Commit 01087688 authored by tbrehm's avatar tbrehm

Several fixes to avoid strict warnings. Made a variable public in...

Several fixes to avoid strict warnings. Made a variable public in db_mysql.inc.php. Added missing language tokens to en_users.lng
parent 8ac9a4cf
......@@ -49,7 +49,7 @@ class db
private $errorNumber = 0; // last error number
public $errorMessage = ''; // last error message
private $errorLocation = '';// last error location
private $show_error_messages = false;
public $show_error_messages = false;
public function __construct()
{
......@@ -252,7 +252,7 @@ class db
foreach($columns as $col){
$sql .= $col['name'].' '.$this->mapType($col['type'], $col['typeValue']).' ';
//* Set default value
if($col['defaultValue'] != '') {
if(isset($col['defaultValue']) && $col['defaultValue'] != '') {
if($col['defaultValue'] == 'NULL' or $col['defaultValue'] == 'NOT NULL') {
$sql .= 'DEFAULT '.$col['defaultValue'].' ';
} else {
......@@ -261,19 +261,19 @@ class db
} elseif($col['defaultValue'] != false) {
$sql .= "DEFAULT '' ";
}
if($col['defaultValue'] != 'NULL' && $col['defaultValue'] != 'NOT NULL') {
if(isset($col['defaultValue']) && $col['defaultValue'] != 'NULL' && $col['defaultValue'] != 'NOT NULL') {
if($col['notNull'] == true) {
$sql .= 'NOT NULL ';
} else {
$sql .= 'NULL ';
}
}
if($col['autoInc'] == true){ $sql .= 'auto_increment '; }
if(isset($col['autoInc']) && $col['autoInc'] == true){ $sql .= 'auto_increment '; }
$sql.= ',';
//* Index Definitions
if($col['option'] == 'primary'){ $index .= 'PRIMARY KEY ('.$col['name'].'),'; }
if($col['option'] == 'index'){ $index .= 'INDEX ('.$col['name'].'),'; }
if($col['option'] == 'unique'){ $index .= 'UNIQUE ('.$col['name'].'),'; }
if(isset($col['option']) && $col['option'] == 'primary'){ $index .= 'PRIMARY KEY ('.$col['name'].'),'; }
if(isset($col['option']) && $col['option'] == 'index'){ $index .= 'INDEX ('.$col['name'].'),'; }
if(isset($col['option']) && $col['option'] == 'unique'){ $index .= 'UNIQUE ('.$col['name'].'),'; }
}
$sql .= $index;
$sql = substr($sql,0,-1);
......
......@@ -268,8 +268,8 @@ class listform {
if(is_array($record)) {
foreach($this->listDef['item'] as $field){
$key = $field['field'];
switch ($field['datatype']){
if(isset($record[$key])) {
switch ($field['datatype']){
case 'VARCHAR':
case 'TEXT':
$record[$key] = stripslashes($record[$key]);
......@@ -293,7 +293,8 @@ class listform {
default:
$record[$key] = stripslashes($record[$key]);
}
}
}
}
}
return $record;
......
......@@ -135,10 +135,16 @@ class tform {
$this->formDef = $form;
$this->module = $module;
$wb = array();
if($module == '') {
if(is_file("lib/lang/".$_SESSION["s"]["language"]."_".$this->formDef["name"].".lng")) {
include_once("lib/lang/".$_SESSION["s"]["language"]."_".$this->formDef["name"].".lng");
}
} else {
if(is_file("../$module/lib/lang/".$_SESSION["s"]["language"]."_".$this->formDef["name"].".lng")) {
include_once("../$module/lib/lang/".$_SESSION["s"]["language"]."_".$this->formDef["name"].".lng");
}
}
$this->wordbook = $wb;
......
......@@ -112,7 +112,7 @@ class tform_tpl_generator {
$lang[$key."_txt"] = $key;
// language File Eintrag, fr error-Text anlegen
if($field["errmsg"] != '') {
if(isset($field["errmsg"]) && $field["errmsg"] != '') {
$errmsg = $field["errmsg"];
$lang[$errmsg] = $errmsg;
}
......
......@@ -21,4 +21,7 @@ $wb["telefon_txt"] = 'Telephone';
$wb["fax_txt"] = 'Fax';
$wb["groups_txt"] = 'Groups';
$wb["default_group_txt"] = 'Default Group';
$wb["active_txt"] = 'Active';
$wb["btn_save_txt"] = 'Save';
$wb["btn_cancel_txt"] = 'Cancel';
?>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment