[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: projects/inc class.bobilling.inc.php, 1.8, 1.9 c
From: |
Bettina Gille <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: projects/inc class.bobilling.inc.php, 1.8, 1.9 class.bodeliveries.inc.php, 1.17, 1.18 class.boprojecthours.inc.php, 1.10, 1.11 class.boprojects.inc.php, 1.51, 1.52 class.bostatistics.inc.php, 1.3, 1.4 class.sobilling.inc.php, 1.14, 1.15 class.sodeliveries.inc.php, 1.18, 1.19 class.soprojecthours.inc.php, 1.10, 1.11 class.soprojects.inc.php, 1.42, 1.43 class.sostatistics.inc.php, 1.9, 1.10 class.uibilling.inc.php, 1.30, 1.31 class.uideliveries.inc.php, 1.30, 1.31 class.uiprojecthours.inc.php, 1.31, 1.32 class.uiprojects.inc.php, 1.64, 1.65 class.uistatistics.inc.php, 1.18, 1.19 hook_add_def_pref.inc.php, 1.5, 1.6 hook_admin.inc.php, 1.12, 1.13 hook_deleteaccount.inc.php, 1.4, 1.5 hook_preferences.inc.php, 1.20, 1.21 |
Date: |
Tue, 09 Sep 2003 20:29:00 -0400 |
Update of /cvsroot/phpgroupware/projects/inc
In directory subversions:/tmp/cvs-serv16904/inc
Modified Files:
class.bobilling.inc.php class.bodeliveries.inc.php
class.boprojecthours.inc.php class.boprojects.inc.php
class.bostatistics.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_admin.inc.php hook_deleteaccount.inc.php
hook_preferences.inc.php
Log Message:
update
Index: class.bobilling.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.bobilling.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** class.bobilling.inc.php 5 Jan 2002 03:26:42 -0000 1.8
--- class.bobilling.inc.php 10 Sep 2003 00:28:56 -0000 1.9
***************
*** 3,11 ****
* phpGroupWare - Projects *
* http://www.phpgroupware.org *
* *
* Project Manager *
* Written by Bettina Gille address@hidden *
* ----------------------------------------------- *
! * Copyright (C) 2000, 2001 Bettina Gille *
* *
* This program is free software; you can redistribute it and/or *
--- 3,12 ----
* phpGroupWare - Projects *
* http://www.phpgroupware.org *
+ * This program is part of the GNU project, see http://www.gnu.org/
*
* *
* Project Manager *
* Written by Bettina Gille address@hidden *
* ----------------------------------------------- *
! * Copyright 2000 - 2003 Free Software Foundation, Inc *
* *
* This program is free software; you can redistribute it and/or *
***************
*** 24,27 ****
--- 25,29 ----
\*******************************************************************/
/* $Id$ */
+ /* $Source$ */
class bobilling
Index: class.bodeliveries.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.bodeliveries.inc.php,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** class.bodeliveries.inc.php 17 Jun 2003 12:39:16 -0000 1.17
--- class.bodeliveries.inc.php 10 Sep 2003 00:28:56 -0000 1.18
***************
*** 3,11 ****
* phpGroupWare - Projects *
* http://www.phpgroupware.org *
* *
* Project Manager *
* Written by Bettina Gille address@hidden *
* ----------------------------------------------- *
! * Copyright (C) 2000,2001,2002 Bettina Gille *
* *
* This program is free software; you can redistribute it and/or *
--- 3,12 ----
* phpGroupWare - Projects *
* http://www.phpgroupware.org *
+ * This program is part of the GNU project, see http://www.gnu.org/
*
* *
* Project Manager *
* Written by Bettina Gille address@hidden *
* ----------------------------------------------- *
! * Copyright 2000 - 2003 Free Software Foundation, Inc *
* *
* This program is free software; you can redistribute it and/or *
***************
*** 24,27 ****
--- 25,29 ----
\*******************************************************************/
/* $Id$ */
+ /* $Source$ */
class bodeliveries
Index: class.boprojecthours.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.boprojecthours.inc.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** class.boprojecthours.inc.php 17 Jun 2003 12:39:16 -0000 1.10
--- class.boprojecthours.inc.php 10 Sep 2003 00:28:57 -0000 1.11
***************
*** 3,11 ****
* phpGroupWare - Projects *
* http://www.phpgroupware.org *
* *
* Project Manager *
* Written by Bettina Gille address@hidden *
* ----------------------------------------------- *
! * Copyright (C) 2000,2001,2002 Bettina Gille *
* *
* This program is free software; you can redistribute it and/or *
--- 3,12 ----
* phpGroupWare - Projects *
* http://www.phpgroupware.org *
+ * This program is part of the GNU project, see http://www.gnu.org/
*
* *
* Project Manager *
* Written by Bettina Gille address@hidden *
* ----------------------------------------------- *
! * Copyright 2000 - 2003 Free Software Foundation, Inc *
* *
* This program is free software; you can redistribute it and/or *
***************
*** 24,27 ****
--- 25,29 ----
\*******************************************************************/
/* $Id$ */
+ // $Source$
class boprojecthours
***************
*** 54,63 ****
}
! $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'));
--- 56,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'));
***************
*** 84,93 ****
$data =
$GLOBALS['phpgw']->session->appsession('session_data','projects_hours');
! $this->start = $data['start'];
! $this->query = $data['query'];
! $this->filter = $data['filter'];
! $this->order = $data['order'];
! $this->sort = $data['sort'];
! $this->state = $data['state'];
$this->project_id = $data['project_id'];
}
--- 86,95 ----
$data =
$GLOBALS['phpgw']->session->appsession('session_data','projects_hours');
! $this->start = $data['start'];
! $this->query = $data['query'];
! $this->filter = $data['filter'];
! $this->order = $data['order'];
! $this->sort = $data['sort'];
! $this->state = $data['state'];
$this->project_id = $data['project_id'];
}
***************
*** 106,109 ****
--- 108,116 ----
}
+ function member()
+ {
+ return $this->boprojects->member($this->project_id);
+ }
+
function check_values($values)
{
***************
*** 234,238 ****
}
! if ($values['hours_id'] && $values['hours_id'] != 0)
{
$this->soprojecthours->edit_hours($values);
--- 241,250 ----
}
! if (!$values['employee'])
! {
! $values['employee'] =
$this->soprojecthours->account;
! }
!
! if (intval($values['hours_id']) > 0)
{
$this->soprojecthours->edit_hours($values);
Index: class.boprojects.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.boprojects.inc.php,v
retrieving revision 1.51
retrieving revision 1.52
diff -C2 -r1.51 -r1.52
*** class.boprojects.inc.php 17 Jun 2003 12:39:16 -0000 1.51
--- class.boprojects.inc.php 10 Sep 2003 00:28:57 -0000 1.52
***************
*** 3,11 ****
* phpGroupWare - Projects *
* http://www.phpgroupware.org *
* *
* Project Manager *
* Written by Bettina Gille address@hidden *
* ----------------------------------------------- *
! * Copyright (C) 2000 - 2003 Bettina Gille *
* *
* This program is free software; you can redistribute it and/or *
--- 3,12 ----
* phpGroupWare - Projects *
* http://www.phpgroupware.org *
+ * This program is part of the GNU project, see http://www.gnu.org/
*
* *
* Project Manager *
* Written by Bettina Gille address@hidden *
* ----------------------------------------------- *
! * Copyright 2000 - 2003 Free Software Foundation, Inc *
* *
* This program is free software; you can redistribute it and/or *
***************
*** 24,27 ****
--- 25,29 ----
\*******************************************************************/
/* $Id$ */
+ // $Source$
class boprojects
***************
*** 73,76 ****
--- 75,79 ----
$this->sohours =
CreateObject('projects.soprojecthours');
$this->contacts = CreateObject('phpgwapi.contacts');
+ $this->cats =
CreateObject('phpgwapi.categories');
if ($session)
***************
*** 163,168 ****
$cached_data[$this->accounts->data['account_id']]['account_id'] =
$this->accounts->data['account_id'];
$cached_data[$this->accounts->data['account_id']]['account_lid'] =
$this->accounts->data['account_lid'];
!
$cached_data[$this->accounts->data['account_id']]['firstname'] =
$this->accounts->data['firstname'];
!
$cached_data[$this->accounts->data['account_id']]['lastname'] =
$this->accounts->data['lastname'];
return $cached_data;
--- 166,171 ----
$cached_data[$this->accounts->data['account_id']]['account_id'] =
$this->accounts->data['account_id'];
$cached_data[$this->accounts->data['account_id']]['account_lid'] =
$this->accounts->data['account_lid'];
!
$cached_data[$this->accounts->data['account_id']]['firstname'] =
$this->accounts->data['firstname'];
!
$cached_data[$this->accounts->data['account_id']]['lastname'] =
$this->accounts->data['lastname'];
return $cached_data;
***************
*** 230,233 ****
--- 233,239 ----
$prefs['mysize'] =
$GLOBALS['phpgw_info']['user']['preferences']['projects']['mysize'];
$prefs['allsize'] =
$GLOBALS['phpgw_info']['user']['preferences']['projects']['allsize'];
+ $prefs['notify_mstone'] =
$GLOBALS['phpgw_info']['user']['preferences']['projects']['notify_mstone'];
+ $prefs['notify_task'] =
$GLOBALS['phpgw_info']['user']['preferences']['projects']['notify_task'];
+ $prefs['notify_assign'] =
$GLOBALS['phpgw_info']['user']['preferences']['projects']['notify_assign'];
}
return $prefs;
***************
*** 238,242 ****
$GLOBALS['phpgw']->preferences->read_repository();
! if ($prefs)
{
$GLOBALS['phpgw']->preferences->change('projects','tax',$prefs['tax']);
--- 244,248 ----
$GLOBALS['phpgw']->preferences->read_repository();
! if (is_array($prefs))
{
$GLOBALS['phpgw']->preferences->change('projects','tax',$prefs['tax']);
***************
*** 246,249 ****
--- 252,259 ----
$GLOBALS['phpgw']->preferences->change('projects','mysize',$prefs['mysize']);
$GLOBALS['phpgw']->preferences->change('projects','allsize',$prefs['allsize']);
+
$GLOBALS['phpgw']->preferences->change('projects','notify_mstone',(isset($prefs['notify_mstone'])?'yes':''));
+
$GLOBALS['phpgw']->preferences->change('projects','notify_task',(isset($prefs['notify_task'])?'yes':''));
+
$GLOBALS['phpgw']->preferences->change('projects','notify_assign',(isset($prefs['notify_assign'])?'yes':''));
+
$GLOBALS['phpgw']->preferences->save_repository(True);
// _debug_array($prefs);
***************
*** 301,304 ****
--- 311,317 ----
$prefs['mysize'] =
$GLOBALS['phpgw_info']['user']['preferences']['projects']['mysize'];
$prefs['allsize'] =
$GLOBALS['phpgw_info']['user']['preferences']['projects']['allsize'];
+ $prefs['notify_mstone'] =
$GLOBALS['phpgw_info']['user']['preferences']['projects']['notify_mstone'];
+ $prefs['notify_task'] =
$GLOBALS['phpgw_info']['user']['preferences']['projects']['notify_task'];
+ $prefs['notify_assign'] =
$GLOBALS['phpgw_info']['user']['preferences']['projects']['notify_assign'];
}
}
***************
*** 312,315 ****
--- 325,356 ----
}
+ function get_acl_for_project($project_id)
+ {
+ return
$GLOBALS['phpgw']->acl->get_ids_for_location($project_id, 7);
+ }
+
+ function selected_employees($project_id)
+ {
+ $emps = $this->get_acl_for_project($project_id);
+
+ if (is_array($emps))
+ {
+ for($i=0;$i<count($emps);$i++)
+ {
+ $this->accounts =
CreateObject('phpgwapi.accounts',$emps[$i]);
+ $this->accounts->read_repository();
+
+ $empl[] = array
+ (
+ 'account_id' =>
$this->accounts->data['account_id'],
+ 'account_lid' =>
$this->accounts->data['account_lid'],
+ 'account_firstname' =>
$this->accounts->data['firstname'],
+ 'account_lastname' =>
$this->accounts->data['lastname']
+ );
+ }
+ }
+ return $empl;
+ }
+
function read_admins($action, $type)
{
***************
*** 390,396 ****
}
! 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))
--- 431,449 ----
}
! function list_projects($type, $parent)
{
! $pro_list = $this->so->read_projects(array
! (
!
'start' => $this->start,
!
'limit' => True,
!
'query' => $this->query,
!
'filter' => $this->filter,
!
'sort' => $this->sort,
!
'order' => $this->order,
!
'status' => $this->status,
!
'cat_id' => $this->cat_id,
!
'type' => $type,
!
'parent' => $parent
! ));
while (is_array($pro_list) &&
list(,$pro)=each($pro_list))
***************
*** 400,404 ****
. ' [' .
$cached_data[$pro['coordinator']]['firstname'] . ' '
.
$cached_data[$pro['coordinator']]['lastname'] . ' ]');
! if ($pro['customer'])
{
$customer =
$this->read_single_contact($pro['customer']);
--- 453,457 ----
. ' [' .
$cached_data[$pro['coordinator']]['firstname'] . ' '
.
$cached_data[$pro['coordinator']]['lastname'] . ' ]');
! /*if ($pro['customer'])
{
$customer =
$this->read_single_contact($pro['customer']);
***************
*** 408,412 ****
$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
--- 461,477 ----
$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']);*/
!
! $mlist = '';
! $mstones =
$this->get_mstones($pro['project_id']);
! if (is_array($mstones))
! {
! $mlist = '<table width="100%"
border="0" cellpadding="0" cellspacing="0">' . "\n";
! for ($i=0;$i<count($mstones);$i++)
! {
! $mlist .= '<tr><td
width="50%">' . $mstones[$i]['title'] . '</td><td width="50%" align="right">' .
$this->formatted_edate($mstones[$i]['edate']) . '</td></tr>' . "\n";
! }
! $mlist .= '</table>';
! }
$projects[] = array
***************
*** 425,429 ****
'pcosts' =>
$pro['pcosts'],
'edate' =>
$pro['edate'],
! 'status' =>
$pro['status']
);
}
--- 490,496 ----
'pcosts' =>
$pro['pcosts'],
'edate' =>
$pro['edate'],
! 'status' =>
$pro['status'],
! 'level' =>
$pro['level'],
! 'mstones' =>
$mlist
);
}
***************
*** 764,779 ****
//_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);
}
}
--- 831,854 ----
//_debug_array($values);
! if (intval($values['project_id']) > 0)
{
! $this->so->edit_project($values,
$book_activities, $bill_activities);
}
else
{
! $values['project_id'] =
$this->so->add_project($values, $book_activities, $bill_activities);
}
+
+ $values['project_id'] = intval($values['project_id']);
+
+ if (is_array($values['employees']))
+ {
+ $this->so->delete_acl($values['project_id']);
+ for($i=0;$i<count($values['employees']);$i++)
+ {
+
$GLOBALS['phpgw']->acl->add_repository('projects',$values['project_id'],$values['employees'][$i],7);
+ }
+ }
+ return $values['project_id'];
}
***************
*** 804,811 ****
}
! function select_project_list($type, $status, $project_id)
{
! $list = $this->so->select_project_list($type, $status,
$project_id);
! return $list;
}
--- 879,885 ----
}
! function select_project_list($values)
{
! return $this->so->select_project_list($values);
}
***************
*** 825,828 ****
--- 899,986 ----
{
$this->so->change_owner($old, $new);
+ }
+
+ function get_mstones($project_id)
+ {
+ $mstones = $this->so->get_mstones($project_id);
+
+ while (is_array($mstones) && list(,$ms) =
each($mstones))
+ {
+ $stones[] = array
+ (
+ 'title' =>
$GLOBALS['phpgw']->strip_html($ms['title']),
+ 'edate' => $ms['edate'],
+ 's_id' => $ms['s_id']
+ );
+ }
+ return $stones;
+ }
+
+ function get_single_mstone($s_id)
+ {
+ return $this->so->get_single_mstone($s_id);
+ }
+
+ function save_mstone($values)
+ {
+ $values['edate'] =
mktime(0,0,0,$values['emonth'],$values['eday'],$values['eyear']);
+
+ if (isset($values['old_edate']) &&
intval($values['old_edate']) > 0)
+ {
+ if ($values['old_edate'] != $values['edate'])
+ {
+ $this->send_alarm($values);
+ }
+ }
+
+ if (intval($values['s_id']) > 0)
+ {
+ $this->so->edit_mstone($values);
+ }
+ else
+ {
+ return $this->so->add_mstone($values);
+ }
+ }
+
+ function delete_mstone($s_id)
+ {
+ $this->so->delete_mstone($s_id);
+ }
+
+ function formatted_edate($edate = '')
+ {
+ $edate = intval($edate);
+
+ $month =
$GLOBALS['phpgw']->common->show_date(time(),'n');
+ $day =
$GLOBALS['phpgw']->common->show_date(time(),'d');
+ $year =
$GLOBALS['phpgw']->common->show_date(time(),'Y');
+
+ if ($edate > 0)
+ {
+ $edate = $edate + (60*60) *
$GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'];
+ $edateout =
$GLOBALS['phpgw']->common->show_date($edate,$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
+ }
+
+ if (mktime(2,0,0,$month,$day,$year) == $edate)
+ {
+ $edateout = '<b>' . $edateout . '</b>';
+ }
+ if (mktime(2,0,0,$month,$day,$year) >= $edate)
+ {
+ $edateout = '<font color="CC0000"><b>' .
$edateout . '</b></font>';
+ }
+
+ return $edateout;
+ }
+
+ function member($project_id = '')
+ {
+ return $this->so->member($project_id);
+ }
+
+ function send_alarm($values)
+ {
+
}
}
Index: class.bostatistics.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.bostatistics.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** class.bostatistics.inc.php 11 Jan 2002 00:40:18 -0000 1.3
--- class.bostatistics.inc.php 10 Sep 2003 00:28:57 -0000 1.4
***************
*** 3,11 ****
* phpGroupWare - Projects *
* http://www.phpgroupware.org *
* *
* Project Manager *
* Written by Bettina Gille address@hidden *
* ----------------------------------------------- *
! * Copyright (C) 2000, 2001 Bettina Gille *
* *
* This program is free software; you can redistribute it and/or *
--- 3,12 ----
* phpGroupWare - Projects *
* http://www.phpgroupware.org *
+ * This program is part of the GNU project, see http://www.gnu.org/
*
* *
* Project Manager *
* Written by Bettina Gille address@hidden *
* ----------------------------------------------- *
! * Copyright 2000 - 2003 Free Software Foundation, Inc *
* *
* This program is free software; you can redistribute it and/or *
***************
*** 24,27 ****
--- 25,29 ----
\*******************************************************************/
/* $Id$ */
+ /* $Source$ */
class bostatistics
***************
*** 56,73 ****
function get_userstat_pro($account_id, $values)
{
! $pro = $this->sostatistics->user_stat_pro($account_id,
$values);
! return $pro;
}
function get_stat_hours($type, $account_id, $project_id,
$values)
{
! $hours = $this->sostatistics->stat_hours($type,
$account_id, $project_id, $values);
! return $hours;
}
function get_employees($project_id, $values)
{
! $employees =
$this->sostatistics->pro_stat_employees($project_id, $values);
! return $employees;
}
}
--- 58,72 ----
function get_userstat_pro($account_id, $values)
{
! return $this->sostatistics->user_stat_pro($account_id,
$values);
}
function get_stat_hours($type, $account_id, $project_id,
$values)
{
! return $this->sostatistics->stat_hours($type,
$account_id, $project_id, $values);
}
function get_employees($project_id, $values)
{
! return
$this->sostatistics->pro_stat_employees($project_id, $values);
}
}
Index: class.sobilling.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.sobilling.inc.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** class.sobilling.inc.php 17 Jun 2003 12:39:16 -0000 1.14
--- class.sobilling.inc.php 10 Sep 2003 00:28:57 -0000 1.15
***************
*** 3,11 ****
* phpGroupWare - Projects *
* http://www.phpgroupware.org *
* *
* Project Manager *
* Written by Bettina Gille address@hidden *
* ----------------------------------------------- *
! * Copyright (C) 2000 - 2003 Bettina Gille *
* *
* This program is free software; you can redistribute it and/or *
--- 3,12 ----
* phpGroupWare - Projects *
* http://www.phpgroupware.org *
+ * This program is part of the GNU project, see http://www.gnu.org/
*
* *
* Project Manager *
* Written by Bettina Gille address@hidden *
* ----------------------------------------------- *
! * Copyright 2000 - 2003 Free Software Foundation, Inc *
* *
* This program is free software; you can redistribute it and/or *
***************
*** 24,27 ****
--- 25,29 ----
\*******************************************************************/
/* $Id$ */
+ /* $Source$ */
class sobilling
Index: class.sodeliveries.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.sodeliveries.inc.php,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** class.sodeliveries.inc.php 17 Jun 2003 12:39:16 -0000 1.18
--- class.sodeliveries.inc.php 10 Sep 2003 00:28:57 -0000 1.19
***************
*** 3,11 ****
* phpGroupWare - Projects *
* http://www.phpgroupware.org *
* *
* Project Manager *
* Written by Bettina Gille address@hidden *
* ----------------------------------------------- *
! * Copyright (C) 2000 - 2003 Bettina Gille *
* *
* This program is free software; you can redistribute it and/or *
--- 3,12 ----
* phpGroupWare - Projects *
* http://www.phpgroupware.org *
+ * This program is part of the GNU project, see http://www.gnu.org/
*
* *
* Project Manager *
* Written by Bettina Gille address@hidden *
* ----------------------------------------------- *
! * Copyright 2000 - 2003 Free Software Foundation, Inc *
* *
* This program is free software; you can redistribute it and/or *
***************
*** 24,27 ****
--- 25,29 ----
\*******************************************************************/
/* $Id$ */
+ // $Source$
class sodeliveries
Index: class.soprojecthours.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.soprojecthours.inc.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** class.soprojecthours.inc.php 17 Jun 2003 12:39:16 -0000 1.10
--- class.soprojecthours.inc.php 10 Sep 2003 00:28:57 -0000 1.11
***************
*** 3,11 ****
* phpGroupWare - Projects *
* http://www.phpgroupware.org *
* *
* Project Manager *
* Written by Bettina Gille address@hidden *
* ----------------------------------------------- *
! * Copyright (C) 2000 - 2003 Bettina Gille *
* *
* This program is free software; you can redistribute it and/or *
--- 3,12 ----
* phpGroupWare - Projects *
* http://www.phpgroupware.org *
+ * This program is part of the GNU project, see http://www.gnu.org/
*
* *
* Project Manager *
* Written by Bettina Gille address@hidden *
* ----------------------------------------------- *
! * Copyright 2000 - 2003 Free Software Foundation, Inc *
* *
* This program is free software; you can redistribute it and/or *
***************
*** 24,27 ****
--- 25,29 ----
\*******************************************************************/
/* $Id$ */
+ // $Source$
class soprojecthours
Index: class.soprojects.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.soprojects.inc.php,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -r1.42 -r1.43
*** class.soprojects.inc.php 17 Jun 2003 12:39:16 -0000 1.42
--- class.soprojects.inc.php 10 Sep 2003 00:28:57 -0000 1.43
***************
*** 3,11 ****
* phpGroupWare - Projects *
* http://www.phpgroupware.org *
* *
* Project Manager *
* Written by Bettina Gille address@hidden *
* ----------------------------------------------- *
! * Copyright (C) 2000 - 2003 Bettina Gille *
* *
* This program is free software; you can redistribute it and/or *
--- 3,12 ----
* phpGroupWare - Projects *
* http://www.phpgroupware.org *
+ * This program is part of the GNU project, see http://www.gnu.org/
*
* *
* Project Manager *
* Written by Bettina Gille address@hidden *
* ----------------------------------------------- *
! * Copyright 2000 - 2003 Free Software Foundation, Inc *
* *
* This program is free software; you can redistribute it and/or *
***************
*** 24,27 ****
--- 25,29 ----
\*******************************************************************/
/* $Id$ */
+ // $Source$
class soprojects
***************
*** 38,41 ****
--- 40,44 ----
$this->currency =
$GLOBALS['phpgw_info']['user']['preferences']['common']['currency'];
$this->year =
$GLOBALS['phpgw']->common->show_date(time(),'Y');
+ $this->member = $this->get_acl_projects();
}
***************
*** 87,91 ****
'udate' =>
$this->db->f('entry_date'),
'investment_nr' =>
$this->db->f('investment_nr'),
! 'pcosts' =>
$this->db->f('pcosts')
);
}
--- 90,96 ----
'udate' =>
$this->db->f('entry_date'),
'investment_nr' =>
$this->db->f('investment_nr'),
! 'pcosts' =>
$this->db->f('pcosts'),
! 'main' =>
$this->db->f('main'),
! 'level' =>
$this->db->f('level')
);
}
***************
*** 94,103 ****
! function read_projects($start = '', $limit = True, $query = '',
$filter = '', $sort = '', $order = '', $status = '', $cat_id = '', $type =
'mains', $pro_parent = '')
{
! $start = intval($start);
! $cat_id = intval($cat_id);
! $pro_parent = intval($pro_parent);
! $query = $this->db->db_addslashes($query);
if ($status)
--- 99,117 ----
! function read_projects($values)
{
! $start = intval($values['start']);
! $limit =
(isset($values['limit'])?$values['limit']:True);
! $filter =
(isset($values['filter'])?$values['filter']:'none');
! $sort =
(isset($values['sort'])?$values['sort']:'ASC');
! $order = $values['order'];
! $status = $values['status'];
! $type =
(isset($values['type'])?$values['type']:'mains');
!
! $cat_id = intval($values['cat_id']);
! $main = intval($values['main']);
! $parent = intval($values['parent']);
!
! $query = $this->db->db_addslashes($values['query']);
if ($status)
***************
*** 110,130 ****
}
- if (!$sort)
- {
- $sort = 'ASC';
- }
-
if ($order)
{
! $ordermethod = "order by $order $sort";
}
else
{
! $ordermethod = 'order by start_date asc';
! }
!
! if (! $filter)
! {
! $filter = 'none';
}
--- 124,134 ----
}
if ($order)
{
! $ordermethod = " order by $order $sort";
}
else
{
! $ordermethod = ' order by start_date asc';
}
***************
*** 133,137 ****
if ($this->isprojectadmin('pad') ||
$this->isbookkeeper('pbo'))
{
! $filtermethod = " ( access != 'private'
OR coordinator = " . $this->account . " )";
}
else
--- 137,141 ----
if ($this->isprojectadmin('pad') ||
$this->isbookkeeper('pbo'))
{
! $filtermethod = " ( access != 'private'
OR coordinator = " . $this->account . ' )';
}
else
***************
*** 146,155 ****
}
reset($public_user_list);
! $filtermethod .= " OR
(access='public' AND coordinator in(" . implode(',',$public_user_list) . ")))";
}
! else
{
! $filtermethod .= ' )';
}
}
}
--- 150,161 ----
}
reset($public_user_list);
! $filtermethod .= " OR
(access='public' AND coordinator in(" . implode(',',$public_user_list) . '))';
}
!
! if (is_array($this->member))
{
! $filtermethod .= " OR
(access='public' AND id in(" . implode(',',$this->member) . '))';
}
+ $filtermethod .= ' )';
}
}
***************
*** 170,177 ****
switch($type)
{
! case 'mains':
! case 'amains': $filtermethod .= ' AND parent =
0 '; break;
! case 'subs' :
! case 'asubs': $filtermethod .= ' AND parent
=' . $pro_parent . ' AND parent != 0 '; break;
}
--- 176,185 ----
switch($type)
{
! case 'all':
! case 'amains':
! case 'mains': $parent_select = ' AND
parent=0'; break;
! case 'asubs':
! case 'subs': $parent_select = ' AND
(parent=' . $parent . ' AND parent != 0)'; break;
! case 'mainandsubs': $parent_select = ' AND
main=' . $main; break;
}
***************
*** 183,199 ****
$sql = "SELECT * from phpgw_p_projects WHERE
$filtermethod $statussort $querymethod";
! $this->db2->query($sql,__LINE__,__FILE__);
! $this->total_records = $this->db2->num_rows();
if ($limit)
{
! $this->db->limit_query($sql .
$ordermethod,$start,__LINE__,__FILE__);
}
else
{
! $this->db->query($sql .
$ordermethod,__LINE__,__FILE__);
}
! return $this->db2projects();
}
--- 191,243 ----
$sql = "SELECT * from phpgw_p_projects WHERE
$filtermethod $statussort $querymethod";
! $this->db2->query($sql .
$parent_select,__LINE__,__FILE__);
! $total = $this->db2->num_rows();
if ($limit)
{
! $this->db->limit_query($sql . $parent_select .
$ordermethod,$start,__LINE__,__FILE__);
}
else
{
! $this->db->query($sql . $parent_select .
$ordermethod,__LINE__,__FILE__);
! }
!
! $pro = $this->db2projects();
!
! if ($main == 0 && $type != 'mains' && $type != 'amains')
! {
! $num_pro = count($pro);
! for ($i=0;$i < $num_pro;$i++)
! {
! $sub_select = ' AND parent=' .
$pro[$i]['project_id'] . ' AND level=' . ($pro[$i]['level']+1);
!
! $this->db->query($sql . $sub_select .
$ordermethod,__LINE__,__FILE__);
! $total += $this->db->num_rows();
! $subpro = $this->db2projects();
!
! $num_subpro = count($subpro);
! if ($num_subpro != 0)
! {
! $newpro = array();
! for ($k = 0; $k <= $i; $k++)
! {
! $newpro[$k] = $pro[$k];
! }
! for ($k = 0; $k < $num_subpro;
$k++)
! {
! $newpro[$k+$i+1] =
$subpro[$k];
! }
! for ($k = $i+1; $k < $num_pro;
$k++)
! {
! $newpro[$k+$num_subpro]
= $pro[$k];
! }
! $pro = $newpro;
! $num_pro = count($pro);
! }
! }
}
! $this->total_records = $total;
! return $pro;
}
***************
*** 202,259 ****
$this->db->query('SELECT * from phpgw_p_projects WHERE
id=' . $project_id,__LINE__,__FILE__);
! $project = $this->db2projects();
!
! if (is_array($project) && list(,$pro) = each($project))
! {
! $p = array
! (
! 'project_id' => $pro['project_id'],
! 'owner' =>
$pro['owner'],
! 'parent' =>
$pro['parent'],
! 'number' =>
$pro['number'],
! 'access' =>
$pro['access'],
! 'cat' => $pro['cat'],
! 'sdate' =>
$pro['sdate'],
! 'edate' =>
$pro['edate'],
! 'coordinator' => $pro['coordinator'],
! 'customer' =>
$pro['customer'],
! 'status' =>
$pro['status'],
! 'descr' =>
$pro['descr'],
! 'title' =>
$pro['title'],
! 'budget' =>
$pro['budget'],
! 'ptime' =>
$pro['ptime'],
! 'udate' =>
$pro['udate'],
! 'cdate' =>
$pro['cdate'],
! 'processor' =>
$pro['processor'],
! 'investment_nr' =>
$pro['investment_nr'],
! 'pcosts' =>
$pro['pcosts']
! );
! return $p;
! }
}
! function select_project_list($type, $status, $selected = '')
{
! $projects = $this->read_projects($start, False, $query,
$filter, $sort, $order, $status, $cat_id, $type);
! for ($i=0;$i<count($projects);$i++)
{
! $pro_select .= '<option value="' .
$projects[$i]['project_id'] . '"';
! if ($projects[$i]['project_id'] == $selected)
{
! $pro_select .= ' selected';
}
! if ($projects[$i]['title'])
{
! $pro_select .= '>' .
$GLOBALS['phpgw']->strip_html($projects[$i]['title']) . ' [ '
! .
$GLOBALS['phpgw']->strip_html($projects[$i]['number']) . ' ]';
}
else
{
! $pro_select .= '>' .
$GLOBALS['phpgw']->strip_html($projects[$i]['number']);
}
! $pro_select .= '</option>';
}
! return $pro_select;
}
--- 246,300 ----
$this->db->query('SELECT * from phpgw_p_projects WHERE
id=' . $project_id,__LINE__,__FILE__);
! list($project) = $this->db2projects();
! return $project;
}
! function select_project_list($values)
{
! $pro = $this->read_projects(array
! (
! 'limit' =>
False,
! 'status' =>
$values['status'],
! 'type' =>
(isset($values['type'])?$values['type']:'mains'),
! 'main' =>
$values['main'],
! ));
!
! if($values['self'])
! {
! for ($i=0;$i<count($pro);$i++)
! {
! if ($pro[$i]['project_id'] ==
$values['self'])
! {
! unset($pro[$i]);
! }
! }
! }
! while (is_array($pro) && list(,$p) = each($pro))
{
! $s .= '<option value="' . $p['project_id'] .
'"';
! if ($p['project_id'] == $values['selected'])
! {
! $s .= ' selected';
! }
! $s .= '>';
!
! for ($j=0;$j<$p['level'];$j++)
{
! $s .= ' . ';
}
!
! if ($p['title'])
{
! $s .=
$GLOBALS['phpgw']->strip_html($p['title']) . ' [ '
! .
$GLOBALS['phpgw']->strip_html($p['number']) . ' ]';
}
else
{
! $s .=
$GLOBALS['phpgw']->strip_html($p['number']);
}
! $s .= '</option>';
}
! return $s;
}
***************
*** 268,287 ****
$values['pcosts'] =
$values['pcosts'] + 0.0;
$table = 'phpgw_p_projects';
$this->db->lock($table);
$this->db->query('INSERT into phpgw_p_projects
(owner,access,category,entry_date,start_date,end_date,coordinator,customer,status,'
! .
'descr,title,budget,num,parent,time_planned,date_created,processor,investment_nr,pcosts)
VALUES (' . $this->account
. ",'" .
$values['access'] . "'," . intval($values['cat']) . ',' . time() . ',' .
intval($values['sdate']) . ','
.
intval($values['edate']) . ',' . intval($values['coordinator']) . ',' .
intval($values['customer']) . ",'" . $values['status']
. "','" .
$values['descr'] . "','" . $values['title'] . "'," . $values['budget'] . ",'" .
$values['number'] . "',"
.
intval($values['parent']) . ',' . intval($values['ptime']) . ',' . time() . ','
. $this->account . ",'" . $values['investment_nr']
! . "'," .
$values['pcosts'] . ')',__LINE__,__FILE__);
!
! /*$this->db->query("SELECT max(id) FROM
phpgw_p_projects");
! if($this->db->next_record())
! {
! $p_id = $this->db->f(0);
! }*/
$p_id = $this->db->get_last_insert_id($table,'id');
--- 309,328 ----
$values['pcosts'] =
$values['pcosts'] + 0.0;
+ if ($values['parent'] && $values['parent'] != 0)
+ {
+ $values['main'] =
intval($this->id2item(array('project_id' => $values['parent'],'item' =>
'main')));
+ $values['level'] =
intval($this->id2item(array('project_id' => $values['parent'],'item' =>
'level'))+1);
+ }
+
$table = 'phpgw_p_projects';
$this->db->lock($table);
$this->db->query('INSERT into phpgw_p_projects
(owner,access,category,entry_date,start_date,end_date,coordinator,customer,status,'
! .
'descr,title,budget,num,parent,time_planned,date_created,processor,investment_nr,pcosts,main,level)
VALUES (' . $this->account
. ",'" .
$values['access'] . "'," . intval($values['cat']) . ',' . time() . ',' .
intval($values['sdate']) . ','
.
intval($values['edate']) . ',' . intval($values['coordinator']) . ',' .
intval($values['customer']) . ",'" . $values['status']
. "','" .
$values['descr'] . "','" . $values['title'] . "'," . $values['budget'] . ",'" .
$values['number'] . "',"
.
intval($values['parent']) . ',' . intval($values['ptime']) . ',' . time() . ','
. $this->account . ",'" . $values['investment_nr']
! . "'," .
$values['pcosts'] . ',' . intval($values['main']) . ',' .
intval($values['level']) . ')',__LINE__,__FILE__);
$p_id = $this->db->get_last_insert_id($table,'id');
***************
*** 290,293 ****
--- 331,339 ----
if ($p_id && ($p_id != 0))
{
+ if (!$values['parent'] || $values['parent'] ==
0)
+ {
+ $this->db->query('UPDATE
phpgw_p_projects SET main=' . $p_id . ' WHERE id=' . $p_id,__LINE__,__FILE__);
+ }
+
if (is_array($book_activities))
{
***************
*** 318,339 ****
}
! function edit_project($values, $book_activities,
$bill_activities)
{
! $values['descr'] =
$this->db->db_addslashes($values['descr']);
! $values['title'] =
$this->db->db_addslashes($values['title']);
! $values['number'] =
$this->db->db_addslashes($values['number']);
! $values['investment_nr'] =
$this->db->db_addslashes($values['investment_nr']);
! $values['project_id'] =
intval($values['project_id']);
! $values['budget'] =
$values['budget'] + 0.0;
! $values['pcosts'] =
$values['pcosts'] + 0.0;
! $this->db->query("UPDATE phpgw_p_projects set access='"
. $values['access'] . "', category=" . intval($values['cat']) . ", entry_date="
! . time() . ",
start_date=" . intval($values['sdate']) . ", end_date=" .
intval($values['edate']) . ", coordinator="
! .
intval($values['coordinator']) . ", customer=" . intval($values['customer']) .
", status='" . $values['status'] . "', descr='"
! . $values['descr'] .
"', title='" . $values['title'] . "', budget=" . $values['budget'] . ", num='"
! . $values['number'] .
"', time_planned=" . intval($values['ptime']) . ', processor=' . $this->account
. ", investment_nr='"
! .
$values['investment_nr'] . "', pcosts=" . $values['pcosts'] . ' where id=' .
$values['project_id'],__LINE__,__FILE__);
if (is_array($book_activities))
{
--- 364,433 ----
}
! function subs($parent,&$subs,&$main)
{
! if (!is_array($main))
! {
! $this->db->query('SELECT * from
phpgw_p_projects WHERE main=' . $main,__LINE__,__FILE__);
! $main = $this->db2projects();
! //echo "main: "; _debug_array($main);
! }
! reset($main);
! for ($n = 0; $n < count($main); $n++)
! {
! $pro = $main[$n];
! if ($pro['parent'] == $parent)
! {
! //echo "Adding($pro[project_id])<br>";
! $subs[$pro['project_id']] = $pro;
!
$this->subs($pro['project_id'],$pro,$main);
! }
! }
! }
! function reparent($values)
! {
! $id = $values['project_id'];
! $parent = $values['parent'];
! $old_parent = $values['old_parent'];
! $main = $old_parent ?
intval($this->id2item(array('project_id' => $old_parent))) : $id;
! //echo "<p>reparent: $id/$main: $old_parent -->
$parent</p>\n";
! $subs = array();
! $this->subs($id,$subs,$main);
! //echo "<p>subs($id) = "; _debug_array($subs);
!
! if (isset($subs[$parent]))
! {
! //echo "<p>new parent $parent is sub of
$id</p>\n";
! $parent = $subs[$parent];
! $parent['old_parent'] = $parent['parent'];
! $parent['parent'] =
intval($values['old_parent']);
! $this->reparent($parent);
!
! unset($parent['old_parent']);
! unset($parent['main']);
!
! $this->edit_project($parent);
! $this->reparent($values);
! return;
! }
!
! $new_main = $parent ? $this->id2item(array('project_id'
=> $parent)) : $id;
! $new_parent_level = $parent ?
$this->id2item(array('project_id' => $parent,'item' => 'level')) : -1;
! $old_parent_level = $old_parent ?
$this->id2item(array('project_id' => $old_parent,'item' => 'level')) : -1;
! $level_adj = $old_parent_level - $new_parent_level;
! reset($subs);
! //echo "new_main=$new_main,level_adj = $level_adj<br>";
! while (list($n) = each($subs))
! {
! $subs[$n]['main'] = $new_main;
! $subs[$n]['level'] -= $level_adj;
! //echo "<p>$n: id=".$subs[$n]['project_id']."
set main to $new_main, subs[$n] = \n"; _debug_array($subs[$n]);
! $this->edit_project($subs[$n]);
! }
! }
+ function edit_project($values, $book_activities = 0,
$bill_activities = 0)
+ {
if (is_array($book_activities))
{
***************
*** 360,363 ****
--- 454,488 ----
}
+ $values['descr'] =
$this->db->db_addslashes($values['descr']);
+ $values['title'] =
$this->db->db_addslashes($values['title']);
+ $values['number'] =
$this->db->db_addslashes($values['number']);
+ $values['investment_nr'] =
$this->db->db_addslashes($values['investment_nr']);
+ $values['project_id'] =
intval($values['project_id']);
+ $values['parent'] =
intval($values['parent']);
+
+ $values['budget'] =
$values['budget'] + 0.0;
+ $values['pcosts'] =
$values['pcosts'] + 0.0;
+
+ if (isset($values['old_parent']) &&
$values['old_parent'] != $values['parent'])
+ {
+ $this->reparent($values);
+ }
+ if (!isset($values['main']) || !isset($values['level']))
+ {
+ if ($values['parent'] > 0)
+ {
+ $values['main'] =
intval($this->id2item(array('project_id' => $values['parent'],'item' =>
'main')));
+ $values['level'] =
intval($this->id2item(array('project_id' => $values['parent'],'item' =>
'level'))+1);
+ }
+ }
+
+ $this->db->query("UPDATE phpgw_p_projects set access='"
. $values['access'] . "', category=" . intval($values['cat']) . ", entry_date="
+ . time() . ",
start_date=" . intval($values['sdate']) . ", end_date=" .
intval($values['edate']) . ", coordinator="
+ .
intval($values['coordinator']) . ", customer=" . intval($values['customer']) .
", status='" . $values['status'] . "', descr='"
+ . $values['descr'] .
"', title='" . $values['title'] . "', budget=" . $values['budget'] . ", num='"
+ . $values['number'] .
"', time_planned=" . intval($values['ptime']) . ', processor=' . $this->account
. ", investment_nr='"
+ .
$values['investment_nr'] . "', pcosts=" . $values['pcosts'] . ', parent=' .
$values['parent']
+ . ', level=' .
intval($values['level']) . ' where id=' .
$values['project_id'],__LINE__,__FILE__);
+
$this->db->query('SELECT max(month) FROM phpgw_p_pcosts
where project_id=' . $values['project_id'],__LINE__,__FILE__);
if($this->db->next_record())
***************
*** 381,384 ****
--- 506,514 ----
$this->db->query("Update phpgw_p_projects set
status='archive' WHERE parent=" . $values['project_id'],__LINE__,__FILE__);
}
+
+ if($values['oldstatus'] && $values['oldstatus'] ==
'archive' && $values['status'] != 'archive')
+ {
+ $this->db->query("Update phpgw_p_projects set
status='" . $values['status'] . "' WHERE parent=" .
$values['project_id'],__LINE__,__FILE__);
+ }
}
***************
*** 1120,1123 ****
--- 1250,1354 ----
return $this->db->f('sumvalue');
}
+ }
+
+ function id2item($data)
+ {
+ if(is_array($data))
+ {
+ $project_id = $data['project_id'];
+ $item =
(isset($data['item'])?$data['item']:'main');
+ }
+
+ $this->db->query("SELECT $item FROM phpgw_p_projects
WHERE id=" . $project_id,__LINE__,__FILE__);
+ $this->db->next_record();
+
+ if ($this->db->f($item))
+ {
+ return $this->db->f(0);
+ }
+ }
+
+ function get_mstones($project_id = '')
+ {
+ $this->db->query("SELECT * FROM phpgw_p_mstones WHERE
project_id=" . intval($project_id),__LINE__,__FILE__);
+
+ while($this->db->next_record())
+ {
+ $stones[] = array
+ (
+ 's_id' => $this->db->f('s_id'),
+ 'title' => $this->db->f('title'),
+ 'edate' => $this->db->f('edate')
+ );
+ }
+ return $stones;
+ }
+
+ function get_single_mstone($s_id = '')
+ {
+ $this->db->query("SELECT * FROM phpgw_p_mstones WHERE
s_id=" . intval($s_id),__LINE__,__FILE__);
+
+ if($this->db->next_record())
+ {
+ $stone = array
+ (
+ 's_id' => $this->db->f('s_id'),
+ 'title' => $this->db->f('title'),
+ 'edate' => $this->db->f('edate')
+ );
+ }
+ return $stone;
+ }
+
+ function add_mstone($values)
+ {
+ $this->db->query('INSERT into phpgw_p_mstones
(project_id,title,edate) VALUES (' . intval($values['project_id']) . ",'"
+ .
$this->db->db_addslashes($values['title']) . "'," . intval($values['edate']) .
')',__LINE__,__FILE__);
+ }
+
+ function edit_mstone($values)
+ {
+ $this->db->query('UPDATE phpgw_p_mstones set edate=' .
intval($values['edate']) . ", title='" .
$this->db->db_addslashes($values['title']) . "' "
+ . 'WHERE s_id=' .
intval($values['s_id']),__LINE__,__FILE__);
+ }
+
+ function delete_mstone($s_id = '')
+ {
+ $this->db->query('DELETE from phpgw_p_mstones where
s_id=' . intval($s_id),__LINE__,__FILE__);
+ }
+
+ function delete_acl($project_id)
+ {
+ $this->db->query("DELETE from phpgw_acl where
acl_appname='projects' AND acl_location=" . $project_id
+ . ' AND
acl_rights=7',__LINE__,__FILE__);
+ }
+
+ function get_acl_projects()
+ {
+ $this->db->query("SELECT acl_location from phpgw_acl
where acl_appname = 'projects' and acl_rights=7 and acl_account="
+ .
$this->account,__LINE__,__FILE__);
+
+ while($this->db->next_record())
+ {
+ $projects[] = $this->db->f(0);
+ }
+ return $projects;
+ }
+
+ function member($project_id)
+ {
+ $this->db->query("SELECT acl_account from phpgw_acl
where acl_appname = 'projects' and acl_rights=7 and acl_location="
+ .
intval($project_id),__LINE__,__FILE__);
+
+ while($this->db->next_record())
+ {
+ $members[] = $this->db->f(0);
+ }
+
+ if (is_array($members) &&
in_array($this->account,$members))
+ {
+ return True;
+ }
+ return False;
}
}
Index: class.sostatistics.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.sostatistics.inc.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** class.sostatistics.inc.php 17 Jun 2003 12:39:16 -0000 1.9
--- class.sostatistics.inc.php 10 Sep 2003 00:28:57 -0000 1.10
***************
*** 3,11 ****
* phpGroupWare - Projects *
* http://www.phpgroupware.org *
* *
* Project Manager *
* Written by Bettina Gille address@hidden *
* ----------------------------------------------- *
! * Copyright (C) 2000, 2001 Bettina Gille *
* *
* This program is free software; you can redistribute it and/or *
--- 3,12 ----
* phpGroupWare - Projects *
* http://www.phpgroupware.org *
+ * This program is part of the GNU project, see http://www.gnu.org/
*
* *
* Project Manager *
* Written by Bettina Gille address@hidden *
* ----------------------------------------------- *
! * Copyright 2000 - 2003 Free Software Foundation, Inc *
* *
* This program is free software; you can redistribute it and/or *
***************
*** 24,27 ****
--- 25,29 ----
\*******************************************************************/
/* $Id$ */
+ /* $Source$ */
class sostatistics
***************
*** 51,60 ****
if ($values['sdate'])
{
! $filter .= " AND start_date >='" .
$values['sdate'] . "'";
}
if ($values['edate'])
{
! $filter .= " AND end_date <='" .
$values['edate'] . "'";
}
--- 53,62 ----
if ($values['sdate'])
{
! $filter .= ' AND start_date >=' .
$values['sdate'];
}
if ($values['edate'])
{
! $filter .= ' AND end_date <=' .
$values['edate'];
}
***************
*** 68,80 ****
if
($GLOBALS['phpgw_info']['server']['db_type']=='pgsql')
{
! $join = " JOIN ";
}
elseif
($GLOBALS['phpgw_info']['server']['db_type']=='mysql')
{
! $join = " LEFT JOIN ";
}
! $this->db->query("SELECT title,num,phpgw_p_projects.id
as id FROM phpgw_p_projects $join phpgw_p_hours ON "
! .
"phpgw_p_hours.employee='" . $account_id . "' GROUP BY
title,num,phpgw_p_projects.id",__LINE__,__FILE__);
while ($this->db->next_record())
--- 70,82 ----
if
($GLOBALS['phpgw_info']['server']['db_type']=='pgsql')
{
! $join = ' JOIN ';
}
elseif
($GLOBALS['phpgw_info']['server']['db_type']=='mysql')
{
! $join = ' LEFT JOIN ';
}
! $this->db->query('SELECT title,num,phpgw_p_projects.id
as id FROM phpgw_p_projects' . $join . 'phpgw_p_hours ON '
! .
'phpgw_p_hours.employee=' . $account_id . ' GROUP BY
title,num,phpgw_p_projects.id',__LINE__,__FILE__);
while ($this->db->next_record())
***************
*** 96,102 ****
switch($type)
{
! case 'account': $idfilter = "WHERE employee='"
. $account_id . "'"; break;
! case 'project': $idfilter = "WHERE
project_id='" . $project_id . "'"; break;
! case 'both': $idfilter = "WHERE employee='"
. $account_id . "' AND project_id='" . $project_id . "'"; break;
}
--- 98,104 ----
switch($type)
{
! case 'account': $idfilter = 'WHERE employee=' .
$account_id; break;
! case 'project': $idfilter = 'WHERE project_id='
. $project_id; break;
! case 'both': $idfilter = 'WHERE employee=' .
$account_id . ' AND project_id=' . $project_id; break;
}
***************
*** 120,125 ****
{
! $this->db->query("SELECT employee from phpgw_p_hours
WHERE project_id='" . $project_id . "'" . $this->stat_filter($values)
! . " GROUP BY
employee",__LINE__,__FILE__);
while ($this->db->next_record())
--- 122,127 ----
{
! $this->db->query('SELECT employee from phpgw_p_hours
WHERE project_id=' . $project_id . $this->stat_filter($values)
! . ' GROUP BY
employee',__LINE__,__FILE__);
while ($this->db->next_record())
Index: class.uibilling.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.uibilling.inc.php,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -r1.30 -r1.31
*** class.uibilling.inc.php 17 Jun 2003 12:39:16 -0000 1.30
--- class.uibilling.inc.php 10 Sep 2003 00:28:57 -0000 1.31
***************
*** 3,11 ****
* phpGroupWare - Projects *
* http://www.phpgroupware.org *
* *
* Project Manager *
* Written by Bettina Gille address@hidden *
* ----------------------------------------------- *
! * Copyright (C) 2000 - 2003 Bettina Gille *
* *
* This program is free software; you can redistribute it and/or *
--- 3,12 ----
* phpGroupWare - Projects *
* http://www.phpgroupware.org *
+ * This program is part of the GNU project, see http://www.gnu.org/
*
* *
* Project Manager *
* Written by Bettina Gille address@hidden *
* ----------------------------------------------- *
! * Copyright 2000 - 2003 Free Software Foundation, Inc *
* *
* This program is free software; you can redistribute it and/or *
***************
*** 24,27 ****
--- 25,29 ----
\*******************************************************************/
/* $Id$ */
+ // $Source$
class uibilling
Index: class.uideliveries.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.uideliveries.inc.php,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -r1.30 -r1.31
*** class.uideliveries.inc.php 17 Jun 2003 12:39:16 -0000 1.30
--- class.uideliveries.inc.php 10 Sep 2003 00:28:57 -0000 1.31
***************
*** 3,11 ****
* phpGroupWare - Projects *
* http://www.phpgroupware.org *
* *
* Project Manager *
* Written by Bettina Gille address@hidden *
* ----------------------------------------------- *
! * Copyright (C) 2000 - 2003 Bettina Gille *
* *
* This program is free software; you can redistribute it and/or *
--- 3,12 ----
* phpGroupWare - Projects *
* http://www.phpgroupware.org *
+ * This program is part of the GNU project, see http://www.gnu.org/
*
* *
* Project Manager *
* Written by Bettina Gille address@hidden *
* ----------------------------------------------- *
! * Copyright 2000 - 2003 Free Software Foundation, Inc *
* *
* This program is free software; you can redistribute it and/or *
***************
*** 24,27 ****
--- 25,29 ----
\*******************************************************************/
/* $Id$ */
+ // $Source$
class uideliveries
Index: class.uiprojecthours.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.uiprojecthours.inc.php,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -r1.31 -r1.32
*** class.uiprojecthours.inc.php 17 Jun 2003 12:39:16 -0000 1.31
--- class.uiprojecthours.inc.php 10 Sep 2003 00:28:57 -0000 1.32
***************
*** 3,11 ****
* phpGroupWare - Projects *
* http://www.phpgroupware.org *
* *
* Project Manager *
* Written by Bettina Gille address@hidden *
* ----------------------------------------------- *
! * Copyright (C) 2000 - 2003 Bettina Gille *
* *
* This program is free software; you can redistribute it and/or *
--- 3,12 ----
* phpGroupWare - Projects *
* http://www.phpgroupware.org *
+ * This program is part of the GNU project, see http://www.gnu.org/
*
* *
* Project Manager *
* Written by Bettina Gille address@hidden *
* ----------------------------------------------- *
! * Copyright 2000 - 2003 Free Software Foundation, Inc *
* *
* This program is free software; you can redistribute it and/or *
***************
*** 24,27 ****
--- 25,29 ----
\*******************************************************************/
/* $Id$ */
+ // $Source$
class uiprojecthours
***************
*** 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)
--- 216,220 ----
$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(array('type'
=> 'all','status' => (($action != 'asubs')?$status:'archive'),'selected' =>
$this->project_id)));
switch($this->state)
***************
*** 341,353 ****
}
! if ($action != 'asubs')
{
! if
($this->boprojects->check_perms($this->grants[$coordinator],PHPGW_ACL_ADD) ||
$coordinator == $this->account)
! {
! $link_data['menuaction'] =
'projects.uiprojecthours.edit_hours';
! unset($link_data['hours_id']);
!
$GLOBALS['phpgw']->template->set_var('action','<form method="POST" action="' .
$GLOBALS['phpgw']->link('/index.php',$link_data)
!
. '"><input
type="submit" value="' . lang('Add') . '"></form>');
! }
}
else
--- 343,353 ----
}
! if ($action != 'asubs' &&
($this->boprojects->check_perms($this->grants[$coordinator],PHPGW_ACL_ADD) ||
$coordinator == $this->account
!
|| $this->bo->member()))
{
! $link_data['menuaction'] =
'projects.uiprojecthours.edit_hours';
! unset($link_data['hours_id']);
!
$GLOBALS['phpgw']->template->set_var('action','<form method="POST" action="' .
$GLOBALS['phpgw']->link('/index.php',$link_data)
!
. '"><input type="submit"
value="' . lang('Add') . '"></form>');
}
else
***************
*** 467,470 ****
--- 467,471 ----
$GLOBALS['phpgw']->template->set_block('hours_' .
$form,'add','addhandle');
$GLOBALS['phpgw']->template->set_block('hours_' .
$form,'edit','edithandle');
+ $GLOBALS['phpgw']->template->set_block('hours_' .
$form,'emp','emphandle');
$GLOBALS['phpgw']->template->set_var('hidden_vars','<input type="hidden"
name="referer" value="' . $referer . '">');
***************
*** 484,488 ****
$GLOBALS['phpgw']->template->set_var('status_list',$this->status_format($values['status']));
-
$GLOBALS['phpgw']->template->set_var('employee_list',$this->employee_format($values['employee']));
$sdate = $this->hdate_format($values['sdate']);
--- 485,488 ----
***************
*** 585,588 ****
--- 585,594 ----
{
$deletehour = True;
+ }
+
+ if
($this->boprojects->check_perms($grants[$coordinator],PHPGW_ACL_EDIT) ||
$coordinator == $this->account)
+ {
+
$GLOBALS['phpgw']->template->set_var('employee_list',$this->employee_format($values['employee']));
+
$GLOBALS['phpgw']->template->fp('emphandle','emp',True);
}
Index: class.uiprojects.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.uiprojects.inc.php,v
retrieving revision 1.64
retrieving revision 1.65
diff -C2 -r1.64 -r1.65
*** class.uiprojects.inc.php 17 Jun 2003 12:39:16 -0000 1.64
--- class.uiprojects.inc.php 10 Sep 2003 00:28:57 -0000 1.65
***************
*** 3,11 ****
* phpGroupWare - Projects *
* http://www.phpgroupware.org *
* *
* Project Manager *
* Written by Bettina Gille address@hidden *
* ----------------------------------------------- *
! * Copyright (C) 2000 - 2003 Bettina Gille *
* *
* This program is free software; you can redistribute it and/or *
--- 3,12 ----
[...1170 lines suppressed...]
+ if (!$values['edate'])
+ {
+ $values['emonth'] = date('m',time());
+ $values['eday'] = date('d',time());
+ $values['eyear'] = date('Y',time());
+ }
+ else
+ {
+ $values['eday'] = date('d',$values['edate']);
+ $values['emonth'] = date('m',$values['edate']);
+ $values['eyear'] = date('Y',$values['edate']);
+ }
+
+
$GLOBALS['phpgw']->template->set_var('end_date_select',$GLOBALS['phpgw']->common->dateformatorder($this->sbox->getYears('values[eyear]',$values['eyear']),
+
$this->sbox->getMonthText('values[emonth]',$values['emonth']),
+
$this->sbox->getDays('values[eday]',$values['eday'])));
+
+ $GLOBALS['phpgw']->template->pfp('out','mstone_edit');
}
}
Index: class.uistatistics.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.uistatistics.inc.php,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** class.uistatistics.inc.php 17 Jun 2003 12:39:16 -0000 1.18
--- class.uistatistics.inc.php 10 Sep 2003 00:28:57 -0000 1.19
***************
*** 3,11 ****
* phpGroupWare - Projects *
* http://www.phpgroupware.org *
* *
* Project Manager *
* Written by Bettina Gille address@hidden *
* ----------------------------------------------- *
! * Copyright (C) 2000 - 2003 Bettina Gille *
* *
* This program is free software; you can redistribute it and/or *
--- 3,12 ----
* phpGroupWare - Projects *
* http://www.phpgroupware.org *
+ * This program is part of the GNU project, see http://www.gnu.org/
*
* *
* Project Manager *
* Written by Bettina Gille address@hidden *
* ----------------------------------------------- *
! * Copyright 2000 - 2003 Free Software Foundation, Inc *
* *
* This program is free software; you can redistribute it and/or *
***************
*** 24,27 ****
--- 25,29 ----
\*******************************************************************/
/* $Id$ */
+ /* $Source$ */
class uistatistics
Index: hook_add_def_pref.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/hook_add_def_pref.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
Index: hook_admin.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/hook_admin.inc.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** hook_admin.inc.php 19 Apr 2003 22:07:52 -0000 1.12
--- hook_admin.inc.php 10 Sep 2003 00:28:57 -0000 1.13
***************
*** 12,24 ****
{
! // Only Modify the $file variable.....
$file = Array
(
'Administration' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiprojects.list_admins&action=pad'),
'Accountancy' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiprojects.list_admins&action=pbo'),
! 'Global Categories' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index&appname='
. $appname . '&global_cats=True')
);
//Do not modify below this line
! $GLOBALS['phpgw']->common->display_mainscreen($appname,$file);
}
?>
--- 12,24 ----
{
! // Only Modify the $file and $title variables.....
$file = Array
(
'Administration' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiprojects.list_admins&action=pad'),
'Accountancy' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiprojects.list_admins&action=pbo'),
! 'Global Categories' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index&appname='
. $appname)
);
//Do not modify below this line
! display_section($appname,$appname,$file);
}
?>
Index: hook_deleteaccount.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/hook_deleteaccount.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
Index: hook_preferences.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/hook_preferences.inc.php,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -r1.20 -r1.21
*** hook_preferences.inc.php 19 Apr 2003 22:07:52 -0000 1.20
--- hook_preferences.inc.php 10 Sep 2003 00:28:57 -0000 1.21
***************
*** 12,15 ****
--- 12,16 ----
{
+ $title = $appname;
$file = Array
(
***************
*** 18,22 ****
'Edit categories' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uicategories.index&cats_app=projects&cats_level=True&global_cats=True')
);
! display_section($appname,$file);
}
?>
--- 19,23 ----
'Edit categories' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uicategories.index&cats_app=projects&cats_level=True&global_cats=True')
);
! display_section($appname,$title,$file);
}
?>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: projects/inc class.bobilling.inc.php, 1.8, 1.9 class.bodeliveries.inc.php, 1.17, 1.18 class.boprojecthours.inc.php, 1.10, 1.11 class.boprojects.inc.php, 1.51, 1.52 class.bostatistics.inc.php, 1.3, 1.4 class.sobilling.inc.php, 1.14, 1.15 class.sodeliveries.inc.php, 1.18, 1.19 class.soprojecthours.inc.php, 1.10, 1.11 class.soprojects.inc.php, 1.42, 1.43 class.sostatistics.inc.php, 1.9, 1.10 class.uibilling.inc.php, 1.30, 1.31 class.uideliveries.inc.php, 1.30, 1.31 class.uiprojecthours.inc.php, 1.31, 1.32 class.uiprojects.inc.php, 1.64, 1.65 class.uistatistics.inc.php, 1.18, 1.19 hook_add_def_pref.inc.php, 1.5, 1.6 hook_admin.inc.php, 1.12, 1.13 hook_deleteaccount.inc.php, 1.4, 1.5 hook_preferences.inc.php, 1.20, 1.21,
Bettina Gille <address@hidden> <=
- Prev by Date:
[Phpgroupware-cvs] CVS: phpgwapi/inc class.schema_proc_pgsql.inc.php, 1.5.2.2, 1.5.2.3
- Next by Date:
[Phpgroupware-cvs] CVS: projects/templates/default form_mstone.tpl, 1.1, 1.2 addressbook.tpl, 1.16, 1.17 archive.tpl, 1.7, 1.8 bill_list.tpl, 1.15, 1.16 bill_listhours.tpl, 1.22, 1.23 bill_listinvoice.tpl, 1.12, 1.13 del_listhours.tpl, 1.18, 1.19 delete.tpl, 1.11, 1.12 form.tpl, 1.35, 1.36 formactivity.tpl, 1.16, 1.17 header.tpl, 1.18, 1.19 hours_formhours.tpl, 1.22, 1.23 hours_listhours.tpl, 1.18, 1.19 hours_view.tpl, 1.7, 1.8 list.tpl, 1.28, 1.29 list_admin.tpl, 1.8, 1.9 list_budget.tpl, 1.2, 1.3 list_pcosts.tpl, 1.2, 1.3 listactivities.tpl, 1.18, 1.19 preference_colspan.tpl, 1.4, 1.5 preferences.tpl, 1.22, 1.23 stats_projectlist.tpl, 1.13, 1.14 stats_projectstat.tpl, 1.13, 1.14 stats_userlist.tpl, 1.11, 1.12 stats_userstat.tpl, 1.13, 1.14 view.tpl, 1.8, 1.9
- Previous by thread:
[Phpgroupware-cvs] CVS: phpgwapi/inc class.schema_proc_pgsql.inc.php, 1.5.2.2, 1.5.2.3
- Next by thread:
[Phpgroupware-cvs] CVS: projects/templates/default form_mstone.tpl, 1.1, 1.2 addressbook.tpl, 1.16, 1.17 archive.tpl, 1.7, 1.8 bill_list.tpl, 1.15, 1.16 bill_listhours.tpl, 1.22, 1.23 bill_listinvoice.tpl, 1.12, 1.13 del_listhours.tpl, 1.18, 1.19 delete.tpl, 1.11, 1.12 form.tpl, 1.35, 1.36 formactivity.tpl, 1.16, 1.17 header.tpl, 1.18, 1.19 hours_formhours.tpl, 1.22, 1.23 hours_listhours.tpl, 1.18, 1.19 hours_view.tpl, 1.7, 1.8 list.tpl, 1.28, 1.29 list_admin.tpl, 1.8, 1.9 list_budget.tpl, 1.2, 1.3 list_pcosts.tpl, 1.2, 1.3 listactivities.tpl, 1.18, 1.19 preference_colspan.tpl, 1.4, 1.5 preferences.tpl, 1.22, 1.23 stats_projectlist.tpl, 1.13, 1.14 stats_projectstat.tpl, 1.13, 1.14 stats_userlist.tpl, 1.11, 1.12 stats_userstat.tpl, 1.13, 1.14 view.tpl, 1.8, 1.9
- Index(es):