[LON-CAPA-cvs] cvs: loncom /homework bridgetask.pm

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 07 Dec 2006 20:44:55 -0000


albertel		Thu Dec  7 15:44:55 2006 EDT

  Modified files:              
    /loncom/homework	bridgetask.pm 
  Log:
  - add a timestamp to when the lock was aquired and display it on the queue overview screen
  
  
Index: loncom/homework/bridgetask.pm
diff -u loncom/homework/bridgetask.pm:1.213 loncom/homework/bridgetask.pm:1.214
--- loncom/homework/bridgetask.pm:1.213	Fri Dec  1 17:53:08 2006
+++ loncom/homework/bridgetask.pm	Thu Dec  7 15:44:55 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: bridgetask.pm,v 1.213 2006/12/01 22:53:08 albertel Exp $
+# $Id: bridgetask.pm,v 1.214 2006/12/07 20:44:55 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1577,8 +1577,16 @@
 		my $ekey=&escape($key);
 		my ($action,$description,$status)=('select',&mt('Select'));
 		if (exists($queue{"$key\0locked"})) {
+		    my $locker = $queue{"$key\0locked"};
+		    my $time;
+		    if (ref($queue{"$key\0locked"}) eq 'ARRAY') {
+			($locker, $time) = @{$queue{"$key\0locked"}};
+			$time = 
+			    &Apache::lonnavmaps::timeToHumanString($time,
+								   'start');
+		    }
 		    my $me=$env{'user.name'}.':'.$env{'user.domain'};
-		    $status=&mt('Locked by <tt>[_1]</tt>',$queue{"$key\0locked"});
+		    $status=&mt('Locked by <tt>[_1]</tt> [_2]',$locker,$time);
 		    if ($me eq $queue{"$key\0locked"}) {
 			($action,$description)=('resume',&mt('Resume'));
 		    } else {
@@ -1797,7 +1805,7 @@
     my (undef,$cid)=&Apache::lonnet::whichuser();
     my $cnum=$env{'course.'.$cid.'.num'};
     my $cdom=$env{'course.'.$cid.'.domain'};
-    my $success=&Apache::lonnet::newput($queue,{"$todo\0locked"=> $me},
+    my $success=&Apache::lonnet::newput($queue,{"$todo\0locked"=> [$me,time]},
 					$cdom,$cnum);
     &Apache::lonxml::debug("success $success $todo");
     if ($success eq 'ok') {