[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [17514] property: allow 0 as id at generic
From: |
sigurdne |
Subject: |
[Fmsystem-commits] [17514] property: allow 0 as id at generic |
Date: |
Tue, 9 Jan 2018 10:11:44 -0500 (EST) |
Revision: 17514
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=17514
Author: sigurdne
Date: 2018-01-09 10:11:44 -0500 (Tue, 09 Jan 2018)
Log Message:
-----------
property: allow 0 as id at generic
Modified Paths:
--------------
trunk/property/inc/class.sogeneric_.inc.php
trunk/property/inc/class.uigeneric.inc.php
trunk/property/setup/phpgw_no.lang
Modified: trunk/property/inc/class.sogeneric_.inc.php
===================================================================
--- trunk/property/inc/class.sogeneric_.inc.php 2018-01-09 09:54:17 UTC (rev
17513)
+++ trunk/property/inc/class.sogeneric_.inc.php 2018-01-09 15:11:44 UTC (rev
17514)
@@ -610,7 +610,7 @@
foreach ($data as $input_name => $value)
{
- if (isset($value) && $value)
+ if (isset($value) && ($value || $value === '0'))
{
$cols[] = $input_name;
$vals[] =
$this->_db->db_addslashes(html_entity_decode($value));
Modified: trunk/property/inc/class.uigeneric.inc.php
===================================================================
--- trunk/property/inc/class.uigeneric.inc.php 2018-01-09 09:54:17 UTC (rev
17513)
+++ trunk/property/inc/class.uigeneric.inc.php 2018-01-09 15:11:44 UTC (rev
17514)
@@ -128,11 +128,20 @@
{
$id_name = $this->location_info['id']['name'];
- $id = phpgw::get_var($id_name);
+// $id = phpgw::get_var($id_name);
+ $id = $_POST[$id_name];
- // $values = phpgw::get_var('values');
$values = array();
+ if($id || $id === '0')
+ {
+ $values[$id_name] = $id;
+ }
+ else
+ {
+ $values[$id_name] =
phpgw::clean_value($_POST['values'][$id_name]);
+ }
+
foreach ($this->location_info['fields'] as $field)
{
switch ($field['type'])
@@ -154,15 +163,8 @@
$values[$field['name']] =
phpgw::clean_value($_POST['values'][$field['name']],$value_type);
}
- $values[$id_name] =
phpgw::clean_value($_POST[$id_name]);
-
$values_attribute = phpgw::get_var('values_attribute');
-// if (!$id && !$values[$id_name] &&
$this->location_info['id']['type'] != 'auto')
-// {
-// $this->receipt['error'][] = array('msg' =>
lang('missing value for %1', lang('id')));
-// }
-
if ($this->location_info['id']['type'] != 'auto')
{
if (empty($values[$id_name]) &&
$values[$id_name] !== '0')
@@ -177,7 +179,7 @@
unset($values[$id_name]);
}
- if ($values[$id_name])
+ if ($values[$id_name] || $values[$id_name] === '0')
{
$data[$id_name] = $values[$id_name];
}
@@ -214,23 +216,6 @@
}
}
}
-/*
- $insert_record_attributes =
$GLOBALS['phpgw']->session->appsession("insert_record_values{$this->acl_location}",
$this->location_info['acl_app']);
-
- if (is_array($insert_record_attributes))
- {
- foreach ($insert_record_attributes as
$attribute)
- {
- foreach ($values_attribute as &$attr)
- {
- if ($attr['name'] == $attribute)
- {
- $attr['value'] =
phpgw::get_var($attribute, 'string', 'POST');
- }
- }
- }
- }
-*/
/*
* Extra data from custom fields
*/
@@ -1032,11 +1017,16 @@
return $this->edit();
}
- $id =
phpgw::get_var($this->location_info['id']['name']);
+ $id = $_POST[$this->location_info['id']['name']];
+ if($id !== '0')
+ {
+ $id = phpgw::clean_value($id);
+ }
+
$values = phpgw::get_var('values');
- if ($id || (int)$id === 0)
+ if ($id || $id === '0')
{
$data = $this->bo->read_single(array('id' =>
$id,'view' => true));
$action = 'edit';
Modified: trunk/property/setup/phpgw_no.lang
===================================================================
--- trunk/property/setup/phpgw_no.lang 2018-01-09 09:54:17 UTC (rev 17513)
+++ trunk/property/setup/phpgw_no.lang 2018-01-09 15:11:44 UTC (rev 17514)
@@ -2392,4 +2392,5 @@
TTS default interface property no TTS default interface
FM settings property no Innstillinger for eiendomsforvaltning
pending action type property no Handlingstyper
-comma separated email addresses to be notified about tenant claim
property no Kommmaseparert liste over hvem som skal ha e-post om
leietakerkrav
\ No newline at end of file
+comma separated email addresses to be notified about tenant claim
property no Kommmaseparert liste over hvem som skal ha e-post om
leietakerkrav
+record has been saved property no Posten er lagret
\ No newline at end of file
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [17514] property: allow 0 as id at generic,
sigurdne <=