Koha/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/rotatingCollections.tt
Owen Leonard e26c8efbdb Bug 8836 [Alt QA Followup] - Add confirmation dialog for deleting collections
The previous patch for adding a confirmation dialog didn't work to make
the confirmation message translatable. This alternate patch uses a
progressive-enhancement method recycled from Guided Reports to trigger a
warning and highlight the row which was clicked.

To test, apply the patch and try to delete an existing rotating
collection. You should get a confirmation dialog, and the corresponding
row in the table should be highlighted red.

Clicking cancel should cancel the deletion. Clicking OK should complete
the deletion.

To test the translatability of the confirmation message:

Run perl translate update [a language code, e.g. 'en-GB']
Search [lang]-i-staff-t-prog-v-3006000.po for the message string

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2014-11-06 15:12:20 -03:00

69 lines
3.2 KiB
Text

[% USE Branches %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Tools &rsaquo; Rotating collections</title>
[% INCLUDE 'doc-head-close.inc' %]
<script type="text/javascript">
$(document).ready(function(){
$(".confirmdelete").click(function(){
$(this).parents('tr').addClass("warn");
if(confirm(_("Are you sure you want to delete this collection?"))){
return true;
} else {
$(this).parents('tr').removeClass("warn");
return false;
}
});
});
</script>
</head>
<body id="rcoll_rotatingCollections" class="tools rcoll">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; Rotating collections</div>
<div id="doc3" class="yui-t2">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
[% INCLUDE 'rotating-collections-toolbar.inc' %]
<h1>Rotating collections</h1>
<div>
[% IF ( collectionsLoop ) %]
<table>
<tr>
<th>Title</th>
<th>Description</th>
<th>Current location</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
</tr>
[% FOREACH collectionsLoo IN collectionsLoop %]
<tr>
<td><a href="/cgi-bin/koha/rotating_collections/addItems.pl?colId=[% collectionsLoo.colId %]">[% collectionsLoo.colTitle %]</a></td>
<td>[% collectionsLoo.colDesc %]</td>
<td>[% Branches.GetName( collectionsLoo.colBranchcode ) %]</td>
<td><a href="/cgi-bin/koha/rotating_collections/addItems.pl?colId=[% collectionsLoo.colId %]">Add or remove items</a></td>
<td><a href="/cgi-bin/koha/rotating_collections/transferCollection.pl?colId=[% collectionsLoo.colId %]">Transfer</a></td>
<td><a href="/cgi-bin/koha/rotating_collections/editCollections.pl?action=edit&amp;colId=[% collectionsLoo.colId %]">Edit</a></td>
<td><a class="confirmdelete" href="/cgi-bin/koha/rotating_collections/editCollections.pl?action=delete&amp;colId=[% collectionsLoo.colId %]">Delete</a></td>
</tr>
[% END %]
</table>
[% ELSE %]
<div class="dialog message">There are no collections currently defined.</div>
[% END %]
</div>
</div> <!-- /.yui-b -->
</div> <!-- /#yui-main -->
<div class="yui-b">
[% INCLUDE 'tools-menu.inc' %]
</div>
</div> <!-- /#bd -->
[% INCLUDE 'intranet-bottom.inc' %]