Bugzilla – Attachment 180520 Details for
Bug 38457
Add additional fields support to debit types
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38457: Add additional fields to debit types
Bug-38457-Add-additional-fields-to-debit-types.patch (text/plain), 34.65 KB, created by
Laura Escamilla
on 2025-04-03 13:12:13 UTC
(
hide
)
Description:
Bug 38457: Add additional fields to debit types
Filename:
MIME Type:
Creator:
Laura Escamilla
Created:
2025-04-03 13:12:13 UTC
Size:
34.65 KB
patch
obsolete
>From d6c1ba3a487750b054602f3b73a7dae58c2a94b3 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 17 Dec 2024 14:27:42 +0000 >Subject: [PATCH] Bug 38457: Add additional fields to debit types > >Test plan, k-t-d: >1) Before defining any additional fields for account_debit_types, > confirm that the 'Additional fields' section does not appear when > attempting to add a new or edit an existing debit type. >2) Add a new additional field to 'account_debit_types': > <staff_url>/cgi-bin/koha/admin/additional-fields.pl?tablename=account_debit_types >3) Click 'New field'. Add a name. Click Save. >4) Repeat step 2 but repeatable. Repeat again for 2 more of AV category > (one repeatable, one not repeatable) >5) Edit an account debit type: > <staff_url>/cgi-bin/koha/admin/debit_types.pl?op=add_form&code=MANUAL >6) Input various values in the different additional fields. Click > 'Submit' >7) Edit the same debit type again and note the additional fields added > in the previous step are visible > <staff_url>/cgi-bin/koha/admin/debit_types.pl?op=add_form&code=MANUAL > >Sponsored-by: PTFS Europe <https://ptfs-europe.com> >Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com> >--- > Koha/Account/DebitType.pm | 2 +- > Koha/Account/DebitTypes.pm | 2 +- > admin/debit_types.pl | 14 +- > .../en/modules/admin/additional-fields.tt | 11 +- > .../prog/en/modules/admin/debit_types.tt | 415 +++++++++--------- > 5 files changed, 231 insertions(+), 213 deletions(-) > >diff --git a/Koha/Account/DebitType.pm b/Koha/Account/DebitType.pm >index 1d5f7f1418..af04a64622 100644 >--- a/Koha/Account/DebitType.pm >+++ b/Koha/Account/DebitType.pm >@@ -22,7 +22,7 @@ use Modern::Perl; > use Koha::Database; > use Koha::Exceptions; > >-use base qw(Koha::Object Koha::Object::Limit::Library); >+use base qw(Koha::Object::Mixin::AdditionalFields Koha::Object Koha::Object::Limit::Library); > > =head1 NAME > >diff --git a/Koha/Account/DebitTypes.pm b/Koha/Account/DebitTypes.pm >index 3860264d50..200f990a5f 100644 >--- a/Koha/Account/DebitTypes.pm >+++ b/Koha/Account/DebitTypes.pm >@@ -22,7 +22,7 @@ use Modern::Perl; > use Koha::Database; > use Koha::Account::DebitType; > >-use base qw(Koha::Objects Koha::Objects::Limit::Library); >+use base qw(Koha::Objects::Mixin::AdditionalFields Koha::Objects Koha::Objects::Limit::Library); > > =head1 NAME > >diff --git a/admin/debit_types.pl b/admin/debit_types.pl >index 9425f5cab8..6b19f3d8c0 100755 >--- a/admin/debit_types.pl >+++ b/admin/debit_types.pl >@@ -27,6 +27,7 @@ use C4::Output qw( output_html_with_http_headers ); > > use Koha::Account::DebitType; > use Koha::Account::DebitTypes; >+use Koha::AdditionalFields; > > my $input = CGI->new; > my $code = $input->param('code'); >@@ -66,9 +67,14 @@ if ( $op eq 'add_form' ) { > }; > } > >+ my @additional_fields = Koha::AdditionalFields->search( { tablename => 'account_debit_types' } )->as_list; >+ my @additional_field_values = $debit_type ? $debit_type->get_additional_field_values_for_template : (); >+ > $template->param( >- debit_type => $debit_type, >- branches_loop => \@branches_loop >+ debit_type => $debit_type, >+ branches_loop => \@branches_loop, >+ additional_fields => \@additional_fields, >+ additional_field_values => @additional_field_values, > ); > } elsif ( $op eq 'cud-add_validate' ) { > my $description = $input->param('description'); >@@ -90,6 +96,10 @@ if ( $op eq 'add_form' ) { > try { > $debit_type->store; > $debit_type->replace_library_limits( \@branches ); >+ >+ my @additional_fields = $debit_type->prepare_cgi_additional_field_values( $input, 'account_debit_types' ); >+ $debit_type->set_additional_fields( \@additional_fields ); >+ > push @messages, { type => 'message', code => 'success_on_saving' }; > } catch { > push @messages, { type => 'error', code => 'error_on_saving' }; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/additional-fields.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/additional-fields.tt >index 8b97922eb2..f7ec537e61 100755 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/additional-fields.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/additional-fields.tt >@@ -147,11 +147,16 @@ > [% WRAPPER table_option value="erm_packages" %]Packages[% END %] > </ul> > [% END %] >- [% IF CAN_user_updatecharges_remaining_permissions %] >+ [% IF CAN_user_updatecharges_remaining_permissions || CAN_user_parameters_manage_accounts %] > <h3>Patrons</h3> > <ul> >- [% WRAPPER table_option value="accountlines:credit" %]Account lines (credit)[% END %] >- [% WRAPPER table_option value="accountlines:debit" %]Account lines (debit)[% END %] >+ [% IF CAN_user_updatecharges_remaining_permissions %] >+ [% WRAPPER table_option value="accountlines:credit" %]Account lines (credit)[% END %] >+ [% WRAPPER table_option value="accountlines:debit" %]Account lines (debit)[% END %] >+ [% END %] >+ [% IF ( CAN_user_parameters_manage_accounts ) %] >+ [% WRAPPER table_option value="account_debit_types" %]Account debit types[% END %] >+ [% END %] > </ul> > [% END %] > [% IF CAN_user_serials_edit_subscription %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/debit_types.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/debit_types.tt >index dbe0198abe..17487e6831 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/debit_types.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/debit_types.tt >@@ -7,20 +7,18 @@ > [% SET footerjs = 1 %] > [% PROCESS 'accounts.inc' %] > [% INCLUDE 'doc-head-open.inc' %] >-<title >- >[% FILTER collapse %] >- [% IF op =='add_form' %] >- [% IF debit_type.code %] >- [% tx("Modify debit type '{debit_type}'", { debit_type = debit_type.code }) | html %] >- [% ELSE %] >- [% t("New debit type") | html %] >- [% END %] >- › >- [% END %] >- [% t("Debit types") | html %] >- › [% t("Administration") | html %] › [% t("Koha") | html %] >- [% END %]</title >-> >+<title>[% FILTER collapse %] >+ [% IF op =='add_form' %] >+ [% IF debit_type.code %] >+ [% tx("Modify debit type '{debit_type}'", { debit_type = debit_type.code }) | html %] >+ [% ELSE %] >+ [% t("New debit type") | html %] >+ [% END %] › >+ [% END %] >+ [% t("Debit types") | html %] › >+ [% t("Administration") | html %] › >+ [% t("Koha") | html %] >+[% END %]</title> > [% INCLUDE 'doc-head-close.inc' %] > </head> > >@@ -46,6 +44,7 @@ > <span>New debit type</span> > [% END %] > [% END %] >+ > [% ELSE %] > [% WRAPPER breadcrumb_item bc_active= 1 %] > <span>Debit types</span> >@@ -56,205 +55,209 @@ > > [% WRAPPER 'main-container.inc' aside='admin-menu' %] > >- [% FOREACH m IN messages %] >- <div class="alert alert-[% m.type | html %]"> >- [% SWITCH m.code %] >- [% CASE 'success_on_saving' %] >- <span>Debit type saved successfully.</span> >- [% CASE 'error_on_saving' %] >- <span>An error occurred when saving this debit type. Check the logs for details.</span> >- [% CASE 'success_on_archive' %] >- <span>Debit type archived successfully.</span> >- [% CASE 'success_on_restore' %] >- <span>Debit type restored successfully.</span> >- [% CASE %] >- <span>[% m.code | html %]</span> >- [% END %] >- </div> >- [% END %] >- >- [% IF op == 'add_form' %] >- [% IF debit_type %] >- <h1>[% tx("Modify debit type '{debit_type}'", { debit_type = debit_type.code }) | html %]</h1> >- [% ELSE %] >- <h1>New debit type</h1> >- [% END %] >- >- <form action="/cgi-bin/koha/admin/debit_types.pl" name="Aform" method="post" class="validated"> >- [% INCLUDE 'csrf-token.inc' %] >- <input type="hidden" name="op" value="cud-add_validate" /> >- <fieldset class="rows"> >- <ol> >- <li> >- <label for="code" class="required">Debit type code: </label> >- [% IF debit_type %] >- <strong>[% debit_type.code | html %]</strong> >- <input type="hidden" name="code" value="[% code | html %]" /> >- [% ELSE %] >- <input type="text" name="code" id="code" size="80" maxlength="64" class="required focus" required="required" /><span class="required">Required. Maximum length is 64 letters</span> >- [% END %] >- </li> >- <li> >- <label for="default_amount">Default amount: </label> >- <input type="text" pattern="^\d+(\.\d{2})?$" name="default_amount" id="default_amount" size="80" maxlength="100" value="[% debit_type.default_amount | $Price on_editing => 1 %]" step="any" min="0" /> >- </li> >- <li> >- <label for="description" class="required">Description: </label> >- [% IF debit_type && debit_type.is_system %] >- <span>[%- PROCESS debit_type_description debit_type = debit_type -%]</span> >- [% ELSE %] >- <input type="text" name="description" id="description" required="required" class="required" size="80" maxlength="100" value="[% debit_type.description | html %]" /> <span class="required">Required</span> >- [% END %] >- </li> >- <li> >- <label for="can_be_invoiced">Can be manually invoiced? </label> >- [% IF debit_type.can_be_invoiced %] >- <input type="checkbox" name="can_be_invoiced" id="can_be_invoiced" checked="checked" value="1" /> >- [% ELSE %] >- <input type="checkbox" name="can_be_invoiced" id="can_be_invoiced" value="1" /> >- [% END %] >- </li> >- <li> >- <label for="can_be_sold">Can be sold? </label> >- [% IF debit_type.can_be_sold %] >- <input type="checkbox" name="can_be_sold" id="can_be_sold" checked="checked" value="1" /> >- [% ELSE %] >- <input type="checkbox" name="can_be_sold" id="can_be_sold" value="1" /> >- [% END %] >- </li> >- <li> >- <label for="restricts_checkouts">Included in noissuescharge? </label> >- [% IF debit_type.restricts_checkouts %] >- <input type="checkbox" name="restricts_checkouts" id="restricts_checkouts" checked="checked" value="1" /> >- [% ELSE %] >- <input type="checkbox" name="restricts_checkouts" id="restricts_checkouts" value="1" /> >- [% END %] >- </li> >- <li> >- <label for="branches">Libraries limitation: </label> >- <select id="branches" name="branches" multiple size="10"> >- <option value="">All libraries</option> >- [% FOREACH branch IN branches_loop %] >- [% IF ( branch.selected ) %] >- <option selected="selected" value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option> >- [% ELSE %] >- <option value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option> >- [% END %] >- [% END %] >- </select> >- <div class="hint">Select 'All libraries' if this debit type should be available at all libraries. Otherwise select libraries you want to associate debit type with.</div> >- </li> >- </ol> >- </fieldset> >- >- <fieldset class="action"> >- <button id="save_debit_type" class="btn btn-primary">Save</button> >- <a class="cancel" href="/cgi-bin/koha/admin/debit_types.pl">Cancel</a> >- </fieldset> >- </form> >- [% END %] >+ [% FOREACH m IN messages %] >+ <div class="alert alert-[% m.type | html %]"> >+ [% SWITCH m.code %] >+ [% CASE 'success_on_saving' %] >+ <span>Debit type saved successfully.</span> >+ [% CASE 'error_on_saving' %] >+ <span>An error occurred when saving this debit type. Check the logs for details.</span> >+ [% CASE 'success_on_archive' %] >+ <span>Debit type archived successfully.</span> >+ [% CASE 'success_on_restore' %] >+ <span>Debit type restored successfully.</span> >+ [% CASE %] >+ <span>[% m.code | html %]</span> >+ [% END %] >+ </div> >+ [% END %] > >- [% IF op == 'list' %] >- <div id="toolbar" class="btn-toolbar"> >- <a class="btn btn-default" id="newdebittype" href="/cgi-bin/koha/admin/debit_types.pl?op=add_form"><i class="fa fa-plus"></i> New debit type</a> >- </div> >+ [% IF op == 'add_form' %] >+ [% IF debit_type %] >+ <h1>[% tx("Modify debit type '{debit_type}'", { debit_type = debit_type.code }) | html %]</h1> >+ [% ELSE %] >+ <h1>New debit type</h1> >+ [% END %] > >- <h1>Debit types</h1> >- [% IF debit_types.count %] >- <div class="page-section"> >- <table id="table_debit_types"> >- <thead> >- <th>Archived</th> >- <th>System</th> >- <th>Code</th> >- <th>Description</th> >- <th>Default amount</th> >- <th>Available for</th> >- <th>Library limitations</th> >- <th>Blocks checkouts?</th> >- <th class="noExport">Actions</th> >- </thead> >- <tbody> >- [% FOREACH debit_type IN debit_types %] >- <tr> >- <td>[% debit_type.archived | html %]</td> >- <td>[% debit_type.is_system | html %]</td> >- <td>[% debit_type.code | html %]</td> >- <td>[%- PROCESS debit_type_description debit_type = debit_type -%]</td> >- <td>[% debit_type.default_amount | $Price %]</td> >- <td >- >[% IF debit_type.can_be_invoiced && debit_type.can_be_sold %] >- <i class="fa fa-id-card"></i> Invoicing, <i class="fa fa-shopping-cart"></i> Sale >- [% ELSIF debit_type.can_be_invoiced %] >- <i class="fa fa-id-card"></i> Invoicing >- [% ELSIF debit_type.can_be_sold %] >- <i class="fa fa-shopping-cart"></i> Sale >+ <form action="/cgi-bin/koha/admin/debit_types.pl" name="Aform" method="post" class="validated"> >+ [% INCLUDE 'csrf-token.inc' %] >+ <input type="hidden" name="op" value="cud-add_validate" /> >+ <fieldset class="rows"> >+ <ol> >+ <li> >+ <label for="code" class="required">Debit type code: </label> >+ [% IF debit_type %] >+ <strong>[% debit_type.code | html %]</strong> >+ <input type="hidden" name="code" value="[% code | html %]" /> >+ [% ELSE %] >+ <input type="text" name="code" id="code" size="80" maxlength="64" class="required focus" required="required"><span class="required">Required. Maximum length is 64 letters</span> > [% END %] >- </td> >- <td> >- [% IF debit_type.library_limits.count > 0 %] >- [% library_limits_str = "" %] >- [% FOREACH library IN debit_type.library_limits %] >- [%- IF loop.first -%] >- [% library_limits_str = library.branchname _ " (" _ library.branchcode _ ")" %] >- [% ELSE %] >- [% library_limits_str = library_limits_str _ "\n" _ library.branchname _ " (" _ library.branchcode _ ")" %] >- [% END %] >- [% END %] >- <span class="library_limitation" title="[% library_limits_str | html %]"> >- [% IF debit_type.library_limits.count > 1 %] >- <span>[% debit_type.library_limits.count | html %] library limitations</span> >- [% ELSE %] >- <span>[% debit_type.library_limits.count | html %] library limitation</span> >- [% END %] >- </span> >+ </li> >+ <li> >+ <label for="default_amount">Default amount: </label> >+ <input type="text" pattern="^\d+(\.\d{2})?$" name="default_amount" id="default_amount" size="80" maxlength="100" value="[% debit_type.default_amount | $Price on_editing => 1 %]" step="any" min="0"/> >+ </li> >+ <li> >+ <label for="description" class="required">Description: </label> >+ [% IF debit_type && debit_type.is_system %] >+ <span>[%- PROCESS debit_type_description debit_type = debit_type -%]</span> >+ [% ELSE %] >+ <input type="text" name="description" id="description" required="required" class="required" size="80" maxlength="100" value="[% debit_type.description | html %]" /> <span class="required">Required</span> >+ [% END %] >+ </li> >+ <li> >+ <label for="can_be_invoiced">Can be manually invoiced? </label> >+ [% IF debit_type.can_be_invoiced %] >+ <input type="checkbox" name="can_be_invoiced" id="can_be_invoiced" checked="checked" value="1" /> > [% ELSE %] >- <span>No limitation</span> >+ <input type="checkbox" name="can_be_invoiced" id="can_be_invoiced" value="1" /> > [% END %] >- </td> >- <td> >+ </li> >+ <li> >+ <label for="can_be_sold">Can be sold? </label> >+ [% IF debit_type.can_be_sold %] >+ <input type="checkbox" name="can_be_sold" id="can_be_sold" checked="checked" value="1" /> >+ [% ELSE %] >+ <input type="checkbox" name="can_be_sold" id="can_be_sold" value="1" /> >+ [% END %] >+ </li> >+ <li> >+ <label for="restricts_checkouts">Included in noissuescharge? </label> > [% IF debit_type.restricts_checkouts %] >- <span>Yes</span> >+ <input type="checkbox" name="restricts_checkouts" id="restricts_checkouts" checked="checked" value="1" /> > [% ELSE %] >- <span>No</span> >+ <input type="checkbox" name="restricts_checkouts" id="restricts_checkouts" value="1" /> > [% END %] >- </td> >- <td class="actions"> >- [% IF !debit_type.archived %] >- <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/debit_types.pl?op=add_form&code=[% debit_type.code | uri %]&type=debit"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a> >- [% IF !debit_type.is_system %] >- <form id="archive_[% debit_type.code | html %]" method="post" action="/cgi-bin/koha/admin/debit_types.pl"> >- [% INCLUDE 'csrf-token.inc' %] >- <input type="hidden" name="op" value="cud-archive" /> >- <input type="hidden" name="code" value="[% debit_type.code | html %]" /> >- <button type="submit" class="btn btn-default btn-xs archive_button" href="#" data-code="[% debit_type.code | html %]"><i class="fa fa-archive"></i> Archive</button> >- </form> >+ </li> >+ <li> >+ <label for="branches">Libraries limitation: </label> >+ <select id="branches" name="branches" multiple size="10"> >+ <option value="">All libraries</option> >+ [% FOREACH branch IN branches_loop %] >+ [% IF ( branch.selected ) %] >+ <option selected="selected" value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option> >+ [% ELSE %] >+ <option value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option> > [% END %] >- [% ELSIF debit_type.archived %] >- <form id="unarchive_[% debit_type.code | html %]" method="post" action="/cgi-bin/koha/admin/debit_types.pl"> >- [% INCLUDE 'csrf-token.inc' %] >- <input type="hidden" name="op" value="cud-unarchive" /> >- <input type="hidden" name="code" value="[% debit_type.code | html %]" /> >- <button type="submit" class="btn btn-default btn-xs unarchive_button" href="#" data-code="[% debit_type.code | html %]"><i class="fa fa-undo"></i> Restore</button> >- </form> >- [% END %] >- </td> >- </tr> >+ [% END %] >+ </select> >+ <div class="hint">Select 'All libraries' if this debit type should be available at all libraries. Otherwise select libraries you want to associate debit type with.</div> >+ </li> >+ </ol> >+ </fieldset> >+ [% IF additional_fields.size %] >+ [% INCLUDE 'additional-fields-entry.inc' available=additional_fields values=additional_field_values wrap_fieldset=1 %] > [% END %] >- </tbody> >- </table> </div >- ><!-- /.page-section --> >- [% ELSE %] >- <div class="alert alert-info"> There are no account debit types defined. <a href="/cgi-bin/koha/admin/debit_types.pl?op=add_form">Create new debit type</a> </div> >- [% END %] >- [% END %] >+ <fieldset class="action"> >+ <button id="save_debit_type" class="btn btn-primary">Save</button> >+ <a class="cancel" href="/cgi-bin/koha/admin/debit_types.pl">Cancel</a> >+ </fieldset> >+ </form> >+ [% END %] >+ >+ [% IF op == 'list' %] >+ <div id="toolbar" class="btn-toolbar"> >+ <a class="btn btn-default" id="newdebittype" href="/cgi-bin/koha/admin/debit_types.pl?op=add_form"><i class="fa fa-plus"></i> New debit type</a> >+ </div> >+ >+ <h1>Debit types</h1> >+ [% IF debit_types.count %] >+ <div class="page-section"> >+ <table id="table_debit_types"> >+ <thead> >+ <th>Archived</th> >+ <th>System</th> >+ <th>Code</th> >+ <th>Description</th> >+ <th>Default amount</th> >+ <th>Available for</th> >+ <th>Library limitations</th> >+ <th>Blocks checkouts?</th> >+ <th class="noExport">Actions</th> >+ </thead> >+ <tbody> >+ [% FOREACH debit_type IN debit_types %] >+ <tr> >+ <td>[% debit_type.archived | html %]</td> >+ <td>[% debit_type.is_system | html %]</td> >+ <td>[% debit_type.code | html %]</td> >+ <td>[%- PROCESS debit_type_description debit_type = debit_type -%]</td> >+ <td>[% debit_type.default_amount | $Price %]</td> >+ <td>[% IF debit_type.can_be_invoiced && debit_type.can_be_sold %] >+ <i class="fa fa-id-card"></i> Invoicing, <i class="fa fa-shopping-cart"></i> Sale >+ [% ELSIF debit_type.can_be_invoiced %] >+ <i class="fa fa-id-card"></i> Invoicing >+ [% ELSIF debit_type.can_be_sold %] >+ <i class="fa fa-shopping-cart"></i> Sale >+ [% END %] >+ </td> >+ <td> >+ [% IF debit_type.library_limits.count > 0 %] >+ [% library_limits_str = "" %] >+ [% FOREACH library IN debit_type.library_limits %] >+ [%- IF loop.first -%] >+ [% library_limits_str = library.branchname _ " (" _ library.branchcode _ ")" %] >+ [% ELSE %] >+ [% library_limits_str = library_limits_str _ "\n" _ library.branchname _ " (" _ library.branchcode _ ")" %] >+ [% END %] >+ [% END %] >+ <span class="library_limitation" title="[% library_limits_str | html %]"> >+ [% IF debit_type.library_limits.count > 1 %] >+ <span>[% debit_type.library_limits.count | html %] library limitations</span> >+ [% ELSE %] >+ <span>[% debit_type.library_limits.count | html %] library limitation</span> >+ [% END %] >+ [% ELSE %] >+ <span>No limitation</span> >+ [% END %] >+ </td> >+ <td> >+ [% IF debit_type.restricts_checkouts %] >+ <span>Yes</span> >+ [% ELSE %] >+ <span>No</span> >+ [% END %] >+ </td> >+ <td class="actions"> >+ [% IF !debit_type.archived %] >+ <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/debit_types.pl?op=add_form&code=[% debit_type.code | uri %]&type=debit"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a> >+ [% IF !debit_type.is_system %] >+ <form id="archive_[% debit_type.code | html %]" method="post" action="/cgi-bin/koha/admin/debit_types.pl"> >+ [% INCLUDE 'csrf-token.inc' %] >+ <input type="hidden" name="op" value="cud-archive" /> >+ <input type="hidden" name="code" value="[% debit_type.code | html %]" /> >+ <button type="submit" class="btn btn-default btn-xs archive_button" href="#" data-code="[% debit_type.code | html %]"><i class="fa fa-archive"></i> Archive</button> >+ </form> >+ [% END %] >+ [% ELSIF debit_type.archived %] >+ <form id="unarchive_[% debit_type.code | html %]" method="post" action="/cgi-bin/koha/admin/debit_types.pl"> >+ [% INCLUDE 'csrf-token.inc' %] >+ <input type="hidden" name="op" value="cud-unarchive" /> >+ <input type="hidden" name="code" value="[% debit_type.code | html %]" /> >+ <button type="submit" class="btn btn-default btn-xs unarchive_button" href="#" data-code="[% debit_type.code | html %]"><i class="fa fa-undo"></i> Restore</button> >+ </form> >+ [% END %] >+ </td> >+ </tr> >+ [% END %] >+ </tbody> >+ </table> >+ </div><!-- /.page-section --> >+ [% ELSE %] >+ <div class="alert alert-info"> >+ There are no account debit types defined. <a href="/cgi-bin/koha/admin/debit_types.pl?op=add_form">Create new debit type</a> >+ </div> >+ [% END %] >+ [% END %] > [% END %] > > [% MACRO jsinclude BLOCK %] > [% Asset.js("js/admin-menu.js") | $raw %] >+ [% Asset.js("js/additional-fields-entry.js") | $raw %] > [% INCLUDE 'datatables.inc' %] >+ > <script> >- $(document).ready(function () { >+ $(document).ready(function() { > var txtActivefilter = _("Filter system debit types"); > var txtInactivefilter = _("Show all debit types"); > var table_debit_types = $("#table_debit_types").kohaTable({ >@@ -273,20 +276,20 @@ > $("#filter_s").html('<p><a href="#" id="filter_system"><i class="fa fa-filter"></i> ' + txtActivefilter + "</a>"); > $("#filter_system").click(function (e) { > e.preventDefault(); >- if ($(this).hasClass("filtered")) { >- var filteredValue = ""; >- $(this).html('<i class="fa fa-filter"></i> ' + txtActivefilter); >- } else { >- // Not filtered. Let's do it! >- var filteredValue = "0"; >- $(this).html('<i class="fa fa-filter"></i> ' + txtInactivefilter); >+ if ($(this).hasClass('filtered')) { >+ var filteredValue = ''; >+ $(this).html('<i class="fa fa-filter"></i> '+txtActivefilter); >+ } else { // Not filtered. Let's do it! >+ var filteredValue = '0'; >+ $(this).html('<i class="fa fa-filter"></i> '+txtInactivefilter); > } > table_debit_types.DataTable().columns(1).search(filteredValue, false, false).draw(); >- $(this).toggleClass("filtered"); >+ $(this).toggleClass('filtered'); > }); > > //Start filtered >- $("#filter_system").click(); >+ $('#filter_system').click(); >+ > }); > </script> > [% END %] >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 38457
:
175630
|
175631
|
175633
|
176789
|
176790
|
176791
|
178394
|
178395
|
178396
|
178397
|
178398
|
180494
|
180495
|
180496
|
180497
|
180498
|
180519
|
180520
|
180521
|
180522
|
180523
|
182384
|
182385
|
182386
|
182387
|
182388
|
182575