phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: projects/inc class.boprojects.inc.php,1.42.2.5.2


From: Bettina Gille <address@hidden>
Subject: [Phpgroupware-cvs] CVS: projects/inc class.boprojects.inc.php,1.42.2.5.2.1,1.42.2.5.2.2 class.soprojects.inc.php,1.34.2.6.2.1,1.34.2.6.2.2 class.uiprojects.inc.php,1.47.2.7.2.2,1.47.2.7.2.3
Date: Fri, 02 May 2003 20:56:46 -0400

Update of /cvsroot/phpgroupware/projects/inc
In directory subversions:/tmp/cvs-serv29649/inc

Modified Files:
      Tag: Version-0_9_16-branch
        class.boprojects.inc.php class.soprojects.inc.php 
        class.uiprojects.inc.php 
Log Message:
update accounts

Index: class.boprojects.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.boprojects.inc.php,v
retrieving revision 1.42.2.5.2.1
retrieving revision 1.42.2.5.2.2
diff -C2 -r1.42.2.5.2.1 -r1.42.2.5.2.2
*** class.boprojects.inc.php    26 Apr 2003 01:33:45 -0000      1.42.2.5.2.1
--- class.boprojects.inc.php    3 May 2003 00:56:43 -0000       1.42.2.5.2.2
***************
*** 92,103 ****
                        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; }
                }
  
--- 92,104 ----
                        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);
                        }
                }
  
***************
*** 242,246 ****
                        if (! isset($prefs['country']) || (! 
isset($prefs['currency'])))
                        {
!                               $error[] = lang('Please set your global 
preferences');
                        }
  
--- 243,247 ----
                        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');
                                }
                        }
--- 250,255 ----
                                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');
                                }
                        }
