4 [% PROCESS 'i18n.inc' %]
6 "sEcho": [% sEcho | html %],
7 "iTotalRecords": [% iTotalRecords | html %],
8 "iTotalDisplayRecords": [% iTotalDisplayRecords | html %],
10 [% FOREACH data IN aaData %]
13 "[% data.public | html %]",
15 "<a href='/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% data.shelfnumber | html %]'>[% data.shelfname | html | $To %]</a>",
17 "[% tnx('{count} item', '{count} items', count, { count = data.count }) | $raw %]",
19 "[% IF data.public %]<span>Public</span>[% ELSIF data.is_shared %]<span>Shared</span>[% ELSE %]<span>Private</span>[% END %]",
21 "<a href='/cgi-bin/koha/members/moremember.pl?borrowernumber=[% data.owner | html %]'>[% data.firstname | html | $To %] [% data.surname | html | $To %]</a>",
23 [% IF data.sortby == "author" %]"<span>Author</span>"[% ELSIF data.sortby == "copyrightdate" %]"<span>Year</span>"[% ELSIF data.sortby == "itemcallnumber" %]"<span>Call number</span>"[% ELSIF data.sortby == "dateadded" %]"<span>Date added</span>"[% ELSE %]"<span>Title</span>"[% END %],
25 "[% data.created_on | $KohaDates %]",
26 "dt_modification_time":
27 "[% data.modification_time | $KohaDates %]",
29 "[% PROCESS action_form shelfnumber=data.shelfnumber can_manage_shelf=data.can_manage_shelf can_delete_shelf=data.can_delete_shelf type=data.type %]"
30 }[% UNLESS loop.last %],[% END %]
35 [% BLOCK action_form -%]
36 [%~ SET action_block = '' ~%]
37 [%~ IF can_manage_shelf OR can_delete_shelf ~%]
38 [%~ shelfnumber = shelfnumber | html ~%]
39 [%~ public = public | html ~%]
40 [%~ IF can_manage_shelf ~%]
41 [%~ action_block = '<form action="shelves.pl" method="get">' ~%]
42 [%~ action_block = action_block _ '<input type="hidden" name="shelfnumber" value="' _ shelfnumber _ '" />' ~%]
43 [%~ action_block = action_block _ '<input type="hidden" name="op" value="edit_form" />' ~%]
44 [%~ action_block = action_block _ '<input type="hidden" name="public" value="' _ public _ '" />' ~%]
45 [%~ action_block = action_block _ '<input type="hidden" name="referer" value="list" />' ~%]
46 [%~ action_block = action_block _ '<button class="editshelf btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</button>' ~%]
47 [%~ action_block = action_block _ '</form> ' ~%]
49 [%~ IF can_delete_shelf ~%]
50 [%~ action_block = action_block _ ' <form action="shelves.pl" method="post">' ~%]
51 [%~ action_block = BLOCK ~%][%~ action_block | $raw ~%][%~ INCLUDE 'csrf-token.inc' | trim ~%][%~ END ~%]
52 [%~ action_block = action_block _ '<input type="hidden" name="shelves" value="1" />' ~%]
53 [%~ action_block = action_block _ '<input type="hidden" name="op" value="delete" />' ~%]
54 [%~ action_block = action_block _ '<input type="hidden" name="shelfnumber" value="' _ shelfnumber _ '" />' ~%]
55 [%~ action_block = action_block _ '<input type="hidden" name="public" value="' _ public _ '" />' ~%]
56 [%~ action_block = action_block _ '<input type="hidden" name="referer" value="list" />' ~%]
57 [%~ action_block = action_block _ '<button type="submit" class="deleteshelf btn btn-default btn-xs"><i class="fa fa-trash"></i> Delete</button>' ~%]
58 [%~ action_block = action_block _ '</form>' ~%]
60 [%~ IF public AND allow_transfer ~%]
61 [%~ action_block = action_block _ ' <form action="shelves.pl" method="post">' ~%]
62 [%~ action_block = action_block _ '<input type="hidden" name="shelves" value="1" />' ~%]
63 [%~ action_block = action_block _ '<input type="hidden" name="op" value="transfer" />' ~%]
64 [%~ action_block = action_block _ '<input type="hidden" name="shelfnumber" value="' _ shelfnumber _ '" />' ~%]
65 [%~ action_block = action_block _ '<input type="hidden" name="public" value="1" />' ~%]
66 [%~ action_block = action_block _ '<input type="hidden" name="referer" value="list" />' ~%]
67 [%~ action_block = action_block _ '<button type="submit" class="btn btn-default btn-xs"><i class="fa"></i> Transfer</button>' ~%]
68 [%~ action_block = action_block _ '</form>' ~%]
71 [%~ SET action_block = 'None' ~%]
73 [%~ To.json(action_block) | $raw ~%]