[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] infolog/inc hook_settings.inc.php, 1.6 hook_home.inc.
From: |
ceb |
Subject: |
[Phpgroupware-cvs] infolog/inc hook_settings.inc.php, 1.6 hook_home.inc.php, 1.9 class.sbox2.inc.php, 1.6 class.bolink.inc.php, 1.22 class.boinfolog.inc.php, 1.37 hook_preferences.inc.php, 1.11 class.solink.inc.php, 1.13 class.soinfolog.inc.php, 1.22 class.uiinfolog.inc.php, 1.75 hook_deleteaccount.inc.php, 1.3 class.vfs.inc.php, 1.10 hook_admin.inc.php, 1.11 class.uilink.inc.php, 1.7 |
Date: |
Thu, 24 Feb 2005 13:25:14 -0000 |
Update of infolog/inc
Modified Files:
Branch: MAIN
hook_settings.inc.php lines: +16 -11
hook_home.inc.php lines: +17 -11
class.sbox2.inc.php lines: +17 -24
class.bolink.inc.php lines: +62 -31
class.boinfolog.inc.php lines: +202 -33
hook_preferences.inc.php lines: +16 -12
class.solink.inc.php lines: +20 -12
class.soinfolog.inc.php lines: +143 -58
class.uiinfolog.inc.php lines: +112 -40
hook_deleteaccount.inc.php lines: +1 -1
class.vfs.inc.php lines: +15 -23
hook_admin.inc.php lines: +25 -13
class.uilink.inc.php lines: +16 -12
Log Message:
added confirmation + email notification
====================================================
Index: infolog/inc/hook_settings.inc.php
diff -u infolog/inc/hook_settings.inc.php:1.5
infolog/inc/hook_settings.inc.php:1.6
--- infolog/inc/hook_settings.inc.php:1.5 Thu Jul 31 09:18:27 2003
+++ infolog/inc/hook_settings.inc.php Wed Jan 5 22:07:58 2005
@@ -1,15 +1,20 @@
<?php
-
/**************************************************************************\
- * phpGroupWare - InfoLog Preferences
*
- * http://www.phpgroupware.org
*
- * --------------------------------------------
*
- * This program is free software; you can redistribute it and/or modify
it *
- * under the terms of the GNU General Public License as published by
the *
- * Free Software Foundation; either version 2 of the License, or (at
your *
- * option) any later version.
*
-
\**************************************************************************/
-
- /* $Id$ */
+ /**********************************************************************\
+ * phpGroupWare - InfoLog *
+ * http://www.phpgroupware.org *
+ * This program is part of the GNU project, see http://www.gnu.org/ *
+ * *
+ * Copyright 2002, 2003 Free Software Foundation, Inc. *
+ * *
+ * Originally Written by Ralf Becker - <address@hidden> *
+ * Based on ToDo Written by Joseph Engo <jengo at phpgroupware.org> *
+ * --------------------------------------------
*
+ * This program is Free Software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * at your option) any later version. *
+ \**********************************************************************/
+ /* $Id$ */
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: infolog/inc/hook_home.inc.php
diff -u infolog/inc/hook_home.inc.php:1.8 infolog/inc/hook_home.inc.php:1.9
--- infolog/inc/hook_home.inc.php:1.8 Sun Jul 6 20:12:27 2003
+++ infolog/inc/hook_home.inc.php Wed Jan 5 22:07:58 2005
@@ -1,14 +1,20 @@
<?php
-
/**************************************************************************\
- * phpGroupWare - Info Log administration
*
- * http://www.phpgroupware.org
*
- * --------------------------------------------
*
- * This program is free software; you can redistribute it and/or modify
it *
- * under the terms of the GNU General Public License as published by
the *
- * Free Software Foundation; either version 2 of the License, or (at
your *
- * option) any later version.
*
-
\**************************************************************************/
- /* $Id$ */
+ /**********************************************************************\
+ * phpGroupWare - InfoLog *
+ * http://www.phpgroupware.org *
+ * This program is part of the GNU project, see http://www.gnu.org/ *
+ * *
+ * Copyright 2002, 2003 Free Software Foundation, Inc. *
+ * *
+ * Originally Written by Ralf Becker - <address@hidden> *
+ * Based on ToDo Written by Joseph Engo <jengo at phpgroupware.org> *
+ * --------------------------------------------
*
+ * This program is Free Software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * at your option) any later version. *
+ \**********************************************************************/
+ /* $Id$ */
if
($GLOBALS['phpgw_info']['user']['preferences']['infolog']['homeShowEvents'])
{
@@ -35,7 +41,7 @@
'tertiary' =>
$GLOBALS['phpgw_info']['theme']['navbar_bg'],
'width' => '100%',
'outerborderwidth' => '0',
- 'header_background_image' =>
$GLOBALS['phpgw']->common->image('phpgwapi/templates/default','bg_filler')
+ 'header_background_image' =>
$GLOBALS['phpgw']->common->image('phpgwapi','bg_filler', '.png', False)
));
foreach(array(
'up' => Array('url' => '/set_box.php',
'app' => $app_id),
====================================================
Index: infolog/inc/class.sbox2.inc.php
diff -u infolog/inc/class.sbox2.inc.php:1.5 infolog/inc/class.sbox2.inc.php:1.6
--- infolog/inc/class.sbox2.inc.php:1.5 Tue Oct 15 13:31:33 2002
+++ infolog/inc/class.sbox2.inc.php Wed Jan 5 22:07:58 2005
@@ -1,28 +1,21 @@
<?php
- /**************************************************************************\
- * phpGroupWare API - Select Box 2 *
- * Written by Ralf Becker <address@hidden> *
- * Class for creating select boxes for addresse, projects, array items, ... *
- * Copyright (C) 2000, 2001 Dan Kuykendall *
- * -------------------------------------------------------------------------*
- * This library is part of the phpGroupWare API *
- * http://www.phpgroupware.org/api *
- * ------------------------------------------------------------------------ *
- * This library is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as published by *
- * the Free Software Foundation; either version 2.1 of the License, *
- * or any later version. *
- * This library is distributed in the hope that it will be useful, but *
- * WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
- * See the GNU Lesser General Public License for more details. *
- * You should have received a copy of the GNU Lesser General Public License *
- * along with this library; if not, write to the Free Software Foundation, *
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
- \**************************************************************************/
-
- /* $Id$ */
-
+ /**********************************************************************\
+ * phpGroupWare - InfoLog *
+ * http://www.phpgroupware.org *
+ * This program is part of the GNU project, see http://www.gnu.org/ *
+ * *
+ * Copyright 2002, 2003 Free Software Foundation, Inc. *
+ * *
+ * Originally Written by Ralf Becker - <address@hidden> *
+ * Based on class.sbox2.inc.php from the phpGroupWare API *
+ * --------------------------------------------
*
+ * This program is Free Software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * at your option) any later version. *
+ \**********************************************************************/
+ /* $Id$ */
+
if(!isset($GLOBALS['phpgw_info']['flags']['included_classes']['sbox']))
{
include(PHPGW_API_INC . '/class.sbox.inc.php');
====================================================
Index: infolog/inc/class.bolink.inc.php
diff -u infolog/inc/class.bolink.inc.php:1.21
infolog/inc/class.bolink.inc.php:1.22
--- infolog/inc/class.bolink.inc.php:1.21 Tue Aug 19 10:29:52 2003
+++ infolog/inc/class.bolink.inc.php Wed Jan 5 22:07:58 2005
@@ -1,16 +1,20 @@
<?php
-
/**************************************************************************\
- * phpGroupWare - InfoLog Links
*
- * http://www.phpgroupware.org
*
- * Written by Ralf Becker <address@hidden> *
- * --------------------------------------------
*
- * This program is free software; you can redistribute it and/or modify
it *
- * under the terms of the GNU General Public License as published by
the *
- * Free Software Foundation; either version 2 of the License, or (at
your *
- * option) any later version.
*
-
\**************************************************************************/
-
- /* $Id$ */
+ /**********************************************************************\
+ * phpGroupWare - InfoLog *
+ * http://www.phpgroupware.org *
+ * This program is part of the GNU project, see http://www.gnu.org/ *
+ * *
+ * Copyright 2002, 2003 Free Software Foundation, Inc. *
+ * *
+ * Originally Written by Ralf Becker - <address@hidden> *
+ * Based on ToDo Written by Joseph Engo <jengo at phpgroupware.org> *
+ * --------------------------------------------
*
+ * This program is Free Software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * at your option) any later version. *
+ \**********************************************************************/
+ /* $Id$ */
include_once(PHPGW_INCLUDE_ROOT . '/infolog/inc/class.solink.inc.php');
@@ -42,7 +46,7 @@
'query' => 'addressbook_query',
'title' => 'addressbook_title',
'view' => array(
- 'menuaction' =>
'addressbook.uiaddressbook.view'
+ 'menuaction' =>
'addressbook.uiaddressbook.view_person'
),
'view_id' => 'ab_id'
),
@@ -327,7 +331,7 @@
{
return $this->delete_attached($app,$id,$id2);
}
- if ($link_id > 0 || !is_array($id))
+ if (!is_array($id))
{
return
solink::unlink($link_id,$app,$id,$owner,$app2,$id2);
}
@@ -388,7 +392,7 @@
@syntax title( $app,$id )
@author ralfbecker
@abstract returns the title (short description) of entry $id
and $app
- @result the title
+ @result the title or false if $id does not exist in $app
*/
function title($app,$id,$link='')
{
@@ -427,7 +431,14 @@
}
$method = $reg['title'];
- return strchr($method,'.') ? ExecMethod($method,$id) :
$this->$method($id);
+ $title = strchr($method,'.') ? ExecMethod($method,$id)
: $this->$method($id);
+
+ if (!$title) // $app,$id has been deleted ==> unlink
als links to it
+ {
+ $this->unlink(0,$app,$id);
+ return False;
+ }
+ return $title;
}
/*!
@@ -823,7 +834,7 @@
}
if (!is_array($event))
{
- return 'not an event !!!';
+ return False;
}
$format =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'] . ' '.
($GLOBALS['phpgw_info']['user']['preferences']['common']['timeformat'] == '12'
? 'h:i a' : 'H:i');
@@ -846,12 +857,18 @@
{
$this->bocal =
createobject('calendar.bocalendar');
}
- $event_ids = $this->bocal->search_keywords($pattern);
-
$content = array( );
- while (is_array($event_ids) && list( $key,$id ) = each(
$event_ids ))
+
+ if ($event_ids =
$this->bocal->search_keywords($pattern))
{
- $content[$id] = $this->calendar_title( $id );
+ foreach($event_ids as $id)
+ {
+ // only include it in the list, if we
have permissions to read it
+ if
($this->bocal->check_perms(PHPGW_ACL_READ,$id))
+ {
+ $content[$id] =
$this->calendar_title( $id );
+ }
+ }
}
return $content;
}
@@ -868,20 +885,26 @@
{
$this->contacts =
createobject('phpgwapi.contacts');
}
- if (!is_array($addr))
+ if (!is_array($addr))
{
- list( $addr ) =
$this->contacts->read_single_entry( $addr );
+ //list( $addr ) =
$this->contacts->read_single_entry( $addr );
+ list( $addr ) =
$this->contacts->get_principal_persons_data( $addr );
}
- $name = $addr['n_family'];
- if ($addr['n_given'])
+
+// if (!is_array($addr))
+// {
+// //return False;
+// }
+ $name = $addr['per_last_name'];
+ if ($addr['per_first_name'])
{
- $name .= ', '.$addr['n_given'];
+ $name .= ', '.$addr['per_first_name'];
}
else
{
- if ($addr['n_prefix'])
+ if ($addr['per_prefix'])
{
- $name .= ', '.$addr['n_prefix'];
+ $name .= ', '.$addr['per_prefix'];
}
}
if ($addr['org_name'])
@@ -903,11 +926,19 @@
{
$this->contacts =
createobject('phpgwapi.contacts');
}
- $addrs = $this->contacts->read(
0,0,'',$pattern,'','DESC','org_name,n_family,n_given' );
+ $columns_to_display = array('contact_id',
'per_first_name', 'per_last_name', 'per_prefix', 'org_name');
+ $me = $GLOBALS['phpgw_info']['user']['account_id'];
+
+ //$addrs = $this->contacts->get_people_by_owner($me,
$columns_to_display);
+ $criteria = $this->contacts->criteria_for_index(
+ $me, PHPGW_CONTACTS_ALL,
+ PHPGW_CONTACTS_CATEGORIES_ALL,
+ $columns_to_display, $pattern,
$columns_to_display);
+ $addrs =
$this->contacts->get_persons($columns_to_display, '','','','','',$criteria);
$content = array( );
while ($addrs && list( $key,$addr ) = each( $addrs ))
{
- $content[$addr['id']] =
$this->addressbook_title( $addr );
+ $content[$addrs[$key]['contact_id']] =
$this->addressbook_title( $addr );
}
return $content;
}
@@ -930,7 +961,7 @@
{
$proj = $this->boprojects->read_single_project(
$proj );
}
- return $proj['title'];
+ return is_array($proj) ? $proj['title'] : False;
}
/*!
====================================================
Index: infolog/inc/class.boinfolog.inc.php
diff -u infolog/inc/class.boinfolog.inc.php:1.36
infolog/inc/class.boinfolog.inc.php:1.37
--- infolog/inc/class.boinfolog.inc.php:1.36 Thu Jul 31 09:21:47 2003
+++ infolog/inc/class.boinfolog.inc.php Wed Jan 5 22:07:58 2005
@@ -1,17 +1,20 @@
<?php
-
/**************************************************************************\
- * phpGroupWare - InfoLog
*
- * http://www.phpgroupware.org
*
- * Written by Ralf Becker <address@hidden> *
- * originaly based on todo written by Joseph Engo <address@hidden> *
- * --------------------------------------------
*
- * This program is free software; you can redistribute it and/or modify
it *
- * under the terms of the GNU General Public License as published by
the *
- * Free Software Foundation; either version 2 of the License, or (at
your *
- * option) any later version.
*
-
\**************************************************************************/
-
- /* $Id$ */
+ /**********************************************************************\
+ * phpGroupWare - InfoLog *
+ * http://www.phpgroupware.org *
+ * This program is part of the GNU project, see http://www.gnu.org/ *
+ * *
+ * Copyright 2002, 2003 Free Software Foundation, Inc. *
+ * *
+ * Originally Written by Ralf Becker - <address@hidden> *
+ * Based on ToDo Written by Joseph Engo <jengo at phpgroupware.org> *
+ * --------------------------------------------
*
+ * This program is Free Software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * at your option) any later version. *
+ \**********************************************************************/
+ /* $Id$ */
class boinfolog // BO: buiseness objects:
internal logic
{
@@ -38,7 +41,7 @@
function boinfolog( $info_id = 0)
{
- $this->enums = array(
+ $this->enums = $this->stock_enums = array(
'priority' => array (
'urgent' => 'urgent','high' =>
'high','normal' => 'normal',
'low' => 'low' ),
@@ -54,7 +57,7 @@
/* ,'confirm' => 'confirm','reject' =>
'reject','email' => 'email',
'fax' => 'fax' not implemented so far
*/ )
);
- $this->status = array(
+ $this->status = $this->stock_status = array(
'defaults' => array(
'task' => 'ongoing', 'phone' => 'call',
'note' => 'done'),
'task' => array(
@@ -76,13 +79,56 @@
$this->config = CreateObject('phpgwapi.config');
$this->config->read_repository();
+ $this->customfields = array();
if ($this->config->config_data)
{
$this->link_pathes =
$this->config->config_data['link_pathes'];
$this->send_file_ips =
$this->config->config_data['send_file_ips'];
+
+ if (isset($this->config->config_data['status'])
&& is_array($this->config->config_data['status']))
+ {
+
foreach($this->config->config_data['status'] as $key => $data)
+ {
+ if
(!is_array($this->status[$key]))
+ {
+ $this->status[$key] =
array();
+ }
+ $this->status[$key] +=
$this->config->config_data['status'][$key];
+ }
+ }
+ if (isset($this->config->config_data['types'])
&& is_array($this->config->config_data['types']))
+ {
+ //echo "stock-types:<pre>";
print_r($this->enums['type']); echo "</pre>\n";
+ //echo "config-types:<pre>";
print_r($this->config->config_data['types']); echo "</pre>\n";
+ $this->enums['type'] +=
$this->config->config_data['types'];
+ //echo "types:<pre>";
print_r($this->enums['type']); echo "</pre>\n";
+ }
+ if
(isset($this->config->config_data['customfields']) &&
is_array($this->config->config_data['customfields']))
+ {
+ $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);
+ /*!
+ @function has_customfields
+ @abstract checks if there are customfields for typ $typ
+ */
+ function has_customfields($typ)
+ {
+ foreach($this->customfields as $name => $field)
+ {
+ if (empty($field['typ']) || $field['typ'] ==
$typ)
+ {
+ return True;
+ }
+ }
+ return False;
}
/*
@@ -100,34 +146,31 @@
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]')";
+ //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 &&
($link =
$this->link->get_link($info['info_link_id'])) !== False)
{
$nr = $link['link_app1'] == 'infolog' &&
$link['link_id1'] == $info['info_id'] ? '2' : '1';
$title =
$this->link->title($link['link_app'.$nr],$link['link_id'.$nr]);
-
- if (htmlentities($title) == $info['info_from'])
+
+ if ($title == $info['info_from'] ||
htmlentities($title) == $info['info_from'])
{
- $info['info_from'] = $title; //
correct old entries
+ $info['info_from'] = '';
}
if ($link['link_app'.$nr] == $not_app &&
$link['link_id'.$nr] == $not_id)
{
- if ($title == $info['info_from'])
- {
- $info['info_from'] = '';
- }
return False;
}
$info['info_link_view'] =
$this->link->view($link['link_app'.$nr],$link['link_id'.$nr]);
- $info['info_link_title'] = $title;
-
+ $info['info_link_title'] =
!empty($info['info_from']) ? $info['info_from'] : $title;
+
//echo " title='$title'</p>\n";
- return $title;
+ return $info['blur_title'] = $title;
}
else
{
$info['info_link_title'] = $info['info_from'];
+ $info['info_link_id'] = 0; // link might
have been deleted
}
return False;
}
@@ -157,7 +200,7 @@
{
while (list($key,$val) = each($values))
{
- if (substr($key,0,5) != 'info_')
+ if ($key[0] != '#' && substr($key,0,5) !=
'info_')
{
$values['info_'.$key] = $val;
unset($values[$key]);
@@ -198,11 +241,9 @@
return $this->so->anzSubs( $info_id );
}
- function
search($order,$sort,$filter,$cat_id,$query,$action,$action_id,
-
$ordermethod,&$start,&$total)
+ function
search($order,$sort,$filter,$cat_id,$query,$action,$action_id,$ordermethod,&$start,&$total)
{
- return
$this->so->search($order,$sort,$filter,$cat_id,$query,
-
$action,$action_id,$ordermethod,$start,$total);
+ return
$this->so->search($order,$sort,$filter,$cat_id,$query,$action,$action_id,$ordermethod,$start,$total);
}
/*!
@@ -217,7 +258,7 @@
{
$info = $this->read( $info );
}
- return $info['info_subject'];
+ return $info ? $info['info_subject'] : False;
}
/*!
@@ -237,4 +278,132 @@
}
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);
+
+ if(intval($content['info_responsible']) > 0 &&
$content['info_responsible'] != $content['info_owner'])
+ {
+ 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(!$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;
+ }
+ $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 '".$emp_events[$k]['emp_name']."' ==> 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);
+ //echo "<p>send(to='$to',
sender='$sender'<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,htmlspecialchars($subject), $sender)."<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;
+ }
}
+?>
====================================================
Index: infolog/inc/hook_preferences.inc.php
diff -u infolog/inc/hook_preferences.inc.php:1.10
infolog/inc/hook_preferences.inc.php:1.11
--- infolog/inc/hook_preferences.inc.php:1.10 Fri Mar 28 02:22:33 2003
+++ infolog/inc/hook_preferences.inc.php Wed Jan 5 22:07:58 2005
@@ -1,16 +1,20 @@
<?php
-
/**************************************************************************\
- * phpGroupWare - InfoLog Preferences
*
- * http://www.phpgroupware.org
*
- * Written by Ralf Becker <address@hidden> *
- * -------------------------------------------------------
*
- * This program is free software; you can redistribute it and/or modify
it *
- * under the terms of the GNU General Public License as published by
the *
- * Free Software Foundation; either version 2 of the License, or (at
your *
- * option) any later version.
*
-
\**************************************************************************/
-
- /* $Id$ */
+ /**********************************************************************\
+ * phpGroupWare - InfoLog *
+ * http://www.phpgroupware.org *
+ * This program is part of the GNU project, see http://www.gnu.org/ *
+ * *
+ * Copyright 2002, 2003 Free Software Foundation, Inc. *
+ * *
+ * Originally Written by Ralf Becker - <address@hidden> *
+ * Based on ToDo Written by Joseph Engo <jengo at phpgroupware.org> *
+ * --------------------------------------------
*
+ * This program is Free Software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * at your option) any later version. *
+ \**********************************************************************/
+ /* $Id$ */
{
// Only Modify the $file and $title variables.....
====================================================
Index: infolog/inc/class.solink.inc.php
diff -u infolog/inc/class.solink.inc.php:1.12
infolog/inc/class.solink.inc.php:1.13
--- infolog/inc/class.solink.inc.php:1.12 Sat Jun 14 13:51:53 2003
+++ infolog/inc/class.solink.inc.php Wed Jan 5 22:07:58 2005
@@ -1,15 +1,18 @@
<?php
-
/**************************************************************************\
- * phpGroupWare - InfoLog Links
*
- * http://www.phpgroupware.org
*
- * Written by Ralf Becker <address@hidden> *
- * --------------------------------------------
*
- * This program is free software; you can redistribute it and/or modify
it *
- * under the terms of the GNU General Public License as published by
the *
- * Free Software Foundation; either version 2 of the License, or (at
your *
- * option) any later version.
*
-
\**************************************************************************/
-
+ /**********************************************************************\
+ * phpGroupWare - InfoLog *
+ * http://www.phpgroupware.org *
+ * This program is part of the GNU project, see http://www.gnu.org/ *
+ * *
+ * Copyright 2002, 2003 Free Software Foundation, Inc. *
+ * *
+ * Originally Written by Ralf Becker - <address@hidden> *
+ * -------------------------------------------------------------------- *
+ * This program is Free Software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * at your option) any later version. *
+ \**********************************************************************/
/* $Id$ */
$GLOBALS['phpgw_info']['flags']['included_classes']['solink'] = True;
@@ -251,6 +254,11 @@
$sql .= " AND link_id1='$id'";
$sql2 .= " AND link_id2='$id'";
}
+ else
+ {
+ return 0;
+ }
+
$sql .= ") OR (link_app2='$app'$sql2))";
}
elseif ($app != '' && $app2 != '')
====================================================
Index: infolog/inc/class.soinfolog.inc.php
diff -u infolog/inc/class.soinfolog.inc.php:1.21
infolog/inc/class.soinfolog.inc.php:1.22
--- infolog/inc/class.soinfolog.inc.php:1.21 Tue Jul 8 23:19:18 2003
+++ infolog/inc/class.soinfolog.inc.php Wed Jan 5 22:07:58 2005
@@ -1,17 +1,20 @@
<?php
-
/**************************************************************************\
- * phpGroupWare - InfoLog
*
- * http://www.phpgroupware.org
*
- * Written by Ralf Becker <address@hidden> *
- * originaly based on todo written by Joseph Engo <address@hidden> *
- * --------------------------------------------
*
- * This program is free software; you can redistribute it and/or modify
it *
- * under the terms of the GNU General Public License as published by
the *
- * Free Software Foundation; either version 2 of the License, or (at
your *
- * option) any later version.
*
-
\**************************************************************************/
-
- /* $Id$ */
+ /**********************************************************************\
+ * phpGroupWare - InfoLog *
+ * http://www.phpgroupware.org *
+ * This program is part of the GNU project, see http://www.gnu.org/ *
+ * *
+ * Copyright 2002, 2003 Free Software Foundation, Inc. *
+ * *
+ * Originally Written by Ralf Becker - <address@hidden> *
+ * Based on ToDo Written by Joseph Engo <jengo at phpgroupware.org> *
+ * --------------------------------------------
*
+ * This program is Free Software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * at your option) any later version. *
+ \**********************************************************************/
+ /* $Id$ */
/*!
@class soinfolog
@@ -41,7 +44,7 @@
$this->links = CreateObject('infolog.solink');
- $this->read( $info_id );
+ $this->read($info_id);
}
/*!
@@ -52,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?
{
@@ -69,17 +72,29 @@
{
return False;
}
+
$owner = $info['info_owner'];
+ if($required_rights == 'confirm' &&
($info['info_confirm'] == 'accept' || $info['info_confirm'] == 'both'))
+ {
+ $access_ok = (intval($info['info_responsible'])
> 0 && $info['info_responsible'] != $owner && $info['info_responsible'] ==
$this->user && $info['info_confirm_status'] == 'not');
+ return $access_ok;
+ }
+
+ if($required_rights == 'finish' &&
($info['info_confirm'] == 'finish' || $info['info_confirm'] == 'both'))
+ {
+ $access_ok = (intval($info['info_responsible'])
> 0 && $info['info_responsible'] != $owner && $info['info_responsible'] ==
$this->user && $info['info_confirm_status'] != 'finished');
+ return $access_ok;
+ }
+
$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");
-
- return $access_ok;
+
!!($this->grants[$owner] & PHPGW_ACL_PRIVATE));
+
+ //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;
}
/*!
@@ -91,7 +106,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]))
@@ -117,27 +132,26 @@
$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))
- {
+ {
$filtermethod .= " OR
(info_access='public' AND info_owner IN(" . implode(',',$public_user_list) .
'))';
}
}
$filtermethod .= ') ';
-
+
return $this->acl_filter[$filter] = $filtermethod; //
cache the filter
}
@@ -236,16 +250,24 @@
$info_id = intval($info_id);
if ($info_id <= 0 || $info_id != $this->data['info_id']
&&
- (!$this->db->query("select * FROM phpgw_infolog
where info_id=$info_id",__LINE__,__FILE__) ||
- !$this->db->next_record()))
+ (!$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
{
$this->db2data($this->data);
+
+ $this->db->query("SELECT
info_extra_name,info_extra_value FROM phpgw_infolog_extra WHERE
info_id=$info_id",__LINE__,__FILE__);
+ while ($this->db->next_record())
+ {
+ $this->data['#'.$this->db->f(0)] =
$this->db->f(1);
+ }
}
+
+ //echo 'soinfolog:read:' . _debug_array($this->data);
return $this->data;
}
@@ -254,23 +276,38 @@
@abstract delete InfoLog entry $info_id AND the links to it
@syntax delete( $info_id )
@param $info_id id of log-entry
+ @param int $delete_children delete the children, if not set
there parent-id to 0
*/
- function delete($info_id) // did _not_ ensure ACL
+ function delete($info_id,$delete_children=True) // did _not_
ensure ACL
{
if (($info_id = intval($info_id)) <= 0)
{
return;
}
- $this->db->query("delete FROM phpgw_infolog where
info_id=$info_id or info_id_parent=$info_id" .
- " AND ((info_access='public' and info_owner !=
$this->user) OR (info_owner=$this->user))",
- __LINE__,__FILE__);
-
+ $this->db->query('DELETE FROM phpgw_infolog WHERE
info_id='.$info_id,__LINE__,__FILE__);
+ $this->db->query('DELETE FROM phpgw_infolog_extra WHERE
info_id='.$info_id,__LINE__,__FILE__);
$this->links->unlink(0,'infolog',$info_id);
if ($this->data['info_id'] == $info_id)
{
$this->init( );
}
+ // delete children, if they are owned by the user
+ if ($delete_children)
+ {
+ $db2 = $this->db; // we need an extra
result-set
+ $db2->query('SELECT info_id FROM phpgw_infolog '
+ . "WHERE
info_id_parent=$info_id "
+ . 'AND info_owner=' .
$this->user,__LINE__,__FILE__);
+ while ($db2->next_record())
+ {
+
$this->delete($db2->f(0),$delete_children);
+ }
+ }
+ // set parent_id to 0 for all not deleted children
+ $this->db->query('UPDATE phpgw_infolog '
+ . 'SET info_id_parent=0 '
+ . "WHERE
info_id_parent=$info_id",__LINE__,__FILE__);
}
/*!
@@ -285,16 +322,23 @@
$owner = intval($owner);
if (!($new_owner = intval($new_owner)))
{
- $sql = "delete FROM phpgw_infolog where
info_owner=$owner";
- $sql2 = "update phpgw_infolog set
info_responsible=0 where info_responsible=$owner";
+ $db2 = $this->db; // we need an extra
result-set
+ $db2->query('SELECT info_id FROM phpgw_infolog '
+ . "WHERE
info_owner=$owner",__LINE__,__FILE__);
+ while($db2->next_record())
+ {
+ $this->delete($this->db->f(0),False);
+ }
}
else
{
- $sql = "update phpgw_infolog set
info_owner=$new_owner where info_owner=$owner";
- $sql2 = "update phpgw_infolog set
info_responsible=$new_owner where info_responsible=$owner";
- }
- $this->db->query($sql,__LINE__,__FILE__);
- $this->db->query($sql2,__LINE__,__FILE__);
+ $this->db->query('UPDATE phpgw_infolog '
+ . "SET info_owner=$new_owner "
+ . "WHERE
info_owner=$owner",__LINE__,__FILE__);
+ }
+ $this->db->query('UPDATE phpgw_infolog '
+ . "SET info_responsible=$new_owner "
+ . "WHERE
info_responsible=$owner",__LINE__,__FILE__);
}
/*!
@@ -310,7 +354,10 @@
$db_cols = $phpgw_baseline['phpgw_infolog']['fd'];
unset($phpgw_baseline);
- while (list($key,$val) = each($values))
+ //_debug_array($values);
+ $info_id = intval($values['info_id']) > 0 ?
intval($values['info_id']) : 0;
+
+ foreach($values as $key => $val)
{
if ($key != 'info_id')
{
@@ -334,9 +381,9 @@
$query .= (strlen($query) ? ',' :
'')."$key=$val";
}
}
- if (($this->data['info_id'] =
intval($values['info_id'])) > 0)
+ if (($this->data['info_id'] = $info_id))
{
- $query = "UPDATE phpgw_infolog SET $query where
info_id='".$this->data['info_id']."'";
+ $query = "UPDATE phpgw_infolog SET $query WHERE
info_id=$info_id";
$this->db->query($query,__LINE__,__FILE__);
}
else
@@ -344,8 +391,40 @@
$query = "INSERT INTO phpgw_infolog ($cols)
VALUES ($vals)";
$this->db->query($query,__LINE__,__FILE__);
$this->data['info_id']=$this->db->get_last_insert_id('phpgw_infolog','info_id');
+ $info_id = $this->data['info_id'];
+ }
+ //echo "<p>soinfolog.write values= ";
_debug_array($values);
+
+ // write customfields now
+ $existing = array();
+ if ($info_id) // existing entry
+ {
+ $this->db->query("SELECT info_extra_name FROM
phpgw_infolog_extra WHERE info_id=$info_id",__LINE__,__FILE__);
+ while($this->db->next_record())
+ {
+ $existing[strtolower($this->db->f(0))]
= True;
+ }
+ }
+ foreach($values as $key => $val)
+ {
+ if ($key[0] != '#')
+ {
+ continue; // no customfield
+ }
+ $this->data[$key] = $val; // update
internal data
+
+ $val = $this->db->db_addslashes($val);
+ $name = $this->db->db_addslashes($key =
substr($key,1));
+ if ($existing[strtolower($key)])
+ {
+ $query = "UPDATE phpgw_infolog_extra
SET info_extra_value='$val' WHERE info_id=$info_id AND info_extra_name='$name'";
+ }
+ else
+ {
+ $query = "INSERT INTO
phpgw_infolog_extra (info_id,info_extra_name,info_extra_value) VALUES
($info_id,'$name','$val')";
+ }
+ $this->db->query($query,__LINE__,__FILE__);
}
- // echo "<p>soinfolog.write values= ";
_debug_array($values);
// echo "<p>soinfolog.write this->data= ";
_debug_array($this->data);
return $this->data['info_id'];
@@ -364,7 +443,7 @@
{
return 0;
}
- $this->db->query("select count(*) FROM phpgw_infolog
where info_id_parent=$info_id",__LINE__,__FILE__);
+ $this->db->query("select count(*) FROM phpgw_infolog
WHERE info_id_parent=$info_id",__LINE__,__FILE__);
$this->db->next_record();
@@ -402,7 +481,7 @@
if (count($links))
{
- $link_extra = ($action == 'sp' ? 'OR' :
'AND').' info_id IN ('.implode(',',$links).')';
+ $link_extra = ($action == 'sp' ? 'OR' :
'AND').' phpgw_infolog.info_id IN ('.implode(',',$links).')';
}
}
if ($order)
@@ -422,11 +501,13 @@
{
$filtermethod .= ' AND info_cat='.intval($cat_id).' ';
}
- if ($query) // we search in
_from, _subject and _des for $query
+ $join = '';
+ if ($query) // we search in
_from, _subject, _des and _extra_value for $query
{
$query = $this->db->db_addslashes($query);
$sql_query = "AND (info_from like '%$query%' OR
info_subject ".
- "LIKE
'%$query%' OR info_des LIKE '%$query%') ";
+ "LIKE
'%$query%' OR info_des LIKE '%$query%' OR info_extra_value LIKE '%$query%') ";
+ $join = 'LEFT JOIN phpgw_infolog_extra ON
phpgw_infolog.info_id=phpgw_infolog_extra.info_id';
}
$pid = 'AND info_id_parent='.($action == 'sp' ?
$action_id : 0);
@@ -438,17 +519,15 @@
$ids = array( );
if ($action == '' || $action == 'sp' || count($links))
{
- $this->db->query($sql="SELECT COUNT(*) FROM
phpgw_infolog i WHERE ($filtermethod $pid $sql_query)
$link_extra",__LINE__,__FILE__);
-
- $this->db->next_record();
- $total = $this->db->f(0);
+ $query = "FROM phpgw_infolog $join WHERE
($filtermethod $pid $sql_query) $link_extra";
+ $this->db->query($sql='SELECT DISTINCT
phpgw_infolog.info_id '.$query,__LINE__,__FILE__);
+ $total = $this->db->num_rows();
if (!$start || $start > $total)
{
$start = 0;
}
- $this->db->limit_query($sql="SELECT * FROM
phpgw_infolog WHERE ($filtermethod $pid $sql_query) $link_extra
$ordermethod",$start,__LINE__,__FILE__);
-
+ $this->db->limit_query($sql="SELECT DISTINCT
phpgw_infolog.* $query $ordermethod",$start,__LINE__,__FILE__);
while ($this->db->next_record())
{
$this->db2data(&$info);
@@ -461,4 +540,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: infolog/inc/class.uiinfolog.inc.php
diff -u infolog/inc/class.uiinfolog.inc.php:1.74
infolog/inc/class.uiinfolog.inc.php:1.75
--- infolog/inc/class.uiinfolog.inc.php:1.74 Thu Jul 31 09:20:36 2003
+++ infolog/inc/class.uiinfolog.inc.php Wed Jan 5 22:07:58 2005
@@ -1,17 +1,20 @@
<?php
-
/**************************************************************************\
- * phpGroupWare - InfoLog
*
- * http://www.phpgroupware.org
*
- * Written by Ralf Becker <address@hidden> *
- * originaly based on todo written by Joseph Engo <address@hidden> *
- * --------------------------------------------
*
- * This program is free software; you can redistribute it and/or modify
it *
- * under the terms of the GNU General Public License as published by
the *
- * Free Software Foundation; either version 2 of the License, or (at
your *
- * option) any later version.
*
-
\**************************************************************************/
-
- /* $Id$ */
+ /**********************************************************************\
+ * phpGroupWare - InfoLog *
+ * http://www.phpgroupware.org *
+ * This program is part of the GNU project, see http://www.gnu.org/ *
+ * *
+ * Copyright 2002, 2003 Free Software Foundation, Inc. *
+ * *
+ * Originally Written by Ralf Becker - <address@hidden> *
+ * Based on ToDo Written by Joseph Engo <jengo at phpgroupware.org> *
+ * --------------------------------------------
*
+ * This program is Free Software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * at your option) any later version. *
+ \**********************************************************************/
+ /* $Id$ */
class uiinfolog // UI - User Interface - HTML
{
@@ -36,6 +39,7 @@
'phone' => 'phone.gif',
'phone_alt' => 'Phonecall',
'note' => 'note.gif',
'note_alt' => 'Note',
'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(
@@ -43,6 +47,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(
@@ -55,15 +60,15 @@
);
$this->filters = array(
- 'none' => 'no Filter',
- 'done' => 'done',
- 'own' => 'own',
- 'own-open-today' => 'own open',
- 'own-open-overdue' => 'own overdue',
- 'own-upcoming' => 'own upcoming',
- 'open-today' => 'open',
- 'open-overdue' => 'overdue',
- 'upcoming' => 'upcoming'
+ 'all' => 'no Filter',
+ 'own' => 'own',
+ 'open-today' => 'open',
+ 'own-open-today' => 'own open',
+ 'own-open-overdue' => 'own overdue',
+ 'own-upcoming' => 'own upcoming',
+ 'open-overdue' => 'overdue',
+ 'upcoming' => 'upcoming',
+ 'done' => 'done'
);
$this->messages = array(
@@ -85,6 +90,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' : '');
@@ -97,6 +105,17 @@
$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');
+ }
+ else
+ {
+ $readonlys["confirm[$id]"] =
$readonlys["finish[$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
@@ -115,6 +134,9 @@
}
}
}
+ $info['info_type_label'] =
$this->bo->enums['type'][$info['info_type']];
+ $info['info_status_label'] =
$this->bo->status[$info['info_type']][$info['info_status']];
+
return $info;
}
@@ -151,6 +173,12 @@
{
$referer = is_array($values) ? $values['referer'] :
$referer;
//echo
"<p>uiinfolog::index(action='$action/$action_id',referer='$referer/$values[referer]')</p>\n";
+
+ if(!$_GET['filter'])
+ {
+ $_GET['filter'] = 'own';
+ }
+
if (!is_array($values))
{
$values = array('nm' =>
$GLOBALS['phpgw']->session->appsession('session_data','infolog'));
@@ -203,12 +231,29 @@
$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;
default:
$value = array();
$action = '';
$action_id = 0;
break;
}
+
+ if($this->bo->emailnotification && ($do
== 'confirm' || $do == 'finish'))
+ {
+
$this->bo->send_notification($do_id,'confirm');
+ }
}
}
switch ($action)
@@ -235,7 +280,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;
@@ -295,15 +340,12 @@
{
$content['info_link_id'] =
$content['link_to']['primary'];
}
- if ($content['set_today'])
- {
- $content['info_startdate'] = time();
- unset($content['set_today']);
- }
if ($content['save'] || $content['delete'] ||
$content['cancel'])
{
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'];
@@ -328,6 +370,18 @@
),False);
}
}
+
+ if($this->bo->emailnotification)
+ {
+ if(!$info_id &&
intval($content['info_responsible']) > 0 && $content['info_responsible'] !=
$content['info_owner'])
+ {
+
$this->bo->send_notification($content);
+ }
+
elseif(intval($content['info_responsible']) != $content['old_responsible'] &&
$content['info_responsible'] != $content['info_owner'])
+ {
+
$this->bo->send_notification($content);
+ }
+ }
}
elseif ($content['delete'] && $info_id
> 0)
{
@@ -387,6 +441,10 @@
{
$content['info_startdate'] =
time();
}
+ if ($content['info_enddate'] < time())
// parent-enddate is in the past => empty
+ {
+ $content['info_enddate'] = '';
+ }
}
else
{
@@ -442,8 +500,17 @@
$readonlys['delete'] = $action != '';
$GLOBALS['phpgw_info']['flags']['app_header'] =
lang($this->messages[$info_id ? 'edit' : ($action == 'sp' ? 'add_sub' :
'add')]);
- //echo "<p>uiinfolog.edit(info_id=$info_id,mode=$mode)
content = "; _debug_array($content);
$this->tmpl->read('infolog.edit');
+ if ($this->bo->has_customfields($content['info_type']))
+ {
+ $content['customfields'] =
$this->bo->customfields;
+ $content['customfields']['###typ###'] =
$content['info_type'];
+ }
+ else
+ {
+
$this->tmpl->set_cell_attribute('description|links|delegation|customfields','name','description|links|delegation');
+ }
+ //echo "<p>uiinfolog.edit(info_id=$info_id,mode=$mode)
content = "; _debug_array($content);
$this->tmpl->exec('infolog.uiinfolog.edit',$content,array(
'info_type' => $this->bo->enums['type'],
'info_pri' => $this->bo->enums['priority'],
@@ -485,7 +552,7 @@
return $icon ?
$this->html->image('infolog',$icon,lang($alt),'border=0') : lang($alt);
}
- function admin( )
+ function admin()
{
if(get_var('cancel',Array('POST')))
{
@@ -507,11 +574,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
+ 'link_pathes' =>
$this->bo->link_pathes,
+ '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();
@@ -523,13 +593,15 @@
$GLOBALS['phpgw']->template->set_block('info_admin_t',
'info_admin');
$GLOBALS['phpgw']->template->set_var(Array(
- 'text' => lang('<b>file-attachments via
symlinks</b> instead of uploads and retrieval via file:/path for direct
lan-clients'),
- 'action_url' =>
$this->html->link('/index.php',$this->menuaction('admin')),
- 'save_button' =>
$this->html->submit_button('save','Save'),
- '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\\.')
+ 'text' =>
lang('<b>file-attachments via symlinks</b> instead of uploads and retrieval via
file:/path for direct lan-clients'),
+ 'action_url' =>
$this->html->link('/index.php',$this->menuaction('admin')),
+ 'save_button' =>
$this->html->submit_button('save','Save'),
+ '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_enable_emailnotification' => lang('enable
email notification for assigned tasks'),
+ 'notify_checked' =>
($this->bo->emailnotification?'checked="checked"':'')
));
if (!is_array($this->bo->send_file_ips))
@@ -604,7 +676,7 @@
case 'addressbook_view':
$app = 'addressbook';
$view_id = 'ab_id';
- $view =
'addressbook.uiaddressbook.view';
+ $view =
'addressbook.uiaddressbook.view_person';
break;
case 'projects_view':
$app = 'projects';
====================================================
====================================================
Index: infolog/inc/class.vfs.inc.php
diff -u infolog/inc/class.vfs.inc.php:1.9 infolog/inc/class.vfs.inc.php:1.10
--- infolog/inc/class.vfs.inc.php:1.9 Thu Jul 3 17:11:23 2003
+++ infolog/inc/class.vfs.inc.php Wed Jan 5 22:07:58 2005
@@ -1,27 +1,19 @@
<?php
- /**************************************************************************\
- * phpGroupWare API - VFS *
- * This file written by Jason Wies (Zone) <address@hidden> *
- * This class handles file/dir access for phpGroupWare *
- * Copyright (C) 2001 Jason Wies *
- * -------------------------------------------------------------------------*
- * This library is part of the phpGroupWare API *
- * http://www.phpgroupware.org/api *
- * ------------------------------------------------------------------------ *
- * This library is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as published by *
- * the Free Software Foundation; either version 2.1 of the License, *
- * or any later version. *
- * This library is distributed in the hope that it will be useful, but *
- * WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
- * See the GNU Lesser General Public License for more details. *
- * You should have received a copy of the GNU Lesser General Public License *
- * along with this library; if not, write to the Free Software Foundation, *
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
- \**************************************************************************/
-
- /* $Id$ */
+ /**********************************************************************\
+ * phpGroupWare - InfoLog *
+ * http://www.phpgroupware.org *
+ * This program is part of the GNU project, see http://www.gnu.org/ *
+ * *
+ * Copyright 2001, 2002, 2003 Free Software Foundation, Inc. *
+ * *
+ * Originally Written by Jason Wies <zone at users.sourceforge.net> *
+ * --------------------------------------------
*
+ * This program is Free Software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Lesser Public License as *
+ * published by the Free Software Foundation; either version 2.1 of the *
+ *License, or at your option) any later version. *
+ \**********************************************************************/
+ /* $Id$ */
/*!
@class vfs
====================================================
Index: infolog/inc/hook_admin.inc.php
diff -u infolog/inc/hook_admin.inc.php:1.10 infolog/inc/hook_admin.inc.php:1.11
--- infolog/inc/hook_admin.inc.php:1.10 Sat Apr 26 08:39:59 2003
+++ infolog/inc/hook_admin.inc.php Wed Jan 5 22:07:58 2005
@@ -1,21 +1,33 @@
<?php
-
/**************************************************************************\
- * phpGroupWare - Info Log administration
*
- * http://www.phpgroupware.org
*
- * --------------------------------------------
*
- * This program is free software; you can redistribute it and/or modify
it *
- * under the terms of the GNU General Public License as published by
the *
- * Free Software Foundation; either version 2 of the License, or (at
your *
- * option) any later version.
*
-
\**************************************************************************/
- /* $Id$ */
+ /**********************************************************************\
+ * phpGroupWare - InfoLog *
+ * http://www.phpgroupware.org *
+ * This program is part of the GNU project, see http://www.gnu.org/ *
+ * *
+ * Copyright 2002, 2003 Free Software Foundation, Inc. *
+ * *
+ * Originally Written by Ralf Becker - <address@hidden> *
+ * Based on ToDo Written by Joseph Engo <jengo at phpgroupware.org> *
+ * --------------------------------------------
*
+ * This program is Free Software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * at your option) any later version. *
+ \**********************************************************************/
+ /* $Id$ */
{
$file = Array
(
- 'Site configuration' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction' =>
'infolog.uiinfolog.admin' )),
- 'Global Categories' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index&appname='
. $appname . '&global_cats=True'),
- 'CSV-Import' =>
$GLOBALS['phpgw']->link('/infolog/csv_import.php')
+ 'Site configuration' =>
$GLOBALS['phpgw']->link('/index.php',array(
+ 'menuaction' => 'infolog.uiinfolog.admin' )),
+ 'Global Categories' =>
$GLOBALS['phpgw']->link('/index.php',array(
+ 'menuaction' => 'admin.uicategories.index',
+ 'appname' => $appname,
+ 'global_cats'=> True)),
+ 'Custom fields, typ and status' =>
$GLOBALS['phpgw']->link('/index.php',array(
+ 'menuaction' => 'infolog.uicustomfields.edit')),
+ 'CSV-Import' =>
$GLOBALS['phpgw']->link('/infolog/csv_import.php')
);
//Do not modify below this line
====================================================
Index: infolog/inc/class.uilink.inc.php
diff -u infolog/inc/class.uilink.inc.php:1.6
infolog/inc/class.uilink.inc.php:1.7
--- infolog/inc/class.uilink.inc.php:1.6 Sun Sep 29 08:40:51 2002
+++ infolog/inc/class.uilink.inc.php Wed Jan 5 22:07:58 2005
@@ -1,16 +1,20 @@
<?php
-
/**************************************************************************\
- * phpGroupWare - InfoLog Links
*
- * http://www.phpgroupware.org
*
- * Written by Ralf Becker <address@hidden> *
- * --------------------------------------------
*
- * This program is free software; you can redistribute it and/or modify
it *
- * under the terms of the GNU General Public License as published by
the *
- * Free Software Foundation; either version 2 of the License, or (at
your *
- * option) any later version.
*
-
\**************************************************************************/
-
- /* $Id$ */
+ /**********************************************************************\
+ * phpGroupWare - InfoLog *
+ * http://www.phpgroupware.org *
+ * This program is part of the GNU project, see http://www.gnu.org/ *
+ * *
+ * Copyright 2002, 2003 Free Software Foundation, Inc. *
+ * *
+ * Originally Written by Ralf Becker - <address@hidden> *
+ * Based on ToDo Written by Joseph Engo <jengo at phpgroupware.org> *
+ * --------------------------------------------
*
+ * This program is Free Software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * at your option) any later version. *
+ \**********************************************************************/
+ /* $Id$ */
include_once(PHPGW_INCLUDE_ROOT . '/infolog/inc/class.bolink.inc.php');
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] infolog/inc hook_settings.inc.php, 1.6 hook_home.inc.php, 1.9 class.sbox2.inc.php, 1.6 class.bolink.inc.php, 1.22 class.boinfolog.inc.php, 1.37 hook_preferences.inc.php, 1.11 class.solink.inc.php, 1.13 class.soinfolog.inc.php, 1.22 class.uiinfolog.inc.php, 1.75 hook_deleteaccount.inc.php, 1.3 class.vfs.inc.php, 1.10 hook_admin.inc.php, 1.11 class.uilink.inc.php, 1.7,
ceb <=