[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm

raeburn raeburn at source.lon-capa.org
Mon Jul 13 20:08:06 EDT 2015


raeburn		Tue Jul 14 00:08:06 2015 EDT

  Modified files:              
    /loncom/interface	loncommon.pm 
  Log:
  - Fix bug introduced in rev. 1.1221.
    - Reinstate support for cloning of own course, where no cloning configuration
      was set in course's environment.db, when using course request form and 
      course is created automatically.
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1224 loncom/interface/loncommon.pm:1.1225
--- loncom/interface/loncommon.pm:1.1224	Thu Jul  2 17:23:17 2015
+++ loncom/interface/loncommon.pm	Tue Jul 14 00:08:06 2015
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.1224 2015/07/02 17:23:17 musolffc Exp $
+# $Id: loncommon.pm,v 1.1225 2015/07/14 00:08:06 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -14527,9 +14527,12 @@
                     $can_clone = 1;
                 } elsif (grep(/^\*\:\Q$args->{'ccdomain'}\E$/, at cloners)) {
                     $can_clone = 1;
+                } elsif (grep(/^\Q$args->{'ccuname'}\E:\Q$args->{'ccdomain'}\E$/, at cloners)) {
+                    $can_clone = 1;
                 }
                 unless ($can_clone) {
-                    if (($clonehash{'internal.coursecode'}) && ($args->{'crscode'}) && ($args->{'clonedomain'} eq  $args->{'course_domain'})) {
+                    if (($clonehash{'internal.coursecode'}) && ($args->{'crscode'}) && 
+                        ($args->{'clonedomain'} eq  $args->{'course_domain'})) {
                         my (%gotdomdefaults,%gotcodedefaults);
                         foreach my $cloner (@cloners) {
                             if (($cloner ne '*') && ($cloner !~ /^\*\:$match_domain$/) &&
@@ -14560,24 +14563,23 @@
                             }
                         }
                     }
-                    unless ($can_clone) {
-                        my $ccrole = 'cc';
-                        if ($args->{'crstype'} eq 'Community') {
-                            $ccrole = 'co';
-                        }
-	                my %roleshash =
-		            &Apache::lonnet::get_my_roles($args->{'ccuname'},
-					                  $args->{'ccdomain'},
-                                                          'userroles',['active'],[$ccrole],
-					                  [$args->{'clonedomain'}]);
-	                if (($roleshash{$args->{'clonecourse'}.':'.$args->{'clonedomain'}.':'.$ccrole}) || 
-                            (grep(/^\Q$args->{'ccuname'}\E:\Q$args->{'ccdomain'}\E$/, at cloners))) {
-                            $can_clone = 1;
-                        } elsif (&Apache::lonnet::is_course_owner($args->{'clonedomain'},$args->{'clonecourse'},
-                                                                  $args->{'ccuname'},$args->{'ccdomain'})) {
-                            $can_clone = 1;
-                        }
-                    }
+                }
+            }
+            unless ($can_clone) {
+                my $ccrole = 'cc';
+                if ($args->{'crstype'} eq 'Community') {
+                    $ccrole = 'co';
+                }
+	        my %roleshash =
+		    &Apache::lonnet::get_my_roles($args->{'ccuname'},
+					          $args->{'ccdomain'},
+                                                  'userroles',['active'],[$ccrole],
+					          [$args->{'clonedomain'}]);
+	        if ($roleshash{$args->{'clonecourse'}.':'.$args->{'clonedomain'}.':'.$ccrole}) {
+                    $can_clone = 1;
+                } elsif (&Apache::lonnet::is_course_owner($args->{'clonedomain'},$args->{'clonecourse'},
+                                                          $args->{'ccuname'},$args->{'ccdomain'})) {
+                    $can_clone = 1;
                 }
             }
             unless ($can_clone) {




More information about the LON-CAPA-cvs mailing list