Commit graph

1080 commits

Author SHA1 Message Date
e7b004689c Bug 20383: Hide link to plugin management if plugins are not enabled
This patch adds a check in admin-home.pl to see whether plugins are
enabled. If plugins are disabled, the link to plugins management is
hidden even if the user has plugin management permission.

To test, view the administration home page with plugins enabled and
disabled via the enable_plugins flag in the Koha configuration file.
Also test using users with different plugins permissions:

- Plugins enabled
  - CAN_user_plugins = 1
    -> Plugins link appears
  - CAN_user_plugins = 0
    -> Plugins link hidden

- Plugins disabled
  - CAN_user_plugins = 1,
  - CAN_user_plugins = 0
    -> Plugins link hidden

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-03-19 13:55:53 -03:00
Mark Tompsett
5db35e919a Bug 20201: Silence warnings triggered by admin/aqplan.pl
TEST PLAN
---------
0) back up DB
1) Run the following commands on a kohadevbox:
    reset_all
    git bz apply 20185
    echo | sudo tee /var/log/koha/kohadev/plack-error.log
    restart_all
2) Navigate in a staff client:
    Home -> Administration -> Budgets -> Edit -> Planning by libraries
   -- could be any of the planning, but by libraries is nicely visible
   on screen.
3) Run the following commands:
    cat /var/log/koha/kohadev/plack-error.log
   -- several warnings.
4) Run the following commands:
    git bz apply 20201
    echo | sudo tee /var/log/koha/kohadev/plack-error.log
    restart_all
5) repeat step 2 and refresh the staff client page.
   -- this time warnings related to aqplan.pl are not there.
6) run koha qa test tools

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-27 12:12:57 -03:00
5d8155439e Bug 17672: Add damaged_on to items and deleteditems tables
This patchset adds a 'damaged_on' column to store the date an item is
marked damaged, analogous to withdrawn_on and itemlost_on

To test:
1 - Apply patch
2 - Mark an item damaged via moredetail.pl (Items tab on left in
        details)
3 - Note the damaged on date apears below
4 - Unmark the item, the date is removed
5 - Go to the edit items screen (from top bar 'Edit->edit items')
6 - Mark item damaged - check db or moredetails.pl to see damaged_on
date
7 - Unmark item damaged - confirm date is removed
8 - prove t/db_dependent/Items.t

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

Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-18 16:48:43 -03:00
8a118d01bf Bug 9573: Lost items report - Add a new itemlost_on column
This patch adds a new "Lost on" column to the result table

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

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-17 18:32:14 -03:00
61c832a507 Bug 9573: Lost items report - Add items.notforloan as a filter
This patch adds a new "Not for loan" status filter to the lost items
report.

Test plan:
0/ Apply all patches from this patch set
1/ Use the new "Not for loan" filter to search lost items
2/ The table result must be consistent and a new "Not for loan" column
should be there
3/ Confirm that you are able to hide/show this column with the column
settings tool.

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

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-17 18:32:13 -03:00
4339291f44 Bug 20227: Check for categorycode in default_borrower_circ_rules
Fixes silent crash when adding the same category twice.
DBD::mysql::st execute failed: Duplicate entry 'ST' for key 'PRIMARY' [for Statement "
                INSERT INTO default_borrower_circ_rules
                    (categorycode, maxissueqty, maxonsiteissueqty, max_holds)
                    VALUES (?, ?, ?, ?)
            " with ParamValues: 0="ST", 1=undef, 2=undef, 3="3"] at /usr/share/koha/devclone/admin/smart-rules.pl line 309.

(Line number affected by bug 15524.)

Very trivial solution.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 14:05:18 -03:00
0ab22e1c7c Bug 18789: Send Koha::Patron object to the templates
In order to simplify and make uniform the code, the controller scripts send
a Koha::Patron object to the templates instead of all attributes of a patron.

That will make the code much more easier to maintain and will be less
error-prone.

The variable "patron" sent to the templates is supposed to represent the
patron the librarian is editing the detail.

In the members module and some scripts of the circulation module, the
patron's detail are sent one by one to the template. That leads to
frustration from developpers (making sure everything is passed from all
scripts) and to regression (we got tone of bugs in the last year because
of this way to do).
With this patch set it will be easy access patron's detail, passing only
1 variable from the controllers.

Test plan:
Play with the patron and circulation module and make sur the detail of
the patron you are editing/seeing info are correctly displayed.

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:03:58 -03:00
216b0cff0d Bug 20185: Remove warnings from aqplan.pl
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:03:58 -03:00
75a40acc39 Bug 20157: Save the features that have been checked
Previous patch forgot to modify the controller script to save the
changes.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-12 15:42:21 -03:00
a0919c3a29 Bug 20133: UI Changes
Add a checkbox to enable/disable the feature for given group of
libraries.

Important note: Only the top level node can turn the feature, the idea
is to avoid confusion, ease testing (by limiting the number of cases)
and force libraries to define one tree per feature (Maybe this is wrong,
but maybe good to start)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-12 15:41:43 -03:00
2059f7d801 Bug 16735: Migrate library search groups into the new hierarchical groups
Test Plan:
1) Apply this patch set
2) Note your existing search groups have been ported over to the new
   __SEARCH_GROUPS__ group if you had any
