From 02890d72f201be8ad7ec5fa70d7ef51952b96d1b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 17 Feb 2012 16:16:47 +0100 Subject: [PATCH 1/1] Bug 7166: Adds edit order notes when the basket is 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 diff --git a/acqui/modordernotes.pl b/acqui/modordernotes.pl new file mode 100755 index 0000000..1518ad4 --- /dev/null +++ b/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; diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl index f3d107d..e56ba77 100755 --- a/acqui/neworderempty.pl +++ b/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}); 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 59f647c..ce43f45 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt +++ b/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 %]

- + [% books_loo.rrp %] [% books_loo.ecost %] [% books_loo.quantity %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/modordernotes.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/modordernotes.tt new file mode 100644 index 0000000..ea205d7 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/modordernotes.tt @@ -0,0 +1,47 @@ +[% INCLUDE 'doc-head-open.inc' %] +Koha › Acquisition › Change order notes +[% INCLUDE 'doc-head-close.inc' %] + + + + +[% INCLUDE 'header.inc' %] + + + +
+ +
+
+
+ [% IF ( save ) %] +

Order [% ordernumber %] successfully modified.

+

Return to previous page

+ [% ELSE %] +

Change order notes (order no. [% ordernumber %])

+ +
+
+ + +
+ + + +
+ + +
+
+ [% END %] +
+
+
+[% INCLUDE 'intranet-bottom.inc' %] + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt index a27d151..51933e6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt @@ -170,9 +170,9 @@ $(document).ready(function() [% IF ( basketno ) %]
-
+
Basket details -
    +
      [% IF ( basketnote ) %]
    1. Internal note: [% basketnote %]
    2. [% END %] [% IF ( basketbooksellernote ) %]
    3. Vendor note: [% basketbooksellernote %]
    4. [% END %] [% IF ( basketcontractno ) %] @@ -198,12 +198,12 @@ $(document).ready(function() -
      - +
      [% END %] + [% END %] -
    -
+ +
[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt index afc9b65..7570663 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt @@ -246,6 +246,12 @@ Suggested by: [% loop_order.surnamesuggestedby %][% IF ( loop_order.firstnamesuggestedby ) %], [% loop_order.firstnamesuggestedby %] [% END %] (suggestion #[% loop_order.suggestionid %]) [% END %] +
+ [% IF ( loop_order.notes ) %] + [% loop_order.notes|html %] - Change note + [% ELSE %] + Add note + [% END %] MARC | Card [% loop_order.quantity %] -- 1.7.7.3