biz9-logic 4.9.92 → 4.9.94

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/biz9_config +1 -1
  2. package/index.js +22 -14
  3. package/package.json +1 -1
  4. package/test.js +0 -76
package/biz9_config CHANGED
@@ -1,4 +1,4 @@
1
- VERSION='9.6.2'
1
+ VERSION='9.6.5'
2
2
  TITLE='BiZ9-Logic';
3
3
  REPO='git@github.com:biz9framework/biz9-logic.git';
4
4
  BRANCH='9.5.3'
package/index.js CHANGED
@@ -1103,9 +1103,6 @@ class Event_Logic {
1103
1103
  };
1104
1104
  }
1105
1105
  class Field_Logic {
1106
- static get_field_value_old = (item_data_type,item_id,value_type,value_id,value,value_list) => {
1107
- return {item_data_type:item_data_type,item_id:item_id,value_type:value_type,value_id:value_id,value:value,value_list:value_list};
1108
- };
1109
1106
  static get_item_field_value_type_list = () => {
1110
1107
  return [
1111
1108
  {value:'text',label:'Text'},
@@ -1114,17 +1111,14 @@ class Field_Logic {
1114
1111
  {value:'list',label:'List'},
1115
1112
  ];
1116
1113
  };
1117
- //static get_field_value_value = (value_type,item,value_id,group_id,title) =>{
1118
- static get_field_value_value = (value_type,item,value_id,title) =>{
1119
- return !Str.check_is_null(item[Field_Logic.get_field_value_title(value_type,value_id,title)]) ? item[Field_Logic.get_field_value_title(value_type,value_id,title)] : "" ? value_type != Type.FIELD_VALUE_LIST : "";
1120
- };
1121
- //static get_field_value_title = (value_type,value_id,title) =>{
1122
- static get_field_value_title = (value_type,value_id,group_id,title) =>{
1123
- if(!title){
1124
- title = '';
1114
+ static get_field_value_value = (value_type,item,value_id) =>{
1115
+ if(value_type!=Type.FIELD_VALUE_LIST){
1116
+ return !Str.check_is_null(item[Field_Logic.get_field_value_title(value_type,value_id)]) ? item[Field_Logic.get_field_value_title(value_type,value_id)] : ""
1125
1117
  }else{
1126
- title = "_"+Str.get_title_url(title);
1118
+ return !Str.check_is_null(item[Field_Logic.get_field_value_title(value_type,value_id)]) ? item[Field_Logic.get_field_value_title(value_type,value_id)] : []
1127
1119
  }
1120
+ };
1121
+ static get_field_value_title = (value_type,value_id) =>{
1128
1122
  switch(value_type){
1129
1123
  case Type.FIELD_VALUE_TEXT:
1130
1124
  return 'text'+'_value_'+value_id;
@@ -1136,7 +1130,7 @@ class Field_Logic {
1136
1130
  return 'image'+'_value_'+value_id;
1137
1131
  break;
1138
1132
  case Type.FIELD_VALUE_LIST:
1139
- return 'list'+'_value_'+value_id +'_group_' +group_id+title;
1133
+ return 'list'+'_value_'+value_id;
1140
1134
  break;
1141
1135
  default:
1142
1136
  return 'text'+'_value_'+value_id;
@@ -1196,6 +1190,21 @@ class Field_Logic {
1196
1190
  }
1197
1191
  return item;
1198
1192
  }
1193
+ static get_value_list_group(item,value_id,group_id){
1194
+ let full_str = 'list_value_'+value_id+"_group_"+group_id;
1195
+ let new_list = [];
1196
+ Log.w(full_str,full_str);
1197
+ let count = 0;
1198
+ for(const prop in item){
1199
+ let new_item = {};
1200
+ if(prop.startsWith(full_str)){
1201
+ count = count+1;
1202
+ new_item[prop.replace(full_str+"_","")] = item[prop];
1203
+ new_list.push(new_item);
1204
+ }
1205
+ }
1206
+ return new_list;
1207
+ }
1199
1208
  static get_value_list(item,option){
1200
1209
  for(let b=0;b<parseInt(option.value_count);b++){
1201
1210
  if(option.get_blank == false){
@@ -1351,7 +1360,6 @@ class Field_Logic {
1351
1360
 
1352
1361
  return option;
1353
1362
  }
1354
-
1355
1363
  }
1356
1364
  class DataType {
1357
1365
  static APP='app_biz';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biz9-logic",
3
- "version": "4.9.92",
3
+ "version": "4.9.94",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/test.js CHANGED
@@ -29,82 +29,6 @@ const biz9_config ={
29
29
  describe("connect", () => {
30
30
  it("_connect", () => {
31
31
  series([
32
-
33
- function(call) {
34
- let my_template = {
35
- title1: "About Us",
36
- title2: "aboout_link",
37
- title3: "Categories",
38
- title4: "category_link",
39
- title5: "Create Gigs",
40
- title6: "gigs_link",
41
- title7: "Home",
42
- title8: "home_link",
43
- title9: "Service",
44
- title10: "service_link",
45
- title11: "Faq",
46
- title12: "faq_link",
47
- title13: "Contact",
48
- title14: "contact_link"
49
- };
50
- /*
51
- let my_template = {
52
- title1: "About Us",
53
- title2: "aboout_link",
54
- title3: "about_id",
55
- title4: "Create Gigs",
56
- title5: "gigs_link",
57
- title6: "gigs_id",
58
- title7: "Service",
59
- title8: "service_link",
60
- title9: "service_id",
61
- title10: "Contact",
62
- title11: "contact_link",
63
- title12: "contact_id"
64
- };
65
- */
66
-
67
- value_count = 2;
68
- let new_list = [];
69
- let row_count = 1;
70
- for(let a = 1; a < 90; a++){
71
- if(!Str.check_is_null(my_template['title'+row_count])){
72
- let item = {};
73
- item['value_1'] = my_template['title'+row_count];
74
- if(value_count >=2){
75
- item['value_2'] = my_template['title'+Number(row_count+1)];
76
- }
77
- if(value_count >=3){
78
- item['value_3'] = my_template['title'+Number(row_count+2)];
79
- }
80
- new_list.push(item);
81
- row_count = row_count + value_count;
82
- }else{
83
- break;
84
- }
85
- }
86
- /*--work
87
- list_value_count = 2;
88
- let title_row = 1;
89
- let link_row = 2;
90
- for(let a = 1; a < 900; a++){
91
- if(!Str.check_is_null(my_template['title'+title_row])){
92
- new_list.push(
93
- {
94
- value_1:my_template['title'+title_row],
95
- value_2:my_template['title'+link_row]
96
- });
97
- title_row = title_row + list_value_count;
98
- link_row = title_row + 1;
99
- }else{
100
- console.log('bbbbbbbbb');
101
- break;
102
- }
103
- }
104
- */
105
-
106
- Log.w('cool',new_list);
107
- },
108
32
  function(call) {
109
33
  console.log('CONNECT-BASE-START');
110
34
  let data_type = DataType.PRODUCT;