Bug 10217 - Make sure direct links to detail views work when there is no session

To reproduce:
- Make sure you do not have a session for the OPAC you will be testing
  with. Delete the CGISESSID session cookie if you have one.
- Go directly to a detail view, e.g.:
  /cgi-bin/koha/opac-detail.pl?biblionumber=1
- Observe the error "Can't use an undefined value as a HASH
  reference at /home/magnus/scripts/kohadev/opac/opac-detail.pl line 445."

To test:
- Apply the patch
- Reload the page with the error
- You should now see the detail view of the record, as usual

Thanks to Chris Cormack who suggested the fix for this!

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested according to test plan, confirmed patch fixes the problem.
All tests and QA script pass.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Merge branch 'bug_10217' into 3.14-master
Bug 10201 - Old OPAC patron update system should be removed

The old pages for viewing and updating patron details in the OPAC have
been superceded by the new script opac-memberentry.pl. This patch
removes he old scripts and templates and corrects links to them.

This patch also removes reference to opac-userupdate.tt from
opac-patron-image.pl  and replaces the authentication process with one
which uses check_cookie_auth, based on the example of opac-tags.pl.

To test, edit a patron record and set the "Gone no address" flag. Log in
to the OPAC with that account and view the patron details page. The
warning about out of date contact information should link to the new
update page.

Next, attempt to place a hold. You should see the same warning, and it
should also link to the new update page.

Test the display of patron images: Log in as a user who has an image
associated with their account and navigate to
/cgi-bin/koha/opac-patron-image.pl. Their patron image should display.

A search of Koha source files should return no results for the missing
scripts or templates.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comments on second patch.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Bug 10201 [Follow-up] Old OPAC patron update system should be removed

The previous patch missed removal of one template, kohaerror.tt, which
was used only by opac-userupdate.pl. This patch removes it.

To test, apply the patch and search Koha source files for references to
kohaerror. There should be none.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and QA script pass. Updating the German po files
with this patch applied no new strings appeared.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Merge branch 'bug_10201' into 3.14-master
Bug 9679 - can't place hold from cart in CCSR

When the CCSR theme is enabled, selecting items in the cart and clicking
"place hold" triggers a JavaScript error and fails. This patch adds a
function missing from the CCSR version of basket.js.

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

- Enable the CCSR theme and put items into the OPAC cart.
- Open the cart, select one or more items, and click "place hold."

The cart should automatically close and the main window should redirect
to the holds screen showing your selections.

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

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Confirmed patch fixes the problem described.
All tests and QA script pass, JavaScript only change.
No strings involved, save for inclusion in 3.12.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Merge branch 'bug_9679' into 3.14-master
Bug 10134 - set XSLT usage ON as default, for new Koha installs

Currently, new installs are created with XSLT display set to "off",
but XSLT seems to be the preferred way to display records, so
having the default be "on" instead seems to make sense. This patch
will of course only affect new installs.

To test:
- Apply the patch
- Run through the webinstaller on an empty database
- Log in to the staff client and search for "xslt" in system
  preferences
- Verify that XSLTDetailsDisplay, XSLTResultsDisplay,
  OPACXSLTDetailsDisplay and OPACXSLTResultsDisplay are all set to
  "default"

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

Passes test plan correctly.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Changes syspref.sql for new installations to use XSLT views
by default. No changes to existing installations, no
string changes.
Passes all tests.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Merge branch 'bug_10134' into 3.14-master
Bug 10225 - If an item isn't editable, don't show the onclick Edit/Delete menu

The user should not be shown edit/delete links when clicking on a row in
additems which they cannot edit because of the IndependantBranches
setting. This patch adds a class to the row to exclude such rows in the
JavaScript onclick handler.

To test:

- Turn IndependantBranches on and edit items for a title which
  has holdings from various branches including your own.
- Click a row for an item which is held by your library. You should see
  the "Edit/Delete" links appear.
- Click a row for an item which is held by another library. No links
  should appear.

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

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and QA script pass.
Changes to the templates include no string changes.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Merge branch 'bug_10225' into 3.14-master
Bug 10054 - When SingleBranchMode is enabled, allow superlibrarians to set logged in library

Currently, when SingleBranchMode is enabled, nobody can change the
logged in library in Koha. To change it requires disable
SingleBranchMode, switching the library, and re-enabling it. It seems
reasonable to allow superlibrarians to switch the logged in library even
if SingleBranchMode is enabled.

Test Plan:
1) Apply this patch
3) Enable SingleBranchMode
4) Log in as a superlibrarian
5) Attempt to change the logged in branch
   This change should succeed
6) Log in as a non-superlibrarian account
7) Attempt to change the logged n branch
   This should not be allowed, as per Koha's current behavior

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

I guess this doesn't do any harm even though the practical motivations
behind it, as described in the bug, seem otherwise solvable. If
SingleBranchMode is supposed to prevent librarians from switching their
logged in library why can they choose their library when they first log
in? Was SingleBranchMode supposed to only affect the OPAC originally? Or
should the login form be modified? This seems to be a band-aid on a
poorly-implemented feature.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Patch works as decribed. As this only adds a check for a superlibrarian
it seems safe and should not interfere with normal staff accounts.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Merge branch 'bug_10054' into 3.14-master
Bug 9680 - cart aligned right in CCSR

The CCSR theme sets a min-width of 1000px for windows which are more
than 700px wide. This caused the cart popup window to be given a
min-width of 1000px, resulting in a broken layout with unnecessary
horizontal scrolling.

This patch adds a class to the cart template and to other pop-up window
templates to ensure that a large min-width is not enforced and to give
consistent padding to those pages.

To test, set your theme to 'CCSR' and view the following pop-up pages:

- The Cart. From the cart, trigger:
  - The "send" window
  - The "download" window
- From a view of a List's contents trigger:
 - The "send" window"
 - The "download" window

Each of these pages should look correct with no horizontal scrolling.

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

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Template and CSS changes only, but no string changes.
Save for inclusion in 3.12.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Merge branch 'bug_9680' into 3.14-master
Bug 7593: Move orders on the destination record when merging 2 records

Revised patch according to QA comments. No more dependent from bz 9780.

At present, merging records breaks the link order/record, except
if an item of the deleted record is used in the order.
This is a serious issue for libraries creating items on receipt.
This patch moves existing orders from deleted record to destination record.
It creates a new function Acquisitions::GetOrdersByBiblionumber,
that could be used by other patches later.

To test :
Check the problem :
1. Set syspref AcqCreateItem = Create an item when receiving an order
1. Create a basket with one order
2. Put the record used by this order in a list
3. Put an other record in the list
4. Merge the 2 records, keeping as a reference the record NOT used in the order
5. In the order, you will see for that order "Deleted bibliographic information..."
6. Apply the patch
7. Repeat steps 1-4
8. In the order, you will see the title/author of the kept record.
9. Set syspref AcqCreateItem = Create an item when placing an order
10. Repeat steps 1-4 (an item will be created)
11. In the oreder, you will see the title/author of the kept record
    (it is already the case at present. the patch should not alter this behavior)

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Test plan, test suite and QA script pass.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Bug 7593 : QA followup : restores deleted line in C4::Acquisition

This patch restores the line exporting GetOrderNumber that I accidentally suppressed.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Restores a line that was deleted by the first patch.
Was not sure if patches should be squashed.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Merge branch 'bug_7593' into 3.14-master
Bug 10100: adds a class to OPAC news dates

Adds a "newsfooter" class to allow CSS modification
of the date appearing as a footer on each news.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Adds a class, checked po files to make sure change is string safe.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Merge branch 'bug_10100' into 3.14-master