Bug 22436 - add move or copy control field from or to subfield in MARC modification templates
Summary: add move or copy control field from or to subfield in MARC modification templ...
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-28 16:19 UTC by Fridolin Somers
Modified: 2023-06-20 16:27 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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."