当前位置: 首页>>代码示例>>PHP>>正文


PHP ApplicationLogs::getLastActivities方法代码示例

本文整理汇总了PHP中ApplicationLogs::getLastActivities方法的典型用法代码示例。如果您正苦于以下问题:PHP ApplicationLogs::getLastActivities方法的具体用法?PHP ApplicationLogs::getLastActivities怎么用?PHP ApplicationLogs::getLastActivities使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ApplicationLogs的用法示例。


在下文中一共展示了ApplicationLogs::getLastActivities方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: explode

<?php    
    $options = explode(",",user_config_option("filters_dashboard"));
    
    $activities =  ApplicationLogs::getLastActivities();
    $limit = $options[2];
    $acts = array();
    $acts['data'] = array();
    foreach($activities as $activity){
        $user = Contacts::findById($activity->getCreatedById());
        if ($activity->getLogData() == 'member deleted') {
        	$object = Members::findById($activity->getRelObjectId());
        	$member_deleted = true;
        } else {
        	$object = Objects::findObject($activity->getRelObjectId());
        }
        
        if($object || $member_deleted){
            $key = $activity->getRelObjectId() . "-" . $activity->getCreatedById();

            if(count($acts['data']) < ($limit*2)){
                if(!array_key_exists($key, $acts['data'])){
                    $acts['data'][$key] = $object;
                    $acts['created_by'][$key] = $user;
                    $acts['act_data'][$key] = $activity->getActivityDataView($user,$object);
                    $acts['date'][$key] = $activity->getCreatedOn() instanceof DateTimeValue ? friendly_date($activity->getCreatedOn()) : lang('n/a');
                }else{
                    $acts['data'][$key] = $object;
                    $acts['created_by'][$key] = $user;
                    $acts['act_data'][$key] = $activity->getActivityDataView($user,$object,true);
                    $acts['date'][$key] = $activity->getCreatedOn() instanceof DateTimeValue ? friendly_date($activity->getCreatedOn()) : lang('n/a');
                }            
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:31,代码来源:index.php

示例2: array

            $tempParent = $x->getParentId();
            $ant = $x;
            $x = $x->getParentWorkspace();
        }
        if (!$x instanceof Project) {
            $tempParent = 0;
            $sub_wss[] = $w;
        }
    }
}
$sub_wss_csv = array();
foreach ($sub_wss as $sub_ws) {
    $sub_wss_csv[] = $sub_ws->getId();
}
$linked_object_actions = array();
$activities = ApplicationLogs::getLastActivities($ws, active_tag(), user_config_option('activity widget elements'));
$groups = array();
$first = null;
$obj_wss_cache = array();
foreach ($activities as $act) {
    $user = Users::findById($act->getCreatedById());
    $object = get_object_by_manager_and_id($act->getRelObjectId(), $act->getRelObjectManager());
    if (!$user || !$object) {
        continue;
    }
    /*		if ($user && $object && $act->getAction() != 'login' && $act->getAction() != 'logout' 
    			&& !can_access($user, $object, ACCESS_LEVEL_READ)) continue;
    */
    $avatar_url = $user->getAvatarUrl();
    $date = $act->getCreatedOn() instanceof DateTimeValue ? friendly_date($act->getCreatedOn()) : lang('n/a');
    $dontshow = false;
开发者ID:pnagaraju25,项目名称:fengoffice,代码行数:31,代码来源:widget_activity.php


注:本文中的ApplicationLogs::getLastActivities方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。