[LON-CAPA-cvs] cvs: loncom /auth lonroles.pm /interface lonaboutme.pm loncommon.pm londocs.pm lonmsg.pm lonsyllabus.pm

www lon-capa-cvs@mail.lon-capa.org
Wed, 28 Aug 2002 14:11:28 -0000


This is a MIME encoded message

--www1030543888
Content-Type: text/plain

www		Wed Aug 28 10:11:28 2002 EDT

  Modified files:              
    /loncom/auth	lonroles.pm 
    /loncom/interface	lonaboutme.pm loncommon.pm londocs.pm lonmsg.pm 
                     	lonsyllabus.pm 
  Log:
  Convenience links to about-me page, syllabus, and email.
  
  
--www1030543888
Content-Type: text/plain
Content-Disposition: attachment; filename="www-20020828101128.txt"

Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.41 loncom/auth/lonroles.pm:1.42
--- loncom/auth/lonroles.pm:1.41	Wed Aug 21 13:18:08 2002
+++ loncom/auth/lonroles.pm	Wed Aug 28 10:11:27 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # User Roles Screen
 #
-# $Id: lonroles.pm,v 1.41 2002/08/21 17:18:08 www Exp $
+# $Id: lonroles.pm,v 1.42 2002/08/28 14:11:27 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -322,7 +322,9 @@
 		    }
                     my $tcourseid=$tdom.'_'.$trest;
                     if ($ENV{'course.'.$tcourseid.'.description'}) {
-                        $twhere=$ENV{'course.'.$tcourseid.'.description'};
+                        $twhere=
+&Apache::loncommon::syllabuswrapper($ENV{'course.'.$tcourseid.'.description'},
+$trest,$tdom);
                     } else {
                         my %newhash=Apache::lonnet::coursedescription
                             ($tcourseid);
Index: loncom/interface/lonaboutme.pm
diff -u loncom/interface/lonaboutme.pm:1.3 loncom/interface/lonaboutme.pm:1.4
--- loncom/interface/lonaboutme.pm:1.3	Tue Aug 27 17:05:04 2002
+++ loncom/interface/lonaboutme.pm	Wed Aug 28 10:11:27 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # "About Me" Personal Information
 #
-# $Id: lonaboutme.pm,v 1.3 2002/08/27 21:05:04 www Exp $
+# $Id: lonaboutme.pm,v 1.4 2002/08/28 14:11:27 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -70,7 +70,9 @@
     $r->print(&Apache::loncommon::bodytag
                            ("Personal Information",$forcestudent,'','',$cdom));
     $r->print('<h1>'.&Apache::loncommon::plainname($cnum,$cdom).'</h1><h3>'.
-              $Apache::lonnet::domaindescription{$cdom}.'</h3>');
+              $Apache::lonnet::domaindescription{$cdom}.'</h3>'.
+    '<p>'.&Apache::loncommon::messagewrapper('Send me a message',$cnum,$cdom).
+    '</p>');
     my %syllabus=&Apache::lonnet::dump('aboutme',$cdom,$cnum);
     my $allowed=0;
 
@@ -81,8 +83,8 @@
        if ($forcestudent) { $allowed=0; }
  
        if ($allowed) {
-          $r->print(
-	  '<p><a href="'.$r->uri.'?forcestudent=1">Show Student View</a></p>');
+          $r->print('<p><b>Privacy Note:</b> The information you submit can be viewed by anybody who is logged into LON-CAPA. Do not provide information that you are not ready to share publically.</p>'.
+	  '<p><a href="'.$r->uri.'?forcestudent=1">Show Public View</a></p>');
       }
       if (($ENV{'form.uploaddoc.filename'}) &&
           ($ENV{'form.storeupl'}) && ($allowed)) {
@@ -99,11 +101,7 @@
                $field=~s/\s+$//s;
                $field=~s/\</\&lt\;/g;
                $field=~s/\>/\&gt\;/g;
-	       if ($field) {
-		   $syllabus{$_}=$field;
-               } else {
-                   delete $syllabus{$_};
-               }
+	       $syllabus{$_}=$field;
            }
            $syllabus{'uploaded.lastmodified'}=time;
            &Apache::lonnet::put('aboutme',\%syllabus,$cdom,$cnum);
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.61 loncom/interface/loncommon.pm:1.62
--- loncom/interface/loncommon.pm:1.61	Tue Aug 27 12:49:20 2002
+++ loncom/interface/loncommon.pm	Wed Aug 28 10:11:27 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.61 2002/08/27 16:49:20 www Exp $
+# $Id: loncommon.pm,v 1.62 2002/08/28 14:11:27 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -939,8 +939,11 @@
     my %names=&Apache::lonnet::get('environment',
                     ['firstname','middlename','lastname','generation'],
 					 $udom,$uname);
