I am trying to allow a user to from a pre-existing list of activities and am using set_relation_n_n. Here is the screen that is generated. Here is the code that does it:
public function activity_management()
{
$crud = new grocery_CRUD();
$crud->set_theme('datatables');
$crud->set_table('activity');//$crud->or_where_in('email',base64_decode( urldecode( $this->session->userdata('userid'))) ,$this->session->userdata('userid'),'N/A' );
$crud->set_subject('a new activity');
$crud->change_field_type('email','invisible');
$crud->change_field_type('campaign','invisible');
$crud->where('email', $this->session->userdata('userid') );
// $crud->or_where('email',$this->session->userdata('userid'));
$crud->or_where ('email','NA');
$crud->where('campaign', $this->session->userdata('campaign') ); //ANDed with email
// $email_encrypt=base64_decode( urldecode( $this->session->userdata('userid') ));
$email_unencrypt=$this->session->userdata('userid');
$email_na="NA";
$where_clause="email in ('$email_unencrypt','NA')";
$crud->set_relation_n_n('activities', 'relation', 'standard_activities', 'activity_id', 'standard_id', 'activity','priority',$where_clause);
$crud->unset_edit_fields('activity_id','email');
$crud->unset_columns('campaign','activity_id','email');
$crud->change_field_type('email','invisible');
$crud->change_field_type('activity_id','invisible');
// $crud->fields('activity_id');
$crud->callback_before_insert(array($this,'add_email'));
$output = $crud->render();
$this->_configure_output($output);
The problem is that I want to add the items selected to activity_text. I can't seem to post the data structure.
Any idea why the activity_text field is not being populated with the "items selected"?