From 8f0a4a0c7d173842d7c0d2644abff41bb54d7215 Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Wed, 4 Dec 2024 11:27:34 +0000 Subject: [PATCH] Bug 38010: Delete old code Signed-off-by: Michaela Sieber Signed-off-by: Jonathan Druart --- acqui/supplier.pl | 118 --- acqui/updatesupplier.pl | 163 ---- .../prog/en/modules/acqui/basket.tt | 4 +- .../prog/en/modules/acqui/booksellers.tt | 2 +- .../prog/en/modules/acqui/supplier.tt | 735 ------------------ .../en/modules/admin/marc_order_accounts.tt | 2 +- 6 files changed, 4 insertions(+), 1020 deletions(-) delete mode 100755 acqui/supplier.pl delete mode 100755 acqui/updatesupplier.pl delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt diff --git a/acqui/supplier.pl b/acqui/supplier.pl deleted file mode 100755 index 285a40f13ec..00000000000 --- a/acqui/supplier.pl +++ /dev/null @@ -1,118 +0,0 @@ -#!/usr/bin/perl - -# Copyright 2000-2002 Katipo Communications -# Copyright 2008-2009 BibLibre SARL -# Copyright 2010 PTFS Europe Ltd -# -# 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 3 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, see . - -=head1 NAME - -supplier.pl - -=head1 DESCRIPTION - -this script shows the details for a bookseller given on input arg. -It allows to edit & save information about this bookseller. - -=head1 CGI PARAMETERS - -=over 4 - -=item booksellerid - -To know the bookseller this script has to display details. - -=back - -=cut - -use Modern::Perl; -use C4::Auth qw( get_template_and_user ); -use C4::Contract qw( GetContracts GetContract ); -use C4::Output qw( output_html_with_http_headers ); -use CGI qw ( -utf8 ); - -use C4::Budgets; - -use Koha::Acquisition::Bookseller::Contacts; -use Koha::Acquisition::Booksellers; -use Koha::Acquisition::Currencies; - -my $query = CGI->new; -my $op = $query->param('op') || 'display'; -my ( $template, $loggedinuser, $cookie ) = get_template_and_user( - { - template_name => 'acqui/supplier.tt', - query => $query, - type => 'intranet', - flagsrequired => { acquisition => '*' }, - } -); -my $booksellerid = $query->param('booksellerid'); -my $supplier; -if ($booksellerid) { - $supplier = Koha::Acquisition::Booksellers->find($booksellerid); - my $supplier_hashref = $supplier->unblessed; - foreach ( keys %{$supplier_hashref} ) { - $template->{'VARS'}->{$_} = $supplier->$_; - } - $template->{VARS}->{contacts} = $supplier->contacts if $supplier->contacts->count; - $template->{'VARS'}->{'booksellerid'} = $booksellerid; -} - -$template->{VARS}->{contacts} ||= Koha::Acquisition::Bookseller::Contact->new; - -if ( $op eq 'display' ) { - my $contracts = GetContracts( { booksellerid => $booksellerid } ); - - $template->param( - active => $supplier->active, - tax_rate => $supplier->tax_rate + 0.0, - invoiceprice => $supplier->invoiceprice, - listprice => $supplier->listprice, - basketcount => $supplier->baskets->count, - subscriptioncount => $supplier->subscriptions->count, - vendor => $supplier, - contracts => $contracts, - ); -} elsif ( $op eq 'cud-delete' ) { - - # no further message needed for the user - # the DELETE button only appears in the template if basketcount == 0 AND subscriptioncount == 0 - if ( $supplier->baskets->count == 0 && $supplier->subscriptions->count == 0 ) { - Koha::Acquisition::Booksellers->find($booksellerid)->delete; - } - print $query->redirect('/cgi-bin/koha/acqui/acqui-home.pl'); - exit; -} else { - - # get option values from TaxRates syspref - my @gst_values = map { option => $_ + 0.0 }, split( '\|', C4::Context->preference("TaxRates") ); - - $template->param( - - # set active ON by default for supplier add (id empty for add) - active => $supplier ? $supplier->active : 1, - tax_rate => $supplier ? $supplier->tax_rate + 0.0 : 0, - vendor => $supplier, - gst_values => \@gst_values, - currencies => Koha::Acquisition::Currencies->search, - enter => 1, - ); -} - -output_html_with_http_headers $query, $cookie, $template->output; diff --git a/acqui/updatesupplier.pl b/acqui/updatesupplier.pl deleted file mode 100755 index 1d6e7578b40..00000000000 --- a/acqui/updatesupplier.pl +++ /dev/null @@ -1,163 +0,0 @@ -#!/usr/bin/perl - -#script to show suppliers and orders -#written by chris@katipo.co.nz 23/2/2000 - -# Copyright 2000-2002 Katipo Communications -# Copyright 2008-2009 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 3 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, see . - -=head1 NAME - -updatesupplier.pl - -=head1 DESCRIPTION - -this script allow to update or create (if id == 0) -a supplier. This script is called from acqui/supplier.pl. - -=head1 CGI PARAMETERS - -All information regarding this supplier are listed on input parameter. -Here is the list : - -supplier, id, company, company_postal, physical, company_phone, -physical, company_phone, company_fax, website, company_email, notes, -status, publishers_imprints, list_currency, gst, list_gst, invoice_gst, -discount, tax_rate, contact_name, contact_position, contact_phone, -contact_altphone, contact_fax, contact_email, contact_notes, -contact_claimacquisition, contact_claimissues, contact_acqprimary, -contact_serialsprimary. - -=cut - -use Modern::Perl; -use List::MoreUtils qw( any ); -use C4::Context; -use C4::Auth qw( checkauth ); - -use C4::Output; - -use Koha::Acquisition::Bookseller::Contacts; -use Koha::Acquisition::Booksellers; -use CGI qw ( -utf8 ); - -my $input = CGI->new; - -checkauth( $input, 0, { acquisition => 'vendors_manage' }, 'intranet' ); - -my $op = $input->param('op') // q{}; - -my $booksellerid = $input->param('booksellerid'); - -my $address = $input->param('physical'); -my @addresses = split( '\n', $address ); - -my %data; -$data{'id'} = $booksellerid; - -$data{'name'} = $input->param('company'); -$data{'postal'} = $input->param('company_postal'); -$data{'address1'} = $addresses[0]; -$data{'address2'} = $addresses[1]; -$data{'address3'} = $addresses[2]; -$data{'address4'} = $addresses[3]; -$data{'phone'} = $input->param('company_phone'); -$data{'accountnumber'} = $input->param('accountnumber'); -$data{'type'} = $input->param('vendor_type'); -$data{'fax'} = $input->param('company_fax'); -$data{'url'} = $input->param('website'); -$data{'notes'} = $input->param('notes'); -$data{'active'} = $input->param('status'); -$data{'listprice'} = $input->param('list_currency'); -$data{'invoiceprice'} = $input->param('invoice_currency'); -$data{'gstreg'} = $input->param('gst'); -$data{'listincgst'} = $input->param('list_gst'); -$data{'invoiceincgst'} = $input->param('invoice_gst'); -$data{'tax_rate'} = $input->param('tax_rate'); #have to transform this into fraction so it's easier to use -$data{'discount'} = $input->param('discount'); -$data{deliverytime} = $input->param('deliverytime'); -$data{'active'} = $input->param('status'); - -my @aliases = $input->multi_param('alias'); -my @contacts; -my %contact_info; - -foreach ( - qw(id name position phone altphone fax email notes orderacquisition claimacquisition claimissues acqprimary serialsprimary) - ) -{ - $contact_info{$_} = [ $input->multi_param( 'contact_' . $_ ) ]; -} - -for my $cnt ( 0 .. scalar( @{ $contact_info{'id'} } ) ) { - my %contact; - my $real_contact; - foreach ( - qw(id name position phone altphone fax email notes orderacquisition claimacquisition claimissues acqprimary serialsprimary) - ) - { - $contact{$_} = $contact_info{$_}->[$cnt]; - $real_contact = 1 if $contact{$_}; - } - push @contacts, \%contact if $real_contact; -} - -if ( $op eq 'cud-add' ) { - my $bookseller; - if ( $data{id} ) { - - # Update - $bookseller = Koha::Acquisition::Booksellers->find( $data{id} )->set( \%data )->store; - - # Delete existing contacts - $bookseller->contacts->delete; - } else { - - # Insert - delete $data{id}; # Remove the key if exists - $bookseller = Koha::Acquisition::Bookseller->new( \%data )->store; - $data{id} = $bookseller->id; - } - - # Insert contacts - for my $contact (@contacts) { - $contact->{booksellerid} = $data{id}; - Koha::Acquisition::Bookseller::Contact->new($contact)->store; - } - - # Insert aliases - $bookseller->aliases( [ map { { alias => $_ } } @aliases ] ); - - # Insert interfaces - my @interface_counters = $input->multi_param('interface_counter'); - my @interfaces; - for my $counter (@interface_counters) { - my $interface = {}; - for my $attr (qw(name type uri login password account_email notes)) { - my $v = $input->param("interface_${attr}_${counter}"); - $interface->{$attr} = $v; - } - push @interfaces, $interface if any { defined && length } values %$interface; - } - $bookseller->interfaces( \@interfaces ); - - #redirect to booksellers.pl - print $input->redirect( "booksellers.pl?booksellerid=" . $data{id} ); -} else { - print $input->redirect("supplier.pl?op=enter"); # fail silently. -} 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 a9d42e86f8d..973e45a10c6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt @@ -280,7 +280,7 @@ [% END %] - Go back to vendor page + Go back to vendor page [% ELSE %] Show baskets for vendor [% booksellername | html %] Show all active baskets @@ -304,7 +304,7 @@ [% END # /FOR m %] -