-    return $names{'firstname'}.' '.$names{'middlename'}.' '.
+    my $name=$names{'firstname'}.' '.$names{'middlename'}.' '.
 	$names{'lastname'}.' '.$names{'generation'};
+    $name=~s/\s+$//;
+    $name=~s/\s+/ /g;
+    return $name;
 }
 
 # ------------------------------------------------------------------ Screenname
@@ -950,6 +953,28 @@
     my %names=
  &Apache::lonnet::get('environment',['screenname'],$udom,$uname);
     return $names{'screenname'};
+}
+
+# ------------------------------------------------------------- Message Wrapper
+
+sub messagewrapper {
+    my ($link,$un,$do)=@_;
+    return 
+"<a href='/adm/email?compose=individual&recname=$un&recdom=$do'>$link</a>";
+}
+# ------------------------------------------------------------- Aboutme Wrapper
+
+sub aboutmewrapper {
+    my ($link,$un,$do)=@_;
+    return "<a href='/adm/$do/$un/aboutme'>$link</a>";
+}
+
+# ------------------------------------------------------------ Syllabus Wrapper
+
+
+sub syllabuswrapper {
+    my ($link,$un,$do)=@_;
+    return "<a href='/public/$do/$un/syllabus'>$link</a>";
 }
 
 # ---------------------------------------------------------------- Language IDs
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.12 loncom/interface/londocs.pm:1.13
--- loncom/interface/londocs.pm:1.12	Tue Aug 27 09:01:26 2002
+++ loncom/interface/londocs.pm	Wed Aug 28 10:11:27 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.12 2002/08/27 13:01:26 www Exp $
+# $Id: londocs.pm,v 1.13 2002/08/28 14:11:27 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -256,18 +256,22 @@
 </form>
 </td><td>
 <form action="/adm/coursedocs" method="post" name="newfolder">
+<input type=hidden name="importdetail" value="">
 <input name="newfolder" type="button" onClick="javascript:newfolder();"
 value="New Folder" />
 </form>
 <form action="/adm/coursedocs" method="post" name="newext">
+<input type=hidden name="importdetail" value="">
 <input name="newext" type="button" onClick="javascript:newext();"
 value="External Resource" />
 </form>
 <form action="/adm/coursedocs" method="post" name="newsyl">
+<input type=hidden name="importdetail" value="">
 <input name="newsyl" type="button" onClick="javascript:newsyl();"
 value="Syllabus" />
 </form>
 <form action="/adm/coursedocs" method="post" name="newaboutme">
+<input type=hidden name="importdetail" value="">
 <input name="newaboutme" type="button" onClick="javascript:newaboutme();"
 value="My Personal Info" />
 </form>
Index: loncom/interface/lonmsg.pm
diff -u loncom/interface/lonmsg.pm:1.36 loncom/interface/lonmsg.pm:1.37
--- loncom/interface/lonmsg.pm:1.36	Mon Jul 29 18:17:05 2002
+++ loncom/interface/lonmsg.pm	Wed Aug 28 10:11:27 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging
 #
-# $Id: lonmsg.pm,v 1.36 2002/07/29 22:17:05 www Exp $
+# $Id: lonmsg.pm,v 1.37 2002/08/28 14:11:27 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -314,9 +314,12 @@
         my %content=&unpackagemsg($what{$_});
         next if ($content{'senderdomain'} eq '');
         $content{'message'}=~s/\n/\<br\>/g;
