…
$form_name = etemplate::form_name($cname=‘exec’,‘ship_to_address’);
$request->to_process[$form_name][‘allowed’][] = $contact_id;
Thanks, Ralf. I think I’m getting closer with the above, but still
doesn’t like me.
I’ve included the function below, can you see if maybe something else
conflicts?
// Get the form name so we can add the options to the etemplate
$form_name = etemplate::form_name($cname=‘exec’, ‘ship_to_address’);
// Need the etemplate request
$request =& etemplate_request::read($et_request_id);
$query = array(
‘client_id’ => $client_id,
);
// Ship to addresses
$this->response->addScript(“removeOptions(’$form_name’)”);
$branches =
ExecMethod(‘perp_ar.bo_perp_client_branch.get_client_branch_list’,
$query);
$contacts = array();
foreach($branches as $branch_id => $branch_name) {
$contacts += ExecMethod2(‘phpgwapi.bolink.get_links’,
‘perp_ar’, ‘CLIENT-BRANCH:’ . $branch_id , ‘addressbook’);
}
$contacts += ExecMethod2(‘phpgwapi.bolink.get_links’, ‘perp_ar’,
‘CLIENT:’ .$client_id, ‘addressbook’);
$contacts = array_unique($contacts);
// Add addresses to selectbox
foreach($contacts as $id => &$contact) {
$name = egw_link::title(‘addressbook’, $contact);
$this->response->addScript(“addOption(’$form_name’,
’$contact’, '” . addslashes($name) . “’)”);
$request->to_process[$form_name][‘allowed’][] = $contact;
}
// If there’s only one branch, select it’s delivery address
$branch =
ExecMethod(‘perp_ar.bo_perp_client_branch.get_client_branch’,
$branch_id);
if($branch[‘delivery_address’] &&
in_array($branch[‘delivery_address’], $contacts)) {
$this->response->addAssign($form_name, ‘value’,
$branch[‘delivery_address’]);
} elseif(count($contacts) > 0) {
$this->response->addAssign($form_name, ‘value’,
current($contacts));
}
return $this->response->getXML();
Nathan Gray
nathan at goarctic dot com
Check out the new SourceForge.net Marketplace.
It’s the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers