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

(-)a/Koha/BackgroundJob/ImportKBARTFile.pm (-4 / +2 lines)
Lines 85-93 sub process { Link Here
85
85
86
        if ( scalar( @{$rows} ) == 0 ) {
86
        if ( scalar( @{$rows} ) == 0 ) {
87
            push @messages, {
87
            push @messages, {
88
                code          => 'job_failed',
88
                code          => 'no_rows',
89
                type          => 'error',
89
                type          => 'error',
90
                error_message => 'No valid rows were found in this file. Please check the file formatting.',
91
            };
90
            };
92
            $self->status('failed')->store;
91
            $self->status('failed')->store;
93
        }
92
        }
Lines 115-123 sub process { Link Here
115
                    my $formatted_title = format_title($new_title);
114
                    my $formatted_title = format_title($new_title);
116
                    if ( !$formatted_title->{publication_title} ) {
115
                    if ( !$formatted_title->{publication_title} ) {
117
                        push @messages, {
116
                        push @messages, {
118
                            code          => 'title_failed',
117
                            code          => 'no_title_found',
119
                            type          => 'error',
118
                            type          => 'error',
120
                            error_message => "No publication_title found for title_id: ",
121
                            title         => '(Unknown)',
119
                            title         => '(Unknown)',
122
                            title_id      => $formatted_title->{external_id}
120
                            title_id      => $formatted_title->{external_id}
123
                        };
121
                        };
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/background_jobs/import_from_kbart_file.inc (-4 / +6 lines)
Lines 28-34 Link Here
28
                        <td>[% report.failed_imports | html %]</td>
28
                        <td>[% report.failed_imports | html %]</td>
29
                    </tr>
29
                    </tr>
30
                </table>
30
                </table>
31
                <a href="/cgi-bin/koha/erm/eholdings/local/packages/[% report.package_id | $raw %]">Click here to see the package</a>
31
                <a href="/cgi-bin/koha/erm/eholdings/local/packages/[% report.package_id | $raw %]">Package</a>
32
            [% ELSIF job.status == 'started' %]
32
            [% ELSIF job.status == 'started' %]
33
                <p id="jobactionlabel"></p>
33
                <p id="jobactionlabel"></p>
34
            [% END %]
34
            [% END %]
Lines 57-66 Link Here
57
            [% SWITCH m.code %]
57
            [% SWITCH m.code %]
58
            [% CASE 'title_already_exists' %]
58
            [% CASE 'title_already_exists' %]
59
                <span><strong>[% m.title | html %]</strong> already exists and was not created.</span>
59
                <span><strong>[% m.title | html %]</strong> already exists and was not created.</span>
60
            [% CASE 'no_title_found' %]
61
                <span><strong>Title [% m.title_id | html %]</strong> did not have a publication title and was not imported.</span>
60
            [% CASE 'title_failed' %]
62
            [% CASE 'title_failed' %]
61
                <span><strong>[% m.title | html %]</strong> failed to import - [% m.error_message | html %][% IF m.title_id %][% m.title_id | html %][% END %]</span>
63
                <span><strong>Title [% m.title_id | html %]</strong> failed to import with the following error: [% m.error_message | html %]</span>
62
            [% CASE 'job_failed' %]
64
            [% CASE 'no_rows' %]
63
                <span>Job failed - [% m.error_message | html %]</span>
65
                <span>No valid rows were found in this file. Please check the file formatting.</span>
64
            [% END %]
66
            [% END %]
65
        </div>
67
        </div>
66
    [% END %]
68
    [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesKBARTImport.vue (-22 / +26 lines)
Lines 12-19 Link Here
12
                        )
12
                        )
13
                    }}
13
                    }}
14
                    <ol>
14
                    <ol>
15
                        <li>Column headings row</li>
15
                        <li>{{ $__("Column headings row") }}</li>
16
                        <li>Title data row</li>
16
                        <li>{{ $__("Title data row") }}</li>
17
                    </ol>
17
                    </ol>
18
                </li>
18
                </li>
19
            </ul>
19
            </ul>
Lines 141-176 export default { Link Here
141
                    let message = ""
141
                    let message = ""
142
                    if (success.job_ids) {
142
                    if (success.job_ids) {
143
                        if (success.job_ids.length > 1) {
143
                        if (success.job_ids.length > 1) {
144
                            message += this.$__(
144
                            message += `<p style='font-weight: normal; font-size: medium; margin-top: 1em;'>${this.$__(
145
                                "<p style='font-weight: normal; font-size: medium; margin-top: 1em;'>Your file was too large to process in one job, the file has been split into %s jobs to meet the maximum size limits.</p>"
145
                                "Your file was too large to process in one job, the file has been split into %s jobs to meet the maximum size limits."
146
                            ).format(success.job_ids.length)
146
                            ).format(success.job_ids.length)}</p>`
147
                        }
147
                        }
148
                        success.job_ids.forEach((job, i) => {
148
                        success.job_ids.forEach((job, i) => {
149
                            message += this.$__(
149
                            message += `<li>${this.$__(
150
                                '<li>Job %s for uploaded file has been queued, <a href="/cgi-bin/koha/admin/background_jobs.pl?op=view&id=%s" target="_blank">click here</a> to check its progress.</li>'
150
                                "Job %s for uploaded file has been queued"
151
                            ).format(i + 1, job)
151
                            ).format(
152
                                i + 1,
153
                                job
154
                            )}, <a href="/cgi-bin/koha/admin/background_jobs.pl?op=view&id=%s" target="_blank">${this.$__(
155
                                "see progress"
156
                            )}</a></li>`
152
                        })
157
                        })
153
                        this.setMessage(message, true)
158
                        this.setMessage(message, true)
154
                    }
159
                    }
155
                    if (success.warnings.invalid_columns) {
160
                    if (success.warnings.invalid_columns) {
156
                        message += this.$__(
161
                        message += `<p style='font-weight: normal; font-size: medium; margin-top: 1em;'>${this.$__(
157
                            "<p style='font-weight: normal; font-size: medium; margin-top: 1em;'>Information:</p>"
162
                            "Information:"
158
                        )
163
                        )}</p>`
159
                        message += this.$__(
164
                        message += `<p>${this.$__(
160
                            "<p>Additional columns were detected in your report, please see the list below:</p>"
165
                            "Additional columns were detected in your report, please see the list below:"
161
                        )
166
                        )}</p>`
162
                        success.warnings.invalid_columns.forEach(column => {
167
                        success.warnings.invalid_columns.forEach(column => {
163
                            message += this.$__(`<li>%s</li>`).format(column)
168
                            message += `<li>${column}</li>`
164
                        })
169
                        })
165
                        message += this.$__(
170
                        message += `<p style='margin-top: 0.1em;'>${this.$__(
166
                            "<p style='margin-top: 0.1em;'>The data in these columns will not be imported.</p>"
171
                            "The data in these columns will not be imported."
167
                        )
172
                        )}</p>`
168
                        this.setMessage(message, true)
173
                        this.setMessage(message, true)
169
                    }
174
                    }
170
                    if (success.invalid_filetype) {
175
                    if (success.invalid_filetype) {
171
                        message += this.$__(
176
                        message += `<p>${this.$__(
172
                            "<p>The file must be in .tsv or .csv format, please convert your file and try again.</p>"
177
                            "The file must be in .tsv or .csv format, please convert your file and try again."
173
                        )
178
                        )}</p>`
174
                        setWarning(message)
179
                        setWarning(message)
175
                    }
180
                    }
176
                },
181
                },
177
- 

Return to bug 34788