CODE STYLE, changes...
FILES: workflow/engine/classes/class.derivation.php workflow/engine/classes/class.popupMenu.php workflow/engine/classes/class.processes.php workflow/engine/classes/class.xmlDb.php workflow/engine/classes/triggers/api/class.zimbraApi.php
This commit is contained in:
@@ -369,8 +369,9 @@ class Derivation
|
|||||||
$uidUser = $users[0];
|
$uidUser = $users[0];
|
||||||
$i = count( $users ) - 1;
|
$i = count( $users ) - 1;
|
||||||
while ($i > 0) {
|
while ($i > 0) {
|
||||||
if ($lastAssigned < $users[$i])
|
if ($lastAssigned < $users[$i]) {
|
||||||
$uidUser = $users[$i];
|
$uidUser = $users[$i];
|
||||||
|
}
|
||||||
$i --;
|
$i --;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -397,10 +398,10 @@ class Derivation
|
|||||||
} else {
|
} else {
|
||||||
throw (new Exception( "Task doesn't have a valid user in variable $variable." ));
|
throw (new Exception( "Task doesn't have a valid user in variable $variable." ));
|
||||||
}
|
}
|
||||||
} else
|
} else {
|
||||||
throw (new Exception( "Task doesn't have a valid user in variable $variable or this variable doesn't exist." ));
|
throw (new Exception( "Task doesn't have a valid user in variable $variable or this variable doesn't exist." ));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'REPORT_TO':
|
case 'REPORT_TO':
|
||||||
//default error user when the reportsTo is not assigned to that user
|
//default error user when the reportsTo is not assigned to that user
|
||||||
//look for USR_REPORTS_TO to this user
|
//look for USR_REPORTS_TO to this user
|
||||||
@@ -423,7 +424,6 @@ class Derivation
|
|||||||
throw (new Exception( G::LoadTranslation( 'ID_MSJ_REPORSTO' ) )); // "The current user does not have a valid Reports To user. Please contact administrator.") ) ;
|
throw (new Exception( G::LoadTranslation( 'ID_MSJ_REPORSTO' ) )); // "The current user does not have a valid Reports To user. Please contact administrator.") ) ;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'SELF_SERVICE':
|
case 'SELF_SERVICE':
|
||||||
//look for USR_REPORTS_TO to this user
|
//look for USR_REPORTS_TO to this user
|
||||||
$userFields['USR_UID'] = '';
|
$userFields['USR_UID'] = '';
|
||||||
@@ -433,7 +433,6 @@ class Derivation
|
|||||||
$userFields['USR_LASTNAME'] = '';
|
$userFields['USR_LASTNAME'] = '';
|
||||||
$userFields['USR_EMAIL'] = '';
|
$userFields['USR_EMAIL'] = '';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw (new Exception( 'Invalid Task Assignment method for Next Task ' ));
|
throw (new Exception( 'Invalid Task Assignment method for Next Task ' ));
|
||||||
}
|
}
|
||||||
@@ -445,7 +444,8 @@ class Derivation
|
|||||||
* @param string $USR_UID
|
* @param string $USR_UID
|
||||||
* @return string $aRow['USR_REPORTS_TO']
|
* @return string $aRow['USR_REPORTS_TO']
|
||||||
*/
|
*/
|
||||||
function getDenpendentUser($USR_UID) {
|
function getDenpendentUser ($USR_UID)
|
||||||
|
{
|
||||||
//Here the uid to next user
|
//Here the uid to next user
|
||||||
$oC = new Criteria();
|
$oC = new Criteria();
|
||||||
$oC->addSelectColumn( UsersPeer::USR_REPORTS_TO );
|
$oC->addSelectColumn( UsersPeer::USR_REPORTS_TO );
|
||||||
@@ -484,10 +484,12 @@ class Derivation
|
|||||||
function derivate ($currentDelegation = array(), $nextDelegations = array())
|
function derivate ($currentDelegation = array(), $nextDelegations = array())
|
||||||
{
|
{
|
||||||
//define this...
|
//define this...
|
||||||
if (! defined( 'TASK_FINISH_PROCESS' ))
|
if (! defined( 'TASK_FINISH_PROCESS' )) {
|
||||||
define( 'TASK_FINISH_PROCESS', - 1 );
|
define( 'TASK_FINISH_PROCESS', - 1 );
|
||||||
if (! defined( 'TASK_FINISH_TASK' ))
|
}
|
||||||
|
if (! defined( 'TASK_FINISH_TASK' )) {
|
||||||
define( 'TASK_FINISH_TASK', - 2 );
|
define( 'TASK_FINISH_TASK', - 2 );
|
||||||
|
}
|
||||||
|
|
||||||
$this->case = new cases();
|
$this->case = new cases();
|
||||||
|
|
||||||
@@ -537,12 +539,10 @@ class Derivation
|
|||||||
$this->case->closeAllThreads( $currentDelegation['APP_UID'] );
|
$this->case->closeAllThreads( $currentDelegation['APP_UID'] );
|
||||||
//I think we need to change the APP_STATUS to completed,
|
//I think we need to change the APP_STATUS to completed,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TASK_FINISH_TASK:
|
case TASK_FINISH_TASK:
|
||||||
$iAppThreadIndex = $appFields['DEL_THREAD'];
|
$iAppThreadIndex = $appFields['DEL_THREAD'];
|
||||||
$this->case->closeAppThread( $currentDelegation['APP_UID'], $iAppThreadIndex );
|
$this->case->closeAppThread( $currentDelegation['APP_UID'], $iAppThreadIndex );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// get all siblingThreads
|
// get all siblingThreads
|
||||||
//if($currentDelegation['TAS_ASSIGN_TYPE'] == 'STATIC_MI')
|
//if($currentDelegation['TAS_ASSIGN_TYPE'] == 'STATIC_MI')
|
||||||
@@ -552,25 +552,27 @@ class Derivation
|
|||||||
$siblingThreads = $this->case->GetAllOpenDelegation( $currentDelegation );
|
$siblingThreads = $this->case->GetAllOpenDelegation( $currentDelegation );
|
||||||
$aData = $this->case->loadCase( $currentDelegation['APP_UID'] );
|
$aData = $this->case->loadCase( $currentDelegation['APP_UID'] );
|
||||||
|
|
||||||
if (isset( $aData['APP_DATA'][str_replace( '@@', '', $currentDelegation['TAS_MI_INSTANCE_VARIABLE'] )] ))
|
if (isset( $aData['APP_DATA'][str_replace( '@@', '', $currentDelegation['TAS_MI_INSTANCE_VARIABLE'] )] )) {
|
||||||
$sMIinstanceVar = $aData['APP_DATA'][str_replace( '@@', '', $currentDelegation['TAS_MI_INSTANCE_VARIABLE'] )];
|
$sMIinstanceVar = $aData['APP_DATA'][str_replace( '@@', '', $currentDelegation['TAS_MI_INSTANCE_VARIABLE'] )];
|
||||||
else
|
} else {
|
||||||
$sMIinstanceVar = $aData['APP_DATA']['TAS_MI_INSTANCE_VARIABLE'];
|
$sMIinstanceVar = $aData['APP_DATA']['TAS_MI_INSTANCE_VARIABLE'];
|
||||||
|
}
|
||||||
|
|
||||||
if (isset( $aData['APP_DATA'][str_replace( '@@', '', $currentDelegation['TAS_MI_COMPLETE_VARIABLE'] )] ))
|
if (isset( $aData['APP_DATA'][str_replace( '@@', '', $currentDelegation['TAS_MI_COMPLETE_VARIABLE'] )] )) {
|
||||||
$sMIcompleteVar = $aData['APP_DATA'][str_replace( '@@', '', $currentDelegation['TAS_MI_COMPLETE_VARIABLE'] )];
|
$sMIcompleteVar = $aData['APP_DATA'][str_replace( '@@', '', $currentDelegation['TAS_MI_COMPLETE_VARIABLE'] )];
|
||||||
else
|
} else {
|
||||||
$sMIcompleteVar = $aData['APP_DATA']['TAS_MI_COMPLETE_VARIABLE'];
|
$sMIcompleteVar = $aData['APP_DATA']['TAS_MI_COMPLETE_VARIABLE'];
|
||||||
|
}
|
||||||
|
|
||||||
$discriminateThread = $sMIinstanceVar - $sMIcompleteVar;
|
$discriminateThread = $sMIinstanceVar - $sMIcompleteVar;
|
||||||
|
|
||||||
// -1 because One App Delegation is closed by above Code
|
// -1 because One App Delegation is closed by above Code
|
||||||
if ($discriminateThread == count( $siblingThreads ))
|
if ($discriminateThread == count( $siblingThreads )) {
|
||||||
$canDerivate = true;
|
$canDerivate = true;
|
||||||
else
|
} else {
|
||||||
$canDerivate = false;
|
$canDerivate = false;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if ($currentDelegation['ROU_TYPE'] == 'SEC-JOIN') {
|
if ($currentDelegation['ROU_TYPE'] == 'SEC-JOIN') {
|
||||||
$siblingThreads = $this->case->getOpenSiblingThreads( $nextDel['TAS_UID'], $currentDelegation['APP_UID'], $currentDelegation['DEL_INDEX'], $currentDelegation['TAS_UID'], $currentDelegation['ROU_TYPE'] );
|
$siblingThreads = $this->case->getOpenSiblingThreads( $nextDel['TAS_UID'], $currentDelegation['APP_UID'], $currentDelegation['DEL_INDEX'], $currentDelegation['TAS_UID'], $currentDelegation['ROU_TYPE'] );
|
||||||
@@ -581,10 +583,11 @@ class Derivation
|
|||||||
$siblingThreadsCount = count( $siblingThreads );
|
$siblingThreadsCount = count( $siblingThreads );
|
||||||
$discriminateThread = $currentDelegation['ROU_CONDITION'];
|
$discriminateThread = $currentDelegation['ROU_CONDITION'];
|
||||||
//$checkThread = count($totalThreads) - $cond;
|
//$checkThread = count($totalThreads) - $cond;
|
||||||
if ($discriminateThread == $siblingThreadsCount)
|
if ($discriminateThread == $siblingThreadsCount) {
|
||||||
$canDerivate = true;
|
$canDerivate = true;
|
||||||
else
|
} else {
|
||||||
$canDerivate = false;
|
$canDerivate = false;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$canDerivate = true;
|
$canDerivate = true;
|
||||||
}
|
}
|
||||||
@@ -594,7 +597,8 @@ class Derivation
|
|||||||
if ($canDerivate) {
|
if ($canDerivate) {
|
||||||
$aSP = isset( $aSP ) ? $aSP : null;
|
$aSP = isset( $aSP ) ? $aSP : null;
|
||||||
$iNewDelIndex = $this->doDerivation( $currentDelegation, $nextDel, $appFields, $aSP );
|
$iNewDelIndex = $this->doDerivation( $currentDelegation, $nextDel, $appFields, $aSP );
|
||||||
} else { //when the task doesnt generate a new AppDelegation
|
} else {
|
||||||
|
//when the task doesnt generate a new AppDelegation
|
||||||
$iAppThreadIndex = $appFields['DEL_THREAD'];
|
$iAppThreadIndex = $appFields['DEL_THREAD'];
|
||||||
switch ($currentDelegation['ROU_TYPE']) {
|
switch ($currentDelegation['ROU_TYPE']) {
|
||||||
case 'DISCRIMINATOR':
|
case 'DISCRIMINATOR':
|
||||||
@@ -602,8 +606,9 @@ class Derivation
|
|||||||
$this->case->closeAppThread( $currentDelegation['APP_UID'], $iAppThreadIndex );
|
$this->case->closeAppThread( $currentDelegation['APP_UID'], $iAppThreadIndex );
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if ($currentDelegation['TAS_ASSIGN_TYPE'] == 'STATIC_MI' || $currentDelegation['TAS_ASSIGN_TYPE'] == 'CANCEL_MI')
|
if ($currentDelegation['TAS_ASSIGN_TYPE'] == 'STATIC_MI' || $currentDelegation['TAS_ASSIGN_TYPE'] == 'CANCEL_MI') {
|
||||||
$this->case->closeAppThread( $currentDelegation['APP_UID'], $iAppThreadIndex );
|
$this->case->closeAppThread( $currentDelegation['APP_UID'], $iAppThreadIndex );
|
||||||
|
}
|
||||||
} //switch
|
} //switch
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -674,12 +679,11 @@ class Derivation
|
|||||||
$iNewThreadIndex = $this->case->newAppThread( $currentDelegation['APP_UID'], $iMIDelIndex, $iAppThreadIndex );
|
$iNewThreadIndex = $this->case->newAppThread( $currentDelegation['APP_UID'], $iMIDelIndex, $iAppThreadIndex );
|
||||||
|
|
||||||
//Setting the del Index for Updating the AppThread delIndex
|
//Setting the del Index for Updating the AppThread delIndex
|
||||||
if ($key == 0)
|
if ($key == 0) {
|
||||||
$iNewDelIndex = $iMIDelIndex - 1;
|
$iNewDelIndex = $iMIDelIndex - 1;
|
||||||
|
}
|
||||||
} //end foreach
|
} //end foreach
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'BALANCED':
|
case 'BALANCED':
|
||||||
$this->setTasLastAssigned( $nextDel['TAS_UID'], $nextDel['USR_UID'] );
|
$this->setTasLastAssigned( $nextDel['TAS_UID'], $nextDel['USR_UID'] );
|
||||||
//No Break, need no execute the default ones....
|
//No Break, need no execute the default ones....
|
||||||
@@ -699,13 +703,10 @@ class Derivation
|
|||||||
$this->case->updateAppDelegation( $currentDelegation['APP_UID'], $iNewDelIndex, $iNewThreadIndex );
|
$this->case->updateAppDelegation( $currentDelegation['APP_UID'], $iNewDelIndex, $iNewThreadIndex );
|
||||||
//print " this->case->updateAppDelegation ( " . $currentDelegation['APP_UID'] .", " . $iNewDelIndex ." , " . $iNewThreadIndex . " )<br>";
|
//print " this->case->updateAppDelegation ( " . $currentDelegation['APP_UID'] .", " . $iNewDelIndex ." , " . $iNewThreadIndex . " )<br>";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'DISCRIMINATOR':
|
case 'DISCRIMINATOR':
|
||||||
if ($currentDelegation['ROU_OPTIONAL'] == 'TRUE') {
|
if ($currentDelegation['ROU_OPTIONAL'] == 'TRUE') {
|
||||||
$this->case->discriminateCases( $currentDelegation );
|
$this->case->discriminateCases( $currentDelegation );
|
||||||
} //No Break, executing Default Condition
|
} //No Break, executing Default Condition
|
||||||
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
switch ($currentDelegation['TAS_ASSIGN_TYPE']) {
|
switch ($currentDelegation['TAS_ASSIGN_TYPE']) {
|
||||||
case 'CANCEL_MI':
|
case 'CANCEL_MI':
|
||||||
@@ -968,5 +969,5 @@ class Derivation
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* class.popupMenu.php
|
* class.popupMenu.php
|
||||||
|
*
|
||||||
* @package workflow.engine.ProcessMaker
|
* @package workflow.engine.ProcessMaker
|
||||||
*
|
*
|
||||||
* ProcessMaker Open Source Edition
|
* ProcessMaker Open Source Edition
|
||||||
@@ -24,9 +26,9 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* popupMenu - popupMenu class
|
* popupMenu - popupMenu class
|
||||||
|
*
|
||||||
* @package workflow.engine.ProcessMaker
|
* @package workflow.engine.ProcessMaker
|
||||||
* @copyright COLOSA
|
* @copyright COLOSA
|
||||||
*/
|
*/
|
||||||
@@ -38,6 +40,7 @@ class popupMenu extends form
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Print the popup
|
* Print the popup
|
||||||
|
*
|
||||||
* @param string $tableId
|
* @param string $tableId
|
||||||
* @param array $tableFields
|
* @param array $tableFields
|
||||||
* @return array
|
* @return array
|
||||||
@@ -57,14 +60,8 @@ class popupMenu extends form
|
|||||||
default:
|
default:
|
||||||
$label = ($tableFields[$f]['Label'] != '') ? $tableFields[$f]['Label'] : $f;
|
$label = ($tableFields[$f]['Label'] != '') ? $tableFields[$f]['Label'] : $f;
|
||||||
$label = str_replace( "\n", ' ', $label );
|
$label = str_replace( "\n", ' ', $label );
|
||||||
$pmXmlNode = new Xml_Node( $f,
|
$pmXmlNode = new Xml_Node( $f, 'complete', '', array ('label' => $label,'type' => 'popupOption','launch' => $tableId . '.showHideField("' . $f . '")'
|
||||||
'complete',
|
) );
|
||||||
'',
|
|
||||||
array ( 'label' => $label,
|
|
||||||
'type' => 'popupOption',
|
|
||||||
'launch' => $tableId . '.showHideField("' . $f . '")'
|
|
||||||
)
|
|
||||||
);
|
|
||||||
$this->fields[$f] = new XmlForm_Field_popupOption( $pmXmlNode );
|
$this->fields[$f] = new XmlForm_Field_popupOption( $pmXmlNode );
|
||||||
$this->values[$f] = '';
|
$this->values[$f] = '';
|
||||||
}
|
}
|
||||||
@@ -79,6 +76,7 @@ class popupMenu extends form
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* XmlForm_Field_popupOption - XmlForm_Field_popupOption class
|
* XmlForm_Field_popupOption - XmlForm_Field_popupOption class
|
||||||
|
*
|
||||||
* @package workflow.engine.ProcessMaker
|
* @package workflow.engine.ProcessMaker
|
||||||
* @copyright COLOSA
|
* @copyright COLOSA
|
||||||
*/
|
*/
|
||||||
@@ -89,13 +87,13 @@ class XmlForm_Field_popupOption extends XmlForm_Field
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Events
|
* Get Events
|
||||||
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function getEvents ()
|
function getEvents ()
|
||||||
{
|
{
|
||||||
$script = '{name:"' . $this->name . '",text:"' . addcslashes($this->label,'\\"') .
|
$script = '{name:"' . $this->name . '",text:"' . addcslashes( $this->label, '\\"' ) . '", launch:leimnud.closure({Function:function(target){' . $this->launch . '}, args:target})}';
|
||||||
'", launch:leimnud.closure({Function:function(target){' . $this->launch . '}, args:target})}';
|
|
||||||
return $script;
|
return $script;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ G::LoadThirdParty( 'pear/json', 'class.json' );
|
|||||||
|
|
||||||
class Processes
|
class Processes
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* change Status of any Process
|
* change Status of any Process
|
||||||
*
|
*
|
||||||
@@ -2493,6 +2494,7 @@ class Processes
|
|||||||
}
|
}
|
||||||
#@!neyek
|
#@!neyek
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update Report Tables from an array of data
|
* Update Report Tables from an array of data
|
||||||
*
|
*
|
||||||
@@ -2646,6 +2648,7 @@ class Processes
|
|||||||
$bytesSaved += fwrite( $fp, $fsXmlGuid ); //writing the size of xml file
|
$bytesSaved += fwrite( $fp, $fsXmlGuid ); //writing the size of xml file
|
||||||
$bytesSaved += fwrite( $fp, $xmlGuid ); //writing the xmlfile
|
$bytesSaved += fwrite( $fp, $xmlGuid ); //writing the xmlfile
|
||||||
|
|
||||||
|
|
||||||
$xmlContent = file_get_contents( $sFileName );
|
$xmlContent = file_get_contents( $sFileName );
|
||||||
$fsXmlContent = sprintf( "%09d", strlen( $xmlContent ) );
|
$fsXmlContent = sprintf( "%09d", strlen( $xmlContent ) );
|
||||||
$bytesSaved += fwrite( $fp, $fsXmlContent ); //writing the size of xml file
|
$bytesSaved += fwrite( $fp, $fsXmlContent ); //writing the size of xml file
|
||||||
@@ -2706,6 +2709,7 @@ class Processes
|
|||||||
$bytesSaved += fwrite( $fp, $fsFileName ); //writing the fileName size
|
$bytesSaved += fwrite( $fp, $fsFileName ); //writing the fileName size
|
||||||
$bytesSaved += fwrite( $fp, $filename ); //writing the fileName size
|
$bytesSaved += fwrite( $fp, $filename ); //writing the fileName size
|
||||||
|
|
||||||
|
|
||||||
$fileContent = file_get_contents( $sFileName );
|
$fileContent = file_get_contents( $sFileName );
|
||||||
$fsFileContent = sprintf( "%09d", strlen( $fileContent ) );
|
$fsFileContent = sprintf( "%09d", strlen( $fileContent ) );
|
||||||
$bytesSaved += fwrite( $fp, $fsFileContent ); //writing the size of xml file
|
$bytesSaved += fwrite( $fp, $fsFileContent ); //writing the size of xml file
|
||||||
@@ -2811,6 +2815,7 @@ class Processes
|
|||||||
$contents = '';
|
$contents = '';
|
||||||
$contents = @fread( $fp, $fsData ); //reading string $oData
|
$contents = @fread( $fp, $fsData ); //reading string $oData
|
||||||
|
|
||||||
|
|
||||||
if ($contents != '') {
|
if ($contents != '') {
|
||||||
$oData = unserialize( $contents );
|
$oData = unserialize( $contents );
|
||||||
if ($oData === false) {
|
if ($oData === false) {
|
||||||
@@ -3049,6 +3054,7 @@ class Processes
|
|||||||
/**
|
/**
|
||||||
* create the files from a .
|
* create the files from a .
|
||||||
*
|
*
|
||||||
|
*
|
||||||
* pm file
|
* pm file
|
||||||
*
|
*
|
||||||
* @param $oData process data
|
* @param $oData process data
|
||||||
@@ -3067,6 +3073,7 @@ class Processes
|
|||||||
$fsData = intval( fread( $fp, 9 ) ); //reading the size of $oData
|
$fsData = intval( fread( $fp, 9 ) ); //reading the size of $oData
|
||||||
$contents = fread( $fp, $fsData ); //reading string $oData
|
$contents = fread( $fp, $fsData ); //reading string $oData
|
||||||
|
|
||||||
|
|
||||||
$path = PATH_DYNAFORM . $oData->process['PRO_UID'] . PATH_SEP;
|
$path = PATH_DYNAFORM . $oData->process['PRO_UID'] . PATH_SEP;
|
||||||
if (! is_dir( $path )) {
|
if (! is_dir( $path )) {
|
||||||
G::verifyPath( $path, true );
|
G::verifyPath( $path, true );
|
||||||
@@ -3077,8 +3084,9 @@ class Processes
|
|||||||
$sIdentifier = fread( $fp, 9 ); //reading the size of $filename
|
$sIdentifier = fread( $fp, 9 ); //reading the size of $filename
|
||||||
if (is_numeric( $sIdentifier )) {
|
if (is_numeric( $sIdentifier )) {
|
||||||
$fsXmlGuid = intval( $sIdentifier ); //reading the size of $filename
|
$fsXmlGuid = intval( $sIdentifier ); //reading the size of $filename
|
||||||
if ($fsXmlGuid > 0)
|
if ($fsXmlGuid > 0) {
|
||||||
$XmlGuid = fread( $fp, $fsXmlGuid ); //reading string $XmlGuid
|
$XmlGuid = fread( $fp, $fsXmlGuid ); //reading string $XmlGuid
|
||||||
|
}
|
||||||
$fsXmlContent = intval( fread( $fp, 9 ) ); //reading the size of $XmlContent
|
$fsXmlContent = intval( fread( $fp, 9 ) ); //reading the size of $XmlContent
|
||||||
if ($fsXmlContent > 0) {
|
if ($fsXmlContent > 0) {
|
||||||
$newXmlGuid = $oData->dynaformFiles[$XmlGuid];
|
$newXmlGuid = $oData->dynaformFiles[$XmlGuid];
|
||||||
@@ -3469,6 +3477,7 @@ class Processes
|
|||||||
//it was commented becuase it seems to be working fine
|
//it was commented becuase it seems to be working fine
|
||||||
//$this->createEventRows(isset($oData->event) ? $oData->event : array());
|
//$this->createEventRows(isset($oData->event) ? $oData->event : array());
|
||||||
|
|
||||||
|
|
||||||
$aRoutesUID = $this->createRouteRows( $oData->routes );
|
$aRoutesUID = $this->createRouteRows( $oData->routes );
|
||||||
$this->createLaneRows( $oData->lanes );
|
$this->createLaneRows( $oData->lanes );
|
||||||
|
|
||||||
@@ -3608,8 +3617,10 @@ class Processes
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$client = new SoapClient( $endpoint, $proxy );
|
$client = new SoapClient( $endpoint, $proxy );
|
||||||
$params = array ('userid' => $user,'password' => $pass);
|
$params = array ('userid' => $user,'password' => $pass
|
||||||
$result = $client->__SoapCall( 'login', array ($params) );
|
);
|
||||||
|
$result = $client->__SoapCall( 'login', array ($params
|
||||||
|
) );
|
||||||
if ($result->status_code == 0) {
|
if ($result->status_code == 0) {
|
||||||
$sessionId = $result->message;
|
$sessionId = $result->message;
|
||||||
return 1;
|
return 1;
|
||||||
@@ -3683,8 +3694,10 @@ class Processes
|
|||||||
|
|
||||||
$client = new SoapClient( $endpoint, $proxy );
|
$client = new SoapClient( $endpoint, $proxy );
|
||||||
$sessionId = '';
|
$sessionId = '';
|
||||||
$params = array ('sessionId' => $sessionId);
|
$params = array ('sessionId' => $sessionId
|
||||||
$result = $client->__SoapCall( 'processList', array ($params) );
|
);
|
||||||
|
$result = $client->__SoapCall( 'processList', array ($params
|
||||||
|
) );
|
||||||
if ($result->status_code == 0) {
|
if ($result->status_code == 0) {
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
@@ -3757,8 +3770,10 @@ class Processes
|
|||||||
$client = new SoapClient( $endpoint, $proxy );
|
$client = new SoapClient( $endpoint, $proxy );
|
||||||
|
|
||||||
$sessionId = '';
|
$sessionId = '';
|
||||||
$params = array ('sessionId' => $sessionId,'processId' => $proId);
|
$params = array ('sessionId' => $sessionId,'processId' => $proId
|
||||||
$result = $client->__SoapCall( 'processGetData', array ($params) );
|
);
|
||||||
|
$result = $client->__SoapCall( 'processGetData', array ($params
|
||||||
|
) );
|
||||||
if ($result->status_code == 0) {
|
if ($result->status_code == 0) {
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
@@ -3811,6 +3826,7 @@ class Processes
|
|||||||
|
|
||||||
G::verifyPath( $dir, true ); //Create if it does not exist
|
G::verifyPath( $dir, true ); //Create if it does not exist
|
||||||
|
|
||||||
|
|
||||||
//Creating the default template (if not exists)
|
//Creating the default template (if not exists)
|
||||||
if (! file_exists( $dir . "alert_message.html" )) {
|
if (! file_exists( $dir . "alert_message.html" )) {
|
||||||
@copy( PATH_TPL . "mails" . PATH_SEP . "alert_message.html", $dir . "alert_message.html" );
|
@copy( PATH_TPL . "mails" . PATH_SEP . "alert_message.html", $dir . "alert_message.html" );
|
||||||
@@ -3826,13 +3842,14 @@ class Processes
|
|||||||
$fileName = basename( $file );
|
$fileName = basename( $file );
|
||||||
|
|
||||||
if ($fileName != "alert_message.html" && $fileName != "unassignedMessage.html") {
|
if ($fileName != "alert_message.html" && $fileName != "unassignedMessage.html") {
|
||||||
$filesList[] = array ("filepath" => $file,"filename" => $fileName);
|
$filesList[] = array ("filepath" => $file,"filename" => $fileName
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $filesList;
|
return $filesList;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} //end class processes
|
//end class processes
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class XMLDB
|
|||||||
* @param string $dsn
|
* @param string $dsn
|
||||||
* @return array $options
|
* @return array $options
|
||||||
*/
|
*/
|
||||||
function &connect ($dsn, $options = array())
|
public function &connect ($dsn, $options = array())
|
||||||
{
|
{
|
||||||
//Needed for $mysql_real_escape_string
|
//Needed for $mysql_real_escape_string
|
||||||
$mresdbc = new DBConnection();
|
$mresdbc = new DBConnection();
|
||||||
@@ -63,7 +63,7 @@ class XMLDB
|
|||||||
* @param string $result
|
* @param string $result
|
||||||
* @return boolean is_a($result, 'DB_Error')
|
* @return boolean is_a($result, 'DB_Error')
|
||||||
*/
|
*/
|
||||||
function isError ($result)
|
public function isError ($result)
|
||||||
{
|
{
|
||||||
return is_a( $result, 'DB_Error' );
|
return is_a( $result, 'DB_Error' );
|
||||||
}
|
}
|
||||||
@@ -82,7 +82,7 @@ class XMLConnection
|
|||||||
{
|
{
|
||||||
var $phptype = 'myxml';
|
var $phptype = 'myxml';
|
||||||
var $caseFolding = true;
|
var $caseFolding = true;
|
||||||
var $xmldoc = NULL;
|
var $xmldoc = null;
|
||||||
var $xmlFile = '';
|
var $xmlFile = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -91,7 +91,7 @@ class XMLConnection
|
|||||||
* @param string $file
|
* @param string $file
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function XMLConnection ($file)
|
public function XMLConnection ($file)
|
||||||
{
|
{
|
||||||
$this->xmldoc = new Xml_Document();
|
$this->xmldoc = new Xml_Document();
|
||||||
$this->xmldoc->parseXmlFile( $file );
|
$this->xmldoc->parseXmlFile( $file );
|
||||||
@@ -105,7 +105,7 @@ class XMLConnection
|
|||||||
* @param string $sql
|
* @param string $sql
|
||||||
* @return object(XMLResult) $result
|
* @return object(XMLResult) $result
|
||||||
*/
|
*/
|
||||||
function &query ($sql)
|
public function &query ($sql)
|
||||||
{
|
{
|
||||||
if (! isset( $this->xmldoc )) {
|
if (! isset( $this->xmldoc )) {
|
||||||
$err = new DB_Error( "Error: Closed xmlConnection." );
|
$err = new DB_Error( "Error: Closed xmlConnection." );
|
||||||
@@ -173,9 +173,10 @@ class XMLConnection
|
|||||||
for ($r = 0; $r < sizeof( $res ); $r ++) {
|
for ($r = 0; $r < sizeof( $res ); $r ++) {
|
||||||
$evalWhere = false;
|
$evalWhere = false;
|
||||||
@eval( '$evalWhere = ' . $sqlWhere . ';' );
|
@eval( '$evalWhere = ' . $sqlWhere . ';' );
|
||||||
if ($evalWhere)
|
if ($evalWhere) {
|
||||||
$newRes[] = $res[$r];
|
$newRes[] = $res[$r];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$res = $newRes;
|
$res = $newRes;
|
||||||
}
|
}
|
||||||
/* End Block */
|
/* End Block */
|
||||||
@@ -377,7 +378,7 @@ class XMLConnection
|
|||||||
* @param string $a
|
* @param string $a
|
||||||
* @return void $b
|
* @return void $b
|
||||||
*/
|
*/
|
||||||
function sqlLike ($a, $b)
|
public function sqlLike ($a, $b)
|
||||||
{
|
{
|
||||||
$b = addcslashes( $b, '[]()\/{}.?' );
|
$b = addcslashes( $b, '[]()\/{}.?' );
|
||||||
$b = str_replace( "%", '.*', $b );
|
$b = str_replace( "%", '.*', $b );
|
||||||
@@ -392,15 +393,16 @@ class XMLConnection
|
|||||||
* @param string $fieldsList
|
* @param string $fieldsList
|
||||||
* @return array $res
|
* @return array $res
|
||||||
*/
|
*/
|
||||||
function expandFields ($resRow, $fieldsList)
|
public function expandFields ($resRow, $fieldsList)
|
||||||
{
|
{
|
||||||
$res = array ();
|
$res = array ();
|
||||||
foreach ($fieldsList as $key => $value) {
|
foreach ($fieldsList as $key => $value) {
|
||||||
if ($key === '*') {
|
if ($key === '*') {
|
||||||
foreach ($resRow as $k => $v)
|
foreach ($resRow as $k => $v) {
|
||||||
$res[$k] = $v;
|
$res[$k] = $v;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$res[$key] = array_key_exists( $value, $resRow ) ? $resRow[$value] : NULL;
|
$res[$key] = array_key_exists( $value, $resRow ) ? $resRow[$value] : null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $res;
|
return $res;
|
||||||
@@ -412,13 +414,14 @@ class XMLConnection
|
|||||||
* @param object &$node
|
* @param object &$node
|
||||||
* @return array $res
|
* @return array $res
|
||||||
*/
|
*/
|
||||||
function fetchNode (&$node)
|
public function fetchNode (&$node)
|
||||||
{
|
{
|
||||||
$res = array ('XMLNODE_NAME' => $node->name,'XMLNODE_TYPE' => $node->type,'XMLNODE_VALUE' => $node->value
|
$res = array ('XMLNODE_NAME' => $node->name,'XMLNODE_TYPE' => $node->type,'XMLNODE_VALUE' => $node->value
|
||||||
);
|
);
|
||||||
foreach ($node->attributes as $name => $value) {
|
foreach ($node->attributes as $name => $value) {
|
||||||
if ($this->caseFolding)
|
if ($this->caseFolding) {
|
||||||
$name = strtoupper( $name );
|
$name = strtoupper( $name );
|
||||||
|
}
|
||||||
$res[$name] = $value;
|
$res[$name] = $value;
|
||||||
}
|
}
|
||||||
return $res;
|
return $res;
|
||||||
@@ -430,7 +433,7 @@ class XMLConnection
|
|||||||
* @param string &$node
|
* @param string &$node
|
||||||
* @return array $res
|
* @return array $res
|
||||||
*/
|
*/
|
||||||
function fetchChildren (&$node)
|
public function fetchChildren (&$node)
|
||||||
{
|
{
|
||||||
$res = array ();
|
$res = array ();
|
||||||
foreach ($node->children as $name => $child) {
|
foreach ($node->children as $name => $child) {
|
||||||
@@ -444,7 +447,7 @@ class XMLConnection
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function disconnect ()
|
public function disconnect ()
|
||||||
{
|
{
|
||||||
unset( $this->xmldoc );
|
unset( $this->xmldoc );
|
||||||
}
|
}
|
||||||
@@ -454,7 +457,7 @@ class XMLConnection
|
|||||||
* @param array $match
|
* @param array $match
|
||||||
* @return object(DB_Error) $err
|
* @return object(DB_Error) $err
|
||||||
*/
|
*/
|
||||||
function sqlWhereLike ($match)
|
public function sqlWhereLike ($match)
|
||||||
{
|
{
|
||||||
switch (substr( $match[2], 0, 1 )) {
|
switch (substr( $match[2], 0, 1 )) {
|
||||||
case '"':
|
case '"':
|
||||||
@@ -476,7 +479,7 @@ class XMLConnection
|
|||||||
* @param array $match
|
* @param array $match
|
||||||
* @return object(DB_Error) $err
|
* @return object(DB_Error) $err
|
||||||
*/
|
*/
|
||||||
function sqlString ($match)
|
public function sqlString ($match)
|
||||||
{
|
{
|
||||||
switch (substr( $match[0], 0, 1 )) {
|
switch (substr( $match[0], 0, 1 )) {
|
||||||
case '"':
|
case '"':
|
||||||
@@ -507,7 +510,7 @@ class XMLConnection
|
|||||||
* @param object $values
|
* @param object $values
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function insertRow (&$node, $values)
|
public function insertRow (&$node, $values)
|
||||||
{
|
{
|
||||||
$attributes = array ();
|
$attributes = array ();
|
||||||
foreach ($values as $field => $value) {
|
foreach ($values as $field => $value) {
|
||||||
@@ -533,7 +536,7 @@ class XMLConnection
|
|||||||
* @param object $values
|
* @param object $values
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function updateRow (&$node, $values)
|
public function updateRow (&$node, $values)
|
||||||
{
|
{
|
||||||
foreach ($values as $field => $value) {
|
foreach ($values as $field => $value) {
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
@@ -573,7 +576,7 @@ class XMLResult
|
|||||||
* @param array $result
|
* @param array $result
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function XMLResult ($result = array())
|
public function XMLResult ($result = array())
|
||||||
{
|
{
|
||||||
$this->result = $result;
|
$this->result = $result;
|
||||||
$this->cursor = 0;
|
$this->cursor = 0;
|
||||||
@@ -584,7 +587,7 @@ class XMLResult
|
|||||||
*
|
*
|
||||||
* @return integer sizeof($this->result)
|
* @return integer sizeof($this->result)
|
||||||
*/
|
*/
|
||||||
function numRows ()
|
public function numRows ()
|
||||||
{
|
{
|
||||||
return sizeof( $this->result );
|
return sizeof( $this->result );
|
||||||
}
|
}
|
||||||
@@ -595,10 +598,11 @@ class XMLResult
|
|||||||
* @param string $const
|
* @param string $const
|
||||||
* @return integer $this->result[ $this->cursor-1 ];
|
* @return integer $this->result[ $this->cursor-1 ];
|
||||||
*/
|
*/
|
||||||
function fetchRow ($const)
|
public function fetchRow ($const)
|
||||||
{
|
{
|
||||||
if ($this->cursor >= $this->numRows())
|
if ($this->cursor >= $this->numRows()) {
|
||||||
return NULL;
|
return null;
|
||||||
|
}
|
||||||
$this->cursor ++;
|
$this->cursor ++;
|
||||||
return $this->result[$this->cursor - 1];
|
return $this->result[$this->cursor - 1];
|
||||||
}
|
}
|
||||||
@@ -621,4 +625,3 @@ function getNames ($children)
|
|||||||
return $names;
|
return $names;
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
|
||||||
@@ -205,7 +205,8 @@ class Zimbra
|
|||||||
if ($sysConf['proxy_user'] != '') {
|
if ($sysConf['proxy_user'] != '') {
|
||||||
curl_setopt( $this->_curl, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : '') );
|
curl_setopt( $this->_curl, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : '') );
|
||||||
}
|
}
|
||||||
curl_setopt( $this->_curl, CURLOPT_HTTPHEADER, array ('Expect:') );
|
curl_setopt( $this->_curl, CURLOPT_HTTPHEADER, array ('Expect:'
|
||||||
|
) );
|
||||||
}
|
}
|
||||||
|
|
||||||
$preauth = $this->getPreAuth( $this->_username );
|
$preauth = $this->getPreAuth( $this->_username );
|
||||||
@@ -673,7 +674,8 @@ class Zimbra
|
|||||||
$tpl->assign( 'total_messages', $total_messages );
|
$tpl->assign( 'total_messages', $total_messages );
|
||||||
$tpl->assign( 'unread_messages', $unread_messages );
|
$tpl->assign( 'unread_messages', $unread_messages );
|
||||||
|
|
||||||
$info = $this->getInfo( array ('sections' => 'mbox') );
|
$info = $this->getInfo( array ('sections' => 'mbox'
|
||||||
|
) );
|
||||||
if (is_array( $info['attrs'][0]['attr_attribute_name'] )) {
|
if (is_array( $info['attrs'][0]['attr_attribute_name'] )) {
|
||||||
$quota = $info['attrs'][0]['attr'][array_search( 'zimbraMailQuota', $info['attrs'][0]['attr_attribute_name'] )];
|
$quota = $info['attrs'][0]['attr'][array_search( 'zimbraMailQuota', $info['attrs'][0]['attr_attribute_name'] )];
|
||||||
$size_text = $this->makeBytesPretty( $info['used'][0], ($quota * 0.75) ) . ' out of ' . $this->makeBytesPretty( $quota );
|
$size_text = $this->makeBytesPretty( $info['used'][0], ($quota * 0.75) ) . ' out of ' . $this->makeBytesPretty( $quota );
|
||||||
@@ -929,16 +931,15 @@ class Zimbra
|
|||||||
switch ($val['type']) {
|
switch ($val['type']) {
|
||||||
case 'open':
|
case 'open':
|
||||||
array_push( $hash_stack, $val['tag'] );
|
array_push( $hash_stack, $val['tag'] );
|
||||||
if (isset( $val['attributes'] ))
|
if (isset( $val['attributes'] )) {
|
||||||
$ret = $this->composeArray( $ret, $hash_stack, $val['attributes'] );
|
$ret = $this->composeArray( $ret, $hash_stack, $val['attributes'] );
|
||||||
else
|
} else {
|
||||||
$ret = $this->composeArray( $ret, $hash_stack );
|
$ret = $this->composeArray( $ret, $hash_stack );
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'close':
|
case 'close':
|
||||||
array_pop( $hash_stack );
|
array_pop( $hash_stack );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'complete':
|
case 'complete':
|
||||||
array_push( $hash_stack, $val['tag'] );
|
array_push( $hash_stack, $val['tag'] );
|
||||||
$ret = $this->composeArray( $ret, $hash_stack, $val['value'] );
|
$ret = $this->composeArray( $ret, $hash_stack, $val['value'] );
|
||||||
@@ -952,11 +953,9 @@ class Zimbra
|
|||||||
array_pop( $hash_stack );
|
array_pop( $hash_stack );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -985,7 +984,8 @@ class Zimbra
|
|||||||
// does the current element refer to a list
|
// does the current element refer to a list
|
||||||
if (sizeof( $elements ) > 0) {
|
if (sizeof( $elements ) > 0) {
|
||||||
$array[$element][sizeof( $array[$element] ) - 1] = &$this->composeArray( $array[$element][sizeof( $array[$element] ) - 1], $elements, $value );
|
$array[$element][sizeof( $array[$element] ) - 1] = &$this->composeArray( $array[$element][sizeof( $array[$element] ) - 1], $elements, $value );
|
||||||
} else { // if (is_array($value))
|
} else {
|
||||||
|
// if (is_array($value))
|
||||||
$array[$element][sizeof( $array[$element] )] = $value;
|
$array[$element][sizeof( $array[$element] )] = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1018,8 +1018,10 @@ class Zimbra
|
|||||||
* @access public
|
* @access public
|
||||||
* @param
|
* @param
|
||||||
*
|
*
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*
|
*
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
public function addAppointment ($serializeOp1)
|
public function addAppointment ($serializeOp1)
|
||||||
{
|
{
|
||||||
@@ -1160,8 +1162,10 @@ class Zimbra
|
|||||||
* @access public
|
* @access public
|
||||||
* @param
|
* @param
|
||||||
*
|
*
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*
|
*
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
public function addContacts ($serializeOp1)
|
public function addContacts ($serializeOp1)
|
||||||
{
|
{
|
||||||
@@ -1202,8 +1206,10 @@ class Zimbra
|
|||||||
* @access public
|
* @access public
|
||||||
* @param
|
* @param
|
||||||
*
|
*
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*
|
*
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function addFolder ($serializeOp1)
|
public function addFolder ($serializeOp1)
|
||||||
@@ -1238,8 +1244,10 @@ class Zimbra
|
|||||||
* @access public
|
* @access public
|
||||||
* @param
|
* @param
|
||||||
*
|
*
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*
|
*
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function upload ($folderId, $UploadId, $fileVersion = '', $docId = '')
|
public function upload ($folderId, $UploadId, $fileVersion = '', $docId = '')
|
||||||
@@ -1282,8 +1290,10 @@ class Zimbra
|
|||||||
* @access public
|
* @access public
|
||||||
* @param
|
* @param
|
||||||
*
|
*
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*
|
*
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
public function getDocId ($folderId, $fileName)
|
public function getDocId ($folderId, $fileName)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user