Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
#4703 update macro command line descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
loiclau committed Sep 12, 2016
1 parent b441b5c commit 2d29baf
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions www/include/configuration/configObject/command/DB-Func.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ function updateCommand($cmd_id = null, $params = array())
$DBRESULT = $pearDB->query($rq);

insertArgDesc($cmd_id, $ret);

insertMacrosDesc($cmd_id, $ret);

/* Prepare value for changelog */
Expand Down Expand Up @@ -242,7 +243,7 @@ function insertCommand($ret = array())

insertArgDesc($max_id, $ret);
insertMacrosDesc($max_id, $ret);

return ($max_id);
}

Expand Down Expand Up @@ -417,7 +418,11 @@ function insertMacrosDesc($cmd, $ret)

if (isset($ret['listOfMacros']) && $ret['listOfMacros']) {
$tab1 = preg_split("/\\n/", $ret['listOfMacros']);


$query = "DELETE FROM `on_demand_macro_command`
WHERE `command_command_id` = ".intval($cmd);
$pearDB->query($query);

foreach ($tab1 as $key => $value) {
$tab2 = preg_split("/\ \:\ /", $value, 2);
$str = trim(substr($tab2[0], 6));
Expand All @@ -432,10 +437,6 @@ function insertMacrosDesc($cmd, $ret)
}

if (!empty($sName)) {
$query = "DELETE FROM `on_demand_macro_command`
WHERE command_macro_name = '".$pearDB->escape($sName)."'
AND `command_command_id` = ".intval($cmd);
$pearDB->query($query);

$sQueryInsert = "INSERT INTO `on_demand_macro_command`
(`command_command_id`, `command_macro_name`, `command_macro_desciption`, `command_macro_type`)
Expand All @@ -445,6 +446,7 @@ function insertMacrosDesc($cmd, $ret)
'".$arr[$sType]."')";
$pearDB->query($sQueryInsert);
}

}
}
}
Expand Down

0 comments on commit 2d29baf

Please sign in to comment.