Skip to content

Commit 0108768

Browse files
committed
Several fixes to avoid strict warnings. Made a variable public in db_mysql.inc.php. Added missing language tokens to en_users.lng
1 parent 8ac9a4c commit 0108768

File tree

5 files changed

+21
-11
lines changed

5 files changed

+21
-11
lines changed

interface/lib/classes/db_mysql.inc.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class db
4949
private $errorNumber = 0; // last error number
5050
public $errorMessage = ''; // last error message
5151
private $errorLocation = '';// last error location
52-
private $show_error_messages = false;
52+
public $show_error_messages = false;
5353

5454
public function __construct()
5555
{
@@ -252,7 +252,7 @@ public function createTable($table_name, $columns)
252252
foreach($columns as $col){
253253
$sql .= $col['name'].' '.$this->mapType($col['type'], $col['typeValue']).' ';
254254
//* Set default value
255-
if($col['defaultValue'] != '') {
255+
if(isset($col['defaultValue']) && $col['defaultValue'] != '') {
256256
if($col['defaultValue'] == 'NULL' or $col['defaultValue'] == 'NOT NULL') {
257257
$sql .= 'DEFAULT '.$col['defaultValue'].' ';
258258
} else {
@@ -261,19 +261,19 @@ public function createTable($table_name, $columns)
261261
} elseif($col['defaultValue'] != false) {
262262
$sql .= "DEFAULT '' ";
263263
}
264-
if($col['defaultValue'] != 'NULL' && $col['defaultValue'] != 'NOT NULL') {
264+
if(isset($col['defaultValue']) && $col['defaultValue'] != 'NULL' && $col['defaultValue'] != 'NOT NULL') {
265265
if($col['notNull'] == true) {
266266
$sql .= 'NOT NULL ';
267267
} else {
268268
$sql .= 'NULL ';
269269
}
270270
}
271-
if($col['autoInc'] == true){ $sql .= 'auto_increment '; }
271+
if(isset($col['autoInc']) && $col['autoInc'] == true){ $sql .= 'auto_increment '; }
272272
$sql.= ',';
273273
//* Index Definitions
274-
if($col['option'] == 'primary'){ $index .= 'PRIMARY KEY ('.$col['name'].'),'; }
275-
if($col['option'] == 'index'){ $index .= 'INDEX ('.$col['name'].'),'; }
276-
if($col['option'] == 'unique'){ $index .= 'UNIQUE ('.$col['name'].'),'; }
274+
if(isset($col['option']) && $col['option'] == 'primary'){ $index .= 'PRIMARY KEY ('.$col['name'].'),'; }
275+
if(isset($col['option']) && $col['option'] == 'index'){ $index .= 'INDEX ('.$col['name'].'),'; }
276+
if(isset($col['option']) && $col['option'] == 'unique'){ $index .= 'UNIQUE ('.$col['name'].'),'; }
277277
}
278278
$sql .= $index;
279279
$sql = substr($sql,0,-1);

interface/lib/classes/listform.inc.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,8 @@ public function decode($record)
268268
if(is_array($record)) {
269269
foreach($this->listDef['item'] as $field){
270270
$key = $field['field'];
271-
switch ($field['datatype']){
272-
271+
if(isset($record[$key])) {
272+
switch ($field['datatype']){
273273
case 'VARCHAR':
274274
case 'TEXT':
275275
$record[$key] = stripslashes($record[$key]);
@@ -293,7 +293,8 @@ public function decode($record)
293293

294294
default:
295295
$record[$key] = stripslashes($record[$key]);
296-
}
296+
}
297+
}
297298
}
298299
}
299300
return $record;

interface/lib/classes/tform.inc.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,16 @@ function loadFormDef($file,$module = '') {
135135
$this->formDef = $form;
136136

137137
$this->module = $module;
138+
$wb = array();
139+
138140
if($module == '') {
141+
if(is_file("lib/lang/".$_SESSION["s"]["language"]."_".$this->formDef["name"].".lng")) {
139142
include_once("lib/lang/".$_SESSION["s"]["language"]."_".$this->formDef["name"].".lng");
143+
}
140144
} else {
145+
if(is_file("../$module/lib/lang/".$_SESSION["s"]["language"]."_".$this->formDef["name"].".lng")) {
141146
include_once("../$module/lib/lang/".$_SESSION["s"]["language"]."_".$this->formDef["name"].".lng");
147+
}
142148
}
143149
$this->wordbook = $wb;
144150

interface/lib/classes/tform_tpl_generator.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ function buildHTML($formDef,$tab) {
112112
$lang[$key."_txt"] = $key;
113113

114114
// language File Eintrag, für error-Text anlegen
115-
if($field["errmsg"] != '') {
115+
if(isset($field["errmsg"]) && $field["errmsg"] != '') {
116116
$errmsg = $field["errmsg"];
117117
$lang[$errmsg] = $errmsg;
118118
}

interface/web/admin/lib/lang/en_users.lng

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,7 @@ $wb["telefon_txt"] = 'Telephone';
2121
$wb["fax_txt"] = 'Fax';
2222
$wb["groups_txt"] = 'Groups';
2323
$wb["default_group_txt"] = 'Default Group';
24+
$wb["active_txt"] = 'Active';
25+
$wb["btn_save_txt"] = 'Save';
26+
$wb["btn_cancel_txt"] = 'Cancel';
2427
?>

0 commit comments

Comments
 (0)