diff --git a/gulliver/core/Session/PmSessionHandler.php b/gulliver/core/Session/PmSessionHandler.php index 94ab7d676..6d3b7b321 100644 --- a/gulliver/core/Session/PmSessionHandler.php +++ b/gulliver/core/Session/PmSessionHandler.php @@ -229,7 +229,7 @@ class PmSessionHandler //implements SessionHandlerInterface /** * Garbase Collection method * - * @param int $maxlifetime max time that especify if the session is active or not + * @param int $maxlifetime max time that specifies if the session is active or not * @return bool always returns true */ public function gc($maxlifetime) @@ -255,4 +255,4 @@ class PmSessionHandler //implements SessionHandlerInterface error_log('PM Session Handler :: ' . print_r($data, true)); } -} \ No newline at end of file +} diff --git a/gulliver/js/highlight/core/test.html b/gulliver/js/highlight/core/test.html index c1256f8a5..e65c1b716 100755 --- a/gulliver/js/highlight/core/test.html +++ b/gulliver/js/highlight/core/test.html @@ -160,7 +160,7 @@ abstract class Zend_Uri */ $uri = explode(':', $uri, 2); $scheme = strtolower($uri[0]); - $schemeSpecific = isset($uri[1]) ? $uri[1] : ''; + $schemeSpecify = isset($uri[1]) ? $uri[1] : ''; if (!strlen($scheme)) { throw new Zend_Uri_Exception('An empty string was supplied for the scheme'); @@ -617,4 +617,4 @@ public boolean unpack(container packedClass)
<div id="contents">
   <p>Hello, World!
 </div>
