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

(-)a/C4/Koha.pm (-2 / +2 lines)
Lines 140-146 Returns the name of the support corresponding to specified authorised value. Link Here
140
sub GetSupportName {
140
sub GetSupportName {
141
    my $authorised_value = shift;
141
    my $authorised_value = shift;
142
    return '' unless $authorised_value;
142
    return '' unless $authorised_value;
143
    my $supports_av = C4::Context->preference("SupportsAuthorizedValues") || 'itemtypes';
143
    my $supports_av = C4::Context->preference("SuggestionsUseValues") || 'itemtypes';
144
    if ( $supports_av eq 'itemtypes' ) {
144
    if ( $supports_av eq 'itemtypes' ) {
145
        my $itemtype = getitemtypeinfo($authorised_value);
145
        my $itemtype = getitemtypeinfo($authorised_value);
146
        return $itemtype->{'description'} if $itemtype;
146
        return $itemtype->{'description'} if $itemtype;
Lines 180-186 build a HTML select with the following code : Link Here
180
=cut
180
=cut
181
181
182
sub GetSupportList {
182
sub GetSupportList {
183
    my $supports_av = C4::Context->preference("SupportsAuthorizedValues") || 'itemtypes';
183
    my $supports_av = C4::Context->preference("SuggestionsUseValues") || 'itemtypes';
184
    if ( $supports_av eq 'itemtypes' ) {
184
    if ( $supports_av eq 'itemtypes' ) {
185
        my @supports = map {
185
        my @supports = map {
186
            {
186
            {
(-)a/installer/data/mysql/sysprefs.sql (-1 / +1 lines)
Lines 417-423 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
417
('SubscriptionHistory','simplified','simplified|full','Define the display preference for serials issue history in OPAC','Choice'),
417
('SubscriptionHistory','simplified','simplified|full','Define the display preference for serials issue history in OPAC','Choice'),
418
('SubscriptionLog','1',NULL,'If ON, enables subscriptions log','YesNo'),
418
('SubscriptionLog','1',NULL,'If ON, enables subscriptions log','YesNo'),
419
('suggestion','1','','If ON, enables patron suggestions feature in OPAC','YesNo'),
419
('suggestion','1','','If ON, enables patron suggestions feature in OPAC','YesNo'),
420
('SupportsAuthorizedValues','itemtypes','itemtypes|ccode|loc','Authorized values representing document physical support','Choice'),
420
('SuggestionsUseValues','itemtypes','itemtypes|ccode|loc|none','Suggestions can be submitted using the following authorized values:','Choice'),
421
('SuspendHoldsIntranet','1','Allow holds to be suspended from the intranet.',NULL,'YesNo'),
421
('SuspendHoldsIntranet','1','Allow holds to be suspended from the intranet.',NULL,'YesNo'),
422
('SuspendHoldsOpac','1','Allow holds to be suspended from the OPAC.',NULL,'YesNo'),
422
('SuspendHoldsOpac','1','Allow holds to be suspended from the OPAC.',NULL,'YesNo'),
423
('SvcMaxReportRows','10',NULL,'Maximum number of rows to return via the report web service.','Integer'),
423
('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 10816-10823 if ( CheckVersion($DBversion) ) { Link Here
10816
10816
10817
$DBversion = "3.19.00.XXX";
10817
$DBversion = "3.19.00.XXX";
10818
if ( CheckVersion($DBversion) ) {
10818
if ( CheckVersion($DBversion) ) {
10819
   $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('SupportsAuthorizedValues', 'itemtypes', 'Authorized values representing document physical support','itemtypes|ccode|loc','Choice')");
10819
   $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')");
10820
   print "Upgrade to $DBversion done (Bug 9223: Add SupportsAuthorizedValues syspref)\n";
10820
   print "Upgrade to $DBversion done (Bug 9223: Add SuggestionsUseValues syspref)\n";
10821
   SetVersion ($DBversion);
10821
   SetVersion ($DBversion);
10822
}
10822
}
10823
10823
(-)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 536-541 OPAC: Link Here
536
                  yes: Allow
536
                  yes: Allow
537
            - patrons to select library when making a purchase suggestion
537
            - patrons to select library when making a purchase suggestion
538
        -
538
        -
539
            - 'Suggestions can be submitted using the following authorized values:'
540
            - pref: SuggestionsUseValues
541
              default: itemtypes
542
              choices:
543
                  itemtypes: "Item type"
544
                  loc: "Shelving location"
545
                  ccode: "Collection code"
546
                  none: "None. Hide this option"
547
        -
539
            - pref: OpacHiddenItems
548
            - pref: OpacHiddenItems
540
              type: textarea
549
              type: textarea
541
              class: code
550
              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 212-222 h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o Link Here
212
        <li><span class="label">Publisher:</span>[% publishercode |html %]</li>
213
        <li><span class="label">Publisher:</span>[% publishercode |html %]</li>
213
        <li><span class="label">Publication place:</span>[% place |html %]</li>
214
        <li><span class="label">Publication place:</span>[% place |html %]</li>
214
        <li><span class="label">Collection title:</span>[% collectiontitle |html %]</li>
215
        <li><span class="label">Collection title:</span>[% collectiontitle |html %]</li>
215
        <li><span class="label">Document type:</span>
216
        [% IF ( Koha.Preference( 'SuggestionsUseValues' ) != 'none' ) %]
216
            [% FOREACH supports_loo IN supports_loop %]
217
            <li>
217
                [% IF ( supports_loo.selected ) %][% supports_loo.lib %][% END %]
218
                [% IF ( Koha.Preference( 'SuggestionsUseValues' ) == 'itemtypes' ) %]
218
            [% END %]
219
                    <span class="label">Item type:</span>
219
        </li>
220
                [% ELSIF ( Koha.Preference( 'SuggestionsUseValues' ) == 'ccode' ) %]
221
                    <span class="label">Collection:</span>
222
                [% ELSIF ( Koha.Preference( 'SuggestionsUseValues' ) == 'loc' )%]
223
                    <span class="label">Shelving location:</span>
224
                [% END %]
225
                [% FOREACH supports_loo IN supports_loop %]
226
                    [% IF ( supports_loo.selected ) %][% supports_loo.lib %][% END %]
227
                [% END %]
228
            </li>
229
        [% END %]
230
220
        [% IF ( patron_reason_loop ) %]
231
        [% IF ( patron_reason_loop ) %]
221
          <li><span class="label">Reason for suggestion: </span>
232
          <li><span class="label">Reason for suggestion: </span>
222
            [% FOREACH patron_reason_loo IN patron_reason_loop %]
233
            [% FOREACH patron_reason_loo IN patron_reason_loop %]
Lines 335-348 h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o Link Here
335
        <li><label for="publishercode">Publisher:</label><input type="text" id="publishercode" name="publishercode" size="50" maxlength="80" value="[% publishercode | html %]"/></li>
346
        <li><label for="publishercode">Publisher:</label><input type="text" id="publishercode" name="publishercode" size="50" maxlength="80" value="[% publishercode | html %]"/></li>
336
        <li><label for="place">Publication place:</label><input type="text" id="place" name="place" size="50" maxlength="80" value="[% place | html %]"/></li>
347
        <li><label for="place">Publication place:</label><input type="text" id="place" name="place" size="50" maxlength="80" value="[% place | html %]"/></li>
337
        <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" size="50" maxlength="80" value="[% collectiontitle | html %]"/></li>
348
        <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" size="50" maxlength="80" value="[% collectiontitle | html %]"/></li>
338
        <li><label for="itemtype">Document type:</label>
349
        [% IF ( Koha.Preference( 'SuggestionsUseValues' ) != 'none' ) %]
339
            <select id="itemtype" name="itemtype" >
350
            <li>
340
            [% FOREACH supports_loo IN supports_loop %]
351
                [% IF ( Koha.Preference( 'SuggestionsUseValues' ) == 'itemtypes' ) %]
341
                [% IF ( supports_loo.selected ) %]<option selected="selected" value="[% supports_loo.authorised_value %]">[% ELSE %]<option value="[% supports_loo.authorised_value %]">[% END %]
352
                    <label for="itemtype">Item type:</label>
342
                [% supports_loo.lib %]</option>
353
                [% ELSIF ( Koha.Preference( 'SuggestionsUseValues' ) == 'ccode' ) %]
343
            [% END %]
354
                    <label for="itemtype">Collection:</label>
344
            </select>
355
                [% ELSIF ( Koha.Preference( 'SuggestionsUseValues' ) == 'loc' )%]
345
        </li>
356
                    <label for="itemtype">Shelving location:</label>
357
                [% END %]
358
                <select id="itemtype" name="itemtype" >
359
                    <option value=""></option>
360
                    [% FOREACH supports_loo IN supports_loop %]
361
                        [% IF ( supports_loo.selected ) %]<option selected="selected" value="[% supports_loo.authorised_value %]">[% ELSE %]<option value="[% supports_loo.authorised_value %]">[% END %]
362
                        [% supports_loo.lib %]</option>
363
                    [% END %]
364
                </select>
365
            </li>
366
        [% END %]
346
        [% 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 %]
367
        [% 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 %]
347
                [% 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 %]
368
                [% 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 %]
348
           [% END %]</select></li>[% END %]
369
           [% END %]</select></li>[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt (-5 / +13 lines)
Lines 42-61 Link Here
42
                                        <li><label for="publishercode">Publisher:</label><input type="text" id="publishercode" name="publishercode" class="span6" maxlength="80" /></li>
42
                                        <li><label for="publishercode">Publisher:</label><input type="text" id="publishercode" name="publishercode" class="span6" maxlength="80" /></li>
43
                                        <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" class="span6" maxlength="80" /></li>
43
                                        <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" class="span6" maxlength="80" /></li>
44
                                        <li><label for="place">Publication place:</label><input type="text" id="place" name="place"  maxlength="80" /></li>
44
                                        <li><label for="place">Publication place:</label><input type="text" id="place" name="place"  maxlength="80" /></li>
45
                                        <li><label for="itemtype">Document type:</label>
45
                                        [% IF ( Koha.Preference( 'SuggestionsUseValues' ) != 'none' ) %]
46
                                            <li>
47
                                                [% IF ( Koha.Preference( 'SuggestionsUseValues' ) == 'itemtypes' ) %]
48
                                                    <label for="itemtype">Item type:</label>
49
                                                [% ELSIF ( Koha.Preference( 'SuggestionsUseValues' ) == 'ccode' ) %]
50
                                                    <label for="itemtype">Collection:</label>
51
                                                [% ELSIF ( Koha.Preference( 'SuggestionsUseValues' ) == 'loc' )%]
52
                                                    <label for="itemtype">Shelving location:</label>
53
                                                [% END %]
46
                                            <select name="itemtype" id="itemtype">
54
                                            <select name="itemtype" id="itemtype">
47
                                                <option value="">Default</option>
55
                                                <option value="">Default</option>
48
                                                [% FOREACH supports_loo IN supports_loop %]
56
                                                [% FOREACH supports_loo IN supports_loop %]
49
                                                    [% IF ( supports_loo.selected ) %]
57
                                                    [% IF ( supports_loo.selected ) %]
50
                                                        <option value="[% supports_loo.itemtype %]" selected="selected">
58
                                                        <option value="[% supports_loo.authorised_value %]" selected="selected">
51
                                                    [% ELSE %]
59
                                                    [% ELSE %]
52
                                                        <option value="[% supports_loo.itemtype %]">
60
                                                        <option value="[% supports_loo.authorised_value %]">
53
                                                    [% END %]
61
                                                    [% END %]
54
                                                            [% supports_loo.description %]
62
                                                            [% supports_loo.lib %]
55
                                                        </option>
63
                                                        </option>
56
                                                [% END %]
64
                                                [% END %]
57
                                            </select>
65
                                            </select>
58
                                        </li>
66
                                        </li>
67
                                        [% END %]
59
                                        [% IF ( branchloop ) %]
68
                                        [% IF ( branchloop ) %]
60
                                            <li><label for="branch">Library:</label>
69
                                            <li><label for="branch">Library:</label>
61
                                                <select name="branchcode" id="branch">
70
                                                <select name="branchcode" id="branch">
62
- 

Return to bug 9223