[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] property inc/class.bor_agreement.inc.php inc/cl...
From: |
Sigurd Nes |
Subject: |
[Phpgroupware-cvs] property inc/class.bor_agreement.inc.php inc/cl... |
Date: |
Sat, 18 Feb 2006 11:25:46 +0000 |
CVSROOT: /sources/phpgroupware
Module name: property
Branch:
Changes by: Sigurd Nes <address@hidden> 06/02/18 11:25:46
Modified files:
inc : class.bor_agreement.inc.php
class.sor_agreement.inc.php
class.uir_agreement.inc.php
templates/base : r_agreement.xsl
Log message:
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.bor_agreement.inc.php.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.sor_agreement.inc.php.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.uir_agreement.inc.php.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/templates/base/r_agreement.xsl.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
Patches:
Index: property/inc/class.bor_agreement.inc.php
diff -u property/inc/class.bor_agreement.inc.php:1.5
property/inc/class.bor_agreement.inc.php:1.6
--- property/inc/class.bor_agreement.inc.php:1.5 Thu Feb 16 22:00:30 2006
+++ property/inc/class.bor_agreement.inc.php Sat Feb 18 11:25:46 2006
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage agreement
- * @version $Id: class.bor_agreement.inc.php,v 1.5 2006/02/16 22:00:30
sigurdne Exp $
+ * @version $Id: class.bor_agreement.inc.php,v 1.6 2006/02/18 11:25:46
sigurdne Exp $
*/
/**
@@ -779,18 +779,13 @@
function read_common_history($data)
{
$values = $this->so->read_common_history($data);
-
$this->total_records = $this->so->total_records;
-
- $this->uicols = $this->so->uicols;
-
for ($i=0; $i<count($values); $i++)
{
$values[$i]['from_date'] =
$GLOBALS['phpgw']->common->show_date($values[$i]['from_date'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
$values[$i]['to_date'] =
$GLOBALS['phpgw']->common->show_date($values[$i]['to_date'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
}
-
return $values;
}
Index: property/inc/class.sor_agreement.inc.php
diff -u property/inc/class.sor_agreement.inc.php:1.7
property/inc/class.sor_agreement.inc.php:1.8
--- property/inc/class.sor_agreement.inc.php:1.7 Fri Feb 17 14:48:14 2006
+++ property/inc/class.sor_agreement.inc.php Sat Feb 18 11:25:46 2006
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage agreement
- * @version $Id: class.sor_agreement.inc.php,v 1.7 2006/02/17 14:48:14
sigurdne Exp $
+ * @version $Id: class.sor_agreement.inc.php,v 1.8 2006/02/18 11:25:46
sigurdne Exp $
*/
/**
@@ -1745,118 +1745,38 @@
$r_agreement_id =
(isset($data['r_agreement_id'])?$data['r_agreement_id']:0);
$common_id =
(isset($data['common_id'])?$data['common_id']:0);
}
-
+
$table = 'fm_r_agreement_common';
-
- $cols = "b_account,budget_cost,
actual_cost,fm_r_agreement_c_history.id,from_date,to_date,fm_r_agreement_c_history.c_id,"
- . "fraction,override_fraction";
-
- $cols_return[] = 'id';
- $uicols['input_type'][] = 'text';
- $uicols['name'][] = 'id';
- $uicols['descr'][] = lang('ID');
- $uicols['statustext'][] = lang('ID');
-
- $cols_return[] = 'b_account';
- $uicols['input_type'][] = 'text';
- $uicols['name'][] = 'b_account';
- $uicols['descr'][] = lang('budget
account');
- $uicols['statustext'][] = lang('Budget
account');
-
- $cols_return[] = 'budget_cost';
- $uicols['input_type'][] = 'text';
- $uicols['name'][] = 'budget_cost';
- $uicols['descr'][] = lang('budget cost');
- $uicols['statustext'][] = lang('budget cost');
-
- $cols_return[] = 'actual_cost';
- $uicols['input_type'][] = 'text';
- $uicols['name'][] = 'actual_cost';
- $uicols['descr'][] = lang('actual cost');
- $uicols['statustext'][] = lang('actual cost');
-
- $cols_return[] = 'fraction';
- $uicols['input_type'][] = 'text';
- $uicols['name'][] = 'fraction';
- $uicols['descr'][] = lang('fraction');
- $uicols['statustext'][] = lang('fraction');
-
- $cols_return[] = 'override_fraction';
- $uicols['input_type'][] = 'text';
- $uicols['name'][] = 'override_fraction';
- $uicols['descr'][] = lang('override
fraction');
- $uicols['statustext'][] = lang('override
fraction');
-
- $cols_return[] = 'from_date';
- $uicols['input_type'][] = 'text';
- $uicols['name'][] = 'from_date';
- $uicols['descr'][] = lang('From date');
- $uicols['statustext'][] = lang('From date');
-
- $cols_return[] = 'to_date';
- $uicols['input_type'][] = 'text';
- $uicols['name'][] = 'to_date';
- $uicols['descr'][] = lang('To date');
- $uicols['statustext'][] = lang('To date');
-
- $cols_return[] = 'index_date';
- $uicols['input_type'][] = 'text';
- $uicols['name'][] = 'index_date';
- $uicols['descr'][] = lang('date');
- $uicols['statustext'][] = lang('date');
-
-
- $paranthesis .='(';
- $joinmethod .= " $this->join fm_r_agreement_c_history
ON ( $table.agreement_id =fm_r_agreement_c_history.agreement_id AND $table.id
=fm_r_agreement_c_history.c_id))";
-
-
- $from .= " FROM $paranthesis $table ";
-
- $sql = "SELECT $cols $from $joinmethod";
-
-
- $this->uicols = $uicols;
-
- $ordermethod = " order by $table.id ASC";
-
- $where= 'WHERE';
-
-
- if ($r_agreement_id)
- {
- $filtermethod .= " $where
$table.agreement_id=$r_agreement_id AND c_id=$common_id";
- $where= 'AND';
- }
-
-
- $sql .= " $filtermethod";
//echo $sql;
+ $sql ="SELECT b_account,budget_cost,
actual_cost,fm_r_agreement_c_history.id,from_date,"
+ . "
to_date,fm_r_agreement_c_history.c_id,override_fraction,remark "
+ . " FROM fm_r_agreement_common $this->join
fm_r_agreement_c_history "
+ . " ON ( fm_r_agreement_common.agreement_id
=fm_r_agreement_c_history.agreement_id "
+ . " AND fm_r_agreement_common.id
=fm_r_agreement_c_history.c_id)"
+ . " WHERE fm_r_agreement_common.agreement_id =
$r_agreement_id AND c_id=$common_id ORDER BY fm_r_agreement_c_history.c_id ASC";
+
+ $this->db->query($sql,__LINE__,__FILE__);
- $this->db2->query($sql,__LINE__,__FILE__);
- $this->total_records = $this->db2->num_rows();
- if(!$allrows)
- {
- $this->db->limit_query($sql .
$ordermethod,$start,__LINE__,__FILE__);
- }
- else
- {
- $this->db->query($sql .
$ordermethod,__LINE__,__FILE__);
- }
+ $this->total_records = $this->db->num_rows();
- $j=0;
- $n=count($cols_return);
while ($this->db->next_record())
{
- for ($i=0;$i<$n;$i++)
- {
- $common_list[$j][$cols_return[$i]] =
$this->db->f($cols_return[$i]);
- $common_list[$j]['agreement_id'] =
$r_agreement_id;
- }
- $j++;
+ $common[] = array
+ (
+ 'agreement_id' => $id,
+ 'common_id' => $this->db->f('c_id'),
+ 'b_account_id' =>
$this->db->f('b_account'),
+ 'from_date' =>
$this->db->f('from_date'),
+ 'to_date' =>
$this->db->f('to_date'),
+ 'budget_cost' =>
$this->db->f('budget_cost'),
+ 'actual_cost' =>
$this->db->f('actual_cost'),
+ 'override_fraction' =>
$this->db->f('override_fraction'),
+ 'remark' =>
stripslashes($this->db->f('remark')),
+ );
}
- return $common_list;
+
+ return $common;
}
-
}
?>
Index: property/inc/class.uir_agreement.inc.php
diff -u property/inc/class.uir_agreement.inc.php:1.8
property/inc/class.uir_agreement.inc.php:1.9
--- property/inc/class.uir_agreement.inc.php:1.8 Fri Feb 17 14:48:14 2006
+++ property/inc/class.uir_agreement.inc.php Sat Feb 18 11:25:46 2006
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage agreement
- * @version $Id: class.uir_agreement.inc.php,v 1.8 2006/02/17 14:48:14
sigurdne Exp $
+ * @version $Id: class.uir_agreement.inc.php,v 1.9 2006/02/18 11:25:46
sigurdne Exp $
*/
/**
@@ -1981,16 +1981,77 @@
if($id)
{
$values =
$this->bo->read_single_common(array('r_agreement_id'=>$r_agreement_id,'common_id'=>$id));
- $list =
$this->bo->read_common_history(array('r_agreement_id'=>$r_agreement_id,'common_id'=>$id));
- $lookup_type='view';
+ $values_common =
$this->bo->read_common_history(array('r_agreement_id'=>$r_agreement_id,'common_id'=>$id));
- }
+ if (isSet($values_common) AND
is_array($values_common))
+ {
+ foreach($values_common as $common_entry)
+ {
- $uicols = $this->bo->uicols;
- $list =
$this->list_content($list,$uicols,$edit_common=True);
- $content = $list['content'];
- $table_header=$list['table_header'];
+ if($this->acl_edit)
+ {
+ $link_edit =
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uir_agreement.edit_common&r_agreement_id='
. $common_entry['agreement_id'] . '&id=' . $common_entry['common_id']);
+ $text_edit
= lang('edit');
+ }
+ if($this->acl_delete)
+ {
+ $link_delete =
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uir_agreement.delete_common&r_agreement_id='
. $common_entry['agreement_id'] . '&id=' . $common_entry['common_id']);
+ $text_delete
=lang('delete');
+ }
+
+ $content_common[] = array
+ (
+ 'agreement_id'
=> $common_entry['agreement_id'],
+ 'common_id'
=> $common_entry['common_id'],
+ 'b_account_id'
=> $common_entry['b_account_id'],
+ 'from_date'
=> $common_entry['from_date'],
+ 'to_date'
=> $common_entry['to_date'],
+ 'budget_cost'
=> $common_entry['budget_cost'],
+ 'actual_cost'
=> $common_entry['actual_cost'],
+ 'fraction'
=> $common_entry['fraction'],
+ 'override_fraction'
=> $common_entry['override_fraction'],
+ 'remark'
=> $common_entry['remark'],
+ 'link_view'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uir_agreement.view&agreement_id='
. $common_entry['agreement_id']),
+ 'link_edit'
=> $link_edit,
+ 'link_delete'
=> $link_delete,
+ 'lang_view_statustext'
=> lang('view the p_of_town'),
+ 'lang_edit_statustext'
=> lang('edit the p_of_town'),
+
'lang_delete_statustext' => lang('delete the p_of_town'),
+ 'text_view'
=> lang('view'),
+ 'text_edit'
=> $text_edit,
+ 'text_delete'
=> $text_delete
+ );
+
+ unset($link_edit);
+ unset($link_delete);
+ unset($text_edit);
+ unset($text_delete);
+ }
+ }
+
+
+ $table_header_common = array
+ (
+ 'lang_id'
=> lang('ID'),
+ 'lang_b_account' =>
lang('Budget account'),
+ 'lang_from_date' =>
lang('from date'),
+ 'lang_to_date' =>
lang('to date'),
+ 'lang_budget_cost' =>
lang('budget cost'),
+ 'lang_actual_cost' =>
lang('actual cost'),
+ 'lang_fraction' =>
lang('fraction'),
+ 'lang_override_fraction' =>
lang('override fraction'),
+ 'lang_view'
=> lang('view'),
+ 'lang_edit'
=> lang('edit'),
+ 'lang_delete' =>
lang('delete')
+ );
+
+
+
+
+ $lookup_type='view';
+
+ }
$link_data = array
(
@@ -2098,8 +2159,6 @@
'agreement_name'
=> $r_agreement['name'],
'table_add'
=> $table_add,
- 'values'
=> $content,
- 'table_header'
=> $table_header,
'acl_manage'
=> $this->acl_manage,
'table_update'
=> $table_update,
'update_action'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uir_agreement.edit_common&r_agreement_id='
. $r_agreement_id . '&id=' . $id),
@@ -2118,7 +2177,10 @@
'lang_override_fraction' =>
lang('Override fraction'),
'lang_override_fraction_statustext'=>
lang('Override fraction of common costs'),
'value_override_fraction' =>
$values['override_fraction'],
- 'value_remark' => $values['remark']
+ 'value_remark' => $values['remark'],
+ 'values_common'
=> $content_common,
+ 'table_header_common' =>
$table_header_common,
+
);
Index: property/templates/base/r_agreement.xsl
diff -u property/templates/base/r_agreement.xsl:1.8
property/templates/base/r_agreement.xsl:1.9
--- property/templates/base/r_agreement.xsl:1.8 Fri Feb 17 14:48:14 2006
+++ property/templates/base/r_agreement.xsl Sat Feb 18 11:25:46 2006
@@ -1886,15 +1886,17 @@
</form>
<xsl:choose>
- <xsl:when test="values != ''">
+ <xsl:when test="values_common != ''">
<xsl:variable
name="update_action"><xsl:value-of select="update_action"/></xsl:variable>
<form method="post" name="form2"
action="{$update_action}">
<input type="hidden"
name="values[agreement_id]" value="{value_r_agreement_id}" ></input>
<input type="hidden"
name="values[common_id]" value="{value_id}" ></input>
<table width="100%" cellpadding="2"
cellspacing="2" align="center">
- <xsl:call-template
name="table_header"/>
- <xsl:call-template
name="values2"/>
+
+ <xsl:apply-templates select="table_header_common"/>
+ <xsl:apply-templates select="values_common"/>
+
</table>
<table width="70%" cellpadding="2"
cellspacing="2" align="center">
<xsl:choose>