Merged colosa/processmaker into master
This commit is contained in:
@@ -231,13 +231,27 @@ class AppProxy extends HttpProxyController
|
||||
*/
|
||||
function getSummary ($httpData)
|
||||
{
|
||||
$labels = array ();
|
||||
$form = new Form( 'cases/cases_Resume', PATH_XMLFORM, SYS_LANG ); //este es el problema!!!!!
|
||||
$labelsCaseProperties = array ();
|
||||
$labelsCurrentTaskProperties = array ();
|
||||
$labelTitleCurrentTasks = array ();
|
||||
|
||||
$formCaseProperties = new Form( 'cases/cases_Resume', PATH_XMLFORM, SYS_LANG );
|
||||
$formCaseTitle = new Form( 'cases/cases_Resume_Current_Task_Title', PATH_XMLFORM, SYS_LANG );
|
||||
$formCurrentTaskProperties = new Form( 'cases/cases_Resume_Current_Task', PATH_XMLFORM, SYS_LANG );
|
||||
|
||||
G::LoadClass( 'case' );
|
||||
$case = new Cases();
|
||||
|
||||
foreach ($form->fields as $fieldName => $field) {
|
||||
$labels[$fieldName] = $field->label;
|
||||
foreach ($formCaseProperties->fields as $fieldName => $field) {
|
||||
$labelsCaseProperties[$fieldName] = $field->label;
|
||||
}
|
||||
|
||||
foreach ($formCaseTitle->fields as $fieldName => $field) {
|
||||
$labelTitleCurrentTasks[$fieldName] = $field->label;
|
||||
}
|
||||
|
||||
foreach ($formCurrentTaskProperties->fields as $fieldName => $field) {
|
||||
$labelsCurrentTaskProperties[$fieldName] = $field->label;
|
||||
}
|
||||
|
||||
if (isset( $_SESSION['_applicationFields'] ) && $_SESSION['_processData']) {
|
||||
@@ -270,26 +284,26 @@ class AppProxy extends HttpProxyController
|
||||
$taskData = $task->load( $applicationFields['TAS_UID'] );
|
||||
$currentUser = $applicationFields['CURRENT_USER'] != '' ? $applicationFields['CURRENT_USER'] : '[' . G::LoadTranslation( 'ID_UNASSIGNED' ) . ']';
|
||||
|
||||
$data[] = array ('label' => $labels['PRO_TITLE'],'value' => $processData['PRO_TITLE'],'section' => $labels['TITLE1']);
|
||||
$data[] = array ("label" => $labels["TITLE"], "value" => htmlentities($applicationFields["TITLE"], ENT_QUOTES, "UTF-8"), "section" => $labels["TITLE1"]);
|
||||
$data[] = array ('label' => $labels['APP_NUMBER'],'value' => $applicationFields['APP_NUMBER'],'section' => $labels['TITLE1']);
|
||||
$data[] = array ('label' => $labels['STATUS'],'value' => $applicationFields['STATUS'],'section' => $labels['TITLE1']);
|
||||
$data[] = array ('label' => $labels['APP_UID'],'value' => $applicationFields['APP_UID'],'section' => $labels['TITLE1']);
|
||||
$data[] = array ('label' => $labels['CREATOR'],'value' => $applicationFields['CREATOR'],'section' => $labels['TITLE1']);
|
||||
$data[] = array ('label' => $labels['CREATE_DATE'],'value' => $applicationFields['CREATE_DATE'],'section' => $labels['TITLE1']);
|
||||
$data[] = array ('label' => $labels['UPDATE_DATE'],'value' => $applicationFields['UPDATE_DATE'],'section' => $labels['TITLE1']);
|
||||
$data[] = array ("label" => $labels["DESCRIPTION"], "value" => htmlentities($applicationFields["DESCRIPTION"], ENT_QUOTES, "UTF-8"), "section" => $labels["TITLE1"]);
|
||||
$data[] = array ('label' => $labelsCaseProperties['PRO_TITLE'],'value' => $processData['PRO_TITLE'],'section' => $labelsCaseProperties['TITLE1']);
|
||||
$data[] = array ("label" => $labelsCaseProperties["TITLE"], "value" => htmlentities($applicationFields["TITLE"], ENT_QUOTES, "UTF-8"), "section" => $labelsCaseProperties["TITLE1"]);
|
||||
$data[] = array ('label' => $labelsCaseProperties['APP_NUMBER'],'value' => $applicationFields['APP_NUMBER'],'section' => $labelsCaseProperties['TITLE1']);
|
||||
$data[] = array ('label' => $labelsCaseProperties['STATUS'],'value' => $applicationFields['STATUS'],'section' => $labelsCaseProperties['TITLE1']);
|
||||
$data[] = array ('label' => $labelsCaseProperties['APP_UID'],'value' => $applicationFields['APP_UID'],'section' => $labelsCaseProperties['TITLE1']);
|
||||
$data[] = array ('label' => $labelsCaseProperties['CREATOR'],'value' => $applicationFields['CREATOR'],'section' => $labelsCaseProperties['TITLE1']);
|
||||
$data[] = array ('label' => $labelsCaseProperties['CREATE_DATE'],'value' => $applicationFields['CREATE_DATE'],'section' => $labelsCaseProperties['TITLE1']);
|
||||
$data[] = array ('label' => $labelsCaseProperties['UPDATE_DATE'],'value' => $applicationFields['UPDATE_DATE'],'section' => $labelsCaseProperties['TITLE1']);
|
||||
$data[] = array ("label" => $labelsCaseProperties["DESCRIPTION"], "value" => htmlentities($applicationFields["DESCRIPTION"], ENT_QUOTES, "UTF-8"), "section" => $labelsCaseProperties["TITLE1"]);
|
||||
|
||||
// note added by krlos pacha carlos[at]colosa[dot]com
|
||||
//getting this field if it doesn't exist. Related 7994 bug
|
||||
$taskData['TAS_TITLE'] = (array_key_exists( 'TAS_TITLE', $taskData )) ? $taskData['TAS_TITLE'] : Content::Load( "TAS_TITLE", "", $applicationFields['TAS_UID'], SYS_LANG );
|
||||
$data[] = array ("label" => $labels["TAS_TITLE"], "value" => htmlentities($taskData["TAS_TITLE"], ENT_QUOTES, "UTF-8"), "section" => $labels["TITLE2"]);
|
||||
$data[] = array ('label' => $labels['CURRENT_USER'],'value' => $currentUser,'section' => $labels['TITLE2']);
|
||||
$data[] = array ('label' => $labels['DEL_DELEGATE_DATE'],'value' => $applicationFields['DEL_DELEGATE_DATE'],'section' => $labels['TITLE2']);
|
||||
$data[] = array ('label' => $labels['DEL_INIT_DATE'],'value' => $applicationFields['DEL_INIT_DATE'],'section' => $labels['TITLE2']);
|
||||
$data[] = array ('label' => $labels['DEL_TASK_DUE_DATE'],'value' => $applicationFields['DEL_TASK_DUE_DATE'],'section' => $labels['TITLE2']);
|
||||
$data[] = array ('label' => $labels['DEL_FINISH_DATE'],'value' => $applicationFields['DEL_FINISH_DATE'],'section' => $labels['TITLE2']);
|
||||
//$data[] = array('label'=>$labels['DYN_UID'] , 'value' => $processData['PRO_DYNAFORMS']['PROCESS'];, 'section'=>$labels['DYN_UID']);
|
||||
$data[] = array ("label" => $labelsCurrentTaskProperties["TAS_TITLE"], "value" => htmlentities($taskData["TAS_TITLE"], ENT_QUOTES, "UTF-8"), "section" => $labelTitleCurrentTasks["TITLE2"]);
|
||||
$data[] = array ('label' => $labelsCurrentTaskProperties['CURRENT_USER'],'value' => $currentUser,'section' => $labelTitleCurrentTasks['TITLE2']);
|
||||
$data[] = array ('label' => $labelsCurrentTaskProperties['DEL_DELEGATE_DATE'],'value' => $applicationFields['DEL_DELEGATE_DATE'],'section' => $labelTitleCurrentTasks['TITLE2']);
|
||||
$data[] = array ('label' => $labelsCurrentTaskProperties['DEL_INIT_DATE'],'value' => $applicationFields['DEL_INIT_DATE'],'section' => $labelTitleCurrentTasks['TITLE2']);
|
||||
$data[] = array ('label' => $labelsCurrentTaskProperties['DEL_TASK_DUE_DATE'],'value' => $applicationFields['DEL_TASK_DUE_DATE'],'section' => $labelTitleCurrentTasks['TITLE2']);
|
||||
$data[] = array ('label' => $labelsCurrentTaskProperties['DEL_FINISH_DATE'],'value' => $applicationFields['DEL_FINISH_DATE'],'section' => $labelTitleCurrentTasks['TITLE2']);
|
||||
//$data[] = array('label'=>$labelsCurrentTaskProperties['DYN_UID'] , 'value' => $processData['PRO_DYNAFORMS']['PROCESS'];, 'section'=>$labelsCurrentTaskProperties['DYN_UID']);
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,10 +240,6 @@ class MessageEventDefinition
|
||||
throw new \Exception(\G::LoadTranslation("ID_MESSAGE_EVENT_DEFINITION_VARIABLES_DO_NOT_MEET_DEFINITION"));
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($arrayData["MSGED_USR_UID"])) {
|
||||
$process->throwExceptionIfNotExistsUser($arrayData["MSGED_USR_UID"], $this->arrayFieldNameForException["messageEventDefinitionUserUid"]);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
@@ -295,27 +291,13 @@ class MessageEventDefinition
|
||||
$arrayData["MSGED_VARIABLES"] = array();
|
||||
}
|
||||
|
||||
if (isset($arrayData["MSGED_USR_UID"]) && $arrayData["MSGED_USR_UID"] != "") {
|
||||
$criteria = new \Criteria("workflow");
|
||||
|
||||
$criteria->addSelectColumn(\UsersPeer::USR_UID);
|
||||
$criteria->add(\UsersPeer::USR_UID, $arrayData["MSGED_USR_UID"], \Criteria::EQUAL);
|
||||
|
||||
//QUERY
|
||||
$rsCriteria = \UsersPeer::doSelectRS($criteria);
|
||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
if (!$rsCriteria->next()) {
|
||||
$arrayData["MSGED_USR_UID"] = "";
|
||||
}
|
||||
}
|
||||
|
||||
$messageEventDefinitionUid = \ProcessMaker\Util\Common::generateUID();
|
||||
|
||||
$messageEventDefinition->fromArray($arrayData, \BasePeer::TYPE_FIELDNAME);
|
||||
|
||||
$messageEventDefinition->setMsgedUid($messageEventDefinitionUid);
|
||||
$messageEventDefinition->setPrjUid($projectUid);
|
||||
$messageEventDefinition->setMsgedUsrUid("00000000000000000000000000000001"); //admin
|
||||
|
||||
if (isset($arrayData["MSGED_VARIABLES"])) {
|
||||
$messageEventDefinition->setMsgedVariables(serialize($arrayData["MSGED_VARIABLES"]));
|
||||
@@ -328,32 +310,6 @@ class MessageEventDefinition
|
||||
|
||||
$cnn->commit();
|
||||
|
||||
//Task - User
|
||||
if (isset($arrayData["MSGED_USR_UID"]) && $arrayData["MSGED_USR_UID"] != "") {
|
||||
$bpmnEvent = \BpmnEventPeer::retrieveByPK($arrayData["EVN_UID"]);
|
||||
|
||||
//Event - START-MESSAGE-EVENT
|
||||
if (!is_null($bpmnEvent) && $bpmnEvent->getEvnType() == "START" && $bpmnEvent->getEvnMarker() == "MESSAGECATCH") {
|
||||
//Message-Event-Task-Relation - Get Task
|
||||
$messageEventTaskRelation = new \ProcessMaker\BusinessModel\MessageEventTaskRelation();
|
||||
|
||||
$arrayMessageEventTaskRelationData = $messageEventTaskRelation->getMessageEventTaskRelationWhere(
|
||||
array(
|
||||
\MessageEventTaskRelationPeer::PRJ_UID => $projectUid,
|
||||
\MessageEventTaskRelationPeer::EVN_UID => $bpmnEvent->getEvnUid()
|
||||
),
|
||||
true
|
||||
);
|
||||
|
||||
if (!is_null($arrayMessageEventTaskRelationData)) {
|
||||
//Assign
|
||||
$task = new \Tasks();
|
||||
|
||||
$result = $task->assignUser($arrayMessageEventTaskRelationData["TAS_UID"], $arrayData["MSGED_USR_UID"], 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Return
|
||||
return $this->getMessageEventDefinition($messageEventDefinitionUid);
|
||||
} else {
|
||||
@@ -431,48 +387,6 @@ class MessageEventDefinition
|
||||
|
||||
$cnn->commit();
|
||||
|
||||
//Task - User
|
||||
if (isset($arrayData["MSGED_USR_UID"]) && $arrayData["MSGED_USR_UID"] != $arrayMessageEventDefinitionData["MSGED_USR_UID"]) {
|
||||
$bpmnEvent = \BpmnEventPeer::retrieveByPK($arrayMessageEventDefinitionData["EVN_UID"]);
|
||||
|
||||
//Event - START-MESSAGE-EVENT
|
||||
if (!is_null($bpmnEvent) && $bpmnEvent->getEvnType() == "START" && $bpmnEvent->getEvnMarker() == "MESSAGECATCH") {
|
||||
//Message-Event-Task-Relation - Get Task
|
||||
$messageEventTaskRelation = new \ProcessMaker\BusinessModel\MessageEventTaskRelation();
|
||||
|
||||
$arrayMessageEventTaskRelationData = $messageEventTaskRelation->getMessageEventTaskRelationWhere(
|
||||
array(
|
||||
\MessageEventTaskRelationPeer::PRJ_UID => $arrayMessageEventDefinitionData["PRJ_UID"],
|
||||
\MessageEventTaskRelationPeer::EVN_UID => $bpmnEvent->getEvnUid()
|
||||
),
|
||||
true
|
||||
);
|
||||
|
||||
if (!is_null($arrayMessageEventTaskRelationData)) {
|
||||
//Unassign
|
||||
$taskUser = new \TaskUser();
|
||||
|
||||
$criteria = new \Criteria("workflow");
|
||||
|
||||
$criteria->add(\TaskUserPeer::TAS_UID, $arrayMessageEventTaskRelationData["TAS_UID"]);
|
||||
|
||||
$rsCriteria = \TaskUserPeer::doSelectRS($criteria);
|
||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
while ($rsCriteria->next()) {
|
||||
$row = $rsCriteria->getRow();
|
||||
|
||||
$result = $taskUser->remove($row["TAS_UID"], $row["USR_UID"], $row["TU_TYPE"], $row["TU_RELATION"]);
|
||||
}
|
||||
|
||||
//Assign
|
||||
$task = new \Tasks();
|
||||
|
||||
$result = $task->assignUser($arrayMessageEventTaskRelationData["TAS_UID"], $arrayData["MSGED_USR_UID"], 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Return
|
||||
$arrayData = $arrayDataBackup;
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ class OutputDocument
|
||||
$oCriteria->addSelectColumn(\OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OPEN_PASSWORD);
|
||||
$oCriteria->addSelectColumn(\OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OWNER_PASSWORD);
|
||||
$oCriteria->addSelectColumn(\OutputDocumentPeer::OUT_DOC_PDF_SECURITY_PERMISSIONS);
|
||||
$oCriteria->addSelectColumn(\OutputDocumentPeer::OUT_DOC_OPEN_TYPE);
|
||||
$oCriteria->addAsColumn('OUT_DOC_TITLE', 'C1.CON_VALUE');
|
||||
$oCriteria->addAsColumn('OUT_DOC_DESCRIPTION', 'C2.CON_VALUE');
|
||||
$oCriteria->addAsColumn('OUT_DOC_FILENAME', 'C3.CON_VALUE');
|
||||
@@ -101,7 +102,8 @@ class OutputDocument
|
||||
'out_doc_pdf_security_enabled' => $aRow['OUT_DOC_PDF_SECURITY_ENABLED'],
|
||||
'out_doc_pdf_security_open_password' => $aRow['OUT_DOC_PDF_SECURITY_OPEN_PASSWORD'],
|
||||
'out_doc_pdf_security_owner_password' => $aRow['OUT_DOC_PDF_SECURITY_OWNER_PASSWORD'],
|
||||
'out_doc_pdf_security_permissions' => $aRow['OUT_DOC_PDF_SECURITY_PERMISSIONS']);
|
||||
'out_doc_pdf_security_permissions' => $aRow['OUT_DOC_PDF_SECURITY_PERMISSIONS'],
|
||||
"out_doc_open_type" => $aRow["OUT_DOC_OPEN_TYPE"]);
|
||||
}
|
||||
$oDataset->next();
|
||||
}
|
||||
@@ -145,6 +147,7 @@ class OutputDocument
|
||||
$oCriteria->addSelectColumn(\OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OPEN_PASSWORD);
|
||||
$oCriteria->addSelectColumn(\OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OWNER_PASSWORD);
|
||||
$oCriteria->addSelectColumn(\OutputDocumentPeer::OUT_DOC_PDF_SECURITY_PERMISSIONS);
|
||||
$oCriteria->addSelectColumn(\OutputDocumentPeer::OUT_DOC_OPEN_TYPE);
|
||||
$oCriteria->add(\OutputDocumentPeer::OUT_DOC_UID, $sOutputDocumentUID);
|
||||
$oCriteria->addAsColumn('OUT_DOC_TITLE', 'C1.CON_VALUE');
|
||||
$oCriteria->addAsColumn('OUT_DOC_DESCRIPTION', 'C2.CON_VALUE');
|
||||
@@ -209,7 +212,8 @@ class OutputDocument
|
||||
'out_doc_pdf_security_enabled' => $aRow['OUT_DOC_PDF_SECURITY_ENABLED'],
|
||||
'out_doc_pdf_security_open_password' => $aRow['OUT_DOC_PDF_SECURITY_OPEN_PASSWORD'],
|
||||
'out_doc_pdf_security_owner_password' => $aRow['OUT_DOC_PDF_SECURITY_OWNER_PASSWORD'],
|
||||
'out_doc_pdf_security_permissions' => $aRow['OUT_DOC_PDF_SECURITY_PERMISSIONS']);
|
||||
'out_doc_pdf_security_permissions' => $aRow['OUT_DOC_PDF_SECURITY_PERMISSIONS'],
|
||||
"out_doc_open_type" => $aRow["OUT_DOC_OPEN_TYPE"]);
|
||||
}
|
||||
$oDataset->next();
|
||||
}
|
||||
|
||||
@@ -602,7 +602,8 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
if ($elementType == "bpmnEvent" &&
|
||||
in_array($key, array("end-message-event", "start-message-event", "intermediate-catch-message-event"))
|
||||
) {
|
||||
if ($key == "intermediate-catch-message-event") {
|
||||
|
||||
if (in_array($key, array("start-message-event", "intermediate-catch-message-event"))) {
|
||||
//Task - User
|
||||
//Assign to admin
|
||||
$task = new \Tasks();
|
||||
|
||||
@@ -222,5 +222,10 @@ class OutputDocumentStructure
|
||||
* @var string {@from body} {@min 0} {@max 150}
|
||||
*/
|
||||
public $out_doc_pdf_security_permissions;
|
||||
|
||||
/**
|
||||
* @var int {@from body} {@choice 0,1}
|
||||
*/
|
||||
public $out_doc_open_type;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,5 +30,5 @@
|
||||
</UPDATE_DATE>
|
||||
<DESCRIPTION type="text" mode="view">
|
||||
<en><![CDATA[Case Description]]></en>
|
||||
</DESCRIPTION>
|
||||
</DESCRIPTION>
|
||||
</dynaForm>
|
||||
|
||||
Reference in New Issue
Block a user