• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Activity类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: _new

 public function _new($followup = FALSE)
 {
     if (array_key_exists('followup', $this->_data)) {
         $followup = $this->_data['followup'];
     }
     $this->view->set('page_title', 'New CRM Activity');
     // New follow-up activity
     if ($followup) {
         $this->view->set('page_title', 'New CRM Follow-up Activity');
         unset($this->_data['id']);
         $activity = new Activity();
         $activity->load($followup);
         $this->_data['person_id'] = $activity->person_id;
         $this->_data['company_id'] = $activity->company_id;
         $this->_data['name'] = $activity->name;
         $this->_data['description'] = $activity->description;
         $this->_data['completed'] = '';
     }
     // Edit existing activity
     if (isset($this->_data['id'])) {
         $this->view->set('page_title', 'Edit CRM Activity');
     }
     // New activity from opportunity
     if (isset($this->_data['opportunity_id'])) {
         $this->view->set('page_title', 'New CRM Activity');
         $opportunity = DataObjectFactory::Factory('Opportunity');
         $opportunity->load($this->_data['opportunity_id']);
         $this->_data['person_id'] = $opportunity->person_id;
         $this->_data['company_id'] = $opportunity->company_id;
     }
     parent::_new();
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:32,代码来源:ActivitysController.php


示例2: logActivity

 function logActivity($action, $body = null)
 {
     $activity = new Activity($this);
     $name = $this->logName();
     $activity->body = "{$action} {$activity->target_class} {$activity->target_id}" . ($name ? ", \"{$name}\"" : "");
     $activity->save();
 }
开发者ID:broofa,项目名称:socipedia,代码行数:7,代码来源:basemodel.php


示例3: load

 /**
  * load in the Activities for the given SQL statement
  *
  * @param string $sql
  * @param array $params the parameters that go into the sql statement
  * @param String $style (optional - default 'long') may be 'short' or 'long' or 'cif'
  * @return ActivitySet (this)
  */
 function load($sql, $params, $style = 'long')
 {
     global $DB;
     if (!isset($params)) {
         $params = array();
     }
     // get records
     $resArray = $DB->select($sql, $params);
     if ($resArray !== false) {
         $count = count($resArray);
         for ($i = 0; $i < $count; $i++) {
             $array = $resArray[$i];
             $a = new Activity();
             $xml = $array['XML'];
             $activity = $a->load($array['ItemID'], $array['UserID'], $array['Type'], $array['ModificationDate'], $array['ChangeType'], $xml, $style);
             if (!$activity instanceof Error) {
                 $this->add($a);
             }
         }
         $this->totalno = count($this->activities);
     } else {
         return database_error();
     }
     return $this;
 }
开发者ID:uniteddiversity,项目名称:DebateHub,代码行数:33,代码来源:activityset.class.php


示例4: log

 function log($activity)
 {
     $act = new Activity();
     $act->message = $activity;
     $act->user_id = Auth::user()->id;
     $act->save();
 }
开发者ID:carriercomm,项目名称:saaspanel,代码行数:7,代码来源:Activity.php


示例5: store

 /**
  * Store to the database the given entities as entities decendent from the given
  * document.
  * 
  * @param $document Parent document -- Must be a document entity on the database.
  * @param $entities List of entities to be created as decendents from the given document. 
  * 
  * @return multitype:string A status array containing the result status information.
  */
 public function store($parent, $units, $type)
 {
     if (count($units) <= 0 && count($units) >= 10000) {
         // We will have problems processing empty files or more than 10,000 entities
         return ['error' => 'Unable to process files with more than 10,000 lines: ' . $nEnts . 'found'];
     }
     $activity = new \Activity();
     $activity->softwareAgent_id = $this->softwareComponent->_id;
     $activity->save();
     $entities = [];
     foreach ($units as $unit) {
         try {
             $entity = new Unit();
             $entity->project = $parent->project;
             $entity->activity_id = $activity->_id;
             $entity->documentType = $type;
             $entity->parents = [$parent->_id];
             $entity->content = $unit;
             $entity->hash = md5(serialize($entity));
             $entity->save();
             array_push($entities, $entity);
         } catch (Exception $e) {
             foreach ($entities as $en) {
                 $en->forceDelete();
             }
             throw $e;
         }
     }
     \Temp::truncate();
     return ['success' => 'Sentences created successfully'];
 }
开发者ID:crowdtruth,项目名称:crowdtruth,代码行数:40,代码来源:TextSentencePreprocessor.php


示例6: boot

 public static function boot()
 {
     parent::boot();
     static::creating(function ($workerunit) {
         //    dd($workerunit);
         // Inherit type, domain and format
         if (empty($workerunit->type) or empty($workerunit->domain) or empty($workerunit->format)) {
             $j = Job::where('_id', $workerunit->job_id)->first();
             $workerunit->type = $j->type;
             $workerunit->domain = $j->domain;
             $workerunit->format = $j->format;
         }
         $workerunit->annotationVector = $workerunit->createAnnotationVector();
         // Activity if not exists
         if (empty($workerunit->activity_id)) {
             try {
                 $activity = new Activity();
                 $activity->label = "Workerunit is saved.";
                 $activity->softwareAgent_id = $workerunit->softwareAgent_id;
                 $activity->save();
                 $workerunit->activity_id = $activity->_id;
                 Log::debug("Saving workerunit {$workerunit->_id} with activity {$workerunit->activity_id}.");
             } catch (Exception $e) {
                 if ($activity) {
                     $activity->forceDelete();
                 }
                 //if($workerunit) $workerunit->forceDelete();
                 throw new Exception('Error saving activity for workerunit.');
             }
         }
     });
 }
开发者ID:harixxy,项目名称:CrowdTruth,代码行数:32,代码来源:Workerunit.php


示例7: update

 public function update($id, $data)
 {
     $action = $this->params()->fromQuery('action');
     $project = $this->find('\\User\\Entity\\Project', $id);
     if ($action == 1) {
         $project->setData(['tax' => $data['tax'], 'discount' => $data['discount']]);
         $project->save($this->getEntityManager());
     }
     if ($action == 2) {
         $project->setData(['status' => 2]);
         $project->save($this->getEntityManager());
         $activity = new Activity();
         $activity->setData(['activityDate' => new \DateTime('NOW'), 'project' => $project, 'type' => "accept_quote", 'sender' => $this->getReference('\\User\\Entity\\User', $data['client']['id'])]);
         //$activity->save($this->getEntityManager());
     }
     if ($action == 3) {
         $arr = [];
         foreach ($data['types'] as $type) {
             $arr[] = $type['id'];
         }
         $data['types'] = $arr;
         $project->setData(['tax' => $data['tax'], 'discount' => $data['discount'], 'duration' => $data['duration'], 'serviceLevel' => $data['serviceLevel'], 'types' => $data['types']]);
         $project->save($this->getEntityManager());
     }
     return new JsonModel(['project' => $project->getData()]);
 }
开发者ID:papertask,项目名称:papertask,代码行数:26,代码来源:FileController.php


示例8: get

 function get($criteria = null)
 {
     $user = current_user();
     $projects = new Project();
     $activity = new Activity();
     $this->projects = $projects->get();
     $this->activity = $activity->get();
 }
开发者ID:neevan1e,项目名称:Done,代码行数:8,代码来源:dashboard.php


示例9: afterFind

 function afterFind(\Model $model, $results, $primary)
 {
     parent::afterFind($model, $results, $primary);
     if ($model->id) {
         $data = array('model' => $model->alias, 'model_id' => $model->id, 'activity_type' => 'R', 'user_id' => $model->loginUser['id']);
         $activity = new Activity();
         $activity->save($data);
     }
 }
开发者ID:khaled-saiful-islam,项目名称:zen_v1.0,代码行数:9,代码来源:ActivityBehavior.php


示例10: getOldActivity

 protected function getOldActivity($subject, $created)
 {
     $activity = new Activity(['subject_id' => $subject->getKey(), 'subject_type' => get_class($subject), 'user_id' => 1, 'name' => 'created_post']);
     $time = Carbon::createFromTimestamp($created)->toDateTimeString();
     $activity->setCreatedAt($time);
     $activity->setUpdatedAt($time);
     $activity->save();
     return $activity;
 }
开发者ID:kenarkose,项目名称:chronicle,代码行数:9,代码来源:ChronicleTest.php


示例11: actionActivity

 public function actionActivity()
 {
     $model = new Activity('search');
     $model->with('users');
     $model->unsetAttributes();
     if (isset($_GET['Activity'])) {
         $model->attributes = $_GET['Activity'];
     }
     $this->render('activity', array('model' => $model));
 }
开发者ID:equa2k9,项目名称:jazz,代码行数:10,代码来源:DashboardController.php


示例12: op_activity_body_filter

/**
 * op_activity_body_filter
 *
 * @param Activity $activity
 * @param boolean  $is_auto_link
 * @return string
 */
function op_activity_body_filter($activity, $is_auto_link = true)
{
    $body = $activity->getBody();
    if ($activity->getTemplate()) {
        $config = $activity->getTable()->getTemplateConfig();
        if (!isset($config[$activity->getTemplate()])) {
            return '';
        }
        $params = array();
        foreach ($activity->getTemplateParam() as $key => $value) {
            $params[$key] = $value;
        }
        $body = __($config[$activity->getTemplate()], $params);
        $event = sfContext::getInstance()->getEventDispatcher()->filter(new sfEvent(null, 'op_activity.template.filter_body'), $body);
        $body = $event->getReturnValue();
    }
    $event = sfContext::getInstance()->getEventDispatcher()->filter(new sfEvent(null, 'op_activity.filter_body'), $body);
    $body = $event->getReturnValue();
    if (false === strpos($body, '<a') && $activity->getUri()) {
        return link_to($body, $activity->getUri());
    }
    if ($is_auto_link) {
        if ('mobile_frontend' === sfConfig::get('sf_app')) {
            return op_auto_link_text_for_mobile($body);
        }
        return op_auto_link_text($body);
    }
    return $body;
}
开发者ID:te-koyama,项目名称:openpne,代码行数:36,代码来源:opActivityHelper.php


示例13: pay

 public function pay($tid)
 {
     $trade = $this->getOne($tid);
     if (!empty($trade) && $trade['status'] == 'created') {
         $this->touch($tid, 'paid');
         require_once MB_ROOT . '/source/Activity.class.php';
         $a = new Activity();
         $activity = $a->getOne($trade['activity']);
         $this->pool($trade['activity'], $activity['tag']['price']);
     }
 }
开发者ID:6662680,项目名称:qday_wx,代码行数:11,代码来源:Game.class.php


示例14: createFromXML

 /**
  * Convert the raw XML into an object
  *
  * @param \SimpleXMLElement $xml
  * @return Activity
  */
 public static function createFromXML(\SimpleXMLElement $xml)
 {
     $activity = new Activity();
     if (isset($xml->attributes()['count'])) {
         $activity->setCount((int) $xml->attributes()['count']);
     }
     if (isset($xml->attributes()['type'])) {
         $activity->setType((string) $xml->attributes()['type']);
     }
     return $activity;
 }
开发者ID:tijsverkoyen,项目名称:uitdatabank,代码行数:17,代码来源:Activity.php


示例15: pay

 public function pay(Order $order, Activity $activity, $lang)
 {
     $activity_data = $activity->get_activity_data();
     $info = model('wt_payment_info')->get_one(array('activity_id' => $activity_data['activity_id']));
     if (!$info) {
         $ret['r'] = 'error';
         $ret['msg'] = '50004:Payment Info get failed.';
     }
     $data = array();
     $data['payment_info'] = $lang == 'en' ? $info['info_en'] : $info['info_zh'];
     return $this->generate_html($data);
 }
开发者ID:WSKINGS,项目名称:chat_tickets,代码行数:12,代码来源:horwath.class.php


示例16: social_news

function social_news()
{
    global $db;
    $news = array();
    $actvity_obj = new Activity();
    $activities = $actvity_obj->getFriendsActivities($_SESSION['member_id']);
    foreach ($activities as $row) {
        $link_title = printSocialName($row['member_id']) . ' ' . $row['title'];
        $news[] = array('time' => $row['created_date'], 'object' => $row, 'thumb' => 'images/home-directory_sm.png', 'link' => '<span title="' . strip_tags($link_title) . '">' . $link_title . "</span>");
    }
    return $news;
}
开发者ID:vicentborja,项目名称:ATutor,代码行数:12,代码来源:module_news.php


示例17: addActivities

 /**
  * Adds activities
  *
  * @return Redirect
  * @author Dan Cox
  */
 public function addActivities($id)
 {
     $schedule = DB::find('Schedule', $id);
     $activity = new Activity();
     $activity->setLabel(Input::get('label'))->setHours(Input::has('hours') ? Input::get('hours') : NULL)->setDay(Input::has('day') ? Input::get('day') : NULL)->setTimes(Input::has('times') ? Input::get('times') : NULL);
     $errors = Validator::make($activity);
     if (count($errors) > 0) {
         return Redirect::route('page.addActivities', ['id' => $id])->withInput()->withErrors($errors)->send();
     }
     $activity->setSchedule($schedule);
     DB::save($activity);
     return Redirect::route('page.activities', ['id' => $id])->with('success', 'Successfully added new activity')->send();
 }
开发者ID:Danzabar,项目名称:schedules,代码行数:19,代码来源:ActivityController.php


示例18: TraceIncomingCall

function TraceIncomingCall()
{
    require_once 'include/utils/utils.php';
    global $adb, $current_user;
    global $theme, $app_strings;
    $theme_path = "themes/" . $theme . "/";
    $image_path = $theme_path . "images/";
    $sql = "select * from vtiger_asteriskextensions where userid = " . $current_user->id;
    $result = $adb->query($sql);
    $asterisk_extension = $adb->query_result($result, 0, "asterisk_extension");
    $query = "select * from vtiger_asteriskincomingcalls where to_number = " . $asterisk_extension;
    $result = $adb->query($query);
    if ($adb->num_rows($result) > 0) {
        $callerNumber = $adb->query_result($result, 0, "from_number");
        $callerName = $adb->query_result($result, 0, "from_name");
        $callerType = $adb->query_result($result, 0, "callertype");
        if (!empty($callerType)) {
            $caller = getCallerName("{$callerType}:" . $callerNumber);
        } else {
            $caller = getCallerName($callerNumber);
        }
        $adb->query("delete from vtiger_asteriskincomingcalls where to_number = " . $asterisk_extension);
        //prepare the div for incoming calls
        $status = "\t<table  border='0' cellpadding='5' cellspacing='0'>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td style='padding:10px;' colspan='2'><b>Incoming Call</b></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t\t<table  border='0' cellpadding='0' cellspacing='0' class='hdrNameBg'>\n\t\t\t\t\t\t<tr><td style='padding:10px;' colspan='2'><b>Caller Information</b>\n\t\t\t\t\t\t\t<br><b>Number:</b> {$callerNumber}\n\t\t\t\t\t\t\t<br><b>Name:</b> {$callerName}\n\t\t\t\t\t\t</td></tr>\n\t\t\t\t\t\t<tr><td style='padding:10px;' colspan='2'><b>Information from vtigerCRM</b>\n\t\t\t\t\t\t\t<br>{$caller}\n\t\t\t\t\t\t</td></tr>\n\t\t\t\t\t</table>";
        require_once 'modules/Calendar/Activity.php';
        $focus = new Activity();
        $focus->column_fields['subject'] = "Incoming call from {$callerName} ({$callerNumber})";
        $focus->column_fields['activitytype'] = "Call";
        $focus->column_fields['date_start'] = date('Y-m-d');
        $focus->column_fields['due_date'] = date('Y-m-d');
        $focus->column_fields['time_start'] = date('H:i');
        $focus->column_fields['time_end'] = date('H:i');
        $focus->column_fields['eventstatus'] = "Held";
        $focus->column_fields['assigned_user_id'] = $current_user->id;
        $focus->save('Calendar');
        $callerInfo = getCallerInfo("{$callerType}:" . $callerNumber);
        if ($callerInfo == false) {
            $callerInfo = getCallerInfo(getStrippedNumber($callerNumber));
        }
        if ($callerInfo != false) {
            $tablename = array('Contacts' => 'vtiger_cntactivityrel', 'Accounts' => 'vtiger_seactivityrel', 'Leads' => 'vtiger_seactivityrel');
            $sql = "insert into " . $tablename[$callerInfo['module']] . " values (?,?)";
            $params = array($callerInfo[id], $focus->id);
            $adb->pquery($sql, $params);
        }
    } else {
        $status = "failure";
    }
    return $status;
}
开发者ID:vtiger-jp,项目名称:vtigercrm-5.1.x-ja,代码行数:50,代码来源:TraceIncomingCall.php


示例19: testActivityCRUD

 /**
  * Test Activity
  */
 public function testActivityCRUD()
 {
     $activity = new Activity();
     $activity->_id = \app\locker\helpers\Helpers::getRandomValue();
     $activity->definition = array('type' => \app\locker\helpers\Helpers::getRandomValue(), 'name' => array('en-US' => \app\locker\helpers\Helpers::getRandomValue()), 'description' => array('en-US' => \app\locker\helpers\Helpers::getRandomValue()));
     $result = $activity->save();
     $this->assertTrue($result);
     // Load activity from db
     $aid = $activity->_id;
     $db_activity = Activity::find($aid);
     $this->assertEquals($db_activity->_id, $activity->_id);
     // Delete activity
     $db_activity->delete();
     $this->assertEquals(Activity::find($aid), NULL);
 }
开发者ID:jesposito,项目名称:learninglocker,代码行数:18,代码来源:ActivityTest.php


示例20: destroy

 public function destroy($id)
 {
     $ac = Activity::find($id);
     $ac->delete();
     Session::flash('success', 'Data telah dihapus.');
     return Redirect::to('/' . Auth::user()->role . '/activity');
 }
开发者ID:heruujoko,项目名称:tsel-net-management,代码行数:7,代码来源:ActivityController.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP ActivityModel类代码示例发布时间:2022-05-23
下一篇:
PHP ActivitiResponseObject类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap