Advanced Order Export For WooCommerce - Version 2.0.0

Version Description

  • 2018-10-24 =
  • It's a major update. Backup settings (tab "Tools") before upgrading
  • New section "Set up fields to export" - simplify UI, format fields, allow duplicates
  • Compatible with Woocommerce 3.5
Download this release

Release Info

Developer algol.plus
Plugin Icon 128x128 Advanced Order Export For WooCommerce
Version 2.0.0
Comparing to
See all releases

Code changes from version 1.5.6 to 2.0.0

Files changed (35) hide show
  1. assets/css/export.css +223 -14
  2. assets/css/select2/select2.min.css +1 -0
  3. assets/js/export.js +291 -141
  4. assets/js/select2/i18n/de.js +3 -0
  5. assets/js/select2/i18n/es.js +3 -0
  6. assets/js/select2/i18n/fr.js +3 -0
  7. assets/js/select2/i18n/pt-BR.js +3 -0
  8. assets/js/select2/i18n/pt.js +3 -0
  9. assets/js/select2/i18n/ru.js +3 -0
  10. assets/js/select2/i18n/zh-CN.js +3 -0
  11. assets/js/select2/select2.full.js +6436 -0
  12. assets/js/settings-form.js +815 -166
  13. classes/admin/class-wc-order-export-ajax.php +1 -1
  14. classes/admin/class-wc-order-export-labels.php +165 -0
  15. classes/admin/class-wc-order-export-manage.php +402 -57
  16. classes/class-wc-order-export-admin.php +54 -12
  17. classes/core/class-wc-order-export-data-extractor-ui.php +115 -20
  18. classes/core/class-wc-order-export-data-extractor.php +119 -261
  19. classes/core/class-wc-order-export-engine.php +183 -293
  20. classes/formats/abstract-class-woe-formatter-plain-format.php +273 -0
  21. classes/formats/abstract-class-woe-formatter-sv.php +33 -26
  22. classes/formats/abstract-class-woe-formatter.php +91 -14
  23. classes/formats/class-woe-formatter-json.php +28 -12
  24. classes/formats/class-woe-formatter-tsv.php +2 -2
  25. classes/formats/class-woe-formatter-xls.php +70 -34
  26. classes/formats/class-woe-formatter-xml.php +27 -19
  27. classes/formats/trait-woe-plain-format.php +242 -0
  28. i18n/languages/woo-order-export-lite.pot +450 -352
  29. readme.txt +8 -3
  30. view/modal-controls.php +0 -55
  31. view/settings-form.php +261 -88
  32. view/tab/order-actions.php +1 -1
  33. view/tab/profiles.php +1 -1
  34. view/tab/schedules.php +1 -1
  35. woo-order-export-lite.php +6 -18
