From 48c6195b8a4c10c89bae653f27c56deaeb0d82fb Mon Sep 17 00:00:00 2001 From: Victor Saisa Lopez Date: Tue, 24 Feb 2015 14:07:29 -0400 Subject: [PATCH 01/10] PM-939 "Support for Message-Event (Message-Event CRON)" - Se a completado el envio de mensajes (para que el caso se "despause") para los eventos "INTERMEDIATE-CATCH-MESSAGE-EVENT" --- .../engine/bin/messageeventcron_single.php | 5 + .../engine/classes/model/ListCanceled.php | 8 +- .../engine/classes/model/ListCompleted.php | 8 +- workflow/engine/classes/model/ListInbox.php | 8 +- workflow/engine/classes/model/ListMyInbox.php | 8 +- .../classes/model/ListParticipatedHistory.php | 8 +- .../classes/model/ListParticipatedLast.php | 8 +- workflow/engine/classes/model/ListPaused.php | 8 +- .../engine/classes/model/ListUnassigned.php | 8 +- .../src/ProcessMaker/BusinessModel/Cases.php | 164 ++++++++++++++---- .../BusinessModel/MessageApplication.php | 98 +++++++++++ .../engine/src/ProcessMaker/Project/Bpmn.php | 23 +++ 12 files changed, 309 insertions(+), 45 deletions(-) diff --git a/workflow/engine/bin/messageeventcron_single.php b/workflow/engine/bin/messageeventcron_single.php index 57470de2e..b991aaab1 100644 --- a/workflow/engine/bin/messageeventcron_single.php +++ b/workflow/engine/bin/messageeventcron_single.php @@ -108,6 +108,7 @@ try { Bootstrap::registerClass("wsResponse", PATH_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "class.wsResponse.php"); G::LoadClass("processes"); + G::LoadClass("derivation"); G::LoadClass("dates"); //Load Criteria //Workflow @@ -198,6 +199,10 @@ try { $rbac = &RBAC::getSingleton(PATH_DATA, session_id()); $rbac->sSystem = "PROCESSMAKER"; + if (!defined("DB_ADAPTER")) { + define("DB_ADAPTER", $DB_ADAPTER); + } + eprintln("Processing workspace: " . $workflow, "green"); try { diff --git a/workflow/engine/classes/model/ListCanceled.php b/workflow/engine/classes/model/ListCanceled.php index a0974f76d..1871e6f25 100644 --- a/workflow/engine/classes/model/ListCanceled.php +++ b/workflow/engine/classes/model/ListCanceled.php @@ -6,7 +6,7 @@ require_once 'classes/model/om/BaseListCanceled.php'; /** * Skeleton subclass for representing a row from the 'LIST_CANCELED' table. * - * + * * * You should add additional methods to this class to meet the * application requirements. This class will only be generated as @@ -269,6 +269,11 @@ class ListCanceled extends BaseListCanceled { $criteria->addSelectColumn(ListCanceledPeer::DEL_DUE_DATE); $criteria->addSelectColumn(ListCanceledPeer::DEL_PRIORITY); + $arrayTaskTypeToExclude = array("WEBENTRYEVENT", "END-MESSAGE-EVENT", "START-MESSAGE-EVENT", "INTERMEDIATE-THROW-MESSAGE-EVENT", "INTERMEDIATE-CATCH-MESSAGE-EVENT"); + + $criteria->addJoin(ListCanceledPeer::TAS_UID, TaskPeer::TAS_UID, Criteria::LEFT_JOIN); + $criteria->add(TaskPeer::TAS_TYPE, $arrayTaskTypeToExclude, Criteria::NOT_IN); + $criteria->add( ListCanceledPeer::USR_UID, $usr_uid, Criteria::EQUAL ); self::loadFilters($criteria, $filters); @@ -300,3 +305,4 @@ class ListCanceled extends BaseListCanceled { return $data; } } // ListCanceled + diff --git a/workflow/engine/classes/model/ListCompleted.php b/workflow/engine/classes/model/ListCompleted.php index be44881dd..2b9a38d21 100644 --- a/workflow/engine/classes/model/ListCompleted.php +++ b/workflow/engine/classes/model/ListCompleted.php @@ -6,7 +6,7 @@ require_once 'classes/model/om/BaseListCompleted.php'; /** * Skeleton subclass for representing a row from the 'LIST_COMPLETED' table. * - * + * * * You should add additional methods to this class to meet the * application requirements. This class will only be generated as @@ -248,6 +248,11 @@ class ListCompleted extends BaseListCompleted $criteria->addSelectColumn(ListCompletedPeer::DEL_CURRENT_USR_LASTNAME); $criteria->addSelectColumn(ListCompletedPeer::DEL_CURRENT_USR_USERNAME); + $arrayTaskTypeToExclude = array("WEBENTRYEVENT", "END-MESSAGE-EVENT", "START-MESSAGE-EVENT", "INTERMEDIATE-THROW-MESSAGE-EVENT", "INTERMEDIATE-CATCH-MESSAGE-EVENT"); + + $criteria->addJoin(ListCompletedPeer::TAS_UID, TaskPeer::TAS_UID, Criteria::LEFT_JOIN); + $criteria->add(TaskPeer::TAS_TYPE, $arrayTaskTypeToExclude, Criteria::NOT_IN); + $criteria->add( ListCompletedPeer::USR_UID, $usr_uid, Criteria::EQUAL ); self::loadFilters($criteria, $filters); @@ -279,3 +284,4 @@ class ListCompleted extends BaseListCompleted return $data; } } // ListCompleted + diff --git a/workflow/engine/classes/model/ListInbox.php b/workflow/engine/classes/model/ListInbox.php index e2901d40e..1d6b9b399 100644 --- a/workflow/engine/classes/model/ListInbox.php +++ b/workflow/engine/classes/model/ListInbox.php @@ -6,7 +6,7 @@ require_once 'classes/model/om/BaseListInbox.php'; /** * Skeleton subclass for representing a row from the 'LIST_INBOX' table. * - * + * * * You should add additional methods to this class to meet the * application requirements. This class will only be generated as @@ -313,6 +313,11 @@ class ListInbox extends BaseListInbox $criteria->addSelectColumn(ListInboxPeer::DEL_DUE_DATE); $criteria->addSelectColumn(ListInboxPeer::DEL_PRIORITY); + $arrayTaskTypeToExclude = array("WEBENTRYEVENT", "END-MESSAGE-EVENT", "START-MESSAGE-EVENT", "INTERMEDIATE-THROW-MESSAGE-EVENT", "INTERMEDIATE-CATCH-MESSAGE-EVENT"); + + $criteria->addJoin(ListInboxPeer::TAS_UID, TaskPeer::TAS_UID, Criteria::LEFT_JOIN); + $criteria->add(TaskPeer::TAS_TYPE, $arrayTaskTypeToExclude, Criteria::NOT_IN); + $criteria->add( ListInboxPeer::USR_UID, $usr_uid, Criteria::EQUAL ); self::loadFilters($criteria, $filters); @@ -352,3 +357,4 @@ class ListInbox extends BaseListInbox return $data; } } + diff --git a/workflow/engine/classes/model/ListMyInbox.php b/workflow/engine/classes/model/ListMyInbox.php index 665517259..5a5aa3f36 100644 --- a/workflow/engine/classes/model/ListMyInbox.php +++ b/workflow/engine/classes/model/ListMyInbox.php @@ -6,7 +6,7 @@ require_once 'classes/model/om/BaseListMyInbox.php'; /** * Skeleton subclass for representing a row from the 'LIST_MY_INBOX' table. * - * + * * * You should add additional methods to this class to meet the * application requirements. This class will only be generated as @@ -236,6 +236,11 @@ class ListMyInbox extends BaseListMyInbox $criteria->addSelectColumn(ListMyInboxPeer::DEL_DUE_DATE); $criteria->addSelectColumn(ListMyInboxPeer::DEL_PRIORITY); + $arrayTaskTypeToExclude = array("WEBENTRYEVENT", "END-MESSAGE-EVENT", "START-MESSAGE-EVENT", "INTERMEDIATE-THROW-MESSAGE-EVENT", "INTERMEDIATE-CATCH-MESSAGE-EVENT"); + + $criteria->addJoin(ListMyInboxPeer::TAS_UID, TaskPeer::TAS_UID, Criteria::LEFT_JOIN); + $criteria->add(TaskPeer::TAS_TYPE, $arrayTaskTypeToExclude, Criteria::NOT_IN); + $criteria->add( ListMyInboxPeer::USR_UID, $usr_uid, Criteria::EQUAL ); self::loadFilters($criteria, $filters); @@ -269,3 +274,4 @@ class ListMyInbox extends BaseListMyInbox return $data; } } // ListMyInbox + diff --git a/workflow/engine/classes/model/ListParticipatedHistory.php b/workflow/engine/classes/model/ListParticipatedHistory.php index 38ffa98a4..8384e1c76 100644 --- a/workflow/engine/classes/model/ListParticipatedHistory.php +++ b/workflow/engine/classes/model/ListParticipatedHistory.php @@ -6,7 +6,7 @@ require_once 'classes/model/om/BaseListParticipatedHistory.php'; /** * Skeleton subclass for representing a row from the 'LIST_PARTICIPATED_HISTORY' table. * - * + * * * You should add additional methods to this class to meet the * application requirements. This class will only be generated as @@ -195,6 +195,11 @@ class ListParticipatedHistory extends BaseListParticipatedHistory $criteria->addSelectColumn(ListParticipatedHistoryPeer::DEL_DUE_DATE); $criteria->addSelectColumn(ListParticipatedHistoryPeer::DEL_PRIORITY); + $arrayTaskTypeToExclude = array("WEBENTRYEVENT", "END-MESSAGE-EVENT", "START-MESSAGE-EVENT", "INTERMEDIATE-THROW-MESSAGE-EVENT", "INTERMEDIATE-CATCH-MESSAGE-EVENT"); + + $criteria->addJoin(ListParticipatedHistoryPeer::TAS_UID, TaskPeer::TAS_UID, Criteria::LEFT_JOIN); + $criteria->add(TaskPeer::TAS_TYPE, $arrayTaskTypeToExclude, Criteria::NOT_IN); + $criteria->add( ListParticipatedHistoryPeer::USR_UID, $usr_uid, Criteria::EQUAL ); self::loadFilters($criteria, $filters); @@ -228,3 +233,4 @@ class ListParticipatedHistory extends BaseListParticipatedHistory return $data; } } + diff --git a/workflow/engine/classes/model/ListParticipatedLast.php b/workflow/engine/classes/model/ListParticipatedLast.php index b1ccb12eb..df076c8be 100644 --- a/workflow/engine/classes/model/ListParticipatedLast.php +++ b/workflow/engine/classes/model/ListParticipatedLast.php @@ -6,7 +6,7 @@ require_once 'classes/model/om/BaseListParticipatedLast.php'; /** * Skeleton subclass for representing a row from the 'LIST_PARTICIPATED_LAST' table. * - * + * * * You should add additional methods to this class to meet the * application requirements. This class will only be generated as @@ -218,6 +218,11 @@ class ListParticipatedLast extends BaseListParticipatedLast $criteria->addSelectColumn(ListParticipatedLastPeer::DEL_DUE_DATE); $criteria->addSelectColumn(ListParticipatedLastPeer::DEL_PRIORITY); + $arrayTaskTypeToExclude = array("WEBENTRYEVENT", "END-MESSAGE-EVENT", "START-MESSAGE-EVENT", "INTERMEDIATE-THROW-MESSAGE-EVENT", "INTERMEDIATE-CATCH-MESSAGE-EVENT"); + + $criteria->addJoin(ListParticipatedLastPeer::TAS_UID, TaskPeer::TAS_UID, Criteria::LEFT_JOIN); + $criteria->add(TaskPeer::TAS_TYPE, $arrayTaskTypeToExclude, Criteria::NOT_IN); + $criteria->add( ListParticipatedLastPeer::USR_UID, $usr_uid, Criteria::EQUAL ); self::loadFilters($criteria, $filters); @@ -251,3 +256,4 @@ class ListParticipatedLast extends BaseListParticipatedLast return $data; } } + diff --git a/workflow/engine/classes/model/ListPaused.php b/workflow/engine/classes/model/ListPaused.php index c211efd76..a88e85f54 100644 --- a/workflow/engine/classes/model/ListPaused.php +++ b/workflow/engine/classes/model/ListPaused.php @@ -6,7 +6,7 @@ require_once 'classes/model/om/BaseListPaused.php'; /** * Skeleton subclass for representing a row from the 'LIST_PAUSED' table. * - * + * * * You should add additional methods to this class to meet the * application requirements. This class will only be generated as @@ -287,6 +287,11 @@ class ListPaused extends BaseListPaused { $criteria->addSelectColumn(ListPausedPeer::DEL_DUE_DATE); $criteria->addSelectColumn(ListPausedPeer::DEL_PRIORITY); + $arrayTaskTypeToExclude = array("WEBENTRYEVENT", "END-MESSAGE-EVENT", "START-MESSAGE-EVENT", "INTERMEDIATE-THROW-MESSAGE-EVENT", "INTERMEDIATE-CATCH-MESSAGE-EVENT"); + + $criteria->addJoin(ListPausedPeer::TAS_UID, TaskPeer::TAS_UID, Criteria::LEFT_JOIN); + $criteria->add(TaskPeer::TAS_TYPE, $arrayTaskTypeToExclude, Criteria::NOT_IN); + $criteria->add( ListPausedPeer::USR_UID, $usr_uid, Criteria::EQUAL ); self::loadFilters($criteria, $filters); @@ -318,3 +323,4 @@ class ListPaused extends BaseListPaused { return $data; } } // ListPaused + diff --git a/workflow/engine/classes/model/ListUnassigned.php b/workflow/engine/classes/model/ListUnassigned.php index 459e6766e..588a032d2 100644 --- a/workflow/engine/classes/model/ListUnassigned.php +++ b/workflow/engine/classes/model/ListUnassigned.php @@ -6,7 +6,7 @@ require_once 'classes/model/om/BaseListUnassigned.php'; /** * Skeleton subclass for representing a row from the 'LIST_UNASSIGNED' table. * - * + * * * You should add additional methods to this class to meet the * application requirements. This class will only be generated as @@ -263,6 +263,11 @@ class ListUnassigned extends BaseListUnassigned $criteria->addSelectColumn(ListUnassignedPeer::DEL_DUE_DATE); $criteria->addSelectColumn(ListUnassignedPeer::DEL_PRIORITY); + $arrayTaskTypeToExclude = array("WEBENTRYEVENT", "END-MESSAGE-EVENT", "START-MESSAGE-EVENT", "INTERMEDIATE-THROW-MESSAGE-EVENT", "INTERMEDIATE-CATCH-MESSAGE-EVENT"); + + $criteria->addJoin(ListUnassignedPeer::TAS_UID, TaskPeer::TAS_UID, Criteria::LEFT_JOIN); + $criteria->add(TaskPeer::TAS_TYPE, $arrayTaskTypeToExclude, Criteria::NOT_IN); + $aConditions = array(); $aConditions[] = array(ListUnassignedPeer::UNA_UID, ListUnassignedGroupPeer::UNA_UID); $aConditions[] = array(ListUnassignedGroupPeer::USR_UID, "'" . $usr_uid . "'"); @@ -312,4 +317,3 @@ class ListUnassigned extends BaseListUnassigned } } - diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php index 200b166ff..9a5d34960 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php @@ -1983,6 +1983,13 @@ class Cases public function throwMessageEventBetweenElementOriginAndElementDest($elementOriginUid, $elementDestUid, array $arrayApplicationData) { try { + //Verify if the Project is BPMN + $bpmn = new \ProcessMaker\Project\Bpmn(); + + if (!$bpmn->exists($arrayApplicationData["PRO_UID"])) { + return; + } + //Element origin and dest $messageEventTaskRelation = new \ProcessMaker\BusinessModel\MessageEventTaskRelation(); @@ -2012,8 +2019,6 @@ class Cases $elementDestType = $arrayElement["elementDest"]["type"]; //Get Message-Events of throw type - $bpmn = new \ProcessMaker\Project\Bpmn(); - $arrayEvent = $bpmn->getMessageEventsOfThrowTypeBetweenElementOriginAndElementDest( $elementOriginUid, $elementOriginType, @@ -2047,50 +2052,137 @@ class Cases //Set variables $ws = new \wsBase(); + $case = new \Cases(); + + $messageApplication = new \ProcessMaker\BusinessModel\MessageApplication(); + $messageApplication->setFrontEnd($frontEnd); //Get data - $messageApplication = new \ProcessMaker\BusinessModel\MessageApplication(); + $totalMessageEvent = 0; - $arrayMessageApplicationUnread = $messageApplication->getMessageApplications(array("messageApplicationStatus" => "UNREAD")); + $counterStartMessageEvent = 0; + $counterIntermediateCatchMessageEvent = 0; + $counter = 0; - foreach ($arrayMessageApplicationUnread["data"] as $value) { - $arrayMessageApplicationData = $value; + $flagFirstTime = false; - $processUid = $arrayMessageApplicationData["PRJ_UID"]; - $taskUid = $arrayMessageApplicationData["TAS_UID"]; + $messageApplication->frontEndShow("START"); - $messageApplicationUid = $arrayMessageApplicationData["MSGAPP_UID"]; - $messageApplicationCorrelation = $arrayMessageApplicationData["MSGAPP_CORRELATION"]; + do { + $flagNextRecords = false; - $messageEventDefinitionUserUid = $arrayMessageApplicationData["MSGED_USR_UID"]; - $messageEventDefinitionVariables = $arrayMessageApplicationData["MSGED_VARIABLES"]; - $messageEventDefinitionCorrelation = $arrayMessageApplicationData["MSGED_CORRELATION"]; + $arrayMessageApplicationUnread = $messageApplication->getMessageApplications(array("messageApplicationStatus" => "UNREAD"), null, null, 0, 1000); - switch ($arrayMessageApplicationData["EVN_TYPE"]) { - case "START": - if ($messageApplicationCorrelation == $messageEventDefinitionCorrelation && - $messageEventDefinitionUserUid != "" - ) { - //Start and derivate new Case - //$result = $ws->newCase($processUid, $messageEventDefinitionUserUid, $taskUid, array("NAME1" => "value1")); - $result = $ws->newCase($processUid, $messageEventDefinitionUserUid, $taskUid, array()); + if (!$flagFirstTime) { + $totalMessageEvent = $arrayMessageApplicationUnread["total"]; - $arrayResult = json_decode(json_encode($result), true); - - if ($arrayResult["status_code"] == 0) { - $applicationUid = $arrayResult["caseId"]; - - $result = $ws->derivateCase($messageEventDefinitionUserUid, $applicationUid, 1); - - //Message-Application catch - $result = $messageApplication->update($messageApplicationUid, array("MSGAPP_STATUS" => "READ")); - } - } - break; - case "INTERMEDIATE": - break; + $flagFirstTime = true; } - } + + foreach ($arrayMessageApplicationUnread["data"] as $value) { + if ($counter + 1 > $totalMessageEvent) { + $flagNextRecords = false; + break; + } + + $arrayMessageApplicationData = $value; + + $processUid = $arrayMessageApplicationData["PRJ_UID"]; + $taskUid = $arrayMessageApplicationData["TAS_UID"]; + + $messageApplicationUid = $arrayMessageApplicationData["MSGAPP_UID"]; + $messageApplicationCorrelation = $arrayMessageApplicationData["MSGAPP_CORRELATION"]; + + $messageEventDefinitionUserUid = $arrayMessageApplicationData["MSGED_USR_UID"]; + $messageEventDefinitionCorrelation = $arrayMessageApplicationData["MSGED_CORRELATION"]; + + $arrayVariable = $messageApplication->mergeVariables($arrayMessageApplicationData["MSGED_VARIABLES"], $arrayMessageApplicationData["MSGAPP_VARIABLES"]); + + $flagCatched = false; + + switch ($arrayMessageApplicationData["EVN_TYPE"]) { + case "START": + if ($messageEventDefinitionCorrelation == $messageApplicationCorrelation && $messageEventDefinitionUserUid != "") { + //Start and derivate new Case + $result = $ws->newCase($processUid, $messageEventDefinitionUserUid, $taskUid, $arrayVariable); + + $arrayResult = json_decode(json_encode($result), true); + + if ($arrayResult["status_code"] == 0) { + $applicationUid = $arrayResult["caseId"]; + + $result = $ws->derivateCase($messageEventDefinitionUserUid, $applicationUid, 1); + + $flagCatched = true; + + //Counter + $counterStartMessageEvent++; + } + } + break; + case "INTERMEDIATE": + $criteria = new \Criteria("workflow"); + + $criteria->addSelectColumn(\AppDelegationPeer::APP_UID); + $criteria->addSelectColumn(\AppDelegationPeer::DEL_INDEX); + $criteria->addSelectColumn(\AppDelegationPeer::USR_UID); + + $criteria->add(\AppDelegationPeer::PRO_UID, $processUid, \Criteria::EQUAL); + $criteria->add(\AppDelegationPeer::TAS_UID, $taskUid, \Criteria::EQUAL); + $criteria->add(\AppDelegationPeer::DEL_THREAD_STATUS, "OPEN", \Criteria::EQUAL); + $criteria->add(\AppDelegationPeer::DEL_FINISH_DATE, null, \Criteria::ISNULL); + + $rsCriteria = \AppDelegationPeer::doSelectRS($criteria); + $rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC); + + while ($rsCriteria->next()) { + $row = $rsCriteria->getRow(); + + $applicationUid = $row["APP_UID"]; + $delIndex = $row["DEL_INDEX"]; + $userUid = $row["USR_UID"]; + + $arrayApplicationData = $case->loadCase($applicationUid); + + if (\G::replaceDataField($messageEventDefinitionCorrelation, $arrayApplicationData["APP_DATA"]) == $messageApplicationCorrelation) { + //"Unpause" and derivate Case + $arrayApplicationData["APP_DATA"] = array_merge($arrayApplicationData["APP_DATA"], $arrayVariable); + + $arrayResult = $case->updateCase($applicationUid, $arrayApplicationData); + + $result = $ws->derivateCase($userUid, $applicationUid, $delIndex); + + $flagCatched = true; + } + } + + //Counter + if ($flagCatched) { + $counterIntermediateCatchMessageEvent++; + } + break; + } + + //Message-Application catch + if ($flagCatched) { + $result = $messageApplication->update($messageApplicationUid, array("MSGAPP_STATUS" => "READ")); + } + + $counter++; + + //Progress bar + $messageApplication->frontEndShow("BAR", "Message-Events (unread): " . $counter . "/" . $totalMessageEvent . " " . $messageApplication->progressBar($totalMessageEvent, $counter)); + + $flagNextRecords = true; + } + } while ($flagNextRecords); + + $messageApplication->frontEndShow("TEXT", "Total Message-Events unread: " . $totalMessageEvent); + $messageApplication->frontEndShow("TEXT", "Total cases started: " . $counterStartMessageEvent); + $messageApplication->frontEndShow("TEXT", "Total cases continued: " . $counterIntermediateCatchMessageEvent); + $messageApplication->frontEndShow("TEXT", "Total Message-Events pending: " . ($totalMessageEvent - ($counterStartMessageEvent + $counterIntermediateCatchMessageEvent))); + + $messageApplication->frontEndShow("END"); } catch (\Exception $e) { throw $e; } diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/MessageApplication.php b/workflow/engine/src/ProcessMaker/BusinessModel/MessageApplication.php index 154924754..a3681cb42 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/MessageApplication.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/MessageApplication.php @@ -8,6 +8,8 @@ class MessageApplication "limit" => "LIMIT" ); + private $frontEnd = false; + /** * Verify if exists the Message-Application * @@ -207,6 +209,102 @@ class MessageApplication } } + /** + * Set front end flag + * + * @param bool $flag Flag + * + * return void + */ + public function setFrontEnd($flag) + { + try { + $this->frontEnd = $flag; + } catch (Exception $e) { + throw $e; + } + } + + /** + * Progress bar + * + * @param int $total Total + * @param int $count Count + * + * return string Return a string that represent progress bar + */ + public function progressBar($total, $count) + { + try { + $p = (int)(($count * 100) / $total); + $n = (int)($p / 2); + + return "[" . str_repeat("|", $n) . str_repeat(" ", 50 - $n) . "] $p%"; + } catch (Exception $e) { + throw $e; + } + } + + /** + * Show front end + * + * @param string $option Option + * @param string $data Data string + * + * return void + */ + public function frontEndShow($option, $data = "") + { + try { + if (!$this->frontEnd) { + return; + } + + $numc = 100; + + switch ($option) { + case "BAR": + echo "\r" . "| " . $data . str_repeat(" ", $numc - 2 - strlen($data)); + break; + case "TEXT": + echo "\r" . "| " . $data . str_repeat(" ", $numc - 2 - strlen($data)) . "\n"; + break; + default: + //START, END + echo "\r" . "+" . str_repeat("-", $numc - 2) . "+" . "\n"; + break; + } + } catch (Exception $e) { + throw $e; + } + } + + /** + * Merge and get variables + * + * @param array $arrayVariableName Variables + * @param array $arrayVariableValue Values + * + * return array Return an array + */ + public function mergeVariables(array $arrayVariableName, array $arrayVariableValue) + { + try { + $arrayVariable = array(); + + foreach ($arrayVariableName as $key => $value) { + if (preg_match("/^@[@%#\?\x24\=]([A-Za-z_]\w*)$/", $value, $arrayMatch) && isset($arrayVariableValue[$key])) { + $arrayVariable[$arrayMatch[1]] = $arrayVariableValue[$key]; + } + } + + //Return + return $arrayVariable; + } catch (\Exception $e) { + throw $e; + } + } + /** * Get all Message-Applications * diff --git a/workflow/engine/src/ProcessMaker/Project/Bpmn.php b/workflow/engine/src/ProcessMaker/Project/Bpmn.php index dcaced7a0..8cb27df25 100755 --- a/workflow/engine/src/ProcessMaker/Project/Bpmn.php +++ b/workflow/engine/src/ProcessMaker/Project/Bpmn.php @@ -91,6 +91,19 @@ class Bpmn extends Handler } } + public function exists($projectUid) + { + try { + $obj = ProjectPeer::retrieveByPK($projectUid); + + return (!is_null($obj))? true : false; + } catch (\Exception $e) { + self::log("Exception: ", $e->getMessage(), "Trace: ", $e->getTraceAsString()); + + throw $e; + } + } + public static function load($prjUid) { $me = new self(); @@ -588,6 +601,8 @@ class Bpmn extends Handler //Return return false; } catch (\Exception $e) { + self::log("Exception: ", $e->getMessage(), "Trace: ", $e->getTraceAsString()); + throw $e; } } @@ -661,6 +676,8 @@ class Bpmn extends Handler } } } catch (\Exception $e) { + self::log("Exception: ", $e->getMessage(), "Trace: ", $e->getTraceAsString()); + throw $e; } } @@ -1294,6 +1311,8 @@ class Bpmn extends Handler //Return return $this->getGateway2($gatewayUid); } catch (\Exception $e) { + self::log("Exception: ", $e->getMessage(), "Trace: ", $e->getTraceAsString()); + throw $e; } } @@ -1386,6 +1405,8 @@ class Bpmn extends Handler return array(); } } catch (\Exception $e) { + self::log("Exception: ", $e->getMessage(), "Trace: ", $e->getTraceAsString()); + throw $e; } } @@ -1427,6 +1448,8 @@ class Bpmn extends Handler //Return return $arrayEvent; } catch (\Exception $e) { + self::log("Exception: ", $e->getMessage(), "Trace: ", $e->getTraceAsString()); + throw $e; } } From c1c254f5ce12fffae5cfdc0e2ee7e9a2ddf7b9e0 Mon Sep 17 00:00:00 2001 From: Roly Rudy Gutierrez Pinto Date: Wed, 25 Feb 2015 11:13:30 -0400 Subject: [PATCH 02/10] IMPROVEMENT --- workflow/engine/classes/class.pmDynaform.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/workflow/engine/classes/class.pmDynaform.php b/workflow/engine/classes/class.pmDynaform.php index f36345274..c3cdd9449 100644 --- a/workflow/engine/classes/class.pmDynaform.php +++ b/workflow/engine/classes/class.pmDynaform.php @@ -28,16 +28,18 @@ class pmDynaform //items $dynContent = G::json_decode($this->record["DYN_CONTENT"]); if (isset($dynContent->items)) { - $this->items = $dynContent->items[0]->items; - for($i=0; $iitems); $i++){ - for($j=0; $jitems[$i]); $j++){ - if($this->items[$i][$j]->required == 1){ + $this->items = $dynContent->items[0]->items; + $n = count($this->items); + for ($i = 0; $i < $n; $i++) { + $m = count($this->items[$i]); + for ($j = 0; $j < $m; $j++) { + if (isset($this->items[$i][$j]->required) && $this->items[$i][$j]->required == 1) { array_push($this->arrayFieldRequired, $this->items[$i][$j]->name); - } + } } - } + } } - + if(!empty($app_data) && isset($app_data["APPLICATION"])){ //data $cases = new \ProcessMaker\BusinessModel\Cases(); @@ -77,7 +79,7 @@ class pmDynaform } //query $arrayVariable = array(); - if ($row["VAR_DBCONNECTION"] !== "none") { + if ($row["VAR_DBCONNECTION"] !== "none" && $row["VAR_SQL"] !== "") { $cnn = Propel::getConnection($row["VAR_DBCONNECTION"]); $stmt = $cnn->createStatement(); $rs = $stmt->executeQuery(\G::replaceDataField($row["VAR_SQL"], $arrayVariable), \ResultSet::FETCHMODE_NUM); From 33485a4c9938cb7c2e9baca7bac94d03d82a91d6 Mon Sep 17 00:00:00 2001 From: Victor Saisa Lopez Date: Wed, 25 Feb 2015 12:08:52 -0400 Subject: [PATCH 03/10] PM-00000 "Accept Event-Based-Gateway only for the design (back-end)" - Accept Event-Based-Gateway only for the design (back-end) --- .../ProcessMaker/Project/Adapter/BpmnWorkflow.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/workflow/engine/src/ProcessMaker/Project/Adapter/BpmnWorkflow.php b/workflow/engine/src/ProcessMaker/Project/Adapter/BpmnWorkflow.php index 82dba105b..5edd19296 100755 --- a/workflow/engine/src/ProcessMaker/Project/Adapter/BpmnWorkflow.php +++ b/workflow/engine/src/ProcessMaker/Project/Adapter/BpmnWorkflow.php @@ -17,10 +17,11 @@ class BpmnWorkflow extends Project\Bpmn */ protected $wp; - const BPMN_GATEWAY_COMPLEX = "COMPLEX"; - const BPMN_GATEWAY_PARALLEL = "PARALLEL"; - const BPMN_GATEWAY_INCLUSIVE = "INCLUSIVE"; - const BPMN_GATEWAY_EXCLUSIVE = "EXCLUSIVE"; + const BPMN_GATEWAY_COMPLEX = "COMPLEX"; + const BPMN_GATEWAY_PARALLEL = "PARALLEL"; + const BPMN_GATEWAY_INCLUSIVE = "INCLUSIVE"; + const BPMN_GATEWAY_EXCLUSIVE = "EXCLUSIVE"; + const BPMN_GATEWAY_EVENTBASED = "EVENTBASED"; private $arrayTaskAttribute = array( "gateway-to-gateway" => array("type" => "GATEWAYTOGATEWAY", "prefix" => "gtg-"), @@ -674,6 +675,11 @@ class BpmnWorkflow extends Project\Bpmn } } break; + //case "TO_DO": + case self::BPMN_GATEWAY_EVENTBASED: + $routeType = "EVALUATE"; + break; + //default default: throw new \LogicException("Unsupported Gateway type: " . $arrayGatewayData["GAT_TYPE"]); break; From 568720d63290d190d3c793caeda8f7436d5e3950 Mon Sep 17 00:00:00 2001 From: Victor Saisa Lopez Date: Wed, 25 Feb 2015 17:24:22 -0400 Subject: [PATCH 04/10] PM-00000 "Small fix in CaseScheduler.php" - Small fix in CaseScheduler.php, set variable: $perform = $aData["SCH_OPTION"]; --- workflow/engine/classes/model/CaseScheduler.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/workflow/engine/classes/model/CaseScheduler.php b/workflow/engine/classes/model/CaseScheduler.php index 05ec7dda7..9e23044bd 100755 --- a/workflow/engine/classes/model/CaseScheduler.php +++ b/workflow/engine/classes/model/CaseScheduler.php @@ -53,8 +53,10 @@ class CaseScheduler extends BaseCaseScheduler throw ($e); } $con->commit(); - + //Add Audit Log + $perform = $aData["SCH_OPTION"]; + switch ($aData['SCH_OPTION']) { case '1': $perform = 'Daily'; @@ -71,10 +73,10 @@ class CaseScheduler extends BaseCaseScheduler case '5': $perform = 'Every'; break; - + } G::auditLog("CreateCaseScheduler", "Scheduler Name: ".$aData['SCH_NAME'].", Task: ".$aData['TAS_UID'].", Perform this task: ".$perform.", Start Date: ".$aData['SCH_START_DATE'].", End Date: ".$aData['SCH_END_DATE'].", Execution time : ".$aData['SCH_START_TIME']); - + return $result; } catch (Exception $e) { $con->rollback(); @@ -92,7 +94,7 @@ class CaseScheduler extends BaseCaseScheduler if ($this->validate()) { $result = $this->save(); $con->commit(); - + //Add Audit Log switch ($fields['SCH_OPTION']){ case '1': @@ -112,7 +114,7 @@ class CaseScheduler extends BaseCaseScheduler break; } G::auditLog("UpdateCaseScheduler", "Scheduler Name: ".$fields['SCH_NAME'].", Task: ".$fields['TAS_UID'].", Perform this task: ".$perform.", Start Date: ".$fields['SCH_START_DATE'].", End Date: ".$fields['SCH_END_DATE'].", Execution time : ".$fields['SCH_START_TIME']); - + return $result; } else { $con->rollback(); @@ -135,7 +137,7 @@ class CaseScheduler extends BaseCaseScheduler $con->commit(); //Add Audit Log G::auditLog("DeleteCaseScheduler", "Scheduler Name: ".$fields['SCH_NAME'].", Task: ".$fields['TAS_UID']); - + return $iResult; } else { throw (new Exception( 'This row doesn\'t exist!' )); From a98068b4a41f57a167c5db81fefa0f0e2880ea27 Mon Sep 17 00:00:00 2001 From: dheeyi Date: Thu, 26 Feb 2015 15:10:35 -0400 Subject: [PATCH 05/10] PM-1127 Change following text in the Trigger Wizard MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Causa: Textos definidos previamentes. SolucióEdicion de nuevos textos. --- workflow/engine/classes/class.pmFunctions.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/workflow/engine/classes/class.pmFunctions.php b/workflow/engine/classes/class.pmFunctions.php index 949a8a034..f69f43390 100755 --- a/workflow/engine/classes/class.pmFunctions.php +++ b/workflow/engine/classes/class.pmFunctions.php @@ -1235,7 +1235,7 @@ function WSInformationUser($userUid) * * @method * - * Returns the unique ID for the current active session. + * Returns the unique ID for the current login session. * * @name WSGetSession * @label WS Get Session @@ -1400,7 +1400,7 @@ function WSUnpauseCase ($caseUid, $delIndex, $userUid) * * @method * - * Add case note. + * Add a case note. * * @name WSAddCaseNote * @label WS Add case note @@ -1537,7 +1537,7 @@ function PMFUserList () //its test was successfull /** * @method * - * Add a input document. + * Add an Input Document. * * @name PMFAddInputDocument * @label PMF Add a input document @@ -1552,7 +1552,7 @@ function PMFUserList () //its test was successfull * @param string(32) | $caseUid | ID of the case | The unique ID of the case. * @param int | $delIndex | Delegation index of the case | The delegation index of the current task in the case. * @param string(32) | $taskUid | ID of the task | The unique ID of the task. - * @param string(32) | $userUid | ID user | The unique ID of the user who will add a input document. + * @param string(32) | $userUid | ID user | The unique ID of the user who will add an input document. * @param string | $option = "file" | Option | Option, value: "file". * @param string | $file = "path_to_file/myfile.txt" | File, path to file | File, path to file. * @return string | $appDocUid | ID of the application document | Returns ID if it has added the input document successfully; otherwise, returns null or empty if an error occurred. @@ -2061,7 +2061,7 @@ function PMFNewCase ($processId, $userId, $taskId, $variables) * * @method * - * Assigns a user to a group. + * * * Assigns a user to a group. Note that the logged-in user must have the PM_USERS permission in his/her role to be able to assign a user to a group. * @@ -2466,7 +2466,7 @@ function PMFGetNextAssignedUser ($application, $task, $delIndex = null, $userUid /** * @method * - * Returns a list or user. + * Returns the email address of the specified user. * * @name PMFGetUserEmailAddress * @label PMF Get User Email Address @@ -2845,7 +2845,7 @@ function PMFAddAttachmentToArray($arrayData, $index, $value, $suffix = " Copy({i /** *@method * - * It delete the mask a field. + * Removes the currency symbol and thousands separator inserted by a currency mask. * * @name PMFRemoveMask * @label PMF Remove Mask From 11ee25b8df02ff011e156df80b94de6d14a9ea59 Mon Sep 17 00:00:00 2001 From: dheeyi Date: Thu, 26 Feb 2015 15:22:35 -0400 Subject: [PATCH 06/10] PM-878 Change description of the "processmaker change-password-hash-method" command in the help --- workflow/engine/bin/tasks/cliAddons.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflow/engine/bin/tasks/cliAddons.php b/workflow/engine/bin/tasks/cliAddons.php index e47e0fe42..27af448db 100644 --- a/workflow/engine/bin/tasks/cliAddons.php +++ b/workflow/engine/bin/tasks/cliAddons.php @@ -21,7 +21,7 @@ EOT /*----------------------------------********---------------------------------*/ CLI::taskName('change-password-hash-method'); CLI::taskDescription(<< Date: Thu, 26 Feb 2015 16:46:52 -0400 Subject: [PATCH 07/10] =?UTF-8?q?PM-1698=20"Los=20procesos=20dise=C3=B1ado?= =?UTF-8?q?s=20se=20guardan=20vacios=20despues=20de=20usar=20el=20Zoom=20"?= =?UTF-8?q?=20SOLVED?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Project/Adapter/BpmnWorkflow.php | 32 +++++++++++++++++-- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/workflow/engine/src/ProcessMaker/Project/Adapter/BpmnWorkflow.php b/workflow/engine/src/ProcessMaker/Project/Adapter/BpmnWorkflow.php index 5edd19296..516ec4cf9 100755 --- a/workflow/engine/src/ProcessMaker/Project/Adapter/BpmnWorkflow.php +++ b/workflow/engine/src/ProcessMaker/Project/Adapter/BpmnWorkflow.php @@ -1283,7 +1283,12 @@ class BpmnWorkflow extends Project\Bpmn $activity = $bwp->getActivity($activityData["ACT_UID"]); + if ($activity["BOU_CONTAINER"] != $activityData["BOU_CONTAINER"]) { + $activity = null; + } + if ($forceInsert || is_null($activity)) { + if ($generateUid) { //Activity @@ -1316,6 +1321,7 @@ class BpmnWorkflow extends Project\Bpmn $diagram["activities"][$i] = $activityData; $whiteList[] = $activityData["ACT_UID"]; + } $activities = $bwp->getActivities(); @@ -1337,6 +1343,10 @@ class BpmnWorkflow extends Project\Bpmn $artifact = $bwp->getArtifact($artifactData["ART_UID"]); + if ($artifact["BOU_CONTAINER"] != $artifactData["BOU_CONTAINER"]) { + $artifact = null; + } + if ($forceInsert || is_null($artifact)) { if ($generateUid) { //Artifact @@ -1397,6 +1407,10 @@ class BpmnWorkflow extends Project\Bpmn $gateway = $bwp->getGateway($gatewayData["GAT_UID"]); + if ($gateway["BOU_CONTAINER"] != $gatewayData["BOU_CONTAINER"]) { + $gateway = null; + } + if ($forceInsert || is_null($gateway)) { if ($generateUid) { //Gateway @@ -1471,6 +1485,10 @@ class BpmnWorkflow extends Project\Bpmn $event = $bwp->getEvent($eventData["EVN_UID"]); + if ($event["BOU_CONTAINER"] != $eventData["BOU_CONTAINER"]) { + $event = null; + } + if ($forceInsert || is_null($event)) { if ($generateUid) { //Event @@ -1527,6 +1545,10 @@ class BpmnWorkflow extends Project\Bpmn $dataObject = $bwp->getData($dataObjectData["DAT_UID"]); + if ($dataObject["BOU_CONTAINER"] != $dataObjectData["BOU_CONTAINER"]) { + $dataObject = null; + } + if ($forceInsert || is_null($dataObject)) { if ($generateUid) { //Data @@ -1581,9 +1603,13 @@ class BpmnWorkflow extends Project\Bpmn $participantData = array_change_key_case($participantData, CASE_UPPER); unset($participantData["_EXTENDED"]); - $dataObject = $bwp->getParticipant($participantData["PAR_UID"]); + $participant = $bwp->getParticipant($participantData["PAR_UID"]); - if ($forceInsert || is_null($dataObject)) { + if ($participant["BOU_CONTAINER"] != $participantData["BOU_CONTAINER"]) { + $participant = null; + } + + if ($forceInsert || is_null($participant)) { if ($generateUid) { //Participant @@ -1609,7 +1635,7 @@ class BpmnWorkflow extends Project\Bpmn } $bwp->addParticipant($participantData); - } elseif (! $bwp->isEquals($dataObject, $participantData)) { + } elseif (! $bwp->isEquals($participant, $participantData)) { $bwp->updateParticipant($participantData["PAR_UID"], $participantData); } else { Util\Logger::log("Update Participant ({$participantData["PAR_UID"]}) Skipped - No changes required"); From 69f5ca8c2331ddfb06c42f4b8587121a1dff9940 Mon Sep 17 00:00:00 2001 From: Victor Saisa Lopez Date: Thu, 26 Feb 2015 17:02:34 -0400 Subject: [PATCH 08/10] PM-1679 "No se ejecuta el cron en Servidores Windows" SOLVED Issue: No se ejecuta el cron en Servidores Windows Cause: - En PHP-5.4 se incorpora de manera predefinida la constante E_STRICT, siendo este la causa para los "Warnings PHP Strict Standards" - No se esta cargando los files de "processmaker/workflow/engine/src/ProcessMaker" Solution: - Se ha corregido codigo para respetar el "PHP Strict Standards" - Se ha agregado codigo para cargar los files requeridos de "processmaker/workflow/engine/src/ProcessMaker" --- gulliver/system/class.dvEditor.php | 2 +- gulliver/system/class.g.php | 5 +- gulliver/system/class.xmlMenu.php | 4 +- gulliver/system/class.xmlform.php | 81 +++++++++---------- gulliver/system/class.xmlformExtension.php | 2 +- workflow/engine/bin/cron_single.php | 59 +++++++++----- .../engine/bin/messageeventcron_single.php | 2 +- 7 files changed, 88 insertions(+), 67 deletions(-) diff --git a/gulliver/system/class.dvEditor.php b/gulliver/system/class.dvEditor.php index af447c5ab..1068c8347 100755 --- a/gulliver/system/class.dvEditor.php +++ b/gulliver/system/class.dvEditor.php @@ -55,7 +55,7 @@ class XmlForm_Field_HTML extends XmlForm_Field * @return string * */ - public function render ($value, $owner = null) + public function render($value = null, $owner = null) { $value = ($value == '') ? '
' : $value; $html = "
"; diff --git a/gulliver/system/class.g.php b/gulliver/system/class.g.php index 7ae0529e3..e406ac3d2 100755 --- a/gulliver/system/class.g.php +++ b/gulliver/system/class.g.php @@ -713,7 +713,7 @@ class G * @param string $strClass * @return void */ - public function LoadThirdParty ($sPath, $sFile) + public static function LoadThirdParty($sPath, $sFile) { $classfile = PATH_THIRDPARTY . $sPath . '/' . $sFile . ((substr( $sFile, 0, - 4 ) !== '.php') ? '.php' : ''); return require_once ($classfile); @@ -3330,7 +3330,7 @@ class G * * @return boolean true or false */ - public function isHttpRequest() + public static function isHttpRequest() { if (isset($_SERVER['SERVER_SOFTWARE']) && strpos(strtolower($_SERVER['SERVER_SOFTWARE']), 'apache') !== false) { return true; @@ -5647,3 +5647,4 @@ function __ ($msgID, $lang = SYS_LANG, $data = null) { return G::LoadTranslation( $msgID, $lang, $data ); } + diff --git a/gulliver/system/class.xmlMenu.php b/gulliver/system/class.xmlMenu.php index bde2c516c..c6745e98a 100755 --- a/gulliver/system/class.xmlMenu.php +++ b/gulliver/system/class.xmlMenu.php @@ -76,7 +76,7 @@ class XmlForm_Field_XmlMenu extends XmlForm_Field * * @return object $out */ - public function render ($value) + public function render($value = null, $paramDummy2 = null) { $this->xmlMenu = new xmlMenu( $this->xmlfile, $this->home ); $this->xmlMenu->setValues( $value ); @@ -97,7 +97,7 @@ class XmlForm_Field_XmlMenu extends XmlForm_Field * * @return none */ - public function renderGrid ($value) + public function renderGrid($value = null, $paramDummy2 = null, $paramDummy3 = null, $paramDummy4 = null) { return $this->render( $value ); } diff --git a/gulliver/system/class.xmlform.php b/gulliver/system/class.xmlform.php index 93458d03b..29e7d0966 100755 --- a/gulliver/system/class.xmlform.php +++ b/gulliver/system/class.xmlform.php @@ -394,7 +394,7 @@ class XmlForm_Field * @param string value * @return string */ - public function render ($value = null) + public function render($value = null, $paramDummy2 = null) { //this is an unknown field type. return $this->htmlentities( $value != '' ? $value : $this->name, ENT_COMPAT, 'utf-8' ); @@ -934,7 +934,7 @@ class XmlForm_Field_Title extends XmlForm_Field * @param string value * @return string */ - public function render ($value = null, &$owner = null) + public function render($value = null, $owner = null) { $this->label = G::replaceDataField( $this->label, $owner->values ); return 'name . ']\' name=\'form[' . $this->name . ']\' ' . $this->NSFieldType() . ' >' . $this->htmlentities( $this->label ) . ''; @@ -970,7 +970,7 @@ class XmlForm_Field_Subtitle extends XmlForm_Field * @param string value * @return string */ - public function render ($value = null) + public function render($value = null, $paramDummy2 = null) { return 'name . ']\' name=\'form[' . $this->name . ']\' ' . $this->NSFieldType() . ' >' . $this->htmlentities( $this->label ) . ''; } @@ -1012,7 +1012,7 @@ class XmlForm_Field_SimpleText extends XmlForm_Field * @param string value * @return string */ - public function render ($value = null, &$owner = null) + public function render($value = null, $owner = null) { if (($this->pmconnection != '') && ($this->pmfield != '') && $value == null) { $value = $this->getPMTableValue( $owner ); @@ -1040,7 +1040,7 @@ class XmlForm_Field_SimpleText extends XmlForm_Field * @param string owner * @return string */ - public function renderGrid ($values = array(), $owner = null) + public function renderGrid($values = array(), $owner = null, $paramDummy3 = null, $paramDummy4 = null) { $result = array (); $r = 1; @@ -1204,7 +1204,7 @@ class XmlForm_Field_Text extends XmlForm_Field_SimpleText * @param string owner * @return string */ - public function renderGrid ($values = array(), $owner = null) + public function renderGrid($values = array(), $owner = null, $paramDummy3 = null, $paramDummy4 = null) { $result = $aux = array (); $r = 1; @@ -1257,7 +1257,7 @@ class XmlForm_Field_Text extends XmlForm_Field_SimpleText return $result; } - public function renderTable ($values = '', $owner = null) + public function renderTable($values = "", $owner = null, $paramDummy3 = null) { $result = $this->htmlentities( $values, ENT_COMPAT, 'utf-8' ); return $result; @@ -1716,7 +1716,7 @@ class XmlForm_Field_Suggest extends XmlForm_Field_SimpleText //by neyek * @param string owner * @return string */ - public function renderGrid ($values = array(), $owner = null) + public function renderGrid($values = array(), $owner = null, $paramDummy3 = null, $paramDummy4 = null) { $aResult = array(); $r = 1; @@ -1735,7 +1735,7 @@ class XmlForm_Field_Suggest extends XmlForm_Field_SimpleText //by neyek * @param $owner * @return $result */ - public function renderTable ($values = '', $owner = null) + public function renderTable($values = "", $owner = null, $paramDummy3 = null) { $result = $this->htmlentities( $values, ENT_COMPAT, 'utf-8' ); return $result; @@ -1812,10 +1812,8 @@ class XmlForm_Field_Caption extends XmlForm_Field * @param $owner * @return true */ - public function validateValue ($value, &$owner) + public function validateValue($value) { - /*$this->executeSQL( $owner ); - return isset($value) && ( array_key_exists( $value , $this->options ) );*/ return true; } @@ -1897,7 +1895,7 @@ class XmlForm_Field_Password extends XmlForm_Field * @param string value * @return string */ - public function render ($value = null) + public function render($value = null, $paramDummy2 = null) { if ($this->autocomplete === '1') { $this->autocomplete = "on"; @@ -2013,7 +2011,7 @@ class XmlForm_Field_Textarea extends XmlForm_Field * @param string owner * @return string */ - public function renderGrid ($values = array(), $owner = null) + public function renderGrid($values = array(), $owner = null, $paramDummy3 = null, $paramDummy4 = null) { $this->gridFieldType = 'textarea'; @@ -2176,7 +2174,7 @@ class XmlForm_Field_Currency extends XmlForm_Field_SimpleText * @param string owner * @return string */ - public function renderGrid ($values = array(), $owner = null) + public function renderGrid($values = array(), $owner = null, $paramDummy3 = null, $paramDummy4 = null) { $result = array (); $r = 1; @@ -2242,7 +2240,7 @@ class XmlForm_Field_CaptionCurrency extends XmlForm_Field * @param string value * @return string */ - public function render ($value = null) + public function render($value = null, $paramDummy2 = null) { return '$ ' . $this->htmlentities( $value, ENT_COMPAT, 'utf-8' ); } @@ -2323,7 +2321,7 @@ class XmlForm_Field_Percentage extends XmlForm_Field_SimpleText return $html; } - public function renderGrid ($values = array(), $owner = null) + public function renderGrid($values = array(), $owner = null, $paramDummy3 = null, $paramDummy4 = null) { $result = array (); $r = 1; @@ -2381,7 +2379,7 @@ class XmlForm_Field_Percentage extends XmlForm_Field_SimpleText class XmlForm_Field_CaptionPercentage extends XmlForm_Field { - public function render ($value = null) + public function render($value = null, $paramDummy2 = null) { return $this->htmlentities( $value, ENT_COMPAT, 'utf-8' ); } @@ -2575,7 +2573,7 @@ class XmlForm_Field_Date2 extends XmlForm_Field_SimpleText * @param $onlyValue * @return */ - public function renderGrid ($values = null, $owner = null, $onlyValue = false) + public function renderGrid($values = null, $owner = null, $onlyValue = false, $paramDummy4 = null) { $result = array (); $r = 1; @@ -2658,7 +2656,7 @@ class XmlForm_Field_Date2 extends XmlForm_Field_SimpleText class XmlForm_Field_DateView extends XmlForm_Field { - public function render ($value = null) + public function render($value = null, $paramDummy2 = null) { return $this->htmlentities( $value, ENT_COMPAT, 'utf-8' ); } @@ -2741,7 +2739,7 @@ class XmlForm_Field_YesNo extends XmlForm_Field * @param $owner * @return */ - public function renderGrid ($values = array(), $owner = null) + public function renderGrid($values = array(), $owner = null, $paramDummy3 = null, $paramDummy4 = null) { $this->gridFieldType = 'yesno'; $result = array (); @@ -2888,7 +2886,7 @@ class XmlForm_Field_Link extends XmlForm_Field * @param $owner * @return */ - public function renderGrid($value = array(), $label = array(), $owner = null) + public function renderGrid($value = array(), $label = array(), $owner = null, $paramDummy4 = null) { $arrayResult = array(); $row = 1; @@ -2914,7 +2912,7 @@ class XmlForm_Field_Link extends XmlForm_Field * @param $owner * @return */ - public function renderTable ($value = null, $owner = null) + public function renderTable($value = null, $owner = null, $paramDummy3 = null) { $onclick = $this->htmlentities( G::replaceDataField( $this->onclick, $owner->values ), ENT_QUOTES, 'utf-8' ); $link = $this->htmlentities( G::replaceDataField( $this->link, $owner->values ), ENT_QUOTES, 'utf-8' ); @@ -3053,7 +3051,7 @@ class XmlForm_Field_File extends XmlForm_Field return $html; } - public function renderGrid ($value = array(), $owner = null, $therow = -1) + public function renderGrid($value = array(), $owner = null, $therow = -1, $paramDummy4 = null) { $arrayResult = array (); $r = 1; @@ -3142,7 +3140,7 @@ class XmlForm_Field_Checkboxpt extends XmlForm_Field * @param $owner * @return result */ - public function renderGrid ($values = array(), $owner = null) + public function renderGrid($values = array(), $owner = null, $paramDummy3 = null, $paramDummy4 = null) { $result = array (); $r = 1; @@ -3238,7 +3236,7 @@ class XmlForm_Field_Checkbox extends XmlForm_Field * @param $owner * @return result */ - public function renderGrid ($values = array(), $owner = null) + public function renderGrid($values = array(), $owner = null, $paramDummy3 = null, $paramDummy4 = null) { $this->gridFieldType = 'checkbox'; $result = array (); @@ -3286,7 +3284,7 @@ class XmlForm_Field_Checkbox2 extends XmlForm_Field { public $required = false; - public function render ($value = null) + public function render($value = null, $paramDummy2 = null) { return '' . $this->label . ''; } @@ -3461,7 +3459,7 @@ class XmlForm_Field_Hidden extends XmlForm_Field * @param $owner * @return result */ - public function renderGrid ($values = null, $owner = null) + public function renderGrid($values = null, $owner = null, $paramDummy3 = null, $paramDummy4 = null) { $result = array (); $r = 1; @@ -3480,7 +3478,7 @@ class XmlForm_Field_Hidden extends XmlForm_Field * @param $owner * @return result */ - public function renderTable ($value = '', $owner = null) + public function renderTable($value = "", $owner = null, $paramDummy3 = null) { return ''; } @@ -3509,10 +3507,8 @@ class XmlForm_Field_Dropdown extends XmlForm_Field public $renderMode = ''; public $selectedValue = ''; - public function validateValue ($value, &$owner) + public function validateValue($value) { - /*$this->executeSQL( $owner ); - return isset($value) && ( array_key_exists( $value , $this->options ) );*/ return true; } @@ -3827,7 +3823,7 @@ class XmlForm_Field_Listbox extends XmlForm_Field * @param $owner * @return result */ - public function renderGrid ($value = null, $owner = null) + public function renderGrid($value = null, $owner = null, $paramDummy3 = null, $paramDummy4 = null) { return $this->render( $value, $owner ); } @@ -4046,7 +4042,7 @@ class XmlForm_Field_CheckGroupView extends XmlForm_Field * @param string value * @return string */ - public function render ($value = null) + public function render($value = null, $paramDummy2 = null) { $html = ''; foreach ($this->option as $optionName => $option) { @@ -4125,7 +4121,7 @@ class XmlForm_Field_Grid extends XmlForm_Field * @return