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

goltermann goltermann at source.lon-capa.org
Mon Oct 1 08:06:46 EDT 2012


goltermann		Mon Oct  1 12:06:46 2012 EDT

  Modified files:              
    /loncom/interface	londocs.pm 
  Log:
  added a filter to exclude not versionable problems in Check/Set Resource Versions
  
  
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.495 loncom/interface/londocs.pm:1.496
--- loncom/interface/londocs.pm:1.495	Thu Sep 20 19:25:22 2012
+++ loncom/interface/londocs.pm	Mon Oct  1 12:06:46 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.495 2012/09/20 19:25:22 raeburn Exp $
+# $Id: londocs.pm,v 1.496 2012/10/01 12:06:46 goltermann Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2184,7 +2184,6 @@
 		'cp' => 'Copy');
 	my $nocopy=0;
         my $nocut=0;
-        my $noremove=0;
         if ($url=~ m{^/res/.+\.(page|sequence)$}) {
 	    # no copy for published maps
 	    $nocopy=1;
@@ -2193,58 +2192,8 @@
            $nocopy=1;
            $nocut=1;
         }
-        my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
-        my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
-        if ($url eq "/uploaded/$cdom/$cnum/group_allfolders.sequence") {
-            if ($env{'form.folderpath'} =~ /^default&[^\&]+$/) {
-                my %curr_groups = &Apache::longroup::coursegroups();
-                if (keys(%curr_groups) > 0) {
-                    $noremove=1;
-                }
-                $nocut=1;
-                $nocopy=1;
-            }
-        } elsif ($url =~ m{^\Q/uploaded/$cdom/$cnum/group_folder_\E(\w+)\.sequence$}) {
-            my $group = $1;
-            if ($env{'form.folderpath'} =~ /^default&[^\&]+\&group_allfolders\&[^\&]+$/) {
-                my %curr_group = &Apache::longroup::coursegroups($cdom,$cnum,$group);
-                if (keys(%curr_group) > 0) {
-                    $noremove=1;
-                }
-            }
-            $nocut=1;
-            $nocopy=1;
-        } elsif ($url =~ m{^\Q/adm/$cdom/$cnum/\E(\w+)/smppg$}) {
-            my $group = $1;
-            if ($env{'form.folderpath'} =~ /^default&[^\&]+\&group_allfolders\&[^\&]+\&\Qgroup_folder_$group\E\&[^\&]+$/) {
-                my %curr_group = &Apache::longroup::coursegroups($cdom,$cnum,$group);
-                my %groupsettings = &Apache::longroup::get_group_settings($curr_group{$group});
-                if (keys(%groupsettings) > 0) {
-                    $noremove=1;
-                }
-                $nocut=1;
-                $nocopy=1;
-            }
-        } elsif ($env{'form.folderpath'} =~ /^default&[^\&]+\&group_allfolders\&[^\&]+\&group_folder_(\w+)\&/) {
-            my $group = $1;
-            my %curr_group = &Apache::longroup::coursegroups($cdom,$cnum,$group);
-            if ($url =~ /group_boards_\Q$group\E/) {
-                my %curr_group = &Apache::longroup::coursegroups($cdom,$cnum,$group);
-                my %groupsettings = &Apache::longroup::get_group_settings($curr_group{$group});
-                if (keys(%groupsettings) > 0) {
-                    if (ref($groupsettings{'functions'}) eq 'HASH') {
-                        if ($groupsettings{'functions'}{'discussion'} eq 'on') {
-                            $noremove=1;
-                        }
-                    }
-                }
-                $nocut=1;
-                $nocopy=1;
-            }
-        }
         my $copylink=' ';
         my $cutlink=' ';
-        my $removelink=' ';
 
 	my $skip_confirm = 0;
 	if ( $folder =~ /^supplemental/
@@ -2268,11 +2217,6 @@
 <a href="javascript:cutres('$esc_path','$index','$renametitle','$container','$symb','$folder',$skip_confirm);" class="LC_docs_cut">$lt{'ct'}</a>
 ENDCUT
         }
-        if (!$noremove) {
-            $removelink=(<<ENDREM);
-<a href='javascript:removeres("$esc_path","$index","$renametitle","$container","$symb",$skip_confirm);' class="LC_docs_remove">$lt{'rm'}</a>
-ENDREM
-        }
 	$form_start = '
    <form action="/adm/coursedocs" method="post">
 ';
@@ -2303,7 +2247,7 @@
    $form_end
 </td>
 <td class="LC_docs_entry_commands">
-$removelink
+   <a href='javascript:removeres("$esc_path","$index","$renametitle","$container","$symb",$skip_confirm);' class="LC_docs_remove">$lt{'rm'}</a>
 $cutlink
    <a href='javascript:changename("$esc_path","$index","$renametitle","$container","$symb");' class="LC_docs_rename">$lt{'rn'}</a>
 $copylink
@@ -2864,7 +2808,8 @@
     '<th colspan="'.$num_ver_col.'">'.&mt('History').'</th>'.
     '</b>');
     foreach my $key (sort(keys(%changes))) {
-	if ($changes{$key}>$starttime) {
+        #excludes not versionable problems from resource version history:
+        if ($changes{$key}>$starttime && $key !~ /^\/res\/lib\/templates/) {
 	    my ($root,$extension)=($key=~/^(.*)\.(\w+)$/);
 	    my $currentversion=&Apache::lonnet::getversion($key);
 	    if ($currentversion<0) {




More information about the LON-CAPA-cvs mailing list