Commit graph

5709 commits

Author SHA1 Message Date
545b64f869 Bug 15635: Koha::Patron::Images - Remove GetPatronImage
To retrieve a patron image, we can call Koha::Patron::Images->find or
Koha::Patrons->find->image
Both will return a Koha::Patron::Image object.

Test plan:
1/ From the patron/member module, open all tabs on the left (Checkouts,
detail, fines, etc.)
The image should be correctly displayed.
2/ At the OPAC, on the patron details page (opac-memberentry.pl) the
image should be displayed as well.
3/ Same on the sco module.

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-03-04 12:54:15 +00:00
85633155f4 Bug 15635: Koha::Patron::Images - Remove RmPatronImage
The C4::Members::RmPatronImage just removed a row in patronimage.
This can be accomplished using the delete method of Koha::Patron::Image.

Test plan:
From the patron defail page, try to delete the image of a patron.

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-03-04 12:53:01 +00:00
d8980b60ee Bug 15635: Koha::Patron::Images - Remove PutPatronImage
The C4::Members::PutPatronImage inserted/updated the image of a patron.
This can be done easily with ->find->set->store or ->new->store

Test plan:
1/ Modify the image of a patron from the patron detail page
2/ Add an image to a new patron
3/ Use the "Upload patron images" tools (tools/picture-upload.pl) to add
or modify the image of a patron
4/ Use the "Upload patron images" tools (tools/picture-upload.pl) to add
or modify the image of several patrons, using a zip file.
Stress the script trying to get as many errors as possible (wrong
cardnumber, wrong mimetype, file does not exist, etc.)
With this patch, if the cardnumber does not exist, you will get a
specific error "Image not imported because this patron does not exist in
the database"

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-03-04 12:53:00 +00:00
771e63f5bf Bug 15669: Alphabetize marc modification templates
This patch sorts the modification templates when getting them from the
database  This affects the pages below:

  tools/batch_record_modification.pl
  tools/marc_modification.pl
  tools/stage-marc-import.pl

To test:

1 - Add some marc modification templates in a non alpha order (Shoes,
    Hats, Cats)
2 - visit the pages above and note the templates are in order
    added
3 - apply patch
4 - visit the three pages and note correct order
5 - verify all tools continue to work as expected

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: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-03 22:11:44 +00:00
77e1e7c4ef Bug 15548 [QA Followup] - More new uses of Koha::Borrower
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

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

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

2/
Prove the different modified test files

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

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

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

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
2016-03-03 14:38:26 -07:00
774993ae2d Bug 15632 [QA Followup] - Get rid of use of uninitialized value errors for unit tests
* Set $user to "" if not passed
* Tidy sub

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-03 21:22:15 +00:00
2d74d926ce Bug 15632: Koha::Patron::Messages - Remove GetMessages
This subroutine just retrieved the messages given some parameters.
Some job should not have been done in this subroutine.
It was called only 3 times, in circ/circulation.pl and opac-user.pl.
Basically it was used to retrieved the message to displaye for a given
patron ($borrowernumber) at the OPAC (B) or Staff (L).

