Commit graph

31404 commits

Author SHA1 Message Date
42ed26660b Bug 20074: Fix hidden value in auth_subfields_structure
The template included an else branch where a value not equal to 0 or -5
was interpreted as 0 (Show all).
This effectively converted hidden values 1 and 8 to 0.
This patch removes that else branch.

Test plan:
Toggle a authority field between Hide all and Show all. Check what happens.

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-26 12:11:29 -03:00
45bb8a8225 Bug 19823: Move template JavaScript to the footer: MARC21 editor plugins
This patch modifies the templates for MARC21 editor plugins so that
JavaScript is included in the footer.

To test, you must link the plugins to their corresponding tag +
subfield (if they aren't already):

In a bibliographic framework:

000 -> marc21_leader.pl
006 -> marc21_field_006.pl
007 -> marc21_field_007.pl
008 -> marc21_field_008.pl
773$t -> marc21_linking_section.tt

In an authorities framework:

000 -> marc21_leader_authorities.tt
008 -> marc21_field_008_authorities.tt
    -> marc21_field_008_classifications.tt

For each field, trigger the plugin by clicking the plugin link. Test
JavaScript-driven functionality in each plugin window and confirm that
your selections are correctly saved to the editor.

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>

Edit: Fix for QA, add KOHA_VERSION variables to js includes

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-23 10:59:12 -03:00
3d2e91a573 Bug 19754: Move template JavaScript to the footer: Acquisitions, part 2
This patch modifies some staff client acquisitions templates so that
JavaScript is included in the footer instead of the header.

To test, apply the patch and test the JavaScript-driven features of the
modified templates: All button controls, DataTables functionality, tabs,
etc.

- Acquisitions -> Invoices
  - Datepickers
  - Search for invoices
    - Datatable
- Acquisitions -> Late orders
  - Datepickers, datatables, selection controls (when searching by
    vendor)
- Acquisitions -> Vendor -> Basket -> Add to basket -> From an existing
  record -> Search
  - Datatables, View MARC modal
- Acquisitions -> Vendor -> Basket -> Add to basket -> From a new
  (empty) record
  - Form validation, inactive fund control, add users to notify on
    receiving.
- Acquisitions -> Vendor -> Basket -> Add to basket -> From a
  subscription -> Search
  - Datatables, show only renewed, show/hide search form
- Acquisitions -> Vendor -> Basket -> Add to basket -> From a suggestion
  - Datatables, "Show" controls
- Acquisitions
  - "Ordered" link in table of funds
    - Datatables
- Acquisitions -> Vendor -> Receive shipment -> Invoice -> Receive
  - Datepickers, item add form plugins (test with AcqCreateItem set to
    'receiving an order.'

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-23 10:58:09 -03:00
efa894e625 Bug 12001: (QA follow-up) Fix showing links to items on boraccount page
Test plan:
Go to the Fines -> Account page of a patron with fees linked to items
--> without patch there is no link to related item
--> with patch the link is presented in description column

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-23 10:57:30 -03:00
d81f371e2d Bug 12001: (QA follow-up) Fix patron account summary print
Test plan:
Try to print patron account summary
--> without patch it explodes
--> with patch it works, and if there is a fee related to item, the title should be printed out

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-23 10:57:30 -03:00
0e83779f2f Bug 12001: (QA follow-up) Add test for Koha::Account::Lines object
Test plan
prove t/db_dependent/Koha/Account/Lines.t
--> should be green

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-23 10:57:30 -03:00
1d9245d7b2 Bug 12001: (QA follow-up) Fix printinvoice page
Test plan:
Try to print a fee
--> without patch it explodes
--> with patch it works and the date is formatted according to
system wide date format setting

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-23 10:57:30 -03:00
2410aaca23 Bug 12001: (QA follow-up) Explicit return
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-23 10:57:30 -03:00
dcd495de24 Bug 12001: Format DEBT correctly
Before this patchset, DEBT was formatted in the module, now it should be
done template-side.

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-23 10:57:30 -03:00
4e479921bf Bug 12001: Prove that result are the same \o/
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-23 10:57:30 -03:00
6355791848 Bug 12001: Move GetMemberAccountBalance to Koha::Account->non_issues_charges
As said previously, GetMemberAccountBalance returns ( the balance, the
non issues charges, the other charges)

The other charges are the balance - the non issues charges.

In this patch we remove the subroutine from C4::Members and use the
new Koha::Account->non_issues_charges subroutine instead

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-23 10:57:30 -03:00
d9558f7786 Bug 12001: Add tests
Yes, we need tests to make sure we understand what is going on in this
subroutine.
The different combination of HoldsInNoissuesCharge,
RentalsInNoissuesCharge and ManInvInNoissuesCharge are tested here with
the subroutine we are going to remove (GetMemberAccountBalance).
In one of the next patches the new methods will be used to make sure we
are not modifying the calculated values (except the formatting).

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-23 10:57:30 -03:00
51aa6db46c Bug 12001: Move GetMemberAccountRecords to the Koha namespace
The GetMemberAccountRecords may be a perf killer, it retrieves all the
account lines of a patron and then the related item and biblio
information.
Most of the time we only want to know how much the patron owns to the
library (sum of amountoutstanding). We already have this information in
Koha::Patron->account->balance.

This patch replaces the occurrences of this subroutine by fetching only
the information we need, either the balance, the detail, or both.
It removes the formatting done in the module, to use the TT plugin
'Price' instead.
There is a very weird and error-prone behavior/feature in
GetMemberAccountBalance (FIXME): as the accountlines.accounttype is a
varchar(5), the value of the authorised value used for the
ManInvInNoissuesCharge pref (category MANUAL_INV) is truncated to the 5
first characters. That could lead to unexpected behaviors.

On the way, this patchset also replace the GetMemberAccountBalance
subroutine, which returns the balance, the non issues charges and the
other charges. We only need to have the balance and the non issues
charges to calcul the third one.

Test plan:
Add several fees for a patron and play with HoldsInNoissuesCharge,
RentalsInNoissuesCharge and ManInvInNoissuesCharge.
The information (biblio and item info, as well as the account line) must
be correctly displayed on the different screens: 'Fines' module, fine
slips, circulation module

Note that this patchset could introduce regression on price formatting,
but will be easy to fix using the TT plugin.

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-23 10:57:30 -03:00
4609e95f9d Bug 20240: Remove space before : when searching for a vendor in serials (Vendor name :)
This patch removes the space before the colon in the "vendor" label in
the vendor search pop-up window.

To test, apply the patch and go to Serials -> New subscription.

- Click the "Search for a vendor" link next to the vendor form field.
- In the pop-up window, confirm that there is no space before the colon
  in the "vendor" label.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-23 10:57:15 -03:00
ca32f93657 Bug 20239: Fix spelling on authority linker plugin
This patch corrects the capitalization of the "Choose" link in the
pop-up window for selecting an authority record to link to a MARC field.

This patch also converts the link, and the "Edit authority" link, to
Bootstrap buttons.

To test:
- Create a new record
- Go to the 100 field
- Click on plugin link behind $a
- Look for an existing authoriy in your system
- In the table of search results, confirm that the "Choose" and "Edit
  authority" links look correct and work correctly.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-23 10:57:04 -03:00
Mirko Tietgen
f1b6feb20f Bug 20061: koha-common is not pulling libsearch-elasticsearch-perl / d/control
update debian/control. this file is auto generated. no testing required.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-23 10:49:42 -03:00
Mirko Tietgen
78cd06a0f6 Bug 20061: koha-common is not pulling libsearch-elasticsearch-perl
Adds Search::Elasticsearch to Perldependencies.pm

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-23 10:49:42 -03:00
fc02e92d10 Bug 7143: Update about page for new dev - Pongtawat Chippimolchai
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-20 14:14:56 -03:00
673a40d2ac Bug 20250: (bug 19529 follow-up) Prevent NoIssuesChargeGuarantees.t to fail randomly
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-19 17:40:06 -03:00
Charles Farmer
29539307e9 Bug 20249: (bug 18789 follow-up) "Patron has no outstanding fines" now appears alongside fines
Test plan:
    1) Choose two patrons from your database, one who has fines, and the other who does not
    2) Visit their 'Fines' page, and click on the 'Pay fines' tab
        2.1) If they don't have any fines, you'll only see a blank row
        2.2) If they do have fines, the payment form will appear, but the text "... no outstanding fines" will also appear
    3) Apply patch
    4) Visit once again the 'Pay fines' tab of your patrons
        4.1) Now, "... no outstanding fines" will appear for the right situation

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-19 17:22:59 -03:00
Pongtawat C
b7219cf43c Bug 18913: Allow symbolic link in /etc/koha/sites
This patch makes the koha-* scripts follow symbolic links when querying for
Koha instances. Without it, it is not possible to define instances outside the
/etc/koha/sites directory,

