Koha/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/aqbasketuser_search.tt
Julian Maurice 54616c37e2 Bug 7295: More granular permissions for baskets
- Add branch info to baskets
- Add a list of borrowers that are allowed to manage a basket (one list
for each basket).
- Add a new subpermission: acquisition => order_manage_all

If user is superlibrarian, or if that user has permission acquisition = 1
(GranularPermissions = OFF), or subpermission acquisition =>
order_manage_all (GranularPermissions = ON), that user is authorised to manage
all baskets.

Depending on syspref AcqViewBaskets:
  'all': user can manage all baskets
  'branch': user can manage baskets of their branch (the basket branch is
            taken into account, not the branch of the basket's creator).
            If basket branch is not defined, all users can manage this
            basket.
  'user': user can manage baskets she created, and baskets in their
          user list

There are unit tests in t/Acquisition/CanUserManageBasket.t, which
require Test::MockModule

You can edit basket's branch and users list in basket modification page
(acqui/basket.pl)

Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-10-31 16:35:35 +00:00

79 lines
2.4 KiB
Text

[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Basket User Search</title>
[% INCLUDE 'doc-head-close.inc' %]
<style type="text/css">
#custom-doc {
width:44.46em;
*width:43.39em;
min-width:578px;
margin:auto;
text-align:left;
}
</style>
<script type="text/javascript">
//<![CDATA[
// modify parent window owner element
function add_user(borrowernumber, borrowername) {
var p = window.opener;
if(p.add_basket_user(borrowernumber, borrowername) < 0) {
alert(_("Borrower '" + borrowername + "' is already in the list."));
}
}
//]]>
</script>
</head>
<body>
<div id="custom-doc" class="yui-t7">
<div id="bd">
<div class="yui-g">
<h3>Search for Basket User</h3>
<form action="/cgi-bin/koha/acqui/aqbasketuser_search.pl" method="post">
<fieldset>
<input type="hidden" name="op" id="op" value="do_search" />
<input type="text" name="q" id="q" value="[% q %]" class="focus" />
<input type="submit" class="button" value="Search" />
</fieldset>
<div class="hint">Only staff with superlibrarian or acquisitions permissions (or order_manage permission if granular permissions are enabled) are returned in the search results</div>
</form>
[% IF (q) %]
<p>Searched for <span class="ex">[% q %]</span>, [% nresults %] patron(s) found.</p>
[% END %]
[% IF ( users_loop ) %]
<table>
<thead>
<tr>
<th>Cardnumber</th>
<th>Name</th>
<th>Branch</th>
<th>Categorycode</th>
<th>Select?</th>
</tr>
</thead>
<tbody>
[% FOREACH user IN users_loop %]
[% IF ( user.toggle ) %]
<tr>
[% ELSE %]
<tr class="highlight">
[% END %]
<td>[% user.cardnumber %]</td>
<td>[% user.surname %], [% user.firstname %]</td>
<td>[% user.branchcode %]</td>
<td>[% user.categorycode %]</td>
<td>
<a style="cursor:pointer" onclick="add_user('[% user.borrowernumber %]', '[% user.firstname %] [% user.surname %]');">Add</a>
</td>
</tr>
[% END %]
</table>
[% END %]
<div id="closewindow"><a href="#" class="close">Close</a></div>
</div>
</div>
[% INCLUDE 'intranet-bottom.inc' %]