- renamed class to new naming convention

- update version and dependencies for 1.6
- file_access method for attachments
This commit is contained in:
Ralf Becker 2008-10-07 12:50:14 +00:00
parent aceef3f548
commit 7f9df0d051
24 changed files with 1873 additions and 1849 deletions

View File

@ -41,7 +41,7 @@ if ($_POST['cancel'])
$GLOBALS['egw_info']['flags']['app_header'] = lang('InfoLog - Import CSV-File');
$GLOBALS['egw']->common->egw_header();
$boinfolog = createobject('infolog.boinfolog');
$infolog_bo = createobject('infolog.infolog_bo');
$GLOBALS['egw']->template->set_file(array('import_t' => 'csv_import.tpl'));
$GLOBALS['egw']->template->set_block('import_t','filename','filenamehandle');
@ -222,9 +222,9 @@ case 'download':
'link_3' => '3. link: appname:appid the entry should be linked to, eg.: addressbook:123',
);
// add custom fields
if ($boinfolog->customfields)
if ($infolog_bo->customfields)
{
foreach($boinfolog->customfields as $name => $field)
foreach($infolog_bo->customfields as $name => $field)
{
if ($field['type'] == 'label' || !count($field['values']) && $field['rows'] <= 1 && $field['len'] <= 0) continue;
@ -506,7 +506,7 @@ case 'import':
{
$values['project_id'] = project_id($values['project_id']);
}
if (($id = $boinfolog->write($to_write,True,False)))
if (($id = $infolog_bo->write($to_write,True,False)))
{
$info_link_id = false;
foreach(array(
@ -526,7 +526,7 @@ case 'import':
'info_id' => $id,
'info_link_id' => $link_id,
);
$boinfolog->write($to_write);
$infolog_bo->write($to_write);
$info_link_id = true;
}
}

View File

@ -9,22 +9,20 @@
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
include_once(EGW_INCLUDE_ROOT.'/infolog/inc/class.soinfolog.inc.php');
define('EGW_ACL_UNDELETE',EGW_ACL_CUSTOM_1); // undelete right
/**
* This class is the BO-layer of InfoLog, it also handles xmlrpc requests
*/
class boinfolog
class infolog_bo
{
var $enums;
var $status;
/**
* Instance of our so class
*
* @var soinfolog
* @var infolog_so
*/
var $so;
var $vfs;
@ -61,26 +59,26 @@ class boinfolog
/**
* offset in secconds between user and server-time,
* it need to be add to a server-time to get the user-time or substracted from a user-time to get the server-time
*
*
* @var int
*/
var $tz_offset_s = 0;
var $user_time_now;
/**
* name of timestamps in an InfoLog entry
*
*
* @var array
*/
var $timestamps = array('info_startdate','info_enddate','info_datemodified','info_datecompleted');
/**
* fields the responsible user can change
*
*
* @var array
*/
var $responsible_edit=array('info_status','info_percent','info_datecompleted');
/**
* implicit ACL rights of the responsible user: read or edit
*
*
* @var string
*/
var $implicit_rights='read';
@ -91,7 +89,7 @@ class boinfolog
*/
var $customfields=array();
/**
* Group owners for certain types read from the infolog config
* Group owners for certain types read from the infolog config
*
* @var array
*/
@ -128,14 +126,14 @@ class boinfolog
* @param int $info_id
* @param boolean $instanciate_link=true should the link class be instanciated, used by the link-registry to prevent infinit recursion
*/
function boinfolog($info_id = 0,$instanciate_link=true)
function __construct($info_id = 0,$instanciate_link=true)
{
$this->enums = $this->stock_enums = array(
'priority' => array (
3 => 'urgent',
2 => 'high',
1 => 'normal',
0 => 'low'
0 => 'low'
),
'confirm' => array(
'not' => 'not','accept' => 'accept','finish' => 'finish',
@ -238,7 +236,7 @@ class boinfolog
$this->user_time_now = time() + $this->tz_offset_s;
$this->grants = $GLOBALS['egw']->acl->get_grants('infolog',$this->group_owners ? $this->group_owners : true);
$this->so =& new soinfolog($this->grants);
$this->so =& new infolog_so($this->grants);
// are we called via xmlrpc?
$this->xmlrpc = is_object($GLOBALS['server']) && $GLOBALS['server']->last_method;
@ -285,9 +283,9 @@ class boinfolog
function check_access( $info,$required_rights )
{
static $cache = array();
$info_id = is_array($info) ? $info['info_id'] : $info;
if (isset($cache[$info_id][$required_rights]))
{
return $cache[$info_id][$required_rights];
@ -296,8 +294,8 @@ class boinfolog
if ($this->history)
{
if (!is_array($info) && !($info = $this->so->read($info_id))) return false;
if ($info['info_status'] == 'deleted' &&
if ($info['info_status'] == 'deleted' &&
($required_rights == EGW_ACL_EDIT || // no edit rights for deleted entries
$required_rights == EGW_ACL_ADD || // no add rights for deleted entries
$required_rights == EGW_ACL_DELETE && ($this->history == 'history_no_delete' || // no delete at all!
@ -311,7 +309,7 @@ class boinfolog
{
return $cache[$info_id][$required_rights] = false; // can only undelete deleted items
}
// undelete requires edit rights
// undelete requires edit rights
return $cache[$info_id][$required_rights] = $this->so->check_access( $info,EGW_ACL_EDIT,$this->implicit_rights == 'edit' );
}
}
@ -321,7 +319,7 @@ class boinfolog
}
return $cache[$info_id][$required_rights] = $this->so->check_access( $info,$required_rights,$this->implicit_rights == 'edit' );
}
/**
* Check if use is responsible for an entry: he or one of his memberships is in responsible
*
@ -412,7 +410,7 @@ class boinfolog
* Read an infolog entry specified by $info_id
*
* @param int/array $info_id integer id or array with key 'info_id' of the entry to read
* @param boolean $run_link_id2from=true should link_id2from run, default yes,
* @param boolean $run_link_id2from=true should link_id2from run, default yes,
* need to be set to false if called from link-title to prevent an infinit recursion
* @return array/boolean infolog entry, null if not found or false if no permission to read it
*/
@ -511,7 +509,7 @@ class boinfolog
}
}
if (!($info = $this->read($info_id))) return false; // should not happen
$deleted = $info;
$deleted['info_status'] = 'deleted';
$deleted['info_datemodified'] = time();
@ -529,13 +527,13 @@ class boinfolog
else
{
$this->so->delete($info_id,false); // we delete the children via bo to get all notifications!
egw_link::unlink(0,'infolog',$info_id);
}
if ($info['info_status'] != 'deleted') // dont notify of final purge of already deleted items
{
$GLOBALS['egw']->contenthistory->updateTimeStamp('infolog_'.$info['info_type'], $info_id, 'delete', time());
// send email notifications and do the history logging
require_once(EGW_INCLUDE_ROOT.'/infolog/inc/class.infolog_tracking.inc.php');
if (!is_object($this->tracking))
@ -546,14 +544,14 @@ class boinfolog
}
return True;
}
/**
* writes the given $values to InfoLog, a new entry gets created if info_id is not set or 0
*
* checks and asures ACL
*
* @param array &$values values to write, if contains values for check_defaults and touch_modified,
* they have precedens over the parameters. The
* @param array &$values values to write, if contains values for check_defaults and touch_modified,
* they have precedens over the parameters. The
* @param boolean $check_defaults=true check and set certain defaults
* @param boolean $touch_modified=true touch the modification data and sets the modiefier's user-id
* @return int/boolean info_id on a successfull write or false
@ -605,7 +603,7 @@ class boinfolog
}
if ($status_only && !$undelete) // make sure only status gets writen
{
$set_completed = !$values['info_datecompleted'] && // set date completed of finished job, only if its not already set
$set_completed = !$values['info_datecompleted'] && // set date completed of finished job, only if its not already set
(in_array($values['info_status'],array('done','billed','cancelled')) || (int)$values['info_percent'] == 100);
$backup_values = $values; // to return the full values
@ -627,7 +625,7 @@ class boinfolog
}
if ($check_defaults)
{
if (!$values['info_datecompleted'] &&
if (!$values['info_datecompleted'] &&
(in_array($values['info_status'],array('done','billed')) || (int)$values['info_percent'] == 100))
{
$values['info_datecompleted'] = $this->user_time_now; // set date completed to today if status == done
@ -699,7 +697,7 @@ class boinfolog
{
// update
$GLOBALS['egw']->contenthistory->updateTimeStamp(
'infolog_'.$values['info_type'],
'infolog_'.$values['info_type'],
$info_id, 'modify', time()
);
}
@ -707,7 +705,7 @@ class boinfolog
{
// add
$GLOBALS['egw']->contenthistory->updateTimeStamp(
'infolog_'.$values['info_type'],
'infolog_'.$values['info_type'],
$info_id, 'add', time()
);
}
@ -722,7 +720,7 @@ class boinfolog
// notify the link-class about the update, as other apps may be subscribt to it
egw_link::notify_update('infolog',$info_id,$values);
// send email notifications and do the history logging
if (!is_object($this->tracking))
{
@ -738,7 +736,7 @@ class boinfolog
/**
* Query the number of children / subs
*
* @param int $info_id id
* @param int $info_id id
* @return int number of subs
*/
function anzSubs( $info_id )
@ -763,7 +761,7 @@ class boinfolog
{
//echo "<p>boinfolog::search(".print_r($query,True).")</p>\n";
$ret = $this->so->search($query);
// convert system- to user-time
if (is_array($ret) && $this->tz_offset_s)
{
@ -789,7 +787,7 @@ class boinfolog
return $ret;
}
/**
* imports a mail identified by uid as infolog
*
@ -805,7 +803,7 @@ class boinfolog
function import_mail($_email_address,$_subject,$_message,$_attachments,$_date)
{
$address_array = imap_rfc822_parse_adrlist($_email_address,'');
foreach ((array)$address_array as $address)
foreach ((array)$address_array as $address)
{
$email[] = $emailadr = sprintf('%s@%s',
trim($address->mailbox),
@ -850,7 +848,7 @@ class boinfolog
$info['msg'] = lang('Attention: No Contact with address %1 found.',$info['info_addr']);
$info['info_custom_from'] = true; // show the info_from line and NOT only the link
}
else
else
{
// create the first address as info_contact
$contact = array_shift($contacts);
@ -871,39 +869,12 @@ class boinfolog
}
}
}
return $info;
}
/**
* Hook called by link-class to include infolog in the appregistry of the linkage
*
* @param array/string $location location and other parameters (not used)
* @return array with method-names
*/
function search_link($location)
{
return array(
'query' => 'infolog.boinfolog.link_query',
'title' => 'infolog.boinfolog.link_title',
'titles' => 'infolog.boinfolog.link_titles',
'view' => array(
'menuaction' => 'infolog.uiinfolog.index',
'action' => 'sp'
),
'view_id' => 'action_id',
'add' => array(
'menuaction' => 'infolog.uiinfolog.edit',
'type' => 'task'
),
'add_app' => 'action',
'add_id' => 'action_id',
'add_popup' => '750x550',
);
return $info;
}
/**
* get title for an infolog entry identified by $info
*
*
* Is called as hook to participate in the linking
*
* @param int/array $info int info_id or array with infolog entry
@ -922,7 +893,7 @@ class boinfolog
return !empty($info['info_subject']) ? $info['info_subject'] :
self::subject_from_des($info['info_descr']);
}
/**
* Return multiple titles fetched by a single query
*
@ -971,6 +942,18 @@ class boinfolog
return $content;
}
/**
* Check access to the projects file store
*
* @param int $id id of entry
* @param int $check EGW_ACL_READ for read and EGW_ACL_EDIT for write or delete access
* @return boolean true if access is granted or false otherwise
*/
function file_access($id,$check,$rel_path)
{
return $this->check_access($id,$check);
}
/**
* hook called be calendar to include events or todos in the cal-dayview
*
@ -1012,7 +995,7 @@ class boinfolog
{
$time = (int) adodb_date('Hi',$info['info_startdate']);
$date = adodb_date('Y/m/d',$info['info_startdate']);
/* As event-like infologs are not showen in current calendar,
/* As event-like infologs are not showen in current calendar,
we need to present all open infologs to the user! (2006-06-27 nelius)
if ($do_events && !$time ||
!$do_events && $time && $date == $date_wanted)
@ -1121,7 +1104,7 @@ class boinfolog
function data2xmlrpc($data)
{
$data['rights'] = $this->so->grants[$data['info_owner']];
// translate timestamps
if($data['info_enddate'] == 0) unset($data['info_enddate']);
foreach($this->timestamps as $name)
@ -1200,7 +1183,7 @@ class boinfolog
{
return $this->xmlrpc ? $GLOBALS['server']->categories($complete) : False;
}
/**
* Returm InfoLog (custom) status icons for projectmanager
*
@ -1297,7 +1280,7 @@ class boinfolog
return;
}
error_log("boinfolog::async_notification() users with open entries: ".implode(', ',$users));
$save_account_id = $GLOBALS['egw_info']['user']['account_id'];
$save_prefs = $GLOBALS['egw_info']['user']['preferences'];
foreach($users as $user)
@ -1310,8 +1293,8 @@ class boinfolog
$GLOBALS['egw']->acl->acl($user);
$GLOBALS['egw']->acl->read_repository();
$this->grants = $GLOBALS['egw']->acl->get_grants('infolog',$this->group_owners ? $this->group_owners : true);
$this->so =& new soinfolog($this->grants); // so caches it's filters
$this->so =& new infolog_so($this->grants); // so caches it's filters
$notified_info_ids = array();
foreach(array(
'notify_due_responsible' => 'open-responsible-enddate',
@ -1321,16 +1304,16 @@ class boinfolog
) as $pref => $filter)
{
if (!($pref_value = $GLOBALS['egw_info']['user']['preferences']['infolog'][$pref])) continue;
$filter .= date('Y-m-d',time()+24*60*60*(int)$pref_value);
error_log("boinfolog::async_notification() checking with filter '$filter' ($pref_value) for user $user ($email)");
$params = array('filter' => $filter);
foreach($this->so->search($params) as $info)
{
// check if we already send a notification for that infolog entry, eg. starting and due on same day
if (in_array($info['info_id'],$notified_info_ids)) continue;
if (is_null($tracking) || $tracking->user != $user)
{
require_once(EGW_INCLUDE_ROOT.'/infolog/inc/class.infolog_tracking.inc.php');
@ -1357,7 +1340,7 @@ class boinfolog
}
error_log("notifiying $user($email) about $info[info_subject]: $info[message]");
$tracking->send_notification($info,null,$email,$user,$pref);
$notified_info_ids[] = $info['info_id'];
}
}
@ -1365,7 +1348,7 @@ class boinfolog
$GLOBALS['egw_info']['user']['account_id'] = $save_account_id;
$GLOBALS['egw_info']['user']['preferences'] = $save_prefs;
}
/** conversion of infolog status to vtodo status
* @private
* @var array
@ -1384,7 +1367,7 @@ class boinfolog
/** conversion of vtodo status to infolog status
* @private
* @var array
* @var array
*/
var $_vtodo2status = array(
'NEEDS-ACTION' => 'not-started',
@ -1392,7 +1375,7 @@ class boinfolog
'COMPLETED' => 'done',
'CANCELLED' => 'cancelled',
);
/**
* Converts an infolog status into a vtodo status
*
@ -1403,10 +1386,10 @@ class boinfolog
{
return isset($this->_status2vtodo[$status]) ? $this->_status2vtodo[$status] : 'NEEDS-ACTION';
}
/**
* Converts a vtodo status into an infolog status using the optional X-INFOLOG-STATUS
*
*
* X-INFOLOG-STATUS is only used, if translated to the vtodo-status gives the identical vtodo status
* --> the user did not changed it
*
@ -1428,7 +1411,7 @@ class boinfolog
}
return $status;
}
/**
* Activates an InfoLog entry (setting it's status from template or inactive depending on the completed percentage)
*

View File

@ -13,7 +13,7 @@
/**
* Administration of custom fields, type and status
*/
class uicustomfields
class infolog_customfields
{
var $public_functions = array(
'edit' => True
@ -32,21 +32,21 @@ class uicustomfields
var $tmpl;
/**
* instance of the config class for infolog
*
*
* @var config
*/
var $config_data;
/**
* Group owners for certain types read from the infolog config
* Group owners for certain types read from the infolog config
*
* @var array
*/
var $group_owners;
function uicustomfields( )
function __construct( )
{
$this->bo =& CreateObject('infolog.boinfolog');
$this->tmpl =& CreateObject('etemplate.etemplate');
$this->bo = new infolog_bo();
$this->tmpl = new etemplate();
$this->types = &$this->bo->enums['type'];
$this->status = &$this->bo->status;
$this->config_data = config::read('infolog');
@ -147,13 +147,13 @@ class uicustomfields
}
$content['fields'][++$n] = array('type2'=>'','order' => 10 * $n); // new line for create
$readonlys['fields']["delete[]"] = True;
$content['group_owner'] = $this->group_owners[$content['type2']];
//echo '<p>uicustomfields.edit(content = <pre style="text-align: left;">'; print_r($content); echo "</pre>\n";
//echo '<p>'.__METHOD__'.(content = <pre style="text-align: left;">'; print_r($content); echo "</pre>\n";
//echo 'readonlys = <pre style="text-align: left;">'; print_r($readonlys); echo "</pre>\n";
$this->tmpl->read('infolog.customfields');
$this->tmpl->exec('infolog.uicustomfields.edit',$content,array(
$this->tmpl->exec('infolog.infolog_customfields.edit',$content,array(
'type2' => $this->types,
),$readonlys,array(
'status' => $preserv_status,
@ -305,7 +305,7 @@ class uicustomfields
{
$this->update_status($content);
$this->update_fields($content);
if ($content['group_owner'])
{
$this->group_owners[$content['type2']] = $content['group_owner'];
@ -363,9 +363,9 @@ class uicustomfields
{
// save changes to repository
config::save_value('types',$this->types,'infolog');
//echo '<p>uicustomfields::save_repository() \$this->status=<pre style="text-aling: left;">'; print_r($this->status); echo "</pre>\n";
//echo '<p>'.__METHOD__.'() \$this->status=<pre style="text-aling: left;">'; print_r($this->status); echo "</pre>\n";
config::save_value('status',$this->status,'infolog');
//echo '<p>uicustomfields::save_repository() \$this->fields=<pre style="text-aling: left;">'; print_r($this->fields); echo "</pre>\n";
//echo '<p>'.__METHOD__.'() \$this->fields=<pre style="text-aling: left;">'; print_r($this->fields); echo "</pre>\n";
config::save_value('customfields',$this->fields,'infolog');
config::save_value('group_owners',$this->group_owners,'infolog');
}

View File

@ -6,7 +6,7 @@
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @package infolog
* @subpackage projectmanager
* @copyright (c) 2005 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @copyright (c) 2005-8 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
@ -16,21 +16,21 @@ include_once(EGW_INCLUDE_ROOT.'/projectmanager/inc/class.datasource.inc.php');
/**
* DataSource for InfoLog
*
* The InfoLog datasource set's only real start- and endtimes, plus planned and used time and
* The InfoLog datasource set's only real start- and endtimes, plus planned and used time and
* the responsible user as resources (not always the owner too!).
* The read method of the extended datasource class sets the planned start- and endtime:
* - planned start from the end of a start constrain
* - planned end from the planned time and a start-time
* - planned start and end from the "real" values
*/
class datasource_infolog extends datasource
class infolog_datasource extends datasource
{
/**
* Reference to boinfolog
* Reference to infolog_bo
*
* @var boinfolog
* @var infolog_bo
*/
var $boinfolog;
var $infolog_bo;
/**
* Constructor
@ -38,21 +38,20 @@ class datasource_infolog extends datasource
function datasource_infolog()
{
$this->datasource('infolog');
$this->valid = PM_COMPLETION|PM_PLANNED_START|PM_PLANNED_END|PM_REAL_END|PM_PLANNED_TIME|PM_REPLANNED_TIME|PM_USED_TIME|PM_RESOURCES;
// we use $GLOBALS['boinfolog'] as an already running instance might be availible there
if (!is_object($GLOBALS['boinfolog']))
// we use $GLOBALS['infolog_bo'] as an already running instance might be availible there
if (!is_object($GLOBALS['infolog_bo']))
{
include_once(EGW_INCLUDE_ROOT.'/infolog/inc/class.boinfolog.inc.php');
$GLOBALS['boinfolog'] =& new boinfolog();
$GLOBALS['infolog_bo'] =& new infolog_bo();
}
$this->boinfolog =& $GLOBALS['boinfolog'];
$this->infolog_bo =& $GLOBALS['infolog_bo'];
}
/**
* get an entry from the underlaying app (if not given) and convert it into a datasource array
*
*
* @param mixed $data_id id as used in the link-class for that app, or complete entry as array
* @return array/boolean array with the data supported by that source or false on error (eg. not found, not availible)
*/
@ -60,8 +59,8 @@ class datasource_infolog extends datasource
{
if (!is_array($data_id))
{
$data =& $this->boinfolog->read((int) $data_id);
$data =& $this->infolog_bo->read((int) $data_id);
if (!is_array($data)) return false;
}
else
@ -69,7 +68,7 @@ class datasource_infolog extends datasource
$data =& $data_id;
}
return array(
'pe_title' => $this->boinfolog->link_title($data),
'pe_title' => $this->infolog_bo->link_title($data),
'pe_completion' => $data['info_percent'],
'pe_planned_start'=> $data['info_startdate'] ? $data['info_startdate'] : null,
'pe_planned_end' => $data['info_enddate'] ? $data['info_enddate'] : null,
@ -87,7 +86,7 @@ class datasource_infolog extends datasource
'pe_used_budget' => $data['info_used_time'] / 60 * $data['info_price'],
);
}
/**
* Copy the datasource of a projectelement (InfoLog entry) and re-link it with project $target
*
@ -98,14 +97,14 @@ class datasource_infolog extends datasource
*/
function copy($element,$target,$extra=null)
{
$info =& $this->boinfolog->read((int) $element['pe_app_id']);
$info =& $this->infolog_bo->read((int) $element['pe_app_id']);
if (!is_array($info)) return false;
// unsetting info_link_id and evtl. info_from
if ($info['info_link_id'])
{
$this->boinfolog->link_id2from($info); // unsets info_from and sets info_link_target
$this->infolog_bo->link_id2from($info); // unsets info_from and sets info_link_target
unset($info['info_link_id']);
}
// we need to unset a view fields, to get a new entry
@ -113,33 +112,33 @@ class datasource_infolog extends datasource
{
unset($info[$key]);
}
if(!($info['info_id'] = $this->boinfolog->write($info))) return false;
if(!($info['info_id'] = $this->infolog_bo->write($info))) return false;
// link the new infolog against the project and setting info_link_id and evtl. info_from
$info['info_link_id'] = $this->boinfolog->link->link('projectmanager',$target,'infolog',$info['info_id'],$element['pe_remark'],0,0,1);
$info['info_link_id'] = $this->infolog_bo->link->link('projectmanager',$target,'infolog',$info['info_id'],$element['pe_remark'],0,0,1);
if (!$info['info_from'])
{
$info['info_from'] = $this->boinfolog->link->title('projectmanager',$target);
$info['info_from'] = $this->infolog_bo->link->title('projectmanager',$target);
}
if ($info['info_status'] == 'template')
{
$info['info_status'] = $this->boinfolog->activate($info);
$info['info_status'] = $this->infolog_bo->activate($info);
}
$this->boinfolog->write($info);
$this->infolog_bo->write($info);
// creating again all links, beside the one to the source-project
foreach($this->boinfolog->link->get_links('infolog',$element['pe_app_id']) as $link)
foreach($this->infolog_bo->link->get_links('infolog',$element['pe_app_id']) as $link)
{
if ($link['app'] == 'projectmanager' && $link['id'] == $element['pm_id'] || // ignoring the source project
$link['app'] == $this->boinfolog->link->vfs_appname) // ignoring files attachments for now
$link['app'] == $this->infolog_bo->link->vfs_appname) // ignoring files attachments for now
{
continue;
}
$this->boinfolog->link->link('infolog',$info['info_id'],$link['app'],$link['id'],$link['remark']);
$this->infolog_bo->link->link('infolog',$info['info_id'],$link['app'],$link['id'],$link['remark']);
}
return array($info['info_id'],$info['info_link_id']);
}
/**
* Delete the datasource of a project element
*
@ -148,19 +147,19 @@ class datasource_infolog extends datasource
*/
function delete($id)
{
if (!is_object($GLOBALS['boinfolog']))
if (!is_object($GLOBALS['infolog_bo']))
{
include_once(EGW_INCLUDE_ROOT.'/infolog/inc/class.boinfolog.inc.php');
$GLOBALS['boinfolog'] =& new boinfolog();
include_once(EGW_INCLUDE_ROOT.'/infolog/inc/class.infolog_bo.inc.php');
$GLOBALS['infolog_bo'] =& new infolog_bo();
}
// dont delete infolog, which are linked to other elements, but their project
if (count($this->boinfolog->link->get_links('infolog',$id)) > 1)
if (count($this->infolog_bo->link->get_links('infolog',$id)) > 1)
{
return false;
}
return $this->boinfolog->delete($id);
return $this->infolog_bo->delete($id);
}
/**
* Change the status of an infolog entry according to the project status
*
@ -171,17 +170,17 @@ class datasource_infolog extends datasource
function change_status($id,$status)
{
//error_log("datasource_infolog::change_status($id,$status)");
if (($info = $this->boinfolog->read($id)) && $this->boinfolog->check_access($info,EGW_ACL_EDIT))
if (($info = $this->infolog_bo->read($id)) && $this->infolog_bo->check_access($info,EGW_ACL_EDIT))
{
if ($status == 'active' && in_array($info['info_status'],array('template','nonactive','archive')))
{
$status = $this->boinfolog->activate($info);
$status = $this->infolog_bo->activate($info);
}
if($info['info_status'] != $status && isset($this->boinfolog->status[$info['info_type']][$status]))
if($info['info_status'] != $status && isset($this->infolog_bo->status[$info['info_type']][$status]))
{
//error_log("datasource_infolog::change_status($id,$status) setting status from ".$info['info_status']);
$info['info_status'] = $status;
return $this->boinfolog->write($info) !== false;
return $this->infolog_bo->write($info) !== false;
}
}
return false;

View File

@ -11,8 +11,6 @@
* @version $Id$
*/
require_once(EGW_INCLUDE_ROOT.'/infolog/inc/class.boinfolog.inc.php');
/**
* eGroupWare: GroupDAV access: infolog handler
*/
@ -21,7 +19,7 @@ class infolog_groupdav extends groupdav_handler
/**
* bo class of the application
*
* @var boinfolog
* @var infolog_bo
*/
var $bo;
@ -36,7 +34,7 @@ class infolog_groupdav extends groupdav_handler
{
parent::__construct($app,$debug,$base_uri);
$this->bo =& new boinfolog();
$this->bo =& new infolog_bo();
}
/**
@ -96,8 +94,7 @@ class infolog_groupdav extends groupdav_handler
{
return $task;
}
include_once(EGW_INCLUDE_ROOT.'/infolog/inc/class.vcalinfolog.inc.php');
$handler = new vcalinfolog();
$handler = new infolog_ical();
$options['data'] = $handler->exportVTODO($id,'2.0',false,false); // keep UID the client set and no extra charset attributes
$options['mimetype'] = 'text/calendar; charset=utf-8';
header('Content-Encoding: identity');
@ -120,8 +117,7 @@ class infolog_groupdav extends groupdav_handler
{
return $ok;
}
include_once(EGW_INCLUDE_ROOT.'/infolog/inc/class.vcalinfolog.inc.php');
$handler = new vcalinfolog();
$handler = new infolog_ical();
if (!($info_id = $handler->importVTODO($options['content'],is_numeric($id) ? $id : -1)))
{
if ($this->debug) error_log(__METHOD__."(,$id) import_vtodo($options[content]) returned false");

View File

@ -0,0 +1,360 @@
<?php
/**
* InfoLog - Admin-, Preferences- and SideboxMenu-Hooks
*
* @link http://www.egroupware.org
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @package infolog
* @copyright (c) 2003-6 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
/**
* Class containing admin, preferences and sidebox-menus (used as hooks)
*/
class infolog_hooks
{
/**
* Hook called by link-class to include infolog in the appregistry of the linkage
*
* @param array/string $location location and other parameters (not used)
* @return array with method-names
*/
static function search_link($location)
{
return array(
'query' => 'infolog.infolog_bo.link_query',
'title' => 'infolog.infolog_bo.link_title',
'titles' => 'infolog.infolog_bo.link_titles',
'view' => array(
'menuaction' => 'infolog.infolog_ui.index',
'action' => 'sp'
),
'view_id' => 'action_id',
'add' => array(
'menuaction' => 'infolog.infolog_ui.edit',
'type' => 'task'
),
'add_app' => 'action',
'add_id' => 'action_id',
'add_popup' => '750x550',
'file_access'=> 'infolog.infolog_bo.file_access',
);
}
/**
* hooks to build sidebox-menu plus the admin and preferences sections
*
* @param string/array $args hook args
*/
static function all_hooks($args)
{
$appname = 'infolog';
$location = is_array($args) ? $args['location'] : $args;
//echo "<p>admin_prefs_sidebox_hooks::all_hooks(".print_r($args,True).") appname='$appname', location='$location'</p>\n";
if ($location == 'sidebox_menu')
{
$file = array(
'infolog list' => $GLOBALS['egw']->link('/index.php',array(
'menuaction' => 'infolog.infolog_ui.index' )),
array(
'text' => '<a class="textSidebox" href="'.htmlspecialchars($GLOBALS['egw']->link('/index.php',array(
'menuaction' => 'infolog.infolog_ui.edit',
))).'" target="_blank" onclick="window.open(this.href,this.target,\'dependent=yes,width=750,height=550,scrollbars=yes,status=yes\'); return false;">'.lang('Add').'</a>',
'no_lang' => true,
)
);
display_sidebox($appname,$GLOBALS['egw_info']['apps']['infolog']['title'].' '.lang('Menu'),$file);
}
if ($GLOBALS['egw_info']['user']['apps']['preferences'] && $location != 'admin')
{
$file = array(
'Preferences' => $GLOBALS['egw']->link('/index.php','menuaction=preferences.uisettings.index&appname='.$appname),
'Grant Access' => $GLOBALS['egw']->link('/index.php','menuaction=preferences.uiaclprefs.index&acl_app='.$appname),
'Edit Categories' => $GLOBALS['egw']->link('/index.php','menuaction=preferences.uicategories.index&cats_app=' . $appname . '&cats_level=True&global_cats=True')
);
if ($location == 'preferences')
{
display_section($appname,$file);
}
else
{
display_sidebox($appname,lang('Preferences'),$file);
}
}
if ($GLOBALS['egw_info']['user']['apps']['admin'] && $location != 'preferences')
{
$file = Array(
'Site configuration' => $GLOBALS['egw']->link('/index.php',array(
'menuaction' => 'infolog.infolog_ui.admin' )),
'Global Categories' => $GLOBALS['egw']->link('/index.php',array(
'menuaction' => 'admin.uicategories.index',
'appname' => $appname,
'global_cats'=> True)),
'Custom fields, typ and status' => $GLOBALS['egw']->link('/index.php',array(
'menuaction' => 'infolog_customfields.edit')),
'CSV-Import' => $GLOBALS['egw']->link('/infolog/csv_import.php')
);
if ($location == 'admin')
{
display_section($appname,$file);
}
else
{
display_sidebox($appname,lang('Admin'),$file);
}
}
}
/**
* populates $GLOBALS['settings'] for the preferences
*/
static function settings()
{
/* Setup some values to fill the array of this app's settings below */
$ui = new infolog_ui(); // need some labels from
$filters = $show_home = array();
$show_home[] = lang("DON'T show InfoLog");
foreach($ui->filters as $key => $label)
{
$show_home[$key] = $filters[$key] = lang($label);
}
// migrage old filter-pref 1,2 to the filter one 'own-open-today'
if (isset($GLOBALS['type']) && in_array($GLOBALS['egw']->preferences->{$GLOBALS['type']}['homeShowEvents'],array('1','2')))
{
$GLOBALS['egw']->preferences->add('infolog','homeShowEvents','own-open-today',$GLOBALS['type']);
$GLOBALS['egw']->preferences->save_repository();
}
$show_links = array(
'all' => lang('all links and attachments'),
'links' => lang('only the links'),
'attach' => lang('only the attachments'),
'none' => lang('no links or attachments'),
'no_describtion' => lang('no describtion, links or attachments'),
);
$show_details = array(
0 => lang('No'),
1 => lang('Yes'),
2 => lang('Only for details'),
);
/* Settings array for this app */
$GLOBALS['settings'] = array(
'defaultFilter' => array(
'type' => 'select',
'label' => 'Default Filter for InfoLog',
'name' => 'defaultFilter',
'values' => $filters,
'help' => 'This is the filter InfoLog uses when you enter the application. Filters limit the entries to show in the actual view. There are filters to show only finished, still open or futures entries of yourself or all users.',
'xmlrpc' => True,
'admin' => False
),
'homeShowEvents' => array(
'type' => 'select',
'label' => 'InfoLog filter for the main screen',
'name' => 'homeShowEvents',
'values' => $show_home,
'help' => 'Should InfoLog show up on the main screen and with which filter. Works only if you dont selected an application for the main screen (in your preferences).',
'xmlrpc' => True,
'admin' => False
),
'listNoSubs' => array(
'type' => 'check',
'label' => 'List no Subs/Childs',
'name' => 'listNoSubs',
'help' => 'Should InfoLog show Subtasks, -calls or -notes in the normal view or not. You can always view the Subs via there parent.',
'xmlrpc' => True,
'admin' => False
),
'show_links' => array(
'type' => 'select',
'label' => 'Show in the InfoLog list',
'name' => 'show_links',
'values' => $show_links,
'help' => 'Should InfoLog show the links to other applications and/or the file-attachments in the InfoLog list (normal view when you enter InfoLog).',
'xmlrpc' => True,
'admin' => False
),
'never_hide' => array(
'type' => 'check',
'label' => 'Never hide search and filters',
'name' => 'never_hide',
'help' => 'If not set, the line with search and filters is hidden for less entries then "max matches per page" (as defined in your common preferences).',
'xmlrpc' => True,
'admin' => False
),
'show_percent' => array(
'type' => 'select',
'label' => 'Show status and percent done separate',
'name' => 'show_percent',
'values' => $show_details,
'help' => 'Should the Infolog list show the percent done only for status ongoing or two separate icons.',
'xmlrpc' => True,
'admin' => False
),
'show_id' => array(
'type' => 'select',
'label' => 'Show ticket Id',
'name' => 'show_id',
'values' => $show_details,
'help' => 'Should the Infolog list show a unique numerical Id, which can be used eg. as ticket Id.',
'xmlrpc' => True,
'admin' => False
),
'set_start' => array(
'type' => 'select',
'label' => 'Startdate for new entries',
'name' => 'set_start',
'values' => array(
'date' => lang('todays date'),
'datetime' => lang('actual date and time'),
'empty' => lang('leave it empty'),
),
'help' => 'To what should the startdate of new entries be set.',
'xmlrpc' => True,
'admin' => False
),
'cal_show' => array(
'type' => 'multiselect',
'label' => 'Which types should the calendar show',
'name' => 'cal_show',
'values' => $ui->bo->enums['type'],
'help' => 'Can be used to show further InfoLog types in the calendar or limit it to show eg. only tasks.',
'xmlrpc' => True,
'admin' => False
),
'cat_add_default' => array(
'type' => 'select',
'label' => 'Default categorie for new Infolog entries',
'name' => 'cat_add_default',
'values' => self::all_cats(),
'help' => 'You can choose a categorie to be preselected, when you create a new Infolog entry',
'xmlrpc' => True,
'admin' => False
),
);
// notification preferences
$GLOBALS['settings']['notify_creator'] = array(
'type' => 'check',
'label' => 'Receive notifications about own items',
'name' => 'notify_creator',
'help' => 'Do you want a notification, if items you created get updated?',
'xmlrpc' => True,
'admin' => False,
);
$GLOBALS['settings']['notify_assigned'] = array(
'type' => 'select',
'label' => 'Receive notifications about items assigned to you',
'name' => 'notify_assigned',
'help' => 'Do you want a notification, if items get assigned to you or assigned items get updated?',
'values' => array(
'0' => lang('No'),
'1' => lang('Yes'),
'assignment' => lang('Only if I get assigned or removed'),
),
'xmlrpc' => True,
'admin' => False,
);
// to add options for more then 3 days back or in advance, you need to update soinfolog::users_with_open_entries()!
$options = array(
'0' => lang('No'),
'-1d' => lang('one day after'),
'0d' => lang('same day'),
'1d' => lang('one day in advance'),
'2d' => lang('%1 days in advance',2),
'3d' => lang('%1 days in advance',3),
);
$GLOBALS['settings']['notify_due_delegated'] = array(
'type' => 'select',
'label' => 'Receive notifications about due entries you delegated',
'name' => 'notify_due_delegated',
'help' => 'Do you want a notification, if items you delegated are due?',
'values' => $options,
'xmlrpc' => True,
'admin' => False,
);
$GLOBALS['settings']['notify_due_responsible'] = array(
'type' => 'select',
'label' => 'Receive notifications about due entries you are responsible for',
'name' => 'notify_due_responsible',
'help' => 'Do you want a notification, if items you are responsible for are due?',
'values' => $options,
'xmlrpc' => True,
'admin' => False,
);
$GLOBALS['settings']['notify_start_delegated'] = array(
'type' => 'select',
'label' => 'Receive notifications about starting entries you delegated',
'name' => 'notify_start_delegated',
'help' => 'Do you want a notification, if items you delegated are about to start?',
'values' => $options,
'xmlrpc' => True,
'admin' => False,
);
$GLOBALS['settings']['notify_start_responsible'] = array(
'type' => 'select',
'label' => 'Receive notifications about starting entries you are responsible for',
'name' => 'notify_start_responsible',
'help' => 'Do you want a notification, if items you are responsible for are about to start?',
'values' => $options,
'xmlrpc' => True,
'admin' => False,
);
return true; // otherwise prefs say it cant find the file ;-)
}
/**
* Return InoLog Categories (used for setting )
*
* @return array
*/
private static function all_cats()
{
$categories = new categories('','infolog');
foreach((array)$categories->return_sorted_array(0,False,'','','',true) as $cat)
{
$s = str_repeat('&nbsp;',$cat['level']) . stripslashes($cat['name']);
if ($cat['app_name'] == 'phpgw' || $cat['owner'] == '-1')
{
$s .= ' &#9830;';
}
$sel_options[$cat['id']] = $s; // 0.9.14 only
}
return $sel_options;
}
/**
* Verification hook called if settings / preferences get stored
*
* Installs a task to send async infolog notifications at 2h everyday
*
* @param array $data
*/
static function verify_settings($data)
{
if ($data['prefs']['notify_due_delegated'] || $data['prefs']['notify_due_responsible'] ||
$data['prefs']['notify_start_delegated'] || $data['prefs']['notify_start_responsible'])
{
require_once(EGW_API_INC.'/class.asyncservice.inc.php');
$async =& new asyncservice();
//$async->cancel_timer('infolog-async-notification');
if (!$async->read('infolog-async-notification'))
{
$async->set_timer(array('hour' => 2),'infolog-async-notification','infolog.infolog_bo.async_notification',null);
}
}
}
}

View File

@ -1,31 +0,0 @@
<?php
/**
* InfoLog - Link-registry
*
* @link http://www.egroupware.org
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @package infolog
* @copyright (c) 2003-6 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
include_once(EGW_INCLUDE_ROOT.'/infolog/inc/class.boinfolog.inc.php');
/**
* This class returns the link-registry for infolog
*
* To prevent an invinit recursion, it has to be outside the boinfolog class,
* which itself instanciats the link class by default.
*
* @todo delete after next infolog update
*/
class infolog_link_registry
{
function search_link($location)
{
$bo =& new boinfolog(0,false); // false = dont instanciate the link class
return $bo->search_link($location);
}
}

View File

@ -1,103 +0,0 @@
<?php
/**
* InfoLog - Admin-, Preferences- and SideboxMenu-Hooks
*
* @link http://www.egroupware.org
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @package infolog
* @copyright (c) 2003-6 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
/**
* Class containing admin, preferences and sidebox-menus (used as hooks)
*/
class infolog_prefs_sidebox_hooks
{
function all_hooks($args)
{
$appname = 'infolog';
$location = is_array($args) ? $args['location'] : $args;
//echo "<p>admin_prefs_sidebox_hooks::all_hooks(".print_r($args,True).") appname='$appname', location='$location'</p>\n";
if ($location == 'sidebox_menu')
{
$file = array(
'infolog list' => $GLOBALS['egw']->link('/index.php',array(
'menuaction' => 'infolog.uiinfolog.index' )),
array(
'text' => '<a class="textSidebox" href="'.htmlspecialchars($GLOBALS['egw']->link('/index.php',array(
'menuaction' => 'infolog.uiinfolog.edit',
))).'" target="_blank" onclick="window.open(this.href,this.target,\'dependent=yes,width=750,height=550,scrollbars=yes,status=yes\'); return false;">'.lang('Add').'</a>',
'no_lang' => true,
)
);
display_sidebox($appname,$GLOBALS['egw_info']['apps']['infolog']['title'].' '.lang('Menu'),$file);
}
if ($GLOBALS['egw_info']['user']['apps']['preferences'] && $location != 'admin')
{
$file = array(
'Preferences' => $GLOBALS['egw']->link('/index.php','menuaction=preferences.uisettings.index&appname='.$appname),
'Grant Access' => $GLOBALS['egw']->link('/index.php','menuaction=preferences.uiaclprefs.index&acl_app='.$appname),
'Edit Categories' => $GLOBALS['egw']->link('/index.php','menuaction=preferences.uicategories.index&cats_app=' . $appname . '&cats_level=True&global_cats=True')
);
if ($location == 'preferences')
{
display_section($appname,$file);
}
else
{
display_sidebox($appname,lang('Preferences'),$file);
}
}
if ($GLOBALS['egw_info']['user']['apps']['admin'] && $location != 'preferences')
{
$file = Array(
'Site configuration' => $GLOBALS['egw']->link('/index.php',array(
'menuaction' => 'infolog.uiinfolog.admin' )),
'Global Categories' => $GLOBALS['egw']->link('/index.php',array(
'menuaction' => 'admin.uicategories.index',
'appname' => $appname,
'global_cats'=> True)),
'Custom fields, typ and status' => $GLOBALS['egw']->link('/index.php',array(
'menuaction' => 'infolog.uicustomfields.edit')),
'CSV-Import' => $GLOBALS['egw']->link('/infolog/csv_import.php')
);
if ($location == 'admin')
{
display_section($appname,$file);
}
else
{
display_sidebox($appname,lang('Admin'),$file);
}
}
}
/**
* Verification hook called if settings / preferences get stored
*
* Installs a task to send async infolog notifications at 2h everyday
*
* @param array $data
*/
function verify_settings($data)
{
if ($data['prefs']['notify_due_delegated'] || $data['prefs']['notify_due_responsible'] ||
$data['prefs']['notify_start_delegated'] || $data['prefs']['notify_start_responsible'])
{
require_once(EGW_API_INC.'/class.asyncservice.inc.php');
$async =& new asyncservice();
//$async->cancel_timer('infolog-async-notification');
if (!$async->read('infolog-async-notification'))
{
$async->set_timer(array('hour' => 2),'infolog-async-notification','infolog.boinfolog.async_notification',null);
}
}
}
}

View File

@ -0,0 +1,549 @@
<?php
/**
* InfoLog - SIF Parser
*
* @link http://www.egroupware.org
* @author Lars Kneschke <lkneschke@egroupware.org>
* @package infolog
* @subpackage syncml
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
require_once EGW_API_INC.'/horde/Horde/iCalendar.php';
/**
* InfoLog: Create and parse SIF
*
*/
class infolog_sif extends infolog_bo
{
// array containing the result of the xml parser
var $_extractedSIFData;
// array containing the current mappings(task or note)
var $_currentSIFMapping;
var $_sifNoteMapping = array(
'Body' => 'info_des',
'Categories' => 'info_cat',
'Color' => '',
'Date' => 'info_startdate',
'Height' => '',
'Left' => '',
'Subject' => 'info_subject',
'Top' => '',
'Width' => '',
);
// mappings for SIFTask to InfologTask
var $_sifTaskMapping = array(
'ActualWork' => '',
'BillingInformation' => '',
'Body' => 'info_des',
'Categories' => 'info_cat',
'Companies' => '',
'Complete' => '',
'DateCompleted' => 'info_datecompleted',
'DueDate' => 'info_enddate',
'Importance' => 'info_priority',
'IsRecurring' => '',
'Mileage' => '',
'PercentComplete' => 'info_percent',
'ReminderSet' => '',
'ReminderTime' => '',
'Sensitivity' => 'info_access',
'StartDate' => 'info_startdate',
'Status' => 'info_status',
'Subject' => 'info_subject',
'TeamTask' => '',
'TotalWork' => '',
'RecurrenceType' => '',
'Interval' => '',
'MonthOfYear' => '',
'DayOfMonth' => '',
'DayOfWeekMask' => '',
'Instance' => '',
'PatternStartDate' => '',
'NoEndDate' => '',
'PatternEndDate' => '',
'Occurrences' => '',
);
function startElement($_parser, $_tag, $_attributes) {
}
function endElement($_parser, $_tag) {
error_log("infolog: tag=$_tag data=".trim($this->sifData));
if(!empty($this->_currentSIFMapping[$_tag])) {
$this->_extractedSIFData[$this->_currentSIFMapping[$_tag]] = trim($this->sifData);
}
unset($this->sifData);
}
function characterData($_parser, $_data) {
$this->sifData .= $_data;
}
function siftoegw($_sifData, $_sifType) {
$sysCharSet = $GLOBALS['egw']->translation->charset();
$sifData = base64_decode($_sifData);
#$tmpfname = tempnam('/tmp/sync/contents','sift_');
#$handle = fopen($tmpfname, "w");
#fwrite($handle, $sifData);
#fclose($handle);
switch ($_sifType)
{
case 'note':
$this->_currentSIFMapping = $this->_sifNoteMapping;
break;
case 'task':
default:
$this->_currentSIFMapping = $this->_sifTaskMapping;
break;
}
$this->xml_parser = xml_parser_create('UTF-8');
xml_set_object($this->xml_parser, $this);
xml_parser_set_option($this->xml_parser, XML_OPTION_CASE_FOLDING, false);
xml_set_element_handler($this->xml_parser, "startElement", "endElement");
xml_set_character_data_handler($this->xml_parser, "characterData");
$this->strXmlData = xml_parse($this->xml_parser, $sifData);
if(!$this->strXmlData) {
error_log(sprintf("XML error: %s at line %d",
xml_error_string(xml_get_error_code($this->xml_parser)),
xml_get_current_line_number($this->xml_parser)));
return false;
}
if(!array($this->_extractedSIFData)) {
return false;
}
switch($_sifType) {
case 'task':
$taskData = array();
$vcal = &new Horde_iCalendar;
$taskData['info_type'] = 'task';
foreach($this->_extractedSIFData as $key => $value) {
$value = $GLOBALS['egw']->translation->convert($value, 'utf-8', $sysCharSet);
error_log("infolog key=$key => value=$value");
switch($key) {
case 'info_access':
$taskData[$key] = ((int)$value > 0) ? 'private' : 'public';
break;
case 'info_datecompleted':
case 'info_enddate':
case 'info_startdate':
if(!empty($value)) {
$taskData[$key] = $vcal->_parseDateTime($value);
// somehow the client always deliver a timestamp about 3538 seconds, when no startdate set.
if($taskData[$key] < 10000)
$taskData[$key] = '';
} else {
$taskData[$key] = '';
}
break;
case 'info_cat':
if (!empty($value)) {
$categories = $this->find_or_add_categories(explode(';', $value));
$taskData['info_cat'] = $categories[0];
}
break;
case 'info_priority':
$taskData[$key] = (int)$value;
break;
case 'info_status':
$taskData[$key] = ((int)$value == 2) ? 'done' : 'ongoing';
switch($value) {
case '0':
$taskData[$key] = 'not-started';
break;
case '1':
$taskData[$key] = 'ongoing';
break;
case '2':
$taskData[$key] = 'done';
break;
case '4':
$taskData[$key] = 'cancelled';
break;
default:
$taskData[$key] = 'ongoing';
break;
}
break;
default:
$taskData[$key] = $value;
break;
}
error_log("infolog task key=$key => value=".$taskData[$key]);
}
return $taskData;
break;
case 'note':
$noteData = array();
$noteData['info_type'] = 'note';
$vcal = &new Horde_iCalendar;
foreach($this->_extractedSIFData as $key => $value)
{
$value = $GLOBALS['egw']->translation->convert($value, 'utf-8', $sysCharSet);
error_log("infolog client key=$key => value=".$value);
switch ($key)
{
case 'info_startdate':
if(!empty($value)) {
$noteData[$key] = $vcal->_parseDateTime($value);
// somehow the client always deliver a timestamp about 3538 seconds, when no startdate set.
if($noteData[$key] < 10000)
$noteData[$key] = '';
} else {
$noteData[$key] = '';
}
break;
case 'info_cat':
if (!empty($value)) {
$categories = $this->find_or_add_categories(explode(';', $value));
$taskData['info_cat'] = $categories[0];
}
break;
default:
$noteData[$key] = $value;
break;
}
error_log("infolog note key=$key => value=".$noteData[$key]);
}
return $noteData;
break;
default:
return false;
}
}
function searchSIF($_sifData, $_sifType) {
if(!$egwData = $this->siftoegw($_sifData, $_sifType)) {
return false;
}
$filter = array('col_filter' => $egwData);
if($foundItems = $this->search($filter)) {
if(count($foundItems) > 0) {
$itemIDs = array_keys($foundItems);
return $itemIDs[0];
}
}
return false;
}
function addSIF($_sifData, $_id, $_sifType) {
if(!$egwData = $this->siftoegw($_sifData, $_sifType)) {
return false;
}
if($_id > 0)
$egwData['info_id'] = $_id;
$egwID = $this->write($egwData, false);
return $egwID;
}
function getSIF($_id, $_sifType) {
switch($_sifType) {
case 'task':
if($taskData = $this->read($_id)) {
$sysCharSet = $GLOBALS['egw']->translation->charset();
$vcal = &new Horde_iCalendar;
$sifTask = '<task>';
foreach($this->_sifTaskMapping as $sifField => $egwField)
{
if(empty($egwField)) continue;
$value = $GLOBALS['egw']->translation->convert($taskData[$egwField], $sysCharSet, 'utf-8');
switch($sifField) {
case 'DateCompleted':
case 'DueDate':
case 'StartDate':
if(!empty($value)) {
$value = $vcal->_exportDateTime($value);
}
$sifTask .= "<$sifField>$value</$sifField>";
break;
case 'Importance':
if($value > 3) $value = 3;
$sifTask .= "<$sifField>$value</$sifField>";
break;
case 'Sensitivity':
$value = ($value == 'private' ? '2' : '0');
$sifTask .= "<$sifField>$value</$sifField>";
break;
case 'Status':
switch($value) {
case 'cancelled':
$value = '4';
break;
case 'done':
$value = '2';
break;
case 'not-started':
$value = '0';
break;
case 'ongoing':
$value = '1';
break;
default:
$value = 1;
break;
}
$sifTask .= "<$sifField>$value</$sifField>";
break;
case 'Categories':
if (!empty($value))
{
$value = implode('; ', $this->get_categories(array($value)));
$value = $GLOBALS['egw']->translation->convert($value, $sysCharSet, 'utf-8');
}
$sifTask .= "<$sifField>$value</$sifField>";
break;
default:
$sifTask .= "<$sifField>$value</$sifField>";
break;
}
}
$sifTask .= '<ActualWork>0</ActualWork><IsRecurring>0</IsRecurring>';
return base64_encode($sifTask);
/* return base64_encode("<task>
<ActualWork>0</ActualWork>
<BillingInformation></BillingInformation>
<Body></Body>
<Categories></Categories>
<Companies></Companies>
<Complete>0</Complete>
<DateCompleted></DateCompleted>
<DueDate></DueDate>
<Importance>1</Importance>
<IsRecurring>0</IsRecurring>
<Mileage></Mileage>
<PercentComplete>0</PercentComplete>
<ReminderSet>0</ReminderSet>
<ReminderTime></ReminderTime>
<Sensitivity>0</Sensitivity>
<StartDate>45001231T230000Z</StartDate>
<Status>3</Status>
<Subject>TARAAA3</Subject>
<TeamTask>0</TeamTask>
<TotalWork>0</TotalWork>
<RecurrenceType>1</RecurrenceType>
<Interval>1</Interval>
<MonthOfYear>0</MonthOfYear>
<DayOfMonth>0</DayOfMonth>
<DayOfWeekMask>4</DayOfWeekMask>
<Instance>0</Instance>
<PatternStartDate>20060320T230000Z</PatternStartDate>
<NoEndDate>1</NoEndDate>
<PatternEndDate></PatternEndDate>
<Occurrences>10</Occurrences>
</task>
"); */
}
break;
case 'note':
if($taskData = $this->read($_id)) {
$sysCharSet = $GLOBALS['egw']->translation->charset();
$vcal = &new Horde_iCalendar;
$sifNote = '<note>';
foreach($this->_sifNoteMapping as $sifField => $egwField)
{
if(empty($egwField)) continue;
$value = $GLOBALS['egw']->translation->convert($taskData[$egwField], $sysCharSet, 'utf-8');
switch($sifField) {
case 'Date':
if(!empty($value)) {
$value = $vcal->_exportDateTime($value);
}
$sifNote .= "<$sifField>$value</$sifField>";
break;
case 'Body':
$value = $GLOBALS['egw']->translation->convert($taskData['info_subject'], $sysCharSet, 'utf-8') . "\n" . $value;
$sifNote .= "<$sifField>$value</$sifField>";
break;
case 'Categories':
if (!empty($value))
{
$value = implode('; ', $this->get_categories(array($value)));
$value = $GLOBALS['egw']->translation->convert($value, $sysCharSet, 'utf-8');
}
$sifNote .= "<$sifField>$value</$sifField>";
break;
default:
$sifNote .= "<$sifField>$value</$sifField>";
break;
}
}
return base64_encode($sifNote);
}
break;
default;
return false;
}
}
function exportVTODO($_taskID, $_version)
{
$taskData = $this->read($_taskID);
$taskData = $GLOBALS['egw']->translation->convert($taskData,$GLOBALS['egw']->translation->charset(),'UTF-8');
//_debug_array($taskData);
$taskGUID = $GLOBALS['phpgw']->common->generate_uid('infolog_task',$_taskID);
$vcal = &new Horde_iCalendar;
$vcal->setAttribute('VERSION',$_version);
$vcal->setAttribute('METHOD','PUBLISH');
$vevent = Horde_iCalendar::newComponent('VTODO',$vcal);
$options = array();
$vevent->setAttribute('SUMMARY',$taskData['info_subject']);
$vevent->setAttribute('DESCRIPTION',$taskData['info_des']);
if($taskData['info_startdate'])
$vevent->setAttribute('DTSTART',$taskData['info_startdate']);
if($taskData['info_enddate'])
$vevent->setAttribute('DUE',$taskData['info_enddate']);
$vevent->setAttribute('DTSTAMP',time());
$vevent->setAttribute('CREATED',$GLOBALS['phpgw']->contenthistory->getTSforAction($eventGUID,'add'));
$vevent->setAttribute('LAST-MODIFIED',$GLOBALS['phpgw']->contenthistory->getTSforAction($eventGUID,'modify'));
$vevent->setAttribute('UID',$taskGUID);
$vevent->setAttribute('CLASS',(($taskData['info_access'] == 'public')?'PUBLIC':'PRIVATE'));
$vevent->setAttribute('STATUS',(($taskData['info_status'] == 'completed')?'COMPLETED':'NEEDS-ACTION'));
// 3=urgent => 1, 2=high => 2, 1=normal => 3, 0=low => 4
$vevent->setAttribute('PRIORITY',4-$taskData['info_priority']);
#$vevent->setAttribute('TRANSP','OPAQUE');
# status
# ATTENDEE
$options = array('CHARSET' => 'UTF-8','ENCODING' => 'QUOTED-PRINTABLE');
$vevent->setParameter('SUMMARY', $options);
$vevent->setParameter('DESCRIPTION', $options);
$vcal->addComponent($vevent);
#print "<pre>";
#print $vcal->exportvCalendar();
#print "</pre>";
return $vcal->exportvCalendar();
}
function importVTODO(&$_vcalData, $_taskID=-1)
{
$botranslation = CreateObject('phpgwapi.translation');
$vcal = &new Horde_iCalendar;
if(!$vcal->parsevCalendar($_vcalData))
{
return FALSE;
}
$components = $vcal->getComponents();
if(count($components) > 0)
{
$component = $components[0];
if(is_a($component, 'Horde_iCalendar_vtodo'))
{
if($_taskID>0)
$taskData['info_id'] = $_taskID;
foreach($component->_attributes as $attributes)
{
#print $attributes['name'].' - '.$attributes['value'].'<br>';
#$attributes['value'] = $GLOBALS['egw']->translation->convert($attributes['value'],'UTF-8');
switch($attributes['name'])
{
case 'CLASS':
$taskData['info_access'] = strtolower($attributes['value']);
break;
case 'DESCRIPTION':
$taskData['info_des'] = $attributes['value'];
break;
case 'DUE':
$taskData['info_enddate'] = $attributes['value'];
break;
case 'DTSTART':
$taskData['info_startdate'] = $attributes['value'];
break;
case 'PRIORITY':
// 1 => 3=urgent, 2 => 2=high, 3 => 1=normal, 4 => 0=low
if (1 <= $attributes['value'] && $attributes['value'] <= 4)
{
$taskData['info_priority'] = 4 - $attributes['value'];
}
else
{
$taskData['info_priority'] = 1; // default = normal
}
break;
case 'STATUS':
$taskData['info_status'] = (strtolower($attributes['value']) == 'completed') ? 'done' : 'ongoing';
break;
case 'SUMMARY':
$taskData['info_subject'] = $attributes['value'];
break;
}
}
#_debug_array($eventData);exit;
return $this->write($taskData);
}
}
return FALSE;
}
}

View File

@ -21,7 +21,7 @@
* @copyright (c) by Ralf Becker <RalfBecker@outdoor-training.de>
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
*/
class soinfolog // DB-Layer
class infolog_so // DB-Layer
{
/**
* Instance of the db class
@ -72,7 +72,7 @@ class soinfolog // DB-Layer
* @param array $grants
* @return soinfolog
*/
function soinfolog( &$grants )
function __construct( &$grants )
{
$this->db = clone($GLOBALS['egw']->db);
$this->db->set_app('infolog');

View File

@ -7,11 +7,9 @@
* @package tracker
* @copyright (c) 2007 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
* @version $Id$
*/
require_once(EGW_INCLUDE_ROOT.'/etemplate/inc/class.bo_tracking.inc.php');
/**
* Tracker - tracking object for the tracker
*/
@ -106,12 +104,11 @@ class infolog_tracking extends bo_tracking
);
/**
* Instance of the boinfolog class calling us
*
* @access private
* @var boinfolog
* Instance of the infolog_bo class calling us
*
* @var infolog_bo
*/
var $infolog;
private $infolog;
/**
* Constructor
@ -119,13 +116,13 @@ class infolog_tracking extends bo_tracking
* @param botracker $botracker
* @return tracker_tracking
*/
function infolog_tracking(&$boinfolog)
function __construct(&$infolog_bo)
{
$this->bo_tracking(); // calling the constructor of the extended class
$this->infolog =& $boinfolog;
parent::__construct(); // calling the constructor of the extended class
$this->infolog =& $infolog_bo;
}
/**
* Get a notification-config value
*
@ -141,10 +138,10 @@ class infolog_tracking extends bo_tracking
{
return null;
}
/**
* Get the subject for a given entry
*
*
* Reimpleneted to use a New|deleted|modified prefix.
*
* @param array $data
@ -170,7 +167,7 @@ class infolog_tracking extends bo_tracking
/**
* Get the modified / new message (1. line of mail body) for a given entry, can be reimplemented
*
*
* @param array $data
* @param array $old
* @return string
@ -194,10 +191,10 @@ class infolog_tracking extends bo_tracking
$GLOBALS['egw']->common->grab_owner_name($data['info_modifier']),
$this->datetime($data['info_datemodified']-$this->infolog->tz_offset_s));
}
/**
* Get the details of an entry
*
*
* @param array $data
* @param string $datetime_format of user to notify, eg. 'Y-m-d H:i'
* @param int $tz_offset_s offset in sec to be add to server-time to get the user-time of the user to notify
@ -250,7 +247,7 @@ class infolog_tracking extends bo_tracking
foreach($this->infolog->customfields as $name => $field)
{
if ($field['type2'] && !in_array($data['info_type'],explode(',',$field['type2']))) continue; // different type
if (!$header_done)
{
$details['custom'] = array(
@ -267,12 +264,12 @@ class infolog_tracking extends bo_tracking
}
return $details;
}
/**
* Save changes to the history log
*
* Reimplemented to store all customfields in a single field, as the history-log has only 2-char field-ids
*
*
* @param array $data current entry
* @param array $old=null old/last state of the entry or null for a new entry
* @param int number of log-entries made
@ -287,7 +284,7 @@ class infolog_tracking extends bo_tracking
}
$data['custom'] = implode("\n",$data_custom);
$old['custom'] = implode("\n",$old_custom);
return parent::save_history($data,$old);
}
}

View File

@ -10,15 +10,12 @@
* @version $Id$
*/
include_once(EGW_INCLUDE_ROOT.'/infolog/inc/class.boinfolog.inc.php');
/**
* This class is the UI-layer (user interface) of InfoLog
*/
class uiinfolog
class infolog_ui
{
var $public_functions = array
(
var $public_functions = array(
'index' => True,
'edit' => True,
'delete' => True,
@ -107,11 +104,11 @@ class uiinfolog
/**
* Constructor
*
* @return uiinfolog
* @return infolog_ui
*/
function uiinfolog()
function __construct()
{
$this->bo =& new boinfolog();
$this->bo =& new infolog_bo();
$this->tmpl = new etemplate();
@ -144,7 +141,7 @@ class uiinfolog
$this->filters['responsible-open-date'.date('Y-m-d',time()+$i*24*60*60)] = "responsible starting in $i day(s)";
}
*/
$GLOBALS['uiinfolog'] =& $this; // make ourself availible for ExecMethod of get_rows function
$GLOBALS['infolog_ui'] =& $this; // make ourself availible for ExecMethod of get_rows function
}
/**
@ -252,7 +249,7 @@ class uiinfolog
function save_sessiondata($values)
{
$for = @$values['session_for'] ? $values['session_for'] : @$this->called_by;
//echo "<p>$for: uiinfolog::save_sessiondata(".print_r($values,True).") called_by='$this->called_by', for='$for'<br />".function_backtrace()."</p>\n";
//echo "<p>$for: ".__METHOD__.'('.print_r($values,True).") called_by='$this->called_by', for='$for'<br />".function_backtrace()."</p>\n";
$GLOBALS['egw']->session->appsession($for.'session_data','infolog',array(
'search' => $values['search'],
'start' => $values['start'],
@ -283,7 +280,7 @@ class uiinfolog
$values['session_for'] = $this->called_by;
$this->save_sessiondata($values);
}
//echo "<p>called_by='$this->called_by': uiinfolog::read_sessiondata() = ".print_r($values,True)."</p>\n";
//echo "<p>called_by='$this->called_by': ".__METHOD__."() = ".print_r($values,True)."</p>\n";
return $values;
}
@ -297,7 +294,7 @@ class uiinfolog
*/
function get_rows(&$query,&$rows,&$readonlys)
{
//echo "<p>uiinfolog.get_rows(start=$query[start],search='$query[search]',filter='$query[filter]',cat_id=$query[cat_id],action='$query[action]/$query[action_id]',col_filter=".print_r($query['col_filter'],True).")</p>\n";
//echo "<p>infolog_ui.get_rows(start=$query[start],search='$query[search]',filter='$query[filter]',cat_id=$query[cat_id],action='$query[action]/$query[action_id]',col_filter=".print_r($query['col_filter'],True).")</p>\n";
if (!isset($query['start'])) $query['start'] = 0;
if (!$query['csv_export'])
@ -454,7 +451,7 @@ class uiinfolog
elseif ($own_referer === '')
{
$own_referer = $GLOBALS['egw']->common->get_referer();
if (strpos($own_referer,'menuaction=infolog.uiinfolog.edit') !== false)
if (strpos($own_referer,'menuaction=infolog.infolog_ui.edit') !== false)
{
$own_referer = $GLOBALS['egw']->session->appsession('own_session','infolog');
}
@ -487,7 +484,7 @@ class uiinfolog
unset($session);
}
}
//echo "<p align=right>uiinfolog::index(action='$action/$action_id',called_as='$called_as/$values[referer]',own_referer='$own_referer') values=\n"; _debug_array($values);
//echo "<p align=right>infolog_ui::index(action='$action/$action_id',called_as='$called_as/$values[referer]',own_referer='$own_referer') values=\n"; _debug_array($values);
if (!is_array($values))
{
$values = array('nm' => $this->read_sessiondata());
@ -586,7 +583,7 @@ class uiinfolog
$this->tmpl->read('infolog.index');
$values['nm']['options-filter'] = $this->filters;
$values['nm']['get_rows'] = 'infolog.uiinfolog.get_rows';
$values['nm']['get_rows'] = 'infolog.infolog_ui.get_rows';
$values['nm']['options-filter2'] = (in_array($this->prefs['show_links'],array('all','no_describtion')) ? array() : array(
'' => 'default',
)) + array(
@ -634,7 +631,7 @@ class uiinfolog
{
$values['css'] = '<style type="text/css">@import url('.$GLOBALS['egw_info']['server']['webserver_url'].'/infolog/templates/default/app.css);'."</style>";
}
return $this->tmpl->exec('infolog.uiinfolog.index',$values,array(
return $this->tmpl->exec('infolog.infolog_ui.index',$values,array(
'info_type' => $this->bo->enums['type'],
),$readonlys,$persist,$return_html ? -1 : 0);
}
@ -675,7 +672,7 @@ class uiinfolog
{
$values = array('delete' => true);
}
//echo "<p>uiinfolog::delete(".print_r($values,true).",'$referer','$called_by') info_id=$info_id</p>\n";
//echo "<p>infolog_ui::delete(".print_r($values,true).",'$referer','$called_by') info_id=$info_id</p>\n";
if (is_array($values) || $info_id <= 0)
{
@ -707,7 +704,7 @@ class uiinfolog
'action' => 'sp',
'action_id' => $info_id,
'options-filter' => $this->filters,
'get_rows' => 'infolog.uiinfolog.get_rows',
'get_rows' => 'infolog.infolog_ui.get_rows',
'no_filter2' => True,
'never_hide' => isset($this->prefs['never_hide']) ?
$this->prefs['never_hide'] :
@ -723,7 +720,7 @@ class uiinfolog
$GLOBALS['egw_info']['flags']['app_header'] = lang('InfoLog').' - '.lang('Delete');
$GLOBALS['egw_info']['flags']['params']['manual'] = array('page' => 'ManualInfologDelete');
$this->tmpl->exec('infolog.uiinfolog.delete',$values,'',$readonlys,$persist,$called_by == 'edit' ? 2 : 0);
$this->tmpl->exec('infolog.infolog_ui.delete',$values,'',$readonlys,$persist,$called_by == 'edit' ? 2 : 0);
}
/**
@ -741,7 +738,7 @@ class uiinfolog
if (is_array($content))
{
//echo "uiinfolog::edit: content="; _debug_array($content);
//echo "infolog_ui::edit: content="; _debug_array($content);
$info_id = $content['info_id'];
$action = $content['action']; unset($content['action']);
$action_id = $content['action_id']; unset($content['action_id']);
@ -756,7 +753,7 @@ class uiinfolog
unset($content['button']);
if ($button)
{
//echo "<p>uiinfolog::edit(info_id=$info_id) '$button' button pressed, content="; _debug_array($content);
//echo "<p>infolog_ui::edit(info_id=$info_id) '$button' button pressed, content="; _debug_array($content);
if (($button == 'save' || $button == 'apply') && isset($content['info_subject']) && empty($content['info_subject']))
{
$this->tmpl->set_validation_error('info_subject',lang('Field must not be empty !!!'));
@ -791,7 +788,7 @@ class uiinfolog
lang('Error: the entry has been updated since you opened it for editing!').'<br />'.
lang('Copy your changes to the clipboard, %1reload the entry%2 and merge them.','<a href="'.
htmlspecialchars($GLOBALS['egw']->link('/index.php',array(
'menuaction' => 'infolog.uiinfolog.edit',
'menuaction' => 'infolog.infolog_ui.edit',
'info_id' => $content['info_id'],
'no_popup' => $no_popup,
'referer' => $referer,
@ -861,7 +858,7 @@ class uiinfolog
elseif ($button == 'delete' && $info_id > 0)
{
if (!$referer && $action) $referer = array(
'menuaction' => 'infolog.uiinfolog.index',
'menuaction' => 'infolog.infolog_ui.index',
'action' => $action,
'action_id' => $action_id
);
@ -895,16 +892,16 @@ class uiinfolog
}
else
{
//echo "<p>uiinfolog::edit: info_id=$info_id, action='$action', action_id='$action_id', type='$type', referer='$referer'</p>\n";
//echo "<p>infolog_ui::edit: info_id=$info_id, action='$action', action_id='$action_id', type='$type', referer='$referer'</p>\n";
$action = $action ? $action : get_var('action', array('POST','GET'));
$action_id = $action_id ? $action_id : get_var('action_id',array('POST','GET'));
$info_id = $content ? $content : get_var('info_id', array('POST','GET'));
$type = $type ? $type : get_var('type', array('POST','GET'));
$ref=$referer = $referer !== '' ? $referer : ($_GET['referer'] ? $_GET['referer'] :
$GLOBALS['egw']->common->get_referer('/index.php?menuaction=infolog.uiinfolog.index'));
$GLOBALS['egw']->common->get_referer('/index.php?menuaction=infolog.infolog_ui.index'));
$referer = preg_replace('/([&?]{1})msg=[^&]+&?/','\\1',$referer); // remove previou/old msg from referer
$no_popup = $_GET['no_popup'];
//echo "<p>uiinfolog::edit: info_id=$info_id, action='$action', action_id='$action_id', type='$type', referer='$referer'</p>\n";
//echo "<p>infolog_ui::edit: info_id=$info_id, action='$action', action_id='$action_id', type='$type', referer='$referer'</p>\n";
$content = $this->bo->read( $info_id || $action != 'sp' ? $info_id : $action_id );
if (is_numeric($_REQUEST['cat_id']))
@ -1174,8 +1171,8 @@ class uiinfolog
$GLOBALS['egw_info']['flags']['app_header'] = lang('InfoLog').' - '.
($content['status_only'] ? lang('Edit Status') : lang('Edit'));
$GLOBALS['egw_info']['flags']['params']['manual'] = array('page' => ($info_id ? 'ManualInfologEdit' : 'ManualInfologAdd'));
//echo "<p>uiinfolog.edit(info_id='$info_id',action='$action',action_id='$action_id') readonlys="; print_r($readonlys); echo ", content = "; _debug_array($content);
$this->tmpl->exec('infolog.uiinfolog.edit',$content,array(
//echo "<p>infolog_ui.edit(info_id='$info_id',action='$action',action_id='$action_id') readonlys="; print_r($readonlys); echo ", content = "; _debug_array($content);
$this->tmpl->exec('infolog.infolog_ui.edit',$content,array(
'info_type' => $types,
'info_priority' => $this->bo->enums['priority'],
'info_confirm' => $this->bo->enums['confirm'],
@ -1465,7 +1462,7 @@ class uiinfolog
}
if (!is_array($args) || $args['debug'])
{
echo "<p>uiinfolog::hook_view("; print_r($args); echo "): app='$app', $view_id='$args[$view_id]', view='$view'</p>\n";
echo "<p>infolog_ui::hook_view("; print_r($args); echo "): app='$app', $view_id='$args[$view_id]', view='$view'</p>\n";
}
if (!isset($app) || !isset($args[$view_id]))
{

View File

@ -10,10 +10,13 @@
* @version $Id$
*/
require_once EGW_SERVER_ROOT.'/infolog/inc/class.boinfolog.inc.php';
require_once EGW_SERVER_ROOT.'/phpgwapi/inc/horde/Horde/iCalendar.php';
require_once EGW_API_INC.'/horde/Horde/iCalendar.php';
class vcalinfolog extends boinfolog
/**
* InfoLog: Create and parse iCal's
*
*/
class infolog_ical extends infolog_bo
{
var $egw_priority2vcal_priority = array(
0 => 3,

View File

@ -10,13 +10,11 @@
* @version $Id$
*/
require_once(EGW_INCLUDE_ROOT.'/infolog/inc/class.boinfolog.inc.php');
/**
* eTemplate Extension: InfoLog widget
*
* This widget can be used to display data from an InfoLog specified by it's id
*
*
* The infolog-value widget takes 3 comma-separated arguments (beside the name) in the options/size field:
* 1) name of the field (as provided by the infolog-fields widget)
* 2) an optional compare value: if given the selected field is compared with its value and an X is printed on equality, nothing otherwise
@ -25,9 +23,9 @@ require_once(EGW_INCLUDE_ROOT.'/infolog/inc/class.boinfolog.inc.php');
*/
class infolog_widget
{
/**
/**
* exported methods of this class
*
*
* @var array $public_functions
*/
var $public_functions = array(
@ -44,7 +42,7 @@ class infolog_widget
);
/**
* Instance of the boinfolog class
*
*
* @var boinfolog
*/
var $infolog;
@ -53,7 +51,7 @@ class infolog_widget
*
* @var array
*/
/**
* Constructor of the extension
*
@ -62,7 +60,7 @@ class infolog_widget
function infolog_widget($ui)
{
$this->ui = $ui;
$this->infolog =& new boinfolog();
$this->infolog =& new infolog_bo();
}
/**
@ -72,7 +70,7 @@ class infolog_widget
*
* @param string $name form-name of the control
* @param mixed &$value value / existing content, can be modified
* @param array &$cell array with the widget, can be modified for ui-independent widgets
* @param array &$cell array with the widget, can be modified for ui-independent widgets
* @param array &$readonlys names of widgets as key, to be made readonly
* @param mixed &$extension_data data the extension can store persisten between pre- and post-process
* @param etemplate &$tmpl reference to the template we belong too
@ -104,7 +102,7 @@ class infolog_widget
$cell['size'] = '';
$cell['no_lang'] = 1;
$cell['readonly'] = true;
switch($type)
{
case '': // Sum of the alternatives
@ -123,31 +121,31 @@ class infolog_widget
case 'info_datecompleted':
$cell['type'] = 'date-time';
break;
case 'info_enddate':
$cell['type'] = 'date';
break;
case 'info_owner':
case 'info_responsible':
$cell['type'] = 'select-owner';
break;
case 'info_cat':
$cell['type'] = 'select-cat';
break;
case 'info_access':
$cell['type'] = 'select-access';
break;
case 'info_type':
case 'info_priority':
case 'info_confirm':
$cell['sel_options'] = $this->infolog->enums[$type];
$cell['type'] = 'select';
break;
case 'info_status':
$cell['sel_options'] = $this->infolog->status[$this->info['info_type']];
$cell['type'] = 'select';
@ -204,13 +202,13 @@ class infolog_widget
return True; // extra label ok
}
function _get_info_fields()
{
static $fields;
if (!is_null($fields)) return $fields;
$fields = array(
'' => lang('Sum'),
'info_type' => lang('Type'),
@ -243,7 +241,7 @@ class infolog_widget
// 'info_id_parent' => lang('Parent'),
// 'info_confirm' => lang('Confirm'),
// 'info_custom_from' => lang('Custom from'),
);
if ($this->infolog->customfields)
{

View File

@ -1,549 +0,0 @@
<?php
/**
* InfoLog - SIF Parser
*
* @link http://www.egroupware.org
* @author Lars Kneschke <lkneschke@egroupware.org>
* @package infolog
* @subpackage syncml
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
require_once PHPGW_SERVER_ROOT.'/infolog/inc/class.boinfolog.inc.php';
require_once EGW_SERVER_ROOT.'/phpgwapi/inc/horde/Horde/iCalendar.php';
class sifinfolog extends boinfolog
{
// array containing the result of the xml parser
var $_extractedSIFData;
// array containing the current mappings(task or note)
var $_currentSIFMapping;
var $_sifNoteMapping = array(
'Body' => 'info_des',
'Categories' => 'info_cat',
'Color' => '',
'Date' => 'info_startdate',
'Height' => '',
'Left' => '',
'Subject' => 'info_subject',
'Top' => '',
'Width' => '',
);
// mappings for SIFTask to InfologTask
var $_sifTaskMapping = array(
'ActualWork' => '',
'BillingInformation' => '',
'Body' => 'info_des',
'Categories' => 'info_cat',
'Companies' => '',
'Complete' => '',
'DateCompleted' => 'info_datecompleted',
'DueDate' => 'info_enddate',
'Importance' => 'info_priority',
'IsRecurring' => '',
'Mileage' => '',
'PercentComplete' => 'info_percent',
'ReminderSet' => '',
'ReminderTime' => '',
'Sensitivity' => 'info_access',
'StartDate' => 'info_startdate',
'Status' => 'info_status',
'Subject' => 'info_subject',
'TeamTask' => '',
'TotalWork' => '',
'RecurrenceType' => '',
'Interval' => '',
'MonthOfYear' => '',
'DayOfMonth' => '',
'DayOfWeekMask' => '',
'Instance' => '',
'PatternStartDate' => '',
'NoEndDate' => '',
'PatternEndDate' => '',
'Occurrences' => '',
);
function startElement($_parser, $_tag, $_attributes) {
}
function endElement($_parser, $_tag) {
error_log("infolog: tag=$_tag data=".trim($this->sifData));
if(!empty($this->_currentSIFMapping[$_tag])) {
$this->_extractedSIFData[$this->_currentSIFMapping[$_tag]] = trim($this->sifData);
}
unset($this->sifData);
}
function characterData($_parser, $_data) {
$this->sifData .= $_data;
}
function siftoegw($_sifData, $_sifType) {
$sysCharSet = $GLOBALS['egw']->translation->charset();
$sifData = base64_decode($_sifData);
#$tmpfname = tempnam('/tmp/sync/contents','sift_');
#$handle = fopen($tmpfname, "w");
#fwrite($handle, $sifData);
#fclose($handle);
switch ($_sifType)
{
case 'note':
$this->_currentSIFMapping = $this->_sifNoteMapping;
break;
case 'task':
default:
$this->_currentSIFMapping = $this->_sifTaskMapping;
break;
}
$this->xml_parser = xml_parser_create('UTF-8');
xml_set_object($this->xml_parser, $this);
xml_parser_set_option($this->xml_parser, XML_OPTION_CASE_FOLDING, false);
xml_set_element_handler($this->xml_parser, "startElement", "endElement");
xml_set_character_data_handler($this->xml_parser, "characterData");
$this->strXmlData = xml_parse($this->xml_parser, $sifData);
if(!$this->strXmlData) {
error_log(sprintf("XML error: %s at line %d",
xml_error_string(xml_get_error_code($this->xml_parser)),
xml_get_current_line_number($this->xml_parser)));
return false;
}
if(!array($this->_extractedSIFData)) {
return false;
}
switch($_sifType) {
case 'task':
$taskData = array();
$vcal = &new Horde_iCalendar;
$taskData['info_type'] = 'task';
foreach($this->_extractedSIFData as $key => $value) {
$value = $GLOBALS['egw']->translation->convert($value, 'utf-8', $sysCharSet);
error_log("infolog key=$key => value=$value");
switch($key) {
case 'info_access':
$taskData[$key] = ((int)$value > 0) ? 'private' : 'public';
break;
case 'info_datecompleted':
case 'info_enddate':
case 'info_startdate':
if(!empty($value)) {
$taskData[$key] = $vcal->_parseDateTime($value);
// somehow the client always deliver a timestamp about 3538 seconds, when no startdate set.
if($taskData[$key] < 10000)
$taskData[$key] = '';
} else {
$taskData[$key] = '';
}
break;
case 'info_cat':
if (!empty($value)) {
$categories = $this->find_or_add_categories(explode(';', $value));
$taskData['info_cat'] = $categories[0];
}
break;
case 'info_priority':
$taskData[$key] = (int)$value;
break;
case 'info_status':
$taskData[$key] = ((int)$value == 2) ? 'done' : 'ongoing';
switch($value) {
case '0':
$taskData[$key] = 'not-started';
break;
case '1':
$taskData[$key] = 'ongoing';
break;
case '2':
$taskData[$key] = 'done';
break;
case '4':
$taskData[$key] = 'cancelled';
break;
default:
$taskData[$key] = 'ongoing';
break;
}
break;
default:
$taskData[$key] = $value;
break;
}
error_log("infolog task key=$key => value=".$taskData[$key]);
}
return $taskData;
break;
case 'note':
$noteData = array();
$noteData['info_type'] = 'note';
$vcal = &new Horde_iCalendar;
foreach($this->_extractedSIFData as $key => $value)
{
$value = $GLOBALS['egw']->translation->convert($value, 'utf-8', $sysCharSet);
error_log("infolog client key=$key => value=".$value);
switch ($key)
{
case 'info_startdate':
if(!empty($value)) {
$noteData[$key] = $vcal->_parseDateTime($value);
// somehow the client always deliver a timestamp about 3538 seconds, when no startdate set.
if($noteData[$key] < 10000)
$noteData[$key] = '';
} else {
$noteData[$key] = '';
}
break;
case 'info_cat':
if (!empty($value)) {
$categories = $this->find_or_add_categories(explode(';', $value));
$taskData['info_cat'] = $categories[0];
}
break;
default:
$noteData[$key] = $value;
break;
}
error_log("infolog note key=$key => value=".$noteData[$key]);
}
return $noteData;
break;
default:
return false;
}
}
function searchSIF($_sifData, $_sifType) {
if(!$egwData = $this->siftoegw($_sifData, $_sifType)) {
return false;
}
$filter = array('col_filter' => $egwData);
if($foundItems = $this->search($filter)) {
if(count($foundItems) > 0) {
$itemIDs = array_keys($foundItems);
return $itemIDs[0];
}
}
return false;
}
function addSIF($_sifData, $_id, $_sifType) {
if(!$egwData = $this->siftoegw($_sifData, $_sifType)) {
return false;
}
if($_id > 0)
$egwData['info_id'] = $_id;
$egwID = $this->write($egwData, false);
return $egwID;
}
function getSIF($_id, $_sifType) {
switch($_sifType) {
case 'task':
if($taskData = $this->read($_id)) {
$sysCharSet = $GLOBALS['egw']->translation->charset();
$vcal = &new Horde_iCalendar;
$sifTask = '<task>';
foreach($this->_sifTaskMapping as $sifField => $egwField)
{
if(empty($egwField)) continue;
$value = $GLOBALS['egw']->translation->convert($taskData[$egwField], $sysCharSet, 'utf-8');
switch($sifField) {
case 'DateCompleted':
case 'DueDate':
case 'StartDate':
if(!empty($value)) {
$value = $vcal->_exportDateTime($value);
}
$sifTask .= "<$sifField>$value</$sifField>";
break;
case 'Importance':
if($value > 3) $value = 3;
$sifTask .= "<$sifField>$value</$sifField>";
break;
case 'Sensitivity':
$value = ($value == 'private' ? '2' : '0');
$sifTask .= "<$sifField>$value</$sifField>";
break;
case 'Status':
switch($value) {
case 'cancelled':
$value = '4';
break;
case 'done':
$value = '2';
break;
case 'not-started':
$value = '0';
break;
case 'ongoing':
$value = '1';
break;
default:
$value = 1;
break;
}
$sifTask .= "<$sifField>$value</$sifField>";
break;
case 'Categories':
if (!empty($value))
{
$value = implode('; ', $this->get_categories(array($value)));
$value = $GLOBALS['egw']->translation->convert($value, $sysCharSet, 'utf-8');
}
$sifTask .= "<$sifField>$value</$sifField>";
break;
default:
$sifTask .= "<$sifField>$value</$sifField>";
break;
}
}
$sifTask .= '<ActualWork>0</ActualWork><IsRecurring>0</IsRecurring>';
return base64_encode($sifTask);
/* return base64_encode("<task>
<ActualWork>0</ActualWork>
<BillingInformation></BillingInformation>
<Body></Body>
<Categories></Categories>
<Companies></Companies>
<Complete>0</Complete>
<DateCompleted></DateCompleted>
<DueDate></DueDate>
<Importance>1</Importance>
<IsRecurring>0</IsRecurring>
<Mileage></Mileage>
<PercentComplete>0</PercentComplete>
<ReminderSet>0</ReminderSet>
<ReminderTime></ReminderTime>
<Sensitivity>0</Sensitivity>
<StartDate>45001231T230000Z</StartDate>
<Status>3</Status>
<Subject>TARAAA3</Subject>
<TeamTask>0</TeamTask>
<TotalWork>0</TotalWork>
<RecurrenceType>1</RecurrenceType>
<Interval>1</Interval>
<MonthOfYear>0</MonthOfYear>
<DayOfMonth>0</DayOfMonth>
<DayOfWeekMask>4</DayOfWeekMask>
<Instance>0</Instance>
<PatternStartDate>20060320T230000Z</PatternStartDate>
<NoEndDate>1</NoEndDate>
<PatternEndDate></PatternEndDate>
<Occurrences>10</Occurrences>
</task>
"); */
}
break;
case 'note':
if($taskData = $this->read($_id)) {
$sysCharSet = $GLOBALS['egw']->translation->charset();
$vcal = &new Horde_iCalendar;
$sifNote = '<note>';
foreach($this->_sifNoteMapping as $sifField => $egwField)
{
if(empty($egwField)) continue;
$value = $GLOBALS['egw']->translation->convert($taskData[$egwField], $sysCharSet, 'utf-8');
switch($sifField) {
case 'Date':
if(!empty($value)) {
$value = $vcal->_exportDateTime($value);
}
$sifNote .= "<$sifField>$value</$sifField>";
break;
case 'Body':
$value = $GLOBALS['egw']->translation->convert($taskData['info_subject'], $sysCharSet, 'utf-8') . "\n" . $value;
$sifNote .= "<$sifField>$value</$sifField>";
break;
case 'Categories':
if (!empty($value))
{
$value = implode('; ', $this->get_categories(array($value)));
$value = $GLOBALS['egw']->translation->convert($value, $sysCharSet, 'utf-8');
}
$sifNote .= "<$sifField>$value</$sifField>";
break;
default:
$sifNote .= "<$sifField>$value</$sifField>";
break;
}
}
return base64_encode($sifNote);
}
break;
default;
return false;
}
}
function exportVTODO($_taskID, $_version)
{
$taskData = $this->read($_taskID);
$taskData = $GLOBALS['egw']->translation->convert($taskData,$GLOBALS['egw']->translation->charset(),'UTF-8');
//_debug_array($taskData);
$taskGUID = $GLOBALS['phpgw']->common->generate_uid('infolog_task',$_taskID);
$vcal = &new Horde_iCalendar;
$vcal->setAttribute('VERSION',$_version);
$vcal->setAttribute('METHOD','PUBLISH');
$vevent = Horde_iCalendar::newComponent('VTODO',$vcal);
$options = array();
$vevent->setAttribute('SUMMARY',$taskData['info_subject']);
$vevent->setAttribute('DESCRIPTION',$taskData['info_des']);
if($taskData['info_startdate'])
$vevent->setAttribute('DTSTART',$taskData['info_startdate']);
if($taskData['info_enddate'])
$vevent->setAttribute('DUE',$taskData['info_enddate']);
$vevent->setAttribute('DTSTAMP',time());
$vevent->setAttribute('CREATED',$GLOBALS['phpgw']->contenthistory->getTSforAction($eventGUID,'add'));
$vevent->setAttribute('LAST-MODIFIED',$GLOBALS['phpgw']->contenthistory->getTSforAction($eventGUID,'modify'));
$vevent->setAttribute('UID',$taskGUID);
$vevent->setAttribute('CLASS',(($taskData['info_access'] == 'public')?'PUBLIC':'PRIVATE'));
$vevent->setAttribute('STATUS',(($taskData['info_status'] == 'completed')?'COMPLETED':'NEEDS-ACTION'));
// 3=urgent => 1, 2=high => 2, 1=normal => 3, 0=low => 4
$vevent->setAttribute('PRIORITY',4-$taskData['info_priority']);
#$vevent->setAttribute('TRANSP','OPAQUE');
# status
# ATTENDEE
$options = array('CHARSET' => 'UTF-8','ENCODING' => 'QUOTED-PRINTABLE');
$vevent->setParameter('SUMMARY', $options);
$vevent->setParameter('DESCRIPTION', $options);
$vcal->addComponent($vevent);
#print "<pre>";
#print $vcal->exportvCalendar();
#print "</pre>";
return $vcal->exportvCalendar();
}
function importVTODO(&$_vcalData, $_taskID=-1)
{
$botranslation = CreateObject('phpgwapi.translation');
$vcal = &new Horde_iCalendar;
if(!$vcal->parsevCalendar($_vcalData))
{
return FALSE;
}
$components = $vcal->getComponents();
if(count($components) > 0)
{
$component = $components[0];
if(is_a($component, 'Horde_iCalendar_vtodo'))
{
if($_taskID>0)
$taskData['info_id'] = $_taskID;
foreach($component->_attributes as $attributes)
{
#print $attributes['name'].' - '.$attributes['value'].'<br>';
#$attributes['value'] = $GLOBALS['egw']->translation->convert($attributes['value'],'UTF-8');
switch($attributes['name'])
{
case 'CLASS':
$taskData['info_access'] = strtolower($attributes['value']);
break;
case 'DESCRIPTION':
$taskData['info_des'] = $attributes['value'];
break;
case 'DUE':
$taskData['info_enddate'] = $attributes['value'];
break;
case 'DTSTART':
$taskData['info_startdate'] = $attributes['value'];
break;
case 'PRIORITY':
// 1 => 3=urgent, 2 => 2=high, 3 => 1=normal, 4 => 0=low
if (1 <= $attributes['value'] && $attributes['value'] <= 4)
{
$taskData['info_priority'] = 4 - $attributes['value'];
}
else
{
$taskData['info_priority'] = 1; // default = normal
}
break;
case 'STATUS':
$taskData['info_status'] = (strtolower($attributes['value']) == 'completed') ? 'done' : 'ongoing';
break;
case 'SUMMARY':
$taskData['info_subject'] = $attributes['value'];
break;
}
}
#_debug_array($eventData);exit;
return $this->write($taskData);
}
}
return FALSE;
}
}
?>

View File

@ -12,10 +12,8 @@
// Delete all records for a user
if((int)$GLOBALS['hook_values']['account_id'] > 0)
{
require_once(EGW_INCLUDE_ROOT.'/infolog/inc/class.soinfolog.inc.php');
$grants = array();
$info =& new soinfolog($grants);
$info =& new infolog_so($grants);
$info->change_delete_owner((int)$GLOBALS['hook_values']['account_id'],(int)$_POST['new_owner']);

View File

@ -19,7 +19,7 @@ if (($showevents = $GLOBALS['egw_info']['user']['preferences']['infolog']['homeS
$app_id = $GLOBALS['egw']->applications->name2id('infolog');
$GLOBALS['portal_order'][] = $app_id;
$infolog =& CreateObject('infolog.uiinfolog');
$infolog =& infolog_ui();
$infolog->called_by = 'home';
if (in_array($showevents,array('1','2'))) $showevents = 'own-open-today';

View File

@ -1,231 +0,0 @@
<?php
/**
* InfoLog - Preferences
*
* @link http://www.egroupware.org
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @package infolog
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
/* Setup some values to fill the array of this app's settings below */
$ui =& CreateObject('infolog.uiinfolog'); // need some labels from
$filters = $show_home = array();
$show_home[] = lang("DON'T show InfoLog");
foreach($ui->filters as $key => $label)
{
$show_home[$key] = $filters[$key] = lang($label);
}
// migrage old filter-pref 1,2 to the filter one 'own-open-today'
if (isset($GLOBALS['type']) && in_array($GLOBALS['egw']->preferences->{$GLOBALS['type']}['homeShowEvents'],array('1','2')))
{
$GLOBALS['egw']->preferences->add('infolog','homeShowEvents','own-open-today',$GLOBALS['type']);
$GLOBALS['egw']->preferences->save_repository();
}
$show_links = array(
'all' => lang('all links and attachments'),
'links' => lang('only the links'),
'attach' => lang('only the attachments'),
'none' => lang('no links or attachments'),
'no_describtion' => lang('no describtion, links or attachments'),
);
$show_details = array(
0 => lang('No'),
1 => lang('Yes'),
2 => lang('Only for details'),
);
/**
* Return InoLog Categories (used for setting )
*
* @return array
*/
function all_cats()
{
$categories = new categories('','infolog');
foreach((array)$categories->return_sorted_array(0,False,'','','',true) as $cat)
{
$s = str_repeat('&nbsp;',$cat['level']) . stripslashes($cat['name']);
if ($cat['app_name'] == 'phpgw' || $cat['owner'] == '-1')
{
$s .= ' &#9830;';
}
$sel_options[$cat['id']] = $s; // 0.9.14 only
}
return $sel_options;
}
/* Settings array for this app */
$GLOBALS['settings'] = array(
'defaultFilter' => array(
'type' => 'select',
'label' => 'Default Filter for InfoLog',
'name' => 'defaultFilter',
'values' => $filters,
'help' => 'This is the filter InfoLog uses when you enter the application. Filters limit the entries to show in the actual view. There are filters to show only finished, still open or futures entries of yourself or all users.',
'xmlrpc' => True,
'admin' => False
),
'homeShowEvents' => array(
'type' => 'select',
'label' => 'InfoLog filter for the main screen',
'name' => 'homeShowEvents',
'values' => $show_home,
'help' => 'Should InfoLog show up on the main screen and with which filter. Works only if you dont selected an application for the main screen (in your preferences).',
'xmlrpc' => True,
'admin' => False
),
'listNoSubs' => array(
'type' => 'check',
'label' => 'List no Subs/Childs',
'name' => 'listNoSubs',
'help' => 'Should InfoLog show Subtasks, -calls or -notes in the normal view or not. You can always view the Subs via there parent.',
'xmlrpc' => True,
'admin' => False
),
'show_links' => array(
'type' => 'select',
'label' => 'Show in the InfoLog list',
'name' => 'show_links',
'values' => $show_links,
'help' => 'Should InfoLog show the links to other applications and/or the file-attachments in the InfoLog list (normal view when you enter InfoLog).',
'xmlrpc' => True,
'admin' => False
),
'never_hide' => array(
'type' => 'check',
'label' => 'Never hide search and filters',
'name' => 'never_hide',
'help' => 'If not set, the line with search and filters is hidden for less entries then "max matches per page" (as defined in your common preferences).',
'xmlrpc' => True,
'admin' => False
),
'show_percent' => array(
'type' => 'select',
'label' => 'Show status and percent done separate',
'name' => 'show_percent',
'values' => $show_details,
'help' => 'Should the Infolog list show the percent done only for status ongoing or two separate icons.',
'xmlrpc' => True,
'admin' => False
),
'show_id' => array(
'type' => 'select',
'label' => 'Show ticket Id',
'name' => 'show_id',
'values' => $show_details,
'help' => 'Should the Infolog list show a unique numerical Id, which can be used eg. as ticket Id.',
'xmlrpc' => True,
'admin' => False
),
'set_start' => array(
'type' => 'select',
'label' => 'Startdate for new entries',
'name' => 'set_start',
'values' => array(
'date' => lang('todays date'),
'datetime' => lang('actual date and time'),
'empty' => lang('leave it empty'),
),
'help' => 'To what should the startdate of new entries be set.',
'xmlrpc' => True,
'admin' => False
),
'cal_show' => array(
'type' => 'multiselect',
'label' => 'Which types should the calendar show',
'name' => 'cal_show',
'values' => $ui->bo->enums['type'],
'help' => 'Can be used to show further InfoLog types in the calendar or limit it to show eg. only tasks.',
'xmlrpc' => True,
'admin' => False
),
'cat_add_default' => array(
'type' => 'select',
'label' => 'Default categorie for new Infolog entries',
'name' => 'cat_add_default',
'values' => all_cats(),
'help' => 'You can choose a categorie to be preselected, when you create a new Infolog entry',
'xmlrpc' => True,
'admin' => False
),
);
unset($ui);
unset($show_home);
unset($show_details);
unset($filters);
unset($show_links);
// notification preferences
$GLOBALS['settings']['notify_creator'] = array(
'type' => 'check',
'label' => 'Receive notifications about own items',
'name' => 'notify_creator',
'help' => 'Do you want a notification, if items you created get updated?',
'xmlrpc' => True,
'admin' => False,
);
$GLOBALS['settings']['notify_assigned'] = array(
'type' => 'select',
'label' => 'Receive notifications about items assigned to you',
'name' => 'notify_assigned',
'help' => 'Do you want a notification, if items get assigned to you or assigned items get updated?',
'values' => array(
'0' => lang('No'),
'1' => lang('Yes'),
'assignment' => lang('Only if I get assigned or removed'),
),
'xmlrpc' => True,
'admin' => False,
);
// to add options for more then 3 days back or in advance, you need to update soinfolog::users_with_open_entries()!
$options = array(
'0' => lang('No'),
'-1d' => lang('one day after'),
'0d' => lang('same day'),
'1d' => lang('one day in advance'),
'2d' => lang('%1 days in advance',2),
'3d' => lang('%1 days in advance',3),
);
$GLOBALS['settings']['notify_due_delegated'] = array(
'type' => 'select',
'label' => 'Receive notifications about due entries you delegated',
'name' => 'notify_due_delegated',
'help' => 'Do you want a notification, if items you delegated are due?',
'values' => $options,
'xmlrpc' => True,
'admin' => False,
);
$GLOBALS['settings']['notify_due_responsible'] = array(
'type' => 'select',
'label' => 'Receive notifications about due entries you are responsible for',
'name' => 'notify_due_responsible',
'help' => 'Do you want a notification, if items you are responsible for are due?',
'values' => $options,
'xmlrpc' => True,
'admin' => False,
);
$GLOBALS['settings']['notify_start_delegated'] = array(
'type' => 'select',
'label' => 'Receive notifications about starting entries you delegated',
'name' => 'notify_start_delegated',
'help' => 'Do you want a notification, if items you delegated are about to start?',
'values' => $options,
'xmlrpc' => True,
'admin' => False,
);
$GLOBALS['settings']['notify_start_responsible'] = array(
'type' => 'select',
'label' => 'Receive notifications about starting entries you are responsible for',
'name' => 'notify_start_responsible',
'help' => 'Do you want a notification, if items you are responsible for are about to start?',
'values' => $options,
'xmlrpc' => True,
'admin' => False,
);

View File

@ -12,7 +12,7 @@
$GLOBALS['egw_info'] = array(
'flags' => array(
'currentapp' => 'infolog',
'currentapp' => 'infolog',
'noheader' => True,
'nonavbar' => True,
)
@ -29,4 +29,4 @@ if ($setup_info['infolog']['version'] != $GLOBALS['egw_info']['apps']['infolog']
}
unset($setup_info);
ExecMethod('infolog.uiinfolog.index','reset_action_view');
ExecMethod('infolog.infolog_ui.index','reset_action_view');

File diff suppressed because one or more lines are too long

View File

@ -12,7 +12,7 @@
*/
$setup_info['infolog']['name'] = 'infolog';
$setup_info['infolog']['version'] = '1.5.004';
$setup_info['infolog']['version'] = '1.6';
$setup_info['infolog']['app_order'] = 5;
$setup_info['infolog']['tables'] = array('egw_infolog','egw_infolog_extra');
$setup_info['infolog']['enable'] = 1;
@ -44,29 +44,28 @@ $setup_info['infolog']['note'] =
<a href="http://www.egroupware.org/wiki/infolog" target="_blank">InfoLog page on our Website</a>.</p>';
/* The hooks this app includes, needed for hooks registration */
$setup_info['infolog']['hooks']['preferences'] = 'infolog.infolog_prefs_sidebox_hooks.all_hooks';
$setup_info['infolog']['hooks'][] = 'settings';
$setup_info['infolog']['hooks']['verify_settings'] = 'infolog.infolog_prefs_sidebox_hooks.verify_settings';
$setup_info['infolog']['hooks']['admin'] = 'infolog.infolog_prefs_sidebox_hooks.all_hooks';
$setup_info['infolog']['hooks']['preferences'] = 'infolog_hooks::all_hooks';
$setup_info['infolog']['hooks']['settings'] = 'infolog_hooks::settings';
$setup_info['infolog']['hooks']['verify_settings'] = 'infolog_hooks::verify_settings';
$setup_info['infolog']['hooks']['admin'] = 'infolog_hooks::all_hooks';
$setup_info['infolog']['hooks'][] = 'deleteaccount';
$setup_info['infolog']['hooks'][] = 'home';
$setup_info['infolog']['hooks']['addressbook_view'] = 'infolog.uiinfolog.hook_view';
$setup_info['infolog']['hooks']['projects_view'] = 'infolog.uiinfolog.hook_view';
$setup_info['infolog']['hooks']['calendar_view'] = 'infolog.uiinfolog.hook_view';
$setup_info['infolog']['hooks']['infolog'] = 'infolog.uiinfolog.hook_view';
$setup_info['infolog']['hooks']['calendar_include_events'] = 'infolog.boinfolog.cal_to_include';
$setup_info['infolog']['hooks']['calendar_include_todos'] = 'infolog.boinfolog.cal_to_include';
$setup_info['infolog']['hooks']['sidebox_menu'] = 'infolog.infolog_prefs_sidebox_hooks.all_hooks';
$setup_info['infolog']['hooks']['search_link'] = 'infolog.boinfolog.search_link';
$setup_info['infolog']['hooks']['pm_custom_app_icons'] = 'infolog.boinfolog.pm_icons';
$setup_info['infolog']['hooks']['addressbook_view'] = 'infolog.infolog_ui.hook_view';
$setup_info['infolog']['hooks']['projects_view'] = 'infolog.infolog_ui.hook_view';
$setup_info['infolog']['hooks']['calendar_view'] = 'infolog.infolog_ui.hook_view';
$setup_info['infolog']['hooks']['infolog'] = 'infolog.infolog_ui.hook_view';
$setup_info['infolog']['hooks']['calendar_include_events'] = 'infolog.infolog_bo.cal_to_include';
$setup_info['infolog']['hooks']['calendar_include_todos'] = 'infolog.infolog_bo.cal_to_include';
$setup_info['infolog']['hooks']['sidebox_menu'] = 'infolog_hooks::all_hooks';
$setup_info['infolog']['hooks']['search_link'] = 'infolog_hooks::search_link';
$setup_info['infolog']['hooks']['pm_custom_app_icons'] = 'infolog.infolog_bo.pm_icons';
/* Dependencies for this app to work */
$setup_info['infolog']['depends'][] = array(
'appname' => 'phpgwapi',
'versions' => Array('1.3','1.4','1.5')
'versions' => Array('1.5','1.6','1.7')
);
$setup_info['infolog']['depends'][] = array(
'appname' => 'etemplate',
'versions' => Array('1.3','1.4','1.5')
'versions' => Array('1.5','1.6','1.7')
);

File diff suppressed because it is too large Load Diff

View File

@ -1,96 +1,145 @@
<?xml version="1.0"?>
<!-- $Id$ -->
<overlay>
<template id="infolog.index.rows-noheader" template="" lang="" group="0" version="1.0.1.002">
<template id="infolog.index.rows-noheader" template="" lang="" group="0" version="1.5.004">
<grid>
<columns>
<column width="5%"/>
<column width="2%"/>
<column/>
<column width="8%"/>
<column width="8%"/>
<column width="12%"/>
<column disabled="@no_customfields"/>
<column width="120"/>
<column disabled="@no_info_used_time_info_planned_time"/>
<column width="8%" disabled="@no_info_onwer_info_responsible"/>
<column width="12%" disabled="@no_info_datemodified"/>
<column width="3%" disabled="@no_actions"/>
<column width="3%" disabled="@no_actions"/>
</columns>
<rows>
<row class="th">
<vbox>
<vbox options="0,0">
<description value="Type"/>
<description value="Status"/>
<description value="Status" align="center"/>
<description value="Completed" align="right"/>
</vbox>
<vbox>
<vbox rows="2" cols="1" options="2">
<description value="Subject"/>
<description value="Description"/>
</vbox>
<vbox>
<vbox options="0,0">
<description id="customfields" options="Custom fields"/>
<grid spacing="0" padding="0">
<columns>
<column disabled="@no_customfields"/>
</columns>
<rows>
<row>
<description no_lang="1" id="customfields[$row][label]" options="Custom fields"/>
</row>
</rows>
</grid>
</vbox>
<vbox options="0,0">
<description value="Startdate"/>
<description value="Enddate"/>
<description value="Date completed"/>
</vbox>
<vbox>
<description value="Times"/>
<description class="planned" value="planned"/>
<description class="replanned" value="Re-planned"/>
</vbox>
<vbox>
<description value="Owner"/>
<description value="Responsible"/>
</vbox>
<description value="last changed"/>
<description value="Sub"/>
<description value="Action"/>
<description value="Sub" class="noPrint"/>
<description value="Action" class="noPrint"/>
</row>
<row class="row" valign="top">
<hbox align="center" orient="2,2">
<hbox options="5" align="center">
<image label="$row_cont[info_type]" src="${row}[info_type]"/>
<button image="$row_cont[info_status]" ro_image="$row_cont[info_status]" label="$row_cont[info_status]" id="edit_status[$row_cont[info_id]]" statustext="Change the status of an entry, eg. close it" onclick="window.open(egw::link('/index.php','menuaction=infolog.uiinfolog.edit&amp;info_id=$row_cont[info_id]'),'_blank','dependent=yes,width=750,height=550,scrollbars=yes,status=yes'); return false;"/>
<button image="$row_cont[info_status_label]" ro_image="$row_cont[info_status_label]" label="$row_cont[info_status_label]" id="edit_status[$row_cont[info_id]]" statustext="Change the status of an entry, eg. close it" onclick="window.open(egw::link('/index.php','menuaction=infolog.infolog_ui.edit&amp;info_id=$row_cont[info_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
<button image="$row_cont[info_percent]" label="$row_cont[info_percent]" id="edit_percent[$row_cont[info_id]]" statustext="Change the status of an entry, eg. close it" onclick="window.open(egw::link('/index.php','menuaction=infolog.infolog_ui.edit&amp;info_id=$row_cont[info_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
<image label="$row_cont[info_percent2]" src="{$row}[info_percent2]" onclick="window.open(egw::link('/index.php','menuaction=infolog.infolog_ui.edit&amp;info_id=$row_cont[info_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
</hbox>
<vbox orient="0,0">
<link label="%s $row_cont[info_addr]" id="${row}[info_link]"/>
<description class="$row_cont[sub_class]" no_lang="1" id="${row}[info_subject]"/>
<vbox options="0,0" class="fullWidth">
<link label="%s $row_cont[info_addr]" id="${row}[info_link]" options="b"/>
<hbox options="0,0">
<description class="$row_cont[sub_class]" no_lang="1" id="${row}[info_subject]"/>
<description no_lang="1" align="right" id="{$row}[info_number]" class="infoId"/>
</hbox>
<description options=",,1" no_lang="1" id="${row}[info_des]"/>
<link-string id="${row}[filelinks]"/>
</vbox>
<vbox orient="0,0">
<date id="${row}[info_startdate]" readonly="true"/>
<date class="$row_cont[end_class]" id="${row}[info_enddate]" readonly="true"/>
<customfields-list class="customfields" id="$row" readonly="true"/>
<vbox options="0,0,1" rows="3" cols="1">
<date-time options=",8" id="${row}[info_startdate]" readonly="true" class="fixedHeight"/>
<date class="$row_cont[end_class] fixedHeight" id="${row}[info_enddate]" readonly="true"/>
<date-time id="${row}[info_datecompleted]" readonly="true" class="fixedHeight"/>
</vbox>
<vbox orient="0,0">
<vbox rows="3" cols="1">
<hbox options="1,0" id="l_used_time">
<image label="Times" src="timesheet"/>
<date-duration id="${row}[info_used_time]" readonly="true" options="@duration_format"/>
<date-duration id="${row}[info_sum_timesheets]" readonly="true" options="@duration_format" class="timesheet"/>
</hbox>
<hbox options="1,0" id="lplanified">
<image label="planned time" src="k_alarm.png" readonly="true"/>
<date-duration id="${row}[info_planned_time]" span="all" class="planned" readonly="true" options="@duration_format"/>
</hbox>
<hbox options="1,0" id="replanified">
<image label="Re-planned time" src="agt_reload.png"/>
<date-duration id="${row}[info_replanned_time]" span="all" class="replanned" readonly="true" options="@duration_format"/>
</hbox>
</vbox>
<vbox options="0,0">
<menulist>
<menupopup type="select-account" id="${row}[info_owner]" readonly="true"/>
</menulist>
<listbox type="select-account" id="${row}[info_responsible]" readonly="true" rows="5"/>
</vbox>
<vbox orient="0,0">
<vbox options="0" orient="0">
<date-time id="${row}[info_datemodified]" readonly="true"/>
<menulist>
<menupopup type="select-account" id="${row}[info_modifier]" readonly="true"/>
</menulist>
</vbox>
<vbox align="center" orient="0,0">
<button image="new" label="Add sub" align="center" id="sp[$row_cont[info_id]]" statustext="Add a new sub-task, -note, -call to this entry" onclick="window.open(egw::link('/index.php','menuaction=infolog.uiinfolog.edit&amp;action=sp&amp;action_id=$row_cont[info_id]'),'_blank','dependent=yes,width=750,height=550,scrollbars=yes,status=yes'); return false;"/>
<vbox options="0" align="center" class="noPrint" orient="0">
<button image="new" label="Add sub" align="center" id="sp[$row_cont[info_id]]" statustext="Add a new sub-task, -note, -call to this entry" onclick="window.open(egw::link('/index.php','menuaction=infolog.infolog_ui.edit&amp;action=sp&amp;action_id=$row_cont[info_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
<button image="view.gif" label="View subs" align="center" id="view[$row_cont[info_id]]" statustext="View all subs of this entry"/>
<button image="parent.gif" label="View parent" align="center" id="view[$row_cont[info_id_parent]]" statustext="View the parent of this entry and all his subs"/>
<button image="timesheet" label="Add timesheet entry" id="timesheet[$row_cont[info_id]]" onclick="window.open(egw::link('/index.php','menuaction=timesheet.timesheet_ui.edit&amp;link_app[]=infolog&amp;link_id[]=$row_cont[info_id]$row_cont[extra_links]'),'_blank','dependent=yes,width=600,height=400,scrollbars=yes,status=yes'); return false;" align="center"/>
</vbox>
<hbox>
<button image="edit" label="Edit" id="edit[$row_cont[info_id]]" statustext="Edit this entry" onclick="window.open(egw::link('/index.php','menuaction=infolog.uiinfolog.edit&amp;info_id=$row_cont[info_id]'),'_blank','dependent=yes,width=750,height=550,scrollbars=yes,status=yes'); return false;"/>
<hbox class="noPrint">
<button image="edit" label="Edit" id="edit[$row_cont[info_id]]" statustext="Edit this entry" onclick="window.open(egw::link('/index.php','menuaction=infolog.infolog_ui.edit&amp;info_id=$row_cont[info_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
<button image="delete" label="Delete" id="delete[$row_cont[info_id]]" statustext="Delete this entry" onclick="return $row_cont[info_anz_subs] || confirm('Delete this entry');"/>
<button image="done" label="Close" id="close[$row_cont[info_id]]" statustext="Sets the status of this entry to done"/>
<button image="done" label="Close" id="close[$row_cont[info_id]]" statustext="Sets the status of this entry and its subs to done"/>
</hbox>
</row>
</rows>
</grid>
</template>
<template id="infolog.index.rows" template="" lang="" group="0" version="1.0.1.003">
<template id="infolog.index.rows" template="" lang="" group="0" version="1.5.004">
<grid>
<columns>
<column width="2%"/>
<column/>
<column width="8%"/>
<column width="8%"/>
<column disabled="@no_customfields"/>
<column/>
<column width="120"/>
<column/>
<column width="8%" disabled="@no_info_owner_info_responsible"/>
<column width="12%"/>
<column width="3%" disabled="@no_actions"/>
<column width="3%" disabled="@no_actions"/>
</columns>
<rows>
<row class="th">
<vbox orient="0,0">
<nextmatch-filterheader options="Type ..." id="info_type"/>
<nextmatch-filterheader options="Status ..." id="info_status"/>
<vbox options="0,0">
<nextmatch-filterheader options="Type" id="info_type" no_lang="1"/>
<nextmatch-filterheader options="Status" id="info_status" align="center"/>
<nextmatch-sortheader label="Completed" id="info_percent" align="right"/>
</vbox>
<grid width="100%" spacing="0" padding="0">
<columns>
@ -98,64 +147,102 @@
<column/>
</columns>
<rows>
<row>
<description/>
<nextmatch-sortheader label="Priority" align="right" id="info_priority" options="DESC" class="noPrint"/>
</row>
<row>
<nextmatch-sortheader label="Subject" id="info_subject"/>
<nextmatch-sortheader label="Priority" align="right" id="info_priority" options="DESC"/>
<nextmatch-sortheader label="Creation" align="right" id="info_id" options="DESC" class="noPrint"/>
</row>
<row>
<nextmatch-sortheader label="Description" id="info_des"/>
<nextmatch-sortheader label="Creation" align="right" id="info_id" options="DESC"/>
<nextmatch-sortheader label="last changed" id="info_datemodified" options="DESC" class="noPrint" align="right"/>
</row>
</rows>
</grid>
<vbox>
<nextmatch-customfields id="customfields"/>
<nextmatch-header label="Category" id="cat_id"/>
<vbox options="0,0">
<nextmatch-sortheader label="Startdate" id="info_startdate"/>
<nextmatch-sortheader label="Enddate" id="info_enddate"/>
<nextmatch-sortheader id="info_datecompleted" label="Date completed"/>
</vbox>
<vbox>
<nextmatch-accountfilter id="info_owner" options="Owner" statustext="Select to filter by owner"/>
<nextmatch-accountfilter id="info_responsible" options="Responsible" statustext="Select to filter by responsible"/>
<vbox rows="2" cols="1" options="2">
<nextmatch-sortheader label="Times" id="info_used_time"/>
<nextmatch-sortheader id="info_planned_time" class="planned" label="planned"/>
<nextmatch-sortheader id="info_replanned_time" class="replanned" label="Re-planned"/>
</vbox>
<vbox options="0,0">
<nextmatch-accountfilter id="info_owner" options="Owner" statustext="Select to filter by owner" class="user_filter"/>
<nextmatch-accountfilter id="info_responsible" options="Responsible,both" statustext="Select to filter by responsible" class="user_filter"/>
</vbox>
<nextmatch-sortheader label="last changed" id="info_datemodified" options="DESC"/>
<description value="Sub"/>
<description value="Action"/>
<description value="Sub" class="noPrint"/>
<description value="Action" class="noPrint"/>
</row>
<row class="row" valign="top">
<hbox align="center" orient=",5">
<hbox options="5" align="center">
<image label="$row_cont[info_type]" src="${row}[info_type]"/>
<button image="$row_cont[info_status]" ro_image="$row_cont[info_status]" label="$row_cont[info_status]" id="edit_status[$row_cont[info_id]]" statustext="Change the status of an entry, eg. close it" onclick="window.open(egw::link('/index.php','menuaction=infolog.uiinfolog.edit&amp;info_id=$row_cont[info_id]'),'_blank','dependent=yes,width=750,height=550,scrollbars=yes,status=yes'); return false;"/>
<button image="$row_cont[info_status_label]" ro_image="$row_cont[info_status_label]" label="$row_cont[info_status_label]" id="edit_status[$row_cont[info_id]]" statustext="Change the status of an entry, eg. close it" onclick="window.open(egw::link('/index.php','menuaction=infolog.infolog_ui.edit&amp;info_id=$row_cont[info_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
<button image="$row_cont[info_percent]" label="$row_cont[info_percent]" id="edit_percent[$row_cont[info_id]]" statustext="Change the status of an entry, eg. close it" onclick="window.open(egw::link('/index.php','menuaction=infolog.infolog_ui.edit&amp;info_id=$row_cont[info_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
<image label="$row_cont[info_percent2]" src="{$row}[info_percent2]" onclick="window.open(egw::link('/index.php','menuaction=infolog.infolog_ui.edit&amp;info_id=$row_cont[info_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
</hbox>
<vbox orient="0,0">
<vbox options="0,0" class="fullWidth">
<link label="%s $row_cont[info_addr]" id="${row}[info_link]" options="b"/>
<description class="$row_cont[sub_class]" no_lang="1" id="${row}[info_subject]"/>
<description options=",,1" no_lang="1" id="${row}[info_des]"/>
<hbox options="0,0">
<description class="$row_cont[sub_class]" no_lang="1" id="${row}[info_subject]"/>
<description no_lang="1" align="right" id="{$row}[info_number]" class="infoId"/>
</hbox>
<description no_lang="1" id="${row}[info_des]" options=",,1"/>
<link-string id="${row}[filelinks]"/>
</vbox>
<vbox orient="0,0">
<date-time options=",8" id="${row}[info_startdate]" readonly="true"/>
<date class="$row_cont[end_class]" id="${row}[info_enddate]" readonly="true"/>
<customfields-list class="customfields" id="$row"/>
<menulist>
<menupopup type="select-cat" id="${row}[info_cat]" readonly="true"/>
</menulist>
<vbox options="0,0,1" rows="3" cols="1">
<date-time options=",8" id="${row}[info_startdate]" readonly="true" class="fixedHeight"/>
<date class="$row_cont[end_class] fixedHeight" id="${row}[info_enddate]" readonly="true"/>
<date-time id="${row}[info_datecompleted]" readonly="true" class="fixedHeight"/>
</vbox>
<vbox orient="0,0">
<vbox rows="3" cols="1">
<hbox options="1,0" id="r_used_time">
<image label="Times" src="timesheet"/>
<date-duration id="${row}[info_used_time]" readonly="true" options="@duration_format"/>
<date-duration id="${row}[info_sum_timesheets]" readonly="true" options="@duration_format" class="timesheet"/>
</hbox>
<hbox options="1,0" id="planified">
<image label="planned time" src="k_alarm.png" readonly="true"/>
<date-duration id="${row}[info_planned_time]" span="all" class="planned" readonly="true" options="@duration_format"/>
</hbox>
<hbox options="1,0" id="replanified">
<image label="Re-planned time" src="agt_reload.png"/>
<date-duration id="${row}[info_replanned_time]" span="all" class="replanned" readonly="true" options="@duration_format"/>
</hbox>
</vbox>
<vbox options="0,0">
<menulist>
<menupopup type="select-account" id="${row}[info_owner]" readonly="true"/>
</menulist>
<listbox type="select-account" id="${row}[info_responsible]" readonly="true" rows="5"/>
</vbox>
<vbox orient="0,0">
<vbox options="0" orient="0">
<date-time id="${row}[info_datemodified]" readonly="true"/>
<menulist>
<menupopup type="select-account" id="${row}[info_modifier]" readonly="true"/>
</menulist>
</vbox>
<vbox align="center" orient="0,0">
<button image="new" label="Add sub" align="center" id="sp[$row_cont[info_id]]" statustext="Add a new sub-task, -note, -call to this entry" onclick="window.open(egw::link('/index.php','menuaction=infolog.uiinfolog.edit&amp;action=sp&amp;action_id=$row_cont[info_id]'),'_blank','dependent=yes,width=750,height=550,scrollbars=yes,status=yes'); return false;"/>
<vbox options="0" align="center" class="noPrint" orient="0">
<button image="new" label="Add sub" align="center" id="sp[$row_cont[info_id]]" statustext="Add a new sub-task, -note, -call to this entry" onclick="window.open(egw::link('/index.php','menuaction=infolog.infolog_ui.edit&amp;action=sp&amp;action_id=$row_cont[info_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
<button image="view.gif" label="View subs" align="center" id="view[$row_cont[info_id]]" statustext="View all subs of this entry"/>
<button image="parent.gif" label="View parent" align="center" id="view[$row_cont[info_id_parent]]" statustext="View the parent of this entry and all his subs"/>
<button image="timesheet" label="Add timesheet entry" id="timesheet[$row_cont[info_id]]" onclick="window.open(egw::link('/index.php','menuaction=timesheet.timesheet_ui.edit&amp;link_app[]=infolog&amp;cat_id=$row_cont[info_cat]&amp;link_id[]=$row_cont[info_id]$row_cont[extra_links]'),'_blank','dependent=yes,width=600,height=400,scrollbars=yes,status=yes'); return false;" align="center"/>
</vbox>
<hbox>
<button image="edit" label="Edit" id="edit[$row_cont[info_id]]" statustext="Edit this entry" onclick="window.open(egw::link('/index.php','menuaction=infolog.uiinfolog.edit&amp;info_id=$row_cont[info_id]'),'_blank','dependent=yes,width=750,height=550,scrollbars=yes,status=yes'); return false;"/>
<hbox class="noPrint">
<button image="edit" label="Edit" id="edit[$row_cont[info_id]]" statustext="Edit this entry" onclick="window.open(egw::link('/index.php','menuaction=infolog.infolog_ui.edit&amp;info_id=$row_cont[info_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
<button image="delete" label="Delete" id="delete[$row_cont[info_id]]" statustext="Delete this entry" onclick="return $row_cont[info_anz_subs] || confirm('Delete this entry');"/>
<button image="done.gif" label="Close" id="close[$row_cont[info_id]]" statustext="Sets the status of this entry to done"/>
<button image="done" label="Close" id="close[$row_cont[info_id]]" statustext="Sets the status of this entry and its subs to done"/>
</hbox>
</row>
</rows>

View File

@ -5,12 +5,12 @@
<description class="headertext bold" value="InfoLog"/>
<styles>.bold { font-weight: bold; }</styles>
</template>
<template id="infolog.index.header_right" template="" lang="" group="0" version="1.4.001">
<template id="infolog.index.header_right" template="" lang="" group="0" version="1.5.001">
<hbox>
<description class="headertext" value="Add:"/>
<button image="task" label="ToDo" id="add[task]" statustext="Add a new ToDo" onclick="window.open(egw::link('/index.php','menuaction=infolog.uiinfolog.edit&amp;type=task&amp;action=$cont[action]&amp;action_id=$cont[action_id]&amp;cat_id=$cont[cat_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
<button image="phone" label="Phonecall" id="add[phone]" statustext="Add a new Phonecall" onclick="window.open(egw::link('/index.php','menuaction=infolog.uiinfolog.edit&amp;type=phone&amp;action=$cont[action]&amp;action_id=$cont[action_id]&amp;cat_id=$cont[cat_id]}'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
<button image="note" label="Note" id="add[note]" statustext="Add a new Note" onclick="window.open(egw::link('/index.php','menuaction=infolog.uiinfolog.edit&amp;type=note&amp;action=$cont[action]&amp;action_id=$cont[action_id]&amp;cat_id=$cont[cat_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
<button image="task" label="ToDo" id="add[task]" statustext="Add a new ToDo" onclick="window.open(egw::link('/index.php','menuaction=infolog.infolog_ui.edit&amp;type=task&amp;action=$cont[action]&amp;action_id=$cont[action_id]&amp;cat_id=$cont[cat_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
<button image="phone" label="Phonecall" id="add[phone]" statustext="Add a new Phonecall" onclick="window.open(egw::link('/index.php','menuaction=infolog.infolog_ui.edit&amp;type=phone&amp;action=$cont[action]&amp;action_id=$cont[action_id]&amp;cat_id=$cont[cat_id]}'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
<button image="note" label="Note" id="add[note]" statustext="Add a new Note" onclick="window.open(egw::link('/index.php','menuaction=infolog.infolog_ui.edit&amp;type=note&amp;action=$cont[action]&amp;action_id=$cont[action_id]&amp;cat_id=$cont[cat_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
</hbox>
</template>
<template id="infolog.index.rows-noheader" template="" lang="" group="0" version="1.5.004">
@ -71,9 +71,9 @@
<row class="row" valign="top">
<hbox options="5" align="center">
<image label="$row_cont[info_type]" src="${row}[info_type]"/>
<button image="$row_cont[info_status_label]" ro_image="$row_cont[info_status_label]" label="$row_cont[info_status_label]" id="edit_status[$row_cont[info_id]]" statustext="Change the status of an entry, eg. close it" onclick="window.open(egw::link('/index.php','menuaction=infolog.uiinfolog.edit&amp;info_id=$row_cont[info_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
<button image="$row_cont[info_percent]" label="$row_cont[info_percent]" id="edit_percent[$row_cont[info_id]]" statustext="Change the status of an entry, eg. close it" onclick="window.open(egw::link('/index.php','menuaction=infolog.uiinfolog.edit&amp;info_id=$row_cont[info_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
<image label="$row_cont[info_percent2]" src="{$row}[info_percent2]" onclick="window.open(egw::link('/index.php','menuaction=infolog.uiinfolog.edit&amp;info_id=$row_cont[info_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
<button image="$row_cont[info_status_label]" ro_image="$row_cont[info_status_label]" label="$row_cont[info_status_label]" id="edit_status[$row_cont[info_id]]" statustext="Change the status of an entry, eg. close it" onclick="window.open(egw::link('/index.php','menuaction=infolog.infolog_ui.edit&amp;info_id=$row_cont[info_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
<button image="$row_cont[info_percent]" label="$row_cont[info_percent]" id="edit_percent[$row_cont[info_id]]" statustext="Change the status of an entry, eg. close it" onclick="window.open(egw::link('/index.php','menuaction=infolog.infolog_ui.edit&amp;info_id=$row_cont[info_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
<image label="$row_cont[info_percent2]" src="{$row}[info_percent2]" onclick="window.open(egw::link('/index.php','menuaction=infolog.infolog_ui.edit&amp;info_id=$row_cont[info_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
</hbox>
<vbox options="0,0" class="fullWidth">
<link label="%s $row_cont[info_addr]" id="${row}[info_link]" options="b"/>
@ -118,13 +118,13 @@
</menulist>
</vbox>
<vbox options="0" align="center" class="noPrint" orient="0">
<button image="new" label="Add sub" align="center" id="sp[$row_cont[info_id]]" statustext="Add a new sub-task, -note, -call to this entry" onclick="window.open(egw::link('/index.php','menuaction=infolog.uiinfolog.edit&amp;action=sp&amp;action_id=$row_cont[info_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
<button image="new" label="Add sub" align="center" id="sp[$row_cont[info_id]]" statustext="Add a new sub-task, -note, -call to this entry" onclick="window.open(egw::link('/index.php','menuaction=infolog.infolog_ui.edit&amp;action=sp&amp;action_id=$row_cont[info_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
<button image="view.gif" label="View subs" align="center" id="view[$row_cont[info_id]]" statustext="View all subs of this entry"/>
<button image="parent.gif" label="View parent" align="center" id="view[$row_cont[info_id_parent]]" statustext="View the parent of this entry and all his subs"/>
<button image="timesheet" label="Add timesheet entry" id="timesheet[$row_cont[info_id]]" onclick="window.open(egw::link('/index.php','menuaction=timesheet.uitimesheet.edit&amp;link_app[]=infolog&amp;link_id[]=$row_cont[info_id]$row_cont[extra_links]'),'_blank','dependent=yes,width=600,height=400,scrollbars=yes,status=yes'); return false;" align="center"/>
<button image="timesheet" label="Add timesheet entry" id="timesheet[$row_cont[info_id]]" onclick="window.open(egw::link('/index.php','menuaction=timesheet.timesheet_ui.edit&amp;link_app[]=infolog&amp;link_id[]=$row_cont[info_id]$row_cont[extra_links]'),'_blank','dependent=yes,width=600,height=400,scrollbars=yes,status=yes'); return false;" align="center"/>
</vbox>
<hbox class="noPrint">
<button image="edit" label="Edit" id="edit[$row_cont[info_id]]" statustext="Edit this entry" onclick="window.open(egw::link('/index.php','menuaction=infolog.uiinfolog.edit&amp;info_id=$row_cont[info_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
<button image="edit" label="Edit" id="edit[$row_cont[info_id]]" statustext="Edit this entry" onclick="window.open(egw::link('/index.php','menuaction=infolog.infolog_ui.edit&amp;info_id=$row_cont[info_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
<button image="delete" label="Delete" id="delete[$row_cont[info_id]]" statustext="Delete this entry" onclick="return $row_cont[info_anz_subs] || confirm('Delete this entry');"/>
<button image="done" label="Close" id="close[$row_cont[info_id]]" statustext="Sets the status of this entry and its subs to done"/>
</hbox>
@ -196,9 +196,9 @@
<row class="row" valign="top">
<hbox options="5" align="center">
<image label="$row_cont[info_type]" src="${row}[info_type]"/>
<button image="$row_cont[info_status_label]" ro_image="$row_cont[info_status_label]" label="$row_cont[info_status_label]" id="edit_status[$row_cont[info_id]]" statustext="Change the status of an entry, eg. close it" onclick="window.open(egw::link('/index.php','menuaction=infolog.uiinfolog.edit&amp;info_id=$row_cont[info_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
<button image="$row_cont[info_percent]" label="$row_cont[info_percent]" id="edit_percent[$row_cont[info_id]]" statustext="Change the status of an entry, eg. close it" onclick="window.open(egw::link('/index.php','menuaction=infolog.uiinfolog.edit&amp;info_id=$row_cont[info_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
<image label="$row_cont[info_percent2]" src="{$row}[info_percent2]" onclick="window.open(egw::link('/index.php','menuaction=infolog.uiinfolog.edit&amp;info_id=$row_cont[info_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
<button image="$row_cont[info_status_label]" ro_image="$row_cont[info_status_label]" label="$row_cont[info_status_label]" id="edit_status[$row_cont[info_id]]" statustext="Change the status of an entry, eg. close it" onclick="window.open(egw::link('/index.php','menuaction=infolog.infolog_ui.edit&amp;info_id=$row_cont[info_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
<button image="$row_cont[info_percent]" label="$row_cont[info_percent]" id="edit_percent[$row_cont[info_id]]" statustext="Change the status of an entry, eg. close it" onclick="window.open(egw::link('/index.php','menuaction=infolog.infolog_ui.edit&amp;info_id=$row_cont[info_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
<image label="$row_cont[info_percent2]" src="{$row}[info_percent2]" onclick="window.open(egw::link('/index.php','menuaction=infolog.infolog_ui.edit&amp;info_id=$row_cont[info_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
</hbox>
<vbox options="0,0" class="fullWidth">
<link label="%s $row_cont[info_addr]" id="${row}[info_link]" options="b"/>
@ -246,13 +246,13 @@
</menulist>
</vbox>
<vbox options="0" align="center" class="noPrint" orient="0">
<button image="new" label="Add sub" align="center" id="sp[$row_cont[info_id]]" statustext="Add a new sub-task, -note, -call to this entry" onclick="window.open(egw::link('/index.php','menuaction=infolog.uiinfolog.edit&amp;action=sp&amp;action_id=$row_cont[info_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
<button image="new" label="Add sub" align="center" id="sp[$row_cont[info_id]]" statustext="Add a new sub-task, -note, -call to this entry" onclick="window.open(egw::link('/index.php','menuaction=infolog.infolog_ui.edit&amp;action=sp&amp;action_id=$row_cont[info_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
<button image="view.gif" label="View subs" align="center" id="view[$row_cont[info_id]]" statustext="View all subs of this entry"/>
<button image="parent.gif" label="View parent" align="center" id="view[$row_cont[info_id_parent]]" statustext="View the parent of this entry and all his subs"/>
<button image="timesheet" label="Add timesheet entry" id="timesheet[$row_cont[info_id]]" onclick="window.open(egw::link('/index.php','menuaction=timesheet.uitimesheet.edit&amp;link_app[]=infolog&amp;cat_id=$row_cont[info_cat]&amp;link_id[]=$row_cont[info_id]$row_cont[extra_links]'),'_blank','dependent=yes,width=600,height=400,scrollbars=yes,status=yes'); return false;" align="center"/>
<button image="timesheet" label="Add timesheet entry" id="timesheet[$row_cont[info_id]]" onclick="window.open(egw::link('/index.php','menuaction=timesheet.timesheet_ui.edit&amp;link_app[]=infolog&amp;cat_id=$row_cont[info_cat]&amp;link_id[]=$row_cont[info_id]$row_cont[extra_links]'),'_blank','dependent=yes,width=600,height=400,scrollbars=yes,status=yes'); return false;" align="center"/>
</vbox>
<hbox class="noPrint">
<button image="edit" label="Edit" id="edit[$row_cont[info_id]]" statustext="Edit this entry" onclick="window.open(egw::link('/index.php','menuaction=infolog.uiinfolog.edit&amp;info_id=$row_cont[info_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
<button image="edit" label="Edit" id="edit[$row_cont[info_id]]" statustext="Edit this entry" onclick="window.open(egw::link('/index.php','menuaction=infolog.infolog_ui.edit&amp;info_id=$row_cont[info_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
<button image="delete" label="Delete" id="delete[$row_cont[info_id]]" statustext="Delete this entry" onclick="return $row_cont[info_anz_subs] || confirm('Delete this entry');"/>
<button image="done" label="Close" id="close[$row_cont[info_id]]" statustext="Sets the status of this entry and its subs to done"/>
</hbox>
@ -286,7 +286,7 @@
</row>
<row class="noPrint">
<hbox span="all">
<button label="Add" id="add[note]" statustext="Add a new Entry" onclick="window.open(egw::link('/index.php','menuaction=infolog.uiinfolog.edit&amp;type=note&amp;action=$cont[action]&amp;action_id=$cont[action_id]&amp;cat_id={$cont[nm][cat_id]}'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
<button label="Add" id="add[note]" statustext="Add a new Entry" onclick="window.open(egw::link('/index.php','menuaction=infolog.infolog_ui.edit&amp;type=note&amp;action=$cont[action]&amp;action_id=$cont[action_id]&amp;cat_id={$cont[nm][cat_id]}'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
<button label="Cancel" id="cancel" statustext="Back to main list"/>
</hbox>
</row>