fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [10794] catch / property: prepare for enable bulk ent


From: Sigurd Nes
Subject: [Fmsystem-commits] [10794] catch / property: prepare for enable bulk entities
Date: Mon, 11 Feb 2013 14:30:16 +0000

Revision: 10794
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10794
Author:   sigurdne
Date:     2013-02-11 14:30:13 +0000 (Mon, 11 Feb 2013)
Log Message:
-----------
catch / property: prepare for enable bulk entities

Modified Paths:
--------------
    trunk/catch/setup/setup.inc.php
    trunk/catch/setup/tables_current.inc.php
    trunk/catch/setup/tables_update.inc.php
    trunk/property/inc/class.soadmin_entity.inc.php
    trunk/property/inc/class.uiadmin_entity.inc.php
    trunk/property/setup/setup.inc.php
    trunk/property/setup/tables_current.inc.php
    trunk/property/setup/tables_update.inc.php
    trunk/property/templates/base/admin_entity.xsl

Modified: trunk/catch/setup/setup.inc.php
===================================================================
--- trunk/catch/setup/setup.inc.php     2013-02-11 14:02:18 UTC (rev 10793)
+++ trunk/catch/setup/setup.inc.php     2013-02-11 14:30:13 UTC (rev 10794)
@@ -27,7 +27,7 @@
         */
 
        $setup_info['catch']['name']                    = 'catch';
-       $setup_info['catch']['version']                 = '0.9.17.514';
+       $setup_info['catch']['version']                 = '0.9.17.515';
        $setup_info['catch']['app_order']               = 20;
        $setup_info['catch']['enable']                  = 1;
        $setup_info['catch']['globals_checked'] = True;

Modified: trunk/catch/setup/tables_current.inc.php
===================================================================
--- trunk/catch/setup/tables_current.inc.php    2013-02-11 14:02:18 UTC (rev 
10793)
+++ trunk/catch/setup/tables_current.inc.php    2013-02-11 14:30:13 UTC (rev 
10794)
@@ -59,6 +59,7 @@
                                'start_project' => array('type' => 
'int','precision' => '4','nullable' => True),
                                'start_ticket' => array('type' => 
'int','precision' => '2','nullable' => True),
                                'is_eav' => array('type' => 'int','precision' 
=> '2','nullable' => True),
+                               'enable_bulk' => array('type' => 
'int','precision' => '2','nullable' => True),
                                'jasperupload' => array('type' => 
'int','precision' => 2,'nullable' => True),
                                'parent_id' => array('type' => 
'int','precision' => '4','nullable' => True),
                                'level' => array('type' => 'int','precision' => 
'4','nullable' => True),

Modified: trunk/catch/setup/tables_update.inc.php
===================================================================
--- trunk/catch/setup/tables_update.inc.php     2013-02-11 14:02:18 UTC (rev 
10793)
+++ trunk/catch/setup/tables_update.inc.php     2013-02-11 14:30:13 UTC (rev 
10794)
@@ -463,3 +463,23 @@
                        return $GLOBALS['setup_info']['catch']['currentver'];
                }
        }
+
+       /**
+       * Update catch version from 0.9.17.514 to 0.9.17.515
+       * Add bulk-flag to entities
+       */
+
+       $test[] = '0.9.17.514';
+       function catch_upgrade0_9_17_514()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_catch_category','enable_bulk',array('type'
 => 'int','precision' => 2,'nullable' => True));
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['catch']['currentver'] = 
'0.9.17.515';
+                       return $GLOBALS['setup_info']['catch']['currentver'];
+               }
+       }
+

