partial fix for mantis #1498

This commit is contained in:
Paul Poulain 2009-06-23 15:06:51 +02:00 committed by Henri-Damien LAURENT
parent fa13689c2d
commit aa708232fe
5 changed files with 62 additions and 49 deletions

View File

@ -651,7 +651,7 @@ Results are ordered from most to least recent.
=cut
sub GetPendingOrders {
my ($supplierid,$grouped,$owner) = @_;
my ($supplierid,$grouped,$owner,$basketno) = @_;
my $dbh = C4::Context->dbh;
my $strsth = "
SELECT ".($grouped?"count(*),":"")."aqbasket.basketno,
@ -680,6 +680,10 @@ sub GetPendingOrders {
$strsth .= " AND aqbasket.authorisedby=? ";
push @query_params, $userenv->{'number'};
}
if ($basketno) {
$strsth .= " AND aqbasket.basketno=? ";
push @query_params, $basketno;
}
$strsth .= " group by aqbasket.basketno" if $grouped;
$strsth .= " order by aqbasket.basketno";

View File

@ -67,12 +67,13 @@ my ($template, $loggedinuser, $cookie)
});
my $booksellerid = $input->param('booksellerid');
my $basketno = $input->param('basketno');
my $op = $input->param('op');
my $owner = $input->param('owner') || 0 ; # flag to see only "my" orders, or everyone orders
my $bookseller = &GetBookSellerFromId($booksellerid);
#show all orders that have uncertain price for the bookseller
my $pendingorders = &GetPendingOrders($booksellerid,0,$owner);
my $pendingorders = &GetPendingOrders($booksellerid,0,$owner,$basketno);
my @orders;
foreach my $order (@{$pendingorders}) {
@ -83,6 +84,8 @@ foreach my $order (@{$pendingorders}) {
$order->{'bibpublicationyear'} = $bibdata->{'publicationyear'};
$order->{'bibtitle'} = $bibdata->{'title'};
$order->{'bibauthor'} = $bibdata->{'author'};
$order->{'surname'} = $order->{'surname'};
$order->{'firstname'} = $order->{'firstname'};
my $order_as_from_db=GetOrder($order->{ordernumber});
$order->{'quantity'} = $order_as_from_db->{'quantity'};
$order->{'listprice'} = $order_as_from_db->{'listprice'};

View File

@ -19,7 +19,11 @@
{ text: _("Baskets"), url: "/cgi-bin/koha/acqui/booksellers.pl?supplierid=<!--TMPL_VAR Name="id"-->"},
{ text: _("Basket grouping"), url: "/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=<!-- TMPL_VAR NAME="id" -->"},
{ text: _("Receive shipments"), url: "/cgi-bin/koha/acqui/parcels.pl?supplierid=<!--TMPL_VAR Name="id"-->" },
{ text: _("Uncertain prices"), url: "/cgi-bin/koha/acqui/uncertainprice.pl?booksellerid=<!-- TMPL_VAR NAME="id" -->&owner=1"}
<!-- TMPL_IF name="basketno" -->
{ text: _("Uncertain prices"), url: "/cgi-bin/koha/acqui/uncertainprice.pl?booksellerid=<!-- TMPL_VAR NAME="id" -->&basketno=<!--TMPL_VAR name="basketno" -->&owner=1"}
<!-- TMPL_ELSE -->
{ text: _("Uncertain prices"), url: "/cgi-bin/koha/acqui/uncertainprice.pl?booksellerid=<!-- TMPL_VAR NAME="id" -->&owner=1"}
<!-- /TMPL_IF -->
]
<!-- TMPL_IF NAME="id" -->new YAHOO.widget.Button("newbasket");
new YAHOO.widget.Button("editsupplier");

View File

@ -69,7 +69,11 @@
<li><a href="<!-- TMPL_VAR NAME="script_name" -->?op=del_basket&basketno=<!-- TMPL_VAR NAME="basketno" -->&booksellerid=<!-- TMPL_VAR NAME="booksellerid" -->" class="button" id="delbasketbutton">Delete this basket</a></li>
<!-- TMPL_IF name="unclosable" -->
<li><button onclick="confirm_close()" class="yui-button-disabled" id="closebutton" type="push" disabled="true" title="You can not close this basket" >Can not close basket</a></li>
<li><a href="/cgi-bin/koha/acqui/uncertainprice.pl?booksellerid=<!-- TMPL_VAR name="booksellerid" -->&owner=1" class="button" id="uncertpricesbutton">Uncertain prices</a></li>
<!-- TMPL_IF name="basketno" -->
<li><a href="/cgi-bin/koha/acqui/uncertainprice.pl?booksellerid=<!-- TMPL_VAR name="booksellerid" -->&basketno=<!-- TMPL_VAR name="basketno" -->&owner=1" class="button" id="uncertpricesbutton">Uncertain prices</a></li>
<!-- TMPL_ELSE -->
<li><a href="/cgi-bin/koha/acqui/uncertainprice.pl?booksellerid=<!-- TMPL_VAR name="booksellerid" -->&owner=1" class="button" id="uncertpricesbutton">Uncertain prices</a></li>
<!--/TMPL_IF -->
<!-- TMPL_ELSE -->
<li><a href="javascript:confirm_close()" class="button" id="closebutton">Close this basket</a></li>
<!-- /TMPL_IF -->

View File

@ -23,48 +23,27 @@ function check(form) {
<META HTTP-EQUIV=Refresh CONTENT="0; URL=<!-- TMPL_VAR name="scriptname" -->?booksellerid=<!-- TMPL_VAR NAME="booksellerid" -->">
<!-- TMPL_ELSE -->
<h1>Orders with uncertain prices for vendor <a href="/cgi-bin/koha/acqui/supplier.pl?supplierid=<!-- TMPL_VAR NAME="booksellerid" -->"><!--TMPL_VAR name="booksellername" --></a> <a href="/cgi-bin/koha/acqui/supplier.pl?supplierid=<!-- TMPL_VAR NAME="booksellerid" -->&op=enter">(edit)</a></h1>
<!-- TMPL_IF name="owner" -->
<a href="/cgi-bin/koha/acqui/uncertainprice.pl?booksellerid=<!-- TMPL_VAR NAME="booksellerid" -->">View everyone orders</a>
<!-- TMPL_ELSE -->
<a href="/cgi-bin/koha/acqui/uncertainprice.pl?booksellerid=<!-- TMPL_VAR NAME="booksellerid" -->&owner=1">View only my orders</a>
<!-- /TMPL_IF -->
<h2>Contact information</h2>
<p><strong>Postal address: </strong>
<!-- TMPL_VAR name="booksellerpostal" --></p>
<!-- TMPL_IF name="bookselleraddress1" -->
<p><strong>Address 1: </strong>
<!-- TMPL_VAR name="bookselleraddress1" --></p>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="bookselleraddress2" -->
<p><strong>Address 2: </strong>
<!-- TMPL_VAR name="bookselleraddress2" --></p>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="bookselleraddress3" -->
<p><strong>Address 3: </strong>
<!-- TMPL_VAR name="bookselleraddress3" --></p>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="bookselleraddress4" -->
<p><strong>Address 4: </strong>
<!-- TMPL_VAR name="bookselleraddress4" --></p>
<!-- /TMPL_IF -->
<p><strong>Telephone: </strong>
<!--TMPL_VAR name="booksellerphone" --></p>
<p><strong>Fax: </strong>
<p><strong>Address: </strong>
<!-- TMPL_VAR name="booksellerpostal" -->
<!-- TMPL_VAR name="bookselleraddress1" -->
<!-- TMPL_VAR name="bookselleraddress2" -->
<!-- TMPL_VAR name="bookselleraddress3" -->
<!-- TMPL_VAR name="bookselleraddress4" -->
<a href="<!--TMPL_VAR name="booksellerurl" -->"><!--TMPL_VAR name="booksellerurl" --></a>
</p>
<p><strong>Phone: </strong>
<!--TMPL_VAR name="booksellerphone" --> / Fax:
<!--TMPL_VAR name="booksellerfax" --></p>
<p><strong>Web: </strong>
<a href="<!--TMPL_VAR name="booksellerurl" -->"><!--TMPL_VAR name="booksellerurl" --></a></p>
<p><dl>
<dt><strong>Contact: </strong></dt>
<dd><strong>Name: </strong><!--TMPL_VAR name="booksellercontact" --></dd>
<dd><strong>Position: </strong><!--TMPL_VAR name="booksellercontpos" --></dd>
<dd><strong>Telephone: </strong><!--TMPL_VAR name="booksellercontphone" --></dd>
<!-- TMPL_IF name="booksellercontaltphone" -->
<dd><strong>Alternate phone: </strong><!--TMPL_VAR name="booksellercontaltphone" --></dd>
<!-- /TMPL_IF -->
<dd><strong>e-mail: </strong><!--TMPL_VAR name="booksellercontemail" --></dd>
<!-- TMPL_IF name="booksellercontnotes" -->
<dd><strong>notes: </strong><!--TMPL_VAR name="booksellercontnotes" --></dd>
<!-- /TMPL_IF -->
<dt><strong>Contact: </strong>
<dd><!--TMPL_VAR name="booksellercontact" -->
<!--TMPL_VAR name="booksellercontpos" -->
<!--TMPL_VAR name="booksellercontphone" -->
<!--TMPL_VAR name="booksellercontaltphone" -->
<!--TMPL_VAR name="booksellercontemail" -->
<!--TMPL_VAR name="booksellercontnotes" -->
</dd>
</dl></p>
<!-- TMPL_IF name="booksellernotes" -->
<p><strong>Notes: </strong>
@ -74,25 +53,44 @@ function check(form) {
<form action="<!-- TMPL_VAR name="scriptname" -->" method="post" name="uncertainprices">
<input type="hidden" name="booksellerid" value="<!-- TMPL_VAR name="booksellerid" -->" />
<input type="hidden" name="op" value="validate" />
Orders from:
<select name="owner">
<!-- TMPL_IF name="owner" -->
<option value="0">Everyone</option>
<option value="1" selected="selected">me</option>
<!-- TMPL_ELSE -->
<option value="0" selected="selected">Everyone</option>
<option value="1">me</option>
<!-- /TMPL_IF -->
</select>
<input type="submit" value="Filter" />
</form>
<form action="<!-- TMPL_VAR name="scriptname" -->" method="post" name="uncertainprices">
<input type="hidden" name="booksellerid" value="<!-- TMPL_VAR name="booksellerid" -->" />
<input type="hidden" name="op" value="validate" />
<table>
<tr>
<th>order information</th>
<th>basket name</th>
<th>uncertain price</th>
<th>basket</th>
<th>order</th>
<th>by</th>
<th>uncertain</th>
<th>price</th>
<th>quantity</th>
</tr>
<!-- TMPL_LOOP name="uncertainpriceorders" -->
<tr>
<td>
<!-- TMPL_VAR name="basketname" -->
</td>
<td>
<!-- TMPL_VAR name="bibtitle" --> / <!-- TMPL_VAR name="bibauthor" --> <br /> <!-- TMPL_VAR name="bibpublishercode" -->, <!-- TMPL_VAR name="bibpublicationyear" --><br /><!-- TMPL_VAR name="bibisbn" --><br />
<a href="neworderempty.pl?ordnum=<!-- TMPL_VAR name="ordernumber" -->&booksellerid=<!-- TMPL_VAR name="booksellerid" -->&basketno=<!-- TMPL_VAR name="basketno" -->">
edit
</a>
</td>
<td>
<!-- TMPL_VAR name="basketname" -->
</td>
<td>
<!-- TMPL_VAR name="firstname" --> <!-- TMPL_VAR name="surname" -->
</td>
<td>
<input type="checkbox" name="uncertainprice<!-- TMPL_VAR name="ordernumber" -->" value="1" checked>
</td>