-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 2176 (4/5): adding RSS feed for patron overdue alerts
opac-mymessages.pl and opac-mymessages.tmpl generate an RSS feed of a patron's messages from the message_queue. Some more methods in C4::Letters to let us pluck out the right entries in the queue. Signed-off-by: Joshua Ferraro <jmf@liblime.com>
- Loading branch information
Showing
3 changed files
with
163 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0"?> | ||
<rss version="2.0"> | ||
<channel> | ||
<title></title> | ||
<link></link> | ||
<description></description> | ||
<language></language> | ||
<pubDate></pubDate> | ||
<lastBuildDate></lastBuildDate> | ||
<docs></docs> | ||
<generator></generator> | ||
<managingEditor></managingEditor> | ||
<webMaster></webMaster> | ||
<!-- TMPL_LOOP NAME="message_list" --> | ||
<item> | ||
<title><!-- TMPL_VAR ESCAPE=HTML NAME="subject" --></title> | ||
<link><!-- TMPL_VAR ESCAPE=HTML NAME="title" --></link> | ||
<description><!-- TMPL_VAR ESCAPE=HTML NAME="content"--></description> | ||
<pubDate><!-- TMPL_VAR ESCAPE=HTML NAME="time_queued" --></pubDate> | ||
<guid><!-- TMPL_VAR ESCAPE=HTML NAME="title" --></guid> | ||
</item> | ||
<!-- /TMPL_LOOP --> | ||
</channel> | ||
</rss> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place, | ||
# Suite 330, Boston, MA 02111-1307 USA | ||
|
||
use strict; | ||
use warnings; | ||
require Exporter; | ||
use CGI; | ||
|
||
use C4::Auth; | ||
use C4::Context; | ||
use C4::Koha; | ||
use C4::Letters; | ||
use C4::Output; | ||
|
||
my $query = CGI->new(); | ||
|
||
my ( $template, $borrowernumber, $cookie ) = get_template_and_user( | ||
{ | ||
template_name => 'opac-mymessages.tmpl', | ||
query => $query, | ||
type => 'opac', | ||
authnotrequired => 0, | ||
flagsrequired => { borrow => 1 }, | ||
debug => 1, | ||
} | ||
); | ||
|
||
|
||
my $messages = C4::Letters::GetRSSMessages( { borrowernumber => $borrowernumber, | ||
limit => 20 } ); | ||
|
||
$template->param( message_list => $messages, | ||
); | ||
|
||
output_html_with_http_headers $query, $cookie, $template->output; |