For the 3 calls, the 2 parameters $borrowernumber and $type
(message_type) were passed, the "%" trick at the beginning of the
subroutine was useless.
Moreover, the date formatting should be done on the TT side, not in
subroutine.
The can_delete flag was set if the branchcode given in parameter was the
same as the one of the message. This has been delegated to the template.
Indeed the can_delete was not valid, since it must depend on the
AllowAllMessageDeletion pref.
The test is now:
  IF message.branchcode == branch OR
  Koha.Preference('AllowAllMessageDeletion'')

There is not specific test plan for this patch, the changes have already
been tested in previous patches.

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

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-03 21:22:14 +00:00
74180472ad Bug 15632: Koha::Patron::Messages - Remove GetMessagesCount
The GetMessageCount subroutine was only used once, in opac-user.pl, to
know if some messages will be displayed.

Test plan:
1/ Create messages to display at the OPAC for a patron
2/ Logged this patron in at the OPAC, you should see the messages
displayed.

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-03 21:22:13 +00:00
e6bd28682e Bug 15632: Koha::Patron::Messages - Remove DeleteMessage
The DeleteMessage just deleted and logged if needed.
This is now be done by Koha::Patron::Message->delete.

Test plan:
1/ Go on the "check out" page of a patron
2/ Delete some messages

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

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-03 21:22:13 +00:00
d9c983c568 Bug 15632: Koha::Patron::Messages - Remove AddMessage
The AddMessage subroutine just
1. checked if all the parameters were passed
2. inserted the message in the DB
3. logged the action if needed

These 3 jobs are now done by the overloaded store method of
Koha::Patron::Message.

Test plan:
1/ Go on the "check out" page of a patron
2/ Add different new messages

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

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-03 21:22:13 +00:00
85d08edddf Bug 15084: Remove C4::Budgets::ConvertCurrency
This subroutine is unused and can be removed.
There is no trace left of currency in C4::Budgets.

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

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

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-03 20:39:01 +00:00
1538e9ecf4 Bug 15084: Replace C4::Budgets::GetCurrencies with Koha::Acquisition::Currencies->search
Most part of the code here is unnecessary complex. We should selected
the currency if it is selected, that's all :)

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

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

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-03 20:39:01 +00:00
c0d7030b02 Bug 12803 [QA Followup] - Allow holiday caching to be disabled for testing purposes
Bug 12803 [QA Followup] - Remove use of C4::Dates

C4::Dates was being included, but not used in the code!

Bug 12803 [QA Followup] - Fix koha-qa.pl errors

Bug 12803 [QA Followup] - Update unit tests due to changes in master

Bug 12803 [QA Followup] - Fix to stop failing unit tests

Bug 12803 [QA Followup] - Remove duplicate 'use' lines

Bug 12803 [QA Followup] - Remove NO_CACHE

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

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-03 20:19:00 +00:00
3c9d50d134 Bug 12803 - Add ability to skip closed libraries when generating the holds queue
The holds queue is typically generated many times a day in order to
select items to fill holds. Often these items are to be sent to a
different library. However, if the library whose item is picked to fill
a hold is closed, that hold will remain unfilled even if there are other
open libraries who own that item. It would be helpful if we could skip
closed libraries for the purpose of selecting items to fill holds.

Test Plan:
1) Apply this patch
2) Run updatedatabase.pl
3) Create a record with two items on it, one at Branch A, and one at
   Branch B
4) Place a hold for pickup at Branch C
5) Generate the holds queue
6) Note which branch's item is selected for the hold
7) Enable the new system preference HoldsQueueSkipClosed
8) Add today as a holiday for that branch noted in step 6
9) Regenerate the holds queue
10) View the holds queue, notice the item selected is not from
    the closed branch!
11) prove t/db_dependent/HoldsQueue.t

Signed-off by: Jason Robb <jrobb@sekls.org>

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

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-03 20:19:00 +00:00
9bd9476b1d Bug 12426: [QA Follow-up] Clear to_address to force update
When resending an email from the Notices tab in Patrons, we would like
to use the recent email address.

Test plan:
[1] Look up a patron with some notices sent.
[2] Adjust the patron email address (watch AutoEmailPrimaryAddress).
[3] Resend the notice. Verify if the new address was used.

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

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-03 20:16:07 +00:00
Lari Taskula
fbb7097b1d Bug 12426: Allow resend for sent messages
This patch allows to resend both sent and failed messages.

With messages in 'sent' status, we have to be careful not to accidentally send
sent messages again. With the previous patch using GET request, this was likely
to happen because of browser storing the GET parameters.

This patch changes request method from GET to POST. Instead of a simple link,
we now have a form element.

In notices.pl we redirect back to notices.pl, because with POST there is a risk
of resending the message accidentally by form resubmission at refresh.

