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 119-135 Link Here
119
                                    <li>
119
                                    <li>
120
                                        <label for="authorised_value">Authorized value: </label>
120
                                        <label for="authorised_value">Authorized value: </label>
121
                                        [% IF ( action_modify ) %]
121
                                        [% IF ( action_modify ) %]
122
                                            <input type="hidden" id="id" name="id" value="[% id | html %]" />
122
                                            <input type="hidden" id="id" name="id" value="[% av.id | html %]" />
123
                                        [% END %]
123
                                        [% END %]
124
                                        <input type="text" id="authorised_value" name="authorised_value" value="[% authorised_value | html %]" maxlength="80" class="focus" />
124
                                        <input type="text" id="authorised_value" name="authorised_value" value="[% av.authorised_value | html %]" maxlength="80" class="focus" />
125
                                    </li>
125
                                    </li>
126
                                    <li>
126
                                    <li>
127
                                        <label for="lib">Description: </label>
127
                                        <label for="lib">Description: </label>
128
                                        <input type="text" name="lib" id="lib" value="[% lib | html %]" maxlength="200" />
128
                                        <input type="text" name="lib" id="lib" value="[% av.lib | html %]" maxlength="200" />
129
                                    </li>
129
                                    </li>
130
                                    <li>
130
                                    <li>
131
                                        <label for="lib_opac">Description (OPAC): </label>
131
                                        <label for="lib_opac">Description (OPAC): </label>
132
                                        <input type="text" name="lib_opac" id="lib_opac" value="[% lib_opac | html %]" maxlength="200" />
132
                                        <input type="text" name="lib_opac" id="lib_opac" value="[% av.lib_opac | html %]" maxlength="200" />
133
                                    </li>
133
                                    </li>
134
                                    <li><label for="branches">Library limitations: </label>
134
                                    <li><label for="branches">Library limitations: </label>
135
                                        <select id="branches" name="branches" multiple size="10">
135
                                        <select id="branches" name="branches" multiple size="10">
Lines 153-163 Link Here
153
                                        [% FOREACH imageset IN imagesets %]
153
                                        [% FOREACH imageset IN imagesets %]
154
                                            [% IF ( imageset.imagesetactive ) %]<li class="ui-tabs-active">[% ELSE %]<li>[% END %]<a href="#[% imageset.imagesetname | uri %]">[% imageset.imagesetname | html %]</a></li>
154
                                            [% IF ( imageset.imagesetactive ) %]<li class="ui-tabs-active">[% ELSE %]<li>[% END %]<a href="#[% imageset.imagesetname | uri %]">[% imageset.imagesetname | html %]</a></li>
155
                                        [% END %]
155
                                        [% END %]
156
                                        [% IF av.imageurl.match('^http') %]
157
                                            <li class="ui-tabs-active">
158
                                        [% ELSE %]
159
                                            <li>
160
                                        [% END %]
161
                                            <a href="#remote">Remote image</a>
162
                                        </li>
156
                                    </ul>
163
                                    </ul>
157
                                    <div id="none">
164
                                    <div id="none">
158
                                        <ul>
165
                                        <ul>
159
                                            <li>
166
                                            <li>
160
                                                <label for="noimage">No image: </label><input type="radio" name="imageurl" id="noimage" value="removeImage" />
167
                                                <label for="noimage">No image: </label><input type="radio" name="image" id="noimage" value="removeImage" />
161
                                            </li>
168
                                            </li>
162
                                        </ul>
169
                                        </ul>
163
                                        <br class="clear" />
170
                                        <br class="clear" />
Lines 174-184 Link Here
174
                                                            [% ELSE %]
181
                                                            [% ELSE %]
175
                                                            [% END %]
182
                                                            [% END %]
176
                                                            [% IF ( image.checked ) %]
183
                                                            [% IF ( image.checked ) %]
177
                                                                <input type="radio" name="imageurl" value="[% image.KohaImage | html %]" checked="checked" />
