Commit graph

1106 commits

Author SHA1 Message Date
8d40fd2c6e Bug 17216: Internal AV should be correctly handled when creating a new category
Signed-off-by: Katrin Fischer  <katrin.fischer@bsz-bw.de>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
2016-10-11 07:30:32 +00:00
5d0dbcaabe Bug 17216: Do no display the empty string category name
Signed-off-by: Katrin Fischer  <katrin.fischer@bsz-bw.de>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
2016-10-11 07:30:32 +00:00
610dbfb5dd Bug 17216: Do not display branches, itemtypes and cn_source
Signed-off-by: Katrin Fischer  <katrin.fischer@bsz-bw.de>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
2016-10-11 07:30:32 +00:00
62aa3f4292 Bug 17216: Use Koha::AVC from mss.pl
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer  <katrin.fischer@bsz-bw.de>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
2016-10-11 07:30:31 +00:00
f97249f56e Bug 17216: Update the admin interface
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer  <katrin.fischer@bsz-bw.de>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
2016-10-11 07:30:30 +00:00
bc41b29b64 Bug 14899: Add a reset option
For developpers only at the moment, if you want to reset your mappings,
you can hit:
  admin/searchengine/elasticsearch/mappings.pl?op=reset&i_know_what_i_am_doing=1

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
2016-10-11 05:22:00 +00:00
39bdb865fc Bug 14899: Add the mapping configuration page in the admin module
This new page (admin/searchengine/elasticsearch/mappings.pl) will permit
to manage the ES mappings.
For the biblios and authorities indexes, the different mappings can be
managed from this single page.
The interface let you add, remove and update mappings and search fields.
It's also possible to reorder the mappings, as the order can be important
in the indexation process. Note that the table can be displayed in a
different order that the one it was before saving, but the mappings are grouped
by search field and the order inside the search field is preserved.

Limitations:
- If something went wrong during the insertion/deletion/modification,
  the users will loose all these changes.

TODO:
- Add a specific permission (?)
- Add some data checks client side (JS)
- Use checkboxes for facet and suggestible (lazy today...)
- Understand the difference between the 3 values that sortable can have
  and improve the value for the options in the select box.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
2016-10-11 05:22:00 +00:00
99bdb7edbd Bug 15975 - Add Owning Library Column to Checkouts
To test:
1 - Checkout some items to a patron
2 - Note there is no 'Home library' column
3 - Apply patch
4 - Note there IS an 'Home library' column
5 - Use the columns configuration and ensure you can hide/display column at
will

Sponsored by: Coeur d'Alene Public Library (http://www.cdalibrary.org/)

Works as expected (after clearing browser cache).
Commit message amended (as of comment #7)
Signed-off-by: Marc <veron@veron.ch>

Signed-off-by: Katrin Fischer  <katrin.fischer@bsz-bw.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-25 15:41:36 +00:00
Marc Véron
a055abe7c0 Bug 17144: Fix variable scope issues in edi_account.pl
To reproduce:
- In Staff client, go to Administration > EDI accounts
- Click "+ New account"
Result: Internal Server Error
Plack error log says:
Can't call method "param" on an undefined value at /home/marc/koha/admin/edi_accounts.pl line 157

To test:
-Apply patch
- Add an EDI account
- Edit an EDI account
- Delete an EDI account

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Katrin Fischer  <katrin.fischer@bsz-bw.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-25 13:18:14 +00:00
Andreas Roussos
69cbea8e0c Bug 17308 - 'New patron attribute type' button does not work
In the Staff client, the 'New patron attribute type' button in the Patron
attribute types page does not work. This patch fixes that.

Test plan:
1) In the Staff client, go to Home > Administration > Patron attribute types,
   and click on the 'New patron attribute type' button. You cannot create a
   new patron attribute type and you get the following Software error:
   Not a HASH reference at [...]
2) Apply the patch.
3) Repeat step 1). The 'New patron attribute type' button now works.

Followed test plan, works as expected.
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>
2016-09-25 13:09:49 +00:00
259679e9de Bug 17281 Warning when saving subfield structure
TO TEST:

1. Home > MARC Framework > Default > Actions > MARC structure
2. On 073 field (for example), click Edit
3. Click on Edit subfield button
4. Click on Save changes
5. Take a look in intranet logs. You find:
   Use of uninitialized value in string eq at
   ../admin/marc_subfields_structure.pl
6. Apply the patch, and repeat steps 3-5
   => no more warning in log

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer  <katrin.fischer@bsz-bw.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-12 09:12:29 +00:00
453e8e7235 Bug 16908: Koha::Patrons - Remove GetSortDetails
This subroutine was only used in one script and its job is the same as
GetAuthorisedValueByCode.
It's better to use the AuthorisedValues TT plugin to retrieve AV
descriptions.

Test plan:
Edit a patron with sort1 and/or sort2 defined.
On the patron details page (members/moremember.pl) you should see the
sort1 and/or sort2 info displayed.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-09 13:12:28 +00:00
a3a1ec57aa Bug 16586: Koha Plugins: Limit results of GetPlugins by metadata
It would be helpful if we could find a plugin based on some metadata
tag as returned by the plugin. This extends the use of GetPlugins that
already supports searching on method.

GetPlugins is used in: admin/edi_accounts.pl, plugins/plugins-home.pl and
tools/stage-marc-import.pl. The changes in these three scripts are
minimal and just related to parameter passing.

Test t/db_dependent/Plugins.t includes another test for GetPlugins. In this
regard a metadata tag has been added to t/Koha/Plugins/Test.pm.

NOTE: This adjustment will also be used in a redesign for bug 15545.

Test plan:
Run t/db_dependent/Plugins.t.
Enable pref UseKohaPlugins and config var enable_plugins.
Go to plugins-home.pl. Verify that it still lists your plugins.
Bonus: Check edi_accounts or stage-marc-import.pl if you have a working
plugin for that.

Signed-off-by: Liz Rea <liz@catalyst.net.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-09 12:13:39 +00:00
c840c93835 Bug 15758: Koha::Libraries - Ultimate duel for C4::Branch
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-08 14:36:04 +00:00
6b95cb48b3 Bug 15758: Koha::Libraries - Move onlymine to C4::Context::only_my_library
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-08 14:36:04 +00:00
df97814f30 Bug 15758: Koha::Libraries - Remove GetBranches
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-08 14:36:03 +00:00
79f4afe26a Bug 15758: Koha::Libraries - Move mybranch to C4::Context
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-08 14:36:03 +00:00
9b9803b69c Bug 15758: Koha::Libraries - Remove GetBranchesLoop
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-08 14:36:02 +00:00
19a977dc7b Bug 15758: Koha::Libraries - Remove GetBranchName
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>
2016-09-08 14:36:01 +00:00
9b8b18151d Bug 15407: Uniformise calls in patron-attr-types
Does not make sense to call first in list context and later in scalar
context.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-08 13:29:23 +00:00
6239bbd35f Bug 15407: Koha::Patron::Categories - replace GetBorrowercategoryList
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>
2016-09-08 13:29:22 +00:00
6ee8dd3a59 Bug 15407: Koha::Patron::Categories - replace C4::Category->all
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>
2016-09-08 13:29:03 +00:00
3bb1578354 Bug 15407: Koha::Patron::Categories - remove sql queries in some pl and pm
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>
2016-09-08 13:29:03 +00:00
Aleisha Amohia
705097f938 Bug 16035: MARC default bibliographic framework Export fix
This patch makes sure that, if there is no framework code,
     $frameworkcode is set to 'default'. This fixes the format issue.
     Then, if $frameworkcode = default, an empty string (rather than
     null) is passed to the ExportFramework method, as the framework
     code in the DB for default codes is "".

To test:
1) Go to Admin -> MARC Bibliographic framework
2) Try to export default framework in all formats, notice the file is
only exported as .ods and is an empty file. Notice warns in intranet
error log.
3) Apply patch and refresh page
4) Confirm exporting default framework works in all formats and
spreadsheet has data
5) Notice warns in error log are gone
6) Confirm export still works for other frameworks

Sponsored-by: Catalyst IT

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-08 12:07:55 +00:00
658f603511 Bug 17189: Replace occurrences of 'use Koha::Cache'
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

https://bugs.koha-community.org/show_bug.cgi?id=11921

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-08 10:24:47 +00:00
f753220701 Bug 17189: Add the ability to define several memcached namespaces - replace existing occurrences
s/Koha::Cache->get_instance/Koha::Caches->get_instance

Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

https://bugs.koha-community.org/show_bug.cgi?id=11921

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-08 10:24:46 +00:00
24740fb2fa Bug 14695 - Add new circulation rule
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jason M. Burds <JBurds@dubuque.lib.ia.us>
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
2016-09-03 00:17:56 +00:00
739eaa82e8 Bug 17009: Speed up the framework duplication
To duplicate frameworks, the code retrieve all the subfields, then
execute 1 insert per subfield.
It's unnecessary slow, we can use the DBMS to do it.

Test plan:
Create a new framework and duplicate the structure of another framework.

Signed-off-by: Marc <veron@veron.ch>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-08-18 16:01:53 +00:00
84812129c9 Bug 16955: Do not clear from cache when adding a new framework
There are several issues with these lines:
1/ $cache is not defined correctly and it not visible inside
duplicate_framework
2/ $frameworkcode is a wrong c/p, it should be $newframeworkcode
3/ these calls are not needed. As we are creating a new framework, the cache
should be empty...

This patch will simply remove these calls

Test plan:
Duplicate a framework and confirm that you do not get any error in your
logs.

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-08-18 15:48:52 +00:00
Alex Sassmannshausen
6a493842cf Bug 6906 - show 'Borrower has previously issued...
New feature: provide granular means to configure warnings about items
that have been issued to a particular borrower before, according to
their checkout history.

