Bug 22436

Summary: add move or copy control field from or to subfield in MARC modification templates
Product: Koha Reporter: Fridolin Somers <fridolin.somers>
Component: ToolsAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: black23, dubyk, jonathan.druart, mathsabypro
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22245
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27978
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36515
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Fridolin Somers 2019-02-28 16:19:02 UTC
MARC modification templates does not allow to mix control field and the subfield of a regular field, we should allow that.
But of course not the mix of an entire regular field and the subfield of a regular field.
Comment 1 Fridolin Somers 2019-02-28 16:19:41 UTC
I think the form checks could look like that :

# Check destination is filled
if
  to_field undefined
then
  "The destination should be filled."

# Control field does not need a subfield
if
  from_field is < 10 and from_subfield undefined
  or
  to_field is < 10 and to_subfield undefined
then
  "If the field is a control field, the subfield should be empty"

# Case source field is a control field
if
  from_field is < 10
then
  if
    to_field is >= 10 and to_subfield undefined
  then
    "If source field is a control field and destination is a regular field, destination subfield must be filled."

# Case source field is a regular field
if
  from_field is >= 10
then
  if
    to_field is < 10 and from_subfield undefined
  then
    "If source field is a regular field and destination is a control field, source subfield must be filled."
  if
    to_field is >= 10
    and
    (
    from_subfield defined and to_subfield undefined
    or
    from_subfield undefined and to_subfield defined
    )
  then
    "If source and destination fields are regular fields, both subfield values should be filled or empty."