View | Details | Raw Unified | Return to bug 8015
Collapse All | Expand All

(-)a/C4/Koha.pm (-6 / +4 lines)
Lines 1488-1496 sub _isbn_cleanup { Link Here
1488
    return;
1488
    return;
1489
}
1489
}
1490
1490
1491
=head2
1491
=head2 Log( $message );
1492
1493
  Log( $message );
1494
1492
1495
  Writes data to /tmp/koha.log.
1493
  Writes data to /tmp/koha.log.
1496
1494
Lines 1502-1510 sub _isbn_cleanup { Link Here
1502
sub Log {
1500
sub Log {
1503
  my ($data) = @_;
1501
  my ($data) = @_;
1504
  warn $data;
1502
  warn $data;
1505
  open (MYFILE, '>>/tmp/koha.log');
1503
  open my $fh, '>>/tmp/koha.log';
1506
  print MYFILE "$data\n";
1504
  print $fh "$data\n";
1507
  close (MYFILE);
1505
  close $fh;
1508
}
1506
}
1509
1;
1507
1;
1510
1508
(-)a/C4/MarcModificationTemplates.pm (-19 / +19 lines)
Lines 35-58 use vars qw($VERSION @ISA @EXPORT); Link Here
35
use constant DEBUG => 0;
35
use constant DEBUG => 0;
36
36
37
BEGIN {
37
BEGIN {
38
	$VERSION = 1.00;	# set the version for version checking
38
    $VERSION = 1.00;    # set the version for version checking
39
	@ISA = qw(Exporter);
39
    @ISA = qw(Exporter);
40
	@EXPORT = qw(
40
    @EXPORT = qw(
41
		&GetModificationTemplates
41
        &GetModificationTemplates
42
		&AddModificationTemplate
42
        &AddModificationTemplate
43
		&DelModificationTemplate
43
        &DelModificationTemplate
44
44
45
		&GetModificationTemplateAction
45
        &GetModificationTemplateAction
46
		&GetModificationTemplateActions
46
        &GetModificationTemplateActions
47
47
48
		&AddModificationTemplateAction
48
        &AddModificationTemplateAction
49
		&ModModificationTemplateAction
49
        &ModModificationTemplateAction
50
		&DelModificationTemplateAction
50
        &DelModificationTemplateAction
51
		&MoveModificationTemplateAction
51
        &MoveModificationTemplateAction
52
52
53
                &ModifyRecordsWithTemplate
53
        &ModifyRecordsWithTemplate
54
		&ModifyRecordWithTemplate
54
        &ModifyRecordWithTemplate
55
	);
55
    );
56
}
56
}
57
57
58
58
Lines 564-570 sub ModifyRecordWithTemplate { Link Here
564
564
565
    C4::Koha::Log("eval $eval") if DEBUG >= 2;
565
    C4::Koha::Log("eval $eval") if DEBUG >= 2;
566
    warn("eval $eval") if DEBUG >= 2;
566
    warn("eval $eval") if DEBUG >= 2;
567
    eval $eval;
567
    eval {$eval};
568
    C4::Koha::Log( $record->as_formatted() ) if DEBUG >= 10;
568
    C4::Koha::Log( $record->as_formatted() ) if DEBUG >= 10;
569
    warn( $record->as_formatted() ) if DEBUG >= 10;
569
    warn( $record->as_formatted() ) if DEBUG >= 10;
570
570
(-)a/Koha/SimpleMARC.pm (-8 / +8 lines)
Lines 60-66 at your option, any later version of Perl 5 you may have available. Link Here
60
60
61
=head1 FUNCTIONS
61
=head1 FUNCTIONS
62
62
63
=head2
63
=head2 copy_field
64
64
65
  copy_field( $record, $fromFieldName, $fromSubfieldName, $toFieldName, $toSubfieldName[, $regex[, $n ] ] );
65
  copy_field( $record, $fromFieldName, $fromSubfieldName, $toFieldName, $toSubfieldName[, $regex[, $n ] ] );
66
66
Lines 94-100 sub copy_field { Link Here
94
94
95
}
95
}
96
96
97
=head2
97
=head2 update_field
98
98
99
  update_field( $record, $fieldName, $subfieldName, $dont_erase, $value[, $value,[ $value ... ] ] );
99
  update_field( $record, $fieldName, $subfieldName, $dont_erase, $value[, $value,[ $value ... ] ] );
100
100
Lines 157-163 sub update_field { Link Here
157
  }
157
  }
158
}
158
}
159
159
160
=head2
160
=head2 read_field
161
161
162
  my @values = read_field( $record, $fieldName[, $subfieldName, [, $n ] ] );
162
  my @values = read_field( $record, $fieldName[, $subfieldName, [, $n ] ] );
163
163
Lines 189-195 sub read_field { Link Here
189
  }
189
  }
190
}
190
}
191
191
192
=head2
192
=head2 field_exists
193
193
194
  $bool = field_exists( $record, $fieldName[, $subfieldName ]);
194
  $bool = field_exists( $record, $fieldName[, $subfieldName ]);
195
195
Lines 214-220 sub field_exists { Link Here
214
  return $return;
214
  return $return;
215
}
215
}
216
216
217
=head2
217
=head2 field_equals
218
218
219
  $bool = field_equals( $record, $value, $fieldName[, $subfieldName[, $regex [, $n ] ] ]);
219
  $bool = field_equals( $record, $value, $fieldName[, $subfieldName[, $regex [, $n ] ] ]);
220
220
Lines 246-252 sub field_equals { Link Here
246
  }
246
  }
247
}
247
}
248
248
249
=head2
249
=head2 move_field
250
250
251
  move_field( $record, $fromFieldName, $fromSubfieldName, $toFieldName, $toSubfieldName[, $regex [, $n ] ] );
251
  move_field( $record, $fromFieldName, $fromSubfieldName, $toFieldName, $toSubfieldName[, $regex [, $n ] ] );
252
252
Lines 266-272 sub move_field { Link Here
266
  delete_field( $record, $fromFieldName, $fromSubfieldName, $n );
266
  delete_field( $record, $fromFieldName, $fromSubfieldName, $n );
267
}
267
}
268
268
269
=head2
269
=head2 delete_field
270
270
271
  delete_field( $record, $fieldName[, $subfieldName [, $n ] ] );
