* Add to the design assigned to.
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
<?php
|
||||
$config->design = new stdclass();
|
||||
$config->design->editor = new stdclass();
|
||||
$config->design->editor->create = array('id' => 'desc', 'tools' => 'simpleTools');
|
||||
$config->design->editor->edit = array('id' => 'desc', 'tools' => 'simpleTools');
|
||||
$config->design->editor->create = array('id' => 'desc', 'tools' => 'simpleTools');
|
||||
$config->design->editor->edit = array('id' => 'desc', 'tools' => 'simpleTools');
|
||||
$config->design->editor->assignto = array('id' => 'comment', 'tools' => 'simpleTools');
|
||||
|
||||
$config->design->affectedFixedNum = 7;
|
||||
|
||||
|
||||
@@ -56,6 +56,7 @@ class design extends control
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->productID = $productID;
|
||||
$this->view->pager = $pager;
|
||||
$this->view->users = $this->loadModel('user')->getPairs();
|
||||
|
||||
$this->display();
|
||||
}
|
||||
@@ -294,4 +295,37 @@ class design extends control
|
||||
die(js::locate($this->session->designList, 'parent'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update assign of design.
|
||||
*
|
||||
* @param int $designID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function assignTo($designID)
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
$changes = $this->design->assign($designID);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
|
||||
$this->loadModel('action');
|
||||
if(!empty($changes))
|
||||
{
|
||||
$actionID = $this->action->create('design', $designID, 'Assigned', $this->post->comment, $this->post->assignedTo);
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
|
||||
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
|
||||
die(js::locate($this->createLink('design', 'browse'), 'parent'));
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->design->assignedTo;
|
||||
$this->view->position[] = $this->lang->design->assignedTo;
|
||||
|
||||
$this->view->design = $this->design->getById($designID);
|
||||
$this->view->users = $this->loadModel('user')->getPairs();
|
||||
$this->display();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,6 +45,8 @@ $lang->design->reviewObject = 'Review Object';
|
||||
$lang->design->createdBy = 'CreatedBy';
|
||||
$lang->design->createdDate = 'CreatedDate';
|
||||
$lang->design->basicInfo = 'Basic Information';
|
||||
$lang->design->assignTo = 'Assign';
|
||||
$lang->design->noAssigned = 'Unassigned';
|
||||
|
||||
$lang->design->typeList = array();
|
||||
$lang->design->typeList[''] = '';
|
||||
|
||||
@@ -45,6 +45,8 @@ $lang->design->reviewObject = '评审对象';
|
||||
$lang->design->createdBy = '由谁创建';
|
||||
$lang->design->createdDate = '创建时间';
|
||||
$lang->design->basicInfo = '基本信息';
|
||||
$lang->design->assignTo = '指派';
|
||||
$lang->design->noAssigned = '未指派';
|
||||
|
||||
$lang->design->typeList = array();
|
||||
$lang->design->typeList[''] = '';
|
||||
|
||||
@@ -347,4 +347,57 @@ class designModel extends model
|
||||
|
||||
$this->loadModel('search')->setSearchParams($this->config->design->search);
|
||||
}
|
||||
|
||||
/**
|
||||
* Print assignedTo html
|
||||
*
|
||||
* @param int $design
|
||||
* @param int $users
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function printAssignedHtml($design, $users)
|
||||
{
|
||||
$btnTextClass = '';
|
||||
$assignedToText = zget($users, $design->assignedTo);
|
||||
|
||||
if(empty($design->assignedTo))
|
||||
{
|
||||
$btnTextClass = 'text-primary';
|
||||
$assignedToText = $this->lang->design->noAssigned;
|
||||
}
|
||||
if($design->assignedTo == $this->app->user->account) $btnTextClass = 'text-red';
|
||||
|
||||
$btnClass = $design->assignedTo == 'closed' ? ' disabled' : '';
|
||||
$btnClass = "iframe btn btn-icon-left btn-sm {$btnClass}";
|
||||
$assignToLink = helper::createLink('design', 'assignTo', "designID=$design->id", '', true);
|
||||
$assignToHtml = html::a($assignToLink, "<i class='icon icon-hand-right'></i> <span title='" . zget($users, $design->assignedTo) . "' class='{$btnTextClass}'>{$assignedToText}</span>", '', "class='$btnClass'");
|
||||
|
||||
echo !common::hasPriv('design', 'assignTo', $design) ? "<span style='padding-left: 21px' class='{$btnTextClass}'>{$assignedToText}</span>" : $assignToHtml;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign a design.
|
||||
*
|
||||
* @param int $designID
|
||||
* @access public
|
||||
* @return array|bool
|
||||
*/
|
||||
public function assign($designID)
|
||||
{
|
||||
$oldDesign = $this->getByID($designID);
|
||||
|
||||
$design = fixer::input('post')
|
||||
->add('editedBy', $this->app->user->account)
|
||||
->add('editedDate', helper::today())
|
||||
->setDefault('assignedDate', helper::today())
|
||||
->stripTags($this->config->design->editor->assignto['id'], $this->config->allowedTags)
|
||||
->remove('uid,comment,files,label')
|
||||
->get();
|
||||
|
||||
$this->dao->update(TABLE_DESIGN)->data($design)->autoCheck()->where('id')->eq((int)$designID)->exec();
|
||||
|
||||
if(!dao::isError()) return common::createChanges($oldDesign, $design);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* The assign of design module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package design
|
||||
* @version $Id: assign.html.php 4903 2013-06-26 05:32:59Z wyd621@gmail.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include "../../common/view/header.html.php";?>
|
||||
<?php include '../../common/view/kindeditor.html.php';?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<div class='main-header'>
|
||||
<h2>
|
||||
<span class='prefix label-id'><strong><?php echo $design->id;?></strong></span>
|
||||
<?php echo "<span title='$design->name'>" . $design->name . '</span>';?>
|
||||
</h2>
|
||||
</div>
|
||||
<form class='load-indicator main-form' method='post' target='hiddenwin'>
|
||||
<table class='table table-form'>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th class='w-100px'><?php echo $lang->design->assignedTo;?></th>
|
||||
<td><?php echo html::select('assignedTo', $users, $design->assignedTo, "class='form-control chosen'");?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->comment;?></th>
|
||||
<td colspan='2'><?php echo html::textarea('comment', '', "rows='6' class='form-control kindeditor' hidefocus='true'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='text-center form-actions' colspan='3'><?php echo html::submitButton(); ?></td> </tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<?php include "../../common/view/footer.html.php";?>
|
||||
@@ -61,7 +61,7 @@
|
||||
<td style="overflow:hidden"><?php echo $design->commit;?></td>
|
||||
<td><?php echo $design->createdBy;?></td>
|
||||
<td><?php echo substr($design->createdDate, 0, 11);?></td>
|
||||
<td><?php echo $design->assignedTo;?></td>
|
||||
<td><?php echo $this->design->printAssignedHtml($design, $users);?></td>
|
||||
<td class='c-actions text-center'>
|
||||
<?php
|
||||
$vars = "design={$design->id}";
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
<?php if(!isonlybody()) echo "<div class='divider'></div>";?>
|
||||
<?php if(!$design->deleted):?>
|
||||
<?php
|
||||
common::printIcon('design', 'assignTo', "designID=$design->id", $design, 'button', '', '', 'iframe showinonlybody', true);
|
||||
common::printIcon('design', 'commit', "designID=$design->id", $design, 'button', 'link', '', 'iframe showinonlybody', true);
|
||||
common::printIcon('design', 'edit', "designID=$design->id", $design, 'button', 'fork', '', '', true);
|
||||
common::printIcon('design', 'delete', "designID=$design->id", $design, 'button', 'trash', 'hiddenwin');
|
||||
|
||||
Reference in New Issue
Block a user