[LON-CAPA-cvs] cvs: modules /msu localenroll.pm
raeburn
raeburn@source.lon-capa.org
Fri, 31 Jul 2009 23:48:10 -0000
raeburn Fri Jul 31 23:48:10 2009 EDT
Modified files:
/modules/msu localenroll.pm
Log:
- Some fixes to scalar names in &validate_instcode().
Index: modules/msu/localenroll.pm
diff -u modules/msu/localenroll.pm:1.41 modules/msu/localenroll.pm:1.42
--- modules/msu/localenroll.pm:1.41 Sat Jul 25 16:56:12 2009
+++ modules/msu/localenroll.pm Fri Jul 31 23:48:10 2009
@@ -1,6 +1,6 @@
# functions to glue school database system into Lon-CAPA for
# automated enrollment
-# $Id: localenroll.pm,v 1.41 2009/07/25 16:56:12 raeburn Exp $
+# $Id: localenroll.pm,v 1.42 2009/07/31 23:48:10 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -314,7 +314,7 @@
if ($dbflag) {
# Check if instructor is in CLIFMS for this course
eval {
- my $clifmscount = $dbh->selectrow_array("SELECT count(*) FROM RO_CLIFMS_VIEW WHERE Term_Code='$sem' AND Subj_Code='$subj' AND Crse_Code='$crse' AND MSUNetID='$owner' AND (Record_Type='1' OR Record_Type='2' OR Record_Type ='3' OR Record_Type = '9')");
+ my $clifmscount = $dbh->selectrow_array("SELECT count(*) FROM RO_CLIFMS_VIEW WHERE Term_Code='$term' AND Subj_Code='$subj' AND Crse_Code='$crse' AND MSUNetID='$owner' AND (Record_Type='1' OR Record_Type='2' OR Record_Type ='3' OR Record_Type = '9')");
if ($clifmscount > 0) {
$outcome = 'ok';
} else {
@@ -333,10 +333,10 @@
($dbh,$dbflag) = &connect_DB('SIS');
if ($dbflag) {
eval {
- my $quotedsubj = $dbh5->quote($subj);
- my $quotedcrse = $dbh4->quote($crse);
- my $quotedterm = $dbh4->quote($term);
- my $count = $dbh4->selectrow_array( "SELECT count(*) FROM SISCRSS WHERE Subj_Code = $quotedsubj AND Crse_Code= $quotedcrse AND Sctn_Term_Code =$quotedterm ");
+ my $quotedsubj = $dbh->quote($subj);
+ my $quotedcrse = $dbh->quote($crse);
+ my $quotedterm = $dbh->quote($term);
+ my $count = $dbh->selectrow_array( "SELECT count(*) FROM SISCRSS WHERE Subj_Code = $quotedsubj AND Crse_Code= $quotedcrse AND Sctn_Term_Code =$quotedterm ");
if ($count > 0) {
$outcome = 'ok';
} else {
@@ -417,6 +417,7 @@
my $sth = $dbh->prepare("SELECT DISTINCT(Subj_Code) FROM SISCRSS");
$sth->execute();
while ( my ($dept) = $sth->fetchrow_array()) {
+ $dept = lc($dept);
push(@depts,$dept);
$deptnames{$dept} = $dept;
}