Commit graph

133 commits

Author SHA1 Message Date
Colin Campbell
77e4b2ce9d Stop generation of unnecessary warning messages to log over undef values
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2009-08-01 08:39:57 -04:00
Joe Atzberger
5961c08a9e Bug 3350 - fail on queued emails w/ no address
If a patron has no email address, we need to avoid stockpiling all
their messages indefinitely.  Otherwise they get mailbombed when
their email IS added.

Note that overdues should not be affected, since the overdues job
checks whether the patron email exists before sending the message
(falling back to the admin).  The other messaging features are the
targets affected by this patch.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-06-24 08:43:45 -05:00
Joe Atzberger
6ad369f80b Cleanup and tighten Letters module.
Subroutine arguments enforced w/ with more checks, explicit return undef where warranted.
Placeholders used in SQL where applicable.
One logical error corrected :
- next MESSAGE if ( lc( $message->{'message_transport_type'} eq 'rss' ) );
+ next MESSAGE if ( lc($message->{'message_transport_type'}) eq 'rss' );

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-04-24 11:16:50 -05:00
Joe Atzberger
35c8a5be58 Introduce sth caching to Letters.pm
The re-creation of statement handles for the same queries, repeatedly,
seriously degrades the performance of notices.  This introduces new
class-level caching to avoid that problem.

