$skipColumnHeader = FALSE,
$mode = self::MODE_PREVIEW,
$contactType = self::CONTACT_INDIVIDUAL,
- $onDuplicate = self::DUPLICATE_SKIP
+ $onDuplicate = self::DUPLICATE_SKIP,
+ $statusID = NULL,
+ $totalRowCount = NULL
) {
if (!is_array($fileName)) {
CRM_Core_Error::fatal();
else {
$this->_activeFieldCount = count($this->_activeFields);
}
+ if ($statusID) {
+ $this->progressImport($statusID);
+ $startTimestamp = $currTimestamp = $prevTimestamp = time();
+ }
while (!feof($fd)) {
$this->_lineCount++;
}
/* trim whitespace around the values */
-
$empty = TRUE;
foreach ($values as $k => $v) {
$values[$k] = trim($v, " \t\r\n");
}
elseif ($mode == self::MODE_IMPORT) {
$returnCode = $this->import($onDuplicate, $values);
+ if ($statusID && (($this->_lineCount % 50) == 0)) {
+ $prevTimestamp = $this->progressImport($statusID, FALSE, $startTimestamp, $prevTimestamp, $totalRowCount);
+ }
}
else {
$returnCode = self::ERROR;