Bugzilla – Attachment 7068 Details for
Bug 7166
Modify order notes when basket is closed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch
0001-Bug-7166-Adds-edit-order-notes-when-the-basket-is-cl.patch (text/plain), 10.86 KB, created by
Jonathan Druart
on 2012-01-06 11:40:10 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2012-01-06 11:40:10 UTC
Size:
10.86 KB
patch
obsolete
>From d0d4bc8a67f7b5195c46994c90b1396a6b8f18ec Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Fri, 6 Jan 2012 12:20:23 +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 | 5 ++ > .../intranet-tmpl/prog/en/modules/acqui/basket.tt | 17 +++-- > .../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, 147 insertions(+), 12 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 459dfe8..2075b92 100755 >--- a/acqui/neworderempty.pl >+++ b/acqui/neworderempty.pl >@@ -121,6 +121,11 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > } > ); > >+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 7bf1843..14b647b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >@@ -277,13 +277,18 @@ > <td> > <p>[% IF ( books_loo.order_received ) %] (rcvd)[% END %] > <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% books_loo.biblionumber %]">[% books_loo.title |html %]</a> 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 %] >+ <br /> >+ [% IF ( books_loo.notes ) %] >+ [% books_loo.notes|html %] - <a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% books_loo.ordernumber %]&referrer=/cgi-bin/koha/acqui/basket.pl%3Fbasketno=[% basketno %]">Change note</a> >+ [% ELSE %] >+ <a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% books_loo.ordernumber %]&referrer=/cgi-bin/koha/acqui/basket.pl%3Fbasketno=[% basketno %]">Add note</a> >+ [% 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 %] > </p> >- </td> >+ </td> > <td class="number">[% books_loo.rrp %]</td> > <td class="number">[% books_loo.ecost %]</td> > <td class="number">[% books_loo.quantity %]</td> >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' %] >+<title>Koha › Acquisition › Change order notes</title> >+[% INCLUDE 'doc-head-close.inc' %] >+<script type="text/javascript"> >+//<![CDATA[ >+function returnToReferrer() { >+ window.location.href = "[% referrer %]"; >+} >+//]]> >+</script> >+</head> >+ >+<body> >+[% INCLUDE 'header.inc' %] >+ >+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisition</a> › Change order notes</div> >+ >+<div id="doc3" class="yui-t2"> >+ >+<div id="bd"> >+ <div id="yui-main"> >+ <div class="yui-b"> >+ [% IF ( save ) %] >+ <p>Order [% ordernumber %] successfully modified.</p> >+ <p>Return to <a href="[% referrer %]">previous page</a></p> >+ [% ELSE %] >+ <h1>Change order notes (order no. [% ordernumber %])</h1> >+ >+ <form action="/cgi-bin/koha/acqui/modordernotes.pl" method="post"> >+ <fieldset> >+ <label for="ordernotes">Notes:</label> >+ <textarea id="ordernotes" name="ordernotes">[% ordernotes %]</textarea> >+ </fieldset> >+ <input type="hidden" name="referrer" value="[% referrer %]" /> >+ <input type="hidden" name="ordernumber" value="[% ordernumber %]" /> >+ <input type="hidden" name="op" value="save" /> >+ <fieldset class="action"> >+ <input type="submit" value="Change" /> >+ <input type="button" value="Cancel" onclick="returnToReferrer();" /> >+ </fieldset> >+ </form> >+ [% END %] >+ </div> >+ </div> >+</div> >+[% 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 d58582e..291f408 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >@@ -171,9 +171,9 @@ $(document).ready(function() > > [% IF ( basketno ) %] > <div id="acqui_basket_summary" class="yui-g"> >- <fieldset class="rows"> >+ <fieldset class="rows"> > <legend>Basket details</legend> >- <ol> >+ <ol> > [% IF ( basketnote ) %]<li><span class="label">Internal note:</span> [% basketnote %]</li>[% END %] > [% IF ( basketbooksellernote ) %]<li><span class="label">Vendor note:</span> [% basketbooksellernote %]</li>[% END %] > [% IF ( basketcontractno ) %] >@@ -199,12 +199,12 @@ $(document).ready(function() > <input type="hidden" value="mod_basket" name="op" /> > <input type="hidden" name="booksellerid" value="[% booksellerid %]" /> > </li> >- <fieldset class="action"><input type="submit" value="Change basketgroup" /></fieldset> >- </form> >+ <fieldset class="action"><input type="submit" value="Change basketgroup" /></fieldset> > [% END %] >+ </form> > [% END %] >- </ol> >-</fieldset> >+ </ol> >+ </fieldset> > </div> > [% 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 eb5492e..7f99a90 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt >@@ -241,6 +241,12 @@ > [% IF ( loop_order.author ) %] by [% loop_order.author %][% END %] > [% IF ( loop_order.isbn ) %] – [% loop_order.isbn %][% END %] > [% IF ( loop_order.publishercode ) %]<br />Publisher :[% loop_order.publishercode %][% END %] >+ <br /> >+ [% IF ( loop_order.notes ) %] >+ [% loop_order.notes|html %] - <a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% loop_order.ordernumber %]&referrer=/cgi-bin/koha/acqui/parcel.pl%3Fsupplierid=[% loop_order.supplierid %]&datereceived=[% loop_order.invoicedatereceived %]&invoice=[% loop_order.invoice %]">Change note</a> >+ [% ELSE %] >+ <a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% loop_order.ordernumber %]&referrer=/cgi-bin/koha/acqui/parcel.pl%3Fsupplierid=[% loop_order.supplierid %]&datereceived=[% loop_order.invoicedatereceived %]&invoice=[% loop_order.invoice %]">Add note</a> >+ [% END %] > </td> > <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% loop_order.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&id=[% loop_order.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">Card</a></td> > <td>[% loop_order.quantity %]</td> >-- >1.7.7.3 >
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 7166
:
7068
|
7736
|
7848
|
7887
|
7888
|
7889
|
7943
|
7950
|
7955
|
8289