[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [7473] property: reference level
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [7473] property: reference level |
Date: |
Tue, 05 Jul 2011 10:25:47 +0000 |
Revision: 7473
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7473
Author: sigurdne
Date: 2011-07-05 10:25:46 +0000 (Tue, 05 Jul 2011)
Log Message:
-----------
property: reference level
Modified Paths:
--------------
trunk/property/inc/class.bocommon.inc.php
trunk/property/inc/class.borequest.inc.php
trunk/property/inc/class.sogeneric.inc.php
trunk/property/inc/class.sorequest.inc.php
trunk/property/inc/class.uirequest.inc.php
trunk/property/setup/phpgw_no.lang
trunk/property/setup/setup.inc.php
trunk/property/setup/tables_current.inc.php
trunk/property/setup/tables_update.inc.php
trunk/property/templates/base/request.xsl
Modified: trunk/property/inc/class.bocommon.inc.php
===================================================================
--- trunk/property/inc/class.bocommon.inc.php 2011-07-04 13:39:01 UTC (rev
7472)
+++ trunk/property/inc/class.bocommon.inc.php 2011-07-05 10:25:46 UTC (rev
7473)
@@ -190,32 +190,18 @@
return $output_list;
}
- function select_list($selected='',$input_list='')
+ function select_list($selected='',$list=array())
{
- $entry_list = array();
- if (isset($input_list) AND is_array($input_list))
+ if (is_array($list))
{
- foreach($input_list as $entry)
+ foreach($list as &$entry)
{
if ($entry['id']==$selected)
{
- $entry_list[] = array
- (
- 'id'
=> $entry['id'],
- 'name'
=> $entry['name'],
- 'selected'
=> 'selected'
- );
+ $entry['selected'] = 'selected';
}
- else
- {
- $entry_list[] = array
- (
- 'id'
=> $entry['id'],
- 'name'
=> $entry['name'],
- );
- }
}
- return $entry_list;
+ return $list;
}
}
Modified: trunk/property/inc/class.borequest.inc.php
===================================================================
--- trunk/property/inc/class.borequest.inc.php 2011-07-04 13:39:01 UTC (rev
7472)
+++ trunk/property/inc/class.borequest.inc.php 2011-07-05 10:25:46 UTC (rev
7473)
@@ -229,6 +229,27 @@
return $probability_list;
}
+
+ function select_reference_list($reference_value = 0)
+ {
+ $selected = $reference_value ? $reference_value :
(int)$GLOBALS['phpgw_info']['user']['preferences']['property']['request_reference_level'];
+
+ $reference_list = array();
+ $reference_comment = array();
+ $reference_comment[0]=' - '.lang('none');
+ $reference_comment[1]=' - '.lang('minor');
+ $reference_comment[2]=' - '.lang('medium');
+ $reference_comment[3]=' - '.lang('serious');
+ for ($i=0; $i<=3; $i++)
+ {
+ $reference_list[$i]['id'] = $i;
+ $reference_list[$i]['name'] =
"{$i}{$reference_comment[$i]}";
+ $reference_list[$i]['selected'] = $i==$selected
? 1 : 0;
+ }
+
+ return $reference_list;
+ }
+
function select_conditions($request_id='')
{
$values = array();
@@ -251,14 +272,16 @@
$risk =
(int)$conditions[$i]['probability'] * (int)$conditions[$i]['consequence'];
$values[] = array
(
+ 'reference'
=> array('options' =>
$this->select_reference_list($conditions[$i]['reference'])),
'degree'
=> array('options' =>
$this->select_degree_list($conditions[$i]['degree'])),
'probability'
=> array('options' =>
$this->select_probability_list($conditions[$i]['probability'])),
'consequence'
=> array('options' =>
$this->select_consequence_list($conditions[$i]['consequence'])),
'condition_type'
=> $condition_type_list[$i]['id'],
'condition_type_name' =>
$condition_type_list[$i]['name'],
+ 'failure'
=> (int)$conditions[$i]['reference'] - (int)$conditions[$i]['degree'] <
0 ? 'X' : '',
'weight'
=> $condition_type_list[$i]['weight'],
'risk'
=> $risk,
- 'score'
=> $risk * (int)$condition_type_list[$i]['weight'] *
(int)$conditions[$i]['degree']
+ 'score'
=> $risk * (int)$condition_type_list[$i]['weight'] *
(int)$conditions[$i]['degree']
);
}
}
@@ -277,17 +300,20 @@
$values[] = array
(
'condition_type_list' =>
array('options' => $this->bocommon->select_list($i, $condition_type_list)),
+ 'reference'
=> array('options' =>
$this->select_reference_list($conditions[$i]['reference'])),
'degree'
=> array('options' => $this->select_degree_list($conditions[$i]['degree'])),
'probability' =>
array('options' =>
$this->select_probability_list($conditions[$i]['probability'])),
'consequence' =>
array('options' =>
$this->select_consequence_list($conditions[$i]['consequence'])),
'condition_type' =>
$condition_type_list[$i]['id'],
'condition_type_name' =>
$condition_type_list[$i]['name'],
+ 'condition_type_descr' =>
$condition_type_list[$i]['descr'],
+ 'failure'
=> (int)$conditions[$i]['reference'] - (int)$conditions[$i]['degree'] < 0 ? 'X'
: '',
'weight'
=> $condition_type_list[$i]['weight'],
'risk'
=> $risk,
'score'
=> $risk * (int)$condition_type_list[$i]['weight'] *
(int)$conditions[$i]['degree']
);
}
-
+//_debug_array($values);die();
return $values;
}
Modified: trunk/property/inc/class.sogeneric.inc.php
===================================================================
--- trunk/property/inc/class.sogeneric.inc.php 2011-07-04 13:39:01 UTC (rev
7472)
+++ trunk/property/inc/class.sogeneric.inc.php 2011-07-05 10:25:46 UTC (rev
7473)
@@ -919,6 +919,12 @@
(
array
(
+ 'name' =>
'name',
+ 'descr' =>
lang('name'),
+ 'type' =>
'varchar'
+ ),
+ array
+ (
'name' =>
'descr',
'descr' =>
lang('descr'),
'type' =>
'varchar'
Modified: trunk/property/inc/class.sorequest.inc.php
===================================================================
--- trunk/property/inc/class.sorequest.inc.php 2011-07-04 13:39:01 UTC (rev
7472)
+++ trunk/property/inc/class.sorequest.inc.php 2011-07-05 10:25:46 UTC (rev
7473)
@@ -143,7 +143,7 @@
function select_condition_type_list()
{
- $this->db->query("SELECT id, descr, priority_key FROM
fm_request_condition_type ORDER BY id",__LINE__,__FILE__);
+ $this->db->query("SELECT * FROM
fm_request_condition_type ORDER BY id",__LINE__,__FILE__);
$values = array();
while ($this->db->next_record())
@@ -152,7 +152,8 @@
$values[$id] = array
(
'id' => $id,
- 'name' =>
$this->db->f('descr',true),
+ 'name' =>
$this->db->f('name',true),
+ 'descr' =>
$this->db->f('descr',true),
'weight' =>
$this->db->f('priority_key')
);
}
@@ -174,6 +175,7 @@
(
'request_id' => $request_id,
'condition_type' =>
$this->db->f('condition_type'),
+ 'reference' =>
$this->db->f('reference'),
'degree' =>
$this->db->f('degree'),
'probability' =>
$this->db->f('probability'),
'consequence' =>
$this->db->f('consequence')
@@ -645,10 +647,11 @@
foreach( $request['condition'] as
$condition_type => $value_type )
{
$_condition_type =
isset($value_type['condition_type']) && $value_type['condition_type'] ?
$value_type['condition_type'] : $condition_type;
- $this->db->query("INSERT INTO
fm_request_condition
(request_id,condition_type,degree,probability,consequence,user_id,entry_date) "
+ $this->db->query("INSERT INTO
fm_request_condition
(request_id,condition_type,reference,degree,probability,consequence,user_id,entry_date)
"
. "VALUES ('"
. $request['id']. "','"
. $_condition_type . "',"
+ . $value_type['reference']. ","
. $value_type['degree']. ","
. $value_type['probability'].
","
. $value_type['consequence'].
","
@@ -834,12 +837,13 @@
foreach( $request['condition'] as
$condition_type => $value_type )
{
$_condition_type =
isset($value_type['condition_type']) && $value_type['condition_type'] ?
$value_type['condition_type'] : $condition_type;
- $this->db->query("INSERT INTO
fm_request_condition
(request_id,condition_type,degree,probability,consequence,user_id,entry_date) "
+ $this->db->query("INSERT INTO
fm_request_condition
(request_id,condition_type,reference,degree,probability,consequence,user_id,entry_date)
"
. "VALUES ('"
. $request['id']. "','"
. $_condition_type . "',"
+ . $value_type['reference']. ","
. $value_type['degree']. ","
- .
$value_type['probability']. ","
+ . $value_type['probability'].
","
. $value_type['consequence'].
","
. $this->account . ","
. time() .
")",__LINE__,__FILE__);
Modified: trunk/property/inc/class.uirequest.inc.php
===================================================================
--- trunk/property/inc/class.uirequest.inc.php 2011-07-04 13:39:01 UTC (rev
7472)
+++ trunk/property/inc/class.uirequest.inc.php 2011-07-05 10:25:46 UTC (rev
7473)
@@ -1177,16 +1177,6 @@
}
-
- $table_header_importance[] = array
- (
- 'lang_subject' =>
lang('Subject'),
- 'lang_condition_degree' =>
lang('Condidtion degree'),
- 'lang_prob_worsening' =>
lang('Probability'),
- 'lang_consequence' =>
lang('Consequence')
- );
-
-
if($values['project_id'])
{
$project_lookup_data = array
@@ -1394,7 +1384,7 @@
'tenant_id'
=> $values['tenant_id'],
'lang_importance'
=> lang('Importance'),
- 'table_header_importance'
=> $table_header_importance,
+
'importance_weight'
=> $importance_weight,
'lang_no_workorders'
=> lang('No workorder budget'),
@@ -1442,12 +1432,8 @@
'lang_request_id'
=> lang('request ID'),
'value_request_id'
=> $id,
- 'lang_title'
=> lang('Title'),
'value_title'
=> $values['title'],
- 'lang_title_statustext'
=> lang('Enter request Title'),
- 'lang_descr_statustext'
=> lang('Enter a description of the request'),
- 'lang_descr'
=> lang('Description'),
'value_descr'
=> $values['descr'],
'lang_score'
=> lang('Score'),
'value_score'
=> $values['score'],
Modified: trunk/property/setup/phpgw_no.lang
===================================================================
--- trunk/property/setup/phpgw_no.lang 2011-07-04 13:39:01 UTC (rev 7472)
+++ trunk/property/setup/phpgw_no.lang 2011-07-05 10:25:46 UTC (rev 7473)
@@ -342,12 +342,13 @@
communication types manager property no Type kommunikasjon
composites property no Leieobjekter
condition property no Tilstand
-condidtion degree property no Tilstandsgrad
+condition degree property no Tilstandsgrad
config property no Konfigurer
configuration property no Konfigurasjon
confirm status property no Bekreft status
confirm status to the history property no Bekreft status til
historikk
consequence property no Konsekvens
+consequence type property no Konsekvenstype
consequential damage property no Følgeskader
consume property no forbruk
consume date property no Dato historisk forbruk
@@ -635,7 +636,7 @@
enter a description of the document property no gi en
beskrivelse av dokumentet
enter a description of the equipment property no gi en
beskrivelse av utstyret
enter a description of the project property no gi en
beskrivelse av prosjektet
-enter a description of the request property no gi en
beskrivelse av anmodningen
+enter a description of the request property no Gi en
beskrivelse av tiltaket
enter a description of the standard property no gi en
beskrivelse av standarden
enter a description of the status property no Angi en
beskrivelse av statusen
enter a description the attribute property no gi en
beskrivelse av attributten
@@ -680,7 +681,7 @@
enter other branch if not found in the list property no Angi
andre fag om det ikke finnes i listen
enter project name property no Angi Prosjekt navn
enter quantity of unit property no angi mengde
-enter request title property no angi tittel for anmodning
+enter request title property no Angi beskrivende navn for tiltak
enter the attribute id property no angi attributt ID
enter the attribute value for this entity property no angi
attributt verdi for denne posten
enter the billable hour for the task property no Angi egne timer
for oppgaven
@@ -770,6 +771,7 @@
failed to create directory property no klarte ikke å lage
katalog
failed to delete file property no klarte ikke å slette fil
failed to upload file ! property no Opplasting av fil
feilet!
+failure property no Svikt
false property no False
feste nr property no Feste nr
fetch the history for this item property no Hent historikk
for dette elementet
@@ -1277,6 +1279,7 @@
receipt property no Kvittering
receipt date property no Kvitteringsdato
record property no Post
+reference level property no Referanse nivå
regulations property no Forskrifter
related property no Relatert
related info property no Relatert info
@@ -1297,7 +1300,6 @@
request %1 has been edited property no anmodning %1 er oppdater
request %1 has been saved property no anmodning %1 er lagret
request budget property no Budsjett for tiltak
-request condition_type property no Tema for tilstand
request descr property no Beskrivelse av tiltak
request end date property no anmodning frist
request entry date property no Registreringsdato for tiltak
@@ -1305,6 +1307,7 @@
request start date property no anmodning startdato
request status property no Status anmodning
request title property no Tiltak tittel
+request description property no Tilstand beskrivelse
requirement property no Behov/pålegg
resend workorder property no Send ordre på nytt
reserve property no reserve
Modified: trunk/property/setup/setup.inc.php
===================================================================
--- trunk/property/setup/setup.inc.php 2011-07-04 13:39:01 UTC (rev 7472)
+++ trunk/property/setup/setup.inc.php 2011-07-05 10:25:46 UTC (rev 7473)
@@ -12,7 +12,7 @@
*/
$setup_info['property']['name'] = 'property';
- $setup_info['property']['version'] = '0.9.17.620';
+ $setup_info['property']['version'] = '0.9.17.621';
$setup_info['property']['app_order'] = 8;
$setup_info['property']['enable'] = 1;
$setup_info['property']['app_group'] = 'office';
Modified: trunk/property/setup/tables_current.inc.php
===================================================================
--- trunk/property/setup/tables_current.inc.php 2011-07-04 13:39:01 UTC (rev
7472)
+++ trunk/property/setup/tables_current.inc.php 2011-07-05 10:25:46 UTC (rev
7473)
@@ -810,6 +810,7 @@
'fd' => array(
'request_id' => array('type' =>
'int','precision' => '4','nullable' => False),
'condition_type' => array('type' =>
'int','precision' => '4','nullable' => False),
+ 'reference' => array('type' =>
'int','precision' => '4','default' => '0','nullable' => True),
'degree' => array('type' => 'int','precision'
=> '4','default' => '0','nullable' => True),
'probability' => array('type' =>
'int','precision' => '4','default' => '0','nullable' => True),
'consequence' => array('type' =>
'int','precision' => '4','default' => '0','nullable' => True),
@@ -1277,7 +1278,8 @@
'fm_request_condition_type' => array(
'fd' => array(
'id' => array('type' => 'int','precision' =>
'4','nullable' => False),
- 'descr' => array('type' =>
'varchar','precision' => '50','nullable' => False),
+ 'name' => array('type' => 'varchar','precision'
=> '255','nullable' => False),
+ 'descr' => array('type' =>
'varchar','precision' => '50','nullable' => true),
'priority_key' => array('type' =>
'int','precision' => '4','default' => '1','nullable' => True)
),
'pk' => array('id'),
Modified: trunk/property/setup/tables_update.inc.php
===================================================================
--- trunk/property/setup/tables_update.inc.php 2011-07-04 13:39:01 UTC (rev
7472)
+++ trunk/property/setup/tables_update.inc.php 2011-07-05 10:25:46 UTC (rev
7473)
@@ -5345,7 +5345,30 @@
}
}
+
/**
+ * Update property version from 0.9.17.620 to 0.9.17.621
+ *
+ */
+
+ $test[] = '0.9.17.620';
+ function property_upgrade0_9_17_620()
+ {
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+
$GLOBALS['phpgw_setup']->oProc->RenameColumn('fm_request_condition_type','descr','name');
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_request_condition_type','descr',
array('type' => 'varchar','precision' => '255','nullable' => True));
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_request_condition','reference',
array('type' => 'int','precision' => '4','default' => '0','nullable' => True));
+
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
+ $GLOBALS['setup_info']['property']['currentver'] =
'0.9.17.621';
+ return $GLOBALS['setup_info']['property']['currentver'];
+ }
+ }
+
+
+ /**
* Update property version from 0.9.17.607 to 0.9.17.608
* Add more room for address at tickets
*
Modified: trunk/property/templates/base/request.xsl
===================================================================
--- trunk/property/templates/base/request.xsl 2011-07-04 13:39:01 UTC (rev
7472)
+++ trunk/property/templates/base/request.xsl 2011-07-05 10:25:46 UTC (rev
7473)
@@ -263,24 +263,24 @@
<tr>
<td
valign="top">
-
<xsl:value-of select="lang_title"/>
+
<xsl:value-of select="php:function('lang', 'request title')" />
</td>
<td>
<input
type="text" name="values[title]" value="{value_title}" size="60">
<xsl:attribute name="title">
-
<xsl:value-of select="lang_title_statustext"/>
+
<xsl:value-of select="php:function('lang', 'enter request title')" />
</xsl:attribute>
</input>
</td>
</tr>
<tr>
<td
valign="top">
-
<xsl:value-of select="lang_descr"/>
+
<xsl:value-of select="php:function('lang', 'request description')" />
</td>
<td>
<textarea cols="60" rows="6" name="values[descr]">
<xsl:attribute name="title">
-
<xsl:value-of select="lang_descr_statustext"/>
+
<xsl:value-of select="php:function('lang', 'enter a description of the
request')" />
</xsl:attribute>
<xsl:value-of select="value_descr"/>
</textarea>
@@ -530,7 +530,7 @@
<tr>
<td colspan='2'>
<table
border="1" width="100%" cellpadding="2" cellspacing="2" align="center">
-
<xsl:apply-templates select="table_header_importance"/>
+
<xsl:call-template name="table_header_importance"/>
<xsl:apply-templates select="condition_list"/>
</table>
</td>
@@ -749,8 +749,7 @@
<td class="small_text" align="left">
<xsl:choose>
<xsl:when test="condition_type_list !=
''">
- <xsl:variable
name="lang_degree_statustext"><xsl:value-of
select="//lang_degree_statustext"/></xsl:variable>
- <select
name="values[condition][{condition_type}][condition_type]" class="forms"
title="{$lang_degree_statustext}">
+ <select
name="values[condition][{condition_type}][condition_type]" class="forms">
<xsl:apply-templates
select="condition_type_list/options"/>
</select>
</xsl:when>
@@ -761,6 +760,12 @@
</td>
<td class="small_text" align="center">
+ <xsl:variable
name="lang_reference_statustext"><xsl:value-of
select="//lang_reference_statustext"/></xsl:variable>
+ <select
name="values[condition][{condition_type}][reference]" class="forms"
title="{$lang_reference_statustext}">
+ <xsl:apply-templates
select="reference/options"/>
+ </select>
+ </td>
+ <td class="small_text" align="center">
<xsl:variable
name="lang_degree_statustext"><xsl:value-of
select="//lang_degree_statustext"/></xsl:variable>
<select
name="values[condition][{condition_type}][degree]" class="forms"
title="{$lang_degree_statustext}">
<xsl:apply-templates
select="degree/options"/>
@@ -778,6 +783,9 @@
<xsl:apply-templates
select="consequence/options"/>
</select>
</td>
+ <td class="small_text" align="center">
+ <xsl:value-of select="failure"/>
+ </td>
<td class="small_text" align="right">
<xsl:value-of select="weight"/>
</td>
@@ -831,6 +839,11 @@
<xsl:if test="selected != 0">
<xsl:attribute name="selected" value="selected"
/>
</xsl:if>
+ <xsl:if test="descr != ''">
+ <xsl:attribute name="title">
+ <xsl:value-of
disable-output-escaping="yes" select="descr"/>
+ </xsl:attribute>
+ </xsl:if>
<xsl:value-of disable-output-escaping="yes"
select="name"/>
</option>
</xsl:template>
@@ -882,21 +895,27 @@
</tr>
</xsl:template>
- <xsl:template match="table_header_importance"
xmlns:php="http://php.net/xsl">
+ <xsl:template name="table_header_importance"
xmlns:php="http://php.net/xsl">
<tr>
<th width="20%" align="left">
- <xsl:value-of select="php:function('lang',
'request condition_type')" />
+ <xsl:value-of select="php:function('lang',
'consequence type')" />
</th>
+ <th width="20%" align="left">
+ <xsl:value-of select="php:function('lang',
'reference level')" />
+ </th>
<th width="20%" align="center">
- <xsl:value-of select="lang_condition_degree"/>
+ <xsl:value-of select="php:function('lang',
'condition degree')" />
</th>
<th width="20%" align="center">
- <xsl:value-of select="lang_prob_worsening"/>
+ <xsl:value-of select="php:function('lang',
'Probability')" />
</th>
<th width="20%" align="center">
- <xsl:value-of select="lang_consequence"/>
+ <xsl:value-of select="php:function('lang',
'Consequence')" />
</th>
<th width="5%" align="center">
+ <xsl:value-of select="php:function('lang',
'failure')" />
+ </th>
+ <th width="5%" align="center">
<xsl:value-of select="php:function('lang',
'weight')" />
</th>
<th width="5%" align="center">
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [7473] property: reference level,
Sigurd Nes <=