Skip to content

Commit e52e87c

Browse files
authored
Ordre des commandes (suite)
1 parent 3e45d0f commit e52e87c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

core/class/mobile.class.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -931,10 +931,10 @@ public function postInsert()
931931
public function postSave()
932932
{
933933
if ($this->getConfiguration('appVersion', 1) == 2) {
934+
$order = count($this->getCmd());
934935
// Commande notification
935936
$cmd = $this->getCmd(null, 'notif');
936937
if (!is_object($cmd)) {
937-
$order = count($this->getCmd());
938938
$cmd = new mobileCmd();
939939
$cmd->setIsVisible(1);
940940
$cmd->setName(__('Notification', __FILE__));
@@ -945,6 +945,7 @@ public function postSave()
945945
$cmd->setDisplay('showIconAndNamedashboard', 1);
946946
$cmd->setDisplay('showIconAndNamemobile', 1);
947947
$cmd->setOrder($order);
948+
$order++;
948949
}
949950
$cmd->setEqLogic_id($this->getId());
950951
$cmd->setType('action');
@@ -954,7 +955,6 @@ public function postSave()
954955
// Commande notification Critique
955956
$cmd = $this->getCmd(null, 'notifCritical');
956957
if (!is_object($cmd)) {
957-
$order = count($this->getCmd());
958958
$cmd = new mobileCmd();
959959
$cmd->setIsVisible(1);
960960
$cmd->setName(__('Notification Critique', __FILE__));
@@ -965,6 +965,7 @@ public function postSave()
965965
$cmd->setDisplay('showIconAndNamedashboard', 1);
966966
$cmd->setDisplay('showIconAndNamemobile', 1);
967967
$cmd->setOrder($order);
968+
$order++;
968969
}
969970
$cmd->setEqLogic_id($this->getId());
970971
$cmd->setType('action');
@@ -974,7 +975,6 @@ public function postSave()
974975
// Commande récupération infos du téléphone
975976
$cmd = $this->getCmd(null, 'notifSpecific');
976977
if (!is_object($cmd)) {
977-
$order = count($this->getCmd());
978978
$cmd = new mobileCmd();
979979
$cmd->setIsVisible(0);
980980
$cmd->setName(__('Récupérer les informations du téléphone', __FILE__));
@@ -985,6 +985,7 @@ public function postSave()
985985
$cmd->setDisplay('showIconAndNamedashboard', 1);
986986
$cmd->setDisplay('showIconAndNamemobile', 1);
987987
$cmd->setOrder($order);
988+
$order++;
988989
}
989990
$cmd->setEqLogic_id($this->getId());
990991
$cmd->setType('action');
@@ -994,7 +995,6 @@ public function postSave()
994995
// Commande suppression des nodifications
995996
$cmd = $this->getCmd(null, 'removeNotifs');
996997
if (!is_object($cmd)) {
997-
$order = count($this->getCmd());
998998
$cmd = new mobileCmd();
999999
$cmd->setIsVisible(1);
10001000
$cmd->setName(__('Supprimer les Notifications', __FILE__));
@@ -1005,6 +1005,7 @@ public function postSave()
10051005
$cmd->setDisplay('showIconAndNamedashboard', 1);
10061006
$cmd->setDisplay('showIconAndNamemobile', 1);
10071007
$cmd->setOrder($order);
1008+
$order++;
10081009
}
10091010
$cmd->setEqLogic_id($this->getId());
10101011
$cmd->setType('action');

0 commit comments

Comments
 (0)