X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2FttImportHelper.class.php;h=26cdfac151aad629430170c204c85676e2b170fd;hb=cb8e3de960b758147b34d8323054e7de70548619;hp=67d60dff235b902d6f4427ad3b3ff4868ddf9020;hpb=9c676b689107fb18c634fb91ca016d3d56c76691;p=timetracker.git diff --git a/WEB-INF/lib/ttImportHelper.class.php b/WEB-INF/lib/ttImportHelper.class.php index 67d60dff..26cdfac1 100644 --- a/WEB-INF/lib/ttImportHelper.class.php +++ b/WEB-INF/lib/ttImportHelper.class.php @@ -75,6 +75,7 @@ class ttImportHelper { || $name == 'PROJECT' || $name == 'CLIENT' || $name == 'INVOICE' + || $name == 'MONTHLY_QUOTA' || $name == 'LOG_ITEM' || $name == 'CUSTOM_FIELD' || $name == 'CUSTOM_FIELD_OPTION' @@ -118,7 +119,7 @@ class ttImportHelper { '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'], @@ -211,6 +212,10 @@ class ttImportHelper { '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( @@ -397,4 +402,12 @@ class ttImportHelper { 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')); + } }