3) Create the group __SEARCH_GROUPS__ if one does not already exist
4) Add some first level subgroups to this group, add libraries to those groups
5) Search the library group searching in the intranet and opac
6) Note you get the same results as pre-patch

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-12 15:41:25 -03:00
f32cdb7211 Bug 15707: Display error if group title is already used
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit: I added !$branchcode && to the checked condition so we can add multiple
libraries back.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-12 15:41:19 -03:00
ee259d6140 Bug 15707: Add library groups editor
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-09 15:05:53 -03:00
Jenny Way
3f6a7933b8 Bug 19992: use Modern::Perl in Admin perl scripts
Test plan:
Check use warnings; use strict doesn't exist and use Modern::Perl is written instead in the following files:

admin/admin-home.pl
admin/aqcontract.pl
admin/aqplan.pl
admin/auth_tag_structure.pl
admin/branch_transfer_limits.pl
admin/check_budget_parent.pl
admin/check_parent_total.pl
admin/checkmarc.pl
admin/classsources.pl
admin/clone-rules.pl
admin/didyoumean.pl
admin/edi_accounts.pl
admin/edi_ean_accounts.pl
admin/import_export_framework.pl
admin/item_circulation_alerts.pl
admin/marctagstructure.pl
admin/matching-rules.pl
admin/printers.pl
admin/smart-rules.pl
admin/systempreferences.pl
admin/transport-cost-matrix.pl

Signed-off-by: Jon Knight <J.P.Knight@lboro.ac.uk>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-05 09:45:46 -03:00
Julian Maurice
8329eb174a Bug 19977: Open only .pref files in Local Use tab (sysprefs)
Test plan:
1. Open .../prog/en/modules/admin/preferences/circulation.pref
with vim (check that it creates a .circulation.pref.swp in the same
directory)
2. Go to the "Local Use" tab in admin/systempreferences.pl
3. Confirm that the page works normally

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-01-19 15:13:24 -03:00
9a2767b577 Bug 16764: Update printers administration page
This patch updates the template for printers administration according to
current interface guidelines.

- Custom JavaScript form validation is removed in favor of the built-in
  form validation plugin.
- Printer-specific header search form is removed, along with server-side
  pagination code. The functionality of both is now taken care of the
  adding DataTables sorting and pagination to the table.
- Edit and delete links are styled as Boostrap buttons with Font Awesome
  icons.
- Confirmation dialogs are updated to use Font Awesome icons.

To test properly you will need to add multiple printers.

- Apply the patch and open /cgi-bin/koha/admin/printers.pl (there is no
  menu link for the page).
- When no printers exist you should see a message dialog saying so.
- Add a new printer. Confirm that printer name and queue are required
  fields.
- After adding multiple printers, confirm that the table of printers is
  correctly sorted and searched by the DataTables plugin.
- Delete a printer and verify that the confirmation dialog is correctly
  styled.

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

Update: rebased and updated Bootstrap 3 classes

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-12-22 13:15:38 -03:00
Mark Tompsett
c1ea09f851 Bug 11976: Add Publication date to subscription table (opac) + column settings
This patch adds the column settings feature to the subscription list at
the OPAC.
It also adds a new column (Publication date) to this table

