Bug 11229: (regression tests) makepayment and makepartialpayment should log correctly
This patch introduces tests for makepayment and makepartialpayment to check
they are correctly logging to the statistics table.
To test:
- Run
$ prove t/db_dependent/Accounts.t
=> FAIL: tests fail because statistics are not correctly logged.
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Tools > Export data produces a file badly encoded, when marc/xml file
format is chosen. It works with CSV.
To test:
1. Tools > Export data
2. Choose a limited interval of biblionumber
3. Export in marc/xml/csv.
4. Check files exported at 3: csv file is ok. marc/xml files are
corrupted, ie badly encoded.
5. Apply the patch
6. Repeat steps 3&4, and confirm that all file formats are valid.
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Bug 13485: Add a page to display links to restricted sites
To test:
I) Apply the patch
II) Run updatedatabase.pl
scenario I)
1) Add some content in RestrictedPageContent and RestrictedPageTitle sysprefs.
2) Add your machine ip (ex. 127.0.0)
3) Validate cgi-bin/koha/opac-proxypage.pl shows a page with RestrictedPageContent and RestrictedPageTitle contents.
scenario II)
1) Logout opac page
2) Add some content in RestrictedPageContent and RestrictedPageTitle sysprefs.
3) Add other ip that your machine ip.
4) Validate: cgi-bin/koha/opac-proxypage.pl shows a login page.
5) Validate: cgi-bin/koha/opac-proxypage.pl shows a page with RestrictedPageContent and RestrictedPageTitle contents after login.
Followed both scenarios, works as expected. Signed-off-by: Marc Veron <veron@veron.ch> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 13485 [QA Followup]
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 13485 - Atomic Update + Rename Proxy page to Restricted page
Test plan:
I) Apply the patch
II) Run updatedatabase.pl
scenario I)
1) Add some content in RestrictedPageContent and RestrictedPageTitle sysprefs.
2) Add your machine ip (ex. 127.0.0)
3) Validate cgi-bin/koha/opac-restrictedpage.pl shows a page with RestrictedPageContent and RestrictedPageTitle contents.
scenario II)
1) Logout opac page
2) Add some content in RestrictedPageContent and RestrictedPageTitle sysprefs.
3) Add a diffrent ip.
4) Validate: cgi-bin/koha/opac-restrictedpage.pl shows a login page.
5) Validate: cgi-bin/koha/opac-restrictedpage.pl shows a page with RestrictedPageContent and RestrictedPageTitle contents after login.
Kyle M Hall [Tue, 17 Mar 2015 14:09:28 +0000 (10:09 -0400)]
Bug 13853: Show waiting hold expiration date for waiting holds in holds ajax datatable
We should show the expiration date for waiting holds in the holds
datatable that appears in circulation.pl and moremember.pl
Test Plan:
1) Ensure ReservesMaxPickUpDelay is set
2) Place a hold on a record
3) Place a second hold and set it to waiting by checking it in
4) Place a third hold with an expiration date
5) View the holds tab on circulation.pl and moremember.pl
6) Note the first hold has no expiration date
7) Note the second hold has an expiration date of today + ReservesMaxPickUpDelay days
8) Note the thrid hold has an expiration date of whatever you set it to
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Cathi Wiggins <CWIGGINS@ci.arcadia.ca.us> Signed-off-by: Megan Wianecki <mwianecki@mplmain.mtpl.org> Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Kyle M Hall [Wed, 8 Oct 2014 16:04:35 +0000 (12:04 -0400)]
Bug 13030: Show waiting hold expiration date for waiting holds on circulation.pl
We should show the date a waiting hold is set to expire for each hold in
the list of waiting holds in circulation.pl
Test Plan:
1) Apply this patch
2) Find a waiting hold for a patron, browser to circulation.pl
for that patron
3) Set system preference ReservesMaxPickUpDelay to 5
4) Refresh circulation.pl, note the waiting holds now display a
"waiting until" part with the waiting date plus 5 days
5) Set system preference ReservesMaxPickUpDelay to 0 ( or empty
string )
6) Refresh circulation.pl, note the waiting hols no longer have a
"waiting until" line.
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Followed test plan successfully. Automated tests successful.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Cathi Wiggins <CWIGGINS@ci.arcadia.ca.us> Signed-off-by: Megan Wianecki <mwianecki@mplmain.mtpl.org>
Bug 13030 [QA Followup] - Fix unit tests
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Fridolin Somers [Tue, 16 Jun 2015 07:40:41 +0000 (09:40 +0200)]
Bug 11325: Focus not on "Add Item" in Lists
When viewing a list, the focus/cursor is no longer on the "add items" field below the list.
This patch moves the "Add Item" form at left part of page so that it is always shown (usefull when there are a lot of items). And adds focus to barcode input so you can enter several items with a barcode scanner.
Test instructions:
1. Create a list
2. Make sure you have an object with an assigned barcode
3. Go to the list
=> The barcode entry interface should be at left and has the focus
4. Enter the barcode and press enter (or use a scanner)
=> The item is added to the list
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
I like the new position.
Works well, focus on input box
No errors
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Marcel de Rooy [Thu, 28 May 2015 09:54:56 +0000 (11:54 +0200)]
Bug 6874: [QA Follow-up] Last adjustments for future developments
This patch does:
[1] Some trivial template changes. Modified some comments (POD lines).
[2] Converted plugin to new style.
[3] Table updates: renames id to hashvalue, adds a autoincrement id,
adds filesize, timestamp, owner and category.
RM: This db rev is in a separate sql file in atomicupdate.
[4] Code references to computed hash renamed to hashvalue instead of id.
[5] Removed some code pertaining to exposing upload dir structure. The user
now may choose a category; the uploader takes care of storage.
The list of upload categories is now taken from authorised values; this
might become a separate table in the future. (If there are none,
the upload process creates one default fallback.)
We can add e.g. permissions later, subdir structure, etc. (So dir will
not necessarily be category anymore.)
Test plan:
[1] Run the db revision.
[2] Upload new file. Check the record in the table. Delete it again; check.
[3] Run t/db../UploadedFiles.t.
[4] Run t/db../FrameworkPlugins.t -incl cataloguing/value_builder/upload.pl
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Marcel de Rooy [Wed, 27 May 2015 11:52:25 +0000 (13:52 +0200)]
Bug 6874: [QA Follow-up] Adjustments for opac-retrieve
Adds httpheaders sub to UploadedFiles; this will be extended on a new
report. (Idea is to add configurable headers for file extensions.)
Trivial unit test added.
Small cosmetic changes to opac-retrieve-file.
Test plan:
Run test UploadedFiles.t
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Mark Tompsett [Sun, 12 Apr 2015 03:57:43 +0000 (23:57 -0400)]
Bug 6874: Catch warnings for clean tests.
I hate noisy tests, so I cleaned them up.
MEGA TEST PLAN
--------------
git checkout -b bug_6874 origin/master
git bz apply 6874
-- yes, it should all apply smoothly.
I intentionally restored an old backup from a couple months ago to force the upgrade.
staff client:
-- upgrade
-- login
Koha administration
MARC Bibliographic framework
MARC structure (for BKS)
Search for 856
Subfields
Edit (for u)
Other options
Plugin: upload.pl
Save changes
Search the catalog tab
{choose a word, any word. I used fancy, because I knew we had a cookbook}
click first link
Edit
Edit record
8 (that's the tab name)
click the name for 856
scroll down to u and click the plugin icon
-- Correctly got a configuration error message.
At a command prompt:
vi ~/koha-dev/etc/koha-conf.xml
/enable_plug
-- add in:
<upload_path>{appropriate path. I used /home/mtompset/uploads}</upload_path>
:wq
mkdir {appropriate path used}
-- I even added some subdirectories
sudo chown -R -v www-data.www-data {appropriate path used}
Back in staff client:
click the plugin icon again
-- this time an upload screen pops up
click the 'Upload file' button
-- message about no file or destination
browse for a file, select one
click the 'Upload file' button
-- message about no destination
click the 'Cancel' button
click the plugin icon
click a destination radio button
click the 'Upload file' button
-- message about no file
browse for a file, select one
click the 'Upload file' button
-- message about success
click the 'close' button.
-- the text box has been filled in with a nice URL
click the plugin icon
click cancel
click the plugin icon
click delete
-- the test box should be blanked, and a success message given
click Close
-- reupload a file properly
click the plugin icon
click delete
click upload file
browse for a file, select a destination, click upload file
click close on success message
click 'Clone this subfield'
click the second plugin icon
click delete
click close
click the first plugin icon
-- Nice error message about a URL which points to nothing.
click cancel
In the second 856$u type in a URL (eg. www.google.com)
click the second plugin icon
-- this jumps immediately to the upload screen, but does not give an error message, because the URL does not have opac-retrieve-file in it.
click save (we need to save the bibliographic record)
In OPAC:
search for the same word (I used fancy)
find the entry you just updated with links
click the two links. The dangling entry should give you a 500 error, and the other link should work just fine.
get back to the detail page
In staff client:
edit
edit record
8
change the 856$u to a valid file in the first link.
save
In OPAC:
refresh the detail page, and click the first link again
this time it should get downloaded nicely.
From a command line:
prove -v t/db_dependent/UploadedFiles.t
perldoc C4::Biblio
perldoc C4::UploadedFiles
One more round of tests tomorrow, and this should be ready. :)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Tested on top of 5010
Followed mostly mega test plan, seems to work :)
Can upload, delete, modify, etc
Test runs Ok
No koha-qa errors
I view this as valuable addition, dangling since 2011!
As with 5010, I consider this can be pushed (for 3.22)
and we can fix anything wrong later.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Mark Tompsett [Thu, 17 Apr 2014 00:49:02 +0000 (20:49 -0400)]
Bug 6874: id based on contents, filename, and directory.
This patch corrects the inability to upload the same file to a
different directory, or even a renamed file to the same
directory. By including the filename and directory as part of
the $id SHA generation, only identical files in the same
directory with the same file name will generate the same $id.
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Mark Tompsett [Wed, 16 Apr 2014 04:23:40 +0000 (00:23 -0400)]
Bug 6874: Clean up file URL generation
This adds a dependency on bug 5010, in that the protocol is
assumed in the OpacBaseURL system preference. It also adds
improved error handling.
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Mark Tompsett [Tue, 15 Apr 2014 03:54:07 +0000 (23:54 -0400)]
Bug 6874: License Text Update
This updates the license text for
- C4/UploadedFiles.pm
- cataloguing/value_builder/upload.pl
- opac/opac-retrieve-file.pl
to GPL v3 as per the
http://wiki.koha-community.org/wiki/Coding_Guidelines#Licence
text.
TEST PLAN
---------
1) Don't apply this patch as part of 6874.
2) Run the koha qa test tool.
-- It will FAIL for those three file.
3) Apply this patch
4) Run the koha qa test tool.
-- License problem is corrected, no FAILs.
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Mark Tompsett [Thu, 26 Sep 2013 15:45:19 +0000 (11:45 -0400)]
Bug 6874: kohastructure.sql, jquery.js, refocus, and more
Two problems were discovered while doing a fresh install
of Koha. These problems in the kohastructure.sql file are
addressed with this patch.
Clicking the plug-in icon should cause the popup window
to refocus. This adds the refocus code to the upload.pl file.
The path to the jquery.js script was wrong in the
upload_delete_file.tt file. Changed [% themelang %] to
[% interface %].
If a user clones 856$u after uploading a file, deletes the file,
and then clicks the plugin icon on the first 856$u, this will go
immediately to the upload screen with an informative error
message.
After some validation was added, it was extended to include
other cases. This serves to patch 6874 to a state where sign
off should be possible.
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Julian Maurice [Mon, 30 Sep 2013 07:34:01 +0000 (09:34 +0200)]
Bug 6874: Force user to select a directory
This patch adds a javascript and a server-side checks
Test plan:
1/ Choose a file, leave the radios not selected and submit
2/ You have a javascript alert which prevents form to be submitted
3/ Disable javascript and repeat step 1
4/ Form is submitted but form is redisplayed with an error message
telling you to choose a directory.
Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Kyle M Hall [Wed, 25 Sep 2013 07:07:44 +0000 (09:07 +0200)]
Bug 6874: (QA followup) Attach files to bibliographic records
* Renames uploadPath to upload_path to follow the standard naming
conventions in koha-conf which use underscores rather than camel case
* Remove reference to intranet-tmpl and replace with [% interface %]
required to pass qa
Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Julian Maurice [Wed, 12 Jun 2013 13:12:51 +0000 (13:12 +0000)]
Bug 6874: Move uploadPath syspref to koha-conf.xml
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Julian Maurice [Thu, 11 Apr 2013 12:36:27 +0000 (12:36 +0000)]
Bug 6874: Add unit tests for C4::UploadedFiles
Add unit tests for C4::UploadedFiles and move a variable
declaration at subroutine level instead of file level.
Add dependency to Test::CGI::Multipart
Still works, and the newly-provided unit tests have good test
coverage:
C4/UploadedFiles.pm 90.7 65.0 66.7 100.0 100.0 0.2 86.4
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Paul Poulain [Tue, 19 Mar 2013 09:48:08 +0000 (10:48 +0100)]
Bug 6874: QA follow-up
Squash of the following commits:
return with explicit undef removed
Follow-up for PBP fixes
follow-up fix POD syntax
follow-up jquery has moved
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com> Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended: removed POD changes in Biblio.pm while rebasing. Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Julian Maurice [Wed, 18 Jul 2012 14:47:54 +0000 (16:47 +0200)]
Bug 6874: Attach files to bibliographic records
New cataloging plugin upload.pl and new system preference 'uploadPath'.
upload.pl provide a way to upload files on the server and store a link
(url) to it in MARC
uploadPath is the absolute path on the server where the files will be
stored. It's possible to have a hierarchy of directories under this path
and the plugin will allow to choose in which directory to store the
file.
Stored value in MARC subfield looks like this:
<OPACBaseURL>/cgi-bin/koha/opac-retrieve-file.pl?id=<SHA-1 of the file>
So both 'uploadPath' and 'OPACBaseURL' sysprefs have to be set for this
plugin to work correctly
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Paul Poulain <paul.poulain@biblibre.com> Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Slightly amended/simplified the patch during QA: The changes to
GetMarcUrls are not really needed, and would have needed some
attention. Another link text can be supplied by the plugin too.
This also reduces the need for changes in basket.pl,
MARCdetail.pl, detail.pl, opac-basket.pl and opac-detail.pl. Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Edit: more meaninfull commit subject
Bug 14534: Stop overdue_notices.pl from issuing the warning: Use of uninitialized value $borrowernumber
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
To test:
1/ Run the overdue_notices.pl script (don't do this on production
obviously :))
2/ Notice the warns
3/ Apply patch
4/ Run again
5/ Notice no warns, but notices are still generated ok
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Amended patch: tidy whitespaces Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Alex Arnaud [Thu, 11 Jun 2015 08:55:35 +0000 (10:55 +0200)]
Bug 13663: Fix permissions in upload-file.pl and upload-file-progress.pl
Test plan:
Verify that the circulate_remaining_permissions perm is enough to upload
.koc file.
Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Bug 14548: Typo in help file for 3.20 (batch_record_modification.tt)
Typo found in batch_record_modification.tt file for Koha help in 3.20
Test plan:
1) Go to url 'koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/batch_record_modification.tt:20' and check the typo "critera" or go to Tools › Batch record modification, open up the help
2) Apply the patch
3) Repeat step 1 and check if the typo is fixed.
Sponsored-by: Universidad de El Salvador Signed-off-by: Aleisha <aleishaamohia@hotmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Typo found in basket.tt file for Koha help in 3.20
Test plan:
1) Go to url 'koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/basket.tt:24' and check the typo "susbscription" or go to Acqusitions > create or view an existing basket, open up the help
2) Apply the patch
3) Repeat step 1 and check if the typo is fixed.
Sponsored-by: Universidad de El Salvador Signed-off-by: Aleisha <aleishaamohia@hotmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Chris Cormack [Sun, 26 Jul 2015 07:07:19 +0000 (19:07 +1200)]
Bug 7143: New developers
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Indranil Das Gupta needs to be included. Emmanuele Somma was
missed a while back, so adding ad shifting numbers for people after her.
Some tab fixes too, I don't have the time to fix them all.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Martin Renvoize [Thu, 8 May 2014 15:48:42 +0000 (15:48 +0000)]
Bug 12216: One should be able to override zebra config
One should be able to override zebra configuration on a per instance
basis. This patch adds /etc/koha/sites/instance to the 'profilePath'
in the zebra config files such that that location is sources first
for any override config files.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Great catch Martin. I thought this was already pushed by the way.
Signed-off-by: Robin Sheat <robin@catalyst.net.nz>
This will be useful. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Kyle M Hall [Tue, 30 Sep 2014 19:07:50 +0000 (15:07 -0400)]
Bug 13851: Replace waiting holds logic in circulation.pl with Koha Objects
This is the original patch for bug 12892 and replaces the older style of
fetching the holds data with Koha Objects. It will be used as a
foundation for future features.
Test Plan:
1) Apply this patch
2) Create a hold, set to waiting
3) Browse to circulation.pl for that patron
4) Note you see the list of waiting holds
5) Switch your logged in branch to a different branch
6) Note the "Waiting at" line is no longer emphasized.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Cathi Wiggins <CWIGGINS@ci.arcadia.ca.us> Signed-off-by: Megan Wianecki <mwianecki@mplmain.mtpl.org> Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Mark Tompsett [Fri, 15 May 2015 04:49:18 +0000 (00:49 -0400)]
Bug 13948: Prevent explosion when Template::Plugin::Stash not installed
TEST PLAN
---------
1) Install first two patches
2) do not install, or uninstall Template::Plugin::Stash
3) Upgrade to make sure system preference is added.
4) Set the system preference to turn it on for Staff and OPAC
5) Refresh staff -- kaboom
6) Load OPAC -- kaboom
7) Apply this patch
8) Reload staff and OPAC
-- nice HTML comment about what is wrong.
9) run koha qa test tools.
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Neat, runs well. Tested with/without sysprefs and Template::Plugin::Stash
No koha-qa errors
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Kyle M Hall [Thu, 2 Apr 2015 15:14:45 +0000 (11:14 -0400)]
Bug 13948: Add ability to dump template toolkit variables to html comment
It would be incredibly helpful if we could easily enable Koha to dump
all Template Toolkit variables to a comment for debugging purposes.
Test Plan:
1) Apply this patch
2) Run updatedatabase
3) Enable the new system preferences DumpTemplateVarsIntranet and
DumpTemplateVarsOpac
4) Load a page in the staff intranet, view the html source
5) Note the template toolkit variables are embedded in an html comment
6) Load a page in the opac, view the html source
7) Note the template toolkit variable are embedded in an html comment
NOTE: I had to cpan2deb Template::Plugin::Stash to test.
This is not optimal. Additionally:
http://www.template-toolkit.org/docs/modules/Template/Plugin/index.html
does not contain Stash. I suspect this was how it was
introduced initially by TT.
Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Marcel de Rooy [Wed, 20 May 2015 11:42:37 +0000 (13:42 +0200)]
Bug 13049: [QA Follow-up] Remove unneeded module
The call to cronlogaction is done in cleanup_database. So there is no use
in keeping the module here.
Test plan:
Run or compile (perl -c) script delete_expired_opac_registrations.pl.
Run or compile (perl -c) script delete_unverified_opac_registrations.pl.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Marcel de Rooy [Thu, 9 Oct 2014 07:52:44 +0000 (09:52 +0200)]
Bug 13049: Merge selfreg cron jobs into cleanup_database
This patch moves the core code of two selfreg cron jobs into the Members
module. The new routines are called from cleanup_database with two new
parameters. The old cron jobs are now wrappers to cleanup_database.
As a bonus, we can add a unit test now.
In time, we can obsolete the selfreg cron jobs. For now, the code is in one
place and behavior does not change.
A next step (as described on the Bugzilla report) would be: remove the Delay
pref for self regs.
Test plan:
Run the unit test t/db_dependent/Members.t.
Test the two new parameters of cleanup_database.pl.
Verify if delete_expired_opac_registrations.pl still works.
Same for delete_unverified_opac_registrations.pl.
Signed-off-by: Frederic Demians <f.demians@tamil.fr>
. Fixed minor merge confict on UT & cleanup_database.pl
. UT ok
. The two deprecated scripts still work as before, with a warning
message.
. cleanup_database.pl do the deletion job, calling new C4::Members
function rather that doing it directly.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Bug 14240: Add '(All libraries)' to notice deletion form
Trivial patch that shows (All libraries) instead of an empty cell
for notices that are applicable across all libraries.
Test plan
=========
1) Log in to staff client
2) Tools->Notices & slips
3) Add a dummy notice for all libraries
-- test code, test description, email - test subject, test content
Click Submit
4) Click Delete
-- note that the Library column value is blank.
5) Click the no option
6) Apply this patch
7) Click Delete
-- note that the Library column value is (All Libraries).
8) 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: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Bug 10961: (followup) Make query fields explicit and add regression tests
add correct frameworkcode to _koha_marc_update_bib_ids parameters
add test, prove with : prove t/db_dependent/Biblio.t
TEST PLAN
---------
1) git checkout -b bug_10961 origin/master
2) git bz apply 10961
3) git checkout origin/master -- C4/Biblio.pm
4) prove t/db_dependent/Biblio.t
-- was expecting failure, got failure.
5) git reset --hard origin/master
6) git bz apply 10961
7) prove t/db_dependent/Biblio.t
-- success as expected.
8) Read over code.
-- Noted it also grabs the framework code for the biblio, rather than uses default.
And it also corrects an indentation issue.
Test case looks like it attempts to cover the biblionumber!=biblioitemnumber case
by adding 1.
9) run koha qa test tools.
Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Kyle M Hall [Fri, 27 Sep 2013 16:53:39 +0000 (12:53 -0400)]
Bug 10961: Error in GetMarcBiblio can cause severe data loss
A bug in GetMarcBiblio can cause severe data loss if your database has
records where the biblionumber and biblioitemnumber do not match and the
script misc/batchRebuildBiblioTables.pl is run.
The Biblio::GetMarcBiblio makes a kall to
C4::Biblio::_koha_marc_update_bib_ids which passes the biblionumber as
both the biblionumber *and the biblioitemnumber*.
Thus, if your biblio and biblioitem numbers are not always equal, you
will end up with a record where the biblioitemnumber is incorrect in the
record!
This is usually not a severe issue, but since batchRebuildBiblioTables
uses that record to update the database tables, it ends up updating the
wrong biblioitem row!
NOTE: What a horrible, horrible typo that was. Tested this with the
second patch.
Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Mark Tompsett [Fri, 3 Jul 2015 22:04:04 +0000 (18:04 -0400)]
Bug 14487: Noise best detected under Debian 8
The first error is caused by the fact that
$messages->{'IsPermanent'} is undefined.
The second error is caused by querying the CGI
parameter 'barcode' inside a function call. This is not required.
There is a variable $barcode set with the parameter. Changed to
use the variable.
TEST PLAN
----------
1) Test first patch.
2) Clear the log
3) Put in a barcode which is not checked out.
4) Check the log.
-- should be two errors. One about a hash,
the other will only be detectable under Debian 8.
5) Apply this second patch
6) Clear the log
7) Put in a barcode which is not checked out.
8) Check the log.
-- should be empty.
9) run koha qa test tools
Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com> Signed-off-by: Nick Clemens <nick@quecheelibrary.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
1/ check out an item and then check it back in.
1/ check the logs after the check-in to see the warns from
returns.pl line 623 of :
(a) Use of uninitialized value $holdingBranch
(b) Use of uninitialized value $collectionBranch
2/ apply patch
3/ check out and check-in again. no warns are recorded this time.
NOTE: Under Debian Jessie, there are other messages.
Additionally, this only corrects the line 623 ones.
Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Nick Clemens <nick@quecheelibrary.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Marc Véron [Sat, 2 May 2015 05:20:22 +0000 (07:20 +0200)]
Bug 14107: Patron cards: Make barcode width and height scaling editable
The size of the barcode in patron card creator was hardcoded to 1% of the card height and 80% of the card width.
This patch exposes both values in the layout editor. If no values are given, the previousely hard coded values (0.01 / 0.8) are used in order to work with existing card definitions.
To test:
- Go to Home > Tools > Patron card creator
- Export a patron card (PDF) from en existing definition
- Apply patch
- Export patron card again, compare results (should be the same)
- Go to Home > Tools > Patron card creator > Manage card layouts
- Edit the layout you use for testing and set barcode scaling values e.g. to 0.03 for height and 0.4 for widht
- Export patron card again, verify that barcode size changed
Signed-off-by: Chris Nighswonger <cnighswonger@foundations.edu> Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Bug 14268: Followup - instruction for preftype selection
removes the now redundant instruction "Note: you should have no
reasons to modify the following default values" and replaces it
with "Note: change the variable type to one of the dropdown values
as needed"
Signed-off-by: Tadeasm <tadeas.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Mark Tompsett [Mon, 25 May 2015 19:38:36 +0000 (15:38 -0400)]
Bug 14268: Use dropdown for variable types
The information needed to build the dropdown is already passed.
This patch uses it to build the variable type dropdown correctly.
TEST PLAN
---------
1) Apply 14135
2) In the staff client:
Home -> Global system preferences -> Local use
3) Click 'Edit' on any system preference.
4) Note all the types listed.
5) Click 'Cancel'
6) Apply this patch
7) Click '+New Preference'
8) Enter data to have a decent 'Free' type preference.
9) Click 'Save'
10) For each type noted in step 4 (do 'Free' again last)
a) Click 'Edit' for the added system preference
-- it should be the last saved variable type.
b) Change the variable type to the next type.
c) Click 'Save'
d) Repeat steps (a) through (c) until all the types have
been done.
-- NOTE: Yes, there are other strange things here, but
those are beyond the scope of this bug.
11) Run koha qa test tools
Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com> Signed-off-by: Tadeasm <tadeas.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Katrin Fischer [Mon, 8 Jun 2015 02:28:50 +0000 (04:28 +0200)]
Bug 12906: Show shipment date in invoice search result list
Patch adds the shipment as a new separate column to the
search results of the invoices search.
To test:
- Search for invoices in the acquisition module
- Verify the results table shows the shipment date
- Verify that sorting works correctly
Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Mark Tompsett [Thu, 30 Apr 2015 00:52:43 +0000 (20:52 -0400)]
Bug 5685: Add missing about information
In comment #20, Katrin requested the about page be updated
to reflect the addition of a jquery plugin.
TEST PLAN
---------
1) Apply all patches
2) Log in to Staff Client
3) Home -> About Koha -> Licenses
-- jQuery Validation Plugin is now listed nicely.
4) Run koha qa test tools
License appears as expected, qa OK Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Owen Leonard [Thu, 23 Oct 2014 13:50:38 +0000 (09:50 -0400)]
Bug 5685: [OPAC follow-up] Validation of email address field
This patch makes a few changes to the way errors are handled in the
OPAC:
- The validation plugin has been moved from the global include file to
the template itself. Since we aren't doing form validation on any
other page yet it doesn't make sense to include it globally at this
time.
- The error message which appears if you have JavaScript disabled and
have submitted invalid emails was styled in a non-standard way.
- I have added in-page links to the error message which appears if you
have JavaScript disabled so that you can click to jump to the field
which contains the error.
- I have modified the error message language slightly to make it (I
hope) read better.
Signed-off-by: Nicole Engard <nengard@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Juhani Seppälä [Fri, 15 Aug 2014 09:11:17 +0000 (12:11 +0300)]
Bug 5685: Validation of email address field
This patch adds server-side & client-side validation for email
form fields in the members/memberentry -view and in the
opac/memberentry-view (bootstrap).
I recently added simple validation for phone number and email address fields
for our in-house koha and saw this old bug: I'm open to any ideas on how
to do this better. Validation for phone numbers would be easy to add on
top of this but I left it out since this bug is only about the email
fields.
To test:
1) Select a member and go to any of the edit forms with email fields
(Primary info, "Library use", "Alternate address", "Alternative
contact").
2) Disable javascript in the browser in order to test server-side
validation and try to input invalid emails in each of the email form
fields.
3) Confirm that an invalid address is catched from any of the email
fields, an alert shown for each invalid address and that the member's
information was not updated with invalid data.
4) Enable javascript in the browser.
5) Confirm that the jquery validation plugin caches invalid addresses
from any of the email fields and that you cannot send the form before
correcting the problem.
6) Perform the same tests for the opac-memberentry-view.
Note: as the jQuery validation plugin doesn't exist in the bootstrap
folder, I just copied it over from the staff-client folder -how to deal
with this?
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
I have undone the changes to opac.css so that they can be submitted as a
separate patch. I have some other follow-ups to make as well.
Signed-off-by: Nicole Engard <nengard@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
mxbeaulieu [Mon, 15 Jun 2015 15:05:51 +0000 (11:05 -0400)]
Bug 14387: Merge reference selection has no effect when merging authorities.
This patch swaps the authority records according to the refenrece record selection.
To TEST:
Merge two authority records, select the second as merge reference.
The reference authority is always the first.
Apply the patch.
Repeat previous steps, the authority is now merged using the selected reference record.
modified: authorities/merge.pl
Signed-off-by: Nick Clemens <nick@quecheelibrary.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Bug 11693: Default emailing preferences not loaded for self registering patron
The call to AddMember_Opac does not take care of the messaging prefs
when enhanced messaging is enabled.
This patch adds the call to handle_form_action to do that.
Test plan:
Enable self registering patrons and enhanced messaging.
Check the (default) message prefs for the relevant patron category. At least
enable email for one notice.
Self-register a user with and without verification email enabled.
Check in both cases that the message prefs of the user conform to
those in the patron category. (So at least one enabled.)
Followed test plan, works as expected. Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Jonathan Druart [Mon, 13 Apr 2015 08:12:03 +0000 (10:12 +0200)]
Bug 8684: Add regression tests for SearchItemsByField
Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Jonathan Druart [Tue, 7 Apr 2015 12:14:18 +0000 (14:14 +0200)]
Bug 8684: Fix duplicate check on creating items in the acquisition module
The script acqui/check_uniqueness.pl has been introduced by bug 7178.
But bug 11425 added a call to a new subroutine SearchItemsByField in
order to refactore some code. This subroutine calls SearchItems with an
arrayref, which is not what SearchItems is expecting.
This broke the duplicate check done on creating items in the acquisition
module.
To reproduce the issue:
1/ Fill the pref UniqueItemFields with "barcode" and AcqCreateItem with
"placing an order"
2/ Create a new basket
3/ Create a new order
4/ Close the basket
5/ Receive items and set barcode with one already in your DB
6/ Save
7/ Nothing happen on the interface, but an error should have been added
in your Koha log file:
Can't use an undefined value as an ARRAY reference at
/home/koha/src/acqui/check_uniqueness.pl line 48.
Test plan:
1/ Repeat steps 1-6
2/ You should see a warning on the interface
Note that this should also happen with AcqCreateItem set to "creating an
order".
Works well, no errors.
Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Jacek Ablewicz [Wed, 24 Jun 2015 17:43:05 +0000 (19:43 +0200)]
Bug 14456: EmbedSeeFromHeadings record filter shouldn't process MARC holding fields
If the system preference IncludeSeeFromInSearches is enabled, records
exported for zebra indexing are being additionally processed by
EmbedSeeFromHeadings record filter (right now used only in rebuild_zebra.pl
script). This filter embeds 'see from' fields (extracted from authority
records linked with the given biblio via $9 subfields) into target MARC
record, which is then subsequently indexed in zebra.
Currently all fields containing $9 are getting the same exact treatment
by this filter. But on the export stage when the filter is applied, MARC
record being processed already does have holdings data fields added in
the previous stage (usually 952 / 995, depending on the MARC format).
Problem is that holdings data fields use to have $9 subfields in them
as well (mapped to item.itemnumber by default). As a consequence, some
(great many in the typical setup) records exported for zebra indexing
may have surplus "see from" fields added erroneously in semi-random
fashion, so biblio searches would often return some completely
unexpected additional results.
EmbedSeeFromHeadings record filter should not process holdings fields
when dealing with MARC records intended for zebra indexing.
To reproduce:
1) database with as many sample or real-world biblio, item and authority
records as possible is recommended for testing purposes
2) enable IncludeSeeFromInSearches
3) export a bunch of biblio records for zebra (e.g.:
misc/migration_tools/rebuild_zebra.pl -I -b -x -k -length=1000),
inspect the result xml records in /tmp/<whatever> file; observe that at
the end of many records, here and there some extra "see from" (= 1st
indicator: 'z') fields tend to appear, which shouldn't be there ;)
To test:
4) apply patch
5) redo 3)
6) compare results from 3) and 5) with diff
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
I introduced a regression test for this. You should run the tests
without/with the patch and verify that the patch actually fixes the problem.
Good job Jacek! I'm sure writing the regression test would take less time
than such a detailed commit message!
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Bug 14456: (regression test) Holdings fields should be skipped by EmbedSeeFromHeadings
This patch introduces a regression test for the situation in which
an itemnumber on a record matches the authid of an authority record
and the current implementation of the EmbedSeeFromHeadings filter
wrongly includes new holding fields with authority data...
To test:
- Apply the patch
- Run:
$ prove t/db_dependent/RecordProcessor_EmbedSeeFromHeadings.t
=> FAIL: The test 'Holdings fields not processed to introduce See-from heading'
fails.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Bug 14545: Typo in help file (stage-marc-import.tt)
Typo found in stage-marc-import.tt file for Koha help in 3.20
Test plan:
1) Go to url 'koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/stage-marc-import.tt:28' and check the typo "precendence" or go to Tools > Stage MARC records for import and open up the help
2) Apply the patch
3) Repeat step 1 and check if the typo is fixed.
Sponsored-by: Universidad de El Salvador 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@theke.io>
Marcel de Rooy [Fri, 26 Jun 2015 12:12:20 +0000 (14:12 +0200)]
Bug 14167: (QA followup) Making Koha::Logger bit more crash resistant
Moving the BEGIN block to _init for the most part. We only need to
initialize when we actually start using the logger.
Removed the third init part. If we do not have a log4perl_conf in the
koha config, we are not using it yet.
Method get uses hash parameters now. It calls init. If we do not have a
config or the logfile is not writable, we will not use log4perl.
Using AUTOLOAD as a wrapper around Log4perl in order to add some checks
that log4perl does not have.
If a logrotate would change file permissions on a default logfile, we
should catch that now too (see recheck).
Test plan:
Run the previous tests again.
Will still add a unit test.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Kyle M Hall [Thu, 14 May 2015 11:04:19 +0000 (07:04 -0400)]
Bug 14167: (QA followup) Add template and changes needed for packages
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended: upgraded DEBUG level to WARN in config file. Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Marcel de Rooy [Fri, 5 Jun 2015 08:08:22 +0000 (10:08 +0200)]
Bug 14167: (QA followup) Adjust category handling in Koha::Logger
The first patch makes the category parameter mandatory.
This patch makes it optional, falling back to the current package. This is
the expected log4perl model. It would not be necessary to pass the class
name everywhere (check subclasses..)
It also adds a delimiter between the interface and the class name.
The first line would make the logger more sensitive to C4::Auth log
messages while staying at the WARN level for other messages, etc. The
second line makes the trace visible from the renewal example.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Kyle M Hall [Thu, 7 May 2015 15:20:50 +0000 (11:20 -0400)]
Bug 14167: Add Koha::Logger based on Log4perl
Koha needs a better logger, and it seems like the best solution would be
to take advantage of Log4perl which is already a fully featured logger.
We use Log4perl to selectively decide what statements should be logged,
and where they should go!
Test plan:
0) Install Log::Log4perl via packages or cpan
1) Apply this patch and the example renewal patch
2) Copy etc/log4perl.conf to your koha conf directory, edit the paths
to match your current error logs
3) Edit your koha-conf file and add the
<log4perl_conf>/path/to/log4perl.conf</log4perl_conf> line
4) Watch your intranet and opac error logs
5) Perform a renewal via the staff interface, note there is nothing new
in the log file
7) Update the log4perl.conf, change the log level from WARN to TRACE
for both the staff and opac sides
8) Perform a renewal via the staff interface, note the logged lines
9) Perform a renewal via the opac, note the logged lines
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended this patch: Moved the renewal stuff to a separate example patch.
And upgraded the DEBUG level to WARN in the log4perl config file. Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
adds alphabetical sorting to <select> lists displayed by
preferences.tt. although added for sorting the days of the
week, this may have larger ramifications. haven't been
tested thoroughly, but no apparent breakage seems to be
happening in preferences.
NOTE: Nice tweak. Makes days of week in sensible order.
Properly adds sorting based on documentation that
is really hard to find.
Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Mark Tompsett [Thu, 24 Apr 2014 23:09:31 +0000 (19:09 -0400)]
Bug 12137: Extend CalendarFirstDayOfWeek to be any day
Mubassir Ahsan asked on the Koha mailing list:
Is there any option to set Saturday as the first day of
the week? Please help me.
CalendarFirstDayOfWeek is currently either Sunday|Monday.
By converting it to 0|1|2|3|4|5|6
(Sunday, Monday, ..., Saturday), we can allow any day of the
week to be the first day of the week in the date picker.
TEST PLAN
---------
1) Backup DB
2) In mysql:
> DELETE FROM systempreferences;
> SOURCE .../installer/data/mysql/sysprefs.sql
> SELECT variable,value FROM systempreferences;
-- It should say 'CalendarFirstDayOfWeek' and '0'
May say '1' if you are using Norwegian.
3) Restore your DB
4) .../installer/data/mysql/updatedatabase.pl
-- If your previous value for 'CalendarFirstDayOfWeek' was
'Sunday', it should be '0'. For 'Monday', it should be '1'.
5) Test an installation with 'de-DE' as the language.
-- The default value should be '1'.
6) Test an installation with 'nb-NO' as the language.
-- The default value should be '1'.
7) In the staff client, confirm that any day of the week is
available in the I18N/L10N system preferences for the
CalendarFirstDayOfWeek dropdown.
-- I'm aware they aren't in order, but I'm after
functionality, not finesse.
8) In another tab, go to a staff place that has a datepicker.
For example, Home -> Tools -> Inventory/stocktaking
9) For each possible value in the CalendarFirstDayOfWeek,
go to the other tab, refresh the page after updating the
system preference, and click the datepicker icon.
-- The date picker should then start on the selected
day of the week.
10) Log into OPAC
-- This may require setting: opacuserlogin to 'Allow'.
11) Click the personal details tab on the left.
12) There is a date picker for the date of birth.
-- The date picker should then start on the selected
day of the week.
13) Run koha QA test tools.
NOTE: not an atomic update, since this is an old patch.
Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Jonathan Druart [Tue, 28 Apr 2015 08:10:56 +0000 (10:10 +0200)]
Bug 12054: Inactive vendors should be inactive
This patch make inactive vendors really inactive.
That means an inactive vendor would not be able to add a basket / add an order.
Revised test plan
=================
1/ In the acquisition module create 2 vendors: 1 active and 1 inactive.
2/ On the acqui/booksellers.pl, acqui/uncertainprice.pl,
admin/aqcontract.pl and acqui/supplier.pl (pages which include the
acq toolbar), you should be able to, for both the 'active' as well
as the inactive vendor :
(a) add new basket
(b) add order items to the basket
Remark: This is *wrong*. You should be able to do so only for active
vendor.
3/ Apply the patch
4/ Go to the links in step #2 above and select the inactive vendor
you should no longer be able to:
(a) add new basket
(b) add order items to the basket
Remark: This is the *correct* behaviour
5/ No change should be noted for vendor marked "active", and should
be able to undertake operations 4 (a), 4 (b) and 4 (c).
Remark: This is the *correct* behaviour.
6/ run koha qa tests tool
Bug 12054: (follow-up) Inactive vendors should be inactive
Don't display "add order""block and buttons if the vendor is inactive.
Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Kyle M Hall [Tue, 16 Jun 2015 23:05:10 +0000 (19:05 -0400)]
Bug 14404: Checkouts default sort order for Self Checkout (SCO) confusing for patrons
Libraries are reporting that patrons are very confused during
self-checkout. The problem is they are expecting the list of checkouts
to be in the order they checked out the items ( first checkout on the
bottom, last item checked out on top ). However, the checkouts
table is sorted by title ( ascending ) then due date ( descending ).
This is not intuitive.
Test Plan:
1) Enable Koha's self checkout
2) Use the SCO to check out a random assortment of items,
make sure you don't check them out in alphabetical order
3) Note the order of the items in the list is not based on the order
you checked them out in
4) Apply this patch
5) Refresh the page
6) Note the items are now in the order you checked them out
with the last on top and the first on bottom
Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
When creating a new notice, warn is triggered "Argument "" isn't numeric in numeric gt (>) at line 400". Same warn is triggered when changing Koha module option to any other module.
To test:
1) Go to Tools, then Notices & Slips
2) Click 'new notice'. Notice warn in intranet-error.log
3) Change Koha module to another module. Notice warn is triggered for every change
4) Apply patch and reload page
5) Change Koha module to another module. Notice there are no longer warns
6) Go back to Notices & Slips and click 'new notice' again. Notice there are no warns
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Aleisha [Wed, 24 Jun 2015 01:15:32 +0000 (01:15 +0000)]
Bug 14445: Silences warn in letter.pl
When changing Koha module to 'Circulation', there is a warn saying that $code is uninitialized. This patch sets $code to an empty string to silence the warn.
To test:
1) Go to Tools, the Notices & Slips
2) Click 'new notice' (This will trigger warns, but ignore these as they will be corrected in the next patch)
3) Change Koha module to 'Circulation'
4) Notice warn about uninitialized $code variable
5) Apply patch and reload page, change Koha module to 'Circulation'
6) Notice page still works and warns are gone
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
TEST PLAN
---------
1) $ prove t/db_dependent/Auth_with_cas.t
-- CGI security warning
2) apply patch
3) $ prove t/db_dependent/Auth_with_cas.t
-- no noise.
4) koha qa test tools
Signed-off-by: Nick Clemens <nick@quecheelibrary.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Not able to reproduce the error on my setup, but the code
is a clear improvement over the previous version. Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Katrin Fischer [Mon, 25 May 2015 11:58:57 +0000 (13:58 +0200)]
Bug 11620: Add dissertation-information index for MARC21 (502)
Bug 11202 introduced a new index 'dissertation-information' for
UNIMARC. This patch adds the index also for MARC21 installations.
http://www.loc.gov/marc/bibliographic/bd502.html
To test:
- Apply patch
- Copy files in etc/zebradb changed by this patch to your
corresponding directory (koha-dev..)
- Make sure you have records with 502
- Reindex
- Verify you can search the field contents with
dissertation-information= and
diss=
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Can find by dissertation-information,
No errors
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Katrin Fischer [Tue, 9 Jun 2015 23:43:22 +0000 (01:43 +0200)]
Bug 12352: Patron modification request page: Add link to patron record
The patron modification request page in the staff client does show
the name and home library of a patron, but there is no way to
go to the patron record. This patch adds a link to the patron details.
Extras: changes display of patron name, so a missing firstname won't
result in an extra , showing.
To test:
- Make some update requests from different patron accounts in the OPAC
- Go to the patron modification request page in staff
- Verify a link 'Patron details' now shows on each entry and
works correctly
Followed test plan. Works as expected. QA tools OK. Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Not sure the "Patron details" link is at the best place, but I don't
have something better to suggest. Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Jonathan Druart [Mon, 13 Jul 2015 14:44:23 +0000 (15:44 +0100)]
Bug 14524: Don't escape query_cgi with uri
According to the doc, we should not escape query_cgi with the uri
filter:
http://www.template-toolkit.org/docs/manual/Filters.html#section_uri
Since query_cgi can contains something like: "idx=kw&q=42", we should
not escape the & char
Test plan:
0/ Don't apply the patch
1/ Go on launch a search at the OPAC
2/ Click on the RSS icon
3/ You should arrive on
opac-search.pl?idx%3Dkw%26q%3D42&count=50&sort_by=acqdate_dsc&format=rss2
The & has been escaped.
4/ Apply the patch
5/ Now you should get result and see an url correctly formatted.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Bug 14494: Add some unit tests too for CalcDateDue
The second patch of this report made some changes to CalcDateDue.
We are adding some unit tests here.
See the commments on the third patch too.
Test plan:
Run t/db_dependent/Circulation_dateexpiry.t
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Amended patch: Set the number of tests for the second subtest (was
commented) and perltidy the second block.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Jonathan Druart [Thu, 9 Jul 2015 08:52:28 +0000 (09:52 +0100)]
Bug 14494: Unit tests for CanBookBeIssued related to dateexpiry
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Moved the test on its own. Nicer than adding TestBuilder in the final part
of the test. No warnings/errors from TestBuilder, no dependency..
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Bug 14494: Terribly slow checkout caused by DateTime->new in far future
An expiry date like 9999-12-31 in the local timezone will make DateTime
spend a lot of time (maybe 60 seconds) on date calculation. See the
DateTime documention on CPAN.
A calculation in floating (or alternatively in UTC) would only take
a few milliseconds.
This patch makes two changes in this regard:
[1] The compare between expiry date and today in CanBookBeIssued has been
adjusted in Jonathan's patch. I am moving the compare to the floating
timezone (as was done in my original patch). This removes a hardcoded
9999.
[2] If ReturnBeforeExpiry is enabled, CalcDateDue compares the normal due
date with the expiry date. The comparison is now done in the floating
timezone. If the expiry date is before the due date, it is
returned in the user context's timezone.
NOTE: The calls to set_time_zone moving to or from floating do not adjust
the local time.
TEST PLAN:
First without this patch (and the one from Jonathan):
[1] Set expiry date to 9999-12-31 for a patron.
[2] Enable ReturnBeforeExpiry.
[3] Checkout a book to this patron. This will be (very) slow.
Continue now with this patch applied:
[4] Check in the same book.
[5] Check it out again. Should be much faster.
Bonus test:
[6] Set borrower expiry date to today. Change relevant circulation rule
to loan period of 21 hours. Test checking out with a manual due date
/time just before today 23:59 and after that. In the second case the
due date/time should become today 23:59 (note that 23:59 is not
shown on the checkout form).
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Jonathan Druart [Thu, 9 Jul 2015 08:52:28 +0000 (09:52 +0100)]
Bug 14494: Prevent slow checkout if the patron does not have an expiry date
If a patron has a expiry date set to 9999-12-31 (for organizations for
instance), the checkouts are very slow.
It's caused by 2 different calls to DateTime in CanBookBeIssued:
1/
DateTime->new( year => 9999, month => 12, day => 31, time_zone => C4::Context->tz );
The time_zone should not be set (as it's done in Koha::DateUtils), set to UTC or floating tz.
2/
DateTime->compare($today, $expiry_dt)
The comparaison of 2 DT with 1 related to 9999 is very slow, as you can
imagine.
For 1/ we need to call Koha::DateUtils::dt_from_string (actually, we
should never call DateTime directly).
For 2/ we just need to test if the date is != 9999, no need to compare
it in this case.
Test plan:
Before this patch, confirm that the checkouts are slow if the patron has a
dateexpiry set to 9999-12-31.
update borrowers set dateexpiry="9999-12-31" where borrowernumber=42;
After this patch, you should not see any regression when checking out
items to an expired patron and to a valid patron.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
David Cook [Mon, 13 Jul 2015 04:06:46 +0000 (14:06 +1000)]
Bug 14521: SQL injection in local use system preferences
This patch fixes a SQL injection vulnerability in the local use
system preferences.
_TEST PLAN_
Before applying:
1) Go to Global System Preferences
2) Click on the "Local use" tab
3) Add a new preference with the value "') or '1' = '1' -- "
(be sure to include the space at the end after the comment --).
4) When the page refreshes, you should now see about 99 other system
preferences which shouldn't be showing up.
5) Apply the patch
6) Refresh the page
7) Note that you now only see a system preference for "') or '1' = '1' -- "
and the other actual local use system preferences.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Bug 14436: Noisy warns in C4/Utils/DataTables/Members.pm
TEST PLAN
---------
1) Backup the koha intranet error log.
2) Empty the koha intranet error log.
3) In staff client, go to Patrons
(/cgi-bin/koha/members/members-home.pl)
4) Pick any letter to 'Browse by last name'
-- koha intranet error log now has warns.
-- the one of importance is the uninitalized value.
5) Empty the koha intranet error log.
6) apply this patch
7) Repeat steps 3 & 4.
-- koha intranet error log does not contain the
uninitialized value error.
8) run koha qa test tools.
Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
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>
Jonathan Druart [Wed, 24 Jun 2015 09:24:14 +0000 (11:24 +0200)]
Bug 14449: Add authentication check on retrieving item info when receiving
The script catalogue/getitem-ajax.pl is called by acqui/orderreceive.pl
when item is receipt.
There is not auth check done, this means anybody can retrieve item info.
Test plan:
With the acquisition => order_receive permission, try to receive an
item.
It should work.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Very easy to test.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>