Bug 30708: Koha controller script and template changes

Sponsored-by: BULAC - http://www.bulac.fr/

Signed-off-by: BULAC - http://www.bulac.fr/
Signed-off-by: Heather Hernandez <heather_hernandez@nps.gov>
Signed-off-by: Laurence Rault <laurence.rault@biblibre.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Jonathan Druart 2023-04-07 14:51:50 +02:00 committed by Tomas Cohen Arazi
parent cf90b426d1
commit 8bbe2eac8e
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
10 changed files with 171 additions and 0 deletions

View File

@ -52,6 +52,9 @@
[% IF ( Koha.Preference('UseCourseReserves') ) %]
<li><a href="/cgi-bin/koha/course_reserves/course-reserves.pl">Course reserves</a></li>
[% END %]
[% IF Koha.Preference('PreservationModule') && CAN_user_preservation %]
<li><a href="/cgi-bin/koha/preservation/home.pl">Preservation</a></li>
[% END %]
[% IF ( CAN_user_reports ) %]
<li><a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a></li>
[% END %]

View File

@ -84,6 +84,9 @@
[%- CASE 'loggedinlibrary' -%]
<span class="main_permission loggedinlibrary_permission">Allow staff to change logged in library</span>
<span class="permissioncode">([% name | html %])</span>
[%- CASE 'preservation' -%]
<span class="main_permission preservation_permission">Manage the preservation module</span>
<span class="permissioncode">([% name | html %])</span>
[%- END -%]
[%- END -%]

View File

@ -139,6 +139,16 @@
[% END %]
</li>
[% IF ( preservation ) %]
<li class="active">
<a title="Preservation" href="/cgi-bin/koha/admin/preferences.pl?tab=preservation">Preservation</a>
[% PROCESS subtabs %]
[% ELSE %]
<li>
<a title="Preservation" href="/cgi-bin/koha/admin/preferences.pl?tab=preservation">Preservation</a>
[% END %]
</li>
[% IF ( searching ) %]
<li class="active">
<a title="Searching" href="/cgi-bin/koha/admin/preferences.pl?tab=searching">Searching</a>

View File

@ -0,0 +1,11 @@
[% USE Koha %]
<div id="navmenu">
<div id="navmenulist">
<h5>Preservation</h5>
<ul>
<li><a href="/cgi-bin/koha/preservation/home.pl">Preservation home</a></li>
<li><a href="/cgi-bin/koha/preservation/waiting-list.pl">Waiting list</a></li>
<li><a href="/cgi-bin/koha/preservation/trains.pl">Trains</a></li>
</ul>
</div>
</div>

View File

@ -0,0 +1,22 @@
<!-- Begin Preservation Resident Search Box -->
<div id="header_search">
<div id="preservation_search" class="residentsearch">
<form name="find_stuff" action="/cgi-bin/koha/preservation/home.pl" method="post">
<span class="form-title">
<label class="control-label">Preservation search</label>
</span>
<span class="form-content">
<input type="text" name="supplier" id="preservation_search_input" class="head-searchbox form-control" placeholder="Search preservation" />
</span>
<button type="submit"><i class="fa fa-arrow-right"></i></button>
</form>
</div>
<ul>
<li><a title="Preservation search" href="#preservation_search"><i class="fa fa-upload"></i> <span class="tab-title">Preservation search</span></a></li>
</ul>
</div><!-- /header_search -->
<!-- End Main page Resident Search Box -->

View File

@ -0,0 +1,6 @@
[% INCLUDE 'blocking_errors.inc' %]
<!-- preservation-toolbar.inc -->
<div id="toolbar" class="btn-toolbar">
<div class="btn-group"><a class="btn btn-default" href="/cgi-bin/koha/preservation/trains.pl?op=add_form"><i class="fa fa-plus"></i> New train</a></div>
</div>
<!-- / preservation-toolbar.inc -->

View File

@ -0,0 +1,16 @@
Preservation:
Interface:
-
- pref: PreservationModule
choices:
1: Enable
0: Disable
- the preservation module
-
- Use the <a href="/cgi-bin/koha/admin/authorised_values.pl?searchfield=NOT_LOAN">NOT_LOAN</a> authorized value
- pref: PreservationNotForLoanWaitingListIn
- to apply to items added to the waiting list
-
- Use the <a href="/cgi-bin/koha/admin/authorised_values.pl?searchfield=NOT_LOAN">NOT_LOAN</a> authorized value
- pref: PreservationNotForLoanDefaultTrainIn
- to apply to items added to a train

View File

@ -150,6 +150,12 @@
</li>
[% END %]
[% IF Koha.Preference('PreservationModule') && CAN_user_preservation%]
<li>
<a class="icon_general icon_preservation" href="/cgi-bin/koha/preservation/home.pl"><i class="fa fa-fw fa-book"></i>Preservation</a>
</li>
[% END %]
[% IF ( CAN_user_tools || CAN_user_clubs ) %]
<li>

View File

@ -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' %]
<title>
Preservation &rsaquo; Koha
</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
<body id="preservation_home" class="preservation">
[% WRAPPER 'header.inc' %]
[% INCLUDE 'preservation-search.inc' %]
[% END %]
<div id="preservation"> <!-- this is closed in intranet-bottom.inc -->
[% 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' %]
<script>
const authorised_value_categories = [% To.json(AuthorisedValues.GetCategories()) | $raw %].map(c => c.category);
const db_columns = [% To.json(db_columns) | $raw %];
const api_mappings = [% To.json(api_mappings) | $raw %];
</script>
[% Asset.js("js/vue/dist/preservation.js") | $raw %]
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]

52
preservation/home.pl Executable file
View File

@ -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 <http://www.gnu.org/licenses>.
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;