From 7d32ac2135fc4dfee907ce601ce9bc0daacd1b1c Mon Sep 17 00:00:00 2001 From: Jacob O'Mara Date: Thu, 30 Oct 2025 10:59:29 +0000 Subject: [PATCH] Bug 17387: add restore records page Signed-off-by: Michaela Sponsored-by: ByWater Solutions Signed-off-by: Martin Renvoize --- .../prog/en/includes/cat-menu.inc | 7 +- .../prog/en/modules/tools/restore-records.tt | 322 ++++++++++++++++++ tools/restore-records.pl | 36 ++ 3 files changed, 364 insertions(+), 1 deletion(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/tools/restore-records.tt create mode 100755 tools/restore-records.pl diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-menu.inc index 1687b185298..65d514cdca5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-menu.inc @@ -43,7 +43,7 @@ [% END %] - [% IF ( CAN_user_tools_items_batchmod || CAN_user_tools_items_batchdel || CAN_user_tools_records_batchmod || CAN_user_tools_records_batchdel || CAN_user_tools_marc_modification_templates ) %] + [% IF ( CAN_user_tools_items_batchmod || CAN_user_tools_items_batchdel || CAN_user_tools_records_batchmod || CAN_user_tools_records_batchdel || CAN_user_tools_marc_modification_templates || CAN_user_editcatalogue_edit_catalogue ) %]
Batch editing
    [% IF ( CAN_user_tools_items_batchmod ) %] @@ -66,6 +66,11 @@ Batch record deletion [% END %] + [% IF ( CAN_user_editcatalogue_edit_catalogue ) %] +
  • + Restore deleted records +
  • + [% END %] [% IF ( CAN_user_tools_marc_modification_templates ) %]
  • MARC modification templates diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/restore-records.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/restore-records.tt new file mode 100644 index 00000000000..49d20120246 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/restore-records.tt @@ -0,0 +1,322 @@ +[% USE raw %] +[% USE Asset %] +[% USE KohaDates %] +[% USE Koha %] +[% PROCESS 'i18n.inc' %] +[% SET footerjs = 1 %] +[% INCLUDE 'doc-head-open.inc' %] + + [% FILTER collapse %] + [% t("Restore deleted records") | html %] + › [% t("Tools") | html %] › [% t("Koha") | html %] + [% END %] + +[% INCLUDE 'doc-head-close.inc' %] + + + +[% WRAPPER 'header.inc' %] + [% INCLUDE 'cat-search.inc' %] +[% END %] + +[% WRAPPER 'sub-header.inc' %] + [% WRAPPER breadcrumbs %] + [% WRAPPER breadcrumb_item %] + Tools + [% END %] + [% WRAPPER breadcrumb_item bc_active= 1 %] + Restore deleted records + [% END %] + [% END #/ WRAPPER breadcrumbs %] +[% END #/ WRAPPER sub-header.inc %] + +[% SET asides = [] %] +[% asides.push('cat-menu') %] + +[% WRAPPER 'main-container.inc' %] +
    +
    +
    +

    Restore deleted records

    + +
    + +

    Deleted bibliographic records

    +
    + + + + + + + + + + +
    Biblio IDTitleAuthorDeleted onActions
    +
    + +

    Deleted items

    +
    + + + + + + + + + + + + +
    Item IDBiblio IDBarcodeCall numberHome libraryDeleted onActions
    +
    +
    +
    +
    +[% END #/ WRAPPER main-container.inc %] + +[% MACRO jsinclude BLOCK %] + [% Asset.js("js/tools-menu.js") | $raw %] + [% INCLUDE 'datatables.inc' %] + +[% END %] + +[% INCLUDE 'intranet-bottom.inc' %] diff --git a/tools/restore-records.pl b/tools/restore-records.pl new file mode 100755 index 00000000000..b3133f2cf18 --- /dev/null +++ b/tools/restore-records.pl @@ -0,0 +1,36 @@ +#!/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 ); + +my $input = CGI->new; + +my ( $template, $loggedinuser, $cookie ) = get_template_and_user( + { + template_name => "tools/restore-records.tt", + query => $input, + type => "intranet", + flagsrequired => { editcatalogue => 'edit_catalogue' }, + } +); + +output_html_with_http_headers $input, $cookie, $template->output; -- 2.53.0