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


PHP CTask::getTaskDepartments方法代码示例

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


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

示例1: foreach

                </tr>
                <tr>
                    <td colspan="3" nowrap="nowrap">
                        <strong><?php 
echo $AppUI->_('Description');
?>
</strong><br />
                    </td>
                 </tr>
                <tr>
                    <?php 
echo $htmlHelper->createCell('task_description', $obj->task_description);
?>
                </tr>
                <?php 
$depts = $obj->getTaskDepartments(null, $task_id);
if (count($depts)) {
    ?>
                <tr>
                    <td><strong><?php 
    echo $AppUI->_('Departments');
    ?>
</strong></td>
                </tr>
                <tr>
                    <td colspan="3" class="hilite">
                    <?php 
    foreach ($depts as $dept_id => $dept_info) {
        echo '<div>' . $dept_info['dept_name'];
        if ($dept_info['dept_phone'] != '') {
            echo '( ' . $dept_info['dept_phone'] . ' )';
开发者ID:,项目名称:,代码行数:31,代码来源:

示例2: executeGet

 /**
  * Get Request Handler
  *
  * This method is called when a request is a GET
  *
  * @return array
  */
 public function executeGet()
 {
     $valid = $this->hasRequiredParameters($this->requiredParams);
     if ($valid instanceof Frapi_Error) {
         return $valid;
     }
     $username = $this->getParam('username');
     $password = $this->getParam('password');
     $task_id = $this->getParam('task_id', self::TYPE_INT);
     // Attempt to login as user, a little bit of a hack as we currently
     // require the $_POST['login'] var to be set as well as a global AppUI
     $AppUI = new CAppUI();
     $GLOBALS['AppUI'] = $AppUI;
     $_POST['login'] = 'login';
     if (!$AppUI->login($username, $password)) {
         throw new Frapi_Error('INVALID_LOGIN');
     }
     $task = new CTask();
     $allowed_tasks = $task->getAllowedRecords($AppUI->user_id);
     // Task ID  is the key, so lets get them in to an array so we can
     // easily check
     $allowed_tasks = array_keys($allowed_tasks);
     if (!in_array($task_id, $allowed_tasks)) {
         throw new Frapi_Error('PERMISSION_ERROR');
     }
     // User has permission so load the project for display
     $task_departments = $task->getTaskDepartments($AppUI, $task_id);
     $task_contacts = $task->getTaskContacts($AppUI, $task_id);
     $task = (array) $task->load($task_id);
     $task['task_departments'] = array();
     foreach ($task_departments as $key => $value) {
         $task['task_departments'][] = $value['dept_id'];
     }
     $task['task_contacts'] = array();
     foreach ($task_contacts as $key => $value) {
         $task['task_contacts'][] = $value['contact_id'];
     }
     // Remove the data that is not for display
     unset($task['_tbl_prefix'], $task['_tbl'], $task['_tbl_key'], $task['_error'], $task['_query'], $task['_tbl_module']);
     $this->data['task'] = $task;
     $this->data['success'] = true;
     $this->setTemplateFileName('Task');
     return $this->toArray();
 }
开发者ID:robertbasic,项目名称:web2project-api,代码行数:51,代码来源:Task.php

示例3: w2p_textarea

                    <td colspan="3" nowrap="nowrap">
                        <strong><?php 
echo $AppUI->_('Description');
?>
</strong><br />
                    </td>
                 </tr>
                <tr>
                    <td class="hilite" colspan="3">
                        <?php 
echo w2p_textarea($obj->task_description);
?>
                    </td>
                </tr>
                <?php 
$depts = $obj->getTaskDepartments($AppUI, $task_id);
if (count($depts)) {
    ?>
                <tr>
                    <td><strong><?php 
    echo $AppUI->_('Departments');
    ?>
</strong></td>
                </tr>
                <tr>
                    <td colspan="3" class="hilite">
                        <?php 
    foreach ($depts as $dept_id => $dept_info) {
        echo '<div>' . $dept_info['dept_name'];
        if ($dept_info['dept_phone'] != '') {
            echo '( ' . $dept_info['dept_phone'] . ' )';
开发者ID:viniciusbudines,项目名称:sisnuss,代码行数:31,代码来源:view.php


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