Diff for /loncom/interface/lonparmset.pm between versions 1.580 and 1.581

version 1.580, 2017/07/15 02:49:10 version 1.581, 2017/07/15 04:58:17
Line 1844  sub isdateparm { Line 1844  sub isdateparm {
 }  }
   
 # Prints the HTML and Javascript to select parameters, with various shortcuts.  # Prints the HTML and Javascript to select parameters, with various shortcuts.
 # FIXME: remove unused parameters  
 #  #
 # @param {Apache2::RequestRec} $r - the Apache request (unused)  # @param {Apache2::RequestRec} $r - the Apache request
 # @param {hash reference} $allparms - hash parameter name -> parameter title  
 # @param {array reference} $pscat - list of selected parameter names (unused)  
 # @param {hash reference} $keyorder - hash parameter key -> appearance rank (unused)  
 sub parmmenu {  sub parmmenu {
     my ($r,$allparms,$pscat,$keyorder)=@_;      my ($r)=@_;
     my $tempkey;  
     $r->print(<<ENDSCRIPT);      $r->print(<<ENDSCRIPT);
 <script type="text/javascript">  <script type="text/javascript">
 // <![CDATA[  // <![CDATA[
Line 1929  sub parmmenu { Line 1924  sub parmmenu {
 ENDSCRIPT  ENDSCRIPT
   
     $r->print('<hr />');      $r->print('<hr />');
     &shortCuts($r,$allparms,$pscat,$keyorder);      &shortCuts($r);
     $r->print('<hr />');      $r->print('<hr />');
 }  }
   
Line 2110  sub parmboxes { Line 2105  sub parmboxes {
 }  }
   
 # Prints HTML with shortcuts to select groups of parameters in one click, or deselect all.  # Prints HTML with shortcuts to select groups of parameters in one click, or deselect all.
 # FIXME: remove unused parameters  
 #  #
 # @param {Apache2::RequestRec} $r - the Apache request  # @param {Apache2::RequestRec} $r - the Apache request
 # @param {hash reference} $allparms - hash parameter name -> parameter title (unused)  
 # @param {array reference} $pscat - list of selected parameter names (unused)  
 # @param {hash reference} $keyorder - hash parameter key -> appearance rank (unused)  
 sub shortCuts {  sub shortCuts {
     my ($r,$allparms,$pscat,$keyorder)=@_;      my ($r)=@_;
   
     # Parameter Selection      # Parameter Selection
     $r->print(      $r->print(
Line 2310  function group_or_section(caller) { Line 2301  function group_or_section(caller) {
 # @param {Apache2::RequestRec} $r - the Apache request  # @param {Apache2::RequestRec} $r - the Apache request
 # @param {hash reference} $allparms - hash parameter name -> parameter title  # @param {hash reference} $allparms - hash parameter name -> parameter title
 # @param {array reference} $pscat - list of selected parameter names  # @param {array reference} $pscat - list of selected parameter names
 # @param {array reference} $psprt - list of selected parameter parts (unused)  
 # @param {hash reference} $keyorder - hash parameter key -> appearance rank  # @param {hash reference} $keyorder - hash parameter key -> appearance rank
 # @param {string} [$divid] - name used to give an id to the HTML element for the scroll box  # @param {string} [$divid] - name used to give an id to the HTML element for the scroll box
 sub displaymenu {  sub displaymenu {
     my ($r,$allparms,$pscat,$psprt,$keyorder,$divid)=@_;      my ($r,$allparms,$pscat,$keyorder,$divid)=@_;
   
     $r->print(&Apache::lonhtmlcommon::start_pick_box());      $r->print(&Apache::lonhtmlcommon::start_pick_box());
     $r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parameters to View')));      $r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parameters to View')));
   
     &parmmenu($r,$allparms,$pscat,$keyorder); # only $allparms is used by parmmenu      &parmmenu($r);
     $r->print(&Apache::loncommon::start_scrollbox('480px','440px','200px',$divid));      $r->print(&Apache::loncommon::start_scrollbox('480px','440px','200px',$divid));
     &parmboxes($r,$allparms,$pscat,$keyorder);      &parmboxes($r,$allparms,$pscat,$keyorder);
     $r->print(&Apache::loncommon::end_scrollbox());      $r->print(&Apache::loncommon::end_scrollbox());
Line 3103  ENDPARMSELSCRIPT Line 3093  ENDPARMSELSCRIPT
   
         # Step 2          # Step 2
         $r->print(&Apache::lonhtmlcommon::topic_bar(2,&mt('Parameter Specification'),'parmstep2'));          $r->print(&Apache::lonhtmlcommon::topic_bar(2,&mt('Parameter Specification'),'parmstep2'));
         &displaymenu($r,\%allparms,\@pscat,\@psprt,\%keyorder,'parmmenuscroll');          &displaymenu($r,\%allparms,\@pscat,\%keyorder,'parmmenuscroll');
   
         # Step 3          # Step 3
         $r->print(&Apache::lonhtmlcommon::topic_bar(3,&mt('User Specification (optional)'),'parmstep3'));          $r->print(&Apache::lonhtmlcommon::topic_bar(3,&mt('User Specification (optional)'),'parmstep3'));
Line 5108  ENDOVER Line 5098  ENDOVER
   
     $r->print('<div class="LC_Box">');      $r->print('<div class="LC_Box">');
     $r->print('<div>');      $r->print('<div>');
     &displaymenu($r,\%allparms,\@pscat,\%keyorder); # FIXME: wrong parameters, could make keysindisplayorderCategory crash because $keyorder is undefined      &displaymenu($r,\%allparms,\@pscat,\%keyorder);
     $r->print(&Apache::lonhtmlcommon::start_pick_box());      $r->print(&Apache::lonhtmlcommon::start_pick_box());
     $r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parts to View')));      $r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parts to View')));
     my $sectionselector = &sectionmenu(\@selected_sections);      my $sectionselector = &sectionmenu(\@selected_sections);
Line 5354  ENDOVER Line 5344  ENDOVER
                 $r->print(&mt('All users'));                  $r->print(&mt('All users'));
             } elsif ($data{'scope_type'} eq 'user') {              } elsif ($data{'scope_type'} eq 'user') {
                 $r->print(&mt('User: [_1]',join(':',@{$data{'scope'}})));                  $r->print(&mt('User: [_1]',join(':',@{$data{'scope'}})));
             } elsif ($data{'scope_type'} eq 'section') {              } elsif ($data{'scope_type'} eq 'secgroup') {
                 $r->print(&mt('Section: [_1]',$data{'scope'}));                  $r->print(&mt('Group/Section: [_1]',$data{'scope'}));
             } elsif ($data{'scope_type'} eq 'group') {  
                 $r->print(&mt('Group: [_1]',$data{'scope'}));  
             }              }
             $r->print('<br />');              $r->print('<br />');
             if ($data{'realm_type'} eq 'all') {              if ($data{'realm_type'} eq 'all') {
Line 5464  sub parse_key { Line 5452  sub parse_key {
             $data{'scope_type'} = 'user';              $data{'scope_type'} = 'user';
             $data{'scope'} = [$1,$2];              $data{'scope'} = [$1,$2];
         } else {          } else {
             #FIXME check for group scope              $data{'scope_type'} = 'secgroup';
             $data{'scope_type'} = 'section';  
         }          }
         $middle=~s/^\[(.*)\]//;          $middle=~s/^\[(.*)\]//;
     }      }
Line 5859  sub addmetafield { Line 5846  sub addmetafield {
             $r->print('You may undelete previously deleted fields.<br />Check those you wish to undelete and click Undelete.<br />');              $r->print('You may undelete previously deleted fields.<br />Check those you wish to undelete and click Undelete.<br />');
             $r->print('<form method="post" action="">');              $r->print('<form method="post" action="">');
             foreach my $key(keys(%$fields)) {              foreach my $key(keys(%$fields)) {
                 $r->print('<input type="checkbox" name="undeletefield" value="'.$key.'" />'.$$fields{$key}.'<br /');                  $r->print('<label><input type="checkbox" name="undeletefield" value="'.$key.'" />'.$$fields{$key}.'</label><br /');
             }              }
             $r->print('<input type="submit" name="undelete" value="Undelete" />');              $r->print('<input type="submit" name="undelete" value="Undelete" />');
             $r->print('</form>');              $r->print('</form>');
         }          }
         $r->print('<hr /><strong>Or</strong> you may enter a new metadata field name.<form method="post" action="/adm/parmset?action=addmetadata">');          $r->print('<hr /><strong>Or</strong> you may enter a new metadata field name.'.
                     '<form method="post" action="/adm/parmset?action=addmetadata">');
         $r->print('<input type="text" name="fieldname" /><br />');          $r->print('<input type="text" name="fieldname" /><br />');
         $r->print('<input type="submit" value="Add Metadata Field" />');          $r->print('<input type="submit" value="Add Metadata Field" />');
           $r->print('</form>');
     }      }
     $r->print('</form>');  
     &endSettingsScreen($r);      &endSettingsScreen($r);
 }  }
   
