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

(-)a/catalogue/updateitem.pl (-6 / +7 lines)
Lines 31-36 my $cgi= new CGI; Link Here
31
31
32
checkauth($cgi, 0, {circulate => 'circulate_remaining_permissions'}, 'intranet');
32
checkauth($cgi, 0, {circulate => 'circulate_remaining_permissions'}, 'intranet');
33
33
34
my $op = $cgi->param('op') || "";
34
my $biblionumber=$cgi->param('biblionumber');
35
my $biblionumber=$cgi->param('biblionumber');
35
my $itemnumber=$cgi->param('itemnumber');
36
my $itemnumber=$cgi->param('itemnumber');
36
my $biblioitemnumber=$cgi->param('biblioitemnumber');
37
my $biblioitemnumber=$cgi->param('biblioitemnumber');
Lines 55-76 for ($damaged,$itemlost,$withdrawn) { Link Here
55
56
56
# modify MARC item if input differs from items table.
57
# modify MARC item if input differs from items table.
57
my $item_changes = {};
58
my $item_changes = {};
58
if (defined $itemnotes_nonpublic) { # i.e., itemnotes_nonpublic parameter passed from form
59
if ( $op eq "set_non_public_note" ) {
59
    checkauth($cgi, 0, {editcatalogue => 'edit_items'}, 'intranet');
60
    checkauth($cgi, 0, {editcatalogue => 'edit_items'}, 'intranet');
60
    if ((not defined  $item_data_hashref->{'itemnotes_nonpublic'}) or $itemnotes_nonpublic ne $item_data_hashref->{'itemnotes_nonpublic'}) {
61
    if ((not defined  $item_data_hashref->{'itemnotes_nonpublic'}) or $itemnotes_nonpublic ne $item_data_hashref->{'itemnotes_nonpublic'}) {
61
        $item_changes->{'itemnotes_nonpublic'} = $itemnotes_nonpublic;
62
        $item_changes->{'itemnotes_nonpublic'} = $itemnotes_nonpublic;
62
    }
63
    }
63
}
64
}
64
elsif (defined $itemnotes) { # i.e., itemnotes parameter passed from form
65
elsif ( $op eq "set_public_note" ) { # i.e., itemnotes parameter passed from form
65
    checkauth($cgi, 0, {editcatalogue => 'edit_items'}, 'intranet');
66
    checkauth($cgi, 0, {editcatalogue => 'edit_items'}, 'intranet');
66
    if ((not defined  $item_data_hashref->{'itemnotes'}) or $itemnotes ne $item_data_hashref->{'itemnotes'}) {
67
    if ((not defined  $item_data_hashref->{'itemnotes'}) or $itemnotes ne $item_data_hashref->{'itemnotes'}) {
67
        $item_changes->{'itemnotes'} = $itemnotes;
68
        $item_changes->{'itemnotes'} = $itemnotes;
68
    }
69
    }
69
} elsif ($itemlost ne $item_data_hashref->{'itemlost'}) {
70
} elsif ( $op eq "set_lost" && $itemlost ne $item_data_hashref->{'itemlost'}) {
70
    $item_changes->{'itemlost'} = $itemlost;
71
    $item_changes->{'itemlost'} = $itemlost;
71
} elsif ($withdrawn ne $item_data_hashref->{'withdrawn'}) {
72
} elsif ( $op eq "set_withdrawn" && $withdrawn ne $item_data_hashref->{'withdrawn'}) {
72
    $item_changes->{'withdrawn'} = $withdrawn;
73
    $item_changes->{'withdrawn'} = $withdrawn;
73
} elsif ($damaged ne $item_data_hashref->{'damaged'}) {
74
} elsif ( $op eq "set_damaged" && $damaged ne $item_data_hashref->{'damaged'}) {
74
    $item_changes->{'damaged'} = $damaged;
75
    $item_changes->{'damaged'} = $damaged;
75
} else {
76
} else {
76
    #nothings changed, so do nothing.
77
    #nothings changed, so do nothing.
Lines 80-85 elsif (defined $itemnotes) { # i.e., itemnotes parameter passed from form Link Here
80
81
81
ModItem($item_changes, $biblionumber, $itemnumber);
82
ModItem($item_changes, $biblionumber, $itemnumber);
82
83
83
LostItem($itemnumber, 'moredetail') if $itemlost;
84
LostItem($itemnumber, 'moredetail') if $op eq "set_lost";
84
85
85
print $cgi->redirect("moredetail.pl?biblionumber=$biblionumber&itemnumber=$itemnumber#item$itemnumber");
86
print $cgi->redirect("moredetail.pl?biblionumber=$biblionumber&itemnumber=$itemnumber#item$itemnumber");
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt (-7 / +5 lines)
Lines 113-120 Link Here
113
                            [% END %]
113
                            [% END %]
114
                        [% END %]
114
                        [% END %]
115
                        </select>
115
                        </select>
116
                        <input type="hidden" name="withdrawn" value="[% ITEM_DAT.withdrawn | html %]" />
116
                        <input type="hidden" name="op" value="set_lost" />
117
                        <input type="hidden" name="damaged" value="[% ITEM_DAT.damaged | html %]" />
118
                        <input type="submit" name="submit" class="submit" value="Set status" /></form>
117
                        <input type="submit" name="submit" class="submit" value="Set status" /></form>
119
                    [% ELSE %]
118
                    [% ELSE %]
120
                        [% FOREACH itemlostloo IN itemlostloop %]
119
                        [% FOREACH itemlostloo IN itemlostloop %]
Lines 146-153 Link Here
146
                [% END %]
145
                [% END %]
147
            [% END %]
146
            [% END %]
148
                    </select>
147
                    </select>
149
                    <input type="hidden" name="withdrawn" value="[% ITEM_DAT.withdrawn | html %]" />
148
                    <input type="hidden" name="op" value="set_damaged" />
150
                    <input type="hidden" name="itemlost" value="[% ITEM_DAT.itemlost | html %]" />
151
                    <input type="submit" name="submit" class="submit" value="Set status" /></form>
149
                    <input type="submit" name="submit" class="submit" value="Set status" /></form>
152
                [% ELSE %]
150
                [% ELSE %]
153
                    [% FOREACH itemdamagedloo IN itemdamagedloop %]
151
                    [% FOREACH itemdamagedloo IN itemdamagedloop %]
Lines 180-187 Link Here
180
                                    [% END %]
178
                                    [% END %]
181
                                [% END %]
179
                                [% END %]
182
                            </select>
180
                            </select>
183
                            <input type="hidden" name="itemlost" value="[% ITEM_DAT.itemlost | html %]" />
181
                            <input type="hidden" name="op" value="set_withdrawn" />
184
                            <input type="hidden" name="damaged" value="[% ITEM_DAT.damaged | html %]" />
185
                            <input type="submit" name="submit" class="submit" value="Set status" /></form>
182
                            <input type="submit" name="submit" class="submit" value="Set status" /></form>
186
                    [% ELSE %]
183
                    [% ELSE %]
187
                        [% FOREACH itemwithdrawn IN itemwithdrawnloop %]
184
                        [% FOREACH itemwithdrawn IN itemwithdrawnloop %]
Lines 249-254 Link Here
249
                    [% IF ( CAN_user_editcatalogue_edit_items ) %]
246
                    [% IF ( CAN_user_editcatalogue_edit_items ) %]
250
                    <form class="inline" action="updateitem.pl" method="post"><input type="hidden" name="biblionumber" value="[% ITEM_DAT.biblionumber | html %]" />
247
                    <form class="inline" action="updateitem.pl" method="post"><input type="hidden" name="biblionumber" value="[% ITEM_DAT.biblionumber | html %]" />
251
                        <input type="hidden" name="biblioitemnumber" value="[% ITEM_DAT.biblioitemnumber | html %]" /><input type="hidden" name="itemnumber" value="[% ITEM_DAT.itemnumber | html %]" />
248
                        <input type="hidden" name="biblioitemnumber" value="[% ITEM_DAT.biblioitemnumber | html %]" /><input type="hidden" name="itemnumber" value="[% ITEM_DAT.itemnumber | html %]" />
249
                        <input type="hidden" name="op" value="set_public_note" />
252
                        <textarea name="itemnotes" rows="2" cols="30">[% ITEM_DAT.itemnotes | html %]</textarea><input type="submit" name="submit" class="submit" value="Update" />
250
                        <textarea name="itemnotes" rows="2" cols="30">[% ITEM_DAT.itemnotes | html %]</textarea><input type="submit" name="submit" class="submit" value="Update" />
253
                    </form>
251
                    </form>
254
                    [% ELSE %]
252
                    [% ELSE %]
Lines 262-267 Link Here
262
                    [% IF ( CAN_user_editcatalogue_edit_items ) %]
260
                    [% IF ( CAN_user_editcatalogue_edit_items ) %]
263
                    <form class="inline" action="updateitem.pl" method="post"><input type="hidden" name="biblionumber" value="[% ITEM_DAT.biblionumber | html %]" />
261
                    <form class="inline" action="updateitem.pl" method="post"><input type="hidden" name="biblionumber" value="[% ITEM_DAT.biblionumber | html %]" />
264
                        <input type="hidden" name="biblioitemnumber" value="[% ITEM_DAT.biblioitemnumber | html %]" /><input type="hidden" name="itemnumber" value="[% ITEM_DAT.itemnumber | html %]" />
262
                        <input type="hidden" name="biblioitemnumber" value="[% ITEM_DAT.biblioitemnumber | html %]" /><input type="hidden" name="itemnumber" value="[% ITEM_DAT.itemnumber | html %]" />
263
                        <input type="hidden" name="op" value="set_non_public_note" />
265
                        <textarea name="itemnotes_nonpublic" rows="2" cols="30">[% ITEM_DAT.itemnotes_nonpublic | html %]</textarea><input type="submit" name="submit" class="submit" value="Update" />
264
                        <textarea name="itemnotes_nonpublic" rows="2" cols="30">[% ITEM_DAT.itemnotes_nonpublic | html %]</textarea><input type="submit" name="submit" class="submit" value="Update" />
266
                    </form>
265
                    </form>
267
                    [% ELSE %]
266
                    [% ELSE %]
268
- 

Return to bug 22927