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

raeburn raeburn@source.lon-capa.org
Fri, 27 Mar 2009 04:59:31 -0000


raeburn		Fri Mar 27 04:59:31 2009 EDT

  Modified files:              
    /loncom/interface	loncommon.pm lonaboutme.pm 
  Log:
  - "Slot reservation history " link in "Functions" area of Personal Information page when 
     viewer is in course context and has "vgr" privilege in course.
  - &slot_reservations_link() provides a link to /adm/slotrequest to display slot reservation history for a specified user.
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.780 loncom/interface/loncommon.pm:1.781
--- loncom/interface/loncommon.pm:1.780	Fri Mar 27 02:14:43 2009
+++ loncom/interface/loncommon.pm	Fri Mar 27 04:59:30 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.780 2009/03/27 02:14:43 raeburn Exp $
+# $Id: loncommon.pm,v 1.781 2009/03/27 04:59:30 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2847,6 +2847,27 @@
 	&help_open_topic('View_recent_activity');
 }
 
+sub slot_reservations_link {
+    my ($linktext,$sname,$sdom,$target) = @_;
+    my $link ="/adm/slotrequest?command=showresv&origin=aboutme";
+    my $title = 'View slot reservation history';
+    if (defined($sname) && $sname !~ /^\s*$/ &&
+        defined($sdom)  && $sdom  !~ /^\s*$/) {
+        $link .= "&uname=$sname&udom=$sdom";
+        $title .= ' of this student';
+    }
+    if (defined($target) && $target !~ /^\s*$/) {
+        $target = qq{target="$target"};
+    } else {
+        $target = '';
+    }
+    $title = &mt($title);
+    $linktext = &mt($linktext);
+    return qq{<a href="$link" title="$title" $target>$linktext</a>};
+# FIXME uncomment when help item created: &help_open_topic('Slot_Reservation_History');
+
+}
+
 # ===================================================== Display a student photo
 
 
Index: loncom/interface/lonaboutme.pm
diff -u loncom/interface/lonaboutme.pm:1.116 loncom/interface/lonaboutme.pm:1.117
--- loncom/interface/lonaboutme.pm:1.116	Sat Mar 21 22:18:29 2009
+++ loncom/interface/lonaboutme.pm	Fri Mar 27 04:59:30 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Personal Information Page
 #
-# $Id: lonaboutme.pm,v 1.116 2009/03/21 22:18:29 bisitz Exp $
+# $Id: lonaboutme.pm,v 1.117 2009/03/27 04:59:30 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -255,6 +255,12 @@
 				&Apache::lontemplate::print_functions_content($r,&Apache::loncommon::track_student_link('View recent activity by this student',
 			  	 	$cnum,$cdom).('&nbsp;'x2));
 	    		}
+                        if (&Apache::lonnet::allowed('vgr', $env{'request.course.id'}) || 
+                            &Apache::lonnet::allowed('vgr', $env{'request.course.id'}.'/'.
+                                                     $env{'request.course.sec'})) {
+                            &Apache::lontemplate::print_functions_content($r,&Apache::loncommon::slot_reservations_link('Slot reservation history',
+                                        $cnum,$cdom).('&nbsp;'x2));
+                        }
 	    		&Apache::lontemplate::print_functions_content($r,&Apache::loncommon::noteswrapper(&mt('Add Records'),$cnum,$cdom));
 		}
 	&Apache::lontemplate::print_end_page_functions($r);