Commit graph

249 commits

Author SHA1 Message Date
9bc08e4e4c Bug 4330 : Fixing FSF address and copyright headers
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-05-28 17:53:40 +02:00
Chris Cormack
e9faa58901 Bug 8072: [SIGNED-OFF] Changes in capitalisation had broken guided reports
signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-05-14 13:56:50 +02:00
Chris Hall
24213703d5 Bug 7249 : Allow reports to be called through a restful interface
Hands back JSON, and supports caching

Squashed commit of the following:

commit 5c93506079738b9a13139417d3a0734289a4b007
Author: Chris Hall <chrish@catalyst.net.nz>
Date:   Mon Nov 21 15:41:14 2011 +1300

    Fixed bugs when creating reports, added more user friendly input and
    feedback

commit c62430bb358ee4af6ee5331b4d3a2ed67f723032
Author: Chris Hall <chrish@catalyst.net.nz>
Date:   Mon Nov 21 12:00:27 2011 +1300

    Added caching to intranet report webservices, added cache expiry and public
    options to reports

commit 2d89f0777d95b26bf08635782070b6367d0698f3
Author: Chris Cormack <chris@bigballofwax.co.nz>
Date:   Wed Nov 9 20:29:26 2011 +1300

    Working on caching for services

commit e0511f180cebd81747858ad776433fe3a1cf6854
Author: Chris Cormack <chris@bigballofwax.co.nz>
Date:   Wed Nov 9 08:28:26 2011 +1300

    Starting work on webservices

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Patch includes database update adding 2 new fields to the saved_sql table.

1) Checked that adding/deleting/editing of sql reports still works and new
fields are correctly saved to the database.

2) The saved reports page now lists the new fields correctly.

3) Checking URLs with JSON output
- if report is not public http://localhost/cgi-bin/koha/svc/report?id=2 fails,
but http://localhost:8080/cgi-bin/koha/svc/report?id=2 works
- if report is public, both links work

4) Checking results are cached
Created a report listing my borrowers, setting caching to 60 seconds and
added new borrowers before doing following tests.
- URL doesn't show new borrower immediately - correct
- Turning off the usecache system preference updates data - correct
- Restarting memcached updates data '/etc/init.d/memcached restart' - correct
- Waiting until cache time runs out updates data - correct

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Retested the feature and renewing my sign-off.

There are some things that should be noted:
- currently there is a hardcoded limit of 10 results for the reports webservice
- reports with runtime parameters are currently not supported
2012-05-11 10:26:29 +02:00
Dobrica Pavlinusic
95bf6fb012 Bug 7829 - reports/ remove all exit(1) for plack
In Bug 7772 Ian correctly noted that reports have exit(1) all over the place.
This is left over from old code, and this patch changes them to exit(0).

I decided to use plain exit as opposed to explicit exit(0) since it produces
cleaner code, but I'm welcoming suggestion on this.

Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-03-28 16:25:24 +02:00
Dobrica Pavlinusic
de8ad03aae Bug 7772 - reports/bor_issues_top.pl: we need to exit(0) for plack
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-03-26 16:25:57 +02:00
20b68731e3 Bug 7668 - Improve navigation and toolbar options in guided reports
Creating new include, reports-toolbar.inc for presenting "action"
options to the user, in contrast with "view" options in the left-
hand navigation menu.

In the toolbar: New (guided report, SQL report), Edit, Run.

The presence of the toolbar allows the user to access functions
more flexibly: Getting directly to 'edit' or 'run' from the 'view'
page for instance.

Modifications to guided_reports.pl pass report id and name to
the template for clarity and for the purpose of enabling the
edit/run buttons.

To test: Apply the patch and go through the process of creating
a new saved SQL report. Note that the toolbar is present and
the buttons are functional at appropriate times.

New and Edit options should only be displayed if the user has
permission to create reports. Test with a user who does not
have create permission to confirm.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-03-19 18:00:15 +01:00
Jonathan Druart
63ac6d7639 Bug 5698: Followup: Add date picker option to SQL Runtime Parameters
Move html

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-03-19 16:21:48 +01:00
Ian Walls
08b7589b85 Bug 5698: Add date picker option to SQL Runtime Parameters
Adds a date picker for SQL reports with the 'date' authorised_value.  Updates help
documentation for this new feature, as well.

