Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision d030c273

Von Tamino Steinert vor fast 2 Jahren hinzugefügt

  • ID d030c2731e67ef87b8eba6774ae1ba1cca1c730f
  • Vorgänger 2aa88240

Reclamation: multi edit for: delete, reason, res_desc_ext, res_desc_int

Unterschiede anzeigen:

js/kivi.Reclamation.js
800 800
    window.open("controller.pl?action=CustomerVendor/edit&db=" + encodeURIComponent(db) + "&id=" + encodeURIComponent($(id_selector).val()), '_blank');
801 801
  };
802 802

  
803
  ns.get_selected_rows = function() {
804
    let selected_rows = [];
805
    $('[name^="multi_id_"]').each( function() {
806
      if (this.checked) {
807
        selected_rows.push($(this).parents("tr").first());
808
      }
809
    });
810
    return selected_rows;
811
  }
812

  
813
  ns.toggle_selected_rows = function() {
814
    let selected_rows = [];
815
    $('[name^="multi_id_"]').each( function() {
816
      this.checked = !this.checked;
817
    });
818
    return selected_rows;
819
  }
820

  
821
  ns.delete_selected_rows = function() {
822
    selected_rows = ns.get_selected_rows();
823
    let row_count = selected_rows.length;
824
    if (row_count == 0) {
825
      alert(kivi.t8("No row selected."));
826
      return;
827
    }
828
    if (!confirm(kivi.t8("Do you want delete #1 rows?", [row_count]))) {
829
      return;
830
    }
831
    selected_rows.forEach(function(row) {
832
      $(row).remove();
833
    });
834
    ns.renumber_positions();
835
    ns.recalc_amounts_and_taxes();
836
  };
837

  
838
  ns.set_selected_to_reason = function() {
839
    let reason_id = $("#reason_for_selected").val();
840
    let selected_rows = ns.get_selected_rows();
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
865
      );
866
    });
867
  };
868

  
803 869
});
804 870

  
805 871
$(function() {
......
859 925
    return false;
860 926
  });
861 927

  
928
  $('#select_all').click( function() {
929
    var checked = this.checked
930
    $('[name^="multi_id_"]').each(function() {
931
      this.checked =  checked;
932
    });
933
  });
934

  
862 935
  $('.reformat_number_as_null_number').change(kivi.Reclamation.reformat_number_as_null_number);
863 936

  
864 937
});

Auch abrufbar als: Unified diff