koha-equinox.git
10 years agoBug 7143: Updating history with new developers
Chris Cormack [Thu, 13 Mar 2014 20:20:34 +0000]
Bug 7143: Updating history with new developers

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 12073: don't show link URLs when printing Bootstrap OPAC detail page
Frédéric Demians [Fri, 11 Apr 2014 15:23:50 +0000]
Bug 12073: don't show link URLs when printing Bootstrap OPAC detail page

On OPAC Bootstrap detail page, by clicking Print link on the right the
page is printed. But the printed page contains HTML <a> anchors URL
attribute. It's useless, and unreadable. It isn't the case with prog
theme.

This patch hides all <a> href attributes when printing any OPAC page.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described and improves the printed detail page's readability.
Currently there is no less file for the print.css.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 12069: redirect to staff login if you access members/mod_debarment.pl when logged out
Owen Leonard [Thu, 10 Apr 2014 19:50:40 +0000]
Bug 12069: redirect to staff login if you access members/mod_debarment.pl when logged out

members/mod_debarment.pl's call to checkauth should pass 'intranet' so
that if the user happens to be logged out they will be redirected to the
staff client login form, rather than the OPAC.

To test, apply the patch and log in to the staff client:

- Add a restriction to a patron's account.
- View the restrictions tab on the patron's account. You should see the
  restriction and a "Remove" link for that restriction.
- In another tab, log out of the staff client.
- In the first tab, click the "Remove" link. You should be redirected to
  the staff client login page.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Good catch! Works as described, passes all tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 12076: better detect an untranslatable template construct
Galen Charlton [Fri, 11 Apr 2014 18:49:07 +0000]
Bug 12076: better detect an untranslatable template construct

Per bug 6458, template constructs of the form

<li [% IF (foo) %]selected="selected"[% END %]...

are forbidden as they can cause problems with translated templates.
However, the tt_valid.t test currently doesn't catch the variation
where '-' is used to suppress extra whitespace:

<li [%- IF (foo) -%]selected="selected"[%- END -%]...

This patch corrects the issue.

To test:

[1] Temporarily add the following line to a template file:

<li [%- IF a -%]a="a"[%- END -%] />

[2] Run prove -v xt/tt_valid.t.  Note that no error is reported.
[3] Apply the patch, and rerun the tt_valid.t test.  This time,
    an error should be reported.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Works well, detects the forbidden pattern
No koha-qa errors.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, passes all tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11563: (follow-up) remove some tabs
Galen Charlton [Fri, 11 Apr 2014 17:51:50 +0000]
Bug 11563: (follow-up) remove some tabs

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11563: (follow-up) improve selector for adding noEnterSubmit to select elements
Jonathan Druart [Tue, 25 Mar 2014 08:30:14 +0000]
Bug 11563: (follow-up) improve selector for adding noEnterSubmit to select elements

Test plan:
To test on modified pages:
- Press enter when cursor is on input or select and verify the form is not
submitted.

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11563: (follow-up) add noEnterSubmit class to pulldowns
Kyle M Hall [Fri, 7 Mar 2014 14:05:31 +0000]
Bug 11563: (follow-up) add noEnterSubmit class to pulldowns

When using Chrome on Mac OS X, form submits are triggered by hitting
enter when focused on a select. This is not an issue with any other
combination of browser and operating system that I am aware of.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11563: (follow-up) change .live() to .on()
Kyle M Hall [Wed, 26 Feb 2014 17:51:11 +0000]
Bug 11563: (follow-up) change .live() to .on()

The jquery event handler .live() has been deprecated. It is recommended
that .on() be used instead.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11563: restore preventing the enter key from submitting several forms
Fridolin Somers [Tue, 25 Feb 2014 11:13:13 +0000]
Bug 11563: restore preventing the enter key from submitting several forms

Several forms that take patron or item barcodes as input stopped
preventing the enter key (which is often sent by barcode scanners)
from submitting the form.

The code binding the CSS class noEnterSubmit to the handler preventing
submission when hitting the enter key was no longer triggered.  This is
because this class is added using JavaScript in $(document).ready() and
the keypress event listerning is also set using $(document).ready().

This patch corrects by using JQuery live() with will set event handlers
for HTML generated with JavaScript.

Also sets noEnterSubmit to use the checkEnter(e) function, as that has
broader browser compatibility.  Also corrects a small bug, for IE,
window.event must be used, not event alone.

Test plan :
- Flush browser cache (Crtl+F5) to update js files
- Go to patron creation : members/memberentrygen.tt
- Type a text in all mandatory inputs
- Type some caracters in a non mandatory input
- Press Enter key
=> Without patch : the form is submitted
=> With patch : the form is not submitted
- Try to set several lines in a textarea
=> It works (checks that in this case enter key is allowed)
- Test other pages usign noEnterSubmit class :
cataloguing/additem.tt
course_reserves/course.tt
members/mancredit.tt
members/maninvoice.tt
patron_lists/list.tt

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, tested in Firefox and Chromium.
Passes tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11960: replace unnecessary call of GetMemberDetails by CanBookBeRenewed
Jonathan Druart [Wed, 19 Mar 2014 15:38:20 +0000]
Bug 11960: replace unnecessary call of GetMemberDetails by CanBookBeRenewed

C4::Circulation::CanBookBeRenewed called C4::Members::GetMemberDetails to
retrieve categorycode and branchcode.

- categorycode is used to retrieve the issuing rule
- the borrower information is passed to
  C4::Circulation::_GetCircControlBranch. Which only uses the branchcode
  parameter.

GetMemberDetails does a lot of calls/queries (patronflags,
account, etc.) that are not needed by CanBookBeRenewed.

This patch replaces it with a call to C4::Members::GetMember.

Note: I presented this small optimisation during a quick introduction to
NYTProf (hackfest 14 in Marseille).

Test plan:
- launch member unit tests
- check the code

Checking the code resulted in the following:
CanBookBeRenewed builds a hash reference from the borrowernumber
(2482). Note it is only used in this function and not passed in.

_GetCircControlBranch (2485) requires that hashreference to
have a branchcode key. As stated above.

The following line (2486) requires it have a categorycode key.

As such, C4::Members::GetMemberDetails is confirmed to be
overkill, and C4::Members::GetMember is sufficient.

Testing Done
------------
0) Back up DB
1) Make sure MPL is in the list of libraries.
2) Apply the patch.
3) run the koha qa test tool
4) prove -v t/db_dependent/Circulation.t

Patch applies cleanly. QA Test tool was all OK. All tests ran successfully.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11598: (follow-up) improve help text for --html and --text options
Galen Charlton [Fri, 11 Apr 2014 16:21:14 +0000]
Bug 11598: (follow-up) improve help text for --html and --text options

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11598: Add --text option to overdue_notices similar to --html option
Kyle M Hall [Wed, 22 Jan 2014 14:50:16 +0000]
Bug 11598: Add --text option to overdue_notices similar to --html option

We have a number of reports of libraries that were upset by Bug 10720
being fixed! These libraries preferred this single file output, but as
text only. We should bring back this behavior, but as a feature, not a
bug.

Test Plan:
1) Apply this patch
2) Run overdue_notices.pl --html
3) Note the output is wrapped in html tags
4) Run overdue_notices.pl --text
5) Note the same output, but not wrapped in html tags

Signed-off-by: wajasu <matted-34813@mypacks.net>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
To test, add the -n parameter.
The filename generation could be refactored but not blocker.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 12040: Add 3 parameters to runreport.pl for SMTP authentication
Chris Nighswonger [Mon, 7 Apr 2014 15:55:35 +0000]
Bug 12040: Add 3 parameters to runreport.pl for SMTP authentication

This patch adds three optional parameters to runreport.pl
to allow authentication with the SMTP server.

--username -> Username to pass to the SMTP server for
              authentication
--password -> Password to pass to the SMTP server for
              authentication
--method   -> Method is the type of authentication.
              Ie. LOGIN, DIGEST-MD5, etc.

Test Plan
---------
As for testing manually using a Gmail account:

1. Set up your sendmail as shown in
    misc/cronjobs/CONFIGURE.gmail

2. Before applying this patch, run misc/cronjobs/runreports.pl
    on your favorite report including the proper email parameters
    against your gmail account.

3. Note the failure message stating the authentication
    requirement.

4. Apply this patch, and return the script including the
    additional parameters and specifying "LOGIN" for the method.

5. Note the successful send.

6. perldoc misc/cronjobs/runreport.pl

7. Run the koha qa test tool.

Signed-off-by: Chris Nighswonger <cnighswonger@foundations.edu>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11441: (follow-up) improve utility help text
Galen Charlton [Fri, 11 Apr 2014 15:25:41 +0000]
Bug 11441: (follow-up) improve utility help text

This patch expands and reformats the help text displayed
when running remove_unused_authorities.pl -h.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11441: enhance remove_unused_authorities.pl ability to select records
Juan Romay Sieira [Tue, 21 Jan 2014 11:46:09 +0000]
Bug 11441: enhance remove_unused_authorities.pl ability to select records

remove_unused_authorities.pl previously required that --aut be supplied
to specify one or more authority types to check for unlinked authority
records.  If --aut was omitted, it would default to search for
records of authority type NC, which is not present in many (or any?)
Koha databases.

Now, if --aut is omitted, unlinked authority records of any type
are removed.

To test it:
Parse only PERSO_NAME authorities:
misc/migration_tools/remove_unused_authorities.pl -aut PERSO_NAME

Parse all authorities:
misc/migration_tools/remove_unused_authorities.pl

Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11995: restore ability of serialsUpdate.pl to calculate next serial issue dates
Jonathan Druart [Mon, 24 Mar 2014 14:25:05 +0000]
Bug 11995: restore ability of serialsUpdate.pl to calculate next serial issue dates

