Bugzilla – Attachment 95424 Details for
Bug 23590
Add the ability to change the manager of a suggestion and notify the new manager
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23590: Batch update manager for suggestions
Bug-23590-Batch-update-manager-for-suggestions.patch (text/plain), 6.56 KB, created by
Séverine Queune
on 2019-11-14 16:15:51 UTC
(
hide
)
Description:
Bug 23590: Batch update manager for suggestions
Filename:
MIME Type:
Creator:
Séverine Queune
Created:
2019-11-14 16:15:51 UTC
Size:
6.56 KB
patch
obsolete
>From 2e33ba3690fadd58cfd9e32023d295377127189d Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 6 Nov 2019 19:41:36 +0100 >Subject: [PATCH] Bug 23590: Batch update manager for suggestions >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> >--- > .../prog/en/modules/suggestion/suggestion.tt | 75 ++++++++++++++-------- > suggestion/suggestion.pl | 8 +++ > 2 files changed, 58 insertions(+), 25 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 d3acf68..8bf80a1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >@@ -652,13 +652,25 @@ > </fieldset> > </div> > >- <div class="col-sm-4"> >+ <div class="col-sm-2"> >+ <fieldset> >+ <label for="set_manager_[% loop.count %]">Update manager</label><br/> >+ <a id="edit_manager" class="new_window" href="#"><i class="fa fa-search"></i> Select manager</a> >+ <span id="managedby_name"></span> >+ <input type="hidden" name="suggestion_managedby" id="managedby" value="[% logged_in_user.borrowernumber | html %]" /> >+ <input type="hidden" name="branchcode" value="[% branchfilter | html %]" /> >+ <fieldset class="action"><button type="submit" class="btn btn-default btn-xs" value="update_manager"/>Submit</button></fieldset> >+ </fieldset> >+ </div> >+ >+ <div class="col-sm-2"> > <fieldset> > <label for="delete_[% loop.count %]">Delete selected</label> > <input type="hidden" name="branchcode" value="[% branchfilter | html %]" /> > <fieldset class="action"><button type="submit" class="btn btn-default btn-xs" value="delete"/>Delete</button></fieldset> > </fieldset> > </div> >+ > </div> > > [% ELSE %] >@@ -832,6 +844,36 @@ > > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'calendar.inc' %] >+ >+ <script type="text/javascript"> >+ function editManagerPopup() { >+ window.open("/cgi-bin/koha/admin/add_user_search.pl?selection_type=select", >+ 'PatronPopup', >+ 'width=740,height=450,location=yes,toolbar=no,' >+ + 'scrollbars=yes,resize=yes' >+ ); >+ } >+ function select_user(borrowernumber, borrower) { >+ $("#managedby_name").empty(); >+ $("#managedby").val(''); >+ var borrowername = borrower.firstname + ' ' + borrower.surname; >+ if (borrowernumber) { >+ var managerlink = '<a href="/cgi-bin/koha/members/moremember.pl' >+ + '?borrowernumber=' + borrowernumber + '">' >+ + borrowername + '</a>'; >+ $('#managedby_name').html(managerlink); >+ $('#managedby').val(borrowernumber); >+ } >+ } >+ >+ $(document).ready(function(){ >+ $("#edit_manager").on("click",function(e){ >+ e.preventDefault(); >+ editManagerPopup(); >+ }); >+ }); >+ </script> >+ > [% IF ( op == 'show' || op == 'else' ) %] > <script type="text/javascript"> > $(document).ready(function(){ >@@ -949,6 +991,12 @@ > return false; > } > } >+ } else if ( action == "update_manager" ) { >+ if ( $("#managedby").val() == "" ) { >+ alert(_("Please select a manager to assign to the selected suggestions")); >+ e.preventDefault(); >+ return false; >+ } > } > > $('<input />').attr('type', 'hidden') >@@ -963,26 +1011,6 @@ > [% IF op == 'save' %] > <script type="text/javascript"> > >- function editManagerPopup() { >- window.open("/cgi-bin/koha/admin/add_user_search.pl?selection_type=select", >- 'PatronPopup', >- 'width=740,height=450,location=yes,toolbar=no,' >- + 'scrollbars=yes,resize=yes' >- ); >- } >- function select_user(borrowernumber, borrower) { >- $("#managedby_name").empty(); >- $("#managedby").val(''); >- var borrowername = borrower.firstname + ' ' + borrower.surname; >- if (borrowernumber) { >- var managerlink = '<a href="/cgi-bin/koha/members/moremember.pl' >- + '?borrowernumber=' + borrowernumber + '">' >- + borrowername + '</a>'; >- $('#managedby_name').html(managerlink); >- $('#managedby').val(borrowernumber); >- } >- } >- > $(document).ready(function(){ > calcNewsuggTotal(); > $("#quantity,#price,#currency").on("change",function(){ >@@ -1007,10 +1035,6 @@ > $("#other_reason").hide(); > }); > >- $("#edit_manager").on("click",function(e){ >- e.preventDefault(); >- editManagerPopup(); >- }); > $("#restore_previous_manager").on("click",function(e){ > e.preventDefault(); > >@@ -1023,6 +1047,7 @@ > $('#managedby_name').html(managerlink); > $('#managedby').val([% managedby_patron.borrowernumber | html %]); > }); >+ > }); > </script> > [% END %] >diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl >index 50dfb4c..bcb6876 100755 >--- a/suggestion/suggestion.pl >+++ b/suggestion/suggestion.pl >@@ -262,6 +262,14 @@ elsif ( $op eq 'update_itemtype' ) { > } > redirect_with_params($input); > } >+elsif ( $op eq 'update_manager' ) { >+ my $managedby = $input->param('suggestion_managedby'); >+ foreach my $suggestionid (@editsuggestions) { >+ next unless $suggestionid; >+ &ModSuggestion({ suggestionid => $suggestionid, managedby => $managedby }); >+ } >+ redirect_with_params($input); >+} > elsif ( $op eq 'show' ) { > $suggestion_ref=&GetSuggestion($$suggestion_ref{'suggestionid'}); > my $budget = GetBudget $$suggestion_ref{budgetid}; >-- >2.1.4
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 23590
:
95162
|
95163
|
95164
|
95165
|
95166
|
95167
|
95168
|
95169
|
95317
|
95318
|
95319
|
95320
|
95321
|
95322
|
95323
|
95324
|
95398
|
95399
|
95407
|
95408
|
95420
|
95421
|
95422
|
95423
|
95424
|
95425
|
95426
|
95427
|
95428
|
95429
|
95430
|
95431
|
95487
|
95488
|
95489
|
95490
|
95491
|
95492
|
95493
|
95494
|
95495
|
95496
|
95497
|
95498
|
98119
|
98120
|
98121
|
98122
|
98123
|
98124
|
98126
|
98127
|
98128
|
98129
|
98130
|
98131
|
98240
|
98267
|
98268
|
98279
|
100788
|
100789
|
100790
|
100791
|
100792
|
100793
|
100794
|
100795
|
100796
|
100797
|
100798
|
100799
|
100800
|
100801
|
100802
|
100803
|
100804
|
100846
|
100847
|
100848
|
100849
|
100850
|
100851
|
100852
|
100853
|
101539
|
101548
|
101588
|
101589
|
101590
|
101591
|
101592
|
101593
|
101594
|
101595
|
101596
|
101597
|
101598
|
101599
|
101600
|
101601
|
101602
|
101603
|
101604
|
101605
|
101606
|
101695