phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] infolog/inc class.vfs.inc.php class.bolink.inc....


From: Sigurd Nes
Subject: [Phpgroupware-cvs] infolog/inc class.vfs.inc.php class.bolink.inc....
Date: Tue, 13 Feb 2007 15:02:07 +0000

CVSROOT:        /sources/phpgroupware
Module name:    infolog
Changes by:     Sigurd Nes <sigurdne>   07/02/13 15:02:07

Modified files:
        inc            : class.vfs.inc.php class.bolink.inc.php 
                         hook_settings.inc.php hook_preferences.inc.php 
                         hook_home.inc.php hook_deleteaccount.inc.php 
                         hook_admin.inc.php class.uilink.inc.php 
                         class.uiinfolog.inc.php 
                         class.uicustomfields.inc.php 
                         class.solink.inc.php class.soinfolog.inc.php 
                         class.sbox2.inc.php 
                         class.customfields_widget.inc.php 
                         class.boinfolog.inc.php 

Log message:
        notices , merging .16 and head

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/infolog/inc/class.vfs.inc.php?cvsroot=phpgroupware&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/infolog/inc/class.bolink.inc.php?cvsroot=phpgroupware&r1=1.27&r2=1.28
http://cvs.savannah.gnu.org/viewcvs/infolog/inc/hook_settings.inc.php?cvsroot=phpgroupware&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/infolog/inc/hook_preferences.inc.php?cvsroot=phpgroupware&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/infolog/inc/hook_home.inc.php?cvsroot=phpgroupware&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/infolog/inc/hook_deleteaccount.inc.php?cvsroot=phpgroupware&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/infolog/inc/hook_admin.inc.php?cvsroot=phpgroupware&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/infolog/inc/class.uilink.inc.php?cvsroot=phpgroupware&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/infolog/inc/class.uiinfolog.inc.php?cvsroot=phpgroupware&r1=1.80&r2=1.81
http://cvs.savannah.gnu.org/viewcvs/infolog/inc/class.uicustomfields.inc.php?cvsroot=phpgroupware&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/infolog/inc/class.solink.inc.php?cvsroot=phpgroupware&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/infolog/inc/class.soinfolog.inc.php?cvsroot=phpgroupware&r1=1.27&r2=1.28
http://cvs.savannah.gnu.org/viewcvs/infolog/inc/class.sbox2.inc.php?cvsroot=phpgroupware&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/infolog/inc/class.customfields_widget.inc.php?cvsroot=phpgroupware&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/infolog/inc/class.boinfolog.inc.php?cvsroot=phpgroupware&r1=1.44&r2=1.45

Patches:
Index: class.vfs.inc.php
===================================================================
RCS file: /sources/phpgroupware/infolog/inc/class.vfs.inc.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- class.vfs.inc.php   12 Feb 2007 14:46:01 -0000      1.12
+++ class.vfs.inc.php   13 Feb 2007 15:02:07 -0000      1.13
@@ -13,7 +13,7 @@
  * published by the Free Software Foundation; either version 2.1 of the *
  *License, or at your option) any later version.                       *
  \**********************************************************************/
- /* $Id: class.vfs.inc.php,v 1.12 2007/02/12 14:46:01 sigurdne Exp $ */
+ /* $Id: class.vfs.inc.php,v 1.13 2007/02/13 15:02:07 sigurdne Exp $ */
 
        /*!
        @class vfs
@@ -83,6 +83,7 @@
                var $override_acl;
                var $linked_dirs;
                var $meta_types;
+               var $debug;
 
                /*!
                @function vfs
@@ -2091,7 +2092,7 @@
                        */
                        $query = $GLOBALS['phpgw']->db->query ("SELECT 
mime_type FROM phpgw_vfs WHERE directory='$p->fake_leading_dirs_clean' AND 
name='$p->fake_name_clean'" . $this->extra_sql (VFS_SQL_SELECT), __LINE__, 
__FILE__);
                        $GLOBALS['phpgw']->db->next_record ();
-                       $mime_type = $GLOBALS['phpgw']->db->Record['mime_type'];
+                       $mime_type = 
isset($GLOBALS['phpgw']->db->Record['mime_type']) ? 
$GLOBALS['phpgw']->db->Record['mime_type'] : '';
 
                        return ($mime_type);
                }
@@ -2272,7 +2273,7 @@
                                reset ($this->attributes);
                                while (list ($num, $attribute) = each 
($this->attributes))
                                {
-                                       $rarray[0][$attribute] = 
$record[$attribute];
+                                       $rarray[0][$attribute] = 
isset($record[$attribute]) ? $record[$attribute] : '';
                                }
 
                                return $rarray;

Index: class.bolink.inc.php
===================================================================
RCS file: /sources/phpgroupware/infolog/inc/class.bolink.inc.php,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28
--- class.bolink.inc.php        11 Feb 2007 21:58:33 -0000      1.27
+++ class.bolink.inc.php        13 Feb 2007 15:02:07 -0000      1.28
@@ -14,12 +14,10 @@
  * the Free Software Foundation; either version 2 of the License, or   *
  * at your option) any later version.                                  *
  \**********************************************************************/
- /* $Id: class.bolink.inc.php,v 1.27 2007/02/11 21:58:33 sigurdne Exp $ */
+ /* $Id: class.bolink.inc.php,v 1.28 2007/02/13 15:02:07 sigurdne Exp $ */
 
        include_once(PHPGW_INCLUDE_ROOT . '/infolog/inc/class.solink.inc.php');
        
-       $GLOBALS['phpgw_info']['flags']['included_classes']['bolink'] = True;
-
        /*!
        @class bolink
        @author ralfbecker
@@ -109,10 +107,20 @@
 
                        $config = CreateObject('phpgwapi.config');
                        $config->read_repository();
+
+                       $this->link_pathes   = '';
+                       $this->send_file_ips = '';
                        if (is_array($config->config_data))
                        {
-                               $this->link_pathes   = 
isset($config->config_data['link_pathes']) ? 
$config->config_data['link_pathes'] : '';
-                               $this->send_file_ips = 
isset($config->config_data['send_file_ips']) ? 
$config->config_data['send_file_ips'] : '';
+                               if ( isset($config->config_data['link_pathes']) 
)
+                               {
+                                       $this->link_pathes   = 
$config->config_data['link_pathes'];
+                               }
+
+                               if ( 
isset($config->config_data['send_file_ips']) )
+                               {
+                                       $this->send_file_ips = 
$config->config_data['send_file_ips'];
+                               }
                        }
                        unset($config);
                        
@@ -317,7 +325,7 @@
                        unlink has to be called with &$id so see the result !!!
                @result the number of links deleted
                */
