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

matthew lon-capa-cvs@mail.lon-capa.org
Thu, 26 Aug 2004 21:42:40 -0000


matthew		Thu Aug 26 17:42:40 2004 EDT

  Modified files:              
    /loncom/interface	loncommon.pm lonaboutme.pm 
  Log:
  Added &loncommon::track_student_link to provide links to /adm/tracker and
  made lonaboutme provide a link iff the user is has permission to view 
  student activity.
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.207 loncom/interface/loncommon.pm:1.208
--- loncom/interface/loncommon.pm:1.207	Wed Aug 25 14:13:00 2004
+++ loncom/interface/loncommon.pm	Thu Aug 26 17:42:40 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.207 2004/08/25 18:13:00 matthew Exp $
+# $Id: loncommon.pm,v 1.208 2004/08/26 21:42:40 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1829,9 +1829,28 @@
     if ($fontcolor) { 
         $linktext='<font color="'.$fontcolor.'">'.$linktext.'</font>'; 
     }
-    return "<a href='/public/$domain/$coursedir/syllabus'>$linktext</a>";
+    return qq{<a href="/public/$domain/$coursedir/syllabus">$linktext</a>};
 }
 
+sub track_student_link {
+    my ($linktext,$sname,$sdom,$target) = @_;
+    my $link ="/adm/trackstudent";
+    my $title = 'View recent activity';
+    if (defined($sname) && $sname !~ /^\s*$/ &&
+        defined($sdom)  && $sdom  !~ /^\s*$/) {
+        $link .= "?selected_student=$sname:$sdom";
+        $title .= ' of this student';
+    }
+    if (defined($target) && $target !~ /^\s*$/) {
+        $target = qq{target="$target"};
+    } else {
+        $target = '';
+    }
+    return qq{<a href="$link" title="$title" $target>$linktext</a>};
+}
+
+
+
 =pod
 
 =back
Index: loncom/interface/lonaboutme.pm
diff -u loncom/interface/lonaboutme.pm:1.30 loncom/interface/lonaboutme.pm:1.31
--- loncom/interface/lonaboutme.pm:1.30	Wed Aug 25 14:08:11 2004
+++ loncom/interface/lonaboutme.pm	Thu Aug 26 17:42:40 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # "About Me" Personal Information
 #
-# $Id: lonaboutme.pm,v 1.30 2004/08/25 18:08:11 sakharuk Exp $
+# $Id: lonaboutme.pm,v 1.31 2004/08/26 21:42:40 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -209,8 +209,18 @@
                           &mt('Shared by course faculty and staff').
                           &Apache::loncommon::help_open_topic("Course_Face_To_Face_Records,Course_Critical_Message").
 '<br />');
-	    &Apache::lonmsg::disfacetoface($r,$cnum,$cdom);
-            $r->print(&Apache::loncommon::noteswrapper('Add Records',$cnum,$cdom));
+                &Apache::lonmsg::disfacetoface($r,$cnum,$cdom);
+                $r->print('<hr />');
+                if (&Apache::lonnet::allowed('vsa',
+                                             $ENV{'request.course.id'}) ||
+                    &Apache::lonnet::allowed('vsa',
+                                             $ENV{'request.course.id'}.'/'.
+                                             $ENV{'request.course.sec'})) {
+                    $r->print(&Apache::loncommon::track_student_link
+                              ('View recent activity by this student',
+                               $cnum,$cdom).('&nbsp;'x2));
+                }
+                $r->print(&Apache::loncommon::noteswrapper('Add Records',$cnum,$cdom));
 	    } else {
 		$r->print('\\\\\textbf{'.&mt('User Notes, Records of Face-To-Face Discussions, and Critical Messages in Course').'}\\\\'.&mt('Shared by course faculty and staff').'\\\\\\\\');
 		&Apache::lonmsg::disfacetoface($r,$cnum,$cdom);