Diff for /loncom/auth/lonroles.pm between versions 1.179 and 1.181.2.1

version 1.179, 2007/09/10 16:07:32 version 1.181.2.1, 2008/03/22 03:40:58
Line 365  ENDENTERKEY Line 365  ENDENTERKEY
     my $start_page=&Apache::loncommon::start_page('User Roles');      my $start_page=&Apache::loncommon::start_page('User Roles');
     my $standby=&mt('Role selected. Please stand by.');      my $standby=&mt('Role selected. Please stand by.');
     $standby=~s/\n/\\n/g;      $standby=~s/\n/\\n/g;
     my $noscript='<span class="LC_error">'.&mt('Use of LON-CAPA requires Javascript to be enabled in your web browser.').'<br />'.&mt('As this is not the case, most functionality in the system will ba unavailable.').'</span><br />';      my $noscript='<span class="LC_error">'.&mt('Use of LON-CAPA requires Javascript to be enabled in your web browser.').'<br />'.&mt('As this is not the case, most functionality in the system will be unavailable.').'</span><br />';
   
     $r->print(<<ENDHEADER);      $r->print(<<ENDHEADER);
 $start_page  $start_page
Line 642  ENDHEADER Line 642  ENDHEADER
     }      }
 # More than one possible role  # More than one possible role
 # ----------------------------------------------------------------------- Table  # ----------------------------------------------------------------------- Table
     unless (($advanced) || ($nochoose)) {      unless ((!&Apache::lonmenu::show_course()) || ($nochoose)) {
  $r->print("<h2>".&mt('Select a Course to Enter')."</h2>\n");   $r->print("<h2>".&mt('Select a Course to Enter')."</h2>\n");
     }      }
     $r->print('<br /><table id="LC_rolesmenu"><tr>');      $r->print('<br /><table id="LC_rolesmenu"><tr>');
Line 930  sub courselink { Line 930  sub courselink {
 }  }
   
 sub coursepick_jscript {  sub coursepick_jscript {
       my %lt = &Apache::lonlocal::texthash(
                     plsu => "Please use the 'Select Course' link to open a separate pick course window where you may select the course you wish to enter.",
                     youc => 'You can only use this screen to select courses in the current domain.',
               );
     my $verify_script = <<"END";      my $verify_script = <<"END";
 <script type="text/javascript">  <script type="text/javascript">
 function verifyCoursePick(caller) {  function verifyCoursePick(caller) {
Line 945  function verifyCoursePick(caller) { Line 949  function verifyCoursePick(caller) {
             }              }
         }          }
         else {          else {
             alert("Please use the 'Select Course' link to open a separate pick course window where you may select the course you wish to enter.");              alert("$lt{'plsu'}");
         }          }
     }      }
     else {      else {
         alert("You can only use this screen to select courses in the current domain")          alert("$lt{'youc'}");
     }      }
 }  }
 function getIndex(caller) {  function getIndex(caller) {
Line 965  END Line 969  END
     return $verify_script;      return $verify_script;
 }  }
   
 sub processpick {  
     my $process_pick = <<"END";  
 <script type="text/javascript">  
 function process_pick(dom) {  
     var pickedCourse=opener.document.rolechoice.$env{'form.cnumelement'}.value;  
     var pickedDomain=opener.document.rolechoice.$env{'form.cdomelement'}.value;  
     var okDomain = 0;  
   
     if (pickedDomain == dom) {  
         if (pickedCourse != '') {  
             var courseTarget = "cc./"+pickedDomain+"/"+pickedCourse  
             opener.document.title='Role selected. Please stand by.';  
             opener.status='Role selected. Please stand by.';  
     opener.document.rolechoice.newrole.value=courseTarget  
             opener.document.rolechoice.submit()  
         }  
     } else {  
         alert("You may only use this screen to select courses in the current domain: "+dom+"\\nPlease return to the roles page window and click the 'Select Course' link for domain: "+pickedDomain+",\\n if you are a Domain Coordinator in that domain, and wish to become a Course Coordinator in a course in the domain");  
     }  
 }  
    
 </script>  
 END  
     return $process_pick;  
 }  
   
 sub display_cc_role {  sub display_cc_role {
     my $rolekey = shift;      my $rolekey = shift;
     my $roletext;      my $roletext;

Removed from v.1.179  
changed lines
  Added in v.1.181.2.1


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