Bugzilla – Attachment 14288 Details for
Bug 9009
Add separate user js and css for SCO module
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9009 - Add separate user js and css for SCO module
Bug-9009---Add-separate-user-js-and-css-for-SCO-mo.patch (text/plain), 7.57 KB, created by
Jonathan Druart
on 2012-12-27 10:19:39 UTC
(
hide
)
Description:
Bug 9009 - Add separate user js and css for SCO module
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2012-12-27 10:19:39 UTC
Size:
7.57 KB
patch
obsolete
>From 77d3886083e6328db16c416a758ac030ea340bd3 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 5 Nov 2012 12:22:24 -0500 >Subject: [PATCH] Bug 9009 - Add separate user js and css for SCO module > >Add system preferences SCOUserCSS and SCOUserJS to define separate CSS and JavaScript for the Self Checkout Module. > >Test plan: >1) Apply patch >2) Run updatedatabase.pl >3) Add something arbitrary to the new sysprefs SCOUserCSS and SCOUserJS ( such as TestCSS and TestJS ). >4) Load the SCO module in a browser, and view the HTML, verify the CSS and JS values in the system preferences have been included. > >Signed-off-by: Marc Veron <veron@veron.ch> > >I tested with an alert('hello') as JavaScript and some background-color for the CSS. Worked as expected. > >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >--- > installer/data/mysql/sysprefs.sql | 2 ++ > installer/data/mysql/updatedatabase.pl | 8 ++++++++ > .../prog/en/modules/admin/preferences/circulation.pref | 10 ++++++++++ > koha-tmpl/opac-tmpl/prog/en/modules/sco/help.tt | 3 +++ > koha-tmpl/opac-tmpl/prog/en/modules/sco/receipt.tt | 2 ++ > koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tt | 3 ++- > opac/sco/help.pl | 5 +++++ > opac/sco/sco-main.pl | 5 +++++ > 8 files changed, 37 insertions(+), 1 deletion(-) > >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index ccb3fcf..b269456 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -400,3 +400,5 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacSeparateHoldings', '0', 'Separate current branch holdings from other holdings (OPAC)', NULL, 'YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacSeparateHoldingsBranch', 'homebranch', 'Branch used to separate holdings (OPAC)', 'homebranch|holdingbranch', 'Choice'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RenewalSendNotice','0', NULL, '', 'YesNo'); >+INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('SCOUserCSS', '', NULL, 'Add CSS to be included in the SCO module in an embedded <style> tag.', 'free'); >+INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('SCOUserJS', '', NULL, 'Define custom javascript for inclusion in the SCO module', 'free'); >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index d93de4e..43d0920 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -6309,6 +6309,14 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { > SetVersion($DBversion); > } > >+$DBversion = "3.11.00.XXX"; >+if (C4::Context->preference("Version") < TransformToNum($DBversion)) { >+ $dbh->do("INSERT INTO systempreferences ( variable, value, explanation, type ) VALUES ( 'SCOUserCSS', '', 'Add CSS to be included in the SCO module in an embedded <style> tag.', 'free' )"); >+ $dbh->do("INSERT INTO systempreferences ( variable, value, explanation, type ) VALUES ( 'SCOUserJS', '', 'Define custom javascript for inclusion in the SCO module', 'free' )"); >+ print "Upgrade to $DBversion done (Add SCOUserCSS and SCOUserJS sysprefs)\n"; >+ SetVersion ($DBversion); >+} >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >index f32b5b1..7c9a4d2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >@@ -466,6 +466,16 @@ Circulation: > - lost item fees charged to a borrower when the lost item is returned. > Self Checkout: > - >+ - "Include the following JavaScript on all pages in the web-based self checkout:" >+ - pref: SCOUserJS >+ type: textarea >+ class: code >+ - >+ - "Include the following CSS on all pages in the web-based self checkout:" >+ - pref: SCOUserCSS >+ type: textarea >+ class: code >+ - > - pref: ShowPatronImageInWebBasedSelfCheck > choices: > yes: Show >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/sco/help.tt b/koha-tmpl/opac-tmpl/prog/en/modules/sco/help.tt >index 32b4f56..f2fa3a9 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/sco/help.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/sco/help.tt >@@ -6,6 +6,9 @@ > <link rel="stylesheet" type="text/css" href="[% yuipath %]/reset-fonts-grids.css" /> > <link rel="stylesheet" type="text/css" href="[% yuipath %]/skin.css" /> > <link rel="stylesheet" type="text/css" href="[% themelang %]/css/sco.css" /> >+[% IF ( SCOUserCSS ) %]<style type="text/css">[% SCOUserCSS %]</style>[% END %] >+ >+[% IF ( SCOUserJS ) %]<script type="text/javascript">[% SCOUserJS %]</script>[% END %] > </head> > <body> > <div id="doc" class="yui-t7"> >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/sco/receipt.tt b/koha-tmpl/opac-tmpl/prog/en/modules/sco/receipt.tt >index 8178412..7e363d2 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/sco/receipt.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/sco/receipt.tt >@@ -26,6 +26,8 @@ function closeNow() > } > </script> > >+[% IF ( SCOUserCSS ) %]<style type="text/css">[% SCOUserCSS %]</style>[% END %] >+[% IF ( SCOUserJS ) %]<script type="text/javascript">[% SCOUserJS %]</script>[% END %] > > </head> > >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tt b/koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tt >index 729b2f3..5441ccf 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tt >@@ -98,12 +98,13 @@ $(document).ready(function(){ > }); > </script> > [% IF ( opacuserjs ) %]<script type="text/javascript">[% opacuserjs %]</script>[% END %] >- >+[% IF ( SCOUserJS ) %]<script type="text/javascript">[% SCOUserJS %]</script>[% END %] > > <link rel="stylesheet" type="text/css" href="[% yuipath %]/reset-fonts-grids.css" /> > <link rel="stylesheet" type="text/css" href="[% yuipath %]/skin.css" /> > <link rel="stylesheet" type="text/css" href="[% themelang %]/css/sco.css" /> > [% IF ( OPACUserCSS ) %]<style type="text/css">[% OPACUserCSS %]</style>[% END %] >+[% IF ( SCOUserCSS ) %]<style type="text/css">[% SCOUserCSS %]</style>[% END %] > > </head> > <body onload="dofocus();"> >diff --git a/opac/sco/help.pl b/opac/sco/help.pl >index b3f4398..abcb396 100755 >--- a/opac/sco/help.pl >+++ b/opac/sco/help.pl >@@ -52,5 +52,10 @@ if (C4::Context->preference('SelfCheckHelpMessage')) { > $template->param(SelfCheckHelpMessage => C4::Context->preference('SelfCheckHelpMessage')); > } > >+$template->param( >+ SCOUserJS => C4::Context->preference('SCOUserJS'), >+ SCOUserCSS => C4::Context->preference('SCOUserCSS'), >+); >+ > output_html_with_http_headers $query, $cookie, $template->output; > >diff --git a/opac/sco/sco-main.pl b/opac/sco/sco-main.pl >index f857b6a..25a3594 100755 >--- a/opac/sco/sco-main.pl >+++ b/opac/sco/sco-main.pl >@@ -263,4 +263,9 @@ if ($borrower->{cardnumber}) { > ); > } > >+$template->param( >+ SCOUserJS => C4::Context->preference('SCOUserJS'), >+ SCOUserCSS => C4::Context->preference('SCOUserCSS'), >+); >+ > output_html_with_http_headers $query, $cookie, $template->output; >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 9009
:
13251
|
13252
|
13253
|
13254
|
13255
|
13871
|
13889
|
13890
| 14288