Modified: trunk/property/inc/class.soadmin_entity.inc.php
===================================================================
--- trunk/property/inc/class.soadmin_entity.inc.php     2013-02-11 14:02:18 UTC 
(rev 10793)
+++ trunk/property/inc/class.soadmin_entity.inc.php     2013-02-11 14:30:13 UTC 
(rev 10794)
@@ -127,25 +127,22 @@
 
                function read_category($data)
                {
-                       if(is_array($data))
-                       {
-                               $start          = isset($data['start'])&& 
$data['start'] ? $data['start'] : 0;
-                               $query          = 
isset($data['query'])?$data['query']:'';
-                               $sort           = 
isset($data['sort'])?$data['sort']:'DESC';
-                               $order          = 
isset($data['order'])?$data['order']:'';
-                               $allrows        = 
isset($data['allrows'])?$data['allrows']:'';
-                               $entity_id      = isset($data['entity_id'])? 
(int)$data['entity_id']:0;
-                               $type           = isset($data['type']) && 
$data['type'] ? $data['type'] : $this->type;
-                               $required       = 
isset($data['required'])?$data['required']:'';
-                       }
+                       $start          = isset($data['start'])&& 
$data['start'] ? $data['start'] : 0;
+                       $query          = 
isset($data['query'])?$data['query']:'';
+                       $sort           = 
isset($data['sort'])?$data['sort']:'DESC';
+                       $order          = 
isset($data['order'])?$data['order']:'';
+                       $allrows        = 
isset($data['allrows'])?$data['allrows']:'';
+                       $entity_id      = isset($data['entity_id'])? 
(int)$data['entity_id']:0;
+                       $type           = isset($data['type']) && $data['type'] 
? $data['type'] : $this->type;
+                       $required       = 
isset($data['required'])?$data['required']:'';
 
                        if ($order)
                        {
-                               $ordermethod = " order by $order $sort";
+                               $ordermethod = " ORDER BY {$order} {$sort}";
                        }
                        else
                        {
-                               $ordermethod = ' order by id asc';
+                               $ordermethod = ' ORDER BY id ASC';
                        }
 
                        $table = "fm_{$type}_category";
@@ -154,7 +151,7 @@
                        if($query)
                        {
                                $query = $this->db->db_addslashes($query);
-                               $querymethod = " AND name {$this->like} 
'%{$query}%' or descr {$this->like} '%{$query}%'";
+                               $querymethod = " AND name {$this->like} 
'%{$query}%' OR descr {$this->like} '%{$query}%'";
                        }
 
                        $sql = "SELECT * FROM {$table} WHERE 
entity_id={$entity_id} {$querymethod}";
@@ -177,14 +174,15 @@
                                $id     = $this->db2->f('id');
                                $category = array
                                (
-                                       'entity_id'     => $entity_id,
-                                       'id'            => $id,
-                                       'name'          => 
$this->db2->f('name'),
-                                       'prefix'        => 
$this->db2->f('prefix'),
-                                       'descr'         => 
$this->db2->f('descr'),
-                                       'level'         => 
$this->db2->f('level'),
-                                       'parent_id'     => 
$this->db2->f('parent_id'),
-                                       'is_eav'        => 
$this->db2->f('is_eav'),
+                                       'entity_id'             => $entity_id,
+                                       'id'                    => $id,
+                                       'name'                  => 
$this->db2->f('name'),
+                                       'prefix'                => 
$this->db2->f('prefix'),
+                                       'descr'                 => 
$this->db2->f('descr'),
+                                       'level'                 => 
$this->db2->f('level'),
+                                       'parent_id'             => 
$this->db2->f('parent_id'),
+                                       'is_eav'                => 
$this->db2->f('is_eav'),
+                                       'enable_bulk'   => 
$this->db2->f('enable_bulk'),
                                );
 
                                if($required)
@@ -449,6 +447,7 @@
                                        'start_project'                         
=> $this->db->f('start_project'),
                                        'start_ticket'                          
=> $this->db->f('start_ticket'),
                                        'is_eav'                                
        => $this->db->f('is_eav'),
+                                       'enable_bulk'                           
=> $this->db->f('enable_bulk'),
                                        'jasperupload'                          
=> $this->db->f('jasperupload'),
                                        'parent_id'                             
        => $this->db->f('parent_id'),
                                        'level'                                 
        => $this->db->f('level')
@@ -574,6 +573,7 @@
                                        $values['start_project'],
                                        $values['start_ticket'],
                                        $values['is_eav'],
+                                       $values['enable_bulk'],
                                        $values['jasperupload'],
                                        $values['parent_id'],
                                        $level
@@ -581,7 +581,7 @@
 
                        $values_insert  = 
$this->db->validate_insert($values_insert);
 
-                       $this->db->query("INSERT INTO {$table} 
(location_id,entity_id,id,name, 
descr,prefix,lookup_tenant,tracking,location_level,location_link_level,fileupload,loc_link,start_project,start_ticket,is_eav,jasperupload,parent_id,level
 ) "
+                       $this->db->query("INSERT INTO {$table} 
(location_id,entity_id,id,name, 
descr,prefix,lookup_tenant,tracking,location_level,location_link_level,fileupload,loc_link,start_project,start_ticket,is_eav,enable_bulk,jasperupload,parent_id,level
 ) "
                                . "VALUES ($values_insert)",__LINE__,__FILE__);
 
 
@@ -794,6 +794,7 @@
                                                'start_project'                 
        => $entity['start_project'],
                                                'start_ticket'                  
        => $entity['start_ticket'],
                                                'is_eav'                        
                => $entity['is_eav'],
+                                               'enable_bulk'                   
        => $entity['enable_bulk'],
                                                'jasperupload'                  
        => $entity['jasperupload'],
                                                'parent_id'                     
                => $entity['parent_id'],
                                                'level'                         
                => $level

Modified: trunk/property/inc/class.uiadmin_entity.inc.php
===================================================================
--- trunk/property/inc/class.uiadmin_entity.inc.php     2013-02-11 14:02:18 UTC 
(rev 10793)
+++ trunk/property/inc/class.uiadmin_entity.inc.php     2013-02-11 14:30:13 UTC 
(rev 10794)
@@ -547,6 +547,8 @@
                        $uicols['descr'][5]     = lang('id');
                        $uicols['name'][6]      = 'is_eav';
                        $uicols['descr'][6]     = lang('is_eav');
+                       $uicols['name'][6]      = 'enable_bulk';
+                       $uicols['descr'][6]     = lang('enable bulk');
                        $j = 0;
                        $count_uicols_name = count($uicols['name']);
 
@@ -1178,6 +1180,7 @@
                                        'start_ticket'                          
                => true,
                                        'value_start_ticket'                    
        => $values['start_ticket'],
                                        'value_is_eav'                          
                => $values['is_eav'],
+                                       'value_enable_bulk'                     
                => $values['enable_bulk'],
                                        'jasperupload'                          
                => true,
                                        'category_list'                         
                => $category_list,
                                        'parent_list'                           
                => $parent_list

Modified: trunk/property/setup/setup.inc.php
===================================================================
--- trunk/property/setup/setup.inc.php  2013-02-11 14:02:18 UTC (rev 10793)
+++ trunk/property/setup/setup.inc.php  2013-02-11 14:30:13 UTC (rev 10794)
@@ -12,7 +12,7 @@
        */
 
        $setup_info['property']['name']                 = 'property';
-       $setup_info['property']['version']              = '0.9.17.664';
+       $setup_info['property']['version']              = '0.9.17.665';
        $setup_info['property']['app_order']    = 8;
        $setup_info['property']['enable']               = 1;
        $setup_info['property']['app_group']    = 'office';

Modified: trunk/property/setup/tables_current.inc.php
===================================================================
--- trunk/property/setup/tables_current.inc.php 2013-02-11 14:02:18 UTC (rev 
10793)
+++ trunk/property/setup/tables_current.inc.php 2013-02-11 14:30:13 UTC (rev 
10794)
@@ -1840,6 +1840,7 @@
                                'start_project' => array('type' => 
'int','precision' => '4','nullable' => True),
                                'start_ticket' => array('type' => 
'int','precision' => '2','nullable' => True),
                                'is_eav' => array('type' => 'int','precision' 
=> '2','nullable' => True),
+                               'enable_bulk' => array('type' => 
'int','precision' => '2','nullable' => True),
                                'jasperupload' => array('type' => 
'int','precision' => '2','nullable' => True),
                                'parent_id' => array('type' => 
'int','precision' => '4','nullable' => True),
                                'level' => array('type' => 'int','precision' => 
'4','nullable' => True)

Modified: trunk/property/setup/tables_update.inc.php
===================================================================
--- trunk/property/setup/tables_update.inc.php  2013-02-11 14:02:18 UTC (rev 
10793)
+++ trunk/property/setup/tables_update.inc.php  2013-02-11 14:30:13 UTC (rev 
10794)
@@ -7361,4 +7361,25 @@
                }
        }
 
