Bug 4461: Add problem reports link to mainpage and admin home
authorAleisha Amohia <aleishaamohia@hotmail.com>
Tue, 10 Mar 2020 22:52:29 +0000 (22:52 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 6 Apr 2020 10:18:20 +0000 (11:18 +0100)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

koha-tmpl/intranet-tmpl/prog/en/includes/admin-menu.inc
koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt
koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt
mainpage.pl

index fd5d595..c5bd432 100644 (file)
             [% IF ( Koha.Preference('EnableAdvancedCatalogingEditor') && CAN_user_parameters_manage_keyboard_shortcuts ) %]
                 <li><a href="/cgi-bin/koha/admin/adveditorshortcuts.pl">Keyboard shortcuts</a></li>
             [% END %]
+            [% IF ( Koha.Preference('OPACReportProblem') && CAN_user_problem_reports ) %]
+                <li><a href="/cgi-bin/koha/admin/problem-reports.pl">OPAC problem reports</a></li>
+            [% END %]
         </ul>
     [% END %]
 </div>
index dc162f4..fded276 100644 (file)
                         <dt><a href="/cgi-bin/koha/admin/adveditorshortcuts.pl">Keyboard shortcuts</a></dt>
                         <dd>Define which keys trigger actions in the advanced cataloging editor</dd>
                     [% END %]
+                    [% IF ( Koha.Preference('OPACReportProblem') && CAN_user_problem_reports ) %]
+                        <dt><a href="/cgi-bin/koha/admin/problem-reports.pl">OPAC problem reports</a></dt>
+                        <dd>Manage OPAC problem reports submitted by patrons</dd>
+                    [% END %]
                 </dl>
             [% END %]
             </div>
index f6a2135..e094e74 100644 (file)
                 <div class="row">
                     <div class="col-sm-12">
                         [%# Following statement must be in one line for translatability %]
-                        [% IF ( ( CAN_user_tools_moderate_comments  && pendingcomments ) || ( CAN_user_tools_moderate_tags && pendingtags ) || ( CAN_user_borrowers_edit_borrowers && pending_borrower_modifications ) || ( CAN_user_acquisition && pendingsuggestions ) || ( CAN_user_borrowers_edit_borrowers && pending_discharge_requests ) || pending_article_requests) || ( Koha.Preference('AllowCheckoutNotes') && CAN_user_circulate_manage_checkout_notes && pending_checkout_notes.count ) %]
+                        [% IF ( CAN_user_tools_moderate_comments  && pendingcomments ) || ( CAN_user_tools_moderate_tags && pendingtags ) || ( CAN_user_borrowers_edit_borrowers && pending_borrower_modifications ) || ( CAN_user_acquisition && pendingsuggestions ) || ( CAN_user_borrowers_edit_borrowers && pending_discharge_requests ) || pending_article_requests || ( Koha.Preference('AllowCheckoutNotes') && CAN_user_circulate_manage_checkout_notes && pending_checkout_notes.count ) || ( Koha.Preference('OPACReportProblem') && CAN_user_problem_reports && pending_problem_reports ) %]
                             <div id="area-pending">
                                 [% IF pending_article_requests %]
                                 <div class="pending-info" id="article_requests_pending">
                                     </div>
                                 [% END %]
 
+                                [% IF ( Koha.Preference('OPACReportProblem') && CAN_user_problem_reports && pending_problem_reports ) %]
+                                    <div class="pending-info" id="problem_reports_pending">
+                                        <a href="/cgi-bin/koha/admin/problem-reports.pl">OPAC problem reports pending</a>:
+                                        <span class="pending-number-link">[% pending_problem_reports.count | html %]</span>
+                                    </div>
+                                [% END %]
+
                             </div>
 
                         [% END %]
index 49f46fc..75072b1 100755 (executable)
@@ -31,6 +31,7 @@ use Koha::Patron::Modifications;
 use Koha::Patron::Discharge;
 use Koha::Reviews;
 use Koha::ArticleRequests;
+use Koha::ProblemReports;
 
 my $query = new CGI;
 
@@ -74,6 +75,7 @@ my $pending_article_requests = Koha::ArticleRequests->search_limited(
         $branch ? ( 'me.branchcode' => $branch ) : (),
     }
 )->count;
+my $pending_problem_reports = Koha::ProblemReports->search({ status => 'N' });
 
 $template->param(
     pendingcomments                => $pendingcomments,
@@ -82,6 +84,7 @@ $template->param(
     pending_borrower_modifications => $pending_borrower_modifications,
     pending_discharge_requests     => $pending_discharge_requests,
     pending_article_requests       => $pending_article_requests,
+    pending_problem_reports        => $pending_problem_reports
 );
 
 output_html_with_http_headers $query, $cookie, $template->output;