Bug 34478: Update label ops 'edit' to 'edit_form'

This serves to clarify that the 'edit' is not an update action in this
case, but instead is a form fetch.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Martin Renvoize 2024-01-24 11:09:22 +00:00 committed by Jonathan Druart
parent adbe19c06b
commit cd02e45119
Signed by: jonathan.druart
GPG key ID: A085E712BEF0E0F0
4 changed files with 4 additions and 4 deletions

View file

@ -94,7 +94,7 @@
[% FOREACH text_field IN table_loo.text_fields %] [% FOREACH text_field IN table_loo.text_fields %]
[% IF ( text_field.select_field ) %] [% IF ( text_field.select_field ) %]
<td class="actions"> <td class="actions">
<a class="btn btn-default btn-xs" href="/cgi-bin/koha/labels/label-edit-[% label_element |url %].pl?op=edit&amp;element_id=[% text_field.field_value |url %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a> <a class="btn btn-default btn-xs" href="/cgi-bin/koha/labels/label-edit-[% label_element |url %].pl?op=edit_form&amp;element_id=[% text_field.field_value |url %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a>
<a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/labels/label-manage.pl?op=delete&amp;label_element=[% label_element | html %]&amp;element_id=[% text_field.field_value |url %]"><i class="fa fa-trash-can"></i> Delete</a> <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/labels/label-manage.pl?op=delete&amp;label_element=[% label_element | html %]&amp;element_id=[% text_field.field_value |url %]"><i class="fa fa-trash-can"></i> Delete</a>
</td> </td>
[% IF label_element == 'batch' %] <td><input type="checkbox" name="action" value="[% text_field.field_value | html %]" /></td>[% END %] [% IF label_element == 'batch' %] <td><input type="checkbox" name="action" value="[% text_field.field_value | html %]" /></td>[% END %]

View file

@ -86,7 +86,7 @@ sub _select_format_string { # generate field table based on format_string
return (\@fields, $field_count); return (\@fields, $field_count);
} }
if ($op eq 'edit') { if ($op eq 'edit_form') {
warn sprintf("Error performing '%s': No 'layout_id' passed in.", $op) unless ($layout_id); warn sprintf("Error performing '%s': No 'layout_id' passed in.", $op) unless ($layout_id);
$layout = C4::Labels::Layout->retrieve(layout_id => $layout_id); $layout = C4::Labels::Layout->retrieve(layout_id => $layout_id);

View file

@ -45,7 +45,7 @@ my @label_template = ();
my $units = get_unit_values(); my $units = get_unit_values();
if ($op eq 'edit') { if ($op eq 'edit_form') {
$profile = C4::Labels::Profile->retrieve(profile_id => $profile_id); $profile = C4::Labels::Profile->retrieve(profile_id => $profile_id);
$template_list = get_all_templates( { fields => [ qw( template_id template_code profile_id) ] } ); $template_list = get_all_templates( { fields => [ qw( template_id template_code profile_id) ] } );
} }

View file

@ -44,7 +44,7 @@ my $profile_list = undef;
my $units = get_unit_values(); my $units = get_unit_values();
if ($op eq 'edit') { if ($op eq 'edit_form') {
$label_template = C4::Labels::Template->retrieve(template_id => $template_id); $label_template = C4::Labels::Template->retrieve(template_id => $template_id);
$profile_list = get_all_profiles({ fields => [ qw( profile_id printer_name paper_bin ) ], filters => { template_id => [ $template_id, '' ], creator => 'Labels'} } ); $profile_list = get_all_profiles({ fields => [ qw( profile_id printer_name paper_bin ) ], filters => { template_id => [ $template_id, '' ], creator => 'Labels'} } );
push @$profile_list, {paper_bin => 'N/A', profile_id => 0, printer_name => 'No Profile'}; push @$profile_list, {paper_bin => 'N/A', profile_id => 0, printer_name => 'No Profile'};