271
  delete_field( $record, $fieldName[, $subfieldName [, $n ] ] );
272
272
Lines 296-302 sub delete_field { Link Here
296
  }
296
  }
297
}
297
}
298
298
299
=head2
299
=head2 _update_repeatable_field_with_single_value
300
300
301
  _update_repeatable_field_with_single_value( $record, $fieldName, $subfieldName, $value );
301
  _update_repeatable_field_with_single_value( $record, $fieldName, $subfieldName, $value );
302
302
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc (-1 / +1 lines)
Lines 69-75 Link Here
69
    [% END %]
69
    [% END %]
70
-->
70
-->
71
    [% IF ( CAN_user_tools_marc_modification_templates ) %]
71
    [% IF ( CAN_user_tools_marc_modification_templates ) %]
72
	<li><a href="/cgi-bin/koha/tools/marc_modification_templates.pl">Manage MARC modification templates</a></li>
72
        <li><a href="/cgi-bin/koha/tools/marc_modification_templates.pl">Manage MARC modification templates</a></li>
73
    [% END %]
73
    [% END %]
74
    [% IF ( CAN_user_tools_stage_marc_import ) %]
74
    [% IF ( CAN_user_tools_stage_marc_import ) %]
75
	<li><a href="/cgi-bin/koha/tools/stage-marc-import.pl">Stage MARC for import</a></li>
75
	<li><a href="/cgi-bin/koha/tools/stage-marc-import.pl">Stage MARC for import</a></li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/marc_modification_templates.tt (-401 / +398 lines)
