[% USE KohaDates %]
+[% USE To %]
{
"sEcho": [% sEcho %],
"iTotalRecords": [% iTotalRecords %],
}
[% BLOCK action_form -%]
- [%- IF can_manage_shelf OR can_delete_shelf-%]
-[% IF can_manage_shelf %]<form action='shelves.pl' method='get'><input type='hidden' name='shelfnumber' value='[% shelfnumber %]' /><input type='hidden' name='op' value='modif' /><input type='submit' class='editshelf' value='Edit' /></form>[% END %][% IF can_manage_shelf OR can_delete_shelf %]<form action='shelves.pl' method='post'><input type='hidden' name='shelfoff' value='[% shelfoff %]' /><input type='hidden' name='shelves' value='1' /><input type='hidden' name='DEL-[% shelfnumber %]' value='1' /><input type='hidden' name='CONFIRM-[% shelfnumber %]' value='1' />[% IF type == 1 %]<input type='hidden' name='display' value='privateshelves' />[% ELSE %]<input type='hidden' name='display' value='publicshelves' />[% END %]<input type='submit' class='deleteshelf' onclick='return confirmDelete(MSG_CONFIRM_DELETE_LIST)' value='Delete' /></form>[% END %]
- [%- ELSE -%]
- None
- [%- END -%]
-[%- END %]
+[%~ 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="modif" />' ~%]
+ [%~ 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="DEL-' _ shelfnumber _ '" value="1" />' ~%]
+ [%~ action_block = action_block _ '<input type="hidden" name="CONFIRM-' _ shelfnumber _ '" value="1" />' ~%]
+ [%~ IF type == 1 ~%]
+ [%~ action_block = action_block _ '<input type="hidden" name="display" value="privateshelves" />' ~%]
+ [%~ ELSE ~%]
+ [%~ action_block = action_block _ '<input type="hidden" name="display" value="publicshelves" />' ~%]
+ [%~ END ~%]
+ [%~ 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 ~%]