To test, find/create a Patron that has sent or failed notices in message_queue:
1. Enable EnchancedMessagingPreferences system preference
2. Go to Patrons -> Notices
3. In the Notice column, click the title of the sent or failed message
4. Observe that there is nothing for resending the sent or failed message
5. Apply the patches.
6. Reload Notices page and repeat step 3
7. Observe that there is now a link "Resend" in the Status-column
8. Click Resend
9. Observe that the message gets into 'pending' status

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-03 20:16:07 +00:00
0813c72b1f Bug 12426: Simplify the code adding a new subroutine GetMessage
The C4::Letters module does not have a GetMessage subroutine, which
could be quite useful.
This patch adds it and simplifies the code added by the previous patch.
It also adds a few tests and fixes POD typos.

Note that ResendNotice only resends failed messages. This will avoid to
resend already sent messages (using an url from the browser history for
instance).

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-03 20:16:07 +00:00
Lari Taskula
05ea6ba1a8 Bug 12426: Allow resending of messages from the notices tab in the patron account
This patch adds a link 'Resend' under a notice in 'failed' status
in the Patron's Notices tab.

By clicking the link, we will request notices.pl with parameter
"resendnotice=XXXXX" where XXXXX is message_id. In notices.pl,
we then check whether the given message is actually in 'failed'
status. If so, we use the C4::Letters::ResendMessage(123) to
change the status of the message into 'pending'. This way it
will be processed again by the cronjob process_message_queue.pl.