To test:
- Create a symlink in /etc/koha/sites:
  $ sudo ln -s /tmp /etc/koha/sites/test
- Test the original is_instance function:
  $ . /usr/share/koha/bin/koha-functions.sh
  $ is_instance test && echo success || echo failure
=> FAIL: symlinks are not considered instance names (i.e. failure is printed)
- Apply this patch
- Update the koha-functions.sh file:
  $ perl misc4dev/cp_debian_files.pl
- Test is_instance again:
  $ . /usr/share/koha/bin/koha-functions.sh
  $ is_instance test && echo success || echo failure
=> SUCCESS: symlinks are considered instance names (i.e. success is printed)
- Sign off :-D

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-19 16:41:00 -03:00
e7d4c773be Bug 19290: DBRev 17.12.00.018
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-19 16:17:54 -03:00
c9a7b6742b Bug 19290: Browse selected bibliographic records - Staff interface
This patch adds the same feature as bug 10858 for the OPAC interface:
after a search, librarians will be able to browse selected results.
The results can be selected from several pages.
By extension it is possible to add results from several pages to a list
or the cart.

When at least one result is selected, a new "Browse selected records" button
becomes usable and change the behaviour of the existing browser.

The whole feature can be turned off with the pref BrowseResultSelection.

Test plan:
- Launch a search (on the staff interface)
- Check some biblios
- Go on another page
- Check some biblios
- Come back to a page you already check results and confirm that they are
still checked
- Click on the "Browse selected records" button
- Check that you are able to browse results you had checked.

