fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [9843] proprty: missing add-function


From: Sigurd Nes
Subject: [Fmsystem-commits] [9843] proprty: missing add-function
Date: Mon, 13 Aug 2012 13:18:37 +0000

Revision: 9843
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9843
Author:   sigurdne
Date:     2012-08-13 13:18:36 +0000 (Mon, 13 Aug 2012)
Log Message:
-----------
proprty: missing add-function

Modified Paths:
--------------
    trunk/property/inc/class.soresponsible.inc.php

Modified: trunk/property/inc/class.soresponsible.inc.php
===================================================================
--- trunk/property/inc/class.soresponsible.inc.php      2012-08-13 12:25:22 UTC 
(rev 9842)
+++ trunk/property/inc/class.soresponsible.inc.php      2012-08-13 13:18:36 UTC 
(rev 9843)
@@ -390,7 +390,41 @@
                }
 
 
+               public function add_role($data)
+               {
+                       $receipt = array();
 
+                       $values_insert['name']                                  
=$this->db->db_addslashes($data['name']);
+                       $values_insert['remark']                                
= $this->db->db_addslashes($data['remark']);
+                       $values_insert['responsibility_id']             = 
$data['responsibility_id'];
+                       $values_insert['location_level']                = 
implode(',', $data['location_level']);
+                       $values_insert['modified_date']                 = 
time();
+                       $values_insert['entry_date']                    = 
time();
+                       $values_insert['user_id']                               
= $this->account;
+                       //FIXME
+                       $values_insert['appname']                               
= 'property';
+                       $values_insert['id'] = 
$this->db->next_id('fm_responsibility_role');
+
+                       $this->db->transaction_begin();
+
+                       $this->db->query("INSERT INTO fm_responsibility_role (" 
. implode(',',array_keys($values_insert)) . ') VALUES ('
+                        . 
$this->db->validate_insert(array_values($values_insert)) . 
')',__LINE__,__FILE__);
+
+
+                       if($this->db->transaction_commit())
+                       {
+                               
$receipt['message'][]=array('msg'=>lang('Responsibility role has been 
changed'));
+                               $receipt['id']= 
$values_insert['id'];//$this->db->get_last_insert_id('fm_responsibility_role', 
'id');
+                       }
+                       else
+                       {
+                               
$receipt['message'][]=array('msg'=>lang('Nothing changed'));
+                       }
+
+                       return $receipt;
+               }
+
+
                public function edit_role($data)
                {
                        $receipt = array();




reply via email to

[Prev in Thread] Current Thread [Next in Thread]