Merge pull request #994 from ralpheav/master
Adding SteepSuperVisorPeer interface class
This commit is contained in:
@@ -284,7 +284,7 @@ function G_Field ( form, element, name )
|
|||||||
return me.element.value;
|
return me.element.value;
|
||||||
};
|
};
|
||||||
this.toJSONString=function() {
|
this.toJSONString=function() {
|
||||||
return '{'+me.name+':'+me.element.value.toJSONString()+'}';
|
return '{"'+me.name+'":'+me.element.value.toJSONString()+'}';
|
||||||
};
|
};
|
||||||
this.highLight=function(){
|
this.highLight=function(){
|
||||||
try{
|
try{
|
||||||
|
|||||||
@@ -960,7 +960,7 @@ var callServer;callServer=new leimnud.module.rpc.xmlhttp({url:me.form.ajaxServer
|
|||||||
else{for(var i=0;i<newcont.length;i++){var oAux=me.form.getElementByName(grid);if(oAux){var oAux2=oAux.getElementByName(row,newcont[i].name);if(oAux2){oAux2.setValue(newcont[i].value);oAux2.setContent(newcont[i].content);oAux2.updateDepententFields();}}}}}else{alert('Invalid response: '+response);}
|
else{for(var i=0;i<newcont.length;i++){var oAux=me.form.getElementByName(grid);if(oAux){var oAux2=oAux.getElementByName(row,newcont[i].name);if(oAux2){oAux2.setValue(newcont[i].value);oAux2.setContent(newcont[i].content);oAux2.updateDepententFields();}}}}}else{alert('Invalid response: '+response);}
|
||||||
return true;};this.setValue=function(newValue){me.element.value=newValue;};this.setContent=function(newContent){};this.setAttributes=function(attributes){for(var a in attributes){if(a=='formula'&&attributes[a]){sumaformu(this.element,attributes[a],attributes['mask']);}
|
return true;};this.setValue=function(newValue){me.element.value=newValue;};this.setContent=function(newContent){};this.setAttributes=function(attributes){for(var a in attributes){if(a=='formula'&&attributes[a]){sumaformu(this.element,attributes[a],attributes['mask']);}
|
||||||
switch(typeof(attributes[a])){case'string':case'int':case'boolean':if(a!='strTo'){switch(true){case typeof(me[a])==='undefined':case typeof(me[a])==='object':case typeof(me[a])==='function':case a==='isObject':case a==='isArray':break;default:me[a]=attributes[a];}}
|
switch(typeof(attributes[a])){case'string':case'int':case'boolean':if(a!='strTo'){switch(true){case typeof(me[a])==='undefined':case typeof(me[a])==='object':case typeof(me[a])==='function':case a==='isObject':case a==='isArray':break;default:me[a]=attributes[a];}}
|
||||||
else{me[a]=attributes[a];}}}};this.value=function(){return me.element.value;};this.toJSONString=function(){return'{'+me.name+':'+me.element.value.toJSONString()+'}';};this.highLight=function(){try{G.highLight(me.element);if(G.autoFirstField){me.element.focus();G.autoFirstField=false;setTimeout("G.autoFirstField=true;",1000);}}catch(e){}};}
|
else{me[a]=attributes[a];}}}};this.value=function(){return me.element.value;};this.toJSONString=function(){return'{"'+me.name+'":'+me.element.value.toJSONString()+'}';};this.highLight=function(){try{G.highLight(me.element);if(G.autoFirstField){me.element.focus();G.autoFirstField=false;setTimeout("G.autoFirstField=true;",1000);}}catch(e){}};}
|
||||||
function G_DropDown(form,element,name)
|
function G_DropDown(form,element,name)
|
||||||
{var me=this;this.parent=G_Field;this.parent(form,element,name);this.setContent=function(content){var dd=me.element;var browser=getBrowserClient();if((browser.name=='msie')||((browser.name=='firefox')&&(browser.version<12))){while(dd.options.length>1)dd.remove(0);}else{for(var key in dd.options){dd.options[key]=null;}}
|
{var me=this;this.parent=G_Field;this.parent(form,element,name);this.setContent=function(content){var dd=me.element;var browser=getBrowserClient();if((browser.name=='msie')||((browser.name=='firefox')&&(browser.version<12))){while(dd.options.length>1)dd.remove(0);}else{for(var key in dd.options){dd.options[key]=null;}}
|
||||||
for(var o=0;o<content.options.length;o++){var optn=$dce("OPTION");optn.text=content.options[o].value;optn.value=content.options[o].key;dd.options[o]=optn;}};if(!element)return;leimnud.event.add(this.element,'change',this.updateDepententFields);}
|
for(var o=0;o<content.options.length;o++){var optn=$dce("OPTION");optn.text=content.options[o].value;optn.value=content.options[o].key;dd.options[o]=optn;}};if(!element)return;leimnud.event.add(this.element,'change',this.updateDepententFields);}
|
||||||
|
|||||||
@@ -20,17 +20,16 @@
|
|||||||
*
|
*
|
||||||
* 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.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*NEXT LINE: Runs any configuration defined to be executed before dependent fields recalc*/
|
/*NEXT LINE: Runs any configuration defined to be executed before dependent fields recalc*/
|
||||||
if (isset( $_SESSION['CURRENT_PAGE_INITILIZATION'] ))
|
if (isset( $_SESSION['CURRENT_PAGE_INITILIZATION'] ))
|
||||||
eval( $_SESSION['CURRENT_PAGE_INITILIZATION'] );
|
eval( $_SESSION['CURRENT_PAGE_INITILIZATION'] );
|
||||||
|
|
||||||
|
|
||||||
// G::LoadThirdParty('pear/json','class.json');
|
// G::LoadThirdParty('pear/json','class.json');
|
||||||
// $json=new Services_JSON();
|
// $json=new Services_JSON();
|
||||||
if (!defined('XMLFORM_AJAX_PATH')) define('XMLFORM_AJAX_PATH',PATH_XMLFORM);
|
if (! defined( 'XMLFORM_AJAX_PATH' ))
|
||||||
|
define( 'XMLFORM_AJAX_PATH', PATH_XMLFORM );
|
||||||
|
|
||||||
$_DBArray = array ();
|
$_DBArray = array ();
|
||||||
if (isset( $_SESSION['_DBArray'] )) {
|
if (isset( $_SESSION['_DBArray'] )) {
|
||||||
@@ -63,9 +62,11 @@
|
|||||||
$aKeys = array_keys( $newValue );
|
$aKeys = array_keys( $newValue );
|
||||||
$aValues = array ();
|
$aValues = array ();
|
||||||
for ($i = 1; $i <= ($_POST['row'] - 1); $i ++) {
|
for ($i = 1; $i <= ($_POST['row'] - 1); $i ++) {
|
||||||
$aValues[$i] = array($aKeys[0] => '');
|
$aValues[$i] = array ($aKeys[0] => ''
|
||||||
|
);
|
||||||
}
|
}
|
||||||
$aValues[$_POST['row']] = array($aKeys[0] => $newValue[$aKeys[0]]);
|
$aValues[$_POST['row']] = array ($aKeys[0] => $newValue[$aKeys[0]]
|
||||||
|
);
|
||||||
$newValues[$sKey]->$_POST['grid'] = $aValues;
|
$newValues[$sKey]->$_POST['grid'] = $aValues;
|
||||||
unset( $newValues[$sKey]->$aKeys[0] );
|
unset( $newValues[$sKey]->$aKeys[0] );
|
||||||
}
|
}
|
||||||
@@ -95,7 +96,8 @@
|
|||||||
//Resolve dependencies
|
//Resolve dependencies
|
||||||
//Returns an array ($dependentFields) with the names of the fields
|
//Returns an array ($dependentFields) with the names of the fields
|
||||||
//that depends of fields passed through AJAX ($_GET/$_POST)
|
//that depends of fields passed through AJAX ($_GET/$_POST)
|
||||||
$dependentFields=array(); $aux=array();
|
$dependentFields = array ();
|
||||||
|
$aux = array ();
|
||||||
for ($r = 0; $r < sizeof( $newValues ); $r ++) {
|
for ($r = 0; $r < sizeof( $newValues ); $r ++) {
|
||||||
$newValues[$r] = (array) $newValues[$r];
|
$newValues[$r] = (array) $newValues[$r];
|
||||||
$G_FORM->setValues( $newValues[$r] );
|
$G_FORM->setValues( $newValues[$r] );
|
||||||
@@ -104,8 +106,7 @@
|
|||||||
if (! is_array( $v )) {
|
if (! is_array( $v )) {
|
||||||
$myDependentFields = subDependencies( $k, $G_FORM, $aux );
|
$myDependentFields = subDependencies( $k, $G_FORM, $aux );
|
||||||
$_SESSION[$G_FORM->id][$k] = $v;
|
$_SESSION[$G_FORM->id][$k] = $v;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
foreach ($v[$_POST['row']] as $k1 => $v1) {
|
foreach ($v[$_POST['row']] as $k1 => $v1) {
|
||||||
$myDependentFields = subDependencies( $k1, $G_FORM, $aux, $_POST['grid'] );
|
$myDependentFields = subDependencies( $k1, $G_FORM, $aux, $_POST['grid'] );
|
||||||
$_SESSION[$G_FORM->id][$_POST['grid']][$_POST['row']][$k1] = $v1;
|
$_SESSION[$G_FORM->id][$_POST['grid']][$_POST['row']][$k1] = $v1;
|
||||||
@@ -114,7 +115,8 @@
|
|||||||
$dependentFields = array_merge( $dependentFields, $myDependentFields );
|
$dependentFields = array_merge( $dependentFields, $myDependentFields );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isset($_POST['grid'])) $G_FORM->values=isset($_SESSION[$G_FORM->id]) ? $_SESSION[$G_FORM->id] : array();
|
if (isset( $_POST['grid'] ))
|
||||||
|
$G_FORM->values = isset( $_SESSION[$G_FORM->id] ) ? $_SESSION[$G_FORM->id] : array ();
|
||||||
|
|
||||||
$dependentFields = array_unique( $dependentFields );
|
$dependentFields = array_unique( $dependentFields );
|
||||||
|
|
||||||
@@ -133,25 +135,27 @@
|
|||||||
foreach ($G_FORM->fields[$d] as $attribute => $value) {
|
foreach ($G_FORM->fields[$d] as $attribute => $value) {
|
||||||
switch ($attribute) {
|
switch ($attribute) {
|
||||||
case 'type':
|
case 'type':
|
||||||
$sendContent[$r]->content->{$attribute}=$value;break;
|
$sendContent[$r]->content->{$attribute} = $value;
|
||||||
|
break;
|
||||||
case 'options':
|
case 'options':
|
||||||
$sendContent[$r]->content->{$attribute}=toJSArray($value, $sendContent[$r]->content->type); break;
|
$sendContent[$r]->content->{$attribute} = toJSArray( $value, $sendContent[$r]->content->type );
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$sendContent[$r]->value = isset( $G_FORM->values[$d] ) ? $G_FORM->values[$d] : '';
|
$sendContent[$r]->value = isset( $G_FORM->values[$d] ) ? $G_FORM->values[$d] : '';
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
foreach ($G_FORM->fields[$_POST['grid']]->fields[$d] as $attribute => $value) {
|
foreach ($G_FORM->fields[$_POST['grid']]->fields[$d] as $attribute => $value) {
|
||||||
switch ($attribute) {
|
switch ($attribute) {
|
||||||
case 'type':
|
case 'type':
|
||||||
$sendContent[$r]->content->{$attribute}=$value; break;
|
$sendContent[$r]->content->{$attribute} = $value;
|
||||||
|
break;
|
||||||
case 'options':
|
case 'options':
|
||||||
if ($sendContent[$r]->content->type != 'text') {
|
if ($sendContent[$r]->content->type != 'text') {
|
||||||
$sendContent[$r]->content->{$attribute} = toJSArray( $value );
|
$sendContent[$r]->content->{$attribute} = toJSArray( $value );
|
||||||
}
|
} else {
|
||||||
else {
|
$sendContent[$r]->content->{$attribute} = toJSArray( (isset( $value[$_POST['row']] ) ? array ($value[$_POST['row']]
|
||||||
$sendContent[$r]->content->{$attribute}=toJSArray((isset($value[$_POST['row']]) ? array($value[$_POST['row']]) : array()));
|
) : array ()) );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -176,38 +180,43 @@
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
function subDependencies( $k , &$G_FORM , &$aux, $grid = '') {
|
function subDependencies ($k, &$G_FORM, &$aux, $grid = '')
|
||||||
if (array_search( $k, $aux )!==FALSE) return array();
|
{
|
||||||
|
if (array_search( $k, $aux ) !== FALSE)
|
||||||
|
return array ();
|
||||||
if ($grid == '') {
|
if ($grid == '') {
|
||||||
if (!array_key_exists( $k , $G_FORM->fields )) return array();
|
if (! array_key_exists( $k, $G_FORM->fields ))
|
||||||
if (!isset($G_FORM->fields[$k]->dependentFields)) return array();
|
return array ();
|
||||||
|
if (! isset( $G_FORM->fields[$k]->dependentFields ))
|
||||||
|
return array ();
|
||||||
$aux[] = $k;
|
$aux[] = $k;
|
||||||
if (strpos( $G_FORM->fields[$k]->dependentFields, ',' ) !== false) {
|
if (strpos( $G_FORM->fields[$k]->dependentFields, ',' ) !== false) {
|
||||||
$myDependentFields = explode( ',', $G_FORM->fields[$k]->dependentFields );
|
$myDependentFields = explode( ',', $G_FORM->fields[$k]->dependentFields );
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$myDependentFields = explode( '|', $G_FORM->fields[$k]->dependentFields );
|
$myDependentFields = explode( '|', $G_FORM->fields[$k]->dependentFields );
|
||||||
}
|
}
|
||||||
for ($r = 0; $r < sizeof( $myDependentFields ); $r ++) {
|
for ($r = 0; $r < sizeof( $myDependentFields ); $r ++) {
|
||||||
if ($myDependentFields[$r]=="") unset($myDependentFields[$r]);
|
if ($myDependentFields[$r] == "")
|
||||||
|
unset( $myDependentFields[$r] );
|
||||||
}
|
}
|
||||||
// $mD = $myDependentFields;
|
// $mD = $myDependentFields;
|
||||||
// foreach( $mD as $ki) {
|
// foreach( $mD as $ki) {
|
||||||
// $myDependentFields = array_merge( $myDependentFields , subDependencies( $ki , $G_FORM , $aux ) );
|
// $myDependentFields = array_merge( $myDependentFields , subDependencies( $ki , $G_FORM , $aux ) );
|
||||||
// }
|
// }
|
||||||
}
|
} else {
|
||||||
else {
|
if (! array_key_exists( $k, $G_FORM->fields[$grid]->fields ))
|
||||||
if (!array_key_exists( $k , $G_FORM->fields[$grid]->fields )) return array();
|
return array ();
|
||||||
if (!isset($G_FORM->fields[$grid]->fields[$k]->dependentFields)) return array();
|
if (! isset( $G_FORM->fields[$grid]->fields[$k]->dependentFields ))
|
||||||
|
return array ();
|
||||||
$aux[] = $k;
|
$aux[] = $k;
|
||||||
if (strpos( $G_FORM->fields[$grid]->fields[$k]->dependentFields, ',' ) !== false) {
|
if (strpos( $G_FORM->fields[$grid]->fields[$k]->dependentFields, ',' ) !== false) {
|
||||||
$myDependentFields = explode( ',', $G_FORM->fields[$grid]->fields[$k]->dependentFields );
|
$myDependentFields = explode( ',', $G_FORM->fields[$grid]->fields[$k]->dependentFields );
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$myDependentFields = explode( '|', $G_FORM->fields[$grid]->fields[$k]->dependentFields );
|
$myDependentFields = explode( '|', $G_FORM->fields[$grid]->fields[$k]->dependentFields );
|
||||||
}
|
}
|
||||||
for ($r = 0; $r < sizeof( $myDependentFields ); $r ++) {
|
for ($r = 0; $r < sizeof( $myDependentFields ); $r ++) {
|
||||||
if ($myDependentFields[$r]=="") unset($myDependentFields[$r]);
|
if ($myDependentFields[$r] == "")
|
||||||
|
unset( $myDependentFields[$r] );
|
||||||
}
|
}
|
||||||
// $mD = $myDependentFields;
|
// $mD = $myDependentFields;
|
||||||
// foreach( $mD as $ki) {
|
// foreach( $mD as $ki) {
|
||||||
@@ -216,4 +225,3 @@
|
|||||||
}
|
}
|
||||||
return $myDependentFields;
|
return $myDependentFields;
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ class WebResource
|
|||||||
}
|
}
|
||||||
/* end class WebResource */
|
/* end class WebResource */
|
||||||
|
|
||||||
if (! function_exists( 'json_encode' )) {
|
/*if (! function_exists( 'json_encode' )) {
|
||||||
G::LoadThirdParty( 'pear/json', 'class.json' );
|
G::LoadThirdParty( 'pear/json', 'class.json' );
|
||||||
|
|
||||||
function json_encode (&$value)
|
function json_encode (&$value)
|
||||||
@@ -127,5 +127,5 @@ if (! function_exists( 'json_decode' )) {
|
|||||||
$json = new Services_JSON();
|
$json = new Services_JSON();
|
||||||
return $json->decode( $value );
|
return $json->decode( $value );
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
|||||||
@@ -5,10 +5,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// include base peer class
|
// include base peer class
|
||||||
require_once 'classes/model/om/BaseStepSupervisorPeer.php';
|
//require_once 'classes/model/om/BaseStepSupervisorPeer.php';
|
||||||
|
|
||||||
// include object class
|
// include object class
|
||||||
include_once 'classes/model/StepSupervisor.php';
|
//include_once 'classes/model/StepSupervisor.php';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -581,6 +581,9 @@ Bootstrap::registerClass('StepPeer', PATH_HOME . "engine/classes/mode
|
|||||||
Bootstrap::registerClass('BaseStepSupervisor', PATH_HOME . "engine/classes/model/om/BaseStepSupervisor.php");
|
Bootstrap::registerClass('BaseStepSupervisor', PATH_HOME . "engine/classes/model/om/BaseStepSupervisor.php");
|
||||||
Bootstrap::registerClass('StepSupervisor', PATH_HOME . "engine/classes/model/StepSupervisor.php");
|
Bootstrap::registerClass('StepSupervisor', PATH_HOME . "engine/classes/model/StepSupervisor.php");
|
||||||
|
|
||||||
|
Bootstrap::registerClass('BaseStepSupervisorPeer',PATH_HOME . "engine/classes/model/om/BaseStepSupervisorPeer.php");
|
||||||
|
Bootstrap::registerClass('StepSupervisorPeer', PATH_HOME . "engine/classes/model/StepSupervisorPeer.php");
|
||||||
|
|
||||||
Bootstrap::registerClass('BaseStepTrigger', PATH_HOME . "engine/classes/model/om/BaseStepTrigger.php");
|
Bootstrap::registerClass('BaseStepTrigger', PATH_HOME . "engine/classes/model/om/BaseStepTrigger.php");
|
||||||
Bootstrap::registerClass('StepTrigger', PATH_HOME . "engine/classes/model/StepTrigger.php");
|
Bootstrap::registerClass('StepTrigger', PATH_HOME . "engine/classes/model/StepTrigger.php");
|
||||||
Bootstrap::registerClass('StepTriggerPeer', PATH_HOME . "engine/classes/model/StepTriggerPeer.php");
|
Bootstrap::registerClass('StepTriggerPeer', PATH_HOME . "engine/classes/model/StepTriggerPeer.php");
|
||||||
|
|||||||
Reference in New Issue
Block a user