[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [10518] property: target-link at enitities
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [10518] property: target-link at enitities |
Date: |
Mon, 19 Nov 2012 22:26:39 +0000 |
Revision: 10518
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10518
Author: sigurdne
Date: 2012-11-19 22:26:38 +0000 (Mon, 19 Nov 2012)
Log Message:
-----------
property: target-link at enitities
Modified Paths:
--------------
trunk/property/inc/class.interlink.inc.php
trunk/property/inc/class.uientity.inc.php
trunk/property/templates/base/entity.xsl
Modified: trunk/property/inc/class.interlink.inc.php
===================================================================
--- trunk/property/inc/class.interlink.inc.php 2012-11-19 18:54:33 UTC (rev
10517)
+++ trunk/property/inc/class.interlink.inc.php 2012-11-19 22:26:38 UTC (rev
10518)
@@ -77,10 +77,10 @@
switch( $role )
{
case 'target':
- $sql = "SELECT location2_id as
linkend_location, location2_item_id as linkend_id FROM phpgw_interlink WHERE
location1_id = {$location_id} AND location1_item_id = {$id} ORDER by
location2_id DESC";
+ $sql = "SELECT location2_id as
linkend_location, location2_item_id as linkend_id, account_id,entry_date FROM
phpgw_interlink WHERE location1_id = {$location_id} AND location1_item_id =
{$id} ORDER by location2_id DESC";
break;
default:
- $sql = "SELECT location1_id as
linkend_location, location1_item_id as linkend_id FROM phpgw_interlink WHERE
location2_id = {$location_id} AND location2_item_id = {$id} ORDER by
location1_id DESC";
+ $sql = "SELECT location1_id as
linkend_location, location1_item_id as linkend_id, account_id,entry_date FROM
phpgw_interlink WHERE location2_id = {$location_id} AND location2_item_id =
{$id} ORDER by location1_id DESC";
}
$this->_db->query($sql,__LINE__,__FILE__);
@@ -95,7 +95,12 @@
$i++;
}
$relation[$i]['linkend_location'] =
$this->_db->f('linkend_location');
- $relation[$i]['data'][] = array( 'id' =>
$this->_db->f('linkend_id'));
+ $relation[$i]['data'][] = array
+ (
+ 'id' =>
$this->_db->f('linkend_id'),
+ 'account_id' =>
$this->_db->f('account_id'),
+ 'entry_date' =>
$this->_db->f('entry_date')
+ );
$last_type = $this->_db->f('linkend_location');
}
Modified: trunk/property/inc/class.uientity.inc.php
===================================================================
--- trunk/property/inc/class.uientity.inc.php 2012-11-19 18:54:33 UTC (rev
10517)
+++ trunk/property/inc/class.uientity.inc.php 2012-11-19 22:26:38 UTC (rev
10518)
@@ -1907,12 +1907,16 @@
);
$myColumnDefs[0] = array
- (
- 'name' => "0",
- 'values' =>
json_encode(array( array('key' =>
'file_name','label'=>lang('Filename'),'sortable'=>false,'resizeable'=>true),
- array('key' =>
'delete_file','label'=>lang('Delete
file'),'sortable'=>false,'resizeable'=>true,'formatter'=>'FormatterCenter')))
- );
+ (
+ 'name' => "0",
+ 'values' => json_encode(array(
array('key' =>
'file_name','label'=>lang('Filename'),'sortable'=>false,'resizeable'=>true),
+ array('key' =>
'delete_file','label'=>lang('Delete
file'),'sortable'=>false,'resizeable'=>true,'formatter'=>'FormatterCenter')))
+ );
+
+
+//_Debug_Array($datavalues);
+//die();
/*
$link_file_data['jasper'] = true;
$content_jasperfiles = array();
@@ -1965,35 +1969,92 @@
}
}
+ $tabs['related'] = array('label' =>
lang('related'), 'link' => '#related');
+ $_target = array();
+ if(isset($values['target']) &&
$values['target'])
+ {
+ foreach($values['target'] as
$_target_section)
+ {
+ foreach
($_target_section['data'] as $_target_entry)
+ {
+ $_target[] = array
+ (
+ 'url'
=> "<a href=\"{$_target_entry['link']}\" > {$_target_entry['id']}</a>",
+ 'type'
=> $_target_section['descr'],
+ 'status'
=> $_target_entry['statustext'],
+ 'user'
=> $GLOBALS['phpgw']->accounts->get($_target_entry['account_id'])->__toString(),
+ 'entry_date'=>
$GLOBALS['phpgw']->common->show_date($_target_entry['entry_date'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']),
+ );
+ }
+ }
+ }
+
$related =
$this->bo->read_entity_to_link(array('entity_id'=>$this->entity_id,'cat_id'=>$this->cat_id,'id'=>$values['num']));
- $related_link = array();
+ $_related = array();
if(isset($related['related']))
{
- $tabs['related'] = array('label'
=> lang('related'), 'link' => '#related');
-
foreach($related as $related_key =>
$related_data)
{
foreach($related_data as $entry)
{
- $related_link[] = array
- (
-
'entity_link' => $entry['entity_link'],
-
'lang_entity_statustext' => $entry['descr'],
-
'text_entity' => $entry['name'],
- );
+ $_related[] = array
+ (
+ 'url'
=> "<a href=\"{$entry['entity_link']}\" > {$entry['name']}</a>",
+ );
}
}
}
+
+ $datavalues[1] = array
+ (
+ 'name'
=> "1",
+ 'values'
=> json_encode($_target),
+ 'total_records' =>
count($_target),
+ 'edit_action' => "''",
+ 'is_paginator' => 1,
+ 'footer'
=> 0
+ );
+
+ $myColumnDefs[1] = array
+ (
+ 'name' => "1",
+ 'values' =>
json_encode(array(
+ array('key' =>
'url','label'=>lang('id'),'sortable'=>false,'resizeable'=>true),
+ array('key' =>
'type','label'=>lang('type'),'sortable'=>true,'resizeable'=>true),
+ array('key' =>
'status','label'=>lang('status'),'sortable'=>false,'resizeable'=>true),
+ array('key' =>
'user','label'=>lang('user'),'sortable'=>true,'resizeable'=>true),
+ array('key' =>
'entry_date','label'=>lang('entry date'),'sortable'=>false,'resizeable'=>true),
+ )
+ )
+ );
+
+ $datavalues[2] = array
+ (
+ 'name'
=> "2",
+ 'values'
=> json_encode($_related),
+ 'total_records' =>
count($_related),
+ 'edit_action' => "''",
+ 'is_paginator' => 1,
+ 'footer'
=> 0
+ );
+
+ $myColumnDefs[2] = array
+ (
+ 'name' => "2",
+ 'values' =>
json_encode(array(
+ array('key' =>
'url','label'=>lang('where'),'sortable'=>false,'resizeable'=>true),
+ )
+ )
+ );
}
-//_debug_array($attributes);die();
$data = array
(
'property_js'
=>
json_encode($GLOBALS['phpgw_info']['server']['webserver_url']."/property/js/yahoo/property2.js"),
'datatable'
=> $datavalues,
'myColumnDefs'
=> $myColumnDefs,
- 'related_link'
=> $related_link,
+// 'related_link'
=> $related_link,
'link_pdf'
=> $GLOBALS['phpgw']->link('/index.php',$pdf_data),
'start_project'
=> $category['start_project'],
'lang_start_project'
=> lang('start project'),
@@ -2019,8 +2080,8 @@
'value_origin_type'
=> isset($origin)?$origin:'',
'value_origin_id'
=> isset($origin_id)?$origin_id:'',
- 'value_target'
=> isset($values['target'])?$values['target']:'',
- 'lang_target'
=> lang('target'),
+ // 'value_target'
=> isset($values['target'])?$values['target']:'',
+ // 'lang_target'
=> lang('target'),
'lang_no_cat'
=> lang('no category'),
'lang_cat_statustext'
=> lang('Select the category. To do not use a category select NO CATEGORY'),
'select_name'
=> 'cat_id',
Modified: trunk/property/templates/base/entity.xsl
===================================================================
--- trunk/property/templates/base/entity.xsl 2012-11-19 18:54:33 UTC (rev
10517)
+++ trunk/property/templates/base/entity.xsl 2012-11-19 22:26:38 UTC (rev
10518)
@@ -77,7 +77,6 @@
</xsl:choose>
</table>
<table cellpadding="2" cellspacing="2"
width="80%" align="center">
- <xsl:call-template name="target"/>
<xsl:for-each select="origin_list">
<tr>
<td class="th_text">
@@ -286,6 +285,28 @@
</div>
</xsl:when>
</xsl:choose>
+ <div id="related">
+ <table cellpadding="2"
cellspacing="2" width="80%" align="center">
+ <tr>
+ <td
valign='top'>
+
<xsl:value-of select="php:function('lang', 'startet from')"/>
+ </td>
+ <td>
+ <div
id="datatable-container_1"/>
+ </td>
+ </tr>
+ <tr>
+ <td
valign='top'>
+
<xsl:value-of select="php:function('lang', 'used in')"/>
+ </td>
+ <td>
+ <div
id="datatable-container_2"/>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <!--
<xsl:choose>
<xsl:when test="related_link !=
''">
<div id="related">
@@ -301,6 +322,7 @@
</div>
</xsl:when>
</xsl:choose>
+ -->
</div>
<xsl:choose>
<xsl:when test="mode = 'edit'">
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [10518] property: target-link at enitities,
Sigurd Nes <=