+ add isUnique attr to 'name' req_depart.meta

+ add сheck the existence of shortcuts шт 010_create_navshortcuts.js
+ add img/initialData/creating_shortcut_console.PNG
+ add img/initialData/desktop_exist_error.png
parent f70f0f5d
......@@ -3,7 +3,6 @@ var
desktopID, folderID, conn = session.connection;
desktopID = conn.lookup('ubm_desktop', 'ID', {expression: 'code', condition: 'equal', values: {code: 'CityReq_desktop'}});
console.info('\tFill `Common dictionary` desktop');
if (!desktopID) {
console.info('\t\tcreate new `City request` desktop');
desktopID = conn.insert({
......@@ -15,63 +14,90 @@ var
}
});
console.log('\t\tcreate `Departments` folder');
folderID = conn.insert({
entity: 'ubm_navshortcut',
fieldList: ['ID'],
execParams: {
desktopID: desktopID,
code: 'req_departments_folder',
caption: 'Departments',
isFolder: true,
isCollapsed:false,
displayOrder: 10
}
});
console.log('\t\t\tcreate `Department` shortcut');
lastID = conn.insert({
fieldList: ['ID'],
entity: 'ubm_navshortcut',
execParams: {
desktopID: desktopID,
parentID: folderID,
code: 'req_depart',
caption: 'Departments',
iconCls: 'fa fa-building-o',
displayOrder: 10,
cmdCode : JSON.stringify({cmdType: 'showList', cmdData: {params:[{ entity: 'req_depart', method: 'select', fieldList: '*'}]}}, null, '\t')
}
});
folderID = conn.lookup('ubm_navshortcut', 'ID', {expression: 'code', condition: 'equal', values: {code: 'req_departments_folder'}});
if (!folderID) {
console.log('\t\tcreate `Departments` folder');
folderID = conn.insert({
entity: 'ubm_navshortcut',
fieldList: ['ID'],
execParams: {
desktopID: desktopID,
code: 'req_departments_folder',
caption: 'Departments',
isFolder: true,
isCollapsed:false,
displayOrder: 10
}
});
console.log('\t\t\tcreate `SubDepartments` shortcut');
lastID = conn.insert({
fieldList: ['ID'],
entity: 'ubm_navshortcut',
execParams: {
desktopID: desktopID,
parentID: folderID,
code: 'req_Subdepart',
caption: 'SubDepartments',
iconCls: 'fa fa-user-circle-o',
displayOrder: 20,
cmdCode : JSON.stringify({cmdType: 'showList', cmdData: {params:[{ entity: 'req_subDepart', method: 'select', fieldList: '*'}]}}, null, '\t')
}
});
lastID = conn.lookup('ubm_navshortcut', 'ID', {expression: 'code', condition: 'equal', values: {code: 'req_depart'}});
if(!lastID) {
console.log('\t\t\tcreate `Department` shortcut');
lastID = conn.insert({
fieldList: ['ID'],
entity: 'ubm_navshortcut',
execParams: {
desktopID: desktopID,
parentID: folderID,
code: 'req_depart',
caption: 'Departments',
iconCls: 'fa fa-building-o',
displayOrder: 10,
cmdCode : JSON.stringify({cmdType: 'showList', cmdData: {params:[{ entity: 'req_depart', method: 'select', fieldList: '*'}]}}, null, '\t')
}
});
}
else {
console.info('\t\tuse existed shortcut with code `req_depart`', lastID);
}
lastID = conn.lookup('ubm_navshortcut', 'ID', {expression: 'code', condition: 'equal', values: {code: 'req_Subdepart'}});
if(!lastID) {
console.log('\t\t\tcreate `SubDepartments` shortcut');
lastID = conn.insert({
fieldList: ['ID'],
entity: 'ubm_navshortcut',
execParams: {
desktopID: desktopID,
parentID: folderID,
code: 'req_Subdepart',
caption: 'SubDepartments',
iconCls: 'fa fa-user-circle-o',
displayOrder: 20,
cmdCode : JSON.stringify({cmdType: 'showList', cmdData: {params:[{ entity: 'req_subDepart', method: 'select', fieldList: '*'}]}}, null, '\t')
}
});
}
else {
console.info('\t\tuse existed shortcut with code `req_subDepart`', lastID);
}
}
else {
console.info('\t\tuse existed folder with code `req_departments_folder`', folderID);
}
console.log('\t\t\tcreate `RequestList` shortcut');
lastID = conn.insert({
fieldList: ['ID'],
entity: 'ubm_navshortcut',
execParams: {
desktopID: desktopID,
code: 'req_reqList',
caption: 'Request list',
iconCls: 'fa fa-clone',
displayOrder: 20,
cmdCode : JSON.stringify({cmdType: 'showList', cmdData: {params:[{ entity: 'req_reqList', method: 'select', fieldList: '*'}]}}, null, '\t')
}
});
lastID = conn.lookup('ubm_navshortcut', 'ID', {expression: 'code', condition: 'equal', values: {code: 'req_reqList'}});
if(!lastID) {
console.log('\t\tcreate `RequestList` shortcut');
lastID = conn.insert({
fieldList: ['ID'],
entity: 'ubm_navshortcut',
execParams: {
desktopID: desktopID,
code: 'req_reqList',
caption: 'Request list',
iconCls: 'fa fa-clone',
displayOrder: 20,
cmdCode : JSON.stringify({cmdType: 'showList', cmdData: {params:[{ entity: 'req_reqList', method: 'select', fieldList: '*'}]}}, null, '\t')
}
});
}
else {
console.info('\t\tuse existed shortcut with code `req_reqList`', lastID);
}
}
else {
console.info('\t\tuse existed desktop with code `CityReq_desktop`', desktopID);
......
......@@ -10,7 +10,8 @@
"caption": "Department Name",
"description": "Department Name",
"allowNull": false,
"isMultiLang": false
"isMultiLang": false,
"isUnique" : true
},
"postAddr": {
"dataType": "String", //must me xml-type
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment