Diff for /loncom/interface/lonpickcourse.pm between versions 1.67.2.2 and 1.77

version 1.67.2.2, 2008/01/02 11:25:38 version 1.77, 2009/03/16 16:05:40
Line 228  sub display_matched_courses { Line 228  sub display_matched_courses {
                  $menuchk = ' checked="checked" ';                   $menuchk = ' checked="checked" ';
             }              }
             $r->print(              $r->print(
                 '<span class="LC_nobreak"><label>'.                  '<fieldset>'
                 '<input type="radio" name="phase" value="ccrole"'.$ccrolechk.'/>'.                 .'<legend>'.&mt('Action').'</legend>'
                 '&nbsp;'.&mt('Enter the course with the role of [_1].',$cctitle).                 .'<div class="LC_nobreak"><label>'
                 '</label>'.('&nbsp;'x3).'</span><br />'.                 .'<input type="radio" name="phase" value="ccrole"'.$ccrolechk.'/>'
                 '<span class="LC_nobreak"><label>'.                 .'&nbsp;'.&mt('Enter the course with the role of [_1].',$cctitle)
                 '<input type="radio" name="phase" value="menu"'.$menuchk.'/>&nbsp;'.                 .'</label></div>'
                 &mt('View or modify course settings which only a [_1] may modify.',$dctitle).                 .'<div class="LC_nobreak"><label>'
                 '</label></span><br /><br />');                 .'<input type="radio" name="phase" value="menu"'.$menuchk.'/>&nbsp;'
                  .&mt('View or modify course settings which only a [_1] may modify.',$dctitle)
                  .'</label></div>'
                  .'</fieldset>'
                  .'<br />'
               );
         }          }
     }      }
     my %by_descrip;      my %by_descrip;
Line 251  sub display_matched_courses { Line 256  sub display_matched_courses {
         my $description = $descr;          my $description = $descr;
         push (@{$by_descrip{$description}}, $course);          push (@{$by_descrip{$description}}, $course);
     }      }
    
     if ($numcourses > 1 && $multiple) {      if ($numcourses > 1 && $multiple) {
         $r->print('<input type="button" value="check all"          $r->print('<input type="button" value="check all"
                   onclick="javascript:checkAll(document.courselist.course_id)" />                    onclick="javascript:checkAll(document.courselist.course_id)" />
Line 258  sub display_matched_courses { Line 264  sub display_matched_courses {
                   onclick="javascript:uncheckAll(document.courselist.course_id)" />                    onclick="javascript:uncheckAll(document.courselist.course_id)" />
                   <br /><br />');                    <br /><br />');
     }      }
   
       if (%courses) {
           $r->print(&Apache::loncommon::start_data_table());
           $r->print(&Apache::loncommon::start_data_table_header_row());
           $r->print('<th>'.&mt('Select').'</th>'
                    .'<th>'.&mt('Course Title').'</th>'
                    .'<th>'.&mt('Domain').'</th>'
                    .'<th>'.&mt('Course Code').'</th>'
                    .'<th>'.&mt('Owner/Co-owner(s)').'</th>'
                    .'<th>'.&mt('Type').'</th>'
                    );
           $r->print(&Apache::loncommon::end_data_table_header_row());
       }
     foreach my $description (sort { lc($a) cmp lc($b) } (keys(%by_descrip))) {      foreach my $description (sort { lc($a) cmp lc($b) } (keys(%by_descrip))) {
         foreach my $course (@{$by_descrip{$description}}) {          foreach my $course (@{$by_descrip{$description}}) {
               $r->print(&Apache::loncommon::start_data_table_row());
             my $cleandesc=&HTML::Entities::encode($description,'<>&"');              my $cleandesc=&HTML::Entities::encode($description,'<>&"');
             $cleandesc=~s/'/\\'/g;              $cleandesc=~s/'/\\'/g;
             my ($cdom,$cnum)=split(/\_/,$course);              my ($cdom,$cnum)=split(/\_/,$course);
Line 279  sub display_matched_courses { Line 299  sub display_matched_courses {
                 ($descr,$instcode,$singleowner,$ttype)=split(/:/,$courses{$course});                  ($descr,$instcode,$singleowner,$ttype)=split(/:/,$courses{$course});
                 push(@owners,&unescape($singleowner));                  push(@owners,&unescape($singleowner));
             }              }
             my $owner = join(', ',@owners);              my $ownerstr = join(', ',@owners);
             $r->print(&course_chooser($multiple,$cdom,$cnum,$cleandesc));              $r->print('<td>'.&course_chooser($multiple,$cdom,$cnum,$cleandesc).'</td>');
             $r->print($description.' ('.              $r->print('<td>'.$description.'</td>');
                       (&Apache::lonnet::domain($cdom,'description')?              $r->print('<td>');
                        &Apache::lonnet::domain($cdom,'description'):$cdom).")");              $r->print(&Apache::lonnet::domain($cdom,'description')?
                         $cdom.' ('.&Apache::lonnet::domain($cdom,'description').')':$cdom);
               $r->print('</td>');
               $r->print('<td>');
             if ($instcode ne '') {              if ($instcode ne '') {
                 $r->print(" - ".&unescape($instcode));                  $r->print(&unescape($instcode));
             }              } else {
             if (@owners > 1) {                  $r->print('&nbsp;');
                 $r->print(', '.&mt('owners').' - ',join(', ',@owners));   
             } elsif (@owners == 1) {  
                 $r->print(', '.&mt('owner').' - '.$owner);  
             }              }
               $r->print('</td>');
               $r->print('<td>'.$ownerstr.'</td>');
               $r->print('<td>');
             if ($ttype ne '') {              if ($ttype ne '') {
                 $r->print(' ('.&unescape($ttype).')');                  $r->print(&mt(&unescape($ttype)));
               } else {
                   $r->print('&nbsp;');
             }              }
               $r->print('</td>');
             if ($multiple) { $r->print("</label>\n"); }              if ($multiple) { $r->print("</label>\n"); }
             $r->print("<br />\n");              $r->print(&Apache::loncommon::end_data_table_row());
               # $r->print("<br />\n");
         }          }
     }      }
       if (%courses) {
           $r->print(&Apache::loncommon::end_data_table());
       }
   
     if (!%courses) {      if (!%courses) {
         $r->print(&mt('None found'));          $r->print(&mt('None found'));
     } elsif ($multiple) {      } elsif ($multiple) {
Line 401  sub build_filters { Line 432  sub build_filters {
                       '15552000','31104000']));                        '15552000','31104000']));
   
     my %lt = (      my %lt = (
               'cac' => &mt('[_1] Activity',$type),                'cac' => &mt("$type Activity"),
               'cde' => &mt('[_1] Description',$type),                'cde' => &mt("$type Title"),
               'cdo' => &mt('[_1] Domain',$type),                'cdo' => &mt("$type Domain"),
               'cin' => &mt('Course Institutional Code'),                'cin' => &mt('Course Institutional Code'),
               'cow' => &mt("[_1] Owner's Username",$type),                'cow' => &mt("$type Owner's Username"),
               'cod' => &mt("[_1] Owner's Domain", $type),                'cod' => &mt("$type Owner's Domain"),
               'cog' => &mt('Course Type')                'cog' => &mt('Course Type')
              );               );
   
