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

(-)a/admin/authorised_values.pl (-7 / +9 lines)
Lines 78-87 if ($op eq 'add_form') { Link Here
78
    if ( $av ) {
78
    if ( $av ) {
79
        $template->param(
79
        $template->param(
80
            category_name => $av->category,
80
            category_name => $av->category,
81
            authorised_value => $av->authorised_value,
81
            av               => $av,
82
            lib              => $av->lib,
83
            lib_opac         => $av->lib_opac,
84
            id               => $av->id,
85
            imagesets        => C4::Koha::getImageSets( checked => $av->imageurl ),
82
            imagesets        => C4::Koha::getImageSets( checked => $av->imageurl ),
86
        );
83
        );
87
    } else {
84
    } else {
Lines 97-104 if ($op eq 'add_form') { Link Here
97
} elsif ($op eq 'add') {
94
} elsif ($op eq 'add') {
98
    my $new_authorised_value = $input->param('authorised_value');
95
    my $new_authorised_value = $input->param('authorised_value');
99
    my $new_category = $input->param('category');
96
    my $new_category = $input->param('category');
100
    my $imageurl     = $input->param( 'imageurl' ) || '';
97
    my $image = $input->param( 'image' ) || '';
101
    $imageurl = '' if $imageurl =~ /removeImage/;
98
    my $imageurl =
99
      $image eq 'removeImage' ? ''
100
      : (
101
          $image eq 'remoteImage' ? $input->param('remoteImage')
102
        : $image
103
      );
102
    my $duplicate_entry = 0;
104
    my $duplicate_entry = 0;
103
    my @branches = grep { $_ ne q{} } $input->multi_param('branches');
105
    my @branches = grep { $_ ne q{} } $input->multi_param('branches');
104
106
Lines 229-235 if ( $op eq 'list' ) { Link Here
229
        $row_data{authorised_value}      = $av->authorised_value;
231
        $row_data{authorised_value}      = $av->authorised_value;
230
        $row_data{lib}                   = $av->lib;
232
        $row_data{lib}                   = $av->lib;
231
        $row_data{lib_opac}              = $av->lib_opac;
233
        $row_data{lib_opac}              = $av->lib_opac;
232
        $row_data{imageurl}              = getitemtypeimagelocation( 'intranet', $av->imageurl );
234
        $row_data{image}              = getitemtypeimagelocation( 'intranet', $av->imageurl );
233
        $row_data{branches}              = $av->library_limits ? $av->library_limits->as_list : [];
235
        $row_data{branches}              = $av->library_limits ? $av->library_limits->as_list : [];
234
        $row_data{id}                    = $av->id;
236
        $row_data{id}                    = $av->id;
235
        push(@loop_data, \%row_data);
237
        push(@loop_data, \%row_data);
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt (-10 / +34 lines)
Lines 118-134 Link Here
118
                                    <li>
118
                                    <li>
119
                                        <label for="authorised_value">Authorized value: </label>
119
                                        <label for="authorised_value">Authorized value: </label>
120
                                        [% IF ( action_modify ) %]
120
                                        [% IF ( action_modify ) %]
121
                                            <input type="hidden" id="id" name="id" value="[% id | html %]" />
121
                                            <input type="hidden" id="id" name="id" value="[% av.id | html %]" />
122
                                        [% END %]
122
                                        [% END %]
123
                                        <input type="text" id="authorised_value" name="authorised_value" value="[% authorised_value | html %]" maxlength="80" class="focus" />
123
                                        <input type="text" id="authorised_value" name="authorised_value" value="[% av.authorised_value | html %]" maxlength="80" class="focus" />
124
                                    </li>
124
                                    </li>
125
                                    <li>
125
                                    <li>
126
                                        <label for="lib">Description: </label>
126
                                        <label for="lib">Description: </label>
127
                                        <input type="text" name="lib" id="lib" value="[% lib | html %]" maxlength="200" />
127
                                        <input type="text" name="lib" id="lib" value="[% av.lib | html %]" maxlength="200" />
128
                                    </li>
128
                                    </li>
129
                                    <li>
129
                                    <li>
130
                                        <label for="lib_opac">Description (OPAC): </label>
130
                                        <label for="lib_opac">Description (OPAC): </label>
131
                                        <input type="text" name="lib_opac" id="lib_opac" value="[% lib_opac | html %]" maxlength="200" />
131
                                        <input type="text" name="lib_opac" id="lib_opac" value="[% av.lib_opac | html %]" maxlength="200" />
132
                                    </li>
132
                                    </li>
133
                                    <li><label for="branches">Library limitations: </label>
133
                                    <li><label for="branches">Library limitations: </label>
134
                                        <select id="branches" name="branches" multiple size="10">
134
                                        <select id="branches" name="branches" multiple size="10">
Lines 152-162 Link Here
152
                                        [% FOREACH imageset IN imagesets %]
152
                                        [% FOREACH imageset IN imagesets %]
153
                                            [% IF ( imageset.imagesetactive ) %]<li class="ui-tabs-active">[% ELSE %]<li>[% END %]<a href="#[% imageset.imagesetname | uri %]">[% imageset.imagesetname | html %]</a></li>
153
                                            [% IF ( imageset.imagesetactive ) %]<li class="ui-tabs-active">[% ELSE %]<li>[% END %]<a href="#[% imageset.imagesetname | uri %]">[% imageset.imagesetname | html %]</a></li>
154
                                        [% END %]
154
                                        [% END %]
155
                                        [% IF av.imageurl.match('^http') %]
156
                                            <li class="ui-tabs-active">
157
                                        [% ELSE %]
158
                                            <li>
159
                                        [% END %]
160
                                            <a href="#remote">Remote image</a>
161
                                        </li>
155
                                    </ul>
162
                                    </ul>
156
                                    <div id="none">
163
                                    <div id="none">
157
                                        <ul>
164
                                        <ul>
158
                                            <li>
165
                                            <li>
159
                                                <label for="noimage">No image: </label><input type="radio" name="imageurl" id="noimage" value="removeImage" />
166
                                                <label for="noimage">No image: </label><input type="radio" name="image" id="noimage" value="removeImage" />
160
                                            </li>
167
                                            </li>
161
                                        </ul>
168
                                        </ul>
162
                                        <br class="clear" />
169
                                        <br class="clear" />
Lines 173-183 Link Here
173
                                                            [% ELSE %]
180
                                                            [% ELSE %]
174
                                                            [% END %]
181
                                                            [% END %]
175
                                                            [% IF ( image.checked ) %]
182
                                                            [% IF ( image.checked ) %]
176
                                                                <input type="radio" name="imageurl" value="[% image.KohaImage | html %]" checked="checked" />
183
                                                                <input type="radio" name="image" value="[% image.KohaImage | html %]" checked="checked" />
177
                                                            [% ELSE %]
184
                                                            [% ELSE %]
178
                                                                [% IF ( image.KohaImage ) %]
185
                                                                [% IF ( image.KohaImage ) %]
179
                                                                    <!-- to delete the radio button if there is no image after -->
186
                                                                    <!-- to delete the radio button if there is no image after -->
180
                                                                    <input type="radio" name="imageurl" value="[% image.KohaImage | html %]" />
187
                                                                    <input type="radio" name="image" value="[% image.KohaImage | html %]" />
181
                                                                [% END %]
188
                                                                [% END %]
182
                                                            [% END %]
189
                                                            [% END %]
183
                                                        </label>
190
                                                        </label>
Lines 187-198 Link Here
187
                                            <br class="clear" />
194
                                            <br class="clear" />
188
                                        </div>
195
                                        </div>
189
                                    [% END # /FOREACH imageset %]
196
                                    [% END # /FOREACH imageset %]
197
198
                                    <div id="remote">
199
                                        <ul>
200
                                            <li>
201
                                                <label for="remote_image_check"> Remote image:</label>
202
                                                [% IF av.imageurl.match('^http') %]
203
                                                    <input type="radio" id="remote_image_check" name="image" value="remoteImage" checked="checked" />
204
                                                    <input type="text" name="remoteImage" size="48" maxlength="200" value="[% av.imageurl | html %]" onmousedown="document.getElementById('remote_image_check').checked = true;" />
205
                                                    <img src="[% av.imageurl | html %]" alt="" />
206
                                                [% ELSE %]
207
                                                    <input type="radio" id="remote_image_check" name="image" value="remoteImage" />
208
                                                    <input type="text" name="remoteImage" size="48" maxlength="200" value="" onmousedown="document.getElementById('remote_image_check').checked = true;" />
209
                                                [% END %]
210
                                            </li>
211
                                        </ul>
212
                                        <br class="clear" />
213
                                    </div>
214
190
                                </div> <!-- /#icons -->
215
                                </div> <!-- /#icons -->
191
                            [% END # /IF action_add_category %]
216
                            [% END # /IF action_add_category %]
192
                        </fieldset>
217
                        </fieldset>
193
218
194
                        <fieldset class="action">
219
                        <fieldset class="action">
195
                            <input type="hidden" name="id" value="[% id | html %]" />
220
                            <input type="hidden" name="id" value="[% av.id | html %]" />
196
                            <input type="submit" value="Save" />
221
                            <input type="submit" value="Save" />
197
                            <a class="cancel" href="/cgi-bin/koha/admin/authorised_values.pl?searchfield=[% category_name | url %]">Cancel</a>
222
                            <a class="cancel" href="/cgi-bin/koha/admin/authorised_values.pl?searchfield=[% category_name | url %]">Cancel</a>
198
                        </fieldset>
223
                        </fieldset>
Lines 289-295 Link Here
289
                                            <td>[% loo.lib | html %]</td>
314
                                            <td>[% loo.lib | html %]</td>
290
                                            <td>[% loo.lib_opac | html %]</td>
315
                                            <td>[% loo.lib_opac | html %]</td>
291
                                            <td>
316
                                            <td>
292
                                                [% IF ( loo.imageurl ) %]<img src="[% loo.imageurl | url %]" alt=""/>[% ELSE %]&nbsp;[% END %]</td>
317
                                                [% IF ( loo.image ) %]<img src="[% loo.image | url %]" alt=""/>[% ELSE %]&nbsp;[% END %]</td>
293
                                            <td>
318
                                            <td>
294
                                                [% IF loo.branches.size > 0 %]
319
                                                [% IF loo.branches.size > 0 %]
295
                                                    [% branches_str = "" %]
320
                                                    [% branches_str = "" %]
296
- 

Return to bug 7374