+       /**
+       * Update property version from 0.9.17.664 to 0.9.17.665
+       * Add bulk-flag to entities
+       */
+       $test[] = '0.9.17.664';
+       function property_upgrade0_9_17_664()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
 
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_entity_category','enable_bulk',array(
+                               'type' =>       'int',
+                               'precision' => 2,
+                               'nullable' => true
+                       )
+               );
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['property']['currentver'] = 
'0.9.17.665';
+                       return $GLOBALS['setup_info']['property']['currentver'];
+               }
+       }

Modified: trunk/property/templates/base/admin_entity.xsl
===================================================================
--- trunk/property/templates/base/admin_entity.xsl      2013-02-11 14:02:18 UTC 
(rev 10793)
+++ trunk/property/templates/base/admin_entity.xsl      2013-02-11 14:30:13 UTC 
(rev 10794)
@@ -767,35 +767,52 @@
                                                                        </input>
                                                                </td>
                                                        </tr>
-                                                       <tr>
-                                                               <td>
-                                                                       
<xsl:value-of select="php:function('lang', 'is eav')"/>
-                                                               </td>
-                                                               <td>
-                                                                       <input 
type="checkbox" name="values[is_eav]" value="1">
-                                                                               
<xsl:attribute name="title">
-                                                                               
        <xsl:value-of select="php:function('lang', 'This category is modelled 