Using Home->Administration->Column Settings->OPAC->subscriptionst
the fields visibility can be toggled.

TEST PLAN
---------
1) Have a subscription where you have received at least once.
2) Look for it in OPAC and note the date is the received date, not the publication date
3) Apply patch
4) Log in to staff client
5) Home->Administration->Column Settings->OPAC->subscriptionst
6) Set visibility as desired.
7) Refresh OPAC page
   -- everything should be as expected.
8) run koha qa test tools.

Signed-off-by: David Bourgault <david.bourgault@inlibro.com>

Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-12-21 13:21:11 -03:00
5359488528 Bug 12227: Remove the demo functionality
This is a legacy mode that did not really work.

Test plan:
Play with frameworks and sysprefs and confirm the changes
(add/del/update) are taken into account.

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-12-11 11:34:20 -03:00
18f4a89ce6 Bug 19096: Do not allow changes to kohafield within MARC frameworks
This patch makes two changes in the script for managing the MARC
frameworks in order to support making the Default authoritative
as for Koha to MARC mappings:

[1] Disable the kohafield select combo. Add a hidden input to save value.
[2] When a new subfield is added, the kohafield is still empty and should
    be overwritten with its Default counterpart.
    Note: Although we could leave the field empty, since Koha looks at the
    Default framework only, it does not cost much to keep these fields in
    sync with Default and perhaps catch a bug when someone somewhere looks
    in the wrong framework.

Note: The description of Koha to MARC mapping on admin-home has been
adjusted accordingly (removing last two lines).

Test plan:
[1] Add a new tag and subfield in Default.
[2] Map it to a kohafield in koha2marclinks.pl
[3] Add the same tag and subfield in another framework.
    Verify that the kohafield is updated after you saved the subfield.

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-12-07 14:44:15 -03:00
590cae04fd Bug 19096: Make Default authoritative in core modules
After feedback from the dev mailing list, it seems appropriate here to
propose making the Default framework authoritative for Koha to MARC
mappings. This implies checking only the Default framework in the
routines:

[1] GetMarcFromKohaField: The parameter frameworkcode is removed. A
    follow-up report (19097) will update the calls not adjusted here.
    This is safe since the parameter is silently ignored.
[2] GetMarcSubfieldStructureFromKohaField: Framework parameter is removed
    and calls are adjusted. Includes acquisitions_stats.pl.
[3] TransformKohaToMarc: The parameter is removed; all calls are verified
    or adjusted.
[4] TransformMarcToKoha: The parameter is no longer used and will be
    removed in a follow-up report (19097). It always goes to Default now.
[5] TransformMarcToKohaOneField: The parameter is removed and all calls
    are adjusted. Including: Breeding, XISBN and MetadataRecord modules.
