BUG 0000 Adjustment for the standardization of code. CODE_STYLE

This commit is contained in:
Hector Cortez
2013-03-14 12:36:34 -04:00
parent 5cc9925075
commit b7e254b425
9 changed files with 864 additions and 897 deletions

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

@@ -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

@@ -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
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
/** /**
* 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++;
} }