phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: todo/inc class.bo.inc.php,1.10,1.11 class.so.inc


From: Bettina Gille <address@hidden>
Subject: [Phpgroupware-cvs] CVS: todo/inc class.bo.inc.php,1.10,1.11 class.so.inc.php,1.5,1.6 class.ui.inc.php,1.14,1.15
Date: Sat, 13 Apr 2002 17:20:36 -0400

Update of /cvsroot/phpgroupware/todo/inc
In directory subversions:/tmp/cvs-serv2567

Modified Files:
        class.bo.inc.php class.so.inc.php class.ui.inc.php 
Log Message:
some fixes

Index: class.bo.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/todo/inc/class.bo.inc.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** class.bo.inc.php    13 Apr 2002 18:58:41 -0000      1.10
--- class.bo.inc.php    13 Apr 2002 21:20:32 -0000      1.11
***************
*** 38,42 ****
                function bo($session=False)
                {
!                       $this->sotodo = CreateObject('todo.so');
  
                        if ($session)
--- 38,43 ----
                function bo($session=False)
                {
!                       $this->sotodo   = CreateObject('todo.so');
!                       $this->datetime = CreateObject('phpgwapi.datetime');
  
                        if ($session)
***************
*** 201,207 ****
                        while (is_array($todos) && list(,$v) = each($todos))
                        {
!                               $v['sdate'] = 
$GLOBALS['phpgw']->common->show_date($v['sdate'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
!                               $v['edate'] = 
$GLOBALS['phpgw']->common->show_date($v['edate'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
!               
                                if ($v['assigned'])
                                {
--- 202,214 ----
                        while (is_array($todos) && list(,$v) = each($todos))
                        {
!                               $sdate          = $v['sdate'] - 
$this->datetime->tz_offset;
!                               $v['sdate'] = 
$GLOBALS['phpgw']->common->show_date($sdate,$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
! 
!                               if ($v['edate'] && $v['edate'] != 0)
!                               {
!                                       $edate          = $v['edate'] - 
$this->datetime->tz_offset;
!                                       $v['edate']     = 
$GLOBALS['phpgw']->common->show_date($edate,$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
!                               }
! 
                                if ($v['assigned'])
                                {
***************
*** 254,259 ****
                function check_values($values)
                {
-                       $datetime = CreateObject('phpgwapi.datetime');
- 
                        if (!$values['title'])
                        {
--- 261,264 ----
***************
*** 273,277 ****
                        if ($values['smonth'] || $values['sday'] || 
$values['syear'])
                        {
!                               if(! 
$datetime->date_valid($values['syear'],$values['smonth'],$values['sday']))
                                {
                                        $error[] = lang('You have entered an 
starting invalid date');
--- 278,282 ----
                        if ($values['smonth'] || $values['sday'] || 
$values['syear'])
                        {
!                               if(! 
$this->datetime->date_valid($values['syear'],$values['smonth'],$values['sday']))
                                {
                                        $error[] = lang('You have entered an 
starting invalid date');
***************
*** 281,285 ****
                        if ($values['emonth'] || $values['eday'] || 
$values['eyear'])
                        {
!                               if(! 
$datetime->date_valid($values['eyear'],$values['emonth'],$values['eday']))
                                {
                                        $error[] = lang('You have entered an 
ending invalid date');
--- 286,290 ----
                        if ($values['emonth'] || $values['eday'] || 
$values['eyear'])
                        {
!                               if(! 
$this->datetime->date_valid($values['eyear'],$values['emonth'],$values['eday']))
                                {
                                        $error[] = lang('You have entered an 
ending invalid date');
***************
*** 294,298 ****
                        if (($values['smonth'] || $values['sday'] || 
$values['syear']) && ($values['emonth'] || $values['eday'] || $values['eyear']))
                        {
!                               
if($datetime->date_compare($values['eyear'],$values['emonth'],$values['eday'],$values['syear'],$values['smonth'],$values['sday'])
 == -1)
                                {
                                        $error[] = lang('Ending date can not be 
before start date');
--- 299,303 ----
                        if (($values['smonth'] || $values['sday'] || 
$values['syear']) && ($values['emonth'] || $values['eday'] || $values['eyear']))
                        {
!                               
if($this->datetime->date_compare($values['eyear'],$values['emonth'],$values['eday'],$values['syear'],$values['smonth'],$values['sday'])
 == -1)
                                {
                                        $error[] = lang('Ending date can not be 
before start date');

Index: class.so.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/todo/inc/class.so.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** class.so.inc.php    1 Feb 2002 04:01:46 -0000       1.5
--- class.so.inc.php    13 Apr 2002 21:20:32 -0000      1.6
***************
*** 181,190 ****
                function add_todo($values)
                {
!                       ob_start();
!                       print_r($values);
!                       $contents = ob_get_contents();
!                       ob_end_clean();
  
!                       $GLOBALS['phpgw']->log->message(array(
                                'text' => 'debug, so add_todo values: %1',
                                'p1'   => $contents,
--- 181,194 ----
                function add_todo($values)
                {
!                       if (floor(phpversion()) == 4)
!                       {
!                               ob_start();
!                               print_r($values);
!                               $contents = ob_get_contents();
!                               ob_end_clean();
!                       }
  
!                       $GLOBALS['phpgw']->log->message(array
!                       (
                                'text' => 'debug, so add_todo values: %1',
                                'p1'   => $contents,
***************
*** 196,201 ****
                        if ($values['parent'] && $values['parent'] != 0)
                        {
!                               $values['main'] = 
$this->return_value($values['parent']);
!                               $values['level'] = 
$this->return_value($values['parent'],'level')+1;
                        }
  
--- 200,205 ----
                        if ($values['parent'] && $values['parent'] != 0)
                        {
!                               $values['main']         = 
$this->return_value($values['parent']);
!                               $values['level']        = 
$this->return_value($values['parent'],'level')+1;
                        }
  
***************
*** 206,210 ****
                        $this->db->query("insert into phpgw_todo 
(todo_id_main,todo_id_parent,todo_level,todo_owner,todo_access,todo_cat,"
                                . 
"todo_des,todo_title,todo_pri,todo_status,todo_datecreated,todo_startdate,todo_enddate,todo_assigned,assigned_group)
 values ('"
!                               . $values['main'] . "','" . $values['parent'] . 
"','" . $values['level'] . "','" . $this->owner . "','" . $values['access']
                                . "','" . $values['cat'] . "','" . 
$values['descr'] . "','" . $values['title'] . "','" . $values['pri'] . "','"
                                . $values['status'] . "','" . time() . "','" . 
$values['sdate'] . "','" . $values['edate'] . "','" . $values['assigned']
--- 210,214 ----
                        $this->db->query("insert into phpgw_todo 
(todo_id_main,todo_id_parent,todo_level,todo_owner,todo_access,todo_cat,"
                                . 
"todo_des,todo_title,todo_pri,todo_status,todo_datecreated,todo_startdate,todo_enddate,todo_assigned,assigned_group)
 values ('"
!                               . $values['main'] . "','" . $values['parent'] . 
"','" . $values['level'] . "','" . $this->account . "','" . $values['access']
                                . "','" . $values['cat'] . "','" . 
$values['descr'] . "','" . $values['title'] . "','" . $values['pri'] . "','"
                                . $values['status'] . "','" . time() . "','" . 
$values['sdate'] . "','" . $values['edate'] . "','" . $values['assigned']
***************
*** 234,238 ****
  
                        $this->db->query("delete from phpgw_todo where 
todo_id='$todo_id' $subdelete and ((todo_access='public' "
!                                                       . "and todo_owner != '" 
. $this->owner . "') or (todo_owner='" . $this->owner . 
"'))",__LINE__,__FILE__);
                        $this->historylog->delete($todo_id);
                        $this->db->transaction_commit();
--- 238,242 ----
  
                        $this->db->query("delete from phpgw_todo where 
todo_id='$todo_id' $subdelete and ((todo_access='public' "
!                                                       . "and todo_owner != '" 
. $this->account . "') or (todo_owner='" . $this->account . 
"'))",__LINE__,__FILE__);
                        $this->historylog->delete($todo_id);
                        $this->db->transaction_commit();

Index: class.ui.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/todo/inc/class.ui.inc.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** class.ui.inc.php    15 Mar 2002 22:31:51 -0000      1.14
--- class.ui.inc.php    13 Apr 2002 21:20:32 -0000      1.15
***************
*** 29,36 ****
                function ui()
                {
!                       $this->bo     = CreateObject('todo.bo',True);
!                       $this->nextmatchs = CreateObject('phpgwapi.nextmatchs');
!                       $this->historylog = 
CreateObject('phpgwapi.historylog','todo');
!                       $this->historylog->types = array(
                                'A' => lang('Entry added'),
                                'C' => lang('Category changed'),
--- 29,37 ----
                function ui()
                {
!                       $this->bo                       = 
CreateObject('todo.bo',True);
!                       $this->nextmatchs       = 
CreateObject('phpgwapi.nextmatchs');
!                       $this->historylog       = 
CreateObject('phpgwapi.historylog','todo');
!                       $this->historylog->types = array
!                       (
                                'A' => lang('Entry added'),
                                'C' => lang('Category changed'),
***************
*** 45,49 ****
                        );
  
!                       $this->historylog->alternate_handlers = array(
                                'S' => '$GLOBALS[\'phpgw\']->common->show_date',
                                'E' => '$GLOBALS[\'phpgw\']->common->show_date',
--- 46,51 ----
                        );
  
!                       $this->historylog->alternate_handlers = array
!                       (
                                'S' => '$GLOBALS[\'phpgw\']->common->show_date',
                                'E' => '$GLOBALS[\'phpgw\']->common->show_date',
***************
*** 199,202 ****
--- 201,206 ----
                                {
                                        $datedue = 
$todo_list[$i]['edate_epoch'];
+                                       $datedue = $datedue - 
$this->bo->datetime->tz_offset;
+ 
                                        $month  = 
$GLOBALS['phpgw']->common->show_date(time(),'n');
                                        $day    = 
$GLOBALS['phpgw']->common->show_date(time(),'d');
***************
*** 204,208 ****
                                        $currentdate = 
mktime(2,0,0,$month,$day,$year);
  
-                                       $datedue = $datedue + (60*60) * 
$GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'];
                                        if (($currentdate >= $datedue) && 
($todo_list[$i]['status'] < 100))
                                        {
--- 208,211 ----
***************
*** 507,512 ****
                        
$this->t->set_var('value_category',$this->cats->id2name($values['cat']));
  
!                       
$this->t->set_var('value_start_date',$GLOBALS['phpgw']->common->show_date($values['sdate'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']));
!                       
$this->t->set_var('value_end_date',$GLOBALS['phpgw']->common->show_date($values['edate'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']));
  
                        $parent_values = $this->bo->read($values['parent']);
--- 510,521 ----
                        
$this->t->set_var('value_category',$this->cats->id2name($values['cat']));
  
!                       $sdate = $values['sdate'] - 
$this->bo->datetime->tz_offset;
!                       
$this->t->set_var('value_start_date',$GLOBALS['phpgw']->common->show_date($sdate,$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']));
! 
!                       if ($values['edate'] && $values['edate'] != 0)
!                       {
!                               $edate = $values['edate'] - 
$this->bo->datetime->tz_offset;
!                               
$this->t->set_var('value_end_date',$GLOBALS['phpgw']->common->show_date($edate,$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']));
!                       }
  
                        $parent_values = $this->bo->read($values['parent']);
***************
*** 688,692 ****
                                if ($subs)
                                {
!                                       $this->bo->delete_todo($todo_id,True);
                                }
                                else
--- 697,701 ----
                                if ($subs)
                                {
!                                       $this->bo->delete($todo_id,True);
                                }
                                else




reply via email to

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