From 81c90ba3bfd4ebd7795ba92e6c41b4a65ada15db Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 12 Oct 2012 15:55:16 -0400 Subject: [PATCH] Bug 8913 [Revised] Improve acquisitions navigation This patch adds a new menu for vendor-related pages in which vendor related "views" can be linked to: baskets, basket groups, contracts, invoices, uncertain prices. The acquisitions toolbar is pared down to vendor-related actions: New basket, contract, or vendor; edit vendor, delete vendor, receive shipment. Other small improvements have been made to other pages: corrections to breadcrumbs and title tags, adding useful links betweeen pages. Vendor menu and toolbar are added to booksellers.pl when there is only one "search result" (i.e. a vendor id is passed). - Menu appears when booksellerid variable is present - Redundant heading removed - Additional variables added to enable proper display of the toolbar - Revision corrects broken links pointed out by QA. - Revision adds check of existing baskets and subscriptions as a condition on display of the vendor delete button. TODO: Add coverage of Basket groups page. To test, navigate Acquisitions pages and test as many links and buttons as you can, confirming that nothing is broken on vendor pages, invoice pages, contract pages, uncertain price pages, etc. Signed-off-by: Nicole C. Engard All tests pass - I like this very much! Signed-off-by: Katrin Fischer All tests and QA script pass. Tests done: 1) New toolbar - vendor search - no results = button to create new vendor shows - 1 result = additional new options show - more than one result = button to create new vendor shows 2) Vendor views - acq toolbar consistent with 1 result in vendor search - new tabs on the left - checked all links have the needed parameters and work correctly 3) New toolbar - different pages - Toolbar is formatted consistently - Delete vendor shows only up when it should - no baskets or subscriptions - Links work correctly Works nicely, great groundwork for further improvements. TODO Add new toolbar to (new) invoices page. Signed-off-by: Jared Camins-Esakov --- acqui/booksellers.pl | 3 +- acqui/invoice.pl | 2 +- acqui/invoices.pl | 11 +-- acqui/uncertainprice.pl | 2 + admin/aqcontract.pl | 2 + .../prog/en/includes/acquisitions-toolbar.inc | 45 +++------- .../prog/en/includes/vendor-menu.inc | 15 ++++ .../prog/en/modules/acqui/basketheader.tt | 78 ++-------------- .../prog/en/modules/acqui/booksellers.tt | 7 +- .../prog/en/modules/acqui/invoice.tt | 2 +- .../prog/en/modules/acqui/invoices.tt | 14 +-- .../prog/en/modules/acqui/supplier.tt | 7 +- .../prog/en/modules/acqui/uncertainprice.tt | 89 +++++++++++-------- .../prog/en/modules/admin/aqcontract.tt | 33 +++---- 14 files changed, 130 insertions(+), 180 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/vendor-menu.inc diff --git a/acqui/booksellers.pl b/acqui/booksellers.pl index 1341dc10b0..f6c7b2e928 100755 --- a/acqui/booksellers.pl +++ b/acqui/booksellers.pl @@ -87,7 +87,8 @@ my $supplier_count = @suppliers; if ( $supplier_count == 1 ) { $template->param( supplier_name => $suppliers[0]->{'name'}, - booksellerid => $suppliers[0]->{'booksellerid'} + booksellerid => $suppliers[0]->{'id'}, + basketcount => $suppliers[0]->{'basketcount'} ); } diff --git a/acqui/invoice.pl b/acqui/invoice.pl index 6e6bb25138..1b6d97c72f 100755 --- a/acqui/invoice.pl +++ b/acqui/invoice.pl @@ -185,7 +185,7 @@ $template->param( invoiceid => $details->{'invoiceid'}, invoicenumber => $details->{'invoicenumber'}, suppliername => $details->{'suppliername'}, - supplierid => $details->{'booksellerid'}, + booksellerid => $details->{'booksellerid'}, datereceived => $details->{'datereceived'}, shipmentdate => $details->{'shipmentdate'}, billingdate => $details->{'billingdate'}, diff --git a/acqui/invoices.pl b/acqui/invoices.pl index b7f360e987..44589ab22d 100755 --- a/acqui/invoices.pl +++ b/acqui/invoices.pl @@ -50,7 +50,7 @@ my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( ); my $invoicenumber = $input->param('invoicenumber'); -my $supplier = $input->param('supplier'); +my $supplierid = $input->param('supplierid'); my $shipmentdatefrom = $input->param('shipmentdatefrom'); my $shipmentdateto = $input->param('shipmentdateto'); my $billingdatefrom = $input->param('billingdatefrom'); @@ -71,7 +71,7 @@ if ( $op and $op eq "do_search" ) { my $billingdateto_iso = C4::Dates->new($billingdateto)->output("iso"); my @invoices = GetInvoices( invoicenumber => $invoicenumber, - suppliername => $supplier, + supplierid => $supplierid, shipmentdatefrom => $shipmentdatefrom_iso, shipmentdateto => $shipmentdateto_iso, billingdatefrom => $billingdatefrom_iso, @@ -89,6 +89,7 @@ if ( $op and $op eq "do_search" ) { billingdate => $_->{billingdate}, invoicenumber => $_->{invoicenumber}, suppliername => $_->{suppliername}, + booksellerid => $_->{booksellerid}, receivedbiblios => $_->{receivedbiblios}, receiveditems => $_->{receiveditems}, subscriptionid => $_->{subscriptionid}, @@ -104,13 +105,13 @@ my @suppliers_loop = (); my $suppliername; foreach (@suppliers) { my $selected = 0; - if ( $supplier && $supplier == $_->{'id'} ) { + if ( $supplierid && $supplierid == $_->{'id'} ) { $selected = 1; $suppliername = $_->{'name'}; } my %row = ( suppliername => $_->{'name'}, - supplierid => $_->{'id'}, + booksellerid => $_->{'id'}, selected => $selected, ); push @suppliers_loop, \%row; @@ -138,7 +139,7 @@ $template->param( do_search => ( $op and $op eq "do_search" ) ? 1 : 0, results_loop => \@results_loop, invoicenumber => $invoicenumber, - supplier => $supplier, + booksellerid => $supplierid, suppliername => $suppliername, billingdatefrom => $billingdatefrom, billingdateto => $billingdateto, diff --git a/acqui/uncertainprice.pl b/acqui/uncertainprice.pl index 792b8af4dd..924f9bddea 100755 --- a/acqui/uncertainprice.pl +++ b/acqui/uncertainprice.pl @@ -127,6 +127,8 @@ $template->param( uncertainpriceorders => \@orders, booksellercontemail => $bookseller->{'contemail'}, booksellercontnotes => $bookseller->{'contnotes'}, booksellernotes => $bookseller->{'notes'}, + basketcount => $bookseller->{'basketcount'}, + subscriptioncount => $bookseller->{'subscriptioncount'}, owner => $owner, scriptname => "/cgi-bin/koha/acqui/uncertainprice.pl"); output_html_with_http_headers $input, $cookie, $template->output; diff --git a/admin/aqcontract.pl b/admin/aqcontract.pl index d744953d93..ab513e7fe6 100755 --- a/admin/aqcontract.pl +++ b/admin/aqcontract.pl @@ -51,6 +51,8 @@ $template->param( contractnumber => $contractnumber, booksellerid => $booksellerid, booksellername => $bookseller->{name}, + basketcount => $bookseller->{'basketcount'}, + subscriptioncount => $bookseller->{'subscriptioncount'}, ); #ADD_FORM: called if $op is 'add_form'. Used to create form to add or modify a record diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-toolbar.inc index 0c52cc2677..c0654fba1a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-toolbar.inc @@ -9,38 +9,20 @@ // YUI Toolbar Functions - function yuiToolbar() { - - new YAHOO.widget.Button("newperiod"); - new YAHOO.widget.Button("newbudget"); - new YAHOO.widget.Button("newsupplier"); - new YAHOO.widget.Button("newbasket"); + function yuiToolbar() { new YAHOO.widget.Button("editsupplier"); new YAHOO.widget.Button("deletesupplier"); new YAHOO.widget.Button("receive"); - new YAHOO.widget.Button("newcontract"); - new YAHOO.widget.Button("editcontracts"); + [% UNLESS ( booksellerid ) %]new YAHOO.widget.Button("newvendor");[% END %] - var manageorders = [ + var newmenu = [ [% IF ( CAN_user_acquisition_order_manage ) %] - [% IF (active) %] - { text: _("New basket"), url: "/cgi-bin/koha/acqui/basketheader.pl?booksellerid=[% booksellerid %]&op=add_form"}, - [% END %] - { text: _("Baskets"), url: "/cgi-bin/koha/acqui/booksellers.pl?booksellerid=[% booksellerid %]"}, - { text: _("Basket groups"), url: "/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=[% booksellerid %]"}, - [% END %] - { text: _("Receive shipments"), url: "/cgi-bin/koha/acqui/parcels.pl?booksellerid=[% booksellerid %]" }, - [% IF ( basketno ) %] - { text: _("Uncertain prices"), url: "/cgi-bin/koha/acqui/uncertainprice.pl?booksellerid=[% booksellerid %]&basketno=[% basketno %]&owner=1"} - [% ELSE %] - { text: _("Uncertain prices"), url: "/cgi-bin/koha/acqui/uncertainprice.pl?booksellerid=[% booksellerid %]&owner=1"} + { text: _("Basket"), url: "/cgi-bin/koha/acqui/basketheader.pl?booksellerid=[% booksellerid %]&op=add_form"}, [% END %] + [% IF ( CAN_user_acquisition_contracts_manage ) %]{ text: _("Contract"), url: "/cgi-bin/koha/admin/aqcontract.pl?op=add_form&booksellerid=[% booksellerid %]"},[% END %] + { text: _("Vendor"), url: "/cgi-bin/koha/acqui/supplier.pl?op=enter"} ] - [% IF ( booksellerid ) %] - [% IF ( basketcount ) %] - new YAHOO.widget.Button({type: "menu", label: _("Manage orders"), name: "manageorders", menu: manageorders, container: "toolbar-list"}); - [% END %] - [% END %] + new YAHOO.widget.Button({type: "menu", label: _("New"), name: "newmenu", menu: newmenu, container: "newmenuc"}); } //]]> @@ -48,18 +30,15 @@ diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/vendor-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/vendor-menu.inc new file mode 100644 index 0000000000..106221e203 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/vendor-menu.inc @@ -0,0 +1,15 @@ +[% IF ( booksellerid ) %] + +[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketheader.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketheader.tt index e1061dada4..07db14867e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketheader.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketheader.tt @@ -1,8 +1,8 @@ [% INCLUDE 'doc-head-open.inc' %] -Koha › +<title>Koha › Acquisitions › [% IF ( add_form ) %] [% IF ( basketno ) %]Edit basket '[% basketname %]' - [% ELSE %]add a basket to [% booksellername %] + [% ELSE %]Add a basket to [% booksellername %] [% END %] [% END %] @@ -28,61 +28,6 @@ function Check(ff) { } //]]> - - [% INCLUDE 'header.inc' %] @@ -94,18 +39,16 @@ li.list2 { [% booksellername %] › [% IF ( add_form ) %] [% IF ( basketno ) %]Edit basket '[% basketname %]' - [% ELSE %]add a basket to [% booksellername %] + [% ELSE %]Add a basket to [% booksellername %] [% END %] [% END %] -
+
- +
- -
- + [% IF ( add_form ) %] [% IF ( basketno ) %]

Edit basket [% basketname %]

@@ -126,7 +69,7 @@ li.list2 {
  • - +
  • - + + Cancel [% END %]
  • -
    - [% INCLUDE 'acquisitions-menu.inc' %] -
    -
    [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt index 4077b5db9c..b0e4549a32 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt @@ -47,9 +47,7 @@ $(document).ready(function() {
    [% INCLUDE 'acquisitions-toolbar.inc' %] -[% IF ( count == 1 ) %] -

    [% supplier_name %]

    -[% ELSE %] +[% UNLESS ( count == 1 ) %]

    You searched on vendor [% supplier %], [% count %] results found

    [% END %] [% IF ( loop_suppliers.size ) %] @@ -139,6 +137,9 @@ $(document).ready(function() {
    +[% IF ( booksellerid ) %] +[% INCLUDE 'vendor-menu.inc' %] +[% END %] [% INCLUDE 'acquisitions-menu.inc' %]
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt index 7b28b875d1..d357e18eda 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt @@ -40,7 +40,7 @@ [% END %]

    Invoice: [% invoicenumber %]

    -

    Supplier: [% suppliername %]

    +

    Supplier: [% suppliername %]

    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt index 21147e50d3..54e12ff1d4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt @@ -57,8 +57,8 @@ $(document).ready(function() { [% FOREACH result IN results_loop %] - [% result.invoicenumber %] - [% result.suppliername %] + [% result.invoicenumber %] + [% result.suppliername %] [% IF (result.billingdate) %] [% result.billingdate | $KohaDates %] @@ -76,9 +76,9 @@ $(document).ready(function() { Details / [% IF ( result.closedate ) %] - Reopen + Reopen [% ELSE %] - Close + Close [% END %] @@ -148,13 +148,13 @@ $(document).ready(function() {
  • - [% FOREACH supplier IN suppliers_loop %] [% IF ( supplier.selected ) %] - + [% ELSE %] - + [% END %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt index e4efa708de..51ec129f0e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt @@ -47,10 +47,11 @@ if (f.company.value == "") { -
    +
    +
    [% IF ( enter ) %] [% IF ( booksellerid ) %]

    Update: [% name %]

    @@ -282,6 +283,10 @@ if (f.company.value == "") { [% END %] +
    +
    +
    +[% INCLUDE 'vendor-menu.inc' %]
    [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt index 1b1f070543..7bbad51e14 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt @@ -1,5 +1,5 @@ [% INCLUDE 'doc-head-open.inc' %] -Koha › Orders with uncertain prices for Vendor [% booksellername %] +Koha › Acquisitions › [% IF ( booksellername ) %]Orders with uncertain prices for vendor [% booksellername %][% ELSE %]Orders with uncertain prices[% END %] [% INCLUDE 'doc-head-close.inc' %] @@ -30,41 +30,48 @@ function check(form) { [% INCLUDE 'header.inc' %] [% INCLUDE 'acquisitions-search.inc' %] - + -
    -
    -
    +
    + +
    +
    +
    + +[% INCLUDE 'acquisitions-toolbar.inc' %] [% IF ( validate ) %] [% ELSE %] -

    Orders with uncertain prices for vendor [% booksellername %] (edit)

    -

    Contact information

    -

    Address: - [% booksellerpostal %] - [% bookselleraddress1 %] - [% bookselleraddress2 %] - [% bookselleraddress3 %] - [% bookselleraddress4 %] - [% booksellerurl %] -

    -

    Phone: - [% booksellerphone %] / Fax: - [% booksellerfax %]

    -
    -
    Contact:
    -
    [% booksellercontact %] - [% booksellercontpos %] - [% booksellercontphone %] - [% booksellercontaltphone %] - [% booksellercontemail %] - [% booksellercontnotes %] -
    -
    - [% IF ( booksellernotes ) %] -

    Notes: - [% booksellernotes %]

    + [% IF ( booksellername ) %] +

    Orders with uncertain prices for vendor [% booksellername %]

    +

    Contact information

    +

    Address: + [% booksellerpostal %] + [% bookselleraddress1 %] + [% bookselleraddress2 %] + [% bookselleraddress3 %] + [% bookselleraddress4 %] + [% booksellerurl %] +

    +

    Phone: + [% booksellerphone %] / Fax: + [% booksellerfax %]

    +
    +
    Contact:
    +
    [% booksellercontact %] + [% booksellercontpos %] + [% booksellercontphone %] + [% booksellercontaltphone %] + [% booksellercontemail %] + [% booksellercontnotes %] +
    +
    + [% IF ( booksellernotes ) %] +

    Notes: + [% booksellernotes %]

    + [% END %] [% END %] +

    Orders with uncertain prices

    @@ -86,12 +93,12 @@ function check(form) { - - - - - - + + + + + + @@ -128,5 +135,11 @@ function check(form) {
    [% END %] + + + +
    +[% INCLUDE 'vendor-menu.inc' %] +
    -[% INCLUDE 'intranet-bottom.inc' %] +[% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tt index e723ed4338..969869ca54 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tt @@ -83,9 +83,13 @@ function Check(ff) { [% IF ( else ) %]Contracts[% END %] -
    +
    +
    -
    +
    +
    + +[% INCLUDE 'acquisitions-toolbar.inc' %] [% IF ( add_form ) %]
    @@ -161,23 +165,6 @@ function Check(ff) { [% END %] [% IF ( else ) %] -
    - - -

    Contract(s) of [% booksellername %]

    [% IF ( loop ) %]
    basketorderbyuncertainpricequantityBasketOrderByUncertainPriceQuantity
    @@ -202,9 +189,13 @@ function Check(ff) { [% END %]
    [% ELSE %] -
    There are no contracts with this vendor.
    +
    There are no contracts with this vendor. Add a contract.
    [% END %] [% END %] -
    +
    +
    +
    +[% INCLUDE 'vendor-menu.inc' %] +
    [% INCLUDE 'intranet-bottom.inc' %] -- 2.39.2