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

(-)a/admin/edi_accounts.pl (-23 / +20 lines)
Lines 56-61 if ( $op eq 'acct_form' ) { Link Here
56
    );
56
    );
57
    $template->param( vendors => \@vendors );
57
    $template->param( vendors => \@vendors );
58
58
59
    # Get available file transports for selection
60
    my @file_transports = $schema->resultset('FileTransport')->search(
61
        {},
62
        { order_by => { -asc => 'name' } }
63
    );
64
    $template->param( file_transports => \@file_transports );
65
59
    if ( C4::Context->config("enable_plugins") ) {
66
    if ( C4::Context->config("enable_plugins") ) {
60
        my @plugins = Koha::Plugins->new()->GetPlugins(
67
        my @plugins = Koha::Plugins->new()->GetPlugins(
61
            {
68
            {
Lines 71-99 if ( $op eq 'acct_form' ) { Link Here
71
    if ( $op eq 'cud-save' ) {
78
    if ( $op eq 'cud-save' ) {
72
79
73
        # validate & display
80
        # validate & display
74
        my $id       = $input->param('id');
81
        my $id     = $input->param('id');
75
        my $password = scalar $input->param('password');
76
        $password = $crypt->encrypt_hex($password);
77
        my $fields = {
82
        my $fields = {
78
            description   => scalar $input->param('description'),
83
            description       => scalar $input->param('description'),
79
            host          => scalar $input->param('host'),
84
            vendor_id         => scalar $input->param('vendor_id'),
80
            username      => scalar $input->param('username'),
85
            file_transport_id => scalar $input->param('file_transport_id') || undef,
81
            password      => $password,
86
            san               => scalar $input->param('san'),
82
            upload_port   => scalar $input->param('upload_port')   || $input->param('transport') eq 'FTP' ? 21 : 22,
87
            standard          => scalar $input->param('standard'),
83
            download_port => scalar $input->param('download_port') || $input->param('transport') eq 'FTP' ? 21 : 22,
88
            quotes_enabled    => $input->param('quotes_enabled')    ? 1 : 0,
84
            vendor_id          => scalar $input->param('vendor_id'),
89
            invoices_enabled  => $input->param('invoices_enabled')  ? 1 : 0,
85
            upload_directory   => scalar $input->param('upload_directory'),
90
            orders_enabled    => $input->param('orders_enabled')    ? 1 : 0,
86
            download_directory => scalar $input->param('download_directory'),
91
            responses_enabled => $input->param('responses_enabled') ? 1 : 0,
87
            san                => scalar $input->param('san'),
92
            auto_orders       => $input->param('auto_orders')       ? 1 : 0,
88
            standard           => scalar $input->param('standard'),
93
            id_code_qualifier => scalar $input->param('id_code_qualifier'),
89
            transport          => scalar $input->param('transport'),
94
            plugin            => scalar $input->param('plugin'),
90
            quotes_enabled     => $input->param('quotes_enabled')    ? 1 : 0,
91
            invoices_enabled   => $input->param('invoices_enabled')  ? 1 : 0,
92
            orders_enabled     => $input->param('orders_enabled')    ? 1 : 0,
93
            responses_enabled  => $input->param('responses_enabled') ? 1 : 0,
94
            auto_orders        => $input->param('auto_orders')       ? 1 : 0,
95
            id_code_qualifier  => scalar $input->param('id_code_qualifier'),
96
            plugin             => scalar $input->param('plugin'),
97
        };
95
        };
98
96
99
        if ($id) {
97
        if ($id) {
Lines 163-169 sub show_account { Link Here
163
    my $acct_id = $input->param('id');
161
    my $acct_id = $input->param('id');
164
    if ($acct_id) {
162
    if ($acct_id) {
165
        my $acct = $schema->resultset('VendorEdiAccount')->find($acct_id);
163
        my $acct = $schema->resultset('VendorEdiAccount')->find($acct_id);
166
        $acct->password( $crypt->decrypt_hex( $acct->password ) );
167
        if ($acct) {
164
        if ($acct) {
168
            $template->param( account => $acct );
165
            $template->param( account => $acct );
169
        }
166
        }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/edi_accounts.tt (-40 / +8 lines)
Lines 134-182 Link Here
134
                        <input type="text" name="description" id="description" size="20" value="[% account.description | html %]" />
134
                        <input type="text" name="description" id="description" size="20" value="[% account.description | html %]" />
135
                    </li>
135
                    </li>
136
                    <li>
136
                    <li>
137
                        [% transport_types = [ 'FTP', 'SFTP', 'FILE' ] %]
137
                        <label for="file_transport_id">File transport: </label>
138
                        <label for="transport">Transport: </label>
138
                        <select name="file_transport_id" id="file_transport_id">
139
                        <select name="transport" title="valid types of transport are FTP and SFTP" id="transport">
139
                            <option value="">Select a file transport configuration</option>
140
                            [% FOREACH transport_type IN transport_types %]
140
                            [% FOREACH transport IN file_transports %]
141
                                [% IF transport_type == account.transport %]
141
                                [% IF transport.file_transport_id == account.file_transport_id %]
142
                                    <option value="[% transport_type | html %]" selected="selected">[% transport_type | html %]</option>
142
                                    <option value="[% transport.file_transport_id | html %]" selected="selected">[% transport.name | html %] ([% transport.transport | upper | html %] - [% transport.host | html %])</option>
143
                                [% ELSE %]
143
                                [% ELSE %]
144
                                    <option value="[% transport_type | html %]">[% transport_type | html %]</option>
144
                                    <option value="[% transport.file_transport_id | html %]">[% transport.name | html %] ([% transport.transport | upper | html %] - [% transport.host | html %])</option>
145
                                [% END %]
145
                                [% END %]
146
                            [% END %]
146
                            [% END %]
147
                        </select>
147
                        </select>
148
                    </li>
148
                        <div class="hint"> Select a file transport configuration for this EDI account. File transports can be managed in <a href="/cgi-bin/koha/admin/file_transports.pl">Administration &rsaquo; File transports</a>. </div>
149
                    <li>
150
                        <label for="host">Remote host: </label>
151
                        <input type="text" name="host" id="host" size="20" maxlength="40" value="[% account.host | html %]" />
152
                    </li>
153
                    <li>
154
                        <label for="username">Username: </label>
155
                        <input type="text" name="username" id="username" size="20" maxlength="40" value="[% account.username | html %]" />
156
                    </li>
157
                    <li>
158
                        <label for="password">Password: </label>
159
                        <input type="text" name="password" id="password" size="20" maxlength="40" value="[% account.password | html %]" />
160
                    </li>
161
                    <li>
162
                        <label for="upload_port">Upload port: </label>
163
                        <input type="text" name="upload_port" id="upload_port" size="20" maxlength="40" value="[% account.upload_port | html %]" />
164
                        <div class="hint">The upload port will default to 22 (for SFTP) or 21 (for FTP) if not set.</div>
165
                    </li>
166
                    <li>
167
                        <label for="download_port">Download port: </label>
168
                        <input type="text" name="download_port" id="download_port" size="20" maxlength="40" value="[% account.download_port | html %]" />
169
                        <div class="hint">The download port will default to 22 (for SFTP) or 21 (for FTP) if not set.</div>
170
                    </li>
171
                    <li>
172
                        <label for="download_directory">Download directory: </label>
173
                        <input type="text" name="download_directory" id="download_directory" size="20" value="[% account.download_directory | html %]" />
174
                        <div class="hint">The download directory specifies the directory on the ftp site from which quotes and invoices are downloaded.</div>
175
                    </li>
176
                    <li>
177
                        <label for="upload_directory">Upload directory: </label>
178
                        <input type="text" name="upload_directory" id="upload_directory" size="20" value="[% account.upload_directory | html %]" />
179
                        <div class="hint">The upload directory specifies the directory on the ftp site to which orders are uploaded.</div>
180
                    </li>
149
                    </li>
181
                    <li>
150
                    <li>
182
                        <label for="id_code_qualifier">Qualifier:</label>
151
                        <label for="id_code_qualifier">Qualifier:</label>
183
- 

Return to bug 38489