Skip to content

Commit

Permalink
Merge pull request #5 from JEALG/DeleteCodeV1
Browse files Browse the repository at this point in the history
Pas de création de commande pour V1
  • Loading branch information
Phpvarious authored Oct 16, 2024
2 parents 2d8e5a9 + eda9a63 commit 7b3262e
Showing 1 changed file with 33 additions and 31 deletions.
64 changes: 33 additions & 31 deletions core/class/mobile.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -867,38 +867,39 @@ public function postInsert()
*/
public function postSave()
{
$cmd = $this->getCmd(null, 'notifSpecific');
if (!is_object($cmd)) {
$cmd = new mobileCmd();
$cmd->setIsVisible(0);
$cmd->setOrder(6);
}
$cmd->setName(__('Récupérer les informations du téléphone', __FILE__));
$cmd->setLogicalId('notifSpecific');
$cmd->setEqLogic_id($this->getId());
$cmd->setDisplay('generic_type', 'GENERIC_ACTION');
$cmd->setType('action');
$cmd->setSubType('message');
$cmd->save();

// Commande notification
$cmd = $this->getCmd(null, 'notif');
if (!is_object($cmd)) {
$cmd = new mobileCmd();
$cmd->setIsVisible(1);
$cmd->setName(__('Notification', __FILE__));
$cmd->setdisplay('icon', '<i class="icon fa-regular fa-message"></i>');
$cmd->setOrder(1);
}
$cmd->setLogicalId('notif');
$cmd->setEqLogic_id($this->getId());
$cmd->setDisplay('generic_type', 'GENERIC_ACTION');
$cmd->setType('action');
$cmd->setSubType('message');
$cmd->save();

// Commande notification Critique
if ($this->getConfiguration('appVersion', 1) == 2) {
// Commande récupération info du téléphone
$cmd = $this->getCmd(null, 'notifSpecific');
if (!is_object($cmd)) {
$cmd = new mobileCmd();
$cmd->setIsVisible(0);
$cmd->setOrder(6);
}
$cmd->setName(__('Récupérer les informations du téléphone', __FILE__));
$cmd->setLogicalId('notifSpecific');
$cmd->setEqLogic_id($this->getId());
$cmd->setDisplay('generic_type', 'GENERIC_ACTION');
$cmd->setType('action');
$cmd->setSubType('message');
$cmd->save();

// Commande notification
$cmd = $this->getCmd(null, 'notif');
if (!is_object($cmd)) {
$cmd = new mobileCmd();
$cmd->setIsVisible(1);
$cmd->setName(__('Notification', __FILE__));
$cmd->setdisplay('icon', '<i class="icon fa-regular fa-message"></i>');
$cmd->setOrder(1);
}
$cmd->setLogicalId('notif');
$cmd->setEqLogic_id($this->getId());
$cmd->setDisplay('generic_type', 'GENERIC_ACTION');
$cmd->setType('action');
$cmd->setSubType('message');
$cmd->save();

// Commande notification Critique
$cmd = $this->getCmd(null, 'notifCritical');
if (!is_object($cmd)) {
$cmd = new mobileCmd();
Expand All @@ -914,6 +915,7 @@ public function postSave()
$cmd->setSubType('message');
$cmd->save();

// Commande suppression des nodifications
$cmd = $this->getCmd(null, 'removeNotifs');
if (!is_object($cmd)) {
$cmd = new mobileCmd();
Expand Down

0 comments on commit 7b3262e

Please sign in to comment.