english/administrator/components/com_aicontactsafe/controllers/profiles.php
// function to apply the contact information changes and open the edit window again
function to apply the contact information changes and open the edit window again
function to apply the contact information changes and open the edit window again
function apply_contact() {
		$model = &$this->getModel( $this->_sTaskModel, '', $this->_parameters );
		$isOK = $model->getFormFields();
		if ($isOK) {
			$isOK = $model->writeContactInformation();
		}
		$last_task = $this->_app->_session->get( 'last_task' );
		$last_id = JRequest::getVar( 'id', 0, 'post', 'int');
		$new_values = array();
		$new_values['task'] = 'edit_contact';
		$new_values['id'] = $last_id;
		$link = $model->getLastLink($new_values);
		if ($isOK) {
			$msg = $this->getConfirmationMessage();
			$msgType = 'message';
		} else {
			$msg = $this->_app->_session->get( 'errorMsg:' . $this->_sTask );
			$msgType = 'error';
		}
		$this->setRedirect($link, $msg, $msgType);
	}
function apply_contact ( ) { $ model = & $ this -> getModel ( $ this -> _sTaskModel , '' , $ this -> _parameters ) ; $ isOK = $ model -> getFormFields ( ) ; if ( $ isOK ) { $ isOK = $ model -> writeContactInformation ( ) ; } $ last_task = $ this -> _app -> _session -> get ( 'last_task' ) ; $ last_id = JRequest :: getVar ( 'id' , 0 , 'post' , 'int' ) ; $ new_values = array ( ) ; $ new_values [ 'task' ] = 'edit_contact' ; $ new_values [ 'id' ] = $ last_id ; $ link = $ model -> getLastLink ( $ new_values ) ; if ( $ isOK ) { $ msg = $ this -> getConfirmationMessage ( ) ; $ msgType = 'message' ; } else { $ msg = $ this -> _app -> _session -> get ( 'errorMsg:' . $ this -> _sTask ) ; $ msgType = 'error' ; } $ this -> setRedirect ( $ link , $ msg , $ msgType ) ; }
function to apply the contact information changes and open the edit window again
function to apply the contact information changes and open the edit window again
// read the last task values // set the new values of the link // get the link with the new values // redirect to the new link