added internal rates (#1591)

This commit is contained in:
Kevin Papst
2020-04-08 14:50:15 +02:00
committed by GitHub
parent 82c713031e
commit 68d703d1e3
128 changed files with 4044 additions and 1571 deletions

View File

@@ -18,6 +18,7 @@ use Symfony\Contracts\Translation\TranslatorInterface;
/**
* The abstract base controller.
* @method null|User getUser()
*/
abstract class AbstractController extends BaseAbstractController implements ServiceSubscriberInterface
{
@@ -42,14 +43,6 @@ abstract class AbstractController extends BaseAbstractController implements Serv
return $this->container->get('logger');
}
/**
* @return User|null
*/
protected function getUser()
{
return parent::getUser();
}
/**
* Adds a "successful" flash message to the stack.
*

View File

@@ -134,25 +134,6 @@ final class ActivityController extends AbstractController
]);
}
/**
* @Route(path="/{id}/rate_delete/{rate}", name="admin_activity_rate_delete", methods={"GET"})
* @Security("is_granted('edit', activity)")
*/
public function deleteRateAction(Activity $activity, ActivityRate $rate, ActivityRateRepository $repository)
{
if ($rate->getActivity() !== $activity) {
$this->flashError('action.delete.error', ['%reason%' => 'Invalid activity']);
} else {
try {
$repository->deleteRate($rate);
} catch (\Exception $ex) {
$this->flashError('action.delete.error', ['%reason%' => $ex->getMessage()]);
}
}
return $this->redirectToRoute('activity_details', ['id' => $activity->getId()]);
}
/**
* @Route(path="/{id}/rate", name="admin_activity_rate_add", methods={"GET", "POST"})
* @Security("is_granted('edit', activity)")

View File

@@ -315,25 +315,6 @@ final class CustomerController extends AbstractController
]);
}
/**
* @Route(path="/{id}/rate_delete/{rate}", name="admin_customer_rate_delete", methods={"GET"})
* @Security("is_granted('edit', customer)")
*/
public function deleteRateAction(Customer $customer, CustomerRate $rate, CustomerRateRepository $repository)
{
if ($rate->getCustomer() !== $customer) {
$this->flashError('action.delete.error', ['%reason%' => 'Invalid customer']);
} else {
try {
$repository->deleteRate($rate);
} catch (\Exception $ex) {
$this->flashError('action.delete.error', ['%reason%' => $ex->getMessage()]);
}
}
return $this->redirectToRoute('customer_details', ['id' => $customer->getId()]);
}
/**
* @Route(path="/{id}/rate", name="admin_customer_rate_add", methods={"GET", "POST"})
* @Security("is_granted('edit', customer)")

View File

@@ -58,7 +58,6 @@ class ProfileController extends AbstractController
}
/**
* @Route(path="/", name="fos_user_profile_show", methods={"GET"})
* @Route(path="/", name="my_profile", methods={"GET"})
*/
public function profileAction()

View File

@@ -314,25 +314,6 @@ final class ProjectController extends AbstractController
]);
}
/**
* @Route(path="/{id}/rate_delete/{rate}", name="admin_project_rate_delete", methods={"GET"})
* @Security("is_granted('edit', project)")
*/
public function deleteRateAction(Project $project, ProjectRate $rate, ProjectRateRepository $repository)
{
if ($rate->getProject() !== $project) {
$this->flashError('action.delete.error', ['%reason%' => 'Invalid project']);
} else {
try {
$repository->deleteRate($rate);
} catch (\Exception $ex) {
$this->flashError('action.delete.error', ['%reason%' => $ex->getMessage()]);
}
}
return $this->redirectToRoute('project_details', ['id' => $project->getId()]);
}
/**
* @Route(path="/{id}/rate", name="admin_project_rate_add", methods={"GET", "POST"})
* @Security("is_granted('edit', project)")