new CRM view, not yet completly finished but usable

This commit is contained in:
Ralf Becker 2014-03-06 18:39:52 +00:00
parent ee50a6b9bb
commit b5c5f3e28a
6 changed files with 127 additions and 5 deletions

View File

@ -28,6 +28,18 @@ class addressbook_hooks
if ($location == 'sidebox_menu')
{
if ($_GET['menuaction'] == 'addressbook.addressbook_ui.view')
{
display_sidebox($appname, lang('Contact data'), array(
array(
'text' => '<div id="addressbook_view_sidebox"/>',
'no_lang' => true,
'link' => false,
'icon' => false,
),
'menuOpened' => true, // display it open by default
));
}
// Magic etemplate2 favorites menu (from nextmatch widget)
display_sidebox($appname, lang('Favorites'), egw_framework::favorite_list('addressbook'));

View File

@ -59,6 +59,13 @@ class addressbook_ui extends addressbook_bo
'cat_id'
);
/**
* Instance of eTemplate class
*
* @var etemplate_new
*/
protected $tmpl;
/**
* Constructor
*
@ -2199,12 +2206,13 @@ window.egw_LAB.wait(function() {
{
$content['no_tid'] = true;
}
if (!$this->tmpl->read($this->content_types[$content['tid']]['options']['template'] ? $this->content_types[$content['tid']]['options']['template'] : 'addressbook.edit'))
$this->tmpl->read('addressbook.view');
/*if (!$this->tmpl->read($this->content_types[$content['tid']]['options']['template'] ? $this->content_types[$content['tid']]['options']['template'] : 'addressbook.edit'))
{
$content['msg'] = lang('WARNING: Template "%1" not found, using default template instead.', $this->content_types[$content['tid']]['options']['template'])."\n";
$content['msg'] .= lang('Please update the templatename in your customfields section!');
$this->tmpl->read('addressbook.edit');
}
}*/
if ($this->private_addressbook && $content['private'] && $content['owner'] == $this->user)
{
$content['owner'] .= 'p';
@ -2241,6 +2249,30 @@ window.egw_LAB.wait(function() {
// load app.css for addressbook explicit, as addressbook_view hooks changes currentapp!
egw_framework::includeCSS('addressbook', 'app');
$this->tmpl->setElementAttribute('toolbar', 'actions', array(
'edit' => array(
'caption' => 'Edit',
'toolbarDefault' => true,
),
'copy' => 'Copy',
'delete' => array(
'caption' => 'Delete',
'confirm' => 'Delete this entry',
),
'cancel' => array(
'caption' => 'Cancel',
'toolbarDefault' => true,
),
'back' => array(
'caption' => 'Back',
'toolbarDefault' => true,
),
'next' => array(
'caption' => 'Next',
'toolbarDefault' => true,
),
));
$this->tmpl->exec('addressbook.addressbook_ui.view',$content,$sel_options,$readonlys,array('id' => $content['id']));
$GLOBALS['egw']->hooks->process(array(

View File

@ -117,6 +117,7 @@ configuration common de Konfiguration
contact common de Kontakt
contact application admin de Kontakt Anwendung
contact copied addressbook de Kontakt kopiert
contact data addressbook de Kontaktdaten
contact deleted addressbook de Kontakt gelöscht
contact fields to show addressbook de Kontaktfelder die angezeigt werden sollen
contact fields: addressbook de Kontaktfelder:

View File

@ -117,6 +117,7 @@ configuration common en Configuration
contact common en Contact
contact application admin en Contact application
contact copied addressbook en Contact copied.
contact data addressbook en Contact data
contact deleted addressbook en Contact deleted.
contact fields to show addressbook en Contact fields to show
contact fields: addressbook en Contact fields:

View File

@ -1,8 +1,28 @@
/**
* Give space to both contact view & infolog list
* CRM view with contact data in sidebox
*/
#addressbook-index {height: 100%}
.et2_container[id^="infolog-index-addressbook"] {min-height: 250px}
.addressbook_sidebox_name {
font-weight: bold;
}
.addressbook_sidebox_name, .addressbook_sidebox_org {
font-size: 130%;
padding: 2px 0 2px 0;
}
td.addressbook_sidebox_header {
font-weight: bold;
height: 20px;
vertical-align: bottom;
}
div#addressbook-view.et2_container {
height: 0;
}
td.addressbook_sidebox_toolbar {
vertical-align: bottom;
height: 32px;
}
div#divGenTime_addressbook {
display: none;
}
/**
* new addressbook.edit

View File

@ -0,0 +1,56 @@
<?xml version="1.0"?>
<!-- $Id$ -->
<overlay>
<template id="addressbook.view" template="" lang="" group="0" version="1.9.001">
<grid class="addressbook_view" parent_node="addressbook_view_sidebox" width="100%">
<columns>
<column width="80"/>
<column/>
</columns>
<rows>
<row>
<image src="photo" class="photo"/>
<vbox>
<description id="n_fn" class="addressbook_sidebox_name"/>
<description id="org_name" class="addressbook_sidebox_org"/>
<description id="org_unit"/>
<description id="adr_one_locality"/>
</vbox>
</row>
<row>
<description span="2" value="Phone numbers" class="addressbook_sidebox_header"/>
</row>
<row>
<description for="tel_work" value="Business"/>
<url-phone id="tel_work" readonly="true"/>
</row>
<row>
<description for="tel_cell" value="Mobile phone"/>
<url-phone id="tel_cell" readonly="true"/>
</row>
<row>
<description for="tel_home" value="Private"/>
<url-phone id="tel_home" readonly="true"/>
</row>
<row>
<description for="tel_fax" value="Fax"/>
<url-phone id="tel_fax" readonly="true"/>
</row>
<row>
<description span="2" value="EMail &amp; Internet" class="addressbook_sidebox_header"/>
</row>
<row>
<description for="email" value="EMail"/>
<url-email id="email" readonly="true"/>
</row>
<row>
<description for="url" value="URL"/>
<url id="url" readonly="true"/>
</row>
<row>
<toolbar class="addressbook_sidebox_toolbar" id="toolbar" span="2" view_range="1" default_execute="app.addressbook.view_actions"/>
</row>
</rows>
</grid>
</template>
</overlay>