Lines 5-237 Link Here
5
<script type="text/javascript">
5
<script type="text/javascript">
6
//<![CDATA[
6
//<![CDATA[
7
$(document).ready(function() {
7
$(document).ready(function() {
8
        $('#select_template').find("input:submit").hide();
8
    $('#select_template').find("input:submit").hide();
9
        $('#select_template').change(function() {
9
    $('#select_template').change(function() {
10
                $('#select_template').submit();
10
        $('#select_template').submit();
11
        });
11
    });
12
});
12
});
13
//]]>
13
//]]>
14
</script>
14
</script>
15
15
16
<script>
16
<script>
17
function onActionChange(selectObj) {
17
function onActionChange(selectObj) {
18
	// get the index of the selected option
18
    // get the index of the selected option
19
	var idx = selectObj.selectedIndex;
19
    var idx = selectObj.selectedIndex;
20
20
21
	// get the value of the selected option
21
    // get the value of the selected option
22
	var action = selectObj.options[idx].value;
22
    var action = selectObj.options[idx].value;
23
23
24
	switch( action ) {
24
    switch( action ) {
25
		case 'delete_field':
25
        case 'delete_field':
26
			show('field_number_block');
26
            show('field_number_block');
27
			hide('with_value_block');
27
            hide('with_value_block');
28
			hide('to_field_block');
28
            hide('to_field_block');
29
			break;
29
            break;
30
30
31
		case 'update_field':
31
        case 'update_field':
32
			hide('field_number_block');
32
            hide('field_number_block');
33
			show('with_value_block');
33
            show('with_value_block');
34
			hide('to_field_block');
34
            hide('to_field_block');
35
			break;
35
            break;
36
36
37
		case 'move_field':
37
        case 'move_field':
38
			show('field_number_block');
38
            show('field_number_block');
39
			hide('with_value_block');
39
            hide('with_value_block');
40
			show('to_field_block');
40
            show('to_field_block');
41
			break;
41
            break;
42
42
43
		case 'copy_field':
43
        case 'copy_field':
44
			show('field_number_block');
44
            show('field_number_block');
45
			hide('with_value_block');
45
            hide('with_value_block');
46
			show('to_field_block');
46
            show('to_field_block');
47
			break;
47
            break;
48
48
49
	}
49
    }
50
}
50
}
51
51
52
function onConditionalChange(selectObj) {
52
function onConditionalChange(selectObj) {
53
        // get the index of the selected option
53
    // get the index of the selected option
54
        var idx = selectObj.selectedIndex;
54
    var idx = selectObj.selectedIndex;
55
55
56
        // get the value of the selected option
56
    // get the value of the selected option
57
        var action = selectObj.options[idx].value;
57
    var action = selectObj.options[idx].value;
58
58
59
        switch( action ) {
59
    switch( action ) {
60
                case '':
60
        case '':
61
                        hide('conditional_block');
61
            hide('conditional_block');
62
                        break;
62
            break;
63
63
64
                case 'if':
64
        case 'if':
65
                case 'unless':
65
        case 'unless':
66
                        show('conditional_block');
66
            show('conditional_block');
67
                        break;
67
            break;
68
        }
68
    }
69
}
69
}
70
70
71
function onConditionalComparisonChange(selectObj) {
71
function onConditionalComparisonChange(selectObj) {
72
        // get the index of the selected option
72
    // get the index of the selected option
73
        var idx = selectObj.selectedIndex;
73
    var idx = selectObj.selectedIndex;
74
74
75
        // get the value of the selected option
75
    // get the value of the selected option
76
        var action = selectObj.options[idx].value;
76
    var action = selectObj.options[idx].value;
77
77
78
        switch( action ) {
78
    switch( action ) {
79
                case 'equals':
79
        case 'equals':
80
                case 'not_equals':
80
        case 'not_equals':
81
                        show('conditional_comparison_block');
81
            show('conditional_comparison_block');
82
                        break;
82
            break;
83
83
84
		default:
84
        default:
85
                        hide('conditional_comparison_block');
85
            hide('conditional_comparison_block');
86
                        break;
86
            break;
87
        }
87
    }
88
}
88
}
89
89
90
function onToFieldRegexChange( checkboxObj ) {
90
function onToFieldRegexChange( checkboxObj ) {
91
	if ( checkboxObj.checked ) {
91
    if ( checkboxObj.checked ) {
92
		show('to_field_regex_value_block');
92
        show('to_field_regex_value_block');
93
	} else {
93
    } else {
94
		hide('to_field_regex_value_block');
94
        hide('to_field_regex_value_block');
95
	}
95
    }
96
}
96
}
97
97
98
function onConditionalRegexChange( checkboxObj ) {
98
function onConditionalRegexChange( checkboxObj ) {
99
        if ( checkboxObj.checked ) {
99
    if ( checkboxObj.checked ) {
100
		document.getElementById( 'match_regex_prefix' ).style.visibility='visible';
100
        document.getElementById( 'match_regex_prefix' ).style.visibility='visible';
101
        } else {
101
    } else {
102
		document.getElementById( 'match_regex_prefix' ).style.visibility='hidden';
102
        document.getElementById( 'match_regex_prefix' ).style.visibility='hidden';
103
        }
103
    }
104
}
104
}
105
105
106
function show(eltId) {
106
function show(eltId) {
107
	elt = document.getElementById( eltId );
107
    elt = document.getElementById( eltId );
108
	elt.style.display='inline';
108
    elt.style.display='inline';
109
}
109
}
110
110
111
function hide(eltId) {
111
function hide(eltId) {
112
	clearFormElements( eltId );
112
    clearFormElements( eltId );
113
	elt = document.getElementById( eltId );
113
    elt = document.getElementById( eltId );
114
	elt.style.display='none';
114
    elt.style.display='none';
115
}
115
}
116
116
117
function clearFormElements(divId) {
117
function clearFormElements(divId) {
118
	myBlock = document.getElementById( divId );
118
    myBlock = document.getElementById( divId );
119
119
120
	var inputElements = myBlock.getElementsByTagName( "input" );
120
    var inputElements = myBlock.getElementsByTagName( "input" );
121
	for (var i = 0; i < inputElements.length; i++) {
121
    for (var i = 0; i < inputElements.length; i++) {
122
		switch( inputElements[i].type ) {
122
        switch( inputElements[i].type ) {
123
			case "text":
123
            case "text":
124
				inputElements[i].value = '';
124
                inputElements[i].value = '';
125
				break;
125
                break;
126
			case "checkbox":
126
            case "checkbox":
127
				inputElements[i].checked = false;
127
                inputElements[i].checked = false;
128
				break;
128
                break;
129
		}
129
        }
130
	}
130
    }
131
131
132
	var selectElements = myBlock.getElementsByTagName( "select" );
132
    var selectElements = myBlock.getElementsByTagName( "select" );
133
	for (var i = 0; i < selectElements.length; i++) {
133
    for (var i = 0; i < selectElements.length; i++) {
134
		selectElements[i].selectedIndex = 0;
134
        selectElements[i].selectedIndex = 0;
135
	}
135
    }
136
136
137
}
137
}
138
138
139
function confirmDelete() {
139
function confirmDelete() {
140
	var agree = confirm("Are you sure you wish to delete this template?");
140
    var agree = confirm("Are you sure you wish to delete this template?");
141
	return agree;
141
    return agree;
142
}
142
}
143
143
144
var modaction_legend_innerhtml;
144
var modaction_legend_innerhtml;
145
var action_submit_value;
145
var action_submit_value;
146
146
147
function editAction( mmta_id, ordering, action, field_number, from_field, from_subfield, field_value, to_field,
147
function editAction( mmta_id, ordering, action, field_number, from_field, from_subfield, field_value, to_field,
148
	to_subfield, to_regex, conditional, conditional_field, conditional_subfield,
148
    to_subfield, to_regex, conditional, conditional_field, conditional_subfield,
149
	conditional_comparison, conditional_value, conditional_regex, description
149
    conditional_comparison, conditional_value, conditional_regex, description
150
) {
150
) {
151
	document.getElementById('mmta_id').value = mmta_id;
151
    document.getElementById('mmta_id').value = mmta_id;
152
152
153
	setSelectByValue( 'action', action );
153
    setSelectByValue( 'action', action );
154
	document.getElementById('action').onchange();
154
    document.getElementById('action').onchange();
155
155
156
	setSelectByValue( 'field_number', field_number );
156
    setSelectByValue( 'field_number', field_number );
157
157
158
	document.getElementById('from_field').value = from_field;
158
    document.getElementById('from_field').value = from_field;
159
	document.getElementById('from_subfield').value = from_subfield;
159
    document.getElementById('from_subfield').value = from_subfield;
160
	document.getElementById('field_value').value = field_value;
160
    document.getElementById('field_value').value = field_value;
161
	document.getElementById('to_field').value = to_field;
161
    document.getElementById('to_field').value = to_field;
162
	document.getElementById('to_subfield').value = to_subfield;
162
    document.getElementById('to_subfield').value = to_subfield;
163
	document.getElementById('to_regex').value = to_regex;
163
    document.getElementById('to_regex').value = to_regex;
164
164
165
	document.getElementById('to_field_regex').checked = to_regex.length;
165
    document.getElementById('to_field_regex').checked = to_regex.length;
166
	document.getElementById('to_field_regex').onchange();
166
    document.getElementById('to_field_regex').onchange();
167
167
168
	setSelectByValue( 'conditional', conditional );
168
    setSelectByValue( 'conditional', conditional );
169
	document.getElementById('conditional').onchange();
169
    document.getElementById('conditional').onchange();
170
170
171
	document.getElementById('conditional_field').value = conditional_field;
171
    document.getElementById('conditional_field').value = conditional_field;
172
	document.getElementById('conditional_subfield').value = conditional_subfield;
172
    document.getElementById('conditional_subfield').value = conditional_subfield;
173
173
174
	setSelectByValue( 'conditional_comparison', conditional_comparison );
174
    setSelectByValue( 'conditional_comparison', conditional_comparison );
175
	document.getElementById('conditional_comparison').onchange();
175
    document.getElementById('conditional_comparison').onchange();
176
176
177
	document.getElementById('conditional_value').value = conditional_value;
177
    document.getElementById('conditional_value').value = conditional_value;
178
178
179
	document.getElementById('conditional_regex').checked = parseInt( conditional_regex );
179
    document.getElementById('conditional_regex').checked = parseInt( conditional_regex );
180
180
181
	document.getElementById('description').value = description;
181
    document.getElementById('description').value = description;
182
182
183
	window.modaction_legend_innerhtml = document.getElementById('modaction_legend').innerhtml;
183
    window.modaction_legend_innerhtml = document.getElementById('modaction_legend').innerhtml;
184
	document.getElementById('modaction_legend').innerhtml = "Edit Action " + ordering;
184
    document.getElementById('modaction_legend').innerhtml = "Edit Action " + ordering;
185
185
186
	window.action_submit_value = document.getElementById('action_submit').value;
186
    window.action_submit_value = document.getElementById('action_submit').value;
187
	document.getElementById('action_submit').value = "Update Action";
187
    document.getElementById('action_submit').value = "Update Action";
188
188
189
	show('cancel_edit');
189
    show('cancel_edit');
190
}
190
}
191
191
192
function cancelEditAction() {
192
function cancelEditAction() {
193
	document.getElementById('mmta_id').value = '';
193
    document.getElementById('mmta_id').value = '';
194
194
195
	setSelectByValue( 'action', 'delete_field' );
195
    setSelectByValue( 'action', 'delete_field' );
196
	document.getElementById('action').onchange();
196
    document.getElementById('action').onchange();
197
197
198
	document.getElementById('from_field').value = '';
198
    document.getElementById('from_field').value = '';
199
	document.getElementById('from_subfield').value = '';
199
    document.getElementById('from_subfield').value = '';
200
	document.getElementById('field_value').value = '';
200
    document.getElementById('field_value').value = '';
201
	document.getElementById('to_field').value = '';
201
    document.getElementById('to_field').value = '';
202
	document.getElementById('to_subfield').value = '';
202
    document.getElementById('to_subfield').value = '';
203
	document.getElementById('to_regex').value = '';
203
    document.getElementById('to_regex').value = '';
204
204
205
	document.getElementById('to_field_regex').checked = false;
205
    document.getElementById('to_field_regex').checked = false;
206
	document.getElementById('to_field_regex').onchange();
206
    document.getElementById('to_field_regex').onchange();
207
207
208
	setSelectByValue( 'conditional', '' );
208
    setSelectByValue( 'conditional', '' );
209
	document.getElementById('conditional').onchange();
209
    document.getElementById('conditional').onchange();
210
210
211
	document.getElementById('conditional_field').value = '';
211
    document.getElementById('conditional_field').value = '';
212
	document.getElementById('conditional_subfield').value = '';
212
    document.getElementById('conditional_subfield').value = '';
213
213
214
	setSelectByValue( 'conditional_comparison', '' );
214
    setSelectByValue( 'conditional_comparison', '' );
215
	document.getElementById('conditional_comparison').onchange();
215
    document.getElementById('conditional_comparison').onchange();
216
216
217
	document.getElementById('conditional_value').value = '';
217
    document.getElementById('conditional_value').value = '';
218
218
219
	document.getElementById('conditional_regex').checked = false;
219
    document.getElementById('conditional_regex').checked = false;
220
220
221
	document.getElementById('modaction_legend').innerhtml = window.modaction_legend_innerhtml;
221
    document.getElementById('modaction_legend').innerhtml = window.modaction_legend_innerhtml;
222
	document.getElementById('action_submit').value = window.action_submit_value;
222
    document.getElementById('action_submit').value = window.action_submit_value;
223
223
224
	hide('cancel_edit');
224
    hide('cancel_edit');
225
}
225
}
226
226
227
function setSelectByValue( selectId, value ) {
227
function setSelectByValue( selectId, value ) {
228
	s = document.getElementById( selectId );
228
    s = document.getElementById( selectId );
229
229
230
	for ( i = 0; i < s.options.length; i++ ) {
230
    for ( i = 0; i < s.options.length; i++ ) {
231
		if ( s.options[i].value == value ) {
231
        if ( s.options[i].value == value ) {
232
			s.selectedIndex = i;
232
            s.selectedIndex = i;
233
		}
233
        }
234
	}
234
    }
235
}
235
}
236
236
237
</script>
237
</script>
Lines 245-496 function setSelectByValue( selectId, value ) { Link Here
245
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; MARC modification templates</div>
245
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; MARC modification templates</div>
246
246
247
<div id="doc3" class="yui-t2">
247
<div id="doc3" class="yui-t2">
248
	<div id="yui-main">
248
    <div id="yui-main">
249
		<div class="yui-b">
249
        <div class="yui-b">
250
			<h2>MARC modification templates</h2>
250
            <h2>MARC modification templates</h2>
251
251
252
			[% IF ( TemplatesLoop ) %]
252
            [% IF ( TemplatesLoop ) %]
253
253
254
				<form method="get" action="/cgi-bin/koha/tools/marc_modification_templates.pl" id="select_template">
254
                <form method="get" action="/cgi-bin/koha/tools/marc_modification_templates.pl" id="select_template">
255
					<label for="select_template">Template: </label>
255
                    <label for="select_template">Template: </label>
256
					<select name="template_id" id="select_template" style="width:20em;">
256
                    <select name="template_id" id="select_template" style="width:20em;">
257
						[% FOREACH TemplatesLoo IN TemplatesLoop %]
257
                        [% FOREACH TemplatesLoo IN TemplatesLoop %]
258
                                                    [% IF ( TemplatesLoo.selected ) %]
258
                                                    [% IF ( TemplatesLoo.selected ) %]
259
							<option value="[% TemplatesLoo.template_id %]" selected="selected"> [% TemplatesLoo.name %]</option>
259
                            <option value="[% TemplatesLoo.template_id %]" selected="selected"> [% TemplatesLoo.name %]</option>
260
                                                    [% ELSE %]
260
                                                    [% ELSE %]
261
							<option value="[% TemplatesLoo.template_id %]"> [% TemplatesLoo.name %]</option>
261
                            <option value="[% TemplatesLoo.template_id %]"> [% TemplatesLoo.name %]</option>
262
                                                    [% END %]
262
                                                    [% END %]
263
						[% END %]
263
                        [% END %]
264
					</select>
264
                    </select>
265
					<input type="hidden" name="op" value="select_template">
265
                    <input type="hidden" name="op" value="select_template">
266
					<input type="submit" value="Go" />
266
                    <input type="submit" value="Go" />
267
				</form>
267
                </form>
268
268
269
				<form method="get" action="/cgi-bin/koha/tools/marc_modification_templates.pl" id="delete_template">
269
                <form method="get" action="/cgi-bin/koha/tools/marc_modification_templates.pl" id="delete_template">
270
					<input type="hidden" name="template_id" value="[% template_id %]" />
270
                    <input type="hidden" name="template_id" value="[% template_id %]" />
271
					<input type="hidden" name="op" value="delete_template">
271
                    <input type="hidden" name="op" value="delete_template">
272
					<input type="submit" value="Delete template" onClick="return confirmDelete()" />
272
                    <input type="submit" value="Delete template" onClick="return confirmDelete()" />
273
				</form>
273
                </form>
274
274
275
275
276
				[% IF ( ActionsLoop ) %]
276
                [% IF ( ActionsLoop ) %]
277
					<table>
277
                    <table>
278
						<caption>Actions for this template</caption>
278
                        <caption>Actions for this template</caption>
279
279
280
						<tr>
280
                        <tr>
281
							<th>Change Order</th>
281
                            <th>Change Order</th>
282
							<th>Order</th>
282
                            <th>Order</th>
283
							<th>Action</th>
283
                            <th>Action</th>
284
							<th>Description</th>
284
                            <th>Description</th>
285
							<th>&nbsp</th>
285
                            <th>&nbsp</th>
286
							<th>&nbsp</th>
286
                            <th>&nbsp</th>
287
						</tr>
287
                        </tr>
288
288
289
						[% FOREACH ActionsLoo IN ActionsLoop %]
289
                        [% FOREACH ActionsLoo IN ActionsLoop %]
290
							<tr>
290
                            <tr>
291
        <td style="white-space:nowrap;">
291
                                <td style="white-space:nowrap;">
292
	        <a title="Move Action Up" href="marc_modification_templates.pl?op=move_action&amp;where=up&amp;template_id=[% ActionsLoo.template_id %]&amp;mmta_id=[% ActionsLoo.mmta_id %]">
292
                                    <a title="Move Action Up" href="marc_modification_templates.pl?op=move_action&amp;where=up&amp;template_id=[% ActionsLoo.template_id %]&amp;mmta_id=[% ActionsLoo.mmta_id %]">
293
			<img src="/intranet-tmpl/[% theme %]/img/go-up.png" border="0" alt="Go up" />
293
                                    <img src="/intranet-tmpl/[% theme %]/img/go-up.png" border="0" alt="Go up" />
294
                </a>
294
                                        </a>
295
295
296
		<a title="Move Action To Top" href="marc_modification_templates.pl?op=move_action&amp;where=top&amp;template_id=[% ActionsLoo.template_id %]&amp;mmta_id=[% ActionsLoo.mmta_id %]">
296
                                <a title="Move Action To Top" href="marc_modification_templates.pl?op=move_action&amp;where=top&amp;template_id=[% ActionsLoo.template_id %]&amp;mmta_id=[% ActionsLoo.mmta_id %]">
297
			<img src="/intranet-tmpl/[% theme %]/img/go-top.png" border="0" alt="Go top" />
297
                                    <img src="/intranet-tmpl/[% theme %]/img/go-top.png" border="0" alt="Go top" />
298
                </a>
298
                                        </a>
299
299
300
                <a title="Move Action To Bottom" href="marc_modification_templates.pl?op=move_action&amp;where=bottom&amp;template_id=[% ActionsLoo.template_id %]&amp;mmta_id=[% ActionsLoo.mmta_id %]">
300
                                        <a title="Move Action To Bottom" href="marc_modification_templates.pl?op=move_action&amp;where=bottom&amp;template_id=[% ActionsLoo.template_id %]&amp;mmta_id=[% ActionsLoo.mmta_id %]">
301
			<img src="/intranet-tmpl/[% theme %]/img/go-bottom.png" border="0" alt="Go bottom" />
301
                                    <img src="/intranet-tmpl/[% theme %]/img/go-bottom.png" border="0" alt="Go bottom" />
302
                </a>
302
                                        </a>
303
303
304
                <a title="Move Action Down" href="marc_modification_templates.pl?op=move_action&amp;where=down&amp;template_id=[% ActionsLoo.template_id %]&amp;mmta_id=[% ActionsLoo.mmta_id %]">
304
                                        <a title="Move Action Down" href="marc_modification_templates.pl?op=move_action&amp;where=down&amp;template_id=[% ActionsLoo.template_id %]&amp;mmta_id=[% ActionsLoo.mmta_id %]">
305
			<img src="/intranet-tmpl/[% theme %]/img/go-down.png" border="0" alt="Go down" />
305
                                    <img src="/intranet-tmpl/[% theme %]/img/go-down.png" border="0" alt="Go down" />
306
                </a>
306
                                        </a>
307
        </td>
307
                                </td>
308
308
309
								<td>[% ActionsLoo.ordering %]</td>
309
                                <td>[% ActionsLoo.ordering %]</td>
310
								<td>
310
                                <td>
311
									[% IF ( ActionsLoo.action_delete_field ) %] Delete [% END %]
311
                                    [% IF ( ActionsLoo.action_delete_field ) %] Delete [% END %]
312
									[% IF ( ActionsLoo.action_update_field ) %] Update [% END %]
312
                                    [% IF ( ActionsLoo.action_update_field ) %] Update [% END %]
313
									[% IF ( ActionsLoo.action_move_field ) %] Move [% END %]
313
                                    [% IF ( ActionsLoo.action_move_field ) %] Move [% END %]
314
									[% IF ( ActionsLoo.action_copy_field ) %] Copy [% END %]
314
                                    [% IF ( ActionsLoo.action_copy_field ) %] Copy [% END %]
315
315
316
									[% UNLESS ( ActionsLoo.action_update_field ) %]
316
                                    [% UNLESS ( ActionsLoo.action_update_field ) %]
317
										[% IF ( ActionsLoo.field_number ) %]
317
                                        [% IF ( ActionsLoo.field_number ) %]
318
											1st
318
                                            1st
319
										[% END %]
319
                                        [% END %]
320
									[% END %]
320
                                    [% END %]
321
321
322
									field
322
                                    field
323
323
324
									[% ActionsLoo.from_field %][% IF ( ActionsLoo.from_subfield ) %]$[% ActionsLoo.from_subfield %][% END %]
324
                                    [% ActionsLoo.from_field %][% IF ( ActionsLoo.from_subfield ) %]$[% ActionsLoo.from_subfield %][% END %]
325
325
326
									[% IF ( ActionsLoo.field_value ) %]
326
                                    [% IF ( ActionsLoo.field_value ) %]
327
										with value <i>[% ActionsLoo.field_value %]</i>
327
                                        with value <i>[% ActionsLoo.field_value %]</i>
328
									[% END %]
328
                                    [% END %]
329
329
330
									[% IF ( ActionsLoo.to_field ) %]
330
                                    [% IF ( ActionsLoo.to_field ) %]
331
										to [% ActionsLoo.to_field %][% IF ( ActionsLoo.to_subfield ) %]$[% ActionsLoo.to_subfield %][% END %]
331
                                        to [% ActionsLoo.to_field %][% IF ( ActionsLoo.to_subfield ) %]$[% ActionsLoo.to_subfield %][% END %]
332
332
333
										[% IF ( ActionsLoo.to_regex ) %]
333
                                        [% IF ( ActionsLoo.to_regex ) %]
334
											 using RegEx s<strong>[% ActionsLoo.to_regex %]</strong>
334
                                             using RegEx s<strong>[% ActionsLoo.to_regex %]</strong>
335
										[% END %]
335
                                        [% END %]
336
									[% END %]
336
                                    [% END %]
337
337
338
									[% IF ( ActionsLoo.conditional ) %]
338
                                    [% IF ( ActionsLoo.conditional ) %]
339
										[% IF ( ActionsLoo.conditional_if ) %] if [% END %]
339
                                        [% IF ( ActionsLoo.conditional_if ) %] if [% END %]
340
										[% IF ( ActionsLoo.conditional_unless ) %] unless [% END %]
340
                                        [% IF ( ActionsLoo.conditional_unless ) %] unless [% END %]
341
341
342
										[% ActionsLoo.conditional_field %][% IF ( ActionsLoo.conditional_subfield ) %]$[% ActionsLoo.conditional_subfield %][% END %]
342
                                        [% ActionsLoo.conditional_field %][% IF ( ActionsLoo.conditional_subfield ) %]$[% ActionsLoo.conditional_subfield %][% END %]
343
343
344
										[% IF ( ActionsLoo.conditional_comparison_exists ) %] exists [% END %]
344
                                        [% IF ( ActionsLoo.conditional_comparison_exists ) %] exists [% END %]
345
										[% IF ( ActionsLoo.conditional_comparison_not_exists ) %] does not exist [% END %]
345
                                        [% IF ( ActionsLoo.conditional_comparison_not_exists ) %] does not exist [% END %]
346
										[% IF ( ActionsLoo.conditional_comparison_equals ) %] matches [% END %]
346
                                        [% IF ( ActionsLoo.conditional_comparison_equals ) %] matches [% END %]
347
										[% IF ( ActionsLoo.conditional_comparison_not_equals ) %] does not match [% END %]
347
                                        [% IF ( ActionsLoo.conditional_comparison_not_equals ) %] does not match [% END %]
348
348
349
										[% IF ( ActionsLoo.conditional_regex ) %] RegEx m[% END %]<strong>[% ActionsLoo.conditional_value %]</strong>
349
                                        [% IF ( ActionsLoo.conditional_regex ) %] RegEx m[% END %]<strong>[% ActionsLoo.conditional_value %]</strong>
350
									[% END %]
350
                                    [% END %]
351
								</td>
351
                                </td>
352
								<td>[% ActionsLoo.description %]</td>
352
                                <td>[% ActionsLoo.description %]</td>
353
								<td><a href="#modaction" onclick='editAction(
353
                                <td><a href="#modaction" onclick='editAction(
354
													"[% ActionsLoo.mmta_id |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]",
354
                                                    "[% ActionsLoo.mmta_id |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]",
355
													"[% ActionsLoo.ordering |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]",
355
                                                    "[% ActionsLoo.ordering |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]",
356
													"[% ActionsLoo.action |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]",
356
                                                    "[% ActionsLoo.action |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]",
357
													"[% ActionsLoo.field_number |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]",
357
                                                    "[% ActionsLoo.field_number |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]",
358
													"[% ActionsLoo.from_field |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]",
358
                                                    "[% ActionsLoo.from_field |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]",
359
													"[% ActionsLoo.from_subfield |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]",
359
                                                    "[% ActionsLoo.from_subfield |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]",
360
													"[% ActionsLoo.field_value |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]",
360
                                                    "[% ActionsLoo.field_value |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]",
361
													"[% ActionsLoo.to_field |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]",
361
                                                    "[% ActionsLoo.to_field |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]",
362
													"[% ActionsLoo.to_subfield |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]",
362
                                                    "[% ActionsLoo.to_subfield |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]",
363
													"[% ActionsLoo.to_regex |replace('\\\\', '\\\\') |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]",
363
                                                    "[% ActionsLoo.to_regex |replace('\\\\', '\\\\') |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]",
364
													"[% ActionsLoo.conditional |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]",
364
                                                    "[% ActionsLoo.conditional |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]",
365
													"[% ActionsLoo.conditional_field |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]",
365
                                                    "[% ActionsLoo.conditional_field |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]",
366
													"[% ActionsLoo.conditional_subfield |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]",
366
                                                    "[% ActionsLoo.conditional_subfield |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]",
367
													"[% ActionsLoo.conditional_comparison |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]",
367
                                                    "[% ActionsLoo.conditional_comparison |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]",
368
													"[% ActionsLoo.conditional_value |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]",
368
                                                    "[% ActionsLoo.conditional_value |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]",
369
													"[% ActionsLoo.conditional_regex |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]",
369
                                                    "[% ActionsLoo.conditional_regex |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]",
370
													"[% ActionsLoo.description |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]"
370
                                                    "[% ActionsLoo.description |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]"
371
												)'>Edit</a></td>
