Merge remote-tracking branch 'upstream/3.1' into HOR-998

This commit is contained in:
dheeyi william
2016-07-19 10:12:49 -04:00
60 changed files with 1659 additions and 915 deletions

View File

@@ -255,6 +255,19 @@ EOT
);
CLI::taskArg('workspace', true, true);
CLI::taskRun("run_migrate_new_cases_lists");
CLI::taskName('migrate-list-unassigned');
CLI::taskDescription(<<<EOT
Migrating the AppCacheView table to match the latest version of List Unassigned
  Specify the WORKSPACE to migrate from a existing workspace.
If no workspace is specified, then the tables schema will be upgraded or
migrate on all available workspaces.
EOT
);
CLI::taskArg('workspace', true, true);
CLI::taskRun("run_migrate_list_unassigned");
/*----------------------------------********---------------------------------*/
/**
@@ -364,13 +377,16 @@ function run_database_check($args, $opts) {
function run_migrate_new_cases_lists($args, $opts) {
migrate_new_cases_lists("migrate", $args, $opts);
}
function run_migrate_counters($args, $opts) {
migrate_counters("migrate", $args);
}
function run_migrate_list_unassigned($args, $opts) {
migrate_list_unassigned("migrate", $args, $opts);
}
function database_upgrade($command, $args) {
G::LoadSystem('inputfilter');
$filter = new InputFilter();
@@ -809,5 +825,23 @@ function migrate_counters($command, $args) {
}
}
}
function migrate_list_unassigned($command, $args, $opts) {
G::LoadSystem('inputfilter');
$filter = new InputFilter();
$opts = $filter->xssFilterHard($opts);
$args = $filter->xssFilterHard($args);
$lang = array_key_exists("lang", $opts) ? $opts['lang'] : 'en';
$workspaces = get_workspaces_from_args($args);
foreach ($workspaces as $workspace) {
print_r("Upgrading Unassigned List in" . pakeColor::colorize($workspace->name, "INFO") . "\n");
try {
$workspace->regenerateListUnassigned();
echo "> Unassigned List is done\n";
} catch (Exception $e) {
echo "> Error: ".CLI::error($e->getMessage()) . "\n";
}
}
}
/*----------------------------------********---------------------------------*/

View File

