[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [11163] add relation to components
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [11163] add relation to components |
Date: |
Mon, 10 Jun 2013 18:54:04 +0000 |
Revision: 11163
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11163
Author: sigurdne
Date: 2013-06-10 18:54:03 +0000 (Mon, 10 Jun 2013)
Log Message:
-----------
add relation to components
Modified Paths:
--------------
trunk/controller/inc/class.uicontrol_group.inc.php
trunk/controller/templates/base/control_group/control_group.xsl
Modified: trunk/controller/inc/class.uicontrol_group.inc.php
===================================================================
--- trunk/controller/inc/class.uicontrol_group.inc.php 2013-06-09 19:40:44 UTC
(rev 11162)
+++ trunk/controller/inc/class.uicontrol_group.inc.php 2013-06-10 18:54:03 UTC
(rev 11163)
@@ -529,8 +529,43 @@
}
phpgwapi_yui::tabview_setup('control_group_tabview');
+
+
+ //--- sigurd 10.juni 13
+ $entity_list =
execMethod('property.soadmin_entity.read', array('allrows' => true));
+ array_unshift($entity_list,array
('id'=>'','name'=> lang('select value')));
+
+ if($location_id)
+ {
+ $loc_arr =
$GLOBALS['phpgw']->locations->get_name($location_id);
+ $entity_arr =
explode('.',$loc_arr['location']);
+
+ $entity =
$entity_so->read_single($entity_arr[2]);
+ $category =
$entity_so->read_single_category($entity_arr[2],$entity_arr[3]);
+ foreach ($entity_list as &$e)
+ {
+ if($e['id'] == $entity['id'])
+ {
+ $e['selected'] = 1;
+ }
+ }
+ $category_list =
$entity_so->read_category(array('allrows'=>true,'entity_id'=>$entity_arr[2]));
+ foreach ($category_list as &$c)
+ {
+ if($c['id'] == $category['id'])
+ {
+ $c['selected'] = 1;
+ }
+ }
+ }
+ //---
+
+
$data = array
(
+ 'entities' => $entity_list,
+ 'categories' => $category_list,
+
'tabs'
=> phpgwapi_yui::tabview_generate($tabs, $tab_to_display),
'value_id'
=> !empty($control_group) ? $control_group->get_id() : 0,
'editable'
=> true,
@@ -557,6 +592,7 @@
self::add_javascript('controller', 'yahoo',
'control_tabs.js');
self::add_javascript('controller',
'controller', 'ajax.js');
+ self::add_javascript('logistic', 'logistic',
'resource_type_requirement.js');
self::render_template_xsl(array('control_group/control_group_tabs','control_group/control_group','control_group/control_group_items'),
$data);
}
}
Modified: trunk/controller/templates/base/control_group/control_group.xsl
===================================================================
--- trunk/controller/templates/base/control_group/control_group.xsl
2013-06-09 19:40:44 UTC (rev 11162)
+++ trunk/controller/templates/base/control_group/control_group.xsl
2013-06-10 18:54:03 UTC (rev 11163)
@@ -67,8 +67,56 @@
</xsl:otherwise>
</xsl:choose>
</dd>
+ <xsl:choose>
+ <xsl:when test="editable">
+ <dt>
+
<label><xsl:value-of select="php:function('lang', 'Entity')" /></label>
+ </dt>
+ <dd>
+ <select
name="entity_id" id="entity_id">
+
<xsl:for-each select="entities">
+
<option value="{id}">
+
<xsl:if test="selected">
+
<xsl:attribute name="selected" value="selected" />
+
</xsl:if>
+
<xsl:value-of select="name"/>
+
</option>
+
</xsl:for-each>
+ </select>
+ </dd>
+ <dt>
+
<label><xsl:value-of select="php:function('lang', 'Category')" /></label>
+ </dt>
+ <dd>
+ <select
name="category_id" id="category_id">
+
<xsl:for-each select="categories">
+
<option value="{id}">
+
<xsl:if test="selected">
+
<xsl:attribute name="selected" value="selected" />
+
</xsl:if>
+
<xsl:value-of select="name"/>
+
</option>
+
</xsl:for-each>
+ </select>
+ </dd>
+ </xsl:when>
+ <xsl:otherwise>
+ <dt>
+
<label><xsl:value-of select="php:function('lang', 'Entity')" /></label>
+ </dt>
+ <dd>
+ <xsl:value-of
select="entity/name" />
+ </dd>
+ <dt>
+
<label><xsl:value-of select="php:function('lang', 'Category')" /></label>
+ </dt>
+ <dd>
+ <xsl:value-of
select="category/name" />
+ </dd>
+ </xsl:otherwise>
+ </xsl:choose>
</dl>
-
+
<div class="form-buttons">
<xsl:choose>
<xsl:when test="editable">
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [11163] add relation to components,
Sigurd Nes <=