To test, find/create a Patron that has failed notices in message_queue:
1. Enable EnchancedMessagingPreferences system preference
2. Go to Patrons -> Notices
3. In the Notice column, click the title of the failed message
4. Observe that there is nothing for resending the failed message
5. Apply patch.
6. Reload Notices page and repeat step 3
7. Observe that there is now a link "Resend" in the Status-column
8. Click Resend
9. Observe that the message gets into 'pending' status

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

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-03 20:16:06 +00:00
Mirko Tietgen
10cbf64b24 Bug 14168: (followup) require WWW::YouTube::Download only when syspref enabled
This patch fixes the problem of missing WWW::YouTube::Download breaking
record detail views. Instead of a general 'use', the module is only
required if the related syspref is enabled.

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

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-03 18:47:03 +00:00
Jonathan Druart
c631fa0924 Bug 11023: Automatic item modification by age (Was Toggle "new" status")
This patch adds:
- a new DB field items.new.
- a new page to configure this new status
  (tools/toggle_new_status.pl).
- a new cronjob script (misc/cronjobs/automatic_item_modification_by_age.pl
was misc/cronjob/toggle_new_status.pl)

Why this status is useful for some libraries ?
The use cases are:
- to know easily what are the new items (with a simple sql query).
- to display an icon in the search results.
- issuing rules can be adapt for new items. Automatically (using the
  cronjob script), the status change (depending the configuration) and
  the item can be issued, for example.
- a RSS/Atom feeds can be created on these new items.

Test plan:
- log in with a librarian having the tools > items_batchmod permission.
- navigate to Home > Tools > Automatic item modifications by age (was: Toggle new status)
- click on the edit button
- there are 3 "blocks":
  * duration: the duration during an item is considered as new.
  * conditions: the status will change only if the conditions are meet.
  * substitutions: if there is no substitution, no action will be done.
    You can add some change to apply to the matching items.
    E.g. ccode=3
         new=''
    If the value is an empty string (in other words, the input does not
    contain anything), the field will be deleted.
  You can create as many rules as you want.
- test the interface : add/remove rule, conditions, substitutions,
  submit the form, edit, etc.
  (There is a looot of JS everywhere, so certainly a looot of bugs...).
- when you have your rules defined, you can now launch the cronjob
  script without any parameter.
  A report will be displayed with the matching itemnumber and the
  substitutions to apply. Verify results are consistent.
- launch the script with the -c argument and verify values have been
  modified depending the substitution rules.

Signed-off-by: juliette et remy <juliette.levast@iepg.fr>

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

Bug 11023: Add the ability to specify fields from biblioitems table.

Test plan:
Same as before but try with fields from the biblioitems table.

Signed-off-by: juliette et remy <juliette.levast@iepg.fr>

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

Bug 11023: Add UT for C4::Items::ToggleNewStatus

Test plan:
prove t/db_dependent/Items/ToggleNewStatus.t

Signed-off-by: juliette et remy <juliette.levast@iepg.fr>

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

Bug 11023: FIX - condition on biblioitems table does not work

If a rule contains a condition on the biblioitems table, the match won't
work. This patch fixes this issue.

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

Bug 11023: Use DBIx-Class to retrieve column names

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

Bug 11023: Don't use the biblioitems fields for the subtitution

It's dangerous to allow a change on the biblioitems fields with this
feature.

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

Bug 11023: Rename the duration parameter with 'age'

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

Bug 11023: The age parameter should be a number

The template should check if the age parameter is correctly filled
(should be a number).

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

Bug 11023: Change the name of the feature

Originaly this feature only permits to update the "new" field.
Now all item fields can be updated.
The name of the feature is now "Automatic item modifications by age".

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

Bug 11023 [QA Followup]

* Update DB version
* Fix capitalization error
* Rename misc/cronjobs/toggle_new_status.pl to misc/cronjobs/automatic_item_modification_by_age.pl

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

Bug 11023 [QA Followup] - Complete the renaming of "toggle new status" to "automatic item modification by age"

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

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-02 22:56:31 +00:00
Jesse Weaver
cdbb63f856 Bug 14659: Allow patrons to enter card number and patron category on OPAC registration page
Test plan:
  1. Open OPAC self-registration page while logged out.
  2. Note that cardnumber and categorycode are not shown.
  3. Remove cardnumber and categorycode from
     PatronSelfRegistrationBorrowerUnwantedField.
  4. Enable autoMemberNum.
  5. Reload self-registration page, note that categorycode now shows.
  6. Disable autoMemberNum.
  7. Reload self-registration page, note that cardnumber now shows.
  8. Try saving a patron with an existing cardnumber; this should fail
     and explain why.
  9. Set CardnumberLength, and verify that those length restrictions are
     enforced.
 10. Verify that patron can be created with custom categorycode and
     cardnumber.

Signed-off-by: Michael Sauers <msauers@dospace.org>

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

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-03-02 04:29:38 +00:00
543a7f5081 Bug 14751 - Allow C4::Context->interface to be set to 'sip' or 'commandline'
Koha::Logger allows us to split up logging to separate files based on
the interface. However, right now the interface is limited to just
'opac' or 'intranet'.

We should extend this to allow the interface to also be set to 'sip'
for SIP server logging, and to 'commandline' for cronjobs and all other
command line scripts.

Signed-off-by: Chris <chris@bigballofwax.co.nz>

Does what it says on the tin

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

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-03-02 04:21:25 +00:00
0fdc1021d4 Bug 15800: Koha::AuthorisedValues - Remove C4::Koha::IsAuthorisedValueCategory
C4::Koha::IsAuthorisedValueCategory contains only 2 useful calls, from
C4::Reports::Guided and reports/guided_reports.pl
It can be replaced with
  Koha::AuthorisedValues->search({ category => $authorised_value})->count

Test plan:
1/ Create a sql report using an authorised value category, something
like:
  SELECT COUNT(*) FROM items where itemlost=<<lost|LOST>>
2/ Execute the report and confirm that everything works fine.
3/ Create a sql report using a nonexistent authorised value categor,
something like:
  SELECT COUNT(*) FROM items where itemlost=<<lost|NONEXIST>>
4/ When saving the report, you should get a warning message
  "lost: The authorized value category (NONEXIST) you selected does not exist."
5/ Save anyway and execute the report, you should get the same warning
message.

QA:
  git grep IsAuthorisedValueCategory
should not return any results
  prove t/db_dependent/ReportsGuided.t
should return green

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

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

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-03-02 03:54:16 +00:00
efb01b66a8 Bug 15675: Fix conflict with bug 15446 (type vs _type)
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-03-02 03:24:46 +00:00
742f3c0335 Bug 15675 - Fix some missed tab characters, remove old FIXMEs
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-03-02 03:24:46 +00:00
2398bfafc6 Bug 15675 - Add issue_id column to accountlines and use it for updating fines
Right now, fines are updated based on the fine description. There are a
number of areas where this can go wrong ( date or time format changing,
title being modified, etc ). Now that issues has a unique
identifier, we should use that for selection and updating of fines.

Test Plan:
1) Apply this patch
2) Test creating and updating fines via fines.pl
   and checking in overdue items. No changes should be noted.
