[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] ged templates/base/css/default.css inc/class.ge...
From: |
Pascal Vilarem |
Subject: |
[Phpgroupware-cvs] ged templates/base/css/default.css inc/class.ge... |
Date: |
Wed, 28 Mar 2007 14:28:56 +0000 |
CVSROOT: /sources/phpgroupware
Module name: ged
Changes by: Pascal Vilarem <maat> 07/03/28 14:28:56
Modified files:
templates/base/css: default.css
inc : class.ged_ui.inc.php class.ged_dm.inc.php
templates/base : file.tpl
Added files:
templates/base/images: obsolete-16.png
Log message:
Added list of linking documents.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/ged/templates/base/css/default.css?cvsroot=phpgroupware&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/ged/inc/class.ged_ui.inc.php?cvsroot=phpgroupware&r1=1.17&r2=1.18
http://cvs.savannah.gnu.org/viewcvs/ged/inc/class.ged_dm.inc.php?cvsroot=phpgroupware&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/ged/templates/base/images/obsolete-16.png?cvsroot=phpgroupware&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/ged/templates/base/file.tpl?cvsroot=phpgroupware&r1=1.5&r2=1.6
Patches:
Index: templates/base/css/default.css
===================================================================
RCS file: /sources/phpgroupware/ged/templates/base/css/default.css,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- templates/base/css/default.css 20 Mar 2007 18:03:42 -0000 1.4
+++ templates/base/css/default.css 28 Mar 2007 14:28:56 -0000 1.5
@@ -87,6 +87,11 @@
width: 100%;
}
+#ged_info #ged_file_relations2 {
+ border: 1px solid black;
+ width: 100%;
+}
+
.ged_label {
font-weight: bold;
Index: inc/class.ged_ui.inc.php
===================================================================
RCS file: /sources/phpgroupware/ged/inc/class.ged_ui.inc.php,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- inc/class.ged_ui.inc.php 28 Mar 2007 13:31:56 -0000 1.17
+++ inc/class.ged_ui.inc.php 28 Mar 2007 14:28:56 -0000 1.18
@@ -469,28 +469,66 @@
$list_versions=$this->ged_dm->list_versions($element_id);
-
$list_relations=$this->ged_dm->list_version_relations($current_version['version_id']);
+
$list_relations_out=$this->ged_dm->list_version_relations_out($current_version['version_id']);
$this->t->set_block('file_tpl', 'relations_list',
'relations_list_handle');
- if ($list_relations !="")
- foreach ($list_relations as $list_relation)
+ $relation_odd_even='odd';
+
+ if ($list_relations_out !="")
+ foreach ($list_relations_out as $list_relation)
{
+ if ( $relation_odd_even=='odd' )
+ $relation_odd_even='even';
+ else
+ $relation_odd_even='odd';
+
$this->t->set_var('relation_name',
$list_relation['name']);
$this->t->set_var('relation_reference',
$list_relation['reference']);
$this->t->set_var('relation_version',
$list_relation['major'].".".$list_relation['minor']);
$this->t->set_var('relation_status_value',
$list_relation['status']);
- $this->t->set_var('relation_status_image',
$GLOBALS['phpgw']->common->image('ged', $list_relation['status']."-32"));
+ $this->t->set_var('relation_status_image',
$GLOBALS['phpgw']->common->image('ged', $list_relation['status']."-16"));
- $link_data=null;
+ $link_data=null;$this->t->set_var('relation_status_oe',
'file_version_'.$list_relation['status'].'_'.$relation_odd_even);
$link_data['menuaction']='ged.ged_ui.browse';
$link_data['focused_id']=$list_relation['element_id'];
$this->t->set_var('relation_link',
$GLOBALS['phpgw']->link('/index.php', $link_data));
+ $this->t->set_var('relation_status_oe',
'file_version_'.$list_relation['status'].'_'.$relation_odd_even);
$this->t->fp('relations_list_handle', 'relations_list',
True);
}
+
$list_relations_in=$this->ged_dm->list_version_relations_in($current_version['version_id']);
+
+ $this->t->set_block('file_tpl', 'relations_list2',
'relations_list2_handle');
+
+ $relation_odd_even='odd';
+
+ if ($list_relations_in !="")
+ foreach ($list_relations_in as $list_relation)
+ {
+ if ( $relation_odd_even=='odd' )
+ $relation_odd_even='even';
+ else
+ $relation_odd_even='odd';
+
+ $this->t->set_var('relation_name',
$list_relation['name']);
+ $this->t->set_var('relation_reference',
$list_relation['reference']);
+ $this->t->set_var('relation_version',
$list_relation['major'].".".$list_relation['minor']);
+ $this->t->set_var('relation_status_value',
$list_relation['status']);
+ $this->t->set_var('relation_status_image',
$GLOBALS['phpgw']->common->image('ged', $list_relation['status']."-16"));
+
+ $link_data=null;
+ $link_data['menuaction']='ged.ged_ui.browse';
+ $link_data['focused_id']=$list_relation['element_id'];
+ $link_data['version_id']=$list_relation['version_id'];
+ $this->t->set_var('relation_link',
$GLOBALS['phpgw']->link('/index.php', $link_data));
+
+ $this->t->set_var('relation_status_oe',
'file_version_'.$list_relation['status'].'_'.$relation_odd_even);
+
+ $this->t->fp('relations_list2_handle',
'relations_list2', True);
+ }
$this->t->set_block('file_tpl', 'versions_list',
'versions_list_handle');
@@ -1253,7 +1291,7 @@
}
else
{
-
$version_relations=$this->ged_dm->list_version_relations (
$last_version['version_id'] );
+
$version_relations=$this->ged_dm->list_version_relations_out (
$last_version['version_id'] );
}
if ( $do_add_relation != '')
Index: inc/class.ged_dm.inc.php
===================================================================
RCS file: /sources/phpgroupware/ged/inc/class.ged_dm.inc.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- inc/class.ged_dm.inc.php 28 Mar 2007 13:31:56 -0000 1.14
+++ inc/class.ged_dm.inc.php 28 Mar 2007 14:28:56 -0000 1.15
@@ -1808,7 +1808,7 @@
// relations management
- function list_version_relations ( $version_id )
+ function list_version_relations_out ( $version_id )
{
if ( is_numeric($version_id) )
{
@@ -1845,6 +1845,43 @@
return null;
}
+ function list_version_relations_in ( $version_id )
+ {
+ if ( is_numeric($version_id) )
+ {
+ $sql="SELECT ged_relations.*, ged_versions.*,
ged_elements.* ";
+ $sql.="FROM (ged_relations INNER JOIN ged_versions on
ged_relations.linking_version_id=ged_versions.version_id) ";
+ $sql.="INNER JOIN ged_elements ON
ged_versions.element_id = ged_elements.element_id WHERE
linked_version_id=".$version_id;
+
+ $this->db->query($sql);
+
+ $i=0;
+ while ($this->db->next_record())
+ {
+ $element_id=$this->db->f('element_id');
+
+ if ( $this->can_read($element_id) )
+ {
+
$relations[$i]['element_id']=$element_id;
+
$relations[$i]['version_id']=$this->db->f('version_id');
+
$relations[$i]['name']=$this->db->f('name');
+
$relations[$i]['status']=$this->db->f('status');
+
$relations[$i]['reference']=$this->db->f('reference');
+
$relations[$i]['major']=$this->db->f('major');
+
$relations[$i]['minor']=$this->db->f('minor');
+ $i ++;
+ }
+ }
+
+ $this->db->unlock();
+ }
+
+ if ( isset($relations))
+ return ($relations);
+ else
+ return null;
+ }
+
function list_versions_referring_to ( $version_id )
{
if ( is_numeric($version_id) )
Index: templates/base/file.tpl
===================================================================
RCS file: /sources/phpgroupware/ged/templates/base/file.tpl,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- templates/base/file.tpl 23 Mar 2007 16:07:15 -0000 1.5
+++ templates/base/file.tpl 28 Mar 2007 14:28:56 -0000 1.6
@@ -7,16 +7,27 @@
</div>
<div class="ged_file_name">Linking to :</div>
-<table id="ged_file_relations">
+<table id="ged_file_relations" cellspacing="0" cellpadding"0">
<!-- BEGIN relations_list -->
-<tr>
- <td>{relation_type}</td>
- <td><a href="{relation_link}" >{relation_name} [{relation_reference}]
v{relation_version}</a></td>
+<tr class="{relation_status_oe}">
<td><img src="{relation_status_image}"/></td>
+ <td><a href="{relation_link}" >{relation_name} [{relation_reference}]
v{relation_version}</a></td>
+ <td>{relation_type}</td>
</tr>
<!-- END relations_list -->
</table>
+<div class="ged_file_name">Linked by :</div>
+<table id="ged_file_relations2" cellspacing="0" cellpadding"0">
+<!-- BEGIN relations_list2 -->
+<tr class="{relation_status_oe}">
+ <td><img src="{relation_status_image}"/></td>
+ <td><a href="{relation_link}" >{relation_name} [{relation_reference}]
v{relation_version}</a></td>
+ <td>{relation_type}</td>
+</tr>
+<!-- END relations_list2 -->
+</table>
+
<div class="ged_file_name">Versions :</div>
<table id="ged_file_versions" cellspacing="0" cellpadding"0">
<!-- BEGIN versions_list -->
Index: templates/base/images/obsolete-16.png
===================================================================
RCS file: templates/base/images/obsolete-16.png
diff -N templates/base/images/obsolete-16.png
Binary files /dev/null and /tmp/cvsA2Q6MZ differ