Commit d11bc0f2 authored by Jean-Paul Saman's avatar Jean-Paul Saman

setup.php: fix inserting of initial data.

parent ed8c95d9
......@@ -197,16 +197,23 @@ class CSetupTimesheet extends w2p_System_Setup
}
private function _insertConfigurationData() {
$data = array(
'timesheet_approval_by' => '0',
'timesheet_book_year' => '2014',
'timesheet_sort_order' => 'Ascending'
);
$q = new w2p_Database_Query();
$q->addTable('timesheet_config');
$q->addInsert('timesheet_config', 'timesheet_approval_by');
$q->addInsert('timesheet_value', '0');
$q->addInsert('timesheet_config', 'timesheet_book_year');
$q->addInsert('timesheet_value', '2014');
$q->addInsert('timesheet_config', 'timesheet_sort_order');
$q->addInsert('timesheet_value', 'Ascending');
$result = $q->exec();
return $result;
foreach($data as $key=>$value) {
$q->addTable('timesheet_config');
$q->addInsert('timesheet_config', $key);
$q->addInsert('timesheet_value', $value);
if (!$q->exec()) {
db_error();
return false;
}
$q->clear();
}
return true;
}
}
......
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