Bug 10111 - Layout on basket summary page a bit inconsistent

Some details in the summary of basket information were not marked up
consistently with others on the page. This patch makes the markup
consistent for a consistent appearance.

To test, view a basket in Acquisitions which is part of a basketgroup.
Information should be displayed consistently for baksets in both open
and closed basket groups.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Works as expected

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Template change only, works nicely.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 9266 - Untranslated strings in tags moderation

There are a couple of English strings in tags moderation JavaScript
which are not properly enclosed in the _() function enabling
translation. As a result, clicking a translated 'Approve' or
'Reject' button in the table of tags would change the button's
neighbor's label to the English string. This patch
corrects it.

To test, apply the patch and regenerate a translation to test with. Go
to Tools -> Tags and find a list of tags to moderate (pending, approved,
or rejected). When you click on an 'Approve' or 'Reject' tag in the
table of tags, the buttons in each Approve/Reject pair should retain
their correct translated label. For instance, looking at approved tags
in French:

[ Approuvé ] [ Rejeter ]

Clicking the "Rejetee" button should change the state to:

[ Approuver ] [ Rejetée ]

Clicking "Approuver" should return the buttons to the first state.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 9957 - Missing cancel link on subfield editing page

The subfield edit page has an edit bottom at the top of the page. Almost
no other edit screens do this. It would be more consistent to put it at
the bottom. Also missing is a "cancel" link. This patch fixes both
issues.

The patch also adds "Default" to the breadcrumbs when editing a subfield
in the default framework.

To test, apply the patch and edit a subfield: MARC frameworks -> MARC
structure -> Subfields -> Edit. The "Save changes" button should appear
at the bottom of the page alonside a "Cancel" link. Both should work
correctly.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Template change only, improves consistency and works
nicely.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 10097 - Hide framework selection when importing staged authority records

Currently, when importing authority records using the "Manage staged
MARC records" tool, it will show the text "Add new bibliographic records
into this framework:" followed by a drop-down menu of possible frameworks.

Since these are bibliographic frameworks and we're importing authority
records which do not use them, we have no need to show this information.

I'm proposing just a little patch to display this info only for
bibliographic records. From my tests, everything seems to work fine
without this text and the drop-down, although I've only uploaded one
MARC21 authority record at a time.

--

Test Plan:

Before applying patch...

1) Find yourself an authority record. I recommend downloading your
favourite author from: http://authorities.loc.gov/
2) Stage MARC for import. Choose "Authority" as your record type.
3) Go to "Manage staged records"
4) Underneath the button "Import this batch into the catalog", you
should see the text "Add new bibliographic records into this framework:"
followed by a drop-down of the available frameworks.

Optionally) You can also try this for bibliographic records. You'll find
the same.

After applying the patch...

