[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm

raeburn raeburn@source.lon-capa.org
Mon, 08 Dec 2008 22:43:52 -0000


raeburn		Mon Dec  8 22:43:52 2008 EDT

  Modified files:              
    /loncom/interface	loncommon.pm 
  Log:
  - Side effect of changes for bug 5839. DCs can set defaults for availability of User Tools (About Me, Portfolio, Blog) to users in a domain.
  - Storage of default portfolio quota will now be in a hash in $quotas{'defaultquota'}, instead of in top level hash in $quotas in configuration.db
    - backwards compatibility maintained.
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.710 loncom/interface/loncommon.pm:1.711
--- loncom/interface/loncommon.pm:1.710	Mon Dec  8 18:25:07 2008
+++ loncom/interface/loncommon.pm	Mon Dec  8 22:43:52 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.710 2008/12/08 18:25:07 bisitz Exp $
+# $Id: loncommon.pm,v 1.711 2008/12/08 22:43:52 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -4697,6 +4697,11 @@
   background-color: $data_table_head;
   font-size:90%;
 }
+table.LC_data_table tr.LC_info_row > td {
+  background-color: #CCC;
+  font-weight: bold;
+  text-align: left;
+}
 table.LC_data_table tr.LC_odd_row > td, 
 table.LC_pick_box tr > td.LC_odd_row,
 table.LC_aboutme_port tr td {
@@ -6764,19 +6769,35 @@
         if ($inststatus ne '') {
             my @statuses = split(/:/,$inststatus);
             foreach my $item (@statuses) {
-                if ($quotahash{'quotas'}{$item} ne '') {
-                    if ($defquota eq '') {
-                        $defquota = $quotahash{'quotas'}{$item};
-                        $settingstatus = $item;
-                    } elsif ($quotahash{'quotas'}{$item} > $defquota) {
-                        $defquota = $quotahash{'quotas'}{$item};
-                        $settingstatus = $item;
+                if (ref($quotahash{'quotas'}{'defaultquota'}) eq 'HASH') {
+                    if ($quotahash{'quotas'}{'defaultquota'}{$item} ne '') {
+                        if ($defquota eq '') {
+                            $defquota = $quotahash{'quotas'}{'defaultquota'}{$item};
+                            $settingstatus = $item;
+                        } elsif ($quotahash{'quotas'}{'defaultquota'}{$item} > $defquota) {
+                            $defquota = $quotahash{'quotas'}{'defaultquota'}{$item};
+                            $settingstatus = $item;
+                        }
+                    }
+                } else {
+                    if ($quotahash{'quotas'}{$item} ne '') {
+                        if ($defquota eq '') {
+                            $defquota = $quotahash{'quotas'}{$item};
+                            $settingstatus = $item;
+                        } elsif ($quotahash{'quotas'}{$item} > $defquota) {
+                            $defquota = $quotahash{'quotas'}{$item};
+                            $settingstatus = $item;
+                        }
                     }
                 }
             }
         }
         if ($defquota eq '') {
-            $defquota = $quotahash{'quotas'}{'default'};
+            if (ref($quotahash{'quotas'}{'defaultquota'}) eq 'HASH') {
+                $defquota = $quotahash{'quotas'}{'defaultquota'}{'default'};
+            } else {
+                $defquota = $quotahash{'quotas'}{'default'};
+            }
             $settingstatus = 'default';
         }
     } else {