You can also:
- add them to the cart
- add them to a list

QA note: the browsers at the OPAC and the one at the staff interface are completely different
That's why the code is not mimicking what has been done on bug 10858.
The behaviour must stay the same anyway.

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-19 16:13:30 -03:00
af1a8c5a78 Bug 18336: (follow-up) Shift TINYTEXT columns
This patch fixes two errors that slipped in the patchset.

To test:
- Create a dummy branch for testing:
  $ cd kohaclone
  $ git fetch
  $ git checkout v17.11.00 -b dummy
- Reset your working DB
  $ reset_all (y)
- Set your branch to current master
  $ git reset --hard origin/master
- Update the DB
  $ updatedatabase
- Update the schema files
  $ kshell
 k$ misc/devel/update_dbix_class_files.pl \
       --db_name koha_kohadev \
       --db_user koha_kohadev \
       --db_passwd password
 k$ exit
  $ git diff
=> FAIL: There are discrepancies on upgrades
- Reset to v17.11.00 revision and DB:
  $ git reset --hard v17.11.00
  $ reset_all (y)
- Set your branch to current master
  $ git reset --hard origin/master
- Apply this patch
- Update the DB
  $ updatedatabase
- Update the schema files
  $ kshell
 k$ misc/devel/update_dbix_class_files.pl \
       --db_name koha_kohadev \
       --db_user koha_kohadev \
       --db_passwd password
 k$ exit
  $ git diff
=> SUCCESS: No discrepancies!
- Reset to HEAD to get rid of the schema changes
  $ git reset --hard HEAD
- Regenerate the schema files on top of this patch
  $ dbic ; cd /home/vagrant/kohaclone
  $ git diff
=> SUCCESS: No discrepancies!
- Sign off :-D

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-19 11:56:28 -03:00
b86a9ee984 Bug 20037: Switch single-column templates to Bootstrap grid: Serials
This patch updates several single-column Serials module templates to
use the Bootstrap grid. In addition to grid changes, some templates have
been modified to include the footer with the correct popup parameter.

- serials\acqui-search.tt - Go to Serials -> New subscription. Click
  "Search for a vendor."

- serials\acqui-search-result.tt - Vendor search results

- serials\result.tt - Click "Search for record."

- serials\subscription-bib-search.tt - Catalog search results.

Each of these pages should look correct.

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>

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:48 -03:00
3eb50270b1 Bug 19981: Switch single-column templates to Bootstrap grid: Course reserves
This patch updates three single-column course reserves templates to use
the Bootstrap grid:

- course-reserves.tt - The main Course Reserves page
- course-details.tt - The detail view of an individual course
- course.tt - Editing a course
- add_items-step1.tt - Adding items to a course, step 1 (scan barcode)
- add_items-step2.tt - Adding items to a course, step 2
- invalid-course.tt - The error page shown if you try to view
  course_reserves/course-details.pl directly without passing a course id
  in the URL
  - Also changed in this template: Error message has been wrapped in the
    standard "dialog alert" <div>.

Each of these pages should look correct, with a single centered column
with wide margins on either side. At lower browser widths the margins
should disappear.

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>

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:48 -03:00
a418f73cf5 Bug 19954: Update popup window templates to use Bootstrap grid: Patrons
This patch updates two patron-related templates to use the
Bootstrap grid instead of the YUI grid.

