Lines 2-66
Link Here
|
2 |
[% USE KohaDates %] |
2 |
[% USE KohaDates %] |
3 |
[% USE To %] |
3 |
[% USE To %] |
4 |
[% PROCESS 'i18n.inc' %] |
4 |
[% PROCESS 'i18n.inc' %] |
5 |
{ "draw": [% draw | html %], "recordsTotal": [% recordsTotal | html %], "recordsFiltered": [% recordsFiltered | html %], "data": [ |
5 |
{ |
6 |
[% FOREACH d IN data %] |
6 |
"draw": [% draw | html %], |
7 |
{ "dt_public": "[% d.public | html %]", "dt_shelfname": "<a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% d.shelfnumber | html %]">[% d.shelfname | html | $To %]</a>", "dt_count": |
7 |
"recordsTotal": [% recordsTotal | html %], |
8 |
"[% tnx('{count} item', '{count} items', count, { count = d.count }) | $raw %]", "dt_is_shared": "[% IF d.public %]<span>Public</span>[% ELSIF d.is_shared %]<span>Shared</span>[% ELSE %]<span>Private</span>[% END %]", "dt_owner": "<a |
8 |
"recordsFiltered": [% recordsFiltered | html %], |
9 |
href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% d.owner | html %]" |
9 |
"data": [ |
10 |
>[% d.firstname | html | $To %] [% d.surname | html | $To %]</a |
10 |
[% FOREACH d IN data %] |
11 |
>", "dt_sortby": |
11 |
{ |
12 |
[% IF d.sortby == "author" %] |
12 |
"dt_public": |
13 |
"<span>Author</span>" |
13 |
"[% d.public | html %]", |
14 |
[% ELSIF d.sortby == "copyrightdate" %] |
14 |
"dt_shelfname": |
15 |
"<span>Year</span>" |
15 |
"<a href='/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% d.shelfnumber | html %]'>[% d.shelfname | html | $To %]</a>", |
16 |
[% ELSIF d.sortby == "itemcallnumber" %] |
16 |
"dt_count": |
17 |
"<span>Call number</span>" |
17 |
"[% tnx('{count} item', '{count} items', count, { count = d.count }) | $raw %]", |
18 |
[% ELSIF d.sortby == "dateadded" %] |
18 |
"dt_is_shared": |
19 |
"<span>Date added</span>" |
19 |
"[% IF d.public %]<span>Public</span>[% ELSIF d.is_shared %]<span>Shared</span>[% ELSE %]<span>Private</span>[% END %]", |
20 |
[% ELSE %] |
20 |
"dt_owner": |
21 |
"<span>Title</span>" |
21 |
"<a href='/cgi-bin/koha/members/moremember.pl?borrowernumber=[% d.owner | html %]'>[% d.firstname | html | $To %] [% d.surname | html | $To %]</a>", |
22 |
[% END %], |
22 |
"dt_sortby": |
23 |
"dt_created_on": "[% d.created_on | $KohaDates %]", "dt_modification_time": "[% d.modification_time | $KohaDates %]", "dt_action": |
23 |
[% IF d.sortby == "author" %]"<span>Author</span>"[% ELSIF d.sortby == "copyrightdate" %]"<span>Year</span>"[% ELSIF d.sortby == "itemcallnumber" %]"<span>Call number</span>"[% ELSIF d.sortby == "dateadded" %]"<span>Date added</span>"[% ELSE %]"<span>Title</span>"[% END %], |
24 |
"[% PROCESS action_form shelfnumber=d.shelfnumber can_manage_shelf=d.can_manage_shelf can_delete_shelf=d.can_delete_shelf type=d.type %]" }[% UNLESS loop.last %],[% END %] |
24 |
"dt_created_on": |
25 |
[% END %] |
25 |
"[% d.created_on | $KohaDates %]", |
26 |
] } |
26 |
"dt_modification_time": |
|
|
27 |
"[% d.modification_time | $KohaDates %]", |
28 |
"dt_action": |
29 |
"[% PROCESS action_form shelfnumber=d.shelfnumber can_manage_shelf=d.can_manage_shelf can_delete_shelf=d.can_delete_shelf type=d.type %]" |
30 |
}[% UNLESS loop.last %],[% END %] |
31 |
[% END %] |
32 |
] |
33 |
} |
34 |
|
27 |
[% BLOCK action_form -%] |
35 |
[% BLOCK action_form -%] |
28 |
[%~ SET action_block = '' ~%] |
36 |
[%~ SET action_block = '' ~%] |
29 |
[%~ IF can_manage_shelf OR can_delete_shelf ~%] |
37 |
[%~ IF can_manage_shelf OR can_delete_shelf ~%] |
30 |
[%~ shelfnumber = shelfnumber | html ~%] |
38 |
[%~ shelfnumber = shelfnumber | html ~%] |
31 |
[%~ public = public | html ~%] |
39 |
[%~ public = public | html ~%] |
32 |
[%~ IF can_manage_shelf ~%] |
40 |
[%~ IF can_manage_shelf ~%] |
33 |
[%~ action_block = '<form action="shelves.pl" method="get">' ~%] |
41 |
[%~ action_block = '<form action="shelves.pl" method="get">' ~%] |
34 |
[%~ action_block = action_block _ '<input type="hidden" name="shelfnumber" value="' _ shelfnumber _ '" />' ~%] |
42 |
[%~ action_block = action_block _ '<input type="hidden" name="shelfnumber" value="' _ shelfnumber _ '" />' ~%] |
35 |
[%~ action_block = action_block _ '<input type="hidden" name="op" value="edit_form" />' ~%] |
43 |
[%~ action_block = action_block _ '<input type="hidden" name="op" value="edit_form" />' ~%] |
36 |
[%~ action_block = action_block _ '<input type="hidden" name="public" value="' _ public _ '" />' ~%] |
44 |
[%~ action_block = action_block _ '<input type="hidden" name="public" value="' _ public _ '" />' ~%] |
37 |
[%~ action_block = action_block _ '<input type="hidden" name="referer" value="list" />' ~%] |
45 |
[%~ action_block = action_block _ '<input type="hidden" name="referer" value="list" />' ~%] |
38 |
[%~ action_block = action_block _ '<button class="editshelf btn btn-default btn-xs"><i class="fa-solid fa-pencil" aria-hidden="true"></i> ' _ t("Edit") _ '</button>' ~%] |
46 |
[%~ action_block = action_block _ '<button class="editshelf btn btn-default btn-xs"><i class="fa-solid fa-pencil" aria-hidden="true"></i> ' _ t("Edit") _ '</button>' ~%] |
39 |
[%~ action_block = action_block _ '</form> ' ~%] |
47 |
[%~ action_block = action_block _ '</form> ' ~%] |
40 |
[%~ END ~%] |
|
|
41 |
[%~ IF can_delete_shelf ~%] |
42 |
[%~ action_block = action_block _ ' <form action="shelves.pl" method="post">' ~%] |
43 |
[%~ action_block = BLOCK ~%][%~ action_block | $raw ~%][%~ INCLUDE 'csrf-token.inc' | trim ~%][%~ END ~%] |
44 |
[%~ action_block = action_block _ '<input type="hidden" name="shelves" value="1" />' ~%] |
45 |
[%~ action_block = action_block _ '<input type="hidden" name="op" value="cud-delete" />' ~%] |
46 |
[%~ action_block = action_block _ '<input type="hidden" name="shelfnumber" value="' _ shelfnumber _ '" />' ~%] |
47 |
[%~ action_block = action_block _ '<input type="hidden" name="public" value="' _ public _ '" />' ~%] |
48 |
[%~ action_block = action_block _ '<input type="hidden" name="referer" value="list" />' ~%] |
49 |
[%~ action_block = action_block _ '<button type="submit" class="deleteshelf btn btn-default btn-xs"><i class="fa fa-trash-can"></i> ' _ t("Delete") _ '</button>' ~%] |
50 |
[%~ action_block = action_block _ '</form>' ~%] |
51 |
[%~ END ~%] |
52 |
[%~ IF public AND allow_transfer ~%] |
53 |
[%~ action_block = action_block _ ' <form action="shelves.pl" method="get">' ~%] |
54 |
[%~ action_block = action_block _ '<input type="hidden" name="shelves" value="1" />' ~%] |
55 |
[%~ action_block = action_block _ '<input type="hidden" name="op" value="transfer" />' ~%] |
56 |
[%~ action_block = action_block _ '<input type="hidden" name="shelfnumber" value="' _ shelfnumber _ '" />' ~%] |
57 |
[%~ action_block = action_block _ '<input type="hidden" name="public" value="1" />' ~%] |
58 |
[%~ action_block = action_block _ '<input type="hidden" name="referer" value="list" />' ~%] |
59 |
[%~ action_block = action_block _ '<button type="submit" class="btn btn-default btn-xs"><i class="fa"></i> ' _ t("Transfer") _ '</button>' ~%] |
60 |
[%~ action_block = action_block _ '</form>' ~%] |
61 |
[%~ END ~%] |
62 |
[%~ ELSE ~%] |
63 |
[%~ SET action_block = 'None' ~%] |
64 |
[%~ END ~%] |
48 |
[%~ END ~%] |
65 |
[%~ To.json(action_block) | $raw ~%] |
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="cud-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-can"></i> ' _ t("Delete") _ '</button>' ~%] |
58 |
[%~ action_block = action_block _ '</form>' ~%] |
59 |
[%~ END ~%] |
60 |
[%~ IF public AND allow_transfer ~%] |
61 |
[%~ action_block = action_block _ ' <form action="shelves.pl" method="get">' ~%] |
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> ' _ t("Transfer") _ '</button>' ~%] |
68 |
[%~ action_block = action_block _ '</form>' ~%] |
69 |
[%~ END ~%] |
70 |
[%~ ELSE ~%] |
71 |
[%~ SET action_block = 'None' ~%] |
72 |
[%~ END ~%] |
73 |
[%~ To.json(action_block) | $raw ~%] |
74 |
|
66 |
[%~ END ~%] |
75 |
[%~ END ~%] |
67 |
- |
|
|