[LON-CAPA-cvs] cvs: loncom /interface lonaboutme.pm loncommon.pm loncommunicate.pm loncreateuser.pm lonmsg.pm lonparmset.pm lonpickstudent.pm
www
lon-capa-cvs@mail.lon-capa.org
Mon, 30 Dec 2002 14:10:58 -0000
This is a MIME encoded message
--www1041257458
Content-Type: text/plain
www Mon Dec 30 09:10:58 2002 EDT
Modified files:
/loncom/interface lonaboutme.pm loncommon.pm loncommunicate.pm
loncreateuser.pm lonmsg.pm lonparmset.pm
lonpickstudent.pm
Log:
Finished "Select Student" screen.
Incorporation of the "Select Student" screen in messages and parmset.
Clean-up for "Face-To-Face" functionality.
--www1041257458
Content-Type: text/plain
Content-Disposition: attachment; filename="www-20021230091058.txt"
Index: loncom/interface/lonaboutme.pm
diff -u loncom/interface/lonaboutme.pm:1.8 loncom/interface/lonaboutme.pm:1.9
--- loncom/interface/lonaboutme.pm:1.8 Fri Dec 27 11:33:36 2002
+++ loncom/interface/lonaboutme.pm Mon Dec 30 09:10:58 2002
@@ -1,7 +1,7 @@
# The LearningOnline Network
# "About Me" Personal Information
#
-# $Id: lonaboutme.pm,v 1.8 2002/12/27 16:33:36 www Exp $
+# $Id: lonaboutme.pm,v 1.9 2002/12/30 14:10:58 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -155,7 +155,9 @@
}
if ($ENV{'request.course.id'}) {
if (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'})) {
+ $r->print('<hr /><h3>User Notes, Records of Face-To-Face Discussions, and Critical Messages in Course</h3>Shared by course faculty and staff<br />');
&Apache::lonmsg::disfacetoface($r,$cnum,$cdom);
+ $r->print(&Apache::loncommon::noteswrapper('Add Records',$cnum,$cdom));
}
}
$r->print('</body></html>');
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.73 loncom/interface/loncommon.pm:1.74
--- loncom/interface/loncommon.pm:1.73 Thu Dec 26 10:38:54 2002
+++ loncom/interface/loncommon.pm Mon Dec 30 09:10:58 2002
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.73 2002/12/26 15:38:54 www Exp $
+# $Id: loncommon.pm,v 1.74 2002/12/30 14:10:58 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -311,7 +311,44 @@
END
}
+sub studentbrowser_javascript {
+ unless ($ENV{'request.course.id'}) { return ''; }
+ unless (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'})) {
+ return '';
+ }
+ return (<<'ENDSTDBRW');
+<script type="text/javascript" language="Javascript" >
+ var stdeditbrowser;
+ function openstdbrowser(formname,uname,udom) {
+ var url = '/adm/pickstudent?';
+ var filter;
+ eval('filter=document.'+formname+'.'+uname+'.value;');
+ if (filter != null) {
+ if (filter != '') {
+ url += 'filter='+filter+'&';
+ }
+ }
+ url += 'form=' + formname + '&unameelement='+uname+
+ '&udomelement='+udom;
+ var title = 'Student Browser';
+ var options = 'scrollbars=1,resizable=1,menubar=0';
+ options += ',width=700,height=600';
+ stdeditbrowser = open(url,title,options,'1');
+ stdeditbrowser.focus();
+ }
+</script>
+ENDSTDBRW
+}
+sub selectstudent_link {
+ my ($form,$unameele,$udomele)=@_;
+ unless ($ENV{'request.course.id'}) { return ''; }
+ unless (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'})) {
+ return '';
+ }
+ return "<a href='".'javascript:openstdbrowser("'.$form.'","'.$unameele.
+ '","'.$udomele.'");'."'>Select</a>";
+}
###############################################################
@@ -1009,6 +1046,13 @@
my ($link,$un,$do)=@_;
return
"<a href='/adm/email?compose=individual&recname=$un&recdom=$do'>$link</a>";
+}
+# --------------------------------------------------------------- Notes Wrapper
+
+sub noteswrapper {
+ my ($link,$un,$do)=@_;
+ return
+"<a href='/adm/email?recordftf=retrieve&recname=$un&recdom=$do'>$link</a>";
}
# ------------------------------------------------------------- Aboutme Wrapper
Index: loncom/interface/loncommunicate.pm
diff -u loncom/interface/loncommunicate.pm:1.14 loncom/interface/loncommunicate.pm:1.15
--- loncom/interface/loncommunicate.pm:1.14 Fri Dec 27 11:33:36 2002
+++ loncom/interface/loncommunicate.pm Mon Dec 30 09:10:58 2002
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Communicate
#
-# $Id: loncommunicate.pm,v 1.14 2002/12/27 16:33:36 www Exp $
+# $Id: loncommunicate.pm,v 1.15 2002/12/30 14:10:58 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -80,7 +80,7 @@
<b><a href="/adm/email?compose=upload">Distribute messages from uploaded file to course</a></b>
</td></tr>
<tr><td bgcolor="#FFFFAA">
- <b><a href="/adm/email?recordftf=query">User records of face-to-face discussions and critical messages</a></b>
+ <b><a href="/adm/email?recordftf=query">User notes, records of face-to-face discussions, and critical messages</a></b>
</td></tr>
END
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.45 loncom/interface/loncreateuser.pm:1.46
--- loncom/interface/loncreateuser.pm:1.45 Mon Nov 25 13:44:33 2002
+++ loncom/interface/loncreateuser.pm Mon Dec 30 09:10:58 2002
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Create a user
#
-# $Id: loncreateuser.pm,v 1.45 2002/11/25 18:44:33 matthew Exp $
+# $Id: loncreateuser.pm,v 1.46 2002/12/30 14:10:58 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -47,7 +47,7 @@
# 11/12,11/13,11/15 Scott Harrison
# 02/11/02 Matthew Hall
#
-# $Id: loncreateuser.pm,v 1.45 2002/11/25 18:44:33 matthew Exp $
+# $Id: loncreateuser.pm,v 1.46 2002/12/30 14:10:58 www Exp $
###
package Apache::loncreateuser;
@@ -102,18 +102,22 @@
my $domform = &Apache::loncommon::select_dom_form($defdom,'ccdomain');
my $bodytag =&Apache::loncommon::bodytag(
'Create Users, Change User Privileges');
+ my $selscript=&Apache::loncommon::studentbrowser_javascript();
+ my $sellink=&Apache::loncommon::selectstudent_link
+ ('crtuser','ccuname','ccdomain');
$r->print(<<"ENDDOCUMENT");
<html>
<head>
<title>The LearningOnline Network with CAPA</title>
+$selscript
</head>
$bodytag
-<form action="/adm/createuser" method="post">
+<form action="/adm/createuser" method="post" name="crtuser">
<input type="hidden" name="phase" value="get_user_info">
<p>
<table>
<tr><td>Username:</td><td><input type="text" size="15" name="ccuname">
-</td></tr><tr><td>
+</td><td rowspan="2">$sellink</td></tr><tr><td>
Domain:</td><td>$domform</td></tr>
</table>
</p>
Index: loncom/interface/lonmsg.pm
diff -u loncom/interface/lonmsg.pm:1.45 loncom/interface/lonmsg.pm:1.46
--- loncom/interface/lonmsg.pm:1.45 Fri Dec 27 11:33:36 2002
+++ loncom/interface/lonmsg.pm Mon Dec 30 09:10:58 2002
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines for messaging
#
-# $Id: lonmsg.pm,v 1.45 2002/12/27 16:33:36 www Exp $
+# $Id: lonmsg.pm,v 1.46 2002/12/30 14:10:58 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -533,10 +533,11 @@
'<table>');
unless (($broadcast eq 'group') || ($broadcast eq 'upload')) {
my $domform = &Apache::loncommon::select_dom_form($defdom,'recdomain');
-
+ my $selectlink=&Apache::loncommon::selectstudent_link
+ ('compemail','recuname','recdomain');
$r->print(<<"ENDREC");
<table>
-<tr><td>Username:</td><td><input type=text size=12 name=recuname value="$ENV{'form.recname'}"></td></tr>
+<tr><td>Username:</td><td><input type=text size=12 name=recuname value="$ENV{'form.recname'}"></td><td rowspan="2">$selectlink</td></tr>
<tr><td>Domain:</td>
<td>$domform</td></tr>
ENDREC
@@ -623,7 +624,7 @@
}
# Check to see if there were any messages.
if ($result eq '') {
- $r->print("<p><b>No face-to-face records or critical messages in this course.</b></p>");
+ $r->print("<p><b>No notes, face-to-face discussion records, or critical messages in this course.</b></p>");
} else {
$r->print($result);
}
@@ -636,16 +637,25 @@
unless (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'})) {
return;
}
+# from query string
+ if ($ENV{'form.recname'}) { $ENV{'form.recuname'}=$ENV{'form.recname'}; }
+ if ($ENV{'form.recdom'}) { $ENV{'form.recdomain'}=$ENV{'form.recdom'}; }
+
my $defdom=$ENV{'user.domain'};
+# already filled in
if ($ENV{'form.recdomain'}) { $defdom=$ENV{'form.recdomain'}; }
+# generate output
my $domform = &Apache::loncommon::select_dom_form($defdom,'recdomain');
+ my $stdbrws = &Apache::loncommon::selectstudent_link
+ ('stdselect','recuname','recdomain');
$r->print(<<"ENDTREC");
-<h2>User Records of Face-To-Face Discussions and Critical Messages in Course</h2>
-<form method="post" action="/adm/email">
+<h3>User Notes, Records of Face-To-Face Discussions, and Critical Messages in Course</h3>
+<form method="post" action="/adm/email" name="stdselect">
<input type="hidden" name="recordftf" value="retrieve" />
<table>
<tr><td>Username:</td><td><input type=text size=12 name=recuname value="$ENV{'form.recuname'}"></td>
<td rowspan="2">
+$stdbrws
<input type="submit" value="Retrieve discussion and message records"></td>
</tr>
<tr><td>Domain:</td>
@@ -663,6 +673,8 @@
'Record ['.$ENV{'form.recuname'}.':'.$ENV{'form.recdomain'}.']',
$ENV{'form.newrecord'});
}
+ $r->print('<h3>'.&Apache::loncommon::plainname($ENV{'form.recuname'},
+ $ENV{'form.recdomain'}).'</h3>');
&disfacetoface($r,$ENV{'form.recuname'},$ENV{'form.recdomain'});
$r->print(<<ENDRHEAD);
<form method="post" action="/adm/email">
@@ -702,7 +714,8 @@
&Apache::lonnet::put('email_status',{'recnewemail'=>0});
# --------------------------------------------------------------- Render Output
- $r->print('<html><head><title>EMail and Messaging</title></head>'.
+ $r->print('<html><head><title>EMail and Messaging</title>'.
+ &Apache::loncommon::studentbrowser_javascript().'</head>'.
&Apache::loncommon::bodytag('EMail and Messages'));
if ($ENV{'form.display'}) {
my $msgid=$ENV{'form.display'};
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.80 loncom/interface/lonparmset.pm:1.81
--- loncom/interface/lonparmset.pm:1.80 Mon Dec 9 17:27:20 2002
+++ loncom/interface/lonparmset.pm Mon Dec 30 09:10:58 2002
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set parameters for assessments
#
-# $Id: lonparmset.pm,v 1.80 2002/12/09 22:27:20 www Exp $
+# $Id: lonparmset.pm,v 1.81 2002/12/30 14:10:58 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -288,6 +288,10 @@
my $bodytag=&Apache::loncommon::bodytag('Set Course Parameters','',
'onUnload="pclose()"');
+ my $chooseopt=&Apache::loncommon::select_dom_form($udom,'udom').' '.
+ &Apache::loncommon::selectstudent_link('parmform','uname','udom');
+ my $selscript=&Apache::loncommon::studentbrowser_javascript();
+
$r->print(<<ENDHEAD);
<html>
<head>
@@ -341,6 +345,7 @@
newWin.focus();
}
</script>
+$selscript
</head>
$bodytag
<form method="post" action="/adm/parmset" name="envform">
@@ -358,7 +363,7 @@
or ID
<input type="text" value="$id" size="12" name="id">
at Domain
-<input type="text" value="$udom" size="6" name="udom">
+$chooseopt
</b>
<input type="hidden" value='' name="pres_value">
<input type="hidden" value='' name="pres_type">
Index: loncom/interface/lonpickstudent.pm
diff -u loncom/interface/lonpickstudent.pm:1.1 loncom/interface/lonpickstudent.pm:1.2
--- loncom/interface/lonpickstudent.pm:1.1 Thu Dec 26 10:15:34 2002
+++ loncom/interface/lonpickstudent.pm Mon Dec 30 09:10:58 2002
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Pick a student from the classlist
#
-# $Id: lonpickstudent.pm,v 1.1 2002/12/26 15:15:34 www Exp $
+# $Id: lonpickstudent.pm,v 1.2 2002/12/30 14:10:58 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -53,9 +53,19 @@
$r->print('<body>Not in a course</body>');
return OK;
}
+
+ unless (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'})) {
+ $r->print('<body>No course listing</body>');
+ return OK;
+ }
+
+
&Apache::loncommon::get_unprocessed_cgi
- ($ENV{'QUERY_STRING'},['filter']);
+ ($ENV{'QUERY_STRING'},['filter','form','unameelement','udomelement']);
+ my $filter=$ENV{'form.filter'};
+ $filter=~s/\W//g;
+ unless ($filter) { $filter='.'; }
my $classlist=&Apache::loncoursedata::DownloadClasslist
($ENV{'request.course.id'},
@@ -64,20 +74,47 @@
# --------------------------------------- There is such a user, get environment
$r->print(&Apache::loncommon::bodytag("Selecting a User"));
-
- my $allowed=&Apache::lonnet::allowed('srm',$ENV{'request.course.id'});
-
+ $r->print(<<ENDSCRIPT);
+<script>
+function gochoose(uname,udom) {
+ opener.document.$ENV{'form.form'}.$ENV{'form.unameelement'}.value=uname;
+ var slct=opener.document.$ENV{'form.form'}.$ENV{'form.udomelement'};
+ var i;
+ for (i=0;i<slct.length;i++) {
+ if (slct[i]==udom) { slct.selectedIndex=i; }
+ }
+ self.close();
+}
+</script>
+ENDSCRIPT
+
+ $r->print('<h3>'.$ENV{'course.'.$ENV{'request.course.id'}.'.description'}.
+ '</h3>');
+ if ($filter ne '.') {
+ $r->print('Name starting with "'.$filter.'"<br />');
+ }
+ $r->print('<form><table>');
foreach (sort keys %$classlist) {
if ($_=~/^(\w+)\:(\w+)\:studentInformation$/) {
my ($uname,$udom)=($1,$2);
- $r->print($classlist->{$_}->{'lastname'}.', '.
- $classlist->{$_}->{'firstname'}.' '.
- $classlist->{$_}->{'middlename'}.' '.
- $classlist->{$_}->{'generation'}.'<br>');
+ if (($uname=~/^$filter/) ||
+ ($classlist->{$_}->{'lastname'}=~/^$filter/i)) {
+ $r->print('<tr><td>'.
+ '<input type="button" value="Select" onClick="gochoose('.
+ "'".$uname."','".$udom."')".'" /></td>'.
+ '<td><tt>'.$uname.'</tt></td><td><tt>'.$udom.
+ '</tt></td><td>'.
+ &Apache::loncommon::aboutmewrapper(
+ $classlist->{$_}->{'lastname'}.', '.
+ $classlist->{$_}->{'firstname'}.' '.
+ $classlist->{$_}->{'middlename'}.' '.
+ $classlist->{$_}->{'generation'},
+ $uname,$udom).'</td></tr>');
+ }
}
}
- $r->print('</body></html>');
+ $r->print('</table></form></body></html>');
return OK;
}
--www1041257458--