--- loncom/interface/londocs.pm 2006/11/13 01:57:57 1.249
+++ loncom/interface/londocs.pm 2006/12/01 22:17:26 1.263
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.249 2006/11/13 01:57:57 www Exp $
+# $Id: londocs.pm,v 1.263 2006/12/01 22:17:26 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -147,6 +147,7 @@ sub dumpcourse {
my $type = &Apache::loncommon::course_type();
$r->print(&Apache::loncommon::start_page('Dump '.$type.' DOCS to Construction Space').
'
');
$r->print(&Apache::loncommon::start_data_table().&Apache::loncommon::start_data_table_header_row().
- ''.&mt('Time').' '.&mt('User').' '.&mt('Folder').' '.&mt('Users').' '.
- &mt('Parameter').' '.&mt('Part').' '.&mt('New Value').' '.&mt('Announce').' '.
+ ''.&mt('Time').' '.&mt('User').' '.&mt('Folder').' '.&mt('Before').' '.
+ &mt('After').' '.
&Apache::loncommon::end_data_table_header_row());
my $shown=0;
foreach my $id (sort { $docslog{$b}{'exe_time'}<=>$docslog{$a}{'exe_time'} } (keys(%docslog))) {
+ if ($env{'form.displayfilter'} eq 'currentfolder') {
+ if ($docslog{$id}{'logentry'}{'currentfolder'} ne $folder) { next; }
+ }
my @changes=keys(%{$docslog{$id}{'logentry'}});
+ if ($env{'form.displayfilter'} eq 'containing') {
+ my $wholeentry=$docslog{$id}{'exe_uname'}.':'.$docslog{$id}{'exe_udom'}.':'.
+ &Apache::loncommon::plainname($docslog{$id}{'exe_uname'},$docslog{$id}{'exe_udom'});
+ foreach my $key (@changes) {
+ $wholeentry.=':'.$docslog{$id}{'logentry'}{$key};
+ }
+ if ($wholeentry!~/\Q$env{'form.containingphrase'}\E/i) { next; }
+ }
my $count = 0;
my $time =
&Apache::lonlocal::locallocaltime($docslog{$id}{'exe_time'});
@@ -1115,9 +1132,53 @@ sub docs_change_log {
''.$docslog{$id}{'exe_uname'}.
':'.$docslog{$id}{'exe_udom'}.' '.
$send_msg_link.''.
- &Apache::lonnet::gettitle($docslog{$id}{'logentry'}{'folder'}).' ');
-
- $r->print(&Apache::loncommon::end_data_table_row());
+ $docslog{$id}{'logentry'}{'folder'}.'');
+# Before
+ for (my $idx=0;$idx<=$docslog{$id}{'logentry'}{'maxidx'};$idx++) {
+ my $oldname=(split(/\:/,$docslog{$id}{'logentry'}{'before_resources_'.$idx}))[0];
+ my $newname=(split(/\:/,$docslog{$id}{'logentry'}{'after_resources_'.$idx}))[0];
+ if ($oldname ne $newname) {
+ $r->print(&LONCAPA::map::qtescape($oldname));
+ }
+ }
+ $r->print('');
+ for (my $idx=0;$idx<=$docslog{$id}{'logentry'}{'maxidx'};$idx++) {
+ if ($docslog{$id}{'logentry'}{'before_order_res_'.$idx}) {
+ $r->print(''.&LONCAPA::map::qtescape((split(/\:/,$docslog{$id}{'logentry'}{'before_order_res_'.$idx}))[0]).' ');
+ }
+ }
+ $r->print(' ');
+# After
+ $r->print(' ');
+
+ for (my $idx=0;$idx<=$docslog{$id}{'logentry'}{'maxidx'};$idx++) {
+ my $oldname=(split(/\:/,$docslog{$id}{'logentry'}{'before_resources_'.$idx}))[0];
+ my $newname=(split(/\:/,$docslog{$id}{'logentry'}{'after_resources_'.$idx}))[0];
+ if ($oldname ne $newname) {
+ $r->print(&LONCAPA::map::qtescape($newname));
+ }
+ }
+ $r->print('');
+ for (my $idx=0;$idx<=$docslog{$id}{'logentry'}{'maxidx'};$idx++) {
+ if ($docslog{$id}{'logentry'}{'after_order_res_'.$idx}) {
+ $r->print(''.&LONCAPA::map::qtescape((split(/\:/,$docslog{$id}{'logentry'}{'after_order_res_'.$idx}))[0]).' ');
+ }
+ }
+ $r->print(' ');
+ if ($docslog{$id}{'logentry'}{'parameter_res'}) {
+ $r->print(&LONCAPA::map::qtescape((split(/\:/,$docslog{$id}{'logentry'}{'parameter_res'}))[0]).':');
+ foreach my $parameter ('randompick','hiddenresource','encrypturl') {
+ if ($docslog{$id}{'logentry'}{'parameter_action_'.$parameter}) {
+ $r->print(''.
+ &mt($lt{$parameter}.' '.$lt{$docslog{$id}{'logentry'}{'parameter_action_'.$parameter}}.' [_1]',
+ $docslog{$id}{'logentry'}{'parameter_value_'.$parameter})
+ .' ');
+ }
+ }
+ $r->print(' ');
+ }
+# End
+ $r->print(' '.&Apache::loncommon::end_data_table_row());
$shown++;
if (!($env{'form.show'} eq &mt('all')
|| $shown<=$env{'form.show'})) { last; }
@@ -1148,7 +1209,7 @@ sub editor {
$env{'form.markedcopy_title'}=$title;
$env{'form.markedcopy_url'}=$url;
}
- my ($breadcrumbtrail,$randompick,$ishidden,$isencrypted)=&breadcrumbs($folder);
+ my ($breadcrumbtrail,$randompick,$ishidden,$isencrypted,$plain)=&breadcrumbs($folder);
$r->print($breadcrumbtrail);
if ($fatal) {
$r->print(''.$errtext.'
');
@@ -1162,27 +1223,39 @@ sub editor {
if ($env{'form.changeparms'}) {
my $idx=$env{'form.setparms'};
# set parameters
- if ($env{'form.randpick_'.$idx}) {
- &LONCAPA::map::storeparameter($idx,'parameter_randompick',$env{'form.randpick_'.$idx},'int_pos');
- &remember_parms($idx,'randompick','set',$env{'form.randpick_'.$idx});
- } else {
- &LONCAPA::map::delparameter($idx,'parameter_randompick');
- &remember_parms($idx,'randompick','del');
+ if ($env{'form.changeparms'} eq 'randompick') {
+ if ($env{'form.randpick_'.$idx}) {
+ &LONCAPA::map::storeparameter($idx,'parameter_randompick',$env{'form.randpick_'.$idx},'int_pos');
+ &remember_parms($idx,'randompick','set',$env{'form.randpick_'.$idx});
+ } else {
+ &LONCAPA::map::delparameter($idx,'parameter_randompick');
+ &remember_parms($idx,'randompick','del');
+ }
+ }
+ if ($env{'form.changeparms'} eq 'hiddenresource') {
+ if ($env{'form.hidprs_'.$idx}) {
+ &LONCAPA::map::storeparameter($idx,'parameter_hiddenresource','yes','string_yesno');
+ &remember_parms($idx,'hiddenresource','set',$env{'form.hidprs_'.$idx});
+ } else {
+ &LONCAPA::map::delparameter($idx,'parameter_hiddenresource');
+ &remember_parms($idx,'hiddenresource','del');
+ }
+ }
+ if ($env{'form.changeparms'} eq 'encrypturl') {
+ if ($env{'form.encprs_'.$idx}) {
+ &LONCAPA::map::storeparameter($idx,'parameter_encrypturl','yes','string_yesno');
+ &remember_parms($idx,'encrypturl','set',$env{'form.encprs_'.$idx});
+ } else {
+ &LONCAPA::map::delparameter($idx,'parameter_encrypturl');
+ &remember_parms($idx,'encrypturl','del');
+ }
+ }
+# store the changed version
+ ($errtext,$fatal)=&storemap($coursenum,$coursedom,$folder.'.'.$container);
+ if ($fatal) {
+ $r->print(''.$errtext.'
');
+ return;
}
- if ($env{'form.hidprs_'.$idx}) {
- &LONCAPA::map::storeparameter($idx,'parameter_hiddenresource','yes','string_yesno');
- &remember_parms($idx,'hiddenresource','set',$env{'form.hidprs_'.$idx});
- } else {
- &LONCAPA::map::delparameter($idx,'parameter_hiddenresource');
- &remember_parms($idx,'hiddenresource','del');
- }
- if ($env{'form.encprs_'.$idx}) {
- &LONCAPA::map::storeparameter($idx,'parameter_encrypturl','yes','string_yesno');
- &remember_parms($idx,'encrypturl','set',$env{'form.encprs_'.$idx});
- } else {
- &LONCAPA::map::delparameter($idx,'parameter_encrypturl');
- &remember_parms($idx,'encrypturl','del');
- }
}
if ($env{'form.newpos'}) {
@@ -1362,8 +1435,7 @@ sub editor {
$r->print(''.&mt('No map selected.').'
');
}
}
- &log_differences($coursenum,$coursedom,
- $folder.'.'.$container);
+ &log_differences($plain);
}
# ---------------------------------------------------------------- End commands
# ---------------------------------------------------------------- Print screen
@@ -1776,7 +1848,7 @@ END
'parameter_encrypturl'))[0]=~/^yes$/i);
$url.='folderpath='.&escape($folderpath).$cpinfo;
$parameterset=''.&mt('Randomly Pick: ').
- ' '.
@@ -1815,9 +1887,9 @@ END
((&LONCAPA::map::getparameter($orderidx,'parameter_hiddenresource'))[0]=~/^yes$/i?' checked="1"':'');
$line.=(<
- $lt{'hd'}
+ $lt{'hd'}
- $lt{'ec'}
+ $lt{'ec'}
$parameterset
ENDPARMS
}
@@ -1931,6 +2003,7 @@ sub list_symbs {
my ($r) = @_;
$r->print(&Apache::loncommon::start_page('Symb List'));
+ $r->print(&Apache::lonhtmlcommon::breadcrumbs('Symb List'));
my $navmap = Apache::lonnavmaps::navmap->new();
$r->print("\n");
foreach my $res ($navmap->retrieveResources()) {
@@ -1950,6 +2023,7 @@ sub verifycontent {
my $loaderror=&Apache::lonnet::overloaderror($r);
if ($loaderror) { return $loaderror; }
$r->print(&Apache::loncommon::start_page('Verify '.$type.' Documents'));
+ $r->print(&Apache::lonhtmlcommon::breadcrumbs('Verify '.$type.' Documents'));
$hashtied=0;
undef %alreadyseen;
%alreadyseen=();
@@ -1985,6 +2059,7 @@ sub checkversions {
my ($r) = @_;
my $type = &Apache::loncommon::course_type();
$r->print(&Apache::loncommon::start_page("Check $type Document Versions"));
+ $r->print(&Apache::lonhtmlcommon::breadcrumbs("Check $type Document Versions"));
my $header='';
my $startsel='';
my $monthsel='';
@@ -2276,6 +2351,22 @@ sub changewarning {
$help{'Caching'}.''."\n\n");
}
+# =========================================== Breadcrumbs for special functions
+
+sub init_breadcrumbs {
+ my ($form,$text)=@_;
+ &Apache::lonhtmlcommon::clear_breadcrumbs();
+ &Apache::lonhtmlcommon::add_breadcrumb({href=>"/adm/coursedocs",
+ text=>&Apache::loncommon::course_type()." Documents",
+ faq=>273,
+ bug=>'Instructor Interface',
+ help => 'Docs_Adding_Course_Doc'});
+ &Apache::lonhtmlcommon::add_breadcrumb({href=>"/adm/coursedocs?".$form.'=1',
+ text=>$text,
+ faq=>273,
+ bug=>'Instructor Interface'});
+}
+
# ================================================================ Main Handler
sub handler {
my $r = shift;
@@ -2304,22 +2395,28 @@ sub handler {
'Docs_About_Bulletin_Board,Docs_Editing_Templated_Pages');
$help{'My Personal Info'} = &Apache::loncommon::help_open_topic(
'Docs_About_My_Personal_Info,Docs_Editing_Templated_Pages');
+ $help{'Group Files'} = &Apache::loncommon::help_open_topic('Docs_About_Group_Files');
$help{'Caching'} = &Apache::loncommon::help_open_topic('Caching');
# does this user have privileges to modify docs
my $allowed=&Apache::lonnet::allowed('mdc',$env{'request.course.id'});
-
if ($allowed && $env{'form.verify'}) {
+ &init_breadcrumbs('verify','Verify Content');
&verifycontent($r);
} elsif ($allowed && $env{'form.listsymbs'}) {
+ &init_breadcrumbs('listsymbs','List Symbs');
&list_symbs($r);
} elsif ($allowed && $env{'form.docslog'}) {
+ &init_breadcrumbs('docslog','Show Log');
&docs_change_log($r);
} elsif ($allowed && $env{'form.versions'}) {
+ &init_breadcrumbs('versions','Check/Set Resource Versions');
&checkversions($r);
} elsif ($allowed && $env{'form.dumpcourse'}) {
+ &init_breadcrumbs('dumpcourse','Dump '.&Apache::loncommon::course_type().' DOCS to Construction Space');
&dumpcourse($r);
} elsif ($allowed && $env{'form.exportcourse'}) {
+ &init_breadcrumbs('exportcourse','Export '.&Apache::loncommon::course_type().' to IMS');
&exportcourse($r);
} else {
# is this a standard course?
@@ -2498,6 +2595,7 @@ sub handler {
'scuf' => 'Score Upload Form',
'bull' => 'Bulletin Board',
'mypi' => 'My Personal Info',
+ 'grpo' => 'Group Files',
'abou' => 'About User',
'imsf' => 'Import IMS package',
'file' => 'File',
@@ -2537,7 +2635,7 @@ sub handler {
$containertag
@@ -2651,7 +2750,7 @@ ENDFORM
$uploadtag
-
+
@@ -2840,7 +2948,7 @@ $lt{'comment'}:
-
+
$help{'Adding_Fol
-
+
$help{'Adding_Ext
-
+
$help{'Syllabus'}
@@ -2867,8 +2975,8 @@ $help{'Syllabus'}
-
+
$help{'My Personal Info'}