-               function 
unlink($link_id,$app='',$id='',$owner='',$app2='',$id2='')
+               function unlink($link_id, $app='', &$id, $owner='', $app2='', 
$id2='' )
                {
                        if ($link_id < 0)       // vfs-link?
                        {
@@ -726,7 +734,7 @@
                function list_attached($app,$id)
                {
                        $this->vfs->override_acl = 1;
-                       $attachments = 
$this->vfs->ls($this->vfs_path($app,$id),array(REALTIVE_NONE));
+                       $attachments = 
$this->vfs->ls($this->vfs_path($app,$id),array(RELATIVE_NONE));
                        $this->vfs->override_acl = 0;
 
                        if (!count($attachments) || !$attachments[0]['name'])

Index: hook_settings.inc.php
===================================================================
RCS file: /sources/phpgroupware/infolog/inc/hook_settings.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- hook_settings.inc.php       10 Feb 2007 16:11:36 -0000      1.7
+++ hook_settings.inc.php       13 Feb 2007 15:02:07 -0000      1.8
@@ -14,7 +14,7 @@
  * the Free Software Foundation; either version 2 of the License, or   *
  * at your option) any later version.                                  *
  \**********************************************************************/
- /* $Id: hook_settings.inc.php,v 1.7 2007/02/10 16:11:36 sigurdne Exp $ */
+ /* $Id: hook_settings.inc.php,v 1.8 2007/02/13 15:02:07 sigurdne Exp $ */
 
        create_check_box('Show open entries: Tasks/Calls/Notes on main 
screen','homeShowEvents',
                'Should InfoLog display your open entries - not finised tasks, 
phonecalls or notes - on the main screen. Works only if you dont selected an 
application for the main screen (in your preferences).');

Index: hook_preferences.inc.php
===================================================================
RCS file: /sources/phpgroupware/infolog/inc/hook_preferences.inc.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- hook_preferences.inc.php    10 Feb 2007 16:11:36 -0000      1.13
+++ hook_preferences.inc.php    13 Feb 2007 15:02:07 -0000      1.14
@@ -14,14 +14,14 @@
  * the Free Software Foundation; either version 2 of the License, or   *
  * at your option) any later version.                                  *
  \**********************************************************************/
- /* $Id: hook_preferences.inc.php,v 1.13 2007/02/10 16:11:36 sigurdne Exp $ */
+ /* $Id: hook_preferences.inc.php,v 1.14 2007/02/13 15:02:07 sigurdne Exp $ */
 
 {
 // Only Modify the $file and $title variables.....
        $file = array(
-               'Preferences'     => 
$GLOBALS['phpgw']->link('/preferences/preferences.php','appname='.$appname),
-               'Grant Access'    => 
$GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uiaclprefs.index&acl_app='.$appname),
-               'Edit Categories' => 
$GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uicategories.index&cats_app='
 . $appname . '&cats_level=True&global_cats=True')
+               'Preferences'     => 
$GLOBALS['phpgw']->link('/preferences/preferences.php',array('appname'=>$appname)),
+               'Grant Access'    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'preferences.uiaclprefs.index','acl_app'=>$appname)),
+               'Edit Categories' => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'preferences.uicategories.index','cats_app'=>$appname,'cats_level'=>'True','global_cats'=>'True'))
        );
 //Do not modify below this line
        display_section($appname,lang($appname),$file); // leave 2. $appname 
for compatibilty with .14

Index: hook_home.inc.php
===================================================================
RCS file: /sources/phpgroupware/infolog/inc/hook_home.inc.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- hook_home.inc.php   10 Feb 2007 16:11:36 -0000      1.11
+++ hook_home.inc.php   13 Feb 2007 15:02:07 -0000      1.12
@@ -14,9 +14,10 @@
  * the Free Software Foundation; either version 2 of the License, or   *
  * at your option) any later version.                                  *
  \**********************************************************************/
- /* $Id: hook_home.inc.php,v 1.11 2007/02/10 16:11:36 sigurdne Exp $ */
+ /* $Id: hook_home.inc.php,v 1.12 2007/02/13 15:02:07 sigurdne Exp $ */
 
-       if 
($GLOBALS['phpgw_info']['user']['preferences']['infolog']['homeShowEvents'])
+       if ( 
isset($GLOBALS['phpgw_info']['user']['preferences']['infolog']['homeShowEvents'])
+               && 
$GLOBALS['phpgw_info']['user']['preferences']['infolog']['homeShowEvents'] )
        {
                $save_app = $GLOBALS['phpgw_info']['flags']['currentapp'];
                $GLOBALS['phpgw_info']['flags']['currentapp'] = 'infolog';

Index: hook_deleteaccount.inc.php
===================================================================
RCS file: /sources/phpgroupware/infolog/inc/hook_deleteaccount.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- hook_deleteaccount.inc.php  10 Feb 2007 16:11:36 -0000      1.5
+++ hook_deleteaccount.inc.php  13 Feb 2007 15:02:07 -0000      1.6
@@ -8,12 +8,10 @@
        *  Free Software Foundation; either version 2 of the License, or (at 
your  *
        *  option) any later version.                                           
   *
        
\**************************************************************************/
-       /* $Id: hook_deleteaccount.inc.php,v 1.5 2007/02/10 16:11:36 sigurdne 
Exp $ */
+       /* $Id: hook_deleteaccount.inc.php,v 1.6 2007/02/13 15:02:07 sigurdne 
Exp $ */
 
        // Delete all records for a user
        $info = CreateObject('infolog.soinfolog');
-
-       $info->change_delete_owner(intval($_POST['account_id']), 
intval($_POST['new_owner']));
-
+       $info->change_delete_owner($_POST['account_id'], $_POST['new_owner']);
        unset($info);
 ?>

Index: hook_admin.inc.php
===================================================================
RCS file: /sources/phpgroupware/infolog/inc/hook_admin.inc.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- hook_admin.inc.php  10 Feb 2007 16:11:36 -0000      1.13
+++ hook_admin.inc.php  13 Feb 2007 15:02:07 -0000      1.14
@@ -14,7 +14,7 @@
  * the Free Software Foundation; either version 2 of the License, or   *
  * at your option) any later version.                                  *
  \**********************************************************************/
