Fixed php warnings

This commit is contained in:
Benjamin Renard 2012-09-03 10:22:18 +02:00
parent 702d53839d
commit d9d312957f
4 changed files with 11 additions and 5 deletions

View file

@ -37,7 +37,7 @@ if(LSsession :: startLSsession()) {
if ( LSsession :: canCreate($LSobject) ) { if ( LSsession :: canCreate($LSobject) ) {
$object = new $LSobject(); $object = new $LSobject();
if ($_GET['load']!='') { if (isset($_GET['load']) && $_GET['load']!='') {
$form = $object -> getForm('create',urldecode($_GET['load'])); $form = $object -> getForm('create',urldecode($_GET['load']));
} }
else { else {

View file

@ -232,13 +232,16 @@ class LSattribute {
else if (isset($this -> config['default_value'])) { else if (isset($this -> config['default_value'])) {
$data=$obj -> getFData($this -> config['default_value']); $data=$obj -> getFData($this -> config['default_value']);
} }
else {
$data=NULL;
}
$element = $this -> html -> addToForm($form,$idForm,$data); $element = $this -> html -> addToForm($form,$idForm,$data);
if(!$element) { if(!$element) {
LSerror :: addErrorCode('LSform_06',$this -> name); LSerror :: addErrorCode('LSform_06',$this -> name);
} }
if($this -> config['required']==1) { if(isset($this -> config['required']) && $this -> config['required']==1) {
$form -> setRequired($this -> name); $form -> setRequired($this -> name);
} }
@ -568,7 +571,10 @@ class LSattribute {
* @retval mixed La configuration de validation de l'attribut * @retval mixed La configuration de validation de l'attribut
*/ */
function getValidateConfig() { function getValidateConfig() {
return $this -> config['validation']; if (isset($this -> config['validation'])) {
return $this -> config['validation'];
}
return;
} }
/** /**

View file

@ -352,7 +352,7 @@ class LSform {
if (empty($value)) { if (empty($value)) {
continue; continue;
} }
if (!is_array($this -> _rules[$element])) if (!isset($this -> _rules[$element]) || !is_array($this -> _rules[$element]))
continue; continue;
LSsession :: loadLSclass('LSformRule'); LSsession :: loadLSclass('LSformRule');
foreach($this -> _rules[$element] as $rule) { foreach($this -> _rules[$element] as $rule) {

View file

@ -80,7 +80,7 @@ class LSformElement_password extends LSformElement {
LSdebug ('send by form'); LSdebug ('send by form');
} }
} }
else if ($this -> params['html_options']['mail']['send']==1) { else if (isset($this -> params['html_options']['mail']['isset'])) && $this -> params['html_options']['mail']['send']==1) {
$this -> sendMail = true; $this -> sendMail = true;
LSdebug ('send by config'); LSdebug ('send by config');
} }