Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Tried to address every single thing that QA mentioned :
1)Removed isNull function
2)Changed datepicker properly
3)We have to fill in two dates not to be flooded with old entries if we don't want to.
4)The first two fieldsets are now in one bigger field set
5)Removed the use of $fullreportname variable
6)Removed the use of dt_from_string when it already recieved a DT.
7)Removed comments starting with "###" in cash_register_stats.pl
8)Used Text::CSV::Encoded to generate the CSV file (used guided_reports.pl as an example)
9)I am not sure if using C4::Reports::Guided is the right choice here. I instead used the same column names as the one recieved by the query in cash_register_stats because this report uses columns from 5 different tables in addition of using both firstname and surname twice.
For the ninth point, I would like to know more about C4::Reports::Guided if you still think using it would be a better solution. Thank you!
Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
To be more specific, the column note from accountlines is now displayed in the table of the transactions.
The grand total is now calculated for neagtive types like Credit or Payment and isn't counted for Write off types.
Credit (return item) 'CR' has been added to drop down of transaction type
Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
I cleaned up the code according to comment #23. I got rid of DHTMLcalendar_dateformat,
beacause it wasn't use in cash_register_stats.tt. C4::Dates is deprecated,
Koha::DateUtils is now used.
Some column names are changed and the pagination for the dataTables is fixed.
Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This patch creates a new report that outputs cash register stats for a specific period.
Changes:
koha-tmpl/intranet-tmpl/prog/en/includes/reports-menu.inc - Added cash register report link
koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash-register_stats.tt - new file
koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tt - Added cash register report link
reports/cash-register_stats.pl - new file
Testing:
I Apply the patch
0) Go to reports home page (Home › Reports);
1) Validate link << Cash Register >> under Statistics wizards;
2) Click link;
3) Validate page with three fieldsets;
4) Chose a date interval, a transaction type, a library and an output;
5) Validade the result.
Signed-off-by: Nicole <nicole@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This patch replaces the call to C4::Koha::GetKohaAuthorisedValues with
Koha::AuthorisedValues->search_by_koha_field
Test plan:
AV descriptions should be displayed on the following pages:
- XSLT view - location and ccode
- Bibliographic detail, moredetail and OPAC pages - location, ccode, copynumber
- returns - location
- opac-basket - ccode, location
- The 3 reports: catalogue_stats.pl, issues_stats.pl and
reserves_stats.pl - location, ccode
Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
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>
At one time it was possible to store the results of a report into the
saved_reports table.
This allowed the librarians to compare different results, from the Koha
interface.
This patch is a proof of concept and is not very polished (understood:
it cannot be pushed like that).
Test plan:
Execute the runreport.pl cronjob script with the new --store-results
option.
This will serialize into json the results and put it into the
saved_reports table.
On the "Saved report" list, the "Saved results" column is now populated
with a date (note that you can have several date for a given report).
If you click on this link, the data will be displayed in a simple table.
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
If a report is duplicated from the report list, the new report will
contain the tag (<<YEAR>> for instance), but from the reports results
page it copies the values used for the results.
Test plan:
Create a new sql report with tags
Duplicate it from the report list: no expected changes
Run it and duplicate it: the tags must not have been replaced
Signed-off-by: Andreas Roussos <arouss1980@gmail.com>
Ran and duplicated a report, the tags remained intact.
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Lot of errors are raised by this script under plack because of var scope
issues:
Variable "$ccodes" is not available at
/home/koha/src/reports/reserves_stats.pl line 337.
Variable "$locations" is not available at
/home/koha/src/reports/reserves_stats.pl line 338.
Variable "$itemtypes" is not available at
/home/koha/src/reports/reserves_stats.pl line 339.
Variable "$Bsort1" is not available at
/home/koha/src/reports/reserves_stats.pl line 344.
Variable "$Bsort2" is not available at
/home/koha/src/reports/reserves_stats.pl line 350.
Variable "@patron_categories" is not available at
/home/koha/src/reports/reserves_stats.pl line 356.
The lazy way to fix that is that reinit them from the subroutines they
are used.
Test plan:
Execute the report, after this patch applied you won't see the error in
the log.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Test plan
=========
On Reports > reservations, select all statuses as line, pickup library as column (empty) and a range of hold date. Keep the results
Run the same reports but with statuses as column and pickup library as line
You should get the same results on another display.
* Without patch, if you've got representative data, most of the time you can observe significant differences between both results
* With the patch, results are always the same (and right if you request directly your database)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This splits off the delete capability from the create reports permission.
From a UI perspective there were CSS issues, that this patch set hackily
bypasses. Perhaps someone else can amend this enhancement with the required
changes so that the extra column at the beginning of the table can be
removed when the user does not have delete capability.
TEST PLAN
---------
1) back up db
2) apply patch
3) ./installer/data/mysql/updatedatabase.pl
-- should run without issue.
4) in mysql:
> drop database ...
> create database ...
-- totally blanks it for fresh web install
5) run web install
-- installing should have no issues
6) go to a patron
7) set permissions
8) expand the reports permission
-- should have delete reports now
9) click help and scroll down to
'Granular Reports Permissions' right at the bottom.
-- there should be a new delete_reports section
10) Head over to guided reports and build a few reports.
-- as system account user, delete stuff should all be visible.
11) Find a patron, set all permissions, except delete reports.
12) log out and then log in as the modified patron
13) Head over the save reports
-- none of the delete options should be available to the user.
14) run koha qa test tools
15) restore db
Followed test plan. Additionally tried to delete using params in URL
(not possible, OK)
Signed-off-by: Marc <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
From qa tools:
reports/cat_issues_top.pl: pod: =over on line 39 without closing =back
Note: qa tools does also report "options_for_libraries: not found" on two
template includes. Considering this as a false alarm, since the block is
defined in another include loaded in doc-head-open.
[1] koha-tmpl/intranet-tmpl/prog/en/includes/subscriptions-search.inc
[2] koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-topissues.inc
Found a template where a USE Branches was missing:
koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt
Easy to spot since the libraries combo was empty.
Tried to find similar occurrences with few greps, but couldn't find any.
I did find duplicate USE Branches though in:
koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/checkexpiration.tt
This patch removes them.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This is the fourth and last patch set to remove C4::Branch.
The real purpose of this patch is to standardise and refactor some code
which is related to the libraries selection/display.
Its unconfessed purpose is to remove the C4::Branch package.
Before this patch set, only 6 subroutines still existed in the C4::Branch
package:
- GetBranchName
- GetBranchesLoop
- mybranch
- onlymine
- GetBranches
- GetBranch
GetBranchName basically returns the branchname for a given branchcode.
The branchname is only used for a display purpose and we don't need to
retrieve it in package or pl scripts (unless for a few exceptions).
We have a `Branches` template plugin with a `GetName` method which does
exactly this job.
To achieve this removal, we will use this template plugin and delete the
GetBranchName from pl and pm files.
The `Branches.all()` will now select the library of the logged in user
if no `selected` parameter has been passed.
This new behavior could cause regressions, for instance there are some
places where we do not want an option preselected (batch item
modification for instance), keep that in mind when testing.
GetBranchesLoop took 3 parameters: $branch and $onlymine.
The first one was used to set a "selected" flag, for a display purpose:
select an option in the libraries dropdown lists.
The second one was useless: If not passed or set to 0, the
`C4::Branch::onlymine` subroutine was called.
This onlymine flag was use to know if the logged in user was able to see
other libraries infos.
A patron can see the infos from other libraries if IndependentBranches
is not set OR if he has the superlibrarian permission.
Prior to this patch set, the "onlymine test" was done on different
places (neworderempty.pl, additem.pl, holidays.pl, etc.), including the
Branches TT plugin. In this patch set, this test is only done on one
place (C4::Context::only_my_library, code moved from
C4::Branch::onlymine).
To accomplish the same job as this subroutine, we just need to call the
`Branches.all()` method from the `Branches` TT plugin. It already
accepts a `selected` parameter to set a flag on the option to select.
To avoid the repetitive
[% IF selected %]<option selected="selected">[% ELSE %]<option>[% END %]
pattern, a new `html_helpers` TT include file has been created, it
defines an `options_for_libraries` block, which takes a `selected`
parameter. We could imagine to use this include file for other
selects.
The 'mybranch` and `onlymine` subroutines of the C4::Branch package have
been moved to C4::Context. onlymine has been renamed with
only_my_library. There are only 4 occurrences of it, against 11 before
this patch set.
There 2 subroutines are Context-centric and it makes sense to put them
in `C4::Context` (at least it's the least worst place!)
GetBranches is the tricky part of this patch set: It retrieves all the
libraries, independently of the value of IndependentBranches.
To keep the same way as the existing calls of `Branches.all()`, I have
added a `unfiltered` parameter. If set, the `Branches.all()` will call
a usual Koha::Libraries->search method, otherwise
Koha::Libraries->search_filtered will be called. This new method will
check if the logged in user is allowed to see other libraries or only
its library.
Note that this `GetBranches` subroutine also created a `category` key:
it allowed to get the list of groups (of libraries) where this library
existed. Thanks to a previous patch set (bug 15295), this value was
not used anymore (I may have missed something!).
Note that the only use of `GetBranch` was buggy (see bug 15746).
Test plan (for the whole patch set):
The best way to test this whole patch set is to test with 2 instances: 1
with the patch set applied, 1 using master, to be sure there is no
regression.
It would be good to test the same with `IndependentBranches` and the
without `IndependentBranches`.
No difference should be found.
The tester must focus on the library dropdowns on as many forms as
possible.
You will notice changes in the order of the options: the libraries will
now be ordered by branchname (instead of branchcode in some places).
A special attention will be given to the following page:
- acqui/neworderempty.pl
- catalogue/search.pl
- members/members-home.pl (header?)
- opac/opac-topissues.pl
- tools/holidays.pl
- admin/branch_transfer_limits.pl
- admin/item_circulation_alerts.pl
- rotating_collections/transferCollection.pl
- suggestion/suggestion.pl
- tools/export.pl
Notes for QA:
- There are 2 FIXMEs in the patch set, I have kept the existing behavior,
but I am not sure it's the good one. Feel free to open a bug report and
I will fill a patch if you think it's not correct. Otherwise, remove the
FIXME lines in a follow-up patch.
- The whole patch set is huge and makes a lot of changes.
But it finally will tremendously reduce the number of lines:
716 insertions for 1910 deletions
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
One of the patches removed %cathash. Some kind of silly remainder
was left in a string. Just used as a text field to explain the
filters used on borrowers_stats.pl. The filter name cathash is not
really easy and also was confusing in relation to the variable.
So just a string patch, replacing it with Patron category.
NOTE: The output of borrowers_stats.pl with the filters listed, is
not one of the most beautiful Koha screens.
Furthermore, translatibility of these filters is still an issue to
be handled on another report.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This unnecessary complicated subroutine returned an arrayref and an
hashref of the patron categories available for the logged in user, for a given
category_type, ordered by categorycode.
This can now be done with the search_limited method.
Test plan:
- Same prerequisite as before
For the following pages, you should not see patron categories limited to other
libraries. They should be ordered as before this patch, by categorycode.
- Add/edit a patron, change his/her patron category value.
- On the 3 following reports:
reports/bor_issues_top.pl
reports/borrowers_out.pl
reports/cat_issues_top.pl
The display for these 3 reports are different than the 2 from the first
patch (borrowers_stats.pl issues_avg_stats.pl): they are ordered by
categorycode and the ones limited to other libraries are not displayed
(should certainly be fixed).
Note that the big part of this patch has already been tested before
(update child related: CATCODE_MULTI).
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
C4::Members::GetBorrowercategoryList returned all the patron categories,
ordered by description.
This can be done using the search method of the Koha::Patron::Categories
module.
Test plan:
- Same prerequisite as before
For the following pages, you should not see patron categories limited to other
libraries. They should be ordered as before this patch, by description.
- On the "patron attribute types" admin page (admin/patron-attr-types.pl).
- On the "Batch patron deletion/anonymization"
(tools/cleanborrowers.pl), the dropdown list should be filled
correctly.
- On the import patron tool
- On the following report:
reports/reserves_stats.pl
Confirm that the patron categories are displayed and that the report
still works as before.
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
The C4::Category module contained only 1 method to return the patron
categories available for the logged in user.
The new method Koha::Patron::Categories->search_limited does exactly the
same thing (see tests) and must be used in place of it.
Test plan:
- Same prerequisite as before
For the following pages, you should not see patron categories limited to
other libraries.
- On the 'Item circulation alerts' admin page
(admin/item_circulation_alerts.pl), modify the settings for check-in
and checkout (NOTE: Should not we display all patron categories on
this page? If yes, it must be done in another bug report to ease
backporting it).
- Search for patrons in the admin (budget) and acquisition (order) module.
- On the patron home page (search form in the header)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This patch replaces sql queries done in some pl script and in
C4::Reports::Guided.
Since we have now a Koha::Patron::Categories module, we should use it
where it is possible.
Test plan:
- Prerequisite: Be sure you have several patron categories created, with
different option enabled, and limit some to certain libraries.
- On the 'Circulation and fine rules' admin page (admin/smart-rules.pl),
all the patron categories should be displayed (even the ones limited to
another library), ordered by description. Try to add/update existing rules.
- On the overdue rules page (tools/overduerules.pl), all the patron
categories with overduenoticerequired set should be displayed.
Try to add/update existing rules.
- On the following reports:
reports/borrowers_stats.pl
reports/issues_avg_stats.pl
The patron categories should be displayed. Note that there is an
inconsistency with these 2 reports: the patron categories limited to
other libraries are displayed on them, when they are not on the other
reports. This should certainly be fixed (on another bug report).
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
TODO: Would be better to provide a better way to know if memcache is correctly set
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
If you click the clear button to clear the search term it does take the search
term away. However, the next time you click on "Saved reports" the search term
is still there.
TO TEST:
1. Reports > Use saved
2. Filter on anything (date/author/keyword). Let say "foo" in keyword.
3. Click the Clear link on the Filter form. You can see that "foo" is removed
from keyword, and all the saved reports are displayed.
4. Click "Saved Reports" on the left. You can see that "foo" reappears in
keyword filter.
5. Apply the patch, and repeat steps 2-4.
Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This patch fixes some variable scoping problems when running
the circulation statistics wizard under Plack. For example,
when using the item type as a row header, with this patch the
item type description is displayed rather than "UKNOWN VALUE".
This patch also enables warnings and fixes a couple variable
initialization issues. (Note that turning on warnings across
the board would make it easier to identify Plack variable scoping
issues, as "Variable "$foo" is not available at' errors would
be recorded in the Plack error log).
To test
-------
[1] Run the staff interface under Plack.
[2] Go to the Circulation Statistics Wizard and run a report
using item type as the row. Note that the row labels
display as "UNKNOWN VALUE" rather than the item type.
[3] Apply the patch and restart Plack.
[4] Run step #2 again; this time, the item type descriptions should
be used as the row labels.
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
An existing 'execute' parameter is already passed to the template when
we need to display the 'Download' button, so let's use it instead of
creating a new one.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
To test:
1) Create a new SQL report or edit a report
2) Ensure that the download option does NOT show in the toolbar
3) Save and run the report
4) Confirm that download option DOES show in toolbar as a dropdown with
the 3 options (csv, tab and ods)
5) Confirm that downloading all 3 file types works as expected
Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Add option show or no inactive budget and more options
Use subroutine GetBudgetHierarchy for return all budgets
Delete subroutine GetBudgetPeriodDescription and theire tests
Use Price TT plugin
Correct name of column and capitalization the first letter
Add checkbox for show inactive budgets, default the drop down list containt a active budget
Not use [i] for inactive budgets, i add (inactive) at the end of inactive budget
Add vendor note in the list of show attribute
Test case:
Go to Home > Reports > Orders by fund
Select one or all budgets
You can show the inactive budget, default the drop down list containt a active budget
Choose output to screen ou csv file
Works as expected. QA tools OK with Bug 16104 applied.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
- changed 'Fund (budget):' back to 'Fund:', as the budget
no longer shows in the pull down.
- Fixed number of tests in Budgets.t
- Removed &GetBudgetPeriodDescription
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This patch replaces the occurrences of
my @foo = $cgi->param('foo');
with
my @foo = $cgi->multi_param('foo');
perl -p -i -e
's/^(\s*my\s*@\w+\s*=\s*)\$(cgi|input|query)\->param\(/$1\$$2\->multi_param\(/xms'
**/*.pl
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
TEST PLAN
---------
1) Ensure you have some checkouts
2) Home -> Reports
-> Patrons with the most checkouts
3) Click 'Submit'
-- you get a list
4) Click a patron name.
5) Note the borrower number.
6) In MySQL run something like:
> UPDATE borrower SET firstname=NULL WHERE borrowernumber=####
7) Refresh the report page
-- name goes totally blank
8) apply patch
9) Refresh the report page
-- only first name is lost
10) run koha qa test tools
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher <bredan@bywatersolutions.com>
TEST PLAN
---------
1) Have at least 6 patrons with checkouts and some checkins.
2) Reports -> Patrons with the most checkouts
3) Click 'Submit' (default is 5)
-- more than 5 entries listed.
4) Apply patch
5) Refresh page
-- only 5 entries listed.
6) Run koha qa test tools
NOTE: While this works, I'd be much happier with a refactor
as it would also speed up the report. See comment #5.
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
The commit b5ecefd485
Date: Mon Feb 3 18:46:00 2003 +0000
had a funny description:
Added function to check if a MARC subfield name is "koha-internal"
(instead of checking it for 'lib' and 'tag' everywhere); temporarily
added to Koha.pm
"Temporarily", since 2003, everything is relative, isn't it? :)
The thing is that GetMarcStructure returns hash like
field_200 => {
subfield_a => {
%attributes_of_subfield_a
},
%attributes_of_field_200
}
The attributes for field_200 can be 'repeatable', 'mandatory', 'tag', 'lib'.
We don't want to loop on these values when looping on subfields.
Since there are just { k => v } with v is a scalar (string), it's easier
to test if we are processing a subfield testing the reference.
At some places, we don't need to test that, we are looping on values
from MARC::Field->subfields which are always valid subfields.
Test plan:
1/ Edit items using the batch item mod tool
2/ display and edit items via the cataloguing module.
You should not see any changes between before and after the patch
applied.
Tech notes:
We need to check what we are processing when we loop on 'subfields' from
GetMarcStructure, not from MARC::Field->subfields.
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
C4::Koha::IsAuthorisedValueCategory contains only 2 useful calls, from
C4::Reports::Guided and reports/guided_reports.pl
It can be replaced with
Koha::AuthorisedValues->search({ category => $authorised_value})->count
Test plan:
1/ Create a sql report using an authorised value category, something
like:
SELECT COUNT(*) FROM items where itemlost=<<lost|LOST>>
2/ Execute the report and confirm that everything works fine.
3/ Create a sql report using a nonexistent authorised value categor,
something like:
SELECT COUNT(*) FROM items where itemlost=<<lost|NONEXIST>>
4/ When saving the report, you should get a warning message
"lost: The authorized value category (NONEXIST) you selected does not exist."
5/ Save anyway and execute the report, you should get the same warning
message.
QA:
git grep IsAuthorisedValueCategory
should not return any results
prove t/db_dependent/ReportsGuided.t
should return green
Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as described
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
The C4::Koha::AddAuthorisedValue is only called twice from
reports/guided_reports.pl and insert an authorised value.
This job can be achieve easily using the Koha::AuthorisedValue module.
Test plan:
1/ Create a new guided report
2/ Use an existing group and/or subgroup of reports
3/ Save
4/ Update an existing report
5/ Use an existing group and/or subgroup of reports
6/ Save
7/ Create or update an existing report
8/ Remove its assigned group and subgroup
9/ Save
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
Initialising $phase variable to be '' if not defined.
To test:
1) Go to Reports -> Guided Reports Wizard
2) Notice warns
3) Apply patch
4) Refresh page
5) Confirm warns are gone and page still works as it should
Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Warns are gone. Page still works as expected
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Amended patch:
-my $phase = $input->param('phase');
-$phase //= '';
+my $phase = $input->param('phase') // '';
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
1/ Do not allow invalid date ranges (from > to) (datepicker only)
2/ Relabel "From:" to "From" for consistency
3/ Fix MIME type for CSV
4/ Use Koha::DateUtils instead of C4::Dates
5/ Use placeholders in SQL query
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
Date filter indexes are 13, 14, 15, 16,
not 14, 15, 16, 17
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Works, no koha-qa errors (some message for the deleted file)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
$hasdewey and $haslccn were hardcoded to 0
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
- Add 3 options for cells value
- Titles count "COUNT (biblionumber)"
- Items count "COUNT (itemnumber)" (current behavior)
- Deleted items count "COUNT (deleteditems.itemnumber)"
- Add to selectable rows, colums and filters:
- items.notforloan
- items.materials
For each of these fields, retrieve the label in the default cataloging
framework.
If no MARC field is mapped to the field in question, it does not show
this line in the wizard.
If the MARC field is associated with a list of authorized values, it
displays a dropdown list for the filter, otherwise it displays a text
field.
- Add to selectable rows, columns and filters:
- items.dateaccessioned (creation date)
- deleteditems.timestamp (deletion date) (Only if the third option (eg
count deleted items) is selected)
- Add unit tests for GetMarcSubfieldStructureFromKohaField
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
On creating new dictionary for report, the choice between "All dates"
and "Date range" should be a real radio button, not 2 radio buttons with
different names (which means they could be selected altogether...)
Note that I don't understand what means 'All dates', there is no
condition generated for the dictionary. We should not have to select a
field if we don't want to add a condition on it :)
Test plan:
Create a new dictionary for the Patron module, then a date field
(dateenrolled or birthdate, etc.)
Confirm that the radio buttons now behave as radio buttons...
Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Looks so much nicer too!
Radio buttons display as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
This patch adds call number, collection code and shelving location to
the filter.
To test:
It is of course a prerequisite to have items in the DB with the correct
MARC fields and that they have been checked out etc. to get a valid
result when testing.
1. Apply patch to koha synced to master.
2. Go to /cgi-bin/koha/reports/cat_issues_top.pl
3. Select filters, the new ones are Call number, Collection code and
Shelving location
4. Hit submit.
Expected result:
The filters chosen will be printed under "Filtered on".
A table with the result is shown.
For manual verification here is some SQL to run:
SELECT DISTINCT biblio.title, COUNT(biblio.biblionumber) AS RANK, biblio.biblionumber AS ID, itemcallnumber as CALLNUM, ccode as CCODE, location as LOC FROM `old_issues`
LEFT JOIN items USING(itemnumber)
LEFT JOIN biblio USING(biblionumber)
LEFT JOIN biblioitems USING(biblionumber)
LEFT JOIN borrowers USING(borrowernumber)
WHERE 1 AND biblioitems.itemtype like 'BK' AND itemcallnumber like '005.2/762' AND ccode like 'NFIC' AND location like 'CART' AND borrowers.categorycode like 'PT' group by biblio.biblionumber order by RANK DESC;
Put in your valid values in the WHERE clause for the values in the
single quotes ''.
Sponsored-by: Halland county library
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
It works as described. Valid results, tested in various combinations.
Follows the coding (awful) style of the original script, without
introducing any regression. It would have been great to have
callnumber interval, but anyway...
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
To test:
- Log in to Staff Interface, go to Administration, Libraries and Groups (cgi-bin/koha/admin/branches.pl). Click 'New library' and confirm that it says 'ZIP/Postal Code:' in the form.
- Go back to Administration, Cities and towns (cgi-bin/koha/admin/cities.pl). Confirm it says 'ZIP/Postal code' in table heading. Click 'New city' and confirm it says 'ZIP/Postal code:' in form
- Go back to Administration, Global system preferences, I18L/L10N (cgi-bin/koha/admin/preferences.pl?tab=i18n_l10n). Under AddressFormat, confirm all available options say '[ZIP/Postal Code]'
- Go to Reports, Patrons (cgi-bin/koha/reports/borrowers_stats.pl). Confirm it says 'ZIP/Postal code' under Title
- Go to Tools, Batch patron modification (cgi-bin/koha/tools/modborrowers.pl), enter any card number and click 'Continue'. Confirm it says 'ZIP/Postal code' in the table of patron details, and in the form to edit
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
NOTE: Tested together with first patch.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This patch fixes following issues with breadcrumbs and html page title
in Home > Reports > Guided reports wizard:
- Sometimes, breadcrumbs display a stray > at the end
- While creating a report, steps are not displayed in breadcrumbs and
do not appear in html page title
- html page title is divided by newlines
To test:
- Apply patch
- Go to Home > Reports > Guided reports wizard
- Go to all pages including the steps for creating a new report and
verify
- that the breadcrumbs display properly and make sense
- in html source, the page title makes sense and displays on one line.
Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as descrived
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
To test:
- Create an SQL report with column names containing UTF characters
- Run the report
=> FAIL: The column names are double encoded
- Export the report
=> FAIL: The column names are double encoded in the exported file
- Apply the patch
- Re-run the report (reload works)
=> SUCCESS: Encoding correct
- Export the report
=> SUCCESS: Encoding correct
- Sign off :-D
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Fix SQL row data and headers enconding problem
To test:
-Apply patches
-Follow previous test plan
-Notice the headers and row data is displayed in UTF-8
without double encoding
-Save in Comma separated text, Tab seprated text, and Open Document.
-Verify in the three options the file exported is Ok
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
To test:
- Go to reports -> Acquisitions statistics
- Populate with the following values:
Acquisitions statistics
Received on.
Row: checked
Column: checked
From: 01/01/2015
To: Un-selected
Cell value
Count items
Output: To screen into the browser: checked
- Running the report will trigger the following error:
Software error:
Can't locate object method "field" via package "aqorders.datereceived" (perhaps you forgot to load "aqorders.datereceived"?) at /usr/share/koha/intranet/cgi-bin/reports/acquisitions_stats.pl line 293.
- Apply the patch and repeat test
- Verify the report now works correctly
Note: Patch was created from notes and suggested
fix on the bug report, written by Barton Chittenden.
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch removes stray C4::Dates from following files:
reports/borrowers_stats.pl
To test: Verify that C4::Dates is not used in the file
reports/guided_reports.pl:
To test:
- Run a saved report with date input and with date range input, e.g.
- Verify that you are asked for date range or date and that the results
are the same as without patch
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
The cache_expiry is not saved when updating a SQL report.
Test plan:
0/ Enable memcached
1/ Create a sql report
2/ Edit it and change the cache expiry value
3/ Edit again
=> The value should have been updated.
Signed-off-by: Frederic Demians <f.demians@tamil.fr>
Repeatable bug. Solved with this patch.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Remove C4::Dates from:
- reports/bor_issues_top.pl
- reports/borrowers_out.pl
- reports/cat_issues_top.pl
- reports/itemslost.pl
To test:
- Go to Home > Reports
- Verify that following reports behave as before:
- 'Patrons with the most checkouts (reports/bor_issues_top.pl)
- 'Most circulated items' (reports/cat_issues_top.pl)
- 'Patrons who haven't checked out (reports/borrowers_out.pl)
- 'Items lost'
Amended to fix issue with reports/borrowers_out.pl / see comment #3
Amended to fix issue with reports/bor_issues_top.pl / see comment #7http://bugs.koha-community.org/show_bug.cgi?id=14965
Signed-off-by: Frederic Demians <f.demians@tamil.fr>
Code OK. The 4 reports works for me as before (same results).
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This patch fixes:
- reports/bor_issues_top.pl
- sort order
- adv search and search results
- opac-topissues.pl
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
The following files use C4::Dates, but they seem no longer to be in use:
- koha-tmpl/intranet-tmpl/prog/en/modules/reports/reservereport.tt
- reports/reservereport.pl
To verify: git grep 'reservereport'
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This patch removes C4::Dates from files:
- reports/guided_reports.pl
- reports/dictionary.pl
- C4/Reports/Guided.pm
To test:
- Go to Home > Reports > Guided reports wizard
- Then go to 'View Dictionary' (menue at teh left)
- Click 'New definition' and step through
- In step 2. select e.g. borrowers
- In step 3 select a date field
- In step 4, select date range and test start / end dates
- In step 5, verify that dates display properly
- Save and verify that dates are insertet properly in sql definition
- Go back to Home > Reports > Guided reports wizard
- Step through the wizard and verify that it works as before.
http://bugs.koha-community.org/show_bug.cgi?id=14982
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Remove C4::Dates from following files:
- reports/acquisitions_stats.pl
- reports/borrowers_stats.pl
- reports/reserves_stats.pl
- reports/serials_stats.pl
- reports/issues_avg_stats.pl
- reports/issues_stats.pl
To test:
- Go to Home > Reports
- Verify that following reports work as before:
- Other > Average loan time
- Statistic wizards
- Acquisitions
- Patrons
- Circulation
- Serials
- Holds
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Happily this was only used for intranetdir.
It's time to remove it and replace existing calls.
I used the following commands to catch calls to C4::Context:
git grep 'C4::Context\->' | grep -v 'C4::Context->preference' | grep -v
'C4::Context->config' | grep -v 'C4::Context->userenv' | grep -v
'C4::Context->IsSuperLibrarian' | grep -v 'C4::Context->dbh' | grep -v
'C4::Context->set_preference' | grep -v '_syspref_cache' | grep -v
_userenv | grep -v 'C4::Context->interface' | grep -v
'C4::Context->Zconn' | grep -v 'C4::Context->queryparser' | grep -v
'C4::Context->tz' | grep -v 'C4::Context->boolean_preference' | grep -v
'C4::Context->memcached'
NOTE: I applied 14428, and then did what I suggested in comment #2.
Only intranetdir references appeared.
I applied this patch, and repeated.
Nothing appeared. This means the autoload references are
properly removed.
koha qa test tools complained about whitespace, I just fixed
those. Though, we may wish to perltidy
auth_fields_substructure.pl on another bug.
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
The regex /|date>>/ will match much more than you like :)
The unescaped pipe is bad, but you also need to remove the >> because
the split a few lines above it removes them already.
This allows you to recover from an error like this one, running another
report with a string parameter:
The given date (india%) does not match the date format (us) at
Koha/DateUtils.pm line 144.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended for possible spaces around the word date.
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
The issue is that SQL expects ISO dates, but the user may wish to view dates according to the dateformat system preference.
By detecting a date preference, the non-ISO dates can be converted to ISO dates before being stuffed back into the SQL query to be executed.
TEST PLAN
---------
1) Add a report with date parameters.
-- I used 'Holds placed in date range' from
http://wiki.koha-community.org/wiki/SQL_Reports_Library
2) Set your dateformat to YYYY-MM-DD
3) Run the report
-- Note the SQL reads
"... BETWEEN '{date formatted in YYYY-MM-DD}'..."
-- If there is supposed to be data, there is some.
4) Set your dateformat to MM/DD/YYYY
5) Run the report
-- Note the SQL reads
"... BETWEEN '{date formatted in MM/DD/YYYY}'..."
-- If there is supposed to be data, there is none.
6) Apply patch
7) Repeat steps 2-5
-- The SQL will always read YYYY-MM-DD (ISO) format.
-- The report will have data, if there is some.
8) koha qa test tools.
Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Adding a QA follow-up.
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Patch adds a 'clear' link next to the 'Apply filters' button to
empty out the form fields.
To test:
- go to the reports module
- make sure you have some saved reports
- search your saved reports using the author, keyword and date filters
- verify searching works as expected
- verify the new 'clear' link works as expected
Tested couner patch, followed test plan, works as expected. QA tools ok.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
See QA comment #5
- new reports log their Id instead of 0
- format info: <name> | <sql>
Signed-off-by: Nicole Engard <nengard@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This patch sets adds the possibility to log new, update and delete actions for saved reports.
To test:
-Apply patch
-Run updatedatabase.pl
-Enable system preference ReportsLog
-Create, duplicate, edit and delete saved reports
-Go to Home > Tools > Logs
-Verify that you can select "Reports" in Modules list
-Verify that your actions were logged
Signed-off-by: Nicole Engard <nengard@bywatersolutions.com>
Signed-off-by: Nicole Engard <nengard@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This patch removes scrolling_lists from this file
To test
1) Go to Reports > Average loan time
2) Check dropdowns Patron category, Item type, Sort1/2 and Into application
will be changed
3) Apply the patch
4) Reload and check for regression
Followed test plan. Works as expected.
Signed-off-by: Marc Veron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Remove an instance of CGI::scrolling_list from this file
To test:
1) Go to Reports, Guided report wizard, New SQL report
2) Create a report with some auth value list, e.g.
SELECT surname,firstname FROM borrowers WHERE branchcode=<<Enter patrons library|branches>>
Save
3) Clic on 'Run this report", look at the dropdown, that will be changed
4) Apply the patch
5) Reload, check dropdown and any regression
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>
To reproduce:
- Go to Home > Reports Guided reports wizard
- Create report from SQL
- Enter something like: select holdrio from borrowers
- Save SQL
- run report
Result:
Can't use an undefined value as an ARRAY reference at /usr/share/kohaclone/reports/guided_reports.pl line 932.
expected: graceful error message
- Change sql to something like: select id from holdrio;
- Save SQL
- Run report
Result:
Can't use an undefined value as an ARRAY reference at /usr/share/kohaclone/reports/guided_reports.pl line 932.
expected: graceful error message
- Change sql to something like: pling from plong
- Save SQL
Result (after saving): Message "The database returned the following error: 1"
Expected: Meaningful message "The database returned the following error: No SELECT" (similar to forbidden statements as UPDATE)
Test plan:
- Apply patch
- Try to reproduce issues above. They should be resolved.
Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
On the saved report list, the filters on the left are not displayed.
It means that some can be set, but the user has not visible feedbacks.
How filters work here:
If a user set a filter, it is saved in the session. Next time he will
come on this search, the previous values will be kept.
This patch just displayed the filter's values in the input fields.
Test plan:
Search for reports by date, author and keyword.
The filters should be displayed after you have clicked on the submit
button ("Apply filter").
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This patch propoeses the name of a saved report as part of the download file name.
To test:
- Apply patch
- Got to Home > Reports > Guided reports wizard > Saved reports (or create a new report from sql)
- Run a saved report
- Download the report (as csv, tab, ods)
Result: The downlaod file name proposed should be prepended by the report name, separated with a -
- Bonus test: Try to downlaod saved reports which have special character in their name.
NOTE: Used "ñ/â is N/A" as a report name. The /'s were translated
to underscored, but the letters were as expected.
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
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>
This patch removes the order by filter on the items lost report.
The sort can now be done by DataTables.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This patch removes all instances of CGI::scrolling_list from
reports/acquisitions_stats.pl, which prevented proper translation
To test:
1) Install and enable a language (es-ES or de-DE are good choices)
2) On Acquisitons wizard, some pulldown labels are not translated
3) Apply the patch
4) Update and install again the language
5) Check labels are translated and all pulldown works
This does not solve the 'Collection code' problem,
is more strange
Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, good improvement.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
If no caching system is up ($usecache == 0), the public parameter is
lost on the step 3.
The hash passed to the template looks like:
'cache_expiry', 300,
'cache_expiry_units',
'public', 1
So the template receives cache_expiry = 300, cache_expiry_units =
'public' and 1 = undef.
This patch fixes the problem passing the cache_expiry* parameters only
if the usecache is set.
Test plan:
0/ Disable any caching system
1/ Create a new public report and go up to the 6th step, save the report
and verify the report is created as public
2/ Enable a caching system
2/ Create a public report with a cache expiry value, save it and verify
the report is created as public and the cache expiry value is correct.
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11679 introduced a FIXME for this but it is wrong. The strings have
to be encoded before generating the ods file.
However, it is useless to decode column names.
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Dobrica Pavlinusic <dpavlin@rot13.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
To reproduce, edit, index notice with utf-8 char and search for it
Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Dobrica Pavlinusic <dpavlin@rot13.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
See the wiki page for the explanation.
Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Dobrica Pavlinusic <dpavlin@rot13.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Publication year was useless for MARC21, as it was using the
biblioitems.publicationyear (UNIMARC) instead of biblio.copyrightdate
(MARC21).
This patch tries to fix the search options to work for both MARC
flavours.
To test:
In Reports > Statistics wizards > Catalog:
- Test the publication year search options on a UNIMARC and
a MARC21 installation.
- Make sure search results make sense for both.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
The changes are fine with me, but this script is certainly not bug free.
Also note that all its SQL should be moved out according to our
coding guidelines. When doing so, a rewrite would be appropriate.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
By tweaking the GetReservedAuthorisedValues function in
C4::Reports::Guided, biblio_framework can be added as a dropdown
list into the guided reports parameters.
The change in C4/Reports/Guided.pm required a test, which is
found in t/db_dependent/ReportsGuided.t
Code was then added to reports/guided_reports.pl to build the
appropriate hash to trigger the proper dropdown list.
TEST PLAN
---------
1) Apply patch
2) prove -v t/db_dependent/ReportsGuided.t
-- all should pass, this confirms that both
C4/Reports/Guided.pm and this test file work.
3) Log into staff client
4) Reports
5) Create from SQL
6) Enter appropriate information like:
Report name: Test 13141
-- no need to change Report group or Report is public or Notes or Type
SQL:
SELECT CONCAT('<a href=\"/cgi-bin/koha/catalogue/detail.pl?biblionumber=',
biblio.biblionumber,'\">',biblio.biblionumber,'</a>') AS
BiblioNumbers, title, author, frameworkcode
FROM biblio
WHERE frameworkcode=<<Enter the frameworkcode|biblio_framework>>
7) Save report
8) Run report
-- The parameter entry page should have a drop down of
framework codes.
9) Select a framework code, and click Run the report
-- The displayed SQL should have a "frameworkcode=" portion
matching the selected framework.
10) Run the koha qa test tool.
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Test plan followed successfully.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This patch removes hardcoded descriptions and sets them in the templates
using the variable content as id.
To test, create a new guided report and verify the 'module to report on' dropdown
shows as usual [1]. Functionality shouldn't get changed.
The patch also changes the dictionary pages where 'area' should be displayed/selectable
with the same strings as the guided reports. Try all the possible disctionary pages.
The last page when creating a dictionary now shows the 'area description' instead of the
code. The same happens to the dictionary list once you have dictionaries saved.
[1] The following texts get changed:
Catalogue -> Catalog
Acquisition -> Acquisitions
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This patch makes some changes to the way filter information is displayed
after running the patrons with the most checkouts report. Before this
patch several untranslatable English strings would be displayed, and
library and item type codes would be shown instead of descriptions.
To test, go to Reports -> Patrons checking out the most. Enter values
for all the filter options:
- Checkout date from
- Checkout date to
- Checkin date from
- Checkin date to
- Library
- Item type
- Patron category
When you submit the form and view the results you should see your date
submissions formatted according to your selected dateformat system
preference. The library name and item type names should be shown instead
of codes.
Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Improves translatability of the filters output after running
the report and the readability of them (removing codes).
Note: it would be nice if the read-only would be removed from the date
fields, as forcing people to use the date widget is a known accessibility
issue.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This patch removes similar instances on 5 files, same code.
Also removes a commented one, changed in case some plan to
resurrect the code.
This bug depends on Bug 12696.
In all cases but the commented one, what was replaced
is a pulldown with one value, 'CSV'
To test:
1. Apply patch for Bug 12696
2. Apply this patch
Check for the pulldown 'Into an application'
3. Go to Reports > Statistics wizard > Borrowers
4. Go to Reports > Statistics wizard > Circulation
5. Go to Reports > Statistics wizard > Holds
6. Go to Reports > Top lists > Most-circulated items
7. Go to Reports > Inactive > Patrons who haven't checked out
8. There is also a commented code on catalogue_stats, no fuctional
changes.
Followed test plan. Patch behaves as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, passes tests and QA script.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This patch depends on Bug 12696
Removed one instance in this file.
Pulldown with one value, 'CSV'
To test:
1. Apply the patch for Bug 12696
2. Apply this patch
3. Go to Reports > Statistics wizard > Serial
4. Check 'Into an application' pulldown, with value 'CSV'
5. Search for regressions
Followed test plan. Patch behaves as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes tests and QA script, works as described.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11679 introduces an ods export for reports.
It looks quite buggy:
1/ You get a Perl error if the report has no results
2/ The ods file contains 1 lines less than the total results.
Test plan:
After applying this patch, try to export a report which has no results
and verify you get an ods file with headers only.
Try to export a report which has a least 1 result and verify the
generated ods has the right number of lines.
Signed-off-by: Robert Higgins <robert.higgins@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Fixes the reported problem, passes all tests and QA script.
Added the sign-off line for Robert.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This patch just adjusts several POD stuff, and in a few cases
reorganizes a hash definition in order to use spaces instead of tabs
for the QA script to be happy.
Nothing important, really. This patch series just changes '.tmpl' for
'.tt'.
Regards
To+
PS beware that running the koha-qa.pl script can take lots of time on this one
:-D
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Since we switched to Template Toolkit we don't need to stick with the
sufix we used for HTML::Template::Pro.
This patch changes the occurences of '.tmpl' in favour of '.tt'.
To test:
- Apply the patch
- Install koha, and verify that every page can be accesed
Regards
To+
P.S. a followup will remove the glue code.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This patch removes the use of smartmatch operators in report scripts.
Regards
To+
Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes QA script and tests.
Acquisition and Patron statistics wizard tested, no regressions found.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
To test:
[1] Verify that item record creating and editing during the
acquisitions process continues to work.
[2] Verify that calling services/itemrecorddisplay.pl without
a valid user session fails.
[3] Verify that authentication is required for making a new
order from a suggestion, transferring an order, doing a
Z39.50 search from acquisitions, displaying the record
card view in the staff interface, and running the till
reconciliation report (/cgi-bin/koha/reports/stats.screen.pl)
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Verified all changed scripts are not accessible witout a valid
user session, but are with one.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
When a user runs a report containing an SQL error, no
error is shown to the user. This patch fixes this.
To test:
1) Run a report with known good SQL.
2) No error is shown.
3) Run a report with bad SQL (eg. a typo in field name)
4) No error is shown.
5) Apply patch
6) Repeat 1-4. For the bad SQL report, the database error
should be shown.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This patch adds the ability to export the data generated by a report
into an Open Document spreadsheet file.
Test plan:
1/ Install the new dependency
2/ Verify you are able to generate an ods file from a
report result.
Tested with several reports and downloaded them as Open Document
Spreadsheet. Wors as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Verified tab and comma separated export still works correctly.
Verifid new ODS export works nicely.
Tested with data containing Arabic characters and German umlauts.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10649 introduced a new include file for adding DataTables-related
JavaScript assets. This patch adds use of this include file to all
circ-related pages which use DataTables.
Apply the patch and test the following pages to confirm that table
sorting works correctly:
- Reports -> Guided reports -> Use saved
(reports/guided_reports.pl?phase=Use saved):
"Creation date" sorting has been reconfigured to use the title-string
method for sorting on an unformatted date. C4:Reports::Guided.pm has
been modified to pass an unformatted date to the template. Sorting
should work correctly for all settings of the dateformat system pref.
- Reports -> Catalog by item type
(reports/manager.pl?report_name=itemtypes)
- Reports -> Serials statistics wizard (reports/serials_stats.pl):
The subscription begin and subscription end columns have been modified
to use the title-string filter for sorting. An unformatted date is now
passed from reports/serials_stats.pl to the template, where the
KohaDates filter is used for formatting. Sorting is based on the
unformatted date. Sorting should work correctly for all settings of
the dateformat system pref.
- Sorting of titles should now exclude article from sorting.
- Minor template improvements:
- Vendor name now links to vendor details.
- Subscription title now links to subscription details.
- Library name is now shown instead of branchcode.
Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Checked all pages, no regressions or Javascript errors detected.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 8124 has commented the option to download results items with no
checkouts report into a file. But the perl code of this page uses
the export into a file has default behavior since the input "output"
is no more present. The consequence is that there are never results
in page.
This patch removes the code concerning file output from template and perl.
Such a feature exists in guided reports.
Test plan :
Play with cgi-bin/koha/reports/catalogue_out.pl form and see if you get results
Bug 10718 - select user branch as default
In cgi-bin/koha/reports/catalogue_out.pl report, select in library filter the user logged-in.
Test plan :
- Log into intranet with a normal user
- Got to "Items with no checkouts" reports
=> Your branch is selected
- Run report
=> You see "Filtered on : Branch = <your branch>"
- Come back to report
- Select "Any library"
- Run report
=> You do not see "Filtered on : Branch"
Bug 10718 - items with no checkouts report permission is execute_reports
This report only executes SQL to change reports/catalogue_out.pl permissions from all reports subpermissions to reports/execute_reports.
Test plan :
Test you can access and run this report with only execute_reports subpermission into reports permission.
Bug 10718 - redefine limit input
In reports/catalogue_out.pl form, the limit input is by defaut none.
So by default the report queries all the catalogue.
This may take a very long time (fall into timeout) and since now the results are displayed in page, the page may be huge.
This patch modifies limit input to removes the "none" option.
Also reduces the number of options (same options as guided reports results per page).
Test plan:
- Go to reports/catalogue_out.pl
=> first value "10" is selected
- Launch report
=> You see "Filtered on: limit = 10"
Bug 10718 - perltidy on reports/catalogue_out.pl
Signed-off-by: Liz Rea <liz@catalyst.net.nz>
Tested all of these things, all ok - squashed patch for neatness.
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Fixed a tab in one of the comments.
Improves script, but more work needed.
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This patch adds the option to select multiple saved reports for
deletion.
To test you must have two or more saved reports to delete. Deletion
should work properly when:
- Selecting one report for deletion by checking the box.
- Selecting more than one report for deletion by checking boxes.
- Clicking the old "Delete" link
Clicking the delete button should prompt you to confirm. Clicking cancel
should cancel.
Clicking the delete button when no boxes are checked should trigger an
alert asking you to select reports for deletion.
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Functional tests pass, template tests pass.
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
- the dateformat value is send to all templates (from
C4::Auth::get_template_and_user)
- remove all assignment of dateformat in all .pl files
- Remove "all" occurrences (those I found!) of dateformat_*
From now the only way to get the date format is a string comparaison
(dateformat == "metric")
Checked with the command:
git grep "\(dateformat_us\|dateformat_metric\|dateformat_iso\)" | grep
-v translator
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Tested all the datepickers I could find, looks good.
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
If you create an SQL report that includes one or more parameters,
using the 'rows per page' pulldown does not work. Instead, it will
prompt for the parameters again and shows the first page of output.
Test Plan:
1) Create a new report from sql as follows:
SELECT * FROM borrowers WHERE surname LIKE <<Last Name>> AND firstname LIKE <<First Name>>
2) Run this report
3) Change the 'Rows per page' and click 'Update'
4) This should kick you back to the start where the report asks you for your parameters
5) Apply the patch
6) Repeat step 3, this time is should work correctly
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works nicely now. All tests and QA script pass.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Adds decoding for cgi params (for completeness).
Apparently, the NAME attribute of DBI statement handle has a UTF8 bug.
Fixing this by decoding the returned column names.
Did this in a shared routine.
http://bugs.koha-community.org/show_bug.cgi?id=10110
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Copying test plan from bug report:
Example SQL:
select
branchname as "Bibliothek (üöä)",
branchname "Bibiothek (üäa)",
branchname
from branches where branchcode = <<Bibliothekskürzel|branches>>
1) Create report with given example SQL or your own including
some diacritics in the columnnames
2) Save the report and run it
3) Verify column names are broken before patch, but fixed after..
All tests and QA script pass.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
A user might create a SQL report that relies on non-existent authorised value categories.
Because of a typo, or just because they copy&pasted the report from the Wiki.
Use cases are:
- The user creates a report from SQL
a) Uses bad authorised values
b) Clicks 'Save Report'
c) Koha lists the problematic authorised values
d) The user decides to
e-1) Save it anyway, it gets saved
e-2) Edit the report, it gets back to where it chose 'Save Report'
- The user edits an already saved report (Update SQL)
a) Uses bad authorised values
b) Clicks 'Update SQL'
c) Koha lists the problematic authorised values
d) The user decides to
e-1) Save it anyway, it gets saved
e-2) Edit the report, it gets back to where it chose 'Update SQL'
- The user tries to run a saved report that contains bad authorised values, Koha advertises the problem and provides the user with a button 'Edit SQL' to fix things.
To test, just create a report from SQL using invalid authorised values like this (misspelled 'branch'):
SELECT *
FROM itemtypes
WHERE hola=<<Test branch1|branchee>> AND
hola2=<<Test branch2|brancha>>
Regards
To+
Notes:
- I added several comments on the code.
- Fixed an annoying warning of uninitialised variable also (refactored some tiny bits to do it).
- Added the following methods
- C4::Reports::Guided::GetReservedAuthorisedValues
- C4::Reports::Guided::GetParametersFromSQL
- C4::Reports::Guided::IsAuthorisedValueValid
- C4::Reports::Guided::ValidateSQLParameters
- C4::Koha::IsAuthorisedValueCategory
- Those methods could have been used to refactor this guided reports code as its *a bit messy*. I chose to do it in a new bug of course :-D.
- Fixed some trivial perlcritic -5 errors
- Removed some debugging stuff left by mistake
- Fixed some POD problems
- Optimal SQL-driven IsAuthorisedValueCategory method
- Thanks to Owen and Jared for their patience heh.
Sponsored-by: Universidad Nacional de Córdoba
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Comment: Work as described. No koha-qa errors.
Test:
Tried with examples (from help and test plan) reports, correctly
identifies invalid authorized values, and no problem with
authorized ones.
NOTE: Online help for this does not states that partial values
need to be between '%' in a SQLish way. Perhaps this could be
addressed inserting % in values or adding a checkbox (partial|exact).
Or changing help.
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
branch > library
budget > fund
bookseller, supplier > vendor
and capitalization
To test:
1) Go to Reports > Acquisitions statistics
2) Check the labels and options of the form for correctness.
3) Run a few test searches to make sure functionality is
unchanged.
Unfortunately, some strings are from the .pl file, so a follow
up moving those to the templates is needed.
To make the changes consistent I have changed them in the .pl file.
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
In current implementation (mostly commented out in this patch)
uses heuristic to guess which strings need decoding from utf-8
to binary representation and doesn't support utf-8 characters
in templates and has problems with utf-8 data from database.
With this changes, Koha perl code always uses utf-8 encoding
correctly. All incomming data from database is allready
correctly marked as utf-8, and decoding of utf8 is required
only from Zebra and XSLT transfers which don't set utf-8 flag
correctly.
For output, standard perl :encoding(utf8) handler is used
so it also removes various "wide character" warnings as side-effect.
Test scenario:
1. make sure that you have utf-8 characters in your biblio
records, patrons, categories etc.
2. try to search records on intranet and opac which contain
utf-8 characters
3. install language which has utf-8 characters, e.g. uk-UA
dpavlin@koha-dev:/srv/koha/misc/translator(bug_6554) $
PERL5LIB=/srv/koha/ perl translate install uk-UA
4. switch language to uk-UA and verify that templates
display correctly
5. test search and Z39.50 search and verify that caracters
are correct
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
I followed the test plan, adding utf-8 characters to library names,
patron categories, titles, and authorized values. I tried the uk-UA
translation and everything looked good.
When performing Z39.50 searches for titles containing utf-8 characters I
got results which were still occasionally contaminated with dummy
characters [?] but I assume this is Z39.50's fault not the patch's.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Already signed, add mine.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
- Filter by groups using tabs
- Filter by subgroups using a dropdown list under each tab
- Allow to create new group and subgroups when building a new report or
editing an existing report (no need to go through admin AV interface)
+ Possibility to duplicate a report (new link in the table)
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
This follow up reinstates or add check for undef returned
by C4::Context->userenv, only where previous patch touch
code.
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
This patch replace use of CGI::scroll_list() to show list of branches.
In two files, marc21_linking_section.pl and unimarc_field_4XX.pl,
the scrolling list is created but not used in the template file,
so the code is removed.
Also minor renaming/normalizing of variables.
To test:
1) Install with some branches, records and patrons
2.1) Select a record, click 'Place hold', select user,
there is a library pull-down next to 'Pickup at:',
list is ordered case sensitive
2.2) Go to Reports > Average loan time,
next to Library is a pull-down,
list without order
2.3) Go to Reports > Catalog by item type,
next to 'Select a library' is a pull-down,
list is ordered case sensitive
2.4) This is tricky, go to Reports home,
change last part of URL 'reports-home.pl' with
'manager.pl?report_name=issues_by_borrower_category'
(can't find a direct link), next to 'Select a library'
is a library pull-down,
list without order
2.5) Edit/Add a patron, on section 'Library management'
there is a library pull-down, case sensitive
2.6) OPAC, as logged user, make a suggestion or hold,
there is library pull-down, correct order
3) Apply the patch
4.1) Repeat 2.1), correctly ordered list
4.2) Repeat 2.2), correctly ordered list
4.3) Repeat 2.3), correctly ordered list
4.4) Repeat 2.4), correctly ordered list
4.5) This is a bit more work
There are 3 possible situations to test:
A) No branches, must show a message that are no
libraries defined
B) New patron, must show a correctly ordered
list of branches, current branch selected
C) Edit patron, must show a correctly ordered
list of branches, patron branch selected
4.6) Small changes on variable names, so retest 2.6)
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
This patch adds the ability to select the number of row to show per page while
retaining the default rows per page as 20.
Test Plan:
1) Apply patch
2) Run a guided report that will have many resultant rows
3) Try the various rows per page options
4) Verify the rows per page selected is retained when paging through results
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
There are several warnings and one non-Plack-compatible variable in
reports/borrower_stats.pl.
To test:
1) Apply patch
2) Use the borrower report wizard to create a report that includes an
extended patron attribute.
3) Check the logs, and make sure that you don't see any of the
following messages:
Variable "$period" is not available at
/home/jcamins/kohaclone/reports/borrowers_stats.pl line 265.
Use of uninitialized value in hash element at
/home/jcamins/kohaclone/reports/borrowers_stats.pl line 375.
Use of uninitialized value in hash element at
/home/jcamins/kohaclone/reports/borrowers_stats.pl line 376.
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Fix bug that prevented zero values to be shown in the results.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Fixes the problem with differentiating 0 and NULL values.
Passes all tests.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Check input parameters to avoid SQL injection
Rewrite a for loop for readability
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests pass, perlcritic is unchanged.
Test plan
- Verify ExtendedPatronAttributes hides/shows new patron attribute
search criteria
- Verify patron attribute show up correctly
- pull down list for attributes linked to authorized values
- input field for other attributes
- Verify search works correctly
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
This patch allows to choose row and column amongst extended patron
attributes and to filter on them in reports/borrower_stats.pl
Signed-off-by: Marc Veron <veron@veron.ch>
Great, I was looking for such a feature.
Patch works as expected.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
- the dateformat value is send to all templates (from
C4::Auth::get_template_and_user)
- remove all assignment of dateformat in all .pl files
- the DHTMLcalendar_dateformat variable is unused
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Fixed conflicts:
- opac/sco/sco-main.pl
- reports/acquisitions_stats.pl
- tools/cleanborrowers.pl
All tests pass, perlcritic problems appeared in some files
before and after these patches were applied.
Checked sorting in following pages:
- acqui/addorderiso2709.tt - list of staged imports in acq
- acqui/histsearch.tt - sorting of dates in acq search result list
- acqui/invoices.tt - billing date in list of invoices in acq
- acqui/lateorders.tt - list of late orders in acq
- acqui/ordered.tt - ordered titles and estimated costs for a fund
- acqui/parcels.tt - receive shipment page
- acqui/spent.tt - received titles and actual costs for a fund
...
- serials-search.tt - subscription search result list
...
- opac/sco/sco-main.tt - due dates in list of checked out items
- reports/acquisitions-stats.tt - date searches, display of dates
- tools/cleanborrowers.tt
- tools.holidays.tt - different views of dates library is closed,
adding dates
Checked dates display according to system preference everywhere and
searching, entering dates etc. still worked as expected.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
- Possibility to select for line and column: items.homebranch and
items.ccode
- Possibility to filter on these fields
- Possibility to count unique biblios (count(distinct biblionumber)),
ordered amount and spent amount (based on aqorders.datereceived)
Filtering on item homebranch and ccode works only on items that were
created at ordering or receiving (ie items are linked to an order)
Some refactoring is done, mainly replacing switch-like if statements by
given/when
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
If a subscription is no longer enough published (or we are not waiting
for a new periodical) we are allowed to close it.
If a subscription is closed, we are not able to receive or generate a
new serial.
On the serial module, we can now
- close a subscriptionn
- reopen a closed subscription
On serial search 2 tabs is displayed (opened and closed subscriptions).
This patch adds:
- a new field subscription.closed in DB
- a new status for serials (8 = stopped)
Test plan:
- search subscriptions
- close a subscription and check that you cannot receive or generate a
new serial
- launch another search and check that the closed serial is into the "closed"
tab.
- You are allowed to reopen a subscription on the subscription detail
page and on the subscription result page. A javascript alert ask you
if are certain to do this operation.
- Check the serial status "stopped" everywhere the status is
displayed (catalogue/detail.pl, serials/claims.pl,
serials/serial-issues-full.pl, serials/serials-collection.pl,
serials/serials-edit.pl, serials/serials-recieve.pl,
serials/subscription-detail.pl and opac-full-serial-issues.pl)
- The report statistics does not include the closed subscriptions if you
don't check the "Include expired subscriptions" checkbox.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 8782: Followup: add some minor modifications
- Show 'closed' information in biblio detail page
- Add a column in serials report table
- Search subscriptions on title words instead of string
- Prevent serials editing when subscription is closed
- Don't change status of "disabled" serials
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 8782 - Close a subscription - Followup - Fix updatedatabase.pl
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
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: Melia Meggs <melia@test.bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and perlcritic pass.
Test plan:
1) Reports > Reports dictionary > New definition
2) Step 1: Some name
3) Step 2: Patrons
4) Step 3: First name (mediumtext)
5) Step 4: Verify 'Search string matches' is offered.
For both, surname (mediumtext) and first name (text) the program should offer you
"Search string matches" on step 4.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
The fix for Bug 7993 removed some lines from guided_reports.pl
which passed a new report's name and id to the template after
saving. For some reason this was removed, making it impossible
to run or edit a new report immediately after saving.
This patch adds back that part of the script which passes those
variables to the template. Before this patch, after adding a new
SQL report you would not see a "run this report" link. The
"run this report" and "edit" buttons in the toolbar would not
work. After applying the patch these should work.
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Tested creating reports and was able to run them after saving.
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
This should make saved reports more manageable.
Group/Subgroup hierarchy is stored in authorised_values,
categories REPORT_GROUP and REPORT_SUBGROUP, connected by
REPORT_SUBGROUP.lib_opac -> REPORT_GROUP.authorised_value
Database changes:
* authorised_values: expanded category to 16 chars
* created default set of REPORT_GROUP authorised values to match
hardcoded report areas
* reports_dictionary: replaced area int with report_area text, converted
values
* saved_sql: added report_area, report_group and report_subgroup;
report_area is not currently used, saved for the record
C4/Reports/Guided.pm:
* Replaced Area numeric values with the mnemonic codes
* get_report_areas(): returns hardcoded areas list
* created get_report_areas(): returns full hierarchy (groups with belonging
subgroups)
* save_report(): changed iterface, accepts fields hashref as input
* update_sql(): changed iterface, accepts id and fields hashref as input
* get_saved_reports():]
- join to authorised_values to pick group and subgroup name
- accept group and subgroup filter params
* get_saved_report():
- changed iterface, return record hashref
- join to authorised_values to pick group and subgroup name
* build_authorised_value_list(): new sub, moved code from
reports/guided_reports.pl
* Updated interfaces in:
cronjobs/runreport.pl, svc/report, opac/svc/report: get_saved_report()
reports/dictionary.pl: get_report_areas()
reports/guided_reports.pl
reports/guided_reports_start.tt:
* Reports list:
- added group/subgroup filter
- display area/group/subgroup for the reports
* Create report wizard:
- carry area to the end
- select group and subgroup when saving the report; group defaults to area,
useful when report groups match areas
* Update report and Create from SQL: added group/subgroup
* Amended reports/guided_reports.pl accordingly
Conflicts:
C4/Reports/Guided.pm
admin/authorised_values.pl
installer/data/mysql/kohastructure.sql
installer/data/mysql/updatedatabase.pl
koha-tmpl/intranet-tmpl/prog/en/modules/reports/dictionary.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tmpl
misc/cronjobs/runreport.pl
reports/dictionary.pl
reports/guided_reports.pl
Signed-off-by: Delaye Stephane <stephane.delaye@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
This reverts commit 215abc8024.
The 3 patches for bug 8089 have been reverted, because they break
jenkins & Koha.
A follow-up has been provided, but it does not solve the problem on my
test server, it just changes the error message.
After a discussion with jared, Dobrica should work on another patch, so
the best option is to revert.
1. Replace all instances of memoize_memcached with appropriate calls
into Koha::Cache:
* reports/guided_reports.pl
* C4::Biblio::GetMarcStructure
* C4::Languages::getFrameworkLanguages
* C4::Languages::getAllLanguages
* C4::SQLHelper::GetPrimaryKeys
* C4::SQLHelper::_get_columns
2. Replace all references to memcached with the appropriate calls into
Koha::Cache in C4::Context.
Test plan :
* have DEBUG env set to 1
* reach addbiblio page to test the patch in Biblio.pm, or setup more than 1
language
* you should see in the logs that you're reading and writing from cache
* run the test suite twice both with and without the following environment
variables set:
export MEMCACHED_SERVERS=127.0.0.1:11211
export MEMCACHED_NAMESPACE=KOHA
export CACHING_SYSTEM=memcached
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
I'm unsure about some of the caching times 10000 is a long long time,
but other than that, works fine.
Rebase of a patch originally submitted by gcollum@gmail.com
Original commit message:
Improvement on the previous patch through the use of GetBranchesLoop.
Added code so that the logged in location will be the location that
is selected by default.
Fixed a couple of minor xhtml errors.
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Changes to markup and script to enable unique ids on form
fields. These changes allow for working label+input pairs
on one or more text and select inputs and multiple working
datepickers.
To test, create a report with more than one date parameter,
at least one text parameter, and one or more authorised
value parameters. The datepickers should each work properly,
and labels should by clickable.
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
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
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>
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>
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>
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.
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>
* 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- '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>
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>
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>
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>
* 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>
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>
[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>
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>
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 <<Question to ask|authorised_value>>.
The << and >> are just delimiters. You must put << at the beginning and >> 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=<<Enter title>>" will display results with title='' (no title). If you want to have to have something not mandatory, use "title like <<Enter title>>" and enter a % at run time instead of nothing
Sample :
SELECT surname,firstname FROM borrowers WHERE branchcode=<<Enter patrons library|branches>> AND surname like <<Enter filter for patron surname (% if none)>>
This fix, just change a grep value that make different way to calculate the table depending on the choosen column and line.
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Comments out all warnings that were used for debugging.
Enables warnigns and fixes the resulting warnings.
This patch replaces the previous follow-up patch for bug 3420.
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Fixed typo in SQL statement. Commented out some unused SQL statements.
Removed limit for itemtype (column not available in results) and added limit for branchcode.
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Form - Fixes alphabetization of dropdowns.
Results - Fixes format of "Date last seen" to be the system date preference. Adds highlighting to the table.
Enables warnings. Pages generated no warnings.
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
This patch alphabetizes the descriptions that appear in the Library, Item type, and patron category drop-down lists of the Most-Circulated Items report form.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Fixes alphabetization for the item type, library and collection drop-down lists in the Checkout Statistics wizard form.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
replacing issues.itemnumber by statistics.itemnumber
since issues was not included in the query.
All statistics on circulation for item count were zeroed.
[RM note: specifically, this patch fixes the results
when you set the 'cell value' to 'count unique items']
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Added code to detect if the syspref for item-level_itypes is being used. The report now correctly returns data based on the syspref. There are some pre-existing XML errors with the FORM view of catalogue_stats.pl. I'll send a subsequent patch to deal with these.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
This patch fix 3 things:
* fix order by
* take care of item_level-itype
* use join in sql query
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
This patch add 2 columns in "Use Saved" page whith creation date, and the creator id.
It fix the creation of a report, to save the borrowernumber in reports table(to show it after).
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>