Diff for /loncom/interface/londocs.pm between versions 1.602 and 1.603

version 1.602, 2016/05/08 18:39:27 version 1.603, 2016/05/09 02:25:33
Line 3705  END Line 3705  END
                                           $currgroups);                                            $currgroups);
         my ($copylink,$cutlink,$removelink);          my ($copylink,$cutlink,$removelink);
  my $skip_confirm = 0;   my $skip_confirm = 0;
           my $confirm_removal = 0;
  if ( $folder =~ /^supplemental/   if ( $folder =~ /^supplemental/
      || ($url =~ m{( /smppg$       || ($url =~ m{( /smppg$
     |/syllabus$      |/syllabus$
Line 3716  END Line 3717  END
              || $isexternal) {               || $isexternal) {
     $skip_confirm = 1;      $skip_confirm = 1;
  }   }
           if (($url=~m|/+uploaded/\Q$coursedom\E/\Q$coursenum\E/|) &&
               ($url!~/$LONCAPA::assess_page_seq_re/)) {
               $confirm_removal = 1;
           }
   
  if ($denied{'copy'}) {   if ($denied{'copy'}) {
             $copylink=(<<ENDCOPY)              $copylink=(<<ENDCOPY)
Line 3758  ENDCUT Line 3763  ENDCUT
 ENDREM  ENDREM
         } else {          } else {
             my $formname = 'edit_remove_'.$orderidx;              my $formname = 'edit_remove_'.$orderidx;
             my $js = "javascript:checkForSubmit(document.forms.renameform,'remove','actions','$orderidx','$esc_path','$index','$renametitle',$skip_confirm);";              my $js = "javascript:checkForSubmit(document.forms.renameform,'remove','actions','$orderidx','$esc_path','$index','$renametitle',$skip_confirm,'$container','$folder',$confirm_removal);";
             $removelink=(<<ENDREM);              $removelink=(<<ENDREM);
 <form name="$formname" method="post" action="/adm/coursedocs">  <form name="$formname" method="post" action="/adm/coursedocs">
 $form_common  $form_common
 <input type="hidden" name="skip_$orderidx" id="skip_remove_$orderidx" value="$skip_confirm" />  <input type="hidden" name="skip_$orderidx" id="skip_remove_$orderidx" value="$skip_confirm" />
   <input type="hidden" name="confirm_rem_$orderidx" id="confirm_removal_$orderidx" value="$confirm_removal" />
 <input type="checkbox" name="remove" id="remove_$orderidx" value="$orderidx" onclick="javascript:singleCheck(this,'$orderidx','remove');" class="LC_hidden" /><a href="$js" class="LC_docs_remove">$lt{'rm'}</a>  <input type="checkbox" name="remove" id="remove_$orderidx" value="$orderidx" onclick="javascript:singleCheck(this,'$orderidx','remove');" class="LC_hidden" /><a href="$js" class="LC_docs_remove">$lt{'rm'}</a>
 $form_end  $form_end
 ENDREM  ENDREM
Line 6110  sub editing_js { Line 6116  sub editing_js {
                                           p_mab_alrt2 => 'Please enter both user and domain in the format user:domain',                                            p_mab_alrt2 => 'Please enter both user and domain in the format user:domain',
                                           p_chn => 'New Title',                                            p_chn => 'New Title',
                                           p_rmr1 => 'WARNING: Removing a resource makes associated grades and scores inaccessible!',                                            p_rmr1 => 'WARNING: Removing a resource makes associated grades and scores inaccessible!',
                                           p_rmr2a => 'Remove[_99]',                                            p_rmr2a => 'Remove',
                                           p_rmr2b => '?[_99]',                                            p_rmr2b => '?',
                                           p_rmr3a => 'Remove those [_2]',                                            p_rmr3a => 'Remove those',
                                           p_rmr3b => 'items?[_2]',                                            p_rmr3b => 'items?',
                                             p_rmr4  => 'WARNING: Removing a resource uploaded to a course cannot be undone via "Undo Delete".',
                                             p_rmr5  => 'Push "Cancel" and then use "Cut" instead if you might need to undo this change.',
                                           p_ctr1a => 'WARNING: Cutting a resource makes associated grades and scores inaccessible!',                                            p_ctr1a => 'WARNING: Cutting a resource makes associated grades and scores inaccessible!',
                                           p_ctr1b => 'Grades remain inaccessible if resource is pasted into another folder.',                                            p_ctr1b => 'Grades remain inaccessible if resource is pasted into another folder.',
                                           p_ctr2a => 'Cut[_98]',                                            p_ctr2a => 'Cut',
                                           p_ctr2b => '?[_98]',                                            p_ctr2b => '?',
                                           p_ctr3a => 'Cut those[_2]',                                            p_ctr3a => 'Cut those',
                                           p_ctr3b => 'items?[_2]',                                            p_ctr3b => 'items?',
                                           rpck    => 'Enter number to pick (e.g., 3)',                                            rpck    => 'Enter number to pick (e.g., 3)',
                                           imsfile => 'You must choose an IMS package for import',                                            imsfile => 'You must choose an IMS package for import',
                                           imscms  => 'You must select which Course Management System was the source of the IMS package',                                            imscms  => 'You must select which Course Management System was the source of the IMS package',
Line 6508  function propagateState(form,param) { Line 6516  function propagateState(form,param) {
     return;      return;
 }  }
   
 function checkForSubmit(targetform,param,context,idx,folderpath,index,oldtitle,skip_confirm,container,folder) {  function checkForSubmit(targetform,param,context,idx,folderpath,index,oldtitle,skip_confirm,container,folder,confirm_removal) {
     var dosettings;      var dosettings;
     var doaction;      var doaction;
     var control = document.togglemultsettings;      var control = document.togglemultsettings;
Line 6546  function checkForSubmit(targetform,param Line 6554  function checkForSubmit(targetform,param
             targetform.markcopy.value=idx+':'+param;              targetform.markcopy.value=idx+':'+param;
             targetform.copyfolder.value=folder+'.'+container;              targetform.copyfolder.value=folder+'.'+container;
             if (param == 'remove') {              if (param == 'remove') {
                 if (skip_confirm || confirm('$js_lt{"p_rmr1"}\\n\\n$js_lt{"p_rmr2a"} "'+oldtitle+'" $js_lt{"p_rmr2b"}')) {                  var doremove = 0;
                   if (skip_confirm) {
                       if (confirm_removal) {
                           if (confirm('$js_lt{"p_rmr4"}\\n$js_lt{"p_rmr5"}\\n\\n$js_lt{"p_rmr2a"} "'+oldtitle+'"$js_lt{"p_rmr2b"}')) {
                               doremove = 1;
                           }
                       } else {
                           doremove = 1;
                       }
                   } else {
                       if (confirm('$js_lt{"p_rmr1"}\\n\\n$js_lt{"p_rmr2a"} "'+oldtitle+'" $js_lt{"p_rmr2b"}')) {
                           doremove = 1;
                       }
                   }
                   if (doremove) {
                     targetform.markcopy.value='';                      targetform.markcopy.value='';
                     targetform.copyfolder.value='';                      targetform.copyfolder.value='';
                     targetform.submit();                      targetform.submit();
Line 6803  function checkSubmits() { Line 6825  function checkSubmits() {
     var doactions = multiActions();      var doactions = multiActions();
     var cutwarnings = 0;      var cutwarnings = 0;
     var remwarnings = 0;      var remwarnings = 0;
       var removalinfo = 0;
     if (doactions == 1) {      if (doactions == 1) {
         var remidxlist = document.cumulativeactions.allremoveidx.value;          var remidxlist = document.cumulativeactions.allremoveidx.value;
         if ((remidxlist != '') && (remidxlist != null)) {          if ((remidxlist != '') && (remidxlist != null)) {
Line 6817  function checkSubmits() { Line 6840  function checkSubmits() {
                                 remwarnings ++;                                  remwarnings ++;
                             }                              }
                         }                          }
                           if (document.getElementById('confirm_removal_'+remidxs[i])) {
                               if (document.getElementById('confirm_removal_'+remidxs[i]).value == 1) {
                                   removalinfo ++;
                               }
                           }
                     }                      }
                 }                  }
             }              }
Line 6915  function checkSubmits() { Line 6943  function checkSubmits() {
     }      }
     if (doactions == 1) {      if (doactions == 1) {
         if (numchanges > 0) {          if (numchanges > 0) {
             if ((cutwarnings > 0) || (remwarnings > 0)) {              if ((cutwarnings > 0) || (remwarnings > 0) || (removalinfo > 0)) {
                 if (remwarnings > 0) {                  if (remwarnings > 0) {
                     if (!confirm('$js_lt{"p_rmr1"}\\n\\n$js_lt{"p_rmr3a"} '+remwarnings+' $js_lt{"p_rmr3b"}')) {                      if (!confirm('$js_lt{"p_rmr1"}\\n\\n$js_lt{"p_rmr3a"} '+remwarnings+' $js_lt{"p_rmr3b"}')) {
                         return false;                          return false;
                     }                      }
                 }                  }
                   if (removalinfo > 0) {
                       if (!confirm('$js_lt{"p_rmr4"}\\n$js_lt{"p_rmr5"}\\n\\n$js_lt{"p_rmr3a"} '+removalinfo+' $js_lt{"p_rmr3b"}')) {
                           return false;
                       }
                   }
                 if (cutwarnings > 0) {                  if (cutwarnings > 0) {
                     if (!confirm('$js_lt{"p_ctr1a"}\\n$js_lt{"p_ctr1b"}\\n\\n$js_lt{"p_ctr3a"} '+cutwarnings+' $js_lt{"p_ctr3b"}')) {                      if (!confirm('$js_lt{"p_ctr1a"}\\n$js_lt{"p_ctr1b"}\\n\\n$js_lt{"p_ctr3a"} '+cutwarnings+' $js_lt{"p_ctr3b"}')) {
                         return false;                          return false;

Removed from v.1.602  
changed lines
  Added in v.1.603


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