This patch also corrects an unrelated error in update-child.tt where
some JS variable declarations required by members-menu.js were
missing.

To test you must have more than one adult-type patron category defined.

- Locate and view a child-type patron record.
- From the "More" menu in the toolbar, choose "Update child to adult
  patron."
  - The popup window which appears should look correct and work
    correctly.
  - The table of patron categories should be sortable.
- Add a new patron and enter the first and last names of an existing
  patron.
  - When Koha asks to confirm a possible duplicate record, click the
    "View existing record" link. The popup which is triggered should
    look correct.

Signed-off-by: Zoe Bennett <zoebennett1308@gmail.com>
Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>

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:47 -03:00
466c46f4f6 Bug 19939: Move cataloging Z39.50 results actions into menu
This patch modifies the template which displays cataloging Z39.50
search results so that the "MARC," "Card," and "Import" links are moved
out of separate table cells and into one menu.

The old menu which would appear when any table cell is clicked has been
removed, and code added to display the same Bootstrap menu if a table
cell is clicked.

To test, apply the patch and go to Cataloging -> New from Z39.50/SRU.

- Perform a Z39.50 search which will return more than one result.
- Confirm that clicking the "Actions" button triggers a drop-down menu.
  - Confirm that the links in the menu trigger actions for the correct
    bibliographic record.
- Confirm that clicking any other table cell in the table of results
  will trigger the display of the same menu.
  - Confirm that this menu works correctly for the correct record.

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>

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:46 -03:00
22ab693c76 Bug 19837: Add error feedback for duplicated or unfound cardnumbers
To test:
1 - Enter some patrons on a list
2 - 'Enter multiple cardnumbers'
3 - Make sure to add some that are already in list, some that don't
    exist, and some new patrons
4 - Verify results are as expected with warnings

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

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:46 -03:00
d63cd0efbb Bug 19837: Add multiple patrons to a list by barcode
This patch adds the interface change and basic functionality for an
option to add multiple patrons to a patron list by scanning barcodes.

To test, apply the patch and go to Tools -> Patron lists.

- Create a patron list if necessary, and got to the "Add patrons"
  screen.
- Test the process for adding patrons using the "Patron search" text
  input.
- Test the process for adding patrons using the "Enter multiple card
  numbers" option.

This should really have some error-handling added to it: Onscreen
messages when a non-existing patron card number is submitted or when a
patron already exists on the list.

Signed-off-by: Nick Clemens <nick@bywatersolutions.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:45 -03:00
e5e150440b Bug 19785: Replace intranet-tmpl with [% interface %]
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-18 16:48:44 -03:00
ac6869eed1 Bug 19785: Move template JavaScript to the footer: Authorities, part 1
This patch modifies even more staff client authorities templates so
that JavaScript is included in the footer instead of the header.

To test, apply the patch and test the JavaScript-driven features of the
modified templates: All button controls, DataTables functionality, tabs,
etc.

 - Authorities
   - New from Z39.50
   -> Search
      -> Results
         - New from Z39.50
         - Deletion confirmation
         - Merge records -> Merge
           - Tabs
           - Tag selection
         -> Authority detail
            - Tabs
            - Deletion confirmation
            - New from Z39.50

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>

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:44 -03:00
00bfa63dc7 Bug 17672: DBRev 17.12.00.017
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-18 16:48:44 -03:00
5977dedb94 Bug 17672: DBIC Schema changes
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-18 16:48:44 -03:00
charles
30f6f17664 Bug 17672: Fixing Items.t expected tests from 12 to 13
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
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
90e0c0de5c Bug 20148: Prevent adding same user multiple times to an order
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-18 16:48:42 -03:00
Pasi Kallinen
53e8b8cbe0 Bug 20148: Prevent adding same user multiple times to acq basket
When adding a user to manage acquisitions basket, it is possible
to add the same user multiple times. Prevent that.

Test plan:

1) Go to Home -> Acquisitions -> [bookseller] -> [basket]
2) On the "Add user" in the Managed by-part, and try adding
   the same user multiple times.
3) Apply patch
4) Repeat 1 and 2. You should now get an error message saying
   the user is already in the list.

Signed-off-by: Pasi Kallinen <pasi.kallinen@joensuu.fi>
Signed-off-by: Roch D'Amour <roch.damour@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 14:48:43 -03:00
138afb693e Bug 20222: Make bread crumb for cleanborrowers.pl match the link text in tools-home.pl
This patch revises the breadcrumbs in the template for batch patron
deletion / anonymization so that they match the text used in the tools
menu and on Tools home.

To test, apply the patch and go through a batch patron anonymization
process. At each step the breadcrumbs should read "Batch patron
deletion/anonymization" instead of "clean patron records."

