- fixed not displayed links on new entries

- removed all tab-indexes, as the default order is inutitive (with the one-column layout we us now)
- added missing copied by note (as link now and no longer a note)
This commit is contained in:
Ralf Becker 2005-11-23 17:07:33 +00:00
parent b111419c1b
commit 4adc7504f1
3 changed files with 55 additions and 36 deletions

View File

@ -60,6 +60,14 @@ class uicontacts extends bocontacts
*/ */
function edit($content=null) function edit($content=null)
{ {
if (!is_object($this->link))
{
if (!is_object($GLOBALS['egw']->link))
{
$GLOBALS['egw']->link =& CreateObject('phpgwapi.bolink');
}
$this->link =& $GLOBALS['egw']->link;
}
if (is_array($content)) if (is_array($content))
{ {
list($button) = each($content['button']); list($button) = each($content['button']);
@ -76,14 +84,6 @@ class uicontacts extends bocontacts
// writing links for new entry, existing ones are handled by the widget itself // writing links for new entry, existing ones are handled by the widget itself
if ($links && $content['id']) if ($links && $content['id'])
{ {
if (!is_object($this->link))
{
if (!is_object($GLOBALS['egw']->link))
{
$GLOBALS['egw']->link =& CreateObject('phpgwapi.bolink');
}
$this->link =& $GLOBALS['egw']->link;
}
$this->link->link('addressbook',$content['id'],$links); $this->link->link('addressbook',$content['id'],$links);
} }
if ($button == 'save') if ($button == 'save')
@ -91,6 +91,7 @@ class uicontacts extends bocontacts
echo "<html><body><script>var referer = opener.location;opener.location.href = referer;window.close();</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(); $GLOBALS['egw']->common->egw_exit();
} }
$content['link_to']['to_id'] = $content['id'];
$GLOBALS['egw_info']['flags']['java_script'] .= "<script LANGUAGE=\"JavaScript\"> $GLOBALS['egw_info']['flags']['java_script'] .= "<script LANGUAGE=\"JavaScript\">
var referer = opener.location; var referer = opener.location;
opener.location.href = referer;</script>"; opener.location.href = referer;</script>";
@ -115,7 +116,19 @@ class uicontacts extends bocontacts
{ {
$content = $this->read($contact_id); $content = $this->read($contact_id);
} }
if($_GET['makecp']) unset($content['id']); if($content && $_GET['makecp']) // copy the contact
{
$content['link_to']['to_id'] = 0;
$this->link->link('addressbook',$content['link_to']['to_id'],'addressbook',$content['id'],
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']);
}
else
{
$content['link_to']['to_id'] = (int) $contact_id;
}
} }
//_debug_array($content); //_debug_array($content);
@ -136,9 +149,9 @@ class uicontacts extends bocontacts
$sel_options['tz'] = $tz; $sel_options['tz'] = $tz;
$content['tz'] = $content['tz'] ? $content['tz'] : 0; $content['tz'] = $content['tz'] ? $content['tz'] : 0;
$content['link'] = $content['link_to'] = array( $content['link_to'] = array(
'to_app' => 'addressbook', 'to_app' => 'addressbook',
'to_id' => (int) $content['id'], 'to_id' => $content['link_to']['to_id'],
); );
$this->tmpl->read('addressbook.edit'); $this->tmpl->read('addressbook.edit');
@ -186,11 +199,11 @@ class uicontacts extends bocontacts
} }
} }
$content['view'] = true; $content['view'] = true;
$content['link'] = $content['link_to'] = array( $content['link_to'] = array(
'to_app' => 'addressbook', 'to_app' => 'addressbook',
'to_id' => $content['id'], 'to_id' => $content['id'],
); );
$readonlys['link'] = $readonlys['link_to'] = $readonlys['customfields'] = true; $readonlys['link_to'] = $readonlys['customfields'] = true;
$readonlys['button[save]'] = $readonlys['button[apply]'] = true; $readonlys['button[save]'] = $readonlys['button[apply]'] = true;
$readonlys['button[delete]'] = !$this->check_perms(EGW_ACL_DELETE,$content); $readonlys['button[delete]'] = !$this->check_perms(EGW_ACL_DELETE,$content);
$readonlys['button[edit]'] = !$this->check_perms(EGW_ACL_EDIT,$content); $readonlys['button[edit]'] = !$this->check_perms(EGW_ACL_EDIT,$content);

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!-- $Id$ --> <!-- $Id$ -->
<overlay> <overlay>
<template id="addressbook.edit.personal" template="" lang="" group="0" version="1.0.1.001"> <template id="addressbook.edit.personal" template="" lang="" group="0" version="1.0.1.002">
<grid height="250"> <grid height="250">
<columns> <columns>
<column/> <column/>
@ -12,42 +12,42 @@
<row> <row>
<image src="personal"/> <image src="personal"/>
<description value="prefix"/> <description value="prefix"/>
<textbox id="n_prefix" size="45" maxlength="64" tabindex="1"/> <textbox id="n_prefix" size="45" maxlength="64"/>
</row> </row>
<row> <row>
<description/> <description/>
<description value="first name"/> <description value="first name"/>
<textbox id="n_given" size="45" maxlength="64" tabindex="2"/> <textbox id="n_given" size="45" maxlength="64"/>
</row> </row>
<row> <row>
<description/> <description/>
<description value="middle name"/> <description value="middle name"/>
<textbox id="n_middle" size="45" maxlength="64" tabindex="3"/> <textbox id="n_middle" size="45" maxlength="64"/>
</row> </row>
<row> <row>
<description/> <description/>
<description value="last name"/> <description value="last name"/>
<textbox id="n_family" size="45" maxlength="64" tabindex="4"/> <textbox id="n_family" size="45" maxlength="64"/>
</row> </row>
<row> <row>
<description/> <description/>
<description value="suffix"/> <description value="suffix"/>
<textbox id="n_suffix" size="45" maxlength="64" tabindex="5"/> <textbox id="n_suffix" size="45" maxlength="64"/>
</row> </row>
<row height="40"> <row height="40">
<image src="gohome"/> <image src="gohome"/>
<description value="company name" options=",,,org_name"/> <description value="company name" options=",,,org_name"/>
<textbox size="45" maxlength="64" id="org_name" tabindex="5"/> <textbox size="45" maxlength="64" id="org_name"/>
</row> </row>
<row valign="top"> <row valign="top">
<image src="folder"/> <image src="folder"/>
<description value="category"/> <description value="category"/>
<listbox type="select-cat" id="cat_id" rows="3" span="4" tabindex="6"/> <listbox type="select-cat" id="cat_id" rows="3" span="4"/>
</row> </row>
<row> <row>
<image src="password"/> <image src="password"/>
<description value="Private" options=",,,private"/> <description value="Private" options=",,,private"/>
<checkbox id="private" tabindex="7"/> <checkbox id="private"/>
</row> </row>
</rows> </rows>
</grid> </grid>
@ -204,7 +204,7 @@
</rows> </rows>
</grid> </grid>
</template> </template>
<template id="addressbook.edit.links" template="" lang="" group="0" version="1.0.1.001"> <template id="addressbook.edit.links" template="" lang="" group="0" version="1.0.1.002">
<grid width="100%" height="250" overflow="auto"> <grid width="100%" height="250" overflow="auto">
<columns> <columns>
<column/> <column/>
@ -220,7 +220,7 @@
<description value="Existing links"/> <description value="Existing links"/>
</row> </row>
<row> <row>
<link-list id="link"/> <link-list id="link_to"/>
</row> </row>
</rows> </rows>
</grid> </grid>
@ -314,7 +314,7 @@
</rows> </rows>
</grid> </grid>
</template> </template>
<template id="addressbook.edit" template="" lang="" group="0" version="1.0.1.001"> <template id="addressbook.edit" template="" lang="" group="0" version="1.0.1.002">
<grid> <grid>
<columns> <columns>
<column width="450"/> <column width="450"/>
@ -371,22 +371,22 @@
<row> <row>
<image src="kaddressbook"/> <image src="kaddressbook"/>
<description value="business" options=",,,tel_work"/> <description value="business" options=",,,tel_work"/>
<textbox id="tel_work" size="28" maxlength="40" tabindex="10"/> <textbox id="tel_work" size="28" maxlength="40"/>
</row> </row>
<row> <row>
<description/> <description/>
<description value="mobile phone" options=",,,tel_cell"/> <description value="mobile phone" options=",,,tel_cell"/>
<textbox id="tel_cell" size="28" maxlength="40" tabindex="11"/> <textbox id="tel_cell" size="28" maxlength="40"/>
</row> </row>
<row> <row>
<description/> <description/>
<description value="Private" options=",,,tel_home"/> <description value="Private" options=",,,tel_home"/>
<textbox id="tel_home" size="28" maxlength="40" tabindex="12"/> <textbox id="tel_home" size="28" maxlength="40"/>
</row> </row>
<row> <row>
<description/> <description/>
<description/> <description/>
<button label="More ..." onclick="showphones(this.form); return false;" tabindex="13" accesskey="m"/> <button label="More ..." onclick="showphones(this.form); return false;" accesskey="m"/>
</row> </row>
</rows> </rows>
</grid> </grid>
@ -403,17 +403,17 @@
<row> <row>
<image src="package_network"/> <image src="package_network"/>
<description value="url" options=",,,url"/> <description value="url" options=",,,url"/>
<textbox id="url" size="28" maxlength="128" tabindex="15"/> <textbox id="url" size="28" maxlength="128"/>
</row> </row>
<row> <row>
<image src="email_icon"/> <image src="email_icon"/>
<description value="business email" options=",,,email"/> <description value="business email" options=",,,email"/>
<textbox id="email" size="28" maxlength="64" tabindex="16"/> <textbox id="email" size="28" maxlength="64"/>
</row> </row>
<row> <row>
<description/> <description/>
<description value="home email" options=",,,email_home"/> <description value="home email" options=",,,email_home"/>
<textbox id="email_home" size="28" maxlength="64" tabindex="17"/> <textbox id="email_home" size="28" maxlength="64"/>
</row> </row>
</rows> </rows>
</grid> </grid>
@ -434,9 +434,9 @@
<button label="Edit" id="button[edit]" onclick="window.open(egw::link('/index.php','menuaction=addressbook.uicontacts.edit&amp;contact_id=$cont[id]'),'_blank','dependent=yes,width=850,height=440,scrollbars=yes,status=yes'); return false;"/> <button label="Edit" id="button[edit]" onclick="window.open(egw::link('/index.php','menuaction=addressbook.uicontacts.edit&amp;contact_id=$cont[id]'),'_blank','dependent=yes,width=850,height=440,scrollbars=yes,status=yes'); return false;"/>
<button label="Copy" id="button[copy]" onclick="window.open(egw::link('/index.php','menuaction=addressbook.uicontacts.edit&amp;contact_id=$cont[id]&amp;makecp=1'),'_blank','dependent=yes,width=850,height=440,scrollbars=yes,status=yes'); return false;"/> <button label="Copy" id="button[copy]" onclick="window.open(egw::link('/index.php','menuaction=addressbook.uicontacts.edit&amp;contact_id=$cont[id]&amp;makecp=1'),'_blank','dependent=yes,width=850,height=440,scrollbars=yes,status=yes'); return false;"/>
<button label="vCard" id="button[vcard]" statustext="download this contact as vCard file"/> <button label="vCard" id="button[vcard]" statustext="download this contact as vCard file"/>
<button label="Save" id="button[save]" tabindex="20" accesskey="s"/> <button label="Save" id="button[save]" accesskey="s"/>
<button label="Apply" id="button[apply]" tabindex="21"/> <button label="Apply" id="button[apply]"/>
<button label="Cancel" id="button[cancel]" onclick="if($cont[view]0) return true; self.close(); return false;" tabindex="22"/> <button label="Cancel" id="button[cancel]" onclick="if($cont[view]0) return true; self.close(); return false;"/>
<template id="addressbook.editphones"/> <template id="addressbook.editphones"/>
</hbox> </hbox>
<button label="Delete" id="button[delete]" onclick="return confirm('Are you shure you want to delete this contact?');" align="right" tabindex="25"/> <button label="Delete" id="button[delete]" onclick="return confirm('Are you shure you want to delete this contact?');" align="right" tabindex="25"/>