Browse Source

Bug 18581 - Add standard edit and delete buttons to suggestions list

This patch modifies the table of suggestions in the staff client, moving
the edit link to the standard last column and styling it correctly. A
delete button is added as well.

Unrelated change: I removed the column containing suggestionid because I
don't think it's human-relevant information.

To test, apply the patch and go to Acquisitions -> Suggestions.

- In each tab, the table of suggestions should have an unsorted last
  column containing "edit" and "delete" links which should be styled
  correctly and working correctly.
- On the detailed view of a suggestion, the "delete" button in the
  toolbar should still work correctly.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
17.11.x
Owen Leonard 7 years ago
committed by Jonathan Druart
parent
commit
9917d9cad1
  1. 34
      koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt

34
koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt

@ -18,11 +18,11 @@
</title>
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'calendar.inc' %]
[% IF ( op == 'show' ) %]
[% IF ( op == 'show' || op_else ) %]
<script type="text/javascript">
// <![CDATA[
$(document).ready(function(){
$("#deletesuggestion").on("click",function(){
$(".deletesuggestion").on("click",function(){
return confirm(_("Are you sure you want to delete this suggestion?"));
});
});
@ -53,7 +53,7 @@ $(document).ready(function() {
});
$(".sorted").dataTable($.extend(true, {}, dataTablesDefaults, {
"aoColumnDefs": [
{ "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
{ "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
{ "sType": "anti-the", "aTargets" : [ "anti-the" ] }
],
"sPaginationType": "four_button"
@ -204,7 +204,7 @@ h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o
<div id="toolbar" class="btn-toolbar">
<a class="btn btn-default btn-sm" id="editsuggestion" href="suggestion.pl?op=edit&amp;suggestionid=[% suggestionid %]"><i class="fa fa-pencil"></i> Edit</a>
<a class="btn btn-default btn-sm" id="deletesuggestion" href="suggestion.pl?op=delete&amp;edit_field=[% suggestionid %]"><i class="fa fa-trash"></i> Delete</a>
<a class="btn btn-default btn-sm deletesuggestion" href="suggestion.pl?op=delete&amp;edit_field=[% suggestionid %]"><i class="fa fa-trash"></i> Delete</a>
</div>
<fieldset class="rows">
@ -582,14 +582,16 @@ h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o
<p><a id="CheckAll[% suggestion.suggestiontype %]" href="#">Check all</a> | <a id="UncheckAll[% suggestion.suggestiontype %]" href="#">Uncheck all</a></p>
<table id="[% suggestion.suggestiontype %]t" class="sorted">
<thead>
<tr><th>&nbsp;</th>
<th>No.</th>
<th class="anti-the">Suggestion</th>
<th>Suggested by - on</th>
<th>Managed by - on</th>
<th>Library</th>
<th>Fund</th>
<th>Status</th></tr>
<tr>
<th class="NoSort">&nbsp;</th>
<th class="anti-the">Suggestion</th>
<th>Suggested by - on</th>
<th>Managed by - on</th>
<th>Library</th>
<th>Fund</th>
<th>Status</th>
<th class="NoSort">&nbsp;</th>
</tr>
</thead>
<tbody>
[% FOREACH suggestions_loo IN suggestion.suggestions_loop %]
@ -597,13 +599,9 @@ h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o
<td>
<input type="checkbox" name="edit_field" value="[% suggestions_loo.suggestionid %]" />
</td>
<td>
[% suggestions_loo.suggestionid %]
</td>
<td>
<a href="suggestion.pl?suggestionid=[% suggestions_loo.suggestionid %]&amp;op=show" title="suggestion" >
[% suggestions_loo.title |html %][% IF ( suggestions_loo.author ) %], by [% suggestions_loo.author %][% END %]</a>
[<a href="suggestion.pl?suggestionid=[% suggestions_loo.suggestionid %]&amp;op=edit" title="suggestion" >edit</a>]
<br />
[% IF ( suggestions_loo.copyrightdate ) %]&copy; [% suggestions_loo.copyrightdate |html %] [% END %]
[% IF ( suggestions_loo.volumedesc ) %]; Volume:<i>[% suggestions_loo.volumedesc |html %]</i> [% END %]
@ -644,6 +642,10 @@ h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o
<br />([% suggestions_loo.reason %])
[% END %]
</td>
<td class="actions">
<a class="btn btn-xs btn-default" href="suggestion.pl?suggestionid=[% suggestions_loo.suggestionid %]&amp;op=edit"><i class="fa fa-pencil"></i> Edit</a>
<a class="btn btn-default btn-xs deletesuggestion" href="suggestion.pl?op=delete&amp;edit_field=[% suggestions_loo.suggestionid %]"><i class="fa fa-trash"></i> Delete</a>
</td>
</tr>
[% END %]</tbody>
</table> <fieldset>

Loading…
Cancel
Save