- /* $Id: hook_admin.inc.php,v 1.13 2007/02/10 16:11:36 sigurdne Exp $ */
+ /* $Id: hook_admin.inc.php,v 1.14 2007/02/13 15:02:07 sigurdne Exp $ */
 
        {
                $file = Array
@@ -31,7 +31,7 @@
                );
 
 //Do not modify below this line
-               if 
($GLOBALS['phpgw']->common->public_functions['display_mainscreen'])
+               if ( 
isset($GLOBALS['phpgw']->common->public_functions['display_mainscreen']) )
                {
                        
$GLOBALS['phpgw']->common->display_mainscreen($appname,$file);
                }

Index: class.uilink.inc.php
===================================================================
RCS file: /sources/phpgroupware/infolog/inc/class.uilink.inc.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- class.uilink.inc.php        10 Feb 2007 16:11:36 -0000      1.9
+++ class.uilink.inc.php        13 Feb 2007 15:02:07 -0000      1.10
@@ -14,7 +14,7 @@
  * the Free Software Foundation; either version 2 of the License, or   *
  * at your option) any later version.                                  *
  \**********************************************************************/
- /* $Id: class.uilink.inc.php,v 1.9 2007/02/10 16:11:36 sigurdne Exp $ */
+ /* $Id: class.uilink.inc.php,v 1.10 2007/02/13 15:02:07 sigurdne Exp $ */
 
        include_once(PHPGW_INCLUDE_ROOT . '/infolog/inc/class.bolink.inc.php');
 
@@ -59,7 +59,7 @@
                        }
                        if ($value['create'] && $value['app'] && $value['id'] 
&& $app)
                        {
-                               
$this->link($app,&$id,$value['app'],$value['id'],$value['remark']);
+                               
$this->link($app,$id,$value['app'],$value['id'],$value['remark']);
                        }
                        if ($value['search'] && count($ids = 
$this->query($value['app'],$value['query'])))
                        {

Index: class.uiinfolog.inc.php
===================================================================
RCS file: /sources/phpgroupware/infolog/inc/class.uiinfolog.inc.php,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -b -r1.80 -r1.81
--- class.uiinfolog.inc.php     10 Feb 2007 16:11:36 -0000      1.80
+++ class.uiinfolog.inc.php     13 Feb 2007 15:02:07 -0000      1.81
@@ -14,7 +14,7 @@
  * the Free Software Foundation; either version 2 of the License, or   *
  * at your option) any later version.                                  *
  \**********************************************************************/
- /* $Id: class.uiinfolog.inc.php,v 1.80 2007/02/10 16:11:36 sigurdne Exp $ */
+ /* $Id: class.uiinfolog.inc.php,v 1.81 2007/02/13 15:02:07 sigurdne Exp $ */
 
        class uiinfolog         // UI - User Interface - HTML 
        {
@@ -38,7 +38,9 @@
                                        'task'      => 'task.gif',      
'task_alt'      => 'Task',
                                        'phone'     => 'phone.gif',     
'phone_alt'     => 'Phonecall',
                                        'note'      => 'note.gif',      
'note_alt'      => 'Note',
+                                       'cancel'        => 'cancel.png',        
'cancel_alt'    => 'Cancel',
                                        'confirm'   => 'confirm.gif',   
'confirm_alt'   => 'Confirmation',
+                                       'finish'        => 'finish.png',        
'finish_alt'    => 'Finished',
                                        'reject'    => 'reject.gif',    
'reject_alt'    => 'Reject',
                                        'email'     => 'email.gif',     
'email_alt'     => 'Email' ),
                                'action' => array(
@@ -46,6 +48,7 @@
                                        'view'      => 'view.gif',      
'view_alt'      => 'View Subs',
                                        'parent'    => 'parent.gif',    
'parent_alt'    => 'View other Subs',
                                        'edit'      => 'edit.gif',      
'edit_alt'      => 'Edit',
+                                       'confirm'       => 'confirm.gif',       
'confirm_alt'   => 'Confirm',
                                        'addfile'   => 'addfile.gif',   
'addfile_alt'   => 'Add a file',
                                        'delete'    => 'delete.gif',    
'delete_alt'    => 'Delete' ),
                                'status' => array(
@@ -58,15 +61,15 @@
                        );
 
                        $this->filters = array(
-                               'none'             =>   'no Filter',
-                               'done'             =>   'done',
+                               'all'                           => 'no Filter',
                                'own'              =>   'own',
+                               'open-today'            => 'open',
                                'own-open-today'   =>   'own open',
                                'own-open-overdue' =>   'own overdue',
                                'own-upcoming'     =>   'own upcoming',
-                               'open-today'       =>   'open',
                                'open-overdue'     =>   'overdue',
-                               'upcoming'         =>   'upcoming'
+                               'upcoming'                      => 'upcoming',
+                               'done'                          => 'done'
                        );
          
                        $this->messages = array(
@@ -88,6 +91,9 @@
                        {
                                $info = $this->bo->read($info);
                        }
+
+                       //echo "uiinfolog::get_info: info="; 
_debug_array($info);
+
                        $id = $info['info_id'];
                        $done = $info['info_status'] == 'done' || 
$info['info_status'] == 'billed';
                        $info['sub_class'] = $info['info_pri'] . ($done ? 
'_done' : '');
@@ -100,11 +106,23 @@
                        
                        $readonlys["edit[$id]"] = 
!$this->bo->check_access($id,PHPGW_ACL_EDIT);
                        $readonlys["delete[$id]"] = 
!$this->bo->check_access($id,PHPGW_ACL_DELETE);
+
+                       if(intval($info['info_responsible']) > 0 && 
$info['info_owner'] != $info['info_responsible'] && $info['info_owner'] != 
$GLOBALS['phpgw_info']['user']['account_id'])
+                       {
+                               $readonlys["confirm[$id]"] = 
!$this->bo->check_access($id,'confirm');
+                               $readonlys["finish[$id]"] = 
!$this->bo->check_access($id,'finish');
+                               $readonlys["cancel[$id]"] = 
!$this->bo->check_access($id,'cancel');
+                       }
+                       else
+                       {
+                               $readonlys["confirm[$id]"] = 
$readonlys["finish[$id]"]  = $readonlys["cancel[$id]"] = True;
+                       }
+
                        $readonlys["sp[$id]"] = 
!$this->bo->check_access($id,PHPGW_ACL_ADD);
                        $readonlys["view[$id]"] = $info['info_anz_subs'] < 1;
                        $readonlys['view[0]'] = True;   // no parent
 
-                       $show_links = 
$GLOBALS['phpgw_info']['user']['preferences']['infolog']['show_links'];
+                       $show_links = 
isset($GLOBALS['phpgw_info']['user']['preferences']['infolog']['show_links']) ? 
$GLOBALS['phpgw_info']['user']['preferences']['infolog']['show_links'] : '';
 
                        if ($show_links != 'none' && ($links = 
$this->link->get_links('infolog',$info['info_id'])))
                        {
@@ -133,6 +151,10 @@
                                'filter' => $query['filter'],
                                'cat_id' => $query['cat_id']
                        ));