To test:
1.  Create a new report with two date parameters, using the syntax:
<<Label for this selection of date|date>>
2.  Run the report
3.  Select dates
4.  The SQL generated should format the dates properly in ISO, and keep track of which
date is which

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-03-19 16:20:29 +01:00
Garry Collum
67825637be Bug 6984 - Holds statistics doesn't work.
This patch fixes several errors in reserves_stats.pl and reserves_stats.tt.

Testing -
To test this patch, data must be in either the reserves table or old_reserves or both.  The following SQL will give you the raw data that is used by the report.

SELECT priority, found, reservedate, notificationdate, reminderdate,
waitingdate, cancellationdate, borrowers.categorycode, items.itype,
reserves.branchcode, holdingbranch, items.homebranch, items.ccode,
items.location, items.itemcallnumber, borrowers.sort1, borrowers.sort2
FROM reserves
LEFT JOIN borrowers on (borrowers.borrowernumber = reserves.borrowernumber)
LEFT JOIN items on (items.itemnumber = reserves.itemnumber)
UNION SELECT priority, found, reservedate, notificationdate, reminderdate,
waitingdate, cancellationdate, borrowers.categorycode, items.itype,
old_reserves.branchcode, holdingbranch, items.homebranch, items.ccode,
items.location, items.itemcallnumber, borrowers.sort1, borrowers.sort2
FROM old_reserves
LEFT JOIN borrowers on (borrowers.borrowernumber = old_reserves.borrowernumber)
LEFT JOIN items on (items.itemnumber = old_reserves.itemnumber)

To test the notificationdate and reminderdate, I added data to the old_reserves table, since I have never run notices on my test machine.

Ex:
UPDATE old_reserves
SET notificationdate = "2012-01-29",
reminderdate = "2012-01-29"
WHERE timestamp = "2012-01-29 20:09:34";

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Confirm original bug -- Reports work as expected now!
prove t xt t/db_dependent no different from master.
2012-02-03 14:14:15 +01:00
Colin Campbell
263dded818 Bug 6752: Be stricter with utf-8 encoding of output
use encoding(UTF-8) rather than utf-8 for stricter
encoding
Marking output as ':utf8' only flags the data as utf8
using :encoding(UTF-8) also checks it as valid utf-8
see binmode in perlfunc for more details
In accordance with the robustness principle input
filehandles have not been changed as code may make
the undocumented assumption that invalid utf-8 is present
in the imput
Fixes errors reported by t/00-testcritic.t
Where feasable some filehandles have been made lexical rather than
reusing global filehandle vars

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-01-27 12:11:06 +01:00
Paul Poulain
ceb5757573 BZ6115: Acquisition reports : date filter & sorting don't work
* the filter on dates don't work
* when displaying by day or month, it was 100% alphabetic, april was before
january for example. Adding the month number before the month name to get
proper sorting
* removed many commented warn & lines

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2012-01-20 14:18:33 +01:00
396efb90c7 Fix for Bug 3431 - Catalog by itemtype report pulling from holdingbranch
Plus several other fixes for this report no one uses:

- Clarifying titles and breadcrumbs
- Correcting terminology: branch -> library
- Sorting library select field by library name
- Displaying library name instead of code on output
- Sorting results by itemtype description
- Adding tablesorter to results

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-12-16 18:30:00 +01:00
Alex Arnaud
9855b834b6 bug 6917 Dates filters doesn't work when they are not selected on row or column
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-12-13 16:16:25 +01:00
Ian Walls
c70ff88205 Bug 2616: Remove unnecessary 'use HTML::Template' calls
Removes deprecated calls to HTML::Template or HTML::Template::Pro from:
C4/Output.pm
catalogue/export.pl
reports/issues_by_borrower_category.plugin
reports/itemtypes.plugin