371
                                                )'>Edit</a></td>
372
								<td><a href="marc_modification_templates.pl?template_id=[% ActionsLoo.template_id %]&op=delete_action&mmta_id=[% ActionsLoo.mmta_id %]">Delete</a></td>
372
                                <td><a href="marc_modification_templates.pl?template_id=[% ActionsLoo.template_id %]&op=delete_action&mmta_id=[% ActionsLoo.mmta_id %]">Delete</a></td>
373
							</tr>
373
                            </tr>
374
						[% END %]
374
                        [% END %]
375
					</table>
375
                    </table>
376
				[% ELSE %]
376
                [% ELSE %]
377
					<div class="dialog message"><p>There are no defined actions for this template.</p></div>
377
                    <div class="dialog message"><p>There are no defined actions for this template.</p></div>
378
				[% END %]
378
                [% END %]
379
379
380
				<form method="post" action="/cgi-bin/koha/tools/marc_modification_templates.pl" id="add_action" >
380
                <form method="post" action="/cgi-bin/koha/tools/marc_modification_templates.pl" id="add_action" >
381
					<a name="modaction"></a>
381
                    <a name="modaction"></a>
382
					<fieldset>
382
                    <fieldset>
383
						<legend id="modaction_legend">Add A New Action</legend>
383
                        <legend id="modaction_legend">Add A New Action</legend>
