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

(-)a/C4/Koha.pm (-2 / +2 lines)
Lines 139-145 Returns the name of the support corresponding to specified authorised value. Link Here
139
sub GetSupportName {
139
sub GetSupportName {
140
    my $authorised_value = shift;
140
    my $authorised_value = shift;
141
    return '' unless $authorised_value;
141
    return '' unless $authorised_value;
142
    my $supports_av = C4::Context->preference("SupportsAuthorizedValues") || 'itemtypes';
142
    my $supports_av = C4::Context->preference("SuggestionsUseValues") || 'itemtypes';
143
    if ( $supports_av eq 'itemtypes' ) {
143
    if ( $supports_av eq 'itemtypes' ) {
144
        my $itemtype = getitemtypeinfo($authorised_value);
144
        my $itemtype = getitemtypeinfo($authorised_value);
145
        return $itemtype->{'description'} if $itemtype;
145
        return $itemtype->{'description'} if $itemtype;
Lines 179-185 build a HTML select with the following code : Link Here
179
=cut
179
=cut
180
180
181
sub GetSupportList {
181
sub GetSupportList {
182
    my $supports_av = C4::Context->preference("SupportsAuthorizedValues") || 'itemtypes';
182
    my $supports_av = C4::Context->preference("SuggestionsUseValues") || 'itemtypes';
183
    if ( $supports_av eq 'itemtypes' ) {
183
    if ( $supports_av eq 'itemtypes' ) {
184
        my @supports = map {
184
        my @supports = map {
185
            {
185
            {
(-)a/installer/data/mysql/sysprefs.sql (-1 / +1 lines)
Lines 404-410 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
404
('SubscriptionHistory','simplified','simplified|full','Define the display preference for serials issue history in OPAC','Choice'),
404
('SubscriptionHistory','simplified','simplified|full','Define the display preference for serials issue history in OPAC','Choice'),
405
('SubscriptionLog','1',NULL,'If ON, enables subscriptions log','YesNo'),
405
('SubscriptionLog','1',NULL,'If ON, enables subscriptions log','YesNo'),
406
('suggestion','1','','If ON, enables patron suggestions feature in OPAC','YesNo'),
406
('suggestion','1','','If ON, enables patron suggestions feature in OPAC','YesNo'),
407
('SupportsAuthorizedValues','itemtypes','itemtypes|ccode|loc','Authorized values representing document physical support','Choice'),
407
('SuggestionsUseValues','itemtypes','itemtypes|ccode|loc|none','Suggestions can be submitted using the following authorized values:','Choice'),
408
('SuspendHoldsIntranet','1','Allow holds to be suspended from the intranet.',NULL,'YesNo'),
408
('SuspendHoldsIntranet','1','Allow holds to be suspended from the intranet.',NULL,'YesNo'),
409
('SuspendHoldsOpac','1','Allow holds to be suspended from the OPAC.',NULL,'YesNo'),
409
('SuspendHoldsOpac','1','Allow holds to be suspended from the OPAC.',NULL,'YesNo'),
410
('SvcMaxReportRows','10',NULL,'Maximum number of rows to return via the report web service.','Integer'),
410
('SvcMaxReportRows','10',NULL,'Maximum number of rows to return via the report web service.','Integer'),
(-)a/installer/data/mysql/updatedatabase.pl (-2 / +2 lines)
Lines 9806-9813 if ( CheckVersion($DBversion) ) { Link Here
9806
9806
9807
$DBversion = "3.19.00.XXX";
9807
$DBversion = "3.19.00.XXX";
9808
if ( CheckVersion($DBversion) ) {
9808
if ( CheckVersion($DBversion) ) {
9809
   $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('SupportsAuthorizedValues', 'itemtypes', 'Authorized values representing document physical support','itemtypes|ccode|loc','Choice')");
9809
   $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('SuggestionsUseValues', 'itemtypes', 'Suggestions can be submitted using the following authorized values:','itemtypes|ccode|loc|none','Choice')");
9810
   print "Upgrade to $DBversion done (Bug 9223: Add SupportsAuthorizedValues syspref)\n";
9810
   print "Upgrade to $DBversion done (Bug 9223: Add SuggestionsUseValues syspref)\n";
9811
   SetVersion ($DBversion);
9811
   SetVersion ($DBversion);
9812
}
9812
}
9813
9813
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref (-9 lines)
Lines 125-139 Cataloging: Link Here
125
            - 'MARC21: "952$a 952$b 952$c"'
125
            - 'MARC21: "952$a 952$b 952$c"'
126
            - Note that the FA framework is excluded from the permission.
126
            - Note that the FA framework is excluded from the permission.
127
            - If the pref is empty, no fields are restricted.
127
            - If the pref is empty, no fields are restricted.
128
        -
129
            - pref: SupportsAuthorizedValues
130
              default: itemtypes
131
              choices:
132
                  itemtypes: "Item type"
133
                  loc: "Shelving Location"
134
                  ccode: "Collection code"
135
            - represents document physical support.
136
        -
137
    Display:
128
    Display:
138
        -
129
        -
139
            - 'Separate multiple displayed authors, series or subjects with '
130
            - 'Separate multiple displayed authors, series or subjects with '
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+9 lines)
Lines 535-540 OPAC: Link Here
535
                  yes: Allow
535
                  yes: Allow
536
            - patrons to select library when making a purchase suggestion
536
            - patrons to select library when making a purchase suggestion
537
        -
537
        -
538
            - 'Suggestions can be submitted using the following authorized values:'
539
            - pref: SuggestionsUseValues
540
              default: itemtypes
541
              choices:
542
                  itemtypes: "Item type"
543
                  loc: "Shelving location"
544
                  ccode: "Collection code"
545
                  none: "None. Hide this option"
546
        -
538
            - pref: OpacHiddenItems
547
            - pref: OpacHiddenItems
539
              type: textarea
548
              type: textarea
540
              class: code
549
              class: code
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt (-13 / +34 lines)
Lines 1-3 Link Here
1
[% USE Koha %]
1
[% USE Branches %]
2
[% USE Branches %]
2
[% USE AuthorisedValues %]
3
[% USE AuthorisedValues %]
3
[% USE KohaDates %]
4
[% USE KohaDates %]
Lines 215-225 h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o Link Here
215
        <li><span class="label">Publisher:</span>[% publishercode |html %]</li>
216
        <li><span class="label">Publisher:</span>[% publishercode |html %]</li>
216
        <li><span class="label">Publication place:</span>[% place |html %]</li>
217
        <li><span class="label">Publication place:</span>[% place |html %]</li>
217
        <li><span class="label">Collection title:</span>[% collectiontitle |html %]</li>
218
        <li><span class="label">Collection title:</span>[% collectiontitle |html %]</li>
218
        <li><span class="label">Document type:</span>
219
        [% IF ( Koha.Preference( 'SuggestionsUseValues' ) != 'none' ) %]
219
            [% FOREACH supports_loo IN supports_loop %]
220
            <li>
220
                [% IF ( supports_loo.selected ) %][% supports_loo.lib %][% END %]
221
                [% IF ( Koha.Preference( 'SuggestionsUseValues' ) == 'itemtypes' ) %]
221
            [% END %]
222
                    <span class="label">Item type:</span>
222
        </li>
223
                [% ELSIF ( Koha.Preference( 'SuggestionsUseValues' ) == 'ccode' ) %]
224
                    <span class="label">Collection:</span>
225
                [% ELSIF ( Koha.Preference( 'SuggestionsUseValues' ) == 'loc' )%]
226
                    <span class="label">Shelving location:</span>
227
                [% END %]
228
                [% FOREACH supports_loo IN supports_loop %]
229
                    [% IF ( supports_loo.selected ) %][% supports_loo.lib %][% END %]
230
                [% END %]
231
            </li>
232
        [% END %]
233
223
        [% IF ( patron_reason_loop ) %]
234
        [% IF ( patron_reason_loop ) %]
224
          <li><span class="label">Reason for suggestion: </span>
235
          <li><span class="label">Reason for suggestion: </span>
225
            [% FOREACH patron_reason_loo IN patron_reason_loop %]
236
            [% FOREACH patron_reason_loo IN patron_reason_loop %]
Lines 338-351 h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o Link Here
338
        <li><label for="publishercode">Publisher:</label><input type="text" id="publishercode" name="publishercode" size="50" maxlength="80" value="[% publishercode %]"/></li>
349
        <li><label for="publishercode">Publisher:</label><input type="text" id="publishercode" name="publishercode" size="50" maxlength="80" value="[% publishercode %]"/></li>
339
        <li><label for="place">Publication place:</label><input type="text" id="place" name="place" size="50" maxlength="80" value="[% place %]"/></li>
350
        <li><label for="place">Publication place:</label><input type="text" id="place" name="place" size="50" maxlength="80" value="[% place %]"/></li>
340
        <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" size="50" maxlength="80" value="[% collectiontitle %]"/></li>
351
        <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" size="50" maxlength="80" value="[% collectiontitle %]"/></li>
341
        <li><label for="itemtype">Document type:</label>
352
        [% IF ( Koha.Preference( 'SuggestionsUseValues' ) != 'none' ) %]
342
            <select id="itemtype" name="itemtype" >
353
            <li>
343
            [% FOREACH supports_loo IN supports_loop %]
354
                [% IF ( Koha.Preference( 'SuggestionsUseValues' ) == 'itemtypes' ) %]
344
                [% IF ( supports_loo.selected ) %]<option selected="selected" value="[% supports_loo.authorised_value %]">[% ELSE %]<option value="[% supports_loo.authorised_value %]">[% END %]
355
                    <label for="itemtype">Item type:</label>
345
                [% supports_loo.lib %]</option>
356
                [% ELSIF ( Koha.Preference( 'SuggestionsUseValues' ) == 'ccode' ) %]
346
            [% END %]
357
                    <label for="itemtype">Collection:</label>
347
            </select>
358
                [% ELSIF ( Koha.Preference( 'SuggestionsUseValues' ) == 'loc' )%]
348
        </li>
359
                    <label for="itemtype">Shelving location:</label>
360
                [% END %]
361
                <select id="itemtype" name="itemtype" >
362
                    <option value=""></option>
363
                    [% FOREACH supports_loo IN supports_loop %]
364
                        [% IF ( supports_loo.selected ) %]<option selected="selected" value="[% supports_loo.authorised_value %]">[% ELSE %]<option value="[% supports_loo.authorised_value %]">[% END %]
365
                        [% supports_loo.lib %]</option>
366
                    [% END %]
367
                </select>
368
            </li>
369
        [% END %]
349
        [% IF ( patron_reason_loop ) %]<li><label for="patronreason">Reason for suggestion: </label><select name="patronreason" id="patronreason"><option value=""> -- Choose -- </option>[% FOREACH patron_reason_loo IN patron_reason_loop %]
370
        [% IF ( patron_reason_loop ) %]<li><label for="patronreason">Reason for suggestion: </label><select name="patronreason" id="patronreason"><option value=""> -- Choose -- </option>[% FOREACH patron_reason_loo IN patron_reason_loop %]
350
                [% IF ( patron_reason_loo.selected ) %]<option value="[% patron_reason_loo.authorised_value %]" selected="selected">[% patron_reason_loo.lib %]</option>[% ELSE %]<option value="[% patron_reason_loo.authorised_value %]">[% patron_reason_loo.lib %]</option>[% END %]
371
                [% IF ( patron_reason_loo.selected ) %]<option value="[% patron_reason_loo.authorised_value %]" selected="selected">[% patron_reason_loo.lib %]</option>[% ELSE %]<option value="[% patron_reason_loo.authorised_value %]">[% patron_reason_loo.lib %]</option>[% END %]
351
           [% END %]</select></li>[% END %]
372
           [% END %]</select></li>[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt (-5 / +13 lines)
Lines 41-60 Link Here
41
                                        <li><label for="publishercode">Publisher:</label><input type="text" id="publishercode" name="publishercode" class="span6" maxlength="80" /></li>
41
                                        <li><label for="publishercode">Publisher:</label><input type="text" id="publishercode" name="publishercode" class="span6" maxlength="80" /></li>
42
                                        <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" class="span6" maxlength="80" /></li>
42
                                        <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" class="span6" maxlength="80" /></li>
43
                                        <li><label for="place">Publication place:</label><input type="text" id="place" name="place"  maxlength="80" /></li>
43
                                        <li><label for="place">Publication place:</label><input type="text" id="place" name="place"  maxlength="80" /></li>
44
                                        <li><label for="itemtype">Document type:</label>
44
                                        [% IF ( Koha.Preference( 'SuggestionsUseValues' ) != 'none' ) %]
45
                                            <li>
46
                                                [% IF ( Koha.Preference( 'SuggestionsUseValues' ) == 'itemtypes' ) %]
47
                                                    <label for="itemtype">Item type:</label>
48
                                                [% ELSIF ( Koha.Preference( 'SuggestionsUseValues' ) == 'ccode' ) %]
49
                                                    <label for="itemtype">Collection:</label>
50
                                                [% ELSIF ( Koha.Preference( 'SuggestionsUseValues' ) == 'loc' )%]
51
                                                    <label for="itemtype">Shelving location:</label>
52
                                                [% END %]
45
                                            <select name="itemtype" id="itemtype">
53
                                            <select name="itemtype" id="itemtype">
46
                                                <option value="">Default</option>
54
                                                <option value="">Default</option>
47
                                                [% FOREACH supports_loo IN supports_loop %]
55
                                                [% FOREACH supports_loo IN supports_loop %]
48
                                                    [% IF ( supports_loo.selected ) %]
56
                                                    [% IF ( supports_loo.selected ) %]
49
                                                        <option value="[% supports_loo.itemtype %]" selected="selected">
57
                                                        <option value="[% supports_loo.authorised_value %]" selected="selected">
50
                                                    [% ELSE %]
58
                                                    [% ELSE %]
51
                                                        <option value="[% supports_loo.itemtype %]">
59
                                                        <option value="[% supports_loo.authorised_value %]">
52
                                                    [% END %]
60
                                                    [% END %]
53
                                                            [% supports_loo.description %]
61
                                                            [% supports_loo.lib %]
54
                                                        </option>
62
                                                        </option>
55
                                                [% END %]
63
                                                [% END %]
56
                                            </select>
64
                                            </select>
57
                                        </li>
65
                                        </li>
66
                                        [% END %]
58
                                        [% IF ( branchloop ) %]
67
                                        [% IF ( branchloop ) %]
59
                                            <li><label for="branch">Library:</label>
68
                                            <li><label for="branch">Library:</label>
60
                                                <select name="branchcode" id="branch">
69
                                                <select name="branchcode" id="branch">
61
- 

Return to bug 9223