added edit and delete for result rows in advanced search

This commit is contained in:
Cornelius Weiß 2005-11-09 19:15:22 +00:00
parent b67562d721
commit 7116559eed
5 changed files with 35 additions and 17 deletions

View File

@ -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');

View File

@ -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 "<html><body><script>$js</script></body></html>\n";
echo "<html><body><script>var referer = opener.location;opener.location.href = referer;window.close();</script></body></html>\n";
$GLOBALS['egw']->common->egw_exit();
}
elseif (isset($content['button']['apply']))
{
$content = $this->save($content);
$GLOBALS['egw_info']['flags']['java_script'] .= "<script LANGUAGE=\"JavaScript\">opener.location.href='".
$GLOBALS['egw']->link('/index.php',array('menuaction' => 'addressbook.uiaddressbook.index'))."';</script>";
$GLOBALS['egw_info']['flags']['java_script'] .= "<script LANGUAGE=\"JavaScript\">
var referer = opener.location;
opener.location.href = referer;</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 "<html><body><script>$js</script></body></html>\n";
$GLOBALS['egw']->common->egw_exit();
echo "<html><body><script>var referer = opener.location;opener.location.href = referer;window.close();</script></body></html>\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(

View File

@ -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')

View File

@ -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

View File

@ -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