Koha/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt
Kyle M Hall a8942c2884 Revert bug 13618 - "Prevent XSS in the Staff Client and the OPAC" due to performance issues
Revert "DBRev to make notes of the XSS patches and the new important dependency."

This reverts commit e140603a59.

Revert "Bug 13618: Specific for branches.opac_info"

This reverts commit 06e4a50f00.

Revert "Bug 13618: (follow-up) Specific for other prefs"

This reverts commit d6475a111f.

Revert "Bug 13618: Fix for debarredcomment and patron messages"

This reverts commit dd98c9df92.

Revert "Bug 13618: Do not display html tags in patron's notices"

This reverts commit a065b243fe.

Revert "Bug 13618: Do not display   and html tags in item fields content"

This reverts commit baeeaffbf8.

Revert "Bug 13618: Fix for system preference description"

This reverts commit a967a09261.

Revert "Bug 13618: Remove html filters for newly pushed code"

This reverts commit 0e98662b10.

Revert "Bug 13618: (follow-up) add missing lines for opac-shelves"

This reverts commit fc2fb605e5.

Revert "Bug 13618: (follow-up) Specific for ColumnsSettings"

This reverts commit bc308fdd9c.

Revert "Bug 13618: Fix for edit biblios and items"

This reverts commit 811c4e8402.

Revert "Bug 13618: followup to remove tabs"

This reverts commit ca8e8c397c.

Revert "Bug 13618: Fix last occurrences recently introduced to master"

This reverts commit bb417b256b.

Revert "Bug 13618: Fix for news"

This reverts commit ae5b98020a.

Revert "Bug 13618: Fix escape on sending baskets or shelves by email"

This reverts commit a7731ffe25.

Revert "Bug 13618: Specific for XSLTBloc"

This reverts commit 11fa38dc29.

Revert "Bug 13618: Specific for Salutation on editing a patron"

This reverts commit 36c07ad6d3.

Revert "Bug 13618: Specific for other prefs"

This reverts commit e6ea281a3b.

Revert "Bug 13618 - memberentrygen.tt errors Not a GLOB reference"

This reverts commit 7824874557.

Revert "Bug 13618: Specific for ColumnsSettings"

This reverts commit 1834da3da3.

Revert "Bug 13618: Specific for IntranetUser* and OPACUser* prefs"

This reverts commit 21ae62b253.

Revert "Bug 13618: Fix error 'Not a GLOB reference'"

This reverts commit 602bdbab4c.

Revert "Bug 13618: Specific for the ISBD view"

This reverts commit d254362435.

Revert "Bug 13618: Specific for pagination_bar"

This reverts commit 8837a8ae68.

Revert "Bug 13618: Specific places where we don't need to escape variables - intra"

This reverts commit 00eff140b3.

Revert "Bug 13618: Remove html filters at the intranet"

This reverts commit 7db851ff03.

Revert "Bug 13618: Specific places where we don't need to escape variables"

This reverts commit 49a3738b8d.

Revert "Bug 13618: Remove html filters at the OPAC"

This reverts commit cedaa0e23e.

Revert "Bug 13618: Use Template::Stash::AutoEscaping to use the html filter"

This reverts commit 01b38d3b13.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-02-11 19:39:53 +00:00

401 lines
26 KiB
Text