[6] C4::Koha::IsKohaFieldLinked: This routine was called only once (in
    C4::Items::_build_default_values_for_mod_marc. It can be replaced by
    calling GetMarcFromKohaField. If there is no kohafield linked, undef
    is returned. (Corresponding unit test is removed here.)
[7] C4::Items::ModItemFromMarc: The helper routine
    _build_default_values_for_mod_marc does no longer have a framework
    parameter. The cache key default_value_for_mod_marc- is no longer
    combined with a frameworkcode. Three admin scripts are adjusted
    accordingly; some tests will be corrected in the next patch.

Test plan:
See next patch. That patch adjusts all tests involved.

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-12-07 14:44:15 -03:00
2164fce41f Bug 10306: (QA follow-up) More feedback for admins in koha2marclinks
As requested by Tomas, this patch does:

[1] Add a js alert when you did not type field,subfield
[2] Print a yellow alert div when the field,subfield is not found.
[3] Bonus: Make it little bit more secure by demanding a POST. (Leaving
    CSRF etc. for another report.)

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-12-07 14:44:15 -03:00
9dfff3ab19 Bug 10306: Support for multiple mappings in koha2marclinks
This actually refactors koha2marclinks.pl in order to support multiple
mappings per kohafield.

Instead of three separate mapping pages for biblio, biblioitems and items,
the script now lists them together. This gives a complete overview of all
mappings rightaway. Changes are applied immediately across all frameworks.

Note: This report handles the Default mappings just like it did before.
In this script Koha already considered them as authoritative, although
other parts of Koha did not. Follow-up report 19096 makes Default
mappings authoritative throughout all Koha.

On each line two buttons are provided, Add and Remove, in order to add or
remove an individual mapping. We do no longer provide a separate form with
the names of MARC tags. Since this form is targeted for administrators,
it should be enough to ask for a field tag and subfield code.

Note: The mappings for biblionumber, biblioitemnumber and itemnumber are
so vital that this form marks them as readonly. It is not recommended to
change them.

Test plan:
[1] Add a mapping. Verify via Frameworks or mysql command line that the
    kohafield is saved to the other frameworks too.
[2] Remove the mapping again. Check Frameworks or mysql cl again.
[3] Test adding a second mapping. Map copyrightdate to 260c and 264c.
    And map biblioitems.place to 260a and 264a.
[4] Edit biblio record 1: Put 1980 in 260c. Do not include 264c.
    Edit biblio record 2: Put 1990 in 264c. Do not include 260c.
    Edit biblio record 3: Put 2000 in both 260c and 264c. Put CityA in 260a
    and in 264a.
    Edit biblio record 4: Put 2010 in 260c, and 2015 in 264c (which you
    should refuse normally). Put CityA in 260a, and CityB in 264a.
[5] Create a report that shows biblioitems.place and biblio.copyrightdate
    for those biblio records.
    Record 4 should have 2010 in copyrightdate (since TransformMarcToKoha
    picks the first year for copyrightdate).
    Record 3 should have place CityA; record 4 should have CityA | CityB.
    Note: The CityA | CityB example illustrates that we should add some
    additional handling in TransformMarcToKoha for multiple 264s.
[6] Add these four biblio records to a new list. Sort by Year.
    With OPACXSLTListsDisplay==default, check if the order = 1,2,3,4.
    (The order is based on biblio.copyrightdate.)
    Note that (RDA) record 2 would be on top without this patch set, since
    copyrightdate would have been null.

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-12-07 14:44:15 -03:00
490ec51af6 Bug 19481: Set default sort options as sortable in ES default mappings
To test:
1 - Setup Koha with ES
2 - perform a search
3 - try sorting by pubdate, acqdate, popularity, or title
4 - Search fails!
5 - Apply patch
6 - visit:
/cgi-bin/koha/admin/searchengine/elasticsearch/mappings.pl?op=reset&i_know_what_i_am_doing=1
7 - Re-index ES
8 - Perform search
9 - All sorting options should work

Signed-off-by: David Bourgault <david.bourgault@inlibro.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-11-26 12:59:51 -03:00
9daf668ca3 Bug 14919: Remove notificationdate and reminderdate
These columns are not used, we do not need to display them

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-10-27 16:05:51 -03:00
4fa34acc41 Bug 14919: Add holds history for patron
Test plan:
0) Have a patron with some current and old reserves
1) Go to patron circulation page
2) Notice, there is new item called "Holds history" in the left
circulation menu
3) Go to this page and confirm the data on this page are OK, and that
ui does behave as expected
4) Go to adminitration, columns setting, try to change the setting for
holdshistory table and confirm it is taken into account on holds history
page

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

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-10-27 16:05:02 -03:00
088cdcda5f Bug 16660: Add support for OpacSuppression to Elasticsearch
To test:
1 - Enable suppression
2 - Suppress some records
3 - Apply all the patches
4 - Reindex ES
5 - Search and don't get suppressed records
6 - Disable suppression
7 - Search and get all the records

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-10-27 14:09:02 -03:00
cffc99cbe5 Bug 19038: QA Followup - Hide barcode column by default (as syspref default is hide)
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-10-25 16:12:53 -03:00
662a98345a Bug 19028: Add 'shelving location' to holdings table in detail page
This patch adds the option to show shelving locations on a separate
column. This is controlled by a new syspref, 'OpacLocationOnDetail',
which replaces 'OpacLocationBranchToDisplayShelving', adding a
conveniente 'column' option.

The new 'Shelving location' column is conveniently added to the columns
configuration entry added by bug 16759 for this purpose.

The current behaviour is preserved.

