Koha/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt
Owen Leonard 93c7f2a987 Bug 8161 - Cataloging home page should be accessible to users with permission to edit catalog or edit items
This patch modifies the permissions required to access the cataloging
home page (addbooks.pl) so that the user requires edit_catalogue,
edit_items, or fast_cataloging permission.

Users with only edit_catalogue permission will only see biblio edit
links. Users with edit_items permission will only see item edit
links. Users with fast_cataloging permission will only be able to
view information about contents of the catalog--useless for them
but I'm not sure how better to handle it.

To test, log in as a user with each of the above permissions
enabled separately and in combination and test access.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-06-05 16:52:10 +02:00

157 lines
7 KiB
Text

[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Cataloging</title>
[% INCLUDE 'greybox.inc' %]
[% INCLUDE 'doc-head-close.inc' %]
<script type="text/javascript">
$(document).ready(function() {
$('#header_search').tabs();
});
</script>
</head>
<body id="cat_addbooks" class="cat">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cataloging-search.inc' %]
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; Cataloging</div>
<div id="doc" class="yui-t7">
<div id="bd">
<div id="yui-main">
[% IF ( CAN_user_editcatalogue_edit_catalogue ) %][% INCLUDE 'cataloging-toolbar.inc' %][% END %]
[% IF ( noitemsfound ) %]
No results found
[% END %]
<!-- display the search results -->
[% IF ( total ) %]
[% total %] result(s) found in catalog,
<a href="#searchresult-breeding">[% breeding_count %] result(s) found in reservoir</a>
<div class="pages">[% pagination_bar %]</div>
<div class="searchresults">
<table>
<tr>
<th>Title</th>
<th>Location</th>
<th>Preview</th>
[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]<th>&nbsp;</th>[% ELSE %][% END %]
[% IF ( CAN_user_editcatalogue_edit_items ) %]<th>&nbsp;</th>[% END %]
</tr>
[% FOREACH resultsloo IN resultsloop %]
[% IF ( loop.even ) %]
<tr class="highlight">
[% ELSE %]
<tr>
[% END %]
<td>
<p>
<a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% resultsloo.biblionumber %]">[% resultsloo.title |html %]</a>
[% FOREACH subtitl IN resultsloo.subtitle %][% subtitl.subfield %][% END %]</p>
[% IF ( resultsloo.summary ) %]
<p>[% resultsloo.summary %]</p>
[% ELSE %]
<p>
[% IF ( resultsloo.author ) %]
[% resultsloo.author %]
[% ELSE %]
&nbsp;
[% END %]
[% IF ( resultsloo.isbn ) %] - [% resultsloo.isbn %] [% END %]
[% IF ( resultsloo.publicationyear ) %] - [% resultsloo.publicationyear %][% END %]
[% IF ( resultsloo.publishercode ) %]- [% resultsloo.publishercode %][% END %]
[% IF ( resultsloo.copyrightdate ) %] - [% resultsloo.copyrightdate %][% END %]
[% IF ( resultsloo.edition ) %]Edition: [% resultsloo.edition %][% END %]
[% IF ( resultsloo.place ) %] ; [% resultsloo.place %][% END %]
[% IF ( resultsloo.pages ) %] - [% resultsloo.pages %][% END %]
[% IF ( resultsloo.size ) %] ; [% resultsloo.size %][% END %]
[% IF ( resultsloo.timestamp ) %] <i>(modified on [% resultsloo.timestamp %])</i>[% END %]
</p>
[% END %]
</td>
<td>
[% IF ( resultsloo.available_items_loop ) %]
<span class="available">
[% FOREACH items_loo IN resultsloo.available_items_loop %]
[% items_loo.count %] [% items_loo.branchname %]
<i>
[% IF ( items_loo.location ) %][% items_loo.location %][% END %]
[% IF ( items_loo.itemcallnumber ) %][% items_loo.itemcallnumber %][% END %]
[% IF ( items_loo.classification ) %]
<a href="/cgi-bin/koha/catalogue/search.pl?q=callnum:[% items_loo.classification |url %]">
[% items_loo.classification %]
</a>
[% END %]
</i>
<br />
[% END %]
</span>
[% END %]
<span class="unavailable">
[% IF ( resultsloo.onloancount ) %] Checked out ([% resultsloo.onloancount %]),<br /> [% END %]
[% IF ( resultsloo.wthdrawncount ) %] Withdrawn ([% resultsloo.wthdrawncount %]),<br /> [% END %]
[% IF ( resultsloo.itemlostcount ) %] Lost ([% resultsloo.itemlostcount %])<br />[% END %]
[% IF ( resultsloo.orderedcount ) %] On order ([% resultsloo.orderedcount %])[% END %]
</span>
</td>
<td> <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% resultsloo.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;id=[% resultsloo.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">Card</a>
</td>
[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]<td><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% resultsloo.biblionumber %]">Edit biblio</a></td>[% END %]
[% IF ( CAN_user_editcatalogue_edit_items ) %]<td><a href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% resultsloo.biblionumber %]">Add/Edit items</a></td>[% END %]
</tr>
[% END %]
</table>
</div>
[% ELSE %]
[% IF ( query ) %]
[% IF ( error ) %]<div class="dialog alert">[% END %]<b>No results found</b>
[% IF ( error ) %]
Error: <span class="error">[% error %]</span></div>
[% END %]
[% END %]
[% END %]
[% IF ( query ) %]
<div id="searchresult-breeding">
<h3>Biblios in reservoir</h3>
[% IF ( breeding_loop ) %]
<table>
<tr>
<th>Title</th>
<th>ISBN</th>
<th>Date</th>
<th>Edition</th>
<th>Coming from</th>
<th>Preview</th>
[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]<th>&nbsp;</th>[% END %]
</tr>
[% FOREACH breeding_loo IN breeding_loop %]
[% IF ( loop.odd ) %]
<tr>
[% ELSE %]
<tr class="highlight">
[% END %]
<td>[% breeding_loo.title |html %]
[% breeding_loo.author %]</td>
<td>[% breeding_loo.isbn %]</td>
<td>[% breeding_loo.copyrightdate %]</td>
<td>[% breeding_loo.edition %]</td>
<td>[% breeding_loo.file %]</td>
<td> <a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.id %]" title="MARC" rel="gb_page_center[600,500]">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;importid=[% breeding_loo.id %]" title="MARC" rel="gb_page_center[600,500]">Card</a>
</td>
[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]<td>
<a href="/cgi-bin/koha/cataloguing/addbiblio.pl?breedingid=[% breeding_loo.id %]">Add biblio</a>
</td>[% END %]
</tr>
[% END %]
</table>
[% ELSE %]
<p>None</p>
[% END %]
</div>
[% END %]
</div>
</div>
[% INCLUDE 'intranet-bottom.inc' %]