phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: property/inc class.bopricebook.inc.php,1.5,1.6 c


From: Sigurd Nes <address@hidden>
Subject: [Phpgroupware-cvs] CVS: property/inc class.bopricebook.inc.php,1.5,1.6 class.historylog.inc.php,1.4,1.5 class.socategory.inc.php,1.2,1.3 class.sodocument.inc.php,1.4,1.5 class.sodrawing.inc.php,1.5,1.6 class.soinvoice.inc.php,1.19,1.20 class.solookup.inc.php,1.16,1.17 class.sopricebook.inc.php,1.7,1.8 class.soproject.inc.php,1.10,1.11 class.sorequest.inc.php,1.5,1.6class.sostandard_2.inc.php,1.15,1.16 class.sostandard_3.inc.php,1.2,1.3 class.sotemplate.inc.php,1.2,1.3 class.sotts.inc.php,1.15,1.16 class.sowo_hour.inc.php,1.8,1.9 class.soworkorder.inc.php,1.13,1.14 class.soXport.inc.php,1.22,1.23 class.uidrawing.inc.php,1.16,1.17 class.uitemplate.inc.php,1.7,1.8
Date: Thu, 15 May 2003 05:08:05 -0400

Update of /cvsroot/phpgroupware/property/inc
In directory subversions:/tmp/cvs-serv28589/inc

Modified Files:
        class.bopricebook.inc.php class.historylog.inc.php 
        class.socategory.inc.php class.sodocument.inc.php 
        class.sodrawing.inc.php class.soinvoice.inc.php 
        class.solookup.inc.php class.sopricebook.inc.php 
        class.soproject.inc.php class.sorequest.inc.php 
        class.sostandard_2.inc.php class.sostandard_3.inc.php 
        class.sotemplate.inc.php class.sotts.inc.php 
        class.sowo_hour.inc.php class.soworkorder.inc.php 
        class.soXport.inc.php class.uidrawing.inc.php 
        class.uitemplate.inc.php 
Log Message:
no message

Index: class.bopricebook.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.bopricebook.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** class.bopricebook.inc.php   5 Mar 2003 14:31:49 -0000       1.5
--- class.bopricebook.inc.php   15 May 2003 09:08:02 -0000      1.6
***************
*** 479,483 ****
                        else
                        {
!                               
$values['activity_id']=$this->socommon->next_id('fm_wo_activities');
                                $receipt = $this->so->add_activity($values);
                        }
--- 479,483 ----
                        else
                        {
!                               
$values['activity_id']=$this->socommon->next_id('fm_activities');
                                $receipt = $this->so->add_activity($values);
                        }
***************
*** 498,502 ****
                        else
                        {
!                               
$values['agreement_id']=$this->socommon->next_id('fm_wo_agreement');
                                $receipt = $this->so->add_agreement($values);
                        }
--- 498,502 ----
                        else
                        {
!                               
$values['agreement_id']=$this->socommon->next_id('fm_agreement');
                                $receipt = $this->so->add_agreement($values);
                        }

