--- loncom/interface/londocs.pm 2013/04/02 00:07:08 1.541 +++ loncom/interface/londocs.pm 2013/04/02 20:33:41 1.542 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.541 2013/04/02 00:07:08 raeburn Exp $ +# $Id: londocs.pm,v 1.542 2013/04/02 20:33:41 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1066,7 +1066,6 @@ END } - sub do_paste_from_buffer { my ($coursenum,$coursedom,$folder,$container,$errors) = @_; @@ -3083,6 +3082,7 @@ ENDCUT $cutlink=(< $form_common + $lt{'ct'} $form_end ENDCUT @@ -3100,6 +3100,7 @@ ENDREM $removelink=(< $form_common + $lt{'rm'} $form_end ENDREM @@ -5306,10 +5307,14 @@ sub editing_js { p_rmr1 => 'WARNING: Removing a resource makes associated grades and scores inaccessible!', p_rmr2a => 'Remove[_99]', p_rmr2b => '?[_99]', + p_rmr3a => 'Remove those [_2]', + p_rmr3b => 'items?[_2]', 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_ctr2a => 'Cut[_98]', p_ctr2b => '?[_98]', + p_ctr3a => 'Cut those[_2]', + p_ctr3b => 'items?[_2]', rpck => 'Enter number to pick (e.g., 3)', imsfile => 'You must choose an IMS package for import', imscms => 'You must select which Course Management System was the source of the IMS package', @@ -5950,6 +5955,8 @@ function checkSubmits() { var numchanges = 0; var form = document.saveactions; var doactions = multiActions(); + var cutwarnings = 0; + var remwarnings = 0; if (doactions == 1) { var remidxlist = document.cumulativeactions.allremoveidx.value; if ((remidxlist != '') && (remidxlist != null)) { @@ -5959,6 +5966,11 @@ function checkSubmits() { if (document.getElementById('remove_'+remidxs[i]).checked) { form.multiremove.value += remidxs[i]+','; numchanges ++; + if (document.getElementById('skip_remove_'+remidxs[i])) { + if (document.getElementById('skip_remove_'+remidxs[i]).value == 0) { + remwarnings ++; + } + } } } } @@ -5971,6 +5983,11 @@ function checkSubmits() { if (document.getElementById('cut_'+cutidxs[i]).checked == true) { form.multicut.value += cutidxs[i]+','; numchanges ++; + if (document.getElementById('skip_cut_'+cutidxs[i])) { + if (document.getElementById('skip_cut_'+cutidxs[i]).value == 0) { + cutwarnings ++; + } + } } } } @@ -6033,8 +6050,25 @@ function checkSubmits() { } } if ((numchanges > 0) || (dosettings == 1)) { - form.submit(); - return true; + if (numchanges > 0) { + if ((cutwarnings > 0) || (remwarnings > 0)) { + if (remwarnings > 0) { + if (!confirm('$lt{"p_rmr1"}\\n\\n$lt{"p_rmr3a"} '+remwarnings+' $lt{"p_rmr3b"}')) { + return false; + } + } + if (cutwarnings > 0) { + if (!confirm('$lt{"p_ctr1a"}\\n$lt{"p_ctr1b"}\\n\\n$lt{"p_ctr3a"} '+cutwarnings+' $lt{"p_ctr3b"}')) { + return false; + } + } + } + form.submit(); + return true; + } else { + form.submit(); + return true; + } } return false; }