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

Commit

Permalink
Enable scheduler by default, but show it's not enabled via its menu l…
Browse files Browse the repository at this point in the history
…abel.
  • Loading branch information
cdujeu committed Sep 5, 2016
1 parent 1a4df42 commit 4f37a1a
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 6 deletions.
1 change: 1 addition & 0 deletions core/src/plugins/action.scheduler/i18n/de.php
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions core/src/plugins/action.scheduler/i18n/en.php
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions core/src/plugins/action.scheduler/i18n/fr.php
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions core/src/plugins/action.scheduler/i18n/it.php
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions core/src/plugins/action.scheduler/i18n/pt.php
Expand Up @@ -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",
Expand Down
8 changes: 7 additions & 1 deletion core/src/plugins/action.scheduler/manifest.xml
@@ -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"/>
Expand Down Expand Up @@ -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"/>
Expand Down
15 changes: 10 additions & 5 deletions core/src/plugins/action.scheduler/src/Scheduler.php
Expand Up @@ -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'.");
}
}

Expand Down Expand Up @@ -175,7 +175,7 @@ public function runTask(ContextInterface $ctx, $taskId, $status = null, &$curren
}
return false;
}

/**
* @param $data1
* @param $data2
Expand Down Expand Up @@ -239,6 +239,12 @@ public function switchAction(ServerRequestInterface $requestInterface, ResponseI

break;

case "scheduler_checkConfig":

$responseInterface = new JsonResponse(["OK" => ConfService::backgroundActionsSupported()]);

break;

default:
break;
}
Expand Down Expand Up @@ -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(
Expand All @@ -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",
Expand Down

0 comments on commit 4f37a1a

Please sign in to comment.