-        $result.='<hr>From: <b>'.$content{'sendername'}.'@'.
-            $content{'senderdomain'}.'</b> ('.$content{'time'}.
-            ')<br>Subject: '.$content{'subject'}.
+        $result.='<hr>From: <b>'.
+&Apache::loncommon::aboutmewrapper(
+ &Apache::loncommon::plainname($content{'sendername'},$content{'senderdomain'}),$content{'sendername'},$content{'senderdomain'}).'</b> ('.
+$content{'sendername'}.'@'.
+            $content{'senderdomain'}.') '.$content{'time'}.
+            '<br>Subject: '.$content{'subject'}.
             '<br><blockquote>'.
               &Apache::lontexconvert::msgtexconverted($content{'message'}).
             '</blockquote>'.
@@ -358,7 +361,7 @@
 <form action="/adm/email" method=post>
 <input type=hidden name=sendreply value="$msgid">
 Subject: <input type=text size=50 name=subject value="$subject"><p>
-<textarea name=message cols=64 rows=10 wrap=hard>
+<textarea name=message cols=84 rows=10 wrap=hard>
 $quotemsg
 </textarea><p>
 $dispcrit
@@ -457,6 +460,7 @@
 	   $content{'sendername'}.' at '.$content{'senderdomain'};
     }
     my $defdom=$ENV{'user.domain'};
+    if ($ENV{'form.recdom'}) { $defdom=$ENV{'form.recdom'}; }
       $r->print(
                 '<form action="/adm/email"  name="compemail" method="post"'.
                 ' enctype="multipart/form-data">'."\n".
@@ -467,7 +471,7 @@
 
        $r->print(<<"ENDREC");
 <table>
-<tr><td>Username:</td><td><input type=text size=12 name=recuname></td></tr>
+<tr><td>Username:</td><td><input type=text size=12 name=recuname value="$ENV{'form.recname'}"></td></tr>
 <tr><td>Domain:</td>
 <td>$domform</td></tr>
 ENDREC
@@ -479,7 +483,7 @@
 <input type=text size=50 name=additionalrec></td></tr>
 <tr><td>Subject:</td><td><input type=text size=50 name=subject value="$dissub">
 </td></tr></table>
-<textarea name=message cols=60 rows=10 wrap=hard>$dismsg
+<textarea name=message cols=80 rows=10 wrap=hard>$dismsg
 </textarea><p>
 $dispcrit
 <input type=submit value="$func Mail">
@@ -532,22 +536,24 @@
 # --------------------------- Get query string for limited number of parameters
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
         ['display','replyto','forward','markread','markdel','markunread',
-         'sendreply','compose','sendmail','critical']);
+         'sendreply','compose','sendmail','critical','recname','recdom']);
 
 # --------------------------------------------------------------- Render Output
   
