biz9-logic 4.8.183 → 4.8.185
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 +17 -82
- package/package.json +1 -1
package/biz9_config
CHANGED
package/index.js
CHANGED
|
@@ -149,47 +149,6 @@ class Template_Logic {
|
|
|
149
149
|
return template;
|
|
150
150
|
};
|
|
151
151
|
}
|
|
152
|
-
class Team_Logic {
|
|
153
|
-
static get_test = (title,option) =>{
|
|
154
|
-
[title,option] = Field_Logic.get_option_title(title,option);
|
|
155
|
-
option = Field_Logic.get_option(DataType.TEAM,option?option:{});
|
|
156
|
-
let team = DataItem.get_new(DataType.TEAM,0,Field_Logic.get_test(title,option));
|
|
157
|
-
team.members = [];
|
|
158
|
-
if(option.get_member){
|
|
159
|
-
for(let a=0;a<option.member_count+1;a++){
|
|
160
|
-
team.members.push(Team_Logic.get_test_member("Full Name " + String(parseInt(a+1)),team,option));
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
return team;
|
|
164
|
-
};
|
|
165
|
-
static get_test_member = (team,title,option) =>{
|
|
166
|
-
[title,option] = Field_Logic.get_option_title(title,option);
|
|
167
|
-
option = Field_Logic.get_option(DataType.TEAM,option?option:{});
|
|
168
|
-
let team_member = DataItem.get_new(DataType.TEAM,team.id,Field_Logic.get_test(title,option));
|
|
169
|
-
team_member.first_name = "First Name "+ Num.get_id();
|
|
170
|
-
team_member.last_name = "Last Name "+ Num.get_id();
|
|
171
|
-
team_member.position = "Position "+ Num.get_id();
|
|
172
|
-
team_member.city = "City "+ Num.get_id();
|
|
173
|
-
team_member.state = "State "+ Num.get_id();
|
|
174
|
-
return team_member;
|
|
175
|
-
};
|
|
176
|
-
static get_test_member_list = (team,option) =>{
|
|
177
|
-
option = Field_Logic.get_option(DataType.TEAM,option?option:{});
|
|
178
|
-
let item_list = [];
|
|
179
|
-
for(let a=0;a<option.member_count+1;a++){
|
|
180
|
-
item_list.push(Team_Logic.get_test_member(team,"Full Name " +parseInt(a+1),option));
|
|
181
|
-
}
|
|
182
|
-
return item_list;
|
|
183
|
-
}
|
|
184
|
-
static get_test_list = (option) =>{
|
|
185
|
-
option = Field_Logic.get_option(DataType.TEAM,option?option:{});
|
|
186
|
-
let item_list = [];
|
|
187
|
-
for(let a=0;a<option.team_count+1;a++){
|
|
188
|
-
item_list.push(Team_Logic.get_test("Team " +parseInt(a+1),option));
|
|
189
|
-
}
|
|
190
|
-
return item_list;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
152
|
class Page_Logic {
|
|
194
153
|
static get_test = (title,option) =>{
|
|
195
154
|
[title,option] = Field_Logic.get_option_title(title,option);
|
|
@@ -629,10 +588,6 @@ class Field_Logic {
|
|
|
629
588
|
if(data_type==DataType.EVENT){
|
|
630
589
|
option.event_count = option.event_count ? option.event_count : 9;
|
|
631
590
|
}
|
|
632
|
-
if(data_type==DataType.TEAM){
|
|
633
|
-
option.get_member = option.get_member ? true : false;
|
|
634
|
-
option.member_count = option.member_count ? option.member_count : 9;
|
|
635
|
-
}
|
|
636
591
|
if(data_type==DataType.FAQ){
|
|
637
592
|
option.question_count = option.question_count ? option.question_count : 9;
|
|
638
593
|
}
|
|
@@ -740,7 +695,6 @@ class Field_Logic {
|
|
|
740
695
|
option.get_business = req.query.get_business ? req.query.get_business : false;
|
|
741
696
|
option.get_template = req.query.get_template ? req.query.get_template : false;
|
|
742
697
|
option.get_page = req.query.get_page ? req.query.get_page : false;
|
|
743
|
-
option.get_team = req.query.get_team ? req.query.get_team : false;
|
|
744
698
|
|
|
745
699
|
return option;
|
|
746
700
|
}
|
|
@@ -771,6 +725,11 @@ class FieldType {
|
|
|
771
725
|
static DATE_CREATE='date_create';
|
|
772
726
|
static DATE_SAVE='date_save';
|
|
773
727
|
|
|
728
|
+
static USER_ROLE_ADMIN='admin';
|
|
729
|
+
static USER_ROLE_MANAGER='manager';
|
|
730
|
+
static USER_ROLE_USER='user';
|
|
731
|
+
static USER_ROLE_GUEST='guest';
|
|
732
|
+
|
|
774
733
|
static STAT_VIEW_ADD_ID='1';
|
|
775
734
|
static STAT_LIKE_ADD_ID='2';
|
|
776
735
|
static STAT_FAVORITE_ADD_ID='3';
|
|
@@ -827,19 +786,6 @@ class PageType {
|
|
|
827
786
|
return String(Str.get_title(data_type.replaceAll('_',' '))).trim();
|
|
828
787
|
}
|
|
829
788
|
}
|
|
830
|
-
static get_item_list = () =>{
|
|
831
|
-
return [
|
|
832
|
-
{title:DataType.get_title(PageType.ABOUT),type:DataType.ABOUT},
|
|
833
|
-
{title:DataType.get_title(PageType.BLOG_POST),type:DataType.BLOG_POST},
|
|
834
|
-
{title:DataType.get_title(PageType.CONTACT),type:DataType.CONTACT},
|
|
835
|
-
{title:DataType.get_title(PageType.EVENT),type:DataType.EVENT},
|
|
836
|
-
{title:DataType.get_title(PageType.GALLERY),type:DataType.GALLERY},
|
|
837
|
-
{title:DataType.get_title(PageType.HOME),type:DataType.HOME},
|
|
838
|
-
{title:DataType.get_title(PageType.TEAM),type:DataType.TEAM},
|
|
839
|
-
{title:DataType.get_title(PageType.PRODUCT),type:DataType.PRODUCT},
|
|
840
|
-
{title:DataType.get_title(PageType.SERVICE),type:DataType.SERVICE}
|
|
841
|
-
]
|
|
842
|
-
};
|
|
843
789
|
static HOME='home';
|
|
844
790
|
static ABOUT='about';
|
|
845
791
|
static CONTACT='contact';
|
|
@@ -915,7 +861,11 @@ class DataType {
|
|
|
915
861
|
static get_data_type_title = (data_type,get_plural) => {
|
|
916
862
|
let r_data_type = (!data_type) ? "" : String(Str.get_title(data_type.replaceAll('_',' ').replaceAll('dt','').replace('biz',''))).trim();
|
|
917
863
|
if(get_plural){
|
|
864
|
+
if(data_type==DataType.GALLERY){
|
|
865
|
+
return 'Galleries';
|
|
866
|
+
}else{
|
|
918
867
|
return r_data_type + "s";
|
|
868
|
+
}
|
|
919
869
|
}else{
|
|
920
870
|
return r_data_type;
|
|
921
871
|
}
|
|
@@ -966,9 +916,9 @@ class DataType {
|
|
|
966
916
|
static get_item_list = () =>{
|
|
967
917
|
return [
|
|
968
918
|
{ title:DataType.get_title(DataType.BLOG_POST),type:DataType.BLOG_POST},
|
|
969
|
-
{ title:DataType.get_title(DataType.GALLERY),type:DataType.GALLERY},
|
|
970
919
|
{ title:DataType.get_title(DataType.EVENT),type:DataType.EVENT},
|
|
971
|
-
{ title:DataType.get_title(DataType.
|
|
920
|
+
{ title:DataType.get_title(DataType.GALLERY),type:DataType.GALLERY},
|
|
921
|
+
{ title:DataType.get_title(DataType.USER),type:DataType.USER},
|
|
972
922
|
{ title:DataType.get_title(DataType.PRODUCT),type:DataType.PRODUCT},
|
|
973
923
|
{ title:DataType.get_title(DataType.SERVICE),type:DataType.SERVICE}
|
|
974
924
|
]
|
|
@@ -1005,7 +955,6 @@ class DataType {
|
|
|
1005
955
|
static SERVICE='service_biz';
|
|
1006
956
|
static STAT='stat_biz';
|
|
1007
957
|
static TEMPLATE='template_biz';
|
|
1008
|
-
static TEAM='team_biz';
|
|
1009
958
|
static USER='user_biz';
|
|
1010
959
|
static VIDEO='video_biz';
|
|
1011
960
|
|
|
@@ -1519,16 +1468,6 @@ class Page_Url {
|
|
|
1519
1468
|
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
1520
1469
|
};
|
|
1521
1470
|
}
|
|
1522
|
-
class Team_Url {
|
|
1523
|
-
static get = (biz9_config,key,params) => {
|
|
1524
|
-
let action_url="team/"+key;
|
|
1525
|
-
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
1526
|
-
};
|
|
1527
|
-
static member = (biz9_config,title_url,params) => {
|
|
1528
|
-
let action_url="team/member/"+title_url;
|
|
1529
|
-
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
1530
|
-
};
|
|
1531
|
-
}
|
|
1532
1471
|
class Url{
|
|
1533
1472
|
static copy = (biz9_config,data_type,id,params) => {
|
|
1534
1473
|
let action_url = "main/crud/copy/"+data_type + "/" + id;
|
|
@@ -1613,14 +1552,13 @@ class Category_Logic {
|
|
|
1613
1552
|
return [
|
|
1614
1553
|
{data_type:DataType.BLOG_POST,value:DataType.BLOG_POST,label:"Blog Posts"},
|
|
1615
1554
|
{data_type:DataType.CATEGORY,value:DataType.CATEGORY,label:"Category"},
|
|
1616
|
-
{data_type:DataType.CUSTOMER,value:DataType.CUSTOMER,label:"Customer"},
|
|
1617
1555
|
{data_type:DataType.CONTENT,value:DataType.CONTENT,label:"Content"},
|
|
1618
|
-
{data_type:DataType.EVENT,value:DataType.EVENT,label:"
|
|
1556
|
+
{data_type:DataType.EVENT,value:DataType.EVENT,label:"Event"},
|
|
1619
1557
|
{data_type:DataType.GALLERY,value:DataType.GALLERY,label:"Gallery"},
|
|
1620
|
-
{data_type:DataType.SERVICE,value:DataType.SERVICE,label:"
|
|
1558
|
+
{data_type:DataType.SERVICE,value:DataType.SERVICE,label:"Service"},
|
|
1559
|
+
{data_type:DataType.USER,value:DataType.USER,label:"User"},
|
|
1621
1560
|
{data_type:DataType.PRODUCT,value:DataType.PRODUCT,label:"Product"},
|
|
1622
1561
|
{data_type:DataType.TEMPLATE,value:DataType.TEMPLATE,label:"Template"},
|
|
1623
|
-
{data_type:DataType.TEAM,value:DataType.TEAM,label:"Team"}
|
|
1624
1562
|
];
|
|
1625
1563
|
};
|
|
1626
1564
|
static get_title_by_type = (data_type) => {
|
|
@@ -1631,9 +1569,6 @@ class Category_Logic {
|
|
|
1631
1569
|
case DataType.CATEGORY:
|
|
1632
1570
|
return "Category";
|
|
1633
1571
|
break;
|
|
1634
|
-
case DataType.CUSTOMER:
|
|
1635
|
-
return "Customer";
|
|
1636
|
-
break;
|
|
1637
1572
|
case DataType.CONTENT:
|
|
1638
1573
|
return "Content";
|
|
1639
1574
|
break;
|
|
@@ -1643,6 +1578,9 @@ class Category_Logic {
|
|
|
1643
1578
|
case DataType.GALLERY:
|
|
1644
1579
|
return "Gallery";
|
|
1645
1580
|
break;
|
|
1581
|
+
case DataType.USER:
|
|
1582
|
+
return "User";
|
|
1583
|
+
break;
|
|
1646
1584
|
case DataType.PAGE:
|
|
1647
1585
|
return "Page";
|
|
1648
1586
|
break;
|
|
@@ -1658,9 +1596,6 @@ class Category_Logic {
|
|
|
1658
1596
|
case DataType.TEMPLATE:
|
|
1659
1597
|
return "Template";
|
|
1660
1598
|
break;
|
|
1661
|
-
case DataType.TEAM:
|
|
1662
|
-
return "Team";
|
|
1663
|
-
break;
|
|
1664
1599
|
default:
|
|
1665
1600
|
return "Blank";
|
|
1666
1601
|
}
|