Skip to content

Commit

Permalink
Merge pull request #7 from matthiaslegac/master
Browse files Browse the repository at this point in the history
cam18326: ajout l'affichage dans la liste des tâches dans l'admin
  • Loading branch information
philblou authored Mar 19, 2024
2 parents d0d07b4 + d9aedc2 commit 069bbdf
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 4 deletions.
26 changes: 22 additions & 4 deletions Koha/Plugin/PDFtoCover.pm
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ BEGIN {
}

our $dbh = C4::Context->dbh();
our $VERSION = 2.0;
our $VERSION = 2.1;
our $metadata = {
name => 'PDFtoCover',
author => 'Mehdi Hamidi, Bouzid Fergani, Arthur Bousquet, The Minh Luong',
author => 'Mehdi Hamidi, Bouzid Fergani, Arthur Bousquet, The Minh Luong, Matthias Le Gac',
description => 'Creates cover images for documents missing one',
date_authored => '2016-06-08',
date_updated => '2024-03-18',
minimum_version => '23.05',
date_updated => '2024-03-19',
minimum_version => '23.05.08',
version => $VERSION,
namespace => 'pdftocover',
};
Expand Down Expand Up @@ -356,6 +356,24 @@ sub background_tasks {
};
}

sub template_include_paths {
my ($self, $args) = @_;

if ( $args->{lang} eq 'fr' ) {
return [
$self->mbf_path('inc/fr'),
]
} elsif ( $args->{lang} eq 'fr-CA' ) {
return [
$self->mbf_path('inc/fr-CA'),
]
} else {
return [
$self->mbf_path('inc/en'),
]
}
}

#Supprimer le plugin avec toutes ses données
sub uninstall() {
my ( $self, $args ) = @_;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[% USE Koha %]

[% BLOCK process %]
[% END %]

[% SET report = job.decoded_data %]
[% BLOCK report %]
[% IF job.status == 'finished' %]
[% IF report %]
<div class="dialog message">
[% report.report.total_success | html %] covers have successfully been genereted.<br>
[% IF report.report.total_success != report.report.total_greets %]
[% report.report.total_greets - report.report.total_success | html %] covers have not been genereted, see the logs for details.
[% END %]
</div>
[% ELSE %]
<div class="dialog message">
Job data could not be read, see the logs for details
</div>
[% END %]
[% ELSIF job.status == 'cancelled' %]
<span>The job has been cancelled before it finished.</span>
[% END %]
[% END %]

[% BLOCK detail %]
[% END %]

[% BLOCK js %]
[% END %]
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[% USE Koha %]

[% BLOCK process %]
[% END %]

[% SET report = job.decoded_data %]
[% BLOCK report %]
[% IF job.status == 'finished' %]
[% IF report %]
<div class="dialog message">
[% report.report.total_success | html %] couvertures ont été générées avec succès.<br>
[% IF report.report.total_success != report.report.total_greets %]
[% report.report.total_greets - report.report.total_success | html %] couvertures n'ont pas été générées, veuillez vérifier les registres pour plus d'information.
[% END %]
</div>
[% ELSE %]
<div class="dialog message">
Les données de la tâche sont illisibles, veuillez vérifier les registres pour plus d'information. </div>
</div>
[% END %]
[% ELSIF job.status == 'cancelled' %]
<span>La tâche a été annulée avant de finir.</span>
[% END %]
[% END %]

[% BLOCK detail %]
[% END %]

[% BLOCK js %]
[% END %]
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[% USE Koha %]

[% BLOCK process %]
[% END %]

[% SET report = job.decoded_data %]
[% BLOCK report %]
[% IF job.status == 'finished' %]
[% IF report %]
<div class="dialog message">
[% report.report.total_success | html %] couvertures ont été générées avec succès.<br>
[% IF report.report.total_success != report.report.total_greets %]
[% report.report.total_greets - report.report.total_success | html %] couvertures n'ont pas été générées, veuillez vérifier les registres pour plus d'information.
[% END %]
</div>
[% ELSE %]
<div class="dialog message">
Les données de la tâche sont illisibles, veuillez vérifier les registres pour plus d'information. </div>
</div>
[% END %]
[% ELSIF job.status == 'cancelled' %]
<span>La tâche a été annulée avant de finir.</span>
[% END %]
[% END %]

[% BLOCK detail %]
[% END %]

[% BLOCK js %]
[% END %]

0 comments on commit 069bbdf

Please sign in to comment.