@@ -, +, @@ closed When you are on parcel.pl or basket.pl you can now add or edit a note for each order. To test: Create orders with and without note. Edit/Add the note on basket.pl page Close the basket. Check you can add/edit the order note on parcel.pl page --- acqui/modordernotes.pl | 72 ++++++++++++++++++++ acqui/neworderempty.pl | 6 ++ .../intranet-tmpl/prog/en/modules/acqui/basket.tt | 29 +++++--- .../prog/en/modules/acqui/modordernotes.tt | 47 +++++++++++++ .../prog/en/modules/acqui/neworderempty.tt | 12 ++-- .../intranet-tmpl/prog/en/modules/acqui/parcel.tt | 6 ++ 6 files changed, 154 insertions(+), 18 deletions(-) create mode 100755 acqui/modordernotes.pl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/acqui/modordernotes.tt --- a/acqui/modordernotes.pl +++ a/acqui/modordernotes.pl @@ -0,0 +1,72 @@ +#!/usr/bin/perl + +# Copyright 2011 BibLibre SARL +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with Koha; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +=head1 NAME + +modordernotes.pl + +=head1 DESCRIPTION + +Modify just notes when basket is closed. + +=cut + +use Modern::Perl; + +use CGI; +use C4::Auth; +use C4::Output; +use C4::Acquisition; + +my $input = new CGI; +my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( { + template_name => 'acqui/modordernotes.tmpl', + query => $input, + type => 'intranet', + authnotrequired => 0, + flagsrequired => { 'acquisition' => '*' }, + debug => 1, +} ); + +my $op = $input->param('op'); +my $ordernumber = $input->param('ordernumber'); +my $referrer = $input->param('referrer') || $input->referer(); + +my $order = GetOrder($ordernumber); + +if($op and $op eq 'save') { + my $ordernotes = $input->param('ordernotes'); + $order->{'notes'} = $ordernotes; + ModOrder($order); +} else { + $template->param( + ordernotes => $order->{'notes'}, + ); +} + +if($op) { + $template->param($op => 1); +} + +$template->param( + ordernumber => $ordernumber, + referrer => $referrer, +); + + +output_html_with_http_headers $input, $cookie, $template->output; --- a/acqui/neworderempty.pl +++ a/acqui/neworderempty.pl @@ -123,6 +123,12 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( ); my $marcflavour = C4::Context->preference('marcflavour'); + +if(!$basketno) { + my $order = GetOrder($ordernumber); + $basketno = $order->{'basketno'}; +} + my $basket = GetBasket($basketno); my $contract = &GetContract($basket->{contractnumber}); --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt @@ -278,19 +278,24 @@
[% IF ( books_loo.order_received ) %] (rcvd)[% END %]
[% books_loo.title |html %] by [% books_loo.author %]
- [% IF ( books_loo.notes ) %] [% books_loo.notes %][% END %]
- [% IF ( books_loo.isbn ) %] - [% books_loo.isbn %][% END %]
- [% IF ( books_loo.issn ) %] - [% books_loo.issn %][% END %]
- [% IF ( books_loo.publishercode ) %], [% books_loo.publishercode %][% END %]
- [% IF ( books_loo.publicationyear ) %], [% books_loo.publicationyear %][% END %]
- [% IF ( books_loo.suggestionid ) %]
-
- Suggested by: [% books_loo.surnamesuggestedby %][% IF ( books_loo.firstnamesuggestedby ) %], [% books_loo.firstnamesuggestedby %] [% END %]
- (suggestion #[% books_loo.suggestionid %])
- [% END %]
- [% IF ( books_loo.editionstatement ) %], [% books_loo.editionstatement %][% END %]
+
+ [% IF ( books_loo.notes ) %]
+ [% books_loo.notes|html %] - Change note
+ [% ELSE %]
+ Add note
+ [% END %]
+ [% IF ( books_loo.isbn ) %] - [% books_loo.isbn %][% END %]
+ [% IF ( books_loo.issn ) %] - [% books_loo.issn %][% END %]
+ [% IF ( books_loo.publishercode ) %], [% books_loo.publishercode %][% END %]
+ [% IF ( books_loo.publicationyear ) %], [% books_loo.publicationyear %][% END %]
+ [% IF ( books_loo.suggestionid ) %]
+
+ Suggested by: [% books_loo.surnamesuggestedby %][% IF ( books_loo.firstnamesuggestedby ) %], [% books_loo.firstnamesuggestedby %] [% END %]
+ (suggestion #[% books_loo.suggestionid %])
+ [% END %]
+ [% IF ( books_loo.editionstatement ) %], [% books_loo.editionstatement %][% END %]
Order [% ordernumber %] successfully modified.
+Return to previous page
+ [% ELSE %] +