Diff for /loncom/interface/lonrequestcourse.pm between versions 1.64 and 1.65

version 1.64, 2012/08/14 15:45:06 version 1.65, 2012/08/15 14:37:13
Line 147  sub handler { Line 147  sub handler {
         }          }
     }      }
   
       if (($action eq 'new') && (&Apache::loncoursequeueadmin::author_prompt())) {
           if (ref($states{$action}) eq 'ARRAY') {
               push(@{$states{$action}},'reqauthor');
           }
       }
   
     foreach my $key (keys(%states)) {      foreach my $key (keys(%states)) {
         if (ref($states{$key}) eq 'ARRAY') {          if (ref($states{$key}) eq 'ARRAY') {
             unshift (@{$states{$key}},'crstype');              unshift (@{$states{$key}},'crstype');
Line 162  sub handler { Line 168  sub handler {
                  personnel     => 'Personnel',                   personnel     => 'Personnel',
                  review        => 'Review',                   review        => 'Review',
                  process       => 'Result',                   process       => 'Result',
                    reqauthor     => 'Authoring Space Result',
                  pick_request  => 'Display Summary',                   pick_request  => 'Display Summary',
                  details       => 'Request Details',                   details       => 'Request Details',
                  cancel        => 'Cancel Request',                   cancel        => 'Cancel Request',
Line 439  sub get_breadcrumbs { Line 446  sub get_breadcrumbs {
                     $crumb = &Apache::lonhtmlcommon::breadcrumbs('Course/Community Requests','Course_Requests');                      $crumb = &Apache::lonhtmlcommon::breadcrumbs('Course/Community Requests','Course_Requests');
                     last;                      last;
                 } else {                  } else {
                     if (($$state eq 'process') || ($$state eq 'removal')) {                      if (($$state eq 'process') || ($$state eq 'removal') || ($$state eq 'reqauthor')) {
                         &Apache::lonhtmlcommon::add_breadcrumb(                          &Apache::lonhtmlcommon::add_breadcrumb(
                             { href => '/adm/requestcourse',                              { href => '/adm/requestcourse',
                               text => "$trail->{$states->{$action}[$i]}",                                text => "$trail->{$states->{$action}[$i]}",
Line 1444  sub print_request_form { Line 1451  sub print_request_form {
                                                            \@code_order);                                                             \@code_order);
         $r->print($result);          $r->print($result);
         if (($storeresult eq 'ok') || ($storeresult eq 'created')) {          if (($storeresult eq 'ok') || ($storeresult eq 'created')) {
             $r->print('<p>');  
             if ($storeresult eq 'ok') {              if ($storeresult eq 'ok') {
                 $r->print('<a href="/adm/requestcourse?action=view&state=details&showdom='.$dom.'&cnum='. $env{'form.cnum'}.'">'.                  $r->print('<p><a href="/adm/requestcourse?action=view&state=details&showdom='.$dom.'&cnum='. $env{'form.cnum'}.'">'.
                           &mt('Modify this request').'</a>'.('&nbsp;'x4));                            &mt('Modify this request').'</a>'.('&nbsp;'x4).
                             '<a href="/adm/requestcourse">'.&mt('Make another request').'</a></p>');
               }
               if (&Apache::loncoursequeueadmin::author_prompt()) {
                   $r->print('<h3>'.&mt('Access to authoring space').'</h3>'.
                             '<p>'.
                             &mt('Although assessment items can be created directly inside a course, such items only use part of the assessment capabilities of LON-CAPA.').
                             '<br />'.
                             &mt('By contrast, items created in authoring space, then imported into a course, can use all of the features of the assessment engine.').'</p>'.
                             '<p>'.&mt('Request authoring space access now?').
                             '<span class="LC_nobreak">&nbsp;'.
                             '<label><input type="radio" name="requestauthor" value="1" />'.&mt('Yes').'</label>'.
                             ('&nbsp;'x2).
                             '<label><input type="radio" name="requestauthor" value="0" checked="checked"/>'.&mt('No').'</label>'.
                             '</span></p>'.
                             '<input type="submit" name="newauthor" value="'.&mt('Submit authoring request').'" />'.
                             '<input type="hidden" name="state" value="reqauthor" />'.
                             '<input type="hidden" name="action" value="'.$env{'form.action'}.'" />'.
                             '<input type="hidden" name="cnum" value="'.$env{'form.cnum'}.'" />'.
                             '<input type="hidden" name="showdom" value="'.$env{'form.showdom'}.'" />'.
                             '<input type="hidden" name="crstype" value="'.$env{'form.crstype'}.'" />'.
                             '<input type="hidden" name="disposition" value="'.$storeresult.'" />'.
                             '<br />');
               } elsif ($storeresult eq 'created') {
                   $r->print('<p><a href="/adm/requestcourse">'.&mt('Make another request').'</a></p>');
               }
           }
       } elsif ($state eq 'reqauthor') {
           my ($result,@links); 
           if ($env{'form.requestauthor'}) {
               $r->print(&Apache::loncoursequeueadmin::process_reqauthor(\$result));
               if ($result eq 'created') {
                   my $role = 'au';
                   my $spec = "$role./$env{'form.showdom'}/";
                   push(@links,&mt('Enter your authoring space with role: [_1]',
                                   '<a href="/adm/roles?selectrole=1&amp;'.$spec.'=1">'.
                                   &Apache::lonnet::plaintext($role).'</a>'));
               }
           }
           if (($env{'form.disposition'} eq 'created') &&
               ($env{'form.cnum'} =~ /^$match_courseid$/) &&
               ($env{'form.showdom'} =~ /^$match_domain$/)) {
               my ($spec,$area,$role,$type);
               my $role = 'cc';
               my $spec = "$role./$env{'form.showdom'}/$env{'form.cnum'}";
               my $type = 'Course';
               if ($env{'form.crstype'} eq 'community') {
                   $type = 'Community';
             }              }
             $r->print('<a href="/adm/requestcourse">'.&mt('Make another request').'</a></p>');              my $showrole = &Apache::lonnet::plaintext($role,$type);
             return;              unshift(@links,&mt('Enter new course with role: [_1]',
                                  '<a href="/adm/roles?selectrole=1&amp;'.$spec.'=1">'.$showrole.'</a>'));
           }
           if (@links > 1) {
               $r->print(&mt('New roles will be listed on your [_1]Roles[_2] page.',
                             '<a href="/adm/roles">','</a>').'&nbsp'.&mt('Choose a role:').
                          '<ul>');
               foreach my $link (@links) {
                   $r->print('<li>'.$link.'</li>');
               }
               $r->print('</ul>');
           } elsif (@links == 1) {
               $r->print('<p>'.$links[0].'</p>');
         }          }
     }      }
     my @excluded = &get_excluded_elements($dom,$states,$action,$state);      my @excluded = &get_excluded_elements($dom,$states,$action,$state);
Line 1480  sub print_request_form { Line 1545  sub print_request_form {
                 $count ++;                  $count ++;
             }              }
             $env{'form.persontotal'} = $count;              $env{'form.persontotal'} = $count;
                
         }          }
     }      }
     if ($state eq 'enrollment') {      if ($state eq 'enrollment') {
         push(@excluded,('sectotal','crosslisttotal'));          push(@excluded,('sectotal','crosslisttotal'));
     }      }
     $r->print(&Apache::lonhtmlcommon::echo_form_input(\@excluded).'</form>');      if (($state eq 'process') || ($state eq 'reqauthor')) {
     &display_navbuttons($r,$dom,$formname,$prev,$navtxt{'prev'},$next,          $r->print('</form>');
                         $navtxt{'next'},$state);      } else {
           $r->print(&Apache::lonhtmlcommon::echo_form_input(\@excluded).'</form>');
           &display_navbuttons($r,$dom,$formname,$prev,$navtxt{'prev'},$next,
                               $navtxt{'next'},$state);
       }
     return;      return;
 }  }
   

Removed from v.1.64  
changed lines
  Added in v.1.65


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