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

(-)a/cataloguing/additem.pl (-3 / +5 lines)
Lines 54-60 use URI::Escape qw( uri_escape_utf8 ); Link Here
54
our $dbh = C4::Context->dbh;
54
our $dbh = C4::Context->dbh;
55
55
56
sub add_item_to_item_group {
56
sub add_item_to_item_group {
57
    my ( $biblionumber, $itemnumber, $item_group, $item_group_description ) = @_;
57
    my ( $biblionumber, $itemnumber, $item_group, $item_group_description, $display_order ) = @_;
58
58
59
    return unless $item_group;
59
    return unless $item_group;
60
60
Lines 64-69 sub add_item_to_item_group { Link Here
64
            {
64
            {
65
                biblio_id   => $biblionumber,
65
                biblio_id   => $biblionumber,
66
                description => $item_group_description,
66
                description => $item_group_description,
67
                display_order => $display_order,
67
            }
68
            }
68
        )->store();
69
        )->store();
69
70
Lines 136-141 my $fa_stickyduedate = $input->param('stickyduedate'); Link Here
136
my $fa_duedatespec         = $input->param('duedatespec');
137
my $fa_duedatespec         = $input->param('duedatespec');
137
my $item_group             = $input->param('item_group');
138
my $item_group             = $input->param('item_group');
138
my $item_group_description = $input->param('item_group_description');
139
my $item_group_description = $input->param('item_group_description');
140
my $display_order          = $input->param('item_group_display_order');
139
141
140
our $frameworkcode = &GetFrameworkCode($biblionumber);
142
our $frameworkcode = &GetFrameworkCode($biblionumber);
141
143
Lines 332-338 if ($op eq "cud-additem") { Link Here
332
        }
334
        }
333
        unless ( @errors ) {
335
        unless ( @errors ) {
334
            $item->store->discard_changes;
336
            $item->store->discard_changes;
335
            add_item_to_item_group( $item->biblionumber, $item->itemnumber, $item_group, $item_group_description );
337
            add_item_to_item_group( $item->biblionumber, $item->itemnumber, $item_group, $item_group_description, $display_order );
336
338
337
            # This is a bit tricky : if there is a cookie for the last created item and
339
            # This is a bit tricky : if there is a cookie for the last created item and
338
            # we just added an item, the cookie value is not correct yet (it will be updated
340
            # we just added an item, the cookie value is not correct yet (it will be updated
Lines 445-451 if ($op eq "cud-additem") { Link Here
445
                    $current_item = $current_item->unblessed;
447
                    $current_item = $current_item->unblessed;
446
                    add_item_to_item_group(
448
                    add_item_to_item_group(
447
                        $item->biblionumber, $item->itemnumber, $item_group,
449
                        $item->biblionumber, $item->itemnumber, $item_group,
448
                        $item_group_description
450
                        $item_group_description, $display_order
449
                    );
451
                    );
450
452
451
# We count the item only if it was really added
453
# We count the item only if it was really added
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt (-21 / +28 lines)
Lines 266-291 Link Here
266
        [% FOREACH ig IN item_groups %]
266
        [% FOREACH ig IN item_groups %]
267
            <input type="hidden" id="item-group-[% ig.id | html %]" value="[% ig.description | html %]" />
267
            <input type="hidden" id="item-group-[% ig.id | html %]" value="[% ig.description | html %]" />
268
        [% END %]
268
        [% END %]
269
        <p>
269
        <ol>
270
            <label for="select_item_group">Options: </label>
270
            <li>
271
            <select name="item_group" id="item-group-add-or-create-form-select">
271
                <label for="select_item_group">Options: </label>
272
                <optgroup label="Use existing item group">
272
                <select name="item_group" id="item-group-add-or-create-form-select">
273
                    [% FOREACH ig IN biblio.item_groups.search({}, {order_by => 'display_order'}) %]
273
                    <optgroup label="Use existing item group">
274
                        <option value="[% ig.id | html %]">[% ig.description | html %]</option>
274
                        [% FOREACH ig IN biblio.item_groups.search({}, {order_by => 'display_order'}) %]
275
                    [% END %]
275
                            <option value="[% ig.id | html %]">[% ig.description | html %]</option>
276
                </optgroup>
276
                        [% END %]
277
                <optgroup label="Other options">
277
                    </optgroup>
278
                    <option id="item-group-add-or-create-form-no-add" value="">Do not add to item group</option>
278
                    <optgroup label="Other options">
279
                    <option value="create">Create new item group</option>
279
                        <option id="item-group-add-or-create-form-no-add" value="">Do not add to item group</option>
280
                </optgroup>
280
                        <option value="create">Create new item group</option>
281
            </select>
281
                    </optgroup>
282
        </p>
282
                </select>
283
283
            </li>
284
        <p id="item-group-add-or-create-form-description-block">
284
            <div id="item-group-add-or-create-form-description-block">
285
            <label for="item_group_description" class="required">Name: </label>
285
                <li>
286
            <input name="item_group_description" id="item-group-add-or-create-form-description" type="text" size="30" class="required" />
286
                    <label for="item_group_description" class="required">Name: </label>
287
            <span class="required">Required</span>
287
                    <input name="item_group_description" id="item-group-add-or-create-form-description" type="text" size="30" class="required" />
288
        </p>
288
                    <span class="required">Required</span>
289
                </li>
290
                <li>
291
                    <label for="item_group_display_order">Display order: </label>
292
                    <input name="item_group_display_order" id="item_group_display_order" type="text" pattern="\d*" size="30" />
293
                    <div class="hint">Display order must be numerical</div>
294
                </li>
295
            </div>
296
        </ol>
289
    </fieldset>
297
    </fieldset>
290
[% END %]
298
[% END %]
291
299
292
- 

Return to bug 36498