- Global syspref ('CheckPrevCheckout'), set to 'hardno' by default,
  allows users to enable this feature library wide.
- Per patron category pref allows libraries to create overrides per
  category, falling back on the global setting by default.
- Per patron pref allows switching the functionality on at the level
  of patron. Fall-back to category settings by default.

* Koha/Patron (wantsCheckPrevCheckout, doCheckPrevCheckout): New
  methods.
* C4/Circulation.pm (CanBookBeIssued): Introduce CheckPrevCheckout
  check.
* admin/categories.pl: Pass along checkprevcheckout.
* koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt: Expose
  CheckPrevCheckout per category setting.
* koha-tmpl/intranet-tmpl/prog/en/modules/preferences/patrons.pref:
  Expose CheckPrevCheckout syspref.
* koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt:
  Expose per patron CheckPrevCheckout preference.
* koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt: Expose
  per patron CheckPrevCheckout preference.
* koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt: Add
  'CHECKPREVCHECKOUT' confirmation message.
* installer/data/mysql/kohastructure.sql: Modify structure of
  'categories', 'borrowers', 'oldborrowers'.
* installer/data/mysql/sysprefs.sql: Add 'CheckPrevCheckout'.
* installer/data/mysql/atomicupdate/checkPrevCheckout.sql: New file.
* t/db_dependent/Patron/CheckPrevCheckout.t: New file with unit tests.

Test plan:
- Apply patch.
- Run updatedatabase.
- Regenerate Koha Schema files.
- Run the unit tests.
- Verify 'CheckPrevCheckout' is visible in Patrons sysprefs and can be
  switched to 'hardyes', 'softyes', 'softno' and 'hardno'.
  + Check out previously checked out items to a patron, checking the
    message appears as expected.
- Verify no 'Check previous checkouts' setting appears on the borrower
  category pages if the syspref is set to a 'hard' option.
- Verify 'Check previous checkouts' setting appears on the borrower
  category pages and can be modified per borrower category.
  + Issue previously issued items to a borrower, checking the message
    appears as expected (This setting should override the default
    setting if that is set to a 'soft' option).
- Verify no 'Check previous checkouts' setting appears on the individual
  borrower pages if the syspref is set to a 'hard' option.
- Verify 'Check previous checkouts' setting appears on individual
  borrower pages and can be modified.
  + Issue previously issued items to a borrower, checking the message
    appears as expected (This setting should override the category
    setting and the default setting if the latter is set to a 'soft'
    option).

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: Kyle M Hall <kyle@bywatersolutions.com>
2016-07-08 13:40:08 +00:00
172ebfe520 Bug 16431: Use Koha::Cache to cache marc subfield structure
The marc subfield structure is currently cached using a global variable
of C4::Context. The infos are retrieved every time a new context is
created.
This patch suggests to use Koha::Cache instead.

To achieve this goal, a new subroutine is created
C4::Biblio::GetMarcSubfieldStructure, it will be called from code which
needs to get the marc subfield structure. GetMarcFromKohaField,
GetMarcSubfieldStructureFromKohaField, TransformKohaToMarc and
_get_inverted_marc_field_map are modified accordingly and the cache is cleared
when the table is updated (from the 3 pl scripts modified by this patch).

The caching done in C4::Context (marcfromkohafield) is removed.

Test plan:
Play with the marc subfield structure (in the administration module),
then add and edit records and make sure everything went fine.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Everything works as expected on my functional tests. I'm really happy to see the
patch introduces relevant tests for previously untested functions.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-07-08 12:44:58 +00:00
e85b2e4f94 Bug 14048: Add a refund rules setting form in smart-rules
This patch introduces the CRUD UI for managing the refund lost item fee
rules on the general 'Circulation and fines rules' page.

Verify that rules can be added and changed.

Rules are correctly associated to the chosen branch (or the
general default rule).

To test:
- Apply the patch
- Open smart-rules.pl
=> SUCCESS: The text and refund rules section correctly refers to default global rules.
   The policy can be set to Yes and No, and works as expected.
- Pick a specific branch
=> SUCCESS: The rule refers to the specific branch
=> SUCCESS: It detects the default rule is picked
=> SUCCESS: On changing the rules values are correctly retrieved if entering
   again to the page.
=> SUCCESS: The 'Use default' text is suffixed with the correct value set by the user
   in the 'All libraries' scenario.
=> Sign off :-D

Sponsored-by: DoverNet
Sponsored-by: South-East Kansas Library System
Sponsored-by: SWITCH Library Consortium

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jason Robb <jrobb@sekls.org>
Signed-off-by: Jennifer Schmidt <jschmidt@switchinc.org>
Signed-off-by: Margaret Thrasher <p.thrasher@dover.nh.gov>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
2016-07-07 10:37:01 -06:00
2af028bb13 Bug 16612 - Cannot set "Until date" for "Enrollment period" for Patron Categories
Attempting to set an "Until date" date for "Enrollment period" will
result in the date being accepted but not saved.

Test Plan:
1) Attempt to set an enrollment period until date for a new patron category
2) Note the period is not saved
3) Apply this patch
4) Attempt to set the enrollment period date again
5) This time it should save!

Signed-off-by: Andrew Brenza <abrenza@audubonlibrary.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-06-24 11:56:04 +00:00
8c14c25521 Bug 13074: Use Koha::Cache to cache the defaults values of a MARC record
With the global %default_values_for_mod_from_marc variable, the changes
made to the marc_subfield_structure table and especially the links
between MARC and DB fields are not safe and might be outdated (if a
field is linked/unlinked)

Test plan:
Under Plack:
- Link the barcode field, edit a record and set a barcode.
- Remove the mapping for the barcode field and then update again the
  barcode of the record.
The items.barcode DB field must not have been updated.

Without this patch, the field should have been updated.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-06-17 14:29:59 +00:00
7f3feacfe3 Bug 16259: Replace CGI->param with CGI->multi_param in list context - part 2
This patch is a follow-up of bug 16154.

It removes the warning "CGI::param called in list context" in the
following scripts:
admin/branches.pl
admin/categories.pl
admin/patron-attr-types.pl
admin/preferences.pl
catalogue/image.pl
circ/circulation.pl
patroncards/add_user_search.pl
serials/add_user_search.pl
tools/marc_modification_templates.pl
virtualshelves/shelves.pl

Note that the warning from catalogue/itemsearch.pl still exists (the
call to CGI->param is done from the template).

Test plan:
- Add/modify a library, patron category, patron attr type
- Update a syspref
- Set localcoverimage and call catalogue/image.pl?biblionumber=XXX
- Search for patrons in the patron cards or serials module
- Add a marc modification templates
- Add a list (shelves)

You should not get the warning in the log after all these actions.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-05-16 17:28:06 +00:00
9c5b819100 Bug 15009: QA follow-up
This patch adds a test to check the unicity of auth cats, simplify
the GetBudgetAuthCats subroutine and make it return an arrayref of scalar
instead of an arrayref of hashref with only 1 key.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-04-29 13:00:21 +00:00
456348aba9 Bug 15532: Add ability to allow only items whose home/holding branch matches the hold's pickup branch to fill a given hold
Some libraries would like to be able to limit hold filling to items that
match the pickup library for a hold based on the item's home or holding
library. The patron's home library should not affect whether a patron
can place the hold, instead the hold will only be fillable when an item
matching the pickup location becomes available.

Test Plan:
1) Apply this patch
2) Run updatedatabase.pl
3) Note the new "Hold pickup library match" rules for "checkout, hold,
   and return policy" and for "holds policy by item type"
4) Set the policy to "item's holding library"
5) Place a hold where the item's holding branch does not match
   the pickup branch
6) Check in the item
7) Note it is not trapped for the hold
8) Update the item's holding branch to match the pickup branch
8) Check in the item
9) Note the item is trapped for the hold
10) Repeat steps 4-9 but for home branch instead

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as described

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2016-04-29 09:49:07 +00:00
c133bedf54 Bug 16154: Fix some other occurrences
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>
2016-04-26 23:16:44 +00:00
f3e4b5bbb6 Bug 16154: CGI->multi_param - Force scalar context
This patch replaces the occurrences of
  $template->param( foo => $cgi->param('foo') );
with
  $template->param( foo => scalar $cgi->param('foo') );

perl -p -i -e 's/(\s*=>\s*)\$(cgi|input|query)\->param\(/$1scalar
\$$2\->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>
2016-04-26 23:16:43 +00:00
66aacace08 Bug 16154: CGI->multi_param - Declare a list
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>
2016-04-26 23:16:42 +00:00
Jesse Weaver
37ea74669c Bug 12748: (QA followup) fix several tiny QA tools warnings
* admin/searchengine/elasticsearch/mappings.yaml:
    * Fix indentation so QA tools believe it's valid YAML
  * C4::AuthoritiesMarc: Remove tab character
  * C4::Search: Fix POD
  * Koha::BiblioUtils: remove "return undef"
  * Koha::Schema::Result::Search*: rename type to _type
  * Koha::SE::ES::Search:
    * Fix spelling/@_[0]
    * Add my to loop variable
    * Remove unused var $error
    * Add use Modern::Perl
    * Fix undefined variables
  * Koha::ES::Indexer: fix POD
  * Koha::SE::ES::QueryBuilder:
    * Don't define variables in conditionals
    * Fix POD
  * Koha::SE::Zebra::Search:
    * Fix debug warns/POD/barewords
    * Koha::SE::Zebra::Search: add use Modern::Perl
  * kohastructure.sql: remove old, unused elasticsearch_mappings table,
    add new tables
  * labels/label-item-search.pl: remove C4::Dates
  * opac/elasticsearch.pl: remove old file

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
2016-04-26 20:20:13 +00:00
1cc42acb91 Bug 12478: Add the yaml mappings file
This should facilitate the modification of the mappings.
The yaml format is more readable than sql.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
2016-04-26 20:20:11 +00:00
38094a260e Bug 12267: Remove borrower_attributes.password
When creating a patron attribute type, there is a "Allow password"
checkbox. If checked, the librarian will be able to enter a password for
this patron attribute when editing a patron.
The goal was to allow a patron to log in with a secondary password.
However, this feature has never been implemented.

