fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [10363] property: more on custom attribute groups


From: Sigurd Nes
Subject: [Fmsystem-commits] [10363] property: more on custom attribute groups
Date: Mon, 29 Oct 2012 10:02:24 +0000

Revision: 10363
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10363
Author:   sigurdne
Date:     2012-10-29 10:02:23 +0000 (Mon, 29 Oct 2012)
Log Message:
-----------
property: more on custom attribute groups

Modified Paths:
--------------
    trunk/phpgwapi/inc/class.custom_fields.inc.php
    trunk/property/inc/class.uientity.inc.php
    trunk/property/templates/base/attributes_form.xsl

Modified: trunk/phpgwapi/inc/class.custom_fields.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.custom_fields.inc.php      2012-10-29 08:11:44 UTC 
(rev 10362)
+++ trunk/phpgwapi/inc/class.custom_fields.inc.php      2012-10-29 10:02:23 UTC 
(rev 10363)
@@ -1191,6 +1191,7 @@
                                        'id'                            => 
$group['id'],
                                        'name'                          => 
$group['name'],
                                        'parent_id'                     => 0,
+                                       'level'                         => 0,
                                        'group_sort'            => 
$group['group_sort'],
                                        'group_sort_text'       => 
$group['group_sort'],
                                        'descr'                         => 
$group['descr'],
@@ -1250,6 +1251,7 @@
                                        'id'                            => $id,
                                        'name'                          => 
str_repeat('..',$level).$db->f('name'),
                                        'parent_id'                     => 
$db->f('parent_id'),
+                                       'level'                         => 
$level,
                                        'group_sort'            => $group_sort,
                                        'group_sort_text'       => 
$group_sort_text,
                                        'descr'                         => 
$db->f('descr'),

Modified: trunk/property/inc/class.uientity.inc.php
===================================================================
--- trunk/property/inc/class.uientity.inc.php   2012-10-29 08:11:44 UTC (rev 
10362)
+++ trunk/property/inc/class.uientity.inc.php   2012-10-29 10:02:23 UTC (rev 
10363)
@@ -1682,16 +1682,31 @@
                                $attributes_groups = 
$this->bo->get_attribute_groups($location, $values['attributes']);
 
                                $attributes_general = array();
+                               $i = -1;
                                $attributes = array();
-                               foreach ($attributes_groups as $group)
+                               foreach ($attributes_groups as $_key => $group)
                                {
                                        if(isset($group['attributes']) && 
(isset($group['group_sort']) || !$location_data))
                                        {
-                                               $_tab_name = str_replace(' ', 
'_', $group['name']);
-                                               $active_tab = $active_tab ? 
$active_tab : $_tab_name;
-                                               $tabs[$_tab_name] = 
array('label' => $group['name'], 'link' => '#' . $_tab_name);
-                                               $group['link'] = $_tab_name;
-                                               $attributes[] = $group;
+                                               if($group['level'] == 0)
+                                               {
+                                                       $_tab_name = 
str_replace(' ', '_', $group['name']);
+                                                       $active_tab = 
$active_tab ? $active_tab : $_tab_name;
+                                                       $tabs[$_tab_name] = 
array('label' => $group['name'], 'link' => '#' . $_tab_name);
+                                                       $group['link'] = 
$_tab_name;
+                                                       $attributes[] = $group;
+                                                       $i ++;
+                                               }
+                                               else
+                                               {
+                                                       
$attributes[$i]['attributes'][] = array
+                                                       (
+                                                               'datatype' => 
'section',
+                                                               'descr' => 
"<H{$group['level']}> {$group['descr']} </H{$group['level']}>",
+                                                               'level' => 
$group['level'],
+                                                       );
+                                                       
$attributes[$i]['attributes'] = array_merge($attributes[$i]['attributes'], 
$group['attributes']);
+                                               }
                                                unset($_tab_name);
                                        }
                                        else if(isset($group['attributes']) && 
!isset($group['group_sort']) && $location_data)
@@ -1699,6 +1714,7 @@
                                                $attributes_general = 
array_merge($attributes_general,$group['attributes']);
                                        }
                                }
+
                                unset($attributes_groups);
 
                                if($category['fileupload'] || 
(isset($values['files']) &&  $values['files']))
@@ -1963,7 +1979,7 @@
                                }
                        }
 
-
+//_debug_array($attributes);die();
                        $data = array
                                (
                                        'property_js'                           
        => 
json_encode($GLOBALS['phpgw_info']['server']['webserver_url']."/property/js/yahoo/property2.js"),

Modified: trunk/property/templates/base/attributes_form.xsl
===================================================================
--- trunk/property/templates/base/attributes_form.xsl   2012-10-29 08:11:44 UTC 
(rev 10362)
+++ trunk/property/templates/base/attributes_form.xsl   2012-10-29 10:02:23 UTC 
(rev 10363)
@@ -21,6 +21,17 @@
                <xsl:variable name="statustext">
                        <xsl:value-of select="statustext"/>
                </xsl:variable>
+
+               <xsl:choose>
+                       <xsl:when test="datatype='section'">
+                               <tr>
+                                       <td colspan='2'>
+                                               <xsl:value-of select="descr" 
disable-output-escaping="yes"/>                            
+                                       </td>
+                               </tr>
+                       </xsl:when>
+               </xsl:choose>
+
                <tr>
                        <td align="left" width="19%" valign="top" 
title="{$statustext}">
                                <xsl:choose>
@@ -388,11 +399,11 @@
                                                                </input>
                                                        </xsl:when>
                                                        <xsl:when 
test="datatype='DT'">
-                                                                               
        <xsl:variable name="clear_function">
-                                                                               
                <xsl:text>clear_</xsl:text>
-                                                                               
                <xsl:value-of select="name"/>
-                                                                               
                <xsl:text>();</xsl:text>
-                                                                               
        </xsl:variable>
+                                                               <xsl:variable 
name="clear_function">
+                                                                       
<xsl:text>clear_</xsl:text>
+                                                                       
<xsl:value-of select="name"/>
+                                                                       
<xsl:text>();</xsl:text>
+                                                               </xsl:variable>
 
                                                                <table>
                                                                        <tr>




reply via email to

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