Skip to content

Commit

Permalink
Revert "Fautes et maladresses de Français + indentation"
Browse files Browse the repository at this point in the history
This reverts commit 3063304.
  • Loading branch information
MrWaloo committed Aug 16, 2024
1 parent 322f494 commit d008c45
Show file tree
Hide file tree
Showing 10 changed files with 107 additions and 106 deletions.
31 changes: 16 additions & 15 deletions core/ajax/cmd.ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
foreach ($cmds as $id) {
$cmd = cmd::byId($id);
if (!is_object($cmd)) {
throw new Exception(__('Commande inconnue. Vérifiez l\'ID', __FILE__) . ' ' . $id);
throw new Exception(__('Cmd inconnu. Vérifiez l\'ID', __FILE__) . ' ' . $id);
}
$cmd->setIsVisible(init('isVisible'));
$cmd->save(true);
Expand All @@ -80,7 +80,7 @@
if (init('action') == 'execCmd') {
$cmd = cmd::byId(init('id'));
if (!is_object($cmd)) {
throw new Exception(__('ID de commande inconnu :', __FILE__) . ' ' . init('id'));
throw new Exception(__('Commande ID inconnu :', __FILE__) . ' ' . init('id'));
}
$eqLogic = $cmd->getEqLogic();
if ($cmd->getType() == 'action' && !$eqLogic->hasRight('x')) {
Expand All @@ -105,15 +105,15 @@
if (init('action') == 'getByObjectNameEqNameCmdName') {
$cmd = cmd::byObjectNameEqLogicNameCmdName(init('object_name'), init('eqLogic_name'), init('cmd_name'));
if (!is_object($cmd)) {
throw new Exception(__('Commande inconnue :', __FILE__) . ' ' . init('object_name') . '/' . init('eqLogic_name') . '/' . init('cmd_name'));
throw new Exception(__('Cmd inconnu :', __FILE__) . ' ' . init('object_name') . '/' . init('eqLogic_name') . '/' . init('cmd_name'));
}
ajax::success($cmd->getId());
}

if (init('action') == 'getByObjectNameCmdName') {
$cmd = cmd::byObjectNameCmdName(init('object_name'), init('cmd_name'));
if (!is_object($cmd)) {
throw new Exception(__('Commande inconnue :', __FILE__) . ' ' . init('object_name') . '/' . init('cmd_name'), 9999);
throw new Exception(__('Cmd inconnu :', __FILE__) . ' ' . init('object_name') . '/' . init('cmd_name'), 9999);
}
ajax::success(utils::o2a($cmd));
}
Expand Down Expand Up @@ -405,7 +405,7 @@
if (is_numeric(init('id'))) {
$cmd = cmd::byId(init('id'));
if (!is_object($cmd)) {
throw new Exception(__('ID de commande inconnu :', __FILE__) . ' ' . init('id'));
throw new Exception(__('Commande ID inconnu :', __FILE__) . ' ' . init('id'));
}
$usage = $cmd->getCache('usage::history', 0);
$cmd->setCache('usage::history', $usage + 1);
Expand Down Expand Up @@ -494,15 +494,16 @@
ajax::success($return);
}

if (init('action') == 'getLastHistory') {
$cmd = cmd::byId(init('id'));
$_time = date('Y-m-d H:i:s', strtotime(init('time')));
if(is_object($cmd)){
ajax::success($cmd->getLastHistory($_time));
} else {
throw new Exception(__('Nombre maximum de niveaux d’éléments affichés dans les graphiques de liens', __FILE__) . ' ' . init('id'));
}
}
if (init('action') == 'getLastHistory') {
$cmd = cmd::byId(init('id'));
$_time = date('Y-m-d H:i:s', strtotime(init('time')));
if(is_object($cmd)){
ajax::success($cmd->getLastHistory($_time));
}
else{
throw new Exception(__('Commande ID inconnu :', __FILE__) . ' ' . init('id'));
}
}

if (init('action') == 'emptyHistory') {
if (!isConnect('admin')) {
Expand All @@ -511,7 +512,7 @@
unautorizedInDemo();
$cmd = cmd::byId(init('id'));
if (!is_object($cmd)) {
throw new Exception(__('Nombre maximum de niveaux d’éléments affichés dans les graphiques de liens', __FILE__) . ' ' . init('id'));
throw new Exception(__('Commande ID inconnu :', __FILE__) . ' ' . init('id'));
}
$cmd->emptyHistory(init('date'));
ajax::success();
Expand Down
12 changes: 6 additions & 6 deletions core/api/jeeApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@
}

if(config::byKey('api::forbidden::method', 'core', '') !== '' && preg_match(config::byKey('api::forbidden::method', 'core', ''), init('type'))){
throw new Exception(__('Cette demande n\'est pas autorisée', __FILE__) . ' ' . getClientIp());
throw new Exception(__('Cette demande n\'est autorisée', __FILE__) . ' ' . getClientIp());
}
if(config::byKey('api::allow::method', 'core', '') !== '' && !preg_match(config::byKey('api::allow::method', 'core', ''), init('type'))){
throw new Exception(__('Cette demande n\'est pas autorisée', __FILE__) . ' ' . getClientIp());
throw new Exception(__('Cette demande n\'est autorisée', __FILE__) . ' ' . getClientIp());
}
$type = init('type');
log::add('api', 'debug', __('Demande sur l\'api http venant de :', __FILE__) . ' ' . getClientIp() . ' => ' . json_encode($_GET));
Expand Down Expand Up @@ -282,10 +282,10 @@
}

if(config::byKey('api::forbidden::method', 'core', '') !== '' && preg_match(config::byKey('api::forbidden::method', 'core', ''), $jsonrpc->getMethod())){
throw new Exception(__('Cette demande n\'est pas autorisée', __FILE__));
throw new Exception(__('Cette demande n\'est autorisée', __FILE__));
}
if(config::byKey('api::allow::method', 'core', '') !== '' && !preg_match(config::byKey('api::allow::method', 'core', ''), $jsonrpc->getMethod())){
throw new Exception(__('Cette demande n\'est pas autorisée', __FILE__) . ' ' . getClientIp());
throw new Exception(__('Cette demande n\'est autorisée', __FILE__) . ' ' . getClientIp());
}

$params = $jsonrpc->getParams();
Expand Down Expand Up @@ -740,7 +740,7 @@
if ($jsonrpc->getMethod() == 'cmd::byId') {
$cmd = cmd::byId($params['id']);
if (!is_object($cmd)) {
throw new Exception(__('Commande introuvable :', __FILE__) . ' ' . secureXSS($params['id']), -32701);
throw new Exception(__('Cmd introuvable :', __FILE__) . ' ' . secureXSS($params['id']), -32701);
}
if (is_object($_USER_GLOBAL) && !$cmd->hasRight($_USER_GLOBAL)) {
throw new Exception(__('Vous n\'avez pas les droits sur cette commande', __FILE__), -32701);
Expand Down Expand Up @@ -910,7 +910,7 @@
}
if ($params['state'] == 'run') {
$scenario->addTag('trigger','api');
$scenario->addTag('message',__('Scénario exécuté sur appel API', __FILE__));
$scenario->addTag('message',__('Scénario exécuté sur appel API', __FILE__));
$jsonrpc->makeSuccess($scenario->launch());
}
if ($params['state'] == 'enable') {
Expand Down
2 changes: 1 addition & 1 deletion core/class/ajax.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static function init($_allowGetAction = array()) {
header('Content-Type: application/json');
}
if(isset($_GET['action']) && !in_array($_GET['action'], $_allowGetAction)){
throw new \Exception(__('Méthode non autorisée en GET : ',__FILE__).$_GET['action']);
throw new \Exception(__('Méthode non autorisé en GET : ',__FILE__).$_GET['action']);
}
}

Expand Down
88 changes: 44 additions & 44 deletions desktop/php/administration.php
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@
<?php
foreach ($JEEDOM_INTERNAL_CONFIG['messageChannel'] as $k => $v) {
echo '<div class="form-group" data-channel="' . $k . '">';
echo '<label class="col-lg-4 col-md-4 col-sm-4 col-xs-8 control-label">' . $v['icon'] . ' {{Action sur message, channel}} ' . $v['name'] . '</label>';
echo '<label class="col-lg-4 col-md-4 col-sm-4 col-xs-8 control-label">' . $v['icon'] . ' {{Action sur message, channel }} ' . $v['name'] . '</label>';
echo '<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">';
echo '<a class="btn btn-sm btn-success bt_addActionOnMessage" data-channel="' . $k . '"><i class="fas fa-plus-circle"></i> {{Ajouter}}</a>';
echo '</div>';
Expand Down Expand Up @@ -1167,8 +1167,8 @@
</div>
</div>
<div class="form-group">
<label class="col-lg-4 col-md-4 col-sm-6 col-xs-6 control-label">{{Limiter à une valeur toutes les}}
<sup><i class="fas fa-question-circle" title="{{Limite le nombre de valeurs historisées par les commandes en temps réel (avant le lissage de la nuit). Attention un mode de lissage doit absolument être défini.}}"></i></sup>
<label class="col-lg-4 col-md-4 col-sm-6 col-xs-6 control-label">{{Limiter à une valeur toute les}}
<sup><i class="fas fa-question-circle" title="{{Limite le nombre de valeur historisé par les commandes en temps réel (avant le lissage de la nuit). Attention un mode de lissage doit absolument être défini.}}"></i></sup>
</label>
<div class="col-lg-2 col-md-2 col-sm-5 col-xs-6">
<select class="form-control configKey" data-l1key="history::smooth">
Expand Down Expand Up @@ -1350,39 +1350,39 @@
<fieldset>
<div class="form-group">
<label class="col-lg-4 col-md-5 col-sm-6 col-xs-6 control-label">{{Profondeur pour les scénarios}}
<sup><i class="fas fa-question-circle" tooltip="{{Nombre maximum de niveaux d’éléments affichés dans les graphiques de liens de scénario}}"></i></sup>
<sup><i class="fas fa-question-circle" tooltip="{{Nombre de niveaux maximal d’éléments à afficher dans les graphiques de liens de scénario}}"></i></sup>
</label>
<div class="col-lg-2 col-md-2 col-sm-4 col-xs-6">
<input class="configKey form-control" data-l1key="graphlink::scenario::drill">
</div>
</div>
<div class="form-group">
<label class="col-lg-4 col-md-5 col-sm-6 col-xs-6 control-label">{{Profondeur pour les objets}}
<sup><i class="fas fa-question-circle" tooltip="{{Nombre maximum de niveaux d’éléments affichés dans les graphiques de liens d'objet}}"></i></sup>
<sup><i class="fas fa-question-circle" tooltip="{{Nombre de niveaux maximal d’éléments à afficher dans les graphiques de liens d'objet}}"></i></sup>
</label>
<div class="col-lg-2 col-md-2 col-sm-4 col-xs-6">
<input class="configKey form-control" data-l1key="graphlink::jeeObject::drill">
</div>
</div>
<div class="form-group">
<label class="col-lg-4 col-md-5 col-sm-6 col-xs-6 control-label">{{Profondeur pour les équipements}}
<sup><i class="fas fa-question-circle" tooltip="{{Nombre maximum de niveaux d’éléments affichés dans les graphiques de liens d'équipement}}"></i></sup>
<sup><i class="fas fa-question-circle" tooltip="{{Nombre de niveaux maximal d’éléments à afficher dans les graphiques de liens d'équipement}}"></i></sup>
</label>
<div class="col-lg-2 col-md-2 col-sm-4 col-xs-6">
<input class="configKey form-control" data-l1key="graphlink::eqLogic::drill">
</div>
</div>
<div class="form-group">
<label class="col-lg-4 col-md-5 col-sm-6 col-xs-6 control-label">{{Profondeur pour les commandes}}
<sup><i class="fas fa-question-circle" tooltip="{{Nombre maximum de niveaux d’éléments affichés dans les graphiques de liens de commande}}"></i></sup>
<sup><i class="fas fa-question-circle" tooltip="{{Nombre de niveaux maximal d’éléments à afficher dans les graphiques de liens de commande}}"></i></sup>
</label>
<div class="col-lg-2 col-md-2 col-sm-4 col-xs-6">
<input class="configKey form-control" data-l1key="graphlink::cmd::drill">
</div>
</div>
<div class="form-group">
<label class="col-lg-4 col-md-5 col-sm-6 col-xs-6 control-label">{{Profondeur pour les variables}}
<sup><i class="fas fa-question-circle" tooltip="{{Nombre maximum de niveaux d’éléments affichés dans les graphiques de liens de variable}}"></i></sup>
<sup><i class="fas fa-question-circle" tooltip="{{Nombre de niveaux maximal d’éléments à afficher dans les graphiques de liens de variable}}"></i></sup>
</label>
<div class="col-lg-2 col-md-2 col-sm-4 col-xs-6">
<input class="configKey form-control" data-l1key="graphlink::dataStore::drill">
Expand Down Expand Up @@ -1843,33 +1843,33 @@
<sup><i class="fas fa-question-circle" tooltip="{{Version installée du core, pour la vérification de mise à jour disponible.}}"></i></sup>
</label>
<div class="col-lg-3 col-md-4 col-xs-5">
<div class="input-group">
<select class="form-control configKey" data-l1key="core::branch">
<optgroup label="{{Defaut (support)}}">
<option value="master">{{Stable}}</option>
</optgroup>
<?php
if(config::byKey('core::repo::provider') == 'default'){
$lists = cache::byKey('core::branch::default::list')->getValue(array());
if(!isset($lists['branchs']) || !is_array($lists['branchs'])){
$request_http = new com_http('https://api.github.com/repos/jeedom/core/branches');
$request_http->setHeader(array('User-agent: jeedom'));
try {
$lists['branchs'] = json_decode($request_http->exec(10, 1), true);
} catch (\Exception $e) {
}
cache::set('core::branch::default::list',$lists,86400);
<div class="input-group">
<select class="form-control configKey" data-l1key="core::branch">
<optgroup label="{{Defaut (support)}}">
<option value="master">{{Stable}}</option>
</optgroup>
<?php
if(config::byKey('core::repo::provider') == 'default'){
$lists = cache::byKey('core::branch::default::list')->getValue(array());
if(!isset($lists['branchs']) || !is_array($lists['branchs'])){
$request_http = new com_http('https://api.github.com/repos/jeedom/core/branches');
$request_http->setHeader(array('User-agent: jeedom'));
try {
$lists['branchs'] = json_decode($request_http->exec(10, 1), true);
} catch (\Exception $e) {
}
cache::set('core::branch::default::list',$lists,86400);
}
if(!isset($lists['tags']) || !is_array($lists['tags'])){
$request_http = new com_http('https://api.github.com/repos/jeedom/core/tags');
$request_http->setHeader(array('User-agent: jeedom'));
try {
$lists['tags'] = json_decode($request_http->exec(10, 1), true);
} catch (\Exception $e) {
}
if(!isset($lists['tags']) || !is_array($lists['tags'])){
$request_http = new com_http('https://api.github.com/repos/jeedom/core/tags');
$request_http->setHeader(array('User-agent: jeedom'));
try {
$lists['tags'] = json_decode($request_http->exec(10, 1), true);
} catch (\Exception $e) {
}
cache::set('core::branch::default::list',$lists,86400);
cache::set('core::branch::default::list',$lists,86400);
}
if(isset($lists['branchs']) && is_array($lists['branchs'])){
if(isset($lists['branchs']) && is_array($lists['branchs'])){
echo '<optgroup label="{{Branches (Pas de support)}}">';
foreach ($lists['branchs'] as $branch) {
if(!is_array($branch) || !isset($branch['name'])){
Expand All @@ -1881,8 +1881,8 @@
echo '<option value="'.$branch['name'].'">'.$branch['name'].'</option>';
}
echo '</optgroup>';
}
if(isset($lists['tags']) && is_array($lists['tags'])){
}
if(isset($lists['tags']) && is_array($lists['tags'])){
echo '<optgroup label="{{Tags (Pas de support)}}">';
foreach ($lists['tags'] as $tag) {
if(!is_array($tag) || !isset($tag['name'])){
Expand All @@ -1892,13 +1892,13 @@
}
echo '</optgroup>';
}
}
?>
</select>
<span class="input-group-btn">
<a class="btn btn-default form-control" id="bt_refreshListBranch"><i class="fas fa-sync"></i></a>
</span>
</div>
}
?>
</select>
<span class="input-group-btn">
<a class="btn btn-default form-control" id="bt_refreshListBranch"><i class="fas fa-sync"></i></a>
</span>
</div>
</div>
</div>
<div class="form-group">
Expand Down Expand Up @@ -2018,7 +2018,7 @@
<form class="form-horizontal">
<fieldset>
<div class="alert alert-info">
{{Attention : toute modification du moteur de cache nécessite un redémarrage et vous fera perdre temporairement les informations sur la valeur des commandes et toute autre information en cache le temps que tout soit renvoyé.}}
{{Attention : toute modification du moteur de cache nécessite un redémarrage et vous fera perdre temporairement les informations sur la valeurs des commandes et toute autre informations en cache le temps que tout soit renvoyée.}}
</div>
<div class="form-group">
<label class="col-lg-4 col-md-5 col-sm-6 col-xs-6 control-label">{{Moteur de cache}}</label>
Expand Down Expand Up @@ -2354,8 +2354,8 @@
</div>
</span>
</div>
</div>

</div>
</div>
</fieldset>
<br>
Expand Down
60 changes: 30 additions & 30 deletions desktop/php/health.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,20 @@
$html .= '</td>';
switch ($dependancy_info['state']) {
case 'ok':
$html .= '<td class="alert alert-success" >{{OK}}</td>';
break;
$html .= '<td class="alert alert-success" >{{OK}}</td>';
break;
case 'nok':
$html .= '<td class="alert alert-danger" >{{NOK}}</td>';
$asNok += 1;
break;
$html .= '<td class="alert alert-danger" >{{NOK}}</td>';
$asNok += 1;
break;
case 'in_progress':
$html .= '<td class="alert alert-info">{{En cours}}</td>';
$asPending += 1;
break;
$html .= '<td class="alert alert-info">{{En cours}}</td>';
$asPending += 1;
break;
default:
$html .= '<td class="alert alert-danger">{{NOK}}</td>';
$asNok += 1;
break;
$html .= '<td class="alert alert-danger">{{NOK}}</td>';
$asNok += 1;
break;
}
$html .= '</tr>';
}
Expand All @@ -86,16 +86,16 @@
$html .= '</td>';
switch ($deamon_info['launchable']) {
case 'ok':
$html .= '<td class="alert alert-success">{{OK}}</td>';
break;
$html .= '<td class="alert alert-success">{{OK}}</td>';
break;
case 'nok':
if ($deamon_info['auto'] != 1) {
$html .= '<td class="alert alert-success">{{Désactivé}}</td>';
} else {
$html .= '<td class="alert alert-danger" title="' . $deamon_info['launchable_message'] . '">{{NOK}}</td>';
$asNok += 1;
}
break;
if ($deamon_info['auto'] != 1) {
$html .= '<td class="alert alert-success">{{Désactivé}}</td>';
} else {
$html .= '<td class="alert alert-danger" title="' . $deamon_info['launchable_message'] . '">{{NOK}}</td>';
$asNok += 1;
}
break;
}
$html .= '</tr>';
$html .= '<tr>';
Expand All @@ -104,17 +104,17 @@
$html .= '</td>';
switch ($deamon_info['state']) {
case 'ok':
$html .= '<td class="alert alert-success">';
$html .= '{{OK}}</td>';
break;
$html .= '<td class="alert alert-success">';
$html .= '{{OK}}</td>';
break;
case 'nok':
if ($deamon_info['auto'] != 1) {
$html .= '<td class="alert alert-success">{{Désactivé}}</td>';
} else {
$html .= '<td class="alert alert-danger">{{NOK}}</td>';
$asNok += 1;
}
break;
if ($deamon_info['auto'] != 1) {
$html .= '<td class="alert alert-success">{{Désactivé}}</td>';
} else {
$html .= '<td class="alert alert-danger">{{NOK}}</td>';
$asNok += 1;
}
break;
}
$html .= '</tr>';
}
Expand Down
Loading

0 comments on commit d008c45

Please sign in to comment.