Diff for /loncom/interface/slotrequest.pm between versions 1.147 and 1.151

version 1.147, 2023/07/12 15:48:23 version 1.151, 2025/03/31 13:55:06
Line 63  sub start_page { Line 63  sub start_page {
         if ($bread_crumbs_component) {          if ($bread_crumbs_component) {
             $args->{bread_crumbs_component} = $bread_crumbs_component;              $args->{bread_crumbs_component} = $bread_crumbs_component;
         }          }
           if ((($env{'form.requestattempt'}) || ($env{'form.context'} eq 'user')) && 
                ($env{'form.symb'})) {
               $args->{'bread_crumbs_nomenu'} = 1;
           }
     }      }
     if (($env{'form.requestattempt'}) || ($env{'form.command'} eq 'manageresv')) {      if (($env{'form.requestattempt'}) || ($env{'form.command'} eq 'manageresv')) {
         my %loaditems = (          my %loaditems = (
Line 104  sub start_page { Line 108  sub start_page {
   
 sub end_page {  sub end_page {
     my ($r)=@_;      my ($r)=@_;
     $r->print(&Apache::loncommon::end_page());      $r->print('</div>'.&Apache::loncommon::end_page());
 }  }
   
 sub reservation_js {  sub reservation_js {
Line 769  sub release_all_slot { Line 773  sub release_all_slot {
         if (!$result) {          if (!$result) {
             $r->print('<p class="LC_error">'.&mt($msg).'</p>');              $r->print('<p class="LC_error">'.&mt($msg).'</p>');
         } else {          } else {
     $r->print("<p>$msg</p>");      $r->print($msg);
         }          }
  $r->rflush();   $r->rflush();
     }      }
Line 1061  sub release_reservation { Line 1065  sub release_reservation {
             if ($mgr eq 'F') {              if ($mgr eq 'F') {
                 $msg = &mt('Released Reservation for user: [_1]',"$uname:$udom");                  $msg = &mt('Released Reservation for user: [_1]',"$uname:$udom");
             } else {              } else {
                 $msg = '<span style="font-weight: bold;">'.&mt('Released reservation: [_1]',$description).'</span><br /><br />';                  $msg = '<p style="font-weight: bold;">'.
                          &mt('Released reservation: [_1]',$description).'</p>';
                 my $person = &Apache::loncommon::plainname($env{'user.name'},$env{'user.domain'});                  my $person = &Apache::loncommon::plainname($env{'user.name'},$env{'user.domain'});
                 my $subject = &mt('Reservation change: [_1]',$description);                  my $subject = &mt('Reservation change: [_1]',$description);
                 my $msgbody = &mt('Reservation released by [_1] for [_2].',$person,$description);                  my $msgbody = &mt('Reservation released by [_1] for [_2].',$person,$description);
Line 1446  sub show_choices { Line 1451  sub show_choices {
         return;          return;
     }      }
     if (!@{$available}) {      if (!@{$available}) {
         $output = '<span class="LC_info">'.&mt('No available times.').'</span>';          $output = '<p class="LC_info">'.&mt('No available times.').'</p>';
         if ($env{'form.command'} ne 'manageresv') {          if ($env{'form.command'} ne 'manageresv') {
             my $target = &return_target();              my $target = &return_target();
             $output .= ' <a href="/adm/flip?postdata=return:" target="'.$target.'">'.              $output .= ' <a href="/adm/flip?postdata=return:" target="'.$target.'">'.
Line 1457  sub show_choices { Line 1462  sub show_choices {
         } else {          } else {
             return $output;              return $output;
         }          }
       } elsif ($env{'form.command'} ne 'manageresv') {
           my $title = &Apache::lonnet::gettitle($symb);
           my $headertext = &mt('Manage Reservation(s) for [_1]',$title);
           $output .= '<h2 class="LC_heading_3">'.$headertext.'</h2>';
     }      }
     if (@{$available} > 1) {      if (@{$available} > 1) {
         my $numavailable = scalar(@{$available});          my $numavailable = scalar(@{$available});
Line 1473  sub show_choices { Line 1482  sub show_choices {
             }              }
         }          }
         my $showfilter = 'none';          my $showfilter = 'none';
         $output .= '<fieldset><legend>'.&mt('Actions').'</legend>'."\n".          $output .= '<fieldset><legend>'.&mt('Actions').':</legend>'."\n".
                    '<form method="post" name="reservationdisplay_'.$num.                     '<form method="post" name="reservationdisplay_'.$num.
                    '" action="" onsubmit="toggleSlotDisplay(this.form,'."'$num'".');">';                     '" action="" onsubmit="toggleSlotDisplay(this.form,'."'$num'".');">';
         my @options = ('all','filter');          my @options = ('all','filter');
Line 1522  ENDSCRIPT Line 1531  ENDSCRIPT
         $output .=          $output .=
             '<div id="LC_slotfilter_'.$num.'" style="display:'.$showfilter.'">'.              '<div id="LC_slotfilter_'.$num.'" style="display:'.$showfilter.'">'.
             '<form method="post" name="'.$chooserform.'" action="">'.              '<form method="post" name="'.$chooserform.'" action="">'.
             '<table><tr><td>'.&mt('Open after').'</td><td>'.              '<table class="LC_manage_reservations"><tr><th>'.&mt('Open after').'</th><td>'.
             &Apache::lonhtmlcommon::date_setter($chooserform,'start',$starttime,'','','','','','','',1,1).              &Apache::lonhtmlcommon::date_setter($chooserform,'start',$starttime,'','','','','','','',1,1).
             '</td></tr><tr><td>'.&mt('Closed before').'</td><td>'.              '</td></tr><tr><th>'.&mt('Closed before').'</th><td>'.
             &Apache::lonhtmlcommon::date_setter($chooserform,'end',$endtime,'','','','','','','',1,1).              &Apache::lonhtmlcommon::date_setter($chooserform,'end',$endtime,'','','','','','','',1,1).
             '</td></tr></table><br />'.              '</td></tr></table><br />'.
             '<input type="button" name="slotfilter" value="Search for reservable slots" onclick="updateSlotDisplay(this.form,'."'$num'".');" />'.              '<input type="button" name="slotfilter" value="Search for reservable slots" onclick="updateSlotDisplay(this.form,'."'$num'".');" />'.
             '</form></div><div id="LC_slotsearch_'.$num.'" style="display:none"><hr />';              '</form></div><div id="LC_slotsearch_'.$num.'" style="display:none"><hr />';
     }      }
     if ($env{'form.command'} eq 'manageresv') {      if ($env{'form.command'} eq 'manageresv') {
         $output .= '<table border="0">';          $output .= '<table border="0" class="LC_manage_reservations">'.
                      '<tr><th>'.&mt('Action').'</th><th>'.&mt('Name').'</th></tr>';
     } else {      } else {
         $output .= &Apache::loncommon::start_data_table();          $output .= &Apache::loncommon::start_data_table().
                      &Apache::loncommon::start_data_table_header_row().
                      '<th>'.&mt('Action').'</th><th>'.&mt('Name').'</th>'.
                      &Apache::loncommon::end_data_table_header_row();
     }      }
     foreach my $slot (@{$available}) {      foreach my $slot (@{$available}) {
  my $description=&get_description($slot,$slots->{$slot});   my $description=&get_description($slot,$slots->{$slot});
Line 1833  sub show_table { Line 1846  sub show_table {
 <input type="hidden" name="command" value="showslots" />');  <input type="hidden" name="command" value="showslots" />');
     $r->print('<div>');      $r->print('<div>');
     $r->print('<table class="inline">      $r->print('<table class="inline">
       <tr><th>'.&mt('Show').'</th>        <tr><th><label for="show">'.&mt('Show').'</label></th>
           <th>'.&mt('Student Display').'</th>            <th><label for="studisplay">'.&mt('Student Display').'</label></th>
           <th>'.&mt('Open').'</th>            <th><label for="when">'.&mt('Open').'</label></th>
           <th>'.&mt('Slot Name Filter').'</th>            <th><label for="name_filter_type">'.&mt('Slot Name Filter').'</label></th>
           <th>'.&mt('Options').'</th>            <th>'.&mt('Options').'</th>
       </tr>        </tr>
       <tr><td valign="top">'.&Apache::loncommon::multiple_select_form('show',\@show,6,\%show_fields,\@show_order).        <tr><td valign="top">'.&Apache::loncommon::multiple_select_form('show',\@show,6,\%show_fields,\@show_order,'show').
       '</td>        '</td>
            <td valign="top">             <td valign="top">
          '.&Apache::loncommon::multiple_select_form('studisplay',\@stu_display,           '.&Apache::loncommon::multiple_select_form('studisplay',\@stu_display,
     6,\%stu_display_fields,      6,\%stu_display_fields,
     \@stu_display_order).'      \@stu_display_order,'studisplay').'
            </td>             </td>
            <td valign="top">'.&Apache::loncommon::select_form($when,'when',\%when_fields).             <td valign="top">'.&Apache::loncommon::select_form($when,'when',\%when_fields,'','','when').
           '</td>            '</td>
            <td valign="top">'.&Apache::loncommon::select_form($name_filter_type,             <td valign="top"><span class="LC_nobreak">'.&Apache::loncommon::select_form($name_filter_type,
  'name_filter_type',   'name_filter_type',
  \%name_filter_type_fields).   \%name_filter_type_fields,'','','name_filter_type').
       '<br />'.        '&nbsp;'.
       &Apache::lonhtmlcommon::textbox('name_filter_value',        &Apache::lonhtmlcommon::textbox('name_filter_value',
       $env{'form.name_filter_value'},        $env{'form.name_filter_value'},
       15).        15,'aria-label="'.&mt('Name filter').'"').
           '</td>            '</span></td>
            <td valign="top">             <td valign="top">
             <table>               <fieldset class="LC_delete_slot">
               <tr>                <legend>'.&mt('Deleted slots').'</legend>
                 <td rowspan="2">'.&mt('Deleted slots:').'</td>                 <span class="LC_nobreak"><label>'.$show_radio.&mt('Show').'</label>&nbsp;&nbsp;&nbsp;
                 <td><label>'.$show_radio.&mt('Show').'</label></td>                 <label>'.$hide_radio.&mt('Hide').'</label></span>
               </tr>               </fieldset>
               <tr>     </td>
                 <td><label>'.$hide_radio.&mt('Hide').'</label></td>  
               </tr>  
             </table>  
   </td>  
        </tr>         </tr>
     </table>');      </table>');
     $r->print('</div>');      $r->print('</div>');
Line 1874  sub show_table { Line 1883  sub show_table {
     my $linkstart='<a href="/adm/slotrequest?command=showslots&amp;order=';      my $linkstart='<a href="/adm/slotrequest?command=showslots&amp;order=';
     my $tableheader = &Apache::loncommon::start_data_table().      my $tableheader = &Apache::loncommon::start_data_table().
               &Apache::loncommon::start_data_table_header_row().'                &Apache::loncommon::start_data_table_header_row().'
               <th></th>';                <th><span class="LC_visually_hidden">'.&mt('Action').'</span></th>';
     foreach my $which (@show_order) {      foreach my $which (@show_order) {
  if ($which ne 'proctor' && exists($show{$which})) {   if ($which ne 'proctor' && exists($show{$which})) {
     $tableheader .= '<th>'.$linkstart.$which.'">'.$show_fields{$which}.'</a></th>';      $tableheader .= '<th>'.$linkstart.$which.'">'.$show_fields{$which}.'</a></th>';
Line 2041  sub show_table { Line 2050  sub show_table {
         my ($edit,$delete,$showlog,$remove_all);          my ($edit,$delete,$showlog,$remove_all);
         if ($mgr) {          if ($mgr) {
     $edit=(<<"EDITLINK");      $edit=(<<"EDITLINK");
 <a href="/adm/helper/newslot.helper?name=$slot">$lt{'edit'}</a>  <p class="LC_medium_line"><a href="/adm/helper/newslot.helper?name=$slot">$lt{'edit'}</a></p>
 EDITLINK  EDITLINK
   
     $delete=(<<"DELETELINK");      $delete=(<<"DELETELINK");
 <a href="/adm/slotrequest?command=delete&amp;slotname=$slot">$lt{'delete'}</a>  <p class="LC_medium_line"><a href="/adm/slotrequest?command=delete&amp;slotname=$slot">$lt{'delete'}</a></p>
 DELETELINK  DELETELINK
   
             $remove_all=&remove_link($slot,'remove all').'<br />';              $remove_all=&remove_link($slot,'remove all').'<br />';
Line 2058  DELETELINK Line 2067  DELETELINK
         }          }
   
         $showlog=(<<"LOGLINK");          $showlog=(<<"LOGLINK");
 <a href="/adm/slotrequest?command=slotlog&amp;slotname=$slot">$lt{'slotlog'}</a>  <p class="LC_medium_line"><a href="/adm/slotrequest?command=slotlog&amp;slotname=$slot">$lt{'slotlog'}</a></p>
 LOGLINK  LOGLINK
   
  if ($slots{$slot}{'type'} ne 'schedulable_student') {   if ($slots{$slot}{'type'} ne 'schedulable_student') {
Line 2298  sub manage_reservations { Line 2307  sub manage_reservations {
     my $slotheader = '<p>'.      my $slotheader = '<p>'.
                  &mt('Your reservation status for any such assignments is listed below:').                   &mt('Your reservation status for any such assignments is listed below:').
                  '</p>'.                   '</p>'.
                  '<table class="LC_data_table LC_tableOfContent" id="LC_slot_reservations">'."\n";                   '<table class="LC_data_table LC_tableOfContent" id="LC_slot_reservations">'."\n".
                    '<tr class="LC_visually_hidden">'.
                    '<th>'.&mt('Resource or Folder').'</th>'.
                    '<th colspan="2">'.&mt('Reservation Status').'</th></tr>'."\n";
     my $shownheader = 0;      my $shownheader = 0;
     my $currmap;      my $currmap;
     my $it=$navmap->getIterator(undef,undef,undef,1,undef,undef);      my $it=$navmap->getIterator(undef,undef,undef,1,undef,undef);
Line 2332  sub manage_reservations { Line 2344  sub manage_reservations {
                             $arrowstate = 'closed';                              $arrowstate = 'closed';
                         }                          }
                         $row .= '<td>'.$spacers.'<img src="/adm/lonIcons/arrow.'.$arrowstate.'.gif" '.                          $row .= '<td>'.$spacers.'<img src="/adm/lonIcons/arrow.'.$arrowstate.'.gif" '.
                                 'id="arrow'.$mapnum.'" '.'alt="arrow" onmouseover="this.style.cursor=\'pointer\'" '.                                  'id="arrow'.$mapnum.'" '.'alt="arrow" onmouseover="this.style.cursor=\'pointer\'" tabindex="0" '.
                                 'onclick="'."toggleSlotMap('$mapnum','$rownum');".'" />'.                                  'onclick="'."toggleSlotMap('$mapnum','$rownum');".'" onkeydown="'."toggleSlotMap('$mapnum','$rownum');".'" />'.
                                 $icon.('&nbsp;' x6).'</td>'."\n";                                  $icon.('&nbsp;' x6).'</td>'."\n";
                         if (ref($output{$currmap}) eq 'HASH') {                          if (ref($output{$currmap}) eq 'HASH') {
                             my $formnum = $mapnum.'_'.$reservable+1;                              my $formnum = $mapnum.'_'.$reservable+1;
Line 2914  sub display_filter { Line 2926  sub display_filter {
     my ($formname,$cdom,$cnum,$curr,$version,$allsymbs) = @_;      my ($formname,$cdom,$cnum,$curr,$version,$allsymbs) = @_;
     my $nolink = 1;      my $nolink = 1;
     my (%titles,%maptitles);      my (%titles,%maptitles);
     my $output = '<br /><table><tr><td valign="top">'.      my $output = '<br /><table><tr><th class="LC_log_filter">'.
                  '<span class="LC_nobreak"><b>'.&mt('Changes/page:').'</b><br />'.                   '<span class="LC_nobreak"><label for="show">'.&mt('Changes/page:').'</label></span></th>'.
                  &Apache::lonmeta::selectbox('show',$curr->{'show'},'',undef,                   '<th class="LC_log_filter">'.&mt('Window during which changes occurred:').'</th>';
                                               (&mt('all'),5,10,20,50,100,1000,10000)).      if (ref($allsymbs) eq 'ARRAY') {
                  '</td><td>&nbsp;&nbsp;</td>';          $output.= '<th class="LC_log_filter"><label for="resource">'.&mt('Resource').'</label></th>'.
                     '<th class="LC_log_filter"><label for="chgcontext">'.&mt('Context').'</label></th>';
       } else {
           $output.= '<th class="LC_log_filter"><label for="action">'.&mt('Action').'</label></th>';
       }
       $output .= '</tr><tr><td class="LC_log_filter">'.
                  &Apache::lonmeta::selectbox('show',$curr->{'show'},'','show',undef,
                                              (&mt('all'),5,10,20,50,100,1000,10000)).
                  '</td>';
     my $startform =      my $startform =
         &Apache::lonhtmlcommon::date_setter($formname,'log_start_date',          &Apache::lonhtmlcommon::date_setter($formname,'log_start_date',
                                             $curr->{'log_start_date'},undef,                                              $curr->{'log_start_date'},undef,
Line 2929  sub display_filter { Line 2949  sub display_filter {
                                             undef,undef,undef,undef,undef,undef,$nolink);                                              undef,undef,undef,undef,undef,undef,$nolink);
     my $crstype = &Apache::loncommon::course_type();      my $crstype = &Apache::loncommon::course_type();
     my %lt = &reservationlog_contexts($crstype);      my %lt = &reservationlog_contexts($crstype);
     $output .= '<td valign="top"><b>'.&mt('Window during which changes occurred:').      $output .= '<td class="LC_log_filter"><table><tr><th>'.&mt('After:').'</th>'.
                '</b><br /><table><tr><td>'.&mt('After:').                 '<td>'.$startform.'</td></tr>'.
                '</td><td>'.$startform.'</td></tr><tr><td>'.&mt('Before:').'</td><td>'.                 '<tr><th>'.&mt('Before:').'</th>'.
                $endform.'</td></tr></table></td><td>&nbsp;&nbsp;</td>';                 '<td>'.$endform.'</td></tr></table>'.
                  '</td>';
     if (ref($allsymbs) eq 'ARRAY') {      if (ref($allsymbs) eq 'ARRAY') {
         $output .= '<td valign="top"><b>'.&mt('Resource').'</b><br />'.          $output .= '<td class="LC_log_filter"><select name="resource" id="resource"><option value="any"';
                    '<select name="resource"><option value="any"';  
         if ($curr->{'resource'} eq 'any') {          if ($curr->{'resource'} eq 'any') {
             $output .= ' selected="selected"';              $output .= ' selected="selected"';
         }          }
Line 2948  sub display_filter { Line 2968  sub display_filter {
             }              }
             $output .= '  <option value="'.$symb.'"'.$selstr.'>'.$title.'</option>';              $output .= '  <option value="'.$symb.'"'.$selstr.'>'.$title.'</option>';
         }          }
         $output .= '</select></td><td>&nbsp;&nbsp;</td><td valign="top"><b>'.          $output .= '</select></td>'.
                    &mt('Context:').'</b><br /><select name="chgcontext">';                     '<td class="LC_log_filter"><select name="chgcontext" id="chgcontext">';
         foreach my $chgtype ('any','user','manage','parameter') {          foreach my $chgtype ('any','user','manage','parameter') {
             my $selstr = '';              my $selstr = '';
             if ($curr->{'chgcontext'} eq $chgtype) {              if ($curr->{'chgcontext'} eq $chgtype) {
Line 2959  sub display_filter { Line 2979  sub display_filter {
         }          }
         $output .= '</select></td>';          $output .= '</select></td>';
     } else {      } else {
         $output .= '<td valign="top"><b>'.&mt('Action').'</b><br />'.          $output .= '<td class="LC_log_filter"><select name="action" id="action"><option value="any"';
                    '<select name="action"><option value="any"';  
         if ($curr->{'action'} eq 'any') {          if ($curr->{'action'} eq 'any') {
             $output .= ' selected="selected"';              $output .= ' selected="selected"';
         }          }
Line 2974  sub display_filter { Line 2993  sub display_filter {
         }          }
         $output .= '</select></td>';          $output .= '</select></td>';
     }      }
     $output .= '<td>&nbsp;&nbsp;</td></tr></table>'.      $output .= '</tr></table>'.
                '<p><input type="submit" value="'.                 '<p><input type="submit" value="'.
                &mt('Update Display').'" /></p>'.                 &mt('Update Display').'" /></p>'.
                '<p class="LC_info">'.                 '<p class="LC_info">'.
Line 3027  sub upload_start { Line 3046  sub upload_start {
     my ($r)=@_;      my ($r)=@_;
     $r->print(      $r->print(
         &Apache::grades::checkforfile_js()          &Apache::grades::checkforfile_js()
        .'<h2>'.&mt('Upload a file containing the slot definitions').'</h2>'         .'<h2 class="LC_heading_2">'.&mt('Upload a file containing the slot definitions').'</h2>'
        .'<form method="post" enctype="multipart/form-data"'         .'<form method="post" enctype="multipart/form-data"'
        .' action="/adm/slotrequest" name="slotupload">'         .' action="/adm/slotrequest" name="slotupload">'
        .'<input type="hidden" name="command" value="csvuploadmap" />'         .'<input type="hidden" name="command" value="csvuploadmap" />'
        .&Apache::lonhtmlcommon::start_pick_box()         .&Apache::lonhtmlcommon::start_pick_box()
        .&Apache::lonhtmlcommon::row_title(&mt('File'))         .&Apache::lonhtmlcommon::row_title('<label for="upfile">'.&mt('File').'</label>')
        .&Apache::loncommon::upfile_select_html()         .&Apache::loncommon::upfile_select_html()
        .&Apache::lonhtmlcommon::row_closure()         .&Apache::lonhtmlcommon::row_closure()
        .&Apache::lonhtmlcommon::row_title(         .&Apache::lonhtmlcommon::row_title(
Line 3065  sub csvuploadmap_header { Line 3084  sub csvuploadmap_header {
   
     $r->print(      $r->print(
         '<form method="post" enctype="multipart/form-data" action="/adm/slotrequest" name="slotupload">'          '<form method="post" enctype="multipart/form-data" action="/adm/slotrequest" name="slotupload">'
        .'<h2>'.&mt('Identify fields in uploaded list').'</h2>'         .'<h2 class="LC_heading_2">'.&mt('Identify fields in uploaded list').'</h2>'
        .'<div class="LC_columnSection">'         .'<div class="LC_columnSection">'
        .&Apache::loncommon::help_open_topic(         .&Apache::loncommon::help_open_topic(
             'Slot About',&mt('Help on slots'))              'Slot About',&mt('Help on slots'))
Line 3439  sub slot_reservationmsg_options { Line 3458  sub slot_reservationmsg_options {
     return %options;      return %options;
 }  }
   
   sub get_user_breadcrumbs {
       my ($symb) = @_;
       my ($mapurl, $rid, $resurl) = &Apache::lonnet::decode_symb($symb);
       return [] unless (&Apache::lonnet::symbverify($symb,$resurl));
       my $coursetitle = $env{'course.'.$env{'request.course.id'}.'.description'};
       my $maptitle = &Apache::lonnet::gettitle($mapurl);
       my $restitle = &Apache::lonnet::gettitle($symb);
       my $crstype = &Apache::loncommon::course_type();
       my ($ltiscope,$ltiuri);
       my (@crumbs,@mapcrumbs);
       if (($env{'request.course.id'}) && ($env{'request.lti.login'})) {
           ($ltiscope,$ltiuri) =
               &LONCAPA::ltiutils::lti_provider_scope($env{'request.lti.uri'},
                          $env{'course.'.$env{'request.course.id'}.'.domain'},
                          $env{'course.'.$env{'request.course.id'}.'.num'});
       }
       if (($resurl ne '/adm/navmaps') && ($mapurl ne '') &&
           (!(($crstype eq 'Placement') && !$env{'request.role.adv'}))) {
           unless ($ltiscope eq 'resource') {
               if (($mapurl ne $env{'course.'.$env{'request.course.id'}.'.url'}) &&
                   !(($ltiscope eq 'map') && (&Apache::lonnet::clutter($resurl) eq $ltiuri))) {
                   my $navmap = Apache::lonnavmaps::navmap->new();
                   if (ref($navmap)) {
                       @mapcrumbs = $navmap->recursed_crumbs($mapurl,$restitle);
                   }
               }
           }
       }
       unless ((($crstype eq 'Placement') && (!$env{'request.role.adv'})) ||
                ($ltiscope eq 'map') || ($ltiscope eq 'resource')) {
                @crumbs = ({text  => $crstype.' Contents',
                            href  => "javascript:gopost('/adm/navmaps','')"});
       }
       if ($mapurl ne $env{'course.'.$env{'request.course.id'}.'.url'}) {
           if (@mapcrumbs) {
               push(@crumbs,@mapcrumbs);
           } elsif (!(($crstype eq 'Placement') && (!$env{'request.role.adv'})) &&
                    ($ltiscope ne 'map') && ($ltiscope ne 'resource')) {
               push(@crumbs, {text  => '...',
                              no_mt => 1});
           }
       }
       unless ((($crstype eq 'Placement') && (!$env{'request.role.adv'})) || (@mapcrumbs) ||
               (!$maptitle) || ($maptitle eq 'default.sequence') ||
               ($mapurl eq $env{'course.'.$env{'request.course.id'}.'.url'}) ||
               ($ltiscope eq 'resource')) {
           push(@crumbs, {text => $maptitle, no_mt => 1,
                          href => &Apache::lonnet::clutter($mapurl).'?navmap=1'});
       }
       if ($restitle && !@mapcrumbs) {
           push(@crumbs,{text => $restitle, no_mt => 1});
       }
       return \@crumbs;
   }
   
 sub handler {  sub handler {
     my $r=shift;      my $r=shift;
   
Line 3452  sub handler { Line 3526  sub handler {
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'});      &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'});
   
     my %crumb_titles = &slot_command_titles();      my %crumb_titles = &slot_command_titles();
     my ($brcrum,$bread_crumbs_component);      my ($symb,$brcrum,$bread_crumbs_component);
   
     my $vgr=&Apache::lonnet::allowed('vgr',$env{'request.course.id'});      my $vgr=&Apache::lonnet::allowed('vgr',$env{'request.course.id'});
     my $mgr=&Apache::lonnet::allowed('mgr',$env{'request.course.id'});      my $mgr=&Apache::lonnet::allowed('mgr',$env{'request.course.id'});
Line 3482  sub handler { Line 3556  sub handler {
             $title = 'Manage Reservations';              $title = 'Manage Reservations';
             $brcrum =[{href=>"/adm/slotrequest?command=manageresv",text=>$title}];              $brcrum =[{href=>"/adm/slotrequest?command=manageresv",text=>$title}];
         }          }
           if ($env{'form.requestattempt'}) {
               $symb=&unescape($env{'form.symb'});
               if ($symb) {
                   $brcrum = &get_user_breadcrumbs($symb);
               }
           }
         my ($cnum,$cdom)=&get_course();          my ($cnum,$cdom)=&get_course();
         %slots = &Apache::lonnet::get_course_slots($cnum,$cdom);          %slots = &Apache::lonnet::get_course_slots($cnum,$cdom);
         $consumed_uniqueperiods = &get_consumed_uniqueperiods(\%slots);          $consumed_uniqueperiods = &get_consumed_uniqueperiods(\%slots);
Line 3501  sub handler { Line 3581  sub handler {
     } elsif ($env{'form.command'} eq 'release') {      } elsif ($env{'form.command'} eq 'release') {
         if ($env{'form.context'} eq 'usermanage') {          if ($env{'form.context'} eq 'usermanage') {
             $brcrum =[{href=>"/adm/slotrequest?command=manageresv",              $brcrum =[{href=>"/adm/slotrequest?command=manageresv",
                        text=>$crumb_titles{'showslots'}}];                         text=>$crumb_titles{'manageresv'}}];
             $title = 'Manage Reservations';              $title = 'Manage Reservations';
             if (ref($brcrum) eq 'ARRAY') {              if (ref($brcrum) eq 'ARRAY') {
                 push(@{$brcrum},{href=>"/adm/slotrequest?command=$env{'form.command'}",text=>$crumb_titles{$env{'form.command'}}});                  push(@{$brcrum},{href=>"/adm/slotrequest?command=$env{'form.command'}",text=>$crumb_titles{$env{'form.command'}}});
             }              }
           } elsif ($env{'form.context'} eq 'user') {
                if ($env{'form.symb'}) {
                    $symb=&unescape($env{'form.symb'});
                    $brcrum = &get_user_breadcrumbs($symb);
                } else {
                    $brcrum =[];
                }
           }
       } elsif (($env{'form.command'} eq 'get') && ($env{'form.context'} eq 'user')) {
           if ($env{'form.symb'}) {
               $symb=&unescape($env{'form.symb'});
               $brcrum = &get_user_breadcrumbs($symb);
           } else {
               $brcrum =[];
         }          }
     } else {      } else {
         $brcrum =[];          $brcrum =[];
     }      }
     my ($symb,$js,$available,$allavailable,$got_slots);      my ($js,$available,$allavailable,$got_slots);
     $available = [];      $available = [];
     if ($env{'form.requestattempt'}) {      if ($env{'form.requestattempt'}) {
         $symb=&unescape($env{'form.symb'});  
         @{$got_slots}=&check_for_reservation($symb,'allslots');          @{$got_slots}=&check_for_reservation($symb,'allslots');
     }      }
     if (($env{'form.requestattempt'}) || ($env{'form.command'} eq 'manageresv')) {      if (($env{'form.requestattempt'}) || ($env{'form.command'} eq 'manageresv')) {
         $js = &reservation_js(\%slots,$consumed_uniqueperiods,$available,$got_slots,$symb);          $js = &reservation_js(\%slots,$consumed_uniqueperiods,$available,$got_slots,$symb);
     }      }
     &start_page($r,$title,$brcrum,$bread_crumbs_component,$js,$mgr);      &start_page($r,$title,$brcrum,$bread_crumbs_component,$js,$mgr);
       $r->print('<div class="LC_landmark" role="main">'."\n");
   
     if ($env{'form.command'} eq 'manageresv') {      if ($env{'form.command'} eq 'manageresv') {
         $allavailable = $available;          $allavailable = $available;
Line 3559  sub handler { Line 3653  sub handler {
     } elsif (($env{'form.command'} eq 'slotlog') && ($vgr eq 'F')) {      } elsif (($env{'form.command'} eq 'slotlog') && ($vgr eq 'F')) {
         &show_reservations_log($r);          &show_reservations_log($r);
     } else {      } else {
  my $symb=&unescape($env{'form.symb'});   $symb = &unescape($env{'form.symb'});
  if (!defined($symb)) {   if (!defined($symb)) {
     &fail($r,'not_valid');      &fail($r,'not_valid');
     return OK;      return OK;
Line 3584  sub handler { Line 3678  sub handler {
     return OK;      return OK;
  }   }
  if ($env{'form.requestattempt'}) {   if ($env{'form.requestattempt'}) {
             $r->print('<div class="LC_left_float">');               $r->print('<div class="LC_left_float">'.
     $r->print(&show_choices($symb,undef,undef,undef,\%slots,$consumed_uniqueperiods,$available,$got_slots));                &show_choices($symb,undef,0,undef,\%slots,$consumed_uniqueperiods,$available,$got_slots).
             $r->print('</div><div style="padding:0;clear:both;margin:0;border:0"></div>');                        '</div><div style="padding:0;clear:both;margin:0;border:0"></div>');
  } elsif ($env{'form.command'} eq 'release') {   } elsif ($env{'form.command'} eq 'release') {
     &release_slot($r,$symb);      &release_slot($r,$symb);
  } elsif ($env{'form.command'} eq 'get') {   } elsif ($env{'form.command'} eq 'get') {

Removed from v.1.147  
changed lines
  Added in v.1.151


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>