biz9-logic 4.8.100 → 4.8.102

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 CHANGED
@@ -1,4 +1,4 @@
1
- VERSION='5.8.0'
1
+ VERSION='5.8.2'
2
2
  TITLE='BiZ9-Logic';
3
3
  REPO='git@github.com:biz9framework/biz9-logic.git';
4
4
  BRANCH='main';
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) =>{
@@ -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
  }
@@ -750,6 +754,7 @@ class DataType {
750
754
  static CONTENT='content_biz';
751
755
  static EVENT='event_biz';
752
756
  static FAQ='faq_biz';
757
+ static FAVORITE='favorite_biz';
753
758
  static GALLERY='gallery_biz';
754
759
  static ITEM_MAP='item_map_biz';
755
760
  static ITEM='item_biz';
@@ -1505,6 +1510,35 @@ class Storage {
1505
1510
  }
1506
1511
  }
1507
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
+ console.log('aaaa');
1519
+ country_state_city = item.state;
1520
+ }
1521
+ if(!Str.check_is_null(item.city)){
1522
+ if(!Str.check_is_null(item.state)){
1523
+ console.log('bbbb');
1524
+ country_state_city = item.city + ", " + item.state;
1525
+ }else{
1526
+ console.log('cccccc');
1527
+ country_state_city = item.city;
1528
+ }
1529
+ }
1530
+ }
1531
+ else{
1532
+ console.log('cccc');
1533
+ if(!Str.check_is_null(item.city)){
1534
+ country_state_city = item.city + ", " + item.country;
1535
+ }else{
1536
+ country_state_city = item.country;
1537
+ }
1538
+ }
1539
+ return country_state_city;
1540
+
1541
+ }
1508
1542
  static get_user(req){
1509
1543
  if(!req || !req.session.user){
1510
1544
  let user=DataItem.get_new(DataType.USER,0,{is_guest:true,customer_id:Number.get_id(99999)});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biz9-logic",
3
- "version": "4.8.100",
3
+ "version": "4.8.102",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/test.js CHANGED
@@ -84,7 +84,9 @@ describe("connect", () => {
84
84
  /* --TEAM--END */
85
85
 
86
86
  /* --USER--START */
87
- //let user = User_Logic.get_test();
87
+ let user = {country:"United States",state:"",city:"Atlanta"};
88
+ let country_state = User_Logic.get_user_country_state_city(user);
89
+ Log.w('country_state',country_state);
88
90
  //let user = User_Logic.get_test();
89
91
  //let user_list = User_Logic.get_test_list();
90
92
  //Log.w('user',user);
@@ -195,6 +197,7 @@ describe("connect", () => {
195
197
 
196
198
  /* --PRODUCT--START */
197
199
  //let product = Product_Logic.get_test("Product 1",{get_value:true,get_item:true})
200
+ //let product = Product_Logic.get_test("Product 1")
198
201
  //let product = Product_Logic.get_test({fields:["date_create"]})
199
202
  //let product = Product_Logic.get_test({fields:["cool_beanj]})
200
203
  //Log.w("product",product);
@@ -272,10 +275,12 @@ describe("connect", () => {
272
275
  /* --CONFIG--END */
273
276
 
274
277
  /* --PAGE--START */
278
+ /*
275
279
  let page = Page_Logic.get_test({item_count:2,page_count:2,get_value:true,get_item:true,value_count:5})
276
280
  let page_row_item = Sub_Item_Logic.get_test_section_list(page,page,{get_value:true,value_count:9,section_count:9});
277
281
  Log.w("Page",page);
278
282
  Log.w("Page_Row_Item",page_row_item);
283
+ */
279
284
  //let page = Page.get_test({item_count:9,page_count:19,get_item:true,get_value:true})
280
285
  //let page = Page.get_test()
281
286
  //Log.w("Page_section_1",page.section_1);