Bug 10712: Save missing config variables to install log

The variables for AUTH_INDEX_MODE and ZEBRA_TOKENIZER were not
being saved to the koha_install_log file.  As a result when using the
--prev-install-log option in Makefile.PL the user was still prompted
to select them.

This patch adds the appropriate variables to the list saved in
the install log.

To test:

On a (non-package) system installed/upgraded without the patch running
'perl Makefile.PL --prev-install-log /path/to/koha-install-log' will
still prompt you to choose authorities indexing mode and select
between chr and icu, after upgrading with this patch applied the same
command should get the responses from the install log and not require
user intervention.

The values can be seen written into misc/koha-install-log

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10614 - have add order form at top and bottom

If a basket has a lot of items it may be inconvenient to scroll to the
bottom of the patch to reach the "add to basket" form. This patch adds
as "Add to basket" button to the toolbar which uses JavaScript to copy
the form into a modal dialog for quick access.

To test, apply the patch and view an open basket. You should be able to
click the "Add to basket" button to trigger a modal dialog with the full
"Add to basket" list of options. All options in the list should function
normally.

If you view a closed basket the new button should not appear.

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
All tests pass and I love it :)

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 8507: koha-create now supports using DOM indexing for bibs

This patch makes the koha-create script install the file zebra-biblios-dom.cfg
with the proper string substitutions inside on the new instance koha-conf.xml file.

It also adds two option switches that control the indexing mode for the instance:

 --biblio-idx {dom|grs1}
 --auth-idx {dom|grs1}

DOM indexing is set as the default for both authorities and bibliographic records.

Following drojf (thanks!) advice I arranged stuff like explained here:

  http://wiki.koha-community.org/wiki/Switching_to_dom_indexing

To test:
- Apply the patch
- Build your own packages and install them on a test server
a) Create a new instance without using the new switches like:
 $ koha-create --create-db domtest
 - Check there's a file /etc/koha/sites/domtest/zebra-biblios-dom.cfg
 - Check that /etc/koha/sites/domtest/koha-conf.xml points to:
   * zebra-biblios-dom.cfg (biblioserver section)
   * zebra-biblios-dom.cfg (publicserver section)
   * zebra-authorities-dom.cfg (authorityserver section)
 - Success means the new default is DOM
b) Play with the 4 possible combination of option switches
 $ koha-create --create-db --auth-idx grs1 --biblio-idx grs1 domtest
 $ koha-create --create-db --auth-idx grs1 --biblio-idx dom domtest
 $ koha-create --create-db --auth-idx dom --biblio-idx grs1 domtest
 $ koha-create --create-db --auth-idx dom --biblio-idx dom domtest
 - Check the koha-conf.xml file reflects the chosen options.
c) Run
 $ koha-create --help
 - It should advertise this addition accordingly.
d) Run
 $ man koha-create
 - Man page for koha-create should provide good information on the new switches behaviour

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 8507: (follow-up) fix one reference to __ZEBRA_BIBLIOS_CFG__

Fixed the path to __ZEBRA_BIBLIOS_CFG__ for <server id="mergeserver">

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Good catach drojf.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 7785: remove MySQL-specific syntax from C4::Members::columns()

The initial thought was to remove this function. However,
tools/import_borrowers.pl uses it. So rather than remove
it to solve the problem, it was reworked to a more generic
solution which runs faster.

By accessing $sth->{NAME} directly, the driver becomes
responsible for filling it correctly. This happens when a SELECT
is done on the borrowers table. It does not even have to have
data in the result set!

The columns method could be more generic and used elsewhere too.
Comparison between the old method and the STH method showed a
significant time difference. The old method took 35 seconds
for 40k iterations versus 19 seconds for the same amount of
iterations with the STH method regardless of the size of the
borrowers table.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 7785: (follow-up) standardize POD

This makes the POD for the columns() function consistent
with the rest of C4/Members.pm.  It also removes a note
that can be relegated to the bug report and the Git
history.

Also, since C4::Members::columns() is not actually a
class method, this patch changes the invocation to
not call it that way.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 5262: make authority plugin copy indicators to bib record

