Bugzilla – Attachment 151521 Details for
Bug 30719
ILL should provide the ability to create batch requests
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30719: ILL Batch Statuses
Bug-30719-ILL-Batch-Statuses.patch (text/plain), 30.97 KB, created by
Pedro Amorim
on 2023-05-22 13:10:00 UTC
(
hide
)
Description:
Bug 30719: ILL Batch Statuses
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2023-05-22 13:10:00 UTC
Size:
30.97 KB
patch
obsolete
>From f278bc08596839129e89274ac46b0b45fe33cd54 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Fri, 12 May 2023 17:09:39 +0000 >Subject: [PATCH] Bug 30719: ILL Batch Statuses > >- UI adding support for batch statuses in batch UI >- Admin UI for managing batch statuses >- API specs > >Co-authored-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com> >--- > Koha/IllbatchStatus.pm | 162 ++++++++++++ > Koha/IllbatchStatuses.pm | 61 +++++ > Koha/REST/V1/IllbatchStatuses.pm | 167 +++++++++++++ > admin/ill_batch_statuses.pl | 102 ++++++++ > .../swagger/definitions/illbatchstatus.yaml | 20 ++ > .../swagger/definitions/illbatchstatuses.yaml | 5 + > api/v1/swagger/paths/illbatchstatuses.yaml | 232 ++++++++++++++++++ > .../prog/en/includes/admin-menu.inc | 3 + > .../prog/en/modules/admin/admin-home.tt | 4 + > .../en/modules/admin/ill_batch_statuses.tt | 168 +++++++++++++ > 10 files changed, 924 insertions(+) > create mode 100644 Koha/IllbatchStatus.pm > create mode 100644 Koha/IllbatchStatuses.pm > create mode 100644 Koha/REST/V1/IllbatchStatuses.pm > create mode 100755 admin/ill_batch_statuses.pl > create mode 100644 api/v1/swagger/definitions/illbatchstatus.yaml > create mode 100644 api/v1/swagger/definitions/illbatchstatuses.yaml > create mode 100644 api/v1/swagger/paths/illbatchstatuses.yaml > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/admin/ill_batch_statuses.tt > >diff --git a/Koha/IllbatchStatus.pm b/Koha/IllbatchStatus.pm >new file mode 100644 >index 0000000000..c49ec48703 >--- /dev/null >+++ b/Koha/IllbatchStatus.pm >@@ -0,0 +1,162 @@ >+package Koha::IllbatchStatus; >+ >+# Copyright PTFS Europe 2022 >+# >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+use Koha::Database; >+use Koha::Illrequest::Logger; >+use Koha::Illbatch; >+use JSON qw( to_json ); >+use base qw(Koha::Object); >+ >+=head1 NAME >+ >+Koha::IllbatchStatus - Koha IllbatchStatus Object class >+ >+=head2 Class methods >+ >+=head3 create_and_log >+ >+ $status->create_and_log; >+ >+Log batch status creation following storage >+ >+=cut >+ >+sub create_and_log { >+ my ( $self ) = @_; >+ >+ # Ensure code is uppercase and contains only word characters >+ my $fixed_code = uc $self->code; >+ $fixed_code =~ s/\W/_/; >+ >+ # Ensure this status doesn't already exist >+ my $status = Koha::IllbatchStatuses->find({ code => $fixed_code }); >+ if ($status) { >+ return { >+ error => "Duplicate status found" >+ }; >+ } >+ >+ # Ensure system statuses can't be created >+ $self->set({ >+ code => $fixed_code, >+ is_system => 0 >+ })->store; >+ >+ my $logger = Koha::Illrequest::Logger->new; >+ >+ $logger->log_something({ >+ modulename => 'ILL', >+ actionname => 'batch_status_create', >+ objectnumber => $self->id, >+ infos => to_json({}) >+ }); >+} >+ >+=head3 update_and_log >+ >+ $status->update_and_log; >+ >+Log batch status update following storage >+ >+=cut >+ >+sub update_and_log { >+ my ( $self, $params ) = @_; >+ >+ my $before = { >+ name => $self->name >+ }; >+ >+ # Ensure only the name can be changed >+ $self->set({ >+ name => $params->{name} >+ }); >+ my $update = $self->store; >+ >+ my $after = { >+ name => $self->name >+ }; >+ >+ my $logger = Koha::Illrequest::Logger->new; >+ >+ $logger->log_something({ >+ modulename => 'ILL', >+ actionname => 'batch_status_update', >+ objectnumber => $self->id, >+ infos => to_json({ >+ before => $before, >+ after => $after >+ }) >+ }); >+} >+ >+=head3 delete_and_log >+ >+ $batch->delete_and_log; >+ >+Log batch status delete >+ >+=cut >+ >+sub delete_and_log { >+ my ( $self ) = @_; >+ >+ # Don't permit deletion of system statuses >+ if ($self->is_system) { >+ return; >+ } >+ >+ # Update all batches that use this status to have status UNKNOWN >+ my $affected = Koha::Illbatches->search({ statuscode => $self->code }); >+ $affected->update({ statuscode => 'UNKNOWN'}); >+ >+ my $logger = Koha::Illrequest::Logger->new; >+ >+ $logger->log_something({ >+ modulename => 'ILL', >+ actionname => 'batch_status_delete', >+ objectnumber => $self->id, >+ infos => to_json({}) >+ }); >+ >+ $self->delete; >+} >+ >+=head2 Internal methods >+ >+=head3 _type >+ >+ my $type = Koha::IllbatchStatus->_type; >+ >+Return this object's type >+ >+=cut >+ >+sub _type { >+ return 'IllbatchStatus'; >+} >+ >+=head1 AUTHOR >+ >+Andrew Isherwood <andrew.isherwood@ptfs-europe.com> >+ >+=cut >+ >+1; >diff --git a/Koha/IllbatchStatuses.pm b/Koha/IllbatchStatuses.pm >new file mode 100644 >index 0000000000..1cbeedbd03 >--- /dev/null >+++ b/Koha/IllbatchStatuses.pm >@@ -0,0 +1,61 @@ >+package Koha::IllbatchStatuses; >+ >+# Copyright PTFS Europe 2022 >+# >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+use Koha::Database; >+use Koha::IllbatchStatus; >+use base qw(Koha::Objects); >+ >+=head1 NAME >+ >+Koha::IllbatchStatuses - Koha IllbatchStatuses Object class >+ >+=head2 Internal methods >+ >+=head3 _type >+ >+ my $type = Koha::IllbatchStatuses->_type; >+ >+Return this object's type >+ >+=cut >+ >+sub _type { >+ return 'IllbatchStatus'; >+} >+ >+=head3 object_class >+ >+ my $class = Koha::IllbatchStatuses->object_class; >+ >+Return this object's class name >+ >+=cut >+ >+sub object_class { >+ return 'Koha::IllbatchStatus'; >+} >+ >+=head1 AUTHOR >+ >+Andrew Isherwood <andrew.isherwood@ptfs-europe.com> >+ >+=cut >+ >+1; >diff --git a/Koha/REST/V1/IllbatchStatuses.pm b/Koha/REST/V1/IllbatchStatuses.pm >new file mode 100644 >index 0000000000..28f398efb1 >--- /dev/null >+++ b/Koha/REST/V1/IllbatchStatuses.pm >@@ -0,0 +1,167 @@ >+package Koha::REST::V1::IllbatchStatuses; >+ >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+ >+use Mojo::Base 'Mojolicious::Controller'; >+ >+use Koha::IllbatchStatuses; >+ >+=head1 NAME >+ >+Koha::REST::V1::IllbatchStatuses >+ >+=head2 Operations >+ >+=head3 list >+ >+Return a list of available ILL batch statuses >+ >+=cut >+ >+sub list { >+ my $c = shift->openapi->valid_input; >+ >+ my @statuses = Koha::IllbatchStatuses->search()->as_list; >+ >+ return $c->render( status => 200, openapi => \@statuses ); >+} >+ >+=head3 get >+ >+Get one batch statuses >+ >+=cut >+ >+sub get { >+ my $c = shift->openapi->valid_input; >+ >+ my $status_code = $c->validation->param('illbatchstatus_code'); >+ >+ my $status = Koha::IllbatchStatuses->find({ code => $status_code }); >+ >+ if (not defined $status) { >+ return $c->render( >+ status => 404, >+ openapi => { error => "ILL batch status not found" } >+ ); >+ } >+ >+ return $c->render( >+ status => 200, >+ openapi => { >+ %{$status->unblessed} >+ } >+ ); >+} >+ >+=head3 add >+ >+Add a new batch status >+ >+=cut >+ >+sub add { >+ my $c = shift->openapi->valid_input or return; >+ >+ my $body = $c->validation->param('body'); >+ >+ my $status = Koha::IllbatchStatus->new( $body ); >+ >+ return try { >+ my $return = $status->create_and_log; >+ if ($return && $return->{error}) { >+ return $c->render( >+ status => 500, >+ openapi => $return >+ ); >+ } else { >+ return $c->render( >+ status => 201, >+ openapi => $status >+ ); >+ } >+ } >+ catch { >+ $c->unhandled_exception($_); >+ }; >+} >+ >+=head3 update >+ >+Update a batch status >+ >+=cut >+ >+sub update { >+ my $c = shift->openapi->valid_input or return; >+ >+ my $status = Koha::IllbatchStatuses->find({ code => $c->validation->param('illbatchstatus_code') }); >+ >+ if ( not defined $status ) { >+ return $c->render( >+ status => 404, >+ openapi => { error => "ILL batch status not found" } >+ ); >+ } >+ >+ my $params = $c->req->json; >+ >+ return try { >+ # Only permit updating of name >+ $status->update_and_log({ name => $params->{name} }); >+ >+ return $c->render( >+ status => 200, >+ openapi => $status >+ ); >+ } >+ catch { >+ $c->unhandled_exception($_); >+ }; >+} >+ >+=head3 delete >+ >+Delete a batch status >+ >+=cut >+ >+sub delete { >+ >+ my $c = shift->openapi->valid_input or return; >+ >+ my $status = Koha::IllbatchStatuses->find({ code => $c->validation->param( 'illbatchstatus_code' ) }); >+ >+ if ( not defined $status ) { >+ return $c->render( status => 404, openapi => { errors => [ { message => "ILL batch status not found" } ] } ); >+ } >+ >+ if ( $status->is_system) { >+ return $c->render( status => 400, openapi => { errors => [ { message => "ILL batch status cannot be deleted" } ] } ); >+ } >+ >+ return try { >+ $status->delete_and_log; >+ return $c->render( status => 204, openapi => ''); >+ } >+ catch { >+ $c->unhandled_exception($_); >+ }; >+} >+ >+1; >diff --git a/admin/ill_batch_statuses.pl b/admin/ill_batch_statuses.pl >new file mode 100755 >index 0000000000..bf16b06ded >--- /dev/null >+++ b/admin/ill_batch_statuses.pl >@@ -0,0 +1,102 @@ >+#! /usr/bin/perl >+ >+# Copyright 2019 Koha Development Team >+# >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+use CGI qw ( -utf8 ); >+use Try::Tiny qw( catch try ); >+ >+use C4::Context; >+use C4::Auth qw( get_template_and_user ); >+use C4::Output qw( output_html_with_http_headers ); >+ >+use Koha::IllbatchStatus; >+use Koha::IllbatchStatuses; >+ >+my $input = CGI->new; >+my $code = $input->param('code'); >+my $op = $input->param('op') || 'list'; >+my @messages; >+ >+my ( $template, $loggedinuser, $cookie ) = get_template_and_user( >+ { >+ template_name => "admin/ill_batch_statuses.tt", >+ query => $input, >+ type => "intranet", >+ flagsrequired => { parameters => 'ill' }, >+ } >+); >+ >+my $status; >+if ($code) { >+ $status = Koha::IllbatchStatuses->find({ code => $code }); >+} >+ >+if ( $op eq 'add_form' ) { >+ if ($status) { >+ $template->param( >+ status => $status >+ ); >+ } >+} >+elsif ( $op eq 'add_validate' ) { >+ my $name = $input->param('name'); >+ my $code = $input->param('code'); >+ >+ if ( not defined $status ) { >+ $status = Koha::IllbatchStatus->new( { >+ name => $name, >+ code => $code >+ } ); >+ } >+ >+ try { >+ if ($status->id) { >+ $status->update_and_log({ name => $name }); >+ } else { >+ $status->create_and_log; >+ } >+ push @messages, { type => 'message', code => 'success_on_saving' }; >+ } >+ catch { >+ push @messages, { type => 'error', code => 'error_on_saving' }; >+ }; >+ $op = 'list'; >+} >+elsif ( $op eq 'delete' ) { >+ try { >+ $status->delete_and_log; >+ push @messages, { code => 'success_on_delete', type => 'message' }; >+ } >+ catch { >+ push @messages, { code => 'error_on_delete', type => 'alert' }; >+ >+ }; >+ $op = 'list'; >+} >+if ( $op eq 'list' ) { >+ my $statuses = Koha::IllbatchStatuses->search(); >+ $template->param( statuses => $statuses ); >+} >+ >+$template->param( >+ messages => \@messages, >+ op => $op, >+); >+ >+output_html_with_http_headers $input, $cookie, $template->output; >diff --git a/api/v1/swagger/definitions/illbatchstatus.yaml b/api/v1/swagger/definitions/illbatchstatus.yaml >new file mode 100644 >index 0000000000..42b2452551 >--- /dev/null >+++ b/api/v1/swagger/definitions/illbatchstatus.yaml >@@ -0,0 +1,20 @@ >+--- >+type: object >+properties: >+ id: >+ type: string >+ description: Internal ILL batch status identifier >+ name: >+ type: string >+ description: Status name >+ code: >+ type: string >+ description: Unique, immutable status code >+ is_system: >+ type: string >+ description: Is this status required for system operation >+additionalProperties: false >+required: >+ - name >+ - code >+ - is_system >diff --git a/api/v1/swagger/definitions/illbatchstatuses.yaml b/api/v1/swagger/definitions/illbatchstatuses.yaml >new file mode 100644 >index 0000000000..5eb4b53400 >--- /dev/null >+++ b/api/v1/swagger/definitions/illbatchstatuses.yaml >@@ -0,0 +1,5 @@ >+--- >+type: array >+items: >+ $ref: "illbatchstatus.yaml" >+additionalProperties: false >diff --git a/api/v1/swagger/paths/illbatchstatuses.yaml b/api/v1/swagger/paths/illbatchstatuses.yaml >new file mode 100644 >index 0000000000..f211b2b62d >--- /dev/null >+++ b/api/v1/swagger/paths/illbatchstatuses.yaml >@@ -0,0 +1,232 @@ >+--- >+/illbatchstatuses: >+ get: >+ x-mojo-to: IllbatchStatuses#list >+ operationId: listIllbatchstatuses >+ tags: >+ - illbatchstatuses >+ summary: List ILL batch statuses >+ parameters: [] >+ produces: >+ - application/json >+ responses: >+ "200": >+ description: A list of ILL batch statuses >+ schema: >+ $ref: "../swagger.yaml#/definitions/illbatchstatuses" >+ "401": >+ description: Authentication required >+ schema: >+ $ref: "../swagger.yaml#/definitions/error" >+ "403": >+ description: Access forbidden >+ schema: >+ $ref: "../swagger.yaml#/definitions/error" >+ "404": >+ description: ILL batch statuses not found >+ schema: >+ $ref: "../swagger.yaml#/definitions/error" >+ "500": >+ description: | >+ Internal server error. Possible `error_code` attribute values: >+ >+ * `internal_server_error` >+ schema: >+ $ref: "../swagger.yaml#/definitions/error" >+ "503": >+ description: Under maintenance >+ schema: >+ $ref: "../swagger.yaml#/definitions/error" >+ x-koha-authorization: >+ permissions: >+ ill: "1" >+ post: >+ x-mojo-to: IllbatchStatuses#add >+ operationId: addIllbatchstatus >+ tags: >+ - illbatchstatuses >+ summary: Add ILL batch status >+ parameters: >+ - name: body >+ in: body >+ description: A JSON object containing informations about the new batch status >+ required: true >+ schema: >+ $ref: "../swagger.yaml#/definitions/illbatchstatus" >+ produces: >+ - application/json >+ responses: >+ "201": >+ description: Batch status added >+ schema: >+ $ref: "../swagger.yaml#/definitions/illbatchstatus" >+ "400": >+ description: Bad request >+ schema: >+ $ref: "../swagger.yaml#/definitions/error" >+ "401": >+ description: Authentication required >+ schema: >+ $ref: "../swagger.yaml#/definitions/error" >+ "403": >+ description: Access forbidden >+ schema: >+ $ref: "../swagger.yaml#/definitions/error" >+ "409": >+ description: Conflict in creating resource >+ schema: >+ $ref: "../swagger.yaml#/definitions/error" >+ "500": >+ description: | >+ Internal server error. Possible `error_code` attribute values: >+ >+ * `internal_server_error` >+ schema: >+ $ref: "../swagger.yaml#/definitions/error" >+ "503": >+ description: Under maintenance >+ schema: >+ $ref: "../swagger.yaml#/definitions/error" >+ x-koha-authorization: >+ permissions: >+ ill: "1" >+"/illbatchstatuses/{illbatchstatus_code}": >+ get: >+ x-mojo-to: IllbatchStatuses#get >+ operationId: getIllbatchstatuses >+ tags: >+ - illbatchstatuses >+ summary: Get ILL batch status >+ parameters: >+ - name: illbatchstatus_code >+ in: path >+ description: ILL batch status >+ required: true >+ type: string >+ produces: >+ - application/json >+ responses: >+ "200": >+ description: An ILL batch status >+ schema: >+ $ref: "../swagger.yaml#/definitions/illbatchstatus" >+ "401": >+ description: Authentication required >+ schema: >+ $ref: "../swagger.yaml#/definitions/error" >+ "403": >+ description: Access forbidden >+ schema: >+ $ref: "../swagger.yaml#/definitions/error" >+ "404": >+ description: ILL batch status not found >+ schema: >+ $ref: "../swagger.yaml#/definitions/error" >+ "500": >+ description: | >+ Internal server error. Possible `error_code` attribute values: >+ >+ * `internal_server_error` >+ schema: >+ $ref: "../swagger.yaml#/definitions/error" >+ "503": >+ description: Under maintenance >+ schema: >+ $ref: "../swagger.yaml#/definitions/error" >+ x-koha-authorization: >+ permissions: >+ ill: "1" >+ put: >+ x-mojo-to: IllbatchStatuses#update >+ operationId: updateIllBatchstatus >+ tags: >+ - illbatchstatuses >+ summary: Update batch status >+ parameters: >+ - $ref: "../swagger.yaml#/parameters/illbatchstatus_code_pp" >+ - name: body >+ in: body >+ description: A JSON object containing information on the batch status >+ required: true >+ schema: >+ $ref: "../swagger.yaml#/definitions/illbatchstatus" >+ consumes: >+ - application/json >+ produces: >+ - application/json >+ responses: >+ "200": >+ description: An ILL batch status >+ schema: >+ $ref: "../swagger.yaml#/definitions/illbatchstatus" >+ "400": >+ description: Bad request >+ schema: >+ $ref: "../swagger.yaml#/definitions/error" >+ "401": >+ description: Authentication required >+ schema: >+ $ref: "../swagger.yaml#/definitions/error" >+ "403": >+ description: Access forbidden >+ schema: >+ $ref: "../swagger.yaml#/definitions/error" >+ "404": >+ description: ILL batch status not found >+ schema: >+ $ref: "../swagger.yaml#/definitions/error" >+ "500": >+ description: | >+ Internal server error. Possible `error_code` attribute values: >+ >+ * `internal_server_error` >+ schema: >+ $ref: "../swagger.yaml#/definitions/error" >+ "503": >+ description: Under maintenance >+ schema: >+ $ref: "../swagger.yaml#/definitions/error" >+ x-koha-authorization: >+ permissions: >+ ill: "1" >+ delete: >+ x-mojo-to: IllbatchStatuses#delete >+ operationId: deleteBatchstatus >+ tags: >+ - illbatchstatuses >+ summary: Delete ILL batch status >+ parameters: >+ - $ref: "../swagger.yaml#/parameters/illbatchstatus_code_pp" >+ produces: >+ - application/json >+ responses: >+ "204": >+ description: ILL batch status deleted >+ schema: >+ type: string >+ "401": >+ description: Authentication required >+ schema: >+ $ref: "../swagger.yaml#/definitions/error" >+ "403": >+ description: Access forbidden >+ schema: >+ $ref: "../swagger.yaml#/definitions/error" >+ "404": >+ description: ILL batch status not found >+ schema: >+ $ref: "../swagger.yaml#/definitions/error" >+ "500": >+ description: | >+ Internal server error. Possible `error_code` attribute values: >+ >+ * `internal_server_error` >+ schema: >+ $ref: "../swagger.yaml#/definitions/error" >+ "503": >+ description: Under maintenance >+ schema: >+ $ref: "../swagger.yaml#/definitions/error" >+ x-koha-authorization: >+ permissions: >+ ill: "1" >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/admin-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/admin-menu.inc >index 96ca936832..1a2adcb8d4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/admin-menu.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/admin-menu.inc >@@ -177,6 +177,9 @@ > [% IF ( Koha.Preference('EnableAdvancedCatalogingEditor') && CAN_user_parameters_manage_keyboard_shortcuts ) %] > <li><a href="/cgi-bin/koha/admin/adveditorshortcuts.pl">Keyboard shortcuts</a></li> > [% END %] >+ [% IF Koha.Preference('ILLModule ') && CAN_user_ill %] >+ <li><a href="/cgi-bin/koha/admin/ill_batch_statuses.pl">Interlibrary Loan batch statuses</a></li> >+ [% END %] > </ul> > [% END %] > </div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt >index 47b2142fea..3eb1749b81 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt >@@ -282,6 +282,10 @@ > <dt><a href="/cgi-bin/koha/admin/adveditorshortcuts.pl">Keyboard shortcuts</a></dt> > <dd>Define which keys trigger actions in the advanced cataloging editor</dd> > [% END %] >+ [% IF Koha.Preference('ILLModule') && CAN_user_ill %] >+ <dt><a href="/cgi-bin/koha/admin/ill_batch_statuses.pl">Interlibrary Loan batch statuses</a></dt> >+ <dd>Manage the statuses that can be assigned to Interlibrary Loan batches</dd> >+ [% END %] > </dl> > [% END %] > </div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/ill_batch_statuses.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/ill_batch_statuses.tt >new file mode 100644 >index 0000000000..c47cc27e2c >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/ill_batch_statuses.tt >@@ -0,0 +1,168 @@ >+[% USE raw %] >+[% USE Asset %] >+[% USE Branches %] >+[% USE Price %] >+[% SET footerjs = 1 %] >+[% INCLUDE 'doc-head-open.inc' %] >+<title> >+ [% IF op =='add_form' %] >+ [% IF status.id %] >+ Modify batch status >+ [% ELSE %] >+ New batch status >+ [% END %] › [% END %] >+ Interlibrary Loan batch statuses › Administration › Koha >+</title> >+[% INCLUDE 'doc-head-close.inc' %] >+</head> >+ >+<body id="admin_ill_batch_statuses" class="admin"> >+[% INCLUDE 'header.inc' %] >+[% INCLUDE 'prefs-admin-search.inc' %] >+ >+<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb"> >+ <ol> >+ <li> >+ <a href="/cgi-bin/koha/mainpage.pl">Home</a> >+ </li> >+ <li> >+ <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> >+ </li> >+ >+ [% IF op == 'add_form' %] >+ <li> >+ <a href="/cgi-bin/koha/admin/ill_batch_statuses.pl">Interlibrary Loan batch statuses</a> >+ </li> >+ <li> >+ <a href="#" aria-current="page"> >+ [% IF status.id %] >+ Modify >+ [% ELSE %] >+ New >+ [% END %] batch status >+ </a> >+ </li> >+ >+ [% ELSE %] >+ <li> >+ <a href="#" aria-current="page"> >+ Interlibrary Loan batch statuses >+ </a> >+ </li> >+ [% END %] >+ </ol> >+</nav> >+ >+<div class="main container-fluid"> >+ <div class="row"> >+ <div class="col-sm-10 col-sm-push-2"> >+ <main> >+ >+ [% FOREACH m IN messages %] >+ <div class="dialog [% m.type | html %]"> >+ [% SWITCH m.code %] >+ [% CASE 'success_on_saving' %] >+ <span>Batch status saved successfully</span> >+ [% CASE 'success_on_delete' %] >+ <span>Batch status deleted successfully</span> >+ [% CASE 'error_on_saving' %] >+ <span>An error occurred when saving this batch status</span> >+ [% CASE 'error_on_delete' %] >+ <span>An error occurred when deleting this batch status</span> >+ [% CASE %] >+ <span>[% m.code | html %]</span> >+ [% END %] >+ </div> >+ [% END %] >+ >+ [% IF op == 'add_form' %] >+ [% IF status %] >+ <h1>Modify a batch status</h1> >+ [% ELSE %] >+ <h1>New batch status</h1> >+ [% END %] >+ >+ <form action="/cgi-bin/koha/admin/ill_batch_statuses.pl" name="Aform" method="post" class="validated"> >+ <input type="hidden" name="op" value="add_validate" /> >+ <fieldset class="rows"> >+ <ol> >+ <li> >+ <label for="name" class="required">Name: </label> >+ <input type="text" name="name" id="name" size="80" maxlength="100" class="required focus" required="required" value="[% status.name | html %]"><span class="required">Required. Maximum length is 100 letters</span> >+ </li> >+ <li> >+ <label for="code">Code: </label> >+ [% IF status %] >+ <strong>[% status.code | html %]</strong> >+ <input type="hidden" name="code" value="[% status.code | html %]" /> >+ [% ELSE %] >+ <input type="text" name="code" id="code" size="80" maxlength="20" class="required" required="required" value="[% status.code | html %]"><span class="required">Required, specify UPPERCASE LETTERS. Maximum length is 20 letters</span> >+ [% END %] >+ </li> >+ <li> >+ <label for="is_system">Is a system status: </label> >+ <strong>[% status.is_system ? "Yes" : "No" | html %]</strong> >+ <input type="hidden" name="is_system" value="[% status.is_system | html %]" /> >+ </li> >+ </ol> >+ </fieldset> >+ >+ <fieldset class="action"> >+ <button id="save_batch_status" class="btn btn-default">Save</button> >+ <a class="cancel" href="/cgi-bin/koha/admin/ill_batch_statuses.pl">Cancel</a> >+ </fieldset> >+ </form> >+ [% END %] >+ >+ [% IF op == 'list' %] >+ <div id="toolbar" class="btn-toolbar"> >+ <a class="btn btn-default" id="newillbatchstatus" href="/cgi-bin/koha/admin/ill_batch_statuses.pl?op=add_form"><i class="fa fa-plus"></i> New batch status</a> >+ </div> >+ >+ <h1>Interlibrary Loan batch statuses</h1> >+ [% IF statuses.count %] >+ <table id="table_batch_statuses"> >+ <thead> >+ <th>Name</th> >+ <th>Code</th> >+ <th>Is system</th> >+ <th class="noExport">Actions</th> >+ </thead> >+ <tbody> >+ [% FOREACH status IN statuses %] >+ <tr> >+ <td>[% status.name | html %]</td> >+ <td>[% status.code | html %]</td> >+ <td>[% status.is_system ? "Yes" : "No" | html %]</td> >+ <td class="actions"> >+ <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/ill_batch_statuses.pl?op=add_form&code=[% status.code | uri %]"><i class="fa fa-pencil"></i> Edit</a> >+ [% IF !status.is_system %] >+ <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/ill_batch_statuses.pl?op=delete&code=[% status.code | uri %]"><i class="fa fa-delete"></i> Delete</a> >+ [% END %] >+ </td> >+ </tr> >+ [% END %] >+ </tbody> >+ </table> >+ [% ELSE %] >+ <div class="dialog message"> >+ There are no batch statuses defined. <a href="/cgi-bin/koha/admin/ill_batch_statuses.pl?op=add_form">Create new batch status</a> >+ </div> >+ [% END %] >+ [% END %] >+ </main> >+ </div> <!-- /.col-sm-10.col-sm-push-2 --> >+ >+ <div class="col-sm-2 col-sm-pull-10"> >+ <aside> >+ [% INCLUDE 'admin-menu.inc' %] >+ </aside> >+ </div> <!-- /.col-sm-2.col-sm-pull-10 --> >+ </div> <!-- /.row --> >+ >+[% MACRO jsinclude BLOCK %] >+ [% Asset.js("js/admin-menu.js") | $raw %] >+ [% INCLUDE 'datatables.inc' %] >+[% END %] >+ >+[% INCLUDE 'intranet-bottom.inc' %] >-- >2.30.2
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 30719
:
144281
|
144285
|
144286
|
144287
|
144288
|
144289
|
144290
|
144291
|
144292
|
144293
|
144294
|
144295
|
144296
|
144297
|
144298
|
144299
|
144300
|
144301
|
144302
|
145760
|
145869
|
145870
|
145876
|
145934
|
146152
|
147658
|
147929
|
147930
|
147931
|
147932
|
147933
|
147934
|
147952
|
147953
|
147954
|
147955
|
147956
|
151152
|
151153
|
151154
|
151155
|
151156
|
151284
|
151285
|
151286
|
151287
|
151288
|
151303
|
151304
|
151305
|
151306
|
151307
|
151308
|
151309
|
151310
|
151311
|
151312
|
151513
|
151514
|
151515
|
151516
|
151517
|
151519
|
151520
|
151521
|
151522
|
151523
|
151571
|
151572
|
151573
|
151574
|
151575
|
151611
|
151612
|
151613
|
151614
|
151615
|
151804
|
151805
|
151806
|
151807
|
151808
|
151809
|
154046
|
154047
|
154048
|
154049
|
154050
|
154051
|
154052
|
155421
|
155422
|
155423
|
155424
|
155425
|
155426
|
155427
|
155428
|
155429
|
155430
|
155431
|
155432
|
155433
|
155434
|
155435
|
156556
|
156748
|
156749
|
156752
|
156783
|
156785
|
156811
|
156812
|
156827
|
156828