Bug 4907: make 'Organize by' filter in suggestions reflect selected option

When using the 'Organize by' option to change the display of the
suggestions, the option is applied, but the pull down always jumps
back to the first entry 'Status'.

This patch fixes that.

To test:
- Try out all settings and verify that after the page reloads the selected
  option is applied to your suggestions and the pull down shows
  the option you selected.

Note: Until bug 10519 is properly fixed the tabs will not show
the correct descriptions, but the URL will show you the selected
option as parameter: displayby=acceptedby

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 10448: can now change framework after duplicating bib record

Changing the framework in the MARC editor immediately after duplicating
a bib record no longer clears the fields.

This patch changes the Changefwk Javascript function so that it passes
the "op" value and the "biblionumberdata" (as the biblionumber) from
addbiblio.pl back to itself, when submitting the form in order to
change the framework.

The reason we need to do this is because the form in addbiblio.tt
is hard-coded to always submit an "op" value of "addbiblio". Currently,
we need to have it hard-coded to "addbiblio", because all the magic
happens in addbiblio.pl when there is an "op" of "addbiblio". If we
always passed the "actual" "op" value, such as "duplicate", nothing
would ever happen when we clicked "save". It seems to me that this
is a flaw in the design of addbiblio.pl.

If we pass the "op" and "biblionumber" when changing frameworks, we're
able to tell addbiblio.pl that we're still wanting to "duplicate" this
"X" biblionumber. However, by having the form still hard-coded to
"addbiblio", when we hit save, the form will do the magic, check if
it's a duplicate, and save the record (or prompt for action if it
is a duplicate).

--

I also noticed that if you make changes to a record, then change
the framework before saving, your changes get cleared (since the
original record from the database is loaded when the page reloads).
It seems to me that this is a bug. Changing the framework should
change the layout while preserving the content. I think most users
would assume that when changing the framework.

This patch also introduces another hidden input into addbiblio.tt and
the Changefwk Javascript called "changed_framework". Basically, if
the Changefwk Javascript is run, it tells addbiblio.pl that the
framework is changed, and it uses the posted data from the form
(which we have been modifying) instead of reloading the record from
the database.

--

Test Plan:

A) Before Applying Patch:

To Show That Changing the Framework Erases All Fields When
Duplicating a Record:

1) Go to any bib record
2) Go to Edit > Edit as new (duplicate). You should see filled
in fields.
3) Change the framework to any other framework than the one
that is currently specified.
4) Note that every single field is now blank

To Show That Changing the Record then Changing the Framework
Ignores Changes, When Editing a Record

5) Go to any bib record
6) Go to Edit.
7) Change the title of the record to "I've changed the title".
8) Change the framework to any other framework than the one that is currently specified.
9) Look at the title. You'll notice it is the original title, and NOT "I've changed the title".

B) Apply the Patch

Also, clear your memcache and shift+refresh your screen. You don't want to use cached templates/javascript.

C) After Applying the Patch

Repeat Steps 1-3 and 5-8.

You should now notice that changing the framework when duplicating the item does not clear all the fields.

You should also notice that any changes you make prior to changing the framework will still exist after changing it.

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 5766 - Add configuration for excluding articles from DataTables sorting

Client-side table sorting should exclude articles like "a," "an," and
"the" when sorting by title. This patch adds a custom sorting plugin for
use by DataTables and a configuration line to the DataTables string
configuration file which can be translated for any language.

As an example, this patch modifies the patron checkout history template
to use the new sort on the title column.

To test, apply the patch and clear your browser cache to ensure the
revised JavaScript file is loaded. Sort the table by title. Titles
should be sorted regardless of the presences of "a," "an", or "the" at
the beginning of the title.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and is a good improvement.
I have added German articles to the list for testing purposes
and it worked nicely.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 7143: Updating history and about page

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