[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: projects/inc class.bodeliveries.inc.php,1.16,1.1
From: |
Bettina Gille <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: projects/inc class.bodeliveries.inc.php,1.16,1.17 class.boprojecthours.inc.php,1.9,1.10class.boprojects.inc.php,1.50,1.51 class.sobilling.inc.php,1.13,1.14class.sodeliveries.inc.php,1.17,1.18 class.soprojecthours.inc.php,1.9,1.10class.soprojects.inc.php,1.41,1.42 class.sostatistics.inc.php,1.8,1.9class.uibilling.inc.php,1.29,1.30 class.uideliveries.inc.php,1.29,1.30class.uiprojecthours.inc.php,1.30,1.31 class.uiprojects.inc.php,1.63,1.64class.uistatistics.inc.php,1.17,1.18 hook_add_def_pref.inc.php,1.4,1.5hook_deleteaccount.inc.php,1.3,1.4 |
Date: |
Tue, 17 Jun 2003 08:39:19 -0400 |
Update of /cvsroot/phpgroupware/projects/inc
In directory subversions:/tmp/cvs-serv24216/inc
Modified Files:
class.bodeliveries.inc.php class.boprojecthours.inc.php
class.boprojects.inc.php class.sobilling.inc.php
class.sodeliveries.inc.php class.soprojecthours.inc.php
class.soprojects.inc.php class.sostatistics.inc.php
class.uibilling.inc.php class.uideliveries.inc.php
class.uiprojecthours.inc.php class.uiprojects.inc.php
class.uistatistics.inc.php hook_add_def_pref.inc.php
hook_deleteaccount.inc.php
Log Message:
update
Index: class.bodeliveries.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.bodeliveries.inc.php,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -r1.16 -r1.17
Index: class.boprojecthours.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.boprojecthours.inc.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** class.boprojecthours.inc.php 18 Apr 2003 23:48:41 -0000 1.9
--- class.boprojecthours.inc.php 17 Jun 2003 12:39:16 -0000 1.10
***************
*** 54,58 ****
}
! global $start, $query, $filter, $order, $sort, $state;
if(isset($start)) { $this->start = $start; }
--- 54,65 ----
}
! $start = get_var('start',array('POST','GET'));
! $query = get_var('query',array('POST','GET'));
! $sort = get_var('sort',array('POST','GET'));
! $order = get_var('order',array('POST','GET'));
! $state = get_var('state',array('POST','GET'));
! $filter = get_var('filter',array('POST','GET'));
! $project_id =
get_var('project_id',array('POST','GET'));
!
if(isset($start)) { $this->start = $start; }
***************
*** 62,65 ****
--- 69,73 ----
if(isset($order)) { $this->order = $order; }
if(isset($state)) { $this->state = $state; }
+ if(isset($project_id)) { $this->project_id =
$project_id; }
}
***************
*** 82,85 ****
--- 90,94 ----
$this->sort = $data['sort'];
$this->state = $data['state'];
+ $this->project_id = $data['project_id'];
}
***************
*** 225,234 ****
}
! if ($values['hours_id'])
{
! if ($values['hours_id'] != 0)
! {
!
$this->soprojecthours->edit_hours($values);
! }
}
else
--- 234,240 ----
}
! if ($values['hours_id'] && $values['hours_id'] != 0)
{
! $this->soprojecthours->edit_hours($values);
}
else
Index: class.boprojects.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.boprojects.inc.php,v
retrieving revision 1.50
retrieving revision 1.51
diff -C2 -r1.50 -r1.51
*** class.boprojects.inc.php 26 Apr 2003 01:22:39 -0000 1.50
--- class.boprojects.inc.php 17 Jun 2003 12:39:16 -0000 1.51
***************
*** 7,11 ****
* Written by Bettina Gille address@hidden *
* ----------------------------------------------- *
! * Copyright (C) 2000,2001,2002 Bettina Gille *
* *
* This program is free software; you can redistribute it and/or *
--- 7,11 ----
* Written by Bettina Gille address@hidden *
* ----------------------------------------------- *
! * Copyright (C) 2000 - 2003 Bettina Gille *
* *
* This program is free software; you can redistribute it and/or *
***************
*** 70,75 ****
function boprojects($session=False, $action = '')
{
! $this->soprojects =
CreateObject('projects.soprojects');
! $this->contacts =
CreateObject('phpgwapi.contacts');
if ($session)
--- 70,76 ----
function boprojects($session=False, $action = '')
{
! $this->so =
CreateObject('projects.soprojects');
! $this->sohours =
CreateObject('projects.soprojecthours');
! $this->contacts = CreateObject('phpgwapi.contacts');
if ($session)
***************
*** 87,103 ****
$status = get_var('status',array('POST','GET'));
! if(isset($start)) { $this->start = $start; }
if(isset($query)) { $this->query = $query; }
if(!empty($filter)) { $this->filter = $filter; }
if(isset($sort)) { $this->sort = $sort; }
if(isset($order)) { $this->order = $order; }
! if(isset($cat_id)) { $this->cat_id = $cat_id; }
!
! if ($cat_id == 'none')
{
! $this->cat_id = '';
}
-
- if(isset($status)) { $this->status = $status; }
}
--- 88,110 ----
$status = get_var('status',array('POST','GET'));
! if(!empty($start) || ($start == '0') || ($start == 0))
! {
! if($this->debug) { echo '<br>overriding $start:
"' . $this->start . '" now "' . $start . '"'; }
! $this->start = $start;
! }
!
if(isset($query)) { $this->query = $query; }
if(!empty($filter)) { $this->filter = $filter; }
if(isset($sort)) { $this->sort = $sort; }
if(isset($order)) { $this->order = $order; }
! if(isset($status)) { $this->status = $status; }
! if(isset($cat_id) && !empty($cat_id))
{
! $this->cat_id = $cat_id;
! }
! if($cat_id == '0' || $cat_id == 0 || $cat_id == 'none'
|| $cat_id == '')
! {
! unset($this->cat_id);
}
}
***************
*** 162,165 ****
--- 169,187 ----
}
+ function return_date()
+ {
+ $date = array
+ (
+ 'month' =>
$GLOBALS['phpgw']->common->show_date(time(),'n'),
+ 'day' =>
$GLOBALS['phpgw']->common->show_date(time(),'d'),
+ 'year' =>
$GLOBALS['phpgw']->common->show_date(time(),'Y')
+ );
+
+ $date['daydate'] =
mktime(2,0,0,$date['month'],$date['day'],$date['year']);
+ $date['monthdate'] =
mktime(2,0,0,$date['month']+2,0,$date['year']);
+ $date['monthformatted'] =
$GLOBALS['phpgw']->common->show_date($date['monthdate'],'n/Y');
+ return $date;
+ }
+
function read_abook($start, $query, $qfilter, $sort, $order)
{
***************
*** 181,192 ****
'org_name' => 'org_name');
! $entry =
$this->contacts->read_single_entry($abid,$cols);
! return $entry;
}
function return_value($action,$item)
{
! $thing = $this->soprojects->return_value($action,$item);
! return $thing;
}
--- 203,217 ----
'org_name' => 'org_name');
! return $this->contacts->read_single_entry($abid,$cols);
}
function return_value($action,$item)
{
! return $this->so->return_value($action,$item);
! }
!
! function list_pcosts($project_id)
! {
! return $this->so->list_pcosts($project_id);
}
***************
*** 242,246 ****
if (! isset($prefs['country']) || (!
isset($prefs['currency'])))
{
! $error[] = lang('Please set your global
preferences');
}
--- 267,271 ----
if (! isset($prefs['country']) || (!
isset($prefs['currency'])))
{
! $error[] = lang('please specify country and
currency in the global preferences section');
}
***************
*** 249,253 ****
if (! isset($prefs['abid']) || (!
isset($prefs['tax'])) || (! isset($prefs['bill'])) || (!
isset($prefs['ifont'])) || (! isset($prefs['mysize'])) || (!
isset($prefs['allsize'])))
{
! $error[] = lang('Please set your
preferences for this application');
}
}
--- 274,279 ----
if (! isset($prefs['abid']) || (!
isset($prefs['tax'])) || (! isset($prefs['bill'])) || (!
isset($prefs['ifont'])) || (! isset($prefs['mysize'])) || (!
isset($prefs['allsize'])))
{
! $error[] = lang('if you are an
administrator, please set the preferences for this application');
! $error[] = lang('if you are not an
administrator, please inform the administrator to set the preferences for this
application');
}
}
***************
*** 288,293 ****
function read_admins($action, $type)
{
! $admins = $this->soprojects->return_admins($action,
$type);
! $this->total_records = $this->soprojects->total_records;
return $admins;
}
--- 314,319 ----
function read_admins($action, $type)
{
! $admins = $this->so->return_admins($action, $type);
! $this->total_records = $this->so->total_records;
return $admins;
}
***************
*** 296,316 ****
{
$admins = $this->read_admins($action, 'all');
-
$allaccounts =
$GLOBALS['phpgw']->accounts->get_list($type, $start, $sort, $order, $query);
! if (is_array($allaccounts))
{
! while (list($null,$account) =
each($allaccounts))
{
! for ($i=0;$i<count($admins);$i++)
{
! if ($account['account_id'] ==
$admins[$i]['account_id'])
! {
!
$admin_data[$i]['account_id'] = $account['account_id'];
! $admin_data[$i]['lid']
= $account['account_lid'];
!
$admin_data[$i]['firstname'] = $account['account_firstname'];
!
$admin_data[$i]['lastname'] = $account['account_lastname'];
! $admin_data[$i]['type']
= $account['account_type'];
! }
}
}
--- 322,340 ----
{
$admins = $this->read_admins($action, 'all');
$allaccounts =
$GLOBALS['phpgw']->accounts->get_list($type, $start, $sort, $order, $query);
! $j = 0;
! while (is_array($allaccounts) && list($null,$account) =
each($allaccounts))
{
! for ($i=0;$i<count($admins);$i++)
{
! if ($account['account_id'] ==
$admins[$i]['account_id'])
{
! $admin_data[$j]['account_id']
= $account['account_id'];
! $admin_data[$j]['lid']
= $account['account_lid'];
! $admin_data[$j]['firstname']
= $account['account_firstname'];
! $admin_data[$j]['lastname']
= $account['account_lastname'];
! $admin_data[$j]['type']
= $account['account_type'];
! $j++;
}
}
***************
*** 350,354 ****
function edit_admins($action, $users, $groups)
{
! $this->soprojects->edit_admins($action, $users,
$groups);
}
--- 374,378 ----
function edit_admins($action, $users, $groups)
{
! $this->so->edit_admins($action, $users, $groups);
}
***************
*** 357,365 ****
if ($action == 'pad')
{
! $admin =
$this->soprojects->isprojectadmin($action);
}
else
{
! $admin =
$this->soprojects->isbookkeeper($action);
}
return $admin;
--- 381,389 ----
if ($action == 'pad')
{
! $admin = $this->so->isprojectadmin($action);
}
else
{
! $admin = $this->so->isbookkeeper($action);
}
return $admin;
***************
*** 368,385 ****
function list_projects($start, $limit, $query, $filter, $sort,
$order, $status, $cat_id, $type, $pro_parent)
{
! $pro_list = $this->soprojects->read_projects($start,
$limit, $query, $filter, $sort, $order, $status, $cat_id, $type, $pro_parent);
! $this->total_records = $this->soprojects->total_records;
! return $pro_list;
}
function read_single_project($project_id)
{
! $single_pro =
$this->soprojects->read_single_project($project_id);
! return $single_pro;
}
function read_single_activity($activity_id)
{
! $single_act =
$this->soprojects->read_single_activity($activity_id);
return $single_act;
}
--- 392,500 ----
function list_projects($start, $limit, $query, $filter, $sort,
$order, $status, $cat_id, $type, $pro_parent)
{
! $pro_list = $this->so->read_projects($start, $limit,
$query, $filter, $sort, $order, $status, $cat_id, $type, $pro_parent);
!
! while (is_array($pro_list) &&
list(,$pro)=each($pro_list))
! {
! $cached_data =
$this->cached_accounts($pro['coordinator']);
! $coordinatorout =
$GLOBALS['phpgw']->strip_html($cached_data[$pro['coordinator']]['account_lid']
! . ' [' .
$cached_data[$pro['coordinator']]['firstname'] . ' '
! .
$cached_data[$pro['coordinator']]['lastname'] . ' ]');
! if ($pro['customer'])
! {
! $customer =
$this->read_single_contact($pro['customer']);
! if ($customer[0]['org_name'] == '') { $customerout =
$customer[0]['n_given'] . ' ' . $customer[0]['n_family']; }
! else { $customerout = $customer[0]['org_name'] . ' [ '
. $customer[0]['n_given'] . ' ' . $customer[0]['n_family'] . ' ]'; }
! }
!
! $pro['sdate'] = $pro['sdate'] + (60*60) *
$GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'];
! $sdateout =
$GLOBALS['phpgw']->common->show_date($pro['sdate'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
!
! $projects[] = array
! (
! 'project_id' =>
$pro['project_id'],
! 'parent' =>
$pro['parent'],
! 'coordinator' =>
$pro['coordinator'],
! 'coordinatorout' =>
$coordinatorout,
! 'customerout' => $customerout,
! 'title' =>
$GLOBALS['phpgw']->strip_html($pro['title']),
! 'number' =>
$GLOBALS['phpgw']->strip_html($pro['number']),
! 'investment_nr' =>
$GLOBALS['phpgw']->strip_html($pro['investment_nr']),
! 'descr' =>
$GLOBALS['phpgw']->strip_html($pro['descr']),
! 'sdateout' =>
$sdateout,
! 'budget' =>
$pro['budget'],
! 'pcosts' =>
$pro['pcosts'],
! 'edate' =>
$pro['edate'],
! 'status' =>
$pro['status']
! );
! }
!
! $this->total_records = $this->so->total_records;
! return $projects;
}
function read_single_project($project_id)
{
! $pro = $this->so->read_single_project($project_id);
!
! $project = array
! (
! 'utime' =>
$this->sohours->get_time_used($project_id),
! 'phours' =>
($pro['ptime']/60),
! 'title' =>
$GLOBALS['phpgw']->strip_html($pro['title']),
! 'number' =>
$GLOBALS['phpgw']->strip_html($pro['number']),
! 'investment_nr' =>
$GLOBALS['phpgw']->strip_html($pro['investment_nr']),
! 'descr' =>
$GLOBALS['phpgw']->strip_html($pro['descr']),
! 'budget' =>
$pro['budget'],
! 'pcosts' =>
$pro['pcosts'],
! 'project_id' => $pro['project_id'],
! 'parent' =>
$pro['parent'],
! 'cat' => $pro['cat'],
! 'access' =>
$pro['access'],
! 'coordinator' => $pro['coordinator'],
! 'customer' =>
$pro['customer'],
! 'status' =>
$pro['status'],
! 'owner' =>
$pro['owner'],
! 'processor' =>
$pro['processor']
! );
!
! if ($project['utime'] > 0)
! {
! $project['uhours'] = ($project['utime']/60);
! }
! else
! {
! $project['uhours'] = 0;
! }
!
! if ($pro['edate'] == 0)
! {
! $project['edate_formatted'] = ' ';
! }
! else
! {
! $project['edate'] = $pro['edate'] + (60*60) *
$GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'];
! $project['edate_formatted'] =
$GLOBALS['phpgw']->common->show_date($pro['edate'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
! }
!
! $project['sdate'] = $pro['sdate'] + (60*60) *
$GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'];
! $project['sdate_formatted'] =
$GLOBALS['phpgw']->common->show_date($pro['sdate'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
!
! $project['udate'] = $pro['udate'] + (60*60) *
$GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'];
! $project['udate_formatted'] =
$GLOBALS['phpgw']->common->show_date($pro['udate'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
!
! $project['cdate'] = $pro['cdate'] + (60*60) *
$GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'];
! $project['cdate_formatted'] =
$GLOBALS['phpgw']->common->show_date($pro['cdate'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
!
! return $project;
! }
!
! function sum_budget($action = 'budget')
! {
! return $this->so->sum_budget($action);
}
function read_single_activity($activity_id)
{
! $single_act =
$this->so->read_single_activity($activity_id);
return $single_act;
}
***************
*** 387,391 ****
function exists($action, $check, $num, $pa_id)
{
! $exists = $this->soprojects->exists($action, $check ,
$num, $pa_id);
if ($exists)
{
--- 502,506 ----
function exists($action, $check, $num, $pa_id)
{
! $exists = $this->so->exists($action, $check , $num,
$pa_id);
if ($exists)
{
***************
*** 400,405 ****
function list_activities($start, $limit, $query, $sort, $order,
$cat_id)
{
! $act_list = $this->soprojects->read_activities($start,
$limit, $query, $sort, $order, $cat_id);
! $this->total_records = $this->soprojects->total_records;
return $act_list;
}
--- 515,520 ----
function list_activities($start, $limit, $query, $sort, $order,
$cat_id)
{
! $act_list = $this->so->read_activities($start, $limit,
$query, $sort, $order, $cat_id);
! $this->total_records = $this->so->total_records;
return $act_list;
}
***************
*** 407,411 ****
function activities_list($project_id, $billable)
{
! $activities_list =
$this->soprojects->activities_list($project_id, $billable);
return $activities_list;
}
--- 522,526 ----
function activities_list($project_id, $billable)
{
! $activities_list =
$this->so->activities_list($project_id, $billable);
return $activities_list;
}
***************
*** 413,417 ****
function select_activities_list($project_id, $billable)
{
! $activities_list =
$this->soprojects->select_activities_list($project_id, $billable);
return $activities_list;
}
--- 528,532 ----
function select_activities_list($project_id, $billable)
{
! $activities_list =
$this->so->select_activities_list($project_id, $billable);
return $activities_list;
}
***************
*** 419,423 ****
function select_pro_activities($project_id, $pro_parent,
$billable)
{
! $activities_list =
$this->soprojects->select_pro_activities($project_id, $pro_parent, $billable);
return $activities_list;
}
--- 534,538 ----
function select_pro_activities($project_id, $pro_parent,
$billable)
{
! $activities_list =
$this->so->select_pro_activities($project_id, $pro_parent, $billable);
return $activities_list;
}
***************
*** 425,429 ****
function select_hours_activities($project_id, $act)
{
! $activities_list =
$this->soprojects->select_hours_activities($project_id, $act);
return $activities_list;
}
--- 540,544 ----
function select_hours_activities($project_id, $act)
{
! $activities_list =
$this->so->select_hours_activities($project_id, $act);
return $activities_list;
}
***************
*** 436,445 ****
}
if (strlen($values['title']) >= 255)
{
! $error[] = lang('Title can not exceed 255
characters in length !');
}
! if (! $values['choose'])
{
if (! $values['number'])
--- 551,565 ----
}
+ if (!$values['coordinator'])
+ {
+ $error[] = lang('please choose a project
coordinator');
+ }
+
if (strlen($values['title']) >= 255)
{
! $error[] = lang('title can not exceed 255
characters in length');
}
! if (!$values['choose'])
{
if (! $values['number'])
***************
*** 458,462 ****
if (strlen($values['number']) > 25)
{
! $error[] = lang('ID can not
exceed 25 characters in length !');
}
}
--- 578,582 ----
if (strlen($values['number']) > 25)
{
! $error[] = lang('id can not
exceed 25 characters in length');
}
}
***************
*** 465,469 ****
if ((! $book_activities) && (! $bill_activities))
{
! $error[] = lang('Please choose activities for
that project first !');
}
--- 585,589 ----
if ((! $book_activities) && (! $bill_activities))
{
! $error[] = lang('please choose activities for
the project');
}
***************
*** 484,491 ****
}
! /* if ($values['edate'] < $values['sdate'] &&
$values['edate'] && $values['sdate'])
{
! $error[] = lang('Ending date can not be before
start date');
! } */
if ($action == 'subs')
--- 604,622 ----
}
! if ($action == 'mains')
{
! if ((!$values['budget'] || $values['budget'] ==
0) && $values['pcosts'])
! {
! $error[] = lang('please specify the
budget');
! }
!
! if (($values['budget'] && $values['budget'] >
0) && ($values['pcosts'] && $values['pcosts'] > 0))
! {
! if ($values['pcosts'] >
$values['budget'])
! {
! $error[] = lang('pcosts can not
be higher than the budget');
! }
! }
! }
if ($action == 'subs')
***************
*** 499,503 ****
if ($checkdate > $main_edate)
{
! $error[] = lang('Ending date
can not be after main projects ending date !');
}
}
--- 630,634 ----
if ($checkdate > $main_edate)
{
! $error[] = lang('ending date
can not be after main projects ending date');
}
}
***************
*** 511,517 ****
if ($checkdate < $main_sdate)
{
! $error[] = lang('Start date can
not be before main projects start date !');
}
}
}
--- 642,666 ----
if ($checkdate < $main_sdate)
{
! $error[] = lang('start date can
not be before main projects start date');
}
}
+
+ $ptime_parent =
$this->so->return_value('ptime',$values['parent']);
+ $sum_ptime =
$this->so->get_planned_value(array('action' => 'tparent','parent_id' =>
$values['parent']
+
,'project_id' =>
$values['project_id']));
+ $pminutes = intval($values['ptime'])*60;
+
+ if (($pminutes+$sum_ptime) > $ptime_parent)
+ {
+ $error[] = lang('planned time sum of
all sub projects is bigger than the planned time of the main project');
+ }
+
+ $budget_parent =
$this->so->return_value('budget',$values['parent']);
+ $sum_budget =
$this->so->get_planned_value(array('action' => 'bparent','parent_id' =>
$values['parent']
+
,'project_id' =>
$values['project_id']));
+ if (($values['budget']+$sum_budget) >
$budget_parent)
+ {
+ $error[] = lang('budget sum of all sub
projects is bigger than the budget of the main project');
+ }
}
***************
*** 546,550 ****
if (strlen($values['number']) >= 20)
{
! $error[] = lang('ID can not
exceed 19 characters in length !');
}
}
--- 695,699 ----
if (strlen($values['number']) >= 20)
{
! $error[] = lang('id can not
exceed 19 characters in length');
}
}
***************
*** 553,557 ****
if ((! $values['billperae']) || ($values['billperae']
== 0))
{
! $error[] = lang('Please enter the bill !');
}
--- 702,706 ----
if ((! $values['billperae']) || ($values['billperae']
== 0))
{
! $error[] = lang('please enter the bill');
}
***************
*** 560,564 ****
if ((! $values['minperae']) ||
($values['minperae'] == 0))
{
! $error[] = lang('Please enter the
minutes per workunit !');
}
}
--- 709,713 ----
if ((! $values['minperae']) ||
($values['minperae'] == 0))
{
! $error[] = lang('please enter the
minutes per workunit');
}
}
***************
*** 576,584 ****
if ($action == 'mains')
{
! $values['number'] =
$this->soprojects->create_projectid();
}
else
{
! $values['number'] =
$this->soprojects->create_jobid($values['parent']);
}
}
--- 725,733 ----
if ($action == 'mains')
{
! $values['number'] =
$this->so->create_projectid();
}
else
{
! $values['number'] =
$this->so->create_jobid($values['parent']);
}
}
***************
*** 593,600 ****
}
! if (!$values['budget'])
! {
! $values['budget'] = 0;
! }
if ($values['smonth'] || $values['sday'] ||
$values['syear'])
--- 742,749 ----
}
! $month = $this->return_date();
! $values['monthdate'] = $month['monthdate'];
!
! $values['ptime'] = intval($values['ptime'])*60;
if ($values['smonth'] || $values['sday'] ||
$values['syear'])
***************
*** 613,626 ****
}
if ($values['project_id'])
{
if ($values['project_id'] != 0)
{
!
$this->soprojects->edit_project($values, $book_activities, $bill_activities);
}
}
else
{
! $this->soprojects->add_project($values,
$book_activities, $bill_activities);
}
}
--- 762,778 ----
}
+ //_debug_array($values);
+
if ($values['project_id'])
{
if ($values['project_id'] != 0)
{
! $this->so->edit_project($values,
$book_activities, $bill_activities);
! return $values['project_id'];
}
}
else
{
! return $this->so->add_project($values,
$book_activities, $bill_activities);
}
}
***************
*** 630,641 ****
if ($values['choose'])
{
! $values['number'] =
$this->soprojects->create_activityid();
}
if ($values['activity_id'])
{
! if ($values['activity_id'] != 0)
{
!
$this->soprojects->edit_activity($values);
if ($values['minperae'])
--- 782,793 ----
if ($values['choose'])
{
! $values['number'] =
$this->so->create_activityid();
}
if ($values['activity_id'])
{
! if ($values['activity_id'] &&
intval($values['activity_id']) > 0)
{
! $this->so->edit_activity($values);
if ($values['minperae'])
***************
*** 648,652 ****
else
{
! $this->soprojects->add_activity($values);
}
}
--- 800,804 ----
else
{
! $this->so->add_activity($values);
}
}
***************
*** 654,658 ****
function select_project_list($type, $status, $project_id)
{
! $list = $this->soprojects->select_project_list($type,
$status, $project_id);
return $list;
}
--- 806,810 ----
function select_project_list($type, $status, $project_id)
{
! $list = $this->so->select_project_list($type, $status,
$project_id);
return $list;
}
***************
*** 662,670 ****
if ($action == 'account')
{
!
$this->soprojects->delete_account_project_data($pa_id);
}
else
{
! $this->soprojects->delete_pa($action, $pa_id,
$subs);
}
}
--- 814,822 ----
if ($action == 'account')
{
! $this->so->delete_account_project_data($pa_id);
}
else
{
! $this->so->delete_pa($action, $pa_id, $subs);
}
}
***************
*** 672,676 ****
function change_owner($old, $new)
{
! $this->soprojects->change_owner($old, $new);
}
}
--- 824,828 ----
function change_owner($old, $new)
{
! $this->so->change_owner($old, $new);
}
}
Index: class.sobilling.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.sobilling.inc.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** class.sobilling.inc.php 18 Apr 2003 23:48:42 -0000 1.13
--- class.sobilling.inc.php 17 Jun 2003 12:39:16 -0000 1.14
***************
*** 7,11 ****
* Written by Bettina Gille address@hidden *
* ----------------------------------------------- *
! * Copyright (C) 2000,2001,2002 Bettina Gille *
* *
* This program is free software; you can redistribute it and/or *
--- 7,11 ----
* Written by Bettina Gille address@hidden *
* ----------------------------------------------- *
! * Copyright (C) 2000 - 2003 Bettina Gille *
* *
* This program is free software; you can redistribute it and/or *
***************
*** 32,37 ****
function sobilling()
{
! $this->db = $GLOBALS['phpgw']->db;
! $this->db2 = $this->db;
}
--- 32,37 ----
function sobilling()
{
! $this->db = $GLOBALS['phpgw']->db;
! $this->db2 = $this->db;
}
***************
*** 42,47 ****
switch ($dbtype)
{
! case 'pgsql': $join = " JOIN "; break;
! case 'mysql': $join = " LEFT JOIN "; break;
}
return $join;
--- 42,47 ----
switch ($dbtype)
{
! case 'pgsql': $join = ' JOIN '; break;
! case 'mysql': $join = ' LEFT JOIN '; break;
}
return $join;
***************
*** 50,53 ****
--- 50,55 ----
function read_invoices($start, $query = '', $sort = '', $order
= '', $limit = True, $project_id = '')
{
+ $project_id = intval($project_id);
+
if ($order)
{
***************
*** 56,78 ****
else
{
! $ordermethod = " order by date asc";
}
if ($query)
{
! $querymethod = " AND (phpgw_p_invoice.num like
'%$query%' OR title like '%$query%' "
! . "OR sum like
'%$query%') ";
}
if ($project_id)
{
! $sql = "SELECT phpgw_p_invoice.id as
id,phpgw_p_invoice.num,title,phpgw_p_invoice.date,sum,phpgw_p_invoice.project_id,"
! . "phpgw_p_invoice.customer FROM
phpgw_p_invoice,phpgw_p_projects WHERE
phpgw_p_invoice.project_id=phpgw_p_projects.id "
! . "AND phpgw_p_projects.id='$project_id' AND
phpgw_p_invoice.project_id='$project_id'";
}
else
{
! $sql = "SELECT phpgw_p_invoice.id as
id,phpgw_p_invoice.num,title,phpgw_p_invoice.date,sum,phpgw_p_invoice.project_id,"
! . "phpgw_p_invoice.customer FROM
phpgw_p_invoice,phpgw_p_projects WHERE
phpgw_p_invoice.project_id=phpgw_p_projects.id";
}
--- 58,79 ----
else
{
! $ordermethod = ' order by date asc';
}
if ($query)
{
! $querymethod = " AND (phpgw_p_invoice.num like
'%$query%' OR title like '%$query%' " . "OR sum like '%$query%') ";
}
if ($project_id)
{
! $sql = 'SELECT phpgw_p_invoice.id as
id,phpgw_p_invoice.num,title,phpgw_p_invoice.date,sum,phpgw_p_invoice.project_id,'
! . 'phpgw_p_invoice.customer FROM
phpgw_p_invoice,phpgw_p_projects WHERE
phpgw_p_invoice.project_id=phpgw_p_projects.id '
! . 'AND phpgw_p_projects.id=' . $project_id . '
AND phpgw_p_invoice.project_id=' . $project_id;
}
else
{
! $sql = 'SELECT phpgw_p_invoice.id as
id,phpgw_p_invoice.num,title,phpgw_p_invoice.date,sum,phpgw_p_invoice.project_id,'
! . 'phpgw_p_invoice.customer FROM
phpgw_p_invoice,phpgw_p_projects WHERE
phpgw_p_invoice.project_id=phpgw_p_projects.id';
}
***************
*** 107,113 ****
function exists($values)
{
if ($values['invoice_id'] && ($values['invoice_id'] !=
0))
{
! $editexists = " and id != '" .
$values['invoice_id'] . "'";
}
--- 108,116 ----
function exists($values)
{
+ $values['invoice_id'] = intval($values['invoice_id']);
+
if ($values['invoice_id'] && ($values['invoice_id'] !=
0))
{
! $editexists = ' and id !=' .
$values['invoice_id'];
}
***************
*** 129,146 ****
{
$values['invoice_num'] =
$this->db->db_addslashes($values['invoice_num']);
! $this->db->query("INSERT INTO phpgw_p_invoice
(num,sum,project_id,customer,date) VALUES ('" . $values['invoice_num'] . "',0,'"
! . $values['project_id']
. "','" . $values['customer'] . "','" . $values['date'] .
"')",__LINE__,__FILE__);
$this->db2->query("SELECT id from phpgw_p_invoice WHERE
num='" . $values['invoice_num'] . "'",__LINE__,__FILE__);
$this->db2->next_record();
$invoice_id = $this->db2->f('id');
! while($select && $entry=each($select))
{
! $this->db->query("INSERT INTO
phpgw_p_invoicepos (invoice_id,hours_id) VALUES ('" . $invoice_id . "','" .
$entry[0] . "')",__LINE__,__FILE__);
! $this->db2->query("UPDATE phpgw_p_hours SET
status='billed' WHERE id='" . $entry[0] . "'",__LINE__,__FILE__);
}
! $this->db->query("SELECT billperae,minutes,minperae
FROM phpgw_p_hours,phpgw_p_invoicepos "
! ."WHERE
phpgw_p_invoicepos.invoice_id='" . $invoice_id . "' AND
phpgw_p_hours.id=phpgw_p_invoicepos.hours_id",__LINE__,__FILE__);
while ($this->db->next_record())
{
--- 132,151 ----
{
$values['invoice_num'] =
$this->db->db_addslashes($values['invoice_num']);
! $this->db->query("INSERT INTO phpgw_p_invoice
(num,sum,project_id,customer,date) VALUES ('" . $values['invoice_num'] . "',0,"
! .
intval($values['project_id']) . ',' . intval($values['customer']) . ',' .
intval($values['date']) . ')',__LINE__,__FILE__);
!
$this->db2->query("SELECT id from phpgw_p_invoice WHERE
num='" . $values['invoice_num'] . "'",__LINE__,__FILE__);
$this->db2->next_record();
$invoice_id = $this->db2->f('id');
+ $invoice_id = intval($invoice_id);
! while(is_array($select) && $entry=each($select))
{
! $this->db->query('INSERT INTO
phpgw_p_invoicepos (invoice_id,hours_id) VALUES (' . $invoice_id . ',' .
intval($entry[0]) . ')',__LINE__,__FILE__);
! $this->db2->query("UPDATE phpgw_p_hours SET
status='billed' WHERE id=" . intval($entry[0]),__LINE__,__FILE__);
}
! $this->db->query('SELECT billperae,minutes,minperae
FROM phpgw_p_hours,phpgw_p_invoicepos '
! .'WHERE
phpgw_p_invoicepos.invoice_id=' . $invoice_id . ' AND
phpgw_p_hours.id=phpgw_p_invoicepos.hours_id',__LINE__,__FILE__);
while ($this->db->next_record())
{
***************
*** 158,162 ****
}
}
! $this->db->query("UPDATE phpgw_p_invoice SET
sum=round(" . $sum_sum . ",2) WHERE id='" . $invoice_id .
"'",__LINE__,__FILE__);
return $invoice_id;
}
--- 163,167 ----
}
}
! $this->db->query('UPDATE phpgw_p_invoice SET
sum=round(' . $sum_sum . ',2) WHERE id=' . $invoice_id,__LINE__,__FILE__);
return $invoice_id;
}
***************
*** 164,183 ****
function update_invoice($values,$select)
{
! $values['invoice_num'] =
$this->db->db_addslashes($values['invoice_num']);
! $this->db->query("UPDATE phpgw_p_invoice set num='" .
$values['invoice_num'] . "',date='" . $values['date'] . "',customer='"
! . $values['customer'] .
"' WHERE id='" . $values['invoice_id'] . "'",__LINE__,__FILE__);
! $this->db2->query("DELETE FROM phpgw_p_invoicepos WHERE
invoice_id='" . $values['invoice_id'] . "'",__LINE__,__FILE__);
! while($select && $entry=each($select))
{
! $this->db->query("INSERT INTO
phpgw_p_invoicepos (invoice_id,hours_id) VALUES ('" . $values['invoice_id'] .
"','"
! . $entry[0] .
"')",__LINE__,__FILE__);
! $this->db2->query("UPDATE phpgw_p_hours SET
status='billed' WHERE id='" . $entry[0] . "'",__LINE__,__FILE__);
}
! $this->db->query("SELECT billperae,minutes,minperae
FROM phpgw_p_hours,phpgw_p_invoicepos "
! ."WHERE
phpgw_p_invoicepos.invoice_id='" . $values['invoice_id'] . "' AND
phpgw_p_hours.id="
! .
"phpgw_p_invoicepos.hours_id",__LINE__,__FILE__);
while($this->db->next_record())
--- 169,190 ----
function update_invoice($values,$select)
{
! $values['invoice_num'] =
$this->db->db_addslashes($values['invoice_num']);
! $values['invoice_id'] = intval($values['invoice_id']);
! $this->db->query("UPDATE phpgw_p_invoice set num='" .
$values['invoice_num'] . "',date=" . intval($values['date']) . ',customer='
! .
intval($values['customer']) . ' WHERE id=' .
$values['invoice_id'],__LINE__,__FILE__);
! $this->db2->query('DELETE FROM phpgw_p_invoicepos WHERE
invoice_id=' . $values['invoice_id'],__LINE__,__FILE__);
!
! while(is_array($select) && $entry=each($select))
{
! $this->db->query('INSERT INTO
phpgw_p_invoicepos (invoice_id,hours_id) VALUES (' . $values['invoice_id'] . ','
! .
intval($entry[0]) . ')',__LINE__,__FILE__);
! $this->db2->query("UPDATE phpgw_p_hours SET
status='billed' WHERE id=" . intval($entry[0]),__LINE__,__FILE__);
}
! $this->db->query('SELECT billperae,minutes,minperae
FROM phpgw_p_hours,phpgw_p_invoicepos '
! .'WHERE
phpgw_p_invoicepos.invoice_id=' . $values['invoice_id'] . ' AND
phpgw_p_hours.id='
! .
'phpgw_p_invoicepos.hours_id',__LINE__,__FILE__);
while($this->db->next_record())
***************
*** 197,220 ****
}
! $this->db2->query("UPDATE phpgw_p_invoice SET
sum=round(" . $sum_sum . ",2) WHERE id='" . $values['invoice_id'] .
"'",__LINE__,__FILE__);
}
function read_hours($project_id, $action)
{
! $ordermethod = " order by end_date asc";
if ($action == 'mains')
{
! $parent_hours = " OR
phpgw_p_hours.pro_parent='" . $project_id . "'";
}
! $this->db->query("SELECT phpgw_p_hours.id as
id,phpgw_p_hours.hours_descr,phpgw_p_activities.descr,phpgw_p_hours.status, "
! .
"phpgw_p_hours.start_date,phpgw_p_hours.end_date,phpgw_p_hours.minutes,phpgw_p_hours.minperae,phpgw_p_hours.billperae,"
! . "phpgw_p_hours.employee FROM
phpgw_p_hours " . $this->return_join() . " phpgw_p_activities ON "
! .
"phpgw_p_hours.activity_id=phpgw_p_activities.id " . $this->return_join() . "
phpgw_p_projectactivities ON "
.
"phpgw_p_hours.activity_id=phpgw_p_projectactivities.activity_id WHERE
(phpgw_p_hours.status='done' OR "
! .
"phpgw_p_hours.status='closed') AND (phpgw_p_hours.project_id='" . $project_id
. "'" . $parent_hours . ") AND "
! .
"phpgw_p_projectactivities.project_id='" . $project_id . "' AND
phpgw_p_projectactivities.billable='Y' "
! . "AND
phpgw_p_projectactivities.activity_id=phpgw_p_hours.activity_id " .
$ordermethod,__LINE__,__FILE__);
while ($this->db->next_record())
--- 204,229 ----
}
! $this->db2->query('UPDATE phpgw_p_invoice SET
sum=round(' . $sum_sum . ',2) WHERE id=' .
$values['invoice_id'],__LINE__,__FILE__);
}
function read_hours($project_id, $action)
{
! $project_id = intval($project_id);
!
! $ordermethod = ' order by end_date asc';
if ($action == 'mains')
{
! $parent_hours = ' OR
phpgw_p_hours.pro_parent=' . $project_id;
}
! $this->db->query('SELECT phpgw_p_hours.id as
id,phpgw_p_hours.hours_descr,phpgw_p_activities.descr,phpgw_p_hours.status,'
! .
'phpgw_p_hours.start_date,phpgw_p_hours.end_date,phpgw_p_hours.minutes,phpgw_p_hours.minperae,phpgw_p_hours.billperae,'
! . 'phpgw_p_hours.employee FROM
phpgw_p_hours ' . $this->return_join() . ' phpgw_p_activities ON '
! .
'phpgw_p_hours.activity_id=phpgw_p_activities.id ' . $this->return_join() . '
phpgw_p_projectactivities ON '
.
"phpgw_p_hours.activity_id=phpgw_p_projectactivities.activity_id WHERE
(phpgw_p_hours.status='done' OR "
! .
"phpgw_p_hours.status='closed') AND (phpgw_p_hours.project_id=" . $project_id .
$parent_hours . ') AND '
! .
'phpgw_p_projectactivities.project_id=' . $project_id . " AND
phpgw_p_projectactivities.billable='Y' "
! . 'AND
phpgw_p_projectactivities.activity_id=phpgw_p_hours.activity_id' .
$ordermethod,__LINE__,__FILE__);
while ($this->db->next_record())
***************
*** 239,255 ****
function read_invoice_hours($project_id, $invoice_id, $action)
{
! $ordermethod = " order by end_date asc";
if ($action == 'mains' || $action == 'amains')
{
! $parent_search = " OR
phpgw_p_hours.pro_parent='" . $project_id . "'";
}
! $this->db->query("SELECT phpgw_p_hours.id as
id,phpgw_p_hours.hours_descr,phpgw_p_activities.descr,phpgw_p_hours.status, "
! .
"phpgw_p_hours.start_date,phpgw_p_hours.end_date,phpgw_p_hours.minutes,phpgw_p_hours.minperae,phpgw_p_hours.billperae
FROM "
! . "phpgw_p_hours " .
$this->return_join() . " phpgw_p_activities ON
phpgw_p_hours.activity_id=phpgw_p_activities.id "
! . $this->return_join() . "
phpgw_p_invoicepos ON phpgw_p_invoicepos.hours_id=phpgw_p_hours.id WHERE "
! . "(phpgw_p_hours.project_id='"
. $project_id . "'" . $parent_search . ") AND phpgw_p_invoicepos.invoice_id='"
! . $invoice_id . "'" .
$ordermethod,__LINE__,__FILE__);
while ($this->db->next_record())
--- 248,266 ----
function read_invoice_hours($project_id, $invoice_id, $action)
{
! $project_id = intval($project_id);
!
! $ordermethod = ' order by end_date asc';
if ($action == 'mains' || $action == 'amains')
{
! $parent_search = ' OR
phpgw_p_hours.pro_parent=' . $project_id;
}
! $this->db->query('SELECT phpgw_p_hours.id as
id,phpgw_p_hours.hours_descr,phpgw_p_activities.descr,phpgw_p_hours.status,'
! .
'phpgw_p_hours.start_date,phpgw_p_hours.end_date,phpgw_p_hours.minutes,phpgw_p_hours.minperae,phpgw_p_hours.billperae
FROM '
! . 'phpgw_p_hours ' .
$this->return_join() . ' phpgw_p_activities ON
phpgw_p_hours.activity_id=phpgw_p_activities.id '
! . $this->return_join() . '
phpgw_p_invoicepos ON phpgw_p_invoicepos.hours_id=phpgw_p_hours.id WHERE '
! . '(phpgw_p_hours.project_id='
. $project_id . $parent_search . ') AND phpgw_p_invoicepos.invoice_id='
! . intval($invoice_id) .
$ordermethod,__LINE__,__FILE__);
while ($this->db->next_record())
***************
*** 274,280 ****
function read_single_invoice($invoice_id)
{
! $this->db->query("SELECT
phpgw_p_invoice.customer,phpgw_p_invoice.num,phpgw_p_invoice.project_id,phpgw_p_invoice.date,"
! .
"phpgw_p_invoice.sum,phpgw_p_projects.title,phpgw_p_projects.num as pnum FROM
phpgw_p_invoice,phpgw_p_projects WHERE "
! .
"phpgw_p_invoice.id='" . $invoice_id . "' AND
phpgw_p_invoice.project_id=phpgw_p_projects.id",__LINE__,__FILE__);
if ($this->db->next_record())
--- 285,291 ----
function read_single_invoice($invoice_id)
{
! $this->db->query('SELECT
phpgw_p_invoice.customer,phpgw_p_invoice.num,phpgw_p_invoice.project_id,phpgw_p_invoice.date,'
! .
'phpgw_p_invoice.sum,phpgw_p_projects.title,phpgw_p_projects.num as pnum FROM
phpgw_p_invoice,phpgw_p_projects WHERE '
! . 'phpgw_p_invoice.id='
. intval($invoice_id) . ' AND
phpgw_p_invoice.project_id=phpgw_p_projects.id',__LINE__,__FILE__);
if ($this->db->next_record())
***************
*** 293,300 ****
function read_invoice_pos($invoice_id)
{
! $this->db->query("SELECT
phpgw_p_hours.minutes,phpgw_p_hours.minperae,phpgw_p_hours.hours_descr,phpgw_p_hours.billperae,"
! .
"phpgw_p_activities.descr,phpgw_p_hours.start_date,phpgw_p_hours.end_date FROM
phpgw_p_hours,phpgw_p_activities,"
! . "phpgw_p_invoicepos WHERE
phpgw_p_invoicepos.hours_id=phpgw_p_hours.id AND
phpgw_p_invoicepos.invoice_id='"
! . $invoice_id . "' AND
phpgw_p_hours.activity_id=phpgw_p_activities.id",__LINE__,__FILE__);
while ($this->db->next_record())
--- 304,311 ----
function read_invoice_pos($invoice_id)
{
! $this->db->query('SELECT
phpgw_p_hours.minutes,phpgw_p_hours.minperae,phpgw_p_hours.hours_descr,phpgw_p_hours.billperae,'
! .
'phpgw_p_activities.descr,phpgw_p_hours.start_date,phpgw_p_hours.end_date FROM
phpgw_p_hours,phpgw_p_activities,'
! . 'phpgw_p_invoicepos WHERE
phpgw_p_invoicepos.hours_id=phpgw_p_hours.id AND phpgw_p_invoicepos.invoice_id='
! . $invoice_id . ' AND
phpgw_p_hours.activity_id=phpgw_p_activities.id',__LINE__,__FILE__);
while ($this->db->next_record())
Index: class.sodeliveries.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.sodeliveries.inc.php,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** class.sodeliveries.inc.php 18 Apr 2003 23:48:42 -0000 1.17
--- class.sodeliveries.inc.php 17 Jun 2003 12:39:16 -0000 1.18
***************
*** 7,11 ****
* Written by Bettina Gille address@hidden *
* ----------------------------------------------- *
! * Copyright (C) 2000,2001,2002 Bettina Gille *
* *
* This program is free software; you can redistribute it and/or *
--- 7,11 ----
* Written by Bettina Gille address@hidden *
* ----------------------------------------------- *
! * Copyright (C) 2000 - 2003 Bettina Gille *
* *
* This program is free software; you can redistribute it and/or *
***************
*** 41,46 ****
switch ($dbtype)
{
! case 'pgsql': $join = " JOIN "; break;
! case 'mysql': $join = " LEFT JOIN "; break;
}
return $join;
--- 41,46 ----
switch ($dbtype)
{
! case 'pgsql': $join = ' JOIN '; break;
! case 'mysql': $join = ' LEFT JOIN '; break;
}
return $join;
***************
*** 50,66 ****
{
$values['delivery_num'] =
$this->db->db_addslashes($values['delivery_num']);
! $this->db->query("INSERT INTO phpgw_p_delivery
(num,project_id,date,customer) VALUES ('" . $values['delivery_num'] . "','"
! . $values['project_id']
. "','" . time() . "','" . $values['customer'] . "')",__LINE__,__FILE__);
$this->db2->query("SELECT id from phpgw_p_delivery
WHERE num='" . $values['delivery_num'] . "'",__LINE__,__FILE__);
$this->db2->next_record();
$delivery_id = $this->db2->f('id');
! while($select && $entry=each($select))
{
! $this->db->query("INSERT INTO
phpgw_p_deliverypos (delivery_id,hours_id) VALUES ('$delivery_id','" . $entry[0]
! .
"')",__LINE__,__FILE__);
! $this->db2->query("UPDATE phpgw_p_hours set
status='closed' WHERE status='done' AND id='" . $entry[0] .
"'",__LINE__,__FILE__);
! $this->db2->query("UPDATE phpgw_p_hours set
dstatus='d' WHERE id='" . $entry[0] . "'",__LINE__,__FILE__);
}
return $delivery_id;
--- 50,67 ----
{
$values['delivery_num'] =
$this->db->db_addslashes($values['delivery_num']);
! $this->db->query("INSERT INTO phpgw_p_delivery
(num,project_id,date,customer) VALUES ('" . $values['delivery_num'] . "',"
! .
intval($values['project_id']) . ',' . time() . ',' .
intval($values['customer']) . ')',__LINE__,__FILE__);
$this->db2->query("SELECT id from phpgw_p_delivery
WHERE num='" . $values['delivery_num'] . "'",__LINE__,__FILE__);
$this->db2->next_record();
$delivery_id = $this->db2->f('id');
+ $delivery_id = intval($delivery_id);
! while(is_array($select) && $entry=each($select))
{
! $this->db->query('INSERT INTO
phpgw_p_deliverypos (delivery_id,hours_id) VALUES (' . $delivery_id . ',' .
intval($entry[0])
! .
')',__LINE__,__FILE__);
! $this->db2->query("UPDATE phpgw_p_hours set
status='closed' WHERE status='done' AND id=" .
intval($entry[0]),__LINE__,__FILE__);
! $this->db2->query("UPDATE phpgw_p_hours set
dstatus='d' WHERE id=" . intval($entry[0]),__LINE__,__FILE__);
}
return $delivery_id;
***************
*** 69,84 ****
function update_delivery($values,$select)
{
$values['delivery_num'] =
$this->db->db_addslashes($values['delivery_num']);
! $this->db->query("UPDATE phpgw_p_delivery set num='" .
$values['delivery_num'] . "',date='" . $values['date'] . "',customer='"
! .
$values['customer'] . "' where id='" . $values['delivery_id'] .
"'",__LINE__,__FILE__);
! $this->db2->query("DELETE FROM phpgw_p_deliverypos
WHERE delivery_id='" . $values['delivery_id'] . "'",__LINE__,__FILE__);
! while($select && $entry=each($select))
{
! $this->db->query("INSERT INTO
phpgw_p_deliverypos (delivery_id,hours_id) VALUES ('" . $values['delivery_id']
. "','"
! . $entry[0] .
"')",__LINE__,__FILE__);
! $this->db2->query("UPDATE phpgw_p_hours set
status='closed' WHERE status='done' AND id='" . $entry[0] .
"'",__LINE__,__FILE__);
! $this->db2->query("UPDATE phpgw_p_hours set
dstatus='d' WHERE id='" . $entry[0] . "'",__LINE__,__FILE__);
}
}
--- 70,87 ----
function update_delivery($values,$select)
{
+ $values['delivery_id'] = intval($values['delivery_id']);
+
$values['delivery_num'] =
$this->db->db_addslashes($values['delivery_num']);
! $this->db->query("UPDATE phpgw_p_delivery set num='" .
$values['delivery_num'] . "',date=" . intval($values['date']) . ',customer='
! .
intval($values['customer']) . ' where id=' .
$values['delivery_id'],__LINE__,__FILE__);
! $this->db2->query('DELETE FROM phpgw_p_deliverypos
WHERE delivery_id=' . $values['delivery_id'],__LINE__,__FILE__);
! while(is_array($select) && $entry=each($select))
{
! $this->db->query('INSERT INTO
phpgw_p_deliverypos (delivery_id,hours_id) VALUES (' . $values['delivery_id'] .
','
! .
intval($entry[0]) . ')',__LINE__,__FILE__);
! $this->db2->query("UPDATE phpgw_p_hours set
status='closed' WHERE status='done' AND id=" .
intval($entry[0]),__LINE__,__FILE__);
! $this->db2->query("UPDATE phpgw_p_hours set
dstatus='d' WHERE id=" . intval($entry[0]),__LINE__,__FILE__);
}
}
***************
*** 86,101 ****
function read_hours($project_id, $action)
{
! $ordermethod = "order by end_date asc";
if ($action == 'mains')
{
! $parent_hours = " OR
phpgw_p_hours.pro_parent='" . $project_id . "'";
}
! $this->db->query("SELECT phpgw_p_hours.id as
id,phpgw_p_hours.hours_descr,phpgw_p_activities.descr,phpgw_p_hours.status,"
! .
"phpgw_p_hours.start_date,phpgw_p_hours.minutes,phpgw_p_hours.minperae FROM
phpgw_p_hours " . $this->return_join()
. "phpgw_p_activities
ON phpgw_p_hours.activity_id=phpgw_p_activities.id WHERE
(phpgw_p_hours.dstatus='o' "
! . "AND
phpgw_p_hours.status != 'open') AND (phpgw_p_hours.project_id='" . $project_id
. "'" . $parent_hours
! . ") " .
$ordermethod,__LINE__,__FILE__);
while ($this->db->next_record())
--- 89,106 ----
function read_hours($project_id, $action)
{
! $project_id = intval($project_id);
!
! $ordermethod = ' order by end_date asc';
if ($action == 'mains')
{
! $parent_hours = ' OR
phpgw_p_hours.pro_parent=' . $project_id;
}
! $this->db->query('SELECT phpgw_p_hours.id as
id,phpgw_p_hours.hours_descr,phpgw_p_activities.descr,phpgw_p_hours.status,'
! .
'phpgw_p_hours.start_date,phpgw_p_hours.minutes,phpgw_p_hours.minperae FROM
phpgw_p_hours' . $this->return_join()
. "phpgw_p_activities
ON phpgw_p_hours.activity_id=phpgw_p_activities.id WHERE
(phpgw_p_hours.dstatus='o' "
! . "AND
phpgw_p_hours.status != 'open') AND (phpgw_p_hours.project_id=" . $project_id .
$parent_hours
! . ')' .
$ordermethod,__LINE__,__FILE__);
while ($this->db->next_record())
***************
*** 118,133 ****
function read_delivery_hours($project_id, $delivery_id, $action)
{
! $ordermethod = "order by end_date asc";
if ($action == 'mains' || $action == 'amains')
{
! $parent_search = " OR
phpgw_p_hours.pro_parent='" . $project_id . "'";
}
! $this->db->query("SELECT phpgw_p_hours.id as
id,phpgw_p_hours.hours_descr,phpgw_p_activities.descr,phpgw_p_hours.status,"
! .
"phpgw_p_hours.start_date,phpgw_p_hours.minutes,phpgw_p_hours.minperae FROM
phpgw_p_hours " . $this->return_join()
! ."phpgw_p_activities ON
phpgw_p_hours.activity_id=phpgw_p_activities.id " . $this->return_join() .
"phpgw_p_deliverypos "
! . "ON
phpgw_p_hours.id=phpgw_p_deliverypos.hours_id WHERE
(phpgw_p_hours.project_id='" . $project_id
! . "'" . $parent_search
. ") AND phpgw_p_deliverypos.delivery_id='" . $delivery_id . "' " .
$ordermethod,__LINE__,__FILE__);
while ($this->db->next_record())
--- 123,141 ----
function read_delivery_hours($project_id, $delivery_id, $action)
{
! $project_id = intval($project_id);
! $delivery_id = intval($delivery_id);
!
! $ordermethod = ' order by end_date asc';
if ($action == 'mains' || $action == 'amains')
{
! $parent_search = ' OR
phpgw_p_hours.pro_parent=' . $project_id;
}
! $this->db->query('SELECT phpgw_p_hours.id as
id,phpgw_p_hours.hours_descr,phpgw_p_activities.descr,phpgw_p_hours.status,'
! .
'phpgw_p_hours.start_date,phpgw_p_hours.minutes,phpgw_p_hours.minperae FROM
phpgw_p_hours' . $this->return_join()
! . 'phpgw_p_activities
ON phpgw_p_hours.activity_id=phpgw_p_activities.id' . $this->return_join() .
'phpgw_p_deliverypos '
! . 'ON
phpgw_p_hours.id=phpgw_p_deliverypos.hours_id WHERE (phpgw_p_hours.project_id='
. $project_id
! . $parent_search . ')
AND phpgw_p_deliverypos.delivery_id=' . $delivery_id .
$ordermethod,__LINE__,__FILE__);
while ($this->db->next_record())
***************
*** 151,154 ****
--- 159,164 ----
function read_deliveries($start, $query = '', $sort = '',
$order = '', $limit = True, $project_id = '')
{
+ $project_id = intval($project_id);
+
if ($order)
{
***************
*** 157,161 ****
else
{
! $ordermethod = " order by date asc";
}
--- 167,171 ----
else
{
! $ordermethod = ' order by date asc';
}
***************
*** 167,179 ****
if ($project_id)
{
! $sql = "SELECT phpgw_p_delivery.id as
id,phpgw_p_delivery.num,title,phpgw_p_delivery.date,"
! .
"phpgw_p_delivery.project_id,phpgw_p_delivery.customer FROM
phpgw_p_delivery,phpgw_p_projects WHERE "
! .
"phpgw_p_delivery.project_id='$project_id' AND
phpgw_p_delivery.project_id=phpgw_p_projects.id";
}
else
{
! $sql = "SELECT phpgw_p_delivery.id as
id,phpgw_p_delivery.num,title,phpgw_p_delivery.date,"
! .
"phpgw_p_delivery.project_id,phpgw_p_delivery.customer FROM
phpgw_p_delivery,phpgw_p_projects WHERE "
! .
"phpgw_p_delivery.project_id=phpgw_p_projects.id";
}
--- 177,189 ----
if ($project_id)
{
! $sql = 'SELECT phpgw_p_delivery.id as
id,phpgw_p_delivery.num,title,phpgw_p_delivery.date,'
! .
'phpgw_p_delivery.project_id,phpgw_p_delivery.customer FROM
phpgw_p_delivery,phpgw_p_projects WHERE '
! . 'phpgw_p_delivery.project_id=' .
$project_id . ' AND phpgw_p_delivery.project_id=phpgw_p_projects.id';
}
else
{
! $sql = 'SELECT phpgw_p_delivery.id as
id,phpgw_p_delivery.num,title,phpgw_p_delivery.date,'
! .
'phpgw_p_delivery.project_id,phpgw_p_delivery.customer FROM
phpgw_p_delivery,phpgw_p_projects WHERE '
! .
'phpgw_p_delivery.project_id=phpgw_p_projects.id';
}
***************
*** 207,213 ****
function read_single_delivery($delivery_id)
{
! $this->db->query("SELECT
phpgw_p_delivery.customer,phpgw_p_delivery.num,phpgw_p_delivery.project_id,phpgw_p_delivery.date,
"
! .
"phpgw_p_projects.title,phpgw_p_projects.num as pnum FROM
phpgw_p_delivery,phpgw_p_projects WHERE "
! . "phpgw_p_delivery.id='$delivery_id'
AND phpgw_p_delivery.project_id=phpgw_p_projects.id",__LINE__,__FILE__);
if ($this->db->next_record())
--- 217,223 ----
function read_single_delivery($delivery_id)
{
! $this->db->query('SELECT
phpgw_p_delivery.customer,phpgw_p_delivery.num,phpgw_p_delivery.project_id,phpgw_p_delivery.date,'
! .
'phpgw_p_projects.title,phpgw_p_projects.num as pnum FROM
phpgw_p_delivery,phpgw_p_projects WHERE '
! .
'phpgw_p_delivery.id=' . intval($delivery_id) . ' AND
phpgw_p_delivery.project_id=phpgw_p_projects.id',__LINE__,__FILE__);
if ($this->db->next_record())
***************
*** 225,231 ****
function exists($values)
{
if ($values['delivery_id'] && ($values['delivery_id']
!= 0))
{
! $editexists = " and id != '" .
$values['delivery_id'] . "'";
}
$this->db->query("select count(*) from phpgw_p_delivery
where num='" . $values['delivery_num'] . "'" . $editexists,__LINE__,__FILE__);
--- 235,243 ----
function exists($values)
{
+ $values['delivery_id'] = intval($values['delivery_id']);
+
if ($values['delivery_id'] && ($values['delivery_id']
!= 0))
{
! $editexists = ' and id !=' .
$values['delivery_id'];
}
$this->db->query("select count(*) from phpgw_p_delivery
where num='" . $values['delivery_num'] . "'" . $editexists,__LINE__,__FILE__);
***************
*** 245,252 ****
function read_delivery_pos($delivery_id)
{
! $this->db->query("SELECT
phpgw_p_hours.hours_descr,phpgw_p_hours.minperae,phpgw_p_hours.minutes,"
! .
"phpgw_p_activities.descr,phpgw_p_hours.start_date, phpgw_p_hours.end_date FROM
phpgw_p_hours,phpgw_p_activities,"
! . "phpgw_p_deliverypos
WHERE phpgw_p_deliverypos.hours_id=phpgw_p_hours.id AND
phpgw_p_deliverypos.delivery_id='"
! . $delivery_id . "'
AND phpgw_p_hours.activity_id=phpgw_p_activities.id",__LINE__,__FILE__);
while ($this->db->next_record())
--- 257,264 ----
function read_delivery_pos($delivery_id)
{
! $this->db->query('SELECT
phpgw_p_hours.hours_descr,phpgw_p_hours.minperae,phpgw_p_hours.minutes,'
! .
'phpgw_p_activities.descr,phpgw_p_hours.start_date, phpgw_p_hours.end_date FROM
phpgw_p_hours,phpgw_p_activities,'
! . 'phpgw_p_deliverypos
WHERE phpgw_p_deliverypos.hours_id=phpgw_p_hours.id AND
phpgw_p_deliverypos.delivery_id='
! . intval($delivery_id)
. ' AND phpgw_p_hours.activity_id=phpgw_p_activities.id',__LINE__,__FILE__);
while ($this->db->next_record())
Index: class.soprojecthours.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.soprojecthours.inc.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** class.soprojecthours.inc.php 26 Apr 2003 01:22:39 -0000 1.9
--- class.soprojecthours.inc.php 17 Jun 2003 12:39:16 -0000 1.10
***************
*** 45,52 ****
else
{
! $ordermethod = " order by start_date asc";
}
! $filtermethod = " project_id = '$project_id'";
if ($state != 'all')
--- 45,52 ----
else
{
! $ordermethod = ' order by start_date asc';
}
! $filtermethod = ' project_id =' . intval($project_id);
if ($state != 'all')
***************
*** 57,61 ****
if ($filter == 'yours')
{
! $filtermethod .= " AND employee='" .
$this->account . "'";
}
--- 57,61 ----
if ($filter == 'yours')
{
! $filtermethod .= ' AND employee=' .
$this->account;
}
***************
*** 71,86 ****
$this->db->limit_query($sql .
$ordermethod,$start,__LINE__,__FILE__);
- $i = 0;
while ($this->db->next_record())
{
! $hours[$i]['hours_id'] =
$this->db->f('id');
! $hours[$i]['project_id'] =
$this->db->f('project_id');
! $hours[$i]['hours_descr'] =
$this->db->f('hours_descr');
! $hours[$i]['status'] =
$this->db->f('status');
! $hours[$i]['sdate'] =
$this->db->f('start_date');
! $hours[$i]['edate'] =
$this->db->f('end_date');
! $hours[$i]['minutes'] =
$this->db->f('minutes');
! $hours[$i]['employee'] =
$this->db->f('employee');
! $i++;
}
return $hours;
--- 71,87 ----
$this->db->limit_query($sql .
$ordermethod,$start,__LINE__,__FILE__);
while ($this->db->next_record())
{
! $hours[] = array
! (
! 'hours_id' =>
$this->db->f('id'),
! 'project_id' =>
$this->db->f('project_id'),
! 'hours_descr' =>
$this->db->f('hours_descr'),
! 'status' =>
$this->db->f('status'),
! 'sdate' =>
$this->db->f('start_date'),
! 'edate' =>
$this->db->f('end_date'),
! 'minutes' =>
$this->db->f('minutes'),
! 'employee' =>
$this->db->f('employee')
! );
}
return $hours;
***************
*** 89,93 ****
function read_single_hours($hours_id)
{
! $this->db->query("SELECT * from phpgw_p_hours WHERE
id='$hours_id'",__LINE__,__FILE__);
while($this->db->next_record())
--- 90,94 ----
function read_single_hours($hours_id)
{
! $this->db->query('SELECT * from phpgw_p_hours WHERE
id=' . $hours_id,__LINE__,__FILE__);
while($this->db->next_record())
***************
*** 116,124 ****
$values['remark'] =
$this->db->db_addslashes($values['remark']);
! $this->db->query("INSERT into phpgw_p_hours
(project_id,activity_id,entry_date,start_date,end_date,hours_descr,remark,minutes,"
! .
"status,minperae,billperae,employee,pro_parent) VALUES ('" .
$values['project_id'] . "','" . $values['activity_id'] . "','"
! . time() . "','" .
$values['sdate'] . "','" . $values['edate'] . "','" . $values['hours_descr'] .
"','"
! . $values['remark'] .
"','" . $values['ae_minutes'] . "','" . $values['status'] . "','" .
$values['minperae']
! . "','" .
$values['billperae'] . "','" . $values['employee'] . "','" .
$values['pro_parent'] . "')",__LINE__,__FILE__);
}
--- 117,125 ----
$values['remark'] =
$this->db->db_addslashes($values['remark']);
! $this->db->query('INSERT into phpgw_p_hours
(project_id,activity_id,entry_date,start_date,end_date,hours_descr,remark,minutes,'
! .
'status,minperae,billperae,employee,pro_parent) VALUES (' .
intval($values['project_id']) . ',' . intval($values['activity_id']) . ','
! . time() . ',' .
intval($values['sdate']) . ',' . intval($values['edate']) . ",'" .
$values['hours_descr'] . "','"
! . $values['remark'] .
"'," . intval($values['ae_minutes']) . ",'" . $values['status'] . "'," .
intval($values['minperae'])
! . ',' .
$values['billperae'] . ',' . intval($values['employee']) . ',' .
intval($values['pro_parent']) . ')',__LINE__,__FILE__);
}
***************
*** 129,147 ****
$values['remark'] =
$this->db->db_addslashes($values['remark']);
! $this->db->query("UPDATE phpgw_p_hours SET
activity_id='" . $values['activity_id'] . "',entry_date='" . time() .
"',start_date='"
! . $values['sdate'] .
"',end_date='" . $values['edate'] . "',hours_descr='" . $values['hours_descr']
. "',remark='"
! . $values['remark'] .
"',minutes='" . $values['ae_minutes'] . "',status='" . $values['status'] .
"',minperae='"
! . $values['minperae'] .
"',billperae='" . $values['billperae'] . "',employee='" . $values['employee']
! . "' where id='" .
$values['hours_id'] . "'",__LINE__,__FILE__);
}
function delete_hours($hours_id)
{
! $this->db->query("Delete from phpgw_p_hours where id =
'$hours_id'",__LINE__,__FILE__);
}
function update_hours_act($activity_id, $minperae)
{
! $this->db->query("SELECT id,minperae from phpgw_p_hours
where activity_id='" . $activity_id . "'",__LINE__,__FILE__);
while ($this->db->next_record())
--- 130,148 ----
$values['remark'] =
$this->db->db_addslashes($values['remark']);
! $this->db->query('UPDATE phpgw_p_hours SET
activity_id=' . intval($values['activity_id']) . ',entry_date=' . time() .
',start_date='
! .
intval($values['sdate']) . ',end_date=' . intval($values['edate']) .
",hours_descr='" . $values['hours_descr'] . "',remark='"
! . $values['remark'] .
"',minutes=" . intval($values['ae_minutes']) . ",status='" . $values['status']
. "',minperae="
! .
intval($values['minperae']) . ',billperae=' . $values['billperae'] .
',employee=' . intval($values['employee'])
! . ' where id=' .
intval($values['hours_id']),__LINE__,__FILE__);
}
function delete_hours($hours_id)
{
! $this->db->query('Delete from phpgw_p_hours where id='
. intval($hours_id),__LINE__,__FILE__);
}
function update_hours_act($activity_id, $minperae)
{
! $this->db->query('SELECT id,minperae from phpgw_p_hours
where activity_id=' . intval($activity_id),__LINE__,__FILE__);
while ($this->db->next_record())
***************
*** 157,162 ****
for ($i=0;$i<=count($hours);$i++)
{
! $this->db->query("UPDATE phpgw_p_hours
set minperae='" . $minperae . "' WHERE id='" . $hours[$i] .
"'",__LINE__,__FILE__);
}
}
}
--- 158,173 ----
for ($i=0;$i<=count($hours);$i++)
{
! $this->db->query('UPDATE phpgw_p_hours
set minperae=' . intval($minperae) . ' WHERE id=' .
intval($hours[$i]),__LINE__,__FILE__);
}
+ }
+ }
+
+ function get_time_used($project_id)
+ {
+ $this->db->query('SELECT SUM(minutes) as utime from
phpgw_p_hours where (project_id=' . intval($project_id) . ' OR pro_parent='
+ . intval($project_id) .
')',__LINE__,__FILE__);
+ if ($this->db->next_record())
+ {
+ return $this->db->f('utime');
}
}
Index: class.soprojects.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.soprojects.inc.php,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -r1.41 -r1.42
*** class.soprojects.inc.php 26 Apr 2003 01:22:39 -0000 1.41
--- class.soprojects.inc.php 17 Jun 2003 12:39:16 -0000 1.42
***************
*** 7,11 ****
* Written by Bettina Gille address@hidden *
* ----------------------------------------------- *
! * Copyright (C) 2000,2001,2002 Bettina Gille *
* *
* This program is free software; you can redistribute it and/or *
--- 7,11 ----
* Written by Bettina Gille address@hidden *
* ----------------------------------------------- *
! * Copyright (C) 2000 - 2003 Bettina Gille *
* *
[...1148 lines suppressed...]
! switch($action)
! {
! case 'bmain':
! case 'bparent': $column = 'budget'; break;
! case 'tmain':
! case 'tparent': $column = 'time_planned'; break;
! }
!
! if($project_id > 0)
! {
! $editfilter = ' and id !=' . $project_id;
! }
!
! $this->db->query('SELECT SUM(' . $column . ') as
sumvalue from phpgw_p_projects where (' . $filter . $editfilter .
')',__LINE__,__FILE__);
! if ($this->db->next_record())
! {
! return $this->db->f('sumvalue');
! }
}
}
Index: class.sostatistics.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.sostatistics.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
Index: class.uibilling.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.uibilling.inc.php,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -r1.29 -r1.30
*** class.uibilling.inc.php 26 Apr 2003 01:22:39 -0000 1.29
--- class.uibilling.inc.php 17 Jun 2003 12:39:16 -0000 1.30
***************
*** 129,135 ****
--- 129,138 ----
{
$GLOBALS['phpgw']->template->set_var('admin_info',lang('Administrator'));
+
$GLOBALS['phpgw']->template->set_var('break1',' | ');
$GLOBALS['phpgw']->template->set_var('space1',' ');
$GLOBALS['phpgw']->template->set_var('link_activities',$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiprojects.list_activities&action=act'));
$GLOBALS['phpgw']->template->set_var('lang_activities',lang('Activities'));
+
$GLOBALS['phpgw']->template->set_var('link_budget',$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiprojects.list_budget&action=mains'));
+
$GLOBALS['phpgw']->template->set_var('lang_budget',lang('budget'));
}
***************
*** 137,141 ****
{
$GLOBALS['phpgw']->template->set_var('book_info',lang('Bookkeeper'));
!
$GLOBALS['phpgw']->template->set_var('break',' | ');
$GLOBALS['phpgw']->template->set_var('space2',' ');
$GLOBALS['phpgw']->template->set_var('link_billing',$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uibilling.list_projects&action=mains'));
--- 140,144 ----
{
$GLOBALS['phpgw']->template->set_var('book_info',lang('Bookkeeper'));
!
$GLOBALS['phpgw']->template->set_var('break2',' | ');
$GLOBALS['phpgw']->template->set_var('space2',' ');
$GLOBALS['phpgw']->template->set_var('link_billing',$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uibilling.list_projects&action=mains'));
***************
*** 179,182 ****
--- 182,186 ----
$pro_parent =
get_var('pro_parent',array('POST','GET'));
+ $GLOBALS['phpgw_info']['flags']['app_header'] =
lang('projects') . ': ' . ($pro_parent?lang('list jobs'):lang('list projects'));
$this->display_app_header();
***************
*** 184,189 ****
$GLOBALS['phpgw']->template->set_block('projects_list_t','projects_list','list');
- $GLOBALS['phpgw_info']['flags']['app_header'] =
lang('projects') . ': ' . ($pro_parent?lang('list jobs'):lang('list projects'));
-
if (!$action)
{
--- 188,191 ----
***************
*** 229,233 ****
{
$action_list= '<form method="POST" action="' .
$GLOBALS['phpgw']->link('/index.php',$link_data) . '" name="form">' . "\n"
! . '<select
name="cat_id" onChange="this.form.submit();"><option value="">' . lang('None')
. '</option>' . "\n"
.
$this->cats->formatted_list('select','all',$this->cat_id,True) . '</select>';
}
--- 231,235 ----
{
$action_list= '<form method="POST" action="' .
$GLOBALS['phpgw']->link('/index.php',$link_data) . '" name="form">' . "\n"
! . '<select
name="cat_id" onChange="this.form.submit();"><option value="">' . lang('Select
category') . '</option>' . "\n"
.
$this->cats->formatted_list('select','all',$this->cat_id,True) . '</select>';
}
***************
*** 276,282 ****
{
$this->nextmatchs->template_alternate_row_color(&$GLOBALS['phpgw']->template);
- $title =
$GLOBALS['phpgw']->strip_html($pro[$i]['title']);
- if (! $title) $title = ' ';
-
$edate = $pro[$i]['edate'];
if ($edate == 0)
--- 278,281 ----
***************
*** 298,339 ****
if ($action == 'mains')
{
! if ($pro[$i]['customer'] != 0)
! {
! $customer =
$this->boprojects->read_single_contact($pro[$i]['customer']);
! if (!$customer[0]['org_name']) { $td_action =
$customer[0]['n_given'] . ' ' . $customer[0]['n_family']; }
! else { $td_action = $customer[0]['org_name'] .
' [ ' . $customer[0]['n_given'] . ' ' . $customer[0]['n_family'] . ' ]'; }
! }
! else { $td_action = ' '; }
}
else
{
! $sdate = $pro[$i]['sdate'];
! if ($sdate == 0) { $sdateout =
' '; }
! else
! {
! $month =
$GLOBALS['phpgw']->common->show_date(time(),'n');
! $day =
$GLOBALS['phpgw']->common->show_date(time(),'d');
! $year =
$GLOBALS['phpgw']->common->show_date(time(),'Y');
!
! $sdate = $sdate + (60*60) *
$GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'];
! $td_action =
$GLOBALS['phpgw']->common->show_date($sdate,$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
! }
}
- $cached_data =
$this->boprojects->cached_accounts($pro[$i]['coordinator']);
- $coordinatorout =
$GLOBALS['phpgw']->strip_html($cached_data[$pro[$i]['coordinator']]['account_lid']
- . ' [' .
$cached_data[$pro[$i]['coordinator']]['firstname'] . ' '
- .
$cached_data[$pro[$i]['coordinator']]['lastname'] . ' ]');
-
// --------------- template declaration for list records
-------------------------------------
$GLOBALS['phpgw']->template->set_var(array
(
! 'number' =>
$GLOBALS['phpgw']->strip_html($pro[$i]['number']),
'td_action' => $td_action,
'status' =>
lang($pro[$i]['status']),
! 'title' => $title,
'end_date' => $edateout,
! 'coordinator' => $coordinatorout
));
--- 297,317 ----
if ($action == 'mains')
{
! $td_action =
($pro[$i]['customerout']?$pro[$i]['customerout']:' ');
}
else
{
! $td_action =
($pro[$i]['sdateout']?$pro[$i]['sdateout']:' ');
}
// --------------- template declaration for list records
-------------------------------------
$GLOBALS['phpgw']->template->set_var(array
(
! 'number' =>
$pro[$i]['number'],
'td_action' => $td_action,
'status' =>
lang($pro[$i]['status']),
! 'title' =>
($pro[$i]['title']?$pro[$i]['title']:' '),
'end_date' => $edateout,
! 'coordinator' =>
$pro[$i]['coordinatorout']
));
Index: class.uideliveries.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.uideliveries.inc.php,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -r1.29 -r1.30
*** class.uideliveries.inc.php 26 Apr 2003 01:22:39 -0000 1.29
--- class.uideliveries.inc.php 17 Jun 2003 12:39:16 -0000 1.30
***************
*** 127,133 ****
--- 127,136 ----
{
$GLOBALS['phpgw']->template->set_var('admin_info',lang('Administrator'));
+
$GLOBALS['phpgw']->template->set_var('break1',' | ');
$GLOBALS['phpgw']->template->set_var('space1',' ');
$GLOBALS['phpgw']->template->set_var('link_activities',$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiprojects.list_activities&action=act'));
$GLOBALS['phpgw']->template->set_var('lang_activities',lang('Activities'));
+
$GLOBALS['phpgw']->template->set_var('link_budget',$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiprojects.list_budget&action=mains'));
+
$GLOBALS['phpgw']->template->set_var('lang_budget',lang('budget'));
}
***************
*** 135,139 ****
{
$GLOBALS['phpgw']->template->set_var('book_info',lang('Bookkeeper'));
!
$GLOBALS['phpgw']->template->set_var('break',' | ');
$GLOBALS['phpgw']->template->set_var('space2',' ');
$GLOBALS['phpgw']->template->set_var('link_billing',$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uibilling.list_projects&action=mains'));
--- 138,142 ----
{
$GLOBALS['phpgw']->template->set_var('book_info',lang('Bookkeeper'));
!
$GLOBALS['phpgw']->template->set_var('break2',' | ');
$GLOBALS['phpgw']->template->set_var('space2',' ');
$GLOBALS['phpgw']->template->set_var('link_billing',$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uibilling.list_projects&action=mains'));
***************
*** 164,167 ****
--- 167,171 ----
$pro_parent =
get_var('pro_parent',array('POST','GET'));
+ $GLOBALS['phpgw_info']['flags']['app_header'] =
lang('projects') . ': ' . ($pro_parent?lang('list jobs'):lang('list projects'));
$this->display_app_header();
***************
*** 169,174 ****
$GLOBALS['phpgw']->template->set_block('projects_list_t','projects_list','list');
- $GLOBALS['phpgw_info']['flags']['app_header'] =
lang('projects') . ': ' . ($pro_parent?lang('list jobs'):lang('list projects'));
-
if (!$action)
{
--- 173,176 ----
***************
*** 210,214 ****
{
$action_list= '<form method="POST" action="' .
$GLOBALS['phpgw']->link('/index.php',$link_data) . '" name="form">' . "\n"
! . '<select
name="cat_id" onChange="this.form.submit();"><option value="">' . lang('None')
. '</option>' . "\n"
.
$this->cats->formatted_list('select','all',$this->cat_id,True) . '</select>';
$GLOBALS['phpgw']->template->set_var(lang_header,lang('Project list'));
--- 212,216 ----
{
$action_list= '<form method="POST" action="' .
$GLOBALS['phpgw']->link('/index.php',$link_data) . '" name="form">' . "\n"
! . '<select
name="cat_id" onChange="this.form.submit();"><option value="">' . lang('Select
category') . '</option>' . "\n"
.
$this->cats->formatted_list('select','all',$this->cat_id,True) . '</select>';
$GLOBALS['phpgw']->template->set_var(lang_header,lang('Project list'));
***************
*** 259,265 ****
{
$this->nextmatchs->template_alternate_row_color(&$GLOBALS['phpgw']->template);
- $title =
$GLOBALS['phpgw']->strip_html($pro[$i]['title']);
- if (! $title) $title = ' ';
-
$edate = $pro[$i]['edate'];
if ($edate == 0)
--- 261,264 ----
***************
*** 281,322 ****
if ($action == 'mains')
{
! if ($pro[$i]['customer'] != 0)
! {
! $customer =
$this->boprojects->read_single_contact($pro[$i]['customer']);
! if (!$customer[0]['org_name']) { $td_action =
$customer[0]['n_given'] . ' ' . $customer[0]['n_family']; }
! else { $td_action = $customer[0]['org_name'] .
' [ ' . $customer[0]['n_given'] . ' ' . $customer[0]['n_family'] . ' ]'; }
! }
! else { $td_action = ' '; }
}
else
{
! $sdate = $pro[$i]['sdate'];
! if ($sdate == 0) { $sdateout =
' '; }
! else
! {
! $month =
$GLOBALS['phpgw']->common->show_date(time(),'n');
! $day =
$GLOBALS['phpgw']->common->show_date(time(),'d');
! $year =
$GLOBALS['phpgw']->common->show_date(time(),'Y');
!
! $sdate = $sdate + (60*60) *
$GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'];
! $td_action =
$GLOBALS['phpgw']->common->show_date($sdate,$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
! }
}
- $cached_data =
$this->boprojects->cached_accounts($pro[$i]['coordinator']);
- $coordinatorout =
$GLOBALS['phpgw']->strip_html($cached_data[$pro[$i]['coordinator']]['account_lid']
- . ' [' .
$cached_data[$pro[$i]['coordinator']]['firstname'] . ' '
- .
$cached_data[$pro[$i]['coordinator']]['lastname'] . ' ]');
-
// --------------- template declaration for list records
-------------------------------------
$GLOBALS['phpgw']->template->set_var(array
(
! 'number' =>
$GLOBALS['phpgw']->strip_html($pro[$i]['number']),
'td_action' => $td_action,
'status' =>
lang($pro[$i]['status']),
! 'title' => $title,
'end_date' => $edateout,
! 'coordinator' => $coordinatorout
));
--- 280,300 ----
if ($action == 'mains')
{
! $td_action =
($pro[$i]['customerout']?$pro[$i]['customerout']:' ');
}
else
{
! $td_action =
($pro[$i]['sdateout']?$pro[$i]['sdateout']:' ');
}
// --------------- template declaration for list records
-------------------------------------
$GLOBALS['phpgw']->template->set_var(array
(
! 'number' =>
$pro[$i]['number'],
'td_action' => $td_action,
'status' =>
lang($pro[$i]['status']),
! 'title' =>
($pro[$i]['title']?$pro[$i]['title']:' '),
'end_date' => $edateout,
! 'coordinator' =>
$pro[$i]['coordinatorout']
));
Index: class.uiprojecthours.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.uiprojecthours.inc.php,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -r1.30 -r1.31
*** class.uiprojecthours.inc.php 26 Apr 2003 01:22:39 -0000 1.30
--- class.uiprojecthours.inc.php 17 Jun 2003 12:39:16 -0000 1.31
***************
*** 44,48 ****
function uiprojecthours()
{
! $this->boprojecthours =
CreateObject('projects.boprojecthours',True);
$this->boprojects =
CreateObject('projects.boprojects');
$this->nextmatchs =
CreateObject('phpgwapi.nextmatchs');
--- 44,48 ----
function uiprojecthours()
{
! $this->bo
= CreateObject('projects.boprojecthours',True);
$this->boprojects =
CreateObject('projects.boprojects');
$this->nextmatchs =
CreateObject('phpgwapi.nextmatchs');
***************
*** 52,61 ****
$this->grants[$this->account] = PHPGW_ACL_READ +
PHPGW_ACL_ADD + PHPGW_ACL_EDIT + PHPGW_ACL_DELETE;
! $this->start =
$this->boprojecthours->start;
! $this->query =
$this->boprojecthours->query;
! $this->filter =
$this->boprojecthours->filter;
! $this->order =
$this->boprojecthours->order;
! $this->sort
= $this->boprojecthours->sort;
! $this->state =
$this->boprojecthours->state;
}
--- 52,62 ----
$this->grants[$this->account] = PHPGW_ACL_READ +
PHPGW_ACL_ADD + PHPGW_ACL_EDIT + PHPGW_ACL_DELETE;
! $this->start =
$this->bo->start;
! $this->query =
$this->bo->query;
! $this->filter =
$this->bo->filter;
! $this->order =
$this->bo->order;
! $this->sort
= $this->bo->sort;
! $this->state =
$this->bo->state;
! $this->project_id =
$this->bo->project_id;
}
***************
*** 64,75 ****
$data = array
(
! 'start' => $this->start,
! 'query' => $this->query,
! 'filter' => $this->filter,
! 'order' => $this->order,
! 'sort' => $this->sort,
! 'state' => $this->state
);
! $this->boprojecthours->save_sessiondata($data);
}
--- 65,77 ----
$data = array
(
! 'start' => $this->start,
! 'query' => $this->query,
! 'filter' => $this->filter,
! 'order' => $this->order,
! 'sort' => $this->sort,
! 'state' => $this->state,
! 'project_id' => $this->project_id
);
! $this->bo->save_sessiondata($data);
}
***************
*** 99,103 ****
$GLOBALS['phpgw']->template->set_var('lang_customer',lang('Customer'));
$GLOBALS['phpgw']->template->set_var('lang_coordinator',lang('Coordinator'));
!
$GLOBALS['phpgw']->template->set_var('lang_done',lang('Done'));
$GLOBALS['phpgw']->template->set_var('lang_save',lang('Save'));
$GLOBALS['phpgw']->template->set_var('lang_view',lang('View'));
--- 101,106 ----
$GLOBALS['phpgw']->template->set_var('lang_customer',lang('Customer'));
$GLOBALS['phpgw']->template->set_var('lang_coordinator',lang('Coordinator'));
!
$GLOBALS['phpgw']->template->set_var('lang_cancel',lang('Cancel'));
!
$GLOBALS['phpgw']->template->set_var('lang_done',lang('done'));
$GLOBALS['phpgw']->template->set_var('lang_save',lang('Save'));
$GLOBALS['phpgw']->template->set_var('lang_view',lang('View'));
***************
*** 116,122 ****
$GLOBALS['phpgw']->template->set_var('lang_end_time',lang('End time'));
$GLOBALS['phpgw']->template->set_var('lang_select_project',lang('Select
project'));
-
$GLOBALS['phpgw']->template->set_var('lang_reset',lang('Clear Form'));
$GLOBALS['phpgw']->template->set_var('lang_minperae',lang('Minutes per
workunit'));
!
$GLOBALS['phpgw']->template->set_var('lang_billperae',lang('Bill per
workunit'));
$GLOBALS['phpgw']->template->set_var('lang_submit',lang('Submit'));
}
--- 119,124 ----
$GLOBALS['phpgw']->template->set_var('lang_end_time',lang('End time'));
$GLOBALS['phpgw']->template->set_var('lang_select_project',lang('Select
project'));
$GLOBALS['phpgw']->template->set_var('lang_minperae',lang('Minutes per
workunit'));
!
$GLOBALS['phpgw']->template->set_var('lang_billperae',lang('Bill per
hour/workunit'));
$GLOBALS['phpgw']->template->set_var('lang_submit',lang('Submit'));
}
***************
*** 132,138 ****
--- 134,143 ----
{
$GLOBALS['phpgw']->template->set_var('admin_info',lang('Administrator'));
+
$GLOBALS['phpgw']->template->set_var('break1',' | ');
$GLOBALS['phpgw']->template->set_var('space1',' ');
$GLOBALS['phpgw']->template->set_var('link_activities',$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiprojects.list_activities&action=act'));
$GLOBALS['phpgw']->template->set_var('lang_activities',lang('Activities'));
+
$GLOBALS['phpgw']->template->set_var('link_budget',$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiprojects.list_budget&action=mains'));
+
$GLOBALS['phpgw']->template->set_var('lang_budget',lang('budget'));
}
***************
*** 140,144 ****
{
$GLOBALS['phpgw']->template->set_var('book_info',lang('Bookkeeper'));
!
$GLOBALS['phpgw']->template->set_var('break',' | ');
$GLOBALS['phpgw']->template->set_var('space2',' ');
$GLOBALS['phpgw']->template->set_var('link_billing',$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uibilling.list_projects&action=mains'));
--- 145,149 ----
{
$GLOBALS['phpgw']->template->set_var('book_info',lang('Bookkeeper'));
!
$GLOBALS['phpgw']->template->set_var('break2',' | ');
$GLOBALS['phpgw']->template->set_var('space2',' ');
$GLOBALS['phpgw']->template->set_var('link_billing',$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uibilling.list_projects&action=mains'));
***************
*** 188,191 ****
--- 193,197 ----
$pro_parent =
get_var('pro_parent',array('POST','GET'));
+ $GLOBALS['phpgw_info']['flags']['app_header'] =
lang('projects') . ': ' . (($action == 'asubs')?lang('work hours
archive'):lang('list work hours'));
$this->display_app_header();
***************
*** 208,213 ****
$GLOBALS['phpgw']->template->set_var('state_action',$GLOBALS['phpgw']->link('/index.php',$link_data));
! $GLOBALS['phpgw_info']['flags']['app_header'] =
lang('projects') . ': ' . (($action == 'asubs')?lang('work hours
archive'):lang('list work hours'));
!
$GLOBALS['phpgw']->template->set_var('project_list',$this->boprojects->select_project_list('all',(($action
!= 'asubs')?$status:'archive'),$project_id));
switch($this->state)
--- 214,218 ----
$GLOBALS['phpgw']->template->set_var('state_action',$GLOBALS['phpgw']->link('/index.php',$link_data));
!
$GLOBALS['phpgw']->template->set_var('project_list',$this->boprojects->select_project_list('all',(($action
!= 'asubs')?$status:'archive'),$this->project_id));
switch($this->state)
***************
*** 238,251 ****
}
! $hours =
$this->boprojecthours->list_hours($this->start, True, $this->query,
$this->filter, $this->sort, $this->order, $this->state, $project_id);
// --------------------- nextmatch variable template-declarations
------------------------
! $left =
$this->nextmatchs->left('/index.php',$this->start,$this->boprojecthours->total_records,$link_data);
! $right =
$this->nextmatchs->right('/index.php',$this->start,$this->boprojecthours->total_records,$link_data);
$GLOBALS['phpgw']->template->set_var('left',$left);
$GLOBALS['phpgw']->template->set_var('right',$right);
!
$GLOBALS['phpgw']->template->set_var('lang_showing',$this->nextmatchs->show_hits($this->boprojecthours->total_records,$this->start));
// ------------------------- end nextmatch template
--------------------------------------
--- 243,256 ----
}
! $hours = $this->bo->list_hours($this->start, True,
$this->query, $this->filter, $this->sort, $this->order, $this->state,
$project_id);
// --------------------- nextmatch variable template-declarations
------------------------
! $left =
$this->nextmatchs->left('/index.php',$this->start,$this->bo->total_records,$link_data);
! $right =
$this->nextmatchs->right('/index.php',$this->start,$this->bo->total_records,$link_data);
$GLOBALS['phpgw']->template->set_var('left',$left);
$GLOBALS['phpgw']->template->set_var('right',$right);
!
$GLOBALS['phpgw']->template->set_var('lang_showing',$this->nextmatchs->show_hits($this->bo->total_records,$this->start));
// ------------------------- end nextmatch template
--------------------------------------
***************
*** 350,356 ****
$GLOBALS['phpgw']->template->set_var('action','');
}
-
-
$GLOBALS['phpgw']->template->pfp('out','hours_list_t',True);
$this->save_sessiondata();
}
--- 355,360 ----
$GLOBALS['phpgw']->template->set_var('action','');
}
$this->save_sessiondata();
+
$GLOBALS['phpgw']->template->pfp('out','hours_list_t',True);
}
***************
*** 413,422 ****
function edit_hours()
{
! $project_id =
get_var('project_id',array('POST','GET'));
! $pro_parent =
get_var('pro_parent',array('POST','GET'));
! $hours_id =
get_var('hours_id',array('POST','GET'));
! $values = get_var('values',array('POST'));
! $referer = get_var('referer',array('POST'));
if (! $values['submit'])
--- 417,429 ----
function edit_hours()
{
! $project_id =
get_var('project_id',array('POST','GET'));
! $pro_parent =
get_var('pro_parent',array('POST','GET'));
! $hours_id =
get_var('hours_id',array('POST','GET'));
!
! $values =
get_var('values',array('POST'));
! $referer =
get_var('referer',array('POST'));
! $delivery_id =
get_var('delivery_id',array('POST','GET'));
! $invoice_id =
get_var('invoice_id',array('POST','GET'));
if (! $values['submit'])
***************
*** 427,432 ****
if ($values['submit'])
{
$values['hours_id'] = $hours_id;
! $error =
$this->boprojecthours->check_values($values);
if (is_array($error))
{
--- 434,441 ----
if ($values['submit'])
{
+ $values['project_id'] = $project_id;
+ $values['pro_parent'] = $pro_parent;
$values['hours_id'] = $hours_id;
! $error = $this->bo->check_values($values);
if (is_array($error))
{
***************
*** 435,439 ****
else
{
!
$this->boprojecthours->save_hours($values);
Header('Location: ' . $referer);
}
--- 444,448 ----
else
{
! $this->bo->save_hours($values);
Header('Location: ' . $referer);
}
***************
*** 450,453 ****
--- 459,463 ----
);
+ $GLOBALS['phpgw_info']['flags']['app_header'] =
lang('projects') . ': ' . ($hours_id?lang('edit work hours'):lang('add work
hours'));
$this->display_app_header();
***************
*** 460,472 ****
$GLOBALS['phpgw']->template->set_var('hidden_vars','<input type="hidden"
name="referer" value="' . $referer . '">');
!
$GLOBALS['phpgw']->template->set_var('doneurl',$referer);
!
$GLOBALS['phpgw']->template->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php',$link_data));
! $GLOBALS['phpgw_info']['flags']['app_header'] =
lang('projects') . ': ' . ($hours_id?lang('edit work hours'):lang('add work
hours'));
if ($hours_id)
{
! $values =
$this->boprojecthours->read_single_hours($hours_id);
}
$GLOBALS['phpgw']->template->set_var('status_list',$this->status_format($values['status']));
$GLOBALS['phpgw']->template->set_var('employee_list',$this->employee_format($values['employee']));
--- 470,486 ----
$GLOBALS['phpgw']->template->set_var('hidden_vars','<input type="hidden"
name="referer" value="' . $referer . '">');
!
$GLOBALS['phpgw']->template->set_var('cancel_url',$referer . '&project_id=' .
$project_id);
!
$GLOBALS['phpgw']->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php',$link_data));
if ($hours_id)
{
! $values =
$this->bo->read_single_hours($hours_id);
!
! $activity_id = $values['activity_id'];
! $project_id = $values['project_id'];
! $pro_parent = $values['pro_parent'];
}
+
$GLOBALS['phpgw']->template->set_var('status_list',$this->status_format($values['status']));
$GLOBALS['phpgw']->template->set_var('employee_list',$this->employee_format($values['employee']));
***************
*** 554,566 ****
if ($values['pro_parent'] != 0)
{
!
$GLOBALS['phpgw']->template->set_var('pro_parent',$GLOBALS['phpgw']->strip_html($this->boprojects->return_value('pro',$values['pro_parent'])));
$GLOBALS['phpgw']->template->set_var('lang_pro_parent',lang('Main project:'));
}
!
$GLOBALS['phpgw']->template->set_var('project_name',$GLOBALS['phpgw']->strip_html($this->boprojects->return_value('pro',$values['project_id'])));
!
$GLOBALS['phpgw']->template->set_var('activity_list',$this->boprojects->select_hours_activities($values['project_id'],$values['activity_id']));
! $coordinator =
$this->boprojects->return_value('co',$values['project_id']);
if
($this->boprojects->check_perms($grants[$coordinator],PHPGW_ACL_DELETE) ||
$coordinator == $this->account)
--- 568,580 ----
if ($values['pro_parent'] != 0)
{
!
$GLOBALS['phpgw']->template->set_var('pro_parent',$GLOBALS['phpgw']->strip_html($this->boprojects->return_value('pro',$pro_parent)));
$GLOBALS['phpgw']->template->set_var('lang_pro_parent',lang('Main project:'));
}
!
$GLOBALS['phpgw']->template->set_var('project_name',$GLOBALS['phpgw']->strip_html($this->boprojects->return_value('pro',$project_id)));
!
$GLOBALS['phpgw']->template->set_var('activity_list',$this->boprojects->select_hours_activities($project_id,$activity_id));
! $coordinator =
$this->boprojects->return_value('co',$project_id);
if
($this->boprojects->check_perms($grants[$coordinator],PHPGW_ACL_DELETE) ||
$coordinator == $this->account)
***************
*** 584,587 ****
--- 598,602 ----
}
+ $this->save_sessiondata();
$GLOBALS['phpgw']->template->set_var('edithandle','');
$GLOBALS['phpgw']->template->set_var('addhandle','');
***************
*** 593,598 ****
function view_hours()
{
! $hours_id =
get_var('hours_id',array('POST','GET'));
! $referer = get_var('referer',array('POST'));
$referer = $GLOBALS['HTTP_SERVER_VARS']['HTTP_REFERER']
? $GLOBALS['HTTP_SERVER_VARS']['HTTP_REFERER'] : $GLOBALS['HTTP_REFERER'];
--- 608,614 ----
function view_hours()
{
! $hours_id = get_var('hours_id',array('GET'));
! //$referer = get_var('referer',array('POST'));
! $project_id = get_var('project_id',array('GET'));
$referer = $GLOBALS['HTTP_SERVER_VARS']['HTTP_REFERER']
? $GLOBALS['HTTP_SERVER_VARS']['HTTP_REFERER'] : $GLOBALS['HTTP_REFERER'];
***************
*** 600,611 ****
if (!$hours_id)
{
! Header('Location: ' . $referer);
}
$this->display_app_header();
$GLOBALS['phpgw']->template->set_file(array('hours_view' => 'hours_view.tpl'));
!
$GLOBALS['phpgw']->template->set_var('lang_action',lang('View work hours'));
!
$GLOBALS['phpgw']->template->set_var('doneurl',$referer);
$nopref = $this->boprojects->check_prefs();
--- 616,627 ----
if (!$hours_id)
{
! $GLOBALS['phpgw']->redirect_link($referer);
}
+ $GLOBALS['phpgw_info']['flags']['app_header'] =
lang('projects') . ': ' . lang('view work hours');
$this->display_app_header();
$GLOBALS['phpgw']->template->set_file(array('hours_view' => 'hours_view.tpl'));
! $GLOBALS['phpgw']->template->set_var('doneurl',$referer
. '&project_id=' . $project_id);
$nopref = $this->boprojects->check_prefs();
***************
*** 619,623 ****
}
! $values =
$this->boprojecthours->read_single_hours($hours_id);
$GLOBALS['phpgw']->template->set_var('status',lang($values['status']));
--- 635,639 ----
}
! $values = $this->bo->read_single_hours($hours_id);
$GLOBALS['phpgw']->template->set_var('status',lang($values['status']));
***************
*** 676,681 ****
if ($confirm)
{
! $this->boprojecthours->delete_hours($hours_id);
! Header('Location: ' .
$GLOBALS['phpgw']->link('/index.php',$link_data));
}
--- 692,697 ----
if ($confirm)
{
! $this->bo->delete_hours($hours_id);
!
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
}
Index: class.uiprojects.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.uiprojects.inc.php,v
retrieving revision 1.63
retrieving revision 1.64
diff -C2 -r1.63 -r1.64
*** class.uiprojects.inc.php 27 Apr 2003 22:41:12 -0000 1.63
--- class.uiprojects.inc.php 17 Jun 2003 12:39:16 -0000 1.64
***************
*** 48,52 ****
'abook' => True,
'preferences' => True,
! 'archive' => True
);
--- 48,55 ----
'abook' => True,
'preferences' => True,
! 'archive' => True,
! 'accounts_popup' => True,
[...1986 lines suppressed...]
+ {
+ $pcosts[$i]['month'] =
$pcosts[$i]['month'] + (60*60) *
$GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'];
+ $pdateout =
$GLOBALS['phpgw']->common->show_date($pcosts[$i]['month'],'n/Y');
+ }
+ else
+ {
+ $pdateout = ' ';
+ }
+
+ $GLOBALS['phpgw']->template->set_var(array
+ (
+ 'month' => $pdateout,
+ 'pcosts' =>
($pcosts[$i]['pcosts']?$pcosts[$i]['pcosts']:' ')
+ ));
+
+
$GLOBALS['phpgw']->template->parse('list','projects_list',True);
+ }
+
$GLOBALS['phpgw']->template->pfp('out','projects_list_t',True);
}
}
Index: class.uistatistics.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.uistatistics.inc.php,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** class.uistatistics.inc.php 26 Apr 2003 01:22:39 -0000 1.17
--- class.uistatistics.inc.php 17 Jun 2003 12:39:16 -0000 1.18
***************
*** 124,130 ****
--- 124,133 ----
{
$GLOBALS['phpgw']->template->set_var('admin_info',lang('Administrator'));
+
$GLOBALS['phpgw']->template->set_var('break1',' | ');
$GLOBALS['phpgw']->template->set_var('space1',' ');
$GLOBALS['phpgw']->template->set_var('link_activities',$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiprojects.list_activities&action=act'));
$GLOBALS['phpgw']->template->set_var('lang_activities',lang('Activities'));
+
$GLOBALS['phpgw']->template->set_var('link_budget',$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiprojects.list_budget&action=mains'));
+
$GLOBALS['phpgw']->template->set_var('lang_budget',lang('budget'));
}
***************
*** 132,136 ****
{
$GLOBALS['phpgw']->template->set_var('book_info',lang('Bookkeeper'));
!
$GLOBALS['phpgw']->template->set_var('break',' | ');
$GLOBALS['phpgw']->template->set_var('space2',' ');
$GLOBALS['phpgw']->template->set_var('link_billing',$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uibilling.list_projects&action=mains'));
--- 135,139 ----
{
$GLOBALS['phpgw']->template->set_var('book_info',lang('Bookkeeper'));
!
$GLOBALS['phpgw']->template->set_var('break2',' | ');
$GLOBALS['phpgw']->template->set_var('space2',' ');
$GLOBALS['phpgw']->template->set_var('link_billing',$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uibilling.list_projects&action=mains'));
***************
*** 160,163 ****
--- 163,167 ----
$pro_parent =
get_var('pro_parent',array('POST','GET'));
+ $GLOBALS['phpgw_info']['flags']['app_header'] =
lang('projects') . ': ' . ($pro_parent?lang('list jobs'):lang('list projects'));
$this->display_app_header();
***************
*** 204,208 ****
{
$action_list= '<form method="POST" action="' .
$GLOBALS['phpgw']->link('/index.php',$link_data) . '" name="form">' . "\n"
! . '<select
name="cat_id" onChange="this.form.submit();"><option value="">' . lang('None')
. '</option>' . "\n"
.
$this->cats->formatted_list('select','all',$this->cat_id,True) . '</select>';
$GLOBALS['phpgw']->template->set_var(lang_header,lang('Project list'));
--- 208,212 ----
{
$action_list= '<form method="POST" action="' .
$GLOBALS['phpgw']->link('/index.php',$link_data) . '" name="form">' . "\n"
! . '<select
name="cat_id" onChange="this.form.submit();"><option value="">' . lang('Select
category') . '</option>' . "\n"
.
$this->cats->formatted_list('select','all',$this->cat_id,True) . '</select>';
$GLOBALS['phpgw']->template->set_var(lang_header,lang('Project list'));
***************
*** 248,254 ****
{
$this->nextmatchs->template_alternate_row_color(&$GLOBALS['phpgw']->template);
- $title =
$GLOBALS['phpgw']->strip_html($pro[$i]['title']);
- if (! $title) $title = ' ';
-
$edate = $pro[$i]['edate'];
if ($edate == 0)
--- 252,255 ----
***************
*** 270,311 ****
if ($action == 'mains')
{
! if ($pro[$i]['customer'] != 0)
! {
! $customer =
$this->boprojects->read_single_contact($pro[$i]['customer']);
! if ($customer[0]['org_name'] == '') {
$td_action = $customer[0]['n_given'] . ' ' . $customer[0]['n_family']; }
! else { $td_action = $customer[0]['org_name'] .
' [ ' . $customer[0]['n_given'] . ' ' . $customer[0]['n_family'] . ' ]'; }
! }
! else { $td_action = ' '; }
}
else
{
! $sdate = $pro[$i]['sdate'];
! if ($sdate == 0) { $sdateout =
' '; }
! else
! {
! $month =
$GLOBALS['phpgw']->common->show_date(time(),'n');
! $day =
$GLOBALS['phpgw']->common->show_date(time(),'d');
! $year =
$GLOBALS['phpgw']->common->show_date(time(),'Y');
!
! $sdate = $sdate + (60*60) *
$GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'];
! $td_action =
$GLOBALS['phpgw']->common->show_date($sdate,$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
! }
}
- $cached_data =
$this->boprojects->cached_accounts($pro[$i]['coordinator']);
- $coordinatorout =
$GLOBALS['phpgw']->strip_html($cached_data[$pro[$i]['coordinator']]['account_lid']
- . ' [' .
$cached_data[$pro[$i]['coordinator']]['firstname'] . ' '
- .
$cached_data[$pro[$i]['coordinator']]['lastname'] . ' ]');
-
// --------------- template declaration for list records
-------------------------------------
$GLOBALS['phpgw']->template->set_var(array
(
! 'number' =>
$GLOBALS['phpgw']->strip_html($pro[$i]['number']),
'td_action' => $td_action,
'status' =>
lang($pro[$i]['status']),
! 'title' => $title,
'end_date' => $edateout,
! 'coordinator' => $coordinatorout
));
--- 271,291 ----
if ($action == 'mains')
{
! $td_action =
($pro[$i]['customerout']?$pro[$i]['customerout']:' ');
}
else
{
! $td_action =
($pro[$i]['sdateout']?$pro[$i]['sdateout']:' ');
}
// --------------- template declaration for list records
-------------------------------------
$GLOBALS['phpgw']->template->set_var(array
(
! 'number' =>
$pro[$i]['number'],
'td_action' => $td_action,
'status' =>
lang($pro[$i]['status']),
! 'title' =>
($pro[$i]['title']?$pro[$i]['title']:' '),
'end_date' => $edateout,
! 'coordinator' =>
$pro[$i]['coordinatorout']
));
***************
*** 377,380 ****
--- 357,361 ----
$action = get_var('action',array('POST','GET'));
+ $GLOBALS['phpgw_info']['flags']['app_header'] =
lang('projects') . ': ' . lang('User statistics');
$this->display_app_header();
***************
*** 382,386 ****
$GLOBALS['phpgw']->template->set_block('user_list_t','user_list','list');
-
$GLOBALS['phpgw']->template->set_var('lang_action',lang('User statistics'));
$GLOBALS['phpgw']->template->set_var('search_action',$GLOBALS['phpgw']->link('/index.php',$link_data));
$GLOBALS['phpgw']->template->set_var('search_list',$this->nextmatchs->search(1));
--- 363,366 ----
***************
*** 462,468 ****
if (! $account_id)
{
! Header('Location: ' .
$phpgw->link('/index.php','menuaction=projects.uistatistics.list_users&action=ustat'));
}
$this->display_app_header();
--- 442,449 ----
if (! $account_id)
{
!
$phpgw->redirect_link('/index.php','menuaction=projects.uistatistics.list_users&action=ustat');
}
+ $GLOBALS['phpgw_info']['flags']['app_header'] =
lang('projects') . ': ' . lang('User statistics');
$this->display_app_header();
***************
*** 470,474 ****
$GLOBALS['phpgw']->template->set_block('user_stat_t','user_stat','stat');
-
$GLOBALS['phpgw']->template->set_var('lang_action',lang('User statistic'));
$GLOBALS['phpgw']->template->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php',$link_data));
--- 451,454 ----
***************
*** 605,611 ****
if (! $project_id)
{
! Header('Location: ' .
$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uistatistics.list_projects&action=mains'));
}
$this->display_app_header();
--- 585,592 ----
if (! $project_id)
{
!
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction=projects.uistatistics.list_projects&action=mains');
}
+ $GLOBALS['phpgw_info']['flags']['app_header'] =
lang('projects') . ': ' . lang('project statistic');
$this->display_app_header();
***************
*** 626,630 ****
$GLOBALS['phpgw']->template->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php',$link_data));
-
$GLOBALS['phpgw']->template->set_var('lang_action',lang('Project statistic'));
$title = $GLOBALS['phpgw']->strip_html($pro['title']);
--- 607,610 ----
Index: hook_add_def_pref.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/hook_add_def_pref.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
Index: hook_deleteaccount.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/hook_deleteaccount.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: projects/inc class.bodeliveries.inc.php,1.16,1.17 class.boprojecthours.inc.php,1.9,1.10class.boprojects.inc.php,1.50,1.51 class.sobilling.inc.php,1.13,1.14class.sodeliveries.inc.php,1.17,1.18 class.soprojecthours.inc.php,1.9,1.10class.soprojects.inc.php,1.41,1.42 class.sostatistics.inc.php,1.8,1.9class.uibilling.inc.php,1.29,1.30 class.uideliveries.inc.php,1.29,1.30class.uiprojecthours.inc.php,1.30,1.31 class.uiprojects.inc.php,1.63,1.64class.uistatistics.inc.php,1.17,1.18 hook_add_def_pref.inc.php,1.4,1.5hook_deleteaccount.inc.php,1.3,1.4,
Bettina Gille <address@hidden> <=
- Prev by Date:
[Phpgroupware-cvs] CVS: projects/templates/default list_budget.tpl,1.1,1.2 list_pcosts.tpl,1.1,1.2 addressbook.tpl,1.15,1.16 archive.tpl,1.6,1.7 bill_list.tpl,1.14,1.15 bill_listhours.tpl,1.21,1.22 bill_listinvoice.tpl,1.11,1.12 del_listhours.tpl,1.17,1.18 delete.tpl,1.10,1.11 form.tpl,1.34,1.35 form_admin.tpl,1.4,1.5 formactivity.tpl,1.15,1.16 header.tpl,1.17,1.18 hours_formhours.tpl,1.21,1.22 hours_listhours.tpl,1.17,1.18 hours_view.tpl,1.6,1.7 list.tpl,1.27,1.28 list_admin.tpl,1.7,1.8 listactivities.tpl,1.17,1.18 preference_colspan.tpl,1.3,1.4 preferences.tpl,1.21,1.22 stats_projectlist.tpl,1.12,1.13 stats_projectstat.tpl,1.12,1.13 stats_userlist.tpl,1.10,1.11 stats_userstat.tpl,1.12,1.13 view.tpl,1.7,1.8
- Next by Date:
[Phpgroupware-cvs] CVS: phpgwapi/inc class.categories.inc.php,1.109,1.110
- Previous by thread:
[Phpgroupware-cvs] CVS: projects/templates/default list_budget.tpl,1.1,1.2 list_pcosts.tpl,1.1,1.2 addressbook.tpl,1.15,1.16 archive.tpl,1.6,1.7 bill_list.tpl,1.14,1.15 bill_listhours.tpl,1.21,1.22 bill_listinvoice.tpl,1.11,1.12 del_listhours.tpl,1.17,1.18 delete.tpl,1.10,1.11 form.tpl,1.34,1.35 form_admin.tpl,1.4,1.5 formactivity.tpl,1.15,1.16 header.tpl,1.17,1.18 hours_formhours.tpl,1.21,1.22 hours_listhours.tpl,1.17,1.18 hours_view.tpl,1.6,1.7 list.tpl,1.27,1.28 list_admin.tpl,1.7,1.8 listactivities.tpl,1.17,1.18 preference_colspan.tpl,1.3,1.4 preferences.tpl,1.21,1.22 stats_projectlist.tpl,1.12,1.13 stats_projectstat.tpl,1.12,1.13 stats_userlist.tpl,1.10,1.11 stats_userstat.tpl,1.12,1.13 view.tpl,1.7,1.8
- Next by thread:
[Phpgroupware-cvs] CVS: phpgwapi/inc class.categories.inc.php,1.109,1.110
- Index(es):