[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [12558]
From: |
Nelson Guerra |
Subject: |
[Fmsystem-commits] [12558] |
Date: |
Wed, 07 Jan 2015 23:21:43 +0000 |
Revision: 12558
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=12558
Author: nelson224
Date: 2015-01-07 23:21:42 +0000 (Wed, 07 Jan 2015)
Log Message:
-----------
Modified Paths:
--------------
branches/dev-syncromind/property/inc/class.uigeneric.inc.php
Modified: branches/dev-syncromind/property/inc/class.uigeneric.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.uigeneric.inc.php
2015-01-07 15:21:29 UTC (rev 12557)
+++ branches/dev-syncromind/property/inc/class.uigeneric.inc.php
2015-01-07 23:21:42 UTC (rev 12558)
@@ -103,8 +103,6 @@
*/
private function _populate($data = array())
{
- //$insert_record =
phpgwapi_cache::session_get('property', 'insert_record');
-
$id_name = $this->location_info['id']['name'];
$id = phpgw::get_var($id_name);
@@ -175,8 +173,8 @@
$this->receipt['error'][]=array('msg'=>lang('Please enter integer for attribute
%1', $attribute['input_text']));
}
}
+
$data['attributes'] = $values_attribute;
- //$data =
$this->custom->preserve_attribute_values($data,$values_attribute);
}
return $data;
@@ -306,9 +304,6 @@
return;
}
- //$receipt =
$GLOBALS['phpgw']->session->appsession('session_data',
"general_receipt_{$this->type}_{$this->type_id}");
- //$this->save_sessiondata();
-
$GLOBALS['phpgw_info']['apps']['manual']['section'] =
"general.index.{$this->type}";
if (phpgw::get_var('phpgw_return_as') == 'json')
@@ -551,28 +546,37 @@
}
$id =
phpgw::get_var($this->location_info['id']['name']);
+ $values_attribute = phpgw::get_var('values_attribute');
$GLOBALS['phpgw_info']['apps']['manual']['section'] =
'general.edit.' . $this->type;
if ($id)
{
- if (!$values)
- {
- $values =
$this->bo->read_single(array('id' => $id));
- $function_msg =
$this->location_info['edit_msg'];
- $action='edit';
- }
+ $values = $this->bo->read_single(array('id' =>
$id));
+ $function_msg =
$this->location_info['edit_msg'];
+ $action='edit';
}
else
{
- if (!$values)
+ $values = $this->bo->read_single();
+ $function_msg = $this->location_info['add_msg'];
+ $action='add';
+ }
+
+ /* Preserve attribute values from post */
+ if($this->receipt['error'])
+ {
+ foreach ( $this->location_info['fields'] as
$field )
{
- $values = $this->bo->read_single();
- $function_msg =
$this->location_info['add_msg'];
- $action='add';
+ $values[$field['name']] =
phpgw::clean_value($_POST['values'][$field['name']]);
}
+
+ if(isset( $values_attribute) && is_array(
$values_attribute))
+ {
+ $values =
$this->custom->preserve_attribute_values($values,$values_attribute);
+ }
}
-
+
$link_save = array
(
'menuaction' =>
'property.uigeneric.save',
@@ -1001,7 +1005,7 @@
if( $this->receipt['error'] )
{
- $this->edit( $data );
+ $this->edit();
}
else
{
@@ -1019,7 +1023,7 @@
if ( $e )
{
phpgwapi_cache::message_set($e->getMessage(), 'error');
- $this->edit( $data );
+ $this->edit();
return;
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [12558],
Nelson Guerra <=