--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/downloadshelf.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/downloadshelf.tt
@@ -3,6 +3,22 @@
[% INCLUDE 'doc-head-close.inc' %]
+
+[% FOR m IN messages %]
+
+ [% SWITCH m.code %]
+ [% CASE 'unauthorized' %]
+ You do not have permission to view this list.
+ [% CASE 'does_not_exist' %]
+ This list does not exist.
+ [% CASE %]
+ [% m.code %]
+ [% END %]
+
+[% END %]
+
+
+
[% IF ( format ) %]
Your download should begin automatically.
[% ELSE %]
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt
@@ -1,5 +1,9 @@
+[% USE Koha %]
+[% USE KohaDates %]
+[% SET PRIVATE = 1 %]
+[% SET PUBLIC = 2 %]
[% INCLUDE 'doc-head-open.inc' %]
-Koha › [% IF ( viewshelf ) %]Lists › Contents of [% shelfname | html %][% ELSE %]Lists[% END %][% IF ( shelves ) %] › Create new list[% END %][% IF ( edit ) %] › Edit list [% shelfname | html %][% END %]
+Koha › [% IF op == 'view' %]Lists › Contents of [% shelf.shelfname | html %][% ELSE %]Lists[% END %][% IF op == 'add_form' %] › Create new list[% END %][% IF op == 'edit_form' %] › Edit list [% shelf.shelfname | html %][% END %]
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'datatables.inc' %]
@@ -14,7 +18,7 @@
[% END %]
-[% IF ( viewshelf ) %]
+[% IF op == 'view' %]
[% END %]
@@ -27,7 +31,11 @@ var MSG_CONFIRM_DELETE_LIST = _("Are you sure you want to remove this list?");
[% IF op == 'list' %]
$(document).ready(function(){
- var type = 1;
+ [% IF category == PUBLIC %]
+ var type = [% PUBLIC %];
+ [% ELSE %]
+ var type = [% PRIVATE %];
+ [% END %]
var dtListResults = $("#listresultst").dataTable($.extend(true, {}, dataTablesDefaults, {
'bServerSide': true,
'sAjaxSource': "/cgi-bin/koha/svc/virtualshelves/search",
@@ -81,13 +89,18 @@ $(document).ready(function(){
dtListResults.fnAddFilters("filter", 750);
var tabs = $("#tabs").tabs({
+ [% IF category == PUBLIC %]
+ active: 1,
+ [% ELSE %]
+ active: 0,
+ [% END %]
activate: function(e, ui) {
var active = tabs.tabs("option", "active" );
if ( active == 0 ) {
- type = 1; // private
+ type = [% PRIVATE %];
dtListResults.fnDraw();
} else if ( active == 1 ) {
- type = 2; // public
+ type = [% PUBLIC %];
dtListResults.fnDraw();
}
}
@@ -95,7 +108,7 @@ $(document).ready(function(){
});
[% END %]
-[% IF ( viewshelf ) %]
+[% IF op == 'view' %]
$(document).ready(function(){
[% IF ( itemsloop ) %]$('#searchheader').fixFloat();[% END %]
$("span.clearall").html(""+_("Clear all")+"<\/a>");
@@ -173,14 +186,6 @@ $(document).ready(function(){
});
[% END %]
- function confirmDelete(message){
- if (window.confirm(message)) {
- location.href="/cgi-bin/koha/virtualshelves/shelves.pl?[% IF ( showprivateshelves ) %]display=privateshelves&[% END %]shelves=1&DEL-[% shelfnumber %]=1&shelfoff=[% shelfoff %]";
- } else {
- return false;
- }
- }
-
/**
* This function checks if the adequate number of records are checked for merging
*/
@@ -272,35 +277,28 @@ function placeHold () {
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
-[% BLOCK list_permissions %]
-
Home › Lists [% IF ( category1 ) %] › [% IF ( viewshelf || edit ) %] Your lists [% ELSE %] Your lists [% END %] [% ELSIF ( category2 ) %] › [% IF ( viewshelf ) %] Public lists [% ELSE %] Public lists [% END %] [% ELSIF ( showprivateshelves ) %] › [% IF ( viewshelf || edit ) %] Your lists [% ELSE %] Your lists [% END %] [% ELSIF ( showpublicshelves ) %] › [% IF ( viewshelf || edit ) %] Public lists [% ELSE %] Public lists [% END %] [% END %]
+
+ Home ›
+ [% IF op != 'list' %]
+ Lists
+ [% ELSE %]
+ Lists
+ [% END %]
+ [% IF shelf AND shelf.category == PRIVATE %] ›
+ [% IF op == 'view' OR op == 'edit_form' %]
+ Your lists
+ [% ELSE %]
+ Your lists
+ [% END %]
+ [% ELSIF shelf AND shelf.category == PUBLIC %] ›
+ [% IF op == 'view' %]
+ Public lists
+ [% ELSE %]
+ Public lists
+ [% END %]
+ [% END %]
-[% IF ( viewshelf ) %]› Contents of [% shelfname | html %][% END %][% IF ( shelves ) %] › Create new list[% END %][% IF ( edit ) %] › Edit list [% shelfname | html %][% END %]
+[% IF op == 'view' %]› Contents of [% shelf.shelfname | html %][% END %][% IF op == 'add_form' %] › Create new list[% END %][% IF op == 'edit_form' %] › Edit list [% shelf.shelfname | html %][% END %]
@@ -318,70 +316,53 @@ function placeHold () {
[% CASE 'error_on_insert' %]
An error occurred when inserting this list. Perhaps the name already exists.
[% CASE 'error_on_delete' %]
- An error occurred when deleteing this list. Check the logs.
+ An error occurred when deleting this list. Check the logs.
+ [% CASE 'error_on_add_biblio' %]
+ The item has not been added to the list. Please check it's not in this list yet.
[% CASE 'success_on_update' %]
List updated with success.
[% CASE 'success_on_insert' %]
List inserted with success.
[% CASE 'success_on_delete' %]
List deleted with success.
- [% CASE 'Koha::Exception::DuplicateObject' %]
+ [% CASE 'success_on_add_biblio' %]
+ The item has been added to the list.
+ [% CASE 'success_on_remove_biblios' %]
+ The item has been removed from the list.
+ [% CASE 'does_not_exist' %]
+ This list does not exist.
+ [% CASE 'item_does_not_exist' %]
+ This item does not exist.
+ [% CASE 'unauthorized_on_view' %]
+ You do not have permission to view this list.
+ [% CASE 'unauthorized_on_update' %]
+ You do not have permission to update this list.
+ [% CASE 'unauthorized_on_delete' %]
+ You do not have permission to delete this list.
+ [% CASE 'unauthorized_on_add_biblio' %]
+ You do not have permission to add a biblio to this list.
+ [% CASE 'no_biblio_removed' %]
+ No biblio has been removed.
+ [% CASE 'Koha::Exceptions::Virtualshelves::DuplicateObject' %]
An error occurred when inserting this list. The name already [% shelfname %] exists.
+ [% CASE 'DBIx::Class::Exception' %]
+ [% m.msg %]
[% CASE %]
[% m.code %]
[% END %]
[% END %]
-[% IF ( paramsloop ) %]
-[% FOREACH paramsloo IN paramsloop %]
-
-
- [% IF ( paramsloo.status ) %]
[% paramsloo.string %]
[% END %]
- [% IF ( paramsloo.nobarcode ) %]
ERROR: No barcode given.
[% END %]
- [% IF ( paramsloo.noshelfnumber ) %]
ERROR: No list number given.
[% END %]
- [% IF ( paramsloo.need_confirm ) %]
-
The list [% paramsloo.need_confirm %] is not empty.
- [% IF ( paramsloo.single ) %]
- It has [% paramsloo.count %] entry.
- [% ELSE %]
- It has [% paramsloo.count %] entries.
- [% END %]
- Use the "Confirm" button below to confirm deletion.
-
- [% END %]
- [% IF ( paramsloo.nopermission ) %]
-
ERROR: You do not have adequate permission for that action on list [% paramsloo.nopermission %].
- [% END %]
- [% IF ( paramsloo.failgetitem ) %]
-
ERROR: No item found with barcode [% paramsloo.failgetitem %].
- [% END %]
- [% IF ( paramsloo.duplicatebiblio ) %]
-
A record matching barcode [% paramsloo.duplicatebiblio %] has already been added.
- [% END %]
- [% IF ( paramsloo.nothingdeleted) %]
-
Warning: You could not delete any of the selected items from this list.
- [% END %]
- [% IF ( paramsloo.somedeleted) %]
-
Warning: You could not delete all selected items from this list.
- [% END %]
- [% IF ( paramsloo.modifyfailure) %]
-
ERROR: List could not be modified.
- [% END %]
-
-
-[% END %]
-[% END %]
-
-[% IF ( viewshelf ) %]
+[% IF op == 'view' %]