Bugzilla – Attachment 152947 Details for
Bug 30708
Creation of a new 'Preservation' module
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30708: Koha controller script and template changes
Bug-30708-Koha-controller-script-and-template-chan.patch (text/plain), 11.57 KB, created by
Jonathan Druart
on 2023-07-03 13:29:24 UTC
(
hide
)
Description:
Bug 30708: Koha controller script and template changes
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-07-03 13:29:24 UTC
Size:
11.57 KB
patch
obsolete
>From fdbb917ca89dbca48c0c319db37763045e9b8a17 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 7 Apr 2023 14:51:50 +0200 >Subject: [PATCH] Bug 30708: Koha controller script and template changes > >Sponsored-by: BULAC - http://www.bulac.fr/ > >Signed-off-by: BULAC - http://www.bulac.fr/ >--- > .../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 > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc >index a63e8443c7e..83252c1f638 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc >@@ -49,6 +49,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 %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >index 9466b94cf7e..07eaca9573c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >@@ -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 -%] > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/prefs-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/prefs-menu.inc >index dbd8bce95e0..021b8f7bf7a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/prefs-menu.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/prefs-menu.inc >@@ -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> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/preservation-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/preservation-menu.inc >new file mode 100644 >index 00000000000..e284b96a423 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/preservation-menu.inc >@@ -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> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/preservation-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/preservation-search.inc >new file mode 100644 >index 00000000000..b02dd79a494 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/preservation-search.inc >@@ -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 --> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/preservation-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/preservation-toolbar.inc >new file mode 100644 >index 00000000000..5c4a6203594 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/preservation-toolbar.inc >@@ -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 --> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/preservation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/preservation.pref >new file mode 100644 >index 00000000000..0a3eb22c955 >--- /dev/null >+++ b/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 <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 >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt >index ce9f4b231d5..60e07e3a0bc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt >@@ -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> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/preservation/home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/preservation/home.tt >new file mode 100644 >index 00000000000..5740f51d5ec >--- /dev/null >+++ b/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' %] >+<title> >+ Preservation › 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' %] >diff --git a/preservation/home.pl b/preservation/home.pl >new file mode 100755 >index 00000000000..af66337c784 >--- /dev/null >+++ b/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 <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; >-- >2.25.1
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 30708
:
134715
|
134716
|
134732
|
134733
|
134734
|
134736
|
134737
|
134738
|
134782
|
134783
|
134784
|
134785
|
152939
|
152940
|
152941
|
152942
|
152943
|
152944
|
152945
|
152946
|
152947
|
152948
|
152949
|
152950
|
152951
|
152952
|
152953
|
152954
|
152955
|
152956
|
152957
|
152958
|
152959
|
152960
|
152961
|
152962
|
152963
|
152964
|
152965
|
152966
|
152967
|
152968
|
152969
|
152970
|
153102
|
153576
|
154167
|
154168
|
154169
|
154170
|
154171
|
154172
|
154173
|
154174
|
154175
|
154176
|
154177
|
154178
|
154179
|
154180
|
154181
|
154182
|
154183
|
154184
|
154185
|
154186
|
154187
|
154188
|
154189
|
154190
|
154191
|
154192
|
154193
|
154194
|
154195
|
154196
|
154197
|
154198
|
154199
|
154200
|
154201
|
154202
|
154203
|
156592
|
156596
|
156597
|
156636
|
156637
|
156638
|
156639
|
156640
|
156641
|
156642
|
156643
|
156644
|
156645
|
156646
|
156647
|
156648
|
156649
|
156650
|
156651
|
156652
|
156653
|
156654
|
156655
|
156656
|
156657
|
156658
|
156659
|
156660
|
156661
|
156662
|
156663
|
156664
|
156665
|
156666
|
156667
|
156668
|
156669
|
156670
|
156671
|
156672
|
156673
|
156674
|
156675
|
157502
|
157503
|
157506
|
157508
|
157512
|
157514
|
157557