[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [15552] rental: more on application
From: |
sigurdne |
Subject: |
[Fmsystem-commits] [15552] rental: more on application |
Date: |
Wed, 31 Aug 2016 18:12:20 +0000 (UTC) |
Revision: 15552
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15552
Author: sigurdne
Date: 2016-08-31 18:12:20 +0000 (Wed, 31 Aug 2016)
Log Message:
-----------
rental: more on application
Modified Paths:
--------------
trunk/rental/inc/class.soapplication.inc.php
trunk/rental/inc/model/class.application.inc.php
Modified: trunk/rental/inc/class.soapplication.inc.php
===================================================================
--- trunk/rental/inc/class.soapplication.inc.php 2016-08-31 12:32:37 UTC
(rev 15551)
+++ trunk/rental/inc/class.soapplication.inc.php 2016-08-31 18:12:20 UTC
(rev 15552)
@@ -64,4 +64,38 @@
return $object;
}
+ protected function update( $object )
+ {
+ $this->db->transaction_begin();
+
+ $original =
$this->read_single($object->get_id());//returned as array()
+ foreach ($this->fields as $field => $params)
+ {
+ $new_value = $object->$field;
+ $old_value = $original[$field];
+ $label = !empty($params['label']) ?
lang($params['label']) : $field;
+ if (!empty($params['history']) && ($new_value
!= $old_value))
+ {
+ $value_set = array
+ (
+ 'application_id' =>
$object->get_id(),
+ 'time' => time(),
+ 'author' =>
$GLOBALS['phpgw_info']['user']['fullname'],
+ 'comment' => $label . '::
' . lang('old value') . ': ' . $this->db->db_addslashes($old_value) . ', '
.lang('new value') . ': ' . $this->db->db_addslashes($new_value),
+ 'type' => 'history',
+ );
+
+ $this->db->query( 'INSERT INTO
rental_application_comment (' . implode( ',', array_keys( $value_set ) ) .
') VALUES ('
+ . $this->db->validate_insert(
array_values( $value_set ) ) . ')',__LINE__,__FILE__);
+ }
+
+ }
+
+ parent::update($object);
+
+ return $this->db->transaction_commit();
+
+
+ }
+
}
\ No newline at end of file
Modified: trunk/rental/inc/model/class.application.inc.php
===================================================================
--- trunk/rental/inc/model/class.application.inc.php 2016-08-31 12:32:37 UTC
(rev 15551)
+++ trunk/rental/inc/model/class.application.inc.php 2016-08-31 18:12:20 UTC
(rev 15552)
@@ -191,7 +191,9 @@
'assign_date_end' => array('action'=>
PHPGW_ACL_READ | PHPGW_ACL_EDIT,
'type' => 'date'),
'status' => array('action'=> PHPGW_ACL_READ |
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
- 'type' => 'int'),
+ 'type' => 'int',
+ 'history' => true,
+ ),
'entry_date' => array('action'=> PHPGW_ACL_READ
| PHPGW_ACL_ADD,
'type' => 'int',
'label' => 'entry_date',
@@ -201,7 +203,7 @@
'type' => 'int',
'label' => 'executive_officer',
'sortable' => true,
- 'hidden' => false
+ 'history' => true,
),
'identifier' => array('action'=> PHPGW_ACL_ADD
| PHPGW_ACL_EDIT,
'type' => 'string'),
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [15552] rental: more on application,
sigurdne <=