phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] addressbook/inc hook_notifywindow.inc.php, 1.5.2.1.2.


From: Jonathan Rivera <address@hidden>
Subject: [Phpgroupware-cvs] addressbook/inc hook_notifywindow.inc.php, 1.5.2.1.2.1, 1.5.2.1.2.2 hook_home.inc.php, 1.13.2.5.2.2, 1.13.2.5.2.3
Date: Thu, 16 Oct 2003 23:13:39 +0000

Update of /cvsroot/phpgroupware/addressbook/inc
In directory subversions:/tmp/cvs-serv1942/addressbook/inc

Modified Files:
      Tag: Version-0_9_16-branch
        hook_notifywindow.inc.php hook_home.inc.php 
Log Message:
I modify this hooks for works with new contacts backend


Index: hook_notifywindow.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/addressbook/inc/hook_notifywindow.inc.php,v
retrieving revision 1.5.2.1.2.1
retrieving revision 1.5.2.1.2.2
diff -C2 -d -r1.5.2.1.2.1 -r1.5.2.1.2.2
*** hook_notifywindow.inc.php   8 Sep 2003 13:26:37 -0000       1.5.2.1.2.1
--- hook_notifywindow.inc.php   16 Oct 2003 23:13:36 -0000      1.5.2.1.2.2
***************
*** 30,36 ****
                $c = CreateObject('phpgwapi.contacts');
                $qfields = array(
!                       'n_given'  => 'n_given',
!                       'n_family' => 'n_family',
!                       'bday'     => 'bday'
                );
                $now = time() - ((60 * 60) * 
intval($GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset']));
--- 30,37 ----
                $c = CreateObject('phpgwapi.contacts');
                $qfields = array(
!                       'contact_id' => 'contact_id',
!                       'per_first_name'  => 'per_first_name',
!                       'per_last_name' => 'per_last_name',
!                       'per_birthday'     => 'per_birthday'
                );
                $now = time() - ((60 * 60) * 
intval($GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset']));
***************
*** 38,48 ****
  //            echo $today."\n";
  
!               $bdays = 
$c->read(0,15,$qfields,$today,'tid=n','','',$GLOBALS['phpgw_info']['user']['account_id']);
! 
                while(list($key,$val) = @each($bdays))
                {
                        $tmp = '<a href="'
!                               . 
$GLOBALS['phpgw']->link('/.php','menuaction=addressbook.uiaddressbook.view&ab_id='
 .  $val['id']) . '">'
!                               . $val['n_given'] . ' ' . $val['n_family'] . 
'</a>';
                        echo '<tr><td align="left">' . lang("Today is %1's 
birthday!", $tmp) . "</td></tr>\n";
                }
--- 39,50 ----
  //            echo $today."\n";
  
!               //$bdays = 
$c->read(0,15,$qfields,$today,'tid=n','','',$GLOBALS['phpgw_info']['user']['account_id']);
!               $criteria = array('per_birthday' => $today);
!               $bdays = $c->get_persons($qfields, 15, 0, '', '', $criteria);
                while(list($key,$val) = @each($bdays))
                {
                        $tmp = '<a href="'
!                               . 
$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.view_person&ab_id='
 .  $val['contact_id']) . '">'
!                               . $val['per_first_name'] . ' ' . 
$val['per_last_name'] . '</a>';
                        echo '<tr><td align="left">' . lang("Today is %1's 
birthday!", $tmp) . "</td></tr>\n";
                }
***************
*** 51,61 ****
  //            echo $tomorrow."\n";
  
!               $bdays = 
$c->read(0,15,$qfields,$tomorrow,'tid=n','','',$GLOBALS['phpgw_info']['user']['account_id']);
  
                while(list($key,$val) = @each($bdays))
                {
                        $tmp = '<a href="'
!                               . 
$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.view&ab_id='
 .  $val['id']) . '">'
!                               . $val['n_given'] . ' ' . $val['n_family'] . 
'</a>';
                        echo '<tr><td align="left">' . lang("Tomorrow is %1's 
birthday.", $tmp) . "</td></tr>\n";
                }
--- 53,65 ----
  //            echo $tomorrow."\n";
  
!               $criteria = array('per_birthday' => $tomorrow);
!               $bdays = $c->get_persons($qfields, 15, 0, '', '', $criteria);
!               //$bdays = 
$c->read(0,15,$qfields,$tomorrow,'tid=n','','',$GLOBALS['phpgw_info']['user']['account_id']);
  
                while(list($key,$val) = @each($bdays))
                {
                        $tmp = '<a href="'
!                               . 
$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.view_person&ab_id='
 .  $val['contact_id']) . '">'
!                               . $val['per_first_name'] . ' ' . 
$val['per_last_name'] . '</a>';
                        echo '<tr><td align="left">' . lang("Tomorrow is %1's 
birthday.", $tmp) . "</td></tr>\n";
                }

Index: hook_home.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/addressbook/inc/hook_home.inc.php,v
retrieving revision 1.13.2.5.2.2
retrieving revision 1.13.2.5.2.3
diff -C2 -d -r1.13.2.5.2.2 -r1.13.2.5.2.3
*** hook_home.inc.php   15 Sep 2003 15:24:32 -0000      1.13.2.5.2.2
--- hook_home.inc.php   16 Oct 2003 23:13:36 -0000      1.13.2.5.2.3
***************
*** 20,23 ****
--- 20,26 ----
        unset($d1);
  
+       $prev_currentapp = $GLOBALS['phpgw_info']['flags']['currentapp'];
+       $GLOBALS['phpgw_info']['flags']['currentapp'] = 'addressbook';
+       
        if ($GLOBALS['phpgw_info']['user']['apps']['addressbook']
                && 
$GLOBALS['phpgw_info']['user']['preferences']['addressbook']['mainscreen_showbirthdays'])
***************
*** 27,41 ****
                $c = CreateObject('phpgwapi.contacts');
                $qfields = array(
!                       'n_given'  => 'n_given',
!                       'n_family' => 'n_family',
!                       'bday'     => 'bday'
                );
                $now = time() - ((60 * 60) * 
intval($GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset']));
                $today = $GLOBALS['phpgw']->common->show_date($now,'n/d/');
                
!               $bdays = 
$c->read(0,15,$qfields,$today,'tid=n','','',$GLOBALS['phpgw_info']['user']['account_id']);
                
!               $title = '<center><font 
color="#FFFFFF">'.lang('Birthdays').'</font></center>';
  
                $portalbox = CreateObject('phpgwapi.listbox',
                        Array(
--- 30,48 ----
                $c = CreateObject('phpgwapi.contacts');
                $qfields = array(
!                       'contact_id' => 'contact_id',
!                       'per_first_name'  => 'per_first_name',
!                       'per_last_name' => 'per_last_name',
!                       'per_birthday'     => 'per_birthday'
                );
                $now = time() - ((60 * 60) * 
intval($GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset']));
                $today = $GLOBALS['phpgw']->common->show_date($now,'n/d/');
                
!               $criteria = array('per_birthday' => $today);
!               $bdays = $c->get_persons($qfields, 15, 0, '', '', $criteria);
!               //$bdays = 
$c->read(0,15,$qfields,$today,'tid=n','','',$GLOBALS['phpgw_info']['user']['account_id']);
                
!               $title = '<font color="#FFFFFF">'.lang('Birthdays').'</font>';
  
+               if ((isset($prev_currentapp))                                   
                                                                                
                 && ($prev_currentapp)                                          
                                                                                
                  && ($GLOBALS['phpgw_info']['flags']['currentapp'] != 
$prev_currentapp))                                                              
                            {                                                   
                                                                                
                                     
$GLOBALS['phpgw_info']['flags']['currentapp'] = $prev_currentapp;               
                                                                         }  
                $portalbox = CreateObject('phpgwapi.listbox',
                        Array(
***************
*** 68,107 ****
                while(list($key,$val) = @each($bdays))
                {
!                       if (substr($val['bday'],0,strlen($today)) == $today)
!                       {
!                               $portalbox->data[] = array(
!                                       'text' => lang("Today is %1's 
birthday!", $val['n_given'] . ' ' . $val['n_family']),
!                                       'link' => 
$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.view&ab_id='
 .  $val['id'])
!                               );
!                       }
! //                    $tmp = '<a href="'
! //                            . 
$GLOBALS['phpgw']->link('/addressbook/view.php','ab_id=' .  $val['id']) . '">'
! //                            . $val['n_given'] . ' ' . $val['n_family'] . 
'</a>';
! //                    echo '<tr><td align="left">' . lang("Today is %1's 
birthday!", $tmp) . '</td></tr>' . "\n";
                }
  
                $tomorrow = $GLOBALS['phpgw']->common->show_date($now + 
86400,'n/d/');
  
!               $bdays = 
$c->read(0,15,$qfields,$tomorrow,'tid=n','','',$GLOBALS['phpgw_info']['user']['account_id']);
  
                while(list($key,$val) = @each($bdays))
                {
!                       if (substr($val['bday'],0,strlen($tomorrow)) == 
$tomorrow)
!                       {
!                               $portalbox->data[] = array(
!                                       'text' => lang("Tomorrow is %1's 
birthday.",$val['n_given'] . ' ' . $val['n_family']),
!                                       'link' => 
$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.view&ab_id='.$val['id'])
!                               );
!                       }
! //                    $tmp = '<a href="'
! //                            . 
$GLOBALS['phpgw']->link('/addressbook/view.php','ab_id=' .  $val['id']) . '">'
! //                            . $val['n_given'] . ' ' . $val["n_family"] . 
'</a>';
! //                    echo '<tr><td align="left">' . lang("Tomorrow is %1's 
birthday.", $tmp) . '</td></tr>' . "\n";
                }
                if(count($portalbox->data))
                {
                        echo $portalbox->draw();
                }
!               unset($portalbox);
                echo "\n<!-- Birthday info -->\n";
        }
--- 75,103 ----
                while(list($key,$val) = @each($bdays))
                {
!                       $portalbox->data[] = array(
!                               'text' => lang("Today is %1's birthday!", 
$val['per_first_name'] . ' ' . $val['per_last_name']),
!                               'link' => 
$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.view_person&ab_id='
 .  $val['contact_id'])
!                       );
                }
  
                $tomorrow = $GLOBALS['phpgw']->common->show_date($now + 
86400,'n/d/');
  
!               $criteria = array('per_birthday' => $tomorrow);
!               $bdays = $c->get_persons($qfields, 15, 0, '', '', $criteria);
  
                while(list($key,$val) = @each($bdays))
                {
!                       $portalbox->data[] = array(
!                               'text' => lang("Tomorrow is %1's 
birthday.",$val['per_first_name'] . ' ' . $val['per_last_name']),
!                               'link' => 
$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.view_person&ab_id='.$val['contact_id'])
!                       );
                }
+               
                if(count($portalbox->data))
                {
                        echo $portalbox->draw();
                }
! 
!               //unset($portalbox);
                echo "\n<!-- Birthday info -->\n";
        }





reply via email to

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