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

(-)a/C4/Acquisition.pm (-4 / +8 lines)
Lines 385-391 sub ModBasket { Link Here
385
385
386
=head3 ModBasketHeader
386
=head3 ModBasketHeader
387
387
388
  &ModBasketHeader($basketno, $basketname, $note, $booksellernote, $contractnumber);
388
  &ModBasketHeader($basketno, $basketname, $note, $booksellernote, $contractnumber, $booksellerid);
389
389
390
Modifies a basket's header.
390
Modifies a basket's header.
391
391
Lines 401-416 Modifies a basket's header. Link Here
401
401
402
=item C<$contractnumber> is the "contractnumber" (foreign) key in the "aqbasket" table.
402
=item C<$contractnumber> is the "contractnumber" (foreign) key in the "aqbasket" table.
403
403
404
=item C<$booksellerid> is the id (foreign) key in the "aqbooksellers" table for the vendor.
405
404
=back
406
=back
405
407
406
=cut
408
=cut
407
409
408
sub ModBasketHeader {
410
sub ModBasketHeader {
409
    my ($basketno, $basketname, $note, $booksellernote, $contractnumber) = @_;
411
    my ($basketno, $basketname, $note, $booksellernote, $contractnumber, $booksellerid) = @_;
410
    my $query = "UPDATE aqbasket SET basketname=?, note=?, booksellernote=? WHERE basketno=?";
412
413
    my $query = "UPDATE aqbasket SET basketname=?, note=?, booksellernote=?, booksellerid=? WHERE basketno=?";
411
    my $dbh = C4::Context->dbh;
414
    my $dbh = C4::Context->dbh;
412
    my $sth = $dbh->prepare($query);
415
    my $sth = $dbh->prepare($query);
413
    $sth->execute($basketname,$note,$booksellernote,$basketno);
416
    $sth->execute($basketname,$note,$booksellernote,$booksellerid,$basketno);
417
414
    if ( $contractnumber ) {
418
    if ( $contractnumber ) {
415
        my $query2 ="UPDATE aqbasket SET contractnumber=? WHERE basketno=?";
419
        my $query2 ="UPDATE aqbasket SET contractnumber=? WHERE basketno=?";
416
        my $sth2 = $dbh->prepare($query2);
420
        my $sth2 = $dbh->prepare($query2);
(-)a/acqui/basketheader.pl (-5 / +6 lines)
Lines 52-58 use C4::Context; Link Here
52
use C4::Auth;
52
use C4::Auth;
53
use C4::Output;
53
use C4::Output;
54
use C4::Acquisition qw/GetBasket NewBasket GetContracts ModBasketHeader/;
54
use C4::Acquisition qw/GetBasket NewBasket GetContracts ModBasketHeader/;
55
use C4::Bookseller qw/GetBookSellerFromId/;
55
use C4::Bookseller qw/GetBookSellerFromId GetBookSeller/;
56
56
57
57
58
my $input = new CGI;
58
my $input = new CGI;
Lines 68-75 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
68
);
68
);
69
69
70
#parameters:
70
#parameters:
71
my $booksellerid;
71
my $booksellerid = $input->param('booksellerid');
72
$booksellerid = $input->param('booksellerid');
73
my $basketno = $input->param('basketno');
72
my $basketno = $input->param('basketno');
74
my $basket;
73
my $basket;
75
my $op = $input ->param('op');
74
my $op = $input ->param('op');
Lines 101-113 if ( $op eq 'add_form' ) { Link Here
101
        $template->param(contractloop => \@contractloop,
100
        $template->param(contractloop => \@contractloop,
102
                         basketcontractnumber => $basket->{'contractnumber'});
101
                         basketcontractnumber => $basket->{'contractnumber'});
103
    }
102
    }
103
    my @booksellers = GetBookSeller();
104
    $template->param( add_form => 1,
104
    $template->param( add_form => 1,
105
                    basketname => $basket->{'basketname'},
105
                    basketname => $basket->{'basketname'},
106
                    basketnote => $basket->{'note'},
106
                    basketnote => $basket->{'note'},
107
                    basketbooksellernote => $basket->{'booksellernote'},
107
                    basketbooksellernote => $basket->{'booksellernote'},
108
                    booksellername => $bookseller->{'name'},
108
                    booksellername => $bookseller->{'name'},
109
                    booksellerid => $booksellerid,
109
                    booksellerid => $booksellerid,
110
                    basketno => $basketno
110
                    basketno => $basketno,
111
                    booksellers => \@booksellers,
111
    	);
112
    	);
112
#End Edit
113
#End Edit
113
} elsif ( $op eq 'add_validate' ) {
114
} elsif ( $op eq 'add_validate' ) {
Lines 115-121 if ( $op eq 'add_form' ) { Link Here
115
    my $basketno;
116
    my $basketno;
116
    if ( $is_an_edit ) {
117
    if ( $is_an_edit ) {
117
        $basketno = $input->param('basketno');
118
        $basketno = $input->param('basketno');
118
        ModBasketHeader($input->param('basketno'),$input->param('basketname'),$input->param('basketnote'),$input->param('basketbooksellernote'),$input->param('basketcontractnumber'));
119
        ModBasketHeader( $input->param('basketno'), $input->param('basketname'), $input->param('basketnote'), $input->param('basketbooksellernote'), $input->param('basketcontractnumber') || undef, $input->param('basketbooksellerid') );
119
    } else { #New basket
120
    } else { #New basket
120
        $basketno = NewBasket($booksellerid, $loggedinuser, $input->param('basketname'), $input->param('basketnote'), $input->param('basketbooksellernote'), $input->param('basketcontractnumber'));
121
        $basketno = NewBasket($booksellerid, $loggedinuser, $input->param('basketname'), $input->param('basketnote'), $input->param('basketbooksellernote'), $input->param('basketcontractnumber'));
121
    }
122
    }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt (-1 / +1 lines)
Lines 111-117 Link Here
111
                    </script>
111
                    </script>
112
112
113
                    <ul id="toolbar-list" class="toolbar">
113
                    <ul id="toolbar-list" class="toolbar">
114
                    <li><a href="basketheader.pl?basketno=[% basketno %]&amp;op=add_form" class="button" id="basketheadbutton">Edit basket header information</a></li>
114
                    <li><a href="basketheader.pl?booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]&amp;op=add_form" class="button" id="basketheadbutton">Edit basket</a></li>
115
                    <li><a href="javascript:confirm_deletion();" class="button" id="delbasketbutton">Delete this basket</a></li>
115
                    <li><a href="javascript:confirm_deletion();" class="button" id="delbasketbutton">Delete this basket</a></li>
116
                    [% IF ( unclosable ) %]
116
                    [% IF ( unclosable ) %]
117
                    [% ELSIF ( uncertainprices ) %]
117
                    [% ELSIF ( uncertainprices ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketheader.tt (-1 / +8 lines)
Lines 126-131 li.list2 { Link Here
126
                        <input type="text" name="basketname" id="basketname" size="40" maxlength="80" value="[% basketname %]" />
126
                        <input type="text" name="basketname" id="basketname" size="40" maxlength="80" value="[% basketname %]" />
127
                </li>
127
                </li>
128
                <li>
128
                <li>
129
                    <label for="basketbooksellerid">Vendor</label> &nbsp;
130
                    <select name="basketbooksellerid" id="basketbooksellerid">
131
			[% FOREACH b IN booksellers %]
132
				<option value="[% b.id %]" [% IF booksellerid == b.id %] selected="selected"[% END %]>[% b.name %]</option>
133
			[% END %]
134
		    </select>
135
                </li>
136
                <li>
129
                    <label for="basketnote">Internal note</label> &nbsp;
137
                    <label for="basketnote">Internal note</label> &nbsp;
130
                    <textarea name="basketnote" id="basketnote" rows="5" cols="40">[% basketnote %]</textarea>
138
                    <textarea name="basketnote" id="basketnote" rows="5" cols="40">[% basketnote %]</textarea>
131
                </li>
139
                </li>
132
- 

Return to bug 7757