fix base path name for inventory sync schedules > add, resolves #2260 (#2281)

This commit is contained in:
Leigh
2016-06-09 14:30:33 -04:00
parent d55bff4c10
commit d95a43ae82

View File

@@ -187,13 +187,13 @@ export default
var scope = params.scope, var scope = params.scope,
callback= params.callback, callback= params.callback,
base = params.base || $location.path().replace(/^\//, '').split('/')[0], base = params.base || $location.path().replace(/^\//, '').split('/')[0],
url, url = params.url || null,
scheduler; scheduler;
if (!Empty($stateParams.id) && base !== 'system_job_templates' && base !== 'inventory') { if (!Empty($stateParams.id) && base !== 'system_job_templates' && base !== 'inventories') {
url = GetBasePath(base) + $stateParams.id + '/schedules/'; url = GetBasePath(base) + $stateParams.id + '/schedules/';
} }
else if(base === "inventory"){ else if(base === "inventories"){
if (!params.url){ if (!params.url){
url = GetBasePath('groups') + $stateParams.id + '/'; url = GetBasePath('groups') + $stateParams.id + '/';
Rest.setUrl(url); Rest.setUrl(url);
@@ -272,7 +272,6 @@ export default
} }
$state.go("^"); $state.go("^");
}); });
scope.saveSchedule = function() { scope.saveSchedule = function() {
SchedulePost({ SchedulePost({
scope: scope, scope: scope,
@@ -541,8 +540,7 @@ export default
scope.addSchedule = function() { scope.addSchedule = function() {
if ($state.includes('inventoryManage')){ if ($state.includes('inventoryManage')){
scope.schedule_url = parent_scope.current_url.split('?')[0]; scope.schedule_url = parent_scope.current_url.split('?')[0];
scope.base = 'inventory'; ParamPass.set(scope.schedule_url);
ParamPass.set(scope.base, scope.schedule_url);
$state.go('inventoryManage.schedules.add'); $state.go('inventoryManage.schedules.add');
} }
else{ else{