* Submit form by ajax.
This commit is contained in:
@@ -953,11 +953,21 @@ class project extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function create($projectID = '', $copyProjectID = '', $planID = 0)
|
||||
public function create($projectID = '', $copyProjectID = '', $planID = 0, $confirm = 'no')
|
||||
{
|
||||
if($projectID)
|
||||
{
|
||||
if(!empty($planID)) $this->project->linkStories($projectID);
|
||||
if(!empty($planID))
|
||||
{
|
||||
if($confirm == 'yes')
|
||||
{
|
||||
$this->project->linkStories($projectID);
|
||||
}
|
||||
else
|
||||
{
|
||||
die(js::confirm($this->lang->project->importPlanStory, inlink('create', "projectID=$projectID©ProjectID=&planID=$planID&confirm=yes"), inlink('create', "projectID=$projectID"), 'parent', 'parent'));
|
||||
}
|
||||
}
|
||||
$this->view->title = $this->lang->project->tips;
|
||||
$this->view->tips = $this->fetch('project', 'tips', "projectID=$projectID");
|
||||
$this->view->projectID = $projectID;
|
||||
@@ -998,19 +1008,18 @@ class project extends control
|
||||
{
|
||||
$projectID = $copyProjectID == '' ? $this->project->create() : $this->project->create($copyProjectID);
|
||||
$this->project->updateProducts($projectID);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
$this->loadModel('action')->create('project', $projectID, 'opened');
|
||||
$url = $this->createLink('project', 'create', "projectID=$projectID");
|
||||
|
||||
$planID = reset($this->post->plans);
|
||||
$planID = reset($_POST['plans']);
|
||||
if(!empty($planID))
|
||||
{
|
||||
die(js::confirm($this->lang->project->importPlanStory, $this->createLink('project', 'create', "projectID=$projectID©ProjectID=&planID=$planID"), $url, 'parent', 'parent'));
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('create', "projectID=$projectID©ProjectID=&planID=$planID&confirm=no")));
|
||||
}
|
||||
else
|
||||
{
|
||||
die(js::locate($url, 'parent'));
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('create', "projectID=$projectID")));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
<button type='button' class='btn btn-link' id='cpmBtn'><?php echo html::icon($lang->icons['copy'], 'muted') . ' ' . $lang->project->copy;?></button>
|
||||
</div>
|
||||
</div>
|
||||
<form class='form-indicator main-form' method='post' target='hiddenwin' id='dataform'>
|
||||
<form class='form-indicator main-form form-ajax' method='post' target='hiddenwin' id='dataform'>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th><?php echo $lang->project->name;?></th>
|
||||
|
||||
Reference in New Issue
Block a user