[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [11358] property: related at location
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [11358] property: related at location |
Date: |
Tue, 08 Oct 2013 13:59:52 +0000 |
Revision: 11358
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11358
Author: sigurdne
Date: 2013-10-08 13:59:52 +0000 (Tue, 08 Oct 2013)
Log Message:
-----------
property: related at location
Modified Paths:
--------------
trunk/property/inc/class.uilocation.inc.php
trunk/property/js/yahoo/entity.edit.js
trunk/property/js/yahoo/location.edit.js
trunk/property/templates/base/location.xsl
Modified: trunk/property/inc/class.uilocation.inc.php
===================================================================
--- trunk/property/inc/class.uilocation.inc.php 2013-10-08 06:54:58 UTC (rev
11357)
+++ trunk/property/inc/class.uilocation.inc.php 2013-10-08 13:59:52 UTC (rev
11358)
@@ -2229,6 +2229,7 @@
//_debug_array($roles);die();
$related =
$this->bo->read_entity_to_link($location_code);
+//_debug_array($related);die();
$related_link = array();
$location_type_info =
$this->soadmin_location->read_single($type_id);
@@ -2277,6 +2278,8 @@
$tabs['related'] = array('label'
=> lang('related'), 'link' => '#related');
}
+
+// old
foreach($related as $related_key =>
$related_data)
{
if( $related_key == 'gab')
@@ -2306,8 +2309,46 @@
}
}
}
+//end old
+ $_related = array();
+ if(isset($related['related']))
+ {
+ foreach($related as $related_key =>
$related_data)
+ {
+ foreach($related_data as $entry)
+ {
+ $_related[] = array
+ (
+ 'url'
=> "<a href=\"{$entry['entity_link']}\" > {$entry['name']}</a>",
+ );
+ }
+ }
+ }
+ $datavalues = array();
+ $myColumnDefs = array();
+ $datavalues[0] = array
+ (
+ 'name'
=> "0",
+ 'values'
=> json_encode($_related),
+ 'total_records' =>
count($_related),
+ 'edit_action' => "''",
+ 'is_paginator' => 0,
+ 'footer'
=> 0
+ );
+
+ $myColumnDefs[0] = array
+ (
+ 'name' => "0",
+ 'values' =>
json_encode(array(
+ array('key' =>
'url','label'=>lang('where'),'sortable'=>false,'resizeable'=>true),
+ )
+ )
+ );
+
+
+
// ---- START INTEGRATION -------------------------
$location_id =
$GLOBALS['phpgw']->locations->get_id('property', $this->acl_location);
@@ -2486,8 +2527,20 @@
unset($values['attributes']);
+ $property_js = "/property/js/yahoo/property2.js";
+
+ if
(!isset($GLOBALS['phpgw_info']['server']['no_jscombine']) ||
!$GLOBALS['phpgw_info']['server']['no_jscombine'])
+ {
+ $cachedir =
urlencode($GLOBALS['phpgw_info']['server']['temp_dir']);
+ $property_js =
"/phpgwapi/inc/combine.php?cachedir={$cachedir}&type=javascript&files=" .
str_replace('/', '--', ltrim($property_js,'/'));
+ }
+
+
$data = array
(
+ 'property_js'
=> json_encode($GLOBALS['phpgw_info']['server']['webserver_url'] .
$property_js),
+ 'datatable'
=> $datavalues,
+ 'myColumnDefs'
=> $myColumnDefs,
'integration'
=> $integration,
'roles'
=> $roles,
'edit'
=> $view ? '' : true,
@@ -2562,7 +2615,23 @@
);
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/examples/treeview/assets/css/folders/tree.css');
+
+ phpgwapi_yui::load_widget('dragdrop');
+ phpgwapi_yui::load_widget('datatable');
+ phpgwapi_yui::load_widget('menu');
+ phpgwapi_yui::load_widget('connection');
+ phpgwapi_yui::load_widget('loader');
+ phpgwapi_yui::load_widget('tabview');
+ phpgwapi_yui::load_widget('paginator');
+ phpgwapi_yui::load_widget('animation');
+
+
phpgwapi_yui::load_widget('treeview');
+
+
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/datatable/assets/skins/sam/datatable.css');
+
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/paginator/assets/skins/sam/paginator.css');
+
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/container/assets/skins/sam/container.css');
+
$GLOBALS['phpgw']->js->validate_file( 'yahoo',
'location.edit', 'property' );
$appname = lang('location');
Modified: trunk/property/js/yahoo/entity.edit.js
===================================================================
--- trunk/property/js/yahoo/entity.edit.js 2013-10-08 06:54:58 UTC (rev
11357)
+++ trunk/property/js/yahoo/entity.edit.js 2013-10-08 13:59:52 UTC (rev
11358)
@@ -1,5 +1,5 @@
var myDataSource, myDataTable, myContextMenu;
-var myPaginator_0, myDataTable_0
+var myPaginator_0, myDataTable_0;
var myPaginator_1, myDataTable_1;
var myPaginator_2, myDataTable_2;
var myPaginator_3, myDataTable_3;
Modified: trunk/property/js/yahoo/location.edit.js
===================================================================
--- trunk/property/js/yahoo/location.edit.js 2013-10-08 06:54:58 UTC (rev
11357)
+++ trunk/property/js/yahoo/location.edit.js 2013-10-08 13:59:52 UTC (rev
11358)
@@ -1,3 +1,19 @@
+
+var myPaginator_0, myDataTable_0;
+
+YAHOO.util.Event.addListener(window, "load", function()
+ {
+ var loader = new YAHOO.util.YUILoader();
+ loader.addModule({
+ name: "anyone",
+ type: "js",
+ fullpath: property_js
+ });
+
+ loader.require("anyone");
+ loader.insert();
+ });
+
//an anonymous function wraps our code to keep our variables
//in function scope rather than in the global namespace:
(function() {
Modified: trunk/property/templates/base/location.xsl
===================================================================
--- trunk/property/templates/base/location.xsl 2013-10-08 06:54:58 UTC (rev
11357)
+++ trunk/property/templates/base/location.xsl 2013-10-08 13:59:52 UTC (rev
11358)
@@ -272,6 +272,35 @@
self.name="first_Window";
<xsl:value-of select="lookup_functions"/>
</script>
+
+ <script type="text/javascript">
+ function set_tab(active_tab)
+ {
+ document.form.active_tab.value = active_tab;
+ }
+
+ var property_js = <xsl:value-of select="property_js"/>;
+ // var base_java_url = <xsl:value-of
select="base_java_url"/>;
+ var datatable = new Array();
+ var myColumnDefs = new Array();
+
+ <xsl:for-each select="datatable">
+ datatable[<xsl:value-of select="name"/>] = [
+ {
+ values:<xsl:value-of
select="values"/>,
+ total_records: <xsl:value-of
select="total_records"/>,
+ edit_action: <xsl:value-of
select="edit_action"/>,
+ is_paginator: <xsl:value-of
select="is_paginator"/>,
+ footer:<xsl:value-of
select="footer"/>
+ }
+ ]
+ </xsl:for-each>
+
+ <xsl:for-each select="myColumnDefs">
+ myColumnDefs[<xsl:value-of select="name"/>] =
<xsl:value-of select="values"/>
+ </xsl:for-each>
+ </script>
+
<div class="yui-navset" id="location_edit_tabview">
<xsl:variable name="form_action">
<xsl:value-of select="form_action"/>
@@ -565,10 +594,17 @@
</table>
</td>
</tr>
+ <tr>
+
<td>
+
<div id="datatable-container_0"/>
+
</td>
+ </tr>
</table>
+
</div>
</xsl:when>
</xsl:choose>
+
<xsl:for-each select="integration">
<div id="{section}">
<iframe
id="{section}_content" width="100%" height="{height}">
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [11358] property: related at location,
Sigurd Nes <=