Bug 7688 changed the prototype for GetNextDate, but the serialsUpdate.pl
cronjob script had not been updated.  This patch fixes the problem.

Test plan:
Before applying the patch:
1/ Check that the following SQL query returns something:
SELECT serial.*
FROM serial
LEFT JOIN subscription ON (subscription.subscriptionid = serial.subscriptionid)
WHERE serial.status = 1
AND DATE_ADD(planneddate, INTERVAL CAST(graceperiod AS SIGNED) DAY) < NOW()
AND subscription.closed = 0;
2/ Run misc/cronjobs/serialsUpdate.pl -v
   It should die with an error message like this:
   Can't use string ("2011-03-05") as a HASH ref while "strict refs" in use
3/ Apply the patch
4/ Run misc/cronjobs/serialsUpdate.pl -v
   It should exit normally and print messages like this:
   Serial issue with id=XX updated
5/ Run the Koha QA test tools.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 7267: Add account number to German PDF template
Katrin Fischer [Thu, 27 Feb 2014 09:16:21 +0000]
Bug 7267: Add account number to German PDF template

To test:
- Switch system preference OrderPdfFormat to pdfformat::layout2pagesde
- Create one or more baskets with some orders each.
- Add all baskets to one basket group
- Print the basket group
- Check the account number from your vendor shows up with the other
  vendor details

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 7267: Add account number to English PDF templates
Katrin Fischer [Thu, 27 Feb 2014 09:13:33 +0000]
Bug 7267: Add account number to English PDF templates

To test:
- Switch system preference OrderPdfFormat to pdfformat::layout2pages
- Create one or more baskets with some orders each.
- Add all baskets to one basket group
- Print the basket group
- Check the account number from your vendor shows up with the other
  vendor details
- Repeat with pdfformat::layout3pages

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 7267: Add account number to French PDF template
Katrin Fischer [Thu, 27 Feb 2014 09:17:44 +0000]
Bug 7267: Add account number to French PDF template

To test:
- Switch system preference OrderPdfFormat to pdfformat::layout3pagesfr
- Create one or more baskets with some orders each.
- Add all baskets to one basket group
- Print the basket group
- Check the account number from your vendor shows up with the other
  vendor details

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11828: (follow-up) add new option to OrderPdfFormat
Katrin Fischer [Sat, 1 Mar 2014 08:33:27 +0000]
Bug 11828: (follow-up) add new option to OrderPdfFormat

To test:
- Check appearance of the OrderPdfFormat system preference
  It will offer a pull down with options, including
  "German 2-page"

Followed test plan. Patch behaves as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11828: Add German translation of layout2pages PDF template
Katrin Fischer [Wed, 26 Feb 2014 16:50:10 +0000]
Bug 11828: Add German translation of layout2pages PDF template

To test:
- Switch system preference OrderPdfFormat to pdfformat::layout2pagesde
- Create one or more baskets with some orders each.
- Add all baskets to one basket group
- Print the basket group
- Check everything is translated into German and the formatting/layout
  looks ok

Followed test plan and compared English with German printout.
German version is OK.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11885: (follow-up) add a CSS class to set subfield code bold
Jonathan Druart [Fri, 11 Apr 2014 08:32:37 +0000]
Bug 11885: (follow-up) add a CSS class to set subfield code bold

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11885: (follow-up) remove tabs
Bernardo Gonzalez Kriegel [Wed, 9 Apr 2014 11:43:23 +0000]
Bug 11885: (follow-up) remove tabs

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11885: (follow-up) make default styling consistent with previous look
Mark Tompsett [Thu, 3 Apr 2014 00:22:44 +0000]
Bug 11885: (follow-up) make default styling consistent with previous look

Jonathan Druart raised the following three issues:
1/ subtags was bold before patch
2/ 1 dash existed between tag and tag name
3/ A space has been added ("606 #1 - Sujet nom commun"
    becomes "606 # 1 Sujet nom commun",  "101 ## - Langue"
    becomes "101 # # Langue")

This patch addresses them in the following way:
1/ You will note that @ was not bold on the 0 tab.
   Every other tab were bold. By making the similar template
   into a procedure based on the 0XX tab, bolding was lost.
   This patch bolds all subtags including the @, so that
   the visible change is minimized.
2/ The dash was programmatically added in at the code stage
   previously. This bug fix splits the the single concatenation
   mess into parts which can be styled. This puts the dash back
   into the template. However, it should be noted that the
   spacing for the 0 tab's tag and tag description will have an
   extra space after the hypen that was lacking before.
3/ <span>...</span><span>...</span> is different than
   <span>...</span>
   <span>...</span>
   The later puts that extra space. This patch fixes that.

See comment 1 for the test plan.

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

Work as described.
Small koha-qa errors fixed in followup

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11885: fix inconsistent HTML in MARC Details
Pasi Kallinen [Tue, 4 Mar 2014 06:57:11 +0000]
Bug 11885: fix inconsistent HTML in MARC Details

In Catalog > MARC Details, the HTML in the different tabs is slightly
inconsistent and doesn't differentiate different elements, making CSS
styling complicated or impossible:

* tab 0 has <p class="subfield_line"> whereas all the other tabs
  have just <p>

* all other tabs wrap the subfield character in <b> tags, except
  for tab 0

* the MARC tag title is a single div with the tag, the indicators
  and the field description.

Attached patch folds all the tab outputs into a single TT BLOCK,
which is then reused. It also marks the separate parts of the tag
title in their own spans.

The output should be nearly identical to previous behaviour, minus
a dash from the tag title descriptions - it was used to separate
the tag from the description. The description can now be styled
separately from the tag itself, so the dash can be added with CSS,
if necessary.

Revised test:
1) Find a biblio
2) Edit the record so that there is something in every tab (0-9).
3) Save and then click 'MARC' in the left pane to view the
    MARC details.
4) Note the contents of each tab.
5) Apply patch
6) Compare the MARC details output to what was noted. Should
   be the same, minus a dash in each of the tag title descriptions.

Signed-off-by: Pasi Kallinen <pasi.kallinen@pttk.fi>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11951: fix OPAC search suggestions template error
Owen Leonard [Mon, 17 Mar 2014 13:34:03 +0000]
Bug 11951: fix OPAC search suggestions template error

If you have search suggestions enabled in the OPAC and click the "Check
for suggestions" link before it is replaced with the JS-rendered output
you will get a template error. This patch corrects it.

To test you must have the bootstrap theme enabled and at least one
OPAC plugin enabled in Administration -> Did you mean?

- Perform a search in the OPAC.
- Look for a box which says "Not what you expected? Check for
  suggestions"
- Click the "Check for suggestions" link before it disappears. If
  necessary disable JavaScript in your browser so that the link doesn't
  disappear.
- The search suggestions page should render without errors.

Signed-off-by: A. Sassmannshausen <alex.sassmannshausen@ptfs-europe.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
The non-Javascript fallback link now works correctly.
Passes tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11184: correct attribute cloning for the patron editor
Srdjan [Fri, 1 Nov 2013 08:24:11 +0000]
Bug 11184: correct attribute cloning for the patron editor

This patch fixes Perl warnings logged when setting up the
patron attribute form in the patron editor.

To test - Patron details entry page:
* Have  ExtendedPatronAttributes enabled. Check that "Additional
  attributes and identifiers" section behaves.
* Verify that editing and saving a patron record does not
  result in the following sorts of entries in the Apache log:

  se of uninitialized value $_ in hash element at memberentry.pl line 798
  Use of uninitialized value in anonymous hash ({}) at memberentry.pl line 798

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested with different types of patron attributes:
- repeatable
- linked to an authorized value
- free text
Tested editing, adding, removing one of multiple, adding multiple,
etc. No regressions found.
Passes all tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 10865: (Follow-up) Add CSS style for form hints
Owen Leonard [Wed, 9 Apr 2014 16:41:24 +0000]
Bug 10865: (Follow-up) Add CSS style for form hints

This patch adds a new "hint" class for displaying information relating
to a form field. On the list edit screen the hint also has an alert
class to highlight it.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script. Works as advertised.
Tested with Bootstrap and prog theme. Some notes:

- When OpacAllowPublicListCreation is turned off, the permissions
  don't show.
- When OpacAllowPublicListCreation is turned off, we could also hide
  the Category pull down in the [new list] pop up, as there is only
  Private left as an option.
- Maybe we should move the new list link outside of the tabs?
  When OpacAllowPublicListCreation is turned off, but public lists
  exist, the link 'new list' will still show on the public list tab,
  but a private list will be created.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agobug 10865: (follow-up) allow patrons to make their public lists private when OpacAllo...
Galen Charlton [Fri, 21 Feb 2014 20:44:24 +0000]
bug 10865: (follow-up) allow patrons to make their public lists private when OpacAllowPublicListCreation is off

This patch ensures that patrons continue to have the ability to make
their public lists private for any public lists they control that were
created before the library turned the OpacAllowPublicListCreation
system preference off.

To test:

[1] Ensure OpacAllowPublicListCreation is on.
[2] As a patron, create a public list in the OPAC.  Also, create
    a private list.
[3] Turn OpacAllowPublicListCreation off.
[4] Back in the OPAC, verify that the public list can be edited
    and that there are drop-downs for category and permissions.
    Also verify that there is a warning that the patron cannot
    change it back if they convert a public list to private.
[5] Edit the private list created in step 2.  Verify that the
    category and permissions drop-downs are not displayed.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Broust <jean-manuel.broust@univ-lyon2.fr>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 10865: (follow-up) Move a li tag to avoid overlapping tags
Jonathan Druart [Wed, 12 Feb 2014 10:33:21 +0000]
Bug 10865: (follow-up) Move a li tag to avoid overlapping tags