Only remaining calls are in misc/cronjobs/rss/rss.pl, misc/cronjobs/smsoverdues.pl,
and t/test_template.pl.  These scripts still legitimately depend on H:T:P

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-12-06 11:34:05 +01:00
df2a3a9a3c Fix for Bug 6602 - Reports dictionary doesn't properly recognize text columns
Reports dictionary won't let you set a comparison for MEDIUMTEXT columns. To
test, choose a MEDIUMTEXT column like borrowers.surname in Step 3 of adding
a new dictionary definition. Before the patch, in Step 4 you would not see
any kind of form field for entering a comparison. After patching Step 4 will
offer you a field labeled "Search string matches."

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Fixes described problem with mediumtext columns.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-08-25 11:49:04 +12:00
Sophie Meynieux
e1370001c6 Bug 6078: Request to find borrowers without issues overload the server
Optimization of the SQL request using NOT EXISTS instead of NOT IN

BibLibre MT5946

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-08-10 21:13:39 +12:00
Colin Campbell
b5b71339f3 Bug 5453 Move declarations out of conditionals
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-07-15 15:50:23 +12:00
Colin Campbell
2ab00242d0 Bug 6050 Make calls to GetItemsInfo consistent
Do not misleadingly document or pass an unused second parameter
makes all calls use the single parameter call as the C4
routines already did

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-06-14 14:12:02 +12:00
577ce72e91 bug 6409: fix pagination of SQL report output when parameters are used
Fixes bug where paging through output of an SQL report that includes
one or more parameters fails by asking you for the parameter values
and again and sending you back to the first page of results.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-06-10 11:45:47 +12:00
Liz Rea
14364d9866 Bug 6258 - Guided reports wizard 'Build new' brings up empty page
Patch fixes a TT error that caused Build New to be empty.