-  $r->print('<html><head><title>EMail and Messaging</title></head>');
-  $r->print(
-   '<body bgcolor="#FFFFFF"><img align=right src=/adm/lonIcons/lonlogos.gif>');
-  $r->print('<h1>EMail</h1>');
+  $r->print('<html><head><title>EMail and Messaging</title></head>'.
+            &Apache::loncommon::bodytag('EMail and Messages'));
   if ($ENV{'form.display'}) {
       my $msgid=$ENV{'form.display'};
       &statuschange($msgid,'read');
       my %message=&Apache::lonnet::get('nohist_email',[$msgid]);
       my %content=&unpackagemsg($message{$msgid});
       $r->print('<b>Subject:</b> '.$content{'subject'}.
-             '<br><b>From:</b> '.$content{'sendername'}.' at '.
-                                 $content{'senderdomain'}.
+             '<br><b>From:</b> '.
+&Apache::loncommon::aboutmewrapper(
+&Apache::loncommon::plainname($content{'sendername'},$content{'senderdomain'}),
+$content{'sendername'},$content{'senderdomain'}).' ('.
+                                 $content{'sendername'}.' at '.
+                                 $content{'senderdomain'}.') '.
              '<br><b>Time:</b> '.$content{'time'}.'<p>'.
              '<table border=2><tr bgcolor="#FFFFAA"><td>Functions:</td>'.
            '<td><a href="/adm/email?replyto='.&Apache::lonnet::escape($msgid).
Index: loncom/interface/lonsyllabus.pm
diff -u loncom/interface/lonsyllabus.pm:1.6 loncom/interface/lonsyllabus.pm:1.7
--- loncom/interface/lonsyllabus.pm:1.6	Tue Aug 27 16:29:54 2002
+++ loncom/interface/lonsyllabus.pm	Wed Aug 28 10:11:27 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Syllabus
 #
-# $Id: lonsyllabus.pm,v 1.6 2002/08/27 20:29:54 www Exp $
+# $Id: lonsyllabus.pm,v 1.7 2002/08/28 14:11:27 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -49,7 +49,8 @@
 ENDDOCUMENT
     my (undef,undef,$cdom,$cnum)=split(/\//,$r->uri);
 # Is this even a course?
-    if (&Apache::lonnet::homeserver($cnum,$cdom) eq 'no_host') {
+    my $homeserver=&Apache::lonnet::homeserver($cnum,$cdom); 
+    if ($homeserver eq 'no_host') {
 	$r->print('<body>No syllabus available</body>');
         return OK;
     }
@@ -58,11 +59,17 @@
        'aaa_instructorinfo' => 'Instructor Information',
        'bbb_description'    => 'Course Description',
        'ccc_prereq'         => 'Prerequisites',
+       'cdc_classhours'     => 'Class Hours',
        'ddd_officehours'    => 'Office Hours',
        'eee_helproom'       => 'Helproom Hours',
+       'efe_projectinfo'    => 'Project Information',
        'fff_examinfo'       => 'Exam Information',
+       'fgf_deadlines'      => 'Deadlines',
        'ggg_grading'        => 'Grading Information',
-       'hhh_readings'       => 'Readings');
+       'hhh_readings'       => 'Readings',
+       'iii_coursepack'     => 'Coursepack',
+       'jjj_weblinks'       => 'Web Links',
+       'kkk_textbook'       => 'Textbook');
 
 # --------------------------------------------------------------- Force Student
     &Apache::loncommon::get_unprocessed_cgi
@@ -88,7 +95,8 @@
           if ($forcestudent) { $allowed=0; }
        }
        if ($allowed) {
-          $r->print(
+          $r->print('<p>This syllabus can be publically viewed at <tt>http://'.
+		    $Apache::lonnet::hostname{$homeserver}.$r->uri.'</tt></p>'.
 	  '<p><a href="'.$r->uri.'?forcestudent=1">Show Student View</a></p>');
       }
        if (($allowed) && ($ENV{'form.storesyl'})) {
@@ -97,11 +105,7 @@
                $field=~s/\s+$//s;
                $field=~s/\</\&lt\;/g;
                $field=~s/\>/\&gt\;/g;
-	       if ($field) {
-		   $syllabus{$_}=$field;
-               } else {
-                   delete $syllabus{$_};
-               }
+	       $syllabus{$_}=$field;
            }
            $syllabus{'uploaded.domain'}=$ENV{'user.domain'};
            $syllabus{'uploaded.name'}=$ENV{'user.name'};
@@ -112,7 +116,9 @@
 # ---------------------------------------------------------------- Get syllabus
     if (($syllabus{'uploaded.lastmodified'}) || ($allowed)) {
        $r->print('<table><tr><td>Uploaded:</td><td>'.
+ &Apache::loncommon::aboutmewrapper(
  &Apache::loncommon::plainname($syllabus{'uploaded.name'},
+                     $syllabus{'uploaded.domain'}),$syllabus{'uploaded.name'},
                      $syllabus{'uploaded.domain'}).
  '</td></tr><tr><td>Last updated</td><td>'.
                      localtime($syllabus{'uploaded.lastmodified'}).

--www1030543888--