Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 5d125bb7

Von Tamino Steinert vor fast 2 Jahren hinzugefügt

Reclamation: multi_edit: zusammenfassen von js-Funktionen

Unterschiede anzeigen:

js/kivi.Reclamation.js
835 835
    ns.recalc_amounts_and_taxes();
836 836
  };
837 837

  
838
  ns.set_selected_to_reason = function() {
839
    let reason_id = $("#reason_for_selected").val();
838
  ns.set_selected_to_value = function(value_name) {
839
    let value = $('[name="' + value_name + '_for_selected"]').val();
840 840
    let selected_rows = ns.get_selected_rows();
841 841
    selected_rows.forEach(function(row) {
842
      $(row).find('[name="reclamation.reclamation_items[].reason_id"]').val(
843
        reason_id
844
      );
845
    });
846

  
847
  };
848

  
849
  ns.set_selected_to_reason_description_ext = function() {
850
    desc_ext_text = $("[name=reason_description_ext_for_selected]").val();
851
    let selected_rows = ns.get_selected_rows();
852
    selected_rows.forEach(function(row) {
853
      $(row).find('[name="reclamation.reclamation_items[].reason_description_ext"]').val(
854
        desc_ext_text
855
      );
856
    });
857
  };
858

  
859
  ns.set_selected_to_reason_description_int = function() {
860
    desc_int_text = $("[name=reason_description_int_for_selected]").val();
861
    let selected_rows = ns.get_selected_rows();
862
    selected_rows.forEach(function(row) {
863
      $(row).find('[name="reclamation.reclamation_items[].reason_description_int"]').val(
864
        desc_int_text
842
      $(row).find(
843
        '[name="reclamation.reclamation_items[].' + value_name  + '"]'
844
      ).val(
845
        value
865 846
      );
866 847
    });
867 848
  };
templates/design40_webpages/reclamation/tabs/basic_data.html
355 355
        [%- END -%]
356 356
        <th colspan="3"></th>
357 357
        <th>
358
          [% L.select_tag("reason_for_selected",
358
          [% L.select_tag("reason_id_for_selected",
359 359
                          SELF.reclamation.valid_reclamation_reasons,
360 360
                          title_key = 'name',
361 361
                          value_key = 'id',
362 362
                          with_empty=1,
363 363
                          class="wi-small",
364 364
                          ) %]
365
          [%- L.button_tag('kivi.Reclamation.set_selected_to_reason()', "↓",
366
                           alt=LxERP.t8('Apply to selected rows'),
367
                           title=LxERP.t8('Apply to selected rows'),
368
                           ) %]
365
          [%- L.button_tag(
366
                'kivi.Reclamation.set_selected_to_value("reason_id")',
367
                "↓",
368
                alt=LxERP.t8('Apply to selected rows'),
369
                title=LxERP.t8('Apply to selected rows'),
370
          ) %]
369 371
        </th>
370 372
        <th>
371 373
          [% L.areainput_tag("reason_description_ext_for_selected",
......
373 375
                             size='40',
374 376
                             class="wi-mediumsmall",
375 377
                             ) %]
376
          [%- L.button_tag('kivi.Reclamation.set_selected_to_reason_description_ext()', "↓",
377
                           alt=LxERP.t8('Apply to selected rows'),
378
                           title=LxERP.t8('Apply to selected rows'),
379
                           ) %]
378
          [%- L.button_tag(
379
                'kivi.Reclamation.set_selected_to_value("reason_description_ext")',
380
                "↓",
381
                alt=LxERP.t8('Apply to selected rows'),
382
                title=LxERP.t8('Apply to selected rows'),
383
          ) %]
380 384
        </th>
381 385
        <th>
382 386
          [% L.areainput_tag("reason_description_int_for_selected",
......
384 388
                             size='40',
385 389
                             class="wi-mediumsmall",
386 390
                             ) %]
387
          [%- L.button_tag('kivi.Reclamation.set_selected_to_reason_description_int()', "↓",
388
                           alt=LxERP.t8('Apply to selected rows'),
389
                           title=LxERP.t8('Apply to selected rows'),
390
                           ) %]
391
          [%- L.button_tag(
392
                'kivi.Reclamation.set_selected_to_value("reason_description_int")',
393
                "↓",
394
                alt=LxERP.t8('Apply to selected rows'),
395
                title=LxERP.t8('Apply to selected rows'),
396
          ) %]
391 397
        </th>
392 398
        <th colspan="7"></th>
393 399
      </tr>
templates/webpages/reclamation/tabs/basic_data.html
273 273
                [%- END -%]
274 274
                <th colspan="3"></th>
275 275
                <th>
276
                  [% L.select_tag("reason_for_selected",
276
                  [% L.select_tag("reason_id_for_selected",
277 277
                                  SELF.reclamation.valid_reclamation_reasons,
278 278
                                  title_key = 'name',
279 279
                                  value_key = 'id',
280 280
                                  with_empty=1,
281 281
                                  class="wi-small",
282 282
                                  ) %]
283
                  [%- L.button_tag('kivi.Reclamation.set_selected_to_reason()', "↓",
284
                                   alt=LxERP.t8('Apply to selected rows'),
285
                                   title=LxERP.t8('Apply to selected rows'),
286
                                   ) %]
283
                  [%- L.button_tag(
284
                        'kivi.Reclamation.set_selected_to_value("reason_id")',
285
                        "↓",
286
                        alt=LxERP.t8('Apply to selected rows'),
287
                        title=LxERP.t8('Apply to selected rows'),
288
                  ) %]
287 289
                </th>
288 290
                <th>
289 291
                  [% L.areainput_tag("reason_description_ext_for_selected",
290 292
                                     "",
291 293
                                     class="wi-mediumsmall",
292 294
                                     ) %]
293
                  [%- L.button_tag('kivi.Reclamation.set_selected_to_reason_description_ext()', "↓",
294
                                   alt=LxERP.t8('Apply to selected rows'),
295
                                   title=LxERP.t8('Apply to selected rows'),
296
                                   ) %]
295
                  [%- L.button_tag(
296
                        'kivi.Reclamation.set_selected_to_value("reason_description_ext")',
297
                        "↓",
298
                        alt=LxERP.t8('Apply to selected rows'),
299
                        title=LxERP.t8('Apply to selected rows'),
300
                  ) %]
297 301
                </th>
298 302
                <th>
299 303
                  [% L.areainput_tag("reason_description_int_for_selected",
300 304
                                     "",
301 305
                                     class="wi-mediumsmall",
302 306
                                     ) %]
303
                  [%- L.button_tag('kivi.Reclamation.set_selected_to_reason_description_int()', "↓",
304
                                   alt=LxERP.t8('Apply to selected rows'),
305
                                   title=LxERP.t8('Apply to selected rows'),
306
                                   ) %]
307
                  [%- L.button_tag(
308
                        'kivi.Reclamation.set_selected_to_value("reason_description_int")',
309
                        "↓",
310
                        alt=LxERP.t8('Apply to selected rows'),
311
                        title=LxERP.t8('Apply to selected rows'),
312
                  ) %]
307 313
                </th>
308 314
                <th colspan="7"></th>
309 315
              </tr>

Auch abrufbar als: Unified diff