Bug 12031: Task Scheduler not sending mail

At some stage the runreport.pl cronjob was changed to accept longopts, but the scheduler script wasn't changed along with it. This patch fixes the mismatch.

To test:

1. make sure that your user is not in at.deny, and (if applicable/necessary) is in at.allow

1.5 test this on a package install, sending mails will still not work for git installs, even with this patch.

Useful, but not required step: make sure email can be sent from your server, also helpful is access to the Koha user's mail box (to see the bounce messages)

2. create a saved sql report to run

3. Go to Tools -> Task Scheduler and schedule a job to be run, and results emailed to you

4. note that you do not (without the patch) get an email. Make a note of the command it reports it is going to run.

5. apply the patch

6. schedule another job, you will notice that the command to run the scheduled job is slightly changed compared to the one in step 4.

7. Receiving an email when your job runs means the patch worked. Seeing --format= and --to= in the command also means the patch worked, as this is the command that runreport.pl is expecting.

8. Run the koha QA test tool.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

NOTE: The line that changes is visible in the bottom section,
      "Jobs already entered", with the corrected parameters and
      path used. If you do not have the <supportdir> config
      parameter set up in koha-conf.xml, it defaults to the
      typical package path. If you have the parameter set up,
      the path given matches what you tell it. Only tested in
      git.

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12031: (QA followup) adding supportdir to koha-conf.xml

By adding a supportdir, this allows for configuring use in a
non-package install environment, such as git.

Seeing as I only tested git, I clearly had this defined.
Further testing should include packaging up an installation, and
installing a package version without setting the supportdir
configuration value.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12031: [QA Follow-up] Undefined routine and change to koha-conf.xml

[1] Routine add_cron_job was added in 2007 but has not been defined.
    Parameter Recurring is not used.
[2] Made some changes to koha-conf.xml. Instead of an example to edit,
    I replaced it by the SCRIPT_NONDEV_DIR install variable.
[3] SCRIPT_NONDEV_DIR had to be included in rewrite-config.pl and the
    path had to be corrected for dev installs in Makefile.PL

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested single and dev install for supportdir change.
Compared installations with and without the patches for this report.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 9530: Adding sysprefs and making changes to the branch table

To allow for separate Reply To and From email addresses for notices

This patch will make no functional changes, it just sets up the db
changes needed.

To Test:
Apply patch, upgrade DB, make sure everything still works fine

(Or wait to test with following patches)

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>
Bug 9530: Adding a new Koha::Email module

To test

1/ Apply patch
2/ run t/Koha_Email.t

No changes to behaviour have been implemented yet

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>
Bug 9350: Making changes so that you can add the new fields to branches

To test

1/ Apply patch
2/ Add or Edit a branch, filling out the new fields
3/ Check that the changes saved

http://bugs.koha-community.org/show_bug.cgi?id=9530
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>
Bug 9530: Making changes to C4::Letters

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>
Bug 9530 making changes to basket/sendbasket.pl

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, test sending a cart email from the staff client
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>
Bug 9530 making changes to opac/opac-sendbasket.pl

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/ Send a cart from the public site (OPAC)
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>
Bug 9530 making changes to opac/opac-sendshelf.pl

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/ Send a list from the public (OPAC) interface
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>
Bug 9530 making changes to virtualshelves/sendshelf.pl

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/ Send a list from the staff client
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>
Bug 9530 Making changes to misc/cronjobs/runreport.pl

Note: mail from this doesnt work in current master, so you may not
be able to test this fully

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 sending a mail from scheduled reports, note you will need to have the fix
   for 12031 applied
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>
Bug 9530: Replace tabs with spaces

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 9530: DBRev 3.17.00.032

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 9530: Update DBIx

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 13138: Remove jQuery plugins which were used by Solr

This patch removes two jQuery plugins which were used only by
Solr-related templates. With the removal of Solr these plugins are
obsolete.

To test, search the Koha code for references to the two plugins:

jquery.textarea-expander.js
tablednd.js

There should be none.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Couldn't find any references. Also passes tests and QA script.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12900: IntranetBiblioDefaultView doesn't do anything with NORMARC or UNIMARC XSLT

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12900: (consistency followup) add buildBiblioDefaultViewURL to MARC21 XSLT

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Works as described, tested in UNIMARC and MARC21.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12871 - wthdrawn instead of withdrawn in ILSDI

Bug 10550 as renamed items.wthdrawn into items.withdrawn.
This change was missing in ILSDI/Services.pm

Test plan :
Test ILSDI webservice GetAvailability on a item with items.withdrawn > 0.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Fixes what seems to be the last occurence of wthdrawn.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12590 - Support deletion of biblio in svc API

The /svc endpoint allows you to create and update biblio records.
This patch extends it so that it is also possible to delete a biblio.

Test plan
* Create a new biblio by sending a POST request to /svc/new_bib with a
  marcxml record as request body. Note the biblionumber it gets assigned.
* Make some changes to the marcxml record, and update it by sending
  a POST request to /svc/bib/{bibilonumber}
* Observe that the changes are persisted on the biblio record.
* Now delete the bilblio by sending a DELETE request to
  /svc/bib/{biblionumber}
* Observe that the biblio is indeed gone from the db.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
This works as described and passes tests and QA script.
I tested using curl for a record with and one without items:

curl -X DELETE 'http://localhost:8080/cgi-bin/koha/svc/bib/2' --cookie /tmp/svc.cookies
<?xml version='1.0' standalone='yes'?>
<response>
  <error>This Biblio has items attached, please delete them first before deleting this biblio </error>
</response>

curl -X DELETE 'http://localhost:8080/cgi-bin/koha/svc/bib/3' --cookie /tmp/svc.cookies
<?xml version='1.0' standalone='yes'?>
<response>
  <status>OK, biblio deleted</status>
</response>

The deletion is processed correctly and the indexes are updated.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>