5) Repeat steps 2 and 3.
6) Underneath the button "Import this batch into the catalog", you
should just see a table listing your MARC record(s).
7) Stage MARC for import. Choose "Bibliographic" as your record type.
8) Go to "Manage staged records".
9) You should find step 4 still to be true (i.e. the "Add new
bibliographic..." text should still be there).

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Small template change, passes all tests.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 7055 - NORMARC: Fix 008 position 15-17 and 35-37

This patch does several things:
- Set the default for 008/15-17 to "no " (yes, there is space at the end)
- Link from 008/15-17 in the value builder to NORMARC country codes
- Set the default for 008/35-37 to "nor" (by setting the
  DefaultLanguageField008 syspref)
- Link from 008/35-37 in the value builder to NORMARC language codes
- Fix a missing <tr> around field 35-37

To reproduce:
- Run through the Web-installer in Norwegian and choose NORMARC as
  the MARC flavour
- Go to Home > Cataloging > Add MARC record and add a new record
- Click in the field for 008. The default should look like:
  130415t        xxu||||| |||| 00| 0 eng d
                 ^^^                 ^^^
- Reload the page and open the value builder for 008. Problems:
  - The text for 15-17 links to MARC21 country codes
  - The default for 15-17 is xxu
  - The text for 35-37 links to MARC21 language codes
  - The default for 35-37 is eng
  - If you choose e.g. "Monografier" in the top dropdown then click
    on "OK" the window does not close

To test:
- Apply the patch and run through the Web-installer again, selecting
  Norwegian and NORMARC
- Go to Home > Cataloging > Add MARC record and add a new record
- Click in the field for 008. The default should look like:
  130415t        no ||||| |||| 00| 0 nor d
                 ^^^                 ^^^
- Reload the page and open the value builder for 008.
- Check that...
  - The default for 15-17 is "no " (with a space at the end)
  - The link goes to NORMARC country codes
  - The default for 35-37 is "nor"
  - The link goes to NORMARC language codes
- Select something from the top dropdown and click "OK". Check that the
  window closes and that the values that are entered into the 008 field
  matches what you chose in the popup window.

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

Trusing Magnus is right, so testing for any regressions mainly, all good

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Only changes NORMARC specific plugin and system preferences
files. Changes all seem logical to me.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

Conflicts:
	installer/data/mysql/nb-NO/1-Obligatorisk/system_preferences.sql

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 7054 - NORMARC: Fix default for 000 position 17

Someone at the library education in Oslo told me that it would be
better to have the default for 000/17 set to 1, instead of 2 as it
is today.

To reproduce:
- Run through the Web-installer in Norwegian and choose NORMARC as
  the MARC dialect
- Go to Home > Cataloging > Add MARC record and start to add a new
  record
- Click in the 000 field and it should be filled with:
  "     nam a22     2  4500"
- Reload the page, then open the value builder for 000 and click on OK
- 000 should get filled with the same string as above

To test:
- Apply the patch and repeat the steps from above. The default value
  for 000 should now be:
  "     nam a22     1  4500"

(Don't be confused by the 1s and the 2s. A value of 1 in position 17
means "level 2", and a value of 2 means "level 1" - that is how it
is defined in the "standard":
1 = Nivå 2, iflg. Katalogiseringsregler
2 = Nivå 1, iflg. Katalogiseringsregler)

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Small changes. Didn't test in a NORMARC installaton, but
trusting Magnus with this and seeing no reason why it
shouldn't work.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(cherry picked from commit 064fc8b5223b19a57c658e7ca3444df7c017a444)

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 8419 - Suspended holds appear on the daily holds queue

This bug was reintroduced by the patch for bu 5911: Transport Cost Matrix

Test Plan:
1) Place a hold on a record
2) Run build_holds_queue.pl
3) Verify the hold is showing in the holds queue
4) Suspend the hold
5) Re-run build_holds_queue.pl
6) Note the hold is still in the holds queue
7) Apply patch
8) Re-run build_holds_queue.pl
9) Note the hold is no longer in the holds queue

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes test plan and QA script.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(cherry picked from commit d098a7c298437b2fd6ced6a8237f98f3221b810f)

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 10033 - dangerous query in _koha_modify_item

The SQL query build in C4::Items::_koha_modify_item performs an update on a row of items table identified by itemnumber.
Actually the query is build using a hash of datas :
    for my $key ( keys %$item ) {
        $query.="$key=?,";
        push @bind, $item->{$key};
    }
But this hash contains 'itemnumber' key, so you get an update including the primary key.
It is actually harmless but may be dangerous.

This patch simply skips itemnumber key in above loop.

Test plan :
Check you can create and modify items.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(cherry picked from commit 598dfe27224f517fafa06df75521c623992ecbe0)

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(cherry picked from commit ba8e383cf6835e204259063e6c18ac9c3892029b)

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 10149 - koha-restart-zebra error handling (rewording)

koha-restart-zebra now
- Checks the instance exists.
- Checks the instance is enabled.
- Checks if the zebra daemon is already running.

Regards
To+

Edit:
- changed some wording problems.
- fixed an error in parameter validation

