|| $name == 'PROJECT'
|| $name == 'CLIENT'
|| $name == 'INVOICE'
+ || $name == 'MONTHLY_QUOTA'
|| $name == 'LOG_ITEM'
|| $name == 'CUSTOM_FIELD'
|| $name == 'CUSTOM_FIELD_OPTION'
'address' => $this->teamData['ADDRESS'],
'currency' => $this->teamData['CURRENCY'],
'lock_spec' => $this->teamData['LOCK_SPEC'],
- 'lock_interval' => $this->teamData['LOCK_INTERVAL'],
+ 'workday_hours' => $this->teamData['WORKDAY_HOURS'],
'lang' => $this->teamData['LANG'],
'decimal_mark' => $this->teamData['DECIMAL_MARK'],
'date_format' => $this->teamData['DATE_FORMAT'],
'status' => $this->currentElement['STATUS']));
}
+ if ($name == 'MONTHLY_QUOTA' && $this->canImport) {
+ $this->insertMonthlyQuota($this->team_id, $this->currentElement['YEAR'], $this->currentElement['MONTH'], $this->currentElement['QUOTA']);
+ }
+
if ($name == 'LOG_ITEM' && $this->canImport) {
$this->logMap[$this->currentElement['ID']] =
ttTimeHelper::insert(array(
fclose ($out_file);
return true;
}
+
+ // insertMonthlyQuota - a helper function to insert a monthly quota.
+ private function insertMonthlyQuota($team_id, $year, $month, $quota) {
+ $mdb2 = getConnection();
+ $sql = "INSERT INTO tt_monthly_quotas (team_id, year, month, quota) values ($team_id, $year, $month, $quota)";
+ $affected = $mdb2->exec($sql);
+ return (!is_a($affected, 'PEAR_Error'));
+ }
}