对task模块的control层view方法重写报错

回贴
回帖数 3
阅读数 1946
发表时间 2018-09-28 16:35:24
😁
li yun tao li 楼主

按二次开发规范对task模块的control层view方法重写,以view命名文件,放在task目录下ext/control下面,访问报错

ERROR: the control task not found in framework\base\router.class.php on line 1629, last called by www\index.php on line 67 through function loadModule.

2018-09-28 16:37:03 li yun tao li 最后编辑
3个回复
石洋洋 沙发

把这个文件发出来看一下。

2018-09-28 18:22:33 石洋洋 回帖
😁
li yun tao li 板凳 回复#1

文件传不上来

/**
     * View a task.
     *
     * @param  int    $taskID
     * @access public
     * @return void
     */
    public function view($taskID)
    {
        $task = $this->task->getById($taskID, true);
        if(!$task) die(js::error($this->lang->notFound) . js::locate('back'));

        if($task->fromBug != 0)
        {
            $bug = $this->loadModel('bug')->getById($task->fromBug);
            $task->bugSteps = '';
            if($bug)
            {
                $task->bugSteps = $this->loadModel('file')->setImgSize($bug->steps);
                foreach($bug->files as $file) $task->files[] = $file;
            }
            $this->view->fromBug = $bug;
        }
 
        $story = $this->story->getById($task->story);
        $task->storySpec     = empty($story) ? '' : $this->loadModel('file')->setImgSize($story->spec);
        $task->storyVerify   = empty($story) ? '' : $this->loadModel('file')->setImgSize($story->verify);
        $task->storyFiles    = $this->loadModel('file')->getByObject('story', $task->story);

        if($task->team) $this->lang->task->assign = $this->lang->task->transfer;

        /* Update action. */
        if($task->assignedTo == $this->app->user->account) $this->loadModel('action')->read('task', $taskID);

        /* Set menu. */
        $project = $this->project->getById($task->project);
        $this->project->setMenu($this->project->getPairs(), $project->id);

        $title      = "TASK#$task->id $task->name / $project->name";
        $position[] = html::a($this->createLink('project', 'browse', "projectID=$task->project"), $project->name);
        $position[] = $this->lang->task->common;
        $position[] = $this->lang->task->view;

        $this->view->title       = $title;
        $this->view->position    = $position;
        $this->view->project     = $project;
        $this->view->task        = $task;
        $this->view->actions     = $this->loadModel('action')->getList('task', $taskID);
        $this->view->users       = $this->loadModel('user')->getPairs('noletter');
        $this->view->preAndNext  = $this->loadModel('common')->getPreAndNextObject('task', $taskID);
        $this->view->product     = $this->tree->getProduct($task->module);
        $this->view->modulePath  = $this->tree->getParents($task->module);
        $this->display();
    }

2018-09-29 15:20:14 li yun tao li 最后编辑 2018-09-29 15:20:14 li yun tao li 回帖
石洋洋 #3

介绍文档:http://devel.easycorp.cn/book/extension/extend-control-37.html

注意红框位置的代码:

2018-09-30 10:12:44 石洋洋 回帖
联系人
丁芝/高级客户经理
电话(微信)
17663906485
QQ号码
1481227768
联系邮箱
dingzhi@chandao.com
返回顶部
丁芝
高级客户经理
17663906485
1481227768
统一服务热线 4006-8899-23
我要提问提问有任何问题,您都可以在这里提问。 问题反馈反馈点击这里,让我们聆听您的建议与反馈。