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

jms jms@source.lon-capa.org
Tue, 20 Oct 2009 14:29:44 -0000


jms		Tue Oct 20 14:29:44 2009 EDT

  Modified files:              
    /loncom/interface	lonhelpmenu.pm domainprefs.pm 
  Log:
  Added ability to toggle "Submit a bug" link in help menu to login area of domain settings.
  
Index: loncom/interface/lonhelpmenu.pm
diff -u loncom/interface/lonhelpmenu.pm:1.37 loncom/interface/lonhelpmenu.pm:1.38
--- loncom/interface/lonhelpmenu.pm:1.37	Fri Feb 13 17:20:29 2009
+++ loncom/interface/lonhelpmenu.pm	Tue Oct 20 14:29:44 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # generate frame-based help system
 #
-# $Id: lonhelpmenu.pm,v 1.37 2009/02/13 17:20:29 bisitz Exp $
+# $Id: lonhelpmenu.pm,v 1.38 2009/10/20 14:29:44 jms Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -74,6 +74,8 @@
 sub display_help_banner {
     my ($r,$faq,$bug,$topic,$component_url,$origurl,$bugurl,$faqbaseurl,$requestmail,$stayOnPage) = @_;
     my $location=&Apache::loncommon::lonhttpdurl("/adm");
+    my $dom = $env{'request.role.domain'};
+    my %domconfig = &Apache::lonnet::get_dom('configuration',['login'],$dom);
     my $scripttag = '';
     if ($requestmail =~ m/^[^\@]+\@[^\@]+$/) {
         my $displayurl = &escape($origurl);
@@ -172,9 +174,12 @@
 END
     }
     if ($env{'user.adv'}) {
-        $r->print(<<END);
-            <td><span class="LC_nobreak"&nbsp;<b><a href="$bugurl" target="bodyframe"><img src="$location/lonMisc/smallBug.gif" border="0" alt="(Report a bug)" valign="middle" />&nbsp;Report a bug</a>&nbsp;</b></span></td>
+    	if ($domconfig{'login'}{'submitbugs'} eq '1' ||
+    		$domconfig{'login'}{'submitbugs'} eq '' ) {
+        	$r->print(<<END);
+            	<td><span class="LC_nobreak"&nbsp;<b><a href="$bugurl" target="bodyframe"><img src="$location/lonMisc/smallBug.gif" border="0" alt="(Report a bug)" valign="middle" />&nbsp;Report a bug</a>&nbsp;</b></span></td>
 END
+		}
     }
     if ($stayOnPage) {
         $r->print(<<END);
Index: loncom/interface/domainprefs.pm
diff -u loncom/interface/domainprefs.pm:1.113 loncom/interface/domainprefs.pm:1.114
--- loncom/interface/domainprefs.pm:1.113	Thu Oct  8 22:37:33 2009
+++ loncom/interface/domainprefs.pm	Tue Oct 20 14:29:44 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set domain-wide configuration settings
 #
-# $Id: domainprefs.pm,v 1.113 2009/10/08 22:37:33 raeburn Exp $
+# $Id: domainprefs.pm,v 1.114 2009/10/20 14:29:44 jms Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -657,8 +657,9 @@
                            'coursecatalog' => 'on',
                            'adminmail'     => 'off',
                            'newuser'       => 'off',
+                           'submitbugs'	   => 'on',
                          );
-    my @toggles = ('coursecatalog','adminmail','newuser');
+    my @toggles = ('coursecatalog','adminmail','newuser','submitbugs');
     my (%checkedon,%checkedoff);
     foreach my $item (@toggles) {
         if ($defaultchecked{$item} eq 'on') { 
@@ -790,6 +791,7 @@
             coursecatalog => 'Display Course Catalog link?',
             adminmail     => "Display Administrator's E-mail Address?",
             disallowlogin => "Login page requests redirected",
+            submitbugs    => "Display &quot;Submit Bug&quot; link?",
             hostid        => "Server",
             serverurl     => "Redirect to log-in via:",
             directlogin   => "No redirect",
@@ -3137,6 +3139,7 @@
     my %title = ( coursecatalog => 'Display course catalog',
                   adminmail => 'Display administrator E-mail address',
                   newuser => 'Link for visitors to create a user account',
+                  submitbugs => 'Link for users to submit a bug',
                   loginheader => 'Log-in box header');
     my @offon = ('off','on');
     my %curr_loginvia;
@@ -3150,7 +3153,7 @@
     my %loginhash;
     ($errors,%colchanges) = &modify_colors($r,$dom,$confname,['login'],
                                            \%domconfig,\%loginhash);
-    my @toggles = ('coursecatalog','adminmail','newuser');
+    my @toggles = ('coursecatalog','adminmail','newuser','submitbugs');
     foreach my $item (@toggles) {
         $loginhash{login}{$item} = $env{'form.'.$item};
     }
@@ -3180,11 +3183,12 @@
     my $putresult = &Apache::lonnet::put_dom('configuration',\%loginhash,
                                              $dom);
     if ($putresult eq 'ok') {
-        my @toggles = ('coursecatalog','adminmail','newuser');
+        my @toggles = ('coursecatalog','adminmail','newuser','submitbugs');
         my %defaultchecked = (
                     'coursecatalog' => 'on',
                     'adminmail'     => 'off',
                     'newuser'       => 'off',
+                    'submitbugs'	=> 'on',
         );
         if (ref($domconfig{'login'}) eq 'HASH') {
             foreach my $item (@toggles) {