[% UNLESS ( basketno ) %]New[% END %]Basket [% basketname | html %] ([% basketno | html %]) for [% booksellername | html %]

+

[% UNLESS ( basketno ) %]New[% END %]Basket [% basketname | html %] ([% basketno | html %]) for [% booksellername | html %]

[% IF ( basketno ) %]
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 c0f7b532511..dcaafc95dda 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt @@ -80,7 +80,7 @@ [% SET h2_class="inactive" %] [% END %]

- + [% IF (supplier.name) %] [% supplier.name | html %] [% ELSE %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt deleted file mode 100644 index 2bfe717ff07..00000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt +++ /dev/null @@ -1,735 +0,0 @@ -[% USE raw %] -[% USE Koha %] -[% USE To %] -[% USE Asset %] -[% USE KohaDates %] -[% USE AuthorisedValues %] -[% PROCESS 'i18n.inc' %] -[% BLOCK edit_contact %] -
    - -
  1. -
  2. -
  3. -
  4. -
  5. -
  6. -
  7. -
-
-
-
- Acquisitions options -
    -
  1. - -
  2. -
  3. - -
  4. -
  5. - -
  6. -
-
-
-
-
- Serials options -
    -
  1. - -
  2. -
  3. - -
  4. -
-
-
-
- - [% IF contact.id %] -
- [% END %] -[% END %] - -[% BLOCK show_contact %] -

[% contact.name | html %]

-
    -
  1. Position: [% contact.position | html %]
  2. -
  3. Phone: [% contact.phone | html %]
  4. -
  5. Alternative phone: [% contact.altphone | html %]
  6. -
  7. Fax: [% contact.fax | html %]
  8. - [% IF ( contact.email ) %] -
  9. Email: [% contact.email | html %]
  10. - [% END %] - [% IF ( contact.notes ) %] -
  11. Notes: [% contact.notes | html %]
  12. - [% END %] - [% IF ( contact.acqprimary || contact.orderacquisition || contact.claimacquisition ) %] -
  13. - Acquisitions options: -
      - [% IF ( contact.acqprimary ) %] -
    1. Primary acquisitions contact
    2. - [% END %] - [% IF ( contact.orderacquisition ) %] -
    3. Receives orders
    4. - [% END %] - [% IF ( contact.claimacquisition ) %] -
    5. Receives claims for late orders
    6. - [% END %] -
    -
  14. - [% END %] - [% IF ( contact.serialsprimary || contact.claimissues ) %] -
  15. - Serials options: -
      - [% IF ( contact.serialsprimary ) %] -
    1. Primary serials contact
    2. - [% END %] - [% IF ( contact.claimissues ) %] -
    3. Receives claims for late issues
    4. - [% END %] -
    -
  16. - [% END %] -
-[% END %] - -[% SET footerjs = 1 %] -[% INCLUDE 'doc-head-open.inc' %] -[% FILTER collapse %] - [% IF ( enter ) %] - [% IF ( booksellerid ) %] - [% tx("Modify vendor '{vendor}'", { vendor = name }) | html %] - [% ELSE %] - [% t("Add vendor") | html %] - [% END %] - [% ELSE %] - [% tx("Vendor '{vendor}'", { vendor = name }) | html %] - [% END %] - › [% t("Acquisitions") | html %] › [% t("Koha") | html %] - [% END %] -[% INCLUDE 'doc-head-close.inc' %] - - - -[% WRAPPER 'header.inc' %] - [% INCLUDE 'acquisitions-search.inc' %] -[% END %] - -[% WRAPPER 'sub-header.inc' %] - [% WRAPPER breadcrumbs %] - [% WRAPPER breadcrumb_item %] - Acquisitions - [% END %] - [% IF ( enter ) %] - [% IF ( booksellerid ) %] - [% WRAPPER breadcrumb_item %] - [% name | html %] - [% END %] - [% WRAPPER breadcrumb_item bc_active= 1 %] - [% tx("Modify vendor '{vendor}'", { vendor = name }) | html %] - [% END %] - [% ELSE %] - [% WRAPPER breadcrumb_item bc_active= 1 %] - Add vendor - [% END %] - [% END %] - [% ELSE %] - [% WRAPPER breadcrumb_item bc_active= 1 %] - [% name | html %] - [% END %] - [% END # /IF (enter) %] - [% END #/ WRAPPER breadcrumbs %] -[% END #/ WRAPPER sub-header.inc %] - -[% WRAPPER 'main-container.inc' aside='vendor-menu' %] - - [% IF ( enter ) %] - [% INCLUDE 'messages.inc' %] - [% IF ( booksellerid ) %] -

Modify vendor '[% name | html %]'

- [% ELSE %] -

Add vendor

- [% END %] - [% END %] - [% UNLESS ( enter ) %][% INCLUDE 'acquisitions-toolbar.inc' %][% END %] - [% IF ( enter ) %] -
- - [% INCLUDE 'csrf-token.inc' %] -
- - [% IF ( booksellerid ) %] - - [% ELSE %] - [% SET a_href = '/cgi-bin/koha/acqui/acqui-home.pl' %] - [% END %] - Cancel -
- - -
- Company details -
  1. Required
  2. -
  3. -
  4. -
  5. -
  6. -
  7. -
  8. -
  9. - - [% PROCESS 'av-build-dropbox.inc' name="vendor_type", category="VENDOR_TYPE", default=type, empty=1, size = 20 %] -
  10. -
  11. - -
    -
  12. -
-
-
- Contacts -
- Contact details - [% INCLUDE edit_contact %] -
- [% FOREACH contact IN contacts %] -
- Contact details - [% INCLUDE edit_contact %] -
- [% END %] - -
- -
- Interfaces -
-
- -
- Ordering information -
  1. [% IF ( active ) %] - - - - - [% ELSE %] - - - - - [% END %]
  2. -
  3. - -
  4. -
  5. - -
  6. -
  7. [% IF ( gstreg ) %] - - - - - [% ELSE %] - - - - - [% END %]
  8. - -
  9. [% IF ( listincgst ) %] - - - - - [% ELSE %] - - - - - [% END %]
  10. - -
  11. [% IF ( invoiceincgst ) %] - - - - - [% ELSE %] - - - - - [% END %]
  12. - - [% IF gst_values %] -
  13. - - -
  14. - [% ELSE %] - - [% END %] -
  15. %
  16. -
  17. - - days -
  18. -
  19. -
-
-
- [% ELSE %] -

[% name | html %]

-
-
-
-

Vendor details

-
    -
  1. - Type: - [% IF (type) %][% AuthorisedValues.GetByCode( 'VENDOR_TYPE', type ) | html %][% END %] -
  2. -
  3. Company name: [% name | html %]
  4. -
  5. Postal address: [% postal | html %]
  6. -
  7. Physical address: [% address1 | html %][% address2 | html %][% address3 | html %][% address4 | html %]
  8. -
  9. Phone: [% phone | html %]
  10. -
  11. Fax: [% fax | html %]
  12. - [% IF ( url ) %] -
  13. Website: [% url | html %]
  14. - [% END %] - [% IF ( accountnumber ) %] -
  15. Account number: [% accountnumber | html %]
  16. - [% END %] - [% IF vendor.aliases.count %] -
  17. - Aliases: -
      - [% FOR alias IN vendor.aliases %] -
    • [% alias.alias | html %]
    • - [% END %] -
    -
  18. - [% END %] -
-
- - -
-

Ordering information

-
  • Vendor is: [% IF ( active ) %]Active[% ELSE %]Inactive[% END %]
  • -
  • List prices are: [% listprice | html %]
  • -
  • Invoice prices are: [% invoiceprice | html %]
  • - [% IF ( tax_rate ) %] -
  • Tax number registered: [% IF ( gstreg ) %]Yes[% ELSE %]No[% END %]
  • -
  • List item price includes tax: [% IF ( listincgst ) %]Yes[% ELSE %]No[% END %]
  • -
  • Invoice item price includes tax: [% IF ( invoiceincgst ) %]Yes[% ELSE %]No[% END %]
  • - [% END %] -
  • Discount: [% ( discount || 0 ) | format("%.1f" ) %] %
  • -
  • Tax rate: [% ( tax_rate || 0 ) * 100 | html %] %
  • - [% IF deliverytime.defined %] -
  • Delivery time: [% deliverytime | html %] days
  • - [% END %] - [% IF ( notes ) %] -
  • Notes: [% notes | html %]
  • - [% END %] -
    - - - [% IF vendor.interfaces.count %] -
    -

    Interfaces

    - - [% FOR i IN vendor.interfaces %] -

    [% i.name | html %]

    - [% IF i.type %] -
  • Type: [% AuthorisedValues.GetByCode( 'VENDOR_INTERFACE_TYPE', i.type) | html %]
  • - [% END %] - [% IF i.uri %] -
  • URI: [% i.uri | html %]
  • - [% END %] - [% IF i.login %] -
  • Login: [% i.login | html %]
  • - [% END %] - [% IF i.password %] -
  • Password: Show
  • - [% END %] - [% IF i.account_email %] -
  • Account email: [% i.account_email | html %]
  • - [% END %] - [% IF i.notes %] -
  • Notes: [% i.notes | html %]
  • - [% END %] - [% END %] -
    - [% END %] -
    - - -
    -
    -

    Contact

    - [% FOREACH contact IN contacts %] - [% INCLUDE show_contact %] - [% END %] -
    - - -
    -

    Subscription details

    -

    Number of subscriptions: - [% IF ( CAN_user_serials ) %] - [% subscriptioncount | html %] - [% ELSE %] - [% subscriptioncount | html %] - [% END %] -

    -
    - -
    - -
    - - - [% IF ( contracts ) %] -
    -

    Contract(s)

    - - - - - - - - [% IF CAN_user_acquisition_contracts_manage %] - - [% END %] - - - - [% FOREACH contract IN contracts %] - - - - - - [% IF CAN_user_acquisition_contracts_manage %] - - [% END %] - - [% END %] - -
    NameDescriptionStart dateEnd dateActions
    - [% contract.contractname | html %] - [% contract.contractdescription | html %][% contract.contractstartdate | $KohaDates %][% contract.contractenddate | $KohaDates %] - Edit - Delete -
    -
    - - [% END %] - [% END %] -[% END %] - -[% MACRO jsinclude BLOCK %] - [% Asset.js("js/acquisitions-menu.js") | $raw %] - [% Asset.js("js/acq.js") | $raw %] - [% INCLUDE 'datatables.inc' %] - [% Asset.js("js/vue/dist/islands.js", "init" => "1") | $raw %] - -[% END %] - -[% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_order_accounts.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_order_accounts.tt index 792a099f061..824dd9a0ac2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_order_accounts.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_order_accounts.tt @@ -58,7 +58,7 @@ [% FOREACH account IN accounts %] [% account.id | html %] - [% account.vendor.name | html %] + [% account.vendor.name | html %] [% account.budget.budget_name | html %] [% account.description | html %] [% account.download_directory | html %] -- 2.34.1