+                       $query['order'] = isset($query['order']) ? 
$query['order'] : '';
+                       $query['sort'] = isset($query['sort']) ? $query['sort'] 
: '';
+                       $query['ordermethod'] = isset($query['ordermethod']) ? 
$query['ordermethod'] : '';
+                       
                        $ids = 
$this->bo->search($query['order'],$query['sort'],$query['filter'],$query['cat_id'],
                                
$query['search'],$query['action'],$query['action_id'],$query['ordermethod'],
                                $query['start'],$total);
@@ -157,6 +179,12 @@
                {
                        $referer = is_array($values) ? $values['referer'] : 
$referer;
                        //echo 
"<p>uiinfolog::index(action='$action/$action_id',referer='$referer/$values[referer]')</p>\n";
+
+                       if(!isset($_GET['filter']) || !$_GET['filter'])
+                       {
+                               $_GET['filter'] = 'own';
+                       }
+
                        if (!is_array($values))
                        {
                                $values = array('nm' => 
$GLOBALS['phpgw']->session->appsession('session_data','infolog'));
@@ -176,15 +204,15 @@
                        }
                        if ($action == '')
                        {
-                               $action = $values['action'] ? $values['action'] 
: get_var('action',array('POST','GET'));
-                               $action_id = $values['action_id'] ? 
$values['action_id'] : get_var('action_id',array('POST','GET'));
+                               $action = isset($values['action']) && 
$values['action'] ? $values['action'] : get_var('action',array('POST','GET'));
+                               $action_id = isset($values['action_id']) && 
$values['action_id'] ? $values['action_id'] : 
get_var('action_id',array('POST','GET'));
                        }
-                       if ($values['nm']['add'])
+                       if (isset($values['nm']['add']) && $values['nm']['add'])
                        {
                                $values['add'] = $values['nm']['add'];
                                unset($values['nm']['add']);
                        }
-                       if ($values['add'] || $values['cancel'] || 
isset($values['nm']['rows']) || isset($values['main']))
+                       if ((isset($values['add']) && $values['add']) || 
(isset($values['cancel']) && $values['cancel']) || isset($values['nm']['rows']) 
|| isset($values['main']))
                        {
                                if ($values['add'])
                                {
@@ -209,12 +237,35 @@
                                                        $action = 'sp';
                                                        $action_id = $do_id;
                                                        break;
+                                               case 'confirm':
+                                                       
$this->bo->confirm($do_id,'accepted');
+                                                       $value = array();
+                                                       $action = '';
+                                                       $action_id = 0;
+                                                       break;
+                                               case 'finish':
+                                                       
$this->bo->confirm($do_id,'finished');
+                                                       $value = array();
+                                                       $action = '';
+                                                       $action_id = 0;
+                                                       break;
+                                               case 'cancel':
+                                                       
$this->bo->confirm($do_id,'canceled');
+                                                       $value = array();
+                                                       $action = '';
+                                                       $action_id = 0;
+                                                       break;
                                                default:
                                                        $value = array();
                                                        $action = '';
                                                        $action_id = 0;
                                                        break;
                                        }
+
+                                       if($this->bo->emailnotification && ($do 
== 'confirm' || $do == 'finish' || $do == 'cancel'))
+                                       {
+                                               
$this->bo->send_notification($do_id,'confirm');
+                                       }
                                }
                        }
                        switch ($action)
@@ -226,7 +277,7 @@
                                                $action_id = 0;
                                                break;
                                        }
-                                       $values['main'][1] = 
$this->get_info($action_id,&$readonlys['main']);
+                                       $values['main'][1] = 
$this->get_info($action_id,$readonlys['main']);
                                        break;
                        }
                        $readonlys['cancel'] = $action != 'sp'; 
@@ -241,7 +292,7 @@
                        {
                                $values['nm']['header_left'] = 
'infolog.index.header_left';
                        }
-                       $values['nm']['bottom_too'] = True;
+                       $values['nm']['bottom_too'] = False;
                        $persist['action'] = $values['nm']['action'] = $action;
                        $persist['action_id'] = $values['nm']['action_id'] = 
$action_id;
                        $persist['referer'] = $referer;
@@ -263,7 +314,7 @@
                                return $referer ? 
$this->tmpl->location($referer) : $this->index();
                        }
                        $readonlys = $values = array();
-                       $values['main'][1] = 
$this->get_info($info_id,&$readonlys['main']);
+                       $values['main'][1] = 
$this->get_info($info_id,$readonlys['main']);
 
                        $this->tmpl->read('infolog.delete');
 
@@ -305,6 +356,8 @@
                                {
                                        if ($content['save'] && (!$info_id || 
$this->bo->check_access($info_id,PHPGW_ACL_EDIT)))
                                        {
+                                               $content['old_responsible'] = 
$this->bo->so->data['info_responsible'];
+
                                                if 
(strstr($content['info_link_id'],':') !== False)
                                                {
                                                        $info_link_id = 
$content['info_link_id'];
@@ -329,6 +382,21 @@
                                                                ),False);
                                                        }
                                                }