With this patch, a li tag is empty (only using the bootstrap theme) if
the pref is disabled.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Broust <jean-manuel.broust@univ-lyon2.fr>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 10865: Don't show list permissions when adding public lists/sharing lists is...
Owen Leonard [Fri, 13 Sep 2013 14:50:27 +0000]
Bug 10865: Don't show list permissions when adding public lists/sharing lists is not allowed

If patron creation of public lists is disallowed by the
OpacAllowPublicListCreation system preference the "category" option
should be hidden altogether instead of showing a <select> with "private"
as the only option. This patch hides category and permissions controls
when OpacAllowPublicListCreation is set to "don't allow."

To test you must have the virtualshelves system preference enabled.
Apply the patch and log into the OPAC. Test:

- With OpacAllowPublicListCreation enabled, create a new list. You
  should see options for setting category and permissions. Saving the
  new list should complete correctly and save the right settings.
- With OpacAllowPublicListCreation enabled, edit an existing list. You
  should see the same options and saving your changes should work
  correctly.
- With OpacAllowPublicListCreation disabled, create a new list. You
  should only see fields for title and sort. Saving this list should
  complete correctly and save the right settings.
- With OpacAllowPublicListCreation disabled, edit an existing list. You
  should be able to edit only title and sort settings. Saving your
  changes should work correctly.

Repeat your tests for both prog and bootstrap themes.

Revision: Existing public lists can be edited and retain their public
status even if OpacAllowPublicListCreation has since been disabled. This
preserves the behavior previous to this patch.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
This patch fixes a big ergonomic issue.
Note: to me, the "New list" action should be outside the tabs.
It is confusing to have a "new list" into the public lists tab when it
is not possible to create new public lists.

Signed-off-by: Broust <jean-manuel.broust@univ-lyon2.fr>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 12056: fix untranslatable strings in calendar
Owen Leonard [Wed, 9 Apr 2014 13:08:27 +0000]
Bug 12056: fix untranslatable strings in calendar

In the calendar there are some strings in a JavaScript function which
are not properly wrapped in a function for translation. This patch
corrects this.

This patch also corrects some minor validation issues and spelling and
grammar issues, including those covered by Bug 12055.

To test, apply the patch and view the calendar in Tools -> Calendar.
When you hover your mouse over a day in the calendar you should see a
title tooltip indicating what kind of day/holiday it is and showing the
title of the holiday, if any.

To test that the strings are now being picked up for translation,
run translate update on a po file and confirm that the affected strings
are now present: "Weekly holiday," "Yearly holiday," etc.

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

Works well. New strings on translation file. No koha-qa errors.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, passes all tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 12060: remove extraneous tags from header.inc
Mark Tompsett [Wed, 9 Apr 2014 18:34:21 +0000]
Bug 12060: remove extraneous tags from header.inc

By correcting the indentation, it became more apparent the two
markup errors (stray </li> and </div> tags) that were generated
by pasting the page source of
   PROTOCOL://STAFFCLIENT/cgi-bin/koha/tools/holidays.pl
into http://validator.w3.org/check

TEST PLAN
---------
1) Home -> Tools -> Calendar in the staff client
2) In another tab open http://validator.w3.org/check
3) Select Validate by Direct Input
4) In the staff client, view the page source
5) Copy the page source to the Validation text box in the
    other tab.
6) Click the 'Check' button.
   -- There will be 3 errors.
7) Apply the patch.
8) Refresh the staff client page.
9) Copy the revised page source into the validation text box.
10) click the 'Check' button.
    -- There will be 1 error.
11) Run the koha qa test tool.

NOTE: This error is not in the intended file to fix.
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
git diff --color -w HEAD^ reveals, that only a </li> and a </div>
are removed by this patch, all other changes are whitespace.
Passes all tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11734 - Use new DataTables include in batch modification templates
Owen Leonard [Mon, 10 Feb 2014 17:26:34 +0000]
Bug 11734 - Use new DataTables include in batch modification templates

Bug 10649 introduced a new include file for adding DataTables-related
JavaScript assets. This patch adds use of this include file to the
batch modification and batch deletion pages.

Minor text changes: Corrected capitalization.

Apply the patch and test the following:

- On batch modification and batch deletion, submit multiple barcodes or
  item numbers. On the results page the title column has been configured
  to use the "anti-the" filter to exclude articles from sorting. Sorting
  on all columns should work correctly.

Edit: Put back checkboxes plugin which was accidentally removed.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, passes all tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11711 - Use new DataTables include in circ templates
Owen Leonard [Fri, 7 Feb 2014 19:06:50 +0000]
Bug 11711 - Use new DataTables include in circ templates

Bug 10649 introduced a new include file for adding DataTables-related
JavaScript assets. This patch adds use of this include file to all
circ-related pages which use DataTables.

Apply the patch and test the following pages to confirm that table
sorting works correctly:

- Circulation
  - The UseTablesortForCirc system preference must be enabled.
  - Check out to a patron with existing checkouts. Choose a patron who
    is a guarantor to another patron with checkouts in order to test the
    relatives' checkouts table.
  - The checkouts and relatives' checkouts tables have been modified to
    exclude articles when sorting of titles.

- Hold ratios - The title column has been configured to exclude articles
  from sorting

- Transfer to receive

- Holds queue
  - The title column has been configured to exclude articles when
    sorting
  - The date column has been modified to use the title-string filter for
    sorting. An unformatted date is now passed from C4::HoldsQueue.pm to
    the template, where the KohaDates filter is used for formatting.
    Sorting is based on the unformatted date.

- Holds awaiting pickup
  - The "available since" column has been configured for sorting on an
    unformatted date. waitingreserves.pl now passes the unformatted
    date to the template, and formatting is done using the KohaDates
    filter.
  - The title column has been configured to exclude articles when
    sorting.

Edit: Rebased on current master following commit of Bug 11605
Signed-off-by: A. Sassmannshausen <alex.sassmannshausen@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11855: remove unused template file
Jonathan Druart [Tue, 18 Mar 2014 15:01:07 +0000]
Bug 11855: remove unused template file

members/search.tt is not in use anymore.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11855: Tiny code cleanup in members
Marcel de Rooy [Thu, 27 Feb 2014 08:12:25 +0000]
Bug 11855: Tiny code cleanup in members

[1] Template variable actionname is not used in the associated
template. This could be a copy-paste from serials/member-search.pl.
Consequently, the module is no longer needed in member.pl. Template
members/search.tt still contains actionname; it seems that this
emplate is not used too.

[2] $template_name not used in members-home.pl.

Test plan:
[1] Go to Patrons. If you reach that page, you tested members-home.pl
[2] Add a new patron.
[3] Search for a patron. Edit one.

Followed test plan. No problems found.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11978 - Fix URLs displayed in OverDrive search
Jesse Weaver [Thu, 20 Mar 2014 17:20:40 +0000]
Bug 11978 - Fix URLs displayed in OverDrive search

OverDrive has recently changed its APIs to include "http://" in the URLs
it returns. This patch removes the "http://" on the Koha end so they
aren't doubled.

Test plan:
  1. Run an OverDrive search on the OPAC.
  2. Check the links, they should start with "http://http://"
  3. Apply this patch.
  4. Rerun the search, the links should now be correct.

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

I can reproduce the problem and confirm that this patch fixes it.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Patch removes hardcoded http:// from URLs in the Overdrive code.
Trusting Jesse and Owen to have tested this with Overdrive,
code review reveals no additional changes or possible problems.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 9075: Rename "type" to "material type" on OPAC XSLT detail and results
Marcel de Rooy [Fri, 4 Apr 2014 15:11:15 +0000]
Bug 9075: Rename "type" to "material type" on OPAC XSLT detail and results

The label Material type better describes what the icon presents.
It is based on leader values of the MARC record.

Revised Test Plan
-----------------
 1) In the staff client, set the OPAC system preference
     OPACXSLTDetailsDisplay to 'default' and save.
 2) In the staff client, set the OPAC system preference
     OPACXSLTResultsDisplay to 'default' and save.
 3) In the staff client, set the OPAC system preference
     opacthemes to 'bootstrap' and save.
 4) In the OPAC, search for biblio used in previous patch testing.
    -- It should display "Type:"
 6) Look at the biblio details
    -- It should also display "Type:"
 7) In the staff client, set the OPAC system preference
     opacthemes to 'prog' and save.
 8) In the OPAC, search for biblio used in previous patch testing.
    -- It should display "Type:"
 9) Look at the biblio details
    -- It should also display "Type:"
10) Apply the patch
11) In the staff client, set the OPAC system preference
     opacthemes to 'bootstrap' and save.
12) In the OPAC, search for biblio used in previous patch testing.
    -- It should display "Material type:" this time.
13) Look at the biblio details
    -- It should display "Material type:" this time.
14) In the staff client, set the OPAC system preference
     opacthemes to 'prog' and save.
15) In the OPAC, search for biblio used in previous patch testing.
    -- It should display "Material type:" this time.
16) Look at the biblio details
    -- It should display "Material type:" this time.
17) Run the koha qa test tool.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Note: Just a simple string change.
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
String change, works as advertised in staff, prog and bootstrap
OPAC.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 9075: Rename "type" to "material type" on staff XSLT detail and results
Marcel de Rooy [Mon, 11 Apr 2011 09:46:44 +0000]
Bug 9075: Rename "type" to "material type" on staff XSLT detail and results

The label Material type better describes what the icon presents.
It is based on leader values of the MARC record.

Revised Test Plan
-----------------
1) Set the Staff system preference XSLTDetailsDisplay to
   'default' and save.
2) Set the Staff system preference XSLTResultsDisplay to
   'default' and save.
3) Click 'Search the catalog' tab in the search area.
4) Search for something
5) Look for a biblio that has 942$c set to some type.
   -- It should display "Type:"
   Or take a result and modify it to have a 942$c.
