BUG 0000 Adjustment for the standardization of code. CODE_STYLE

This commit is contained in:
Hector Cortez
2013-03-14 11:33:22 -04:00
parent 9e0e980a23
commit 5cc9925075
7 changed files with 742 additions and 726 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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