Merged master into dashboards2

This commit is contained in:
Dante Loayza
2015-06-11 09:33:45 -04:00
28 changed files with 338 additions and 150 deletions

View File

@@ -325,7 +325,7 @@ class Task
if (!isset($arrayProperty["TAS_DURATION"])) {
throw (new \Exception("Invalid value specified for 'tas_duration'"));
}
$valuesTimeUnit = array('DAYS','HOURS');
$valuesTimeUnit = array('DAYS','HOURS','MINUTES');
if ((!isset($arrayProperty["TAS_TIMEUNIT"])) ||
(!in_array($arrayProperty["TAS_TIMEUNIT"], $valuesTimeUnit))) {
throw (new \Exception("Invalid value specified for 'tas_timeunit'"));

View File

@@ -181,6 +181,31 @@ class Trigger
}
}
/*----------------------------------********---------------------------------*/
if (\PMLicensedFeatures::getSingleton()->verifyfeature("B0oWlBLY3hHdWY0YUNpZEtFQm5CeTJhQlIwN3IxMEkwaG4=") &&
isset($dataTrigger["TRI_WEBBOT"])
) {
//Check disabled code
\G::LoadClass("codeScanner");
$arraySystemConfiguration = \System::getSystemConfiguration(PATH_CONFIG . "env.ini");
$cs = new \CodeScanner((isset($arraySystemConfiguration["enable_blacklist"]) && (int)($arraySystemConfiguration["enable_blacklist"]) == 1)? "DISABLED_CODE" : "");
$arrayFoundDisabledCode = $cs->checkDisabledCode("SOURCE", $dataTrigger["TRI_WEBBOT"]);
if (!empty($arrayFoundDisabledCode)) {
$strCodeAndLine = "";
foreach ($arrayFoundDisabledCode["source"] as $key => $value) {
$strCodeAndLine .= (($strCodeAndLine != "")? ", " : "") . \G::LoadTranslation("ID_DISABLED_CODE_CODE_AND_LINE", array($key, implode(", ", $value)));
}
throw new \Exception(\G::LoadTranslation("ID_DISABLED_CODE_TRIGGER", array($strCodeAndLine)));
}
}
/*----------------------------------********---------------------------------*/
$dataTrigger['PRO_UID'] = $sProcessUID;
$oTrigger = new \Triggers();
if ($create) {

View File

@@ -27,7 +27,7 @@ abstract class Importer
const IMPORT_STAT_INVALID_SOURCE_FILE = 102; //Error, Invalid file type or the file have corrupt data.
const IMPORT_STAT_GROUP_ALREADY_EXISTS = 105; //Error, Group already exists.
public abstract function load();
public abstract function load($filename = null);
/**
* Verify if exists reserved words SQL

View File

@@ -24,9 +24,13 @@ class XmlImporter extends Importer
* )
* @throws \Exception
*/
public function load()
public function load($filename = null)
{
$this->dom->load($this->filename);
if (!is_null($filename) && !file_exists($filename)) {
throw new \Exception(\G::LoadTranslation("ID_INVALID_FILE"));
}
$this->dom->load((is_null($filename))? $this->filename : $filename);
$this->root = $this->dom->documentElement;
// validate version