assets/css/export.css CHANGED
@@ -1,9 +1,6 @@
1
- #fields {
2
-
3
-
4
height: 800px;
5
- overflow: scroll;
6
- width: 530px;
7
padding: 20px;
8
border-color: rgb(187, 180, 180);
9
border-style: solid;
@@ -33,7 +30,6 @@
33
34
.fields_control_style {
35
padding: 10px;
36
- // width: 530px;
37
border-color: rgb(187, 180, 180);
38
border-style: solid;
39
border-width: 1px;
@@ -66,7 +62,7 @@
66
67
#fields_control {
68
padding: 10px;
69
- width: 530px;
70
border-color: rgb(187, 180, 180);
71
border-style: solid;
72
border-width: 1px;
@@ -98,7 +94,15 @@
98
padding: 0px;
99
min-width: 100px;
100
}
101
- #order_fields { list-style-type: none; margin: 0; padding: 0; width: 490px; }
102
#output_preview {border-color:green; border-style: dashed; border-width: 1px; display:none; width:90% }
103
.spit-settings-cols {width:20px}
104
@@ -121,7 +125,7 @@
121
}
122
.mapping_col_2{
123
display:table-cell;
124
- width:150px;
125
}
126
.mapping_col_3{
127
display:table-cell;
@@ -404,11 +408,7 @@ input.date{
404
.email_body_textarea
405
{
406
height: 451px;
407
- width: 736px;
408
- }
409
- #modal-email-body
410
- {
411
- display: none;
412
}
413
.select_compare
414
{
@@ -694,4 +694,213 @@ input.date{
694
695
#my-shedule-days .input-mins-custom-interval {
696
max-width: 100px;
697
}
1
+ #fields, #unselected_fields {
2
height: 800px;
3
+ /*overflow: scroll;*/
4
padding: 20px;
5
border-color: rgb(187, 180, 180);
6
border-style: solid;
30
31
.fields_control_style {
32
padding: 10px;
33
border-color: rgb(187, 180, 180);
34
border-style: solid;
35
border-width: 1px;
62
63
#fields_control {
64
padding: 10px;
65
+ /*width: 530px;*/
66
border-color: rgb(187, 180, 180);
67
border-style: solid;
68
border-width: 1px;
94
padding: 0px;
95
min-width: 100px;
96
}
97
+ #order_fields {
98
+ list-style-type: none;
99
+ margin: 0;
100
+ padding: 0;
101
+ min-height: 50vh;
102
+ overflow-y: scroll;
103
+ overflow-x: hidden;
104
+ height: 630px;
105
+ }
106
#output_preview {border-color:green; border-style: dashed; border-width: 1px; display:none; width:90% }
107
.spit-settings-cols {width:20px}
108
125
}
126
.mapping_col_2{
127
display:table-cell;
128
+ min-width:150px;
129
}
130
.mapping_col_3{
131
display:table-cell;
408
.email_body_textarea
409
{
410
height: 451px;
411
+ width: 100%;
412
}
413
.select_compare
414
{
694
695
#my-shedule-days .input-mins-custom-interval {
696
max-width: 100px;
697
+ }
698
+
699
+ .flat_format_controls div {
700
+ margin: 10px;
701
+ }
702
+
703
+ .mapping_row.segment_products {
704
+ background-color: #c5ffbb;
705
+ }
706
+
707
+ .mapping_row.segment_coupons {
708
+ background-color: #c2bdff;
709
+ }
710
+
711
+
712
+
713
+ .segment_choice {
714
+ cursor: pointer;
715
+ }
716
+
717
+ .segment_choice.active {
718
+ font-weight: bold;
719
+ color: #000;
720
+ }
721
+
722
+ .settings-segment:not(.active) {
723
+ display: none;
724
+ }
725
+
726
+ .segment_fields li {
727
+ /*padding: 3px;*/
728
+ }
729
+
730
+ .segment_field {
731
+ padding: 3px;
732
+ margin: 3px;
733
+ cursor: pointer;
734
+ /*display: inline-block;*/
735
+ vertical-align: top;
736
+ overflow: hidden;
737
+ /*flex-basis: 45%;*/
738
+ }
739
+
740
+ .segment_field.blink {
741
+ animation: blinker 3s linear infinite;
742
+ }
743
+
744
+ @keyframes blinker {
745
+ 50% { opacity: 0; }
746
+ }
747
+
748
+ .section {
749
+ display: flex;
750
+ flex-wrap: wrap;
751
+ }
752
+
753
+ .ui-draggable.segment_field .mapping_col_1,
754
+ .ui-draggable.segment_field .mapping_col_3:not(.custom-field-value),
755
+ .mapping_row.segment_field .mapping_row-delete_field,
756
+ .mapping_row.ui-draggabled .mapping_row-delete_custom_field {
757
+ display: none;
758
+ }
759
+
760
+ .ui-draggable.segment_field .mapping_col_3.custom-field-value {
761
+ padding: 0;
762
+ }
763
+
764
+ .ui-draggable.segment_field .mapping_col_3.custom-field-value .mapping_fieldname {
765
+ margin: 0 1px;
766
+ font-size: 12px;
767
+ padding: 0 3px;
768
+ }
769
+
770
+ .ui-draggable.segment_field .mapping_col_3.custom-field-value {
771
+ max-width: 50px;
772
+ }
773
+
774
+
775
+ #order_fields #sortable_products,
776
+ #order_fields #sortable_coupons {
777
+ min-height: 40px;
778
+ margin-left: 30px;
779
+ }
780
+
781
+ #order_fields.non_flat_height {
782
+ height: 750px;
783
+ }
784
+
785
+ .tab-actions-buttons {
786
+ margin-top: 10px;
787
+ line-height: 30px;
788
+ vertical-align: middle;
789
+ }
790
+
791
+ .tab-actions-buttons__title {
792
+ margin-right: 7px;
793
+ }
794
+
795
+ .tab-actions-forms .segment-form {
796
+ border-color: rgb(187, 180, 180);
797
+ border-style: solid;
798
+ border-width: 1px;
799
+ /*display: inline-block;*/
800
+ padding: 10px;
801
+ margin-top: 10px;
802
+ }
803
+
804
+ .tab-actions-forms label {
805
+ display: inline-block;
806
+ padding: 5px;
807
+ min-width: 100px;
808
+
809
+ }
810
+
811
+ .tab-actions-forms span {
812
+ display:block;
813
+ width:100px;
814
+ height: 100%;
815
+ margin: 0 auto;
816
+ padding: 5px;
817
+ }
818
+
819
+ .tab-actions-forms .div_meta label {
820
+ display: inline-block;
821
+ padding: 0px;
822
+ min-width: 120px;
823
+ }
824
+
825
+ .tab-actions-forms .segment-form:not(.active) {
826
+ display: none;
827
+ }
828
+
829
+ .tab-actions-forms .segment-form select {
830
+ margin-left: 1px;
831
+ }
832
+
833
+ #fields .fields-control-block .display_as {
834
+ display: none;
835
+ }
836
+
837
+ #fields .fields-control-block .display_as input[type="text"] {
838
+ max-width: 50px;
839
+ }
840
+
841
+ #fields .fields-control-block .display_as.active {
842
+ display: inline-block;
843
+ }
844
+
845
+ #fields .fields-control-block .display_as div {
846
+ display: inline-block;
847
+ }
848
+
849
+ #fields .fields-control-block .display_as.duplicate_columns_options > div {
850
+ margin: 0 5px 0 5px;
851
+ }
852
+
853
+ #fields .fields-control-block .display_as.duplicate_rows_options > div label,
854
+ #fields .fields-control-block .display_as.duplicate_inside_one_cell_options > div label{
855
+ margin: 0 5px 0 5px;
856
+ }
857
+
858
+ .fields-control-block {
859
+ margin-top: 10px;
860
+ }
861
+
862
+ .fields-control-block .segment-header {
863
+ margin-bottom: 5px;
864
+ display: inline-block;
865
+ }
866
+
867
+ .fields-control-block .segment-header select {
868
+ width: auto;
869
+ }
870
+
871
+ .fields-control-block .display_as .input-delimiter {
872
+ max-width: 40px;
873
+ }
874
+
875
+ #manage_fields.summary-products-report .fields-control-block,
876
+ #manage_fields.summary-products-report #order_fields .mapping_row:not(.segment_products),
877
+ #manage_fields.summary-products-report .field-prefix,
878
+ #manage_fields.summary-products-report #unselected_fields .subsubsub,
879
+ #manage_fields.summary-products-report #unselected_fields label[for="select_custom_meta_order_items"],
880
+ #manage_fields.summary-products-report #unselected_fields #select_custom_meta_order_items {
881
+ display: none;
882
+ }
883
+
884
+ #manage_fields.summary-products-report #unselected_fields .tab-actions-buttons {
885
+ margin-top: 0;
886
+ }
887
+
888
+ .mapping_row-delete_field_block .mapping_row-delete_field {
889
+ color: #000;
890
+ text-decoration: none;
891
+ }
892
+
893
+ .mapping_row-delete_field_block .mapping_row-delete_field .dashicons {
894
+ margin-top: 0;
895
+ }
896
+
897
+ #order_fields .mapping_row:not(.flat-products-group):not(.flat-coupons-group) {
898
+ position: relative;
899
+ padding-right: 35px;
900
+ }
901
+
902
+ #order_fields .mapping_row .mapping_row-delete_field_block {
903
+ position: absolute;
904
+ top: 5px;
905
+ right: 5px;
906
}
assets/css/select2/select2.min.css ADDED
@@ -0,0 +1 @@
1
+ .select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{color:#999;margin-top:5px;float:left}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb}
assets/js/export.js CHANGED
@@ -35,10 +35,10 @@ window.onload = function () {
35
return undefined;
36
}
37
} );
38
-
39
//force style for popup!
40
- var style = jQuery('<style>#TB_ajaxContent { overflow: auto !important; }</style>');
41
- jQuery('html > head').append(style);
42
};
43
44
function bind_events() {
@@ -63,15 +63,16 @@ function bind_events() {
63
jQuery.each( response, function( index, value ) {
64
options += '<option>' + value + '</option>';
65
} );
66
- var $select = jQuery( '<div id="select_custom_fields--select2" style="margin-top: 0px;margin-right: 6px; vertical-align: top;'
67
+ 'display: ' + (('LIKE' === val_op || 'NOT SET' === val_op|| 'IS SET' === val_op) ? 'none' : 'inline-block') + ';">'
68
+ '<select id="select_custom_fields">' + options + '</select></div>' );
69
$select.insertBefore( jQuery( '#add_custom_fields' ) )
70
- $select.find('select').select2({ tags: true });
71
}
72
else {
73
jQuery( '<input type="text" id="select_custom_fields" style="margin-right: 8px;">' ).insertBefore( jQuery( '#add_custom_fields' ) );
74
}
75
}, 'json' );
76
} );
77
jQuery( '#add_custom_fields' ).click( function() {
@@ -97,7 +98,7 @@ function bind_events() {
97
jQuery( '#custom_fields_check' ).append( '<option selected="selected" value="' + result + '">' + result + '</option>' );
98
}
99
100
- jQuery( '#custom_fields_check' ).select2();
101
102
jQuery( '#custom_fields_check option' ).each( function() {
103
jQuery( '#custom_fields_check option[value=\"' + jQuery( this ).val() + '\"]:not(:last)' ).remove();
@@ -142,7 +143,7 @@ function bind_events() {
142
method: "get_products_attributes_values",
143
action: "order_exporter"
144
};
145
-
146
var val_op = jQuery( '#attributes_compare' ).val();
147
jQuery( '#text_attributes' ).val( '' );
148
@@ -155,11 +156,11 @@ function bind_events() {
155
jQuery.each( response, function( index, value ) {
156
options += '<option>' + value + '</option>';
157
} );
158
- var $select = jQuery( '<div id="select_attributes--select2" style="margin-top: 0px;margin-right: 6px; vertical-align: top;'
159
+ 'display: ' + (('LIKE' === val_op) ? 'none' : 'inline-block') + ';">'
160
+ '<select id="select_attributes">' + options + '</select></div>' );
161
$select.insertBefore( jQuery( '#add_attributes' ) )
162
- $select.find('select').select2({ tags: true });
163
}
164
else {
165
jQuery( '<input type="text" id="select_attributes" style="margin-right: 8px;">' ).insertBefore( jQuery( '#add_attributes' ) );
@@ -185,7 +186,7 @@ function bind_events() {
185
if ( f ) {
186
187
jQuery( '#attributes_check' ).append( '<option selected="selected" value="' + val + '">' + val + '</option>' );
188
- jQuery( '#attributes_check' ).select2(select2WODropdownOpts);
189
190
jQuery( '#attributes_check option' ).each( function() {
191
jQuery( '#attributes_check option[value=\"' + jQuery( this ).val() + '\"]:not(:last)' ).remove();
@@ -222,7 +223,7 @@ function bind_events() {
222
method: "get_products_itemmeta_values",
223
action: "order_exporter"
224
};
225
-
226
var val_op = jQuery( '#itemmeta_compare' ).val();
227
jQuery( '#text_itemmeta' ).val( '' );
228
@@ -234,11 +235,11 @@ function bind_events() {
234
jQuery.each( response, function( index, value ) {
235
options += '<option>' + value + '</option>';
236
} );
237
- var $select = jQuery( '<div id="select_itemmeta--select2" style="margin-top: 0px;margin-right: 6px; vertical-align: top;'
238
+ 'display: ' + (('LIKE' === val_op) ? 'none' : 'inline-block') + ';">'
239
+ '<select id="select_itemmeta">' + options + '</select></div>' );
240
$select.insertBefore( jQuery( '#add_itemmeta' ) )
241
- $select.find('select').select2({ tags: true });
242
}
243
else {
244
jQuery( '<input type="text" id="select_itemmeta" style="margin-right: 8px;">' ).insertBefore( jQuery( '#add_itemmeta' ) );
@@ -265,7 +266,7 @@ function bind_events() {
265
if ( f ) {
266
267
jQuery( '#itemmeta_check' ).append( '<option selected="selected" value="' + val + '">' + val + '</option>' );
268
- jQuery( '#itemmeta_check' ).select2(select2WODropdownOpts);
269
270
jQuery( '#itemmeta_check option' ).each( function() {
271
jQuery( '#itemmeta_check option[value=\"' + jQuery( this ).val() + '\"]:not(:last)' ).remove(); // jQuerySelectorEscape ?
@@ -313,7 +314,7 @@ function bind_events() {
313
var $select = jQuery( '<div id="select_taxonomies--select2" style="margin-top: 0px;margin-right: 6px; vertical-align: top; display: inline-block;">'
314
+ '<select id="select_taxonomies">' + options + '</select></div>' );
315
$select.insertBefore( jQuery( '#add_taxonomies' ) )
316
- $select.find('select').select2({ tags: true });
317
}
318
else {
319
jQuery( '<input type="text" id="select_taxonomies" style="margin-right: 8px;">' ).insertBefore( jQuery( '#add_taxonomies' ) );
@@ -339,7 +340,7 @@ function bind_events() {
339
if ( f ) {
340
341
jQuery( '#taxonomies_check' ).append( '<option selected="selected" value="' + val + '">' + val + '</option>' );
342
- jQuery( '#taxonomies_check' ).select2(select2WODropdownOpts);
343
344
jQuery( '#taxonomies_check option' ).each( function() {
345
jQuery( '#taxonomies_check option[value=\"' + jQuery( this ).val() + '\"]:not(:last)' ).remove();
@@ -386,11 +387,11 @@ function bind_events() {
386
jQuery.each( response, function( index, value ) {
387
options += '<option>' + value + '</option>';
388
} );
389
- var $select = jQuery( '<div id="select_product_custom_fields--select2" style="margin-top: 0px;margin-right: 6px; vertical-align: top;'
390
+ 'display: ' + (('LIKE' === val_op) ? 'none' : 'inline-block') + ';">'
391
+ '<select id="select_product_custom_fields">' + options + '</select></div>' );
392
$select.insertBefore( jQuery( '#add_product_custom_fields' ) )
393
- $select.find('select').select2({ tags: true });
394
}
395
else {
396
jQuery( '<input type="text" id="select_product_custom_fields" style="margin-right: 8px;">' ).insertBefore( jQuery( '#add_product_custom_fields' ) );
@@ -415,7 +416,7 @@ function bind_events() {
415
if ( f ) {
416
417
jQuery( '#product_custom_fields_check' ).append( '<option selected="selected" value="' + val + '">' + val + '</option>' );
418
- jQuery( '#product_custom_fields_check' ).select2(select2WODropdownOpts);
419
420
jQuery( '#product_custom_fields_check option' ).each( function() {
421
jQuery( '#product_custom_fields_check option[value=\"' + jQuery( this ).val() + '\"]:not(:last)' ).remove();
@@ -470,20 +471,22 @@ function bind_events() {
470
jQuery( '#button_custom_field' ).click( function() {
471
var colname = jQuery( '#colname_custom_field' ).val();
472
var value = jQuery( '#value_custom_field' ).val();
473
if ( !colname )
474
{
475
alert( export_messages.empty_column_name );
476
jQuery( '#colname_custom_field' ).focus();
477
return false
478
}
479
- /*if ( !value )
480
- {
481
- alert( 'empty Value' );
482
- jQuery( '#value_custom_field' ).focus();
483
- return false
484
- }*/
485
- add_custom_field( jQuery( "#order_fields" ), 'orders', output_format, colname, value );
486
reset_field_contorls();
487
return false;
488
} );
489
@@ -496,8 +499,8 @@ function bind_events() {
496
jQuery( '#select_custom_meta_order' ).html( options );
497
}
498
else {
499
- var data = jQuery( '#export_job_settings' ).serialize()
500
- data = data + "&action=order_exporter&method=get_used_custom_order_meta";
501
502
jQuery.post( ajaxurl, data, function( response ) {
503
if ( response ) {
@@ -530,7 +533,7 @@ function bind_events() {
530
jQuery( '#select_custom_meta_order_items' ).prop( "disabled", false );
531
}
532
else {
533
- jQuery('#modal-manage-products').html(jQuery('#TB_ajaxContent').html());
534
var data = jQuery( '#export_job_settings' ).serialize(),
535
data_products = data + "&action=order_exporter&method=get_used_custom_products_meta&mode=" + mode + "&id=" + job_id,
536
data_order_items = data + "&action=order_exporter&method=get_used_custom_order_items_meta&mode=" + mode + "&id=" + job_id;
@@ -557,7 +560,7 @@ function bind_events() {
557
}
558
}, 'json' );
559
560
- jQuery('#modal-manage-products').html('');
561
}
562
});
563
jQuery('input[name=custom_meta_products_mode]').trigger('change');
@@ -589,6 +592,7 @@ function bind_events() {
589
jQuery( '#button_custom_meta' ).click( function() {
590
var label = jQuery( '#select_custom_meta_order' ).val();
591
var colname = jQuery( '#colname_custom_meta' ).val();
592
if (! label) //try custom text
593
label = jQuery( '#text_custom_meta_order' ).val();;
594
if ( !label )
@@ -603,8 +607,15 @@ function bind_events() {
603
jQuery( '#colname_custom_meta' ).focus();
604
return false
605
}
606
- add_custom_meta( jQuery( "#order_fields" ), 'orders', output_format, label, colname );
607
reset_field_contorls();
608
return false;
609
} );
610
@@ -631,7 +642,7 @@ function bind_events() {
631
632
var $select = jQuery( '<div id="text_shipping_locations--select2" style="margin-top: 0px;margin-right: 6px; vertical-align: top; display: inline-block;"><select id="text_shipping_locations">' + options + '</select></div>' );
633
$select.insertBefore( jQuery( '#add_shipping_locations' ) )
634
- $select.find('select').select2({ tags: true });
635
}
636
else {
637
jQuery( '<input type="text" id="text_shipping_locations" style="margin-right: 8px;">' ).insertBefore( jQuery( '#add_shipping_locations' ) );
@@ -657,7 +668,7 @@ function bind_events() {
657
if ( f ) {
658
659
jQuery( '#shipping_locations_check' ).append( '<option selected="selected" value="' + val + '">' + val + '</option>' );
660
- jQuery( '#shipping_locations_check' ).select2(select2WODropdownOpts);
661
662
jQuery( '#shipping_locations_check option' ).each( function() {
663
jQuery( '#shipping_locations_check option[value=\"' + jQuery( this ).val() + '\"]:not(:last)' ).remove();
@@ -690,7 +701,7 @@ function bind_events() {
690
var $select = jQuery( '<div id="text_billing_locations--select2" style="margin-top: 0px;margin-right: 6px; vertical-align: top; display: inline-block;">'
691
+ '<select id="text_billing_locations">' + options + '</select></div>' );
692
$select.insertBefore( jQuery( '#add_billing_locations' ) )
693
- $select.find('select').select2({ tags: true });
694
}
695
else {
696
jQuery( '<input type="text" id="text_billing_locations" style="margin-right: 8px;">' ).insertBefore( jQuery( '#add_billing_locations' ) );
@@ -716,7 +727,7 @@ function bind_events() {
716
if ( f ) {
717
718
jQuery( '#billing_locations_check' ).append( '<option selected="selected" value="' + val + '">' + val + '</option>' );
719
- jQuery( '#billing_locations_check' ).select2(select2WODropdownOpts);
720
721
jQuery( '#billing_locations_check option' ).each( function() {
722
jQuery( '#billing_locations_check option[value=\"' + jQuery( this ).val() + '\"]:not(:last)' ).remove();
@@ -727,8 +738,8 @@ function bind_events() {
727
}
728
return false;
729
} )
730
-
731
-
732
// ITEM NAMES
733
jQuery( '#item_names' ).change( function() {
734
@@ -750,7 +761,7 @@ function bind_events() {
750
751
var $select = jQuery( '<div id="text_item_names--select2" style="margin-top: 0px;margin-right: 6px; vertical-align: top; display: inline-block;"><select id="text_item_names">' + options + '</select></div>' );
752
$select.insertBefore( jQuery( '#add_item_names' ) )
753
- $select.find('select').select2({ tags: true });
754
}
755
else {
756
jQuery( '<input type="text" id="text_item_names" style="margin-right: 8px;">' ).insertBefore( jQuery( '#add_item_names' ) );
@@ -776,7 +787,7 @@ function bind_events() {
776
if ( f ) {
777
778
jQuery( '#item_names_check' ).append( '<option selected="selected" value="' + val + '">' + val + '</option>' );
779
- jQuery( '#item_names_check' ).select2(select2WODropdownOpts);
780
781
jQuery( '#item_names_check option' ).each( function() {
782
jQuery( '#item_names_check option[value=\"' + jQuery( this ).val() + '\"]:not(:last)' ).remove();
@@ -787,7 +798,7 @@ function bind_events() {
787
}
788
return false;
789
} );
790
-
791
// ITEM METADATA
792
jQuery( '#item_metadata' ).change( function() {
793
@@ -809,7 +820,7 @@ function bind_events() {
809
810
var $select = jQuery( '<div id="text_item_metadata--select2" style="margin-top: 0px;margin-right: 6px; vertical-align: top; display: inline-block;"><select id="text_item_metadata">' + options + '</select></div>' );
811
$select.insertBefore( jQuery( '#add_item_metadata' ) )
812
- $select.find('select').select2({ tags: true });
813
}
814
else {
815
jQuery( '<input type="text" id="text_item_metadata" style="margin-right: 8px;">' ).insertBefore( jQuery( '#add_item_metadata' ) );
@@ -835,7 +846,7 @@ function bind_events() {
835
if ( f ) {
836
837
jQuery( '#item_metadata_check' ).append( '<option selected="selected" value="' + val + '">' + val + '</option>' );
838
- jQuery( '#item_metadata_check' ).select2(select2WODropdownOpts);
839
840
jQuery( '#item_metadata_check option' ).each( function() {
841
jQuery( '#item_metadata_check option[value=\"' + jQuery( this ).val() + '\"]:not(:last)' ).remove();
@@ -846,16 +857,7 @@ function bind_events() {
846
}
847
return false;
848
} );
849
-
850
851
-
852
-
853
- jQuery( '#summary_report_by_products_checkbox' ).on('change', function() {
854
- jQuery('#manage_fields').parent().toggle(jQuery('#summary_report_by_products_checkbox').val());
855
- } );
856
- if( jQuery('#summary_report_by_products_checkbox').prop('checked') ) {
857
- jQuery('#manage_fields').parent().hide();
858
- }
859
}
860
861
function bind_events_users() {
@@ -887,7 +889,7 @@ function bind_events_users() {
887
) + ';">'
888
+ '<select id="select_user_custom_fields">' + options + '</select></div>' );
889
$select.insertBefore( jQuery( '#add_user_custom_fields' ) )
890
- $select.find( 'select' ).select2( {tags: true} );
891
}
892
else {
893
jQuery( '<input type="text" id="select_user_custom_fields" style="margin-right: 8px;">' ).insertBefore(
@@ -921,7 +923,7 @@ function bind_events_users() {
921
'#user_custom_fields_check' ).append( '<option selected="selected" value="' + result + '">' + result + '</option>' );
922
}
923
924
- jQuery( '#user_custom_fields_check' ).select2();
925
926
jQuery( '#user_custom_fields_check option' ).each( function () {
927
jQuery( '#user_custom_fields_check option[value=\"' + jQuery( this ).val() + '\"]:not(:last)' ).remove();
@@ -958,6 +960,7 @@ function add_bind_for_custom_fields( prefix, output_format, $to ) {
958
jQuery( '#button_custom_field_' + prefix + '' ).click( function() {
959
var colname = jQuery( '#colname_custom_field_' + prefix + '' ).val();
960
var value = jQuery( '#value_custom_field_' + prefix + '' ).val();
961
if ( !colname )
962
{
963
alert( export_messages.empty_column_name );
@@ -970,9 +973,18 @@ function add_bind_for_custom_fields( prefix, output_format, $to ) {
970
jQuery( '#value_custom_field_' + prefix + '' ).focus();
971
return false
972
}
973
jQuery( '#colname_custom_field_' + prefix + '' ).val( "" );
974
jQuery( '#value_custom_field_' + prefix + '' ).val( "" );
975
- add_custom_field( $to, prefix, output_format, colname, value );
976
return false;
977
} );
978
@@ -981,17 +993,30 @@ function add_bind_for_custom_fields( prefix, output_format, $to ) {
981
var prefix_items = 'order_items',
982
original_prefix = prefix,
983
prefix_items_select = jQuery( '#select_custom_meta_' + prefix_items + '' ),
984
- prefix_product_select = jQuery( '#select_custom_meta_' + prefix + '' );
985
986
- var type = ( prefix_items_select.val() || prefix_product_select.val() ) ? 'meta' : 'taxonomies';
987
if ( 'meta' === type ) {
988
- original_prefix = prefix_product_select.val() ? prefix : prefix_items;
989
} else {
990
original_prefix = prefix;
991
}
992
type = type + '_' + original_prefix;
993
var label = jQuery( '#select_custom_' + type + '' ).val();
994
var colname = jQuery( '#colname_custom_meta_' + prefix + '' ).val();
995
if ( !label )
996
{
997
alert( export_messages.empty_meta_key_and_taxonomy );
@@ -1005,19 +1030,37 @@ function add_bind_for_custom_fields( prefix, output_format, $to ) {
1005
alert( export_messages.empty_column_name );
1006
return false
1007
}
1008
- add_custom_meta( $to, prefix, output_format, label, colname );
1009
jQuery( '#select_custom_' + type + '' ).val( "" );
1010
jQuery( '#colname_custom_meta_' + prefix + '' ).val( "" );
1011
return false;
1012
} );
1013
1014
}
1015
1016
function reset_field_contorls() {
1017
- jQuery( '#fields_control' ).find( 'input' ).val( '' );
1018
jQuery( "#fields_control > div" ).hide();
1019
jQuery( "#fields_control .div1" ).show();
1020
jQuery( "#fields_control .div2" ).show();
1021
}
1022
1023
function formatItem( item ) {
@@ -1032,58 +1075,154 @@ function formatItem( item ) {
1032
return markup;
1033
}
1034
1035
- function add_custom_field( to, index_p, format, colname, value ) {
1036
1037
value = escapeStr(value);
1038
colname = escapeStr(colname);
1039
- var arr = jQuery( 'input[name*=' + index_p + '\\[label\\]\\[custom_field]' );
1040
- var count = arr.length;
1041
-
1042
- var max = 0;
1043
- for(var i=0; i<count; i++) {
1044
- var n = parseInt(arr[i].name.replace(index_p+'[label][custom_field_', '').replace(']','')); // fixed for popups
1045
- if(n > max) {
1046
- max = n;
1047
}
1048
}
1049
- count = max+1;
1050
1051
// console.log( to, index_p, format, colname, value );
1052
- var row = '<li class="mapping_row segment_modal_' + index_p + '">\
1053
- <div class="mapping_col_1">\
1054
- <input type=hidden name="' + index_p + '[exported][custom_field_' + count + ']" value="0">\
1055
- <input type=checkbox name="' + index_p + '[exported][custom_field_' + count + ']" value="1" checked>\
1056
- <input class="mapping_fieldname" type=hidden name="' + index_p + '[segment][custom_field_' + count + ']" value="misc">\
1057
- <input class="mapping_fieldname" type=hidden name="' + index_p + '[label][custom_field_' + count + ']" value="' + colname + '">\
1058
- </div>\
1059
- <div class="mapping_col_2">' + colname + '<a href="#" onclick="return remove_custom_field(this);" style="float: right;"><span class="ui-icon ui-icon-trash"></span></a></div>\
1060
- <div class="mapping_col_3"><input class="mapping_fieldname" type=input name="' + index_p + '[colname][custom_field_' + count + ']" value="' + colname + '"></div>\
1061
- <div class="mapping_col_3"><input class="mapping_fieldname" type=input name="' + index_p + '[value][custom_field_' + count + ']" value="' + value + '"></div>\
1062
- </li>\
1063
- ';
1064
- to.append( row );
1065
-
1066
- scroll_to_added_field( to );
1067
}
1068
1069
- function add_custom_meta( to, index_p, format, label, colname ) {
1070
1071
label = escapeStr(label);
1072
colname = escapeStr(colname);
1073
1074
- // console.log();
1075
- var row = '<li class="mapping_row segment_modal_' + index_p + '">\
1076
- <div class="mapping_col_1">\
1077
- <input type=hidden name="' + index_p + '[exported][' + label + ']" value="0">\
1078
- <input type=checkbox name="' + index_p + '[exported][' + label + ']" value="1" checked>\
1079
- <input class="mapping_fieldname" type=hidden name="' + index_p + '[label][' + label + ']" value="' + label + '">\
1080
- </div>\
1081
- <div class="mapping_col_2">' + label + '<a href="#" onclick="return remove_custom_field(this);" style="float: right;"><span class="ui-icon ui-icon-trash"></span></a></div>\
1082
- <div class="mapping_col_3"><input class="mapping_fieldname" type=input name="' + index_p + '[colname][' + label + ']" value="' + colname + '"></div>\
1083
- </li>\
1084
- ';
1085
- to.append( row );
1086
- scroll_to_added_field( to );
1087
}
1088
1089
function scroll_to_added_field( to ) {
@@ -1100,65 +1239,74 @@ function formatItemSelection( item ) {
1100
return item.text;
1101
}
1102
1103
function select2_inits()
1104
{
1105
- jQuery( "#from_status, #to_status" ).select2({
1106
- multiple: true
1107
- });
1108
- jQuery( "#statuses" ).select2();
1109
- jQuery( "#shipping_methods" ).select2();
1110
- jQuery( "#user_roles" ).select2();
1111
- jQuery( "#payment_methods" ).select2();
1112
- jQuery( "#attributes" ).select2( {
1113
width: 150
1114
} );
1115
- jQuery( "#attributes_check" ).select2(select2WODropdownOpts);
1116
- jQuery( "#itemmeta" ).select2( {
1117
width: 220
1118
} );
1119
- jQuery( "#itemmeta_check" ).select2(select2WODropdownOpts);
1120
1121
- jQuery( "#custom_fields" ).select2( {
1122
width: 150
1123
} );
1124
- jQuery( "#custom_fields_check" ).select2();
1125
1126
- jQuery( "#product_custom_fields" ).select2( {
1127
width: 150
1128
} );
1129
- jQuery( "#product_custom_fields_check" ).select2(select2WODropdownOpts);
1130
1131
- jQuery( "#user_custom_fields" ).select2( {
1132
width: 150
1133
} );
1134
- jQuery( "#user_custom_fields_check" ).select2();
1135
1136
- jQuery( "#taxonomies" ).select2( {
1137
width: 150
1138
} );
1139
- jQuery( "#taxonomies_check" ).select2(select2WODropdownOpts);
1140
1141
- jQuery( "#shipping_locations" ).select2( {
1142
width: 150
1143
} );
1144
- jQuery( "#shipping_locations_check" ).select2(select2WODropdownOpts);
1145
1146
- jQuery( "#billing_locations" ).select2( {
1147
width: 150
1148
} );
1149
- jQuery( "#billing_locations_check" ).select2(select2WODropdownOpts);
1150
1151
- jQuery( "#item_names" ).select2( {
1152
width: 150
1153
} );
1154
- jQuery( "#item_names_check" ).select2(select2WODropdownOpts);
1155
1156
- jQuery( "#item_metadata" ).select2( {
1157
width: 150
1158
} );
1159
- jQuery( "#item_metadata_check" ).select2(select2WODropdownOpts);
1160
1161
- jQuery( "#product_categories" ).select2( {
1162
ajax: {
1163
url: ajaxurl,
1164
dataType: 'json',
@@ -1189,7 +1337,7 @@ function select2_inits()
1189
templateSelection: formatItemSelection // omitted for brevity, see the source of this page
1190
} );
1191
1192
- jQuery( "#product_vendors" ).select2( {
1193
ajax: {
1194
url: ajaxurl,
1195
dataType: 'json',
@@ -1220,7 +1368,7 @@ function select2_inits()
1220
templateSelection: formatItemSelection // omitted for brevity, see the source of this page
1221
} );
1222
1223
- jQuery( "#products" ).select2( {
1224
ajax: {
1225
url: ajaxurl,
1226
dataType: 'json',
@@ -1251,7 +1399,7 @@ function select2_inits()
1251
templateSelection: formatItemSelection // omitted for brevity, see the source of this page
1252
} );
1253
1254
- jQuery( "#user_names" ).select2( {
1255
ajax: {
1256
url: ajaxurl,
1257
dataType: 'json',
@@ -1282,7 +1430,7 @@ function select2_inits()
1282
templateSelection: formatItemSelection // omitted for brevity, see the source of this page
1283
} );
1284
1285
- jQuery( "#coupons" ).select2( {
1286
ajax: {
1287
url: ajaxurl,
1288
dataType: 'json',
@@ -1339,7 +1487,7 @@ function jQuerySelectorEscape(expression) {
1339
return expression.replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]^`{|}~]/g, '\\amp;');
1340
}
1341
1342
- //for warning
1343
function setup_alert_date_filter() {
1344
default_date_filter_color = jQuery( "#my-date-filter" ).css('color');
1345
try_color_date_filter();
@@ -1347,9 +1495,9 @@ function setup_alert_date_filter() {
1347
jQuery( '#to_date' ).change( function() { try_color_date_filter(); });
1348
}
1349
function try_color_date_filter() {
1350
- var color = default_date_filter_color;
1351
- if( jQuery( "#from_date" ).val() || jQuery( "#to_date" ).val() )
1352
- color = 'red';
1353
jQuery( "#my-date-filter" ).css('color', color);
1354
}
1355
@@ -1357,7 +1505,7 @@ jQuery( document ).ready( function ($) {
1357
1358
$( "#the-list" ).sortable( { handle: '.woe-row-sort-handle' } );
1359
1360
- $( '.wp-wrap .column-order' ).hide();
1361
1362
$start_reorder_button = $( '#start_reorder' );
1363
$apply_reorder_button = $( '#apply_reorder' );
@@ -1369,8 +1517,10 @@ jQuery( document ).ready( function ($) {
1369
$apply_reorder_button.show();
1370
$cancel_reorder_button.show();
1371
1372
- $( '.wp-wrap .check-column' ).hide();
1373
- $( '.wp-wrap .column-order' ).show();
1374
} );
1375
1376
$apply_reorder_button.click( function ( e ) {
@@ -1378,8 +1528,8 @@ jQuery( document ).ready( function ($) {
1378
$apply_reorder_button.hide();
1379
$cancel_reorder_button.hide();
1380
1381
- $( '.wp-wrap .check-column' ).show();
1382
- $( '.wp-wrap .column-order' ).hide();
1383
1384
jQuery.ajax({
1385
url: ajaxurl,
@@ -1404,8 +1554,8 @@ jQuery( document ).ready( function ($) {
1404
$apply_reorder_button.hide();
1405
$cancel_reorder_button.hide();
1406
1407
- $( '.wp-wrap .check-column' ).show();
1408
- $( '.wp-wrap .column-order' ).hide();
1409
1410
$( $order_ids ).each( function ( $key, $job_id ) {
1411
$element = $( '[data-job_id="' + $job_id + '"' ).detach();
35
return undefined;
36
}
37
} );
38
+
39
//force style for popup!
40
+ // var style = jQuery('<style>#TB_ajaxContent { overflow: auto !important; }</style>');
41
+ // jQuery('html > head').append(style);
42
};
43
44
function bind_events() {
63
jQuery.each( response, function( index, value ) {
64
options += '<option>' + value + '</option>';
65
} );
66
+ var $select = jQuery( '<div id="select_custom_fields--select2" style="margin-top: 0px;margin-right: 6px; vertical-align: top;'
67
+ 'display: ' + (('LIKE' === val_op || 'NOT SET' === val_op|| 'IS SET' === val_op) ? 'none' : 'inline-block') + ';">'
68
+ '<select id="select_custom_fields">' + options + '</select></div>' );
69
$select.insertBefore( jQuery( '#add_custom_fields' ) )
70
+ $select.find('select').select2_i18n({ tags: true });
71
}
72
else {
73
jQuery( '<input type="text" id="select_custom_fields" style="margin-right: 8px;">' ).insertBefore( jQuery( '#add_custom_fields' ) );
74
}
75
+ jQuery( '#custom_fields_compare').trigger('change');
76
}, 'json' );
77
} );
78
jQuery( '#add_custom_fields' ).click( function() {
98
jQuery( '#custom_fields_check' ).append( '<option selected="selected" value="' + result + '">' + result + '</option>' );
99
}
100
101
+ jQuery( '#custom_fields_check' ).select2_i18n();
102
103
jQuery( '#custom_fields_check option' ).each( function() {
104
jQuery( '#custom_fields_check option[value=\"' + jQuery( this ).val() + '\"]:not(:last)' ).remove();
143
method: "get_products_attributes_values",
144
action: "order_exporter"
145
};
146
+
147
var val_op = jQuery( '#attributes_compare' ).val();
148
jQuery( '#text_attributes' ).val( '' );
149
156
jQuery.each( response, function( index, value ) {
157
options += '<option>' + value + '</option>';
158
} );
159
+ var $select = jQuery( '<div id="select_attributes--select2" style="margin-top: 0px;margin-right: 6px; vertical-align: top;'
160
+ 'display: ' + (('LIKE' === val_op) ? 'none' : 'inline-block') + ';">'
161
+ '<select id="select_attributes">' + options + '</select></div>' );
162
$select.insertBefore( jQuery( '#add_attributes' ) )
163
+ $select.find('select').select2_i18n({ tags: true });
164
}
165
else {
166
jQuery( '<input type="text" id="select_attributes" style="margin-right: 8px;">' ).insertBefore( jQuery( '#add_attributes' ) );
186
if ( f ) {
187
188
jQuery( '#attributes_check' ).append( '<option selected="selected" value="' + val + '">' + val + '</option>' );
189
+ jQuery( '#attributes_check' ).select2_i18n(select2WODropdownOpts);
190
191
jQuery( '#attributes_check option' ).each( function() {
192
jQuery( '#attributes_check option[value=\"' + jQuery( this ).val() + '\"]:not(:last)' ).remove();
223
method: "get_products_itemmeta_values",
224
action: "order_exporter"
225
};
226
+
227
var val_op = jQuery( '#itemmeta_compare' ).val();
228
jQuery( '#text_itemmeta' ).val( '' );
229
235
jQuery.each( response, function( index, value ) {
236
options += '<option>' + value + '</option>';
237
} );
238
+ var $select = jQuery( '<div id="select_itemmeta--select2" style="margin-top: 0px;margin-right: 6px; vertical-align: top;'
239
+ 'display: ' + (('LIKE' === val_op) ? 'none' : 'inline-block') + ';">'
240
+ '<select id="select_itemmeta">' + options + '</select></div>' );
241
$select.insertBefore( jQuery( '#add_itemmeta' ) )
242
+ $select.find('select').select2_i18n({ tags: true });
243
}
244
else {
245
jQuery( '<input type="text" id="select_itemmeta" style="margin-right: 8px;">' ).insertBefore( jQuery( '#add_itemmeta' ) );
266
if ( f ) {
267
268
jQuery( '#itemmeta_check' ).append( '<option selected="selected" value="' + val + '">' + val + '</option>' );
269
+ jQuery( '#itemmeta_check' ).select2_i18n(select2WODropdownOpts);
270
271
jQuery( '#itemmeta_check option' ).each( function() {
272
jQuery( '#itemmeta_check option[value=\"' + jQuery( this ).val() + '\"]:not(:last)' ).remove(); // jQuerySelectorEscape ?
314
var $select = jQuery( '<div id="select_taxonomies--select2" style="margin-top: 0px;margin-right: 6px; vertical-align: top; display: inline-block;">'
315
+ '<select id="select_taxonomies">' + options + '</select></div>' );
316
$select.insertBefore( jQuery( '#add_taxonomies' ) )
317
+ $select.find('select').select2_i18n({ tags: true });
318
}
319
else {
320
jQuery( '<input type="text" id="select_taxonomies" style="margin-right: 8px;">' ).insertBefore( jQuery( '#add_taxonomies' ) );
340
if ( f ) {
341
342
jQuery( '#taxonomies_check' ).append( '<option selected="selected" value="' + val + '">' + val + '</option>' );
343
+ jQuery( '#taxonomies_check' ).select2_i18n(select2WODropdownOpts);
344
345
jQuery( '#taxonomies_check option' ).each( function() {
346
jQuery( '#taxonomies_check option[value=\"' + jQuery( this ).val() + '\"]:not(:last)' ).remove();
387
jQuery.each( response, function( index, value ) {
388
options += '<option>' + value + '</option>';
389
} );
390
+ var $select = jQuery( '<div id="select_product_custom_fields--select2" style="margin-top: 0px;margin-right: 6px; vertical-align: top;'
391
+ 'display: ' + (('LIKE' === val_op) ? 'none' : 'inline-block') + ';">'
392
+ '<select id="select_product_custom_fields">' + options + '</select></div>' );
393
$select.insertBefore( jQuery( '#add_product_custom_fields' ) )
394
+ $select.find('select').select2_i18n({ tags: true });
395
}
396
else {
397
jQuery( '<input type="text" id="select_product_custom_fields" style="margin-right: 8px;">' ).insertBefore( jQuery( '#add_product_custom_fields' ) );
416
if ( f ) {
417
418
jQuery( '#product_custom_fields_check' ).append( '<option selected="selected" value="' + val + '">' + val + '</option>' );
419
+ jQuery( '#product_custom_fields_check' ).select2_i18n(select2WODropdownOpts);
420
421
jQuery( '#product_custom_fields_check option' ).each( function() {
422
jQuery( '#product_custom_fields_check option[value=\"' + jQuery( this ).val() + '\"]:not(:last)' ).remove();
471
jQuery( '#button_custom_field' ).click( function() {
472
var colname = jQuery( '#colname_custom_field' ).val();
473
var value = jQuery( '#value_custom_field' ).val();
474
+ var format_field = jQuery( '#format_custom_field' ).val();
475
if ( !colname )
476
{
477
alert( export_messages.empty_column_name );
478
jQuery( '#colname_custom_field' ).focus();
479
return false
480
}
481
+
482
+ var segment = jQuery('.segment_choice.active').attr('data-segment');
483
+
484
+ add_custom_field( jQuery( "#" + segment + '_unselected_segment' ), 'orders', output_format, colname, value, segment, format_field );
485
+
486
reset_field_contorls();
487
+
488
+ jQuery(this).siblings('.button-cancel').trigger('click');
489
+
490
return false;
491
} );
492
499
jQuery( '#select_custom_meta_order' ).html( options );
500
}
501
else {
502
+ var json = makeJsonVar(jQuery( '#export_job_settings' ));
503
+ var data = "json="+ json +"&action=order_exporter&method=get_used_custom_order_meta";
504
505
jQuery.post( ajaxurl, data, function( response ) {
506
if ( response ) {
533
jQuery( '#select_custom_meta_order_items' ).prop( "disabled", false );
534
}
535
else {
536
+ // jQuery('#modal-manage-products').html(jQuery('#TB_ajaxContent').html());
537
var data = jQuery( '#export_job_settings' ).serialize(),
538
data_products = data + "&action=order_exporter&method=get_used_custom_products_meta&mode=" + mode + "&id=" + job_id,
539
data_order_items = data + "&action=order_exporter&method=get_used_custom_order_items_meta&mode=" + mode + "&id=" + job_id;
560
}
561
}, 'json' );
562
563
+ // jQuery('#modal-manage-products').html('');
564
}
565
});
566
jQuery('input[name=custom_meta_products_mode]').trigger('change');
592
jQuery( '#button_custom_meta' ).click( function() {
593
var label = jQuery( '#select_custom_meta_order' ).val();
594
var colname = jQuery( '#colname_custom_meta' ).val();
595
+ var format_field = jQuery( '#format_custom_meta' ).val();
596
if (! label) //try custom text
597
label = jQuery( '#text_custom_meta_order' ).val();;
598
if ( !label )
607
jQuery( '#colname_custom_meta' ).focus();
608
return false
609
}
610
+
611
+ var segment = jQuery('.segment_choice.active').attr('data-segment');
612
+
613
+ add_custom_meta( jQuery( "#" + segment + '_unselected_segment' ), 'orders', output_format, label, colname, segment, format_field );
614
+
615
reset_field_contorls();
616
+
617
+ jQuery(this).siblings('.button-cancel').trigger('click');
618
+
619
return false;
620
} );
621
642
643
var $select = jQuery( '<div id="text_shipping_locations--select2" style="margin-top: 0px;margin-right: 6px; vertical-align: top; display: inline-block;"><select id="text_shipping_locations">' + options + '</select></div>' );
644
$select.insertBefore( jQuery( '#add_shipping_locations' ) )
645
+ $select.find('select').select2_i18n({ tags: true });
646
}
647
else {
648
jQuery( '<input type="text" id="text_shipping_locations" style="margin-right: 8px;">' ).insertBefore( jQuery( '#add_shipping_locations' ) );
668
if ( f ) {
669
670
jQuery( '#shipping_locations_check' ).append( '<option selected="selected" value="' + val + '">' + val + '</option>' );
671
+ jQuery( '#shipping_locations_check' ).select2_i18n(select2WODropdownOpts);
672
673
jQuery( '#shipping_locations_check option' ).each( function() {
674
jQuery( '#shipping_locations_check option[value=\"' + jQuery( this ).val() + '\"]:not(:last)' ).remove();
701
var $select = jQuery( '<div id="text_billing_locations--select2" style="margin-top: 0px;margin-right: 6px; vertical-align: top; display: inline-block;">'
702
+ '<select id="text_billing_locations">' + options + '</select></div>' );
703
$select.insertBefore( jQuery( '#add_billing_locations' ) )
704
+ $select.find('select').select2_i18n({ tags: true });
705
}
706
else {
707
jQuery( '<input type="text" id="text_billing_locations" style="margin-right: 8px;">' ).insertBefore( jQuery( '#add_billing_locations' ) );
727
if ( f ) {
728
729
jQuery( '#billing_locations_check' ).append( '<option selected="selected" value="' + val + '">' + val + '</option>' );
730
+ jQuery( '#billing_locations_check' ).select2_i18n(select2WODropdownOpts);
731
732
jQuery( '#billing_locations_check option' ).each( function() {
733
jQuery( '#billing_locations_check option[value=\"' + jQuery( this ).val() + '\"]:not(:last)' ).remove();
738
}
739
return false;
740
} )
741
+
742
+
743
// ITEM NAMES
744
jQuery( '#item_names' ).change( function() {
745
761
762
var $select = jQuery( '<div id="text_item_names--select2" style="margin-top: 0px;margin-right: 6px; vertical-align: top; display: inline-block;"><select id="text_item_names">' + options + '</select></div>' );
763
$select.insertBefore( jQuery( '#add_item_names' ) )
764
+ $select.find('select').select2_i18n({ tags: true });
765
}
766
else {
767
jQuery( '<input type="text" id="text_item_names" style="margin-right: 8px;">' ).insertBefore( jQuery( '#add_item_names' ) );
787
if ( f ) {
788
789
jQuery( '#item_names_check' ).append( '<option selected="selected" value="' + val + '">' + val + '</option>' );
790
+ jQuery( '#item_names_check' ).select2_i18n(select2WODropdownOpts);
791
792
jQuery( '#item_names_check option' ).each( function() {
793
jQuery( '#item_names_check option[value=\"' + jQuery( this ).val() + '\"]:not(:last)' ).remove();
798
}
799
return false;
800
} );
801
+
802
// ITEM METADATA
803
jQuery( '#item_metadata' ).change( function() {
804
820
821
var $select = jQuery( '<div id="text_item_metadata--select2" style="margin-top: 0px;margin-right: 6px; vertical-align: top; display: inline-block;"><select id="text_item_metadata">' + options + '</select></div>' );
822
$select.insertBefore( jQuery( '#add_item_metadata' ) )
823
+ $select.find('select').select2_i18n({ tags: true });
824
}
825
else {
826
jQuery( '<input type="text" id="text_item_metadata" style="margin-right: 8px;">' ).insertBefore( jQuery( '#add_item_metadata' ) );
846
if ( f ) {
847
848
jQuery( '#item_metadata_check' ).append( '<option selected="selected" value="' + val + '">' + val + '</option>' );
849
+ jQuery( '#item_metadata_check' ).select2_i18n(select2WODropdownOpts);
850
851
jQuery( '#item_metadata_check option' ).each( function() {
852
jQuery( '#item_metadata_check option[value=\"' + jQuery( this ).val() + '\"]:not(:last)' ).remove();
857
}
858
return false;
859
} );
860
861
}
862
863
function bind_events_users() {
889
) + ';">'
890
+ '<select id="select_user_custom_fields">' + options + '</select></div>' );
891
$select.insertBefore( jQuery( '#add_user_custom_fields' ) )
892
+ $select.find( 'select' ).select2_i18n( {tags: true} );
893
}
894
else {
895
jQuery( '<input type="text" id="select_user_custom_fields" style="margin-right: 8px;">' ).insertBefore(
923
'#user_custom_fields_check' ).append( '<option selected="selected" value="' + result + '">' + result + '</option>' );
924
}
925
926
+ jQuery( '#user_custom_fields_check' ).select2_i18n();
927
928
jQuery( '#user_custom_fields_check option' ).each( function () {
929
jQuery( '#user_custom_fields_check option[value=\"' + jQuery( this ).val() + '\"]:not(:last)' ).remove();
960
jQuery( '#button_custom_field_' + prefix + '' ).click( function() {
961
var colname = jQuery( '#colname_custom_field_' + prefix + '' ).val();
962
var value = jQuery( '#value_custom_field_' + prefix + '' ).val();
963
+ var format_field = jQuery( '#format_custom_field_' + prefix + '' ).val();
964
if ( !colname )
965
{
966
alert( export_messages.empty_column_name );
973
jQuery( '#value_custom_field_' + prefix + '' ).focus();
974
return false
975
}
976
+
977
jQuery( '#colname_custom_field_' + prefix + '' ).val( "" );
978
+
979
jQuery( '#value_custom_field_' + prefix + '' ).val( "" );
980
+ jQuery( '#format_custom_field_' + prefix + '' ).val( "" );
981
+
982
+ var segment = jQuery('.segment_choice.active').attr('data-segment');
983
+
984
+ add_custom_field( jQuery( "#" + segment + '_unselected_segment' ), prefix, output_format, colname, value, segment, format_field );
985
+
986
+ jQuery(this).siblings('.button-cancel').trigger('click');
987
+
988
return false;
989
} );
990
993
var prefix_items = 'order_items',
994
original_prefix = prefix,
995
prefix_items_select = jQuery( '#select_custom_meta_' + prefix_items + '' ),
996
+ prefix_product_select = jQuery( '#select_custom_meta_' + prefix + '' ),
997
+ prefix_product_text = jQuery( '#text_custom_meta_' + prefix + '' ),
998
+ prefix_items_text = jQuery( '#text_custom_meta_' + prefix_items + '' );
999
+
1000
+ var type = (
1001
+ prefix_items_select.val() ||
1002
+ prefix_product_select.val() ||
1003
+ prefix_product_text.val() ||
1004
+ prefix_items_text.val()
1005
+ ) ? 'meta' : 'taxonomies';
1006
1007
if ( 'meta' === type ) {
1008
+ original_prefix = prefix_product_select.val() || prefix_product_text.val() ? prefix : prefix_items;
1009
} else {
1010
original_prefix = prefix;
1011
}
1012
type = type + '_' + original_prefix;
1013
var label = jQuery( '#select_custom_' + type + '' ).val();
1014
var colname = jQuery( '#colname_custom_meta_' + prefix + '' ).val();
1015
+ var field_format = jQuery( '#format_custom_meta_' + prefix + '' ).val();
1016
+
1017
+ if (! label ) //try custom text
1018
+ label = jQuery( '#text_custom_' + type ).val();
1019
+
1020
if ( !label )
1021
{
1022
alert( export_messages.empty_meta_key_and_taxonomy );
1030
alert( export_messages.empty_column_name );
1031
return false
1032
}
1033
+
1034
+ var segment = jQuery('.segment_choice.active').attr('data-segment');
1035
+
1036
+ add_custom_meta( jQuery( "#" + segment + '_unselected_segment' ), prefix, output_format, label, colname, segment, field_format );
1037
+
1038
+ jQuery(this).siblings('.button-cancel').trigger('click');
1039
+
1040
jQuery( '#select_custom_' + type + '' ).val( "" );
1041
jQuery( '#colname_custom_meta_' + prefix + '' ).val( "" );
1042
+ jQuery( '#format_custom_meta_' + prefix + '' ).val( "" );
1043
return false;
1044
} );
1045
1046
}
1047
1048
function reset_field_contorls() {
1049
+ jQuery( '.tab-actions-forms' )
1050
+ .find( 'input,select' )
1051
+ .val( '' );
1052
+ }
1053
+
1054
+ function reset_field_contorls_() {
1055
+ jQuery( '#fields_control' )
1056
+ .find( 'input' )
1057
+ .not('.segment_products input')
1058
+ .not('.segment_coupons input')
1059
+ .val( '' );
1060
jQuery( "#fields_control > div" ).hide();
1061
jQuery( "#fields_control .div1" ).show();
1062
jQuery( "#fields_control .div2" ).show();
1063
+ jQuery( "#fields_control .flat_format_controls" ).show();
1064
}
1065
1066
function formatItem( item ) {
1075
return markup;
1076
}
1077
1078
+ function add_custom_field( to, index_p, format, colname, value, segment, format_field ) {
1079
1080
value = escapeStr(value);
1081
colname = escapeStr(colname);
1082
+
1083
+ if ( is_flat_format(format) ) {
1084
+ _index = 'plain_' + index_p + '_';
1085
+ _index_p = 'orders[]';
1086
+ } else {
1087
+ _index = '';
1088
+ _index_p = index_p + '[]';
1089
+ }
1090
+
1091
+ var label_prefix = '';
1092
+
1093
+ if (is_flat_format(format)) {
1094
+
1095
+ if (segment === 'products' ) {
1096
+ label_prefix = '[P] '
1097
+ }
1098
+
1099
+ if (segment === 'coupons' ) {
1100
+ label_prefix = '[C] '
1101
}
1102
}
1103
+
1104
+ var suffix = 0;
1105
+
1106
+ jQuery('#unselected_fields input[value*="static_field_"]').each(function () {
1107
+
1108
+ var match = jQuery(this).attr('value').match(/static_field_(\d+)/);
1109
+
1110
+ if (!match) {
1111
+ return true;
1112
+ }
1113
+
1114
+ var n = parseInt(match[1]);
1115
+
1116
+ if(n > suffix) {
1117
+ suffix = n;
1118
+ }
1119
+ });
1120
+
1121
+ var field_key = 'static_field_' + (suffix + 1);
1122
+
1123
+ var delete_btn = '<div class="mapping_col_3 mapping_row-delete_field_block"><a href="#" class="mapping_row-delete_field"><span class="dashicons dashicons-trash"></span></a></div>';
1124
1125
// console.log( to, index_p, format, colname, value );
1126
+ var row = jQuery('<li class="mapping_row segment_field segment_'+ segment +'">\
1127
+ <div class="mapping_col_1" style="width: 10px">\
1128
+ <input class="mapping_fieldname" type=hidden name="' + _index_p + '[segment]" value="'+ (segment ? segment : 'misc') +'">\
1129
+ <input class="mapping_fieldname" type=hidden name="' + _index_p + '[key]" value="'+ _index + field_key +'">\
1130
+ <input class="mapping_fieldname" type=hidden name="' + _index_p + '[label]" value="' + colname + '">\
1131
+ <input class="mapping_fieldname" type=hidden name="' + _index_p + '[format]" value="' + format_field + '">\
1132
+ </div>\
1133
+ <div class="mapping_col_2" title="'+field_key+'">' + '<span class="field-prefix">' + label_prefix + '</span>' + colname + '<a href="#" onclick="return remove_custom_field(this);" class="mapping_row-delete_custom_field" style="float: right;"><span class="ui-icon ui-icon-trash"></span></a></div>\
1134
+ <div class="mapping_col_3"><input class="mapping_fieldname" type=input name="' + _index_p + '[colname]" value="' + colname + '"></div>\
1135
+ <div class="mapping_col_3 custom-field-value"><input class="mapping_fieldname" type=input name="' + _index_p + '[value]" value="' + value + '"></div>'+ delete_btn +'\
1136
+ </li>\
1137
+ ');
1138
+
1139
+ row.find('input').prop('disabled', 'disabled');
1140
+
1141
+ to.prepend( row );
1142
+
1143
+ activate_draggable_field(
1144
+ to.find('.segment_field').first(),
1145
+ segment,
1146
+ format
1147
+ );
1148
+
1149
+ to.find('.segment_field').first().addClass('blink');
1150
+
1151
+ var field = {
1152
+ key: field_key,
1153
+ colname: colname,
1154
+ 'default': 0,
1155
+ label: colname,
1156
+ format: 'string',
1157
+ value: value,
1158
+ };
1159
+
1160
+ window.all_fields[segment].unshift(field);
1161
}
1162
1163
+ function add_custom_meta( to, index_p, format, label, colname, segment, format_field ) {
1164
1165
label = escapeStr(label);
1166
colname = escapeStr(colname);
1167
1168
+ if ( is_flat_format(format) ) {
1169
+ _index = 'plain_' + index_p + '_' + label;
1170
+ _index_p = 'orders[]';
1171
+ } else {
1172
+ _index = label;
1173
+ _index_p = index_p + '[]';
1174
+ }
1175
+
1176
+ var label_prefix = '';
1177
+
1178
+ if (is_flat_format(format)) {
1179
+
1180
+ if (segment === 'products' ) {
1181
+ label_prefix = '[P] '
1182
+ }
1183
+
1184
+ if (segment === 'coupons' ) {
1185
+ label_prefix = '[C] '
1186
+ }
1187
+ }
1188
+
1189
+ var delete_btn = '<div class="mapping_col_3 mapping_row-delete_field_block"><a href="#" class="mapping_row-delete_field"><span class="dashicons dashicons-trash"></span></a></div>';
1190
+
1191
+ var row = jQuery('<li class="mapping_row segment_field segment_'+ segment +'">\
1192
+ <div class="mapping_col_1" style="width: 10px">\
1193
+ <input class="mapping_fieldname" type=hidden name="' + _index_p + '[segment]" value="'+ (segment ? segment : 'misc') +'">\
1194
+ <input class="mapping_fieldname" type=hidden name="' + _index_p + '[key]" value="'+ _index +'">\
1195
+ <input class="mapping_fieldname" type=hidden name="' + _index_p + '[label]" value="' + label + '">\
1196
+ <input class="mapping_fieldname" type=hidden name="' + _index_p + '[format]" value="' + format_field + '">\
1197
+ </div>\
1198
+ <div class="mapping_col_2" title="'+label+'">' + '<span class="field-prefix">' + label_prefix + '</span>' + label + '<a href="#" onclick="return remove_custom_field(this);" class="mapping_row-delete_custom_field" style="float: right;"><span class="ui-icon ui-icon-trash"></span></a></div>\
1199
+ <div class="mapping_col_3"><input class="mapping_fieldname" type=input name="' + _index_p + '[colname]" value="' + colname + '"></div>'+ delete_btn +'\
1200
+ </li>\
1201
+ ');
1202
+
1203
+ row.find('input').prop('disabled', 'disabled');
1204
+
1205
+ to.prepend( row );
1206
+
1207
+ activate_draggable_field(
1208
+ to.find('.segment_field').first(),
1209
+ segment,
1210
+ format
1211
+ );
1212
+
1213
+ to.find('.segment_field').first().addClass('blink');
1214
+
1215
+ var field = {
1216
+ key: label,
1217
+ colname: colname,
1218
+ 'default': 0,
1219
+ label: label,
1220
+ segment: segment,
1221
+ format: 'string',
1222
+ value: 'undefined',
1223
+ };
1224
+
1225
+ window.all_fields[segment].unshift(field);
1226
}
1227
1228
function scroll_to_added_field( to ) {
1239
return item.text;
1240
}
1241
1242
+ jQuery.fn.extend(
1243
+ {
1244
+ select2_i18n: function ($attrs) {
1245
+ if ( typeof $attrs !== 'object' ) {
1246
+ $attrs = {};
1247
+ }
1248
+ $attrs = Object.assign({ language: script_data.select2_locale }, $attrs);
1249
+ jQuery(this).select2($attrs);
1250
+ }
1251
+ } );
1252
+
1253
function select2_inits()
1254
{
1255
+ jQuery( "#from_status, #to_status" ).select2_i18n({multiple: true});
1256
+ jQuery( "#statuses" ).select2_i18n();
1257
+ jQuery( "#shipping_methods" ).select2_i18n();
1258
+ jQuery( "#user_roles" ).select2_i18n();
1259
+ jQuery( "#payment_methods" ).select2_i18n();
1260
+ jQuery( "#attributes" ).select2_i18n( {
1261
width: 150
1262
} );
1263
+ jQuery( "#attributes_check" ).select2_i18n(select2WODropdownOpts);
1264
+ jQuery( "#itemmeta" ).select2_i18n( {
1265
width: 220
1266
} );
1267
+ jQuery( "#itemmeta_check" ).select2_i18n(select2WODropdownOpts);
1268
1269
+ jQuery( "#custom_fields" ).select2_i18n( {
1270
width: 150
1271
} );
1272
+ jQuery( "#custom_fields_check" ).select2_i18n();
1273
1274
+ jQuery( "#product_custom_fields" ).select2_i18n( {
1275
width: 150
1276
} );
1277
+ jQuery( "#product_custom_fields_check" ).select2_i18n(select2WODropdownOpts);
1278
1279
+ jQuery( "#user_custom_fields" ).select2_i18n( {
1280
width: 150
1281
} );
1282
+ jQuery( "#user_custom_fields_check" ).select2_i18n();
1283
1284
+ jQuery( "#taxonomies" ).select2_i18n( {
1285
width: 150
1286
} );
1287
+ jQuery( "#taxonomies_check" ).select2_i18n(select2WODropdownOpts);
1288
1289
+ jQuery( "#shipping_locations" ).select2_i18n( {
1290
width: 150
1291
} );
1292
+ jQuery( "#shipping_locations_check" ).select2_i18n(select2WODropdownOpts);
1293
1294
+ jQuery( "#billing_locations" ).select2_i18n( {
1295
width: 150
1296
} );
1297
+ jQuery( "#billing_locations_check" ).select2_i18n(select2WODropdownOpts);
1298
1299
+ jQuery( "#item_names" ).select2_i18n( {
1300
width: 150
1301
} );
1302
+ jQuery( "#item_names_check" ).select2_i18n(select2WODropdownOpts);
1303
1304
+ jQuery( "#item_metadata" ).select2_i18n( {
1305
width: 150
1306
} );
1307
+ jQuery( "#item_metadata_check" ).select2_i18n(select2WODropdownOpts);
1308
1309
+ jQuery( "#product_categories" ).select2_i18n( {
1310
ajax: {
1311
url: ajaxurl,
1312
dataType: 'json',
1337
templateSelection: formatItemSelection // omitted for brevity, see the source of this page
1338
} );
1339
1340
+ jQuery( "#product_vendors" ).select2_i18n( {
1341
ajax: {
1342
url: ajaxurl,
1343
dataType: 'json',
1368
templateSelection: formatItemSelection // omitted for brevity, see the source of this page
1369
} );
1370
1371
+ jQuery( "#products" ).select2_i18n( {
1372
ajax: {
1373
url: ajaxurl,
1374
dataType: 'json',
1399
templateSelection: formatItemSelection // omitted for brevity, see the source of this page
1400
} );
1401
1402
+ jQuery( "#user_names" ).select2_i18n( {
1403
ajax: {
1404
url: ajaxurl,
1405
dataType: 'json',
1430
templateSelection: formatItemSelection // omitted for brevity, see the source of this page
1431
} );
1432
1433
+ jQuery( "#coupons" ).select2_i18n( {
1434
ajax: {
1435
url: ajaxurl,
1436
dataType: 'json',
1487
return expression.replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]^`{|}~]/g, '\\amp;');
1488
}
1489
1490
+ //for warning
1491
function setup_alert_date_filter() {
1492
default_date_filter_color = jQuery( "#my-date-filter" ).css('color');
1493
try_color_date_filter();
1495
jQuery( '#to_date' ).change( function() { try_color_date_filter(); });
1496
}
1497
function try_color_date_filter() {
1498
+ var color = default_date_filter_color;
1499
+ if( jQuery( "#from_date" ).val() || jQuery( "#to_date" ).val() )
1500
+ color = 'red';
1501
jQuery( "#my-date-filter" ).css('color', color);
1502
}
1503
1505
1506
$( "#the-list" ).sortable( { handle: '.woe-row-sort-handle' } );
1507
1508
+ $( '.check-column .order_part' ).hide();
1509
1510
$start_reorder_button = $( '#start_reorder' );
1511
$apply_reorder_button = $( '#apply_reorder' );
1517
$apply_reorder_button.show();
1518
$cancel_reorder_button.show();
1519
1520
+ $( '.check-column .cb_part' ).hide();
1521
+ $( '.check-column .order_part' ).show();
1522
+
1523
+
1524
} );
1525
1526
$apply_reorder_button.click( function ( e ) {
1528
$apply_reorder_button.hide();
1529
$cancel_reorder_button.hide();
1530
1531
+ $( '.check-column .cb_part' ).show();
1532
+ $( '.check-column .order_part' ).hide();
1533
1534
jQuery.ajax({
1535
url: ajaxurl,
1554
$apply_reorder_button.hide();
1555
$cancel_reorder_button.hide();
1556
1557
+ $( '.check-column .cb_part' ).show();
1558
+ $( '.check-column .order_part' ).hide();
1559
1560
$( $order_ids ).each( function ( $key, $job_id ) {
1561
$element = $( '[data-job_id="' + $job_id + '"' ).detach();
assets/js/select2/i18n/de.js ADDED
@@ -0,0 +1,3 @@
1
+ /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/de",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return"Bitte "+t+" Zeichen weniger eingeben"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Bitte "+t+" Zeichen mehr eingeben"},loadingMore:function(){return"Lade mehr Ergebnisse…"},maximumSelected:function(e){var t="Sie können nur "+e.maximum+" Eintr";return e.maximum===1?t+="ag":t+="äge",t+=" auswählen",t},noResults:function(){return"Keine Übereinstimmungen gefunden"},searching:function(){return"Suche…"}}}),{define:e.define,require:e.require}})();
assets/js/select2/i18n/es.js ADDED
@@ -0,0 +1,3 @@
1
+ /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/es",[],function(){return{errorLoading:function(){return"La carga falló"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Por favor, elimine "+t+" car";return t==1?n+="ácter":n+="acteres",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Por favor, introduzca "+t+" car";return t==1?n+="ácter":n+="acteres",n},loadingMore:function(){return"Cargando más resultados…"},maximumSelected:function(e){var t="Sólo puede seleccionar "+e.maximum+" elemento";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No se encontraron resultados"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})();
assets/js/select2/i18n/fr.js ADDED
@@ -0,0 +1,3 @@
1
+ /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fr",[],function(){return{errorLoading:function(){return"Les résultats ne peuvent pas être chargés."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Supprimez "+t+" caractère";return t!==1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Saisissez "+t+" caractère";return t!==1&&(n+="s"),n},loadingMore:function(){return"Chargement de résultats supplémentaires…"},maximumSelected:function(e){var t="Vous pouvez seulement sélectionner "+e.maximum+" élément";return e.maximum!==1&&(t+="s"),t},noResults:function(){return"Aucun résultat trouvé"},searching:function(){return"Recherche en cours…"}}}),{define:e.define,require:e.require}})();
assets/js/select2/i18n/pt-BR.js ADDED
@@ -0,0 +1,3 @@
1
+ /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pt-BR",[],function(){return{errorLoading:function(){return"Os resultados não puderam ser carregados."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Apague "+t+" caracter";return t!=1&&(n+="es"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Digite "+t+" ou mais caracteres";return n},loadingMore:function(){return"Carregando mais resultados…"},maximumSelected:function(e){var t="Você só pode selecionar "+e.maximum+" ite";return e.maximum==1?t+="m":t+="ns",t},noResults:function(){return"Nenhum resultado encontrado"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})();
assets/js/select2/i18n/pt.js ADDED
@@ -0,0 +1,3 @@
1
+ /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pt",[],function(){return{errorLoading:function(){return"Os resultados não puderam ser carregados."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Por favor apague "+t+" ";return n+=t!=1?"caracteres":"carácter",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Introduza "+t+" ou mais caracteres";return n},loadingMore:function(){return"A carregar mais resultados…"},maximumSelected:function(e){var t="Apenas pode seleccionar "+e.maximum+" ";return t+=e.maximum!=1?"itens":"item",t},noResults:function(){return"Sem resultados"},searching:function(){return"A procurar…"}}}),{define:e.define,require:e.require}})();
assets/js/select2/i18n/ru.js ADDED
@@ -0,0 +1,3 @@
1
+ /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ru",[],function(){function e(e,t,n,r){return e%10<5&&e%10>0&&e%100<5||e%100>20?e%10>1?n:t:r}return{errorLoading:function(){return"Невозможно загрузить результаты"},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Пожалуйста, введите на "+n+" символ";return r+=e(n,"","a","ов"),r+=" меньше",r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Пожалуйста, введите еще хотя бы "+n+" символ";return r+=e(n,"","a","ов"),r},loadingMore:function(){return"Загрузка данных…"},maximumSelected:function(t){var n="Вы можете выбрать не более "+t.maximum+" элемент";return n+=e(t.maximum,"","a","ов"),n},noResults:function(){return"Совпадений не найдено"},searching:function(){return"Поиск…"}}}),{define:e.define,require:e.require}})();
assets/js/select2/i18n/zh-CN.js ADDED
@@ -0,0 +1,3 @@
1
+ /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/zh-CN",[],function(){return{errorLoading:function(){return"无法载入结果。"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="请删除"+t+"个字符";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="请再输入至少"+t+"个字符";return n},loadingMore:function(){return"载入更多结果…"},maximumSelected:function(e){var t="最多只能选择"+e.maximum+"个项目";return t},noResults:function(){return"未找到结果"},searching:function(){return"搜索中…"}}}),{define:e.define,require:e.require}})();
assets/js/select2/select2.full.js ADDED
@@ -0,0 +1,6436 @@