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

View File

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

View File

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

View File

@@ -1,4 +1,5 @@
<?php <?php
/** /**
* class.tree.php * class.tree.php
* *
@@ -25,7 +26,6 @@
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* *
*/ */
/** /**
* *
* @package gulliver.system * @package gulliver.system
@@ -34,18 +34,19 @@ G::LoadSystem( 'objectTemplate' );
class Tree extends Xml_Node class Tree extends Xml_Node
{ {
var $template = 'tree.html';
var $nodeType = 'base'; public $template = 'tree.html';
var $nodeClass = 'treeNode'; public $nodeType = 'base';
var $contentClass = 'treeContent'; public $nodeClass = 'treeNode';
var $width = '100%'; public $contentClass = 'treeContent';
var $contentWidth = '360'; public $width = '100%';
var $contracted = false; public $contentWidth = '360';
var $showSign = true; public $contracted = false;
var $isChild = false; public $showSign = true;
var $plus = "<span style='position:absolute; width:16px;height:22px;cursor:pointer;'onclick='tree.expand(this.parentNode);'>&nbsp;</span>"; public $isChild = false;
var $minus = "<span style='position:absolute; width:16px;height:22px;cursor:pointer' onclick='tree.contract(this.parentNode);'>&nbsp;</span>"; public $plus = "<span style='position:absolute; width:16px;height:22px;cursor:pointer;'onclick='tree.expand(this.parentNode);'>&nbsp;</span>";
var $point = "<span style='position:absolute; width:5px;height:10px;cursor:pointer;' onclick='tree.select(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 * Tree
@@ -86,7 +87,6 @@ class Tree extends Xml_Node
* *
* @return object(Tree) $newNode * @return object(Tree) $newNode
*/ */
public function &addChild($name, $label, $attributes = array()) public function &addChild($name, $label, $attributes = array())
{ {
$newNode = new Tree(new Xml_Node($name, 'open', $label, $attributes)); $newNode = new Tree(new Xml_Node($name, 'open', $label, $attributes));
@@ -153,8 +153,7 @@ class Tree extends Xml_Node
public function render() public function render()
{ {
$obj = new objectTemplate($this->template); $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 class Xml_Node
{ {
var $name = ''; public $name = '';
var $type = ''; public $type = '';
var $value = ''; //maybe not necesary public $value = ''; //maybe not necesary
var $attributes = array (); public $attributes = array ();
var $children = array (); public $children = array ();
/** /**
* Function Xml_Node * Function Xml_Node
@@ -51,7 +51,7 @@ class Xml_Node
* @param eter string attributes * @param eter string attributes
* @return string * @return string
*/ */
function Xml_Node ($name, $type, $value, $attributes = array()) public function Xml_Node ($name, $type, $value, $attributes = array())
{ {
$this->name = $name; $this->name = $name;
$this->type = $type; $this->type = $type;
@@ -68,7 +68,7 @@ class Xml_Node
* @param eter string value * @param eter string value
* @return string * @return string
*/ */
function addAttribute ($name, $value) public function addAttribute ($name, $value)
{ {
$this->attributes[$name] = $value; $this->attributes[$name] = $value;
return true; return true;
@@ -82,7 +82,7 @@ class Xml_Node
* @param eter string childNode * @param eter string childNode
* @return string * @return string
*/ */
function addChildNode ($childNode) public function addChildNode ($childNode)
{ {
if (is_object( $childNode ) && strcasecmp( get_class( $childNode ), 'Xml_Node' ) == 0) { if (is_object( $childNode ) && strcasecmp( get_class( $childNode ), 'Xml_Node' ) == 0) {
$this->type = 'open'; $this->type = 'open';
@@ -101,7 +101,7 @@ class Xml_Node
* @access public * @access public
* @return string * @return string
*/ */
function toTree () public function toTree ()
{ {
$arr = new Xml_Node( $this->name, $this->type, $this->value, $this->attributes ); $arr = new Xml_Node( $this->name, $this->type, $this->value, $this->attributes );
unset( $arr->parent ); unset( $arr->parent );
@@ -112,7 +112,7 @@ class Xml_Node
return $arr; return $arr;
} }
function toArray ($obj = null) public function toArray ($obj = null)
{ {
$arr = array (); $arr = array ();
if (! isset( $obj )) { if (! isset( $obj )) {
@@ -136,7 +136,7 @@ class Xml_Node
* @param eter string xpath * @param eter string xpath
* @return string * @return string
*/ */
function &findNode ($xpath) public function &findNode ($xpath)
{ {
$n = null; $n = null;
$p = explode( '/', $xpath ); $p = explode( '/', $xpath );
@@ -180,7 +180,7 @@ class Xml_Node
* @param eter string xpath * @param eter string xpath
* @return string * @return string
*/ */
function getXML () public function getXML ()
{ {
switch ($this->type) { switch ($this->type) {
case 'open': case 'open':
@@ -237,7 +237,7 @@ class Xml_Node
return $xml; return $xml;
} }
function getCDATAValue () public function getCDATAValue ()
{ {
$cdata = htmlentities( $this->value, ENT_QUOTES, 'utf-8' ); $cdata = htmlentities( $this->value, ENT_QUOTES, 'utf-8' );
if ($this->value === $cdata) { if ($this->value === $cdata) {
@@ -257,7 +257,7 @@ class Xml_Node
*/ */
class Xml_document extends Xml_Node class Xml_document extends Xml_Node
{ {
var $currentNode; public $currentNode;
/** /**
* Function Xml_document * Function Xml_document
@@ -266,7 +266,7 @@ class Xml_document extends Xml_Node
* @access public * @access public
* @return string * @return string
*/ */
function Xml_document () public function Xml_document ()
{ {
$this->currentNode = &$this; $this->currentNode = &$this;
} }
@@ -280,7 +280,7 @@ class Xml_document extends Xml_Node
* @param eter string content * @param eter string content
* @return string * @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. { //$content is a new variable, if it has any value then use it instead of the file content.
if ($content == "") { if ($content == "") {
if (! file_exists( $filename )) { if (! file_exists( $filename )) {
@@ -333,7 +333,7 @@ class Xml_document extends Xml_Node
* @param eter string xpath * @param eter string xpath
* @return string * @return string
*/ */
function &findNode ($xpath) public function &findNode ($xpath)
{ {
if (substr( $xpath, 0, 1 ) == '/') { if (substr( $xpath, 0, 1 ) == '/') {
return parent::findNode( substr( $xpath, 1 ) ); return parent::findNode( substr( $xpath, 1 ) );
@@ -357,7 +357,7 @@ class Xml_document extends Xml_Node
* @access public * @access public
* @return string $xml * @return string $xml
*/ */
function getXML () public function getXML ()
{ {
$xml = '<?xml version="1.0" encoding="UTF-8"?>' . "\n"; $xml = '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
$xml .= $this->children[0]->getXML(); $xml .= $this->children[0]->getXML();
@@ -370,7 +370,7 @@ class Xml_document extends Xml_Node
* @access public * @access public
* @return void * @return void
*/ */
function save ($filename) public function save ($filename)
{ {
$xml = $this->getXML(); $xml = $this->getXML();
$fp = fopen( $filename, 'w' ); $fp = fopen( $filename, 'w' );

View File

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

View File

@@ -33,7 +33,6 @@
// License: LGPL, see LICENSE // License: LGPL, see LICENSE
//////////////////////////////////////////////////// ////////////////////////////////////////////////////
/** /**
* Processmaker Installer * Processmaker Installer
* *
@@ -41,9 +40,9 @@
* @author maborak * @author maborak
* @copyright 2008 COLOSA * @copyright 2008 COLOSA
*/ */
class Installer class Installer
{ {
public $options = Array(); public $options = Array();
public $result = Array(); public $result = Array();
public $error = Array(); public $error = Array();
@@ -56,7 +55,7 @@ class Installer
* @param string $pPRO_UID * @param string $pPRO_UID
* @return void * @return void
*/ */
function __construct () public function __construct()
{ {
} }
@@ -132,8 +131,6 @@ class Installer
if ($this->options['advanced']['ao_db_drop'] === true) { if ($this->options['advanced']['ao_db_drop'] === true) {
//Delete workspace directory if exists //Delete workspace directory if exists
//Drop databases //Drop databases
$this->run_query("DROP DATABASE IF EXISTS " . $wf, "Drop database $wf"); $this->run_query("DROP DATABASE IF EXISTS " . $wf, "Drop database $wf");
$this->run_query("DROP DATABASE IF EXISTS " . $rb, "Drop database $rb"); $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" . "?>"; $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"); $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)); $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); fclose($fp);
$this->set_admin(); $this->set_admin();
@@ -236,7 +233,7 @@ class Installer
* @param string $query SQL command * @param string $query SQL command
* @param string $description Description to log instead of $query * @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); $result = @mysql_query($query, $this->connection_database);
$error = ($result) ? false : mysql_error(); $error = ($result) ? false : mysql_error();
@@ -253,7 +250,7 @@ class Installer
public function query_sql_file($file, $connection) public function query_sql_file($file, $connection)
{ {
$lines = file($file); $lines = file($file);
$previous = NULL; $previous = null;
$errors = ''; $errors = '';
@mysql_query("SET NAMES 'utf8';"); @mysql_query("SET NAMES 'utf8';");
foreach ($lines as $j => $line) { foreach ($lines as $j => $line) {
@@ -280,7 +277,7 @@ class Installer
if ($previous) { if ($previous) {
$line = $previous . " " . $line; $line = $previous . " " . $line;
} }
$previous = NULL; $previous = null;
// If the current line doesnt end with ; then put this line together // If the current line doesnt end with ; then put this line together
// with the next one, thus supporting multi-line statements. // with the next one, thus supporting multi-line statements.
@@ -302,7 +299,6 @@ class Installer
*/ */
private function check_path() private function check_path()
{ {
} }
/** /**
@@ -329,11 +325,12 @@ class Installer
*/ */
public function file_permisions($file, $def = 777) public function file_permisions($file, $def = 777)
{ {
if (PHP_OS == 'WINNT') if (PHP_OS == 'WINNT') {
return $def; return $def;
else } else {
return (int) substr(sprintf('%o', @fileperms($file)), - 4); return (int) substr(sprintf('%o', @fileperms($file)), - 4);
} }
}
/** /**
* is_dir_writable * is_dir_writable
@@ -481,7 +478,6 @@ class Installer
$rt['message'] = "Successful connection"; $rt['message'] = "Successful connection";
} }
@mysql_query("DROP DATABASE " . $dbNameTest, $this->connection_database); @mysql_query("DROP DATABASE " . $dbNameTest, $this->connection_database);
} }
// var_dump($wf,$rb,$rp); // var_dump($wf,$rb,$rp);
} }
@@ -498,11 +494,12 @@ class Installer
* @param string $text * @param string $text
* @return void * @return void
*/ */
public function log ($text, $failed = NULL) public function log($text, $failed = null)
{ {
array_push($this->report, $text); array_push($this->report, $text);
if ($failed) if ($failed) {
throw new Exception(is_string($text) ? $text : var_export($text, true) ); throw new Exception(is_string($text) ? $text : var_export($text, true) );
} }
} }
?> }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,4 +1,5 @@
<?php <?php
/** /**
* triggers_WizardSave.php * triggers_WizardSave.php
* *
@@ -21,7 +22,6 @@
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/ */
if (($RBAC_Response = $RBAC->userCanAccess("PM_FACTORY")) != 1) { if (($RBAC_Response = $RBAC->userCanAccess("PM_FACTORY")) != 1) {
return $RBAC_Response; 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]) . "'"; $option = (is_numeric($aDataTriggers[$sOptionTrigger]) || is_bool($aDataTriggers[$sOptionTrigger]) ) ? trim($aDataTriggers[$sOptionTrigger]) : (strstr($aDataTriggers[$sOptionTrigger], "array")) ? trim($aDataTriggers[$sOptionTrigger]) : "'" . trim($aDataTriggers[$sOptionTrigger]) . "'";
break; break;
} }
} }
} else { } else {
$option = "''"; $option = "''";
} }
$methodParamsFinal[] = $option; $methodParamsFinal[] = $option;
} }
$i++; $i++;
} }

View File

@@ -1,4 +1,5 @@
<?php <?php
/** /**
* triggers_WizardUpdate.php * triggers_WizardUpdate.php
* *
@@ -21,7 +22,6 @@
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/ */
if (($RBAC_Response = $RBAC->userCanAccess("PM_FACTORY")) != 1) { if (($RBAC_Response = $RBAC->userCanAccess("PM_FACTORY")) != 1) {
return $RBAC_Response; 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]) . "'"; $option = (is_numeric($aDataTriggers[$sOptionTrigger]) || is_bool($aDataTriggers[$sOptionTrigger]) ) ? trim($aDataTriggers[$sOptionTrigger]) : (strstr($aDataTriggers[$sOptionTrigger], "array")) ? trim($aDataTriggers[$sOptionTrigger]) : "'" . trim($aDataTriggers[$sOptionTrigger]) . "'";
break; break;
} }
} }
} else { } else {
$option = "' '"; $option = "' '";
} }
$methodParamsFinal[] = $option; $methodParamsFinal[] = $option;
} }
$i++; $i++;
} }

View File

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