Bugzilla – Attachment 8289 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]
Bug 7166: Adds edit order notes when the basket is closed
0001-Bug-7166-Adds-edit-order-notes-when-the-basket-is-cl.patch (text/plain), 13.82 KB, created by
Jonathan Druart
on 2012-03-19 14:50:46 UTC
(
hide
)
Description:
Bug 7166: Adds edit order notes when the basket is closed
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2012-03-19 14:50:46 UTC
Size:
13.82 KB
patch
obsolete
>From 554937c10d4508c1fa5c1dc4b93bf1cc84703b45 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Mon, 19 Mar 2012 15:50:01 +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 > >+ From Owen: >Correcting markup issues with modordernotes.pl: > >- Adding "rows" and "cols" attributes to <textarea> (required) >- Converting cancel button to link to stay consistent with > other pages >- Changing page layout to fixed & centered (not sidebar needed) >- Expanding information in breadcrumbs to match information > on basket.pl > >Changing markup around note add and edit links: Moving output >of order note to the end of the table cell, putting it in its >own paragraph, and adding a "Note:" label >--- > C4/Acquisition.pm | 5 +- > acqui/modordernotes.pl | 82 ++++++++++++++++++++ > acqui/neworderempty.pl | 6 ++ > .../intranet-tmpl/prog/en/modules/acqui/basket.tt | 29 ++++--- > .../prog/en/modules/acqui/modordernotes.tt | 32 ++++++++ > .../prog/en/modules/acqui/neworderempty.tt | 12 ++-- > .../intranet-tmpl/prog/en/modules/acqui/parcel.tt | 6 ++ > 7 files changed, 152 insertions(+), 20 deletions(-) > create mode 100755 acqui/modordernotes.pl > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/acqui/modordernotes.tt > >diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm >index 0a96a02..15a68ea 100644 >--- a/C4/Acquisition.pm >+++ b/C4/Acquisition.pm >@@ -714,8 +714,9 @@ sub GetPendingOrders { > my $dbh = C4::Context->dbh; > my $strsth = " > SELECT ".($grouped?"count(*),":"")."aqbasket.basketno, >- surname,firstname,aqorders.*,biblio.*,biblioitems.isbn, >- aqbasket.closedate, aqbasket.creationdate, aqbasket.basketname >+ surname,firstname,biblio.*,biblioitems.isbn, >+ aqbasket.closedate, aqbasket.creationdate, aqbasket.basketname, >+ aqorders.* > FROM aqorders > LEFT JOIN aqbasket ON aqbasket.basketno=aqorders.basketno > LEFT JOIN borrowers ON aqbasket.authorisedby=borrowers.borrowernumber >diff --git a/acqui/modordernotes.pl b/acqui/modordernotes.pl >new file mode 100755 >index 0000000..ffdc9f6 >--- /dev/null >+++ b/acqui/modordernotes.pl >@@ -0,0 +1,82 @@ >+#!/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; >+use C4::Bookseller qw( GetBookSellerFromId); >+ >+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); >+my $basket = GetBasket($order->{basketno}); >+my ($bookseller) = GetBookSellerFromId($basket->{booksellerid}); >+ >+ >+if($op and $op eq 'save') { >+ my $ordernotes = $input->param('ordernotes'); >+ $order->{'notes'} = $ordernotes; >+ ModOrder($order); >+ print $input->redirect($referrer); >+ exit; >+} else { >+ $template->param( >+ ordernotes => $order->{'notes'}, >+ ); >+} >+ >+if($op) { >+ $template->param($op => 1); >+} >+ >+$template->param( >+ basketname => $basket->{'basketname'}, >+ basketno => $order->{basketno}, >+ booksellerid => $bookseller->{'id'}, >+ booksellername => $bookseller->{'name'}, >+ ordernumber => $ordernumber, >+ referrer => $referrer, >+); >+ >+ >+output_html_with_http_headers $input, $cookie, $template->output; >diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl >index 7fee382..1e33a1a 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 88578b2..bad45e0 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 @@ > <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 %] >- [% IF ( books_loo.suggestionid ) %] >- <br/> >- Suggested by: [% books_loo.surnamesuggestedby %][% IF ( books_loo.firstnamesuggestedby ) %], [% books_loo.firstnamesuggestedby %] [% END %] >- (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% books_loo.suggestionid %]&op=show">suggestion #[% books_loo.suggestionid %]</a>) >- [% END %] >- [% IF ( books_loo.editionstatement ) %], [% books_loo.editionstatement %][% END %] >+ <br /> >+ [% 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.editionstatement ) %], [% books_loo.editionstatement %][% END %] >+ [% IF ( books_loo.suggestionid ) %] >+ <br/> >+ Suggested by: [% books_loo.surnamesuggestedby %][% IF ( books_loo.firstnamesuggestedby ) %], [% books_loo.firstnamesuggestedby %] [% END %] >+ (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% books_loo.suggestionid %]&op=show">suggestion #[% books_loo.suggestionid %]</a>) >+ [% END %] >+ [% IF ( books_loo.notes ) %] >+ <p class="ordernote"><strong>Note: </strong>[% books_loo.notes|html %] [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% books_loo.ordernumber %]">Change note</a>]</p> >+ [% ELSE %] >+ [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% books_loo.ordernumber %]">Add note</a>] >+ [% 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..f931ad1 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/modordernotes.tt >@@ -0,0 +1,32 @@ >+[% INCLUDE 'doc-head-open.inc' %] >+<title>Koha › Acquisition › Change order notes</title> >+[% INCLUDE 'doc-head-close.inc' %] >+</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> › <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% booksellername|html %]</a> › <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]">Basket [% basketname|html %] ([% basketno %])</a> › Change order notes</div> >+ >+<div id="doc" class="yui-t7"> >+ >+<div id="bd"> >+ <div id="yui-main"> >+ <h1>Change order notes (order no. [% ordernumber %])</h1> >+ <form action="/cgi-bin/koha/acqui/modordernotes.pl" method="post"> >+ <fieldset class="brief"> >+ <label for="ordernotes">Notes:</label> >+ <textarea id="ordernotes" name="ordernotes" rows="3" cols="30">[% 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="Save" /> >+ <a class="cancel" href="[% referrer %]">Cancel</a> >+ </fieldset> >+ </form> >+ </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 e6464f2..26a53bb 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 ) %] > <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 ) %] >@@ -198,12 +198,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 786c5be..02e1769 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 %] > (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% loop_order.suggestionid %]&op=show">suggestion #[% loop_order.suggestionid %]</a>) > [% END %] >+ <br /> >+ [% IF ( loop_order.notes ) %] >+ <p class="ordernote"><strong>Note: </strong>[% loop_order.notes|html %] [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% loop_order.ordernumber %]&referrer=/cgi-bin/koha/acqui/parcel.pl%3Fbooksellerid=[% loop_order.booksellerid %]&datereceived=[% loop_order.invoicedatereceived %]&invoice=[% loop_order.invoice %]">Change note</a>]</p> >+ [% ELSE %] >+ [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% loop_order.ordernumber %]&referrer=/cgi-bin/koha/acqui/parcel.pl%3Fbooksellerid=[% loop_order.booksellerid %]&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