Hi,
I need some serious help. I’ve a $_Request[] variable I want to put into appsession. But I cant pass it into preserve once user updates info.
I need to change certain preserve values when they update their profile after login.
How can I do that?
It seems to pick up the appsession variable once but after they save and move onto another screen to update the next set of profile information, the preserve value isnt changed to the new one.
The forms in question have two entry points. One is if it is a first time user entering data for the very first time. The second entry point is if they return back to their profile to update info. When they click update I popup brings them to the relevant forms. Thats why the code below has either raw data input OR $_Request dependant input
$this->tmpl =& CreateObject(‘etemplate.etemplate’,‘nysvolunteers.editlanguages’);
if (is_array($content)) // not first call from index
{
if ($content['ID'] > 0)
{
$this->read($content);
}
//echo "<p>edit: content ="; _debug_array($content);
$this->data_merge($content);
//echo "<p>edit: data ="; _debug_array($this->data);
if (isset($content['Save']))
{
//_debug_array($content);
$msg .= !$this->save() ? lang('Entry saved') : lang('Error: while saving !!!');
}
if (isset($content['Add']))
{
$this->init();
}
if (isset($content['Next']))
{
$this->init();
$GLOBALS['egw']->redirect_link('/index.php', 'menuaction=nysvolunteers.uinysvolunteersemployment.editemploymenthistory');
}
}
// now we filling the content array for the next call to etemplate.exec
$data = $GLOBALS['egw']->session->appsession('nationalid','nysvolunteers');
if(isset($_GET['NID'])) {
echo "I'm here NID";
$GLOBALS['egw']->session->appsession('nationalid','nysvolunteers',$_GET['NID']);
$data = $GLOBALS['egw']->session->appsession('nationalid','nysvolunteers');
//_debug_array($_GET['ID']);
}
if(isset($_GET['passID'])) {
echo "I'm here";
$GLOBALS['egw']->session->appsession('passID','nysvolunteers',$_GET['passID']);
$passID = $GLOBALS['egw']->session->appsession('passID','nysvolunteers');
//_debug_array($_GET['ID']);
$this->data['ID']= $passID;
}
$content = $this->data + array(
'msg' => $msg,
'NID'=>$data,
);
$sel_options = array(
'Proficiency_Level_reading' => $this->Proficiency_Level_reading,
'Proficiency_Level_written' => $this->Proficiency_Level_written,
'Proficiency_Level_spoken' => $this->Proficiency_Level_spoken,
'native' => $this->native,
);
$no_button = array( // no delete button if id == 0 --> entry not saved
'Next' => !$this->data[$this->db_key_cols[$this->autoinc_id]]
);
_debug_array($content);
_debug_array($this->data['ID']);
$this->tmpl->exec('nysvolunteers.uinysvolunteerslanguages.editlanguages',$content,$sel_options,$no_button,array(
'ID' => $this->data['ID'],
'NID'=>$data
));
Please help (hope that makes sense)