Owen Leonard [Thu, 28 Jul 2016 18:33:16 +0000 (14:33 -0400)]
Bug 16995 - Remove event attributes from two include files
This patch removes event attributes from two include files:
cat-toolbar.inc and members-toolbar.inc.
In cat-toolbar.inc an unused <form> tag with an "onsubmit" attribute has
been removed.
To test, apply the patch and:
- View the detail page for any bibliographic record. All toolbar buttons
("New," "Edit," "Save," etc.) should work as expected.
- View the detail page for any patron. Click the "Add message" button in
the toolbar. Selecting a predefined note should correctly populate the
textarea with your selected message.
Signed-off-by: Claire Gravely <c.gravely@arts.ac.uk> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Mark Tompsett [Mon, 1 Aug 2016 23:38:10 +0000 (19:38 -0400)]
Bug 16978: Followup - Copy create_report permissions for delete_report
This patch should deal with comment #6's point of where a user who
has create, but not execute permissions, would lose delete ability.
Users with create and execute permissions would already have delete
as well.
TEST PLAN
---------
1) Back up db
2) drop database koha_library;
3) create database koha_library;
4) web install with all sample data with system user
6) log into staff client as system user
7) make sample koha admin user a superlibrarian
8) set username and password for sample koha admin user
9) log out and log in as koha admin
10) Create a user (USER_A) with permissions:
create_reports and execute_reports.
11) Create a user (USER_B) with permissions:
create_reports, but not execute_reports.
12) Create a user (USER_C) with permissions:
execute_reports, but not create_reports.
13) Create a user (USER_D) with no report permissions.
14) Run the atomic update.
15) Check USER_A permissions
-- should have delete_reports
16) Check USER_B
-- should have delete_reports
17) Check USER_C
-- should NOT have delete_reports
18) Check USER_D
-- should NOT have delete_reports
19) run koha qa test tools
20) restore db
Signed-off-by: Frédéric Demians <f.demians@tamil.fr> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Mark Tompsett [Tue, 26 Jul 2016 13:50:52 +0000 (09:50 -0400)]
Bug 16978: Add delete reports user permission
This splits off the delete capability from the create reports permission.
From a UI perspective there were CSS issues, that this patch set hackily
bypasses. Perhaps someone else can amend this enhancement with the required
changes so that the extra column at the beginning of the table can be
removed when the user does not have delete capability.
TEST PLAN
---------
1) back up db
2) apply patch
3) ./installer/data/mysql/updatedatabase.pl
-- should run without issue.
4) in mysql:
> drop database ...
> create database ...
-- totally blanks it for fresh web install
5) run web install
-- installing should have no issues
6) go to a patron
7) set permissions
8) expand the reports permission
-- should have delete reports now
9) click help and scroll down to
'Granular Reports Permissions' right at the bottom.
-- there should be a new delete_reports section
10) Head over to guided reports and build a few reports.
-- as system account user, delete stuff should all be visible.
11) Find a patron, set all permissions, except delete reports.
12) log out and then log in as the modified patron
13) Head over the save reports
-- none of the delete options should be available to the user.
14) run koha qa test tools
15) restore db
Followed test plan. Additionally tried to delete using params in URL
(not possible, OK) Signed-off-by: Marc <veron@veron.ch> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Owen Leonard [Fri, 22 Jul 2016 19:24:03 +0000 (15:24 -0400)]
Bug 16968 - Remove the use of "onclick" from serial patron and vendor search templates
This patch removes instances of "onclick" from the serials templates for
patron and vendor search.
To test, go to Serials and click "New subscription."
- In the new subscription form, click the "Search for a vendor" link.
- In the popup, search for a vendor. Confirm that clicking "Choose"
selects the correct vendor.
- From the detail page of an existing subscription, click "Create
routing list."
- Search for a patron and test that the "Add" button in search results
works correctly to add patrons to the routing list.
Signed-off-by: Claire Gravely <c.gravely@arts.ac.uk> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Owen Leonard [Fri, 22 Jul 2016 15:32:54 +0000 (11:32 -0400)]
Bug 16963 - Remove the use of "onclick" from subscription add template
This patch removes the use of event attributes from the subscription add
template and the template for testing prediction patterns. Events are
now defined in the JavaScript.
To test, go to Serials -> New subscription.
- Test that the "Search for vendor," "Search for record," and "Create
record" links work correctly.
- Test the "Next" button without entering a vendor or a biblionumber.
You should be warned about selecting a vendor and biblionumber.
- After selecting a bibliographic record to link to the subscription,
click the "Next" button. The second section of the subscription add
form should be displayed.
- Under frequency, choose "1/day."
- Confirm that the "Show advanced pattern" link correctly toggles
display of the advanced pattern form.
- Under the advanced pattern form, test the "Modify pattern" button. It
should enable editing in the form.
- Test the "Cancel modifications" and "Save as new pattern" buttons.
- Test the "Test prediction pattern" button.
- In the "Prediction pattern" box, test that the checkboxes next to
each day of the week, when checked, trigger the corresponding issue
number to be marked as "not published."
- Finally, confirm that your subscription is saved correctly.
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
To test:
1) Go to Serials
2) Click Advanced Search in the toolbar at the top
3) Notice heading says Serials subscriptions (0 found) before a search has even happened
4) Apply patch and click Advanced Search again
5) Heading should now say Serials subscriptions search
6) Submit search
7) Heading should say how many subscriptions your search found (like before)
Sponsored-by: Catalyst IT Signed-off-by: Marc <veron@veron.ch> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Owen Leonard [Wed, 20 Jul 2016 14:51:30 +0000 (10:51 -0400)]
Bug 16946 [Revised] Remove the use of "onclick" from several serials templates
This patch modifies several serials module templates to remove the use
of event attributes. Events will now be defined in JavaScript.
Also changed:
- In Serials -> Check expiration, custom form validation has been
removed in favor of validation with the plugin.
- In Serials -> Claims, the "Clear filter" button has been replaced with
a link. Error messages are now styled with the standard "alert" class.
- In Serials -> New subscription -> Search for record, the "choose" link
is now a Bootstrap button. Pagination links are now styled like other
similar links. The "Close" button is now styled as in other popup
windows. The "no results found" messages is styled as an informational
dialog.
- In Serials -> Subscription -> Edit routing list, the "add recipients"
and "delete all" controls are now links with Font Awesome icons.
To test, apply the patch and:
- Go to Serials -> Check expiration.
- Try to submit the form without filling in a date. The form
validation plugin should warn you that the date field is required.
- Submit the form using data which will return results.
- Click the "Renew" button for any result. The subscription renewal
popup should be triggered for the correct title.
- Go to Serials -> Claims.
- Select a vendor with missing issues.
- Confirm that the date filter works correctly, and that the "Clear
filter" link works.
- Select one or more result and click the "Send notification" button.
The notification should be sent.
- Go to Serials -> New subscription.
- Click the "Search for record" link to trigger the bibliographic
search popup.
- Perform a search. Confirm that the "Choose" button selects the
correct record and populates the fields in the parent window.
- Go to Serials -> Subscription -> Edit routing list.
- Confirm that the process of adding recipients to the list works
correctly.
- Confirm that changing the rank of any recipient works correctly.
- Save the routing list and click the "Save and preview routing slip"
button on the confirmation page. The slip preview should open.
- In the slip preview window, test that the print button works
correctly.
Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
QA revision: Removed stray '// -->' and corrected clear filter function
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Owen Leonard [Tue, 12 Jul 2016 15:55:51 +0000 (11:55 -0400)]
Bug 17112: Action buttons for course reserves detail page
This patch revises the edit and delete buttons on the course reserves
detail page so that they are styled as Bootstrap buttons with Font
Awesome icons.
To test, apply the patch and choose or create a course reserve which has
in it at least one lost item and at least one item which is checked out.
- In the list of items on the course reserve detail page, confirm that
the 'Edit' and 'Delete' buttons are correctly styled.
- Confirm that for the checked out item the delete button is disabled.
Hovering over the button should trigger a tooltip. Clicking the button
should trigger an alert.
- Confirm that for the lost item the same is true.
Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Buttons styled as Bootstrap. Works as expected.
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Owen Leonard [Mon, 18 Jul 2016 16:20:33 +0000 (12:20 -0400)]
Bug 16937 [Revised] Remove "onclick" from the manage staged MARC records template
This patch revises the manage staged MARC records template, removing
"onclick" attributes from the markup and defining those events in the
script.
To test, apply the patch and go to Tools -> Manage staged MARC records.
- If necessary, stage a MARC file for import.
- Click the name of the staged file and then the "Import this batch into
the catalog" button. The batch should be correctly imported.
- Return to the list of staged MARC files.
- Click the name of an imported file and then the "Undo import into
catalog" button. The import should be reverted.
- Return to the list of staged MARC files.
- Click the "Clean" button for any record. Confirm that the batch is
cleaned.
- For any cleaned record, click the "Delete" button. The batch should be
deleted.
Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised
QA revision: Corrected class name so that "delete" button triggers the
correct warning.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Jonathan Druart [Mon, 11 Jul 2016 21:06:46 +0000 (22:06 +0100)]
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>
Bug 16875: OPAC - removing link to records if authority is not used by any records
To test:
1) Do an authority search. Notice that authorities not used by any records have a clickable link (under Biblio records) which redirects to a catalog search with no results
2) Go back to the authority search and click View full heading for an authority with no records. Notice that under the auth name, it says Number of records used in: 0, with a link to a catalog search
3) Apply patch
4) Repeat steps 1 and 2. Authorities not used in any records should no longer have clickable links nd authorities which have records should work as expected.
Sponsored-by: Catalyst IT 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>
Bug 16874: Making serials collections actions buttons
To test:
1) Go to serials -> Search a subscription (or make a new one)
2) Ensure that subscription has an end-date that has passed or will pass soon
3) Go to Serials collection (left sidebar menu)
4) Ensure that Subscription summary table has two buttons, Create routing list and Renew. These buttons should be bolded and the table cell highlighted
5) Ensure 'Print list' is a button in year tables below
6) Edit subscription to have a later end-date (will not expire soon)
7) Go back to serials collection
8) Ensure that table cell is no longer highlighted and buttons not bolded. Renew button should not be there.
9) Ensure that both buttons do not wrap when the browser is narrow
Sponsored-by: Catalyst IT Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
1) Go to Admin -> EDI accounts
2) Click Help in top-right corner
3) Confirm that Help window opens with appropriate help text
4) Confirm links work as expected
Sponsored-by: Catalyst IT Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Fixed link to the manual: cat -> acq
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Lari Taskula [Wed, 3 Aug 2016 11:55:08 +0000 (14:55 +0300)]
Bug 17032: Make sure Swagger object definition is up-to-date with Koha-object
If a definition in api/v1/definitions/*.json has a corresponding Koha-object by
filename, compare properties of the definition and columns of the Koha-object
and ensure that all columns are defined inside properties of the definition.
To test:
1. Run t/db_dependent/api/v1/swagger/definitions.t
2. See that all of the tests pass. (If not, file a bug report to fix missing
properties in the Swagger definition.)
3. Remove a property from api/v1/swagger/definitions/patron.json
4. Repeat step 1
5. See that test fails and lets you know that the property you just removed
is missing from the definition.
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
1) Go to Admin -> Library EANs
2) Click Help in top-right corner
3) Confirm that Help window opens with appropriate help text
4) Confirm link to manual works as expected
Sponsored-by: Catalyst IT Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Fixed link to the manual.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Owen Leonard [Mon, 1 Aug 2016 14:20:00 +0000 (10:20 -0400)]
Bug 17011 - Remove "onblur" event attribute from some templates
Several templates have an "onblur" event attribute in the markup. This
patch moves the onblur event definition into the JavaScript.
To test, apply the patch and clear your browser cache if necessary.
In Administration -> Authority types:
- Choose "New authority type."
- Enter any text into the "Authority type" field.
- Moving the cursor focus away from this field should convert your
text to uppercase.
In Administration -> MARC bibliographic framework:
- Choose "New framework."
- Enter any text into the "Framework code" field.
- Moving the cursor focus away from this field should convert your
text to uppercase.
In Administration -> Currencies and exchange rates:
- Choose "New currency."
- Enter any text into the "Currency" field.
- Moving the cursor focus away from this field should convert your
text to uppercase.
In Administration -> Item types
- Choose "New item type."
- Enter any text into the "Item type" field.
- Moving the cursor focus away from this field should convert your
text to uppercase.
Signed-off-by: Frédéric Demians <f.demians@tamil.fr> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Owen Leonard [Tue, 26 Apr 2016 18:09:58 +0000 (14:09 -0400)]
Bug 16738 - Improve EDIFACT messages template
This patch makes several improvements to the EDIFACT messages template
to make it more consistent with similar interfaces in Koha. Changes to
edimsg.tt are made to simplify the display of the data in a modal.
This patch also corrects a couple of markup errors.
To test you must have multiple rows of data in the edifact_messages
table. I tested with dummy data I inserted manually. Should should have
some rows which use 'QUOTE' and 'ORDERS' as the message_type.
To test deletions you may need to apply the patch for Bug 16737.
- Apply the patch and go to Acquisitions -> EDIFACT messages.
- In the table of messages, the date should be displayed according to
your system preference.
- Sorting by date should work correctly regardless of date format
setting.
- The 'Actions' column should contain 'View message' and 'Delete'
Bootstrap-style buttons with Font Awesome icons. The column should be
unsorted.
- Clicking the 'Delete' button should prompt you to confirm.
- Clicking the 'View message' button should trigger a modal which loads
the message data.
- Test the page with no messages or when all messages have been
deleted. The page should display a standard message dialog instead of
an empty table.
Signed-off-by: Nicole C Engard <nengard@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Kyle M Hall [Mon, 27 Jun 2016 15:56:58 +0000 (15:56 +0000)]
Bug 16685 [QA Followup] - Use Path::Tiny::slurp instead of File::Slurp
Path::Tiny::slurp is considered better to use than File::Slurp.
RM Note: The package version in wheezy is too old, the package version
in jessie is just fine and should be added to the community
repo if wheezy will be supported for the coming release.
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Kyle M Hall [Tue, 7 Jun 2016 14:07:19 +0000 (14:07 +0000)]
Bug 16685 - Use eval instead of do for .perl atomicupdates
If we use eval instead of do for our .perl atomic update files, it will
allow developers to put in the exact code that should go into
updatedatabase.pl. The problem with do is that none of the variables
defined in updatadatabase.pl are available, whereas with eval they are.
Test Plan:
1) Apply this patch
2) Create a .perl file in atomicupdates with the following in it:
say "DBversion: $DBversion";
3) Run updatadatabase.pl
4) Note the output
5) Add a syntax error to your atomic update
6) Run updatedatabase.pl
7) Note the error is displayed
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Jonathan Druart [Mon, 25 Jul 2016 15:10:34 +0000 (16:10 +0100)]
Bug 16586: [QA Follow-up] Simplify code
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended this patch: Replaced none by any. Exists test adjusted.
This effectively makes the test pass.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Marcel de Rooy [Wed, 25 May 2016 11:37:49 +0000 (13:37 +0200)]
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>
Owen Leonard [Tue, 24 May 2016 13:18:37 +0000 (09:18 -0400)]
Bug 16576 [Revised] Remove the use of "onclick" from label templates
This patch updates several label creator templates to remove the use of
"onclick" in favor of defining click events in JavaScript.
Also changed:
- Replaced the non-existant element <icon> with <i>
- Removed the use of <center> and 'align="center"';
- In the item search results template:
- The use of the checkboxes jQuery plugin has been replaced with
straight jQuery for simplicity's sake.
- Output of table headers has been modified so that translatable
strings are in the template instead of having English strings
passed from the script.
- Moved the 'Add checked' and 'Done' buttons into a floating toolbar.
To test, apply the patch and go to Tools -> Label creator.
- Choose New -> Label batch
- Click 'Add items'
- Perform a search for items.
- Confirm that 'select all' and 'clear all' links work.
- Confirm that clicking an individual 'Add' button works.
- Select multiple items and click the 'Add checked' button. Confirm
that the selected items were added to your batch.
- Click 'Add items' again to save the selected items to your batch.
- Test that the 'Delete' and 'Export' buttons next to any item work
correctly.
- Choose Manage -> Label batches
- Test that the 'Delete' button works correctly.
- Select one or more batches and test that the 'Export selected'
button works correctly.
Revision: Removed changes to pagination in the item search results
template since it didn't work.
Followed test plan, works as expected. Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Aleisha [Thu, 30 Jun 2016 00:03:23 +0000 (00:03 +0000)]
Bug 16507: Show play media tab first if record has no holdings
To test:
1) Go to Admin -> Global sysprefs
2) Turn on HTML5MediaEnabled and HTML5MediaYouTube
3) Go to Cataloging and create a new record
4) Catalogue a YouTube link in 856$u and save record. Do not add any items (click Normal tab)
5) Confirm that Play media tab is the selected tab by default
6) View record on OPAC and confirm Play media tab is selected by default
7) Go back to staff client, add an item then go back to Normal tab
8) Confirm that Holdings tab is now selected by default
9) Confirm Holdings tab is selected by default on OPAC
Sponsored-by: Catalyst IT Signed-off-by: Claire Gravely <c.gravely@arts.ac.uk> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Jonathan Druart [Sat, 23 Apr 2016 16:01:24 +0000 (17:01 +0100)]
Bug 16275: Do not allow a self registration with an existing email address
To avoid multiple registrations, it would be good to check the unicity
of the primary email address.
This patchset adds a new pref PatronSelfRegistrationEmailMustBeUnique.
If on, a patron will get "This email address already exists in our
database" if he try to register with an existing email address.
Test plan:
1/ Register a new patron with an email address
2/ Make an other registration using the same email address
=> With the pref PatronSelfRegistrationEmailMustBeUnique on, you won't be allowed
=> With the pref off, no change should be noticed.
Sponsored-by: BULAC - http://www.bulac.fr/ Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Work as described, no errors.
Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Jonathan Druart [Thu, 21 Apr 2016 20:42:11 +0000 (21:42 +0100)]
Bug 16272: Specific case when switching an on-site checkout to a regular checkout
In the case on-site checkouts are considered as a regular checkout in issuing
rules (i.e. ConsiderOnSiteCheckoutsAsNormalCheckouts is on):
When after the on-site checkout the maximum limit of checkouts is
reached and the patron wants to switch an on-site checkout to a regular
checkout, the C4::Circulation::TooMany subroutine will return a
TOO_MANY_CHECKOUTS error.
To avoid that, we need to allow an extra checkout in this subroutine.
Test plan:
0/ Switch ConsiderOnSiteCheckoutsAsNormalCheckouts and
SwitchOnSiteCheckouts on
1/ In the issuing rules, set the total number of checkouts (maxissueqty)
to 2 and the number of on-site checkouts to 2 (maxonsiteissueqty)
2/ Check 2 items out ticking the 'on-site checkout' checkbox
3/ Check one of these items out, to automatically switch it to a regular
checkout
=> The checkout should be allowed.
Sponsored-by: BULAC - http://www.bulac.fr/ Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Jonathan Druart [Thu, 21 Apr 2016 10:00:20 +0000 (11:00 +0100)]
Bug 16272: Automatically switch an on-site checkout to a regular checkout when checked out
Use case: A patron checks some items out on-site and want to take it home.
To facilitate the librarian work the checkout is directly switched from
on-site to regular when checked out if the new pref SwitchOnSiteCheckouts is on.
Test plan:
0/ Let the new pref SwitchOnSiteCheckouts off
1/ Checkout one items to a patron and tick the "on-site checkout"
checkbox
2/ Check the same item out without ticking the "on-site checkout"
checkbox
=> You should get "This item can not be renewed, it's an on-site checkout"
3/ Switch the pref on
4/ Repeat 2
=> The on-site checkout should be automatically switched to a regular checkout
Sponsored-by: BULAC - http://www.bulac.fr/ Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>
With small changes to apply to master.
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Aleisha Amohia [Mon, 29 Aug 2016 23:22:11 +0000 (23:22 +0000)]
Bug 17222: Remove use of onclick from OPAC member entry page
There is only one instance on onclick here, and that is the clear date
function.
To test, make sure clicking 'Clear date' next to Date of Birth works the
same before and after the patch.
Sponsored-by: Catalyst IT Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Lee Jamison [Mon, 29 Aug 2016 20:24:49 +0000 (16:24 -0400)]
Bug 17220: Change hold confirmation string from 'Place hold' to 'Confirm hold'
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
1) Go to Acqui -> EDIFACT messages
2) Click Help in top-right corner
3) Confirm that Help window opens with appropriate help text
4) Confirm link to manual works as expected
Sponsored-by: Catalyst IT Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Aleisha Amohia [Mon, 29 Aug 2016 06:07:53 +0000 (06:07 +0000)]
Bug 17210: Remove use of onclick from biblio detail sidebar in OPAC
Four instances of onclick here:
1) Print
2) Save to your lists
3) Add to your cart
4) Remove from cart
To test:
Find a biblio detail page in OPAC and confirm all four events above work
as expected before and after the patch.
Sponsored-by: Catalyst IT Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 16365: [QA Follow-up] Add some comment lines to Cache.pm
Resolve typo inifinite too.
Adds a few lines in order to stress that the thawed key of the L1
cache SHOULD ONLY be used for unsafe calls, and not be mixed with
regular (safe) calls.
Test plan:
Nothing to test, but verify the quality of the added comments.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 16365: Adding additional unsafe call-candidates from Acquisition
[1] Candidate 1 is FillWithDefaultValues.
This routine in Acquisition.pm does not autovivify the tagslib
structure but first collects the keys at tag and subfield level.
So, unsafe can be safely added here :)
[2] Candidate 2 is script acqui/neworderempty.pl.
It only (!) uses GetMarcStructure to know if there is a ACQ framework.
There should be cheaper ways to do it, but when we use the fast cache,
it does not matter that much anymore.
[3] Candidate 3 is script acqui/orderreceive.pl. Same reason as [2].
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested with neworderempty.pl
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Jacek Ablewicz [Wed, 27 Jul 2016 09:38:00 +0000 (11:38 +0200)]
Bug 16365 - GetMarcStructure() "unsafe" variant in PrepareItemrecordDisplay()
This sub is a good candidate for the "unsafe" treatment too, it doesn't
modify nor autovivify anything in the marc structure.
Added a warning in the code regarding the $tagslib usage by the
custom item plugins, plus a small change to prevent possible
"Use of uninitialized value" warnings in the future.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested with neworderempty.pl and itemrecorddisplay.pl.
Amended slightly: Made warning less dramatic.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Jacek Ablewicz [Wed, 27 Apr 2016 11:19:10 +0000 (13:19 +0200)]
Bug 16365: Selectively introduce GetMarcStructure() "unsafe" variant for better performance
GetMarcStructure() currently uses Koha::Cache in the "safe" mode
(returning deep copy of the result data structure by default), which
causes numerous performance issues in many Koha scripts. Switching
it to the "unsafe" mode globally (2nd patch from Bug 16140) resolves
those issues, but ensuring that it is regression-free (and that it
will stay that way in the future) is far from easy. This patch
proposes a bit more manageable solution, it introduces
a possibility to use "unsafe" variant selectively (only in those
places in the code where GetMarcStructure() is called repetitively).
That way, amount of the code that needs to be audited for possible
problems gets vastly reduced, without any performance trade-offs.
Test plan:
1) Have a look at the code and audit the parts affected by this patch
for possible regressions
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended the POD of GetMarcStructure, removing a TODO.
NOTE: GetAuthorisedValueDesc, as called in C4::XSLT::transformMARCXML4XSLT
and by GetISBDView, GetMarcAuthors in C4::Biblio, may autovivify some hash
entries in tagslib.
Same for Koha/Filter/MARC/ViewPolicy.pm, sub filter.
No reason however to worry; our use of this structure in Koha does not
depend on the existence of intermediate hash keys. (We seem to be safe as
long as $tagslib->{$tag}->{$subfield}->{tab} and/or hidden are not filled.)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 15839: [QA Follow-up] Error checking in opac-review.pl
[1] Adds a check on biblionumber. (Prevents a DBIx error.)
[2] If you have a reviewid, search on that and check results.
Add an unauthorized error in template.
[3] If you add a new review, check that there is no review yet.
If so, edit the existing one.
This supports the added FIXME on a unique constraint.
Note: This script could receive further attention.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested all crud ops with opac-review.pl (incl URL manipulation).
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 15839: [QA Follow-up] Paging on opac-showreviews
Paging is kind of messy here. This patch at least improves somewhat.
The page number should be rounded.
The results per page should be passed to the template too.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested a number of reviews and played with count parameter in URL.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marc Veron <veron@veron.ch> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Jonathan Druart [Tue, 16 Feb 2016 16:30:07 +0000 (16:30 +0000)]
Bug 15839: Koha::Reviews - Remove savereview
Signed-off-by: Marc Veron <veron@veron.ch> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Jonathan Druart [Tue, 16 Feb 2016 16:28:33 +0000 (16:28 +0000)]
Bug 15839: Koha::Reviews - Remove updatereview
Signed-off-by: Marc Veron <veron@veron.ch> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marc Veron <veron@veron.ch> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Jonathan Druart [Tue, 16 Feb 2016 16:15:55 +0000 (16:15 +0000)]
Bug 15839: Koha::Reviews - Remove getreview
Note that this (biblionumber, borrowernumber) pair should be defined as
a unique key at the DB level (FIXME added)
Signed-off-by: Marc Veron <veron@veron.ch> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Jonathan Druart [Tue, 16 Feb 2016 16:06:46 +0000 (16:06 +0000)]
Bug 15839: Koha::Reviews - Remove deletereview
Note that a future enhancement should take into account the possible
error returned by ->approve, ->unapprove and ->delete
Signed-off-by: Marc Veron <veron@veron.ch> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Jonathan Druart [Tue, 16 Feb 2016 16:53:41 +0000 (16:53 +0000)]
Bug 15839: Koha::Reviews - Change default value for approved to 0
The reviews.approved column had a default value set to NULL.
It does not make sense, the default value should be 0, this will avoid
to have to specify the approved value when creating a new review.
Signed-off-by: Marc Veron <veron@veron.ch> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This patch adds 2 new methods to Koha::Review: approve and unapprove.
Signed-off-by: Marc Veron <veron@veron.ch> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Jonathan Druart [Tue, 16 Feb 2016 15:56:03 +0000 (15:56 +0000)]
Bug 15839: Koha::Reviews - Remove getallreviews
Signed-off-by: Marc Veron <veron@veron.ch> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Jonathan Druart [Tue, 16 Feb 2016 15:09:01 +0000 (15:09 +0000)]
Bug 15839: Koha::Reviews - Remove getreviews
The C4::Reviews::getreviews subroutine retrieved the reviews for a given
record, depending on their status.
This can be achieve with a call to Koha::Reviews->search.
There were 2 calls to this subroutine. The one from opac-ISBDdetail.pl
does not look in used: the reviews are not display on this page. It
certainly comes from an old copy/paste from opac-detail.pl.
The one from opac-detail only asked for the approved reviews. So the
logged in user does not see its own review if it is pending approval.
Actually this pending approval review is only displayed when the user
submits it (because of a unecessary complex text replacement done in
JS).
With this patch, the approved reviews AND the unaproved review from the
logged in user will be displayed.
It will allow a future enhancement to add a way to delete our own
reviews.
Moreover, the reviews were retrieved even if they were not displayed (if
reviewson is off), it's now fixed.
Signed-off-by: Marc Veron <veron@veron.ch> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
The subroutines in C4::Reviews are only doing CRUD operations.
This patch set moves them to 2 new Koha::Review[s] classes.
Test plan for the whole patch set:
0/ Set the reviewson syspref
1/ At the OPAC, create a couple of reviews for a record
Try and create a review without html tags different that br b i em big
small strong: You should get a warning.
2/ Edit a review
3/ On the Staff interface, you should see a "Comments pending approval"
link on the mainpage
4/ Approve 1 review and delete the other
5/ At the OPAC you should only see 1 review (the approved one) in the
"Comments" tab
6/ Modify the review
7/ The review should appear again in the "comments awaiting moderation"
tab.
Note that even the comment has not been changed, it will have to be
reapproved (FIXME later). This behavior already existed prior to this
patch.
Tested all patches together (with database updated) Signed-off-by: Marc Veron <veron@veron.ch> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Jonathan Druart [Mon, 4 Jul 2016 16:56:54 +0000 (17:56 +0100)]
Bug 16851: Move HasOverdues to Koha::Patron->has_overdues
This patch just move C4::Members::HasOverdues to
Koha::Patron->has_overdues and updated callers
Test plan:
No change in behavior is expected.
1/ If a patron is debarred and does not have overdues and
AutoRemoveOverduesRestrictions is on, the debarment will be removed on
checkin
2/ Add overdues and make sure the patron cannot renew
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Jonathan Druart [Wed, 20 Jul 2016 18:03:53 +0000 (19:03 +0100)]
Bug 16911: ->get_expiry_date accepts strings
To make sure nothing else will be broken, it's certainly better to
handle date strings in a first phase.
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Jonathan Druart [Tue, 12 Jul 2016 19:29:15 +0000 (20:29 +0100)]
Bug 16911: Rename extend_subscription with renew_account
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Jonathan Druart [Mon, 11 Jul 2016 22:28:19 +0000 (23:28 +0100)]
Bug 16911: Koha::Patrons - Move ExtendMemberSubscriptionTo to ->extend_subscription
This patch moves the code from C4::Members::ExtendMemberSubscriptionTo
to Koha::Patron->extend_subscription.
The expected behavior is:
When a new patron is created, the enrolment period defined for the
patron category is used unless an enrolment period date is defined. In
that case, this date is used.
When an account is renewed, the pref BorrowerRenewalPeriodBase is used to
determine if the subscription is renewed from today or from the day when his/her
account has expired.
Test plan:
Confirm that the behavior is correct before this patch and that it's
still the same after this patchset applied.
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Jonathan Druart [Mon, 11 Jul 2016 23:18:56 +0000 (00:18 +0100)]
Bug 16911: Koha::Patrons - Add tests for ->extend_subscription
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Jonathan Druart [Mon, 11 Jul 2016 22:45:55 +0000 (23:45 +0100)]
Bug 16911: Koha::Patron::Categories - Move GetExpiryDate to ->get_expiry_date
This patch moves the code from C4::Members::GetExpiryDate to
Koha::Patron::Categories.
Nothing much exiting, please follow test plan in next patches.
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Jonathan Druart [Mon, 11 Jul 2016 23:14:56 +0000 (00:14 +0100)]
Bug 16911: Koha::Patron::Categories - Add tests for ->get_expiry_date
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Jonathan Druart [Tue, 9 Aug 2016 16:06:56 +0000 (17:06 +0100)]
Bug 17089: Improve errors handling
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>
Jonathan Druart [Tue, 9 Aug 2016 14:08:55 +0000 (15:08 +0100)]
Bug 17089: Mark out the boundaries of ratings
In the doc of C4::Ratings, it was written that the rate values should be
>=0 and <=5, but it was not taken into account.
This bug should be fixed on stable releases as well.
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>
Jonathan Druart [Tue, 9 Aug 2016 14:01:05 +0000 (15:01 +0100)]
Bug 17089: Koha::Ratings - Remove C4::Ratings
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>
Jonathan Druart [Tue, 9 Aug 2016 14:01:21 +0000 (15:01 +0100)]
Bug 17089: Koha::Ratings - Remove GetRating
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>
Jonathan Druart [Tue, 12 Jul 2016 10:28:57 +0000 (11:28 +0100)]
Bug 17089: Koha::Ratings - Remove DelRating
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>
Jonathan Druart [Tue, 12 Jul 2016 10:06:07 +0000 (11:06 +0100)]
Bug 17089: Koha::Ratings - Remove ModRating
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>
Jonathan Druart [Tue, 12 Jul 2016 10:04:41 +0000 (11:04 +0100)]
Bug 17089: Koha::Ratings - Remove AddRating
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>
Jonathan Druart [Tue, 12 Jul 2016 10:28:42 +0000 (11:28 +0100)]
Bug 17089: Koha::Ratings - move tests
Rewrite and move the tests.
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>
The subroutines in C4::Ratings are only CRUD operations.
This patch set moves the entire module to Koha::Rating[s] based on
Koha::Object[s]
Test plan for the whole patch set:
0/ Set OpacStarRatings to "results and details"
1/ Log in at the OPAC
2/ Launch a search, you should see the star ratings
3/ Go on a detail page, you should see the star ratings
4/ Rate the record
5/ Log in with another patron
6/ Go on the same detail page, you should see the previous rating
7/ Rate the racord, you should see "2 votes" and the average rating
value.
8/ Cancel your rate
9/ Disable JavaScript and repeat 7
Note: You cannot cancel your rate if JavaScript is disabled (not a
regression).
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>
Magnus Enger [Thu, 8 Sep 2016 12:55:58 +0000 (14:55 +0200)]
Bug 17267 - Document koha-create --adminuser
A description of --adminuser was missing from debian/docs/koha-create.xml
This patch adds a description in the Options section, as well as under
DEFAULTSQL in the list of configuration variables.
To test:
Run these commands and look at the formatted man page:
$ xsltproc /usr/share/xml/docbook/stylesheet/docbook-xsl/manpages/docbook.xsl \
debian/docs/koha-create.xml
$ man -l koha-create.8
Make sure this test passes:
$ prove -v xt/verify-debian-docbook.t
Signed-off-by: Liz Rea <liz@catalyst.net.nz>
Edited commit message to fix typo - koha-mysql -> koha-create as that's what we're testing. :)
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Test plan:
1) Shut down the Plack server.
2) The OPAC and staff side homepage should still load (as it is
mistakenly being loaded via CGI).
3) Apply patch.
4) Both homepages should now not load.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Marcel de Rooy [Wed, 31 Aug 2016 12:20:34 +0000 (14:20 +0200)]
Bug 15758: [QA Follow-up] Final touch?
From qa tools:
reports/cat_issues_top.pl: pod: =over on line 39 without closing =back
Note: qa tools does also report "options_for_libraries: not found" on two
template includes. Considering this as a false alarm, since the block is
defined in another include loaded in doc-head-open.
[1] koha-tmpl/intranet-tmpl/prog/en/includes/subscriptions-search.inc
[2] koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-topissues.inc
Found a template where a USE Branches was missing:
koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt
Easy to spot since the libraries combo was empty.
Tried to find similar occurrences with few greps, but couldn't find any.
I did find duplicate USE Branches though in:
koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/checkexpiration.tt
This patch removes them.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Marcel de Rooy [Fri, 26 Aug 2016 07:02:04 +0000 (09:02 +0200)]
Bug 15758: [QA Follow-up] Some corrections related to GetBranchName
[1] Acquisition.pm
The lines filling $row in GetBasketGroupAsCSV may have side-effects when
the library name is not found. This change restores former behavior. Just
theoretically more safe.
Note that it also contained a typo: $row->{deliveryplace} should have been
$row->{$place}.
[2] Auth.pm
checkauth: $branchname = Koha::Libraries->find($branchcode)->branchname;
Should normally be fine, but I rather have an empty string here than
crashing on "Can't call method branchname on undefined value".
Same for sub check_api_auth.
Note that this holds for a larger number of calls, but I am adding a check
here because it is checkauth.
Also removed a duplicate use Koha::Libraries-statement.
[3] Search.pm
Also removed a duplicate use statement for Libraries.
[4] svc/holds
Added an (explicit) use statement for Koha::Libraries.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Marcel de Rooy [Fri, 26 Aug 2016 06:01:07 +0000 (08:01 +0200)]
Bug 15758: [QA Follow-up] Remove onlymine from Plugin/Branches.pm
Hard to miss that one:
Template process failed: plugin error - Bareword "C4::Branch::onlymine" not allowed while "strict subs" in use at Koha/Template/Plugin/Branches.pm line 59.
Compilation failed in require at /usr/lib/perl5/Template/Plugins.pm line 206.
Removed OnlyMine from Plugin/Branches. Replaced by a template var in
cleanborrowers; it was used only once.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Jonathan Druart [Tue, 2 Feb 2016 17:28:30 +0000 (17:28 +0000)]
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>