+ complete task #312:add linkpruduct to createproject and editproject page.
This commit is contained in:
@@ -371,6 +371,7 @@ class project extends control
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$projectID = $this->project->create();
|
||||
$this->project->updateProducts($projectID);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
$this->loadModel('action')->create('project', $projectID, 'opened');
|
||||
die(js::locate($this->createLink('project', 'tips', "projectID=$projectID"), 'parent'));
|
||||
@@ -383,6 +384,7 @@ class project extends control
|
||||
$this->view->position[] = $this->view->header->title;
|
||||
$this->view->projects = array('' => '') + $this->projects;
|
||||
$this->view->groups = $this->loadModel('group')->getPairs();
|
||||
$this->view->allProducts = $this->loadModel('product')->getPairs();
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -393,6 +395,7 @@ class project extends control
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$changes = $this->project->update($projectID);
|
||||
$this->project->updateProducts($projectID);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
if($changes)
|
||||
{
|
||||
@@ -416,13 +419,18 @@ class project extends control
|
||||
$position[] = html::a($browseProjectLink, $project->name);
|
||||
$position[] = $this->lang->project->edit;
|
||||
|
||||
$linkedProducts = $this->project->getProducts($project->id);
|
||||
$linkedProducts = join(',', array_keys($linkedProducts));
|
||||
|
||||
/* 赋值。*/
|
||||
$this->view->header = $header;
|
||||
$this->view->position = $position;
|
||||
$this->view->projects = $projects;
|
||||
$this->view->project = $project;
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noclosed,nodeleted');
|
||||
$this->view->groups = $this->loadModel('group')->getPairs();
|
||||
$this->view->header = $header;
|
||||
$this->view->position = $position;
|
||||
$this->view->projects = $projects;
|
||||
$this->view->project = $project;
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noclosed,nodeleted');
|
||||
$this->view->groups = $this->loadModel('group')->getPairs();
|
||||
$this->view->allProducts = $this->loadModel('product')->getPairs();
|
||||
$this->view->linkedProducts = $linkedProducts;
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -88,6 +88,7 @@ class projectModel extends model
|
||||
->specialChars('goal, desc')
|
||||
->setIF($this->post->acl != 'custom', 'whitelist', '')
|
||||
->join('whitelist', ',')
|
||||
->remove('products')
|
||||
->get();
|
||||
$this->dao->insert(TABLE_PROJECT)->data($project)
|
||||
->autoCheck($skipFields = 'begin,end')
|
||||
@@ -124,6 +125,7 @@ class projectModel extends model
|
||||
->setIF($this->post->end == '0000-00-00', 'end', '')
|
||||
->setIF($this->post->acl != 'custom', 'whitelist', '')
|
||||
->join('whitelist', ',')
|
||||
->remove('products')
|
||||
->get();
|
||||
$this->dao->update(TABLE_PROJECT)->data($project)
|
||||
->autoCheck($skipFields = 'begin,end')
|
||||
|
||||
@@ -42,6 +42,10 @@ function setWhite(acl)
|
||||
<th class='rowhead'><?php echo $lang->project->teamname;?></th>
|
||||
<td><?php echo html::input('team', '', "class='text-3'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->project->manageProducts;?></th>
|
||||
<td><?php echo html::checkbox("products", $allProducts, '');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->project->goal;?></th>
|
||||
<td><?php echo html::textarea('goal', '', "rows='5' class='area-1'");?></td>
|
||||
|
||||
@@ -63,6 +63,10 @@ function setWhite(acl)
|
||||
<th class='rowhead'><?php echo $lang->project->RM;?></th>
|
||||
<td><?php echo html::select('RM', $users, $project->RM, 'class=text-3');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->project->manageProducts;?></th>
|
||||
<td><?php echo html::checkbox("products", $allProducts, $linkedProducts);?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->project->goal;?></th>
|
||||
<td><?php echo html::textarea('goal', $project->goal, "rows='5' class='area-1'");?></td>
|
||||
|
||||
Reference in New Issue
Block a user