View | Details | Raw Unified | Return to bug 26296
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug_26296-Replace-comma-with-pipe-in-OPACSuggestion-preferences.perl (+16 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    # you can use $dbh here like:
4
    # $dbh->do( "ALTER TABLE biblio ADD COLUMN badtaste int" );
5
6
    # or perform some test and warn
7
    # if( !column_exists( 'biblio', 'biblionumber' ) ) {
8
    #    warn "There is something wrong";
9
    # }
10
11
    $dbh->do("UPDATE systempreferences SET value = REPLACE(value, ',', '|') WHERE variable IN ('OPACSuggestionMandatoryFields','OPACSuggestionUnwantedFields')");
12
13
    # Always end with this (adjust the bug info)
14
    NewVersion( $DBversion, 26296, "Replace comma with pipe in OPACSuggestion field preferences");
15
}
16
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-24 / +4 lines)
Lines 613-646 OPAC: Link Here
613
        -
613
        -
614
            - "Fields that should be mandatory for patron purchase suggestions:"
614
            - "Fields that should be mandatory for patron purchase suggestions:"
615
            - pref: OPACSuggestionMandatoryFields
615
            - pref: OPACSuggestionMandatoryFields
616
              multiple:
616
              type: modalselect
617
                title: Title
617
              source: suggestions
618
                author: Author
619
                copyrightdate: Copyright or publication date
620
                isbn: ISBN, ISSN or other standard number
621
                publishercode: Publisher name
622
                collectiontitle: Collection title
623
                place: Publication place
624
                itemtype: Item type
625
                branch: Library or branch
626
                patronreason: Patron reason
627
                note: Note
628
            - "<br />Note: if none of the above options are selected, 'Title' field would be mandatory anyway, by default."
618
            - "<br />Note: if none of the above options are selected, 'Title' field would be mandatory anyway, by default."
629
        -
619
        -
630
            - "Fields that should be hidden for patron purchase suggestions:"
620
            - "Fields that should be hidden for patron purchase suggestions:"
631
            - pref: OPACSuggestionUnwantedFields
621
            - pref: OPACSuggestionUnwantedFields
632
              multiple:
622
              type: modalselect
633
                author: Author
623
              source: suggestions
634
                copyrightdate: Copyright or publication date
635
                isbn: ISBN, ISSN or other standard number
636
                publishercode: Publisher name
637
                collectiontitle: Collection title
638
                place: Publication place
639
                itemtype: Item type
640
                quantity: Quantity
641
                branch: Library or branch
642
                patronreason: Patron reason
643
                note: Note
644
            - '<br />Note: Do not make <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OPACSuggestionMandatoryFields">OPACSuggestionMandatoryFields</a> unwanted fields '
624
            - '<br />Note: Do not make <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OPACSuggestionMandatoryFields">OPACSuggestionMandatoryFields</a> unwanted fields '
645
        -
625
        -
646
            - pref: OpacHiddenItems
626
            - pref: OpacHiddenItems
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/suggestions.json (+13 lines)
Line 0 Link Here
1
{
2
    "author": "author",
3
    "copyrightdate": "copyrightdate",
4
    "isbn": "isbn",
5
    "publishercode": "publishercode",
6
    "collectiontitle": "collectiontitle",
7
    "place": "place",
8
    "quantity": "quantity",
9
    "itemtype": "itemtype",
10
    "branchcode": "branchcode",
11
    "patronreason": "patronreason",
12
    "note": "note"
13
}
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt (-1 / +1 lines)
Lines 174-180 Link Here
174
                                            [% END %]
174
                                            [% END %]
175
                                            </li>
175
                                            </li>
176
                                        [% END %]
176
                                        [% END %]
177
                                        [% UNLESS ( branch_hidden )%]
177
                                        [% UNLESS ( branchcode_hidden )%]
178
                                            <li>
178
                                            <li>
179
                                                [% IF ( branchcode_required ) %]
179
                                                [% IF ( branchcode_required ) %]
180
                                                    <label for="branch" class="required">Library:</label>
180
                                                    <label for="branch" class="required">Library:</label>
(-)a/opac/opac-suggestions.pl (-3 / +2 lines)
Lines 223-229 my @mandatoryfields; Link Here
223
{
223
{
224
    last unless ($op eq 'add');
224
    last unless ($op eq 'add');
225
    my $fldsreq_sp = C4::Context->preference("OPACSuggestionMandatoryFields") || 'title';
225
    my $fldsreq_sp = C4::Context->preference("OPACSuggestionMandatoryFields") || 'title';
226
    @mandatoryfields = sort split(/\s*\,\s*/, $fldsreq_sp);
226
    @mandatoryfields = sort split(/\s*\|\s*/, $fldsreq_sp);
227
    foreach (@mandatoryfields) {
227
    foreach (@mandatoryfields) {
228
        $template->param( $_."_required" => 1);
228
        $template->param( $_."_required" => 1);
229
    }
229
    }
Lines 246-252 my @unwantedfields; Link Here
246
{
246
{
247
    last unless ($op eq 'add');
247
    last unless ($op eq 'add');
248
    my $fldsreq_sp = C4::Context->preference("OPACSuggestionUnwantedFields");
248
    my $fldsreq_sp = C4::Context->preference("OPACSuggestionUnwantedFields");
249
    @unwantedfields = sort split(/\s*\,\s*/, $fldsreq_sp);
249
    @unwantedfields = sort split(/\s*\|\s*/, $fldsreq_sp);
250
    foreach (@unwantedfields) {
250
    foreach (@unwantedfields) {
251
        $template->param( $_."_hidden" => 1);
251
        $template->param( $_."_hidden" => 1);
252
    }
252
    }
253
- 

Return to bug 26296