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

raeburn raeburn@source.lon-capa.org
Thu, 19 Nov 2009 18:16:21 -0000


raeburn		Thu Nov 19 18:16:21 2009 EDT

  Modified files:              (Branch: GCI_2)
    /loncom/interface	loncoursequeueadmin.pm 
  Log:
  - Backport 1.10, 1.11.
  
  
Index: loncom/interface/loncoursequeueadmin.pm
diff -u loncom/interface/loncoursequeueadmin.pm:1.9.2.2 loncom/interface/loncoursequeueadmin.pm:1.9.2.3
--- loncom/interface/loncoursequeueadmin.pm:1.9.2.2	Sun Oct  4 16:07:11 2009
+++ loncom/interface/loncoursequeueadmin.pm	Thu Nov 19 18:16:21 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.2.2 2009/10/04 16:07:11 raeburn Exp $
+# $Id: loncoursequeueadmin.pm,v 1.9.2.3 2009/11/19 18:16:21 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -76,13 +76,13 @@
     if ($context eq 'coursemanagers') {
         $rawsubj = 'Self-enrollment requests processed';
         push(@rawmsg,{
-                      mt => 'Enrollment requests in the following course: [_1]have been processed.',
+                      mt => 'Enrollment requests in the following course: [_1] have been processed.',
                       args => ["\n  $contextdesc"],
                      });
     } elsif ($context eq 'domainmanagers') {
         $rawsubj = 'Course requests reviewed';
         push(@rawmsg,{
-                      mt  => 'Course creation requests in the following domain: [_1]have been reviewed.',
+                      mt  => 'Course creation requests in the following domain: [_1] have been reviewed.',
                       args => ["\n  $contextdesc"],
                      });
         if (ref($textstr) eq 'ARRAY') {
@@ -188,7 +188,7 @@
                                                        @{$item->{args}})."\n";
             }
         }
-        if ($context eq 'managers') {
+        if ($context eq 'coursemanagers') {
             if ($approvedlist) {
                 $message .= "\n\n".&Apache::lonlocal::mt_user($sender_lh,'Approved enrollments:')."\n".$approvedlist;
             }
@@ -970,11 +970,15 @@
 }
 
 sub can_clone_course {
-    my ($uname,$udom,$clonecrs,$clonedom) = @_;
+    my ($uname,$udom,$clonecrs,$clonedom,$crstype) = @_;
     my $canclone;
+    my $ccrole = 'cc';
+    if ($crstype eq 'Community') {
+        $ccrole = 'co';
+    }
     my %roleshash = &Apache::lonnet::get_my_roles($uname,$udom,'userroles',['active'],
-                                                  ['cc'],[$clonedom]);
-    if (exists($roleshash{$clonecrs.':'.$clonedom.':cc'})) {
+                                                  [$ccrole],[$clonedom]);
+    if (exists($roleshash{$clonecrs.':'.$clonedom.':'.$ccrole})) {
         $canclone = 1;
     } else {
         my %courseenv = &Apache::lonnet::userenvironment($clonedom,$clonecrs,('cloners'));