phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] tasks/class.base.php, 1.1.2.4


From: nomail
Subject: [Phpgroupware-cvs] tasks/class.base.php, 1.1.2.4
Date: Sun, 23 May 2004 06:24:29 -0000

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

date: 2004/05/07 00:11:33;  author: jengo;  state: Exp;  lines: +8 -17

Log Message:
- Fixed viewing tasks not working
- Added proper support for last insert id, using the ADODB build in sequences.  
This will allow better cross database support.
- Currently, MySQL will create a seperate table for each table that uses 
sequences, I don't like this.  I would prefear to create a single generic table 
for sequences on databases that don't have native support for sequences.  For 
now, this is fine.
=====================================================================
Index: tasks/class.base.php
diff -u tasks/class.base.php:1.1.2.3 tasks/class.base.php:1.1.2.4
--- tasks/class.base.php:1.1.2.3        Fri Apr 23 05:42:04 2004
+++ tasks/class.base.php        Fri May  7 00:11:33 2004
@@ -265,9 +265,11 @@
                                        $args['end']    = 
$GLOBALS['phpgw']->db->dbtimestamp(time());
                                        $args['status'] = 0;
 
+                                       $task_id  = 
$GLOBALS['phpgw']->db->genid('phpgw_tasks_task_id_seq');
                                        $dbresult = 
$GLOBALS['phpgw']->db->execute("
                                                INSERT INTO phpgw_tasks
-                                                       (task_owner,
+                                                       (task_id,
+                                                       task_owner,
                                                        task_responsible,
                                                        task_subject,
                                                        task_category,
@@ -281,7 +283,8 @@
                                                        task_modified,
                                                        task_created)
                                                VALUES
-                                                       (" . 
$GLOBALS['phpgw_data']['user']['id'] . ",
+                                                       ($task_id,
+                                                       " . 
$GLOBALS['phpgw_data']['user']['id'] . ",
                                                        0,
                                                        '" . $args['subject'] . 
"',
                                                        " . $args['category'] . 
",
@@ -295,18 +298,6 @@
                                                        now(),
                                                        now())");
 
-                                       $dbresult = 
$GLOBALS['phpgw']->db->execute("
-                                               SELECT
-                                                       *
-                                               FROM
-                                                       phpgw_tasks
-                                               WHERE
-                                                       task_subject='" . 
$args['subject'] . "'
-                                               AND
-                                                       task_description='" . 
$args['description'] . "'
-                                               ORDER BY task_created desc");
-                                       $task_id  = 
$dbresult->fields['task_id'];
-
                                        if ($task_id)
                                        {
                                                $history_data = array
@@ -552,13 +543,13 @@
                                AND
                                        task_id=" . $args['id']);
 
-                       if (! $dbresult->EOF)
+                       if ($dbresult->EOF)
                        {
                                return false;
                        }
                        else
                        {
-                               return $this->__get_item(&$dbresult);
+                               return $this->__get_record(&$dbresult);
                        }
                }
 




reply via email to

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