https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26246
--- Comment #1 from Alvaro Cornejo <[email protected]> --- Have done some testings for article requests adding this code to header.inc [%# ALVARO ADDED FOR SHOW PENDINGS %] [% IF ( pending_article_requests ) %] <li> <a href="/cgi-bin/koha/circ/article-requests.pl">Article requests: [% pending_article_requests | html %]</a> </li> [% END %] With this modiification pending articles appear only in main menu since others do not have access to pending info "pending_article_requests". For other pages to include pending info (tested only with article request), we need to include these libraries: use C4::Context; use Koha::ArticleRequests; use Koha::BiblioFrameworks; We also need to include variable $flags in the definition of get_template_and_user even if original script does not use it so it will be something like my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( Note that it seems the content of the array? does not matter... and finaly add the code to get the values for the pendings: # ALVARO TEST my $branch = ( C4::Context->preference("IndependentBranchesPatronModifications") || C4::Context->preference("IndependentBranches") ) && !$flags->{'superlibrarian'} ? C4::Context->userenv()->{'branch'} : undef; my $pending_article_requests = Koha::ArticleRequests->search_limited( { status => Koha::ArticleRequest::Status::Pending, $branch ? ( 'me.branchcode' => $branch ) : (), } )->count; $template->param( pending_article_requests => $pending_article_requests, ); ## END ALVARO Before sending the html output to template output_html_with_http_headers $query, $cookie, $template->output; So far I tried with search.pl, ciculation-home.pl, detail.pl, addbiblio.pl tool-home.pl and members-home.pl and worked fine in all cases I guess it can be possible to add the others pending notices in the same way I apologise if the code/terms used are not the correct ones but I´m by no means a programmer but just have some basic understanding of it. Have no idea if what I´ve done have any impact somewhere else... specially with user permits... -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