+
+                                               if($this->bo->emailnotification)
+                                               {
+                                                       
if(intval($content['info_responsible']) > 0 && $content['info_responsible'] != 
$content['info_owner'])
+                                                       {
+                                                               if(!$info_id)
+                                                               {
+                                                                       
$this->bo->send_notification($content);
+                                                               }
+                                                               
elseif(intval($content['info_responsible']) != $content['old_responsible'])
+                                                               {
+                                                                       
$this->bo->send_notification($content);
+                                                               }
+                                                       }
+                                               }
                                        }
                                        elseif ($content['delete'] && $info_id 
> 0)
                                        {
@@ -462,10 +530,11 @@
                                'info_type'     => $this->bo->enums['type'],
                                'info_pri'      => $this->bo->enums['priority'],
                                'info_confirm'  => $this->bo->enums['confirm'],
-                               'info_status'   => 
$this->bo->status[$content['info_type']]
-                       ),$readonlys,array(
+                                       'info_confirm_status'   => 
$this->bo->enums['confirm_status'],
+                                       'info_status'                   => 
$this->bo->status[$content['info_type']]),
+                               $readonlys,array(
                                'info_id'   => $info_id,
-                               'info_id_parent' => $content['info_id_parent'],
+                                       'info_id_parent'                => 
isset($content['info_id_parent']) ? $content['info_id_parent'] : '',
                                'info_link_id' => $content['info_link_id'],
                                'action'    => $action,
                                'action_id' => $action_id,
@@ -499,7 +568,7 @@
                        return $icon ? 
$this->html->image('infolog',$icon,lang($alt),'border=0') : lang($alt);
                }
 
-               function admin( )
+               function admin()
                {
                        if(get_var('cancel',Array('POST')))
                        {
@@ -521,11 +590,14 @@
                                                $this->bo->send_file_ips[$val] 
= stripslashes($ip[$key]);
                                        }
                                }
+
                                $this->bo->config->config_data = array(
                                        'link_pathes' => $this->bo->link_pathes,
-                                       'send_file_ips' => 
$this->bo->send_file_ips
+                                       'send_file_ips'         => 
$this->bo->send_file_ips,
+                                       'emailnotification'     => 
($_POST['emailnotification']?'yes':'no')
                                );
                                $this->bo->config->save_repository(True);
+                               
$GLOBALS['phpgw']->redirect_link('/admin/index.php');
                        }
 
                        $GLOBALS['phpgw_info']['flags']['css'] = 
$this->html->theme2css();
@@ -543,7 +615,9 @@
                                'done_button' => 
$this->html->submit_button('cancel','Cancel'),
                                'lang_valid'  => lang('valid path on 
clientside<br>eg. \\\\Server\\Share or e:\\'),
                                'lang_trans'  => lang('path on 
(web-)serverside<br>eg. /var/samba/Share'),
-                               'lang_ip'     => lang('reg. expr. for local 
IP\'s<br>eg. ^192\\.168\\.1\\.')
+                               'lang_ip'                       => lang('reg. 
expr. for local IP\'s<br>eg. ^192\\.168\\.1\\.'),
+                               'lang_enable_emailnotification' => lang('enable 
email notification for assigned tasks'),
+                               'notify_checked'        => 
($this->bo->emailnotification?'checked="checked"':'')
                        ));
 
                        if (!is_array($this->bo->send_file_ips))

Index: class.uicustomfields.inc.php
===================================================================
RCS file: /sources/phpgroupware/infolog/inc/class.uicustomfields.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- class.uicustomfields.inc.php        10 Feb 2007 16:11:36 -0000      1.3
+++ class.uicustomfields.inc.php        13 Feb 2007 15:02:07 -0000      1.4
@@ -13,7 +13,7 @@
  * the Free Software Foundation; either version 2 of the License, or   *
  * at your option) any later version.                                  *
  \**********************************************************************/
- /* $Id: class.uicustomfields.inc.php,v 1.3 2007/02/10 16:11:36 sigurdne Exp $ 
*/
+ /* $Id: class.uicustomfields.inc.php,v 1.4 2007/02/13 15:02:07 sigurdne Exp $ 
*/
 
        class uicustomfields
        {

Index: class.solink.inc.php
===================================================================
RCS file: /sources/phpgroupware/infolog/inc/class.solink.inc.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- class.solink.inc.php        10 Feb 2007 16:11:36 -0000      1.15
+++ class.solink.inc.php        13 Feb 2007 15:02:07 -0000      1.16
@@ -13,9 +13,8 @@
        * the Free Software Foundation; either version 2 of the License, or    *
        * at your option) any later version.                                   *
        \**********************************************************************/
-       /* $Id: class.solink.inc.php,v 1.15 2007/02/10 16:11:36 sigurdne Exp $ 
*/
+       /* $Id: class.solink.inc.php,v 1.16 2007/02/13 15:02:07 sigurdne Exp $ 
*/
 
-       $GLOBALS['phpgw_info']['flags']['included_classes']['solink'] = True;
        /*!
        @class solink
        @author ralfbecker

Index: class.soinfolog.inc.php
===================================================================
RCS file: /sources/phpgroupware/infolog/inc/class.soinfolog.inc.php,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28
--- class.soinfolog.inc.php     10 Feb 2007 16:11:36 -0000      1.27
+++ class.soinfolog.inc.php     13 Feb 2007 15:02:07 -0000      1.28
@@ -14,7 +14,7 @@
  * the Free Software Foundation; either version 2 of the License, or   *
  * at your option) any later version.                                  *
  \**********************************************************************/
- /* $Id: class.soinfolog.inc.php,v 1.27 2007/02/10 16:11:36 sigurdne Exp $ */
+ /* $Id: class.soinfolog.inc.php,v 1.28 2007/02/13 15:02:07 sigurdne Exp $ */
 
        /*!
        @class soinfolog
@@ -44,7 +44,7 @@
 
                        $this->links = CreateObject('infolog.solink');
 
-                       $this->read( $info_id );
+                       $this->read($info_id);
                }
 
                /*!
@@ -55,7 +55,7 @@
                @param $required_rights PHPGW_ACL_xyz anded together
                @returns True if access is granted else False
                */
