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 410-416 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
410
('SubscriptionHistory','simplified','simplified|full','Define the display preference for serials issue history in OPAC','Choice'),
410
('SubscriptionHistory','simplified','simplified|full','Define the display preference for serials issue history in OPAC','Choice'),
411
('SubscriptionLog','1',NULL,'If ON, enables subscriptions log','YesNo'),
411
('SubscriptionLog','1',NULL,'If ON, enables subscriptions log','YesNo'),
412
('suggestion','1','','If ON, enables patron suggestions feature in OPAC','YesNo'),
412
('suggestion','1','','If ON, enables patron suggestions feature in OPAC','YesNo'),
413
('SupportsAuthorizedValues','itemtypes','itemtypes|ccode|loc','Authorized values representing document physical support','Choice'),
413
('SuggestionsUseValues','itemtypes','itemtypes|ccode|loc|none','Suggestions can be submitted using the following authorized values:','Choice'),
414
('SuspendHoldsIntranet','1','Allow holds to be suspended from the intranet.',NULL,'YesNo'),
414
('SuspendHoldsIntranet','1','Allow holds to be suspended from the intranet.',NULL,'YesNo'),
415
('SuspendHoldsOpac','1','Allow holds to be suspended from the OPAC.',NULL,'YesNo'),
415
('SuspendHoldsOpac','1','Allow holds to be suspended from the OPAC.',NULL,'YesNo'),
416
('SvcMaxReportRows','10',NULL,'Maximum number of rows to return via the report web service.','Integer'),
416
('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 10556-10563 if ( CheckVersion($DBversion) ) { Link Here
10556
10556
10557
$DBversion = "3.19.00.XXX";
10557
$DBversion = "3.19.00.XXX";
10558
if ( CheckVersion($DBversion) ) {
10558
if ( CheckVersion($DBversion) ) {
10559
   $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('SupportsAuthorizedValues', 'itemtypes', 'Authorized values representing document physical support','itemtypes|ccode|loc','Choice')");
10559
   $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')");
10560
   print "Upgrade to $DBversion done (Bug 9223: Add SupportsAuthorizedValues syspref)\n";
10560
   print "Upgrade to $DBversion done (Bug 9223: Add SuggestionsUseValues syspref)\n";
10561
   SetVersion ($DBversion);
10561
   SetVersion ($DBversion);
10562
}
10562
}
10563
10563
(-)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 529-534 OPAC: Link Here
529
                  yes: Allow
529
                  yes: Allow
530
            - patrons to select library when making a purchase suggestion
530
            - patrons to select library when making a purchase suggestion
531
        -
531
        -
532
            - 'Suggestions can be submitted using the following authorized values:'
533
            - pref: SuggestionsUseValues
534
              default: itemtypes
535
              choices:
536
                  itemtypes: "Item type"
537
                  loc: "Shelving location"
538
                  ccode: "Collection code"
539
                  none: "None. Hide this option"
540
        -
532
            - pref: OpacHiddenItems
541
            - pref: OpacHiddenItems
533
              type: textarea
542
              type: textarea
534
              class: code
543
              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 %]"/></li>
346
        <li><label for="publishercode">Publisher:</label><input type="text" id="publishercode" name="publishercode" size="50" maxlength="80" value="[% publishercode %]"/></li>
336
        <li><label for="place">Publication place:</label><input type="text" id="place" name="place" size="50" maxlength="80" value="[% place %]"/></li>
347
        <li><label for="place">Publication place:</label><input type="text" id="place" name="place" size="50" maxlength="80" value="[% place %]"/></li>
337
        <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" size="50" maxlength="80" value="[% collectiontitle %]"/></li>
348
        <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" size="50" maxlength="80" value="[% collectiontitle %]"/></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 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