184
                                                                <input type="radio" name="image" value="[% image.KohaImage | html %]" checked="checked" />
178
                                                            [% ELSE %]
185
                                                            [% ELSE %]
179
                                                                [% IF ( image.KohaImage ) %]
186
                                                                [% IF ( image.KohaImage ) %]
180
                                                                    <!-- to delete the radio button if there is no image after -->
187
                                                                    <!-- to delete the radio button if there is no image after -->
181
                                                                    <input type="radio" name="imageurl" value="[% image.KohaImage | html %]" />
188
                                                                    <input type="radio" name="image" value="[% image.KohaImage | html %]" />
182
                                                                [% END %]
189
                                                                [% END %]
183
                                                            [% END %]
190
                                                            [% END %]
184
                                                        </label>
191
                                                        </label>
Lines 188-199 Link Here
188
                                            <br class="clear" />
195
                                            <br class="clear" />
189
                                        </div>
196
                                        </div>
190
                                    [% END # /FOREACH imageset %]
197
                                    [% END # /FOREACH imageset %]
198
199
                                    <div id="remote">
200
                                        <ul>
201
                                            <li>
202
                                                <label for="remote_image_check"> Remote image:</label>
203
                                                [% IF av.imageurl.match('^http') %]
204
                                                    <input type="radio" id="remote_image_check" name="image" value="remoteImage" checked="checked" />
205
                                                    <input type="text" name="remoteImage" size="48" maxlength="200" value="[% av.imageurl | html %]" onmousedown="document.getElementById('remote_image_check').checked = true;" />
206
                                                    <img src="[% av.imageurl | html %]" alt="" />
207
                                                [% ELSE %]
208
                                                    <input type="radio" id="remote_image_check" name="image" value="remoteImage" />
209
                                                    <input type="text" name="remoteImage" size="48" maxlength="200" value="" onmousedown="document.getElementById('remote_image_check').checked = true;" />
210
                                                [% END %]
211
                                            </li>
212
                                        </ul>
213
                                        <br class="clear" />
214
                                    </div>
215
191
                                </div> <!-- /#icons -->
216
                                </div> <!-- /#icons -->
192
                            [% END # /IF action_add_category %]
217
                            [% END # /IF action_add_category %]
193
                        </fieldset>
218
                        </fieldset>
194
219
195
                        <fieldset class="action">
220
                        <fieldset class="action">
196
                            <input type="hidden" name="id" value="[% id | html %]" />
221
                            <input type="hidden" name="id" value="[% av.id | html %]" />
197
                            <input type="submit" value="Save" />
222
                            <input type="submit" value="Save" />
198
                            <a class="cancel" href="/cgi-bin/koha/admin/authorised_values.pl?searchfield=[% category_name | url %]">Cancel</a>
223
                            <a class="cancel" href="/cgi-bin/koha/admin/authorised_values.pl?searchfield=[% category_name | url %]">Cancel</a>
199
                        </fieldset>
224
                        </fieldset>
Lines 290-296 Link Here
290
                                            <td>[% loo.lib | html %]</td>
315
                                            <td>[% loo.lib | html %]</td>
291
                                            <td>[% loo.lib_opac | html %]</td>
316
                                            <td>[% loo.lib_opac | html %]</td>
292
                                            <td>
317
                                            <td>
293
                                                [% IF ( loo.imageurl ) %]<img src="[% loo.imageurl | url %]" alt=""/>[% ELSE %]&nbsp;[% END %]</td>
318
                                                [% IF ( loo.image ) %]<img src="[% loo.image | url %]" alt=""/>[% ELSE %]&nbsp;[% END %]</td>
294
                                            <td>
319
                                            <td>
295
                                                [% IF loo.branches.size > 0 %]
320
                                                [% IF loo.branches.size > 0 %]
296
                                                    [% branches_str = "" %]
321
                                                    [% branches_str = "" %]
297
- 

Return to bug 7374