mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-15 05:53:13 +00:00
Add a namespace to Phraseanet doctrine entities
This commit is contained in:
@@ -88,7 +88,7 @@ class Authenticator
|
|||||||
|
|
||||||
public function refreshAccount(Session $session)
|
public function refreshAccount(Session $session)
|
||||||
{
|
{
|
||||||
if (!$this->em->getRepository('Alchemy\Phrasea\Model\Entities\Session')->findOneBy(['id' => $session->getId()])) {
|
if (!$this->em->getRepository('Phraseanet:Session')->findOneBy(['id' => $session->getId()])) {
|
||||||
throw new RuntimeException('Unable to refresh the session, it does not exist anymore');
|
throw new RuntimeException('Unable to refresh the session, it does not exist anymore');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,7 +120,7 @@ class Authenticator
|
|||||||
throw new RuntimeException('No session to close.');
|
throw new RuntimeException('No session to close.');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (null !== $session = $this->em->find('Alchemy\Phrasea\Model\Entities\Session', $this->session->get('session_id'))) {
|
if (null !== $session = $this->em->find('Phraseanet:Session', $this->session->get('session_id'))) {
|
||||||
$this->em->remove($session);
|
$this->em->remove($session);
|
||||||
$this->em->flush();
|
$this->em->flush();
|
||||||
}
|
}
|
||||||
@@ -154,7 +154,7 @@ class Authenticator
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($this->session->has('session_id')) {
|
if ($this->session->has('session_id')) {
|
||||||
if (null !== $this->em->find('Alchemy\Phrasea\Model\Entities\Session', $this->session->get('session_id'))) {
|
if (null !== $this->em->find('Phraseanet:Session', $this->session->get('session_id'))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -38,7 +38,7 @@ class Manager
|
|||||||
public function getSession($cookieValue)
|
public function getSession($cookieValue)
|
||||||
{
|
{
|
||||||
$session = $this->em
|
$session = $this->em
|
||||||
->getRepository('Alchemy\Phrasea\Model\Entities\Session')
|
->getRepository('Phraseanet:Session')
|
||||||
->findOneBy(['token' => $cookieValue]);
|
->findOneBy(['token' => $cookieValue]);
|
||||||
|
|
||||||
if (!$session) {
|
if (!$session) {
|
||||||
|
@@ -80,7 +80,7 @@ class FailureManager
|
|||||||
public function checkFailures($username, Request $request)
|
public function checkFailures($username, Request $request)
|
||||||
{
|
{
|
||||||
$failures = $this->em
|
$failures = $this->em
|
||||||
->getRepository('Alchemy\Phrasea\Model\Entities\AuthFailure')
|
->getRepository('Phraseanet:AuthFailure')
|
||||||
->findLockedFailuresMatching($username, $request->getClientIp());
|
->findLockedFailuresMatching($username, $request->getClientIp());
|
||||||
|
|
||||||
if (0 === count($failures)) {
|
if (0 === count($failures)) {
|
||||||
@@ -109,7 +109,7 @@ class FailureManager
|
|||||||
private function removeOldFailures()
|
private function removeOldFailures()
|
||||||
{
|
{
|
||||||
$failures = $this->em
|
$failures = $this->em
|
||||||
->getRepository('Alchemy\Phrasea\Model\Entities\AuthFailure')
|
->getRepository('Phraseanet:AuthFailure')
|
||||||
->findOldFailures('-2 months');
|
->findOldFailures('-2 months');
|
||||||
|
|
||||||
if (0 < count($failures)) {
|
if (0 < count($failures)) {
|
||||||
|
@@ -39,7 +39,7 @@ class ConnectedUsers implements ControllerProviderInterface
|
|||||||
|
|
||||||
public function listConnectedUsers(Application $app, Request $request)
|
public function listConnectedUsers(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
$dql = 'SELECT s FROM Alchemy\Phrasea\Model\Entities\Session s
|
$dql = 'SELECT s FROM Phraseanet:Session s
|
||||||
WHERE
|
WHERE
|
||||||
s.updated > :date
|
s.updated > :date
|
||||||
ORDER BY s.updated DESC';
|
ORDER BY s.updated DESC';
|
||||||
|
@@ -34,7 +34,7 @@ class Publications implements ControllerProviderInterface
|
|||||||
});
|
});
|
||||||
|
|
||||||
$controllers->get('/list/', function (PhraseaApplication $app) {
|
$controllers->get('/list/', function (PhraseaApplication $app) {
|
||||||
$feeds = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Feed')->getAllForUser(
|
$feeds = $app['EM']->getRepository('Phraseanet:Feed')->getAllForUser(
|
||||||
$app['acl']->get($app['authentication']->getUser())
|
$app['acl']->get($app['authentication']->getUser())
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -76,7 +76,7 @@ class Publications implements ControllerProviderInterface
|
|||||||
})->bind('admin_feeds_create');
|
})->bind('admin_feeds_create');
|
||||||
|
|
||||||
$controllers->get('/feed/{id}/', function (PhraseaApplication $app, Request $request, $id) {
|
$controllers->get('/feed/{id}/', function (PhraseaApplication $app, Request $request, $id) {
|
||||||
$feed = $app["EM"]->find('Alchemy\Phrasea\Model\Entities\Feed', $id);
|
$feed = $app["EM"]->find('Phraseanet:Feed', $id);
|
||||||
|
|
||||||
return $app['twig']
|
return $app['twig']
|
||||||
->render('admin/publications/fiche.html.twig', ['feed' => $feed, 'error' => $app['request']->query->get('error')]);
|
->render('admin/publications/fiche.html.twig', ['feed' => $feed, 'error' => $app['request']->query->get('error')]);
|
||||||
@@ -90,7 +90,7 @@ class Publications implements ControllerProviderInterface
|
|||||||
$app->abort(400, "Bad request");
|
$app->abort(400, "Bad request");
|
||||||
}
|
}
|
||||||
|
|
||||||
$feed = $app["EM"]->find('Alchemy\Phrasea\Model\Entities\Feed', $id);
|
$feed = $app["EM"]->find('Phraseanet:Feed', $id);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$collection = \collection::get_from_base_id($app, $request->request->get('base_id'));
|
$collection = \collection::get_from_base_id($app, $request->request->get('base_id'));
|
||||||
@@ -106,7 +106,7 @@ class Publications implements ControllerProviderInterface
|
|||||||
|
|
||||||
return $app->redirectPath('admin_feeds_list');
|
return $app->redirectPath('admin_feeds_list');
|
||||||
})->before(function (Request $request) use ($app) {
|
})->before(function (Request $request) use ($app) {
|
||||||
$feed = $app["EM"]->find('Alchemy\Phrasea\Model\Entities\Feed', $request->attributes->get('id'));
|
$feed = $app["EM"]->find('Phraseanet:Feed', $request->attributes->get('id'));
|
||||||
|
|
||||||
if (!$feed->isOwner($app['authentication']->getUser())) {
|
if (!$feed->isOwner($app['authentication']->getUser())) {
|
||||||
return $app->redirectPath('admin_feeds_feed', ['id' => $request->attributes->get('id'), 'error' => $app->trans('You are not the owner of this feed, you can not edit it')]);
|
return $app->redirectPath('admin_feeds_feed', ['id' => $request->attributes->get('id'), 'error' => $app->trans('You are not the owner of this feed, you can not edit it')]);
|
||||||
@@ -120,7 +120,7 @@ class Publications implements ControllerProviderInterface
|
|||||||
'success' => false,
|
'success' => false,
|
||||||
'message' => '',
|
'message' => '',
|
||||||
];
|
];
|
||||||
$feed = $app["EM"]->find('Alchemy\Phrasea\Model\Entities\Feed', $id);
|
$feed = $app["EM"]->find('Phraseanet:Feed', $id);
|
||||||
|
|
||||||
if (null === $feed) {
|
if (null === $feed) {
|
||||||
$app->abort(404, "Feed not found");
|
$app->abort(404, "Feed not found");
|
||||||
@@ -194,7 +194,7 @@ class Publications implements ControllerProviderInterface
|
|||||||
try {
|
try {
|
||||||
$request = $app['request'];
|
$request = $app['request'];
|
||||||
$user = \User_Adapter::getInstance($request->request->get('usr_id'), $app);
|
$user = \User_Adapter::getInstance($request->request->get('usr_id'), $app);
|
||||||
$feed = $app["EM"]->find('Alchemy\Phrasea\Model\Entities\Feed', $id);
|
$feed = $app["EM"]->find('Phraseanet:Feed', $id);
|
||||||
|
|
||||||
$publisher = new FeedPublisher();
|
$publisher = new FeedPublisher();
|
||||||
$publisher->setUsrId($user->get_id());
|
$publisher->setUsrId($user->get_id());
|
||||||
@@ -219,9 +219,9 @@ class Publications implements ControllerProviderInterface
|
|||||||
try {
|
try {
|
||||||
$request = $app['request'];
|
$request = $app['request'];
|
||||||
|
|
||||||
$feed = $app["EM"]->find('Alchemy\Phrasea\Model\Entities\Feed', $id);
|
$feed = $app["EM"]->find('Phraseanet:Feed', $id);
|
||||||
|
|
||||||
$publisher = $app["EM"]->find('Alchemy\Phrasea\Model\Entities\FeedPublisher', $request->request->get('publisher_id'));
|
$publisher = $app["EM"]->find('Phraseanet:FeedPublisher', $request->request->get('publisher_id'));
|
||||||
if (null === $publisher) {
|
if (null === $publisher) {
|
||||||
$app->abort(404, "Feed Publisher not found");
|
$app->abort(404, "Feed Publisher not found");
|
||||||
}
|
}
|
||||||
@@ -243,7 +243,7 @@ class Publications implements ControllerProviderInterface
|
|||||||
->assert('id', '\d+');
|
->assert('id', '\d+');
|
||||||
|
|
||||||
$controllers->post('/feed/{id}/delete/', function (PhraseaApplication $app, $id) {
|
$controllers->post('/feed/{id}/delete/', function (PhraseaApplication $app, $id) {
|
||||||
$feed = $app["EM"]->find('Alchemy\Phrasea\Model\Entities\Feed', $id);
|
$feed = $app["EM"]->find('Phraseanet:Feed', $id);
|
||||||
|
|
||||||
if (null === $feed) {
|
if (null === $feed) {
|
||||||
$app->abort(404);
|
$app->abort(404);
|
||||||
|
@@ -61,7 +61,7 @@ class Baskets implements ControllerProviderInterface
|
|||||||
public function deleteBasketElement(Application $app, Request $request)
|
public function deleteBasketElement(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\BasketElement');
|
$repository = $app['EM']->getRepository('Phraseanet:BasketElement');
|
||||||
$basketElement = $repository->findUserElement($request->request->get('p0'), $app['authentication']->getUser());
|
$basketElement = $repository->findUserElement($request->request->get('p0'), $app['authentication']->getUser());
|
||||||
$app['EM']->remove($basketElement);
|
$app['EM']->remove($basketElement);
|
||||||
$app['EM']->flush();
|
$app['EM']->flush();
|
||||||
@@ -167,7 +167,7 @@ class Baskets implements ControllerProviderInterface
|
|||||||
public function getBaskets(Application $app, Request $request)
|
public function getBaskets(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
$selectedBasketId = trim($request->get('courChuId', ''));
|
$selectedBasketId = trim($request->get('courChuId', ''));
|
||||||
$baskets = new ArrayCollection($app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Basket')->findActiveByUser($app['authentication']->getUser()));
|
$baskets = new ArrayCollection($app['EM']->getRepository('Phraseanet:Basket')->findActiveByUser($app['authentication']->getUser()));
|
||||||
$selectedBasket = null;
|
$selectedBasket = null;
|
||||||
|
|
||||||
if ('' === $selectedBasketId && $baskets->count() > 0) {
|
if ('' === $selectedBasketId && $baskets->count() > 0) {
|
||||||
@@ -202,7 +202,7 @@ class Baskets implements ControllerProviderInterface
|
|||||||
public function checkBaskets(Application $app, Request $request)
|
public function checkBaskets(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
$noview = 0;
|
$noview = 0;
|
||||||
$repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Basket');
|
$repository = $app['EM']->getRepository('Phraseanet:Basket');
|
||||||
|
|
||||||
/* @var $repository Alchemy\Phrasea\Model\Repositories\BasketRepository */
|
/* @var $repository Alchemy\Phrasea\Model\Repositories\BasketRepository */
|
||||||
$baskets = $repository->findActiveByUser($app['authentication']->getUser());
|
$baskets = $repository->findActiveByUser($app['authentication']->getUser());
|
||||||
|
@@ -80,7 +80,7 @@ class Datafiles extends AbstractDelivery
|
|||||||
|
|
||||||
if ($watermark && !$all_access) {
|
if ($watermark && !$all_access) {
|
||||||
|
|
||||||
$repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\BasketElement');
|
$repository = $app['EM']->getRepository('Phraseanet:BasketElement');
|
||||||
|
|
||||||
/* @var $repository BasketElementRepository */
|
/* @var $repository BasketElementRepository */
|
||||||
|
|
||||||
|
@@ -76,7 +76,7 @@ class Lightbox implements ControllerProviderInterface
|
|||||||
return $app->redirectPath('logout');
|
return $app->redirectPath('logout');
|
||||||
}
|
}
|
||||||
|
|
||||||
$repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Basket');
|
$repository = $app['EM']->getRepository('Phraseanet:Basket');
|
||||||
|
|
||||||
$basket_collection = array_merge(
|
$basket_collection = array_merge(
|
||||||
$repository->findActiveByUser($app['authentication']->getUser())
|
$repository->findActiveByUser($app['authentication']->getUser())
|
||||||
@@ -104,7 +104,7 @@ class Lightbox implements ControllerProviderInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
$basketElement = $app['EM']
|
$basketElement = $app['EM']
|
||||||
->getRepository('Alchemy\Phrasea\Model\Entities\BasketElement')
|
->getRepository('Phraseanet:BasketElement')
|
||||||
->findUserElement($sselcont_id, $app['authentication']->getUser());
|
->findUserElement($sselcont_id, $app['authentication']->getUser());
|
||||||
|
|
||||||
$parameters = [
|
$parameters = [
|
||||||
@@ -118,7 +118,7 @@ class Lightbox implements ControllerProviderInterface
|
|||||||
->assert('sselcont_id', '\d+');
|
->assert('sselcont_id', '\d+');
|
||||||
|
|
||||||
$controllers->get('/ajax/LOAD_BASKET_ELEMENT/{sselcont_id}/', function (SilexApplication $app, $sselcont_id) {
|
$controllers->get('/ajax/LOAD_BASKET_ELEMENT/{sselcont_id}/', function (SilexApplication $app, $sselcont_id) {
|
||||||
$repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\BasketElement');
|
$repository = $app['EM']->getRepository('Phraseanet:BasketElement');
|
||||||
|
|
||||||
$BasketElement = $repository->findUserElement($sselcont_id, $app['authentication']->getUser());
|
$BasketElement = $repository->findUserElement($sselcont_id, $app['authentication']->getUser());
|
||||||
|
|
||||||
@@ -164,7 +164,7 @@ class Lightbox implements ControllerProviderInterface
|
|||||||
|
|
||||||
$controllers->get('/ajax/LOAD_FEED_ITEM/{entry_id}/{item_id}/', function (SilexApplication $app, $entry_id, $item_id) {
|
$controllers->get('/ajax/LOAD_FEED_ITEM/{entry_id}/{item_id}/', function (SilexApplication $app, $entry_id, $item_id) {
|
||||||
|
|
||||||
$entry = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\FeedEntry')->find($entry_id);
|
$entry = $app['EM']->getRepository('Phraseanet:FeedEntry')->find($entry_id);
|
||||||
$item = $entry->getItem($item_id);
|
$item = $entry->getItem($item_id);
|
||||||
|
|
||||||
if ($app['browser']->isMobile()) {
|
if ($app['browser']->isMobile()) {
|
||||||
@@ -209,7 +209,7 @@ class Lightbox implements ControllerProviderInterface
|
|||||||
return $app->redirectPath('logout');
|
return $app->redirectPath('logout');
|
||||||
}
|
}
|
||||||
|
|
||||||
$repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Basket');
|
$repository = $app['EM']->getRepository('Phraseanet:Basket');
|
||||||
|
|
||||||
$basket_collection = $repository->findActiveValidationAndBasketByUser(
|
$basket_collection = $repository->findActiveValidationAndBasketByUser(
|
||||||
$app['authentication']->getUser()
|
$app['authentication']->getUser()
|
||||||
@@ -256,7 +256,7 @@ class Lightbox implements ControllerProviderInterface
|
|||||||
return $app->redirectPath('logout');
|
return $app->redirectPath('logout');
|
||||||
}
|
}
|
||||||
|
|
||||||
$repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Basket');
|
$repository = $app['EM']->getRepository('Phraseanet:Basket');
|
||||||
|
|
||||||
$basket_collection = $repository->findActiveValidationAndBasketByUser(
|
$basket_collection = $repository->findActiveValidationAndBasketByUser(
|
||||||
$app['authentication']->getUser()
|
$app['authentication']->getUser()
|
||||||
@@ -303,7 +303,7 @@ class Lightbox implements ControllerProviderInterface
|
|||||||
return $app->redirectPath('logout');
|
return $app->redirectPath('logout');
|
||||||
}
|
}
|
||||||
|
|
||||||
$feed_entry = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\FeedEntry')->find($entry_id);
|
$feed_entry = $app['EM']->getRepository('Phraseanet:FeedEntry')->find($entry_id);
|
||||||
|
|
||||||
$template = 'lightbox/feed.html.twig';
|
$template = 'lightbox/feed.html.twig';
|
||||||
|
|
||||||
@@ -346,7 +346,7 @@ class Lightbox implements ControllerProviderInterface
|
|||||||
Return new Response('You must provide a note value', 400);
|
Return new Response('You must provide a note value', 400);
|
||||||
}
|
}
|
||||||
|
|
||||||
$repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\BasketElement');
|
$repository = $app['EM']->getRepository('Phraseanet:BasketElement');
|
||||||
|
|
||||||
$basket_element = $repository->findUserElement($sselcont_id, $app['authentication']->getUser());
|
$basket_element = $repository->findUserElement($sselcont_id, $app['authentication']->getUser());
|
||||||
|
|
||||||
@@ -393,7 +393,7 @@ class Lightbox implements ControllerProviderInterface
|
|||||||
'datas' => $app->trans('Erreur lors de la mise a jour des donnes')
|
'datas' => $app->trans('Erreur lors de la mise a jour des donnes')
|
||||||
];
|
];
|
||||||
|
|
||||||
$repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\BasketElement');
|
$repository = $app['EM']->getRepository('Phraseanet:BasketElement');
|
||||||
|
|
||||||
$basket_element = $repository->findUserElement(
|
$basket_element = $repository->findUserElement(
|
||||||
$sselcont_id
|
$sselcont_id
|
||||||
|
@@ -117,7 +117,7 @@ class Permalink extends AbstractDelivery
|
|||||||
|
|
||||||
private function retrieveRecord($app, $databox, $token, $record_id, $subdef)
|
private function retrieveRecord($app, $databox, $token, $record_id, $subdef)
|
||||||
{
|
{
|
||||||
if (in_array($subdef, [\databox_subdef::CLASS_PREVIEW, \databox_subdef::CLASS_THUMBNAIL]) && $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\FeedItem')->isRecordInPublicFeed($app, $databox->get_sbas_id(), $record_id)) {
|
if (in_array($subdef, [\databox_subdef::CLASS_PREVIEW, \databox_subdef::CLASS_THUMBNAIL]) && $app['EM']->getRepository('Phraseanet:FeedItem')->isRecordInPublicFeed($app, $databox->get_sbas_id(), $record_id)) {
|
||||||
$record = $databox->get_record($record_id);
|
$record = $databox->get_record($record_id);
|
||||||
} else {
|
} else {
|
||||||
$record = \media_Permalink_Adapter::challenge_token($app, $databox, $token, $record_id, $subdef);
|
$record = \media_Permalink_Adapter::challenge_token($app, $databox, $token, $record_id, $subdef);
|
||||||
@@ -159,7 +159,7 @@ class Permalink extends AbstractDelivery
|
|||||||
$watermark = !$app['acl']->get($user)->has_right_on_base($record->get_base_id(), 'nowatermark');
|
$watermark = !$app['acl']->get($user)->has_right_on_base($record->get_base_id(), 'nowatermark');
|
||||||
|
|
||||||
if ($watermark) {
|
if ($watermark) {
|
||||||
$repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\BasketElement');
|
$repository = $app['EM']->getRepository('Phraseanet:BasketElement');
|
||||||
|
|
||||||
if (count($repository->findReceivedValidationElementsByRecord($record, $user)) > 0) {
|
if (count($repository->findReceivedValidationElementsByRecord($record, $user)) > 0) {
|
||||||
$watermark = false;
|
$watermark = false;
|
||||||
|
@@ -350,7 +350,7 @@ class BasketController implements ControllerProviderInterface
|
|||||||
|
|
||||||
foreach ($request->request->get('elements') as $bask_element_id) {
|
foreach ($request->request->get('elements') as $bask_element_id) {
|
||||||
try {
|
try {
|
||||||
$basket_element = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\BasketElement')
|
$basket_element = $app['EM']->getRepository('Phraseanet:BasketElement')
|
||||||
->findUserElement($bask_element_id, $app['authentication']->getUser());
|
->findUserElement($bask_element_id, $app['authentication']->getUser());
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
continue;
|
continue;
|
||||||
|
@@ -34,7 +34,7 @@ class Feed implements ControllerProviderInterface
|
|||||||
$app['firewall']->addMandatoryAuthentication($controllers);
|
$app['firewall']->addMandatoryAuthentication($controllers);
|
||||||
|
|
||||||
$controllers->post('/requestavailable/', function (Application $app, Request $request) {
|
$controllers->post('/requestavailable/', function (Application $app, Request $request) {
|
||||||
$feeds = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Feed')->getAllForUser(
|
$feeds = $app['EM']->getRepository('Phraseanet:Feed')->getAllForUser(
|
||||||
$app['acl']->get($app['authentication']->getUser())
|
$app['acl']->get($app['authentication']->getUser())
|
||||||
);
|
);
|
||||||
$publishing = RecordsRequest::fromRequest($app, $request, true, [], ['bas_chupub']);
|
$publishing = RecordsRequest::fromRequest($app, $request, true, [], ['bas_chupub']);
|
||||||
@@ -43,13 +43,13 @@ class Feed implements ControllerProviderInterface
|
|||||||
});
|
});
|
||||||
|
|
||||||
$controllers->post('/entry/create/', function (Application $app, Request $request) {
|
$controllers->post('/entry/create/', function (Application $app, Request $request) {
|
||||||
$feed = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Feed')->find($request->request->get('feed_id'));
|
$feed = $app['EM']->getRepository('Phraseanet:Feed')->find($request->request->get('feed_id'));
|
||||||
|
|
||||||
if (null === $feed) {
|
if (null === $feed) {
|
||||||
$app->abort(404, "Feed not found");
|
$app->abort(404, "Feed not found");
|
||||||
}
|
}
|
||||||
|
|
||||||
$publisher = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\FeedPublisher')->findOneBy(['feed' => $feed, 'usrId' => $app['authentication']->getUser()->get_id()]);
|
$publisher = $app['EM']->getRepository('Phraseanet:FeedPublisher')->findOneBy(['feed' => $feed, 'usrId' => $app['authentication']->getUser()->get_id()]);
|
||||||
|
|
||||||
if ('' === $title = trim($request->request->get('title', ''))) {
|
if ('' === $title = trim($request->request->get('title', ''))) {
|
||||||
$app->abort(400, "Bad request");
|
$app->abort(400, "Bad request");
|
||||||
@@ -95,13 +95,13 @@ class Feed implements ControllerProviderInterface
|
|||||||
});
|
});
|
||||||
|
|
||||||
$controllers->get('/entry/{id}/edit/', function (Application $app, Request $request, $id) {
|
$controllers->get('/entry/{id}/edit/', function (Application $app, Request $request, $id) {
|
||||||
$entry = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\FeedEntry')->find($id);
|
$entry = $app['EM']->getRepository('Phraseanet:FeedEntry')->find($id);
|
||||||
|
|
||||||
if (!$entry->isPublisher($app['authentication']->getUser())) {
|
if (!$entry->isPublisher($app['authentication']->getUser())) {
|
||||||
throw new AccessDeniedHttpException();
|
throw new AccessDeniedHttpException();
|
||||||
}
|
}
|
||||||
|
|
||||||
$feeds = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Feed')->getAllForUser($app['acl']->get($app['authentication']->getUser()));
|
$feeds = $app['EM']->getRepository('Phraseanet:Feed')->getAllForUser($app['acl']->get($app['authentication']->getUser()));
|
||||||
|
|
||||||
$datas = $app['twig']->render('prod/actions/publish/publish_edit.html.twig', ['entry' => $entry, 'feeds' => $feeds]);
|
$datas = $app['twig']->render('prod/actions/publish/publish_edit.html.twig', ['entry' => $entry, 'feeds' => $feeds]);
|
||||||
|
|
||||||
@@ -115,7 +115,7 @@ class Feed implements ControllerProviderInterface
|
|||||||
|
|
||||||
$controllers->post('/entry/{id}/update/', function (Application $app, Request $request, $id) {
|
$controllers->post('/entry/{id}/update/', function (Application $app, Request $request, $id) {
|
||||||
$datas = ['error' => true, 'message' => '', 'datas' => ''];
|
$datas = ['error' => true, 'message' => '', 'datas' => ''];
|
||||||
$entry = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\FeedEntry')->find($id);
|
$entry = $app['EM']->getRepository('Phraseanet:FeedEntry')->find($id);
|
||||||
|
|
||||||
if (null === $entry) {
|
if (null === $entry) {
|
||||||
$app->abort(404, 'Entry not found');
|
$app->abort(404, 'Entry not found');
|
||||||
@@ -136,7 +136,7 @@ class Feed implements ControllerProviderInterface
|
|||||||
$new_feed_id = $request->request->get('feed_id', $currentFeedId);
|
$new_feed_id = $request->request->get('feed_id', $currentFeedId);
|
||||||
if ($currentFeedId !== (int) $new_feed_id) {
|
if ($currentFeedId !== (int) $new_feed_id) {
|
||||||
|
|
||||||
$new_feed = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Feed')->find($new_feed_id);
|
$new_feed = $app['EM']->getRepository('Phraseanet:Feed')->find($new_feed_id);
|
||||||
|
|
||||||
if ($new_feed === null) {
|
if ($new_feed === null) {
|
||||||
$app->abort(404, 'Feed not found');
|
$app->abort(404, 'Feed not found');
|
||||||
@@ -155,7 +155,7 @@ class Feed implements ControllerProviderInterface
|
|||||||
if (count($item_sort_datas) != 2) {
|
if (count($item_sort_datas) != 2) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$item = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\FeedItem')->find($item_sort_datas[0]);
|
$item = $app['EM']->getRepository('Phraseanet:FeedItem')->find($item_sort_datas[0]);
|
||||||
$item->setOrd($item_sort_datas[1]);
|
$item->setOrd($item_sort_datas[1]);
|
||||||
$app['EM']->persist($item);
|
$app['EM']->persist($item);
|
||||||
}
|
}
|
||||||
@@ -179,7 +179,7 @@ class Feed implements ControllerProviderInterface
|
|||||||
$controllers->post('/entry/{id}/delete/', function (Application $app, Request $request, $id) {
|
$controllers->post('/entry/{id}/delete/', function (Application $app, Request $request, $id) {
|
||||||
$datas = ['error' => true, 'message' => ''];
|
$datas = ['error' => true, 'message' => ''];
|
||||||
|
|
||||||
$entry = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\FeedEntry')->find($id);
|
$entry = $app['EM']->getRepository('Phraseanet:FeedEntry')->find($id);
|
||||||
|
|
||||||
if (null === $entry) {
|
if (null === $entry) {
|
||||||
$app->abort(404, 'Entry not found');
|
$app->abort(404, 'Entry not found');
|
||||||
@@ -203,7 +203,7 @@ class Feed implements ControllerProviderInterface
|
|||||||
$page = (int) $request->query->get('page');
|
$page = (int) $request->query->get('page');
|
||||||
$page = $page > 0 ? $page : 1;
|
$page = $page > 0 ? $page : 1;
|
||||||
|
|
||||||
$feeds = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Feed')->getAllForUser($app['acl']->get($app['authentication']->getUser()));
|
$feeds = $app['EM']->getRepository('Phraseanet:Feed')->getAllForUser($app['acl']->get($app['authentication']->getUser()));
|
||||||
|
|
||||||
$datas = $app['twig']->render('prod/feeds/feeds.html.twig', [
|
$datas = $app['twig']->render('prod/feeds/feeds.html.twig', [
|
||||||
'feeds' => $feeds,
|
'feeds' => $feeds,
|
||||||
@@ -218,11 +218,11 @@ class Feed implements ControllerProviderInterface
|
|||||||
$page = (int) $request->query->get('page');
|
$page = (int) $request->query->get('page');
|
||||||
$page = $page > 0 ? $page : 1;
|
$page = $page > 0 ? $page : 1;
|
||||||
|
|
||||||
$feed = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Feed')->find($id);
|
$feed = $app['EM']->getRepository('Phraseanet:Feed')->find($id);
|
||||||
if (!$feed->isAccessible($app['authentication']->getUser(), $app)) {
|
if (!$feed->isAccessible($app['authentication']->getUser(), $app)) {
|
||||||
$app->abort(404, 'Feed not found');
|
$app->abort(404, 'Feed not found');
|
||||||
}
|
}
|
||||||
$feeds = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Feed')->getAllForUser($app['acl']->get($app['authentication']->getUser()));
|
$feeds = $app['EM']->getRepository('Phraseanet:Feed')->getAllForUser($app['acl']->get($app['authentication']->getUser()));
|
||||||
|
|
||||||
$datas = $app['twig']->render('prod/feeds/feeds.html.twig', ['feed' => $feed, 'feeds' => $feeds, 'page' => $page]);
|
$datas = $app['twig']->render('prod/feeds/feeds.html.twig', ['feed' => $feed, 'feeds' => $feeds, 'page' => $page]);
|
||||||
|
|
||||||
@@ -234,7 +234,7 @@ class Feed implements ControllerProviderInterface
|
|||||||
$controllers->get('/subscribe/aggregated/', function (Application $app, Request $request) {
|
$controllers->get('/subscribe/aggregated/', function (Application $app, Request $request) {
|
||||||
$renew = ($request->query->get('renew') === 'true');
|
$renew = ($request->query->get('renew') === 'true');
|
||||||
|
|
||||||
$feeds = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Feed')->getAllForUser($app['acl']->get($app['authentication']->getUser()));
|
$feeds = $app['EM']->getRepository('Phraseanet:Feed')->getAllForUser($app['acl']->get($app['authentication']->getUser()));
|
||||||
|
|
||||||
$link = $app['feed.aggregate-link-generator']->generate(new Aggregate($app['EM'], $feeds),
|
$link = $app['feed.aggregate-link-generator']->generate(new Aggregate($app['EM'], $feeds),
|
||||||
$app['authentication']->getUser(),
|
$app['authentication']->getUser(),
|
||||||
@@ -255,7 +255,7 @@ class Feed implements ControllerProviderInterface
|
|||||||
$controllers->get('/subscribe/{id}/', function (Application $app, Request $request, $id) {
|
$controllers->get('/subscribe/{id}/', function (Application $app, Request $request, $id) {
|
||||||
$renew = ($request->query->get('renew') === 'true');
|
$renew = ($request->query->get('renew') === 'true');
|
||||||
|
|
||||||
$feed = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Feed')->find($id);
|
$feed = $app['EM']->getRepository('Phraseanet:Feed')->find($id);
|
||||||
if (!$feed->isAccessible($app['authentication']->getUser(), $app)) {
|
if (!$feed->isAccessible($app['authentication']->getUser(), $app)) {
|
||||||
$app->abort(404, 'Feed not found');
|
$app->abort(404, 'Feed not found');
|
||||||
}
|
}
|
||||||
|
@@ -85,7 +85,7 @@ class Lazaret implements ControllerProviderInterface
|
|||||||
$lazaretFiles = null;
|
$lazaretFiles = null;
|
||||||
|
|
||||||
if (count($baseIds) > 0) {
|
if (count($baseIds) > 0) {
|
||||||
$lazaretRepository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\LazaretFile');
|
$lazaretRepository = $app['EM']->getRepository('Phraseanet:LazaretFile');
|
||||||
|
|
||||||
$lazaretFiles = $lazaretRepository->findPerPage(
|
$lazaretFiles = $lazaretRepository->findPerPage(
|
||||||
$baseIds, $request->query->get('offset', 0), $request->query->get('limit', 10)
|
$baseIds, $request->query->get('offset', 0), $request->query->get('limit', 10)
|
||||||
@@ -110,7 +110,7 @@ class Lazaret implements ControllerProviderInterface
|
|||||||
{
|
{
|
||||||
$ret = ['success' => false, 'message' => '', 'result' => []];
|
$ret = ['success' => false, 'message' => '', 'result' => []];
|
||||||
|
|
||||||
$lazaretFile = $app['EM']->find('Alchemy\Phrasea\Model\Entities\LazaretFile', $file_id);
|
$lazaretFile = $app['EM']->find('Phraseanet:LazaretFile', $file_id);
|
||||||
|
|
||||||
/* @var $lazaretFile LazaretFile */
|
/* @var $lazaretFile LazaretFile */
|
||||||
if (null === $lazaretFile) {
|
if (null === $lazaretFile) {
|
||||||
@@ -163,7 +163,7 @@ class Lazaret implements ControllerProviderInterface
|
|||||||
return $app->json($ret);
|
return $app->json($ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
$lazaretFile = $app['EM']->find('Alchemy\Phrasea\Model\Entities\LazaretFile', $file_id);
|
$lazaretFile = $app['EM']->find('Phraseanet:LazaretFile', $file_id);
|
||||||
|
|
||||||
/* @var $lazaretFile LazaretFile */
|
/* @var $lazaretFile LazaretFile */
|
||||||
if (null === $lazaretFile) {
|
if (null === $lazaretFile) {
|
||||||
@@ -272,7 +272,7 @@ class Lazaret implements ControllerProviderInterface
|
|||||||
{
|
{
|
||||||
$ret = ['success' => false, 'message' => '', 'result' => []];
|
$ret = ['success' => false, 'message' => '', 'result' => []];
|
||||||
|
|
||||||
$lazaretFile = $app['EM']->find('Alchemy\Phrasea\Model\Entities\LazaretFile', $file_id);
|
$lazaretFile = $app['EM']->find('Phraseanet:LazaretFile', $file_id);
|
||||||
/* @var $lazaretFile LazaretFile */
|
/* @var $lazaretFile LazaretFile */
|
||||||
if (null === $lazaretFile) {
|
if (null === $lazaretFile) {
|
||||||
$ret['message'] = $app->trans('File is not present in quarantine anymore, please refresh');
|
$ret['message'] = $app->trans('File is not present in quarantine anymore, please refresh');
|
||||||
@@ -319,7 +319,7 @@ class Lazaret implements ControllerProviderInterface
|
|||||||
{
|
{
|
||||||
$ret = ['success' => false, 'message' => '', 'result' => []];
|
$ret = ['success' => false, 'message' => '', 'result' => []];
|
||||||
|
|
||||||
$lazaretFiles = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\LazaretFile')->findAll();
|
$lazaretFiles = $app['EM']->getRepository('Phraseanet:LazaretFile')->findAll();
|
||||||
|
|
||||||
$app['EM']->beginTransaction();
|
$app['EM']->beginTransaction();
|
||||||
|
|
||||||
@@ -357,7 +357,7 @@ class Lazaret implements ControllerProviderInterface
|
|||||||
return $app->json($ret);
|
return $app->json($ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
$lazaretFile = $app['EM']->find('Alchemy\Phrasea\Model\Entities\LazaretFile', $file_id);
|
$lazaretFile = $app['EM']->find('Phraseanet:LazaretFile', $file_id);
|
||||||
|
|
||||||
/* @var $lazaretFile LazaretFile */
|
/* @var $lazaretFile LazaretFile */
|
||||||
if (null === $lazaretFile) {
|
if (null === $lazaretFile) {
|
||||||
@@ -428,7 +428,7 @@ class Lazaret implements ControllerProviderInterface
|
|||||||
*/
|
*/
|
||||||
public function thumbnailElement(Application $app, Request $request, $file_id)
|
public function thumbnailElement(Application $app, Request $request, $file_id)
|
||||||
{
|
{
|
||||||
$lazaretFile = $app['EM']->find('Alchemy\Phrasea\Model\Entities\LazaretFile', $file_id);
|
$lazaretFile = $app['EM']->find('Phraseanet:LazaretFile', $file_id);
|
||||||
|
|
||||||
/* @var $lazaretFile LazaretFile */
|
/* @var $lazaretFile LazaretFile */
|
||||||
if (null === $lazaretFile) {
|
if (null === $lazaretFile) {
|
||||||
|
@@ -193,8 +193,8 @@ class Order implements ControllerProviderInterface
|
|||||||
|
|
||||||
$baseIds = array_keys($app['acl']->get($app['authentication']->getUser())->get_granted_base(['order_master']));
|
$baseIds = array_keys($app['acl']->get($app['authentication']->getUser())->get_granted_base(['order_master']));
|
||||||
|
|
||||||
$ordersList = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Order')->listOrders($baseIds, $offsetStart, $perPage, $sort);
|
$ordersList = $app['EM']->getRepository('Phraseanet:Order')->listOrders($baseIds, $offsetStart, $perPage, $sort);
|
||||||
$total = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Order')->countTotalOrders($baseIds);
|
$total = $app['EM']->getRepository('Phraseanet:Order')->countTotalOrders($baseIds);
|
||||||
|
|
||||||
return $app['twig']->render('prod/orders/order_box.html.twig', [
|
return $app['twig']->render('prod/orders/order_box.html.twig', [
|
||||||
'page' => $page,
|
'page' => $page,
|
||||||
@@ -216,7 +216,7 @@ class Order implements ControllerProviderInterface
|
|||||||
*/
|
*/
|
||||||
public function displayOneOrder(Application $app, Request $request, $order_id)
|
public function displayOneOrder(Application $app, Request $request, $order_id)
|
||||||
{
|
{
|
||||||
$order = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Order')->find($order_id);
|
$order = $app['EM']->getRepository('Phraseanet:Order')->find($order_id);
|
||||||
if (null === $order) {
|
if (null === $order) {
|
||||||
throw new NotFoundHttpException('Order not found');
|
throw new NotFoundHttpException('Order not found');
|
||||||
}
|
}
|
||||||
@@ -237,7 +237,7 @@ class Order implements ControllerProviderInterface
|
|||||||
public function sendOrder(Application $app, Request $request, $order_id)
|
public function sendOrder(Application $app, Request $request, $order_id)
|
||||||
{
|
{
|
||||||
$success = false;
|
$success = false;
|
||||||
$order = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Order')->find($order_id);
|
$order = $app['EM']->getRepository('Phraseanet:Order')->find($order_id);
|
||||||
if (null === $order) {
|
if (null === $order) {
|
||||||
throw new NotFoundHttpException('Order not found');
|
throw new NotFoundHttpException('Order not found');
|
||||||
}
|
}
|
||||||
@@ -324,7 +324,7 @@ class Order implements ControllerProviderInterface
|
|||||||
public function denyOrder(Application $app, Request $request, $order_id)
|
public function denyOrder(Application $app, Request $request, $order_id)
|
||||||
{
|
{
|
||||||
$success = false;
|
$success = false;
|
||||||
$order = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Order')->find($order_id);
|
$order = $app['EM']->getRepository('Phraseanet:Order')->find($order_id);
|
||||||
if (null === $order) {
|
if (null === $order) {
|
||||||
throw new NotFoundHttpException('Order not found');
|
throw new NotFoundHttpException('Order not found');
|
||||||
}
|
}
|
||||||
|
@@ -117,7 +117,7 @@ class Push implements ControllerProviderInterface
|
|||||||
$controllers->post('/sendform/', function (Application $app) use ($userSelection) {
|
$controllers->post('/sendform/', function (Application $app) use ($userSelection) {
|
||||||
$push = new RecordHelper\Push($app, $app['request']);
|
$push = new RecordHelper\Push($app, $app['request']);
|
||||||
|
|
||||||
$repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\UsrList');
|
$repository = $app['EM']->getRepository('Phraseanet:UsrList');
|
||||||
|
|
||||||
$RecommendedUsers = $userSelection($push->get_elements());
|
$RecommendedUsers = $userSelection($push->get_elements());
|
||||||
|
|
||||||
@@ -135,7 +135,7 @@ class Push implements ControllerProviderInterface
|
|||||||
$controllers->post('/validateform/', function (Application $app) use ($userSelection) {
|
$controllers->post('/validateform/', function (Application $app) use ($userSelection) {
|
||||||
$push = new RecordHelper\Push($app, $app['request']);
|
$push = new RecordHelper\Push($app, $app['request']);
|
||||||
|
|
||||||
$repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\UsrList');
|
$repository = $app['EM']->getRepository('Phraseanet:UsrList');
|
||||||
|
|
||||||
$RecommendedUsers = $userSelection($push->get_elements());
|
$RecommendedUsers = $userSelection($push->get_elements());
|
||||||
|
|
||||||
@@ -277,7 +277,7 @@ class Push implements ControllerProviderInterface
|
|||||||
try {
|
try {
|
||||||
$pusher = new RecordHelper\Push($app, $app['request']);
|
$pusher = new RecordHelper\Push($app, $app['request']);
|
||||||
|
|
||||||
$repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Basket');
|
$repository = $app['EM']->getRepository('Phraseanet:Basket');
|
||||||
|
|
||||||
$validation_name = $request->request->get('name', $app->trans('Validation from %user%', ['%user%' => $app['authentication']->getUser()->get_display_name()]));
|
$validation_name = $request->request->get('name', $app->trans('Validation from %user%', ['%user%' => $app['authentication']->getUser()->get_display_name()]));
|
||||||
$validation_description = $request->request->get('validation_description');
|
$validation_description = $request->request->get('validation_description');
|
||||||
@@ -492,7 +492,7 @@ class Push implements ControllerProviderInterface
|
|||||||
$controllers->get('/list/{list_id}/', function (Application $app, $list_id) use ($listFormatter) {
|
$controllers->get('/list/{list_id}/', function (Application $app, $list_id) use ($listFormatter) {
|
||||||
$datas = null;
|
$datas = null;
|
||||||
|
|
||||||
$repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\UsrList');
|
$repository = $app['EM']->getRepository('Phraseanet:UsrList');
|
||||||
|
|
||||||
$list = $repository->findUserListByUserAndId($app, $app['authentication']->getUser(), $list_id);
|
$list = $repository->findUserListByUserAndId($app, $app['authentication']->getUser(), $list_id);
|
||||||
|
|
||||||
@@ -592,7 +592,7 @@ class Push implements ControllerProviderInterface
|
|||||||
->limit(0, 50)
|
->limit(0, 50)
|
||||||
->execute()->get_results();
|
->execute()->get_results();
|
||||||
|
|
||||||
$repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\UsrList');
|
$repository = $app['EM']->getRepository('Phraseanet:UsrList');
|
||||||
|
|
||||||
$lists = $repository->findUserListLike($app['authentication']->getUser(), $request->query->get('query'));
|
$lists = $repository->findUserListLike($app['authentication']->getUser(), $request->query->get('query'));
|
||||||
|
|
||||||
@@ -615,7 +615,7 @@ class Push implements ControllerProviderInterface
|
|||||||
|
|
||||||
$controllers->match('/edit-list/{list_id}/', function (Application $app, Request $request, $list_id) {
|
$controllers->match('/edit-list/{list_id}/', function (Application $app, Request $request, $list_id) {
|
||||||
|
|
||||||
$repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\UsrList');
|
$repository = $app['EM']->getRepository('Phraseanet:UsrList');
|
||||||
|
|
||||||
$list = $repository->findUserListByUserAndId($app, $app['authentication']->getUser(), $list_id);
|
$list = $repository->findUserListByUserAndId($app, $app['authentication']->getUser(), $list_id);
|
||||||
|
|
||||||
|
@@ -152,8 +152,8 @@ class Records implements ControllerProviderInterface
|
|||||||
'candeleterecord'
|
'candeleterecord'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$basketElementsRepository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\BasketElement');
|
$basketElementsRepository = $app['EM']->getRepository('Phraseanet:BasketElement');
|
||||||
$StoryWZRepository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\StoryWZ');
|
$StoryWZRepository = $app['EM']->getRepository('Phraseanet:StoryWZ');
|
||||||
|
|
||||||
$deleted = [];
|
$deleted = [];
|
||||||
|
|
||||||
|
@@ -71,7 +71,7 @@ class Root implements ControllerProviderInterface
|
|||||||
$cssfile = '000000';
|
$cssfile = '000000';
|
||||||
}
|
}
|
||||||
|
|
||||||
$feeds = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Feed')->getAllForUser($app['acl']->get($app['authentication']->getUser()));
|
$feeds = $app['EM']->getRepository('Phraseanet:Feed')->getAllForUser($app['acl']->get($app['authentication']->getUser()));
|
||||||
$aggregate = Aggregate::createFromUser($app, $app['authentication']->getUser());
|
$aggregate = Aggregate::createFromUser($app, $app['authentication']->getUser());
|
||||||
|
|
||||||
$thjslist = "";
|
$thjslist = "";
|
||||||
|
@@ -80,7 +80,7 @@ class UsrLists implements ControllerProviderInterface
|
|||||||
$lists = new ArrayCollection();
|
$lists = new ArrayCollection();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\UsrList');
|
$repository = $app['EM']->getRepository('Phraseanet:UsrList');
|
||||||
|
|
||||||
$lists = $repository->findUserLists($app['authentication']->getUser());
|
$lists = $repository->findUserLists($app['authentication']->getUser());
|
||||||
|
|
||||||
@@ -193,7 +193,7 @@ class UsrLists implements ControllerProviderInterface
|
|||||||
|
|
||||||
public function displayList(Application $app, Request $request, $list_id)
|
public function displayList(Application $app, Request $request, $list_id)
|
||||||
{
|
{
|
||||||
$repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\UsrList');
|
$repository = $app['EM']->getRepository('Phraseanet:UsrList');
|
||||||
|
|
||||||
$list = $repository->findUserListByUserAndId($app, $app['authentication']->getUser(), $list_id);
|
$list = $repository->findUserListByUserAndId($app, $app['authentication']->getUser(), $list_id);
|
||||||
|
|
||||||
@@ -251,7 +251,7 @@ class UsrLists implements ControllerProviderInterface
|
|||||||
throw new ControllerException($app->trans('List name is required'));
|
throw new ControllerException($app->trans('List name is required'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\UsrList');
|
$repository = $app['EM']->getRepository('Phraseanet:UsrList');
|
||||||
|
|
||||||
$list = $repository->findUserListByUserAndId($app, $app['authentication']->getUser(), $list_id);
|
$list = $repository->findUserListByUserAndId($app, $app['authentication']->getUser(), $list_id);
|
||||||
|
|
||||||
@@ -282,7 +282,7 @@ class UsrLists implements ControllerProviderInterface
|
|||||||
public function removeList(Application $app, $list_id)
|
public function removeList(Application $app, $list_id)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\UsrList');
|
$repository = $app['EM']->getRepository('Phraseanet:UsrList');
|
||||||
|
|
||||||
$list = $repository->findUserListByUserAndId($app, $app['authentication']->getUser(), $list_id);
|
$list = $repository->findUserListByUserAndId($app, $app['authentication']->getUser(), $list_id);
|
||||||
|
|
||||||
@@ -316,7 +316,7 @@ class UsrLists implements ControllerProviderInterface
|
|||||||
public function removeUser(Application $app, $list_id, $usr_id)
|
public function removeUser(Application $app, $list_id, $usr_id)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\UsrList');
|
$repository = $app['EM']->getRepository('Phraseanet:UsrList');
|
||||||
|
|
||||||
$list = $repository->findUserListByUserAndId($app, $app['authentication']->getUser(), $list_id);
|
$list = $repository->findUserListByUserAndId($app, $app['authentication']->getUser(), $list_id);
|
||||||
/* @var $list UsrList */
|
/* @var $list UsrList */
|
||||||
@@ -325,7 +325,7 @@ class UsrLists implements ControllerProviderInterface
|
|||||||
throw new ControllerException($app->trans('You are not authorized to do this'));
|
throw new ControllerException($app->trans('You are not authorized to do this'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$entry_repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\UsrListEntry');
|
$entry_repository = $app['EM']->getRepository('Phraseanet:UsrListEntry');
|
||||||
|
|
||||||
$user_entry = $entry_repository->findEntryByListAndUsrId($list, $usr_id);
|
$user_entry = $entry_repository->findEntryByListAndUsrId($list, $usr_id);
|
||||||
|
|
||||||
@@ -358,7 +358,7 @@ class UsrLists implements ControllerProviderInterface
|
|||||||
throw new ControllerException('Invalid or missing parameter usr_ids');
|
throw new ControllerException('Invalid or missing parameter usr_ids');
|
||||||
}
|
}
|
||||||
|
|
||||||
$repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\UsrList');
|
$repository = $app['EM']->getRepository('Phraseanet:UsrList');
|
||||||
|
|
||||||
$list = $repository->findUserListByUserAndId($app, $app['authentication']->getUser(), $list_id);
|
$list = $repository->findUserListByUserAndId($app, $app['authentication']->getUser(), $list_id);
|
||||||
/* @var $list UsrList */
|
/* @var $list UsrList */
|
||||||
@@ -422,7 +422,7 @@ class UsrLists implements ControllerProviderInterface
|
|||||||
$list = null;
|
$list = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\UsrList');
|
$repository = $app['EM']->getRepository('Phraseanet:UsrList');
|
||||||
|
|
||||||
$list = $repository->findUserListByUserAndId($app, $app['authentication']->getUser(), $list_id);
|
$list = $repository->findUserListByUserAndId($app, $app['authentication']->getUser(), $list_id);
|
||||||
/* @var $list UsrList */
|
/* @var $list UsrList */
|
||||||
@@ -452,7 +452,7 @@ class UsrLists implements ControllerProviderInterface
|
|||||||
throw new BadRequestHttpException('Role is invalid');
|
throw new BadRequestHttpException('Role is invalid');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\UsrList');
|
$repository = $app['EM']->getRepository('Phraseanet:UsrList');
|
||||||
|
|
||||||
$list = $repository->findUserListByUserAndId($app, $app['authentication']->getUser(), $list_id);
|
$list = $repository->findUserListByUserAndId($app, $app['authentication']->getUser(), $list_id);
|
||||||
/* @var $list UsrList */
|
/* @var $list UsrList */
|
||||||
@@ -508,7 +508,7 @@ class UsrLists implements ControllerProviderInterface
|
|||||||
public function unshareWithUser(Application $app, $list_id, $usr_id)
|
public function unshareWithUser(Application $app, $list_id, $usr_id)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\UsrList');
|
$repository = $app['EM']->getRepository('Phraseanet:UsrList');
|
||||||
|
|
||||||
$list = $repository->findUserListByUserAndId($app, $app['authentication']->getUser(), $list_id);
|
$list = $repository->findUserListByUserAndId($app, $app['authentication']->getUser(), $list_id);
|
||||||
/* @var $list UsrList */
|
/* @var $list UsrList */
|
||||||
@@ -517,7 +517,7 @@ class UsrLists implements ControllerProviderInterface
|
|||||||
throw new \Exception($app->trans('You are not authorized to do this'));
|
throw new \Exception($app->trans('You are not authorized to do this'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$owners_repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\UsrListOwner');
|
$owners_repository = $app['EM']->getRepository('Phraseanet:UsrListOwner');
|
||||||
|
|
||||||
$owner = $owners_repository->findByListAndUsrId($list, $usr_id);
|
$owner = $owners_repository->findByListAndUsrId($list, $usr_id);
|
||||||
|
|
||||||
|
@@ -80,7 +80,7 @@ class WorkZone implements ControllerProviderInterface
|
|||||||
{
|
{
|
||||||
$request = $app['request'];
|
$request = $app['request'];
|
||||||
|
|
||||||
$BasketRepo = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Basket');
|
$BasketRepo = $app['EM']->getRepository('Phraseanet:Basket');
|
||||||
|
|
||||||
$Page = (int) $request->query->get('Page', 0);
|
$Page = (int) $request->query->get('Page', 0);
|
||||||
|
|
||||||
@@ -123,7 +123,7 @@ class WorkZone implements ControllerProviderInterface
|
|||||||
throw new BadRequestHttpException('Missing parameters stories');
|
throw new BadRequestHttpException('Missing parameters stories');
|
||||||
}
|
}
|
||||||
|
|
||||||
$StoryWZRepo = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\StoryWZ');
|
$StoryWZRepo = $app['EM']->getRepository('Phraseanet:StoryWZ');
|
||||||
|
|
||||||
$alreadyFixed = $done = 0;
|
$alreadyFixed = $done = 0;
|
||||||
|
|
||||||
@@ -184,7 +184,7 @@ class WorkZone implements ControllerProviderInterface
|
|||||||
{
|
{
|
||||||
$Story = new \record_adapter($app, $sbas_id, $record_id);
|
$Story = new \record_adapter($app, $sbas_id, $record_id);
|
||||||
|
|
||||||
$repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\StoryWZ');
|
$repository = $app['EM']->getRepository('Phraseanet:StoryWZ');
|
||||||
|
|
||||||
$StoryWZ = $repository->findUserStory($app, $app['authentication']->getUser(), $Story);
|
$StoryWZ = $repository->findUserStory($app, $app['authentication']->getUser(), $Story);
|
||||||
|
|
||||||
|
@@ -213,7 +213,7 @@ class RecordsRequest extends ArrayCollection
|
|||||||
$received[$basket_element->getRecord($app)->get_serialize_key()] = $basket_element->getRecord($app);
|
$received[$basket_element->getRecord($app)->get_serialize_key()] = $basket_element->getRecord($app);
|
||||||
}
|
}
|
||||||
} elseif ($request->get('story')) {
|
} elseif ($request->get('story')) {
|
||||||
$repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\StoryWZ');
|
$repository = $app['EM']->getRepository('Phraseanet:StoryWZ');
|
||||||
|
|
||||||
$storyWZ = $repository->findByUserAndId(
|
$storyWZ = $repository->findByUserAndId(
|
||||||
$app, $app['authentication']->getUser()
|
$app, $app['authentication']->getUser()
|
||||||
|
@@ -267,7 +267,7 @@ class Account implements ControllerProviderInterface
|
|||||||
*/
|
*/
|
||||||
public function accountSessionsAccess(Application $app, Request $request)
|
public function accountSessionsAccess(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
$dql = 'SELECT s FROM Alchemy\Phrasea\Model\Entities\Session s
|
$dql = 'SELECT s FROM Phraseanet:Session s
|
||||||
WHERE s.usr_id = :usr_id
|
WHERE s.usr_id = :usr_id
|
||||||
ORDER BY s.created DESC';
|
ORDER BY s.created DESC';
|
||||||
|
|
||||||
|
@@ -52,7 +52,7 @@ class Login implements ControllerProviderInterface
|
|||||||
{
|
{
|
||||||
$items = [];
|
$items = [];
|
||||||
|
|
||||||
foreach ($app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\FeedItem')->loadLatest($app, 20) as $item) {
|
foreach ($app['EM']->getRepository('Phraseanet:FeedItem')->loadLatest($app, 20) as $item) {
|
||||||
$record = $item->getRecord($app);
|
$record = $item->getRecord($app);
|
||||||
$preview = $record->get_subdef('preview');
|
$preview = $record->get_subdef('preview');
|
||||||
$permalink = $preview->get_permalink();
|
$permalink = $preview->get_permalink();
|
||||||
@@ -304,7 +304,7 @@ class Login implements ControllerProviderInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
$userAuthProvider = $app['EM']
|
$userAuthProvider = $app['EM']
|
||||||
->getRepository('Alchemy\Phrasea\Model\Entities\UsrAuthProvider')
|
->getRepository('Phraseanet:UsrAuthProvider')
|
||||||
->findWithProviderAndId($token->getProvider()->getId(), $token->getId());
|
->findWithProviderAndId($token->getProvider()->getId(), $token->getId());
|
||||||
|
|
||||||
if (null !== $userAuthProvider) {
|
if (null !== $userAuthProvider) {
|
||||||
@@ -762,7 +762,7 @@ class Login implements ControllerProviderInterface
|
|||||||
$app->addFlash('error', $app->trans('login::erreur: No available connection - Please contact sys-admin'));
|
$app->addFlash('error', $app->trans('login::erreur: No available connection - Please contact sys-admin'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$feeds = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Feed')->findBy(['public' => true], ['updatedOn' => 'DESC']);
|
$feeds = $app['EM']->getRepository('Phraseanet:Feed')->findBy(['public' => true], ['updatedOn' => 'DESC']);
|
||||||
|
|
||||||
$form = $app->form(new PhraseaAuthenticationForm());
|
$form = $app->form(new PhraseaAuthenticationForm());
|
||||||
$form->setData([
|
$form->setData([
|
||||||
@@ -854,7 +854,7 @@ class Login implements ControllerProviderInterface
|
|||||||
$date = new \DateTime('+' . (int) $app['conf']->get(['registry', 'actions', 'validation-reminder-days']) . ' days');
|
$date = new \DateTime('+' . (int) $app['conf']->get(['registry', 'actions', 'validation-reminder-days']) . ' days');
|
||||||
|
|
||||||
foreach ($app['EM']
|
foreach ($app['EM']
|
||||||
->getRepository('Alchemy\Phrasea\Model\Entities\ValidationParticipant')
|
->getRepository('Phraseanet:ValidationParticipant')
|
||||||
->findNotConfirmedAndNotRemindedParticipantsByExpireDate($date) as $participant) {
|
->findNotConfirmedAndNotRemindedParticipantsByExpireDate($date) as $participant) {
|
||||||
|
|
||||||
/* @var $participant ValidationParticipant */
|
/* @var $participant ValidationParticipant */
|
||||||
@@ -927,7 +927,7 @@ class Login implements ControllerProviderInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
$userAuthProvider = $app['EM']
|
$userAuthProvider = $app['EM']
|
||||||
->getRepository('Alchemy\Phrasea\Model\Entities\UsrAuthProvider')
|
->getRepository('Phraseanet:UsrAuthProvider')
|
||||||
->findWithProviderAndId($token->getProvider()->getId(), $token->getId());
|
->findWithProviderAndId($token->getProvider()->getId(), $token->getId());
|
||||||
|
|
||||||
if (null !== $userAuthProvider) {
|
if (null !== $userAuthProvider) {
|
||||||
@@ -1058,7 +1058,7 @@ class Login implements ControllerProviderInterface
|
|||||||
if (!$user->is_guest() && $request->cookies->has('invite-usr_id')) {
|
if (!$user->is_guest() && $request->cookies->has('invite-usr_id')) {
|
||||||
if ($user->get_id() != $inviteUsrId = $request->cookies->get('invite-usr_id')) {
|
if ($user->get_id() != $inviteUsrId = $request->cookies->get('invite-usr_id')) {
|
||||||
|
|
||||||
$repo = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Basket');
|
$repo = $app['EM']->getRepository('Phraseanet:Basket');
|
||||||
$baskets = $repo->findBy(['usr_id' => $inviteUsrId]);
|
$baskets = $repo->findBy(['usr_id' => $inviteUsrId]);
|
||||||
|
|
||||||
foreach ($baskets as $basket) {
|
foreach ($baskets as $basket) {
|
||||||
|
@@ -25,7 +25,7 @@ class RSSFeeds implements ControllerProviderInterface
|
|||||||
$controllers = $app['controllers_factory'];
|
$controllers = $app['controllers_factory'];
|
||||||
|
|
||||||
$controllers->get('/feed/{id}/{format}/', function (Application $app, $id, $format) {
|
$controllers->get('/feed/{id}/{format}/', function (Application $app, $id, $format) {
|
||||||
$feed = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Feed')->find($id);
|
$feed = $app['EM']->getRepository('Phraseanet:Feed')->find($id);
|
||||||
|
|
||||||
if (null === $feed) {
|
if (null === $feed) {
|
||||||
$app->abort(404, 'Feed not found');
|
$app->abort(404, 'Feed not found');
|
||||||
@@ -47,7 +47,7 @@ class RSSFeeds implements ControllerProviderInterface
|
|||||||
->assert('format', '(rss|atom)');
|
->assert('format', '(rss|atom)');
|
||||||
|
|
||||||
$controllers->get('/userfeed/{token}/{id}/{format}/', function (Application $app, $token, $id, $format) {
|
$controllers->get('/userfeed/{token}/{id}/{format}/', function (Application $app, $token, $id, $format) {
|
||||||
$token = $app["EM"]->find('Alchemy\Phrasea\Model\Entities\FeedToken', $id);
|
$token = $app["EM"]->find('Phraseanet:FeedToken', $id);
|
||||||
|
|
||||||
$request = $app['request'];
|
$request = $app['request'];
|
||||||
|
|
||||||
@@ -62,10 +62,10 @@ class RSSFeeds implements ControllerProviderInterface
|
|||||||
->assert('format', '(rss|atom)');
|
->assert('format', '(rss|atom)');
|
||||||
|
|
||||||
$controllers->get('/userfeed/aggregated/{token}/{format}/', function (Application $app, $token, $format) {
|
$controllers->get('/userfeed/aggregated/{token}/{format}/', function (Application $app, $token, $format) {
|
||||||
$token = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\AggregateToken')->findOneBy(["value" => $token]);
|
$token = $app['EM']->getRepository('Phraseanet:AggregateToken')->findOneBy(["value" => $token]);
|
||||||
$user = \User_Adapter::getInstance($token->getUsrId(), $app);
|
$user = \User_Adapter::getInstance($token->getUsrId(), $app);
|
||||||
|
|
||||||
$feeds = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Feed')->getAllForUser($app['acl']->get($user));
|
$feeds = $app['EM']->getRepository('Phraseanet:Feed')->getAllForUser($app['acl']->get($user));
|
||||||
|
|
||||||
$aggregate = new Aggregate($app['EM'], $feeds, $token);
|
$aggregate = new Aggregate($app['EM'], $feeds, $token);
|
||||||
|
|
||||||
|
@@ -81,7 +81,7 @@ class Session implements ControllerProviderInterface
|
|||||||
return $app->json($ret);
|
return $app->json($ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
$session = $app['EM']->find('Alchemy\Phrasea\Model\Entities\Session', $app['session']->get('session_id'));
|
$session = $app['EM']->find('Phraseanet:Session', $app['session']->get('session_id'));
|
||||||
$session->setUpdated(new \DateTime());
|
$session->setUpdated(new \DateTime());
|
||||||
|
|
||||||
if (!$session->hasModuleId($moduleId)) {
|
if (!$session->hasModuleId($moduleId)) {
|
||||||
@@ -102,7 +102,7 @@ class Session implements ControllerProviderInterface
|
|||||||
'notifications' => $app['events-manager']->get_notifications()
|
'notifications' => $app['events-manager']->get_notifications()
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$baskets = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Basket')->findUnreadActiveByUser($app['authentication']->getUser());
|
$baskets = $app['EM']->getRepository('Phraseanet:Basket')->findUnreadActiveByUser($app['authentication']->getUser());
|
||||||
|
|
||||||
foreach ($baskets as $basket) {
|
foreach ($baskets as $basket) {
|
||||||
$ret['changed'][] = $basket->getId();
|
$ret['changed'][] = $basket->getId();
|
||||||
@@ -132,7 +132,7 @@ class Session implements ControllerProviderInterface
|
|||||||
*/
|
*/
|
||||||
public function deleteSession(Application $app, Request $request, $id)
|
public function deleteSession(Application $app, Request $request, $id)
|
||||||
{
|
{
|
||||||
$session = $app['EM']->find('Alchemy\Phrasea\Model\Entities\Session', $id);
|
$session = $app['EM']->find('Phraseanet:Session', $id);
|
||||||
|
|
||||||
if (null === $session) {
|
if (null === $session) {
|
||||||
$app->abort(404, 'Unknown session');
|
$app->abort(404, 'Unknown session');
|
||||||
|
@@ -62,7 +62,7 @@ class TaskManagerServiceProvider implements ServiceProviderInterface
|
|||||||
$finder = new PhpExecutableFinder();
|
$finder = new PhpExecutableFinder();
|
||||||
$php = $finder->find();
|
$php = $finder->find();
|
||||||
|
|
||||||
return new TaskList($app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Task'), $app['root.path'], $php, $conf);
|
return new TaskList($app['EM']->getRepository('Phraseanet:Task'), $app['root.path'], $php, $conf);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -17,6 +17,7 @@ use Doctrine\Common\Annotations\AnnotationReader;
|
|||||||
use Doctrine\Common\Annotations\AnnotationRegistry;
|
use Doctrine\Common\Annotations\AnnotationRegistry;
|
||||||
use Doctrine\Common\Annotations\FileCacheReader;
|
use Doctrine\Common\Annotations\FileCacheReader;
|
||||||
use Doctrine\Common\EventManager;
|
use Doctrine\Common\EventManager;
|
||||||
|
use Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain;
|
||||||
use Doctrine\ORM\Mapping\Driver\AnnotationDriver;
|
use Doctrine\ORM\Mapping\Driver\AnnotationDriver;
|
||||||
use Doctrine\ORM\Mapping\Driver\DriverChain;
|
use Doctrine\ORM\Mapping\Driver\DriverChain;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManager;
|
||||||
@@ -54,7 +55,7 @@ class ORMServiceProvider implements ServiceProviderInterface
|
|||||||
$app['debug']
|
$app['debug']
|
||||||
);
|
);
|
||||||
|
|
||||||
$driverChain = new DriverChain();
|
$driverChain = new MappingDriverChain();
|
||||||
DoctrineExtensions::registerAbstractMappingIntoDriverChainORM(
|
DoctrineExtensions::registerAbstractMappingIntoDriverChainORM(
|
||||||
$driverChain,
|
$driverChain,
|
||||||
$fileCacheReader
|
$fileCacheReader
|
||||||
@@ -95,6 +96,7 @@ class ORMServiceProvider implements ServiceProviderInterface
|
|||||||
$config->setProxyDir($app['root.path'] . '/tmp/doctrine-proxies');
|
$config->setProxyDir($app['root.path'] . '/tmp/doctrine-proxies');
|
||||||
$config->setProxyNamespace('Alchemy\Phrasea\Model\Proxies');
|
$config->setProxyNamespace('Alchemy\Phrasea\Model\Proxies');
|
||||||
$config->setAutoGenerateProxyClasses($app['debug']);
|
$config->setAutoGenerateProxyClasses($app['debug']);
|
||||||
|
$config->addEntityNamespace('Phraseanet', 'Alchemy\Phrasea\Model\Entities');
|
||||||
|
|
||||||
return $config;
|
return $config;
|
||||||
});
|
});
|
||||||
|
@@ -77,8 +77,8 @@ class Aggregate implements FeedInterface
|
|||||||
*/
|
*/
|
||||||
public static function createFromUser(Application $app, \User_Adapter $user)
|
public static function createFromUser(Application $app, \User_Adapter $user)
|
||||||
{
|
{
|
||||||
$feeds = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Feed')->getAllForUser($app['acl']->get($user));
|
$feeds = $app['EM']->getRepository('Phraseanet:Feed')->getAllForUser($app['acl']->get($user));
|
||||||
$token = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\AggregateToken')->findOneBy(['usrId' => $user->get_id()]);
|
$token = $app['EM']->getRepository('Phraseanet:AggregateToken')->findOneBy(['usrId' => $user->get_id()]);
|
||||||
|
|
||||||
return new static($app['EM'], $feeds, $token);
|
return new static($app['EM'], $feeds, $token);
|
||||||
}
|
}
|
||||||
@@ -93,7 +93,7 @@ class Aggregate implements FeedInterface
|
|||||||
*/
|
*/
|
||||||
public static function create(Application $app, array $feed_ids)
|
public static function create(Application $app, array $feed_ids)
|
||||||
{
|
{
|
||||||
$feeds = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Feed')->findByIds($feed_ids);
|
$feeds = $app['EM']->getRepository('Phraseanet:Feed')->findByIds($feed_ids);
|
||||||
|
|
||||||
return new static($app, $feeds);
|
return new static($app, $feeds);
|
||||||
}
|
}
|
||||||
@@ -120,7 +120,7 @@ class Aggregate implements FeedInterface
|
|||||||
$feedIds[] = $feed->getId();
|
$feedIds[] = $feed->getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->em->getRepository('Alchemy\Phrasea\Model\Entities\FeedEntry')->findByFeeds($feedIds, $offset_start, $how_many);
|
return $this->em->getRepository('Phraseanet:FeedEntry')->findByFeeds($feedIds, $offset_start, $how_many);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -206,7 +206,7 @@ class Aggregate implements FeedInterface
|
|||||||
$feedIds[] = $feed->getId();
|
$feedIds[] = $feed->getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
return count($this->em->getRepository('Alchemy\Phrasea\Model\Entities\FeedEntry')->findByFeeds($feedIds));
|
return count($this->em->getRepository('Phraseanet:FeedEntry')->findByFeeds($feedIds));
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -238,6 +238,6 @@ class Aggregate implements FeedInterface
|
|||||||
*/
|
*/
|
||||||
public static function getPublic(Application $app)
|
public static function getPublic(Application $app)
|
||||||
{
|
{
|
||||||
return new static($app['EM'], $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Feed')->findBy(['public' => true], ['updatedOn' => 'DESC']));
|
return new static($app['EM'], $app['EM']->getRepository('Phraseanet:Feed')->findBy(['public' => true], ['updatedOn' => 'DESC']));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -130,7 +130,7 @@ class AggregateLinkGenerator implements LinkGeneratorInterface
|
|||||||
private function getAggregateToken(\User_Adapter $user, $renew = false)
|
private function getAggregateToken(\User_Adapter $user, $renew = false)
|
||||||
{
|
{
|
||||||
$token = $this->em
|
$token = $this->em
|
||||||
->getRepository('Alchemy\Phrasea\Model\Entities\AggregateToken')
|
->getRepository('Phraseanet:AggregateToken')
|
||||||
->findOneBy(['usrId' => $user->get_id()]);
|
->findOneBy(['usrId' => $user->get_id()]);
|
||||||
|
|
||||||
if (null === $token || true === $renew) {
|
if (null === $token || true === $renew) {
|
||||||
|
@@ -138,7 +138,7 @@ class FeedLinkGenerator implements LinkGeneratorInterface
|
|||||||
private function getFeedToken(Feed $feed, \User_Adapter $user, $renew = false)
|
private function getFeedToken(Feed $feed, \User_Adapter $user, $renew = false)
|
||||||
{
|
{
|
||||||
$token = $this->em
|
$token = $this->em
|
||||||
->getRepository('Alchemy\Phrasea\Model\Entities\FeedToken')
|
->getRepository('Phraseanet:FeedToken')
|
||||||
->findOneBy(['usrId' => $user->get_id(), 'feed' => $feed->getId()]);
|
->findOneBy(['usrId' => $user->get_id(), 'feed' => $feed->getId()]);
|
||||||
|
|
||||||
if (null === $token || true === $renew) {
|
if (null === $token || true === $renew) {
|
||||||
|
@@ -116,7 +116,7 @@ class Helper extends \Alchemy\Phrasea\Helper\Helper
|
|||||||
$this->is_basket = true;
|
$this->is_basket = true;
|
||||||
$this->original_basket = $Basket;
|
$this->original_basket = $Basket;
|
||||||
} elseif (trim($Request->get('story')) !== '') {
|
} elseif (trim($Request->get('story')) !== '') {
|
||||||
$repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\StoryWZ');
|
$repository = $app['EM']->getRepository('Phraseanet:StoryWZ');
|
||||||
|
|
||||||
$storyWZ = $repository->findByUserAndId($app, $app['authentication']->getUser(), $Request->get('story'));
|
$storyWZ = $repository->findByUserAndId($app, $app['authentication']->getUser(), $Request->get('story'));
|
||||||
|
|
||||||
|
@@ -33,7 +33,7 @@ class WorkZone extends Helper
|
|||||||
public function getContent($sort)
|
public function getContent($sort)
|
||||||
{
|
{
|
||||||
/* @var $repo_baskets Alchemy\Phrasea\Model\Repositories\BasketRepository */
|
/* @var $repo_baskets Alchemy\Phrasea\Model\Repositories\BasketRepository */
|
||||||
$repo_baskets = $this->app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Basket');
|
$repo_baskets = $this->app['EM']->getRepository('Phraseanet:Basket');
|
||||||
|
|
||||||
$sort = in_array($sort, ['date', 'name']) ? $sort : 'name';
|
$sort = in_array($sort, ['date', 'name']) ? $sort : 'name';
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ class WorkZone extends Helper
|
|||||||
$validations = $repo_baskets->findActiveValidationByUser($this->app['authentication']->getUser(), $sort);
|
$validations = $repo_baskets->findActiveValidationByUser($this->app['authentication']->getUser(), $sort);
|
||||||
|
|
||||||
/* @var $repo_stories Alchemy\Phrasea\Model\Repositories\StoryWZRepository */
|
/* @var $repo_stories Alchemy\Phrasea\Model\Repositories\StoryWZRepository */
|
||||||
$repo_stories = $this->app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\StoryWZ');
|
$repo_stories = $this->app['EM']->getRepository('Phraseanet:StoryWZ');
|
||||||
|
|
||||||
$stories = $repo_stories->findByUser($this->app, $this->app['authentication']->getUser(), $sort);
|
$stories = $repo_stories->findByUser($this->app, $this->app['authentication']->getUser(), $sort);
|
||||||
|
|
||||||
|
@@ -31,7 +31,7 @@ class BasketConverter implements ConverterInterface
|
|||||||
*/
|
*/
|
||||||
public function convert($id)
|
public function convert($id)
|
||||||
{
|
{
|
||||||
if (null === $basket = $this->om->find('Alchemy\Phrasea\Model\Entities\Basket', (int) $id)) {
|
if (null === $basket = $this->om->find('Phraseanet:Basket', (int) $id)) {
|
||||||
throw new NotFoundHttpException(sprintf('Basket %s not found.', $id));
|
throw new NotFoundHttpException(sprintf('Basket %s not found.', $id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,7 +31,7 @@ class TaskConverter implements ConverterInterface
|
|||||||
*/
|
*/
|
||||||
public function convert($id)
|
public function convert($id)
|
||||||
{
|
{
|
||||||
if (null === $task = $this->om->find('Alchemy\Phrasea\Model\Entities\Task', (int) $id)) {
|
if (null === $task = $this->om->find('Phraseanet:Task', (int) $id)) {
|
||||||
throw new NotFoundHttpException(sprintf('Task %s not found.', $id));
|
throw new NotFoundHttpException(sprintf('Task %s not found.', $id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -439,7 +439,7 @@ class Session
|
|||||||
* Get a module by its identifier
|
* Get a module by its identifier
|
||||||
*
|
*
|
||||||
* @param integer $moduleId
|
* @param integer $moduleId
|
||||||
* @return Alchemy\Phrasea\Model\Entities\SessionModule|null
|
* @return SessionModule|null
|
||||||
*/
|
*/
|
||||||
public function getModuleById($moduleId)
|
public function getModuleById($moduleId)
|
||||||
{
|
{
|
||||||
|
@@ -136,7 +136,7 @@ class UserManager
|
|||||||
*/
|
*/
|
||||||
private function cleanFtpExports(User $user)
|
private function cleanFtpExports(User $user)
|
||||||
{
|
{
|
||||||
$elements = $this->objectManager->getRepository('Alchemy\Phrasea\Model\Entities\FtpExport')
|
$elements = $this->objectManager->getRepository('Phraseanet:FtpExport')
|
||||||
->findBy(['usrId' => $user->getId()]);
|
->findBy(['usrId' => $user->getId()]);
|
||||||
|
|
||||||
foreach ($elements as $element) {
|
foreach ($elements as $element) {
|
||||||
@@ -151,7 +151,7 @@ class UserManager
|
|||||||
*/
|
*/
|
||||||
private function cleanOrders(User $user)
|
private function cleanOrders(User $user)
|
||||||
{
|
{
|
||||||
$orders = $this->objectManager->getRepository('Alchemy\Phrasea\Model\Entities\Order')
|
$orders = $this->objectManager->getRepository('Phraseanet:Order')
|
||||||
->findBy(['usrId' => $user->getId()]);
|
->findBy(['usrId' => $user->getId()]);
|
||||||
|
|
||||||
foreach ($orders as $order) {
|
foreach ($orders as $order) {
|
||||||
|
@@ -178,6 +178,6 @@ class TaskManipulator implements ManipulatorInterface
|
|||||||
*/
|
*/
|
||||||
public function getRepository()
|
public function getRepository()
|
||||||
{
|
{
|
||||||
return $this->om->getRepository('Alchemy\Phrasea\Model\Entities\Task');
|
return $this->om->getRepository('Phraseanet:Task');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -46,7 +46,7 @@ class UserManipulator implements ManipulatorInterface
|
|||||||
*/
|
*/
|
||||||
public function getRepository()
|
public function getRepository()
|
||||||
{
|
{
|
||||||
return $this->manager->getObjectManager()->getRepository('Alchemy\Phrasea\Model\Entities\User');
|
return $this->manager->getObjectManager()->getRepository('Phraseanet:User');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -26,7 +26,7 @@ class AuthFailureRepository extends EntityRepository
|
|||||||
$date = new \DateTime($limit);
|
$date = new \DateTime($limit);
|
||||||
|
|
||||||
$dql = 'SELECT f
|
$dql = 'SELECT f
|
||||||
FROM Alchemy\Phrasea\Model\Entities\AuthFailure f
|
FROM Phraseanet:AuthFailure f
|
||||||
WHERE f.created < :date';
|
WHERE f.created < :date';
|
||||||
|
|
||||||
$params = ['date' => $date->format('Y-m-d h:i:s')];
|
$params = ['date' => $date->format('Y-m-d h:i:s')];
|
||||||
@@ -40,7 +40,7 @@ class AuthFailureRepository extends EntityRepository
|
|||||||
public function findLockedFailuresMatching($username, $ip)
|
public function findLockedFailuresMatching($username, $ip)
|
||||||
{
|
{
|
||||||
$dql = 'SELECT f
|
$dql = 'SELECT f
|
||||||
FROM Alchemy\Phrasea\Model\Entities\AuthFailure f
|
FROM Phraseanet:AuthFailure f
|
||||||
WHERE (f.username = :username OR f.ip = :ip)
|
WHERE (f.username = :username OR f.ip = :ip)
|
||||||
AND f.locked = true';
|
AND f.locked = true';
|
||||||
|
|
||||||
|
@@ -27,7 +27,7 @@ class BasketElementRepository extends EntityRepository
|
|||||||
public function findUserElement($element_id, \User_Adapter $user)
|
public function findUserElement($element_id, \User_Adapter $user)
|
||||||
{
|
{
|
||||||
$dql = 'SELECT e
|
$dql = 'SELECT e
|
||||||
FROM Alchemy\Phrasea\Model\Entities\BasketElement e
|
FROM Phraseanet:BasketElement e
|
||||||
JOIN e.basket b
|
JOIN e.basket b
|
||||||
LEFT JOIN e.validation_datas vd
|
LEFT JOIN e.validation_datas vd
|
||||||
LEFT JOIN b.validation s
|
LEFT JOIN b.validation s
|
||||||
@@ -57,7 +57,7 @@ class BasketElementRepository extends EntityRepository
|
|||||||
public function findElementsByRecord(\record_adapter $record)
|
public function findElementsByRecord(\record_adapter $record)
|
||||||
{
|
{
|
||||||
$dql = 'SELECT e
|
$dql = 'SELECT e
|
||||||
FROM Alchemy\Phrasea\Model\Entities\BasketElement e
|
FROM Phraseanet:BasketElement e
|
||||||
JOIN e.basket b
|
JOIN e.basket b
|
||||||
LEFT JOIN b.validation s
|
LEFT JOIN b.validation s
|
||||||
LEFT JOIN s.participants p
|
LEFT JOIN s.participants p
|
||||||
@@ -78,7 +78,7 @@ class BasketElementRepository extends EntityRepository
|
|||||||
public function findElementsByDatabox(\databox $databox)
|
public function findElementsByDatabox(\databox $databox)
|
||||||
{
|
{
|
||||||
$dql = 'SELECT e
|
$dql = 'SELECT e
|
||||||
FROM Alchemy\Phrasea\Model\Entities\BasketElement e
|
FROM Phraseanet:BasketElement e
|
||||||
JOIN e.basket b
|
JOIN e.basket b
|
||||||
LEFT JOIN b.validation s
|
LEFT JOIN b.validation s
|
||||||
LEFT JOIN s.participants p
|
LEFT JOIN s.participants p
|
||||||
@@ -103,7 +103,7 @@ class BasketElementRepository extends EntityRepository
|
|||||||
public function findReceivedElementsByRecord(\record_adapter $record, \User_Adapter $user)
|
public function findReceivedElementsByRecord(\record_adapter $record, \User_Adapter $user)
|
||||||
{
|
{
|
||||||
$dql = 'SELECT e
|
$dql = 'SELECT e
|
||||||
FROM Alchemy\Phrasea\Model\Entities\BasketElement e
|
FROM Phraseanet:BasketElement e
|
||||||
JOIN e.basket b
|
JOIN e.basket b
|
||||||
LEFT JOIN b.validation s
|
LEFT JOIN b.validation s
|
||||||
LEFT JOIN s.participants p
|
LEFT JOIN s.participants p
|
||||||
@@ -127,7 +127,7 @@ class BasketElementRepository extends EntityRepository
|
|||||||
public function findReceivedValidationElementsByRecord(\record_adapter $record, \User_Adapter $user)
|
public function findReceivedValidationElementsByRecord(\record_adapter $record, \User_Adapter $user)
|
||||||
{
|
{
|
||||||
$dql = 'SELECT e
|
$dql = 'SELECT e
|
||||||
FROM Alchemy\Phrasea\Model\Entities\BasketElement e
|
FROM Phraseanet:BasketElement e
|
||||||
JOIN e.basket b
|
JOIN e.basket b
|
||||||
JOIN b.validation v
|
JOIN b.validation v
|
||||||
JOIN v.participants p
|
JOIN v.participants p
|
||||||
|
@@ -30,7 +30,7 @@ class BasketRepository extends EntityRepository
|
|||||||
public function findActiveByUser(\User_Adapter $user, $sort = null)
|
public function findActiveByUser(\User_Adapter $user, $sort = null)
|
||||||
{
|
{
|
||||||
$dql = 'SELECT b
|
$dql = 'SELECT b
|
||||||
FROM Alchemy\Phrasea\Model\Entities\Basket b
|
FROM Phraseanet:Basket b
|
||||||
LEFT JOIN b.elements e
|
LEFT JOIN b.elements e
|
||||||
WHERE b.usr_id = :usr_id
|
WHERE b.usr_id = :usr_id
|
||||||
AND b.archived = false';
|
AND b.archived = false';
|
||||||
@@ -56,7 +56,7 @@ class BasketRepository extends EntityRepository
|
|||||||
public function findUnreadActiveByUser(\User_Adapter $user)
|
public function findUnreadActiveByUser(\User_Adapter $user)
|
||||||
{
|
{
|
||||||
$dql = 'SELECT b
|
$dql = 'SELECT b
|
||||||
FROM Alchemy\Phrasea\Model\Entities\Basket b
|
FROM Phraseanet:Basket b
|
||||||
JOIN b.elements e
|
JOIN b.elements e
|
||||||
LEFT JOIN b.validation s
|
LEFT JOIN b.validation s
|
||||||
LEFT JOIN s.participants p
|
LEFT JOIN s.participants p
|
||||||
@@ -91,7 +91,7 @@ class BasketRepository extends EntityRepository
|
|||||||
public function findActiveValidationByUser(\User_Adapter $user, $sort = null)
|
public function findActiveValidationByUser(\User_Adapter $user, $sort = null)
|
||||||
{
|
{
|
||||||
$dql = 'SELECT b
|
$dql = 'SELECT b
|
||||||
FROM Alchemy\Phrasea\Model\Entities\Basket b
|
FROM Phraseanet:Basket b
|
||||||
JOIN b.elements e
|
JOIN b.elements e
|
||||||
JOIN e.validation_datas v
|
JOIN e.validation_datas v
|
||||||
JOIN b.validation s
|
JOIN b.validation s
|
||||||
@@ -115,7 +115,7 @@ class BasketRepository extends EntityRepository
|
|||||||
{
|
{
|
||||||
|
|
||||||
$dql = 'SELECT b
|
$dql = 'SELECT b
|
||||||
FROM Alchemy\Phrasea\Model\Entities\Basket b
|
FROM Phraseanet:Basket b
|
||||||
JOIN b.elements e
|
JOIN b.elements e
|
||||||
WHERE e.record_id = :record_id AND e.sbas_id = e.sbas_id
|
WHERE e.record_id = :record_id AND e.sbas_id = e.sbas_id
|
||||||
AND b.usr_id = :usr_id';
|
AND b.usr_id = :usr_id';
|
||||||
@@ -138,7 +138,7 @@ class BasketRepository extends EntityRepository
|
|||||||
switch ($type) {
|
switch ($type) {
|
||||||
case self::RECEIVED:
|
case self::RECEIVED:
|
||||||
$dql = 'SELECT b
|
$dql = 'SELECT b
|
||||||
FROM Alchemy\Phrasea\Model\Entities\Basket b
|
FROM Phraseanet:Basket b
|
||||||
JOIN b.elements e
|
JOIN b.elements e
|
||||||
WHERE b.usr_id = :usr_id AND b.pusher_id IS NOT NULL';
|
WHERE b.usr_id = :usr_id AND b.pusher_id IS NOT NULL';
|
||||||
$params = [
|
$params = [
|
||||||
@@ -147,7 +147,7 @@ class BasketRepository extends EntityRepository
|
|||||||
break;
|
break;
|
||||||
case self::VALIDATION_DONE:
|
case self::VALIDATION_DONE:
|
||||||
$dql = 'SELECT b
|
$dql = 'SELECT b
|
||||||
FROM Alchemy\Phrasea\Model\Entities\Basket b
|
FROM Phraseanet:Basket b
|
||||||
JOIN b.elements e
|
JOIN b.elements e
|
||||||
JOIN b.validation s
|
JOIN b.validation s
|
||||||
JOIN s.participants p
|
JOIN s.participants p
|
||||||
@@ -159,7 +159,7 @@ class BasketRepository extends EntityRepository
|
|||||||
break;
|
break;
|
||||||
case self::VALIDATION_SENT:
|
case self::VALIDATION_SENT:
|
||||||
$dql = 'SELECT b
|
$dql = 'SELECT b
|
||||||
FROM Alchemy\Phrasea\Model\Entities\Basket b
|
FROM Phraseanet:Basket b
|
||||||
JOIN b.elements e
|
JOIN b.elements e
|
||||||
JOIN b.validation v
|
JOIN b.validation v
|
||||||
WHERE b.usr_id = :usr_id';
|
WHERE b.usr_id = :usr_id';
|
||||||
@@ -169,7 +169,7 @@ class BasketRepository extends EntityRepository
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$dql = 'SELECT b
|
$dql = 'SELECT b
|
||||||
FROM Alchemy\Phrasea\Model\Entities\Basket b
|
FROM Phraseanet:Basket b
|
||||||
LEFT JOIN b.elements e
|
LEFT JOIN b.elements e
|
||||||
LEFT JOIN b.validation s
|
LEFT JOIN b.validation s
|
||||||
LEFT JOIN s.participants p
|
LEFT JOIN s.participants p
|
||||||
@@ -181,7 +181,7 @@ class BasketRepository extends EntityRepository
|
|||||||
break;
|
break;
|
||||||
case self::MYBASKETS:
|
case self::MYBASKETS:
|
||||||
$dql = 'SELECT b
|
$dql = 'SELECT b
|
||||||
FROM Alchemy\Phrasea\Model\Entities\Basket b
|
FROM Phraseanet:Basket b
|
||||||
LEFT JOIN b.elements e
|
LEFT JOIN b.elements e
|
||||||
LEFT JOIN b.validation s
|
LEFT JOIN b.validation s
|
||||||
LEFT JOIN s.participants p
|
LEFT JOIN s.participants p
|
||||||
@@ -228,7 +228,7 @@ class BasketRepository extends EntityRepository
|
|||||||
public function findActiveValidationAndBasketByUser(\User_Adapter $user, $sort = null)
|
public function findActiveValidationAndBasketByUser(\User_Adapter $user, $sort = null)
|
||||||
{
|
{
|
||||||
$dql = 'SELECT b
|
$dql = 'SELECT b
|
||||||
FROM Alchemy\Phrasea\Model\Entities\Basket b
|
FROM Phraseanet:Basket b
|
||||||
LEFT JOIN b.elements e
|
LEFT JOIN b.elements e
|
||||||
LEFT JOIN b.validation s
|
LEFT JOIN b.validation s
|
||||||
LEFT JOIN s.participants p
|
LEFT JOIN s.participants p
|
||||||
|
@@ -32,7 +32,7 @@ class FeedEntryRepository extends EntityRepository
|
|||||||
*/
|
*/
|
||||||
public function findByFeeds($feeds, $offset_start = null, $how_many = null)
|
public function findByFeeds($feeds, $offset_start = null, $how_many = null)
|
||||||
{
|
{
|
||||||
$dql = 'SELECT f FROM Alchemy\Phrasea\Model\Entities\FeedEntry f
|
$dql = 'SELECT f FROM Phraseanet:FeedEntry f
|
||||||
WHERE f.feed IN (:feeds) order by f.updatedOn DESC';
|
WHERE f.feed IN (:feeds) order by f.updatedOn DESC';
|
||||||
|
|
||||||
$query = $this->_em->createQuery($dql);
|
$query = $this->_em->createQuery($dql);
|
||||||
|
@@ -35,7 +35,7 @@ class FeedItemRepository extends EntityRepository
|
|||||||
public function isRecordInPublicFeed(Application $app, $sbas_id, $record_id)
|
public function isRecordInPublicFeed(Application $app, $sbas_id, $record_id)
|
||||||
{
|
{
|
||||||
$dql = 'SELECT i
|
$dql = 'SELECT i
|
||||||
FROM Alchemy\Phrasea\Model\Entities\FeedItem i
|
FROM Phraseanet:FeedItem i
|
||||||
JOIN i.entry e
|
JOIN i.entry e
|
||||||
JOIN e.feed f
|
JOIN e.feed f
|
||||||
WHERE i.sbasId = :sbas_id
|
WHERE i.sbasId = :sbas_id
|
||||||
@@ -63,7 +63,7 @@ class FeedItemRepository extends EntityRepository
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
$dql = 'SELECT i
|
$dql = 'SELECT i
|
||||||
FROM Alchemy\Phrasea\Model\Entities\FeedItem i
|
FROM Phraseanet:FeedItem i
|
||||||
JOIN i.entry e
|
JOIN i.entry e
|
||||||
JOIN e.feed f
|
JOIN e.feed f
|
||||||
WHERE f.public = true ORDER BY i.createdOn DESC';
|
WHERE f.public = true ORDER BY i.createdOn DESC';
|
||||||
|
@@ -50,7 +50,7 @@ class FtpExportRepository extends EntityRepository
|
|||||||
public function findDoableExports()
|
public function findDoableExports()
|
||||||
{
|
{
|
||||||
$dql = 'SELECT f
|
$dql = 'SELECT f
|
||||||
FROM Alchemy\Phrasea\Model\Entities\FtpExport f
|
FROM Phraseanet:FtpExport f
|
||||||
INNER JOIN f.elements e
|
INNER JOIN f.elements e
|
||||||
WHERE e.done = false';
|
WHERE e.done = false';
|
||||||
|
|
||||||
|
@@ -30,7 +30,7 @@ class LazaretFileRepository extends EntityRepository
|
|||||||
|
|
||||||
$dql = '
|
$dql = '
|
||||||
SELECT f
|
SELECT f
|
||||||
FROM Alchemy\Phrasea\Model\Entities\LazaretFile f'
|
FROM Phraseanet:LazaretFile f'
|
||||||
. ('' === $base_ids ? '' : ' WHERE f.base_id IN (' . $base_ids . ')')
|
. ('' === $base_ids ? '' : ' WHERE f.base_id IN (' . $base_ids . ')')
|
||||||
. ' ORDER BY f.id DESC';
|
. ' ORDER BY f.id DESC';
|
||||||
|
|
||||||
|
@@ -24,7 +24,7 @@ class SessionRepository extends EntityRepository
|
|||||||
public function findByUser(\User_Adapter $user)
|
public function findByUser(\User_Adapter $user)
|
||||||
{
|
{
|
||||||
$dql = 'SELECT s
|
$dql = 'SELECT s
|
||||||
FROM Alchemy\Phrasea\Model\Entities\Session s
|
FROM Phraseanet:Session s
|
||||||
WHERE s.usr_id = :usr_id';
|
WHERE s.usr_id = :usr_id';
|
||||||
|
|
||||||
$query = $this->_em->createQuery($dql);
|
$query = $this->_em->createQuery($dql);
|
||||||
|
@@ -27,7 +27,7 @@ class StoryWZRepository extends EntityRepository
|
|||||||
|
|
||||||
public function findByUser(Application $app, \User_Adapter $user, $sort)
|
public function findByUser(Application $app, \User_Adapter $user, $sort)
|
||||||
{
|
{
|
||||||
$dql = 'SELECT s FROM Alchemy\Phrasea\Model\Entities\StoryWZ s WHERE s.usr_id = :usr_id ';
|
$dql = 'SELECT s FROM Phraseanet:StoryWZ s WHERE s.usr_id = :usr_id ';
|
||||||
|
|
||||||
if ($sort == 'date') {
|
if ($sort == 'date') {
|
||||||
$dql .= ' ORDER BY s.created DESC';
|
$dql .= ' ORDER BY s.created DESC';
|
||||||
@@ -118,7 +118,7 @@ class StoryWZRepository extends EntityRepository
|
|||||||
|
|
||||||
public function findByRecord(Application $app, \record_adapter $Story)
|
public function findByRecord(Application $app, \record_adapter $Story)
|
||||||
{
|
{
|
||||||
$dql = 'SELECT s FROM Alchemy\Phrasea\Model\Entities\StoryWZ s WHERE s.sbas_id = :sbas_id
|
$dql = 'SELECT s FROM Phraseanet:StoryWZ s WHERE s.sbas_id = :sbas_id
|
||||||
AND s.record_id = :record_id';
|
AND s.record_id = :record_id';
|
||||||
|
|
||||||
$query = $this->_em->createQuery($dql);
|
$query = $this->_em->createQuery($dql);
|
||||||
@@ -144,7 +144,7 @@ class StoryWZRepository extends EntityRepository
|
|||||||
|
|
||||||
public function findByDatabox(Application $app, \databox $databox)
|
public function findByDatabox(Application $app, \databox $databox)
|
||||||
{
|
{
|
||||||
$dql = 'SELECT s FROM Alchemy\Phrasea\Model\Entities\StoryWZ s WHERE s.sbas_id = :sbas_id';
|
$dql = 'SELECT s FROM Phraseanet:StoryWZ s WHERE s.sbas_id = :sbas_id';
|
||||||
|
|
||||||
$query = $this->_em->createQuery($dql);
|
$query = $this->_em->createQuery($dql);
|
||||||
$query->setParameters([
|
$query->setParameters([
|
||||||
|
@@ -24,7 +24,7 @@ class UsrAuthProviderRepository extends EntityRepository
|
|||||||
public function findByUser(\User_Adapter $user)
|
public function findByUser(\User_Adapter $user)
|
||||||
{
|
{
|
||||||
$dql = 'SELECT u
|
$dql = 'SELECT u
|
||||||
FROM Alchemy\Phrasea\Model\Entities\UsrAuthProvider u
|
FROM Phraseanet:UsrAuthProvider u
|
||||||
WHERE u.usr_id = :usrId';
|
WHERE u.usr_id = :usrId';
|
||||||
|
|
||||||
$params = ['usrId' => $user->get_id()];
|
$params = ['usrId' => $user->get_id()];
|
||||||
@@ -38,7 +38,7 @@ class UsrAuthProviderRepository extends EntityRepository
|
|||||||
public function findWithProviderAndId($providerId, $distantId)
|
public function findWithProviderAndId($providerId, $distantId)
|
||||||
{
|
{
|
||||||
$dql = 'SELECT u
|
$dql = 'SELECT u
|
||||||
FROM Alchemy\Phrasea\Model\Entities\UsrAuthProvider u
|
FROM Phraseanet:UsrAuthProvider u
|
||||||
WHERE u.provider = :providerId AND u.distant_id = :distantId';
|
WHERE u.provider = :providerId AND u.distant_id = :distantId';
|
||||||
|
|
||||||
$params = ['providerId' => $providerId, 'distantId' => $distantId];
|
$params = ['providerId' => $providerId, 'distantId' => $distantId];
|
||||||
|
@@ -34,7 +34,7 @@ class UsrListEntryRepository extends EntityRepository
|
|||||||
*/
|
*/
|
||||||
public function findUserList(\User_Adapter $user)
|
public function findUserList(\User_Adapter $user)
|
||||||
{
|
{
|
||||||
$dql = 'SELECT e FROM Alchemy\Phrasea\Model\Entities\UsrListEntry e
|
$dql = 'SELECT e FROM Phraseanet:UsrListEntry e
|
||||||
WHERE e.usr_id = :usr_id';
|
WHERE e.usr_id = :usr_id';
|
||||||
|
|
||||||
$params = [
|
$params = [
|
||||||
@@ -65,7 +65,7 @@ class UsrListEntryRepository extends EntityRepository
|
|||||||
|
|
||||||
public function findEntryByListAndUsrId(UsrList $list, $usr_id)
|
public function findEntryByListAndUsrId(UsrList $list, $usr_id)
|
||||||
{
|
{
|
||||||
$dql = 'SELECT e FROM Alchemy\Phrasea\Model\Entities\UsrListEntry e
|
$dql = 'SELECT e FROM Phraseanet:UsrListEntry e
|
||||||
JOIN e.list l
|
JOIN e.list l
|
||||||
WHERE e.usr_id = :usr_id AND l.id = :list_id';
|
WHERE e.usr_id = :usr_id AND l.id = :list_id';
|
||||||
|
|
||||||
|
@@ -58,7 +58,7 @@ class UsrListOwnerRepository extends EntityRepository
|
|||||||
*/
|
*/
|
||||||
public function findByListAndUsrId(UsrList $list, $usr_id)
|
public function findByListAndUsrId(UsrList $list, $usr_id)
|
||||||
{
|
{
|
||||||
$dql = 'SELECT o FROM Alchemy\Phrasea\Model\Entities\UsrListOwner o
|
$dql = 'SELECT o FROM Phraseanet:UsrListOwner o
|
||||||
JOIN o.list l
|
JOIN o.list l
|
||||||
WHERE l.id = :list_id AND o.usr_id = :usr_id';
|
WHERE l.id = :list_id AND o.usr_id = :usr_id';
|
||||||
|
|
||||||
|
@@ -34,7 +34,7 @@ class UsrListRepository extends EntityRepository
|
|||||||
*/
|
*/
|
||||||
public function findUserLists(\User_Adapter $user)
|
public function findUserLists(\User_Adapter $user)
|
||||||
{
|
{
|
||||||
$dql = 'SELECT l FROM Alchemy\Phrasea\Model\Entities\UsrList l
|
$dql = 'SELECT l FROM Phraseanet:UsrList l
|
||||||
JOIN l.owners o
|
JOIN l.owners o
|
||||||
WHERE o.usr_id = :usr_id';
|
WHERE o.usr_id = :usr_id';
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@ class UsrListRepository extends EntityRepository
|
|||||||
*/
|
*/
|
||||||
public function findUserListLike(\User_Adapter $user, $name)
|
public function findUserListLike(\User_Adapter $user, $name)
|
||||||
{
|
{
|
||||||
$dql = 'SELECT l FROM Alchemy\Phrasea\Model\Entities\UsrList l
|
$dql = 'SELECT l FROM Phraseanet:UsrList l
|
||||||
JOIN l.owners o
|
JOIN l.owners o
|
||||||
WHERE o.usr_id = :usr_id AND l.name LIKE :name';
|
WHERE o.usr_id = :usr_id AND l.name LIKE :name';
|
||||||
|
|
||||||
|
@@ -27,7 +27,7 @@ class ValidationParticipantRepository extends EntityRepository
|
|||||||
{
|
{
|
||||||
$dql = '
|
$dql = '
|
||||||
SELECT p, s
|
SELECT p, s
|
||||||
FROM Alchemy\Phrasea\Model\Entities\ValidationParticipant p
|
FROM Phraseanet:ValidationParticipant p
|
||||||
JOIN p.session s
|
JOIN p.session s
|
||||||
JOIN s.basket b
|
JOIN s.basket b
|
||||||
WHERE p.is_confirmed = 0
|
WHERE p.is_confirmed = 0
|
||||||
|
@@ -74,7 +74,7 @@ class FtpJob extends AbstractJob
|
|||||||
private function removeDeadExports(Application $app)
|
private function removeDeadExports(Application $app)
|
||||||
{
|
{
|
||||||
foreach ($app['EM']
|
foreach ($app['EM']
|
||||||
->getRepository('Alchemy\Phrasea\Model\Entities\FtpExport')
|
->getRepository('Phraseanet:FtpExport')
|
||||||
->findCrashedExports(new \DateTime('-1 month')) as $export) {
|
->findCrashedExports(new \DateTime('-1 month')) as $export) {
|
||||||
$app['EM']->remove($export);
|
$app['EM']->remove($export);
|
||||||
}
|
}
|
||||||
@@ -84,7 +84,7 @@ class FtpJob extends AbstractJob
|
|||||||
private function retrieveExports(Application $app)
|
private function retrieveExports(Application $app)
|
||||||
{
|
{
|
||||||
return $app['EM']
|
return $app['EM']
|
||||||
->getRepository('Alchemy\Phrasea\Model\Entities\FtpExport')
|
->getRepository('Phraseanet:FtpExport')
|
||||||
->findDoableExports();
|
->findDoableExports();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -252,7 +252,7 @@ class ACL implements cache_cacheableInterface
|
|||||||
$granted = true;
|
$granted = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (false === $granted && $this->app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\FeedItem')->isRecordInPublicFeed($this->app, $record->get_sbas_id(), $record->get_record_id())) {
|
if (false === $granted && $this->app['EM']->getRepository('Phraseanet:FeedItem')->isRecordInPublicFeed($this->app, $record->get_sbas_id(), $record->get_record_id())) {
|
||||||
$granted = true;
|
$granted = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -24,6 +24,7 @@ use Alchemy\Phrasea\Model\Entities\FeedItem;
|
|||||||
use Alchemy\Phrasea\Model\Entities\LazaretFile;
|
use Alchemy\Phrasea\Model\Entities\LazaretFile;
|
||||||
use Alchemy\Phrasea\Model\Entities\Task;
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
use Alchemy\Phrasea\Model\Entities\UserQuery;
|
use Alchemy\Phrasea\Model\Entities\UserQuery;
|
||||||
|
use Alchemy\Phrasea\Model\Entities\ValidationData;
|
||||||
use Alchemy\Phrasea\Model\Entities\ValidationParticipant;
|
use Alchemy\Phrasea\Model\Entities\ValidationParticipant;
|
||||||
use Silex\Application;
|
use Silex\Application;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
@@ -724,7 +725,7 @@ class API_V1_adapter extends API_V1_Abstract
|
|||||||
$lazaretFiles = [];
|
$lazaretFiles = [];
|
||||||
|
|
||||||
if (count($baseIds) > 0) {
|
if (count($baseIds) > 0) {
|
||||||
$lazaretRepository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\LazaretFile');
|
$lazaretRepository = $app['EM']->getRepository('Phraseanet:LazaretFile');
|
||||||
|
|
||||||
$lazaretFiles = $lazaretRepository->findPerPage(
|
$lazaretFiles = $lazaretRepository->findPerPage(
|
||||||
$baseIds, $offset_start, $per_page
|
$baseIds, $offset_start, $per_page
|
||||||
@@ -750,7 +751,7 @@ class API_V1_adapter extends API_V1_Abstract
|
|||||||
|
|
||||||
public function list_quarantine_item($lazaret_id, Application $app, Request $request)
|
public function list_quarantine_item($lazaret_id, Application $app, Request $request)
|
||||||
{
|
{
|
||||||
$lazaretFile = $app['EM']->find('Alchemy\Phrasea\Model\Entities\LazaretFile', $lazaret_id);
|
$lazaretFile = $app['EM']->find('Phraseanet:LazaretFile', $lazaret_id);
|
||||||
|
|
||||||
/* @var $lazaretFile LazaretFile */
|
/* @var $lazaretFile LazaretFile */
|
||||||
if (null === $lazaretFile) {
|
if (null === $lazaretFile) {
|
||||||
@@ -1240,7 +1241,7 @@ class API_V1_adapter extends API_V1_Abstract
|
|||||||
*/
|
*/
|
||||||
protected function list_baskets($usr_id)
|
protected function list_baskets($usr_id)
|
||||||
{
|
{
|
||||||
$repo = $this->app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Basket');
|
$repo = $this->app['EM']->getRepository('Phraseanet:Basket');
|
||||||
/* @var $repo Alchemy\Phrasea\Model\Repositories\BasketRepository */
|
/* @var $repo Alchemy\Phrasea\Model\Repositories\BasketRepository */
|
||||||
|
|
||||||
$baskets = $repo->findActiveByUser($this->app['authentication']->getUser());
|
$baskets = $repo->findActiveByUser($this->app['authentication']->getUser());
|
||||||
@@ -1357,7 +1358,7 @@ class API_V1_adapter extends API_V1_Abstract
|
|||||||
foreach ($basket_element->getValidationDatas() as $validation_datas) {
|
foreach ($basket_element->getValidationDatas() as $validation_datas) {
|
||||||
$participant = $validation_datas->getParticipant();
|
$participant = $validation_datas->getParticipant();
|
||||||
$user = $participant->getUser($this->app);
|
$user = $participant->getUser($this->app);
|
||||||
/* @var $validation_datas Alchemy\Phrasea\Model\Entities\ValidationData */
|
/* @var $validation_datas ValidationData */
|
||||||
$choices[] = [
|
$choices[] = [
|
||||||
'validation_user' => [
|
'validation_user' => [
|
||||||
'usr_id' => $user->get_id(),
|
'usr_id' => $user->get_id(),
|
||||||
@@ -1440,7 +1441,7 @@ class API_V1_adapter extends API_V1_Abstract
|
|||||||
{
|
{
|
||||||
$result = new API_V1_result($this->app, $request, $this);
|
$result = new API_V1_result($this->app, $request, $this);
|
||||||
|
|
||||||
$coll = $this->app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Feed')->getAllForUser($this->app['acl']->get($user));
|
$coll = $this->app['EM']->getRepository('Phraseanet:Feed')->getAllForUser($this->app['acl']->get($user));
|
||||||
|
|
||||||
$datas = [];
|
$datas = [];
|
||||||
foreach ($coll as $feed) {
|
foreach ($coll as $feed) {
|
||||||
@@ -1473,7 +1474,7 @@ class API_V1_adapter extends API_V1_Abstract
|
|||||||
{
|
{
|
||||||
$result = new API_V1_result($this->app, $request, $this);
|
$result = new API_V1_result($this->app, $request, $this);
|
||||||
|
|
||||||
$feed = $this->app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Feed')->find($publication_id);
|
$feed = $this->app['EM']->getRepository('Phraseanet:Feed')->find($publication_id);
|
||||||
if (!$feed->isAccessible($user, $this->app)) {
|
if (!$feed->isAccessible($user, $this->app)) {
|
||||||
return $result->set_datas([]);
|
return $result->set_datas([]);
|
||||||
}
|
}
|
||||||
@@ -1521,7 +1522,7 @@ class API_V1_adapter extends API_V1_Abstract
|
|||||||
{
|
{
|
||||||
$result = new API_V1_result($this->app, $request, $this);
|
$result = new API_V1_result($this->app, $request, $this);
|
||||||
|
|
||||||
$entry = $this->app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\FeedEntry')->find($entry_id);
|
$entry = $this->app['EM']->getRepository('Phraseanet:FeedEntry')->find($entry_id);
|
||||||
|
|
||||||
$collection = $entry->getFeed()->getCollection($this->app);
|
$collection = $entry->getFeed()->getCollection($this->app);
|
||||||
|
|
||||||
|
@@ -188,7 +188,7 @@ class Session_Logger
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$session = $app['EM']->find('Alchemy\Phrasea\Model\Entities\Session', $app['session']->get('session_id'));
|
$session = $app['EM']->find('Phraseanet:Session', $app['session']->get('session_id'));
|
||||||
|
|
||||||
if (!$session) {
|
if (!$session) {
|
||||||
throw new SessionNotFound('No session found');
|
throw new SessionNotFound('No session found');
|
||||||
|
@@ -676,7 +676,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
|
|||||||
public function getFtpCredential()
|
public function getFtpCredential()
|
||||||
{
|
{
|
||||||
if (null === $this->ftpCredential) {
|
if (null === $this->ftpCredential) {
|
||||||
$this->ftpCredential = $this->app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\FtpCredential')->findOneBy([
|
$this->ftpCredential = $this->app['EM']->getRepository('Phraseanet:FtpCredential')->findOneBy([
|
||||||
'usrId' => $this->get_id()
|
'usrId' => $this->get_id()
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@@ -731,22 +731,22 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
|
|||||||
*/
|
*/
|
||||||
public function delete()
|
public function delete()
|
||||||
{
|
{
|
||||||
$repo = $this->app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\UsrAuthProvider');
|
$repo = $this->app['EM']->getRepository('Phraseanet:UsrAuthProvider');
|
||||||
foreach ($repo->findByUser($this) as $provider) {
|
foreach ($repo->findByUser($this) as $provider) {
|
||||||
$this->app['EM']->remove($provider);
|
$this->app['EM']->remove($provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
$repo = $this->app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\FtpExport');
|
$repo = $this->app['EM']->getRepository('Phraseanet:FtpExport');
|
||||||
foreach ($repo->findByUser($this) as $export) {
|
foreach ($repo->findByUser($this) as $export) {
|
||||||
$this->app['EM']->remove($export);
|
$this->app['EM']->remove($export);
|
||||||
}
|
}
|
||||||
|
|
||||||
$repo = $this->app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Order');
|
$repo = $this->app['EM']->getRepository('Phraseanet:Order');
|
||||||
foreach ($repo->findByUser($this) as $order) {
|
foreach ($repo->findByUser($this) as $order) {
|
||||||
$this->app['EM']->remove($order);
|
$this->app['EM']->remove($order);
|
||||||
}
|
}
|
||||||
|
|
||||||
$repo = $this->app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Session');
|
$repo = $this->app['EM']->getRepository('Phraseanet:Session');
|
||||||
|
|
||||||
foreach ($repo->findByUser($this) as $session) {
|
foreach ($repo->findByUser($this) as $session) {
|
||||||
$this->app['EM']->remove($session);
|
$this->app['EM']->remove($session);
|
||||||
|
@@ -454,11 +454,11 @@ class databox extends base
|
|||||||
$n+=50;
|
$n+=50;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($this->app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\StoryWZ')->findByDatabox($this->app, $this) as $story) {
|
foreach ($this->app['EM']->getRepository('Phraseanet:StoryWZ')->findByDatabox($this->app, $this) as $story) {
|
||||||
$this->app['EM']->remove($story);
|
$this->app['EM']->remove($story);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($this->app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\BasketElement')->findElementsByDatabox($this) as $element) {
|
foreach ($this->app['EM']->getRepository('Phraseanet:BasketElement')->findElementsByDatabox($this) as $element) {
|
||||||
$this->app['EM']->remove($element);
|
$this->app['EM']->remove($element);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -133,7 +133,7 @@ class eventsmanager_notify_feed extends eventsmanager_notifyAbstract
|
|||||||
{
|
{
|
||||||
$sx = simplexml_load_string($datas);
|
$sx = simplexml_load_string($datas);
|
||||||
|
|
||||||
$entry = $this->app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\FeedEntry')->find((int) $sx->entry_id);
|
$entry = $this->app['EM']->getRepository('Phraseanet:FeedEntry')->find((int) $sx->entry_id);
|
||||||
|
|
||||||
if (null === $entry) {
|
if (null === $entry) {
|
||||||
return [];
|
return [];
|
||||||
|
@@ -49,7 +49,7 @@ class eventsmanager_notify_order extends eventsmanager_notifyAbstract
|
|||||||
$users = [];
|
$users = [];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$repository = $this->app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\OrderElement');
|
$repository = $this->app['EM']->getRepository('Phraseanet:OrderElement');
|
||||||
|
|
||||||
$results = $repository->findBy(['orderId' => $order_id]);
|
$results = $repository->findBy(['orderId' => $order_id]);
|
||||||
|
|
||||||
|
@@ -98,7 +98,7 @@ class eventsmanager_notify_orderdeliver extends eventsmanager_notifyAbstract
|
|||||||
$receiver = Receiver::fromUser($user_to);
|
$receiver = Receiver::fromUser($user_to);
|
||||||
$emitter = Emitter::fromUser($user_from);
|
$emitter = Emitter::fromUser($user_from);
|
||||||
|
|
||||||
$repository = $this->app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Basket');
|
$repository = $this->app['EM']->getRepository('Phraseanet:Basket');
|
||||||
$basket = $repository->find($params['ssel_id']);
|
$basket = $repository->find($params['ssel_id']);
|
||||||
|
|
||||||
$readyToSend = true;
|
$readyToSend = true;
|
||||||
|
@@ -80,7 +80,7 @@ class eventsmanager_notify_push extends eventsmanager_notifyAbstract
|
|||||||
|
|
||||||
$readyToSend = false;
|
$readyToSend = false;
|
||||||
try {
|
try {
|
||||||
$repository = $this->app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Basket');
|
$repository = $this->app['EM']->getRepository('Phraseanet:Basket');
|
||||||
$basket = $repository->find($params['ssel_id']);
|
$basket = $repository->find($params['ssel_id']);
|
||||||
|
|
||||||
$user_from = User_Adapter::getInstance($params['from'], $this->app);
|
$user_from = User_Adapter::getInstance($params['from'], $this->app);
|
||||||
|
@@ -97,7 +97,7 @@ class eventsmanager_notify_validate extends eventsmanager_notifyAbstract
|
|||||||
$user_to = User_Adapter::getInstance($params['to'], $this->app);
|
$user_to = User_Adapter::getInstance($params['to'], $this->app);
|
||||||
|
|
||||||
$basket = $this->app['EM']
|
$basket = $this->app['EM']
|
||||||
->getRepository('Alchemy\Phrasea\Model\Entities\Basket')
|
->getRepository('Phraseanet:Basket')
|
||||||
->find($params['ssel_id']);
|
->find($params['ssel_id']);
|
||||||
$title = $basket->getName();
|
$title = $basket->getName();
|
||||||
|
|
||||||
|
@@ -92,7 +92,7 @@ class eventsmanager_notify_validationdone extends eventsmanager_notifyAbstract
|
|||||||
$user_to = User_Adapter::getInstance($params['to'], $this->app);
|
$user_to = User_Adapter::getInstance($params['to'], $this->app);
|
||||||
|
|
||||||
$basket = $this->app['EM']
|
$basket = $this->app['EM']
|
||||||
->getRepository('Alchemy\Phrasea\Model\Entities\Basket')
|
->getRepository('Phraseanet:Basket')
|
||||||
->find($params['ssel_id']);
|
->find($params['ssel_id']);
|
||||||
$title = $basket->getName();
|
$title = $basket->getName();
|
||||||
|
|
||||||
|
@@ -98,7 +98,7 @@ class eventsmanager_notify_validationreminder extends eventsmanager_notifyAbstra
|
|||||||
$readyToSend = false;
|
$readyToSend = false;
|
||||||
try {
|
try {
|
||||||
$basket = $this->app['EM']
|
$basket = $this->app['EM']
|
||||||
->getRepository('Alchemy\Phrasea\Model\Entities\Basket')
|
->getRepository('Phraseanet:Basket')
|
||||||
->find($params['ssel_id']);
|
->find($params['ssel_id']);
|
||||||
$title = $basket->getName();
|
$title = $basket->getName();
|
||||||
|
|
||||||
|
@@ -88,7 +88,7 @@ class patch_361alpha1a implements patchInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$dql = "SELECT b FROM Alchemy\Phrasea\Model\Entities\Basket b WHERE b.description != ''";
|
$dql = "SELECT b FROM Phraseanet:Basket b WHERE b.description != ''";
|
||||||
|
|
||||||
$n = 0;
|
$n = 0;
|
||||||
$perPage = 100;
|
$perPage = 100;
|
||||||
|
@@ -69,13 +69,13 @@ class patch_383alpha1a implements patchInterface
|
|||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
|
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
if (null !== $session = $app['EM']->find('Alchemy\Phrasea\Model\Entities\Session', $row['id'])) {
|
if (null !== $session = $app['EM']->find('Phraseanet:Session', $row['id'])) {
|
||||||
$app['EM']->remove($session);
|
$app['EM']->remove($session);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove API sessions
|
// Remove API sessions
|
||||||
$query = $app['EM']->createQuery('SELECT s FROM Alchemy\Phrasea\Model\Entities\Session s WHERE s.user_agent LIKE :guzzle');
|
$query = $app['EM']->createQuery('SELECT s FROM Phraseanet:Session s WHERE s.user_agent LIKE :guzzle');
|
||||||
$query->setParameter(':guzzle', 'Guzzle%');
|
$query->setParameter(':guzzle', 'Guzzle%');
|
||||||
|
|
||||||
foreach ($query->getResult() as $session) {
|
foreach ($query->getResult() as $session) {
|
||||||
|
@@ -64,7 +64,7 @@ class patch_383alpha2a implements patchInterface
|
|||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
|
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
if (null !== $vsession = $app['EM']->find('Alchemy\Phrasea\Model\Entities\ValidationSession', $row['validation_session_id'])) {
|
if (null !== $vsession = $app['EM']->find('Phraseanet:ValidationSession', $row['validation_session_id'])) {
|
||||||
$app['EM']->remove($vsession);
|
$app['EM']->remove($vsession);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -79,7 +79,7 @@ class patch_390alpha1b implements patchInterface
|
|||||||
$n = 0;
|
$n = 0;
|
||||||
$em = $app['EM'];
|
$em = $app['EM'];
|
||||||
$em->getEventManager()->removeEventSubscriber(new TimestampableListener());
|
$em->getEventManager()->removeEventSubscriber(new TimestampableListener());
|
||||||
$basketRepository = $em->getRepository('Alchemy\Phrasea\Model\Entities\Basket');
|
$basketRepository = $em->getRepository('Phraseanet:Basket');
|
||||||
|
|
||||||
foreach ($rs as $row) {
|
foreach ($rs as $row) {
|
||||||
$sql = 'SELECT count(id) as todo
|
$sql = 'SELECT count(id) as todo
|
||||||
|
@@ -185,7 +185,7 @@ class patch_390alpha2a implements patchInterface
|
|||||||
|
|
||||||
$n = 0;
|
$n = 0;
|
||||||
|
|
||||||
$repository = $em->getRepository('Alchemy\Phrasea\Model\Entities\User');
|
$repository = $em->getRepository('Phraseanet:User');
|
||||||
|
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
$template = $repository->findOneByLogin($row['usr_login']);
|
$template = $repository->findOneByLogin($row['usr_login']);
|
||||||
|
@@ -101,7 +101,7 @@ class patch_390alpha9a implements patchInterface
|
|||||||
|
|
||||||
private function updateDoctrineUsers(Application $app)
|
private function updateDoctrineUsers(Application $app)
|
||||||
{
|
{
|
||||||
$dql = 'SELECT u FROM Alchemy\Phrasea\Model\Entities\User u WHERE u.locale IS NOT NULL';
|
$dql = 'SELECT u FROM Phraseanet:User u WHERE u.locale IS NOT NULL';
|
||||||
$users = $app['EM']->createQuery($dql)->getResult();
|
$users = $app['EM']->createQuery($dql)->getResult();
|
||||||
|
|
||||||
foreach ($users as $user) {
|
foreach ($users as $user) {
|
||||||
|
@@ -189,7 +189,7 @@ class queries
|
|||||||
$history = '<ul>';
|
$history = '<ul>';
|
||||||
|
|
||||||
$queries = $app['EM']
|
$queries = $app['EM']
|
||||||
->getRepository('Alchemy\Phrasea\Model\Entities\UserQuery')
|
->getRepository('Phraseanet:UserQuery')
|
||||||
->findBy(['usrId' => $usrId], ['created' => 'ASC'], 25, 0);
|
->findBy(['usrId' => $usrId], ['created' => 'ASC'], 25, 0);
|
||||||
|
|
||||||
foreach ($queries as $query) {
|
foreach ($queries as $query) {
|
||||||
|
@@ -1491,7 +1491,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
|||||||
$stmt->execute([':record_id' => $this->get_record_id()]);
|
$stmt->execute([':record_id' => $this->get_record_id()]);
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
|
|
||||||
$orderElementRepository = $this->app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\OrderElement');
|
$orderElementRepository = $this->app['EM']->getRepository('Phraseanet:OrderElement');
|
||||||
|
|
||||||
/* @var $repository Alchemy\Phrasea\Model\Repositories\OrderElementRepository */
|
/* @var $repository Alchemy\Phrasea\Model\Repositories\OrderElementRepository */
|
||||||
foreach ($orderElementRepository->findBy(['recordId' => $this->get_record_id()]) as $order_element) {
|
foreach ($orderElementRepository->findBy(['recordId' => $this->get_record_id()]) as $order_element) {
|
||||||
@@ -1500,7 +1500,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$basketElementRepository = $this->app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\BasketElement');
|
$basketElementRepository = $this->app['EM']->getRepository('Phraseanet:BasketElement');
|
||||||
|
|
||||||
/* @var $repository Alchemy\Phrasea\Model\Repositories\BasketElementRepository */
|
/* @var $repository Alchemy\Phrasea\Model\Repositories\BasketElementRepository */
|
||||||
foreach ($basketElementRepository->findElementsByRecord($this) as $basket_element) {
|
foreach ($basketElementRepository->findElementsByRecord($this) as $basket_element) {
|
||||||
@@ -1613,7 +1613,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
|||||||
public function get_container_baskets(EntityManager $em, User_Adapter $user)
|
public function get_container_baskets(EntityManager $em, User_Adapter $user)
|
||||||
{
|
{
|
||||||
return $em
|
return $em
|
||||||
->getRepository('Alchemy\Phrasea\Model\Entities\Basket')
|
->getRepository('Phraseanet:Basket')
|
||||||
->findContainingRecordForUser($this, $user);
|
->findContainingRecordForUser($this, $user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -170,7 +170,7 @@ class record_preview extends record_adapter
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "FEED":
|
case "FEED":
|
||||||
$entry = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\FeedEntry')->find($contId);
|
$entry = $app['EM']->getRepository('Phraseanet:FeedEntry')->find($contId);
|
||||||
|
|
||||||
$this->container = $entry;
|
$this->container = $entry;
|
||||||
$this->total = count($entry->getItems());
|
$this->total = count($entry->getItems());
|
||||||
|
@@ -8,43 +8,43 @@ class BasketACLTest extends \PhraseanetTestCase
|
|||||||
{
|
{
|
||||||
public function testOwnerIsOwner()
|
public function testOwnerIsOwner()
|
||||||
{
|
{
|
||||||
$basket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 4);
|
$basket = self::$DI['app']['EM']->find('Phraseanet:Basket', 4);
|
||||||
$this->assertTrue((new BasketACL())->isOwner($basket, self::$DI['user']));
|
$this->assertTrue((new BasketACL())->isOwner($basket, self::$DI['user']));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testParticipantIsNotAnOwner()
|
public function testParticipantIsNotAnOwner()
|
||||||
{
|
{
|
||||||
$basket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 4);
|
$basket = self::$DI['app']['EM']->find('Phraseanet:Basket', 4);
|
||||||
$this->assertFalse((new BasketACL())->isOwner($basket, self::$DI['user_alt1']));
|
$this->assertFalse((new BasketACL())->isOwner($basket, self::$DI['user_alt1']));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testUserIsNotTheOwner()
|
public function testUserIsNotTheOwner()
|
||||||
{
|
{
|
||||||
$basket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 1);
|
$basket = self::$DI['app']['EM']->find('Phraseanet:Basket', 1);
|
||||||
$this->assertFalse((new BasketACL())->isOwner($basket, self::$DI['user_alt1']));
|
$this->assertFalse((new BasketACL())->isOwner($basket, self::$DI['user_alt1']));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testOwnerHasAccessInValidationEnv()
|
public function testOwnerHasAccessInValidationEnv()
|
||||||
{
|
{
|
||||||
$basket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 4);
|
$basket = self::$DI['app']['EM']->find('Phraseanet:Basket', 4);
|
||||||
$this->assertTrue((new BasketACL())->hasAccess($basket, self::$DI['user']));
|
$this->assertTrue((new BasketACL())->hasAccess($basket, self::$DI['user']));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testOwnerHasAccess()
|
public function testOwnerHasAccess()
|
||||||
{
|
{
|
||||||
$basket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 1);
|
$basket = self::$DI['app']['EM']->find('Phraseanet:Basket', 1);
|
||||||
$this->assertTrue((new BasketACL())->hasAccess($basket, self::$DI['user']));
|
$this->assertTrue((new BasketACL())->hasAccess($basket, self::$DI['user']));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testParticipantHasAccess()
|
public function testParticipantHasAccess()
|
||||||
{
|
{
|
||||||
$basket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 4);
|
$basket = self::$DI['app']['EM']->find('Phraseanet:Basket', 4);
|
||||||
$this->assertTrue((new BasketACL())->hasAccess($basket, self::$DI['user_alt1']));
|
$this->assertTrue((new BasketACL())->hasAccess($basket, self::$DI['user_alt1']));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testUserHasNotAccess()
|
public function testUserHasNotAccess()
|
||||||
{
|
{
|
||||||
$basket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 1);
|
$basket = self::$DI['app']['EM']->find('Phraseanet:Basket', 1);
|
||||||
$this->assertFalse((new BasketACL())->hasAccess($basket, self::$DI['user_alt1']));
|
$this->assertFalse((new BasketACL())->hasAccess($basket, self::$DI['user_alt1']));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -100,10 +100,10 @@ abstract class ApiTestCase extends \PhraseanetWebTestCase
|
|||||||
|
|
||||||
public function testThatSessionIsClosedAfterRequest()
|
public function testThatSessionIsClosedAfterRequest()
|
||||||
{
|
{
|
||||||
$this->assertCount(0, self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Session')->findAll());
|
$this->assertCount(0, self::$DI['app']['EM']->getRepository('Phraseanet:Session')->findAll());
|
||||||
$this->setToken(self::$token);
|
$this->setToken(self::$token);
|
||||||
self::$DI['client']->request('GET', '/api/v1/databoxes/list/', $this->getParameters(), [], ['HTTP_Accept' => $this->getAcceptMimeType()]);
|
self::$DI['client']->request('GET', '/api/v1/databoxes/list/', $this->getParameters(), [], ['HTTP_Accept' => $this->getAcceptMimeType()]);
|
||||||
$this->assertCount(0, self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Session')->findAll());
|
$this->assertCount(0, self::$DI['app']['EM']->getRepository('Phraseanet:Session')->findAll());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function provideEventNames()
|
public function provideEventNames()
|
||||||
@@ -1331,7 +1331,7 @@ abstract class ApiTestCase extends \PhraseanetWebTestCase
|
|||||||
{
|
{
|
||||||
$this->setToken(self::$adminToken);
|
$this->setToken(self::$adminToken);
|
||||||
|
|
||||||
$basketElement = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\BasketElement', 1);
|
$basketElement = self::$DI['app']['EM']->find('Phraseanet:BasketElement', 1);
|
||||||
$basket = $basketElement->getBasket();
|
$basket = $basketElement->getBasket();
|
||||||
|
|
||||||
$route = '/api/v1/baskets/' . $basket->getId() . '/content/';
|
$route = '/api/v1/baskets/' . $basket->getId() . '/content/';
|
||||||
@@ -1371,7 +1371,7 @@ abstract class ApiTestCase extends \PhraseanetWebTestCase
|
|||||||
{
|
{
|
||||||
$this->setToken(self::$adminToken);
|
$this->setToken(self::$adminToken);
|
||||||
|
|
||||||
$basket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 1);
|
$basket = self::$DI['app']['EM']->find('Phraseanet:Basket', 1);
|
||||||
|
|
||||||
$route = '/api/v1/baskets/' . $basket->getId() . '/setname/';
|
$route = '/api/v1/baskets/' . $basket->getId() . '/setname/';
|
||||||
|
|
||||||
@@ -1424,7 +1424,7 @@ abstract class ApiTestCase extends \PhraseanetWebTestCase
|
|||||||
{
|
{
|
||||||
$this->setToken(self::$adminToken);
|
$this->setToken(self::$adminToken);
|
||||||
|
|
||||||
$basket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 1);
|
$basket = self::$DI['app']['EM']->find('Phraseanet:Basket', 1);
|
||||||
|
|
||||||
$route = '/api/v1/baskets/' . $basket->getId() . '/setdescription/';
|
$route = '/api/v1/baskets/' . $basket->getId() . '/setdescription/';
|
||||||
|
|
||||||
@@ -1643,7 +1643,7 @@ abstract class ApiTestCase extends \PhraseanetWebTestCase
|
|||||||
*/
|
*/
|
||||||
public function testFeedList()
|
public function testFeedList()
|
||||||
{
|
{
|
||||||
$created_feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 1);
|
$created_feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 1);
|
||||||
|
|
||||||
$this->setToken(self::$token);
|
$this->setToken(self::$token);
|
||||||
$route = '/api/v1/feeds/list/';
|
$route = '/api/v1/feeds/list/';
|
||||||
@@ -1693,7 +1693,7 @@ abstract class ApiTestCase extends \PhraseanetWebTestCase
|
|||||||
$author = "W. Shakespeare";
|
$author = "W. Shakespeare";
|
||||||
$author_email = "gontran.bonheur@gmail.com";
|
$author_email = "gontran.bonheur@gmail.com";
|
||||||
|
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 1);
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 1);
|
||||||
$created_entry = $feed->getEntries()->first();
|
$created_entry = $feed->getEntries()->first();
|
||||||
|
|
||||||
$created_entry->setAuthorEmail($author_email);
|
$created_entry->setAuthorEmail($author_email);
|
||||||
@@ -1749,7 +1749,7 @@ abstract class ApiTestCase extends \PhraseanetWebTestCase
|
|||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 1);
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 1);
|
||||||
$created_entry = $feed->getEntries()->first();
|
$created_entry = $feed->getEntries()->first();
|
||||||
|
|
||||||
$this->setToken(self::$token);
|
$this->setToken(self::$token);
|
||||||
@@ -1780,7 +1780,7 @@ abstract class ApiTestCase extends \PhraseanetWebTestCase
|
|||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
$created_feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 1);
|
$created_feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 1);
|
||||||
$created_entry = $created_feed->getEntries()->first();
|
$created_entry = $created_feed->getEntries()->first();
|
||||||
|
|
||||||
$created_feed->setCollection(self::$DI['collection_no_access']);
|
$created_feed->setCollection(self::$DI['collection_no_access']);
|
||||||
@@ -1813,7 +1813,7 @@ abstract class ApiTestCase extends \PhraseanetWebTestCase
|
|||||||
$entry_title = 'Superman';
|
$entry_title = 'Superman';
|
||||||
$entry_subtitle = 'Wonder Woman';
|
$entry_subtitle = 'Wonder Woman';
|
||||||
|
|
||||||
$created_feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 1);
|
$created_feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 1);
|
||||||
$created_entry = $created_feed->getEntries()->first();
|
$created_entry = $created_feed->getEntries()->first();
|
||||||
$created_entry->setTitle($entry_title);
|
$created_entry->setTitle($entry_title);
|
||||||
$created_entry->setSubtitle($entry_subtitle);
|
$created_entry->setSubtitle($entry_subtitle);
|
||||||
|
@@ -48,7 +48,7 @@ class LightboxTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
{
|
{
|
||||||
$this->logout(self::$DI['app']);
|
$this->logout(self::$DI['app']);
|
||||||
|
|
||||||
$Basket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 1);
|
$Basket = self::$DI['app']['EM']->find('Phraseanet:Basket', 1);
|
||||||
$token = self::$DI['app']['tokens']->getUrlToken(\random::TYPE_VIEW, self::$DI['user_alt2']->get_id(), null, $Basket->getId());
|
$token = self::$DI['app']['tokens']->getUrlToken(\random::TYPE_VIEW, self::$DI['user_alt2']->get_id(), null, $Basket->getId());
|
||||||
|
|
||||||
self::$DI['client']->request('GET', '/lightbox/?LOG='.$token);
|
self::$DI['client']->request('GET', '/lightbox/?LOG='.$token);
|
||||||
@@ -59,7 +59,7 @@ class LightboxTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testAjaxNoteForm()
|
public function testAjaxNoteForm()
|
||||||
{
|
{
|
||||||
$basket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 4);
|
$basket = self::$DI['app']['EM']->find('Phraseanet:Basket', 4);
|
||||||
$basket_element = $basket->getELements()->first();
|
$basket_element = $basket->getELements()->first();
|
||||||
|
|
||||||
$this->set_user_agent(self::USER_AGENT_FIREFOX8MAC, self::$DI['app']);
|
$this->set_user_agent(self::USER_AGENT_FIREFOX8MAC, self::$DI['app']);
|
||||||
@@ -83,7 +83,7 @@ class LightboxTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testAjaxElement()
|
public function testAjaxElement()
|
||||||
{
|
{
|
||||||
$basket_element = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\BasketElement', 1);
|
$basket_element = self::$DI['app']['EM']->find('Phraseanet:BasketElement', 1);
|
||||||
|
|
||||||
$this->set_user_agent(self::USER_AGENT_FIREFOX8MAC, self::$DI['app']);
|
$this->set_user_agent(self::USER_AGENT_FIREFOX8MAC, self::$DI['app']);
|
||||||
|
|
||||||
@@ -128,7 +128,7 @@ class LightboxTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
{
|
{
|
||||||
$this->set_user_agent(self::USER_AGENT_FIREFOX8MAC, self::$DI['app']);
|
$this->set_user_agent(self::USER_AGENT_FIREFOX8MAC, self::$DI['app']);
|
||||||
|
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 1);
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 1);
|
||||||
$entry = $feed->getEntries()->first();
|
$entry = $feed->getEntries()->first();
|
||||||
$item = $entry->getItems()->first();
|
$item = $entry->getItems()->first();
|
||||||
|
|
||||||
@@ -173,7 +173,7 @@ class LightboxTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
{
|
{
|
||||||
$this->authenticate(self::$DI['app']);
|
$this->authenticate(self::$DI['app']);
|
||||||
|
|
||||||
$basket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 4);
|
$basket = self::$DI['app']['EM']->find('Phraseanet:Basket', 4);
|
||||||
|
|
||||||
$this->set_user_agent(self::USER_AGENT_FIREFOX8MAC, self::$DI['app']);
|
$this->set_user_agent(self::USER_AGENT_FIREFOX8MAC, self::$DI['app']);
|
||||||
|
|
||||||
@@ -198,7 +198,7 @@ class LightboxTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
{
|
{
|
||||||
$this->authenticate(self::$DI['app']);
|
$this->authenticate(self::$DI['app']);
|
||||||
|
|
||||||
$basket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 1);
|
$basket = self::$DI['app']['EM']->find('Phraseanet:Basket', 1);
|
||||||
|
|
||||||
$this->set_user_agent(self::USER_AGENT_FIREFOX8MAC, self::$DI['app']);
|
$this->set_user_agent(self::USER_AGENT_FIREFOX8MAC, self::$DI['app']);
|
||||||
|
|
||||||
@@ -225,7 +225,7 @@ class LightboxTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
$this->set_user_agent(self::USER_AGENT_FIREFOX8MAC, self::$DI['app']);
|
$this->set_user_agent(self::USER_AGENT_FIREFOX8MAC, self::$DI['app']);
|
||||||
|
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 1);
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 1);
|
||||||
$entry = $feed->getEntries()->first();
|
$entry = $feed->getEntries()->first();
|
||||||
|
|
||||||
$crawler = self::$DI['client']->request('GET', '/lightbox/feeds/entry/' . $entry->getId() . '/');
|
$crawler = self::$DI['client']->request('GET', '/lightbox/feeds/entry/' . $entry->getId() . '/');
|
||||||
@@ -247,7 +247,7 @@ class LightboxTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testAjaxReport()
|
public function testAjaxReport()
|
||||||
{
|
{
|
||||||
$validationBasket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 4);
|
$validationBasket = self::$DI['app']['EM']->find('Phraseanet:Basket', 4);
|
||||||
|
|
||||||
$this->set_user_agent(self::USER_AGENT_FIREFOX8MAC, self::$DI['app']);
|
$this->set_user_agent(self::USER_AGENT_FIREFOX8MAC, self::$DI['app']);
|
||||||
self::$DI['client']->request('GET', '/lightbox/ajax/LOAD_REPORT/' . $validationBasket->getId() . '/');
|
self::$DI['client']->request('GET', '/lightbox/ajax/LOAD_REPORT/' . $validationBasket->getId() . '/');
|
||||||
@@ -257,7 +257,7 @@ class LightboxTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testAjaxSetNote()
|
public function testAjaxSetNote()
|
||||||
{
|
{
|
||||||
$validationBasket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 4);
|
$validationBasket = self::$DI['app']['EM']->find('Phraseanet:Basket', 4);
|
||||||
$validationBasketElement = $validationBasket->getElements()->first();
|
$validationBasketElement = $validationBasket->getElements()->first();
|
||||||
|
|
||||||
self::$DI['client']->request('POST', '/lightbox/ajax/SET_NOTE/' . $validationBasketElement->getId() . '/');
|
self::$DI['client']->request('POST', '/lightbox/ajax/SET_NOTE/' . $validationBasketElement->getId() . '/');
|
||||||
@@ -280,7 +280,7 @@ class LightboxTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testAjaxSetAgreement()
|
public function testAjaxSetAgreement()
|
||||||
{
|
{
|
||||||
$validationBasket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 4);
|
$validationBasket = self::$DI['app']['EM']->find('Phraseanet:Basket', 4);
|
||||||
$validationBasketElement = $validationBasket->getElements()->first();
|
$validationBasketElement = $validationBasket->getElements()->first();
|
||||||
|
|
||||||
$crawler = self::$DI['client']->request(
|
$crawler = self::$DI['client']->request(
|
||||||
@@ -306,7 +306,7 @@ class LightboxTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testAjaxSetReleaseWithRegularBasket()
|
public function testAjaxSetReleaseWithRegularBasket()
|
||||||
{
|
{
|
||||||
$basket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 1);
|
$basket = self::$DI['app']['EM']->find('Phraseanet:Basket', 1);
|
||||||
|
|
||||||
$crawler = self::$DI['client']->request('POST', '/lightbox/ajax/SET_RELEASE/' . $basket->getId() . '/');
|
$crawler = self::$DI['client']->request('POST', '/lightbox/ajax/SET_RELEASE/' . $basket->getId() . '/');
|
||||||
$this->assertEquals(200, self::$DI['client']->getResponse()->getStatusCode());
|
$this->assertEquals(200, self::$DI['client']->getResponse()->getStatusCode());
|
||||||
@@ -318,7 +318,7 @@ class LightboxTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testAjaxSetReleaseWithRegularBasketWithValidation()
|
public function testAjaxSetReleaseWithRegularBasketWithValidation()
|
||||||
{
|
{
|
||||||
$validationBasket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 4);
|
$validationBasket = self::$DI['app']['EM']->find('Phraseanet:Basket', 4);
|
||||||
|
|
||||||
$this->mockNotificationDeliverer('Alchemy\Phrasea\Notification\Mail\MailInfoValidationDone');
|
$this->mockNotificationDeliverer('Alchemy\Phrasea\Notification\Mail\MailInfoValidationDone');
|
||||||
|
|
||||||
|
@@ -209,7 +209,7 @@ class OverviewTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testPermalinkRouteNotAuthenticatedIsOkInPublicFeed()
|
public function testPermalinkRouteNotAuthenticatedIsOkInPublicFeed()
|
||||||
{
|
{
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 2);
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 2);
|
||||||
$entry = $feed->getEntries()->first();
|
$entry = $feed->getEntries()->first();
|
||||||
$item = $entry->getItems()->first();
|
$item = $entry->getItems()->first();
|
||||||
|
|
||||||
|
@@ -155,7 +155,7 @@ class AuthenticatorTest extends \PhraseanetTestCase
|
|||||||
|
|
||||||
$em->expects($this->once())
|
$em->expects($this->once())
|
||||||
->method('getRepository')
|
->method('getRepository')
|
||||||
->with($this->equalTo('Alchemy\Phrasea\Model\Entities\Session'))
|
->with($this->equalTo('Phraseanet:Session'))
|
||||||
->will($this->returnValue($repo));
|
->will($this->returnValue($repo));
|
||||||
|
|
||||||
$authenticator = new Authenticator($app, $browser, $SFsession, $em);
|
$authenticator = new Authenticator($app, $browser, $SFsession, $em);
|
||||||
@@ -197,7 +197,7 @@ class AuthenticatorTest extends \PhraseanetTestCase
|
|||||||
|
|
||||||
$em->expects($this->once())
|
$em->expects($this->once())
|
||||||
->method('getRepository')
|
->method('getRepository')
|
||||||
->with($this->equalTo('Alchemy\Phrasea\Model\Entities\Session'))
|
->with($this->equalTo('Phraseanet:Session'))
|
||||||
->will($this->returnValue($repo));
|
->will($this->returnValue($repo));
|
||||||
|
|
||||||
$authenticator = new Authenticator($app, $browser, $SFsession, $em);
|
$authenticator = new Authenticator($app, $browser, $SFsession, $em);
|
||||||
|
@@ -41,7 +41,7 @@ class ManagerTest extends \PhraseanetTestCase
|
|||||||
|
|
||||||
$em->expects($this->once())
|
$em->expects($this->once())
|
||||||
->method('getRepository')
|
->method('getRepository')
|
||||||
->with($this->equalTo('Alchemy\Phrasea\Model\Entities\Session'))
|
->with($this->equalTo('Phraseanet:Session'))
|
||||||
->will($this->returnValue($repo));
|
->will($this->returnValue($repo));
|
||||||
|
|
||||||
$encoder->expects($this->once())
|
$encoder->expects($this->once())
|
||||||
@@ -86,7 +86,7 @@ class ManagerTest extends \PhraseanetTestCase
|
|||||||
|
|
||||||
$em->expects($this->once())
|
$em->expects($this->once())
|
||||||
->method('getRepository')
|
->method('getRepository')
|
||||||
->with($this->equalTo('Alchemy\Phrasea\Model\Entities\Session'))
|
->with($this->equalTo('Phraseanet:Session'))
|
||||||
->will($this->returnValue($repo));
|
->will($this->returnValue($repo));
|
||||||
|
|
||||||
$encoder->expects($this->once())
|
$encoder->expects($this->once())
|
||||||
@@ -119,7 +119,7 @@ class ManagerTest extends \PhraseanetTestCase
|
|||||||
|
|
||||||
$em->expects($this->once())
|
$em->expects($this->once())
|
||||||
->method('getRepository')
|
->method('getRepository')
|
||||||
->with($this->equalTo('Alchemy\Phrasea\Model\Entities\Session'))
|
->with($this->equalTo('Phraseanet:Session'))
|
||||||
->will($this->returnValue($repo));
|
->will($this->returnValue($repo));
|
||||||
|
|
||||||
$this->assertFalse($manager->getSession($tokenValue));
|
$this->assertFalse($manager->getSession($tokenValue));
|
||||||
|
@@ -250,17 +250,17 @@ class FailureManagerTest extends \PhraseanetTestCase
|
|||||||
->method('getClientIp')
|
->method('getClientIp')
|
||||||
->will($this->returnValue($ip));
|
->will($this->returnValue($ip));
|
||||||
|
|
||||||
$this->assertCount(10, self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\AuthFailure')
|
$this->assertCount(10, self::$DI['app']['EM']->getRepository('Phraseanet:AuthFailure')
|
||||||
->findOldFailures());
|
->findOldFailures());
|
||||||
$this->assertCount(12, self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\AuthFailure')
|
$this->assertCount(12, self::$DI['app']['EM']->getRepository('Phraseanet:AuthFailure')
|
||||||
->findAll());
|
->findAll());
|
||||||
|
|
||||||
$manager = new FailureManager(self::$DI['app']['EM'], $recaptcha, 9);
|
$manager = new FailureManager(self::$DI['app']['EM'], $recaptcha, 9);
|
||||||
$manager->saveFailure($username, $request);
|
$manager->saveFailure($username, $request);
|
||||||
|
|
||||||
$this->assertCount(0, self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\AuthFailure')
|
$this->assertCount(0, self::$DI['app']['EM']->getRepository('Phraseanet:AuthFailure')
|
||||||
->findOldFailures());
|
->findOldFailures());
|
||||||
$this->assertCount(3, self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\AuthFailure')
|
$this->assertCount(3, self::$DI['app']['EM']->getRepository('Phraseanet:AuthFailure')
|
||||||
->findAll());
|
->findAll());
|
||||||
|
|
||||||
self::$DI['app']['EM']->getEventManager()->addEventSubscriber(new TimestampableListener());
|
self::$DI['app']['EM']->getEventManager()->addEventSubscriber(new TimestampableListener());
|
||||||
@@ -285,7 +285,7 @@ class FailureManagerTest extends \PhraseanetTestCase
|
|||||||
|
|
||||||
$em->expects($this->once())
|
$em->expects($this->once())
|
||||||
->method('getRepository')
|
->method('getRepository')
|
||||||
->with($this->equalTo('Alchemy\Phrasea\Model\Entities\AuthFailure'))
|
->with($this->equalTo('Phraseanet:AuthFailure'))
|
||||||
->will($this->returnValue($repo));
|
->will($this->returnValue($repo));
|
||||||
|
|
||||||
return $em;
|
return $em;
|
||||||
|
@@ -38,7 +38,7 @@ class Sha256Test extends \PhraseanetTestCase
|
|||||||
*/
|
*/
|
||||||
public function testCheck()
|
public function testCheck()
|
||||||
{
|
{
|
||||||
$session = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\LazaretSession', 1);
|
$session = self::$DI['app']['EM']->find('Phraseanet:LazaretSession', 1);
|
||||||
|
|
||||||
self::$DI['app']['border-manager']->process($session, File::buildFromPathfile($this->media->getFile()->getPathname(), self::$DI['collection'], self::$DI['app']), null, Manager::FORCE_RECORD);
|
self::$DI['app']['border-manager']->process($session, File::buildFromPathfile($this->media->getFile()->getPathname(), self::$DI['collection'], self::$DI['app']), null, Manager::FORCE_RECORD);
|
||||||
|
|
||||||
|
@@ -54,7 +54,7 @@ class ManagerTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$this->object = new Manager(self::$DI['app']);
|
$this->object = new Manager(self::$DI['app']);
|
||||||
$this->session = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\LazaretSession', 1);
|
$this->session = self::$DI['app']['EM']->find('Phraseanet:LazaretSession', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -558,7 +558,7 @@ class AdminCollectionTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
$json = $this->getJson(self::$DI['client']->getResponse());
|
$json = $this->getJson(self::$DI['client']->getResponse());
|
||||||
$this->assertTrue($json->success);
|
$this->assertTrue($json->success);
|
||||||
|
|
||||||
if (count(self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Task')->findAll()) === 0) {
|
if (count(self::$DI['app']['EM']->getRepository('Phraseanet:Task')->findAll()) === 0) {
|
||||||
$this->fail('Task for empty collection has not been created');
|
$this->fail('Task for empty collection has not been created');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -680,7 +680,7 @@ class DataboxTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
$json = $this->getJson(self::$DI['client']->getResponse());
|
$json = $this->getJson(self::$DI['client']->getResponse());
|
||||||
$this->assertTrue($json->success);
|
$this->assertTrue($json->success);
|
||||||
|
|
||||||
if (count(self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Task')->findAll()) === 0) {
|
if (count(self::$DI['app']['EM']->getRepository('Phraseanet:Task')->findAll()) === 0) {
|
||||||
$this->fail('Task for empty collection has not been created');
|
$this->fail('Task for empty collection has not been created');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -19,7 +19,7 @@ class PublicationTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
$crawler = self::$DI['client']->request('GET', '/admin/publications/list/');
|
$crawler = self::$DI['client']->request('GET', '/admin/publications/list/');
|
||||||
$pageContent = self::$DI['client']->getResponse()->getContent();
|
$pageContent = self::$DI['client']->getResponse()->getContent();
|
||||||
$this->assertTrue(self::$DI['client']->getResponse()->isOk());
|
$this->assertTrue(self::$DI['client']->getResponse()->isOk());
|
||||||
$feeds = self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Feed')->getAllForUser(self::$DI['app']['acl']->get(self::$DI['user']));
|
$feeds = self::$DI['app']['EM']->getRepository('Phraseanet:Feed')->getAllForUser(self::$DI['app']['acl']->get(self::$DI['user']));
|
||||||
|
|
||||||
foreach ($feeds as $feed) {
|
foreach ($feeds as $feed) {
|
||||||
$this->assertRegExp('/\/admin\/publications\/feed\/' . $feed->getId() . '/', $pageContent);
|
$this->assertRegExp('/\/admin\/publications\/feed\/' . $feed->getId() . '/', $pageContent);
|
||||||
@@ -34,21 +34,21 @@ class PublicationTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testCreate()
|
public function testCreate()
|
||||||
{
|
{
|
||||||
$feeds = self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Feed')->getAllForUser(self::$DI['app']['acl']->get(self::$DI['user']));
|
$feeds = self::$DI['app']['EM']->getRepository('Phraseanet:Feed')->getAllForUser(self::$DI['app']['acl']->get(self::$DI['user']));
|
||||||
$count = sizeof($feeds);
|
$count = sizeof($feeds);
|
||||||
|
|
||||||
$crawler = self::$DI['client']->request('POST', '/admin/publications/create/', ["title" => "hello", "subtitle" => "coucou", "base_id" => self::$DI['collection']->get_base_id()]);
|
$crawler = self::$DI['client']->request('POST', '/admin/publications/create/', ["title" => "hello", "subtitle" => "coucou", "base_id" => self::$DI['collection']->get_base_id()]);
|
||||||
|
|
||||||
$this->assertTrue(self::$DI['client']->getResponse()->isRedirect('/admin/publications/list/'));
|
$this->assertTrue(self::$DI['client']->getResponse()->isRedirect('/admin/publications/list/'));
|
||||||
|
|
||||||
$feeds = self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Feed')->getAllForUser(self::$DI['app']['acl']->get(self::$DI['user']));
|
$feeds = self::$DI['app']['EM']->getRepository('Phraseanet:Feed')->getAllForUser(self::$DI['app']['acl']->get(self::$DI['user']));
|
||||||
$count_after = sizeof($feeds);
|
$count_after = sizeof($feeds);
|
||||||
$this->assertGreaterThan($count, $count_after);
|
$this->assertGreaterThan($count, $count_after);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGetFeed()
|
public function testGetFeed()
|
||||||
{
|
{
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 1);
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 1);
|
||||||
$crawler = self::$DI['client']->request('GET', '/admin/publications/feed/' . $feed->getId() . '/');
|
$crawler = self::$DI['client']->request('GET', '/admin/publications/feed/' . $feed->getId() . '/');
|
||||||
$this->assertTrue(self::$DI['client']->getResponse()->isOk());
|
$this->assertTrue(self::$DI['client']->getResponse()->isOk());
|
||||||
$this->assertEquals(1, $crawler->filterXPath("//form[@action='/admin/publications/feed/" . $feed->getId() . "/update/']")->count());
|
$this->assertEquals(1, $crawler->filterXPath("//form[@action='/admin/publications/feed/" . $feed->getId() . "/update/']")->count());
|
||||||
@@ -57,7 +57,7 @@ class PublicationTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testUpdatedFeedException()
|
public function testUpdatedFeedException()
|
||||||
{
|
{
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 1);
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 1);
|
||||||
|
|
||||||
self::$DI['client']->request("POST", "/admin/publications/feed/" . $feed->getId() . "/update/", [
|
self::$DI['client']->request("POST", "/admin/publications/feed/" . $feed->getId() . "/update/", [
|
||||||
'title' => 'test'
|
'title' => 'test'
|
||||||
@@ -65,7 +65,7 @@ class PublicationTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
, 'public' => '1'
|
, 'public' => '1'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', $feed->getId());
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', $feed->getId());
|
||||||
|
|
||||||
$this->assertTrue(
|
$this->assertTrue(
|
||||||
strpos(
|
strpos(
|
||||||
@@ -81,7 +81,7 @@ class PublicationTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testUpdatedFeedOwner()
|
public function testUpdatedFeedOwner()
|
||||||
{
|
{
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 1);
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 1);
|
||||||
|
|
||||||
self::$DI['client']->request("POST", "/admin/publications/feed/" . $feed->getId() . "/update/", [
|
self::$DI['client']->request("POST", "/admin/publications/feed/" . $feed->getId() . "/update/", [
|
||||||
'title' => 'test'
|
'title' => 'test'
|
||||||
@@ -96,7 +96,7 @@ class PublicationTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
, '/admin/publications/list/'
|
, '/admin/publications/list/'
|
||||||
) === 0);
|
) === 0);
|
||||||
|
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', $feed->getId());
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', $feed->getId());
|
||||||
|
|
||||||
$collection = $feed->getCollection(self::$DI['app']);
|
$collection = $feed->getCollection(self::$DI['app']);
|
||||||
|
|
||||||
@@ -114,7 +114,7 @@ class PublicationTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testIconUploadErrorOwner()
|
public function testIconUploadErrorOwner()
|
||||||
{
|
{
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 3);
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 3);
|
||||||
|
|
||||||
self::$DI['client']->request("POST", "/admin/publications/feed/" . $feed->getId() . "/iconupload/", [], [], ['HTTP_ACCEPT' => 'application/json']);
|
self::$DI['client']->request("POST", "/admin/publications/feed/" . $feed->getId() . "/iconupload/", [], [], ['HTTP_ACCEPT' => 'application/json']);
|
||||||
|
|
||||||
@@ -125,7 +125,7 @@ class PublicationTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testIconUploadErrorFileData()
|
public function testIconUploadErrorFileData()
|
||||||
{
|
{
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 1);
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 1);
|
||||||
|
|
||||||
self::$DI['client']->request(
|
self::$DI['client']->request(
|
||||||
"POST"
|
"POST"
|
||||||
@@ -143,7 +143,7 @@ class PublicationTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testIconUploadErrorFileType()
|
public function testIconUploadErrorFileType()
|
||||||
{
|
{
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 1);
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 1);
|
||||||
|
|
||||||
self::$DI['client']->request(
|
self::$DI['client']->request(
|
||||||
"POST"
|
"POST"
|
||||||
@@ -161,7 +161,7 @@ class PublicationTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testIconUpload()
|
public function testIconUpload()
|
||||||
{
|
{
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 1);
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 1);
|
||||||
|
|
||||||
$files = [
|
$files = [
|
||||||
'files' => [
|
'files' => [
|
||||||
@@ -189,7 +189,7 @@ class PublicationTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testAddPublisher()
|
public function testAddPublisher()
|
||||||
{
|
{
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 1);
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 1);
|
||||||
|
|
||||||
self::$DI['client']->request("POST", "/admin/publications/feed/" . $feed->getId() . "/addpublisher/", [
|
self::$DI['client']->request("POST", "/admin/publications/feed/" . $feed->getId() . "/addpublisher/", [
|
||||||
'usr_id' => self::$DI['user_alt1']->get_id()
|
'usr_id' => self::$DI['user_alt1']->get_id()
|
||||||
@@ -198,7 +198,7 @@ class PublicationTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
$response = self::$DI['client']->getResponse();
|
$response = self::$DI['client']->getResponse();
|
||||||
$this->assertTrue($response->isRedirect());
|
$this->assertTrue($response->isRedirect());
|
||||||
|
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', $feed->getId());
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', $feed->getId());
|
||||||
$publishers = $feed->getPublishers();
|
$publishers = $feed->getPublishers();
|
||||||
|
|
||||||
$this->assertTrue($feed->isPublisher(self::$DI['user_alt1']));
|
$this->assertTrue($feed->isPublisher(self::$DI['user_alt1']));
|
||||||
@@ -211,11 +211,11 @@ class PublicationTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testAddPublisherException()
|
public function testAddPublisherException()
|
||||||
{
|
{
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 1);
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 1);
|
||||||
|
|
||||||
self::$DI['client']->request("POST", "/admin/publications/feed/" . $feed->getId() . "/addpublisher/");
|
self::$DI['client']->request("POST", "/admin/publications/feed/" . $feed->getId() . "/addpublisher/");
|
||||||
|
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', $feed->getId());
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', $feed->getId());
|
||||||
$response = self::$DI['client']->getResponse();
|
$response = self::$DI['client']->getResponse();
|
||||||
$this->assertTrue($response->isRedirect());
|
$this->assertTrue($response->isRedirect());
|
||||||
$this->assertTrue(
|
$this->assertTrue(
|
||||||
@@ -227,7 +227,7 @@ class PublicationTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testRemovePublisher()
|
public function testRemovePublisher()
|
||||||
{
|
{
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 1);
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 1);
|
||||||
|
|
||||||
self::$DI['client']->request("POST", "/admin/publications/feed/" . $feed->getId() . "/removepublisher/", [
|
self::$DI['client']->request("POST", "/admin/publications/feed/" . $feed->getId() . "/removepublisher/", [
|
||||||
'usr_id' => self::$DI['user_alt1']->get_id()
|
'usr_id' => self::$DI['user_alt1']->get_id()
|
||||||
@@ -236,7 +236,7 @@ class PublicationTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
$response = self::$DI['client']->getResponse();
|
$response = self::$DI['client']->getResponse();
|
||||||
$this->assertTrue($response->isRedirect());
|
$this->assertTrue($response->isRedirect());
|
||||||
|
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', $feed->getId());
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', $feed->getId());
|
||||||
$publishers = $feed->getPublishers();
|
$publishers = $feed->getPublishers();
|
||||||
|
|
||||||
$this->assertFalse(isset($publishers[self::$DI['user_alt1']->get_id()]));
|
$this->assertFalse(isset($publishers[self::$DI['user_alt1']->get_id()]));
|
||||||
@@ -249,14 +249,14 @@ class PublicationTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testRemovePublisherException()
|
public function testRemovePublisherException()
|
||||||
{
|
{
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 1);
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 1);
|
||||||
|
|
||||||
self::$DI['client']->request("POST", "/admin/publications/feed/" . $feed->getId() . "/removepublisher/");
|
self::$DI['client']->request("POST", "/admin/publications/feed/" . $feed->getId() . "/removepublisher/");
|
||||||
|
|
||||||
$response = self::$DI['client']->getResponse();
|
$response = self::$DI['client']->getResponse();
|
||||||
$this->assertTrue($response->isRedirect());
|
$this->assertTrue($response->isRedirect());
|
||||||
|
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', $feed->getId());
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', $feed->getId());
|
||||||
|
|
||||||
$this->assertTrue(
|
$this->assertTrue(
|
||||||
strpos(
|
strpos(
|
||||||
@@ -267,7 +267,7 @@ class PublicationTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testDeleteFeed()
|
public function testDeleteFeed()
|
||||||
{
|
{
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 1);
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 1);
|
||||||
|
|
||||||
self::$DI['client']->request("POST", "/admin/publications/feed/" . $feed->getId() . "/delete/");
|
self::$DI['client']->request("POST", "/admin/publications/feed/" . $feed->getId() . "/delete/");
|
||||||
|
|
||||||
|
@@ -85,12 +85,12 @@ class TaskManagerTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
$this->assertEquals(302, self::$DI['client']->getResponse()->getStatusCode());
|
$this->assertEquals(302, self::$DI['client']->getResponse()->getStatusCode());
|
||||||
$this->assertEquals('/admin/task-manager/tasks', self::$DI['client']->getResponse()->headers->get('location'));
|
$this->assertEquals('/admin/task-manager/tasks', self::$DI['client']->getResponse()->headers->get('location'));
|
||||||
|
|
||||||
$this->assertNull(self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Task', 1));
|
$this->assertNull(self::$DI['app']['EM']->find('Phraseanet:Task', 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testPostTaskStart()
|
public function testPostTaskStart()
|
||||||
{
|
{
|
||||||
$task = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Task', 1);
|
$task = self::$DI['app']['EM']->find('Phraseanet:Task', 1);
|
||||||
|
|
||||||
self::$DI['client']->request('POST', '/admin/task-manager/task/'.$task->getId().'/start');
|
self::$DI['client']->request('POST', '/admin/task-manager/task/'.$task->getId().'/start');
|
||||||
$this->assertEquals(302, self::$DI['client']->getResponse()->getStatusCode());
|
$this->assertEquals(302, self::$DI['client']->getResponse()->getStatusCode());
|
||||||
@@ -101,7 +101,7 @@ class TaskManagerTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testPostTaskStop()
|
public function testPostTaskStop()
|
||||||
{
|
{
|
||||||
$task = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Task', 1);
|
$task = self::$DI['app']['EM']->find('Phraseanet:Task', 1);
|
||||||
|
|
||||||
self::$DI['client']->request('POST', '/admin/task-manager/task/'.$task->getId().'/stop');
|
self::$DI['client']->request('POST', '/admin/task-manager/task/'.$task->getId().'/stop');
|
||||||
$this->assertEquals(302, self::$DI['client']->getResponse()->getStatusCode());
|
$this->assertEquals(302, self::$DI['client']->getResponse()->getStatusCode());
|
||||||
@@ -112,7 +112,7 @@ class TaskManagerTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testPostResetCrashes()
|
public function testPostResetCrashes()
|
||||||
{
|
{
|
||||||
$task = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Task', 1);
|
$task = self::$DI['app']['EM']->find('Phraseanet:Task', 1);
|
||||||
|
|
||||||
self::$DI['client']->request('POST', '/admin/task-manager/task/'.$task->getId().'/resetcrashcounter');
|
self::$DI['client']->request('POST', '/admin/task-manager/task/'.$task->getId().'/resetcrashcounter');
|
||||||
$this->assertEquals(200, self::$DI['client']->getResponse()->getStatusCode());
|
$this->assertEquals(200, self::$DI['client']->getResponse()->getStatusCode());
|
||||||
@@ -123,7 +123,7 @@ class TaskManagerTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testPostSaveTask()
|
public function testPostSaveTask()
|
||||||
{
|
{
|
||||||
$task = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Task', 1);
|
$task = self::$DI['app']['EM']->find('Phraseanet:Task', 1);
|
||||||
|
|
||||||
$name = 'renamed';
|
$name = 'renamed';
|
||||||
$period = 366;
|
$period = 366;
|
||||||
|
@@ -31,10 +31,10 @@ class BasketsTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
*/
|
*/
|
||||||
public function testCreateBasket()
|
public function testCreateBasket()
|
||||||
{
|
{
|
||||||
$nbBasketsBefore = self::$DI['app']['EM']->createQuery('SELECT COUNT(b.id) FROM \Alchemy\Phrasea\Model\Entities\Basket b')->getSingleScalarResult();
|
$nbBasketsBefore = self::$DI['app']['EM']->createQuery('SELECT COUNT(b.id) FROM Phraseanet:Basket b')->getSingleScalarResult();
|
||||||
self::$DI['client']->request("POST", "/client/baskets/new/", ['p0' => 'hello']);
|
self::$DI['client']->request("POST", "/client/baskets/new/", ['p0' => 'hello']);
|
||||||
$this->assertTrue(self::$DI['client']->getResponse()->isRedirect());
|
$this->assertTrue(self::$DI['client']->getResponse()->isRedirect());
|
||||||
$nbBasketsAfter = self::$DI['app']['EM']->createQuery('SELECT COUNT(b.id) FROM \Alchemy\Phrasea\Model\Entities\Basket b')->getSingleScalarResult();
|
$nbBasketsAfter = self::$DI['app']['EM']->createQuery('SELECT COUNT(b.id) FROM Phraseanet:Basket b')->getSingleScalarResult();
|
||||||
$this->assertGreaterThan($nbBasketsBefore,$nbBasketsAfter);
|
$this->assertGreaterThan($nbBasketsBefore,$nbBasketsAfter);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,14 +43,14 @@ class BasketsTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
*/
|
*/
|
||||||
public function testAddElementToBasket()
|
public function testAddElementToBasket()
|
||||||
{
|
{
|
||||||
$basket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 1);
|
$basket = self::$DI['app']['EM']->find('Phraseanet:Basket', 1);
|
||||||
self::$DI['client']->request("POST", "/client/baskets/add-element/", [
|
self::$DI['client']->request("POST", "/client/baskets/add-element/", [
|
||||||
'courChuId' => $basket->getId(),
|
'courChuId' => $basket->getId(),
|
||||||
'sbas' => self::$DI['record_1']->get_sbas_id(),
|
'sbas' => self::$DI['record_1']->get_sbas_id(),
|
||||||
'p0' => self::$DI['record_1']->get_record_id()
|
'p0' => self::$DI['record_1']->get_record_id()
|
||||||
]);
|
]);
|
||||||
$this->assertTrue(self::$DI['client']->getResponse()->isRedirect());
|
$this->assertTrue(self::$DI['client']->getResponse()->isRedirect());
|
||||||
$basket = self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Basket')->find($basket->getId());
|
$basket = self::$DI['app']['EM']->getRepository('Phraseanet:Basket')->find($basket->getId());
|
||||||
$this->assertGreaterThan(0, $basket->getElements()->count());
|
$this->assertGreaterThan(0, $basket->getElements()->count());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ class BasketsTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
]);
|
]);
|
||||||
$this->assertTrue(self::$DI['client']->getResponse()->isRedirect());
|
$this->assertTrue(self::$DI['client']->getResponse()->isRedirect());
|
||||||
try {
|
try {
|
||||||
$basket = self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Basket')->find(1);
|
$basket = self::$DI['app']['EM']->getRepository('Phraseanet:Basket')->find(1);
|
||||||
$this->fail('Basket is not deleted');
|
$this->fail('Basket is not deleted');
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
|
||||||
@@ -76,8 +76,8 @@ class BasketsTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
*/
|
*/
|
||||||
public function testDeleteBasketElement()
|
public function testDeleteBasketElement()
|
||||||
{
|
{
|
||||||
$basket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 1);
|
$basket = self::$DI['app']['EM']->find('Phraseanet:Basket', 1);
|
||||||
$basketElement = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\BasketElement', 1);
|
$basketElement = self::$DI['app']['EM']->find('Phraseanet:BasketElement', 1);
|
||||||
|
|
||||||
self::$DI['client']->request("POST", "/client/baskets/delete-element/", [
|
self::$DI['client']->request("POST", "/client/baskets/delete-element/", [
|
||||||
'p0' => $basketElement->getId()
|
'p0' => $basketElement->getId()
|
||||||
|
@@ -35,13 +35,13 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
$response = self::$DI['client']->getResponse();
|
$response = self::$DI['client']->getResponse();
|
||||||
|
|
||||||
$query = self::$DI['app']['EM']->createQuery('SELECT COUNT(b.id) FROM \Alchemy\Phrasea\Model\Entities\Basket b');
|
$query = self::$DI['app']['EM']->createQuery('SELECT COUNT(b.id) FROM Phraseanet:Basket b');
|
||||||
$count = $query->getSingleScalarResult();
|
$count = $query->getSingleScalarResult();
|
||||||
|
|
||||||
$this->assertEquals(5, $count);
|
$this->assertEquals(5, $count);
|
||||||
$this->assertEquals(302, $response->getStatusCode());
|
$this->assertEquals(302, $response->getStatusCode());
|
||||||
|
|
||||||
$query = self::$DI['app']['EM']->createQuery('SELECT b FROM \Alchemy\Phrasea\Model\Entities\Basket b');
|
$query = self::$DI['app']['EM']->createQuery('SELECT b FROM Phraseanet:Basket b');
|
||||||
$result = $query->getResult();
|
$result = $query->getResult();
|
||||||
|
|
||||||
$basket = array_pop($result);
|
$basket = array_pop($result);
|
||||||
@@ -50,7 +50,7 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testRootPostJSON()
|
public function testRootPostJSON()
|
||||||
{
|
{
|
||||||
$query = self::$DI['app']['EM']->createQuery('SELECT COUNT(b.id) FROM \Alchemy\Phrasea\Model\Entities\Basket b');
|
$query = self::$DI['app']['EM']->createQuery('SELECT COUNT(b.id) FROM Phraseanet:Basket b');
|
||||||
$count = $query->getSingleScalarResult();
|
$count = $query->getSingleScalarResult();
|
||||||
|
|
||||||
$route = '/prod/baskets/';
|
$route = '/prod/baskets/';
|
||||||
@@ -70,7 +70,7 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
$response = self::$DI['client']->getResponse();
|
$response = self::$DI['client']->getResponse();
|
||||||
|
|
||||||
$query = self::$DI['app']['EM']->createQuery('SELECT COUNT(b.id) FROM \Alchemy\Phrasea\Model\Entities\Basket b');
|
$query = self::$DI['app']['EM']->createQuery('SELECT COUNT(b.id) FROM Phraseanet:Basket b');
|
||||||
|
|
||||||
$this->assertEquals($count + 1, $query->getSingleScalarResult());
|
$this->assertEquals($count + 1, $query->getSingleScalarResult());
|
||||||
$this->assertEquals(200, $response->getStatusCode());
|
$this->assertEquals(200, $response->getStatusCode());
|
||||||
@@ -105,7 +105,7 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testBasketGetAccessDenied()
|
public function testBasketGetAccessDenied()
|
||||||
{
|
{
|
||||||
$basket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 3);
|
$basket = self::$DI['app']['EM']->find('Phraseanet:Basket', 3);
|
||||||
$route = sprintf('/prod/baskets/%s/', $basket->getId());
|
$route = sprintf('/prod/baskets/%s/', $basket->getId());
|
||||||
self::$DI['client']->request('GET', $route);
|
self::$DI['client']->request('GET', $route);
|
||||||
$response = self::$DI['client']->getResponse();
|
$response = self::$DI['client']->getResponse();
|
||||||
@@ -114,7 +114,7 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testBasketDeleteElementPost()
|
public function testBasketDeleteElementPost()
|
||||||
{
|
{
|
||||||
$basketElement = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\BasketElement', 1);
|
$basketElement = self::$DI['app']['EM']->find('Phraseanet:BasketElement', 1);
|
||||||
$basket = $basketElement->getBasket();
|
$basket = $basketElement->getBasket();
|
||||||
|
|
||||||
$this->assertEquals(1, $basket->getElements()->count());
|
$this->assertEquals(1, $basket->getElements()->count());
|
||||||
@@ -131,8 +131,8 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testBasketDeldeteElementPostJSON()
|
public function testBasketDeldeteElementPostJSON()
|
||||||
{
|
{
|
||||||
$basket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 1);
|
$basket = self::$DI['app']['EM']->find('Phraseanet:Basket', 1);
|
||||||
$basket_element = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\BasketElement', 1);
|
$basket_element = self::$DI['app']['EM']->find('Phraseanet:BasketElement', 1);
|
||||||
|
|
||||||
$route = sprintf(
|
$route = sprintf(
|
||||||
"/prod/baskets/%s/delete/%s/", $basket->getId(), $basket_element->getId()
|
"/prod/baskets/%s/delete/%s/", $basket->getId(), $basket_element->getId()
|
||||||
@@ -151,13 +151,13 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testBasketDeletePostUnauthorized()
|
public function testBasketDeletePostUnauthorized()
|
||||||
{
|
{
|
||||||
$basket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 3);
|
$basket = self::$DI['app']['EM']->find('Phraseanet:Basket', 3);
|
||||||
$route = sprintf('/prod/baskets/%s/delete/', $basket->getId());
|
$route = sprintf('/prod/baskets/%s/delete/', $basket->getId());
|
||||||
self::$DI['client']->request('POST', $route);
|
self::$DI['client']->request('POST', $route);
|
||||||
$response = self::$DI['client']->getResponse();
|
$response = self::$DI['client']->getResponse();
|
||||||
|
|
||||||
$this->assertEquals(403, $response->getStatusCode());
|
$this->assertEquals(403, $response->getStatusCode());
|
||||||
$query = self::$DI['app']['EM']->createQuery('SELECT COUNT(b.id) FROM \Alchemy\Phrasea\Model\Entities\Basket b');
|
$query = self::$DI['app']['EM']->createQuery('SELECT COUNT(b.id) FROM Phraseanet:Basket b');
|
||||||
$count = $query->getSingleScalarResult();
|
$count = $query->getSingleScalarResult();
|
||||||
$this->assertEquals(4, $count);
|
$this->assertEquals(4, $count);
|
||||||
}
|
}
|
||||||
@@ -167,7 +167,7 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
$route = '/prod/baskets/1/delete/';
|
$route = '/prod/baskets/1/delete/';
|
||||||
self::$DI['client']->request('POST', $route);
|
self::$DI['client']->request('POST', $route);
|
||||||
$response = self::$DI['client']->getResponse();
|
$response = self::$DI['client']->getResponse();
|
||||||
$query = self::$DI['app']['EM']->createQuery('SELECT COUNT(b.id) FROM \Alchemy\Phrasea\Model\Entities\Basket b');
|
$query = self::$DI['app']['EM']->createQuery('SELECT COUNT(b.id) FROM Phraseanet:Basket b');
|
||||||
$count = $query->getSingleScalarResult();
|
$count = $query->getSingleScalarResult();
|
||||||
$this->assertEquals(3, $count);
|
$this->assertEquals(3, $count);
|
||||||
$this->assertEquals(302, $response->getStatusCode());
|
$this->assertEquals(302, $response->getStatusCode());
|
||||||
@@ -178,7 +178,7 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
$route = '/prod/baskets/1/delete/';
|
$route = '/prod/baskets/1/delete/';
|
||||||
self::$DI['client']->request('POST', $route, [], [], ["HTTP_ACCEPT" => "application/json"]);
|
self::$DI['client']->request('POST', $route, [], [], ["HTTP_ACCEPT" => "application/json"]);
|
||||||
$response = self::$DI['client']->getResponse();
|
$response = self::$DI['client']->getResponse();
|
||||||
$query = self::$DI['app']['EM']->createQuery('SELECT COUNT(b.id) FROM \Alchemy\Phrasea\Model\Entities\Basket b');
|
$query = self::$DI['app']['EM']->createQuery('SELECT COUNT(b.id) FROM Phraseanet:Basket b');
|
||||||
$count = $query->getSingleScalarResult();
|
$count = $query->getSingleScalarResult();
|
||||||
$this->assertEquals(3, $count);
|
$this->assertEquals(3, $count);
|
||||||
$this->assertEquals(200, $response->getStatusCode());
|
$this->assertEquals(200, $response->getStatusCode());
|
||||||
@@ -186,7 +186,7 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testBasketUpdatePost()
|
public function testBasketUpdatePost()
|
||||||
{
|
{
|
||||||
$basket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 1);
|
$basket = self::$DI['app']['EM']->find('Phraseanet:Basket', 1);
|
||||||
$route = sprintf('/prod/baskets/%s/update/', $basket->getId());
|
$route = sprintf('/prod/baskets/%s/update/', $basket->getId());
|
||||||
|
|
||||||
self::$DI['client']->request(
|
self::$DI['client']->request(
|
||||||
@@ -203,7 +203,7 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testBasketUpdatePostJSON()
|
public function testBasketUpdatePostJSON()
|
||||||
{
|
{
|
||||||
$basket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 1);
|
$basket = self::$DI['app']['EM']->find('Phraseanet:Basket', 1);
|
||||||
$route = sprintf('/prod/baskets/%s/update/', $basket->getId());
|
$route = sprintf('/prod/baskets/%s/update/', $basket->getId());
|
||||||
|
|
||||||
self::$DI['client']->request(
|
self::$DI['client']->request(
|
||||||
@@ -222,7 +222,7 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testReorderGet()
|
public function testReorderGet()
|
||||||
{
|
{
|
||||||
$basket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 4);
|
$basket = self::$DI['app']['EM']->find('Phraseanet:Basket', 4);
|
||||||
|
|
||||||
$route = sprintf("/prod/baskets/%s/reorder/", $basket->getId());
|
$route = sprintf("/prod/baskets/%s/reorder/", $basket->getId());
|
||||||
|
|
||||||
@@ -238,7 +238,7 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testBasketUpdateGet()
|
public function testBasketUpdateGet()
|
||||||
{
|
{
|
||||||
$basket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 1);
|
$basket = self::$DI['app']['EM']->find('Phraseanet:Basket', 1);
|
||||||
$route = sprintf('/prod/baskets/%s/update/', $basket->getId());
|
$route = sprintf('/prod/baskets/%s/update/', $basket->getId());
|
||||||
|
|
||||||
$crawler = self::$DI['client']->request(
|
$crawler = self::$DI['client']->request(
|
||||||
@@ -260,7 +260,7 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testBasketArchivedPost()
|
public function testBasketArchivedPost()
|
||||||
{
|
{
|
||||||
$basket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 1);
|
$basket = self::$DI['app']['EM']->find('Phraseanet:Basket', 1);
|
||||||
$route = sprintf('/prod/baskets/%s/archive/?archive=1', $basket->getId());
|
$route = sprintf('/prod/baskets/%s/archive/?archive=1', $basket->getId());
|
||||||
self::$DI['client']->request('POST', $route);
|
self::$DI['client']->request('POST', $route);
|
||||||
$this->assertTrue($basket->getArchived());
|
$this->assertTrue($basket->getArchived());
|
||||||
@@ -274,7 +274,7 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testBasketArchivedPostJSON()
|
public function testBasketArchivedPostJSON()
|
||||||
{
|
{
|
||||||
$basket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 1);
|
$basket = self::$DI['app']['EM']->find('Phraseanet:Basket', 1);
|
||||||
$route = sprintf('/prod/baskets/%s/archive/?archive=1', $basket->getId());
|
$route = sprintf('/prod/baskets/%s/archive/?archive=1', $basket->getId());
|
||||||
|
|
||||||
self::$DI['client']->request(
|
self::$DI['client']->request(
|
||||||
@@ -300,7 +300,7 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testAddElementPost()
|
public function testAddElementPost()
|
||||||
{
|
{
|
||||||
$basket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 1);
|
$basket = self::$DI['app']['EM']->find('Phraseanet:Basket', 1);
|
||||||
$route = sprintf('/prod/baskets/%s/addElements/', $basket->getId());
|
$route = sprintf('/prod/baskets/%s/addElements/', $basket->getId());
|
||||||
|
|
||||||
$records = [
|
$records = [
|
||||||
@@ -324,10 +324,10 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testAddElementToValidationPost()
|
public function testAddElementToValidationPost()
|
||||||
{
|
{
|
||||||
$datas = self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\ValidationData')->findAll();
|
$datas = self::$DI['app']['EM']->getRepository('Phraseanet:ValidationData')->findAll();
|
||||||
$countDatas = count($datas);
|
$countDatas = count($datas);
|
||||||
|
|
||||||
$basket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 4);
|
$basket = self::$DI['app']['EM']->find('Phraseanet:Basket', 4);
|
||||||
$this->assertCount(2, $basket->getElements());
|
$this->assertCount(2, $basket->getElements());
|
||||||
$route = sprintf('/prod/baskets/%s/addElements/', $basket->getId());
|
$route = sprintf('/prod/baskets/%s/addElements/', $basket->getId());
|
||||||
|
|
||||||
@@ -348,13 +348,13 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
$this->assertEquals(302, $response->getStatusCode());
|
$this->assertEquals(302, $response->getStatusCode());
|
||||||
$this->assertCount(4, $basket->getElements());
|
$this->assertCount(4, $basket->getElements());
|
||||||
$datas = self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\ValidationData')->findAll();
|
$datas = self::$DI['app']['EM']->getRepository('Phraseanet:ValidationData')->findAll();
|
||||||
$this->assertTrue($countDatas < count($datas), 'assert that ' . count($datas) . ' > ' . $countDatas);
|
$this->assertTrue($countDatas < count($datas), 'assert that ' . count($datas) . ' > ' . $countDatas);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testAddElementPostJSON()
|
public function testAddElementPostJSON()
|
||||||
{
|
{
|
||||||
$basket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 1);
|
$basket = self::$DI['app']['EM']->find('Phraseanet:Basket', 1);
|
||||||
$route = '/prod/baskets/1/addElements/';
|
$route = '/prod/baskets/1/addElements/';
|
||||||
|
|
||||||
$records = [
|
$records = [
|
||||||
@@ -372,10 +372,10 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testRouteStealElements()
|
public function testRouteStealElements()
|
||||||
{
|
{
|
||||||
$BasketElement = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\BasketElement', 1);
|
$BasketElement = self::$DI['app']['EM']->find('Phraseanet:BasketElement', 1);
|
||||||
|
|
||||||
$Basket_1 = $BasketElement->getBasket();
|
$Basket_1 = $BasketElement->getBasket();
|
||||||
$Basket_2 = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 2);
|
$Basket_2 = self::$DI['app']['EM']->find('Phraseanet:Basket', 2);
|
||||||
|
|
||||||
$route = sprintf('/prod/baskets/%s/stealElements/', $Basket_2->getId());
|
$route = sprintf('/prod/baskets/%s/stealElements/', $Basket_2->getId());
|
||||||
|
|
||||||
@@ -395,11 +395,11 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testRouteStealElementsJson()
|
public function testRouteStealElementsJson()
|
||||||
{
|
{
|
||||||
$BasketElement = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\BasketElement', 1);
|
$BasketElement = self::$DI['app']['EM']->find('Phraseanet:BasketElement', 1);
|
||||||
|
|
||||||
$Basket_1 = $BasketElement->getBasket();
|
$Basket_1 = $BasketElement->getBasket();
|
||||||
|
|
||||||
$Basket_2 = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 2);
|
$Basket_2 = self::$DI['app']['EM']->find('Phraseanet:Basket', 2);
|
||||||
|
|
||||||
$route = sprintf('/prod/baskets/%s/stealElements/', $Basket_2->getId());
|
$route = sprintf('/prod/baskets/%s/stealElements/', $Basket_2->getId());
|
||||||
|
|
||||||
@@ -428,7 +428,7 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testRemoveBasket()
|
public function testRemoveBasket()
|
||||||
{
|
{
|
||||||
$basket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 4);
|
$basket = self::$DI['app']['EM']->find('Phraseanet:Basket', 4);
|
||||||
|
|
||||||
$route = sprintf('/prod/baskets/%s/delete/', $basket->getId());
|
$route = sprintf('/prod/baskets/%s/delete/', $basket->getId());
|
||||||
self::$DI['client']->request('POST', $route, [], [], ["HTTP_ACCEPT" => "application/json"]);
|
self::$DI['client']->request('POST', $route, [], [], ["HTTP_ACCEPT" => "application/json"]);
|
||||||
@@ -443,16 +443,16 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
$this->assertArrayHasKey('success', $datas);
|
$this->assertArrayHasKey('success', $datas);
|
||||||
$this->assertTrue($datas['success']);
|
$this->assertTrue($datas['success']);
|
||||||
|
|
||||||
$query = self::$DI['app']['EM']->createQuery('SELECT COUNT(v.id) FROM \Alchemy\Phrasea\Model\Entities\ValidationParticipant v');
|
$query = self::$DI['app']['EM']->createQuery('SELECT COUNT(v.id) FROM Phraseanet:ValidationParticipant v');
|
||||||
$this->assertEquals(0, $query->getSingleScalarResult());
|
$this->assertEquals(0, $query->getSingleScalarResult());
|
||||||
|
|
||||||
$query = self::$DI['app']['EM']->createQuery('SELECT COUNT(b.id) FROM \Alchemy\Phrasea\Model\Entities\BasketElement b');
|
$query = self::$DI['app']['EM']->createQuery('SELECT COUNT(b.id) FROM Phraseanet:BasketElement b');
|
||||||
$this->assertEquals(1, $query->getSingleScalarResult());
|
$this->assertEquals(1, $query->getSingleScalarResult());
|
||||||
|
|
||||||
$query = self::$DI['app']['EM']->createQuery('SELECT COUNT(v.id) FROM \Alchemy\Phrasea\Model\Entities\ValidationSession v');
|
$query = self::$DI['app']['EM']->createQuery('SELECT COUNT(v.id) FROM Phraseanet:ValidationSession v');
|
||||||
$this->assertEquals(0, $query->getSingleScalarResult());
|
$this->assertEquals(0, $query->getSingleScalarResult());
|
||||||
|
|
||||||
$query = self::$DI['app']['EM']->createQuery('SELECT COUNT(b.id) FROM \Alchemy\Phrasea\Model\Entities\Basket b');
|
$query = self::$DI['app']['EM']->createQuery('SELECT COUNT(b.id) FROM Phraseanet:Basket b');
|
||||||
$this->assertEquals(3, $query->getSingleScalarResult());
|
$this->assertEquals(3, $query->getSingleScalarResult());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -104,7 +104,7 @@ class DownloadTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
*/
|
*/
|
||||||
public function testDownloadBasket()
|
public function testDownloadBasket()
|
||||||
{
|
{
|
||||||
$basket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 4);
|
$basket = self::$DI['app']['EM']->find('Phraseanet:Basket', 4);
|
||||||
|
|
||||||
$eventManagerStub = $this->getMockBuilder('\eventsmanager_broker')
|
$eventManagerStub = $this->getMockBuilder('\eventsmanager_broker')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
@@ -136,7 +136,7 @@ class DownloadTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
*/
|
*/
|
||||||
public function testDownloadBasketValidation()
|
public function testDownloadBasketValidation()
|
||||||
{
|
{
|
||||||
$basket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 4);
|
$basket = self::$DI['app']['EM']->find('Phraseanet:Basket', 4);
|
||||||
|
|
||||||
$eventManagerStub = $this->getMockBuilder('\eventsmanager_broker')
|
$eventManagerStub = $this->getMockBuilder('\eventsmanager_broker')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
|
@@ -12,7 +12,7 @@ class FeedTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
{
|
{
|
||||||
$crawler = self::$DI['client']->request('POST', '/prod/feeds/requestavailable/');
|
$crawler = self::$DI['client']->request('POST', '/prod/feeds/requestavailable/');
|
||||||
$this->assertTrue(self::$DI['client']->getResponse()->isOk());
|
$this->assertTrue(self::$DI['client']->getResponse()->isOk());
|
||||||
$feeds = self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Feed')->getAllForUser(self::$DI['app']['acl']->get(self::$DI['user']));
|
$feeds = self::$DI['app']['EM']->getRepository('Phraseanet:Feed')->getAllForUser(self::$DI['app']['acl']->get(self::$DI['user']));
|
||||||
foreach ($feeds as $one_feed) {
|
foreach ($feeds as $one_feed) {
|
||||||
if ($one_feed->isPublisher(self::$DI['user'])) {
|
if ($one_feed->isPublisher(self::$DI['user'])) {
|
||||||
$this->assertEquals(1, $crawler->filterXPath("//input[@value='" . $one_feed->getId() . "' and @name='feed_proposal[]']")->count());
|
$this->assertEquals(1, $crawler->filterXPath("//input[@value='" . $one_feed->getId() . "' and @name='feed_proposal[]']")->count());
|
||||||
@@ -30,7 +30,7 @@ class FeedTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
->method('deliver')
|
->method('deliver')
|
||||||
->with($this->isInstanceOf('Alchemy\Phrasea\Notification\Mail\MailInfoNewPublication'), $this->equalTo(null));
|
->with($this->isInstanceOf('Alchemy\Phrasea\Notification\Mail\MailInfoNewPublication'), $this->equalTo(null));
|
||||||
|
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 1);
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 1);
|
||||||
$params = [
|
$params = [
|
||||||
"feed_id" => $feed->getId()
|
"feed_id" => $feed->getId()
|
||||||
, "notify" => 1
|
, "notify" => 1
|
||||||
@@ -67,7 +67,7 @@ class FeedTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testEntryCreateUnauthorized()
|
public function testEntryCreateUnauthorized()
|
||||||
{
|
{
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 3);
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 3);
|
||||||
|
|
||||||
self::$DI['app']['notification.deliverer'] = $this->getMockBuilder('Alchemy\Phrasea\Notification\Deliverer')
|
self::$DI['app']['notification.deliverer'] = $this->getMockBuilder('Alchemy\Phrasea\Notification\Deliverer')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
@@ -91,7 +91,7 @@ class FeedTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testEntryEdit()
|
public function testEntryEdit()
|
||||||
{
|
{
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 1);
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 1);
|
||||||
$entry = $feed->getEntries()->first();
|
$entry = $feed->getEntries()->first();
|
||||||
$crawler = self::$DI['client']->request('GET', '/prod/feeds/entry/' . $entry->getId() . '/edit/');
|
$crawler = self::$DI['client']->request('GET', '/prod/feeds/entry/' . $entry->getId() . '/edit/');
|
||||||
|
|
||||||
@@ -108,7 +108,7 @@ class FeedTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testEntryEditUnauthorized()
|
public function testEntryEditUnauthorized()
|
||||||
{
|
{
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 3);
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 3);
|
||||||
$entry = $feed->getEntries()->first();
|
$entry = $feed->getEntries()->first();
|
||||||
|
|
||||||
self::$DI['client']->request('GET', '/prod/feeds/entry/' . $entry->getId() . '/edit/');
|
self::$DI['client']->request('GET', '/prod/feeds/entry/' . $entry->getId() . '/edit/');
|
||||||
@@ -118,7 +118,7 @@ class FeedTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testEntryUpdate()
|
public function testEntryUpdate()
|
||||||
{
|
{
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 1);
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 1);
|
||||||
$entry = $feed->getEntries()->first();
|
$entry = $feed->getEntries()->first();
|
||||||
|
|
||||||
$params = [
|
$params = [
|
||||||
@@ -142,9 +142,9 @@ class FeedTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testEntryUpdateChangeFeed()
|
public function testEntryUpdateChangeFeed()
|
||||||
{
|
{
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 1);
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 1);
|
||||||
$entry = $feed->getEntries()->first();
|
$entry = $feed->getEntries()->first();
|
||||||
$newfeed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 2);
|
$newfeed = self::$DI['app']['EM']->find('Phraseanet:Feed', 2);
|
||||||
|
|
||||||
$params = [
|
$params = [
|
||||||
"feed_id" => $newfeed->getId(),
|
"feed_id" => $newfeed->getId(),
|
||||||
@@ -164,15 +164,15 @@ class FeedTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
$this->assertTrue(is_string($pageContent->datas));
|
$this->assertTrue(is_string($pageContent->datas));
|
||||||
$this->assertRegExp("/entry_" . $entry->getId() . "/", $pageContent->datas);
|
$this->assertRegExp("/entry_" . $entry->getId() . "/", $pageContent->datas);
|
||||||
|
|
||||||
$retrievedentry = self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\FeedEntry')->find($entry->getId());
|
$retrievedentry = self::$DI['app']['EM']->getRepository('Phraseanet:FeedEntry')->find($entry->getId());
|
||||||
$this->assertEquals($newfeed->getId(), $retrievedentry->getFeed()->getId());
|
$this->assertEquals($newfeed->getId(), $retrievedentry->getFeed()->getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testEntryUpdateChangeFeedNoAccess()
|
public function testEntryUpdateChangeFeedNoAccess()
|
||||||
{
|
{
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 1);
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 1);
|
||||||
$entry = $feed->getEntries()->first();
|
$entry = $feed->getEntries()->first();
|
||||||
$newfeed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 3);
|
$newfeed = self::$DI['app']['EM']->find('Phraseanet:Feed', 3);
|
||||||
$newfeed->setCollection(self::$DI['collection_no_access']);
|
$newfeed->setCollection(self::$DI['collection_no_access']);
|
||||||
self::$DI['app']['EM']->persist($newfeed);
|
self::$DI['app']['EM']->persist($newfeed);
|
||||||
self::$DI['app']['EM']->flush();
|
self::$DI['app']['EM']->flush();
|
||||||
@@ -192,7 +192,7 @@ class FeedTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testEntryUpdateChangeFeedInvalidFeed()
|
public function testEntryUpdateChangeFeedInvalidFeed()
|
||||||
{
|
{
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 1);
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 1);
|
||||||
$entry = $feed->getEntries()->first();
|
$entry = $feed->getEntries()->first();
|
||||||
|
|
||||||
$params = [
|
$params = [
|
||||||
@@ -225,7 +225,7 @@ class FeedTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testEntryUpdateFailed()
|
public function testEntryUpdateFailed()
|
||||||
{
|
{
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 1);
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 1);
|
||||||
$entry = $feed->getEntries()->first(['user']);
|
$entry = $feed->getEntries()->first(['user']);
|
||||||
|
|
||||||
$params = [
|
$params = [
|
||||||
@@ -243,7 +243,7 @@ class FeedTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testEntryUpdateUnauthorized()
|
public function testEntryUpdateUnauthorized()
|
||||||
{
|
{
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 3);
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 3);
|
||||||
$entry = $feed->getEntries()->first();
|
$entry = $feed->getEntries()->first();
|
||||||
|
|
||||||
$params = [
|
$params = [
|
||||||
@@ -261,7 +261,7 @@ class FeedTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testEntryUpdateChangeOrder()
|
public function testEntryUpdateChangeOrder()
|
||||||
{
|
{
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 1);
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 1);
|
||||||
$entry = $feed->getEntries()->first();
|
$entry = $feed->getEntries()->first();
|
||||||
|
|
||||||
$items = $entry->getItems()->toArray();
|
$items = $entry->getItems()->toArray();
|
||||||
@@ -282,8 +282,8 @@ class FeedTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
self::$DI['client']->request('POST', '/prod/feeds/entry/' . $entry->getId() . '/update/', $params);
|
self::$DI['client']->request('POST', '/prod/feeds/entry/' . $entry->getId() . '/update/', $params);
|
||||||
$this->assertTrue(self::$DI['client']->getResponse()->isOk());
|
$this->assertTrue(self::$DI['client']->getResponse()->isOk());
|
||||||
|
|
||||||
$newItem1 = self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\FeedItem')->find($item1->getId());
|
$newItem1 = self::$DI['app']['EM']->getRepository('Phraseanet:FeedItem')->find($item1->getId());
|
||||||
$newItem2 = self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\FeedItem')->find($item2->getId());
|
$newItem2 = self::$DI['app']['EM']->getRepository('Phraseanet:FeedItem')->find($item2->getId());
|
||||||
|
|
||||||
$this->assertEquals($ord1, (int) $newItem2->getOrd());
|
$this->assertEquals($ord1, (int) $newItem2->getOrd());
|
||||||
$this->assertEquals($ord2, (int) $newItem1->getOrd());
|
$this->assertEquals($ord2, (int) $newItem1->getOrd());
|
||||||
@@ -291,7 +291,7 @@ class FeedTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testDelete()
|
public function testDelete()
|
||||||
{
|
{
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 1);
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 1);
|
||||||
$entry = $feed->getEntries()->first();
|
$entry = $feed->getEntries()->first();
|
||||||
|
|
||||||
self::$DI['client']->request('POST', '/prod/feeds/entry/' . $entry->getId() . '/delete/');
|
self::$DI['client']->request('POST', '/prod/feeds/entry/' . $entry->getId() . '/delete/');
|
||||||
@@ -306,7 +306,7 @@ class FeedTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
$this->assertTrue(is_string($pageContent->message));
|
$this->assertTrue(is_string($pageContent->message));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
self::$DI["app"]['EM']->getRepository('Alchemy\Phrasea\Model\Entities\FeedEntry')->find($entry->getId());
|
self::$DI["app"]['EM']->getRepository('Phraseanet:FeedEntry')->find($entry->getId());
|
||||||
$this->fail("Failed to delete entry");
|
$this->fail("Failed to delete entry");
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
|
||||||
@@ -321,7 +321,7 @@ class FeedTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testDeleteUnauthorized()
|
public function testDeleteUnauthorized()
|
||||||
{
|
{
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 3);
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 3);
|
||||||
$entry = $feed->getEntries()->first();
|
$entry = $feed->getEntries()->first();
|
||||||
|
|
||||||
self::$DI['client']->request('POST', '/prod/feeds/entry/' . $entry->getId() . '/delete/');
|
self::$DI['client']->request('POST', '/prod/feeds/entry/' . $entry->getId() . '/delete/');
|
||||||
@@ -332,7 +332,7 @@ class FeedTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
{
|
{
|
||||||
$crawler = self::$DI['client']->request('GET', '/prod/feeds/');
|
$crawler = self::$DI['client']->request('GET', '/prod/feeds/');
|
||||||
$this->assertTrue(self::$DI['client']->getResponse()->isOk());
|
$this->assertTrue(self::$DI['client']->getResponse()->isOk());
|
||||||
$feeds = self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Feed')->getAllForUser(self::$DI['app']['acl']->get(self::$DI['user']));
|
$feeds = self::$DI['app']['EM']->getRepository('Phraseanet:Feed')->getAllForUser(self::$DI['app']['acl']->get(self::$DI['user']));
|
||||||
|
|
||||||
foreach ($feeds as $one_feed) {
|
foreach ($feeds as $one_feed) {
|
||||||
$path = CssSelector::toXPath("ul.submenu a[href='/prod/feeds/feed/" . $one_feed->getId() . "/']");
|
$path = CssSelector::toXPath("ul.submenu a[href='/prod/feeds/feed/" . $one_feed->getId() . "/']");
|
||||||
@@ -348,8 +348,8 @@ class FeedTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testGetFeed()
|
public function testGetFeed()
|
||||||
{
|
{
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 1);
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 1);
|
||||||
$feeds = self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Feed')->getAllForUser(self::$DI['app']['acl']->get(self::$DI['user']));
|
$feeds = self::$DI['app']['EM']->getRepository('Phraseanet:Feed')->getAllForUser(self::$DI['app']['acl']->get(self::$DI['user']));
|
||||||
$crawler = self::$DI['client']->request('GET', '/prod/feeds/feed/' . $feed->getId() . "/");
|
$crawler = self::$DI['client']->request('GET', '/prod/feeds/feed/' . $feed->getId() . "/");
|
||||||
|
|
||||||
foreach ($feeds as $one_feed) {
|
foreach ($feeds as $one_feed) {
|
||||||
@@ -398,7 +398,7 @@ class FeedTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testSuscribe()
|
public function testSuscribe()
|
||||||
{
|
{
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 1);
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 1);
|
||||||
|
|
||||||
self::$DI['app']['feed.user-link-generator'] = $this->getMockBuilder('Alchemy\Phrasea\Feed\Link\FeedLinkGenerator')
|
self::$DI['app']['feed.user-link-generator'] = $this->getMockBuilder('Alchemy\Phrasea\Feed\Link\FeedLinkGenerator')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
|
@@ -57,7 +57,7 @@ class LazaretTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
$em->expects($this->once())
|
$em->expects($this->once())
|
||||||
->method('getRepository')
|
->method('getRepository')
|
||||||
->with($this->EqualTo('Alchemy\Phrasea\Model\Entities\LazaretFile'))
|
->with($this->equalTo('Phraseanet:LazaretFile'))
|
||||||
->will($this->returnValue($repo));
|
->will($this->returnValue($repo));
|
||||||
|
|
||||||
$route = '/prod/lazaret/';
|
$route = '/prod/lazaret/';
|
||||||
@@ -94,7 +94,7 @@ class LazaretTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
$em->expects($this->any())
|
$em->expects($this->any())
|
||||||
->method('find')
|
->method('find')
|
||||||
->with($this->EqualTo('Alchemy\Phrasea\Model\Entities\LazaretFile'), $this->EqualTo($id))
|
->with($this->equalTo('Phraseanet:LazaretFile'), $this->equalTo($id))
|
||||||
->will($this->returnValue($lazaretFile));
|
->will($this->returnValue($lazaretFile));
|
||||||
|
|
||||||
self::$DI['app']['EM'] = $em;
|
self::$DI['app']['EM'] = $em;
|
||||||
@@ -138,7 +138,7 @@ class LazaretTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
$em->expects($this->any())
|
$em->expects($this->any())
|
||||||
->method('find')
|
->method('find')
|
||||||
->with($this->EqualTo('Alchemy\Phrasea\Model\Entities\LazaretFile'), $this->EqualTo($id))
|
->with($this->equalTo('Phraseanet:LazaretFile'), $this->equalTo($id))
|
||||||
->will($this->returnValue(null));
|
->will($this->returnValue(null));
|
||||||
|
|
||||||
self::$DI['app']['EM'] = $em;
|
self::$DI['app']['EM'] = $em;
|
||||||
@@ -208,13 +208,13 @@ class LazaretTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
//Expect the retrieval of the lazaret file with the provided id
|
//Expect the retrieval of the lazaret file with the provided id
|
||||||
$em->expects($this->any())
|
$em->expects($this->any())
|
||||||
->method('find')
|
->method('find')
|
||||||
->with($this->EqualTo('Alchemy\Phrasea\Model\Entities\LazaretFile'), $this->EqualTo($id))
|
->with($this->equalTo('Phraseanet:LazaretFile'), $this->equalTo($id))
|
||||||
->will($this->returnValue($lazaretFile));
|
->will($this->returnValue($lazaretFile));
|
||||||
|
|
||||||
//In any case we expect the deletion of the lazaret file
|
//In any case we expect the deletion of the lazaret file
|
||||||
$em->expects($this->once())
|
$em->expects($this->once())
|
||||||
->method('remove')
|
->method('remove')
|
||||||
->with($this->EqualTo($lazaretFile));
|
->with($this->equalTo($lazaretFile));
|
||||||
|
|
||||||
//Then flush
|
//Then flush
|
||||||
$em->expects($this->once())
|
$em->expects($this->once())
|
||||||
@@ -259,7 +259,7 @@ class LazaretTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
//Expect the retrieval of the lazaret file with the provided id
|
//Expect the retrieval of the lazaret file with the provided id
|
||||||
$em->expects($this->any())
|
$em->expects($this->any())
|
||||||
->method('find')
|
->method('find')
|
||||||
->with($this->EqualTo('Alchemy\Phrasea\Model\Entities\LazaretFile'), $this->EqualTo($id))
|
->with($this->equalTo('Phraseanet:LazaretFile'), $this->equalTo($id))
|
||||||
->will($this->returnValue($lazaretFile));
|
->will($this->returnValue($lazaretFile));
|
||||||
|
|
||||||
self::$DI['app']['EM'] = $em;
|
self::$DI['app']['EM'] = $em;
|
||||||
@@ -321,7 +321,7 @@ class LazaretTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
$this->assertResponseOk($response);
|
$this->assertResponseOk($response);
|
||||||
$this->assertGoodJsonContent(json_decode($response->getContent()));
|
$this->assertGoodJsonContent(json_decode($response->getContent()));
|
||||||
|
|
||||||
$query = self::$DI['app']['EM']->createQuery('SELECT COUNT(l.id) FROM \Alchemy\Phrasea\Model\Entities\LazaretFile l');
|
$query = self::$DI['app']['EM']->createQuery('SELECT COUNT(l.id) FROM Phraseanet:LazaretFile l');
|
||||||
|
|
||||||
$count = $query->getSingleScalarResult();
|
$count = $query->getSingleScalarResult();
|
||||||
|
|
||||||
@@ -344,7 +344,7 @@ class LazaretTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
$this->assertGoodJsonContent(json_decode($response->getContent()));
|
$this->assertGoodJsonContent(json_decode($response->getContent()));
|
||||||
|
|
||||||
$query = self::$DI['app']['EM']->createQuery(
|
$query = self::$DI['app']['EM']->createQuery(
|
||||||
'SELECT COUNT(l.id) FROM \Alchemy\Phrasea\Model\Entities\LazaretFile l'
|
'SELECT COUNT(l.id) FROM Phraseanet:LazaretFile l'
|
||||||
);
|
);
|
||||||
|
|
||||||
$count = $query->getSingleScalarResult();
|
$count = $query->getSingleScalarResult();
|
||||||
@@ -430,13 +430,13 @@ class LazaretTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
//Expect the retrieval of the lazaret file with the provided id
|
//Expect the retrieval of the lazaret file with the provided id
|
||||||
$em->expects($this->any())
|
$em->expects($this->any())
|
||||||
->method('find')
|
->method('find')
|
||||||
->with($this->EqualTo('Alchemy\Phrasea\Model\Entities\LazaretFile'), $this->EqualTo($id))
|
->with($this->equalTo('Phraseanet:LazaretFile'), $this->equalTo($id))
|
||||||
->will($this->returnValue($lazaretFile));
|
->will($this->returnValue($lazaretFile));
|
||||||
|
|
||||||
//In any case we expect the deletion of the lazaret file
|
//In any case we expect the deletion of the lazaret file
|
||||||
$em->expects($this->once())
|
$em->expects($this->once())
|
||||||
->method('remove')
|
->method('remove')
|
||||||
->with($this->EqualTo($lazaretFile));
|
->with($this->equalTo($lazaretFile));
|
||||||
|
|
||||||
//Then flush
|
//Then flush
|
||||||
$em->expects($this->once())
|
$em->expects($this->once())
|
||||||
@@ -496,7 +496,7 @@ class LazaretTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
//Expect the retrieval of the lazaret file with the provided id
|
//Expect the retrieval of the lazaret file with the provided id
|
||||||
$em->expects($this->any())
|
$em->expects($this->any())
|
||||||
->method('find')
|
->method('find')
|
||||||
->with($this->EqualTo('Alchemy\Phrasea\Model\Entities\LazaretFile'), $this->EqualTo($id))
|
->with($this->equalTo('Phraseanet:LazaretFile'), $this->equalTo($id))
|
||||||
->will($this->returnValue($lazaretFile));
|
->will($this->returnValue($lazaretFile));
|
||||||
|
|
||||||
$id = 1;
|
$id = 1;
|
||||||
@@ -551,7 +551,7 @@ class LazaretTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
//Expect the retrieval of the lazaret file with the provided id
|
//Expect the retrieval of the lazaret file with the provided id
|
||||||
$em->expects($this->any())
|
$em->expects($this->any())
|
||||||
->method('find')
|
->method('find')
|
||||||
->with($this->EqualTo('Alchemy\Phrasea\Model\Entities\LazaretFile'), $this->EqualTo($id))
|
->with($this->equalTo('Phraseanet:LazaretFile'), $this->equalTo($id))
|
||||||
->will($this->returnValue($lazaretFile));
|
->will($this->returnValue($lazaretFile));
|
||||||
|
|
||||||
self::$DI['app']['EM'] = $em;
|
self::$DI['app']['EM'] = $em;
|
||||||
@@ -598,7 +598,7 @@ class LazaretTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
//Expect the retrieval of the lazaret file with the provided id
|
//Expect the retrieval of the lazaret file with the provided id
|
||||||
$em->expects($this->any())
|
$em->expects($this->any())
|
||||||
->method('find')
|
->method('find')
|
||||||
->with($this->EqualTo('Alchemy\Phrasea\Model\Entities\LazaretFile'), $this->EqualTo($id))
|
->with($this->equalTo('Phraseanet:LazaretFile'), $this->equalTo($id))
|
||||||
->will($this->returnValue($lazaretFile));
|
->will($this->returnValue($lazaretFile));
|
||||||
|
|
||||||
self::$DI['app']['EM'] = $em;
|
self::$DI['app']['EM'] = $em;
|
||||||
|
@@ -197,7 +197,7 @@ class OrderTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
}
|
}
|
||||||
self::$DI['client']->request('POST', '/prod/order/' . $order->getId() . '/send/', ['elements' => $parameters]);
|
self::$DI['client']->request('POST', '/prod/order/' . $order->getId() . '/send/', ['elements' => $parameters]);
|
||||||
|
|
||||||
$testOrder = self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Order')->find($order->getId());
|
$testOrder = self::$DI['app']['EM']->getRepository('Phraseanet:Order')->find($order->getId());
|
||||||
$this->assertEquals(0, $testOrder->getTodo());
|
$this->assertEquals(0, $testOrder->getTodo());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -218,13 +218,13 @@ class OrderTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
$parameters = [$order->getElements()->first()->getId()];
|
$parameters = [$order->getElements()->first()->getId()];
|
||||||
self::$DI['client']->request('POST', '/prod/order/' . $order->getId() . '/send/', ['elements' => $parameters]);
|
self::$DI['client']->request('POST', '/prod/order/' . $order->getId() . '/send/', ['elements' => $parameters]);
|
||||||
$testOrder = self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Order')->find($order->getId());
|
$testOrder = self::$DI['app']['EM']->getRepository('Phraseanet:Order')->find($order->getId());
|
||||||
$this->assertEquals(1, $testOrder->getTodo());
|
$this->assertEquals(1, $testOrder->getTodo());
|
||||||
|
|
||||||
$parameters = [$orderElement->getId()];
|
$parameters = [$orderElement->getId()];
|
||||||
self::$DI['client']->request('POST', '/prod/order/' . $order->getId() . '/deny/', ['elements' => $parameters]);
|
self::$DI['client']->request('POST', '/prod/order/' . $order->getId() . '/deny/', ['elements' => $parameters]);
|
||||||
|
|
||||||
$testOrder = self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Order')->find($order->getId());
|
$testOrder = self::$DI['app']['EM']->getRepository('Phraseanet:Order')->find($order->getId());
|
||||||
$this->assertEquals(0, $testOrder->getTodo());
|
$this->assertEquals(0, $testOrder->getTodo());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -190,7 +190,7 @@ class RecordsTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
public function testGetRecordDetailBasket()
|
public function testGetRecordDetailBasket()
|
||||||
{
|
{
|
||||||
$this->authenticate(self::$DI['app']);
|
$this->authenticate(self::$DI['app']);
|
||||||
$basket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 1);
|
$basket = self::$DI['app']['EM']->find('Phraseanet:Basket', 1);
|
||||||
|
|
||||||
$this->XMLHTTPRequest('POST', '/prod/records/', [
|
$this->XMLHTTPRequest('POST', '/prod/records/', [
|
||||||
'env' => 'BASK',
|
'env' => 'BASK',
|
||||||
@@ -226,7 +226,7 @@ class RecordsTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 1);
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 1);
|
||||||
$feedEntry = $feed->getEntries()->first();
|
$feedEntry = $feed->getEntries()->first();
|
||||||
|
|
||||||
$this->XMLHTTPRequest('POST', '/prod/records/', [
|
$this->XMLHTTPRequest('POST', '/prod/records/', [
|
||||||
|
@@ -27,7 +27,7 @@ class StoryTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
$this->assertEquals(302, $response->getStatusCode());
|
$this->assertEquals(302, $response->getStatusCode());
|
||||||
|
|
||||||
$query = self::$DI['app']['EM']->createQuery(
|
$query = self::$DI['app']['EM']->createQuery(
|
||||||
'SELECT COUNT(w.id) FROM \Alchemy\Phrasea\Model\Entities\StoryWZ w'
|
'SELECT COUNT(w.id) FROM Phraseanet:StoryWZ w'
|
||||||
);
|
);
|
||||||
|
|
||||||
$count = $query->getSingleScalarResult();
|
$count = $query->getSingleScalarResult();
|
||||||
|
@@ -84,7 +84,7 @@ class UsrListsTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testGetList()
|
public function testGetList()
|
||||||
{
|
{
|
||||||
$entry = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\UsrListEntry', 2);
|
$entry = self::$DI['app']['EM']->find('Phraseanet:UsrListEntry', 2);
|
||||||
$list_id = $entry->getList()->getId();
|
$list_id = $entry->getList()->getId();
|
||||||
|
|
||||||
$route = '/prod/lists/list/' . $list_id . '/';
|
$route = '/prod/lists/list/' . $list_id . '/';
|
||||||
@@ -104,7 +104,7 @@ class UsrListsTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testPostUpdate()
|
public function testPostUpdate()
|
||||||
{
|
{
|
||||||
$entry = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\UsrListEntry', 2);
|
$entry = self::$DI['app']['EM']->find('Phraseanet:UsrListEntry', 2);
|
||||||
$list_id = $entry->getList()->getId();
|
$list_id = $entry->getList()->getId();
|
||||||
|
|
||||||
$route = '/prod/lists/list/' . $list_id . '/update/';
|
$route = '/prod/lists/list/' . $list_id . '/update/';
|
||||||
@@ -140,7 +140,7 @@ class UsrListsTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testPostDelete()
|
public function testPostDelete()
|
||||||
{
|
{
|
||||||
$entry = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\UsrListEntry', 2);
|
$entry = self::$DI['app']['EM']->find('Phraseanet:UsrListEntry', 2);
|
||||||
$list_id = $entry->getList()->getId();
|
$list_id = $entry->getList()->getId();
|
||||||
|
|
||||||
$route = '/prod/lists/list/' . $list_id . '/delete/';
|
$route = '/prod/lists/list/' . $list_id . '/delete/';
|
||||||
@@ -159,14 +159,14 @@ class UsrListsTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
$this->assertTrue($datas['success']);
|
$this->assertTrue($datas['success']);
|
||||||
|
|
||||||
$repository = self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\UsrList');
|
$repository = self::$DI['app']['EM']->getRepository('Phraseanet:UsrList');
|
||||||
|
|
||||||
$this->assertNull($repository->find($list_id));
|
$this->assertNull($repository->find($list_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testPostRemoveEntry()
|
public function testPostRemoveEntry()
|
||||||
{
|
{
|
||||||
$entry = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\UsrListEntry', 2);
|
$entry = self::$DI['app']['EM']->find('Phraseanet:UsrListEntry', 2);
|
||||||
$list_id = $entry->getList()->getId();
|
$list_id = $entry->getList()->getId();
|
||||||
$usr_id = $entry->getUser(self::$DI['app'])->get_id();
|
$usr_id = $entry->getUser(self::$DI['app'])->get_id();
|
||||||
$entry_id = $entry->getId();
|
$entry_id = $entry->getId();
|
||||||
@@ -187,14 +187,14 @@ class UsrListsTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
$this->assertTrue($datas['success']);
|
$this->assertTrue($datas['success']);
|
||||||
|
|
||||||
$repository = self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\UsrListEntry');
|
$repository = self::$DI['app']['EM']->getRepository('Phraseanet:UsrListEntry');
|
||||||
|
|
||||||
$this->assertNull($repository->find($entry_id));
|
$this->assertNull($repository->find($entry_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testPostAddEntry()
|
public function testPostAddEntry()
|
||||||
{
|
{
|
||||||
$list = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\UsrList', 1);
|
$list = self::$DI['app']['EM']->find('Phraseanet:UsrList', 1);
|
||||||
|
|
||||||
$this->assertEquals(2, $list->getEntries()->count());
|
$this->assertEquals(2, $list->getEntries()->count());
|
||||||
|
|
||||||
@@ -218,7 +218,7 @@ class UsrListsTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testPostShareList()
|
public function testPostShareList()
|
||||||
{
|
{
|
||||||
$list = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\UsrList', 1);
|
$list = self::$DI['app']['EM']->find('Phraseanet:UsrList', 1);
|
||||||
|
|
||||||
$this->assertEquals(1, $list->getOwners()->count());
|
$this->assertEquals(1, $list->getOwners()->count());
|
||||||
|
|
||||||
@@ -256,7 +256,7 @@ class UsrListsTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
$this->assertTrue($datas['success']);
|
$this->assertTrue($datas['success']);
|
||||||
|
|
||||||
$repository = self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\UsrList');
|
$repository = self::$DI['app']['EM']->getRepository('Phraseanet:UsrList');
|
||||||
|
|
||||||
$list = $repository->find($list->getId());
|
$list = $repository->find($list->getId());
|
||||||
|
|
||||||
@@ -265,7 +265,7 @@ class UsrListsTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testPostUnShareList()
|
public function testPostUnShareList()
|
||||||
{
|
{
|
||||||
$list = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\UsrList', 1);
|
$list = self::$DI['app']['EM']->find('Phraseanet:UsrList', 1);
|
||||||
|
|
||||||
$this->assertEquals(1, $list->getOwners()->count());
|
$this->assertEquals(1, $list->getOwners()->count());
|
||||||
|
|
||||||
@@ -285,7 +285,7 @@ class UsrListsTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
$this->assertTrue($datas['success']);
|
$this->assertTrue($datas['success']);
|
||||||
|
|
||||||
$repository = self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\UsrList');
|
$repository = self::$DI['app']['EM']->getRepository('Phraseanet:UsrList');
|
||||||
|
|
||||||
$list = $repository->find($list->getId());
|
$list = $repository->find($list->getId());
|
||||||
|
|
||||||
@@ -304,7 +304,7 @@ class UsrListsTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
$this->assertTrue($datas['success']);
|
$this->assertTrue($datas['success']);
|
||||||
|
|
||||||
$repository = self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\UsrList');
|
$repository = self::$DI['app']['EM']->getRepository('Phraseanet:UsrList');
|
||||||
|
|
||||||
$list = $repository->find($list->getId());
|
$list = $repository->find($list->getId());
|
||||||
|
|
||||||
@@ -315,7 +315,7 @@ class UsrListsTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
public function testPostUnShareFail()
|
public function testPostUnShareFail()
|
||||||
{
|
{
|
||||||
$list = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\UsrList', 1);
|
$list = self::$DI['app']['EM']->find('Phraseanet:UsrList', 1);
|
||||||
|
|
||||||
$this->assertEquals(1, $list->getOwners()->count());
|
$this->assertEquals(1, $list->getOwners()->count());
|
||||||
|
|
||||||
@@ -367,7 +367,7 @@ class UsrListsTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
$this->assertTrue($datas['success']);
|
$this->assertTrue($datas['success']);
|
||||||
|
|
||||||
$repository = self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\UsrList');
|
$repository = self::$DI['app']['EM']->getRepository('Phraseanet:UsrList');
|
||||||
|
|
||||||
$list = $repository->find($list->getId());
|
$list = $repository->find($list->getId());
|
||||||
|
|
||||||
|
@@ -40,7 +40,7 @@ class WorkZoneTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
$em = self::$DI['app']['EM'];
|
$em = self::$DI['app']['EM'];
|
||||||
/* @var $em \Doctrine\ORM\EntityManager */
|
/* @var $em \Doctrine\ORM\EntityManager */
|
||||||
$query = $em->createQuery('SELECT COUNT(w.id) FROM \Alchemy\Phrasea\Model\Entities\StoryWZ w');
|
$query = $em->createQuery('SELECT COUNT(w.id) FROM Phraseanet:StoryWZ w');
|
||||||
|
|
||||||
$count = $query->getSingleScalarResult();
|
$count = $query->getSingleScalarResult();
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ class WorkZoneTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
$em = self::$DI['app']['EM'];
|
$em = self::$DI['app']['EM'];
|
||||||
/* @var $em \Doctrine\ORM\EntityManager */
|
/* @var $em \Doctrine\ORM\EntityManager */
|
||||||
$query = $em->createQuery('SELECT COUNT(w.id) FROM \Alchemy\Phrasea\Model\Entities\StoryWZ w');
|
$query = $em->createQuery('SELECT COUNT(w.id) FROM Phraseanet:StoryWZ w');
|
||||||
$count = $query->getSingleScalarResult();
|
$count = $query->getSingleScalarResult();
|
||||||
|
|
||||||
$this->assertEquals(2, $count);
|
$this->assertEquals(2, $count);
|
||||||
@@ -73,7 +73,7 @@ class WorkZoneTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
$story = self::$DI['record_story_2'];
|
$story = self::$DI['record_story_2'];
|
||||||
$route = sprintf("/prod/WorkZone/attachStories/");
|
$route = sprintf("/prod/WorkZone/attachStories/");
|
||||||
|
|
||||||
$storyWZ = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\StoryWZ', 1);
|
$storyWZ = self::$DI['app']['EM']->find('Phraseanet:StoryWZ', 1);
|
||||||
|
|
||||||
self::$DI['client']->request('POST', $route, ['stories' => [$story->get_serialize_key()]]);
|
self::$DI['client']->request('POST', $route, ['stories' => [$story->get_serialize_key()]]);
|
||||||
$response = self::$DI['client']->getResponse();
|
$response = self::$DI['client']->getResponse();
|
||||||
@@ -83,7 +83,7 @@ class WorkZoneTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
$em = self::$DI['app']['EM'];
|
$em = self::$DI['app']['EM'];
|
||||||
/* @var $em \Doctrine\ORM\EntityManager */
|
/* @var $em \Doctrine\ORM\EntityManager */
|
||||||
$query = $em->createQuery(
|
$query = $em->createQuery(
|
||||||
'SELECT COUNT(w.id) FROM \Alchemy\Phrasea\Model\Entities\StoryWZ w'
|
'SELECT COUNT(w.id) FROM Phraseanet:StoryWZ w'
|
||||||
);
|
);
|
||||||
|
|
||||||
$count = $query->getSingleScalarResult();
|
$count = $query->getSingleScalarResult();
|
||||||
@@ -131,7 +131,7 @@ class WorkZoneTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
self::$DI['client']->request('POST', $attachRoute, ['stories' => [$story->get_serialize_key()]]);
|
self::$DI['client']->request('POST', $attachRoute, ['stories' => [$story->get_serialize_key()]]);
|
||||||
|
|
||||||
$query = self::$DI['app']['EM']->createQuery(
|
$query = self::$DI['app']['EM']->createQuery(
|
||||||
'SELECT COUNT(w.id) FROM \Alchemy\Phrasea\Model\Entities\StoryWZ w'
|
'SELECT COUNT(w.id) FROM Phraseanet:StoryWZ w'
|
||||||
);
|
);
|
||||||
|
|
||||||
$count = $query->getSingleScalarResult();
|
$count = $query->getSingleScalarResult();
|
||||||
@@ -144,7 +144,7 @@ class WorkZoneTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
$this->assertEquals(302, $response->getStatusCode());
|
$this->assertEquals(302, $response->getStatusCode());
|
||||||
|
|
||||||
$query = self::$DI['app']['EM']->createQuery(
|
$query = self::$DI['app']['EM']->createQuery(
|
||||||
'SELECT COUNT(w.id) FROM \Alchemy\Phrasea\Model\Entities\StoryWZ w'
|
'SELECT COUNT(w.id) FROM Phraseanet:StoryWZ w'
|
||||||
);
|
);
|
||||||
|
|
||||||
$count = $query->getSingleScalarResult();
|
$count = $query->getSingleScalarResult();
|
||||||
|
@@ -158,7 +158,7 @@ class RecordsRequestTest extends \PhraseanetAuthenticatedTestCase
|
|||||||
|
|
||||||
public function testSimpleBasket()
|
public function testSimpleBasket()
|
||||||
{
|
{
|
||||||
$basketElement = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\BasketElement', 1);
|
$basketElement = self::$DI['app']['EM']->find('Phraseanet:BasketElement', 1);
|
||||||
$request = new Request(['ssel' => $basketElement->getBasket()->getId()]);
|
$request = new Request(['ssel' => $basketElement->getBasket()->getId()]);
|
||||||
|
|
||||||
$records = RecordsRequest::fromRequest(self::$DI['app'], $request);
|
$records = RecordsRequest::fromRequest(self::$DI['app'], $request);
|
||||||
@@ -240,6 +240,6 @@ class RecordsRequestTest extends \PhraseanetAuthenticatedTestCase
|
|||||||
|
|
||||||
private function getStoryWZ()
|
private function getStoryWZ()
|
||||||
{
|
{
|
||||||
return self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\StoryWZ', 1);
|
return self::$DI['app']['EM']->find('Phraseanet:StoryWZ', 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1017,7 +1017,7 @@ class LoginTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
$user = new \User_Adapter((int) $userId, self::$DI['app']);
|
$user = new \User_Adapter((int) $userId, self::$DI['app']);
|
||||||
|
|
||||||
$ret = self::$DI['app']['EM']->getRepository('\Alchemy\Phrasea\Model\Entities\UsrAuthProvider')
|
$ret = self::$DI['app']['EM']->getRepository('Phraseanet:UsrAuthProvider')
|
||||||
->findBy(['usr_id' => $userId, 'provider' => 'provider-test']);
|
->findBy(['usr_id' => $userId, 'provider' => 'provider-test']);
|
||||||
$this->assertCount(1, $ret);
|
$this->assertCount(1, $ret);
|
||||||
|
|
||||||
@@ -1520,7 +1520,7 @@ class LoginTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
$this->assertSame(302, self::$DI['client']->getResponse()->getStatusCode());
|
$this->assertSame(302, self::$DI['client']->getResponse()->getStatusCode());
|
||||||
|
|
||||||
$ret = self::$DI['app']['EM']->getRepository('\Alchemy\Phrasea\Model\Entities\UsrAuthProvider')
|
$ret = self::$DI['app']['EM']->getRepository('Phraseanet:UsrAuthProvider')
|
||||||
->findBy(['usr_id' => self::$DI['user']->get_id(), 'provider' => 'provider-test']);
|
->findBy(['usr_id' => self::$DI['user']->get_id(), 'provider' => 'provider-test']);
|
||||||
|
|
||||||
$this->assertCount(1, $ret);
|
$this->assertCount(1, $ret);
|
||||||
@@ -1595,7 +1595,7 @@ class LoginTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
$this->assertSame(302, self::$DI['client']->getResponse()->getStatusCode());
|
$this->assertSame(302, self::$DI['client']->getResponse()->getStatusCode());
|
||||||
|
|
||||||
$ret = self::$DI['app']['EM']->getRepository('\Alchemy\Phrasea\Model\Entities\UsrAuthProvider')
|
$ret = self::$DI['app']['EM']->getRepository('Phraseanet:UsrAuthProvider')
|
||||||
->findBy(['usr_id' => $createdUser->get_id(), 'provider' => 'provider-test']);
|
->findBy(['usr_id' => $createdUser->get_id(), 'provider' => 'provider-test']);
|
||||||
|
|
||||||
$this->assertCount(1, $ret);
|
$this->assertCount(1, $ret);
|
||||||
@@ -1760,7 +1760,7 @@ class LoginTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
self::$DI['app']['EM']->expects($this->at(0))
|
self::$DI['app']['EM']->expects($this->at(0))
|
||||||
->method('getRepository')
|
->method('getRepository')
|
||||||
->with('Alchemy\Phrasea\Model\Entities\UsrAuthProvider')
|
->with('Phraseanet:UsrAuthProvider')
|
||||||
->will($this->returnValue($repo));
|
->will($this->returnValue($repo));
|
||||||
|
|
||||||
if ($participants) {
|
if ($participants) {
|
||||||
@@ -1774,7 +1774,7 @@ class LoginTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
|
|
||||||
self::$DI['app']['EM']->expects($this->at(1))
|
self::$DI['app']['EM']->expects($this->at(1))
|
||||||
->method('getRepository')
|
->method('getRepository')
|
||||||
->with('Alchemy\Phrasea\Model\Entities\ValidationParticipant')
|
->with('Phraseanet:ValidationParticipant')
|
||||||
->will($this->returnValue($repo));
|
->will($this->returnValue($repo));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -14,7 +14,7 @@ class RSSFeedTest extends \PhraseanetWebTestCase
|
|||||||
{
|
{
|
||||||
public function testPublicFeedAggregated()
|
public function testPublicFeedAggregated()
|
||||||
{
|
{
|
||||||
self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 2);
|
self::$DI['app']['EM']->find('Phraseanet:Feed', 2);
|
||||||
|
|
||||||
self::$DI['client']->request('GET', '/feeds/aggregated/atom/');
|
self::$DI['client']->request('GET', '/feeds/aggregated/atom/');
|
||||||
$response = self::$DI['client']->getResponse();
|
$response = self::$DI['client']->getResponse();
|
||||||
@@ -59,7 +59,7 @@ class RSSFeedTest extends \PhraseanetWebTestCase
|
|||||||
public function testPublicFeed()
|
public function testPublicFeed()
|
||||||
{
|
{
|
||||||
$this->authenticate(self::$DI['app']);
|
$this->authenticate(self::$DI['app']);
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 2);
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 2);
|
||||||
|
|
||||||
self::$DI['client']->request('GET', "/feeds/feed/" . $feed->getId() . "/atom/");
|
self::$DI['client']->request('GET', "/feeds/feed/" . $feed->getId() . "/atom/");
|
||||||
$response = self::$DI['client']->getResponse();
|
$response = self::$DI['client']->getResponse();
|
||||||
@@ -72,7 +72,7 @@ class RSSFeedTest extends \PhraseanetWebTestCase
|
|||||||
|
|
||||||
public function testUserFeedAggregated()
|
public function testUserFeedAggregated()
|
||||||
{
|
{
|
||||||
$token = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\AggregateToken', 1);
|
$token = self::$DI['app']['EM']->find('Phraseanet:AggregateToken', 1);
|
||||||
$tokenValue = $token->getValue();
|
$tokenValue = $token->getValue();
|
||||||
|
|
||||||
$this->logout(self::$DI['app']);
|
$this->logout(self::$DI['app']);
|
||||||
@@ -88,7 +88,7 @@ class RSSFeedTest extends \PhraseanetWebTestCase
|
|||||||
|
|
||||||
public function testUserFeed()
|
public function testUserFeed()
|
||||||
{
|
{
|
||||||
$token = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\FeedToken', 1);
|
$token = self::$DI['app']['EM']->find('Phraseanet:FeedToken', 1);
|
||||||
$tokenValue = $token->getValue();
|
$tokenValue = $token->getValue();
|
||||||
$this->logout(self::$DI['app']);
|
$this->logout(self::$DI['app']);
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@ class RSSFeedTest extends \PhraseanetWebTestCase
|
|||||||
|
|
||||||
public function testGetFeedFormat()
|
public function testGetFeedFormat()
|
||||||
{
|
{
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 2);
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 2);
|
||||||
self::$DI['client']->request("GET", "/feeds/feed/" . $feed->getId() . "/rss/");
|
self::$DI['client']->request("GET", "/feeds/feed/" . $feed->getId() . "/rss/");
|
||||||
|
|
||||||
$this->assertEquals("application/rss+xml", self::$DI['client']->getResponse()->headers->get("content-type"));
|
$this->assertEquals("application/rss+xml", self::$DI['client']->getResponse()->headers->get("content-type"));
|
||||||
@@ -121,7 +121,7 @@ class RSSFeedTest extends \PhraseanetWebTestCase
|
|||||||
|
|
||||||
public function testCooliris()
|
public function testCooliris()
|
||||||
{
|
{
|
||||||
self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 2);
|
self::$DI['app']['EM']->find('Phraseanet:Feed', 2);
|
||||||
|
|
||||||
self::$DI['client']->request("GET", "/feeds/cooliris/");
|
self::$DI['client']->request("GET", "/feeds/cooliris/");
|
||||||
$this->assertTrue(self::$DI['client']->getResponse()->isOk());
|
$this->assertTrue(self::$DI['client']->getResponse()->isOk());
|
||||||
@@ -132,7 +132,7 @@ class RSSFeedTest extends \PhraseanetWebTestCase
|
|||||||
|
|
||||||
public function testAggregatedRss()
|
public function testAggregatedRss()
|
||||||
{
|
{
|
||||||
$all_feeds = self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Feed')->findBy(['public' => true], ['updatedOn' => 'DESC']);
|
$all_feeds = self::$DI['app']['EM']->getRepository('Phraseanet:Feed')->findBy(['public' => true], ['updatedOn' => 'DESC']);
|
||||||
|
|
||||||
foreach ($all_feeds as $feed) {
|
foreach ($all_feeds as $feed) {
|
||||||
$this->assertTrue($feed->isPublic());
|
$this->assertTrue($feed->isPublic());
|
||||||
@@ -146,7 +146,7 @@ class RSSFeedTest extends \PhraseanetWebTestCase
|
|||||||
|
|
||||||
public function testAggregatedAtom()
|
public function testAggregatedAtom()
|
||||||
{
|
{
|
||||||
$all_feeds = self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Feed')->findBy(['public' => true], ['updatedOn' => 'DESC']);
|
$all_feeds = self::$DI['app']['EM']->getRepository('Phraseanet:Feed')->findBy(['public' => true], ['updatedOn' => 'DESC']);
|
||||||
|
|
||||||
foreach ($all_feeds as $feed) {
|
foreach ($all_feeds as $feed) {
|
||||||
$this->assertTrue($feed->isPublic());
|
$this->assertTrue($feed->isPublic());
|
||||||
@@ -173,7 +173,7 @@ class RSSFeedTest extends \PhraseanetWebTestCase
|
|||||||
|
|
||||||
public function testGetFeedId()
|
public function testGetFeedId()
|
||||||
{
|
{
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 2);
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 2);
|
||||||
|
|
||||||
self::$DI['client']->request("GET", "/feeds/feed/" . $feed->getId() . "/rss/");
|
self::$DI['client']->request("GET", "/feeds/feed/" . $feed->getId() . "/rss/");
|
||||||
$this->assertTrue(self::$DI['client']->getResponse()->isOk());
|
$this->assertTrue(self::$DI['client']->getResponse()->isOk());
|
||||||
@@ -189,7 +189,7 @@ class RSSFeedTest extends \PhraseanetWebTestCase
|
|||||||
|
|
||||||
public function testPrivateFeedAccess()
|
public function testPrivateFeedAccess()
|
||||||
{
|
{
|
||||||
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 1);
|
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 1);
|
||||||
self::$DI['client']->request("GET", "/feeds/feed/" . $feed->getId() . "/rss/");
|
self::$DI['client']->request("GET", "/feeds/feed/" . $feed->getId() . "/rss/");
|
||||||
$this->assertFalse(self::$DI['client']->getResponse()->isOk());
|
$this->assertFalse(self::$DI['client']->getResponse()->isOk());
|
||||||
$this->assertEquals(403, self::$DI['client']->getResponse()->getStatusCode());
|
$this->assertEquals(403, self::$DI['client']->getResponse()->getStatusCode());
|
||||||
|
@@ -39,7 +39,7 @@ class BasketMiddlewareProviderTest extends MiddlewareProviderTestCase
|
|||||||
$this->authenticate(self::$DI['app']);
|
$this->authenticate(self::$DI['app']);
|
||||||
self::$DI['app']->register(new BasketMiddlewareProvider());
|
self::$DI['app']->register(new BasketMiddlewareProvider());
|
||||||
$request = new Request();
|
$request = new Request();
|
||||||
$basket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 1);
|
$basket = self::$DI['app']['EM']->find('Phraseanet:Basket', 1);
|
||||||
$request->attributes->set('basket', $basket->getId());
|
$request->attributes->set('basket', $basket->getId());
|
||||||
call_user_func(self::$DI['app']['middleware.basket.converter'], $request, self::$DI['app']);
|
call_user_func(self::$DI['app']['middleware.basket.converter'], $request, self::$DI['app']);
|
||||||
$this->assertSame($basket, $request->attributes->get('basket'));
|
$this->assertSame($basket, $request->attributes->get('basket'));
|
||||||
@@ -59,7 +59,7 @@ class BasketMiddlewareProviderTest extends MiddlewareProviderTestCase
|
|||||||
$this->authenticate(self::$DI['app']);
|
$this->authenticate(self::$DI['app']);
|
||||||
self::$DI['app']->register(new BasketMiddlewareProvider());
|
self::$DI['app']->register(new BasketMiddlewareProvider());
|
||||||
$request = new Request();
|
$request = new Request();
|
||||||
$basket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 1);
|
$basket = self::$DI['app']['EM']->find('Phraseanet:Basket', 1);
|
||||||
$request->attributes->set('basket', $basket);
|
$request->attributes->set('basket', $basket);
|
||||||
call_user_func(self::$DI['app']['middleware.basket.user-access'], $request, self::$DI['app']);
|
call_user_func(self::$DI['app']['middleware.basket.user-access'], $request, self::$DI['app']);
|
||||||
}
|
}
|
||||||
@@ -69,7 +69,7 @@ class BasketMiddlewareProviderTest extends MiddlewareProviderTestCase
|
|||||||
$this->authenticate(self::$DI['app']);
|
$this->authenticate(self::$DI['app']);
|
||||||
self::$DI['app']->register(new BasketMiddlewareProvider());
|
self::$DI['app']->register(new BasketMiddlewareProvider());
|
||||||
$request = new Request();
|
$request = new Request();
|
||||||
$basket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 3);
|
$basket = self::$DI['app']['EM']->find('Phraseanet:Basket', 3);
|
||||||
$request->attributes->set('basket', $basket);
|
$request->attributes->set('basket', $basket);
|
||||||
$this->setExpectedException('Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException', 'Current user does not have access to the basket');
|
$this->setExpectedException('Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException', 'Current user does not have access to the basket');
|
||||||
call_user_func(self::$DI['app']['middleware.basket.user-access'], $request, self::$DI['app']);
|
call_user_func(self::$DI['app']['middleware.basket.user-access'], $request, self::$DI['app']);
|
||||||
|
@@ -12,7 +12,7 @@ class ORMServiceProviderTest extends ServiceProviderTestCase
|
|||||||
return [
|
return [
|
||||||
['Alchemy\Phrasea\Core\Provider\ORMServiceProvider', 'EM', 'Doctrine\\ORM\\EntityManager'],
|
['Alchemy\Phrasea\Core\Provider\ORMServiceProvider', 'EM', 'Doctrine\\ORM\\EntityManager'],
|
||||||
['Alchemy\Phrasea\Core\Provider\ORMServiceProvider', 'EM.sql-logger', 'Alchemy\\Phrasea\\Model\\MonologSQLLogger'],
|
['Alchemy\Phrasea\Core\Provider\ORMServiceProvider', 'EM.sql-logger', 'Alchemy\\Phrasea\\Model\\MonologSQLLogger'],
|
||||||
['Alchemy\Phrasea\Core\Provider\ORMServiceProvider', 'EM.driver', 'Doctrine\\ORM\Mapping\\Driver\\DriverChain'],
|
['Alchemy\Phrasea\Core\Provider\ORMServiceProvider', 'EM.driver', 'Doctrine\\Common\\Persistence\\Mapping\\Driver\\MappingDriverChain'],
|
||||||
['Alchemy\Phrasea\Core\Provider\ORMServiceProvider', 'EM.config', 'Doctrine\\ORM\\Configuration'],
|
['Alchemy\Phrasea\Core\Provider\ORMServiceProvider', 'EM.config', 'Doctrine\\ORM\\Configuration'],
|
||||||
['Alchemy\Phrasea\Core\Provider\ORMServiceProvider', 'EM.events-manager', 'Doctrine\\Common\\EventManager'],
|
['Alchemy\Phrasea\Core\Provider\ORMServiceProvider', 'EM.events-manager', 'Doctrine\\Common\\EventManager'],
|
||||||
];
|
];
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user