From c35f6f70a0952617e47934de0a86469d42b9c47f Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 14 Apr 2021 17:43:38 +0000 Subject: [PATCH] Bug 28149: Improve internationalization and formatting on background jobs page MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This patch adds some logic to the background jobs template in order to make job status and job type translatable. Output of dates has been changed to use the KohaDates plugin, using the "with_hours" flag. This patch also modifies the page title and breadcrumbs so that if one is viewing the details of a background job the page title and breadcrumbs reflect this. I've also added inclusion of the preferences search form in the header, the default for administration pages which don't have their own search. To test, apply the patch and go to Administration -> Background jobs. - If there are no background jobs listed, submit at least one batch of bibliograhpic records and at least one batch of authorty records for modification (Tools -> Batch record modification). - In the table of background jobs, the status should be shown correctly. If you see it capitalized ("Finished") you're seeing the new string in the template which will be used for translation. - In the "Type" column, you should see either "Batch authority record modification" or "Batch bibliographic record modification" - In the "Queued," "Started," and "Ended" columns the date should be formatted according to your system's dateformat system preference, including the time. - View the details of a background job. The same changes to status and type should be seen on this page, as well as the date formatting of the date fields. - In the breadcrumbs, confirm that it shows a link to the background jobs page followed by "Details if job #X". Signed-off-by: Fridolin Somers Signed-off-by: Joonas Kylmälä Signed-off-by: Jonathan Druart --- .../prog/en/modules/admin/background_jobs.tt | 95 +++++++++++++++---- 1 file changed, 74 insertions(+), 21 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/background_jobs.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/background_jobs.tt index 64f2278c20..40a0abe6c7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/background_jobs.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/background_jobs.tt @@ -1,21 +1,46 @@ [% USE raw %] [% USE Asset %] +[% USE KohaDates %] [% SET footerjs = 1 %] +[% BLOCK show_job_status %] + [% SWITCH job.status %] + [% CASE "cancelled" %] + Cancelled + [% CASE "finished" %] + Finished + [% CASE "started" %] + Started + [% CASE "running" %] + Running + [% CASE # Default case %] + [% job.status | html %] + [% END -%] +[% END %] +[% BLOCK show_job_type %] + [% SWITCH job.type %] + [% CASE "batch_biblio_record_modification" %] + Batch bibliographic record modification + [% CASE "batch_authority_record_modification" %] + Batch authority record modification + [% CASE # Default case %] + [% job.type | html %] + [% END %] +[% END %] [% INCLUDE 'doc-head-open.inc' %] -[% IF op =='add_form' %] - [% IF job %] - View background job - [% ELSE %] - Background jobs - [% END %] › Background jobs › [% END %] -Administration › Koha + [% IF op == 'view' %] + Details of job #[% job.id | html %] › + [% END %] + Background jobs › + Administration › Koha + [% INCLUDE 'doc-head-close.inc' %] [% INCLUDE 'header.inc' %] +[% INCLUDE 'prefs-admin-search.inc' %]