With this patch Koha should correctly copy indicators
(and create $2 subfield in MARC 21 if need) from the chosen authority
record to the edited bibliographic record (according to discussion in
bugzilla). UNIMARC and MARC 21 flavors are covered.

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

Comment: work as described, testing in comments 9 and 12.
No errors.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes QA script and tests. Tested functionality repeating
some of the tests noted by Bernardo - checking mostly 1xx, 490,
and 7xx.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10483: fix item uniqueness check on order form

When syspref "UniqueItemFields" is defined, the item uniqueness is
tested in acquisition by an AJAX call to check_uniqueness.pl.  This
patch fixes an issue where check_uniqueness.pl wasn't looking
at the correct CGI parameters.

Test plan :
- Select an existing item with barcode
- Add "barcode" to "UniqueItemFields" syspref (use space as separator
  for multiple values)
- Set "AcqCreateItem" syspref to "Create an item when placing an order"
- Go to an acquisition basket
- Create a new order from empty
- Enter existing barcode in item form and save
=> You get an alert that barcode already exists and order is not saved
- Enter a non-existing barcode in item form and save
=> Order and item are created

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 8712: change "New list" to "Create new list" in OPAC masthead

This makes it clear for screen reader users.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Note that you should delete all your private lists to see this change.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 8712: add 'and' label for inputs in OPAC "fewer options" advanced search page

The "and" label not only improves the accessibility but also gives the
user an idea that the operation between multiple search fields is a
boolean "AND" by default.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Actually only adds a label and an id to the select.
Note that the boxes do not exactly align anymore now (with fewer options).

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10405: add IDs for customizable OPAC regions

This patch adds unique IDs for:
opaccredits
opacheader
OPACMobileUserCSS
OpacNavBottom
OpacUserCSS
opacuserjs

This is an amended patch which includes the changes to CCSR which I
forgot to commit before. The patch does not add a unique ID for
opacheader to CCSR, since opacheader is positioned wrong.

This is most useful for previewing changes you make in the OPAC
preferences using the following javascript in your IntranetUserJS:

function showPreview(url) {
    $('#preview-loading').show();
    document.getElementById('opac-preview').src = url;
    $('#opac-preview').load(function () {
        $('#opac-preview').show();
        $('#region-opaccredits', $('#opac-preview').contents()).html($('#pref_opaccredits').val());
        $('#region-opacheader', $('#opac-preview').contents()).html($('#pref_opacheader').val());
        $('#opacmainuserblock', $('#opac-preview').contents()).html($('#pref_OpacMainUserBlock').val());
        $('#opacmainuserblockmobile', $('#opac-preview').contents()).html($('#pref_OpacMainUserBlockMobile').val());
        $('#region-opacnav', $('#opac-preview').contents()).html($('#pref_OpacNav').val());
        $('#region-opacnavbottom', $('#opac-preview').contents()).html($('#pref_OpacNavBottom').val());
        $('#opacrightsidebar', $('#opac-preview').contents()).html($('#pref_OpacNavRight').val());
        $('#noresultsfound', $('#opac-preview').contents()).html($('#pref_OPACNoResultsFound').val());
        $('#opacresultssidebar', $('#opac-preview').contents()).html($('#pref_OPACResultsSidebar').val());
        $('#region-opacusercss', $('#opac-preview').contents()).replaceWith('<style id="region-opacusercss" type="text/css">' + $('#pref_OPACUserCSS').val() + '</style>');

        $('#region-opacuserjs', $('#opac-preview').contents()).replaceWith('<script id="region-opacuserjs" type="text/javascript">' + $('#pref_opacuserjs').val() + '</script>');
        $('#preview-loading').hide();
    });
}