To test:
- Apply this patches
- Run the upgrade:
  $ sudo koha-shell kohadev
 k$ cd kohaclone
 k$ perl installer/data/mysql/updatedatabase.pl
=> SUCCESS: Upgrade doesn't fail
- Have an item with shelving location set to something not void
- Have the item set home and holding libraries for testing purposes.
- Set 'OpacLocationBranchToDisplay' to 'home and holding libraries' [*]
- Visit the OPAC detail page for the record containing the item
=> SUCCESS: Both home and holding libraries are displayed.
- Loop through all OpacLocationOnDetail options (except from 'column', we leave it for later).
=> SUCCESS: Works as expected.
- Go to Administration > Columns settings
- Make item_shelving_location available in the OPAC section
- Reload the OPAC detail page
=> SUCCESS: No change
- Set OpacLocationOnDetail to 'on a separate column'
- Reload the OPAC detail page
=> SUCCESS: Shelving location is displayed on a separate column
- Sign off :-D

Sponsored-by: Dover

[*] For testing purposes

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-10-25 12:14:41 -03:00
92f6f5b049 Bug 16759: Make OPAC holdings table configurable
This patch makes the holdings table in the OPAC biblio detail page
configurable using the Columns configuration tools.

This patch:
- Moves the holdingst table from plain DataTable to KohaTable
- Creates a sample yml colvis configuration for this table
  containing all the currently available columns

To test:
- Visit some record's detail page in the OPAC
- Apply this patch
- Reload
=> SUCCESS: The page shows the same information
- On the staff interface, go to:
  Home > Administration > Columns settings
=> SUCCESS: There's a new OPAC section containing the configuration for
   holdingst.
- Choose to hide some fields (both currently displayed and currently hidden).
- Reload the OPAC detail page
=> SUCCESS:
   - Required fields are hidden
   - It doesn't explode because of trying to hide stuff that is not there to start with
- Sign off :-D

Sponsored-by: DOVER

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

Followed test plan, patch worked as described. Also passed QA test tool

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-10-25 12:14:40 -03:00
charles
4b6c9178c4 Bug 12768: Replacement cost and processing fee management
Signed-off-by: Eivin Giske Skaaren <eivin@sysmystic.com>

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-10-20 17:14:33 -03:00
Marc Véron
7211fd22ba Bug 19328: Internal server error because of missing currency
This patch fixes internal server errors because of missing active currency
in files aqbudgetperiods.pl, aqbudgets.pl and aqplan.pl.

To reproduce:
- Make sure that no active currency is defined. You can undefine the active
  currency in Administration->Currencies and exchange rates
- Try to go to Administration->Budgets and Admistration->Funds
Result: Internal server error

To test:
- Apply patch
- Restart plack
- Try to reproduce issue, it should no longer occur. There should be a
  yellow message box "No active currency is defined"
- From Administration-> Budgets administration try to edit a fund and go to
  "Planning". Verify that the message box appears here as well.

Signed-off-by: David Bourgault <david.bourgault@inlibro.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-10-11 13:05:31 -03:00
e2d56c0b2b Bug 10132: Admin pages changes
Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-09-19 09:47:27 -03:00
Aleisha Amohia
0ed469525f Bug 18351: Able to delete budget with funds
To test:
1) Create a budget, add a fund
2) Delete budget. Notice this is successful and triggers no warning
message etc.
3) Go to Funds. Notice the funds appear as if they are not there
4) Go into mysql and view the aqbudgetperiods table - notice the funds
are still there and are now inaccessible.
5) Apply patch
6) Create a budget, add a fund
7) Attempt to delete budget. Notice you can't click Delete button.
Confirm number of funds in hover message is correct.
8) Delete fund
9) Confirm you can now delete budget.

Sponsored-by: Catalyst IT

Signed-off-by: Felix Hemme <felix.hemme@thulb.uni-jena.de>

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

Bug 18351: [FOLLOW-UP] Some code fixes

See Comment 5. Ready to test.

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>

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

Bug 18351: [FOLLOW-UP] Code fix

See comment 10.
Ready for testing.

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

Bug 18351: [FOLLOW-UP] Prevent deletion from forcing URL

This patch adds a check in the script for existing funds so that the
budget cannot be deleted when forcing the URL and has other small fixes.

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

