⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Show Output Error Callbacks



Lucas
  • profile picture
  • Member

Posted 22 April 2012 - 23:30 PM

Can not show the error ? anybody can help me ?


//Funcion que hace los CRUD de participantes por actividad
function proyectos_recursos_actividad_crud() {
$crud = new grocery_CRUD();
if ($this->input->post('actividad') != null) {
$this->session->set_userdata('proyecto', $this->input->post('proyecto'));
$this->session->set_userdata('etapa', $this->input->post('etapa'));
$this->session->set_userdata('actividad', $this->input->post('actividad'));
}
$crud->set_table('fs_recurso_fisico_actividad');
$crud->set_theme('flexigrid');
$crud->set_subject('Recurso Fisico por Actividad');
$crud->unset_columns('id', 'fs_actividad_id');
$crud->where('fs_actividad_id', $this->session->userdata('actividad'));
$crud->required_fields('fs_recurso_fisico_id', 'recurso_fisico_actividad_fecha_inicio', 'recurso_fisico_actividad_fecha_fin');
$crud->set_relation('fs_recurso_fisico_id', 'fs_recurso_fisico', '{recurso_fisico_nombre} - {recurso_fisico_tipo}');
$crud->change_field_type('fs_actividad_id', 'hidden', $this->session->userdata('actividad'));
$crud->callback_before_insert(array($this, 'recurso_check'));
$crud->display_as('fs_recurso_fisico_id', 'Recurso - Tipo');
$output = $crud->render();
$this->_example_output($output);
}
// Funcion que verifica un participante no este mas de una vez inscrito or actividad
public function recurso_check($str) {
if ($this->proyecto_model->recursoXactividad($str['fs_recurso_fisico_id'], $str['fs_actividad_id']) == true) {
$this->form_validation->set_message('recurso_check', 'El Recurso ya se encuentra registrado en la Actividad');
return FALSE;
} else {
return TRUE;
}
}

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 22 April 2012 - 23:37 PM

You are not doing it right you have to do it with the set_rules and a callback you can see an example at: /topic/71-solved-set-rules-is-unique-doesnt-work/page__view__findpost__p__262

Lucas
  • profile picture
  • Member

Posted 24 April 2012 - 02:30 AM

[color=#333333][font=arial, sans-serif][size=6]thank you very much[/size][/font][/color]