Fixes on org view:

- Fix or disable broken actions on orgs
- Fix going from viewing the organisations of one contact does not clear all filters
This commit is contained in:
Nathan Gray 2015-03-11 23:15:50 +00:00
parent 6e98e917b6
commit 4f0b1397ea

View File

@ -570,6 +570,8 @@ class addressbook_ui extends addressbook_bo
'icon' => 'infolog/navbar', 'icon' => 'infolog/navbar',
'onExecute' => 'javaScript:app.addressbook.view_infolog', 'onExecute' => 'javaScript:app.addressbook.view_infolog',
'allowOnMultiple' => true, 'allowOnMultiple' => true,
'disableClass' => 'contact_organisation',
'hideOnDisabled' => true,
), ),
'infolog_add' => array( 'infolog_add' => array(
'caption' => 'Add a new Infolog', 'caption' => 'Add a new Infolog',
@ -592,7 +594,9 @@ class addressbook_ui extends addressbook_bo
'caption' => 'Show', 'caption' => 'Show',
'icon' => 'view', 'icon' => 'view',
'url' => 'menuaction=calendar.calendar_uilist.listview&filter=all&owner=0,c$id&ajax=true', 'url' => 'menuaction=calendar.calendar_uilist.listview&filter=all&owner=0,c$id&ajax=true',
'targetapp' => 'calendar', // open in calendar tab 'targetapp' => 'calendar', // open in calendar tab,
'disableClass' => 'contact_organisation',
'hideOnDisabled' => true,
), ),
'calendar_add' => array( 'calendar_add' => array(
'caption' => 'Add appointment', 'caption' => 'Add appointment',
@ -608,6 +612,8 @@ class addressbook_ui extends addressbook_bo
$actions['email'] = array( $actions['email'] = array(
'caption' => 'Email', 'caption' => 'Email',
'icon' => 'mail/navbar', 'icon' => 'mail/navbar',
'disableClass' => 'contact_organisation',
'hideOnDisabled' => true,
'group' => $group, 'group' => $group,
'children' => array( 'children' => array(
'add_to_to' => array( 'add_to_to' => array(
@ -659,7 +665,7 @@ class addressbook_ui extends addressbook_bo
'allowOnMultiple' => false, 'allowOnMultiple' => false,
'group' => $group, 'group' => $group,
// disable for for org-views, as it needs contact-ids // disable for for org-views, as it needs contact-ids
'enabled' => !isset($this->org_views[(string) $org_view]), 'disableClass' => 'contact_organisation',
); );
} }
// check if user is an admin or the export is not generally turned off (contact_export_limit is non-numerical, eg. no) // check if user is an admin or the export is not generally turned off (contact_export_limit is non-numerical, eg. no)
@ -697,6 +703,8 @@ class addressbook_ui extends addressbook_bo
'icon' => 'filemanager/mail_post_to', 'icon' => 'filemanager/mail_post_to',
'group' => $group, 'group' => $group,
'onExecute' => 'javaScript:app.addressbook.adb_mail_vcard', 'onExecute' => 'javaScript:app.addressbook.adb_mail_vcard',
'disableClass' => 'contact_organisation',
'hideOnDisabled' => true,
); );
} }
++$group; ++$group;
@ -1067,24 +1075,20 @@ window.egw_LAB.wait(function() {
return false; return false;
case 'infolog_add': case 'infolog_add':
list($width,$height) = explode('x',egw_link::get_registry('infolog', 'add_popup')); egw_framework::popup(egw::link('/index.php',array(
egw_framework::set_onload(
"egw_openWindowCentered2('".egw::link('/index.php',array(
'menuaction' => 'infolog.infolog_ui.edit', 'menuaction' => 'infolog.infolog_ui.edit',
'type' => 'task', 'type' => 'task',
'action' => 'addressbook', 'action' => 'addressbook',
'action_id' => implode(',',$checked), 'action_id' => implode(',',$checked),
))."','_blank',$width,$height);"); )),'_blank',egw_link::get_registry('infolog', 'add_popup'));
$msg = ''; // no message, as we send none in javascript too and users sees opening popup $msg = ''; // no message, as we send none in javascript too and users sees opening popup
return false; return false;
case 'calendar_add': // add appointment for org-views, other views are handled directly in javascript case 'calendar_add': // add appointment for org-views, other views are handled directly in javascript
list($width,$height) = explode('x',egw_link::get_registry('calendar', 'add_popup')); egw_framework::popup(egw::link('/index.php',array(
egw_framework::set_onload(
"egw_openWindowCentered2('".egw::link('/index.php',array(
'menuaction' => 'calendar.calendar_uiforms.edit', 'menuaction' => 'calendar.calendar_uiforms.edit',
'participants' => 'c'.implode(',c',$checked), 'participants' => 'c'.implode(',c',$checked),
))."','_blank',$width,$height);"); )),'_blank',egw_link::get_registry('calendar', 'add_popup'));
$msg = ''; // no message, as we send none in javascript too and users sees opening popup $msg = ''; // no message, as we send none in javascript too and users sees opening popup
return false; return false;
@ -1299,7 +1303,7 @@ window.egw_LAB.wait(function() {
{ {
$old_state = egw_session::appsession($what,'addressbook'); $old_state = egw_session::appsession($what,'addressbook');
} }
if (!isset($this->org_views[(string) $query['org_view']])) // we dont have an org view, unset the according col_filters if (!isset($this->org_views[(string) $query['org_view']]) || strpos($query['org_view'],':') === false) // we dont have an org view, unset the according col_filters
{ {
if (isset($query['col_filter']['org_name'])) unset($query['col_filter']['org_name']); if (isset($query['col_filter']['org_name'])) unset($query['col_filter']['org_name']);
if (isset($query['col_filter']['adr_one_locality'])) unset($query['col_filter']['adr_one_locality']); if (isset($query['col_filter']['adr_one_locality'])) unset($query['col_filter']['adr_one_locality']);