-
\ No newline at end of file + diff --git a/gulliver/system/class.bootstrap.php b/gulliver/system/class.bootstrap.php index f625536db..0edcae85b 100644 --- a/gulliver/system/class.bootstrap.php +++ b/gulliver/system/class.bootstrap.php @@ -463,7 +463,7 @@ class Bootstrap $filter = new InputFilter(); $file = $filter->xssFilterHard($file); $downloadFileName = $filter->xssFilterHard($downloadFileName); - + $fileNameIni = $file; $browserCacheFilesUid = G::browserCacheFilesGetUid(); @@ -1273,7 +1273,7 @@ class Bootstrap $checkSum = ''; foreach ($files as $file) { if (is_file($file)) { - $checkSum .= md5_file($file); + $checkSum .= Bootstrap::encryptFileOld($file); } } return Bootstrap::encryptOld($checkSum . $key); @@ -1376,7 +1376,7 @@ class Bootstrap { global $translation; - // if the second parameter $lang is an array does mean it was especified to use as data + // if the second parameter ($lang) is an array, it was specified to use it as data if (is_array($lang)) { $data = $lang; $lang = SYS_LANG; @@ -1409,7 +1409,7 @@ class Bootstrap * * @param $path path to scan recursively the write permission * @param $flags to notive glob function - * @param $pattern pattern to filter some especified files + * @param $pattern pattern to filter some specified files * @return array containing the recursive glob results */ public function rglob($pattern = '*', $flags = 0, $path = '') @@ -2894,7 +2894,7 @@ class Bootstrap if ($hashType == '') { $hashType = Bootstrap::getPasswordHashType(); } - + G::LoadSystem('inputfilter'); $filter = new InputFilter(); $hashType = $filter->validateInput($hashType); @@ -2934,4 +2934,3 @@ class Bootstrap return md5($string); } } - diff --git a/gulliver/system/class.g.php b/gulliver/system/class.g.php index 846fbd558..ca57a81f0 100755 --- a/gulliver/system/class.g.php +++ b/gulliver/system/class.g.php @@ -2095,7 +2095,7 @@ class G { global $translation; - // if the second parameter $lang is an array does mean it was especified to use as data + // if the second parameter ($lang) is an array, it was specified to use as data if (is_array( $lang )) { $data = $lang; $lang = SYS_LANG; @@ -2634,8 +2634,8 @@ class G $oldumask = umask( 0 ); if (! is_dir( $path )) { G::verifyPath( $path, true ); - } - + } + if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { $file = str_replace("\\\\","\\",$file,$count); if(!$count) { @@ -2647,13 +2647,13 @@ class G } } $file = substr($file,0,-1); - } + } } - + G::LoadSystem('inputfilter'); $filter = new InputFilter(); - $file = $filter->validateInput($file, "path"); - + $file = $filter->validateInput($file, "path"); + move_uploaded_file( $file, $path . "/" . $nameToSave ); @chmod( $path . "/" . $nameToSave, $permission ); umask( $oldumask ); @@ -3133,6 +3133,9 @@ class G */ public function evalJScript ($c) { + G::LoadSystem('inputfilter'); + $filter = new InputFilter(); + $c = $filter->xssFilterHard($c); print ("") ; } @@ -3634,7 +3637,7 @@ class G * @author Erik Amaru Ortiz * * @param $path path to scan recursively the write permission - * @param $pattern pattern to filter some especified files + * @param $pattern pattern to filter some specified files * @return if the $path, assuming that is a directory -> all files in it are writeables or not */ public function is_rwritable($path, $pattern = '*') @@ -3655,7 +3658,7 @@ class G * * @param $path path to scan recursively the write permission * @param $flags to notive glob function - * @param $pattern pattern to filter some especified files + * @param $pattern pattern to filter some specified files * @return array containing the recursive glob results */ public static function rglob($pattern = '*', $flags = 0, $path = '') @@ -4582,7 +4585,7 @@ class G $checkSum = ''; foreach ($files as $file) { if (is_file( $file )) { - $checkSum .= md5_file( $file ); + $checkSum .= G::encryptFileOld( $file ); } } return G::encryptOld( $checkSum . $key ); @@ -5600,6 +5603,17 @@ class G return md5($string); } /** + * encryptFileOld + * + * @param string $string + * + * @return md5_file($string) + */ + public function encryptFileOld ($string) + { + return md5_file($string); + } + /** * crc32 * * @param string $string @@ -5705,4 +5719,3 @@ function __ ($msgID, $lang = SYS_LANG, $data = null) { return G::LoadTranslation( $msgID, $lang, $data ); } - diff --git a/gulliver/thirdparty/creole/drivers/pgsql/metadata/PgSQLTableInfo.php b/gulliver/thirdparty/creole/drivers/pgsql/metadata/PgSQLTableInfo.php index be6988af0..4e9febde8 100755 --- a/gulliver/thirdparty/creole/drivers/pgsql/metadata/PgSQLTableInfo.php +++ b/gulliver/thirdparty/creole/drivers/pgsql/metadata/PgSQLTableInfo.php @@ -80,8 +80,7 @@ class PgSQLTableInfo extends TableInfo { require_once($pathTrunk.'gulliver/system/class.inputfilter.php'); $filter = new InputFilter(); $this->oid = $filter->validateInput($this->oid, 'int'); - - $result = pg_query ($this->conn->getResource(), sprintf ("SELECT + $query = "SELECT att.attname, att.atttypmod, att.atthasdef, @@ -102,7 +101,9 @@ class PgSQLTableInfo extends TableInfo { LEFT OUTER JOIN pg_attrdef def ON adrelid=att.attrelid AND adnum=att.attnum WHERE att.attrelid = %d AND att.attnum > 0 AND att.attisdropped IS FALSE - ORDER BY att.attnum", $this->oid)); + ORDER BY att.attnum"; + $query = $filter->preventSqlInjection($query); + $result = pg_query ($this->conn->getResource(), sprintf ($query, $this->oid)); if (!$result) { throw new SQLException("Could not list fields for table: " . $this->name, pg_last_error($this->conn->getResource())); @@ -224,8 +225,7 @@ class PgSQLTableInfo extends TableInfo { require_once($pathTrunk.'gulliver/system/class.inputfilter.php'); $filter = new InputFilter(); $strDomain = $filter->validateInput($strDomain); - - $result = pg_query ($this->conn->getResource(), sprintf ("SELECT + $query = "SELECT d.typname as domname, b.typname as basetype, d.typlen, @@ -237,7 +237,9 @@ class PgSQLTableInfo extends TableInfo { WHERE d.typtype = 'd' AND d.typname = '%s' - ORDER BY d.typname", $strDomain)); + ORDER BY d.typname"; + $query = $filter->preventSqlInjection($query); + $result = pg_query ($this->conn->getResource(), sprintf ($query, $strDomain)); if (!$result) { throw new SQLException("Query for domain [" . $strDomain . "] failed.", pg_last_error($this->conn->getResource())); @@ -276,7 +278,7 @@ class PgSQLTableInfo extends TableInfo { $filter = new InputFilter(); $this->oid = $filter->validateInput($this->oid, 'int'); - $result = pg_query ($this->conn->getResource(), sprintf ("SELECT + $query = "SELECT conname, confupdtype, confdeltype, @@ -294,7 +296,9 @@ class PgSQLTableInfo extends TableInfo { AND conrelid = %d AND a2.attnum = ct.conkey[1] AND a1.attnum = ct.confkey[1] - ORDER BY conname", $this->oid)); + ORDER BY conname"; + $query = $filter->preventSqlInjection($query); + $result = pg_query ($this->conn->getResource(), sprintf ($query, $this->oid)); if (!$result) { throw new SQLException("Could not list foreign keys for table: " . $this->name, pg_last_error($this->conn->getResource())); } @@ -371,15 +375,17 @@ class PgSQLTableInfo extends TableInfo { $filter = new InputFilter(); $this->oid = $filter->validateInput($this->oid, 'int'); - $result = pg_query ($this->conn->getResource(), sprintf ("SELECT - DISTINCT ON(cls.relname) - cls.relname as idxname, - indkey, - indisunique - FROM pg_index idx - JOIN pg_class cls ON cls.oid=indexrelid - WHERE indrelid = %d AND NOT indisprimary - ORDER BY cls.relname", $this->oid)); + $query = "SELECT + DISTINCT ON(cls.relname) + cls.relname as idxname, + indkey, + indisunique + FROM pg_index idx + JOIN pg_class cls ON cls.oid=indexrelid + WHERE indrelid = %d AND NOT indisprimary + ORDER BY cls.relname"; + $query = $filter->preventSqlInjection($query); + $result = pg_query ($this->conn->getResource(), sprintf ($query, $this->oid)); if (!$result) { @@ -407,10 +413,12 @@ class PgSQLTableInfo extends TableInfo { { $intColNum = $filter->validateInput($intColNum, 'int'); - $result2 = pg_query ($this->conn->getResource(), sprintf ("SELECT a.attname + $query = "SELECT a.attname FROM pg_catalog.pg_class c JOIN pg_catalog.pg_attribute a ON a.attrelid = c.oid WHERE c.oid = '%s' AND a.attnum = %d AND NOT a.attisdropped - ORDER BY a.attnum", $this->oid, $intColNum)); + ORDER BY a.attnum"; + $query = $filter->preventSqlInjection($query); + $result2 = pg_query ($this->conn->getResource(), sprintf ($query, $this->oid, $intColNum)); if (!$result2) { throw new SQLException("Could not list indexes keys for table: " . $this->name, pg_last_error($this->conn->getResource())); @@ -444,7 +452,7 @@ class PgSQLTableInfo extends TableInfo { $filter = new InputFilter(); $this->oid = $filter->validateInput($this->oid); - $result = pg_query($this->conn->getResource(), sprintf ("SELECT + $query = "SELECT DISTINCT ON(cls.relname) cls.relname as idxname, indkey, @@ -452,7 +460,9 @@ class PgSQLTableInfo extends TableInfo { FROM pg_index idx JOIN pg_class cls ON cls.oid=indexrelid WHERE indrelid = %s AND indisprimary - ORDER BY cls.relname", $this->oid)); + ORDER BY cls.relname"; + $query = $filter->preventSqlInjection($query); + $result = pg_query($this->conn->getResource(), sprintf ($query, $this->oid)); if (!$result) { throw new SQLException("Could not list primary keys for table: " . $this->name, pg_last_error($this->conn->getResource())); } @@ -477,10 +487,12 @@ class PgSQLTableInfo extends TableInfo { { $intColNum = $filter->validateInput($intColNum, 'int'); - $result2 = pg_query ($this->conn->getResource(), sprintf ("SELECT a.attname + $query = "SELECT a.attname FROM pg_catalog.pg_class c JOIN pg_catalog.pg_attribute a ON a.attrelid = c.oid WHERE c.oid = '%s' AND a.attnum = %d AND NOT a.attisdropped - ORDER BY a.attnum", $this->oid, $intColNum)); + ORDER BY a.attnum"; + $query = $filter->preventSqlInjection($query); + $result2 = pg_query ($this->conn->getResource(), sprintf ($query, $this->oid, $intColNum)); if (!$result2) { throw new SQLException("Could not list indexes keys for table: " . $this->name, pg_last_error($this->conn->getResource())); diff --git a/gulliver/thirdparty/creole/drivers/sqlite/metadata/SQLiteTableInfo.php b/gulliver/thirdparty/creole/drivers/sqlite/metadata/SQLiteTableInfo.php index c88eab6a1..98e9c32ff 100755 --- a/gulliver/thirdparty/creole/drivers/sqlite/metadata/SQLiteTableInfo.php +++ b/gulliver/thirdparty/creole/drivers/sqlite/metadata/SQLiteTableInfo.php @@ -123,7 +123,9 @@ class SQLiteTableInfo extends TableInfo { $this->indexes[$name] = new IndexInfo($name); // get columns for that index - $res2 = sqlite_query($this->conn->getResource(), "PRAGMA index_info('$name')"); + $query = "PRAGMA index_info('$name')"; + $query = $filter->preventSqlInjection($query); + $res2 = sqlite_query($this->conn->getResource(), $query); while($row2 = sqlite_fetch_array($res2, SQLITE_ASSOC)) { $colname = $row2['name']; $this->indexes[$name]->addColumn($this->columns[ $colname ]); diff --git a/gulliver/thirdparty/pear/PEAR/Frontend/CLI.php b/gulliver/thirdparty/pear/PEAR/Frontend/CLI.php index 55ee979eb..67c15b9ea 100755 --- a/gulliver/thirdparty/pear/PEAR/Frontend/CLI.php +++ b/gulliver/thirdparty/pear/PEAR/Frontend/CLI.php @@ -72,6 +72,15 @@ class PEAR_Frontend_CLI extends PEAR function _displayLine($text) { + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.inputfilter.php'); + $filter = new InputFilter(); + $text = $filter->xssFilterHard($text); print "$this->lp$text\n"; } @@ -124,15 +133,25 @@ class PEAR_Frontend_CLI extends PEAR function userDialog($command, $prompts, $types = array(), $defaults = array()) { + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.inputfilter.php'); + $filter = new InputFilter(); $result = array(); if (is_array($prompts)) { $fp = fopen("php://stdin", "r"); foreach ($prompts as $key => $prompt) { $type = $types[$key]; $default = @$defaults[$key]; + $default = $filter->xssFilterHard($default); if ($type == 'password') { system('stty -echo'); } + $prompt = $filter->xssFilterHard($prompt); print "$this->lp$prompt "; if ($default) { print "[$default] "; diff --git a/gulliver/thirdparty/pear/SOAP/Interop/interop_client_run.php b/gulliver/thirdparty/pear/SOAP/Interop/interop_client_run.php index c77eb78f1..70f98dddb 100755 --- a/gulliver/thirdparty/pear/SOAP/Interop/interop_client_run.php +++ b/gulliver/thirdparty/pear/SOAP/Interop/interop_client_run.php @@ -82,10 +82,19 @@ function print_test_names() function print_endpoint_names() { global $iop; + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.inputfilter.php'); + $filter = new InputFilter(); + $currTest = $filter->xssFilterHard($iop->currentTest); if (!$iop->getEndpoints($iop->currentTest)) { - die("Unable to retrieve endpoints for $iop->currentTest\n"); + die("Unable to retrieve endpoints for $currTest\n"); } - print "Interop Servers for $iop->currentTest:\n"; + print "Interop Servers for $currTestt:\n"; foreach ($iop->endpoints as $server) { print " $server->name\n"; } diff --git a/gulliver/thirdparty/pear/class.wsdlcache.php b/gulliver/thirdparty/pear/class.wsdlcache.php index 048a8a4f3..6e5075bed 100755 --- a/gulliver/thirdparty/pear/class.wsdlcache.php +++ b/gulliver/thirdparty/pear/class.wsdlcache.php @@ -134,7 +134,7 @@ class wsdlcache { $this->debug("Lock for $filename already exists"); return false; } - $this->fplock[md5($filename)] = fopen($filename.".lock", "w"); + $this->fplock[G::encryptOld($filename)] = fopen($filename.".lock", "w"); if ($mode == "r") { return flock($this->fplock[G::encryptOld($filename)], LOCK_SH); } else { @@ -173,9 +173,18 @@ class wsdlcache { * @access private */ function releaseMutex($filename) { - $ret = flock($this->fplock[md5($filename)], LOCK_UN); - fclose($this->fplock[md5($filename)]); - unset($this->fplock[md5($filename)]); + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + $ret = flock($this->fplock[G::encryptOld($filename)], LOCK_UN); + fclose($this->fplock[G::encryptOld($filename)]); + unset($this->fplock[G::encryptOld($filename)]); if (! $ret) { $this->debug("Not able to release lock for $filename"); } diff --git a/gulliver/thirdparty/phpmailer/class.phpmailer.php b/gulliver/thirdparty/phpmailer/class.phpmailer.php index 830cd592d..50ae12c4f 100755 --- a/gulliver/thirdparty/phpmailer/class.phpmailer.php +++ b/gulliver/thirdparty/phpmailer/class.phpmailer.php @@ -2527,7 +2527,7 @@ class PHPMailer { $mimeType = self::_mime_types($ext); if ( strlen($basedir) > 1 && substr($basedir, -1) != '/') { $basedir .= '/'; } if ( strlen($directory) > 1 && substr($directory, -1) != '/') { $directory .= '/'; } - if ( $this->AddEmbeddedImage($basedir.$directory.$filename, md5($url), $filename, 'base64', $mimeType) ) { + if ( $this->AddEmbeddedImage($basedir.$directory.$filename, G::encryptOld($url), $filename, 'base64', $mimeType) ) { $message = preg_replace("/".$images[1][$i]."=[\"']".preg_quote($url, '/')."[\"']/Ui", $images[1][$i]."=\"".$cid."\"", $message); } } diff --git a/workflow/engine/bin/cron.php b/workflow/engine/bin/cron.php index 4e0932e73..9ab67a4ad 100755 --- a/workflow/engine/bin/cron.php +++ b/workflow/engine/bin/cron.php @@ -5,7 +5,7 @@ */ if ( !defined('PATH_SEP') ) { - define('PATH_SEP', ( substr(PHP_OS, 0, 3) == 'WIN' ) ? '\\' : '/'); + define("PATH_SEP", (substr(PHP_OS, 0, 3) == "WIN")? "\\" : "/"); } $docuroot = explode(PATH_SEP, str_replace('engine' . PATH_SEP . 'methods' . PATH_SEP . 'services', '', dirname(__FILE__))); @@ -129,7 +129,7 @@ if ($force || !$bCronIsRunning) { $oDirectory = dir(PATH_DB); $cws = 0; - while($sObject = $oDirectory->read()) { + while (($sObject = $oDirectory->read()) !== false) { if (($sObject != ".") && ($sObject != "..")) { if (is_dir(PATH_DB . $sObject)) { if (file_exists(PATH_DB . $sObject . PATH_SEP . "db.php")) { @@ -141,6 +141,10 @@ if ($force || !$bCronIsRunning) { } } } else { + if (!is_dir(PATH_DB . $ws) || !file_exists(PATH_DB . $ws . PATH_SEP . "db.php")) { + throw new Exception("Error: The workspace \"$ws\" does not exist"); + } + $cws = 1; system("php -f \"" . dirname(__FILE__) . PATH_SEP . "cron_single.php\" $ws \"$sDate\" \"$dateSystem\" $argsx", $retval); diff --git a/workflow/engine/bin/cron_single.php b/workflow/engine/bin/cron_single.php index dbe2951c0..4d7b59945 100755 --- a/workflow/engine/bin/cron_single.php +++ b/workflow/engine/bin/cron_single.php @@ -10,11 +10,6 @@ register_shutdown_function( ) ); -/** - * cron_single.php - * @package workflow-engine-bin - */ - if (!defined('SYS_LANG')) { define('SYS_LANG', 'en'); } @@ -220,9 +215,6 @@ Bootstrap::registerClass('CaseTrackerObject', PATH_HOME . "engine/classes/mod Bootstrap::registerClass('BaseCaseTrackerObjectPeer',PATH_HOME . "engine/classes/model/om/BaseCaseTrackerObjectPeer.php"); Bootstrap::registerClass('CaseTrackerObjectPeer', PATH_HOME . "engine/classes/model/CaseTrackerObjectPeer.php"); -Bootstrap::registerClass('BaseConfiguration', PATH_HOME . "engine/classes/model/om/BaseConfiguration.php"); -Bootstrap::registerClass('Configuration', PATH_HOME . "engine/classes/model/Configuration.php"); - Bootstrap::registerClass('BaseDbSource', PATH_HOME . "engine/classes/model/om/BaseDbSource.php"); Bootstrap::registerClass('DbSource', PATH_HOME . "engine/classes/model/DbSource.php"); @@ -367,7 +359,7 @@ Bootstrap::registerClass("AddonsManagerPeer", PATH_HOME . "engine" . PATH_SEP Bootstrap::registerClass('dashboards', PATH_HOME . "engine/classes/class.dashboards.php"); /*----------------------------------********---------------------------------*/ -$arrayClass = array("EmailServer", "ListInbox", "ListParticipatedHistory"); +$arrayClass = array("Configuration", "EmailServer", "ListInbox", "ListParticipatedHistory"); foreach ($arrayClass as $value) { Bootstrap::registerClass("Base" . $value, PATH_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "om" . PATH_SEP . "Base" . $value . ".php"); diff --git a/workflow/engine/bin/messageeventcron.php b/workflow/engine/bin/messageeventcron.php index e8d1d9a50..4d884768d 100644 --- a/workflow/engine/bin/messageeventcron.php +++ b/workflow/engine/bin/messageeventcron.php @@ -114,6 +114,10 @@ try { } } } else { + if (!is_dir(PATH_DB . $workspace) || !file_exists(PATH_DB . $workspace . PATH_SEP . "db.php")) { + throw new Exception("Error: The workspace \"$workspace\" does not exist"); + } + $countw++; passthru("php -f \"$messageEventCronSinglePath\" $workspace \"" . base64_encode(PATH_HOME) . "\" \"" . base64_encode(PATH_TRUNK) . "\" \"" . base64_encode(PATH_OUTTRUNK) . "\""); diff --git a/workflow/engine/bin/rest-gen b/workflow/engine/bin/rest-gen index aa2135bc2..e5b3bf127 100755 --- a/workflow/engine/bin/rest-gen +++ b/workflow/engine/bin/rest-gen @@ -24,8 +24,8 @@ Usage: {$argv[0]} [build-crud] [gen-ini] [-p ] [-w Options: build-crud : Task, build Rest Crud API. gen-ini : Task, generates the rest config ini file. - -p : Especify a plugin to set as enviroment to perform the tasks. - -w : Especify a workspace to set as enviroment to perform the tasks. + -p : Specifies a plugin to set as environment to perform the tasks. + -w : Specifies a workspace to set as environment to perform the tasks. EOT; @@ -42,7 +42,7 @@ try { case 'gen-ini': if (isset($argv[2])) { if (! isset($argv[3])) { - throw new Exception("Missing option, need especify a valid argument after option '{$argv[2]}'"); + throw new Exception("Missing option, need specify a valid argument after option '{$argv[2]}'"); } switch ($argv[2]) { diff --git a/workflow/engine/bin/tasks/cliUpgrade.php b/workflow/engine/bin/tasks/cliUpgrade.php index 5d6bd71bf..958413427 100755 --- a/workflow/engine/bin/tasks/cliUpgrade.php +++ b/workflow/engine/bin/tasks/cliUpgrade.php @@ -217,7 +217,7 @@ function run_unify_database($args) if ($count > 1) { if(!Bootstrap::isLinuxOs()){ - CLI::error("This is not a Linux enviroment, please especify workspace.\n"); + CLI::error("This is not a Linux enviroment, please specify workspace.\n"); return; } } diff --git a/workflow/engine/classes/class.Upgrade.php b/workflow/engine/classes/class.Upgrade.php index 4e830c09f..2f0f0b903 100644 --- a/workflow/engine/classes/class.Upgrade.php +++ b/workflow/engine/classes/class.Upgrade.php @@ -98,7 +98,7 @@ class Upgrade $installedMD5 = ""; } else { $time = microtime(1); - $installedMD5 = md5_file($installedFile); + $installedMD5 = G::encryptFileOld($installedFile); $checksumTime += microtime(1) - $time; } $archiveMD5 = $checksum; diff --git a/workflow/engine/classes/class.case.php b/workflow/engine/classes/class.case.php index 87839c453..4f27344f9 100755 --- a/workflow/engine/classes/class.case.php +++ b/workflow/engine/classes/class.case.php @@ -4100,6 +4100,7 @@ class Cases $oApplication = new Application(); $aFields = $oApplication->load($sApplicationUID); + $appStatusCurrent = $aFields['APP_STATUS']; $oCriteria = new Criteria('workflow'); $oCriteria->add(AppDelegationPeer::APP_UID, $sApplicationUID); $oCriteria->add(AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNULL); @@ -4168,9 +4169,10 @@ class Cases } /*----------------------------------********---------------------------------*/ $data = array ( - 'APP_UID' => $sApplicationUID, - 'DEL_INDEX' => $iIndex, - 'USR_UID' => $user_logged + 'APP_UID' => $sApplicationUID, + 'DEL_INDEX' => $iIndex, + 'USR_UID' => $user_logged, + 'APP_STATUS_CURRENT' => $appStatusCurrent ); $data = array_merge($aFields, $data); $oListCanceled = new ListCanceled(); diff --git a/workflow/engine/classes/class.derivation.php b/workflow/engine/classes/class.derivation.php index 7e81cab80..1085bab39 100755 --- a/workflow/engine/classes/class.derivation.php +++ b/workflow/engine/classes/class.derivation.php @@ -752,14 +752,19 @@ class Derivation //$appFields['APP_PROC_CODE'] = $nextDel['TAS_DEF_PROC_CODE']; /*----------------------------------********---------------------------------*/ if ($nextDel['TAS_UID'] != '-1') { - $taskCur = TaskPeer::retrieveByPK($nextDel['TAS_UID']); - $aTask = $taskCur->toArray( BasePeer::TYPE_FIELDNAME ); + $taskNex = TaskPeer::retrieveByPK($nextDel['TAS_UID']); + $aTask = $taskNex->toArray( BasePeer::TYPE_FIELDNAME ); $arrayTaskTypeToExclude = array("WEBENTRYEVENT", "END-MESSAGE-EVENT", "START-MESSAGE-EVENT", "INTERMEDIATE-THROW-MESSAGE-EVENT", "INTERMEDIATE-CATCH-MESSAGE-EVENT"); if (!in_array($aTask['TAS_TYPE'], $arrayTaskTypeToExclude)) { if (!empty($iNewDelIndex) && empty($aSP)) { $oAppDel = AppDelegationPeer::retrieveByPK( $appFields['APP_UID'], $iNewDelIndex ); $aFields = $oAppDel->toArray( BasePeer::TYPE_FIELDNAME ); $aFields['APP_STATUS'] = $currentDelegation['APP_STATUS']; + $taskCur = TaskPeer::retrieveByPK($currentDelegation['TAS_UID']); + $aTaskCur = $taskCur->toArray( BasePeer::TYPE_FIELDNAME ); + if ($aTaskCur['TAS_TYPE'] == "INTERMEDIATE-CATCH-MESSAGE-EVENT") { + $removeList = false; + } $aFields['REMOVED_LIST'] = $removeList; $inbox = new ListInbox(); $inbox->newRow($aFields, $appFields['CURRENT_USER_UID'], false, array(), ($nextDel['TAS_ASSIGN_TYPE'] == 'SELF_SERVICE' ? true : false)); diff --git a/workflow/engine/classes/class.indicatorsCalculator.php b/workflow/engine/classes/class.indicatorsCalculator.php index 321e1857e..badf19261 100644 --- a/workflow/engine/classes/class.indicatorsCalculator.php +++ b/workflow/engine/classes/class.indicatorsCalculator.php @@ -151,12 +151,12 @@ class indicatorsCalculator $params[":endMonth"] = $endMonth; $params[":language"] = $language; - $sqlString = " - select + $sqlString = "select i.PRO_UID as uid, tp.CON_VALUE as name, efficiencyIndex, - inefficiencyCost + inefficiencyCost, + @curRow := @curRow + 1 AS rank from ( select PRO_UID, @@ -172,12 +172,14 @@ class indicatorsCalculator AND IF(`YEAR` = :endYear, `MONTH`, `YEAR`) <= IF (`YEAR` = :endYear, :endMonth, :endYear) group by PRO_UID + order by $this->peiFormula DESC ) i left join (select * - from CONTENT - where CON_CATEGORY = 'PRO_TITLE' - and CON_LANG = :language - ) tp on i.PRO_UID = tp.CON_ID"; + from CONTENT + where CON_CATEGORY = 'PRO_TITLE' + and CON_LANG = :language + ) tp on i.PRO_UID = tp.CON_ID + join (SELECT @curRow := 0) order_table"; //$retval = $this->propelExecutor($sqlString); $retval = $this->pdoExecutor($sqlString, $params); @@ -210,7 +212,8 @@ class indicatorsCalculator efficiencyIndex, inefficiencyCost, averageTime, - deviationTime + deviationTime, + @curRow := @curRow + 1 AS rank from ( select gu.GRP_UID, @@ -224,12 +227,14 @@ class indicatorsCalculator WHERE IF(`YEAR` = :endYear, `MONTH`, `YEAR`) <= IF (`YEAR` = :endYear, :endMonth, :endYear) group by gu.GRP_UID + order by $this->ueiFormula DESC ) i left join (select * from CONTENT where CON_CATEGORY = 'GRP_TITLE' and CON_LANG = :language - ) tp on i.GRP_UID = tp.CON_ID"; + ) tp on i.GRP_UID = tp.CON_ID + join (SELECT @curRow := 0) order_table"; $retval = $this->pdoExecutor($sqlString, $params); //$retval = $this->propelExecutor($sqlString); @@ -262,7 +267,8 @@ class indicatorsCalculator efficiencyIndex, inefficiencyCost, averageTime, - deviationTime + deviationTime, + @curRow := @curRow + 1 AS rank from ( select u.USR_UID, @@ -279,7 +285,9 @@ class indicatorsCalculator AND IF(`YEAR` = :endYear, `MONTH`, `YEAR`) <= IF (`YEAR` = :endYear, :endMonth, :endYear) group by ur.USR_UID - ) i"; + order by $this->ueiFormula DESC + ) i + join (SELECT @curRow := 0) order_table"; $retval = $this->pdoExecutor($sqlString, $params); //$returnValue = $this->propelExecutor($sqlString); diff --git a/workflow/engine/classes/class.pluginRegistry.php b/workflow/engine/classes/class.pluginRegistry.php index e6a24a476..27248d4fa 100755 --- a/workflow/engine/classes/class.pluginRegistry.php +++ b/workflow/engine/classes/class.pluginRegistry.php @@ -399,22 +399,19 @@ class PMPluginRegistry } /** - * get status plugin in the singleton + * Get status plugin in the singleton * - * @param unknown_type $sNamespace + * @param string $name Plugin name + * + * return mixed Return a string with status plugin, 0 otherwise */ - public function getStatusPlugin ($sNamespace) + public function getStatusPlugin($name) { - foreach ($this->_aPluginDetails as $namespace => $detail) { - if ($sNamespace == $namespace) { - if ($this->_aPluginDetails[$sNamespace]->enabled) { - return 'enabled'; - } else { - return 'disabled'; - } - } + try { + return (isset($this->_aPluginDetails[$name]))? (($this->_aPluginDetails[$name]->enabled)? "enabled" : "disabled") : 0; + } catch (Excepton $e) { + throw $e; } - return 0; } /** diff --git a/workflow/engine/classes/class.system.php b/workflow/engine/classes/class.system.php index 12f4bb0dc..4c8b48c29 100755 --- a/workflow/engine/classes/class.system.php +++ b/workflow/engine/classes/class.system.php @@ -260,7 +260,7 @@ class System continue; } if (file_exists( realpath( $filename ) )) { - if (strcmp( $checksum, md5_file( realpath( $filename ) ) ) != 0) { + if (strcmp( $checksum, G::encryptFileOld( realpath( $filename ) ) ) != 0) { $result['diff'][] = $filename; } } else { @@ -542,7 +542,7 @@ class System $file = PATH_TRUNK . trim( $line[2] ); if (is_readable( $file )) { $size = sprintf( "%07d", filesize( $file ) ); - $checksum = sprintf( "%010u", crc32( file_get_contents( $file ) ) ); + $checksum = sprintf( "%010u", G::encryptCrc32( file_get_contents( $file ) ) ); if (! ($line[0] == $size && $line[1] == $checksum) && substr( $file, - 4 ) != '.xml') { $distinctFiles .= $file . "\n"; $distinct ++; diff --git a/workflow/engine/classes/model/AddonsManager.php b/workflow/engine/classes/model/AddonsManager.php index ada2ffb3e..f9fddeb6a 100644 --- a/workflow/engine/classes/model/AddonsManager.php +++ b/workflow/engine/classes/model/AddonsManager.php @@ -61,7 +61,7 @@ class AddonsManager extends BaseAddonsManager if ($download_md5 == null) { return null; } - return (strcasecmp(md5_file($filename), $download_md5) == 0); + return (strcasecmp(G::encryptFileOld($filename), $download_md5) == 0); } /** diff --git a/workflow/engine/classes/model/Application.php b/workflow/engine/classes/model/Application.php index 2c08b541d..944bf3932 100755 --- a/workflow/engine/classes/model/Application.php +++ b/workflow/engine/classes/model/Application.php @@ -367,7 +367,7 @@ class Application extends BaseApplication $pin = G::generateCode(4, 'ALPHANUMERIC'); $this->setAppData(serialize(array('PIN' => $pin))); - $this->setAppPin(md5($pin)); + $this->setAppPin(G::encryptOld($pin)); $c = new Criteria(); $c->clearSelectColumns(); diff --git a/workflow/engine/classes/model/DashboardIndicator.php b/workflow/engine/classes/model/DashboardIndicator.php index c33abdf7c..e0eef6b5c 100644 --- a/workflow/engine/classes/model/DashboardIndicator.php +++ b/workflow/engine/classes/model/DashboardIndicator.php @@ -27,7 +27,7 @@ class DashboardIndicator extends BaseDashboardIndicator throw $error; } } - function loadbyDasUid ($dasUid, $vmeasureDate, $vcompareDate, $userUid) + function loadbyDasUid ($dasUid, $vcompareDate, $vmeasureDate, $userUid) { G::loadClass('indicatorsCalculator'); $calculator = new \IndicatorsCalculator(); @@ -64,11 +64,15 @@ class DashboardIndicator extends BaseDashboardIndicator $value = current(reset($calculator->peiHistoric($uid, $measureDate, $measureDate, \ReportingPeriodicityEnum::NONE))); $oldValue = current(reset($calculator->peiHistoric($uid, $compareDate, $compareDate, \ReportingPeriodicityEnum::NONE))); $row['DAS_IND_VARIATION'] = $value - $oldValue; + $row['DAS_IND_OLD_VALUE'] = $oldValue; + $row['DAS_IND_PERCENT_VARIATION'] = round(($value - $oldValue) * 100 / (($oldValue == 0) ? 1 : $oldValue), 1); break; case '1030': $value = current(reset($calculator->ueiHistoric(null, $measureDate, $measureDate, \ReportingPeriodicityEnum::NONE))); $oldValue = current(reset($calculator->ueiHistoric($uid, $compareDate, $compareDate, \ReportingPeriodicityEnum::NONE))); $row['DAS_IND_VARIATION'] = $value - $oldValue; + $row['DAS_IND_OLD_VALUE'] = $oldValue; + $row['DAS_IND_PERCENT_VARIATION'] = round(($value - $oldValue) * 100 / (($oldValue == 0) ? 1 : $oldValue), 1); break; case '1050': $value = $calculator->statusIndicatorGeneral($userUid); diff --git a/workflow/engine/classes/model/ListCanceled.php b/workflow/engine/classes/model/ListCanceled.php index a81944440..f5d740bc4 100644 --- a/workflow/engine/classes/model/ListCanceled.php +++ b/workflow/engine/classes/model/ListCanceled.php @@ -104,9 +104,21 @@ class ListCanceled extends BaseListCanceled { $oListInbox->removeAll($data['APP_UID']); $users = new Users(); - $users->refreshTotal($data['USR_UID'], 'removed', 'inbox'); + if (!empty($data['APP_STATUS_CURRENT']) && $data['APP_STATUS_CURRENT'] == 'DRAFT') { + $users->refreshTotal($data['USR_UID'], 'removed', 'draft'); + } else { + $users->refreshTotal($data['USR_UID'], 'removed', 'inbox'); + } $users->refreshTotal($data['USR_UID'], 'add', 'canceled'); + //Update - WHERE + $criteriaWhere = new Criteria("workflow"); + $criteriaWhere->add(ListParticipatedLastPeer::APP_UID, $data["APP_UID"], Criteria::EQUAL); + //Update - SET + $criteriaSet = new Criteria("workflow"); + $criteriaSet->add(ListParticipatedLastPeer::APP_STATUS, 'CANCELLED'); + BasePeer::doUpdate($criteriaWhere, $criteriaSet, Propel::getConnection("workflow")); + $con = Propel::getConnection( ListCanceledPeer::DATABASE_NAME ); try { $this->fromArray( $data, BasePeer::TYPE_FIELDNAME ); diff --git a/workflow/engine/config/schema.xml b/workflow/engine/config/schema.xml index d196baf25..4245350f7 100755 --- a/workflow/engine/config/schema.xml +++ b/workflow/engine/config/schema.xml @@ -269,7 +269,7 @@ - + @@ -4844,15 +4844,15 @@ - - - - - - - - - + + + + + + + + + @@ -4891,15 +4891,15 @@ - - - - - - - - - + + + + + + + + +
@@ -4942,7 +4942,7 @@ - + @@ -4997,6 +4997,7 @@
+ @@ -5011,7 +5012,7 @@ - + diff --git a/workflow/engine/controllers/installer.php b/workflow/engine/controllers/installer.php index 6222f97fc..737653c5a 100755 --- a/workflow/engine/controllers/installer.php +++ b/workflow/engine/controllers/installer.php @@ -848,7 +848,7 @@ class Installer extends Controller // Write the paths_installed.php file (contains all the information configured so far) if (! file_exists( FILE_PATHS_INSTALLED )) { - $sh = md5( filemtime( PATH_GULLIVER . '/class.g.php' ) ); + $sh = G::encryptOld( filemtime( PATH_GULLIVER . '/class.g.php' ) ); $h = G::encrypt( $db_hostname . $sh . $db_username . $sh . $db_password, $sh ); $dbText = "mssqlQuery( $query ); - $query = sprintf( "UPDATE USERS SET USR_USERNAME = '%s', USR_PASSWORD = '%s' WHERE USR_UID = '00000000000000000000000000000001' ", $adminUsername, md5( $adminPassword ) ); + $query = sprintf( "UPDATE USERS SET USR_USERNAME = '%s', USR_PASSWORD = '%s' WHERE USR_UID = '00000000000000000000000000000001' ", $adminUsername, G::encryptOld( $adminPassword ) ); $this->mssqlQuery( $query ); $query = sprintf( "USE %s;", $wf ); $this->mssqlQuery( $query ); - $query = sprintf( "UPDATE RBAC_USERS SET USR_USERNAME = '%s', USR_PASSWORD = '%s' WHERE USR_UID = '00000000000000000000000000000001' ", $adminUsername, md5( $adminPassword ) ); + $query = sprintf( "UPDATE RBAC_USERS SET USR_USERNAME = '%s', USR_PASSWORD = '%s' WHERE USR_UID = '00000000000000000000000000000001' ", $adminUsername, G::encryptOld( $adminPassword ) ); $this->mssqlQuery( $query ); // Write the paths_installed.php file (contains all the information configured so far) if (! file_exists( FILE_PATHS_INSTALLED )) { - $sh = md5( filemtime( PATH_GULLIVER . '/class.g.php' ) ); + $sh = G::encryptOld( filemtime( PATH_GULLIVER . '/class.g.php' ) ); $h = G::encrypt( $db_hostname . $sh . $db_username . $sh . $db_password . '1', $sh ); $dbText = "setVar('translation', $translation); $this->render(); } catch (Exception $error) { @@ -208,7 +215,41 @@ class StrategicDashboard extends Controller { try { $this->setView( 'strategicDashboard/viewDashboardIE' ); + $this->setVar('urlProxy',$this->urlProxy); + $this->setVar('usrId',$this->usrId); + $this->setVar('credentials',$this->clientToken); + + $translation = array(); + + $translation['ID_MANAGERS_DASHBOARDS'] = G::LoadTranslation( 'ID_MANAGERS_DASHBOARDS'); + $translation['ID_PRO_EFFICIENCY_INDEX'] = G::LoadTranslation( 'ID_PRO_EFFICIENCY_INDEX'); + $translation['ID_EFFICIENCY_USER'] = G::LoadTranslation( 'ID_EFFICIENCY_USER'); + $translation['ID_COMPLETED_CASES'] = G::LoadTranslation( 'ID_COMPLETED_CASES'); + $translation['ID_WELL_DONE'] = G::LoadTranslation( 'ID_WELL_DONE'); + $translation['ID_NUMBER_CASES'] = G::LoadTranslation( 'ID_NUMBER_CASES'); + $translation['ID_EFFICIENCY_INDEX'] = G::LoadTranslation( 'ID_EFFICIENCY_INDEX'); + $translation['ID_INEFFICIENCY_COST'] = G::LoadTranslation( 'ID_INEFFICIENCY_COST'); + $translation['ID_EFFICIENCY_COST'] = G::LoadTranslation( 'ID_EFFICIENCY_COST'); + $translation['ID_RELATED_PROCESS'] = G::LoadTranslation( 'ID_RELATED_PROCESS'); + $translation['ID_RELATED_GROUPS'] = G::LoadTranslation( 'ID_RELATED_GROUPS'); + $translation['ID_RELATED_TASKS'] = G::LoadTranslation( 'ID_RELATED_TASKS'); + $translation['ID_RELATED_USERS'] = G::LoadTranslation( 'ID_RELATED_USERS'); + $translation['ID_GRID_PAGE_NO_DASHBOARD_MESSAGE'] = G::LoadTranslation( 'ID_GRID_PAGE_NO_DASHBOARD_MESSAGE'); + $translation['ID_PROCESS_TASKS'] = G::LoadTranslation( 'ID_PROCESS_TASKS'); + $translation['ID_TIME_HOURS'] = G::LoadTranslation( 'ID_TIME_HOURS'); + $translation['ID_GROUPS'] = G::LoadTranslation( 'ID_GROUPS'); + $translation['ID_COSTS'] = G::LoadTranslation( 'ID_COSTS'); + $translation['ID_TASK'] = G::LoadTranslation( 'ID_TASK'); + $translation['ID_USER'] = G::LoadTranslation( 'ID_USER'); + $translation['ID_YEAR'] = G::LoadTranslation( 'ID_YEAR'); + $translation['ID_USERS'] = G::LoadTranslation( 'ID_USERS'); + $translation['ID_OVERDUE'] = G::LoadTranslation( 'ID_OVERDUE'); + $translation['ID_AT_RISK'] = G::LoadTranslation( 'ID_AT_RISK'); + $translation['ID_ON_TIME'] = G::LoadTranslation( 'ID_ON_TIME'); + + $this->setVar('translation', $translation); $this->render(); + } catch (Exception $error) { } catch (Exception $error) { $_SESSION['__DASHBOARD_ERROR__'] = $error->getMessage(); die(); diff --git a/workflow/engine/data/mysql/schema.sql b/workflow/engine/data/mysql/schema.sql index 22fa6d65d..52a0cb4eb 100755 --- a/workflow/engine/data/mysql/schema.sql +++ b/workflow/engine/data/mysql/schema.sql @@ -2,6 +2,7 @@ # This is a fix for InnoDB in MySQL >= 4.1.x # It "suspends judgement" for fkey relationships until are tables are set. SET FOREIGN_KEY_CHECKS = 0; +SET @@global.sql_mode='MYSQL40'; #----------------------------------------------------------------------------- #-- APPLICATION @@ -2705,13 +2706,14 @@ CREATE TABLE `USR_REPORTING` `TOTAL_TIME_BY_TASK` DECIMAL(7,2) default 0, `TOTAL_CASES_IN` DECIMAL(7,2) default 0, `TOTAL_CASES_OUT` DECIMAL(7,2) default 0, + `USER_HOUR_COST` DECIMAL(7,2) default 0, `AVG_TIME` DECIMAL(7,2) default 0, `SDV_TIME` DECIMAL(7,2) default 0, `CONFIGURED_TASK_TIME` DECIMAL(7,2) default 0, `TOTAL_CASES_OVERDUE` DECIMAL(7,2) default 0, `TOTAL_CASES_ON_TIME` DECIMAL(7,2) default 0, - PRIMARY KEY (`USR_UID`, `TAS_UID`,`MONTH`,`YEAR`) - KEY `indexApp`(`USR_UID`, `TAS_UID`, `PRO_UID`) + PRIMARY KEY (`USR_UID`, `TAS_UID`,`MONTH`,`YEAR`), + KEY `indexReporting`(`USR_UID`, `TAS_UID`, `PRO_UID`) )ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='Data calculated users by task'; #----------------------------------------------------------------------------- #-- PRO_REPORTING @@ -2748,7 +2750,6 @@ CREATE TABLE `DASHBOARD` `DAS_UID` VARCHAR(32) default '' NOT NULL, `DAS_TITLE` VARCHAR(255) default '' NOT NULL, `DAS_DESCRIPTION` MEDIUMTEXT, - `DAS_VERSION` VARCHAR(10) default '1.0' NOT NULL, `DAS_CREATE_DATE` DATETIME NOT NULL, `DAS_UPDATE_DATE` DATETIME, `DAS_STATUS` TINYINT default 1 NOT NULL, @@ -2763,17 +2764,21 @@ DROP TABLE IF EXISTS `DASHBOARD_INDICATOR`; CREATE TABLE `DASHBOARD_INDICATOR` ( - `DAS_IND_UID` VARCHAR(32) default '' NOT NULL, - `DAS_UID` VARCHAR(32) default '' NOT NULL, - `DAS_IND_TYPE` VARCHAR(32) default '' NOT NULL, - `DAS_IND_TITLE` VARCHAR(255) default '' NOT NULL, - `DAS_IND_GOAL` DECIMAL(7,2) default 0, - `DAS_UID_PROCESS` VARCHAR(32) default '' NOT NULL, - `DAS_IND_PROPERTIES` MEDIUMTEXT, - `DAS_CREATE_DATE` DATETIME NOT NULL, - `DAS_UPDATE_DATE` DATETIME, - `DAS_STATUS` TINYINT default 1 NOT NULL, - PRIMARY KEY (`DAS_UID`), + `DAS_IND_UID` VARCHAR(32) default '' NOT NULL, + `DAS_UID` VARCHAR(32) default '' NOT NULL, + `DAS_IND_TYPE` VARCHAR(32) default '' NOT NULL, + `DAS_IND_TITLE` VARCHAR(255) default '' NOT NULL, + `DAS_IND_GOAL` DECIMAL(7,2) default 0, + `DAS_IND_DIRECTION` TINYINT default 2 NOT NULL, + `DAS_UID_PROCESS` VARCHAR(32) default '' NOT NULL, + `DAS_IND_FIRST_FIGURE` VARCHAR(32) default '', + `DAS_IND_FIRST_FREQUENCY` VARCHAR(32) default '', + `DAS_IND_SECOND_FIGURE` VARCHAR(32) default '', + `DAS_IND_SECOND_FREQUENCY` VARCHAR(32) default '', + `DAS_IND_CREATE_DATE` DATETIME NOT NULL, + `DAS_IND_UPDATE_DATE` DATETIME, + `DAS_IND_STATUS` TINYINT default 1 NOT NULL, + PRIMARY KEY (`DAS_IND_UID`), KEY `indexDashboard`(`DAS_UID`, `DAS_IND_TYPE`), CONSTRAINT `fk_dashboard_indicator_dashboard` FOREIGN KEY (`DAS_UID`) @@ -2791,7 +2796,7 @@ CREATE TABLE `DASHBOARD_DAS_IND` `DAS_UID` VARCHAR(32) default '' NOT NULL, `OWNER_UID` VARCHAR(32) default '' NOT NULL, `OWNER_TYPE` VARCHAR(15) default '' NOT NULL, - PRIMARY KEY (`DAS_UID`), + PRIMARY KEY (`DAS_UID`,`OWNER_UID`), CONSTRAINT `fk_dashboard_indicator_dashboard_das_ind` FOREIGN KEY (`DAS_UID`) REFERENCES `DASHBOARD` (`DAS_UID`) diff --git a/workflow/engine/js/strategicDashboard/viewDashboardHelper.js b/workflow/engine/js/strategicDashboard/viewDashboardHelper.js index b7f47e83b..f975872bf 100644 --- a/workflow/engine/js/strategicDashboard/viewDashboardHelper.js +++ b/workflow/engine/js/strategicDashboard/viewDashboardHelper.js @@ -139,7 +139,8 @@ ViewDashboardHelper.prototype.merge = function (objFrom, objTo, propMap) { toKey = propMap[fromKey]; //force toKey to an array of toKeys - if (!Array.isArray(toKey)) { + //if (!Array.isArray(toKey)) { + if (!$.isArray(toKey)) { toKey = [toKey]; } @@ -147,14 +148,17 @@ ViewDashboardHelper.prototype.merge = function (objFrom, objTo, propMap) { def = null; transform = null; key = toKey[x]; - keyIsArray = Array.isArray(key); + //keyIsArray = Array.isArray(key); + keyIsArray = $.isArray(key); if (typeof(key) === "object" && !keyIsArray) { - def = key.default || null; + //def = (key.default || null); + def = null; transform = key.transform || null; key = key.key; //evaluate if the new key is an array - keyIsArray = Array.isArray(key); + // keyIsArray = Array.isArray(key); + keyIsArray = $.isArray(key); } if (keyIsArray) { diff --git a/workflow/engine/js/strategicDashboard/viewDashboardPresenter.js b/workflow/engine/js/strategicDashboard/viewDashboardPresenter.js index b8e135391..435c4f8ba 100644 --- a/workflow/engine/js/strategicDashboard/viewDashboardPresenter.js +++ b/workflow/engine/js/strategicDashboard/viewDashboardPresenter.js @@ -57,6 +57,7 @@ ViewDashboardPresenter.prototype.dashboardIndicatorsViewModel = function(data) { "DAS_IND_TITLE" : "title", "DAS_IND_TYPE" : "type", "DAS_IND_VARIATION" : "comparative", + "DAS_IND_PERCENT_VARIATION" : "percentComparative", "DAS_IND_DIRECTION" : "direction", "DAS_IND_VALUE" : "value", "DAS_IND_X" : "x", @@ -76,7 +77,6 @@ ViewDashboardPresenter.prototype.dashboardIndicatorsViewModel = function(data) { newObject.toDrawY = (newObject.y == 0) ? 6 : newObject.y; newObject.toDrawHeight = (newObject.y == 0) ? 2 : newObject.height; newObject.toDrawWidth = (newObject.y == 0) ? 12 / data.length : newObject.width; - newObject.comparative = ((newObject.comparative > 0)? "+": "") + that.helper.stringIfNull(newObject.comparative); newObject.directionSymbol = (newObject.direction == "1") ? "<" : ">"; newObject.isWellDone = (newObject.direction == "1") ? parseFloat(newObject.value) <= parseFloat(newObject.comparative) @@ -86,10 +86,9 @@ ViewDashboardPresenter.prototype.dashboardIndicatorsViewModel = function(data) { ? "special" : "normal"; - //round goals for normal indicators - newObject.comparative = (newObject.category == "normal") - ? Math.round(newObject.comparative) + "" - : newObject.comparative; + //rounding + newObject.comparative = Math.round(newObject.comparative*1000)/1000; + newObject.comparative = ((newObject.comparative > 0)? "+": "") + newObject.comparative; newObject.value = (newObject.category == "normal") ? Math.round(newObject.value) + "" @@ -170,7 +169,19 @@ ViewDashboardPresenter.prototype.peiViewModel = function(data) { : newObject.datalabel.substring(0,15); newObject.datalabel = shortLabel; - graphData.push(newObject); + + //use positive values for drawing; + if (newObject.value > 0) { + newObject.value = 0; + } + if (newObject.value < 0) { + newObject.value = Math.abs(newObject.value); + } + + if (newObject.value > 0) { + graphData.push(newObject); + } + originalObject.inefficiencyCostToShow = "$ " + Math.round(originalObject.inefficiencyCost); originalObject.efficiencyIndexToShow = Math.round(originalObject.efficiencyIndex * 100) / 100; originalObject.indicatorId = data.id; @@ -186,16 +197,6 @@ ViewDashboardPresenter.prototype.peiViewModel = function(data) { }) retval.dataToDraw = graphData.splice(0,7); - //use positive values for drawing; - $.each(retval.dataToDraw, function(index, item) { - if (item.value > 0) { - item.value = 0; - } - if (item.value < 0) { - item.value = Math.abs(item.value); - } - }); - //TODO aumentar el símbolo de moneda $ retval.inefficiencyCostToShow = "$ " +Math.round(retval.inefficiencyCost); @@ -220,7 +221,17 @@ ViewDashboardPresenter.prototype.ueiViewModel = function(data) { : newObject.datalabel.substring(0,7); newObject.datalabel = shortLabel; - graphData.push(newObject); + //use positive values for drawing; + if (newObject.value > 0) { + newObject.value = 0; + } + if (newObject.value < 0) { + newObject.value = Math.abs(newObject.value); + } + + if (newObject.value > 0) { + graphData.push(newObject); + } originalObject.inefficiencyCostToShow = "$ " + Math.round(originalObject.inefficiencyCost); originalObject.efficiencyIndexToShow = Math.round(originalObject.efficiencyIndex * 100) / 100; originalObject.indicatorId = data.id; @@ -231,22 +242,11 @@ ViewDashboardPresenter.prototype.ueiViewModel = function(data) { retval = data; graphData.sort(function(a,b) { var retval = 0; - retval = ((a.value*1.0 <= b.value*1.0) ? -1 : 1); + retval = ((a.value*1.0 <= b.value*1.0) ? 1 : -1); return retval; }) retval.dataToDraw = graphData.splice(0,7); - //use positive values for drawing; - $.each(retval.dataToDraw, function(index, item) { - if (item.value > 0) { - item.value = 0; - } - if (item.value < 0) { - item.value = Math.abs(item.value); - } - }); - - //TODO aumentar el símbolo de moneda $ retval.inefficiencyCostToShow = "$ " + Math.round(retval.inefficiencyCost); retval.efficiencyIndexToShow = Math.round(retval.efficiencyIndex * 100) / 100; @@ -366,16 +366,32 @@ ViewDashboardPresenter.prototype.returnIndicatorSecondLevelPei = function(modelD $.each(modelData, function(index, originalObject) { var map = { "name" : "datalabel", - "averageTime" : "value", + "inefficiencyCost" : "value", "deviationTime" : "dispersion" }; var newObject = that.helper.merge(originalObject, {}, map); newObject.datalabel = ((newObject.datalabel == null) ? "" : newObject.datalabel.substring(0, 7)); originalObject.inefficiencyCostToShow = "$ " + Math.round(originalObject.inefficiencyCost); originalObject.efficiencyIndexToShow = Math.round(originalObject.efficiencyIndex * 100) / 100; - graphData.push(newObject); + originalObject.deviationTimeToShow = Math.round(originalObject.deviationTime); + //use positive values for drawing; + if (newObject.value > 0) { + newObject.value = 0; + } + if (newObject.value < 0) { + newObject.value = Math.abs(newObject.value); + } + + if (newObject.value > 0) { + graphData.push(newObject); + } }); var retval = {}; + graphData.sort(function(a,b) { + var retval = 0; + retval = ((a.value*1.0 <= b.value*1.0) ? 1 : -1); + return retval; + }) retval.dataToDraw = graphData.splice(0,7); retval.entityData = modelData; return retval; @@ -391,16 +407,33 @@ ViewDashboardPresenter.prototype.returnIndicatorSecondLevelUei = function(modelD $.each(modelData, function(index, originalObject) { var map = { "name" : "datalabel", - "averageTime" : "value", + "inefficiencyCost" : "value", "deviationTime" : "dispersion" }; var newObject = that.helper.merge(originalObject, {}, map); newObject.datalabel = ((newObject.datalabel == null) ? "" : newObject.datalabel.substring(0, 7)); originalObject.inefficiencyCostToShow = "$ " +Math.round(originalObject.inefficiencyCost); originalObject.efficiencyIndexToShow = Math.round(originalObject.efficiencyIndex * 100) / 100; - graphData.push(newObject); + originalObject.deviationTimeToShow = Math.round(originalObject.deviationTime); + //use positive values for drawing; + if (newObject.value > 0) { + newObject.value = 0; + } + if (newObject.value < 0) { + newObject.value = Math.abs(newObject.value); + } + + if (newObject.value > 0) { + graphData.push(newObject); + } + }); var retval = {}; + graphData.sort(function(a,b) { + var retval = 0; + retval = ((a.value*1.0 <= b.value*1.0) ? 1 : -1); + return retval; + }) retval.dataToDraw = graphData.splice(0,7); retval.entityData = modelData; return retval; diff --git a/workflow/engine/js/strategicDashboard/viewDashboardView.js b/workflow/engine/js/strategicDashboard/viewDashboardView.js index 81b7590b5..0cec9c51e 100644 --- a/workflow/engine/js/strategicDashboard/viewDashboardView.js +++ b/workflow/engine/js/strategicDashboard/viewDashboardView.js @@ -134,7 +134,6 @@ WidgetBuilder.prototype.buildSpecialIndicatorSecondView = function (secondViewDa $retval.find(".sind-index-selector").text(G_STRING.ID_EFFICIENCY_INDEX); $retval.find(".sind-cost-selector").text(G_STRING.ID_INEFFICIENCY_COST); - $retval.find('.breadcrumb').find('li').remove(); $retval.find('.breadcrumb').append ('
  • ' + window.currentIndicator.title + '
  • '); $retval.find('.breadcrumb').append ('
  • ' + window.currentEntityData.name + '
  • '); @@ -273,7 +272,7 @@ $(document).ready(function() { } else { favoriteData = 0; }*/ - if (typeof idWidGet != "undefined") { + if (typeof idWidGet != "undefined" && el.hasClass('ind-button-selector')) { var widgetsObj = { 'indicatorId': idWidGet, 'x': item.x, @@ -513,7 +512,7 @@ var fillStatusIndicatorFirstView = function (presenterData) { showLabels: true } }; - + var graph1 = new PieChart(presenterData.graph1Data, graphParams1, null, null); graph1.drawChart(); var graphParams2 = graphParams1; @@ -588,8 +587,8 @@ var fillSpecialIndicatorFirstView = function(presenterData) { graph: { allowDrillDown:false, allowTransition:true, - axisX:{ showAxis: true, label: G_STRING.ID_YEAR }, - axisY:{ showAxis: true, label: "Q" }, + axisX:{ showAxis: true, label: G_STRING.ID_GROUPS}, + axisY:{ showAxis: true, label: G_STRING.ID_COSTS}, gridLinesX:false, gridLinesY:true, showTip: true, @@ -670,8 +669,8 @@ var fillSpecialIndicatorSecondView = function(presenterData) { gridLinesX: true, gridLinesY: true, area: {visible: false, css:"area"}, - axisX:{ showAxis: true, label: G_STRING.ID_USERS }, - axisY:{ showAxis: true, label: G_STRING.ID_TIME_HOURS }, + axisX:{ showAxis: true, label: G_STRING.ID_USER }, + axisY:{ showAxis: true, label: G_STRING.ID_COSTS }, showErrorBars: true } @@ -680,6 +679,7 @@ var fillSpecialIndicatorSecondView = function(presenterData) { var indicatorPrincipalData = widgetBuilder.getIndicatorLoadedById(window.currentEntityData.indicatorId); if (window.currentIndicator.type == "1010") { + detailParams.graph.axisX.label = G_STRING.ID_TASK; var graph = new BarChart(presenterData.dataToDraw, detailParams, null, null); graph.drawChart(); } @@ -788,7 +788,7 @@ var fillGeneralIndicatorFirstView = function (presenterData) { allowDrillDown:false, allowTransition:true, axisX:{ showAxis: true, label: G_STRING.ID_YEAR }, - axisY:{ showAxis: true, label: "Q" }, + axisY:{ showAxis: true, label: G_STRING.ID_COSTS}, gridLinesX:false, gridLinesY:true, showTip: true, @@ -810,7 +810,7 @@ var fillGeneralIndicatorFirstView = function (presenterData) { allowDrillDown:false, allowTransition:true, axisX:{ showAxis: true, label: G_STRING.ID_YEAR }, - axisY:{ showAxis: true, label: "Q" }, + axisY:{ showAxis: true, label: G_STRING.ID_COSTS }, gridLinesX:false, gridLinesY:true, showTip: true, diff --git a/workflow/engine/js/strategicDashboard/viewDashboardViewIE.js b/workflow/engine/js/strategicDashboard/viewDashboardViewIE.js new file mode 100644 index 000000000..dad069276 --- /dev/null +++ b/workflow/engine/js/strategicDashboard/viewDashboardViewIE.js @@ -0,0 +1,760 @@ +/**************************************************************/ +var WidgetBuilder = function () { + this.helper = new ViewDashboardHelper(); +} + +WidgetBuilder.prototype.getIndicatorWidget = function (indicator) { + var retval = null; + switch(indicator.type) { + case "1010": retval = this.buildSpecialIndicatorButton(indicator); break; + case "1030": retval = this.buildSpecialIndicatorButton(indicator); break; + case "1050": retval = this.buildStatusIndicatorButton(indicator); break; + case "1020": + case "1040": + case "1060": + case "1070": + case "1080": + retval = this.buildIndicatorButton(indicator); break; + } + if(retval == null) {throw new Error(indicator.type + " has not associated a widget.");} + return retval; +}; + +WidgetBuilder.prototype.buildSpecialIndicatorButton = function (indicator) { + _.templateSettings.variable = "indicator"; + var template = _.template ($("script.specialIndicatorButtonTemplate").html()); + var $retval = $(template(indicator)); + + if(indicator.comparative < 0){ + $retval.find(".ind-container-selector").removeClass("panel-green").addClass("panel-red"); + $retval.find(".ind-symbol-selector").removeClass("fa-chevron-up").addClass("fa-chevron-down"); + } + + if(indicator.comparative > 0){ + $retval.find(".ind-container-selector").removeClass("panel-red").addClass("panel-green"); + $retval.find(".ind-symbol-selector").removeClass("fa-chevron-down").addClass("fa-chevron-up"); + } + + if(indicator.comparative == 0){ + $retval.find(".ind-symbol-selector").removeClass("fa-chevron-up"); + $retval.find(".ind-symbol-selector").removeClass("fa-chevron-down"); + $retval.find(".ind-symbol-selector").addClass("fa-circle-o"); + $retval.find(".ind-container-selector").removeClass("panel-red").addClass("panel-green"); + } + return $retval; +} + +WidgetBuilder.prototype.buildStatusIndicatorButton = function (indicator) { + _.templateSettings.variable = "indicator"; + var template = _.template ($("script.statusIndicatorButtonTemplate").html()); + var $retval = $(template(indicator)); + return $retval; +} + +WidgetBuilder.prototype.buildIndicatorButton = function (indicator) { + _.templateSettings.variable = "indicator"; + var template = _.template ($("script.statusIndicatorButtonTemplate").html()); + var $retval = $(template(indicator)); + var $comparative = $retval.find('.ind-comparative-selector'); + var $title = $retval.find('.ind-title-selector'); + if (indicator.isWellDone) { + $comparative.text("(" + indicator.directionSymbol + " " + indicator.comparative + "%)-"+ G_STRING.ID_WELL_DONE); + $retval.find(".ind-container-selector").removeClass("panel-low").addClass("panel-high"); + } + else { + $comparative.text("Goal: " + indicator.directionSymbol + " " + indicator.comparative + "%"); + $retval.find(".ind-container-selector").removeClass("panel-high").addClass("panel-low"); + } + return $retval; +} + +WidgetBuilder.prototype.buildSpecialIndicatorFirstView = function (indicatorData) { + if (indicatorData == null) { throw new Error ("indicatorData is null."); } + if (!indicatorData.hasOwnProperty("id")) { throw new Error ("indicatorData has no id."); } + + _.templateSettings.variable = "indicator"; + var template = _.template ($("script.specialIndicatorMainPanel").html()); + var $retval = $(template(indicatorData)); + var indicatorPrincipalData = this.getIndicatorLoadedById(indicatorData.id) + $retval.find('.breadcrumb').find('li').remove() + $retval.find('.breadcrumb').append ('
  • '+indicatorPrincipalData.title+'
  • ') + $retval.find(".sind-index-selector").text(G_STRING.ID_EFFICIENCY_INDEX); + $retval.find(".sind-cost-selector").text(G_STRING.ID_INEFFICIENCY_COST); + this.setColorForInefficiency($retval.find(".sind-cost-number-selector"), indicatorData); + return $retval; +} + +WidgetBuilder.prototype.buildSpecialIndicatorFirstViewDetail = function (oneItemDetail) { + //detailData = {indicatorId, uid, name, averateTime...} + if (oneItemDetail == null){throw new Error("oneItemDetail is null ");} + if (!typeof(oneItemDetail) === 'object'){throw new Error( "detailData is not and object ->" + oneItemDetail);} + if (!oneItemDetail.hasOwnProperty("name")){throw new Error("buildSpecialIndicatorFirstViewDetail -> detailData has not the name param. Has it the correct Type? ->" + oneItemDetail);} + + _.templateSettings.variable = "detailData"; + var template = _.template ($("script.specialIndicatorDetail").html()); + var $retval = $(template(oneItemDetail)); + $retval.find(".detail-efficiency-selector").text(G_STRING.ID_EFFICIENCY_INDEX); + $retval.find(".detail-cost-selector").text(G_STRING.ID_INEFFICIENCY_COST); + this.setColorForInefficiency($retval.find(".detail-cost-number-selector"), oneItemDetail); + return $retval; +} + +WidgetBuilder.prototype.buildStatusIndicatorFirstView = function (indicatorData) { + if (indicatorData == null) { throw new Error ("indicatorData is null."); } + if (!indicatorData.hasOwnProperty("id")) { throw new Error ("indicatorData has no id."); } + + _.templateSettings.variable = "indicator"; + var template = _.template ($("script.statusIndicatorMainPanel").html()); + var $retval = $(template(indicatorData)); + var indicatorPrincipalData = this.getIndicatorLoadedById(indicatorData.id) + $retval.find('.breadcrumb').find('li').remove() + $retval.find('.breadcrumb').append ('
  • '+indicatorPrincipalData.title+'
  • ') + return $retval; +} + +WidgetBuilder.prototype.buildStatusIndicatorFirstViewDetail = function (oneItemDetail) { + //detailData = {indicatorId, uid, name, averateTime...} + if (oneItemDetail == null){throw new Error("oneItemDetail is null ");} + if (!typeof(oneItemDetail) === 'object'){throw new Error( "detailData is not and object ->" + oneItemDetail);} + if (!oneItemDetail.hasOwnProperty("taskTitle")){throw new Error("detailData has not the name param. Has it the correct Type? ->" + oneItemDetail);} + + _.templateSettings.variable = "detailData"; + var template = _.template ($("script.statusDetail").html()); + var $retval = $(template(oneItemDetail)); + return $retval; +} + +WidgetBuilder.prototype.buildSpecialIndicatorSecondView = function (secondViewData) { + //presenterData= object {dataToDraw[], entityData[] //user/tasks data} + _.templateSettings.variable = "indicator"; + var template = _.template ($("script.specialIndicatorMainPanel").html()); + var $retval = $(template(window.currentEntityData)); + //var indicatorPrincipalData = this.getIndicatorLoadedById(indicatorId); + //$retval.find(".sind-title-selector").text(indicatorPrincipalData.title); + $retval.find(".sind-index-selector").text(G_STRING.ID_EFFICIENCY_INDEX); + $retval.find(".sind-cost-selector").text(G_STRING.ID_INEFFICIENCY_COST); + + $retval.find('.breadcrumb').find('li').remove(); + $retval.find('.breadcrumb').append ('
  • ' + window.currentIndicator.title + '
  • '); + $retval.find('.breadcrumb').append ('
  • ' + window.currentEntityData.name + '
  • '); + this.setColorForInefficiency($retval.find(".sind-cost-number-selector"), window.currentEntityData); + return $retval; +}; + +WidgetBuilder.prototype.buildSpecialIndicatorSecondViewDetailPei = function (oneItemDetail) { + if (oneItemDetail == null){throw new Error("oneItemDetail is null ");} + if (!typeof(oneItemDetail) === 'object'){throw new Error( "detailData is not and object ->" + oneItemDetail);} + if (!oneItemDetail.hasOwnProperty("name")){throw new Error("buildSpecialIndicatorFirstViewDetail -> detailData has not the name param. Has it the correct Type? ->" + oneItemDetail);} + + _.templateSettings.variable = "detailData"; + var template = _.template ($("script.specialIndicatorSencondViewDetailPei").html()); + var $retval = $(template(oneItemDetail)); + $retval.find(".detail-efficiency-selector").text(G_STRING.ID_EFFICIENCY_INDEX); + $retval.find(".detail-cost-selector").text(G_STRING.ID_INEFFICIENCY_COST); + this.setColorForInefficiency($retval.find(".detail-cost-number-selector"), oneItemDetail); + return $retval; +} + +WidgetBuilder.prototype.buildSpecialIndicatorSecondViewDetailUei = function (oneItemDetail) { + if (oneItemDetail == null){throw new Error("oneItemDetail is null ");} + if (!typeof(oneItemDetail) === 'object'){throw new Error( "detailData is not and object ->" + oneItemDetail);} + if (!oneItemDetail.hasOwnProperty("name")){throw new Error("buildSpecialIndicatorFirstViewDetail -> detailData has not the name param. Has it the correct Type? ->" + oneItemDetail);} + + _.templateSettings.variable = "detailData"; + var template = _.template ($("script.specialIndicatorSencondViewDetailUei").html()); + var $retval = $(template(oneItemDetail)); + $retval.find(".detail-efficiency-selector").text(G_STRING.ID_EFFICIENCY_INDEX); + $retval.find(".detail-cost-selector").text(G_STRING.ID_INEFFICIENCY_COST); + this.setColorForInefficiency($retval.find(".detail-cost-number-selector"), oneItemDetail); + return $retval; +} + +WidgetBuilder.prototype.buildSpecialIndicatorSecondViewDetaiUei = function (oneItemDetail) { + if (oneItemDetail == null){throw new Error("oneItemDetail is null ");} + if (!typeof(oneItemDetail) === 'object'){throw new Error( "detailData is not and object ->" + oneItemDetail);} + if (!oneItemDetail.hasOwnProperty("name")){throw new Error("buildSpecialIndicatorFirstViewDetail -> detailData has not the name param. Has it the correct Type? ->" + oneItemDetail);} + + _.templateSettings.variable = "detailData"; + var template = _.template ($("script.specialIndicatorSencondViewDetailUei").html()); + var $retval = $(template(oneItemDetail)); + $retval.find(".detail-efficiency-selector").text(G_STRING.ID_EFFICIENCY_INDEX); + $retval.find(".detail-cost-selector").text(G_STRING.ID_INEFFICIENCY_COST); + this.setColorForInefficiency($retval.find(".detail-cost-number-selector"), oneItemDetail); + return $retval; +} + +WidgetBuilder.prototype.getIndicatorLoadedById = function (searchedIndicatorId) { + var retval = null; + for (key in window.loadedIndicators) { + var indicator = window.loadedIndicators[key]; + if (indicator.id == searchedIndicatorId) { + retval = indicator; + } + } + if (retval == null) { throw new Error(searchedIndicatorId + " was not found in the loaded indicators.");} + return retval; +} + +WidgetBuilder.prototype.buildGeneralIndicatorFirstView = function (indicatorData) { + _.templateSettings.variable = "indicator"; + var template = _.template ($("script.generalIndicatorMainPanel").html()); + var $retval = $(template(indicatorData)); + $retval.find(".ind-title-selector").text(window.currentIndicator.title); + return $retval; +} + + +WidgetBuilder.prototype.setColorForInefficiency = function ($widget, indicatorData) { + //turn red/gree the font according if is positive or negative: var $widget = $retval.find(".sind-cost-number-selector"); + $widget.removeClass("red"); + $widget.removeClass("green"); + if (indicatorData.inefficiencyCost >= 0) { + $widget.addClass("green"); + } + else { + $widget.addClass("red"); + } +} + +/**********************************************************************/ +helper = new ViewDashboardHelper(); +var ws = urlProxy.split('/'); +model = new ViewDashboardModel(token, urlProxy, ws[3]); +presenter = new ViewDashboardPresenter(model); + +window.loadedIndicators = []; //updated in das-title-selector.click->fillIndicatorWidgets, ready->fillIndicatorWidgets +window.currentEntityData = null; +window.currentIndicator = null;//updated in ind-button-selector.click ->loadIndicator, ready->loadIndicator +window.currentDashboardId = null; +window.currentDetailFunction = null; +window.currentDetailList = null; + +$(document).ready(function() { + initialDraw(); +}); + + +var initialDraw = function () { + presenter.getUserDashboards(pageUserId) + .then(function(dashboardsVM) { + fillDashboardsList(dashboardsVM); + if (window.currentDashboardId == null) {return;} + /**** window initialization with favorite dashboard*****/ + presenter.getDashboardIndicators(window.currentDashboardId, defaultInitDate(), defaultEndDate()) + .done(function(indicatorsVM) { + fillIndicatorWidgets(indicatorsVM); + }); + }); +} + +var loadIndicator = function (indicatorId, initDate, endDate) { + if (indicatorId == null || indicatorId === undefined) {return;} + var builder = new WidgetBuilder(); + window.currentIndicator = builder.getIndicatorLoadedById(indicatorId); + presenter.getIndicatorData(indicatorId, window.currentIndicator.type, initDate, endDate) + .done(function (viewModel) { + switch (window.currentIndicator.type) { + case "1010": + case "1030": + fillSpecialIndicatorFirstView(viewModel); + break; + case "1050": + fillStatusIndicatorFirstView(viewModel); + break; + default: + fillGeneralIndicatorFirstView(viewModel); + break; + } + }); +} + +var setIndicatorActiveMarker = function () { + $('.panel-footer').each (function () { + $(this).removeClass('panel-active'); + var indicatorId = $(this).parents('.ind-button-selector').data('indicator-id'); + if (window.currentIndicator.id == indicatorId) { + $(this).addClass('panel-active'); + } + }); +} + +var getFavoriteIndicator = function() { + var retval = (window.loadedIndicators.length > 0) + ? window.loadedIndicators[0] + : null; + for (key in window.loadedIndicators) { + var indicator = window.loadedIndicators[key]; + if (indicator.favorite == 1) { + retval = indicator; + } + } + if (retval==null) {throw new Error ('No favorites found.');} + return retval; +} + +var defaultInitDate = function() { + var date = new Date(); + var dateMonth = date.getMonth(); + var dateYear = date.getFullYear(); + var initDate = $('#year').val() + '-' + $('#month').val() + '-' + '01'; + return initDate; +} + +var defaultEndDate = function () { + var date = new Date(); + var dateMonth = date.getMonth(); + var dateYear = date.getFullYear(); + return dateYear + "-" + (dateMonth + 1) + "-30"; +} + +var fillDashboardsList = function (presenterData) { + if (presenterData == null || presenterData.length == 0) { + $('#dashboardsList').append(G_STRING['ID_NO_DATA_TO_DISPLAY']); + } + _.templateSettings.variable = "dashboard"; + var template = _.template ($("script.dashboardButtonTemplate").html()) + for (key in presenterData) { + var dashboard = presenterData[key]; + $('#dashboardsList').append(template(dashboard)); + if (dashboard.isFavorite == 1) { + window.currentDashboardId = dashboard.id; + $('#dashboardButton-' + dashboard.id) + .find('.das-icon-selector') + .addClass('selected'); + } + } + +}; + +var fillIndicatorWidgets = function (presenterData) { + if (presenterData == null || presenterData === undefined) {return;} + var widgetBuilder = new WidgetBuilder(); + var grid = $('#indicatorsGridStack'); + window.loadedIndicators = presenterData; + $.each(presenterData, function(key, indicator) { + var $widget = widgetBuilder.getIndicatorWidget(indicator); + grid.append($widget, indicator.toDrawX, indicator.toDrawY, indicator.toDrawWidth, indicator.toDrawHeight, true); + }); +} + +var fillStatusIndicatorFirstView = function (presenterData) { + var widgetBuilder = new WidgetBuilder(); + var panel = $('#indicatorsDataGridStack').data('gridstack'); + panel.remove_all(); + $('#relatedDetailGridStack').data('gridstack').remove_all(); + + var $widget = widgetBuilder.buildStatusIndicatorFirstView(presenterData); + panel.add_widget($widget, 0, 15, 20, 4.7, true); + + var graphParams1 = { + canvas : { + containerId:'graph1', + width:300, + height:300, + stretch:true + }, + graph: { + + allowDrillDown:true, + allowTransition:true, + showTip: true, + allowZoom: false, + showLabels: true + } + }; + + var graph1 = new PieChart(presenterData.graph1Data, graphParams1, null, null); + graph1.drawChart(); + var graphParams2 = graphParams1; + graphParams2.canvas.containerId = "graph2"; + var graph2 = new PieChart(presenterData.graph2Data, graphParams2, null, null); + graph2.drawChart(); + var graphParams3 = graphParams1; + graphParams3.canvas.containerId = "graph3"; + var graph3 = new PieChart(presenterData.graph3Data, graphParams3, null, null); + graph3.drawChart(); + + var indicatorPrincipalData = widgetBuilder.getIndicatorLoadedById(presenterData.id) + setIndicatorActiveMarker(); + $('#relatedLabel').hide(); +} + +var fillStatusIndicatorFirstViewDetail = function(presenterData) { + var widgetBuilder = new WidgetBuilder(); + var gridDetail = $('#relatedDetailGridStack').data('gridstack'); + //gridDetail.remove_all(); + $.each(presenterData.dataList, function(index, dataItem) { + var $widget = widgetBuilder.buildStatusIndicatorFirstViewDetail(dataItem); + var x = (index % 2 == 0) ? 6 : 0; + gridDetail.add_widget($widget, x, 15, 6, 2, true); + }); + if (window.currentIndicator.type == "1010") { + $('#relatedLabel').find('h3').text(G_STRING['ID_RELATED_PROCESS']); + } + if (window.currentIndicator.type == "1030") { + $('#relatedLabel').find('h3').text(G_STRING['ID_RELATED_GROUPS']); + } + if (window.currentIndicator.type == "1050") { + $('#relatedLabel').find('h3').text(G_STRING['ID_RELATED_PROCESS']); + } +} + +var fillSpecialIndicatorFirstView = function(presenterData) { + $('#relatedLabel').show(); + var widgetBuilder = new WidgetBuilder(); + var panel = $('#indicatorsDataGridStack').data('gridstack'); + panel.remove_all(); + $('#relatedDetailGridStack').data('gridstack').remove_all(); + + var $widget = widgetBuilder.buildSpecialIndicatorFirstView(presenterData); + panel.add_widget($widget, 0, 15, 20, 4.7, true); + var peiParams = { + canvas : { + containerId:'specialIndicatorGraph', + width:300, + height:300, + stretch:true + }, + graph: { + allowDrillDown:false, + allowTransition:true, + showTip: true, + allowZoom: false, + gapWidth:0.3, + useShadows: true, + thickness: 30, + showLabels: true + } + }; + + var ueiParams = { + canvas : { + containerId:'specialIndicatorGraph', + width:500, + height:300, + stretch:true + }, + graph: { + allowDrillDown:false, + allowTransition:true, + axisX:{ showAxis: true, label: "Group" }, + axisY:{ showAxis: true, label: "Cost" }, + gridLinesX:false, + gridLinesY:true, + showTip: true, + allowZoom: false, + useShadows: true, + paddingTop: 50 + } + }; + + var indicatorPrincipalData = widgetBuilder.getIndicatorLoadedById(presenterData.id) + + if (indicatorPrincipalData.type == "1010") { + var graph = new Pie3DChart(presenterData.dataToDraw, peiParams, null, null); + graph.drawChart(); + //the pie chart goes to much upwards,so a margin is added: + $('#specialIndicatorGraph').css('margin-top','60px'); + } + + if (indicatorPrincipalData.type == "1030") { + var graph = new BarChart(presenterData.dataToDraw, ueiParams, null, null); + graph.drawChart(); + } + + + this.fillSpecialIndicatorFirstViewDetail(presenter.orderDataList(presenterData.data, selectedOrderOfDetailList())); + setIndicatorActiveMarker(); +} + +var fillSpecialIndicatorFirstViewDetail = function (list) { + //presenterData = { id: "indId", efficiencyIndex: "0.11764706", efficiencyVariation: -0.08235294, + // inefficiencyCost: "-127.5000", inefficiencyCostToShow: -127, efficiencyIndexToShow: 0.12 + // data: {indicatorId, uid, name, averateTime...}, dataToDraw: [{datalabe, value}] } + var widgetBuilder = new WidgetBuilder(); + var gridDetail = $('#relatedDetailGridStack').data('gridstack'); + gridDetail.remove_all(); + + window.currentDetailList = list; + window.currentDetailFunction = fillSpecialIndicatorFirstViewDetail; + + $.each(list, function(index, dataItem) { + var $widget = widgetBuilder.buildSpecialIndicatorFirstViewDetail(dataItem); + var x = (index % 2 == 0) ? 6 : 0; + //the first 2 elements are not hidden + if (index < 2) { + $widget.removeClass("hideme"); + } + gridDetail.add_widget($widget, x, 15, 6, 2, true); + }); + if (window.currentIndicator.type == "1010") { + $('#relatedLabel').find('h3').text(G_STRING['ID_RELATED_PROCESS']); + } + if (window.currentIndicator.type == "1030") { + $('#relatedLabel').find('h3').text(G_STRING['ID_RELATED_GROUPS']); + } + hideScrollIfAllDivsAreVisible(); +} + +var fillSpecialIndicatorSecondView = function(presenterData) { + //presenterData= object {dataToDraw[], entityData[] //user/tasks data} + var widgetBuilder = new WidgetBuilder(); + var panel = $('#indicatorsDataGridStack').data('gridstack'); + panel.remove_all(); + var $widget = widgetBuilder.buildSpecialIndicatorSecondView(presenterData); + panel.add_widget($widget, 0, 15, 20, 4.7, true); + var detailParams = { + canvas : { + containerId:'specialIndicatorGraph', + width:300, + height:300, + stretch:true + }, + graph: { + allowTransition: false, + allowDrillDown: true, + showTip: true, + allowZoom: false, + useShadows: false, + gridLinesX: true, + gridLinesY: true, + area: {visible: false, css:"area"}, + axisX:{ showAxis: true, label: "User" }, + axisY:{ showAxis: true, label: "Cost" }, + showErrorBars: true + + } + }; + + var indicatorPrincipalData = widgetBuilder.getIndicatorLoadedById(window.currentEntityData.indicatorId); + + if (window.currentIndicator.type == "1010") { + detailParams.graph.axisX.label = "Task"; + var graph = new BarChart(presenterData.dataToDraw, detailParams, null, null); + graph.drawChart(); + } + + if (window.currentIndicator.type == "1030") { + var graph = new BarChart(presenterData.dataToDraw, detailParams, null, null); + graph.drawChart(); + } + this.fillSpecialIndicatorSecondViewDetail(presenter.orderDataList(presenterData.entityData, selectedOrderOfDetailList())); +} + +var fillSpecialIndicatorSecondViewDetail = function (list) { + //presenterData = { entityData: Array[{name,uid,inefficiencyCost, + // inefficiencyIndex, deviationTime, + // averageTime}], + // dataToDraw: Array[{datalabel, value}] } + var widgetBuilder = new WidgetBuilder(); + var gridDetail = $('#relatedDetailGridStack').data('gridstack'); + gridDetail.remove_all(); + + window.currentDetailList = list; + window.currentDetailFunction = fillSpecialIndicatorSecondViewDetail; + + $.each(list, function(index, dataItem) { + if (window.currentIndicator.type == "1010") { + var $widget = widgetBuilder.buildSpecialIndicatorSecondViewDetailPei(dataItem); + } + + if (window.currentIndicator.type == "1030") { + var $widget = widgetBuilder.buildSpecialIndicatorSecondViewDetailUei(dataItem); + } + + var x = (index % 2 == 0) ? 6 : 0; + //the first 2 elements are not hidden + if (index < 2) { + $widget.removeClass("hideme"); + } + gridDetail.add_widget($widget, x, 15, 6, 2, true); + }); + + if (window.currentIndicator.type == "1010") { + $('#relatedLabel').find('h3').text(G_STRING['ID_RELATED_TASKS']); + } + if (window.currentIndicator.type == "1030") { + $('#relatedLabel').find('h3').text(G_STRING['ID_RELATED_USERS']); + } + hideScrollIfAllDivsAreVisible(); +} + +var fillGeneralIndicatorFirstView = function (presenterData) { + var widgetBuilder = new WidgetBuilder(); + var panel = $('#indicatorsDataGridStack').data('gridstack'); + panel.remove_all(); + $('#relatedDetailGridStack').data('gridstack').remove_all(); + + var $widget = widgetBuilder.buildGeneralIndicatorFirstView(presenterData); + panel.add_widget($widget, 0, 15, 20, 4.7, true); + + $('#relatedLabel').find('h3').text(''); + + var generalLineParams1 = { + canvas : { + containerId:'generalGraph1', + width:300, + height:300, + stretch:true + }, + graph: { + allowTransition: false, + allowDrillDown: true, + showTip: true, + allowZoom: false, + useShadows: false, + gridLinesX: true, + gridLinesY: true, + area: {visible: false, css:"area"}, + axisX:{ showAxis: true, label: G_STRING.ID_PROCESS_TASKS }, + axisY:{ showAxis: true, label: G_STRING.ID_TIME_HOURS }, + showErrorBars: false + } + }; + + var generalLineParams2 = { + canvas : { + containerId:'generalGraph2', + width:300, + height:300, + stretch:true + }, + graph: { + allowTransition: false, + allowDrillDown: true, + showTip: true, + allowZoom: false, + useShadows: false, + gridLinesX: true, + gridLinesY: true, + area: {visible: false, css:"area"}, + axisX:{ showAxis: true, label: G_STRING.ID_PROCESS_TASKS }, + axisY:{ showAxis: true, label: G_STRING.ID_TIME_HOURS }, + showErrorBars: false + } + }; + + var generalBarParams1 = { + canvas : { + containerId:'generalGraph1', + width:300, + height:300, + stretch:true + }, + graph: { + allowDrillDown:false, + allowTransition:true, + axisX:{ showAxis: true, label: G_STRING.ID_YEAR }, + axisY:{ showAxis: true, label: "Q" }, + gridLinesX:false, + gridLinesY:true, + showTip: true, + allowZoom: false, + useShadows: true, + paddingTop: 50, + colorPalette: ['#5486bf','#bf8d54','#acb30c','#7a0c0c','#bc0000','#906090','#007efb','#62284a','#0c7a7a','#74a9a9'] + } + }; + + var generalBarParams2 = { + canvas : { + containerId:'generalGraph2', + width:300, + height:300, + stretch:true + }, + graph: { + allowDrillDown:false, + allowTransition:true, + axisX:{ showAxis: true, label: G_STRING.ID_YEAR }, + axisY:{ showAxis: true, label: "Q" }, + gridLinesX:false, + gridLinesY:true, + showTip: true, + allowZoom: false, + useShadows: true, + paddingTop: 50, + colorPalette: ['#5486bf','#bf8d54','#acb30c','#7a0c0c','#bc0000','#906090','#007efb','#62284a','#0c7a7a','#74a9a9'] + } + }; + + var graph1 = null; + if (presenterData.graph1Type == '10') { + generalBarParams1.graph.axisX.label = presenterData.graph1XLabel; + generalBarParams1.graph.axisY.label = presenterData.graph1YLabel; + graph1 = new BarChart(presenterData.graph1Data, generalBarParams1, null, null); + } else { + generalLineParams1.graph.axisX.label = presenterData.graph1XLabel; + generalLineParams1.graph.axisY.label = presenterData.graph1YLabel; + graph1 = new LineChart(presenterData.graph1Data, generalLineParams1, null, null); + } + graph1.drawChart(); + + var graph2 = null; + if (presenterData.graph2Type == '10') { + generalBarParams2.graph.axisX.label = presenterData.graph2XLabel; + generalBarParams2.graph.axisY.label = presenterData.graph2YLabel; + graph2 = new BarChart(presenterData.graph2Data, generalBarParams2, null, null); + } else { + generalLineParams2.graph.axisX.label = presenterData.graph2XLabel; + generalLineParams2.graph.axisY.label = presenterData.graph2YLabel; + graph2 = new LineChart(presenterData.graph2Data, generalLineParams2, null, null); + } + graph2.drawChart(); + + setIndicatorActiveMarker(); +} + +var animateProgress = function (indicatorItem, widget){ + var getRequestAnimationFrame = function () { + return window.requestAnimationFrame || + window.webkitRequestAnimationFrame || + window.mozRequestAnimationFrame || + window.oRequestAnimationFrame || + window.msRequestAnimationFrame || + function ( callback ){ + window.setTimeout(enroute, 1 / 60 * 1000); + }; + }; + + var fpAnimationFrame = getRequestAnimationFrame(); + var i = 0; + var j = 0; + + var indicator = indicatorItem; + var animacion = function () { + var intComparative = parseInt(indicator.comparative); + var divId = "#indicatorButton" + indicator.id; + var $valueLabel = widget + .find('.ind-value-selector'); + var $progressBar = widget + .find('.ind-progress-selector'); + + if (!($valueLabel.length > 0)) {throw new Error ('"No ind-value-selector found for " + divId');} + this.helper.assert($progressBar.length > 0, "No ind-progress-selector found for " + divId); + $progressBar.attr('aria-valuemax', intComparative); + var indexToPaint = Math.min(indicator.value * 100 / intComparative, 100); + + if (i <= indexToPaint) { + $progressBar.css('width', i+'%').attr('aria-valuenow', i); + i++; + fpAnimationFrame(animacion); + } + + if(j <= indicator.value){ + $valueLabel.text(j + "%"); + j++; + fpAnimationFrame(animacion); + } + + } + fpAnimationFrame(animacion); +}; + +/*var dashboardButtonTemplate = '
    \ + \ + \ +
    ';*/ + + + diff --git a/workflow/engine/methods/authSources/authSources_Ajax.php b/workflow/engine/methods/authSources/authSources_Ajax.php index 5e2dbb57b..edf936350 100755 --- a/workflow/engine/methods/authSources/authSources_Ajax.php +++ b/workflow/engine/methods/authSources/authSources_Ajax.php @@ -149,16 +149,30 @@ try { } break; case 'authSourcesNew': + $pluginRegistry = &PMPluginRegistry::getSingleton(); + $arr = Array (); $oDirectory = dir( PATH_RBAC . 'plugins' . PATH_SEP ); - $aAuthSourceTypes = array (); + while ($sObject = $oDirectory->read()) { if (($sObject != '.') && ($sObject != '..') && ($sObject != '.svn') && ($sObject != 'ldap')) { if (is_file( PATH_RBAC . 'plugins' . PATH_SEP . $sObject )) { - $sType = trim( str_replace( 'class.', '', str_replace( '.php', '', $sObject ) ) ); - $aAuthSourceTypes['sType'] = $sType; - $aAuthSourceTypes['sLabel'] = $sType; - $arr[] = $aAuthSourceTypes; + $sType = trim(str_replace(array("class.", ".php"), "", $sObject)); + + $statusPlugin = $pluginRegistry->getStatusPlugin($sType); + $flagAdd = false; + + if (preg_match("/^(?:enabled|disabled)$/", $statusPlugin)) { + if ($statusPlugin == "enabled") { + $flagAdd = true; + } + } else { + $flagAdd = true; + } + + if ($flagAdd) { + $arr[] = array("sType" => $sType, "sLabel" => $sType); + } } } } diff --git a/workflow/engine/methods/cases/caseHistory_Ajax.php b/workflow/engine/methods/cases/caseHistory_Ajax.php index 85c94c7f4..052298332 100644 --- a/workflow/engine/methods/cases/caseHistory_Ajax.php +++ b/workflow/engine/methods/cases/caseHistory_Ajax.php @@ -137,7 +137,7 @@ if ($actionAjax == "showDynaformHistoryGetNomDynaform_JXP") { $dynTitle = $contentObjeto->getConValue(); } - $md5Hash = md5( $idDin . $dynDate ); + $md5Hash = G::encryptOld( $idDin . $dynDate ); //assign task $result = new stdClass(); diff --git a/workflow/engine/methods/cases/casesListExtJs.php b/workflow/engine/methods/cases/casesListExtJs.php index 7d86cf9b0..48e7560e3 100755 --- a/workflow/engine/methods/cases/casesListExtJs.php +++ b/workflow/engine/methods/cases/casesListExtJs.php @@ -42,6 +42,12 @@ switch ($action) { $urlProxy = 'proxyCasesList'; $action = 'unassigned'; break; + case 'to_revise': + $urlProxy = 'proxyCasesList'; + break; + case 'to_reassign': + $urlProxy = 'proxyCasesList'; + break; } /*----------------------------------********---------------------------------*/ diff --git a/workflow/engine/methods/cases/cases_StepToRevise.php b/workflow/engine/methods/cases/cases_StepToRevise.php index d693fae4c..dbf7e5f88 100755 --- a/workflow/engine/methods/cases/cases_StepToRevise.php +++ b/workflow/engine/methods/cases/cases_StepToRevise.php @@ -138,7 +138,7 @@ if (! isset( $_GET['ex'] )) { // DEPRECATED this JS section is marked for removal function setSelect() { - var ex=; + var ex=xssFilterHard($_GET['ex'])?>; try { for(i=1; i<50; i++) { if (i == ex) { diff --git a/workflow/engine/methods/cases/cases_StepToReviseInputs.php b/workflow/engine/methods/cases/cases_StepToReviseInputs.php index b4999f81e..07d45ca39 100755 --- a/workflow/engine/methods/cases/cases_StepToReviseInputs.php +++ b/workflow/engine/methods/cases/cases_StepToReviseInputs.php @@ -140,7 +140,7 @@ G::RenderPage( 'publish', 'blank' ); //Deprecated Section since the interface are now movig to ExtJS function setSelect() { - var ex=; + var ex=xssFilterHard($_GET['ex'])?>; try { for (i=1; i<50; i++) { if (i == ex) { diff --git a/workflow/engine/methods/cases/cases_StepToReviseOutputs.php b/workflow/engine/methods/cases/cases_StepToReviseOutputs.php index 976b75dc5..1a78eaf4f 100755 --- a/workflow/engine/methods/cases/cases_StepToReviseOutputs.php +++ b/workflow/engine/methods/cases/cases_StepToReviseOutputs.php @@ -84,7 +84,7 @@ if (! isset( $_GET['ex'] )) { //Deprecated Section since the interface are now movig to ExtJS function setSelect() { - var ex=; + var ex=xssFilterHard($_GET['ex'])?>; try{ for (i=1; i<50; i++) { if (i == ex) { diff --git a/workflow/engine/methods/cases/cases_ToReviseOutputDocView.php b/workflow/engine/methods/cases/cases_ToReviseOutputDocView.php index 351d778d9..b978b21e0 100755 --- a/workflow/engine/methods/cases/cases_ToReviseOutputDocView.php +++ b/workflow/engine/methods/cases/cases_ToReviseOutputDocView.php @@ -104,7 +104,7 @@ if (! isset( $_GET['ex'] )) { /*------------------------------ To Revise Routines ---------------------------*/ function setSelect() { - var ex=; + var ex=xssFilterHard($_GET['ex'])?>; try{ for(i=1; i<50; i++) { diff --git a/workflow/engine/methods/dynaforms/dynaforms_FlatEditor.php b/workflow/engine/methods/dynaforms/dynaforms_FlatEditor.php index 0014b64f9..b615b5005 100755 --- a/workflow/engine/methods/dynaforms/dynaforms_FlatEditor.php +++ b/workflow/engine/methods/dynaforms/dynaforms_FlatEditor.php @@ -170,12 +170,12 @@ G::RenderPage( "publish", "raw" ); + {/literal} + + + + + +
    + +
    + + + +
    +
    +
    +

    {translate label="ID_DASH_CLICK_TO_VIEW"}

    +

    + +

    +
    +

    +
    +
    +
    + + + + + + +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + + + +
    +
    +
    +
    +
    + + - diff --git a/workflow/engine/templates/users/users.js b/workflow/engine/templates/users/users.js index 3b6997d5b..22eefe599 100755 --- a/workflow/engine/templates/users/users.js +++ b/workflow/engine/templates/users/users.js @@ -521,7 +521,11 @@ Ext.onReady(function () { id : 'USR_COST_BY_HOUR', fieldLabel : _('ID_COST_BY_HOUR'), xtype : 'numberfield', + allowNegative: false, decimalSeparator : '.', + maskRe : /^[0-9]/i, + regex : /^[0-9]/i, + regexText : _('ID_INVALID_VALUE', _('ID_COST_BY_HOUR')), maxLength : 13, width : 80 }, diff --git a/workflow/engine/xmlform/login/forgotPasswordpm3.xml b/workflow/engine/xmlform/login/forgotPasswordpm3.xml index 98122fc1f..60d8b9b6f 100755 --- a/workflow/engine/xmlform/login/forgotPasswordpm3.xml +++ b/workflow/engine/xmlform/login/forgotPasswordpm3.xml @@ -6,7 +6,7 @@ - + diff --git a/workflow/engine/xmlform/login/licenseExpiredpm3.html b/workflow/engine/xmlform/login/licenseExpiredpm3.html index 2f57e2d0f..3f5531645 100644 --- a/workflow/engine/xmlform/login/licenseExpiredpm3.html +++ b/workflow/engine/xmlform/login/licenseExpiredpm3.html @@ -16,7 +16,7 @@ {$form.updateButton} -
    * Required Field
    +