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

(-)a/C4/Koha.pm (-2 / +2 lines)
Lines 136-142 Returns the name of the support corresponding to specified authorised value. Link Here
136
sub GetSupportName {
136
sub GetSupportName {
137
    my $authorised_value = shift;
137
    my $authorised_value = shift;
138
    return '' unless $authorised_value;
138
    return '' unless $authorised_value;
139
    my $supports_av = C4::Context->preference("SupportsAuthorizedValues") || 'itemtypes';
139
    my $supports_av = C4::Context->preference("SuggestionsUseValues") || 'itemtypes';
140
    if ( $supports_av eq 'itemtypes' ) {
140
    if ( $supports_av eq 'itemtypes' ) {
141
        my $itemtype = getitemtypeinfo($authorised_value);
141
        my $itemtype = getitemtypeinfo($authorised_value);
142
        return $itemtype->{'description'} if $itemtype;
142
        return $itemtype->{'description'} if $itemtype;
Lines 177-183 build a HTML select with the following code : Link Here
177
=cut
177
=cut
178
178
179
sub GetSupportList {
179
sub GetSupportList {
180
    my $supports_av = C4::Context->preference("SupportsAuthorizedValues") || 'itemtypes';
180
    my $supports_av = C4::Context->preference("SuggestionsUseValues") || 'itemtypes';
181
    if ( $supports_av eq 'itemtypes' ) {
181
    if ( $supports_av eq 'itemtypes' ) {
182
        my @supports = map {
182
        my @supports = map {
183
            {
183
            {
(-)a/installer/data/mysql/sysprefs.sql (-1 / +1 lines)
Lines 430-433 INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) V Link Here
430
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('CalculateFinesOnReturn','1','Switch to control if overdue fines are calculated on return or not', '', 'YesNo');
430
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('CalculateFinesOnReturn','1','Switch to control if overdue fines are calculated on return or not', '', 'YesNo');
431
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('AcqWarnOnDuplicateInvoice','0','Warn librarians when they try to create a duplicate invoice', '', 'YesNo');
431
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('AcqWarnOnDuplicateInvoice','0','Warn librarians when they try to create a duplicate invoice', '', 'YesNo');
432
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('AllowTooManyOverride', '1', 'If on, allow staff to override and check out items when the patron has reached the maximum number of allowed checkouts', '', 'YesNo');
432
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('AllowTooManyOverride', '1', 'If on, allow staff to override and check out items when the patron has reached the maximum number of allowed checkouts', '', 'YesNo');
433
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('SupportsAuthorizedValues', 'itemtypes', 'Authorized values representing document physical support','itemtypes|ccode|loc','Choice');
433
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');
(-)a/installer/data/mysql/updatedatabase.pl (-2 / +2 lines)
Lines 7069-7076 if ( CheckVersion($DBversion) ) { Link Here
7069
7069
7070
$DBversion = "3.13.00.XXX";
7070
$DBversion = "3.13.00.XXX";
7071
if ( CheckVersion($DBversion) ) {
7071
if ( CheckVersion($DBversion) ) {
7072
   $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('SupportsAuthorizedValues', 'itemtypes', 'Authorized values representing document physical support','itemtypes|ccode|loc','Choice')");
7072
   $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')");
7073
   print "Upgrade to $DBversion done (Bug 9223: Add SupportsAuthorizedValues syspref)\n";
7073
   print "Upgrade to $DBversion done (Bug 9223: Add SuggestionsUseValues syspref)\n";
7074
   SetVersion ($DBversion);
7074
   SetVersion ($DBversion);
7075
}
7075
}
7076
7076
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref (-9 lines)
Lines 109-123 Cataloging: Link Here
109
            - pref: UNIMARCField100Language
109
            - pref: UNIMARCField100Language
110
              class: short
110
              class: short
111
            - as default language in the UNIMARC field 100 when creating a new record or in the field plugin.
111
            - as default language in the UNIMARC field 100 when creating a new record or in the field plugin.
112
        -
113
            - pref: SupportsAuthorizedValues
114
              default: itemtypes
115
              choices:
116
                  itemtypes: "Item type"
117
                  loc: "Shelving Location"
118
                  ccode: "Collection code"
119
            - represents document physical support.
120
        -
121
    Display:
112
    Display:
122
        -
113
        -
123
            - 'Separate multiple displayed authors, series or subjects with '
114
            - 'Separate multiple displayed authors, series or subjects with '
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+9 lines)
Lines 492-497 OPAC: Link Here
492
                  yes: Allow
492
                  yes: Allow
493
            - patrons to select library when making a purchase suggestion
493
            - patrons to select library when making a purchase suggestion
494
        -
494
        -
495
            - 'Suggestions can be submitted using the following authorized values:'
496
            - pref: SuggestionsUseValues
497
              default: itemtypes
498
              choices:
499
                  itemtypes: "Item type"
500
                  loc: "Shelving location"
501
                  ccode: "Collection code"
502
                  none: "None. Hide this option"
503
        -
495
            - pref: OpacHiddenItems
504
            - pref: OpacHiddenItems
496
              type: textarea
505
              type: textarea
497
              class: code
506
              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 KohaAuthorisedValues %]
2
[% USE KohaAuthorisedValues %]
2
[% USE KohaBranchName %]
3
[% USE KohaBranchName %]
3
[% INCLUDE 'doc-head-open.inc' %]
4
[% INCLUDE 'doc-head-open.inc' %]
Lines 177-187 $(document).ready(function() { calcNewsuggTotal(); }); Link Here
177
        <li><span class="label">Publisher:</span>[% publishercode %]</li>
178
        <li><span class="label">Publisher:</span>[% publishercode %]</li>
178
        <li><span class="label">Publication place:</span>[% place %]</li>
179
        <li><span class="label">Publication place:</span>[% place %]</li>
179
        <li><span class="label">Collection title:</span>[% collectiontitle %]</li>
180
        <li><span class="label">Collection title:</span>[% collectiontitle %]</li>
180
        <li><span class="label">Document type:</span>
181
        [% IF ( Koha.Preference( 'SuggestionsUseValues' ) != 'none' ) %]
181
            [% FOREACH supports_loo IN supports_loop %]
182
            <li>
182
                [% IF ( supports_loo.selected ) %][% supports_loo.lib %][% END %]
183
                [% IF ( Koha.Preference( 'SuggestionsUseValues' ) == 'itemtypes' ) %]
183
            [% END %]
184
                    <span class="label">Item type:</span>
184
        </li>
185
                [% ELSIF ( Koha.Preference( 'SuggestionsUseValues' ) == 'ccode' ) %]
186
                    <span class="label">Collection:</span>
187
                [% ELSIF ( Koha.Preference( 'SuggestionsUseValues' ) == 'loc' )%]
188
                    <span class="label">Shelving location:</span>
189
                [% END %]
190
                [% FOREACH supports_loo IN supports_loop %]
191
                    [% IF ( supports_loo.selected ) %][% supports_loo.lib %][% END %]
192
                [% END %]
193
            </li>
194
        [% END %]
195
185
        [% IF ( patron_reason_loop ) %]
196
        [% IF ( patron_reason_loop ) %]
186
          <li><span class="label">Reason for suggestion: </span>
197
          <li><span class="label">Reason for suggestion: </span>
187
            [% FOREACH patron_reason_loo IN patron_reason_loop %]
198
            [% FOREACH patron_reason_loo IN patron_reason_loop %]
Lines 292-305 $(document).ready(function() { calcNewsuggTotal(); }); Link Here
292
        <li><label for="publishercode">Publisher:</label><input type="text" id="publishercode" name="publishercode" size="50" maxlength="80" value="[% publishercode %]"/></li>
303
        <li><label for="publishercode">Publisher:</label><input type="text" id="publishercode" name="publishercode" size="50" maxlength="80" value="[% publishercode %]"/></li>
293
        <li><label for="place">Publication place:</label><input type="text" id="place" name="place" size="50" maxlength="80" value="[% place %]"/></li>
304
        <li><label for="place">Publication place:</label><input type="text" id="place" name="place" size="50" maxlength="80" value="[% place %]"/></li>
294
        <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" size="50" maxlength="80" value="[% collectiontitle %]"/></li>
305
        <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" size="50" maxlength="80" value="[% collectiontitle %]"/></li>
295
        <li><label for="itemtype">Document type:</label>
306
        [% IF ( Koha.Preference( 'SuggestionsUseValues' ) != 'none' ) %]
296
            <select id="itemtype" name="itemtype" >
307
            <li>
297
            [% FOREACH supports_loo IN supports_loop %]
308
                [% IF ( Koha.Preference( 'SuggestionsUseValues' ) == 'itemtypes' ) %]
298
                [% IF ( supports_loo.selected ) %]<option selected="selected" value="[% supports_loo.authorised_value %]">[% ELSE %]<option value="[% supports_loo.authorised_value %]">[% END %]
309
                    <label for="itemtype">Item type:</label>
299
                [% supports_loo.lib %]</option>
310
                [% ELSIF ( Koha.Preference( 'SuggestionsUseValues' ) == 'ccode' ) %]
300
            [% END %]
311
                    <label for="itemtype">Collection:</label>
301
            </select>
312
                [% ELSIF ( Koha.Preference( 'SuggestionsUseValues' ) == 'loc' )%]
302
        </li>
313
                    <label for="itemtype">Shelving location:</label>
314
                [% END %]
315
                <select id="itemtype" name="itemtype" >
316
                    <option value=""></option>
317
                    [% FOREACH supports_loo IN supports_loop %]
318
                        [% IF ( supports_loo.selected ) %]<option selected="selected" value="[% supports_loo.authorised_value %]">[% ELSE %]<option value="[% supports_loo.authorised_value %]">[% END %]
319
                        [% supports_loo.lib %]</option>
320
                    [% END %]
321
                </select>
322
            </li>
323
        [% END %]
303
        [% 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 %]
324
        [% 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 %]
304
                [% 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 %]
325
                [% 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 %]
305
           [% END %]</select></li>[% END %]
326
           [% END %]</select></li>[% END %]
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt (-2 / +11 lines)
Lines 112-123 $.tablesorter.addParser({ Link Here
112
    <li><label for="publishercode">Publisher:</label><input type="text" id="publishercode" name="publishercode" size="50" maxlength="80" /></li>
112
    <li><label for="publishercode">Publisher:</label><input type="text" id="publishercode" name="publishercode" size="50" maxlength="80" /></li>
113
    <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" size="50" maxlength="80" /></li>
113
    <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" size="50" maxlength="80" /></li>
114
    <li><label for="place">Publication place:</label><input type="text" id="place" name="place" size="50" maxlength="80" /></li>
114
    <li><label for="place">Publication place:</label><input type="text" id="place" name="place" size="50" maxlength="80" /></li>
115
    <li><label for="itemtype">Document type:</label><select name="itemtype" id="itemtype">
115
        [% IF ( Koha.Preference( 'SuggestionsUseValues' ) != 'none' ) %]
116
            <li>
117
                [% IF ( Koha.Preference( 'SuggestionsUseValues' ) == 'itemtypes' ) %]
118
                    <label for="itemtype">Item type:</label>
119
                [% ELSIF ( Koha.Preference( 'SuggestionsUseValues' ) == 'ccode' ) %]
120
                    <label for="itemtype">Collection:</label>
121
                [% ELSIF ( Koha.Preference( 'SuggestionsUseValues' ) == 'loc' )%]
122
                    <label for="itemtype">Shelving location:</label>
123
                [% END %]
124
        <select name="itemtype" id="itemtype">
116
            <option value="">Default</option>
125
            <option value="">Default</option>
117
        [% FOREACH supports_loo IN supports_loop %]
126
        [% FOREACH supports_loo IN supports_loop %]
118
            [% IF ( supports_loo.selected ) %]<option value="[% supports_loo.authorised_value %]" selected="selected">[% ELSE %]<option value="[% supports_loo.authorised_value %]">[% END %][% supports_loo.lib %]</option>
127
            [% IF ( supports_loo.selected ) %]<option value="[% supports_loo.authorised_value %]" selected="selected">[% ELSE %]<option value="[% supports_loo.authorised_value %]">[% END %][% supports_loo.lib %]</option>
119
        [% END %]
128
        [% END %]
120
        </select> </li>
129
        </select> </li>
130
        [% END %]
121
    [% IF ( branchloop ) %]
131
    [% IF ( branchloop ) %]
122
    <li><label for="branch">Library:</label>
132
    <li><label for="branch">Library:</label>
123
        <select name="branch" id="branch">
133
        <select name="branch" id="branch">
124
- 

Return to bug 9223