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


PHP ProjectTasks::findByRelated方法代码示例

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


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

示例1: check_related_task

 function check_related_task()
 {
     ajx_current("empty");
     //I find all those related to the task to find out if the original
     $task_related = ProjectTasks::findByRelated(array_var($_REQUEST, 'related_id'));
     if (!$task_related) {
         $task_related = ProjectTasks::findById(array_var($_REQUEST, 'related_id'));
         //is not the original as the original look plus other related
         if ($task_related->getOriginalTaskId() != "0") {
             ajx_extra_data(array("status" => true));
         } else {
             ajx_extra_data(array("status" => false));
         }
     } else {
         ajx_extra_data(array("status" => true));
     }
 }
开发者ID:rorteg,项目名称:fengoffice,代码行数:17,代码来源:TaskController.class.php

示例2: getArrayInfo

 /**
  * End task templates
  */
 function getArrayInfo($full = false)
 {
     if (config_option("wysiwyg_tasks")) {
         if ($this->getTypeContent() == "text") {
             $desc = nl2br(htmlspecialchars($this->getText()));
         } else {
             $desc = purify_html(nl2br($this->getText()));
         }
     } else {
         if ($this->getTypeContent() == "text") {
             $desc = htmlspecialchars($this->getText());
         } else {
             $desc = html_to_text(html_entity_decode(nl2br($this->getText()), null, "UTF-8"));
         }
     }
     $result = array('id' => $this->getId(), 't' => $this->getObjectName(), 'desc' => $desc, 'members' => $this->getMemberIds(), 'c' => $this->getCreatedOn() instanceof DateTimeValue ? $this->getCreatedOn()->getTimestamp() : 0, 'cid' => $this->getCreatedById(), 'otype' => $this->getObjectSubtype(), 'percentCompleted' => $this->getPercentCompleted(), 'memPath' => str_replace('"', "'", str_replace("'", "\\'", json_encode($this->getMembersToDisplayPath()))));
     if ($full) {
         $result['description'] = $this->getText();
     }
     $result['multiAssignment'] = $this->getColumnValue('multi_assignment', 0);
     if ($this->isCompleted()) {
         $result['s'] = 1;
     }
     if ($this->getParentId() > 0) {
         $result['pid'] = $this->getParentId();
     }
     //if ($this->getPriority() != 200)
     $result['pr'] = $this->getPriority();
     if ($this->getMilestoneId() > 0) {
         $result['mid'] = $this->getMilestoneId();
     }
     if ($this->getAssignedToContactId() > 0) {
         $result['atid'] = $this->getAssignedToContactId();
     }
     $result['atName'] = $this->getAssignedToName();
     if ($this->getCompletedById() > 0) {
         $result['cbid'] = $this->getCompletedById();
         $result['con'] = $this->getCompletedOn()->getTimestamp();
     }
     if ($this->getDueDate() instanceof DateTimeValue) {
         $result['dd'] = $this->getDueDate()->getTimestamp() + logged_user()->getTimezone() * 3600;
         $result['udt'] = $this->getUseDueTime() ? 1 : 0;
     }
     if ($this->getStartDate() instanceof DateTimeValue) {
         $result['sd'] = $this->getStartDate()->getTimestamp() + logged_user()->getTimezone() * 3600;
         $result['ust'] = $this->getUseStartTime() ? 1 : 0;
     }
     $time_estimate = $this->getTimeEstimate();
     $result['TimeEstimate'] = $this->getTimeEstimate();
     if ($time_estimate > 0) {
         $result['estimatedTime'] = DateTimeValue::FormatTimeDiff(new DateTimeValue(0), new DateTimeValue($time_estimate * 60), 'hm', 60);
     }
     $result['tz'] = logged_user()->getTimezone() * 3600;
     $ot = $this->getOpenTimeslots();
     if ($ot) {
         $users = array();
         $time = array();
         $paused = array();
         foreach ($ot as $t) {
             $time[] = $t->getSeconds();
             $users[] = $t->getContactId();
             $paused[] = $t->isPaused() ? 1 : 0;
             if ($t->isPaused() && $t->getContactId() == logged_user()->getId()) {
                 $result['wpt'] = $t->getPausedOn()->getTimestamp();
             }
         }
         $result['wt'] = $time;
         $result['wid'] = $users;
         $result['wp'] = $paused;
     }
     if ($this->isRepetitive()) {
         $result['rep'] = 1;
     } else {
         //I find all those related to the task to find out if the original
         $task_related = ProjectTasks::findByRelated($this->getObjectId());
         if (!$task_related) {
             //is not the original as the original look plus other related
             if ($this->getOriginalTaskId() != "0") {
                 $task_related = ProjectTasks::findByTaskAndRelated($this->getObjectId(), $this->getOriginalTaskId());
             }
         }
         if ($task_related) {
             $result['rep'] = 1;
         }
     }
     return $result;
 }
开发者ID:rorteg,项目名称:fengoffice,代码行数:90,代码来源:ProjectTask.class.php


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