Merge remote branch 'upstream/master'
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* AppFolder.php
|
||||
*
|
||||
* @package workflow.engine.classes.model
|
||||
*/
|
||||
|
||||
@@ -15,21 +16,29 @@ require_once 'classes/model/Application.php';
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
*/
|
||||
/**
|
||||
*
|
||||
* @author hugo loza
|
||||
* @package workflow.engine.classes.model
|
||||
*/
|
||||
class AppFolder extends BaseAppFolder {
|
||||
class AppFolder extends BaseAppFolder
|
||||
{
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $folderName
|
||||
* @param strin(32) $folderParent
|
||||
* @return Ambigous <>|number
|
||||
*/
|
||||
function createFolder($folderName, $folderParent = "/", $action="createifnotexists") {
|
||||
$validActions=array("createifnotexists","create","update");
|
||||
if(!in_array($action,$validActions)) $action="createifnotexists";
|
||||
function createFolder ($folderName, $folderParent = "/", $action = "createifnotexists")
|
||||
{
|
||||
$validActions = array ("createifnotexists","create","update"
|
||||
);
|
||||
if (! in_array( $action, $validActions )) {
|
||||
$action = "createifnotexists";
|
||||
}
|
||||
|
||||
//Clean Folder and Parent names (delete spaces...)
|
||||
$folderName = trim( $folderName );
|
||||
$folderParent = trim( $folderParent );
|
||||
@@ -40,13 +49,15 @@ class AppFolder extends BaseAppFolder {
|
||||
$oDataset = AppFolderPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
if ($aRow = $oDataset->getRow ()) {//Folder exist, then return the ID
|
||||
if ($aRow = $oDataset->getRow()) {
|
||||
//Folder exist, then return the ID
|
||||
$response['success'] = false;
|
||||
$response['message'] = $response['error'] = "Can't create folder <br /> A folder with same name already exist. <br /> $folderName";
|
||||
$response['folderUID'] = $aRow['FOLDER_UID'];
|
||||
//return ($aRow ['FOLDER_UID']);
|
||||
return ($response);
|
||||
} else {//Folder doesn't exist. Create and return the ID
|
||||
} else {
|
||||
//Folder doesn't exist. Create and return the ID
|
||||
$folderUID = G::GenerateUniqueID();
|
||||
$tr = new AppFolder();
|
||||
$tr->setFolderUid( $folderUID );
|
||||
@@ -70,30 +81,30 @@ class AppFolder extends BaseAppFolder {
|
||||
$msg .= $objValidationFailure->getMessage() . "<br/>";
|
||||
}
|
||||
$response['success'] = false;
|
||||
|
||||
$response['message'] = $response['error'] = "Can't create folder \n A \n " . $msg;
|
||||
return ($response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $folderPath
|
||||
* @param strin(32) $sessionID
|
||||
* @return string Last Folder ID generated
|
||||
*/
|
||||
function createFromPath($folderPath, $sessionID = "") {
|
||||
if ($sessionID == "")
|
||||
function createFromPath ($folderPath, $sessionID = "")
|
||||
{
|
||||
if ($sessionID == "") {
|
||||
$sessionID = $_SESSION['APPLICATION'];
|
||||
//Get current Application Fields
|
||||
}
|
||||
|
||||
$oApplication = new Application();
|
||||
|
||||
$appFields = $oApplication->Load( $sessionID );
|
||||
|
||||
$folderPathParsed = G::replaceDataField( $folderPath, $appFields );
|
||||
$folderPathParsed = G::replaceDataField( $folderPath, unserialize( $appFields['APP_DATA'] ) );
|
||||
|
||||
$folderPathParsedArray = explode( "/", $folderPathParsed );
|
||||
|
||||
$folderRoot = "/"; //Always starting from Root
|
||||
foreach ($folderPathParsedArray as $folderName) {
|
||||
if (trim( $folderName ) != "") {
|
||||
@@ -105,50 +116,51 @@ class AppFolder extends BaseAppFolder {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $fileTags
|
||||
* @param string(32) $sessionID Application ID
|
||||
* @return string
|
||||
*/
|
||||
function parseTags($fileTags, $sessionID = "") {
|
||||
function parseTags ($fileTags, $sessionID = "")
|
||||
{
|
||||
|
||||
if ($sessionID == "")
|
||||
if ($sessionID == "") {
|
||||
$sessionID = $_SESSION['APPLICATION'];
|
||||
//Get current Application Fields
|
||||
}
|
||||
|
||||
$oApplication = new Application();
|
||||
|
||||
$appFields = $oApplication->Load( $sessionID );
|
||||
|
||||
$fileTagsParsed = G::replaceDataField( $fileTags, $appFields );
|
||||
$fileTagsParsed = G::replaceDataField( $fileTags, unserialize( $appFields['APP_DATA'] ) );
|
||||
|
||||
return $fileTagsParsed;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string(32) $folderID
|
||||
* @return multitype:
|
||||
*/
|
||||
function getFolderList($folderID, $limit=0, $start=0) {
|
||||
function getFolderList ($folderID, $limit = 0, $start = 0)
|
||||
{
|
||||
$Criteria = new Criteria( 'workflow' );
|
||||
$Criteria->clearSelectColumns()->clearOrderByColumns();
|
||||
|
||||
$Criteria->addSelectColumn( AppFolderPeer::FOLDER_UID );
|
||||
$Criteria->addSelectColumn( AppFolderPeer::FOLDER_PARENT_UID );
|
||||
$Criteria->addSelectColumn( AppFolderPeer::FOLDER_NAME );
|
||||
$Criteria->addSelectColumn( AppFolderPeer::FOLDER_CREATE_DATE );
|
||||
$Criteria->addSelectColumn( AppFolderPeer::FOLDER_UPDATE_DATE );
|
||||
|
||||
$Criteria->add( appFolderPeer::FOLDER_PARENT_UID, $folderID, CRITERIA::EQUAL );
|
||||
|
||||
$Criteria->addAscendingOrderByColumn( AppFolderPeer::FOLDER_NAME );
|
||||
|
||||
$response['totalFoldersCount'] = AppFolderPeer::doCount( $Criteria );
|
||||
$response['folders'] = array ();
|
||||
|
||||
if ($limit != 0) {
|
||||
|
||||
$Criteria->setLimit( $limit );
|
||||
$Criteria->setOffset( $start );
|
||||
}
|
||||
|
||||
$rs = appFolderPeer::doSelectRS( $Criteria );
|
||||
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$rs->next();
|
||||
@@ -159,11 +171,14 @@ if($limit != 0){
|
||||
}
|
||||
return ($response);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string(32) $folderUid
|
||||
* @return array <multitype:, mixed>
|
||||
*/
|
||||
function load($folderUid) {
|
||||
function load ($folderUid)
|
||||
{
|
||||
$tr = AppFolderPeer::retrieveByPK( $folderUid );
|
||||
if ((is_object( $tr ) && get_class( $tr ) == 'AppFolder')) {
|
||||
$fields['FOLDER_UID'] = $tr->getFolderUid();
|
||||
@@ -187,10 +202,12 @@ if($limit != 0){
|
||||
}
|
||||
return $fields;
|
||||
}
|
||||
function getFolderStructure($folderId) {
|
||||
|
||||
function getFolderStructure ($folderId)
|
||||
{
|
||||
$folderObj = $this->load( $folderId );
|
||||
$folderArray [$folderObj ['FOLDER_UID']] = array ("NAME" => $folderObj ['FOLDER_NAME'], "PARENT" => $folderObj ['FOLDER_PARENT_UID'] );
|
||||
$folderArray[$folderObj['FOLDER_UID']] = array ("NAME" => $folderObj['FOLDER_NAME'],"PARENT" => $folderObj['FOLDER_PARENT_UID']
|
||||
);
|
||||
$folderArray['PATH_ARRAY'][] = $folderObj['FOLDER_NAME'];
|
||||
|
||||
while ($folderObj['FOLDER_PARENT_UID'] != "") {
|
||||
@@ -203,7 +220,8 @@ if($limit != 0){
|
||||
return $folderArray;
|
||||
}
|
||||
|
||||
function getFolderContent($folderID, $docIdFilter = array(), $keyword = NULL, $searchType = NULL, $limit=0, $start=0, $user='', $onlyActive=false) {
|
||||
function getFolderContent ($folderID, $docIdFilter = array(), $keyword = null, $searchType = null, $limit = 0, $start = 0, $user = '', $onlyActive = false)
|
||||
{
|
||||
require_once ("classes/model/AppDocument.php");
|
||||
require_once ("classes/model/InputDocument.php");
|
||||
require_once ("classes/model/OutputDocument.php");
|
||||
@@ -217,11 +235,12 @@ if($limit != 0){
|
||||
$oAppDocument = new AppDocument();
|
||||
$oCriteria = new Criteria();
|
||||
|
||||
if ((is_array ( $docIdFilter )) && (count ( $docIdFilter ) > 0)) { //Search by App Doc UID no matter what Folder it is
|
||||
if ((is_array( $docIdFilter )) && (count( $docIdFilter ) > 0)) {
|
||||
//Search by App Doc UID no matter what Folder it is
|
||||
$oCriteria->add( AppDocumentPeer::APP_DOC_UID, $docIdFilter, CRITERIA::IN );
|
||||
} elseif ($folderID != NULL) {
|
||||
} elseif ($folderID != null) {
|
||||
if ($folderID == "/") {
|
||||
$oCriteria->add ( AppDocumentPeer::FOLDER_UID, array('root','',NULL), CRITERIA::IN );
|
||||
$oCriteria->add( AppDocumentPeer::FOLDER_UID, array ('root','',null), CRITERIA::IN );
|
||||
} else {
|
||||
$oCriteria->add( AppDocumentPeer::FOLDER_UID, $folderID );
|
||||
}
|
||||
@@ -259,20 +278,15 @@ if($limit != 0){
|
||||
|
||||
$oCase->verifyTable();
|
||||
|
||||
|
||||
$oCriteria->addAscendingOrderByColumn( AppDocumentPeer::APP_DOC_INDEX );
|
||||
$oCriteria->addDescendingOrderByColumn( AppDocumentPeer::DOC_VERSION );
|
||||
|
||||
|
||||
$response['totalDocumentsCount'] = AppDocumentPeer::doCount( $oCriteria );
|
||||
$response['documents'] = array ();
|
||||
|
||||
|
||||
|
||||
$oCriteria->setLimit( $limit );
|
||||
$oCriteria->setOffset( $start );
|
||||
|
||||
|
||||
$rs = AppDocumentPeer::doSelectRS( $oCriteria );
|
||||
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$rs->next();
|
||||
@@ -281,10 +295,8 @@ if($limit != 0){
|
||||
//**** start get Doc Info
|
||||
$oApp = new Application();
|
||||
if (($oApp->exists( $row['APP_UID'] )) || ($row['APP_UID'] == "00000000000000000000000000000000")) {
|
||||
|
||||
//$completeInfo = array("APP_DOC_FILENAME" => $row ["APP_DOC_UID"],"APP_DOC_UID"=>$row ['APP_UID']);
|
||||
$completeInfo = $this->getCompleteDocumentInfo( $row['APP_UID'], $row['APP_DOC_UID'], $row['DOC_VERSION'], $row['DOC_UID'], $row['USR_UID'] );
|
||||
|
||||
$oAppDocument = new AppDocument();
|
||||
$lastVersion = $oAppDocument->getLastAppDocVersion( $row['APP_DOC_UID'], $row['APP_UID'] );
|
||||
//$filesResult [] = $completeInfo;
|
||||
@@ -294,16 +306,17 @@ if($limit != 0){
|
||||
if (in_array( $row['APP_DOC_UID'], $docIdFilter )) {
|
||||
$response['documents'][] = $completeInfo;
|
||||
}
|
||||
} elseif ($lastVersion == $row ['DOC_VERSION']) { //Only Last Document version
|
||||
} elseif ($lastVersion == $row['DOC_VERSION']) {
|
||||
//Only Last Document version
|
||||
if ($searchType == "ALL") { // If search in name of docs is active then filter
|
||||
if ((stripos( $completeInfo['APP_DOC_FILENAME'], $keyword ) !== false) || (stripos( $completeInfo['APP_DOC_TAGS'], $keyword ) !== false)) {
|
||||
$response['documents'][] = $completeInfo;
|
||||
}
|
||||
} else {//No search filter active
|
||||
} else {
|
||||
//No search filter active
|
||||
$response['documents'][] = $completeInfo;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -311,7 +324,9 @@ if($limit != 0){
|
||||
}
|
||||
return ($response);
|
||||
}
|
||||
function getCompleteDocumentInfo($appUid, $appDocUid, $docVersion, $docUid, $usrId) {
|
||||
|
||||
function getCompleteDocumentInfo ($appUid, $appDocUid, $docVersion, $docUid, $usrId)
|
||||
{
|
||||
require_once ("classes/model/AppDocument.php");
|
||||
require_once ("classes/model/InputDocument.php");
|
||||
require_once ("classes/model/OutputDocument.php");
|
||||
@@ -388,7 +403,6 @@ if($limit != 0){
|
||||
///////
|
||||
if (! empty( $row1["APP_DOC_PLUGIN"] )) {
|
||||
$pluginRegistry = &PMPluginRegistry::getSingleton();
|
||||
|
||||
$pluginName = $row1["APP_DOC_PLUGIN"];
|
||||
$fieldValue = "";
|
||||
|
||||
@@ -398,23 +412,18 @@ if($limit != 0){
|
||||
if ($pluginDetail) {
|
||||
if ($pluginDetail->enabled) {
|
||||
require_once (PATH_PLUGINS . $pluginName . ".php");
|
||||
|
||||
$pluginNameClass = $pluginName . "Plugin";
|
||||
|
||||
$objPluginClass = new $pluginNameClass( $pluginName );
|
||||
|
||||
if (isset( $objPluginClass->sMethodGetUrlDownload ) && ! empty( $objPluginClass->sMethodGetUrlDownload )) {
|
||||
if (file_exists( PATH_PLUGINS . $pluginName . PATH_SEP . "class." . $pluginName . ".php" )) {
|
||||
require_once (PATH_PLUGINS . $pluginName . PATH_SEP . "class." . $pluginName . ".php");
|
||||
|
||||
$pluginNameClass = $pluginName . "Class";
|
||||
|
||||
$objClass = new $pluginNameClass();
|
||||
|
||||
if (method_exists( $objClass, $objPluginClass->sMethodGetUrlDownload )) {
|
||||
eval( "\$url = \$objClass->" . $objPluginClass->sMethodGetUrlDownload . "(\"" . $row1["APP_DOC_UID"] . "\");" );
|
||||
$downloadLink = $url;
|
||||
|
||||
$fieldValue = $row1["APP_DOC_PLUGIN"];
|
||||
}
|
||||
}
|
||||
@@ -422,7 +431,6 @@ if($limit != 0){
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$row1["APP_DOC_PLUGIN"] = $fieldValue;
|
||||
}
|
||||
break;
|
||||
@@ -435,7 +443,6 @@ if($limit != 0){
|
||||
$downloadLabel = G::LoadTranslation( 'ID_DOWNLOAD' );
|
||||
$downloadLabel1 = "";
|
||||
break;
|
||||
|
||||
}
|
||||
$oUser = new Users();
|
||||
if (($usrId != "-1") && ($oUser->userExists( $usrId ))) {
|
||||
@@ -460,12 +467,11 @@ if($limit != 0){
|
||||
}
|
||||
$row6['APP_DOC_UID_VERSION'] = $appDocUid . "_" . $docVersion;
|
||||
|
||||
if ($appUid == "00000000000000000000000000000000") { //External Files
|
||||
if ($appUid == "00000000000000000000000000000000") {
|
||||
//External Files
|
||||
$row1['APP_DOC_TYPE'] = G::LoadTranslation( 'ID_EXTERNAL_FILE' );
|
||||
}
|
||||
//**** End get docinfo
|
||||
|
||||
|
||||
$infoMerged = array_merge( $row1, $row2, $row3, $row4, $row5, $row6 );
|
||||
//krumo($infoMerged);
|
||||
//****************************************************************************************************
|
||||
@@ -476,7 +482,10 @@ if($limit != 0){
|
||||
}
|
||||
|
||||
if (! is_array( $aObjectPermissions )) {
|
||||
$aObjectPermissions = array ('DYNAFORMS' => array (- 1 ), 'INPUT_DOCUMENTS' => array (- 1 ), 'OUTPUT_DOCUMENTS' => array (- 1 ) );
|
||||
$aObjectPermissions = array ('DYNAFORMS' => array (- 1),
|
||||
'INPUT_DOCUMENTS' => array (- 1),
|
||||
'OUTPUT_DOCUMENTS' => array (- 1)
|
||||
);
|
||||
}
|
||||
if (! isset( $aObjectPermissions['DYNAFORMS'] )) {
|
||||
$aObjectPermissions['DYNAFORMS'] = array (- 1);
|
||||
@@ -500,12 +509,12 @@ if($limit != 0){
|
||||
}
|
||||
}
|
||||
//****************************************************************************************************
|
||||
|
||||
|
||||
return array_merge( $infoMerged, $aObjectPermissions );
|
||||
}
|
||||
}
|
||||
function getFolderChilds($folderID, $folderArray) {
|
||||
|
||||
function getFolderChilds ($folderID, $folderArray)
|
||||
{
|
||||
$folderList = $this->getFolderList( $folderID );
|
||||
$foldersList = array ();
|
||||
foreach ($folderList as $key => $folderObj) {
|
||||
@@ -515,7 +524,8 @@ if($limit != 0){
|
||||
return (array_merge( $folderArray, $foldersList ));
|
||||
}
|
||||
|
||||
function getFolderTags($rootFolder) {
|
||||
function getFolderTags ($rootFolder)
|
||||
{
|
||||
$folderArray[$rootFolder] = $rootFolder;
|
||||
$foldersToProcess = $this->getFolderChilds( $rootFolder, $folderArray );
|
||||
$tagsInfo = array ();
|
||||
@@ -535,9 +545,13 @@ if($limit != 0){
|
||||
return $tagsInfo;
|
||||
|
||||
}
|
||||
function remove ($FolderUid, $rootfolder ) {
|
||||
|
||||
function remove ($FolderUid, $rootfolder)
|
||||
{
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->add( AppFolderPeer::FOLDER_UID, $FolderUid );
|
||||
AppFolderPeer::doDelete( $oCriteria );
|
||||
}
|
||||
} // AppFolder
|
||||
}
|
||||
// AppFolder
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* Step.php
|
||||
*
|
||||
* @package workflow.engine.classes.model
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
@@ -26,7 +27,6 @@
|
||||
|
||||
require_once 'classes/model/om/BaseStep.php';
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'STEP' table.
|
||||
*
|
||||
@@ -38,63 +38,67 @@ require_once 'classes/model/om/BaseStep.php';
|
||||
*
|
||||
* @package workflow.engine.classes.model
|
||||
*/
|
||||
class Step extends BaseStep {
|
||||
function create($aData)
|
||||
class Step extends BaseStep
|
||||
{
|
||||
|
||||
public function create ($aData)
|
||||
{
|
||||
$con = Propel::getConnection( StepPeer::DATABASE_NAME );
|
||||
try
|
||||
{
|
||||
if ( isset ( $aData['STEP_UID'] ) && $aData['STEP_UID']== '' )
|
||||
try {
|
||||
if (isset( $aData['STEP_UID'] ) && $aData['STEP_UID'] == '') {
|
||||
unset( $aData['STEP_UID'] );
|
||||
if ( isset ( $aData['STEP_UID'] ) )
|
||||
}
|
||||
if (isset( $aData['STEP_UID'] )) {
|
||||
$sStepUID = $aData['STEP_UID'];
|
||||
else
|
||||
} else {
|
||||
$sStepUID = G::generateUniqueID();
|
||||
}
|
||||
|
||||
$con->begin();
|
||||
$this->setStepUid( $sStepUID );
|
||||
$this->setProUid( $aData['PRO_UID'] );
|
||||
$this->setTasUid( $aData['TAS_UID'] );
|
||||
|
||||
if (isset ( $aData['STEP_TYPE_OBJ'] ))
|
||||
if (isset( $aData['STEP_TYPE_OBJ'] )) {
|
||||
$this->setStepTypeObj( $aData['STEP_TYPE_OBJ'] );
|
||||
else
|
||||
} else {
|
||||
$this->setStepTypeObj( "DYNAFORM" );
|
||||
}
|
||||
|
||||
if (isset ( $aData['STEP_UID_OBJ'] ))
|
||||
if (isset( $aData['STEP_UID_OBJ'] )) {
|
||||
$this->setStepUidObj( $aData['STEP_UID_OBJ'] );
|
||||
else
|
||||
} else {
|
||||
$this->setStepUidObj( "" );
|
||||
}
|
||||
|
||||
if (isset ( $aData['STEP_CONDITION'] ))
|
||||
if (isset( $aData['STEP_CONDITION'] )) {
|
||||
$this->setStepCondition( $aData['STEP_CONDITION'] );
|
||||
else
|
||||
} else {
|
||||
$this->setStepCondition( "" );
|
||||
}
|
||||
|
||||
if (isset ( $aData['STEP_POSITION'] ))
|
||||
if (isset( $aData['STEP_POSITION'] )) {
|
||||
$this->setStepPosition( $aData['STEP_POSITION'] );
|
||||
else
|
||||
} else {
|
||||
$this->setStepPosition( "" );
|
||||
}
|
||||
|
||||
if (isset ( $aData['STEP_MODE'] ))
|
||||
if (isset( $aData['STEP_MODE'] )) {
|
||||
$this->setStepMode( $aData['STEP_MODE'] );
|
||||
else
|
||||
} else {
|
||||
$this->setStepMode( "" );
|
||||
}
|
||||
|
||||
if($this->validate())
|
||||
{
|
||||
if ($this->validate()) {
|
||||
$result = $this->save();
|
||||
$con->commit();
|
||||
return $sStepUID;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$con->rollback();
|
||||
throw (new Exception( "Failed Validation in class " . get_class( $this ) . "." ));
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
|
||||
} catch (Exception $e) {
|
||||
$con->rollback();
|
||||
throw ($e);
|
||||
}
|
||||
@@ -104,18 +108,15 @@ class Step extends BaseStep {
|
||||
{
|
||||
try {
|
||||
$oRow = StepPeer::retrieveByPK( $StepUid );
|
||||
if (!is_null($oRow))
|
||||
{
|
||||
if (! is_null( $oRow )) {
|
||||
$aFields = $oRow->toArray( BasePeer::TYPE_FIELDNAME );
|
||||
$this->fromArray( $aFields, BasePeer::TYPE_FIELDNAME );
|
||||
$this->setNew( false );
|
||||
return $aFields;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
throw (new Exception( "The row '$StepUid' in table StepUid doesn't exist!" ));
|
||||
}
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
} catch (Exception $oError) {
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
@@ -130,13 +131,11 @@ class Step extends BaseStep {
|
||||
if (StepPeer::doCount( $c ) > 0) {
|
||||
$rs = StepPeer::doSelect( $c );
|
||||
return $rs[0];
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
} catch (Exception $oError) {
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
@@ -156,15 +155,12 @@ class Step extends BaseStep {
|
||||
$c->add( StepPeer::STEP_TYPE_OBJ, $sType );
|
||||
$c->add( StepPeer::STEP_UID_OBJ, $sUid );
|
||||
$rs = StepPeer::doSelect( $c );
|
||||
if (!is_null($rs) && !is_null($rs[0]))
|
||||
{
|
||||
if (! is_null( $rs ) && ! is_null( $rs[0] )) {
|
||||
return $rs[0];
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
throw (new Exception( "You tried to call to loadByType method without send the Task UID or Type or Object UID !" ));
|
||||
}
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
} catch (Exception $oError) {
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
@@ -174,33 +170,28 @@ class Step extends BaseStep {
|
||||
* @param array $fields
|
||||
* @return variant
|
||||
*/
|
||||
function update($fields)
|
||||
public function update ($fields)
|
||||
{
|
||||
$con = Propel::getConnection( StepPeer::DATABASE_NAME );
|
||||
try
|
||||
{
|
||||
try {
|
||||
$con->begin();
|
||||
$this->load( $fields['STEP_UID'] );
|
||||
$this->fromArray( $fields, BasePeer::TYPE_FIELDNAME );
|
||||
if($this->validate())
|
||||
{
|
||||
if ($this->validate()) {
|
||||
$result = $this->save();
|
||||
$con->commit();
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$con->rollback();
|
||||
throw (new Exception( "Failed Validation in class " . get_class( $this ) . "." ));
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
} catch (Exception $e) {
|
||||
$con->rollback();
|
||||
throw ($e);
|
||||
}
|
||||
}
|
||||
function remove($sStepUID)
|
||||
|
||||
public function remove ($sStepUID)
|
||||
{
|
||||
require_once ('classes/model/StepTrigger.php');
|
||||
$oStepTriggers = new StepTrigger();
|
||||
@@ -230,24 +221,22 @@ class Step extends BaseStep {
|
||||
$oConnection = Propel::getConnection( StepPeer::DATABASE_NAME );
|
||||
try {
|
||||
$oStep = StepPeer::retrieveByPK( $sStepUID );
|
||||
if (!is_null($oStep))
|
||||
{
|
||||
if (! is_null( $oStep )) {
|
||||
$oConnection->begin();
|
||||
$iResult = $oStep->delete();
|
||||
$oConnection->commit();
|
||||
return $iResult;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
throw (new Exception( 'This row doesn\'t exist!' ));
|
||||
}
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
} catch (Exception $oError) {
|
||||
$oConnection->rollback();
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
|
||||
function getNextPosition($sTaskUID) {
|
||||
public function getNextPosition ($sTaskUID)
|
||||
{
|
||||
try {
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->addSelectColumn( '(COUNT(*) + 1) AS POSITION' );
|
||||
@@ -257,13 +246,13 @@ class Step extends BaseStep {
|
||||
$oDataset->next();
|
||||
$aRow = $oDataset->getRow();
|
||||
return (int) $aRow['POSITION'];
|
||||
}
|
||||
catch (Exception $oException) {
|
||||
} catch (Exception $oException) {
|
||||
throw $Exception;
|
||||
}
|
||||
}
|
||||
|
||||
function reOrder($sStepUID, $iPosition) {
|
||||
public function reOrder ($sStepUID, $iPosition)
|
||||
{
|
||||
try {
|
||||
/*$oCriteria1 = new Criteria('workflow');
|
||||
$oCriteria1->add(StepPeer::STEP_POSITION, StepPeer::STEP_POSITION);
|
||||
@@ -285,13 +274,13 @@ class Step extends BaseStep {
|
||||
$oStep->save();
|
||||
$oDataset->next();
|
||||
}
|
||||
}
|
||||
catch (Exception $oException) {
|
||||
} catch (Exception $oException) {
|
||||
throw $oException;
|
||||
}
|
||||
}
|
||||
|
||||
function up($sStepUID = '', $sTaskUID = '', $iPosition = 0) {
|
||||
public function up ($sStepUID = '', $sTaskUID = '', $iPosition = 0)
|
||||
{
|
||||
try {
|
||||
if ($iPosition > 1) {
|
||||
$oCriteria1 = new Criteria( 'workflow' );
|
||||
@@ -306,13 +295,13 @@ class Step extends BaseStep {
|
||||
$oCriteria2->add( StepPeer::STEP_UID, $sStepUID );
|
||||
BasePeer::doUpdate( $oCriteria2, $oCriteria1, Propel::getConnection( 'workflow' ) );
|
||||
}
|
||||
}
|
||||
catch (Exception $oException) {
|
||||
} catch (Exception $oException) {
|
||||
throw $oException;
|
||||
}
|
||||
}
|
||||
|
||||
function down($sStepUID = '', $sTaskUID = '', $iPosition = 0) {
|
||||
public function down ($sStepUID = '', $sTaskUID = '', $iPosition = 0)
|
||||
{
|
||||
try {
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->addSelectColumn( 'COUNT(*) AS MAX_POSITION' );
|
||||
@@ -334,13 +323,13 @@ class Step extends BaseStep {
|
||||
$oCriteria2->add( StepPeer::STEP_UID, $sStepUID );
|
||||
BasePeer::doUpdate( $oCriteria2, $oCriteria1, Propel::getConnection( 'workflow' ) );
|
||||
}
|
||||
}
|
||||
catch (Exception $oException) {
|
||||
} catch (Exception $oException) {
|
||||
throw $oException;
|
||||
}
|
||||
}
|
||||
|
||||
function removeStep($sType = '', $sObjUID = '') {
|
||||
public function removeStep ($sType = '', $sObjUID = '')
|
||||
{
|
||||
try {
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->add( StepPeer::STEP_TYPE_OBJ, $sType );
|
||||
@@ -353,8 +342,7 @@ class Step extends BaseStep {
|
||||
$this->remove( $aRow['STEP_UID'] );
|
||||
$oDataset->next();
|
||||
}
|
||||
}
|
||||
catch (Exception $oException) {
|
||||
} catch (Exception $oException) {
|
||||
throw $oException;
|
||||
}
|
||||
}
|
||||
@@ -365,18 +353,17 @@ class Step extends BaseStep {
|
||||
* @param string $sUid the uid of the
|
||||
*/
|
||||
|
||||
function StepExists ( $sUid ) {
|
||||
public function StepExists ($sUid)
|
||||
{
|
||||
$con = Propel::getConnection( StepPeer::DATABASE_NAME );
|
||||
try {
|
||||
$oObj = StepPeer::retrieveByPk( $sUid );
|
||||
if (is_object( $oObj ) && get_class( $oObj ) == 'Step') {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
} catch (Exception $oError) {
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
@@ -387,7 +374,8 @@ class Step extends BaseStep {
|
||||
* @param string $sproUid the uid of the process
|
||||
* @param string $sObjUID the uid of the dynaform
|
||||
*/
|
||||
function loadInfoAssigDynaform($sproUid,$sObjUID){
|
||||
public function loadInfoAssigDynaform ($sproUid, $sObjUID)
|
||||
{
|
||||
|
||||
require_once ("classes/model/DynaformPeer.php");
|
||||
G::LoadSystem( 'dynaformhandler' );
|
||||
@@ -400,7 +388,6 @@ class Step extends BaseStep {
|
||||
$oDataset->next();
|
||||
$aRow = $oDataset->getRow();
|
||||
|
||||
|
||||
if ($aRow['DYN_TYPE'] != 'xmlform') {
|
||||
|
||||
$oC1 = new Criteria( 'workflow' );
|
||||
@@ -439,15 +426,14 @@ class Step extends BaseStep {
|
||||
$aRow = $oDataset->getRow();
|
||||
return ($aRow);
|
||||
}
|
||||
die;
|
||||
die();
|
||||
}
|
||||
|
||||
function getAttribute($node, $attName){
|
||||
public function getAttribute ($node, $attName)
|
||||
{
|
||||
|
||||
foreach ( $node->attributes as $attribute )
|
||||
{
|
||||
if ( $attribute->name == $attName )
|
||||
{
|
||||
foreach ($node->attributes as $attribute) {
|
||||
if ($attribute->name == $attName) {
|
||||
return $attribute->value;
|
||||
}
|
||||
|
||||
@@ -460,8 +446,8 @@ class Step extends BaseStep {
|
||||
* @param string $sproUid the uid of the process
|
||||
* @param string $sdbsUid the uid of the db connection
|
||||
*/
|
||||
function loadInfoAssigConnecctionDB($sproUid,$sdbsUid){
|
||||
|
||||
public function loadInfoAssigConnecctionDB ($sproUid, $sdbsUid)
|
||||
{
|
||||
require_once ("classes/model/DynaformPeer.php");
|
||||
G::LoadSystem( 'dynaformhandler' );
|
||||
$swDynaform = true;
|
||||
@@ -499,6 +485,7 @@ class Step extends BaseStep {
|
||||
$swDynaform = false;
|
||||
} //end foreach
|
||||
|
||||
|
||||
} //end if
|
||||
$oDataset->next();
|
||||
} //end while
|
||||
@@ -510,7 +497,7 @@ class Step extends BaseStep {
|
||||
//there is a db connection, you can not delete this connection
|
||||
return false;
|
||||
}
|
||||
die;
|
||||
die();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -518,7 +505,7 @@ class Step extends BaseStep {
|
||||
*
|
||||
* @author Erik A. O. <erik@colosa.com>
|
||||
*/
|
||||
function getAllCaseSteps($PRO_UID, $TAS_UID, $APP_UID)
|
||||
public function getAllCaseSteps ($PRO_UID, $TAS_UID, $APP_UID)
|
||||
{
|
||||
|
||||
$c = new Criteria();
|
||||
@@ -537,7 +524,8 @@ class Step extends BaseStep {
|
||||
* @param string $sdbsUid the uid of the db connection
|
||||
* @author krlos <carlos@colosa.com>
|
||||
*/
|
||||
function lookingforUidGrids($sproUid,$sObjUID) {
|
||||
public function lookingforUidGrids ($sproUid, $sObjUID)
|
||||
{
|
||||
|
||||
require_once ("classes/model/DynaformPeer.php");
|
||||
G::LoadSystem( 'dynaformhandler' );
|
||||
@@ -551,7 +539,6 @@ class Step extends BaseStep {
|
||||
$aRow = $oDataset->getRow();
|
||||
|
||||
if ($aRow['DYN_TYPE'] == 'xmlform') {
|
||||
|
||||
$oC1 = new Criteria( 'workflow' );
|
||||
$oC1->add( DynaformPeer::PRO_UID, $sproUid );
|
||||
$oC1->add( DynaformPeer::DYN_TYPE, "xmlform" );
|
||||
@@ -581,21 +568,6 @@ class Step extends BaseStep {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} // Step
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
// Step
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ class adminProxy extends HttpProxyController
|
||||
$updateRedirector = false;
|
||||
$restart = false;
|
||||
|
||||
if (!file_exists($envFile) ) { // if ini file doesn't exists
|
||||
if (!file_exists($envFile) ) {
|
||||
if (!is_writable(PATH_CONFIG)) {
|
||||
throw new Exception('The enviroment config directory is not writable. <br/>Please give write permission to directory: /workflow/engine/config');
|
||||
}
|
||||
@@ -41,8 +41,7 @@ class adminProxy extends HttpProxyController
|
||||
$content .= ";\r\n";
|
||||
file_put_contents($envFile, $content);
|
||||
//@chmod($envFile, 0777);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (!is_writable($envFile)) {
|
||||
throw new Exception('The enviroment ini file file is not writable. <br/>Please give write permission to file: /workflow/engine/config/env.ini');
|
||||
}
|
||||
@@ -90,8 +89,7 @@ class adminProxy extends HttpProxyController
|
||||
if ($updateRedirector) {
|
||||
if (!file_exists(PATH_HTML . 'index.html')) {
|
||||
throw new Exception('The index.html file is not writable on workflow/public_html directory.');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (!is_writable(PATH_HTML . 'index.html')) {
|
||||
throw new Exception(G::LoadTranslation('ID_INDEX_NOT_WRITEABLE') . ' /workflow/public_html/index.html');
|
||||
}
|
||||
@@ -108,8 +106,7 @@ class adminProxy extends HttpProxyController
|
||||
G::update_php_ini($envFile, $updatedConf);
|
||||
if (substr($sysConf['default_skin'], 0, 2) == 'ux') {
|
||||
$urlPart = '/main/login';
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$urlPart = '/login/login';
|
||||
}
|
||||
|
||||
@@ -119,7 +116,7 @@ class adminProxy extends HttpProxyController
|
||||
$this->message = 'Saved Successfully';
|
||||
}
|
||||
|
||||
function uxUserUpdate($httpData)
|
||||
public function uxUserUpdate($httpData)
|
||||
{
|
||||
require_once 'classes/model/Users.php';
|
||||
$data = G::json_decode($httpData->users);
|
||||
@@ -127,8 +124,7 @@ class adminProxy extends HttpProxyController
|
||||
|
||||
if (!is_array($data)) {
|
||||
$list[0] = (array) $data ;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$list = $data;
|
||||
}
|
||||
|
||||
@@ -149,15 +145,15 @@ class adminProxy extends HttpProxyController
|
||||
|
||||
if (count($rows) == 1) {
|
||||
$retRow = $rows[0];
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$retRow = $rows;
|
||||
}
|
||||
|
||||
return array('success' => true, 'message'=>'done', 'users'=>$retRow);
|
||||
}
|
||||
|
||||
function calendarValidate($httpData) {
|
||||
public function calendarValidate($httpData)
|
||||
{
|
||||
$httpData=array_unique((array)$httpData);
|
||||
$message = '';
|
||||
$oldName = isset($_POST['oldName'])? $_POST['oldName']:'';
|
||||
@@ -177,8 +173,7 @@ class adminProxy extends HttpProxyController
|
||||
}
|
||||
if ($aDefinitions['CALENDAR_NAME'] != $_POST['name']) {
|
||||
$validated = true;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if ($aDefinitions['CALENDAR_NAME'] != $oldName) {
|
||||
$validated = false;
|
||||
$message = G::loadTranslation('ID_CALENDAR_INVALID_NAME');
|
||||
@@ -195,7 +190,7 @@ class adminProxy extends HttpProxyController
|
||||
return $message;
|
||||
}
|
||||
|
||||
function uxGroupUpdate($httpData)
|
||||
public function uxGroupUpdate($httpData)
|
||||
{
|
||||
G::LoadClass('groups');
|
||||
$groups = new Groups();
|
||||
@@ -216,7 +211,7 @@ class adminProxy extends HttpProxyController
|
||||
return array('success' => $success, 'users' => $usersAdmin);
|
||||
}
|
||||
|
||||
function getUxTypesList($type = 'assoc')
|
||||
public function getUxTypesList($type = 'assoc')
|
||||
{
|
||||
$list = array();
|
||||
|
||||
@@ -227,8 +222,7 @@ class adminProxy extends HttpProxyController
|
||||
'SWITCHABLE' => 'Switchable',
|
||||
'SINGLE' => 'Single Application'
|
||||
);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$list = array(
|
||||
array('NORMAL', 'Normal'),
|
||||
array('SIMPLIFIED', 'Simplified'),
|
||||
@@ -236,11 +230,10 @@ class adminProxy extends HttpProxyController
|
||||
array('SINGLE', 'Single Application')
|
||||
);
|
||||
}
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
function calendarSave()
|
||||
public function calendarSave()
|
||||
{
|
||||
//{ $_POST['BUSINESS_DAY']
|
||||
$businessDayArray = G::json_decode($_POST['BUSINESS_DAY']);
|
||||
@@ -286,7 +279,6 @@ class adminProxy extends HttpProxyController
|
||||
G::LoadClass('calendar');
|
||||
$calendarObj=new calendar();
|
||||
$calendarObj->saveCalendarInfo($form);
|
||||
|
||||
echo "{success: true}";
|
||||
}
|
||||
|
||||
@@ -295,21 +287,21 @@ class adminProxy extends HttpProxyController
|
||||
* @param object $params
|
||||
* @return array $data
|
||||
*/
|
||||
function testingOption($params){
|
||||
|
||||
public function testingOption($params)
|
||||
{
|
||||
$data['success'] = true;
|
||||
$data['optionAuthS'] = $params->optionAuthS;
|
||||
return $data;
|
||||
|
||||
}// end testingOption function
|
||||
}
|
||||
|
||||
/**
|
||||
* saving the authentication source data
|
||||
* @param object $params
|
||||
* @return array $data
|
||||
*/
|
||||
function saveAuthSources($params){
|
||||
|
||||
public function saveAuthSources($params)
|
||||
{
|
||||
global $RBAC;
|
||||
if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1) {
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
@@ -336,34 +328,31 @@ class adminProxy extends HttpProxyController
|
||||
foreach ($params as $sField => $sValue) {
|
||||
if (in_array($sField, $aCommonFields)) {
|
||||
$aFields[$sField] = (($sField=='AUTH_SOURCE_ENABLED_TLS' || $sField=='AUTH_ANONYMOUS'))? ($sValue=='yes')?1:0 :$sValue;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$aData[$sField] = ($sValue=='Active Directory')?'ad':$sValue;
|
||||
}
|
||||
}
|
||||
$aFields['AUTH_SOURCE_DATA'] = $aData;
|
||||
if ($aFields['AUTH_SOURCE_UID'] == '') {
|
||||
$RBAC->createAuthSource($aFields);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$RBAC->updateAuthSource($aFields);
|
||||
}
|
||||
$data=array();
|
||||
$data['success'] = true;
|
||||
return $data;
|
||||
}//end saveAuthSoruces function
|
||||
}
|
||||
|
||||
/**
|
||||
* for Test email configuration
|
||||
* @autor Alvaro <alvaro@colosa.com>
|
||||
*/
|
||||
public function testConnection($params) {
|
||||
|
||||
public function testConnection($params)
|
||||
{
|
||||
G::LoadClass('net');
|
||||
G::LoadThirdParty('phpmailer', 'class.smtp');
|
||||
|
||||
if ($_POST['typeTest'] == 'MAIL')
|
||||
{
|
||||
if ($_POST['typeTest'] == 'MAIL') {
|
||||
define("SUCCESSFUL", 'SUCCESSFUL');
|
||||
define("FAILED", 'FAILED');
|
||||
$mail_to = $_POST['mail_to'];
|
||||
@@ -388,9 +377,9 @@ class adminProxy extends HttpProxyController
|
||||
|
||||
$response = array('success' => $resp->status);
|
||||
|
||||
if ($resp->status == false)
|
||||
if ($resp->status == false) {
|
||||
$response['msg'] = G::LoadTranslation('ID_SENDMAIL_NOT_INSTALLED');
|
||||
|
||||
}
|
||||
echo G::json_encode($response);
|
||||
die;
|
||||
}
|
||||
@@ -437,20 +426,17 @@ class adminProxy extends HttpProxyController
|
||||
$this->success = $Server->getErrno() == 0;
|
||||
$this->msg = $this->result ? 'success' : $Server->error;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
$Server->scannPort($port);
|
||||
|
||||
$this->success = $Server->getErrno() == 0; //'Successfull'.$smtp->status;
|
||||
$this->msg = $this->result ? '' : $Server->error;
|
||||
break;
|
||||
|
||||
case 3: //try to connect to host
|
||||
if (preg_match('/^(.+):([0-9]+)$/', $srv, $hostinfo)) {
|
||||
$server = $hostinfo[1];
|
||||
$port = $hostinfo[2];
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$host = $srv;
|
||||
}
|
||||
|
||||
@@ -459,17 +445,14 @@ class adminProxy extends HttpProxyController
|
||||
|
||||
$this->success = $smtp->Connect(($ssl ? 'ssl://':'').$server, $port, $timeout);
|
||||
$this->msg = $this->result ? '' : $Server->error;
|
||||
|
||||
break;
|
||||
|
||||
case 4: //try login to host
|
||||
if ($auth_required == 'true') {
|
||||
try {
|
||||
if (preg_match('/^(.+):([0-9]+)$/', $srv, $hostinfo)) {
|
||||
$server = $hostinfo[1];
|
||||
$port = $hostinfo[2];
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$server = $srv;
|
||||
}
|
||||
if (strtoupper($UseSecureCon)=='TLS') {
|
||||
@@ -486,44 +469,35 @@ class adminProxy extends HttpProxyController
|
||||
|
||||
if (strtoupper($UseSecureCon) == 'SSL') {
|
||||
$resp = $smtp->Connect(('ssl://').$server, $port, $timeout);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$resp = $smtp->Connect($server, $port, $timeout);
|
||||
}
|
||||
|
||||
if ($resp) {
|
||||
$hello = $_SERVER['SERVER_NAME'];
|
||||
$smtp->Hello($hello);
|
||||
|
||||
if (strtoupper($UseSecureCon) == 'TLS') {
|
||||
$smtp->Hello($hello);
|
||||
}
|
||||
|
||||
if ( $smtp->Authenticate($user, $passwd) ) {
|
||||
$this->success = true;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$this->success = false;
|
||||
$this->msg = $smtp->error['error'];
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$this->success = false;
|
||||
$this->msg = $smtp->error['error'];
|
||||
}
|
||||
}
|
||||
catch (Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$this->success = false;
|
||||
$this->msg = $e->getMessage();
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$this->success = true;
|
||||
$this->msg = 'No authentication required!';
|
||||
}
|
||||
break;
|
||||
|
||||
case 5: //send a test mail
|
||||
case 5:
|
||||
if ($SendaTestMail == 'true') {
|
||||
try {
|
||||
$_POST['FROM_NAME'] = 'Process Maker O.S. [Test mail]';
|
||||
@@ -537,34 +511,27 @@ class adminProxy extends HttpProxyController
|
||||
|
||||
if ($auth_required == 'true') {
|
||||
$_POST['SMTPAuth'] = true;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$_POST['SMTPAuth'] = false;
|
||||
}
|
||||
|
||||
if (strtolower($_POST["UseSecureCon"]) != "no") {
|
||||
$_POST["SMTPSecure"] = $_POST["UseSecureCon"];
|
||||
}
|
||||
|
||||
if ($_POST['UseSecureCon'] == 'ssl') {
|
||||
$_POST['MESS_SERVER'] = 'ssl://'.$_POST['MESS_SERVER'];
|
||||
}
|
||||
|
||||
$resp = $this->sendTestMail();
|
||||
if ($resp->status == '1') {
|
||||
$this->success=true;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$this->success=false;
|
||||
$this->msg=$smtp->error['error'];
|
||||
}
|
||||
}
|
||||
catch (Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$this->success = false;
|
||||
$this->msg = $e->getMessage();
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$this->success=true;
|
||||
$this->msg='jump this step';
|
||||
}
|
||||
@@ -576,8 +543,8 @@ class adminProxy extends HttpProxyController
|
||||
* for send email configuration
|
||||
* @autor Alvaro <alvaro@colosa.com>
|
||||
*/
|
||||
public function sendTestMail() {
|
||||
|
||||
public function sendTestMail()
|
||||
{
|
||||
global $G_PUBLISH;
|
||||
G::LoadClass("system");
|
||||
G::LoadClass('spool');
|
||||
@@ -590,11 +557,9 @@ class adminProxy extends HttpProxyController
|
||||
case 'MAIL':
|
||||
$engine = G::LoadTranslation('ID_MESS_ENGINE_TYPE_1');
|
||||
break;
|
||||
|
||||
case 'PHPMAILER':
|
||||
$engine = G::LoadTranslation('ID_MESS_ENGINE_TYPE_2');
|
||||
break;
|
||||
|
||||
case 'OPENMAIL':
|
||||
$engine = G::LoadTranslation('ID_MESS_ENGINE_TYPE_3');
|
||||
break;
|
||||
@@ -648,8 +613,7 @@ class adminProxy extends HttpProxyController
|
||||
$o->status = true;
|
||||
$o->success = true;
|
||||
$o->msg = G::LoadTranslation('ID_MAIL_TEST_SUCCESS');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$o->status = false;
|
||||
$o->success = false;
|
||||
$o->msg = $oSpool->error;
|
||||
@@ -661,10 +625,9 @@ class adminProxy extends HttpProxyController
|
||||
* getting Save email configuration
|
||||
* @autor Alvaro <alvaro@colosa.com>
|
||||
*/
|
||||
public function saveConfiguration() {
|
||||
|
||||
public function saveConfiguration()
|
||||
{
|
||||
require_once 'classes/model/Configuration.php';
|
||||
|
||||
try {
|
||||
$oConfiguration = new Configuration();
|
||||
$aFields['MESS_PASSWORD'] = $_POST['passwd'];
|
||||
@@ -687,7 +650,7 @@ class adminProxy extends HttpProxyController
|
||||
}
|
||||
$aFields['MESS_PASSWORD'] = $passwd;
|
||||
|
||||
if ($aFields['MESS_PASSWORD'] != '') { // for plain text
|
||||
if ($aFields['MESS_PASSWORD'] != '') {
|
||||
$aFields['MESS_PASSWORD'] = 'hash:'.$aFields['MESS_PASSWORD'];
|
||||
$aFields['MESS_PASSWORD'] = G::encrypt($aFields['MESS_PASSWORD'],'EMAILENCRYPT');
|
||||
}
|
||||
@@ -727,8 +690,7 @@ class adminProxy extends HttpProxyController
|
||||
);
|
||||
$this->success='true';
|
||||
$this->msg='Saved';
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$oConfiguration->create(
|
||||
array(
|
||||
'CFG_UID' => 'Emails',
|
||||
@@ -742,8 +704,7 @@ class adminProxy extends HttpProxyController
|
||||
$this->success='true';
|
||||
$this->msg='Saved';
|
||||
}
|
||||
}
|
||||
catch (Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$this->success= false;
|
||||
$this->msg = $e->getMessage();
|
||||
}
|
||||
@@ -753,8 +714,8 @@ class adminProxy extends HttpProxyController
|
||||
* loadFields for email configuration
|
||||
* @autor Alvaro <alvaro@colosa.com>
|
||||
*/
|
||||
public function loadFields() {
|
||||
|
||||
public function loadFields()
|
||||
{
|
||||
G::loadClass('configuration');
|
||||
|
||||
$oConfiguration = new Configurations();
|
||||
@@ -796,6 +757,7 @@ class adminProxy extends HttpProxyController
|
||||
G::mk_dir ( $dir );
|
||||
$i = 0;
|
||||
$images = array();
|
||||
|
||||
/** if we have at least one image it's load */
|
||||
if (file_exists($dir)) {
|
||||
if ($handle = opendir($dir)) {
|
||||
@@ -804,12 +766,9 @@ class adminProxy extends HttpProxyController
|
||||
$extention = explode(".", $file);
|
||||
$aImageProp = getimagesize($dir . '/' . $file, $info);
|
||||
$sfileExtention = strtoupper($extention[count($extention)-1]);
|
||||
|
||||
if ( in_array($sfileExtention, array('JPG', 'JPEG', 'PNG', 'GIF') ) ) {
|
||||
|
||||
$check = (!strcmp($file, $sPhotoSelect)) ? '/images/toadd.png' : '/images/delete.png';
|
||||
$onclick = (strcmp($file, $sPhotoSelect)) ? "onclick ='deleteLogo(\" $file \");return false;'" : '';
|
||||
|
||||
if ($i == 0) {
|
||||
$i++;
|
||||
}
|
||||
@@ -831,12 +790,13 @@ class adminProxy extends HttpProxyController
|
||||
echo G::json_encode($o);
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Change Name logo
|
||||
* @param type $snameLogo
|
||||
* @return type $snameLogo
|
||||
*/
|
||||
function changeNamelogo($snameLogo)
|
||||
public function changeNamelogo($snameLogo)
|
||||
{
|
||||
$snameLogo = preg_replace("/[áàâãª]/", "a", $snameLogo);
|
||||
$snameLogo = preg_replace("/[ÁÀÂÃ]/", "A", $snameLogo);
|
||||
@@ -854,6 +814,7 @@ class adminProxy extends HttpProxyController
|
||||
$snameLogo = str_replace( "[Ñ]", "N", $snameLogo);
|
||||
return ($snameLogo);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Thumb
|
||||
* @param type $img_file
|
||||
@@ -861,7 +822,7 @@ class adminProxy extends HttpProxyController
|
||||
* @param type $thumb_path
|
||||
* @param type $img_type
|
||||
*/
|
||||
function createThumb($img_file, $ori_path, $thumb_path, $img_type)
|
||||
public function createThumb($img_file, $ori_path, $thumb_path, $img_type)
|
||||
{
|
||||
$path = $ori_path;
|
||||
$img = $path.$img_file;
|
||||
@@ -946,10 +907,8 @@ class adminProxy extends HttpProxyController
|
||||
$img_thumb_square = imagecreatefromgif($thumb);
|
||||
break;
|
||||
}
|
||||
|
||||
$thumb_width = imagesx($img_thumb_square);
|
||||
$thumb_height = imagesy($img_thumb_square);
|
||||
|
||||
if ($thumb_height < $thumb_width) {
|
||||
// wide
|
||||
$x_src = ($thumb_width - $square_size) / 2;
|
||||
@@ -957,16 +916,14 @@ class adminProxy extends HttpProxyController
|
||||
$img_final = imagecreatetruecolor($square_size, $square_size);
|
||||
imagecopy($img_final, $img_thumb_square, 0, 0,
|
||||
$x_src, $y_src, $square_size, $square_size);
|
||||
}
|
||||
else if ($thumb_height > $thumb_width) {
|
||||
} elseif ($thumb_height > $thumb_width) {
|
||||
// landscape
|
||||
$x_src = 0;
|
||||
$y_src = ($thumb_height - $square_size) / 2;
|
||||
$img_final = imagecreatetruecolor($square_size, $square_size);
|
||||
imagecopy($img_final, $img_thumb_square, 0, 0,
|
||||
$x_src, $y_src, $square_size, $square_size);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$img_final = imagecreatetruecolor($square_size, $square_size);
|
||||
imagecopy($img_final, $img_thumb_square, 0, 0,
|
||||
0, 0, $square_size, $square_size);
|
||||
@@ -995,7 +952,7 @@ class adminProxy extends HttpProxyController
|
||||
* Upload Image
|
||||
* @global type $_FILES
|
||||
*/
|
||||
function uploadImage()
|
||||
public function uploadImage()
|
||||
{
|
||||
//!dataSystem
|
||||
$ainfoSite = explode("/", $_SERVER["REQUEST_URI"]);
|
||||
@@ -1028,7 +985,6 @@ class adminProxy extends HttpProxyController
|
||||
if (in_array($_FILES['img']['type'], $allowedType)) {
|
||||
// max upload file is 500 KB
|
||||
if ($_FILES['img']['size'] <= 500000) {
|
||||
|
||||
$formf = $_FILES['img'];
|
||||
$namefile = $formf['name'];
|
||||
$typefile = $formf['type'];
|
||||
@@ -1037,43 +993,34 @@ class adminProxy extends HttpProxyController
|
||||
$aMessage1 = array();
|
||||
$fileName = trim(str_replace(' ', '_', $namefile));
|
||||
$fileName = self::changeNamelogo($fileName);
|
||||
|
||||
G::uploadFile($tmpFile, $dir, 'tmp' . $fileName);
|
||||
|
||||
try {
|
||||
if (extension_loaded('exif')) {
|
||||
$typeMime = exif_imagetype($dir . '/'. 'tmp'.$fileName);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$arrayInfo = getimagesize($dir . '/' . 'tmp' . $fileName);
|
||||
$typeMime = $arrayInfo[2];
|
||||
}
|
||||
|
||||
if ($typeMime == $allowedTypeArray['index' . base64_encode($_FILES['img']['type'])]) {
|
||||
$error = false;
|
||||
try {
|
||||
list($imageWidth, $imageHeight, $imageType) = @getimagesize($dir . '/' . 'tmp' . $fileName);
|
||||
G::resizeImage($dir . '/tmp' . $fileName, $imageWidth, 49, $dir . '/' . $fileName);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$error = $e->getMessage();
|
||||
}
|
||||
$uploaded++;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$failed = "3";
|
||||
}
|
||||
unlink ($dir . '/tmp' . $fileName);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$failed = "3";
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$failed = "2";
|
||||
}
|
||||
}
|
||||
else if ($_FILES['img']['type'] != '') {
|
||||
} elseif ($_FILES['img']['type'] != '') {
|
||||
$failed = "1";
|
||||
}
|
||||
|
||||
@@ -1085,7 +1032,7 @@ class adminProxy extends HttpProxyController
|
||||
* Get Name Current Logo
|
||||
* @return type
|
||||
*/
|
||||
function getNameCurrentLogo()
|
||||
public function getNameCurrentLogo()
|
||||
{
|
||||
G::LoadClass('replacementLogo');
|
||||
$upload = new replacementLogo();
|
||||
@@ -1099,7 +1046,7 @@ class adminProxy extends HttpProxyController
|
||||
* @param type $selectLogo
|
||||
* @return type int value
|
||||
*/
|
||||
function isCurrentLogo()
|
||||
public function isCurrentLogo()
|
||||
{
|
||||
$arrayImg = explode(";", $_POST['selectLogo']);
|
||||
foreach ($arrayImg as $imgname) {
|
||||
@@ -1120,7 +1067,7 @@ class adminProxy extends HttpProxyController
|
||||
* @param
|
||||
* @return string '{success: true | false}'
|
||||
*/
|
||||
function deleteImage()
|
||||
public function deleteImage()
|
||||
{
|
||||
//!dataSystem
|
||||
$ainfoSite = explode("/", $_SERVER["REQUEST_URI"]);
|
||||
@@ -1141,8 +1088,7 @@ class adminProxy extends HttpProxyController
|
||||
if (file_exists($dir . '/tmp' . $imgname)) {
|
||||
unlink ($dir . '/tmp' . $imgname);
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
echo '{success: false}';
|
||||
exit();
|
||||
}
|
||||
@@ -1157,13 +1103,13 @@ class adminProxy extends HttpProxyController
|
||||
* @global type $_REQUEST
|
||||
* @global type $RBAC
|
||||
*/
|
||||
function replacementLogo()
|
||||
public function replacementLogo()
|
||||
{
|
||||
global $_REQUEST;
|
||||
$sfunction = $_REQUEST['nameFunction'];
|
||||
$_GET['NAMELOGO'] = $_REQUEST['NAMELOGO'];
|
||||
|
||||
try {//ini_set('display_errors','1');
|
||||
try {
|
||||
global $RBAC;
|
||||
switch ($RBAC->userCanAccess('PM_LOGIN')) {
|
||||
case -2:
|
||||
@@ -1210,8 +1156,7 @@ class adminProxy extends HttpProxyController
|
||||
G::SendTemporalMessage('ID_REPLACED_LOGO', 'tmp-info', 'labels');
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (Exception $oException) {
|
||||
} catch (Exception $oException) {
|
||||
die($oException->getMessage());
|
||||
}
|
||||
exit();
|
||||
@@ -1221,7 +1166,7 @@ class adminProxy extends HttpProxyController
|
||||
* Show Logo
|
||||
* @param type $imagen
|
||||
*/
|
||||
function showLogo($imagen)
|
||||
public function showLogo($imagen)
|
||||
{
|
||||
$info = @getimagesize($imagen);
|
||||
$fp = fopen($imagen, "rb");
|
||||
@@ -1229,8 +1174,7 @@ class adminProxy extends HttpProxyController
|
||||
header("Content-type: {$info['mime']}");
|
||||
fpassthru($fp);
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
throw new Exception("Image format not valid");
|
||||
}
|
||||
}
|
||||
@@ -1240,7 +1184,7 @@ class adminProxy extends HttpProxyController
|
||||
* @param type $dir
|
||||
* @param type $newDir
|
||||
*/
|
||||
function cpyMoreLogos($dir,$newDir)
|
||||
public function cpyMoreLogos($dir, $newDir)
|
||||
{
|
||||
if (file_exists($dir)) {
|
||||
if (($handle = opendir($dir))) {
|
||||
@@ -1250,7 +1194,6 @@ class adminProxy extends HttpProxyController
|
||||
$aImageProp = getimagesize($dir . '/' . $file, $info);
|
||||
$sfileExtention = strtoupper($extention[count($extention)-1]);
|
||||
if ( in_array($sfileExtention, array('JPG', 'JPEG', 'PNG', 'GIF') ) ) {
|
||||
|
||||
$dir1 = $dir . PATH_SEP . $file;
|
||||
$dir2 = $newDir . PATH_SEP . $file;
|
||||
copy($dir1, $dir2);
|
||||
@@ -1265,7 +1208,7 @@ class adminProxy extends HttpProxyController
|
||||
/**
|
||||
* Show Logo File
|
||||
*/
|
||||
function showLogoFile()
|
||||
public function showLogoFile()
|
||||
{
|
||||
$_GET['id'] = $_REQUEST['id'];
|
||||
|
||||
@@ -1276,16 +1219,13 @@ class adminProxy extends HttpProxyController
|
||||
|
||||
if (is_file($imagen)) {
|
||||
self::showLogo($imagen);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$newDir = PATH_DATA . "sites" . PATH_SEP.str_replace("sys", "", $ainfoSite[1]).PATH_SEP."files/logos";
|
||||
$dir = PATH_HOME . "public_html/files/logos";
|
||||
|
||||
if (!is_dir($newDir)) {
|
||||
G::mk_dir($newDir);
|
||||
}
|
||||
//this function does copy all logos from public_html/files/logos to /shared/site/yourSite/files/logos
|
||||
//cpyMoreLogos($dir,$newDir);
|
||||
$newDir .= PATH_SEP.$base64Id;
|
||||
$dir .= PATH_SEP.$base64Id;
|
||||
copy($dir,$newDir);
|
||||
@@ -1295,5 +1235,5 @@ class adminProxy extends HttpProxyController
|
||||
die;
|
||||
exit();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ $ajax->$action( $_REQUEST );
|
||||
class Ajax
|
||||
{
|
||||
|
||||
function getCaseMenu ($params)
|
||||
public function getCaseMenu ($params)
|
||||
{
|
||||
|
||||
G::LoadClass( "configuration" );
|
||||
@@ -59,8 +59,7 @@ class Ajax
|
||||
|
||||
$menuOptions = Array ();
|
||||
foreach ($oMenu->Options as $i => $action) {
|
||||
$option = Array ('id' => $oMenu->Id[$i],'label' => $oMenu->Labels[$i],'action' => $action
|
||||
);
|
||||
$option = Array ('id' => $oMenu->Id[$i],'label' => $oMenu->Labels[$i],'action' => $action);
|
||||
|
||||
switch ($option['id']) {
|
||||
case 'STEPS':
|
||||
@@ -79,7 +78,7 @@ class Ajax
|
||||
echo G::json_encode( $menuOptions );
|
||||
}
|
||||
|
||||
function steps ()
|
||||
public function steps ()
|
||||
{
|
||||
G::LoadClass( 'applications' );
|
||||
$applications = new Applications();
|
||||
@@ -122,30 +121,22 @@ class Ajax
|
||||
echo G::json_encode( $list );
|
||||
}
|
||||
|
||||
function getInformationOptions ()
|
||||
public function getInformationOptions ()
|
||||
{
|
||||
$options = Array ();
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_PROCESS_MAP' ),'fn' => 'processMap'
|
||||
);
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_PROCESS_INFORMATION' ),'fn' => 'processInformation'
|
||||
);
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_TASK_INFORMATION' ),'fn' => 'taskInformation'
|
||||
);
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_CASE_HISTORY' ),'fn' => 'caseHistory'
|
||||
);
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_HISTORY_MESSAGE_CASE' ),'fn' => 'messageHistory'
|
||||
);
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_DYNAFORMS' ),'fn' => 'dynaformHistory'
|
||||
);
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_UPLOADED_DOCUMENTS' ),'fn' => 'uploadedDocuments'
|
||||
);
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_GENERATED_DOCUMENTS' ),'fn' => 'generatedDocuments'
|
||||
);
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_PROCESS_MAP' ),'fn' => 'processMap' );
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_PROCESS_INFORMATION' ),'fn' => 'processInformation');
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_TASK_INFORMATION' ),'fn' => 'taskInformation');
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_CASE_HISTORY' ),'fn' => 'caseHistory');
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_HISTORY_MESSAGE_CASE' ),'fn' => 'messageHistory');
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_DYNAFORMS' ),'fn' => 'dynaformHistory' );
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_UPLOADED_DOCUMENTS' ),'fn' => 'uploadedDocuments');
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_GENERATED_DOCUMENTS' ),'fn' => 'generatedDocuments');
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
function getActionOptions ()
|
||||
public function getActionOptions ()
|
||||
{
|
||||
$APP_UID = $_SESSION['APPLICATION'];
|
||||
|
||||
@@ -166,47 +157,36 @@ class Ajax
|
||||
switch ($aFields['APP_STATUS']) {
|
||||
case 'DRAFT':
|
||||
if (! AppDelay::isPaused( $_SESSION['APPLICATION'], $_SESSION['INDEX'] )) {
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_PAUSED_CASE' ),'fn' => 'setUnpauseCaseDate'
|
||||
);
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_PAUSED_CASE' ),'fn' => 'setUnpauseCaseDate');
|
||||
} else {
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_UNPAUSE' ),'fn' => 'unpauseCase'
|
||||
);
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_UNPAUSE' ),'fn' => 'unpauseCase');
|
||||
}
|
||||
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_DELETE' ),'fn' => 'deleteCase'
|
||||
);
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_DELETE' ),'fn' => 'deleteCase');
|
||||
|
||||
if ($RBAC->userCanAccess( 'PM_REASSIGNCASE' ) == 1) {
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_REASSIGN' ),'fn' => 'getUsersToReassign'
|
||||
);
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_REASSIGN' ),'fn' => 'getUsersToReassign');
|
||||
}
|
||||
break;
|
||||
|
||||
case 'TO_DO':
|
||||
if (! AppDelay::isPaused( $_SESSION['APPLICATION'], $_SESSION['INDEX'] )) {
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_PAUSED_CASE' ),'fn' => 'setUnpauseCaseDate'
|
||||
);
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_PAUSED_CASE' ),'fn' => 'setUnpauseCaseDate');
|
||||
if ($cant == 1) {
|
||||
if ($RBAC->userCanAccess( 'PM_CANCELCASE' ) == 1)
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_CANCEL' ),'fn' => 'cancelCase'
|
||||
);
|
||||
else
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_CANCEL' ),'fn' => 'cancelCase','hide' => 'hiden'
|
||||
);
|
||||
if ($RBAC->userCanAccess( 'PM_CANCELCASE' ) == 1) {
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_CANCEL' ),'fn' => 'cancelCase');
|
||||
} else {
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_CANCEL' ),'fn' => 'cancelCase','hide' => 'hiden');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_UNPAUSE' ),'fn' => 'unpauseCase'
|
||||
);
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_UNPAUSE' ),'fn' => 'unpauseCase');
|
||||
}
|
||||
if ($RBAC->userCanAccess( 'PM_REASSIGNCASE' ) == 1) {
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_REASSIGN' ),'fn' => 'getUsersToReassign'
|
||||
);
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_REASSIGN' ),'fn' => 'getUsersToReassign');
|
||||
}
|
||||
break;
|
||||
|
||||
case 'CANCELLED':
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_REACTIVATE' ),'fn' => 'reactivateCase'
|
||||
);
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_REACTIVATE' ),'fn' => 'reactivateCase');
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -214,14 +194,13 @@ class Ajax
|
||||
$oTask = new Task();
|
||||
$aTask = $oTask->load( $_SESSION['TASK'] );
|
||||
if ($aTask['TAS_TYPE'] == 'ADHOC') {
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_ADHOC_ASSIGNMENT' ),'fn' => 'adhocAssignmentUsers'
|
||||
);
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_ADHOC_ASSIGNMENT' ),'fn' => 'adhocAssignmentUsers');
|
||||
}
|
||||
}
|
||||
return $options;
|
||||
}
|
||||
|
||||
function processMap ()
|
||||
public function processMap ()
|
||||
{
|
||||
global $G_PUBLISH;
|
||||
global $G_CONTENT;
|
||||
@@ -322,7 +301,7 @@ class Ajax
|
||||
G::RenderPage( 'publish', 'blank' );
|
||||
}
|
||||
|
||||
function getProcessInformation ()
|
||||
public function getProcessInformation ()
|
||||
{
|
||||
$process = new Process();
|
||||
$processData = $process->load( $_SESSION['PROCESS'] );
|
||||
@@ -340,17 +319,18 @@ class Ajax
|
||||
print (G::json_encode( $processData )) ;
|
||||
}
|
||||
|
||||
function getTaskInformation ()
|
||||
public function getTaskInformation ()
|
||||
{
|
||||
$task = new Task();
|
||||
if ($_SESSION['TASK'] == '-1')
|
||||
if ($_SESSION['TASK'] == '-1') {
|
||||
$_SESSION['TASK'] = $_SESSION['CURRENT_TASK'];
|
||||
}
|
||||
$taskData = $task->getDelegatedTaskData( $_SESSION['TASK'], $_SESSION['APPLICATION'], $_SESSION['INDEX'] );
|
||||
|
||||
print (G::json_encode( $taskData )) ;
|
||||
}
|
||||
|
||||
function caseHistory ()
|
||||
public function caseHistory ()
|
||||
{
|
||||
global $G_PUBLISH;
|
||||
G::loadClass( 'configuration' );
|
||||
@@ -363,7 +343,7 @@ class Ajax
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
}
|
||||
|
||||
function messageHistory ()
|
||||
public function messageHistory ()
|
||||
{
|
||||
global $G_PUBLISH;
|
||||
G::loadClass( 'configuration' );
|
||||
@@ -376,7 +356,7 @@ class Ajax
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
}
|
||||
|
||||
function dynaformHistory ()
|
||||
public function dynaformHistory ()
|
||||
{
|
||||
global $G_PUBLISH;
|
||||
G::loadClass( 'configuration' );
|
||||
@@ -389,7 +369,7 @@ class Ajax
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
}
|
||||
|
||||
function uploadedDocuments ()
|
||||
public function uploadedDocuments ()
|
||||
{
|
||||
global $G_PUBLISH;
|
||||
G::loadClass( 'configuration' );
|
||||
@@ -402,7 +382,7 @@ class Ajax
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
}
|
||||
|
||||
function uploadedDocumentsSummary ()
|
||||
public function uploadedDocumentsSummary ()
|
||||
{
|
||||
global $G_PUBLISH;
|
||||
G::loadClass( 'configuration' );
|
||||
@@ -415,7 +395,7 @@ class Ajax
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
}
|
||||
|
||||
function generatedDocuments ()
|
||||
public function generatedDocuments ()
|
||||
{
|
||||
global $G_PUBLISH;
|
||||
G::loadClass( 'configuration' );
|
||||
@@ -428,7 +408,7 @@ class Ajax
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
}
|
||||
|
||||
function generatedDocumentsSummary ()
|
||||
public function generatedDocumentsSummary ()
|
||||
{
|
||||
global $G_PUBLISH;
|
||||
G::loadClass( 'configuration' );
|
||||
@@ -441,7 +421,7 @@ class Ajax
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
}
|
||||
|
||||
function cancelCase ()
|
||||
public function cancelCase ()
|
||||
{
|
||||
$oCase = new Cases();
|
||||
$multiple = false;
|
||||
@@ -452,8 +432,9 @@ class Ajax
|
||||
|
||||
$appUids = explode( ',', $APP_UID );
|
||||
$delIndexes = explode( ',', $DEL_INDEX );
|
||||
if (count( $appUids ) > 1 && count( $delIndexes ) > 1)
|
||||
if (count( $appUids ) > 1 && count( $delIndexes ) > 1) {
|
||||
$multiple = true;
|
||||
}
|
||||
} elseif (isset( $_POST['sApplicationUID'] ) && isset( $_POST['iIndex'] )) {
|
||||
$APP_UID = $_POST['sApplicationUID'];
|
||||
$DEL_INDEX = $_POST['iIndex'];
|
||||
@@ -473,13 +454,15 @@ class Ajax
|
||||
|
||||
|
||||
if ($multiple) {
|
||||
foreach ($appUids as $i => $appUid)
|
||||
foreach ($appUids as $i => $appUid) {
|
||||
$oCase->cancelCase( $appUid, $delIndexes[$i], $_SESSION['USER_LOGGED'] );
|
||||
} else
|
||||
}
|
||||
} else {
|
||||
$oCase->cancelCase( $APP_UID, $DEL_INDEX, $_SESSION['USER_LOGGED'] );
|
||||
}
|
||||
}
|
||||
|
||||
function getUsersToReassign ()
|
||||
public function getUsersToReassign ()
|
||||
{
|
||||
$case = new Cases();
|
||||
$result->data = $case->getUsersToReassign( $_SESSION['TASK'], $_SESSION['USER_LOGGED'] );
|
||||
@@ -488,7 +471,7 @@ class Ajax
|
||||
|
||||
}
|
||||
|
||||
function reassignCase ()
|
||||
public function reassignCase ()
|
||||
{
|
||||
$cases = new Cases();
|
||||
$user = new Users();
|
||||
@@ -512,7 +495,7 @@ class Ajax
|
||||
print G::json_encode( $result );
|
||||
}
|
||||
|
||||
function pauseCase ()
|
||||
public function pauseCase ()
|
||||
{
|
||||
try {
|
||||
$unpauseDate = $_REQUEST['unpauseDate'];
|
||||
@@ -553,7 +536,7 @@ class Ajax
|
||||
echo G::json_encode( $result );
|
||||
}
|
||||
|
||||
function unpauseCase ()
|
||||
public function unpauseCase ()
|
||||
{
|
||||
try {
|
||||
$applicationUID = (isset( $_POST['APP_UID'] )) ? $_POST['APP_UID'] : $_SESSION['APPLICATION'];
|
||||
@@ -575,7 +558,7 @@ class Ajax
|
||||
print G::json_encode( $result );
|
||||
}
|
||||
|
||||
function deleteCase ()
|
||||
public function deleteCase ()
|
||||
{
|
||||
try {
|
||||
$applicationUID = (isset( $_POST['APP_UID'] )) ? $_POST['APP_UID'] : $_SESSION['APPLICATION'];
|
||||
@@ -595,7 +578,7 @@ class Ajax
|
||||
print G::json_encode( $result );
|
||||
}
|
||||
|
||||
function reactivateCase ()
|
||||
public function reactivateCase ()
|
||||
{
|
||||
try {
|
||||
$applicationUID = (isset( $_POST['APP_UID'] )) ? $_POST['APP_UID'] : $_SESSION['APPLICATION'];
|
||||
@@ -617,7 +600,7 @@ class Ajax
|
||||
print G::json_encode( $result );
|
||||
}
|
||||
|
||||
function changeLogTab ()
|
||||
public function changeLogTab ()
|
||||
{
|
||||
try {
|
||||
global $G_PUBLISH;
|
||||
@@ -656,13 +639,15 @@ body {
|
||||
var return_xml=false;
|
||||
var http_request = false;
|
||||
|
||||
if (window.XMLHttpRequest) { // Mozilla, Safari,...
|
||||
if (window.XMLHttpRequest) {
|
||||
// Mozilla, Safari,...
|
||||
http_request = new XMLHttpRequest();
|
||||
if (http_request.overrideMimeType){
|
||||
http_request.overrideMimeType('text/xml');
|
||||
}
|
||||
}
|
||||
else if (window.ActiveXObject) {// IE
|
||||
elseif (window.ActiveXObject) {
|
||||
// IE
|
||||
try {
|
||||
http_request = new ActiveXObject("Msxml2.XMLHTTP");
|
||||
}
|
||||
@@ -753,8 +738,7 @@ body {
|
||||
showDynaformHistoryGlobal.idHistory = idHistory;
|
||||
showDynaformHistoryGlobal.dynDate = dynDate;
|
||||
|
||||
var url = "caseHistory_Ajax.php?actionAjax=showDynaformHistoryGetNomDynaform_JXP&idDin="+idDin+"&dynDate="+dynDate;
|
||||
ajaxPostRequest(url, 'showDynaformHistoryGetNomDynaform_RSP');
|
||||
var url = "caseHistory_Ajax.php?actionAjax=showDynaformHistoryGetNomDynaform_JXP&idDin="+idDin+"&dynDate="+dynDate;ajaxPostRequest(url, 'showDynaformHistoryGetNomDynaform_RSP');
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
@@ -769,10 +753,9 @@ body {
|
||||
}
|
||||
}
|
||||
|
||||
function dynaformViewFromHistory ()
|
||||
public function dynaformViewFromHistory ()
|
||||
{
|
||||
?>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="/css/classic.css" />
|
||||
|
||||
<script type="text/javascript">
|
||||
@@ -813,8 +796,7 @@ body {
|
||||
global $G_FORM;
|
||||
?>
|
||||
|
||||
function loadForm_<?php echo $G_FORM->id; ?>(parametro1)
|
||||
{
|
||||
function loadForm_<?php echo $G_FORM->id; ?>(parametro1) {
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -838,8 +820,7 @@ body {
|
||||
global $G_FORM;
|
||||
?>
|
||||
|
||||
function loadForm_<?php echo $G_FORM->id; ?>(parametro1)
|
||||
{
|
||||
function loadForm_<?php echo $G_FORM->id; ?>(parametro1) {
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -73,21 +73,13 @@ if ($actionAjax == 'historyGridListChangeLogPanelBody_JXP') {
|
||||
<td height=99%>
|
||||
<div
|
||||
style="width: 100%; overflow-y: scroll; overflow-x: hidden; max-height: 310px; _height: 310px; height: 310px; visibility: inherit;">
|
||||
|
||||
<?php
|
||||
require_once 'classes/model/AppHistory.php';
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'view', 'cases/cases_DynaformHistory' );
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
@@ -20,8 +20,7 @@ $functionName( $functionParams );
|
||||
|
||||
function getExtJSParams ()
|
||||
{
|
||||
$validParams = array ('callback' => '','dir' => 'DESC','sort' => '','start' => 0,'limit' => 25,'filter' => '','search' => '','action' => '','xaction' => '','data' => '','status' => '','query' => '','fields' => ""
|
||||
);
|
||||
$validParams = array ('callback' => '','dir' => 'DESC','sort' => '','start' => 0,'limit' => 25,'filter' => '','search' => '','action' => '','xaction' => '','data' => '','status' => '','query' => '','fields' => "");
|
||||
$result = array ();
|
||||
foreach ($validParams as $paramName => $paramDefault) {
|
||||
$result[$paramName] = isset( $_REQUEST[$paramName] ) ? $_REQUEST[$paramName] : isset( $_REQUEST[$paramName] ) ? $_REQUEST[$paramName] : $paramDefault;
|
||||
@@ -52,6 +51,7 @@ function getNotesList ()
|
||||
$usrUid = (isset( $_SESSION['USER_LOGGED'] )) ? $_SESSION['USER_LOGGED'] : "";
|
||||
$appNotes = new AppNotes();
|
||||
$response = $appNotes->getNotesList( $appUid, '', $start, $limit );
|
||||
|
||||
sendJsonResultGeneric( $response['array'], $callback );
|
||||
}
|
||||
|
||||
|
||||
@@ -78,4 +78,5 @@ G::RenderPage( 'publish', 'blank' );
|
||||
parent.outerLayout.hide('east');
|
||||
parent.PANEL_EAST_OPEN = false;
|
||||
</script>
|
||||
<?php
|
||||
|
||||
|
||||
@@ -20,9 +20,10 @@
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
if (($RBAC_Response=$RBAC->userCanAccess("PM_FACTORY"))!=1) return $RBAC_Response;
|
||||
if (($RBAC_Response = $RBAC->userCanAccess( "PM_FACTORY" )) != 1) {
|
||||
return $RBAC_Response;
|
||||
}
|
||||
/*
|
||||
* Created on 21/12/2007
|
||||
*
|
||||
@@ -41,29 +42,23 @@ if (($RBAC_Response=$RBAC->userCanAccess("PM_FACTORY"))!=1) return $RBAC_Respons
|
||||
$DYN_UID = (isset( $_GET['DYN_UID'] )) ? urldecode( $_GET['DYN_UID'] ) : '0';
|
||||
$_SESSION['PROCESS'] = $_GET['PRO_UID'];
|
||||
|
||||
|
||||
if ($PRO_UID==='0') return;
|
||||
$process = new Process;
|
||||
if ($process->exists($PRO_UID))
|
||||
{
|
||||
$process->load( $PRO_UID );
|
||||
if ($PRO_UID === '0') {
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
$process = new Process();
|
||||
if ($process->exists( $PRO_UID )) {
|
||||
$process->load( $PRO_UID );
|
||||
} else {
|
||||
//TODO
|
||||
print ("$PRO_UID doesn't exist, continue? yes") ;
|
||||
}
|
||||
|
||||
$dynaform = new dynaform();
|
||||
|
||||
$dynaform = new dynaform;
|
||||
|
||||
if ($dynaform->exists($DYN_UID))
|
||||
{
|
||||
if ($dynaform->exists( $DYN_UID )) {
|
||||
$dynaform->load( $DYN_UID );
|
||||
$_SESSION['CURRENT_DYN_UID'] = $DYN_UID;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
/* New Dynaform
|
||||
*
|
||||
*/
|
||||
@@ -71,11 +66,11 @@ if (($RBAC_Response=$RBAC->userCanAccess("PM_FACTORY"))!=1) return $RBAC_Respons
|
||||
}
|
||||
|
||||
//creating SESSION for redirecting to new bpmn editor after closing Dynaform
|
||||
if(isset($_GET['bpmn']) && $_GET['bpmn'] == '1')
|
||||
{$_SESSION['dynaform_editor'] = 'bpmn';}
|
||||
else if(!isset($_GET['bpmn']))
|
||||
{$_SESSION['dynaform_editor'] = 'processmap';}
|
||||
|
||||
if (isset( $_GET['bpmn'] ) && $_GET['bpmn'] == '1') {
|
||||
$_SESSION['dynaform_editor'] = 'bpmn';
|
||||
} elseif (! isset( $_GET['bpmn'] )) {
|
||||
$_SESSION['dynaform_editor'] = 'processmap';
|
||||
}
|
||||
|
||||
$editor = new dynaformEditor( $_POST );
|
||||
$editor->file = $dynaform->getDynFilename();
|
||||
@@ -90,4 +85,3 @@ if (($RBAC_Response=$RBAC->userCanAccess("PM_FACTORY"))!=1) return $RBAC_Respons
|
||||
$editor->_setUseTemporalCopy( true );
|
||||
$editor->_render();
|
||||
|
||||
?>
|
||||
@@ -211,3 +211,4 @@ G::RenderPage( "publish", "raw" );
|
||||
return myPanel;
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* eventList.php
|
||||
*
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
//$req = $_POST['request'];
|
||||
$req = (isset($_POST['request']))? $_POST['request']:((isset($_REQUEST['request']))? $_REQUEST['request'] : 'No hayyy tal');
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* eventsCompleted.php
|
||||
*
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* events_Delete.php
|
||||
*
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* events_Edit.php
|
||||
*
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* events_EditAction.php
|
||||
*
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* eventsPending.php
|
||||
*
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* events_Save.php
|
||||
*
|
||||
|
||||
@@ -70,7 +70,6 @@ imagerectangle( $im, 0, 0, $w - 1, $h - 1, $gray );
|
||||
// imageline($im, $x +$mean, $h , $x + $mean, $h-1, $red);
|
||||
// }
|
||||
|
||||
|
||||
function drawTask ($im, $x1, $x2, $y, $h)
|
||||
{
|
||||
global $w;
|
||||
@@ -88,7 +87,6 @@ function drawTask ($im, $x1, $x2, $y, $h)
|
||||
}
|
||||
imagerectangle( $im, $x1, $y - 10, $x2, $y, $black );
|
||||
}
|
||||
;
|
||||
|
||||
function smallTask ($im, $x1, $x2, $y)
|
||||
{
|
||||
@@ -120,7 +118,6 @@ function drawMultipleTask ($im, $x1, $x2, $y, $h)
|
||||
smallTask( $im, $x1 + 1 * $terca, $x1 + 2 * $terca, $y - 6 );
|
||||
smallTask( $im, $x1 + 2 * $terca, $x1 + 3 * $terca, $y );
|
||||
}
|
||||
;
|
||||
|
||||
function drawTimerEvent ($im, $x1, $y1, $h)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* triggers_Save.php
|
||||
*
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* autoinstallProcess.php
|
||||
*
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* autoinstallProcess.php
|
||||
*
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
try {
|
||||
if (isset( $_REQUEST['status'] )) {
|
||||
G::LoadClass( 'serverConfiguration' );
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* install.php
|
||||
*
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* installServer.php
|
||||
*
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* installServer.php
|
||||
*
|
||||
|
||||
@@ -33,6 +33,7 @@ define( 'SYSTEM_HASH', '$sh' );";
|
||||
|
||||
echo '<br/>';
|
||||
|
||||
|
||||
if (file_exists( FILE_PATHS_INSTALLED )) {
|
||||
if (@copy( FILE_PATHS_INSTALLED, FILE_PATHS_INSTALLED . '.backup' )) {
|
||||
echo 'Backup file was created ' . FILE_PATHS_INSTALLED . '.backup<br>';
|
||||
|
||||
Reference in New Issue
Block a user