biz9-logic 4.8.323 → 4.8.326
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 +525 -697
- package/package.json +2 -3
- package/test.js +2 -666
package/index.js
CHANGED
|
@@ -35,14 +35,11 @@ class Message {
|
|
|
35
35
|
static REVIEW_REMOVE_SUCCESS="Review Remove Success.";
|
|
36
36
|
static REVIEW_USER_LOGIN="Please Login To Add Review.";
|
|
37
37
|
}
|
|
38
|
-
class TemplateType {
|
|
39
|
-
static PRIMARY='primary';
|
|
40
|
-
static HEADER='header';
|
|
41
|
-
static NAVIGATION='navigation';
|
|
42
|
-
static BODY='body';
|
|
43
|
-
static FOOTER='footer';
|
|
44
|
-
}
|
|
45
38
|
class Item_Logic {
|
|
39
|
+
static url_post_cms = (app_id,url,data_type,id,param) => {
|
|
40
|
+
let action_url = "item/post_cms/"+data_type+"/"+id;
|
|
41
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
42
|
+
};
|
|
46
43
|
static get_test = (title,data_type,id,option)=>{
|
|
47
44
|
data_type = data_type ? data_type : DataType.BLANK;
|
|
48
45
|
id = id ? id : 0;
|
|
@@ -127,56 +124,6 @@ class Item_Logic {
|
|
|
127
124
|
}
|
|
128
125
|
return Item_Logic.get_search(query.data_type,filter,sort_by,query.page_current,query.page_size);
|
|
129
126
|
}
|
|
130
|
-
static get_field_value = (item_data_type,item_id,value_type,value_id,value,value_list) => {
|
|
131
|
-
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};
|
|
132
|
-
};
|
|
133
|
-
static get_item_field_value_type_list = () => {
|
|
134
|
-
return [
|
|
135
|
-
{value:'text',label:'Text'},
|
|
136
|
-
{value:'note',label:'Note'},
|
|
137
|
-
{value:'image',label:'Image'},
|
|
138
|
-
{value:'list',label:'List'},
|
|
139
|
-
];
|
|
140
|
-
};
|
|
141
|
-
static get_field_value_value = (value_type,item,value_id) =>{
|
|
142
|
-
switch(value_type){
|
|
143
|
-
case FieldType.ITEM_FIELD_VALUE_TYPE_TEXT:
|
|
144
|
-
case FieldType.ITEM_FIELD_VALUE_TYPE_NOTE:
|
|
145
|
-
case FieldType.ITEM_FIELD_VALUE_TYPE_IMAGE:
|
|
146
|
-
return !Str.check_is_null(item[Item_Logic.get_field_value_title(value_type,value_id)]) ? item[Item_Logic.get_field_value_title(value_type,value_id)] : "";
|
|
147
|
-
break;
|
|
148
|
-
case FieldType.ITEM_FIELD_VALUE_TYPE_LIST:
|
|
149
|
-
let r_list = [];
|
|
150
|
-
for(let a=0;a<30;a++){
|
|
151
|
-
if(!Str.check_is_null(item[Item_Logic.get_field_value_title(value_type,value_id,a+1)])){
|
|
152
|
-
r_list.push(item[Item_Logic.get_field_value_title(value_type,value_id,a+1)]);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
return r_list;
|
|
156
|
-
break;
|
|
157
|
-
default:
|
|
158
|
-
return "";
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
static get_field_value_title = (value_type,value_id,row_id) =>{
|
|
162
|
-
let type_str = '';
|
|
163
|
-
switch(value_type){
|
|
164
|
-
case FieldType.ITEM_FIELD_VALUE_TYPE_TEXT:
|
|
165
|
-
return 'text'+'_value_'+value_id;
|
|
166
|
-
break;
|
|
167
|
-
case FieldType.ITEM_FIELD_VALUE_TYPE_NOTE:
|
|
168
|
-
return 'note'+'_value_'+value_id;
|
|
169
|
-
break;
|
|
170
|
-
case FieldType.ITEM_FIELD_VALUE_TYPE_IMAGE:
|
|
171
|
-
return 'image'+'_value_'+value_id;
|
|
172
|
-
break;
|
|
173
|
-
case FieldType.ITEM_FIELD_VALUE_TYPE_LIST:
|
|
174
|
-
return 'list'+'_value_'+value_id +'_row_'+row_id;
|
|
175
|
-
break;
|
|
176
|
-
default:
|
|
177
|
-
return "";
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
127
|
static get_data_search_result = (app_id,data_type,item_count,page_count,filter,data_list,option) =>{
|
|
181
128
|
return{
|
|
182
129
|
option:option?option:{},
|
|
@@ -190,14 +137,20 @@ class Item_Logic {
|
|
|
190
137
|
}
|
|
191
138
|
}
|
|
192
139
|
class Stat_Logic {
|
|
193
|
-
|
|
194
|
-
static
|
|
195
|
-
static
|
|
196
|
-
static
|
|
197
|
-
static
|
|
198
|
-
static
|
|
199
|
-
static
|
|
200
|
-
|
|
140
|
+
static TYPE_STAT_VIEW='view_post';
|
|
141
|
+
static TYPE_STAT_LIKE='like_post';
|
|
142
|
+
static TYPE_STAT_FAVORITE='favorite_post';
|
|
143
|
+
static TYPE_STAT_CART='cart_post';
|
|
144
|
+
static TYPE_STAT_ORDER='order_post';
|
|
145
|
+
static TYPE_STAT_REVIEW='review_post';
|
|
146
|
+
static TYPE_STAT_LOGIN='login_post';
|
|
147
|
+
static TYPE_STAT_REGISTER='register_post';
|
|
148
|
+
|
|
149
|
+
static url_search_activity = (app_id,url,param) => {
|
|
150
|
+
let action_url="item/search_activity";
|
|
151
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
152
|
+
};
|
|
153
|
+
|
|
201
154
|
static get_new = (user_id,stat_type_id,parent_item_list)=>{
|
|
202
155
|
return {
|
|
203
156
|
user_id:user_id,
|
|
@@ -207,6 +160,65 @@ class Stat_Logic {
|
|
|
207
160
|
}
|
|
208
161
|
}
|
|
209
162
|
class Page_Logic {
|
|
163
|
+
static TYPE_PAGE_HOME='home';
|
|
164
|
+
static TYPE_PAGE_ABOUT='about';
|
|
165
|
+
static TYPE_PAGE_CONTACT='contact';
|
|
166
|
+
static TYPE_PAGE_FAQ='faq';
|
|
167
|
+
|
|
168
|
+
static TYPE_PAGE_BLOG_POST='blog_post';
|
|
169
|
+
static TYPE_PAGE_BLOG_POST_DETAIL='blog_post_detail';
|
|
170
|
+
|
|
171
|
+
static TYPE_PAGE_EVENT='event';
|
|
172
|
+
static TYPE_PAGE_EVENT_DETAIL='event_detail';
|
|
173
|
+
|
|
174
|
+
static TYPE_PAGE_GALLERY='gallery';
|
|
175
|
+
static TYPE_PAGE_GALLERY_DETAIL='gallery_detail';
|
|
176
|
+
|
|
177
|
+
static TYPE_PAGE_SERVICE='service';
|
|
178
|
+
static TYPE_PAGE_SERVICE_DETAIL='service_detail';
|
|
179
|
+
|
|
180
|
+
static TYPE_PAGE_PRODUCT='product';
|
|
181
|
+
static TYPE_PAGE_PRODUCT_DETAIL='product_detail';
|
|
182
|
+
|
|
183
|
+
static TYPE_PAGE_LIST = [
|
|
184
|
+
Page_Logic.TYPE_PAGE_HOME,
|
|
185
|
+
Page_Logic.TYPE_PAGE_ABOUT,
|
|
186
|
+
Page_Logic.TYPE_PAGE_CONTACT,
|
|
187
|
+
Page_Logic.TYPE_PAGE_FAQ,
|
|
188
|
+
Page_Logic.TYPE_PAGE_BLOG_POST,
|
|
189
|
+
Page_Logic.TYPE_PAGE_EVENT,
|
|
190
|
+
Page_Logic.TYPE_PAGE_GALLERY,
|
|
191
|
+
Page_Logic.TYPE_PAGE_SERVICE,
|
|
192
|
+
Page_Logic.TYPE_PAGE_PRODUCT];
|
|
193
|
+
|
|
194
|
+
static get_page_title = (data_type) => {
|
|
195
|
+
if(!data_type){
|
|
196
|
+
return "";
|
|
197
|
+
}else{
|
|
198
|
+
return String(Str.get_title(data_type.replaceAll('_',' '))).trim();
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
static url_get = (app_id,url,title_url,param) => {
|
|
202
|
+
let action_url="page/get/"+title_url;
|
|
203
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
204
|
+
};
|
|
205
|
+
static url_home = (app_id,url,param) => {
|
|
206
|
+
let action_url="page/home";
|
|
207
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
208
|
+
};
|
|
209
|
+
static url_about = (app_id,url,param) => {
|
|
210
|
+
let action_url="page/about";
|
|
211
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
212
|
+
};
|
|
213
|
+
static url_contact = (app_id,url,param) => {
|
|
214
|
+
let action_url="page/contact";
|
|
215
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
216
|
+
};
|
|
217
|
+
static url_faq = (app_id,url,key,param) => {
|
|
218
|
+
let action_url="page/faq/"+key;
|
|
219
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
220
|
+
};
|
|
221
|
+
|
|
210
222
|
static get_test = (title,option) =>{
|
|
211
223
|
[title,option] = Field_Logic.get_option_title(title,option);
|
|
212
224
|
option = Field_Logic.get_option(DataType.PAGE,option?option:{});
|
|
@@ -227,9 +239,43 @@ class Page_Logic {
|
|
|
227
239
|
};
|
|
228
240
|
}
|
|
229
241
|
class Order_Logic {
|
|
242
|
+
|
|
243
|
+
static ORDER_NUMBER="OR-";
|
|
244
|
+
static TRANSACTION_ID="TR-";
|
|
245
|
+
|
|
246
|
+
static TYPE_PAYMENT_STATUS_OPEN="Open";
|
|
247
|
+
static TYPE_PAYMENT_STATUS_COMPLETE="Complete";
|
|
248
|
+
|
|
249
|
+
static TYPE_PAYMENT_PLAN_PENDING="Pending";
|
|
250
|
+
static TYPE_PAYMENT_PLAN_1="1 Payment";
|
|
251
|
+
static TYPE_PAYMENT_PLAN_2="2 Payments";
|
|
252
|
+
static TYPE_PAYMENT_PLAN_3="3 Payments";
|
|
253
|
+
static TYPE_PAYMENT_PLAN_4="4 Payments";
|
|
254
|
+
|
|
255
|
+
static TYPE_PAYMENT_METHOD_STRIPE="Stripe";
|
|
256
|
+
static TYPE_PAYMENT_METHOD_CASH="Cash";
|
|
257
|
+
static TYPE_PAYMENT_METHOD_OTHER="Other";
|
|
258
|
+
static TYPE_PAYMENT_METHOD_TEST="Test";
|
|
259
|
+
|
|
260
|
+
static url_search_order = (app_id,url,parent_data_type,param) => {
|
|
261
|
+
let action_url="item/search_order/"+parent_data_type;
|
|
262
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
263
|
+
};
|
|
264
|
+
static url_post_order = (app_id,url,param) => {
|
|
265
|
+
let action_url="item/post_order";
|
|
266
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
267
|
+
};
|
|
268
|
+
static url_get_order = (app_id,url,order_number,param) => {
|
|
269
|
+
let action_url="item/get_order/"+order_number;
|
|
270
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
271
|
+
};
|
|
272
|
+
static url_delete_order = (app_id,url,id,param) => {
|
|
273
|
+
let action_url="item/delete_order/"+id;
|
|
274
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
275
|
+
};
|
|
230
276
|
static get_new = (cart) => {
|
|
231
277
|
let order = DataItem.get_new(DataType.ORDER,0,{
|
|
232
|
-
order_number:
|
|
278
|
+
order_number:Order_Logic.ORDER_NUMBER + Num.get_id(99999),
|
|
233
279
|
parent_data_type:cart.parent_data_type,
|
|
234
280
|
user_id:cart.user_id,
|
|
235
281
|
cart_number:cart.cart_number,
|
|
@@ -267,13 +313,31 @@ class Order_Logic {
|
|
|
267
313
|
order_number:order_number,
|
|
268
314
|
payment_method_type:payment_method_type,
|
|
269
315
|
payment_amount:payment_amount,
|
|
270
|
-
transaction_id:
|
|
316
|
+
transaction_id:Order_Logic.TRANSACTION_ID + Num.get_id(99999)
|
|
271
317
|
});
|
|
272
318
|
};
|
|
273
319
|
}
|
|
274
320
|
class Cart_Logic {
|
|
321
|
+
static CART_NUMBER="CA-";
|
|
322
|
+
|
|
323
|
+
static url_search_cart = (app_id,url,parent_data_type,param) => {
|
|
324
|
+
let action_url="item/search_cart/"+parent_data_type;
|
|
325
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
326
|
+
};
|
|
327
|
+
static url_post_cart = (app_id,url,parent_data_type,param) => {
|
|
328
|
+
let action_url="item/post_cart/"+parent_data_type;
|
|
329
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
330
|
+
};
|
|
331
|
+
static url_delete_cart = (app_id,url,id,param) => {
|
|
332
|
+
let action_url="item/delete_cart/"+id;
|
|
333
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
334
|
+
};
|
|
335
|
+
static url_get_cart = (app_id,url,cart_number,param) => {
|
|
336
|
+
let action_url="item/get_cart/"+cart_number;
|
|
337
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
338
|
+
};
|
|
275
339
|
static get_new = (parent_data_type,user_id) => {
|
|
276
|
-
return DataItem.get_new(DataType.CART,0,{user_id:user_id,cart_number:
|
|
340
|
+
return DataItem.get_new(DataType.CART,0,{user_id:user_id,cart_number:Cart_Logic.CART_NUMBER + Num.get_id(99999),parent_data_type:parent_data_type,grand_total:0,cart_item_list:[]});
|
|
277
341
|
};
|
|
278
342
|
static get_new_cart_item = (parent_data_type,parent_id,cart_number,quanity) =>{
|
|
279
343
|
return DataItem.get_new(DataType.CART_ITEM,0,{parent_data_type:parent_data_type,parent_id:parent_id,cart_number:cart_number,quanity:quanity,cart_sub_item_list:[]});
|
|
@@ -283,6 +347,49 @@ class Cart_Logic {
|
|
|
283
347
|
};
|
|
284
348
|
}
|
|
285
349
|
class Product_Logic {
|
|
350
|
+
static url_detail = (app_id,url,key,param) => {
|
|
351
|
+
let action_url="product/detail/"+key;
|
|
352
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
353
|
+
};
|
|
354
|
+
static url_home = (app_id,url,param) => {
|
|
355
|
+
let action_url="product";
|
|
356
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
357
|
+
};
|
|
358
|
+
static url_search = (app_id,url,param) => {
|
|
359
|
+
let action_url="product/search";
|
|
360
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
361
|
+
};
|
|
362
|
+
static get_stock_list = () => {
|
|
363
|
+
const r_list=
|
|
364
|
+
[
|
|
365
|
+
{ value: "0", label: "Out of Stock" },
|
|
366
|
+
{ value: "1", label: "Only 1 Left" },
|
|
367
|
+
{ value: "2", label: "Less Than 3 Left" },
|
|
368
|
+
{ value: "3", label: "Availble" }
|
|
369
|
+
];
|
|
370
|
+
return r_list;
|
|
371
|
+
};
|
|
372
|
+
static get_stock_by_value = (stock_val) => {
|
|
373
|
+
switch(stock_val)
|
|
374
|
+
{
|
|
375
|
+
case "0":
|
|
376
|
+
return 'Out of Stock';
|
|
377
|
+
break;
|
|
378
|
+
case "1":
|
|
379
|
+
return 'Only 1 Left';
|
|
380
|
+
break;
|
|
381
|
+
case "2":
|
|
382
|
+
return 'Less Than 3 Left';
|
|
383
|
+
break;
|
|
384
|
+
case "3":
|
|
385
|
+
return 'Availble';
|
|
386
|
+
break;
|
|
387
|
+
default:
|
|
388
|
+
return 'Availble';
|
|
389
|
+
break;
|
|
390
|
+
}
|
|
391
|
+
};
|
|
392
|
+
|
|
286
393
|
static get_test = (title,option) =>{
|
|
287
394
|
[title,option] = Field_Logic.get_option_title(title,option);
|
|
288
395
|
option = Field_Logic.get_option(DataType.PRODUCT,option?option:{});
|
|
@@ -310,7 +417,7 @@ class Product_Logic {
|
|
|
310
417
|
return product;
|
|
311
418
|
};
|
|
312
419
|
static get_test_cart = (cart_number,user_id,option) =>{
|
|
313
|
-
[cart_number,option] =
|
|
420
|
+
[cart_number,option] = ield_Logic.get_option_title(cart_number,option);
|
|
314
421
|
option = Field_Logic.get_option(DataType.CART,option?option:{});
|
|
315
422
|
let cart = DataItem.get_new(DataType.CART,Num.get_guid(),Field_Logic.get_test(cart_number,option));
|
|
316
423
|
cart.user_id = user_id;
|
|
@@ -352,6 +459,42 @@ class Product_Logic {
|
|
|
352
459
|
};
|
|
353
460
|
}
|
|
354
461
|
class Service_Logic {
|
|
462
|
+
static url_detail = (app_id,url,key,param) => {
|
|
463
|
+
let action_url="service/detail/"+key;
|
|
464
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
465
|
+
};
|
|
466
|
+
static url_home = (app_id,url,param) => {
|
|
467
|
+
let action_url="service/search";
|
|
468
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
469
|
+
};
|
|
470
|
+
static url_search = (app_id,url,param) => {
|
|
471
|
+
let action_url="service/search";
|
|
472
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
473
|
+
};
|
|
474
|
+
static get_stock_list = () => {
|
|
475
|
+
const r_list=
|
|
476
|
+
[
|
|
477
|
+
{ value: "0", label: "No Sessions Availble" },
|
|
478
|
+
{ value: "1", label: "Ready For Booking" },
|
|
479
|
+
{ value: "2", label: "No Sessions Availble" }
|
|
480
|
+
];
|
|
481
|
+
return r_list;
|
|
482
|
+
};
|
|
483
|
+
static get_stock_by_value = (stock_val) => {
|
|
484
|
+
switch(stock_val)
|
|
485
|
+
{
|
|
486
|
+
case "0":
|
|
487
|
+
return 'No Sessions Availble';
|
|
488
|
+
break;
|
|
489
|
+
case "1":
|
|
490
|
+
return 'Ready For Booking';
|
|
491
|
+
break;
|
|
492
|
+
case "2":
|
|
493
|
+
return 'No Sessions Availble';
|
|
494
|
+
break;
|
|
495
|
+
}
|
|
496
|
+
};
|
|
497
|
+
|
|
355
498
|
static get_test = (title,option) =>{
|
|
356
499
|
[title,option] = Field_Logic.get_option_title(title,option);
|
|
357
500
|
option = Field_Logic.get_option(DataType.SERVICE,option?option:{});
|
|
@@ -392,6 +535,10 @@ class Service_Logic {
|
|
|
392
535
|
};
|
|
393
536
|
}
|
|
394
537
|
class Content_Logic {
|
|
538
|
+
static url_get_content = (app_id,url,key,param) => {
|
|
539
|
+
let action_url="item/get_content/"+key;
|
|
540
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
541
|
+
};
|
|
395
542
|
static get_test = (title,option) =>{
|
|
396
543
|
[title,option] = Field_Logic.get_option_title(title,option);
|
|
397
544
|
option = Field_Logic.get_option(DataType.CONTENT,option?option:{});
|
|
@@ -429,6 +576,16 @@ class Content_Logic {
|
|
|
429
576
|
};
|
|
430
577
|
}
|
|
431
578
|
class Template_Logic {
|
|
579
|
+
static TYPE_PAGE_PRIMARY='primary';
|
|
580
|
+
static TYPE_PAGE_HEADER='header';
|
|
581
|
+
static TYPE_PAGE_NAVIGATION='navigation';
|
|
582
|
+
static TYPE_PAGE_BODY='body';
|
|
583
|
+
static TYPE_PAGE_FOOTER='footer';
|
|
584
|
+
|
|
585
|
+
static url_get_template = (app_id,url,key,param) => {
|
|
586
|
+
let action_url="item/get_template/"+key;
|
|
587
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
588
|
+
};
|
|
432
589
|
static get_test = (title,option) =>{
|
|
433
590
|
[title,option] = Field_Logic.get_option_title(title,option);
|
|
434
591
|
option = Field_Logic.get_option(DataType.TEMPLATE,option?option:{});
|
|
@@ -437,6 +594,19 @@ class Template_Logic {
|
|
|
437
594
|
};
|
|
438
595
|
}
|
|
439
596
|
class Blog_Post_Logic {
|
|
597
|
+
static url_detail = (app_id,url,key,param) => {
|
|
598
|
+
let action_url="blog_post/detail/"+key;
|
|
599
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
600
|
+
};
|
|
601
|
+
static url_home = (app_id,url,param) => {
|
|
602
|
+
let action_url="blog_post";
|
|
603
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
604
|
+
};
|
|
605
|
+
static url_search = (app_id,url,param) => {
|
|
606
|
+
let action_url="blog_post/search";
|
|
607
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
608
|
+
};
|
|
609
|
+
|
|
440
610
|
static get_test = (title,option) =>{
|
|
441
611
|
[title,option] = Field_Logic.get_option_title(title,option);
|
|
442
612
|
option = Field_Logic.get_option(DataType.BLOG_POST,option?option:{});
|
|
@@ -478,6 +648,18 @@ class Blog_Post_Logic {
|
|
|
478
648
|
};
|
|
479
649
|
}
|
|
480
650
|
class Gallery_Logic {
|
|
651
|
+
static url_detail = (app_id,url,key,param) => {
|
|
652
|
+
let action_url="gallery/detail/"+key;
|
|
653
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
654
|
+
};
|
|
655
|
+
static url_home = (app_id,url,param) => {
|
|
656
|
+
let action_url="gallery";
|
|
657
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
658
|
+
};
|
|
659
|
+
static url_search = (app_id,url,param) => {
|
|
660
|
+
let action_url="gallery/search";
|
|
661
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
662
|
+
};
|
|
481
663
|
static get_test = (title,option) =>{
|
|
482
664
|
[title,option] = Field_Logic.get_option_title(title,option);
|
|
483
665
|
option = Field_Logic.get_option(DataType.GALLERY,option?option:{});
|
|
@@ -497,6 +679,45 @@ class Gallery_Logic {
|
|
|
497
679
|
};
|
|
498
680
|
|
|
499
681
|
class Event_Logic {
|
|
682
|
+
static url_detail = (app_id,url,key,param) => {
|
|
683
|
+
let action_url="event/detail/"+key;
|
|
684
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
685
|
+
};
|
|
686
|
+
static url_home = (app_id,url,param) => {
|
|
687
|
+
let action_url="event";
|
|
688
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
689
|
+
};
|
|
690
|
+
static url_search = (app_id,url,param) => {
|
|
691
|
+
let action_url="event/search";
|
|
692
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
693
|
+
};
|
|
694
|
+
static get_stock_list = () => {
|
|
695
|
+
const r_list=
|
|
696
|
+
[
|
|
697
|
+
{ value: "0", label: "Sold Out" },
|
|
698
|
+
{ value: "1", label: "Less Than 25 Tickets Remaining" },
|
|
699
|
+
{ value: "2", label: "Tickets Are Availble" },
|
|
700
|
+
{ value: "3", label: "Sold Out" },
|
|
701
|
+
];
|
|
702
|
+
return r_list;
|
|
703
|
+
};
|
|
704
|
+
static get_stock_by_value = (stock_val) => {
|
|
705
|
+
switch(stock_val)
|
|
706
|
+
{
|
|
707
|
+
case "0":
|
|
708
|
+
return 'Sold Out';
|
|
709
|
+
break;
|
|
710
|
+
case "1":
|
|
711
|
+
return 'Less Than 25 Tickets Remaining';
|
|
712
|
+
break;
|
|
713
|
+
case "2":
|
|
714
|
+
return 'Tickets Are Availble';
|
|
715
|
+
break;
|
|
716
|
+
case "3":
|
|
717
|
+
return 'Sold Out';
|
|
718
|
+
break;
|
|
719
|
+
}
|
|
720
|
+
};
|
|
500
721
|
static get_test = (title,option) =>{
|
|
501
722
|
[title,option] = Field_Logic.get_option_title(title,option);
|
|
502
723
|
option = Field_Logic.get_option(DataType.EVENT,option?option:{});
|
|
@@ -554,22 +775,120 @@ class Event_Logic {
|
|
|
554
775
|
};
|
|
555
776
|
}
|
|
556
777
|
class Field_Logic {
|
|
557
|
-
static
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
static
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
778
|
+
static TYPE_FIELD_VALUE_TEXT="text";
|
|
779
|
+
static TYPE_FIELD_VALUE_NOTE="note";
|
|
780
|
+
static TYPE_FIELD_VALUE_IMAGE="image";
|
|
781
|
+
static TYPE_FIELD_VALUE_LIST="list";
|
|
782
|
+
static url_copy = (app_id,url,data_type,id,param) => {
|
|
783
|
+
let action_url = "main/crud/copy/"+data_type + "/" + id;
|
|
784
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
785
|
+
};
|
|
786
|
+
static url_delete = (app_id,url,data_type,id,param) => {
|
|
787
|
+
let action_url = "main/crud/delete/"+data_type + "/" + id;
|
|
788
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
789
|
+
};
|
|
790
|
+
static url_delete_check_protection = (app_id,url,data_type,id,param) => {
|
|
791
|
+
let action_url = "main/crud/delete_item_check_protection/"+data_type + "/" + id;
|
|
792
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
793
|
+
};
|
|
794
|
+
static url_delete_search = (app_id,url,data_type,param) => {
|
|
795
|
+
let action_url = "main/crud/delete_list/"+data_type;
|
|
796
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
797
|
+
};
|
|
798
|
+
static url_get = (app_id,url,data_type,key,param) => {
|
|
799
|
+
let action_url= "main/crud/get/"+data_type + "/" + key;
|
|
800
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
801
|
+
};
|
|
802
|
+
static url_get_parent_top = (app_id,url,data_type,id,param) => {
|
|
803
|
+
let action_url = "main/crud/get_parent_top/"+data_type+"/"+id;
|
|
804
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
805
|
+
};
|
|
806
|
+
static url_search = (app_id,url,data_type,param) => {
|
|
807
|
+
let action_url = "main/crud/search/"+data_type;
|
|
808
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
809
|
+
};
|
|
810
|
+
static url_post = (app_id,url,data_type,id,param) => {
|
|
811
|
+
let action_url = "main/crud/post/"+data_type + "/" + id;
|
|
812
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
813
|
+
};
|
|
814
|
+
static url_post_list = (app_id,url,param) => {
|
|
815
|
+
let action_url = "main/crud/post_list";
|
|
816
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
817
|
+
};
|
|
818
|
+
static url_post_field_value = (app_id,url,item_data_type,parent_item_id,value_id,param) => {
|
|
819
|
+
let action_url="item/post_field_value/"+item_data_type+"/"+parent_item_id;
|
|
820
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
821
|
+
};
|
|
822
|
+
static url_get_custom_field = (app_id,url,data_type,key,param) => {
|
|
823
|
+
let action_url="item/get_custom_field/"+data_type+"/"+key;
|
|
824
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
825
|
+
};
|
|
826
|
+
static get_field_value = (item_data_type,item_id,value_type,value_id,value,value_list) => {
|
|
827
|
+
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};
|
|
828
|
+
};
|
|
829
|
+
static get_item_field_value_type_list = () => {
|
|
830
|
+
return [
|
|
831
|
+
{value:'text',label:'Text'},
|
|
832
|
+
{value:'note',label:'Note'},
|
|
833
|
+
{value:'image',label:'Image'},
|
|
834
|
+
{value:'list',label:'List'},
|
|
835
|
+
];
|
|
836
|
+
};
|
|
837
|
+
static get_field_value_value = (value_type,item,value_id) =>{
|
|
838
|
+
switch(value_type){
|
|
839
|
+
case Field_Logic.TYPE_FIELD_VALUE_TEXT:
|
|
840
|
+
case Field_Logic.TYPE_FIELD_VALUE_NOTE:
|
|
841
|
+
case Field_Logic.TYPE_FIELD_VALUE_IMAGE:
|
|
842
|
+
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)] : "";
|
|
843
|
+
break;
|
|
844
|
+
case Field_Logic.TYPE_FIELD_VALUE_LIST:
|
|
845
|
+
let r_list = [];
|
|
846
|
+
for(let a=0;a<30;a++){
|
|
847
|
+
if(!Str.check_is_null(item[Field_Logic.get_field_value_title(value_type,value_id,a+1)])){
|
|
848
|
+
r_list.push(item[Field_Logic.get_field_value_title(value_type,value_id,a+1)]);
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
return r_list;
|
|
852
|
+
break;
|
|
853
|
+
default:
|
|
854
|
+
return "";
|
|
855
|
+
};
|
|
856
|
+
}
|
|
857
|
+
static get_field_value_title = (value_type,value_id,row_id) =>{
|
|
858
|
+
let type_str = '';
|
|
859
|
+
switch(value_type){
|
|
860
|
+
case Field_Logic.TYPE_FIELD_VALUE_TEXT:
|
|
861
|
+
return 'text'+'_value_'+value_id;
|
|
862
|
+
break;
|
|
863
|
+
case Field_Logic.TYPE_FIELD_VALUE_NOTE:
|
|
864
|
+
return 'note'+'_value_'+value_id;
|
|
865
|
+
break;
|
|
866
|
+
case Field_Logic.TYPE_FIELD_VALUE_IMAGE:
|
|
867
|
+
return 'image'+'_value_'+value_id;
|
|
868
|
+
break;
|
|
869
|
+
case Field_Logic.TYPE_FIELD_VALUE_LIST:
|
|
870
|
+
return 'list'+'_value_'+value_id +'_row_'+row_id;
|
|
871
|
+
break;
|
|
872
|
+
default:
|
|
873
|
+
return "";
|
|
874
|
+
};
|
|
875
|
+
}
|
|
876
|
+
static get_test_cost(){
|
|
877
|
+
return String(Num.get_id(999)) + "." + String(Num.get_id(99));
|
|
878
|
+
}
|
|
879
|
+
static get_test_note = () => {
|
|
880
|
+
return "Note "+String(Num.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.";
|
|
881
|
+
}
|
|
882
|
+
static get_test = (title,option) =>{
|
|
883
|
+
option = !Obj.check_is_empty(option) ? option : {};
|
|
884
|
+
let item = {};
|
|
885
|
+
if(option.get_blank == true){
|
|
886
|
+
option.category_title = "";
|
|
887
|
+
item = {
|
|
888
|
+
title:title,
|
|
889
|
+
title_url:title,
|
|
890
|
+
title_url:Str.get_title_url(title),
|
|
891
|
+
setting_visible:"1",
|
|
573
892
|
}
|
|
574
893
|
}else{
|
|
575
894
|
item = {
|
|
@@ -766,6 +1085,7 @@ class Field_Logic {
|
|
|
766
1085
|
|
|
767
1086
|
}
|
|
768
1087
|
class FieldType {
|
|
1088
|
+
/*
|
|
769
1089
|
static APP_ID='app_id';
|
|
770
1090
|
static ID='id';
|
|
771
1091
|
static DATA_TYPE='data_type';
|
|
@@ -789,112 +1109,8 @@ class FieldType {
|
|
|
789
1109
|
static SOURCE_TOP_DATA_TYPE='source_top_data_type';
|
|
790
1110
|
static DATE_CREATE='date_create';
|
|
791
1111
|
static DATE_SAVE='date_save';
|
|
792
|
-
|
|
793
|
-
static USER_ROLE_SUPER_ADMIN='super_admin';
|
|
794
|
-
static USER_ROLE_ADMIN='admin';
|
|
795
|
-
static USER_ROLE_MANAGER='manager';
|
|
796
|
-
static USER_ROLE_USER='user';
|
|
797
|
-
static USER_ROLE_GUEST='guest';
|
|
798
|
-
|
|
799
|
-
static STAT_VIEW_ADD_ID='1';
|
|
800
|
-
static STAT_LIKE_ADD_ID='2';
|
|
801
|
-
static STAT_FAVORITE_ADD_ID='3';
|
|
802
|
-
static STAT_CART_ADD_ID='4';
|
|
803
|
-
static STAT_ORDER_ADD_ID='5';
|
|
804
|
-
static STAT_REVIEW_ADD_ID='6';
|
|
805
|
-
|
|
806
|
-
/*
|
|
807
|
-
static KEY_ADMIN="key_admin";
|
|
808
|
-
static KEY_APP_ID="key_app_id";
|
|
809
|
-
static KEY_TEMPLATE="key_template";
|
|
810
|
-
static KEY_CART="key_cart";
|
|
811
|
-
static KEY_ORDER="key_order";
|
|
812
|
-
static KEY_USER="key_user";
|
|
813
1112
|
*/
|
|
814
1113
|
|
|
815
|
-
static ORDER_NUMBER="OR-";
|
|
816
|
-
static CART_NUMBER="CA-";
|
|
817
|
-
static TRANSACTION_ID="TR-";
|
|
818
|
-
|
|
819
|
-
static ORDER_PAYMENT_STATUS_OPEN="Open";
|
|
820
|
-
static ORDER_PAYMENT_STATUS_COMPLETE="Complete";
|
|
821
|
-
|
|
822
|
-
static PAYMENT_PLAN_TYPE_PENDING="Pending";
|
|
823
|
-
static PAYMENT_PLAN_TYPE_1="1 Payment";
|
|
824
|
-
static PAYMENT_PLAN_TYPE_2="2 Payments";
|
|
825
|
-
static PAYMENT_PLAN_TYPE_3="3 Payments";
|
|
826
|
-
static PAYMENT_PLAN_TYPE_4="4 Payments";
|
|
827
|
-
|
|
828
|
-
static PAYMENT_METHOD_STRIPE="Stripe";
|
|
829
|
-
static PAYMENT_METHOD_CASH="Cash";
|
|
830
|
-
static PAYMENT_METHOD_OTHER="Other";
|
|
831
|
-
static PAYMENT_METHOD_TEST="Test";
|
|
832
|
-
|
|
833
|
-
static APP_TYPE_MOBILE="Mobile";
|
|
834
|
-
static APP_TYPE_WEBSITE="Website";
|
|
835
|
-
static APP_TYPE_LANDING="Landing";
|
|
836
|
-
|
|
837
|
-
static DATA_SOURCE_CACHE="cache";
|
|
838
|
-
static DATA_SOURCE_DATABASE="database";
|
|
839
|
-
static DATA_SOURCE_SERVER="server";
|
|
840
|
-
static DATA_SOURCE_NOT_FOUND="not_found";
|
|
841
|
-
|
|
842
|
-
static ENV_TEST="test";
|
|
843
|
-
static ENV_STAGE="stage";
|
|
844
|
-
static ENV_PRODUCTION="production";
|
|
845
|
-
|
|
846
|
-
static ACTIVITY_TYPE_LOGIN="login";
|
|
847
|
-
static ACTIVITY_TYPE_REGISTER="register";
|
|
848
|
-
|
|
849
|
-
static ITEM_FIELD_VALUE_TYPE_TEXT="text";
|
|
850
|
-
static ITEM_FIELD_VALUE_TYPE_NOTE="note";
|
|
851
|
-
static ITEM_FIELD_VALUE_TYPE_IMAGE="image";
|
|
852
|
-
static ITEM_FIELD_VALUE_TYPE_LIST="list";
|
|
853
|
-
|
|
854
|
-
static IMAGE_SIZE_THUMB="thumb";
|
|
855
|
-
static IMAGE_SIZE_MID="mid";
|
|
856
|
-
static IMAGE_SIZE_LARGE="large";
|
|
857
|
-
static IMAGE_SIZE_SQUARE_THUMB="squre_thumb";
|
|
858
|
-
static IMAGE_SIZE_SQUARE_MID="squre_mid";
|
|
859
|
-
static IMAGE_SIZE_SQUARE_LARGE="squre_large";
|
|
860
|
-
}
|
|
861
|
-
class Social {
|
|
862
|
-
static FACEBOOK_URL="https://facebook.com/";
|
|
863
|
-
static TWITTER_URL="https://twitter.com/";
|
|
864
|
-
static INSTAGRAM_URL="https://instagram.com/";
|
|
865
|
-
static YOUTUBE_URL="https://youtube.com/";
|
|
866
|
-
static LINKEDIN_URL="https://linkedin.com/";
|
|
867
|
-
}
|
|
868
|
-
class PageType {
|
|
869
|
-
static HOME='home';
|
|
870
|
-
static ABOUT='about';
|
|
871
|
-
static CONTACT='contact';
|
|
872
|
-
static FAQ='faq';
|
|
873
|
-
|
|
874
|
-
static BLOG_POST='blog_post';
|
|
875
|
-
static BLOG_POST_DETAIL='blog_post_detail';
|
|
876
|
-
|
|
877
|
-
static EVENT='event';
|
|
878
|
-
static EVENT_DETAIL='event_detail';
|
|
879
|
-
|
|
880
|
-
static GALLERY='gallery';
|
|
881
|
-
static GALLERY_DETAIL='gallery_detail';
|
|
882
|
-
|
|
883
|
-
static SERVICE='service';
|
|
884
|
-
static SERVICE_DETAIL='service_detail';
|
|
885
|
-
|
|
886
|
-
static PRODUCT='product';
|
|
887
|
-
static PRODUCT_DETAIL='product_detail';
|
|
888
|
-
|
|
889
|
-
static PAGE_LIST = [PageType.HOME,PageType.ABOUT,PageType.CONTACT,PageType.FAQ,PageType.BLOG_POST,PageType.EVENT,PageType.GALLERY,PageType.SERVICE,PageType.PRODUCT];
|
|
890
|
-
|
|
891
|
-
static get_title = (data_type) => {
|
|
892
|
-
if(!data_type){
|
|
893
|
-
return "";
|
|
894
|
-
}else{
|
|
895
|
-
return String(Str.get_title(data_type.replaceAll('_',' '))).trim();
|
|
896
|
-
}
|
|
897
|
-
}
|
|
898
1114
|
}
|
|
899
1115
|
class DataType {
|
|
900
1116
|
|
|
@@ -1010,9 +1226,17 @@ class Favorite_Logic {
|
|
|
1010
1226
|
user_id:user_id
|
|
1011
1227
|
});
|
|
1012
1228
|
}
|
|
1229
|
+
static url_search_favorite = (app_id,url,parent_data_type,param) => {
|
|
1230
|
+
let action_url="item/search_favorite/"+parent_data_type;
|
|
1231
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1232
|
+
};
|
|
1233
|
+
static url_post_favorite = (app_id,url,parent_data_type,parent_id,user_id,param) => {
|
|
1234
|
+
let action_url="item/post_favorite/"+parent_data_type+"/"+parent_id+"/"+user_id;
|
|
1235
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1236
|
+
};
|
|
1013
1237
|
static get_favorite_by_list = (favorite_list,item_list) =>{
|
|
1014
1238
|
favorite_list.forEach(item => {
|
|
1015
|
-
const item_match = item_list.find(item_find => item_find.id === item.
|
|
1239
|
+
const item_match = item_list.find(item_find => item_find.id === item.parent_id);
|
|
1016
1240
|
if (item_match) {
|
|
1017
1241
|
item_match.is_favorite = true;
|
|
1018
1242
|
}
|
|
@@ -1036,6 +1260,14 @@ class Favorite_Logic {
|
|
|
1036
1260
|
}
|
|
1037
1261
|
}
|
|
1038
1262
|
class Review_Logic {
|
|
1263
|
+
static url_post_review = (app_id,url,parent_data_type,parent_id,user_id,param) => {
|
|
1264
|
+
let action_url="item/post_review/"+parent_data_type+"/"+parent_id+"/"+user_id;
|
|
1265
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1266
|
+
};
|
|
1267
|
+
static url_search_review = (app_id,url,parent_data_type,page_current,page_size,param) => {
|
|
1268
|
+
let action_url="item/search_review/"+parent_data_type+"/"+page_current+"/"+page_size;
|
|
1269
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1270
|
+
};
|
|
1039
1271
|
static get_new = (parent_data_type,parent_id,user_id,title,comment,rating) =>{
|
|
1040
1272
|
return DataItem.get_new(DataType.REVIEW,0,{
|
|
1041
1273
|
parent_data_type:parent_data_type,
|
|
@@ -1131,270 +1363,19 @@ class DataItem {
|
|
|
1131
1363
|
return get_new_full_item_main(item,parent_item,top_item,option?option:{});
|
|
1132
1364
|
};
|
|
1133
1365
|
}
|
|
1134
|
-
class
|
|
1135
|
-
static
|
|
1136
|
-
let action_url="dashboard/user_home";
|
|
1137
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1138
|
-
};
|
|
1139
|
-
static app_home = (app_id,url,param) => {
|
|
1140
|
-
let action_url="dashboard/app_home";
|
|
1141
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1142
|
-
};
|
|
1143
|
-
}
|
|
1144
|
-
class Blog_Post_Url {
|
|
1145
|
-
static detail = (app_id,url,key,param) => {
|
|
1146
|
-
let action_url="blog_post/detail/"+key;
|
|
1147
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1148
|
-
};
|
|
1149
|
-
static home = (app_id,url,param) => {
|
|
1150
|
-
let action_url="blog_post";
|
|
1151
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1152
|
-
};
|
|
1153
|
-
static search = (app_id,url,param) => {
|
|
1154
|
-
let action_url="blog_post/search";
|
|
1155
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1156
|
-
};
|
|
1157
|
-
}
|
|
1158
|
-
class Product_Url {
|
|
1159
|
-
static detail = (app_id,url,key,param) => {
|
|
1160
|
-
let action_url="product/detail/"+key;
|
|
1161
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1162
|
-
};
|
|
1163
|
-
static home = (app_id,url,param) => {
|
|
1164
|
-
let action_url="product";
|
|
1165
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1166
|
-
};
|
|
1167
|
-
static search = (app_id,url,param) => {
|
|
1168
|
-
let action_url="product/search";
|
|
1169
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1170
|
-
};
|
|
1171
|
-
}
|
|
1172
|
-
class Event_Url {
|
|
1173
|
-
static detail = (app_id,url,key,param) => {
|
|
1174
|
-
let action_url="event/detail/"+key;
|
|
1175
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1176
|
-
};
|
|
1177
|
-
static home = (app_id,url,param) => {
|
|
1178
|
-
let action_url="event";
|
|
1179
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1180
|
-
};
|
|
1181
|
-
static search = (app_id,url,param) => {
|
|
1182
|
-
let action_url="event/search";
|
|
1183
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1184
|
-
};
|
|
1185
|
-
}
|
|
1186
|
-
class Service_Url {
|
|
1187
|
-
static detail = (app_id,url,key,param) => {
|
|
1188
|
-
let action_url="service/detail/"+key;
|
|
1189
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1190
|
-
};
|
|
1191
|
-
static home = (app_id,url,param) => {
|
|
1192
|
-
let action_url="service/search";
|
|
1193
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1194
|
-
};
|
|
1195
|
-
static search = (app_id,url,param) => {
|
|
1196
|
-
let action_url="service/search";
|
|
1197
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1198
|
-
};
|
|
1199
|
-
}
|
|
1200
|
-
class Gallery_Url {
|
|
1201
|
-
static detail = (app_id,url,key,param) => {
|
|
1202
|
-
let action_url="gallery/detail/"+key;
|
|
1203
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1204
|
-
};
|
|
1205
|
-
static home = (app_id,url,param) => {
|
|
1206
|
-
let action_url="gallery";
|
|
1207
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1208
|
-
};
|
|
1209
|
-
static search = (app_id,url,param) => {
|
|
1210
|
-
let action_url="gallery/search";
|
|
1211
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1212
|
-
};
|
|
1213
|
-
}
|
|
1214
|
-
class User_Url {
|
|
1215
|
-
static info = (app_id,url,param) => {
|
|
1216
|
-
let action_url="user/info/";
|
|
1217
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1218
|
-
};
|
|
1219
|
-
static register = (app_id,url,param) => {
|
|
1220
|
-
let action_url="user/register";
|
|
1221
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1222
|
-
};
|
|
1223
|
-
static login = (app_id,url,param) => {
|
|
1224
|
-
let action_url="user/login";
|
|
1225
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1226
|
-
};
|
|
1227
|
-
static logout = (app_id,url,param) => {
|
|
1228
|
-
let action_url="user/logout";
|
|
1229
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1230
|
-
};
|
|
1231
|
-
}
|
|
1232
|
-
class Image_Url {
|
|
1233
|
-
static post = (app_id,url,param) => {
|
|
1234
|
-
let action_url="main/image/post";
|
|
1235
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1236
|
-
};
|
|
1237
|
-
static post_cdn = (app_id,url,param) => {
|
|
1238
|
-
let action_url="main/image/post_cdn";
|
|
1239
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1240
|
-
};
|
|
1241
|
-
}
|
|
1242
|
-
class Item_Url {
|
|
1243
|
-
static delete_order = (app_id,url,id,param) => {
|
|
1244
|
-
let action_url="item/delete_order/"+id;
|
|
1245
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1246
|
-
};
|
|
1247
|
-
static delete_cart = (app_id,url,id,param) => {
|
|
1248
|
-
let action_url="item/delete_cart/"+id;
|
|
1249
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1250
|
-
};
|
|
1251
|
-
static get_cart = (app_id,url,cart_number,param) => {
|
|
1252
|
-
let action_url="item/get_cart/"+cart_number;
|
|
1253
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1254
|
-
};
|
|
1255
|
-
static get_template = (app_id,url,key,param) => {
|
|
1256
|
-
let action_url="item/get_template/"+key;
|
|
1257
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1258
|
-
};
|
|
1259
|
-
static get_content = (app_id,url,key,param) => {
|
|
1260
|
-
let action_url="item/get_content/"+key;
|
|
1261
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1262
|
-
};
|
|
1263
|
-
static get_custom_field = (app_id,url,data_type,key,param) => {
|
|
1264
|
-
let action_url="item/get_custom_field/"+data_type+"/"+key;
|
|
1265
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1266
|
-
};
|
|
1267
|
-
static get_order = (app_id,url,order_number,param) => {
|
|
1268
|
-
let action_url="item/get_order/"+order_number;
|
|
1269
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1270
|
-
};
|
|
1271
|
-
static post_cart = (app_id,url,parent_data_type,param) => {
|
|
1272
|
-
let action_url="item/post_cart/"+parent_data_type;
|
|
1273
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1274
|
-
};
|
|
1275
|
-
static post_cms = (app_id,url,data_type,id,param) => {
|
|
1276
|
-
let action_url = "item/post_cms/"+data_type+"/"+id;
|
|
1277
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1278
|
-
};
|
|
1279
|
-
static post_favorite = (app_id,url,parent_data_type,parent_id,user_id,param) => {
|
|
1280
|
-
let action_url="item/post_favorite/"+parent_data_type+"/"+parent_id+"/"+user_id;
|
|
1281
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1282
|
-
};
|
|
1283
|
-
static post_field_value = (app_id,url,item_data_type,parent_item_id,value_id,param) => {
|
|
1284
|
-
let action_url="item/post_field_value/"+item_data_type+"/"+parent_item_id;
|
|
1285
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1286
|
-
};
|
|
1287
|
-
static post_review = (app_id,url,parent_data_type,parent_id,user_id,param) => {
|
|
1288
|
-
let action_url="item/post_review/"+parent_data_type+"/"+parent_id+"/"+user_id;
|
|
1289
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1290
|
-
};
|
|
1291
|
-
static post_order = (app_id,url,param) => {
|
|
1292
|
-
let action_url="item/post_order";
|
|
1293
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1294
|
-
};
|
|
1295
|
-
static search_activity = (app_id,url,param) => {
|
|
1296
|
-
let action_url="item/search_activity";
|
|
1297
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1298
|
-
};
|
|
1299
|
-
static search_favorite = (app_id,url,parent_data_type,param) => {
|
|
1300
|
-
let action_url="item/search_favorite/"+parent_data_type;
|
|
1301
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1302
|
-
};
|
|
1303
|
-
static search_review = (app_id,url,parent_data_type,page_current,page_size,param) => {
|
|
1304
|
-
let action_url="item/search_review/"+parent_data_type+"/"+page_current+"/"+page_size;
|
|
1305
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1306
|
-
};
|
|
1307
|
-
static search_cart = (app_id,url,parent_data_type,param) => {
|
|
1308
|
-
let action_url="item/search_cart/"+parent_data_type;
|
|
1309
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1310
|
-
};
|
|
1311
|
-
static search_order = (app_id,url,parent_data_type,param) => {
|
|
1312
|
-
let action_url="item/search_order/"+parent_data_type;
|
|
1313
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1314
|
-
};
|
|
1315
|
-
}
|
|
1316
|
-
class Category_Url {
|
|
1317
|
-
static detail = (app_id,url,key,param) => {
|
|
1366
|
+
class Category_Logic {
|
|
1367
|
+
static url_detail = (app_id,url,key,param) => {
|
|
1318
1368
|
let action_url="category/detail/"+key;
|
|
1319
1369
|
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1320
1370
|
};
|
|
1321
|
-
static
|
|
1371
|
+
static url_home = (app_id,url,param) => {
|
|
1322
1372
|
let action_url="category";
|
|
1323
1373
|
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1324
1374
|
};
|
|
1325
|
-
static
|
|
1375
|
+
static url_search = (app_id,url,param) => {
|
|
1326
1376
|
let action_url="category/search";
|
|
1327
1377
|
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1328
1378
|
};
|
|
1329
|
-
}
|
|
1330
|
-
class Page_Url {
|
|
1331
|
-
static get = (app_id,url,title_url,param) => {
|
|
1332
|
-
let action_url="page/get/"+title_url;
|
|
1333
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1334
|
-
};
|
|
1335
|
-
static home = (app_id,url,param) => {
|
|
1336
|
-
let action_url="page/home";
|
|
1337
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1338
|
-
};
|
|
1339
|
-
static about = (app_id,url,param) => {
|
|
1340
|
-
let action_url="page/about";
|
|
1341
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1342
|
-
};
|
|
1343
|
-
static contact = (app_id,url,param) => {
|
|
1344
|
-
let action_url="page/contact";
|
|
1345
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1346
|
-
};
|
|
1347
|
-
static faq = (app_id,url,key,param) => {
|
|
1348
|
-
let action_url="page/faq/"+key;
|
|
1349
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1350
|
-
};
|
|
1351
|
-
}
|
|
1352
|
-
class Url{
|
|
1353
|
-
static copy = (app_id,url,data_type,id,param) => {
|
|
1354
|
-
let action_url = "main/crud/copy/"+data_type + "/" + id;
|
|
1355
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1356
|
-
};
|
|
1357
|
-
static delete = (app_id,url,data_type,id,param) => {
|
|
1358
|
-
let action_url = "main/crud/delete/"+data_type + "/" + id;
|
|
1359
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1360
|
-
};
|
|
1361
|
-
static delete_check_protection = (app_id,url,data_type,id,param) => {
|
|
1362
|
-
let action_url = "main/crud/delete_item_check_protection/"+data_type + "/" + id;
|
|
1363
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1364
|
-
};
|
|
1365
|
-
static delete_search = (app_id,url,data_type,param) => {
|
|
1366
|
-
let action_url = "main/crud/delete_list/"+data_type;
|
|
1367
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1368
|
-
};
|
|
1369
|
-
static url = (app_id,url,action_url,param) => {
|
|
1370
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1371
|
-
}
|
|
1372
|
-
static get = (app_id,url,data_type,key,param) => {
|
|
1373
|
-
let action_url= "main/crud/get/"+data_type + "/" + key;
|
|
1374
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1375
|
-
};
|
|
1376
|
-
static get_parent_top = (app_id,url,data_type,id,param) => {
|
|
1377
|
-
let action_url = "main/crud/get_parent_top/"+data_type+"/"+id;
|
|
1378
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1379
|
-
};
|
|
1380
|
-
static search = (app_id,url,data_type,param) => {
|
|
1381
|
-
let action_url = "main/crud/search/"+data_type;
|
|
1382
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1383
|
-
};
|
|
1384
|
-
static upload_file = (app_id,url,data_type,id,param) => {
|
|
1385
|
-
let action_url = "main/crud/post/"+data_type + "/" + id;
|
|
1386
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1387
|
-
};
|
|
1388
|
-
static post = (app_id,url,data_type,id,param) => {
|
|
1389
|
-
let action_url = "main/crud/post/"+data_type + "/" + id;
|
|
1390
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1391
|
-
};
|
|
1392
|
-
static post_list = (app_id,url,param) => {
|
|
1393
|
-
let action_url = "main/crud/post_list";
|
|
1394
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1395
|
-
};
|
|
1396
|
-
}
|
|
1397
|
-
class Category_Logic {
|
|
1398
1379
|
static get_test = (title,option) =>{
|
|
1399
1380
|
title = (title) ? title : "Category 1";
|
|
1400
1381
|
option = Field_Logic.get_option(DataType.CATEGORY,option?option:{});
|
|
@@ -1481,212 +1462,6 @@ class Category_Logic {
|
|
|
1481
1462
|
}
|
|
1482
1463
|
}
|
|
1483
1464
|
};
|
|
1484
|
-
class CMS {
|
|
1485
|
-
static Tab_Edit_Title_General = 'general';
|
|
1486
|
-
static Tab_Edit_Title_Image = 'image';
|
|
1487
|
-
static Tab_Edit_Title_List = 'list';
|
|
1488
|
-
static Tab_Edit_Title_Value = 'value';
|
|
1489
|
-
static Tab_Edit_Title_Setting = 'setting';
|
|
1490
|
-
static Tab_Edit_Title_Custom_Field = 'custom_field';
|
|
1491
|
-
static Tab_Edit_Title_Audio = 'audio';
|
|
1492
|
-
static Tab_Edit_Title_Video = 'video';
|
|
1493
|
-
static Tab_Edit_Title_Note = 'note';
|
|
1494
|
-
static get_new_query_item_by_item = (item) => {
|
|
1495
|
-
return {
|
|
1496
|
-
id: item.id ? item.id : 0,
|
|
1497
|
-
data_type:item.data_type ? item.data_type : DataType.BLANK,
|
|
1498
|
-
|
|
1499
|
-
parent_id:item.parent_id ? item.parent_id : 0,
|
|
1500
|
-
parent_data_type:item.parent_data_type ? item.parent_data_type : DataType.BLANK,
|
|
1501
|
-
|
|
1502
|
-
top_id:item.top_id ? item.top_id : 0,
|
|
1503
|
-
top_data_type:item.top_data_type ? item.top_data_type : DataType.BLANK
|
|
1504
|
-
}
|
|
1505
|
-
};
|
|
1506
|
-
static get_new_query_item = (item,parent_item,top_item) => {
|
|
1507
|
-
return {
|
|
1508
|
-
id: item.id ? item.id : 0,
|
|
1509
|
-
data_type:item.data_type ? item.data_type : DataType.BLANK,
|
|
1510
|
-
parent_id:parent_item.id ? parent_item.id : 0,
|
|
1511
|
-
parent_data_type:parent_item.data_type ? parent_item.data_type : DataType.BLANK,
|
|
1512
|
-
|
|
1513
|
-
top_id:top_item.id ? top_item.id : 0,
|
|
1514
|
-
top_data_type:top_item.data_type ? top_item.data_type : DataType.BLANK
|
|
1515
|
-
}
|
|
1516
|
-
};
|
|
1517
|
-
static get_query_itemz_by_query = (item) => {
|
|
1518
|
-
return [];
|
|
1519
|
-
};
|
|
1520
|
-
static get_query_item_by_page = (item) => {
|
|
1521
|
-
return { id:item.id ? item.id : 0, data_type:item.data_type ? item.data_type : DataType.BLANK };
|
|
1522
|
-
};
|
|
1523
|
-
static get_query_parent_item_by_page = (parent_item) => {
|
|
1524
|
-
return { id:parent_item.id ? parent_item.id : 0, data_type:parent_item.data_type ? parent_item.data_type : DataType.BLANK };
|
|
1525
|
-
};
|
|
1526
|
-
static get_query_top_item_by_page = (top_item) => {
|
|
1527
|
-
return { id:top_item.id ? top_item.id : 0, data_type:top_item.data_type ? top_item.data_type : DataType.BLANK };
|
|
1528
|
-
};
|
|
1529
|
-
static get_query_item_by_query = (query) => {
|
|
1530
|
-
return { id:query.get('id') ? query.get('id') : 0, data_type:query.get('data_type') ? query.get('data_type') : DataType.BLANK } ;
|
|
1531
|
-
};
|
|
1532
|
-
static get_query_parent_item_by_query = (query) => {
|
|
1533
|
-
return { id:query.get('parent_id') ? query.get('parent_id') : 0, data_type:query.get('parent_data_type') ? query.get('parent_data_type') : DataType.BLANK } ;
|
|
1534
|
-
};
|
|
1535
|
-
static get_query_top_item_by_query = (query) => {
|
|
1536
|
-
return { id:query.get('top_id') ? query.get('top_id') : 0, data_type:query.get('top_data_type') ? query.get('top_data_type') : DataType.BLANK } ;
|
|
1537
|
-
};
|
|
1538
|
-
static get_sub_page_title = (title) => {
|
|
1539
|
-
switch(title)
|
|
1540
|
-
{
|
|
1541
|
-
case CMS.Tab_Edit_Title_General:
|
|
1542
|
-
return 'General';
|
|
1543
|
-
break;
|
|
1544
|
-
case CMS.Tab_Edit_Title_Image:
|
|
1545
|
-
return 'Images';
|
|
1546
|
-
break;
|
|
1547
|
-
case CMS.Tab_Edit_Title_Value:
|
|
1548
|
-
return 'Values';
|
|
1549
|
-
break;
|
|
1550
|
-
case CMS.Tab_Edit_Title_Setting:
|
|
1551
|
-
return 'Settings';
|
|
1552
|
-
break;
|
|
1553
|
-
case CMS.Tab_Edit_Title_Note:
|
|
1554
|
-
return 'Note';
|
|
1555
|
-
break;
|
|
1556
|
-
case CMS.Tab_Edit_Title_Audio:
|
|
1557
|
-
return 'Audio';
|
|
1558
|
-
break;
|
|
1559
|
-
case CMS.Tab_Edit_Title_Video:
|
|
1560
|
-
return 'Video';
|
|
1561
|
-
case CMS.Tab_Edit_Title_Custom_Field:
|
|
1562
|
-
return 'Custom Fields';
|
|
1563
|
-
break;
|
|
1564
|
-
default:
|
|
1565
|
-
return 'N/A';
|
|
1566
|
-
break;
|
|
1567
|
-
}
|
|
1568
|
-
}
|
|
1569
|
-
static get_page_url = (url,tab_title,item,parent_item,top_item,parms) => {
|
|
1570
|
-
let r_url="?tab_title="+tab_title
|
|
1571
|
-
+"&id="+item.id
|
|
1572
|
-
+"&data_type="
|
|
1573
|
-
+item.data_type
|
|
1574
|
-
+"&parent_id="
|
|
1575
|
-
+parent_item.id
|
|
1576
|
-
+"&parent_data_type="
|
|
1577
|
-
+parent_item.data_type
|
|
1578
|
-
+"&top_id="
|
|
1579
|
-
+top_item.id
|
|
1580
|
-
+"&top_data_type="
|
|
1581
|
-
+top_item.data_type;
|
|
1582
|
-
if(parms){
|
|
1583
|
-
r_url = r_url + parms;
|
|
1584
|
-
}
|
|
1585
|
-
return url+r_url;
|
|
1586
|
-
}
|
|
1587
|
-
}
|
|
1588
|
-
class Stock {
|
|
1589
|
-
static get_event_stock_list = () => {
|
|
1590
|
-
const r_list=
|
|
1591
|
-
[
|
|
1592
|
-
{ value: "0", label: "Sold Out" },
|
|
1593
|
-
{ value: "1", label: "Less Than 25 Tickets Remaining" },
|
|
1594
|
-
{ value: "2", label: "Tickets Are Availble" },
|
|
1595
|
-
{ value: "3", label: "Sold Out" },
|
|
1596
|
-
];
|
|
1597
|
-
return r_list;
|
|
1598
|
-
};
|
|
1599
|
-
static get_event_stock_by_value = (stock_val) => {
|
|
1600
|
-
switch(stock_val)
|
|
1601
|
-
{
|
|
1602
|
-
case "0":
|
|
1603
|
-
return 'Sold Out';
|
|
1604
|
-
break;
|
|
1605
|
-
case "1":
|
|
1606
|
-
return 'Less Than 25 Tickets Remaining';
|
|
1607
|
-
break;
|
|
1608
|
-
case "2":
|
|
1609
|
-
return 'Tickets Are Availble';
|
|
1610
|
-
break;
|
|
1611
|
-
case "3":
|
|
1612
|
-
return 'Sold Out';
|
|
1613
|
-
break;
|
|
1614
|
-
}
|
|
1615
|
-
};
|
|
1616
|
-
static get_service_stock_list = () => {
|
|
1617
|
-
const r_list=
|
|
1618
|
-
[
|
|
1619
|
-
{ value: "0", label: "No Sessions Availble" },
|
|
1620
|
-
{ value: "1", label: "Ready For Booking" },
|
|
1621
|
-
{ value: "2", label: "No Sessions Availble" }
|
|
1622
|
-
];
|
|
1623
|
-
return r_list;
|
|
1624
|
-
};
|
|
1625
|
-
static get_service_stock_by_value = (stock_val) => {
|
|
1626
|
-
switch(stock_val)
|
|
1627
|
-
{
|
|
1628
|
-
case "0":
|
|
1629
|
-
return 'No Sessions Availble';
|
|
1630
|
-
break;
|
|
1631
|
-
case "1":
|
|
1632
|
-
return 'Ready For Booking';
|
|
1633
|
-
break;
|
|
1634
|
-
case "2":
|
|
1635
|
-
return 'No Sessions Availble';
|
|
1636
|
-
break;
|
|
1637
|
-
}
|
|
1638
|
-
};
|
|
1639
|
-
static get_product_stock_list = () => {
|
|
1640
|
-
const r_list=
|
|
1641
|
-
[
|
|
1642
|
-
{ value: "0", label: "Out of Stock" },
|
|
1643
|
-
{ value: "1", label: "Only 1 Left" },
|
|
1644
|
-
{ value: "2", label: "Less Than 3 Left" },
|
|
1645
|
-
{ value: "3", label: "Availble" }
|
|
1646
|
-
];
|
|
1647
|
-
return r_list;
|
|
1648
|
-
};
|
|
1649
|
-
static get_product_stock_by_value = (stock_val) => {
|
|
1650
|
-
switch(stock_val)
|
|
1651
|
-
{
|
|
1652
|
-
case "0":
|
|
1653
|
-
return 'Out of Stock';
|
|
1654
|
-
break;
|
|
1655
|
-
case "1":
|
|
1656
|
-
return 'Only 1 Left';
|
|
1657
|
-
break;
|
|
1658
|
-
case "2":
|
|
1659
|
-
return 'Less Than 3 Left';
|
|
1660
|
-
break;
|
|
1661
|
-
case "3":
|
|
1662
|
-
return 'Availble';
|
|
1663
|
-
break;
|
|
1664
|
-
default:
|
|
1665
|
-
return 'Availble';
|
|
1666
|
-
break;
|
|
1667
|
-
}
|
|
1668
|
-
};
|
|
1669
|
-
}
|
|
1670
|
-
class Schedule {
|
|
1671
|
-
static get_start_date_time = (item) => {
|
|
1672
|
-
item.date = (item.date) ? item.date : new Date();
|
|
1673
|
-
item.time = (item.time) ? item.time : new Date();
|
|
1674
|
-
item.start_date = DateTime.get_full_date_by_date_time(item.date,item.time);
|
|
1675
|
-
item.start_time = DateTime.get_full_time_by_date_time(item.date,item.time);
|
|
1676
|
-
item.start_date_time = DateTime.get_full_date_time_by_date_time(item.date,item.time);
|
|
1677
|
-
return item;
|
|
1678
|
-
}
|
|
1679
|
-
static get_start_date_time_by_list = (list) => {
|
|
1680
|
-
for(let a=0;a<list.length;a++){
|
|
1681
|
-
list[a].date = (list[a].date) ? list[a].date : new Date();
|
|
1682
|
-
list[a].time = (list[a].time) ? list[a].time : new Date();
|
|
1683
|
-
list[a].start_date = DateTime.get_full_date_by_date_time(list[a].date,list[a].time);
|
|
1684
|
-
list[a].start_time = DateTime.get_full_time_by_date_time(list[a].date,list[a].time);
|
|
1685
|
-
list[a].start_date_time = DateTime.get_full_date_time_by_date_time(list[a].date,list[a].time);
|
|
1686
|
-
}
|
|
1687
|
-
return list;
|
|
1688
|
-
}
|
|
1689
|
-
};
|
|
1690
1465
|
class Storage {
|
|
1691
1466
|
static get = (window,key) => {
|
|
1692
1467
|
if(!Obj.check_is_empty(window)){
|
|
@@ -1722,6 +1497,24 @@ class Storage {
|
|
|
1722
1497
|
}
|
|
1723
1498
|
}
|
|
1724
1499
|
class User_Logic {
|
|
1500
|
+
static TYPE_ROLE_SUPER_ADMIN='super_admin';
|
|
1501
|
+
static TYPE_ROLE_ADMIN='admin';
|
|
1502
|
+
static TYPE_ROLE_MANAGER='manager';
|
|
1503
|
+
static TYPE_ROLE_USER='user';
|
|
1504
|
+
static TYPE_ROLE_GUEST='guest';
|
|
1505
|
+
|
|
1506
|
+
static url_register = (app_id,url,param) => {
|
|
1507
|
+
let action_url="user/register";
|
|
1508
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1509
|
+
};
|
|
1510
|
+
static url_login = (app_id,url,param) => {
|
|
1511
|
+
let action_url="user/login";
|
|
1512
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1513
|
+
};
|
|
1514
|
+
static url_logout = (app_id,url,param) => {
|
|
1515
|
+
let action_url="user/logout";
|
|
1516
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1517
|
+
};
|
|
1725
1518
|
static get_role_list(){
|
|
1726
1519
|
return [
|
|
1727
1520
|
{value:'admin',label:"Admin"},
|
|
@@ -1732,15 +1525,15 @@ class User_Logic {
|
|
|
1732
1525
|
};
|
|
1733
1526
|
static get_role_title(role_type){
|
|
1734
1527
|
switch(role_type){
|
|
1735
|
-
case
|
|
1528
|
+
case User_Logic.TYPE_ROLE_SUPER_ADMIN:
|
|
1736
1529
|
return "Super Admin";
|
|
1737
|
-
case
|
|
1530
|
+
case User_Logic.TYPE_ROLE_ADMIN:
|
|
1738
1531
|
return "Admin";
|
|
1739
|
-
case
|
|
1532
|
+
case User_Logic.TYPE_ROLE_MANAGER:
|
|
1740
1533
|
return "Manager";
|
|
1741
|
-
case
|
|
1534
|
+
case User_Logic.TYPE_ROLE_USER:
|
|
1742
1535
|
return "User";
|
|
1743
|
-
case
|
|
1536
|
+
case User_Logic.TYPE_ROLE_GUEST:
|
|
1744
1537
|
return "Guest";
|
|
1745
1538
|
}
|
|
1746
1539
|
}
|
|
@@ -1886,6 +1679,33 @@ class Sub_Item_Logic {
|
|
|
1886
1679
|
}
|
|
1887
1680
|
}
|
|
1888
1681
|
class App_Logic {
|
|
1682
|
+
static TYPE_APP_MOBILE="Mobile";
|
|
1683
|
+
static TYPE_APP_WEBSITE="Website";
|
|
1684
|
+
static TYPE_APP_LANDING="Landing";
|
|
1685
|
+
|
|
1686
|
+
static TYPE_DATA_SOURCE_CACHE="cache";
|
|
1687
|
+
static TYPE_DATA_SOURCE_DATABASE="database";
|
|
1688
|
+
static TYPE_DATA_SOURCE_SERVER="server";
|
|
1689
|
+
static TYPE_DATA_SOURCE_NOT_FOUND="not_found";
|
|
1690
|
+
|
|
1691
|
+
static TYPE_ENV_TEST="test";
|
|
1692
|
+
static TYPE_ENV_STAGE="stage";
|
|
1693
|
+
static TYPE_ENV_PRODUCTION="production";
|
|
1694
|
+
|
|
1695
|
+
static TYPE_SOCIAL_URL_FACEBOOK="https://facebook.com/";
|
|
1696
|
+
static TYPE_SOCIAL_URL_TWITTER="https://twitter.com/";
|
|
1697
|
+
static TYPE_SOCIAL_URL_INSTAGRAM="https://instagram.com/";
|
|
1698
|
+
static TYPE_SOCIAL_URL_YOUTUBE="https://youtube.com/";
|
|
1699
|
+
static TYPE_SOCIAL_URL_LINKEDIN="https://linkedin.com/";
|
|
1700
|
+
|
|
1701
|
+
static url_dashboard_user_home = (app_id,url,param) => {
|
|
1702
|
+
let action_url="dashboard/user_home";
|
|
1703
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1704
|
+
};
|
|
1705
|
+
static url_dashboard_app_home = (app_id,url,param) => {
|
|
1706
|
+
let action_url="dashboard/app_home";
|
|
1707
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1708
|
+
};
|
|
1889
1709
|
static get_new = (title,user_id,type,option) =>{
|
|
1890
1710
|
option = Field_Logic.get_option(DataType.APP,option?option:{});
|
|
1891
1711
|
let app = DataItem.get_new(DataType.APP,0);
|
|
@@ -1896,52 +1716,79 @@ class App_Logic {
|
|
|
1896
1716
|
}
|
|
1897
1717
|
}
|
|
1898
1718
|
class Image_Logic {
|
|
1899
|
-
static
|
|
1719
|
+
static TYPE_SIZE_THUMB="thumb";
|
|
1720
|
+
static TYPE_SIZE_MID="mid";
|
|
1721
|
+
static TYPE_SIZE_LARGE="large";
|
|
1722
|
+
static TYPE_SIZE_ORIGINAL="original";
|
|
1723
|
+
static TYPE_SIZE_SQUARE_THUMB="squre_thumb";
|
|
1724
|
+
static TYPE_SIZE_SQUARE_MID="squre_mid";
|
|
1725
|
+
static TYPE_SIZE_SQUARE_LARGE="squre_large";
|
|
1726
|
+
|
|
1727
|
+
static TYPE_RESIZE_NORMAL="normal";
|
|
1728
|
+
static TYPE_RESIZE_SQUARE="squre";
|
|
1729
|
+
static TYPE_RESIZE_NONE="none";
|
|
1730
|
+
|
|
1731
|
+
static url_post = (app_id,url,param) => {
|
|
1732
|
+
let action_url="main/image/post";
|
|
1733
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1734
|
+
};
|
|
1735
|
+
static url_post_cdn = (app_id,url,param) => {
|
|
1736
|
+
let action_url="main/image/post_cdn";
|
|
1737
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1738
|
+
};
|
|
1739
|
+
|
|
1740
|
+
static url = (host,image_filename,size,param) =>{
|
|
1900
1741
|
host = host ? host : "";
|
|
1901
1742
|
image_filename = image_filename ? image_filename : "";
|
|
1902
1743
|
size = size ? size : "";
|
|
1903
1744
|
param = param ? param : "";
|
|
1904
1745
|
return host+"/"+size + "_"+image_filename+param;
|
|
1905
1746
|
}
|
|
1906
|
-
static get_process_list = (upload_dir,image_filename) =>{
|
|
1747
|
+
static get_process_list = (upload_dir,image_filename) =>{
|
|
1907
1748
|
upload_dir = upload_dir ? upload_dir : "";
|
|
1908
1749
|
image_filename = image_filename ? image_filename : "";
|
|
1909
1750
|
return [
|
|
1910
1751
|
{
|
|
1911
|
-
image_filename:
|
|
1912
|
-
path_filename:upload_dir+"/"+
|
|
1752
|
+
image_filename:Image_Logic.TYPE_SIZE_ORIGINAL+"_"+image_filename,
|
|
1753
|
+
path_filename:upload_dir+"/"+Image_Logic.TYPE_SIZE_ORIGINAL+"_"+image_filename,
|
|
1754
|
+
size:0,
|
|
1755
|
+
type_resize:Image_Logic.TYPE_RESIZE_NONE,
|
|
1756
|
+
},
|
|
1757
|
+
{
|
|
1758
|
+
image_filename:Image_Logic.TYPE_SIZE_THUMB+"_"+image_filename,
|
|
1759
|
+
path_filename:upload_dir+"/"+Image_Logic.TYPE_SIZE_THUMB+"_"+image_filename,
|
|
1913
1760
|
size:250,
|
|
1914
|
-
|
|
1761
|
+
type_resize:Image_Logic.TYPE_RESIZE_NORMAL,
|
|
1915
1762
|
},
|
|
1916
1763
|
{
|
|
1917
|
-
image_filename:
|
|
1918
|
-
path_filename:upload_dir+"/"+
|
|
1764
|
+
image_filename:Image_Logic.TYPE_SIZE_MID+"_"+image_filename,
|
|
1765
|
+
path_filename:upload_dir+"/"+Image_Logic.TYPE_SIZE_MID+"_"+image_filename,
|
|
1919
1766
|
size:720,
|
|
1920
|
-
|
|
1767
|
+
type_resize:Image_Logic.TYPE_RESIZE_NORMAL,
|
|
1921
1768
|
},
|
|
1922
1769
|
{
|
|
1923
|
-
image_filename:
|
|
1924
|
-
path_filename:upload_dir+"/"+
|
|
1770
|
+
image_filename:Image_Logic.TYPE_SIZE_LARGE+"_"+image_filename,
|
|
1771
|
+
path_filename:upload_dir+"/"+Image_Logic.TYPE_SIZE_LARGE+"_"+image_filename,
|
|
1925
1772
|
size:1000,
|
|
1926
|
-
|
|
1773
|
+
type_resize:Image_Logic.TYPE_RESIZE_NORMAL,
|
|
1927
1774
|
},
|
|
1928
1775
|
{
|
|
1929
|
-
image_filename:
|
|
1930
|
-
path_filename:upload_dir+"/"+
|
|
1776
|
+
image_filename:Image_Logic.TYPE_SIZE_SQUARE_THUMB+"_"+image_filename,
|
|
1777
|
+
path_filename:upload_dir+"/"+Image_Logic.TYPE_SIZE_SQUARE_THUMB+"_"+image_filename,
|
|
1931
1778
|
size:250,
|
|
1932
|
-
|
|
1779
|
+
type_resize:Image_Logic.TYPE_RESIZE_SQUARE,
|
|
1933
1780
|
},
|
|
1934
1781
|
{
|
|
1935
|
-
image_filename:
|
|
1936
|
-
path_filename:upload_dir+"/"+
|
|
1782
|
+
image_filename:Image_Logic.TYPE_SIZE_SQUARE_MID+"_"+image_filename,
|
|
1783
|
+
path_filename:upload_dir+"/"+Image_Logic.TYPE_SIZE_SQUARE_MID+"_"+image_filename,
|
|
1937
1784
|
size:720,
|
|
1938
|
-
|
|
1785
|
+
type_resize:Image_Logic.TYPE_RESIZE_SQUARE,
|
|
1939
1786
|
},
|
|
1940
1787
|
{
|
|
1941
|
-
image_filename:
|
|
1942
|
-
path_filename:upload_dir+"/"+
|
|
1788
|
+
image_filename:Image_Logic.TYPE_SIZE_SQUARE_LARGE+"_"+image_filename,
|
|
1789
|
+
path_filename:upload_dir+"/"+Image_Logic.TYPE_SIZE_SQUARE_LARGE+"_"+image_filename,
|
|
1943
1790
|
size:1000,
|
|
1944
|
-
|
|
1791
|
+
type_resize:Image_Logic.TYPE_RESIZE_SQUARE,
|
|
1945
1792
|
},
|
|
1946
1793
|
];
|
|
1947
1794
|
}
|
|
@@ -1950,45 +1797,26 @@ module.exports = {
|
|
|
1950
1797
|
App_Logic,
|
|
1951
1798
|
Admin_Logic,
|
|
1952
1799
|
Blog_Post_Logic,
|
|
1953
|
-
Blog_Post_Url,
|
|
1954
|
-
Dashboard_Url,
|
|
1955
1800
|
Cart_Logic,
|
|
1956
1801
|
Category_Logic,
|
|
1957
|
-
Category_Url,
|
|
1958
1802
|
Content_Logic,
|
|
1959
|
-
CMS,
|
|
1960
1803
|
DataItem,
|
|
1961
1804
|
DataType,
|
|
1962
|
-
|
|
1805
|
+
Event_Logic,
|
|
1963
1806
|
Field_Logic,
|
|
1964
|
-
FieldType,
|
|
1965
1807
|
Favorite_Logic,
|
|
1966
1808
|
Gallery_Logic,
|
|
1967
|
-
Gallery_Url,
|
|
1968
1809
|
Item_Logic,
|
|
1969
1810
|
Image_Logic,
|
|
1970
|
-
Image_Url,
|
|
1971
|
-
Item_Url,
|
|
1972
|
-
Event_Logic,
|
|
1973
1811
|
Message,
|
|
1812
|
+
Order_Logic,
|
|
1974
1813
|
Page_Logic,
|
|
1975
|
-
Page_Url,
|
|
1976
|
-
Product_Url,
|
|
1977
|
-
PageType,
|
|
1978
1814
|
Product_Logic,
|
|
1979
1815
|
Review_Logic,
|
|
1980
|
-
Order_Logic,
|
|
1981
1816
|
Service_Logic,
|
|
1982
|
-
Service_Url,
|
|
1983
|
-
Social,
|
|
1984
1817
|
Sub_Item_Logic,
|
|
1985
1818
|
Stat_Logic,
|
|
1986
1819
|
Storage,
|
|
1987
|
-
Schedule,
|
|
1988
|
-
Stock,
|
|
1989
1820
|
Template_Logic,
|
|
1990
|
-
TemplateType,
|
|
1991
|
-
Url,
|
|
1992
|
-
User_Url,
|
|
1993
1821
|
User_Logic,
|
|
1994
1822
|
};
|