-               function check_access( $info_id,$required_rights )
+               function check_access($info_id,$required_rights)
                {
                        if ($info_id != $this->data['info_id'])         // 
already loaded?
                        {
@@ -72,16 +72,38 @@
                        {
                                return False;
                        }
+
                        $owner = $info['info_owner'];
 
+                       if(intval($info['info_responsible']) > 0 && $owner != 
$info['info_responsible'] && $owner != $this->user && $info['info_responsible'] 
== $this->user)
+                       {
+                               if($required_rights == 'confirm' && 
($info['info_confirm'] == 'accept' || $info['info_confirm'] == 'both'))
+                               {
+                                       $access_ok = 
($info['info_confirm_status'] == 'not');
+                                       return $access_ok;
+                               }
+
+                               if($required_rights == 'finish' && 
($info['info_confirm'] == 'finish' || $info['info_confirm'] == 'both'))
+                               {
+                                       $access_ok = 
($info['info_confirm_status'] != 'finished' && $info['info_confirm_status'] != 
'canceled');
+                                       return $access_ok;
+                               }
+
+                               if($required_rights == 'cancel')
+                               {
+                                       $access_ok = 
($info['info_confirm_status'] != 'canceled');
+                                       return $access_ok;
+                               }
+                               return False;
+                       }
+
                        $access_ok = $owner == $this->user ||                // 
user has all rights
                                                         // ACL only on public 
entrys || $owner granted _PRIVATE
                                                         
!!($this->grants[$owner] & $required_rights) &&
                                                         ($info['info_access'] 
== 'public' ||
                                                         
!!($this->grants[$owner] & PHPGW_ACL_PRIVATE));   
                                                        
-                       // echo "check_access(info_id=$info_id (owner=$owner, 
user=$user),required_rights=$required_rights): 
access".($access_ok?"Ok":"Denied");
-                       
+                       //echo "check_access(info_id=$info_id (owner=$owner, 
user=" . $info['info_responsible'] . "),required_rights=$required_rights): 
access".($access_ok?"Ok":"Denied") . '<br />';
                        return $access_ok;         
                }
 
@@ -94,7 +116,7 @@
                */           
                function aclFilter($filter = 'none')
                {
-                       ereg('.*(own|privat|all|none).*',$filter,$vars);
+                       ereg('.*(own|none).*',$filter,$vars);
                        $filter = $vars[1];
 
                        if (isset($this->acl_filter[$filter]))
@@ -120,19 +142,18 @@
                                        $has_private_access = 'info_owner IN 
('.implode(',',$private_user_list).')';
                                }            
                        }
-                       $filtermethod = " (info_owner=$this->user"; // user has 
all rights
+                       $filtermethod = ' (info_owner=' . $this->user; // user 
has all rights
 
                        // private: own entries plus the one user is 
responsible for 
-                       if ($filter == 'private' || $filter == 'own')
+                       if ($filter == 'own')
                        {
-                               $filtermethod .= " OR 
(info_responsible=$this->user OR info_status = 'offer')".
-                                                " AND 
(info_access='public'".($has_private_access?" OR $has_private_access":'').')';
+                               $filtermethod .= ' OR info_responsible=' . 
$this->user . " OR (info_status = 'offer' AND info_access='public')";
                        }
-                       else                                    // none --> all 
entrys user has rights to see
+                       else
                        {
                                if ($has_private_access)
                                {
-                                       $filtermethod .= " OR 
$has_private_access";
+                                       $filtermethod .= ' OR ' . 
$has_private_access;
                                }
                                if (count($public_user_list))
                                { 
@@ -242,7 +263,7 @@
                                (!$this->db->query("select * FROM phpgw_infolog 
WHERE info_id=$info_id",__LINE__,__FILE__) ||
                                 !$this->db->next_record()))
                        {
-                               $this->init( );
+                               $this->init();
                                return False;
                        }
                        if ($info_id != $this->data['info_id'])      // data 
yet read in
@@ -255,6 +276,8 @@
                                        $this->data['#'.$this->db->f(0)] = 
$this->db->f(1);
                                }
                        }
+
+                       //echo 'soinfolog:read:' . _debug_array($this->data);
                        return $this->data;
                }
                
@@ -462,6 +485,7 @@
                        {
                                $action = $action2app[$action];
                        }
+                       $link_extra = '';
                        if ($action != '')
                        {
                                $links = 
$this->links->get_links($action=='sp'?'infolog':$action,$action_id,'infolog');
@@ -489,6 +513,7 @@
                          $filtermethod .= ' AND info_cat='.intval($cat_id).' ';
                        }
                        $join = '';
+                       $sql_query = '';
                        if ($query)                       // we search in 
_from, _subject, _des and _extra_value for $query
                        {
                                $query = $this->db->db_addslashes($query);
@@ -498,7 +523,7 @@
                        }
                        $pid = 'AND info_id_parent='.($action == 'sp' ? 
$action_id : 0);
 
-                       if 
(!$phpgw_info['user']['preferences']['infolog']['listNoSubs'] &&
+                       if 
((!isset($GLOBALS['phpgw_info']['user']['preferences']['infolog']['listNoSubs'])
 || !$GLOBALS['phpgw_info']['user']['preferences']['infolog']['listNoSubs']) &&
                                 $action != 'sp')
                        {
                                $pid = '';
@@ -517,7 +542,7 @@
                                $this->db->limit_query($sql="SELECT DISTINCT 
phpgw_infolog.* $query $ordermethod",$start,__LINE__,__FILE__);
                                while ($this->db->next_record())
                                {
-                                       $this->db2data(&$info);
+                                       $this->db2data($info);
                                        $ids[$info['info_id']] = $info;
                                }
                        }
@@ -527,4 +552,10 @@
                        }
                        return $ids;
                }
+
+               function confirm($info_id,$confirm_status = 'accepted')
+               {
+                       $this->db->query("Update phpgw_infolog set 
info_confirm_status='$confirm_status' where info_id=" . 
intval($info_id),__LINE__,__FILE__);
+               }
        }
+?>

Index: class.sbox2.inc.php
===================================================================
RCS file: /sources/phpgroupware/infolog/inc/class.sbox2.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- class.sbox2.inc.php 10 Feb 2007 16:11:36 -0000      1.8
+++ class.sbox2.inc.php 13 Feb 2007 15:02:07 -0000      1.9
@@ -14,13 +14,13 @@
  * the Free Software Foundation; either version 2 of the License, or   *
  * at your option) any later version.                                  *
  \**********************************************************************/
