Jonathan Druart
19a977dc7b
This is the fourth and last patch set to remove C4::Branch. The real purpose of this patch is to standardise and refactor some code which is related to the libraries selection/display. Its unconfessed purpose is to remove the C4::Branch package. Before this patch set, only 6 subroutines still existed in the C4::Branch package: - GetBranchName - GetBranchesLoop - mybranch - onlymine - GetBranches - GetBranch GetBranchName basically returns the branchname for a given branchcode. The branchname is only used for a display purpose and we don't need to retrieve it in package or pl scripts (unless for a few exceptions). We have a `Branches` template plugin with a `GetName` method which does exactly this job. To achieve this removal, we will use this template plugin and delete the GetBranchName from pl and pm files. The `Branches.all()` will now select the library of the logged in user if no `selected` parameter has been passed. This new behavior could cause regressions, for instance there are some places where we do not want an option preselected (batch item modification for instance), keep that in mind when testing. GetBranchesLoop took 3 parameters: $branch and $onlymine. The first one was used to set a "selected" flag, for a display purpose: select an option in the libraries dropdown lists. The second one was useless: If not passed or set to 0, the `C4::Branch::onlymine` subroutine was called. This onlymine flag was use to know if the logged in user was able to see other libraries infos. A patron can see the infos from other libraries if IndependentBranches is not set OR if he has the superlibrarian permission. Prior to this patch set, the "onlymine test" was done on different places (neworderempty.pl, additem.pl, holidays.pl, etc.), including the Branches TT plugin. In this patch set, this test is only done on one place (C4::Context::only_my_library, code moved from C4::Branch::onlymine). To accomplish the same job as this subroutine, we just need to call the `Branches.all()` method from the `Branches` TT plugin. It already accepts a `selected` parameter to set a flag on the option to select. To avoid the repetitive [% IF selected %]<option selected="selected">[% ELSE %]<option>[% END %] pattern, a new `html_helpers` TT include file has been created, it defines an `options_for_libraries` block, which takes a `selected` parameter. We could imagine to use this include file for other selects. The 'mybranch` and `onlymine` subroutines of the C4::Branch package have been moved to C4::Context. onlymine has been renamed with only_my_library. There are only 4 occurrences of it, against 11 before this patch set. There 2 subroutines are Context-centric and it makes sense to put them in `C4::Context` (at least it's the least worst place!) GetBranches is the tricky part of this patch set: It retrieves all the libraries, independently of the value of IndependentBranches. To keep the same way as the existing calls of `Branches.all()`, I have added a `unfiltered` parameter. If set, the `Branches.all()` will call a usual Koha::Libraries->search method, otherwise Koha::Libraries->search_filtered will be called. This new method will check if the logged in user is allowed to see other libraries or only its library. Note that this `GetBranches` subroutine also created a `category` key: it allowed to get the list of groups (of libraries) where this library existed. Thanks to a previous patch set (bug 15295), this value was not used anymore (I may have missed something!). Note that the only use of `GetBranch` was buggy (see bug 15746). Test plan (for the whole patch set): The best way to test this whole patch set is to test with 2 instances: 1 with the patch set applied, 1 using master, to be sure there is no regression. It would be good to test the same with `IndependentBranches` and the without `IndependentBranches`. No difference should be found. The tester must focus on the library dropdowns on as many forms as possible. You will notice changes in the order of the options: the libraries will now be ordered by branchname (instead of branchcode in some places). A special attention will be given to the following page: - acqui/neworderempty.pl - catalogue/search.pl - members/members-home.pl (header?) - opac/opac-topissues.pl - tools/holidays.pl - admin/branch_transfer_limits.pl - admin/item_circulation_alerts.pl - rotating_collections/transferCollection.pl - suggestion/suggestion.pl - tools/export.pl Notes for QA: - There are 2 FIXMEs in the patch set, I have kept the existing behavior, but I am not sure it's the good one. Feel free to open a bug report and I will fill a patch if you think it's not correct. Otherwise, remove the FIXME lines in a follow-up patch. - The whole patch set is huge and makes a lot of changes. But it finally will tremendously reduce the number of lines: 716 insertions for 1910 deletions Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
760 lines
42 KiB
Text
760 lines
42 KiB
Text
[% USE KohaDates %]
|
||
[% USE Branches %]
|
||
[% USE Price %]
|
||
[% USE AuthorisedValues %]
|
||
|
||
[% INCLUDE 'doc-head-open.inc' %]
|
||
<title>Koha › Acquisitions › [% UNLESS ( basketno ) %]New [% END %]Basket [% basketname|html %] ([% basketno %]) for [% name|html %]</title>
|
||
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
|
||
[% INCLUDE 'doc-head-close.inc' %]
|
||
[% INCLUDE 'datatables.inc' %]
|
||
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat.js"></script>
|
||
<script type="text/javascript">
|
||
//<![CDATA[
|
||
function updateColumnsVisibility(visible) {
|
||
if ( visible ) {
|
||
$("table .gste, .gsti").show();
|
||
} else {
|
||
[% IF ( listincgst ) %]
|
||
$("table .gste").hide();
|
||
[% ELSE %]
|
||
$("table .gsti").hide();
|
||
[% END %]
|
||
}
|
||
}
|
||
|
||
$(document).ready(function() {
|
||
$('#toolbar').fixFloat();
|
||
$("#show_all_details").click(function(){
|
||
updateColumnsVisibility($(this).is(":checked"));
|
||
});
|
||
|
||
$("#show_all_details").prop('checked', false);
|
||
updateColumnsVisibility(false);
|
||
[% UNLESS ( closedate ) %]
|
||
$('#addtoBasket').on('show', function () {
|
||
$(this).find(".modal-body").html($(".acqui_basket_add")[0].outerHTML);
|
||
});
|
||
[% END %]
|
||
|
||
$("body").on("click", ".del_user", function(e){
|
||
e.preventDefault();
|
||
del_user( $(this).data("borrowernumber") );
|
||
});
|
||
|
||
$("#add_user").on("click",function(e){
|
||
e.preventDefault();
|
||
UserSearchPopup();
|
||
});
|
||
|
||
$(".transfer_order").on("click",function(e){
|
||
e.preventDefault();
|
||
transfer_order_popup( $(this).data("ordernumber"));
|
||
});
|
||
});
|
||
//]]>
|
||
</script>
|
||
|
||
[% UNLESS ( closedate ) %]
|
||
<script type="text/javascript">
|
||
//<![CDATA[
|
||
|
||
function transfer_order_popup(ordernumber) {
|
||
var url = "/cgi-bin/koha/acqui/transferorder.pl?"
|
||
+ "ordernumber=" + ordernumber
|
||
window.open(url, 'TransferOrder','width=600,height=400,toolbar=false,scrollbars=yes');
|
||
}
|
||
|
||
function confirm_ediorder() {
|
||
var is_confirmed = confirm(_("Are you sure you want to close this basket and generate an EDIFACT order?"));
|
||
if (is_confirmed) {
|
||
window.location = "/cgi-bin/koha/acqui/basket.pl?op=edi_confirm&basketno=[% basketno %]";
|
||
}
|
||
}
|
||
|
||
//]]>
|
||
</script>
|
||
[% ELSE %]
|
||
<script type="text/javascript">
|
||
//<![CDATA[
|
||
$(document).ready(function(){
|
||
$("#basketgroupid").change(function(){
|
||
if($(this).val() == "new"){
|
||
location.href="/cgi-bin/koha/acqui/basketgroup.pl?op=add&booksellerid=[% booksellerid %]";
|
||
}
|
||
});
|
||
});
|
||
//]]>
|
||
</script>
|
||
[% UNLESS ( grouped ) %]
|
||
<script type="text/javascript">
|
||
//<![CDATA[
|
||
function confirm_reopen() {
|
||
var skip = [% IF ( skip_confirm_reopen ) %] 1 [% ELSE %] 0 [% END %];
|
||
var is_confirmed = skip || confirm(_("Are you sure you want to reopen this basket?"));
|
||
if (is_confirmed) {
|
||
window.location = "/cgi-bin/koha/acqui/basket.pl?op=reopen&basketno=[% basketno %]";
|
||
}
|
||
}
|
||
//]]>
|
||
</script>
|
||
[% END %]
|
||
[% END %]
|
||
<script type="text/javascript">
|
||
//<![CDATA[
|
||
$(document).ready(function() {
|
||
var orderst = $("#orders").dataTable($.extend(true, {}, dataTablesDefaults, {
|
||
"sPaginationType": "four_button",
|
||
[% IF ( active ) %]
|
||
"aoColumnDefs": [
|
||
[% UNLESS ( closedate ) %]
|
||
{ "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
|
||
[% END %]
|
||
{ "sType": "anti-the", "aTargets": [ "anti-the" ] }
|
||
],
|
||
[% END %]
|
||
} ) );
|
||
var cancelledorderst = $("#cancelledorderst").dataTable($.extend(true, {}, dataTablesDefaults, {
|
||
"sPaginationType": "four_button"
|
||
} ) );
|
||
$("#reopenbutton").on("click",function(e){
|
||
e.preventDefault();
|
||
confirm_reopen();
|
||
});
|
||
});
|
||
|
||
function UserSearchPopup(f) {
|
||
window.open(
|
||
"/cgi-bin/koha/acqui/add_user_search.pl",
|
||
'UserSearchPopup',
|
||
'width=840, height=500, scrollbars=yes, toolbar=no,'
|
||
);
|
||
}
|
||
|
||
function add_user(borrowernumber, borrowername) {
|
||
var ids = $("#users_ids").val();
|
||
if(ids.length > 0) {
|
||
ids = ids.split(':');
|
||
} else {
|
||
ids = new Array;
|
||
}
|
||
if (ids.indexOf(borrowernumber) < 0) {
|
||
ids.push(borrowernumber);
|
||
$("#users_ids").val(ids.join(':'));
|
||
var li = '<li id="user_'+borrowernumber+'">'+borrowername
|
||
+ ' <a href="#" data-borrowernumber="'+borrowernumber+'" class="del_user"><i class="fa fa-trash"></i> '
|
||
+ _("Delete user") + '</a></li>';
|
||
$("#users_names").append(li);
|
||
return 0;
|
||
}
|
||
return -1;
|
||
}
|
||
|
||
function del_user(borrowernumber) {
|
||
$("#user_"+borrowernumber).remove();
|
||
var ids = $("#users_ids").val().split(':');
|
||
ids.splice(ids.indexOf(borrowernumber.toString()), 1);
|
||
$("#users_ids").val(ids.join(':'));
|
||
}
|
||
//]]>
|
||
</script>
|
||
<style type="text/css">
|
||
.sortmsg {font-size: 80%;}
|
||
</style>
|
||
</head>
|
||
<body id="acq_basket" class="acq">
|
||
[% INCLUDE 'header.inc' %]
|
||
[% INCLUDE 'acquisitions-search.inc' %]
|
||
|
||
|
||
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> › <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% name|html %]</a> › [% UNLESS ( basketno ) %]New [% END %]Basket [% basketname|html %] ([% basketno %]) for [% name|html %]</div>
|
||
|
||
<div id="doc3" class="yui-t2">
|
||
|
||
<div id="bd">
|
||
<div id="yui-main">
|
||
[% IF (cannot_manage_basket) %]
|
||
<div class="yui-b">
|
||
<p class="error">You are not authorised to manage this basket.</p>
|
||
</div>
|
||
[% ELSE %]
|
||
<div class="yui-b">
|
||
[% IF !confirm_close && !edi_confirm %]
|
||
[% UNLESS ( selectbasketg ) %]
|
||
[% UNLESS ( closedate ) %]
|
||
<div id="toolbar" class="btn-toolbar">
|
||
[% IF active %]
|
||
<div class="btn-group"><a href="#addtoBasket" role="button" class="btn btn-small" data-toggle="modal"><i class="fa fa-plus"></i> Add to basket</a></div>
|
||
[% END %]
|
||
<div class="btn-group"><a href="basketheader.pl?booksellerid=[% booksellerid %]&basketno=[% basketno %]&op=add_form" class="btn btn-small" id="basketheadbutton"><i class="fa fa-pencil"></i> Edit basket</a></div>
|
||
[%# FIXME This action should not be available for everyone %]
|
||
<div class="btn-group"><a href="#deleteBasketModal" role="button" class="btn btn-small" data-toggle="modal" id="delbasketbutton"><i class="fa fa-trash"></i> Delete this basket</a></div>
|
||
[% IF ( unclosable ) %]
|
||
[% ELSIF ( uncertainprices ) %]
|
||
<div class="btn-group"><a href="/cgi-bin/koha/acqui/uncertainprice.pl?booksellerid=[% booksellerid %]&owner=1" class="btn btn-small" id="uncertpricesbutton">Uncertain prices</a></div>
|
||
[% ELSE %]
|
||
<div class="btn-group">
|
||
<a href="/cgi-bin/koha/acqui/basket.pl?op=close&basketno=[% basketno %]&booksellerid=[% booksellerid %]" class="btn btn-small" id="closebutton"><i class="fa fa-times-circle"></i> Close this basket</a>
|
||
</div>
|
||
[% END %]
|
||
<div class="btn-group"><a href="/cgi-bin/koha/acqui/basket.pl?op=export&basketno=[% basketno %]&booksellerid=[% booksellerid %]" class="btn btn-small" id="exportbutton"><i class="fa fa-download"></i> Export this basket as CSV</a></div>
|
||
[% IF ediaccount %]
|
||
<div class="btn-group"><a href="/cgi-bin/koha/acqui/edi_ean.pl?op=ediorder&basketno=[% basketno %]&booksellerid=[% booksellerid %]" class="btn btn-small" id="ediorderbutton"><i class="fa fa-download"></i> Create EDIFACT order</a></div>
|
||
[% END %]
|
||
</div>
|
||
<!-- Modal for confirm deletion box-->
|
||
<div class="modal hide" id="deleteBasketModal" tabindex="-1" role="dialog" aria-labelledby="delbasketModalLabel" aria-hidden="true">
|
||
<div class="modal-header">
|
||
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
|
||
<h3>Confirm deletion</h3>
|
||
</div>
|
||
[% UNLESS book_foot_loop %]
|
||
<div class="modal-body">
|
||
<p>Are you sure you want to delete this basket?</p>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<button type="button" class="btn btn-primary" data-dismiss="modal">Cancel</button>
|
||
<form action="/cgi-bin/koha/acqui/basket.pl" method="get">
|
||
<input type="hidden" name="op" value="delete_confirm" />
|
||
<input type="hidden" name="basketno" value="[% basketno %]" />
|
||
<input type="hidden" name="booksellerid" value="[% booksellerid %]" />
|
||
<input type="hidden" name="delbiblio" value="0" />
|
||
<button type="submit" class="btn btn-default">Delete basket</button>
|
||
</form>
|
||
</div>
|
||
[% ELSE %]
|
||
<div class="modal-body">
|
||
<p>Are you sure you want to delete this basket?</p>
|
||
<p>Warning:</p>
|
||
<p>All orders of this basket will be cancelled and used funds will be refunded.</p>
|
||
<p>If items have been created when ordering or receiving, they will be deleted.</p>
|
||
<p>You can choose to delete bibliographic records if possible (bibliographic records that have other items or that are used in a subscription or another order will not be deleted).</p>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<button type="button" class="btn btn-primary" data-dismiss="modal">Cancel</button>
|
||
<form action="/cgi-bin/koha/acqui/basket.pl" method="get">
|
||
<input type="hidden" name="op" value="delete_confirm" />
|
||
<input type="hidden" name="basketno" value="[% basketno %]" />
|
||
<input type="hidden" name="booksellerid" value="[% booksellerid %]" />
|
||
<input type="hidden" name="delbiblio" value="0" />
|
||
<button type="submit" class="btn btn-default">Delete basket and orders</button>
|
||
</form>
|
||
|
||
<form action="/cgi-bin/koha/acqui/basket.pl" method="get">
|
||
<input type="hidden" name="op" value="delete_confirm" />
|
||
<input type="hidden" name="basketno" value="[% basketno %]" />
|
||
<input type="hidden" name="booksellerid" value="[% booksellerid %]" />
|
||
<input type="hidden" name="delbiblio" value="1" />
|
||
<button type="submit" class="btn btn-default">Delete basket, orders, and records</button>
|
||
</form>
|
||
|
||
</div>
|
||
[% END %]
|
||
</div>
|
||
<!-- End of Modal-->
|
||
[% ELSE %]
|
||
[% UNLESS ( grouped ) %]
|
||
<div id="toolbar" class="btn-toolbar">
|
||
<div class="btn-group"><a href="#" class="btn btn-small" id="reopenbutton"><i class="fa fa-refresh"></i> Reopen this basket</a></div>
|
||
<div class="btn-group"><a href="/cgi-bin/koha/acqui/basket.pl?op=export&basketno=[% basketno %]&booksellerid=[% booksellerid %]" class="btn btn-small" id="exportbutton"><i class="fa fa-download"></i> Export this basket as CSV</a></div>
|
||
</div>
|
||
[% END %]
|
||
[% END %]
|
||
[% END %]
|
||
|
||
[% IF ( NO_BOOKSELLER ) %]
|
||
<h2>Vendor not found</h2>
|
||
[% ELSE %]
|
||
[% IF ( delete_confirmed ) %]
|
||
<div class="dialog message">
|
||
<h3>Basket deleted</h3>
|
||
</div>
|
||
[% IF (cannotdelbiblios) %]
|
||
<div class="dialog alert">
|
||
<p><strong>Warning:</strong></p>
|
||
<p><strong>The following records could not be deleted:</strong></p>
|
||
<ul>
|
||
[% FOREACH cannotdelbiblio IN cannotdelbiblios %]
|
||
<li><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% cannotdelbiblio.biblionumber %]">[% cannotdelbiblio.title |html %]</a> by [% cannotdelbiblio.author %]:
|
||
<ul>
|
||
[% IF (cannotdelbiblio.itemcount) %]<li>[% cannotdelbiblio.itemcount %] item(s) attached.</li>[% END %]
|
||
[% IF (cannotdelbiblio.subscriptions) %]<li>[% cannotdelbiblio.subscriptions %] subscription(s) attached.</li>[% END %]
|
||
[% IF (cannotdelbiblio.countbiblio) %]<li>[% cannotdelbiblio.countbiblio %] order(s) attached.</li>[% END %]
|
||
[% IF (cannotdelbiblio.othererror) %]<li>Unknown error.</li>[% END %]
|
||
</ul>
|
||
</li>
|
||
[% END %]
|
||
</ul>
|
||
</div>
|
||
<a href="booksellers.pl">Click here to go back to booksellers page</a>
|
||
[% ELSE %]
|
||
<META HTTP-EQUIV=Refresh CONTENT="0; url=booksellers.pl">
|
||
[% END %]
|
||
[% ELSE %]
|
||
<h1>[% UNLESS ( basketno ) %]New [% END %]Basket [% basketname|html %] ([% basketno %]) for <a href="supplier.pl?booksellerid=[% booksellerid %]">[% name|html %]</a></h1>
|
||
[% IF ( basketno ) %]
|
||
<div id="acqui_basket_summary" class="yui-g">
|
||
<div class="rows">
|
||
<div class="yui-u first">
|
||
<ol>
|
||
[% IF ( basketnote ) %]<li><span class="label">Internal note:</span> [% basketnote %]</li>[% END %]
|
||
[% IF ( basketbooksellernote ) %]<li><span class="label">Vendor note:</span> [% basketbooksellernote %]</li>[% END %]
|
||
[% IF ( basketcontractno ) %]
|
||
<li><span class="label">Contract name:</span> <a href="../admin/aqcontract.pl?op=add_form&contractnumber=[% basketcontractno %]&booksellerid=[% booksellerid %]">[% basketcontractname %]</a></li>
|
||
[% END %]
|
||
[% IF deliveryplace %]<li><span class="label">Delivery place:</span> [% Branches.GetName( deliveryplace ) %]</li>[% END %]
|
||
[% IF billingplace %]<li><span class="label">Billing place:</span> [% Branches.GetName( billingplace ) %]</li>[% END %]
|
||
[% IF ( authorisedbyname ) %]<li><span class="label">Created by:</span> [% authorisedbyname %]</li>[% END %]
|
||
<li id="managedby">
|
||
<form action="" method="post">
|
||
<span class="label">Managed by:</span>
|
||
<div style="float:left">
|
||
<ul id="users_names" style="padding-left:0">
|
||
[% FOREACH user IN users %]
|
||
<li id="user_[% user.borrowernumber %]">
|
||
[% user.firstname %] [% user.surname %]
|
||
<a href="#" data-borrowernumber="[% user.borrowernumber %]" class="del_user"><i class="fa fa-trash"></i> Delete user</a>
|
||
</li>
|
||
[% END %]
|
||
</ul>
|
||
<input type="hidden" id="basketno" name="basketno" value="[% basketno %]" />
|
||
<input type="hidden" id="users_ids" name="users_ids" value="[% users_ids %]" />
|
||
<input type="hidden" id="op" name="op" value="mod_users" />
|
||
<input type="button" id="add_user" value="Add user" />
|
||
<input type="submit" value="Save changes" />
|
||
</div>
|
||
</form>
|
||
</li>
|
||
<li id="branch">
|
||
<span class="label">Library:</span>
|
||
[% IF basketbranchcode %]
|
||
[% Branches.GetName( basketbranchcode ) %]
|
||
[% ELSE %]
|
||
No library
|
||
[% END %]
|
||
[% IF branches_loop.size %]
|
||
<form action="" method="post">
|
||
<select id="branch" name="branch">
|
||
<option value="">(no library)</option>
|
||
[% FOREACH branch IN branches_loop %]
|
||
[% IF (branch.selected) %]
|
||
<option selected="selected" value="[% branch.branchcode %]"> [% branch.branchname %]</option>
|
||
[% ELSE %]
|
||
<option value="[% branch.branchcode %]"> [% branch.branchname %]</option>
|
||
[% END %]
|
||
[% END %]
|
||
</select>
|
||
<input type="hidden" id="basketno" name="basketno" value="[% basketno %]" />
|
||
<input type="hidden" id="op" name="op" value="mod_branch" />
|
||
<input type="submit" value="Change" />
|
||
</form>
|
||
[% END %]
|
||
</li>
|
||
[% IF ( creationdate ) %]<li><span class="label">Opened on:</span> [% creationdate | $KohaDates %]</li>[% END %]
|
||
[% IF ( closedate ) %]<li><span class="label">Closed on:</span> [% closedate | $KohaDates %]</li>[% END %]
|
||
[% IF ( estimateddeliverydate ) %]<li><span class="label">Estimated delivery date:</span> [% estimateddeliverydate | $KohaDates %]</li>[% END %]
|
||
[% IF ( estimateddeliverydate ) %]<li><span class="label">Estimated delivery date:</span> [% estimateddeliverydate | $KohaDates %]</li>[% END %]
|
||
<li><span class="label">Orders are standing:</span> [% IF is_standing %]Yes[% ELSE %]No[% END %]</li>
|
||
|
||
|
||
</ol>
|
||
</div>
|
||
[% IF ( closedate ) %]
|
||
<div class="yui-u">
|
||
[% IF ( CAN_user_acquisition_group_manage ) %]
|
||
<form action="/cgi-bin/koha/acqui/basketgroup.pl" method="post">
|
||
[% END %]
|
||
<ol>
|
||
<li>
|
||
<span class="label">Basket group:</span>
|
||
[% IF basketgroup.id and not basketgroup.name %]
|
||
[% SET basketgroup.name = "Basket group no. " _ basketgroup.id %]
|
||
[% END %]
|
||
[% IF basketgroup.closed %]
|
||
[% IF ( CAN_user_acquisition_group_manage ) %]
|
||
<a href="basketgroup.pl?op=add&booksellerid=[% booksellerid %]&basketgroupid=[% basketgroup.id %]" title="basketgroup">[% basketgroup.name %] (closed)</a>
|
||
[% ELSE %]
|
||
[% basketgroup.name %] (closed)
|
||
[% END %]
|
||
[% ELSIF ( ! CAN_user_acquisition_group_manage ) %]
|
||
[%- IF basketgroup.id -%]
|
||
[% basketgroup.name %]
|
||
[%- ELSE -%]
|
||
No group
|
||
[%- END -%]
|
||
[% ELSE %]
|
||
<select id="basketgroupid" name="basketgroupid">
|
||
<option value="">No group</option>
|
||
[% FOREACH bg IN basketgroups %]
|
||
[% IF ( bg.default ) %]
|
||
<option value="[% bg.id %]" selected="selected">[% bg.name %]</option>
|
||
[% ELSE %]
|
||
[% UNLESS bg.closed %]
|
||
<option value="[% bg.id %]">[% bg.name %]</option>
|
||
[% ELSE %]
|
||
<option value="[% bg.id %]" disabled="disabled">[% bg.name %] (closed)</option>
|
||
[% END %]
|
||
[% END %]
|
||
[% END %]
|
||
<option value="new">Add new group</option>
|
||
</select>
|
||
<input type="hidden" id="basketno" value="[% basketno %]" name="basketno" />
|
||
<input type="hidden" value="mod_basket" name="op" />
|
||
<input type="hidden" name="booksellerid" value="[% booksellerid %]" />
|
||
<input type="submit" value="Change basket group" />
|
||
[% END %]
|
||
</li>
|
||
[% IF basketgroup.deliveryplace %]<li><span class="label">Basket group delivery placename:</span> [% Branches.GetName( basketgroup.deliveryplace ) %]</li>[% END %]
|
||
[% IF basketgroup.billingplace %]<li><span class="label">Basket group billing place:</span> [% Branches.GetName( basketgroup.billingplace ) %]</li>[% END %]
|
||
</ol>
|
||
[% IF ( CAN_user_acquisition_group_manage ) %]
|
||
</form>
|
||
[% END %]
|
||
</div>
|
||
[% END %]
|
||
</div>
|
||
</div>
|
||
[% END %]
|
||
[% IF ( duplinbatch ) %]<div class="dialog alert">
|
||
<h4>Duplicate warning</h4>
|
||
<p>Some records have not been automatically added because they match an existing record in your catalog:<a href="/cgi-bin/koha/acqui/addorderiso2709.pl?import_batch_id=[% duplinbatch %]&basketno=[% basketno %]&booksellerid=[% booksellerid %]" title="Open in new window" target="_blank" class="popup" style="margin-left:10px">Display them</a></p>
|
||
</div>[% END %]
|
||
|
||
<div id="acqui_basket_content" class="yui-g">
|
||
[% IF ( books_loop ) %]
|
||
<h2>Orders</h2>
|
||
<label for="show_all_details">
|
||
<input type="checkbox" style="vertical-align: middle;" id="show_all_details" />
|
||
Show all details
|
||
</label>
|
||
<table id="orders">
|
||
<thead>
|
||
<tr>
|
||
<th>No.</th>
|
||
<th class="anti-the">Order</th>
|
||
<th class="gste">RRP tax exc.</th>
|
||
<th class="gste">ecost tax exc.</th>
|
||
<th class="gsti">RRP tax inc.</th>
|
||
<th class="gsti">ecost tax inc.</th>
|
||
<th>Qty.</th>
|
||
<th class="gste">Total tax exc. ([% currency %])</th>
|
||
<th class="gsti">Total tax inc. ([% currency %])</th>
|
||
<th>GST %</th>
|
||
<th>GST</th>
|
||
<th>Fund</th>
|
||
<th>Supplier report</th>
|
||
[% IF ( active ) %]
|
||
[% UNLESS ( closedate ) %]
|
||
<th>Modify</th>
|
||
<th>Cancel order</th>
|
||
[% END %]
|
||
[% END %]
|
||
</tr>
|
||
</thead>
|
||
<tfoot>
|
||
[% FOREACH foot_loo IN book_foot_loop %]
|
||
<tr>
|
||
<th></th>
|
||
<th>Total (GST [% foot_loo.gstrate * 100 | $Price %])</th>
|
||
<th class="gste"> </th>
|
||
<th class="gste"> </th>
|
||
<th class="gsti"> </th>
|
||
<th class="gsti"> </th>
|
||
<th>[% foot_loo.quantity %]</th>
|
||
<th class="gste">[% foot_loo.totalgste | $Price%]</th>
|
||
<th class="gsti">[% foot_loo.totalgsti | $Price %]</th>
|
||
<th> </th>
|
||
<th>[% foot_loo.gstvalue | $Price %]</th>
|
||
<th> </th>
|
||
<th> </th>
|
||
[% IF ( active ) %]
|
||
[% UNLESS ( closedate ) %]
|
||
<th> </th>
|
||
<th> </th>
|
||
[% END %]
|
||
[% END %]
|
||
</tr>
|
||
[% END %]
|
||
<tr>
|
||
<th></th>
|
||
<th>Total ([% currency %])</th>
|
||
<th class="gste"> </th>
|
||
<th class="gste"> </th>
|
||
<th class="gsti"> </th>
|
||
<th class="gsti"> </th>
|
||
<th>[% total_quantity %]</th>
|
||
<th class="gste">[% total_gste | $Price %]</th>
|
||
<th class="gsti">[% total_gsti | $Price %]</th>
|
||
<th> </th>
|
||
<th>[% total_gstvalue | $Price %]</th>
|
||
<th> </th>
|
||
<th> </th>
|
||
[% IF ( active ) %]
|
||
[% UNLESS ( closedate ) %]
|
||
<th> </th>
|
||
<th> </th>
|
||
[% END %]
|
||
[% END %]
|
||
</tr>
|
||
</tfoot>
|
||
<tbody>
|
||
[% FOREACH books_loo IN books_loop %]
|
||
[% IF ( books_loo.order_received ) %]
|
||
<tr class="disabled">
|
||
[% ELSE %]
|
||
<tr>
|
||
[% END %]
|
||
<td>
|
||
[% books_loo.ordernumber %]
|
||
</td>
|
||
<td>
|
||
<p>
|
||
[% IF ( books_loo.order_received ) %] (rcvd)[% END %]
|
||
[% IF books_loo.title %]
|
||
<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% books_loo.biblionumber %]">[% books_loo.title |html %]</a>[% IF books_loo.author %] by [% books_loo.author %][% END %]
|
||
[% ELSE %]
|
||
<em>Deleted bibliographic record, can't find title</em><br />
|
||
[% END %]
|
||
<br />
|
||
[% IF ( books_loo.isbn ) %] - [% books_loo.isbn %][% END %]
|
||
[% IF ( books_loo.issn ) %] - [% books_loo.issn %][% END %]
|
||
[% IF ( books_loo.publishercode ) %], [% books_loo.publishercode %][% END %]
|
||
[% IF ( books_loo.publicationyear ) %], [% books_loo.publicationyear %][% END %]
|
||
[% IF ( books_loo.editionstatement ) %], [% books_loo.editionstatement %][% END %]
|
||
[% IF ( books_loo.suggestionid ) %]
|
||
<br/>
|
||
Suggested by: [% books_loo.surnamesuggestedby %][% IF ( books_loo.firstnamesuggestedby ) %], [% books_loo.firstnamesuggestedby %] [% END %]
|
||
(<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% books_loo.suggestionid %]&op=show">suggestion #[% books_loo.suggestionid %]</a>)
|
||
[% END %]
|
||
</p>
|
||
[% IF ( books_loo.order_internalnote ) %]
|
||
<p class="ordernote"><strong>Internal note: </strong>[% books_loo.order_internalnote|html %] [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% books_loo.ordernumber %]&type=internal">Change internal note</a>]</p>
|
||
[% ELSE %]
|
||
[<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% books_loo.ordernumber %]&type=internal">Add internal note</a>]
|
||
[% END %]
|
||
[% IF ( books_loo.order_vendornote ) %]
|
||
<p class="ordernote"><strong>Vendor note: </strong>[% books_loo.order_vendornote|html %] [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% books_loo.ordernumber %]&type=vendor">Change vendor note</a>]</p>
|
||
[% ELSE %]
|
||
[<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% books_loo.ordernumber %]&type=vendor">Add vendor note</a>]
|
||
[% END %]
|
||
[% IF (books_loo.transferred_from) %]
|
||
[% basket = books_loo.transferred_from.basket %]
|
||
[% bookseller = books_loo.transferred_from.bookseller %]
|
||
[% timestamp = books_loo.transferred_from.timestamp %]
|
||
<p>Transferred from basket:
|
||
<a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno %]"> [% basket.basketname %]</a>
|
||
(<a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% bookseller.id %]">[% bookseller.name %]</a>)
|
||
on <span title="[% timestamp | $KohaDates with_hours = 1 %]">
|
||
[% timestamp | $KohaDates %]
|
||
</span>
|
||
</p>
|
||
[% END %]
|
||
</td>
|
||
[% SET zero_regex = "^0{1,}\.?0{1,}[^1-9]" %] [%# 0 or 0.0 or 0.00 or 00 or 00.0 or 00.00 or 0.000 ... %]
|
||
[%# FIXME: use of a regexp is not ideal; bugs 9410 and 10929 suggest better way of handling this %]
|
||
<td class="number gste [% IF books_loo.rrpgste.search(zero_regex) %]error[% END %]">[% books_loo.rrpgste | $Price %]</td>
|
||
<td class="number gste [% IF books_loo.ecostgste.search(zero_regex) %]error[% END %]">[% books_loo.ecostgste | $Price%]</td>
|
||
<td class="number gsti [% IF books_loo.rrpgsti.search(zero_regex) %]error[% END %]">[% books_loo.rrpgsti | $Price %]</td>
|
||
<td class="number gsti [% IF books_loo.ecostgsti.search(zero_regex) %]error[% END %]">[% books_loo.ecostgsti | $Price %]</td>
|
||
<td class="number [% IF books_loo.quantity.search(zero_regex) %]error[% END %]">[% books_loo.quantity %]</td>
|
||
<td class="number gste [% IF books_loo.totalgste.search(zero_regex) %]error[% END %]">[% books_loo.totalgste | $Price %]</td>
|
||
<td class="number gsti [% IF books_loo.totalgsti.search(zero_regex) %]error[% END %]">[% books_loo.totalgsti | $Price %]</td>
|
||
<td class="number">[% books_loo.gstrate * 100 | $Price %]</td>
|
||
<td class="number [% IF books_loo.gstvalue.search(zero_regex) %]error[% END %]">[% books_loo.gstvalue | $Price %]</td>
|
||
<td>[% books_loo.budget_name %]</td>
|
||
<td>[% books_loo.suppliers_report %]</td>
|
||
[% IF ( active ) %]
|
||
[% UNLESS ( closedate ) %]
|
||
<td>
|
||
<a href="neworderempty.pl?ordernumber=[% books_loo.ordernumber %]&booksellerid=[% booksellerid %]&basketno=[% basketno %]">Modify</a>
|
||
[% UNLESS (books_loo.order_received) %]
|
||
<br />
|
||
<a href="#" class="transfer_order" data-ordernumber="[% books_loo.ordernumber %]">Transfer</a>
|
||
[% END %]
|
||
</td>
|
||
<td>
|
||
[% IF ( books_loo.left_holds_on_order ) %]
|
||
<span class="button" title="Can't cancel order, ([% books_loo.holds_on_order %]) holds are linked with this order cancel holds first">Can't cancel order</span><br>
|
||
[% ELSE %]
|
||
<a href="/cgi-bin/koha/acqui/cancelorder.pl?ordernumber=[% books_loo.ordernumber %]&biblionumber=[% books_loo.biblionumber %]&referrer=/cgi-bin/koha/acqui/basket.pl%3Fbasketno=[% basketno %]" class="button">Cancel order</a><br>
|
||
[% END %]
|
||
[% IF ( books_loo.can_del_bib ) %]
|
||
<a href="/cgi-bin/koha/acqui/cancelorder.pl?ordernumber=[% books_loo.ordernumber %]&biblionumber=[% books_loo.biblionumber %]&del_biblio=1&referrer=/cgi-bin/koha/acqui/basket.pl%3Fbasketno=[% basketno %]" class="button">Cancel order and delete catalog record</a><br>
|
||
[% ELSE %]
|
||
<span class="button" title="Can't delete catalog record, see constraints below">Can't cancel order and delete catalog record</span><br>
|
||
[% END %]
|
||
[% IF ( books_loo.left_item ) %]
|
||
<b title="Can't delete catalog record, because of [% books_loo.items %] existing hold(s)" >[% books_loo.items %] item(s) left</b><br>
|
||
[% END %]
|
||
[% IF ( books_loo.left_biblio ) %]
|
||
<b title="Can't delete catalog record, delete other orders linked to it first">[% books_loo.biblios %] order(s) left</b><br>
|
||
[% END %]
|
||
[% IF ( books_loo.left_subscription ) %]
|
||
<b title="Can't delete catalog record, delete subscriptions first">[% books_loo.subscriptions %] subscription(s) left</b><br>
|
||
[% END %]
|
||
[% IF ( books_loo.left_holds ) %]
|
||
<b title="Can't delete catalog record or order, cancel holds first">[% books_loo.holds %] hold(s) left</b>
|
||
[% END %]
|
||
</td>
|
||
[% END %]
|
||
[% END %]
|
||
</tr>
|
||
[% END %]
|
||
</tbody>
|
||
</table>
|
||
[% END %]
|
||
[% IF ( listincgst ) %]<small class="highlight">** Vendor's listings already include tax.</small>
|
||
[% END %]
|
||
</div>
|
||
[% IF (cancelledorders_loop) %]
|
||
<div id="cancelledorders">
|
||
<h2>Cancelled orders</h2>
|
||
<table id="cancelledorderst">
|
||
<thead>
|
||
<tr>
|
||
<th>No.</th>
|
||
<th>Order</th>
|
||
<th class="gste">RRP tax exc.</th>
|
||
<th class="gste">ecost tax exc.</th>
|
||
<th class="gsti">RRP tax inc.</th>
|
||
<th class="gsti">ecost tax inc.</th>
|
||
<th>Qty.</th>
|
||
<th class="gste">Total tax exc. ([% currency %])</th>
|
||
<th class="gsti">Total tax inc. ([% currency %])</th>
|
||
<th>GST %</th>
|
||
<th>GST</th>
|
||
<th>Fund</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
[% FOREACH order IN cancelledorders_loop %]
|
||
<tr style="color:grey">
|
||
<td>
|
||
[% order.ordernumber %]
|
||
</td>
|
||
<td>
|
||
<p>
|
||
[% IF ( order.order_received ) %] (rcvd)[% END %]
|
||
[% IF (order.title) %]
|
||
[% order.title |html %][% IF order.author %] by [% order.author %][% END %]
|
||
[% ELSE %]
|
||
<em>Deleted bibliographic record, can't find title</em>
|
||
[% END %]
|
||
<br />
|
||
[% IF ( order.order_internalnote ) %] [% order.order_internalnote %][% END %]
|
||
[% IF ( order.isbn ) %] - [% order.isbn %][% END %]
|
||
[% IF ( order.issn ) %] - [% order.issn %][% END %]
|
||
[% IF ( order.publishercode ) %], [% order.publishercode %][% END %]
|
||
[% IF ( order.publicationyear ) %], [% order.publicationyear %][% END %]
|
||
[% IF ( books_loo.editionstatement ) %], [% books_loo.editionstatement %][% END %]
|
||
[% IF ( order.cancellationreason ) %]
|
||
<br />
|
||
Cancellation reason: [% AuthorisedValues.GetByCode( 'ORDER_CANCELLATION_REASON', order.cancellationreason ) %]
|
||
[% END %]
|
||
</p>
|
||
[% IF order.transferred_to %]
|
||
[% basket = order.transferred_to.basket %]
|
||
[% bookseller = order.transferred_to.bookseller %]
|
||
[% timestamp = order.transferred_to.timestamp %]
|
||
<p>Transferred to basket:
|
||
<a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno %]"> [% basket.basketname %]</a>
|
||
(<a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% bookseller.id %]">[% bookseller.name %]</a>)
|
||
on <span title="[% timestamp | $KohaDates with_hours = 1%]">
|
||
[% timestamp | $KohaDates %]
|
||
</span>
|
||
</p>
|
||
[% END %]
|
||
</td>
|
||
<td class="number gste">[% order.rrpgste | $Price %]</td>
|
||
<td class="number gste">[% order.ecostgste | $Price %]</td>
|
||
<td class="number gsti">[% order.rrpgsti | $Price %]</td>
|
||
<td class="number gsti">[% order.ecostgsti | $Price %]</td>
|
||
<td class="number">[% order.quantity %]</td>
|
||
<td class="number gste">[% order.totalgste | $Price %]</td>
|
||
<td class="number gsti">[% order.totalgsti | $Price %]</td>
|
||
<td class="number">[% order.gstrate * 100 | $Price %]</td>
|
||
<td class="number">[% order.gstvalue | $Price %]</td>
|
||
<td>[% order.budget_name %]
|
||
</tr>
|
||
[% END %]
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
[% END %]
|
||
<br />
|
||
[% UNLESS ( closedate ) %]
|
||
|
||
<!-- Modal -->
|
||
<div id="addtoBasket" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="addtoBasketLabel" aria-hidden="true">
|
||
<div class="modal-body">
|
||
[% IF active %]
|
||
[% INCLUDE 'acquisitions-add-to-basket.inc' %]
|
||
[% END %]
|
||
</div>
|
||
<div class="modal-footer">
|
||
<a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a>
|
||
</div>
|
||
</div>
|
||
|
||
[% END %]
|
||
|
||
[% END %]
|
||
[% END %] [% ELSE %] <!-- if we want just to select a basketgroup for a closed basket -->
|
||
[% END %]
|
||
[% IF ( confirm_close ) %]
|
||
<div id="closebasket_needsconfirmation" class="dialog alert">
|
||
|
||
<form action="/cgi-bin/koha/acqui/basket.pl">
|
||
<h1>Are you sure you want to close basket [% basketname|html %]?</h1>
|
||
[% IF ( CAN_user_acquisition_group_manage ) %]
|
||
<p>
|
||
<label for="createbasketgroup">Attach this basket to a new basket group with the same name</label>
|
||
<input type="checkbox" id="createbasketgroup" name="createbasketgroup"/>
|
||
</p>
|
||
[% END %]
|
||
<input type="hidden" id="basketno" value="[% basketno %]" name="basketno" />
|
||
<input type="hidden" value="close" name="op" />
|
||
<input type="hidden" name="booksellerid" value="[% booksellerid %]" />
|
||
<input type="hidden" name="confirm" value="1" />
|
||
<input type="hidden" name="basketgroupname" value="[% basketgroupname %]" />
|
||
<button type="submit" class="approve" accesskey="y"><i class="fa fa-fw fa-check"></i> Yes, close (Y)</button>
|
||
</form>
|
||
<form action="/cgi-bin/koha/acqui/basket.pl" method="get">
|
||
<input type="hidden" name="basketno" value="[% basketno %]" />
|
||
<button type="submit" class="deny" accesskey="n"><i class="fa fa-fw fa-remove"></i> No, don't close (N)</button>
|
||
</form>
|
||
</div>
|
||
[% END %]
|
||
[% IF edi_confirm %]
|
||
<div id="closebasket_needsconfirmation" class="dialog alert">
|
||
|
||
<form action="/cgi-bin/koha/acqui/basket.pl">
|
||
<h1>Are you sure you want to generate an EDIFACT order and close basket [% basketname|html %]?</h1>
|
||
[% IF CAN_user_acquisition_group_manage %]
|
||
<p>
|
||
<label for="createbasketgroup">Attach this basket to a new basket group with the same name</label>
|
||
<input type="checkbox" id="createbasketgroup" name="createbasketgroup"/>
|
||
</p>
|
||
[% END %]
|
||
<input type="hidden" id="basketno" value="[% basketno %]" name="basketno" />
|
||
<input type="hidden" value="ediorder" name="op" />
|
||
<input type="hidden" name="ean" value="[% ean %]" />
|
||
<input type="hidden" name="booksellerid" value="[% booksellerid %]" />
|
||
<input type="hidden" name="confirm" value="1" />
|
||
<input type="hidden" name="basketgroupname" value="[% basketgroupname %]" />
|
||
<button type="submit" class="approve" accesskey="Y"><i class="fa fa-fw fa-check"></i> Yes, close (Y)</button>
|
||
</form>
|
||
<form action="/cgi-bin/koha/acqui/basket.pl" method="get">
|
||
<input type="hidden" name="basketno" value="[% basketno %]" />
|
||
<button type="submit" class="deny" accesskey="N"><i class="fa fa-fw fa-remove"></i> No, don't close (N)</button>
|
||
</form>
|
||
</div>
|
||
[% END %]
|
||
</div>
|
||
[% END %][%# IF (cannot_manage_basket) %]
|
||
</div>
|
||
<div class="yui-b">
|
||
[% INCLUDE 'acquisitions-menu.inc' %]
|
||
</div>
|
||
</div>
|
||
[% INCLUDE 'intranet-bottom.inc' %]
|