***************
*** 433,445 ****
                        if (strlen($values['descr']) >= 8000)
                        {
!                               $error[] = lang('Description can not exceed 
8000 characters in length !');
                        }
  
                        if (strlen($values['title']) >= 255)
                        {
!                               $error[] = lang('Title can not exceed 255 
characters in length !');
                        }
  
!                       if (! $values['choose'])
                        {
                                if (! $values['number'])
--- 435,447 ----
                        if (strlen($values['descr']) >= 8000)
                        {
!                               $error[] = lang('Description can not exceed 
8000 characters in length');
                        }
  
                        if (strlen($values['title']) >= 255)
                        {
!                               $error[] = lang('Title can not exceed 255 
characters in length');
                        }
  
!                       if (!$values['choose'])
                        {
                                if (! $values['number'])
***************
*** 453,462 ****
                                        if ($exists)
                                        {
!                                               $error[] = lang('That ID has 
been used already !');
                                        }
  
                                        if (strlen($values['number']) > 25)
                                        {
!                                               $error[] = lang('ID can not 
exceed 25 characters in length !');
                                        }
                                }
--- 455,464 ----
                                        if ($exists)
                                        {
!                                               $error[] = lang('That ID has 
been used already');
                                        }
  
                                        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 !');
                        }
  
--- 467,471 ----
                        if ((! $book_activities) && (! $bill_activities))
                        {
!                               $error[] = lang('Please choose activities for 
that project first');
                        }
  
***************
*** 472,476 ****
                                if (! 
checkdate($values['smonth'],$values['sday'],$values['syear']))
                                {
!                                       $error[] = lang('You have entered an 
invalid start date !');
                                }
                        }
--- 474,478 ----
                                if (! 
checkdate($values['smonth'],$values['sday'],$values['syear']))
                                {
!                                       $error[] = lang('You have entered an 
invalid start date');
                                }
                        }
***************
*** 480,484 ****
                                if (! 
checkdate($values['emonth'],$values['eday'],$values['eyear']))
                                {
!                                       $error[] = lang('You have entered an 
invalid end date !');
                                }
                        }
--- 482,486 ----
                                if (! 
checkdate($values['emonth'],$values['eday'],$values['eyear']))
                                {
!                                       $error[] = lang('You have entered an 
invalid end date');
                                }
                        }
***************
*** 618,626 ****
                                {
                                        
$this->soprojects->edit_project($values, $book_activities, $bill_activities);
                                }
                        }
                        else
                        {
!                               $this->soprojects->add_project($values, 
$book_activities, $bill_activities);
                        }
                }
--- 620,629 ----
                                {
                                        
$this->soprojects->edit_project($values, $book_activities, $bill_activities);
+                                       return $values['project_id'];
                                }
                        }
                        else
                        {
!                               return $this->soprojects->add_project($values, 
$book_activities, $bill_activities);
                        }
                }

Index: class.soprojects.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.soprojects.inc.php,v
retrieving revision 1.34.2.6.2.1
retrieving revision 1.34.2.6.2.2
diff -C2 -r1.34.2.6.2.1 -r1.34.2.6.2.2
*** class.soprojects.inc.php    26 Apr 2003 01:33:45 -0000      1.34.2.6.2.1
--- class.soprojects.inc.php    3 May 2003 00:56:43 -0000       1.34.2.6.2.2
***************
*** 44,49 ****
                        switch ($type)
                        {
!                               case 'subs':                    $s = " and 
parent != '0'"; break;
!                               case 'mains':                   $s = " and 
parent = '0'"; break;
                                default: return False;
              }
--- 44,49 ----
                        switch ($type)
                        {
!                               case 'subs':                    $s = ' and 
parent != 0'; break;
!                               case 'mains':                   $s = ' and 
parent = 0'; break;
                                default: return False;
              }
***************
*** 64,67 ****
--- 64,72 ----
                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)
                        {
***************
*** 75,79 ****
                        if (!$sort)
                        {
!                               $sort = "ASC";
                        }
  
--- 80,84 ----
                        if (!$sort)
                        {
!                               $sort = 'ASC';
                        }
  
***************
*** 84,88 ****
                        else
                        {
!                               $ordermethod = "order by start_date asc";
                        }
  
--- 89,93 ----
                        else
                        {
!                               $ordermethod = 'order by start_date asc';
                        }
  
***************
*** 96,104 ****
                                if ($this->isprojectadmin('pad') || 
$this->isbookkeeper('pbo'))
                                {
!                                       $filtermethod = " ( access != 'private' 
OR coordinator = '" . $this->account . "' )";
                                }
                                else
                                {
!                                       $filtermethod = " ( coordinator='" . 
$this->account . "'";
                                        if (is_array($this->grants))
                                        {
--- 101,109 ----
                                if ($this->isprojectadmin('pad') || 
$this->isbookkeeper('pbo'))
                                {
!                                       $filtermethod = " ( access != 'private' 
OR coordinator = " . $this->account . " )";
                                }
                                else
                                {
!                                       $filtermethod = ' ( coordinator=' . 
$this->account;
                                        if (is_array($this->grants))
                                        {
***************
*** 119,140 ****
                        elseif ($filter == 'yours')
                        {
!                               $filtermethod = " coordinator='" . 
$this->account . "'";
                        }
                        else
                        {
!                               $filtermethod = " coordinator='" . 
$this->account . "' AND access='private'";
                        }
  
!                       if ($cat_id)
                        {
!                               $filtermethod .= " AND category='$cat_id' ";
                        }
  
                        switch($type)
                        {
!                               case 'mains':   $filtermethod .= " AND parent = 
'0' "; break;
!                               case 'subs' :   $filtermethod .= " AND parent = 
'$pro_parent' AND parent != '0' "; break;
!                               case 'amains':  $filtermethod .= " AND parent = 
'0' "; break;
!                               case 'asubs':   $filtermethod .= " AND parent = 
'$pro_parent' AND parent != '0' "; break;
                        }
  
--- 124,145 ----
                        elseif ($filter == 'yours')
                        {
!                               $filtermethod = ' coordinator=' . 
$this->account;
                        }
                        else
                        {
!                               $filtermethod = ' coordinator=' . 
$this->account . "' AND access='private'";
                        }
  
!                       if ($cat_id > 0)
                        {
!                               $filtermethod .= ' AND category=' . $cat_id;
                        }
  
                        switch($type)
                        {
!                               case 'mains':
!                               case 'amains':  $filtermethod .= ' AND parent = 
0 '; break;
!                               case 'subs' :
!                               case 'asubs':   $filtermethod .= ' AND parent 
=' . $pro_parent . ' AND parent != 0 '; break;
                        }
  
***************
*** 180,184 ****
                function read_single_project($project_id)
                {
!                       $this->db->query("SELECT * from phpgw_p_projects WHERE 
id='$project_id'",__LINE__,__FILE__);
        
                        if ($this->db->next_record())
--- 185,189 ----
                function read_single_project($project_id)
                {
!                       $this->db->query('SELECT * from phpgw_p_projects WHERE 
id=' . $project_id,__LINE__,__FILE__);
        
                        if ($this->db->next_record())
***************
*** 235,253 ****
  
                        $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) values ('" . $values['owner'] . "','" . 
$values['access'] . "','" . $values['cat'] . "','"
!                                                       . time() ."','" . 
$values['sdate'] . "','" . $values['edate'] . "','" . $values['coordinator'] . 
"','" . $values['customer']
!                                                       . "','" . 
$values['status'] . "','" . $values['descr'] . "','" . $values['title'] . "','" 
. $values['budget'] . "','"
!                                                       . $values['number'] . 
"','" . $values['parent'] . "')",__LINE__,__FILE__);
  
!                       $this->db->query("SELECT max(id) FROM 
phpgw_p_projects");
                        if($this->db->next_record())
                        {
                                $p_id = $this->db->f(0);
!                       }
  
                        $this->db->unlock();
  
--- 240,258 ----
  
                        $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) values (" . intval($values['owner']) . ",'" . 
$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']) . ")",__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');
                        $this->db->unlock();
  
***************
*** 258,263 ****
                                        while($activ=each($book_activities))
                                        {
!                                               $this->db->query("insert into 
phpgw_p_projectactivities (project_id,activity_id,billable) values ('$p_id','"
!                                                                               
. $activ[1] . "','N')",__LINE__,__FILE__);
                                        }
                                }
--- 263,268 ----
                                        while($activ=each($book_activities))
                                        {
!                                               $this->db->query('insert into 
phpgw_p_projectactivities (project_id,activity_id,billable) values (' . $p_id . 
','
!                                                                               
. $activ[1] . ",'N')",__LINE__,__FILE__);
                                        }
                                }
***************
*** 267,298 ****
                                        while($activ=each($bill_activities))
                                        {
!                                               $this->db->query("insert into 
phpgw_p_projectactivities (project_id,activity_id,billable) values ('$p_id','"
                                                                                
. $activ[1] . "','Y')",__LINE__,__FILE__);
                                        }
                                }
                        }
                }
  
                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']);
! 
!                       $this->db->query("update phpgw_p_projects set access='" 
. $values['access'] . "', category='" . $values['cat'] . "', entry_date='"
!                                                       . time() . "', 
start_date='" . $values['sdate'] . "', end_date='" . $values['edate'] . "', 
coordinator='"
!                                                       . 
$values['coordinator'] . "', customer='" . $values['customer'] . "', status='" 
. $values['status'] . "', descr='"
!                                                       . $values['descr'] . 
"', title='" . $values['title'] . "', budget='" . $values['budget'] . "', num='"
!                                                       . $values['number'] . 
"' where id='" . $values['project_id'] . "'",__LINE__,__FILE__);
  
                        if (count($book_activities) != 0)
                        {
!                               $this->db2->query("delete from 
phpgw_p_projectactivities where project_id='" . $values['project_id']
!                                                               . "' and 
billable='N'",__LINE__,__FILE__);
  
                                while($activ=each($book_activities))
                                {
!                                       $this->db->query("insert into 
phpgw_p_projectactivities (project_id, activity_id, billable) values ('" . 
$values['project_id']
!                                                                       . 
"','$activ[1]','N')",__LINE__,__FILE__);
                                }
                        }
--- 272,306 ----
                                        while($activ=each($bill_activities))
                                        {
!                                               $this->db->query('insert into 
phpgw_p_projectactivities (project_id,activity_id,billable) values (' . $p_id . 
','
                                                                                
. $activ[1] . "','Y')",__LINE__,__FILE__);
                                        }
                                }
+                               return $p_id;
                        }
+                       return False;
                }
  
                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['project_id']   = intval($values['project_id']);
! 
!                       $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'] . 
"' where id=" . $values['project_id'],__LINE__,__FILE__);
  
                        if (count($book_activities) != 0)
                        {
!                               $this->db2->query('delete from 
phpgw_p_projectactivities where project_id=' . $values['project_id']
!                                                               . " and 
billable='N'",__LINE__,__FILE__);
  
                                while($activ=each($book_activities))
                                {
!                                       $this->db->query('insert into 
phpgw_p_projectactivities (project_id, activity_id, billable) values (' . 
$values['project_id']
!                                                                       . ',' . 
$activ[1] . ",'N')",__LINE__,__FILE__);
                                }
                        }
***************
*** 300,310 ****
                        if (count($bill_activities) != 0)
                        {
!                               $this->db2->query("delete from 
phpgw_p_projectactivities where project_id='" . $values['project_id']
!                                                               . "' and 
billable='Y'",__LINE__,__FILE__);
  
                                while($activ=each($bill_activities))
                                {
!                                       $this->db->query("insert into 
phpgw_p_projectactivities (project_id, activity_id, billable) values ('" . 
$values['project_id']
!                                                                       . 
"','$activ[1]','Y')",__LINE__,__FILE__);
                                }
                        }
--- 308,318 ----
                        if (count($bill_activities) != 0)
                        {
!                               $this->db2->query('delete from 
phpgw_p_projectactivities where project_id=' . $values['project_id']
!                                                               . " and 
billable='Y'",__LINE__,__FILE__);
  
                                while($activ=each($bill_activities))
                                {
!                                       $this->db->query('insert into 
phpgw_p_projectactivities (project_id, activity_id, billable) values (' . 
$values['project_id']
!                                                                       . ',' . 
$activ[1] . ",'Y')",__LINE__,__FILE__);
                                }
                        }
***************
*** 322,328 ****
                        }
  
!                       $this->db->query("SELECT 
phpgw_p_activities.id,num,descr,billperae,activity_id from 
phpgw_p_activities,phpgw_p_projectactivities "
!                                                       . "WHERE 
phpgw_p_projectactivities.project_id='" . $project_id . "' AND 
phpgw_p_activities.id="
!                                                       . 
"phpgw_p_projectactivities.activity_id" . $bill_filter,__LINE__,__FILE__);
  
                        while ($this->db->next_record())
--- 330,336 ----
                        }
  
!                       $this->db->query('SELECT 
phpgw_p_activities.id,num,descr,billperae,activity_id from 
phpgw_p_activities,phpgw_p_projectactivities '
!                                                       . 'WHERE 
phpgw_p_projectactivities.project_id=' . $project_id . ' AND 
phpgw_p_activities.id='
!                                                       . 
'phpgw_p_projectactivities.activity_id' . $bill_filter,__LINE__,__FILE__);
  
                        while ($this->db->next_record())
***************
*** 349,353 ****
                        }
  
!                       $this->db2->query("SELECT activity_id from 
phpgw_p_projectactivities WHERE project_id='$project_id' 
$bill_filter",__LINE__,__FILE__);
                        while ($this->db2->next_record())
                        {
--- 357,361 ----
                        }
  
!                       $this->db2->query('SELECT activity_id from 
phpgw_p_projectactivities WHERE project_id=' . intval($project_id) . 
$bill_filter,__LINE__,__FILE__);
                        while ($this->db2->next_record())
                        {
***************
*** 355,359 ****
                        }
  
!                       $this->db->query("SELECT id,num,descr,billperae FROM 
phpgw_p_activities ORDER BY descr asc");
                        while ($this->db->next_record())
                        {
--- 363,367 ----
                        }
  
!                       $this->db->query('SELECT id,num,descr,billperae FROM 
phpgw_p_activities ORDER BY descr asc');
                        while ($this->db->next_record())
                        {
***************
*** 389,393 ****
                        }
  
!                       $this->db2->query("SELECT activity_id from 
phpgw_p_projectactivities WHERE project_id='$project_id' 
$bill_filter",__LINE__,__FILE__);
                        while ($this->db2->next_record())
                        {
--- 397,401 ----
                        }
  
!                       $this->db2->query('SELECT activity_id from 
phpgw_p_projectactivities WHERE project_id=' . $project_id . 
$bill_filter,__LINE__,__FILE__);
                        while ($this->db2->next_record())
                        {
***************
*** 395,400 ****
                        }
  
!                       $this->db->query("SELECT a.id, a.num, a.descr, 
a.billperae, pa.activity_id FROM phpgw_p_activities as a, 
phpgw_p_projectactivities as pa"
!                                                       . " WHERE 
pa.project_id='$pro_parent' $bill_filter AND pa.activity_id=a.id ORDER BY 
a.descr asc");
                        while ($this->db->next_record())
                        {
--- 403,408 ----
                        }
  
!                       $this->db->query('SELECT a.id, a.num, a.descr, 
a.billperae, pa.activity_id FROM phpgw_p_activities as a, 
phpgw_p_projectactivities as pa'
!                                                       . ' WHERE 
pa.project_id=' . $pro_parent . $bill_filter . ' AND pa.activity_id=a.id ORDER 
BY a.descr asc');
                        while ($this->db->next_record())
                        {
***************
*** 428,433 ****
                function select_hours_activities($project_id, $activity = '')
                {
!                       $this->db->query("SELECT activity_id,num, 
descr,billperae,billable FROM phpgw_p_projectactivities,phpgw_p_activities 
WHERE project_id ='"
!                                                       . $project_id . "' AND 
phpgw_p_projectactivities.activity_id=phpgw_p_activities.id order by descr 
asc",__LINE__,__FILE__);
  
                        while ($this->db->next_record())
--- 436,441 ----
                function select_hours_activities($project_id, $activity = '')
                {
!                       $this->db->query('SELECT activity_id,num, 
descr,billperae,billable FROM phpgw_p_projectactivities,phpgw_p_activities 
WHERE project_id ='
!                                                       . $project_id . ' AND 
phpgw_p_projectactivities.activity_id=phpgw_p_activities.id order by descr 
asc',__LINE__,__FILE__);
  
                        while ($this->db->next_record())
***************
*** 454,458 ****
                        if ($action == 'act')
                        {                       
!                               $this->db->query("SELECT num,descr from 
phpgw_p_activities where id='" . $item . "'",__LINE__,__FILE__);
                                if ($this->db->next_record())
                                {
--- 462,466 ----
                        if ($action == 'act')
                        {                       
!                               $this->db->query('SELECT num,descr from 
phpgw_p_activities where id=' . $item,__LINE__,__FILE__);
                                if ($this->db->next_record())
                                {
***************
*** 462,466 ****
                        elseif ($action == 'co')
                        {
!                               $this->db->query("SELECT coordinator from 
phpgw_p_projects where id='" . $item . "'",__LINE__,__FILE__);
                                if ($this->db->next_record())
                                {
--- 470,474 ----
                        elseif ($action == 'co')
                        {
!                               $this->db->query('SELECT coordinator from 
phpgw_p_projects where id=' . $item,__LINE__,__FILE__);
                                if ($this->db->next_record())
                                {
***************
*** 477,481 ****
                                }
  
!                               $this->db->query('SELECT ' . $column . "from 
phpgw_p_projects where id='" . $item . "'",__LINE__,__FILE__);
                                if ($this->db->next_record())
                                {
--- 485,489 ----
                                }
  
!                               $this->db->query('SELECT ' . $column . 'from 
phpgw_p_projects where id=' . $item,__LINE__,__FILE__);
                                if ($this->db->next_record())
                                {
***************
*** 504,516 ****
                                if ($pa_id && ($pa_id != 0))
                                {
!                                       $editexists = " and id != '$pa_id'";
                                }
  
!                               $this->db->query("select count(*) from $p_table 
where num = '$num' $editexists",__LINE__,__FILE__);
                        }
  
                        if ($check == 'par')
                        {
!                               $this->db->query("select count(*) from 
phpgw_p_projects where parent = '$pa_id'",__LINE__,__FILE__);
                        }
                        $this->db->next_record();
--- 512,524 ----
                                if ($pa_id && ($pa_id != 0))
                                {
!                                       $editexists = ' and id !=' . $pa_id;
                                }
  
!                               $this->db->query("select count(*) from $p_table 
where num='$num'" .  $editexists,__LINE__,__FILE__);
                        }
  
                        if ($check == 'par')
                        {
!                               $this->db->query('select count(*) from 
phpgw_p_projects where parent=' . $pa_id,__LINE__,__FILE__);
                        }
                        $this->db->next_record();
***************
*** 636,640 ****
                                while($activ=each($users))
                                {
!                                       $this->db->query("insert into 
phpgw_p_projectmembers (project_id, account_id,type) values (0,'" . $activ[1] . 
"','"
                                                                        . $aa . 
"')",__LINE__,__FILE__);
                                }
--- 644,648 ----
                                while($activ=each($users))
                                {
!                                       $this->db->query('insert into 
phpgw_p_projectmembers (project_id, account_id,type) values (0,' . $activ[1] . 
",'"
                                                                        . $aa . 
"')",__LINE__,__FILE__);
                                }
***************
*** 645,649 ****
                                while($activ=each($groups))
                                {
!                                       $this->db->query("insert into 
phpgw_p_projectmembers (project_id, account_id,type) values (0,'" . $activ[1] . 
"','"
                                                                        . $ag . 
"')",__LINE__,__FILE__);
                                }
--- 653,657 ----
                                while($activ=each($groups))
                                {
!                                       $this->db->query('insert into 
phpgw_p_projectmembers (project_id, account_id,type) values (0,' . $activ[1] . 
"','"
                                                                        . $ag . 
"')",__LINE__,__FILE__);
                                }
***************
*** 695,699 ****
                function create_jobid($pro_parent)
                {
!                       $this->db->query("select num from phpgw_p_projects 
where id='$pro_parent'");
                        $this->db->next_record();
                        $prefix = $this->db->f('num') . '/';
--- 703,707 ----
                function create_jobid($pro_parent)
                {
!                       $this->db->query('select num from phpgw_p_projects 
where id=' . $pro_parent);
                        $this->db->next_record();
                        $prefix = $this->db->f('num') . '/';
***************
*** 754,758 ****
                                if ($cat_id)
                                {
!                                       $filtermethod .= " AND 
category='$cat_id' ";
                                }
                        }
--- 762,766 ----
                                if ($cat_id)
                                {
!                                       $filtermethod .= ' AND category=' . 
$cat_id;
                                }
                        }
***************
*** 761,769 ****
                                if ($cat_id)
                                {
!                                       $filtermethod = " WHERE 
category='$cat_id' ";
                                }
                        }
  
!                       $sql = "select * from phpgw_p_activities $filtermethod";
                        $this->db2->query($sql,__LINE__,__FILE__);
                        $this->total_records = $this->db2->num_rows();
--- 769,777 ----
                                if ($cat_id)
                                {
!                                       $filtermethod = ' WHERE category=' . 
$cat_id;
                                }
                        }
  
!                       $sql = 'select * from phpgw_p_activities' . 
$filtermethod;
                        $this->db2->query($sql,__LINE__,__FILE__);
                        $this->total_records = $this->db2->num_rows();
***************
*** 795,799 ****
                function read_single_activity($activity_id)
                {
!                       $this->db->query("SELECT * from phpgw_p_activities 
WHERE id='$activity_id'",__LINE__,__FILE__);
        
                        if ($this->db->next_record())
--- 803,807 ----
                function read_single_activity($activity_id)
                {
!                       $this->db->query('SELECT * from phpgw_p_activities 
WHERE id=' . $activity_id,__LINE__,__FILE__);
        
                        if ($this->db->next_record())
***************
*** 816,821 ****
  
                        $this->db->query("insert into phpgw_p_activities 
(num,category,descr,remarkreq,billperae,minperae) values ('"
!                                                       . $values['number'] . 
"','" . $values['cat'] . "','" . $values['descr'] . "','" . 
$values['remarkreq'] . "','"
!                                                       . $values['billperae'] 
. "','" . $values['minperae'] . "')",__LINE__,__FILE__);
                }
  
--- 824,829 ----
  
                        $this->db->query("insert into phpgw_p_activities 
(num,category,descr,remarkreq,billperae,minperae) values ('"
!                                                       . $values['number'] . 
"'," . $values['cat'] . ",'" . $values['descr'] . "','" . $values['remarkreq'] 
. "',"
!                                                       . $values['billperae'] 
. ','  . $values['minperae'] . ')',__LINE__,__FILE__);
                }
  
***************
*** 825,832 ****
                        $values['descr']        = 
$this->db->db_addslashes($values['descr']);
  
!                       $this->db->query("update phpgw_p_activities set num='" 
. $values['number'] . "', category='" . $values['cat']
!                                                       . "',remarkreq='" . 
$values['remarkreq'] . "',descr='" . $values['descr'] . "',billperae='"
!                                                       . $values['billperae'] 
. "',minperae='" . $values['minperae'] . "' where id='" . $values['activity_id']
!                                                       . 
"'",__LINE__,__FILE__);
                }
  
--- 833,839 ----
                        $values['descr']        = 
$this->db->db_addslashes($values['descr']);
  
!                       $this->db->query("update phpgw_p_activities set num='" 
. $values['number'] . "', category=" . $values['cat']
!                                                       . ",remarkreq='" . 
$values['remarkreq'] . "',descr='" . $values['descr'] . "',billperae="
!                                                       . $values['billperae'] 
. ',minperae=' . $values['minperae'] . ' where id=' . 
$values['activity_id'],__LINE__,__FILE__);
                }
  
***************
*** 842,853 ****
                        if ($subs)
                        {
!                               $subdelete = " OR parent ='" . $pa_id . "'";
                        }
  
!                       $this->db->query("DELETE from $p_table where id='" . 
$pa_id . "'" . $subdelete,__LINE__,__FILE__);
  
                        if ($action == 'act')
                        {
!                               $this->db->query("DELETE from 
phpgw_p_projectactivities where activity_id='" . $pa_id . 
"'",__LINE__,__FILE__); 
                        }
  
--- 849,860 ----
                        if ($subs)
                        {
!                               $subdelete = ' OR parent =' . $pa_id;
                        }
  
!                       $this->db->query("DELETE from $p_table where id=" . 
$pa_id . $subdelete,__LINE__,__FILE__);
  
                        if ($action == 'act')
                        {
!                               $this->db->query('DELETE from 
phpgw_p_projectactivities where activity_id=' . $pa_id,__LINE__,__FILE__); 
                        }
  
***************
*** 856,865 ****
                                if ($subs)
                                {
!                                       $subdelete = " or pro_parent='" . 
$pa_id . "'";
                                }
  
!                               $this->db->query("DELETE from phpgw_p_hours 
where project_id='" . $pa_id . "'" . $subdelete,__LINE__,__FILE__); 
  
!                               $this->db->query("select id from 
phpgw_p_delivery where project_id='" . $pa_id . "'",__LINE__,__FILE__);
  
                                while ($this->db->next_record())
--- 863,872 ----
                                if ($subs)
                                {
!                                       $subdelete = ' or pro_parent=' . $pa_id;
                                }
  
!                               $this->db->query('DELETE from phpgw_p_hours 
where project_id=' . $pa_id . $subdelete,__LINE__,__FILE__); 
  
!                               $this->db->query('select id from 
phpgw_p_delivery where project_id=' . $pa_id,__LINE__,__FILE__);
  
                                while ($this->db->next_record())
***************
*** 873,882 ****
                                for ($i=0;$i<=count($del);$i++)
                                {
!                                       $this->db->query("Delete from 
phpgw_p_deliverypos where delivery_id='" . $del[$i]['id'] . 
"'",__LINE__,__FILE__);
                                }
  
!                               $this->db->query("DELETE from phpgw_p_delivery 
where project_id='" . $pa_id . "'",__LINE__,__FILE__);
  
!                               $this->db->query("select id from 
phpgw_p_invoice where project_id='" . $pa_id . "'",__LINE__,__FILE__);
  
                                while ($this->db->next_record())
--- 880,889 ----
                                for ($i=0;$i<=count($del);$i++)
                                {
!                                       $this->db->query('Delete from 
phpgw_p_deliverypos where delivery_id=' . $del[$i]['id'],__LINE__,__FILE__);
                                }
  
!                               $this->db->query('DELETE from phpgw_p_delivery 
where project_id=' . $pa_id,__LINE__,__FILE__);
  
!                               $this->db->query('select id from 
phpgw_p_invoice where project_id=' . $pa_id,__LINE__,__FILE__);
  
                                while ($this->db->next_record())
***************
*** 890,897 ****
                                for ($i=0;$i<=count($del);$i++)
                                {
!                                       $this->db->query("Delete from 
phpgw_p_invoicepos where invoice_id='" . $del[$i]['id'] . 
"'",__LINE__,__FILE__);
                                }
  
!                               $this->db->query("DELETE from phpgw_p_invoice 
where project_id='" . $pa_id . "'",__LINE__,__FILE__);
                        }
                }
--- 897,904 ----
                                for ($i=0;$i<=count($del);$i++)
                                {
!                                       $this->db->query('Delete from 
phpgw_p_invoicepos where invoice_id=' . $del[$i]['id'],__LINE__,__FILE__);
                                }
  
!                               $this->db->query('DELETE from phpgw_p_invoice 
where project_id=' . $pa_id,__LINE__,__FILE__);
                        }
                }
***************
*** 901,906 ****
                        if ($account_id && $account_id != 0)
                        {
!                               $this->db->query("delete from phpgw_p_hours 
where employee='" . $account_id . "'",__LINE__,__FILE__);
!                               $this->db->query("select id from 
phpgw_p_projects where coordinator='" . $account_id . "'",__LINE__,__FILE__);
  
                                while ($this->db->next_record())
--- 908,913 ----
                        if ($account_id && $account_id != 0)
                        {
!                               $this->db->query('delete from phpgw_p_hours 
where employee=' . $account_id,__LINE__,__FILE__);
!                               $this->db->query('select id from 
phpgw_p_projects where coordinator=' . $account_id,__LINE__,__FILE__);
  
                                while ($this->db->next_record())
***************
*** 915,924 ****
  //                                    exit;
  
!                                       $subdelete = " OR parent in (" . 
implode(',',$drop_list) . ")";
  
!                                       $this->db->query("DELETE from 
phpgw_p_projects where id in (" . implode(',',$drop_list) . ")"
                                                                        . 
$subdelete,__LINE__,__FILE__);
  
!                                       $this->db->query("select id from 
phpgw_p_delivery where project_id in (" . implode(',',$drop_list) . 
")",__LINE__,__FILE__);
  
                                        while ($this->db->next_record())
--- 922,931 ----
  //                                    exit;
  
!                                       $subdelete = ' OR parent in (' . 
implode(',',$drop_list) . ')';
  
!                                       $this->db->query('DELETE from 
phpgw_p_projects where id in (' . implode(',',$drop_list) . ')'
                                                                        . 
$subdelete,__LINE__,__FILE__);
  
!                                       $this->db->query('select id from 
phpgw_p_delivery where project_id in (' . implode(',',$drop_list) . 
')',__LINE__,__FILE__);
  
                                        while ($this->db->next_record())
***************
*** 949,956 ****
                                        for ($i=0;$i<=count($inv);$i++)
                                        {
!                                               $this->db->query("Delete from 
phpgw_p_invoicepos where invoice_id='" . $inv[$i]['id'] . 
"'",__LINE__,__FILE__);
                                        }
  
!                                       $this->db->query("DELETE from 
phpgw_p_invoice where project_id in (" . implode(',',$drop_list) . 
")",__LINE__,__FILE__);
                                }
                        }
--- 956,963 ----
                                        for ($i=0;$i<=count($inv);$i++)
                                        {
!                                               $this->db->query('Delete from 
phpgw_p_invoicepos where invoice_id=' . $inv[$i]['id'],__LINE__,__FILE__);
                                        }
  
!                                       $this->db->query('DELETE from 
phpgw_p_invoice where project_id in (' . implode(',',$drop_list) . 
')',__LINE__,__FILE__);
                                }
                        }
***************
*** 959,965 ****
                function change_owner($old, $new)
                {
!                       $this->db->query("UPDATE phpgw_p_projects set 
coordinator='" . $new . "' where coordinator='" . $old . "'",__LINE__,__FILE__);
!                       $this->db->query("UPDATE phpgw_p_hours set employee='" 
. $new . "' where employee='" . $old . "'",__LINE__,__FILE__);
!                       $this->db->query("UPDATE phpgw_p_projectmembers set 
account_id='" . $new . "' where (account_id='" . $old
                                                        . "' AND 
type='aa')",__LINE__,__FILE__);
                }
--- 966,972 ----
                function change_owner($old, $new)
                {
!                       $this->db->query('UPDATE phpgw_p_projects set 
coordinator=' . $new . ' where coordinator=' . $old,__LINE__,__FILE__);
!                       $this->db->query('UPDATE phpgw_p_hours set employee=' . 
$new . ' where employee=' . $old,__LINE__,__FILE__);
!                       $this->db->query('UPDATE phpgw_p_projectmembers set 
account_id=' . $new . ' where (account_id=' . $old
                                                        . "' AND 
type='aa')",__LINE__,__FILE__);
                }

Index: class.uiprojects.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.uiprojects.inc.php,v
retrieving revision 1.47.2.7.2.2
retrieving revision 1.47.2.7.2.3
diff -C2 -r1.47.2.7.2.2 -r1.47.2.7.2.3
*** class.uiprojects.inc.php    27 Apr 2003 22:39:19 -0000      1.47.2.7.2.2
--- class.uiprojects.inc.php    3 May 2003 00:56:43 -0000       1.47.2.7.2.3
***************
*** 48,52 ****
                        'abook'                         => True,
                        'preferences'           => True,
!                       'archive'                       => True
                );
  
--- 48,53 ----
                        'abook'                         => True,
                        'preferences'           => True,
!                       'archive'                       => True,
!                       'accounts_popup'        => True
                );
  
***************
*** 107,119 ****
                        
$GLOBALS['phpgw']->template->set_var('lang_title',lang('Title'));
                        
$GLOBALS['phpgw']->template->set_var('lang_status',lang('Status'));
-                       
$GLOBALS['phpgw']->template->set_var('lang_save',lang('Save'));
-                       
$GLOBALS['phpgw']->template->set_var('lang_reset',lang('Clear form'));
                        
$GLOBALS['phpgw']->template->set_var('lang_budget',lang('Budget'));
                        
$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_bookable_activities',lang('Bookable 
activities'));
                        
$GLOBALS['phpgw']->template->set_var('lang_billable_activities',lang('Billable 
activities'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_edit',lang('Edit'));
                        
$GLOBALS['phpgw']->template->set_var('lang_view',lang('View'));
                        
$GLOBALS['phpgw']->template->set_var('lang_hours',lang('Work hours'));
--- 108,118 ----
                        
$GLOBALS['phpgw']->template->set_var('lang_title',lang('Title'));
                        
$GLOBALS['phpgw']->template->set_var('lang_status',lang('Status'));
                        
$GLOBALS['phpgw']->template->set_var('lang_budget',lang('Budget'));
                        
$GLOBALS['phpgw']->template->set_var('lang_customer',lang('Customer'));
                        
$GLOBALS['phpgw']->template->set_var('lang_coordinator',lang('Coordinator'));
! 
                        
$GLOBALS['phpgw']->template->set_var('lang_bookable_activities',lang('Bookable 
activities'));
                        
$GLOBALS['phpgw']->template->set_var('lang_billable_activities',lang('Billable 
activities'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_edit',lang('edit'));
                        
$GLOBALS['phpgw']->template->set_var('lang_view',lang('View'));
                        
$GLOBALS['phpgw']->template->set_var('lang_hours',lang('Work hours'));
***************
*** 123,127 ****
                        
$GLOBALS['phpgw']->template->set_var('lang_deliveries',lang('Deliveries'));
                        
$GLOBALS['phpgw']->template->set_var('lang_stats',lang('Statistics'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_submit',lang('Submit'));
                }
  
--- 122,131 ----
                        
$GLOBALS['phpgw']->template->set_var('lang_deliveries',lang('Deliveries'));
                        
$GLOBALS['phpgw']->template->set_var('lang_stats',lang('Statistics'));
! 
!                       
$GLOBALS['phpgw']->template->set_var('lang_done',lang('done'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_save',lang('save'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_apply',lang('apply'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_cancel',lang('cancel'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_search',lang('search'));
                }
  
***************
*** 244,249 ****
                                                        . '<select 
name="cat_id" onChange="this.form.submit();"><option value="none">' . 
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'));
!                               
$GLOBALS['phpgw']->template->set_var(lang_action,lang('Jobs'));
                        }
                        else
--- 248,252 ----
                                                        . '<select 
name="cat_id" onChange="this.form.submit();"><option value="none">' . 
lang('Select category') . '</option>' . "\n"
                                                        . 
$this->cats->formatted_list('select','all',$this->cat_id,True) . '</select>';
!                               
$GLOBALS['phpgw']->template->set_var('lang_action',lang('Jobs'));
                        }
                        else
***************
*** 252,256 ****
                                                        . '<select 
name="pro_parent" onChange="this.form.submit();"><option value="">' . 
lang('Select main project') . '</option>' . "\n"
                                                        . 
$this->boprojects->select_project_list('mains', $status, $pro_parent) . 
'</select>';
-                               
$GLOBALS['phpgw']->template->set_var('lang_header',lang('Job list'));
                                
$GLOBALS['phpgw']->template->set_var('lang_action',lang('Work hours'));
                        }
--- 255,258 ----
***************
*** 266,284 ****
  // ---------------- list header variable template-declarations 
--------------------------
  
!                       
$GLOBALS['phpgw']->template->set_var(sort_number,$this->nextmatchs->show_sort_order($this->sort,'num',$this->order,'/index.php',lang('Project
 ID'),$link_data));
  
                        if ($action == 'mains')
                        {
!                               
$GLOBALS['phpgw']->template->set_var(sort_action,$this->nextmatchs->show_sort_order($this->sort,'customer',$this->order,'/index.php',lang('Customer'),$link_data));
                        }
                        else
                        {
!                               
$GLOBALS['phpgw']->template->set_var(sort_action,$this->nextmatchs->show_sort_order($this->sort,'start_date',$this->order,'/index.php',lang('Start
 date'),$link_data));
                        }
  
!                       
$GLOBALS['phpgw']->template->set_var(sort_status,$this->nextmatchs->show_sort_order($this->sort,'status',$this->order,'/index.php',lang('Status'),$link_data));
!                       
$GLOBALS['phpgw']->template->set_var(sort_title,$this->nextmatchs->show_sort_order($this->sort,'title',$this->order,'/index.php',lang('Title'),$link_data));
!                       
$GLOBALS['phpgw']->template->set_var(sort_end_date,$this->nextmatchs->show_sort_order($this->sort,'end_date',$this->order,'/index.php',lang('Date
 due'),$link_data));
!                       
$GLOBALS['phpgw']->template->set_var(sort_coordinator,$this->nextmatchs->show_sort_order($this->sort,'coordinator',$this->order,'/index.php',lang('Coordinator'),$link_data));
  
  
--- 268,286 ----
  // ---------------- list header variable template-declarations 
--------------------------
  
!                       
$GLOBALS['phpgw']->template->set_var('sort_number',$this->nextmatchs->show_sort_order($this->sort,'num',$this->order,'/index.php',lang('Project
 ID'),$link_data));
  
                        if ($action == 'mains')
                        {
!                               
$GLOBALS['phpgw']->template->set_var('sort_action',$this->nextmatchs->show_sort_order($this->sort,'customer',$this->order,'/index.php',lang('Customer'),$link_data));
                        }
                        else
                        {
!                               
$GLOBALS['phpgw']->template->set_var('sort_action',$this->nextmatchs->show_sort_order($this->sort,'start_date',$this->order,'/index.php',lang('Start
 date'),$link_data));
                        }
  
!                       
$GLOBALS['phpgw']->template->set_var('sort_status',$this->nextmatchs->show_sort_order($this->sort,'status',$this->order,'/index.php',lang('Status'),$link_data));
!                       
$GLOBALS['phpgw']->template->set_var('sort_title',$this->nextmatchs->show_sort_order($this->sort,'title',$this->order,'/index.php',lang('Title'),$link_data));
!                       
$GLOBALS['phpgw']->template->set_var('sort_end_date',$this->nextmatchs->show_sort_order($this->sort,'end_date',$this->order,'/index.php',lang('Date
 due'),$link_data));
!                       
$GLOBALS['phpgw']->template->set_var('sort_coordinator',$this->nextmatchs->show_sort_order($this->sort,'coordinator',$this->order,'/index.php',lang('Coordinator'),$link_data));
  
  
***************
*** 428,433 ****
  // ----------------------- end Add form declaration 
----------------------------
  
-                       
$GLOBALS['phpgw']->template->pfp('out','projects_list_t',True);
                        $this->save_sessiondata($action);
                }
  
--- 430,435 ----
  // ----------------------- end Add form declaration 
----------------------------
  
                        $this->save_sessiondata($action);
+                       
$GLOBALS['phpgw']->template->pfp('out','projects_list_t',True);
                }
  
***************
*** 452,455 ****
--- 454,462 ----
                }
  
+               function accounts_popup()
+               {
+                       $GLOBALS['phpgw']->accounts->accounts_popup('projects');
+               }
+ 
                function edit_project()
                {
***************
*** 457,462 ****
                        $pro_parent             = 
get_var('pro_parent',array('POST','GET'));
  
-                       $abid                           = 
get_var('abid',array('POST'));
- 
                        $book_activities        = 
get_var('book_activities',array('POST'));
                        $bill_activities        = 
get_var('bill_activities',array('POST'));
--- 464,467 ----
***************
*** 474,484 ****
                        );
  
!                       if ($values['submit'])
                        {
!                               $this->cat_id = 
($values['new_cat']?$values['new_cat']:'');
  
                                $values['project_id']   = $project_id;
                                $values['cat']                  = $this->cat_id;
!                               $values['customer']             = $abid;
                                $values['parent']               = $pro_parent;
  
--- 479,490 ----
                        );
  
!                       if ($_POST['save'] || $_POST['apply'])
                        {
!                               //$this->cat_id = 
($values['new_cat']?$values['new_cat']:$this->cat_id);
  
+                               $values['coordinator']  = $_POST['accountid'];
                                $values['project_id']   = $project_id;
                                $values['cat']                  = $this->cat_id;
!                               $values['customer']             = 
$_POST['abid'];
                                $values['parent']               = $pro_parent;
  
***************
*** 490,505 ****
                                else
                                {
!                                       
$this->boprojects->save_project($action, $values, $book_activities, 
$bill_activities);
!                                       Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',$link_data));
                                }
                        }
  
!                       $this->display_app_header();
  
!                       $form = ($project_id?'edit':'add');
  
!                       $GLOBALS['phpgw']->template->set_file(array('projects_' 
. $form => 'form.tpl'));
!                       $GLOBALS['phpgw']->template->set_block('projects_' . 
$form,'add','addhandle');
!                       $GLOBALS['phpgw']->template->set_block('projects_' . 
$form,'edit','edithandle');
  
                        $nopref = $this->boprojects->check_prefs();
--- 496,522 ----
                                else
                                {
!                                       $project_id = 
$this->boprojects->save_project($action, $values, $book_activities, 
$bill_activities);
! 
!                                       if($_POST['save'])
!                                       {
!                                               
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
!                                       }
!                                       else
!                                       {
!                                               
$GLOBALS['phpgw']->template->set_var('message',lang('project %1 has been 
saved',$values['title']));
!                                       }
                                }
                        }
  
!                       if($_POST['cancel'])
!                       {
!                               
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
!                       }
  
!                       $this->display_app_header();
  
!                       $GLOBALS['phpgw']->template->set_file(array('edit_form' 
=> 'form.tpl'));
!                       
$GLOBALS['phpgw']->template->set_block('edit_form','clist','clisthandle');
!                       
$GLOBALS['phpgw']->template->set_block('edit_form','cfield','cfieldhandle');
  
                        $nopref = $this->boprojects->check_prefs();
***************
*** 513,521 ****
                        }
  
-                       
$GLOBALS['phpgw']->template->set_var('done_url',$GLOBALS['phpgw']->link('/index.php',$link_data));
                        
$GLOBALS['phpgw']->template->set_var('addressbook_link',$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiprojects.abook'));
! 
                        $link_data['menuaction'] = 
'projects.uiprojects.edit_project';
!                       
$GLOBALS['phpgw']->template->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php',$link_data));
  
                        if ($project_id)
--- 530,538 ----
                        }
  
                        
$GLOBALS['phpgw']->template->set_var('addressbook_link',$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiprojects.abook'));
!                       
$GLOBALS['phpgw']->template->set_var('accounts_link',$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiprojects.accounts_popup'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_open_popup',lang('open popup 
window'));
                        $link_data['menuaction'] = 
'projects.uiprojects.edit_project';
!                       
$GLOBALS['phpgw']->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php',$link_data));
  
                        if ($project_id)
***************
*** 586,590 ****
                        
$GLOBALS['phpgw']->template->set_var('status_list',$this->status_format($values['status']));
  
!                       
$GLOBALS['phpgw']->template->set_var('coordinator_list',$this->coordinator_format($values['coordinator']));
  
                        
$GLOBALS['phpgw']->template->set_var('budget',$values['budget']);
--- 603,625 ----
                        
$GLOBALS['phpgw']->template->set_var('status_list',$this->status_format($values['status']));
  
!                       
switch($GLOBALS['phpgw_info']['user']['preferences']['common']['account_selection'])
!                       {
!                               case 'popup':
!                                       if ($values['coordinator'])
!                                       {
!                                               
$GLOBALS['phpgw']->template->set_var('accountid',$values['coordinator']);
!                                               $co = 
$GLOBALS['phpgw']->accounts->get_account_data($values['coordinator']);
!                                               
$GLOBALS['phpgw']->template->set_var('accountname',$GLOBALS['phpgw']->common->display_fullname($co[$values['coordinator']]['lid'],
!                                                                               
                                                                        
$co[$values['coordinator']]['firstname'],$co[$values['coordinator']]['lastname']));
!                                       }
!                                       
$GLOBALS['phpgw']->template->set_var('clisthandle','');
!                                       
$GLOBALS['phpgw']->template->fp('cfieldhandle','cfield',True);
!                                       break;
!                               default:
!                                       
$GLOBALS['phpgw']->template->set_var('coordinator_list',$this->coordinator_format($values['coordinator']));
!                                               
$GLOBALS['phpgw']->template->set_var('cfieldhandle','');
!                                               
$GLOBALS['phpgw']->template->fp('clisthandle','clist',True);
!                                       break;
!                       }
  
                        
$GLOBALS['phpgw']->template->set_var('budget',$values['budget']);
***************
*** 596,600 ****
                                $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('projects') . ': ' . ($project_id?lang('edit project'):lang('add 
project'));
  
!                               $cat = '<select name="new_cat"><option 
value="">' . lang('None') . '</option>'
                                                .       
$this->cats->formatted_list('select','all',$this->cat_id,True) . '</select>';
  
--- 631,635 ----
                                $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('projects') . ': ' . ($project_id?lang('edit project'):lang('add 
project'));
  
!                               $cat = '<select name="cat_id"><option 
value="">' . lang('None') . '</option>'
                                                .       
$this->cats->formatted_list('select','all',$this->cat_id,True) . '</select>';
  
***************
*** 652,661 ****
                                
$GLOBALS['phpgw']->template->set_var('delete','&nbsp;');
                        }
! 
!                       $GLOBALS['phpgw']->template->set_var('edithandle','');
!                       $GLOBALS['phpgw']->template->set_var('addhandle','');
! 
!                       $GLOBALS['phpgw']->template->pfp('out','projects_' . 
$form);
!                       $GLOBALS['phpgw']->template->pfp($form . 
'handle',$form);
                }
  
--- 687,692 ----
                                
$GLOBALS['phpgw']->template->set_var('delete','&nbsp;');
                        }
!                       $this->save_sessiondata($action);
!                       $GLOBALS['phpgw']->template->pfp('out','edit_form');
                }
  





reply via email to

[Prev in Thread] Current Thread [Next in Thread]