执行
4484

解决bug时,需添加“附件”功能已解决 悬赏5积分

提问者少虎 答案数1 阅读数2110 发表时间2017-02-24 12:10:45

在assignto.html.php中已经添加显示,但是在提交时始终不能写入数据库,在model和control中均不断尝试,(是不是哪里有遗漏)陷入困境(初学者)

control代码如下

    public function assignTo($bugID)
    {
        $bug = $this->bug->getById($bugID);

        /* Set menu. */
        $this->bug->setMenu($this->products, $bug->product);

        if(!empty($_POST))
        {
            $this->loadModel('action');
            $changes = $this->bug->assign($bugID);
            if(dao::isError()) die(js::error(dao::getError()));
            $files = $this->loadModel('file')->saveUpload('bug', $bugID);
            $fileAction = !empty($files) ? $this->lang->addFiles . join(',', $files) . "\n" : '';

            $actionID = $this->action->create('bug', $bugID, 'Assigned', $fileAction . $this->post->comment, $this->post->assignedTo);
            $this->action->logHistory($actionID, $changes);
            $this->sendmail($bugID, $actionID);

            if(isonlybody()) die(js::closeModal('parent.parent'));
            die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent'));
        }

        $this->view->title      = $this->products[$bug->product] . $this->lang->colon . $this->lang->bug->assignedTo;
        $this->view->position[] = $this->lang->bug->assignedTo;

        $this->view->users   = $this->user->getPairs('nodeleted', $bug->assignedTo);
        $this->view->bug     = $bug;
        $this->view->bugID   = $bugID;
        $this->view->actions = $this->action->getList('bug', $bugID);
        $this->display();
    }

model代码如下:

    public function assign($bugID)
    {
        $now = helper::now();
        $oldBug = $this->getById($bugID);
        $bug = fixer::input('post')
            ->setDefault('lastEditedBy', $this->app->user->account)
            ->setDefault('lastEditedDate', $now)
            ->setDefault('assignedDate', $now)
            ->remove('comment,files,labels')
            ->join('mailto', ',')
            ->get();

        $this->dao->update(TABLE_BUG)
            ->data($bug)
            ->autoCheck()
            ->where('id')->eq($bugID)->exec(); 

        if(!dao::isError()) 
{
$bugID = $this->dao->lastInsertID();
$this->loadModel('file')->saveUpload('bug', $bugID);
return common::createChanges($oldBug, $bug);
}
    }



禅道版本:7.3

安装包类型:源码包

操作系统:Windows 7

客户端浏览器:Chrome

设置备注
内容
答案列表
2017-02-24 14:17:53

升级到禅道最新版本:

🌾
2017/02/24
写错了,应该是“指派”时,添加附件功能
🌾
2017/02/24
最新版“指派”时有附件功能吗?
2017/02/24
指派只是切换一下指派人,一般是不需要上传附件的,可以再编辑任务上传附件。
联系我们
联系人
张淑钧/高级客户经理
电话(微信)
13156280939
QQ号码
2082428410
联系邮箱
zhangshujun@chandao.com
返回顶部
张淑钧
高级客户经理
13156280939
2082428410
统一服务热线 4006-8899-23
我要提问提问有任何问题,您都可以在这里提问。 问题反馈反馈点击这里,让我们聆听您的建议与反馈。