For instance an issue is not fetch from its fk but using the fk
itemnumber.
We need to support them.
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
On of the awesome things we will be able to do with the TT syntax is the support of plurals.
For instance we will be able to send a list of items, checkouts, etc. to the notice template.
That way we will get rid of our custom syntax like <<items.content>> or <item></item> for instance.
The existing code already has the playground for that but it is not used.
Basically the idea is to add a "loops" key which can contain a list of
object to retrieve from the DB and send to the template.
For instance:
loops => { overdues => [ $itemnumber_1, .., $itemnumber_N ] }
will send a variable "overdues" to the template. It will contain the
Koha::Checkout objects relative to the id passed.
There is one quite big inconvenient to this approach so far: since we
are still supporting the historical syntax, the objects can be fetch by
a script, then the script will send the id to GetPreparedLetter which
will refetch them.
This must be improved, but I suggest to do that later.
Test plan:
prove t/db_dependent/Letters/TemplateToolkit.t
should return green
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
From C4::Letters::GetPreparedLetter:
my $tables = $params{tables};
my $substitute = $params{substitute};
$tables || $substitute || $repeat
or carp( "ERROR: nothing to substitute - both 'tables' and 'substitute' are empty" ),
return;
So if the parameter tables or substitute is passed but does not contain anything, it will not warn as expected.
Test plan:
1/ Apply the patch with tests
2/ Confirm that they do not pass
3/ Apply this patch
4/ Confirm that the tests now pass
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Nothing new here since bug 17962, the AR_* notice messages are quite
simple. They send the article_request, patron, biblio, biblioitem, item and
library linked to the article request.
All the fields from these 6 tables should still be accessible using the
TT syntax.
Test plan:
Define TT notice templates for AR_PENDING, AR_PROCESSING, AR_COMPLETED
or AR_CANCELED.
You should manage to create a template to generate the same result as
the historical syntax.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
To make ACQ_NOTIF_ON_RECEIV TT compatible, we need to expose data from
the aqorders table. We already have a package for it in the Koha
namespace but it is based on Koha::Object[s].
The other path creates dummy Koha::Tmp::Order[s] packages to make it
usable. Of course we should use a valid Koha::Acquisition::Order[s]
based on Koha::Object, but it's outside the scope of this bug report.
This notice template is quite simple, and it's a good one to start.
From C4::Acq::NotifyOrderUsers, GetPreparedLetter is called with 4
elements: the library, the patron to notify, the biblio and the order
information.
Note that prior to this patch aqorders was filled from GetOrder, which
retrieved a lot of information from the acquisition table (aqbasket,
aqbookseller). The idea with the TT syntax is to access the data from
where it really exists. So if a user wants to display the basket name,
[% order.basket.basketname %] should be used instead.
Note that this will not work at the moment, the basket method is not
defined in the order package.
However the basic template should work as before.
The test added to TemplateToolkit proves that.
Test plan:
Use the default ACQ_NOTIF_ON_RECEIV to notify a patron that an order has
been received.
That generated template should be exactly the same as prior to this
patch.
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
To recreate:
/cgi-bin/koha/acqui/lateorders.plop=send_alert&ordernumber=1)and%20(select*from(select(sleep(20)))a)--%20&letter_code=0
Notice the delay.
The SQL query is not constructed correctly, placeholders must be used.
This vulnerability has been reported by MDSec.
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
To recreate:
/cgi-bin/koha/serials/claims.pl?serialid=1)and%20(select*from(select(sleep(20)))a)--%20&letter_code=0
Notice the delay.
The SQL query is not constructed correctly, placeholders must be used.
This vulnerability has been reported by MDSec.
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Currently you can call GetPreparedLetter like:
$prepared_letter = GetPreparedLetter(
(
module => 'test',
letter_code => 'TEST_HOLD',
tables => {
reserves => [ $fk1, $fk2 ],
},
)
);
It assumes that $fk1 is a borrowernumber and $fk2 a biblionumber.
It seems hazardous to do this guess.
I suggest to remove this feature and only allow hashref indeed.
Test plan:
Use different way to generate letters and make sure you do not reach the croak
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
When no notice template ACQORDER was defined, you'r receive a false
positive "email sent" message. Now it will display a specific
error message instead.
Also includes 2 unit tests to test for the warn and new error code.
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
With this patch it will be possible to send order information
to the vendor by e-mail. For now this feature can be triggered
manually with a button before closing the basket.
The order e-mail is based on the acquisition claim feature, but
uses a new notice template.
Test plan:
1) Vendors
A new checkbox "Contact when ordering?" was added to the vendor
page.
- Add a vendor and/or edit an existing vendor
- Verify the new option is saved correctly
- Verify the new option displays on the vendor summary page
after saving
2) Notices
The feature works with a new notice template: ACQORDER
It works with the same formatting/fields etc. as the acq claim
notice.
- Add a new notice template ACQORDER in module
'Claim/order aquisition'
- Make sure to use fields from the various offered tables
in your notice
- Verify it is saved correctly
3) Basket
- Turn on LetterLog system preference
- Create multiple order lines
- Click the 'Send order' button in the toolbar
- Verify error or success message
- Verify you received the e-mail
- Verify there is a new entry with about the sent
notice in your action_logs table
4) Regression testing...
- Verify order claims still work
- Verify serial claims still work
- Verify new serial issue notices still work
...
(I can provide additional test plans if needed)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jennifer Schmidt <jschmidt@switchinc.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
The subroutine C4::Koha::GetAuthorisedValueByCode returned the
description (staff or opac) for a given authorised value.
Note that we may need a unique key to ->find instead of ->search.
Test plan:
- Checkin an item that cannot be checked in because it's lost, the
message should display the AV description
- Generate a letter with borrowers.streettype equals an ROADTYPE AV, the
description should be displayed.
- Edit a patron attribute type, the AV dropdown list should be
displayed
- Create the PA_CLASS AV category (see bug 7154) and make sure it
behaves as before when editing a patron
- The checkout list should display descriptions for LOC, LOST and
DAMAGED
Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Built on top of bug 17441
Test plan:
Just have a look at the changes. Trivial.
Git grep seleted. No results.
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
This patch makes the return value of SendAlerts more consistent.
It returns 1 on success, or undef || { error => 'msg' } on failure.
Needed to adjust one test in Letters.t too.
Adjusted one typo along the way (seleted).
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested by running Letters.t.
Also tested SendAlerts from the interface with AutoEmailOpacUser and
memberentry (adding new patron).
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Confirming a hold to set it to waiting will result in an DBIC error in
master.
Test Plan:
1) Attempt to check in an item on hold and confirm the hold
2) Note the error
3) Apply this patch
4) Repeat step 1
5) Note there is no error!
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
https://bugs.koha-community.org/show_bug.cgi?id=14942
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
TEST PLAN
---------
1) Apply Jonathan's test patch
2) prove t/db_dependent/Letters.t
-- dies before finishing tests
3) Apply second test patch
4) prove t/db_dependent/Letters.t
-- dies before finishing tests
-- 'addalert' is changed to 'getalert'
5) Log into OPAC with database admin user.
-- see error given in comment #0
6) Apply this patch
7) prove t/db_dependent/Letters.t
-- says 'getalert'
-- all tests pass.
8) Log into OPAC with database admin user.
-- logs in, but gives warning with a nice logout button.
9) run koha qa test tools.
Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
No kaha qa errors
In debian display diferent error:
Can't use an undefined value as an ARRAY reference at /usr/lib/perl5/DBI.pm line 2054.
Works as advertised
NOTE: Revised test plan, as Jonathan added useful test case.
Works as I've tested above.
Hector tested older test plan which was steps
5,6,8 and 9.
Revised test plan again while tweaking to address comment #9.
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This bug is the beginning of a conversion from our current bespoke
syntax for slips and notices to Template Toolkit syntax.
This patch is the initial seed which will evolve over time.
With this addition, we can take advantage of our Koha Objects
to greatly simplify the processing of Slips and Notices over time.
Test Plan:
1) Apply this patch
2) Ensure you have the default CHECKOUT notice
3) Check out and return an item for a patron
4) Note the text of the CHECKOUT notice
5) Replace your CHECKOUT notice with the following:
The following items have been checked out:
----
[% biblio.title %]
----
Thank you for visiting [% branch.branchname %].
6) Repeat step 3
7) Note the CHECKOUT notice text matches the previous CHECKOUT notice text
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
New notice syntax works, no koha-qa errors
Signed-off-by: Sean McGarvey <seanm@pascolibraries.org>
Bug 14757 [QA Followup] - Change method type() to _type() for Koha objects
Signed-off-by: Sean McGarvey <seanm@pascolibraries.org>
Bug 14757 [QA Followup] - Change all references to Koha::Borrower to Koha::Patron
Signed-off-by: Sean McGarvey <seanm@pascolibraries.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 13622 has introduced a bug, if pref TimeFormat is 12hr and a date is
displayed in both title and content of the letter.
Test plan:
1 - Checkout an item (with default time 11:59:00 PM)
2 - Generate a quickslip
3 - Notice the time is 'AM'
4 - Apply patch
5 - Generate quickslip
6 - Note time is correct
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
C4::Letters::getletter use a package variable (%letter) to cache letter
returned by the subroutine.
I have not found any direct issues caused by that but it is safer to
remove it.
It won't be a big deal to hit the DBMS to get a valid letter when
needed.
No test plan here, just confirm that the changes make sense.
Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Confirm that performance loss is just a millisecond or so per
subsequent call of getletter.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
perl -p -i -e 's/^.*set the version for version checking.*\n//' **/*.pm
+ manual adjustements
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
Mainly a
perl -p -i -e 's/^.*3.07.00.049.*\n//' **/*.pm
Then some adjustements
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
perl -p -i -e 's/^(use vars .*)\$VERSION\s?(.*)/$1$2/' **/*.pm
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
When resending an email from the Notices tab in Patrons, we would like
to use the recent email address.
Test plan:
[1] Look up a patron with some notices sent.
[2] Adjust the patron email address (watch AutoEmailPrimaryAddress).
[3] Resend the notice. Verify if the new address was used.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
This patch allows to resend both sent and failed messages.
With messages in 'sent' status, we have to be careful not to accidentally send
sent messages again. With the previous patch using GET request, this was likely
to happen because of browser storing the GET parameters.
This patch changes request method from GET to POST. Instead of a simple link,
we now have a form element.
In notices.pl we redirect back to notices.pl, because with POST there is a risk
of resending the message accidentally by form resubmission at refresh.
To test, find/create a Patron that has sent or failed notices in message_queue:
1. Enable EnchancedMessagingPreferences system preference
2. Go to Patrons -> Notices
3. In the Notice column, click the title of the sent or failed message
4. Observe that there is nothing for resending the sent or failed message
5. Apply the patches.
6. Reload Notices page and repeat step 3
7. Observe that there is now a link "Resend" in the Status-column
8. Click Resend
9. Observe that the message gets into 'pending' status
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
The C4::Letters module does not have a GetMessage subroutine, which
could be quite useful.
This patch adds it and simplifies the code added by the previous patch.
It also adds a few tests and fixes POD typos.
Note that ResendNotice only resends failed messages. This will avoid to
resend already sent messages (using an url from the browser history for
instance).
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
This patch adds a link 'Resend' under a notice in 'failed' status
in the Patron's Notices tab.
By clicking the link, we will request notices.pl with parameter
"resendnotice=XXXXX" where XXXXX is message_id. In notices.pl,
we then check whether the given message is actually in 'failed'
status. If so, we use the C4::Letters::ResendMessage(123) to
change the status of the message into 'pending'. This way it
will be processed again by the cronjob process_message_queue.pl.
To test, find/create a Patron that has failed notices in message_queue:
1. Enable EnchancedMessagingPreferences system preference
2. Go to Patrons -> Notices
3. In the Notice column, click the title of the failed message
4. Observe that there is nothing for resending the failed message
5. Apply patch.
6. Reload Notices page and repeat step 3
7. Observe that there is now a link "Resend" in the Status-column
8. Click Resend
9. Observe that the message gets into 'pending' status
Works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
C4::Branch::GetBranchDetail retrieved library infos, it could be easily
replaced with Koha::Libraries->find
When this change needs other big changes, the unblessed method is
called, to manipulate a hashref (as before) instead of a Koha::Library
object (for instance when $library is sent to GetPreparedLetter).
Test plan:
1/ Print a basket group, the library names should be correctly
displayed.
2/ Enable emailLibrarianWhenHoldIsPlaced and place a hold, a HOLDPLACED
notice will be generated (focus on the library name)
3/ Edit a patron and change his/her library
4/ Generate the advanced notices (misc/cronjobs/advance_notices.pl) and
have a look at the generated notices
5/ Same of overdues notices
6/ Set IndependentBranches and use a non superlibrarian user to place a
hold. The "pickup at" should be correctly filled.
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Nearly all cellular providers allow a person to send an text message to a cellular
phone by sending an email to phonenumber@provider. We can leverage this capability
to add the ability for Koha to send sms messages to patrons without the need to
subscribe to an sms gateway server.
Basic plan:
1. Add a table sms_providers to the db to tell Koha what service providers are available, and what domain emails should be sent to.
2. Add borrowers.sms_provider_id to tell Koha which mobile service the patron subscribes to for the number given in smsalertnumber
3. Modify Koha to send an email rather than using SMS::Send if the driver is set to 'Email'
Test plan:
0) Get a mobile phone
1) Apply the patch
2) Run updatedatabase.pl
3) Set the value of SMSSendDriver to 'Email'
4) Go to the admin page, the "Additional parameters" area should now have the link "SMS cellular providers"
5) On this page, add some providers. Make sure to add the provider for your own cellular phone service.
Here are some examples:
Sprint phonenumber@messaging.sprintpcs.com
Verizon phonenumber@vtext.com
T-Mobile phonenumber@tmomail.net
AT&T phonenumber@txt.att.net
Only add the domain part in the 'domain' field. So for Verizon, that would be 'vtext.com'
6) Create an account for yourself, add your SMS number, and select your provider from the dropdown box directly below it.
7) Enable SMS messaging for Item check-in and Item checkout
8) Check out an item to yourself
9) Run process_message_queue.pl
10) Wait! You should receive a text message shortly, when I tested it, I received my sms message within the minute.
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
It could be undefined.
Test plan:
prove t/db_dependent/Suggestions.t
should return green.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
There is already a syspref called "OverdueNoticeBcc" for sending Bcc
copies of mails sent for overdues and other notices. This patch add a
new syspref ClaimsBccCopy to bcc the claimacquisition and clamissues
alerts.
Changed the wording of the system preference to:
[Send|Don't send] blind copy (BCC) to logged in user when sending
serial or acquisitions claims notices.
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
In C4/Letters.pm, sub _parseletter changes values that are passed by
reference. E.g. patron's expiry date can change from iso format to
syspref format, leading to strange behaviour in the calling routines
(see Bug 15423).
This patch makes sub _parseletter work on a copy of the referenced values.
(Submitted to get feedback - is this the way to go?)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Good solution to real time bomb.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
C4::Letters::_parseletter will replace reserves.expirationdate with the
date a hold will be marked as problematic ( holds over ) if both
ReservesMaxPickUpDelay and ExpireReservesMaxPickUpDelay are enabled.
There is no reason this feature needs to rely on
ExpireReservesMaxPickUpDelay as there are many libraries that would like
to send the last day to pick up a hold in notices, but would rather deal
with the expired waiting holds manually rather than have Koha cancel
them automatically.
Test Plan:
1) Apply this patch
2) Set ReservesMaxPickUpDelay to 7
3) Disable ExpireReservesMaxPickUpDelay
4) Add reserves.expirationdate to your HOLD notice
5) Fill a hold for a patron
6) View the message, not that reserves.expirationdate is replaced
with the date the hold will be marked as problematic
Signed-off-by: Karl Holton <kholten@switchinc.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>
Bug 6810 - Fix QA failures
- Use KohaDates to convert dateexpiry
- remove MYSQL specifics methods for date handling in
GetUpcomingMembershipExpires
- make the script membership_expiry.pl write in Koha system logs
- add tests
Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>
Bug 6810 - Fix QA failures:
- use Koha::DateUtils instead of Koha::Template::Plugin::KohaDates,
- Add test with syspref MembershipExpiryDaysNotice equals 0 and undef,
- fix (new) test failure (when MembershipExpiryDaysNotice is undef).
Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
A new crontab based perl script to send membership expiry reminders. A
system preference controls the number of days in advance of membership
expiry that the notices will be sent on.
To Test:
1) Create a new Patron and set membership expiry date 14 days from the
date of registration.
2) Check your systemprefence ( MemExpDayNotice to 14 days default value)
3) Manual testing Run ( perl membership_expiry.pl -h)
It would give you various option:
This script prepares for membership expiry reminders to be sent to
patrons. It queues them in the message queue, which is processed by
the process_message_queue.pl cronjob.
See the comments in the script for directions on changing the script.
This script has the following parameters :
-c Confirm and remove this help & warning
-n send No mail. Instead, all mail messages are printed on screen.
Useful for testing purposes.
-v verbose
Do you wish to continue? (y/n)
4) Choose option for ex: perl membership_expiry.pl -c
5) Go to your koha database and check message_queue table you see some
results.
6) Run (perl process_message_queue.pl) it will send email to those
patron whose membership after 14 days from today.
7) Cron testing: (10 1 * * * $KOHA_CRON_PATH/membership_expiry.pl -c)
8) Set your 15 * * * * $KOHA_CRON_PATH/process_message_queue.pl
9) After running membership_expiry.pl, (process_message_queue.pl will
send emails to those patron whose membership after 14 days from
today).
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
For some needs, a librarian would like to display a datetime or
timestamp field without the time.
This patch adds filter logic in the notice/letter parsing process.
Test plan:
1/ Defined a notice using a datetime or timestamp DB field
(biblio.timestamp for instance).
2/ Generate the notice
3/ Verify that the letter is generated with the time
4/ Use the "dateonly" filter like:
<<your_table.your_field | dateonly>>
<<biblio.timestamp | dateonly>>
5/ Generate the notice
6/ Confirm the the letter is generated without the time for this field.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>
Updated the count of tests to 64 for t/db_dependent/Letters.t to pass
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Currently it's not possible to include information about which
issue has arrived in the serial notification notice the patron
can subscribe to from the OPAC.
The patch makes the fields from the subscription and serial
table available to the notice template.
In order to be able to print information about the correct
issue, the GetAlert has been modified to expext the serialid
as externalid when the module is issue.
git grep SendAlerts (only call with 'issue' is in Serial.pm)
To test:
- Add a subscription, select a patron notification template
- Search for the record in the OPAC
- Go to the subscription tab - More details
- Subscribe to the notification
- Edit the notice template you selected for the subscription
- add fields from subscription
- add fields from serial (serial.serialseq has the issue
information)
- Receive an issue for the subscription
- Check that you have received the notification and that
all information has been printed correctly
NOTE: notice is sent directly, not through the message_queue
Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
C4::Letters::getletter() is called in tools/letter.pl by the function
delete_confirm() to display the selected notice for deletion. Due to
current implementation of getletter(), a notice that does not use
the 'email' template (but uses any/all of the other templates - sms,
print or phone) can't be deleted from the staff client.
This patch adds deletion capability for notices that do not use email
template, but uses any/all of the other templates i.e. sms, print or
phone. This also adds 2 tests to t/db_dependent/Letters.t for testing
both conditions - a) when message_transport_type is specified b) when
it is not.
Test plan
=========
1/ Go to Tools -> Notices & Slips. Add a new notice only for print,
leave 'Library' and 'Koha module' options as default selections.
Enter 'KOHA_14206' and 'Koha Test 14206' against Code and Name
respectively, and 'Test' and 'Test Message' for subject and body.
Leave the Email, Phone and SMS tabs blank. Save the notice.
2/ On the notices listing page the new notice will be listed. Try to
delete it. It will load the 'Delete notice' dialog form, but the
table will not show any data under <th>s - 'Library', 'Module',
'Code' or 'Name'.
3/ Click the "Yes, delete" button. The page will be submitted and the
Notices listing reloaded. The print-only KOHA_14206 notice should
continue to exist. This is *wrong*.
4/ Apply this patch
5/ Reload the listings page and click on the 'Delete' link for Notice
KOHA_14206. This time, it should show the data under 'Module',
'Code' or 'Name' at least.
6/ Click on 'Yes, delete'. The page should submit and the listing page
reload. This time KOHA_14206 will be gone.
7/ Run prove -v t/db_dependent/Letters.t
All tests should PASS without any error.
Followed test plan. Works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
If the *DGST notices are sent in HTML, the items are displayed in a
single line.
To reproduce:
1/ Define a *DGST notice using the <<items.content>> pattern.
2/ Checkout at least 2 items to a patron and set the due date as today.
3/ Launch the advance_notices.pl and process_message_queue.pl cronjobs.
4/ Verify the email you will receive separates the items with a line
break.
Verify you don't find a regression for non-html letters.
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Note: the display in the notices tab is misleading here,
needs to be verified checking the sent emails or database
entries in message_queue.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Chris Nighswonger <cnighswonger@foundations.edu>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
http://bugs.koha-community.org/show_bug.cgi?id=9987
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
The emails sent via SendAlerts don't take into account HTML format.
_TEST PLAN_
Before applying:
1) Change system preference "AutoEmailOpacUser" to "Send"
2) Change "ACCTDETAILS" notice to HTML and add HTML to it
3) Create a new user with your email address
4) Note how the email displays the HTML tags as plain text
Apply patch
5) Create a new user with your email address
6) Note how the email displays the email as an HTML email
For thoroughness:
7) Change "ACCTDETAILS" notice to non-HTML
8) Create a new user with your email address
9) Note how the email displays the HTML as plain text
Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
The UTF-8 charset in the content type is written as "utf8" instead of "utf-8"
in SendAlerts(), which causes UTF-8 characters to display incorrectly.
_TEST PLAN_
Before Applying:
1) Edit ACCTDETAILS
2) Add some UTF-8 characters
I recommend using the following website
http://www.ltg.ed.ac.uk/~richard/unicode-sample.html
In my tests, I added the samples from Hebrew, Arabic, Basic Latin,
Latin-1 Supplement, Latin Extended-A, and Latin Extended-B.
3) Set the system preference "AutoEmailOpacUser" to "Send"
4) Create a new user account with your email address
5) Note that the email in your inbox doesn't display the Unicode
characters correctly
Apply the patch
6) Create a new user account with your email address
7) Note that the email in your inbox _does_ display the
Unicode characters correctly.
Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This patch fixes a major issue introduced by the
commit 5c4fdcf Bug 11742: A letter code should be unique.
The interface should let the possibility to create a default template
letter and some specific ones, with the same letter code (letter.code).
The patches submitted on bug 11742 tried to fix an issue based on a
(very bad) assumption: letter.code should be considered as a primary key and
should be uniq.
This patch reintroduces this behavior.
Note that the interface will block a letter code used in different
module (this is consistent not to have the same letter code used for different
needs).
This patch is absolutely not perfect, it just tries to change as less
change as possible and to use new tested subroutines.
Test plan:
1/ Verify that the problem raised on bug 11742 does not appears anymore.
2/ Verify there are no regression on adding, editing, copying, deleting
letters.
3/ Verify you are allowed to create a default letter template with a letter
code and to reuse for a specific letter (i.e. for a given library).
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
If you use a claimissue notice to claim serials, the generated letter
will be
<order>Title1, Author1</order>
<order>Title2, Author2</order>
...
<order>TitleN, AuthorN</order>
This patch geds rid of these tags.
Test plan:
1/ Create a claimissue notice with something like:
<<LibrarianFirstname>>
<<LibrarianSurname>>
The following issues are in late:
<order><<biblio.title>>, <<biblio.author>> (<<biblio.serial>>)</order>
2/ Generated late serial issues.
3/ Send notifications to vendor.
4/ The order tags should not exist anymore in the sent email.
You can see bug 5342 for a more detailled test plan.
Note for QA: This should have been done in GetPreparedLetter, but I did
not find a better way to do.
Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described. Tested having the <order> tags on one line
and also for a multi-line layout.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This patch simplifies the SQL query in Letters.pm for table
borrower_modifications.
It also addresses the only case this query is used in opac-memberentry.
An unused variable in Letters.pm is removed.
Test plan:
Enable selfregistration on opac.
Set verification by email to required in prefs too.
Self-register two new users.
Check the email notices generated.
Verify the new users with the tokens in their notice.
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Much cleaner SQL
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Cleaner and works as described, no regressions found.
Passes tests and QA script.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Modified:
C4/Letters.pm - remove aqbooksellers.* from SELECT statement
In Letters - SendAlerts subrotine, is safe to remove aqbooksellers.* from SELECT statement
for type=claimacquisition or claimissues. Aqbooksellers is passed to GetPreparedLetter subrotine in tables variable.
Testing:
I Apply the patch
Select Tools -> Notices and slips;
Edit ACQCLAIM;
Add :
<order>Ordernumber <<aqorders.ordernumber>> (<<biblio.title>>) (<<aqorders.quantity>> ordered) ($<<aqorders.listprice>> <<aqbooksellers.listprice>> each) has not been received.</order>
Save modifications;
Create a vendor (Acquisition module);
Create an order (Acquisition module);
Click Acquisitions -> Late orders;
Select the order created;
Click Claim order button;
Valide <<aqorders.listprice>>;
Valide <<aqbooksellers.listprice>>.
Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described. It's now possible to output the actual price
in the claim notice.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
If no order is selected on the acq claim page when clicking
'Claim order' an ugly perl error message is displayed.
This patch corrects the behaviour to display a human readable
'No order selected'
instead.
Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Reworded commit message to reflect what the patch achieves.
Works as described and passes tests.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
DateTime::Format::DateParse (called in Koha::DateUtils::dt_from_string)
does not manage to parse 9999-12-31 if a time zone is given.
my $date = DateTime->new(year => 9999, month => 12, day => 31);
=> OK
DateTime::Format::DateParse->parse_datetime( '9999-12-31' );
=> OK
DateTime::Format::DateParse->parse_datetime( '9999-12-31',
'America/Los_Angeles' );
=> KO (~20sec on my laptop)
It should not be considered as a valid date when the letter is parsed.
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Note that to reproduce the problem you much be checking in items from an
account which has been restricted indefinitely (either manually or by
the overdues process). With this patch such checkins go from taking
around 50 seconds (in my test system) to around 7 to 10 seconds.
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Good catch! Works as described, no problems found.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
When parsing the letter content, the 0000-00-00 should not be replaced,
it's not a valid date.
Test plan:
prove t/db_dependent/Suggestions.t
should not return the following error:
0000-00-00 seems to be a date but an error occurs on generating it (The
'month' parameter ("0") to DateTime::new did not pass the 'an integer
between 1 and 12' callback
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Adds another check for 0000-00-00.
Passes tests and QA script.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This patch adds a new DB field serial.claims_count
This field already exists for late orders. It makes sense to introduce
it for serial.
Test plan:
0/
a) Does not apply the patch.
b) Remove all your claimissues notices and be sure you have some serial issues
in late.
c) remove email address for the vendor you will use.
d) remove email address for the logged in user.
e) Export claims using the csv export => The selected issues will be
marked as claimed.
f) logout/login (to update the email address).
1/ Apply the patch and execute the updatedb entry.
2/ Go on the Serials > Claims page
3/ Verify that you get a warning message 'No claimissue notice defined'
4/ Verify the vendor list is correct (with the number of serial in late.
You should not get any changes here.
5/ Select one vendor and verify that the issue which was claimed before
has a claim count set to 1.
6/ Verify that you are not able to send notification to the vendor.
7/ Create a claimissue notice.
Something like:
<<LibrarianFirstname>>
<<LibrarianSurname>>
The following issues are in late:
<order><<biblio.title>>, <<biblio.author>> (<<biblio.serial>>)</order>
8/ Go on the Serials > Claims page, the warning message does not appear
anymore.
9/ Select issues. Select a notice. And "Send notification".
You should get an error (no email defined for this vendor).
10/ Add an email for the vendor.
11/ Select issues. Select a notice. And "Send notification".
You should get an error (no email defined for your user).
12/ Add an email address to your user
logout/login
13/ Select issues. Select a notice. And "Send notification".
You should get a happy message: the email has been sent!
14/ The email will contain the order tags if bug 12851 is not
pushed/applied.
Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, some small issues fixed in a follow-up.
Note: If you change the email address of your staff user, you will
have to log out and back in to make the change take effect.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
So notices using it (circulation, holds etc) will now use the new behaviour
To test:
1/ Edit the new systempreferences (ReplytoDefault and ReturnpathDefault)
2/ Optionally edit the branch the mail will be sent from, adding email addresses
3/ Test some mails, a circulation alert, an acquisitions claim, or a newly created borrower alert
4/ Check that the mails have the correct From, Replyto and ReturnPath set
The rules are
If the values are set in the branch use that, else use the syspref
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This patch makes it possible to choose a particular contact for
acquisitions and serials claims. To test:
1) Select a contact to use for claiming late orders and a contact
to use for claiming late issues.
2) Send a claim for a late order and a claim for a late issue.
3) Note that the claims went out to the proper people.
4) Run the unit test with:
> prove t/db_dependent/Letters.t
5) Sign off.
Note: the claim messages are recorded in the logs in the *Acquisitions*
module, not the Letters module as you might expect
This patch also fixes several perlcritic violations and centralizes
contact-related unit testing in Bookseller.t.
Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
If multiple registrations are submitted, the first patron to register
will be used for the first patron to click the registration confirmation
link!
Test Plan:
1) Submit 2 new patron registrations
2) Use the confirm link from the 2nd registration
3) Note you end up registering as the first submitted registration
4) Apply the patch
5) Repeat steps 1 and 2
6) Note you are now confirmed correctly
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Test plan appears to work fine, I have a feeling the sql could be
written better but can't come up with it on a Sunday morning
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described and fixes a critical bug.
Passes tests and QA script.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
At the moment, $dateonly is set to true when $1 is defined. However,
since the regex capture group only includes the time, this flag will
only be set when there is a value that includes a time.
In effect, this means that timestamps are reduced to dates only,
while dates have 00-00-0000 added to them.
This patch keeps the logic but reverses the values, so that $dateonly
will default to true unless $1 is defined.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Overdue notices are using the MySQL date format and not the dateformat
in the system preferences.
Test Plan:
1) Enable checkout notices for a patron, make sure the date due is in
the notice.
2) Check out an item to that patron, note the date is in the mysql
datetime format
3) Apply this patch
4) Check out another item to the patron, not the date is now in the
preferred date format.
Signed-off-by: David Cook <dcook@prosentient.com.au>
I love this patch! It is the best solution to this problem that I've
seen. I think it is set up to perfectly handle dates in the notices.
Unfortunately, the $dateonly flag is backwards, so the time is stripped
from timestamps and 00:00:00 is added to dates without times.
I'm adding a follow-up to reverse the setting of this flag.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
In C4::Letters::GetLetters, the code filter was not used as a query
parameter.
Moreover, the JS code was buggy. We only need to check the letter code,
except if it is an edit and the letter code has not been changed.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
This patch is a dirty way to fix a design issue on notices.
Currently the code assumes that a letter code is unique. Which is wrong,
the primary key is module, code, branchcode.
Maybe we should add a primary key (id) for the letter table in order to
pass the id to the template and correctly manage the letter code
duplication.
Test plan:
Try to duplicate a letter code using edit, add and copy actions.
If you manage to do it, please describe how you did.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
The GetLetters subroutine should return an arrayref with different
letters for a module.
Test plan:
0/ Delete your notices with module=claimacquisition, claimissues,
serial
1/ Go on the late orders page (acqui/lateorders.pl) and verify you
cannot choose a notice for claiming
2/ Create a notice with module=claimacquisition
3/ Go on the late orders page (acqui/lateorders.pl) and verify you
can choose the notice for claiming
4/ Go on the Claim serials page (serials/claims.pl) and repeat the same
thing with the a "claimissues" notice
5/ Create a new subscription (serials/subscription-add.pl) and verify
you cannot choose a notification for patrons.
6/ Create a notice with module "serial" and verify you can.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script. Additional tests done:
- copy notice ODUE, on saving you are now prompted to choose
a new CODE for the notice
- edit new notice, try to set code back to ODUE. You are
prompted that the code is already in use.
This will prevent people from accidentally overwriting a letter
with the same letter code.
If the template contains dynamic parts, the message won't be
considerated as duplicated.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Duplicate messages will be queued, but when sending the queued messages
duplicates are found and are marked as failed.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
The previous patch checks if a notice has already been sent when the
current notices has been sent in queue. Which is wrong!
We have to check if a similar notice has been sent today.
This patch has been created after an observation on a production server:
If a user place on holds several items, he will receive 1 SMS per hold.
Here we only want 1 SMS for all holds.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
For PREDUE messages, one message is sent to the message_queue table for
each items in advance, meaning that the patron could receive duplicate
notices.
The SMS part for DUE and PREDUE often do not contain dynamic parts, only
a standard message.
Note that this patch *only* affects the SMS transport.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
GetLetters only returns letters with a mtt = email. It should return all
letter codes in the DB.
The message_transport_type parameter is never used.
To reproduce the issue:
Create a notice with a sms template and no email template.
Go on the overdue rules configucation page.
The notice does not appear in the notice list.
Signed-off-by: Olli-Antti Kivilahti <kivilahtio@ProBook6570b>
---------------
Testing report:
---------------
Testing this subroutine from a test stub. Calling the method without arguments
and with argument 'circulation' and 'circulat'.
Works as supposed to.
Related Bug 11931 discovered but not within the scope of this featureset.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
* Fixes POD of GetMessageTransportTypes.
* Removes the useless map in GetMessageTransportTypes.
* Textual: "You must specify a title and a content" ->
"Please specify title and content".
* Reintroduces << and >> around the field name.
* Change message for the update DB entry.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This patch adds:
- a new jquery plugin : insertatcaret.
- the ability to define a notice template for each transport type.
- a new routine C4::Letters::GetMessageTransportTypes.
Test plan:
- Go on tools/letter.pl and check that all existing notices are still
there.
- Modify one. A new empty message is present for sms, print, etc. The
email message is filled with the existant value.
- Add a message for sms for example (don't forget the subject) and save.
- edit again and verify the sms message has been saved.
Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Test plan :
- Define a notice containing <<borrowers.streettype>>
- Trigger an event that generate this notice
Without patch <<borrowers.streettype>> is replaced by ROADTYPE
authorised value code. With the patch it is resplaced by its
description
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
This works as described, passes tests and QA script.
Note: it seems it's not possible currently to use B_streettype from
the interface, but it might be worth adding it as a follow up for later
use.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
When you run the Reserves test, you have the warnings:
Use of uninitialized value $branchcode in hash element at /usr/share/koha/testclone/C4/Letters.pm line 138.
Use of uninitialized value $branchcode in hash element at /usr/share/koha/testclone/C4/Letters.pm line 148.
This patch removes that warning.
Test plan:
Run the Reserves.t again.
Revised Test Plan
-----------------
Run the following on the command line prompt before and after
applying the patch:
perl -e "use C4::Letters; *C4::Context::userenv= sub { return {} }; my \$blah=C4::Letters::getletter('circulation','DUE', 'BRA');"
Before the patch there will be errors (as above), after there will not.
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
IndependentBranches must be on.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Pasting comment from the Bugzilla report:
Looking bit longer at this code, it is kind of strange to find it
there in the first place. Adding maxpickupdelay in Letters.pm should
not be there, but it is..
Also this date is not used normally in the default HOLD Available for
Pickup notice (that we are generating in this case). And if it would be
undef, the expiration date should imo be empty instead of today+0.
(before adding maxreservespickupdelay, you should test the allowexpire
pref first) So it is an (invisible) bug on its own.
Test plan:
See former patch. Kyle just discovered this bug, apparently by
deleting the maxpickupdelay pref..
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
For DUE message (and PREDUE, etc.) there are no check before sending the
message to the message_queue table.
This check avoids to try to send again and again the same message. Now
it is marked as "failed".
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Without the patch a sms notice will remain as 'pending' forever.
With the patch applied, the status is set to 'failed'.
Passes all tests and QA script.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Test plan:
1) set an empty string for the ReservesMaxPickUpDelay pref
2) place a hold on an item
3) check in the item
4) click on "Print and confirm"
5) an error occurs
> The 'days' parameter (undef) to DateTime::Duration::new was an 'undef'
6) apply the patch
7) repeat steps 1 to 4
8) the error does not occur anymore.
Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
An empty string didn't do it for me, I had to set the
variable for the systempreference to NULL. I am not sure
if this can happen when editing from the interface, but
this change should not have any ill side effects and it has
unit tests!
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Koha::DateUtils::output_pref took 4 parameters and the last one is a
boolean, so some calls were:
output_pref($dt, undef, undef, 1)
This patch changes its prototype to
output_pref({
dt => $dt,
dateformat => $dateformat,
timeformat => $timeformat,
dateonly => $boolean
});
An alternative is to call the output_pref routine with a datetime
object, without using an hashref:
output_pref($dt);
Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Right now overdues come from the branch, but the
others come from the admin email address - this
is a problem in multi-branch systems because they
have to come up with one email address that all
branches have access to.
C4::Letters::_send_message_by_email currently sets
the from address in the following order:
1) Address specified in message
2) Koha admin email address
The order will now be:
1) Address specified in message
2) Borrower's home library email address
3) Koha admin email address
Test Plan:
1) Set your library email addresses, and the KohaAdminEmailAddress
Make sure each of them are unqiue
2) Choose a borrower, enable the enhanced messaging and enable the
checkout and checkin email notices. Use your email address for
the borrower's email so you can recieve the emails.
3) Check out an item, check the from address of the email,
it should be the email addres set in KohaAdminEmailAddress
4) Apply the patch
5) Return the item, check the from address of the email,
it should match the email address set for the borrower's
home library.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
From-address and to-address were the same (patron's email) for
subscription alerts. This patch changes 'from' the branch or
kohaadminemailaddress
To test
- add a subscription in staff/serials in case you don't have any
- enable patron notifications or the subscription
- in the OPAC, subscribe to the serial
- in staff/serial, receive an issue of the serial
Before applying the patch, the email that is supposed to be sent
has the patron's email as 'from' and 'to' (and is likely to fail).
If you follow the steps after applying the patch, the email alert
should have the 'from' address of the patron's branch or
kohaadminemiladdress -- which should also work fine with the MTA/SMTP
you have set up for messaging.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Generating (e.g.) overdue notices can result in spurious warnings in
the cronjob logs:
$ ./misc/cronjobs/overdue_notices.pl -t -library CPL
prepare_cached(SELECT * FROM issues WHERE itemnumber = ?) statement handle DBI::st=HASH(0x54a7828) still Active at C4/Letters.pm line 589
This patch removes the warning by making sure that the relevant statement
handle is finished after fetching its first row of results.
To test:
[1] Set up an overdue loan such that running overdue_notices.pl will
trigger the generation of a notice.
[2] Run overdue_notices.pl -t and note the warning message.
[3] Apply the patch.
[4] Run overdue_notices.pl -t again and note that the warning message
is no longer displayed.
[5] Check the message_queue table and verify that the overdue
notices generated in steps 2 and 4 have the same text.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
The DB field aqorders.biblioitemnumber seems to be unused except to get
the itype on the spent.pl page.
This information can be retrieved uising another SQL join.
Test plan:
Try a complete workflow in the acquisition module: create an order,
receive it, play with the syspref AcqCreateItem.
Check that no regression is found and that the data for existing
orders don't change.
Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Test Plan:
1) Enable IndependantBranches
2) Apply this patch
3) Run updatedatabase.pl
4) Verify that the system preference still functions correctly
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Prior to this patch, at more-or-less random intervals pages working
with notices will cease to function. To test:
1) Apply patch.
2) Try to edit some notices.
3) Trigger some notices.
4) If you were able to edit the notices and trigger the notices, sign
off.
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and QA script pass.
I did a regression script without Plack:
- edit, add, delete and copy notice
- trigger checkout/checkin notice
- print issueslip
No problems found.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
This patch makes ParseLetter somewhat more restrictive in removing
punctuation characters from the end of a table field.
Based on the assumption that we want to remove punctuation from fields in
biblio and biblioitems (like ISBD).
ParseLetter should not remove e.g. a parenthesis in itemcallnumber, but still
removes e.g. a colon (:) at the end of a title.
Removed an unneeded global and lookahead from the regex.
Test plan:
1) Add a colon (:) to the end of a title.
2) Add a colon to the end of item copynumber.
3) Place a hold on that item. Check it in. Confirm hold.
4) Check the email or print notice generated. There should be no colon at the
end of the title, but the colon in the copynumber should still be there.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
I compared checkout notices with lots of different fields before
and after applying the patch. For example the ) at the end of a
field in branches is now longer removed. Other fields looked ok
before and after.
Passes all tests and QA script.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
This patch modifies Koha::DateUtils::output_pref to support the new system preference TimeFormat, which defines the visual format for a time as either the 24 hour format ( default ), or the 12 hour format (HH:MM AM/PM).
The patch also modifies C4::Members::IssueSlip to use output_pref rather than format_date.
Test Plan:
1) Apply patch
2) Run updatedatabase.pl
3) Issue an item to a patron, verify the times are in 24 hour format.
4) Switch TimeFormat to the 12 hour format.
5) Revisit the patron record you issued an item to, times should now be in a 12 hour format.
6) Print a slip for this patron, you should now see the time as well as the date.
Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests after fixing the test count in t/DateUtils.t.
Fixed conflicts in syspref.sql and updatedatabase.pl.
Signed-off-by: Cedric Vita <cedric.vita@dracenie.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
As we have another sign-off on this now I gave it a quick
run through and it works as expected.
All tests and QA script pass.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Script overdue_notices.pl creates a printed letter if borrower as no email.
Actually, unless --email option is used, first valid email of borrower is used. Email field should depend on AutoEmailPrimaryAddress syspref like in other letter creations.
Signed-off-by: MJ Ray <mjr@phonecoop.coop>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and QA script pass.
Following test plan from Julien Sicot from Bugzilla:
- with patron's email address specified on "primary email"
field AND syspref "AutoEmailPrimaryAddress" on "home"
=> notice sent to patron | OK
- with patron's email address specified on "secondary email"
field AND syspref "AutoEmailPrimaryAddress" on "work"
=> notice sent to patron | OK
- with patron's email address specified on "alternate email"
field AND syspref "AutoEmailPrimaryAddress" on "alternate"
=> notice sent to patron | OK
- with patron's email address specified on "secondary email"
OR "alternate email" field AND syspref "AutoEmailPrimaryAddress" on "home"
=> no notice sent to patron, overdue notice sent to koha admin | OK
- with patron's email address specified on "primary email" OR
- with patron's email address specified on "primary email" field
AND syspref "AutoEmailPrimaryAddress" on "home"
=> notice sent to patron | OK
- with patron's email address specified on "secondary email" field
AND syspref "AutoEmailPrimaryAddress" on "work"
=> notice sent to patron | OK
- with patron's email address specified on "alternate email" field
AND syspref "AutoEmailPrimaryAddress" on "alternate"
=> notice sent to patron | OK
- with patron's email address specified on "secondary email"
OR "alternate email" field AND syspref "AutoEmailPrimaryAddress"
on "home"
=> no notice sent to patron, overdue notice sent to koha admin | OK
- with patron's email address specified on "primary email"
OR "secondary email" field AND syspref "AutoEmailPrimaryAddress"
on "alternate"
=> no notice sent to patron, overdue notice sent to koha admin | OK
- with patron's email address specified on "primary email"
OR "secondary email" OR "alternate email" field and syspref
"AutoEmailPrimaryAddress" on "first valid" => notice sent to patron | OK"secondary email" field AND syspref "AutoEmailPrimaryAddress" on "alternate" => no notice sent to patron, overdue notice sent to koha admin | OK
- with patron's email address specified on "primary email" OR
"secondary email" OR "alternate email" field and syspref
"AutoEmailPrimaryAddress" on "first valid" => notice sent to patron | OK
Note: Options for AutoEmailPrimaryAddress should be like the field names on
the patron form (primary, secondary...), but this is outside the scope of this
patch.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Right now notices for holds awaiting pickup read something like this:
You have a hold available for pickup as of 2011-02-12.
This hold will expire if it is not picked up before: 02/22/2011.
If you no longer need this item or have any questions please contact us
Both dates should be formatting based on the dateformat system preference.
Test Plan:
1) Apply patch
2) Set the HOLD notice to the following:
<<reserves.waitingdate>> / <<reserves.expirationdate>>
3) Place a hold for a patron
4) Enable the HOLD notice via email for that patron ( requires EnhancedMessaging )
5) Check the item in
6) Go to the borrower's Notices tab, check the body of the new HOLD notice,
it should have two dates separated by a '/' in the format set by the dateformat
system preference.
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Patch works as advertised according to the test plan.
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Tested also with the HOLD_PRINT notice.
This reverts commit 40f9914e60.
Per Colin's report (confirmed by Mathieu and Julian):
"I've had some problems with this patch. With it applied I found
overdues for multiple users getting the same user's overdue message
text, eg user 1 gets their correct message but users 2, 3 and 4
get it as well. reverting the patch corrected this. I've not tracked
down the cause as yet."
This development will add the ability for a new patron to register
himself or herself. The self-registration will attempt to match this
newly inputted data to any existing patrons and if any possible matches
are found, ask if the patron is sure he or she doesn't already have an
account at the library. A system preference may be set to prevent patron
self-registration if the system detects the possibility that the person
may already have an account.
Once the patron has registered, passing a captcha (or similar
bot-stopper), the patron will then be optionally verified a second time
via email. At this point, the patron will be able to print a temporary
library card (optional by system preference), and will be provided any
details necessary to access electronic resources (this body of text
would be a template in the slips and notices system). At the library's
choice, this new patron would either be set to a temporary patron status
(patron type set via system preference), or a fully-fledged patron
(allow patron type to be determined by age and/or other attributes).
Assuming the library uses temporary patron types for OPAC registrations,
this patron will next enter a queue and would need to physically enter
the library to verify himself and become a fully-fledged patron (most
likely by bringing in physical proof of address, etc.). The librarian
would look up the patron record and modify the patron type. If a
temporary patron has not been verified within a certain time frame
(defined by a system preference), the patron record will be deleted
from the system via a cron job.
For registered patrons, the system will allow each person to also
update his or her personal data via the OPAC. When a patron updates his
or her information, the changes will be entered into a queue to be
verified by a librarian (preventing a patron from inputting obviously
bogus data). The staff client home page will display the number of
patron records with changes awaiting approval. A librarian would then be
able to click through a list of modification requests, and approve or
deny each (with approval and denial alerts being sent to the patron via
the standard messaging system).
NEW SYSTEM PREFERENCES
* PatronSelfRegistration
* PatronSelfRegistrationDetectDuplicates
* PatronSelfRegistrationVerifyByEmail
* PatronSelfRegistrationPrintTemporaryCard
* PatronSelfRegistrationUseTemporaryStatus
* PatronSelfRegistrationExpireTemporaryAccountsDelay
NEW NOTICE
* Verify by email notice
NEW SLIP
* Temporary card slip
NEW CRON JOB
* delete_expired_opac_registrations.pl
- Deletes patrons that have not been upgraded from the temporary
status within the specified delay
* delete_unverified_opac_registrations.pl
- Deletes the unverified patrons based on the length of time specified
in the PatronSelfRegistrationExpireTemporaryAccountsDelay
The patron will register from self_registration.pl, linked off opac-main.pl if enabled. The registration page will be translatable to other languages in the same way that existing templates are.
Test Plan:
1) Enable PatronSelfRegistration
2) Set PatronSelfRegistrationExpireTemporaryAccountsDelay to a number
of days
3) Create a self-registered borrower category
4) Set PatronSelfRegistrationUseTemporaryStatus
5) Set PatronSelfRegistrationVerifyByEmail to "Don't require"
6) Go to OPAC, log out if logged in.
7) You should see the "Register here" link below the login box
8) Attempt to register yourself
9) Verify you can log in with your temporary password.
10) Set PatronSelfRegistrationVerifyByEmail to "Require"
11) Attempt another self-registration
12) Check the messages table, you should see a new message with a
verification link.
13) Copy and paste the link into a web browser to verify the registration
14) Log in with the given credentials to verify the account was created.
Test Plan - Part 2 - Borrower Modifications
1) Log in to OPAC, go to "my personal details" tab.
2) Make some modifications to your details.
3) Repeat steps 1 and 2 for two more borrowers.
4) Log in to Koha intranet with a user that can modify borrowers.
5) At the bottom of mainpage.pl, you should see:
Patrons requesting modifications: 3
6) Click the link
7) Approve one change, deny a different one, and ignore the third, then
submit.
8) Check the records, you should see the changes take affect on the
approved one, and no changes to the other two. You should also see
"Patrons requesting modifications: 1" at the bottom of mainpage.pl
now.
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Bug 7067 - OPAC Borrower Self Registration - Followup
* Rename PatronSelfRegistrationUseTemporaryStatus to PatronSelfRegistrationDefaultCategory
* Hide register link unless PatronSelfRegistrationDefaultCategory is set.
* Add invalid token page
* Add documentation and switches to cron scripts
* Add required fields check for editing exiting patrons
* Don't force require email address for existing patrons when
PatronSelfRegistrationVerifyByEmail is enabled.
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Passed-QA-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
The patches for bug 7001 removed the parseletter subroutine from
C4::Letters without updating the talking tech script to use the
new alternative. This patch rectifies that situation.
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 8378 - <fine> syntax broken NFC and charset utf8
NFC normalize enqueued letters and add content-type charset=utf-8
This prevents utf8 codes from causing mysql to truncate the 'content'
from the point of certain codes, when stored in the message_queue table.
This was happenning with the currency symbol generated by
Locale::Currency:Format currency_format routine. NFC normalization
was only done on the attachment content with its content-type
containing "text", as in text/plain.
For emails AND attachments, the charset="utf-8" was added to the
content-type so mail clients would correctly iterate the utf8 codes,
thus preventing mobijake.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Ran through test plan before and after applying patch. Verified
that fine syntax does not work pre-patch and does work post-patch
for both direct emails and emails to the KohaAdminEmailAddress.
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Patch introduces a check for C4::Context->userenv in Letters.pm, so that script doesn't fail when it calls to C4::Context->userenv->{branch}, when run from shell.
Without the check, Advanced Notices, Item Due, and Overdues fail to generate.
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Perlcritic reported the following errors:
Subroutine prototypes used at line 96, column 1. See page 194 of PBP. (Severity: 5)
Subroutine prototypes used at line 120, column 1. See page 194 of PBP. (Severity: 5)
Subroutine prototypes used at line 152, column 1. See page 194 of PBP. (Severity: 5)
Subroutine prototypes used at line 173, column 1. See page 194 of PBP. (Severity: 5)
Subroutine prototypes used at line 190, column 1. See page 194 of PBP. (Severity: 5)
Subroutine prototypes used at line 227, column 1. See page 194 of PBP. (Severity: 5)
"return" statement with explicit "undef" at line 228, column 31. See page 199 of PBP. (Severity: 5)
"return" statement with explicit "undef" at line 229, column 31. See page 199 of PBP. (Severity: 5)
"return" statement with explicit "undef" at line 236, column 9. See page 199 of PBP. (Severity: 5)
Subroutine prototypes used at line 668, column 1. See page 194 of PBP. (Severity: 5)
"return" statement with explicit "undef" at line 669, column 27. See page 199 of PBP. (Severity: 5)
Subroutine prototypes used at line 719, column 1. See page 194 of PBP. (Severity: 5)
Subroutine prototypes used at line 865, column 1. See page 194 of PBP. (Severity: 5)
Subroutine prototypes used at line 899, column 1. See page 194 of PBP. (Severity: 5)
Subroutine prototypes used at line 981, column 1. See page 194 of PBP. (Severity: 5)
"return" statement with explicit "undef" at line 982, column 28. See page 199 of PBP. (Severity: 5)
Subroutine prototypes used at line 1000, column 1. See page 194 of PBP. (Severity: 5)
"return" statement with explicit "undef" at line 1001, column 27. See page 199 of PBP. (Severity: 5)
"return" statement with explicit "undef" at line 1004, column 9. See page 199 of PBP. (Severity: 5)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Adds the option -s/--split to enable notices to be separated
into different files by borrower home library.
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
For the CHECKIN and CHECKOUT notices, any data that is issue specific
does not show. For example, date due.
For CHECKOUT, this is caused not passing in the issues table as part
of the 'table' hash used by C4::Letters::GetPreparedLetter.
For CHECKIN notices, we need the old_issues table instead, as the item
has already been returned.
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
passes tests, correct information shows in notices.
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
This patch avoid enqueuing messages that have an empty body. It can
happen when letter is empty or becomes empty after being processed by
parseletter
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Implements support for Talking Tech I-tiva phone notification for OVERDUE, PREDUE and HOLD notifications.
Overdues respect triggers as configured for the patron's branch.
Predue and Holds notifications respect patron's messaging preference choices.
A new column for phone notification is added if the TalkingTechItivaPhoneNotification system preference is turned on
Record of phone messages being sent to patrons is added to the patron's Notices
tab; notice of success or failure can be retrieved from I-tiva.
See the TalkingTech.README for installation and set-up instructions.
Aside from the control system preference, and the necessary changes to Messaging Preferences
forms to make use of phone notifications, the bulk of the code resides in external
cronjobs.
TalkingTech_itiva_outbound.pl generates the Spec C file to send to I-tiva. Actual transmission
of the file must be handled by the system administrator.
TalkingTech_itiva_inbound.pl processes the received Results file from I-tiva. Getting the
file from I-tiva to Koha is the job of the system administrator, as well.
Both scripts have a --help option with full documentation.
The only necessary change to core Koha behavior is in C4::Letters::EnqueueLetter. The return
value was changed from 0 or 1 (successful addition of letter to message_queue or not), to the actual
insert ID of the letter. This was required by the outbound script to present a unique Transaction ID
for the notice added to the patron's record (so a 'sent' or 'failed' status could be updated). Since
the dbh and sth are not shared, and the last_insert_id() command is table-specific, this should be thread-safe.
No changes are necessary to any parts of Koha, as all usage of EnqueueLetter currently ignores the return value.
To Test:
1. Turn on TalkingTechItivaPhoneNotification system preference
2. Verify that 'phone' is now a valid notification option for patrons on both staff and OPAC side
3. Attempt to set a 'phone' preference for PREDUE or HOLD messaging; attempt should succeed
4. Set up the patron for notices to triggers:
a. include checked out items due in a range of days, including the value set up in their messaging preferences.
b. place several holds, some in position, others waiting for pickup, others in transit.
c. set the patron up to have overdues, overdue by a range of days that includes the delay values for
the patrons branch and categorycode
5. Run TalkingTech_itiva_outbound.pl --type=RESERVE --type=PREOVERDUE --type=OVERDUE --outfile=/tmp/talkingtechtest.csv
The resulting talkingtechtest.csv file should include all the items due on X days (where X is the patrons' preference),
and none of the ones due in other increments. Similarly, overdues messages should be added for each item due by a delay
value as configured; overdues of other numbers of days should be ignore. Holds that are waiting pick up or in transit should
have messages, those still pending should not.
Messages should be added to the patron's notices tab for each issue sent. Verify these messages exist, and all Notices
tokens are replaced with appropriate information.
Repeat, this time with 4c making use of the default branch overdue triggers, instead of branch-specific triggers.
To test the inbound script, create a CSV with rows in the format "<<Message_id>>","<<SUCCESS or FAIL>>"
Message ID should correspond to the final column of the talkingtechtest.csv file (the transaction id) for the message.
Primary Authorship: Ian Walls
Additional modifications: Kyle M Hall
http://bugs.koha-community.org/show_bug.cgi?id=4246
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Tested and in use in production by two public libraries : Middletown
and Washoe. Both have given their sign off, but don't have git to
actually sign off.
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
- sending claim mails works now
- claim counter is not increased when vendor has no email address
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
- Fix sql syntax error
- Fix Encoding
- SendAlerts must return an error if no email is defined
- Get error if no email in memberentry
http://bugs.koha-community.org/show_bug.cgi?id=7001
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
solves my comment 89: when you have a "mandatory" notice defined for a given library, it's not possible to delete it (and switch back to the "default" notification). isn't this a (small) bug ? was it intended ?
thanks!
Branches can have their own version of notices - added branchcode to
letter table.
Support html notices - added is_html to letter table.
Support for borrower attributes in templates.
GetPreparedletter() is the interface for compiling letters (notices).
Sysprefs for notice and slips stylesheets
Added TRANSFERSLIP to the letters
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
This bookseller has no email shows up correctly, when vendor has
no email address.
Small change made: Changed bookseller to vendor.
This patch fixes some minor problems found in late order management:
1) Silences 2 warns in Letters.p
After patch is applied no more warns should show up in the logs.
2) Fixes check/uncheck al
When limiting on one vendor the checkbox in the last header column
was doing nothing. I changed the checkbox to 2 links 'check all' and
'uncheck all' as it's done in other templates.
3) Email has been sent
The message was hardcoded into the lateorders.pl file and not
translatable.
I moved it to the template and changed the wording slightly.
Note: The error message 'The bookseller has no email' comes from
Letters.pm. I didn't change that, because I was not sure where it is
used. The error message as is can not be translated and should be
moved into the templates too.
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
FIX encoding problem
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Umlauts and diacritics now show up correctly in generated claims notices.
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
This patch adds 2 columns in the aqorders table :
- claims_count : number of claims for an orders
- claimed_date : date of the lastest claim
In the lateorders.pl table, you can not select orders from different
supplier because there is just one letter sent after clicking the "Claim
order" button. So, it's logic that you want to select only orders from
this supplier.
Modification in C4/Letters.pm:
refactoring code for claimacquisition and claimissues letter type.
Now, fields for theses letters check the table name. It's not possible
to chooce aqorders.title, this field doesn't exist !
Furthermore, you can add a <order> tag around your item fields, like
this :
-- Begin example
<<LibrarianFirstname>>
<<LibrarianSurname>>
<<aqbooksellers.contact>>
<<aqbooksellers.address1>>
<<aqbooksellers.phone>>
<<aqbasket.basketno>>
<<aqbooksellers.phone>>
<order>Library : <<items.homebranch>>
In your possesssion : <<biblio.author>>. <<biblio.title>>.
<<biblioitems.publishercode>>, <<biblioitems.publicationyear>>.
Callnumber : <<items.itemcallnumber>>. doc type : <<items.itype>>
Barcode : <<items.barcode>>
Date for the return : <<items.onloan>>.</order>
<<LibrarianSurname>>
-- End example
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Updates to_address in message queue when sending an email (when needed).
Signed-off-by: Koustubha Kale <kmkale@anantcorp.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
In parseletter_sth, the suggestions table was defined twice. The first time (which
is the only definition to get called, as it matches first then exists), defined the
primary search keys as borrowernumber and biblionumber. This is incorrect; the only
usage of the suggestions table tokens is with suggestionid as the key. This is defined
further down the if/then chain.
This patch removes the erroneous sth query definition.
To test:
1. Place a suggestion with a patron account with a configured email you can access
2. Approve or reject it
3. Verify the message you receive contains suggestion tokens (like title, author and reason)
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Suggestion mails for accepted, rejected and ordered look good now.
I couldn't test the suggestion mail AVAILABLE (bug 7096), but
assuming this would work too.
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Adding support for including fields from the Issues table in advanced due notices.
This is primarily to allow the inclusion of the due date for each item in the
advanced due notice, but will allow the inclusion of any field from the ISSUES
table.
This also adds code to exclude timestamp fields as these are irrelevant to the
end user in this context.
Note: Documentation should be updated to reflect the availability of the additional
fields in all circulation notices.
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This patch adds support for using a gmail account as an SMTP server.
It includes a basic HOWTO.
Signed-off-by: Magnus Enger <magnus@enger.priv.no>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This patch enables the ACCTDETAIL notices (and any branch-specific derivatives) to use
<<branches.*>> and <<borrowers.*>> tokens
This patch also attempts to send the email from the branch email first, falling back to
KohaAdminEmailAddress if no branch email exists.
To test:
1. Enable AutoEmailOpacUser system preference
2. Add <<branches.*>> tokens to the ACCTDETAIL notice
3. Create a new patron, including:
a. test email address in the field matching your AutoEmailPrimaryAddress syspref value
b. username and password (required to send a notice)
c. any other required fields to save the record
4. Check you inbox. Notice should send instantly (no need to run process_message_queue.pl)
Signed-off-by: Jared Camins-Esakov <jcamins@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Your suggestion notices template needs to contain things like
<<suggestions.title>>
<<suggestions.author>>
etc
Squashed commit of the following:
commit 3f4278bbe8d4c68be9f72d50e1eef6a411dc873d
Author: Chris Cormack <chrisc@catalyst.net.nz>
Date: Fri Aug 13 09:41:34 2010 +1200
bug 4211 parsing the letter before we enqueue it
commit ecdc0ff34c1aa9b96b68d541423ca693e2d63e67
Author: Chris Cormack <chrisc@catalyst.net.nz>
Date: Fri Aug 13 09:32:09 2010 +1200
Changing the query to fetch suggestions data, this is needed for suggestion mail to be sent
commit ece11d015b945ce119cf7cbc5e2563f4bc8aecf9
Author: Owen Leonard <oleonard@myacpl.org>
Date: Thu Aug 12 12:36:26 2010 -0400
Fix for Bug 4211, Acquisitions actions on suggestions don't generate email
Assuming 1) The patch for Bug 5126 is approved and 2) Suggestions
notices are added by hand (or from default sql--see Bug 5127) this
correction should get suggestions notices properly enqueued.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
commit 5c3bbe7d557b1994be72518746217fc6fc4e5b83
Author: Owen Leonard <oleonard@myacpl.org>
Date: Thu Aug 12 12:27:33 2010 -0400
Fix for Bug 5126 - Suggestions module missing from "add notice" form
- Adding "suggestions" entry
- Re-ordering options in alphabetical order
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
This is done by saving the notices in the message_queue table with
type 'print'. The notices are generated from a notice named
HOLD_PRINT. At the end of the day, they are dumped to an HTML file and
marked as sent by a new cronjob.
This setup is intended to be temporary; modules/batch/ shouldn't be around
forever.
Mandatory SQL:
INSERT INTO message_transport_types (message_transport_type) values ('print');
Note: overdue_notices.pl really needs to be completely re-written.
The script does not process all fields advertised in tools/letter.pl
This patch adds code to process all fields advertised as well as any
from the items table.
It also adds two additional tags for use in the letter templates:
<item></item> which should enclose all fields from the biblio, biblioitems,
and items tables.
<fine></fine> which should be enclosed by the item tag and should
enclose a currency identifier per ISO 4217. If this tag is present with
a proper identifier, the fine for that item will be displayed in the
proper currency format. Note: ISO 4217 changes from time to time therefore
all currencies may not be supported. If you find one that is not
supported, please file a bug with the Locale::Currency::Format author
Tan D Nguyen <tnguyen at cpan doe org>.
An example of the implimentation of these two tags in a notice template
might be like:
The following item(s) is/are currently overdue:
<item>"<<biblio.title>>" by <<biblio.author>>, <<items.itemcallnumber>>, Barcode: <<items.barcode>> Fine: <fine>GBP</fine></item>
Which, assuming two items were overdue, would result in a notice like:
The following item(s) is/are currently overdue:
"A Short History of Western Civilization" by Harrison, John B, 909.09821 H2451, Barcode: 08030003 Fine: £3.50
"History of Western Civilization" by Hayes, Carlton Joseph Huntley, 909.09821 H3261 v.1, Barcode: 08030004 Fine: £3.50
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
The return from Mail::Sendmail should always be checked
Output the error message if it fails so we have some
indication of where to start looking if it fails
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
If a global syspref OverdueNoticeBcc is present, send overdue notices to
this address. This allow a library to track and gather all outgoing
overdue notices.
Enhancing C4::SearchSuggestion
And changing its API
Changing C4::Suggestions API taking a hashref for NewSuggestion and ModSuggestion
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
This update the way Member is added and editing so that import and Edition
could be best automatized
GetMember evolves and allow ppl to serach on a hash of data
Adding SQLHelper A new package to deal with INSERT UPDATE and SELECT
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
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>
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>
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>
- 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>
- 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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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
- 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.
* 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 ;-) )