@@ -, +, @@ DumpTemplateVarsOpac --- C4/Installer/PerlDependencies.pm | 13 ++- installer/data/mysql/sysprefs.sql | 2 + installer/data/mysql/updatedatabase.pl | 24 +++++ .../prog/en/includes/doc-head-open.inc | 14 +++ .../prog/en/modules/admin/preferences/logs.pref | 110 +++++++++++--------- .../bootstrap/en/includes/doc-head-open.inc | 14 +++ 6 files changed, 125 insertions(+), 52 deletions(-) --- a/C4/Installer/PerlDependencies.pm +++ a/C4/Installer/PerlDependencies.pm @@ -528,10 +528,15 @@ our $PERL_DEPS = { 'min_ver' => '2.05', }, 'Template' => { - 'usage' => 'Core', - 'required' => '1', - 'min_ver' => '2.22', - }, + 'usage' => 'Core', + 'required' => '1', + 'min_ver' => '2.22', + }, + 'Template::Plugin::Stash' => { + 'usage' => 'Debugging', + 'required' => '1', + 'min_ver' => '1.006', + }, 'Gravatar::URL' => { 'usage' => 'Photos in OPAC reviews', 'required' => '0', --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -113,6 +113,8 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('DisplayMultiPlaceHold','1','','Display the ability to place multiple holds or not','YesNo'), ('DisplayOPACiconsXSLT','1','','If ON, displays the format, audience, and material type icons in XSLT MARC21 results and detail pages in the OPAC.','YesNo'), ('dontmerge','1',NULL,'If ON, modifying an authority record will not update all associated bibliographic records immediately, ask your system administrator to enable the merge_authorities.pl cron job','YesNo'), +('DumpTemplateVarsIntranet', '0', NULL , 'If enabled, dump all Template Toolkit variable to a comment in the html source for the staff intranet.', 'YesNo'), +('DumpTemplateVarsOpac', '0', NULL , 'If enabled, dump all Template Toolkit variable to a comment in the html source for the opac.', 'YesNo'), ('EasyAnalyticalRecords','0','','If on, display in the catalogue screens tools to easily setup analytical record relationships','YesNo'), ('emailLibrarianWhenHoldIsPlaced','0',NULL,'If ON, emails the librarian whenever a hold is placed','YesNo'), ('EnableBorrowerFiles','0',NULL,'If enabled, allows librarians to upload and attach arbitrary files to a borrower record.','YesNo'), --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -37,6 +37,7 @@ use Getopt::Long; use C4::Context; use C4::Installer; use C4::Dates; +use Koha::Database; use MARC::Record; use MARC::File::XML ( BinaryEncoding => 'utf8' ); @@ -9971,6 +9972,29 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } +$DBversion = "XXX"; +if ( CheckVersion($DBversion) ) { + my $rs = Koha::Database->new()->schema()->resultset('Systempreference'); + $rs->find_or_create( + { + variable => 'DumpTemplateVarsIntranet', + value => 0, + explanation => 'If enabled, dump all Template Toolkit variable to a comment in the html source for the staff intranet.', + type => 'YesNo', + } + ); + $rs->find_or_create( + { + variable => 'DumpTemplateVarsOpac', + value => 0, + explanation => 'If enabled, dump all Template Toolkit variable to a comment in the html source for the opac.', + type => 'YesNo', + } + ); + print "Upgrade to $DBversion done (Bug 13948 - Add ability to dump template toolkit variables to html comment)\n"; + SetVersion($DBversion); +} + # DEVELOPER PROCESS, search for anything to execute in the db_update directory # SEE bug 13068 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-open.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-open.inc @@ -1,4 +1,18 @@ + +[% USE Koha %] +[% IF Koha.Preference('DumpTemplateVarsIntranet') %] + [% USE Stash %] + [% USE Dumper %] + ', '- ->') %] + [% Dumper.dump( Stash.stash() ) %] + [% END %] + [% END %] + --> +[% END %] + [% IF ( bidi ) %][% ELSE %][% END %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref @@ -1,49 +1,63 @@ Logging: - - - - pref: LetterLog - choices: - on: Log - off: "Don't log" - - when an automatic claim notice is sent. - - - - pref: BorrowersLog - choices: - on: Log - off: "Don't log" - - changes to patron records. - - - - pref: CataloguingLog - choices: - on: Log - off: "Don't log" - - any changes to bibliographic or item records. Since this occurs whenever a book is checked in or out as well, it is not advisable to turn this on. - - - - pref: AuthoritiesLog - choices: - on: Log - off: "Don't log" - - changes to authority records. - - - - pref: FinesLog - choices: - on: Log - off: "Don't log" - - when fines are charged, paid, or forgiven. - - - - pref: IssueLog - choices: - on: Log - off: "Don't log" - - when items are checked out. - - - - pref: ReturnLog - choices: - on: Log - off: "Don't log" - - when items are returned. - - - - pref: SubscriptionLog - choices: - on: Log - off: "Don't log" - - when serials are added, deleted or changed. + Logging: + - + - pref: LetterLog + choices: + on: Log + off: "Don't log" + - when an automatic claim notice is sent. + - + - pref: BorrowersLog + choices: + on: Log + off: "Don't log" + - changes to patron records. + - + - pref: CataloguingLog + choices: + on: Log + off: "Don't log" + - any changes to bibliographic or item records. Since this occurs whenever a book is checked in or out as well, it is not advisable to turn this on. + - + - pref: AuthoritiesLog + choices: + on: Log + off: "Don't log" + - changes to authority records. + - + - pref: FinesLog + choices: + on: Log + off: "Don't log" + - when fines are charged, paid, or forgiven. + - + - pref: IssueLog + choices: + on: Log + off: "Don't log" + - when items are checked out. + - + - pref: ReturnLog + choices: + on: Log + off: "Don't log" + - when items are returned. + - + - pref: SubscriptionLog + choices: + on: Log + off: "Don't log" + - when serials are added, deleted or changed. + Debugging: + - + - pref: DumpTemplateVarsIntranet + choices: + on: Do + off: "Don't" + - dump all Template Toolkit variable to a comment in the html source for the staff intranet. + - + - pref: DumpTemplateVarsOpac + choices: + on: Do + off: "Don't" + - dump all Template Toolkit variable to a comment in the html source for the OPAC. --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-open.inc +++ a/koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-open.inc @@ -1,5 +1,19 @@ + +[% USE Koha %] +[% IF Koha.Preference('DumpTemplateVarsOpac') %] + [% USE Stash %] + [% USE Dumper %] + ', '- ->') %] + [% Dumper.dump( Stash.stash() ) %] + [% END %] + [% END %] + --> +[% END %] + [% IF ( bidi ) %][% ELSE %][% END %] --