Index: class.historylog.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.historylog.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** class.historylog.inc.php    29 Apr 2003 12:20:06 -0000      1.4
--- class.historylog.inc.php    15 May 2003 09:08:02 -0000      1.5
***************
*** 45,55 ****
                        {
                                case 'request':
!                                       $this->table='fm_wo_request_history';
                                        break;
                                case 'workorder':
!                                       $this->table='fm_wo_workorder_history';
                                        break;
                                case 'project':
!                                       $this->table='fm_wo_project_history';
                                        break;
                                case 'tts':
--- 45,55 ----
                        {
                                case 'request':
!                                       $this->table='fm_request_history';
                                        break;
                                case 'workorder':
!                                       $this->table='fm_workorder_history';
                                        break;
                                case 'project':
!                                       $this->table='fm_project_history';
                                        break;
                                case 'tts':

Index: class.socategory.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.socategory.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** class.socategory.inc.php    8 May 2003 10:47:51 -0000       1.2
--- class.socategory.inc.php    15 May 2003 09:08:02 -0000      1.3
***************
*** 102,121 ****
                        {
                                case 'accounting':
!                                       $table='fm_wo_accounts';
                                        break;
                                case 'dim_d':
!                                       $table='fm_wo_dim_d';
                                        break;
                                case 'tender_chapter':
!                                       $table='fm_wo_chapter';
                                        break;
                                case 'ticket':
!                                       $table='fm_ticket_category';
                                        break;
                                case 'request':
!                                       $table='fm_wo_request_category';
                                        break;
                                case 'wo':
!                                       $table='fm_wo_workorder_category';
                                        break;
                                case 'property':
--- 102,121 ----
                        {
                                case 'accounting':
!                                       $table='fm_b_account';
                                        break;
                                case 'dim_d':
!                                       $table='fm_dim_d';
                                        break;
                                case 'tender_chapter':
!                                       $table='fm_chapter';
                                        break;
                                case 'ticket':
!                                       $table='fm_tts_category';
                                        break;
                                case 'request':
!                                       $table='fm_request_category';
                                        break;
                                case 'wo':
!                                       $table='fm_workorder_category';
                                        break;
                                case 'property':

Index: class.sodocument.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.sodocument.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** class.sodocument.inc.php    30 Apr 2003 09:50:02 -0000      1.4
--- class.sodocument.inc.php    15 May 2003 09:08:02 -0000      1.5
***************
*** 71,75 ****
                function select_branch_list()
                {
!                       $this->db->query("SELECT id, descr FROM fm_wo_branch 
ORDER BY id ");
  
                        $i = 0;
--- 71,75 ----
                function select_branch_list()
                {
!                       $this->db->query("SELECT id, descr FROM fm_branch ORDER 
BY id ");
  
                        $i = 0;

Index: class.sodrawing.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.sodrawing.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** class.sodrawing.inc.php     30 Apr 2003 09:50:02 -0000      1.5
--- class.sodrawing.inc.php     15 May 2003 09:08:02 -0000      1.6
***************
*** 71,75 ****
                function select_branch_list()
                {
!                       $this->db->query("SELECT id, descr FROM fm_wo_branch 
ORDER BY id ");
  
                        $i = 0;
--- 71,75 ----
                function select_branch_list()
                {
!                       $this->db->query("SELECT id, descr FROM fm_branch ORDER 
BY id ");
  
                        $i = 0;

Index: class.soinvoice.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.soinvoice.inc.php,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -r1.19 -r1.20
*** class.soinvoice.inc.php     25 Apr 2003 09:46:14 -0000      1.19
--- class.soinvoice.inc.php     15 May 2003 09:08:02 -0000      1.20
***************
*** 347,352 ****
                        }
  
!                       $sql = "SELECT 
$table.*,fm_wo_wrkorders.status,fm_wo_wrkorders.charge_tenant ,org_name FROM 
$table $this->join "
!                       . "fm_wo_wrkorders on fm_wo_wrkorders.id = 
$table.pmwrkord_code  $this->join "
                        . "phpgw_addressbook  on $table.spvend_code = 
phpgw_addressbook.id  $filtermethod ";
  
--- 347,352 ----
                        }
  
!                       $sql = "SELECT 
$table.*,fm_workorder.status,fm_workorder.charge_tenant ,org_name FROM $table 
$this->join "
!                       . "fm_workorder on fm_workorder.id = 
$table.pmwrkord_code  $this->join "
                        . "phpgw_addressbook  on $table.spvend_code = 
phpgw_addressbook.id  $filtermethod ";
  
***************
*** 530,534 ****
                                        
$budget_account=$values['budget_account'][$n];
  
!                                       $GLOBALS['phpgw']->db->query("select 
count(*) from fm_wo_accounts  where id =$budget_account");
                                        $GLOBALS['phpgw']->db->next_record();
                                        if ($GLOBALS['phpgw']->db->f(0) == 0)
--- 530,534 ----
                                        
$budget_account=$values['budget_account'][$n];
  
!                                       $GLOBALS['phpgw']->db->query("select 
count(*) from fm_b_account  where id =$budget_account");
                                        $GLOBALS['phpgw']->db->next_record();
                                        if ($GLOBALS['phpgw']->db->f(0) == 0)
***************
*** 551,555 ****
                                {
                                        $dimd=$values['dimd'][$n];
!                                       $GLOBALS['phpgw']->db->query("select 
count(*) from  fm_wo_dim_d where id =$dimd");
                                        $GLOBALS['phpgw']->db->next_record();
                                        if ($GLOBALS['phpgw']->db->f(0) == 0)
--- 551,555 ----
                                {
                                        $dimd=$values['dimd'][$n];
!                                       $GLOBALS['phpgw']->db->query("select 
count(*) from  fm_dim_d where id =$dimd");
                                        $GLOBALS['phpgw']->db->next_record();
                                        if ($GLOBALS['phpgw']->db->f(0) == 0)
***************
*** 591,600 ****
                                        if($values['close_order'][$n])
                                        {
!                                               
$GLOBALS['phpgw']->db->query("update fm_wo_wrkorders set status='closed' where 
id='$workorder_id'");
                                        }
  
                                        if(!$values['close_order'][$n] && 
$values['close_order_orig'][$n])
                                        {
!                                               
$GLOBALS['phpgw']->db->query("update fm_wo_wrkorders set status='re_opened' 
where id='$workorder_id'");
                                        }
  
--- 591,600 ----
                                        if($values['close_order'][$n])
                                        {
!                                               
$GLOBALS['phpgw']->db->query("update fm_workorder set status='closed' where 
id='$workorder_id'");
                                        }
  
                                        if(!$values['close_order'][$n] && 
$values['close_order_orig'][$n])
                                        {
!                                               
$GLOBALS['phpgw']->db->query("update fm_workorder set status='re_opened' where 
id='$workorder_id'");
                                        }
  
***************
*** 815,819 ****
                function select_account_class()
                {
!                       $sql = "SELECT  distinct left(id,2) as id from 
fm_wo_accounts ";
                        $this->db->query($sql,__LINE__,__FILE__);
  
--- 815,819 ----
                function select_account_class()
                {
!                       $sql = "SELECT  distinct left(id,2) as id from 
fm_b_account ";
                        $this->db->query($sql,__LINE__,__FILE__);
  

Index: class.solookup.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.solookup.inc.php,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -r1.16 -r1.17
*** class.solookup.inc.php      12 Apr 2003 17:55:03 -0000      1.16
--- class.solookup.inc.php      15 May 2003 09:08:02 -0000      1.17
***************
*** 156,160 ****
                        }
  
!                       $sql = "SELECT * FROM fm_wo_accounts $querymethod  ";
  
                        $this->db2->query($sql,__LINE__,__FILE__);
--- 156,160 ----
                        }
  
!                       $sql = "SELECT * FROM fm_b_account $querymethod  ";
  
                        $this->db2->query($sql,__LINE__,__FILE__);
***************
*** 379,383 ****
                        }
  
!                       $sql = "SELECT * FROM fm_wo_ns3420  $querymethod  ";
  
                        $this->db2->query($sql,__LINE__,__FILE__);
--- 379,383 ----
                        }
  
!                       $sql = "SELECT * FROM fm_ns3420  $querymethod  ";
  
                        $this->db2->query($sql,__LINE__,__FILE__);

Index: class.sopricebook.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.sopricebook.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** class.sopricebook.inc.php   30 Apr 2003 10:17:58 -0000      1.7
--- class.sopricebook.inc.php   15 May 2003 09:08:02 -0000      1.8
***************
*** 31,35 ****
                function 
add_activity_first_prize($m_cost,$w_cost,$total_cost,$activity_id,$vendor_id,$date)
                {
!                       $this->db->query("update fm_wo_activity_price_index  
set index_count='1',this_index='1', 
m_cost='$m_cost',w_cost='$w_cost',total_cost='$total_cost',date='$date',current_index='1'
 where activity_id='$activity_id' and vendor_id= '$vendor_id' and index_count= 
'1'",__LINE__,__FILE__);
  
                        $receipt['message'][] = array('msg'=>lang('First entry 
is added!'));
--- 31,35 ----
                function 
add_activity_first_prize($m_cost,$w_cost,$total_cost,$activity_id,$vendor_id,$date)
                {
!                       $this->db->query("update fm_activity_price_index  set 
index_count='1',this_index='1', 
m_cost='$m_cost',w_cost='$w_cost',total_cost='$total_cost',date='$date',current_index='1'
 where activity_id='$activity_id' and vendor_id= '$vendor_id' and index_count= 
'1'",__LINE__,__FILE__);
  
                        $receipt['message'][] = array('msg'=>lang('First entry 
is added!'));
***************
*** 42,53 ****
                        for ($i=0; $i<count($update); $i++)
                        {
!                               $this->db->query("select max(index_count) as 
max_index_count from fm_wo_activity_price_index Where activity_id='". 
$update[$i]['activity_id'] . "' and vendor_id='".$update[$i]['vendor_id'] . 
"'",__LINE__,__FILE__);
                                $this->db->next_record();
                                $next_index_count  = 
$this->db->f('max_index_count')+1;
  
!                               $this->db->query("update 
fm_wo_activity_price_index set current_index = Null"
                                . " WHERE activity_id='" . 
$update[$i]['activity_id'] . "' and vendor_id='" . $update[$i]['vendor_id'] . 
"'",__LINE__,__FILE__);
  
!                               $this->db->query("insert into 
fm_wo_activity_price_index (activity_id, vendor_id, index_count, this_index, 
m_cost, w_cost, total_cost, date,current_index) "
                                . " values ('" .
                                        $update[$i]['activity_id'] . "','" .
--- 42,53 ----
                        for ($i=0; $i<count($update); $i++)
                        {
!                               $this->db->query("select max(index_count) as 
max_index_count from fm_activity_price_index Where activity_id='". 
$update[$i]['activity_id'] . "' and vendor_id='".$update[$i]['vendor_id'] . 
"'",__LINE__,__FILE__);
                                $this->db->next_record();
                                $next_index_count  = 
$this->db->f('max_index_count')+1;
  
!                               $this->db->query("update 
fm_activity_price_index set current_index = Null"
                                . " WHERE activity_id='" . 
$update[$i]['activity_id'] . "' and vendor_id='" . $update[$i]['vendor_id'] . 
"'",__LINE__,__FILE__);
  
!                               $this->db->query("insert into 
fm_activity_price_index (activity_id, vendor_id, index_count, this_index, 
m_cost, w_cost, total_cost, date,current_index) "
                                . " values ('" .
                                        $update[$i]['activity_id'] . "','" .
***************
*** 70,74 ****
                {
                        $this->db->query("SELECT phpgw_addressbook.org_name 
,vendor_id "
!                               . " FROM (fm_wo_activities $this->join 
fm_wo_activity_price_index ON fm_wo_activities.id = 
fm_wo_activity_price_index.activity_id) $this->join phpgw_addressbook ON 
fm_wo_activity_price_index.vendor_id = phpgw_addressbook.id "
                                . " GROUP by org_name ,vendor_id "
                                . " ORDER BY phpgw_addressbook.org_name ");
--- 70,74 ----
                {
                        $this->db->query("SELECT phpgw_addressbook.org_name 
,vendor_id "
!                               . " FROM (fm_activities $this->join 
fm_activity_price_index ON fm_activities.id = 
fm_activity_price_index.activity_id) $this->join phpgw_addressbook ON 
fm_activity_price_index.vendor_id = phpgw_addressbook.id "
                                . " GROUP by org_name ,vendor_id "
                                . " ORDER BY phpgw_addressbook.org_name ");
***************
*** 90,94 ****
                function get_agreement_list()
                {
!                       $this->db->query("SELECT * FROM fm_wo_agreement ORDER 
BY descr asc");
                        while ($this->db->next_record())
                        {
--- 90,94 ----
                function get_agreement_list()
                {
!                       $this->db->query("SELECT * FROM fm_agreement ORDER BY 
descr asc");
                        while ($this->db->next_record())
                        {
***************
*** 104,108 ****
                function get_dim_d_list()
                {
!                       $this->db->query("SELECT * FROM fm_wo_dim_d ORDER BY 
descr asc");
                        while ($this->db->next_record())
                        {
--- 104,108 ----
                function get_dim_d_list()
                {
!                       $this->db->query("SELECT * FROM fm_dim_d ORDER BY descr 
asc");
                        while ($this->db->next_record())
                        {
***************
*** 132,136 ****
                function get_branch_list()
                {
!                       $this->db->query("SELECT * FROM fm_wo_branch ORDER BY 
descr asc");
                        while ($this->db->next_record())
                        {
--- 132,136 ----
                function get_branch_list()
                {
!                       $this->db->query("SELECT * FROM fm_branch ORDER BY 
descr asc");
                        while ($this->db->next_record())
                        {
***************
*** 146,150 ****
                function check_activity_num($num='')
                {
!                       $this->db->query("SELECT count(*) FROM fm_wo_activities 
where num='$num'");
  
                        $this->db->next_record();
--- 146,150 ----
                function check_activity_num($num='')
                {
!                       $this->db->query("SELECT count(*) FROM fm_activities 
where num='$num'");
  
                        $this->db->next_record();
***************
*** 158,162 ****
                function check_agreement_num($num='')
                {
!                       $this->db->query("SELECT count(*) FROM fm_wo_agreement 
where num='$num'");
  
                        $this->db->next_record();
--- 158,162 ----
                function check_agreement_num($num='')
                {
!                       $this->db->query("SELECT count(*) FROM fm_agreement 
where num='$num'");
  
                        $this->db->next_record();
***************
*** 208,219 ****
                                $query = ereg_replace('"','',$query);
  
!                               $querymethod = " AND (fm_wo_activities.descr 
LIKE '%$query%' or fm_wo_activities.num LIKE '%$query%')";
                        }
  
!                       $sql = "SELECT 
fm_wo_activities.num,fm_wo_activities.unit,fm_wo_activities.dim_d,fm_wo_activities.ns3420,fm_wo_activities.descr
 as descr, fm_wo_activities.base_descr,activity_id, 
phpgw_addressbook.org_name,fm_wo_branch.descr as branch 
,vendor_id,total_cost,m_cost,w_cost,index_count,fm_wo_activity_price_index.this_index
 "
!                               . " FROM (fm_wo_activities  $this->join 
fm_wo_activity_price_index ON fm_wo_activities.id = 
fm_wo_activity_price_index.activity_id) $this->join phpgw_addressbook ON 
fm_wo_activity_price_index.vendor_id = phpgw_addressbook.id "
!                               . " $this->join fm_wo_branch ON 
fm_wo_activities.branch_id = fm_wo_branch.id "
                                . " WHERE (vendor_id='$cat_id' and 
current_index is not null "
!                               . " OR (fm_wo_activity_price_index.vendor_id = 
'$cat_id') AND (fm_wo_activity_price_index.this_index IS NULL)) $querymethod";
  
                        $this->db2->query($sql,__LINE__,__FILE__);
--- 208,219 ----
                                $query = ereg_replace('"','',$query);
  
!                               $querymethod = " AND (fm_activities.descr LIKE 
'%$query%' or fm_activities.num LIKE '%$query%')";
                        }
  
!                       $sql = "SELECT 
fm_activities.num,fm_activities.unit,fm_activities.dim_d,fm_activities.ns3420,fm_activities.descr
 as descr, fm_activities.base_descr,activity_id, 
phpgw_addressbook.org_name,fm_branch.descr as branch 
,vendor_id,total_cost,m_cost,w_cost,index_count,fm_activity_price_index.this_index
 "
!                               . " FROM (fm_activities  $this->join 
fm_activity_price_index ON fm_activities.id = 
fm_activity_price_index.activity_id) $this->join phpgw_addressbook ON 
fm_activity_price_index.vendor_id = phpgw_addressbook.id "
!                               . " $this->join fm_branch ON 
fm_activities.branch_id = fm_branch.id "
                                . " WHERE (vendor_id='$cat_id' and 
current_index is not null "
!                               . " OR (fm_activity_price_index.vendor_id = 
'$cat_id') AND (fm_activity_price_index.this_index IS NULL)) $querymethod";
  
                        $this->db2->query($sql,__LINE__,__FILE__);
***************
*** 300,304 ****
                        }
  
!                       $sql = "SELECT * FROM  fm_wo_agreement $filtermethod 
$querymethod";
  
                        $this->db2->query($sql,__LINE__,__FILE__);
--- 300,304 ----
                        }
  
!                       $sql = "SELECT * FROM  fm_agreement $filtermethod 
$querymethod";
  
                        $this->db2->query($sql,__LINE__,__FILE__);
***************
*** 332,336 ****
                function select_status_list()
                {
!                       $this->db->query("SELECT id, descr FROM 
fm_wo_agreement_status ORDER BY id ");
  
                        $i = 0;
--- 332,336 ----
                function select_status_list()
                {
!                       $this->db->query("SELECT id, descr FROM 
fm_agreement_status ORDER BY id ");
  
                        $i = 0;
***************
*** 386,394 ****
                                $query = ereg_replace('"','',$query);
  
!                               $querymethod = " AND (fm_wo_activities.descr 
LIKE '%$query%' or fm_wo_activities.num LIKE '%$query%')";
                        }
  
                        $sql = "SELECT 
index_count,this_index,current_index,m_cost,w_cost,total_cost,date"
!                               . " FROM fm_wo_activity_price_index Where 
activity_id= '$activity_id' and vendor_id= '$vendor_id'";
  
  
--- 386,394 ----
                                $query = ereg_replace('"','',$query);
  
!                               $querymethod = " AND (fm_activities.descr LIKE 
'%$query%' or fm_activities.num LIKE '%$query%')";
                        }
  
                        $sql = "SELECT 
index_count,this_index,current_index,m_cost,w_cost,total_cost,date"
!                               . " FROM fm_activity_price_index Where 
activity_id= '$activity_id' and vendor_id= '$vendor_id'";
  
  
***************
*** 466,475 ****
                                $query = ereg_replace('"','',$query);
  
! //                            $querymethod = " AND (fm_wo_activities.descr 
LIKE '%$query%' or fm_wo_activities.num LIKE '%$query%')";
!                               $querymethod = " and (fm_wo_activities.descr 
like '%$query%' or fm_wo_activities.base_descr like '%$query%' or 
fm_wo_activities.num like '%$query%') ";
                        }
  
!                       $sql = "SELECT fm_wo_activities.id AS activity_id, 
fm_wo_activities.num, fm_wo_activities.base_descr, fm_wo_activities.unit, 
fm_wo_activities.dim_d, fm_wo_branch.descr as branch, fm_wo_activities.descr, 
ns3420 "
!                               . " FROM  fm_wo_activities $this->join 
fm_wo_branch on fm_wo_activities.branch_id=fm_wo_branch.id"
                                . " $filtermethod $querymethod ";
  
--- 466,475 ----
                                $query = ereg_replace('"','',$query);
  
! //                            $querymethod = " AND (fm_activities.descr LIKE 
'%$query%' or fm_activities.num LIKE '%$query%')";
!                               $querymethod = " and (fm_activities.descr like 
'%$query%' or fm_activities.base_descr like '%$query%' or fm_activities.num 
like '%$query%') ";
                        }
  
!                       $sql = "SELECT fm_activities.id AS activity_id, 
fm_activities.num, fm_activities.base_descr, fm_activities.unit, 
fm_activities.dim_d, fm_branch.descr as branch, fm_activities.descr, ns3420 "
!                               . " FROM  fm_activities $this->join fm_branch 
on fm_activities.branch_id=fm_branch.id"
                                . " $filtermethod $querymethod ";
  
***************
*** 552,559 ****
                        }
  
!                       $sql = "SELECT fm_wo_activities.id as 
activity_id,fm_wo_activities.num, phpgw_addressbook.org_name,fm_wo_branch.descr 
as branch ,vendor_id "
!                               . " FROM (fm_wo_activities  $this->join 
fm_wo_activity_price_index ON fm_wo_activities.id = 
fm_wo_activity_price_index.activity_id)  $this->join phpgw_addressbook ON 
fm_wo_activity_price_index.vendor_id = phpgw_addressbook.id "
!                               . " $this->join fm_wo_branch on fm_wo_branch.id 
= fm_wo_activities.branch_id "
!                               . " Where 
fm_wo_activity_price_index.activity_id= '$activity_id' $querymethod group by 
fm_wo_activities.num,fm_wo_branch.descr,org_name ,vendor_id ";
  
                        $this->db2->query($sql,__LINE__,__FILE__);
--- 552,559 ----
                        }
  
!                       $sql = "SELECT fm_activities.id as 
activity_id,fm_activities.num, phpgw_addressbook.org_name,fm_branch.descr as 
branch ,vendor_id "
!                               . " FROM (fm_activities  $this->join 
fm_activity_price_index ON fm_activities.id = 
fm_activity_price_index.activity_id)  $this->join phpgw_addressbook ON 
fm_activity_price_index.vendor_id = phpgw_addressbook.id "
!                               . " $this->join fm_branch on fm_branch.id = 
fm_activities.branch_id "
!                               . " Where fm_activity_price_index.activity_id= 
'$activity_id' $querymethod group by fm_activities.num,fm_branch.descr,org_name 
,vendor_id ";
  
                        $this->db2->query($sql,__LINE__,__FILE__);
***************
*** 587,591 ****
                function read_single_activity($id)
                {
!                       $sql = "SELECT * FROM fm_wo_activities where id='$id'";
  
                        $this->db->query($sql,__LINE__,__FILE__);
--- 587,591 ----
                function read_single_activity($id)
                {
!                       $sql = "SELECT * FROM fm_activities where id='$id'";
  
                        $this->db->query($sql,__LINE__,__FILE__);
***************
*** 609,613 ****
                function read_single_agreement($id)
                {
!                       $sql = "SELECT * FROM fm_wo_agreement where id='$id'";
  
                        $this->db->query($sql,__LINE__,__FILE__);
--- 609,613 ----
                function read_single_agreement($id)
                {
!                       $sql = "SELECT * FROM fm_agreement where id='$id'";
  
                        $this->db->query($sql,__LINE__,__FILE__);
***************
*** 629,633 ****
                        $values['base_descr'] = 
$this->db->db_addslashes($values['base_descr']);
  
!                       $this->db->query("INSERT INTO fm_wo_activities (id, 
num,unit,agreement_id,ns3420,dim_d,branch_id,descr,base_descr) "
                                . "VALUES ('" .
                                $values['activity_id']. "','" .
--- 629,633 ----
                        $values['base_descr'] = 
$this->db->db_addslashes($values['base_descr']);
  
!                       $this->db->query("INSERT INTO fm_activities (id, 
num,unit,agreement_id,ns3420,dim_d,branch_id,descr,base_descr) "
                                . "VALUES ('" .
                                $values['activity_id']. "','" .
***************
*** 650,654 ****
                        $values['base_descr'] = 
$this->db->db_addslashes($values['base_descr']);
  
!                       $this->db->query("UPDATE fm_wo_activities set
                                num='" . $values['num'] . "',
                                unit='" . $values['unit'] . "',
--- 650,654 ----
                        $values['base_descr'] = 
$this->db->db_addslashes($values['base_descr']);
  
!                       $this->db->query("UPDATE fm_activities set
                                num='" . $values['num'] . "',
                                unit='" . $values['unit'] . "',
***************
*** 669,673 ****
                        $values['descr'] = 
$this->db->db_addslashes($values['descr']);
  
!                       $this->db->query("INSERT INTO fm_wo_agreement 
(id,num,status,descr) "
                                . "VALUES ('" .
                                $values['agreement_id']. "','" .
--- 669,673 ----
                        $values['descr'] = 
$this->db->db_addslashes($values['descr']);
  
!                       $this->db->query("INSERT INTO fm_agreement 
(id,num,status,descr) "
                                . "VALUES ('" .
                                $values['agreement_id']. "','" .
***************
*** 685,689 ****
                        $values['descr'] = 
$this->db->db_addslashes($values['descr']);
  
!                       $this->db->query("UPDATE fm_wo_agreement set
                                num='" . $values['num'] . "',
                                status='"       . $values['status'] . "',
--- 685,689 ----
                        $values['descr'] = 
$this->db->db_addslashes($values['descr']);
  
!                       $this->db->query("UPDATE fm_agreement set
                                num='" . $values['num'] . "',
                                status='"       . $values['status'] . "',
***************
*** 697,707 ****
                function delete_activity_vendor($activity_id,$vendor_id)
                {
!                       $this->db->query("DELETE FROM 
fm_wo_activity_price_index WHERE activity_id='$activity_id' and 
vendor_id='$vendor_id'",__LINE__,__FILE__);
                }
  
                function delete_activity($activity_id)
                {
!                       $this->db->query("DELETE FROM fm_wo_activities WHERE 
id='$activity_id'",__LINE__,__FILE__);
!                       $this->db->query("DELETE FROM 
fm_wo_activity_price_index WHERE activity_id='$activity_id'",__LINE__,__FILE__);
                }
  
--- 697,707 ----
                function delete_activity_vendor($activity_id,$vendor_id)
                {
!                       $this->db->query("DELETE FROM fm_activity_price_index 
WHERE activity_id='$activity_id' and vendor_id='$vendor_id'",__LINE__,__FILE__);
                }
  
                function delete_activity($activity_id)
                {
!                       $this->db->query("DELETE FROM fm_activities WHERE 
id='$activity_id'",__LINE__,__FILE__);
!                       $this->db->query("DELETE FROM fm_activity_price_index 
WHERE activity_id='$activity_id'",__LINE__,__FILE__);
                }
  
***************
*** 710,722 ****
                        if ($index_count==1)
                        {
!                               $this->db->query("update 
fm_wo_activity_price_index set index_count = '1', current_index = '0', 
this_index=Null, m_cost=Null,w_cost=Null,total_cost=Null,date=Null  where 
activity_id='$activity_id' and vendor_id= '$vendor_id' and index_count= 
'1'",__LINE__,__FILE__);
                        }
                        else
                        {
!                               $this->db->query("delete from 
fm_wo_activity_price_index where activity_id='$activity_id' and vendor_id= 
'$vendor_id' and index_count= '$index_count'",__LINE__,__FILE__);
  
                                $new_index_count= $index_count -1;
  
!                               $this->db->query("update 
fm_wo_activity_price_index set current_index = '1' where 
activity_id='$activity_id' and vendor_id= '$vendor_id' and index_count= 
'$new_index_count'",__LINE__,__FILE__);
                        }
  
--- 710,722 ----
                        if ($index_count==1)
                        {
!                               $this->db->query("update 
fm_activity_price_index set index_count = '1', current_index = '0', 
this_index=Null, m_cost=Null,w_cost=Null,total_cost=Null,date=Null  where 
activity_id='$activity_id' and vendor_id= '$vendor_id' and index_count= 
'1'",__LINE__,__FILE__);
                        }
                        else
                        {
!                               $this->db->query("delete from 
fm_activity_price_index where activity_id='$activity_id' and vendor_id= 
'$vendor_id' and index_count= '$index_count'",__LINE__,__FILE__);
  
                                $new_index_count= $index_count -1;
  
!                               $this->db->query("update 
fm_activity_price_index set current_index = '1' where 
activity_id='$activity_id' and vendor_id= '$vendor_id' and index_count= 
'$new_index_count'",__LINE__,__FILE__);
                        }
  
***************
*** 725,729 ****
                function delete_agreement($agreement_id)
                {
!                       $this->db->query("DELETE FROM fm_wo_agreement WHERE 
id='$agreement_id'",__LINE__,__FILE__);
  //how to handle the activities and vendors ...?
                }
--- 725,729 ----
                function delete_agreement($agreement_id)
                {
!                       $this->db->query("DELETE FROM fm_agreement WHERE 
id='$agreement_id'",__LINE__,__FILE__);
  //how to handle the activities and vendors ...?
                }
***************
*** 732,736 ****
                function add_activity_vendor($values)
                {
!                       $this->db->query("SELECT count(*) FROM 
fm_wo_activity_price_index where activity_id='" . $values['activity_id'] . "' 
and vendor_id='" . $values['vendor_id'] . "'",__LINE__,__FILE__);
  
                        $this->db->next_record();
--- 732,736 ----
                function add_activity_vendor($values)
                {
!                       $this->db->query("SELECT count(*) FROM 
fm_activity_price_index where    activity_id='" . $values['activity_id'] . "' 
and vendor_id='" . $values['vendor_id'] . "'",__LINE__,__FILE__);
  
                        $this->db->next_record();
***************
*** 742,746 ****
                        else
                        {
!                               $this->db->query("insert into 
fm_wo_activity_price_index (activity_id, vendor_id, 
index_count,current_index,m_cost,w_cost,total_cost) "
                                        . " values ('" .
                                        $values['activity_id']. "','" .
--- 742,746 ----
                        else
                        {
!                               $this->db->query("insert into 
fm_activity_price_index (activity_id, vendor_id, 
index_count,current_index,m_cost,w_cost,total_cost) "
                                        . " values ('" .
                                        $values['activity_id']. "','" .

Index: class.soproject.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.soproject.inc.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** class.soproject.inc.php     13 May 2003 11:03:06 -0000      1.10
--- class.soproject.inc.php     15 May 2003 09:08:02 -0000      1.11
***************
*** 35,39 ****
                {
  
!                       $this->db->query("SELECT id, descr FROM 
fm_wo_workorder_category  ORDER BY descr ");
  
                        $i = 0;
--- 35,39 ----
                {
  
!                       $this->db->query("SELECT id, descr FROM 
fm_workorder_category  ORDER BY descr ");
  
                        $i = 0;
***************
*** 49,53 ****
                function read_single_project_category($id='')
                {
!                       $this->db->query("SELECT descr FROM 
fm_wo_workorder_category where id='$id' ");
                        $this->db->next_record();
                        return $this->db->f('descr');
--- 49,53 ----
                function read_single_project_category($id='')
                {
!                       $this->db->query("SELECT descr FROM 
fm_workorder_category where id='$id' ");
                        $this->db->next_record();
                        return $this->db->f('descr');
***************
*** 56,60 ****
                function select_status_list()
                {
!                       $this->db->query("SELECT id, descr FROM 
fm_wo_wrkorders_status ORDER BY id ");
  
                        $i = 0;
--- 56,60 ----
                function select_status_list()
                {
!                       $this->db->query("SELECT id, descr FROM 
fm_workorder_status ORDER BY id ");
  
                        $i = 0;
***************
*** 70,74 ****
                function select_branch_list()
                {
!                       $this->db->query("SELECT id, descr FROM fm_wo_branch 
ORDER BY id ");
  
                        $i = 0;
--- 70,74 ----
                function select_branch_list()
                {
!                       $this->db->query("SELECT id, descr FROM fm_branch ORDER 
BY id ");
  
                        $i = 0;
***************
*** 84,88 ****
                function select_key_location_list()
                {
!                       $this->db->query("SELECT id, descr FROM fm_wo_key_loc 
ORDER BY descr ");
  
                        $i = 0;
--- 84,88 ----
                function select_key_location_list()
                {
!                       $this->db->query("SELECT id, descr FROM fm_key_loc 
ORDER BY descr ");
  
                        $i = 0;
***************
*** 122,129 ****
                        else
                        {
!                               $ordermethod = ' order by fm_wo_project.id ASC';
                        }
  
!                       $filtermethod = ' ( fm_wo_project.owner=' . 
$this->account;
                        if (is_array($this->grants))
                        {
--- 122,129 ----
                        else
                        {
!                               $ordermethod = ' order by fm_project.id ASC';
                        }
  
!                       $filtermethod = ' ( fm_project.owner=' . $this->account;
                        if (is_array($this->grants))
                        {
***************
*** 134,138 ****
                                }
                                reset($public_user_list);
!                               $filtermethod .= " OR 
(fm_wo_project.access='public' OR fm_wo_project.owner IN(" . 
implode(',',$public_user_list) . ")))";
                        }
                        else
--- 134,138 ----
                                }
                                reset($public_user_list);
!                               $filtermethod .= " OR 
(fm_project.access='public' OR fm_project.owner IN(" . 
implode(',',$public_user_list) . ")))";
                        }
                        else
***************
*** 143,157 ****
                        if ($cat_id > 0)
                        {
!                               $filtermethod .= " AND 
fm_wo_project.category='$cat_id' ";
                        }
  
                        if ($status_id)
                        {
!                               $filtermethod .= " AND 
fm_wo_project.status='$status_id' ";
                        }
  
                        if ($filter)
                        {
!                               $filtermethod .= " AND 
fm_wo_project.coordinator='$filter' ";
                        }
  
--- 143,157 ----
                        if ($cat_id > 0)
                        {
!                               $filtermethod .= " AND 
fm_project.category='$cat_id' ";
                        }
  
                        if ($status_id)
                        {
!                               $filtermethod .= " AND 
fm_project.status='$status_id' ";
                        }
  
                        if ($filter)
                        {
!                               $filtermethod .= " AND 
fm_project.coordinator='$filter' ";
                        }
  
***************
*** 161,168 ****
                                $query = ereg_replace('"','',$query);
  
!                               $querymethod = " AND fm_wo_project.name LIKE 
'%$query%' or fm_wo_project.descr LIKE '%$query%' or fm_wo_project.address LIKE 
'%$query%' or fm_wo_project.location_code LIKE '%$query%'";
                        }
  
!                       $sql = "SELECT * FROM fm_wo_project WHERE  
$filtermethod $querymethod";
  
                        $this->db2->query($sql,__LINE__,__FILE__);
--- 161,168 ----
                                $query = ereg_replace('"','',$query);
  
!                               $querymethod = " AND fm_project.name LIKE 
'%$query%' or fm_project.descr LIKE '%$query%' or fm_project.address LIKE 
'%$query%' or fm_project.location_code LIKE '%$query%'";
                        }
  
!                       $sql = "SELECT * FROM fm_project WHERE  $filtermethod 
$querymethod";
  
                        $this->db2->query($sql,__LINE__,__FILE__);
***************
*** 172,176 ****
                        while ($this->db->next_record())
                        {
!                               $ngrants = 
(int)$this->grants[$this->db->f('fm_wo_project.owner')];
                                $project_list[] = array
                                (
--- 172,176 ----
                        while ($this->db->next_record())
                        {
!                               $ngrants = 
(int)$this->grants[$this->db->f('fm_project.owner')];
                                $project_list[] = array
                                (
***************
*** 194,198 ****
                function read_single($project_id)
                {
!                       $sql = "SELECT * from fm_wo_project where 
id='$project_id'";
  
                        $this->db->query($sql,__LINE__,__FILE__);
--- 194,198 ----
                function read_single($project_id)
                {
!                       $sql = "SELECT * from fm_project where 
id='$project_id'";
  
                        $this->db->query($sql,__LINE__,__FILE__);
***************
*** 252,256 ****
                function project_workorder_data($project_id = '')
                {
!                       $this->db->query("select budget, id as workorder_id, 
vendor_id from fm_wo_wrkorders where project_id='$project_id'");
                        while ($this->db->next_record())
                        {
--- 252,256 ----
                function project_workorder_data($project_id = '')
                {
!                       $this->db->query("select budget, id as workorder_id, 
vendor_id from fm_workorder where project_id='$project_id'");
                        while ($this->db->next_record())
                        {
***************
*** 267,271 ****
                {
  
!                       $this->db2->query("SELECT branch_id from 
fm_wo_projectbranch WHERE project_id='$project_id' ",__LINE__,__FILE__);
                        while ($this->db2->next_record())
                        {
--- 267,271 ----
                {
  
!                       $this->db2->query("SELECT branch_id from 
fm_projectbranch WHERE project_id='$project_id' ",__LINE__,__FILE__);
                        while ($this->db2->next_record())
                        {
***************
*** 346,350 ****
                        $project['title'] = 
$this->db->db_addslashes($project['title']);
  //_debug_array($project);
!                       $this->db->query("INSERT INTO fm_wo_project 
(id,name,equipment_id,access,category,entry_date,start_date,end_date,coordinator,status,"
                                . 
"descr,title,budget,location_code,floor,address,key_deliver,key_fetch,other_branch,key_responsible,tenant_id,charge_tenant,owner)
 "
                                . "VALUES ('"
--- 346,350 ----
                        $project['title'] = 
$this->db->db_addslashes($project['title']);
  //_debug_array($project);
!                       $this->db->query("INSERT INTO fm_project 
(id,name,equipment_id,access,category,entry_date,start_date,end_date,coordinator,status,"
                                . 
"descr,title,budget,location_code,floor,address,key_deliver,key_fetch,other_branch,key_responsible,tenant_id,charge_tenant,owner)
 "
                                . "VALUES ('"
***************
*** 389,393 ****
                                while($branch=each($project['branch']))
                                {
!                                       $this->db->query("insert into 
fm_wo_projectbranch (project_id,branch_id) values ('" . $project['project_id']. 
"','$branch[1]')",__LINE__,__FILE__);
                                }
                        }
--- 389,393 ----
                                while($branch=each($project['branch']))
                                {
!                                       $this->db->query("insert into 
fm_projectbranch (project_id,branch_id) values ('" . $project['project_id']. 
"','$branch[1]')",__LINE__,__FILE__);
                                }
                        }
***************
*** 446,450 ****
                function edit($project)
                {
!                       $this->db->query("SELECT status,category,coordinator 
FROM fm_wo_project where id='" .$project['project_id']."'",__LINE__,__FILE__);
  
                        $this->db->next_record();
--- 446,450 ----
                function edit($project)
                {
!                       $this->db->query("SELECT status,category,coordinator 
FROM fm_project where id='" .$project['project_id']."'",__LINE__,__FILE__);
  
                        $this->db->next_record();
***************
*** 480,484 ****
  //_debug_array($project);
  
!                       $this->db->query("UPDATE fm_wo_project set
                                name                    ='" . $project['name'] 
. "',
                                status                  ='" . 
$project['status'] . "',
--- 480,484 ----
  //_debug_array($project);
  
!                       $this->db->query("UPDATE fm_project set
                                name                    ='" . $project['name'] 
. "',
                                status                  ='" . 
$project['status'] . "',
***************
*** 512,516 ****
                        }
        // -----------------which branch is represented
!                       $this->db->query("delete from fm_wo_projectbranch where 
project_id='" . $project['project_id'] ."'",__LINE__,__FILE__);
  
                        if (count($project['branch']) != 0)
--- 512,516 ----
                        }
        // -----------------which branch is represented
!                       $this->db->query("delete from fm_projectbranch where 
project_id='" . $project['project_id'] ."'",__LINE__,__FILE__);
  
                        if (count($project['branch']) != 0)
***************
*** 518,522 ****
                                while($branch=each($project['branch']))
                                {
!                                       $this->db->query("insert into 
fm_wo_projectbranch (project_id,branch_id) values ('" . $project['project_id']. 
"','$branch[1]')",__LINE__,__FILE__);
                                }
                        }
--- 518,522 ----
                                while($branch=each($project['branch']))
                                {
!                                       $this->db->query("insert into 
fm_projectbranch (project_id,branch_id) values ('" . $project['project_id']. 
"','$branch[1]')",__LINE__,__FILE__);
                                }
                        }
***************
*** 530,536 ****
                function delete($project_id )
                {
!                       $this->db->query("DELETE FROM fm_wo_project WHERE id='" 
. $project_id . "'",__LINE__,__FILE__);
!                       $this->db->query("DELETE FROM fm_wo_project_history  
WHERE  history_record_id='" . $project_id   . "'",__LINE__,__FILE__);
!                       $this->db->query("DELETE FROM fm_wo_projectbranch  
WHERE  project_id='" . $project_id   . "'",__LINE__,__FILE__);
                        $this->db->query("DELETE FROM fm_project_origin WHERE 
project_id='" . $project_id . "'",__LINE__,__FILE__);
  
--- 530,536 ----
                function delete($project_id )
                {
!                       $this->db->query("DELETE FROM fm_project WHERE id='" . 
$project_id . "'",__LINE__,__FILE__);
!                       $this->db->query("DELETE FROM fm_project_history  WHERE 
 history_record_id='" . $project_id   . "'",__LINE__,__FILE__);
!                       $this->db->query("DELETE FROM fm_projectbranch  WHERE  
project_id='" . $project_id   . "'",__LINE__,__FILE__);
                        $this->db->query("DELETE FROM fm_project_origin WHERE 
project_id='" . $project_id . "'",__LINE__,__FILE__);
  

Index: class.sorequest.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.sorequest.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** class.sorequest.inc.php     13 May 2003 11:03:06 -0000      1.5
--- class.sorequest.inc.php     15 May 2003 09:08:02 -0000      1.6
***************
*** 35,39 ****
                {
  
!                       $this->db->query("SELECT id, descr FROM 
fm_wo_workorder_category  ORDER BY descr ");
  
                        $i = 0;
--- 35,39 ----
                {
  
!                       $this->db->query("SELECT id, descr FROM 
fm_workorder_category  ORDER BY descr ");
  
                        $i = 0;
***************
*** 49,53 ****
                function read_priority_key()
                {
!                       $this->db->query("SELECT * FROM 
fm_wo_request_priority_key",__LINE__,__FILE__);
  
                        $this->db->next_record();
--- 49,53 ----
                function read_priority_key()
                {
!                       $this->db->query("SELECT * FROM 
fm_request_priority_key",__LINE__,__FILE__);
  
                        $this->db->next_record();
***************
*** 67,71 ****
                {
  
!                       $this->db->query("UPDATE fm_wo_request_priority_key set
                                safety  ='" . $values['safety'] . "',
                                aesthetics      ='" . $values['aesthetics'] . 
"',
--- 67,71 ----
                {
  
!                       $this->db->query("UPDATE fm_request_priority_key set
                                safety  ='" . $values['safety'] . "',
                                aesthetics      ='" . $values['aesthetics'] . 
"',
***************
*** 106,110 ****
                        }
  
!                       $this->db->query("update fm_wo_request set 
score=($safety* (d_safety*p_safety*(c_safety+1)))"
                        . "+ ($aesthetics* 
(d_aesthetics*p_aesthetics*(c_aesthetics+1)))"
                        . "+ ($indoor_climate* 
(d_indoor_climate*p_indoor_climate*(c_indoor_climate+1)))"
--- 106,110 ----
                        }
  
!                       $this->db->query("update fm_request set score=($safety* 
(d_safety*p_safety*(c_safety+1)))"
                        . "+ ($aesthetics* 
(d_aesthetics*p_aesthetics*(c_aesthetics+1)))"
                        . "+ ($indoor_climate* 
(d_indoor_climate*p_indoor_climate*(c_indoor_climate+1)))"
***************
*** 119,123 ****
                function read_single_request_category($id='')
                {
!                       $this->db->query("SELECT descr FROM 
fm_wo_workorder_category where id='$id' ");
                        $this->db->next_record();
                        return $this->db->f('descr');
--- 119,123 ----
                function read_single_request_category($id='')
                {
!                       $this->db->query("SELECT descr FROM 
fm_workorder_category where id='$id' ");
                        $this->db->next_record();
                        return $this->db->f('descr');
***************
*** 126,130 ****
                function select_status_list()
                {
!                       $this->db->query("SELECT id, descr FROM 
fm_wo_request_status ORDER BY id ");
  
                        $i = 0;
--- 126,130 ----
                function select_status_list()
                {
!                       $this->db->query("SELECT id, descr FROM 
fm_request_status ORDER BY id ");
  
                        $i = 0;
***************
*** 140,144 ****
                function select_branch_list()
                {
!                       $this->db->query("SELECT id, descr FROM fm_wo_branch 
ORDER BY id ");
  
                        $i = 0;
--- 140,144 ----
                function select_branch_list()
                {
!                       $this->db->query("SELECT id, descr FROM fm_branch ORDER 
BY id ");
  
                        $i = 0;
***************
*** 154,158 ****
                function select_key_location_list()
                {
!                       $this->db->query("SELECT id, descr FROM fm_wo_key_loc 
ORDER BY descr ");
  
                        $i = 0;
--- 154,158 ----
                function select_key_location_list()
                {
!                       $this->db->query("SELECT id, descr FROM fm_key_loc 
ORDER BY descr ");
  
                        $i = 0;
***************
*** 192,199 ****
                        else
                        {
!                               $ordermethod = ' order by fm_wo_request.id ASC';
                        }
  
!                       $filtermethod = ' ( fm_wo_request.owner=' . 
$this->account;
                        if (is_array($this->grants))
                        {
--- 192,199 ----
                        else
                        {
!                               $ordermethod = ' order by fm_request.id ASC';
                        }
  
!                       $filtermethod = ' ( fm_request.owner=' . $this->account;
                        if (is_array($this->grants))
                        {
***************
*** 204,208 ****
                                }
                                reset($public_user_list);
!                               $filtermethod .= " OR 
(fm_wo_request.access='public' OR fm_wo_request.owner IN(" . 
implode(',',$public_user_list) . ")))";
                        }
                        else
--- 204,208 ----
                                }
                                reset($public_user_list);
!                               $filtermethod .= " OR 
(fm_request.access='public' OR fm_request.owner IN(" . 
implode(',',$public_user_list) . ")))";
                        }
                        else
***************
*** 213,227 ****
                        if ($cat_id > 0)
                        {
!                               $filtermethod .= " AND 
fm_wo_request.category='$cat_id' ";
                        }
  
                        if ($status_id)
                        {
!                               $filtermethod .= " AND 
fm_wo_request.status='$status_id' ";
                        }
  
                        if ($filter)
                        {
!                               $filtermethod .= " AND 
fm_wo_request.coordinator='$filter' ";
                        }
  
--- 213,227 ----
                        if ($cat_id > 0)
                        {
!                               $filtermethod .= " AND 
fm_request.category='$cat_id' ";
                        }
  
                        if ($status_id)
                        {
!                               $filtermethod .= " AND 
fm_request.status='$status_id' ";
                        }
  
                        if ($filter)
                        {
!                               $filtermethod .= " AND 
fm_request.coordinator='$filter' ";
                        }
  
***************
*** 231,238 ****
                                $query = ereg_replace('"','',$query);
  
!                               $querymethod = " AND fm_wo_request.title LIKE 
'%$query%' or fm_wo_request.address LIKE '%$query%' or 
fm_wo_request.location_code LIKE '%$query%'";
                        }
  
!                       $sql = "SELECT * FROM fm_wo_request WHERE  
$filtermethod $querymethod";
  
                        $this->db2->query($sql,__LINE__,__FILE__);
--- 231,238 ----
                                $query = ereg_replace('"','',$query);
  
!                               $querymethod = " AND fm_request.title LIKE 
'%$query%' or fm_request.address LIKE '%$query%' or fm_request.location_code 
LIKE '%$query%'";
                        }
  
!                       $sql = "SELECT * FROM fm_request WHERE  $filtermethod 
$querymethod";
  
                        $this->db2->query($sql,__LINE__,__FILE__);
***************
*** 242,246 ****
                        while ($this->db->next_record())
                        {
!                               $ngrants = 
(int)$this->grants[$this->db->f('fm_wo_request.owner')];
                                $request_list[] = array
                                (
--- 242,246 ----
                        while ($this->db->next_record())
                        {
!                               $ngrants = 
(int)$this->grants[$this->db->f('fm_request.owner')];
                                $request_list[] = array
                                (
***************
*** 264,268 ****
                function read_single($request_id)
                {
!                       $sql = "SELECT * from fm_wo_request where 
id='$request_id'";
  
                        $this->db->query($sql,__LINE__,__FILE__);
--- 264,268 ----
                function read_single($request_id)
                {
!                       $sql = "SELECT * from fm_request where 
id='$request_id'";
  
                        $this->db->query($sql,__LINE__,__FILE__);
***************
*** 330,334 ****
                function request_workorder_data($request_id = '')
                {
!                       $this->db->query("select budget, id as workorder_id, 
vendor_id from fm_wo_wrkorders where request_id='$request_id'");
                        while ($this->db->next_record())
                        {
--- 330,334 ----
                function request_workorder_data($request_id = '')
                {
!                       $this->db->query("select budget, id as workorder_id, 
vendor_id from fm_workorder where request_id='$request_id'");
                        while ($this->db->next_record())
                        {
***************
*** 345,349 ****
                {
  
!                       $this->db2->query("SELECT branch_id from 
fm_wo_requestbranch WHERE request_id='$request_id' ",__LINE__,__FILE__);
                        while ($this->db2->next_record())
                        {
--- 345,349 ----
                {
  
!                       $this->db2->query("SELECT branch_id from 
fm_requestbranch WHERE request_id='$request_id' ",__LINE__,__FILE__);
                        while ($this->db2->next_record())
                        {
***************
*** 403,407 ****
  //                    $request['title'] = 
$this->db->db_addslashes($request['title']);
  //_debug_array($request);
!                       $this->db->query("insert into fm_wo_request 
(id,title,owner,category,descr,location_code,equipment_id,property_id,floor,"
                                . 
"address,tenant_id,entry_date,budget,status,branch_id,coordinator,"
                                . 
"d_safety,d_aesthetics,d_indoor_climate,d_consequential_damage,d_user_gratification,d_residential_environment,"
--- 403,407 ----
  //                    $request['title'] = 
$this->db->db_addslashes($request['title']);
  //_debug_array($request);
!                       $this->db->query("insert into fm_request 
(id,title,owner,category,descr,location_code,equipment_id,property_id,floor,"
                                . 
"address,tenant_id,entry_date,budget,status,branch_id,coordinator,"
                                . 
"d_safety,d_aesthetics,d_indoor_climate,d_consequential_damage,d_user_gratification,d_residential_environment,"
***************
*** 474,478 ****
                function edit($request)
                {
!                       $this->db->query("SELECT status,category,coordinator 
FROM fm_wo_request where id='" .$request['request_id']."'",__LINE__,__FILE__);
  
                        $this->db->next_record();
--- 474,478 ----
                function edit($request)
                {
!                       $this->db->query("SELECT status,category,coordinator 
FROM fm_request where id='" .$request['request_id']."'",__LINE__,__FILE__);
  
                        $this->db->next_record();
***************
*** 508,512 ****
  //_debug_array($request);
  
!                       $this->db->query("UPDATE fm_wo_request set
                                status                  ='" . 
$request['status'] . "',
                                category                ='" . 
$request['cat_id'] . "',
--- 508,512 ----
  //_debug_array($request);
  
!                       $this->db->query("UPDATE fm_request set
                                status                  ='" . 
$request['status'] . "',
                                category                ='" . 
$request['cat_id'] . "',
***************
*** 564,569 ****
                function delete($request_id )
                {
!                       $this->db->query("DELETE FROM fm_wo_request WHERE id='" 
. $request_id . "'",__LINE__,__FILE__);
!                       $this->db->query("DELETE FROM fm_wo_request_history  
WHERE  history_record_id='" . $request_id   . "'",__LINE__,__FILE__);
                        $this->db->query("DELETE FROM fm_request_origin WHERE 
request_id='" . $request_id . "'",__LINE__,__FILE__);
                }
--- 564,569 ----
                function delete($request_id )
                {
!                       $this->db->query("DELETE FROM fm_request WHERE id='" . 
$request_id . "'",__LINE__,__FILE__);
!                       $this->db->query("DELETE FROM fm_request_history  WHERE 
 history_record_id='" . $request_id   . "'",__LINE__,__FILE__);
                        $this->db->query("DELETE FROM fm_request_origin WHERE 
request_id='" . $request_id . "'",__LINE__,__FILE__);
                }

Index: class.sostandard_2.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.sostandard_2.inc.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** class.sostandard_2.inc.php  12 May 2003 21:45:32 -0000      1.15
--- class.sostandard_2.inc.php  15 May 2003 09:08:02 -0000      1.16
***************
*** 102,109 ****
                        {
                                case 'workorder_status':
!                                       $table='fm_wo_wrkorders_status';
                                        break;
                                case 'request_status':
!                                       $table='fm_wo_request_status';
                                        break;
                                case 'equipment_status':
--- 102,109 ----
                        {
                                case 'workorder_status':
!                                       $table='fm_workorder_status';
                                        break;
                                case 'request_status':
!                                       $table='fm_request_status';
                                        break;
                                case 'equipment_status':
***************
*** 111,115 ****
                                        break;
                                case 'agreement_status':
!                                       $table='fm_wo_agreement_status';
                                        break;
                                case 'building_part':
--- 111,115 ----
                                        break;
                                case 'agreement_status':
!                                       $table='fm_agreement_status';
                                        break;
                                case 'building_part':

Index: class.sostandard_3.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.sostandard_3.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** class.sostandard_3.inc.php  27 Jan 2003 19:19:55 -0000      1.2
--- class.sostandard_3.inc.php  15 May 2003 09:08:02 -0000      1.3
***************
*** 95,102 ****
                        {
                                case 'branch':
!                                       $table='fm_wo_branch';
                                        break;
                                case 'key_location':
!                                       $table='fm_wo_key_loc';
                                        break;
                        }
--- 95,102 ----
                        {
                                case 'branch':
!                                       $table='fm_branch';
                                        break;
                                case 'key_location':
!                                       $table='fm_key_loc';
                                        break;
                        }

Index: class.sotemplate.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.sotemplate.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** class.sotemplate.inc.php    3 May 2003 06:02:17 -0000       1.2
--- class.sotemplate.inc.php    15 May 2003 09:08:02 -0000      1.3
***************
*** 60,64 ****
                        }
  
!                       $filtermethod = ' ( fm_wo_template.owner=' . 
$this->account;
                        if (is_array($this->grants))
                        {
--- 60,64 ----
                        }
  
!                       $filtermethod = ' ( fm_template.owner=' . 
$this->account;
                        if (is_array($this->grants))
                        {
***************
*** 69,73 ****
                                }
                                reset($public_user_list);
!                               $filtermethod .= " OR ( fm_wo_template.owner 
IN(" . implode(',',$public_user_list) . ")))";
                        }
                        else
--- 69,73 ----
                                }
                                reset($public_user_list);
!                               $filtermethod .= " OR ( fm_template.owner IN(" 
. implode(',',$public_user_list) . ")))";
                        }
                        else
***************
*** 84,88 ****
                        if ($filter)
                        {
!                               $filtermethod .= " AND 
fm_wo_template.owner='$filter' ";
                        }
  
--- 84,88 ----
                        if ($filter)
                        {
!                               $filtermethod .= " AND 
fm_template.owner='$filter' ";
                        }
  
***************
*** 93,101 ****
                                $query = ereg_replace('"','',$query);
  
!                               $querymethod = " AND (fm_wo_template.descr LIKE 
'%$query%')";
                        }
  
!                       $sql = "SELECT 
fm_wo_template.id,fm_wo_template.descr,fm_wo_template.name,fm_wo_template.owner,fm_wo_template.entry_date,"
!                        . " fm_wo_chapter.descr as chapter  FROM 
fm_wo_template $this->join fm_wo_chapter  on 
fm_wo_template.chapter_id=fm_wo_chapter.id"
                         . " WHERE $filtermethod $querymethod";
  
--- 93,101 ----
                                $query = ereg_replace('"','',$query);
  
!                               $querymethod = " AND (fm_template.descr LIKE 
'%$query%')";
                        }
  
!                       $sql = "SELECT 
fm_template.id,fm_template.descr,fm_template.name,fm_template.owner,fm_template.entry_date,"
!                        . " fm_chapter.descr as chapter  FROM fm_template 
$this->join fm_chapter  on fm_template.chapter_id=fm_chapter.id"
                         . " WHERE $filtermethod $querymethod";
  
***************
*** 114,118 ****
                        while ($this->db->next_record())
                        {
!                               $ngrants = 
(int)$this->grants[$this->db->f('fm_wo_wrkorders.owner')];
                                $template_list[] = array
                                (
--- 114,118 ----
                        while ($this->db->next_record())
                        {
!                               $ngrants = 
(int)$this->grants[$this->db->f('fm_workorder.owner')];
                                $template_list[] = array
                                (
***************
*** 167,174 ****
                                $query = ereg_replace('"','',$query);
  
!                               $querymethod = " AND (hours_descr LIKE 
'%$query%' or fm_wo_template_hours.remark LIKE '%$query%' or ns3420_id LIKE 
'%$query%')";
                        }
  
!                       $sql = "SELECT fm_wo_template_hours.*, chapter_id from 
fm_wo_template_hours  $this->join fm_wo_template on 
fm_wo_template.id=fm_wo_template_hours.template_id $filtermethod $querymethod";
  
                        $this->db2->query($sql,__LINE__,__FILE__);
--- 167,174 ----
                                $query = ereg_replace('"','',$query);
  
!                               $querymethod = " AND (hours_descr LIKE 
'%$query%' or fm_template_hours.remark LIKE '%$query%' or ns3420_id LIKE 
'%$query%')";
                        }
  
!                       $sql = "SELECT fm_template_hours.*, chapter_id from 
fm_template_hours  $this->join fm_template on 
fm_template.id=fm_template_hours.template_id $filtermethod $querymethod";
  
                        $this->db2->query($sql,__LINE__,__FILE__);
***************
*** 186,190 ****
                        while ($this->db->next_record())
                        {
!                               $ngrants = 
(int)$this->grants[$this->db->f('fm_wo_wrkorders.owner')];
                                $hour_list[] = array
                                (
--- 186,190 ----
                        while ($this->db->next_record())
                        {
!                               $ngrants = 
(int)$this->grants[$this->db->f('fm_workorder.owner')];
                                $hour_list[] = array
                                (
***************
*** 213,217 ****
                function read_single_template($template_id)
                {
!                       $sql = "SELECT * FROM fm_wo_template where 
id='$template_id'";
  
                        $this->db->query($sql,__LINE__,__FILE__);
--- 213,217 ----
                function read_single_template($template_id)
                {
!                       $sql = "SELECT * FROM fm_template where 
id='$template_id'";
  
                        $this->db->query($sql,__LINE__,__FILE__);
***************
*** 229,233 ****
                function read_single_hour($hour_id)
                {
!                       $sql = "SELECT * from fm_wo_template_hours where 
id='$hour_id'";
  
                        $this->db->query($sql,__LINE__,__FILE__);
--- 229,233 ----
                function read_single_hour($hour_id)
                {
!                       $sql = "SELECT * from fm_template_hours where 
id='$hour_id'";
  
                        $this->db->query($sql,__LINE__,__FILE__);
***************
*** 258,262 ****
                {
  
!                       $this->db->query("SELECT  max(record) as record FROM 
fm_wo_template_hours where template_id='$template_id'",__LINE__,__FILE__);
                        $this->db->next_record();
                        $record = $this->db->f('record')+1;
--- 258,262 ----
                {
  
!                       $this->db->query("SELECT  max(record) as record FROM 
fm_template_hours where template_id='$template_id'",__LINE__,__FILE__);
                        $this->db->next_record();
                        $record = $this->db->f('record')+1;
***************
*** 270,279 ****
                        $hour['record'] = $this->next_record($template_id);
  
!                       $this->db->query("UPDATE fm_wo_template set
                                chapter_id      ='" . $hour['chapter_id'] . "' 
WHERE id= '$template_id'",__LINE__,__FILE__);
  
                        if($hour['grouping_id'])
                        {
!                               $this->db->query("SELECT grouping_descr , 
max(record) as record FROM fm_wo_template_hours where grouping_id='" 
.$hour['grouping_id'] . "' and template_id= '$template_id' GROUP by 
grouping_descr",__LINE__,__FILE__);
                                $this->db->next_record();
                                $hour['grouping_descr'] = 
$this->db->f('grouping_descr');
--- 270,279 ----
                        $hour['record'] = $this->next_record($template_id);
  
!                       $this->db->query("UPDATE fm_template set
                                chapter_id      ='" . $hour['chapter_id'] . "' 
WHERE id= '$template_id'",__LINE__,__FILE__);
  
                        if($hour['grouping_id'])
                        {
!                               $this->db->query("SELECT grouping_descr , 
max(record) as record FROM fm_template_hours where grouping_id='" 
.$hour['grouping_id'] . "' and template_id= '$template_id' GROUP by 
grouping_descr",__LINE__,__FILE__);
                                $this->db->next_record();
                                $hour['grouping_descr'] = 
$this->db->f('grouping_descr');
***************
*** 282,286 ****
                        if($hour['new_grouping'])
                        {
!                               $this->db->query("SELECT grouping_id FROM 
fm_wo_template_hours where grouping_descr ='" .$hour['new_grouping'] . "' and 
template_id= '$template_id'",__LINE__,__FILE__);
                                $this->db->next_record();
                                if ( $this->db->f('grouping_id'))
--- 282,286 ----
                        if($hour['new_grouping'])
                        {
!                               $this->db->query("SELECT grouping_id FROM 
fm_template_hours where grouping_descr ='" .$hour['new_grouping'] . "' and 
template_id= '$template_id'",__LINE__,__FILE__);
                                $this->db->next_record();
                                if ( $this->db->f('grouping_id'))
***************
*** 290,294 ****
                                else
                                {
!                                       $this->db->query("SELECT 
max(grouping_id) as grouping_id FROM fm_wo_template_hours where template_id= 
'$template_id'",__LINE__,__FILE__);
                                        $this->db->next_record();
                                        $hour['grouping_id']    = 
$this->db->f('grouping_id')+1;
--- 290,294 ----
                                else
                                {
!                                       $this->db->query("SELECT 
max(grouping_id) as grouping_id FROM fm_template_hours where template_id= 
'$template_id'",__LINE__,__FILE__);
                                        $this->db->next_record();
                                        $hour['grouping_id']    = 
$this->db->f('grouping_id')+1;
***************
*** 298,302 ****
                        }
  
!                       $this->db->query("insert into fm_wo_template_hours 
(owner,hours_descr,unit,cost,quantity,billperae,ns3420_id,dim_d,"
                                . " 
grouping_id,grouping_descr,record,building_part,tolerance,remark,entry_date,template_id)
 "
                                . " values ('" .
--- 298,302 ----
                        }
  
!                       $this->db->query("insert into fm_template_hours 
(owner,hours_descr,unit,cost,quantity,billperae,ns3420_id,dim_d,"
                                . " 
grouping_id,grouping_descr,record,building_part,tolerance,remark,entry_date,template_id)
 "
                                . " values ('" .
***************
*** 318,322 ****
                                        $template_id . "')",__LINE__,__FILE__);
  
!                       $receipt['hour_id'] = 
$this->db->get_last_insert_id('fm_wo_template_hours','id');
  
                        $receipt['message'][] = array('msg'=>lang('hour %1 is 
added!',$hour['record']));
--- 318,322 ----
                                        $template_id . "')",__LINE__,__FILE__);
  
!                       $receipt['hour_id'] = 
$this->db->get_last_insert_id('fm_template_hours','id');
  
                        $receipt['message'][] = array('msg'=>lang('hour %1 is 
added!',$hour['record']));
***************
*** 332,341 ****
                        $hour['remark'] = 
$this->db->db_addslashes($hour['remark']);
  
!                       $this->db->query("UPDATE fm_wo_template set
                                chapter_id      ='" . $hour['chapter_id'] . "' 
WHERE id= '$template_id'",__LINE__,__FILE__);
  
                        if($hour['new_grouping'])
                        {
!                               $this->db->query("SELECT grouping_id FROM 
fm_wo_template_hours where grouping_descr ='" .$hour['new_grouping'] . "' and 
template_id= '$template_id'",__LINE__,__FILE__);
                                $this->db->next_record();
                                if ( $this->db->f('grouping_id'))
--- 332,341 ----
                        $hour['remark'] = 
$this->db->db_addslashes($hour['remark']);
  
!                       $this->db->query("UPDATE fm_template set
                                chapter_id      ='" . $hour['chapter_id'] . "' 
WHERE id= '$template_id'",__LINE__,__FILE__);
  
                        if($hour['new_grouping'])
                        {
!                               $this->db->query("SELECT grouping_id FROM 
fm_template_hours where grouping_descr ='" .$hour['new_grouping'] . "' and 
template_id= '$template_id'",__LINE__,__FILE__);
                                $this->db->next_record();
                                if ( $this->db->f('grouping_id'))
***************
*** 346,351 ****
                                {
  
!                                       $this->db->query("UPDATE 
fm_wo_template_hours set grouping_id = NULL WHERE id ='" .$hour['hour_id'] . 
"'",__LINE__,__FILE__);
!                                       $this->db->query("SELECT 
count(grouping_id) as num_grouping FROM fm_wo_template_hours where template_id= 
'$template_id' and grouping_id >0 ",__LINE__,__FILE__);
                                        $this->db->next_record();
                                        if ($this->db->f('num_grouping')==1)
--- 346,351 ----
                                {
  
!                                       $this->db->query("UPDATE 
fm_template_hours set grouping_id = NULL WHERE id ='" .$hour['hour_id'] . 
"'",__LINE__,__FILE__);
!                                       $this->db->query("SELECT 
count(grouping_id) as num_grouping FROM fm_template_hours where template_id= 
'$template_id' and grouping_id >0 ",__LINE__,__FILE__);
                                        $this->db->next_record();
                                        if ($this->db->f('num_grouping')==1)
***************
*** 355,359 ****
                                        else
                                        {
!                                               $this->db->query("SELECT 
max(grouping_id) as grouping_id FROM fm_wo_template_hours where template_id= 
'$template_id'",__LINE__,__FILE__);
                                                $this->db->next_record();
                                                $hour['grouping_id']    = 
$this->db->f('grouping_id')+1;
--- 355,359 ----
                                        else
                                        {
!                                               $this->db->query("SELECT 
max(grouping_id) as grouping_id FROM fm_template_hours where template_id= 
'$template_id'",__LINE__,__FILE__);
                                                $this->db->next_record();
                                                $hour['grouping_id']    = 
$this->db->f('grouping_id')+1;
***************
*** 364,368 ****
                        else
                        {
!                               $this->db->query("SELECT 
grouping_id,grouping_descr FROM fm_wo_template_hours where id ='" 
.$hour['hour_id'] . "'",__LINE__,__FILE__);
                                $this->db->next_record();
                                $old_grouping_id        = 
$this->db->f('grouping_id');
--- 364,368 ----
                        else
                        {
!                               $this->db->query("SELECT 
grouping_id,grouping_descr FROM fm_template_hours where id ='" 
.$hour['hour_id'] . "'",__LINE__,__FILE__);
                                $this->db->next_record();
                                $old_grouping_id        = 
$this->db->f('grouping_id');
***************
*** 375,379 ****
                                else
                                {
!                                       $this->db->query("SELECT grouping_descr 
, max(record) as record FROM fm_wo_template_hours where grouping_id='" 
.$hour['grouping_id'] . "' and template_id= '$template_id' GROUP by 
grouping_descr",__LINE__,__FILE__);
                                        $this->db->next_record();
                                        if($this->db->f('grouping_descr'))
--- 375,379 ----
                                else
                                {
!                                       $this->db->query("SELECT grouping_descr 
, max(record) as record FROM fm_template_hours where grouping_id='" 
.$hour['grouping_id'] . "' and template_id= '$template_id' GROUP by 
grouping_descr",__LINE__,__FILE__);
                                        $this->db->next_record();
                                        if($this->db->f('grouping_descr'))
***************
*** 390,398 ****
                        }
  
!                       $this->db->query("SELECT record FROM 
fm_wo_template_hours where id ='" .$hour['hour_id'] . "'",__LINE__,__FILE__);
                        $this->db->next_record();
                        $hour['record'] = $this->db->f('record');
  
!                       $this->db->query("UPDATE fm_wo_template_hours set
                                hours_descr                     ='" . 
$hour['descr'] . "',
                                remark                          ='" . 
$hour['remark'] . "',
--- 390,398 ----
                        }
  
!                       $this->db->query("SELECT record FROM fm_template_hours 
where id ='" .$hour['hour_id'] . "'",__LINE__,__FILE__);
                        $this->db->next_record();
                        $hour['record'] = $this->db->f('record');
  
!                       $this->db->query("UPDATE fm_template_hours set
                                hours_descr                     ='" . 
$hour['descr'] . "',
                                remark                          ='" . 
$hour['remark'] . "',
***************
*** 417,421 ****
                function get_grouping_list($template_id='')
                {
!                       $this->db->query("SELECT grouping_id, grouping_descr 
FROM fm_wo_template_hours where template_id='$template_id' and grouping_id >0 
group by grouping_id, grouping_descr");
  
                        $i = 0;
--- 417,421 ----
                function get_grouping_list($template_id='')
                {
!                       $this->db->query("SELECT grouping_id, grouping_descr 
FROM fm_template_hours where template_id='$template_id' and grouping_id >0 
group by grouping_id, grouping_descr");
  
                        $i = 0;
***************
*** 434,438 ****
                        $values['name'] = 
$this->db->db_addslashes($values['name']);
  
!                       $this->db->query("insert into fm_wo_template 
(owner,name,descr,chapter_id,entry_date) "
                                . " values ('" .
                                        $this->account . "','" .
--- 434,438 ----
                        $values['name'] = 
$this->db->db_addslashes($values['name']);
  
!                       $this->db->query("insert into fm_template 
(owner,name,descr,chapter_id,entry_date) "
                                . " values ('" .
                                        $this->account . "','" .
***************
*** 442,446 ****
                                        time() . "')",__LINE__,__FILE__);
  
!                       $template_id = 
$this->db->get_last_insert_id('fm_wo_template','id');
  
                        $receipt['template_id'] = $template_id;
--- 442,446 ----
                                        time() . "')",__LINE__,__FILE__);
  
!                       $template_id = 
$this->db->get_last_insert_id('fm_template','id');
  
                        $receipt['template_id'] = $template_id;
***************
*** 454,458 ****
                        $values['descr'] = 
$this->db->db_addslashes($values['descr']);
  
!                       $this->db->query("UPDATE fm_wo_template set name='" . 
$values['name'] . "', descr='" . $values['descr'] . "', chapter_id='"
                                                        . 
(int)$values['chapter_id']
                                                        . "' WHERE id='" . 
$values['template_id'] . "'",__LINE__,__FILE__);
--- 454,458 ----
                        $values['descr'] = 
$this->db->db_addslashes($values['descr']);
  
!                       $this->db->query("UPDATE fm_template set name='" . 
$values['name'] . "', descr='" . $values['descr'] . "', chapter_id='"
                                                        . 
(int)$values['chapter_id']
                                                        . "' WHERE id='" . 
$values['template_id'] . "'",__LINE__,__FILE__);
***************
*** 464,481 ****
                function delete($id)
                {
!                       $this->db->query("DELETE FROM fm_wo_template WHERE 
id='$id'",__LINE__,__FILE__);
!                       $this->db->query("DELETE FROM fm_wo_template_hours  
WHERE template_id='$id'",__LINE__,__FILE__);
                }
  
                function delete_hour($hour_id,$template_id )
                {
!                       $this->db->query("SELECT record FROM 
fm_wo_template_hours where id ='$hour_id'",__LINE__,__FILE__);
                        $this->db->next_record();
                        $old_record     = $this->db->f('record');
  
!                       $this->db->query("DELETE FROM fm_wo_template_hours 
WHERE id='" . $hour_id . "'",__LINE__,__FILE__);
                        if($old_record)
                        {
!                               $this->db->query("UPDATE fm_wo_template_hours 
set record        = record - 1 where  template_id= '$template_id' and record > 
$old_record ",__LINE__,__FILE__);
                        }
  
--- 464,481 ----
                function delete($id)
                {
!                       $this->db->query("DELETE FROM fm_template WHERE 
id='$id'",__LINE__,__FILE__);
!                       $this->db->query("DELETE FROM fm_template_hours  WHERE 
template_id='$id'",__LINE__,__FILE__);
                }
  
                function delete_hour($hour_id,$template_id )
                {
!                       $this->db->query("SELECT record FROM fm_template_hours 
where id ='$hour_id'",__LINE__,__FILE__);
                        $this->db->next_record();
                        $old_record     = $this->db->f('record');
  
!                       $this->db->query("DELETE FROM fm_template_hours WHERE 
id='" . $hour_id . "'",__LINE__,__FILE__);
                        if($old_record)
                        {
!                               $this->db->query("UPDATE fm_template_hours set 
record   = record - 1 where  template_id= '$template_id' and record > 
$old_record ",__LINE__,__FILE__);
                        }
  

Index: class.sotts.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.sotts.inc.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** class.sotts.inc.php 13 May 2003 11:03:06 -0000      1.15
--- class.sotts.inc.php 15 May 2003 09:08:02 -0000      1.16
***************
*** 34,38 ****
                function select_category_list()
                {
!                       $this->db->query("SELECT id, descr FROM 
fm_ticket_category  ORDER BY descr ");
  
                        $i = 0;
--- 34,38 ----
                function select_category_list()
                {
!                       $this->db->query("SELECT id, descr FROM fm_tts_category 
 ORDER BY descr ");
  
                        $i = 0;

Index: class.sowo_hour.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.sowo_hour.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** class.sowo_hour.inc.php     3 May 2003 06:02:17 -0000       1.8
--- class.sowo_hour.inc.php     15 May 2003 09:08:02 -0000      1.9
***************
*** 32,36 ****
                function get_chapter_list()
                {
!                       $this->db->query("SELECT id, descr FROM fm_wo_chapter 
ORDER BY id ");
  
                        $i = 0;
--- 32,36 ----
                function get_chapter_list()
                {
!                       $this->db->query("SELECT id, descr FROM fm_chapter 
ORDER BY id ");
  
                        $i = 0;
***************
*** 75,79 ****
                function select_branch_list()
                {
!                       $this->db->query("SELECT id, descr FROM fm_wo_branch 
ORDER BY id ");
  
                        $i = 0;
--- 75,79 ----
                function select_branch_list()
                {
!                       $this->db->query("SELECT id, descr FROM fm_branch ORDER 
BY id ");
  
                        $i = 0;
***************
*** 107,111 ****
                        while ($this->db->next_record())
                        {
!                               $ngrants = 
(int)$this->grants[$this->db->f('fm_wo_wrkorders.owner')];
                                $hour_list[] = array
                                (
--- 107,111 ----
                        while ($this->db->next_record())
                        {
!                               $ngrants = 
(int)$this->grants[$this->db->f('fm_workorder.owner')];
                                $hour_list[] = array
                                (
***************
*** 151,155 ****
  //_debug_array($workorder);
  
!                       $this->db->query("insert into fm_wo_template 
(owner,name,descr,chapter_id,entry_date) "
                                . " values ('" .
                                        $this->account . "','" .
--- 151,155 ----
  //_debug_array($workorder);
  
!                       $this->db->query("insert into fm_template 
(owner,name,descr,chapter_id,entry_date) "
                                . " values ('" .
                                        $this->account . "','" .
***************
*** 159,163 ****
                                        time() . "')",__LINE__,__FILE__);
  
!                       $template_id = 
$this->db->get_last_insert_id('fm_wo_template','id');
  
                        $hour = $this->read(array('workorder_id' => 
$workorder_id));
--- 159,163 ----
                                        time() . "')",__LINE__,__FILE__);
  
!                       $template_id = 
$this->db->get_last_insert_id('fm_template','id');
  
                        $hour = $this->read(array('workorder_id' => 
$workorder_id));
***************
*** 169,173 ****
                        {
  
!                               $this->db->query("insert into 
fm_wo_template_hours (activity_id,activity_num,owner,hours_descr,unit,"
                                . 
"cost,quantity,billperae,ns3420_id,dim_d,grouping_id,grouping_descr,remark,tolerance,building_part,record,template_id)
 "
                                . " values ('" .
--- 169,173 ----
                        {
  
!                               $this->db->query("insert into fm_template_hours 
(activity_id,activity_num,owner,hours_descr,unit,"
                                . 
"cost,quantity,billperae,ns3420_id,dim_d,grouping_id,grouping_descr,remark,tolerance,building_part,record,template_id)
 "
                                . " values ('" .
***************
*** 240,244 ****
                        $record = $this->next_record($workorder_id);
  
!                       $this->db->query("UPDATE fm_wo_wrkorders set
                                chapter_id      ='" . $hour[0]['chapter_id'] . 
"' WHERE id= '$workorder_id'",__LINE__,__FILE__);
  
--- 240,244 ----
                        $record = $this->next_record($workorder_id);
  
!                       $this->db->query("UPDATE fm_workorder set
                                chapter_id      ='" . $hour[0]['chapter_id'] . 
"' WHERE id= '$workorder_id'",__LINE__,__FILE__);
  
***************
*** 301,305 ****
                        $hour['record'] = $this->next_record($workorder_id);
  
!                       $this->db->query("UPDATE fm_wo_wrkorders set
                                chapter_id      ='" . $hour['chapter_id'] . "' 
WHERE id= '$workorder_id'",__LINE__,__FILE__);
  
--- 301,305 ----
                        $hour['record'] = $this->next_record($workorder_id);
  
!                       $this->db->query("UPDATE fm_workorder set
                                chapter_id      ='" . $hour['chapter_id'] . "' 
WHERE id= '$workorder_id'",__LINE__,__FILE__);
  
***************
*** 398,402 ****
  
  
!                       $this->db->query("UPDATE fm_wo_wrkorders set
                                chapter_id      ='" . $hour['chapter_id'] . "' 
WHERE id= '$workorder_id'",__LINE__,__FILE__);
  
--- 398,402 ----
  
  
!                       $this->db->query("UPDATE fm_workorder set
                                chapter_id      ='" . $hour['chapter_id'] . "' 
WHERE id= '$workorder_id'",__LINE__,__FILE__);
  
***************
*** 488,492 ****
                function update_email($to_email,$workorder_id)
                {
!                       $this->db->query("SELECT vendor_id FROM fm_wo_wrkorders 
where id ='$workorder_id'",__LINE__,__FILE__);
                        $this->db->next_record();
                        $vendor_id      = $this->db->f('vendor_id');
--- 488,492 ----
                function update_email($to_email,$workorder_id)
                {
!                       $this->db->query("SELECT vendor_id FROM fm_workorder 
where id ='$workorder_id'",__LINE__,__FILE__);
                        $this->db->next_record();
                        $vendor_id      = $this->db->f('vendor_id');

Index: class.soworkorder.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.soworkorder.inc.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** class.soworkorder.inc.php   10 Apr 2003 10:14:27 -0000      1.13
--- class.soworkorder.inc.php   15 May 2003 09:08:02 -0000      1.14
***************
*** 35,39 ****
                {
  
!                       $this->db->query("SELECT id, descr FROM 
fm_wo_workorder_category  ORDER BY descr ");
  
                        $i = 0;
--- 35,39 ----
                {
  
!                       $this->db->query("SELECT id, descr FROM 
fm_workorder_category  ORDER BY descr ");
  
                        $i = 0;
***************
*** 49,53 ****
                function read_single_project_category($id='')
                {
!                       $this->db->query("SELECT descr FROM 
fm_wo_workorder_category where id='$id' ");
                        $this->db->next_record();
                        return $this->db->f('descr');
--- 49,53 ----
                function read_single_project_category($id='')
                {
!                       $this->db->query("SELECT descr FROM 
fm_workorder_category where id='$id' ");
                        $this->db->next_record();
                        return $this->db->f('descr');
***************
*** 56,60 ****
                function get_b_account_name($id='')
                {
!                       $this->db->query("SELECT descr FROM fm_wo_accounts 
where id='$id' ");
                        $this->db->next_record();
                        return $this->db->f('descr');
--- 56,60 ----
                function get_b_account_name($id='')
                {
!                       $this->db->query("SELECT descr FROM fm_b_account where 
id='$id' ");
                        $this->db->next_record();
                        return $this->db->f('descr');
***************
*** 63,67 ****
                function select_status_list()
                {
!                       $this->db->query("SELECT id, descr FROM 
fm_wo_wrkorders_status ORDER BY id ");
  
                        $i = 0;
--- 63,67 ----
                function select_status_list()
                {
!                       $this->db->query("SELECT id, descr FROM 
fm_workorder_status ORDER BY id ");
  
                        $i = 0;
***************
*** 77,81 ****
                function select_branch_list()
                {
!                       $this->db->query("SELECT id, descr FROM fm_wo_branch 
ORDER BY id ");
  
                        $i = 0;
--- 77,81 ----
                function select_branch_list()
                {
!                       $this->db->query("SELECT id, descr FROM fm_branch ORDER 
BY id ");
  
                        $i = 0;
***************
*** 91,95 ****
                function select_key_location_list()
                {
!                       $this->db->query("SELECT id, descr FROM fm_wo_key_loc 
ORDER BY descr ");
  
                        $i = 0;
--- 91,95 ----
                function select_key_location_list()
                {
!                       $this->db->query("SELECT id, descr FROM fm_key_loc 
ORDER BY descr ");
  
                        $i = 0;
***************
*** 129,136 ****
                        else
                        {
!                               $ordermethod = ' order by fm_wo_wrkorders.id 
ASC';
                        }
  
!                       $filtermethod = ' ( fm_wo_wrkorders.owner=' . 
$this->account;
                        if (is_array($this->grants))
                        {
--- 129,136 ----
                        else
                        {
!                               $ordermethod = ' order by fm_workorder.id ASC';
                        }
  
!                       $filtermethod = ' ( fm_workorder.owner=' . 
$this->account;
                        if (is_array($this->grants))
                        {
***************
*** 141,145 ****
                                }
                                reset($public_user_list);
!                               $filtermethod .= " OR 
(fm_wo_wrkorders.access='public' OR fm_wo_wrkorders.owner IN(" . 
implode(',',$public_user_list) . ")))";
                        }
                        else
--- 141,145 ----
                                }
                                reset($public_user_list);
!                               $filtermethod .= " OR 
(fm_workorder.access='public' OR fm_workorder.owner IN(" . 
implode(',',$public_user_list) . ")))";
                        }
                        else
***************
*** 150,164 ****
                        if ($cat_id > 0)
                        {
!                               $filtermethod .= " AND 
fm_wo_wrkorders.category='$cat_id' ";
                        }
  
                        if ($status_id)
                        {
!                               $filtermethod .= " AND 
fm_wo_wrkorders.status='$status_id' ";
                        }
  
                        if ($filter)
                        {
!                               $filtermethod .= " AND 
fm_wo_wrkorders.owner='$filter' ";
                        }
  
--- 150,164 ----
                        if ($cat_id > 0)
                        {
!                               $filtermethod .= " AND 
fm_workorder.category='$cat_id' ";
                        }
  
                        if ($status_id)
                        {
!                               $filtermethod .= " AND 
fm_workorder.status='$status_id' ";
                        }
  
                        if ($filter)
                        {
!                               $filtermethod .= " AND 
fm_workorder.owner='$filter' ";
                        }
  
***************
*** 168,177 ****
                                $query = ereg_replace('"','',$query);
  
!                               $querymethod = " AND fm_wo_wrkorders.title LIKE 
'%$query%' or fm_wo_wrkorders.descr LIKE '%$query%' or fm_wo_project.address 
LIKE '%$query%' or fm_wo_project.location_code LIKE '%$query%'";
                        }
  
!                       $sql = "SELECT fm_wo_project.id as 
project_id,fm_wo_wrkorders.id,fm_wo_wrkorders.entry_date,fm_wo_wrkorders.status,fm_wo_project.location_code,"
!                               . " 
fm_wo_project.floor,fm_wo_project.address,fm_wo_wrkorders.title,fm_wo_wrkorders.owner
 "
!                               . " FROM fm_wo_wrkorders $this->join 
fm_wo_project ON fm_wo_project.id = fm_wo_wrkorders.project_id WHERE  
$filtermethod $querymethod";
  
                        $this->db2->query($sql,__LINE__,__FILE__);
--- 168,177 ----
                                $query = ereg_replace('"','',$query);
  
!                               $querymethod = " AND fm_workorder.title LIKE 
'%$query%' or fm_workorder.descr LIKE '%$query%' or fm_project.address LIKE 
'%$query%' or fm_project.location_code LIKE '%$query%'";
                        }
  
!                       $sql = "SELECT fm_project.id as 
project_id,fm_workorder.id,fm_workorder.entry_date,fm_workorder.status,fm_project.location_code,"
!                               . " 
fm_project.floor,fm_project.address,fm_workorder.title,fm_workorder.owner "
!                               . " FROM fm_workorder $this->join fm_project ON 
fm_project.id = fm_workorder.project_id WHERE  $filtermethod $querymethod";
  
                        $this->db2->query($sql,__LINE__,__FILE__);
***************
*** 181,185 ****
                        while ($this->db->next_record())
                        {
!                               $ngrants = 
(int)$this->grants[$this->db->f('fm_wo_wrkorders.owner')];
                                $workorder_list[] = array
                                (
--- 181,185 ----
                        while ($this->db->next_record())
                        {
!                               $ngrants = 
(int)$this->grants[$this->db->f('fm_workorder.owner')];
                                $workorder_list[] = array
                                (
***************
*** 203,208 ****
                function read_single($workorder_id)
                {
!                       $sql = "SELECT fm_wo_wrkorders.*, fm_wo_chapter.descr 
as chapter  from fm_wo_wrkorders $this->join fm_wo_chapter on "
!                               . " fm_wo_wrkorders.chapter_id = 
fm_wo_chapter.id where fm_wo_wrkorders.id='$workorder_id'";
  
                        $this->db->query($sql,__LINE__,__FILE__);
--- 203,208 ----
                function read_single($workorder_id)
                {
!                       $sql = "SELECT fm_workorder.*, fm_chapter.descr as 
chapter  from fm_workorder $this->join fm_chapter on "
!                               . " fm_workorder.chapter_id = fm_chapter.id 
where fm_workorder.id='$workorder_id'";
  
                        $this->db->query($sql,__LINE__,__FILE__);
***************
*** 243,247 ****
                function project_budget_from_workorder($project_id = '')
                {
!                       $this->db->query("select budget, id as workorder_id 
from fm_wo_wrkorders where project_id='$project_id'");
                        while ($this->db->next_record())
                        {
--- 243,247 ----
                function project_budget_from_workorder($project_id = '')
                {
!                       $this->db->query("select budget, id as workorder_id 
from fm_workorder where project_id='$project_id'");
                        while ($this->db->next_record())
                        {
***************
*** 257,261 ****
                {
  
!                       $this->db2->query("SELECT branch_id from 
fm_wo_projectbranch WHERE project_id='$project_id' ",__LINE__,__FILE__);
                        while ($this->db2->next_record())
                        {
--- 257,261 ----
                {
  
!                       $this->db2->query("SELECT branch_id from 
fm_projectbranch WHERE project_id='$project_id' ",__LINE__,__FILE__);
                        while ($this->db2->next_record())
                        {
***************
*** 322,326 ****
                        $workorder['title'] = 
$this->db->db_addslashes($workorder['title']);
  //_debug_array($workorder);
!                       $this->db->query("INSERT INTO fm_wo_wrkorders 
(id,project_id,title,access,entry_date,start_date,end_date,status,"
                                . 
"descr,budget,account_id,rig_addition,addition,key_deliver,key_fetch,vendor_id,charge_tenant,owner)
 "
                                . "VALUES ('"
--- 322,326 ----
                        $workorder['title'] = 
$this->db->db_addslashes($workorder['title']);
  //_debug_array($workorder);
!                       $this->db->query("INSERT INTO fm_workorder 
(id,project_id,title,access,entry_date,start_date,end_date,status,"
                                . 
"descr,budget,account_id,rig_addition,addition,key_deliver,key_fetch,vendor_id,charge_tenant,owner)
 "
                                . "VALUES ('"
***************
*** 350,354 ****
                function edit($workorder)
                {
!                       $this->db->query("SELECT status,budget FROM 
fm_wo_wrkorders where id='" .$workorder['workorder_id']."'",__LINE__,__FILE__);
  
                        $this->db->next_record();
--- 350,354 ----
                function edit($workorder)
                {
!                       $this->db->query("SELECT status,budget FROM 
fm_workorder where id='" .$workorder['workorder_id']."'",__LINE__,__FILE__);
  
                        $this->db->next_record();
***************
*** 369,373 ****
  //_debug_array($workorder);
  
!                       $this->db->query("UPDATE fm_wo_wrkorders set
                                title                   ='" . 
$workorder['title'] . "',
                                status                  ='" . 
$workorder['status'] . "',
--- 369,373 ----
  //_debug_array($workorder);
  
!                       $this->db->query("UPDATE fm_workorder set
                                title                   ='" . 
$workorder['title'] . "',
                                status                  ='" . 
$workorder['status'] . "',
***************
*** 393,398 ****
                function delete($workorder_id )
                {
!                       $this->db->query("DELETE FROM fm_wo_wrkorders WHERE 
id='" . $workorder_id . "'",__LINE__,__FILE__);
!                       $this->db->query("DELETE FROM fm_wo_workorder_history  
WHERE  history_record_id='" . $workorder_id   . "'",__LINE__,__FILE__);
                        $this->db->query("DELETE FROM fm_wo_hours WHERE 
workorder_id='" . $workorder_id   . "'",__LINE__,__FILE__);
  
--- 393,398 ----
                function delete($workorder_id )
                {
!                       $this->db->query("DELETE FROM fm_workorder WHERE id='" 
. $workorder_id . "'",__LINE__,__FILE__);
!                       $this->db->query("DELETE FROM fm_workorder_history  
WHERE  history_record_id='" . $workorder_id   . "'",__LINE__,__FILE__);
                        $this->db->query("DELETE FROM fm_wo_hours WHERE 
workorder_id='" . $workorder_id   . "'",__LINE__,__FILE__);
  

Index: class.soXport.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.soXport.inc.php,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -r1.22 -r1.23
*** class.soXport.inc.php       10 May 2003 16:34:22 -0000      1.22
--- class.soXport.inc.php       15 May 2003 09:08:02 -0000      1.23
***************
*** 130,134 ****
                {
  
!                       $this->db->query("select count(*) from fm_wo_wrkorders 
where id='$pmwrkord_code'");
                        $this->db->next_record();
                        return $this->db->f(0);
--- 130,134 ----
                {
  
!                       $this->db->query("select count(*) from fm_workorder 
where id='$pmwrkord_code'");
                        $this->db->next_record();
                        return $this->db->f(0);
***************
*** 138,142 ****
                {
  
!                       $this->db->query("select count(*) from fm_wo_accounts 
where id='$id'");
                        $this->db->next_record();
                        return $this->db->f(0);
--- 138,142 ----
                {
  
!                       $this->db->query("select count(*) from fm_b_account 
where id='$id'");
                        $this->db->next_record();
                        return $this->db->f(0);
***************
*** 743,747 ****
          function select_dimc($pmwrkord_code)
          {
!               $sql= "select location_code from fm_wo_wrkorders $this->join 
fm_wo_project on fm_wo_wrkorders.project_id=fm_wo_project.id  where 
fm_wo_wrkorders.id='$pmwrkord_code'";
                        $this->db->query($sql,__LINE__,__FILE__);
                        $this->db->next_record();
--- 743,747 ----
          function select_dimc($pmwrkord_code)
          {
!               $sql= "select location_code from fm_workorder $this->join 
fm_project on fm_workorder.project_id=fm_project.id  where 
fm_workorder.id='$pmwrkord_code'";
                        $this->db->query($sql,__LINE__,__FILE__);
                        $this->db->next_record();
***************
*** 763,771 ****
                        if ($dimd % 2 == 0)
                {
!                       $sql="update fm_wo_wrkorders set 
act_mtrl_cost=act_mtrl_cost + 
substr($belop,0,(strlen($belop)-2)).substr($belop,(strlen($belop)-3),2) where 
pmwrkord_code='$pmwrkord_code'";
                }
                        else
                        {
!                               $sql="update fm_wo_wrkorders set 
act_vendor_cost=act_vendor_cost + 
substr($belop,0,(strlen($belop)-2)).substr($belop,(strlen($belop)-3),2) where 
pmwrkord_code='$pmwrkord_code'";
                        }
  
--- 763,771 ----
                        if ($dimd % 2 == 0)
                {
!                       $sql="update fm_workorder set 
act_mtrl_cost=act_mtrl_cost + 
substr($belop,0,(strlen($belop)-2)).substr($belop,(strlen($belop)-3),2) where 
pmwrkord_code='$pmwrkord_code'";
                }
                        else
                        {
!                               $sql="update fm_workorder set 
act_vendor_cost=act_vendor_cost + 
substr($belop,0,(strlen($belop)-2)).substr($belop,(strlen($belop)-3),2) where 
pmwrkord_code='$pmwrkord_code'";
                        }
  
***************
*** 781,785 ****
                        $Belop=$Belop/100;
  
!                       $sql="update fm_wo_wrkorders set 
$actual_cost_field=$actual_cost_field $operator $Belop where 
id='$pmwrkord_code'";
  //echo 'sql :' . $sql . '<BR>';
                        $this->db->query($sql,__LINE__,__FILE__);
--- 781,785 ----
                        $Belop=$Belop/100;
  
!                       $sql="update fm_workorder set 
$actual_cost_field=$actual_cost_field $operator $Belop where 
id='$pmwrkord_code'";
  //echo 'sql :' . $sql . '<BR>';
                        $this->db->query($sql,__LINE__,__FILE__);

Index: class.uidrawing.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uidrawing.inc.php,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -r1.16 -r1.17
*** class.uidrawing.inc.php     14 May 2003 13:18:15 -0000      1.16
--- class.uidrawing.inc.php     15 May 2003 09:08:02 -0000      1.17
***************
*** 312,315 ****
--- 312,319 ----
                                        
$receipt['error'][]=array('msg'=>lang('Please select a status !'));
                                }
+                               if(!$values['property_id'])
+                               {
+                                       
$receipt['error'][]=array('msg'=>lang('Please select a location !'));
+                               }
  
                                if(!$values['drawing_name_orig'] && 
$this->bo->vfs->file_exists(array(
***************
*** 326,338 ****
                                {
  
!                                       $this->bo->vfs->cp (array (
                                                'from'  => 
$_FILES['drawing_file']['tmp_name'],
                                                'to'    => $this->fakebase. SEP 
. 'drawing' . SEP . $values['drawing_name'],
!                                               'relatives'     => array 
(RELATIVE_NONE|VFS_REAL, RELATIVE_ALL)));
! 
!                                       $receipt = $this->bo->save($values);
! 
!                                       $drawing_id=$receipt['drawing_id'];
! //_debug_array($receipt);
                                }
                        }
--- 330,350 ----
                                {
  
!                                       if(!$this->bo->vfs->cp (array (
                                                'from'  => 
$_FILES['drawing_file']['tmp_name'],
                                                'to'    => $this->fakebase. SEP 
. 'drawing' . SEP . $values['drawing_name'],
!                                               'relatives'     => array 
(RELATIVE_NONE|VFS_REAL, RELATIVE_ALL))))
!                                       {
!                                               
$receipt['error'][]=array('msg'=>lang('Failed to upload file !'));
!                                       }
! 
!                                       if(!$receipt['error'])
!                                       {
!                                               $receipt = 
$this->bo->save($values);
!                                               
$drawing_id=$receipt['drawing_id'];
!                                       }
!                               }
!                               else
!                               {
!                                       $values['drawing_name']='';
                                }
                        }

Index: class.uitemplate.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uitemplate.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** class.uitemplate.inc.php    3 May 2003 06:02:17 -0000       1.7
--- class.uitemplate.inc.php    15 May 2003 09:08:02 -0000      1.8
***************
*** 119,123 ****
                                                                                
(
                                                                                
        'sort'  => $this->sort,
!                                                                               
        'var'   =>      'fm_wo_template.id',
                                                                                
        'order' =>      $this->order,
                                                                                
        'extra'         => array('menuaction'           => 
$this->currentapp.'.uitemplate.list_template',
--- 119,123 ----
                                                                                
(
                                                                                
        'sort'  => $this->sort,
!                                                                               
        'var'   =>      'fm_template.id',
                                                                                
        'order' =>      $this->order,
                                                                                
        'extra'         => array('menuaction'           => 
$this->currentapp.'.uitemplate.list_template',





reply via email to

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