correctly disable change_org, if no organisation set

This commit is contained in:
Ralf Becker 2012-05-15 16:55:12 +00:00
parent 7ff86a46a6
commit d4c1a288e4

View File

@ -1793,7 +1793,6 @@ class addressbook_ui extends addressbook_bo
$GLOBALS['egw']->js->set_onload('show_custom_country(document.getElementById("exec[adr_one_countrycode]"));'); $GLOBALS['egw']->js->set_onload('show_custom_country(document.getElementById("exec[adr_one_countrycode]"));');
$GLOBALS['egw']->js->set_onload('show_custom_country(document.getElementById("exec[adr_two_countrycode]"));'); $GLOBALS['egw']->js->set_onload('show_custom_country(document.getElementById("exec[adr_two_countrycode]"));');
$content['disable_change_org'] = $view || !$content['org_name'];
//_debug_array($content); //_debug_array($content);
$readonlys['button[delete]'] = !$content['owner'] || !$this->check_perms(EGW_ACL_DELETE,$content); $readonlys['button[delete]'] = !$content['owner'] || !$this->check_perms(EGW_ACL_DELETE,$content);
$readonlys['button[copy]'] = $readonlys['button[edit]'] = $readonlys['button[vcard]'] = true; $readonlys['button[copy]'] = $readonlys['button[edit]'] = $readonlys['button[vcard]'] = true;
@ -1824,6 +1823,7 @@ class addressbook_ui extends addressbook_bo
$this->account_repository == 'ldap' && $content['account_id']; $this->account_repository == 'ldap' && $content['account_id'];
$readonlys['button[delete]'] = !$content['id']; $readonlys['button[delete]'] = !$content['id'];
if ($this->config['private_cf_tab']) $content['no_private_cfs'] = 0; if ($this->config['private_cf_tab']) $content['no_private_cfs'] = 0;
$readonlys['change_org'] = empty($content['org_name']) || $view;
// for editing the own account (by a non-admin), enable only the fields allowed via the "own_account_acl" // for editing the own account (by a non-admin), enable only the fields allowed via the "own_account_acl"
if (!$content['owner'] && !$this->is_admin($content)) if (!$content['owner'] && !$this->is_admin($content))
@ -2202,9 +2202,9 @@ class addressbook_ui extends addressbook_bo
// setting hidebuttons for content will hide the 'normal' addressbook edit dialog buttons // setting hidebuttons for content will hide the 'normal' addressbook edit dialog buttons
$content['hidebuttons'] = true; $content['hidebuttons'] = true;
$content['no_tid'] = true; $content['no_tid'] = true;
$content['disable_change_org'] = true;
$this->tmpl->read('addressbook.search'); $this->tmpl->read('addressbook.search');
$this->tmpl->set_cell_attribute('change_org','disabled',true);
return $this->tmpl->exec('addressbook.addressbook_ui.search',$content,$sel_options,$readonlys,array( return $this->tmpl->exec('addressbook.addressbook_ui.search',$content,$sel_options,$readonlys,array(
'do_email' => $do_email, 'do_email' => $do_email,
),2); ),2);