\r\r"; - print_r($array); - echo "\r\r"; -} - diff --git a/workflow/engine/classes/Patch.php b/workflow/engine/classes/Patch.php new file mode 100644 index 000000000..597a1cf02 --- /dev/null +++ b/workflow/engine/classes/Patch.php @@ -0,0 +1,19 @@ +. + * + * For more information, contact Colosa Inc, 2566 Le Jeune Rd., + * Coral Gables, FL, 33134, USA, or email info@colosa.com. + */ + +use ProcessMaker\Plugins\PluginRegistry; + +/** + * + * @package workflow.engine.classes + */ + +require_once 'class.plugin.php'; + + + +/** + * + * @package workflow.engine.classes + */class pluginDetail +{ + public $sNamespace; + public $sClassName; + public $sFriendlyName = null; + public $sDescription = null; + public $sSetupPage = null; + public $sFilename; + public $sPluginFolder = ''; + public $sCompanyLogo = ''; + public $iVersion = 0; + public $enabled = false; + public $aWorkspaces = null; + public $bPrivate = false; + + /** + * This function is the constructor of the pluginDetail class + * + * @param string $sNamespace + * @param string $sClassName + * @param string $sFilename + * @param string $sFriendlyName + * @param string $sPluginFolder + * @param string $sDescription + * @param string $sSetupPage + * @param integer $iVersion + * @return void + */ + public function __construct ($sNamespace, $sClassName, $sFilename, $sFriendlyName = '', $sPluginFolder = '', $sDescription = '', $sSetupPage = '', $iVersion = 0) + { + $this->sNamespace = $sNamespace; + $this->sClassName = $sClassName; + $this->sFriendlyName = $sFriendlyName; + $this->sDescription = $sDescription; + $this->sSetupPage = $sSetupPage; + $this->iVersion = $iVersion; + $this->sFilename = $sFilename; + if ($sPluginFolder == '') { + $this->sPluginFolder = $sNamespace; + } else { + $this->sPluginFolder = $sPluginFolder; + } + } +} diff --git a/workflow/engine/classes/class.pmDynaform.php b/workflow/engine/classes/PmDynaform.php similarity index 99% rename from workflow/engine/classes/class.pmDynaform.php rename to workflow/engine/classes/PmDynaform.php index 3bc58a7ae..c103ba8d2 100644 --- a/workflow/engine/classes/class.pmDynaform.php +++ b/workflow/engine/classes/PmDynaform.php @@ -7,7 +7,14 @@ * @author Roly Rudy Gutierrez Pinto * @package engine.classes */ -class pmDynaform + +/** + * class.pmDynaform.php + * Implementing pmDynaform library in the running case. + * + * @author Roly Rudy Gutierrez Pinto + * @package engine.classes + */class pmDynaform { public static $instance = null; diff --git a/workflow/engine/classes/class.pmGauge.php b/workflow/engine/classes/PmGauge.php similarity index 100% rename from workflow/engine/classes/class.pmGauge.php rename to workflow/engine/classes/PmGauge.php index 6c09d84ed..c059188b6 100644 --- a/workflow/engine/classes/class.pmGauge.php +++ b/workflow/engine/classes/PmGauge.php @@ -1,5 +1,6 @@ serial, file_get_contents(PATH_PLUGINS . 'enterprise/data/default'))); } } - diff --git a/workflow/engine/classes/class.pmPhing.php b/workflow/engine/classes/PmPhing.php similarity index 100% rename from workflow/engine/classes/class.pmPhing.php rename to workflow/engine/classes/PmPhing.php index 4f482e27a..20592272f 100644 --- a/workflow/engine/classes/class.pmPhing.php +++ b/workflow/engine/classes/PmPhing.php @@ -38,6 +38,7 @@ if (! class_exists( 'Phing' )) { throw new Exception( 'Fatal Error: Phing is not loaded!' ); } + class pmPhing extends Phing { @@ -46,4 +47,3 @@ class pmPhing extends Phing return 'pmPhing Ver 1.0'; } } - diff --git a/workflow/engine/classes/class.pmSso.php b/workflow/engine/classes/PmSsoClass.php similarity index 96% rename from workflow/engine/classes/class.pmSso.php rename to workflow/engine/classes/PmSsoClass.php index 19bda3a51..b76080080 100644 --- a/workflow/engine/classes/class.pmSso.php +++ b/workflow/engine/classes/PmSsoClass.php @@ -4,7 +4,11 @@ * */ - class pmSsoClass extends PMPlugin { + +/** + * class.pmSso.php + * + */ class pmSsoClass extends PMPlugin { function __construct() { } @@ -63,4 +67,3 @@ return $res; } } -?> \ No newline at end of file diff --git a/workflow/engine/classes/class.popupMenu.php b/workflow/engine/classes/PopupMenu.php similarity index 81% rename from workflow/engine/classes/class.popupMenu.php rename to workflow/engine/classes/PopupMenu.php index 7739ddc89..e0e97adb2 100644 --- a/workflow/engine/classes/class.popupMenu.php +++ b/workflow/engine/classes/PopupMenu.php @@ -26,14 +26,14 @@ * */ +/** + * popupMenu - popupMenu /** * popupMenu - popupMenu class * * @package workflow.engine.ProcessMaker * @copyright COLOSA - */ - -class popupMenu extends form + */class popupMenu extends form { var $type = 'popupMenu'; var $theme = 'processmaker'; @@ -73,27 +73,3 @@ class popupMenu extends form return $sc; } } - -/** - * XmlForm_Field_popupOption - XmlForm_Field_popupOption class - * - * @package workflow.engine.ProcessMaker - * @copyright COLOSA - */ - -class XmlForm_Field_popupOption extends XmlForm_Field -{ - var $launch = ''; - - /** - * Get Events - * - * @return string - */ - function getEvents () - { - $script = '{name:"' . $this->name . '",text:"' . addcslashes( $this->label, '\\"' ) . '", launch:leimnud.closure({Function:function(target){' . $this->launch . '}, args:target})}'; - return $script; - } -} - diff --git a/workflow/engine/classes/class.processes.php b/workflow/engine/classes/Processes.php similarity index 99% rename from workflow/engine/classes/class.processes.php rename to workflow/engine/classes/Processes.php index 8b4e1281a..8f8646aae 100644 --- a/workflow/engine/classes/class.processes.php +++ b/workflow/engine/classes/Processes.php @@ -24,7 +24,31 @@ * Coral Gables, FL, 33134, USA, or email info@colosa.com. */ -class Processes + +/** + * class.processes.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
' . $this->htmlentities( number_format( $v, 2 ), ENT_COMPAT, 'utf-8' ) . '
'; + } else { + $result[] = '' . $this->htmlentities( number_format( $v, 2 ), ENT_COMPAT, 'utf-8' ) . '
'; + } + $r ++; + } + return $result; + } + + /** + * Function attachEvents + * + * @access public + * @param eter string $element + * @return string + */ + public function attachEvents ($element) + { + return "myForm.aElements[i] = new G_Text(myForm, $element,'{$this->name}'); + myForm.aElements[i].setAttributes(" . $this->getAttributes() . ");"; + } +} diff --git a/workflow/engine/classes/XmlForm_Field_PopupOption.php b/workflow/engine/classes/XmlForm_Field_PopupOption.php new file mode 100644 index 000000000..ffa02cade --- /dev/null +++ b/workflow/engine/classes/XmlForm_Field_PopupOption.php @@ -0,0 +1,50 @@ +. + * + * For more information, contact Colosa Inc, 2566 Le Jeune Rd., + * Coral Gables, FL, 33134, USA, or email info@colosa.com. + * + */ + +/** + * popupMenu - popupMenu +/** + * XmlForm_Field_popupOption - XmlForm_Field_popupOption class + * + * @package workflow.engine.ProcessMaker + * @copyright COLOSA + */class XmlForm_Field_popupOption extends XmlForm_Field +{ + var $launch = ''; + + /** + * Get Events + * + * @return string + */ + function getEvents () + { + $script = '{name:"' . $this->name . '",text:"' . addcslashes( $this->label, '\\"' ) . '", launch:leimnud.closure({Function:function(target){' . $this->launch . '}, args:target})}'; + return $script; + } +} diff --git a/workflow/engine/classes/XmlForm_Field_TextPM.php b/workflow/engine/classes/XmlForm_Field_TextPM.php new file mode 100644 index 000000000..54c23914a --- /dev/null +++ b/workflow/engine/classes/XmlForm_Field_TextPM.php @@ -0,0 +1,181 @@ +. + * + * For more information, contact Colosa Inc, 2566 Le Jeune Rd., + * Coral Gables, FL, 33134, USA, or email info@colosa.com. + * + * @package workflow.engine.classes + **/ + + +/** + * class.xmlfield_InputPM.php + * + * @package workflow.engine.classes + * + * 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' . $this->htmlentities( number_format( $v, 2 ), ENT_COMPAT, 'utf-8' ) . '
'; - } else { - $result[] = '' . $this->htmlentities( number_format( $v, 2 ), ENT_COMPAT, 'utf-8' ) . '
'; - } - $r ++; - } - return $result; - } - - /** - * Function attachEvents - * - * @access public - * @param eter string $element - * @return string - */ - public function attachEvents ($element) - { - return "myForm.aElements[i] = new G_Text(myForm, $element,'{$this->name}'); - myForm.aElements[i].setAttributes(" . $this->getAttributes() . ");"; - } -} - -/** - * Function getDynaformsVars - * - * @access public - * @param eter string $sProcessUID - * @param eter boolean $bSystemVars - * @return array - */ -function getDynaformsVars ($sProcessUID, $typeVars = 'all', $bIncMulSelFields = 0) -{ - $aFields = array (); - $aFieldsNames = array (); - if ($typeVars == 'system' || $typeVars == 'all') { - $aAux = G::getSystemConstants(); - foreach ($aAux as $sName => $sValue) { - $aFields[] = array ('sName' => $sName,'sType' => 'system','sLabel' => G::LoadTranslation('ID_TINY_SYSTEM_VARIABLES')); - } - //we're adding the pin variable to the system list - $aFields[] = array ('sName' => 'PIN','sType' => 'system','sLabel' => G::LoadTranslation('ID_TINY_SYSTEM_VARIABLES')); - - //we're adding the app_number variable to the system list - $aFields[] = array('sName' => 'APP_NUMBER', 'sType' => 'system', 'sLabel' => G::LoadTranslation('ID_TINY_SYSTEM_VARIABLE'), 'sUid' => ''); - } - - $aInvalidTypes = array("title", "subtitle", "file", "button", "reset", "submit", "javascript", "pmconnection"); - $aMultipleSelectionFields = array("listbox", "checkgroup"); - - if ($bIncMulSelFields != 0) { - $aInvalidTypes = array_merge( $aInvalidTypes, $aMultipleSelectionFields ); - } - // getting bpmn projects - $oCriteria = new Criteria('workflow'); - $oCriteria->addSelectColumn(BpmnProjectPeer::PRJ_UID); - $oCriteria->add(BpmnProjectPeer::PRJ_UID, $sProcessUID); - $oDataset = ProcessPeer::doSelectRS($oCriteria, Propel::getDbConnection('workflow_ro')); - $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); - $oDataset->next(); - $row = $oDataset->getRow(); - if (isset($row["PRJ_UID"])) { - if($typeVars == 'process' || $typeVars == 'all') { - $oCriteria = new Criteria('workflow'); - $oCriteria->addSelectColumn(ProcessVariablesPeer::VAR_UID); - $oCriteria->addSelectColumn(ProcessVariablesPeer::VAR_NAME); - $oCriteria->addSelectColumn(ProcessVariablesPeer::VAR_FIELD_TYPE); - $oCriteria->add(ProcessVariablesPeer::PRJ_UID, $sProcessUID); - $oDataset = ProcessVariablesPeer::doSelectRS($oCriteria); - $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); - while ($oDataset->next()) { - $row = $oDataset->getRow(); - array_push($aFields, array( - "sName" => $row["VAR_NAME"], - "sType" => $row["VAR_FIELD_TYPE"], - "sLabel" => $row["VAR_FIELD_TYPE"] - )); - } - } - if($typeVars == 'grid' || $typeVars == 'all') { - $oC = new Criteria( 'workflow' ); - $oC->addSelectColumn( DynaformPeer::DYN_CONTENT ); - $oC->add( DynaformPeer::PRO_UID, $sProcessUID ); - $oC->add( DynaformPeer::DYN_TYPE, 'xmlform' ); - $oData = DynaformPeer::doSelectRS( $oC ); - $oData->setFetchmode( ResultSet::FETCHMODE_ASSOC ); - $oData->next(); - while ($aRowd = $oData->getRow()) { - $dynaform = G::json_decode($aRowd['DYN_CONTENT'],true); - if(is_array($dynaform) && sizeof($dynaform)) { - $items = $dynaform['items'][0]['items']; - foreach($items as $key => $val){ - if(isset($val[0]['type']) && $val[0]['type'] == 'grid'){ - if(sizeof($val[0]['columns'])) { - $columns = $val[0]['columns']; - foreach($columns as $column) { - array_push($aFields, array( - "sName" => $column['name'], - "sType" => $column['type'], - "sLabel" => $column['type'] - )); - } - } - } - } - } - $oData->next(); - } - } - - } else { - require_once 'classes/model/Dynaform.php'; - $oCriteria = new Criteria( 'workflow' ); - $oCriteria->addSelectColumn( DynaformPeer::DYN_FILENAME ); - $oCriteria->add( DynaformPeer::PRO_UID, $sProcessUID ); - $oCriteria->add( DynaformPeer::DYN_TYPE, 'xmlform' ); - $oDataset = DynaformPeer::doSelectRS( $oCriteria ); - $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); - $oDataset->next(); - while ($aRow = $oDataset->getRow()) { - if (file_exists( PATH_DYNAFORM . PATH_SEP . $aRow['DYN_FILENAME'] . '.xml' )) { - $G_FORM = new Form( $aRow['DYN_FILENAME'], PATH_DYNAFORM, SYS_LANG ); - if (($G_FORM->type == 'xmlform') || ($G_FORM->type == '')) { - foreach ($G_FORM->fields as $k => $v) { - if (! in_array( $v->type, $aInvalidTypes )) { - if (! in_array( $k, $aFieldsNames )) { - $aFields[] = array ('sName' => $k,'sType' => $v->type,'sLabel' => ($v->type != 'grid' ? $v->label : '[ ' . G::LoadTranslation( 'ID_GRID' ) . ' ]') - ); - $aFieldsNames[] = $k; - } - } - } - } - } - $oDataset->next(); - } - } - return $aFields; -} - -/** - * Function getGridsVars - * - * @access public - * @param eter string $sProcessUID - * @return array - */ -function getGridsVars ($sProcessUID) -{ - $aFields = array (); - $aFieldsNames = array (); - - require_once 'classes/model/Dynaform.php'; - $oCriteria = new Criteria( 'workflow' ); - $oCriteria->addSelectColumn( DynaformPeer::DYN_FILENAME ); - $oCriteria->add( DynaformPeer::PRO_UID, $sProcessUID ); - $oDataset = DynaformPeer::doSelectRS( $oCriteria ); - $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); - $oDataset->next(); - while ($aRow = $oDataset->getRow()) { - $G_FORM = new Form( $aRow['DYN_FILENAME'], PATH_DYNAFORM, SYS_LANG ); - if ($G_FORM->type == 'xmlform') { - foreach ($G_FORM->fields as $k => $v) { - if ($v->type == 'grid') { - if (! in_array( $k, $aFieldsNames )) { - $aFields[] = array ('sName' => $k,'sXmlForm' => str_replace( $sProcessUID . '/', '', $v->xmlGrid )); - $aFieldsNames[] = $k; - } - } - } - } - $oDataset->next(); - } - return $aFields; -} -/** - * Function getVarsGrid returns all variables of Grid - * - * @access public - * @param string proUid process ID - * @param string dynUid dynaform ID - * @return array - */ - -function getVarsGrid ($proUid, $dynUid) -{ - $dynaformFields = array (); - - if (is_file( PATH_DATA . '/sites/'. SYS_SYS .'/xmlForms/'. $proUid .'/'.$dynUid. '.xml' ) && filesize( PATH_DATA . '/sites/'. SYS_SYS .'/xmlForms/'. $proUid .'/'. $dynUid .'.xml' ) > 0) { - $dyn = new DynaformHandler( PATH_DATA . '/sites/'. SYS_SYS .'/xmlForms/' .$proUid. '/' . $dynUid .'.xml' ); - $dynaformFields[] = $dyn->getFields(); - } - - $dynaformFieldTypes = array (); - - foreach ($dynaformFields as $aDynFormFields) { - foreach ($aDynFormFields as $field) { - - if ($field->getAttribute( 'validate' ) == 'Int') { - $dynaformFieldTypes[$field->nodeName] = 'Int'; - } elseif ($field->getAttribute( 'validate' ) == 'Real') { - $dynaformFieldTypes[$field->nodeName] = 'Real'; - } else { - $dynaformFieldTypes[$field->nodeName] = $field->getAttribute( 'type' ); - } - } - } - return $dynaformFieldTypes; -} - - -/** - * Class XmlForm_Field_CheckBoxTable - */ -class XmlForm_Field_CheckBoxTable extends XmlForm_Field_Checkbox -{ - - /** - * Function render - * - * @author The Answer - * @access public - * @param eter string value - * @param eter string owner - * @return string - */ - public function render ($value = null, $owner = null) - { - //$optionName = $owner->values['USR_UID']; - $optionName = $value; - $onclick = (($this->onclick) ? ' onclick="' . G::replaceDataField( $this->onclick, $owner->values ) . '" ' : ''); - $html = ' '; - return $html; - } -} - diff --git a/workflow/engine/classes/entities/AppSolrQueue.php b/workflow/engine/classes/entities/Entity_AppSolrQueue.php similarity index 89% rename from workflow/engine/classes/entities/AppSolrQueue.php rename to workflow/engine/classes/entities/Entity_AppSolrQueue.php index 8df7933fa..724845498 100644 --- a/workflow/engine/classes/entities/AppSolrQueue.php +++ b/workflow/engine/classes/entities/Entity_AppSolrQueue.php @@ -4,7 +4,10 @@ require_once ('Base.php'); /** * Application Solr Queue */ -class Entity_AppSolrQueue extends Entity_Base + +/** + * Application Solr Queue + */class Entity_AppSolrQueue extends Entity_Base { public $appUid = ''; public $appChangeDate = ''; diff --git a/workflow/engine/classes/entities/Base.php b/workflow/engine/classes/entities/Entity_Base.php similarity index 99% rename from workflow/engine/classes/entities/Base.php rename to workflow/engine/classes/entities/Entity_Base.php index 5aa927469..9bcb878e1 100644 --- a/workflow/engine/classes/entities/Base.php +++ b/workflow/engine/classes/entities/Entity_Base.php @@ -1,5 +1,6 @@ - auth Setup"; - $this->auth = $auth; - } - - public function setwsdlurl($wsdl) - { - //print "