[LON-CAPA-cvs] cvs: modules /msu localenroll.pm

raeburn raeburn at source.lon-capa.org
Wed Jun 9 12:11:08 EDT 2021


raeburn		Wed Jun  9 16:11:08 2021 EDT

  Modified files:              
    /modules/msu	localenroll.pm 
  Log:
  - Integration with MSU campus information systems
    Using full RO_ClassList views
  
  
Index: modules/msu/localenroll.pm
diff -u modules/msu/localenroll.pm:1.76 modules/msu/localenroll.pm:1.77
--- modules/msu/localenroll.pm:1.76	Wed Jun  9 03:22:00 2021
+++ modules/msu/localenroll.pm	Wed Jun  9 16:11:08 2021
@@ -1,6 +1,6 @@
 # functions to glue school database system into Lon-CAPA for
 # automated enrollment
-# $Id: localenroll.pm,v 1.76 2021/06/09 03:22:00 raeburn Exp $
+# $Id: localenroll.pm,v 1.77 2021/06/09 16:11:08 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -189,7 +189,7 @@
               $sem =~tr/a-z/A-Z/;
               $subj =~tr/a-z/A-Z/;
               $crse =~tr/a-z/A-Z/;
-              my $sth = $dbh->prepare("SELECT Pid,Pilot_Id,Student_Name,Sctn_Crdt_Hours FROM LONCAPA_ClassList WHERE (Term_Code = '$sem' AND Subj_Code = '$subj' AND Crse_Code = '$crse' AND Sctn_Code = '$sec') ORDER BY Student_Name");
+              my $sth = $dbh->prepare("SELECT Pid,Pilot_Id,Student_Name,Sctn_Crdt_Hours FROM RO_ClassList WHERE (Term_Code = '$sem' AND Subj_Code = '$subj' AND Crse_Code = '$crse' AND Sctn_Code = '$sec') ORDER BY Student_Name");
               $sth->execute();
               while ( my($pid,$pilot,$name,$credits)  = $sth->fetchrow_array ) {
                   if ($pilot =~ m/^\w{2,8}$/) {
@@ -325,7 +325,7 @@
             }
             if ($dbflag) {
 # Check if owner is in CLIFMS for this course
-                my $clifmscount = $dbh->selectrow_array("SELECT count(*) FROM RO_CLIFMS_VIEW WHERE Term_Code='$term' AND Subj_Code='$subj' AND Crse_Code='$crse' AND Sctn_Code='$sec' 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 WHERE Term_Code='$term' AND Subj_Code='$subj' AND Crse_Code='$crse' AND Sctn_Code='$sec' AND MSUNetID='$owner' AND (Record_Type='1' OR Record_Type='2' OR Record_Type ='3' OR Record_Type = '9')");
                 if ($clifmscount > 0) {
                     if ($dbflaglc) {
 	       	        my $loncount = $dbhlc->selectrow_array("SELECT count(*) FROM LONCAPA WHERE Term_Code='$term' AND Subj_Code='$subj' AND Crse_Code='$crse' AND Sctn_Code='$sec' AND MSUNetID='$owner'");
@@ -355,7 +355,7 @@
                         }
                         if (@netids > 0) {
                             foreach my $coowner (@netids) { 
-                                my $clifmscoowner = $dbh->selectrow_array("SELECT count(*) FROM RO_CLIFMS_VIEW WHERE Term_Code='$term' AND Subj_Code='$subj' AND Crse_Code='$crse' AND Sctn_Code='$sec' AND MSUNetID='$coowner' AND (Record_Type='1' OR Record_Type='2' OR Record_Type ='3' OR Record_Type = '9')");
+                                my $clifmscoowner = $dbh->selectrow_array("SELECT count(*) FROM RO_CLIFMS WHERE Term_Code='$term' AND Subj_Code='$subj' AND Crse_Code='$crse' AND Sctn_Code='$sec' AND MSUNetID='$coowner' AND (Record_Type='1' OR Record_Type='2' OR Record_Type ='3' OR Record_Type = '9')");
                                 if ($clifmscoowner > 0) {
                                     if ($dbflaglc) {
                                         my $loncoowner = $dbhlc->selectrow_array("SELECT count(*) FROM LONCAPA WHERE Term_Code='$term' AND Subj_Code='$subj' AND Crse_Code='$crse' AND Sctn_Code='$sec' AND MSUNetID='$coowner'");
@@ -550,7 +550,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='$term' AND Subj_Code='$subj' AND Crse_Code='$crse' AND MSUNetID='$ownername' 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 WHERE Term_Code='$term' AND Subj_Code='$subj' AND Crse_Code='$crse' AND MSUNetID='$ownername' AND (Record_Type='1' OR Record_Type='2' OR Record_Type ='3' OR Record_Type = '9')");
                             if ($clifmscount > 0) {
                                 $outcome = 'valid';
                             }
@@ -1008,7 +1008,7 @@
     my $blankcount = 0;
     if ($class =~ m/^([suf]s\d{2})(\w{2,4})(\d{3,4}\w?)(\d{3})$/) {
         eval {
-            my $sth = $dbh->prepare("SELECT Pid,Pilot_Id FROM LONCAPA_ClassList WHERE Term_Code = '$1' AND Subj_Code = '$2' AND Crse_Code = '$3' AND Sctn_Code = '$4'  ORDER BY Pid");
+            my $sth = $dbh->prepare("SELECT Pid,Pilot_Id FROM RO_ClassList WHERE Term_Code = '$1' AND Subj_Code = '$2' AND Crse_Code = '$3' AND Sctn_Code = '$4'  ORDER BY Pid");
             $sth->execute();
             while ( my($pid,$pilot,$name)  = $sth->fetchrow_array ) {
                 $pid =~ s/^1(\d{8})$/A$1/;
@@ -1155,7 +1155,7 @@
     my ($term,$subj,$crse,$sec,$dbh) = @_;
     my @in_clifms;
     if ($dbh) {
-        my $statement = "SELECT MSUNetID FROM RO_CLIFMS_VIEW WHERE Term_Code='$term' AND Subj_Code='$subj' AND Crse_Code='$crse' AND Sctn_Code='$sec' AND (Record_Type='1' OR Record_Type='2' OR Record_Type ='3' OR Record_Type = '9')";
+        my $statement = "SELECT MSUNetID FROM RO_CLIFMS WHERE Term_Code='$term' AND Subj_Code='$subj' AND Crse_Code='$crse' AND Sctn_Code='$sec' AND (Record_Type='1' OR Record_Type='2' OR Record_Type ='3' OR Record_Type = '9')";
         my $sth = $dbh->prepare("$statement");
         $sth->execute();
         while ( my ($uname) = $sth->fetchrow_array ) {




More information about the LON-CAPA-cvs mailing list