[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [7104] property: add regulations
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [7104] property: add regulations |
Date: |
Thu, 10 Mar 2011 15:31:59 +0000 |
Revision: 7104
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7104
Author: sigurdne
Date: 2011-03-10 15:31:52 +0000 (Thu, 10 Mar 2011)
Log Message:
-----------
property: add regulations
Modified Paths:
--------------
trunk/property/inc/class.bogeneric.inc.php
trunk/property/inc/class.menu.inc.php
trunk/property/inc/class.sogeneric.inc.php
trunk/property/inc/class.uigeneric.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/generic.xsl
Modified: trunk/property/inc/class.bogeneric.inc.php
===================================================================
--- trunk/property/inc/class.bogeneric.inc.php 2011-03-10 10:23:40 UTC (rev
7103)
+++ trunk/property/inc/class.bogeneric.inc.php 2011-03-10 15:31:52 UTC (rev
7104)
@@ -199,10 +199,20 @@
public function get_list($data)
{
$values = $this->so->get_list($data);
- foreach ($values as &$entry)
+ if(isset($data['selected']) &&
is_array($data['selected']))
{
- $entry['selected'] = isset($data['selected'])
&& trim($data['selected']) == trim($entry['id']) ? 1 : 0;
+ foreach ($values as &$entry)
+ {
+ $entry['selected'] =
in_array($entry['id'],$data['selected']);
+ }
}
+ else
+ {
+ foreach ($values as &$entry)
+ {
+ $entry['selected'] =
isset($data['selected']) && trim($data['selected']) == trim($entry['id']) ? 1 :
0;
+ }
+ }
return $values;
}
Modified: trunk/property/inc/class.menu.inc.php
===================================================================
--- trunk/property/inc/class.menu.inc.php 2011-03-10 10:23:40 UTC (rev
7103)
+++ trunk/property/inc/class.menu.inc.php 2011-03-10 15:31:52 UTC (rev
7104)
@@ -405,6 +405,11 @@
'text' =>
lang('authorities demands'),
'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uigeneric.index', 'type' => 'authorities_demands') )
),
+ 'regulations' => array
+ (
+ 'text' =>
lang('regulations'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uigeneric.index', 'type' => 'regulations') )
+ ),
'request_attribs' => array
(
'text' =>
lang('request Attributes'),
Modified: trunk/property/inc/class.sogeneric.inc.php
===================================================================
--- trunk/property/inc/class.sogeneric.inc.php 2011-03-10 10:23:40 UTC (rev
7103)
+++ trunk/property/inc/class.sogeneric.inc.php 2011-03-10 15:31:52 UTC (rev
7104)
@@ -123,7 +123,7 @@
$uicols['input_type'][] =
isset($field['hidden']) && $field['hidden'] ? 'hidden' : 'text';
$uicols['name'][] =
$field['name'];
$uicols['descr'][] =
$field['descr'];
- $uicols['datatype'][] = 'V';
+ $uicols['datatype'][] =
$field['type'];
$uicols['sortable'][] =
isset($field['sortable']) && $field['sortable'] ? true : false;
$uicols['formatter'][] =
$field['type'] == 'int' ? 'FormatterRight' : '';
}
@@ -1562,6 +1562,48 @@
'menu_selection' =>
'admin::property::ticket_status'
);
break;
+
+
+ case 'regulations':
+ $info = array
+ (
+ 'table'
=> 'fm_regulations',
+ 'id'
=> array('name' => 'id', 'type' => 'auto'),
+ 'fields'
=> array
+ (
+ array
+ (
+ 'name' =>
'name',
+ 'descr' =>
lang('name'),
+ 'type' =>
'varchar'
+ ),
+ array
+ (
+ 'name' =>
'descr',
+ 'descr' =>
lang('descr'),
+ 'type' => 'text'
+ ),
+ array
+ (
+ 'name' =>
'external_ref',
+ 'descr' =>
lang('external ref'),
+ 'type' => 'link'
+ )
+ ),
+ 'edit_msg'
=> lang('edit'),
+ 'add_msg'
=> lang('add'),
+ 'name'
=> lang('regulations'),
+ 'acl_app'
=> 'property',
+ 'acl_location' =>
'.admin',
+ 'menu_selection' =>
'admin::property::regulations',
+ 'default'
=> array
+ (
+ 'user_id'
=> array('add' => '$this->account'),
+ 'entry_date' =>
array('add' => 'time()'),
+ 'modified_date' =>
array('edit' => 'time()'),
+ )
+ );
+ break;
//START HELPDESK - APP
case 'helpdesk_status':
// the helpdesk app
Modified: trunk/property/inc/class.uigeneric.inc.php
===================================================================
--- trunk/property/inc/class.uigeneric.inc.php 2011-03-10 10:23:40 UTC (rev
7103)
+++ trunk/property/inc/class.uigeneric.inc.php 2011-03-10 15:31:52 UTC (rev
7104)
@@ -360,6 +360,7 @@
{
$datatable['rows']['row'][$j]['column'][$k]['name'] =
$uicols['name'][$k];
$datatable['rows']['row'][$j]['column'][$k]['value'] =
$entry[$uicols['name'][$k]];
+
$datatable['rows']['row'][$j]['column'][$k]['format'] =
$uicols['datatype'][$k];
}
}
$j++;
@@ -501,14 +502,18 @@
$json_row = array();
foreach( $row['column'] as $column)
{
- if(isset($column['format']) &&
$column['format']== "link" && $column['java_link']==true)
+ if(isset($column['format']) &&
$column['format']== 'link' && $column['java_link']==true)
{
-
$json_row[$column['name']] = "<a href='#' id='".$column['link']."'
onclick='javascript:filter_data(this.id);'>" .$column['value']."</a>";
+
$json_row[$column['name']] = "<a href='#' id='{$column['link']}'
onclick='javascript:filter_data(this.id);'>{$column['value']}</a>";
}
- else
if(isset($column['format']) && $column['format']== "link")
+ else
if(isset($column['format']) && $column['format']== 'link')
{
-
$json_row[$column['name']] = "<a href='".$column['link']."'>"
.$column['value']."</a>";
+
$json_row[$column['name']] = "<a href='{$column['value']}' target='_blank'>"
.lang('link') . '</a>';
}
+ else
if(isset($column['format']) && $column['format']== 'text')
+ {
+
$json_row[$column['name']] = nl2br($column['value']);
+ }
else
{
$json_row[$column['name']] = $column['value'];
Modified: trunk/property/inc/class.uirequest.inc.php
===================================================================
--- trunk/property/inc/class.uirequest.inc.php 2011-03-10 10:23:40 UTC (rev
7103)
+++ trunk/property/inc/class.uirequest.inc.php 2011-03-10 15:31:52 UTC (rev
7104)
@@ -1408,6 +1408,7 @@
'currency'
=>
$GLOBALS['phpgw_info']['user']['preferences']['common']['currency'],
'authorities_demands'
=> array('options' =>
execMethod('property.bogeneric.get_list',array('type' => 'authorities_demands',
'selected' => $values['authorities_demands']))),
+ 'regulations'
=> execMethod('property.bogeneric.get_list',array('type' =>
'regulations', 'selected' => $values['regulations'])),
'condition_list'
=> $this->bo->select_conditions($id),
'building_part_list'
=> array('options' =>
$this->bocommon->select_category_list(array('type'=> 'building_part','selected'
=>$values['building_part'], 'order' => 'id', 'id_in_name' => 'num' ))),
Modified: trunk/property/setup/phpgw_no.lang
===================================================================
--- trunk/property/setup/phpgw_no.lang 2011-03-10 10:23:40 UTC (rev 7103)
+++ trunk/property/setup/phpgw_no.lang 2011-03-10 15:31:52 UTC (rev 7104)
@@ -750,6 +750,7 @@
export date property no Eksport dato
export invoice property no Overfør
export to file property no Eksport til fil
+external ref property no Ekstern referanse
extra property no Ekstra
extra mail address property no Ekstra adresse
f property no F
@@ -1264,6 +1265,7 @@
receipt property no Kvittering
receipt date property no Kvitteringsdato
record property no Post
+regulations property no Forskrifter
related property no Relatert
related info property no Relatert info
remark property no Merknad
Modified: trunk/property/setup/setup.inc.php
===================================================================
--- trunk/property/setup/setup.inc.php 2011-03-10 10:23:40 UTC (rev 7103)
+++ trunk/property/setup/setup.inc.php 2011-03-10 15:31:52 UTC (rev 7104)
@@ -12,7 +12,7 @@
*/
$setup_info['property']['name'] = 'property';
- $setup_info['property']['version'] = '0.9.17.612';
+ $setup_info['property']['version'] = '0.9.17.613';
$setup_info['property']['app_order'] = 8;
$setup_info['property']['enable'] = 1;
$setup_info['property']['app_group'] = 'office';
@@ -194,7 +194,8 @@
'fm_jasper_input_type',
'fm_jasper_format_type',
'fm_jasper_input',
- 'fm_custom_menu_items'
+ 'fm_custom_menu_items',
+ 'fm_regulations'
);
/* The hooks this app includes, needed for hooks registration */
Modified: trunk/property/setup/tables_current.inc.php
===================================================================
--- trunk/property/setup/tables_current.inc.php 2011-03-10 10:23:40 UTC (rev
7103)
+++ trunk/property/setup/tables_current.inc.php 2011-03-10 15:31:52 UTC (rev
7104)
@@ -798,6 +798,7 @@
'closed_date' => array('type' =>
'int','precision' => '4','nullable' => True),
'in_progress_date' => array('type' =>
'int','precision' => '4','nullable' => True),
'delivered_date' => array('type' =>
'int','precision' => '4','nullable' => True),
+ 'regulations' => array('type' =>
'varchar','precision' => 100,'nullable' => True),
),
'pk' => array('id'),
'fk' => array(),
@@ -1175,7 +1176,7 @@
'fk' => array(),
'ix' => array(),
'uc' => array()
- ),
+ ),
'fm_event' =>array(
'fd' => array(
'id' => array('type' => 'auto','precision' =>
4,'nullable' => False),
@@ -2216,5 +2217,20 @@
'fk' => array(),
'ix' => array(),
'uc' => array()
+ ),
+ 'fm_regulations' => array(
+ 'fd' => array(
+ 'id' => array('type' => 'int','precision' =>
4,'nullable' => False),
+ 'name' => array('type' =>
'varchar','precision' => 255,'nullable' => False),
+ 'descr' => array('type' => 'text','nullable' =>
True),
+ 'external_ref' => array('type' =>
'varchar','precision' => 255,'nullable' => True),
+ 'user_id' => array('type' => 'int','precision'
=> 4,'nullable' => True),
+ 'entry_date' => array('type' =>
'int','precision' => 4,'nullable' => True),
+ 'modified_date' => array('type' =>
'int','precision' => 4,'nullable' => True)
+ ),
+ 'pk' => array('id'),
+ 'fk' => array(),
+ 'ix' => array(),
+ 'uc' => array()
)
);
Modified: trunk/property/setup/tables_update.inc.php
===================================================================
--- trunk/property/setup/tables_update.inc.php 2011-03-10 10:23:40 UTC (rev
7103)
+++ trunk/property/setup/tables_update.inc.php 2011-03-10 15:31:52 UTC (rev
7104)
@@ -5107,8 +5107,45 @@
}
}
+ /**
+ * Update property version from 0.9.17.612 to 0.9.17.613
+ * Add regulations
+ *
+ */
+ $test[] = '0.9.17.612';
+ function property_upgrade0_9_17_612()
+ {
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_request','regulations',
array('type' => 'varchar','precision' => 100,'nullable' => True));
+
+ $GLOBALS['phpgw_setup']->oProc->CreateTable(
+ 'fm_regulations' , array(
+ 'fd' => array(
+ 'id' => array('type' =>
'int','precision' => 4,'nullable' => False),
+ 'name' => array('type' =>
'varchar','precision' => 255,'nullable' => False),
+ 'descr' => array('type' =>
'text','nullable' => True),
+ 'external_ref' => array('type' =>
'varchar','precision' => 255,'nullable' => True),
+ 'user_id' => array('type' =>
'int','precision' => 4,'nullable' => True),
+ 'entry_date' => array('type' =>
'int','precision' => 4,'nullable' => True),
+ 'modified_date' => array('type' =>
'int','precision' => 4,'nullable' => True)
+ ),
+ 'pk' => array('id'),
+ 'fk' => array(),
+ 'ix' => array(),
+ 'uc' => array()
+ )
+ );
+
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
+ $GLOBALS['setup_info']['property']['currentver'] =
'0.9.17.613';
+ 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/generic.xsl
===================================================================
--- trunk/property/templates/base/generic.xsl 2011-03-10 10:23:40 UTC (rev
7103)
+++ trunk/property/templates/base/generic.xsl 2011-03-10 15:31:52 UTC (rev
7104)
@@ -133,6 +133,22 @@
</xsl:for-each>
</select>
</xsl:when>
+
<xsl:when test="type='link'">
+
<input type="text" name="values[{name}]" value="{value}"
size="30">
+
<xsl:choose>
+
<xsl:when test="disabled!=''">
+
<xsl:attribute name="disabled">
+
<xsl:text> disabled</xsl:text>
+
</xsl:attribute>
+
</xsl:when>
+
</xsl:choose>
+
</input>
+
<xsl:choose>
+
<xsl:when test="value!=''">
+
<br/><a href="{value}"
target="_blank"><xsl:value-of select="value"/></a>
+
</xsl:when>
+
</xsl:choose>
+
</xsl:when>
</xsl:choose>
</td>
</tr>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [7104] property: add regulations,
Sigurd Nes <=