diff --git a/addressbook/inc/class.bocontacts.inc.php b/addressbook/inc/class.bocontacts.inc.php index 74eb289472..1229bd61e6 100755 --- a/addressbook/inc/class.bocontacts.inc.php +++ b/addressbook/inc/class.bocontacts.inc.php @@ -57,7 +57,7 @@ class bocontacts extends socontacts /** * deletes contact in db * - * @param array &contact contact array from etemplate::exec + * @param mixed &contact contact array from etemplate::exec or id * @return bool false if all went right */ function delete(&$contact) @@ -81,11 +81,13 @@ class bocontacts extends socontacts } return $msg; } - if(isset($contact['id']) && !$this->check_perms(EGW_ACL_DELETE,$contact['id'])) + if((isset($contact['id']) && !$this->check_perms(EGW_ACL_DELETE,$contact['id'])) || + (is_numeric($contact) && !$this->check_perms(EGW_ACL_DELETE,$contact))) { $contact['msg'] = lang('You are not permittet to delete this contact'); return 1; } + if(is_numeric($contact)) $contact = array('id' => $contact); if(parent::delete($contact)) { $contact['msg'] = lang('Something went wrong by deleting this contact'); diff --git a/addressbook/inc/class.uicontacts.inc.php b/addressbook/inc/class.uicontacts.inc.php index 86ae11bbde..f7b1f37b3c 100644 --- a/addressbook/inc/class.uicontacts.inc.php +++ b/addressbook/inc/class.uicontacts.inc.php @@ -57,27 +57,22 @@ class uicontacts extends bocontacts if (isset($content['button']['save'])) { $this->save($content); - $js = "opener.location.href='".$GLOBALS['egw']->link('/index.php', - array('menuaction' => 'addressbook.uiaddressbook.index'))."';"; - $js .= 'window.close();'; - echo "
\n"; + echo "\n"; $GLOBALS['egw']->common->egw_exit(); } elseif (isset($content['button']['apply'])) { $content = $this->save($content); - $GLOBALS['egw_info']['flags']['java_script'] .= ""; + $GLOBALS['egw_info']['flags']['java_script'] .= ""; } elseif (isset($content['button']['delete'])) { if(!$this->delete($content)); { - $js = "opener.location.href='".$GLOBALS['egw']->link('/index.php', - array('menuaction' => 'addressbook.uiaddressbook.index'))."';"; - $js .= 'window.close();'; - echo "\n"; - $GLOBALS['egw']->common->egw_exit(); + echo "\n"; + $GLOBALS['egw']->common->egw_exit(); } } } @@ -115,6 +110,7 @@ class uicontacts extends bocontacts function search($content='') { + $GLOBALS['egw_info']['flags']['app_header'] = lang('Addressbook'). ' - '. lang('Advanced search'); if(!($GLOBALS['egw_info']['server']['contact_repository'] == 'sql' || !isset($GLOBALS['egw_info']['server']['contact_repository']))) { $GLOBALS['egw']->common->phpgw_header(); @@ -143,7 +139,25 @@ class uicontacts extends bocontacts 'email' => lang('work email'), 'tel_home' => lang('tel home'), ); - + + $content['advs']['row_actions'] = array( + 'edit' => array( + 'type' => 'button', + 'options' => array( + 'size' => 'edit', + 'onclick' => 'window.open(\''. + $GLOBALS['egw']->link('/index.php?menuaction=addressbook.uicontacts.edit'). + '&contact_id=$row_cont[id] \',\'\',\'dependent=yes,width=800,height=600,location=no,menubar=no,toolbar=no,scrollbars=yes,status=yes\'); + return false;', + )), + 'delete' => array( + 'type' => 'button', + 'method' => 'addressbook.bocontacts.delete', + 'options' => array( + 'size' => 'delete', + 'onclick' => 'if(!confirm(\''. lang('Do your really want to delete this contact?'). '\')) return false;', + )), + ); /* $content['advs']['actions']['email'] = array( 'type' => 'button', 'options' => array( diff --git a/addressbook/inc/hook_sidebox_menu.inc.php b/addressbook/inc/hook_sidebox_menu.inc.php index 1026e337fb..c1cbd32f9a 100644 --- a/addressbook/inc/hook_sidebox_menu.inc.php +++ b/addressbook/inc/hook_sidebox_menu.inc.php @@ -34,7 +34,7 @@ 'link' => false ), // 'Add'=>$GLOBALS['egw']->link('/index.php','menuaction=addressbook.uiaddressbook.add'), - 'Advances search'=>$GLOBALS['egw']->link('/index.php','menuaction=addressbook.uicontacts.search'), + 'Advanced search'=>$GLOBALS['egw']->link('/index.php','menuaction=addressbook.uicontacts.search'), '_NewLine_', // give a newline 'import contacts' => $GLOBALS['egw']->link('/index.php','menuaction=addressbook.uiXport.import'), 'export contacts' => $GLOBALS['egw']->link('/index.php','menuaction=addressbook.uiXport.export') diff --git a/addressbook/setup/phpgw_de.lang b/addressbook/setup/phpgw_de.lang index b0f1828c58..1981c91ed5 100644 --- a/addressbook/setup/phpgw_de.lang +++ b/addressbook/setup/phpgw_de.lang @@ -16,7 +16,7 @@ addressbook common de Adressbuch addressbook preferences addressbook de Adressbuch Einstellungen addressbook-fieldname addressbook de Adressbuch Feldname addvcard addressbook de VCard hinzufügen -advances search addressbook de Erweiterte Suche +advanced search addressbook de Erweiterte Suche alt. csv import addressbook de Alt. CSV Import are you sure you want to delete this field? addressbook de Sind Sie sicher, dass Sie dieses Feld löschen wollen? bbs phone addressbook de BBS @@ -55,6 +55,7 @@ debug output in browser addressbook de Debugausgaben in Browser default filter addressbook de Standardfilter delete a single entry by passing the id. addressbook de Löscht einen einzelnen Eintrag durch Übergabe seiner ID. department common de Abteilung +do your really want to delete this contact? addressbook de Wollen sie diesen Kontakt wirklich löschen? doesn't matter addressbook de egal domestic addressbook de Wohnung download addressbook de Herunterladen diff --git a/addressbook/setup/phpgw_en.lang b/addressbook/setup/phpgw_en.lang index f90652b87f..e2ac3ed299 100644 --- a/addressbook/setup/phpgw_en.lang +++ b/addressbook/setup/phpgw_en.lang @@ -16,7 +16,7 @@ addressbook common en Addressbook addressbook preferences addressbook en Addressbook preferences addressbook-fieldname addressbook en Addressbook-Fieldname addvcard addressbook en Add VCard -advances search addressbook en Advances search +advanced search addressbook en Advanced search alt. csv import addressbook en Alt. CSV Import are you sure you want to delete this field? addressbook en Are you sure you want to delete this field? bbs phone addressbook en BBS Phone @@ -55,6 +55,7 @@ debug output in browser addressbook en Debug output in browser default filter addressbook en Default Filter delete a single entry by passing the id. addressbook en Delete a single entry by passing the id. department common en Department +do your really want to delete this contact? addressbook en Do your really want to delete this contact? doesn't matter addressbook en doesn't matter domestic addressbook en Domestic download addressbook en Download