X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2FttImportHelper.class.php;h=26cdfac151aad629430170c204c85676e2b170fd;hb=b35ed34767de056ad0adef9d85060b587c1f6ce2;hp=29c537f360289f849dba960f49220e53a044aa95;hpb=51d4d0c0575e14bf8cbfa81cfdef08361f075f71;p=timetracker.git diff --git a/WEB-INF/lib/ttImportHelper.class.php b/WEB-INF/lib/ttImportHelper.class.php index 29c537f3..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,6 +119,7 @@ class ttImportHelper { 'address' => $this->teamData['ADDRESS'], 'currency' => $this->teamData['CURRENCY'], 'lock_spec' => $this->teamData['LOCK_SPEC'], + 'workday_hours' => $this->teamData['WORKDAY_HOURS'], 'lang' => $this->teamData['LANG'], 'decimal_mark' => $this->teamData['DECIMAL_MARK'], 'date_format' => $this->teamData['DATE_FORMAT'], @@ -210,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( @@ -396,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')); + } }