mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-25 09:23:28 +01:00
InfoLog view for organisations or multiple contacts
This commit is contained in:
parent
c02a67c9af
commit
3ae17a35cf
@ -243,7 +243,7 @@ class bocontacts extends socontacts
|
||||
$contact['n_fn'],$contact['org_name'],$contact['org_unit'],$contact['adr_one_locality']),$type);
|
||||
|
||||
// removing empty delimiters, caused by empty contact fields
|
||||
$fileas = str_replace(array(', : ',': , ',', , ',': : '),array(': ',': ',', ',': '),$fileas);
|
||||
$fileas = str_replace(array(', , : ',', : ',': , ',', , ',': : '),array(': ',': ',': ',', ',': '),$fileas);
|
||||
while ($fileas{0} == ':' || $fileas{0} == ',') $fileas = substr($fileas,2);
|
||||
while (substr($fileas,-2) == ': ' || substr($fileas,-2) == ', ') $fileas = substr($fileas,0,-2);
|
||||
|
||||
|
@ -112,6 +112,11 @@ class uicontacts extends bocontacts
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($content['nm']['rows']['infolog'])
|
||||
{
|
||||
list($org) = each($content['nm']['rows']['infolog']);
|
||||
return $this->infolog_org_view($org);
|
||||
}
|
||||
if ($content['nm']['rows']['view']) // show all contacts of an organisation
|
||||
{
|
||||
list($org_view) = each($content['nm']['rows']['view']);
|
||||
@ -185,6 +190,10 @@ class uicontacts extends bocontacts
|
||||
// 'export' => lang('Export selection'),
|
||||
// ToDo: 'copy' => lang('Copy a contact and edit the copy'),
|
||||
);
|
||||
if ($GLOBALS['egw_info']['user']['apps']['infolog'])
|
||||
{
|
||||
$sel_options['action']['infolog'] = lang('View linked InfoLog entries');
|
||||
}
|
||||
if ($do_email)
|
||||
{
|
||||
$sel_options['action']['email'] = lang('Add %1',lang('business email'));
|
||||
@ -275,6 +284,40 @@ class uicontacts extends bocontacts
|
||||
return $this->index($content,$msg,true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the infologs of an whole organisation
|
||||
*
|
||||
* @param string $org
|
||||
*/
|
||||
function infolog_org_view($org)
|
||||
{
|
||||
$query = $GLOBALS['egw']->session->appsession('index','addressbook');
|
||||
$query['num_rows'] = -1; // all
|
||||
$query['org_view'] = $org;
|
||||
$this->get_rows($query,$checked,$readonlys,true); // true = only return the id's
|
||||
|
||||
if (count($checked) > 1) // use a nicely formatted org-name as title in infolog
|
||||
{
|
||||
$parts = array();
|
||||
foreach(explode('|||',$org) as $part)
|
||||
{
|
||||
list(,$part) = explode(':',$part,2);
|
||||
if ($part) $parts[] = $part;
|
||||
}
|
||||
$org = implode(', ',$parts);
|
||||
}
|
||||
else
|
||||
{
|
||||
$org = ''; // use infolog default of link-title
|
||||
}
|
||||
$GLOBALS['egw']->redirect_link('/index.php',array(
|
||||
'menuaction' => 'infolog.uiinfolog.index',
|
||||
'action' => 'addressbook',
|
||||
'action_id' => implode(',',$checked),
|
||||
'action_title' => $org,
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* apply an action to multiple contacts
|
||||
*
|
||||
@ -304,6 +347,10 @@ class uicontacts extends bocontacts
|
||||
{
|
||||
if (substr($id,0,9) == 'org_name:')
|
||||
{
|
||||
if (count($checked) == 1)
|
||||
{
|
||||
return $this->infolog_org_view($id); // uses the org-name, instead of 'selected contacts'
|
||||
}
|
||||
unset($checked[$n]);
|
||||
$query = $GLOBALS['egw']->session->appsession('index','addressbook');
|
||||
$query['num_rows'] = -1; // all
|
||||
@ -347,6 +394,15 @@ class uicontacts extends bocontacts
|
||||
// does not return!
|
||||
$Ok = false;
|
||||
break;
|
||||
|
||||
case 'infolog':
|
||||
$GLOBALS['egw']->redirect_link('/index.php',array(
|
||||
'menuaction' => 'infolog.uiinfolog.index',
|
||||
'action' => 'addressbook',
|
||||
'action_id' => implode(',',$checked),
|
||||
'action_title' => count($checked) > 1 ? lang('selected contacts') : '',
|
||||
));
|
||||
break;
|
||||
}
|
||||
foreach($checked as $id)
|
||||
{
|
||||
@ -428,7 +484,7 @@ class uicontacts extends bocontacts
|
||||
* @param array &$query
|
||||
* @param array &$rows returned rows/cups
|
||||
* @param array &$readonlys eg. to disable buttons based on acl
|
||||
* @param boolena $id_only=false if true only return (via $rows) an array of contact-ids, dont save state to session
|
||||
* @param boolean $id_only=false if true only return (via $rows) an array of contact-ids, dont save state to session
|
||||
* @return int total number of contacts matching the selection
|
||||
*/
|
||||
function get_rows(&$query,&$rows,&$readonlys,$id_only=false)
|
||||
@ -596,6 +652,7 @@ class uicontacts extends bocontacts
|
||||
$row['type_label'] = lang('Organisation');
|
||||
|
||||
$readonlys["delete[$row[id]]"] = $query['filter'] && !($this->grants[(int)$query['filter']] & EGW_ACL_DELETE);
|
||||
$readonlys["infolog[$row[id]]"] = !$GLOBALS['egw_info']['user']['apps']['infolog'];
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -934,9 +991,12 @@ class uicontacts extends bocontacts
|
||||
lang('Copied by %1, from record #%2.',$GLOBALS['egw']->common->display_fullname('',
|
||||
$GLOBALS['egw_info']['user']['account_firstname'],$GLOBALS['egw_info']['user']['account_lastname']),
|
||||
$content['id']));
|
||||
unset($content['id']);
|
||||
// create a new contact with the content of the old
|
||||
foreach(array('id','modified','modifier') as $key) unset($content[$key]);
|
||||
$content['owner'] = $this->prefs['add_default'];
|
||||
$content['creator'] = $this->user;
|
||||
$content['created'] = $this->now_su;
|
||||
$content['msg'] = lang('Contact copied');
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -945,7 +1005,7 @@ class uicontacts extends bocontacts
|
||||
}
|
||||
$content['disable_change_org'] = $view || !$content['org_name'];
|
||||
//_debug_array($content);
|
||||
$readonlys['button[delete]'] = !$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;
|
||||
|
||||
$sel_options['fileas_type'] = $this->fileas_options($content);
|
||||
@ -1109,7 +1169,7 @@ class uicontacts extends bocontacts
|
||||
);
|
||||
$readonlys['link_to'] = $readonlys['customfields'] = $readonlys['fileas_type'] = true;
|
||||
$readonlys['button[save]'] = $readonlys['button[apply]'] = $readonlys['change_photo'] = true;
|
||||
$readonlys['button[delete]'] = !$this->check_perms(EGW_ACL_DELETE,$content);
|
||||
$readonlys['button[delete]'] = !$content['owner'] || !$this->check_perms(EGW_ACL_DELETE,$content);
|
||||
$readonlys['button[edit]'] = !$this->check_perms(EGW_ACL_EDIT,$content);
|
||||
// ToDo: fix vCard export
|
||||
$readonlys['button[vcard]'] = true;
|
||||
|
File diff suppressed because one or more lines are too long
@ -68,6 +68,7 @@ company name addressbook de Firmenname
|
||||
configuration common de Konfiguration
|
||||
contact common de Kontakt
|
||||
contact application admin de Kontakt Anwendung
|
||||
contact copied addressbook de Kontakt kopiert
|
||||
contact deleted addressbook de Kontakt gelöscht
|
||||
contact id addressbook de Kontakt ID
|
||||
contact repository admin de Speicherort Kontakte
|
||||
@ -235,9 +236,11 @@ select phone number as prefered way of contact addressbook de Telefonnummer als
|
||||
select the type of conversion addressbook de Typ der Umwandlung auswählen
|
||||
select the type of conversion: addressbook de Typ der Umwandlung auswählen:
|
||||
select where you want to store / retrieve contacts admin de Auswählen wo Sie Adressen speichern wollen
|
||||
selected contacts addressbook de ausgewählte Kontakte
|
||||
show addressbook de Anzeigen
|
||||
show a column for %1 addressbook de Zeige eine %1 Spalte
|
||||
show birthday reminders on main screen addressbook de Geburtstagserinnerungen auf der Startseite anzeigen
|
||||
show infolog entries for this organisation addressbook de InfoLog Einträge dieser Organisation anzeigen
|
||||
show the contacts of this organisation addressbook de Kontakte dieser Organisation anzeigen
|
||||
size of popup (wxh, eg.400x300, if a popup should be used) admin de Größe des Popup (WxH, zB. 400x300, falls ein Popup verwendet werden soll)
|
||||
start admin de Starten
|
||||
@ -267,6 +270,7 @@ used for links and for the own sorting of the list addressbook de wird f
|
||||
vcard common de VCard
|
||||
vcards require a first name entry. addressbook de VCards benötigen einen Vornamen.
|
||||
vcards require a last name entry. addressbook de VCards benötigen einen Nachnamen.
|
||||
view linked infolog entries addressbook de Verknüpfte InfoLog Einträge anzeigen
|
||||
warning!! ldap is valid only if you are not using contacts for accounts storage! admin de WARNUNG!! LDAP darf nur verwendet werden, wenn sie die Benutzerkonten nicht im Adressbuch speichern!
|
||||
warning: all contacts found will be deleted! addressbook de WARNUNG: Alle gefundenen Kontakte werden gelöscht!
|
||||
what should links to the addressbook display in other applications. empty values will be left out. you need to log in anew, if you change this setting! addressbook de Was sollen Verknüpfungen zum Adressbuch in anderen Anwendungen anzeigen. Leere Werte werden ausgelassen. Sie müssen sich neu anmelden, wenn Sie hier eine Änderung vornehmen!
|
||||
|
@ -68,6 +68,7 @@ company name addressbook en company name
|
||||
configuration common en Configuration
|
||||
contact common en Contact
|
||||
contact application admin en Contact application
|
||||
contact copied addressbook en Contact copied
|
||||
contact deleted addressbook en Contact deleted
|
||||
contact id addressbook en Contact ID
|
||||
contact repository admin en Contact repository
|
||||
@ -235,9 +236,11 @@ select phone number as prefered way of contact addressbook en select phone numbe
|
||||
select the type of conversion addressbook en Select the type of conversion
|
||||
select the type of conversion: addressbook en Select the type of conversion:
|
||||
select where you want to store / retrieve contacts admin en Select where you want to store / retrieve contacts
|
||||
selected contacts addressbook en selected contacts
|
||||
show addressbook en Show
|
||||
show a column for %1 addressbook en Show a column for %1
|
||||
show birthday reminders on main screen addressbook en Show birthday reminders on main screen
|
||||
show infolog entries for this organisation addressbook en Show InfoLog entries for this organisation
|
||||
show the contacts of this organisation addressbook en Show the contacts of this organisation
|
||||
size of popup (wxh, eg.400x300, if a popup should be used) admin en Size of popup (WxH, eg.400x300, if a popup should be used)
|
||||
start admin en Start
|
||||
@ -267,6 +270,7 @@ used for links and for the own sorting of the list addressbook en used for links
|
||||
vcard common en VCard
|
||||
vcards require a first name entry. addressbook en VCards require a first name entry.
|
||||
vcards require a last name entry. addressbook en Vcards require a last name entry.
|
||||
view linked infolog entries addressbook en View linked InfoLog entries
|
||||
warning!! ldap is valid only if you are not using contacts for accounts storage! admin en WARNING!! LDAP is valid only if you are NOT using contacts for accounts storage!
|
||||
warning: all contacts found will be deleted! addressbook en WARNING: All contacts found will be deleted!
|
||||
what should links to the addressbook display in other applications. empty values will be left out. you need to log in anew, if you change this setting! addressbook en What should links to the addressbook display in other applications. Empty values will be left out. You need to log in anew, if you change this setting!
|
||||
|
BIN
addressbook/templates/default/images/infolog.png
Normal file
BIN
addressbook/templates/default/images/infolog.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
72
addressbook/templates/default/index.org_rows.xet
Normal file
72
addressbook/templates/default/index.org_rows.xet
Normal file
@ -0,0 +1,72 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- $Id$ -->
|
||||
<overlay>
|
||||
<template id="addressbook.index.org_rows" template="" lang="" group="0" version="1.3.002">
|
||||
<grid width="100%">
|
||||
<columns>
|
||||
<column/>
|
||||
<column/>
|
||||
<column/>
|
||||
<column/>
|
||||
<column/>
|
||||
<column disabled="@no_customfields"/>
|
||||
<column width="90"/>
|
||||
</columns>
|
||||
<rows>
|
||||
<row class="th">
|
||||
<description/>
|
||||
<description value="#" align="center"/>
|
||||
<nextmatch-sortheader id="org_name" label="Organisation"/>
|
||||
<description value="department"/>
|
||||
<description value="Business address"/>
|
||||
<grid spacing="0" padding="0">
|
||||
<columns>
|
||||
<column/>
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<description no_lang="1" id="customfields[$row][label]"/>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
<hbox align="center" class="noPrint">
|
||||
<description value="Actions" align="center"/>
|
||||
<button image="check" label="Check all" id="check_all" statustext="Check all" onclick="toggle_all(this.form,form::name('checked[]')); return false;" needed="1" align="right"/>
|
||||
</hbox>
|
||||
</row>
|
||||
<row class="row" valign="top">
|
||||
<image label="$row_cont[type_label]" src="${row}[type]" align="center" no_lang="1"/>
|
||||
<int id="${row}[org_count]" readonly="true" align="center"/>
|
||||
<description id="${row}[org_name]" no_lang="1"/>
|
||||
<description id="${row}[org_unit]" no_lang="1"/>
|
||||
<vbox options="0,0">
|
||||
<description id="${row}[adr_one_countryname]" no_lang="1"/>
|
||||
<hbox options="0,0" orient="0">
|
||||
<description no_lang="1" id="${row}[adr_one_locality]"/>
|
||||
<description id="${row}[adr_one_postalcode]" class="leftPad5" value=" " no_lang="1"/>
|
||||
</hbox>
|
||||
<description no_lang="1" id="${row}[adr_one_street]"/>
|
||||
<description id="${row}[adr_one_street2]" no_lang="1"/>
|
||||
</vbox>
|
||||
<grid height="60" spacing="0" padding="0" overflow="auto">
|
||||
<columns>
|
||||
<column/>
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<description class="fixedHeight" id="$row" no_lang="1"/>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
<hbox options="0" class="noPrint" orient="0">
|
||||
<button image="view" label="View" id="view[$row_cont[id]]" statustext="Show the contacts of this organisation"/>
|
||||
<button image="new" label="Add" onclick="window.open(egw::link('/index.php','menuaction=addressbook.uicontacts.edit&org=$row_cont[id]'),'_blank','dependent=yes,width=850,height=440,scrollbars=yes,status=yes'); return false;" id="add[$row_cont[id]]" statustext="Add a contact to this organisation"/>
|
||||
<button id="delete[$row_cont[id]]" image="delete" label="Delete" statustext="Delete this organisation including ALL its contacts" onclick="return confirm('Delete this organisation including ALL its contacts');"/>
|
||||
<button image="infolog" label="InfoLog" id="infolog[$row_cont[id]]" statustext="Show InfoLog entries for this organisation"/>
|
||||
<checkbox id="checked[]" options="$row_cont[id]" statustext="Select multiple contacts for a further action" align="right"/>
|
||||
</hbox>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
</template>
|
||||
</overlay>
|
Loading…
Reference in New Issue
Block a user