Bug 12540: Display "Every" on editing a MMT action if previously selected
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 22 Sep 2015 10:16:28 +0000 (11:16 +0100)
committerLiz Rea <wizzyrea@gmail.com>
Thu, 10 Dec 2015 01:49:24 +0000 (14:49 +1300)
On creating a marc modification template action, the "All" is changed with
"Every" if the condition field is the same as the original field.

But on editing, the "All" value is not replaced. For consistency, it
should.

Test plan:
1/ Create the following action:
    Copy field 650$x to 650$y if 650$z matches "foobar"
Note that the "All" is replaced with "Every" when the condition is the
same field as the original field.
2/ Save
3/ Edit the action.
The "Every" should be selected.

Without this patch, "All" is selected.

Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 384dceeef583c444ac8350c928a2e1aed34e536b)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 868bdc355d9f5d7e098fd00eff2fbc29597659c7)
Signed-off-by: Liz Rea <wizzyrea@gmail.com>

koha-tmpl/intranet-tmpl/prog/en/modules/tools/marc_modification_templates.tt

index d42e0ad..7e84b21 100644 (file)
@@ -425,7 +425,7 @@ function setSelectByValue( selectId, value ) {
                                                     "[% ActionsLoo.conditional_value |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]",
                                                     "[% ActionsLoo.conditional_regex |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]",
                                                     "[% ActionsLoo.description |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]"
-                                                )'>Edit</a></td>
+                                                );updateAllEvery();'>Edit</a></td>
                                 <td><a href="marc_modification_templates.pl?template_id=[% ActionsLoo.template_id %]&op=delete_action&mmta_id=[% ActionsLoo.mmta_id %]">Delete</a></td>
                             </tr>
                         [% END %]