223 |
else |
else |
224 |
{ |
{ |
225 |
$appstbl = 'phpgw_applications'; |
$appstbl = 'phpgw_applications'; |
226 |
|
if($this->amorethanb($setup_info['phpgwapi']['currentver'],'0.9.13.014')) |
227 |
|
{ |
228 |
|
$use_appid = True; |
229 |
|
} |
230 |
} |
} |
231 |
|
|
232 |
if($DEBUG) |
if($DEBUG) |
241 |
{ |
{ |
242 |
$tables = implode(',',$setup_info[$appname]['tables']); |
$tables = implode(',',$setup_info[$appname]['tables']); |
243 |
} |
} |
244 |
|
if($use_appid) |
245 |
|
{ |
246 |
|
$this->db->query("SELECT MAX(app_id) FROM $appstbl"); |
247 |
|
$this->db->next_record(); |
248 |
|
if($this->db->f(0)) |
249 |
|
{ |
250 |
|
$app_id = ($this->db->f(0) + 1) . ','; |
251 |
|
$app_idstr = 'app_id,'; |
252 |
|
} |
253 |
|
else |
254 |
|
{ |
255 |
|
srand(100000); |
256 |
|
$app_id = rand(1,100000) . ','; |
257 |
|
$app_idstr = 'app_id,'; |
258 |
|
} |
259 |
|
} |
260 |
$this->db->query("INSERT INTO $appstbl " |
$this->db->query("INSERT INTO $appstbl " |
261 |
. "(app_name,app_title,app_enabled,app_order,app_tables,app_version) " |
. "($app_idstr app_name,app_title,app_enabled,app_order,app_tables,app_version) " |
262 |
. "VALUES (" |
. "VALUES (" |
263 |
|
. $app_id |
264 |
. "'" . $setup_info[$appname]['name'] . "'," |
. "'" . $setup_info[$appname]['name'] . "'," |
265 |
. "'" . $setup_info[$appname]['title'] . "'," |
. "'" . $setup_info[$appname]['title'] . "'," |
266 |
. $enable . "," |
. $enable . "," |