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

(-)a/admin/matching-rules.pl (-1 / +1 lines)
Lines 126-132 sub add_update_matching_rule { Link Here
126
126
127
    # match checks
127
    # match checks
128
    my @mc_nums = sort map { /^mc_(\d+)_id/ ? int($1): () } $input->param;
128
    my @mc_nums = sort map { /^mc_(\d+)_id/ ? int($1): () } $input->param;
129
    foreach my $mc_num (@mp_nums) {
129
    foreach my $mc_num (@mc_nums) {
130
        # source components
130
        # source components
131
        my $src_components = [];
131
        my $src_components = [];
132
        my @src_comp_nums = sort map { /^mc_${mc_num}_src_c_(\d+)_tag/ ? int($1): () } $input->param;
132
        my @src_comp_nums = sort map { /^mc_${mc_num}_src_c_(\d+)_tag/ ? int($1): () } $input->param;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/matching-rules.tt (-50 / +49 lines)
Lines 250-291 function CheckRuleForm(f) { Link Here
250
      </li>
250
      </li>
251
      </ol>
251
      </ol>
252
      [% FOREACH component IN matchpoint.components %]
252
      [% FOREACH component IN matchpoint.components %]
253
      <fieldset class="rows" id="mp_[% component.mp_num %]_c_[% component.comp_num %]">
253
      <fieldset class="rows" id="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]">
254
      <legend>Matchpoint components</legend>
254
      <legend>Matchpoint components</legend>
255
        <ol>
255
        <ol>
256
          <li>
256
          <li>
257
            <label for="mp_[% component.mp_num %]_c_[% component.comp_num %]_tag">Tag: </label>
257
            <label for="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_tag">Tag: </label>
258
            <input type="text" id="mp_[% component.mp_num %]_c_[% component.comp_num %]_tag" 
258
            <input type="text" id="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_tag" 
259
                   name="mp_[% component.mp_num %]_c_[% component.comp_num %]_tag" 
259
                   name="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_tag" 
260
                   value="[% component.tag |html %]"
260
                   value="[% component.tag |html %]"
261
                   size="3" maxlength="3" />
261
                   size="3" maxlength="3" />
262
          </li>
262
          </li>
263
          <li>
263
          <li>
264
            <label for="mp_[% component.mp_num %]_c_[% component.comp_num %]_subfields">Subfields: </label>
264
            <label for="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_subfields">Subfields: </label>
265
            <input type="text" id="mp_[% component.mp_num %]_c_[% component.comp_num %]_subfields" 
265
            <input type="text" id="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_subfields" 
266
                   name="mp_[% component.mp_num %]_c_[% component.comp_num %]_subfields" 
266
                   name="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_subfields" 
267
                   value="[% component.subfields |html %]"
267
                   value="[% component.subfields |html %]"
268
                   size="10" maxlength="40" />
268
                   size="10" maxlength="40" />
269
          </li>
269
          </li>
270
          <li>
270
          <li>
271
            <label for="mp_[% component.mp_num %]_c_[% component.comp_num %]_offset">Offset: </label>
271
            <label for="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_offset">Offset: </label>
272
            <input type="text" id="mp_[% component.mp_num %]_c_[% component.comp_num %]_offset" 
272
            <input type="text" id="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_offset" 
273
                   name="mp_[% component.mp_num %]_c_[% component.comp_num %]_offset" 
273
                   name="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_offset" 
274
                   value="[% component.offset |html %]"
274
                   value="[% component.offset |html %]"
275
                   size="5" maxlength="5" />
275
                   size="5" maxlength="5" />
276
          </li>
276
          </li>
277
          <li>
277
          <li>
278
            <label for="mp_[% component.mp_num %]_c_[% component.comp_num %]_length">Length: </label>
278
            <label for="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_length">Length: </label>
279
            <input type="text" id="mp_[% component.mp_num %]_c_[% component.comp_num %]_length" 
279
            <input type="text" id="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_length" 
280
                   name="mp_[% component.mp_num %]_c_[% component.comp_num %]_length" 
280
                   name="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_length" 
281
                   value="[% component.length |html %]"
281
                   value="[% component.length |html %]"
282
                   size="5" maxlength="5" />
282
                   size="5" maxlength="5" />
283
          </li>
283
          </li>
284
              [% FOREACH norm IN component.norms %]
284
              [% FOREACH norm IN component.norms %]
285
              <li id="mp_[% norm.mp_num %]_c_[% norm.comp_num %]_n_[% norm.norm_num %]">
285
              <li id="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_n_[% norm.norm_num %]">
286
                <label for="mp_[% norm.mp_num %]_c_[% norm.comp_num %]_n__[% norm.norm_num %]_norm">Normalization rule: </label>
286
                <label for="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_n__[% norm.norm_num %]_norm">Normalization rule: </label>
287
                <input type="text" id="mp_[% norm.mp_num %]_c_[% norm.comp_num %]_n__[% norm.norm_num %]_norm" 
287
                <input type="text" id="mp_[% norm.mp_num %]_c_[% component.comp_num %]_n__[% norm.norm_num %]_norm" 
288
                       name="mp_[% norm.mp_num %]_c_[% norm.comp_num %]_n_[% norm.norm_num %]_norm" 
288
                       name="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_n_[% norm.norm_num %]_norm" 
289
                       value="[% norm.norm |html %]"
289
                       value="[% norm.norm |html %]"
290
                       size="20" maxlength="50" />
290
                       size="20" maxlength="50" />
291
              </li>
291
              </li>
Lines 362-398 function CheckRuleForm(f) { Link Here
362
        <ol>
362
        <ol>
363
          <li>
363
          <li>
364
            <label for="mc_[% src_component.mc_num %]_src_c_[% src_component.comp_num %]_tag">Tag: </label>
364
            <label for="mc_[% src_component.mc_num %]_src_c_[% src_component.comp_num %]_tag">Tag: </label>
365
            <input type="text" id="mc_[% src_component.mc_num %]_src_c_[% src_component.comp_num %]_tag" 
365
            <input type="text" id="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_tag" 
366
                   name="mc_[% src_component.mc_num %]_src_c_[% src_component.comp_num %]_tag" 
366
                   name="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_tag" 
367
                   value="[% src_component.tag |html %]"
367
                   value="[% src_component.tag |html %]"
368
                   size="3" maxlength="3" />
368
                   size="3" maxlength="3" />
369
          </li>
369
          </li>
370
          <li>
370
          <li>
371
            <label for="mc_[% src_component.mc_num %]_src_c_[% src_component.comp_num %]_subfields">Subfields: </label>
371
            <label for="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_subfields">Subfields: </label>
372
            <input type="text" id="mc_[% src_component.mc_num %]_src_c_[% src_component.comp_num %]_subfields" 
372
            <input type="text" id="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_subfields" 
373
                   name="mc_[% src_component.mc_num %]_src_c_[% src_component.comp_num %]_subfields" 
373
                   name="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_subfields" 
374
                   value="[% src_component.subfields |html %]"
374
                   value="[% src_component.subfields |html %]"
375
                   size="10" maxlength="40" />
375
                   size="10" maxlength="40" />
376
          </li>
376
          </li>
377
          <li>
377
          <li>
378
            <label for="mc_[% src_component.mc_num %]_src_c_[% src_component.comp_num %]_offset">Offset: </label>
378
            <label for="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_offset">Offset: </label>
379
            <input type="text" id="mc_[% src_component.mc_num %]_src_c_[% src_component.comp_num %]_offset" 
379
            <input type="text" id="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_offset" 
380
                   name="mc_[% src_component.mc_num %]_src_c_[% src_component.comp_num %]_offset" 
380
                   name="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_offset" 
381
                   value="[% src_component.offset |html %]"
381
                   value="[% src_component.offset |html %]"
382
                   size="5" maxlength="5" />
382
                   size="5" maxlength="5" />
383
          </li>
383
          </li>
384
          <li>
384
          <li>
385
            <label for="mc_[% src_component.mc_num %]_src_c_[% src_component.comp_num %]_length">Length: </label>
385
            <label for="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_length">Length: </label>
386
            <input type="text" id="mc_[% src_component.mc_num %]_src_c_[% src_component.comp_num %]_length" 
386
            <input type="text" id="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_length" 
387
                   name="mc_[% src_component.mc_num %]_src_c_[% src_component.comp_num %]_length" 
387
                   name="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_length" 
388
                   value="[% src_component.length |html %]"
388
                   value="[% src_component.length |html %]"
389
                   size="5" maxlength="5" />
389
                   size="5" maxlength="5" />
390
          </li>
390
          </li>
391
          [% FOREACH norm IN src_component.norms %]
391
          [% FOREACH norm IN src_component.norms %]
392
            <li id="mc_[% norm.mc_num %]_src_c_[% norm.comp_num %]_n_[% norm.norm_num %]">
392
            <li id="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_n_[% norm.norm_num %]">
393
              <label for="mc_[% norm.mc_num %]_src_c_[% norm.comp_num %]_n_[% norm.norm_num %]_norm">Normalization rule: </label>
393
              <label for="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_n_[% norm.norm_num %]_norm">Normalization rule: </label>
394
              <input type="text" id="mc_[% norm.mc_num %]_src_c_[% norm.comp_num %]_n_[% norm.norm_num %]_norm" 
394
              <input type="text" id="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_n_[% norm.norm_num %]_norm" 
395
                     name="mc_[% norm.mc_num %]_src_c_[% norm.comp_num %]_n_[% norm.norm_num %]_norm" 
395
                     name="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_n_[% norm.norm_num %]_norm" 
396
                    value="[% norm.norm |html %]"
396
                    value="[% norm.norm |html %]"
397
                    size="20" maxlength="50" />
397
                    size="20" maxlength="50" />
398
            </li>
398
            </li>
Lines 401-442 function CheckRuleForm(f) { Link Here
401
      </fieldset>
401
      </fieldset>
402
      [% END %]
402
      [% END %]
403
      [% FOREACH tgt_component IN matchcheck.tgt_components %]
403
      [% FOREACH tgt_component IN matchcheck.tgt_components %]
404
      <fieldset class="rows" id="mc_[% tgt_component.mc_num %]_tgt_c_[% tgt_component.comp_num %]">
404
      <fieldset class="rows" id="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]">
405
        <legend>Target (database) record check field</legend>
405
        <legend>Target (database) record check field</legend>
406
        <ol>
406
        <ol>
407
          <li>
407
          <li>
408
            <label for="mc_[% tgt_component.mc_num %]_tgt_c_[% tgt_component.comp_num %]_tag">Tag: </label>
408
            <label for="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_tag">Tag: </label>
409
            <input type="text" id="mc_[% tgt_component.mc_num %]_tgt_c_[% tgt_component.comp_num %]_tag" 
409
            <input type="text" id="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_tag" 
410
                   name="mc_[% tgt_component.mc_num %]_tgt_c_[% tgt_component.comp_num %]_tag" 
410
                   name="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_tag" 
411
                   value="[% tgt_component.tag |html %]"
411
                   value="[% tgt_component.tag |html %]"
412
                   size="3" maxlength="3" />
412
                   size="3" maxlength="3" />
413
          </li>
413
          </li>
414
          <li>
414
          <li>
415
            <label for="mc_[% tgt_component.mc_num %]_tgt_c_[% tgt_component.comp_num %]_subfields">Subfields: </label>
415
            <label for="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_subfields">Subfields: </label>
416
            <input type="text" id="mc_[% tgt_component.mc_num %]_tgt_c_[% tgt_component.comp_num %]_subfields" 
416
            <input type="text" id="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_subfields" 
417
                   name="mc_[% tgt_component.mc_num %]_tgt_c_[% tgt_component.comp_num %]_subfields" 
417
                   name="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_subfields" 
418
                   value="[% tgt_component.subfields |html %]"
418
                   value="[% tgt_component.subfields |html %]"
419
                   size="10" maxlength="40" />
419
                   size="10" maxlength="40" />
420
          </li>
420
          </li>
421
          <li>
421
          <li>
422
            <label for="mc_[% tgt_component.mc_num %]_tgt_c_[% tgt_component.comp_num %]_offset">Offset: </label>
422
            <label for="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_offset">Offset: </label>
423
            <input type="text" id="mc_[% tgt_component.mc_num %]_tgt_c_[% tgt_component.comp_num %]_offset" 
423
            <input type="text" id="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_offset" 
424
                   name="mc_[% tgt_component.mc_num %]_tgt_c_[% tgt_component.comp_num %]_offset" 
424
                   name="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_offset" 
425
                   value="[% tgt_component.offset |html %]"
425
                   value="[% tgt_component.offset |html %]"
426
                   size="5" maxlength="5" />
426
                   size="5" maxlength="5" />
427
          </li>
427
          </li>
428
          <li>
428
          <li>
429
            <label for="mc_[% tgt_component.mc_num %]_tgt_c_[% tgt_component.comp_num %]_length">Length: </label>
429
            <label for="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_length">Length: </label>
430
            <input type="text" id="mc_[% tgt_component.mc_num %]_tgt_c_[% tgt_component.comp_num %]_length" 
430
            <input type="text" id="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_length" 
431
                   name="mc_[% tgt_component.mc_num %]_tgt_c_[% tgt_component.comp_num %]_length" 
431
                   name="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_length" 
432
                   value="[% tgt_component.length |html %]"
432
                   value="[% tgt_component.length |html %]"
433
                   size="5" maxlength="5" />
433
                   size="5" maxlength="5" />
434
          </li>
434
          </li>
435
          [% FOREACH norm IN tgt_component.norms %]
435
          [% FOREACH norm IN tgt_component.norms %]
436
            <li id="mc_[% norm.mc_num %]_tgt_c_[% norm.comp_num %]_n_[% norm.norm_num %]">
436
            <li id="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_n_[% norm.norm_num %]">
437
              <label for="mc_[% norm.mc_num %]_tgt_c_[% norm.comp_num %]_n_[% norm.norm_num %]_norm">Normalization rule: </label>
437
              <label for="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_n_[% norm.norm_num %]_norm">Normalization rule: </label>
438
              <input type="text" id="mc_[% norm.mc_num %]_tgt_c_[% norm.comp_num %]_n_[% norm.norm_num %]_norm" 
438
              <input type="text" id="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_n_[% norm.norm_num %]_norm" 
439
                     name="mc_[% norm.mc_num %]_tgt_c_[% norm.comp_num %]_n_[% norm.norm_num %]_norm" 
439
                     name="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_n_[% norm.norm_num %]_norm" 
440
                    value="[% norm.norm |html %]"
440
                    value="[% norm.norm |html %]"
441
                    size="20" maxlength="50" />
441
                    size="20" maxlength="50" />
442
            </li>
442
            </li>
443
- 

Return to bug 6713