384
384
385
						<select name="action" id="action" onchange="onActionChange(this);">
385
                        <select name="action" id="action" onchange="onActionChange(this);">
386
							<option value="delete_field">Delete</option>
386
                            <option value="delete_field">Delete</option>
387
							<option value="update_field">Add/Update</option>
387
                            <option value="update_field">Add/Update</option>
388
							<option value="move_field">Move</option>
388
                            <option value="move_field">Move</option>
389
							<option value="copy_field">Copy</option>
389
                            <option value="copy_field">Copy</option>
390
						</select>
390
                        </select>
391
391
392
						<span id="field_number_block">
392
                        <span id="field_number_block">
393
							<select name="field_number" id="field_number">
393
                            <select name="field_number" id="field_number">
394
								<option value="0">All</option>
394
                                <option value="0">All</option>
395
								<option value="1">1st</option>
395
                                <option value="1">1st</option>
396
							</select>
396
                            </select>
397
						</span>
397
                        </span>
398
398
399
						field(s) <input type="text" name="from_field" id="from_field" size="3" maxlength="3" /> <input type="text" name="from_subfield" id="from_subfield" size="1" maxlength="1" />
399
                        field(s) <input type="text" name="from_field" id="from_field" size="3" maxlength="3" /> <input type="text" name="from_subfield" id="from_subfield" size="1" maxlength="1" />
