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

raeburn raeburn at source.lon-capa.org
Mon Jan 18 16:46:09 EST 2021


raeburn		Mon Jan 18 21:46:09 2021 EDT

  Modified files:              
    /loncom/interface	slotrequest.pm 
  Log:
  - For users with 'vgr' priv include 'Slots' help item at right of header row
    on 'Manage Slots' page. Help icon to right of 'Create Slot' button now 
    points to 'Slot_About' help item in place of 'Slot AddInterface' help item.  
  
  
Index: loncom/interface/slotrequest.pm
diff -u loncom/interface/slotrequest.pm:1.142 loncom/interface/slotrequest.pm:1.143
--- loncom/interface/slotrequest.pm:1.142	Sun Jul  7 22:06:04 2019
+++ loncom/interface/slotrequest.pm	Mon Jan 18 21:46:09 2021
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler for requesting to have slots added to a students record
 #
-# $Id: slotrequest.pm,v 1.142 2019/07/07 22:06:04 raeburn Exp $
+# $Id: slotrequest.pm,v 1.143 2021/01/18 21:46:09 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -56,10 +56,13 @@
 }
 
 sub start_page {
-    my ($r,$title,$brcrum,$js)=@_;
+    my ($r,$title,$brcrum,$bread_crumbs_component,$js)=@_;
     my $args;
     if (ref($brcrum) eq 'ARRAY') {
         $args = {bread_crumbs => $brcrum};
+        if ($bread_crumbs_component) {    
+            $args->{bread_crumbs_component} = $bread_crumbs_component;    
+        }
     }
     if (($env{'form.requestattempt'}) || ($env{'form.command'} eq 'manageresv')) {
         my %loaditems = (
@@ -1663,10 +1666,6 @@
     } 
     my $available;
     if ($mgr eq 'F') {
-    # FIXME: This line should be deleted once Slots uses breadcrumbs
-    $r->print('<br />'.&Apache::loncommon::help_open_topic(
-        'Slot About', &mt('Help on slots')));
-
 	$r->print('<div>');
 	$r->print('<form method="post" action="/adm/slotrequest">
 <input type="hidden" name="command" value="uploadstart" />
@@ -1676,7 +1675,7 @@
 	$r->print('<form method="post" action="/adm/helper/newslot.helper">
 <input type="submit" name="newslot" value="'.&mt('Create a New Slot').'" />
 </form>');
-	$r->print(&Apache::loncommon::help_open_topic('Slot AddInterface'));
+	$r->print(&Apache::loncommon::help_open_topic('Slot About'));
 	$r->print('</div>');
     }
 
@@ -3300,6 +3299,9 @@
 			 'secret','symb') {
 	    if ($entries{$fields{$key}}) {
 		$slot{$key}=$entries{$fields{$key}};
+                if ($key eq 'maxspace') {
+                    $slot{$key} =~ s/\D+//g;
+                }
 	    }
 	}
         if ($entries{$fields{'iptied'}} =~ /^\s*(yes|1)\s*$/i) {
@@ -3407,7 +3409,7 @@
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'});
 
     my %crumb_titles = &slot_command_titles();
-    my $brcrum;
+    my ($brcrum,$bread_crumbs_component);
 
     my $vgr=&Apache::lonnet::allowed('vgr',$env{'request.course.id'});
     my $mgr=&Apache::lonnet::allowed('mgr',$env{'request.course.id'});
@@ -3443,8 +3445,10 @@
     } elsif ($vgr eq 'F') {
         if ($env{'form.command'} =~ /^(slotlog|showslots|uploadstart|csvuploadmap|csvuploadassign|delete|release|remove_registration)$/) {
             $brcrum =[{href=>"/adm/slotrequest?command=showslots",
-                       text=>$crumb_titles{'showslots'}}];
+                       text=>$crumb_titles{'showslots'},
+                       help=>'Slot_Use'}];
 	    $title = 'Managing Slots';
+            $bread_crumbs_component = 'Slots';
             unless ($env{'form.command'} eq 'showslots') {
                 if (ref($brcrum) eq 'ARRAY') {
                     push(@{$brcrum},{href=>"/adm/slotrequest?command=$env{'form.command'}",text=>$crumb_titles{$env{'form.command'}}});
@@ -3472,7 +3476,7 @@
     if (($env{'form.requestattempt'}) || ($env{'form.command'} eq 'manageresv')) {
         $js = &reservation_js(\%slots,$consumed_uniqueperiods,$available,$got_slots,$symb);
     }
-    &start_page($r,$title,$brcrum,$js);
+    &start_page($r,$title,$brcrum,$bread_crumbs_component,$js);
 
     if ($env{'form.command'} eq 'manageresv') {
         $allavailable = $available;




More information about the LON-CAPA-cvs mailing list