Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Remove template workspace from the list
Browse files Browse the repository at this point in the history
  • Loading branch information
c12simple committed Sep 7, 2015
1 parent 9222b39 commit 9690828
Showing 1 changed file with 33 additions and 29 deletions.
62 changes: 33 additions & 29 deletions core/src/plugins/action.scheduler/class.AjxpScheduler.php 100644 → 100755
Expand Up @@ -189,7 +189,11 @@ public function runTask($taskId, $status = null, &$currentlyRunning = -1, $force
$data["user_id"] = "queue:".$tmpQueue;
}
if ($data["repository_id"] == "*") {
$data["repository_id"] = implode(",", array_keys(ConfService::getRepositoriesList("all")));
$criteria = array();
$criteria["isTemplate"] = false;
$count = 0;
$listRepos = ConfService::listRepositoriesWithCriteria($criteria, $count);
$data["repository_id"] = implode(",", array_keys($listRepos));
}
$process = AJXP_Controller::applyActionInBackground(
$data["repository_id"],
Expand Down Expand Up @@ -270,7 +274,7 @@ public function switchAction($action, $httpVars, $postProcessData)
AJXP_XMLWriter::close();
}

break;
break;

case "scheduler_runTask":

Expand All @@ -280,7 +284,7 @@ public function switchAction($action, $httpVars, $postProcessData)
AJXP_XMLWriter::reloadDataNode();
AJXP_XMLWriter::close();

break;
break;

case "scheduler_generateCronExpression":

Expand All @@ -291,10 +295,10 @@ public function switchAction($action, $httpVars, $postProcessData)
HTMLWriter::charsetHeader("text/plain", "UTF-8");
print "$cronTiming $phpCmd $rootInstall -r=ajxp_conf -u=".AuthService::getLoggedUser()->getId()." -p=YOUR_PASSWORD_HERE -a=scheduler_runAll >> $logFile";

break;
break;

default:
break;
break;
}

}
Expand Down Expand Up @@ -331,26 +335,26 @@ public function listTasks($action, $httpVars, $postProcessData)

$timeArray = $this->getTimeArray($task["schedule"]);
$res = $this->getNextExecutionTimeForScript(time(), $timeArray);
$task["NEXT_EXECUTION"] = date($mess["date_format"], $res);
$task["PARAMS"] = implode(", ", $task["PARAMS"]);
$task["icon"] = "scheduler/ICON_SIZE/task.png";
$task["ajxp_mime"] = "scheduler_task";
$sFile = AJXP_CACHE_DIR."/cmd_outputs/task_".$task["task_id"].".status";
if (is_file($sFile)) {
$s = $this->getTaskStatus($task["task_id"]);
$task["STATUS"] = implode(":", $s);
$task["LAST_EXECUTION"] = date($mess["date_format"], filemtime($sFile));
} else {
$task["STATUS"] = "n/a";
$task["LAST_EXECUTION"] = "n/a";
}

AJXP_XMLWriter::renderNode("/admin/scheduler/".$task["task_id"],
(isSet($task["label"])?$task["label"]:"Action ".$task["action_name"]),
true,
$task
);
$task["NEXT_EXECUTION"] = date($mess["date_format"], $res);
$task["PARAMS"] = implode(", ", $task["PARAMS"]);
$task["icon"] = "scheduler/ICON_SIZE/task.png";
$task["ajxp_mime"] = "scheduler_task";
$sFile = AJXP_CACHE_DIR."/cmd_outputs/task_".$task["task_id"].".status";
if (is_file($sFile)) {
$s = $this->getTaskStatus($task["task_id"]);
$task["STATUS"] = implode(":", $s);
$task["LAST_EXECUTION"] = date($mess["date_format"], filemtime($sFile));
} else {
$task["STATUS"] = "n/a";
$task["LAST_EXECUTION"] = "n/a";
}

AJXP_XMLWriter::renderNode("/admin/scheduler/".$task["task_id"],
(isSet($task["label"])?$task["label"]:"Action ".$task["action_name"]),
true,
$task
);
}
AJXP_XMLWriter::close();

}
Expand Down Expand Up @@ -457,7 +461,7 @@ public function handleTasks($action, $httpVars, $fileVars)
AJXP_XMLWriter::reloadDataNode();
AJXP_XMLWriter::close();

break;
break;

case "scheduler_removeTask" :

Expand All @@ -467,7 +471,7 @@ public function handleTasks($action, $httpVars, $fileVars)
AJXP_XMLWriter::reloadDataNode();
AJXP_XMLWriter::close();

break;
break;

case "scheduler_loadTask":

Expand Down Expand Up @@ -502,10 +506,10 @@ public function handleTasks($action, $httpVars, $fileVars)
echo json_encode($task);
}

break;
break;

default:
break;
break;
}
//var_dump($tasks);

Expand Down Expand Up @@ -663,4 +667,4 @@ public function nextMinute($timeArray, &$a, &$m, &$j, &$h, &$min)
if ($min == 60) { return -1; }
} while ($valeurs[$min] != TRUE);
}
}
}

0 comments on commit 9690828

Please sign in to comment.