[% USE Branches %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Basket grouping for [% booksellername |html %]</title>
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'datatables.inc' %]
<script type="text/javascript" src="[% themelang %]/lib/yui/utilities/utilities.js"></script>
<script type="text/javascript" src="[% themelang %]/lib/yui/button/button-min.js"></script>
<script type="text/javascript" src="[% themelang %]/lib/yui/container/container_core-min.js"></script>
<script type="text/javascript" src="[% themelang %]/lib/yui/menu/menu-min.js"></script>
<script type="text/javascript" src="[% themelang %]/js/basketgroup.js"></script>
[% IF ( grouping ) %]
<script type="text/javascript" src="[% themelang %]/lib/yui/yahoo-dom-event/yahoo-dom-event.js"></script>
<script type="text/javascript" src="[% themelang %]/lib/yui/animation/animation-min.js"></script>
<script type="text/javascript" src="[% themelang %]/lib/yui/dragdrop/dragdrop-min.js"></script>
<script type="text/javascript" src="[% themelang %]/lib/yui/element/element-min.js"></script>
<style type="text/css">
/*margin and padding on body element
can introduce errors in determining
element position and are not recommended;
we turn them off as a foundation for YUI
CSS treatments. */
#basketgroupcolumns {
width: 58em;
}
#ungrouped {
overflow: auto;
height: 400px;
}
.draglist{
width: 200px;
height: 300px;
overflow: auto;
}
div.workarea_alt { padding: 5px; float:left; width: 95%;}
div.closed { background-color: pink; padding:10px; float:left; width: 45%;}
ul.draglist {
position: relative;
background: #EEE;
padding-bottom:10;
border: 1px inset gray;
list-style: none;
margin:0;
padding: 5px;
}
ul.draglist li {
margin: 1px;
cursor: move;
list-style: none;
}
ul.draglist_alt {
position: relative;
border: 1px solid gray;
list-style: none;
margin: 0;
background: #f7f7f7;
padding: 5px;
cursor: move;
}
ul.draglist_alt li {
margin: 1px;
list-style: none;
}
li.grouped {
background-color: #D1E6EC;
border:1px solid #7EA6B2;
list-style: none;
}
li.ungrouped {
background-color: #D8D4E2;
border:1px solid #6B4C86;
}
fieldset.various li {
list-style: none;
clear: none;
}
</style>
[% END %]
<script type="text/javascript">
//<![CDATA[
YAHOO.util.Event.onDOMReady(DDApp.init, DDApp, true);
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() {
$("#basket_groups").tabs();
$("table").dataTable($.extend(true, {}, dataTablesDefaults, {
"aoColumnDefs": [
{ "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
],
"bAutoWidth": false,
"sPaginationType": "four_button"
} ));
});
//]]>
</script>
</head>
<body id="acq_basketgroup" class="acq">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'acquisitions-search.inc' %]
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo;
[% IF ( grouping ) %]
<a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% booksellername |html %]</a> &rsaquo; <a href="/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=[% booksellerid %]">Basket grouping</a> &rsaquo; Add basket group for [% booksellername |html %]</div>
[% ELSE %]
<a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% booksellername |html %]</a> &rsaquo; Basket grouping</div>
[% END %]
<div id="doc3" class="yui-t2">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
[% IF ( grouping ) %]
[% IF (closedbg) %]
<div id="toolbar" class="btn-toolbar">
<div class="btn-group"><a href="[% script_name %]?op=reopen&amp;basketgroupid=[% basketgroupid %]&amp;booksellerid=[% booksellerid %]&amp;mode=singlebg" class="btn btn-small" id="reopenbutton"><i class="fa fa-download"></i> Reopen this basket group</a></div>
<div class="btn-group"><a href="[% script_name %]?op=export&amp;basketgroupid=[% basketgroupid %]&amp;booksellerid=[% booksellerid %]" class="btn btn-small" id="exportbutton"><i class="fa fa-download"></i> Export this basket group as CSV</a></div>
<div class="btn-group"><a href="[% script_name %]?op=print&amp;basketgroupid=[% basketgroupid %]&amp;booksellerid=[% booksellerid %]" class="btn btn-small" id="printbutton"><i class="fa fa-download"></i> Print this basket group in PDF</a></div>
</div>
[% ELSE %]
<div class="btn-group"><a href="[% script_name %]?op=delete&amp;basketgroupid=[% basketgroupid %]&amp;booksellerid=[% booksellerid %]" class="btn btn-small" id="delbutton"><i class="fa fa-remove"></i> Delete basket group</a></div>
[% END %]
[% IF (name && closedbg) %]
<h1>Basket group [% name %] ([% basketgroupid %]) for <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% booksellername |html %]</a></h1>
[% ELSIF (name) %]
<h1>Edit basket group [% name %] ([% basketgroupid %]) for <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% booksellername |html %]</a></h1>
[% ELSE %]
<h1>Add basket group for <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% booksellername |html %]</a></h1>
[% END %]
<div id="basketgroupcolumns" class="yui-g">
[% UNLESS (closedbg) %]
<div class="yui-u">
<form action="[% scriptname %]" method="post" name="basketgroups" id="basketgroups">
<div id="groups">
<fieldset class="brief">
<div class="workarea_alt" >
<h3>Ungrouped baskets</h3>
<ul id="ungrouped" class="draglist_alt">
[% IF ( baskets ) %]
[% FOREACH basket IN baskets %]
<li class="ungrouped" id="b-[% basket.basketno %]" >
<a href="basket.pl?basketno=[% basket.basketno %]">
[% IF ( basket.basketname ) %]
[% basket.basketname %]
[% ELSE %]
No name, basketnumber: [% basket.basketno %]
[% END %]
</a>, <br />
Total: [% basket.total %]
<input type="hidden" class="basket" name="basket" value="[% basket.basketno %]" />
</li>
[% END %]
[% END %]
</ul>
</div>
</fieldset>
</div>
</form>
</div>
[% END %]
<div class="yui-u first">
<form action="" 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 %]" class="focus" />
</li>
[% ELSE %]
<input type="hidden" name="basketgroupname" id="basketgroupname" value="[% name %]" />
[% END %]
<li>
[% UNLESS (closedbg) %]
<label for="billingplace">Billing place:</label>
<select name="billingplace" id="billingplace" style="width:13em;">
<option value="">--</option>
[% FOREACH billingplaceloo IN billingplaceloop %]
[% IF ( billingplaceloo.selected ) %]<option value="[% billingplaceloo.value %]" selected="selected">[% billingplaceloo.branchname %]</option>
[% ELSE %]<option value="[% billingplaceloo.value %]">[% billingplaceloo.branchname %]</option>[% END%]
[% END %]
</select>
[% ELSE %]
<span class="label">Billing place:</span>
[% FOREACH billingplaceloo IN billingplaceloop %]
[% IF ( billingplaceloo.selected ) %]
<input name="billingplace" id="billingplace" type ="hidden" value="[% billingplaceloo.value %]" />[% billingplaceloo.branchname %]
[% END %]
[% END %]
[% END %]
</li>
[% UNLESS (closedbg) %]
<li>
<label for="deliveryplace">Delivery place:</label>
<select name="deliveryplace" id="deliveryplace" style="width:13em;">
<option value="">--</option>
[% FOREACH deliveryplaceloo IN deliveryplaceloop %]
[% IF ( deliveryplaceloo.selected ) %]<option value="[% deliveryplaceloo.value %]" selected="selected">[% deliveryplaceloo.branchname %]</option>
[% ELSE %]<option value="[% deliveryplaceloo.value %]">[% deliveryplaceloo.branchname %]</option>[% END %]
[% END %]
<select>
</li>
<li><p>or</p></li>
<li>
<label for="freedeliveryplace">Delivery place:</label>
<textarea cols="26" rows="3" name="freedeliveryplace" id="freedeliveryplace">[% freedeliveryplace %]</textarea>
</li>
[% ELSE %]
<li>
<span class="label">Delivery place:</span>
[% IF (freedeliveryplace) %]
<input name="freedeliveryplace" id="freedeliveryplace" type ="hidden" value="[% freedeliveryplace %]" />[% freedeliveryplace %]
<input name="deliveryplace" id="deliveryplace" type ="hidden" value="" />
[% ELSE %]
[% FOREACH deliveryplaceloo IN deliveryplaceloop %]
[% IF ( deliveryplaceloo.selected ) %]
<input name="deliveryplace" id="deliveryplace" type ="hidden" value="[% deliveryplaceloo.value %]" />[% deliveryplaceloo.branchname %]
[% END %]
[% END %]
<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 %]</textarea>
[% ELSE %]
<span class="label">Delivery comment:</span>[% deliverycomment %]
<input name="deliverycomment" id="deliverycomment" type="hidden" value = "[% deliverycomment %]" />
[% END %]
</li>
<li>
<span class="label">Baskets in this group:</span>
[% UNLESS (closedbg) %]
<ul class="draglist" id="bg">
[% ELSE %]
<ul>
[% END %]
[% FOREACH selectedbasket IN selectedbaskets %]
<li class="grouped" id="b-[% selectedbasket.basketno %]" >
<a href="basket.pl?basketno=[% selectedbasket.basketno %]">
[% IF ( selectedbasket.basketname ) %]
[% selectedbasket.basketname %]
[% ELSE %]
No name, basketnumber: [% selectedbasket.basketno %]
[% END %]
</a>, <br />
Total: [% selectedbasket.total %]
<input type="hidden" class="basket" name="basket" value="[% selectedbasket.basketno %]" />
</li>
[% END %]
</ul>
</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 %]" />
[% IF ( basketgroupid ) %]
<input type="hidden" name="basketgroupid" value="[% basketgroupid %]" />
[% END %]
<input type="hidden" name="op" value="attachbasket" />
<input type="submit" value="Save" /> <a href="/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=[% booksellerid %]" 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&amp;booksellerid=[% booksellerid %]" class="btn btn-small" 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 %]">[% booksellername |html %]</a></h1>
<div id="basket_groups" class="toptabs">
<ul class="ui-tabs-nav">
[% UNLESS ( listclosed) %]<li class="ui-tabs-active"><a href="#opened">Open</a></li>
[% ELSE%]<li><a href="#opened">Open</a></li>[% END %]
[% IF ( listclosed) %]<li class="ui-tabs-active"><a href="#closed">Closed</a></li>
[% ELSE %]<li><a href="#closed">Closed</a></li>[% END %]
</ul>
<div 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 %]
[% ELSE %]
Basket group no. [% basketgroup.id %]
[% END %]
</td>
<td>[% basketgroup.id %]</td>
<td>[% Branches.GetName( basketgroup.billingplace ) %]</td>
<td>[% IF (basketgroup.freedeliveryplace) %]Free delivery place[% ELSE %][% Branches.GetName( basketgroup.deliveryplace ) %][% END %]</td>
<td>[% basketgroup.basketsqty %]</td>
<td>
<input type="button" onclick="closeandprint('[% basketgroup.id %]');" value="Close and print" />
<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 %]" /><input type="hidden" name="basketgroupid" value="[% basketgroup.id %]" /><input type="submit" value="Edit" /></form>
<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 %]" /><input type="hidden" name="basketgroupid" value="[% basketgroup.id %]" /><input type="submit" value="Delete" /></form>
</td>
</tr>
[% END %]
[% END %]
</tbody>
</table>
</div>
<div 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 %]
[% ELSE %]
Basket group no. [% basketgroup.id %]
[% END %]
</td>
<td>[% basketgroup.id %]</td>
<td>[% Branches.GetName( basketgroup.billingplace ) %]</td>
<td>[% IF (basketgroup.freedeliveryplace) %]Free delivery place[% ELSE %][% Branches.GetName( basketgroup.deliveryplace ) %][% END %]</td>
<td>[% basketgroup.basketsqty %]</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 %]" /><input type="hidden" name="basketgroupid" value="[% basketgroup.id %]" /><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 %]" /><input type="hidden" name="basketgroupid" value="[% basketgroup.id %]" /><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 %]" /><input type="submit" value="Print" /></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 %]" /><input type="submit" value="Export as CSV" /></form>
</td>
</tr>
[% END %]
[% END %]
</tbody>
</table>
</div>
</div>
[% END %]
</div>
</div>
<div class="yui-b">
[% IF ( booksellerid ) %]
[% INCLUDE 'vendor-menu.inc' %]
[% END %]
[% INCLUDE 'acquisitions-menu.inc' %]
</div>
</div>
[% INCLUDE 'intranet-bottom.inc' %]