400
400
401
						<span name="with_value_block" id="with_value_block" style="display:none;">
401
                        <span name="with_value_block" id="with_value_block" style="display:none;">
402
							with value <input type="text" name="field_value" id="field_value" />
402
                            with value <input type="text" name="field_value" id="field_value" />
403
						</span>
403
                        </span>
404
404
405
						<span name="to_field_block" id="to_field_block" style="display:none;">
405
                        <span name="to_field_block" id="to_field_block" style="display:none;">
406
							to field <input type="text" name="to_field" id="to_field" size="3" maxlength="3" /> <input type="text" name="to_subfield" id="to_subfield" size="1" maxlength="1" />
406
                            to field <input type="text" name="to_field" id="to_field" size="3" maxlength="3" /> <input type="text" name="to_subfield" id="to_subfield" size="1" maxlength="1" />
407
407
408
							<span name="to_field_regex_block" id="to_field_regex_block">
408
                            <span name="to_field_regex_block" id="to_field_regex_block">
409
								<sup>
409
                                <sup>
410
									<label for="to_field_regex">RegEx</label>
410
                                    <label for="to_field_regex">RegEx</label>
411
									<input type="checkbox" name="to_field_regex" id="to_field_regex" onchange="onToFieldRegexChange(this);" />
411
                                    <input type="checkbox" name="to_field_regex" id="to_field_regex" onchange="onToFieldRegexChange(this);" />
