Merge pull request #1400 from hector-cortez/BUG-0000

BUG 0000 Adjustment for the standardization of code. CODE_STYLE
This commit is contained in:
julceslauhub
2013-03-14 12:44:47 -07:00
25 changed files with 2504 additions and 2571 deletions

View File

@@ -39,15 +39,16 @@
*/
class DBTable
{
var $_dbc;
var $_dbses;
var $_dset;
var $table_name;
var $table_keys;
var $Fields = null;
var $is_new;
var $errorLevel;
var $debug = false;
public $_dbc;
public $_dbses;
public $_dset;
public $table_name;
public $table_keys;
public $Fields = null;
public $is_new;
public $errorLevel;
public $debug = false;
/**
* Initiate a database conecction using default values
@@ -57,7 +58,7 @@ class DBTable
* @param object $objConnection conecction string
* @return void
*/
function dBTable ($objConnection = null, $strTable = "", $arrKeys = array( 'UID' ))
public function dBTable($objConnection = null, $strTable = "", $arrKeys = array('UID'))
{
$this->_dbc = null;
$this->_dbses = null;
@@ -74,7 +75,7 @@ class DBTable
* @param array $arrKeys table keys defaultvalue=UID
* @return void
*/
function setTo ($objDBConnection, $strTable = "", $arrKeys = array( 'UID' ))
public function setTo($objDBConnection, $strTable = "", $arrKeys = array('UID'))
{
$this->_dbc = $objDBConnection;
@@ -105,7 +106,7 @@ class DBTable
* @access public
* @return void
*/
function loadEmpty ()
public function loadEmpty()
{
$stQry = "DESCRIBE `" . $this->table_name . "`";
$dset = $this->_dbses->execute($stQry);
@@ -152,7 +153,7 @@ class DBTable
* @param string $strWhere string which contains conditions
* @return strint
*/
function loadWhere ($strWhere)
public function loadWhere($strWhere)
{
$this->Fields = null;
@@ -184,7 +185,7 @@ class DBTable
* @param array array of arguments key values
* @return void
*/
function load ()
public function load()
{
// bug::traceRoute();
$ncount = 0;
@@ -219,7 +220,7 @@ class DBTable
* @param eter string seq
* @return string
*/
function nextvalPGSql ($seq)
public function nextvalPGSql($seq)
{
$stQry = " Select NEXTVAL( '$seq' ) ";
$dset = $this->_dbses->Execute($stQry);
@@ -239,7 +240,7 @@ class DBTable
* @return boolean
*
*/
function insert ()
public function insert()
{
$strFields = "";
$strValues = "";
@@ -278,7 +279,7 @@ class DBTable
* @access public
* @return boolean
*/
function update ()
public function update()
{
$stQry = "";
@@ -310,7 +311,7 @@ class DBTable
$remainKeys[$field] = true;
}
}
foreach ($remainKeys as $field => $bool)
foreach ($remainKeys as $field => $bool) {
if ($bool == false) {
if ($stWhere != "") {
$stWhere = " AND ";
@@ -318,6 +319,7 @@ class DBTable
$stWhere .= $field . "= ''";
$remainKeys[$field] = true;
}
}
$stQry = trim($stQry);
$stQry = substr($stQry, 0, strlen($stQry) - 1); //to remove the last comma ,
@@ -345,7 +347,7 @@ class DBTable
* @access public
* @return boolean
*/
function save ()
public function save()
{
if ($this->is_new == true) {
return $this->Insert();
@@ -361,7 +363,7 @@ class DBTable
* @access public
* @return boolean
*/
function delete ()
public function delete()
{
$stQry = "delete from `" . $this->table_name . "` ";
@@ -389,7 +391,7 @@ class DBTable
}
}
}
foreach ($remainKeys as $field => $bool)
foreach ($remainKeys as $field => $bool) {
if ($bool == false) {
if ($stWhere != "") {
$stWhere .= " AND ";
@@ -397,6 +399,7 @@ class DBTable
$stWhere .= $field . "= ''";
$remainKeys[$field] = true;
}
}
$stQry = trim($stQry);
$stWhere = trim($stWhere);
@@ -421,7 +424,7 @@ class DBTable
* @access public
* @return boolean
*/
function next ()
public function next()
{
$this->Fields = $this->_dset->read();
}

View File

@@ -35,35 +35,32 @@
* date Aug 31th, 2010
* @copyright (C) 2002 by Colosa Development Team.
*/
class i18n_PO
{
private $_file = null;
private $_string = '';
private $_meta;
private $_fp;
private $_fileComments;
protected $_editingHeader;
protected $_fileLine;
protected $flagEndHeaders;
protected $flagError;
protected $flagInit;
protected $lineNumber;
public $translatorComments;
public $extractedComments;
public $references;
public $flags;
public $previousUntranslatedStrings;
function __construct ($file)
public function __construct($file)
{
$this->file = $file;
}
function buildInit ()
public function buildInit()
{
$this->_fp = fopen($this->file, 'w');
@@ -85,7 +82,7 @@ class i18n_PO
$this->_editingHeader = true;
}
function readInit ()
public function readInit()
{
$this->_fp = fopen($this->file, 'r');
@@ -104,7 +101,7 @@ class i18n_PO
$this->previousUntranslatedStrings = Array();
}
function addHeader ($id, $value)
public function addHeader($id, $value)
{
if ($this->_editingHeader) {
$meta = '"' . trim($id) . ': ' . trim($value) . '\n"';
@@ -112,42 +109,42 @@ class i18n_PO
}
}
function addTranslatorComment ($str)
public function addTranslatorComment($str)
{
$this->headerStroke();
$comment = '# ' . trim($str);
$this->_writeLine($comment);
}
function addExtractedComment ($str)
public function addExtractedComment($str)
{
$this->headerStroke();
$comment = '#. ' . trim($str);
$this->_writeLine($comment);
}
function addReference ($str)
public function addReference($str)
{
$this->headerStroke();
$reference = '#: ' . trim($str);
$this->_writeLine($reference);
}
function addFlag ($str)
public function addFlag($str)
{
$this->headerStroke();
$flag = '#, ' . trim($str);
$this->_writeLine($flag);
}
function addPreviousUntranslatedString ($str)
public function addPreviousUntranslatedString($str)
{
$this->headerStroke();
$str = '#| ' . trim($str);
$this->_writeLine($str);
}
function addTranslation ($msgid, $msgstr)
public function addTranslation($msgid, $msgstr)
{
$this->headerStroke();
$this->_writeLine('msgid "' . $this->prepare($msgid, true) . '"');
@@ -155,44 +152,40 @@ class i18n_PO
$this->_writeLine('');
}
function _writeLine ($str)
public function _writeLine($str)
{
$this->_write($str . "\n");
}
function _write ($str)
public function _write($str)
{
fwrite($this->_fp, $str);
}
function prepare ($string, $reverse = false)
public function prepare($string, $reverse = false)
{
//$string = str_replace('\"', '"', $string);
//$string = stripslashes($string);
if ($reverse) {
$smap = array ('"',"\n","\t","\r"
);
$rmap = array ('\"','\\n"' . "\n" . '"','\\t','\\r'
);
$smap = array('"', "\n", "\t", "\r");
$rmap = array('\"', '\\n"' . "\n" . '"', '\\t', '\\r');
return (string) str_replace($smap, $rmap, $string);
} else {
$string = preg_replace('/"\s+"/', '', $string);
$smap = array ('\\n','\\r','\\t','\"'
);
$rmap = array ("\n","\r","\t",'"'
);
$smap = array('\\n', '\\r', '\\t', '\"');
$rmap = array("\n", "\r", "\t", '"');
return (string) str_replace($smap, $rmap, $string);
}
}
function headerStroke ()
public function headerStroke()
{
if ($this->_editingHeader) {
$this->_editingHeader = false;
$this->_writeLine('');
;
}
}
@@ -221,10 +214,9 @@ class i18n_PO
while (!$this->flagError && !$this->flagEndHeaders) {
if ($this->flagInit) { //in first instance
if ($this->flagInit) {
//in first instance
$this->flagInit = false; //unset init flag
//read the first and second line of the file
$firstLine = fgets($this->_fp);
$secondLine = fgets($this->_fp);
@@ -260,8 +252,6 @@ class i18n_PO
break;
}
} //end looking for headeers
//verifying the headers data
if (!isset($this->_meta['X-Poedit-Language'])) {
if (!isset($this->_meta['Language'])) {
@@ -293,7 +283,7 @@ class i18n_PO
}
}
function getHeaders ()
public function getHeaders()
{
return $this->_meta;
}
@@ -403,12 +393,11 @@ class i18n_PO
g::pr($match);
die; */
return Array ('msgid' => trim( $msgid ),'msgstr' => trim( $msgstr )
);
return Array('msgid' => trim($msgid), 'msgstr' => trim($msgstr));
}
//garbage
function __destruct ()
public function __destruct()
{
if ($this->_fp) {
fclose($this->_fp);

View File

@@ -30,6 +30,7 @@
* @package gulliver.system
*
*/
/**
*
*
@@ -43,18 +44,19 @@
*/
class Menu
{
var $Id = null;
var $Options = null;
var $Labels = null;
var $Icons = null;
var $JS = null;
var $Types = null;
var $Class = "mnu";
var $Classes = null;
var $Enabled = null;
var $optionOn = - 1;
var $id_optionOn = "";
var $ElementClass = null;
public $Id = null;
public $Options = null;
public $Labels = null;
public $Icons = null;
public $JS = null;
public $Types = null;
public $Class = "mnu";
public $Classes = null;
public $Enabled = null;
public $optionOn = - 1;
public $id_optionOn = "";
public $ElementClass = null;
/**
* Set menu style
@@ -64,7 +66,7 @@ class Menu
* @param $strClass name of style class default value 'mnu'
* @return void
*/
function SetClass ($strClass = "mnu")
public function SetClass($strClass = "mnu")
{
$this->Class = "mnu";
}
@@ -77,7 +79,7 @@ class Menu
* @param $strMenuName name of menu
* @return void
*/
function Load ($strMenuName)
public function Load($strMenuName)
{
global $G_TMP_MENU;
$G_TMP_MENU = null;
@@ -105,7 +107,7 @@ class Menu
//?
$c = 0;
for ($i = 0; $i < count( $G_TMP_MENU->Options ); $i ++)
for ($i = 0; $i < count($G_TMP_MENU->Options); $i++) {
if ($G_TMP_MENU->Enabled[$i] == 1) {
$this->Options[$c] = $G_TMP_MENU->Options[$i];
$this->Labels[$c] = $G_TMP_MENU->Labels[$i];
@@ -118,13 +120,15 @@ class Menu
$this->ElementClass[$c] = $G_TMP_MENU->ElementClass[$i];
$c++;
} else {
if ($i == $this->optionOn)
if ($i == $this->optionOn) {
$this->optionOn = - 1;
elseif ($i < $this->optionOn)
} elseif ($i < $this->optionOn) {
$this->optionOn--;
elseif ($this->optionOn > 0)
} elseif ($this->optionOn > 0) {
$this->optionOn--; //added this line
}
}
}
$G_TMP_MENU = null;
}
@@ -135,7 +139,7 @@ class Menu
* @access public
* @return int
*/
function OptionCount ()
public function OptionCount()
{
$result = 0;
if (is_array($this->Options)) {
@@ -154,7 +158,7 @@ class Menu
* @param string $strType type, defualt value ='plugins'
* @return void
*/
function AddOption ($strLabel, $strURL, $strType = "plugins")
public function AddOption($strLabel, $strURL, $strType = "plugins")
{
$pos = $this->OptionCount();
$this->Options[$pos] = $strURL;
@@ -176,7 +180,7 @@ class Menu
* @param string $strType type, defualt value ='plugins'
* @return void
*/
function AddIdOption ($strId, $strLabel, $strURL, $strType = "plugins")
public function AddIdOption($strId, $strLabel, $strURL, $strType = "plugins")
{
$pos = $this->OptionCount();
$this->Options[$pos] = $strURL;
@@ -201,7 +205,7 @@ class Menu
* @param string $strType type, defualt value ='plugins'
* @return void
*/
function AddRawOption ($strURL = "", $strType = "plugins")
public function AddRawOption($strURL = "", $strType = "plugins")
{
$pos = $this->OptionCount();
$this->Options[$pos] = $strURL;
@@ -224,7 +228,7 @@ class Menu
* @param string $elementClass default value =''
* @return void
*/
function AddIdRawOption ($strId, $strURL = "", $label = "", $icon = "", $js = "", $strType = "plugins", $elementClass = '')
public function AddIdRawOption($strId, $strURL = "", $label = "", $icon = "", $js = "", $strType = "plugins", $elementClass = '')
{
$pos = $this->OptionCount();
$this->Options[$pos] = $strURL;
@@ -251,7 +255,7 @@ class Menu
* @param string $intPos menu option's position
* @return void
*/
function DisableOptionPos ($intPos)
public function DisableOptionPos($intPos)
{
$this->Enabled[$intPos] = 0;
}
@@ -264,7 +268,7 @@ class Menu
* @param string $id menu's id
* @return void
*/
function DisableOptionId ($id)
public function DisableOptionId($id)
{
if (array_search($id, $this->Id)) {
$this->Enabled[array_search($id, $this->Id)] = 0;
@@ -279,7 +283,7 @@ class Menu
* @param string $intPos menu option's position
* @return void
*/
function RenderOption ($intPos)
public function RenderOption($intPos)
{
if ($this->Enabled[$intPos] != 1) {
return;
@@ -304,7 +308,6 @@ class Menu
$result .= htmlentities($label, ENT_NOQUOTES, 'utf-8');
$result .= "</a>";
print ($result);
}
/**
@@ -319,7 +322,7 @@ class Menu
* @param string $G_ID_MENU_SELECTED
* @return array
*/
function generateArrayForTemplate ($G_MAIN_MENU, $classOn, $classOff, $G_MENU_SELECTED, $G_ID_MENU_SELECTED)
public function generateArrayForTemplate($G_MAIN_MENU, $classOn, $classOff, $G_MENU_SELECTED, $G_ID_MENU_SELECTED)
{
$menus = array();
if ($G_MAIN_MENU == null) {
@@ -374,8 +377,7 @@ class Menu
$elementclass = 'class="' . $this->ElementClass[$ncount] . '"';
}
$menus[] = array ('id' => $ncount,'target' => $target,'label' => $label,'onMenu' => $onMenu,'classname' => $classname,'imageLeft' => $imageLeft,'onclick' => $onclick,'icon' => $icon,'aux' => $aux,'idName' => $idName,'elementclass' => $elementclass
);
$menus[] = array('id' => $ncount, 'target' => $target, 'label' => $label, 'onMenu' => $onMenu, 'classname' => $classname, 'imageLeft' => $imageLeft, 'onclick' => $onclick, 'icon' => $icon, 'aux' => $aux, 'idName' => $idName, 'elementclass' => $elementclass);
}
}
return $menus;

View File

@@ -1,4 +1,5 @@
<?php
/**
* class.tree.php
*
@@ -25,7 +26,6 @@
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
/**
*
* @package gulliver.system
@@ -34,18 +34,19 @@ G::LoadSystem( 'objectTemplate' );
class Tree extends Xml_Node
{
var $template = 'tree.html';
var $nodeType = 'base';
var $nodeClass = 'treeNode';
var $contentClass = 'treeContent';
var $width = '100%';
var $contentWidth = '360';
var $contracted = false;
var $showSign = true;
var $isChild = false;
var $plus = "<span style='position:absolute; width:16px;height:22px;cursor:pointer;'onclick='tree.expand(this.parentNode);'>&nbsp;</span>";
var $minus = "<span style='position:absolute; width:16px;height:22px;cursor:pointer' onclick='tree.contract(this.parentNode);'>&nbsp;</span>";
var $point = "<span style='position:absolute; width:5px;height:10px;cursor:pointer;' onclick='tree.select(this.parentNode);'>&nbsp;</span>";
public $template = 'tree.html';
public $nodeType = 'base';
public $nodeClass = 'treeNode';
public $contentClass = 'treeContent';
public $width = '100%';
public $contentWidth = '360';
public $contracted = false;
public $showSign = true;
public $isChild = false;
public $plus = "<span style='position:absolute; width:16px;height:22px;cursor:pointer;'onclick='tree.expand(this.parentNode);'>&nbsp;</span>";
public $minus = "<span style='position:absolute; width:16px;height:22px;cursor:pointer' onclick='tree.contract(this.parentNode);'>&nbsp;</span>";
public $point = "<span style='position:absolute; width:5px;height:10px;cursor:pointer;' onclick='tree.select(this.parentNode);'>&nbsp;</span>";
/**
* Tree
@@ -86,7 +87,6 @@ class Tree extends Xml_Node
*
* @return object(Tree) $newNode
*/
public function &addChild($name, $label, $attributes = array())
{
$newNode = new Tree(new Xml_Node($name, 'open', $label, $attributes));
@@ -153,8 +153,7 @@ class Tree extends Xml_Node
public function render()
{
$obj = new objectTemplate($this->template);
return $obj->printObject( array ('node' => &$this
) );
return $obj->printObject(array('node' => &$this));
}
}

View File

@@ -34,11 +34,11 @@
*/
class Xml_Node
{
var $name = '';
var $type = '';
var $value = ''; //maybe not necesary
var $attributes = array ();
var $children = array ();
public $name = '';
public $type = '';
public $value = ''; //maybe not necesary
public $attributes = array ();
public $children = array ();
/**
* Function Xml_Node
@@ -51,7 +51,7 @@ class Xml_Node
* @param eter string attributes
* @return string
*/
function Xml_Node ($name, $type, $value, $attributes = array())
public function Xml_Node ($name, $type, $value, $attributes = array())
{
$this->name = $name;
$this->type = $type;
@@ -68,7 +68,7 @@ class Xml_Node
* @param eter string value
* @return string
*/
function addAttribute ($name, $value)
public function addAttribute ($name, $value)
{
$this->attributes[$name] = $value;
return true;
@@ -82,7 +82,7 @@ class Xml_Node
* @param eter string childNode
* @return string
*/
function addChildNode ($childNode)
public function addChildNode ($childNode)
{
if (is_object( $childNode ) && strcasecmp( get_class( $childNode ), 'Xml_Node' ) == 0) {
$this->type = 'open';
@@ -101,7 +101,7 @@ class Xml_Node
* @access public
* @return string
*/
function toTree ()
public function toTree ()
{
$arr = new Xml_Node( $this->name, $this->type, $this->value, $this->attributes );
unset( $arr->parent );
@@ -112,7 +112,7 @@ class Xml_Node
return $arr;
}
function toArray ($obj = null)
public function toArray ($obj = null)
{
$arr = array ();
if (! isset( $obj )) {
@@ -136,7 +136,7 @@ class Xml_Node
* @param eter string xpath
* @return string
*/
function &findNode ($xpath)
public function &findNode ($xpath)
{
$n = null;
$p = explode( '/', $xpath );
@@ -180,7 +180,7 @@ class Xml_Node
* @param eter string xpath
* @return string
*/
function getXML ()
public function getXML ()
{
switch ($this->type) {
case 'open':
@@ -237,7 +237,7 @@ class Xml_Node
return $xml;
}
function getCDATAValue ()
public function getCDATAValue ()
{
$cdata = htmlentities( $this->value, ENT_QUOTES, 'utf-8' );
if ($this->value === $cdata) {
@@ -257,7 +257,7 @@ class Xml_Node
*/
class Xml_document extends Xml_Node
{
var $currentNode;
public $currentNode;
/**
* Function Xml_document
@@ -266,7 +266,7 @@ class Xml_document extends Xml_Node
* @access public
* @return string
*/
function Xml_document ()
public function Xml_document ()
{
$this->currentNode = &$this;
}
@@ -280,7 +280,7 @@ class Xml_document extends Xml_Node
* @param eter string content
* @return string
*/
function parseXmlFile ($filename, $content = "")
public function parseXmlFile ($filename, $content = "")
{ //$content is a new variable, if it has any value then use it instead of the file content.
if ($content == "") {
if (! file_exists( $filename )) {
@@ -333,7 +333,7 @@ class Xml_document extends Xml_Node
* @param eter string xpath
* @return string
*/
function &findNode ($xpath)
public function &findNode ($xpath)
{
if (substr( $xpath, 0, 1 ) == '/') {
return parent::findNode( substr( $xpath, 1 ) );
@@ -357,7 +357,7 @@ class Xml_document extends Xml_Node
* @access public
* @return string $xml
*/
function getXML ()
public function getXML ()
{
$xml = '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
$xml .= $this->children[0]->getXML();
@@ -370,7 +370,7 @@ class Xml_document extends Xml_Node
* @access public
* @return void
*/
function save ($filename)
public function save ($filename)
{
$xml = $this->getXML();
$fp = fopen( $filename, 'w' );

View File

@@ -30,11 +30,10 @@
*
* @package gulliver.system
*/
class XmlForm_Field_Label extends XmlForm_Field
{
var $withoutValue = true;
var $align = 'left';
public $withoutValue = true;
public $align = 'left';
}
/**
@@ -49,12 +48,12 @@ class XmlForm_Field_cellMark extends XmlForm_Field
/* Defines the style of the next tds
of the pagedTable.
*/
var $showInTable = "0";
var $style = "";
var $styleAlt = "";
var $className = "";
var $classNameAlt = "";
var $condition = 'false';
public $showInTable = "0";
public $style = "";
public $styleAlt = "";
public $className = "";
public $classNameAlt = "";
public $condition = 'false';
/**
* tdStyle
@@ -64,7 +63,7 @@ class XmlForm_Field_cellMark extends XmlForm_Field
*
* @return string $value
*/
function tdStyle ($values, $owner)
public function tdStyle($values, $owner)
{
$value = G::replaceDataField($this->condition, $owner->values);
$value = @eval('return (' . $value . ');');
@@ -81,7 +80,7 @@ class XmlForm_Field_cellMark extends XmlForm_Field
*
* @return $value
*/
function tdClass ($values, $owner)
public function tdClass($values, $owner)
{
$value = G::replaceDataField($this->condition, $owner->values);
$value = @eval('return (' . $value . ');');
@@ -101,9 +100,9 @@ class XmlForm_Field_cellMark extends XmlForm_Field
*/
class XmlForm_Field_DVEditor extends XmlForm_Field
{
var $toolbarSet = 'toolbar2lines.html';
var $width = '90%';
var $height = '200';
public $toolbarSet = 'toolbar2lines.html';
public $width = '90%';
public $height = '200';
/**
* render
@@ -113,7 +112,7 @@ class XmlForm_Field_DVEditor extends XmlForm_Field
*
* @return string '<div> ... </div>'
*/
function render ($value, $owner = null)
public function render($value, $owner = null)
{
return '<div style="width:' . htmlentities($this->width, ENT_QUOTES, 'utf-8') . ';height:' . htmlentities($this->height, ENT_QUOTES, 'utf-8') . '"><input id="form[' . $this->name . ']" name="form[' . $this->name . ']" type="hidden" value="' . htmlentities($value, ENT_QUOTES, 'UTF-8') . '"/></div>';
}
@@ -125,7 +124,7 @@ class XmlForm_Field_DVEditor extends XmlForm_Field
*
* @return $html
*/
function attachEvents ($element)
public function attachEvents($element)
{
$html = 'var _editor' . $this->name . '=new DVEditor(getField("form[' . $this->name . ']").parentNode,getField("form[' . $this->name . ']").value)';
return $html;
@@ -153,9 +152,9 @@ class XmlForm_Field_DVEditor extends XmlForm_Field
*/
class XmlForm_Field_FastSearch extends XmlForm_Field_Text
{
var $onkeypress = "if (event.keyCode===13)@#PAGED_TABLE_ID.doFastSearch(this.value);if (event.keyCode===13)return false;";
var $colAlign = "right";
var $colWidth = "180";
var $label = "@G::LoadTranslation(ID_SEARCH)";
public $onkeypress = "if (event.keyCode===13)@#PAGED_TABLE_ID.doFastSearch(this.value);if (event.keyCode===13)return false;";
public $colAlign = "right";
public $colWidth = "180";
public $label = "@G::LoadTranslation(ID_SEARCH)";
}

View File

@@ -33,7 +33,6 @@
// License: LGPL, see LICENSE
////////////////////////////////////////////////////
/**
* Processmaker Installer
*
@@ -41,9 +40,9 @@
* @author maborak
* @copyright 2008 COLOSA
*/
class Installer
{
public $options = Array();
public $result = Array();
public $error = Array();
@@ -56,7 +55,7 @@ class Installer
* @param string $pPRO_UID
* @return void
*/
function __construct ()
public function __construct()
{
}
@@ -132,8 +131,6 @@ class Installer
if ($this->options['advanced']['ao_db_drop'] === true) {
//Delete workspace directory if exists
//Drop databases
$this->run_query("DROP DATABASE IF EXISTS " . $wf, "Drop database $wf");
$this->run_query("DROP DATABASE IF EXISTS " . $rb, "Drop database $rb");
@@ -200,9 +197,9 @@ class Installer
$db_text = "<?php\n" . "// Processmaker configuration\n" . "define ('DB_ADAPTER', 'mysql' );\n" . "define ('DB_HOST', '" . $this->options['database']['hostname'] . ":" . $myPort . "' );\n" . "define ('DB_NAME', '" . $wf . "' );\n" . "define ('DB_USER', '" . (($this->cc_status == 1) ? $wf : $this->options['database']['username']) . "' );\n" . "define ('DB_PASS', '" . (($this->cc_status == 1) ? $this->options['password'] : $this->options['database']['password']) . "' );\n" . "define ('DB_RBAC_HOST', '" . $this->options['database']['hostname'] . ":" . $myPort . "' );\n" . "define ('DB_RBAC_NAME', '" . $rb . "' );\n" . "define ('DB_RBAC_USER', '" . (($this->cc_status == 1) ? $rb : $this->options['database']['username']) . "' );\n" . "define ('DB_RBAC_PASS', '" . (($this->cc_status == 1) ? $this->options['password'] : $this->options['database']['password']) . "' );\n" . "define ('DB_REPORT_HOST', '" . $this->options['database']['hostname'] . ":" . $myPort . "' );\n" . "define ('DB_REPORT_NAME', '" . $rp . "' );\n" . "define ('DB_REPORT_USER', '" . (($this->cc_status == 1) ? $rp : $this->options['database']['username']) . "' );\n" . "define ('DB_REPORT_PASS', '" . (($this->cc_status == 1) ? $this->options['password'] : $this->options['database']['password']) . "' );\n" . "?>";
$fp = @fopen($db_file, "w");
$this->log( "Create: " . $db_file . " => " . ((! $fp) ? $fp : "OK") . "\n", $fp === FALSE );
$this->log("Create: " . $db_file . " => " . ((!$fp) ? $fp : "OK") . "\n", $fp === false);
$ff = @fputs($fp, $db_text, strlen($db_text));
$this->log( "Write: " . $db_file . " => " . ((! $ff) ? $ff : "OK") . "\n", $ff === FALSE );
$this->log("Write: " . $db_file . " => " . ((!$ff) ? $ff : "OK") . "\n", $ff === false);
fclose($fp);
$this->set_admin();
@@ -236,7 +233,7 @@ class Installer
* @param string $query SQL command
* @param string $description Description to log instead of $query
*/
private function run_query ($query, $description = NULL)
private function run_query($query, $description = null)
{
$result = @mysql_query($query, $this->connection_database);
$error = ($result) ? false : mysql_error();
@@ -253,7 +250,7 @@ class Installer
public function query_sql_file($file, $connection)
{
$lines = file($file);
$previous = NULL;
$previous = null;
$errors = '';
@mysql_query("SET NAMES 'utf8';");
foreach ($lines as $j => $line) {
@@ -280,7 +277,7 @@ class Installer
if ($previous) {
$line = $previous . " " . $line;
}
$previous = NULL;
$previous = null;
// If the current line doesnt end with ; then put this line together
// with the next one, thus supporting multi-line statements.
@@ -302,7 +299,6 @@ class Installer
*/
private function check_path()
{
}
/**
@@ -329,11 +325,12 @@ class Installer
*/
public function file_permisions($file, $def = 777)
{
if (PHP_OS == 'WINNT')
if (PHP_OS == 'WINNT') {
return $def;
else
} else {
return (int) substr(sprintf('%o', @fileperms($file)), - 4);
}
}
/**
* is_dir_writable
@@ -481,7 +478,6 @@ class Installer
$rt['message'] = "Successful connection";
}
@mysql_query("DROP DATABASE " . $dbNameTest, $this->connection_database);
}
// var_dump($wf,$rb,$rp);
}
@@ -498,11 +494,12 @@ class Installer
* @param string $text
* @return void
*/
public function log ($text, $failed = NULL)
public function log($text, $failed = null)
{
array_push($this->report, $text);
if ($failed)
if ($failed) {
throw new Exception(is_string($text) ? $text : var_export($text, true) );
}
}
?>
}

View File

@@ -1,4 +1,5 @@
<?php
/**
* class.dates.php
*
@@ -30,7 +31,6 @@
*
* @author David Callizaya <davidsantos@colosa.com>
*/
require_once ("classes/model/TaskPeer.php");
require_once ("classes/model/HolidayPeer.php");
@@ -40,6 +40,7 @@ require_once ("classes/model/HolidayPeer.php");
*/
class dates
{
private $holidays = array();
private $weekends = array();
private $range = array();
@@ -47,7 +48,6 @@ class dates
private $calendarDays = false; //by default we are using working days
private $hoursPerDay = 8; //you should change this
/**
* Function that calculate a final date based on $sInitDate and $iDuration
* This function also uses a Calendar component (class.calendar.php) where all the definition of
@@ -70,7 +70,7 @@ class dates
*
*
*/
function calculateDate ($sInitDate, $iDuration, $sTimeUnit, $iTypeDay, $UsrUid = NULL, $ProUid = NULL, $TasUid = NULL)
public function calculateDate($sInitDate, $iDuration, $sTimeUnit, $iTypeDay, $UsrUid = null, $ProUid = null, $TasUid = null)
{
//$oldDate=$this->calculateDate_noCalendar( $sInitDate, $iDuration, $sTimeUnit, $iTypeDay, $UsrUid, $ProUid, $TasUid);
//Set Calendar when the object is instanced in this order/priority (Task, User, Process, Default)
@@ -175,8 +175,7 @@ class dates
* @return integer timestamp of the result
* @deprecated renamed by Hugo Loza (see calculateDate new function)
*/
function calculateDate_noCalendar ($sInitDate, $iDuration, $sTimeUnit, $iTypeDay, $UsrUid = NULL, $ProUid = NULL, $TasUid = NULL)
public function calculateDate_noCalendar($sInitDate, $iDuration, $sTimeUnit, $iTypeDay, $UsrUid = null, $ProUid = null, $TasUid = null)
{
//load in class variables the config of working days, holidays etc..
$this->prepareInformation($UsrUid, $ProUid, $TasUid);
@@ -195,12 +194,14 @@ class dates
}
$addSign = ($iDuration >= 0) ? '+' : '-';
$iInitDate = strtotime($sInitDate);
if ($iTypeDay == 1) { // working days
if ($iTypeDay == 1) {
// working days
// if there are days calculate the days,
$iEndDate = $this->addDays($iInitDate, $iDays, $addSign);
// if there are hours calculate the hours, and probably add a day if the quantity of hours for last day > 8 hours
$iEndDate = $this->addHours($iEndDate, $iHours, $addSign);
} else { // $task->getTasTypeDay() == 2 // calendar days
} else {
// $task->getTasTypeDay() == 2 // calendar days
$iEndDate = strtotime($addSign . $iDays . ' days ', $iInitDate);
$iEndDate = strtotime($addSign . $iHours . ' hours ', $iEndDate);
}
@@ -218,7 +219,7 @@ class dates
* @return int
*
*/
function calculateDuration ($sInitDate, $sEndDate = '', $UsrUid = NULL, $ProUid = NULL, $TasUid = NULL)
public function calculateDuration($sInitDate, $sEndDate = '', $UsrUid = null, $ProUid = null, $TasUid = null)
{
$this->prepareInformation($UsrUid, $ProUid, $TasUid);
if ((string) $sEndDate == '') {
@@ -239,12 +240,10 @@ class dates
$fHours1 = 0.0;
$fHours2 = 0.0;
if (count($aInitDate) != 3) {
$aInitDate = array (0,0,0
);
$aInitDate = array(0, 0, 0);
}
if (count($aEndDate) != 3) {
$aEndDate = array (0,0,0
);
$aEndDate = array(0, 0, 0);
}
if ($aInitDate !== $aEndDate) {
while (!$bFinished && ($i < 10000)) {
@@ -283,7 +282,7 @@ class dates
* @param string $TasUid
* @return void
*/
function prepareInformation ($UsrUid = NULL, $ProUid = NULL, $TasUid = NULL)
public function prepareInformation($UsrUid = null, $ProUid = null, $TasUid = null)
{
// setup calendarDays according the task
if (isset($TasUid)) {
@@ -296,12 +295,12 @@ class dates
//get an array with all holidays.
$aoHolidays = HolidayPeer::doSelect(new Criteria());
$holidays = array();
foreach ($aoHolidays as $holiday)
foreach ($aoHolidays as $holiday) {
$holidays[] = strtotime($holiday->getHldDate());
}
// by default the weekdays are from monday to friday
$this->weekends = array (0,6
);
$this->weekends = array(0, 6);
$this->holidays = $holidays;
return;
}
@@ -312,7 +311,7 @@ class dates
* @param $bSkipEveryYear
* @return void
*/
function setSkipEveryYear ($bSkipEveryYear)
public function setSkipEveryYear($bSkipEveryYear)
{
$this->skipEveryYear = $bSkipEveryYear === true;
}
@@ -323,13 +322,14 @@ class dates
* @param data $sDate
* @return void
*/
function addHoliday ($sDate)
public function addHoliday($sDate)
{
if ($date = strtotime( $sDate ))
if ($date = strtotime($sDate)) {
$this->holidays[] = self::truncateTime($date);
else
} else {
throw new Exception("Invalid date: $sDate.");
}
}
/**
* Set all the holidays
@@ -337,11 +337,12 @@ class dates
* @param date/array $aDate must be an array of (strtotime type) dates
* @return void
*/
function setHolidays ($aDates)
public function setHolidays($aDates)
{
foreach ($aDates as $sDate)
foreach ($aDates as $sDate) {
$this->holidays = $aDates;
}
}
/**
* Set all the weekends
@@ -351,7 +352,7 @@ class dates
* 7=Saturday
* @return void
*/
function setWeekends ($aWeekends)
public function setWeekends($aWeekends)
{
$this->weekends = $aWeekends;
}
@@ -364,10 +365,11 @@ class dates
* 7=Saturday
* @return void
*/
function skipDayOfWeek ($iDayNumber)
public function skipDayOfWeek($iDayNumber)
{
if ($iDayNumber < 1 || $iDayNumber > 7)
if ($iDayNumber < 1 || $iDayNumber > 7) {
throw new Exception("The day of week must be a number from 1 to 7.");
}
$this->weekends[] = $iDayNumber;
}
@@ -378,24 +380,24 @@ class dates
* @param date $sDateB must be a (strtotime type) dates
* @return void
*/
function addNonWorkingRange ($sDateA, $sDateB)
public function addNonWorkingRange($sDateA, $sDateB)
{
if ($date = strtotime( $sDateA ))
if ($date = strtotime($sDateA)) {
$iDateA = self::truncateTime($date);
else
} else {
throw new Exception("Invalid date: $sDateA.");
if ($date = strtotime( $sDateB ))
}
if ($date = strtotime($sDateB)) {
$iDateB = self::truncateTime($date);
else
} else {
throw new Exception("Invalid date: $sDateB.");
}
if ($iDateA > $iDateB) {
$s = $iDateA;
$iDateA = $iDateB;
$iDateB = $s;
}
;
$this->range[] = array ($iDateA,$iDateB
);
$this->range[] = array($iDateA, $iDateB);
}
/**
@@ -414,9 +416,10 @@ class dates
for ($r = 1; $r <= $iDaysCount; $r++) {
$iEndDate = strtotime($addSign . "1 day", $iEndDate);
$dayOfWeek = idate('w', $iEndDate); //now sunday=0
if (array_search( $dayOfWeek, $this->weekends ) !== false)
if (array_search($dayOfWeek, $this->weekends) !== false) {
$r--; //continue loop, but we are adding one more day.
}
}
return $iEndDate;
}
@@ -428,7 +431,6 @@ class dates
* @param string $addSign
* @return $iEndDate
*/
private function addHours($sInitDate, $iHoursCount, $addSign = '+')
{
$iEndDate = strtotime($addSign . $iHoursCount . " hours", $sInitDate);
@@ -451,9 +453,10 @@ class dates
$rang[0] = self::changeYear($rang[0], $iYear);
$rang[1] = self::changeYear($rang[1], $iYear + $deltaYears);
}
if (($iDate >= $rang[0]) && ($iDate <= $rang[1]))
if (($iDate >= $rang[0]) && ($iDate <= $rang[1])) {
return true;
}
}
return false;
}
@@ -476,8 +479,7 @@ class dates
*/
private function getTime($iDate)
{
return array (idate( 'H', $iDate ),idate( 'm', $iDate ),idate( 's', $iDate )
);
return array(idate('H', $iDate), idate('m', $iDate), idate('s', $iDate));
}
/**
@@ -528,4 +530,4 @@ class dates
return $iDate;
}
}
?>

View File

@@ -1,4 +1,5 @@
<?php
/**
* class.groups.php
*
@@ -34,7 +35,6 @@ require_once 'classes/model/Users.php';
* @package workflow.engine.ProcessMaker
* @copyright 2007 COLOSA
*/
class Groups
{
@@ -44,7 +44,7 @@ class Groups
* @param string $sGroupUID
* @return array
*/
function getUsersOfGroup ($sGroupUID)
public function getUsersOfGroup($sGroupUID)
{
try {
$aUsers = array();
@@ -72,7 +72,7 @@ class Groups
* @param string $sUserUID
* @return array
*/
function getActiveGroupsForAnUser ($sUserUID)
public function getActiveGroupsForAnUser($sUserUID)
{
try {
$oCriteria = new Criteria();
@@ -104,7 +104,7 @@ class Groups
* @param string $GrpUid, $UsrUid
* @return array
*/
function addUserToGroup ($GrpUid, $UsrUid)
public function addUserToGroup($GrpUid, $UsrUid)
{
try {
$oGrp = GroupUserPeer::retrieveByPk($GrpUid, $UsrUid);
@@ -121,12 +121,12 @@ class Groups
}
}
/*
/**
* Remove a user from group
* @param string $GrpUid, $UsrUid
* @return array
*/
function removeUserOfGroup ($GrpUid, $UsrUid)
public function removeUserOfGroup($GrpUid, $UsrUid)
{
$gu = new GroupUser();
$gu->remove($GrpUid, $UsrUid);
@@ -138,7 +138,7 @@ class Groups
* @param none
* @return $objects
*/
function getAllGroups ()
public function getAllGroups()
{
try {
$criteria = new Criteria();
@@ -157,7 +157,7 @@ class Groups
* @param $sUserUid user uid
* @return an array of group objects
*/
function getUserGroups ($sUserUID)
public function getUserGroups($sUserUID)
{
try {
$criteria = new Criteria();
@@ -180,8 +180,7 @@ class Groups
* @param string $sUserUid
* @return object
*/
function getAvailableGroupsCriteria ($sUserUid, $filter = '')
public function getAvailableGroupsCriteria($sUserUid, $filter = '')
{
try {
$oCriteria = new Criteria('workflow');
@@ -223,8 +222,7 @@ class Groups
* @param string $sUserUid
* @return object
*/
function getAssignedGroupsCriteria ($sUserUid, $filter = '')
public function getAssignedGroupsCriteria($sUserUid, $filter = '')
{
try {
$oCriteria = new Criteria('workflow');
@@ -249,7 +247,7 @@ class Groups
}
}
function getGroupsForUser ($usrUid)
public function getGroupsForUser($usrUid)
{
$criteria = $this->getAssignedGroupsCriteria($usrUid);
$criteria->addAscendingOrderByColumn(ContentPeer::CON_VALUE);
@@ -289,7 +287,7 @@ class Groups
* @param string $sGroupUID
* @return array
*/
function getUsersGroupCriteria ($sGroupUID = '')
public function getUsersGroupCriteria($sGroupUID = '')
{
require_once 'classes/model/GroupUser.php';
require_once 'classes/model/Users.php';
@@ -316,7 +314,7 @@ class Groups
* @param string $sGroupUID
* @return array
*/
function getUserGroupsCriteria ($sUserUID = '')
public function getUserGroupsCriteria($sUserUID = '')
{
require_once 'classes/model/GroupUser.php';
require_once 'classes/model/Users.php';
@@ -341,7 +339,7 @@ class Groups
* @param string $sGroupUid
* @return integer $cnt
*/
function getNumberGroups ($sUserUID)
public function getNumberGroups($sUserUID)
{
try {
$allGroups = $this->getUserGroups($sUserUID);
@@ -361,7 +359,7 @@ class Groups
* @param string $sGroupUID
* @return object
*/
function getAvailableUsersCriteria ($sGroupUID = '')
public function getAvailableUsersCriteria($sGroupUID = '')
{
try {
$oCriteria = new Criteria('workflow');
@@ -396,7 +394,7 @@ class Groups
* @param $UsrUid user Uid
* @return 1/0 if it's or not assigned
*/
function verifyUsertoGroup ($GrpUid, $UsrUid)
public function verifyUsertoGroup($GrpUid, $UsrUid)
{
try {
$oGrp = GroupUserPeer::retrieveByPk($GrpUid, $UsrUid);
@@ -416,7 +414,7 @@ class Groups
* @param $sGroupUid group Uid
* @return 1/0 if exist or not
*/
function verifyGroup ($sGroupUID)
public function verifyGroup($sGroupUID)
{
try {
$aUsers = array();
@@ -428,10 +426,11 @@ class Groups
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aRow = $oDataset->getRow();
if (is_array( $aRow ))
if (is_array($aRow)) {
return 1;
else
} else {
return 0;
}
} catch (exception $oError) {
throw ($oError);
}
@@ -461,3 +460,4 @@ class Groups
}
}
}

View File

@@ -2,62 +2,63 @@
class pmGauge
{
/**
* width
*/
var $w = 610;
public $w = 610;
/**
* height
*/
var $h = 300;
public $h = 300;
/**
* value of gauge
*/
var $value = 50;
public $value = 50;
/**
* maxValue
*/
var $maxValue = 100;
public $maxValue = 100;
/**
* redFrom
*/
var $redFrom = 80;
public $redFrom = 80;
/**
* redTo
*/
var $redTo = 100;
public $redTo = 100;
/**
* yellowFrom
*/
var $yellowFrom = 60;
public $yellowFrom = 60;
/**
* yellowTo
*/
var $yellowTo = 80;
public $yellowTo = 80;
/**
* greenFrom
*/
var $greenFrom = 0;
public $greenFrom = 0;
/**
* greenTo
*/
var $greenTo = 60;
public $greenTo = 60;
/**
* centerLabel, the label in the middle of the gauge
*/
var $centerLabel = '';
public $centerLabel = '';
function render ()
public function render()
{
$this->h = $this->w / 2;
$im = imagecreatetruecolor($this->w, $this->h);
@@ -107,10 +108,9 @@ class pmGauge
*/
Header("Content-type: image/png");
ImagePng($im);
}
function renderGauge ($im, $cX, $cY, $diameter)
public function renderGauge($im, $cX, $cY, $diameter)
{
//gauge color
$bgcolor = ImageColorAllocate($im, 247, 247, 247);
@@ -278,7 +278,6 @@ class pmGauge
$centerX = $cX - $bbox[4] / 2;
$centerY = $cY + $dYRing / 2 + 3 - abs($bbox[5]);
imagettftext($im, 9, 0, $centerX, $centerY, $black, $fontArial, $textToDisplay);
}
}

View File

@@ -35,13 +35,14 @@
*/
class serverConf
{
private $_aProperties = array();
private $_aHeartbeatConfig = array();
private $_aWSapces = array();
private $aWSinfo = array();
private $pluginsA = array();
private $errors = array();
private static $instance = NULL;
private static $instance = null;
private $haveSetupData = false;
private $beatType = 'starting';
private $ip;
@@ -58,8 +59,7 @@ class serverConf
private $lanDirection;
private $lanLanguage;
public $workspaces = array();
public $rtlLang = array ('ar','iw','fa'
);
public $rtlLang = array('ar', 'iw', 'fa');
public $filePath = '';
public function __construct()
@@ -75,9 +75,9 @@ class serverConf
*
* @return object
*/
function &getSingleton ()
public function &getSingleton()
{
if (self::$instance == NULL) {
if (self::$instance == null) {
self::$instance = new serverConf();
if ((file_exists(self::$instance->filePath)) && (filesize(self::$instance->filePath) > 0)) {
self::$instance->unSerializeInstance(file_get_contents(self::$instance->filePath));
@@ -92,7 +92,7 @@ class serverConf
*
* @return void
*/
function serializeInstance ()
public function serializeInstance()
{
return serialize(self::$instance);
}
@@ -103,9 +103,9 @@ class serverConf
* @param string $serialized
* @return void
*/
function unSerializeInstance ($serialized)
public function unSerializeInstance($serialized)
{
if (self::$instance == NULL) {
if (self::$instance == null) {
self::$instance = new serverConf();
}
@@ -120,8 +120,7 @@ class serverConf
*
* @return void
*/
function saveSingleton ()
public function saveSingleton()
{
if (defined('PATH_DATA')) {
$this->filePath = PATH_DATA . 'srvConf.singleton';
@@ -136,7 +135,7 @@ class serverConf
* @param string $propertyName
* @param string $propertyValue
*/
function setProperty ($propertyName, $propertyValue)
public function setProperty($propertyName, $propertyValue)
{
$this->_aProperties[$propertyName] = $propertyValue;
$this->saveSingleton();
@@ -149,7 +148,7 @@ class serverConf
* @param string $propertyName
* @return void
*/
function unsetProperty ($propertyName)
public function unsetProperty($propertyName)
{
if (isset($this->_aProperties[$propertyName])) {
unset($this->_aProperties[$propertyName]);
@@ -164,7 +163,7 @@ class serverConf
* @param string $propertyName
* @return string/null
*/
function getProperty ($propertyName)
public function getProperty($propertyName)
{
if (isset($this->_aProperties[$propertyName])) {
return $this->_aProperties[$propertyName];
@@ -179,19 +178,21 @@ class serverConf
*
* @return void
*/
function sucessfulLogin ()
public function sucessfulLogin()
{
$this->logins++;
if (isset( $this->workspaces[SYS_SYS] ) && isset( $this->workspaces[SYS_SYS]['WSP_LOGINS'] ))
if (isset($this->workspaces[SYS_SYS]) && isset($this->workspaces[SYS_SYS]['WSP_LOGINS'])) {
$this->workspaces[SYS_SYS]['WSP_LOGINS']++;
}
if (isset( $this->workspaces[SYS_SYS] ) && ! isset( $this->workspaces[SYS_SYS]['WSP_LOGINS'] ))
if (isset($this->workspaces[SYS_SYS]) && !isset($this->workspaces[SYS_SYS]['WSP_LOGINS'])) {
$this->workspaces[SYS_SYS]['WSP_LOGINS'] = 1;
}
$this->saveSingleton();
}
function setWsInfo ($wsname, $info)
public function setWsInfo($wsname, $info)
{
$this->aWSinfo[$wsname] = $info;
}
@@ -202,10 +203,11 @@ class serverConf
* @param string $wsName
* @return void
*/
function changeStatusWS ($wsName)
public function changeStatusWS($wsName)
{
if (isset( $this->_aWSapces[$wsName] )) { //Enable WS
if (isset($this->_aWSapces[$wsName])) {
//Enable WS
unset($this->_aWSapces[$wsName]);
} else {
$this->_aWSapces[$wsName] = 'disabled';
@@ -220,7 +222,7 @@ class serverConf
* @param $wsname
* @return boolean
*/
function isWSDisabled ($wsName)
public function isWSDisabled($wsName)
{
return isset($this->_aWSapces[$wsName]);
}
@@ -232,14 +234,16 @@ class serverConf
*
* @return boolean
*/
function checkIfHostNameHasChanged ()
public function checkIfHostNameHasChanged()
{
//removed the PM_VERSION control, because when an upgrade is done, the haveSetupData has to be changed.
if ($this->ip != getenv( 'SERVER_ADDR' ))
if ($this->ip != getenv('SERVER_ADDR')) {
return false;
}
if ($this->host != getenv( 'SERVER_NAME' ))
if ($this->host != getenv('SERVER_NAME')) {
return false;
}
return $this->haveSetupData;
}
@@ -251,7 +255,7 @@ class serverConf
* param
* @return array
*/
function getWSList ()
public function getWSList()
{
$dir = PATH_DB;
$wsArray = array();
@@ -259,7 +263,8 @@ class serverConf
if ($handle = opendir($dir)) {
while (false !== ($file = readdir($handle))) {
if (($file != ".") && ($file != "..")) {
if (file_exists( PATH_DB . $file . '/db.php' )) { //print $file."/db.php <hr>";
if (file_exists(PATH_DB . $file . '/db.php')) {
//print $file."/db.php <hr>";
$statusl = ($this->isWSDisabled($file)) ? 'DISABLED' : 'ENABLED';
if (isset($this->aWSinfo[$file])) {
$wsInfo = $this->aWSinfo[$file];
@@ -269,11 +274,10 @@ class serverConf
;
$wsInfo['num_users'] = "not gathered yet";
}
$wsArray[$file] = array ('WSP_ID' => $file,'WSP_NAME' => $file,'WSP_STATUS' => $statusl,'WSP_PROCESS_COUNT' => $wsInfo['num_processes'],'WSP_CASES_COUNT' => $wsInfo['num_cases'],'WSP_USERS_COUNT' => isset( $wsInfo['num_users'] ) ? $wsInfo['num_users'] : ""
);
if (isset( $this->workspaces[$file]['WSP_LOGINS'] ))
$wsArray[$file] = array ('WSP_ID' => $file,'WSP_NAME' => $file,'WSP_STATUS' => $statusl,'WSP_PROCESS_COUNT' => $wsInfo['num_processes'],'WSP_CASES_COUNT' => $wsInfo['num_cases'],'WSP_USERS_COUNT' => isset( $wsInfo['num_users'] ) ? $wsInfo['num_users'] : "");
if (isset($this->workspaces[$file]['WSP_LOGINS'])) {
$wsArray[$file]['WSP_LOGINS'] = $this->workspaces[$file]['WSP_LOGINS'];
}
}
}
}
@@ -281,7 +285,6 @@ class serverConf
}
}
return $wsArray;
}
/**
@@ -294,7 +297,7 @@ class serverConf
* @param string $wsName
* @return array
*/
function getWorkspaceInfo ($wsName)
public function getWorkspaceInfo($wsName)
{
$aResult = Array('num_processes' => '0', 'num_cases' => '0'
);
@@ -324,7 +327,7 @@ class serverConf
*
* @return array
*/
function getPluginsList ()
public function getPluginsList()
{
return $this->pluginsA;
}
@@ -333,12 +336,12 @@ class serverConf
* *
* Register a PLugin
*/
function addPlugin ($workspace, $info)
public function addPlugin($workspace, $info)
{
$this->pluginsA[$workspace] = $info;
}
function getDBVersion ()
public function getDBVersion()
{
$sMySQLVersion = '?????';
if (defined("DB_HOST")) {
@@ -350,8 +353,9 @@ class serverConf
$dbConns = new dbConnections('');
$availdb = '';
foreach ($dbConns->getDbServicesAvailables() as $key => $val) {
if ($availdb != '')
if ($availdb != '') {
$availdb .= ', ';
}
$availdb .= $val['name'];
}
@@ -370,7 +374,7 @@ class serverConf
*
* @return void
*/
function resetLogins ()
public function resetLogins()
{
$this->logins = 0;
if (is_array($this->workspaces)) {
@@ -386,15 +390,16 @@ class serverConf
* @param void
* @return string
*/
function getLanDirection ()
public function getLanDirection()
{
if (!isset($this->lanDirection)) {
$this->lanDirection = 'L';
}
if (defined('SYS_LANG')) {
//if we already have the landirection for this language, just return from serverConf
if ($this->lanLanguage == SYS_LANG)
if ($this->lanLanguage == SYS_LANG) {
return $this->lanDirection;
}
//if not , we need to query Database, in order to get the direction
$this->lanDirection = 'L'; //default value;
@@ -422,7 +427,7 @@ class serverConf
* @param string $propertyValue
* @param string $workspace
*/
function setHeartbeatProperty ($propertyName, $propertyValue, $workspace)
public function setHeartbeatProperty($propertyName, $propertyValue, $workspace)
{
$this->_aHeartbeatConfig[$workspace][$propertyName] = $propertyValue;
$this->saveSingleton();
@@ -436,10 +441,11 @@ class serverConf
* @param string $workspace
* @return void
*/
function unsetHeartbeatProperty ($propertyName, $workspace)
public function unsetHeartbeatProperty($propertyName, $workspace)
{
if (isset( $this->_aHeartbeatConfig[$workspace][$propertyName] ))
if (isset($this->_aHeartbeatConfig[$workspace][$propertyName])) {
unset($this->_aHeartbeatConfig[$workspace][$propertyName]);
}
$this->saveSingleton();
}
@@ -450,7 +456,7 @@ class serverConf
* @param string $propertyName
* @return string/null
*/
function getHeartbeatProperty ($propertyName, $workspace)
public function getHeartbeatProperty($propertyName, $workspace)
{
if (isset($this->_aHeartbeatConfig[$workspace][$propertyName])) {
return $this->_aHeartbeatConfig[$workspace][$propertyName];
@@ -459,10 +465,10 @@ class serverConf
}
}
function isRtl ($lang = SYS_LANG)
public function isRtl($lang = SYS_LANG)
{
$lang = substr($lang, 0, 2);
return in_array($lang, $this->rtlLang);
}
}

View File

@@ -1,4 +1,5 @@
<?php
/**
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2012 Colosa Inc.23
@@ -28,7 +29,9 @@
*/
class BpmnEngine_SearchIndexAccess_Solr
{
const SOLR_VERSION = '&version=2.2';
private $_solrIsEnabled = false;
private $_solrHost = "";
@@ -76,11 +79,10 @@ class BpmnEngine_SearchIndexAccess_Solr
*/
public function getNumberDocuments($workspace)
{
if (! $this->_solrIsEnabled)
if (!$this->_solrIsEnabled) {
return;
}
// get configuration information in base to workspace parameter
// get total number of documents in registry
$solrIntruct = (substr($this->_solrHost, - 1) == "/") ? $this->_solrHost : $this->_solrHost . "/";
$solrIntruct .= $workspace;
@@ -101,8 +103,7 @@ class BpmnEngine_SearchIndexAccess_Solr
if ($sysConf['proxy_user'] != '') {
curl_setopt($handlerTotal, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
}
curl_setopt( $handlerTotal, CURLOPT_HTTPHEADER, array ('Expect:'
) );
curl_setopt($handlerTotal, CURLOPT_HTTPHEADER, array('Expect:'));
}
$responseTotal = curl_exec($handlerTotal);
@@ -127,8 +128,9 @@ class BpmnEngine_SearchIndexAccess_Solr
*/
public function executeQuery($solrRequestData)
{
if (! $this->_solrIsEnabled)
if (!$this->_solrIsEnabled) {
return;
}
$solrIntruct = '';
// get configuration information in base to workspace parameter
$workspace = $solrRequestData->workspace;
@@ -185,8 +187,7 @@ class BpmnEngine_SearchIndexAccess_Solr
if ($sysConf['proxy_user'] != '') {
curl_setopt($handler, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
}
curl_setopt( $handler, CURLOPT_HTTPHEADER, array ('Expect:'
) );
curl_setopt($handler, CURLOPT_HTTPHEADER, array('Expect:'));
}
$response = curl_exec($handler);
@@ -211,8 +212,9 @@ class BpmnEngine_SearchIndexAccess_Solr
*/
public function updateDocument($solrUpdateDocument)
{
if (! $this->_solrIsEnabled)
if (!$this->_solrIsEnabled) {
return;
}
$solrIntruct = '';
// get configuration information in base to workspace parameter
$solrIntruct = (substr($this->_solrHost, - 1) == "/") ? $this->_solrHost : $this->_solrHost . "/";
@@ -223,10 +225,8 @@ class BpmnEngine_SearchIndexAccess_Solr
curl_setopt($handler, CURLOPT_RETURNTRANSFER, true);
curl_setopt($handler, CURLOPT_HTTPHEADER, array('Content-type:application/xml'
)); // -H
curl_setopt( $handler, CURLOPT_BINARYTRANSFER, TRUE ); // --data-binary
curl_setopt($handler, CURLOPT_BINARYTRANSFER, true); // --data-binary
curl_setopt($handler, CURLOPT_POSTFIELDS, $solrUpdateDocument->document); // data
//Apply proxy settings
$sysConf = System::getSystemConfiguration();
if ($sysConf['proxy_host'] != '') {
@@ -237,8 +237,7 @@ class BpmnEngine_SearchIndexAccess_Solr
if ($sysConf['proxy_user'] != '') {
curl_setopt($handler, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
}
curl_setopt( $handler, CURLOPT_HTTPHEADER, array ('Expect:'
) );
curl_setopt($handler, CURLOPT_HTTPHEADER, array('Expect:'));
}
$response = curl_exec($handler);
@@ -260,8 +259,9 @@ class BpmnEngine_SearchIndexAccess_Solr
*/
public function commitChanges($workspace)
{
if (! $this->_solrIsEnabled)
if (!$this->_solrIsEnabled) {
return;
}
$solrIntruct = '';
// get configuration information in base to workspace parameter
$solrIntruct = (substr($this->_solrHost, - 1) == "/") ? $this->_solrHost : $this->_solrHost . "/";
@@ -270,12 +270,9 @@ class BpmnEngine_SearchIndexAccess_Solr
$handler = curl_init($solrIntruct);
curl_setopt($handler, CURLOPT_RETURNTRANSFER, true);
curl_setopt( $handler, CURLOPT_HTTPHEADER, array ('Content-type:application/xml'
) ); // -H
curl_setopt( $handler, CURLOPT_BINARYTRANSFER, TRUE ); // --data-binary
curl_setopt($handler, CURLOPT_HTTPHEADER, array('Content-type:application/xml')); // -H
curl_setopt($handler, CURLOPT_BINARYTRANSFER, true); // --data-binary
curl_setopt($handler, CURLOPT_POSTFIELDS, "<commit/>"); // data
//Apply proxy settings
$sysConf = System::getSystemConfiguration();
if ($sysConf['proxy_host'] != '') {
@@ -286,8 +283,7 @@ class BpmnEngine_SearchIndexAccess_Solr
if ($sysConf['proxy_user'] != '') {
curl_setopt($handler, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
}
curl_setopt( $handler, CURLOPT_HTTPHEADER, array ('Expect:'
) );
curl_setopt($handler, CURLOPT_HTTPHEADER, array('Expect:'));
}
$response = curl_exec($handler);
@@ -309,8 +305,9 @@ class BpmnEngine_SearchIndexAccess_Solr
*/
public function rollbackChanges($workspace)
{
if (! $this->_solrIsEnabled)
if (!$this->_solrIsEnabled) {
return;
}
$solrIntruct = '';
// get configuration information in base to workspace parameter
@@ -320,12 +317,9 @@ class BpmnEngine_SearchIndexAccess_Solr
$handler = curl_init($solrIntruct);
curl_setopt($handler, CURLOPT_RETURNTRANSFER, true);
curl_setopt( $handler, CURLOPT_HTTPHEADER, array ('Content-type:application/xml'
) ); // -H
curl_setopt( $handler, CURLOPT_BINARYTRANSFER, TRUE ); // --data-binary
curl_setopt($handler, CURLOPT_HTTPHEADER, array('Content-type:application/xml')); // -H
curl_setopt($handler, CURLOPT_BINARYTRANSFER, true); // --data-binary
curl_setopt($handler, CURLOPT_POSTFIELDS, "<rollback/>"); // data
//Apply proxy settings
$sysConf = System::getSystemConfiguration();
if ($sysConf['proxy_host'] != '') {
@@ -336,8 +330,7 @@ class BpmnEngine_SearchIndexAccess_Solr
if ($sysConf['proxy_user'] != '') {
curl_setopt($handler, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
}
curl_setopt( $handler, CURLOPT_HTTPHEADER, array ('Expect:'
) );
curl_setopt($handler, CURLOPT_HTTPHEADER, array('Expect:'));
}
$response = curl_exec($handler);
@@ -359,8 +352,9 @@ class BpmnEngine_SearchIndexAccess_Solr
*/
public function optimizeChanges($workspace)
{
if (! $this->_solrIsEnabled)
if (!$this->_solrIsEnabled) {
return;
}
$solrIntruct = '';
// get configuration information in base to workspace parameter
@@ -370,12 +364,9 @@ class BpmnEngine_SearchIndexAccess_Solr
$handler = curl_init($solrIntruct);
curl_setopt($handler, CURLOPT_RETURNTRANSFER, true);
curl_setopt( $handler, CURLOPT_HTTPHEADER, array ('Content-type:application/xml'
) ); // -H
curl_setopt( $handler, CURLOPT_BINARYTRANSFER, TRUE ); // --data-binary
curl_setopt($handler, CURLOPT_HTTPHEADER, array('Content-type:application/xml')); // -H
curl_setopt($handler, CURLOPT_BINARYTRANSFER, true); // --data-binary
curl_setopt($handler, CURLOPT_POSTFIELDS, "<optimize/>"); // data
//Apply proxy settings
$sysConf = System::getSystemConfiguration();
if ($sysConf['proxy_host'] != '') {
@@ -386,8 +377,7 @@ class BpmnEngine_SearchIndexAccess_Solr
if ($sysConf['proxy_user'] != '') {
curl_setopt($handler, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
}
curl_setopt( $handler, CURLOPT_HTTPHEADER, array ('Expect:'
) );
curl_setopt($handler, CURLOPT_HTTPHEADER, array('Expect:'));
}
$response = curl_exec($handler);
@@ -408,8 +398,9 @@ class BpmnEngine_SearchIndexAccess_Solr
*/
public function getListIndexedStoredFields($workspace)
{
if (! $this->_solrIsEnabled)
if (!$this->_solrIsEnabled) {
return;
}
$solrIntruct = '';
// get configuration information in base to workspace parameter
@@ -430,8 +421,7 @@ class BpmnEngine_SearchIndexAccess_Solr
if ($sysConf['proxy_user'] != '') {
curl_setopt($handler, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
}
curl_setopt( $handler, CURLOPT_HTTPHEADER, array ('Expect:'
) );
curl_setopt($handler, CURLOPT_HTTPHEADER, array('Expect:'));
}
$response = curl_exec($handler);
@@ -513,8 +503,9 @@ class BpmnEngine_SearchIndexAccess_Solr
*/
public function deleteAllDocuments($workspace)
{
if (! $this->_solrIsEnabled)
if (!$this->_solrIsEnabled) {
return;
}
// $registry = Zend_Registry::getInstance();
@@ -526,12 +517,9 @@ class BpmnEngine_SearchIndexAccess_Solr
$handler = curl_init($solrIntruct);
curl_setopt($handler, CURLOPT_RETURNTRANSFER, true);
curl_setopt( $handler, CURLOPT_HTTPHEADER, array ('Content-type:application/xml'
) ); // -H
curl_setopt( $handler, CURLOPT_BINARYTRANSFER, TRUE ); // --data-binary
curl_setopt($handler, CURLOPT_HTTPHEADER, array('Content-type:application/xml')); // -H
curl_setopt($handler, CURLOPT_BINARYTRANSFER, true); // --data-binary
curl_setopt($handler, CURLOPT_POSTFIELDS, "<delete><query>*:*</query></delete>"); // data
//Apply proxy settings
$sysConf = System::getSystemConfiguration();
if ($sysConf['proxy_host'] != '') {
@@ -542,8 +530,7 @@ class BpmnEngine_SearchIndexAccess_Solr
if ($sysConf['proxy_user'] != '') {
curl_setopt($handler, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
}
curl_setopt( $handler, CURLOPT_HTTPHEADER, array ('Expect:'
) );
curl_setopt($handler, CURLOPT_HTTPHEADER, array('Expect:'));
}
$response = curl_exec($handler);
@@ -566,8 +553,9 @@ class BpmnEngine_SearchIndexAccess_Solr
*/
public function deleteDocument($workspace, $idQuery)
{
if (! $this->_solrIsEnabled)
if (!$this->_solrIsEnabled) {
return;
}
// $registry = Zend_Registry::getInstance();
@@ -579,12 +567,9 @@ class BpmnEngine_SearchIndexAccess_Solr
$handler = curl_init($solrIntruct);
curl_setopt($handler, CURLOPT_RETURNTRANSFER, true);
curl_setopt( $handler, CURLOPT_HTTPHEADER, array ('Content-type:application/xml'
) ); // -H
curl_setopt( $handler, CURLOPT_BINARYTRANSFER, TRUE ); // --data-binary
curl_setopt($handler, CURLOPT_HTTPHEADER, array('Content-type:application/xml')); // -H
curl_setopt($handler, CURLOPT_BINARYTRANSFER, true); // --data-binary
curl_setopt($handler, CURLOPT_POSTFIELDS, "<delete><query>" . $idQuery . "</query></delete>"); // data
//Apply proxy settings
$sysConf = System::getSystemConfiguration();
if ($sysConf['proxy_host'] != '') {
@@ -595,8 +580,7 @@ class BpmnEngine_SearchIndexAccess_Solr
if ($sysConf['proxy_user'] != '') {
curl_setopt($handler, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
}
curl_setopt( $handler, CURLOPT_HTTPHEADER, array ('Expect:'
) );
curl_setopt($handler, CURLOPT_HTTPHEADER, array('Expect:'));
}
$response = curl_exec($handler);
@@ -617,8 +601,9 @@ class BpmnEngine_SearchIndexAccess_Solr
*/
public function getFacetsList($facetRequest)
{
if (! $this->_solrIsEnabled)
if (!$this->_solrIsEnabled) {
return;
}
$solrIntruct = '';
// get configuration information in base to workspace parameter
@@ -682,8 +667,7 @@ class BpmnEngine_SearchIndexAccess_Solr
if ($sysConf['proxy_user'] != '') {
curl_setopt($handler, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
}
curl_setopt( $handler, CURLOPT_HTTPHEADER, array ('Expect:'
) );
curl_setopt($handler, CURLOPT_HTTPHEADER, array('Expect:'));
}
$response = curl_exec($handler);

View File

@@ -1,4 +1,5 @@
<?php
/**
* class.tasks.php
*
@@ -23,7 +24,6 @@
* 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';
@@ -44,7 +44,6 @@ require_once 'classes/model/Gateway.php';
* @author Julio Cesar Laura Avenda<64>o
* @copyright 2007 COLOSA
*/
class Tasks
{
@@ -124,8 +123,9 @@ class Tasks
{
foreach ($aTask as $key => $row) {
$oTask = new Task();
if ($oTask->taskExists( $row['TAS_UID'] ))
if ($oTask->taskExists($row['TAS_UID'])) {
$oTask->remove($row['TAS_UID']);
}
$res = $oTask->createRow($row);
}
return;
@@ -141,11 +141,12 @@ class Tasks
{
foreach ($aTask as $key => $row) {
$oTask = new Task();
if ($oTask->taskExists( $row['TAS_UID'] ))
if ($oTask->taskExists($row['TAS_UID'])) {
$oTask->remove($row['TAS_UID']);
else
} else {
$res = $oTask->update($row);
}
}
return;
}
@@ -197,8 +198,6 @@ class Tasks
$oTask = new Task();
$oEvent = new Event();
//unset ($row['ROU_UID']);
//Saving Gateway into the GATEWAY table
$idTask = $row['TAS_UID'];
$nextTask = $row['ROU_NEXT_TASK'];
@@ -248,8 +247,9 @@ class Tasks
$row['GAT_UID'] = $sGatewayUID;
}
if ($oRoute->routeExists( $row['ROU_UID'] ))
if ($oRoute->routeExists($row['ROU_UID'])) {
$oRoute->remove($row['ROU_UID']);
}
$routeID = $oRoute->create($row);
@@ -279,7 +279,6 @@ class Tasks
}
}
}
}
return;
}
@@ -295,11 +294,12 @@ class Tasks
foreach ($aRoutes as $key => $row) {
$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']);
else
} else {
$res = $oRoute->update($row);
}
}
return;
}
@@ -338,7 +338,7 @@ class Tasks
* @param string $sTaskUID
* @return void
*/
function deleteTask ($sTaskUID = '')
public function deleteTask($sTaskUID = '')
{
try {
//Instance classes
@@ -471,14 +471,16 @@ class Tasks
{
foreach ($aGateway as $key => $row) {
$oGateway = new Gateway();
if ($oGateway->gatewayExists( $row['GAT_UID'] ))
if ($oGateway->gatewayExists($row['GAT_UID'])) {
$oGateway->remove($row['GAT_UID']);
}
if ($row['TAS_UID'] != '' && $row['GAT_NEXT_TASK'] != '')
if ($row['TAS_UID'] != '' && $row['GAT_NEXT_TASK'] != '') {
continue;
else
} else {
$res = $oGateway->createRow($row);
}
}
return;
}
@@ -524,8 +526,7 @@ class Tasks
{
try {
$oTaskUser = new TaskUser();
return $oTaskUser->create( array ('TAS_UID' => $sTaskUID,'USR_UID' => $sUserUID,'TU_TYPE' => $iType,'TU_RELATION' => 1
) );
return $oTaskUser->create(array('TAS_UID' => $sTaskUID, 'USR_UID' => $sUserUID, 'TU_TYPE' => $iType, 'TU_RELATION' => 1));
} catch (Exception $oError) {
throw ($oError);
}
@@ -712,10 +713,11 @@ class Tasks
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aRow = $oDataset->getRow();
if (is_array( $aRow ))
if (is_array($aRow)) {
return 1;
else
} else {
return 0;
}
} catch (Exception $oError) {
throw ($oError);
}
@@ -740,10 +742,11 @@ class Tasks
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aRow = $oDataset->getRow();
if (is_array( $aRow ))
if (is_array($aRow)) {
return $aRow;
else
} else {
return $aRow;
}
} catch (Exception $oError) {
throw ($oError);
}
@@ -854,6 +857,5 @@ class Tasks
throw ($oError);
}
}
}
?>

View File

@@ -1,8 +1,10 @@
<?php
//require_once ('Base.php');
class Entity_FacetRequest extends Entity_Base
{
public $workspace = '';
public $searchText = '';
public $facetFields = array();
@@ -19,13 +21,13 @@ class Entity_FacetRequest extends Entity_Base
{
}
static function createEmpty()
public static function createEmpty()
{
$obj = new Entity_FacetRequest ();
return $obj;
}
static function createForRequest($data)
public static function createForRequest($data)
{
$obj = new Entity_FacetRequest ();
@@ -39,5 +41,5 @@ class Entity_FacetRequest extends Entity_Base
return $obj;
}
}

View File

@@ -1,8 +1,10 @@
<?php
//require_once ('Base.php');
class Entity_SolrRequestData extends Entity_Base
{
public $workspace = '';
public $startAfter = 0;
public $pageSize = 10;
@@ -22,13 +24,13 @@ class Entity_SolrRequestData extends Entity_Base
{
}
static function createEmpty()
public static function createEmpty()
{
$obj = new Entity_SolrRequestData ();
return $obj;
}
static function createForRequestPagination($data)
public static function createForRequestPagination($data)
{
$obj = new Entity_SolrRequestData ();
@@ -42,5 +44,5 @@ class Entity_SolrRequestData extends Entity_Base
return $obj;
}
}

View File

@@ -1,4 +1,5 @@
<?php
/**
* OutputDocument.php
* @package workflow.engine.classes.model
@@ -23,7 +24,6 @@
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
//require_once ("classes/model/om/BaseOutputDocument.php");
//require_once ("classes/model/Content.php");
@@ -40,6 +40,7 @@
*/
class OutputDocument extends BaseOutputDocument
{
/**
* This value goes in the content table
* @var string
@@ -100,6 +101,7 @@ class OutputDocument extends BaseOutputDocument
* @param string $sAppDocUid
* @return variant
*/
public function load($sOutDocUid)
{
try {
@@ -289,10 +291,7 @@ class OutputDocument extends BaseOutputDocument
if ($this->out_doc_title == '') {
try {
$this->out_doc_title = Content::load(
'OUT_DOC_TITLE',
'',
$this->getOutDocUid(),
(defined('SYS_LANG')? SYS_LANG : 'en')
'OUT_DOC_TITLE', '', $this->getOutDocUid(), (defined('SYS_LANG') ? SYS_LANG : 'en')
);
} catch (Exception $oError) {
throw ($oError);
@@ -319,11 +318,7 @@ class OutputDocument extends BaseOutputDocument
$this->out_doc_title = $sValue;
$iResult = Content::addContent(
'OUT_DOC_TITLE',
'',
$this->getOutDocUid(),
(defined('SYS_LANG')? SYS_LANG : 'en'),
$this->out_doc_title
'OUT_DOC_TITLE', '', $this->getOutDocUid(), (defined('SYS_LANG') ? SYS_LANG : 'en'), $this->out_doc_title
);
} catch (Exception $oError) {
$this->out_doc_title = '';
@@ -342,10 +337,7 @@ class OutputDocument extends BaseOutputDocument
if ($this->out_doc_description == '') {
try {
$this->out_doc_description = Content::load(
'OUT_DOC_DESCRIPTION',
'',
$this->getOutDocUid(),
(defined('SYS_LANG')? SYS_LANG : 'en')
'OUT_DOC_DESCRIPTION', '', $this->getOutDocUid(), (defined('SYS_LANG') ? SYS_LANG : 'en')
);
} catch (Exception $oError) {
throw ($oError);
@@ -372,11 +364,7 @@ class OutputDocument extends BaseOutputDocument
$this->out_doc_description = $sValue;
$iResult = Content::addContent(
'OUT_DOC_DESCRIPTION',
'',
$this->getOutDocUid(),
(defined('SYS_LANG')? SYS_LANG : 'en'),
$this->out_doc_description
'OUT_DOC_DESCRIPTION', '', $this->getOutDocUid(), (defined('SYS_LANG') ? SYS_LANG : 'en'), $this->out_doc_description
);
} catch (Exception $oError) {
$this->out_doc_description = '';
@@ -395,10 +383,7 @@ class OutputDocument extends BaseOutputDocument
if ($this->out_doc_filename == '') {
try {
$this->out_doc_filename = Content::load(
'OUT_DOC_FILENAME',
'',
$this->getOutDocUid(),
(defined('SYS_LANG')? SYS_LANG : 'en')
'OUT_DOC_FILENAME', '', $this->getOutDocUid(), (defined('SYS_LANG') ? SYS_LANG : 'en')
);
} catch (Exception $oError) {
throw ($oError);
@@ -425,11 +410,7 @@ class OutputDocument extends BaseOutputDocument
$this->out_doc_filename = $sValue;
$iResult = Content::addContent(
'OUT_DOC_FILENAME',
'',
$this->getOutDocUid(),
(defined('SYS_LANG')? SYS_LANG : 'en'),
$this->out_doc_filename
'OUT_DOC_FILENAME', '', $this->getOutDocUid(), (defined('SYS_LANG') ? SYS_LANG : 'en'), $this->out_doc_filename
);
} catch (Exception $oError) {
$this->out_doc_filename = '';
@@ -448,10 +429,7 @@ class OutputDocument extends BaseOutputDocument
if ($this->out_doc_template == '') {
try {
$this->out_doc_template = Content::load(
'OUT_DOC_TEMPLATE',
'',
$this->getOutDocUid(),
(defined('SYS_LANG')? SYS_LANG : 'en')
'OUT_DOC_TEMPLATE', '', $this->getOutDocUid(), (defined('SYS_LANG') ? SYS_LANG : 'en')
);
} catch (Exception $oError) {
throw ($oError);
@@ -478,11 +456,7 @@ class OutputDocument extends BaseOutputDocument
$this->out_doc_template = $sValue;
$iResult = Content::addContent(
'OUT_DOC_TEMPLATE',
'',
$this->getOutDocUid(),
(defined('SYS_LANG')? SYS_LANG : 'en'),
$this->out_doc_template
'OUT_DOC_TEMPLATE', '', $this->getOutDocUid(), (defined('SYS_LANG') ? SYS_LANG : 'en'), $this->out_doc_template
);
} catch (Exception $oError) {
$this->out_doc_template = '';
@@ -499,16 +473,9 @@ class OutputDocument extends BaseOutputDocument
* @param string $sPath
* @return variant
*/
public function generate(
$sUID,
$aFields,
$sPath,
$sFilename,
$sContent,
$sLandscape = false,
$sTypeDocToGener = 'BOTH',
$aProperties = array()
) {
public function generate($sUID, $aFields, $sPath, $sFilename, $sContent, $sLandscape = false, $sTypeDocToGener = 'BOTH', $aProperties = array())
{
if (($sUID != '') && is_array($aFields) && ($sPath != '')) {
$sContent = G::replaceDataGridField($sContent, $aFields);
@@ -663,19 +630,12 @@ class OutputDocument extends BaseOutputDocument
} else {
$this->generateHtml2ps_pdf($sUID, $aFields, $sPath, $sFilename, $sContent, $sLandscape, $aProperties);
}
}
//end if $sTypeDocToGener
/* End - Create .pdf */
} else {
return PEAR::raiseError(
null,
G_ERROR_USER_UID,
null,
null,
'You tried to call to a generate method without send the Output Document UID, fields to use and the file path!',
'G_Error',
true
null, G_ERROR_USER_UID, null, null, 'You tried to call to a generate method without send the Output Document UID, fields to use and the file path!', 'G_Error', true
);
}
}
@@ -749,7 +709,6 @@ class OutputDocument extends BaseOutputDocument
copy(PATH_OUTPUT_FILE_DIRECTORY . $sFilename . '.pdf', $sPath . $sFilename . '.pdf');
unlink(PATH_OUTPUT_FILE_DIRECTORY . $sFilename . '.pdf');
unlink(PATH_OUTPUT_FILE_DIRECTORY . $sFilename . '.html');
}
public function generateTcpdf($sUID, $aFields, $sPath, $sFilename, $sContent, $sLandscape = false, $aProperties = array())
@@ -873,7 +832,6 @@ class OutputDocument extends BaseOutputDocument
$pdf->SetProtection($permissions, $userPass, $ownerPass);
}
// ---------------------------------------------------------
// set default font subsetting mode
$pdf->setFontSubsetting(true);
@@ -882,7 +840,8 @@ class OutputDocument extends BaseOutputDocument
// print standard ASCII chars, you can use core fonts like
// helvetica or times to reduce file size.
//$pdf->SetFont('dejavusans', '', 14, '', true);
if (preg_match('/[\x{30FF}\x{3040}-\x{309F}\x{4E00}-\x{9FFF}\x{0E00}-\x{0E7F}]/u', $sContent, $matches)) {// Detect chinese, japanese, thai
// Detect chinese, japanese, thai
if (preg_match('/[\x{30FF}\x{3040}-\x{309F}\x{4E00}-\x{9FFF}\x{0E00}-\x{0E7F}]/u', $sContent, $matches)) {
$pdf->SetFont('kozminproregular');
}
@@ -892,7 +851,6 @@ class OutputDocument extends BaseOutputDocument
// set text shadow effect
//$pdf->setTextShadow(array('enabled'=>true, 'depth_w'=>0.2, 'depth_h'=>0.2, 'color'=>array(196,196,196), 'opacity'=>1, 'blend_mode'=>'Normal'));
// Print text using writeHTMLCell()
// $pdf->writeHTMLCell($w=0, $h=0, $x='', $y='', $html, $border=0, $ln=1, $fill=0, $reseth=true, $align='', $autopadding=true);
if (mb_detect_encoding($sContent) == 'UTF-8') {
@@ -903,7 +861,6 @@ class OutputDocument extends BaseOutputDocument
$doc->encoding = 'UTF-8';
$pdf->writeHTML($doc->saveXML(), false, false, false, false, '');
// ---------------------------------------------------------
// Close and output PDF document
// This method has several options, check the source code documentation for more information.
//$pdf->Output('example_00.pdf', 'I');
@@ -974,8 +931,7 @@ class OutputDocument extends BaseOutputDocument
$GLOBALS['g_config']['pdfSecurity']['openPassword'] != ""
) {
$GLOBALS['g_config']['pdfSecurity']['openPassword'] = G::decrypt(
$GLOBALS['g_config']['pdfSecurity']['openPassword'],
$sUID
$GLOBALS['g_config']['pdfSecurity']['openPassword'], $sUID
);
}
@@ -983,8 +939,7 @@ class OutputDocument extends BaseOutputDocument
$GLOBALS['g_config']['pdfSecurity']['ownerPassword'] != ""
) {
$GLOBALS['g_config']['pdfSecurity']['ownerPassword'] = G::decrypt(
$GLOBALS['g_config']['pdfSecurity']['ownerPassword'],
$sUID
$GLOBALS['g_config']['pdfSecurity']['ownerPassword'], $sUID
);
}

View File

@@ -14,8 +14,8 @@ include_once 'classes/model/Task.php';
*/
abstract class BaseTaskPeer
{
/** the default database name for this class */
const DATABASE_NAME = 'workflow';
/** the table name for this class */
@@ -172,7 +172,6 @@ abstract class BaseTaskPeer
/** The PHP to DB Name Mapping */
private static $phpNameMap = null;
/**
* holds an array of fieldnames
*
@@ -209,6 +208,7 @@ abstract class BaseTaskPeer
include_once 'classes/model/map/TaskMapBuilder.php';
return BasePeer::getMapBuilder('classes.model.map.TaskMapBuilder');
}
/**
* Gets a map (hash) of PHP names to DB column names.
*
@@ -230,6 +230,7 @@ abstract class BaseTaskPeer
}
return self::$phpNameMap;
}
/**
* Translates a fieldname to another type
*
@@ -257,7 +258,6 @@ abstract class BaseTaskPeer
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
* @return array A list of field names
*/
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
{
if (!array_key_exists($type, self::$fieldNames)) {
@@ -388,7 +388,6 @@ abstract class BaseTaskPeer
$criteria->addSelectColumn(TaskPeer::TAS_SELFSERVICE_TIME_UNIT);
$criteria->addSelectColumn(TaskPeer::TAS_SELFSERVICE_TRIGGER_UID);
}
const COUNT = 'COUNT(TASK.TAS_UID)';
@@ -428,6 +427,7 @@ abstract class BaseTaskPeer
return 0;
}
}
/**
* Method to select one object from the DB.
*
@@ -447,6 +447,7 @@ abstract class BaseTaskPeer
}
return null;
}
/**
* Method to do selects.
*
@@ -460,6 +461,7 @@ abstract class BaseTaskPeer
{
return TaskPeer::populateObjects(TaskPeer::doSelectRS($criteria, $con));
}
/**
* Prepares the Criteria object and uses the parent doSelect()
* method to get a ResultSet.
@@ -492,6 +494,7 @@ abstract class BaseTaskPeer
// rows indexed numerically.
return BasePeer::doSelect($criteria, $con);
}
/**
* The returned array will contain objects of the default type or
* objects that inherit from the default.
@@ -512,10 +515,10 @@ abstract class BaseTaskPeer
$obj = new $cls();
$obj->hydrate($rs);
$results[] = $obj;
}
return $results;
}
/**
* Returns the TableMap related to this peer.
* This method is not needed for general use but a specific application could have a need.
@@ -603,7 +606,6 @@ abstract class BaseTaskPeer
$comparison = $criteria->getComparison(TaskPeer::TAS_UID);
$selectCriteria->add(TaskPeer::TAS_UID, $criteria->remove(TaskPeer::TAS_UID), $comparison);
} else {
$criteria = $values->buildCriteria(); // gets full criteria
$selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
@@ -719,63 +721,80 @@ abstract class BaseTaskPeer
}
} else {
if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_TYPE))
if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_TYPE)) {
$columns[TaskPeer::TAS_TYPE] = $obj->getTasType();
}
if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_TIMEUNIT))
if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_TIMEUNIT)) {
$columns[TaskPeer::TAS_TIMEUNIT] = $obj->getTasTimeunit();
}
if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_ALERT))
if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_ALERT)) {
$columns[TaskPeer::TAS_ALERT] = $obj->getTasAlert();
}
if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_ASSIGN_TYPE))
if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_ASSIGN_TYPE)) {
$columns[TaskPeer::TAS_ASSIGN_TYPE] = $obj->getTasAssignType();
}
if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_ASSIGN_LOCATION))
if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_ASSIGN_LOCATION)) {
$columns[TaskPeer::TAS_ASSIGN_LOCATION] = $obj->getTasAssignLocation();
}
if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_ASSIGN_LOCATION_ADHOC))
if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_ASSIGN_LOCATION_ADHOC)) {
$columns[TaskPeer::TAS_ASSIGN_LOCATION_ADHOC] = $obj->getTasAssignLocationAdhoc();
}
if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_TRANSFER_FLY))
if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_TRANSFER_FLY)) {
$columns[TaskPeer::TAS_TRANSFER_FLY] = $obj->getTasTransferFly();
}
if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_CAN_UPLOAD))
if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_CAN_UPLOAD)) {
$columns[TaskPeer::TAS_CAN_UPLOAD] = $obj->getTasCanUpload();
}
if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_VIEW_UPLOAD))
if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_VIEW_UPLOAD)) {
$columns[TaskPeer::TAS_VIEW_UPLOAD] = $obj->getTasViewUpload();
}
if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_VIEW_ADDITIONAL_DOCUMENTATION))
if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_VIEW_ADDITIONAL_DOCUMENTATION)) {
$columns[TaskPeer::TAS_VIEW_ADDITIONAL_DOCUMENTATION] = $obj->getTasViewAdditionalDocumentation();
}
if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_CAN_CANCEL))
if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_CAN_CANCEL)) {
$columns[TaskPeer::TAS_CAN_CANCEL] = $obj->getTasCanCancel();
}
if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_CAN_PAUSE))
if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_CAN_PAUSE)) {
$columns[TaskPeer::TAS_CAN_PAUSE] = $obj->getTasCanPause();
}
if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_CAN_SEND_MESSAGE))
if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_CAN_SEND_MESSAGE)) {
$columns[TaskPeer::TAS_CAN_SEND_MESSAGE] = $obj->getTasCanSendMessage();
}
if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_CAN_DELETE_DOCS))
if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_CAN_DELETE_DOCS)) {
$columns[TaskPeer::TAS_CAN_DELETE_DOCS] = $obj->getTasCanDeleteDocs();
if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_SELF_SERVICE))
}
if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_SELF_SERVICE)) {
$columns[TaskPeer::TAS_SELF_SERVICE] = $obj->getTasSelfService();
}
if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_START))
if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_START)) {
$columns[TaskPeer::TAS_START] = $obj->getTasStart();
}
if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_TO_LAST_USER))
if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_TO_LAST_USER)) {
$columns[TaskPeer::TAS_TO_LAST_USER] = $obj->getTasToLastUser();
}
if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_SEND_LAST_EMAIL))
if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_SEND_LAST_EMAIL)) {
$columns[TaskPeer::TAS_SEND_LAST_EMAIL] = $obj->getTasSendLastEmail();
}
if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_DERIVATION))
if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_DERIVATION)) {
$columns[TaskPeer::TAS_DERIVATION] = $obj->getTasDerivation();
}
}
return BasePeer::doValidate(TaskPeer::DATABASE_NAME, TaskPeer::TABLE_NAME, $columns);
@@ -830,7 +849,6 @@ abstract class BaseTaskPeer
}
}
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
// the MapBuilder classes register themselves with Propel during initialization

View File

@@ -1,4 +1,5 @@
<?php
try {
$form = $_POST['form'];
$FolderUid = $form['FOLDER_UID'];
@@ -24,8 +25,7 @@
if ($tr->validate()) {
// we save it, since we get no validation errors, or do whatever else you like.
$res = $tr->save();
}
else {
} else {
// Something went wrong. We can now get the validationFailures and handle them.
$msg = '';
$validationFailuresArray = $tr->getValidationFailures();
@@ -35,16 +35,12 @@
//return array ( 'codError' => -100, 'rowsAffected' => 0, 'message' => $msg );
}
//return array ( 'codError' => 0, 'rowsAffected' => $res, 'message' => '');
//to do: uniform coderror structures for all classes
//if ( $res['codError'] < 0 ) {
// G::SendMessageText ( $res['message'] , 'error' );
//}
G::Header('location: appFolderList');
}
catch ( Exception $e ) {
} catch (Exception $e) {
$G_PUBLISH = new Publisher;
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage);

View File

@@ -27,7 +27,6 @@
* @author Erik Amaru Ortiz <erik@colosa.com>
* @date Jan 3th, 2010
*/
//require_once 'classes/model/Application.php';
//require_once 'classes/model/Users.php';
//require_once 'classes/model/AppThread.php';
@@ -462,7 +461,6 @@ class Ajax
$result->data = $case->getUsersToReassign($_SESSION['TASK'], $_SESSION['USER_LOGGED']);
print G::json_encode($result);
}
public function reassignCase()
@@ -603,8 +601,6 @@ class Ajax
//!dataInput
$idHistory = $_REQUEST["idHistory"];
//!dataInput
//!dataSytem
$idHistoryArray = explode("_", $idHistory);
$_REQUEST["PRO_UID"] = $idHistoryArray[0];
@@ -732,11 +728,11 @@ class Ajax
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
G::RenderPage('publish', 'raw');
$result->success = true;
@@ -761,7 +757,8 @@ class Ajax
leimnud.browser = {};
leimnud.browser.isIphone = "";
leimnud.iphone = {};
leimnud.iphone.make = function () {};
leimnud.iphone.make = function() {
};
function ajax_function(ajax_server, funcion, parameters, method)
{
}
@@ -840,3 +837,4 @@ $action = $_REQUEST['action'];
unset($_REQUEST['action']);
$ajax->$action($_REQUEST);

View File

@@ -1,4 +1,5 @@
<?php
/**
* processes/ajaxListener.php Ajax Listener for Cases rpc requests
*
@@ -21,13 +22,11 @@
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
/**
*
* @author Erik Amaru Ortiz <erik@colosa.com>
* @date Jan 10th, 2010
*/
$action = $_REQUEST['action'];
unset($_REQUEST['action']);
@@ -37,37 +36,34 @@ $ajax->$action( $_REQUEST );
class Ajax
{
function categoriesList ()
public function categoriesList()
{
require_once "classes/model/ProcessCategory.php";
$processCategory = new ProcessCategory();
$defaultOption = Array();
$defaultOption[] = Array ('CATEGORY_UID' => '<reset>','CATEGORY_NAME' => G::LoadTranslation( 'ID_ALL' )
);
$defaultOption[] = Array ('CATEGORY_UID' => '','CATEGORY_NAME' => G::LoadTranslation( 'ID_PROCESS_NO_CATEGORY' )
);
$defaultOption[] = Array('CATEGORY_UID' => '<reset>', 'CATEGORY_NAME' => G::LoadTranslation('ID_ALL'));
$defaultOption[] = Array('CATEGORY_UID' => '', 'CATEGORY_NAME' => G::LoadTranslation('ID_PROCESS_NO_CATEGORY'));
$response->rows = array_merge($defaultOption, $processCategory->getAll('array'));
echo G::json_encode($response);
}
function processCategories ()
public function processCategories()
{
require_once "classes/model/ProcessCategory.php";
$processCategory = new ProcessCategory();
$defaultOption = Array();
$defaultOption[] = Array ('CATEGORY_UID' => '','CATEGORY_NAME' => G::LoadTranslation( 'ID_PROCESS_NO_CATEGORY' )
);
$defaultOption[] = Array('CATEGORY_UID' => '', 'CATEGORY_NAME' => G::LoadTranslation('ID_PROCESS_NO_CATEGORY'));
$response->rows = array_merge($defaultOption, $processCategory->getAll('array'));
echo G::json_encode($response);
}
function saveProcess ()
public function saveProcess()
{
try {
require_once 'classes/model/Task.php';
@@ -77,8 +73,10 @@ class Ajax
if (!isset($_POST['PRO_UID'])) {
if (Process::existsByProTitle($_POST['PRO_TITLE'])) {
$result = array ('success' => false,'msg' => 'Process Save Error','errors' => array ('PRO_TITLE' => G::LoadTranslation( 'ID_PROCESSTITLE_ALREADY_EXISTS', SYS_LANG, $_POST )
)
$result = array(
'success' => false,
'msg' => 'Process Save Error',
'errors' => array('PRO_TITLE' => G::LoadTranslation('ID_PROCESSTITLE_ALREADY_EXISTS', SYS_LANG, $_POST))
);
print G::json_encode($result);
exit(0);
@@ -98,7 +96,6 @@ class Ajax
$oPluginRegistry = & PMPluginRegistry::getSingleton();
$oPluginRegistry->executeTriggers(PM_NEW_PROCESS_SAVE, $oData);
} else {
//$oProcessMap->updateProcess($_POST['form']);
$sProUid = $_POST['PRO_UID'];
@@ -122,31 +119,33 @@ class Ajax
print G::json_encode($result);
}
function changeStatus ()
public function changeStatus()
{
$ids = explode(',', $_REQUEST['UIDS']);
G::LoadClass('processes');
$oProcess = new Processes();
if (count($ids) > 0) {
foreach ($ids as $id)
foreach ($ids as $id) {
$oProcess->changeStatus($id);
}
}
}
function changeDebugMode ()
public function changeDebugMode()
{
$ids = explode(',', $_REQUEST['UIDS']);
G::LoadClass('processes');
$oProcess = new Processes();
if (count($ids) > 0) {
foreach ($ids as $id)
foreach ($ids as $id) {
$oProcess->changeDebugMode($id);
}
}
}
function getUsers ($params)
public function getUsers($params)
{
require_once 'classes/model/Users.php';
G::LoadClass('configuration');
@@ -156,13 +155,12 @@ class Ajax
$users = Users::getAll($params['start'], $params['limit'], $search);
foreach ($users->data as $i => $user) {
$users->data[$i]['USER'] = $conf->getEnvSetting( 'format', Array ('userName' => $user['USR_USERNAME'],'firstName' => $user['USR_FIRSTNAME'],'lastName' => $user['USR_LASTNAME']
) );
$users->data[$i]['USER'] = $conf->getEnvSetting('format', Array('userName' => $user['USR_USERNAME'], 'firstName' => $user['USR_FIRSTNAME'], 'lastName' => $user['USR_LASTNAME']));
}
print G::json_encode($users);
}
function getGroups ($params)
public function getGroups($params)
{
require_once 'classes/model/Groupwf.php';
$search = isset($params['search']) ? $params['search'] : null;
@@ -171,7 +169,7 @@ class Ajax
print G::json_encode($groups);
}
function assignUsersTask ($param)
public function assignUsersTask($param)
{
try {
require_once 'classes/model/TaskUser.php';
@@ -181,22 +179,20 @@ class Ajax
$TU_TYPE = 1;
foreach ($UIDS as $UID) {
if ($_POST['TU_RELATION'] == 1)
$oTaskUser->create( array ('TAS_UID' => $param['TAS_UID'],'USR_UID' => $UID,'TU_TYPE' => $TU_TYPE,'TU_RELATION' => 1
) );
else
$oTaskUser->create( array ('TAS_UID' => $param['TAS_UID'],'USR_UID' => $UID,'TU_TYPE' => $TU_TYPE,'TU_RELATION' => 2
) );
if ($_POST['TU_RELATION'] == 1) {
$oTaskUser->create(array('TAS_UID' => $param['TAS_UID'], 'USR_UID' => $UID, 'TU_TYPE' => $TU_TYPE, 'TU_RELATION' => 1));
} else {
$oTaskUser->create(array('TAS_UID' => $param['TAS_UID'], 'USR_UID' => $UID, 'TU_TYPE' => $TU_TYPE, 'TU_RELATION' => 2));
}
}
$task = TaskPeer::retrieveByPk($param['TAS_UID']);
$result->success = true;
if (count( $UIDS ) > 1)
$result->msg = __( 'ID_ACTORS_ASSIGNED_SUCESSFULLY', SYS_LANG, Array (count( $UIDS ),$task->getTasTitle()
) );
else
$result->msg = __( 'ID_ACTOR_ASSIGNED_SUCESSFULLY', SYS_LANG, Array ('tas_title' => $task->getTasTitle()
) );
if (count($UIDS) > 1) {
$result->msg = __('ID_ACTORS_ASSIGNED_SUCESSFULLY', SYS_LANG, Array(count($UIDS), $task->getTasTitle()));
} else {
$result->msg = __('ID_ACTOR_ASSIGNED_SUCESSFULLY', SYS_LANG, Array('tas_title' => $task->getTasTitle()));
}
} catch (Exception $e) {
$result->success = false;
$result->msg = $e->getMessage();
@@ -205,7 +201,7 @@ class Ajax
print G::json_encode($result);
}
function removeUsersTask ($param)
public function removeUsersTask($param)
{
try {
require_once 'classes/model/TaskUser.php';
@@ -218,7 +214,6 @@ class Ajax
if ($TU_RELATIONS[$i] == 1) {
$oTaskUser->remove($param['TAS_UID'], $USR_UID, $TU_TYPE, 1);
} else {
$oTaskUser->remove($param['TAS_UID'], $USR_UID, $TU_TYPE, 2);
}
@@ -234,7 +229,7 @@ class Ajax
print G::json_encode($result);
}
function getUsersTask ($param)
public function getUsersTask($param)
{
require_once 'classes/model/TaskUser.php';
G::LoadClass('configuration');
@@ -251,8 +246,9 @@ class Ajax
$usersTaskListItem['USR_USERNAME'] = $userTask['USR_USERNAME'];
$usersTaskListItem['USR_FIRSTNAME'] = $userTask['USR_FIRSTNAME'];
$usersTaskListItem['USR_LASTNAME'] = $userTask['USR_LASTNAME'];
} else
} else {
$usersTaskListItem['NAME'] = $userTask['GRP_TITLE'];
}
$usersTaskListItem['TU_RELATION'] = $userTask['TU_RELATION'];
$usersTaskListItem['USR_UID'] = $userTask['USR_UID'];
@@ -266,7 +262,7 @@ class Ajax
print G::json_encode($result);
}
function getProcessDetail ($param)
public function getProcessDetail($param)
{
require_once 'classes/model/Process.php';
@@ -300,7 +296,7 @@ class Ajax
print G::json_encode($treeDetail);
}
function getProperties ($param)
public function getProperties($param)
{
switch ($param['type']) {
case 'process':
@@ -324,7 +320,6 @@ class Ajax
$result->sucess = true;
$result->prop = $properties;
break;
case 'task':
require_once 'classes/model/Task.php';
$task = new Task();
@@ -344,7 +339,7 @@ class Ajax
print G::json_encode($result);
}
function saveProperties ($param)
public function saveProperties($param)
{
try {
$result->sucess = true;
@@ -389,7 +384,6 @@ class Ajax
$oProcessMap->updateProcess($process);
}
break;
case 'task':
require_once 'classes/model/Task.php';
$oTask = new Task();
@@ -424,34 +418,32 @@ class Ajax
print G::json_encode($result);
}
function getCategoriesList ()
public function getCategoriesList()
{
require_once "classes/model/ProcessCategory.php";
$processCategory = new ProcessCategory();
$defaultOption = Array();
$defaultOption[] = Array ('CATEGORY_UID' => '','CATEGORY_NAME' => ''
);
$defaultOption[] = Array('CATEGORY_UID' => '', 'CATEGORY_NAME' => '');
$response->rows = array_merge($defaultOption, $processCategory->getAll('array'));
print G::json_encode($response);
}
function getCaledarList ()
public function getCaledarList()
{
G::LoadClass('calendar');
$calendar = new CalendarDefinition();
$calendarObj = $calendar->getCalendarList(true, true);
$calendarObj['array'][0] = Array ('CALENDAR_UID' => '','CALENDAR_NAME' => ''
);
$calendarObj['array'][0] = Array('CALENDAR_UID' => '', 'CALENDAR_NAME' => '');
$response->rows = $calendarObj['array'];
print G::json_encode($response);
}
function getPMVariables ($param)
public function getPMVariables($param)
{
G::LoadClass('processMap');
$oProcessMap = new processMap(new DBConnection());
@@ -461,7 +453,5 @@ class Ajax
}
print G::json_encode($response);
}
}

View File

@@ -1,4 +1,5 @@
<?php
/**
* processes_availableProcessesUser.php
*
@@ -22,7 +23,6 @@
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
/**
* @Description This is a callback for the View of all groups from a determinated user
* @author Everth S. Berrios Morales <everth@colosa.com>
@@ -44,12 +44,10 @@ try {
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'processes/processes_availableProcessesUser', $c, array('PRO_UID' => $sProUid));
G::RenderPage('publish', 'raw');
}
catch ( Exception $e ){
} catch (Exception $e) {
$G_PUBLISH = new Publisher;
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage);
G::RenderPage('publish', 'raw');
}
?>

View File

@@ -1,4 +1,5 @@
<?php
/**
* tools/ajaxListener.php Ajax Listener for Cases rpc requests
*
@@ -21,13 +22,11 @@
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
/**
*
* @author Erik Amaru Ortiz <erik@colosa.com>
* @date Jan 10th, 2010
*/
require "classes/model/Translation.php";
$action = $_REQUEST['action'];
@@ -38,7 +37,7 @@ $ajax->$action( $_REQUEST );
class Ajax
{
function getList ($params)
public function getList($params)
{
$search = isset($params['search']) ? $params['search'] : null;
$params['dateFrom'] = str_replace('T00:00:00', '', $params['dateFrom']);
@@ -54,7 +53,7 @@ class Ajax
echo G::json_encode($result);
}
function save ()
public function save()
{
try {
require_once ("classes/model/Translation.php");
@@ -69,7 +68,6 @@ class Ajax
$result->success = true;
$result->msg = 'Label ' . $id . ' saved Successfully!';
}
} catch (Exception $e) {
$result->success = false;
$result->msg = $e->getMessage();
@@ -77,7 +75,7 @@ class Ajax
print G::json_encode($result);
}
function delete ()
public function delete()
{
require_once ("classes/model/Translation.php");
$ids = explode(',', $_POST['IDS']);
@@ -93,7 +91,6 @@ class Ajax
$result->success = true;
$result->msg = 'Deleted Successfully!';
} catch (Exception $e) {
$result->success = false;
$result->msg = $e->getMessage();
@@ -101,14 +98,13 @@ class Ajax
print G::json_encode($result);
}
function rebuild ()
public function rebuild()
{
try {
require_once ("classes/model/Translation.php");
$t = new Translation();
$result = Translation::generateFileTranslation('en');
$result['success'] = true;
} catch (Exception $e) {
$result->success = false;
$result->msg = $e->getMessage();

View File

@@ -1,4 +1,5 @@
<?php
/**
* triggers_WizardSave.php
*
@@ -21,7 +22,6 @@
* 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;
}
@@ -84,13 +84,11 @@ foreach ($aInfoFunction as $k => $v) {
$option = (is_numeric($aDataTriggers[$sOptionTrigger]) || is_bool($aDataTriggers[$sOptionTrigger]) ) ? trim($aDataTriggers[$sOptionTrigger]) : (strstr($aDataTriggers[$sOptionTrigger], "array")) ? trim($aDataTriggers[$sOptionTrigger]) : "'" . trim($aDataTriggers[$sOptionTrigger]) . "'";
break;
}
}
} else {
$option = "''";
}
$methodParamsFinal[] = $option;
}
$i++;
}

View File

@@ -1,4 +1,5 @@
<?php
/**
* triggers_WizardUpdate.php
*
@@ -21,7 +22,6 @@
* 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;
}
@@ -87,13 +87,11 @@ foreach ($aInfoFunction as $k => $v) {
$option = (is_numeric($aDataTriggers[$sOptionTrigger]) || is_bool($aDataTriggers[$sOptionTrigger]) ) ? trim($aDataTriggers[$sOptionTrigger]) : (strstr($aDataTriggers[$sOptionTrigger], "array")) ? trim($aDataTriggers[$sOptionTrigger]) : "'" . trim($aDataTriggers[$sOptionTrigger]) . "'";
break;
}
}
} else {
$option = "' '";
}
$methodParamsFinal[] = $option;
}
$i++;
}

View File

@@ -2,6 +2,7 @@
class Services_Rest_OutputDocument
{
/**
* Implementation for 'GET' method for Rest API
*
@@ -76,6 +77,5 @@ class Services_Rest_OutputDocument
return $result;
}
}