Change the execution condition of scripts in 010_create_navshortcuts.js

parent 5eeb6215
......@@ -13,9 +13,13 @@ var
caption: 'City Requests'
}
});
}
else {
console.info('\t\tuse existed desktop with code `CityReq_desktop`', desktopID);
}
folderID = conn.lookup('ubm_navshortcut', 'ID', {expression: 'code', condition: 'equal', values: {code: 'req_departments_folder'}});
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({
......@@ -30,6 +34,10 @@ var
displayOrder: 10
}
});
}
else {
console.info('\t\tuse existed folder with code `req_departments_folder`', folderID);
}
lastID = conn.lookup('ubm_navshortcut', 'ID', {expression: 'code', condition: 'equal', values: {code: 'req_depart'}});
......@@ -48,10 +56,12 @@ var
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);
}
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) {
......@@ -73,10 +83,7 @@ var
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);
}
lastID = conn.lookup('ubm_navshortcut', 'ID', {expression: 'code', condition: 'equal', values: {code: 'req_reqList'}});
if(!lastID) {
......@@ -98,10 +105,7 @@ var
console.info('\t\tuse existed shortcut with code `req_reqList`', lastID);
}
}
else {
console.info('\t\tuse existed desktop with code `CityReq_desktop`', desktopID);
}
};
\ No newline at end of file
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