in the database as a xml adapted entity attribute value model')"/>
-                                                                               
</xsl:attribute>
-                                                                               
<xsl:if test="value_is_eav = '1'">
-                                                                               
        <xsl:attribute name="checked">
-                                                                               
                <xsl:text>checked</xsl:text>
-                                                                               
        </xsl:attribute>
-                                                                               
</xsl:if>
-                                                                               
<xsl:if test="value_is_eav = '1' or value_id != ''">
-                                                                               
        <xsl:attribute name="disabled">
-                                                                               
                <xsl:text>disabled</xsl:text>
-                                                                               
        </xsl:attribute>
-                                                                               
</xsl:if>
-                                                                       </input>
-                                                                       
<xsl:choose>
-                                                                               
<xsl:when test="value_is_eav = '1'">
-                                                                               
        <input type="hidden" name="values[is_eav]" value="1"/>
-                                                                               
</xsl:when>
-                                                                       
</xsl:choose>
-                                                               </td>
-                                                       </tr>
                                                </xsl:when>
                                        </xsl:choose>
+                                       <tr>
+                                               <td>
+                                                       <xsl:value-of 
select="php:function('lang', 'is eav')"/>
+                                               </td>
+                                               <td>
+                                                       <input type="checkbox" 
name="values[is_eav]" value="1">
+                                                               <xsl:attribute 
name="title">
+                                                                       
<xsl:value-of select="php:function('lang', 'This category is modelled in the 
database as a xml adapted entity attribute value model')"/>
+                                                               </xsl:attribute>
+                                                               <xsl:if 
test="value_is_eav = '1'">
+                                                                       
<xsl:attribute name="checked">
+                                                                               
<xsl:text>checked</xsl:text>
+                                                                       
</xsl:attribute>
+                                                               </xsl:if>
+                                                               <xsl:if 
test="value_is_eav = '1' or value_id != ''">
+                                                                       
<xsl:attribute name="disabled">
+                                                                               
<xsl:text>disabled</xsl:text>
+                                                                       
</xsl:attribute>
+                                                               </xsl:if>
+                                                       </input>
+                                                       <xsl:choose>
+                                                               <xsl:when 
test="value_is_eav = '1'">
+                                                                       <input 
type="hidden" name="values[is_eav]" value="1"/>
+                                                               </xsl:when>
+                                                       </xsl:choose>
+                                               </td>
+                                       </tr>
+                                       <tr>
+                                               <td>
+                                                       <xsl:value-of 
select="php:function('lang', 'enable bulk')"/>
+                                               </td>
+                                               <td>
+                                                       <input type="checkbox" 
name="values[enable_bulk]" value="1">
+                                                               <xsl:attribute 
name="title">
+                                                                       
<xsl:value-of select="php:function('lang', 'This category is allowed to 
reperesent bulk entities')"/>
+                                                               </xsl:attribute>
+                                                               <xsl:if 
test="value_enable_bulk = '1'">
+                                                                       
<xsl:attribute name="checked">
+                                                                               
<xsl:text>checked</xsl:text>
+                                                                       
</xsl:attribute>
+                                                               </xsl:if>
+                                                       </input>
+                                               </td>
+                                       </tr>
                                        <xsl:choose>
                                                <xsl:when 
test="lang_location_level != ''">
                                                        <tr>




reply via email to

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