"""
commit 6fc62bcd32
  CommitDate: Mon May 12 09:03:00 2008 -0500
  extended patron attributes tables & syspref (DB rev 081)

- password_allowed (if set, staff patron editor will
  allow a password to be associated with a value; this
  is mostly a hook for functionality to be implemented
  in the future.
"""

To decrease maintainability, this patch suggest to remove the 2 DB fields
borrower_attributes.password and
borrower_attribute_types.password_allowed
If they have not used by the library.

Test plan:
- Edit a patron attribute type and select "allow password"
- Edit a patron and defined a password for this attribute
- Execute the DB entry
- Note that you get a warning
- Empty the password field
- Execute the DB entry
- You do not get the warning and the 2 DB fields have been removed

Signed-off-by: Marc Veron <veron@veron.ch>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
2016-04-22 23:08:32 +00:00
d46a664ef6 Bug 15757: Make issuelength default to null instead of 0
When editing circ rules, if the Loan period "issuelength" is not defined
(empty string), the default value was 0, not it's inserted in the DB as
NULL.

Test plan:
1/ Create or edit a circ rule
2/ Do not fill the Loan period column
3/ Save
=> Without this patch, the value was 0
=> With this patch it's now an empty string (in the DB it's set to NULL)

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Works as described.
No errors

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-04-22 00:24:05 +00:00
51e3e31627 Bug 16256 - Can't edit library EAN if you leave EAN empty
Test Plan:
1) Create an empty EAN
2) Edit it and save
3) Note you get a new EAN row
4) Apply this patch
5) Edit the empty EAN again
6) Note you now get an updated EAN and not a new row

Signed-off-by: Chris Cormack <chrisc@catalyst.net.z>

Depends on bug 16208 (which depends on 16206)

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan Gallagher <bredan@bywatersolutions.com>
2016-04-20 16:52:17 +00:00
e1cdef939a Bug 16208 - Can't delete a library EAN if the EAN value is empty
Test Plan:
1) Create an empty EAN
2) Attempt to delete it, you should get an error
3) Apply this patch
4) Attempt to delete the EAN, you should now be able to

Signed-off-by: Chris Cormack <chrisc@catalyst.net.z>

This depends on bug 16206 being pushed, or you need to apply that patch
first

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

https://bugs.koha-community.org/show_bug.cgi?id=16256

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan Gallagher <bredan@bywatersolutions.com>
2016-04-20 16:51:07 +00:00
Jesse Weaver
22633b5a61 Bug 16237: Allow entering of EDI accounts with plugins disabled
Test plan:
  1. Disable <enable_plugins> in koha-conf.xml (restart memcached if needed).
  2. Open the EDI accounts admin page.
  3. Notice incredible breakage.
  4. Apply patch.
  5. Reload page, should now display (and the "Plugin:" dropdown should
     be hidden).
  6. Re-enable <enable_plugins> (and the UseKohaPlugins syspref as
     well).
  7. Ensure that the "Plugin:" dropdown is once again displayed.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan Gallagher <bredan@bywatersolutions.com>
2016-04-20 16:46:34 +00:00
b64e6be1c4 Bug 16157: Move the selected flag from GetAuthorisedValues to the templates
From C4::Koha::GetAuthorisedValues

    # TODO: the "selected" feature should be replaced by a utility function
    # somewhere else, it doesn't belong in here. For starters it makes
    # caching much more complicated. Or just let the UI logic handle it, it's
    # what it's for.

Indeed, it's not a job for a subroutine, the template should take care of that.
Note that a perf gain could be won with this patch \o/

Test plan:
- Edit an itemtype and check the value of the "Search category" dropdown list
- Edit a patron attribute type and check the value of the "Class" dropdown list
- Detail for a catalogue record, the Status column should be correctly
  populated if items are damaged and/or lost
- Item details for a catalogue record, the lost, damaged and withdrawn
  value should be correctly displayed
- Edit a patron, the "street type" should be correctly selected
- Create a patron attribute type linked to an authorised value list.
- Edit a patron, set a value for this attribute, edit it again. The
  correct value should be selected.
- Search for subscriptions. The 'Location' dropdown list should behave
  correctly (select the entry you have choosen before, etc.)
- Edit a subscription, the location dropdown list should select the
  correct value.
- Edit and view a suggestion with a 'reason for suggestion' set (you
  should have at least 1 OPAC_SUG AV defined)

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>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-04-07 00:16:09 +00:00
fb0d0ddf39 Bug 15630 - Make Edifact module pluggable
Koha's EDIFACT module works great for many European vendors,
but does not work will for US vendors, which have a much different
interpretation of 'standard'. In fact, each vendor may require
different arrangements of values in EDIFACT messages. It would be
impossible to encompass all these requirements within Koha's EDIFACT
module itself. Instead, we should allow the module to be pluggable, so
versions of the module can be developed for vendors that require EDIFACT
messages that don't conform to the standard set by Koha's EDIFACT
module.

Test Plan:
1) Apply this patch
2) Run updatedatabase
3) Enable Koha plugins
4) Install the Edifact stub plugin available at
   https://github.com/bywatersolutions/koha-plugin-edifact-stub
5) Edit the EDI Vendor account, assign the plugin to a Vendor EDI account
6) Test EDI functionality ( ORDER, INVOICE ), there should be no errors
   or changes to the EDIFACT message input or output

Signed-off-by: Jason DeShaw <JDeShaw@cityoffargo.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-04-01 21:31:28 +00:00
07e098ef67 Bug 7736 [QA Followup] - Fix SQL, Add description field for Library EANs
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-04-01 20:03:18 +00:00
c2ec238d9f Bug 7736 [QA Followup] - Fix column headers, values and spelling
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-04-01 20:03:18 +00:00
Colin Campbell
e2e9916348 Bug 7736: Support Ordering via Edifact EDI messages
Add support for processing incoming Edifact Quotes, Invoices
and order responses and generating and transmission of
Edifact Orders.
Basic workflow is that an incoming quote generates an aquisition
basket in Koha, with each line corresponding to an order record

The user can then generate an edifact order from this (or another)
basket, which is transferred to the vendor's site

The supplier generates an invoice on despatch and this will
result in corresponding invoices being generated in Koha
The orderlines on the invoice are receipted automatically.

We also support order response messages. This may include
simple order acknowledgements, supplier reports/amendments
on availability. Cancellation messages cause the koha order
to be cancelled, other messages are recorded against the order

Which messages are to be supported/processed is specifiable on a
vendor by vendor basis via the admin screens

You can also specify auto order i.e. to generate orders from quotes
without user intervention - This reflects existing
workflows where most work is done on the suppliers website
then generating a dummy quote

Received messages are stored in the edifact_messages table
and the original can be viewed via the online

Database changes are in installer/data/mysql/atomicchanges/edifact.sql
Note new perl dependencies:
    Net::SFTP:Foreign
    Text::Unidecode

Signed-off-by: Paul Johnson <p.johnson@staffs.ac.uk>

Signed-off-by: Sally Healey <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-04-01 20:03:17 +00:00
Hector Castro
d995613eaf Bug 16092: Fix error dialog and introduce the Font Awesome icons when delete a branch category
Also change admin/branch.pl   type => 'error' to type => 'alert' to fit
with wiki <https://wiki.koha-community.org/wiki/Interface_patterns#Errors_and_messages>

To test:
1) Go to Admin -> Libraries and groups
2) Try to delete a library with patrons and bib items
3) See the error message in yellow
4) Try to delete a branch category/group without any library attached
   to it
5) Apply patch and repeat steps 1 to 4. Notice about the changes
6) Test buttons Yes, delete and No, do not delete and verify that they
   work as expected

Signed-off-by: Marc Véron <veron@veron.ch>

NOTE: Patch rebased and reword title according with QA comment 4

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-31 19:36:13 +00:00
870104ce11 Bug 13464 - Standardize the pagination class
There are a few template which use a different wrapper class for the
pagination links. These should be made consistent for a consistent
style.

To test, apply the patch and go to Administration -> Budgets.

- On this page the pagination markup has been removed in favor of
  DataTables pagination. The budget tables were already sorted using
  DataTables, so having server-side pagination on top of that doesn't
  make sense.

In Administration -> Class sources:

- This page had pagination markup which was unused.

In Authorities -> Authority search results:

- Perform an authority search which will return more than one page of
results. Confirm that the pagination links are correctly styled.

In Search -> Item search:

- Perform a search which will return more than one page of results.
Confirm that the pagination links are correctly styled.

Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Since the funds are all displayed (and nobody complained), it makes sense to
display all budgets.

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-23 23:05:00 +00:00
39597b86ae Bug 15773: Fix and standardise checkboxes code in framework
When creating a new subfield for an authority framework, the checkboxes
don't behave as they should.
If you click on the 'repeatable', 'mandatory' or 'is url' checkbox's
label, the checkbox from the second tab will be checked/unchecked.
This is caused by a non-unique id of the input element.

I have found this bug when working on the removal of CGI::checkbox in
both admin/auth_subfields_structure.pl and
admin/marc_subfields_structure.pl scripts.

This patch remove the use of CGI::checkbox as well as the generation of
html code from these 2 pl scripts (which should be avoided).
The code these scripts are now pretty similar.

