Description
Magnus Enger
2015-12-04 18:26:57 UTC
Created attachment 45711 [details] [review] Patch to enable OpacMaintenanceNotice systempreference Added new systempreference OpacMaintenanceNotice. When OpacMaintenance is ON the HTML contents of OpacMaintenanceNotice will be displayed. Enabling OpacMaintenance is all that is required to enable this preference. If OpacMaintenanceNotice is undefined, the default (original) notice will appear when OpacMaintenance is enabled. To test: - Enable OpacMaintenance systempreference - Observe the default maintenance message when OPAC is viewed - Edit OpacMaintenanceNotice systempreference, adding custom HTML - Observe the custom HTML appear on the opac - Remove OpacMaintenanceNotice (mindful of orphaned spaces etc.) - Observe the default opac notice appears in the opac - Disable OpacMaintenance - Observce opac is back online Created attachment 45712 [details] [review] Bug 15311 - Let libraries set text to display when OpacMaintenance = on Added new systempreference OpacMaintenanceNotice. When OpacMaintenance is ON the HTML contents of OpacMaintenanceNotice will be displayed. Enabling OpacMaintenance is all that is required to enable this preference. If OpacMaintenanceNotice is undefined, the default (original) notice will appear when OpacMaintenance is enabled. To test: - Enable OpacMaintenance systempreference - Observe the default maintenance message when OPAC is viewed - Edit OpacMaintenanceNotice systempreference, adding custom HTML - Observe the custom HTML appear on the opac - Remove OpacMaintenanceNotice (mindful of orphaned spaces etc.) - Observe the default opac notice appears in the opac - Disable OpacMaintenance - Observce opac is back online Signed-off-by: Aleisha <aleishaamohia@hotmail.com> Comment on attachment 45712 [details] [review] Bug 15311 - Let libraries set text to display when OpacMaintenance = on Review of attachment 45712 [details] [review]: ----------------------------------------------------------------- It would have been great to use the new table localization and create a new area in the admin module to let libraries define several values for this text, depending on the language used. ::: installer/data/mysql/updatedatabase.pl @@ +11393,5 @@ > +$DBversion = "3.23.00.XXX"; > +if(CheckVersion($DBversion)) { > + $dbh->do(q{ > + INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) > + VALUES ('OpacMaintenanceNotice','','70|10','A user-defined block of HTML to appear on screen when OpacMaintenace is enabled','Textarea') what is 70|10? explanation and options don't seem in the correct order. ::: opac/maintenance.pl @@ +33,5 @@ > $koha_db_version =~ s/\.//g if defined $koha_db_version; > +my $maintenance_notice = C4::Context->preference('OpacMaintenanceNotice'); > + > +$template->param( > + maintenance_notice => $maintenance_notice Don't pass it to the template, use the Koha template plugin to access syspref values (Koha.Preference) Created attachment 45719 [details] [review] Patch to enable OpacMaintenanceNotice systempreference Added new systempreference OpacMaintenanceNotice. When OpacMaintenance is ON the HTML contents of OpacMaintenanceNotice will be displayed. Enabling OpacMaintenance is all that is required to enable this preference. If OpacMaintenanceNotice is undefined, the default (original) notice will appear when OpacMaintenance is enabled. To test: - Enable OpacMaintenance systempreference - Observe the default maintenance message when OPAC is viewed - Edit OpacMaintenanceNotice systempreference, adding custom HTML - Observe the custom HTML appear on the opac - Remove OpacMaintenanceNotice (mindful of orphaned spaces etc.) - Observe the default opac notice appears in the opac - Disable OpacMaintenance - Observce opac is back online Should this be set back to Needs signoff or Signed off? Thanks to everyone contributing to realising my little idea! :-) CONFLICT (content): Merge conflict in installer/data/mysql/updatedatabase.pl (In reply to Aleisha Amohia from comment #7) > CONFLICT (content): Merge conflict in installer/data/mysql/updatedatabase.pl I think that the part in /installer/data/mysql/updatedatabase.pl should go to an atomic update, see: http://wiki.koha-community.org/wiki/Database_updates#updatedatabase.pl Will set to Failed QA until the move to an atomic update is made. Set back to Needs Signoff when that's done so I can come test it again :) Created attachment 47627 [details] [review] 0001-Bug-15311-Let-libraries-set-text-to-display-when-Opa.patch Added new systempreference OpacMaintenanceNotice. When OpacMaintenance is ON the HTML contents of OpacMaintenanceNotice will be displayed. Enabling OpacMaintenance is all that is required to enable this preference. If OpacMaintenanceNotice is undefined, the default (original) notice will appear when OpacMaintenance is enabled. To test: - Enable OpacMaintenance systempreference - Observe the default maintenance message when OPAC is viewed - Edit OpacMaintenanceNotice systempreference, adding custom HTML - Observe the custom HTML appear on the opac - Remove OpacMaintenanceNotice (mindful of orphaned spaces etc.) - Observe the default opac notice appears in the opac - Disable OpacMaintenance - Observce opac is back online Moving code to atomic update and fixing merge conflict Sponsored-by: Catalyst IT (In reply to Aleisha Amohia from comment #10) > Sponsored-by: Catalyst IT Was that on purpose? Claiming a patch somebody else wrote to be sponsored by Catalyst because you fixed a conflict does not seem like a nice move. In fact support companies do not really put that line in for their own stuff, just for things sponsored by third parties. (In reply to Mirko Tietgen from comment #11) > (In reply to Aleisha Amohia from comment #10) > > > Sponsored-by: Catalyst IT > > Was that on purpose? Claiming a patch somebody else wrote to be sponsored by > Catalyst because you fixed a conflict does not seem like a nice move. In > fact support companies do not really put that line in for their own stuff, > just for things sponsored by third parties. No I'm sorry that was a complete accident! I was trying to get in to the habit of adding it and did it without thinking! Sorry it looks so bad I did not mean to claim the patch :( I'll remove it when I get in to work on Tuesday Aleisha, don't worry about it. If you don't get around to it, we can fix it too later on. - Or the person fixing the database update can. Created attachment 47769 [details] [review] Bug 15311 - Let libraries set text to display when OpacMaintenance = on Added new systempreference OpacMaintenanceNotice. When OpacMaintenance is ON the HTML contents of OpacMaintenanceNotice will be displayed. Enabling OpacMaintenance is all that is required to enable this preference. If OpacMaintenanceNotice is undefined, the default (original) notice will appear when OpacMaintenance is enabled. To test: - Enable OpacMaintenance systempreference - Observe the default maintenance message when OPAC is viewed - Edit OpacMaintenanceNotice systempreference, adding custom HTML - Observe the custom HTML appear on the opac - Remove OpacMaintenanceNotice (mindful of orphaned spaces etc.) - Observe the default opac notice appears in the opac - Disable OpacMaintenance - Observce opac is back online Moving code to atomic update and fixing merge conflict Created attachment 47784 [details] [review] [SIGNED-OFF] Bug 15311 - Let libraries set text to display when OpacMaintenance = on Added new systempreference OpacMaintenanceNotice. When OpacMaintenance is ON the HTML contents of OpacMaintenanceNotice will be displayed. Enabling OpacMaintenance is all that is required to enable this preference. If OpacMaintenanceNotice is undefined, the default (original) notice will appear when OpacMaintenance is enabled. To test: - Enable OpacMaintenance systempreference - Observe the default maintenance message when OPAC is viewed - Edit OpacMaintenanceNotice systempreference, adding custom HTML - Observe the custom HTML appear on the opac - Remove OpacMaintenanceNotice (mindful of orphaned spaces etc.) - Observe the default opac notice appears in the opac - Disable OpacMaintenance - Observce opac is back online Moving code to atomic update and fixing merge conflict NOTE: Accounted for an SQL typo and autoescaping of the template. If someone else could test this, then I would be fine with marking it signed off. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Looks like Mark forgot to change the status. :-) Created attachment 47788 [details] [review] Bug 15311 - Let libraries set text to display when OpacMaintenance = on Added new systempreference OpacMaintenanceNotice. When OpacMaintenance is ON the HTML contents of OpacMaintenanceNotice will be displayed. Enabling OpacMaintenance is all that is required to enable this preference. If OpacMaintenanceNotice is undefined, the default (original) notice will appear when OpacMaintenance is enabled. To test: - Enable OpacMaintenance systempreference - Observe the default maintenance message when OPAC is viewed - Edit OpacMaintenanceNotice systempreference, adding custom HTML - Observe the custom HTML appear on the opac - Remove OpacMaintenanceNotice (mindful of orphaned spaces etc.) - Observe the default opac notice appears in the opac - Disable OpacMaintenance - Observce opac is back online Moving code to atomic update and fixing merge conflict NOTE: Accounted for an SQL typo and autoescaping of the template. If someone else could test this, then I would be fine with marking it signed off. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> (In reply to Magnus Enger from comment #16) > Looks like Mark forgot to change the status. :-) No, I figured since I squashed my changes in, that a secondary sign would be a good idea. Created attachment 48400 [details] [review] Bug 15311 [QA Followup] - Remove use of .raw method as it's use was reverted Pushed to master! Should be in Koha 3.24, thanks Barry! |