[Koha-patches] [Signed-off] [PATCH] Fix Bug 5261 broken link in Local Use sysprefs

Chris Cormack chris at bigballofwax.co.nz
Wed Sep 29 10:13:14 CEST 2010


From: Jared Camins-Esakov <jcamins at cpbibliography.com>

This patch eliminates the sysprefs-menu.inc include file and changes the
systempreferences.pl and systempreferences.tmpl files to work with the
prefs-menu.inc instead. This will centralize the syspref tabs and make it
easier to modify tabs in the future if necessary.

This commit also changes the default tab to Acquisitions, since the Local Use
tab does not work with preferences.pl at present.

Signed-off-by: Chris Cormack <chris at bigballofwax.co.nz>
---
 admin/preferences.pl                               |    3 ++-
 admin/systempreferences.pl                         |    2 +-
 .../prog/en/includes/sysprefs-menu.inc             |   20 --------------------
 .../prog/en/modules/admin/systempreferences.tmpl   |    2 +-
 4 files changed, 4 insertions(+), 23 deletions(-)
 delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/sysprefs-menu.inc

diff --git a/admin/preferences.pl b/admin/preferences.pl
index b5bcde8..7fcf5fc 100755
--- a/admin/preferences.pl
+++ b/admin/preferences.pl
@@ -266,7 +266,8 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
 $lang = $template->param( 'lang' );
 my $op = $input->param( 'op' ) || '';
 my $tab = $input->param( 'tab' );
-$tab ||= 'local-use';
+$tab ||= 'acquisitions'; # Ideally this should be "local-use" but preferences.pl
+                         # does not presently support local use preferences
 
 my $highlighted;
 
diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl
index 824b058..411f434 100755
--- a/admin/systempreferences.pl
+++ b/admin/systempreferences.pl
@@ -801,7 +801,7 @@ if ( $op eq 'add_form' ) {
         $row_data->{delete} = "$script_name?op=delete_confirm&amp;searchfield=" . $results->[$i]{'variable'};
         push( @loop_data, $row_data );
     }
-    $tab = ( $tab ? $tab : "Local Use" );
+    $tab = ( $tab ? $tab : "local-use" );
     $template->param( loop => \@loop_data, $tab => 1 );
     if ( $offset > 0 ) {
         my $prevpage = $offset - $pagesize;
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/sysprefs-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/sysprefs-menu.inc
deleted file mode 100644
index 3b2fea4..0000000
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/sysprefs-menu.inc
+++ /dev/null
@@ -1,20 +0,0 @@
-<div id="menu">
-<ul>
-<!-- TMPL_IF NAME="Acquisitions" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Acquisitions" href="/cgi-bin/koha/admin/preferences.pl?tab=acquisitions">Acquisitions</a></li>
-<!-- TMPL_IF NAME="Admin" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Administration" href="/cgi-bin/koha/admin/preferences.pl?tab=admin">Administration</a></li>
-<!-- TMPL_IF NAME="Authorities" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Authority Control" href="/cgi-bin/koha/admin/preferences.pl?tab=authorities">Authorities</a></li>
-<!-- TMPL_IF NAME="Cataloging" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Cataloging" href="/cgi-bin/koha/admin/preferences.pl?tab=cataloging">Cataloging</a></li>
-<!-- TMPL_IF NAME="Circulation" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Circulation" href="/cgi-bin/koha/admin/preferences.pl?tab=circulation">Circulation</a></li>
-<!-- TMPL_IF NAME="Creators" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Creators" href="/cgi-bin/koha/admin/preferences.pl?tab=creators">Creators</a></li>
-<!-- TMPL_IF NAME="EnhancedContent" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Enhanced content settings" href="/cgi-bin/koha/admin/preferences.pl?tab=enhanced-content">Enhanced Content</a></li>
-<!-- TMPL_IF NAME="I18N/L10N" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Internationalization and Localization" href="/cgi-bin/koha/admin/preferences.pl?tab=i18n-l10n">I18N/L10N</a></li>
-<!-- TMPL_IF NAME="" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a href="/cgi-bin/koha/admin/systempreferences.pl">Local Use</a></li>
-<!-- TMPL_IF NAME="Logs" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Transaction Logs" href="/cgi-bin/koha/admin/preferences.pl?tab=logs">Logs</a></li>
-<!-- TMPL_IF NAME="OPAC" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Online Public Access Catalog" href="/cgi-bin/koha/admin/preferences.pl?tab=opac">OPAC</a></li>
-<!-- TMPL_IF NAME="Patrons" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Patrons" href="/cgi-bin/koha/admin/preferences.pl?tab=patrons">Patrons</a></li>
-<!-- TMPL_IF NAME="Searching" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Searching" href="/cgi-bin/koha/admin/preferences.pl?tab=searching">Searching</a></li>
-<!-- TMPL_IF NAME="Serials" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Serials" href="/cgi-bin/koha/admin/preferences.pl?tab=serials">Serials</a></li>
-<!-- TMPL_IF NAME="StaffClient" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Staff Client" href="/cgi-bin/koha/admin/preferences.pl?tab=staff-client">Staff Client</a></li>
-<!-- TMPL_IF NAME="OAI-PMH" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Web Services" href="/cgi-bin/koha/admin/preferences.pl?tab=web-services">Web Services</a></li>
-</ul>
-</div>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tmpl
index 8d54fe0..de9a592 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tmpl
@@ -347,7 +347,7 @@
 </div>
 </div>
 <div class="yui-b">
-<!-- TMPL_INCLUDE NAME="sysprefs-menu.inc" -->
+<!-- TMPL_INCLUDE NAME="prefs-menu.inc" -->
 </div>
 </div>
 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
-- 
1.6.3.3



More information about the Koha-patches mailing list