3) prove t/db_dependent/Circulation.t

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-03-02 03:24:45 +00:00
Tomas Cohen Arazi
16548d3984 Bug 15721: (QA followup) pick the most probable first
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-03-02 03:22:51 +00:00
Marc Véron
019634fc5b Bug 15721: (followup) Add apache2ctl to C4::Context::get_versions
See comment #6

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-03-02 03:22:51 +00:00
ca36ee3794 Bug 15939: Action logs - Do not default dates to today
When accessing the modification logs from a link that does not
explicitly set the to and from dates (e.g., from patron or bib details),
no results are displayed unless the object had an action occur during
the current day.

This is a side-effect of commit 5dceb851 for bug 13813.

Test plan:
- View the modification logs of a record which has already been modified
(/tools/viewlog.pl?do_it=1&modules=CATALOGUING&action=MODIFY&object=XXX)
=> Without this patch, you won't see any logs (unless you have modified
the record today)
=> With this patch, the behavior is the same as prior bug 13813 (you can
check in 3.20.x), you will see all logs

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>

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

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-03-02 00:53:14 +00:00
361c1e987c Bug 15842 - Cannot import patrons if the csv file does not contain privacy_guarantor_checkouts
When importing patrons with a csv file which does not contain the privacy_guarantor_checkouts column in the header, you will get
DBIx::Class::Storage::DBI::_dbh_execute(): Column 'privacy_guarantor_checkouts' cannot be null at /home/koha/src/C4/Members.pm line 768

The same issue seems to occur for sms_provider_id.

Test Plan:
1) Attempt to import patron csv file with no privacy_guarantor_checkouts column
2) Note the error
3) Apply this patch
4) Repeat step 1
5) The error should no longer occur

NOTE: While this patch does work, should it be solved only
at this level? The issue that there is the lack of those two
fields on the tools screen still exists.

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

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

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-03-02 00:52:01 +00:00
3963740ee2 Bug 14168 [QA Followup] - Fix typo
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-03-02 00:40:00 +00:00
Mirko Tietgen
f3e1e49797 Bug 14168 - enhance streaming cataloging to include youtube
Add optional embedding of YouTube videos via HTML5Media.
New syspref: HTML5MediaYouTube: Embed/Don't embed videos.
Format WEBM is hardcoded as it is the only format accepted by all
modern browsers.

Test plan:
- apply patch
- catalogue a YouTube link in 856$u
- turn on HTML5MediaEnabled and HTML5MediaYouTube
- open the record in OPAC and staff client, check that the
  'Play media' tab is showing and playing the video works.

Possible enhancements for followups:
- check available formats, offer quality choice
- accept official YT URL shortener

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

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

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

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-03-02 00:40:00 +00:00
d9dc15f21e Revert Bug 11081 - Port Koha::Contrib::Tamil indexer into Koha code base
It has been decided that Moose should not be a dependency for Koha, and
that this patch set should be reverted to avoid it's use.