6) Look at the biblio details
   -- It should also display "Type:"
7) Apply the patch
8) Search for the same biblio again.
   -- It should display "Material type:" this time.
9) Look at the biblio details
   -- It should display "Material type:" this time.
10) Run the koha qa test tool.

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

Note: This is a simple string substitution.
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 7413: (follow-up) tweak description of the AllowRenewalLimitOverride syspref
Galen Charlton [Tue, 8 Apr 2014 23:28:21 +0000]
Bug 7413: (follow-up) tweak description of the AllowRenewalLimitOverride syspref

As it happens, the AllowRenewalLimitOverride serves to both allow
operators to override renewal blocks when the renewal exceed the
maximum renewal count or when the renewal is premature.  This
patch adjust the wording to reflect the expansion in meaning; if
it turns out that folks want to distinguish between overriding the
maximum renewal count and overriding premature renewals, a new
system preference can be added later.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 7413: (follow-up) teach renew interface about too_soon
Galen Charlton [Tue, 8 Apr 2014 23:22:05 +0000]
Bug 7413: (follow-up) teach renew interface about too_soon

This patch ensures that the new staff interface for renewals
recognizes when premature renewals are requested.  If the
AllowRenewalLimitOverride system preference is enabled, staff members
are able to override the block:

To test:

[1] Set up a loan policy with a "no renewal before" value and
    check out an item.
[2] In the renewal page, verify that attempting to renew the loan
    results in an error forbidding the renew.
[3] If AllowRenewalLimitOverride is enabled, the operator should
    also be given the option to override the block.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 7413: (follow-up) add direct unit tests
Galen Charlton [Tue, 8 Apr 2014 23:05:13 +0000]
Bug 7413: (follow-up) add direct unit tests

This patch adds a direct unit test of GetSoonestRenewDate()
and verifies that CanBookBeRenewed() returns a 'too_soon'
error as expected.

To test:

[1] Verify that prove -v t/db_dependent/Circulation.t passes.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 7413: (follow-up) improve return of GetSoonestRenewDate()
Galen Charlton [Tue, 8 Apr 2014 22:52:01 +0000]
Bug 7413: (follow-up) improve return of GetSoonestRenewDate()

This patch modifies GetSoonestRenewDate() so that it returns
undef if the patron, item, or loan cannot be found.  This
better reflects the usage of this routine GetSoonestRenewDate(),
as none of its callers tried to check the second return
value containing an error code.

This patch also updates the POD to match.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 7413: (follow-up) validate norenewalbefore values better
Galen Charlton [Tue, 8 Apr 2014 22:46:28 +0000]
Bug 7413: (follow-up) validate norenewalbefore values better

This patch ensures both both '0' and strings consisting of zero
or more blanks are recognized by the circ rules editor as specifying
clearing the "no renewal before" value.  Concretely, this fixes
warnings of the following form when clearing this field:

    Argument "" isn't numeric in numeric eq (==)

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 7413: update DBIC schema classes
Galen Charlton [Tue, 8 Apr 2014 22:40:52 +0000]
Bug 7413: update DBIC schema classes

Note that this patch also incorpates updates
for the new branches <-> opac_news relationship.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 7413: DBRev 3.15.00.028
Galen Charlton [Mon, 7 Apr 2014 18:30:17 +0000]
Bug 7413: DBRev 3.15.00.028

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 7413: Unit test
Holger Meißner [Fri, 14 Feb 2014 09:01:19 +0000]
Bug 7413: Unit test

This patch makes the new parameter norenewalbefore known to
unit test Circulation_Issuingrule.t.

To test:
1) Before applying the patch:
   prove t/db_dependent/Circulation_Issuingrule.t
2) Notice that the test fails with:
   $got->{norenewalbefore} = undef
   $expected->{norenewalbefore} = Does not exist
3) Apply the patch.
4) Run test again and it should pass.

Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>

10 years agoBug 7413: OPAC prog theme changes
Holger Meißner [Fri, 14 Feb 2014 08:56:10 +0000]
Bug 7413: OPAC prog theme changes

This patch makes the prog version of opac-user.tt handle the new
renewal error "too_soon".

To test:
1) Set global syspref "opacthemes" to prog.
2) Test the same things as in previous patch.

Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>

10 years agoBug 7413: OPAC bootstrap theme changes
Holger Meißner [Fri, 14 Feb 2014 08:11:19 +0000]
Bug 7413: OPAC bootstrap theme changes

This patch makes opac-user.pl and the bootstrap version of opac-user.tt
handle the new renewal error "too_soon".

To test:
1) Set global syspref "opacthemes" to bootstrap.
2) Set global syspref "OpacRenewalAllowed" to Allow.
3) Test the same things as in previous patch, this time for the OPAC
    summary page.

Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>

10 years agoBug 7413: Code and intranet template changes
Holger Meißner [Thu, 13 Feb 2014 16:05:08 +0000]
Bug 7413: Code and intranet template changes

This patch modifies CanBookBeRenewed, so that based on
issuingrules.norenewalbefore a new error "too_soon" can be returned.
Also adds a new subroutine GetSoonestRenewDate.

To test:
1) Create an issuing rule with "No renewal before" set to value X
   and "Unit" set to days.
2) Test the following steps for both:
   Home > Patron > Patron details
   Home > Circulation > Checkouts
3) On the checkout page, test for today's issues as well as previous
   issues. (Check something out on one day and something else on the
   next day, then do the testing.)
4) Confirm that items can't be renewed if current date is more than
   X days before due date.
5) Confirm that the date and time of the soonest possible renewal are
   displayed in the format specified by global sysprefs "dateformat"
   and "TimeFormat".
6) Confirm that items can be renewed if "No renewal before" is
   undefined or current date is X or less days before due date.
7) Confirm that if the number of allowed renewals is exceeded
   "Not renewable" is displayed, no matter what "No renewal before"
   is set to.
8) Test the same things with "Unit" set to hours.

Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>

10 years agoBug 7413: Add "No renewal before" to the circulation and fine rules
Holger Meißner [Wed, 12 Feb 2014 16:16:40 +0000]
Bug 7413: Add "No renewal before" to the circulation and fine rules

This patch adds a column "No renewal before" to the circulation and
fine rules table.

To test:
1) Add or edit some issuing rules.
2) Confirm that an empty entry, zero and non-numerical values for
   "No renewal before" are saved as undefined.
3) Confirm that numerical values can be entered and saved.

Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>

10 years agoBug 7413: Add issuingrules.norenewalbefore to database
Holger Meißner [Wed, 12 Feb 2014 15:53:06 +0000]
Bug 7413: Add issuingrules.norenewalbefore to database

Currently multiple renewals can be done in immediate succsession.
To optionally prevent this, a new parameter "No renewal before"
is introduced.

This patch adds issuingrules.norenewalbefore to the database.
Default value is NULL.

To test:
1) Run installer/data/mysql/updatedatabase.pl
2) Create a SQL report like:
   SELECT * FROM issuingrules
3) Confirm that norenewalbefore was added after renewalperiod.

Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>

10 years agoBug 7567: (follow-up) construct values clause in SQL statement more idiomatically
Galen Charlton [Mon, 7 Apr 2014 18:10:38 +0000]
Bug 7567: (follow-up) construct values clause in SQL statement more idiomatically

To test:

[1] Verify that prove -v t/db_dependent/NewsChannels.t passes

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 7567: (follow-up) make tests of get_opac_new more readable
Galen Charlton [Mon, 7 Apr 2014 17:45:44 +0000]
Bug 7567: (follow-up) make tests of get_opac_new more readable

This patch updates two of the tests cases to directly compare
the results returned by get_opac_new with the expected value
by using is_deeply().  Consequently, it removes the use of magic
numbers (which do not stop being magic numbers if they're wrapped
in constants named F1, F2, etc.).

To test:

[1] Verify that prove -v t/db_dependent/NewsChannels.t passes.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 7567: DBRev 3.15.00.027
Galen Charlton [Mon, 7 Apr 2014 17:01:18 +0000]
Bug 7567: DBRev 3.15.00.027

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 7567: (follow-up) Modify DataTables configuration
Owen Leonard [Thu, 27 Mar 2014 13:30:24 +0000]
Bug 7567: (follow-up) Modify DataTables configuration

This follow-up corrects a JavaScript error by converting the sorting
configuration to be class-based
(http://wiki.koha-community.org/wiki/DataTables_HowTo#Sorting_dates_regardless_of_date_format_preference).

I have also changed the DataTables configuration to allow for pagination
and JS-based filtering.

To test, apply the patch and view the list of News items. Your browser
should report no JavaScript errors. Table sorting, pagination, and
filtering should work correctly.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 7567: QA followup: remove useless $parameters hashref
Jonathan Druart [Thu, 27 Mar 2014 12:15:14 +0000]
Bug 7567: QA followup: remove useless $parameters hashref

This hashref is useless, it is only used once.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 7567: QA followup: FIX SQL query
Jonathan Druart [Thu, 27 Mar 2014 12:14:08 +0000]
Bug 7567: QA followup: FIX SQL query

The WHERE clause should not erase $query.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 7567 - Use, display, filter News by library
Mark Tompsett [Fri, 20 Dec 2013 03:59:28 +0000]
Bug 7567 - Use, display, filter News by library

This adds the ability to specify whether staff, OPAC,
or slip news entries apply to all libraries or just a
particular library.

With the branch parameter added to key functions in
C4/NewsChannels.pm, function calls in C4/Members.pm,
mainpage.pl, opac/opac-main.pl, tools/koha-news.pl, and
t/db_dependent/NewsChannels.t were needed.

Some license texts were updated.

Templates were modified to display, allow for entry and editing
of the branches selected.

TEST PLAN
---------
1) Having logged into the staff client, is the news displaying
   correctly? Have you entered a news item which should not
   display for this branch of logged in user?