412
412
413
									<span name="to_field_regex_value_block" id="to_field_regex_value_block" style="display:none;">
413
                                    <span name="to_field_regex_value_block" id="to_field_regex_value_block" style="display:none;">
414
										s<input type="text" name="to_regex" id="to_regex" />
414
                                        s<input type="text" name="to_regex" id="to_regex" />
415
									</span>
415
                                    </span>
416
								</sup>
416
                                </sup>
417
							</span>
417
                            </span>
418
						</span>
418
                        </span>
419
419
420
						<p/>
420
                        <p/>
421
421
422
						<select name="conditional" id="conditional" onchange="onConditionalChange(this);">
422
                        <select name="conditional" id="conditional" onchange="onConditionalChange(this);">
423
							<option value="" selected />
423
                            <option value="" selected />
424
							<option value="if">if</option>
424
                            <option value="if">if</option>
425
							<option value="unless">unless</option>
425
                            <option value="unless">unless</option>
426
						</select>
426
                        </select>
427
427
428
						<span name="conditional_block" id="conditional_block" style="display:none;">
428
                        <span name="conditional_block" id="conditional_block" style="display:none;">
429
							field <input type="text" name="conditional_field" id="conditional_field" size="3" maxlength="3" /> <input type="text" name="conditional_subfield" id="conditional_subfield" size="1" maxlength="1" />
429
                            field <input type="text" name="conditional_field" id="conditional_field" size="3" maxlength="3" /> <input type="text" name="conditional_subfield" id="conditional_subfield" size="1" maxlength="1" />
430
430
431
							<select name="conditional_comparison" id="conditional_comparison" onchange="onConditionalComparisonChange(this);">
431
                            <select name="conditional_comparison" id="conditional_comparison" onchange="onConditionalComparisonChange(this);">
432
								<option value="" />
432
                                <option value="" />