Sponsored-by: Universidad Nacional de Córdoba
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(cherry picked from commit cee6909c8a5c10cc534a1ebe35ec5b8cda522eab)

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(cherry picked from commit 6ee0d799bb9e1f08625503a1e5b4505791985d3d)

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 10144 - koha-start-zebra error handling

koha-start-zebra now
- Checks the instance exists.
- Checks the instance is enabled.
- Checks if the zebra daemon is already running.

Regards
To+

Sponsored-by: Universidad Nacional de Córdoba
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(cherry picked from commit 98bde26d2571b43ecee07e017e36f45e1aa6e680)

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(cherry picked from commit 6f40e7ebd667fbaf850046b8b4c3246e2dd3e170)

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 10104 - make koha-disable more robust

koha-disable now:

- checks for the existence of the instance before any actions on it.
- checks if the instance is already disabled before touching anything (warns otherwise)
- only reloads apache if needed
- handles more than one instance name.
- changed the docs to acknowledge the previous item.

To test:
- Apply the patch, build your package
- Run koha-disable on
  - Non existent instance (try names that are prefix and suffix of a valid one too please)
  - Already disabled instance name.
  - Enabled instance name.

It should work as expected and warn the user on the expected wrong cases.

Regards
To+

Sponsored-by: Universidad Nacional de Córdoba
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(cherry picked from commit b055f7d86c7772cf52c4a20d04a7e1cb0c8c19c9)

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(cherry picked from commit 3f03c2699062d399f3f7392acfd3e32b50cdf81a)

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 10104 - Followup: fix param check

As noted by Mason on bug 10101, the check was not working for zero arguments.

Sponsored-by: Universidad Nacional de Córdoba

Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(cherry picked from commit ca118d57db383f5efebc4d53cba11ccc8af5c9a9)

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(cherry picked from commit 605d0a99b7d0fa91ed321c72c27111b1af7ceef4)

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 10101 - make koha-enable more robust

koha-enable now:

- checks for the existence of the instance before any other action on it.
- checks if the instance is already enabled before changing stuff in the config files.
- only reloads apache if it is needed!
- handles more than one instance name as parameter (the code was there, a check for the cardinality of the args prevented it from working).
- documents this behaviour change in the docs
- doesn't break if the provided (invalid) instance name is a prefix/suffix of a real one (added -x to the relevant grep command).

To test:
- Aplpy the patch, build your packages
- Run koha-enable on
  - Non existent instance (try using a prefix or a suffix of an already created one too).
  - Already enabled existent instance name.
  - Disabled instance.

Regards
To+

Sponsored-by: Universidad Nacional de Córdoba
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(cherry picked from commit 3bca90eb0c0fc91f64f3e479ac6ab25e54d4f1aa)

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(cherry picked from commit 97bf5b40c9da1ba4bca114185fb0770edfaf65f1)

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 10101 - Follwup: fix param check

As Mason noted, there was an error on that line.

Sponsored-by: Universidad Nacional de Córdoba
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(cherry picked from commit 7d09198659c92eda7046dee0f93e4caf2ec37096)

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(cherry picked from commit a4a270be68b7047ec6359847c1a462b7a82f6b67)

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 10041 - Provide a koha-translate script to aid package users on installing translations

Until we have solved the packaging of koha template translations, provide a command that manages the installed translations in a proper way.

To test, build a Debian package of current master+the patches from this bug :-D and try the many options running koha-translate --help provide.

The command itself can be grabbed from a git checkout with this patch applied to test the script's funcionality. If it (and its docs) fits the package building stuff, I'll test on monday when I can be back on my workstation.

Sponsored-by: Universidad Nacional de Córdoba

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

Comment: Good adition. Work as described. No errors.
Copied to /usr/local/bin. No errors on install, update, remove, list and check.
Passed-QA-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(cherry picked from commit 2cd5afa9741ef432a9f3ecac939c98e20d5ebfc5)

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(cherry picked from commit cb321e5b10fc944d65d5b274e97e3506bd034396)

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 9250 - [SIGNED-OFF] provide commands to manage the SIP server

