phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property inc/class.bocommon.inc.php inc/class.b...


From: Sigurd Nes
Subject: [Phpgroupware-cvs] property inc/class.bocommon.inc.php inc/class.b...
Date: Wed, 12 Apr 2006 10:24:43 +0000

CVSROOT:        /sources/phpgroupware
Module name:    property
Branch:         
Changes by:     Sigurd Nes <address@hidden>     06/04/12 10:24:43

Modified files:
        inc            : class.bocommon.inc.php class.botts.inc.php 
                         class.sob_account.inc.php 
                         class.sobudget.inc.php class.socategory.inc.php 
                         class.uib_account.inc.php class.uitts.inc.php 
                         hook_admin.inc.php 
        setup          : setup.inc.php tables_current.inc.php 
                         tables_update.inc.php 
        templates/base : b_account.xsl 

Log message:
        

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.bocommon.inc.php.diff?tr1=1.28&tr2=1.29&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.botts.inc.php.diff?tr1=1.21&tr2=1.22&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.sob_account.inc.php.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.sobudget.inc.php.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.socategory.inc.php.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.uib_account.inc.php.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.uitts.inc.php.diff?tr1=1.31&tr2=1.32&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/hook_admin.inc.php.diff?tr1=1.22&tr2=1.23&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/setup/setup.inc.php.diff?tr1=1.37&tr2=1.38&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/setup/tables_current.inc.php.diff?tr1=1.55&tr2=1.56&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/setup/tables_update.inc.php.diff?tr1=1.40&tr2=1.41&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/templates/base/b_account.xsl.diff?tr1=1.1&tr2=1.2&r1=text&r2=text

