@@ -, +, @@
---
.../intranet-tmpl/prog/en/includes/header.inc | 3 ++
.../prog/en/includes/permissions.inc | 3 ++
.../prog/en/includes/prefs-menu.inc | 10 ++++
.../prog/en/includes/preservation-menu.inc | 11 ++++
.../prog/en/includes/preservation-search.inc | 22 ++++++++
.../prog/en/includes/preservation-toolbar.inc | 6 +++
.../admin/preferences/preservation.pref | 16 ++++++
.../prog/en/modules/intranet-main.tt | 6 +++
.../prog/en/modules/preservation/home.tt | 42 +++++++++++++++
preservation/home.pl | 52 +++++++++++++++++++
10 files changed, 171 insertions(+)
create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/preservation-menu.inc
create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/preservation-search.inc
create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/preservation-toolbar.inc
create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/preservation.pref
create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/preservation/home.tt
create mode 100755 preservation/home.pl
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc
+++ a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc
@@ -52,6 +52,9 @@
[% IF ( Koha.Preference('UseCourseReserves') ) %]
Course reserves
[% END %]
+ [% IF Koha.Preference('PreservationModule') && CAN_user_preservation %]
+ Preservation
+ [% END %]
[% IF ( CAN_user_reports ) %]
Reports
[% END %]
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc
+++ a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc
@@ -84,6 +84,9 @@
[%- CASE 'loggedinlibrary' -%]
Allow staff to change logged in library
([% name | html %])
+ [%- CASE 'preservation' -%]
+ Manage the preservation module
+ ([% name | html %])
[%- END -%]
[%- END -%]
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/prefs-menu.inc
+++ a/koha-tmpl/intranet-tmpl/prog/en/includes/prefs-menu.inc
@@ -139,6 +139,16 @@
[% END %]
+ [% IF ( preservation ) %]
+
+ Preservation
+ [% PROCESS subtabs %]
+ [% ELSE %]
+
+ Preservation
+ [% END %]
+
+
[% IF ( searching ) %]
Searching
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/preservation-menu.inc
+++ a/koha-tmpl/intranet-tmpl/prog/en/includes/preservation-menu.inc
@@ -0,0 +1,11 @@
+[% USE Koha %]
+
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/preservation-search.inc
+++ a/koha-tmpl/intranet-tmpl/prog/en/includes/preservation-search.inc
@@ -0,0 +1,22 @@
+
+
+
+
+
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/preservation-toolbar.inc
+++ a/koha-tmpl/intranet-tmpl/prog/en/includes/preservation-toolbar.inc
@@ -0,0 +1,6 @@
+[% INCLUDE 'blocking_errors.inc' %]
+
+
+
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/preservation.pref
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/preservation.pref
@@ -0,0 +1,16 @@
+Preservation:
+ Interface:
+ -
+ - pref: PreservationModule
+ choices:
+ 1: Enable
+ 0: Disable
+ - the preservation module
+ -
+ - Use the NOT_LOAN authorized value
+ - pref: PreservationNotForLoanWaitingListIn
+ - to apply to items added to the waiting list
+ -
+ - Use the NOT_LOAN authorized value
+ - pref: PreservationNotForLoanDefaultTrainIn
+ - to apply to items added to a train
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt
@@ -150,6 +150,12 @@
[% END %]
+ [% IF Koha.Preference('PreservationModule') && CAN_user_preservation%]
+
+ Preservation
+
+ [% END %]
+
[% IF ( CAN_user_tools || CAN_user_clubs ) %]
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/preservation/home.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/preservation/home.tt
@@ -0,0 +1,42 @@
+[% USE raw %]
+[% USE To %]
+[% USE Asset %]
+[% USE KohaDates %]
+[% USE TablesSettings %]
+[% USE AuthorisedValues %]
+[% SET footerjs = 1 %]
+[% PROCESS 'i18n.inc' %]
+[% INCLUDE 'doc-head-open.inc' %]
+
+ Preservation › Koha
+
+[% INCLUDE 'doc-head-close.inc' %]
+
+
+
+[% WRAPPER 'header.inc' %]
+ [% INCLUDE 'preservation-search.inc' %]
+[% END %]
+
+
+
+[% MACRO jsinclude BLOCK %]
+ [% INCLUDE 'calendar.inc' %]
+ [% INCLUDE 'datatables.inc' %]
+ [% INCLUDE 'columns_settings.inc' %]
+ [% INCLUDE 'js-patron-format.inc' %]
+ [% INCLUDE 'js-date-format.inc' %]
+ [% INCLUDE 'js-biblio-format.inc' %]
+
+
+
+ [% Asset.js("js/vue/dist/preservation.js") | $raw %]
+
+[% END %]
+[% INCLUDE 'intranet-bottom.inc' %]
--- a/preservation/home.pl
+++ a/preservation/home.pl
@@ -0,0 +1,52 @@
+#!/usr/bin/perl
+
+# 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 .
+
+use Modern::Perl;
+
+use CGI qw ( -utf8 );
+use C4::Auth qw( get_template_and_user );
+use C4::Output qw( output_html_with_http_headers );
+
+use Koha::Database::Columns;
+
+my $query = CGI->new;
+my ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user(
+ {
+ template_name => 'preservation/home.tt',
+ query => $query,
+ type => 'intranet',
+ flagsrequired => { preservation => '*' },
+ }
+);
+
+my $columns = Koha::Database::Columns::columns;
+$template->param(
+ db_columns => {
+ map {
+ my $table = $_;
+ map { ( $table . '.' . $_ => $columns->{$table}->{$_} ) }
+ keys %{ $columns->{$table} }
+ } qw( biblio biblioitems items )
+ },
+ api_mappings => {
+ items => Koha::Item->to_api_mapping,
+ biblioitems => Koha::Biblioitem->to_api_mapping,
+ biblio => Koha::Biblio->to_api_mapping,
+ },
+);
+
+output_html_with_http_headers $query, $cookie, $template->output;
--