This adds commands required to control the SIP server. These commands
are:
* koha-enable-sip - copies the SIP config to the sites directory
* koha-start-sip - starts the SIP server processes
* koha-stop-sip - stops the SIP server processes

It also calls these as appropriate from the koha-common init script.

To use:
1) sudo koha-enable-sip instancename
2) sudo vim /etc/koha/sites/instancename/SIPconfig.xml
   Do whatever is needed for your site's SIP configuration
3) sudo koha-start-sip instancename

To test:
1) Build packages with this patch
2) Ensure that sudo koha-start-sip instancename doesn't do anything
3) Run sudo koha-enable-sip instancename
4) Edit /etc/koha/sites/instancename/SIPconfig.xml if needed (probably
   not required for testing)
5) Run sudo koha-start-sip instancename
6) Note that the sip processes are now running
7) Run sudo koha-stop-sip instancename
8) Note that the sip processes have gone
9) Reboot your Koha server
10) Note that the sip processes are back

Sponsored-By: Waitaki District Council Libraries
Sponsored-By: South Taranaki District Council Libraries
Sponsored-By: Horowhenua District Council Libraries
Sponsored-By: Rangitikei District Council Libraries

Signed-off-by: Magnus Enger <magnus@enger.priv.no>
Works as advertised. koha-start-sip without a prior koha-enable-sip
does nothing. koha-enable-sip copies the SIP config file to the
instance directory. After koha-enable-sip, koha-start-sip and
koha-stop-sip works as expected. After a reboot, the SIP processes are
still running. I have not actually tested the SIP servers after they
have been started, but assume they work the same as always.
The man pages look good.

The new commands should also have been added to the man page for
koha-common. I'll do a followup for that.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(cherry picked from commit 3dc22e7fb27162b3a461477bc40f5c38a1739516)

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(cherry picked from commit c70fb0fcd625701d0f3d01f0c8faa17468bba54c)

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 9250 - Followup to add koha-*-sip commands to koha-common.xml

The original patch for Bug 9250 did not add the new commands to
debian/docs/koha-common.xml, which functions as a sort of table
of contents for the real commands. This patch adds them.

Signed-off-by: Robin Sheat <robin@catalyst.net.nz>

Simple documentation patch
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(cherry picked from commit 38b1fd99c4e3a2ae3a944c5ba0b17189da3feef5)

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(cherry picked from commit cdfca5bb6b6a25619216e579f2cdf5bdaa14f990)

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 10044: Remove duplicate pagination on the pending orders page.

Test plan:
Check that there is just one pagination on the pending orders page.

Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works and deletes the old pagination that was replaced by
datatables.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(cherry picked from commit 7b0b6e32d1462fab10257769c417f014b0819135)

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(cherry picked from commit e61c1e0810528cdaf1db99a4ec70bd96e607021a)

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 10150 - koha-email-disable error handling

koha-email-disable now
- Checks the instance exists.
- Checks if email is already disabled.

Regards
To+

Sponsored-by: Universidad Nacional de Córdoba
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 31b43ac1fe6830426c80988b93bc15d0fa88e79a)

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(cherry picked from commit 72961866afc155327dee10d1a2c4dfbac9075159)

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 9358 - Fixed field plugins for MARC21 should be updated for MARC21 update #15

This patch, together with 9357, fix plugins for leader, 006, 007 and 008 MARC21 fields

Leader18 c and i is fixed on Bug 9357

Added missing/renamed fields on 007

Options 'o' and 'q' already present on 006 and 008,
fixing spaces and removing unnecessary descriptions.

To test:
1) Catalog/edit a record
2) On 007 value builder, check missing values
   on 008, BKS, check for example 33- Literary form,
   i- Letters has a description
3) Apply the patch
4) Clean your browser cache
5) On 007 value builder, new values are present
   On 008/6 descriptions are absent

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(cherry picked from commit 67dae3abd4bbd5394c62eaeccfa67d9c0220a627)

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(cherry picked from commit 75b662028ae825bb2db4801132bb23707af7db53)

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