Patches:
Index: property/inc/class.bocommon.inc.php
diff -u property/inc/class.bocommon.inc.php:1.28 
property/inc/class.bocommon.inc.php:1.29
--- property/inc/class.bocommon.inc.php:1.28    Fri Mar 24 19:30:21 2006
+++ property/inc/class.bocommon.inc.php Wed Apr 12 10:24:43 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage core
-       * @version $Id: class.bocommon.inc.php,v 1.28 2006/03/24 19:30:21 
sigurdne Exp $
+       * @version $Id: class.bocommon.inc.php,v 1.29 2006/04/12 10:24:43 
sigurdne Exp $
        */
 
        /**
@@ -1260,6 +1260,56 @@
                }
 
 
+               function select_category_list($data)
+               {
+                       switch($data['format'])
+                       {
+                               case 'select':
+                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_select'));
+                                       break;
+                               case 'filter':
+                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_filter'));
+                                       break;
+                       }
+
+                       if (!is_object($socategory))
+                       {
+                               $socategory = 
CreateObject($this->currentapp.'.socategory');
+                       }
+                       
+                       $categories= 
$socategory->select_category_list(array('type'     =>$data['type'],
+                                                                               
'type_id'=>$data['type_id'],
+                                                                               
'order' =>$data['order']));
+
+                       while (is_array($categories) && list(,$category) = 
each($categories))
+                       {
+                               $sel_category = '';
+                               if ($category['id']==$data['selected'])
+                               {
+                                       $sel_category = 'selected';
+                               }
+
+                               $category_list[] = array
+                               (
+                                       'cat_id'        => $category['id'],
+                                       'name'          => $category['name'],
+                                       'selected'      => $sel_category
+                               );
+                       }
+
+                       for ($i=0;$i<count($category_list);$i++)
+                       {
+                               if ($category_list[$i]['selected'] != 
'selected')
+                               {
+                                       unset($category_list[$i]['selected']);
+                               }
+                       }
+
+
+                       return $category_list;
+               }
+
+
                function validate_db_insert($values)
                {
                        foreach($values as $value)
Index: property/inc/class.botts.inc.php
diff -u property/inc/class.botts.inc.php:1.21 
property/inc/class.botts.inc.php:1.22
--- property/inc/class.botts.inc.php:1.21       Thu Mar 23 09:29:35 2006
+++ property/inc/class.botts.inc.php    Wed Apr 12 10:24:43 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage helpdesk
-       * @version $Id: class.botts.inc.php,v 1.21 2006/03/23 09:29:35 sigurdne 
Exp $
+       * @version $Id: class.botts.inc.php,v 1.22 2006/04/12 10:24:43 sigurdne 
Exp $
        */
 
        /**
@@ -298,7 +298,6 @@
 
                function select_category_list($format='',$selected='')
                {
-
                        switch($format)
                        {
                                case 'select':
Index: property/inc/class.sob_account.inc.php
diff -u property/inc/class.sob_account.inc.php:1.8 
property/inc/class.sob_account.inc.php:1.9
--- property/inc/class.sob_account.inc.php:1.8  Mon Jan 30 22:14:19 2006
+++ property/inc/class.sob_account.inc.php      Wed Apr 12 10:24:43 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage admin
-       * @version $Id: class.sob_account.inc.php,v 1.8 2006/01/30 22:14:19 
sigurdne Exp $
+       * @version $Id: class.sob_account.inc.php,v 1.9 2006/04/12 10:24:43 
sigurdne Exp $
        */
 
        /**
@@ -21,11 +21,11 @@
                function sob_account()
                {
                        $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
-                       $this->account  = 
$GLOBALS['phpgw_info']['user']['account_id'];
-                       $this->bocommon         = 
CreateObject($this->currentapp.'.bocommon');
+                       $this->account  =       
$GLOBALS['phpgw_info']['user']['account_id'];
+                       $this->bocommon = 
CreateObject($this->currentapp.'.bocommon');
                        $this->db               = $this->bocommon->new_db();
                        $this->db2              = $this->bocommon->new_db();
-                       $this->like                     = $this->bocommon->like;
+                       $this->like             = $this->bocommon->like;
                }
 
                function read($data)
@@ -102,9 +102,9 @@
 
                        if ($this->db->next_record())
                        {
-                               $b_account['id']                        = 
$this->db->f('id');
-                               $b_account['descr']                     = 
$this->db->f('descr');
-                               $b_account['group']                     = 
$this->db->f('grouping');
+                               $b_account['id']                = 
$this->db->f('id');
+                               $b_account['descr']             = 
$this->db->f('descr');
+                               $b_account['cat_id']            = 
$this->db->f('category');
                                $b_account['responsible']       = 
$this->db->f('responsible');
 
                                return $b_account;
@@ -117,8 +117,8 @@
 
                        $b_account['descr'] = 
$this->db->db_addslashes($b_account['descr']);
 
-                       $this->db->query("INSERT INTO $table (id, 
descr,grouping,responsible) "
-                               . "VALUES ('" . $b_account['id'] . "','" . 
$b_account['descr']. "','" . substr($b_account['id'],0,2) . "','" . 
$b_account['responsible'] . "')",__LINE__,__FILE__);
+                       $this->db->query("INSERT INTO $table (id, 
descr,category,responsible) "
+                               . "VALUES ('" . $b_account['id'] . "','" . 
$b_account['descr']. "','" .$b_account['cat_id'] . "','" . 
$b_account['responsible'] . "')",__LINE__,__FILE__);
 
                        $receipt['message'][]=array('msg'=>lang('budget account 
%1 has been saved',$b_account['id']));
                        return $receipt;
@@ -131,8 +131,11 @@
 
                        $b_account['descr'] = 
$this->db->db_addslashes($b_account['descr']);
 
-                       $this->db->query("UPDATE $table set descr='" . 
$b_account['descr'] . "',responsible='" . $b_account['responsible']
-                                                       . "' WHERE id='" . 
$b_account['id']. "'",__LINE__,__FILE__);
+                       $this->db->query("UPDATE $table set"
+                                       . " descr='" . $b_account['descr'] . 
"',"
+                                       . "responsible=" . 
$b_account['responsible'] . ","
+                                       . "category=" . 
(int)$b_account['cat_id']
+                                       . " WHERE id='" . $b_account['id']. 
"'",__LINE__,__FILE__);
 
 
                        $receipt['message'][]=array('msg'=>lang('budget account 
%1 has been edited',$b_account['id']));
Index: property/inc/class.sobudget.inc.php
diff -u property/inc/class.sobudget.inc.php:1.7 
property/inc/class.sobudget.inc.php:1.8
--- property/inc/class.sobudget.inc.php:1.7     Tue Apr 11 20:49:10 2006
+++ property/inc/class.sobudget.inc.php Wed Apr 12 10:24:43 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage budget
-       * @version $Id: class.sobudget.inc.php,v 1.7 2006/04/11 20:49:10 
sigurdne Exp $
+       * @version $Id: class.sobudget.inc.php,v 1.8 2006/04/12 10:24:43 
sigurdne Exp $
        */
 
        /**
@@ -74,7 +74,7 @@
                        }
                        if ($grouping > 0)
                        {
-                               $filtermethod .= " $where grouping='$grouping' 
";
+                               $filtermethod .= " $where category='$grouping' 
";
                                $where = 'AND';
 
                        }
@@ -94,7 +94,7 @@
                        }
 
 
-                       $sql = "SELECT fm_budget.*,grouping, descr FROM 
fm_budget $this->join fm_b_account ON fm_budget.b_account_id = fm_b_account.id 
$filtermethod $querymethod";
+                       $sql = "SELECT fm_budget.*, descr,category FROM 
fm_budget $this->join fm_b_account ON fm_budget.b_account_id = fm_b_account.id 
$filtermethod $querymethod";
 
                        $this->db2->query($sql,__LINE__,__FILE__);
                        $this->total_records = $this->db2->num_rows();
@@ -114,7 +114,7 @@
                                (
                                        'budget_id'             => 
$this->db->f('id'),
                                        'year'                  => 
$this->db->f('year'),
-                                       'grouping'              => 
$this->db->f('grouping'),
+                                       'grouping'              => 
$this->db->f('category'),
                                        'b_account_id'          => 
$this->db->f('b_account_id'),
                                        'b_account_name'        => 
$this->db->f('descr'),
                                        'district_id'           => 
$this->db->f('district_id'),
@@ -185,7 +185,7 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);
 
-                               $querymethod = " $where ( descr $this->like 
'%$query%')";
+                       //      $querymethod = " $where ( descr $this->like 
'%$query%')";
                        }
 
 
@@ -326,15 +326,15 @@
 
                function get_b_group_list()
                {
-                       $sql = "SELECT grouping FROM fm_b_account group by 
grouping order by grouping asc";
-                       $this->db->query($sql);
+                       $sql = "SELECT id FROM fm_b_account_category order by 
id asc";
+                       $this->db->query($sql,__LINE__,__FILE__);
 
                        while ($this->db->next_record())
                        {
                                $group_list[] = array
                                (
-                                       'id'    => $this->db->f('grouping'),
-                                       'name'  => $this->db->f('grouping')
+                                       'id'    => $this->db->f('id'),
+                                       'name'  => $this->db->f('id')
                                );
 
                        }
@@ -346,7 +346,7 @@
                        $table = $basis?'fm_budget_basis':'fm_budget';
                        
                        $sql = "SELECT revision FROM $table where year =" . 
(int)$year;
-                       $this->db->query($sql);
+                       $this->db->query($sql,__LINE__,__FILE__);
 
                        while ($this->db->next_record())
                        {
@@ -373,7 +373,7 @@
                {
                        $table = $basis?'fm_budget_basis':'fm_budget';
                        $sql = "SELECT year FROM $table group by year";
-                       $this->db->query($sql);
+                       $this->db->query($sql,__LINE__,__FILE__);
 
                        while ($this->db->next_record())
                        {
@@ -390,7 +390,7 @@
                {
                        $table = $basis?'fm_budget_basis':'fm_budget';
                        $sql = "SELECT max(revision) as revision FROM $table 
WHERE year =". (int)$year;
-                       $this->db->query($sql);
+                       $this->db->query($sql,__LINE__,__FILE__);
                        $this->db->next_record();
                        return $this->db->f('revision');
                }
@@ -400,7 +400,7 @@
                {
                        $table = $basis?'fm_budget_basis':'fm_budget';
                        $sql = "SELECT revision FROM $table WHERE year =". 
(int)$year . "  group by revision";
-                       $this->db->query($sql);
+                       $this->db->query($sql,__LINE__,__FILE__);
 
                        while ($this->db->next_record())
                        {
@@ -421,10 +421,10 @@
                        }
                        else
                        {
-                               $sql = "SELECT grouping FROM fm_budget 
$this->join fm_b_account ON fm_budget.b_account_id = fm_b_account.id WHERE year 
=". (int)$year . "  group by grouping";
+                               $sql = "SELECT category as grouping FROM 
fm_budget $this->join fm_b_account ON fm_budget.b_account_id = fm_b_account.id 
WHERE year =". (int)$year . "  group by category";
                        }
                        
-                       $this->db->query($sql);
+                       $this->db->query($sql,__LINE__,__FILE__);
 
                        while ($this->db->next_record())
                        {
@@ -441,7 +441,7 @@
                {
                        $table = 'fm_budget_cost';
                        $sql = "SELECT year FROM $table group by year order by 
year asc";
-                       $this->db->query($sql);
+                       $this->db->query($sql,__LINE__,__FILE__);
 
                        while ($this->db->next_record())
                        {
@@ -484,12 +484,12 @@
                                        $basis['budget_cost']           = 
$this->db->f('budget_cost');
                                }
                                
-                               $sql = "SELECT SUM(amount) as group_sum FROM 
fm_budget_cost $this->join fm_b_account ON fm_budget_cost.b_account_id = 
fm_b_account.id WHERE fm_b_account.grouping = '" . $basis['b_group'] . "' AND 
$year_condition";
+                               $sql = "SELECT SUM(amount) as group_sum FROM 
fm_budget_cost $this->join fm_b_account ON fm_budget_cost.b_account_id = 
fm_b_account.id WHERE fm_b_account.category = '" . $basis['b_group'] . "' AND 
$year_condition";
                                $this->db->query($sql,__LINE__,__FILE__);
                                $this->db->next_record();
                                $group_sum = $this->db->f('group_sum');
                                
-                               $sql = "SELECT SUM(amount) as account_sum, 
b_account_id FROM fm_budget_cost $this->join fm_b_account ON 
fm_budget_cost.b_account_id = fm_b_account.id WHERE fm_b_account.grouping = '" 
. $basis['b_group'] . "' AND $year_condition group by b_account_id";
+                               $sql = "SELECT SUM(amount) as account_sum, 
b_account_id FROM fm_budget_cost $this->join fm_b_account ON 
fm_budget_cost.b_account_id = fm_b_account.id WHERE fm_b_account.category = '" 
. $basis['b_group'] . "' AND $year_condition group by b_account_id";
                                $this->db->query($sql,__LINE__,__FILE__);
 
                                while ($this->db->next_record())
Index: property/inc/class.socategory.inc.php
diff -u property/inc/class.socategory.inc.php:1.14 
property/inc/class.socategory.inc.php:1.15
--- property/inc/class.socategory.inc.php:1.14  Sun Feb 12 18:12:01 2006
+++ property/inc/class.socategory.inc.php       Wed Apr 12 10:24:43 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage admin
-       * @version $Id: class.socategory.inc.php,v 1.14 2006/02/12 18:12:01 
sigurdne Exp $
+       * @version $Id: class.socategory.inc.php,v 1.15 2006/04/12 10:24:43 
sigurdne Exp $
        */
 
        /**
@@ -159,6 +159,10 @@
                                case 'r_agreement':
                                        $table='fm_r_agreement_category';
                                        break;
+                               case 'b_account':
+                                       $table='fm_b_account_category';
+                                       break;
+
                        }
 
                        return $table;
@@ -183,6 +187,32 @@
                        }
                }
 
+
+               function select_category_list($data)
+               {
+                       $table = 
$this->select_table($data['type'],$data['type_id']);
+                       if($data['order'] == 'id')
+                       {
+                               $order='id';
+                       }
+                       else
+                       {
+                               $order='descr';
+                       }
+                       
+                       $this->db->query("SELECT id, descr FROM $table ORDER BY 
$order");
+
+                       while ($this->db->next_record())
+                       {
+                               $categories[] = array(
+                                       'id'    => $this->db->f('id'),
+                                       'name'  => 
stripslashes($this->db->f('descr'))
+                                       );
+                       }
+                       return $categories;
+               }
+
+
                function add($category,$type,$type_id)
                {
                        $table = $this->select_table($type,$type_id);
Index: property/inc/class.uib_account.inc.php
diff -u property/inc/class.uib_account.inc.php:1.11 
property/inc/class.uib_account.inc.php:1.12
--- property/inc/class.uib_account.inc.php:1.11 Fri Feb  3 12:05:49 2006
+++ property/inc/class.uib_account.inc.php      Wed Apr 12 10:24:43 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage admin
-       * @version $Id: class.uib_account.inc.php,v 1.11 2006/02/03 12:05:49 
sigurdne Exp $
+       * @version $Id: class.uib_account.inc.php,v 1.12 2006/04/12 10:24:43 
sigurdne Exp $
        */
 
        /**
@@ -239,33 +239,36 @@
                                'menuaction'    => 
$this->currentapp.'.uib_account.edit',
                                'id'    => $id
                        );
-//_debug_array($link_data);
+//_debug_array($b_account);
 
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
 
                        $data = array
                        (
-                               'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'done_action'                                   
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uib_account.index&type='.$type),
-                               'lang_id'                                       
        => lang('budget account'),
-                               'lang_descr'                                    
=> lang('Descr'),
-                               'lang_save'                                     
        => lang('save'),
-                               'lang_done'                                     
        => lang('done'),
-                               'value_id'                                      
        => $id,
-                               'lang_group'                                    
=> lang('group'),
-                               'value_group'                                   
=> $b_account['group'],
+                               'msgbox_data'                           => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
+                               'form_action'                           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uib_account.index&type='.$type),
+                               'lang_id'                               => 
lang('budget account'),
+                               'lang_descr'                            => 
lang('Descr'),
+                               'lang_save'                             => 
lang('save'),
+                               'lang_done'                             => 
lang('done'),
+                               'value_id'                              => $id,
                                'lang_id_b_accounttext'                 => 
lang('Enter the budget account'),
                                'lang_descr_b_accounttext'              => 
lang('Enter a description the budget account'),
                                'lang_done_b_accounttext'               => 
lang('Back to the list'),
                                'lang_save_b_accounttext'               => 
lang('Save the budget account'),
-                               'value_descr'                                   
=> $b_account['descr'],
-                               'lang_responsible'                              
=> lang('Responsible'),
+                               'value_descr'                           => 
$b_account['descr'],
+                               'lang_responsible'                      => 
lang('Responsible'),
                                'lang_user_statustext'                  => 
lang('Select the budget responsible'),
-                               'select_user_name'                              
=> 'values[responsible]',
-                               'lang_no_user'                                  
=> lang('Select responsible'),
-                               'user_list'                                     
        => 
$this->bocommon->get_user_list_right2('select',128,$b_account['responsible'],'.invoice'),
-
+                               'select_user_name'                      => 
'values[responsible]',
+                               'lang_no_user'                          => 
lang('Select responsible'),
+                               'user_list'                             => 
$this->bocommon->get_user_list_right2('select',128,$b_account['responsible'],'.invoice'),
+                               
+                               'lang_category'                         => 
lang('category'),
+                               'lang_no_cat'                           => 
lang('no category'),
+                               'lang_cat_statustext'                   => 
lang('Select the category the selection belongs to. To do not use a category 
select NO CATEGORY'),
+                               'select_name'                           => 
'values[cat_id]',
+                               'cat_list'                              => 
$this->bocommon->select_category_list(array('format'=>'select','selected' => 
$b_account['cat_id'],'type' =>'b_account','order'=>'id')),
                        );
 
                        $appname                                                
= lang('budget account');
Index: property/inc/class.uitts.inc.php
diff -u property/inc/class.uitts.inc.php:1.31 
property/inc/class.uitts.inc.php:1.32
--- property/inc/class.uitts.inc.php:1.31       Fri Mar 10 14:40:11 2006
+++ property/inc/class.uitts.inc.php    Wed Apr 12 10:24:43 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage helpdesk
-       * @version $Id: class.uitts.inc.php,v 1.31 2006/03/10 14:40:11 sigurdne 
Exp $
+       * @version $Id: class.uitts.inc.php,v 1.32 2006/04/12 10:24:43 sigurdne 
Exp $
        */
 
        /**
@@ -757,12 +757,12 @@
                                'lang_done_statustext'                  => 
lang('Back to the ticket list'),
                                'lang_save_statustext'                  => 
lang('Save the ticket'),
                                'lang_no_cat'                                   
=> lang('no category'),
-                               'lang_cat_statustext'                   => 
lang('Select the category the building belongs to. To do not use a category 
select NO CATEGORY'),
+                               'lang_cat_statustext'                   => 
lang('Select the category the selection belongs to. To do not use a category 
select NO CATEGORY'),
                                'select_name'                                   
=> 'values[cat_id]',
                                'lang_town_statustext'                  => 
lang('Select the part of town the building belongs to. To do not use a part of 
town -  select NO PART OF TOWN'),
                                'lang_part_of_town'                             
=> lang('Part of town'),
                                'lang_no_part_of_town'                  => 
lang('No part of town'),
-                               'cat_list'                                      
        => $this->bo->select_category_list('select',$this->cat_id),
+                               'cat_list'                                      
=> $this->bo->select_category_list('select',$this->cat_id),
                                'mailnotification'                              
=> $this->bo->config->config_data['mailnotification'],
                                'lang_mailnotification'                 => 
lang('Send e-mail'),
                                'lang_mailnotification_statustext'      => 
lang('Choose to send mailnotification'),
Index: property/inc/hook_admin.inc.php
diff -u property/inc/hook_admin.inc.php:1.22 
property/inc/hook_admin.inc.php:1.23
--- property/inc/hook_admin.inc.php:1.22        Fri Mar  3 13:00:18 2006
+++ property/inc/hook_admin.inc.php     Wed Apr 12 10:24:43 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage admin
-       * @version $Id: hook_admin.inc.php,v 1.22 2006/03/03 13:00:18 sigurdne 
Exp $
+       * @version $Id: hook_admin.inc.php,v 1.23 2006/04/12 10:24:43 sigurdne 
Exp $
        */
 
                {
@@ -59,6 +59,7 @@
                                'Key location'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uistandard_3.index&type=key_location'),
                                'Branch'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uistandard_3.index&type=branch'),
                                'Accounting'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uib_account.index'),
+                               'Accounting Categories'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uicategory.index&type=b_account'),
                                'Accounting extra'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uicategory.index&type=dim_d'),
                                'Import'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uiXport.import'),
                                'Export'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uiXport.export'),
Index: property/setup/setup.inc.php
diff -u property/setup/setup.inc.php:1.37 property/setup/setup.inc.php:1.38
--- property/setup/setup.inc.php:1.37   Mon Apr 10 14:38:42 2006
+++ property/setup/setup.inc.php        Wed Apr 12 10:24:43 2006
@@ -8,12 +8,12 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage setup
-       * @version $Id: setup.inc.php,v 1.37 2006/04/10 14:38:42 sigurdne Exp $
+       * @version $Id: setup.inc.php,v 1.38 2006/04/12 10:24:43 sigurdne Exp $
        */
 
        $setup_info['property']['name']      = 'property';
        $setup_info['property']['title']         = 'Property';
-       $setup_info['property']['version']   = '0.9.17.517';
+       $setup_info['property']['version']   = '0.9.17.518';
        $setup_info['property']['app_order'] = 8;
        $setup_info['property']['enable']    = 1;
        $setup_info['property']['app_group']    = 'office';
@@ -102,6 +102,7 @@
                'fm_location_config',
                'fm_building_part',
                'fm_b_account',
+               'fm_b_account_category',
                'fm_dim_d',
                'fm_workorder',
                'fm_workorder_category',
Index: property/setup/tables_current.inc.php
diff -u property/setup/tables_current.inc.php:1.55 
property/setup/tables_current.inc.php:1.56
--- property/setup/tables_current.inc.php:1.55  Tue Apr 11 11:39:04 2006
+++ property/setup/tables_current.inc.php       Wed Apr 12 10:24:43 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage setup
-       * @version $Id: tables_current.inc.php,v 1.55 2006/04/11 11:39:04 
sigurdne Exp $
+       * @version $Id: tables_current.inc.php,v 1.56 2006/04/12 10:24:43 
sigurdne Exp $
        */
 
        $phpgw_baseline = array(
@@ -509,7 +509,7 @@
                'fm_b_account' => array(
                        'fd' => array(
                                'id' => array('type' => 'varchar','precision' 
=> '20','nullable' => False),
-                               'grouping' => array('type' => 
'varchar','precision' => '4','nullable' => False),
+                               'category' => array('type' => 'int','precision' 
=> '4','nullable' => False),
                                'descr' => array('type' => 
'varchar','precision' => '100','nullable' => False),
                                'mva' => array('type' => 'int','precision' => 
'4','nullable' => True),
                                'responsible' => array('type' => 
'int','precision' => '4','nullable' => True),
@@ -519,6 +519,16 @@
                        'ix' => array(),
                        'uc' => array()
                ),
+               'fm_b_account_category' => array(
+                       'fd' => array(
+                               'id' => array('type' => 'int','precision' => 
'4','nullable' => False),
+                               'descr' => array('type' => 
'varchar','precision' => '255','nullable' => False)
+                       ),
+                       'pk' => array('id'),
+                       'fk' => array(),
+                       'ix' => array(),
+                       'uc' => array()
+               ),
                'fm_dim_d' => array(
                        'fd' => array(
                                'id' => array('type' => 'int','precision' => 
'4','nullable' => False),
Index: property/setup/tables_update.inc.php
diff -u property/setup/tables_update.inc.php:1.40 
property/setup/tables_update.inc.php:1.41
--- property/setup/tables_update.inc.php:1.40   Tue Apr 11 11:39:05 2006
+++ property/setup/tables_update.inc.php        Wed Apr 12 10:24:43 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage setup
-       * @version $Id: tables_update.inc.php,v 1.40 2006/04/11 11:39:05 
sigurdne Exp $
+       * @version $Id: tables_update.inc.php,v 1.41 2006/04/12 10:24:43 
sigurdne Exp $
        */
 
        /**
@@ -1179,3 +1179,64 @@
                $GLOBALS['setup_info']['property']['currentver'] = '0.9.17.517';
                return $GLOBALS['setup_info']['property']['currentver'];
        }
+
+
+       /**
+       * Update property version from 0.9.17.517 to 0.9.17.518
+       */
+
+       $test[] = '0.9.17.517';
+       function property_upgrade0_9_17_517()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+               $GLOBALS['phpgw_setup']->oProc->CreateTable(            
+                       'fm_b_account_category', array(
+                               'fd' => array(
+                                       'id' => array('type' => 
'int','precision' => '4','nullable' => False),
+                                       'descr' => array('type' => 
'varchar','precision' => '255','nullable' => False)
+                               ),
+                               'pk' => array('id'),
+                               'fk' => array(),
+                               'ix' => array(),
+                               'uc' => array()
+                       )
+               );
+
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_b_account','category',array('type'
 => 'int','precision' => 4,'nullable' => True));
+
+               $sql = "SELECT id, grouping from fm_b_account";
+               $GLOBALS['phpgw_setup']->oProc->query($sql,__LINE__,__FILE__);
+               while ($GLOBALS['phpgw_setup']->oProc->next_record())
+               {
+                       $grouping[]=array(
+                               'id' => $GLOBALS['phpgw_setup']->oProc->f('id'),
+                               'grouping' => 
$GLOBALS['phpgw_setup']->oProc->f('grouping')
+                       );
+               }
+               
+               if (is_array($grouping))
+               {
+                       foreach ($grouping as $entry)
+                       {
+                               if((int)$entry['grouping']>0)
+                               {
+                                       $grouping2[]=$entry['grouping'];
+
+                                       
$GLOBALS['phpgw_setup']->oProc->query("UPDATE fm_b_account set category = ". 
(int)$entry['grouping'] . " WHERE id = " . $entry['id'],__LINE__,__FILE__);
+                               }       
+                               
+                       }
+                       $grouping2 = array_unique($grouping2);
+                       foreach ($grouping2 as $entry)
+                       {
+                                       
$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_b_account_category (id, 
descr) VALUES (" . (int)$entry . ",'" . $entry . "')",__LINE__,__FILE__);
+                       }
+
+               }               
+               
+               
$GLOBALS['phpgw_setup']->oProc->DropColumn('fm_b_account',null,'grouping');
+               
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
+               $GLOBALS['setup_info']['property']['currentver'] = '0.9.17.518';
+               return $GLOBALS['setup_info']['property']['currentver'];
+       }
Index: property/templates/base/b_account.xsl
diff -u property/templates/base/b_account.xsl:1.1 
property/templates/base/b_account.xsl:1.2
--- property/templates/base/b_account.xsl:1.1   Mon Jan 17 10:03:18 2005
+++ property/templates/base/b_account.xsl       Wed Apr 12 10:24:43 2006
@@ -1,4 +1,4 @@
-<!-- $Id: b_account.xsl,v 1.1 2005/01/17 10:03:18 sigurdne Exp $ -->
+<!-- $Id: b_account.xsl,v 1.2 2006/04/12 10:24:43 sigurdne Exp $ -->
 
        <xsl:template name="app_data">
                <xsl:choose>
@@ -166,18 +166,15 @@
                                        </xsl:choose>   
                                </td>
                        </tr>
-                       <xsl:choose>
-                               <xsl:when test="value_id != ''">
-                               <tr>
-                                       <td>
-                                               <xsl:value-of 
select="lang_group"/>
-                                       </td>
-                                       <td >
-                                               <xsl:value-of 
select="value_group"/>
-                                       </td>
-                               </tr>
-                               </xsl:when>
-                       </xsl:choose>   
+                       <tr>
+                               <td>
+                                       <xsl:value-of select="lang_category"/>
+                               </td>
+                               <td>
+                                       <xsl:call-template name="cat_select"/>
+                               </td>
+                       </tr>
+
                        <tr>
                                <td>
                                        <xsl:value-of 
select="lang_responsible"/>




reply via email to

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