From 0b5cc8f809cddac09a234bb2b260c5b6bb433d33 Mon Sep 17 00:00:00 2001 From: Matthias Meusburger Date: Mon, 28 Dec 2009 11:21:49 +0100 Subject: [PATCH] MT2345 : Changes on contracts --- acqui/supplier.pl | 18 +++++++++++++ admin/aqcontract.pl | 4 +-- .../prog/en/includes/acquisitions-toolbar.inc | 1 - .../prog/en/modules/acqui/basket.tmpl | 2 +- .../prog/en/modules/acqui/supplier.tmpl | 26 +++++++++++++++++++ .../prog/en/modules/admin/aqcontract.tmpl | 11 -------- 6 files changed, 47 insertions(+), 15 deletions(-) diff --git a/acqui/supplier.pl b/acqui/supplier.pl index b8afe0d48d..42b23b038a 100755 --- a/acqui/supplier.pl +++ b/acqui/supplier.pl @@ -43,8 +43,10 @@ To know the bookseller this script has to display details. use strict; use C4::Auth; use C4::Acquisition; +use C4::Contract; use C4::Biblio; use C4::Output; +use C4::Dates qw/format_date /; use CGI; use C4::Bookseller; @@ -66,8 +68,23 @@ my ($template, $loggedinuser, $cookie) = get_template_and_user( ); my $GST = $booksellers[0]->{'gstrate'} || C4::Context->preference("gist"); $GST *= 100; + +my @contracts = GetContracts($id); +my $contractcount = scalar(@contracts); +$template->param(hascontracts => 1) if ($contractcount > 0); + #build array for currencies if ($op eq "display") { + + # get contracts + my @contracts = @{GetContract( { booksellerid => $id } )}; + + # format dates + for ( @contracts ) { + $$_{contractstartdate} = format_date($$_{contractstartdate}); + $$_{contractenddate} = format_date($$_{contractenddate}); + } + $template->param( id => $id, name => $booksellers[0]->{'name'}, @@ -97,6 +114,7 @@ if ($op eq "display") { listprice => $booksellers[0]->{'listprice'}, GST => $GST, basketcount => $booksellers[0]->{'basketcount'}, + contracts => \@contracts ); } elsif ($op eq 'delete') { diff --git a/admin/aqcontract.pl b/admin/aqcontract.pl index 9476f06464..f1cc17be0c 100755 --- a/admin/aqcontract.pl +++ b/admin/aqcontract.pl @@ -98,7 +98,7 @@ elsif ( $op eq 'add_validate' ) { }); } - print $input->redirect("aqcontract.pl?booksellerid=$booksellerid"); + print $input->redirect("/cgi-bin/koha/acqui/supplier.pl?supplierid=$booksellerid"); exit; # END $OP eq ADD_VALIDATE @@ -125,7 +125,7 @@ elsif ( $op eq 'delete_confirmed' ) { DelContract( { contractnumber => $contractnumber } ); - print $input->redirect("aqcontract.pl?booksellerid=$booksellerid"); + print $input->redirect("/cgi-bin/koha/acqui/supplier.pl?supplierid=$booksellerid"); exit; # END $OP eq DELETE_CONFIRMED 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 99c8c4b743..c3376fefc5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-toolbar.inc @@ -44,7 +44,6 @@
  • &op=enter">Edit
  • ">New Contract
  • -
  • ">Contracts
  • ">New Basket
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tmpl index 561ce9a9de..c04ad121ca 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tmpl @@ -143,7 +143,7 @@

    Vendor note:

    Contract number:

    -

    Contract name: ">

    +

    Contract name: &booksellerid=">

    Managed by:

    Open on:

    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tmpl index 8b6b026ace..61e1d252f9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tmpl @@ -202,6 +202,32 @@ if (f.company.value == "") {

    Notes:

    + + +

    Contract(s)

    + + + + + + + + + + + + + + + + + + +
    NameDescriptionStart dateEnd date 
    + &booksellerid="> + &booksellerid=">Edit&booksellerid=">Delete
    + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tmpl index ae85de202d..c9324c73de 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tmpl @@ -108,17 +108,6 @@ function Check(ff) {
  •   " />
  • -
  • - -
  •   " maxlength="10" size="10"/> /lib/calendar/cal.gif" id="contractstartdate_button" alt="Show Calendar" /> -- 2.39.5