[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] notes/class.base.php, 1.1.2.4
From: |
nomail |
Subject: |
[Phpgroupware-cvs] notes/class.base.php, 1.1.2.4 |
Date: |
Thu, 20 May 2004 16:21:59 -0000 |
Update of /notes
Modified Files:
Branch: proposal-branch
class.base.php
date: 2004/04/18 04:50:01; author: jengo; state: Exp; lines: +44 -12
Log Message:
Some small changes to problem flow, needed for the rollback features
=====================================================================
No syntax errors detected in -
=====================================================================
Index: notes/class.base.php
diff -u notes/class.base.php:1.1.2.3 notes/class.base.php:1.1.2.4
--- notes/class.base.php:1.1.2.3 Sun Apr 18 04:36:29 2004
+++ notes/class.base.php Sun Apr 18 04:50:01 2004
@@ -344,16 +344,8 @@
$GLOBALS['phpgw']->add_appmenu('Notes
menu','Edit note','notes.base.edit¬e_id=' . $args['note_id']);
$GLOBALS['phpgw']->add_appmenu('Notes
menu','Delete note','notes.base.delete¬e_id=' . $args['note_id']);
- $GLOBALS['phpgw']->db->execute("
- UPDATE
- phpgw_notes
- SET
- note_content='" .
$args['content'] . "',
- note_access='" .
$args['access'] . "',
- note_category='" .
$args['category'] . "'
- WHERE
- note_id=" .
$args['note_id']);
-
+ if ($this->_update($args))
+ {
$old_values = array
(
'access' =>
$note_values['access'],
@@ -378,7 +370,13 @@
$obj->set('notes.base.' .
$args['note_id'],$history_data,$old_values);
$GLOBALS['msgbox']->add(lang('Note has been successfully updated'),'notice');
- return
$this->view($args['note_id']);
+ }
+ else
+ {
+
$GLOBALS['msgbox']->add(lang('There was a problem updating this
note'),'warning');
+ }
+
+ return $this->view($args['note_id']);
}
else
{
@@ -450,6 +448,40 @@
return $result;
}
+
+ function _update()
+ {
+ $args = new safe_args();
+ $args->set('note_id',REQUIRED,'number');
+ $args->set('access',NOTSET,'string');
+ $args->set('content',NOTSET,'string');
+ $args->set('category',NOTSET,'number');
+ $args = $args->get(func_get_args());
+
+ $dbresult = $GLOBALS['phpgw']->db->execute("
+ UPDATE
+ phpgw_notes
+ SET
+ note_content='" .
$args['content'] . "',
+ note_access='" .
$args['access'] . "',
+ note_category='" .
$args['category'] . "'
+ WHERE
+ note_id=" . $args['note_id']);
+
+ return ($GLOBALS['phpgw']->db->affected_rows() ? True :
False);
+ }
+
+ function _read()
+ {
+ $args = new safe_args();
+ $args->set('note_id',REQUIRED,'number');
+ $args = $args->get(func_get_args());
+
+ $dbresult = $GLOBALS['phpgw']->db->execute("SELECT *
FROM phpgw_notes WHERE note_id='"
+ . $args['note_id'] . "'");
+
+ return $this->__get_record(&$dbresult);
+ }
function _datamine_get()
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] notes/class.base.php, 1.1.2.4,
nomail <=