From 6dd6af59c2d1dd4a11cf16608c4161d24e6cf18b Mon Sep 17 00:00:00 2001 From: Nicole Engard Date: Sun, 6 Sep 2009 13:45:07 -0400 Subject: [PATCH] Bug 2576: Added OPACFinesTab Syspref This preference allows library staff to decide whether to show the fines tab in the OPAC for logged in patrons. Signed-off-by: Galen Charlton --- C4/Auth.pm | 1 + admin/systempreferences.pl | 1 + installer/data/mysql/en/mandatory/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 6 ++++++ koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc | 2 ++ 5 files changed, 11 insertions(+) diff --git a/C4/Auth.pm b/C4/Auth.pm index f05ec767d7..d73f19b692 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -352,6 +352,7 @@ sub get_template_and_user { OpacNav => "" . C4::Context->preference("OpacNav"), OpacPasswordChange => C4::Context->preference("OpacPasswordChange"), OPACPatronDetails => C4::Context->preference("OPACPatronDetails"), + OPACFinesTab => C4::Context->preference("OPACFinesTab"), OpacTopissue => C4::Context->preference("OpacTopissue"), RequestOnOpac => C4::Context->preference("RequestOnOpac"), TemplateEncoding => "". C4::Context->preference("TemplateEncoding"), diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl index b48f05517f..95c4b8aa08 100755 --- a/admin/systempreferences.pl +++ b/admin/systempreferences.pl @@ -319,6 +319,7 @@ $tabsysprefs{OPACShelfBrowser} = "OPAC"; $tabsysprefs{OPACDisplayRequestPriority} = "OPAC"; $tabsysprefs{OPACAllowHoldDateInFuture} = "OPAC"; $tabsysprefs{OPACPatronDetails} = "OPAC"; +$tabsysprefs{OPACFinesTab} = "OPAC"; # OPAC $tabsysprefs{SearchMyLibraryFirst} = "OPAC"; diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql index 52b3bd808a..caaf147bef 100644 --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ b/installer/data/mysql/en/mandatory/sysprefs.sql @@ -258,3 +258,4 @@ INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanatio INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('HidePatronName', '0', '', 'If this is switched on, patron''s cardnumber will be shown instead of their name on the holds and catalog screens', 'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACSearchForTitleIn','
  • Other Libraries (WorldCat)
  • \n
  • Other Databases (Google Scholar)
  • \n
  • Online Stores (Bookfinder.com)
  • ','Enter the HTML that will appear in the \'Search for this title in\' box on the detail page in the OPAC. Enter {TITLE}, {AUTHOR}, or {ISBN} in place of their respective variables in the URL. Leave blank to disable \'More Searches\' menu.','70|10','Textarea') INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACPatronDetails','1','If OFF the patron details tab in the OPAC is disabled.','','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACFinesTab','1','If OFF the patron fines tab in the OPAC is disabled.','','YesNo'); \ No newline at end of file diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 55cb20d1f0..24154eb36f 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -2628,6 +2628,12 @@ $DBversion = '3.01.00.XXX'; print "Upgrade to $DBversion done (Bug 1172 : Add OPACPatronDetails syspref)\n"; } +$DBversion = '3.01.00.XXX'; + if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACFinesTab','1','If OFF the patron fines tab in the OPAC is disabled.','','YesNo');"); + SetVersion ($DBversion); + print "Upgrade to $DBversion done (Bug 2576 : Add OPACFinesTab syspref)\n"; + } =item DropAllForeignKeys($table) diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc b/koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc index d8f4adcb73..a8fc320fcd 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc @@ -2,7 +2,9 @@