Line 417  sub build_filters { Line 448  sub build_filters {
                 $list->{'instcodefilter'}.'" />';                  $list->{'instcodefilter'}.'" />';
     }      }
     foreach my $posstype ('Course','Non-standard Course') {      foreach my $posstype ('Course','Non-standard Course') {
         $typeselectform.='<option value="'.$posstype.'" "'.          $typeselectform.='<option value="'.$posstype.'"'.
             ($posstype eq $type ? 'selected="selected" ' : ''). ">$posstype</option>\n";              ($posstype eq $type ? ' selected="selected" ' : ''). ">".&mt($posstype)."</option>\n";
     }      }
     $typeselectform.="</select>";      $typeselectform.="</select>";
     my $output = qq|      my $output = qq|
Line 446  $multelement Line 477  $multelement
             $output .= '<input type="hidden" name="setroles" value="'.$env{'form.setroles'}.'" />';              $output .= '<input type="hidden" name="setroles" value="'.$env{'form.setroles'}.'" />';
         }          }
     }      }
   
       $output .= "<br />\n".&Apache::lonhtmlcommon::start_pick_box();
     if ($sincefilterform) {       if ($sincefilterform) { 
         $output .= $lt{'cac'}.': '.$sincefilterform.'<br />'."\n";          $output .= &Apache::lonhtmlcommon::row_title($lt{'cac'})
                     .$sincefilterform
                     .&Apache::lonhtmlcommon::row_closure();
     }      }
     if ($domainselectform) {      if ($domainselectform) {
         $output .= $lt{'cdo'}.': '.$domainselectform.'<br />'."\n";          $output .= &Apache::lonhtmlcommon::row_title($lt{'cdo'})
                     .$domainselectform
                     .&Apache::lonhtmlcommon::row_closure();
       }
       if ($typeselectform) {
           $output .= &Apache::lonhtmlcommon::row_title($lt{'cog'})
                     .$typeselectform
                     .&Apache::lonhtmlcommon::row_closure();
     }      }
 #    if ($typeselectform) {  
 #        $output .= $lt{'cog'}.': '.$typeselectform.'<br />'."\n";  
 #    }  
     if ($instcodeform) {      if ($instcodeform) {
         $output .= $lt{'cin'}.': '.$instcodeform.'<br />'."\n";          $output .= &Apache::lonhtmlcommon::row_title($lt{'cin'})
                     .$instcodeform
                     .&Apache::lonhtmlcommon::row_closure();
     }      }
     if (exists($filter->{'ownerfilter'})) {      if (exists($filter->{'ownerfilter'})) {
         $output .= $lt{'cow'}.': '.          $output .= &Apache::lonhtmlcommon::row_title($lt{'cow'})
                    '<input type="text" name="ownerfilter" size="10" value="'.                    .'<input type="text" name="ownerfilter" size="20" value="'
                    $list->{'ownerfilter'}.'" /><br />'."\n".                    .$list->{'ownerfilter'}.'" />'
                    $lt{'cod'}.': '.$ownerdomselectform.'<br />'."\n";                    .&Apache::lonhtmlcommon::row_closure()
                     .&Apache::lonhtmlcommon::row_title($lt{'cod'})
                     .$ownerdomselectform
                     .&Apache::lonhtmlcommon::row_closure();
     }      }
     if (exists($filter->{'coursefilter'})) {      if (exists($filter->{'coursefilter'})) {
         $output .= &mt('LON-CAPA course ID').': '.          $output .= &Apache::lonhtmlcommon::row_title(&mt('LON-CAPA course ID'))
                    '<input type="text" name="coursefilter" size="25" value="'.                    .'<input type="text" name="coursefilter" size="25" value="'
                     $list->{'coursefilter'}.'" /><br />';                    .$list->{'coursefilter'}.'" />'
                     .&Apache::lonhtmlcommon::row_closure();
     }      }
     if (exists($filter->{'descriptfilter'})) {      if (exists($filter->{'descriptfilter'})) {
         $output .=$lt{'cde'}.': '.          $output .= &Apache::lonhtmlcommon::row_title($lt{'cde'})
                   '<input type="text" name="descriptfilter" size="40" value="'.                    .'<input type="text" name="descriptfilter" size="40" value="'
                   $list->{'descriptfilter'}.'" />'."\n";                    .$list->{'descriptfilter'}.'" />'
     }                    .&Apache::lonhtmlcommon::row_closure(1);
     $output .= qq|      }
 <p><input type="submit" name="gosearch" value="Search" /></p>      $output .= &Apache::lonhtmlcommon::end_pick_box();
 </form>      $output .= '<p><input type="submit" name="gosearch" value="'. 
 <hr />                 &mt('Search').'" /></p>'."\n".'</form>'."\n".'<hr />'."\n";
 |;  
     return $output;       return $output; 
 }  }
   