Test plan:
Add/modify/remove subfield for a MARC framework and an Authority
framework.
Use as many field as possible and confirm that the values are correctly
inserted/displayed.

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: Brendan Gallagher brendan@bywatersolutions.com
2016-03-23 01:06:55 +00:00
fdac3eecf8 Bug 15962: Block the currency deletion if used
A currency should not be deleted if used by a vendor or a basket.

Test plan:
1/ Add a new currency
2/ Create a vendor using this currency
3/ Create a basket using this currency
4/ Try to delete the currency
5/ Delete the basket
6/ Try to delete the currency
7/ Delete the vendor
8/ Delete the currency

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
2016-03-21 22:56:11 +00:00
804e7d377b Bug 16012: Restore the ability to edit default authority type
Bug 15380 introduced a regression on the authority types admin page: the
default authority type (authtypecode="") is no longer editable.

Test plan:
Edit the authority type to update the summary
=> Without this patch you will get the "add a new authority type" form
=> With this patch applied, the correct behavior will be restored

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-03-21 22:41:44 +00:00
f6463317db Bug 16013: Make classification sources deletable
Because of a wrong variable scope, the classification sources are not
deletable.

Test plan:
Create a classification sources (admin/classsources.pl)
Try to delete it
Without this patch, the classification source won't be deleted
With this patch, it will work!

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-03-21 22:40:37 +00:00
99f2feeed9 Bug 16015: Restore the ability to delete a group of libraries
If a group of libraries is linked to at least 1 library, the group
cannot be delete and the librarian should get a warning message.
But if no libraries are linked, the deletion should be allowed.
Since bug 15294 this behavior is broken: The deletion is always blocked:
"This library category cannot be deleted. 0 libraries are still using
it", hum...

Test plan:
Create a group of libraries, delete it

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-03-21 17:19:44 +00:00
9820f9dfbd Bug 11998: Use Koha::Cache to cache sysprefs
At the moment, the sysprefs are only cache in the thread memory
executing the processus
When using Plack, that means we need to clear the syspref cache on each
page.
To avoid that, we can use Koha::Cache to cache the sysprefs correctly.

A big part of the authorship of this patch goes to Robin Sheat.

Test plan:
1/ Add/Update/Delete local use prefs
2/ Update pref values and confirm that the changes are correctly taken
into account

Signed-off-by: Chris <chrisc@catalyst.net.nz>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Tested with plack with syspref cache enabled, there is some time between setting the syspref and applying it, but it takes just one reload of page, it shouldn't be problem, should it?
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>

Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Tested with CGI and CGI + memcache; some small issues still remain,
but it would be better to deal with them in separate bug reports
if necessary

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-03-15 07:08:28 +00:00
34380f406c Bug 15084: typo currency vs currency_code
The DB column is currency.currency not currency.currency_code.

Test plan:
Delete a currency
Without this patch, you will get a warning in the logs:
No method currency_code! at
/home/koha/src/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt
line 148.
And the currency won't be deleted.

With this patch, it will!

It also changes the value of the delete op.

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-08 22:03:54 +00:00
6d854a167d Bug 15755: Display default item type as "All" in circ rules
Bug 15354 did not fix correctly the issue with the item type display.
The default item type '*' should be "All", at the moment nothing is
displayed in the column.