$(document).ready(function () {
    if ($('#pref_OpacNav').size() > 0) {
        $('#doc3').after('<div class="navbar navbar-fixed-bottom" style="z-index: 10000;"><div id="preview-pane" class="navbar-inner"><h4 style="float: left; margin-right: 2em;">Preview changes</h4><div class="btn-group" data-toggle="buttons-radio"><button type="button" class="btn" id="preview-main">Main page</button><button type="button" class="btn" id="preview-results">Results</button><button type="button" class="btn" id="preview-details">Details</button><button type="button" class="btn active" id="preview-hide">Hide</button></div><img id="preview-loading" style="display: none;" src="/intranet-tmpl/prog/img/loading-small.gif"><iframe id="opac-preview" style="height: 20em; width: 100%; display: none;"></iframe></div></div>');

        $('#preview-main').click(function () {
            showPreview('/cgi-bin/koha/opac/opac-main.pl');
        });
        $('#preview-results').click(function () {
            showPreview('/cgi-bin/koha/opac/opac-search.pl?idx=&q=pqf%3D%40attr+1%3D_ALLRECORDS+%40attr+2%3D103+%22%22&branch_group_limit=');
        });
        $('#preview-details').click(function () {
            showPreview('/cgi-bin/koha/opac/opac-detail.pl?biblionumber=1');
        });
        $('#preview-hide').click(function () {
            $('#opac-preview').hide();
            $('#preview-loading').hide();
        });
    }
});

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>

Note: The provided JavaScript didn't work for me and resulted in an
error in Firebug. Ater talking to Jared it seems like there is more needed
than the bit of Javascript so make this work, but it might be a good
starting point, so I am leaving it in the commit message.

Passes all tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 9487: Allow item fields to be used in the HOLDPLACED notice

Test Plan:
1) Enable the syspref emailLibrarianWhenHoldIsPlaced
2) Modify the HOLDPLACED notice, add some item level fields
3) Place an item level hold
4) Check the email you receive ( or just look at it from the db )
   You should see the item level fields are new populated
5) Place a title level hold
6) Check the email you receive - item fields are not populated,
   but notice still looks ok.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10663: tests for CanBookBeRenewed

Initial work on unit tests for CanBookBeRenewed. More scenarios are needed.
Also made Circulation.t use autocommit=0.

Sponsored-by: Universidad Nacional de Córdoba
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10663: Follow-up - Unit tests for CanBookBeRenewed

Follow-up fixing some and adding more unit tests.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10663: (follow-up) set circ policy for circulation tests

This patch ensures that the loan rules are set to a known
value suitable for testing.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10663: restore ability of active hold requests to block renewal

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
This reverts changes made to CanBookBeRenewed by
patches from bug 9367.
GetReserveStatus is not suitable to recognize if an item
can fild a hold on return and CheckReserves is restored.

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

This patch includes a squash of a follow-up authored by
Katrin Fischer <Katrin.Fischer.83@web.de>:

  CheckReserves returns '' when no reserve is found,
  so $resfound will always be defined and we need to
  check if it's true.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10666: (follow-up) really fix the daily quotes test

Koha::DateUtils::dt_from_string() and DateTime->now() are
not equivalent -- they don't handle timezones in the same
way.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10663: QA Followup: Typo in comment in renewscript

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10715 - MARC21 007 Plugin Editor doesn't load position 01

This patch changes the MARC21 007 plugin editor so that it uses
1 character instead of 4 characters for position 01.

TEST PLAN:

1) Create new record/edit an existing record
2) Using the tag editor for the 007 field, choose "Videorecording"
3) Click OK
4) Change the second character in the 007 from "c" to "d"
5) Open the tag editor again
6) Note that position 01 will still say "c - Videocartridge" rather
than "d - Videodisc".
7) Exit tag editor

8) Apply patch

9) Reload the page (Shift + Refresh is always useful)
10) Open the tag editor again
11) Note that position 01 will now say "d - Videodisc"

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10615 - Move saved reports action items into dropdown menu

This patch moves saved reports "action" links (view, edit, run, etc)
into a dropdown menu triggered by clicking an "Actions" button.

To test you must have saved reports. View the saved reports page and
click the "Actions" button in the last column of the table. This should
trigger a menu. All options in the menu should work correctly.

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
works and looks awesome

Signed-off-by: Liz Rea <liz@catalyst.net.nz>
Yes, exactly what I had in mind. Great improvement.

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