Bugzilla – Attachment 95501 Details for
Bug 22784
Add the ability to archive purchase suggestions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22784: Add the ability to archive/unarchive a purchase suggestions
Bug-22784-Add-the-ability-to-archiveunarchive-a-pu.patch (text/plain), 4.33 KB, created by
Jonathan Druart
on 2019-11-18 11:09:09 UTC
(
hide
)
Description:
Bug 22784: Add the ability to archive/unarchive a purchase suggestions
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-11-18 11:09:09 UTC
Size:
4.33 KB
patch
obsolete
>From 2617427e4f3a1b5f65c110c75b8313ee224881fd Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 13 Nov 2019 16:34:56 +0100 >Subject: [PATCH] Bug 22784: Add the ability to archive/unarchive a purchase > suggestions > >There are performance issues when searching suggestions if there are >thousands of suggestions. >To prevent that we are going to add the ability to archive purchase >suggestions, in order to remove them from the search list (by default). > >Test plan: >0. Apply all the patches, execute the updatedatabase.pl script, restart >all >1. Create some suggestions >2. Search for them >3. Use the "Archive" action button for one of them >4. Restart the search >=> The archived suggestion does no longer appear in the list >5. Use the filter "Included archived" in the "Suggestion information" >filter box >=> The archived suggestion is now displayed >6. Use other filters >=> The "archived" filter is kept from one search to another >7. Use one of the action at the bottom of the suggestion list (change >the status for instance) >=> The "archived" filter is still kept > >Sponsored-by: BULAC - http://www.bulac.fr/ >--- > .../prog/en/modules/suggestion/suggestion.tt | 15 +++++++++++++-- > suggestion/suggestion.pl | 10 ++++++++++ > 2 files changed, 23 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >index 3e6ed544b3..cb45d0b3b1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >@@ -603,8 +603,19 @@ > [% END %] > </td> > <td class="actions"> >- <a class="btn btn-xs btn-default" href="suggestion.pl?suggestionid=[% suggestions_loo.suggestionid | html %]&op=edit"><i class="fa fa-pencil"></i> Edit</a> >- <a class="btn btn-default btn-xs deletesuggestion" href="suggestion.pl?op=delete&suggestionid=[% suggestions_loo.suggestionid | html %]"><i class="fa fa-trash"></i> Delete</a> >+ <div class="dropup"> >+ <div class="btn-group"> >+ <a class="btn btn-default btn-xs" role="button" href="suggestion.pl?suggestionid=[% suggestions_loo.suggestionid | html %]&op=edit"><i class="fa fa-pencil"></i> Edit</a><a class="btn btn-default btn-xs dropdown-toggle" id="more_actions_[% suggestions_loo.suggestionid | html %]" role="button" data-toggle="dropdown" href="#"><b class="caret"></b></a> >+ <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="more_actions_[% suggestions_loo.suggestionid | html %]"> >+ <li><a class="deletesuggestion" href="suggestion.pl?op=delete&suggestionid=[% suggestions_loo.suggestionid | html %]"><i class="fa fa-trash"></i> Delete</a></li> >+ [% UNLESS suggestions_loo.archived %] >+ <li><a class="archivesuggestion" href="suggestion.pl?op=archive&suggestionid=[% suggestions_loo.suggestionid | html %]"><i class="fa fa-archive"></i> Archive</a></li> >+ [% ELSE %] >+ <li><a class="unarchivesuggestion" href="suggestion.pl?op=unarchive&suggestionid=[% suggestions_loo.suggestionid | html %]"><i class="fa fa-archive"></i> Unarchive</a></li> >+ [% END %] >+ </ul> >+ </div> >+ </div> > </td> > </tr> > [% END %]</tbody> >diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl >index ff39b3daf9..1364c61b50 100755 >--- a/suggestion/suggestion.pl >+++ b/suggestion/suggestion.pl >@@ -290,6 +290,16 @@ elsif ($op eq "update_status" ) { > } > redirect_with_params($input); > } >+elsif ($op eq "archive" ) { >+ Koha::Suggestions->find($_)->update({ archived => 1 }) for @editsuggestions; >+ >+ redirect_with_params($input); >+} >+elsif ($op eq "unarchive" ) { >+ Koha::Suggestions->find($_)->update({ archived => 0 }) for @editsuggestions; >+ >+ redirect_with_params($input); >+} > elsif ( $op eq 'update_itemtype' ) { > my $new_itemtype = $input->param('suggestion_itemtype'); > foreach my $suggestionid (@editsuggestions) { >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 22784
:
95499
|
95500
|
95501
|
95502
|
95510
|
95511
|
95512
|
95513
|
95533
|
95534
|
95535
|
95536
|
95537
|
95538
|
96900
|
96901
|
96902
|
96903
|
96904
|
96905
|
100806
|
100807
|
100808
|
100809
|
100810
|
100811
|
100854
|
100855
|
100856
|
100857
|
100858
|
100859
|
101948
|
102779
|
102780
|
102781
|
102782
|
102783
|
102784
|
102785
|
102786
|
102944