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

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 25 May 2006 22:40:00 -0000


albertel		Thu May 25 18:40:00 2006 EDT

  Modified files:              
    /loncom/interface	loncoursegroups.pm 
  Log:
  - styleploice
  
  
Index: loncom/interface/loncoursegroups.pm
diff -u loncom/interface/loncoursegroups.pm:1.21 loncom/interface/loncoursegroups.pm:1.22
--- loncom/interface/loncoursegroups.pm:1.21	Mon May 22 18:35:46 2006
+++ loncom/interface/loncoursegroups.pm	Thu May 25 18:39:59 2006
@@ -397,71 +397,90 @@
         }
     }
 
-    my %toolprivs = ();
-    %{$toolprivs{'email'}} = (
-                                 sgm => 'Send group mail',
-                                 sgb => 'Broadcast mail',
-                             );
-    %{$toolprivs{'discussion'}} =  (
-                                     cgb => 'Create boards',
-                                     pgd => 'Post',
-                                     pag => 'Anon. posts',
-                                     rgi => 'Get identities', 
-                                     vgb => 'View boards',
-                                   );
-    %{$toolprivs{'chat'}} =  (
-                                pgc => 'Chat',
-                             );
-    %{$toolprivs{'files'}} =  (
-                                 rgf => 'Retrieve',
-                                 ugf => 'Upload',
-                                 dgf => 'Delete',
-                              );
-    %{$toolprivs{'roster'}} = (
-                                 vgm => 'View',
-                              );
-    %{$toolprivs{'homepage'}} = (
-                                vgh => 'View page',
-                                mgh => 'Modify page',
-                              );
-    my %fixedprivs = ();
-    %{$fixedprivs{'email'}} = ('sgm' => 1);
-    %{$fixedprivs{'discussion'}} = ('vgb' => 1);
-    %{$fixedprivs{'chat'}} = ('pgc' => 1);
-    %{$fixedprivs{'files'}} = ('rgf' => 1);
-    %{$fixedprivs{'roster'}} = ('vgm' => 1);
-    %{$fixedprivs{'homepage'}} = ('vgh' => 1);
-
-    my %elements = ();
-    %{$elements{'create'}} = ();
-    %{$elements{'modify'}} = ();
-    %{$elements{'create'}{'pick_name'}} = (
-        startdate_month => 'selectbox',
-        startdate_hour => 'selectbox',
-        enddate_month => 'selectbox',
-        enddate_hour => 'selectbox',
-        startdate_day => 'text',
-        startdate_year => 'text',
-        startdate_minute => 'text',
-        startdate_second => 'text',
-        enddate_day => 'text',
-        enddate_year => 'text',
-        enddate_minute => 'text',
-        enddate_second => 'text',
-        groupname => 'text',
-        description => 'text',
-        tool => 'checkbox',
-        granularity => 'radio',
-        no_end_date => 'checkbox',
-    );
-    %{$elements{'modify'}{'change_settings'}} = (
-                                   %{$elements{'create'}{'pick_name'}},
-                                                specificity => 'radio',
-                                                defpriv => 'checkbox',
-                                                autorole => 'checkbox',
-                                                autoadd => 'radio',
-                                                autodrop => 'radio',
-                                   );
+    my %toolprivs =
+	(
+	 email      => {
+	     sgm => 'Send group mail',
+	     sgb => 'Broadcast mail',
+	 },
+	 discussion => {
+	     cgb => 'Create boards',
+	     pgd => 'Post',
+	     pag => 'Anon. posts',
+	     rgi => 'Get identities', 
+	     vgb => 'View boards',
+	 },
+	 chat       => {
+	     pgc => 'Chat',
+	 },
+	 files      => {
+	     rgf => 'Retrieve',
+	     ugf => 'Upload',
+	     dgf => 'Delete',
+	 },
+	 roster     => {
+	     vgm => 'View',
+	 },
+	 homepage   => {
+	     vgh => 'View page',
+	     mgh => 'Modify page',
+	 },
+	 );
+
+    my %fixedprivs = 
+	(
+	 email      => {sgm => 1},
+	 discussion => {vgb => 1},
+	 chat       => {pgc => 1},
+	 files      => {rgf => 1},
+	 roster     => {vgm => 1},
+	 homepage   => {vgh => 1},
+	 );
+
+    my %elements = 
+	(
+	 create => {
+	     pick_name => {
+		 startdate_month  => 'selectbox',
+		 startdate_hour   => 'selectbox',
+		 enddate_month    => 'selectbox',
+		 enddate_hour     => 'selectbox',
+		 startdate_day    => 'text',
+		 startdate_year   => 'text',
+		 startdate_minute => 'text',
+		 startdate_second => 'text',
+		 enddate_day      => 'text',
+		 enddate_year     => 'text',
+		 enddate_minute   => 'text',
+		 enddate_second   => 'text',
+		 groupname        => 'text',
+		 description      => 'text',
+		 tool             => 'checkbox',
+		 granularity      => 'radio',
+		 no_end_date      => 'checkbox',
+	     },
+	     pick_members => {
+		 member          => 'checkbox',
+		 defpriv         => 'checkbox',
+	     },
+	 },
+	 );
+    
+    $elements{'modify'} = {
+	change_settings => {
+	    %{$elements{'create'}{'pick_name'}},
+	    specificity => 'radio',
+	    defpriv     => 'checkbox',
+	    autorole    => 'checkbox',
+	    autoadd     => 'radio',
+	    autodrop    => 'radio',
+	},
+	add_members => {
+	    types       => 'selectbox',
+	    roles       => 'selectbox',
+	},
+    };
+
     if (ref($stored{'autorole'}) eq 'ARRAY') {
         foreach my $role (@{$stored{'autorole'}}) {
             unless ($role eq 'cc') {
@@ -470,15 +489,6 @@
             }
         }
     }
-    %{$elements{'create'}{'pick_members'}} = (
-        member => 'checkbox',
-        defpriv => 'checkbox',
-    );
-
-    %{$elements{'modify'}{'add_members'}} = (
-        types => 'selectbox',
-        roles => 'selectbox',
-    );
 
     if (($action eq 'create') && ($state eq 'pick_name')) {
         $elements{'create'}{'pick_name'}{'types'} = 'selectbox';
@@ -2114,11 +2124,14 @@
                 my($end,$start,@userprivs) = split(/:/,$membership{$key});
                 unless ($start == -1) {
                     $allnames{$udom}{$uname} = 1;
-                    %{$current{$user}} = ();
-                    $current{$user}{uname} = $uname;
-                    $current{$user}{udom} = $udom;
-                    $current{$user}{start} = 
-                                     &Apache::lonlocal::locallocaltime($start);
+                    $current{$user} = {
+			uname     => $uname,
+			udom      => $udom,
+			start     => &Apache::lonlocal::locallocaltime($start),
+			currtools => [];
+			newtools  => [];
+		    };
+
                     if ($end == 0) {
                         $current{$user}{end} =  'No end date';
                     } else {
@@ -2136,8 +2149,6 @@
                         $current{$user}{changestate} = 'expire';
                         $num_expire ++;
                     }
-                    @{$current{$user}{currtools}} = ();
-                    @{$current{$user}{newtools}} = ();
                     if (@userprivs > 0) {
                         foreach my $tool (sort(keys(%{$fixedprivs}))) {
                             foreach my $priv (keys(%{$$fixedprivs{$tool}})) {