biz9-logic 4.8.101 → 4.8.103
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.
- package/biz9_config +1 -1
- package/index.js +29 -1
- package/package.json +1 -1
- package/test.js +19 -4
package/biz9_config
CHANGED
package/index.js
CHANGED
|
@@ -207,6 +207,7 @@ class Product_Logic {
|
|
|
207
207
|
DataItem.get_new(DataType.PRODUCT,0),
|
|
208
208
|
DataItem.get_new(DataType.PRODUCT,0),
|
|
209
209
|
Field_Logic.get_test(title,option));
|
|
210
|
+
/*
|
|
210
211
|
if(option.get_blank ==false){
|
|
211
212
|
product.cost = String(Number.get_id(999)) + "." + String(Number.get_id(99));
|
|
212
213
|
product.old_cost = String(Number.get_id(999)) + "." + String(Number.get_id(99));
|
|
@@ -225,6 +226,7 @@ class Product_Logic {
|
|
|
225
226
|
if(option.get_item){
|
|
226
227
|
product.items = Sub_Item_Logic.get_test_list(product,product,option);
|
|
227
228
|
}
|
|
229
|
+
*/
|
|
228
230
|
return product;
|
|
229
231
|
};
|
|
230
232
|
static get_test_list = (option) =>{
|
|
@@ -428,7 +430,7 @@ class Field_Logic {
|
|
|
428
430
|
static get_test = (title,option) =>{
|
|
429
431
|
option = !Obj.check_is_empty(option) ? option : {};
|
|
430
432
|
let sub_note = "Sub Note "+String(Number.get_id());
|
|
431
|
-
let note = "Note "+String(Number.get_id());
|
|
433
|
+
let note = "Note "+String(Number.get_id()) + "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.";
|
|
432
434
|
option.category_title = !Str.check_is_null(option.category_title) ? option.category_title : 'Category '+String(Number.get_id());
|
|
433
435
|
if(option.get_blank == true){
|
|
434
436
|
date_create:"";
|
|
@@ -458,7 +460,9 @@ class Field_Logic {
|
|
|
458
460
|
if(option.get_blank == true){
|
|
459
461
|
item[field_list[a]] = "";
|
|
460
462
|
}else{
|
|
463
|
+
if(!Str.check_is_null(field_list[a])){
|
|
461
464
|
item[Str.get_title_url(field_list[a])] = Str.get_title(field_list[a]) +"_" + Number.get_id();
|
|
465
|
+
}
|
|
462
466
|
}
|
|
463
467
|
}
|
|
464
468
|
}
|
|
@@ -1506,6 +1510,30 @@ class Storage {
|
|
|
1506
1510
|
}
|
|
1507
1511
|
}
|
|
1508
1512
|
class User_Logic {
|
|
1513
|
+
static get_user_country_state_city(item){
|
|
1514
|
+
let country_state_city = "";
|
|
1515
|
+
if(item.country == "United States"){
|
|
1516
|
+
let state = "";
|
|
1517
|
+
if(!Str.check_is_null(item.state)){
|
|
1518
|
+
country_state_city = item.state;
|
|
1519
|
+
}
|
|
1520
|
+
if(!Str.check_is_null(item.city)){
|
|
1521
|
+
if(!Str.check_is_null(item.state)){
|
|
1522
|
+
country_state_city = item.city + ", " + item.state;
|
|
1523
|
+
}else{
|
|
1524
|
+
country_state_city = item.city;
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
}
|
|
1528
|
+
else{
|
|
1529
|
+
if(!Str.check_is_null(item.city)){
|
|
1530
|
+
country_state_city = item.city + ", " + item.country;
|
|
1531
|
+
}else{
|
|
1532
|
+
country_state_city = item.country;
|
|
1533
|
+
}
|
|
1534
|
+
}
|
|
1535
|
+
return country_state_city;
|
|
1536
|
+
}
|
|
1509
1537
|
static get_user(req){
|
|
1510
1538
|
if(!req || !req.session.user){
|
|
1511
1539
|
let user=DataItem.get_new(DataType.USER,0,{is_guest:true,customer_id:Number.get_id(99999)});
|
package/package.json
CHANGED
package/test.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
2
|
const series = require('async-series');
|
|
3
|
-
const {DataItem,DataType,Url,Obj,BiZ_Url,Cat,Stock,Schedule,Storage,Business,Product,Service,Event,Template,Page,Category,Review,Blog_Post,Faq_Logic,Category_Url,Blank_Url,Blank_Logic,Item_Logic,Service_Logic,Template_Logic,Page_Logic,Product_Logic,Event_Logic,Blog_Post_Logic,Content_Logic,Category_Logic,Team_Logic,Business_Logic,PageType,Sub_Item_Logic,Page_Url,Review_Logic,User_Logic} = require('./index');
|
|
3
|
+
const {DataItem,DataType,Url,Obj,BiZ_Url,Cat,Stock,Schedule,Storage,Business,Product,Service,Event,Template,Page,Category,Review,Blog_Post,Faq_Logic,Category_Url,Blank_Url,Blank_Logic,Item_Logic,Service_Logic,Template_Logic,Page_Logic,Product_Logic,Event_Logic,Blog_Post_Logic,Content_Logic,Category_Logic,Team_Logic,Business_Logic,PageType,Sub_Item_Logic,Page_Url,Review_Logic,User_Logic,Field_Logic} = require('./index');
|
|
4
4
|
const {Log,Number} = require('biz9-utility');
|
|
5
5
|
const {Scriptz}= require('biz9-scriptz');
|
|
6
6
|
|
|
@@ -83,13 +83,26 @@ describe("connect", () => {
|
|
|
83
83
|
//Log.w('team_list',team_list);
|
|
84
84
|
/* --TEAM--END */
|
|
85
85
|
|
|
86
|
-
/* --
|
|
87
|
-
|
|
86
|
+
/* --FIELD-LOGIC--START */
|
|
87
|
+
let field_logic = Field_Logic.get_test();
|
|
88
|
+
Log.w('field_logic',field_logic);
|
|
89
|
+
//let country_state = User_Logic.get_user_country_state_city(user);
|
|
90
|
+
//Log.w('country_state',country_state);
|
|
88
91
|
//let user = User_Logic.get_test();
|
|
89
92
|
//let user_list = User_Logic.get_test_list();
|
|
90
93
|
//Log.w('user',user);
|
|
91
94
|
//Log.w('user_list',user_list);
|
|
95
|
+
/* --FIELD-LOGIC--END */
|
|
96
|
+
|
|
92
97
|
|
|
98
|
+
/* --USER--START */
|
|
99
|
+
//let user = {country:"United States",state:"",city:"Atlanta"};
|
|
100
|
+
//let country_state = User_Logic.get_user_country_state_city(user);
|
|
101
|
+
//Log.w('country_state',country_state);
|
|
102
|
+
//let user = User_Logic.get_test();
|
|
103
|
+
//let user_list = User_Logic.get_test_list();
|
|
104
|
+
//Log.w('user',user);
|
|
105
|
+
//Log.w('user_list',user_list);
|
|
93
106
|
/* --USER--END */
|
|
94
107
|
|
|
95
108
|
/* --SEARCH--START */
|
|
@@ -103,7 +116,6 @@ describe("connect", () => {
|
|
|
103
116
|
let search_filter_value_2 = 'value2';
|
|
104
117
|
*/
|
|
105
118
|
|
|
106
|
-
|
|
107
119
|
//let query = "?app_id=19&data_type="+data_type+"&sort_by={}&page_current=1&page_size=99&search_filter_key_1="+search_filter_key_1+"&search_filter_value_1="+search_filter_value_1+"&search_filter_key_2="+search_filter_key_2+"&search_filter_value_2="+search_filter_value_2;
|
|
108
120
|
|
|
109
121
|
//Log.w('query',query);
|
|
@@ -195,6 +207,7 @@ describe("connect", () => {
|
|
|
195
207
|
|
|
196
208
|
/* --PRODUCT--START */
|
|
197
209
|
//let product = Product_Logic.get_test("Product 1",{get_value:true,get_item:true})
|
|
210
|
+
//let product = Product_Logic.get_test("Product 1")
|
|
198
211
|
//let product = Product_Logic.get_test({fields:["date_create"]})
|
|
199
212
|
//let product = Product_Logic.get_test({fields:["cool_beanj]})
|
|
200
213
|
//Log.w("product",product);
|
|
@@ -272,10 +285,12 @@ describe("connect", () => {
|
|
|
272
285
|
/* --CONFIG--END */
|
|
273
286
|
|
|
274
287
|
/* --PAGE--START */
|
|
288
|
+
/*
|
|
275
289
|
let page = Page_Logic.get_test({item_count:2,page_count:2,get_value:true,get_item:true,value_count:5})
|
|
276
290
|
let page_row_item = Sub_Item_Logic.get_test_section_list(page,page,{get_value:true,value_count:9,section_count:9});
|
|
277
291
|
Log.w("Page",page);
|
|
278
292
|
Log.w("Page_Row_Item",page_row_item);
|
|
293
|
+
*/
|
|
279
294
|
//let page = Page.get_test({item_count:9,page_count:19,get_item:true,get_value:true})
|
|
280
295
|
//let page = Page.get_test()
|
|
281
296
|
//Log.w("Page_section_1",page.section_1);
|