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

foxr lon-capa-cvs@mail.lon-capa.org
Wed, 17 May 2006 09:51:26 -0000


foxr		Wed May 17 05:51:26 2006 EDT

  Modified files:              
    /loncom/interface	lonmsgdisplay.pm 
  Log:
  Removed old style student prompting.
  
  
Index: loncom/interface/lonmsgdisplay.pm
diff -u loncom/interface/lonmsgdisplay.pm:1.25 loncom/interface/lonmsgdisplay.pm:1.26
--- loncom/interface/lonmsgdisplay.pm:1.25	Wed May 17 05:46:01 2006
+++ loncom/interface/lonmsgdisplay.pm	Wed May 17 05:51:26 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging display
 #
-# $Id: lonmsgdisplay.pm,v 1.25 2006/05/17 09:46:01 foxr Exp $
+# $Id: lonmsgdisplay.pm,v 1.26 2006/05/17 09:51:26 foxr Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -277,137 +277,6 @@
     return $result;
 }
 
-# --------------------------------- No longer needed ..old display course list.
-sub discourse_obsolete {
-    my $r=shift;
-    my ($classlist,$keylist) = &Apache::loncoursedata::get_classlist();
-    my ($classgroups,$studentgroups) = 
-	&Apache::loncoursedata::get_group_memberships($classlist,$keylist);
-    my %lt=&Apache::lonlocal::texthash('cfa' => 'Check All',
-            'cfs' => 'Check Section/Group',
-            'cfn' => 'Uncheck All');
-    if (defined($env{'form.group'})) {
-        $r->print('<input type="hidden" name="group" value="'.
-                  $env{'form.group'}.'" />'."\n");
-    }
-    $r->print(<<ENDDISHEADER);
-<input type="hidden" name="sendmode" value="group" />
-<script pe="text/javascript">
-    function checkall() {
-	for (i=0; i<document.forms.compemail.elements.length; i++) {
-            if 
-          (document.forms.compemail.elements[i].name.indexOf('send_to_')==0) {
-	      document.forms.compemail.elements[i].checked=true;
-            }
-        }
-    }
-
-    function checksec() {
-	for (i=0; i<document.forms.compemail.elements.length; i++) {
-            if 
-          (document.forms.compemail.elements[i].name.indexOf
-           ('send_to_&&&'+document.forms.compemail.chksec.value+'&&&')==0) {
-	      document.forms.compemail.elements[i].checked=true;
-            }
-            if
-          (document.forms.compemail.elements[i].name.indexOf
-           ('group_&&&'+document.forms.compemail.chksec.value+'&&&_')==0) {
-              var count = i - document.forms.compemail.elements[i].value;
-              document.forms.compemail.elements[count].checked=true;
-            }
-        }
-    }
-
-    function uncheckall() {
-	for (i=0; i<document.forms.compemail.elements.length; i++) {
-            if 
-          (document.forms.compemail.elements[i].name.indexOf('send_to_')==0) {
-	      document.forms.compemail.elements[i].checked=false;
-            }
-        }
-    }
-</script>
-<input type="button" onClick="checkall()" value="$lt{'cfa'}" />&nbsp;
-<input type="button" onClick="checksec()" value="$lt{'cfs'}" />
-<input type="text" size="15" name="chksec" value="$env{'form.group'}" />&nbsp;
-<input type="button" onClick="uncheckall()" value="$lt{'cfn'}" />
-<p>
-ENDDISHEADER
-    my %coursepersonnel=&Apache::lonnet::get_course_adv_roles();
-    $r->print(&Apache::loncommon::start_data_table());
-    if (keys(%coursepersonnel) > 0) {
-        $r->print('<h3>Non-students</h3>');
-        $r->print(&Apache::loncommon::start_data_table());
-        $r->print('<tr><th>Name</th><th>Username:Domain</th><th>Role</th></tr>');
-        foreach my $role (sort(keys(%coursepersonnel))) {
-            foreach my $user (split(/\,/,$coursepersonnel{$role})) {
-                my ($puname,$pudom)=split(/\:/,$user);
-                $r->print(&Apache::loncommon::start_data_table_row());
-                $r->print('<td><label>'.
-                          '<input type="checkbox" name="send_to_&&&&&&_'.
-                          $puname.':'.$pudom.'" /> '.
-                          &Apache::loncommon::plainname($puname,$pudom).
-                          '</label></td>'.
-                          '<td>('.$user.'),</td><td><i>'.$role.'</i></td>');
-                $r->print(&Apache::loncommon::end_data_table_row());
-            }
-        }
-        $r->print(&Apache::loncommon::end_data_table());
-    }
-    if (keys(%{$classlist}) > 0) {
-        $r->print('<h3>Students</h3>');
-        $r->print(&Apache::loncommon::start_data_table());
-        $r->print('<tr><th>Name</th><th>Username:Domain</th><th>Section</th><th>Groups</th></tr>');
-        my $sort = sub {
-	    my $aname=lc($classlist->{$a}[&Apache::loncoursedata::CL_FULLNAME()]);
-	    if (!$aname) { $aname=$a; }
-	    my $bname=lc($classlist->{$b}[&Apache::loncoursedata::CL_FULLNAME()]);
-	    if (!$bname) { $bname=$b; }
-	    return $aname cmp $bname;
-        };
-        foreach my $student (sort $sort (keys(%{$classlist}))) {
-	    my $info=$classlist->{$student};
-            my ($sname,$sdom,$status,$fullname,$section) =
-                (@{$info}[&Apache::loncoursedata::CL_SNAME(),
-                          &Apache::loncoursedata::CL_SDOM(),
-                          &Apache::loncoursedata::CL_STATUS(),
-                          &Apache::loncoursedata::CL_FULLNAME(),
-                          &Apache::loncoursedata::CL_SECTION()]);
-            next if ($status ne 'Active');
-	    next if ($env{'request.course.sec'} &&
-		     $section ne $env{'request.course.sec'});
-            my @studentsgroups = 
-		&Apache::loncoursedata::get_students_groups($student,$status,
-							    $classgroups);
-            my $grouplist = join(', ',@studentsgroups);
-            my $key = 'send_to_&&&'.$section.'&&&_'.$student;
-            if (! defined($fullname) || $fullname eq '') {$fullname = $sname;}
-            my $checked = '';
-            my $groupcount = 0;
-            my $groupitems;
-            $r->print(&Apache::loncommon::start_data_table_row());
-            $r->print('<td><label>');
-            foreach my $group (@studentsgroups) {
-                $groupcount ++;
-                $groupitems .= ('<input type="hidden" name="group_&&&'.
-                                $group.'&&&_'.$student.'" value="'.
-                                $groupcount.'" />');
-                if (defined($env{'form.group'})) {
-                    if ($env{'form.group'} eq $group) {
-                        $checked = 'checked="checked"';
-                    }
-                }
-            }
-            $r->print(qq{<input type="checkbox" name="$key" $checked />}.
-                      ('&nbsp;'x2).$fullname.'</label>'.$groupitems.
-                      '</td><td>'.$sname.':'.$sdom.'</td><td>'.$section.
-                      '</td><td>'.$grouplist.'</td>');
-            $r->print(&Apache::loncommon::end_data_table_row());
-        }
-        $r->print(&Apache::loncommon::end_data_table());
-    }
-}
-
 # ==================================================== Display Critical Message
 
 sub discrit {