Bugzilla – Attachment 28353 Details for
Bug 7162
Factorize code for order cancellation and add field for giving a reason
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7162; Factorize code for order cancellation (QA fixes)
Bug-7162-Factorize-code-for-order-cancellation-QA-.patch (text/plain), 6.26 KB, created by
Jonathan Druart
on 2014-05-20 11:50:48 UTC
(
hide
)
Description:
Bug 7162; Factorize code for order cancellation (QA fixes)
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-05-20 11:50:48 UTC
Size:
6.26 KB
patch
obsolete
>From 9850bd262d0aec85676ebc57111efe924451449c Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Tue, 20 May 2014 13:49:57 +0200 >Subject: [PATCH] Bug 7162; Factorize code for order cancellation (QA fixes) > >* Remove tab characters in acqui/addorder.pl >* Remove FIXME in acqui/cancelorder.pl >* Fix typos: "canceled" -> "cancelled", "occured" -> "occurred" >* Replace "Click here" link by "OK" >* Add a column to aqorders to store cancellation reason instead of > having it in aqorders.notes, to avoid having untranslatable strings in > database >--- > C4/Acquisition.pm | 9 ++------- > acqui/cancelorder.pl | 5 ----- > installer/data/mysql/kohastructure.sql | 1 + > installer/data/mysql/updatedatabase.pl | 11 +++++++++++ > koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt | 4 ++++ > koha-tmpl/intranet-tmpl/prog/en/modules/acqui/cancelorder.tt | 10 +++++----- > 6 files changed, 23 insertions(+), 17 deletions(-) > >diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm >index cce0a12..00123ef 100644 >--- a/C4/Acquisition.pm >+++ b/C4/Acquisition.pm >@@ -1841,19 +1841,14 @@ sub DelOrder { > SET datecancellationprinted=now(), orderstatus='cancelled' > "; > if($reason) { >- $query .= " >- , notes = IF(notes IS NULL, >- CONCAT('Cancellation reason: ', ?), >- CONCAT(notes, ' - Cancellation reason: ', ?) >- ) >- "; >+ $query .= ", cancellationreason = ? "; > } > $query .= " > WHERE biblionumber=? AND ordernumber=? > "; > my $sth = $dbh->prepare($query); > if($reason) { >- $sth->execute($reason, $reason, $bibnum, $ordernumber); >+ $sth->execute($reason, $bibnum, $ordernumber); > } else { > $sth->execute( $bibnum, $ordernumber ); > } >diff --git a/acqui/cancelorder.pl b/acqui/cancelorder.pl >index 0c24893..c45b8da 100755 >--- a/acqui/cancelorder.pl >+++ b/acqui/cancelorder.pl >@@ -33,11 +33,6 @@ use Modern::Perl; > use CGI; > use C4::Auth; > use C4::Output; >-# FIXME: C4::Search is needed by C4::Items::GetAnalyticsCount, which is called >-# by C4::Acquisition::DelOrder. But C4::Search is not imported by C4::Items. >-# Once this problem is resolved, the following line can be removed. >-# See Bug 7847. >-use C4::Search; > use C4::Acquisition; > > my $input = new CGI; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 92ab713..77744a8 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -3002,6 +3002,7 @@ CREATE TABLE `aqorders` ( -- information related to the basket line items > `quantityreceived` smallint(6) NOT NULL default 0, -- the quantity that have been received so far > `cancelledby` varchar(10) default NULL, -- not used? always NULL > `datecancellationprinted` date default NULL, -- the date the line item was deleted >+ `cancellationreason` text default NULL, -- reason of cancellation > `order_internalnote` mediumtext, -- notes related to this order line, made for staff > `order_vendornote` mediumtext, -- notes related to this order line, made for vendor > `supplierreference` mediumtext, -- not used? always NULL >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 421e772..9b7ec52 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -8471,6 +8471,17 @@ if ( CheckVersion($DBversion) ) { > SetVersion($DBversion); > } > >+$DBversion = "XXX"; >+if ( CheckVersion($DBversion) ) { >+ $dbh->do(" >+ ALTER TABLE aqorders >+ ADD COLUMN cancellationreason TEXT DEFAULT NULL AFTER datecancellationprinted >+ "); >+ print "Upgrade to $DBversion done (Bug 7162: Add aqorders.cancellationreason)\n"; >+ SetVersion($DBversion); >+} >+ >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >index ac58f19..056a92a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >@@ -595,6 +595,10 @@ > [% IF ( order.publishercode ) %], [% order.publishercode %][% END %] > [% IF ( order.publicationyear ) %], [% order.publicationyear %][% END %] > [% IF ( books_loo.editionstatement ) %], [% books_loo.editionstatement %][% END %] >+ [% IF ( order.cancellationreason ) %] >+ <br /> >+ Cancellation reason: [% order.cancellationreason %] >+ [% END %] > </p> > [% IF order.transferred_to %] > [% basket = order.transferred_to.basket %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/cancelorder.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/cancelorder.tt >index 4ac1f82..8df5f2c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/cancelorder.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/cancelorder.tt >@@ -41,18 +41,18 @@ > [% ELSE %] > [% IF ( success_cancelorder ) %] > <div class="dialog message"> >- The order has been successfully canceled >+ The order has been successfully cancelled > [% ELSE %] > <div class="dialog alert"> >- An error has occured. >+ An error has occurred. > [% IF ( error_delitem ) %] >- <p>The order has been canceled, although one or more items could not have been deleted.</p> >+ <p>The order has been cancelled, although one or more items could not have been deleted.</p> > [% END %] > [% IF ( error_delbiblio ) %] >- <p>The order has been canceled, although the record has not been deleted.</p> >+ <p>The order has been cancelled, although the record has not been deleted.</p> > [% END %] > [% END %] >- <p>Click <a href="[% referrer %]">here</a> to return to previous page</p> >+ <p><a href="[% referrer %]">OK</a></p> > </div> > [% END %] > >-- >2.0.0.rc2
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 7162
:
6219
|
7007
|
9148
|
9238
|
13224
|
13225
|
16373
|
16374
|
16409
|
16457
|
18455
|
18456
|
19315
|
21333
|
21334
|
21335
|
22719
|
22720
|
22721
|
24075
|
24076
|
24077
|
26235
|
26236
|
26237
|
28353
|
28558
|
28559
|
28560
|
28836
|
29535
|
29536
|
29661
|
29662
|
29663
|
29664
|
29665
|
29698
|
29889
|
29890
|
29891
|
29892
|
29893
|
29894
|
29918
|
29943
|
32895
|
32896
|
32897
|
32898
|
32899
|
32900
|
32902