Bugzilla – Attachment 35830 Details for
Bug 10848
Allow configuration of mandatory/required fields on the suggestion form in OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10848: (QA followup) use the 'multiple' syspref type instead
Bug-10848-QA-followup-use-the-multiple-syspref-typ.patch (text/plain), 5.25 KB, created by
Tomás Cohen Arazi (tcohen)
on 2015-02-11 13:10:31 UTC
(
hide
)
Description:
Bug 10848: (QA followup) use the 'multiple' syspref type instead
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2015-02-11 13:10:31 UTC
Size:
5.25 KB
patch
obsolete
>From 5557efed3c4d50bbab34ebaabc716e530c8c0d92 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@gmail.com> >Date: Wed, 11 Feb 2015 00:07:28 -0300 >Subject: [PATCH] Bug 10848: (QA followup) use the 'multiple' syspref type > instead > >This patch makes the feature use the 'multiple' syspref type. >It does so by changing the type in opac.pref and fixing the relevant >files that are used to insert the data on the DB. > >It also changes opac-suggestions.pl to use ',0 as separator, as used by >the 'multiple' syspref type. > >To test: >- Verify there's no behaviour change besides the change in the sysprefs definition. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> >--- > installer/data/mysql/sysprefs.sql | 2 +- > installer/data/mysql/updatedatabase.pl | 2 +- > .../prog/en/modules/admin/preferences/opac.pref | 17 ++++++++++++----- > opac/opac-suggestions.pl | 2 +- > 4 files changed, 15 insertions(+), 8 deletions(-) > >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 4959058..47bb6e8 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -305,7 +305,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('OPACShowUnusedAuthorities','1','','Show authorities that are not being used in the OPAC.','YesNo'), > ('OpacStarRatings','all','disable|all|details',NULL,'Choice'), > ('OpacSuggestionManagedBy',1,'','Show the name of the staff member who managed a suggestion in OPAC','YesNo'), >-('OPACSuggestionMandatoryFields','',NULL,'Define the mandatory fields for a patron purchase suggestions made via OPAC.','free'), >+('OPACSuggestionMandatoryFields','',NULL,'Define the mandatory fields for a patron purchase suggestions made via OPAC.','multiple'), > ('OpacSuppression','0','','Turn ON the OPAC Suppression feature, requires further setup, ask your system administrator for details','YesNo'), > ('OpacSuppressionByIPRange','','','Restrict the suppression to IP adresses outside of the IP range','free'), > ('OpacSuppressionMessage','','Display this message on the redirect page for suppressed biblios','70|10','Textarea'), >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index f6340ab..9abc523 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -9761,7 +9761,7 @@ if ( CheckVersion($DBversion) ) { > > $DBversion = "3.19.00.XXX"; > if (CheckVersion($DBversion)) { >- $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('OPACSuggestionMandatoryFields', '', 'NULL', 'Define the mandatory fields for a patron purchase suggestions made via OPAC.', 'Free');"); >+ $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('OPACSuggestionMandatoryFields', '', 'NULL', 'Define the mandatory fields for a patron purchase suggestions made via OPAC.', 'multiple');"); > print "Upgrade to $DBversion done (Bug 10848 - Allow configuration of mandatory/required fields on the suggestion form in OPAC)\n"; > SetVersion($DBversion); > } >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >index 2b0e0e1..14dafe2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >@@ -535,12 +535,19 @@ OPAC: > yes: Allow > - patrons to select library when making a purchase suggestion > - >- - "Fields (separated with |) that should be mandatory for patron purchase suggestions:" >+ - "Fields that should be mandatory for patron purchase suggestions:" > - pref: OPACSuggestionMandatoryFields >- class: multi >- - "<br />Field names you can set here as mandatory for OPAC suggestions include: <code>author</code>, <code>copyrightdate</code>," >- - "<code>isbn</code>, <code>publishercode</code>, <code>collectiontitle</code>, <code>place</code>, <code>note</code>, <code>itemtype</code> and <code>patronreason</code>." >- - "Note: <code>title</code> field would be always implicitly required, no need to enter it here." >+ multiple: >+ author: Author >+ copyrightdate: Copyright date >+ isbn: ISBN >+ publishercode: Publisher code >+ collectiontitle: Collection title >+ place: Place >+ note: Note >+ itemtype: Item type >+ patronreason: Patron reason >+ - "(Note: <code>title</code> field would be always implicitly required, no need to enter it here)." > - > - pref: OpacHiddenItems > type: textarea >diff --git a/opac/opac-suggestions.pl b/opac/opac-suggestions.pl >index 86a38e6..565c46d 100755 >--- a/opac/opac-suggestions.pl >+++ b/opac/opac-suggestions.pl >@@ -176,7 +176,7 @@ my $mandatoryfields = ''; > }; > my %fh = map { > ($_ && $supported_rf->{$_})? ('"'.$_.'"', 1): (); >- } (split(/\s*\|\s*/, $fldsreqsp)); >+ } (split(/\s*\,\s*/, $fldsreqsp)); > $fh{'"title"'} = 1; > $mandatoryfields = join(',', (sort keys %fh)); > } >-- >2.3.0
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 10848
:
28721
|
28722
|
28792
|
29091
|
29092
|
34317
|
34318
|
34319
|
34324
|
34325
|
34326
|
34544
|
34545
|
34546
|
34547
|
35830
|
54016
|
54017
|
54018
|
54019
|
54020
|
54021
|
54083
|
54084
|
54356
|
54430
|
54431
|
54432