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