Bug 18351: [FOLLOW-UP] Prevent deletion if funds are added after clicking 'Delete' and before confirming delete

Followed test plan and patch works as described.

Signed-off-by: Dilan Johnpullé <dilan@calyx.net.au>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-09-12 11:28:53 -03:00
3aeb1fc7e8 Bug 19256: Make Koha::Acq::Order using Koha::Object
At the moment we have 2 different modules for acquisition orders:
Koha::Tmp::Order[s] and Koha::Acquisition::Order
The later has been added before the creation of Koha::Object.
Koha::Tmp::Order[s] has been created to make the TT syntax for notices
works with acquisition order data.

This patch removes the temporary packages Koha::Tmp::Order[s] and adapt
the code of Koha::Acquisition::Order[s] to be based on Koha::Object[s].

It also overloads Koha::Object->new to add the trick that was done in
Koha::Acquisition::Order->insert. This is needed because acqui/addorder.pl
is called from several places and CGI->Vars is used to retrieved order's
attributes (and so much more). To avoid regression, the easiest (but not
cleanest) way to do is to filter on aqorders column's names.
This is *not* a pattern to follow!

Test plan:
Create basket and add orders from different ways, then continue a whole
acquisition process

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-09-07 15:03:04 -03:00
19a7b498e1 Bug 18906: Display all funds the logged in user can use
There are complex conditions to know if a librarian can use a fund, we
cannot do that with a SQL query, we need to use C4::Budgets::CanUserUseBudget

When this patch is applied then all funds are visible to both
superlibrarian patrons and patrons with all acq permissions

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-08-09 16:51:40 -03:00
9f47bd8825 Bug 18854: Protect few other occurrences of offset
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-07-14 12:02:04 -03:00
Aleisha Amohia
88ab0ef579 Bug 18934: Preventing warns in Admin -> SMS providers
This patch initialises the $op variable to prevent the warns

To test:
1) Go to admin -> sms providers
2) Notice warns in error log
3) Apply patch and refresh page
4) Notice warns are gone

Sponsored-by: Catalyst IT

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-07-13 18:26:22 -03:00
2b90ea2cb0 Bug 17829: Move GetMember to Koha::Patron
GetMember returned a patron given a borrowernumber, cardnumber or
userid.
All of these 3 attributes are defined as a unique key at the DB level
and so we can use Koha::Patrons->find to replace this subroutine.
Additionaly GetMember set category_type and description.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-07-10 13:14:19 -03:00
6d76f61a6b Bug 17944: QA follow-up
- Remove an unused use statement
- Fix pod
- Use snake_case
- Fix test "An itemtype cannot be deleted if and only if there is
biblioitem linked with it"

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: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-06-05 11:59:11 -03:00
db3ebe47e8 Bug 17944 - Add Koha::ItemType->can_be_deleted and use it from admin/itemtypes.pl
Removed the sql code from Itemtypes.pm and replaced  it with DBIx
database query in the itemtypes.pl administrative script

Test plan:
1. In the staff interface, stage and manage MARC records for import

2. Try to delete an itemtype. If there are items of that itemtype in the
   database then a message telling you the number of items of that
   itemtype there are will be displayed.

3. Record that number

4. View the admin/itemtpes.pl script and confirm that there is sql code
   written in this file.

5. Apply this patch

6. View the admin/itemtypes.pl script and observe that there is no sql
   in this file. There is however DBIx code, for example
   $schema->resultset('Item')->search({ 'itype' => $itemtype_code} );
   which is searching for items with the itype value matching
   $itemtype_code value.

7. In the staff interface try to delete the same itemtype

8. Record the number of items there are with that itemtype in the
   resulting message

9. The numbers recorded in steps 3 and 8 should match showing that the
   DBIx code is working as intended

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: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-06-05 11:59:10 -03:00
a80366439e Bug 18632: Remove 'CGI::param called in list context' warnings
Once again, after bug 16154 and bug 16259 we need to remove more
occurrence of CGi->param called in list context.
Refer to bug 15809 for more information.

Test plan:
Make sure you do not see the error on the modified scripts.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2017-05-28 22:25:22 -04:00
f0eda04ddf Bug 18662: Fix currency deletion
Sounds like it is caused by bug 13726.
It is not possible to delete a currency, even if not used by any vendors