2) Find a patron (with some items checked out?)
3) Print a slip
   - News which is labelled 'All Branches' or for the same branch
     as the one printing the slip should display on the slip.
   - THIS DOES NOT AFFECT QUICK SLIPS
4) Home -> Tools -> News
   - Can you edit a news item?
   - Does the change save correctly?
   - Can you filter based on location and branch correctly?
   - Can you add a new entry correctly?
   - Can you delete an entry correctly?
5) Open an OPAC client.
   - Does only the news for all branches display?
6) Log into the OPAC client.
   - Does the news for all branches and the specific branch display?
7) prove -v t/db_dependent/NewsChannels.t
   - Does it run and all succeed?
   - Does the code seem to catch the required cases?
8) Comparing the patched and unpatched versions of files affected,
   are the license changes missing anything?

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 7567 - Schema update for opac_news
Mark Tompsett [Mon, 17 Feb 2014 03:40:28 +0000]
Bug 7567 - Schema update for opac_news

This was generated by:
Reset hard to master.
Restore old DB
Apply the patches for 7567
./installer/data/mysql/updatedatabase.pl
./misc/devel/update_dbix_class_files.pl -db_name=... -db_user=... -db_passwd=...
git add Koha/Schema/Results/OpacNews.pm

This should provide the necessary changes to the schema files for
Koha 3.16 and forward.

Had to generate under Debian, because Ubuntu's was broken by comparison.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 7567 - Added branchcode to opac_news
Mark Tompsett [Thu, 19 Dec 2013 22:51:34 +0000]
Bug 7567 - Added branchcode to opac_news

This patch merely adds branchcode varchar(10) DEFAULT NULL to
the opac_news table.

TEST PLAN
---------
 1) backup your kohadata base if you care about the data.
 2) use the koha database
 3) describe opac_news;
 4) show create table opac_news;
    -- No branchcode constraint will exist.
 5) apply the patch
 6) upgrade the database (either staff client or script)
 7) use the koha database
 8) describe opac_news;
 9) show create table opac_news;
    -- The branchcode constraint should be listed.
10) drop that koha database
11) create the koha database
12) use the koha database
13) source ~/kohaclone/installer/data/mysql/kohastructure.sql
    -- there should be no errors in creating the database.
14) describe opac_news;
15) show create table opac_news;
    -- The branchcode constraint should be listed.
16) restore your koha database if you backed it up.

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

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 7567: convert news add/update routines to take hashref; fix bugs
Mark Tompsett [Mon, 16 Dec 2013 05:41:47 +0000]
Bug 7567: convert news add/update routines to take hashref; fix bugs

Changed the add and update functions to use a hash reference
for the parameter, so that adding or subtracting parameters
should be easier. Added some POD for the add_opac_news and
upd_opac_news functions, so that developers would know how to
call it.

The hashref changes resulted in being able to return 0 for
failure and 1 for success. This meant adding a couple tests
to the test file.

And while testing, there was some sort of logic problem with
the matter of '' being all, but selecting all only showed
things set for all, and excluded particular languages, or other
interfaces.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 7567: (code cleanup) remove finish calls
Mark Tompsett [Mon, 16 Dec 2013 03:33:32 +0000]
Bug 7567: (code cleanup) remove finish calls

"When all the data has been fetched from a SELECT statement,
the driver will automatically call finish for you. So you should
not call it explicitly except when you know that you've not
fetched all the data from a statement handle and the handle
won't be destroyed soon."
(http://search.cpan.org/~timb/DBI-1.627/DBI.pm#finish)

All the $sth variables were scoped within the functions,
and would be destroyed immediately. Additionally, there was
one after a SELECT, for only a single idnew, and so it was
not necessary.

TEST PLAN
---------
1) prove -v t/db_dependent/NewsChannels.t
2) apply patch
3) prove -v t/db_dependent/NewsChannels.t

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

ok 1 - use C4::NewsChannels;
ok 2 - Successfully added the first dummy news item!
ok 3 - Successfully added the second dummy news item!
ok 4 - Successfully updated second dummy news item!
ok 5 - Successfully tested get_opac_new id1!
ok 6 - Successfully tested get_opac_new id2!
ok 7 - Successfully tested get_opac_news!
ok 8 - Successfully tested GetNewsToDisplay!

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 7567 - Correct Filtering and Default dropdown values
Mark Tompsett [Sat, 14 Dec 2013 03:12:37 +0000]
Bug 7567 - Correct Filtering and Default dropdown values

In the staff client, when you went to Home -> Tools -> News
the default 'Display location' is 'All'. Everything is correctly
displayed. However, if you change the filter it filters the
table correctly, but does not set the dropdown value to match.
This patch corrects this.

TEST PLAN
---------
 1) Home -> Tools -> News
 2) Change 'Display location' value and click 'Filter'.
    - Is the 'Display location' value the same now?
      (no)
    - Are the correct values displayed?
 3) Click 'New entry'
    - Is it anything other than 'All'?
      (no, and is this correct?)
 4) Click 'Cancel'
 5) Click 'Edit' for various news items with different locations.
    - Does the 'Display location' get proper set?
      (no)
 6) Apply patch
 7) Change the 'Display location' value and click 'Filter'.
    - Does the 'Display location' value stay the same?
      (this should be correct now)
    - Are the correct values displayed?
 8) Change the 'Display location' value to 'All' and click 'Filter'.
    - Does everything display?
 9) Change the 'Display location' value and click 'Filter'.
10) Click 'New entry'
    - Does it match what the filter was?
      (should match now)
11) Click 'Cancel'
12) Click 'Edit' for various news items with different locations.
    - Does the 'Display location' get proper set?
      (this should be correct now)

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 7567: (code cleanup) remove excess line
Mark Tompsett [Fri, 13 Dec 2013 21:17:04 +0000]
Bug 7567: (code cleanup) remove excess line

The template parameter { $lang => 1 } does not seem used in
master. It is unconfirmed whether this is used in earlier
versions of Koha.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 7567 - Clean up sample news files
Mark Tompsett [Fri, 13 Dec 2013 20:51:36 +0000]
Bug 7567 - Clean up sample news files

Some files had truncate. Some files had foreign key checks.
Other files had foreign key checks disabled. Some files gave
the column names expressly, and others assumed the fields in
a particular order. Everything was modified to:
- not truncate
- not say utf8 (because it should already be by default)
- not disable foreign key checks (because it should work)
- expressly name the fields (adding fields shouldn't break it)

TEST PLAN
---------
0) Backup opac_news if you care about your news.
1) open mysql client
2) use the koha database
3) Run the following script
TRUNCATE opac_news;
source ~/kohaclone/installer/data/mysql/uk-UA/optional/sample_news.sql
source ~/kohaclone/installer/data/mysql/it-IT/necessari/sample_news.sql
source ~/kohaclone/installer/data/mysql/de-DE/optional/sample_news.sql
source ~/kohaclone/installer/data/mysql/nb-NO/2-Valgfritt/sample_news.sql
source ~/kohaclone/installer/data/mysql/en/optional/sample_news.sql
source ~/kohaclone/installer/data/mysql/pl-PL/optional/sample_news.sql
source ~/kohaclone/installer/data/mysql/es-ES/optional/sample_news.sql
source ~/kohaclone/installer/data/mysql/ru-RU/optional/sample_news.sql
source ~/kohaclone/installer/data/mysql/fr-FR/2-Optionel/sample_news.sql

- Were there errors?
- Did everything add nicely?
    - Not likely, by expressly stating the idnew field, the news
      items in some files would not be added.

4) apply patch
5) try running the script again

- Were there errors?
- Did everything add nicely?
6) Log into the staff client
7) Tools->News
- Do you see the news items added?

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

Much needed clean up, making for much more robust and less error prone
sql

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 7567: (code cleanup) update License tools/koha-news.pl
Mark Tompsett [Fri, 13 Dec 2013 20:13:49 +0000]
Bug 7567: (code cleanup) update License tools/koha-news.pl

Updated license text using
    http://wiki.koha-community.org/wiki/Coding_Guidelines#Licence
for the base text.

TEST PLAN
---------
1) less tools/koha-news.pl
2) apply patch
3) less tools/koha-news.pl
    - was any contributor information lost?

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

Safe no op action

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 7567: (code cleanup) update license and use Modern::Perl
Mark Tompsett [Fri, 13 Dec 2013 19:49:56 +0000]
Bug 7567: (code cleanup) update license and use Modern::Perl

Grabbed the current license from
  http://wiki.koha-community.org/wiki/Coding_Guidelines#Licence
and changed the use strict; use warnings; into a
use Modern::Perl instead.

TEST PLAN
---------
1) Log into staff client.
    - Does news look okay?
2) Apply patch
3) Refresh staff client.
    - Does news look the same?

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

Safe no op action

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 7567: add tests for C4::NewsChannel
Mark Tompsett [Fri, 13 Dec 2013 04:19:18 +0000]
Bug 7567: add tests for C4::NewsChannel

Testing was lacking, this tests every function call. As a
side effect, this moved the stub of a test file from
t/NewsChannels.t to t/db_dependent/NewsChannels.t, since the
table opac_news must exist.

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

Passes all 8 tests

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 10790: fix misalignment in item type form when noItemTypeImages is off
Bernardo Gonzalez Kriegel [Thu, 20 Mar 2014 01:25:07 +0000]
Bug 10790: fix misalignment in item type form when noItemTypeImages is off

This patch fixes the odd behavior when noItemTypesImages is set
to 'Don't show'. Just a misplaced </div>

To test:

1) Set syspref noItemTypeImages to 'Don't show'
2) Go to Admininstration > Item types
3) Edit some item type, you will view a display
similar to the attached image
4) Apply the patch
5) Reload the page, now the display is fixed
6) Change syspref to 'Show' to check that
the display is also good

