Koha/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/tables/shelves_results.tt
Jonathan Druart 6f75aa11ff Bug 14544: Make the intranet side independent of Page.pm
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-05 09:58:01 -03:00

56 lines
3.1 KiB
Text

[% USE KohaDates %]
[% USE To %]
{
"sEcho": [% sEcho %],
"iTotalRecords": [% iTotalRecords %],
"iTotalDisplayRecords": [% iTotalDisplayRecords %],
"aaData": [
[% FOREACH data IN aaData %]
{
"dt_type":
"[% data.type %]",
"dt_shelfname":
"<a href='/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% data.shelfnumber %]'>[% data.shelfname | html%]</a>",
"dt_count":
"[% data.count %] item(s)",
"dt_owner":
"<a href='/cgi-bin/koha/members/moremember.pl?borrowernumber=[% data.owner %]'>[% data.firstname %] [% data.surname %]</a>",
"dt_sortby":
[% IF data.sortby == "author" %]"Author"[% ELSIF data.sortby == "copyrightdate" %]"Year"[% ELSIF data.sortby == "itemcallnumber" %]"Call number"[% ELSE %]"Title"[% END %],
"dt_created_on":
"[% data.created_on | $KohaDates %]",
"dt_modification_time":
"[% data.modification_time | $KohaDates %]",
"dt_action":
"<a style=\"cursor:pointer\">[% PROCESS action_form shelfnumber=data.shelfnumber can_manage_shelf=data.can_manage_shelf can_delete_shelf=data.can_delete_shelf type=data.type %]</a>"
}[% UNLESS loop.last %],[% END %]
[% END %]
]
}
[% BLOCK action_form -%]
[%~ SET action_block = '' ~%]
[%~ IF can_manage_shelf OR can_delete_shelf ~%]
[%~ IF can_manage_shelf ~%]
[%~ action_block = '<form action="shelves.pl" method="get">' ~%]
[%~ action_block = action_block _ '<input type="hidden" name="shelfnumber" value="' _ shelfnumber _ '" />' ~%]
[%~ action_block = action_block _ '<input type="hidden" name="op" value="edit_form" />' ~%]
[%~ action_block = action_block _ '<input type="hidden" name="category" value="' _ type _ '" />' ~%]
[%~ action_block = action_block _ '<input type="submit" class="editshelf" value="Edit" />' ~%]
[%~ action_block = action_block _ '</form>' ~%]
[%~ END ~%]
[%~ IF can_manage_shelf OR can_delete_shelf ~%]
[%~ action_block = action_block _ '<form action="shelves.pl" method="post">' ~%]
[%~ action_block = action_block _ '<input type="hidden" name="shelfoff" value="' _ shelfoff _ '" />' ~%]
[%~ action_block = action_block _ '<input type="hidden" name="shelves" value="1" />' ~%]
[%~ action_block = action_block _ '<input type="hidden" name="op" value="delete" />' ~%]
[%~ action_block = action_block _ '<input type="hidden" name="shelfnumber" value="' _ shelfnumber _ '" />' ~%]
[%~ action_block = action_block _ '<input type="hidden" name="category" value="' _ type _ '" />' ~%]
[%~ action_block = action_block _ '<input type="submit" class="deleteshelf" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST)" value="Delete" />' ~%]
[%~ action_block = action_block _ '</form>' ~%]
[%~ END ~%]
[%~ ELSE ~%]
[%~ SET action_block = 'None' ~%]
[%~ END ~%]
[%~ To.json(action_block) ~%]
[%~ END ~%]