HOR-3670-RG-4 Files review:
workflow/engine/classes/Stat.php workflow/engine/classes/Tar_File.php workflow/engine/classes/Tasks.php workflow/engine/classes/ToolBar.php workflow/engine/classes/TriggerLibrary.php
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
/**
|
/**
|
||||||
* This class is derived from the class archive, is employed to use files .bzip
|
* This class is derived from the class archive, is employed to use files .bzip
|
||||||
*/
|
*/
|
||||||
class BzipFile extends tar_file
|
class BzipFile extends TarFile
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*
|
*
|
||||||
* @package workflow.engine.classes
|
* @package workflow.engine.classes
|
||||||
*
|
*
|
||||||
*/class gzip_file extends tar_file
|
*/class gzip_file extends TarFile
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,23 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
class Stat
|
||||||
* LastModification 30/05/2008
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @package workflow.engine.classes
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @package workflow.engine.classes
|
|
||||||
*/class Stat
|
|
||||||
{
|
{
|
||||||
public $stutus;
|
public $stutus;
|
||||||
|
|
||||||
public function __construct ()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->status = false;
|
$this->status = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,25 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
/*--------------------------------------------------
|
|
||||||
* TAR/GZIP/BZIP2/ZIP ARCHIVE CLASSES 2.1
|
|
||||||
* By Devin Doucette
|
|
||||||
* Copyright (c) 2005 Devin Doucette
|
|
||||||
* Email: darksnoopy@shaw.ca
|
|
||||||
*--------------------------------------------------
|
|
||||||
* Email bugs/suggestions to darksnoopy@shaw.ca
|
|
||||||
*--------------------------------------------------
|
|
||||||
* This script has been created and released under
|
|
||||||
* the GNU GPL and is free to use and redistribute
|
|
||||||
* only if this copyright statement is not removed
|
|
||||||
*--------------------------------------------------*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class is derived from the class archive, is imployed to use files .
|
* This class is derived from the class archive, is imployed to use files .
|
||||||
* tar
|
* tar
|
||||||
*
|
|
||||||
* @package workflow.engine.classes
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
class tar_file extends Archive
|
class TarFile extends Archive
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -27,7 +12,7 @@ class tar_file extends Archive
|
|||||||
*
|
*
|
||||||
* @param string $name
|
* @param string $name
|
||||||
*/
|
*/
|
||||||
public function tar_file($name)
|
public function TarFile($name)
|
||||||
{
|
{
|
||||||
$this->archive($name);
|
$this->archive($name);
|
||||||
$this->options['type'] = "tar";
|
$this->options['type'] = "tar";
|
||||||
@@ -102,7 +87,7 @@ class tar_file extends Archive
|
|||||||
while ($block = fread($fp, 512)) {
|
while ($block = fread($fp, 512)) {
|
||||||
$temp = unpack("a100name/a8mode/a8uid/a8gid/a12size/a12mtime/a8checksum/a1type/a100symlink/a6magic/a2temp/a32temp/a32temp/a8temp/a8temp/a155prefix/a12temp", $block);
|
$temp = unpack("a100name/a8mode/a8uid/a8gid/a12size/a12mtime/a8checksum/a1type/a100symlink/a6magic/a2temp/a32temp/a32temp/a8temp/a8temp/a155prefix/a12temp", $block);
|
||||||
$file = array('name' => $this->options['basedir'] . '/' . $temp['prefix'] . $temp['name'], 'stat' => array(2 => $temp['mode'], 4 => octdec($temp['uid']), 5 => octdec($temp['gid']), 7 => octdec($temp['size']), 9 => octdec($temp['mtime'])
|
$file = array('name' => $this->options['basedir'] . '/' . $temp['prefix'] . $temp['name'], 'stat' => array(2 => $temp['mode'], 4 => octdec($temp['uid']), 5 => octdec($temp['gid']), 7 => octdec($temp['size']), 9 => octdec($temp['mtime'])
|
||||||
), 'checksum' => octdec($temp['checksum']), 'type' => $temp['type'], 'magic' => $temp['magic']
|
), 'checksum' => octdec($temp['checksum']), 'type' => $temp['type'], 'magic' => $temp['magic']
|
||||||
);
|
);
|
||||||
if ($file['checksum'] == 0x00000000) {
|
if ($file['checksum'] == 0x00000000) {
|
||||||
break;
|
break;
|
||||||
@@ -125,7 +110,6 @@ class tar_file extends Archive
|
|||||||
$this->files[] = $file;
|
$this->files[] = $file;
|
||||||
} elseif ($file['type'] == 5) {
|
} elseif ($file['type'] == 5) {
|
||||||
if (!is_dir($file['name'])) {
|
if (!is_dir($file['name'])) {
|
||||||
//mkdir($file['name'], $file['stat'][2]);
|
|
||||||
mkdir($file['name'], 0775);
|
mkdir($file['name'], 0775);
|
||||||
}
|
}
|
||||||
} elseif ($this->options['overwrite'] == 0 && file_exists($file['name'])) {
|
} elseif ($this->options['overwrite'] == 0 && file_exists($file['name'])) {
|
||||||
@@ -133,23 +117,18 @@ class tar_file extends Archive
|
|||||||
continue;
|
continue;
|
||||||
} elseif ($file['type'] == 2) {
|
} elseif ($file['type'] == 2) {
|
||||||
symlink($temp['symlink'], $file['name']);
|
symlink($temp['symlink'], $file['name']);
|
||||||
//chmod($file['name'], $file['stat'][2]);
|
|
||||||
} elseif ($new = @fopen($file['name'], "wb")) {
|
} elseif ($new = @fopen($file['name'], "wb")) {
|
||||||
fwrite($new, fread($fp, $file['stat'][7]));
|
fwrite($new, fread($fp, $file['stat'][7]));
|
||||||
if ((512 - $file['stat'][7] % 512) != 512) {
|
if ((512 - $file['stat'][7] % 512) != 512) {
|
||||||
fread($fp, (512 - $file['stat'][7] % 512));
|
fread($fp, (512 - $file['stat'][7] % 512));
|
||||||
}
|
}
|
||||||
//fread($fp, (512 - $file['stat'][7] % 512) == 512 ? 0 : (512 - $file['stat'][7] % 512));
|
|
||||||
fclose($new);
|
fclose($new);
|
||||||
//chmod($file['name'], $file['stat'][2]);
|
|
||||||
chmod($file['name'], 0777);
|
chmod($file['name'], 0777);
|
||||||
$this->files[] = $file['name'];
|
$this->files[] = $file['name'];
|
||||||
} else {
|
} else {
|
||||||
$this->error[] = "Could not open {$file['name']} for writing.";
|
$this->error[] = "Could not open {$file['name']} for writing.";
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//chown($file['name'], $file['stat'][4]);
|
|
||||||
//chgrp($file['name'], $file['stat'][5]);
|
|
||||||
@touch($file['name'], $file['stat'][9]);
|
@touch($file['name'], $file['stat'][9]);
|
||||||
unset($file);
|
unset($file);
|
||||||
}
|
}
|
||||||
@@ -1,51 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
class Tasks
|
||||||
* class.tasks.php
|
|
||||||
*
|
|
||||||
* @package workflow.engine.ProcessMaker
|
|
||||||
*
|
|
||||||
* ProcessMaker Open Source Edition
|
|
||||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
|
||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
|
||||||
*/
|
|
||||||
require_once 'classes/model/GroupUser.php';
|
|
||||||
require_once 'classes/model/Groupwf.php';
|
|
||||||
require_once 'classes/model/ObjectPermission.php';
|
|
||||||
require_once 'classes/model/Process.php';
|
|
||||||
require_once 'classes/model/Route.php';
|
|
||||||
require_once 'classes/model/Event.php';
|
|
||||||
require_once 'classes/model/Step.php';
|
|
||||||
require_once 'classes/model/StepTrigger.php';
|
|
||||||
require_once 'classes/model/Task.php';
|
|
||||||
require_once 'classes/model/TaskUser.php';
|
|
||||||
require_once 'classes/model/Users.php';
|
|
||||||
require_once 'classes/model/Gateway.php';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Tasks - Tasks
|
|
||||||
/**
|
|
||||||
* Tasks - Tasks class
|
|
||||||
*
|
|
||||||
* @package workflow.engine.ProcessMaker
|
|
||||||
* @author Julio Cesar Laura Avenda<64>o
|
|
||||||
* @copyright 2007 COLOSA
|
|
||||||
*/class Tasks
|
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -89,7 +44,7 @@ require_once 'classes/model/Gateway.php';
|
|||||||
try {
|
try {
|
||||||
$aTasks = array();
|
$aTasks = array();
|
||||||
$oCriteria = new Criteria('workflow');
|
$oCriteria = new Criteria('workflow');
|
||||||
$oCriteria->addSelectColumn( TaskPeer::TAS_UID );
|
$oCriteria->addSelectColumn(TaskPeer::TAS_UID);
|
||||||
$oCriteria->add(TaskPeer::PRO_UID, $sProUid);
|
$oCriteria->add(TaskPeer::PRO_UID, $sProUid);
|
||||||
$oCriteria->addAscendingOrderByColumn(TaskPeer::TAS_TITLE);
|
$oCriteria->addAscendingOrderByColumn(TaskPeer::TAS_TITLE);
|
||||||
$oDataset = TaskPeer::doSelectRS($oCriteria);
|
$oDataset = TaskPeer::doSelectRS($oCriteria);
|
||||||
@@ -162,7 +117,6 @@ require_once 'classes/model/Gateway.php';
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all Routes for any Process
|
* Get all Routes for any Process
|
||||||
*
|
*
|
||||||
@@ -210,7 +164,7 @@ require_once 'classes/model/Gateway.php';
|
|||||||
$oProcessMap = new ProcessMap();
|
$oProcessMap = new ProcessMap();
|
||||||
$oTask = new Task();
|
$oTask = new Task();
|
||||||
$oEvent = new Event();
|
$oEvent = new Event();
|
||||||
//unset ($row['ROU_UID']);
|
|
||||||
//Saving Gateway into the GATEWAY table
|
//Saving Gateway into the GATEWAY table
|
||||||
$idTask = $row['TAS_UID'];
|
$idTask = $row['TAS_UID'];
|
||||||
$nextTask = $row['ROU_NEXT_TASK'];
|
$nextTask = $row['ROU_NEXT_TASK'];
|
||||||
@@ -306,7 +260,7 @@ require_once 'classes/model/Gateway.php';
|
|||||||
{
|
{
|
||||||
foreach ($aRoutes as $key => $row) {
|
foreach ($aRoutes as $key => $row) {
|
||||||
$oRoute = new Route();
|
$oRoute = new Route();
|
||||||
//krumo ($row);
|
|
||||||
if (is_array($oRoute->load($row['ROU_UID']))) {
|
if (is_array($oRoute->load($row['ROU_UID']))) {
|
||||||
$oRoute->remove($row['ROU_UID']);
|
$oRoute->remove($row['ROU_UID']);
|
||||||
} else {
|
} else {
|
||||||
@@ -384,15 +338,6 @@ require_once 'classes/model/Gateway.php';
|
|||||||
$oDataset1->next();
|
$oDataset1->next();
|
||||||
while ($aRow1 = $oDataset1->getRow()) {
|
while ($aRow1 = $oDataset1->getRow()) {
|
||||||
//Delete the triggers assigned to step
|
//Delete the triggers assigned to step
|
||||||
/* $oCriteria = new Criteria('workflow');
|
|
||||||
$oCriteria->add(StepTriggerPeer::STEP_UID, $aRow1['STEP_UID']);
|
|
||||||
$oDataset2 = StepTriggerPeer::doSelectRS($oCriteria);
|
|
||||||
$oDataset2->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
||||||
$oDataset2->next();
|
|
||||||
while ($aRow2 = $oDataset2->getRow()) {
|
|
||||||
$oStepTrigger->remove($aRow2['STEP_UID'], $aRow2['TAS_UID'], $aRow2['TRI_UID'], $aRow2['ST_TYPE']);
|
|
||||||
$oDataset2->next();
|
|
||||||
} */
|
|
||||||
$oStep->remove($aRow1['STEP_UID']);
|
$oStep->remove($aRow1['STEP_UID']);
|
||||||
$oDataset1->next();
|
$oDataset1->next();
|
||||||
}
|
}
|
||||||
@@ -565,24 +510,6 @@ require_once 'classes/model/Gateway.php';
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$oTaskUser = new TaskUser();
|
$oTaskUser = new TaskUser();
|
||||||
/* $oCriteria = new Criteria('workflow');
|
|
||||||
$oCriteria->add(GroupUserPeer::GRP_UID, $sGroupUID);
|
|
||||||
$oDataset = GroupUserPeer::doSelectRS($oCriteria);
|
|
||||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
||||||
$oDataset->next();
|
|
||||||
while ($aGroupUser = $oDataset->getRow()) {
|
|
||||||
$oCriteria = new Criteria('workflow');
|
|
||||||
$oCriteria->add(TaskUserPeer::TAS_UID, $sTaskUID);
|
|
||||||
$oCriteria->add(TaskUserPeer::USR_UID, $aGroupUser['USR_UID']);
|
|
||||||
$oDataset2 = TaskUserPeer::doSelectRS($oCriteria);
|
|
||||||
$oDataset2->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
||||||
$oDataset2->next();
|
|
||||||
$aRow = $oDataset2->getRow();
|
|
||||||
if (!is_array($aRow)) {
|
|
||||||
$this->assignUser($sTaskUID, $aGroupUser['USR_UID'], $iType);
|
|
||||||
}
|
|
||||||
$oDataset->next();
|
|
||||||
} */
|
|
||||||
return $oTaskUser->create(array('TAS_UID' => $sTaskUID, 'USR_UID' => $sGroupUID, 'TU_TYPE' => $iType, 'TU_RELATION' => 2
|
return $oTaskUser->create(array('TAS_UID' => $sTaskUID, 'USR_UID' => $sGroupUID, 'TU_TYPE' => $iType, 'TU_RELATION' => 2
|
||||||
));
|
));
|
||||||
} catch (Exception $oError) {
|
} catch (Exception $oError) {
|
||||||
@@ -680,10 +607,6 @@ require_once 'classes/model/Gateway.php';
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$oCriteria = new Criteria('workflow');
|
$oCriteria = new Criteria('workflow');
|
||||||
//$oCriteria->add(StepPeer::PRO_UID, $sProcessUID);
|
|
||||||
//$oDataset = StepPeer::doSelectRS($oCriteria);
|
|
||||||
//$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
||||||
//$oDataset->next();
|
|
||||||
return true;
|
return true;
|
||||||
} catch (Exception $oError) {
|
} catch (Exception $oError) {
|
||||||
throw ($oError);
|
throw ($oError);
|
||||||
@@ -701,9 +624,8 @@ require_once 'classes/model/Gateway.php';
|
|||||||
try {
|
try {
|
||||||
$aTasks = array();
|
$aTasks = array();
|
||||||
$oCriteria = new Criteria('workflow');
|
$oCriteria = new Criteria('workflow');
|
||||||
$oCriteria->addSelectColumn( TaskPeer::TAS_UID );
|
$oCriteria->addSelectColumn(TaskPeer::TAS_UID);
|
||||||
$oCriteria->add(TaskPeer::PRO_UID, $sProUid);
|
$oCriteria->add(TaskPeer::PRO_UID, $sProUid);
|
||||||
//$oCriteria->add(TaskPeer::TAS_USER, $sUsrUid);
|
|
||||||
$oCriteria->add(TaskPeer::TAS_START, 'TRUE');
|
$oCriteria->add(TaskPeer::TAS_START, 'TRUE');
|
||||||
$oDataset = TaskPeer::doSelectRS($oCriteria);
|
$oDataset = TaskPeer::doSelectRS($oCriteria);
|
||||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
|
|||||||
@@ -1,38 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
class ToolBar extends form
|
||||||
* class.toolBar.php
|
|
||||||
*
|
|
||||||
* @package workflow.engine.ProcessMaker
|
|
||||||
*
|
|
||||||
* ProcessMaker Open Source Edition
|
|
||||||
* Copyright (C) 2004 - 2011 Colosa Inc.
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
|
||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ToolBar - ToolBar
|
|
||||||
/**
|
|
||||||
* ToolBar - ToolBar class
|
|
||||||
*
|
|
||||||
* @package workflow.engine.ProcessMaker
|
|
||||||
*/class ToolBar extends form
|
|
||||||
{
|
{
|
||||||
public $type = 'toolbar';
|
public $type = 'toolbar';
|
||||||
public $align = 'left';
|
public $align = 'left';
|
||||||
|
|||||||
@@ -1,56 +1,45 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
*
|
class TriggerLibrary
|
||||||
* @author Hugo Loza <hugo@colosa.com>
|
|
||||||
*
|
|
||||||
* This
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @package workflow.engine.ProcessMaker
|
|
||||||
*/class triggerLibrary
|
|
||||||
{
|
{
|
||||||
|
private $_aTriggerClasses_ = array();
|
||||||
private $_aTriggerClasses_ = array ();
|
private static $instance = null;
|
||||||
|
|
||||||
private static $instance = NULL;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* __construct
|
* __construct
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function __construct ()
|
public function __construct()
|
||||||
{
|
{
|
||||||
//Initialize the Library and register the Default
|
//Initialize the Library and register the Default
|
||||||
$this->registerFunctionsFileToLibrary( PATH_CORE . "classes" . PATH_SEP . "class.pmFunctions.php", "ProcessMaker Functions" );
|
$this->registerFunctionsFileToLibrary(PATH_CORE . "classes" . PATH_SEP . "class.pmFunctions.php", "ProcessMaker Functions");
|
||||||
|
|
||||||
//Register all registered PLugin Functions
|
//Register all registered PLugin Functions
|
||||||
if (class_exists( 'folderData' )) {
|
if (class_exists('folderData')) {
|
||||||
//$folderData = new folderData($sProUid, $proFields['PRO_TITLE'], $sAppUid, $Fields['APP_TITLE'], $sUsrUid);
|
|
||||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||||
$aAvailablePmFunctions = $oPluginRegistry->getPmFunctions();
|
$aAvailablePmFunctions = $oPluginRegistry->getPmFunctions();
|
||||||
$oPluginRegistry->setupPlugins(); //Get and setup enabled plugins
|
$oPluginRegistry->setupPlugins(); //Get and setup enabled plugins
|
||||||
foreach ($aAvailablePmFunctions as $key => $class) {
|
foreach ($aAvailablePmFunctions as $key => $class) {
|
||||||
$filePlugin = PATH_PLUGINS . $class . PATH_SEP . 'classes' . PATH_SEP . 'class.pmFunctions.php';
|
$filePlugin = PATH_PLUGINS . $class . PATH_SEP . 'classes' . PATH_SEP . 'class.pmFunctions.php';
|
||||||
|
|
||||||
if (file_exists( $filePlugin ) && ! is_dir( $filePlugin )) {
|
if (file_exists($filePlugin) && !is_dir($filePlugin)) {
|
||||||
$this->registerFunctionsFileToLibrary( $filePlugin, "ProcessMaker Functions" );
|
$this->registerFunctionsFileToLibrary($filePlugin, "ProcessMaker Functions");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//Add External Triggers
|
//Add External Triggers
|
||||||
$dir = G::ExpandPath( "classes" ) . 'triggers';
|
$dir = G::ExpandPath("classes") . 'triggers';
|
||||||
$filesArray = array ();
|
$filesArray = array();
|
||||||
|
|
||||||
if (file_exists( $dir )) {
|
if (file_exists($dir)) {
|
||||||
if ($handle = opendir( $dir )) {
|
if ($handle = opendir($dir)) {
|
||||||
while (false !== ($file = readdir( $handle ))) {
|
while (false !== ($file = readdir($handle))) {
|
||||||
if ($file != "." && $file != ".." && ! is_dir( $dir . PATH_SEP . $file )) {
|
if ($file != "." && $file != ".." && !is_dir($dir . PATH_SEP . $file)) {
|
||||||
$this->registerFunctionsFileToLibrary( $dir . PATH_SEP . $file, "ProcessMaker External Functions" );
|
$this->registerFunctionsFileToLibrary($dir . PATH_SEP . $file, "ProcessMaker External Functions");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
closedir( $handle );
|
closedir($handle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -60,10 +49,10 @@
|
|||||||
*
|
*
|
||||||
* @return self::$instance;
|
* @return self::$instance;
|
||||||
*/
|
*/
|
||||||
function &getSingleton ()
|
public function &getSingleton()
|
||||||
{
|
{
|
||||||
if (self::$instance == NULL) {
|
if (self::$instance == null) {
|
||||||
self::$instance = new triggerLibrary();
|
self::$instance = new TriggerLibrary();
|
||||||
}
|
}
|
||||||
return self::$instance;
|
return self::$instance;
|
||||||
}
|
}
|
||||||
@@ -73,9 +62,9 @@
|
|||||||
*
|
*
|
||||||
* @return serialize ( self::$instance );
|
* @return serialize ( self::$instance );
|
||||||
*/
|
*/
|
||||||
function serializeInstance ()
|
public function serializeInstance()
|
||||||
{
|
{
|
||||||
return serialize( self::$instance );
|
return serialize(self::$instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -84,13 +73,13 @@
|
|||||||
* @param integer $serialized
|
* @param integer $serialized
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function unSerializeInstance ($serialized)
|
public function unSerializeInstance($serialized)
|
||||||
{
|
{
|
||||||
if (self::$instance == NULL) {
|
if (self::$instance == null) {
|
||||||
self::$instance = new PluginRegistry();
|
self::$instance = new PluginRegistry();
|
||||||
}
|
}
|
||||||
|
|
||||||
$instance = unserialize( $serialized );
|
$instance = unserialize($serialized);
|
||||||
self::$instance = $instance;
|
self::$instance = $instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,15 +90,14 @@
|
|||||||
* @param string $libraryName
|
* @param string $libraryName
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function registerFunctionsFileToLibrary ($filePath, $libraryName)
|
public function registerFunctionsFileToLibrary($filePath, $libraryName)
|
||||||
{
|
{
|
||||||
$aLibrary = $this->getMethodsFromLibraryFile( $filePath );
|
$aLibrary = $this->getMethodsFromLibraryFile($filePath);
|
||||||
$aLibrary->libraryFile = $filePath;
|
$aLibrary->libraryFile = $filePath;
|
||||||
$aLibrary->libraryName = $libraryName;
|
$aLibrary->libraryName = $libraryName;
|
||||||
if (isset( $aLibrary->info['className'] )) {
|
if (isset($aLibrary->info['className'])) {
|
||||||
$this->_aTriggerClasses_[$aLibrary->info['className']] = $aLibrary;
|
$this->_aTriggerClasses_[$aLibrary->info['className']] = $aLibrary;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -118,12 +106,11 @@
|
|||||||
* @param string $file
|
* @param string $file
|
||||||
* @return object(PHPClass) $parsedLibrary
|
* @return object(PHPClass) $parsedLibrary
|
||||||
*/
|
*/
|
||||||
function getMethodsFromLibraryFile ($file)
|
public function getMethodsFromLibraryFile($file)
|
||||||
{
|
{
|
||||||
// parse class comments from file
|
// parse class comments from file
|
||||||
$parsedLibrary = new PHPClass();
|
$parsedLibrary = new PHPClass();
|
||||||
//$success = $parsedLibrary->parseFromFile ( PATH_CORE . "classes" . PATH_SEP . $file );
|
$success = $parsedLibrary->parseFromFile($file);
|
||||||
$success = $parsedLibrary->parseFromFile( $file );
|
|
||||||
|
|
||||||
return $parsedLibrary;
|
return $parsedLibrary;
|
||||||
}
|
}
|
||||||
@@ -133,7 +120,7 @@
|
|||||||
*
|
*
|
||||||
* @return array ($this->_aTriggerClasses_)
|
* @return array ($this->_aTriggerClasses_)
|
||||||
*/
|
*/
|
||||||
function getRegisteredClasses ()
|
public function getRegisteredClasses()
|
||||||
{
|
{
|
||||||
return ($this->_aTriggerClasses_);
|
return ($this->_aTriggerClasses_);
|
||||||
}
|
}
|
||||||
@@ -144,7 +131,7 @@
|
|||||||
* @param string $libraryClassName
|
* @param string $libraryClassName
|
||||||
* @return array ($this->_aTriggerClasses_[$libraryClassName])
|
* @return array ($this->_aTriggerClasses_[$libraryClassName])
|
||||||
*/
|
*/
|
||||||
function getLibraryDefinition ($libraryClassName)
|
public function getLibraryDefinition($libraryClassName)
|
||||||
{
|
{
|
||||||
return ($this->_aTriggerClasses_[$libraryClassName]);
|
return ($this->_aTriggerClasses_[$libraryClassName]);
|
||||||
}
|
}
|
||||||
@@ -154,9 +141,8 @@
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function __destruct ()
|
public function __destruct()
|
||||||
{
|
{
|
||||||
|
|
||||||
//TODO - Insert your code here
|
//TODO - Insert your code here
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,7 +64,7 @@
|
|||||||
*/
|
*/
|
||||||
public function render($value)
|
public function render($value)
|
||||||
{
|
{
|
||||||
$this->toolBar = new toolBar($this->xmlfile, $this->home);
|
$this->toolBar = new ToolBar($this->xmlfile, $this->home);
|
||||||
$template = PATH_CORE . 'templates/' . $this->type . '.html';
|
$template = PATH_CORE . 'templates/' . $this->type . '.html';
|
||||||
$out = $this->toolBar->render($template, $scriptCode);
|
$out = $this->toolBar->render($template, $scriptCode);
|
||||||
$oHeadPublisher = & headPublisher::getSingleton();
|
$oHeadPublisher = & headPublisher::getSingleton();
|
||||||
|
|||||||
@@ -1617,7 +1617,7 @@ class Process
|
|||||||
$triggerWizard->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase);
|
$triggerWizard->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase);
|
||||||
$triggerWizard->setArrayFieldNameForException($this->arrayFieldNameForException);
|
$triggerWizard->setArrayFieldNameForException($this->arrayFieldNameForException);
|
||||||
|
|
||||||
$triggerLibrary = \triggerLibrary::getSingleton();
|
$triggerLibrary = \TriggerLibrary::getSingleton();
|
||||||
$library = $triggerLibrary->getRegisteredClasses();
|
$library = $triggerLibrary->getRegisteredClasses();
|
||||||
|
|
||||||
ksort($library);
|
ksort($library);
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class TriggerWizard
|
|||||||
|
|
||||||
//Library
|
//Library
|
||||||
|
|
||||||
$this->library = \triggerLibrary::getSingleton();
|
$this->library = \TriggerLibrary::getSingleton();
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$triggerLibrary = triggerLibrary::getSingleton();
|
$triggerLibrary = TriggerLibrary::getSingleton();
|
||||||
$triggerLibraryO = $triggerLibrary->getRegisteredClasses();
|
$triggerLibraryO = $triggerLibrary->getRegisteredClasses();
|
||||||
|
|
||||||
$oTree = new Tree();
|
$oTree = new Tree();
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$triggerLibrary = triggerLibrary::getSingleton ();
|
$triggerLibrary = TriggerLibrary::getSingleton ();
|
||||||
$libraryClassName = $_GET ['LIBRARY'];
|
$libraryClassName = $_GET ['LIBRARY'];
|
||||||
$libraryMethod = $_GET ['NAME_FUN'];
|
$libraryMethod = $_GET ['NAME_FUN'];
|
||||||
$sProUid = $_GET ['PRO_UID'];
|
$sProUid = $_GET ['PRO_UID'];
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$triggerLibrary = triggerLibrary::getSingleton ();
|
$triggerLibrary = TriggerLibrary::getSingleton ();
|
||||||
$libraryClassName = $_GET ['LIBRARY_CLASS'];
|
$libraryClassName = $_GET ['LIBRARY_CLASS'];
|
||||||
$libraryMethod = $_GET ['PMFUNTION_NAME'];
|
$libraryMethod = $_GET ['PMFUNTION_NAME'];
|
||||||
$sProUid = $_GET ['PRO_UID'];
|
$sProUid = $_GET ['PRO_UID'];
|
||||||
|
|||||||
Reference in New Issue
Block a user