Also fixed a missing '/' on a closing select

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11570 - Upgrade jQueryUI to latest version in the staff client
Owen Leonard [Wed, 15 Jan 2014 19:51:11 +0000]
Bug 11570 - Upgrade jQueryUI to latest version in the staff client

This patch upgrades the version of jQueryUI included in the Koha staff
client from v1.8.23 to v.1.10.4. The upgrade introduces a few minor API
changes which require the updates in this patch:

- In CSS, the term "active" is used instead of "selected"
- Autocomplete functions use slightly changed parameters

Changes to the default jQueryUI CSS allows us to remove some instances
of "!important" from jQueryUI-related CSS in the staff client's main CSS
file.

To test:

Testing changes to autocomplete:

- Enable the CircAutocompl system preference. Try searching in the
  header's "Check out" tab. Autocomplete should look correct and
  function correctly.

- In Circulation -> Overdues: The patron attribute authorized value
  filter (must have patron attributes enabled, and a patron attribute
  defined which uses authorized values.

- Course reserves -> Course -> Edit: Searching for an instructor

- In the unimarc_field_210c_bis.pl plugin:
  1. Link the publisher name field in your MARC structure to
     the unimarc_field_210c_bis.pl plugin.
  2. Open a MARC record for editing and click the "tag editor" link to
     launch the plugin.
  3. Type the first few letters of a publisher which exists in your
     database. You should get an autocomplete menu of publishers
     which match your search.
  4. Select one and click the "choose" button to fill the field in the
     MARC editor.

- Tools -> Patron lists: Add a list or choose an existing list and add
  patrons. Perform a search for a patron.

- Placing a hold: After choose a title and clicking "Place hold,"
  search for a patron.

- Tags management: The sidebar filter for "reviewer" should let you
  search by patron name.

Other jQueryUI widget changes:

- Check tabs appearance in header search, biblio detail, cataloging, and
  circulation patron fines pages.

To confirm other jQueryUI widgets still function correctly:

- Check accordion (collapsing sections) in Patrons -> Patrons requesting
  modifications and the MARC subfield structure edit screen.

- Check datepickers, especially in Circulation with the added timepicker.
  Test a linked datepicker, for example in Reports -> Stats wizards ->
  Circulation where the value in one date field affects what dates are
  available in the matching field.

- Check the calendar interface in Tools -> Calendar

To confirm that the new jQueryUI default CSS is more flexible (fixing
Bug 11042), add the following CSS to your IntranetUserCSS system
preference and confirm that the header search active tab border color
changes (hash mark escaped so that it will appear in commit msg):

\#header_search ul.ui-tabs-nav li.ui-tabs-active {
  background-color: #FFFFF1;
  border: 1px solid #800000;
  border-top: 0 !important;
  top: -2px;
}

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

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11850: Add -append option to bulkmarcimport.pl to append to logfile
Matthias Meusburger [Wed, 26 Feb 2014 15:59:14 +0000]
Bug 11850: Add -append option to bulkmarcimport.pl to append to logfile

Signed-off-by: Magnus Enger <digitalutvikling@gmail.com>
Keeps current behaviour as default.
The -append option is described in the POD and works as expected.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described.
Adding a date/time to the output might
be good, to make it easier to find the entry you were looking for.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 12024: fix add to list opening the list adding UI in two windows
Pasi Kallinen [Wed, 2 Apr 2014 11:30:03 +0000]
Bug 12024: fix add to list opening the list adding UI in two windows

In Item details, when using the menu toolbar for Add To > List,
the list adding UI opens in a popup window, and also in the original
window. The original window should stay showing the item details page.

This patch corrects this behavior, which has been observed in Chromium
on Ubuntu and Chrome on Windows.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Works fixing problem. No koha-qa errors.

Test:
1. On staff, go to detail of some biblio,
click add to List, described behavior

2. With patch applied, original windows stay on item detail

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Patch passes all tests and QA script, works as described.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 12032: disable automatic URL conversion by TinyMCE in news
Liz Rea [Thu, 3 Apr 2014 03:25:35 +0000]
Bug 12032: disable automatic URL conversion by TinyMCE in news

To test:

* create a news item with a link in it that is within the same domain

example: my koha was at http://demo.mykoha.co.nz, I created a link in a
news item to http://demo-intra.mykoha.co.nz

* note that when the item is saved, the url changes to ../../../../ (or
something like)

* apply the patch

* edit the link again, and save it

* note that the link is saved correctly

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

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 10818: improve display and translatability of sysprefs OAI-PMH:ConfFile's description
Bernardo Gonzalez Kriegel [Sat, 22 Mar 2014 15:02:12 +0000]
Bug 10818: improve display and translatability of sysprefs OAI-PMH:ConfFile's description

This patch correct english display for OAI-PMH:ConfFile syspref,
and makes it's strings translatable

To test:
1) On Administration > System preferences > Web Services
OAI-PMH:ConfFile syspref doesn't have description before
file box. Text after that box is not translated.
2) Choose your prefered language, xx-YY, update po files
cd misc/translator
perl translate update xx-YY
3) Look into xx-YY-pref.po for any occurence of "YAML", there is none
4) Apply the patch
5) Update po files again
6) Look into xx-YY-pref.po, now there are 2 entries
7) Also reload page from 1) and check for text before
file box.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works for me as described, only changes YAML pref file.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 12034: standardize alerts referring to lists and list items
Owen Leonard [Thu, 3 Apr 2014 12:38:08 +0000]
Bug 12034: standardize alerts referring to lists and list items

The staff client lists template contains a warning which differs from
the same warning in the OPAC. The OPAC version is correct because it
refers to a list rather than a shelf. This patch copies the OPAC version
to the staff client template.

This patch also corrects a few of other instances where the incorrect
term "shelf" is used.

To test, apply the patch and view a list in the staff client which is
populated with items. Check the box next to one or more items on the
list and click the "Remove selected" button. You should see the message,
"Are you sure you want to remove these items from the list?"

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

Work as described, no koha-qa errors

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11393: fix display of Thai in language menu when Thai translation is installed
Bernardo Gonzalez Kriegel [Thu, 27 Mar 2014 13:26:41 +0000]
Bug 11393: fix display of Thai in language menu when Thai translation is installed

The problem is with the name of PO files

Currently Koha expect, among other variants, that PO filenames
began with (using as example *-pref.po):
{lang}-pref.po
{lang}-{region}-pref.po
{lang}-{script}-pref.po
{lang}-{script}-{region}-pref.po
and expect 2 chars for lang and region, and 4 for script

So the problem with Thai translation files are that it's names
do not match that convention.

This patch only rename Thai files as th-THA-* to th-TH-*.
In that way language description is right.
translate script use that chars to make dirs, and use dirs to find
description.

To test:
1) Go to I18N/L10N sysprefs
2) Install th-THA language (or simply mkdir koha-tmpl/intranet-tmpl/prog/th-THA)
3) Reload page, wrong description
4) Apply patch
5) Install th-TH language (or simply mkdir koha-tmpl/intranet-tmpl/prog/th-TH)
6) Reload page, right description
7) If you want do "mkdir koha-tmpl/intranet-tmpl/prog/th-Thai", reload,
   also right description

To the reporter of this Bug: the rename of the folder is a good
workaround, when this patch is pushed to stable I'll rename Thai
files

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

This does not correct existing problems which need human
intervention. It does, however, allow for a correct installation
of Thai after the patch is made.

If we really want a patch for fixing an existing install. I
wrote it, but have not tested it.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
As pointed out by Mark, this does not fix existing installations.
Putting a note in the release notes might be something we can do here.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11993: fix untranslatable confirm popup in request.tt
Bernardo Gonzalez Kriegel [Thu, 27 Mar 2014 03:32:33 +0000]
Bug 11993: fix untranslatable confirm popup in request.tt

This patch makes confirm popup text translatable. It implements a
similar function as used on OPAC deleteConfirm() and a JS var message.

This function, or variants, can also be found on other files on intranet,
I think that the only valid places are staff-global.js and help-top.inc

Redefinitions of this function:
prog/en/modules/serials/subscription-frequencies.tt:6
prog/en/modules/tools/marc_modification_templates.tt:158
prog/en/modules/virtualshelves/shelves.tt:92

Last case is a little different

To test:

1) Confirm that the "cancel hold" link correctly prompts for
   confirmation:
   a) Place an item-level hold on a title.
   b) Check in the item and confirm the hold.
   c) Return to the place hold screen for that title and submit another
      patron to place a hold for.
   d) On the place hold screen for that patron, look at the table of
      items. There should be a "cancel hold" link next to the item for
      which the hold was confirmed in step (b).
   e) Click "cancel hold."  You should see a confirmation message.
      Cancelling this dialog should cancel the operation. Confirming it
      should cancel the hold.

2) Check the string is not present on staff PO file
3) Apply the patch
4) Update translation files (cd misc/translator; perl translate update
   xx-YY)
5) Verify the string is now present

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 12018 - add table sorting to patron card batches
Owen Leonard [Wed, 2 Apr 2014 14:13:31 +0000]
Bug 12018 - add table sorting to patron card batches

When viewing batches of patrons in the patron card creator module the
table is not sortable. This patch adds table sorting.

The patch also makes some corrections of invalid markup and moves
informational/error messages to the top of the page rather than in a
sidebar. This change lets the table and sorting controls expand into a
wider space.

This patch also corrects a translation issue with table headers
identical to that addressed by Bug 11505.

To test, go to Tools -> Patron card creator -> Manage batches.
View an existing batch or create a new batch and populate it with
patrons. Table sorting controls should work correctly. Batch management
operations should work correctly.

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11786: Improve RDFa structured data schema.org mappings
Dan Scott [Tue, 18 Feb 2014 18:29:35 +0000]
Bug 11786: Improve RDFa structured data schema.org mappings

