Permalink
Browse files

Enable scheduler by default, but show it's not enabled via its menu l…

…abel.
  • Loading branch information...
1 parent 1a4df42 commit 4f37a1a25dd70b2528c498a8ecf185a9da4b9712 @cdujeu cdujeu committed Sep 5, 2016
@@ -50,6 +50,7 @@
"17d" => "Kommagetrennte Liste mit Benutzern oder Wildcard * damit die Aufgabe für alle Benutzer ausgeführt wird.",
"18" => "Aufgabenplanung",
"18d" => "Cron-ähnliche Aufgabenplanung",
+ "18e" => "Aufgabenplanung (disabled)",
"19" => "Aufgabe löschen",
"19d" => "Aufgabe nicht mehr ausführen und löschen",
"20" => "Crontab-Eintrag generieren",
@@ -50,6 +50,7 @@
"17d" => "Enter a comma separated list of users, or wildcard * to recurse the task on all users.",
"18" => "Scheduler",
"18d" => "Cron-like scheduler actions",
+ "18e" => "Scheduler (disabled)",
"19" => "Delete Task",
"19d" => "Unschedule and remove the selected task",
"20" => "Cron Expression",
@@ -49,6 +49,7 @@
"17d" => "Entrer une liste d'utilisateurs séparés par des virgules, ou un joker (*) pour lancer la tâche sur chaque utilisateur.",
"18" => "Planificateur",
"18d" => "Actions du planificateur (type cron)",
+ "18e" => "Planificateur (inactif)",
"19" => "Supprimer la tâche",
"19d" => "Déplanifier et supprimer la tâche sélectionnée",
"20" => "Expression Cron",
@@ -49,6 +49,7 @@
"17" => "Utente(i)",
"17d" => "Inserisci un elenco di utenti, separati dalla virgola, o il wildcard * per eseguire l'azione per ogni utente.",
"18" => "Schedulatore",
+ "18e" => "Schedulatore (disabled)",
"18d" => "Azioni in stile 'Cron'",
"19" => "Cancella Azione",
"19d" => "De-Schedula e rimuovi l'azione selezionata",
@@ -49,6 +49,7 @@
"17" => "Utilizador(es)",
"17d" => "Introduza uma lista de utilizadores separados por virgulas, ou um Wildcard * Tarefa recursiva para todos os utilizadores.",
"18" => "Agenda",
+ "18e" => "Agenda (disabled)",
"18d" => "Agenda Cronológica de acções",
"19" => "Apagar Tarefa",
"19d" => "Remover entrada da agenda e remover as tarefas seleccionadas",
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<ajxp_plugin id="action.scheduler" enabled="false" label="CONF_MESSAGE[Tasks Scheduler]" description="CONF_MESSAGE[Register tasks to be run on a regular basis instead of writing them one by one in cron tab.]" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:../core.ajaxplorer/ajxp_registry.xsd">
+<ajxp_plugin id="action.scheduler" enabled="true" label="CONF_MESSAGE[Tasks Scheduler]" description="CONF_MESSAGE[Register tasks to be run on a regular basis instead of writing them one by one in cron tab.]" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:../core.ajaxplorer/ajxp_registry.xsd">
<client_settings>
<resources>
<i18n namespace="action.scheduler" path="plugins/action.scheduler/i18n"/>
@@ -302,6 +302,12 @@
<serverCallback methodName="fakeLongTask" developerComment="Launch a fake long task."/>
</processing>
</action>
+ <action name="scheduler_checkConfig">
+ <rightsContext adminOnly="true" noUser="false" read="true" userLogged="true" write="true"/>
+ <processing>
+ <serverCallback methodName="switchAction" developerComment="Check scheduler configuration"/>
+ </processing>
+ </action>
</actions>
<hooks>
<serverCallback methodName="placeConfigNode" hookName="ajxp_conf.list_config_nodes"/>
@@ -102,7 +102,7 @@ public function getDbFile()
public function performChecks()
{
if (!ConfService::backgroundActionsSupported()) {
- throw new Exception("The command line must be supported. See 'Pydio Core Options'.");
+ //throw new Exception("The command line must be supported. See 'Pydio Core Options'.");
}
}
@@ -175,7 +175,7 @@ public function runTask(ContextInterface $ctx, $taskId, $status = null, &$curren
}
return false;
}
-
+
/**
* @param $data1
* @param $data2
@@ -239,6 +239,12 @@ public function switchAction(ServerRequestInterface $requestInterface, ResponseI
break;
+ case "scheduler_checkConfig":
+
+ $responseInterface = new JsonResponse(["OK" => ConfService::backgroundActionsSupported()]);
+
+ break;
+
default:
break;
}
@@ -401,10 +407,9 @@ public function placeConfigNode(ContextInterface $ctx, &$configTree)
{
$mess = LocaleService::getMessages();
if (isSet($configTree["parameters"])) {
-
$configTree["parameters"]["CHILDREN"]["scheduler"] = array(
"AJXP_MIME" => "scheduler_zone",
- "LABEL" => "action.scheduler.18",
+ "LABEL" => "action.scheduler.18".(ConfService::backgroundActionsSupported()?"":"e"),
"DESCRIPTION" => "action.scheduler.22",
"ICON" => "preferences_desktop.png",
"METADATA" => array(
@@ -416,7 +421,7 @@ public function placeConfigNode(ContextInterface $ctx, &$configTree)
} else if (isSet($configTree["admin"])) {
$configTree["admin"]["CHILDREN"]["scheduler"] = array(
- "LABEL" => $mess["action.scheduler.18"],
+ "LABEL" => $mess["action.scheduler.18".(ConfService::backgroundActionsSupported()?"":"e")],
"AJXP_MIME" => "scheduler_zone",
"DESCRIPTION" => $mess["action.scheduler.22"],
"ICON" => "scheduler/ICON_SIZE/player_time.png",

0 comments on commit 4f37a1a

Please sign in to comment.