Test plan:
Try and delete currencies used or not by vendors.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2017-05-28 22:01:39 -04:00
285dd88356 Bug 18376: Do not need to prepare a single statement, use do
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2017-05-19 09:53:14 -04:00
6a82ff4b89 Bug 18376 - authority framework creation fails under Plack
With plack, when creating a new authority framework from another, you get the error :
Can't call method "prepare" on an undefined value at (...)/src/admin/auth_tag_structure.pl line 267.

Looks like plack does not like when the var $dbh from the script is called inside a sub.

This patch adds a local var $dbh inside sub duplicate_auth_framework(), like in sub StringSearch().

Also correctes a redefine of my $sth.

Test plan:
- Go to Administration > Authority types
- Create a new type
- On this new type click on Actions > MARC Structure
- Select another type and click OK
=> You must get a table filled with the tag structure
Check with and without plack
You may not be able to reproduce the error with plack.

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2017-05-19 09:53:14 -04:00
56bbec4a4e Bug 18299 - Removed unused env_tz_test.pl based on user testing feedback
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2017-05-08 09:24:07 -04:00
d3e459289f Bug 16344: Add a circ rule to limit the auto renewals given a specific
This patch adds a new circulation rule (no_auto_renewal_after_hard_limit) to block/allow
auto renewals after a given date.
The idea is to stop renewals at a given date. That way the library will have
time to send overdues and get the books back before the students do on holiday.

Test plan:
0/ Execute the update DB entry
1/ Define a rule with no_auto_renewal_after_hard_limit set to tomorrow
2/ Modify the issues.issuedate, to simulate a checkout in the past:
    UPDATE issues
    SET issuedate = "yyyy-mm-dd hh:mm:ss"
    WHERE itemnumber = YOUR_ITEMNUMBER;
with issuedate = 2 days before for instance
3/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl)
Confirm that the issue has been renewed
4/ Modify the no_auto_renewal_after_hard_limit and set it to yesterday
5/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl)
Confirm that the issue has not been renewed

Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Signed-off-by: Janet McGowan <janet.mcgowan@ptfs-europe.com>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2017-04-28 09:15:21 -04:00
8d5b4306e0 Bug 17835: Replace GetItemTypes with Koha::ItemTypes
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Lari Taskula <lari.taskula@jns.fi>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2017-04-14 10:43:51 -04:00
476179a123 Bug 17872: Fix small error in GetBudgetHierarchy and one of its calls
In aqbudgetperiods.pl a commented line is removed that contains a
wrong userenv hash key. Should be branch instead of branchcode.

In aqbudgets GetBudgetHierarchy is called with the same wrong userenv
hash key. Should be userenv->{branch}.
This made another bug visible: if you call GetBudgetHierarchy with a
branch and without owner, the where clause should take into account
that the branchcode can be empty (not null).

Test plan:
[1] Run Budgets.t
[2] Run aqbudgets.pl from Administration
[3] Add the show_mine=1 parameter in the URL
[4] Change owner of one of the funds and repeat step 2 and 3.

t/Budgets.t returns green. 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>
2017-04-13 08:34:15 -04:00
Christopher Brannon
9098a4d3fa Bug 17346: Make checkin column hidable
To test:
1) Go to columns_settings.pl --> Circulation --> issues-table and note that you cannot change the settings for checkin.
2) Go to columns_settings.pl --> Patrons --> issues-table and note that you cannot change the settings for checkin.
3) Apply the patch.
4) Go to both tables again and note that you can now change the settings.

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>
2017-03-31 13:24:02 +00:00
afe3fa1d07 Bug 18269: Move field mappings related code to Koha::FieldMapping[s]
The 3 subroutines GetFieldMapping, SetFieldMapping and
DeleteFieldMapping from the C4::Biblio module were only used from the
field mappings admin page.
They can easily replaced with new packages Koha::FieldMappings based on
Koha::Object[s]

Test plan:
Add and delete field mappings (admin/fieldmapping.pl, Home ›
Administration › Keyword to MARC mapping).
Add an existing mapping > Nothing should be added

Note that this page has not been rewritten and you will not get any
feedbacks, but it's not the goal of this page to improve it.

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2017-03-31 10:20:00 +00:00