Signed-off-by: Roch D'Amour <roch.damour@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 14:48:35 -03:00
58b5c925cc Bug 19452: Remove the truncate option
The truncate option is not really useful. Its result is probably not what
most users of this script expect or need.
It truncates both tables borrower_message_preferences and
borrower_message_transport_preferences. This (unfortunately) includes
deleting messaging preferences for patron categories. After that, adding
preferences again will not add categories again, but only borrower
preferences which are all disabled.

Furthermore, we do not need to disable the foreign key check. Neither
do we actually need to truncate, deleting records seems sufficient.
Also deleting transport preferences is not needed, since it will be
done by a cascade from messaging preferences. Note that the subsequent
call of SetMessagingPreferencesFromDefaults will already delete the
records.

This makes it possible to remove the truncate option altogether.

Test plan:
[1] Select a patron category (say ST) and change days_in_advance to x.
[2] Select a ST patron and set days_advance to y in his msg prefs.
[3] Run borrowers-force-messaging-defaults.pl -doit
[4] Verify that the patron has been reset to the default prefs (incl.
    value x in days_in_advance).
[5] Verify that the patron category prefs are still intact.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-18 14:48:25 -03:00
744e9a0379 Bug 20145: Do not insert 0000-00-00 in patron tests (and more)
We should call Koha::Patron->is_expired in CanBookBeIssued instead of
doing the same calculation.

Tests have been adapted to pass with new SQL modes.

We should not need to update the values in DB, we already have
  Bug 14717: Prevent 0000-00-00 dates in patron data (3.21.00.023)

Test plan:
  prove t/db_dependent/Circulation/dateexpiry.t
  prove t/db_dependent/Koha/Patrons.t
must return green

Signed-off-by: Roch D'Amour <roch.damour@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 14:48:05 -03:00
69e51d729f Bug 19978: Fix ITEMTYPECAT behaviour
ITEMTYPECAT permits to group and hide item types at the OPAC (see bug
10937 for a complete description).

Since commit 091d6c513b
    Bug 17843: Replace C4::Koha::getitemtypeinfo with Koha::ItemTypes
the code assume that they are item types. Before it just assigned undef
to the description.

Test plan:
Create ITEMTYPECAT authorised values
Assign an item type to this authorised value group
Search for a item using this item type at the OPAC
Without this patch applied you get:
Can't call method "translated_description" on an undefined value at
/home/vagrant/kohaclone/opac/opac-search.pl line 231.

With this patch applied the search result is displayed.

Make sure the original feature still works.

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-18 14:47:57 -03:00
208f102125 Bug 18975: Retrieve up-to-date CGISESSID when just logged in
If a user is asked to login before sending a card, the wrong (old)
CGISESSID cookie is used.
We need to retrieve the one that has just been created.

This will certainly need more work, I guess other scripts are affected
too.

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-18 14:47:42 -03:00
Katrin Fischer
549b8fe787 Bug 9573: (QA follow-up) Add missing include back
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:45:13 -03:00
b76ee62eed Bug 9573: Add missing KOHA_VERSION in js paths
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
618b15a569 Bug 9573: Add missing use statement
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
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
8b5b1a0358 Bug 9573: (follow-up) Lost items report - add KohaTable to itemlost
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
abbd0eeea9 Bug 9573: Lost items report - Add the CSV export ability
Finally we add the ability to export the list of lost items.
The items will be export in CSV format using a CSV profile defined.

Test plan:
0/ Apply all the patches from this patch set
1/ Define a CSV profile (type=SQL, Usage=Export lost items in report)
Try something like that to get the same columns as the default table:
Title=biblio.title
|Author=biblio.author
|Lost status=items.itemlost
|Lost on=items.itemlost_on
|Barcode=items.barcode
|Call number=items.itemcallnumber
|Date last seen=items.datelastseen
|Price=items.price
|Rep. price=items.replacementprice
|Library=items.homebranch
|item type=items.itype
|Current location=items.holdingbranch
|Location=items.location
|Not for loan status=items.notforloan
|Notes=items.itemnotes
2/ Use the filters and select items to export
3/ Export the list of items you want and make sure the CSV is correctly
formatted and contains the items you selected

QA Notes:
- I think we should add default CSV profiles for the different "usage",
but I would consider it as a separate enhancement since none of them is
defined yet
- Most of the code to export CSV is no reusable. We should make
Koha::Exporter::Record support CSV export for type=SQL (it only
supports MARC type so far).

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
17948b0c37 Bug 9573: Lost items report - Add a new "Export selected items" link
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
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