- /* $Id: class.sbox2.inc.php,v 1.8 2007/02/10 16:11:36 sigurdne Exp $ */
+ /* $Id: class.sbox2.inc.php,v 1.9 2007/02/13 15:02:07 sigurdne Exp $ */
  
-       if(!isset($GLOBALS['phpgw_info']['flags']['included_classes']['sbox']))
-       {
-               include(PHPGW_API_INC . '/class.sbox.inc.php');
-               $GLOBALS['phpgw_info']['flags']['included_classes']['sbox'] = 
True;
-       }
+       /**
+       * Include parent class
+       * @see sbox
+       */
+       include_once(PHPGW_API_INC . '/class.sbox.inc.php');
 
        class sbox2 extends sbox
        {

Index: class.customfields_widget.inc.php
===================================================================
RCS file: /sources/phpgroupware/infolog/inc/class.customfields_widget.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- class.customfields_widget.inc.php   10 Feb 2007 16:11:36 -0000      1.3
+++ class.customfields_widget.inc.php   13 Feb 2007 15:02:07 -0000      1.4
@@ -13,7 +13,7 @@
  * the Free Software Foundation; either version 2 of the License, or   *
  * at your option) any later version.                                  *
  \**********************************************************************/
- /* $Id: class.customfields_widget.inc.php,v 1.3 2007/02/10 16:11:36 sigurdne 
Exp $ */
+ /* $Id: class.customfields_widget.inc.php,v 1.4 2007/02/13 15:02:07 sigurdne 
Exp $ */
 
        /*!
        @class customfields_widget

Index: class.boinfolog.inc.php
===================================================================
RCS file: /sources/phpgroupware/infolog/inc/class.boinfolog.inc.php,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -b -r1.44 -r1.45
--- class.boinfolog.inc.php     10 Feb 2007 16:11:36 -0000      1.44
+++ class.boinfolog.inc.php     13 Feb 2007 15:02:07 -0000      1.45
@@ -14,7 +14,7 @@
  * the Free Software Foundation; either version 2 of the License, or   *
  * at your option) any later version.                                  *
  \**********************************************************************/
- /* $Id: class.boinfolog.inc.php,v 1.44 2007/02/10 16:11:36 sigurdne Exp $ */
+ /* $Id: class.boinfolog.inc.php,v 1.45 2007/02/13 15:02:07 sigurdne Exp $ */
 
        class boinfolog                         // BO: buiseness objects: 
