Bugzilla – Attachment 23740 Details for
Bug 11433
Remove attachbasket op value in basket.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PATCH] Bug 11433 - Remove attachbasket op value in basket.pl and rename it in basketgroup.pl
0001-new.patch (text/plain), 6.55 KB, created by
Mathieu Saby
on 2013-12-20 22:36:43 UTC
(
hide
)
Description:
[PATCH] Bug 11433 - Remove attachbasket op value in basket.pl and rename it in basketgroup.pl
Filename:
MIME Type:
Creator:
Mathieu Saby
Created:
2013-12-20 22:36:43 UTC
Size:
6.55 KB
patch
obsolete
>From c244ecbb9a2ec30231ac1d88a9f5a33d565872ed Mon Sep 17 00:00:00 2001 >From: Mathieu Saby <mathieu.saby@univ-rennes2.fr> >Date: Fri, 20 Dec 2013 23:21:32 +0100 >Subject: [PATCH] Bug 11433 - Remove attachbasket op value in basket.pl and rename it in basketgroup.pl >Content-Type: text/plain; charset="utf-8" > >This patch cleans code in basket.pl, basketgroup.pl and basketgroup.tt >Not absolutely needed, but makes further improvements easier > >'attachbasket' is used in basket.pl and basketgroup.pl as a value of $op >In basket.pl, some code is supposed to be executed if $op eq 'attachbasket'. But it is never the case (grep attachbasket * -r), so this condition must be removed. >In basketgroup.pl, the description of 'attachbasket' value in comments is wrong, and the name is misleading (this value of $op is ONLY used when someone clic on 'Save' button on a basketgroup page). So 'attachbasket' should be renamed. > >This patch >- removes code related to 'attachbasket' in basket.pl >- rename 'attachbasket' to 'save' in basketgroup.pl and basketgroup.tt >- fixes some comments related to 'attachbasket' and 'mod_basket' in basketgroup.pl > >No functional change expected. >Regression test only : >Make a complete acquisition process, from the creation of a basket to the closure of a basketgroup, and check everything is OK >On a basket page, try to change the basketgroup it belongs to, and check everything is OK >On a basketgroup page, try to edit the content of a basketgroup (put a new basket in it, change the deliverybranch...), and check everything is OK >On a basketgroup page, try to reopen a closed basketgroup, and close an open basketgroup, and check everything is OK > >--- > acqui/basket.pl | 3 --- > acqui/basketgroup.pl | 15 ++++++--------- > .../prog/en/modules/acqui/basketgroup.tt | 2 +- > 3 files changed, 7 insertions(+), 13 deletions(-) > >diff --git a/acqui/basket.pl b/acqui/basket.pl >index 6833eb6..56fb415 100755 >--- a/acqui/basket.pl >+++ b/acqui/basket.pl >@@ -189,9 +189,6 @@ if ( $op eq 'delete_confirm' ) { > address3 => $bookseller->{'address3'}, > address4 => $bookseller->{'address4'}, > ); >-} elsif ($op eq 'attachbasket' && $template->{'VARS'}->{'CAN_user_acquisition_group_manage'} == 1) { >- print $query->redirect('/cgi-bin/koha/acqui/basketgroup.pl?basketno=' . $basket->{'basketno'} . '&op=attachbasket&booksellerid=' . $booksellerid); >- # check if we have to "close" a basket before building page > } elsif ($op eq 'export') { > print $query->header( > -type => 'text/csv', >diff --git a/acqui/basketgroup.pl b/acqui/basketgroup.pl >index 36c4462..ef66b50 100755 >--- a/acqui/basketgroup.pl >+++ b/acqui/basketgroup.pl >@@ -296,14 +296,14 @@ sub printbasketgrouppdf{ > my $op = $input->param('op') || 'display'; > # possible values of $op : > # - add : adds a new basketgroup, or edit an open basketgroup, or display a closed basketgroup >-# - mod_basket : modify an individual basket of the basketgroup >+# - mod_basket : puts a basket in the basketgroup and redirect to basket page (called from basket page) > # - validate : FIXME dead code > # - closeandprint : close and print an closed basketgroup in pdf. called by clicking on "Close and print" button in closed basketgroups list > # - print : print a closed basketgroup. called by clicking on "Print" button in closed basketgroups list > # - export : export in CSV a closed basketgroup. called by clicking on "Export" button in closed basketgroups list > # - delete : delete an open basketgroup. called by clicking on "Delete" button in open basketgroups list > # - reopen : reopen a closed basketgroup. called by clicking on "Reopen" button in closed basketgroup list >-# - attachbasket : save a modified basketgroup, or creates a new basketgroup when a basket is closed. called from basket page >+# - save : saves a modified or newly created basketgroup > # - display : display the list of all basketgroups for a vendor > my $booksellerid = $input->param('booksellerid'); > $template->param(booksellerid => $booksellerid); >@@ -380,7 +380,7 @@ if ( $op eq "add" ) { > displaybasketgroups($basketgroups, $bookseller, $baskets); > } elsif ($op eq 'mod_basket') { > # >-# edit an individual basket contained in this basketgroup >+# put a basket in the basketgroup and redirect to basket page (called from basket page) > # > my $basketno=$input->param('basketno'); > my $basketgroupid=$input->param('basketgroupid'); >@@ -470,9 +470,9 @@ if ( $op eq "add" ) { > ReOpenBasketgroup($basketgroupid); > my $redirectpath = ((defined $input->param('mode'))&& ($input->param('mode') eq 'singlebg')) ?'/cgi-bin/koha/acqui/basketgroup.pl?op=add&basketgroupid='.$basketgroupid.'&booksellerid='.$booksellerid : '/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=' .$booksellerid.'&listclosed=1'; > print $input->redirect($redirectpath); >-} elsif ( $op eq 'attachbasket') { >+} elsif ( $op eq 'save') { > # >-# save a modified basketgroup, or creates a new basketgroup when a basket is closed. called from basket page >+# saves a modified or newly created basketgroup > # > # Getting parameters > my $basketgroup = {}; >@@ -498,11 +498,8 @@ if ( $op eq "add" ) { > closed => $closedbg, > }; > ModBasketgroup($basketgroup); >- if($closedbg){ >-# FIXME >- } > }else{ >- # we create a new basketgroup (whith a closed basket) >+ # we create a new basketgroup > $basketgroup = { > name => $basketgroupname, > booksellerid => $booksellerid, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt >index 6aff7da..b828a1c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt >@@ -292,7 +292,7 @@ function submitForm(form) { > [% IF ( basketgroupid ) %] > <input type="hidden" name="basketgroupid" value="[% basketgroupid %]" /> > [% END %] >- <input type="hidden" name="op" value="attachbasket" /> >+ <input type="hidden" name="op" value="save" /> > <input type="submit" value="Save" /> <a href="/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=[% booksellerid %]" class="cancel">Cancel</a> > </fieldset> > [% END %] >-- >1.7.9.5 >
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 11433
:
23740
|
25367
|
27037
|
27648
|
27990
|
28024