Note: initial provisions
to do the same with caching of COLUMNS information about tables is
also included, but this would probably be most usefully implemented
in C4::Context (or a separate more central module).  The benefits of
caching that info would probably be even greater.  Note that this
proposed implementation might be obsoleted by ORM integration, where
DB structure info would already be cached.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-04-08 13:01:23 -05:00
Nahuel ANGELINETTI
63d2fdd8c6 (bug #2995) Set a default encoding for e-mails
Just set a default encoding as utf8 if none is provided.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-03-04 08:02:03 -06:00
John Beppu
062bb9a804 bug 324: Setting to_address
- Enqueue the messages with a to_address.

Signed-off-by: Daniel Sweeney <daniel.sweeney@liblime.com>
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-02-04 14:00:18 -06:00
John Beppu
39d0ed3635 Perl Modules
- C4::Letters:EnqueueLetter() is aware of new fields in message_queue table
- C4::Circulation::SendCirculationAlert() actually works
- C4::Category cleanup
- C4::ItemType cleanup
- C4::Message is a new module.
  It presents yet another way to interact with the message_queue.
  You can now take messages that have already been queued and modify
  their contents before they're sent out.

Signed-off-by: Daniel Sweeney <daniel.sweeney@liblime.com>
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-02-04 13:58:03 -06:00
Joe Atzberger
54f5ee3332 Prevent multiple warnings per notice filling cron logs.
If a value being substituted in was NULL, then warnings like this
would be emailed to the crontab owner (or MAILTO):

Use of uninitialized value in substitution (s///) at /home/user/kohaclone/C4/Letters.pm line 508.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-01-09 12:22:30 -06:00
Jesse Weaver
c9a50403e5 bug 2848 [1/2]: Send notifications to patrons when hold is received
This adds notification code to Reserves.pm to send notifications through email
or SMS to patrons when their hold is filled. It does not send the letter
directly, but instead uses EnqueueLetter. Also, it relies on
EnhancedPatronMessaging being on and the hold notification being turned on for
the specific patron through the 'Messaging' tab.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-12-08 08:51:12 -06:00
Joshua Ferraro
aae52f6b70 Fix for 2492: Mail::Sendmail chokes on utf-8 [ process_message_queue.pl ] 2008-08-10 14:42:47 -05:00
Andrew Moore
8ae66932cd Bug 2274 [3/5]: consolidating overdue notice cronjobs into one
This patch adds the misc/cronjobs/overdue_notices.pl script that is intended to replace
overduenotices.pl, overduenotices-30.pl and overduenotices-csv.pl. It adds messages to
the message_queue to be sent later (by process_message_queue.pl). It also marks borrowers
as debarred if their issues become too overdue.

It is intended to be run from cron nightly with usage something like:
0 2 * * * misc/cronjobs/overdue_notices.pl

C4::Members:
 - improved documentation on ModMember
 - made ModMember return a useful value (the return value of the database call)
 - added a DebarMember method
 - adding t/lib/KohaTest/Members/DebarMember.pm to test ModMember

misc/cronjobs/overdue_notices.pl
 - designed to replace overduenotices.pl, overduenotices-30.pl, and overduenotice-csv

Changes to C4::Letters:
 - EnqueueLetter now lets you pass in to_address and from_address which can override defaults
 - _send_message_by_email pays attention to these defaults.
 - now handles attachments with MIME::Lite

C4::Overdues
 - added GetBranchcodesWithOverdueRules
   - added t/lib/KohaTest/Overdues/GerBranchcodesWithOverdueRules.pm to test that.

circ/overdue.pl
 - replaced call to obsolete overduenotices-csv.pl with call to overdue_notices.pl

KohaTest:
 - added three helper methods: random_phone, random_email, random_ip
   - these can be used to populate example records
 - you can now pass an optional lengh to random_string

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-10 09:10:46 -05:00
Andrew Moore
4d0e0fec72 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>
2008-06-20 13:04:53 -05:00
Andrew Moore
2cae4efa0a Bug 2176 (3/5): adding methods to manage message_queue, new advance_notices.pl, new C4::SMS module
I've added methods to to C4::Letters to manage the database table
message_queue. This will let us keep track of messages sent
via email, sms, and rss to patrons. That way, we can show the history,
deal with failures, and reconstruct an RSS feed when needed.

misc/cronjobs/overduenotics.pl has been added. It prepares advance notices
and item due notices and stages messages to be sent in the message_queue
table.

C4::Overdues::Getoverdues now takes two optional arguments to tell it how
old of overdues to fetch.

Also, a C4::Circualtion::getUpcomingDueIssues method was added that
advance_notices.pl uses.

misc/cronjobs/process_message_queue.pl has been added. It sends the email
or SMS messages out of the message queue.

The C4::SMS module didn't work at all, and it has been rebuilt to use
an external perl module from CPAN, SMS::Send.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-20 13:04:52 -05:00
Mason James
90c25f0498 bug-2149, var fix - changing borr.cardnumber to borr.userid.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-30 11:13:02 -05:00
Mason James
b461a041d0 bug-2149, added new block to C4::Letters::SendAlerts() to email 'account creation' notice, and new block in memberentry.pl to call SendAlerts().
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-30 11:11:22 -05:00
Paul POULAIN
dfcdc73be6 bugfix : ship utf-8 encoding in mail header
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-12 10:07:55 -05:00
Galen Charlton
afb36c429e refactor C4::Log::logaction
This fix should resolve in whole or in part several bugs
characterized by the error message 'Can't use string ("0")
as a HASH ref while "strict refs" in use', including
bugs 1101, 1899, and 1910.

There are some possibilities for future work:

[1] Dealing with an operator override, e.g., where
    a circ operator needs to get a supervisor
    to enter a login and password and escalate
    the original operator's privileges for a
    transaction, e.g., to forgive a fine.  This
    is an enhancement, of course.
[2] Creating a dummy operator to represent
    batch job runs; or alternatively, give
    each batch job an option to log its work
    under a specified user ID.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-03-19 06:34:10 -05:00
Paul POULAIN
16c30c0d51 BUGFIXING mail alert on issue arrival
To make this feature work :
- create a "notice" (tools/letter.pl) of the category "serials"
- choose this notice in each subscription you want to enable this feature

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-02-29 09:05:33 -06:00
Galen Charlton
7f654fa140 getalert - do not generate bad SQL for borrowernumber=0
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-02-16 11:29:16 -06:00
Joe Atzberger
f59595d92f C4 - BEGIN blocks and 1; __END__ for modules
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-07 20:02:18 -06:00
Joe Atzberger
a428b49167 Letters.pm: Minor change. Unsure if this is "the right" move, but pretty sure the line does not make sense as is.
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-12-04 15:45:51 -06:00
Henri-Damien LAURENT
d2b15eeb9a Adding titles to claimissues letter.
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-10-31 19:40:16 -05:00
Paul POULAIN
1e3e69fe99 Overdues fixes (unfinished)
- reindenting
- upcasing SQL
- the script at least compiles...

... but it does seem not work yet

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-10-22 07:15:41 -05:00
Chris Cormack
b9c20fa9cf Patch from Galen Charlton, removing $Id$ $Log$ and $Revision$ from files
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-10-18 20:22:01 -05:00
Joe Atzberger
7fecc7cd41 Unnecessary "use" statements commented out.
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-10-11 12:45:52 -05:00
toins
a3135df486 really minor change : POD fixing, indentation & some compilation warn removing. 2007-07-26 15:18:46 +00:00
hdl
097fef712a Removing $dbh from GetMarcFromKohaField (dbh is not used in this function.) 2007-04-27 14:00:48 +00:00
tipaul
2ffd5b7228 rel_3_0 moved to HEAD 2007-03-09 14:28:54 +00:00
tgarip1957
0451359813 New set of routines for HEAD.
Uses a complete new ZEBRA Indexing.
ZEBRA is now XML and comprises of a KOHA meta record. Explanatory notes will be on koha-devel
Fixes UTF8 problems
Fixes bug with authorities
SQL database major changes.
Separate biblioograaphic and holdings records. Biblioitems table depreceated
etc. etc.
Wait for explanatory document on koha-devel
2006-08-25 21:07:08 +00:00
tipaul
3897417124 adding some fields available for Letters 2005-08-05 15:50:46 +00:00
tipaul
735487d1e6 removing my own adress as "From" ;-) 2005-08-05 14:48:52 +00:00
tipaul
791e786944 2 new features :
- a mail is sent everytime an issue if recieved in serial module. The mail is sent to all borrowers that have put an alert on the subscription (remember that you can put an alert only if the librarian have defined a "letter" as mail to send)
- the librarian can see, for a given subscription, who has put an alert.
2005-08-05 14:47:23 +00:00
tipaul
df6c6bcada Letters / alert system, continuing...
* adding a package Letters.pm, that manages Letters & alerts.
* adding feature : it's now possible to define a "letter" for any subscription created. If a letter is defined, users in OPAC can put an alert on the subscription. When an issue is marked "arrived", all users in the alert will recieve a mail (as defined in the "letter"). This last part (= send the mail) is not yet developped. (Should be done this week)
* adding feature : it's now possible to "put to an alert" in OPAC, for any serial subscription. The alert is stored in a new table, called alert. An alert can be put only if the librarian has activated them in subscription (and they activate it just by choosing a "letter" to sent to borrowers on new issues)
* adding feature : librarian can see in borrower detail which alerts they have put, and a user can see in opac-detail which alert they have put too.
Note that the system should be generic enough to manage any type of alert.
I plan to extend it soon to virtual shelves : a borrower will be able to put an alert on a virtual shelf, to be warned when something is changed in the virtual shelf (mail being sent once a day by cron, or manually by the shelf owner. Anyway, a mail won't be sent on every change, users would be spammed by Koha ;-) )
2005-08-04 08:54:54 +00:00