improved projectmanager integration, specially pricelist plus some bugfixes

This commit is contained in:
Ralf Becker 2006-01-11 05:17:15 +00:00
parent 7c036da742
commit 15201df1b5
11 changed files with 159 additions and 28 deletions

View File

@ -70,6 +70,13 @@ class botimesheet extends so_sql
'2 years ago' => array(-2,0,0,0, -1,0,0,0),
'3 years ago' => array(-3,0,0,0, -2,0,0,0),
);
/**
* @var object $link reference to the (bo)link class instanciated at $GLOBALS['egw']->link
*/
var $link;
/**
* @var array $grants
*/
function botimesheet()
{
@ -296,7 +303,7 @@ class botimesheet extends so_sql
$this->data['ts_modifier'] = $GLOBALS['egw_info']['user']['account_id'];
$this->data['ts_modified'] = $this->now;
}
if (!($err = parent::save(null)))
if (!($err = parent::save()))
{
// notify the link-class about the update, as other apps may be subscribt to it
$this->link->notify_update(TIMESHEET_APP,$this->data['ts_id'],$this->data);
@ -313,7 +320,11 @@ class botimesheet extends so_sql
*/
function delete($keys=null,$ignore_acl=false)
{
$ts_id = is_null($keys) ? $this->data['ts_id'] : (is_array($keys) ? $keys['ts_id'] : $keys);
if (!is_array($keys) && (int) $keys)
{
$keys = array('ts_id' => (int) $keys);
}
$ts_id = is_null($keys) ? $this->data['ts_id'] : $keys['ts_id'];
if (!$this->check_acl(EGW_ACL_DELETE,$ts_id))
{

View File

@ -32,7 +32,8 @@ class datasource_timesheet extends datasource
{
$this->datasource(TIMESHEET_APP);
$this->valid = PM_REAL_START|PM_REAL_END|PM_USED_TIME|PM_USED_BUDGET|PM_RESOURCES|PM_DETAILS|PM_COMPLETION;
$this->valid = PM_REAL_START|PM_REAL_END|PM_USED_TIME|PM_USED_BUDGET|PM_USED_QUANTITY|
PM_PRICELIST_ID|PM_UNITPRICE|PM_RESOURCES|PM_DETAILS|PM_COMPLETION;
}
/**
@ -46,7 +47,7 @@ class datasource_timesheet extends datasource
// we use $GLOBALS['bocal'] as an already running instance is availible there
if (!is_object($GLOBALS['botimesheet']))
{
$GLOBALS['bocal'] =& new botimesheet();
$GLOBALS['botimesheet'] =& new botimesheet();
}
if (!is_array($data_id))
{
@ -64,6 +65,9 @@ class datasource_timesheet extends datasource
'pe_real_start' => $data['ts_start'],
'pe_resources' => array($data['ts_owner']),
'pe_details' => $data['ts_description'] ? nl2br($data['ts_description']) : '',
'pl_id' => $data['pl_id'],
'pe_unitprice' => $data['ts_unitprice'],
'pe_used_quantity' => $data['ts_quantity'],
'pe_used_budget' => $data['ts_quantity'] * $data['ts_unitprice'],
'pe_completion' => 100,
);

View File

@ -72,7 +72,7 @@ class uitimesheet extends botimesheet
}
else
{
list($button) = each($content['button']);
list($button) = @each($content['button']);
$view = $content['view'];
$referer = $content['referer'];
$this->data = $content;
@ -103,6 +103,19 @@ class uitimesheet extends botimesheet
else
{
$msg = lang('Entry saved');
if ((int) $this->data['pm_id'] != (int) $this->data['old_pm_id'])
{
// update links accordingly
if ($this->data['pm_id'])
{
$this->link->link(TIMESHEET_APP,$content['link_to']['to_id'],'projectmanager',$this->data['pm_id']);
}
if ($this->data['old_pm_id'])
{
$this->link->unlink2(0,TIMESHEET_APP,$content['link_to']['to_id'],0,'projectmanager',$this->data['old_pm_id']);
unset($this->data['old_pm_id']);
}
}
if (is_array($content['link_to']['to_id']) && count($content['link_to']['to_id']))
{
$this->link->link(TIMESHEET_APP,$this->data['ts_id'],$content['link_to']['to_id']);
@ -127,10 +140,18 @@ class uitimesheet extends botimesheet
case 'delete':
if ($button == 'delete')
{
$this->delete();
$msg = lang('Entry deleted');
$js = "opener.location.href=opener.location.href+'&msg=$msg'";
if ($this->delete())
{
$msg = lang('Entry deleted');
$js = "opener.location.href=opener.location.href+'&msg=$msg';";
}
else
{
$msg = lang('Error deleting the entry!!!');
break; // dont close window
}
}
// fall-through for save
case 'cancel':
$js .= 'window.close();';
echo "<html>\n<body>\n<script>\n$js\n</script>\n</body>\n</html>\n";
@ -142,23 +163,22 @@ class uitimesheet extends botimesheet
'view' => $view,
'referer' => $referer,
);
$content = $this->data + array(
$content = array_merge($this->data,array(
'msg' => $msg,
'view' => $view,
$tabs => $content[$tabs],
'link_to' => array(
'to_id' => $content['link_to']['to_id'] ? $content['link_to']['to_id'] : $this->data['ts_id'],
'to_id' => $this->data['ts_id'] ? $this->data['ts_id'] : $content['link_to']['to_id'],
'to_app' => TIMESHEET_APP,
),
'js' => "<script>\n$js\n</script>\n",
'ts_quantity_blur' => $this->data['ts_duration'] ? $this->data['ts_duration'] / 60.0 : '',
);
));
if (!$this->data['ts_id'] && isset($_GET['link_app']) && isset($_GET['link_id']) &&
preg_match('/^[a-z_0-9-]+:[:a-z_0-9-]+$/i',$_GET['link_app'].':'.$_GET['link_id']) && // gard against XSS
!is_array($content['link_to']['to_id']))
{
$this->link->link(TIMESHEET_APP,$content['link_to']['to_id'],$_GET['link_app'],$_GET['link_id']);
// $content['ts_project'] = $this->link->title($_GET['link_app'],$_GET['link_id']);
if ($_GET['link_app'] == 'projectmanager')
{
$links = array($_GET['link_id']);
@ -168,9 +188,12 @@ class uitimesheet extends botimesheet
{
$links = $this->link->get_links(TIMESHEET_APP,$this->data['ts_id'],'projectmanager');
}
if ($links)
$preserv['old_pm_id'] = array_shift($links);
if (!isset($this->data['pm_id']) && $preserv['old_pm_id']) $content['pm_id'] = $preserv['old_pm_id'];
if ($content['pm_id'])
{
$preserv['ts_project_blur'] = $content['ts_project_blur'] = $this->link->title('projectmanager',array_shift($links));
$preserv['ts_project_blur'] = $content['ts_project_blur'] = $this->link->title('projectmanager',$content['pm_id']);
}
$readonlys = array(
'button[delete]' => !$this->data['ts_id'] || !$this->check_acl(EGW_ACL_DELETE),
@ -181,7 +204,7 @@ class uitimesheet extends botimesheet
);
if ($view)
{
foreach($this->data as $key => $val)
foreach(array_merge(array_keys($this->data),array('pm_id','pl_id','link_to')) as $key)
{
$readonlys[$key] = true;
}
@ -195,7 +218,12 @@ class uitimesheet extends botimesheet
($view ? lang('View') : ($this->data['ts_id'] ? lang('Edit') : lang('Add')));
$etpl =& new etemplate('timesheet.edit');
// supress unknow widget 'projectmanager-*', if projectmanager is not installed or old
if (!@file_exists(EGW_INCLUDE_ROOT.'/projectmanager/inc/class.projectmanager_widget.inc.php'))
{
$etpl->set_cell_attribute('pm_id','disabled',true);
$etpl->set_cell_attribute('pl_id','disabled',true);
}
return $etpl->exec(TIMESHEET_APP.'.uitimesheet.edit',$content,array(
'ts_owner' => $edit_grants,
),$readonlys,$preserv,2);
@ -286,6 +314,18 @@ class uitimesheet extends botimesheet
if ($_GET['msg']) $msg = $_GET['msg'];
if ($content['nm']['rows']['delete'])
{
list($ts_id) = each($content['nm']['rows']['delete']);
if ($this->delete($ts_id))
{
$msg = lang('Entry deleted');
}
else
{
$msg = lang('Error deleting the entry!!!');
}
}
$content = array(
'nm' => $GLOBALS['egw']->session->appsession('index',TIMESHEET_APP),
'msg' => $msg,

View File

@ -1,5 +1,5 @@
<?php
// eTemplates for Application 'timesheet', generated by soetemplate::dump4setup() 2005-12-19 01:52
// eTemplates for Application 'timesheet', generated by soetemplate::dump4setup() 2006-01-10 23:59
/* $Id$ */
@ -7,9 +7,11 @@ $templ_version=1;
$templ_data[] = array('name' => 'timesheet.edit','template' => '','lang' => '','group' => '0','version' => '0.1.001','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:8:{i:0;a:8:{s:2:"c2";s:2:"th";s:2:"c3";s:3:"row";s:1:"A";s:3:"100";s:2:"c6";s:3:"row";s:2:"h6";s:14:",!@ts_modified";s:2:"c4";s:3:"row";s:2:"h2";s:2:"28";s:2:"h1";s:6:",!@msg";}i:1;a:2:{s:1:"A";a:5:{s:4:"type";s:5:"label";s:4:"span";s:13:"all,redItalic";s:4:"name";s:3:"msg";s:7:"no_lang";s:1:"1";s:5:"align";s:6:"center";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:2;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"size";s:11:",,,ts_owner";s:5:"label";s:4:"User";}s:1:"B";a:4:{s:4:"type";s:6:"select";s:4:"name";s:8:"ts_owner";s:4:"span";s:3:"all";s:7:"no_lang";s:1:"1";}}i:3;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"size";s:13:",,,ts_project";s:5:"label";s:7:"Project";}s:1:"B";a:5:{s:4:"type";s:4:"text";s:4:"size";s:5:"65,80";s:4:"name";s:10:"ts_project";s:4:"span";s:3:"all";s:4:"blur";s:16:"@ts_project_blur";}}i:4;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"size";s:14:",,ts_unitprice";s:5:"label";s:9:"Unitprice";}s:1:"B";a:3:{s:4:"type";s:5:"float";s:4:"name";s:12:"ts_unitprice";s:4:"span";s:3:"all";}}i:5;a:2:{s:1:"A";a:4:{s:4:"type";s:3:"tab";s:5:"label";s:19:"General|Notes|Links";s:4:"name";s:19:"general|notes|links";s:4:"span";s:3:"all";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:6;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:13:"Last modified";}s:1:"B";a:4:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";i:1;a:3:{s:4:"type";s:9:"date-time";s:4:"name";s:11:"ts_modified";s:8:"readonly";s:1:"1";}i:2;a:4:{s:4:"type";s:14:"select-account";s:4:"name";s:11:"ts_modifier";s:5:"label";s:2:"by";s:8:"readonly";s:1:"1";}}}i:7;a:2:{s:1:"A";a:5:{s:4:"type";s:4:"hbox";s:4:"size";s:5:"2,0,0";s:4:"span";s:1:"2";i:1;a:8:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"6";i:1;a:4:{s:4:"type";s:6:"button";s:5:"label";s:4:"Edit";s:4:"name";s:12:"button[edit]";s:4:"help";s:15:"Edit this entry";}i:2;a:4:{s:4:"type";s:6:"button";s:4:"name";s:16:"button[save_new]";s:5:"label";s:10:"Save & New";s:4:"help";s:34:"Saves this entry and add a new one";}i:3;a:4:{s:4:"type";s:6:"button";s:4:"name";s:12:"button[save]";s:5:"label";s:4:"Save";s:4:"help";s:22:"Saves the changes made";}i:4;a:4:{s:4:"type";s:6:"button";s:4:"name";s:13:"button[apply]";s:5:"label";s:5:"Apply";s:4:"help";s:24:"Applies the changes made";}i:5;a:5:{s:4:"type";s:6:"button";s:4:"name";s:14:"button[cancel]";s:5:"label";s:6:"Cancel";s:4:"help";s:44:"closes the window without saving the changes";s:7:"onclick";s:15:"window.close();";}i:6;a:2:{s:4:"type";s:4:"html";s:4:"name";s:2:"js";}}i:2;a:6:{s:4:"type";s:6:"button";s:5:"label";s:6:"Delete";s:5:"align";s:5:"right";s:4:"name";s:14:"button[delete]";s:4:"help";s:17:"Delete this entry";s:7:"onclick";s:36:"return confirm(\'Delete this entry\');";}}s:1:"B";a:1:{s:4:"type";s:5:"label";}}}s:4:"rows";i:7;s:4:"cols";i:2;s:4:"size";s:4:"100%";s:7:"options";a:1:{i:0;s:4:"100%";}}}','size' => '100%','style' => '','modified' => '1134772260',);
$templ_data[] = array('name' => 'timesheet.edit','template' => '','lang' => '','group' => '0','version' => '0.2.001','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:8:{i:0;a:8:{s:2:"c2";s:2:"th";s:2:"c3";s:3:"row";s:1:"A";s:3:"100";s:2:"c6";s:3:"row";s:2:"h6";s:14:",!@ts_modified";s:2:"c4";s:3:"row";s:2:"h2";s:2:"28";s:2:"h1";s:6:",!@msg";}i:1;a:2:{s:1:"A";a:5:{s:4:"type";s:5:"label";s:4:"span";s:13:"all,redItalic";s:4:"name";s:3:"msg";s:7:"no_lang";s:1:"1";s:5:"align";s:6:"center";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:2;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"size";s:11:",,,ts_owner";s:5:"label";s:4:"User";}s:1:"B";a:4:{s:4:"type";s:6:"select";s:4:"name";s:8:"ts_owner";s:4:"span";s:3:"all";s:7:"no_lang";s:1:"1";}}i:3;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"size";s:13:",,,ts_project";s:5:"label";s:7:"Project";}s:1:"B";a:5:{s:4:"type";s:4:"vbox";s:4:"size";s:1:"2";s:4:"span";s:3:"all";i:1;a:6:{s:4:"type";s:21:"projectmanager-select";s:4:"size";s:4:"None";s:4:"name";s:5:"pm_id";s:4:"span";s:3:"all";s:4:"help";s:16:"Select a project";s:8:"onchange";s:1:"1";}i:2;a:4:{s:4:"type";s:4:"text";s:4:"name";s:10:"ts_project";s:4:"blur";s:16:"@ts_project_blur";s:4:"size";s:5:"65,80";}}}i:4;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"size";s:14:",,ts_unitprice";s:5:"label";s:9:"Unitprice";}s:1:"B";a:5:{s:4:"type";s:4:"hbox";s:4:"span";s:3:"all";s:4:"size";s:1:"2";i:1;a:4:{s:4:"type";s:24:"projectmanager-pricelist";s:4:"name";s:5:"pl_id";s:4:"size";s:4:"None";s:8:"onchange";s:209:"this.form[\'exec[ts_unitprice]\'].value=this.options[this.selectedIndex].text.lastIndexOf(\'(\') < 0 ? \'\' : this.options[this.selectedIndex].text.slice(this.options[this.selectedIndex].text.lastIndexOf(\'(\')+1,-1);";}i:2;a:3:{s:4:"type";s:5:"float";s:4:"name";s:12:"ts_unitprice";s:4:"span";s:3:"all";}}}i:5;a:2:{s:1:"A";a:4:{s:4:"type";s:3:"tab";s:5:"label";s:19:"General|Notes|Links";s:4:"name";s:19:"general|notes|links";s:4:"span";s:3:"all";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:6;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:13:"Last modified";}s:1:"B";a:4:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";i:1;a:3:{s:4:"type";s:9:"date-time";s:4:"name";s:11:"ts_modified";s:8:"readonly";s:1:"1";}i:2;a:4:{s:4:"type";s:14:"select-account";s:4:"name";s:11:"ts_modifier";s:5:"label";s:2:"by";s:8:"readonly";s:1:"1";}}}i:7;a:2:{s:1:"A";a:5:{s:4:"type";s:4:"hbox";s:4:"size";s:5:"2,0,0";s:4:"span";s:1:"2";i:1;a:8:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"6";i:1;a:4:{s:4:"type";s:6:"button";s:5:"label";s:4:"Edit";s:4:"name";s:12:"button[edit]";s:4:"help";s:15:"Edit this entry";}i:2;a:4:{s:4:"type";s:6:"button";s:4:"name";s:16:"button[save_new]";s:5:"label";s:10:"Save & New";s:4:"help";s:34:"Saves this entry and add a new one";}i:3;a:4:{s:4:"type";s:6:"button";s:4:"name";s:12:"button[save]";s:5:"label";s:4:"Save";s:4:"help";s:22:"Saves the changes made";}i:4;a:4:{s:4:"type";s:6:"button";s:4:"name";s:13:"button[apply]";s:5:"label";s:5:"Apply";s:4:"help";s:24:"Applies the changes made";}i:5;a:5:{s:4:"type";s:6:"button";s:4:"name";s:14:"button[cancel]";s:5:"label";s:6:"Cancel";s:4:"help";s:44:"closes the window without saving the changes";s:7:"onclick";s:15:"window.close();";}i:6;a:2:{s:4:"type";s:4:"html";s:4:"name";s:2:"js";}}i:2;a:6:{s:4:"type";s:6:"button";s:5:"label";s:6:"Delete";s:5:"align";s:5:"right";s:4:"name";s:14:"button[delete]";s:4:"help";s:17:"Delete this entry";s:7:"onclick";s:36:"return confirm(\'Delete this entry\');";}}s:1:"B";a:1:{s:4:"type";s:5:"label";}}}s:4:"rows";i:7;s:4:"cols";i:2;s:4:"size";s:4:"100%";s:7:"options";a:1:{i:0;s:4:"100%";}}}','size' => '100%','style' => '.width100 { width: 100%; }','modified' => '1136861594',);
$templ_data[] = array('name' => 'timesheet.edit.general','template' => '','lang' => '','group' => '0','version' => '0.1.001','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:6:{i:0;a:5:{s:2:"c1";s:3:"row";s:1:"A";s:2:"95";s:2:"c3";s:3:"row";s:2:"c4";s:3:"row";s:2:"c2";s:3:"row";}i:1;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"size";s:11:",,,ts_title";s:5:"label";s:5:"Title";}s:1:"B";a:4:{s:4:"type";s:4:"text";s:4:"size";s:5:"65,80";s:4:"name";s:8:"ts_title";s:6:"needed";s:1:"1";}}i:2;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"size";s:9:",,,cat_id";s:5:"label";s:8:"Category";}s:1:"B";a:3:{s:4:"type";s:10:"select-cat";s:4:"name";s:6:"cat_id";s:4:"size";s:4:"None";}}i:3;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"size";s:11:",,,ts_start";s:5:"label";s:4:"Date";}s:1:"B";a:4:{s:4:"type";s:9:"date-time";s:4:"name";s:8:"ts_start";s:6:"needed";s:1:"1";s:4:"size";s:2:",8";}}i:4;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"size";s:14:",,,ts_duration";s:5:"label";s:8:"Duration";}s:1:"B";a:3:{s:4:"type";s:13:"date-duration";s:4:"name";s:11:"ts_duration";s:4:"size";s:2:",h";}}i:5;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"size";s:14:",,,ts_quantity";s:5:"label";s:8:"Quantity";}s:1:"B";a:4:{s:4:"type";s:5:"float";s:4:"name";s:11:"ts_quantity";s:4:"help";s:30:"empty if identical to duration";s:4:"blur";s:17:"@ts_quantity_blur";}}}s:4:"rows";i:5;s:4:"cols";i:2;s:4:"size";s:8:"100%,150";s:7:"options";a:2:{i:0;s:4:"100%";i:1;s:3:"150";}}}','size' => '100%,150','style' => '','modified' => '1134773043',);
$templ_data[] = array('name' => 'timesheet.edit.links','template' => '','lang' => '','group' => '0','version' => '0.1.001','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:5:{i:0;a:7:{s:1:"A";s:3:"100";s:2:"h1";s:13:",@status_only";s:2:"h2";s:13:",@status_only";s:2:"c1";s:2:"th";s:2:"c2";s:3:"row";s:2:"c3";s:2:"th";s:2:"c4";s:11:"row_off,top";}i:1;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"span";s:3:"all";s:5:"label";s:16:"Create new links";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:2;a:2:{s:1:"A";a:3:{s:4:"type";s:7:"link-to";s:4:"span";s:3:"all";s:4:"name";s:7:"link_to";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:3;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"span";s:3:"all";s:5:"label";s:14:"Existing links";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:4;a:2:{s:1:"A";a:3:{s:4:"type";s:9:"link-list";s:4:"span";s:3:"all";s:4:"name";s:7:"link_to";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}}s:4:"rows";i:4;s:4:"cols";i:2;s:4:"size";s:17:"100%,150,,,,,auto";s:7:"options";a:3:{i:0;s:4:"100%";i:1;s:3:"150";i:6;s:4:"auto";}}}','size' => '100%,150,,,,,auto','style' => '','modified' => '1134775301',);
$templ_data[] = array('name' => 'timesheet.edit.links','template' => '','lang' => '','group' => '0','version' => '0.1.001','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:5:{i:0;a:7:{s:1:"A";s:3:"100";s:2:"h1";s:6:",@view";s:2:"h2";s:13:",@status_only";s:2:"c1";s:2:"th";s:2:"c2";s:3:"row";s:2:"c3";s:2:"th";s:2:"c4";s:11:"row_off,top";}i:1;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"span";s:3:"all";s:5:"label";s:16:"Create new links";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:2;a:2:{s:1:"A";a:3:{s:4:"type";s:7:"link-to";s:4:"span";s:3:"all";s:4:"name";s:7:"link_to";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:3;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"span";s:3:"all";s:5:"label";s:14:"Existing links";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:4;a:2:{s:1:"A";a:3:{s:4:"type";s:9:"link-list";s:4:"span";s:3:"all";s:4:"name";s:7:"link_to";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}}s:4:"rows";i:4;s:4:"cols";i:2;s:4:"size";s:17:"100%,150,,,,,auto";s:7:"options";a:3:{i:0;s:4:"100%";i:1;s:3:"150";i:6;s:4:"auto";}}}','size' => '100%,150,,,,,auto','style' => '','modified' => '1134775301',);
$templ_data[] = array('name' => 'timesheet.edit.notes','template' => '','lang' => '','group' => '0','version' => '0.1.001','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:2:{i:0;a:1:{s:2:"c1";s:7:"row,top";}i:1;a:1:{s:1:"A";a:3:{s:4:"type";s:8:"textarea";s:4:"size";s:4:"8,70";s:4:"name";s:14:"ts_description";}}}s:4:"rows";i:1;s:4:"cols";i:1;s:4:"size";s:8:"100%,150";s:7:"options";a:2:{i:0;s:4:"100%";i:1;s:3:"150";}}}','size' => '100%,150','style' => '','modified' => '1134773787',);

View File

@ -9,6 +9,7 @@ edit this entry timesheet de diesen Eintrag bearbeiten
empty if identical to duration timesheet de leer lassen wenn gleich Dauer
entry deleted timesheet de Eintrag gelöscht
entry saved timesheet de Eintrag gespeichert
error deleting the entry!!! timesheet de Fehler beim Löschen des Eintrags!!!
error saving the entry!!! timesheet de Fehler beim Speichern des Eintrags!!!
existing links timesheet de Bestehende Verknüpfungen
general timesheet de Allgemein
@ -23,7 +24,7 @@ price timesheet de Preis
quantity timesheet de Menge
save & new timesheet de Speichern & Neu
saves the changes made timesheet de Speichert die Änderungen
saves this entry and add a new one timesheet de Speichert diesen Eintrag und fügt einen neune hinzu
saves this entry and add a new one timesheet de Speichert diesen Eintrag und fügt einen neuen hinzu
this month timesheet de Diesen Monat
this week timesheet de Diese Woche
this year timesheet de Diese Jahr

View File

@ -9,6 +9,7 @@ edit this entry timesheet en Edit this entry
empty if identical to duration timesheet en empty if identical to duration
entry deleted timesheet en Entry deleted
entry saved timesheet en Entry saved
error deleting the entry!!! timesheet en Error deleting the entry!!!
error saving the entry!!! timesheet en Error saving the entry!!!
existing links timesheet en Existing links
general timesheet en General

View File

@ -18,7 +18,7 @@ if (!defined('TIMESHEET_APP'))
}
$setup_info[TIMESHEET_APP]['name'] = TIMESHEET_APP;
$setup_info[TIMESHEET_APP]['version'] = '0.1.001';
$setup_info[TIMESHEET_APP]['version'] = '0.2.001';
$setup_info[TIMESHEET_APP]['app_order'] = 5;
$setup_info[TIMESHEET_APP]['tables'] = array('egw_timesheet');
$setup_info[TIMESHEET_APP]['enable'] = 1;
@ -53,3 +53,4 @@ $setup_info[TIMESHEET_APP]['depends'][] = array(
'appname' => 'etemplate',
'versions' => Array('1.2','1.3')
);

View File

@ -0,0 +1,37 @@
<?php
/**************************************************************************\
* eGroupWare - Setup *
* http://www.eGroupWare.org *
* Created by eTemplates DB-Tools written by ralfbecker@outdoor-training.de *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
$phpgw_baseline = array(
'egw_timesheet' => array(
'fd' => array(
'ts_id' => array('type' => 'auto','nullable' => False),
'ts_project' => array('type' => 'varchar','precision' => '80'),
'ts_title' => array('type' => 'varchar','precision' => '80','nullable' => False),
'ts_description' => array('type' => 'text'),
'ts_start' => array('type' => 'int','precision' => '8','nullable' => False),
'ts_duration' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0'),
'ts_quantity' => array('type' => 'float','precision' => '8','nullable' => False),
'ts_unitprice' => array('type' => 'float','precision' => '4'),
'cat_id' => array('type' => 'int','precision' => '4','default' => '0'),
'ts_owner' => array('type' => 'int','precision' => '4','nullable' => False),
'ts_modified' => array('type' => 'int','precision' => '8','nullable' => False),
'ts_modifier' => array('type' => 'int','precision' => '4','nullable' => False)
),
'pk' => array('ts_id'),
'fk' => array(),
'ix' => array('ts_project','ts_owner'),
'uc' => array()
)
);

View File

@ -27,7 +27,8 @@
'cat_id' => array('type' => 'int','precision' => '4','default' => '0'),
'ts_owner' => array('type' => 'int','precision' => '4','nullable' => False),
'ts_modified' => array('type' => 'int','precision' => '8','nullable' => False),
'ts_modifier' => array('type' => 'int','precision' => '4','nullable' => False)
'ts_modifier' => array('type' => 'int','precision' => '4','nullable' => False),
'pl_id' => array('type' => 'int','precision' => '4','default' => '0')
),
'pk' => array('ts_id'),
'fk' => array(),

View File

@ -0,0 +1,26 @@
<?php
/**************************************************************************\
* eGroupWare - Setup *
* http://www.eGroupWare.org *
* Created by eTemplates DB-Tools written by ralfbecker@outdoor-training.de *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
$test[] = '0.1.001';
function timesheet_upgrade0_1_001()
{
$GLOBALS['egw_setup']->oProc->AddColumn('egw_timesheet','pl_id',array(
'type' => 'int',
'precision' => '4',
'default' => '0'
));
return $GLOBALS['setup_info']['timesheet']['currentver'] = '0.2.001';
}
?>

View File

@ -52,7 +52,7 @@
<column/>
</columns>
<rows>
<row class="th" disabled="@status_only">
<row class="th" disabled="@view">
<description span="all" value="Create new links"/>
</row>
<row class="row" disabled="@status_only">
@ -67,7 +67,7 @@
</rows>
</grid>
</template>
<template id="timesheet.edit" template="" lang="" group="0" version="0.1.001">
<template id="timesheet.edit" template="" lang="" group="0" version="0.2.001">
<grid width="100%">
<columns>
<column width="100"/>
@ -86,11 +86,17 @@
</row>
<row class="row">
<description options=",,,ts_project" value="Project"/>
<textbox size="65" maxlength="80" id="ts_project" span="all" blur="@ts_project_blur"/>
<vbox span="all">
<projectmanager-select options="None" id="pm_id" span="all" statustext="Select a project" onchange="1"/>
<textbox id="ts_project" blur="@ts_project_blur" size="65" maxlength="80"/>
</vbox>
</row>
<row class="row">
<description options=",,ts_unitprice" value="Unitprice"/>
<textbox type="float" id="ts_unitprice" span="all"/>
<hbox span="all">
<projectmanager-pricelist id="pl_id" options="None" onchange="this.form['exec[ts_unitprice]'].value=this.options[this.selectedIndex].text.lastIndexOf('(') &lt; 0 ? '' : this.options[this.selectedIndex].text.slice(this.options[this.selectedIndex].text.lastIndexOf('(')+1,-1);"/>
<textbox type="float" id="ts_unitprice" span="all"/>
</hbox>
</row>
<row>
<tabbox span="all">
@ -130,5 +136,6 @@
</row>
</rows>
</grid>
<styles>.width100 { width: 100%; }</styles>
</template>
</overlay>