This patch updates both the prog and bootstrap themes to provide better
schema.org mappings for catalogue elements in the following ways:

* More granular author attributes (one "author" property per author in records
  with multiple contributors; wrap in a Person or Organization type instead of
  using a simple literal value)
* Use "byArtist" instead of "author" for music recordings to respect schema.org
  preferences
* Use alternateName instead of alternativeHeadline, as the former is a better
  parallel to the "name" property

Signed-off-by: Dan Scott <dan@coffeecode.net>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Only covers MARC21, but that is no reason not to move it forward

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests. Looked at the source code of a few records in both
prog and bootstrap and took a look at the properties using
http://www.google.com/webmasters/tools/richsnippets.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 12000: ensure that hold resumption dates can be set only to future dates
Galen Charlton [Wed, 26 Mar 2014 17:58:46 +0000]
Bug 12000: ensure that hold resumption dates can be set only to future dates

This patch makes the datepickers for the hold resumption date
(AKA the hold suspend until date) field only permit dates in
the future to be selected in the staff interface checkout page
and hold list pages.  This makes these pages consistent with
the OPAC and the patron details page in the staff interface.

To test:

[1] Ensure that AutoResumeSuspendedHolds and SuspendHoldsIntranet
    are enabled.
[2] Go to the checkout page for a patron that has at least one hold
    request.
[3] Verify that the datepicker for the hold suspend until
    date field only permits choosing a date in the future.
[4] Go to the page listing hold requests for a title.
[5] Verify that the datepicker for the hold suspend until
    date fields only permit choosing a date in the future.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, passes all tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11946 - add table sorters to label batches
Owen Leonard [Fri, 21 Mar 2014 19:50:18 +0000]
Bug 11946 - add table sorters to label batches

When viewing batches of titles in the label creator module the table is
not sortable. This patch adds table sorting.

The patch also makes some corrections of invalid markup and moves
informational/error messages to the top of the page rather than in a
sidebar. This change lets the table and sorting controls expand into a
wider space.

To test, go to Tools -> Labels -> Manage label batches. View an existing
batch or create a new batch and populate it with items. Table sorting
controls should work correctly.

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Solves 1/2 of this bug which is to add the sorters to labels, the original
request was to add this to patron cards as well.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, passes all tests and QA script.
Template could be improved forther by showing
the itemtype description instead of the code in the table.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11906: ensure that Koha::Database uses UTF8 mode when connecting to databases
Galen Charlton [Wed, 26 Mar 2014 20:38:32 +0000]
Bug 11906: ensure that Koha::Database uses UTF8 mode when connecting to databases

This patch fixes an issue whereby the DBIx::Class schema objects
were not connecting to the underlying database in UTF8 mode.  This
most visibility manifested as patron list pages not displaying
diacritics correctly.

To test:

[1] Create a patron list, and make sure that it contains at least
    one patron whose name or patron category description contains
    a non-ASCII character.
[2] View the list contents; the diacritics should appear mangled.
[3] Apply the patch.
[4] View the patron list again.  This time, the diacritics should
    be displayed correctly.  Note that Apache will also log
    "list.pl: Wide character in print ...", but this is the lesser
    of two evils.
[5] Verify that prove -v t/db_dependent/Koha_Database.t passes.
[6] (extra credit) Verify that  t/db_dependent/Koha_Database.t
    passes when connect to a PostgreSQL database.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11906: regression test for using DBIC to store & fetch UTF8 strings
Galen Charlton [Wed, 26 Mar 2014 20:26:26 +0000]
Bug 11906: regression test for using DBIC to store & fetch UTF8 strings

This patch adds a regression test for verifying that a
DBIx::Class schema object initialized by Koha database sets up
the database connection to correct store and retrieve UTF8
values as Perl utf8 strings.

To test:

[1] Apply this patch.
[2] Run prove -v t/db_dependent/Koha_Database.t
[3] The test should fail.
[4] Apply the main patch for this bug, then do step 2 again.
[5] The test should pass.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11671 - Restructure patron lists add form for improved usability
Owen Leonard [Mon, 3 Feb 2014 18:59:34 +0000]
Bug 11671 - Restructure patron lists add form for improved usability

Non-standard interface features have the potential to cause confusion.
This patch brings various aspects of the patron lists add page into
conformity with other staff client pages.

- Add "select all/clear all" links for the checkboxes
- Add a "remove selected" to the top of the table (see also Lists)
- Split functionality of add from from delete form
- Hide "Add patrons" button until at least one patron has been selected
- Remove non-standard trash can icon from table's checkbox column
- Exclude checkbox column from table sorting
- Add confirmation to deletion actions
- Improve breadcrumb specificity
- Add title-string sorting to date column to accommodate sorting for all
  date format types

To test, apply the patch and create a patron list.

1. Search for and select patrons for the list. Selecting a patron should
   trigger the display of an "Add patrons" button.
2. Click "Add patrons" and confirm that the add process completes
   correctly.
3. Search for and select a patron and also check the box next to an
   existing patron. Click "Add patrons" and confirm that no patron is
   removed.
4. Check that the "select all" and "clear all" links work correctly.
5. Select patrons on the list and click the "Remove selected" link. You
   should be prompted to confirm your choice.
   4.a. Click cancel and confirm that the deletion process aborts.
   4.b. Click OK and confirm that the deletion process completes.
6. Repeat step 4 with the "Remove selected patrons" at the bottom of the
   page.
7. Confirm that the page title and breadcrumbs correctly show the list
   name.
8. Switch between us and metric dateformat settings and confirm that
   table sorting by date is correct in both cases.

Followed test plan. Patch behaves as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, no regressions found.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11738: Use new DataTables include in batch patron modification template
Owen Leonard [Mon, 10 Feb 2014 19:51:27 +0000]
Bug 11738: Use new DataTables include in batch patron modification template

Bug 10649 introduced a new include file for adding DataTables-related
JavaScript assets. This patch adds use of this include file to the
batch patron modification template.

This patch modifies the template so that date columns are sorted using
the "title-string" filter, based on the unformatted date. The DataTables
configuration has also been modified to account for varying structure
based on the page state.

Other minor edits: Corrected capitalization.

To test, go Tools -> Batch patron modification and submit a list of
patrons for modification. The resulting page should be correctly sorted.
Date columns should sort correctly for all dateformat system pref
settings.

Test with extended patron attributes enabled. Test adding and removing
varying numbers of attributes to patrons in your batch.

Submit a change to multiple borrowers. The results page should also be
sorted correctly.

Revision: Corrected error caused by the variable number of columns in
the table corresponding to varying numbers of patron attributes.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script, works as described.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11878 - Eliminate use of deprecated jQuery .toggle() method usage
Owen Leonard [Tue, 4 Mar 2014 13:19:57 +0000]
Bug 11878 - Eliminate use of deprecated jQuery .toggle() method usage

jQuery's .toggle() method can no longer be used to trigger a pair of
specified functions. .toggle() can only be used to change the visibility
of an element. This patch fixes a few places in Koha where the
deprecated functionality was used.

To test, apply the patch and clear your browser cache.

- View the system preferences page in the staff client. Clicking a
  heading ("Appearance" under OPAC preferences, for instance) should
  collapse that section. Clicking again should expand it.

- View the MARC detail page for a record in the OPAC. Clicking the "view
  plain" link should display the plain MARC view. Clicking the "view
  labeled" view should return to the original view. Test in both prog
  and bootstrap themes.

Signed-off-by: wajasu <matted-34813@mypacks.net>

Followed test plan. Works fine.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script, works as described.
No Javascript errors found.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11806 - Use validation plugin when creating new OAI set
Owen Leonard [Thu, 20 Feb 2014 21:08:02 +0000]
Bug 11806 - Use validation plugin when creating new OAI set

The form for adding a new OAI indicates that two fields are
required but does nothing to enforce this rule. This can be
handled client-side with HTML5 validation attributes and Koha's built-in
validation plugin. This patch implements this.

To test, apply the patch and go to Administration -> OAI sets
configuration -> New set. Try submitting the form without entering a
setSpec and/or setName. Doing so should trigger a validation warning.

Submission of the form with valid data should work correctly. Editing an
existing set should also work correctly.

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

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script, works as described.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11877 - Eliminate use of deprecated jQuery .live() method
Owen Leonard [Fri, 28 Feb 2014 19:48:36 +0000]
Bug 11877 - Eliminate use of deprecated jQuery .live() method

As of jQuery 1.9 the .live() method has been removed. A few templates
contain JavaScript which uses it. It can be easily replaced with .on().
This patch makes the correction.

To test, apply the patch and test the following pages:

- In the staff client, Administration -> OAI sets configuration:
  Define mappings for an existing set. You should be able to add rows by
  clicking the "OR" button. You should be able to delete or clear any
  line by clicking the "Delete" link.

- In the staff client, view the details for any patron and click the
  "Change password" button: In the change password form click the link
  to fill the password fields with a random password. This link should
  work correctly.

- If necessary enable OpacRenewalAllowed in system preferences. Log in
  to the OPAC as a patron who has checkouts. On the patron summary page
  (opac-user.pl) look for the "renew selected" and "renew all" links at
  the top of the table of checkouts. Both these links should work
  correctly. Test in prog and bootstrap themes.

Followed test plan. Same behaviour as without patch, i.e. patch OK
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script, works as described.
No Javasript errors found.

Note: The buttons on the form show up, even if no item shows the
checkbox. In my case the problem was that I had 0 renewals allowed
in the circulation rules. Maybe we could hide them, if no item
can be renewed.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11694: [QA Followup] strip out time portion when setting suspension date for...
Kyle M Hall [Thu, 27 Feb 2014 13:40:55 +0000]
Bug 11694: [QA Followup] strip out time portion when setting suspension date for individual hold

