View | Details | Raw Unified | Return to bug 38010
Collapse All | Expand All

(-)a/acqui/supplier.pl (-117 lines)
Lines 1-117 Link Here
1
#!/usr/bin/perl
2
3
# Copyright 2000-2002 Katipo Communications
4
# Copyright 2008-2009 BibLibre SARL
5
# Copyright 2010 PTFS Europe Ltd
6
#
7
# This file is part of Koha.
8
#
9
# Koha is free software; you can redistribute it and/or modify it
10
# under the terms of the GNU General Public License as published by
11
# the Free Software Foundation; either version 3 of the License, or
12
# (at your option) any later version.
13
#
14
# Koha is distributed in the hope that it will be useful, but
15
# WITHOUT ANY WARRANTY; without even the implied warranty of
16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
# GNU General Public License for more details.
18
#
19
# You should have received a copy of the GNU General Public License
20
# along with Koha; if not, see <http://www.gnu.org/licenses>.
21
22
=head1 NAME
23
24
supplier.pl
25
26
=head1 DESCRIPTION
27
28
this script shows the details for a bookseller given on input arg.
29
It allows to edit & save information about this bookseller.
30
31
=head1 CGI PARAMETERS
32
33
=over 4
34
35
=item booksellerid
36
37
To know the bookseller this script has to display details.
38
39
=back
40
41
=cut
42
43
use Modern::Perl;
44
use C4::Auth qw( get_template_and_user );
45
use C4::Contract qw( GetContracts GetContract );
46
use C4::Output qw( output_html_with_http_headers );
47
use CGI qw ( -utf8 );
48
49
use C4::Budgets;
50
51
use Koha::Acquisition::Bookseller::Contacts;
52
use Koha::Acquisition::Booksellers;
53
use Koha::Acquisition::Currencies;
54
55
my $query    = CGI->new;
56
my $op = $query->param('op') || 'display';
57
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
58
    {   template_name   => 'acqui/supplier.tt',
59
        query           => $query,
60
        type            => 'intranet',
61
        flagsrequired   => { acquisition => '*' },
62
    }
63
);
64
my $booksellerid       = $query->param('booksellerid');
65
my $supplier;
66
if ($booksellerid) {
67
    $supplier = Koha::Acquisition::Booksellers->find( $booksellerid );
68
    my $supplier_hashref = $supplier->unblessed;
69
    foreach ( keys %{$supplier_hashref} ) {
70
        $template->{'VARS'}->{$_} = $supplier->$_;
71
    }
72
    $template->{VARS}->{contacts} = $supplier->contacts if $supplier->contacts->count;
73
    $template->{'VARS'}->{'booksellerid'} = $booksellerid;
74
}
75
76
$template->{VARS}->{contacts} ||= Koha::Acquisition::Bookseller::Contact->new;
77
78
if ( $op eq 'display' ) {
79
    my $contracts = GetContracts( { booksellerid => $booksellerid } );
80
81
    $template->param(
82
        active        => $supplier->active,
83
        tax_rate      => $supplier->tax_rate + 0.0,
84
        invoiceprice  => $supplier->invoiceprice,
85
        listprice     => $supplier->listprice,
86
        basketcount   => $supplier->baskets->count,
87
        subscriptioncount => $supplier->subscriptions->count,
88
        vendor        => $supplier,
89
        contracts     => $contracts,
90
    );
91
} elsif ( $op eq 'cud-delete' ) {
92
    # no further message needed for the user
93
    # the DELETE button only appears in the template if basketcount == 0 AND subscriptioncount == 0
94
    if ( $supplier->baskets->count == 0 && $supplier->subscriptions->count == 0) {
95
        Koha::Acquisition::Booksellers->find($booksellerid)->delete;
96
    }
97
    print $query->redirect('/cgi-bin/koha/acqui/acqui-home.pl');
98
    exit;
99
} else {
100
101
    # get option values from TaxRates syspref
102
    my @gst_values = map {
103
        option => $_ + 0.0
104
    }, split( '\|', C4::Context->preference("TaxRates") );
105
106
    $template->param(
107
        # set active ON by default for supplier add (id empty for add)
108
        active     => $supplier ? $supplier->active         : 1,
109
        tax_rate   => $supplier ? $supplier->tax_rate + 0.0 : 0,
110
        vendor        => $supplier,
111
        gst_values    => \@gst_values,
112
        currencies    => Koha::Acquisition::Currencies->search,
113
        enter         => 1,
114
    );
115
}
116
117
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/acqui/updatesupplier.pl (-163 lines)
Lines 1-163 Link Here
1
#!/usr/bin/perl
2
3
#script to show suppliers and orders
4
#written by chris@katipo.co.nz 23/2/2000
5
6
# Copyright 2000-2002 Katipo Communications
7
# Copyright 2008-2009 BibLibre SARL
8
#
9
# This file is part of Koha.
10
#
11
# Koha is free software; you can redistribute it and/or modify it
12
# under the terms of the GNU General Public License as published by
13
# the Free Software Foundation; either version 3 of the License, or
14
# (at your option) any later version.
15
#
16
# Koha is distributed in the hope that it will be useful, but
17
# WITHOUT ANY WARRANTY; without even the implied warranty of
18
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
# GNU General Public License for more details.
20
#
21
# You should have received a copy of the GNU General Public License
22
# along with Koha; if not, see <http://www.gnu.org/licenses>.
23
24
=head1 NAME
25
26
updatesupplier.pl
27
28
=head1 DESCRIPTION
29
30
this script allow to update or create (if id == 0)
31
a supplier. This script is called from acqui/supplier.pl.
32
33
=head1 CGI PARAMETERS
34
35
All informations regarding this supplier are listed on input parameter.
36
Here is the list :
37
38
supplier, id, company, company_postal, physical, company_phone,
39
physical, company_phone, company_fax, website, company_email, notes,
40
status, publishers_imprints, list_currency, gst, list_gst, invoice_gst,
41
discount, tax_rate, contact_name, contact_position, contact_phone,
42
contact_altphone, contact_fax, contact_email, contact_notes,
43
contact_claimacquisition, contact_claimissues, contact_acqprimary,
44
contact_serialsprimary.
45
46
=cut
47
48
use Modern::Perl;
49
use List::MoreUtils qw( any );
50
use C4::Context;
51
use C4::Auth qw( checkauth );
52
53
use C4::Output;
54
55
use Koha::Acquisition::Bookseller::Contacts;
56
use Koha::Acquisition::Booksellers;
57
use CGI qw ( -utf8 );
58
59
my $input = CGI->new;
60
61
checkauth( $input, 0, { acquisition => 'vendors_manage' }, 'intranet' );
62
63
my $op = $input->param('op') // q{};
64
65
my $booksellerid = $input->param('booksellerid');
66
67
my $address   = $input->param('physical');
68
my @addresses = split( '\n', $address );
69
70
my %data;
71
$data{'id'} = $booksellerid;
72
73
$data{'name'}          = $input->param('company');
74
$data{'postal'}        = $input->param('company_postal');
75
$data{'address1'}      = $addresses[0];
76
$data{'address2'}      = $addresses[1];
77
$data{'address3'}      = $addresses[2];
78
$data{'address4'}      = $addresses[3];
79
$data{'phone'}         = $input->param('company_phone');
80
$data{'accountnumber'} = $input->param('accountnumber');
81
$data{'type'}          = $input->param('vendor_type');
82
$data{'fax'}           = $input->param('company_fax');
83
$data{'url'}           = $input->param('website');
84
$data{'notes'}         = $input->param('notes');
85
$data{'active'}        = $input->param('status');
86
$data{'listprice'}     = $input->param('list_currency');
87
$data{'invoiceprice'}  = $input->param('invoice_currency');
88
$data{'gstreg'}        = $input->param('gst');
89
$data{'listincgst'}    = $input->param('list_gst');
90
$data{'invoiceincgst'} = $input->param('invoice_gst');
91
$data{'tax_rate'}      = $input->param('tax_rate');          #have to transform this into fraction so it's easier to use
92
$data{'discount'}      = $input->param('discount');
93
$data{deliverytime}    = $input->param('deliverytime');
94
$data{'active'}        = $input->param('status');
95
96
my @aliases = $input->multi_param('alias');
97
my @contacts;
98
my %contact_info;
99
100
foreach (
101
    qw(id name position phone altphone fax email notes orderacquisition claimacquisition claimissues acqprimary serialsprimary)
102
    )
