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


PHP DAO_Worker::get方法代码示例

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


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

示例1: _workerAssignedTask

 private function _workerAssignedTask($event)
 {
     $translate = DevblocksPlatform::getTranslationService();
     $events = DevblocksPlatform::getEventService();
     $worker_id = $event->params['worker_id'];
     $context = $event->params['context'];
     $task_id = $event->params['context_id'];
     $mail_service = DevblocksPlatform::getMailService();
     $mailer = null;
     // lazy load
     $settings = DevblocksPlatform::getPluginSettingsService();
     $reply_to = $settings->get('cerberusweb.core', CerberusSettings::DEFAULT_REPLY_FROM, CerberusSettingsDefaults::DEFAULT_REPLY_FROM);
     $reply_personal = $settings->get('cerberusweb.core', CerberusSettings::DEFAULT_REPLY_PERSONAL, CerberusSettingsDefaults::DEFAULT_REPLY_PERSONAL);
     $task = DAO_Task::get($task_id);
     // Sanitize and combine all the destination addresses
     $next_worker = DAO_Worker::get($worker_id);
     $notify_emails = $next_worker->email;
     if (empty($notify_emails)) {
         return;
     }
     try {
         if (null == $mailer) {
             $mailer = $mail_service->getMailer(CerberusMail::getMailerDefaults());
         }
         // Create the message
         $mail = $mail_service->createMessage();
         $mail->setTo(array($notify_emails));
         $mail->setFrom(array($reply_to => $reply_personal));
         $mail->setReplyTo($reply_to);
         $mail->setSubject(sprintf("[Task Assignment #%d]: %s", $task->id, $task->title));
         $headers = $mail->getHeaders();
         $headers->addTextHeader('X-Mailer', 'Cerberus Helpdesk (Build ' . APP_BUILD . ')');
         $headers->addTextHeader('Precedence', 'List');
         $headers->addTextHeader('Auto-Submitted', 'auto-generated');
         $body = sprintf("[Task Assignment #%d]: %s", $task->id, $task->title);
         $mft = DevblocksPlatform::getExtension($context, false, true);
         $ext = $mft->createInstance();
         $url = $ext->getPermalink($task_id);
         $body .= "\r\n" . $url;
         // Comments
         $comments = DAO_Comment::getByContext(CerberusContexts::CONTEXT_TASK, $task_id);
         foreach ($comments as $comment_id => $comment) {
             $address = DAO_Address::get($comment->address_id);
             $body .= "\r\nCommented By: " . $address->first_name . " " . $address->last_name;
             $body .= "\r\n" . $comment->comment;
         }
         unset($comments);
         $body .= "\r\n";
         $mail->setBody($body);
         $result = $mailer->send($mail);
     } catch (Exception $e) {
         echo "Task Email Notification failed to send<br>";
     }
 }
开发者ID:rmiddle,项目名称:cerb5_plugins,代码行数:54,代码来源:App.php

示例2: showWorkerPeekAction

 function showWorkerPeekAction()
 {
     @($id = DevblocksPlatform::importGPC($_REQUEST['id'], 'integer', 0));
     @($view_id = DevblocksPlatform::importGPC($_REQUEST['view_id'], 'string', ''));
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl->assign('path', $this->_TPL_PATH);
     $tpl->assign('view_id', $view_id);
     $worker = DAO_Worker::get($id);
     $tpl->assign('worker', $worker);
     // Custom Fields
     $custom_fields = DAO_CustomField::getBySource(FegCustomFieldSource_Worker::ID);
     $tpl->assign('custom_fields', $custom_fields);
     $custom_field_values = DAO_CustomFieldValue::getValuesBySourceIds(FegCustomFieldSource_Worker::ID, $id);
     if (isset($custom_field_values[$id])) {
         $tpl->assign('custom_field_values', $custom_field_values[$id]);
     }
     $tpl->display('file:' . $this->_TPL_PATH . 'setup/tabs/workers/peek.tpl');
 }
开发者ID:rmiddle,项目名称:feg,代码行数:18,代码来源:setup.php


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