To test:
Click More -> Reports, you should see the welcome page and be able to step through creating the report.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-05-26 11:27:56 +12:00
300dbe5d72 Fix for Bug 6284, Reports Filters Need Prettying
1. Moved the form to the left under the menu
2. Added a calendar next to date (and a date format tip)
3. Styled the form like other filter forms for consistency's sake
4. Formatted on-screen message to match standard style

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-05-11 09:10:06 +12:00
Srdjan Jankovic
8360343fbc Bug 6033 : wr77488 : report selection filter
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-04-28 11:14:19 +12:00
Srdjan Jankovic
c5762df823 Bug 6024 : Show "Run report" link after sql update as wel
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-04-08 13:33:43 +12:00
Srdjan Jankovic
b390c657b8 Bug 6024 : add "Run report" link on the new report creation success page
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-04-08 13:29:58 +12:00
Jonathan Druart
6de105084e Bug 6099: error in report pagination when GROUP BY
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: fdurand <frederic.durand@univ-lyon2.fr>
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-04-08 12:15:32 +12:00
Paul Poulain
ddbedbfc2f Bug 4330 : Adding some copyright BibLibre statements 2011-03-21 10:57:20 +13:00
Chris Cormack
2b1de0948d Bug 5869 - Follow up patch, fixing copyring and s/reserves/holds/
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-03-17 14:33:09 +13:00
Paul Poulain
99b0a074eb Bug 5869 : Adding a reserve report
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-03-17 14:33:08 +13:00
Katrin Fischer
f2cf6c2db3 Bug 5527: Fix some problems in inactive borrowers report
- 'Not checked out since:' date was not added to query
- borrowers with only checkouts and no returns since this date were considered inactive

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-03-12 08:30:21 +13:00
Nahuel ANGELINETTI
6b285cf44d (bug #5157) fix borrowers top issues
this fix filters of borrowers top issues that doesn't work really well... perhaps because reports scripts need too much improvment.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-03-06 08:31:08 +13:00
Nahuel ANGELINETTI
e8de8b97c6 (bug #3743) fix acquisition stats ordering
This patch fix ordering in acquisition stats to order by month number.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-13 08:26:52 +13:00
Garry Collum
0fc7e5bfdc Bug 4937: Fixes XHTML in the pagination links of a saved report.
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-12-15 09:17:37 +13:00
Chris Cormack
5278aa0ca4 Merge remote branch 'kc/new/biblibre_reports' into kcmaster 2010-12-14 06:31:00 +13:00
Nahuel ANGELINETTI
666cc03bd3 (bug #5154) fix most checkouts report
Ignore null/deleted borrowers

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-12-13 16:11:03 +13:00
Andrew Elwell
efa66f1f55 Bug 5385: POD Cleanups (part 2)
More podchecker cleanups to eliminate warnings / errors

Signed-off-by: Andrew Elwell <Andrew.Elwell@gmail.com>
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-11-12 10:06:56 +13:00
89cda847a1 follow-up to reports permissions patch
* Enforce the requirement that the user must have the
  create_reports permission in order to delete a saved report;
  closes hole where unprivileged user could delete reports
  by constructing a URL maliciously
* Added another tweak of the template - don't offer option
  to create a new report if the user doesn't have permission.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-11-10 19:39:50 +13:00
Jean-André Santoni
4bd6188816 Fixes a permission problem in guided reports
missing s
create_reports
and execute_reports
rather than
create_report
and execute_report

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-11-10 19:39:23 +13:00
311d958bbb follow-up: improve use of home and holding library in circ stats report
[1] Actually make use of home/holding library if set
[2] Use current terminology - "library", not "branch"

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-11-10 19:39:03 +13:00
Alex Arnaud
51d4e749d5 (MT 3267) Add Homebranch and Holdingbranch search criterion on circulation stat.
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-11-10 19:38:59 +13:00
b49a0a30a1 bug 4176: remove references to unimplemented system preference MIME
The intended functionality of this system preference was never
implemented.  To avoid template changes prior to 3.2.0, put in
hard-coded string 'CSV' to (accurately) identify the type of
the output files in the affected reports.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-10-21 21:36:45 -04:00
573ac9488f remove a bunch of unconditional debug warns
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-07-02 10:57:08 -04:00
Colin Campbell
4d32d848e0 Bug 4911 Remove duplicated code
Two duplicated subroutine definitions removed

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-06-25 13:17:12 -04:00
Donovan Jones
f1598406e5 Bug 2505 - Add commented use warnings where missing in the reports/ directory 2010-04-21 20:19:57 +12:00
Nahuel ANGELINETTI
c5dabb4ad1 (bug #4339) fix catalog stats
This fix the catalog stats to count items that have no barcode.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-04-16 07:17:11 -04:00
Lars Wirzenius
6e7a4d3a3d Fix FSF address in directory reports/
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-03-16 20:17:55 -04:00
df99b9b69c bug 1542 followup - tweak to keep handling the UI selected value out of C4
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-02-14 18:31:21 -05:00
Chris Cormack
8f902d3248 Bug 1542, followup patch to tidy up some messy dropdown behaviour
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-02-14 18:14:19 -05:00
Nahuel ANGELINETTI
473b38185e (bug #3760) fix and improve some reports
This patch fix some problems with dates, and itemtypes level.
And it improve some sql queries.
2010-01-28 15:11:49 +01:00
Paul Poulain
7d8b369ba4 Improved guided reports (#3929)
added runtime parameters for guided reports. Online help:

Can I have run-time defined parameters?

Yes, you can: there is a specific syntax that Koha will understand as 'ask for values when running the report'. The syntax is &lt;&lt;Question to ask|authorised_value&gt;&gt;.

The &lt;&lt; and &gt;&gt; are just delimiters. You must put &lt;&lt; at the beginning and &gt;&gt; at the end of your parameter
The Question to ask will be displayed on the left of the string to enter.
The authorised_value can be omitted if not applicable. If it contains an authorised value category, or <strong>branches</strong> or <strong>itemtype</strong> or <strong>categorycode</strong>, a list with the Koha authorised values will be displayed instead of a free field

Note that you can have more than one parameter in a given SQL
Note that entering nothing at run time won't probably work as you expect. It will be considered as "value empty" not as "ignore this parameter". For example entering nothing for : "title=&lt;&lt;Enter title&gt;&gt;" will display results with title='' (no title). If you want to have to have something not mandatory, use "title like &lt;&lt;Enter title&gt;&gt;" and enter a % at run time instead of nothing
Sample :
SELECT surname,firstname FROM borrowers WHERE branchcode=&lt;&lt;Enter patrons library|branches&gt;&gt; AND surname like &lt;&lt;Enter filter for patron surname (% if none)&gt;&gt;
2010-01-28 15:11:46 +01:00
Nahuel ANGELINETTI
e85209a933 (bug #4038) fix birth date filter in borrowers stats
this patch format date for SQL if there is non-iso dates.
2010-01-15 10:00:07 +01:00