getOptions( 'columns' ); $retval = Misc::trimSortPrefix( $retval ); Debug::Arr( $retval, 'ImportDepartmentColumns: ', __FILE__, __LINE__, __METHOD__, 10 ); break; case 'import_options': $retval = [ '-1010-fuzzy_match' => TTi18n::getText( 'Enable smart matching.' ), ]; break; case 'parse_hint': $upf = TTnew( 'UserPreferenceFactory' ); /** @var UserPreferenceFactory $upf */ $retval = []; $retval = $upf->getCustomFieldsParseHints( $retval, null, 'department' ); break; } return $retval; } /** * @param $row_number * @param $raw_row * @return mixed */ function _preParseRow( $row_number, $raw_row ) { $retval = $this->getObject()->stripReturnHandler( $this->getObject()->getDepartmentDefaultData() ); $retval['manual_id'] += $row_number; //Auto increment manual_id automatically. return $retval; } /** * @param int $validate_only EPOCH * @return mixed */ function _import( $validate_only ) { return $this->getObject()->setDepartment( $this->getParsedData(), $validate_only ); } // // Generic parser functions. // /** * @param $input * @param null $default_value * @param null $parse_hint * @return int */ function parse_status( $input, $default_value = null, $parse_hint = null ) { if ( strtolower( $input ) == 'e' || strtolower( $input ) == 'enabled' ) { $retval = 10; } else if ( strtolower( $input ) == 'd' || strtolower( $input ) == 'disabled' ) { $retval = 20; } else { $retval = (int)$input; } return $retval; } } ?>