Line 6191  ENDYESNO Line 6179  ENDYESNO
 # $issection - section or group name  # $issection - section or group name
 # $realmdescription - title for the parameter level and resource (without using HTML)  # $realmdescription - title for the parameter level and resource (without using HTML)
 #  #
 # FIXME: remove unused fields.  
 #  
 # @param {string} $key - parameter log key  # @param {string} $key - parameter log key
 # @param {string} $uname - user name  # @param {string} $uname - user name
 # @param {string} $udom - user domain  # @param {string} $udom - user domain
 # @param {string} $exeuser - unused  
 # @param {string} $exedomain - unused  
 # @param {boolean} $typeflag - .type log entry  # @param {boolean} $typeflag - .type log entry
 # @returns {Array}  # @returns {Array}
 sub components {  sub components {
     my ($key,$uname,$udom,$exeuser,$exedomain,$typeflag)=@_;      my ($key,$uname,$udom,$typeflag)=@_;
   
     if ($typeflag) {      if ($typeflag) {
         $key=~s/\.type$//;          $key=~s/\.type$//;
Line 6416  sub parm_change_log { Line 6400  sub parm_change_log {
             my $typeflag = ($changed =~/\.type$/ &&              my $typeflag = ($changed =~/\.type$/ &&
                     !exists($parmlog{$id}{'logentry'}{$changed.'.type'}));                      !exists($parmlog{$id}{'logentry'}{$changed.'.type'}));
             my ($realm,$section,$parmname,$part,$what,$middle,$uname,$udom,$issection,$realmdescription)=              my ($realm,$section,$parmname,$part,$what,$middle,$uname,$udom,$issection,$realmdescription)=
                 &components($changed,$parmlog{$id}{'uname'},$parmlog{$id}{'udom'},undef,undef,$typeflag);                  &components($changed,$parmlog{$id}{'uname'},$parmlog{$id}{'udom'},$typeflag);
             if ($env{'request.course.sec'} ne '') {              if ($env{'request.course.sec'} ne '') {
                 next if (($issection ne '') && ($issection ne $env{'request.course.sec'}));                  next if (($issection ne '') && ($issection ne $env{'request.course.sec'}));
                 if ($uname ne '') {                  if ($uname ne '') {

Removed from v.1.580  
changed lines
  Added in v.1.581


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