Author: ralfbecker
New Revision: 55955
URL: http://svn.stylite.de/viewvc/egroupware?rev=55955&view=rev
Log:
using new api for InfoLog
Removed:
trunk/infolog/setup/etemplates.inc.php
Modified:
trunk/infolog/inc/class.infolog_bo.inc.php
trunk/infolog/inc/class.infolog_customfields.inc.php
trunk/infolog/inc/class.infolog_datasource.inc.php
trunk/infolog/inc/class.infolog_export_csv.inc.php
trunk/infolog/inc/class.infolog_export_ical.inc.php
trunk/infolog/inc/class.infolog_groupdav.inc.php
trunk/infolog/inc/class.infolog_hooks.inc.php
trunk/infolog/inc/class.infolog_ical.inc.php
trunk/infolog/inc/class.infolog_import_ical.inc.php
trunk/infolog/inc/class.infolog_import_infologs_csv.inc.php
trunk/infolog/inc/class.infolog_merge.inc.php
trunk/infolog/inc/class.infolog_so.inc.php
trunk/infolog/inc/class.infolog_tracking.inc.php
trunk/infolog/inc/class.infolog_ui.inc.php
trunk/infolog/inc/class.infolog_widget.inc.php
trunk/infolog/inc/class.infolog_wizard_export_csv.inc.php
trunk/infolog/inc/class.infolog_wizard_import_infologs_csv.inc.php
trunk/infolog/inc/class.infolog_zpush.inc.php
trunk/infolog/index.php
trunk/infolog/setup/setup.inc.php
trunk/infolog/setup/tables_update.inc.php
— trunk/infolog/inc/class.infolog_bo.inc.php (original)
+++ trunk/infolog/inc/class.infolog_bo.inc.php Sat Apr 30 19:05:23 2016
@@ -11,13 +11,21 @@
-define(‘EGW_ACL_UNDELETE’,EGW_ACL_CUSTOM_1); // undelete right
+use EGroupware\Api;
+use EGroupware\Api\Link;
+use EGroupware\Api\Acl;
+use EGroupware\Api\Vfs;
/**
- This class is the BO-layer of InfoLog
*/
class infolog_bo
{
- /**
-
- */
- const ACL_UNDELETE = Acl::CUSTOM1;
- var $enums;
var $status;
/**
@@ -204,7 +212,7 @@
‘ongoing’ => ‘ongoing’, // iCal has no status on notes
’done’ => ‘done’ ),
);
@@ -226,7 +234,7 @@
}
if ($config_data[‘group_owners’]) $this->group_owners = $config_data[‘group_owners’];
@@ -244,7 +252,7 @@
$save_config = true;
}
}
@@ -278,7 +286,7 @@
$this->user = $GLOBALS[‘egw_info’][‘user’][‘account_id’];
$this->now = time();
-
$this->user_time_now = Api\DateTime::server2user($this->now,'ts');
$this->grants = $GLOBALS['egw']->acl->get_grants('infolog',$this->group_owners ? $this->group_owners : true);
$this->so = new infolog_so($this->grants);
@@ -297,17 +305,13 @@
* checks if there are customfields for typ $typ
*
* @param string $type
- function has_customfields($type)
- {
foreach($this->customfields as $field)
{
-
if ((!$type || empty($field['type2']) || in_array($type,is_array($field['type2']) ? $field['type2'] : explode(',',$field['type2']))) &&
-
(!$links || in_array($field['type'],$link_types)))
-
if ((!$type || empty($field['type2']) || in_array($type,is_array($field['type2']) ? $field['type2'] : explode(',',$field['type2']))))
{
return True;
}
@@ -319,7 +323,7 @@
* check’s if user has the requiered rights on entry $info_id
*
* @param int|array $info data or info_id of infolog entry to check
-
-
@param int $required_rights EGW_ACL_{READ|EDIT|ADD|DELETE}
-
-
@param int $required_rights ACL::{READ|EDIT|ADD|DELETE}|infolog_bo::ACL_UNDELETE
-
@param int $other uid to check (if info==0) or 0 to check against $this->user
-
@param int $user = null user whos rights to check, default current user
-
@return boolean
@@ -356,14 +360,14 @@
if (!is_array($info) && !($info = $this->so->read(array(‘info_id’ => $info_id)))) return false;
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!
-
($required_rights == Acl::EDIT || // no edit rights for deleted entries
-
$required_rights == Acl::ADD || // no add rights for deleted entries
-
$required_rights == Acl::DELETE && ($this->history == 'history_no_delete' || // no delete at all!
$this->history == 'history_admin_delete' && (!isset($GLOBALS['egw_info']['user']['apps']['admin']) || $user!=$this->user)))) // delete only for admins
{
$access = false;
}
@@ -372,11 +376,11 @@
else
{
// undelete requires edit rights
-
$access = $this->so->check_access( $info,EGW_ACL_EDIT,$this->implicit_rights == 'edit',$grants,$user );
-
}
-
}
-
}
-
elseif ($required_rights == EGW_ACL_UNDELETE)
-
$access = $this->so->check_access( $info,Acl::EDIT,$this->implicit_rights == 'edit',$grants,$user );
-
}
-
}
-
}
-
elseif ($required_rights == self::ACL_UNDELETE)
{
$access = false;
}
@@ -423,7 +427,7 @@
if ($info['info_link_id'] > 0 &&
(isset($info['links']) && ($link = $info['links'][$info['info_link_id']]) || // use supplied links info
@@ -436,7 +440,7 @@
$app = $link[‘link_app’.$nr];
$id = $link[‘link_id’.$nr];
}
@@ -493,7 +497,7 @@
if ($fromTZId === $toTZId) return;
@@ -505,12 +509,12 @@
}
elseif (is_null($fromTZId))
{
@@ -522,30 +526,30 @@
}
elseif (is_null($toTZId))
{
-
$toTZ = egw_time::$server_timezone;
-
}
-
//error_log(__METHOD__.'(values[info_enddate]='.date('Y-m-d H:i:s',$values['info_enddate']).", from=".array2string($fromTZId).", to=".array2string($toTZId).") tz=".$tz->getName().', fromTZ='.$fromTZ->getName().', toTZ='.$toTZ->getName().', userTZ='.egw_time::$user_timezone->getName());
-
$toTZ = Api\DateTime::$server_timezone;
-
}
-
//error_log(__METHOD__.'(values[info_enddate]='.date('Y-m-d H:i:s',$values['info_enddate']).", from=".array2string($fromTZId).", to=".array2string($toTZId).") tz=".$tz->getName().', fromTZ='.$fromTZ->getName().', toTZ='.$toTZ->getName().', userTZ='.Api\DateTime::$user_timezone->getName());
foreach($this->timestamps as $key)
{
if ($values[$key])
{
-
$arr = egw_time::to($time,'array');
-
$time = new egw_time($arr, $toTZ);
-
$arr = Api\DateTime::to($time,'array');
-
$time = new Api\DateTime($arr, $toTZ);
}
else
{
$time->setTimezone($toTZ);
}
@@ -562,7 +566,7 @@
{
if (empty($ts) || $date_format == ‘server’) return $ts;
-
return Api\DateTime::server2user($ts,$date_format);
}
/**
@@ -596,9 +600,8 @@
{
return null;
}
-
$info_id = $data['info_id']; // in case the uid was specified
-
-
if (!$ignore_acl && !$this->check_access($data,EGW_ACL_READ)) // check behind read, to prevent a double read
@@ -640,7 +643,7 @@
{
return False;
}
@@ -649,7 +652,7 @@
{
foreach($children as $id => $owner)
{
-
if ($delete_children && $this->so->grants[$owner] & Acl::DELETE)
{
$this->delete($id,$delete_children,$new_parent,$skip_notification); // call ourself recursive to delete the child
}
@@ -674,13 +677,13 @@
$this->so->write($deleted);
-
egw_link::unlink(0,'infolog',$info_id,'','!file','',true); // keep the file attachments, hide the rest
-
Link::unlink(0,'infolog',$info_id,'','!file','',true); // keep the file attachments, hide the rest
}
else
{
$this->so->delete($info_id,false); // we delete the children via bo to get all notifications!
@@ -717,8 +720,8 @@
{
$values = $values_in;
//echo “boinfolog::write()values=”; _debug_array($values);
-
if (!$values['info_id'] && !$this->check_access(0,EGW_ACL_EDIT,$values['info_owner']) &&
-
!$this->check_access(0,EGW_ACL_ADD,$values['info_owner']))
-
if (!$values['info_id'] && !$this->check_access(0,Acl::EDIT,$values['info_owner']) &&
-
!$this->check_access(0,Acl::ADD,$values['info_owner']))
{
return false;
}
@@ -728,7 +731,7 @@
$old = $this->read($values[‘info_id’], false, ‘server’);
}
@@ -744,11 +747,11 @@
}
if (!$status_only && $values[‘info_status’] != ‘deleted’)
{
-
$status_only = $undelete = $this->check_access($values['info_id'],EGW_ACL_UNDELETE);
-
}
-
}
-
if ($values['info_id'] && !$this->check_access($values['info_id'],EGW_ACL_EDIT) && !$status_only ||
-
!$values['info_id'] && $values['info_id_parent'] && !$this->check_access($values['info_id_parent'],EGW_ACL_ADD))
-
$status_only = $undelete = $this->check_access($values['info_id'],self::ACL_UNDELETE);
-
}
-
}
-
if ($values['info_id'] && !$this->check_access($values['info_id'],Acl::EDIT) && !$status_only ||
-
!$values['info_id'] && $values['info_id_parent'] && !$this->check_access($values['info_id_parent'],Acl::ADD))
{
return false;
}
@@ -851,7 +854,7 @@
// Check required custom fields
if($throw_exception)
{
-
$custom = Api\Storage\Customfields::get('infolog');
foreach($custom as $c_name => $c_field)
{
if($c_field['type2']) $type2 = is_array($c_field['type2']) ? $c_field['type2'] : explode(',',$c_field['type2']);
@@ -860,7 +863,7 @@
// Required custom field
if(!$values[’#’.$c_name])
{
-
throw new egw_exception_wrong_userinput(lang('For infolog type %1, %2 is required',lang($values['info_type']),$c_field['label']));
-
throw new Api\Exception\WrongUserinput(lang('For infolog type %1, %2 is required',lang($values['info_type']),$c_field['label']));
}
}
}
@@ -869,10 +872,10 @@
if (isset($this->group_owners[$values[‘info_type’]]))
{
$values[‘info_owner’] = $this->group_owners[$values[‘info_type’]];
-
if (!($this->grants[$this->group_owners[$values['info_type']]] & EGW_ACL_EDIT))
-
{
-
if (!$this->check_access($values['info_id'],EGW_ACL_EDIT) ||
-
!$values['info_id'] && !$this->check_access($values,EGW_ACL_ADD)
-
if (!($this->grants[$this->group_owners[$values['info_type']]] & Acl::EDIT))
-
{
-
if (!$this->check_access($values['info_id'],Acl::EDIT) ||
-
!$values['info_id'] && !$this->check_access($values,Acl::ADD)
)
{
return false; // no edit rights from the group-owner and no implicit rights (delegated and sufficient rights)
@@ -950,11 +953,11 @@
// Check for restore of deleted entry, restore held links
if($old[‘info_status’] == ‘deleted’ && $values[‘info_status’] != ‘deleted’)
{
@@ -1056,7 +1059,7 @@
{
if (!empty($query[‘col_filter’][$key]))
{
@@ -1069,7 +1072,7 @@
{
foreach ($ret as $id => &$data)
{
@@ -1079,21 +1082,21 @@
{
if ($data[$key])
{
-
$arr = egw_time::to($time,'array');
-
$time = new egw_time($arr, egw_time::$user_timezone);
-
$arr = Api\DateTime::to($time,'array');
-
$time = new Api\DateTime($arr, Api\DateTime::$user_timezone);
}
else
{
@@ -1161,7 +1164,7 @@
‘info_addr’ => implode(’, ',$emails),
‘info_subject’ => $_subject,
‘info_des’ => $_message,
-
'info_startdate' => Api\DateTime::server2user($_date),
'info_status' => $status,
'info_priority' => 1,
'info_percent' => $status == 'done' ? 100 : 0,
@@ -1173,7 +1176,7 @@
);
if ($GLOBALS[‘egw_info’][‘user’][‘preferences’][‘infolog’][‘cat_add_default’]) $info[‘info_cat’] = $GLOBALS[‘egw_info’][‘user’][‘preferences’][‘infolog’][‘cat_add_default’];
// find the addressbookentry to link with
@@ -1196,7 +1199,7 @@
// create the rest a “ordinary” links
foreach ($contacts as $contact)
{
-
Link::link('infolog',$info['link_to']['to_id'],'addressbook',$contact['id']);
}
}
if (is_array($_attachments))
@@ -1205,12 +1208,12 @@
{
if($attachment[‘egw_data’])
{
-
Link::link('infolog',$info['link_to']['to_id'],Link::DATA_APPNAME, $attachment);
}
else if(is_readable($attachment['tmp_name']) ||
-
(egw_vfs::is_readable($attachment['tmp_name']) && parse_url($attachment['tmp_name'], PHP_URL_SCHEME) === 'vfs'))
-
{
-
egw_link::link('infolog',$info['link_to']['to_id'],'file', $attachment);
-
(Vfs::is_readable($attachment['tmp_name']) && parse_url($attachment['tmp_name'], PHP_URL_SCHEME) === 'vfs'))
-
{
-
Link::link('infolog',$info['link_to']['to_id'],'file', $attachment);
}
}
}
@@ -1294,7 +1297,7 @@
* Check access to the file store
*
* @param int|array $id id of entry or entry array
-
-
@param int $check EGW_ACL_READ for read and EGW_ACL_EDIT for write or delete access
-
-
@param int $check Acl::READ for read and Acl::EDIT for write or delete access
-
@param string $rel_path = null currently not used in InfoLog
-
@param int $user = null for which user to check, default current user
-
@return boolean true if access is granted or false otherwise
@@ -1312,10 +1315,10 @@
*/
function set_link_cache(array $info)
{
-
$this->file_access($info,EGW_ACL_EDIT) ? EGW_ACL_READ|EGW_ACL_EDIT :
-
($this->file_access($info,EGW_ACL_READ) ? EGW_ACL_READ : 0));
-
$this->file_access($info,Acl::EDIT) ? EGW_ACL_READ|EGW_ACL_EDIT :
-
($this->file_access($info,Acl::READ) ? Acl::READ : 0));
}
/**
@@ -1334,7 +1337,7 @@
{
return False;
}
@@ -1357,12 +1360,12 @@
{
foreach ($infos as $info)
{
@@ -1372,10 +1375,10 @@
$status => ‘status’
) as $icon => $default)
{
-
$icons[common::image('infolog',$icon) ? $icon : $default] = $icon;
-
}
-
$content[] = html::a_href($title,$view);
-
$html = html::table(array(1 => $content));
-
$icons[Api\Image::find('infolog',$icon) ? $icon : $default] = $icon;
-
}
-
$content[] = Api\Html::a_href($title,$view);
-
$html = Api\Html::table(array(1 => $content));
$to_include[] = array(
'starttime' => $info['info_startdate'],
@@ -1421,8 +1424,8 @@
‘ongoing’ : ‘infolog/’.$row[‘info_status’],
‘class’ => $row[‘info_id_parent’] ? ‘infolog_rowHasParent’ : null,
);
-
if (common::image('infolog', $icon=$row['info_type'].'_element') ||
-
common::image('infolog', $icon=$row['info_type']))
-
if (Api\Image::find('infolog', $icon=$row['info_type'].'_element') ||
-
Api\Image::find('infolog', $icon=$row['info_type']))
{
$infos[$row['info_id']]['icon'] = 'infolog/'.$icon;
}
@@ -1450,19 +1453,19 @@
{
if (!is_object($this->categories))
{
-
// preserve Api\Categories without users read access
$old_infolog = $this->read($info_id);
$old_categories = explode(',',$old_infolog['info_cat']);
if (is_array($old_categories) && count($old_categories) > 0)
{
foreach ($old_categories as $cat_id)
{
@@ -1518,7 +1521,7 @@
{
if (!is_object($this->categories))
{
@@ -1528,7 +1531,7 @@
$cat_list = array();
foreach($cat_id_list as $cat_id)
{
@@ -1671,13 +1674,13 @@
* X-INFOLOG-STATUS is only used, if translated to the vtodo-status gives the identical vtodo status
* --> the user did not changed it
*
-
-
@param string $vtodo_status {CANCELLED|NEEDS-ACTION|COMPLETED|IN-PROCESS}
-
-
@param string $_vtodo_status {CANCELLED|NEEDS-ACTION|COMPLETED|IN-PROCESS}
-
@param string $x_infolog_status preserved original infolog status
-
@return string
*/
@@ -1800,7 +1803,7 @@
$filter = array(‘col_filter’ => array(‘info_uid’ => $infoData[‘info_uid’]));
foreach($this->so->search($filter) as $egwData)
{
@@ -1852,7 +1855,7 @@
foreach ($this->so->search($filter) as $itemID => $egwData)
{
@@ -1925,7 +1928,7 @@
// FILE, LINE, PEAR_LOG_DEBUG);
foreach ($this->so->search($filter) as $itemID => $egwData)
{
-
if (!$this->check_access($egwData,Acl::READ)) continue;
// Horde::logMessage("findVTODO Trying\n"
// . print_r($egwData, true),
// __FILE__, __LINE__, PEAR_LOG_DEBUG);
@@ -1947,8 +1950,8 @@
if (isset($egwData[‘info_startdate’]) && $egwData[‘info_startdate’])
{
// We compare the date only
-
$taskTime = new egw_time($infoData['info_startdate'],egw_time::$server_timezone);
-
$egwTime = new egw_time($egwData['info_startdate'],egw_time::$server_timezone);
-
$taskTime = new Api\DateTime($infoData['info_startdate'],Api\DateTime::$server_timezone);
-
$egwTime = new Api\DateTime($egwData['info_startdate'],Api\DateTime::$server_timezone);
if ($taskTime->format('Ymd') != $egwTime->format('Ymd'))
{
if ($this->log)
@@ -1992,8 +1995,8 @@
if (isset($egwData[‘info_enddate’]) && $egwData[‘info_enddate’])
{
// We compare the date only
-
$taskTime = new egw_time($infoData['info_enddate'],egw_time::$server_timezone);
-
$egwTime = new egw_time($egwData['info_enddate'],egw_time::$server_timezone);
-
$taskTime = new Api\DateTime($infoData['info_enddate'],Api\DateTime::$server_timezone);
-
$egwTime = new Api\DateTime($egwData['info_enddate'],Api\DateTime::$server_timezone);
if ($taskTime->format('Ymd') != $egwTime->format('Ymd'))
{
if ($this->log)
@@ -2021,8 +2024,8 @@
if (isset($egwData[‘info_datecompleted’]) && $egwData[‘info_datecompleted’])
{
// We compare the date only
-
$taskTime = new egw_time($infoData['info_datecompleted'],egw_time::$server_timezone);
-
$egwTime = new egw_time($egwData['info_datecompleted'],egw_time::$server_timezone);
-
$taskTime = new Api\DateTime($infoData['info_datecompleted'],Api\DateTime::$server_timezone);
-
$egwTime = new Api\DateTime($egwData['info_datecompleted'],Api\DateTime::$server_timezone);
if ($taskTime->format('Ymd') != $egwTime->format('Ymd'))
{
if ($this->log)
— trunk/infolog/inc/class.infolog_customfields.inc.php (original)
+++ trunk/infolog/inc/class.infolog_customfields.inc.php Sat Apr 30 19:05:23 2016
@@ -5,10 +5,13 @@
+use EGroupware\Api;
+use EGroupware\Api\Etemplate;
require_once(EGW_INCLUDE_ROOT . ‘/admin/inc/class.customfields.inc.php’);
/**
@@ -26,7 +29,7 @@
/**
* instance of the config class for infolog
*
-
-
@var Api\Config
/
var $config_data;
/*
@@ -39,12 +42,12 @@
function __construct( )
{
parent::__construct(‘infolog’);
-
$this->config_data = Api\Config::read('infolog');
$this->fields = &$this->bo->customfields;
$this->group_owners =& $this->bo->group_owners;
}
@@ -55,6 +58,8 @@
*/
protected function app_index(&$content, &$sel_options, &$readonlys, &$preserve)
{
-
unset($sel_options); // not used, but required by function signature
-
$n = 0;
foreach($this->status[$this->content_type] as $name => $label)
{
@@ -83,7 +88,6 @@
function update_fields(&$content)
{
@@ -129,8 +133,8 @@
{
foreach(explode("\n",$field[‘values’]) as $line)
{
-
list($var2,$value) = explode('=',trim($line),2);
-
$var = trim($var2);
$values[$var] = empty($value) ? $var : $value;
}
}
@@ -156,7 +160,7 @@
uasort($this->fields,sort_by_order);
$n = 0;
@@ -265,7 +269,7 @@
}
else
{
@@ -285,15 +289,15 @@
$this->save_repository();
return $new_name;
}
- function save_repository()
{
// save changes to repository
-
egw_customfields::save('infolog', $this->fields);
-
config::save_value('group_owners',$this->group_owners,'infolog');
-
Api\Storage\Customfields::save('infolog', $this->fields);
-
Api\Config::save_value('group_owners',$this->group_owners,'infolog');
}
}
— trunk/infolog/inc/class.infolog_datasource.inc.php (original)
+++ trunk/infolog/inc/class.infolog_datasource.inc.php Sat Apr 30 19:05:23 2016
@@ -6,10 +6,13 @@
+use EGroupware\Api\Link;
+use EGroupware\Api\Acl;
include_once(EGW_INCLUDE_ROOT.’/projectmanager/inc/class.datasource.inc.php’);
@@ -93,11 +96,13 @@
*
* @param array $element source project element representing an InfoLog entry, $element[‘pe_app_id’] = info_id
* @param int $target target project id
-
-
@param array $target_data=null data of target-project, atm not used by the infolog datasource
-
-
@param array $extra =null data of target-project, atm not used by the infolog datasource
-
@return array/boolean array(info_id,link_id) on success, false otherwise
*/
function copy($element,$target,$extra=null)
{
-
unset($extra); // not used, but required by function signature
-
$info =& $this->infolog_bo->read((int) $element['pe_app_id']);
if (!is_array($info)) return false;
@@ -116,11 +121,11 @@
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
-
$old_link = $info['info_link_id'] ? egw_link::get_link($info['info_link']) : $info['info_link'];
-
$info['info_link_id'] = egw_link::link('projectmanager',$target,'infolog',$info['info_id'],$element['pe_remark'],0,0,1);
-
$old_link = $info['info_link_id'] ? Link::get_link($info['info_link']) : $info['info_link'];
-
$info['info_link_id'] = Link::link('projectmanager',$target,'infolog',$info['info_id'],$element['pe_remark'],0,0,1);
if (!$info['info_from'] || $old_link && $info['info_from'] == $old_link['title'])
{
@@ -129,14 +134,14 @@
$this->infolog_bo->write($info);
// creating again all links, beside the one to the source-project
-
egw_link::link('infolog',$info['info_id'],$link['app'],$link['id'],$link['remark']);
-
Link::link('infolog',$info['info_id'],$link['app'],$link['id'],$link['remark']);
}
$ret = array($info['info_id'],$info['info_link_id']);
@@ -181,7 +186,7 @@
$GLOBALS[‘infolog_bo’] = new infolog_bo();
}
// dont delete infolog, which are linked to other elements, but their project
@@ -198,7 +203,7 @@
function change_status($id,$status)
{
//error_log(“datasource_infolog::change_status($id,$status)”);
-
if (($info = $this->infolog_bo->read($id)) && $this->infolog_bo->check_access($info,Acl::EDIT))
{
if ($status == 'active' && in_array($info['info_status'],array('template','nonactive','archive')))
{
— trunk/infolog/inc/class.infolog_export_csv.inc.php (original)
+++ trunk/infolog/inc/class.infolog_export_csv.inc.php Sat Apr 30 19:05:23 2016
@@ -1,6 +1,6 @@
<?php
/**
- * eGroupWare
+ * EGroupware Infolog - export plugin
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package infolog
@@ -11,6 +11,9 @@
* @version $Id$
*/
+use EGroupware\Api;
+use EGroupware\Api\Link;
+
/**
* export plugin of infolog
*/
@@ -18,7 +21,7 @@
public function __construct() {
- translation::add_app('infolog');
+ Api\Translation::add_app('infolog');
$this->bo = new infolog_bo();
$this->get_selects();
}
@@ -42,7 +45,7 @@
switch($options['selection'])
{
case 'search':
- $query = array_merge((array)$GLOBALS['egw']->session->appsession('session_data','infolog'), $query);
+ $query = array_merge((array)Api\Cache::getSession('infolog', 'session_data'), $query);
// Fall through
case 'filter':
case 'all':
@@ -94,7 +97,7 @@
if($row[$field]) $cf_preload[$app][] = $row[$field];
}
if($cf_preload[$app]){
- $selects[$field] = egw_link::titles($app, $cf_preload[$app]);
+ $selects[$field] = Link::titles($app, $cf_preload[$app]);
//error_log('Preload ' . $field . '['.$app . ']: ' . implode(',',$cf_preload[$app]));
}
}
@@ -104,7 +107,7 @@
} while($query['start'] < $query['total']);
return $this->export_object;
- break;
+
default:
$ids = $selection = explode(',',$options['selection']);
$this->export_records($this->export_object, $options, $selection, $ids);
@@ -118,22 +121,22 @@
// Pre-load links all at once
if($ids && $options['mapping']['info_link_id'])
{
- $links = egw_link::get_links_multiple('infolog', $ids, true, '!'.egw_link::VFS_APPNAME);
+ $links = Link::get_links_multiple('infolog', $ids, true, '!'.Link::VFS_APPNAME);
foreach($links as $id => $link) {
if(!is_array($selection[$id])) break;
$selection[$id]['info_link_id'] = $link;
- if($options['convert']) $selection[$id]['info_link_id'] = egw_link::title($link['app'], $link['id']);
+ if($options['convert']) $selection[$id]['info_link_id'] = Link::title($link['app'], $link['id']);
}
}
// If exporting PM fields, pre-load them all at once
if($ids && ($options['mapping']['pm_id'] || $options['mapping']['project']))
{
- $projects = egw_link::get_links_multiple('infolog', $ids, true, 'projectmanager');
+ $projects = Link::get_links_multiple('infolog', $ids, true, 'projectmanager');
foreach($projects as $id => $links)
{
if(!is_array($selection[$id])) break;
$selection[$id]['pm_id'] = current($links);
- $selection[$id]['project'] = egw_link::title('projectmanager', $selection[$id]['pm_id']);
+ $selection[$id]['project'] = Link::title('projectmanager', $selection[$id]['pm_id']);
$this->selects['pl_id'] = ExecMethod('projectmanager.projectmanager_pricelist_bo.pricelist',$selection[$id]['pm_id']);
}
}
@@ -141,11 +144,11 @@
foreach ($selection as $_identifier) {
if(!is_array($_identifier)) {
$record = new infolog_egw_record($_identifier);
- if($link = $links[$record->info_id]) $record->info_link_id = $options['convert'] ? egw_link::title($link['app'], $link['id']) : $link;
- if($project = $projects[$record->info_id])
+ if(($link = $links[$record->info_id])) $record->info_link_id = $options['convert'] ? Link::title($link['app'], $link['id']) : $link;
+ if(($project = $projects[$record->info_id]))
{
$record->pm_id = current($project);
- $record->project = egw_link::title('projectmanager', $record->pm_id);
+ $record->project = Link::title('projectmanager', $record->pm_id);
}
} else {
$record = new infolog_egw_record();
@@ -249,7 +252,7 @@
foreach($filters as $field_name => &$settings)
{
if($this->selects[$field_name]) $settings['values'] = $this->selects[$field_name];
-
+
// Infolog can't handle ranges in custom fields due to the way searching is done.
if(strpos($field_name, '#') === 0 && strpos($settings['type'],'date') === 0) unset($filters[$field_name]);
}
Modified: trunk/infolog/inc/class.infolog_export_ical.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/infolog/inc/class.infolog_export_ical.inc.php?rev=55955&r1=55954&r2=55955&view=diff
==============================================================================
--- trunk/infolog/inc/class.infolog_export_ical.inc.php (original)
+++ trunk/infolog/inc/class.infolog_export_ical.inc.php Sat Apr 30 19:05:23 2016
@@ -10,6 +10,8 @@
* @copyright Nathan Gray
* @version $Id$
*/
+
+use EGroupware\Api;
/**
* export iCal plugin of infolog
@@ -25,15 +27,15 @@
$options = $_definition->plugin_options;
$this->bo = new infolog_bo();
- $limit_exception = bo_merge::is_export_limit_excepted();
- if (!$limit_exception) $export_limit = bo_merge::getExportLimit('infolog');
+ $limit_exception = Api\Storage\Merge::is_export_limit_excepted();
+ if (!$limit_exception) $export_limit = Api\Storage\Merge::getExportLimit('infolog');
$ids = array();
$query = array();
switch($options['selection'])
{
case 'search':
- $query = array_merge($GLOBALS['egw']->session->appsession('session_data','infolog'), $query);
+ $query = array_merge(Api\Cache::getSession('infolog', 'session_data'), $query);
// Fall through
case 'all':
$query['num_rows'] = $export_limit ? $export_limit : -1;
Modified: trunk/infolog/inc/class.infolog_groupdav.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/infolog/inc/class.infolog_groupdav.inc.php?rev=55955&r1=55954&r2=55955&view=diff
==============================================================================
--- trunk/infolog/inc/class.infolog_groupdav.inc.php (original)
+++ trunk/infolog/inc/class.infolog_groupdav.inc.php Sat Apr 30 19:05:23 2016
@@ -5,16 +5,17 @@
* @link http://www.egroupware.org
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package infolog
- * @subpackage groupdav
+ * @subpackage caldav
* @author Ralf Becker
* @copyright (c) 2007-16 by Ralf Becker
* @version $Id$
*/
use EGroupware\Api;
+use EGroupware\Api\Acl;
/**
- * EGroupware: GroupDAV access: infolog handler
+ * EGroupware: CalDAV access: infolog handler
*
* Permanent error_log() calls should use $this->caldav->log($str) instead, to be send to PHP error_log()
* and our request-log (prefixed with "### " after request and response, like exceptions).
@@ -623,7 +624,7 @@
$action = $GLOBALS['egw_info']['user']['preferences']['groupdav']['infolog-cat-action'];
//error_log(__METHOD__.'('.array2string($task).', '.array2string($oldTask).") action=$action");
- if ($task['info_cat'] && ($new_cat = categories::id2name($task['info_cat'])) &&
+ if ($task['info_cat'] && ($new_cat = Api\Categories::id2name($task['info_cat'])) &&
strpos($new_cat, '@') !== false)
{
$new_user = $GLOBALS['egw']->accounts->name2id($new_cat, 'account_email');
@@ -633,17 +634,17 @@
if ($new_user)
{
// make sure category is global, as otherwise it will not be transmitted to other users
- if (!categories::is_global($task['info_cat']))
- {
- $cat_obj = new categories(categories::GLOBAL_ACCOUNT, 'infolog');
- $cat = categories::read($task['info_cat']);
- $cat['owner'] = categories::GLOBAL_ACCOUNT;
+ if (!Api\Categories::is_global($task['info_cat']))
+ {
+ $cat_obj = new Api\Categories(categories::GLOBAL_ACCOUNT, 'infolog');
+ $cat = Api\Categories::read($task['info_cat']);
+ $cat['owner'] = Api\Categories::GLOBAL_ACCOUNT;
$cat['access'] = 'public';
$cat_obj->edit($cat);
}
// if replace, remove user of old category from responsible
if ($action == 'replace' && $oldTask && $oldTask['info_cat'] &&
- ($old_cat = categories::id2name($oldTask['info_cat'])) && strpos($old_cat, '@') !== false &&
+ ($old_cat = Api\Categories::id2name($oldTask['info_cat'])) && strpos($old_cat, '@') !== false &&
($old_user = $GLOBALS['egw']->accounts->name2id($old_cat, 'account_email')) &&
($key = array_search($old_user, (array)$task['info_responsible'])) !== false)
{
@@ -722,7 +723,7 @@
/**
* Check if user has the neccessary rights on a task / infolog entry
*
- * @param int $acl EGW_ACL_READ, EGW_ACL_EDIT or EGW_ACL_DELETE
+ * @param int $acl Acl::READ, Acl::EDIT or Acl::DELETE
* @param array|int $task task-array or id
* @return boolean null if entry does not exist, false if no access, true if access permitted
*/
@@ -732,7 +733,7 @@
$access = $this->bo->check_access($task,$acl);
- if (!$access && $acl == EGW_ACL_EDIT && $this->bo->is_responsible($task))
+ if (!$access && $acl == Acl::EDIT && $this->bo->is_responsible($task))
{
$access = true; // access limited to $this->bo->responsible_edit fields (handled in infolog_bo::write())
}
@@ -774,7 +775,7 @@
/**
* Add extra properties for calendar collections
*
- * @param array $props =array() regular props by the groupdav handler
+ * @param array $props =array() regular props by the Api\CalDAV handler
* @param string $displayname
* @param string $base_uri =null base url of handler
* @param int $user =null account_id of owner of collection
@@ -785,7 +786,7 @@
unset($base_uri); // not used, but required by function signature
// calendar description
- $displayname = translation::convert(lang('Tasks of'),translation::charset(),'utf-8').' '.$displayname;
+ $displayname = Api\Translation::convert(lang('Tasks of'),Api\Translation::charset(),'utf-8').' '.$displayname;
$props['calendar-description'] = Api\CalDAV::mkprop(Api\CalDAV::CALDAV,'calendar-description',$displayname);
// supported components, currently only VEVENT
$props['supported-calendar-component-set'] = Api\CalDAV::mkprop(Api\CalDAV::CALDAV,'supported-calendar-component-set',array(
@@ -802,7 +803,7 @@
Api\CalDAV::mkprop(Api\CalDAV::CALDAV,'calendar-multiget',''))))),
);
// only advertice rfc 6578 sync-collection report, if "delete-prevention" is switched on (deleted entries get marked deleted but not actualy deleted
- $config = config::read('infolog');
+ $config = Api\Config::read('infolog');
if ($config['history'])
{
$props['supported-report-set']['sync-collection'] = Api\CalDAV::mkprop('supported-report',array(
@@ -842,7 +843,7 @@
{
if (!isset($hook_data['setup']))
{
- translation::add_app('infolog');
+ Api\Translation::add_app('infolog');
$infolog = new infolog_bo();
$types = $infolog->enums['type'];
}
Modified: trunk/infolog/inc/class.infolog_hooks.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/infolog/inc/class.infolog_hooks.inc.php?rev=55955&r1=55954&r2=55955&view=diff
==============================================================================
--- trunk/infolog/inc/class.infolog_hooks.inc.php (original)
+++ trunk/infolog/inc/class.infolog_hooks.inc.php Sat Apr 30 19:05:23 2016
@@ -1,14 +1,20 @@
<?php
/**
- * InfoLog - Admin-, Preferences- and SideboxMenu-Hooks
+ * EGroupware InfoLog - Admin-, Preferences- and SideboxMenu-Hooks
*
* @link http://www.egroupware.org
* @author Ralf Becker
* @package infolog
- * @copyright (c) 2003-13 by Ralf Becker
+ * @copyright (c) 2003-16 by Ralf Becker
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
+
+use EGroupware\Api;
+use EGroupware\Api\Link;
+use EGroupware\Api\Framework;
+use EGroupware\Api\Egw;
+use EGroupware\Api\Acl;
/**
* Class containing admin, preferences and sidebox-menus (used as hooks)
@@ -24,7 +30,7 @@
static function not_enum_group_acls($location)
{
unset($location); // not used, but part of hook signature
- $config = config::read('infolog');
+ $config = Api\Config::read('infolog');
return $config['group_owners'];
}
@@ -38,15 +44,6 @@
static function search_link($location)
{
unset($location); // not used, but part of hook signature
- // register our not_enum_group_acls hook, if not al