This reverts commit 43bcc1c42c.
This reverts commit e5f4a0e3d5.
This reverts commit 6d44b0a91a.
2016-03-01 16:56:35 +00:00
Holger Meißner
b52e879209 Bug 14395: Code changes
This patch updates the calculation of 'No renewal before' to include the
new syspref NoRenewalBeforePrecision.

To test:

1) Check out an hour-based loan with 'No renewal before' set to 1.
   Switch syspref NoRenewalBeforePrecision between 'date' and 'exact
   time'. Confirm that with both settings the item cannot be renewed
   until exactly one hour before due.

2) Check out a day-based loan with 'No renewal before' set to 1 day.
   Confirm that:
   * with NoRenewalBeforePrecision set to 'date', renewal is possible
     at 12:00 AM on the day before due.
   * with NoRenewalBeforePrecision set to 'exact time', renewal is
     possible at 11:59 PM on the day before due.

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

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
2016-02-26 14:28:41 +00:00
a6dc6a28f3 Bug 4941 [QA Followup] - Retain singleBranchMode in list of sysprefs passed to XSLT 2016-02-26 12:24:04 +00:00
8627ec5f6a Bug 4941: Remove the singleBranchMode system preference
The singleBranchMode system preference does not make sense.
Either the install has only 1 library defined or several. In both case,
we can easily guess the behavior to follow.

So the idea of this patch is to replace the fetch of this syspref with a
call to count the number of libraries defined in DB.

Test plan:
1/ From a fresh Koha install, execute the DB entry to remove the pref.
2/ Define only 1 library
3/ Confirm that Koha behaves the same as before (try to change your
library, look at the facets)
4/ Create another library (or more) and reinsert the pref and set it:
  insert into systempreferences (variable, value)
    values('singleBranchMode', 1);
5/ Execute the DB entry
You should get a warning message.
6/ Repeat 3.

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

Does what it says, but will change behaviour for any Koha install that
has 2 branches defined, One circulation, and this preference set.
If that is an acceptable change, we might need to make sure this is noted well in the
release notes.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-02-26 12:13:09 +00:00
a1bd7af5fb Bug 15798: Remove C4::Koha::displayServers
This subroutine is no longer is use and can be removed.

Test plan:
  git grep displayServers
should not return any results.

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-02-24 17:09:39 +00:00
714899c7f8 Bug 15343 - Allow user to set password on opac-memberentry.pl
This patch allows patrons to create thier own password during OPAC self
registration.  It sets the password field to be hidden by default, and
allows for a system generated password if no password is supplied and
field is not mandatory

1 - Apply patch
2 - run updatedatabase.pl
3 - Check syspref "PatronSelfRegistrationBorrowerUnwantedField" - it
should contain 'password'
4 - Check self registration on opac - there should be no change
5 - Remove 'password' from PatronSelfRegistrationBorrowerUnwantedField
6 - Password field should now be visible in OPAC self registration
7 - Register a patron: If no passwor is supplied you should get a system
generated password
8 - Register a patron with a password, your password should be used
9 - Add 'password' to PatronSelfRegistrationBorrowerMnadatoryField
10 - Attempt to register a patron with no password - it should fail
11 - Try all combinations if mismatched/short/missing passwords and view
correct error messages
12 - prove t/db_dependent/Members.t

Sponsored by : Do Space (www.dospace.org)

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>

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

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-02-24 04:04:04 +00:00
3b8f35de79 Bug 15629 [QA Followup]
* Use ->id instead of ->branchcode when possible to eliminate use of that nomenclature
* Fix bad use of ->branchcode to ->{branchcode} for unblessed hashref  version of Koha::Library

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

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-02-24 03:55:07 +00:00
d564d3732d Bug 15629: Koha::Libraries - Remove GetBranchInfo
C4::Branch::GetBranchInfo was only used once in opac/opac-suggestions.pl
The occurrence can easily be replaced by a call to Koha::Libraries->find

