Koha/koha-tmpl/intranet-tmpl/prog/en/modules
David Cook ca33b7fc63 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>
2013-07-08 15:23:05 +00:00
..
acqui Bug 10366: Alert librarian if an invoice number is duplicated 2013-07-06 17:13:45 +00:00
admin Bug 10366: Alert librarian if an invoice number is duplicated 2013-07-06 17:13:45 +00:00
authorities Bug 2774 - Path to theme is hard-coded in many places 2013-05-20 11:11:04 -07:00
basket Bug 9669 - Replace YUI buttons on staff client cart toolbar 2013-02-28 19:14:46 -05:00
batch
catalogue Bug 9757: Make staff client list contents view more like search results 2013-06-26 09:04:04 -07:00
cataloguing Bug 10448: can now change framework after duplicating bib record 2013-07-08 15:23:05 +00:00
circ Bug 10368: (followup) tweak label 2013-06-07 08:56:48 -07:00
course_reserves Bug 10418 - Correct template markup problems on course reserves add item page 2013-06-14 11:21:45 -07:00
errors
help Bug 9307: (follow-up) help text tweaks 2013-06-19 08:14:51 -07:00
installer Bug 2774 - Path to theme is hard-coded in many places 2013-06-07 09:04:15 -07:00
labels Bug 2774 - Path to theme is hard-coded in many places 2013-06-07 09:04:15 -07:00
members Bug 10297 - categorycode and branchcode should be required when adding patrons 2013-06-12 11:51:54 -07:00
offline_circ Bug 10288 - Fix a tiny typo on "Pending offline circulation actions" 2013-05-20 12:23:32 -07:00
patroncards Bug 2835 - Inconsistent use of colon at the end of sentences 2013-04-02 09:03:42 -04:00
plugins Bug 7804 - Add Koha Plugin System - QA Followup 2 2013-03-20 14:50:19 -04:00
reports Bug 10396: remove unnecessary date-picker widgets from Catalog statistics form 2013-06-17 07:37:30 -07:00
reserve Bug 10464: Patron search on placing a hold now supports autocomplete 2013-06-16 18:38:30 -07:00
reviews
rotating_collections
serials Bug 10080: (followup) change two last instances of the old syspref name 2013-05-22 08:10:35 -07:00
services Bug 8637: Lack of control on mandatory in orderreveive.tt 2012-08-31 13:48:52 +02:00
sms
suggestion Bug 4907: make 'Organize by' filter in suggestions reflect selected option 2013-07-08 15:15:16 +00:00
tags Bug 2774 - Path to theme is hard-coded in many places 2013-05-20 11:11:04 -07:00
test Bug 2774 - Path to theme is hard-coded in many places 2013-05-20 11:11:04 -07:00
tools Bug 9533: batch item modification form now shows default field values only by request 2013-07-05 15:52:26 +00:00
virtualshelves Bug 9757: Remove duplicated action buttons. 2013-06-26 09:04:37 -07:00
z3950 Bug 9265 - Switch to HTML5 doctype in OPAC and staff client 2013-01-31 11:47:04 -05:00
about.tt Bug 7143: Release team 3.14 on about page 2013-06-16 15:19:39 -07:00
auth.tt Bug 10080 - Change system pref IndependantBranches to IndependentBranches 2013-05-22 07:58:23 -07:00
intranet-main.tt Bug 7875: Change the pending suggestion link in home page so that it directs to pending suggestions 2013-03-20 08:40:43 -04:00