[LON-CAPA-cvs] cvs: loncom /interface londocs.pm

www lon-capa-cvs@mail.lon-capa.org
Wed, 22 Oct 2003 21:41:11 -0000


www		Wed Oct 22 17:41:11 2003 EDT

  Modified files:              
    /loncom/interface	londocs.pm 
  Log:
  Working on setting resource versions from DOCS (not working yet).
  
  
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.87 loncom/interface/londocs.pm:1.88
--- loncom/interface/londocs.pm:1.87	Wed Oct 22 15:47:52 2003
+++ loncom/interface/londocs.pm	Wed Oct 22 17:41:11 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.87 2003/10/22 19:47:52 www Exp $
+# $Id: londocs.pm,v 1.88 2003/10/22 21:41:11 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -588,6 +588,7 @@
        my $monthsel='';
        my $weeksel='';
        my $daysel='';
+       my $allsel='';
        if ($ENV{'form.timerange'}==-1) {
 	   $seltext='since start of course';
            $startsel='selected';
@@ -603,13 +604,16 @@
        } elsif ($ENV{'form.timerange'}==86400) {
            $seltext=&mt('since yesterday').' ('.&Apache::lonlocal::locallocaltime($starttime).')';
            $daysel='selected';
+       } elsif ($ENV{'form.timerange'} eq 'all') {
+	   $allsel='all';
        }
        my %lt=&Apache::lonlocal::texthash
-	      ('st' => 'Since Start of Course',
-	       'lm' => 'Last Month',
-	       'lw' => 'Last Week',
-	       'sy' => 'Since Yesterday',
-	       'di' => 'Display',
+	      ('st' => 'Version changes since start of Course',
+	       'lm' => 'Version changes since last Month',
+	       'lw' => 'Version changes since last Week',
+	       'sy' => 'Version changes since Yesterday',
+               'al' => 'All Resources',
+	       'sd' => 'Display',
                'cc' => 'Content changed',
 	       'fi' => 'File',
 	       'md' => 'Modification Date',
@@ -620,12 +624,13 @@
        $r->print(<<ENDHEADERS);
 <form action="/adm/coursedocs" method="post">
 <select name="timerange">
+<option value='all' $allsel>$lt{'al'}</option>
 <option value="-1" $startsel>$lt{'st'}</option>
 <option value="2592000" $monthsel>$lt{'lm'}</option>
 <option value="604800" $weeksel>$lt{'lw'}</option>
 <option value="86400" $daysel>$lt{'sy'}</option>
 </select>
-<input type="submit" name="versions" value="$lt{'di'}" />
+<input type="submit" name="versions" value="$lt{'sd'}" />
 </form>
 <h3>$lt{'cc'} $seltext</h3>
 <table border="2">
@@ -641,11 +646,23 @@
              $r->print(
                  '<tr><td><a href="'.$linkurl.'" target="cat">'.$linkurl.
                  '</a></td><td>'.
-                 &Apache::lonlocal::locallocaltime($changes{$_}).'</td><td>'.
-		       $currentversion.'</td><td>');
+                 &Apache::lonlocal::locallocaltime($changes{$_}).
+                      '</td><td><font size="+2">'.
+		       $currentversion.'</font></td><td><font size="+2">');
 # Used in course
-	     $r->print('</td><td>');
+	     my $usedversion=$hash{'version_'.$linkurl};
+	     if ($usedversion) {
+		 $r->print($usedversion);
+	     } else {
+		 $r->print($currentversion);
+	     }
+	     $r->print('</font></td><td>');
 # Set version
+	     $r->print(&Apache::loncommon::select_form($usedversion,
+						       'set_version_'.$linkurl,
+                               ('' => '',
+                              'current' => 'current',
+                               map {$_,$_} (1..$currentversion))));
 	     $r->print('</td><td>');
              my $lastold=1;
              for (my $prevvers=1;$prevvers<$currentversion;$prevvers++) {
@@ -884,6 +901,10 @@
 # -----------------------------------------------------------------------------
     if ($allowed) {
        my $dumpbut=&dumpbutton();
+       my %lt=&Apache::lonlocal::texthash(
+					 'vc' => 'Verify Content',
+					 'cv' => 'Check/Set Resource Versions',
+					  );
        $r->print(<<ENDCOURSEVERIFY);
 <form name="renameform" method="post" action="/adm/coursedocs">
 <input type="hidden" name="title" />
@@ -897,9 +918,9 @@
 <form action="/adm/coursedocs" method="post" name="courseverify">
 <table bgcolor="#AAAAAA" width="100%" cellspacing="4" cellpadding="4">
 <tr><td bgcolor="#DDDDCC">
-<input type="submit" name="verify" value="Verify Content" />
+<input type="submit" name="verify" value="$lt{'vc'}" />
 </td><td bgcolor="#DDDDCC">
-<input type="submit" name="versions" value="Check Resource Versions" />
+<input type="submit" name="versions" value="$lt{'cv'}" />
 $dumpbut
 </td></tr></table>
 </form>