103
{
104
    $contact_info{$_} = [ $input->multi_param( 'contact_' . $_ ) ];
105
}
106
107
for my $cnt ( 0 .. scalar( @{ $contact_info{'id'} } ) ) {
108
    my %contact;
109
    my $real_contact;
110
    foreach (
111
        qw(id name position phone altphone fax email notes orderacquisition claimacquisition claimissues acqprimary serialsprimary)
112
        )
113
    {
114
        $contact{$_} = $contact_info{$_}->[$cnt];
115
        $real_contact = 1 if $contact{$_};
116
    }
117
    push @contacts, \%contact if $real_contact;
118
}
119
120
if ( $op eq 'cud-add' ) {
121
    my $bookseller;
122
    if ( $data{id} ) {
123
124
        # Update
125
        $bookseller = Koha::Acquisition::Booksellers->find( $data{id} )->set( \%data )->store;
126
127
        # Delete existing contacts
128
        $bookseller->contacts->delete;
129
    } else {
130
131
        # Insert
132
        delete $data{id};    # Remove the key if exists
133
        $bookseller = Koha::Acquisition::Bookseller->new( \%data )->store;
134
        $data{id} = $bookseller->id;
135
    }
136
137
    # Insert contacts
138
    for my $contact (@contacts) {
139
        $contact->{booksellerid} = $data{id};
140
        Koha::Acquisition::Bookseller::Contact->new($contact)->store;
141
    }
142
143
    # Insert aliases
144
    $bookseller->aliases( [ map { { alias => $_ } } @aliases ] );
145
146
    # Insert interfaces
147
    my @interface_counters = $input->multi_param('interface_counter');
148
    my @interfaces;
149
    for my $counter (@interface_counters) {
150
        my $interface = {};
151
        for my $attr (qw(name type uri login password account_email notes)) {
152
            my $v = $input->param("interface_${attr}_${counter}");
153
            $interface->{$attr} = $v;
154
        }
155
        push @interfaces, $interface if any { defined && length } values %$interface;
156
    }
157
    $bookseller->interfaces( \@interfaces );
158
159
    #redirect to booksellers.pl
160
    print $input->redirect( "booksellers.pl?booksellerid=" . $data{id} );
161
} else {
162
    print $input->redirect("supplier.pl?op=enter");    # fail silently.
163
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt (-2 / +2 lines)
Lines 235-241 Link Here
235
                                            [% END %]
235
                                            [% END %]
236
                                        </ul>
236
                                        </ul>
237
                                    </div>
237
                                    </div>
238
                                    <a href="booksellers.pl">Go back to vendor page</a>
238
                                    <a href="/cgi-bin/koha/vendors">Go back to vendor page</a>
239
                                [% ELSE %]
239
                                [% ELSE %]
240
                                    <a href="/cgi-bin/koha/vendors/[% booksellerid | uri %]" class="btn btn-default btn-sm">Show baskets for vendor [% booksellername | html %]</a> <a href="/cgi-bin/koha/vendors" class="btn btn-default btn-sm">Show all active baskets</a>
240
                                    <a href="/cgi-bin/koha/vendors/[% booksellerid | uri %]" class="btn btn-default btn-sm">Show baskets for vendor [% booksellername | html %]</a> <a href="/cgi-bin/koha/vendors" class="btn btn-default btn-sm">Show all active baskets</a>
241
                                [% END # /IF (cannotdelbiblios) %]
241
                                [% END # /IF (cannotdelbiblios) %]
Lines 258-264 Link Here
258
                                    </div>
258
                                    </div>
259
                                [% END # /FOR m %]
259
                                [% END # /FOR m %]
260
260
261
                                <h1>[% UNLESS ( basketno ) %]New [% END %]Basket [% basketname | html %] ([% basketno | html %]) for <a href="supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a></h1>
261
                                <h1>[% UNLESS ( basketno ) %]New [% END %]Basket [% basketname | html %] ([% basketno | html %]) for <a href="cgi-bin/koha/vendors/[% booksellerid | uri %]">[% booksellername | html %]</a></h1>
262
262
263
                                [% IF ( basketno ) %]
263
                                [% IF ( basketno ) %]
264
                                    <div id="acqui_basket_summary" class="row">
264
                                    <div id="acqui_basket_summary" class="row">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt (-1 / +1 lines)
Lines 80-86 Link Here
80
                [% ELSE %]
80
                [% ELSE %]
81
                    <h2 class="suppliername inactive">
81
                    <h2 class="suppliername inactive">
82
                [% END %]
82
                [% END %]
83
                        <a id="vendor[% supplier.booksellerid | html %]" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% supplier.booksellerid | uri %]">
83
                        <a id="vendor[% supplier.booksellerid | html %]" href="/cgi-bin/koha/vendors/[% supplier.booksellerid | uri %]">
84
                            [% IF (supplier.name) %]
84
                            [% IF (supplier.name) %]
85
                                [% supplier.name | html %]
85
                                [% supplier.name | html %]
86
                            [% ELSE %]
86
                            [% ELSE %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt (-740 lines)
Lines 1-740 Link Here
1
[% USE raw %]
2
[% USE To %]
3
[% USE Asset %]
4
[% USE KohaDates %]
5
[% USE AuthorisedValues %]
6
[% PROCESS 'i18n.inc' %]
7
[% BLOCK edit_contact %]
8
    <ol id="contact-form">
9
        <input type="hidden" name="contact_id" value="[% contact.id | html %]" />
10
        <li><label for="contact_name[% contact.id | html %]">Contact name: </label>
11
            <input type="text" size="40" id="contact_name[% contact.id | html %]" name="contact_name" value="[% contact.name | html %]" /></li>
12
        <li><label for="contact_position[% contact.id | html %]">Position: </label>
13
            <input type="text" size="40" id="contact_position[% contact.id | html %]" name="contact_position" value="[% contact.position | html %]" /></li>
14
        <li><label for="contact_phone[% contact.id | html %]">Phone: </label>
15
                <input type="tel" size="20" id="contact_phone[% contact.id | html %]" name="contact_phone" value="[% contact.phone | html %]" /> </li>
16
        <li><label for="contact_altphone[% contact.id | html %]">Alternative phone: </label>
17
            <input type="tel" size="20" id="contact_altphone[% contact.id | html %]" name="contact_altphone" value="[% contact.altphone | html %]" /></li>
18
        <li><label for="contact_fax[% contact.id | html %]">Fax: </label>
19
            <input type="tel" size="20" id="contact_fax[% contact.id | html %]" name="contact_fax" value="[% contact.fax | html %]" /></li>
20
        <li><label for="contact_email[% contact.id | html %]">Email: </label>
21
            <input type="email" size="40" id="contact_email[% contact.id | html %]" name="contact_email" value="[% contact.email | html %]" class="email" /></li>
22
        <li><label for="contact_notes[% contact.id | html %]">Notes: </label>
23
            <textarea id="contact_notes[% contact.id | html %]" name="contact_notes" cols="40" rows="4">[% contact.notes | html %]</textarea></li>
24
    </ol>
25
    <div style="display:flex">
26
        <div>
27
            <fieldset class="rows">
28
                <legend>Acquisitions options</legend>
29
                <ol class="radio">
30
                    <li>
31
                        <label>
32
                            [% IF contact.acqprimary %]
33
                                <input type="checkbox" id="contact_acqprimary[% contact.id | html %]" class="contact_acqprimary" checked="checked" />
34
                            [% ELSE %]
35
                                <input type="checkbox" id="contact_acqprimary[% contact.id | html %]" class="contact_acqprimary" />
36
                            [% END %]
37
                            <input type="hidden" class="contact_acqprimary_hidden" name="contact_acqprimary" value="[% contact.acqprimary | html %]" />
38
                            Primary acquisitions contact
39
                        </label>
40
                    </li>
41
                    <li>
42
                        <label>
43
                            [% IF contact.orderacquisition %]
44
                                <input type="checkbox" id="contact_orderacquisition[% contact.id | html %]" class="contact_orderacquisition" checked="checked" />
45
                            [% ELSE %]
46
                                <input type="checkbox" id="contact_orderacquisition[% contact.id | html %]" class="contact_orderacquisition" />
47
                            [% END %]
48
                            <input type="hidden" class="contact_orderacquisition_hidden" name="contact_orderacquisition" value="[% contact.orderacquisition | html %]" />
49
                            Contact when ordering
50
                        </label>
51
                    </li>
52
                    <li>
53
                        <label>
54
                            [% IF contact.claimacquisition %]
55
                                <input type="checkbox" id="contact_claimacquisition[% contact.id | html %]" class="contact_claimacquisition" checked="checked" />
56
                            [% ELSE %]
57
                                <input type="checkbox" id="contact_claimacquisition[% contact.id | html %]" class="contact_claimacquisition" />
58
                            [% END %]
59
                            <input type="hidden" class="contact_claimacquisition_hidden" name="contact_claimacquisition" value="[% contact.claimacquisition | html %]" />
60
                            Contact about late orders
61
                        </label>
62
                    </li>
63
                </ol>
64
            </fieldset>
65
        </div>
66
        <div>
67
            <fieldset class="rows">
68
                <legend>Serials options</legend>
69
                <ol class="radio">
70
                    <li>
71
                        <label>
72
                            [% IF contact.serialsprimary %]
73
                                <input type="checkbox" id="contact_serialsprimary[% contact.id | html %]" class="contact_serialsprimary" checked="checked" />
74
                            [% ELSE %]
75
                                <input type="checkbox" id="contact_serialsprimary[% contact.id | html %]" class="contact_serialsprimary" />
76
                            [% END %]
77
                            <input type="hidden" class="contact_serialsprimary_hidden" name="contact_serialsprimary" value="[% contact.serialsprimary | html %]" />
78
                            Primary serials contact
79
                        </label>
80
                    </li>
81
                    <li>
82
                        <label>
83
                            [% IF contact.claimissues %]
84
                                <input type="checkbox" id="contact_claimissues[% contact.id | html %]" class="contact_claimissues" checked="checked" />
85
                            [% ELSE %]
86
                                <input type="checkbox" id="contact_claimissues[% contact.id | html %]" class="contact_claimissues" />
87
                            [% END %]
88
                            <input type="hidden" class="contact_claimissues_hidden" name="contact_claimissues" value="[% contact.claimissues | html %]" />
89
                            Contact about late issues
90
                        </label>
91
                    </li>
92
                </ol>
93
            </fieldset>
94
        </div>
95
    </div>
96
97
        [% IF contact.id %]<li><button class="btn btn-default delete-contact"><i class="fa fa-trash-can"></i> Delete contact</li>[% END %]
98
    </ol>
99
[% END %]
100
101
[% BLOCK show_contact %]
102
    <h3>[% contact.name | html %]</h3>
103
    <ol>
104
        <li><span class="label">Position: </span>[% contact.position | html %]</li>
105
        <li><span class="label">Phone: </span>[% contact.phone | html %]</li>
106
        <li><span class="label">Alternative phone: </span>[% contact.altphone | html %]</li>
107
        <li><span class="label">Fax: </span>[% contact.fax | html %]</li>
108
        [% IF ( contact.email ) %]
109
            <li><span class="label">Email: </span><a href="mailto:[% contact.email | uri %]">[% contact.email | html %]</a></li>
110
        [% END %]
111
        [% IF ( contact.notes ) %]
112
            <li><span class="label">Notes: </span>[% contact.notes | html %]</li>
113
        [% END %]
114
        [% IF ( contact.acqprimary || contact.orderacquisition || contact.claimacquisition ) %]
115
            <li>
116
                <span class="label">Acquisitions options:</span>
117
                <ol>
118
                    [% IF ( contact.acqprimary ) %]
119
                        <li><span class="label"></span> <i class="fa fa-check"></i> Primary acquisitions contact</li>
120
                    [% END %]
121
                    [% IF ( contact.orderacquisition ) %]
122
                        <li><span class="label"></span> <i class="fa fa-check"></i> Receives orders</li>
123
                    [% END %]
124
                    [% IF ( contact.claimacquisition ) %]
125
                        <li><span class="label"></span> <i class="fa fa-check"></i> Receives claims for late orders</li>
126
                    [% END %]
127
                </ol>
128
            </li>
129
        [% END %]
130
        [% IF ( contact.serialsprimary || contact.claimissues ) %]
131
            <li>
132
                <span class="label">Serials options:</span>
133
                <ol>
134
                    [% IF ( contact.serialsprimary ) %]
135
                        <li><span class="label"></span> <i class="fa fa-check"></i> Primary serials contact</li>
136
                    [% END %]
137
                    [% IF ( contact.claimissues ) %]
138
                        <li><span class="label"></span> <i class="fa fa-check"></i> Receives claims for late issues</li>
139
                    [% END %]
140
                </ol>
141
            </li>
142
        [% END %]
143
    </ol>
144
[% END %]
145
146
[% SET footerjs = 1 %]
147
[% INCLUDE 'doc-head-open.inc' %]
148
<title>[% FILTER collapse %]
149
    [% IF ( enter ) %]
150
        [% IF ( booksellerid ) %]
151
            [% tx("Modify vendor '{vendor}'", { vendor = name }) | html %]
152
        [% ELSE %]
153
            [% t("Add vendor") | html %]
154
        [% END %]
155
    [% ELSE %]
156
        [% tx("Vendor '{vendor}'", { vendor = name }) | html %]
157
    [% END %] &rsaquo;
158
    [% t("Acquisitions") | html %] &rsaquo;
159
    [% t("Koha") | html %]
160
[% END %]</title>
161
[% INCLUDE 'doc-head-close.inc' %]
162
</head>
163
164
<body id="acq_supplier" class="acq">
165
[% WRAPPER 'header.inc' %]
166
    [% INCLUDE 'acquisitions-search.inc' %]
167
[% END %]
168
169
[% WRAPPER 'sub-header.inc' %]
170
    [% WRAPPER breadcrumbs %]
171
        [% WRAPPER breadcrumb_item %]
172
            <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
173
        [% END %]
174
        [% IF ( enter ) %]
175
            [% IF ( booksellerid ) %]
176
                [% WRAPPER breadcrumb_item %]
177
                    <a href="/cgi-bin/koha/vendors/[% booksellerid | uri %]">[% name | html %]</a>
178
                [% END %]
179
                [% WRAPPER breadcrumb_item bc_active= 1 %]
180
                    [% tx("Modify vendor '{vendor}'", { vendor = name }) | html %]
181
                [% END %]
182
            [% ELSE %]
183
                [% WRAPPER breadcrumb_item bc_active= 1 %]
184
                    <span>Add vendor</span>
185
                [% END %]
186
            [% END %]
187
        [% ELSE %]
188
            [% WRAPPER breadcrumb_item bc_active= 1 %]
189
                [% name | html %]
190
            [% END %]
191
        [% END # /IF (enter) %]
192
    [% END #/ WRAPPER breadcrumbs %]
193
[% END #/ WRAPPER sub-header.inc %]
194
195
<div class="main container-fluid">
196
    <div class="row">
197
198
    [% IF ( enter ) %]
199
        <div class="col-md-10 order-sm-1 order-md-2">
200
            <main>
201
                [% INCLUDE 'messages.inc' %]
202
                [% IF ( booksellerid ) %]
203
                    <h1>Modify vendor '[% name | html %]'</h1>
204
                [% ELSE %]
205
                    <h1>Add vendor</h1>
206
                [% END %]
207
    [% ELSE %]
208
        <div class="col-md-10 order-sm-1 order-md-2">
209
            <main>
210
    [% END %]
211
[% UNLESS ( enter ) %][% INCLUDE 'acquisitions-toolbar.inc' %][% END %]
212
[% IF ( enter ) %]
213
    <form action="updatesupplier.pl" name="updatesupplier" class="validated" method="post">
214
        <input type="hidden" name="op" value="cud-add"/>
215
        [% INCLUDE 'csrf-token.inc' %]
216
        <div id="toolbar" class="btn-toolbar sticky">
217
            <button class="btn btn-primary" type="submit"><i class="fa fa-save"></i> Save</button>
218
            [% IF ( booksellerid ) %]
219
                <a class="btn btn-default cancel" href="/cgi-bin/koha/vendors/[% booksellerid | html %]">
220
            [% ELSE %]
221
                <a class="btn btn-default cancel" href="/cgi-bin/koha/acqui/acqui-home.pl">
222
            [% END %] <i class="fa fa-times"></i> Cancel</a>
223
        </div>
224
225
        <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
226
        <fieldset class="rows">
227
            <legend>Company details</legend>
228
            <ol><li><label for="company" class="required">Name:</label>
229
                <input type="text" size="40" id="company" name="company" value="[% name | html %]" required="required" class="required focus" /><span class="required">Required</span></li>
230
            <li><label for="company_postal">Postal address: </label>
231
                    <textarea id="company_postal" name="company_postal" cols="40" rows="3">[% postal | html %]</textarea></li>
232
            <li><label for="physical">Physical address: </label>
233
                <textarea id="physical" name="physical" cols="40" rows="3">[% address1 | html %][% address2 | html %][% address3 | html %][% address4 | html %]</textarea></li>
234
            <li><label for="company_phone">Phone: </label>
235
                <input type="tel" size="20" id="company_phone" name="company_phone" value="[% phone | html %]" /></li>
236
            <li><label for="company_fax">Fax: </label>
237
                <input type="tel" size="20" id="company_fax" name="company_fax" value="[% fax | html %]" /></li>
238
            <li><label for="website">Website: </label>
239
                <input type="url" size="40" id="website" name="website" value="[% url | html %]" class="url" /></li>
240
            <li><label for="accountnumber">Account number: </label>
241
                <input type="text" size="40" id="accountnumber" name="accountnumber" value="[% accountnumber | html %]" /></li>
242
                <li>
243
                    <label for="vendor_type">Vendor type: </label>
244
                    [% PROCESS 'av-build-dropbox.inc' name="vendor_type", category="VENDOR_TYPE", default=type, empty=1, size = 20 %]
245
                </li>
246
                <li>
247
                    <label for="aliases">Aliases: </label>
248
                    <div id="aliases" style="padding-left: 11rem;"></div>
249
                </li>
250
            </ol>
251
        </fieldset>
252
        <fieldset class="rows">
253
            <legend>Contacts</legend>
254
            <fieldset id="contact-template" class="supplier-contact">
255
                <legend>Contact details</legend>
256
                [% INCLUDE edit_contact %]
257
            </fieldset>
258
            [% FOREACH contact IN contacts %]
259
                <fieldset class="supplier-contact">
260
                    <legend>Contact details</legend>
261
                    [% INCLUDE edit_contact %]
262
                </fieldset>
263
            [% END %]
264
            <button id="add-contact" class="btn btn-default"><i class="fa fa-plus"></i> Add another contact</button>
265
        </fieldset>
266
267
        <fieldset class="rows">
268
            <legend>Interfaces</legend>
269
            <div id="interfaces"></div>
270
        </fieldset>
271
272
        <fieldset class="rows">
273
            <legend>Ordering information</legend>
274
            <ol><li><label for="activestatus">Vendor is:</label>
275
                    [% IF ( active ) %]
276
                        <input type="radio" id="activestatus" name="status" value="1" checked="checked" />
277
                        <label class="radio" for="activestatus">Active</label>
278
                        <input type="radio" id="inactivestatus" name="status" value="0" />
279
                        <label class="radio" for="inactivestatus">Inactive</label>
280
                    [% ELSE %]
281
                        <input type="radio" id="activestatus" name="status" value="1" />
282
                        <label class="radio" for="activestatus">Active</label>
283
                        <input type="radio" id="inactivestatus" name="status" value="0" checked="checked" />
284
                        <label class="radio" for="inactivestatus">Inactive</label>
285
                    [% END %]</li>
286
            <li><label for="list_currency">List prices are: </label>
287
                <select name="list_currency" id="list_currency">
288
                    [% FOREACH c IN currencies %]
289
                        [% IF booksellerid and c.currency == listprice or not booksellerid and c.active %]
290
                            <option value="[% c.currency | html %]" selected="selected">[% c.currency | html %]</option>
291
                        [% ELSIF not c.archived %]
292
                            <option value="[% c.currency | html %]">[% c.currency | html %]</option>
293
                        [% END %]
294
                    [% END %]
295
                </select>
296
            </li>
297
            <li><label for="invoice_currency">Invoice prices are: </label>
298
                <select name="invoice_currency" id="invoice_currency">
299
                    [% FOREACH c IN currencies %]
300
                        [% IF booksellerid and c.currency == invoiceprice or not booksellerid and c.active %]
301
                            <option value="[% c.currency | html %]" selected="selected">[% c.currency | html %]</option>
302
                        [% ELSIF not c.archived %]
303
                            <option value="[% c.currency | html %]">[% c.currency | html %]</option>
304
                        [% END %]
305
                    [% END %]
306
                </select>
307
            </li>
308
            <li><label for="gstyes">Tax number registered:</label>
309
                [% IF ( gstreg ) %]
310
                    <label class="radio" for="gstyes">Yes</label>
311
                    <input type="radio" name="gst" id="gstyes" value="1" checked="checked" />
312
                    <label class="radio" for="gstno">No</label>
313
                    <input type="radio" name="gst" id="gstno" value="0" />
314
                [% ELSE %]
315
                    <label class="radio" for="gstyes">Yes</label>
316
                    <input type="radio" name="gst" id="gstyes" value="1" />
317
                    <label class="radio" for="gstno">No</label>
318
                    <input type="radio" name="gst" id="gstno" value="0" checked="checked" />
319
                [% END %]</li>
320
321
            <li><label for="list_gstyes">List prices:</label>
322
                [% IF ( listincgst ) %]
323
                    <label class="radio" for="list_gstyes">Include tax</label>
324
                    <input type="radio" id="list_gstyes" name="list_gst" value="1" checked="checked" />
325
                    <label class="radio" for="list_gstno">Don't include tax</label>
326
                    <input type="radio" id="list_gstno" name="list_gst" value="0" />
327
                [% ELSE %]
328
                    <label class="radio" for="list_gstyes">Include tax</label>
329
                    <input type="radio" id="list_gstyes" name="list_gst" value="1" />
330
                    <label class="radio" for="list_gstno">Don't include tax</label>
331
                    <input type="radio" id="list_gstno" name="list_gst" value="0" checked="checked" />
332
                [% END %]</li>
333
334
            <li><label for="invoice_gstyes">Invoice prices:</label>
335
                [% IF ( invoiceincgst ) %]
336
                    <label class="radio" for="invoice_gstyes">Include tax</label>
337
                    <input type="radio" id="invoice_gstyes" name="invoice_gst" value="1" checked="checked" />
338
                    <label class="radio" for="invoice_gstno">Don't include tax</label>
339
                    <input type="radio" id="invoice_gstno" name="invoice_gst" value="0" />
340
                    [% ELSE %]
341
                    <label class="radio" for="invoice_gstyes">Include tax</label>
342
                    <input type="radio" id="invoice_gstyes" name="invoice_gst" value="1" />
343
                    <label class="radio" for="invoice_gstno">Don't include tax</label>
344
                    <input type="radio" id="invoice_gstno" name="invoice_gst" value="0" checked="checked" />
345
                [% END %]</li>
346
347
            [% IF gst_values %]
348
                <li>
349
                  <label for="tax_rate">Tax rate: </label>
350
                  <select name="tax_rate" id="tax_rate">
351
                  [% FOREACH gst IN gst_values %]
352
                    [% IF ( tax_rate == gst.option ) %]
353
                      <option value="[% gst.option | html %]" selected="selected">[% gst.option * 100 | html %] %</option>
354
                    [% ELSE %]
355
                      <option value="[% gst.option | html %]">[% gst.option * 100 | html %] %</option>
356
                    [% END %]
357
                  [% END %]
358
                  </select>
359
                </li>
360
            [% ELSE %]
361
                <input type="hidden" name="tax_rate" value="0" />
362
            [% END %]
363
            <li><label for="discount">Discount: </label>
364
                <input class="rate" type="text" size="6" id="discount" name="discount" value="[% discount | html %]" />%</li>
365
            <li>
366
                <label for="deliverytime">Delivery time: </label>
367
                <input type="text" size="2" id="deliverytime" name="deliverytime" value="[% deliverytime | html %]" /> days
368
            </li>
369
            <li><label for="notes">Notes: </label>
370
                <textarea cols="40" rows="4" id="notes" name="notes" >[% notes | html %]</textarea></li>
371
            </ol>
372
        </fieldset>
373
374
    </form>
375
[% ELSE %]
376
    <h1>[% name | html %]</h1>
377
        <div class="row">
378
            <div class="col">
379
                <div id="supplier-company-details" class="page-section rows">
380
                    <h2>Vendor details</h2>
381
                    <ol>
382
                    <li>
383
                        <span class="label">Type: </span>
384
                        [% IF (type) %][% AuthorisedValues.GetByCode( 'VENDOR_TYPE', type ) | html %][% END %]
385
                    </li>
386
                    <li><span class="label">Company name: </span>[% name | html %]</li>
387
                    <li><span class="label">Postal address: </span>[% postal | html %]</li>
388
                    <li><span class="label">Physical address: </span>[% address1 | html %][% address2 | html %][% address3 | html %][% address4 | html %]</li>
389
                    <li><span class="label">Phone: </span>[% phone | html %]</li>
390
                    <li><span class="label">Fax: </span>[% fax | html %]</li>
391
                    [% IF ( url ) %]
392
                        <li><span class="label">Website: </span><a href="[% url | url %]" target="_blank">[% url | html %]</a></li>
393
                    [% END %]
394
                    [% IF ( accountnumber ) %]
395
                        <li><span class="label">Account number: </span>[% accountnumber | html %]</li>
396
                    [% END %]
397
                    [% IF vendor.aliases.count %]
398
                        <li>
399
                            <span class="label">Aliases: </span>
400
                            <ul>
401
                            [% FOR alias IN vendor.aliases %]
402
                                <li>[% alias.alias | html %]</li>
403
                            [% END %]
404
                            </ul>
405
                        </li>
406
                    [% END %]
407
                    </ol>
408
                </div> <!-- /#supplier-company-details -->
409
410
                <div id="supplier-ordering-information" class="page-section rows">
411
                    <h2>Ordering information</h2>
412
                    <li><span class="label">Vendor is: </span>[% IF ( active ) %]Active[% ELSE %]Inactive[% END %]</li>
413
                    <li><span class="label">List prices are: </span>[% listprice | html %]</li>
414
                    <li><span class="label">Invoice prices are: </span>[% invoiceprice | html %]</li>
415
                    [% IF ( tax_rate ) %]
416
                        <li><span class="label">Tax number registered: </span>[% IF ( gstreg ) %]Yes[% ELSE %]No[% END %]</li>
417
                        <li><span class="label">List item price includes tax: </span>[% IF ( listincgst ) %]Yes[% ELSE %]No[% END %]</li>
418
                        <li><span class="label">Invoice item price includes tax: </span>[% IF ( invoiceincgst ) %]Yes[% ELSE %]No[% END %]</li>
419
                    [% END %]
420
                    <li><span class="label">Discount: </span>[% ( discount || 0 ) | format("%.1f" ) %] %</li>
421
                    <li><span class="label">Tax rate: </span>[% ( tax_rate || 0 ) * 100 | html %] %</li>
422
                    [% IF deliverytime.defined %]
423
                        <li><span class="label">Delivery time: </span>[% deliverytime | html %] days</li>
424
                    [% END %]
425
                    [% IF ( notes ) %]
426
                        <li><span class="label">Notes: </span>[% notes | html %]</li>
427
                    [% END %]
428
                </div> <!-- #supplier-ordering-information -->
429
430
                [% IF vendor.interfaces.count %]
431
                <div id="supplier-interfaces" class="page-section rows">
432
                    <h2>Interfaces</h2>
433
434
                    [% FOR i IN vendor.interfaces %]
435
                        <h3>[% i.name | html %]</h3>
436
                        [% IF i.type %]
437
                            <li><span class="label">Type: </span>[% AuthorisedValues.GetByCode( 'VENDOR_INTERFACE_TYPE', i.type) | html %]</li>
438
                        [% END %]
439
                        [% IF i.uri %]
440
                            <li>
441
                                <span class="label">URI: </span><a href="[% i.uri | url %]" target="_blank">[% i.uri | html %]</a>
442
                            </li>
443
                        [% END %]
444
                        [% IF i.login %]
445
                            <li><span class="label">Login: </span>[% i.login | html %]</li>
446
                        [% END %]
447
                        [% IF i.password %]
448
                            <li><span class="label">Password: </span><span class="password"><a href="#" class="show_password" data-plain-text-password="[% i.plain_text_password | html %]">Show</a></span></span></li>
449
                        [% END %]
450
                        [% IF i.account_email %]
451
                            <li><span class="label">Account email: </span>[% i.account_email | html %]</li>
452
                        [% END %]
453
                        [% IF i.notes %]
454
                            <li><span class="label">Notes: </span>[% i.notes | html %]</li>
455
                        [% END %]
456
                    [% END %]
457
                </div>
458
                [% END %]
459
460
            </div> <!-- /.col -->
461
462
            <div class="col">
463
                <div id="supplier-contact-details" class="page-section rows">
464
                    <h2>Contact</h2>
465
                    [% FOREACH contact IN contacts %]
466
                        [% INCLUDE show_contact %]
467
                    [% END %]
468
                </div> <!-- /#supplier-contact-details -->
469
470
                <div id="subscription-details" class="page-section">
471
                    <h2>Subscription details</h2>
472
                    <p><strong>Number of subscriptions: </strong>
473
                        [% IF (  CAN_user_serials ) %]
474
                            <a href="/cgi-bin/koha/serials/serials-search.pl?bookseller_filter=[% name | uri %]&searched=1">[% subscriptioncount | html %]</a>
475
                        [% ELSE %]
476
                            [% subscriptioncount | html %]
477
                        [% END %]
478
                    </p>
479
                </div> <!-- /#subscription-details -->
480
            </div> <!-- /.col -->
481
482
        </div> <!-- /.row -->
483
484
        [% IF ( contracts ) %]
485
            <div id="supplier-contracts" class="page-section rows">
486
                <h2>Contract(s)</h2>
487
                <table id="contractst">
488
                  <thead>
489
                    <tr>
490
                        <th scope="col">Name</th>
491
                        <th scope="col">Description</th>
492
                        <th scope="col">Start date</th>
493
                        <th scope="col">End date</th>
494
                        [% IF CAN_user_acquisition_contracts_manage %]
495
                            <th scope="col" class="NoSort noExport">Actions</th>
496
                        [% END %]
497
                    </tr>
498
                  </thead>
499
                  <tbody>
500
                    [% FOREACH contract IN contracts %]
501
                        <tr>
502
                        <td>
503
                            <a href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&amp;contractnumber=[% contract.contractnumber | uri %]&amp;booksellerid=[% contract.booksellerid | uri %]">[% contract.contractname | html %]</a>
504
                        </td>
505
                        <td>[% contract.contractdescription | html %]</td>
506
                        <td data-order="[% contract.contractstartdate | html %]">[% contract.contractstartdate | $KohaDates %]</td>
507
                        <td data-order="[% contract.contractenddate | html %]">[% contract.contractenddate | $KohaDates %]</td>
508
                        [% IF CAN_user_acquisition_contracts_manage %]
509
                            <td class="actions">
510
                                <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&amp;contractnumber=[% contract.contractnumber | html %]&amp;booksellerid=[% contract.booksellerid | html %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a>
511
                                <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/aqcontract.pl?op=delete_confirm&amp;contractnumber=[% contract.contractnumber | html %]&amp;booksellerid=[% contract.booksellerid | html %]"><i class="fa fa-trash-can"></i> Delete</a>
512
                            </td>
513
                        [% END %]
514
                        </tr>
515
                    [% END %]
516
                  </tbody>
517
                </table>
518
            </div> <!-- /#supplier-contracts -->
519
        [% END %]
520
521
[% END %]
522
523
</main>
524
</div> <!-- /.col-md-10.order-md-2 -->
525
526
<div class="col-md-2 order-sm-2 order-md-1">
527
    <aside>
528
        [% INCLUDE 'vendor-menu.inc' %]
529
    </aside>
530
</div> <!-- /.col-md-2.order-md-1 -->
531
</div> <!-- /.row -->
532
533
[% MACRO jsinclude BLOCK %]
534
    [% Asset.js("js/acquisitions-menu.js") | $raw %]
535
    [% Asset.js("js/acq.js") | $raw %]
536
    [% INCLUDE 'datatables.inc' %]
537
    [% Asset.js("js/vue/dist/islands.js", "init" => "1") | $raw %]
538
    <script>
539
        function add_contact() {
540
            var new_contact = $('#contact-template').clone();
541
            var timestamp = new Date().getTime();
542
            $(new_contact).removeAttr('id');
543
            $('input, textarea', new_contact).each(function () {
544
                $(this).attr('id', $(this).attr('id') + '_' + timestamp);
545
            });
546
            $(new_contact).insertBefore(this);
547
            if ($('.supplier-contact').length === 2) { // First contact
548
                $.each(['.contact_acqprimary', '.contact_serialsprimary', '.contact_orderacquisition', '.contact_claimacquisition', '.contact_claimissues'], function (idx, checkbox) {
549
                    $(checkbox, new_contact).click();
550
                });
551
            }
552
            $('input[name="contact_name"]', new_contact).focus();
553
            return false;
554
        }
555
556
        function delete_contact(ev) {
557
            $(this).parents('.supplier-contact').remove();
558
            ev.preventDefault();
559
        }
560
561
        [% IF vendor %]
562
        let aliases = [% To.json(vendor.aliases.unblessed) | $raw %];
563
        [% ELSE %]
564
        let aliases = [];
565
        [% END %]
566
        function remove_alias(i){
567
            aliases.splice(i, 1);
568
            refresh_aliases();
569
        }
570
571
        function encodeHTMLEntities(str){
572
            return str.replace(/[&<>'"]/g,
573
              tag => ({
574
                  '&': '&amp;',
575
                  '<': '&lt;',
576
                  '>': '&gt;',
577
                  "'": '&#39;',
578
                  '"': '&quot;'
579
                }[tag]));
580
        }
581
582
        function add_alias(){
583
            let alias = $("#new_alias").val();
584
            if ( !alias.length > 0 ) { return }
585
            aliases.push({alias});
586
            refresh_aliases();
587
        }
588
        function refresh_aliases(){
589
            let nodes = $("<div></div>");
590
            aliases.forEach((a, i) => {
591
                let alias_str = encodeHTMLEntities(a.alias);
592
                let n = $("<div></div>").append(alias_str);
593
                let input = $('<input type="hidden" name="alias" />');
594
                input.val(a.alias);
595
                n.append(input);
596
                n.append(` <a style="cursor: pointer;" onclick="remove_alias(${i});"><i class="fa fa-trash" aria-hidden="true"></i> ` + _("Remove") + '</a>');
597
                nodes.append(n);
598
            });
599
            nodes.append("<input id='new_alias' type='text' class='noEnterSubmit' />");
600
            nodes.append(' <a style="cursor: pointer;" onclick="add_alias();"><i class="fa fa-plus" aria-hidden="true"></i> ' + _("Add") + '</a>');
601
            $("#aliases").html(nodes.html());
602
        }
603
604
        [% IF vendor %]
605
            let interfaces = [];
606
            [% FOR i_object IN vendor.interfaces %]
607
                [% SET i = i_object.unblessed %]
608
                [% SET i.password = i_object.plain_text_password %]
609
                interfaces.push([% To.json(i) | $raw %]);
610
            [% END %]
611
        [% ELSE %]
612
            let interfaces = [];
613
        [% END %]
614
        function serialize_interface_form(){
615
            interfaces = [];
616
            $("#interfaces > fieldset.supplier-interface > ol.interface-form").each( (index, interface_form )=> {
617
                let interface = {};
618
                $(interface_form).find('input,textarea,select').serializeArray().map(attr => {
619
                    let name = attr.name.replace(/interface_([\w_]+)_\d+/, "$1");
620
                    interface[name] = attr.value
621
                })
622
                interfaces.push(interface);
623
            });
624
            return interfaces;
625
        }
626
        function remove_interface(i){
627
            interfaces = serialize_interface_form();
628
            interfaces.splice(i, 1);
629
            refresh_interfaces();
630
        }
631
        function add_interface(){
632
            interfaces = serialize_interface_form();
633
            interfaces.push({
634
                type: "",
635
                name: "",
636
                uri: "",
637
                login: "",
638
                password: "",
639
                account_email: "",
640
                notes: "",
641
            });
642
            refresh_interfaces();
643
        }
644
        let av_select = {
645
            VENDOR_INTERFACE_TYPE: $("[% PROCESS 'av-build-dropbox.inc', category="VENDOR_INTERFACE_TYPE" empty=1 | replace('\n', '') | replace('"', '\"') %]"),
646
        };
647
        function refresh_interfaces(){
648
            let nodes = $("<div id='interfaces'></div>");
649
            interfaces.forEach((interface, i) => {
650
                let n = $("<fieldset class='supplier-interface'></fieldset>");
651
                n.append("<legend>" + _("Interface details") + "</legend>");
652
                n.append(`<input type="hidden" name="interface_counter" value="${i}" />`);
653
                let ol = $('<ol class="interface-form"></ol>');
654
                let attributes = [
655
                    { label: _("Name:"),          name: 'name',          type: 'text',     node: 'input' },
656
                    { label: _("Type:"),          name: 'type',          type: 'select',   node: 'av_select', av_cat: 'VENDOR_INTERFACE_TYPE' },
657
                    { label: _("URI:"),           name: 'uri',           type: 'url',      node: 'input' },
658
                    { label: _("Login:"),         name: 'login',         type: 'text',     node: 'input' },
659
                    { label: _("Password:"),      name: 'password',      type: 'text',     node: 'input' },
660
                    { label: _("Account email:"), name: 'account_email', type: 'email',    node: 'input' },
661
                    { label: _("Notes:"),         name: 'notes',         type: 'textarea', node: 'textarea' }
662
                ];
663
                attributes.forEach((attribute, ii) => {
664
                    let li = $('<li></li>');
665
                    li.append(`<label for="interface_${attribute.name}_${i}">${attribute.label}</label>`);
666
                    if( attribute.node == 'input' ) {
667
                        li.append(`<input type="${attribute.type}" size="40" id="interface_${attribute.name}_${i}" name="interface_${attribute.name}_${i}" value="${interface[attribute.name]}" />`);
668
                    } else if ( attribute.node == 'textarea' ) {
669
                        li.append(`<textarea cols="40" rows="3" id="interface_${attribute.name}_${i}" name="interface_${attribute.name}_${i}">${interface[attribute.name]}</textarea>`);
670
                    } else if ( attribute.node == 'av_select' ) {
671
                        let select = av_select[attribute.av_cat].clone();
672
                        select.attr('name', `interface_${attribute.name}_${i}`);
673
                        select.find(`option[value='${interface[attribute.name]}']`).prop("selected", true);
674
                        li.append(select);
675
                    }
676
                    ol.append(li);
677
                });
678
                ol.append(`<li><button class="btn btn-default" onclick="remove_interface(${i});"><i class="fa fa-trash"></i> ` + _("Delete interface") + '</li>');
679
                n.append(ol);
680
                nodes.append(n);
681
            });
682
            nodes.append(`<button onclick="add_interface();" class="btn btn-default"><i class="fa fa-plus"></i> ` + _("Add another interface") + '</button>')
683
            $("#interfaces").replaceWith(nodes);
684
685
            interfaces.forEach((interface, i) => {
686
                $("#interface_account_email_" + i).rules("add", {
687
                    email: true,
688
                });
689
            });
690
        }
691
692
         $(document).ready(function() {
693
            var contractst = $("#contractst").dataTable($.extend(true, {}, dataTablesDefaults, {
694
                "columnDefs": [
695
                    { "orderable": false, "searchable":  false, "targets": [ 'NoSort' ] }
696
                ],
697
                "dom": 't'
698
            } ) );
699
            $('body').on('click', '.delete-contact', null, delete_contact);
700
            $('#add-contact').click(add_contact);
701
            $('body').on('click', '.contact_acqprimary', null, function () {
702
                if ($(this).is(':checked')) {
703
                    $('.contact_acqprimary').filter(':checked').not(this).prop('checked', false);
704
                    $('.contact_acqprimary_hidden').each(function () {
705
                        $(this).val('0');
706
                    });
707
                }
708
                $(this).next('.contact_acqprimary_hidden').val('1');
709
            });
710
            $('body').on('click', '.contact_serialsprimary', null, function () {
711
                if ($(this).is(':checked')) {
712
                    $('.contact_serialsprimary').filter(':checked').not(this).prop('checked', false);
713
                    $('.contact_serialsprimary_hidden').each(function () {
714
                        $(this).val('0');
715
                    });
716
                }
717
                $(this).next('.contact_serialsprimary_hidden').val($(this).is(':checked') ? '1' : '0');
718
            });
719
            $('body').on('click', '.contact_orderacquisition', null, function () {
720
                $(this).next('.contact_orderacquisition_hidden').val($(this).is(':checked') ? '1' : '0');
721
            });
722
            $('body').on('click', '.contact_claimacquisition', null, function () {
723
                $(this).next('.contact_claimacquisition_hidden').val($(this).is(':checked') ? '1' : '0');
724
            });
725
            $('body').on('click', '.contact_claimissues', null, function () {
726
                $(this).next('.contact_claimissues_hidden').val($(this).is(':checked') ? '1' : '0');
727
            });
728
729
            $('body').on('click', '.show_password', null, function(e){
730
                e.preventDefault();
731
                $(this).parent().replaceWith($(this).data('plain-text-password'));
732
            });
733
            refresh_aliases();
734
            refresh_interfaces();
735
736
        });
737
    </script>
738
[% END %]
739
740
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_order_accounts.tt (-2 / +1 lines)
Lines 63-69 MARC order accounts Link Here
63
                                [% FOREACH account IN accounts %]
63
                                [% FOREACH account IN accounts %]
64
                                    <tr>
64
                                    <tr>
65
                                        <td>[% account.id | html %]</td>
65
                                        <td>[% account.id | html %]</td>
66
                                        <td><a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% account.vendor_id | uri %]">[% account.vendor.name | html %]</a></td>
66
                                        <td><a href="/cgi-bin/koha/vendors/[% account.vendor_id | uri %]">[% account.vendor.name | html %]</a></td>
67
                                        <td><a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% account.budget.budget_period_id | uri %]">[% account.budget.budget_name | html %]</a></td>
67
                                        <td><a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% account.budget.budget_period_id | uri %]">[% account.budget.budget_name | html %]</a></td>
68
                                        <td>[% account.description | html %]</td>
68
                                        <td>[% account.description | html %]</td>
69
                                        <td>[% account.download_directory | html %]</td>
69
                                        <td>[% account.download_directory | html %]</td>
70
- 

Return to bug 38010