Merged colosa/processmaker into master

This commit is contained in:
Richard Yujra
2015-03-05 15:00:12 -04:00
13 changed files with 136 additions and 68 deletions

View File

@@ -21,7 +21,7 @@ EOT
/*----------------------------------********---------------------------------*/
CLI::taskName('change-password-hash-method');
CLI::taskDescription(<<<EOT
Change password hash method to md5 or sha256 for the specified workspace
Change password hash method to md5 or sha256 for the specified workspace
EOT
);
CLI::taskArg('workspace', false);

View File

@@ -414,7 +414,7 @@ class calendar extends CalendarDefinition
$hoursDuration -= (float)($secondRes/3600);
//$dataLog[] = (float)($secondRes/3600);
} else {
$newDate = date('Y-m-d H:i:s', strtotime('+' . (((float)$hoursDuration)*3600) . ' seconds', strtotime($newDate)));
$newDate = date("Y-m-d H:i:s", strtotime("+" . round(((float)($hoursDuration)) * 3600) . " seconds", strtotime($newDate)));
//$dataLog[] = (float)($hoursDuration);
$hoursDuration = 0;
}
@@ -797,4 +797,4 @@ class calendar extends CalendarDefinition
}
}
?>
?>

View File

@@ -213,7 +213,15 @@ class NET
}
$stat = new Stat();
$flagTns = (isset($arrayServerData["connectionType"]) && $arrayServerData["connectionType"] == "TNS")? 1 : 0;
if (array_key_exists("connectionType", $arrayServerData) || array_key_exists("DBS_TYPEORACLE", $arrayServerData)) {
if ($arrayServerData["connectionType"] == "TNS" || $arrayServerData["DBS_TYPEORACLE"] == "TNS") {
$flagTns=1;
}else{
$flagTns=0;
}
}else{
$flagTns=0;
}
if (isset($this->db_user) && (isset($this->db_passwd) || $this->db_passwd == "") && (isset($this->db_sourcename) || $flagTns == 1)) {
switch ($pDbDriver) {
@@ -323,7 +331,15 @@ class NET
set_time_limit( 0 );
$stat = new Stat();
$flagTns = (isset($arrayServerData["connectionType"]) && $arrayServerData["connectionType"] == "TNS")? 1 : 0;
if (array_key_exists("connectionType", $arrayServerData) || array_key_exists("DBS_TYPEORACLE", $arrayServerData)) {
if ($arrayServerData["connectionType"] == "TNS" || $arrayServerData["DBS_TYPEORACLE"] == "TNS") {
$flagTns=1;
}else{
$flagTns=0;
}
}else{
$flagTns=0;
}
if (isset($this->db_user) && (isset($this->db_passwd) || $this->db_passwd == "") && (isset($this->db_sourcename) || $flagTns == 1)) {
switch ($pDbDriver) {

View File

@@ -885,7 +885,7 @@ function PMFSendMessage(
if ($result->status_code == 0) {
return 1;
} else {
error_log($result->message);
error_log($result->message);
return 0;
}
}
@@ -1402,8 +1402,8 @@ function WSUnpauseCase ($caseUid, $delIndex, $userUid)
*
* Add a case note.
*
* @name WSAddCaseNote
* @label WS Add case note
* @name WSAddACaseNote
* @label WS Add a case note
* @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#WSAddCaseNote.28.29
*
* @param string(32) | $caseUid | ID of the case | The unique ID of the case.
@@ -1539,8 +1539,8 @@ function PMFUserList () //its test was successfull
*
* Add an Input Document.
*
* @name PMFAddInputDocument
* @label PMF Add a input document
* @name PMFAddAnInputDocument
* @label PMF Add an input document
* @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#PMFAddInputDocument.28.29
*
* @param string(32) | $inputDocumentUid | ID of the input document | The unique ID of the input document.
@@ -2773,8 +2773,8 @@ function PMFUnpauseCase ($caseUid, $delIndex, $userUid)
*
* Add case note.
*
* @name PMFAddCaseNote
* @label PMF Add case note
* @name PMFAddACaseNote
* @label PMF Add a case note
* @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#PMFAddCaseNote.28.29
*
* @param string(32) | $caseUid | ID of the case | The unique ID of the case.

View File

@@ -1516,9 +1516,20 @@ class Processes
{
foreach ($SubProcess as $key => $row) {
$oSubProcess = new SubProcess();
if ($oSubProcess->subProcessExists( $row['SP_UID'] )) {
$oSubProcess->remove( $row['SP_UID'] );
}
//if ($oSubProcess->subProcessExists( $row['SP_UID'] )) {
// $oSubProcess->remove( $row['SP_UID'] );
//}
//Delete
$criteria = new Criteria("workflow");
$criteria->add(SubProcessPeer::PRO_PARENT, $row["PRO_PARENT"], Criteria::EQUAL);
$criteria->add(SubProcessPeer::TAS_PARENT, $row["TAS_PARENT"], Criteria::EQUAL);
$result = SubProcessPeer::doDelete($criteria);
//Create
$res = $oSubProcess->create( $row );
}
return;
@@ -2279,14 +2290,16 @@ class Processes
try {
$map = array();
foreach ($data->messageType as $key => $value) {
$record = $value;
if (isset($data->messageType)) {
foreach ($data->messageType as $key => $value) {
$record = $value;
if (isset($record["MSGT_UID"])) {
$newUid = $this->getUnusedMessageTypeUid();
if (isset($record["MSGT_UID"])) {
$newUid = $this->getUnusedMessageTypeUid();
$map[$record["MSGT_UID"]] = $newUid;
$data->messageType[$key]["MSGT_UID"] = $newUid;
$map[$record["MSGT_UID"]] = $newUid;
$data->messageType[$key]["MSGT_UID"] = $newUid;
}
}
}
@@ -2333,14 +2346,16 @@ class Processes
try {
$map = array();
foreach ($data->messageTypeVariable as $key => $value) {
$record = $value;
if (isset($data->messageTypeVariable)) {
foreach ($data->messageTypeVariable as $key => $value) {
$record = $value;
if (isset($record["MSGTV_UID"])) {
$newUid = $this->getUnusedMessageTypeVariableUid();
if (isset($record["MSGTV_UID"])) {
$newUid = $this->getUnusedMessageTypeVariableUid();
$map[$record["MSGTV_UID"]] = $newUid;
$data->messageTypeVariable[$key]["MSGTV_UID"] = $newUid;
$map[$record["MSGTV_UID"]] = $newUid;
$data->messageTypeVariable[$key]["MSGTV_UID"] = $newUid;
}
}
}

View File

@@ -201,7 +201,7 @@ class OutputDocument extends BaseOutputDocument
}
$description .= ", By clicking on the generated file link: ".$genLink;
G::auditLog("CreateOutputDocument", $description);
return $aData['OUT_DOC_UID'];
} else {
$sMessage = '';
@@ -329,9 +329,11 @@ class OutputDocument extends BaseOutputDocument
Content::removeContent('OUT_DOC_TEMPLATE', '', $oOutputDocument->getOutDocUid());
$iResult = $oOutputDocument->delete();
$oConnection->commit();
//Add Audit Log
G::auditLog("DeleteOutputDocument", "Output Document Name: ".$outputName.", Output Document Uid: ".$sOutDocUid.", Description: ".$outputDesc.", Filename generated: ".$outputFile);
//Add Audit Log
G::auditLog("DeleteOutputDocument", "Output Document Name: " . $oOutputDocument->getOutDocTitle() . ", Output Document Uid: " . $sOutDocUid . ", Description: " . $oOutputDocument->getOutDocDescription() . ", Filename generated: " . $oOutputDocument->getOutDocFilename());
//Return
return $iResult;
} else {
throw (new Exception('This row doesn\'t exist!'));
@@ -845,7 +847,7 @@ class OutputDocument extends BaseOutputDocument
$sContent = str_ireplace("</font>", "</span>", $sContent);
$sContent = str_replace($nrthtml, $nrt, $sContent);
$sContent = str_replace("margin-left", "text-indent", $sContent);
// define Save file

View File

@@ -189,7 +189,7 @@ class Triggers extends BaseTriggers
$description .= ", Description: ".$aData['TRI_DESCRIPTION'];
}
G::auditLog("CreateTrigger", $description);
return $result;
} else {
$con->rollback();
@@ -240,18 +240,14 @@ class Triggers extends BaseTriggers
$con->begin();
$oTri = TriggersPeer::retrieveByPK( $TriUid );
if (!is_null($oTri)) {
$triggerName = $this->getTriTitle();
$triggerDesc = $this->getTriDescription();
Content::removeContent( 'TRI_TITLE', '', $this->getTriUid());
Content::removeContent( 'TRI_DESCRIPTION', '', $this->getTriUid());
Content::removeContent("TRI_TITLE", "", $TriUid);
Content::removeContent("TRI_DESCRIPTION", "", $TriUid);
$result = $oTri->delete();
$con->commit();
//Add Audit Log
$description = "Trigger Name: ".$triggerName.", Trigger Uid: ".$TriUid;
if (isset ( $triggerDesc )) {
$description .= ", Description: ".$triggerDesc;
}
G::auditLog("DeleteTrigger", $description);
G::auditLog("DeleteTrigger", "Trigger Name: " . $oTri->getTriTitle() . ", Trigger Uid: " . $TriUid . ", Description: " . $oTri->getTriDescription());
}
return $result;
} catch (Exception $e) {

View File

@@ -462,6 +462,7 @@ try {
break;
case 5:
$sType = 'SEC-JOIN';
$oProcessNewPattern = new Process();
$taskProcess=$oProcessNewPattern->load($oData->pro_uid);
$titleProcess=$taskProcess['PRO_TITLE'];
$oTaskNewPattern = new Task();
@@ -478,6 +479,7 @@ try {
break;
case 8:
$sType = 'DISCRIMINATOR';
$oProcessNewPattern = new Process();
$taskProcess=$oProcessNewPattern->load($oData->pro_uid);
$titleProcess=$taskProcess['PRO_TITLE'];
$oTaskNewPattern = new Task();

View File

@@ -73,8 +73,7 @@ abstract class Importer
{
$this->prepare();
$name = $this->importData["tables"]["bpmn"]["project"][0]["prj_name"];
//Verify data
switch ($option) {
case self::IMPORT_OPTION_CREATE_NEW:
if ($this->targetExists()) {
@@ -94,23 +93,12 @@ abstract class Importer
self::IMPORT_STAT_TARGET_ALREADY_EXISTS
);
}
$generateUid = false;
break;
case self::IMPORT_OPTION_OVERWRITE:
$this->removeProject();
// this option shouldn't generate new uid for all objects
$generateUid = false;
break;
case self::IMPORT_OPTION_DISABLE_AND_CREATE_NEW:
$this->disableProject();
// this option should generate new uid for all objects
$generateUid = true;
$name = "New - " . $name . " - " . date("M d, H:i");
break;
case self::IMPORT_OPTION_KEEP_WITHOUT_CHANGING_AND_CREATE_NEW:
// this option should generate new uid for all objects
$generateUid = true;
$name = \G::LoadTranslation("ID_COPY_OF") . " - " . $name . " - " . date("M d, H:i");
break;
}
@@ -149,6 +137,36 @@ abstract class Importer
break;
}
//Import
$name = $this->importData["tables"]["bpmn"]["project"][0]["prj_name"];
switch ($option) {
case self::IMPORT_OPTION_CREATE_NEW:
//Shouldn't generate new UID for all objects
$generateUid = false;
break;
case self::IMPORT_OPTION_OVERWRITE:
//Shouldn't generate new UID for all objects
$this->removeProject();
$generateUid = false;
break;
case self::IMPORT_OPTION_DISABLE_AND_CREATE_NEW:
//Should generate new UID for all objects
$this->disableProject();
$name = "New - " . $name . " - " . date("M d, H:i");
$generateUid = true;
break;
case self::IMPORT_OPTION_KEEP_WITHOUT_CHANGING_AND_CREATE_NEW:
//Should generate new UID for all objects
$name = \G::LoadTranslation("ID_COPY_OF") . " - " . $name . " - " . date("M d, H:i");
$generateUid = true;
break;
}
$this->importData["tables"]["bpmn"]["project"][0]["prj_name"] = $name;
$this->importData["tables"]["bpmn"]["diagram"][0]["dia_name"] = $name;
$this->importData["tables"]["bpmn"]["process"][0]["pro_name"] = $name;

View File

@@ -764,6 +764,13 @@ class Workflow extends Handler
$oCriteria->add(\CaseTrackerObjectPeer::PRO_UID, $sProcessUID);
\ProcessUserPeer::doDelete($oCriteria);
//Delete SubProcess
$criteria = new \Criteria("workflow");
$criteria->add(\SubProcessPeer::PRO_PARENT, $sProcessUID, \Criteria::EQUAL);
$result = \SubProcessPeer::doDelete($criteria);
//Delete WebEntries
$webEntry = new \ProcessMaker\BusinessModel\WebEntry();

View File

@@ -30,7 +30,15 @@ function formatAMPM(date, initVal) {
minutes = minutes < 10 ? '0'+minutes : minutes;
var strTime = hours + ':' + minutes + ' ' + ampm;
return strTime;
}
};
function isBrowserIE(){
if ( (navigator.userAgent.indexOf("MSIE")!=-1) || (navigator.userAgent.indexOf("Trident")!=-1) ){
return true;
} else {
return false;
}
};
Ext.onReady(function(){
openToRevisePanel = function() {
@@ -1531,20 +1539,24 @@ Ext.onReady(function(){
TabPanel.setActiveTab(tabId);
}
else {
TabPanel.add({
id: tabId,
title: menuSelectedTitle[name],
frameConfig: {name: name + 'Frame', id: name + 'Frame'},
defaultSrc: uri,
loadMask: {msg: _('ID_LOADING_GRID') + '...'},
autoWidth: true,
closable: true,
autoScroll: true,
bodyStyle: {height: (PMExt.getBrowser().screen.height - 60) + 'px', overflow: 'auto'}
}).show();
if(!isBrowserIE()){
TabPanel.add({
id: tabId,
title: menuSelectedTitle[name],
frameConfig: {name: name + 'Frame', id: name + 'Frame'},
defaultSrc: uri,
loadMask: {msg: _('ID_LOADING_GRID') + '...'},
autoWidth: true,
closable: true,
autoScroll: true,
bodyStyle: {height: (PMExt.getBrowser().screen.height - 60) + 'px', overflow: 'auto'}
}).show();
TabPanel.doLayout();
}
TabPanel.doLayout();
}else{
var windContainer = window.open(uri,"winContainer");
}
}
}
},
failure: function ( result, request) {