Victor Grousset/tuxayo
7758a0248e
And a few minor fixes when they where causing issues for translatability. And rephrased a string about password reset to have it identical to other strings with the same meaning. Simplified via wrapping strings with <span> to split to huge concatenated strings with a lot of %s everywhere. == Test plan == This patch needs mainly proof reading. Still it's possible to do some basic testing to demonstrate that adding a <span> in an IF doesn't break anything. Pick in one of the 110 modified templates a string that you know how to display. Otherwise: 1. acquisitions => vendor => basket => add to basket => search "from existing record" => add order 2. Cancel the order 3. You see without issue "Bibliographic record will not be deleted" 4. administration => Patron categories 5. Try to delete a used and unused category 6. You see as expected Category XXXX is in use. Deletion not possible! and Confirm deletion of category XXXX Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
431 lines
30 KiB
Text
431 lines
30 KiB
Text
[% USE raw %]
|
|
[% USE Asset %]
|
|
[% USE Branches %]
|
|
[% USE Price %]
|
|
[% INCLUDE 'doc-head-open.inc' %]
|
|
<title>Basket grouping for [% booksellername | html %] › Koha</title>
|
|
[% INCLUDE 'doc-head-close.inc' %]
|
|
[% INCLUDE 'datatables.inc' %]
|
|
<script>
|
|
|
|
var MSG_CONFIRM_CLOSE_BASKETGROUP = _("Are you sure you want to close this basketgroup?");
|
|
var MSG_CLOSE_EMPTY_BASKET = _("Why close an empty basket?");
|
|
var MSG_SAVE_BEFORE_PRINTING = _("You need to save the page before printing");
|
|
var MSG_REOPEN_BASKETGROUP = _("reopen basketgroup");
|
|
var MSG_FILE_DOWNLOAD_ERROR = _("Error downloading the file");
|
|
|
|
function submitForm(form) {
|
|
if (form.close.checked == true) {
|
|
var input = document.createElement("input");
|
|
input.setAttribute("type", "hidden");
|
|
input.setAttribute("name", "closed");
|
|
input.setAttribute("value", "1");
|
|
form.appendChild(input);
|
|
}
|
|
}
|
|
|
|
$(document).ready(function() {
|
|
[% IF ( listclosed) %]
|
|
$("#basket_groups a[href='#closed']").tab("show");
|
|
[% ELSE %]
|
|
$("#basket_groups a[href='#opened']").tab("show");
|
|
[% END %]
|
|
[% UNLESS ( grouping ) %]
|
|
$("table").dataTable($.extend(true, {}, dataTablesDefaults, {
|
|
"aoColumnDefs": [
|
|
{ "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
|
|
],
|
|
"bAutoWidth": false,
|
|
"sPaginationType": "full"
|
|
} ));
|
|
[% ELSE %]
|
|
grouped = $("#grouped").DataTable($.extend(true, {}, dataTablesDefaults, {
|
|
"dom": 't',
|
|
"columnDefs": [
|
|
{ 'sortable': false, 'targets': [ 'NoSort' ] }
|
|
],
|
|
'autoWidth': false,
|
|
"language": {
|
|
"emptyTable": _("There are no baskets in this group")
|
|
}
|
|
} ));
|
|
ungrouped = $("#ungrouped").DataTable($.extend(true, {}, dataTablesDefaults, {
|
|
"dom": 't',
|
|
"columnDefs": [
|
|
{ 'sortable': false, 'targets': [ 'NoSort' ] }
|
|
],
|
|
'autoWidth': false,
|
|
"language": {
|
|
"emptyTable": _("There are no ungrouped baskets")
|
|
}
|
|
} ));
|
|
[% END %]
|
|
|
|
$("#basketgroupcolumns").on("click", ".addtogroup", function(){
|
|
const row = $("#" + $(this).data("basketid") );
|
|
if( row ){
|
|
$(this).removeClass("addtogroup").addClass("removefromgroup").html("<i class=\"fa fa-trash\" aria-hidden=\"true\"></i> " + _("Remove") );
|
|
row.removeClass("ungrouped").addClass("grouped");
|
|
ungrouped.row( row ).remove().draw();
|
|
grouped.row.add( row ).draw();
|
|
}
|
|
});
|
|
|
|
$("#basketgroupcolumns").on("click", ".removefromgroup", function(){
|
|
const row = $("#" + $(this).data("basketid") );
|
|
if( row ){
|
|
$(this).removeClass("removefromgroup").addClass("addtogroup").html("<i class=\"fa fa-plus\" aria-hidden=\"true\"></i> " + _("Add to group") );
|
|
$(this).removeClass("").addClass("");
|
|
row.removeClass("grouped").addClass("ungrouped");
|
|
grouped.row( row ).remove().draw();
|
|
ungrouped.row.add( row ).draw();
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
|
|
</head>
|
|
<body id="acq_basketgroup" class="acq">
|
|
[% INCLUDE 'header.inc' %]
|
|
[% INCLUDE 'acquisitions-search.inc' %]
|
|
|
|
<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
|
|
<ol>
|
|
<li>
|
|
<a href="/cgi-bin/koha/mainpage.pl">Home</a>
|
|
</li>
|
|
<li>
|
|
<a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
|
|
</li>
|
|
|
|
[% IF ( grouping ) %]
|
|
<li>
|
|
<a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a>
|
|
</li>
|
|
<li>
|
|
<a href="/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=[% booksellerid | uri %]">Basket grouping</a>
|
|
</li>
|
|
<li>
|
|
<a href="#" aria-current="page">
|
|
Add basket group for [% booksellername | html %]
|
|
</a>
|
|
</li>
|
|
</ol>
|
|
</nav>
|
|
|
|
[% ELSE %]
|
|
<li>
|
|
<a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a>
|
|
</li>
|
|
<li>
|
|
<a href="#" aria-current="page">
|
|
Basket grouping
|
|
</a>
|
|
</li>
|
|
</ol>
|
|
</nav>
|
|
[% END %]
|
|
|
|
|
|
<div class="main container-fluid">
|
|
<div class="row">
|
|
<div class="col-sm-10 col-sm-push-2">
|
|
<main>
|
|
|
|
[% IF ( grouping ) %]
|
|
[% IF (closedbg) %]
|
|
<div id="toolbar" class="btn-toolbar">
|
|
<div class="btn-group"><a href="[% script_name | url %]?op=reopen&basketgroupid=[% basketgroupid | uri %]&booksellerid=[% booksellerid | uri %]&mode=singlebg" class="btn btn-default" id="reopenbutton"><i class="fa fa-download"></i> Reopen basket group</a></div>
|
|
<div class="btn-group"><a href="[% script_name | url %]?op=export&basketgroupid=[% basketgroupid | uri %]&booksellerid=[% booksellerid | uri %]" class="btn btn-default" id="exportbutton"><i class="fa fa-download"></i> Export basket group as CSV</a></div>
|
|
<div class="btn-group"><a href="[% script_name | url %]?op=print&basketgroupid=[% basketgroupid | uri %]&booksellerid=[% booksellerid | uri %]" class="btn btn-default" id="printbutton"><i class="fa fa-download"></i> Print basket group in PDF</a></div>
|
|
[% IF (ediaccount) %]
|
|
<div class="btn-group"><a href="[% script_name | url %]?op=ediprint&basketgroupid=[% basketgroupid | uri %]&booksellerid=[% booksellerid | uri %]" class="btn btn-default" id="printbutton"><i class="fa fa-download"></i> Generate EDIFACT order</a></div>
|
|
[% END %]
|
|
</div>
|
|
[% END %]
|
|
[% IF (name && closedbg) %]
|
|
<h1>Basket group [% name | html %] ([% basketgroupid | html %]) for <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a></h1>
|
|
[% ELSIF (name) %]
|
|
<h1>Edit basket group [% name | html %] ([% basketgroupid | html %]) for <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a></h1>
|
|
[% ELSE %]
|
|
<h1>Add basket group for <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a></h1>
|
|
[% END %]
|
|
<div id="basketgroupcolumns" class="row">
|
|
[% UNLESS (closedbg) %]
|
|
<div class="col-xs-6 col-xs-push-6">
|
|
|
|
<div id="groups">
|
|
<div class="workarea_alt" >
|
|
<h3>Ungrouped baskets</h3>
|
|
<table id="ungrouped" class="basketgroup_baskets">
|
|
<thead>
|
|
<tr>
|
|
<th>Basket</th>
|
|
<th>Total</th>
|
|
<th class="NoSort"></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
[% IF ( baskets ) %]
|
|
[% FOREACH basket IN baskets %]
|
|
<tr class="ungrouped" id="b-[% basket.basketno | html %]">
|
|
<td>
|
|
<a href="basket.pl?basketno=[% basket.basketno | uri %]">
|
|
[% IF ( basket.basketname ) %]
|
|
[% basket.basketname | html %]
|
|
[% ELSE %]
|
|
<span>No name, basketnumber: [% basket.basketno | html %]</span>
|
|
[% END %]
|
|
</a>
|
|
</td>
|
|
<td data-sort="[% basket.total | html %]">
|
|
[% basket.total | $Price %]
|
|
<input type="hidden" class="basket" name="basket" value="[% basket.basketno | html %]" />
|
|
</td>
|
|
<td>
|
|
<a class="addtogroup btn btn-default btn-xs" data-basketid="b-[% basket.basketno | html %]">
|
|
<i class="fa fa-plus" aria-hidden="true"></i> Add to group
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
[% END %]
|
|
[% END %]
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
[% END %]
|
|
[% IF ( closedbg ) %]
|
|
<div class="col-xs-12">
|
|
[% ELSE %]
|
|
<div class="col-xs-6 col-xs-pull-6">
|
|
[% END %]
|
|
<form action="/cgi-bin/koha/acqui/basketgroup.pl" method="post" id="groupingform" onsubmit="return submitForm(this)">
|
|
<fieldset id="various" class="brief">
|
|
<ol>
|
|
[% UNLESS (closedbg) %]
|
|
<li>
|
|
<label for="basketgroupname">Basket group name:</label>
|
|
<input type="text" name="basketgroupname" id="basketgroupname" value="[% name | html %]" class="focus" />
|
|
</li>
|
|
[% ELSE %]
|
|
<input type="hidden" name="basketgroupname" id="basketgroupname" value="[% name | html %]" />
|
|
[% END %]
|
|
<li>
|
|
[% UNLESS (closedbg) %]
|
|
<label for="billingplace">Billing place:</label>
|
|
<select name="billingplace" id="billingplace">
|
|
<option value="">--</option>
|
|
[% PROCESS options_for_libraries libraries => Branches.all( selected => billingplace ) %]
|
|
</select>
|
|
[% ELSE %]
|
|
<span class="label">Billing place:</span>
|
|
<input name="billingplace" id="billingplace" type ="hidden" value="[% billingplace | html %]" />[% Branches.GetName( billingplace ) | html %]
|
|
[% END %]
|
|
</li>
|
|
[% UNLESS (closedbg) %]
|
|
<li>
|
|
<label for="deliveryplace">Delivery place:</label>
|
|
<select name="deliveryplace" id="deliveryplace">
|
|
<option value="">--</option>
|
|
[% PROCESS options_for_libraries libraries => Branches.all( selected => deliveryplace ) %]
|
|
</select>
|
|
</li>
|
|
<li><p>or</p></li>
|
|
<li>
|
|
<label for="freedeliveryplace">Delivery place:</label>
|
|
<textarea cols="26" rows="3" name="freedeliveryplace" id="freedeliveryplace">[% freedeliveryplace | html %]</textarea>
|
|
</li>
|
|
[% ELSE %]
|
|
<li>
|
|
<span class="label">Delivery place:</span>
|
|
[% IF (freedeliveryplace) %]
|
|
<input name="freedeliveryplace" id="freedeliveryplace" type ="hidden" value="[% freedeliveryplace | html %]" />[% freedeliveryplace | html %]
|
|
<input name="deliveryplace" id="deliveryplace" type ="hidden" value="" />
|
|
[% ELSE %]
|
|
<input name="deliveryplace" id="deliveryplace" type ="hidden" value="[% deliveryplace | html %]" />[% Branches.GetName( deliveryplace ) | html %]
|
|
<input name="freedeliveryplace" id="freedeliveryplace" type ="hidden" value="" />
|
|
[% END %]
|
|
</li>
|
|
[% END %]
|
|
<li>
|
|
[% UNLESS (closedbg) %]
|
|
<label for="deliverycomment">Delivery comment:</label>
|
|
<textarea cols="26" rows="3" name="deliverycomment" id="deliverycomment">[% deliverycomment | html %]</textarea>
|
|
[% ELSE %]
|
|
<span class="label">Delivery comment:</span>[% deliverycomment | html %]
|
|
<input name="deliverycomment" id="deliverycomment" type="hidden" value = "[% deliverycomment | html %]" />
|
|
[% END %]
|
|
</li>
|
|
<li>
|
|
<h3>Baskets in this group:</h3>
|
|
<table id="grouped" class="basketgroup_baskets">
|
|
<thead>
|
|
<tr>
|
|
<th>Basket</th>
|
|
<th>Total</th>
|
|
<th class="NoSort"></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
[% FOREACH selectedbasket IN selectedbaskets %]
|
|
<tr id="b-[% selectedbasket.basketno | html %]">
|
|
<td>
|
|
<a href="basket.pl?basketno=[% selectedbasket.basketno | uri %]">
|
|
[% IF ( selectedbasket.basketname ) %]
|
|
[% selectedbasket.basketname | html %]
|
|
[% ELSE %]
|
|
<span>No name, basketnumber: [% selectedbasket.basketno | html %]</span>
|
|
[% END %]
|
|
</a>
|
|
</td>
|
|
<td data-sort="[% selectedbasket.total | html %]">
|
|
[% selectedbasket.total | $Price %]
|
|
<input type="hidden" class="basket" name="basket" value="[% selectedbasket.basketno | html %]" />
|
|
</td>
|
|
<td>
|
|
[% IF ( closedbg ) %]
|
|
[% ELSE %]
|
|
<a class="removefromgroup btn btn-default btn-xs" data-basketid="b-[% selectedbasket.basketno | html %]" id="addtogroup[% selectedbasket.basketno | html %]">
|
|
<i class="fa fa-trash" aria-hidden="true"></i> Remove
|
|
</a>
|
|
[% END %]
|
|
</td>
|
|
</tr>
|
|
[% END %]
|
|
</tbody>
|
|
</table>
|
|
</li>
|
|
[% UNLESS (closedbg) %]
|
|
<li><label><input type="checkbox" id="closedbg" name="closedbg" /> Close basket group</label></li>
|
|
[% ELSE %]
|
|
<input type="hidden" id="closedbg" name="closedbg" value ="1"/>
|
|
[% END %]
|
|
</ol>
|
|
</fieldset>
|
|
|
|
[% UNLESS (closedbg) %]
|
|
<fieldset class="action"><input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
|
|
[% IF ( basketgroupid ) %]
|
|
<input type="hidden" name="basketgroupid" value="[% basketgroupid | html %]" />
|
|
[% END %]
|
|
<input type="hidden" name="op" value="attachbasket" />
|
|
<input type="submit" value="Save" /> <a href="/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=[% booksellerid | uri %]" class="cancel">Cancel</a>
|
|
</fieldset>
|
|
[% END %]
|
|
</form>
|
|
</div>
|
|
</div>
|
|
[% ELSE %]
|
|
<div id="toolbar" class="btn-toolbar">
|
|
<div class="btn-group"><a href="/cgi-bin/koha/acqui/basketgroup.pl?op=add&booksellerid=[% booksellerid | uri %]" class="btn btn-default" id="newbasketgroup"><i class="fa fa-plus"></i> New basket group</a></div>
|
|
</div>
|
|
<h1>Basket grouping for <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a></h1>
|
|
[% IF (NoEDIMessage) %]<div><strong>No EDIFACT configuration for [% booksellername | html %]</strong></div>[% END %]
|
|
<div id="basket_groups" class="toptabs">
|
|
<ul class="nav nav-tabs" role="tablist">
|
|
<li role="presentation"><a href="#opened" aria-controls="opened" role="tab" data-toggle="tab">Open</a></li>
|
|
<li role="presentation"><a href="#closed" aria-controls="closed" role="tab" data-toggle="tab">Closed</a></li>
|
|
</ul>
|
|
<div class="tab-content">
|
|
<div role="tabpanel" class="tab-pane active" id="opened">
|
|
<table id="basket_group_opened">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Number</th>
|
|
<th>Billing place</th>
|
|
<th>Delivery place</th>
|
|
<th>Number of baskets</th>
|
|
<th>Action</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
[% FOREACH basketgroup IN basketgroups %]
|
|
[% UNLESS ( basketgroup.closed ) %]
|
|
<tr>
|
|
<td>[% IF ( basketgroup.name ) %]
|
|
[% basketgroup.name | html %]
|
|
[% ELSE %]
|
|
<span>Basket group no. [% basketgroup.id | html %]</span>
|
|
[% END %]
|
|
</td>
|
|
<td>[% basketgroup.id | html %]</td>
|
|
<td>[% Branches.GetName( basketgroup.billingplace ) | html %]</td>
|
|
<td>[% IF (basketgroup.freedeliveryplace) %]Free delivery place[% ELSE %][% Branches.GetName( basketgroup.deliveryplace ) | html %][% END %]</td>
|
|
<td>[% basketgroup.basketsqty | html %]</td>
|
|
<td>
|
|
<input type="button" onclick="closeandprint('[% basketgroup.id | html %]');" value="Close and export as PDF" />
|
|
<form action="/cgi-bin/koha/acqui/basketgroup.pl" method="get"><input type="hidden" name="op" value="add" /><input type="hidden" name="booksellerid" value="[% basketgroup.booksellerid | html %]" /><input type="hidden" name="basketgroupid" value="[% basketgroup.id | html %]" /><input type="submit" value="Edit" /></form>
|
|
[% UNLESS basketgroup.basketsqty %]
|
|
<form action="/cgi-bin/koha/acqui/basketgroup.pl" method="get"><input type="hidden" name="op" value="delete" /><input type="hidden" name="booksellerid" value="[% basketgroup.booksellerid | html %]" /><input type="hidden" name="basketgroupid" value="[% basketgroup.id | html %]" /><input type="submit" value="Delete" /></form>
|
|
[% END %]
|
|
</td>
|
|
</tr>
|
|
[% END %]
|
|
[% END %]
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div role="tabpanel" class="tab-pane" id="closed">
|
|
<table id="basket_group_closed">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Number</th>
|
|
<th>Billing place</th>
|
|
<th>Delivery place</th>
|
|
<th>Number of baskets</th>
|
|
<th>Action</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
[% FOREACH basketgroup IN basketgroups %]
|
|
[% IF ( basketgroup.closed ) %]
|
|
<tr>
|
|
<td>
|
|
[% IF ( basketgroup.name ) %]
|
|
[% basketgroup.name | html %]
|
|
[% ELSE %]
|
|
<span>Basket group no. [% basketgroup.id | html %]</span>
|
|
[% END %]
|
|
</td>
|
|
<td>[% basketgroup.id | html %]</td>
|
|
<td>[% Branches.GetName( basketgroup.billingplace ) | html %]</td>
|
|
<td>[% IF (basketgroup.freedeliveryplace) %]Free delivery place[% ELSE %][% Branches.GetName( basketgroup.deliveryplace ) | html %][% END %]</td>
|
|
<td>[% basketgroup.basketsqty | html %]</td>
|
|
<td>
|
|
<form action="/cgi-bin/koha/acqui/basketgroup.pl" method="get"><input type="hidden" name="op" value="add" /><input type="hidden" name="booksellerid" value="[% basketgroup.booksellerid | html %]" /><input type="hidden" name="basketgroupid" value="[% basketgroup.id | html %]" /><input type="submit" value="View" /></form>
|
|
<form action="/cgi-bin/koha/acqui/basketgroup.pl" method="get"><input type="hidden" name="op" value="reopen" /><input type="hidden" name="booksellerid" value="[% basketgroup.booksellerid | html %]" /><input type="hidden" name="basketgroupid" value="[% basketgroup.id | html %]" /><input type="submit" value="Reopen" /></form>
|
|
<form action="/cgi-bin/koha/acqui/basketgroup.pl" method="get"><input type="hidden" name="op" value="print" /><input type="hidden" name="basketgroupid" value="[% basketgroup.id | html %]" /><input type="submit" value="Export as PDF" /></form>
|
|
<form action="/cgi-bin/koha/acqui/basketgroup.pl" method="get"><input type="hidden" name="op" value="export" /><input type="hidden" name="basketgroupid" value="[% basketgroup.id | html %]" /><input type="submit" value="Export as CSV" /></form>
|
|
[% IF (ediaccount) %]
|
|
<form action="/cgi-bin/koha/acqui/basketgroup.pl" method="get"><input type="hidden" name="op" value="ediprint" /><input type="hidden" name="basketgroupid" value="[% basketgroup.id | html %]" /><input type="submit" value="Generate EDIFACT order" /></form>
|
|
[% ELSE %]
|
|
<div>No EDIFACT configuration for [% booksellername | html %]</div>
|
|
[% END %]
|
|
</td>
|
|
</tr>
|
|
[% END %]
|
|
[% END %]
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
[% END %]
|
|
</main>
|
|
</div> <!-- /.col-sm-10.col-sm-push-2 -->
|
|
|
|
<div class="col-sm-2 col-sm-pull-10">
|
|
<aside>
|
|
[% IF ( booksellerid ) %]
|
|
[% INCLUDE 'vendor-menu.inc' %]
|
|
[% END %]
|
|
[% INCLUDE 'acquisitions-menu.inc' %]
|
|
</aside>
|
|
</div>
|
|
</div> <!-- /.row -->
|
|
[% INCLUDE 'intranet-bottom.inc' %]
|