--- loncom/interface/loncourserespicker.pm 2013/11/12 14:36:07 1.7 +++ loncom/interface/loncourserespicker.pm 2013/11/13 13:32:33 1.9 @@ -1,6 +1,6 @@ # The LearningOnline Network # -# $Id: loncourserespicker.pm,v 1.7 2013/11/12 14:36:07 raeburn Exp $ +# $Id: loncourserespicker.pm,v 1.9 2013/11/13 13:32:33 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -459,14 +459,14 @@ sub create_picker { $display .= ''. '
'. '
'. - ''. + ''. '
'; $numcount = $count + $startcount; } $display .= ''; my $scripttag = &respicker_javascript($startcount,$numcount,$context,$formname,\%children, - \%hierarchy,\@checked_maps); + \%hierarchy,\@checked_maps,$numhome); if ($context eq 'dumpdocs') { return $scripttag.$display; } @@ -484,7 +484,7 @@ sub create_picker { $output .= &Apache::lonhtmlcommon::breadcrumbs('IMS Export'). &Apache::londocs::startContentScreen('tools'); } elsif ($context eq 'dumpdocs') { - $output .= &Apache::lonhtmlcommon::breadcrumbs('Dump to Authoring Space'). + $output .= &Apache::lonhtmlcommon::breadcrumbs('Copying to Authoring Space'). &Apache::londocs::startContentScreen('tools'); } $output .= $display; @@ -498,7 +498,7 @@ sub create_picker { sub respicker_javascript { my ($startcount,$numitems,$context,$formname,$children,$hierarchy, - $checked_maps) = @_; + $checked_maps,$numhome) = @_; return unless ((ref($children) eq 'HASH') && (ref($hierarchy) eq 'HASH') && (ref($checked_maps) eq 'ARRAY')); my ($elem,$nested,$nameforelem); @@ -591,11 +591,13 @@ EXTRA } elsif ($context eq 'dumpdocs') { my $blankmsg = &mt('An item selected has no filename set in the "Save as ..." column.'); my $dupmsg = &mt('Items selected for copying need unique filenames in the "Save as ..." column.'); + my $homemsg = &mt('An authoring space needs to be selected.'); $scripttag .= <<"EXTRA"; function checkUnique(form,field) { var duplicate = 0; var blank = 0; + var numhome = '$numhome'; if (field.length > 0) { for (i=0; i 1) { + if (!form.authorspace.options[form.authorspace.selectedIndex].value) { + alert('$homemsg'); + return false; + } + } return true; } @@ -730,7 +738,7 @@ sub get_navmap_object { undef,{'only_body' => 1,}). '

'.&mt('Resource Display Failed').'

'; } elsif ($context eq 'dumpdocs') { - $outcome = '

'.&mt('Dump to Authoring Space unavilable'); + $outcome = '

'.&mt('Copying to Authoring Space unavilable'); } $outcome .= '
'; if ($crstype eq 'Community') { @@ -750,7 +758,7 @@ sub get_navmap_object { if ($context eq 'imsexport') { &Apache::lonnet::logthis('IMS export failed - could not create navmap object in '.lc($crstype).':'.$env{'request.course.id'}); } else { - &Apache::lonnet::logthis('Dump to Authoring Space failed - could not create navmap object in '.lc($crstype).':'.$env{'request.course.id'}); + &Apache::lonnet::logthis('Copying to Authoring Space failed - could not create navmap object in '.lc($crstype).':'.$env{'request.course.id'}); } } elsif ($context eq 'examblock') { $outcome .= ''.&mt('Close window').'';