Designer > BPMN Designer > Porcess Supervisors > Steps: Estandarizar la ventana al nuevo diseñue se solicito para el diseñr BPMN
This commit is contained in:
dheeyi
2015-06-16 11:21:24 -04:00
26 changed files with 1088 additions and 147 deletions

View File

@@ -69,11 +69,28 @@ class MSSQLConnection extends ConnectionCommon implements Connection {
$pw = $dsninfo['password'];
$dbhost = $dsninfo['hostspec'] ? $dsninfo['hostspec'] : 'localhost';
/**
* MSSQL (http://php.net/manual/en/intro.mssql.php)
* These functions allow you to access MS SQL Server database.
* This extension is not available anymore on Windows with PHP 5.3 or later.
* SQLSRV, an alternative extension for MS SQL connectivity is available from
* Microsoft: » http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx.
* http://blogs.msdn.com/b/brian_swan/archive/2010/03/08/mssql-vs-sqlsrv-what-s-the-difference-part-1.aspx
*
* Alternatively to use the mssql functions in Windows, use php_dblib.dll (FreeTDS) http://www.freetds.org/
* e.g. php.ini setting
* extension=php_dblib.dll
*
* php_dblib.dll (FreeTDS) use ':' as the delimiter in all installations.
*/
/*
if (PHP_OS == "WINNT" || PHP_OS == "WIN32") {
$portDelimiter = ",";
} else {
$portDelimiter = ":";
}
*/
$portDelimiter = ":";
if(!empty($dsninfo['port'])) {
$dbhost .= $portDelimiter.$dsninfo['port'];

View File

@@ -1,7 +1,7 @@
<?php
class actionsByEmailClass extends PMPlugin
class actionsByEmailCoreClass extends PMPlugin
{
public function __construct()
{
@@ -25,10 +25,10 @@ class actionsByEmailClass extends PMPlugin
{
try {
// Validations
try {
if (!is_object($data)) {
throw new Exception('The parameter $data is null.');
}
if (!isset($data->TAS_UID)) {
throw new Exception('The parameter $data->TAS_UID is null.');
}
@@ -41,6 +41,10 @@ class actionsByEmailClass extends PMPlugin
throw new Exception('The parameter $data->DEL_INDEX is null.');
}
if (!isset($data->USR_UID)) {
throw new Exception('The parameter $data->USR_UID is null.');
}
if ($data->TAS_UID == '') {
throw new Exception('The parameter $data->TAS_UID is empty.');
}
@@ -53,6 +57,14 @@ class actionsByEmailClass extends PMPlugin
throw new Exception('The parameter $data->DEL_INDEX is empty.');
}
if ($data->USR_UID == '') {
throw new Exception('The parameter $data->USR_UID is empty.');
}
} catch(Exception $e) {
echo $e->getMessage().' Please contact to your system administrator.';
die;
}
G::LoadClass('pmFunctions');
$emailSetup = getEmailConfiguration();

View File

@@ -16,10 +16,13 @@ class ConsolidatedCases
if ($sRepTabUid != '') {
if (!$status) {
$oCaseConsolidated = new CaseConsolidated();
$oCaseConsolidated = CaseConsolidatedPeer::retrieveByPK($sTasUid);
$oCaseConsolidated = new CaseConsolidatedCore();
$oCaseConsolidated = CaseConsolidatedCorePeer::retrieveByPK($sTasUid);
if (!(is_object($oCaseConsolidated)) || get_class($oCaseConsolidated) != 'CaseConsolidated') {
$oCaseConsolidated = new CaseConsolidated();
$oCaseConsolidated = new CaseConsolidatedCore();
$oCaseConsolidated->setTasUid($sTasUid);
$oCaseConsolidated->delete();
$oCaseConsolidated = new CaseConsolidatedCore();
$oCaseConsolidated->setTasUid($sTasUid);
$oCaseConsolidated->setConStatus('INACTIVE');
$oCaseConsolidated->save();
@@ -168,9 +171,9 @@ class ConsolidatedCases
$oReportTables->populateTable($_POST['form']['REP_TAB_NAME'], $_POST['form']['REP_TAB_CONNECTION'], $_POST['form']['REP_TAB_TYPE'], $aFields, $_POST['form']['PRO_UID'], '');
$sRepTabUid = $_POST['form']['REP_TAB_UID'];
$oCaseConsolidated = CaseConsolidatedPeer::retrieveByPK($sTasUid);
$oCaseConsolidated = CaseConsolidatedCorePeer::retrieveByPK($sTasUid);
if (!(is_object($oCaseConsolidated)) || get_class($oCaseConsolidated) != 'CaseConsolidated') {
$oCaseConsolidated = new CaseConsolidated();
$oCaseConsolidated = new CaseConsolidatedCore();
$oCaseConsolidated->setTasUid($sTasUid);
}

View File

@@ -136,10 +136,13 @@ class dbConnections
/**
* getConnectionsProUid
*
* @param string $pType
* Parameter $only list of items displayed, everything else is ignored.
*
* @param string $pProUid
* @param string $only
* @return Array $connections
*/
public function getConnectionsProUid ($pProUid)
public function getConnectionsProUid ($pProUid, $only = array())
{
$connections = Array ();
$c = new Criteria();
@@ -155,8 +158,9 @@ class dbConnections
$result->next();
$row = $result->getRow();
$sw = count($only) > 0;
while ($row = $result->getRow()) {
if ((trim( $pProUid ) == trim( $row[1] )) && ($row[2] == 'mysql')) {
if ((trim( $pProUid ) == trim( $row[1] )) && ( $sw ? in_array($row[2], $only) : true )) {
$connections[] = Array ('DBS_UID' => $row[0],'DBS_NAME' => '[' . $row[3] . '] ' . $row[2] . ': ' . $row[4]
);
}

View File

@@ -10,12 +10,12 @@ class Library
$criteria = new Criteria("workflow");
//SELECT
$criteria->addSelectColumn(CaseConsolidatedPeer::CON_STATUS);
$criteria->addSelectColumn(CaseConsolidatedCorePeer::CON_STATUS);
//FROM
//WHERE
$criteria->add(CaseConsolidatedPeer::CON_STATUS, "ACTIVE");
$criteria->add(CaseConsolidatedCorePeer::CON_STATUS, "ACTIVE");
$activeNumRec = CaseConsolidatedPeer::doCount($criteria);
$activeNumRec = CaseConsolidatedCorePeer::doCount($criteria);
//Number of records
$numRec = 0;

View File

@@ -1545,7 +1545,7 @@ class processMap
}
if ($iForm == 8) {
$oCaseConsolidated = CaseConsolidatedPeer::retrieveByPK($_SESSION["cDhTajE2T2lxSkhqMzZUTXVacWYyNcKwV3A4eWYybDdyb1p3"]["TAS_UID"]);
$oCaseConsolidated = CaseConsolidatedCorePeer::retrieveByPK($_SESSION["cDhTajE2T2lxSkhqMzZUTXVacWYyNcKwV3A4eWYybDdyb1p3"]["TAS_UID"]);
if ((is_object($oCaseConsolidated)) && get_class($oCaseConsolidated) == "CaseConsolidated") {
require_once ("classes/model/ReportTable.php");

View File

@@ -582,6 +582,15 @@ class ReportTables
$sQuery = 'UPDATE `' . $aRow['REP_TAB_NAME'] . '` SET ';
foreach ($aTableFields as $aField) {
$sQuery .= '`' . $aField['sFieldName'] . '` = ';
if(!isset($aFields[$aField['sFieldName']])){
foreach($aFields as $row){
if(is_array($row)){
$aFields = $row[count($row)];
}
}
}
switch ($aField['sType']) {
case 'number':
$sQuery .= (isset( $aFields[$aField['sFieldName']] ) ? (float) str_replace( ',', '', $aFields[$aField['sFieldName']] ) : '0') . ',';

View File

@@ -188,8 +188,8 @@ class AppDelegation extends BaseAppDelegation
if (PMLicensedFeatures
::getSingleton()
->verifyfeature('zLhSk5TeEQrNFI2RXFEVktyUGpnczV1WEJNWVp6cjYxbTU3R29mVXVZNWhZQT0=')) {
G::LoadClass('actionsByEmail');
$actionsByEmail = new actionsByEmailClass();
G::LoadClass('actionsByEmailCore');
$actionsByEmail = new actionsByEmailCoreClass();
$actionsByEmail->sendActionsByEmail($data);
}
/*----------------------------------********---------------------------------*/

View File

@@ -1,6 +1,6 @@
<?php
require_once 'classes/model/om/BaseCaseConsolidated.php';
require_once 'classes/model/om/BaseCaseConsolidatedCore.php';
/**
@@ -14,6 +14,6 @@ require_once 'classes/model/om/BaseCaseConsolidated.php';
*
* @package classes.model
*/
class CaseConsolidated extends BaseCaseConsolidated {
class CaseConsolidatedCore extends BaseCaseConsolidatedCore {
} // CaseConsolidated

View File

@@ -1,10 +1,10 @@
<?php
// include base peer class
require_once 'classes/model/om/BaseCaseConsolidatedPeer.php';
require_once 'classes/model/om/BaseCaseConsolidatedCorePeer.php';
// include object class
include_once 'classes/model/CaseConsolidated.php';
include_once 'classes/model/CaseConsolidatedCore.php';
/**
@@ -18,6 +18,6 @@
*
* @package classes.model
*/
class CaseConsolidatedPeer extends BaseCaseConsolidatedPeer {
class CaseConsolidatedCorePeer extends BaseCaseConsolidatedCorePeer {
} // CaseConsolidatedPeer

View File

@@ -16,13 +16,13 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
class CaseConsolidatedMapBuilder
class CaseConsolidatedCoreMapBuilder
{
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'classes.model.map.CaseConsolidatedMapBuilder';
const CLASS_NAME = 'classes.model.map.CaseConsolidatedCoreMapBuilder';
/**
* The database map.
@@ -75,4 +75,4 @@ class CaseConsolidatedMapBuilder
} // doBuild()
} // CaseConsolidatedMapBuilder
} // CaseConsolidatedCoreMapBuilder

View File

@@ -7,7 +7,7 @@ require_once 'propel/om/Persistent.php';
include_once 'propel/util/Criteria.php';
include_once 'classes/model/CaseConsolidatedPeer.php';
include_once 'classes/model/CaseConsolidatedCorePeer.php';
/**
* Base class that represents a row from the 'CASE_CONSOLIDATED' table.
@@ -16,7 +16,7 @@ include_once 'classes/model/CaseConsolidatedPeer.php';
*
* @package workflow.classes.model.om
*/
abstract class BaseCaseConsolidated extends BaseObject implements Persistent
abstract class BaseCaseConsolidatedCore extends BaseObject implements Persistent
{
/**
@@ -126,7 +126,7 @@ abstract class BaseCaseConsolidated extends BaseObject implements Persistent
if ($this->tas_uid !== $v || $v === '') {
$this->tas_uid = $v;
$this->modifiedColumns[] = CaseConsolidatedPeer::TAS_UID;
$this->modifiedColumns[] = CaseConsolidatedCorePeer::TAS_UID;
}
} // setTasUid()
@@ -148,7 +148,7 @@ abstract class BaseCaseConsolidated extends BaseObject implements Persistent
if ($this->dyn_uid !== $v || $v === '') {
$this->dyn_uid = $v;
$this->modifiedColumns[] = CaseConsolidatedPeer::DYN_UID;
$this->modifiedColumns[] = CaseConsolidatedCorePeer::DYN_UID;
}
} // setDynUid()
@@ -170,7 +170,7 @@ abstract class BaseCaseConsolidated extends BaseObject implements Persistent
if ($this->rep_tab_uid !== $v || $v === '') {
$this->rep_tab_uid = $v;
$this->modifiedColumns[] = CaseConsolidatedPeer::REP_TAB_UID;
$this->modifiedColumns[] = CaseConsolidatedCorePeer::REP_TAB_UID;
}
} // setRepTabUid()
@@ -192,7 +192,7 @@ abstract class BaseCaseConsolidated extends BaseObject implements Persistent
if ($this->con_status !== $v || $v === 'ACTIVE') {
$this->con_status = $v;
$this->modifiedColumns[] = CaseConsolidatedPeer::CON_STATUS;
$this->modifiedColumns[] = CaseConsolidatedCorePeer::CON_STATUS;
}
} // setConStatus()
@@ -227,7 +227,7 @@ abstract class BaseCaseConsolidated extends BaseObject implements Persistent
$this->setNew(false);
// FIXME - using NUM_COLUMNS may be clearer.
return $startcol + 4; // 4 = CaseConsolidatedPeer::NUM_COLUMNS - CaseConsolidatedPeer::NUM_LAZY_LOAD_COLUMNS).
return $startcol + 4; // 4 = CaseConsolidatedCorePeer::NUM_COLUMNS - CaseConsolidatedCorePeer::NUM_LAZY_LOAD_COLUMNS).
} catch (Exception $e) {
throw new PropelException("Error populating CaseConsolidated object", $e);
@@ -250,12 +250,12 @@ abstract class BaseCaseConsolidated extends BaseObject implements Persistent
}
if ($con === null) {
$con = Propel::getConnection(CaseConsolidatedPeer::DATABASE_NAME);
$con = Propel::getConnection(CaseConsolidatedCorePeer::DATABASE_NAME);
}
try {
$con->begin();
CaseConsolidatedPeer::doDelete($this, $con);
CaseConsolidatedCorePeer::doDelete($this, $con);
$this->setDeleted(true);
$con->commit();
} catch (PropelException $e) {
@@ -281,7 +281,7 @@ abstract class BaseCaseConsolidated extends BaseObject implements Persistent
}
if ($con === null) {
$con = Propel::getConnection(CaseConsolidatedPeer::DATABASE_NAME);
$con = Propel::getConnection(CaseConsolidatedCorePeer::DATABASE_NAME);
}
try {
@@ -316,14 +316,14 @@ abstract class BaseCaseConsolidated extends BaseObject implements Persistent
// If this object has been modified, then save it to the database.
if ($this->isModified()) {
if ($this->isNew()) {
$pk = CaseConsolidatedPeer::doInsert($this, $con);
$pk = CaseConsolidatedCorePeer::doInsert($this, $con);
$affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
// should always be true here (even though technically
// BasePeer::doInsert() can insert multiple rows).
$this->setNew(false);
} else {
$affectedRows += CaseConsolidatedPeer::doUpdate($this, $con);
$affectedRows += CaseConsolidatedCorePeer::doUpdate($this, $con);
}
$this->resetModified(); // [HL] After being saved an object is no longer 'modified'
}
@@ -394,7 +394,7 @@ abstract class BaseCaseConsolidated extends BaseObject implements Persistent
$failureMap = array();
if (($retval = CaseConsolidatedPeer::doValidate($this, $columns)) !== true) {
if (($retval = CaseConsolidatedCorePeer::doValidate($this, $columns)) !== true) {
$failureMap = array_merge($failureMap, $retval);
}
@@ -417,7 +417,7 @@ abstract class BaseCaseConsolidated extends BaseObject implements Persistent
*/
public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
{
$pos = CaseConsolidatedPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
$pos = CaseConsolidatedCorePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->getByPosition($pos);
}
@@ -461,7 +461,7 @@ abstract class BaseCaseConsolidated extends BaseObject implements Persistent
*/
public function toArray($keyType = BasePeer::TYPE_PHPNAME)
{
$keys = CaseConsolidatedPeer::getFieldNames($keyType);
$keys = CaseConsolidatedCorePeer::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getTasUid(),
$keys[1] => $this->getDynUid(),
@@ -483,7 +483,7 @@ abstract class BaseCaseConsolidated extends BaseObject implements Persistent
*/
public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
{
$pos = CaseConsolidatedPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
$pos = CaseConsolidatedCorePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->setByPosition($pos, $value);
}
@@ -531,7 +531,7 @@ abstract class BaseCaseConsolidated extends BaseObject implements Persistent
*/
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
{
$keys = CaseConsolidatedPeer::getFieldNames($keyType);
$keys = CaseConsolidatedCorePeer::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) {
$this->setTasUid($arr[$keys[0]]);
@@ -558,22 +558,22 @@ abstract class BaseCaseConsolidated extends BaseObject implements Persistent
*/
public function buildCriteria()
{
$criteria = new Criteria(CaseConsolidatedPeer::DATABASE_NAME);
$criteria = new Criteria(CaseConsolidatedCorePeer::DATABASE_NAME);
if ($this->isColumnModified(CaseConsolidatedPeer::TAS_UID)) {
$criteria->add(CaseConsolidatedPeer::TAS_UID, $this->tas_uid);
if ($this->isColumnModified(CaseConsolidatedCorePeer::TAS_UID)) {
$criteria->add(CaseConsolidatedCorePeer::TAS_UID, $this->tas_uid);
}
if ($this->isColumnModified(CaseConsolidatedPeer::DYN_UID)) {
$criteria->add(CaseConsolidatedPeer::DYN_UID, $this->dyn_uid);
if ($this->isColumnModified(CaseConsolidatedCorePeer::DYN_UID)) {
$criteria->add(CaseConsolidatedCorePeer::DYN_UID, $this->dyn_uid);
}
if ($this->isColumnModified(CaseConsolidatedPeer::REP_TAB_UID)) {
$criteria->add(CaseConsolidatedPeer::REP_TAB_UID, $this->rep_tab_uid);
if ($this->isColumnModified(CaseConsolidatedCorePeer::REP_TAB_UID)) {
$criteria->add(CaseConsolidatedCorePeer::REP_TAB_UID, $this->rep_tab_uid);
}
if ($this->isColumnModified(CaseConsolidatedPeer::CON_STATUS)) {
$criteria->add(CaseConsolidatedPeer::CON_STATUS, $this->con_status);
if ($this->isColumnModified(CaseConsolidatedCorePeer::CON_STATUS)) {
$criteria->add(CaseConsolidatedCorePeer::CON_STATUS, $this->con_status);
}
@@ -590,9 +590,9 @@ abstract class BaseCaseConsolidated extends BaseObject implements Persistent
*/
public function buildPkeyCriteria()
{
$criteria = new Criteria(CaseConsolidatedPeer::DATABASE_NAME);
$criteria = new Criteria(CaseConsolidatedCorePeer::DATABASE_NAME);
$criteria->add(CaseConsolidatedPeer::TAS_UID, $this->tas_uid);
$criteria->add(CaseConsolidatedCorePeer::TAS_UID, $this->tas_uid);
return $criteria;
}
@@ -671,12 +671,12 @@ abstract class BaseCaseConsolidated extends BaseObject implements Persistent
* same instance for all member of this class. The method could therefore
* be static, but this would prevent one from overriding the behavior.
*
* @return CaseConsolidatedPeer
* @return CaseConsolidatedCorePeer
*/
public function getPeer()
{
if (self::$peer === null) {
self::$peer = new CaseConsolidatedPeer();
self::$peer = new CaseConsolidatedCorePeer();
}
return self::$peer;
}

View File

@@ -2,8 +2,8 @@
require_once 'propel/util/BasePeer.php';
// The object class -- needed for instanceof checks in this class.
// actual class may be a subclass -- as returned by CaseConsolidatedPeer::getOMClass()
include_once 'classes/model/CaseConsolidated.php';
// actual class may be a subclass -- as returned by CaseConsolidatedCorePeer::getOMClass()
include_once 'classes/model/CaseConsolidatedCore.php';
/**
* Base static class for performing query and update operations on the 'CASE_CONSOLIDATED' table.
@@ -12,7 +12,7 @@ include_once 'classes/model/CaseConsolidated.php';
*
* @package workflow.classes.model.om
*/
abstract class BaseCaseConsolidatedPeer
abstract class BaseCaseConsolidatedCorePeer
{
/** the default database name for this class */
@@ -22,7 +22,7 @@ abstract class BaseCaseConsolidatedPeer
const TABLE_NAME = 'CASE_CONSOLIDATED';
/** A class that can be returned by this peer. */
const CLASS_DEFAULT = 'classes.model.CaseConsolidated';
const CLASS_DEFAULT = 'classes.model.CaseConsolidatedCore';
/** The total number of columns. */
const NUM_COLUMNS = 4;
@@ -55,7 +55,7 @@ abstract class BaseCaseConsolidatedPeer
*/
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('TasUid', 'DynUid', 'RepTabUid', 'ConStatus', ),
BasePeer::TYPE_COLNAME => array (CaseConsolidatedPeer::TAS_UID, CaseConsolidatedPeer::DYN_UID, CaseConsolidatedPeer::REP_TAB_UID, CaseConsolidatedPeer::CON_STATUS, ),
BasePeer::TYPE_COLNAME => array (CaseConsolidatedCorePeer::TAS_UID, CaseConsolidatedCorePeer::DYN_UID, CaseConsolidatedCorePeer::REP_TAB_UID, CaseConsolidatedCorePeer::CON_STATUS, ),
BasePeer::TYPE_FIELDNAME => array ('TAS_UID', 'DYN_UID', 'REP_TAB_UID', 'CON_STATUS', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
);
@@ -68,7 +68,7 @@ abstract class BaseCaseConsolidatedPeer
*/
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('TasUid' => 0, 'DynUid' => 1, 'RepTabUid' => 2, 'ConStatus' => 3, ),
BasePeer::TYPE_COLNAME => array (CaseConsolidatedPeer::TAS_UID => 0, CaseConsolidatedPeer::DYN_UID => 1, CaseConsolidatedPeer::REP_TAB_UID => 2, CaseConsolidatedPeer::CON_STATUS => 3, ),
BasePeer::TYPE_COLNAME => array (CaseConsolidatedCorePeer::TAS_UID => 0, CaseConsolidatedCorePeer::DYN_UID => 1, CaseConsolidatedCorePeer::REP_TAB_UID => 2, CaseConsolidatedCorePeer::CON_STATUS => 3, ),
BasePeer::TYPE_FIELDNAME => array ('TAS_UID' => 0, 'DYN_UID' => 1, 'REP_TAB_UID' => 2, 'CON_STATUS' => 3, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
);
@@ -80,8 +80,8 @@ abstract class BaseCaseConsolidatedPeer
*/
public static function getMapBuilder()
{
include_once 'classes/model/map/CaseConsolidatedMapBuilder.php';
return BasePeer::getMapBuilder('classes.model.map.CaseConsolidatedMapBuilder');
include_once 'classes/model/map/CaseConsolidatedCoreMapBuilder.php';
return BasePeer::getMapBuilder('classes.model.map.CaseConsolidatedCoreMapBuilder');
}
/**
* Gets a map (hash) of PHP names to DB column names.
@@ -94,7 +94,7 @@ abstract class BaseCaseConsolidatedPeer
public static function getPhpNameMap()
{
if (self::$phpNameMap === null) {
$map = CaseConsolidatedPeer::getTableMap();
$map = CaseConsolidatedCorePeer::getTableMap();
$columns = $map->getColumns();
$nameMap = array();
foreach ($columns as $column) {
@@ -149,12 +149,12 @@ abstract class BaseCaseConsolidatedPeer
* $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
* </code>
* @param string $alias The alias for the current table.
* @param string $column The column name for current table. (i.e. CaseConsolidatedPeer::COLUMN_NAME).
* @param string $column The column name for current table. (i.e. CaseConsolidatedCorePeer::COLUMN_NAME).
* @return string
*/
public static function alias($alias, $column)
{
return str_replace(CaseConsolidatedPeer::TABLE_NAME.'.', $alias.'.', $column);
return str_replace(CaseConsolidatedCorePeer::TABLE_NAME.'.', $alias.'.', $column);
}
/**
@@ -171,13 +171,13 @@ abstract class BaseCaseConsolidatedPeer
public static function addSelectColumns(Criteria $criteria)
{
$criteria->addSelectColumn(CaseConsolidatedPeer::TAS_UID);
$criteria->addSelectColumn(CaseConsolidatedCorePeer::TAS_UID);
$criteria->addSelectColumn(CaseConsolidatedPeer::DYN_UID);
$criteria->addSelectColumn(CaseConsolidatedCorePeer::DYN_UID);
$criteria->addSelectColumn(CaseConsolidatedPeer::REP_TAB_UID);
$criteria->addSelectColumn(CaseConsolidatedCorePeer::REP_TAB_UID);
$criteria->addSelectColumn(CaseConsolidatedPeer::CON_STATUS);
$criteria->addSelectColumn(CaseConsolidatedCorePeer::CON_STATUS);
}
@@ -200,9 +200,9 @@ abstract class BaseCaseConsolidatedPeer
// clear out anything that might confuse the ORDER BY clause
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(CaseConsolidatedPeer::COUNT_DISTINCT);
$criteria->addSelectColumn(CaseConsolidatedCorePeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(CaseConsolidatedPeer::COUNT);
$criteria->addSelectColumn(CaseConsolidatedCorePeer::COUNT);
}
// just in case we're grouping: add those columns to the select statement
@@ -210,7 +210,7 @@ abstract class BaseCaseConsolidatedPeer
$criteria->addSelectColumn($column);
}
$rs = CaseConsolidatedPeer::doSelectRS($criteria, $con);
$rs = CaseConsolidatedCorePeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
@@ -231,7 +231,7 @@ abstract class BaseCaseConsolidatedPeer
{
$critcopy = clone $criteria;
$critcopy->setLimit(1);
$objects = CaseConsolidatedPeer::doSelect($critcopy, $con);
$objects = CaseConsolidatedCorePeer::doSelect($critcopy, $con);
if ($objects) {
return $objects[0];
}
@@ -248,7 +248,7 @@ abstract class BaseCaseConsolidatedPeer
*/
public static function doSelect(Criteria $criteria, $con = null)
{
return CaseConsolidatedPeer::populateObjects(CaseConsolidatedPeer::doSelectRS($criteria, $con));
return CaseConsolidatedCorePeer::populateObjects(CaseConsolidatedCorePeer::doSelectRS($criteria, $con));
}
/**
* Prepares the Criteria object and uses the parent doSelect()
@@ -272,7 +272,7 @@ abstract class BaseCaseConsolidatedPeer
if (!$criteria->getSelectColumns()) {
$criteria = clone $criteria;
CaseConsolidatedPeer::addSelectColumns($criteria);
CaseConsolidatedCorePeer::addSelectColumns($criteria);
}
// Set the correct dbName
@@ -294,7 +294,7 @@ abstract class BaseCaseConsolidatedPeer
$results = array();
// set the class once to avoid overhead in the loop
$cls = CaseConsolidatedPeer::getOMClass();
$cls = CaseConsolidatedCorePeer::getOMClass();
$cls = Propel::import($cls);
// populate the object(s)
while ($rs->next()) {
@@ -329,7 +329,7 @@ abstract class BaseCaseConsolidatedPeer
*/
public static function getOMClass()
{
return CaseConsolidatedPeer::CLASS_DEFAULT;
return CaseConsolidatedCorePeer::CLASS_DEFAULT;
}
/**
@@ -391,8 +391,8 @@ abstract class BaseCaseConsolidatedPeer
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
$comparison = $criteria->getComparison(CaseConsolidatedPeer::TAS_UID);
$selectCriteria->add(CaseConsolidatedPeer::TAS_UID, $criteria->remove(CaseConsolidatedPeer::TAS_UID), $comparison);
$comparison = $criteria->getComparison(CaseConsolidatedCorePeer::TAS_UID);
$selectCriteria->add(CaseConsolidatedCorePeer::TAS_UID, $criteria->remove(CaseConsolidatedCorePeer::TAS_UID), $comparison);
} else {
$criteria = $values->buildCriteria(); // gets full criteria
@@ -420,7 +420,7 @@ abstract class BaseCaseConsolidatedPeer
// use transaction because $criteria could contain info
// for more than one table or we could emulating ON DELETE CASCADE, etc.
$con->begin();
$affectedRows += BasePeer::doDeleteAll(CaseConsolidatedPeer::TABLE_NAME, $con);
$affectedRows += BasePeer::doDeleteAll(CaseConsolidatedCorePeer::TABLE_NAME, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
@@ -444,7 +444,7 @@ abstract class BaseCaseConsolidatedPeer
public static function doDelete($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(CaseConsolidatedPeer::DATABASE_NAME);
$con = Propel::getConnection(CaseConsolidatedCorePeer::DATABASE_NAME);
}
if ($values instanceof Criteria) {
@@ -455,7 +455,7 @@ abstract class BaseCaseConsolidatedPeer
} else {
// it must be the primary key
$criteria = new Criteria(self::DATABASE_NAME);
$criteria->add(CaseConsolidatedPeer::TAS_UID, (array) $values, Criteria::IN);
$criteria->add(CaseConsolidatedCorePeer::TAS_UID, (array) $values, Criteria::IN);
}
// Set the correct dbName
@@ -494,8 +494,8 @@ abstract class BaseCaseConsolidatedPeer
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(CaseConsolidatedPeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(CaseConsolidatedPeer::TABLE_NAME);
$dbMap = Propel::getDatabaseMap(CaseConsolidatedCorePeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(CaseConsolidatedCorePeer::TABLE_NAME);
if (! is_array($cols)) {
$cols = array($cols);
@@ -511,7 +511,7 @@ abstract class BaseCaseConsolidatedPeer
}
return BasePeer::doValidate(CaseConsolidatedPeer::DATABASE_NAME, CaseConsolidatedPeer::TABLE_NAME, $columns);
return BasePeer::doValidate(CaseConsolidatedCorePeer::DATABASE_NAME, CaseConsolidatedCorePeer::TABLE_NAME, $columns);
}
/**
@@ -527,12 +527,12 @@ abstract class BaseCaseConsolidatedPeer
$con = Propel::getConnection(self::DATABASE_NAME);
}
$criteria = new Criteria(CaseConsolidatedPeer::DATABASE_NAME);
$criteria = new Criteria(CaseConsolidatedCorePeer::DATABASE_NAME);
$criteria->add(CaseConsolidatedPeer::TAS_UID, $pk);
$criteria->add(CaseConsolidatedCorePeer::TAS_UID, $pk);
$v = CaseConsolidatedPeer::doSelect($criteria, $con);
$v = CaseConsolidatedCorePeer::doSelect($criteria, $con);
return !empty($v) > 0 ? $v[0] : null;
}
@@ -556,8 +556,8 @@ abstract class BaseCaseConsolidatedPeer
$objs = array();
} else {
$criteria = new Criteria();
$criteria->add(CaseConsolidatedPeer::TAS_UID, $pks, Criteria::IN);
$objs = CaseConsolidatedPeer::doSelect($criteria, $con);
$criteria->add(CaseConsolidatedCorePeer::TAS_UID, $pks, Criteria::IN);
$objs = CaseConsolidatedCorePeer::doSelect($criteria, $con);
}
return $objs;
}
@@ -569,14 +569,14 @@ if (Propel::isInit()) {
// the MapBuilder classes register themselves with Propel during initialization
// so we need to load them here.
try {
BaseCaseConsolidatedPeer::getMapBuilder();
BaseCaseConsolidatedCorePeer::getMapBuilder();
} catch (Exception $e) {
Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
}
} else {
// even if Propel is not yet initialized, the map builder class can be registered
// now and then it will be loaded when Propel initializes.
require_once 'classes/model/map/CaseConsolidatedMapBuilder.php';
Propel::registerMapBuilder('classes.model.map.CaseConsolidatedMapBuilder');
require_once 'classes/model/map/CaseConsolidatedCoreMapBuilder.php';
Propel::registerMapBuilder('classes.model.map.CaseConsolidatedCoreMapBuilder');
}

View File

@@ -116,7 +116,7 @@ class pmTablesProxy extends HttpProxyController
G::LoadClass( 'dbConnections' );
$proUid = $_POST['PRO_UID'];
$dbConn = new DbConnections();
$dbConnections = $dbConn->getConnectionsProUid( $proUid );
$dbConnections = $dbConn->getConnectionsProUid( $proUid, array('mysql') );
$workSpace = new workspaceTools(SYS_SYS);
$workspaceDB = $workSpace->getDBInfo();
@@ -1713,6 +1713,8 @@ class pmTablesProxy extends HttpProxyController
$oCriteria->addSelectColumn(ProcessVariablesPeer::VAR_UID);
$oCriteria->addSelectColumn(ProcessVariablesPeer::VAR_NAME);
$oCriteria->addSelectColumn(ProcessVariablesPeer::VAR_FIELD_TYPE);
$oCriteria->addSelectColumn(ProcessVariablesPeer::VAR_SQL);
$oCriteria->addSelectColumn(ProcessVariablesPeer::VAR_ACCEPTED_VALUES);
$oCriteria->add(ProcessVariablesPeer::PRJ_UID, $row["PRJ_UID"]);
$oDataset = ProcessVariablesPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
@@ -1720,7 +1722,10 @@ class pmTablesProxy extends HttpProxyController
while ($oDataset->next()) {
$row = $oDataset->getRow();
$fieldType = isset($row["VAR_FIELD_TYPE"]) ? $row["VAR_FIELD_TYPE"]: '';
$varSql = isset($row["VAR_SQL"]) ? $row["VAR_SQL"] : '';
$varProcessVariable = isset($row["VAR_ACCEPTED_VALUES"]) ? $row["VAR_ACCEPTED_VALUES"] : '[]';
if(! in_array( $fieldType, $excludeFieldsList )){
if(strlen($varSql) == 0 && $varProcessVariable == '[]'){
array_push($fields, array(
"FIELD_UID" => $row["VAR_NAME"] . "-" . $row["VAR_FIELD_TYPE"],
"FIELD_NAME" => $row["VAR_NAME"],
@@ -1731,6 +1736,7 @@ class pmTablesProxy extends HttpProxyController
}
}
}
}
sort( $fields );

View File

@@ -100,4 +100,3 @@ if (count($dashBoardPages)>0) {
}
}
}

View File

@@ -105,6 +105,9 @@ while ($rsSql->next()) {
$grdTitle = htmlentities($proTitle . " / " . $tabTitle, ENT_QUOTES, "UTF-8");
$tabTitle = htmlentities(substr($proTitle, 0, 25) . ((strlen($proTitle) > 25)? "..." : null) . " / " . $tabTitle, ENT_QUOTES, "UTF-8");
$oProcess = new Process();
$isBpmn = $oProcess->isBpmnProcess($processUid);
if($isBpmn){
$arrayTabItem[] = "
{
title: \"<span onmouseover=\\\"toolTipTab('$grdTitle', 1);\\\" onmouseout=\\\"toolTipTab('', 0);\\\">$tabTitle</span>\",
@@ -115,6 +118,18 @@ while ($rsSql->next()) {
}
}
}";
}else{
$arrayTabItem[] = "
{
title: \"<span onmouseover=\\\"toolTipTab('$grdTitle', 1);\\\" onmouseout=\\\"toolTipTab('', 0);\\\">$tabTitle</span>\",
listeners: {
activate: function ()
{
generateGridClassic(\"$processUid\", \"$taskUid\", \"$dynaformUid\");
}
}
}";
}
}
if (count($arrayTabItem) > 0) {

View File

@@ -0,0 +1,75 @@
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
$appUid = isset($_POST["appUid"])? $_POST["appUid"] : "";
$dynUid = isset($_POST["dynUid"])? $_POST["dynUid"] : "";
$proUid = isset($_POST["proUid"])? $_POST["proUid"] : "";
$fieldName = isset($_POST["fieldName"])? $_POST["fieldName"] : "";
$filename = $proUid . PATH_SEP . $dynUid . ".xml";
$G_FORM = new xmlform();
$G_FORM->home = PATH_DYNAFORM;
$G_FORM->parseFile($filename, SYS_LANG, true);
G::LoadClass("case");
G::LoadClass("pmFunctions");
//Load the variables
$oCase = new Cases();
$sqlQuery = null;
$array = array();
$aFields = $oCase->loadCase($appUid);
foreach ($G_FORM->fields as $key => $val) {
if ($fieldName == $val->name) {
if ($G_FORM->fields[$key]->sql != null) {
$sqlQuery = G::replaceDataField($G_FORM->fields[$key]->sql, $aFields ["APP_DATA"]);
}
//$coma = "";
//$data1 = "";
if (is_array($val->options)) {
foreach ($val->options as $key1 => $val1) {
$array[] = array("value" => $key1, "text" => $val1);
}
}
}
}
//echo ($sqlQuery);
if ($sqlQuery != null) {
$aResult = executeQuery($sqlQuery);
//var_dump($aResult);
if ($aResult == "false" || $aResult == null) {
$aResult = array();
}
} else {
$aResult = array();
}
//var_dump($aResult);
$arrayTmp = array();
foreach ($aResult as $field) {
$i = 0;
foreach ($field as $key => $value) {
if ($i == 0) {
$arrayTmp["value"] = $value;
if (count($field) == 1) {
$arrayTmp["text"]=$value;
}
}
if ($i == 1) {
$arrayTmp["text"] = $value;
}
$i++;
}
$array[] = $arrayTmp;
}
$response["records"] = $array;
echo G::json_encode($response);

View File

@@ -7,7 +7,7 @@ use \Criteria;
use \ReportTablePeer;
use \ResultSet;
use \AppCacheViewPeer;
use \CaseConsolidatedPeer;
use \CaseConsolidatedCorePeer;
use \ContentPeer;
/**
@@ -29,21 +29,21 @@ class Consolidated
public function get ($tas_uid)
{
$criteria = new Criteria();
$criteria->addSelectColumn(CaseConsolidatedPeer::DYN_UID);
$criteria->addSelectColumn(CaseConsolidatedCorePeer::DYN_UID);
$criteria->addSelectColumn(\ReportTablePeer::REP_TAB_NAME);
$criteria->addSelectColumn(\ReportTablePeer::REP_TAB_UID);
$criteria->addSelectColumn(ContentPeer::CON_VALUE);
$criteria->addSelectColumn(CaseConsolidatedPeer::CON_STATUS);
$criteria->addSelectColumn(CaseConsolidatedCorePeer::CON_STATUS);
$criteria->addJoin( CaseConsolidatedPeer::REP_TAB_UID, ReportTablePeer::REP_TAB_UID, Criteria::LEFT_JOIN );
$criteria->addJoin( CaseConsolidatedPeer::REP_TAB_UID, ContentPeer::CON_ID, Criteria::LEFT_JOIN );
$criteria->addJoin( CaseConsolidatedCorePeer::REP_TAB_UID, ReportTablePeer::REP_TAB_UID, Criteria::LEFT_JOIN );
$criteria->addJoin( CaseConsolidatedCorePeer::REP_TAB_UID, ContentPeer::CON_ID, Criteria::LEFT_JOIN );
$criteria->add( ContentPeer::CON_CATEGORY, "REP_TAB_TITLE");
$criteria->add( ContentPeer::CON_LANG, SYS_LANG);
$criteria->add( CaseConsolidatedPeer::TAS_UID, $tas_uid, Criteria::EQUAL );
$criteria->add( CaseConsolidatedPeer::CON_STATUS, 'ACTIVE', Criteria::EQUAL );
$criteria->add( CaseConsolidatedCorePeer::TAS_UID, $tas_uid, Criteria::EQUAL );
$criteria->add( CaseConsolidatedCorePeer::CON_STATUS, 'ACTIVE', Criteria::EQUAL );
$dataset = CaseConsolidatedPeer::doSelectRS($criteria);
$dataset = CaseConsolidatedCorePeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
if ($dataset->next()) {
$response = $dataset->getRow();

View File

@@ -90,6 +90,11 @@ class Light
return $response;
}
/**
* Get status trigger case
* @param $triggers
* @return array
*/
public function statusTriggers($triggers)
{
$return = array("before" => false, "after"=> false);
@@ -1061,6 +1066,23 @@ class Light
$sysConf = \System::getSystemConfiguration( PATH_CONFIG . 'env.ini' );
$offset = timezone_offset_get( new \DateTimeZone( $sysConf['time_zone'] ), new \DateTime() );
$response['timeZone'] = sprintf( "GMT%s%02d:%02d", ( $offset >= 0 ) ? '+' : '-', abs( $offset / 3600 ), abs( ($offset % 3600) / 60 ) );
$fields = \System::getSysInfo();
$response['version'] = $fields['PM_VERSION'];
$Translations = new \Translation;
$translationsTable = $Translations->getTranslationEnvironments();
$languagesList = array ();
foreach ($translationsTable as $locale) {
$LANG_ID = $locale['LOCALE'];
if ($locale['COUNTRY'] != '.') {
$LANG_NAME = $locale['LANGUAGE'] . ' (' . (ucwords( strtolower( $locale['COUNTRY'] ) )) . ')';
} else {
$LANG_NAME = $locale['LANGUAGE'];
}
$languagesList[$LANG_ID] = $LANG_NAME;
}
$response['listLanguage'] = $languagesList;
return $response;
}

View File

@@ -0,0 +1,347 @@
<?php
namespace ProcessMaker\BusinessModel\Light;
class Tracker
{
function __construct()
{
\Creole::registerDriver('dbarray', 'creole.contrib.DBArrayConnection');
}
/**
* authenticaction for case tracker
*
* @param $case numbre case
* @param $pin code pin access for case tracek
* @return array
* @throws \Exception
*/
public function authentication($case, $pin)
{
$cases = new \Cases();
$response = array();
$uid = $cases->verifyCaseTracker( $case, $pin );
switch ($uid) {
//The case doesn't exist
case - 1:
throw (new \Exception(\G::LoadTranslation('ID_CASE_NOT_EXISTS')));
break;
//The pin is invalid
case - 2:
throw (new \Exception(\G::LoadTranslation('ID_PIN_INVALID')));
break;
}
$response['process'] = $uid['PRO_UID'];
$response['app_uid'] = $uid['APP_UID'];
return $response;
}
/**
* Access granted for administrator in case tracker
*
* @param $pro_uid
* @param $status
* @return bool
*/
public function permissions ($pro_uid, $status)
{
$cases = new \Cases();
$caseTracker = $cases->caseTrackerPermissions( $pro_uid );
switch ($status) {
case "map":
$return = $caseTracker['CT_MAP_TYPE'];
break;
case "messages":
$return = $caseTracker['CT_MESSAGE_HISTORY'];
break;
case "history":
$return = $caseTracker['CT_DERIVATION_HISTORY'];
break;
case "objects":
$return = $caseTracker['DYNADOC'];
break;
default:
$return = false;
break;
}
return $return;
}
public function history($idProcess, $appUid)
{
$oCase = new \Cases();
$aFields = $oCase->loadCase( $appUid );
$oProcess = new \Process();
$aProcessFieds = $oProcess->load( $idProcess );
$noShowTitle = 0;
if (isset( $aProcessFieds['PRO_SHOW_MESSAGE'] )) {
$noShowTitle = $aProcessFieds['PRO_SHOW_MESSAGE'];
}
if (isset( $aFields['TITLE'] )) {
$aFields['APP_TITLE'] = $aFields['TITLE'];
}
if ($aFields['APP_PROC_CODE'] != '') {
$aFields['APP_NUMBER'] = $aFields['APP_PROC_CODE'];
}
$aFields['CASE'] = \G::LoadTranslation( 'ID_CASE' );
$aFields['TITLE'] = \G::LoadTranslation( 'ID_TITLE' );
$c = \Cases::getTransferHistoryCriteria( $appUid );
$dataset = \AppDelegationPeer::doSelectRS( $c );
$dataset->setFetchmode( \ResultSet::FETCHMODE_ASSOC );
$dataset->next();
$history = array();
while ($row = $dataset->getRow()) {
$history[] = $row;
$dataset->next();
}
$response = $this->parserHistory($history);
return $response;
}
public function parserHistory ($data)
{
$structure = array(
'PRO_UID' => 'processId',
'TAS_UID' => 'taskId',
'APP_UID' => 'caseId',
'user' => array(
'USR_NAME' => 'name',
'USR_FIRSTNAME' => 'firstName',
'USR_LASTNAME' => 'lastName'
),
'DEL_DELEGATE_DATE' => 'delegateDate',
'DEL_INDEX' => 'index',
'DEL_INIT_DATE' => 'initDate',
'APP_ENABLE_ACTION_DATE' => 'enableAction',
'APP_DISABLE_ACTION_DATE' => 'disableAction',
'TAS_TITLE' => 'taskTitle',
'DEL_FINISH_DATE' => 'finishDate',
'APP_TYPE' => 'type'
);
$response = $this->replaceFields($data, $structure);
return $response;
}
public function messages($idProcess, $appUid)
{
$oCase = new \Cases();
$aFields = $oCase->loadCase( $appUid );
$oProcess = new \Process();
$aProcessFieds = $oProcess->load( $idProcess );
$noShowTitle = 0;
if (isset( $aProcessFieds['PRO_SHOW_MESSAGE'] )) {
$noShowTitle = $aProcessFieds['PRO_SHOW_MESSAGE'];
}
if (isset( $aFields['TITLE'] )) {
$aFields['APP_TITLE'] = $aFields['TITLE'];
}
if ($aFields['APP_PROC_CODE'] != '') {
$aFields['APP_NUMBER'] = $aFields['APP_PROC_CODE'];
}
$aFields['CASE'] = \G::LoadTranslation( 'ID_CASE' );
$aFields['TITLE'] = \G::LoadTranslation( 'ID_TITLE' );
$c = \Cases::getHistoryMessagesTracker( $appUid );
$response = array();
if ($c->getDbName() == 'dbarray') {
$rs = \ArrayBasePeer::doSelectRs( $c );
$rs->setFetchmode( \ResultSet::FETCHMODE_ASSOC );
$rs->next();
$messages = array();
while ($row = $rs->getRow()) {
$messages[] = $row;
$rs->next();
}
$response = $this->parserMessages($messages);
}
return $response;
}
public function parserMessages ($data)
{
$structure = array(
'APP_UID' => 'caseId',
'APP_MSG_UID' => 'messageId',
'APP_MSG_TYPE' => 'messageType',
'APP_MSG_SUBJECT' => 'messageSubject',
'APP_MSG_FROM' => 'messageFrom',
'APP_MSG_TO' => 'messageTo',
'APP_MSG_BODY' => 'messageBody',
'APP_MSG_DATE' => 'messageDate',
'APP_MSG_CC' => 'messageCc',
'APP_MSG_BCC' => 'messageBcc',
'APP_MSG_TEMPLATE' => 'messageTemplate',
'APP_MSG_STATUS' => 'messageStatus'
);
$response = $this->replaceFields($data, $structure);
return $response;
}
public function objects($idProcess, $appUid)
{
$oProcessMap = new \processMap();
$oCase = new \Cases();
$oProcess = new \Process();
$aProcessFieds = $oProcess->load( $idProcess );
$noShowTitle = 0;
if (isset( $aProcessFieds['PRO_SHOW_MESSAGE'] )) {
$noShowTitle = $aProcessFieds['PRO_SHOW_MESSAGE'];
}
$aFields = $oCase->loadCase( $appUid );
if (isset( $aFields['TITLE'] )) {
$aFields['APP_TITLE'] = $aFields['TITLE'];
}
if ($aFields['APP_PROC_CODE'] != '') {
$aFields['APP_NUMBER'] = $aFields['APP_PROC_CODE'];
}
$aFields['CASE'] = \G::LoadTranslation( 'ID_CASE' );
$aFields['TITLE'] = \G::LoadTranslation( 'ID_TITLE' );
$c = $oProcessMap->getCaseTrackerObjectsCriteria( $idProcess );
$response = array();
if ($c->getDbName() == 'dbarray') {
$rs = \ArrayBasePeer::doSelectRs( $c );
$rs->setFetchmode( \ResultSet::FETCHMODE_ASSOC );
$rs->next();
$objects = array();
while ($row = $rs->getRow()) {
$objects[] = $row;
$rs->next();
}
$response = $this->parserObjects($objects);
}
return $response;
}
public function parserObjects ($data)
{
$structure = array(
//'CTO_UID' => 'objectId',
'CTO_TITLE' => 'objectTitle',
'CTO_TYPE_OBJ' => 'objectType',
'CTO_UID_OBJ' => 'objectId',
'CTO_CONDITION' => 'condition',
'CTO_POSITION' => 'position'
);
$response = $this->replaceFields($data, $structure);
return $response;
}
public function showObjects ($pro_uid, $app_uid, $obj_uid, $typeObject)
{
switch ($typeObject) {
case 'DYNAFORM':
$oCase = new \Cases();
$Fields = $oCase->loadCase( $app_uid );
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['PREVIOUS_STEP_LABEL'] = '';
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP_LABEL'] = '';
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP'] = '#';
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_ACTION'] = 'alert("Sample"); return false;';
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['PRINT_PREVIEW'] = '#';
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['PRINT_PREVIEW_ACTION'] = 'tracker_PrintView?CTO_UID_OBJ=' . $obj_uid . '&CTO_TYPE_OBJ=PRINT_PREVIEW';
$dynaForm = new \Dynaform();
$arrayDynaFormData = $dynaForm->Load($obj_uid);
if (isset($arrayDynaFormData["DYN_VERSION"]) && $arrayDynaFormData["DYN_VERSION"] == 2) {
\G::LoadClass("pmDynaform");
$Fields["PRO_UID"] = $pro_uid;
$Fields["CURRENT_DYNAFORM"] = $obj_uid;
$pmDynaForm = new \pmDynaform($Fields);
// if ($pmDynaForm->isResponsive()) {
// $pmDynaForm->printTracker();
// }
$response = $pmDynaForm;
}
break;
case 'INPUT_DOCUMENT':
//G::LoadClass( 'case' );
$oCase = new \Cases();
$c = $oCase->getAllUploadedDocumentsCriteriaTracker( $pro_uid, $app_uid, $obj_uid );
// $response = array();
if ($c->getDbName() == 'dbarray') {
$rs = \ArrayBasePeer::doSelectRs( $c );
$rs->setFetchmode( \ResultSet::FETCHMODE_ASSOC );
$rs->next();
$doc = array();
while ($row = $rs->getRow()) {
$doc[] = $row;
$rs->next();
}
//$response = $this->parserObjects($objects);
}
$response = $doc;
break;
case 'OUTPUT_DOCUMENT':
//G::LoadClass( 'case' );
$oCase = new \Cases();
$c = $oCase->getAllGeneratedDocumentsCriteriaTracker( $pro_uid, $app_uid, $obj_uid );
$response = $c;
break;
}
return $response;
}
public function replaceFields ($data, $structure)
{
$response = array();
foreach ($data as $field => $d) {
if (is_array($d)) {
$newData = array();
foreach ($d as $field => $value) {
if (array_key_exists($field, $structure)) {
$newName = $structure[$field];
$newData[$newName] = is_null($value) ? "":$value;
} else {
foreach ($structure as $name => $str) {
if (is_array($str) && array_key_exists($field, $str)) {
$newName = $str[$field];
$newData[$name][$newName] = is_null($value) ? "":$value;
}
}
}
}
if (count($newData) > 0)
$response[] = $newData;
} else {
if (array_key_exists($field, $structure)) {
$newName = $structure[$field];
$response[$newName] = is_null($d) ? "":$d;
} else {
foreach ($structure as $name => $str) {
if (is_array($str) && array_key_exists($field, $str)) {
$newName = $str[$field];
$response[$name][$newName] = is_null($d) ? "":$d;
}
}
}
}
}
return $response;
}
}

View File

@@ -226,12 +226,12 @@ class Lists {
$licensedFeatures = & \PMLicensedFeatures::getSingleton();
if ($licensedFeatures->verifyfeature('7TTeDBQeWRoZTZKYjh4eFpYUlRDUUEyVERPU3FxellWank=')) {
$criteria = new Criteria();
$criteria->add(\CaseConsolidatedPeer::CON_STATUS, 'ACTIVE');
$criteria->addJoin(\CaseConsolidatedPeer::TAS_UID, \AppCacheViewPeer::TAS_UID, Criteria::LEFT_JOIN);
$criteria->add(\CaseConsolidatedCorePeer::CON_STATUS, 'ACTIVE');
$criteria->addJoin(\CaseConsolidatedCorePeer::TAS_UID, \AppCacheViewPeer::TAS_UID, Criteria::LEFT_JOIN);
$criteria->add(\AppCacheViewPeer::USR_UID, $userId);
$criteria->add(\AppCacheViewPeer::DEL_THREAD_STATUS, 'OPEN');
$criteria->add(\AppCacheViewPeer::APP_STATUS, 'TO_DO');
$total = \CaseConsolidatedPeer::doCount( $criteria );
$total = \CaseConsolidatedCorePeer::doCount( $criteria );
$response[] = array('count' => $total, 'item' => 'CONSOLIDATED_CASES');
}
/*----------------------------------********---------------------------------*/

View File

@@ -462,8 +462,11 @@ class Light extends Api
$response = $process->getDynaForms($prj_uid);
$result = $this->parserDataDynaForm($response);
\G::LoadClass("pmDynaform");
$pmDynaForm = new \pmDynaform();
foreach ($result as $k => $form) {
$result[$k]['formContent'] = (isset($form['formContent']) && $form['formContent'] != null)?json_decode($form['formContent']):"";
$pmDynaForm->jsonr($result[$k]['formContent']);
$result[$k]['index'] = $k;
}
} catch (\Exception $e) {
@@ -491,12 +494,15 @@ class Light extends Api
$dynaForm->setFormatFieldNameInUppercase(false);
$oMobile = new \ProcessMaker\BusinessModel\Light();
$step = new \ProcessMaker\Services\Api\Project\Activity\Step();
\G::LoadClass("pmDynaform");
$pmDynaForm = new \pmDynaform();
$response = array();
for ($i = 0; $i < count($activitySteps); $i++) {
if ($activitySteps[$i]['step_type_obj'] == "DYNAFORM") {
$dataForm = $dynaForm->getDynaForm($activitySteps[$i]['step_uid_obj']);
$result = $this->parserDataDynaForm($dataForm);
$result['formContent'] = (isset($result['formContent']) && $result['formContent'] != null)?json_decode($result['formContent']):"";
$pmDynaForm->jsonr($result['formContent']);
$result['index'] = $i;
$result['stepId'] = $activitySteps[$i]["step_uid"];
$trigger = $oMobile->statusTriggers($step->doGetActivityStepTriggers($activitySteps[$i]["step_uid"], $act_uid, $prj_uid));
@@ -559,6 +565,9 @@ class Light extends Api
$response = $dynaForm->getDynaForm($dyn_uid);
$result = $this->parserDataDynaForm($response);
$result['formContent'] = (isset($result['formContent']) && $result['formContent'] != null)?json_decode($result['formContent']):"";
\G::LoadClass("pmDynaform");
$pmDynaForm = new \pmDynaform();
$pmDynaForm->jsonr($result['formContent']);
return $result;
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
@@ -574,11 +583,14 @@ class Light extends Api
try {
$dynaForm = new \ProcessMaker\BusinessModel\DynaForm();
$dynaForm->setFormatFieldNameInUppercase(false);
\G::LoadClass("pmDynaform");
$pmDynaForm = new \pmDynaform();
$return = array();
foreach ($request_data['formId'] as $dyn_uid) {
$response = $dynaForm->getDynaForm($dyn_uid);
$result = $this->parserDataDynaForm($response);
$result['formContent'] = (isset($result['formContent']) && $result['formContent'] != null)?json_decode($result['formContent']):"";
$pmDynaForm->jsonr($result['formContent']);
$return[] = $result;
}
} catch (\Exception $e) {
@@ -832,7 +844,7 @@ class Light extends Api
/**
* @url POST /case/:app_uid/claim
*
* @param $app_uid
* @param $app_uid {@min 1}{@max 32}
* @return mixed
*/
public function claimCaseUser($app_uid)

View File

@@ -0,0 +1,143 @@
<?php
namespace ProcessMaker\Services\Api\Light;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;
/**
*
* Process Api Controller
*
* @protected
*/
class Tracker extends Api
{
/**
* @return array
* @access public
* @url GET /case/:case/tracker/:pin
*/
public function Authentication($case, $pin)
{
try {
$oMobile = new \ProcessMaker\BusinessModel\Light\Tracker();
$response = $oMobile->authentication($case, $pin);
} catch (\Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
return $response;
}
/**
* @return array
* @access public
* @url GET /process/:pro_uid/case/:app_uid/tracker-history
*/
public function history($pro_uid, $app_uid)
{
try {
$oMobile = new \ProcessMaker\BusinessModel\Light\Tracker();
if (!$oMobile->permissions($pro_uid, "history"))
{
throw (new \Exception(\G::LoadTranslation('ID_ACCOUNT_DISABLED_CONTACT_ADMIN')));
}
$response = $oMobile->history($pro_uid, $app_uid);
} catch (\Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
return $response;
}
/**
* @return array
* @access public
*
* @param string $pro_uid {@min 1}{@max 32}
* @param string $app_uid {@min 1}{@max 32}
*
* @url GET /process/:pro_uid/case/:app_uid/tracker-messages
*/
public function getMessages($pro_uid, $app_uid)
{
try {
$oMobile = new \ProcessMaker\BusinessModel\Light\Tracker();
if (!$oMobile->permissions($pro_uid, "messages"))
{
throw (new \Exception(\G::LoadTranslation('ID_ACCOUNT_DISABLED_CONTACT_ADMIN')));
}
$response = $oMobile->messages($pro_uid, $app_uid);
} catch (\Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
return $response;
}
/**
* @return array
* @access public
*
* @param string $msg_uid {@min 1}{@max 32}
* @param string $app_uid {@min 1}{@max 32}
*
* @url GET /process/case/:app_uid/message/:msg_uid/view
*/
public function getViewMessages($app_uid, $msg_uid)
{
try {
$oMobile = new \ProcessMaker\BusinessModel\Light\Tracker();
$Fields = \Cases::getHistoryMessagesTrackerView( $app_uid, $msg_uid );
$response = $oMobile->parserMessages($Fields);
//$response = $oMobile->messages($pro_uid, $app_uid);
} catch (\Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
return $response;
}
/**
* @return array
* @access public
*
* @param string $pro_uid {@min 1}{@max 32}
* @param string $app_uid {@min 1}{@max 32}
*
* @url GET /process/:pro_uid/case/:app_uid/tracker-docs
*/
public function getObjects($pro_uid, $app_uid)
{
try {
$oMobile = new \ProcessMaker\BusinessModel\Light\Tracker();
if (!$oMobile->permissions($pro_uid, "objects"))
{
throw (new \Exception(\G::LoadTranslation('ID_ACCOUNT_DISABLED_CONTACT_ADMIN')));
}
$response = $oMobile->objects($pro_uid, $app_uid);
} catch (\Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
return $response;
}
/**
* @return array
* @access public
*
* @param string $pro_uid {@min 1}{@max 32}
* @param string $app_uid {@min 1}{@max 32}
* @param string $obj_uid {@min 1}{@max 32}
* @param string $type
*
* @url GET /process/:pro_uid/case/:app_uid/object/:obj_uid/:type/show
*/
public function getShowObjects($pro_uid, $app_uid, $obj_uid, $type)
{
try {
$oMobile = new \ProcessMaker\BusinessModel\Light\Tracker();
$response = $oMobile->showObjects($pro_uid, $app_uid, $obj_uid, $type);
} catch (\Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
return $response;
}
}

View File

@@ -100,6 +100,7 @@ debug = 1
[alias: light]
light = "ProcessMaker\Services\Api\Light"
tracker = "ProcessMaker\Services\Api\Light\Tracker"
[alias: consolidated]
list = "ProcessMaker\Services\Api\Consolidated"

View File

@@ -706,6 +706,279 @@ function renderSummary (val, p, r) {
return summaryIcon;
};
function generateGridClassic(proUid, tasUid, dynUid){
var pager = 20; //pageSize
var pagei = 0; //start
Ext.Ajax.request({
url: '../pmConsolidatedCL/proxyGenerateGrid',
success: function(response) {
//Obtenemos el column model y los reader fields de proxyGenerateGrid
var dataResponse = Ext.util.JSON.decode(response.responseText);
var viewConfigObject;
var textArea = dataResponse.hasTextArea;
if (textArea == false) {
viewConfigObject = { //forceFit: true
};
} else {
viewConfigObject = {
//forceFit:true,
enableRowBody:true,
showPreview:true,
getRowClass : function(record, rowIndex, p, store){
if (this.showPreview) {
p.body = '<p><br /></p>';
return 'x-grid3-row-expanded';
}
return 'x-grid3-row-collapsed';
}
};
}
storeConsolidated = new Ext.data.Store({
id: "storeConsolidatedGrid",
remoteSort: true,
//definimos un proxy como un objeto de la clase HttpProxy
proxy: new Ext.data.HttpProxy({
url: "../pmConsolidatedCL/proxyConsolidated",
api: {
read: "../pmConsolidatedCL/proxyConsolidated",
//update: "../pmConsolidatedCL/proxySaveConsolidated"
update: "../pmConsolidatedCL/consolidatedUpdateAjax"
}
}),
//el data reader obtiene los reader fields de la consulta en ajax
reader: new Ext.data.JsonReader({
fields: dataResponse.readerFields,
totalProperty: "totalCount",
//successProperty: "success",
idProperty: "APP_UID",
root: "data",
messageProperty: "message"
}),
//el data writer es un objeto generico pero q permitira a futuro el escribir los datos al servidor mediante el proxy
writer: new Ext.data.JsonWriter({
encode: true,
writeAllFields: false
}), //<-- plug a DataWriter into the store just as you would a Reader
autoSave: true, //<-- false would delay executing create, update, destroy requests until specifically told to do so with some [save] buton.
//el ordenamiento para los campos posiblemente este tenga q ser el tercer dato obtenido del proxy dado q los listados son muy cambiantes de tarea en tarea
//sortInfo:{
// field: 'APP_CACHE_VIEW.APP_NUMBER',
// direction: "DESC"
//}
//,
listeners: { //
beforeload:function (store, options) { //
grdNumRows = 0; //
}, //
load:function (store, records, options) { //
grdNumRows = store.getCount(); //
consolidatedGrid.setDisabled(false);
} //
} //
});
var xColumns = dataResponse.columnModel;
xColumns.unshift(smodel);
var cm = new Ext.grid.ColumnModel(xColumns);
cm.config[2].renderer = renderTitle; //Case Number
cm.config[3].renderer = renderTitle; //Case Title
cm.config[4].renderer = renderSummary;//Case Summary
//generacion del grid basados en los atributos definidos con anterioridad
storeConsolidated.setBaseParam("limit", pager);
storeConsolidated.setBaseParam("start", pagei);
storeConsolidated.setBaseParam('tasUid', tasUid);
storeConsolidated.setBaseParam('dynUid', dynUid);
storeConsolidated.setBaseParam('proUid', proUid);
storeConsolidated.setBaseParam('dropList', Ext.util.JSON.encode(dataResponse.dropList));
storeConsolidated.load();
consolidatedGrid = new Ext.grid.EditorGridPanel({
id: gridId,
region: "center",
store: storeConsolidated,
cm: cm,
sm: smodel,
//autoHeight: true,
//height: pnlMain.getSize().height - pnlMain.getFrameHeight(), //
width: pnlMain.getSize().width, //
height: browserHeight - 35, //
layout: 'fit',
//plugins: filters,
viewConfig: viewConfigObject,
listeners: {
beforeedit: function (e) {
var selRow = Ext.getCmp(gridId).getSelectionModel().getSelected();
var swDropdown = 0;
for (var i = 0; i <= dataResponse.dropList.length - 1 && swDropdown == 0; i++) {
if (dataResponse.dropList[i] == e.field) {
swDropdown = 1;
}
}
var swYesNo = 0;
for (var i = 0; i <= dataResponse.comboBoxYesNoList.length - 1 && swYesNo == 0; i++) {
if (dataResponse.comboBoxYesNoList[i] == e.field) {
swYesNo = 1;
}
}
if (swDropdown == 1 && swYesNo == 0) {
storeAux = Ext.StoreMgr.get("store" + e.field + "_" + proUid);
storeAux.setBaseParam("appUid", selRow.data["APP_UID"]);
storeAux.setBaseParam("dynUid", dynUid);
storeAux.setBaseParam("proUid", proUid);
storeAux.setBaseParam("fieldName", e.field);
//currentFieldEdited = e.field;
storeAux.load();
}
},
afteredit: function (e) {
//var store = consolidatedGrid.getStore();
if (Ext.getCmp("chk_allColumn").checked) {
Ext.Msg.show({
title: "",
msg: "The modification will be applied to all rows in your selection.",
buttons: Ext.Msg.YESNO,
fn: function (btn) {
if (btn == "yes") {
//storeConsolidated.each(function (record) {
// record.set(e.field, e.value);
//});
consolidatedGrid.setDisabled(true);
var dataUpdate = "";
var strValue = "";
var sw = 0;
if (e.value instanceof Date) {
var mAux = e.value.getMonth() + 1;
var dAux = e.value.getDate();
var hAux = e.value.getHours();
var iAux = e.value.getMinutes();
var sAux = e.value.getSeconds();
strValue = e.value.getFullYear() + "-" + ((mAux <= 9)? "0" : "") + mAux + "-" + ((dAux <= 9)? "0" : "") + dAux;
strValue = strValue + " " + ((hAux <= 9)? "0" + ((hAux == 0)? "0" : hAux) : hAux) + ":" + ((iAux <= 9)? "0" + ((iAux == 0)? "0" : iAux) : iAux) + ":" + ((sAux <= 9)? "0" + ((sAux == 0)? "0" : sAux) : sAux);
} else {
strValue = strReplace("\"", "\\\"", e.value + "");
}
storeConsolidated.each(function (record) {
dataUpdate = dataUpdate + ((sw == 1)? "(sep1 /)": "") + record.data["APP_UID"] + "(sep2 /)" + e.field + "(sep2 /)" + strValue;
sw = 1;
});
///////
Ext.Ajax.request({
url: "consolidatedUpdateAjax",
method: "POST",
params: {
"option": "ALL",
"dynaformUid": dynUid,
"dataUpdate": dataUpdate
},
success: function (response, opts) {
var dataResponse = eval("(" + response.responseText + ")"); //json
if (dataResponse.status && dataResponse.status == "OK") {
if (typeof(storeConsolidated.lastOptions.params) != "undefined") {
pagei = storeConsolidated.lastOptions.params.start;
}
storeConsolidated.setBaseParam("start", pagei);
storeConsolidated.load();
} else {
//
}
}
});
}
},
//animEl: "elId",
icon: Ext.MessageBox.QUESTION
});
}
},
mouseover: function (e, cell) {
var rowIndex = consolidatedGrid.getView().findRowIndex(cell);
if (!(rowIndex === false)) {
var record = consolidatedGrid.store.getAt(rowIndex);
var msg = record.get('APP_TITLE');
Ext.QuickTips.register({
text: msg,
target: e.target
});
} else {
Ext.QuickTips.unregister(e.target);
}
},
mouseout: function (e, cell) {
Ext.QuickTips.unregister(e.target);
}
},
//tbar: tb,
tbar: new Ext.Toolbar({
height: 33,
items: toolbarconsolidated
}),
bbar: new Ext.PagingToolbar({
pageSize: pager,
store: storeConsolidated,
displayInfo: true,
displayMsg: _("ID_DISPLAY_ITEMS"),
emptyMsg: _("ID_DISPLAY_EMPTY")
})
});
//remocion de todos los elementos del panel principal donde se carga el grid
//Ext.ComponentMgr.get("myId").body.update("");
//pnlMain.removeAll(false);
pnlMain.removeAll();
//adicion del grid definido con anterioridad
pnlMain.add(consolidatedGrid);
//recarga de los elementos del grid, para su visualizacion.
pnlMain.doLayout();
},
//en caso de fallo ejecutar la siguiente funcion.
failure: function(){
alert("Failure...");
},
// parametros que son enviados en la peticion al servidor.
params: {
xaction: 'read',
tasUid: tasUid,
dynUid: dynUid,
proUid: proUid
}
});
}
function generateGrid(proUid, tasUid, dynUid)
{

View File

@@ -162,6 +162,9 @@
<a href="#" class="mafe-menu-permissions"></a>
<a href="#" class="btn_create mafe-menu-permissions-create"><span></span></a>
</li>
<li>
<a href="#" class="mafe-menu-casetracker"></a>
</li>
<li>
<a href="#" class="mafe-menu-supervisors"></a>
</li>