@@ -68,7 +68,7 @@ class Installer
*/
public function create_site($config = Array(), $confirmed = false)
{
$this->options = G::array_concat(Array('isset' => false, 'password' => G::generate_password(12), 'path_data' => @PATH_DATA, 'path_compiled' => @PATH_C, 'name' => $config['name'], 'database' => Array(), 'admin' => Array('username' => 'admin', 'password' => 'admin'
$this->options = G::array_concat(Array('isset' => false, 'password' => G::generate_password(15), 'path_data' => @PATH_DATA, 'path_compiled' => @PATH_C, 'name' => $config['name'], 'database' => Array(), 'admin' => Array('username' => 'admin', 'password' => 'admin'
), 'advanced' => Array('ao_db_wf' => 'wf_' . $config['name'], 'ao_db_rb' => 'rb_' . $config['name'], 'ao_db_rp' => 'rp_' . $config['name'], 'ao_db_drop' => false
)
), $config);

View File

@@ -143,11 +143,6 @@ class actionsByEmailCoreClass extends PMPlugin
$_SESSION['CURRENT_DYN_UID'] = $configuration['DYN_UID'];
$scriptCode = '';
// foreach ($dynaform->fields as $fieldName => $field) {
// if ($field->type == 'submit') {
// unset($dynaform->fields[$fieldName]);
// }
// }
$__ABE__ = '';
$link = (G::is_https() ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/ActionsByEmail';
@@ -168,7 +163,7 @@ class actionsByEmailCoreClass extends PMPlugin
$__ABE__ .= '<strong>' . $field->label . '</strong><br /><br /><table align="left" border="0"><tr>';
$index = 1;
$__ABE__.='<br /><td><table align="left" cellpadding="2"><tr>';
foreach ($customGrid as $key => $value) {
foreach ($customGrid as $key => $value) {
$__ABE__ .= '<td align="center"><a style="'.$value['abe_custom_format'].'" ';
$__ABE__ .= 'href="' .urldecode(urlencode($link)). '?ACTION='.G::encrypt('processABE', URL_KEY).'&APP_UID=';
$__ABE__ .= G::encrypt($data->APP_UID, URL_KEY) . '&DEL_INDEX=' . G::encrypt($data->DEL_INDEX, URL_KEY);
@@ -266,18 +261,24 @@ class actionsByEmailCoreClass extends PMPlugin
G::LoadClass("Users");
$user = new Users();
$userDetails = $user->loadDetails($data->PREVIOUS_USR_UID);
if($configuration['ABE_MAILSERVER_OR_MAILCURRENT'] == 1 && $configuration['ABE_TYPE'] !== ''){
$emailFrom = ($userDetails["USR_FULLNAME"] . ' <' . $userDetails["USR_EMAIL"] . '>');
}else{
if($data->PREVIOUS_USR_UID!==''){
$userDetails = $user->loadDetails($data->PREVIOUS_USR_UID);
$emailFrom = ($userDetails["USR_FULLNAME"] . ' <' . $userDetails["USR_EMAIL"] . '>');
} else {
global $RBAC;
$currentUser = $RBAC->aUserInfo['USER_INFO'];
$emailFrom = ($currentUser["USR_FIRSTNAME"] .' '. $currentUser["USR_LASTNAME"] .' <' . $currentUser["USR_EMAIL"] . '>');
}
}else{
if(isset($emailSetup["MESS_FROM_NAME"]) && isset($emailSetup["MESS_FROM_MAIL"] )){
$emailFrom = ($emailSetup["MESS_FROM_NAME"] . ' <' . $emailSetup["MESS_FROM_MAIL"] . '>');
}else{
$emailFrom = ((isset($emailSetup["MESS_FROM_NAME"])) ? $emailSetup["MESS_FROM_NAME"] : $emailSetup["MESS_FROM_MAIL"]);
}
}
G::LoadClass('wsBase');
$wsBaseInstance = new wsBase();

View File

@@ -1319,6 +1319,10 @@ class Cases
$appAssignSelfServiceValue->remove($sAppUid, $iDelIndex);
/*----------------------------------********---------------------------------*/
//Delete record of the table LIST_UNASSIGNED
$unassigned = new ListUnassigned();
$unassigned->remove($sAppUid, $iDelIndex);
$aFields = $oAppDel->toArray(BasePeer::TYPE_FIELDNAME);
$aFields['APP_STATUS'] = 'TO_DO';
$inbox = new ListInbox();

View File

@@ -114,11 +114,10 @@ class Derivation
$arrayTaskData["NEXT_TASK"]["TAS_PARENT"] = "";
}
$regexpTaskTypeToExclude = "GATEWAYTOGATEWAY|END-MESSAGE-EVENT|SCRIPT-TASK|INTERMEDIATE-CATCH-TIMER-EVENT|END-EMAIL-EVENT";
$regexpTaskTypeToExclude = "GATEWAYTOGATEWAY|END-MESSAGE-EVENT|SCRIPT-TASK|INTERMEDIATE-CATCH-TIMER-EVENT|END-EMAIL-EVENT|INTERMEDIATE-THROW-EMAIL-EVENT";
$arrayTaskData["NEXT_TASK"]["USER_ASSIGNED"] = (!preg_match("/^(?:" . $regexpTaskTypeToExclude . ")$/", $arrayTaskData["NEXT_TASK"]["TAS_TYPE"]))? $this->getNextAssignedUser($arrayTaskData) : array("USR_UID" => "", "USR_FULLNAME" => "");
}
//Return
return $arrayTaskData;
} catch (Exception $e) {
@@ -150,14 +149,6 @@ class Derivation
$arrayNextTaskDefault = array();
$i = 0;
//SELECT *
//FROM APP_DELEGATION AS A
//LEFT JOIN TASK AS T ON(T.TAS_UID = A.TAS_UID)
//LEFT JOIN ROUTE AS R ON(R.TAS_UID = A.TAS_UID)
//WHERE
//APP_UID = '$arrayData["APP_UID"]'
//AND DEL_INDEX = '$arrayData["DEL_INDEX"]'
$criteria = new Criteria("workflow");
$criteria->addSelectColumn(RoutePeer::TAS_UID);
@@ -229,10 +220,6 @@ class Derivation
$count++;
}
if ($arrayRouteData["ROU_TYPE"] == "EVALUATE" && !empty($arrayNextTask)) {
$flagAddDelegation = false;
}
if ($flagAddDelegation &&
preg_match("/^(?:EVALUATE|PARALLEL-BY-EVALUATION)$/", $arrayRouteData["ROU_TYPE"]) &&
trim($arrayRouteData["ROU_CONDITION"]) == ""
@@ -271,7 +258,7 @@ class Derivation
}
}
} else {
$regexpTaskTypeToInclude = "END-MESSAGE-EVENT|END-EMAIL-EVENT";
$regexpTaskTypeToInclude = "END-MESSAGE-EVENT|END-EMAIL-EVENT|INTERMEDIATE-THROW-EMAIL-EVENT";
if ($arrayNextTaskData["NEXT_TASK"]["TAS_UID"] == "-1" &&
preg_match("/^(?:" . $regexpTaskTypeToInclude . ")$/", $arrayNextTaskData["TAS_TYPE"])
@@ -329,13 +316,6 @@ class Derivation
*/
function getRouteCondition ($aData)
{
//SELECT *
//FROM APP_DELEGATION AS A
//LEFT JOIN TASK AS T ON(T.TAS_UID = A.TAS_UID)
//LEFT JOIN ROUTE AS R ON(R.TAS_UID = A.TAS_UID)
//WHERE
//APP_UID = '$aData['APP_UID']'
//AND DEL_INDEX = '$aData['DEL_INDEX']'
$c = new Criteria( 'workflow' );
$c->clearSelectColumns();
$c->addSelectColumn( AppDelegationPeer::TAS_UID );
@@ -506,22 +486,10 @@ class Derivation
*/
function getNextAssignedUser ($tasInfo)
{
//$oUser = new Users();
$nextAssignedTask = $tasInfo['NEXT_TASK'];
$lastAssigned = $tasInfo['NEXT_TASK']['TAS_LAST_ASSIGNED'];
$sTasUid = $tasInfo['NEXT_TASK']['TAS_UID'];
//// to do: we can increase the LOCATION by COUNTRY, STATE and LOCATION
///* Verify if the next Task is set with the option "TAS_ASSIGN_LOCATION == TRUE" */
//$assignLocation = '';
//if ($tasInfo['NEXT_TASK']['TAS_ASSIGN_LOCATION'] == 'TRUE') {
// $oUser->load( $tasInfo['USER_UID'] );
// krumo( $oUser->getUsrLocation() );
// //to do: assign for location
// //$assignLocation = " AND USR_LOCATION = " . $oUser->Fields['USR_LOCATION'];
//}
///* End - Verify if the next Task is set with the option "TAS_ASSIGN_LOCATION == TRUE" */
$taskNext = TaskPeer::retrieveByPK($nextAssignedTask["TAS_UID"]);
$bpmnActivityNext = BpmnActivityPeer::retrieveByPK($nextAssignedTask["TAS_UID"]);
@@ -591,7 +559,17 @@ class Derivation
$userFields['USR_EMAIL'] = '';
//get the report_to user & its full info
$useruid = ($tasInfo["USER_UID"] != "")? $this->checkReplacedByUser($this->getDenpendentUser($tasInfo["USER_UID"])) : "";
$lastManager = $userTasInfo = $tasInfo["USER_UID"];
do {
$userTasInfo = $this->getDenpendentUser($userTasInfo);
$useruid = $this->checkReplacedByUser($userTasInfo);
//When the lastManager is INACTIVE/VACATION and does not have a Replace by, the REPORT_TO is himself
if($lastManager === $userTasInfo){
$useruid = $tasInfo["USER_UID"];
} else {
$lastManager = $userTasInfo;
}
} while ($useruid === '');
if (isset( $useruid ) && $useruid != '') {
$userFields = $this->getUsersFullNameFromArray( $useruid );
@@ -671,239 +649,90 @@ class Derivation
}
/**
* Throw Events for the Case
* Execute Event
*
* @param string $elementOriginUid Unique id of Element Origin (unique id of Task)
* @param string $elementDestUid Unique id of Element Destination (unique id of Task)
* @param array $arrayApplicationData Case data
* @param string $dummyTaskUid Unique id of Element Origin (unique id of Task) This is the nextTask
* @param array $applicationData Case data
* @param bool $flagEventExecuteBeforeGateway Execute event before gateway
* @param bool $flagEventExecuteAfterGateway Execute event after gateway
*
* @return void
*/
private function throwEventsBetweenElementOriginAndElementDest($elementOriginUid, $elementDestUid, array $arrayApplicationData, $flagEventExecuteBeforeGateway = true, $flagEventExecuteAfterGateway = true, $rouCondition="")
private function executeEvent($dummyTaskUid, array $applicationData, $flagEventExecuteBeforeGateway = true, $flagEventExecuteAfterGateway = true, $elementOriUid='')
{
try {
//Verify if the Project is BPMN
$bpmn = new \ProcessMaker\Project\Bpmn();
if (!$bpmn->exists($arrayApplicationData["PRO_UID"])) {
if (!$bpmn->exists($applicationData["PRO_UID"])) {
return;
}
//Element origin and dest
$arrayElement = array();
$elementTaskRelation = new \ProcessMaker\BusinessModel\ElementTaskRelation();
$arrayElement = [
"elementOrigin" => ["uid" => $elementOriginUid, "type" => "bpmnActivity"],
"elementDest" => ["uid" => $elementDestUid, "type" => "bpmnActivity"]
];
foreach ($arrayElement as $key => $value) {
$arrayElementTaskRelationData = $elementTaskRelation->getElementTaskRelationWhere(
$arrayElementTaskRelationData = $elementTaskRelation->getElementTaskRelationWhere(
[
ElementTaskRelationPeer::PRJ_UID => $arrayApplicationData["PRO_UID"],
ElementTaskRelationPeer::PRJ_UID => $applicationData["PRO_UID"],
ElementTaskRelationPeer::ELEMENT_TYPE => "bpmnEvent",
ElementTaskRelationPeer::TAS_UID => $arrayElement[$key]["uid"]
ElementTaskRelationPeer::TAS_UID => $dummyTaskUid
],
true
);
if(is_null($arrayElementTaskRelationData)){
$arrayOtherElement = array();
$arrayOtherElement = $bpmn->getElementsBetweenElementOriginAndElementDest(
$elementOriUid,
"bpmnActivity",
$dummyTaskUid,
"bpmnActivity"
);
if (!is_null($arrayElementTaskRelationData)) {
$arrayElement[$key]["uid"] = $arrayElementTaskRelationData["ELEMENT_UID"];
$arrayElement[$key]["type"] = "bpmnEvent";
$count = 0;
foreach ($arrayOtherElement as $value) {
if($value[1] === 'bpmnEvent'){
$arrayElement[$count]["uid"] = $value[0];
$arrayElement[$count++]["type"] = $value[1];
}
}
}
$elementOriginUid = $arrayElement["elementOrigin"]["uid"];
$elementOriginType = $arrayElement["elementOrigin"]["type"];
$elementDestUid = $arrayElement["elementDest"]["uid"];
$elementDestType = $arrayElement["elementDest"]["type"];
if (!is_null($arrayElementTaskRelationData)) {
$arrayElement[0]["uid"] = $arrayElementTaskRelationData["ELEMENT_UID"];
$arrayElement[0]["type"] = "bpmnEvent";
}
//Throw Events
$messageApplication = new \ProcessMaker\BusinessModel\MessageApplication();
$emailEvent = new \ProcessMaker\BusinessModel\EmailEvent();
$arrayEventExecute = ["BEFORE" => $flagEventExecuteBeforeGateway, "AFTER" => $flagEventExecuteAfterGateway];
$positionEventExecute = "BEFORE";
$arrayElement = $bpmn->getElementsBetweenElementOriginAndElementDest(
$elementOriginUid,
$elementOriginType,
$elementDestUid,
$elementDestType
);
if(sizeof($arrayElement)){
foreach ($arrayElement as $value) {
switch ($value['type']) {
case 'bpmnEvent':
if ($arrayEventExecute[$positionEventExecute]) {
$event = \BpmnEventPeer::retrieveByPK($value['uid']);
//Search next is INTERMEDIATE and MESSAGECATCH
$searchMessageCatch = false;
if($elementDestType === 'bpmnEvent'){
$c = new Criteria("workflow");
$c->addSelectColumn(BpmnEventPeer::EVN_TYPE);
$c->addSelectColumn(BpmnEventPeer::EVN_MARKER);
$c->add(BpmnEventPeer::EVN_UID, $elementDestUid);
$c->add(BpmnEventPeer::PRJ_UID, $arrayApplicationData["PRO_UID"]);
$rsC = RoutePeer::doSelectRS($c);
$rsC->setFetchmode(ResultSet::FETCHMODE_ASSOC);
if (!is_null($event)) {
if (preg_match("/^(?:END|INTERMEDIATE)$/", $event->getEvnType()) && $event->getEvnMarker() === 'MESSAGETHROW') {
//Message-Application throw
$result = $messageApplication->create($applicationData["APP_UID"], $applicationData["PRO_UID"], $value['uid'], $applicationData);
}
if($rsC->next()){
$row = $rsC->getRow();
if($row['EVN_TYPE'] === 'INTERMEDIATE' && $row['EVN_MARKER'] === 'MESSAGECATCH'){
$searchMessageCatch = true;
}
}
}
if($elementDestUid === '-1' || count($arrayElement) === 0 || $searchMessageCatch){
$arrayElement = $this->throwElementToEnd($elementOriginUid, $rouCondition);
}
foreach ($arrayElement as $value) {
switch ($value[1]) {
case 'bpmnEvent':
if ($arrayEventExecute[$positionEventExecute]) {
$event = \BpmnEventPeer::retrieveByPK($value[0]);
if (!is_null($event)) {
if (preg_match("/^(?:END|INTERMEDIATE)$/", $event->getEvnType()) && $event->getEvnMarker() === 'MESSAGETHROW') {
//Message-Application throw
$result = $messageApplication->create($arrayApplicationData["APP_UID"], $arrayApplicationData["PRO_UID"], $value[0], $arrayApplicationData);
}
if (preg_match("/^(?:END|INTERMEDIATE)$/", $event->getEvnType()) && $event->getEvnMarker() === 'EMAIL') {
//Email-Event throw
$result = $emailEvent->sendEmail($arrayApplicationData["APP_UID"], $arrayApplicationData["PRO_UID"], $value[0], $arrayApplicationData);
if (preg_match("/^(?:END|INTERMEDIATE)$/", $event->getEvnType()) && $event->getEvnMarker() === 'EMAIL') {
//Email-Event throw
$result = $emailEvent->sendEmail($applicationData["APP_UID"], $applicationData["PRO_UID"], $value['uid'], $applicationData);
}
}
}
}
break;
case 'bpmnGateway':
$positionEventExecute = 'AFTER';
break;
}
}
} catch (Exception $e) {
throw $e;
}
}
/**
* Throw all events to End Process
*
* @param string $currentTask Task uid
*
* @return void
*/
private function throwElementToEnd($currentTask, $routeCondition){
try{
$bpmnFlow = new BpmnFlow();
$rsCriFlow = $bpmnFlow->getElementOriginToElementDest($currentTask);
$arrayElement = array();
$count = 0;
$continue = false;
if($rsCriFlow->next()){
$continue = true;
$row = $rsCriFlow->getRow();
}
while ($continue) {
$array[0] = $row["FLO_ELEMENT_DEST"];
$array[1] = $row["FLO_ELEMENT_DEST_TYPE"];
$arrayElement[$count++] = $array;
$continue = false;
if($rsCriFlow->next()){
$continue = true;
$row = $rsCriFlow->getRow();
}else{
$rsCriFlow = $bpmnFlow->getElementOriginToElementDest($row["FLO_ELEMENT_DEST"],$routeCondition,"bpmnEvent");
$routeCondition = '';
$continue = false;
if($rsCriFlow->next()){
$continue = true;
$row = $rsCriFlow->getRow();
break;
case 'bpmnGateway':
$positionEventExecute = 'AFTER';
break;
}
}
}
return $arrayElement;
} catch (Exception $e) {
throw $e;
}
}
/**
* Throw Events for the Case
*
* @param string $currentTask Task uid
*
* @return void
*/
private function throwAllRouteInFlow($currentTask,$appFields){
$criFlow = new Criteria("workflow");
$criFlow->addSelectColumn(BpmnFlowPeer::FLO_ELEMENT_ORIGIN);
$criFlow->addSelectColumn(BpmnFlowPeer::FLO_ELEMENT_DEST);
$criFlow->add(BpmnFlowPeer::FLO_ELEMENT_ORIGIN, $currentTask, Criteria::EQUAL);
$rsCriFlow = RoutePeer::doSelectRS($criFlow);
$rsCriFlow->setFetchmode(ResultSet::FETCHMODE_ASSOC);
if($rsCriFlow->next()){
$continue = true;
$row = $rsCriFlow->getRow();
}
while ($continue) {
$origin = $row["FLO_ELEMENT_ORIGIN"];
$destiny = $row["FLO_ELEMENT_DEST"];
$this->throwEventsElemntOriginToElementDest($destiny, $appFields);
$currentDestiny = $destiny;
$continue = false;
if($rsCriFlow->next()){
$continue = true;
$row = $rsCriFlow->getRow();
}else{
//Search the next
$criFlow = new Criteria("workflow");
$criFlow->addSelectColumn(BpmnFlowPeer::FLO_ELEMENT_ORIGIN);
$criFlow->addSelectColumn(BpmnFlowPeer::FLO_ELEMENT_DEST);
$criFlow->add(BpmnFlowPeer::FLO_ELEMENT_ORIGIN, $currentDestiny, Criteria::EQUAL);
$rsCriFlow = RoutePeer::doSelectRS($criFlow);
$rsCriFlow->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$continue = false;
if($rsCriFlow->next()){
$continue = true;
$row = $rsCriFlow->getRow();
}
}
}
return $currentDestiny;
}
/**
* Throw Events for the Case
*
* @param string $eventUid Unique id of Event
* @param array $appFields Case data
*
* @return void
*/
private function throwEventsElemntOriginToElementDest($eventUid, $appFields){
try {
//Verify if the Project is BPMN
$bpmn = new \ProcessMaker\Project\Bpmn();
if (!$bpmn->exists($appFields["PRO_UID"])) {
return;
}
//Throw Events
$messageApplication = new \ProcessMaker\BusinessModel\MessageApplication();
$emailEvent = new \ProcessMaker\BusinessModel\EmailEvent();
$event = \BpmnEventPeer::retrieveByPK($eventUid);
if (!is_null($event)) {
if (preg_match("/^(?:END|INTERMEDIATE)$/", $event->getEvnType()) && $event->getEvnMarker() == "MESSAGETHROW") {
//Message-Application throw
$result = $messageApplication->create($appFields["APP_UID"], $appFields["PRO_UID"], $value[0], $appFields);
}
if (preg_match("/^(?:END|INTERMEDIATE)$/", $event->getEvnType()) && $event->getEvnMarker() == "EMAIL") {
//Email-Event throw
$result = $emailEvent->sendEmail($appFields["APP_UID"], $appFields["PRO_UID"], $eventUid, $appFields);
}
}
} catch (Exception $e) {
throw $e;
}
@@ -1035,7 +864,7 @@ class Derivation
$flagFirstIteration = true;
foreach ($nextDelegations as $nextDel) {
//BpmnEvent - END-MESSAGE-EVENT, END-EMAIL-EVENT
//BpmnEvent - END-MESSAGE-EVENT, END-EMAIL-EVENT, INTERMEDIATE-THROW-EMAIL-EVENT
//Check and get unique id
if (preg_match("/^(.{32})\/(\-1)$/", $nextDel["TAS_UID"], $arrayMatch)) {
$nextDel["TAS_UID"] = $arrayMatch[2];
@@ -1102,17 +931,14 @@ class Derivation
if (!isset($nextDel['ROU_CONDITION'])) {
$nextDel['ROU_CONDITION'] = '';
}
//Execute the Intermediate Event After the End of Process
$this->executeEvent($nextDel["TAS_UID"], $appFields, true, true);
if (isset($nextDel["TAS_UID_DUMMY"]) ) {
$taskDummy = TaskPeer::retrieveByPK($nextDel["TAS_UID_DUMMY"]);
if (preg_match("/^(?:END-MESSAGE-EVENT|END-EMAIL-EVENT)$/", $taskDummy->getTasType())) {
//Throw Events
$this->throwEventsBetweenElementOriginAndElementDest($currentDelegation["TAS_UID"], $nextDel["TAS_UID_DUMMY"], $appFields, $flagFirstIteration, true, $nextDel['ROU_CONDITION']);
} else {
$this->throwEventsBetweenElementOriginAndElementDest($currentDelegation["TAS_UID"], $nextDel["TAS_UID"], $appFields, $flagFirstIteration, true, $nextDel['ROU_CONDITION']);
$this->executeEvent($nextDel["TAS_UID_DUMMY"], $appFields, $flagFirstIteration, true);
}
} else {
//BpmnEvent
$this->throwEventsBetweenElementOriginAndElementDest($currentDelegation["TAS_UID"], $nextDel["TAS_UID"], $appFields, $flagFirstIteration, true, $nextDel['ROU_CONDITION']);
}
break;
case TASK_FINISH_TASK:
@@ -1194,8 +1020,11 @@ class Derivation
if(isset($nextDel['ROU_CONDITION'])){
$rouCondition = $nextDel['ROU_CONDITION'];
}
if(!isset($nextDel['USR_UID'])){
$nextDel['USR_UID'] = '';
}
//Throw Events
$this->throwEventsBetweenElementOriginAndElementDest($currentDelegation["TAS_UID"], $nextDel["TAS_UID"], $appFields, $flagFirstIteration, true, $rouCondition);
$this->executeEvent($nextDel["TAS_UID"], $appFields, true, true, $currentDelegation["TAS_UID"]);
//Derivate
$aSP = (isset($aSP))? $aSP : null;
@@ -1239,7 +1068,7 @@ class Derivation
$appFields["APP_DATA"] = $scriptTask->execScriptByActivityUid($nextDel["TAS_UID"], $appFields);
//Create record in table APP_ASSIGN_SELF_SERVICE_VALUE
$regexpTaskTypeToExclude = "SCRIPT-TASK";
$regexpTaskTypeToExclude = "SCRIPT-TASK|INTERMEDIATE-THROW-EMAIL-EVENT";
if (!is_null($taskNextDel) && !preg_match("/^(?:" . $regexpTaskTypeToExclude . ")$/", $taskNextDel->getTasType())) {
if ($taskNextDel->getTasAssignType() == "SELF_SERVICE" && trim($taskNextDel->getTasGroupVariable()) != "") {
@@ -1259,14 +1088,13 @@ class Derivation
}
//Check if $taskNextDel is Script-Task
if (!is_null($taskNextDel) && $taskNextDel->getTasType() == "SCRIPT-TASK") {
if (!is_null($taskNextDel) && ($taskNextDel->getTasType() === "SCRIPT-TASK" || $taskNextDel->getTasType() === "INTERMEDIATE-THROW-EMAIL-EVENT")) {
//Get for $nextDel["TAS_UID"] your next Task
$currentDelegationAux = array_merge($currentDelegation, array("DEL_INDEX" => $iNewDelIndex, "TAS_UID" => $nextDel["TAS_UID"]));
$nextDelegationsAux = array();
$taskNextDelNextDelRouType = "";
$i = 0;
$arrayTaskNextDelNextDelegations = $this->prepareInformation(array(
"USER_UID" => $_SESSION["USER_LOGGED"],
"APP_UID" => $currentDelegation["APP_UID"],
@@ -1320,8 +1148,11 @@ class Derivation
switch ($routeType) {
case 'SEC-JOIN':
//Throw Events
$this->throwEventsBetweenElementOriginAndElementDest($currentDelegation["TAS_UID"], $nextDel["TAS_UID"], $appFields, $flagFirstIteration, false);
//If the all Siblings are done execute the events
if(sizeof($arraySiblings) === 0){
//Throw Events
$this->executeEvent($nextDel["TAS_UID"], $appFields, $flagFirstIteration, false);
}
//Close thread
$this->case->closeAppThread( $currentDelegation['APP_UID'], $iAppThreadIndex );
@@ -1481,6 +1312,10 @@ class Derivation
$sTargetField = trim($sTargetField, " @#%?$=");
$aNewFields[$sTargetField] = isset( $appFields['APP_DATA'][$sOriginField] ) ? $appFields['APP_DATA'][$sOriginField] : '';
if (array_key_exists($sOriginField . '_label', $appFields['APP_DATA'])) {
$aNewFields[$sTargetField . '_label'] = $appFields['APP_DATA'][$sOriginField . '_label'];
}
}
$aOldFields['APP_DATA'] = array_merge( $aOldFields['APP_DATA'], $aNewFields );
@@ -1607,8 +1442,13 @@ class Derivation
$sTargetField = str_replace('$', '', $sTargetField);
$sTargetField = str_replace('=', '', $sTargetField);
$aNewFields[$sTargetField] = isset($appFields['APP_DATA'][$sOriginField]) ? $appFields['APP_DATA'][$sOriginField] : '';
if (isset($aParentCase['APP_DATA'][$sTargetField . '_label'])) {
$aNewFields[$sTargetField . '_label'] = isset($appFields['APP_DATA'][$sOriginField . '_label']) ? $appFields['APP_DATA'][$sOriginField . '_label'] : '';
if (array_key_exists($sOriginField . '_label', $appFields['APP_DATA'])) {
$aNewFields[$sTargetField . '_label'] = $appFields['APP_DATA'][$sOriginField . '_label'];
} else {
if (array_key_exists($sTargetField . '_label', $aParentCase['APP_DATA'])) {
$aNewFields[$sTargetField . '_label'] = '';
}
}
}
$aParentCase['APP_DATA'] = array_merge($aParentCase['APP_DATA'], $aNewFields);

View File

@@ -408,11 +408,11 @@ class PMPluginRegistry
unset($this->_arrayDesignerMenu[$key]);
}
}
if(sizeof( $this->_aMenuOptionsToReplace )){
unset( $this->_aMenuOptionsToReplace );
}
if(sizeof( $this->_aImportProcessCallbackFile )){
unset( $this->_aImportProcessCallbackFile );
}
@@ -1678,14 +1678,14 @@ class PMPluginRegistry
throw $e;
}
}
/**
* Replace new options to menu
*
* @param unknown_type $namespace
*
* @param array $from
*
*
* @param array $options
*
* @return void
@@ -1701,7 +1701,7 @@ class PMPluginRegistry
$this->_aMenuOptionsToReplace[$from["section"]][$from["menuId"]][] = $options;
}
}
/**
* Return all menu Options from a specific section
*
@@ -1713,10 +1713,10 @@ class PMPluginRegistry
if(sizeof($oMenuFromPlugin)) {
if(array_key_exists($strMenuName,$oMenuFromPlugin)) {
return $oMenuFromPlugin[$strMenuName];
}
}
}
}
/**
* Register a callBackFile in the singleton
*
@@ -1739,12 +1739,12 @@ class PMPluginRegistry
if (!$found) {
$callBackFile = new importCallBack( $namespace, $callBackFile );
$this->_aImportProcessCallbackFile[] = $callBackFile;
}
}
} catch(Excepton $e) {
throw $e;
}
}
/**
* Return all callBackFiles registered
*
@@ -1814,5 +1814,25 @@ class PMPluginRegistry
}
return $plugin;
}
/**
* Checks if the plugin name is Enterprise Plugin
*
* @param string $pluginName Plugin name
* @param string $path Path to plugin
*
* @return bool Returns TRUE when plugin name is Enterprise Plugin, FALSE otherwise
*/
public function isEnterprisePlugin($pluginName, $path = null)
{
$path = (!is_null($path) && $path != '')? rtrim($path, '/\\') . PATH_SEP : PATH_PLUGINS;
$pluginFile = $pluginName . '.php';
//Return
return preg_match(
'/^.*class\s+' . $pluginName . 'Plugin\s+extends\s+(?:enterprisePlugin)\s*\{.*$/i',
str_replace(["\n", "\r", "\t"], ' ', file_get_contents($path . $pluginFile))
);
}
}

View File

@@ -419,26 +419,26 @@ class pmDynaform
}
}
if ($key === "type" && ($value === "file") && isset($this->fields["APP_DATA"]["APPLICATION"])) {
$oCriteria = new Criteria("workflow");
$oCriteria->addSelectColumn(AppDocumentPeer::APP_DOC_UID);
$oCriteria->addSelectColumn(AppDocumentPeer::DOC_VERSION);
$oCriteria->addSelectColumn(ContentPeer::CON_VALUE);
$oCriteria->addJoin(AppDocumentPeer::APP_DOC_UID, ContentPeer::CON_ID, Criteria::LEFT_JOIN);
$oCriteria->add(AppDocumentPeer::APP_UID, $this->fields["APP_DATA"]["APPLICATION"]);
$oCriteria->add(AppDocumentPeer::APP_DOC_FIELDNAME, $json->name);
$oCriteria->add(ContentPeer::CON_CATEGORY, 'APP_DOC_FILENAME');
$oCriteria->add(ContentPeer::CON_LANG, $this->lang);
$oCriteria->addDescendingOrderByColumn(AppDocumentPeer::APP_DOC_CREATE_DATE);
$oCriteria->setLimit(1);
$rs = AppDocumentPeer::doSelectRS($oCriteria);
$oCriteriaAppDocument = new Criteria("workflow");
$oCriteriaAppDocument->addSelectColumn(AppDocumentPeer::APP_DOC_UID);
$oCriteriaAppDocument->addSelectColumn(AppDocumentPeer::DOC_VERSION);
$oCriteriaAppDocument->add(AppDocumentPeer::APP_UID, $this->fields["APP_DATA"]["APPLICATION"]);
$oCriteriaAppDocument->add(AppDocumentPeer::APP_DOC_FIELDNAME, $json->name);
$oCriteriaAppDocument->addDescendingOrderByColumn(AppDocumentPeer::APP_DOC_CREATE_DATE);
$oCriteriaAppDocument->setLimit(1);
$rs = AppDocumentPeer::doSelectRS($oCriteriaAppDocument);
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$rs->next();
$links = array();
$labelsFromDb = array();
$appDocUids = array();
while ($rs->next()) {
$row = $rs->getRow();
$oAppDocument = new AppDocument();
if ($row = $rs->getRow()) {
$oAppDocument->load($row["APP_DOC_UID"], $row["DOC_VERSION"]);
$links[] = "../cases/cases_ShowDocument?a=" . $row["APP_DOC_UID"] . "&v=" . $row["DOC_VERSION"];
$labelsFromDb[] = $row["CON_VALUE"];
$labelsFromDb[] = $oAppDocument->getAppDocFilename();
$appDocUids[] = $row["APP_DOC_UID"];
}
$json->data = new stdClass();

View File

@@ -3639,3 +3639,57 @@ function PMFCopyDocumentCase($appDocUid, $versionNumber, $targetCaseUid, $inputD
throw $e;
}
}
/**
* @method
*
* Add user or group to Task
*
* @name PMFAddUserGroupToTask
* @label PMF Add user or group to Task
* @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#PMFAddUserGroupToTask.28.29
*
* @param string | $taskUid | Task Uid | The unique Id of the Task.
* @param string | $userGroupUid | Uid from User or Group | The unique Uid from User or Group.
*
* @return int Returns 1 when is assigned.
*/
function PMFAddUserGroupToTask($taskUid, $userGroupUid)
{
//Verify data and Set variables
$task = new \ProcessMaker\BusinessModel\Task();
$taskwf = TaskPeer::retrieveByPK($taskUid);
if (is_null($taskwf)) {
throw new Exception(G::LoadTranslation('ID_TASK_NOT_EXIST', ['tas_uid', $taskUid]));
}
$uid = '';
$userType = '';
$objUser = UsersPeer::retrieveByPK($userGroupUid);
if (!is_null($objUser)) {
$uid = $userGroupUid;
$userType = 'user';
} else {
$groupUid = GroupwfPeer::retrieveByPK($userGroupUid);
if (!is_null($groupUid)) {
$uid = $userGroupUid;
$userType = 'group';
} else {
throw new Exception(G::LoadTranslation(
'ID_USER_GROUP_NOT_CORRESPOND', [$userGroupUid, G::LoadTranslation('ID_USER') . '/' . G::LoadTranslation('ID_GROUP')]
));
}
}
//Assignee User/Group
$task->addTaskAssignee($taskwf->getProUid(), $taskUid, $uid, $userType);
//Return
return 1;
}

View File

@@ -109,12 +109,14 @@ class workspaceTools
$final = $stop - $start;
CLI::logging("<*> Backup log files Process took $final seconds.\n");
/*----------------------------------********---------------------------------*/
$start = microtime(true);
CLI::logging("> Migrate new lists...\n");
$this->migrateList($workSpace, false, $lang);
$stop = microtime(true);
$final = $stop - $start;
CLI::logging("<*> Migrate new lists Process took $final seconds.\n");
/*----------------------------------********---------------------------------*/
$start = microtime(true);
CLI::logging("> Updating Files Manager...\n");
@@ -2011,10 +2013,18 @@ class workspaceTools
$this->regenerateListParticipatedHistory(); // this list require no translation
$this->regenerateListParticipatedLast(); // this list require no translation
$this->regenerateListPaused(); // this list require no translation
$this->regenerateListUnassigned(); // this list require no translation
$this->migrateCounters();
}
if (!$flagReinsert) {
$this->listFirstExecution("insert");
$this->listFirstExecution('insert', 'unassigned');
}
//Check for the List Unassigned
if(!$this->listFirstExecution('check','unassigned')){
$this->regenerateListUnassigned(); // this list require no translation
$this->listFirstExecution('insert', 'unassigned');
}
//Return
@@ -2373,7 +2383,7 @@ class workspaceTools
ACV.APP_PRO_TITLE,
ACV.APP_TAS_TITLE,
ACV.APP_STATUS,
ACV.PREVIOUS_USR_UID AS DEL_PREVIOUS_USR_UID,
PRE_USR.USR_UID AS DEL_PREVIOUS_USR_UID,
PRE_USR.USR_USERNAME AS DEL_PREVIOUS_USR_USERNAME,
PRE_USR.USR_FIRSTNAME AS DEL_PREVIOUS_USR_FIRSTNAME,
PRE_USR.USR_LASTNAME AS DEL_PREVIOUS_USR_LASTNAME,
@@ -2383,23 +2393,31 @@ class workspaceTools
ACV.DEL_DELEGATE_DATE AS DEL_DELEGATE_DATE,
ACV.DEL_INIT_DATE AS DEL_INIT_DATE,
ACV.DEL_TASK_DUE_DATE AS DEL_DUE_DATE,
ACV.APP_TAS_TITLE AS DEL_CURRENT_TAS_TITLE,
CURR_USER_ACV.APP_TAS_TITLE AS DEL_CURRENT_TAS_TITLE,
ACV.DEL_PRIORITY,
ACV.DEL_THREAD_STATUS
FROM
'.$this->dbName.'.APP_CACHE_VIEW ACV
LEFT JOIN
'.$this->dbName.'.USERS CUR_USR ON ACV.USR_UID = CUR_USR.USR_UID
LEFT JOIN
'.$this->dbName.'.USERS PRE_USR ON ACV.PREVIOUS_USR_UID = PRE_USR.USR_UID
(SELECT
*, MAX(ACV_INT.DEL_INDEX) MAX_DEL_INDEX
FROM
'.$this->dbName.'.APP_CACHE_VIEW ACV_INT
GROUP BY ACV_INT.APP_UID , ACV_INT.USR_UID) ACV
INNER JOIN
(SELECT
ACV.APP_UID, ACV.USR_UID, MAX(DEL_INDEX) DEL_INDEX
ACV.APP_UID, ACV.USR_UID, ACV.APP_TAS_TITLE, ACV.PREVIOUS_USR_UID, ACV.DEL_INDEX
FROM
'.$this->dbName.'.APP_CACHE_VIEW ACV
GROUP BY ACV.APP_UID , ACV.USR_UID) LAST_ACV ON LAST_ACV.APP_UID = ACV.APP_UID
AND LAST_ACV.USR_UID = ACV.USR_UID
AND LAST_ACV.DEL_INDEX = ACV.DEL_INDEX
APP_CACHE_VIEW ACV
INNER JOIN
(SELECT
ACV_INT.APP_UID, MAX(ACV_INT.DEL_INDEX) DEL_INDEX
FROM
'.$this->dbName.'.APP_CACHE_VIEW ACV_INT
GROUP BY ACV_INT.APP_UID) LAST_ACV ON LAST_ACV.APP_UID = ACV.APP_UID
AND LAST_ACV.DEL_INDEX = ACV.DEL_INDEX) CURR_USER_ACV ON CURR_USER_ACV.APP_UID = ACV.APP_UID
LEFT JOIN
'.$this->dbName.'.USERS PRE_USR ON CURR_USER_ACV.PREVIOUS_USR_UID = PRE_USR.USR_UID
LEFT JOIN
'.$this->dbName.'.USERS CUR_USR ON CURR_USER_ACV.USR_UID = CUR_USR.USR_UID
';
$con = Propel::getConnection("workflow");
$stmt = $con->createStatement();
@@ -2435,6 +2453,61 @@ class workspaceTools
CLI::logging("> Completed table LIST_PAUSED\n");
}
/*----------------------------------********---------------------------------*/
public function regenerateListUnassigned(){
$this->initPropel(true);
$truncate = 'TRUNCATE '.$this->dbName.'.LIST_UNASSIGNED';
//This executeQuery is very fast than Propel
$query = 'INSERT INTO '.$this->dbName.'.LIST_UNASSIGNED
(APP_UID,
DEL_INDEX,
TAS_UID,
PRO_UID,
APP_NUMBER,
APP_TITLE,
APP_PRO_TITLE,
APP_TAS_TITLE,
DEL_PREVIOUS_USR_USERNAME,
DEL_PREVIOUS_USR_FIRSTNAME,
DEL_PREVIOUS_USR_LASTNAME,
APP_UPDATE_DATE,
DEL_PREVIOUS_USR_UID,
DEL_DELEGATE_DATE,
DEL_DUE_DATE,
DEL_PRIORITY)
SELECT
ACV.APP_UID,
ACV.DEL_INDEX,
ACV.TAS_UID,
ACV.PRO_UID,
ACV.APP_NUMBER,
ACV.APP_TITLE,
ACV.APP_PRO_TITLE,
ACV.APP_TAS_TITLE,
USR.USR_USERNAME AS DEL_PREVIOUS_USR_USERNAME,
USR.USR_FIRSTNAME AS DEL_PREVIOUS_USR_FIRSTNAME,
USR.USR_LASTNAME AS DEL_PREVIOUS_USR_LASTNAME,
ACV.APP_UPDATE_DATE,
ACV.PREVIOUS_USR_UID AS DEL_PREVIOUS_USR_UID,
ACV.DEL_DELEGATE_DATE AS DEL_DELEGATE_DATE,
ACV.DEL_TASK_DUE_DATE AS DEL_DUE_DATE,
ACV.DEL_PRIORITY
FROM
'.$this->dbName.'.APP_CACHE_VIEW ACV
LEFT JOIN
'.$this->dbName.'.USERS USR ON ACV.PREVIOUS_USR_UID = USR.USR_UID
WHERE
ACV.DEL_THREAD_STATUS = \'OPEN\'
AND ACV.USR_UID = \'\' ';
$con = Propel::getConnection("workflow");
$stmt = $con->createStatement();
$stmt->executeQuery($truncate);
$stmt->executeQuery($query);
CLI::logging("> Completed table LIST_UNASSIGNED\n");
}
/*----------------------------------********---------------------------------*/
public function migrateCounters()
{
$this->initPropel(true);
@@ -2532,41 +2605,59 @@ class workspaceTools
*
* return boolean value
*/
public function listFirstExecution ($action){
public function listFirstExecution ($action, $list='all'){
$this->initPropel(true);
switch ($action) {
case 'insert':
case 'insert':
$conf = new Configuration();
if (!($conf->exists('MIGRATED_LIST', 'list', 'list', 'list', 'list'))) {
$data["CFG_UID"] ='MIGRATED_LIST';
$data["OBJ_UID"] ='list';
$data["CFG_VALUE"]='true';
$data["PRO_UID"] ='list';
$data["USR_UID"] ='list';
$data["APP_UID"] ='list';
$conf->create($data);
if($list==='all'){
if (!($conf->exists('MIGRATED_LIST', 'list', 'list', 'list', 'list'))) {
$data["CFG_UID"] ='MIGRATED_LIST';
$data["OBJ_UID"] ='list';
$data["CFG_VALUE"]='true';
$data["PRO_UID"] ='list';
$data["USR_UID"] ='list';
$data["APP_UID"] ='list';
$conf->create($data);
}
}
if($list==='unassigned'){
if (!($conf->exists('MIGRATED_LIST_UNASSIGNED', 'list', 'list', 'list', 'list'))) {
$data["CFG_UID"] ='MIGRATED_LIST_UNASSIGNED';
$data["OBJ_UID"] ='list';
$data["CFG_VALUE"]='true';
$data["PRO_UID"] ='list';
$data["USR_UID"] ='list';
$data["APP_UID"] ='list';
$conf->create($data);
}
}
return true;
break;
case 'check':
$criteria = new Criteria("workflow");
$criteria->addSelectColumn(ConfigurationPeer::CFG_UID);
if($list==='all'){
$criteria->add(ConfigurationPeer::CFG_UID, "MIGRATED_LIST", CRITERIA::EQUAL);
}
if($list==='unassigned'){
$criteria->add(ConfigurationPeer::CFG_UID, "MIGRATED_LIST_UNASSIGNED", CRITERIA::EQUAL);
}
$rsCriteria = AppCacheViewPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$aRows = array ();
while ($rsCriteria->next()) {
$aRows[] = $rsCriteria->getRow();
}
if(empty($aRows)){
return false; //If is false continue with the migrated
} else {
return true; //Stop
}
break;
case 'check':
$criteria = new Criteria("workflow");
$criteria->addSelectColumn(ConfigurationPeer::CFG_UID);
$criteria->add(ConfigurationPeer::CFG_UID, "MIGRATED_LIST", CRITERIA::EQUAL);
$rsCriteria = AppCacheViewPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$aRows = array ();
while ($rsCriteria->next()) {
$aRows[] = $rsCriteria->getRow();
}
if(empty($aRows)){
return false; //If is false continue with the migrated
} else {
return true; //Stop
}
break;
default:
default:
return true;
}
}
}
/**
@@ -2655,7 +2746,7 @@ class workspaceTools
CLI::logging(" All roles permissions already updated \n");
}
}
public function checkSequenceNumber()
{
$criteria = new Criteria("workflow");

View File

@@ -96,6 +96,7 @@ class AppDelegation extends BaseAppDelegation
$delIndex = (isset($row["DEL_INDEX"]))? $row["DEL_INDEX"] + 1 : 1;
$delPreviusUsrUid = $row["USR_UID"];
$delPreviousFather = $row["DEL_PREVIOUS"];
} else {
$criteriaDelIndex = new Criteria("workflow");
@@ -116,7 +117,7 @@ class AppDelegation extends BaseAppDelegation
//Verify successors: parrallel submit in the same time
if($flagControl){
$nextTaskUid = $sTasUid;
$index = $this->getAllTasksBeforeSecJoin($nextTaskUid, $sAppUid);
$index = $this->getAllTasksBeforeSecJoin($nextTaskUid, $sAppUid, $delPreviousFather);
if($this->createThread($index, $sAppUid)){
return 0;
}
@@ -190,7 +191,6 @@ class AppDelegation extends BaseAppDelegation
// Hook for the trigger PM_CREATE_NEW_DELEGATION
if (defined( 'PM_CREATE_NEW_DELEGATION' )) {
$bpmn = new \ProcessMaker\Project\Bpmn();
$flagActionsByEmail = true;
@@ -781,13 +781,15 @@ class AppDelegation extends BaseAppDelegation
* @param string $sAppUid
* @return array $index
*/
public static function getAllTasksBeforeSecJoin($nextTaskUid, $sAppUid){
public static function getAllTasksBeforeSecJoin($nextTaskUid, $sAppUid, $sDelPrevious){
$criteriaR = new Criteria('workflow');
$criteriaR->addSelectColumn(AppDelegationPeer::DEL_INDEX);
$criteriaR->addSelectColumn(AppDelegationPeer::DEL_PREVIOUS);
$criteriaR->addJoin(RoutePeer::TAS_UID, AppDelegationPeer::TAS_UID, Criteria::LEFT_JOIN);
$criteriaR->add(RoutePeer::ROU_NEXT_TASK, $nextTaskUid, Criteria::EQUAL);
$criteriaR->add(RoutePeer::ROU_TYPE, 'SEC-JOIN', Criteria::EQUAL);
$criteriaR->add(AppDelegationPeer::APP_UID, $sAppUid, Criteria::EQUAL);
$criteriaR->add(AppDelegationPeer::DEL_PREVIOUS, $sDelPrevious, Criteria::EQUAL);
$rsCriteriaR = RoutePeer::doSelectRS($criteriaR);
$rsCriteriaR->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$index = array();

View File

@@ -84,6 +84,8 @@ class ListInbox extends BaseListInbox
$listParticipatedLast->create($data);
$listParticipatedLast = new ListParticipatedLast();
$listParticipatedLast->refresh($data, $isSelfService);
$listUnassigned = new ListUnassigned();
$listUnassigned->newRow($data, $data['DEL_PREVIOUS_USR_UID']);
}
return $result;
@@ -264,7 +266,7 @@ class ListInbox extends BaseListInbox
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
$aRow = $dataset->getRow();
if ($aRow['CON_VALUE'] == '') {
if ($aRow['CON_VALUE'] == '') {
$criteria = new Criteria();
$criteria->addSelectColumn(ContentPeer::CON_VALUE);
$criteria->add( ContentPeer::CON_ID, $data['APP_UID'], Criteria::EQUAL );
@@ -306,6 +308,11 @@ class ListInbox extends BaseListInbox
$data['APP_PREVIOUS_USER'] = '';
if($data['DEL_PREVIOUS_USR_UID'] === ''){
global $RBAC;
$aUser = $RBAC->aUserInfo['USER_INFO'];
$data['DEL_PREVIOUS_USR_UID'] = $aUser['USR_UID'];
}
if ($data['DEL_PREVIOUS_USR_UID'] != '') {
$criteria = new Criteria();
$criteria->addSelectColumn(UsersPeer::USR_USERNAME);

View File

@@ -16,6 +16,7 @@ require_once 'classes/model/om/BaseListUnassigned.php';
*/
class ListUnassigned extends BaseListUnassigned
{
private $total = 0;
/**
* Create List Unassigned Table
*
@@ -79,11 +80,12 @@ class ListUnassigned extends BaseListUnassigned
* @throws type
*
*/
public function remove ($app_uid)
public function remove ($appUid, $delIndex)
{
$con = Propel::getConnection( ListUnassignedPeer::DATABASE_NAME );
try {
$this->setAppUid($app_uid);
$this->setAppUid($appUid);
$this->setDelIndex($delIndex);
$con->begin();
$this->delete();
@@ -94,8 +96,8 @@ class ListUnassigned extends BaseListUnassigned
}
}
public function newRow ($data, $delPreviusUsrUid) {
$data['UNA_UID'] = (isset($data['UNA_UID'])) ? $data['UNA_UID']: G::GenerateUniqueId() ;
public function newRow ($data, $delPreviusUsrUid)
{
$data['DEL_PREVIOUS_USR_UID'] = $delPreviusUsrUid;
$data['DEL_DUE_DATE'] = $data['DEL_TASK_DUE_DATE'];
@@ -157,13 +159,13 @@ class ListUnassigned extends BaseListUnassigned
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
$aRow = $dataset->getRow();
$data['APP_PREVIOUS_USR_USERNAME'] = $aRow['USR_USERNAME'];
$data['APP_PREVIOUS_USR_FIRSTNAME'] = $aRow['USR_FIRSTNAME'];
$data['APP_PREVIOUS_USR_LASTNAME'] = $aRow['USR_LASTNAME'];
$data['DEL_PREVIOUS_USR_USERNAME'] = $aRow['USR_USERNAME'];
$data['DEL_PREVIOUS_USR_FIRSTNAME'] = $aRow['USR_FIRSTNAME'];
$data['DEL_PREVIOUS_USR_LASTNAME'] = $aRow['USR_LASTNAME'];
}
self::create($data);
return $data['UNA_UID'];
return true;
}
public function loadFilters (&$criteria, $filters)
@@ -235,13 +237,7 @@ class ListUnassigned extends BaseListUnassigned
public function countTotal ($usr_uid, $filters = array())
{
$criteria = new Criteria();
$aConditions = array();
$aConditions[] = array(ListUnassignedPeer::UNA_UID, ListUnassignedGroupPeer::UNA_UID);
$aConditions[] = array(ListUnassignedGroupPeer::USR_UID, "'" . $usr_uid . "'");
$criteria->addJoinMC($aConditions, Criteria::INNER_JOIN);
self::loadFilters($criteria, $filters);
$total = ListUnassignedPeer::doCount( $criteria );
$total = $this->total;
return (int)$total;
}
@@ -249,6 +245,7 @@ class ListUnassigned extends BaseListUnassigned
{
$resp = array();
$pmTable = new PmTable();
$tasks = $this->getSelfServiceTasks( $usr_uid );
$criteria = $pmTable->addPMFieldsToList('unassigned');
$criteria->addSelectColumn(ListUnassignedPeer::APP_UID);
@@ -259,124 +256,225 @@ class ListUnassigned extends BaseListUnassigned
$criteria->addSelectColumn(ListUnassignedPeer::APP_TITLE);
$criteria->addSelectColumn(ListUnassignedPeer::APP_PRO_TITLE);
$criteria->addSelectColumn(ListUnassignedPeer::APP_TAS_TITLE);
$criteria->addSelectColumn(ListUnassignedPeer::APP_PREVIOUS_USR_USERNAME);
$criteria->addSelectColumn(ListUnassignedPeer::APP_PREVIOUS_USR_FIRSTNAME);
$criteria->addSelectColumn(ListUnassignedPeer::APP_PREVIOUS_USR_LASTNAME);
$criteria->addSelectColumn(ListUnassignedPeer::APP_UPDATE_DATE);
$criteria->addSelectColumn(ListUnassignedPeer::DEL_PREVIOUS_USR_USERNAME);
$criteria->addSelectColumn(ListUnassignedPeer::DEL_PREVIOUS_USR_FIRSTNAME);
$criteria->addSelectColumn(ListUnassignedPeer::DEL_PREVIOUS_USR_LASTNAME);
$criteria->addSelectColumn(ListUnassignedPeer::DEL_PREVIOUS_USR_UID);
$criteria->addSelectColumn(ListUnassignedPeer::DEL_DELEGATE_DATE);
$criteria->addSelectColumn(ListUnassignedPeer::DEL_DUE_DATE);
$criteria->addSelectColumn(ListUnassignedPeer::DEL_PRIORITY);
$aConditions = array();
$aConditions[] = array(ListUnassignedPeer::UNA_UID, ListUnassignedGroupPeer::UNA_UID);
$aConditions[] = array(ListUnassignedGroupPeer::USR_UID, "'" . $usr_uid . "'");
$criteria->addJoinMC($aConditions, Criteria::INNER_JOIN);
//Self Service Value Based Assignment
$aSelfServiceValueBased = $this->getSelfServiceCasesByEvaluate($usr_uid);
if (!empty($aSelfServiceValueBased)) {
$criterionAux = null;
//Load Self Service Value Based Assignment
foreach ($aSelfServiceValueBased as $value) {
if (is_null($criterionAux)) {
$criterionAux = $criteria->getNewCriterion(
ListUnassignedPeer::APP_UID,
$value["APP_UID"],
Criteria::EQUAL
)->addAnd(
$criteria->getNewCriterion(
ListUnassignedPeer::DEL_INDEX,
$value["DEL_INDEX"],
Criteria::EQUAL
)
)->addAnd(
$criteria->getNewCriterion(
ListUnassignedPeer::TAS_UID,
$value["TAS_UID"],
Criteria::EQUAL
)
);
} else {
$criterionAux = $criteria->getNewCriterion(
ListUnassignedPeer::APP_UID,
$value["APP_UID"],
Criteria::EQUAL
)->addAnd(
$criteria->getNewCriterion(
ListUnassignedPeer::DEL_INDEX, $value["DEL_INDEX"], Criteria::EQUAL
)
)->addAnd(
$criteria->getNewCriterion(
ListUnassignedPeer::TAS_UID, $value["TAS_UID"], Criteria::EQUAL
)
)->addOr(
$criterionAux
);
}
}
//And Load Selfservice
$criteria->add(
$criterionAux->addOr($criteria->getNewCriterion(ListUnassignedPeer::TAS_UID, $tasks, Criteria::IN))
);
}else{
//Load Selfservice
$criteria->add(ListUnassignedPeer::TAS_UID, $tasks, Criteria::IN);
}
//Apply some filters
self::loadFilters($criteria, $filters);
$sort = (!empty($filters['sort'])) ? $filters['sort'] : "LIST_UNASSIGNED.DEL_DELEGATE_DATE";
$dir = isset($filters['dir']) ? $filters['dir'] : "ASC";
$start = isset($filters['start']) ? $filters['start'] : "0";
$limit = isset($filters['limit']) ? $filters['limit'] : "25";
$paged = isset($filters['paged']) ? $filters['paged'] : 1;
$count = isset($filters['count']) ? $filters['count'] : 1;
if ($count == 1) {
$criteriaTotal = clone $criteria;
$resp['total'] = ListUnassignedPeer::doCount( $criteriaTotal );
}
if ($dir == "DESC") {
$criteria->addDescendingOrderByColumn($sort);
} else {
$criteria->addAscendingOrderByColumn($sort);
}
if ($paged == 1) {
$criteria->setLimit( $limit );
$criteria->setOffset( $start );
}
$dataset = ListUnassignedPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$data = array();
$aPriorities = array ('1' => 'VL','2' => 'L','3' => 'N','4' => 'H','5' => 'VH');
$data = array();
while ($dataset->next()) {
$aRow = (is_null($callbackRecord))? $dataset->getRow() : $callbackRecord($dataset->getRow());
$aRow['DEL_PRIORITY'] = (isset($aRow['DEL_PRIORITY']) && is_numeric($aRow['DEL_PRIORITY']) && $aRow['DEL_PRIORITY'] <= 5 && $aRow['DEL_PRIORITY'] > 0 ) ? $aRow['DEL_PRIORITY'] : 3;
$aRow['DEL_PRIORITY'] = G::LoadTranslation( "ID_PRIORITY_{$aPriorities[$aRow['DEL_PRIORITY']]}" );
$data[] = $aRow;
}
if ($count == 1) {
$resp['data'] = $data;
} else {
$resp = $data;
}
return $resp;
$this->total = count($data);
return $data;
}
/**
* Generate Data
*
* @return object criteria
*/
public function generateData($appUid,$delPreviusUsrUid){
try {
G::LoadClass("case");
//Generate data
$case = new Cases();
/**
* Get Selfservice Value Based
*
* @param string $userUid
* @return array criteria $arrayAppAssignSelfServiceValueData
*/
public function getSelfServiceCasesByEvaluate($userUid)
{
try {
G::LoadClass("groups");
$arrayAppAssignSelfServiceValueData = array();
//Get APP_UIDs
$group = new Groups();
$arrayUid = $group->getActiveGroupsForAnUser($userUid); //Set UIDs of Groups (Groups of User)
$arrayUid[] = $userUid; //Set UID of User
$criteria = new Criteria("workflow");
$criteria->addSelectColumn(AppDelegationPeer::APP_UID);
$criteria->addSelectColumn(AppDelegationPeer::DEL_INDEX);
$criteria->addSelectColumn(ApplicationPeer::APP_DATA);
$criteria->addSelectColumn(AppDelegationPeer::PRO_UID);
$criteria->addSelectColumn(AppDelegationPeer::DEL_TASK_DUE_DATE);
$criteria->addSelectColumn(TaskPeer::TAS_UID);
$criteria->addSelectColumn(TaskPeer::TAS_GROUP_VARIABLE);
$criteria->addJoin(AppDelegationPeer::APP_UID, ApplicationPeer::APP_UID, Criteria::LEFT_JOIN);
$criteria->addJoin(AppDelegationPeer::TAS_UID, TaskPeer::TAS_UID, Criteria::LEFT_JOIN);
$criteria->add(TaskPeer::TAS_ASSIGN_TYPE, "SELF_SERVICE", Criteria::EQUAL);
//$criteria->add(TaskPeer::TAS_GROUP_VARIABLE, "", Criteria::NOT_EQUAL);
$criteria->setDistinct();
$criteria->addSelectColumn(AppAssignSelfServiceValuePeer::APP_UID);
$criteria->addSelectColumn(AppAssignSelfServiceValuePeer::DEL_INDEX);
$criteria->addSelectColumn(AppAssignSelfServiceValuePeer::TAS_UID);
$arrayCondition = array();
$arrayCondition[] = array(AppAssignSelfServiceValuePeer::APP_UID, AppDelegationPeer::APP_UID, Criteria::EQUAL);
$arrayCondition[] = array(AppAssignSelfServiceValuePeer::DEL_INDEX, AppDelegationPeer::DEL_INDEX, Criteria::EQUAL);
$arrayCondition[] = array(AppAssignSelfServiceValuePeer::TAS_UID, AppDelegationPeer::TAS_UID, Criteria::EQUAL);
$criteria->addJoinMC($arrayCondition, Criteria::LEFT_JOIN);
$criteria->add(AppDelegationPeer::USR_UID, "", Criteria::EQUAL);
$criteria->add(AppDelegationPeer::DEL_THREAD_STATUS, "OPEN", Criteria::EQUAL);
$criteria->add(AppDelegationPeer::APP_UID, $appUid, Criteria::EQUAL);
$rsCriteria = AppDelegationPeer::doSelectRS($criteria);
$criterionAux = null;
foreach ($arrayUid as $value) {
if (is_null($criterionAux)) {
$criterionAux = $criteria->getNewCriterion(AppAssignSelfServiceValuePeer::GRP_UID, "%$value%", Criteria::LIKE);
} else {
$criterionAux = $criteria->getNewCriterion(AppAssignSelfServiceValuePeer::GRP_UID, "%$value%", Criteria::LIKE)->addOr($criterionAux);
}
}
$criteria->add($criterionAux);
$rsCriteria = AppAssignSelfServiceValuePeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$applicationData = $case->unserializeData($row["APP_DATA"]);
$taskGroupVariable = trim($row["TAS_GROUP_VARIABLE"], " @#");
$delPreviusUsrUid = '';
$unaUid = $this->newRow($row,$delPreviusUsrUid);
//Selfservice by group
if ($taskGroupVariable != "" && isset($applicationData[$taskGroupVariable]) && trim($applicationData[$taskGroupVariable]) != "") {
$gprUid = trim($applicationData[$taskGroupVariable]);
//Define Users by Group
$gpr = new GroupUser();
$arrayUsers = $gpr->getAllGroupUser($gprUid);
foreach($arrayUsers as $urow){
$newRow["USR_UID"] = $urow["USR_UID"];
$listUnassignedGpr = new ListUnassignedGroup();
$listUnassignedGpr->newRow($unaUid,$urow["USR_UID"],"GROUP",$gprUid);
}
} else {
//Define all users assigned to Task
$task = new TaskUser();
$arrayUsers = $task->getAllUsersTask($row["TAS_UID"]);
foreach($arrayUsers as $urow){
$newRow["USR_UID"] = $urow["USR_UID"];
$listUnassignedGpr = new ListUnassignedGroup();
$listUnassignedGpr->newRow($unaUid,$urow["USR_UID"],"USER","");
}
}
$arrayAppAssignSelfServiceValueData[] = array(
"APP_UID" => $row["APP_UID"],
"DEL_INDEX" => $row["DEL_INDEX"],
"TAS_UID" => $row["TAS_UID"]
);
}
//Return
return $arrayAppAssignSelfServiceValueData;
} catch (Exception $e) {
throw $e;
}
}
/**
* get user's SelfService tasks
* @param string $sUIDUser
* @return $rows
*/
public function getSelfServiceTasks($userUid = '')
{
$rows[] = array();
$tasks = array();
//check self service tasks assigned directly to this user
$c = new Criteria();
$c->clearSelectColumns();
$c->addSelectColumn(TaskPeer::TAS_UID);
$c->addSelectColumn(TaskPeer::PRO_UID);
$c->addJoin(TaskPeer::PRO_UID, ProcessPeer::PRO_UID, Criteria::LEFT_JOIN);
$c->addJoin(TaskPeer::TAS_UID, TaskUserPeer::TAS_UID, Criteria::LEFT_JOIN);
$c->add(ProcessPeer::PRO_STATUS, 'ACTIVE');
$c->add(TaskPeer::TAS_ASSIGN_TYPE, 'SELF_SERVICE');
$c->add(TaskPeer::TAS_GROUP_VARIABLE, '');
$c->add(TaskUserPeer::USR_UID, $userUid);
$rs = TaskPeer::doSelectRS($c);
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$rs->next();
$row = $rs->getRow();
while (is_array($row)) {
$tasks[] = $row['TAS_UID'];
$rs->next();
$row = $rs->getRow();
}
//check groups assigned to SelfService task
G::LoadClass('groups');
$group = new Groups();
$aGroups = $group->getActiveGroupsForAnUser($userUid);
$c = new Criteria();
$c->clearSelectColumns();
$c->addSelectColumn(TaskPeer::TAS_UID);
$c->addSelectColumn(TaskPeer::PRO_UID);
$c->addJoin(TaskPeer::PRO_UID, ProcessPeer::PRO_UID, Criteria::LEFT_JOIN);
$c->addJoin(TaskPeer::TAS_UID, TaskUserPeer::TAS_UID, Criteria::LEFT_JOIN);
$c->add(ProcessPeer::PRO_STATUS, 'ACTIVE');
$c->add(TaskPeer::TAS_ASSIGN_TYPE, 'SELF_SERVICE');
$c->add(TaskPeer::TAS_GROUP_VARIABLE, '');
$c->add(TaskUserPeer::USR_UID, $aGroups, Criteria::IN);
$rs = TaskPeer::doSelectRS($c);
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$rs->next();
$row = $rs->getRow();
while (is_array($row)) {
$tasks[] = $row['TAS_UID'];
$rs->next();
$row = $rs->getRow();
}
return $tasks;
}
}

View File

@@ -188,6 +188,7 @@ class Process extends BaseProcess
$this->setProWidth( 10000 );
$this->setProTitleX( 0 );
$this->setProTitleY( 0 );
$this->setProItee( 1 );
$this->setProDynaforms( isset( $aData['PRO_DYNAFORMS'] ) ? (is_array( $aData['PRO_DYNAFORMS'] ) ? serialize( $aData['PRO_DYNAFORMS'] ) : $aData['PRO_DYNAFORMS']) : '' );
if ($this->validate()) {

View File

@@ -67,7 +67,7 @@ class ListUnassignedMapBuilder
$tMap->addPrimaryKey('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addPrimaryKey('UNA_UID', 'UnaUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addPrimaryKey('DEL_INDEX', 'DelIndex', 'int', CreoleTypes::INTEGER, true, null);
$tMap->addColumn('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
@@ -81,13 +81,13 @@ class ListUnassignedMapBuilder
$tMap->addColumn('APP_TAS_TITLE', 'AppTasTitle', 'string', CreoleTypes::VARCHAR, true, 255);
$tMap->addColumn('APP_PREVIOUS_USR_USERNAME', 'AppPreviousUsrUsername', 'string', CreoleTypes::VARCHAR, false, 100);
$tMap->addColumn('DEL_PREVIOUS_USR_USERNAME', 'DelPreviousUsrUsername', 'string', CreoleTypes::VARCHAR, false, 100);
$tMap->addColumn('APP_PREVIOUS_USR_FIRSTNAME', 'AppPreviousUsrFirstname', 'string', CreoleTypes::VARCHAR, false, 50);
$tMap->addColumn('DEL_PREVIOUS_USR_FIRSTNAME', 'DelPreviousUsrFirstname', 'string', CreoleTypes::VARCHAR, false, 50);
$tMap->addColumn('APP_PREVIOUS_USR_LASTNAME', 'AppPreviousUsrLastname', 'string', CreoleTypes::VARCHAR, false, 50);
$tMap->addColumn('DEL_PREVIOUS_USR_LASTNAME', 'DelPreviousUsrLastname', 'string', CreoleTypes::VARCHAR, false, 50);
$tMap->addColumn('DEL_INDEX', 'DelIndex', 'int', CreoleTypes::INTEGER, true, null);
$tMap->addColumn('APP_UPDATE_DATE', 'AppUpdateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
$tMap->addColumn('DEL_PREVIOUS_USR_UID', 'DelPreviousUsrUid', 'string', CreoleTypes::VARCHAR, false, 32);

View File

@@ -135,6 +135,8 @@ class ProcessMapBuilder
$tMap->addColumn('PRO_UNIT_COST', 'ProUnitCost', 'string', CreoleTypes::VARCHAR, false, 50);
$tMap->addColumn('PRO_ITEE', 'ProItee', 'int', CreoleTypes::INTEGER, true, null);
$tMap->addValidator('PRO_TIMEUNIT', 'validValues', 'propel.validator.ValidValuesValidator', 'WEEKS|MONTHS|DAYS|HOURS|MINUTES', 'Please select a valid Time Unit.');
$tMap->addValidator('PRO_STATUS', 'validValues', 'propel.validator.ValidValuesValidator', 'ACTIVE|INACTIVE|DISABLED', 'Please select a valid Process Status.');

View File

@@ -159,7 +159,7 @@ class TaskMapBuilder
$tMap->addColumn('TAS_SELFSERVICE_EXECUTION', 'TasSelfserviceExecution', 'string', CreoleTypes::VARCHAR, false, 15);
$tMap->addValidator('TAS_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'NORMAL|ADHOC|SUBPROCESS|HIDDEN|GATEWAYTOGATEWAY|WEBENTRYEVENT|END-MESSAGE-EVENT|START-MESSAGE-EVENT|INTERMEDIATE-THROW-MESSAGE-EVENT|INTERMEDIATE-CATCH-MESSAGE-EVENT|SCRIPT-TASK|START-TIMER-EVENT|INTERMEDIATE-CATCH-TIMER-EVENT|END-EMAIL-EVENT', 'Please set a valid value for TAS_TYPE');
$tMap->addValidator('TAS_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'NORMAL|ADHOC|SUBPROCESS|HIDDEN|GATEWAYTOGATEWAY|WEBENTRYEVENT|END-MESSAGE-EVENT|START-MESSAGE-EVENT|INTERMEDIATE-THROW-MESSAGE-EVENT|INTERMEDIATE-CATCH-MESSAGE-EVENT|SCRIPT-TASK|START-TIMER-EVENT|INTERMEDIATE-CATCH-TIMER-EVENT|END-EMAIL-EVENT|INTERMEDIATE-THROW-EMAIL-EVENT', 'Please set a valid value for TAS_TYPE');
$tMap->addValidator('TAS_TIMEUNIT', 'validValues', 'propel.validator.ValidValuesValidator', 'MINUTES|HOURS|DAYS|WEEKS|MONTHS', 'Please select a valid value for TAS_TIMEUNIT.');

View File

@@ -34,10 +34,10 @@ abstract class BaseListUnassigned extends BaseObject implements Persistent
protected $app_uid = '';
/**
* The value for the una_uid field.
* The value for the del_index field.
* @var string
*/
protected $una_uid = '';
protected $del_index = 0;
/**
* The value for the tas_uid field.
@@ -76,28 +76,28 @@ abstract class BaseListUnassigned extends BaseObject implements Persistent
protected $app_tas_title = '';
/**
* The value for the app_previous_usr_username field.
* The value for the del_previous_usr_username field.
* @var string
*/
protected $app_previous_usr_username = '';
protected $del_previous_usr_username = '';
/**
* The value for the app_previous_usr_firstname field.
* The value for the del_previous_usr_firstname field.
* @var string
*/
protected $app_previous_usr_firstname = '';
protected $del_previous_usr_firstname = '';
/**
* The value for the app_previous_usr_lastname field.
* The value for the del_previous_usr_lastname field.
* @var string
*/
protected $app_previous_usr_lastname = '';
protected $del_previous_usr_lastname = '';
/**
* The value for the del_index field.
* The value for the app_update_date field.
* @var int
*/
protected $del_index = 0;
protected $app_update_date;
/**
* The value for the del_previous_usr_uid field.
@@ -149,14 +149,14 @@ abstract class BaseListUnassigned extends BaseObject implements Persistent
}
/**
* Get the [una_uid] column value.
* Get the [del_index] column value.
*
* @return string
*/
public function getUnaUid()
public function getDelIndex()
{
return $this->una_uid;
return $this->del_index;
}
/**
@@ -226,47 +226,68 @@ abstract class BaseListUnassigned extends BaseObject implements Persistent
}
/**
* Get the [app_previous_usr_username] column value.
* Get the [del_previous_usr_username] column value.
*
* @return string
*/
public function getAppPreviousUsrUsername()
{
return $this->app_previous_usr_username;
return $this->del_previous_usr_username;
}
/**
* Get the [app_previous_usr_firstname] column value.
* Get the [del_previous_usr_firstname] column value.
*
* @return string
*/
public function getAppPreviousUsrFirstname()
{
return $this->app_previous_usr_firstname;
return $this->del_previous_usr_firstname;
}
/**
* Get the [app_previous_usr_lastname] column value.
* Get the [del_previous_usr_lastname] column value.
*
* @return string
*/
public function getAppPreviousUsrLastname()
{
return $this->app_previous_usr_lastname;
return $this->del_previous_usr_lastname;
}
/**
* Get the [del_index] column value.
* Get the [optionally formatted] [app_update_date] column value.
*
* @return int
* @param string $format The date/time format string (either date()-style or strftime()-style).
* If format is NULL, then the integer unix timestamp will be returned.
* @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
* @throws PropelException - if unable to convert the date/time to timestamp.
*/
public function getDelIndex()
public function getAppUpdateDate($format = 'Y-m-d H:i:s')
{
return $this->del_index;
if ($this->app_update_date === null || $this->app_update_date === '') {
return null;
} elseif (!is_int($this->app_update_date)) {
// a non-timestamp value was set externally, so we convert it
$ts = strtotime($this->app_update_date);
if ($ts === -1 || $ts === false) {
throw new PropelException("Unable to parse value of [app_update_date] as date/time value: " .
var_export($this->app_update_date, true));
}
} else {
$ts = $this->app_update_date;
}
if ($format === null) {
return $ts;
} elseif (strpos($format, '%') !== false) {
return strftime($format, $ts);
} else {
return date($format, $ts);
}
}
/**
@@ -378,26 +399,26 @@ abstract class BaseListUnassigned extends BaseObject implements Persistent
} // setAppUid()
/**
* Set the value of [una_uid] column.
* Set the value of [del_index] column.
*
* @param string $v new value
* @param int $v new value
* @return void
*/
public function setUnaUid($v)
public function setDelIndex($v)
{
// Since the native PHP type for this column is string,
// we will cast the input to a string (if it is not).
if ($v !== null && !is_string($v)) {
$v = (string) $v;
// Since the native PHP type for this column is integer,
// we will cast the input value to an int (if it is not).
if ($v !== null && !is_int($v) && is_numeric($v)) {
$v = (int) $v;
}
if ($this->una_uid !== $v || $v === '') {
$this->una_uid = $v;
$this->modifiedColumns[] = ListUnassignedPeer::UNA_UID;
if ($this->del_index !== $v || $v === 0) {
$this->del_index = $v;
$this->modifiedColumns[] = ListUnassignedPeer::DEL_INDEX;
}
} // setUnaUid()
} // setDelIndex()
/**
* Set the value of [tas_uid] column.
@@ -532,7 +553,7 @@ abstract class BaseListUnassigned extends BaseObject implements Persistent
} // setAppTasTitle()
/**
* Set the value of [app_previous_usr_username] column.
* Set the value of [del_previous_usr_username] column.
*
* @param string $v new value
* @return void
@@ -546,15 +567,15 @@ abstract class BaseListUnassigned extends BaseObject implements Persistent
$v = (string) $v;
}
if ($this->app_previous_usr_username !== $v || $v === '') {
$this->app_previous_usr_username = $v;
$this->modifiedColumns[] = ListUnassignedPeer::APP_PREVIOUS_USR_USERNAME;
if ($this->del_previous_usr_username !== $v || $v === '') {
$this->del_previous_usr_username = $v;
$this->modifiedColumns[] = ListUnassignedPeer::DEL_PREVIOUS_USR_USERNAME;
}
} // setAppPreviousUsrUsername()
/**
* Set the value of [app_previous_usr_firstname] column.
* Set the value of [del_previous_usr_firstname] column.
*
* @param string $v new value
* @return void
@@ -568,15 +589,15 @@ abstract class BaseListUnassigned extends BaseObject implements Persistent
$v = (string) $v;
}
if ($this->app_previous_usr_firstname !== $v || $v === '') {
$this->app_previous_usr_firstname = $v;
$this->modifiedColumns[] = ListUnassignedPeer::APP_PREVIOUS_USR_FIRSTNAME;
if ($this->del_previous_usr_firstname !== $v || $v === '') {
$this->del_previous_usr_firstname = $v;
$this->modifiedColumns[] = ListUnassignedPeer::DEL_PREVIOUS_USR_FIRSTNAME;
}
} // setAppPreviousUsrFirstname()
/**
* Set the value of [app_previous_usr_lastname] column.
* Set the value of [del_previous_usr_lastname] column.
*
* @param string $v new value
* @return void
@@ -590,34 +611,41 @@ abstract class BaseListUnassigned extends BaseObject implements Persistent
$v = (string) $v;
}
if ($this->app_previous_usr_lastname !== $v || $v === '') {
$this->app_previous_usr_lastname = $v;
$this->modifiedColumns[] = ListUnassignedPeer::APP_PREVIOUS_USR_LASTNAME;
if ($this->del_previous_usr_lastname !== $v || $v === '') {
$this->del_previous_usr_lastname = $v;
$this->modifiedColumns[] = ListUnassignedPeer::DEL_PREVIOUS_USR_LASTNAME;
}
} // setAppPreviousUsrLastname()
/**
* Set the value of [del_index] column.
* Set the value of [app_update_date] column.
*
* @param int $v new value
* @return void
*/
public function setDelIndex($v)
public function setAppUpdateDate($v)
{
// Since the native PHP type for this column is integer,
// we will cast the input value to an int (if it is not).
if ($v !== null && !is_int($v) && is_numeric($v)) {
$v = (int) $v;
if ($v !== null && !is_int($v)) {
$ts = strtotime($v);
//Date/time accepts null values
if ($v == '') {
$ts = null;
}
if ($ts === -1 || $ts === false) {
throw new PropelException("Unable to parse date/time value for [app_update_date] from input: " .
var_export($v, true));
}
} else {
$ts = $v;
}
if ($this->app_update_date !== $ts) {
$this->app_update_date = $ts;
$this->modifiedColumns[] = ListUnassignedPeer::APP_UPDATE_DATE;
}
if ($this->del_index !== $v || $v === 0) {
$this->del_index = $v;
$this->modifiedColumns[] = ListUnassignedPeer::DEL_INDEX;
}
} // setDelIndex()
} // setAppUpdateDate()
/**
* Set the value of [del_previous_usr_uid] column.
@@ -740,7 +768,7 @@ abstract class BaseListUnassigned extends BaseObject implements Persistent
$this->app_uid = $rs->getString($startcol + 0);
$this->una_uid = $rs->getString($startcol + 1);
$this->del_index = $rs->getInt($startcol + 1);
$this->tas_uid = $rs->getString($startcol + 2);
@@ -754,13 +782,13 @@ abstract class BaseListUnassigned extends BaseObject implements Persistent
$this->app_tas_title = $rs->getString($startcol + 7);
$this->app_previous_usr_username = $rs->getString($startcol + 8);
$this->del_previous_usr_username = $rs->getString($startcol + 8);
$this->app_previous_usr_firstname = $rs->getString($startcol + 9);
$this->del_previous_usr_firstname = $rs->getString($startcol + 9);
$this->app_previous_usr_lastname = $rs->getString($startcol + 10);
$this->del_previous_usr_lastname = $rs->getString($startcol + 10);
$this->del_index = $rs->getInt($startcol + 11);
$this->app_update_date = $rs->getTimestamp($startcol + 11, null);
$this->del_previous_usr_uid = $rs->getString($startcol + 12);
@@ -983,7 +1011,7 @@ abstract class BaseListUnassigned extends BaseObject implements Persistent
return $this->getAppUid();
break;
case 1:
return $this->getUnaUid();
return $this->getDelIndex();
break;
case 2:
return $this->getTasUid();
@@ -1013,7 +1041,7 @@ abstract class BaseListUnassigned extends BaseObject implements Persistent
return $this->getAppPreviousUsrLastname();
break;
case 11:
return $this->getDelIndex();
return $this->getAppUpdateDate();
break;
case 12:
return $this->getDelPreviousUsrUid();
@@ -1048,7 +1076,7 @@ abstract class BaseListUnassigned extends BaseObject implements Persistent
$keys = ListUnassignedPeer::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getAppUid(),
$keys[1] => $this->getUnaUid(),
$keys[1] => $this->getDelIndex(),
$keys[2] => $this->getTasUid(),
$keys[3] => $this->getProUid(),
$keys[4] => $this->getAppNumber(),
@@ -1058,7 +1086,7 @@ abstract class BaseListUnassigned extends BaseObject implements Persistent
$keys[8] => $this->getAppPreviousUsrUsername(),
$keys[9] => $this->getAppPreviousUsrFirstname(),
$keys[10] => $this->getAppPreviousUsrLastname(),
$keys[11] => $this->getDelIndex(),
$keys[11] => $this->getAppUpdateDate(),
$keys[12] => $this->getDelPreviousUsrUid(),
$keys[13] => $this->getDelDelegateDate(),
$keys[14] => $this->getDelDueDate(),
@@ -1098,7 +1126,7 @@ abstract class BaseListUnassigned extends BaseObject implements Persistent
$this->setAppUid($value);
break;
case 1:
$this->setUnaUid($value);
$this->setDelIndex($value);
break;
case 2:
$this->setTasUid($value);
@@ -1128,7 +1156,7 @@ abstract class BaseListUnassigned extends BaseObject implements Persistent
$this->setAppPreviousUsrLastname($value);
break;
case 11:
$this->setDelIndex($value);
$this->setAppUpdateDate($value);
break;
case 12:
$this->setDelPreviousUsrUid($value);
@@ -1170,7 +1198,7 @@ abstract class BaseListUnassigned extends BaseObject implements Persistent
}
if (array_key_exists($keys[1], $arr)) {
$this->setUnaUid($arr[$keys[1]]);
$this->setDelIndex($arr[$keys[1]]);
}
if (array_key_exists($keys[2], $arr)) {
@@ -1210,7 +1238,7 @@ abstract class BaseListUnassigned extends BaseObject implements Persistent
}
if (array_key_exists($keys[11], $arr)) {
$this->setDelIndex($arr[$keys[11]]);
$this->setAppUpdateDate($arr[$keys[11]]);
}
if (array_key_exists($keys[12], $arr)) {
@@ -1244,8 +1272,8 @@ abstract class BaseListUnassigned extends BaseObject implements Persistent
$criteria->add(ListUnassignedPeer::APP_UID, $this->app_uid);
}
if ($this->isColumnModified(ListUnassignedPeer::UNA_UID)) {
$criteria->add(ListUnassignedPeer::UNA_UID, $this->una_uid);
if ($this->isColumnModified(ListUnassignedPeer::DEL_INDEX)) {
$criteria->add(ListUnassignedPeer::DEL_INDEX, $this->del_index);
}
if ($this->isColumnModified(ListUnassignedPeer::TAS_UID)) {
@@ -1272,20 +1300,20 @@ abstract class BaseListUnassigned extends BaseObject implements Persistent
$criteria->add(ListUnassignedPeer::APP_TAS_TITLE, $this->app_tas_title);
}
if ($this->isColumnModified(ListUnassignedPeer::APP_PREVIOUS_USR_USERNAME)) {
$criteria->add(ListUnassignedPeer::APP_PREVIOUS_USR_USERNAME, $this->app_previous_usr_username);
if ($this->isColumnModified(ListUnassignedPeer::DEL_PREVIOUS_USR_USERNAME)) {
$criteria->add(ListUnassignedPeer::DEL_PREVIOUS_USR_USERNAME, $this->del_previous_usr_username);
}
if ($this->isColumnModified(ListUnassignedPeer::APP_PREVIOUS_USR_FIRSTNAME)) {
$criteria->add(ListUnassignedPeer::APP_PREVIOUS_USR_FIRSTNAME, $this->app_previous_usr_firstname);
if ($this->isColumnModified(ListUnassignedPeer::DEL_PREVIOUS_USR_FIRSTNAME)) {
$criteria->add(ListUnassignedPeer::DEL_PREVIOUS_USR_FIRSTNAME, $this->del_previous_usr_firstname);
}
if ($this->isColumnModified(ListUnassignedPeer::APP_PREVIOUS_USR_LASTNAME)) {
$criteria->add(ListUnassignedPeer::APP_PREVIOUS_USR_LASTNAME, $this->app_previous_usr_lastname);
if ($this->isColumnModified(ListUnassignedPeer::DEL_PREVIOUS_USR_LASTNAME)) {
$criteria->add(ListUnassignedPeer::DEL_PREVIOUS_USR_LASTNAME, $this->del_previous_usr_lastname);
}
if ($this->isColumnModified(ListUnassignedPeer::DEL_INDEX)) {
$criteria->add(ListUnassignedPeer::DEL_INDEX, $this->del_index);
if ($this->isColumnModified(ListUnassignedPeer::APP_UPDATE_DATE)) {
$criteria->add(ListUnassignedPeer::APP_UPDATE_DATE, $this->app_update_date);
}
if ($this->isColumnModified(ListUnassignedPeer::DEL_PREVIOUS_USR_UID)) {
@@ -1321,7 +1349,7 @@ abstract class BaseListUnassigned extends BaseObject implements Persistent
$criteria = new Criteria(ListUnassignedPeer::DATABASE_NAME);
$criteria->add(ListUnassignedPeer::APP_UID, $this->app_uid);
$criteria->add(ListUnassignedPeer::UNA_UID, $this->una_uid);
$criteria->add(ListUnassignedPeer::DEL_INDEX, $this->del_index);
return $criteria;
}
@@ -1337,7 +1365,7 @@ abstract class BaseListUnassigned extends BaseObject implements Persistent
$pks[0] = $this->getAppUid();
$pks[1] = $this->getUnaUid();
$pks[1] = $this->getDelIndex();
return $pks;
}
@@ -1353,7 +1381,7 @@ abstract class BaseListUnassigned extends BaseObject implements Persistent
$this->setAppUid($keys[0]);
$this->setUnaUid($keys[1]);
$this->setDelIndex($keys[1]);
}
@@ -1382,13 +1410,13 @@ abstract class BaseListUnassigned extends BaseObject implements Persistent
$copyObj->setAppTasTitle($this->app_tas_title);
$copyObj->setAppPreviousUsrUsername($this->app_previous_usr_username);
$copyObj->setAppPreviousUsrUsername($this->del_previous_usr_username);
$copyObj->setAppPreviousUsrFirstname($this->app_previous_usr_firstname);
$copyObj->setAppPreviousUsrFirstname($this->del_previous_usr_firstname);
$copyObj->setAppPreviousUsrLastname($this->app_previous_usr_lastname);
$copyObj->setAppPreviousUsrLastname($this->del_previous_usr_lastname);
$copyObj->setDelIndex($this->del_index);
$copyObj->setAppUpdateDate($this->app_update_date);
$copyObj->setDelPreviousUsrUid($this->del_previous_usr_uid);
@@ -1403,7 +1431,7 @@ abstract class BaseListUnassigned extends BaseObject implements Persistent
$copyObj->setAppUid(''); // this is a pkey column, so set to default value
$copyObj->setUnaUid(''); // this is a pkey column, so set to default value
$copyObj->setDelIndex(0); // this is a pkey column, so set to default value
}

View File

@@ -34,8 +34,8 @@ abstract class BaseListUnassignedPeer
/** the column name for the APP_UID field */
const APP_UID = 'LIST_UNASSIGNED.APP_UID';
/** the column name for the UNA_UID field */
const UNA_UID = 'LIST_UNASSIGNED.UNA_UID';
/** the column name for the DEL_INDEX field */
const DEL_INDEX = 'LIST_UNASSIGNED.DEL_INDEX';
/** the column name for the TAS_UID field */
const TAS_UID = 'LIST_UNASSIGNED.TAS_UID';
@@ -55,17 +55,17 @@ abstract class BaseListUnassignedPeer
/** the column name for the APP_TAS_TITLE field */
const APP_TAS_TITLE = 'LIST_UNASSIGNED.APP_TAS_TITLE';
/** the column name for the APP_PREVIOUS_USR_USERNAME field */
const APP_PREVIOUS_USR_USERNAME = 'LIST_UNASSIGNED.APP_PREVIOUS_USR_USERNAME';
/** the column name for the DEL_PREVIOUS_USR_USERNAME field */
const DEL_PREVIOUS_USR_USERNAME = 'LIST_UNASSIGNED.DEL_PREVIOUS_USR_USERNAME';
/** the column name for the APP_PREVIOUS_USR_FIRSTNAME field */
const APP_PREVIOUS_USR_FIRSTNAME = 'LIST_UNASSIGNED.APP_PREVIOUS_USR_FIRSTNAME';
/** the column name for the DEL_PREVIOUS_USR_FIRSTNAME field */
const DEL_PREVIOUS_USR_FIRSTNAME = 'LIST_UNASSIGNED.DEL_PREVIOUS_USR_FIRSTNAME';
/** the column name for the APP_PREVIOUS_USR_LASTNAME field */
const APP_PREVIOUS_USR_LASTNAME = 'LIST_UNASSIGNED.APP_PREVIOUS_USR_LASTNAME';
/** the column name for the DEL_PREVIOUS_USR_LASTNAME field */
const DEL_PREVIOUS_USR_LASTNAME = 'LIST_UNASSIGNED.DEL_PREVIOUS_USR_LASTNAME';
/** the column name for the DEL_INDEX field */
const DEL_INDEX = 'LIST_UNASSIGNED.DEL_INDEX';
/** the column name for the APP_UPDATE_DATE field */
const APP_UPDATE_DATE = 'LIST_UNASSIGNED.APP_UPDATE_DATE';
/** the column name for the DEL_PREVIOUS_USR_UID field */
const DEL_PREVIOUS_USR_UID = 'LIST_UNASSIGNED.DEL_PREVIOUS_USR_UID';
@@ -90,9 +90,9 @@ abstract class BaseListUnassignedPeer
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('AppUid', 'UnaUid', 'TasUid', 'ProUid', 'AppNumber', 'AppTitle', 'AppProTitle', 'AppTasTitle', 'AppPreviousUsrUsername', 'AppPreviousUsrFirstname', 'AppPreviousUsrLastname', 'DelIndex', 'DelPreviousUsrUid', 'DelDelegateDate', 'DelDueDate', 'DelPriority', ),
BasePeer::TYPE_COLNAME => array (ListUnassignedPeer::APP_UID, ListUnassignedPeer::UNA_UID, ListUnassignedPeer::TAS_UID, ListUnassignedPeer::PRO_UID, ListUnassignedPeer::APP_NUMBER, ListUnassignedPeer::APP_TITLE, ListUnassignedPeer::APP_PRO_TITLE, ListUnassignedPeer::APP_TAS_TITLE, ListUnassignedPeer::APP_PREVIOUS_USR_USERNAME, ListUnassignedPeer::APP_PREVIOUS_USR_FIRSTNAME, ListUnassignedPeer::APP_PREVIOUS_USR_LASTNAME, ListUnassignedPeer::DEL_INDEX, ListUnassignedPeer::DEL_PREVIOUS_USR_UID, ListUnassignedPeer::DEL_DELEGATE_DATE, ListUnassignedPeer::DEL_DUE_DATE, ListUnassignedPeer::DEL_PRIORITY, ),
BasePeer::TYPE_FIELDNAME => array ('APP_UID', 'UNA_UID', 'TAS_UID', 'PRO_UID', 'APP_NUMBER', 'APP_TITLE', 'APP_PRO_TITLE', 'APP_TAS_TITLE', 'APP_PREVIOUS_USR_USERNAME', 'APP_PREVIOUS_USR_FIRSTNAME', 'APP_PREVIOUS_USR_LASTNAME', 'DEL_INDEX', 'DEL_PREVIOUS_USR_UID', 'DEL_DELEGATE_DATE', 'DEL_DUE_DATE', 'DEL_PRIORITY', ),
BasePeer::TYPE_PHPNAME => array ('AppUid', 'DelIndex', 'TasUid', 'ProUid', 'AppNumber', 'AppTitle', 'AppProTitle', 'AppTasTitle', 'DelPreviousUsrUsername', 'DelPreviousUsrFirstname', 'DelPreviousUsrLastname', 'AppUpdateDate', 'DelPreviousUsrUid', 'DelDelegateDate', 'DelDueDate', 'DelPriority', ),
BasePeer::TYPE_COLNAME => array (ListUnassignedPeer::APP_UID, ListUnassignedPeer::DEL_INDEX, ListUnassignedPeer::TAS_UID, ListUnassignedPeer::PRO_UID, ListUnassignedPeer::APP_NUMBER, ListUnassignedPeer::APP_TITLE, ListUnassignedPeer::APP_PRO_TITLE, ListUnassignedPeer::APP_TAS_TITLE, ListUnassignedPeer::DEL_PREVIOUS_USR_USERNAME, ListUnassignedPeer::DEL_PREVIOUS_USR_FIRSTNAME, ListUnassignedPeer::DEL_PREVIOUS_USR_LASTNAME, ListUnassignedPeer::APP_UPDATE_DATE, ListUnassignedPeer::DEL_PREVIOUS_USR_UID, ListUnassignedPeer::DEL_DELEGATE_DATE, ListUnassignedPeer::DEL_DUE_DATE, ListUnassignedPeer::DEL_PRIORITY, ),
BasePeer::TYPE_FIELDNAME => array ('APP_UID', 'DEL_INDEX', 'TAS_UID', 'PRO_UID', 'APP_NUMBER', 'APP_TITLE', 'APP_PRO_TITLE', 'APP_TAS_TITLE', 'DEL_PREVIOUS_USR_USERNAME', 'DEL_PREVIOUS_USR_FIRSTNAME', 'DEL_PREVIOUS_USR_LASTNAME', 'APP_UPDATE_DATE', 'DEL_PREVIOUS_USR_UID', 'DEL_DELEGATE_DATE', 'DEL_DUE_DATE', 'DEL_PRIORITY', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, )
);
@@ -103,9 +103,9 @@ abstract class BaseListUnassignedPeer
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('AppUid' => 0, 'UnaUid' => 1, 'TasUid' => 2, 'ProUid' => 3, 'AppNumber' => 4, 'AppTitle' => 5, 'AppProTitle' => 6, 'AppTasTitle' => 7, 'AppPreviousUsrUsername' => 8, 'AppPreviousUsrFirstname' => 9, 'AppPreviousUsrLastname' => 10, 'DelIndex' => 11, 'DelPreviousUsrUid' => 12, 'DelDelegateDate' => 13, 'DelDueDate' => 14, 'DelPriority' => 15, ),
BasePeer::TYPE_COLNAME => array (ListUnassignedPeer::APP_UID => 0, ListUnassignedPeer::UNA_UID => 1, ListUnassignedPeer::TAS_UID => 2, ListUnassignedPeer::PRO_UID => 3, ListUnassignedPeer::APP_NUMBER => 4, ListUnassignedPeer::APP_TITLE => 5, ListUnassignedPeer::APP_PRO_TITLE => 6, ListUnassignedPeer::APP_TAS_TITLE => 7, ListUnassignedPeer::APP_PREVIOUS_USR_USERNAME => 8, ListUnassignedPeer::APP_PREVIOUS_USR_FIRSTNAME => 9, ListUnassignedPeer::APP_PREVIOUS_USR_LASTNAME => 10, ListUnassignedPeer::DEL_INDEX => 11, ListUnassignedPeer::DEL_PREVIOUS_USR_UID => 12, ListUnassignedPeer::DEL_DELEGATE_DATE => 13, ListUnassignedPeer::DEL_DUE_DATE => 14, ListUnassignedPeer::DEL_PRIORITY => 15, ),
BasePeer::TYPE_FIELDNAME => array ('APP_UID' => 0, 'UNA_UID' => 1, 'TAS_UID' => 2, 'PRO_UID' => 3, 'APP_NUMBER' => 4, 'APP_TITLE' => 5, 'APP_PRO_TITLE' => 6, 'APP_TAS_TITLE' => 7, 'APP_PREVIOUS_USR_USERNAME' => 8, 'APP_PREVIOUS_USR_FIRSTNAME' => 9, 'APP_PREVIOUS_USR_LASTNAME' => 10, 'DEL_INDEX' => 11, 'DEL_PREVIOUS_USR_UID' => 12, 'DEL_DELEGATE_DATE' => 13, 'DEL_DUE_DATE' => 14, 'DEL_PRIORITY' => 15, ),
BasePeer::TYPE_PHPNAME => array ('AppUid' => 0, 'DelIndex' => 1, 'TasUid' => 2, 'ProUid' => 3, 'AppNumber' => 4, 'AppTitle' => 5, 'AppProTitle' => 6, 'AppTasTitle' => 7, 'AppPreviousUsrUsername' => 8, 'AppPreviousUsrFirstname' => 9, 'AppPreviousUsrLastname' => 10, 'AppUpdateDate' => 11, 'DelPreviousUsrUid' => 12, 'DelDelegateDate' => 13, 'DelDueDate' => 14, 'DelPriority' => 15, ),
BasePeer::TYPE_COLNAME => array (ListUnassignedPeer::APP_UID => 0, ListUnassignedPeer::DEL_INDEX => 1, ListUnassignedPeer::TAS_UID => 2, ListUnassignedPeer::PRO_UID => 3, ListUnassignedPeer::APP_NUMBER => 4, ListUnassignedPeer::APP_TITLE => 5, ListUnassignedPeer::APP_PRO_TITLE => 6, ListUnassignedPeer::APP_TAS_TITLE => 7, ListUnassignedPeer::DEL_PREVIOUS_USR_USERNAME => 8, ListUnassignedPeer::DEL_PREVIOUS_USR_FIRSTNAME => 9, ListUnassignedPeer::DEL_PREVIOUS_USR_LASTNAME => 10, ListUnassignedPeer::APP_UPDATE_DATE => 11, ListUnassignedPeer::DEL_PREVIOUS_USR_UID => 12, ListUnassignedPeer::DEL_DELEGATE_DATE => 13, ListUnassignedPeer::DEL_DUE_DATE => 14, ListUnassignedPeer::DEL_PRIORITY => 15, ),
BasePeer::TYPE_FIELDNAME => array ('APP_UID' => 0, 'DEL_INDEX' => 1, 'TAS_UID' => 2, 'PRO_UID' => 3, 'APP_NUMBER' => 4, 'APP_TITLE' => 5, 'APP_PRO_TITLE' => 6, 'APP_TAS_TITLE' => 7, 'DEL_PREVIOUS_USR_USERNAME' => 8, 'DEL_PREVIOUS_USR_FIRSTNAME' => 9, 'DEL_PREVIOUS_USR_LASTNAME' => 10, 'APP_UPDATE_DATE' => 11, 'DEL_PREVIOUS_USR_UID' => 12, 'DEL_DELEGATE_DATE' => 13, 'DEL_DUE_DATE' => 14, 'DEL_PRIORITY' => 15, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, )
);
@@ -209,7 +209,7 @@ abstract class BaseListUnassignedPeer
$criteria->addSelectColumn(ListUnassignedPeer::APP_UID);
$criteria->addSelectColumn(ListUnassignedPeer::UNA_UID);
$criteria->addSelectColumn(ListUnassignedPeer::DEL_INDEX);
$criteria->addSelectColumn(ListUnassignedPeer::TAS_UID);
@@ -223,13 +223,13 @@ abstract class BaseListUnassignedPeer
$criteria->addSelectColumn(ListUnassignedPeer::APP_TAS_TITLE);
$criteria->addSelectColumn(ListUnassignedPeer::APP_PREVIOUS_USR_USERNAME);
$criteria->addSelectColumn(ListUnassignedPeer::DEL_PREVIOUS_USR_USERNAME);
$criteria->addSelectColumn(ListUnassignedPeer::APP_PREVIOUS_USR_FIRSTNAME);
$criteria->addSelectColumn(ListUnassignedPeer::DEL_PREVIOUS_USR_FIRSTNAME);
$criteria->addSelectColumn(ListUnassignedPeer::APP_PREVIOUS_USR_LASTNAME);
$criteria->addSelectColumn(ListUnassignedPeer::DEL_PREVIOUS_USR_LASTNAME);
$criteria->addSelectColumn(ListUnassignedPeer::DEL_INDEX);
$criteria->addSelectColumn(ListUnassignedPeer::APP_UPDATE_DATE);
$criteria->addSelectColumn(ListUnassignedPeer::DEL_PREVIOUS_USR_UID);
@@ -454,8 +454,8 @@ abstract class BaseListUnassignedPeer
$comparison = $criteria->getComparison(ListUnassignedPeer::APP_UID);
$selectCriteria->add(ListUnassignedPeer::APP_UID, $criteria->remove(ListUnassignedPeer::APP_UID), $comparison);
$comparison = $criteria->getComparison(ListUnassignedPeer::UNA_UID);
$selectCriteria->add(ListUnassignedPeer::UNA_UID, $criteria->remove(ListUnassignedPeer::UNA_UID), $comparison);
$comparison = $criteria->getComparison(ListUnassignedPeer::DEL_INDEX);
$selectCriteria->add(ListUnassignedPeer::DEL_INDEX, $criteria->remove(ListUnassignedPeer::DEL_INDEX), $comparison);
} else {
$criteria = $values->buildCriteria(); // gets full criteria
@@ -533,7 +533,7 @@ abstract class BaseListUnassignedPeer
}
$criteria->add(ListUnassignedPeer::APP_UID, $vals[0], Criteria::IN);
$criteria->add(ListUnassignedPeer::UNA_UID, $vals[1], Criteria::IN);
$criteria->add(ListUnassignedPeer::DEL_INDEX, $vals[1], Criteria::IN);
}
// Set the correct dbName
@@ -595,18 +595,18 @@ abstract class BaseListUnassignedPeer
/**
* Retrieve object using using composite pkey values.
* @param string $app_uid
* @param string $una_uid
* @param string $del_index
* @param Connection $con
* @return ListUnassigned
*/
public static function retrieveByPK($app_uid, $una_uid, $con = null)
public static function retrieveByPK($app_uid, $del_index, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$criteria = new Criteria();
$criteria->add(ListUnassignedPeer::APP_UID, $app_uid);
$criteria->add(ListUnassignedPeer::UNA_UID, $una_uid);
$criteria->add(ListUnassignedPeer::DEL_INDEX, $del_index);
$v = ListUnassignedPeer::doSelect($criteria, $con);
return !empty($v) ? $v[0] : null;

View File

@@ -237,6 +237,12 @@ abstract class BaseProcess extends BaseObject implements Persistent
*/
protected $pro_unit_cost = '';
/**
* The value for the pro_debug field.
* @var int
*/
protected $pro_itee = 1;
/**
* Flag to prevent endless save loop, if this object is referenced
* by another object which falls in this transaction.
@@ -678,6 +684,17 @@ abstract class BaseProcess extends BaseObject implements Persistent
return $this->pro_unit_cost;
}
/**
* Get the [pro_itee] column value.
*
* @return string
*/
public function getProItee()
{
return $this->pro_itee;
}
/**
* Set the value of [pro_uid] column.
*
@@ -1450,6 +1467,28 @@ abstract class BaseProcess extends BaseObject implements Persistent
} // setProUnitCost()
/**
* Set the value of [pro_itee] column.
*
* @param int $v new value
* @return void
*/
public function setProItee($v)
{
// Since the native PHP type for this column is integer,
// we will cast the input value to an int (if it is not).
if ($v !== null && !is_int($v) && is_numeric($v)) {
$v = (int) $v;
}
if ($this->pro_itee !== $v || $v === 1) {
$this->pro_itee = $v;
$this->modifiedColumns[] = ProcessPeer::PRO_ITEE;
}
} // setProItee()
/**
* Hydrates (populates) the object variables with values from the database resultset.
*
@@ -1537,12 +1576,14 @@ abstract class BaseProcess extends BaseObject implements Persistent
$this->pro_unit_cost = $rs->getString($startcol + 34);
$this->pro_itee = $rs->getString($startcol + 35);
$this->resetModified();
$this->setNew(false);
// FIXME - using NUM_COLUMNS may be clearer.
return $startcol + 35; // 35 = ProcessPeer::NUM_COLUMNS - ProcessPeer::NUM_LAZY_LOAD_COLUMNS).
return $startcol + 36; // 36 = ProcessPeer::NUM_COLUMNS - ProcessPeer::NUM_LAZY_LOAD_COLUMNS).
} catch (Exception $e) {
throw new PropelException("Error populating Process object", $e);
@@ -1851,6 +1892,9 @@ abstract class BaseProcess extends BaseObject implements Persistent
case 34:
return $this->getProUnitCost();
break;
case 35:
return $this->getProItee();
break;
default:
return null;
break;
@@ -1906,6 +1950,7 @@ abstract class BaseProcess extends BaseObject implements Persistent
$keys[32] => $this->getProDerivationScreenTpl(),
$keys[33] => $this->getProCost(),
$keys[34] => $this->getProUnitCost(),
$keys[35] => $this->getProItee(),
);
return $result;
}
@@ -2042,6 +2087,9 @@ abstract class BaseProcess extends BaseObject implements Persistent
case 34:
$this->setProUnitCost($value);
break;
case 35:
$this->setProItee($value);
break;
} // switch()
}
@@ -2205,6 +2253,10 @@ abstract class BaseProcess extends BaseObject implements Persistent
$this->setProUnitCost($arr[$keys[34]]);
}
if (array_key_exists($keys[35], $arr)) {
$this->setProItee($arr[$keys[35]]);
}
}
/**
@@ -2356,6 +2408,10 @@ abstract class BaseProcess extends BaseObject implements Persistent
$criteria->add(ProcessPeer::PRO_UNIT_COST, $this->pro_unit_cost);
}
if ($this->isColumnModified(ProcessPeer::PRO_ITEE)) {
$criteria->add(ProcessPeer::PRO_ITEE, $this->pro_itee);
}
return $criteria;
}
@@ -2478,6 +2534,8 @@ abstract class BaseProcess extends BaseObject implements Persistent
$copyObj->setProUnitCost($this->pro_unit_cost);
$copyObj->setProItee($this->pro_itee);
$copyObj->setNew(true);

View File

@@ -136,6 +136,9 @@ abstract class BaseProcessPeer
/** the column name for the PRO_UNIT_COST field */
const PRO_UNIT_COST = 'PROCESS.PRO_UNIT_COST';
/** the column name for the PRO_ITEE field */
const PRO_ITEE = 'PROCESS.PRO_ITEE';
/** The PHP to DB Name Mapping */
private static $phpNameMap = null;
@@ -147,10 +150,10 @@ abstract class BaseProcessPeer
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('ProUid', 'ProParent', 'ProTime', 'ProTimeunit', 'ProStatus', 'ProTypeDay', 'ProType', 'ProAssignment', 'ProShowMap', 'ProShowMessage', 'ProSubprocess', 'ProTriOpen', 'ProTriDeleted', 'ProTriCanceled', 'ProTriPaused', 'ProTriReassigned', 'ProTriUnpaused', 'ProTypeProcess', 'ProShowDelegate', 'ProShowDynaform', 'ProCategory', 'ProSubCategory', 'ProIndustry', 'ProUpdateDate', 'ProCreateDate', 'ProCreateUser', 'ProHeight', 'ProWidth', 'ProTitleX', 'ProTitleY', 'ProDebug', 'ProDynaforms', 'ProDerivationScreenTpl', 'ProCost', 'ProUnitCost', ),
BasePeer::TYPE_COLNAME => array (ProcessPeer::PRO_UID, ProcessPeer::PRO_PARENT, ProcessPeer::PRO_TIME, ProcessPeer::PRO_TIMEUNIT, ProcessPeer::PRO_STATUS, ProcessPeer::PRO_TYPE_DAY, ProcessPeer::PRO_TYPE, ProcessPeer::PRO_ASSIGNMENT, ProcessPeer::PRO_SHOW_MAP, ProcessPeer::PRO_SHOW_MESSAGE, ProcessPeer::PRO_SUBPROCESS, ProcessPeer::PRO_TRI_OPEN, ProcessPeer::PRO_TRI_DELETED, ProcessPeer::PRO_TRI_CANCELED, ProcessPeer::PRO_TRI_PAUSED, ProcessPeer::PRO_TRI_REASSIGNED, ProcessPeer::PRO_TRI_UNPAUSED, ProcessPeer::PRO_TYPE_PROCESS, ProcessPeer::PRO_SHOW_DELEGATE, ProcessPeer::PRO_SHOW_DYNAFORM, ProcessPeer::PRO_CATEGORY, ProcessPeer::PRO_SUB_CATEGORY, ProcessPeer::PRO_INDUSTRY, ProcessPeer::PRO_UPDATE_DATE, ProcessPeer::PRO_CREATE_DATE, ProcessPeer::PRO_CREATE_USER, ProcessPeer::PRO_HEIGHT, ProcessPeer::PRO_WIDTH, ProcessPeer::PRO_TITLE_X, ProcessPeer::PRO_TITLE_Y, ProcessPeer::PRO_DEBUG, ProcessPeer::PRO_DYNAFORMS, ProcessPeer::PRO_DERIVATION_SCREEN_TPL, ProcessPeer::PRO_COST, ProcessPeer::PRO_UNIT_COST, ),
BasePeer::TYPE_FIELDNAME => array ('PRO_UID', 'PRO_PARENT', 'PRO_TIME', 'PRO_TIMEUNIT', 'PRO_STATUS', 'PRO_TYPE_DAY', 'PRO_TYPE', 'PRO_ASSIGNMENT', 'PRO_SHOW_MAP', 'PRO_SHOW_MESSAGE', 'PRO_SUBPROCESS', 'PRO_TRI_OPEN', 'PRO_TRI_DELETED', 'PRO_TRI_CANCELED', 'PRO_TRI_PAUSED', 'PRO_TRI_REASSIGNED', 'PRO_TRI_UNPAUSED', 'PRO_TYPE_PROCESS', 'PRO_SHOW_DELEGATE', 'PRO_SHOW_DYNAFORM', 'PRO_CATEGORY', 'PRO_SUB_CATEGORY', 'PRO_INDUSTRY', 'PRO_UPDATE_DATE', 'PRO_CREATE_DATE', 'PRO_CREATE_USER', 'PRO_HEIGHT', 'PRO_WIDTH', 'PRO_TITLE_X', 'PRO_TITLE_Y', 'PRO_DEBUG', 'PRO_DYNAFORMS', 'PRO_DERIVATION_SCREEN_TPL', 'PRO_COST', 'PRO_UNIT_COST', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, )
BasePeer::TYPE_PHPNAME => array ('ProUid', 'ProParent', 'ProTime', 'ProTimeunit', 'ProStatus', 'ProTypeDay', 'ProType', 'ProAssignment', 'ProShowMap', 'ProShowMessage', 'ProSubprocess', 'ProTriOpen', 'ProTriDeleted', 'ProTriCanceled', 'ProTriPaused', 'ProTriReassigned', 'ProTriUnpaused', 'ProTypeProcess', 'ProShowDelegate', 'ProShowDynaform', 'ProCategory', 'ProSubCategory', 'ProIndustry', 'ProUpdateDate', 'ProCreateDate', 'ProCreateUser', 'ProHeight', 'ProWidth', 'ProTitleX', 'ProTitleY', 'ProDebug', 'ProDynaforms', 'ProDerivationScreenTpl', 'ProCost', 'ProUnitCost', 'ProItee', ),
BasePeer::TYPE_COLNAME => array (ProcessPeer::PRO_UID, ProcessPeer::PRO_PARENT, ProcessPeer::PRO_TIME, ProcessPeer::PRO_TIMEUNIT, ProcessPeer::PRO_STATUS, ProcessPeer::PRO_TYPE_DAY, ProcessPeer::PRO_TYPE, ProcessPeer::PRO_ASSIGNMENT, ProcessPeer::PRO_SHOW_MAP, ProcessPeer::PRO_SHOW_MESSAGE, ProcessPeer::PRO_SUBPROCESS, ProcessPeer::PRO_TRI_OPEN, ProcessPeer::PRO_TRI_DELETED, ProcessPeer::PRO_TRI_CANCELED, ProcessPeer::PRO_TRI_PAUSED, ProcessPeer::PRO_TRI_REASSIGNED, ProcessPeer::PRO_TRI_UNPAUSED, ProcessPeer::PRO_TYPE_PROCESS, ProcessPeer::PRO_SHOW_DELEGATE, ProcessPeer::PRO_SHOW_DYNAFORM, ProcessPeer::PRO_CATEGORY, ProcessPeer::PRO_SUB_CATEGORY, ProcessPeer::PRO_INDUSTRY, ProcessPeer::PRO_UPDATE_DATE, ProcessPeer::PRO_CREATE_DATE, ProcessPeer::PRO_CREATE_USER, ProcessPeer::PRO_HEIGHT, ProcessPeer::PRO_WIDTH, ProcessPeer::PRO_TITLE_X, ProcessPeer::PRO_TITLE_Y, ProcessPeer::PRO_DEBUG, ProcessPeer::PRO_DYNAFORMS, ProcessPeer::PRO_DERIVATION_SCREEN_TPL, ProcessPeer::PRO_COST, ProcessPeer::PRO_UNIT_COST, ProcessPeer::PRO_ITEE, ),
BasePeer::TYPE_FIELDNAME => array ('PRO_UID', 'PRO_PARENT', 'PRO_TIME', 'PRO_TIMEUNIT', 'PRO_STATUS', 'PRO_TYPE_DAY', 'PRO_TYPE', 'PRO_ASSIGNMENT', 'PRO_SHOW_MAP', 'PRO_SHOW_MESSAGE', 'PRO_SUBPROCESS', 'PRO_TRI_OPEN', 'PRO_TRI_DELETED', 'PRO_TRI_CANCELED', 'PRO_TRI_PAUSED', 'PRO_TRI_REASSIGNED', 'PRO_TRI_UNPAUSED', 'PRO_TYPE_PROCESS', 'PRO_SHOW_DELEGATE', 'PRO_SHOW_DYNAFORM', 'PRO_CATEGORY', 'PRO_SUB_CATEGORY', 'PRO_INDUSTRY', 'PRO_UPDATE_DATE', 'PRO_CREATE_DATE', 'PRO_CREATE_USER', 'PRO_HEIGHT', 'PRO_WIDTH', 'PRO_TITLE_X', 'PRO_TITLE_Y', 'PRO_DEBUG', 'PRO_DYNAFORMS', 'PRO_DERIVATION_SCREEN_TPL', 'PRO_COST', 'PRO_UNIT_COST', 'PRO_ITEE', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, )
);
/**
@@ -160,10 +163,10 @@ abstract class BaseProcessPeer
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('ProUid' => 0, 'ProParent' => 1, 'ProTime' => 2, 'ProTimeunit' => 3, 'ProStatus' => 4, 'ProTypeDay' => 5, 'ProType' => 6, 'ProAssignment' => 7, 'ProShowMap' => 8, 'ProShowMessage' => 9, 'ProSubprocess' => 10, 'ProTriOpen' => 11, 'ProTriDeleted' => 12, 'ProTriCanceled' => 13, 'ProTriPaused' => 14, 'ProTriReassigned' => 15, 'ProTriUnpaused' => 16, 'ProTypeProcess' => 17, 'ProShowDelegate' => 18, 'ProShowDynaform' => 19, 'ProCategory' => 20, 'ProSubCategory' => 21, 'ProIndustry' => 22, 'ProUpdateDate' => 23, 'ProCreateDate' => 24, 'ProCreateUser' => 25, 'ProHeight' => 26, 'ProWidth' => 27, 'ProTitleX' => 28, 'ProTitleY' => 29, 'ProDebug' => 30, 'ProDynaforms' => 31, 'ProDerivationScreenTpl' => 32, 'ProCost' => 33, 'ProUnitCost' => 34, ),
BasePeer::TYPE_COLNAME => array (ProcessPeer::PRO_UID => 0, ProcessPeer::PRO_PARENT => 1, ProcessPeer::PRO_TIME => 2, ProcessPeer::PRO_TIMEUNIT => 3, ProcessPeer::PRO_STATUS => 4, ProcessPeer::PRO_TYPE_DAY => 5, ProcessPeer::PRO_TYPE => 6, ProcessPeer::PRO_ASSIGNMENT => 7, ProcessPeer::PRO_SHOW_MAP => 8, ProcessPeer::PRO_SHOW_MESSAGE => 9, ProcessPeer::PRO_SUBPROCESS => 10, ProcessPeer::PRO_TRI_OPEN => 11, ProcessPeer::PRO_TRI_DELETED => 12, ProcessPeer::PRO_TRI_CANCELED => 13, ProcessPeer::PRO_TRI_PAUSED => 14, ProcessPeer::PRO_TRI_REASSIGNED => 15, ProcessPeer::PRO_TRI_UNPAUSED => 16, ProcessPeer::PRO_TYPE_PROCESS => 17, ProcessPeer::PRO_SHOW_DELEGATE => 18, ProcessPeer::PRO_SHOW_DYNAFORM => 19, ProcessPeer::PRO_CATEGORY => 20, ProcessPeer::PRO_SUB_CATEGORY => 21, ProcessPeer::PRO_INDUSTRY => 22, ProcessPeer::PRO_UPDATE_DATE => 23, ProcessPeer::PRO_CREATE_DATE => 24, ProcessPeer::PRO_CREATE_USER => 25, ProcessPeer::PRO_HEIGHT => 26, ProcessPeer::PRO_WIDTH => 27, ProcessPeer::PRO_TITLE_X => 28, ProcessPeer::PRO_TITLE_Y => 29, ProcessPeer::PRO_DEBUG => 30, ProcessPeer::PRO_DYNAFORMS => 31, ProcessPeer::PRO_DERIVATION_SCREEN_TPL => 32, ProcessPeer::PRO_COST => 33, ProcessPeer::PRO_UNIT_COST => 34, ),
BasePeer::TYPE_FIELDNAME => array ('PRO_UID' => 0, 'PRO_PARENT' => 1, 'PRO_TIME' => 2, 'PRO_TIMEUNIT' => 3, 'PRO_STATUS' => 4, 'PRO_TYPE_DAY' => 5, 'PRO_TYPE' => 6, 'PRO_ASSIGNMENT' => 7, 'PRO_SHOW_MAP' => 8, 'PRO_SHOW_MESSAGE' => 9, 'PRO_SUBPROCESS' => 10, 'PRO_TRI_OPEN' => 11, 'PRO_TRI_DELETED' => 12, 'PRO_TRI_CANCELED' => 13, 'PRO_TRI_PAUSED' => 14, 'PRO_TRI_REASSIGNED' => 15, 'PRO_TRI_UNPAUSED' => 16, 'PRO_TYPE_PROCESS' => 17, 'PRO_SHOW_DELEGATE' => 18, 'PRO_SHOW_DYNAFORM' => 19, 'PRO_CATEGORY' => 20, 'PRO_SUB_CATEGORY' => 21, 'PRO_INDUSTRY' => 22, 'PRO_UPDATE_DATE' => 23, 'PRO_CREATE_DATE' => 24, 'PRO_CREATE_USER' => 25, 'PRO_HEIGHT' => 26, 'PRO_WIDTH' => 27, 'PRO_TITLE_X' => 28, 'PRO_TITLE_Y' => 29, 'PRO_DEBUG' => 30, 'PRO_DYNAFORMS' => 31, 'PRO_DERIVATION_SCREEN_TPL' => 32, 'PRO_COST' => 33, 'PRO_UNIT_COST' => 34, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, )
BasePeer::TYPE_PHPNAME => array ('ProUid' => 0, 'ProParent' => 1, 'ProTime' => 2, 'ProTimeunit' => 3, 'ProStatus' => 4, 'ProTypeDay' => 5, 'ProType' => 6, 'ProAssignment' => 7, 'ProShowMap' => 8, 'ProShowMessage' => 9, 'ProSubprocess' => 10, 'ProTriOpen' => 11, 'ProTriDeleted' => 12, 'ProTriCanceled' => 13, 'ProTriPaused' => 14, 'ProTriReassigned' => 15, 'ProTriUnpaused' => 16, 'ProTypeProcess' => 17, 'ProShowDelegate' => 18, 'ProShowDynaform' => 19, 'ProCategory' => 20, 'ProSubCategory' => 21, 'ProIndustry' => 22, 'ProUpdateDate' => 23, 'ProCreateDate' => 24, 'ProCreateUser' => 25, 'ProHeight' => 26, 'ProWidth' => 27, 'ProTitleX' => 28, 'ProTitleY' => 29, 'ProDebug' => 30, 'ProDynaforms' => 31, 'ProDerivationScreenTpl' => 32, 'ProCost' => 33, 'ProUnitCost' => 34, 'ProItee' => 35, ),
BasePeer::TYPE_COLNAME => array (ProcessPeer::PRO_UID => 0, ProcessPeer::PRO_PARENT => 1, ProcessPeer::PRO_TIME => 2, ProcessPeer::PRO_TIMEUNIT => 3, ProcessPeer::PRO_STATUS => 4, ProcessPeer::PRO_TYPE_DAY => 5, ProcessPeer::PRO_TYPE => 6, ProcessPeer::PRO_ASSIGNMENT => 7, ProcessPeer::PRO_SHOW_MAP => 8, ProcessPeer::PRO_SHOW_MESSAGE => 9, ProcessPeer::PRO_SUBPROCESS => 10, ProcessPeer::PRO_TRI_OPEN => 11, ProcessPeer::PRO_TRI_DELETED => 12, ProcessPeer::PRO_TRI_CANCELED => 13, ProcessPeer::PRO_TRI_PAUSED => 14, ProcessPeer::PRO_TRI_REASSIGNED => 15, ProcessPeer::PRO_TRI_UNPAUSED => 16, ProcessPeer::PRO_TYPE_PROCESS => 17, ProcessPeer::PRO_SHOW_DELEGATE => 18, ProcessPeer::PRO_SHOW_DYNAFORM => 19, ProcessPeer::PRO_CATEGORY => 20, ProcessPeer::PRO_SUB_CATEGORY => 21, ProcessPeer::PRO_INDUSTRY => 22, ProcessPeer::PRO_UPDATE_DATE => 23, ProcessPeer::PRO_CREATE_DATE => 24, ProcessPeer::PRO_CREATE_USER => 25, ProcessPeer::PRO_HEIGHT => 26, ProcessPeer::PRO_WIDTH => 27, ProcessPeer::PRO_TITLE_X => 28, ProcessPeer::PRO_TITLE_Y => 29, ProcessPeer::PRO_DEBUG => 30, ProcessPeer::PRO_DYNAFORMS => 31, ProcessPeer::PRO_DERIVATION_SCREEN_TPL => 32, ProcessPeer::PRO_COST => 33, ProcessPeer::PRO_UNIT_COST => 34, ProcessPeer::PRO_ITEE => 35, ),
BasePeer::TYPE_FIELDNAME => array ('PRO_UID' => 0, 'PRO_PARENT' => 1, 'PRO_TIME' => 2, 'PRO_TIMEUNIT' => 3, 'PRO_STATUS' => 4, 'PRO_TYPE_DAY' => 5, 'PRO_TYPE' => 6, 'PRO_ASSIGNMENT' => 7, 'PRO_SHOW_MAP' => 8, 'PRO_SHOW_MESSAGE' => 9, 'PRO_SUBPROCESS' => 10, 'PRO_TRI_OPEN' => 11, 'PRO_TRI_DELETED' => 12, 'PRO_TRI_CANCELED' => 13, 'PRO_TRI_PAUSED' => 14, 'PRO_TRI_REASSIGNED' => 15, 'PRO_TRI_UNPAUSED' => 16, 'PRO_TYPE_PROCESS' => 17, 'PRO_SHOW_DELEGATE' => 18, 'PRO_SHOW_DYNAFORM' => 19, 'PRO_CATEGORY' => 20, 'PRO_SUB_CATEGORY' => 21, 'PRO_INDUSTRY' => 22, 'PRO_UPDATE_DATE' => 23, 'PRO_CREATE_DATE' => 24, 'PRO_CREATE_USER' => 25, 'PRO_HEIGHT' => 26, 'PRO_WIDTH' => 27, 'PRO_TITLE_X' => 28, 'PRO_TITLE_Y' => 29, 'PRO_DEBUG' => 30, 'PRO_DYNAFORMS' => 31, 'PRO_DERIVATION_SCREEN_TPL' => 32, 'PRO_COST' => 33, 'PRO_UNIT_COST' => 34, 'PRO_ITEE' => 35, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, )
);
/**
@@ -334,6 +337,8 @@ abstract class BaseProcessPeer
$criteria->addSelectColumn(ProcessPeer::PRO_UNIT_COST);
$criteria->addSelectColumn(ProcessPeer::PRO_ITEE);
}
const COUNT = 'COUNT(PROCESS.PRO_UID)';

View File

@@ -1,6 +1,15 @@
;The separator parameter is |
;Setting statements - Statements can not allowed in the execution, example queries="INSERT|UPDATE|REPLACE|DELETE"
;;;;;ExecuteQuery Blacklist Configuration File;;;;;
;The statement delimiter is "|"
;;;;;Statements Settings;;;;;
;The following are statements that are not allowed to be executed
;example: queries="INSERT|UPDATE|REPLACE|DELETE"
queries = "INSERT|UPDATE|REPLACE|DELETE"
;Setting tables - Tables that can not apply sentences, pmtables="PMTABLE1|PMTABLE2"
;;;;;Tables Settings;;;;;
;The following tables are restricted to be executed along with the statements defined previously.
;example: pmtables="PMTABLE1|PMTABLE2"
pmtables = ""

View File

@@ -904,6 +904,7 @@
<column name="PRO_DERIVATION_SCREEN_TPL" type="VARCHAR" size="128" default="" required="false"/>
<column name="PRO_COST" type="DECIMAL" size="7,2" required="false" default="0"/>
<column name="PRO_UNIT_COST" type="VARCHAR" size="50" required="false" default=""/>
<column name="PRO_ITEE" type="INTEGER" required="true" default="0"/>
<validator column="PRO_TIMEUNIT">
<rule name="validValues" value="WEEKS|MONTHS|DAYS|HOURS|MINUTES" message="Please select a valid Time Unit."/>
</validator>
@@ -1298,7 +1299,7 @@
</index>
<validator column="TAS_TYPE">
<rule name="validValues" value="NORMAL|ADHOC|SUBPROCESS|HIDDEN|GATEWAYTOGATEWAY|WEBENTRYEVENT|END-MESSAGE-EVENT|START-MESSAGE-EVENT|INTERMEDIATE-THROW-MESSAGE-EVENT|INTERMEDIATE-CATCH-MESSAGE-EVENT|SCRIPT-TASK|START-TIMER-EVENT|INTERMEDIATE-CATCH-TIMER-EVENT|END-EMAIL-EVENT" message="Please set a valid value for TAS_TYPE" />
<rule name="validValues" value="NORMAL|ADHOC|SUBPROCESS|HIDDEN|GATEWAYTOGATEWAY|WEBENTRYEVENT|END-MESSAGE-EVENT|START-MESSAGE-EVENT|INTERMEDIATE-THROW-MESSAGE-EVENT|INTERMEDIATE-CATCH-MESSAGE-EVENT|SCRIPT-TASK|START-TIMER-EVENT|INTERMEDIATE-CATCH-TIMER-EVENT|END-EMAIL-EVENT|INTERMEDIATE-THROW-EMAIL-EVENT" message="Please set a valid value for TAS_TYPE" />
</validator>
<validator column="TAS_TIMEUNIT">
<rule name="validValues" value="MINUTES|HOURS|DAYS|WEEKS|MONTHS" message="Please select a valid value for TAS_TIMEUNIT."/>
@@ -4405,17 +4406,17 @@
<parameter name="Comment" value="Unassiged list"/>
</vendor>
<column name="APP_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default=""/>
<column name="UNA_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default=""/>
<column name="DEL_INDEX" type="INTEGER" required="true" primaryKey="true" default="0"/>
<column name="TAS_UID" type="VARCHAR" size="32" required="true" default=""/>
<column name="PRO_UID" type="VARCHAR" size="32" required="true" default=""/>
<column name="APP_NUMBER" type="INTEGER" required="true" default="0"/>
<column name="APP_TITLE" type="VARCHAR" size="255" required="true" default=""/>
<column name="APP_PRO_TITLE" type="VARCHAR" size="255" required="true" default=""/>
<column name="APP_TAS_TITLE" type="VARCHAR" size="255" required="true" default=""/>
<column name="APP_PREVIOUS_USR_USERNAME" type="VARCHAR" size="100" default=""/>
<column name="APP_PREVIOUS_USR_FIRSTNAME" type="VARCHAR" size="50" default=""/>
<column name="APP_PREVIOUS_USR_LASTNAME" type="VARCHAR" size="50" default=""/>
<column name="DEL_INDEX" type="INTEGER" required="true" default="0"/>
<column name="DEL_PREVIOUS_USR_USERNAME" type="VARCHAR" size="100" default=""/>
<column name="DEL_PREVIOUS_USR_FIRSTNAME" type="VARCHAR" size="50" default=""/>
<column name="DEL_PREVIOUS_USR_LASTNAME" type="VARCHAR" size="50" default=""/>
<column name="APP_UPDATE_DATE" type="TIMESTAMP" required="true"/>
<column name="DEL_PREVIOUS_USR_UID" type="VARCHAR" size="32" default=""/>
<column name="DEL_DELEGATE_DATE" type="TIMESTAMP" required="true"/>
<column name="DEL_DUE_DATE" type="TIMESTAMP" required="false"/>

File diff suppressed because one or more lines are too long

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ProcessMaker (Branch 3.1)\n"
"POT-Creation-Date: \n"
"PO-Revision-Date: 2016-07-05 12:03:37\n"
"PO-Revision-Date: 2016-07-11 20:25:46\n"
"Last-Translator: \n"
"Language-Team: Colosa Developers Team <developers@colosa.com>\n"
"MIME-Version: 1.0\n"
@@ -3814,8 +3814,8 @@ msgstr "Process Supervisor"
# TRANSLATION
# LABEL/ID_SENT
#: LABEL/ID_SENT
msgid "[LABEL/ID_SENT] Sent"
msgstr "Sent"
msgid "Participated"
msgstr "Participated"
# TRANSLATION
# LABEL/ID_CALENDAR
@@ -4918,7 +4918,7 @@ msgstr "Draft"
# TRANSLATION
# LABEL/ID_TITLE_PARTICIPATED
#: LABEL/ID_TITLE_PARTICIPATED
msgid "Participated"
msgid "[LABEL/ID_TITLE_PARTICIPATED] Participated"
msgstr "Participated"
# TRANSLATION
@@ -27461,6 +27461,48 @@ msgstr "The email event definition does not exist."
msgid "The user can't be deleted because it is referenced in the process {processTitle} in a process permission."
msgstr "The user can't be deleted because it is referenced in the process {processTitle} in a process permission."
# TRANSLATION
# LABEL/ID_USER_NOT_IT_BELONGS_CASE_OR_NOT_SUPERVISOR
#: LABEL/ID_USER_NOT_IT_BELONGS_CASE_OR_NOT_SUPERVISOR
msgid "The user does not belong to case or user not is supervisor"
msgstr "The user does not belong to case or user not is supervisor"
# TRANSLATION
# LABEL/ID_USER_IS_SUPERVISOR_DOES_NOT_ASSOCIATED_INPUT_DOCUMENT
#: LABEL/ID_USER_IS_SUPERVISOR_DOES_NOT_ASSOCIATED_INPUT_DOCUMENT
msgid "The user is supervisor, but it does not have an associated input document"
msgstr "The user is supervisor, but it does not have an associated input document"
# TRANSLATION
# LABEL/ID_MAFE_c5bcf625cbb751aba886be634ef4ef47
#: LABEL/ID_MAFE_c5bcf625cbb751aba886be634ef4ef47
msgid "Invalid Connection between elements"
msgstr "Invalid Connection between elements"
# TRANSLATION
# LABEL/ID_MAFE_815b565aff7fbfe8db5eb2573677e9a4
#: LABEL/ID_MAFE_815b565aff7fbfe8db5eb2573677e9a4
msgid "SubProcess must have an incoming sequence flow"
msgstr "SubProcess must have an incoming sequence flow"
# TRANSLATION
# LABEL/ID_MAFE_85cc96b9ef52490be95df14539d47a39
#: LABEL/ID_MAFE_85cc96b9ef52490be95df14539d47a39
msgid "SubProcess must have an outgoing sequence flow"
msgstr "SubProcess must have an outgoing sequence flow"
# TRANSLATION
# LABEL/ID_MAFE_fbd86a8fe4703e24aff466cbe75facd6
#: LABEL/ID_MAFE_fbd86a8fe4703e24aff466cbe75facd6
msgid "This is a Message of Error"
msgstr "This is a Message of Error"
# TRANSLATION
# LABEL/ID_MAFE_ec6f1a89963c5b95d783e0c260fc959a
#: LABEL/ID_MAFE_ec6f1a89963c5b95d783e0c260fc959a
msgid "Can't connect start event to subprocess"
msgstr "Can't connect start event to subprocess"
# additionalTables/additionalTablesData.xml?ADD_TAB_NAME
# additionalTables/additionalTablesData.xml
#: text - ADD_TAB_NAME

View File

@@ -727,7 +727,7 @@ class Installer extends Controller
$rb_workpace = $wf;
$rp_workpace = $wf;
if (!$userLogged) {
$wfPass = G::generate_password( 12 );
$wfPass = G::generate_password( 15 );
$this->setGrantPrivilegesMySQL( $wf, $wfPass, $wf, $db_hostname );
$this->setGrantPrivilegesMySQL( $rb, $wfPass, $wf, $db_hostname );
$this->setGrantPrivilegesMySQL( $rp, $wfPass, $wf, $db_hostname );
@@ -1064,7 +1064,7 @@ class Installer extends Controller
$this->mssqlQuery( $q );
//CREATE users and GRANT Privileges
$wfPass = G::generate_password( 12 );
$wfPass = G::generate_password( 15 );
$this->setGrantPrivilegesMSSQL( $wf, $wfPass, $wf );
//Generate the db.php file and folders

View File

@@ -770,7 +770,10 @@ class pmTablesProxy extends HttpProxyController
$fileContent = file_get_contents( $PUBLIC_ROOT_PATH . $filename );
if (strpos( $fileContent, '-----== ProcessMaker Open Source Private Tables ==-----' ) === false) {
throw new Exception( G::loadTranslation( 'ID_PMTABLE_INVALID_FILE' ) );
$result->success = false;
$result->errorType = 'notice';
$result->message = G::loadTranslation( 'ID_PMTABLE_INVALID_FILE', array ($filename));
return $result;
}
$currentProUid = '';

View File

@@ -61452,6 +61452,8 @@ INSERT INTO DASHLET_INSTANCE (DAS_INS_UID,DAS_UID,DAS_INS_OWNER_TYPE,DAS_INS_OWN
INSERT INTO CONFIGURATION (CFG_UID,OBJ_UID,CFG_VALUE,PRO_UID,USR_UID,APP_UID) VALUES
('ENVIRONMENT_SETTINGS','','a:1:{s:18:"directoryStructure";i:2;}','','','');
('MIGRATED_LIST','list','true','list','list','list');
('MIGRATED_LIST_UNASSIGNED','list','true','list','list','list');
INSERT INTO CATALOG (CAT_UID, CAT_LABEL_ID, CAT_TYPE, CAT_FLAG, CAT_OBSERVATION, CAT_CREATE_DATE, CAT_UPDATE_DATE) VALUES
('10','ID_BARS','GRAPHIC','','','2015-03-04','2015-03-04'),

View File

@@ -452,6 +452,7 @@ CREATE TABLE `PROCESS`
`PRO_DERIVATION_SCREEN_TPL` VARCHAR(128) default '',
`PRO_COST` DECIMAL(7,2) default 0,
`PRO_UNIT_COST` VARCHAR(50) default '',
`PRO_ITEE` INTEGER default 0 NOT NULL,
PRIMARY KEY (`PRO_UID`)
)ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='Store process Information';
#-----------------------------------------------------------------------------
@@ -2490,17 +2491,17 @@ DROP TABLE IF EXISTS `LIST_UNASSIGNED`;
CREATE TABLE `LIST_UNASSIGNED`
(
`APP_UID` VARCHAR(32) default '' NOT NULL,
`UNA_UID` VARCHAR(32) default '' NOT NULL,
`DEL_INDEX` INTEGER default 0 NOT NULL,
`TAS_UID` VARCHAR(32) default '' NOT NULL,
`PRO_UID` VARCHAR(32) default '' NOT NULL,
`APP_NUMBER` INTEGER default 0 NOT NULL,
`APP_TITLE` VARCHAR(255) default '' NOT NULL,
`APP_PRO_TITLE` VARCHAR(255) default '' NOT NULL,
`APP_TAS_TITLE` VARCHAR(255) default '' NOT NULL,
`APP_PREVIOUS_USR_USERNAME` VARCHAR(100) default '',
`APP_PREVIOUS_USR_FIRSTNAME` VARCHAR(50) default '',
`APP_PREVIOUS_USR_LASTNAME` VARCHAR(50) default '',
`DEL_INDEX` INTEGER default 0 NOT NULL,
`DEL_PREVIOUS_USR_USERNAME` VARCHAR(100) default '',
`DEL_PREVIOUS_USR_FIRSTNAME` VARCHAR(50) default '',
`DEL_PREVIOUS_USR_LASTNAME` VARCHAR(50) default '',
`APP_UPDATE_DATE` DATETIME NOT NULL,
`DEL_PREVIOUS_USR_UID` VARCHAR(32) default '',
`DEL_DELEGATE_DATE` DATETIME NOT NULL,
`DEL_DUE_DATE` DATETIME,

View File

@@ -44,8 +44,7 @@ switch ($action) {
$urlProxy .= '?list=myInbox';
break;
case 'unassigned':
$urlProxy = 'proxyCasesList';
$action = 'unassigned';
$urlProxy .= '?list=unassigned';
break;
case 'to_revise':
$urlProxy = 'proxyCasesList';
@@ -58,10 +57,6 @@ switch ($action) {
G::LoadClass("BasePeer");
G::LoadClass("configuration");
//require_once ("classes/model/Fields.php");
//require_once ("classes/model/AppCacheView.php");
//require_once ("classes/model/Process.php");
//require_once ("classes/model/Users.php");
$oHeadPublisher = & headPublisher::getSingleton();
// oHeadPublisher->setExtSkin( 'xtheme-blue');
@@ -109,7 +104,7 @@ if (isset( $generalConfCasesList['casesListDateFormat'] ) && ! empty( $generalCo
$dateFormat = $config['dateformat'];
}
if ($action == 'draft' /* && $action == 'cancelled' */) {
if ($action == 'draft') {
//array_unshift ( $columns, array( 'header'=> '', 'width'=> 50, 'sortable'=> false, 'id'=> 'deleteLink' ) );
}
if ($action == 'selfservice') {
@@ -119,14 +114,6 @@ if ($action == 'selfservice') {
if ($action == 'paused') {
//array_unshift ( $columns, array( 'header'=> '', 'width'=> 50, 'sortable'=> false, 'id'=> 'unpauseLink' ) );
}
/*
if ( $action == 'to_reassign' ) {
array_unshift ( $columns, array( 'header'=> '', 'width'=> 50, 'sortable'=> false, 'id'=> 'reassignLink' ) );
}
*/
// if ( $action == 'cancelled' ) {
// array_unshift ( $columns, array( 'header'=> '', 'width'=> 50, 'sortable'=> false, 'id'=> 'reactivateLink' ) );
// }
$userUid = (isset( $_SESSION['USER_LOGGED'] ) && $_SESSION['USER_LOGGED'] != '') ? $_SESSION['USER_LOGGED'] : null;
$oAppCache = new AppCacheView();
@@ -201,19 +188,12 @@ if ($licensedFeatures->verifyfeature('r19Vm5DK1UrT09MenlLYjZxejlhNUZ1b1NhV0JHWjB
/*----------------------------------********---------------------------------*/
//menu permissions
/*$c = new Criteria('workflow');
$c->clearSelectColumns();
$c->addSelectColumn( AppThreadPeer::APP_THREAD_PARENT );
$c->add(AppThreadPeer::APP_UID, $APP_UID );
$c->add(AppThreadPeer::APP_THREAD_STATUS , 'OPEN' );
$cnt = AppThreadPeer::doCount($c);*/
$cnt = '';
$menuPerms = '';
$menuPerms = $menuPerms . ($RBAC->userCanAccess( 'PM_REASSIGNCASE' ) == 1) ? 'R' : ''; //can reassign case
$oHeadPublisher->assign( '___p34315105', $menuPerms ); // user menu permissions
G::LoadClass( 'configuration' );
$c = new Configurations();
//$oHeadPublisher->addExtJsScript('cases/caseUtils', true);
$oHeadPublisher->addExtJsScript( 'app/main', true );
$oHeadPublisher->addExtJsScript( 'cases/casesList', false ); //adding a javascript file .js
$oHeadPublisher->addContent( 'cases/casesListExtJs' ); //adding a html file .html.

View File

@@ -12,6 +12,11 @@ switch ($action) {
case 'getProcess':
getProcess();
break;
/*----------------------------------********---------------------------------*/
case 'getAllCountersEnterprise':
getAllCountersEnterprise();
break;
/*----------------------------------********---------------------------------*/
default: //this is the starting call
getLoadTreeMenuData();
break;
@@ -271,6 +276,20 @@ function getProcess ()
echo G::json_encode( $response );
}
/*----------------------------------********---------------------------------*/
function getAllCountersEnterprise()
{
try {
$userUid = (isset($_SESSION['USER_LOGGED']) && $_SESSION['USER_LOGGED'] != '') ? $_SESSION['USER_LOGGED'] : null;
$lists = new \ProcessMaker\BusinessModel\Lists();
$response = $lists->getCounters($userUid);
echo G::json_encode($response);
} catch (\Exception $e) {
throw (new Exception($e->getMessage()));
}
}
/*----------------------------------********---------------------------------*/
function getAllCounters ()
{
$userUid = (isset( $_SESSION['USER_LOGGED'] ) && $_SESSION['USER_LOGGED'] != '') ? $_SESSION['USER_LOGGED'] : null;

View File

@@ -65,7 +65,7 @@ try {
$oCurUser->load( $aAppDel['USR_UID'] );
$Fields['PREVIOUS_USER'] = $oCurUser->getUsrFirstname() . ' ' . $oCurUser->getUsrLastname();
} catch (Exception $oError) {
$Fields['PREVIOUS_USER'] = '';
$Fields['PREVIOUS_USER'] = G::LoadTranslation( 'ID_NO_PREVIOUS_USR_UID' );
}
$objTask = new Task();

View File

@@ -964,6 +964,9 @@ try {
case "INTERMEDIATE-CATCH-TIMER-EVENT":
$aFields["TASK"][$sKey]["NEXT_TASK"]["USR_UID"] = G::LoadTranslation("ID_ROUTE_TO_TASK_INTERMEDIATE_CATCH_TIMER_EVENT");
break;
case "INTERMEDIATE-THROW-EMAIL-EVENT":
$aFields["TASK"][$sKey]["NEXT_TASK"]["TAS_TITLE"] = G::LoadTranslation("ID_ROUTE_TO_TASK_INTERMEDIATE-THROW-EMAIL-EVENT");
break;
}
$hiddenName = 'form[TASKS][' . $sKey . ']';

View File

@@ -124,53 +124,19 @@ if ($oServerConf->isRtl( SYS_LANG )) {
$urlProxy = 'casesMenuLoader?action=getAllCounters&r=';
/*----------------------------------********---------------------------------*/
$urlProxy = System::getHttpServerHostnameRequestsFrontEnd() . '/api/1.0/' . SYS_SYS . '/system/counters-lists?r=';
$clientId = 'x-pm-local-client';
$client = getClientCredentials($clientId);
$authCode = getAuthorizationCode($client);
$debug = false; //System::isDebugMode();
$loader = Maveriks\Util\ClassLoader::getInstance();
$loader->add(PATH_TRUNK . 'vendor/bshaffer/oauth2-server-php/src/', "OAuth2");
$request = array(
'grant_type' => 'authorization_code',
'code' => $authCode
);
$server = array(
'REQUEST_METHOD' => 'POST'
);
$headers = array(
"PHP_AUTH_USER" => $client['CLIENT_ID'],
"PHP_AUTH_PW" => $client['CLIENT_SECRET'],
"Content-Type" => "multipart/form-data;",
"Authorization" => "Basic " . base64_encode($client['CLIENT_ID'] . ":" . $client['CLIENT_SECRET'])
);
$request = new \OAuth2\Request(array(), $request, array(), array(), array(), $server, null, $headers);
$oauthServer = new \ProcessMaker\Services\OAuth2\Server();
$response = $oauthServer->postToken($request, true);
$clientToken = $response->getParameters();
$clientToken["client_id"] = $client['CLIENT_ID'];
$clientToken["client_secret"] = $client['CLIENT_SECRET'];
$urlProxy = 'casesMenuLoader?action=getAllCountersEnterprise&r=';
/*----------------------------------********---------------------------------*/
$oHeadPublisher->assign( 'regionTreePanel', $regionTreePanel );
$oHeadPublisher->assign( 'regionDebug', $regionDebug );
$oHeadPublisher->assign( "defaultOption", $defaultOption ); //User menu permissions
$oHeadPublisher->assign( 'urlProxy', $urlProxy ); //sending the urlProxy to make
/*----------------------------------********---------------------------------*/
$oHeadPublisher->assign( 'credentials', $clientToken );
/*----------------------------------********---------------------------------*/
$oHeadPublisher->assign( "_nodeId", isset( $confDefaultOption ) ? $confDefaultOption : "PM_USERS" ); //User menu permissions
$oHeadPublisher->assign( "FORMATS", $conf->getFormats() );
$oHeadPublisher->assign('regionTreePanel', $regionTreePanel);
$oHeadPublisher->assign('regionDebug', $regionDebug);
$oHeadPublisher->assign("defaultOption", $defaultOption); //User menu permissions
$oHeadPublisher->assign('urlProxy', $urlProxy); //sending the urlProxy to make
$oHeadPublisher->assign("_nodeId", isset($confDefaultOption) ? $confDefaultOption : "PM_USERS"); //User menu permissions
$oHeadPublisher->assign("FORMATS", $conf->getFormats());
$_SESSION["current_ux"] = "NORMAL";
G::RenderPage( "publish", "extJs" );
G::RenderPage("publish", "extJs");
/*----------------------------------********---------------------------------*/
function getClientCredentials($clientId)

View File

@@ -96,6 +96,13 @@ try {
}
$res = $tar->extract($path);
//Verify if not is Enterprise Plugin
if (!$oPluginRegistry->isEnterprisePlugin($sClassName, $path)) {
throw new Exception(G::LoadTranslation('ID_EEPLUGIN_IMPORT_PLUGIN_NOT_IS_ENTERPRISE', [$filename]));
}
//Get contents of plugin file
$sContent = file_get_contents($path . $pluginFile);
$sContent = str_ireplace($sAux, $sAux . '_', $sContent);
$sContent = str_ireplace('PATH_PLUGINS', "'".$path."'", $sContent);

View File

@@ -55,45 +55,55 @@ if (isset( $_FILES ) && $_FILES["ATTACH_FILE"]["error"] == 0) {
$oAppDocument = new AppDocument();
if (isset( $_POST["APP_DOC_UID"] ) && trim( $_POST["APP_DOC_UID"] ) != "") {
if (isset($_POST["APP_DOC_UID"]) && trim($_POST["APP_DOC_UID"]) != "") {
//Update
echo "[update]";
$aFields["APP_DOC_UID"] = $_POST["APP_DOC_UID"];
$aFields["DOC_VERSION"] = $_POST["DOC_VERSION"];
$aFields["APP_DOC_FILENAME"] = $_FILES["ATTACH_FILE"]["name"];
if (isset( $_POST["APPLICATION"] )) {
if (isset($_POST["APPLICATION"])) {
$aFields["APP_UID"] = $_POST["APPLICATION"];
}
if (isset( $_POST["INDEX"] )) {
if (isset($_POST["INDEX"])) {
$aFields["DEL_INDEX"] = $_POST["INDEX"];
}
if (isset( $_POST["USR_UID"] )) {
if (isset($_POST["USR_UID"])) {
$aFields["USR_UID"] = $_POST["USR_UID"];
}
if (isset( $_POST["DOC_UID"] )) {
if (isset($_POST["DOC_UID"])) {
$aFields["DOC_UID"] = $_POST["DOC_UID"];
}
if (isset( $_POST["APP_DOC_TYPE"] )) {
if (isset($_POST["APP_DOC_TYPE"])) {
$aFields["APP_DOC_TYPE"] = $_POST["APP_DOC_TYPE"];
}
$aFields["APP_DOC_CREATE_DATE"] = date( "Y-m-d H:i:s" );
$aFields["APP_DOC_COMMENT"] = (isset( $_POST["COMMENT"] )) ? $_POST["COMMENT"] : "";
$aFields["APP_DOC_TITLE"] = (isset( $_POST["TITLE"] )) ? $_POST["TITLE"] : "";
$aFields["APP_DOC_CREATE_DATE"] = date("Y-m-d H:i:s");
$aFields["APP_DOC_COMMENT"] = (isset($_POST["COMMENT"])) ? $_POST["COMMENT"] : "";
$aFields["APP_DOC_TITLE"] = (isset($_POST["TITLE"])) ? $_POST["TITLE"] : "";
//$aFields["FOLDER_UID"] = $folderId,
//$aFields["APP_DOC_TAGS"] = $fileTags
$aFields["APP_DOC_FIELDNAME"] = $_POST["APP_DOC_FIELDNAME"];
} else {
//New record
$aFields = array ("APP_UID" => $_POST["APPLICATION"],"DEL_INDEX" => $_POST["INDEX"],"USR_UID" => $_POST["USR_UID"],"DOC_UID" => $_POST["DOC_UID"],"APP_DOC_TYPE" => $_POST["APP_DOC_TYPE"],"APP_DOC_CREATE_DATE" => date( "Y-m-d H:i:s" ),"APP_DOC_COMMENT" => (isset( $_POST["COMMENT"] )) ? $_POST["COMMENT"] : "","APP_DOC_TITLE" => (isset( $_POST["TITLE"] )) ? $_POST["TITLE"] : "","APP_DOC_FILENAME" => (isset( $_FILES["ATTACH_FILE"]["name"] )) ? $_FILES["ATTACH_FILE"]["name"] : "","FOLDER_UID" => $folderId,"APP_DOC_TAGS" => $fileTags,"APP_DOC_FIELDNAME" => (isset($_POST["APP_DOC_FIELDNAME"])) ? $_POST["APP_DOC_FIELDNAME"] : ( (isset( $_FILES["ATTACH_FILE"]["name"] )) ? $_FILES["ATTACH_FILE"]["name"] : "")
$aFields = array(
"APP_UID" => $_POST["APPLICATION"],
"DEL_INDEX" => $_POST["INDEX"],
"USR_UID" => $_POST["USR_UID"],
"DOC_UID" => $_POST["DOC_UID"],
"APP_DOC_TYPE" => $_POST["APP_DOC_TYPE"],
"APP_DOC_CREATE_DATE" => date("Y-m-d H:i:s"),
"APP_DOC_COMMENT" => (isset($_POST["COMMENT"])) ? $_POST["COMMENT"] : "",
"APP_DOC_TITLE" => (isset($_POST["TITLE"])) ? $_POST["TITLE"] : "",
"APP_DOC_FILENAME" => (isset($_FILES["ATTACH_FILE"]["name"])) ? $_FILES["ATTACH_FILE"]["name"] : "",
"FOLDER_UID" => $folderId, "APP_DOC_TAGS" => $fileTags,
"APP_DOC_FIELDNAME" => (isset($_POST["APP_DOC_FIELDNAME"])) ? $_POST["APP_DOC_FIELDNAME"] : ((isset($_FILES["ATTACH_FILE"]["name"])) ? $_FILES["ATTACH_FILE"]["name"] : "")
);
}

View File

@@ -52,7 +52,9 @@ if ($handle = opendir( PATH_PLUGINS )) {
if (is_file(PATH_PLUGINS . $pluginName . ".php") && is_dir(PATH_PLUGINS . $pluginName)) {
/*----------------------------------********---------------------------------*/
if (PMLicensedFeatures::getSingleton()->verifyfeature("B0oWlBLY3hHdWY0YUNpZEtFQm5CeTJhQlIwN3IxMEkwaG4=")) {
if (!$oPluginRegistry->isEnterprisePlugin($pluginName) &&
PMLicensedFeatures::getSingleton()->verifyfeature('B0oWlBLY3hHdWY0YUNpZEtFQm5CeTJhQlIwN3IxMEkwaG4=')
) {
//Check disabled code
G::LoadClass("codeScanner");

View File

@@ -242,6 +242,11 @@ try {
}
$res = $tar->extract( $path );
//Check if is enterprise plugin
if ($oPluginRegistry->isEnterprisePlugin($sClassName, $path)) {
throw new Exception(G::LoadTranslation('ID_PMPLUGIN_IMPORT_PLUGIN_IS_ENTERPRISE', [$filename]));
}
/*----------------------------------********---------------------------------*/
if (PMLicensedFeatures::getSingleton()->verifyfeature("B0oWlBLY3hHdWY0YUNpZEtFQm5CeTJhQlIwN3IxMEkwaG4=")) {
//Check disabled code
@@ -259,12 +264,8 @@ try {
}
/*----------------------------------********---------------------------------*/
//Check if is enterprise plugin
//Get contents of plugin file
$sContent = file_get_contents( $path . $pluginFile );
$chain = preg_quote( 'extends enterprisePlugin' );
if (strpos( $sContent, $chain )) {
throw (new Exception( 'The plugin ' . $filename . ' is a Enterprise Edition Plugin, please install the Enterprise Plugins Manager to use this plugin.' ));
}
$sContent = str_ireplace( $sAux, $sAux . '_', $sContent );
$sContent = str_ireplace( 'PATH_PLUGINS', "'" . $path . "'", $sContent );
$sContent = preg_replace( "/\\\$oPluginRegistry\s*=\s*&\s*PMPluginRegistry::getSingleton\s*\(\s*\)\s*;/i", null, $sContent );

View File

@@ -493,7 +493,7 @@ class InputDocument
*
* return array Return an array with data of an InputDocument
*/
public function addCasesInputDocument($applicationUid, $taskUid, $appDocComment, $inputDocumentUid, $userUid)
public function addCasesInputDocument($applicationUid, $taskUid, $appDocComment, $inputDocumentUid, $userUid, $runningWorkflow = true)
{
try {
if ((isset( $_FILES['form'] )) && ($_FILES['form']['error'] != 0)) {
@@ -535,7 +535,60 @@ class InputDocument
$appDocType = 'INPUT';
$case = new \Cases();
$delIndex = \AppDelegation::getCurrentIndex($applicationUid);
$case->thisIsTheCurrentUser($applicationUid, $delIndex, $userUid, "REDIRECT", "casesListExtJs");
if ($runningWorkflow) {
$case->thisIsTheCurrentUser($applicationUid, $delIndex, $userUid, 'REDIRECT', 'casesListExtJs');
} else {
$criteria = new \Criteria('workflow');
$criteria->add(\AppDelegationPeer::APP_UID, $applicationUid);
$criteria->add(\AppDelegationPeer::DEL_INDEX, $delIndex);
$criteria->add(\AppDelegationPeer::USR_UID, $userUid);
$rsCriteria = \ProcessUserPeer::doSelectRS($criteria);
if (!$rsCriteria->next()) {
$case2 = new \ProcessMaker\BusinessModel\Cases();
$arrayApplicationData = $case2->getApplicationRecordByPk($applicationUid, [], false);
$msg = '';
$supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor();
$flagps = $supervisor->isUserProcessSupervisor($arrayApplicationData['PRO_UID'], $userUid);
if ($flagps == false) {
$msg = \G::LoadTranslation('ID_USER_NOT_IT_BELONGS_CASE_OR_NOT_SUPERVISOR');
}
if ($msg == '') {
$criteria = new \Criteria('workflow');
$criteria->add(\StepSupervisorPeer::PRO_UID, $arrayApplicationData['PRO_UID'], \Criteria::EQUAL);
$criteria->add(\StepSupervisorPeer::STEP_TYPE_OBJ, 'INPUT_DOCUMENT', \Criteria::EQUAL);
$criteria->add(\StepSupervisorPeer::STEP_UID_OBJ, $inputDocumentUid, \Criteria::EQUAL);
$rsCriteria = \StepSupervisorPeer::doSelectRS($criteria);
if (!$rsCriteria->next()) {
$msg = \G::LoadTranslation('ID_USER_IS_SUPERVISOR_DOES_NOT_ASSOCIATED_INPUT_DOCUMENT');
}
}
if ($msg != '') {
if ($runningWorkflow) {
\G::SendMessageText($msg, 'ERROR');
$backUrlObj = explode('sys' . SYS_SYS, $_SERVER['HTTP_REFERER']);
\G::header('location: ' . '/sys' . SYS_SYS . $backUrlObj[1]);
exit(0);
} else {
throw new \Exception($msg);
}
}
}
}
//Load the fields
$arrayField = $case->loadCase($applicationUid);
$arrayField["APP_DATA"] = array_merge($arrayField["APP_DATA"], \G::getSystemConstants());

View File

@@ -179,10 +179,13 @@ class NotificationDevice
}
$userIds = $arrayTaskUser;
//sub process
$taskAssignType = (isset($nextDel["TAS_ASSIGN_TYPE"])) ? $nextDel["TAS_ASSIGN_TYPE"] : $nextDel["SP_TYPE"];
$message = '#' . $appFields['APP_NUMBER'] . ' : ' . $appFields['APP_TITLE'];
$data = array(
'processId' => $appFields['PRO_UID'],
'taskId' => $nextDel["TAS_UID"],
'taskAssignType' => $taskAssignType,
'caseId' => $appFields['APP_UID'],
'caseTitle' => $appFields['APP_TITLE'],
'delIndex' => $iNewDelIndex,
@@ -281,5 +284,4 @@ class NotificationDevice
return $arrayTaskUser;
}
}

View File

@@ -100,17 +100,19 @@ class PushMessageIOS
// $errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx);
// if (!$fp)
// exit("Failed to connect: $err $errstr" . PHP_EOL);
$alert = new \stdClass();
$alert->{'loc-key'} = $data['taskAssignType'];
$alert->{'loc-args'} = array($message);
// Create the payload body
if (!is_null($data)) {
$body['aps'] = array(
'alert' => $message,
'alert' => $alert,
'sound' => 'default',
'data' => $data
);
} else {
$body['aps'] = array(
'alert' => $message,
'alert' => $alert,
'sound' => 'default'
);
}

View File

@@ -1523,5 +1523,57 @@ class ProcessSupervisor
$oCriteria->setStepPosition($pos);
$oCriteria->save();
}
}
/**
* Validate if the user is supervisor of the process
*
* @param string $projectUid Unique id of process
* @param string $userUid Unique id of User
*
* @return bool Return
*/
public function isUserProcessSupervisor($projectUid, $userUid)
{
try {
$criteria = new \Criteria('workflow');
$criteria->add(\ProcessUserPeer::USR_UID, $userUid, \Criteria::EQUAL);
$criteria->add(\ProcessUserPeer::PRO_UID, $projectUid, \Criteria::EQUAL);
$criteria->add(\ProcessUserPeer::PU_TYPE, 'SUPERVISOR', \Criteria::EQUAL);
$rsCriteria = \ProcessUserPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
if ($rsCriteria->next()) {
return true;
}
$criteria = new \Criteria('workflow');
$criteria->addSelectColumn(\ProcessUserPeer::USR_UID);
$criteria->add(\ProcessUserPeer::PRO_UID, $projectUid, \Criteria::EQUAL);
$criteria->add(\ProcessUserPeer::PU_TYPE, 'GROUP_SUPERVISOR', \Criteria::EQUAL);
$rsCriteria = \ProcessUserPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$record = $rsCriteria->getRow();
$groupUid = $record['USR_UID'];
$obj = \GroupUserPeer::retrieveByPK($groupUid, $userUid);
if (!is_null($obj)) {
return true;
}
}
//Return
return false;
} catch (\Exception $e) {
throw $e;
}
}
}

View File

@@ -150,8 +150,12 @@ class Table
*
* @return array
*/
public function getTableData($tab_uid, $pro_uid = '', $reportFlag = false)
public function getTableData($tab_uid, $pro_uid = '', $filter = null, $reportFlag = false)
{
//Validation
$inputFilter = new \InputFilter();
$filter = $inputFilter->sanitizeInputValue($filter, 'nosql');
//VALIDATION
if ($reportFlag) {
$pro_uid = $this->validateProUid($pro_uid);
@@ -160,7 +164,7 @@ class Table
$additionalTables = new AdditionalTables();
$table = $additionalTables->load($tab_uid, true);
$result = $additionalTables->getAllData($tab_uid);
$result = $additionalTables->getAllData($tab_uid, null, null, null, $filter);
$primaryKeys = $additionalTables->getPrimaryKeys();
if (is_array($result['rows'])) {
foreach ($result['rows'] as $i => $row) {

View File

@@ -922,6 +922,7 @@ class Variable
$sqlOrderBy = " ORDER BY " . $sFieldSel;
}
$start = 0;
$sqlLimit = "";
if ($start >= 0) {
$sqlLimit = " LIMIT " . $start;
@@ -943,17 +944,43 @@ class Variable
$row = $ds->getRow();
if (isset($row["DBS_TYPE"])) {
if ($row["DBS_TYPE"] === "pgsql") {
$sqlLimit = $this->limitPgsql($start, $limit);
if ($start >= 0) {
$sqlLimit = " OFFSET " . $start;
}
if ($limit !== "") {
$sqlLimit = $sqlLimit . " LIMIT " . $limit;
}
}
if ($row["DBS_TYPE"] === "mssql") {
return $this->limitMssqlOracle($sqlSelect, $sqlFrom, $sqlWhere, $sqlGroupBy, $sqlHaving, $sqlOrderBy, $start, $limit, true);
$sqlLimit = "";
if ($limit !== "") {
$wordsSearch = [" DISTINCT ", " ALL "];
$wordsSearchCount = count($wordsSearch);
for ($i = 0; $i < $wordsSearchCount; $i++) {
$stringSearch = $wordsSearch[$i];
$stringPosition = strpos($sqlSelect, $stringSearch);
if ($stringPosition !== false) {
$stringLength = strlen($stringSearch);
$string1 = substr($sqlSelect, 0, $stringPosition + $stringLength);
$string2 = substr($sqlSelect, $stringPosition + $stringLength);
$sqlSelect = $string1 . "TOP(" . $limit . ") " . $string2;
}
}
}
}
if ($row["DBS_TYPE"] === "oracle") {
return $this->limitMssqlOracle($sqlSelect, $sqlFrom, $sqlWhere, $sqlGroupBy, $sqlHaving, $sqlOrderBy, $start, $limit, false);
$sqlLimit = "";
if ($limit !== "") {
if (strpos($sqlWhere, "WHERE ") === false) {
$sqlWhere = " WHERE ROWNUM <= " . $limit;
} else {
$sqlWhere = $sqlWhere . " AND ROWNUM <= " . $limit;
}
}
}
}
return $sqlSelect . $sqlFrom . $sqlWhere . $sqlGroupBy . $sqlHaving . $sqlOrderBy . $sqlLimit;
return $sqlSelect . $sqlFrom . $sqlWhere . $sqlGroupBy . $sqlHaving . " " . $sqlOrderBy . $sqlLimit;
}
if (!empty($sqlParsed['CALL'])) {
$sCall = "CALL ";
@@ -981,36 +1008,6 @@ class Variable
}
}
public function limitPgsql($start = 0, $limit = "")
{
$sqlLimit = "";
if ($start >= 0) {
$sqlLimit = " OFFSET " . $start;
}
if ($limit !== "") {
$sqlLimit = $sqlLimit . " LIMIT " . $limit;
}
return $sqlLimit;
}
public function limitMssqlOracle($sqlSelect = "", $sqlFrom = "", $sqlWhere = "", $sqlGroupBy = "", $sqlHaving = "", $sqlOrderBy = "", $start = 0, $limit = "", $isMssql = true)
{
$sqlLimit = "";
if ($start >= 0) {
$sqlLimit = "WHERE rn >= " . $start;
}
if ($start >= 0 && $limit != "") {
$sqlLimit = "WHERE rn BETWEEN " . $start . " AND " . $limit;
}
$sql = ""
. "SELECT * FROM ("
. " " . $sqlSelect . ", ROW_NUMBER() OVER( " . $sqlOrderBy . " desc )-1 " . ($isMssql ? " AS " : "") . " rn "
. " " . $sqlFrom . $sqlWhere . $sqlGroupBy . $sqlHaving
. ")" . ($isMssql ? " AS A " : "")
. $sqlLimit;
return $sql;
}
public function getVariableTypeByName($processUid, $variableName)
{
try {

View File

@@ -174,11 +174,27 @@ abstract class Importer
/*----------------------------------********---------------------------------*/
if($objectsToImport === ''){
/*----------------------------------********---------------------------------*/
try {
$this->verifyIfTheProcessHasStartedCases();
} catch (\Exception $e) {
throw $e;
}
$this->removeProject();
/*----------------------------------********---------------------------------*/
} else {
$granularObj = new \ProcessMaker\BusinessModel\Migrator\GranularImporter();
$objectList = $granularObj->loadObjectsListSelected($this->importData, $objectsToImport);
try {
foreach ($objectList as $rowObject) {
if ($rowObject['name'] === 'PROCESSDEFINITION') {
$this->verifyIfTheProcessHasStartedCases();
}
}
} catch (\Exception $e) {
$exception = new ImportException($e->getMessage());
$exception->setNameException($e->getMessage());
throw $exception;
}
try {
foreach ($objectList as $rowObject) {
if ($rowObject['name'] === 'PROCESSDEFINITION') {
@@ -351,6 +367,46 @@ abstract class Importer
$project->remove(true, false, $onlyDiagram);
}
/**
* Check tasks that have cases.
*
* @return boolean
*/
public function verifyIfTheProcessHasStartedCases()
{
$tasksIds = array();
$importedTasks = $this->importData["tables"]["workflow"]["tasks"];
foreach ($importedTasks as $value) {
$tasksIds[] = $value["TAS_UID"];
}
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\TaskPeer::TAS_UID);
$criteria->add(\TaskPeer::PRO_UID, $this->metadata["uid"], \Criteria::EQUAL);
$criteria->add(\TaskPeer::TAS_UID, $tasksIds, \Criteria::NOT_IN);
$ds = \TaskPeer::doSelectRS($criteria);
$ds->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$tasksEliminatedIds = array();
while ($ds->next()) {
$row = $ds->getRow();
$tasksEliminatedIds[] = $row["TAS_UID"];
}
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\AppDelegationPeer::TAS_UID);
$criteria->add(\AppDelegationPeer::PRO_UID, $this->metadata["uid"], \Criteria::EQUAL);
$criteria->add(\AppDelegationPeer::DEL_FINISH_DATE, null, \Criteria::ISNULL);
$criteria->add(\AppDelegationPeer::TAS_UID, $tasksEliminatedIds, \Criteria::IN);
$ds = \AppDelegationPeer::doSelectRS($criteria);
$ds->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$ds->next();
$row = $ds->getRow();
if (isset($row["TAS_UID"])) {
$exception = new \Exception(\G::LoadTranslation("ID_PROCESS_CANNOT_BE_UPDATED_THERE_ARE_TASKS_WITH_ACTIVE_CASES"));
throw $exception;
}
}
/**
* Sets the temporal file save directory
* @param $dirName
@@ -481,7 +537,7 @@ abstract class Importer
foreach ($arrayWorkflowTables["tasks"] as $key => $value) {
$arrayTaskData = $value;
if (!in_array($arrayTaskData["TAS_TYPE"], array("GATEWAYTOGATEWAY", "WEBENTRYEVENT", "END-MESSAGE-EVENT", "START-MESSAGE-EVENT", "INTERMEDIATE-THROW-MESSAGE-EVENT", "INTERMEDIATE-CATCH-MESSAGE-EVENT", "START-TIMER-EVENT", "INTERMEDIATE-CATCH-TIMER-EVENT", "END-EMAIL-EVENT", "INTERMEDIATE-EMAIL-EVENT"))) {
if (!in_array($arrayTaskData["TAS_TYPE"], array("GATEWAYTOGATEWAY", "WEBENTRYEVENT", "END-MESSAGE-EVENT", "START-MESSAGE-EVENT", "INTERMEDIATE-THROW-MESSAGE-EVENT", "INTERMEDIATE-CATCH-MESSAGE-EVENT", "START-TIMER-EVENT", "INTERMEDIATE-CATCH-TIMER-EVENT", "END-EMAIL-EVENT", "INTERMEDIATE-THROW-EMAIL-EVENT"))) {
$result = $workflow->updateTask($arrayTaskData["TAS_UID"], $arrayTaskData);
}
}

View File

@@ -0,0 +1,105 @@
<?php
namespace ProcessMaker\Policies;
use \Luracast\Restler\iAuthenticate;
use \Luracast\Restler\RestException;
use \Luracast\Restler\Defaults;
use \Luracast\Restler\Util;
use \Luracast\Restler\Scope;
use \OAuth2\Request;
use \ProcessMaker\Services\OAuth2\Server;
use \ProcessMaker\BusinessModel\User;
class AccessControl implements iAuthenticate
{
public static $role;
public static $permission;
public static $className;
private $userUid = null;
private $oUser;
/**
* This method checks if an endpoint permission or permissions access
*
* @return bool
* @throws RestException
*/
public function __isAllowed()
{
$response = true;
$oServerOauth = new Server();
$this->oUser = new User();
$server = $oServerOauth->getServer();
$request = Request::createFromGlobals();
$allowed = $server->verifyResourceRequest($request);
$this->userUid = $oServerOauth->getUserId();
$this->oUser->loadUserRolePermission('PROCESSMAKER', $this->userUid);
$metadata = Util::nestedValue($this->restler, 'apiMethodInfo', 'metadata');
if ($allowed && !empty($this->userUid) && (!empty($metadata['access']) && $metadata['access'] == 'protected')) {
$parameters = Util::nestedValue($this->restler, 'apiMethodInfo', 'parameters');
if (!is_null(self::$className) && is_string(self::$className)) {
$authObj = Scope::get(self::$className);
$authObj->parameters = $parameters;
$authObj->permission = self::$permission;
if (!method_exists($authObj, Defaults::$authenticationMethod)) {
throw new RestException (
500,
'Authentication Class should implement iAuthenticate');
} elseif (!$authObj->{Defaults::$authenticationMethod}()) {
throw new RestException(401);
}
} elseif (!$this->verifyAccess(self::$permission)) {
throw new RestException(401);
}
}
return $response;
}
/**
* @return string
*/
public function __getWWWAuthenticateString()
{
return '';
}
/**
* @param $permissions
* @return bool
*/
public function verifyAccess($permissions)
{
$response = false;
$access = -1;
if (!is_array($permissions)) {
$access = $this->userCanAccess($permissions);
} elseif (count($permissions) > 0) {
foreach ($permissions as $perm) {
$access = $this->userCanAccess($perm);
if ($access == 1) {
break;
}
}
}
if ($access == 1 || empty($permissions)) {
$response = true;
}
return $response;
}
public function userCanAccess($perm)
{
$res = -1;
$permissions = Util::nestedValue($this->oUser, 'aUserInfo', 'PROCESSMAKER', 'PERMISSIONS');
if (isset($permissions)) {
$res = -3;
foreach ($permissions as $key => $val) {
if ($perm == $val['PER_CODE']) {
$res = 1;
break;
}
}
}
return $res;
}
}

View File

@@ -31,7 +31,8 @@ class BpmnWorkflow extends Project\Bpmn
"intermediate-catch-message-event" => array("type" => "INTERMEDIATE-CATCH-MESSAGE-EVENT", "prefix" => "icme-"),
"start-timer-event" => array("type" => "START-TIMER-EVENT", "prefix" => "ste-"),
"intermediate-catch-timer-event" => array("type" => "INTERMEDIATE-CATCH-TIMER-EVENT", "prefix" => "icte-"),
"end-email-event" => array("type" => "END-EMAIL-EVENT", "prefix" => "eee-")
"end-email-event" => array("type" => "END-EMAIL-EVENT", "prefix" => "eee-"),
"intermediate-throw-email-event" => array("type" => "INTERMEDIATE-THROW-EMAIL-EVENT", "prefix" => "itee-")
);
private $arrayElementTaskRelation = array();
@@ -885,10 +886,6 @@ class BpmnWorkflow extends Project\Bpmn
\BpmnFlowPeer::FLO_ELEMENT_ORIGIN_TYPE => "bpmnGateway"
));
//if ($arrayFlow > 0) {
// $this->wp->resetTaskRoutes($activityUid);
//}
foreach ($arrayFlow as $value) {
$arrayFlowData = $value->toArray();
@@ -980,12 +977,13 @@ class BpmnWorkflow extends Project\Bpmn
if (!is_null($arrayEventData)) {
$arrayEventType = array("INTERMEDIATE");
$arrayEventMarker = array("MESSAGECATCH", "TIMER");
$arrayEventMarker = array("MESSAGECATCH", "TIMER", "EMAIL");
if (in_array($arrayEventData["EVN_TYPE"], $arrayEventType) && in_array($arrayEventData["EVN_MARKER"], $arrayEventMarker)) {
$arrayKey = array(
"MESSAGECATCH" => "intermediate-catch-message-event",
"TIMER" => "intermediate-catch-timer-event"
"TIMER" => "intermediate-catch-timer-event",
"EMAIL" => "intermediate-throw-email-event"
);
$taskUid = $this->createTaskByElement(

View File

@@ -85,8 +85,9 @@ class InputDocument extends Api
{
try {
$userUid = $this->getUserId();
$inputDocument = new \ProcessMaker\BusinessModel\Cases\InputDocument();
$response = $inputDocument->addCasesInputDocument($app_uid, $tas_uid, $app_doc_comment, $inp_doc_uid, $userUid);
$response = $inputDocument->addCasesInputDocument($app_uid, $tas_uid, $app_doc_comment, $inp_doc_uid, $userUid, false);
return $response;
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));

View File

@@ -902,10 +902,10 @@ class Light extends Api
$dynaForm->setFormatFieldNameInUppercase(false);
$_SESSION['PROCESS'] = $prj_uid;
$response = $dynaForm->getDynaForm($dyn_uid);
$result = $this->parserDataDynaForm($response);
$result['formContent'] = (isset($result['formContent']) && $result['formContent'] != null)?json_decode($result['formContent']):"";
$result = $this->parserDataDynaForm($response);
$result['formContent'] = (isset($result['formContent']) && $result['formContent'] != null) ? \G::json_decode($result['formContent']) : "";
\G::LoadClass("pmDynaform");
$pmDynaForm = new \pmDynaform();
$pmDynaForm = new \pmDynaform(["CURRENT_DYNAFORM" => $dyn_uid]);
$pmDynaForm->jsonr($result['formContent']);
return $result;
} catch (\Exception $e) {

View File

@@ -79,11 +79,11 @@ class Pmtable extends Api
*
* @url GET /:pmt_uid/data
*/
public function doGetPmTableData($pmt_uid)
public function doGetPmTableData($pmt_uid, $filter = null)
{
try {
$oPmTable = new \ProcessMaker\BusinessModel\Table();
$response = $oPmTable->getTableData($pmt_uid);
$response = $oPmTable->getTableData($pmt_uid, null, $filter);
return $response;
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));

View File

@@ -87,7 +87,7 @@ class ReportTable extends Api
{
try {
$oReportTable = new \ProcessMaker\BusinessModel\Table();
$response = $oReportTable->getTableData($rep_uid, $prj_uid, true);
$response = $oReportTable->getTableData($rep_uid, $prj_uid, null, true);
return $response;
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));

View File

@@ -37,10 +37,13 @@ class Common extends \Maveriks\Util\Common
}
$numc = 50;
$total = $numc - 2 - strlen($data);
if($total < 0){
$total = 0;
}
switch ($option) {
case "BAR":
echo "\r" . "| " . $data . str_repeat(" ", $numc - 2 - strlen($data));
echo "\r" . "| " . $data . str_repeat(" ", $total);
break;
case "TEXT":
echo "\r" . '| ' . $data . "\n";

View File

@@ -566,51 +566,42 @@ function updateCasesView(viewList) {
}
function updateCasesTree() {
//treeMenuItems.root.reload();
document.getElementById('refreshNotifiers').src = '/images/ext/default/grid/loading.gif';
itemsTypes = Array('CASES_INBOX', 'CASES_DRAFT', 'CASES_CANCELLED', 'CASES_SENT', 'CASES_PAUSED', 'CASES_COMPLETED','CASES_SELFSERVICE');
if(currentSelectedTreeMenuItem){
ReloadTreeMenuItemDetail({item:currentSelectedTreeMenuItem});
itemsTypes = Array('CASES_INBOX', 'CASES_DRAFT', 'CASES_CANCELLED', 'CASES_SENT', 'CASES_PAUSED', 'CASES_COMPLETED', 'CASES_SELFSERVICE');
if (currentSelectedTreeMenuItem) {
ReloadTreeMenuItemDetail({item: currentSelectedTreeMenuItem});
}
Ext.Ajax.request({
url: urlProxy + Math.random(),
/*----------------------------------********---------------------------------*/
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + credentials.access_token
},
method: 'GET',
/*----------------------------------********---------------------------------*/
success: function(response){
success: function (response) {
result = Ext.util.JSON.decode(response.responseText);
for(i=0; i<result.length; i++){
if( document.getElementById('NOTIFIER_'+result[i].item ) ){
oldValue = document.getElementById('NOTIFIER_'+result[i].item).innerHTML;
for (i = 0; i < result.length; i++) {
if (document.getElementById('NOTIFIER_' + result[i].item)) {
oldValue = document.getElementById('NOTIFIER_' + result[i].item).innerHTML;
oldValue = oldValue.replace('<b>', '');
oldValue = oldValue.replace('</b>', '');
newValue = result[i].count;
if( oldValue != newValue && oldValue != 0 ){
document.getElementById('NOTIFIER_'+result[i].item).innerHTML = '<b>' + result[i].count + '</b>';
if (oldValue != newValue && oldValue != 0) {
document.getElementById('NOTIFIER_' + result[i].item).innerHTML = '<b>' + result[i].count + '</b>';
//NOTIFIER_FLAG = true;
} else {
//if(NOTIFIER_FLAG === false){
document.getElementById('NOTIFIER_'+result[i].item).innerHTML = result[i].count;
document.getElementById('NOTIFIER_' + result[i].item).innerHTML = result[i].count;
//}
}
}
else continue;
}
document.getElementById('refreshNotifiers').src = '/images/refresh.gif';
},
failure: function(){},
failure: function () {
},
params: {'updateCasesTree': true}
});
}
setFlag = function (val) {

View File

@@ -17,6 +17,7 @@ var importOption;
var externalOption;
var externalPermissions;
var currentSelectedRow = -1;
var extensionPmt = 'pmt';
Ext.onReady(function(){
///Keyboard Events
@@ -565,77 +566,85 @@ ImportPMTable = function(){
buttons: [{
id: 'importPMTableButtonUpload',
text: _('ID_UPLOAD'),
handler: function(){
var uploader = Ext.getCmp('uploader');
handler: function () {
var uploader = Ext.getCmp('uploader');
if ((eval("/^.+\.(" + extensionPmt + ")$/i").exec(Ext.getCmp('uploader').items.items[0].value))) {
if (uploader.getForm().isValid()) {
uploader.getForm().submit({
url: 'pmTablesProxy/import',
waitMsg: _('ID_UPLOADING_FILE'),
waitTitle: "&nbsp;",
success: function (o, resp) {
var result = Ext.util.JSON.decode(resp.response.responseText);
if(uploader.getForm().isValid()){
uploader.getForm().submit({
url: 'pmTablesProxy/import',
waitMsg: _('ID_UPLOADING_FILE'),
waitTitle : "&nbsp;",
success: function(o, resp){
var result = Ext.util.JSON.decode(resp.response.responseText);
if (result.success) {
PMExt.notify('', result.message);
}
else {
win = new Ext.Window({
id: 'windowImportingError',
applyTo: 'hello-win',
layout: 'fit',
width: 500,
height: 300,
closeAction: 'hide',
plain: true,
html: '<h3>' + _('ID_IMPORTING_ERROR') + '</h3>' + result.message,
items: [],
if (result.success) {
PMExt.notify('', result.message);
}
else {
win = new Ext.Window({
id: 'windowImportingError',
applyTo:'hello-win',
layout:'fit',
width:500,
height:300,
closeAction:'hide',
plain: true,
html: '<h3>' + _('ID_IMPORTING_ERROR') + '</h3>' + result.message,
items: [],
buttons: [{
text: 'Close',
handler: function () {
win.hide();
}
}]
});
win.show(this);
}
buttons: [{
text: 'Close',
handler: function(){
win.hide();
}
}]
});
win.show(this);
}
w.close();
infoGrid.store.reload();
},
failure: function (o, resp) {
w.close();
infoGrid.store.reload();
w.close();
infoGrid.store.reload();
},
failure: function(o, resp){
w.close();
infoGrid.store.reload();
var result = Ext.util.JSON.decode(resp.response.responseText);
if (result.errorType == 'warning') {
Ext.MessageBox.show({
title: _('ID_WARNING_PMTABLES'),
width: 510,
height: 300,
msg: "<div style=\"overflow: auto; width: 439px; height: 200px;\">" + result.message.replace(/\n/g,' <br>') + "</div>",
buttons: Ext.MessageBox.OK,
animEl: 'mb9',
fn: function(){},
icon: Ext.MessageBox.INFO
var result = Ext.util.JSON.decode(resp.response.responseText);
if (result.errorType == 'warning') {
Ext.MessageBox.show({
title: _('ID_WARNING_PMTABLES'),
width: 510,
height: 300,
msg: "<div style=\"overflow: auto; width: 439px; height: 200px;\">" + result.message.replace(/\n/g, ' <br>') + "</div>",
buttons: Ext.MessageBox.OK,
animEl: 'mb9',
fn: function () {
},
icon: Ext.MessageBox.INFO
});
} else {
if (result.errorType == 'notice') {
Ext.MessageBox.alert(_("ID_ERROR"), result.message);
} else {
if (result.fromAdmin) { /* from admin tab */
aOverwrite = result.arrayOverwrite;
aRelated = result.arrayRelated;
aMessage = result.arrayMessage;
pmtablesErrors(aOverwrite, aRelated, aMessage);
} else { /* from designer tab */
aOverwrite = result.arrayOverwrite;
aRelated = result.arrayRelated;
aMessage = result.arrayMessage;
pmtablesErrors(aOverwrite, aRelated, aMessage);
}
}
}
}
});
} else {
if(result.fromAdmin) { /* from admin tab */
aOverwrite = result.arrayOverwrite;
aRelated = result.arrayRelated;
aMessage = result.arrayMessage;
pmtablesErrors(aOverwrite,aRelated,aMessage);
} else { /* from designer tab */
aOverwrite = result.arrayOverwrite;
aRelated = result.arrayRelated;
aMessage = result.arrayMessage;
pmtablesErrors(aOverwrite,aRelated,aMessage);
}
}
}
});
}
} else {
Ext.MessageBox.alert(_("ID_ERROR"), _("ID_FILE_UPLOAD_INCORRECT_EXTENSION"));
}
}
},{
id: 'importPMTableButtonCancel',

View File

@@ -10,6 +10,93 @@ var processesGrid,
affectedGroups,
processObjectsArray;
/**
* Shows disabled Process Designer Type message
*
*/
var disabledProcessTypeMessage = function(){
Ext.MessageBox.show({
title: _("ID_ERROR"),
msg: _("ID_DESIGNER_PROCESS_DESIGNER_IS_DISABLED"),
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK
});
};
/**
* Object which loads all supported Process types and their edit function
* You can register here Process types to evitate eval funtion
* Ex. registerNewProcessType('CPF_STANDARD_TPL', function(rowSelected){ doSomething();});
*
* @type {{bpmn: Function, classic: Function, default: Function}}
*/
var supportedProcessTypes = {
'bpmn': function (rowSelected) {
openWindowIfIE("../designer?prj_uid=" + rowSelected.data.PRO_UID);
},
'classic': function (rowSelected) {
location.assign("processes_Map?PRO_UID=" + rowSelected.data.PRO_UID);
},
'default': function (rowSelected) {
var fn = rowSelected.data.PROJECT_TYPE;
fn = fn.replace(/\s/g, "_");
fn = fn.replace(/\-/g, "_");
fn = fn + "DesignerGridRowDblClick";
// Todo We should remove eval functions as they are NSFW
eval("var flag = typeof(" + fn + ") == \"function\";");
if (flag) {
eval(fn + "(rowSelected.data);");
} else {
disabledProcessTypeMessage();
}
}
};
/**
* This Object contains default disabled New Options,
* Set to true if you want to disable a create option.
* Ex. disabledNewProjectOptions["classicProject"] = true;
*
* @type {{bpmnProject: boolean, classicProject: boolean}}
*/
var disabledNewProjectOptions = {
'bpmnProject': false,
'classicProject': false
};
/**
* Register a new Supported Process Type
*
* @param name string
* @param action function
*/
function registerNewProcessType(name, action) {
try {
this.supportedProcessTypes[name] = action;
} catch (e) {
console.log("Cannot add " + name + " Process type: " + e);
}
}
/**
* Disable a Process type for edition
* can be used in a plugin like: disableProcessType("classic");
*
* @param name
*/
function disableProcessType(name) {
try {
if (this.supportedProcessTypes[name]) {
this.supportedProcessTypes[name] = disabledProcessTypeMessage;
}
} catch (e) {
console.log("Cannot disable " + name + " Process type:" + e);
}
}
/**
* Global variables and variable initialization for import process.
*/
@@ -225,6 +312,14 @@ Ext.onReady(function(){
}
}
//Checks all disabled options and removes from new options by pmTypeProject
var io = arrayMenuNewOption.length - 1;
for (io; io >= 0; io -= 1) {
if (disabledNewProjectOptions[arrayMenuNewOption[io].pmTypeProject]) {
arrayMenuNewOption.splice(io, 1);
}
}
if (arrayMenuNewOption.length > 1) {
newTypeProcess = {
xtype: "tbsplit",
@@ -239,13 +334,20 @@ Ext.onReady(function(){
}
};
} else {
// Handler should be the one from the unique option, if not,
// should fallback to default pmTypeProject.
var handler;
if (typeof arrayMenuNewOption[0].handler === "function") {
handler = arrayMenuNewOption[0].handler;
} else {
handler = function () {
newProcess({type: arrayMenuNewOption[0].pmTypeProject});
}
}
newTypeProcess = {
text: _("ID_NEW"),
iconCls: "button_menu_ext ss_sprite ss_add",
handler: function ()
{
newProcess({type: arrayMenuNewOption[0].pmTypeProject});
}
handler: handler
};
}
//Code export - exportGranular (handle)
@@ -817,34 +919,15 @@ editProcess = function(typeParam)
return;
}
switch (rowSelected.data.PROJECT_TYPE) {
case "bpmn":
openWindowIfIE("../designer?prj_uid=" + rowSelected.data.PRO_UID);
break;
case "classic":
location.assign("processes_Map?PRO_UID=" + rowSelected.data.PRO_UID);
break;
default:
var fn = rowSelected.data.PROJECT_TYPE;
fn = fn.replace(/\s/g, "_");
fn = fn.replace(/\-/g, "_");
fn = fn + "DesignerGridRowDblClick";
eval("var flag = typeof(" + fn + ") == \"function\";");
if (flag) {
eval(fn + "(rowSelected.data);");
} else {
Ext.MessageBox.show({
title: _("ID_ERROR"),
msg: _("ID_DESIGNER_PROCESS_DESIGNER_IS_DISABLED"),
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK
});
}
break;
// Look for edit process type, by default there are two options, bpmn and classic,
// replacement of old switch statement.
var process = supportedProcessTypes[rowSelected.data.PROJECT_TYPE] || false;
if (process) {
process(rowSelected);
} else {
supportedProcessTypes['default'](rowSelected);
}
}
};
editNewProcess = function(){
var rowSelected = processesGrid.getSelectionModel().getSelected();

View File

@@ -70,72 +70,80 @@ try {
}
//Save files
if (isset($_FILES["form"]["name"]) && count($_FILES["form"]["name"]) > 0) {
$arrayField = array();
$arrayFileName = array();
$arrayFileTmpName = array();
$arrayFileError = array();
if (isset( $_FILES["form"]["name"] ) && count( $_FILES["form"]["name"] ) > 0) {
$arrayField = array ();
$arrayFileName = array ();
$arrayFileTmpName = array ();
$arrayFileError = array ();
$i = 0;
foreach ($_FILES["form"]["name"] as $fieldIndex => $fieldValue) {
if (is_array($fieldValue)) {
foreach ($fieldValue as $index => $value) {
if (is_array($value)) {
foreach ($value as $grdFieldIndex => $grdFieldValue) {
$arrayField[$i]["grdName"] = $fieldIndex;
$arrayField[$i]["grdFieldName"] = $grdFieldIndex;
$arrayField[$i]["index"] = $index;
foreach ($_FILES["form"]["name"] as $fieldIndex => $fieldValue) {
if (is_array( $fieldValue )) {
foreach ($fieldValue as $index => $value) {
if (is_array( $value )) {
foreach ($value as $grdFieldIndex => $grdFieldValue) {
$arrayField[$i]["grdName"] = $fieldIndex;
$arrayField[$i]["grdFieldName"] = $grdFieldIndex;
$arrayField[$i]["index"] = $index;
$arrayFileName[$i] = $_FILES["form"]["name"][$fieldIndex][$index][$grdFieldIndex];
$arrayFileTmpName[$i] = $_FILES["form"]["tmp_name"][$fieldIndex][$index][$grdFieldIndex];
$arrayFileError[$i] = $_FILES["form"]["error"][$fieldIndex][$index][$grdFieldIndex];
$i = $i + 1;
$arrayFileName[$i] = $_FILES["form"]["name"][$fieldIndex][$index][$grdFieldIndex];
$arrayFileTmpName[$i] = $_FILES["form"]["tmp_name"][$fieldIndex][$index][$grdFieldIndex];
$arrayFileError[$i] = $_FILES["form"]["error"][$fieldIndex][$index][$grdFieldIndex];
$i = $i + 1;
}
}
}
} else {
$arrayField[$i] = $fieldIndex;
$arrayFileName[$i] = $_FILES["form"]["name"][$fieldIndex];
$arrayFileTmpName[$i] = $_FILES["form"]["tmp_name"][$fieldIndex];
$arrayFileError[$i] = $_FILES["form"]["error"][$fieldIndex];
$i = $i + 1;
} else {
$arrayField[$i] = $fieldIndex;
$arrayFileName[$i] = $_FILES["form"]["name"][$fieldIndex];
$arrayFileTmpName[$i] = $_FILES["form"]["tmp_name"][$fieldIndex];
$arrayFileError[$i] = $_FILES["form"]["error"][$fieldIndex];
$i = $i + 1;
}
}
}
if (count( $arrayField ) > 0) {
for ($i = 0; $i <= count( $arrayField ) - 1; $i ++) {
if ($arrayFileError[$i] == 0) {
$indocUid = null;
$fieldName = null;
$fileSizeByField = 0;
if (count($arrayField) > 0) {
for ($i = 0; $i <= count($arrayField) - 1; $i++) {
if ($arrayFileError[$i] == 0) {
$indocUid = null;
$fieldName = null;
if (is_array( $arrayField[$i] )) {
if (isset( $_POST["INPUTS"][$arrayField[$i]["grdName"]][$arrayField[$i]["grdFieldName"]] ) && ! empty( $_POST["INPUTS"][$arrayField[$i]["grdName"]][$arrayField[$i]["grdFieldName"]] )) {
$indocUid = $_POST["INPUTS"][$arrayField[$i]["grdName"]][$arrayField[$i]["grdFieldName"]];
}
if (is_array($arrayField[$i])) {
if (isset($_POST["INPUTS"][$arrayField[$i]["grdName"]][$arrayField[$i]["grdFieldName"]]) &&
!empty($_POST["INPUTS"][$arrayField[$i]["grdName"]][$arrayField[$i]["grdFieldName"]])
) {
$indocUid = $_POST["INPUTS"][$arrayField[$i]["grdName"]][$arrayField[$i]["grdFieldName"]];
}
$fieldName = $arrayField[$i]["grdName"] . "_" . $arrayField[$i]["index"] . "_" . $arrayField[$i]["grdFieldName"];
$fieldName = $arrayField[$i]["grdName"] . "_" . $arrayField[$i]["index"] . "_" . $arrayField[$i]["grdFieldName"];
} else {
if (isset($_POST["INPUTS"][$arrayField[$i]]) &&
!empty($_POST["INPUTS"][$arrayField[$i]])
) {
if (isset($_FILES["form"]["size"][$arrayField[$i]["grdName"]][$arrayField[$i]["index"]][$arrayField[$i]["grdFieldName"]])) {
$fileSizeByField = $_FILES["form"]["size"][$arrayField[$i]["grdName"]][$arrayField[$i]["index"]][$arrayField[$i]["grdFieldName"]];
}
} else {
if (isset( $_POST["INPUTS"][$arrayField[$i]] ) && ! empty( $_POST["INPUTS"][$arrayField[$i]] )) {
$indocUid = $_POST["INPUTS"][$arrayField[$i]];
}
$fieldName = $arrayField[$i];
if (isset($_FILES["form"]["size"][$fieldName])) {
$fileSizeByField = $_FILES["form"]["size"][$fieldName];
}
}
$filePath = G::sys_get_temp_dir() . PATH_SEP . $arrayFileName[$i];
file_put_contents($filePath, file_get_contents($arrayFileTmpName[$i]));
$temDir = G::sys_get_temp_dir();
$uploadfile = $temDir . PATH_SEP . basename($arrayFileName[$i]);
$result = move_uploaded_file($arrayFileTmpName[$i], $uploadfile);
$filePath = $temDir . PATH_SEP . $arrayFileName[$i];
file_put_contents($filePath, file_get_contents($uploadfile));
$filename = $arrayFileName[$i];
if ($indocUid != null) {
//Input file type
ws_sendFile($filePath, $USR_UID, $caseId, 1, $indocUid, $fieldName);
ws_sendFile($uploadfile, $USR_UID, $caseId, 1, $indocUid, $fieldName, null, null, $filename);
} else {
//Attached file type
ws_sendFile($filePath, $USR_UID, $caseId, 1, null, $fieldName);
ws_sendFile($uploadfile, $USR_UID, $caseId, 1, null, $fieldName, null, null, $filename);
}
}
}

View File

@@ -447,41 +447,44 @@ function ws_sendFile(
$FILENAME,
$USR_UID,
$APP_UID,
$DEL_INDEX=1,
$DOC_UID=null,
$APP_DOC_FIELDNAME=null,
$title=null,
$comment=null
) {
$DOC_UID = ($DOC_UID != null)? $DOC_UID : -1;
$APP_DOC_TYPE = ($DOC_UID == -1)? "ATTACHED" : "INPUT";
$title = ($title != null)? $title : $FILENAME;
$comment = ($comment != null)? $comment : null;
$DEL_INDEX = 1,
$DOC_UID = null,
$APP_DOC_FIELDNAME = null,
$title = null,
$comment = null,
$APP_DOC_FILENAME = null
)
{
$DOC_UID = ($DOC_UID != null) ? $DOC_UID : -1;
$APP_DOC_TYPE = ($DOC_UID == -1) ? "ATTACHED" : "INPUT";
$title = ($title != null) ? $title : $FILENAME;
$comment = ($comment != null) ? $comment : null;
$params = array(
"ATTACH_FILE" => "@$FILENAME",
"APPLICATION" => $APP_UID,
"INDEX" => $DEL_INDEX,
"DOC_UID" => $DOC_UID,
"USR_UID" => $USR_UID,
"APP_DOC_TYPE" => $APP_DOC_TYPE,
"APP_DOC_FIELDNAME" => $APP_DOC_FIELDNAME,
"TITLE" => $title,
"COMMENT" => $comment
);
$params = array(
"ATTACH_FILE" => "@$FILENAME",
"APPLICATION" => $APP_UID,
"INDEX" => $DEL_INDEX,
"DOC_UID" => $DOC_UID,
"USR_UID" => $USR_UID,
"APP_DOC_TYPE" => $APP_DOC_TYPE,
"APP_DOC_FIELDNAME" => $APP_DOC_FIELDNAME,
"TITLE" => $title,
"COMMENT" => $comment,
"APP_DOC_FILENAME" => $APP_DOC_FILENAME
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, WS_UPLOAD_URL);
//curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$response = curl_exec($ch);
curl_close($ch);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, WS_UPLOAD_URL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SAFE_UPLOAD, false);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$response = curl_exec($ch);
curl_close($ch);
return $response;
return $response;
}
function ws_updateFile($APP_DOC_UID, $FILENAME, $DOC_VERSION, $APP_DOC_TYPE=NULL, $USR_UID=NULL, $APP_UID=NULL, $DEL_INDEX=NULL, $DOC_UID=NULL, $title=NULL, $comment=NULL) {