phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] notes/class.base.php, 1.1.2.15


From: nomail
Subject: [Phpgroupware-cvs] notes/class.base.php, 1.1.2.15
Date: Mon, 5 Jul 2004 21:03:04 +0200

Update of /notes
Modified Files:
        Branch: proposal-branch
          class.base.php

date: 2004/07/05 19:03:04;  author: jengo;  state: Exp;  lines: +30 -9

Log Message:
- Added acl_id column for new ACL changes (Will commit later this week)
- Added transaction block, if the insert fails the datamine entry isn't created
=====================================================================
Index: notes/class.base.php
diff -u notes/class.base.php:1.1.2.14 notes/class.base.php:1.1.2.15
--- notes/class.base.php:1.1.2.14       Wed Jun 30 07:00:16 2004
+++ notes/class.base.php        Mon Jul  5 19:03:04 2004
@@ -259,16 +259,37 @@
                                else
                                {
                                        $note_id = 
$GLOBALS['phpgw']->db->genid('phpgw_notes_seq');
-                                       $GLOBALS['phpgw']->db->execute("INSERT 
INTO phpgw_notes (note_id,note_owner,"
-                                               . 
"note_access,note_category,note_content,note_dm_type,note_modified,"
-                                               . "note_created) values 
($note_id,'" . $GLOBALS['phpgw_data']['user']['id']
-                                               . "','" . $args['access'] . 
"','" . $args['category']
-                                               . "','" . $args['content'] . 
"','" . $args['dm_type']
-                                               . "',now(),now())");
-                                               
+                                       $GLOBALS['phpgw']->db->starttrans();
+                                       $GLOBALS['phpgw']->db->execute("
+                                               INSERT INTO
+                                                       phpgw_notes
+                                               (
+                                                       note_id,
+                                                       note_owner,
+                                                       note_access,
+                                                       note_category,
+                                                       note_content,
+                                                       note_dm_type,
+                                                       note_modified,
+                                                       note_created,
+                                                       acl_id
+                                               )
+                                               VALUES
+                                               (
+                                                       $note_id,
+                                                       '" . 
$GLOBALS['phpgw_data']['user']['id'] . "',
+                                                       '" . $args['access'] . 
"',
+                                                       '" . $args['category'] 
. "',
+                                                       '" . $args['content'] . 
"',
+                                                       '" . $args['dm_type'] . 
"',
+                                                       now(),
+                                                       now(),
+                                                       -1
+                                               )
+                                       ");
 
                                        // If insert works, show this message 
then forward them to view the new note
-                                       if ($note_id)
+                                       if 
($GLOBALS['phpgw']->db->completetrans())
                                        {
                                                
$this->__update_history($note_id,$args,array());
 




reply via email to

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