--- loncom/interface/Attic/londropadd.pm 2001/01/15 14:51:18 1.9
+++ loncom/interface/Attic/londropadd.pm 2003/11/07 21:04:37 1.90
@@ -1,217 +1,420 @@
# The LearningOnline Network with CAPA
# Handler to drop and add students in courses
#
-# (Handler to set parameters for assessments
+# $Id: londropadd.pm,v 1.90 2003/11/07 21:04:37 matthew Exp $
#
-# (Handler to resolve ambiguous file locations
+# Copyright Michigan State University Board of Trustees
#
-# (TeX Content Handler
+# This file is part of the LearningOnline Network with CAPA (LON-CAPA).
+#
+# LON-CAPA is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# LON-CAPA is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
#
-# 05/29/00,05/30,10/11 Gerd Kortemeyer)
+# You should have received a copy of the GNU General Public License
+# along with LON-CAPA; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# 10/11,10/12,10/16 Gerd Kortemeyer)
+# /home/httpd/html/adm/gpl.txt
+#
+# http://www.lon-capa.org/
+#
+# (Handler to set parameters for assessments
+#
+# (Handler to resolve ambiguous file locations
#
-# 11/20,11/21,11/22,11/23,11/24,11/25,11/27,11/28,
-# 12/08,12/12 Gerd Kortemeyer)
+# (TeX Content Handler
#
-# 12/26,12/27,12/28,
-# 01/01/01,01/15 Gerd Kortemeyer
+###############################################################
+##############################################################
package Apache::londropadd;
use strict;
-use Apache::lonnet;
+use Apache::lonnet();
+use Apache::loncommon();
+use Apache::lonhtmlcommon();
use Apache::Constants qw(:common :http REDIRECT);
+use Spreadsheet::WriteExcel;
+use Apache::lonlocal;
+###############################################################
+###############################################################
+sub header {
+ my $bodytag=&Apache::loncommon::bodytag('Enrollment Manager');
+ my $title = &mt('LON-CAPA Enrollment Manager');
+ return(<
+
+$title
+
+$bodytag
+
+END
+}
-# ----------------------------------------------------- Needs to be in a course
+###############################################################
+###############################################################
+sub hidden_input {
+ my ($name,$value) = @_;
+ return ''."\n";
+}
- if (($ENV{'request.course.fn'}) &&
- (&Apache::lonnet::allowed('cst',$ENV{'request.course.id'}))) {
+sub print_upload_manager_header {
+ my ($r,$datatoken,$distotal,$krbdefdom)=@_;
+ my $javascript;
+ if (! exists($ENV{'form.upfile_associate'})) {
+ $ENV{'form.upfile_associate'} = 'forward';
+ }
+ if ($ENV{'form.associate'} eq 'Reverse Association') {
+ if ( $ENV{'form.upfile_associate'} ne 'reverse' ) {
+ $ENV{'form.upfile_associate'} = 'reverse';
+ } else {
+ $ENV{'form.upfile_associate'} = 'forward';
+ }
+ }
+ if ($ENV{'form.upfile_associate'} eq 'reverse') {
+ $javascript=&upload_manager_javascript_reverse_associate();
+ } else {
+ $javascript=&upload_manager_javascript_forward_associate();
+ }
+ my $javascript_validations=&javascript_validations('auth',$krbdefdom);
+ my $checked=(($ENV{'form.noFirstLine'})?' checked="1"':'');
+ $r->print('
'.&mt('Uploading Class List')."
\n".
+ "\n".
+ '
'.&mt('Identify fields')."
\n");
+ $r->print("
\n".
+ &mt('Total number of records found in file: [_1].',$distotal).
+ "\n".
+ "
\n");
+ $r->print(&mt('Enter as many fields as you can. '.
+ 'The system will inform you and bring you back to '.
+ 'this page if the data selected is insufficient to '.
+ 'enroll students in your class.')."\n");
+ $r->print(&hidden_input('action','upload').
+ &hidden_input('state','got_file').
+ &hidden_input('associate','').
+ &hidden_input('datatoken',$datatoken).
+ &hidden_input('fileupload',$ENV{'form.fileupload'}).
+ &hidden_input('upfiletype',$ENV{'form.upfiletype'}).
+ &hidden_input('upfile_associate',$ENV{'form.upfile_associate'}));
+ $r->print('');
+ $r->print(''.
+ &mt('Ignore First Line'));
+ $r->print("\n".
+ '');
+}
-# ------------------------------------------------------------------ Start page
- $r->content_type('text/html');
- $r->send_http_header;
- $r->print(<
-
-LON-CAPA Student Drop/Add
-
-
-
-