This patch fixes an issue originally reported by bug 11702.

RM note: the patch is clear enough and doesn't break existing tests,
but on the other hand, I have been completely unable to reproduce
the original issue.

To test:

[1] Verify that prove -v t/db_dependent/Holds.t passes

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11694: Improve handling of individual hold suspension in Bootstrap OPAC
Owen Leonard [Wed, 5 Feb 2014 21:11:29 +0000]
Bug 11694: Improve handling of individual hold suspension in Bootstrap OPAC

This patch changes the way the controls to suspend and resume holds are
displayed on the OPAC for a logged-in user when using the Bootstrap
theme. Instead of showing all the suspend options in the table cell a
link will trigger a modal with the controls. This makes the table more
compact and readable.

The patch adds a span and class to the dateformat include so that the
dateformat hint can be hidden if JavaScript is enabled (and thus the
datepicker will use the correct format automatically).

A new class has been added to the CSS, ".js-show" to be used for
elements which should be hidden if JavaScript is disabled and made
visible by JavaScript if it is enabled.

To test you must have RequestOnOpac, SuspendHoldsOpac, and the bootstrap
theme enabled.

Apply the patch and test with AutoResumeSuspendedHolds enabled:

1. Log in to the OPAC and place a hold.
2. View the list of your holds in the OPAC.
3. Click the "Suspend" link for your new hold. A modal window should
   appear allowing you to specify a suspend-until date.
4. Specify a suspend-until date. Test the "clear" link and confirm that
   it clears the date.
5. Specify a suspend-until date and submit.
6. Confirm that the hold has been suspended with the specified
   resumption date.
7. Click the "Resume" link on the suspended hold to resume.
8. Click the "Suspend" link again and submit without specifying a date.
9. Confirm that the hold has been suspended indefinitely.

Follow the same steps above with JavaScript disabled. The "suspend
until" options will appear inside the table as before and everything
should work correctly.

Test with AutoResumeSuspendedHolds disabled. No modal dialog should
appear when the "Suspend" link is clicked. The hold should simply be
suspended indefinitely.

Test again with JavaScript disabled. There should be no change in
functionality.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script, works as described.
Happy about the fallback for users without Javascript.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11939: set active currency for non-English sample data
Jonathan Druart [Mon, 17 Mar 2014 16:21:09 +0000]
Bug 11939: set active currency for non-English sample data

Revised Test Plan
-----------------
The following SQL commands were used to test this.

installer/data/mysql/en/optional/parameters.sql is part of the
first patch and didn't really need testing again.

installer/data/mysql/de-DE/optional/parameters.sql is not part
of the patch, but since I was playing with the script, which
is also attached here, it was included for good measure.

use kohadata;
SET FOREIGN_KEY_CHECKS=0;
TRUNCATE currency;
source /home/mtompset/kohaclone/installer/data/mysql/pl-PL/optional/parameters.sql
SET FOREIGN_KEY_CHECKS=0;
TRUNCATE currency;
source /home/mtompset/kohaclone/installer/data/mysql/es-ES/optional/parameters.sql
SET FOREIGN_KEY_CHECKS=0;
TRUNCATE currency;
source /home/mtompset/kohaclone/installer/data/mysql/ru-RU/optional/sample_currency.sql
SET FOREIGN_KEY_CHECKS=0;
TRUNCATE currency;
source /home/mtompset/kohaclone/installer/data/mysql/uk-UA/optional/sample_currency.sql
SET FOREIGN_KEY_CHECKS=0;
TRUNCATE currency;
source /home/mtompset/kohaclone/installer/data/mysql/it-IT/necessari/parameters.sql
SET FOREIGN_KEY_CHECKS=0;
TRUNCATE currency;
source /home/mtompset/kohaclone/installer/data/mysql/de-DE/optional/parameters.sql
SET FOREIGN_KEY_CHECKS=0;
TRUNCATE currency;
source /home/mtompset/kohaclone/installer/data/mysql/nb-NO/2-Valgfritt/parameters.sql
SET FOREIGN_KEY_CHECKS=0;
TRUNCATE currency;
source /home/mtompset/kohaclone/installer/data/mysql/en/optional/parameters.sql

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11939: set active currency when using English sample data
Zeno Tajoli [Fri, 14 Mar 2014 10:38:07 +0000]
Bug 11939: set active currency when using English sample data

This patch offers a better default for currencies,
with USA dollar as default active currency.

To test the patch:
1)Install master without the patch, during web installation
select 'parameters.sql' file
2)Finish install and go to Administration -Currencies & Exchange rates
3)No active currency

4)Install master with this patch, during web installation
 select 'parameters.sql' file
5)Finish install and go to Administration -Currencies & Exchange rates
6)Now USA dollar is the active currency

NOTE: This does solve the problem of everything being NULL for active,
      and lacking an active value. It also corrects the description
      of the optional item to check related to currencies.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, passes all tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11701: Fix C4::Context::Zconn
Julian Maurice [Wed, 13 Nov 2013 13:21:40 +0000]
Bug 11701: Fix C4::Context::Zconn

When calling C4::Context::Zconn twice with different parameters,
the same ZOOM::Connection object is returned twice (parameters
of 2nd call are not used) This patch fixes that.

This is in part because the connection cache is keyed on server
name only. This patch corrects this by keying on all parameters.

TEST PLAN
---------
1) apply patch
2) run koha qa test tools
3) prove -v t/Context.t

The unit tests properly triggers the modified routine for
testing. Additionally, in hunting for ways it could break,
no nested synchronous or asynchronous Zconn's were found.
And even if they were, the keying on all parameters should allow
it to function properly without messing up the other connection.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11701: (follow-up) move unit tests to t/db_dependent
Galen Charlton [Tue, 25 Mar 2014 14:41:07 +0000]
Bug 11701: (follow-up) move unit tests to t/db_dependent

The new tests will not function if there isn't a valid
configuration (or mocking of preference()) so this patch
moves them to t/db_dependent/Context.t.

To test:

[1] After applying the main patch for this bug, verify that
    prove -v t/db_dependent/Context.t passes.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11701: Unit tests for C4::Context::Zconn
Julian Maurice [Thu, 6 Feb 2014 16:09:50 +0000]
Bug 11701: Unit tests for C4::Context::Zconn

TEST PLAN
---------
1) apply patch
2) run koha qa test tool
3) prove -v t/Context.t

Unit tests ran as expected.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11352: fix unexpected data loss issues with batch patron deletion/anonymization
Jacek Ablewicz [Mon, 24 Feb 2014 16:37:43 +0000]
Bug 11352: fix unexpected data loss issues with batch patron deletion/anonymization

Batch patron deletion/anonymization tool has some issues:

1) If 'dateformat' setting in I18N/L10N system preferences is set
to anything other then 'iso' (eg. 'metric'), bulk deletion when using
'expiration date is before' criterion is not working properly. Date
entered in this field will be efectivelly ignored (or possibly
sometimes wrongly interpreted as different date, in other format)
on the final patron deletion stage. This may result in deleting
(or moving to trash) more borrower records then intended.
2) Bulk/batch patron deletion should skip borrowers with
nonzero account balance (ones with oustanding fines or credits)
3) This tool shouldn't offer to choose as deletion criterion
those patron categories which have category_type set to 'S'
(= staff patron categories)

This patch fixes above mentioned problems. It also adds an option
to "test run" patron batch deletion, and makes this option
the default choice in "warning" stage.

Test plan:
- prepare test database with some patron records (at least 2,
the more the better) set up in such a way that they will be vulnerable
to issues 1 & 2
- confirm issues 1,2
- restore test database
- apply patch
- ensure issues 1 & 2 are no longer present - first by using new "test
run" option: for #1, record counts in "warning" stage and "final" stage
should be now the same; for #2, observe that patron records with nonzero
balance are now excluded from deletion
- redo the tests, this time choosing "delete permanently" and "move
to trash" instead of "test run"
- test #3 by changing "Category type" to "S" in some
test patron categories - after that, those categories should no
longer be choosable as deletion criteria.

Signed-off-by: Magnus Enger <digitalutvikling@gmail.com>
Tested with dateformat = dd/mm/yyyy. I tested with two expired patrons,
one with fines and one without. Before the patch a lot of unexpected
patrons were deleted along with the expected ones. After
applying the patch only the expired patron was deleted, not the
one with fines. The test run and the "real" run reported correct numbers.

The patch also makes sure no patron categories with category_type = S
are suggested for batch deletion.

Note: The ergonomics of the "Batch delete/anonymize" tool is hardly
optimal, but this patch fixes a real, data-loosing bug, so let's
deal with the ergonomics later.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11973: DBRev 3.15.00.026
Galen Charlton [Sat, 22 Mar 2014 12:57:30 +0000]
Bug 11973: DBRev 3.15.00.026

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

10 years agoBug 11973 - Fix Armenian language description
Bernardo Gonzalez Kriegel [Thu, 20 Mar 2014 11:45:14 +0000]
Bug 11973 - Fix Armenian language description

This patch fix Armenian language description

To test:
1) Do a fake translation to Armenian,
   mkdir koha-tmpl/intranet-tmpl/prog/hy-Armn
2) Go to Administration > System preferences > I18N/L10N
3) Armenian description looks like the second string in Bug description
4) Apply the patch
5) Run updatedatabase.pl
6) Reload page, now description look as first string in
Bug description (it's the sixth letter, similar to 't')

Ammended patch, wrong column.

Signed-off-by: Holger Meißner <h.meissner.82@web.de>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Patch fixes the English sample file for translations and includes
a database update to correct the string in existing installations.
Passes all tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>