fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [7396] property: allow custom attributes on first tab


From: Sigurd Nes
Subject: [Fmsystem-commits] [7396] property: allow custom attributes on first tab
Date: Fri, 17 Jun 2011 13:19:01 +0000

Revision: 7396
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7396
Author:   sigurdne
Date:     2011-06-17 13:19:00 +0000 (Fri, 17 Jun 2011)
Log Message:
-----------
property: allow custom attributes on first tab

Modified Paths:
--------------
    trunk/property/inc/class.uilocation.inc.php
    trunk/property/templates/base/attributes_form.xsl
    trunk/property/templates/base/location.xsl

Modified: trunk/property/inc/class.uilocation.inc.php
===================================================================
--- trunk/property/inc/class.uilocation.inc.php 2011-06-17 13:17:44 UTC (rev 
7395)
+++ trunk/property/inc/class.uilocation.inc.php 2011-06-17 13:19:00 UTC (rev 
7396)
@@ -2006,6 +2006,9 @@
 
                        //_debug_array($attributes_values);
 
+                       $_config                = 
CreateObject('phpgwapi.config','property');
+                       $_config->read();
+
                        $insert_record['extra'][]                               
                = 'cat_id';
 
                        $config_count=count($config);
@@ -2023,8 +2026,11 @@
 
                                        
if($config[$j]['column_name']=='tenant_id')
                                        {
-                                               $edit_tenant=true;
-                                               $insert_record['extra'][]       
= 'tenant_id';
+                                               
if(!isset($_config->config_data['suppress_tenant']) || 
!$_config->config_data['suppress_tenant'])
+                                               {
+                                                       $edit_tenant=true;
+                                                       
$insert_record['extra'][]       = 'tenant_id';
+                                               }
                                        }
 
                                        
if($config[$j]['column_name']=='part_of_town_id')
@@ -2127,17 +2133,23 @@
 
                                $location = ".location.{$type_id}";
                                $attributes_groups = 
$this->bo->get_attribute_groups($location, $values['attributes']);
-                               //_debug_array($attributes_groups);die();
+//     _debug_array($attributes_groups);die();
 
+                               $attributes_general = array();
                                $attributes = array();
                                foreach ($attributes_groups as $group)
                                {
-                                       if(isset($group['attributes']))
+                                       if(isset($group['attributes']) && 
isset($group['group_sort']))
                                        {
                                                $tabs[str_replace(' ', '_', 
$group['name'])] = array('label' => $group['name'], 'link' => '#' . 
str_replace(' ', '_', $group['name']));
                                                $group['link'] = str_replace(' 
', '_', $group['name']);
                                                $attributes[] = $group;
                                        }
+                                       else if(isset($group['attributes']) && 
!isset($group['group_sort']))
+                                       {
+                                               $attributes_general = 
array_merge($attributes_general,$group['attributes']);
+                                       }
+
                                }
                                unset($attributes_groups);
                                unset($values['attributes']);
@@ -2185,8 +2197,6 @@
                                        $documents = json_encode($documents);   
                        
                                }
 
-                               $_config                = 
CreateObject('phpgwapi.config','property');
-                               $_config->read();
                                $_dirname = '';
 
                                $_files_maxlevel = 0;
@@ -2414,6 +2424,7 @@
                                'lang_owner_statustext'                 => 
(isset($lang_owner_statustext)?$lang_owner_statustext:''),
                                'additional_fields'                             
=> $additional_fields,
                                'attributes_group'                              
=> $attributes,
+                               'attributes_general'                    => 
array('attributes' => $attributes_general),
 //                             'attributes_values'                             
=> $values['attributes'],
                                'lookup_functions'                              
=> isset($values['lookup_functions'])?$values['lookup_functions']:'',
                                'lang_none'                                     
        => lang('None'),

Modified: trunk/property/templates/base/attributes_form.xsl
===================================================================
--- trunk/property/templates/base/attributes_form.xsl   2011-06-17 13:17:44 UTC 
(rev 7395)
+++ trunk/property/templates/base/attributes_form.xsl   2011-06-17 13:19:00 UTC 
(rev 7396)
@@ -8,14 +8,13 @@
                <xsl:for-each select="attributes_group" >
                        <div id="{link}">
                                <table cellpadding="2" cellspacing="2" 
width="100%" align="center" border="0">
-                                       <xsl:call-template name="attributes"/>
+                                       <xsl:apply-templates 
select="attributes"/>
                                </table>
                        </div>
                </xsl:for-each>
        </xsl:template>
 
-       <xsl:template name="attributes">
-               <xsl:for-each select="attributes" >
+       <xsl:template match="attributes">
                        <xsl:variable name="statustext"><xsl:value-of 
select="statustext"/></xsl:variable>
                        <tr>
                                <td align="left" width="19%" valign="top" 
title="{$statustext}">
@@ -387,7 +386,6 @@
                                        </xsl:choose>
                                </td>
                        </tr>
-               </xsl:for-each>
        </xsl:template>
 
        <xsl:template name="choice">

Modified: trunk/property/templates/base/location.xsl
===================================================================
--- trunk/property/templates/base/location.xsl  2011-06-17 13:17:44 UTC (rev 
7395)
+++ trunk/property/templates/base/location.xsl  2011-06-17 13:19:00 UTC (rev 
7396)
@@ -459,7 +459,7 @@
                                                                        </tr>
                                                                </xsl:when>
                                                        </xsl:choose>
-
+                                                       <xsl:apply-templates 
select="attributes_general/attributes"/>
                                                </table>
                                        </div>
 




reply via email to

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