internal logic
        {
@@ -42,20 +42,16 @@
                function boinfolog( $info_id = 0)
                {
                        $this->enums = $this->stock_enums = array(
-                               'priority' => array (
-                                       'urgent' => 'urgent','high' => 
'high','normal' => 'normal',
-                                       'low' => 'low' ),
+                               'priority'                      => 
array('urgent' => 'urgent','high' => 'high','normal' => 'normal','low' => 'low' 
),
 /*                             'status'   => array(
                                        'offer' => 'offer','ongoing' => 
'ongoing','call' => 'call',
                                        'will-call' => 'will-call','done' => 
'done',
                                        'billed' => 'billed' ),
-*/                             'confirm'   => array(
-                                       'not' => 'not','accept' => 
'accept','finish' => 'finish',
-                                       'both' => 'both' ),
-                               'type'      => array(
-                                       'task' => 'task','phone' => 
'phone','note' => 'note'
+*/                             'confirm'                       => array('not' 
=> 'not','accept' => 'accept','finish' => 'finish','both' => 'both' ),
+                               'confirm_status'        => array('not' => 
'not','accepted' => 'accepted','finished' => 'finished','canceled' => 
'canceled'),
+                               'type'                          => array('task' 
=> 'task','phone' => 'phone','note' => 'note')
                                /*      ,'confirm' => 'confirm','reject' => 
'reject','email' => 'email',
-                                       'fax' => 'fax' not implemented so far 
*/ )
+                                       'fax' => 'fax' not implemented so far)*/
                        );
                        $this->status = $this->stock_status = array(
                                'defaults' => array(
@@ -107,9 +103,12 @@
                                {
                                        $this->customfields = 
$this->config->config_data['customfields'];
                                }
+                               
if($this->config->config_data['emailnotification'] == 'yes')
+                               {
+                                       $this->emailnotification = True;
                        }
-
-                       $this->read( $info_id);
+                       }
+                       $this->read($info_id);
                }
 
                /*!
@@ -144,7 +143,7 @@
                function link_id2from(&$info,$not_app='',$not_id='')
                {
                        //echo 
"<p>boinfolog::link_id2from(subject='$info[info_subject]', 
link_id='$info[info_link_id], from='$info[info_from]', not_app='$not_app', 
not_id='$not_id')";
-                       if ($info['info_link_id'] > 0 &&
+                       if (isset($info['info_link_id']) && 
$info['info_link_id'] > 0 &&
                                 ($link = 
$this->link->get_link($info['info_link_id'])) !== False)
                        {
                                $nr = $link['link_app1'] == 'infolog' && 
$link['link_id1'] == $info['info_id'] ? '2' : '1';
@@ -166,7 +165,7 @@
                        }
                        else
                        {
-                               $info['info_link_title'] = $info['info_from'];
+                               $info['info_link_title'] = 
isset($info['info_from']) ? $info['info_from'] : '';
                                $info['info_link_id'] = 0;      // link might 
have been deleted
                        }
                        return False;
@@ -177,7 +176,7 @@
                        $err = $this->so->read($info_id) === False;
                        $data = &$this->so->data;
 
-                       if ($data['info_subject'] == 
(substr($data['info_des'],0,60).' ...'))
+                       if (isset($data['info_subject']) && 
isset($data['info_des']) && $data['info_subject'] == 
(substr($data['info_des'],0,60).' ...'))
                        {
                                $data['info_subject'] = '';
                        }
@@ -267,7 +266,7 @@
                function link_query( $pattern )
                {
                        $start = $total = 0;
-                       $ids = 
$this->search('','','','',$pattern,'','','',&$start,&$total);
+                       $ids = 
$this->search('','','','',$pattern,'','','',$start,$total);
                        $content = array();
                        while (is_array($ids) && list( $id,$info ) = each( $ids 
))
                        {
@@ -275,4 +274,137 @@
                        }
                        return $content;
                }
+
+               function confirm($info_id,$confirm_status)
+               {
+                       $this->so->confirm($info_id,$confirm_status);
+               }
+
+               function send_notification($content = 0,$action = 'assign')
+               {
+                       if(!is_array($content))
+                       {
+                               $info_id = $content;
+                               $content = $this->read($info_id);
+
+                               //echo 'boinfolog:send_notification: ' . 
_debug_array($content);
+
+                               switch($content['info_confirm'])
+                               {
+                                       case 'accept':
+                                               $send = 
($content['info_confirm_status'] == 'accepted'?True:False);
+                                               break;
+                                       case 'finish':
+                                               $send = 
($content['info_confirm_status'] == 'finished'?True:False);
+                                               break;
+                                       case 'both':
+                                               $send = 
(($content['info_confirm_status'] == 'accepted' || 
$content['info_confirm_status'] == 'finished')?True:False);
+                                               break;
+                               }
+
+                               if($content['info_confirm_status'] == 
'canceled')
+                               {
+                                       $send = True;
+                               }
+
+                               if(!$send)
+                               {
+                                       return False;
+                               }
+                       }
+
+                       $msg = lang('subject') . ': ' . 
$content['info_subject'] . "\n";
+                       $msg .= lang('type') . ': ' . $content['info_type'] . 
"\n";
+                       $msg .= lang('description') . ': ' . 
lang($content['info_des']) . "\n";
+                       $msg .= lang('confirm') . ': ' . 
lang($content['info_confirm']) . "\n";
+
+                       switch($action)
+                       {
+                               case 'assign':
+                                       $sender         = 
$content['info_owner'];
+                                       $recipient      = 
$content['info_responsible'];
+                                       $subject        = lang('infolog task 
*%1* has been assigned to you', $content['info_subject']);
+                                       $msg .= lang('created by') . ': ' . 
$GLOBALS['phpgw']->common->grab_owner_name($content['info_owner']) . "\n";
+                                       break;
+                               case 'confirm':
+                                       $sender         = 
$content['info_responsible'];
+                                       $recipient      = 
$content['info_owner'];
+                                       switch($content['info_confirm_status'])
+                                       {
+                                               case 'accepted':
+                                                       $subject = 
lang('infolog task *%1* delegation has been 
confirmed',$content['info_subject']);
+                                                       break;
+                                               case 'finished':
+                                                       $subject = 
lang('infolog task *%1* has been finished',$content['info_subject']);
+                                                       break;
+                                               case 'canceled':
+                                                       $subject = 
lang('infolog task *%1* delegation has been canceled',$content['info_subject']);
+                                                       break;
+                                       }
+                                       $msg .= lang('responsible') . ': ' . 
$GLOBALS['phpgw']->common->grab_owner_name($content['info_responsible']) . "\n";
+                                       $msg .= lang('confirmation status') . 
': ' . lang($content['info_confirm_status']);
+                                       break;
+                       }
+
+                       //create the url for automatic login
+                       $link_data = array
+                       (
+                               'phpgw_forward'         => '/index.php',
+                               'phpgw_menuaction'      => 
'infolog.uiinfolog.index'
+                       );
+
+                       $param_list = '';
+                       $is_first_param = True;
+
+                       foreach($link_data as $param_name => $param_val)
+                       {
+                               $param_val = urlencode($param_val);
+
+                               $param_list .= ($is_first_param?'?':'&') . 
$param_name . '=' . $param_val;
+                               $is_first_param = false;
+                       }
+
+                       $msg .= "\n\n" . 'http://' . $_SERVER['HTTP_HOST'] . 
$GLOBALS['phpgw_info']['server']['webserver_url'] . '/login.php' . $param_list;
+                       //$msg .= "\n\n" . 
$GLOBALS['phpgw']->link('/index.php',$link_data);
+
+                       $prefs_sender   = 
CreateObject('phpgwapi.preferences',$sender);
+                       $prefs_sender->read_repository();
+                       $sender_email   = $prefs_sender->email_address($sender);
+                       unset($prefs_sender);
+
+                       $prefs = 
CreateObject('phpgwapi.preferences',$recipient);
+                       $prefs->read_repository();
+
+                       $msgtype = '"infolog";';
+
+                       if(!is_object($GLOBALS['phpgw']->send))
+                       {
+                               $GLOBALS['phpgw']->send = 
CreateObject('phpgwapi.send');
+                       }
+
+                       $to = $prefs->email_address($recipient);
+
+                       /*if (empty($to) || $to[0] == '@' || $to[0] == '$')     
// we have no valid email-address
+                       {
+                               //echo "<p>infolog::send_notification: Empty 
email adress for user '".$recipient."' ==> ignored !!!</p>\n";
+                               continue;
+                       }*/
+                       echo 'Email being sent to ' . $to;
+
+                       $subject = 
$GLOBALS['phpgw']->send->encode_subject($subject);
+
+                       $returncode = 
$GLOBALS['phpgw']->send->msg('email',$to,$subject,$msg,''/*$msgtype*/,'','','',$sender_email);
+                       //echo "<p>send(to='$to', 
sender='$sender_email'<br>subject='$subject') 
returncode=$returncode<br>".nl2br($body)."</p>\n";
+
+                       if (!$returncode)       // not nice, but better than 
failing silently
+                       {
+                               echo '<p><b>boinfolog::send_notification</b>: 
'.lang("Failed sending message to '%1' #%2 subject='%3', sender='%4' 
!!!",$to,$sender_email,htmlspecialchars($subject),$sender_email)."<br>\n";
+                               echo 
'<i>'.$GLOBALS['phpgw']->send->err['desc']."</i><br>\n";
+                               echo lang('This is mostly caused by a not or 
wrongly configured SMTP server. Notify your administrator.')."</p>\n";
+                               echo '<p>'.lang('Click %1here%2 to return to 
infolog.','<a 
href="'.$GLOBALS['phpgw']->link('/infolog/').'">','</a>')."</p>\n";
+                       }
+                       unset($prefs);
+                       return $returncode;
+               }
        }
+?>




reply via email to

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