Bugzilla – Attachment 148440 Details for
Bug 33260
Show message queue on staff interface and make notices printable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33260: [WIP] Add Notice management tool
Bug-33260-WIP-Add-Notice-management-tool.patch (text/plain), 12.19 KB, created by
Aleisha Amohia
on 2023-03-21 03:27:15 UTC
(
hide
)
Description:
Bug 33260: [WIP] Add Notice management tool
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2023-03-21 03:27:15 UTC
Size:
12.19 KB
patch
obsolete
>From d8ba38814d8b6fae3e2a5108885458992f5d8fe1 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Tue, 21 Mar 2023 02:49:45 +0000 >Subject: [PATCH] Bug 33260: [WIP] Add Notice management tool > >--- > .../prog/en/includes/tools-menu.inc | 5 +- > .../prog/en/modules/tools/notices.tt | 145 ++++++++++++++++++ > .../prog/en/modules/tools/tools-home.tt | 7 +- > tools/notices.pl | 41 +++++ > 4 files changed, 196 insertions(+), 2 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/tools/notices.tt > create mode 100755 tools/notices.pl > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc >index b106cffbea8..22d3ecd6f1d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc >@@ -7,7 +7,7 @@ > <ul> > <li><a href="/cgi-bin/koha/tools/tools-home.pl">Tools home</a></li> > </ul> >- [% IF ( CAN_user_tools_manage_patron_lists || CAN_user_clubs || CAN_user_tools_moderate_comments || CAN_user_tools_import_patrons || CAN_user_tools_edit_notices || CAN_user_tools_edit_notice_status_triggers || CAN_user_tools_label_creator || CAN_user_tools_delete_anonymize_patrons || CAN_user_tools_edit_patrons || CAN_user_tools_moderate_tags || ( CAN_user_tools_batch_upload_patron_images && Koha.Preference('patronimages') ) || CAN_user_tools_rotating_collections ) %] >+ [% IF ( CAN_user_tools_manage_patron_lists || CAN_user_clubs || CAN_user_tools_moderate_comments || CAN_user_tools_import_patrons || CAN_user_tools_edit_notices || CAN_user_tools_edit_notice_status_triggers || CAN_user_tools_label_creator || CAN_user_tools_delete_anonymize_patrons || CAN_user_tools_edit_patrons || CAN_user_tools_moderate_tags || ( CAN_user_tools_batch_upload_patron_images && Koha.Preference('patronimages') ) || CAN_user_tools_rotating_collections ) || ( CAN_user_tools_view_generated_notices && Koha.Preference('NoticesManagement') ) %] > <h5>Patrons and circulation</h5> > <ul> > [% IF ( CAN_user_tools_manage_patron_lists ) %] >@@ -28,6 +28,9 @@ > [% IF ( CAN_user_tools_edit_notice_status_triggers ) %] > <li><a href="/cgi-bin/koha/tools/overduerules.pl">Overdue notice/status triggers</a></li> > [% END %] >+ [% IF ( CAN_user_tools_view_generated_notices && Koha.Preference('NoticesManagement') ) %] >+ <li><a href="/cgi-bin/koha/tools/notices.pl">Notices management</a></li> >+ [% END %] > [% IF ( CAN_user_tools_label_creator ) %] > <li><a href="/cgi-bin/koha/patroncards/home.pl">Patron card creator</a></li> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/notices.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/notices.tt >new file mode 100644 >index 00000000000..3bfc015ba1a >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/notices.tt >@@ -0,0 +1,145 @@ >+[% USE raw %] >+[% USE Asset %] >+[% USE KohaDates %] >+[% SET footerjs = 1 %] >+[% INCLUDE 'doc-head-open.inc' %] >+<title>Notices management › Tools › Koha</title> >+[% INCLUDE 'doc-head-close.inc' %] >+<style> >+ .notice { display: none; } >+</style> >+</head> >+ >+<body id="tools_notices_mgmt" class="tools"> >+[% WRAPPER 'header.inc' %] >+ [% INCLUDE 'circ-search.inc' %] >+[% END %] >+ >+[% WRAPPER 'sub-header.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/tools/tools-home.pl">Tools</a> >+ </li> >+ <li> >+ <a href="#" aria-current="page"> >+ Notices management >+ </a> >+ </li> >+ </ol> >+</nav> >+[% END %] >+ >+<div class="main container-fluid"> >+ <div class="row"> >+ <div class="col-sm-10 col-sm-push-2"> >+ <main> >+ >+ <h1>Notices management</h1> >+ >+ [% IF notices %] >+ >+ <table id="notices"> >+ <thead> >+ <tr> >+ <th>Time created</th> >+ <th>Patron</th> >+ <th>Notice</th> >+ <th>Type</th> >+ <th>Status</th> >+ <th>Updated on</th> >+ <th>Actions</th> >+ </tr> >+ </thead> >+ <tbody> >+ [% FOREACH notice IN notices %] >+ <tr> >+ <td>[% notice.time_queued | $KohaDates with_hours = 1 %]</td> >+ <td>[% INCLUDE 'patron-title.inc' patron=notice.patron hide_patron_infos_if_needed=1 %]</td> >+ <!-- <td>[% notice.subject | html %]</td>--> >+ <td> >+ <a class="notice-title" data-noticeid="[% notice.message_id | html %]" href="/cgi-bin/koha/members/notices.pl?borrowernumber=[% notice.borrowernumber | uri %]&noticeid=[% notice.message_id | uri %]">[% notice.subject | html %]</a> >+ <iframe class="notice" id="notice[% notice.message_id | html %]" srcdoc="[% notice.content | html | html_line_break %]"></iframe> >+ </td> >+ <td>[% notice.message_transport_type | html %]</td> >+ <td>[% notice.status | html %]</td> >+ <td>[% notice.updated_on | $KohaDates with_hours = 1 %]</td> >+ <td class="actions"><button class="btn btn-default btn-xs print"><i class="fa fa-print"></i> Print</button></td> >+ </tr> >+ [% END %] >+ </tbody> >+ </table> >+ >+ [% ELSE %] >+ >+ <div class="dialog message"> >+ There are no notices. >+ </div> >+ >+ [% END %] >+ >+ </main> >+ </div> <!-- /.col-sm-10.col-sm-push-2 --> >+ >+ <div class="col-sm-2 col-sm-pull-10"> >+ <aside> >+ [% INCLUDE 'tools-menu.inc' %] >+ </aside> >+ </div> <!-- /.col-sm-2.col-sm-pull-10 --> >+ </div> <!-- /.row --> >+ >+<!-- Modal --> >+<div class="modal" id="noticeModal" tabindex="-1" aria-labelledby="noticeModalLabel" aria-hidden="true"> >+ <div class="modal-dialog"> >+ <div class="modal-content"> >+ <div class="modal-header"> >+ <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"> >+ <span aria-hidden="true">×</span> >+ </button> >+ <h5 class="modal-title" id="noticeModalLabel">Notice</h5> >+ </div> >+ <div class="modal-body"> >+ ... >+ </div> >+ <div class="modal-footer"> >+ <button type="button" class="btn btn-default deny cancel" data-dismiss="modal"><i class="fa fa-remove"></i> Close</button> >+ </div> >+ </div> <!-- /.modal-content --> >+ </div> <!-- /.modal-dialog --> >+</div> <!-- /.modal --> >+ >+[% MACRO jsinclude BLOCK %] >+ [% Asset.js("js/tools-menu.js") | $raw %] >+ [% INCLUDE 'calendar.inc' %] >+ [% INCLUDE 'datatables.inc' %] >+ >+ <script> >+ $(document).ready(function() { >+ $("#notices").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "aaSorting": [[ 3, "desc" ]], >+ "sPaginationType": "full" >+ })); >+ >+ $("#notices").on("click", ".notice-title", function(e){ >+ e.preventDefault(); >+ var title = $(this).text(); >+ var noticeid = $(this).data("noticeid"); >+ var body = $("#notice" + noticeid ).attr("srcdoc"); >+ $("#noticeModalLabel").text( title ); >+ $("#noticeModal .modal-body").html( body ); >+ $("#noticeModal").modal("show"); >+ }); >+ >+ $("#noticeModal").on("hide.bs.modal", function(){ >+ $("#noticeModalLabel").text(""); >+ $("#noticeModal .modal-body").html(""); >+ }); >+ }); >+ </script> >+ >+[% END %] >+ >+[% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt >index 73508b2c649..097ee4a10a1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt >@@ -32,7 +32,7 @@ > <h1>Tools</h1> > <div class="row"> > <div class="col-sm-6"> >- [% IF ( CAN_user_tools_manage_patron_lists || CAN_user_clubs || CAN_user_tools_moderate_comments || CAN_user_tools_import_patrons || CAN_user_tools_edit_notices || CAN_user_tools_edit_notice_status_triggers || CAN_user_tools_label_creator || CAN_user_tools_delete_anonymize_patrons || CAN_user_tools_edit_patrons || CAN_user_tools_batch_extend_due_dates || CAN_user_tools_moderate_tags || CAN_user_tools_rotating_collections || ( CAN_user_tools_batch_upload_patron_images && Koha.Preference('patronimages') ) ) %] >+ [% IF ( CAN_user_tools_manage_patron_lists || CAN_user_clubs || CAN_user_tools_moderate_comments || CAN_user_tools_import_patrons || CAN_user_tools_edit_notices || CAN_user_tools_edit_notice_status_triggers || CAN_user_tools_label_creator || CAN_user_tools_delete_anonymize_patrons || CAN_user_tools_edit_patrons || CAN_user_tools_batch_extend_due_dates || CAN_user_tools_moderate_tags || CAN_user_tools_rotating_collections || ( CAN_user_tools_batch_upload_patron_images && Koha.Preference('patronimages') ) || ( CAN_user_tools_view_generated_notices && Koha.Preference('NoticesManagement') ) ) %] > <h3>Patrons and circulation</h3> > [% END %] > <dl> >@@ -71,6 +71,11 @@ > <dd>Set notice/status triggers for overdue items</dd> > [% END %] > >+ [% IF ( CAN_user_tools_view_generated_notices && Koha.Preference('NoticesManagement') ) %] >+ <dt><a href="/cgi-bin/koha/tools/notices.pl">Notices management</a></dt> >+ <dd>View and print generated notices</dd> >+ [% END %] >+ > [% IF ( CAN_user_tools_label_creator ) %] > <dt><a href="/cgi-bin/koha/patroncards/home.pl">Patron card creator</a></dt> > <dd>Create printable patron cards</dd> >diff --git a/tools/notices.pl b/tools/notices.pl >new file mode 100755 >index 00000000000..92ba828334b >--- /dev/null >+++ b/tools/notices.pl >@@ -0,0 +1,41 @@ >+#!/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::Notice::Messages; >+ >+my $query = CGI->new; >+my ( $template, $loggedinuser, $cookie ) = get_template_and_user( >+ { >+ template_name => "tools/notices.tt", >+ query => $query, >+ type => "intranet", >+ flagsrequired => tools => 'view_generated_notices', >+ } >+); >+ >+my $notices = Koha::Notice::Messages->search; >+ >+$template->param( >+ notices => $notices, >+); >+ >+output_html_with_http_headers $query, $cookie, $template->output; >-- >2.20.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 33260
:
148437
|
148438
|
148439
|
148440
|
148943
|
149009
|
149413
|
149581
|
149593
|
149594
|
149595
|
149596
|
149597
|
149598
|
150346
|
150347
|
154927
|
154928
|
157383
|
157384
|
157385
|
157386
|
158852
|
158853
|
158854
|
158855
|
162570
|
162571
|
162572
|
162573
|
162574
|
162624
|
162625
|
162677
|
162678
|
162679
|
162680
|
162681
|
164783
|
164784
|
164785
|
164786
|
164787
|
165238
|
165239
|
165717
|
165939
|
165946
|
165947
|
165948
|
165949
|
165950
|
165951
|
166020
|
166178
|
166335
|
166336
|
166337
|
166338
|
166339
|
166340
|
166341
|
166342
|
166343
|
166344
|
166345
|
166362
|
166363
|
166364
|
166365
|
166366
|
166367
|
166368
|
166369
|
166370
|
166371
|
166372
|
166373