* Add Cc field to Infolog

This commit is contained in:
Nathan Gray 2011-03-08 19:18:07 +00:00
parent 1299714c61
commit 579d813ec9
7 changed files with 126 additions and 52 deletions

View File

@ -60,6 +60,7 @@ class infolog_tracking extends bo_tracking
'info_startdate' => 'st',
'info_enddate' => 'En',
'info_responsible' => 'Re',
'info_cc' => 'cc',
'info_subject' => 'Su',
'info_des' => 'De',
'info_location' => 'Lo',
@ -96,6 +97,7 @@ class infolog_tracking extends bo_tracking
'info_startdate' => 'Startdate',
'info_enddate' => 'Enddate',
'info_responsible' => 'Responsible',
'info_cc' => 'Cc',
// PM fields
'info_planned_time' => 'planned time',
'info_used_time' => 'used time',
@ -321,4 +323,31 @@ class infolog_tracking extends bo_tracking
return parent::save_history($data,$old);
}
/**
* Get a notification-config value
*
* @param string $what
* - 'copy' array of email addresses notifications should be copied too, can depend on $data
* - 'lang' string lang code for copy mail
* - 'sender' string send email address
* @param array $data current entry
* @param array $old=null old/last state of the entry or null for a new entry
* @return mixed
*/
function get_config($name,$data,$old=null)
{
$config = array();
switch($name)
{
case 'copy': // include the info_cc addresses
if ($data['info_access'] == 'private') return array(); // no copies for private entries
if ($data['info_cc'])
{
$config = array_merge($config,preg_split('/, ?/',$data['info_cc']));
}
break;
}
return $config;
}
}

View File

@ -1649,6 +1649,7 @@ class infolog_ui
{
$readonlys[$tabs]['history'] = true;
}
egw_framework::validate_file('.','edit','infolog');
$GLOBALS['egw_info']['flags']['app_header'] = lang('InfoLog').' - '.
($content['status_only'] ? lang('Edit Status') : lang('Edit'));
$GLOBALS['egw_info']['flags']['params']['manual'] = array('page' => ($info_id ? 'ManualInfologEdit' : 'ManualInfologAdd'));

28
infolog/js/edit.js Normal file
View File

@ -0,0 +1,28 @@
/**
* Javascript used on the infolog edit popup
*/
function add_email_from_ab(ab_id,info_cc)
{
var ab = document.getElementById(ab_id);
if (!ab || !ab.value)
{
set_style_by_class('tr','hiddenRow','display','block');
}
else
{
var cc = document.getElementById(info_cc);
for(var i=0; i < ab.options.length && ab.options[i].value != ab.value; ++i) ;
if (i < ab.options.length)
{
cc.value += (cc.value?', ':'')+ab.options[i].text.replace(/^.* <(.*)>$/,'$1');
ab.value = '';
ab.onchange();
set_style_by_class('tr','hiddenRow','display','none');
}
}
return false;
}

File diff suppressed because one or more lines are too long

View File

@ -12,7 +12,7 @@
*/
$setup_info['infolog']['name'] = 'infolog';
$setup_info['infolog']['version'] = '1.8';
$setup_info['infolog']['version'] = '1.9.001';
$setup_info['infolog']['app_order'] = 5;
$setup_info['infolog']['tables'] = array('egw_infolog','egw_infolog_extra');
$setup_info['infolog']['enable'] = 1;
@ -70,3 +70,4 @@ $setup_info['infolog']['depends'][] = array(
'appname' => 'etemplate',
'versions' => Array('1.7','1.8','1.9')
);

View File

