[LON-CAPA-cvs] cvs: loncom(GCI_2) /interface loncoursequeueadmin.pm

raeburn raeburn@source.lon-capa.org
Sun, 04 Oct 2009 15:29:58 -0000


raeburn		Sun Oct  4 15:29:58 2009 EDT

  Modified files:              (Branch: GCI_2)
    /loncom/interface	loncoursequeueadmin.pm 
  Log:
  - Customization for GCI.
  - Users for whom self-enrollment is approved in the GCI Concept Inventory, automatically receive the right to create unlimited Concept Test coursess in the gcitest domain. 
  
  
Index: loncom/interface/loncoursequeueadmin.pm
diff -u loncom/interface/loncoursequeueadmin.pm:1.9 loncom/interface/loncoursequeueadmin.pm:1.9.2.1
--- loncom/interface/loncoursequeueadmin.pm:1.9	Fri Sep 11 02:27:50 2009
+++ loncom/interface/loncoursequeueadmin.pm	Sun Oct  4 15:29:58 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Utilities to administer domain course requests and course self-enroll requests 
 #
-# $Id: loncoursequeueadmin.pm,v 1.9 2009/09/11 02:27:50 raeburn Exp $
+# $Id: loncoursequeueadmin.pm,v 1.9.2.1 2009/10/04 15:29:58 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -346,7 +346,7 @@
         @existing,@missingreq,@invalidusers,@limitexceeded,@completed,
         @processing_errors,@warn_approves,@warn_rejects,@approvals,
         @rejections,@rejectionerrors,@nopermissions,%courseroles,
-        %communityroles,%domdefs);
+        %communityroles,%domdefs,@warn_coursereqs);
     @approvals = &Apache::loncommon::get_env_multiple('form.approvereq');
     @rejections = &Apache::loncommon::get_env_multiple('form.rejectreq');
     $now = time;
@@ -463,6 +463,15 @@
                             &Apache::lonnet::put($namespace,\%userrequest,$udom,$uname);
                         if ($userresult ne 'ok') {
                             push(@warn_approves,$uname.':'.$udom);
+                        } elsif ($udom eq 'gci') {
+                            my %changehash = (
+                                'reqcrsotherdom.unofficial' => 'gcitest:autolimit=';
+                            );
+                            my $reqresult = &Apache::lonnet::put('environment',\%changeHash,
+                                                                 $udom,$uname);
+                            if ($reqresult ne 'ok') {
+                                push(@warn_coursereqs,$uname.':'.$udom);
+                            }
                         }
                     } else {
                         push(@processing_errors,$uname.':'.$udom);
@@ -832,6 +841,13 @@
             $output .= '</ul></p>';
         }
     }
+    if (@warn_coursereqs) {
+        $output .= '<p>'..&mt("For the following users, an error occurred when setting rights to request creation of Concept Test courses:").'<ul>';
+            foreach my $user (@warn_coursereqs) {
+                $output .= '<li>'.$user.'</li>';
+            }
+            $output .= '</ul></p>';
+    }
     return $output;
 }