mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-15 14:03:27 +00:00
Fix order
This commit is contained in:
@@ -158,7 +158,7 @@ class Order implements ControllerProviderInterface
|
|||||||
$toRemove = array();
|
$toRemove = array();
|
||||||
|
|
||||||
$records = RecordsRequest::fromRequest($app, $request, true, array('cancmd'));
|
$records = RecordsRequest::fromRequest($app, $request, true, array('cancmd'));
|
||||||
$query = new \User_Query($app);
|
$hasOneAdmin = array();
|
||||||
|
|
||||||
if (!$records->isEmpty()) {
|
if (!$records->isEmpty()) {
|
||||||
$order = new OrderEntity();
|
$order = new OrderEntity();
|
||||||
@@ -172,13 +172,16 @@ class Order implements ControllerProviderInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$hasOneAdmin = !!count($query->on_base_ids(array($record->get_base_id()))
|
if (!isset($hasOneAdmin[$record->get_base_id()])) {
|
||||||
->who_have_right(array('order_master'))
|
$query = new \User_Query($app);
|
||||||
->execute()->get_results());
|
$hasOneAdmin[$record->get_base_id()] = (Boolean) count($query->on_base_ids(array($record->get_base_id()))
|
||||||
|
->who_have_right(array('order_master'))
|
||||||
|
->execute()->get_results());
|
||||||
|
}
|
||||||
|
|
||||||
$collectionHasOrderAdmins->set($record->get_base_id(), $hasOneAdmin);
|
$collectionHasOrderAdmins->set($record->get_base_id(), $hasOneAdmin[$record->get_base_id()]);
|
||||||
|
|
||||||
if (!$hasOneAdmin) {
|
if (!$hasOneAdmin[$record->get_base_id()]) {
|
||||||
$toRemove[] = $key;
|
$toRemove[] = $key;
|
||||||
} else {
|
} else {
|
||||||
$orderElement = new OrderElement();
|
$orderElement = new OrderElement();
|
||||||
|
Reference in New Issue
Block a user