Line 486  sub search_courses { Line 530  sub search_courses {
     my ($r,$type,$onlyown,$filter) = @_;      my ($r,$type,$onlyown,$filter) = @_;
     my %courses;      my %courses;
     if (!$onlyown) {      if (!$onlyown) {
         $r->print(&mt('Searching').' ...<br />&nbsp;<br />');          $r->print(&mt('Searching ...').'<br />&nbsp;<br />');
         $r->rflush();          $r->rflush();
         if (($filter->{'ownerfilter'} ne '') ||          if (($filter->{'ownerfilter'} ne '') ||
             ($filter->{'ownerdomfilter'} ne '')) {              ($filter->{'ownerdomfilter'} ne '')) {
Line 526  sub course_chooser { Line 570  sub course_chooser {
     if ($multiple) {      if ($multiple) {
         $output = '<label><input type="checkbox" name="course_id" value="'.$cdom.'_'.$cnum.'" />'."\n";          $output = '<label><input type="checkbox" name="course_id" value="'.$cdom.'_'.$cnum.'" />'."\n";
     } else {      } else {
         $output = '<input type="button" value="Select" onClick="gochoose('.          $output = '<input type="button" value="'.&mt('Select').'" onClick="gochoose('.
                   "'".$cnum."','".$cdom."','".$cleandesc."')".'" />'."\n";                    "'".$cnum."','".$cdom."','".$cleandesc."')".'" />'."\n";
     }      }
     return $output;      return $output;
Line 669  Course Owner's Username - the username o Line 713  Course Owner's Username - the username o
 Course Owner's Domain - the domain of the owner of the course  Course Owner's Domain - the domain of the owner of the course
   
 =item *   =item * 
 Course Description - text which appears in the Course Description (or title), as set in the Course Parameters.  Course Title - text which appears in the Course Title, as set in the Course Parameters.
   
 =item *  =item *
 Course ID - the internal course number (course ID part after initial 'domain_') used by LON-CAPA (this criterion is only displayed to Domain Coordinators selecting a course in the same domain as their DC role).  Course ID - the internal course number (course ID part after initial 'domain_') used by LON-CAPA (this criterion is only displayed to Domain Coordinators selecting a course in the same domain as their DC role).

Removed from v.1.67.2.2  
changed lines
  Added in v.1.77


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