Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Nomalized redirection after creating or editing object

  • Loading branch information...
commit 76033058a3a1b306a5bcc18ffe151ec70dc7d8b9 1 parent 4f833d9
Filippo authored
View
BIN  data/phpcollab_unit_test.db
Binary file not shown
View
22 plugins/idProjectManagementPlugin/modules/idIssue/actions/actions.class.php
@@ -140,6 +140,8 @@ public function executeDelete(sfWebRequest $request)
$project_id = $request->getParameter('project_id');
$issue->delete();
+ $this->getUser()->setFlash('notice', 'Issue deleted succesfully');
+
$this->redirect('@index_issue?project_id='.$project_id);
}
@@ -213,25 +215,9 @@ protected function processForm(sfWebRequest $request, sfForm $form)
$form->bind($this->fixParameterForOpenOrClosedIssue($request->getParameter($form->getName()), $form->getObject()));
if ($form->isValid())
{
- $operation = $form->getObject()->isNew() ? 'create' : 'update';
$issue = $form->save();
-
-// the operation of saving this issue again cannot be done cause of a bug on the embedded for that we thought was solved during the phpday2009
-// $issue->save();
-//
-// if ($issue->hasBeenClosed())
-// {
-// $issue->setEndingDate(date('Y-m-d H:i:s', time()));
-// }
-//
-// if ($issue->hasBeenReopen())
-// {
-// $issue->setEndingDate(null);
-// }
-
-
-
- $this->redirect('@index_issue?project_id='.$issue->project_id);
+ $this->getUser()->setFlash('notice', 'Issue saved');
+ $this->redirect('@edit_issue?project_id='.$issue->project_id.'&issue_id='.$issue->id);
}
}
}
View
3  plugins/idProjectManagementPlugin/modules/idLogtime/actions/actions.class.php
@@ -190,11 +190,8 @@ protected function processForm(sfWebRequest $request, sfForm $form)
$form->bind($parameters);
if ($form->isValid())
{
- $operation = $form->getObject()->isNew() ? 'create' : 'update';
$log_time = $form->save();
-
$this->getUser()->setFlash('success', 'Log time added');
-
$this->redirect($this->referer);
}
}
View
8 plugins/idProjectManagementPlugin/modules/idMessage/actions/actions.class.php
@@ -22,11 +22,6 @@ public function executeIndex(sfWebRequest $request)
$this->pager->setMaxPerPage(sfConfig::get('mod_maxperpage_logtime', 10));
$this->pager->setPage($this->getRequestParameter('page',1));
$this->pager->init();
-
-/*
- $this->message_list = Doctrine::getTable('Message')
- ->createQuery('a')
- ->execute();*/
}
public function executeShow(sfWebRequest $request)
@@ -41,7 +36,6 @@ public function executeShow(sfWebRequest $request)
public function executeNew(sfWebRequest $request)
{
$this->form = new MessageForm();
-
$this->setTemplate('edit');
}
@@ -82,7 +76,9 @@ public function executeDelete(sfWebRequest $request)
$this->forward404Unless($message = Doctrine::getTable('Message')->find(array($request->getParameter('message_id'))), sprintf('Object message does not exist (%s).', array($request->getParameter('message_id'))));
$this->forward404Unless($message->project_id == $request->getParameter('project_id'));
+
$message->delete();
+ $this->getUser()->setFlash('notice', 'Message deleted successfully');
$this->redirect('@index_messages?project_id='.$request->getParameter('project_id'));
}
View
3  plugins/idProjectManagementPlugin/modules/idMilestone/actions/actions.class.php
@@ -134,6 +134,7 @@ public function executeDelete(sfWebRequest $request)
$this->forward404Unless($milestone->getProjectId() == $request->getParameter('project_id'));
$milestone->delete();
+ $this->getUser()->setFlash('notice', 'Milestone deleted successfully');
$this->redirect('@show_project?id='.$milestone->getProjectId());
}
@@ -150,7 +151,7 @@ protected function processForm(sfWebRequest $request, sfForm $form)
if ($form->isValid())
{
$milestone = $form->save();
- $this->redirect('@show_project?id='.$milestone->getProjectId());
+ $this->redirect('@edit_milestone?project_id='.$milestone->getProjectId().'&milestone_id='.$milestone->getId());
}
}
}
View
15 plugins/idProjectManagementPlugin/modules/idProfile/actions/actions.class.php
@@ -15,16 +15,6 @@ public function executeIndex(sfWebRequest $request)
$this->forward404Unless($this->getUser()->isMyProfile($this->getUser()->getGuardUser()->getid()));
}
- public function executeNew(sfWebRequest $request)
- {
- $this->forward404();
- }
-
- public function executeCreate(sfWebRequest $request)
- {
- $this->forward404();
- }
-
public function executeEdit(sfWebRequest $request)
{
$this->form = new idProfileForm($this->getUser()->getGuardUser());
@@ -43,11 +33,6 @@ public function executeUpdate(sfWebRequest $request)
$this->setTemplate('edit');
}
- public function executeDelete(sfWebRequest $request)
- {
- $this->forward404();
- }
-
protected function processForm(sfWebRequest $request, sfForm $form)
{
$form->bind($request->getParameter($form->getName()));
View
1  plugins/idProjectManagementPlugin/modules/idProject/actions/actions.class.php
@@ -163,6 +163,7 @@ public function executeDelete(sfWebRequest $request)
$this->forward404Unless($project = Doctrine::getTable('Project')->find(array($request->getParameter('id'))), sprintf('Object project does not exist (%s).', array($request->getParameter('id'))));
$project->delete();
+ $this->getUser()->setFlash('notice', 'Project dleted successfully');
$this->redirect('idProject/index');
}
View
5 test/functional/fe/idProjectEventLoggedTest.php
@@ -42,9 +42,8 @@
followRedirect()->
with('request')->begin()->
- isParameter('module', 'idProject')->
- isParameter('action', 'show')->
- isParameter('id', '4')->
+ isParameter('module', 'idMilestone')->
+ isParameter('action', 'edit')->
end()->
click('Milestones')->
View
4 test/functional/fe/idProjectIssueCreateAssociateWithMilestoneTest.php
@@ -52,9 +52,11 @@
with('request')->begin()->
isParameter('module', 'idIssue')->
- isParameter('action', 'index')->
+ isParameter('action', 'edit')->
end()->
+ click('Issues')->
+
click('Last')->
with('response')->begin()->
View
4 test/functional/fe/idProjectIssueCreateTest.php
@@ -77,8 +77,10 @@
with('request')->begin()->
isParameter('module', 'idIssue')->
- isParameter('action', 'index')->
+ isParameter('action', 'edit')->
end()->
+
+ click('Issues')->
click('Last')->
responseContains('new ticket')->
View
8 test/functional/fe/idProjectIssueEditTest.php
@@ -74,7 +74,7 @@
with('request')->begin()->
isParameter('module', 'idIssue')->
- isParameter('action', 'index')->
+ isParameter('action', 'edit')->
end()->
responseContains('new ticket up')->
@@ -100,7 +100,7 @@
with('request')->begin()->
isParameter('module', 'idIssue')->
- isParameter('action', 'index')->
+ isParameter('action', 'edit')->
end()->
click('Dashboard')->
@@ -171,9 +171,11 @@
with('request')->begin()->
isParameter('module', 'idIssue')->
- isParameter('action', 'index')->
+ isParameter('action', 'edit')->
end()->
+ click('Issues')->
+
click('#1')->
click('Edit')->
View
5 test/functional/fe/idProjectMilestoneCreateTest.php
@@ -44,9 +44,8 @@
followRedirect()->
with('request')->begin()->
- isParameter('module', 'idProject')->
- isParameter('action', 'show')->
- isParameter('id', '4')->
+ isParameter('module', 'idMilestone')->
+ isParameter('action', 'edit')->
end()->
click('Milestones')->
View
5 test/functional/fe/idProjectMilestoneEditTest.php
@@ -35,9 +35,8 @@
followRedirect()->
with('request')->begin()->
- isParameter('module', 'idProject')->
- isParameter('action', 'show')->
- isParameter('id', '3')->
+ isParameter('module', 'idMilestone')->
+ isParameter('action', 'edit')->
end()->
click('Milestones')->
Please sign in to comment.
Something went wrong with that request. Please try again.