@ -11,53 +11,54 @@
* @version $Id$
*/
$phpgw_baseline = array(
'egw_infolog' => array(
'fd' => array(
'info_id' => array('type' => 'auto','nullable' => False),
'info_type' => array('type' => 'varchar','precision' => '40','nullable' => False,'default' => 'task'),
'info_from' => array('type' => 'varchar','precision' => '255'),
'info_addr' => array('type' => 'varchar','precision' => '255'),
'info_subject' => array('type' => 'varchar','precision' => '255'),
'info_des' => array('type' => 'text'),
'info_owner' => array('type' => 'int','precision' => '4','nullable' => False),
'info_responsible' => array('type' => 'varchar','precision' => '255','nullable' => False,'default' => '0'),
'info_access' => array('type' => 'varchar','precision' => '10','default' => 'public'),
'info_cat' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'),
'info_datemodified' => array('type' => 'int','precision' => '8','nullable' => False),
'info_startdate' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0'),
'info_enddate' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0'),
'info_id_parent' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'),
'info_planned_time' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'),
'info_replanned_time' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'),
'info_used_time' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'),
'info_status' => array('type' => 'varchar','precision' => '40','default' => 'done'),
'info_confirm' => array('type' => 'varchar','precision' => '10','default' => 'not'),
'info_modifier' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'),
'info_link_id' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'),
'info_priority' => array('type' => 'int','precision' => '2','default' => '1'),
'pl_id' => array('type' => 'int','precision' => '4'),
'info_price' => array('type' => 'float','precision' => '8'),
'info_percent' => array('type' => 'int','precision' => '2','default' => '0'),
'info_datecompleted' => array('type' => 'int','precision' => '8'),
'info_location' => array('type' => 'varchar','precision' => '255'),
'info_custom_from' => array('type' => 'int','precision' => '1'),
'info_uid' => array('type' => 'varchar','precision' => '255')
),
'pk' => array('info_id'),
'fk' => array(),
'ix' => array(array('info_owner','info_responsible','info_status','info_startdate'),array('info_id_parent','info_owner','info_responsible','info_status','info_startdate')),
'uc' => array()
$phpgw_baseline = array(
'egw_infolog' => array(
'fd' => array(
'info_id' => array('type' => 'auto','nullable' => False),
'info_type' => array('type' => 'varchar','precision' => '40','nullable' => False,'default' => 'task'),
'info_from' => array('type' => 'varchar','precision' => '255'),
'info_addr' => array('type' => 'varchar','precision' => '255'),
'info_subject' => array('type' => 'varchar','precision' => '255'),
'info_des' => array('type' => 'text'),
'info_owner' => array('type' => 'int','precision' => '4','nullable' => False),
'info_responsible' => array('type' => 'varchar','precision' => '255','nullable' => False,'default' => '0'),
'info_access' => array('type' => 'varchar','precision' => '10','default' => 'public'),
'info_cat' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'),
'info_datemodified' => array('type' => 'int','precision' => '8','nullable' => False),
'info_startdate' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0'),
'info_enddate' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0'),
'info_id_parent' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'),
'info_planned_time' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'),
'info_replanned_time' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'),
'info_used_time' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'),
'info_status' => array('type' => 'varchar','precision' => '40','default' => 'done'),
'info_confirm' => array('type' => 'varchar','precision' => '10','default' => 'not'),
'info_modifier' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'),
'info_link_id' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'),
'info_priority' => array('type' => 'int','precision' => '2','default' => '1'),
'pl_id' => array('type' => 'int','precision' => '4'),
'info_price' => array('type' => 'float','precision' => '8'),
'info_percent' => array('type' => 'int','precision' => '2','default' => '0'),
'info_datecompleted' => array('type' => 'int','precision' => '8'),
'info_location' => array('type' => 'varchar','precision' => '255'),
'info_custom_from' => array('type' => 'int','precision' => '1'),
'info_uid' => array('type' => 'varchar','precision' => '255'),
'info_cc' => array('type' => 'varchar','precision' => '255')
),
'egw_infolog_extra' => array(
'fd' => array(
'info_id' => array('type' => 'int','precision' => '4','nullable' => False),
'info_extra_name' => array('type' => 'varchar','precision' => '64','nullable' => False),
'info_extra_value' => array('type' => 'text','nullable' => False)
),
'pk' => array('info_id','info_extra_name'),
'fk' => array(),
'ix' => array(),
'uc' => array()
)
);
'pk' => array('info_id'),
'fk' => array(),
'ix' => array(array('info_owner','info_responsible','info_status','info_startdate'),array('info_id_parent','info_owner','info_responsible','info_status','info_startdate')),
'uc' => array()
),
'egw_infolog_extra' => array(
'fd' => array(
'info_id' => array('type' => 'int','precision' => '4','nullable' => False),
'info_extra_name' => array('type' => 'varchar','precision' => '64','nullable' => False),
'info_extra_value' => array('type' => 'text','nullable' => False)
),
'pk' => array('info_id','info_extra_name'),
'fk' => array(),
'ix' => array(),
'uc' => array()
)
);

View File

@ -634,3 +634,14 @@ function infolog_upgrade1_6()
{
return $GLOBALS['setup_info']['infolog']['currentver'] = '1.8';
}
function infolog_upgrade1_8()
{
$GLOBALS['egw_setup']->oProc->AddColumn('egw_infolog','info_cc',array(
'type' => 'varchar',
'precision' => '255'
));
return $GLOBALS['setup_info']['infolog']['currentver'] = '1.9.001';
}