<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
protected $_tableName;
/**#@+
- * @access protected
* @var integer
*/
/**
- * total number of lines in file
+ * Total number of lines in file
*/
protected $_rowCount;
/**
- * running total number of un matched Conact
+ * Running total number of un matched Conact
*/
protected $_unMatchCount;
/**
- * array of unmatched lines
+ * Array of unmatched lines
*/
protected $_unMatch;
/**
- * total number of contacts with unparsed addresses
+ * Total number of contacts with unparsed addresses
*/
protected $_unparsedAddressCount;
/**
- * filename of mismatch data
+ * Filename of mismatch data
*
* @var string
*/
protected $_statusFieldName;
/**
- * on duplicate
+ * On duplicate
*
* @var int
*/
public $_onDuplicate;
/**
- * dedupe rule group id to use if set
+ * Dedupe rule group id to use if set
*
* @var int
*/
public $_dedupeRuleGroupID = NULL;
/**
- * @param $tableName
+ * @param string $tableName
* @param $mapper
* @param int $mode
* @param int $contactType
* @param string $primaryKeyName
* @param string $statusFieldName
* @param int $onDuplicate
- * @param null $statusID
+ * @param int $statusID
* @param null $totalRowCount
* @param bool $doGeocodeAddress
* @param int $timeout
* @param null $contactSubType
- * @param null $dedupeRuleGroupID
+ * @param int $dedupeRuleGroupID
*
* @return mixed
*/
$estimatedTime = $estimatedTime - ($estMinutes * 60);
}
$timeFormatted .= round($estimatedTime) . ' ' . ts('seconds');
- $processedPercent = (int )(($this->_rowCount * 100) / $totalRowCount);
+ $processedPercent = (int ) (($this->_rowCount * 100) / $totalRowCount);
$statusMsg = ts('%1 of %2 records - %3 remaining',
array(1 => $this->_rowCount, 2 => $totalRowCount, 3 => $timeFormatted)
);
</div>
";
- $contents = json_encode (array($processedPercent, $status));
+ $contents = json_encode(array($processedPercent, $status));
file_put_contents($statusFile, $contents);
} */
}
-
if ($mode == self::MODE_PREVIEW || $mode == self::MODE_IMPORT) {
$customHeaders = $mapper;
* @param array mapped array of values
*
* @return void
- * @access public
*/
- function setActiveFields($fieldKeys) {
+ public function setActiveFields($fieldKeys) {
$this->_activeFieldCount = count($fieldKeys);
foreach ($fieldKeys as $key) {
if (empty($this->_fields[$key])) {
/**
* @param $elements
*/
- function setActiveFieldLocationTypes($elements) {
+ public function setActiveFieldLocationTypes($elements) {
for ($i = 0; $i < count($elements); $i++) {
$this->_activeFields[$i]->_hasLocationType = $elements[$i];
}
/**
* @param $elements
*/
- function setActiveFieldPhoneTypes($elements) {
+ public function setActiveFieldPhoneTypes($elements) {
for ($i = 0; $i < count($elements); $i++) {
$this->_activeFields[$i]->_phoneType = $elements[$i];
}
/**
* @param $elements
*/
- function setActiveFieldWebsiteTypes($elements) {
+ public function setActiveFieldWebsiteTypes($elements) {
for ($i = 0; $i < count($elements); $i++) {
$this->_activeFields[$i]->_websiteType = $elements[$i];
}
}
/**
- * Function to set IM Service Provider type fields
+ * Set IM Service Provider type fields
*
- * @param array $elements IM service provider type ids
+ * @param array $elements
+ * IM service provider type ids.
*
* @return void
- * @access public
*/
- function setActiveFieldImProviders($elements) {
+ public function setActiveFieldImProviders($elements) {
for ($i = 0; $i < count($elements); $i++) {
$this->_activeFields[$i]->_imProvider = $elements[$i];
}
/**
* @param $elements
*/
- function setActiveFieldRelated($elements) {
+ public function setActiveFieldRelated($elements) {
for ($i = 0; $i < count($elements); $i++) {
$this->_activeFields[$i]->_related = $elements[$i];
}
/**
* @param $elements
*/
- function setActiveFieldRelatedContactType($elements) {
+ public function setActiveFieldRelatedContactType($elements) {
for ($i = 0; $i < count($elements); $i++) {
$this->_activeFields[$i]->_relatedContactType = $elements[$i];
}
/**
* @param $elements
*/
- function setActiveFieldRelatedContactDetails($elements) {
+ public function setActiveFieldRelatedContactDetails($elements) {
for ($i = 0; $i < count($elements); $i++) {
$this->_activeFields[$i]->_relatedContactDetails = $elements[$i];
}
/**
* @param $elements
*/
- function setActiveFieldRelatedContactLocType($elements) {
+ public function setActiveFieldRelatedContactLocType($elements) {
for ($i = 0; $i < count($elements); $i++) {
$this->_activeFields[$i]->_relatedContactLocType = $elements[$i];
}
/**
* @param $elements
*/
- function setActiveFieldRelatedContactPhoneType($elements) {
+ public function setActiveFieldRelatedContactPhoneType($elements) {
for ($i = 0; $i < count($elements); $i++) {
$this->_activeFields[$i]->_relatedContactPhoneType = $elements[$i];
}
/**
* @param $elements
*/
- function setActiveFieldRelatedContactWebsiteType($elements) {
+ public function setActiveFieldRelatedContactWebsiteType($elements) {
for ($i = 0; $i < count($elements); $i++) {
$this->_activeFields[$i]->_relatedContactWebsiteType = $elements[$i];
}
}
/**
- * Function to set IM Service Provider type fields for related contacts
+ * Set IM Service Provider type fields for related contacts
*
- * @param array $elements IM service provider type ids of related contact
+ * @param array $elements
+ * IM service provider type ids of related contact.
*
* @return void
- * @access public
*/
- function setActiveFieldRelatedContactImProvider($elements) {
+ public function setActiveFieldRelatedContactImProvider($elements) {
for ($i = 0; $i < count($elements); $i++) {
$this->_activeFields[$i]->_relatedContactImProvider = $elements[$i];
}
}
/**
- * function to format the field values for input to the api
+ * Format the field values for input to the api
*
* @return array (reference ) associative array of name/value pairs
- * @access public
*/
- function &getActiveFieldParams() {
+ public function &getActiveFieldParams() {
$params = array();
- //CRM_Core_Error::debug( 'Count', $this->_activeFieldCount );
for ($i = 0; $i < $this->_activeFieldCount; $i++) {
if ($this->_activeFields[$i]->_name == 'do_not_import') {
continue;
/**
* @return array
*/
- function getColumnPatterns() {
+ public function getColumnPatterns() {
$values = array();
foreach ($this->_fields as $name => $field) {
$values[$name] = $field->_columnPattern;
}
/**
- * @param $name
+ * @param string $name
* @param $title
* @param int $type
* @param string $headerPattern
* @param int $mode
*
* @return void
- * @access public
*/
- function set($store, $mode = self::MODE_SUMMARY) {
+ public function set($store, $mode = self::MODE_SUMMARY) {
$store->set('rowCount', $this->_rowCount);
$store->set('fields', $this->getSelectValues());
$store->set('fieldTypes', $this->getSelectTypes());
/**
* Export data to a CSV file
*
- * @param $fileName
+ * @param string $fileName
* @param array $header
- * @param data $data
+ * @param array $data
*
- * @internal param string $filename
* @return void
- * @access public
*/
- static function exportCSV($fileName, $header, $data) {
+ public static function exportCSV($fileName, $header, $data) {
if (file_exists($fileName) && !is_writable($fileName)) {
CRM_Core_Error::movedSiteError($fileName);
* @param array $params
*
* @return void
- * @access public
*/
public function updateImportRecord($id, &$params) {
$statusFieldName = $this->_statusFieldName;
}
}
-