433
								<option value="exists">exists</option>
433
                                <option value="exists">exists</option>
434
								<option value="not_exists">doesn't exist</option>
434
                                <option value="not_exists">doesn't exist</option>
435
								<option value="equals">matches</option>
435
                                <option value="equals">matches</option>
436
								<option value="not_equals">doesn't match</option>
436
                                <option value="not_equals">doesn't match</option>
437
							</select>
437
                            </select>
438
438
439
							<span name="conditional_comparison_block" id="conditional_comparison_block" style="display:none;">
439
                            <span name="conditional_comparison_block" id="conditional_comparison_block" style="display:none;">
440
440
441
								<span id="match_regex_prefix" style="visibility:hidden;">m</span><input type="text" id="conditional_value" name="conditional_value" />
441
                                <span id="match_regex_prefix" style="visibility:hidden;">m</span><input type="text" id="conditional_value" name="conditional_value" />
442
442
443
								<sup>
443
                                <sup>
444
									<label for="conditional_regex">RegEx</label>
444
                                    <label for="conditional_regex">RegEx</label>
445
									<input type="checkbox" name="conditional_regex" id="conditional_regex" onchange="onConditionalRegexChange(this);" />
445
                                    <input type="checkbox" name="conditional_regex" id="conditional_regex" onchange="onConditionalRegexChange(this);" />
446
								</sup>
446
                                </sup>
447
447
448
							</span>
448
                            </span>
449
						</span>
449
                        </span>
450
450
451
						<input type="hidden" name="template_id" value="[% template_id %]" />
451
                        <input type="hidden" name="template_id" value="[% template_id %]" />
452
						<input type="hidden" name="mmta_id" id="mmta_id" />
452
                        <input type="hidden" name="mmta_id" id="mmta_id" />
453
						<input type="hidden" name="op" value="add_action" />
453
                        <input type="hidden" name="op" value="add_action" />
454
454
455
						<br/><br/>
455
                        <br/><br/>
456
						<label for="description">Description:</label>
456
                        <label for="description">Description:</label>
457
						<input type="text" name="description" id="description" size="60" />
457
                        <input type="text" name="description" id="description" size="60" />
458
458
459
						<br/><br/>
459
                        <br/><br/>
460
						<input id="action_submit" type="submit" value="Add Action" /> <a href="#modaction" id="cancel_edit" onclick="cancelEditAction();" style="display:none;">Cancel</a>
460
                        <input id="action_submit" type="submit" value="Add Action" /> <a href="#modaction" id="cancel_edit" onclick="cancelEditAction();" style="display:none;">Cancel</a>
461
461
462
					</fieldset>
462
                    </fieldset>
463
				</form>
463
                </form>
464
464
465
			[% ELSE %]
465
            [% ELSE %]
466
				<div class="dialog message"><p>There are no defined templates. Please create a template first.</p></div>
466
                <div class="dialog message"><p>There are no defined templates. Please create a template first.</p></div>
467
			[% END %]
467
            [% END %]
468
468
469
			<form method="post" action="/cgi-bin/koha/tools/marc_modification_templates.pl" id="add_template" >
469
            <form method="post" action="/cgi-bin/koha/tools/marc_modification_templates.pl" id="add_template" >
470
				<fieldset>
470
                <fieldset>
471
					<legend>Create a new template</legend>
471
                    <legend>Create a new template</legend>
472
472
473
					<label for="template_name">Name: </label>
473
                    <label for="template_name">Name: </label>
474
					<input name="template_name" id="template_name" type="text" size="30" />
474
                    <input name="template_name" id="template_name" type="text" size="30" />
475
475
476
					<input type="hidden" name="op" value="create_template" />
476
                    <input type="hidden" name="op" value="create_template" />
477
					<input type="submit" value="Create template" />
477
                    <input type="submit" value="Create template" />
478
478
479
					[% IF ( template_id ) %]
479
                    [% IF ( template_id ) %]
480
						<input type="hidden" name="template_id" value="[% template_id %]" />
480
                        <input type="hidden" name="template_id" value="[% template_id %]" />
481
						<input type="checkbox" name="duplicate_current_template" id="duplicate_current_template" />
481
                        <input type="checkbox" name="duplicate_current_template" id="duplicate_current_template" />
482
						<label for="duplicate_current_template">Duplicate current template</label>
482
                        <label for="duplicate_current_template">Duplicate current template</label>
483
					[% END %]
483
                    [% END %]
484
				</fieldset>
484
                </fieldset>
485
			</form>
485
            </form>
486
486
        </div>
487
487
    </div>
488
488
489
		</div>
489
    <div class="yui-b">
490
	</div>
490
        [% INCLUDE 'tools-menu.inc' %]
491
491
    </div>
492
	<div class="yui-b">
493
		[% INCLUDE 'tools-menu.inc' %]
494
	</div>
495
</div>
492
</div>
496
[% INCLUDE 'intranet-bottom.inc' %]
493
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/tools/marc_modification_templates.pl (-8 / +8 lines)
Lines 32-44 my $op = $cgi->param('op'); Link Here
32
my $template_id = $cgi->param('template_id');
32
my $template_id = $cgi->param('template_id');
33
33
34
my ($template, $loggedinuser, $cookie)
34
my ($template, $loggedinuser, $cookie)
35
    = get_template_and_user({template_name => "tools/marc_modification_templates.tmpl",
35
    = get_template_and_user({
36
			     query => $cgi,
36
            template_name => "tools/marc_modification_templates.tmpl",
37
			     type => "intranet",
37
            query => $cgi,
38
			     authnotrequired => 0,
38
            type => "intranet",
39
			     flagsrequired => { tools => 'marc_modfication_templates' },
39
            authnotrequired => 0,
40
			     debug => 1,
40
            flagsrequired => { tools => 'marc_modfication_templates' },
41
			     });
41
            debug => 1,
42
    });
42
43
43
if ( $op eq "create_template" ) {
44
if ( $op eq "create_template" ) {
44
  $template_id = '' unless $cgi->param('duplicate_current_template');
45
  $template_id = '' unless $cgi->param('duplicate_current_template');
45
- 

Return to bug 8015