Test plan:
1/ Define a rule for default item types (All/*) and for specific item
types.
2/ Translate some item type descriptions used in previous step
3/ Default item type should be "All" and correct translations should be
displayed.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-03 22:24:08 +00:00
ed882397da Bug 15548 [QA Followup] - Catch a couple new Koha::Borrower uses
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
2016-03-03 14:39:00 -07:00
3691bd8419 Bug 15548: Move new patron related code to Patron*
The 'borrower' should not be used anymore, especially for new code.
This patch move files and rename variables newly pushed (i.e. in the Koha
namespace).

Test plan:
1/
  git grep Koha::Borrower
should not return code in use.

2/
Prove the different modified test files

3/ Do some clicks in the member^Wpatron module to be sure there is not
an obvious error.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as described. Tested with Circulation, Members/Patrons, Discharge,
Restrictions modules and the must common functionalities

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
2016-03-03 14:38:26 -07:00
1538e9ecf4 Bug 15084: Replace C4::Budgets::GetCurrencies with Koha::Acquisition::Currencies->search
Most part of the code here is unnecessary complex. We should selected
the currency if it is selected, that's all :)

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-03 20:39:01 +00:00
0423b82314 Bug 15084: use Koha::Acquisition::Currenc[y|ies] in admin/currency
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-03 20:39:00 +00:00
6c3a413f94 Bug 14753: Add the "page" parameter in the yml file
checkedintable is on the returns page

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-03-02 04:18:33 +00:00
eb3b68b7a4 Bug 14753 - Use columns configuration for checkins table
This patch adds the ability to configrue the visible columns on the
check in screen.

To test with both patches:
1 - Check in an item
2 - Note there is no 'Date acquired' column
3 - Apply  patches
4 - Note there is still no 'Date acquired' column
5 - Note that there is now a "Show / hide columns" button
6 - Verify that you can check the box and view the 'Date acquired'
column
7 - Verify that showing/hiding columns works (it will not carry over
        between items due to page reload)
8 - Verify that changes from the 'Configure columns' section of
Administration hold between checkins

Sponsored by: North Central Regional Library (ncrl.org)

Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-03-02 04:18:33 +00:00
Julian Maurice
fdc06dec2a Bug 15471: Add column settings and filters to Holds queue table
Add column visibility menu using DataTables Buttons
Add a text filter on top of each column
Also extend page width so that the large table is better centered

Depends on bug 15285

Test plan
1. Go to Holds queue page (circ/view_holdsqueue.pl)
2. Check that table sorting and filtering work well and that you can
   hide each column
3. Go to Admin > Configure columns and change the settings for this
   table (Circulation > view_holdsqueue > holds-table). Verify that the
   settings work by going again to the Holds queue page
4. Check that filters continue to work after hiding some columns

Tested on top of 15285, works as expected.
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
2016-02-24 04:00:52 +00:00
d6651ab949 Bug 15629: Koha::Libraries - Remove GetBranchesInCategory (1)
For consistency, the branchcodes method of Koha::LibraryCategory should be
named libraries.
At the moment, there is only one occurrence, in admin/branches.pl

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-02-24 03:55:05 +00:00
adef1d1020 Bug 15306: Do not display the translate link if only 1 language is installed
It doesn't make sense to offer the option to translate an item type
description into another language if there is only one language
installed.

Test plan:
Generates templates for only 1 language
Edit an item type and confirm that the link "translate into..." is not
displayed.
Generates templates for another language
Confirm that the link is now displayed.

Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-02-23 23:59:20 +00:00
4afc8550c6 Bug 9021 [QA Followup] - Switch to Koha::Object(s)
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-02-14 12:40:06 +00:00
5901fc5c12 Bug 9021 [QA Followup] - Use Modern::Perl
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-02-14 12:40:05 +00:00
0f57ecbb37 Bug 9021 [QA Followup] - Use TT plugin instead of passing syspref via script
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-02-14 12:40:05 +00:00
00c89d915b Bug 9021 - Add SMS via email as an alternative to SMS services via SMS::Send drivers
Nearly all cellular providers allow a person to send an text message to a cellular
phone by sending an email to phonenumber@provider. We can leverage this capability
to add the ability for Koha to send sms messages to patrons without the need to
subscribe to an sms gateway server.

Basic plan:
1. Add a table sms_providers to the db to tell Koha what service providers are available, and what domain emails should be sent to.
2. Add borrowers.sms_provider_id to tell Koha which mobile service the patron subscribes to for the number given in smsalertnumber
3. Modify Koha to send an email rather than using SMS::Send if the driver is set to 'Email'

Test plan:
0) Get a mobile phone
1) Apply the patch
2) Run updatedatabase.pl
3) Set the value of SMSSendDriver to 'Email'
4) Go to the admin page, the "Additional parameters" area should now have the link "SMS cellular providers"
5) On this page, add some providers. Make sure to add the provider for your own cellular phone service.

Here are some examples:
Sprint   phonenumber@messaging.sprintpcs.com
Verizon  phonenumber@vtext.com
T-Mobile phonenumber@tmomail.net
AT&T     phonenumber@txt.att.net

Only add the domain part in the 'domain' field. So for Verizon, that would be 'vtext.com'

6) Create an account for yourself, add your SMS number, and select your provider from the dropdown box directly below it.

7) Enable SMS messaging for Item check-in and Item checkout
8) Check out an item to yourself
9) Run process_message_queue.pl
10) Wait! You should receive a text message shortly, when I tested it, I received my sms message within the minute.

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-02-14 12:40:04 +00:00
95f0caed38 Bug 14828: use Koha::ItemType[s] in admin/itemtypes
Test plan:
Add/edit/remove item types from the administration module
(admin/itemtypes.pl).
You should get message feedback after each action.
Don't forget to play with the image and try to remove an item type
linked to records (you should not be able to remove it).

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
2016-01-27 20:46:58 +00:00
aafe73eefb Bug 14828: Use Koha::ItemType[s] everywhere C4::ItemType was used
This patch mainly replaces C4::ItemType->all with
Koha::ItemTypes->search.

Test plan:
At the places where the C4::ItemType module was used, confirm there is
no regression:
- acqui/neworderempty.pl
- catalogue/itemsearch.pl
- admin/item_circulation_alerts.pl
and the 2 cataloguing plugins:
- marc21_linking_section.pl
- unimarc_field_4XX.pl

QA step:
prove t/db_dependent/HoldsQueue.t should return green
Note that the tests were buggy.

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
2016-01-27 20:46:58 +00:00
Julian Maurice
9c81343bf6 Bug 15004: Allow to change amounts of duplicated budgets
When duplicating a budget we now have the possibility to change amounts
of budget and funds by a given percentage.  Additionally, we can
configure how to round the amounts.

Test plan:
1. Create a budget and several funds with different amounts
2. Duplicate it using the 2 new options
3. Check that the amounts are correct

Signed-off-by: Frederic Demians <f.demians@tamil.fr>
  It works exactly as advertised. Was happy to see that decimal point
  can be used: for example, increase a budget by 2.6%, and round the
  amound to 0.5.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-01-27 06:05:01 +00:00
001f8b9c07 Bug 15354: Sort itemtypes by translated description everywhere on circ rules admin page
It's better to cmp on lc.

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Passes QA tools. Fixes sorting of dropdown for translated itemtype
descriptions.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
2016-01-19 15:34:32 -07:00
f1b7e8b4d8 Bug 15354: Fix translated itemtype descriptions in circ rules
In bug 14100, the admin/smart-rules.pl needed much more love.
Indeed, the translated_description string should be used everywhere and
replaced the previous 'humanitemtype'.

Test plan:
1/ Translate some item types.
2/ Define some holds policy using these item types.
3/ Update the template strings
4/ Confirm that the "holds policy by item type" are displayed (for the
default and specific library) and sorted by translated item type descriptions.

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Passes QA tools.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
2016-01-19 15:34:32 -07:00
c5aa676294 Bug 15568: Fix display default circ rules
To reproduce:
Go on the admin circ rules page (admin/smart-rules.pl), switch the
dropdown list from specific to "all libraries".
The rules are not displayed anymore.

Test plan:
Apply this patch and confirm that the rules are now displayed correctly.
Make sure the enh introduced by bug 11625 is not broken.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
2016-01-19 15:18:42 -07:00
b43b9bbfb9 Bug 15295: (follow-up) Koha::Libraries - Remove GetBranchesCount
Fix conflict with bug 11625

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-01-19 12:31:27 +00:00
5c110a394d Bug 15294: Koha::Libraries - Rewrite the admin scripts
This patch rewrites the admin/branches.pl script to use the new modules
instead of C4::Branches.

Test plan:
1/ Create libraries using all the fields available
2/ Create groups of libraries
3/ Assign 1+ libraries to some groups
4/ Delete libraries and groups of libraries
You should not able to delete a library if items or patrons use it.
You should not able to delete a group of libraries if there are still
libraries using it.
5/ Update libraries and groups of libraries

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-01-14 15:22:26 +00:00
Joonas Kylmälä
e3f81857d8 Bug 15129: Add Koha::Object for issuing rules and let smart-rules.pl use it
Test plan:
1. Make sure that in koha/admin/smart-rules.pl you can still create
   new rules and that the new rules have all their values remained
   after saving the rule (so put to every field something).
2. Make sure you can edit that rule
3. Make sure you can delete that rule

Sponsored-by: Vaara-kirjastot

Followed test plan, works as expected
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
2015-12-31 19:19:45 +00:00
b2ae720fec Bug 14889: Fix error msg on duplicate
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2015-12-31 19:04:45 +00:00
ba2f667c3c Bug 14889: Use Koha::BiblioFramework[s] in admin/biblio_framework.pl
Test plan:
Add/edit/remove biblio frameworks from the administration module
(admin/biblio_framework.pl).
You should get message feedback after each action.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
No problems found. Tested add/edit/delete
No koha-qa errors

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2015-12-31 19:04:45 +00:00
7283069a9d Bug 15381: Remove getauthtypes and getauthtype
These 2 subroutines are now not necessary anymore, we can use
Koha::Authority::Types to retrieve the authority types.

This patch won't be easy to test. Indeed, a lot of file are updated.
To test it I would suggest to focus on the merge authority

You should also confirm that the authtypecode and the authtypetext
values are correctly displayed when navigating in the authority module.

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2015-12-31 18:59:02 +00:00
e28d54f7d9 Bug 15381: Use Koha::Authority::Types in some other places
There are 3 place where the auth_types table were requested directly
from the script or a subroutine.  These 3 occurrences are easy to
replace with the new module.

Test plan:
1/ Search for authorities and use the "did you mean" feature for
authorities.
Focus on the authtypecode
2/ Edit authority and biblio frameworks.
The "Thesaurus" dropdown list should be correctly populated (UNIMARC
only).

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2015-12-31 18:59:02 +00:00
5fc9a42c7c Bug 15380: Use Koha::Authority::Type[s] in admin script
This path rewrites the admin/authtypes.pl script to use the new modules
instead of executing the SQL queries from the script.

Test plan:
1/ Create 1+ authority types
2/ Update one
3/ Delete it
4/ Create an authority record using this authority type.
5/ Try to delete the authority type
Here there is a change in the behavior.
Prior to this patch, the user was able to delete the authority type, now
it's not.
I think it was a bug, feel free to give your opinion if you disagree on
this change.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2015-12-31 18:50:41 +00:00
c42de7460b Bug 9129 - Add the ability to set the maximum fine for an item to its replacement price
This patch adds the ability to set the maximum fine for a given item to
its replacement price ( assuming the replacement price is set ). If
overduefinescap is also set, the fine will be the lesser of the two, if
both apply to the given overdue checkout.

To enable this new limit, create or edit your circulation rules and
check the checkbox for "Cap fines at replacement price"

Test Plan:
1) Apply this patch
2) Run updatedatabase.pl
3) Pick an item, and set it's replacement price to 3.99
4) Edit the circulation rule that would apply to this item
   and the patron you will check it out to.
5) Check out the item to the patron, and backdate the due date
   such that the fine generated would be more than 3.99
6) Enable CalculateFinesOnReturn
7) Return the item, and view the fine generated, it should be 3.99

Signed-off-by: Cindy Murdock Ames <cmurdock@ccfls.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2015-12-31 15:29:36 +00:00
dad848a0a7 Bug 13931 - Date of birth in patron search result and in autocomplete
Test plan:
1) Apply the patch
2) Type into search form patron's name & check his date of birth in
   autocompletion
3) Go to intranet/cgi-bin/koha/members/member.pl & submit
   a search with more than one result .. now should in the table appear
   patron's date of birth
4) Try show/hide columns section if it works correctly for date of birth
5) Go to intranet/cgi-bin/koha/admin/columns_settings.pl -> go to
   patrons section & check there is dateofbirth & it's functionality

Signed-off-by: Frederic Demians <f.demians@tamil.fr>
  Works as described. Syspref dateformat respected. Column dateofbirth
  configurable, but mandatory on autocompletion search result.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2015-12-31 13:40:29 +00:00
ff1579de6d Bug 15258: Fix Perl scripts declaring unused variables
Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

All affected files tested with `perl -c`.
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
2015-12-30 17:24:45 -07:00
a2293ff6f5 Bug 15099: Move admin/categorie.pl to admin/categories.pl
This patch fixes the filename categorie.pl correcting it by categories.pl
The plurial is usually used for script names in the admin module.

Test plan:
Navigate to the patron categories page.

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
  No reference to categorie.pl anywhere in the code

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2015-12-30 16:36:41 +00:00
826326064e Bug 9819 - 'stopwords'-related code removed
This patch removes code related to stopwords usage. The following methods are removed:

C4::Search->remove_stopwords
C4::Context->stopwords
C4::Context->_new_stopwords

And the buildQuery API was changed (removed the \@removed_stopwords return value).
A follow-up is provided for database changes, to make rebasing easier.

To test:
- Apply this patch
- Do some searches in both intranet and opac interfaces
- Nothing should break

Sponsored-by: Universidad Nacional de Córdoba
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2015-12-30 15:49:35 +00:00
010a32d95f Bug 15344: Remove some other calls of GetMemberDetails from pl scripts
Same as previously.
For these files it's a bit less obvious.
To make sure these changes won't introduce any regression, check that
the variable returned by GetMember is never used to get something
else than a borrower fields.
The 'flags' should not be get neither.
For opac-user.tt it's different, other keys are got but there are defined
in the pl script.

On the way:
- 'showname' is removed (never used)
- fix scope var issue in opac-user.tt (BORROWER_INF.OPACPatronDetails vs
OPACPatronDetails)

Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2015-12-30 11:53:18 +00:00
ac541e0fa1 Bug 15344: Remove unucessary call to GetMemberDetails
This subroutine does a lot a processing and should only be called when
necessary.
In the get_template_and_user subroutine (so called from any pages of
Koha), it is call to pass the branchcode, title, firstname, surname and
borrowernumber values for the logged in user.
This subroutine calls GetMemberAccountRecords which retrieve the items
infos for all accountlines entries of the logged in user.
On members/members.pl, let's say you have 74 entries in the accountlines
tables, the page will execute 115 SELECT instead of 35 if you don't have any
accountlines entries.
With this patch, the number of SELECT is always 31.

To test this patch you should have technical skills to know what to do.

Note that USER_INFO was an array of... 1 element. Now it's a hashref.

Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2015-12-30 11:53:18 +00:00
83e913f8c2 Bug 11625 - Implement DefaultToLoggedInLibraryCircRules
This patch set makes the default circ rules and notices/slips to edit
the logged in branch, if one is set.

Test Plan:
1) Apply this patch
2) Log into staff side, and set your library
3) Browse to Administration/Circulation and fines rules
4) Note the rule set selected is for your library
5) Select "All libraries"
6) Note the rule set selected is for "All libraries"
7) Browse to Toos/Notices & slips
8) Note the notice set selected is for your library
9) Select "All libraries"
10) Not the rule set selected is for "All libraries"
11) Click "New Notice"
12) Note the Library field is set to "All libraries"

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes QA script and tests.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2015-12-30 11:41:13 +00:00
Aleisha
825d68ee86 Bug 14153: Noisy warns in admin/transport-cost-matrix.pl
To test:

1) Go to Admin -> Transport cost matrix
2) Notice the warns in the error log
3) Apply the patch and refresh page
4) Notice page still works but no warns in error log

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Amended patch: Init a $op variable, if it must be reused later.

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2015-12-30 04:00:51 +00:00
Holger Meißner
a68d565622 Bug 14101: Automatic renewals exactly on due date
If no value for 'no renewal before' is specified, automatic renewal now
falls back on the due date. Also 'no renewal before' can now be zero, so
both automatic and manual renewals can be delayed until due date.

Test plan:

1) Create some circulation rules with different settings for 'No renewal
   before' and 'Automatic renewal'. Both daily and hourly loans should
   work.

2) Try to renew both manually and automatically before and after a renewal
   should be possible. You can run misc/cronjobs/automatic_renewals.pl for
   automatic renewal.

3) Confirm that:
   * Both automatic and manual renewal with 'No renewal before' set
     to 0 do not happen before the due date (exact DateTime).
   * Manual renewal with 'No renewal before' set to undef (enter empty
     string) is unrestricted.
   * Automatic renewal with 'No renewal before' set to undef does not
     happen before the due date.

Sponsored-by: Hochschule für Gesundheit (hsg), Germany

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-20 10:13:47 -03:00
Mark Tompsett
fea7b9b4d4 Bug 4502: An attempt to make things more sensible.
The reason the budget_period_id was not defined was because in
two cases it was not passed! This patch adds those missing
parameters. And as a result, cuts out the attempt to default the
authcat to '' unless the budget_period_id is defined.

Additionally, the start and end months don't seem to be passed,
so rather than have it blow up, checking them forces the else
case logic.

budget_period_id is the budget id. If you have two budgets,
you can craft a URL to work with budget_period_id matching
those two ids. Anything else should trigger the new error which
was modified to reflect more of what the problem is.

Follow the test plan in comment #6. Feel free to also to attempt
crafting URLs and triggering errors.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Well, works and does not explode any more
No errors

To trigger the new message simply put /cgi-bin/koha/admin/aqplan.pl
on your staff page, an intriguing 'Planning for by Asort1' appears :)

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-19 20:23:46 -03:00
Jonathan Druart
0a39123771 Bug 4502: Catch software error if no active budget defined
TEST PLAN
---------
0) Back up your database.
1) In mysql client:
   > DROP DATABASE {your koha database name};
   > CREATE DATABASE {your koha database name};
   > QUIT;
2) Go to the staff client, and install all the default
   and optional things -- except patrons. :)
3) Log into staff client.
4) Create a patron -> New Patron -> Staff
5) Enter data and Save
6) More -> Set Permissions
7) Make superlibrarian
8) Log out
9) Log in as new superlibrarian
10) Acquisitions -> Budgets -> New Budget
11) Enter a non-active budget with some funds.
    -- Once saved, it should list in the inactive budgets.
12) Click on the name.
13) Click on one of the Planning submenu options.
14) Click the 'Submit' button in the Filter area.
    -- This should trigger the blow up.
15) Apply the patch
16) Repeat steps 12-15
    -- The kaboom is avoided and a nice message given.

NOTE: This does not solve all the problems in this ugly, ugly
      module area. It does solve the one thing it is meant to:
      that nasty kaboom.

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

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-19 20:23:46 -03:00
defcfd050e Bug 15109: Make name the default sort order for all patron searches
Find another place where there is a patron search (add user to a basket,
add users to a fund or edit owner of a fund, set a guarantor to a child,
etc.).
Do a search a confirm that the results are now sorted by name instead of
cardnumber.

Signed-off-by: Nicole Engard <nengard@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-17 09:49:21 -03:00
3c120e7b92 Bug 14836: Move Koha::PatronCategor* to Koha::Patron::Categor*
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-05 10:57:41 -03:00
891526e311 Bug 14836: Use Koha::PatronCategor[y|ies] in admin/categories.pl
Test plan:
Add/edit/remove patron categories from the administration module
(admin/categories.pl).
You should get message feedback after each action.

Signed-off-by: Frederic Demians <f.demians@tamil.fr>
  Operations in admin/category is unchanged, and functionnal

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-05 10:57:40 -03:00
Katrin Fischer
2f6d1e8240 Bug 11431: (QA followup) Typo in help file / variable name
Fixes the variable name to avoid a double-up that made it
impossible to turn off the sounds in general. If AudioAlerts
are turned off, they will only work on the audio administration
page now so you can set up and test the different sounds there.

Also fixes a little typo in the help file.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-04 12:33:44 -03:00
7091c6b274 Bug 11431: (QA followup) Add ability to edit audio alerts
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2015-11-04 12:33:10 -03:00
dc0c851fc9 Bug 11431: (QA followup) Always allow audio alerts for audio alerts editor page
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2015-11-04 12:33:10 -03:00
07ddb07341 Bug 11431: (QA followup) Fix alter precedences on delete
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2015-11-04 12:33:10 -03:00
220ff161e9 Bug 11431: Add additional sound options
This patch set replaces and extends Koha's current sound options.
This is implemented be removing the existing sound system, and
re-engineering using a table of selector/sound combinations such that
the highest precedence selector that is found in the DOM will trigger
and audio alert. The existing audio behaviors are implemented as a set
of default audio alerts.

Test Plan:
1) Apply this patch set
2) Run updatedatabase.pl
3) Enable the AudioAlerts system preference
4) Test existing sounds
5) Enter the new alerts editor in the admin section
6) Add a new audo alert with the following selector:
    "body:contains('Check in message')",
   choose any sound alert you wish, make sure it's not one of the 3
   sounds already used! Make this selector precedence 1
4) Browse to the checkins page, you should hear the default sound
5) Attempt to return an invalid barcode, you should hear your custom sound!

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2015-11-04 12:32:57 -03:00
9c203a0040 Bug 15087: hardduedate should not be inserted as 0000-00-00 but NULL
This has been introduced by bug 14949, recently pushed.
So I don't think we need to update the DB, only devs will face this
problem.

The hardduedate was inserted as 0000-00-00 because was en empty string.
To be inserted as NULL, the value should be undef.

Test plan:
0/ Don't apply this patch
1/ Edit a circ rules and don't fill the hard due date
2/ Look at the DB, the value is 0000-00-00
3/ Apply this patch and confirm that the value is now NULL

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Confirmed
+--------------+----------+-------------+
| categorycode | itemtype | hardduedate |
+--------------+----------+-------------+
| *            | *        | NULL        |
+--------------+----------+-------------+

No koha-qa errors

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-02 11:32:06 -03:00
Bernardo Gonzalez Kriegel
b722fbfb5c Bug 15093: Load/show saved item type group and hideinopac
This patch adds loading of hideinopac and searchgroup
when showing/editing itemtypes

To test:
1) Put some values in ITEMTYPCAT auth value
2) Edit an item type, select a value for
search category & check 'Hide in OPAC'
Save
3) Results do no show on list of item types
4) Edit same item type, values are default/empty
5) Apply the patch
6) Edit again, change again, save
Now values shows in list
7) Edit again, values are now correct

Values were saved on db, but not loaded from it
How this happen?

Side note: searching for searchcategory I found

installer/data/mysql/kohastructure.sql:  searchcategory varchar(80) default NULL, -- Group this item type with others w
installer/data/mysql/updatedatabase.pl:            ADD searchcategory VARCHAR(20) DEFAULT NULL

Its varchar(80) in kohastructure and varchar(20) in updatedatabase

We need more eyes :)

Signed-off-by: Nicole Engard <nengard@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-01 17:10:44 -03:00
a636f2223c Bug 14931: (qa followu-up) small improvements
- Avoid 1 call to dt_from_string in some cases
- Do not use $_

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-29 12:00:42 -03:00
Marc Véron
f461de794b Bug 14931: (Follow-up) Validate date entry in contracts
Go to Home > Acquisitions, search for an active vendor and view the vendor
- Click on 'Contracts' at the left
  (admin/aqcontract.pl)
- Create and edit contracts and verify that it works OK.
  (Note: there is no help for this page, see Bug 14929)

Amended for comment #7  25.10.2015 / mv

Signed-off-by: Jesse Weaver <pianohacker@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-29 12:00:36 -03:00
Marc Véron
e4cc11ee13 Bug 14931: Remove C4::Dates from files admin/aq*.pl
This patch removes C4::Dates from:

- admin/aqbudgets.pl
- admin/aqplan.pl
- admin/aqcontract.pl

To test:

- Apply patch

- Go to Home > Adminstration > Budgets > All funds
  (admin/aqbudgets.pl)
- Verify that everything displays as before

- Edit one of the funds and click on 'Planning - Plan by months'
  (admin/aqplan.pl)
- Verify that planning works as before

- Go to Home > Acquisitions, search for an active vendor and view the vendor
- Click on 'Contracts' at the left
  (admin/aqcontract.pl)
- Create and edit contracts and verify that it works OK.
  (Note: there is no help for this page, see Bug 14929)

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised. Tested with dateformat syspref
Dates in planning by months not needed to be on iso format, aqplan.pl
uses instead Date::Calc

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-29 12:00:28 -03:00
30667f0555 Bug 14100: (follow-up) Language overlay for item types
Display the translated description for item types in the following pages:
> admin/smart-rules.pl
> catalogue/detail.pl
> catalogue/itemsearch.pl
> catalogue/moredetail.pl
> reports/acquisitions_stats.pl
> reports/bor_issues_top.pl
> reports/cat_issues_top.pl
> reports/catalogue_out.pl
> reports/catalogue_stats.pl
> reports/issues_avg_stats.pl
> reports/issues_stats.pl
> reports/itemslost.pl
> reports/manager.pl
> reports/reserves_stats.pl
> suggestion/suggestion.pl
> tools/export.pl

> Opac:
> opac-detail.pl
> opac-MARCdetail.pl
> opac-search.pl

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>
2015-10-27 12:34:06 -03:00
Jonathan Druart
0f63f89f66 Bug 14100: Generic solution for language overlay - Item types
Test plan:
1/ update the Schema (misc/devel/update_dbix_class_files.pl)
2/ Translate templates for some languages (es-DE, de-DE for instance)
3/ Enable them in the pref (search for 'lang') for the staff interface
4/ Go on the item type admin page (admin/itemtypes.pl)
5/ Edit one
6/ Click on the 'translate for other languages' link
7/ You are now on the interface to translate the item type's description
in the languages you want. So translate some :)
8/ Go back on the item type list view (admin/itemtypes.pl)
9/ You should see the original description (non translated)
10/ Switch the language
11/ You should see the translated description in the correct language.
If the description is non translated, the original description is
displayed.

12/ On the different page where the item type is displayed, confirm that
the translated description appears.

Think further / Todo:
1/ Update all occurrences of the item type's description (DONE)
2/ Implement for authorised values
3/ Implement for syspref value (at least textarea)
4/ Implement for branch names
5/ Centralize all the translation on a single page in the admin area
...
N/ Implement a webservice to centralize all the translations and give
the ability to sync the item types/authorised values description with
the rest of the world (push and pull).

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>
2015-10-27 12:34:06 -03:00
Marc Véron
c3c636bf7f Bug 14949: Remove remaining C4::Dates and fix display in admin/categorie.pl
This patch removes a remaining C4::Dates from admin/categroie.pl and fixes
the display of "Enrollment period" on the confirmation screen for deleting.

To verify and test pls. refer to comments #5 and #6

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: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-27 10:11:13 -03:00
Marc Véron
4750d321ec Bug 14949: (followup) Fix regression with hard due date
This patch fixes the regresseion as described in comment #3

To test:

- Go on smart-rules.pl and edit a line. Do not define a Hard due date, save.
  The value is "None defined".

- Edit the line, do not change anything and save.
  The value should be "None defined"

- Edit the line, define a hard due date, save.
  The date should display as expected.

- Edit the line agein, remove the hard due date, save.
  The value should be "None defined"

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: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-27 10:11:05 -03:00
Marc Véron
52c646b3ea Bug 14949: Remove C4::Dates from admin/smart-rules.pl and admin/categorie.pl
Bug to remove C4::Dates from
 - admin/smart-rules.pl
 - admin/categorie.pl

To test:

- Apply patch

- Go to Home > Administration > Circulation and fine rules (smart-rules.pl)
- Edit or add a rule
- Verify that 'Hard due date' displays and saves fine

- Go to Home > Administration > Patron categories
- Edit or add a category
- Verify that 'Until date' displays and saves fine

Note: The date picker does not warn about wrong date formats as e.g. while
      editing patrons, but that is not in the scope of this bug

Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-27 10:10:57 -03:00
f86816220e Bug 13590: Add ability to charge fines at start of charge period
Right now, Koha only charges fines at the end of a given charge period.
For example, let us assume a circulation rule has a charge period of one
week ( 7 days ) and a fine of $5. This means that an item can be overdue
for 6 days without accruing a fine. Koha should allow circulation rules
to be configured to place the charge at the start of the end of the
charge period so the library can decide when the fine should accrue.

Test Plan:
1) Apply this patch
2) Run updatedatabase.pl
3) prove t/db_dependent/Circulation_Issuingrule.t
4) prove t/db_dependent/Circulation.t
5) prove t/db_dependent/Fines.t
6) Ensure you can still create/edit circulation rules

Edit: I removed the DBIx changes after a couple minutes fighting with them.
Will regenerate as usual in a RM followup / Tomas

Signed-off-by: Daniel Grobani <dgrobani@samuelmerritt.edu>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-22 14:51:24 -03:00
Blou
96b05f3535 Bug 10937: cleanup and rename DOCTYPECAT to ITEMTYPECAT
- "Item" and not "Document" is the word used throughout Koha.
- Moved the updates to an atomic update
- changed searchcategory from varchar(20) to (80)
- cleanup
2015-10-22 11:06:22 -03:00
ahmed
30edfbfa58 Bug 10937: Option to hide and group itemtypes from advanced search
This allows to group certain item types in a category, to be displayed (and searched) as such in OPAC's advanced search.  For example, you can group Reserve 2h and Reserve 12h into a Reserve category.  The 2 and 12h types won't appear anymore.
This also allows to simply prevent an item type from displaying as a search option.

TEST PLAN
------------------
0) Back up database, so you can reset and retest easily. ;)
1) Apply the patch
2) Run Koha QA tool.
3) prove -v t/db_dependent/Koha.t
  -- all tests should pass.
  4) run ./installer/data/mysql/updatedatabase.pl to add the
  two columns to itemtypes
  -- Does a meaningful message get printed?
  Are the columns added?
  "DESCRIBE itemtypes;" should list hideinopac and searchcategory.
  5) You need to add a category to group your item types:
  a) In Intranet/Koha Admin/Authorized values,
  select DOCTYPECAT in the 'Show category:' dropdown
  i) If you do not have a DOCTYPECAT category, create one.
  b) Click button "New authorized value for DOCTYPECAT"
  c) Enter
  Authorized value: HARDWARE
  Description : Hardware
  Description (OPAC): Hardware
  6) Group your items under that new category
  a) In Intranet/Koha Admin/Item types, choose (at least)
  two item types and for each:
  - Click action/Edit on the right column
  - Third row (below Description) is the Search category list box, select Hardware
  - click Save changes at the bottom
  7) Select at least one item to be hidden in the OPAC search
  a) In Intranet/Koha Admin/Item types (again), choose a different item type:
  -  Click action/Edit
  -  Click the checkbox "Hide in OPAC" below the list of icons.
  8) Go test your modifications
  a) Go to OPAC/Adv search.
  b) Validate that all items modified above (hidden or grouped) do not appear in Item type list
  c) Validate that new item type Hardware does appear instead.
  d) Select item Hardware, start Search.
  ) Validate returned items are the of the two types that were grouped into the Hardware category in step 4.

Sponsored-by: Vanier college

Signed-off-by: Nick <nick@quecheelibrary.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-22 11:06:07 -03:00
4b2b06311e Bug 10363: FIX regression - prevent duplicate
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-19 12:46:28 -03:00
7f0202ab84 Bug 10363: FIX rebase conflict error
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-19 12:46:28 -03:00
9b029fbc45 Bug 10363: [QA Followup]
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>
2015-10-19 12:46:27 -03:00
Jonathan Druart
64aa24d593 Bug 10363: Use Koha::AuthorisedValue[s] in the admin page
Now we have packages, we need use them in the pl script.

Test plan:
Verify there are no regression on addind/editing/deleting authorised
values.
Done forget to test the branch limitation.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
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>
2015-10-19 12:46:27 -03:00
f94afd5e6c Bug 14841: Fine column is not manage by columns settings
Bug 9481 added the "Fine" columns to the checkouts table and bug 13492
added the columns settings to these table.
They overlapped each others in the bugs queue.

Test plan:
Confirm that you are able to hide/show the "Fine" columns on both
checkouts table.

Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-13 11:38:23 -03:00
Jonathan Druart
eda4070f2b Bug 14045: Introduce the maxonsiteissueqty field as a copy of maxissueqty
This patch adds the new fields maxonsiteissueqty as a copy of the
existing maxissueqty field.

There is no brainy code here, it only adds the ability to fill the new
field from the admin interface (admin/smart-rules.pl).

Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-13 11:13:23 -03:00
45331a4a7c Bug 14888: Update copyright and wording
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-05 12:00:38 -03:00
b755e657e5 Bug 14888: use Koha::Cit[y|ies] in admin/itemtypes
Test plan:
Add/edit/remove cities from the administration module
(admin/cities.pl).
You should get message feedback after each action.

Tested both patches together, works as expected.
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@theke.io>
2015-10-05 12:00:37 -03:00
Jesse Weaver
13fadc06da Bug 14510: (QA followup) Add more columns, resort
Per a conversation with Jonathan Druart, add all columns that could be
reasonably mapped, and order them the same as in kohastructure.sql.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-09-18 11:57:04 -03:00
Jesse Weaver
547ef37e04 Bug 14510: Allow column visibility in additem.pl to be customized
This patch adds the table of items on additem.pl to the columns
customizer.

Test plan:
  1. Open item editor on a record, and verify that all columns are visible.
  2. Apply patch.
  3. Reload editor, and verify that column visibility hasn't changed.
  4. Open "Hide/show columns," and verify that you can add and remove
     columns.
  5. Change the visibility and togglability of some columns in
     columns_settings.pl, and verify that these correctly apply to
     additem.pl.

NOTE: The columns that are configurable are selected from the non-hidden
columns that have mappings to MARC subfields in the default MARC21
framework (and can thus be displayed in the item editor).

Signed-off-by: Jenny Schmidt <jschmidt@switchinc.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-09-18 11:57:03 -03:00
e0ed9cbcf6 Bug 14649: Fix regression - display fund name on budget planning
A patch from bug 11714 removes 'budget_name_indent', which was useless.
The script and the template should use the budget_name value.

Note that this patch impacts the CSV export, which does not work, so it cannot be
tested.

Test plan:
Edit a fund and click on one of the Planning value (by months, etc.)
The "Fund name" column should be correctly populated with the fund
names.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.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>
2015-09-07 11:45:26 -03:00
eb12ee1e22 Bug 12965: Prevent to erase an existing item type
On creating an item type, if it already exists, it will replace the
existing one.
This patch prevent that and display a message to the interface.

Note: The fields are lost.

Test plan:
1/ Create an item type 'AAA', description 'AAA'
2/ Edit it, update the description with 'BBB'
3/ Create an item type 'AAA' with a description 'CCC' => you should get
a warning "already exists".

Works well, no errors

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>
Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Warning message is triggered.
Adding, editing and deleting item types still works.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-02 14:39:11 -03:00
6d73e951be Bug 11584: Add wysiwyg editor to system preferences dealing with HTML
This patch adds the ability to use a WYSIWYG editor for system preferences.

The key files that I touch are:

1) admin/systempreferences.pl
2) koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt
3) koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tt

I also add:

4) koha-tmpl/intranet-tmpl/prog/en/includes/wysiwyg-systempreferences.inc

and

5) koha-tmpl/intranet-tmpl/lib/tiny_mce/plugins/advimage

This plugin is part of the TinyMCE distribution. It used to be in Koha, but
then someone removed it. It's useful for preferences like "opacheader" though.

*If you're using anything except IE, this should work super well. If
you're using IE, it'll probably only work for keyboard input and dragging
text within the editor box but not from outside of it. IE has worse
security, so you can probably paste using the context menu paste.

*While I think a WYSIWYG editor can be useful, there might be times
where the content is displayed differently than it is in the editor
because of higher level CSS and Javascript.

Signed-off-by: Martin Persson <xarragon@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-08-28 10:28:50 -03:00
Jonathan Druart
58c652a0fc 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>
2015-07-20 10:34:55 -03:00
a72262a950 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>
2015-07-20 10:15:27 -03:00
Jonathan Druart
454becb78f Bug 9006: Remove AUTOLOAD in C4::Context
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>
2015-07-20 10:11:41 -03:00
Mark Tompsett
63427fce60 Bug 14428: Remove C4::Input
Jonathan Druart agreed that C4::Input is vestigial code that should be removed.
Here is how I checked. First I found where C4::Input was used. Then, I checked
what functions are in the package: just checkdigit. Then, I confirmed that
checkdigit is not used at all in any acquisition, administration, or member
related perl scripts. Lastly, I took a look at our supposed test file for the
package. It was painfully sparse.

As such, this patch removes the test file and the package file, and removes
C4::Input references from these six files:
- acqui/addorderiso2709.pl
- acqui/basketgroup.pl
- acqui/neworderempty.pl
- acqui/uncertainprice.pl
- admin/aqplan.pl
- members/memberentry.pl
NOTE: neworderempty had 3 lines of it?! Didn't anyone see that?!

Here is the output of what I did to confirm this correction:

mtompset@debian:~/kohaclone$ git reset --hard origin/master
HEAD is now at 6e9086f Bug 3206: (QA followup) missing comma on sysprefs.sql
mtompset@debian:~/kohaclone$ git grep C4::Input
C4/Input.pm:package C4::Input; #assumes C4/Input
C4/Input.pm:C4::Input - Miscellaneous sanity checks
C4/Input.pm:  use C4::Input;
acqui/addorderiso2709.pl:use C4::Input;
acqui/basketgroup.pl:use C4::Input;
acqui/neworderempty.pl:use C4::Input;
acqui/neworderempty.pl:use C4::Input;
acqui/neworderempty.pl:use C4::Input;
acqui/uncertainprice.pl:use C4::Input;
admin/aqplan.pl:use C4::Input;
members/memberentry.pl:use C4::Input;
t/Input.t:        use_ok('C4::Input');
mtompset@debian:~/kohaclone$ grep sub C4/Input.pm
sub checkdigit ($;$) {
                my $temp2 = substr($infl,$i,1);
        if ($rem eq substr($infl,8,1)) {
} # sub checkdigit
mtompset@debian:~/kohaclone$ grep checkdigit `find acqui -type f`
mtompset@debian:~/kohaclone$ grep checkdigit `find admin -type f`
mtompset@debian:~/kohaclone$ grep checkdigit `find members -type f`
mtompset@debian:~/kohaclone$ cat t/Input.t

use strict;
use warnings;

use Test::More tests => 1;

BEGIN {
        use_ok('C4::Input');
}

Apply this patch, and the output of git grep C4::Input will be empty.
Run koha qa test tools (kind of overkill)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-07-10 10:53:56 -03:00
Jonathan Druart
fc6789c206 Bug 8802: On editing a library group category type is not set
The category type was always set to 'searchdomain', because it's the
first of the dropdown list.

Test plan:
1/ Create or edit a library group
2/ Set the category type to "properties"
3/ Edit it again
4/ Confirm "properties" is correctly selected

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-06-23 10:14:13 -03:00
Stefan Weil
3f3a29f796 Bug 14383: admin: Fix some typos in comments and documentation
Most of them were found and fixed using codespell.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
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@theke.io>
2015-06-22 17:34:46 -03:00
Mark Tompsett
7ad39b6fc9 Bug 14145: Noisy warns in admin/preferences.pl
The problem with the odd number of hashes happens when not everything is selected.
The grep returns undef, because it isn't found in @values.
By turning the grep into a ternary-operator truth value, we can set a value (1 or 0) expressly.

The next problem is when nothing is selected in these multiple lists, $value is
undefined, so you can't split it. By splitting the definition of @values from
the actual splitting, we can split only if $value is defined, thus eliminating the
warning message.

TEST PLAN
---------
1) back up your koha error log file
2) blank your koha error log file
3) log in to the staff client
4) Home -> Koha administration -> Global system preferences
5) Click on every tab, EXCEPT local use.
6) notice the koha error log file has warnings.
7) blank the koha error log file again
8) apply this patch
9) Click on every tab, EXCEPT local use, again.
10) notice the koha error log file has no warnings.
11) koha qa test tools.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
I like more this version
Works as described
No koha-qa errors

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
To reproduce: go on the OPAC tab, OpacAdvSearchMoreOptions  or
OpacAdvSearchOptions should not have all options selected.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-22 09:37:24 -03:00
Jonathan Druart
60403419ed Bug 10947: Fix editing the default authority type
The default authority type cannot be defined.
The authtypecode is en empty string and the tests should be done on
"defined", not "exist".

Test plan:
Edit the default authority type, save it.

Note: There is no way to create an authority with an empty string, with
you deleted you won't be able to recreate it.

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>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-19 09:25:59 -03:00
Jonathan Druart
918c068e17 Bug 10011: Save branch limitations on creating a new patron category
The code was just badly placed.
It should be executed on update but also on insert.

Test plan:
1/ Create a new patron category and select 1+ branch limitations
2/ Confirm it's correctly saved
3/ Edit it and change the branch limitations
4/ Confirm it's correctly saved

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

NOTE: Not a C4 or Koha library, so tests not required. Though,
      this code could be cleaned up and have the DB stuff put
      into some sort of library with tests to prevent regression.
      However, that dream is beyond the scope of this bug.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-19 09:21:23 -03:00
Jonathan Druart
e9d30862c1 Bug 14042: Get rid of the home made pagination in the auth type admin
This patch removes the home made pagination and introduces datatables on
this page.

Test plan:
Go to the authority type admin page and confirm there is a beautiful
table.

Confirmed...
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@gmail.com>
2015-05-07 11:11:21 -03:00
Jonathan Druart
7bf6987327 Bug 1487: Store the "display only used tags/subf" value in a cookie
On the marc framework page, the checkbox to display only used
tags/subfields is always unchecked.
It should be stored into a cookie to always display the same view.

Test plan:
1/ Go on the marc framework page
2/ Check the checkbox
3/ Go somewhere else on the staff interface
4/ Back to the marc framework page, the checkbox should be checked

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Works as advertised, getting datatables error when using feature
but the error exists pre-patch
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-30 15:23:01 -03:00
Jonathan Druart
d7cfdb45e5 Bug 13492: Add the location column to the checkouts tables
Test plan:
1/ Verify that the location column is correctly displayed on the
checkouts tables (circ/circulation.pl and members/moremember.pl).
2/ Verify that you can hide/show this column (using the admin page
and/or the ColVis DT plugin).

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-24 09:41:23 -03:00
Jonathan Druart
06cde076c7 Bug 13492: Add the column configuration for the checkouts table - morember.pl
Test plan:
1/ Verify that you can show/hide columns on the checkouts table (moremember.pl).
2/ Play with the column configuration admin page (admin/columns_settings.pl),
and confirm the behavior is correct (depends on what you have selected).

Amended patch: replace 'un' and 'deux' with 'sort_order' and
'todays_or_previous_checkouts' in the yml file.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-24 09:41:15 -03:00
Jonathan Druart
8c324dd2a0 Bug 13492: Add the column configuration for the checkouts table - circulation.pl
Test plan:
1/ Verify that you can show/hide columns on the checkouts table (circulation.pl).
2/ Play with the column configuration admin page (admin/columns_settings.pl),
and confirm the behavior is correct (depends on what you have selected).

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-24 09:41:11 -03:00
Jonathan Druart
65cb0f5be6 Bug 10131: Add a fallback if the pref search is not a valid regex
It's possible to search prefs using a regex.
But it the regex is not correctly written, the app explodes.
We should provide a fallback.

Test plan:
0/ Does not apply the patch
1/ Search for sysprefs with "notes.*", note the number of results
2/ Search for *notes*, boom
3/ Apply the patch
4/ Repeat 1 and confirm you get the same number of results
5/ Repeat 2 and confirm you don't get the error anymore

NOTE: As noted on comment #4, the kaboom is because of the
      leading * and not the following *, because 's*' is a valid
      regular expression, while '*n' is not.

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>
2015-04-21 09:30:34 -03:00