Bug 15117: Transfer Order: Better user information and translation handling

While transferring an order, a untranslatable JavaScript confirmation
dialog pops up.

This patch moves the information about the order to be transferred to the
top of the screen to better inform the user what order is to be transferred,
and simplifies the confirmation dialog.

To test:
- Apply patch
- Transfer an order from a basket to another basket
- Verify, that on top of the screen an information is displayed about which
  order from which vendor and basket is to be transferred
- Verify that the transfer works OK
- Update a po lang file and confirm you see the string and you are able
  to translate it.

Signed-off-by: Frederic Demians <f.demians@tamil.fr>
  Dialog box with readable & translatable info.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Marc Véron 2015-11-04 10:13:46 +01:00 committed by Tomas Cohen Arazi
parent b4967bf0ed
commit 571ec9a94b
2 changed files with 24 additions and 1 deletions

View File

@ -49,8 +49,10 @@ my $op = $input->param('op');
my $query = $input->param('query');
my $order = GetOrder($ordernumber);
my $basketfromname = '';
if($order) {
my $basket = GetBasket($order->{basketno});
$basketfromname = $basket->{basketname};
$bookselleridfrom = $basket->{booksellerid} if $basket;
}
@ -65,6 +67,7 @@ if($booksellerto){
$booksellertoname = $booksellerto->{name};
}
if( $basketno && $ordernumber) {
# Transfer order and exit
my $order = GetOrder( $ordernumber );
@ -132,6 +135,7 @@ $template->param(
booksellertoname => $booksellertoname,
ordernumber => $ordernumber,
basketno => $basketno,
basketfromname => $basketfromname,
);
output_html_with_http_headers $input, $cookie, $template->output;

View File

@ -12,6 +12,18 @@
//]]>
</script>
[% END %]
[% IF ( bookselleridfrom ) %]
<script type="text/javascript">
//<![CDATA[
function confirmtransfer() {
return confirm( _("Transfer order to this basket?") );
}
//]]>
</script>
[% END %]
</head>
<body id="acq_transferorder" class="acq">
@ -20,6 +32,13 @@
<div class="yui-g">
[% IF ( bookselleridfrom ) %]
<h3>Search for a vendor to transfer to</h3>
<div class="transferinfo">
<ul>
<li><span class="label">From vendor: </span>[% booksellerfromname %]</li>
<li><span class="label">Basket: </span>[% basketfromname %]</li>
<li><span class="label">Order: </span>[% ordernumber %]</li>
</ol>
</div>
[% ELSE %]
<h3>Search for a vendor to transfer from</h3>
[% END %]
@ -53,7 +72,7 @@
<td>[% basket.basketname %] (#[% basket.basketno %])</td>
<td>[% basket.createdby %]</td>
<td>[% basket.creationdate %]</td>
<td><a href="transferorder.pl?basketno=[% basket.basketno %]&ordernumber=[% ordernumber %]" onclick="return confirm('Do you want to transfer order [% ordernumber %] from basket [% basketfromname %] ([% booksellerfromname %]) to basket [% basket.basketname %] ([% booksellertoname %]) ?');">Choose</a>
<td><a href="transferorder.pl?basketno=[% basket.basketno %]&ordernumber=[% ordernumber %]" onclick="return confirmtransfer();">Choose</a>
</tr>
[% END %]
</tbody>