Test plan:
1/ Create a suggestion for library A
2/ Enable OPACViewOthersSuggestions
3/ Use a patron from library B to see the suggestions
4/ The "Suggested for" value should be correctly filled with the library
A name.

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

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

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-02-24 03:55:07 +00:00
a007178b87 Bug 15629: Koha::Libraries - Remove ModBranch
This subroutine was only used in tests to add/update a library.

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

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

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-02-24 03:55:06 +00:00
4f5217314c Bug 15629: Koha::Libraries - Remove GetBranchDetail
C4::Branch::GetBranchDetail retrieved library infos, it could be easily
replaced with Koha::Libraries->find

When this change needs other big changes, the unblessed method is
called, to manipulate a hashref (as before) instead of a Koha::Library
object (for instance when $library is sent to GetPreparedLetter).

Test plan:
1/ Print a basket group, the library names should be correctly
displayed.
2/ Enable emailLibrarianWhenHoldIsPlaced and place a hold, a HOLDPLACED
notice will be generated (focus on the library name)
3/ Edit a patron and change his/her library
4/ Generate the advanced notices (misc/cronjobs/advance_notices.pl) and
have a look at the generated notices
5/ Same of overdues notices
6/ Set IndependentBranches and use a non superlibrarian user to place a
hold. The "pickup at" should be correctly filled.

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

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

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-02-24 03:55:06 +00:00
f4d6c1cd50 Bug 15629: Koha::Libraries - Remove GetBranchesInCategory (3)
C4::Branch::GetBranchesInCategory is not used anymore and can be
removed.

Test plan:
  git grep GetBranchesInCategory
should not return any result.

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

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

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-02-24 03:55:06 +00:00
07f85e7f88 Bug 15631: Koha::Cities - remove getidcity and GetCities
C4::Members::getidcity and C4::Members::GetCities simply retrieved
cities info from the cities table.
The job done in members/memberentry.pl looked really weird and complicated.
Either I have missed something, or this patch can simplify it.

The expected behavior is:
1. Create a new patron => No city selected
2. Edit an existing patron => The borrowers.city value is selected
3. Add a guarantee => The borrowers.city of the guarantor is selected
4. Edit a guarantee => The borrowers.city of the guarantee is selected

Test plan:
Confirm that the expected behaviors are the ones before and after this patch.

Signed-off-by: Natasha <tasham_8@hotmail.com>

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

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-02-24 03:53:52 +00:00
fdc224e102 Bug 15631: Koha::Cities - remove getzipnamecity
C4::Members::getzipnamecity was not used and can be remove safely.

Test plan:
  git grep getzipnamecity
should not return any result.

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

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-02-24 03:53:51 +00:00
e51fe4a8f1 Bug 15731: Remove C4::Reports::Guided::build_authorised_value_list
This subroutine has been added by
  commit 42acfbf75b
  Bug 7993: Save reports with Group/Subgroup hierarchy

But it has never been used (or git grep cheats me).

Test plan:
1/ git grep build_authorised_value_list
should not return any result
2/ Create a report, execute it
Everything should work fine.

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

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

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-02-24 03:36:56 +00:00
ad8d063ffa Bug 15769: Remove outdated C4::Koha::slashifyDate subroutine
This subroutine does not make sense anymore (Koha::DateUtils should be
used) and is no longer used.
It can be removed safely.

Test plan:
  git grep slashifyDate
should not return any results

  prove t/Koha.t
and
  prove t/db_dependent/Koha.t
should return green

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
slashifyDate removed, all test pass successfully

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

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-02-24 03:35:29 +00:00
2ea901c641 Bug 15783: AddAuthorisedValue - Remove the subroutine
Test plan:
  prove t/db_dependent/Koha.t
should return green

  git grep AddAuthorisedValue
should not return any results

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

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

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-02-24 03:34:14 +00:00
50c6991f49 Bug 15796: Remove C4::Koha::get_itemtypeinfos_of
This subroutine is no longer in use.

Test plan:
  git grep get_itemtypeinfos_of
should not return any results.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Trivial and needed removal.

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-02-24 03:33:05 +00:00