Add a namespace to Phraseanet doctrine entities

This commit is contained in:
Romain Neutron
2014-02-18 18:53:38 +01:00
parent 094b3f5c9d
commit 2de870c3f9
120 changed files with 444 additions and 441 deletions

View File

@@ -88,7 +88,7 @@ class Authenticator
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');
}
@@ -120,7 +120,7 @@ class Authenticator
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->flush();
}
@@ -154,7 +154,7 @@ class Authenticator
}
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;
}
}

View File

@@ -38,7 +38,7 @@ class Manager
public function getSession($cookieValue)
{
$session = $this->em
->getRepository('Alchemy\Phrasea\Model\Entities\Session')
->getRepository('Phraseanet:Session')
->findOneBy(['token' => $cookieValue]);
if (!$session) {

View File

@@ -80,7 +80,7 @@ class FailureManager
public function checkFailures($username, Request $request)
{
$failures = $this->em
->getRepository('Alchemy\Phrasea\Model\Entities\AuthFailure')
->getRepository('Phraseanet:AuthFailure')
->findLockedFailuresMatching($username, $request->getClientIp());
if (0 === count($failures)) {
@@ -109,7 +109,7 @@ class FailureManager
private function removeOldFailures()
{
$failures = $this->em
->getRepository('Alchemy\Phrasea\Model\Entities\AuthFailure')
->getRepository('Phraseanet:AuthFailure')
->findOldFailures('-2 months');
if (0 < count($failures)) {

View File

@@ -39,7 +39,7 @@ class ConnectedUsers implements ControllerProviderInterface
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
s.updated > :date
ORDER BY s.updated DESC';

View File

@@ -34,7 +34,7 @@ class Publications implements ControllerProviderInterface
});
$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())
);
@@ -76,7 +76,7 @@ class Publications implements ControllerProviderInterface
})->bind('admin_feeds_create');
$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']
->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");
}
$feed = $app["EM"]->find('Alchemy\Phrasea\Model\Entities\Feed', $id);
$feed = $app["EM"]->find('Phraseanet:Feed', $id);
try {
$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');
})->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())) {
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,
'message' => '',
];
$feed = $app["EM"]->find('Alchemy\Phrasea\Model\Entities\Feed', $id);
$feed = $app["EM"]->find('Phraseanet:Feed', $id);
if (null === $feed) {
$app->abort(404, "Feed not found");
@@ -194,7 +194,7 @@ class Publications implements ControllerProviderInterface
try {
$request = $app['request'];
$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->setUsrId($user->get_id());
@@ -219,9 +219,9 @@ class Publications implements ControllerProviderInterface
try {
$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) {
$app->abort(404, "Feed Publisher not found");
}
@@ -243,7 +243,7 @@ class Publications implements ControllerProviderInterface
->assert('id', '\d+');
$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) {
$app->abort(404);

View File

@@ -61,7 +61,7 @@ class Baskets implements ControllerProviderInterface
public function deleteBasketElement(Application $app, Request $request)
{
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());
$app['EM']->remove($basketElement);
$app['EM']->flush();
@@ -167,7 +167,7 @@ class Baskets implements ControllerProviderInterface
public function getBaskets(Application $app, Request $request)
{
$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;
if ('' === $selectedBasketId && $baskets->count() > 0) {
@@ -202,7 +202,7 @@ class Baskets implements ControllerProviderInterface
public function checkBaskets(Application $app, Request $request)
{
$noview = 0;
$repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Basket');
$repository = $app['EM']->getRepository('Phraseanet:Basket');
/* @var $repository Alchemy\Phrasea\Model\Repositories\BasketRepository */
$baskets = $repository->findActiveByUser($app['authentication']->getUser());

View File

@@ -80,7 +80,7 @@ class Datafiles extends AbstractDelivery
if ($watermark && !$all_access) {
$repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\BasketElement');
$repository = $app['EM']->getRepository('Phraseanet:BasketElement');
/* @var $repository BasketElementRepository */

View File

@@ -76,7 +76,7 @@ class Lightbox implements ControllerProviderInterface
return $app->redirectPath('logout');
}
$repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Basket');
$repository = $app['EM']->getRepository('Phraseanet:Basket');
$basket_collection = array_merge(
$repository->findActiveByUser($app['authentication']->getUser())
@@ -104,7 +104,7 @@ class Lightbox implements ControllerProviderInterface
}
$basketElement = $app['EM']
->getRepository('Alchemy\Phrasea\Model\Entities\BasketElement')
->getRepository('Phraseanet:BasketElement')
->findUserElement($sselcont_id, $app['authentication']->getUser());
$parameters = [
@@ -118,7 +118,7 @@ class Lightbox implements ControllerProviderInterface
->assert('sselcont_id', '\d+');
$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());
@@ -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) {
$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);
if ($app['browser']->isMobile()) {
@@ -209,7 +209,7 @@ class Lightbox implements ControllerProviderInterface
return $app->redirectPath('logout');
}
$repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Basket');
$repository = $app['EM']->getRepository('Phraseanet:Basket');
$basket_collection = $repository->findActiveValidationAndBasketByUser(
$app['authentication']->getUser()
@@ -256,7 +256,7 @@ class Lightbox implements ControllerProviderInterface
return $app->redirectPath('logout');
}
$repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Basket');
$repository = $app['EM']->getRepository('Phraseanet:Basket');
$basket_collection = $repository->findActiveValidationAndBasketByUser(
$app['authentication']->getUser()
@@ -303,7 +303,7 @@ class Lightbox implements ControllerProviderInterface
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';
@@ -346,7 +346,7 @@ class Lightbox implements ControllerProviderInterface
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());
@@ -393,7 +393,7 @@ class Lightbox implements ControllerProviderInterface
'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(
$sselcont_id

View File

@@ -117,7 +117,7 @@ class Permalink extends AbstractDelivery
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);
} else {
$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');
if ($watermark) {
$repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\BasketElement');
$repository = $app['EM']->getRepository('Phraseanet:BasketElement');
if (count($repository->findReceivedValidationElementsByRecord($record, $user)) > 0) {
$watermark = false;

View File

@@ -350,7 +350,7 @@ class BasketController implements ControllerProviderInterface
foreach ($request->request->get('elements') as $bask_element_id) {
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());
} catch (\Exception $e) {
continue;

View File

@@ -34,7 +34,7 @@ class Feed implements ControllerProviderInterface
$app['firewall']->addMandatoryAuthentication($controllers);
$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())
);
$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) {
$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) {
$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', ''))) {
$app->abort(400, "Bad request");
@@ -95,13 +95,13 @@ class Feed implements ControllerProviderInterface
});
$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())) {
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]);
@@ -115,7 +115,7 @@ class Feed implements ControllerProviderInterface
$controllers->post('/entry/{id}/update/', function (Application $app, Request $request, $id) {
$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) {
$app->abort(404, 'Entry not found');
@@ -136,7 +136,7 @@ class Feed implements ControllerProviderInterface
$new_feed_id = $request->request->get('feed_id', $currentFeedId);
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) {
$app->abort(404, 'Feed not found');
@@ -155,7 +155,7 @@ class Feed implements ControllerProviderInterface
if (count($item_sort_datas) != 2) {
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]);
$app['EM']->persist($item);
}
@@ -179,7 +179,7 @@ class Feed implements ControllerProviderInterface
$controllers->post('/entry/{id}/delete/', function (Application $app, Request $request, $id) {
$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) {
$app->abort(404, 'Entry not found');
@@ -203,7 +203,7 @@ class Feed implements ControllerProviderInterface
$page = (int) $request->query->get('page');
$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', [
'feeds' => $feeds,
@@ -218,11 +218,11 @@ class Feed implements ControllerProviderInterface
$page = (int) $request->query->get('page');
$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)) {
$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]);
@@ -234,7 +234,7 @@ class Feed implements ControllerProviderInterface
$controllers->get('/subscribe/aggregated/', function (Application $app, Request $request) {
$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),
$app['authentication']->getUser(),
@@ -255,7 +255,7 @@ class Feed implements ControllerProviderInterface
$controllers->get('/subscribe/{id}/', function (Application $app, Request $request, $id) {
$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)) {
$app->abort(404, 'Feed not found');
}

View File

@@ -85,7 +85,7 @@ class Lazaret implements ControllerProviderInterface
$lazaretFiles = null;
if (count($baseIds) > 0) {
$lazaretRepository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\LazaretFile');
$lazaretRepository = $app['EM']->getRepository('Phraseanet:LazaretFile');
$lazaretFiles = $lazaretRepository->findPerPage(
$baseIds, $request->query->get('offset', 0), $request->query->get('limit', 10)
@@ -110,7 +110,7 @@ class Lazaret implements ControllerProviderInterface
{
$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 */
if (null === $lazaretFile) {
@@ -163,7 +163,7 @@ class Lazaret implements ControllerProviderInterface
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 */
if (null === $lazaretFile) {
@@ -272,7 +272,7 @@ class Lazaret implements ControllerProviderInterface
{
$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 */
if (null === $lazaretFile) {
$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' => []];
$lazaretFiles = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\LazaretFile')->findAll();
$lazaretFiles = $app['EM']->getRepository('Phraseanet:LazaretFile')->findAll();
$app['EM']->beginTransaction();
@@ -357,7 +357,7 @@ class Lazaret implements ControllerProviderInterface
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 */
if (null === $lazaretFile) {
@@ -428,7 +428,7 @@ class Lazaret implements ControllerProviderInterface
*/
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 */
if (null === $lazaretFile) {

View File

@@ -193,8 +193,8 @@ class Order implements ControllerProviderInterface
$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);
$total = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Order')->countTotalOrders($baseIds);
$ordersList = $app['EM']->getRepository('Phraseanet:Order')->listOrders($baseIds, $offsetStart, $perPage, $sort);
$total = $app['EM']->getRepository('Phraseanet:Order')->countTotalOrders($baseIds);
return $app['twig']->render('prod/orders/order_box.html.twig', [
'page' => $page,
@@ -216,7 +216,7 @@ class Order implements ControllerProviderInterface
*/
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) {
throw new NotFoundHttpException('Order not found');
}
@@ -237,7 +237,7 @@ class Order implements ControllerProviderInterface
public function sendOrder(Application $app, Request $request, $order_id)
{
$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) {
throw new NotFoundHttpException('Order not found');
}
@@ -324,7 +324,7 @@ class Order implements ControllerProviderInterface
public function denyOrder(Application $app, Request $request, $order_id)
{
$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) {
throw new NotFoundHttpException('Order not found');
}

View File

@@ -117,7 +117,7 @@ class Push implements ControllerProviderInterface
$controllers->post('/sendform/', function (Application $app) use ($userSelection) {
$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());
@@ -135,7 +135,7 @@ class Push implements ControllerProviderInterface
$controllers->post('/validateform/', function (Application $app) use ($userSelection) {
$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());
@@ -277,7 +277,7 @@ class Push implements ControllerProviderInterface
try {
$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_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) {
$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);
@@ -592,7 +592,7 @@ class Push implements ControllerProviderInterface
->limit(0, 50)
->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'));
@@ -615,7 +615,7 @@ class Push implements ControllerProviderInterface
$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);

View File

@@ -152,8 +152,8 @@ class Records implements ControllerProviderInterface
'candeleterecord'
]);
$basketElementsRepository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\BasketElement');
$StoryWZRepository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\StoryWZ');
$basketElementsRepository = $app['EM']->getRepository('Phraseanet:BasketElement');
$StoryWZRepository = $app['EM']->getRepository('Phraseanet:StoryWZ');
$deleted = [];

View File

@@ -71,7 +71,7 @@ class Root implements ControllerProviderInterface
$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());
$thjslist = "";

View File

@@ -80,7 +80,7 @@ class UsrLists implements ControllerProviderInterface
$lists = new ArrayCollection();
try {
$repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\UsrList');
$repository = $app['EM']->getRepository('Phraseanet:UsrList');
$lists = $repository->findUserLists($app['authentication']->getUser());
@@ -193,7 +193,7 @@ class UsrLists implements ControllerProviderInterface
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);
@@ -251,7 +251,7 @@ class UsrLists implements ControllerProviderInterface
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);
@@ -282,7 +282,7 @@ class UsrLists implements ControllerProviderInterface
public function removeList(Application $app, $list_id)
{
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);
@@ -316,7 +316,7 @@ class UsrLists implements ControllerProviderInterface
public function removeUser(Application $app, $list_id, $usr_id)
{
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);
/* @var $list UsrList */
@@ -325,7 +325,7 @@ class UsrLists implements ControllerProviderInterface
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);
@@ -358,7 +358,7 @@ class UsrLists implements ControllerProviderInterface
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);
/* @var $list UsrList */
@@ -422,7 +422,7 @@ class UsrLists implements ControllerProviderInterface
$list = null;
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);
/* @var $list UsrList */
@@ -452,7 +452,7 @@ class UsrLists implements ControllerProviderInterface
throw new BadRequestHttpException('Role is invalid');
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);
/* @var $list UsrList */
@@ -508,7 +508,7 @@ class UsrLists implements ControllerProviderInterface
public function unshareWithUser(Application $app, $list_id, $usr_id)
{
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);
/* @var $list UsrList */
@@ -517,7 +517,7 @@ class UsrLists implements ControllerProviderInterface
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);

View File

@@ -80,7 +80,7 @@ class WorkZone implements ControllerProviderInterface
{
$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);
@@ -123,7 +123,7 @@ class WorkZone implements ControllerProviderInterface
throw new BadRequestHttpException('Missing parameters stories');
}
$StoryWZRepo = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\StoryWZ');
$StoryWZRepo = $app['EM']->getRepository('Phraseanet:StoryWZ');
$alreadyFixed = $done = 0;
@@ -184,7 +184,7 @@ class WorkZone implements ControllerProviderInterface
{
$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);

View File

@@ -213,7 +213,7 @@ class RecordsRequest extends ArrayCollection
$received[$basket_element->getRecord($app)->get_serialize_key()] = $basket_element->getRecord($app);
}
} elseif ($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()

View File

@@ -267,7 +267,7 @@ class Account implements ControllerProviderInterface
*/
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
ORDER BY s.created DESC';

View File

@@ -52,7 +52,7 @@ class Login implements ControllerProviderInterface
{
$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);
$preview = $record->get_subdef('preview');
$permalink = $preview->get_permalink();
@@ -304,7 +304,7 @@ class Login implements ControllerProviderInterface
}
$userAuthProvider = $app['EM']
->getRepository('Alchemy\Phrasea\Model\Entities\UsrAuthProvider')
->getRepository('Phraseanet:UsrAuthProvider')
->findWithProviderAndId($token->getProvider()->getId(), $token->getId());
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'));
}
$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->setData([
@@ -854,7 +854,7 @@ class Login implements ControllerProviderInterface
$date = new \DateTime('+' . (int) $app['conf']->get(['registry', 'actions', 'validation-reminder-days']) . ' days');
foreach ($app['EM']
->getRepository('Alchemy\Phrasea\Model\Entities\ValidationParticipant')
->getRepository('Phraseanet:ValidationParticipant')
->findNotConfirmedAndNotRemindedParticipantsByExpireDate($date) as $participant) {
/* @var $participant ValidationParticipant */
@@ -927,7 +927,7 @@ class Login implements ControllerProviderInterface
}
$userAuthProvider = $app['EM']
->getRepository('Alchemy\Phrasea\Model\Entities\UsrAuthProvider')
->getRepository('Phraseanet:UsrAuthProvider')
->findWithProviderAndId($token->getProvider()->getId(), $token->getId());
if (null !== $userAuthProvider) {
@@ -1058,7 +1058,7 @@ class Login implements ControllerProviderInterface
if (!$user->is_guest() && $request->cookies->has('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]);
foreach ($baskets as $basket) {

View File

@@ -25,7 +25,7 @@ class RSSFeeds implements ControllerProviderInterface
$controllers = $app['controllers_factory'];
$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) {
$app->abort(404, 'Feed not found');
@@ -47,7 +47,7 @@ class RSSFeeds implements ControllerProviderInterface
->assert('format', '(rss|atom)');
$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'];
@@ -62,10 +62,10 @@ class RSSFeeds implements ControllerProviderInterface
->assert('format', '(rss|atom)');
$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);
$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);

View File

@@ -81,7 +81,7 @@ class Session implements ControllerProviderInterface
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());
if (!$session->hasModuleId($moduleId)) {
@@ -102,7 +102,7 @@ class Session implements ControllerProviderInterface
'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) {
$ret['changed'][] = $basket->getId();
@@ -132,7 +132,7 @@ class Session implements ControllerProviderInterface
*/
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) {
$app->abort(404, 'Unknown session');

View File

@@ -62,7 +62,7 @@ class TaskManagerServiceProvider implements ServiceProviderInterface
$finder = new PhpExecutableFinder();
$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);
});
}

View File

@@ -17,6 +17,7 @@ use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\Common\Annotations\AnnotationRegistry;
use Doctrine\Common\Annotations\FileCacheReader;
use Doctrine\Common\EventManager;
use Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain;
use Doctrine\ORM\Mapping\Driver\AnnotationDriver;
use Doctrine\ORM\Mapping\Driver\DriverChain;
use Doctrine\ORM\EntityManager;
@@ -54,7 +55,7 @@ class ORMServiceProvider implements ServiceProviderInterface
$app['debug']
);
$driverChain = new DriverChain();
$driverChain = new MappingDriverChain();
DoctrineExtensions::registerAbstractMappingIntoDriverChainORM(
$driverChain,
$fileCacheReader
@@ -95,6 +96,7 @@ class ORMServiceProvider implements ServiceProviderInterface
$config->setProxyDir($app['root.path'] . '/tmp/doctrine-proxies');
$config->setProxyNamespace('Alchemy\Phrasea\Model\Proxies');
$config->setAutoGenerateProxyClasses($app['debug']);
$config->addEntityNamespace('Phraseanet', 'Alchemy\Phrasea\Model\Entities');
return $config;
});

View File

@@ -77,8 +77,8 @@ class Aggregate implements FeedInterface
*/
public static function createFromUser(Application $app, \User_Adapter $user)
{
$feeds = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Feed')->getAllForUser($app['acl']->get($user));
$token = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\AggregateToken')->findOneBy(['usrId' => $user->get_id()]);
$feeds = $app['EM']->getRepository('Phraseanet:Feed')->getAllForUser($app['acl']->get($user));
$token = $app['EM']->getRepository('Phraseanet:AggregateToken')->findOneBy(['usrId' => $user->get_id()]);
return new static($app['EM'], $feeds, $token);
}
@@ -93,7 +93,7 @@ class Aggregate implements FeedInterface
*/
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);
}
@@ -120,7 +120,7 @@ class Aggregate implements FeedInterface
$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();
}
return count($this->em->getRepository('Alchemy\Phrasea\Model\Entities\FeedEntry')->findByFeeds($feedIds));
return count($this->em->getRepository('Phraseanet:FeedEntry')->findByFeeds($feedIds));
}
return 0;
@@ -238,6 +238,6 @@ class Aggregate implements FeedInterface
*/
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']));
}
}

View File

@@ -130,7 +130,7 @@ class AggregateLinkGenerator implements LinkGeneratorInterface
private function getAggregateToken(\User_Adapter $user, $renew = false)
{
$token = $this->em
->getRepository('Alchemy\Phrasea\Model\Entities\AggregateToken')
->getRepository('Phraseanet:AggregateToken')
->findOneBy(['usrId' => $user->get_id()]);
if (null === $token || true === $renew) {

View File

@@ -138,7 +138,7 @@ class FeedLinkGenerator implements LinkGeneratorInterface
private function getFeedToken(Feed $feed, \User_Adapter $user, $renew = false)
{
$token = $this->em
->getRepository('Alchemy\Phrasea\Model\Entities\FeedToken')
->getRepository('Phraseanet:FeedToken')
->findOneBy(['usrId' => $user->get_id(), 'feed' => $feed->getId()]);
if (null === $token || true === $renew) {

View File

@@ -116,7 +116,7 @@ class Helper extends \Alchemy\Phrasea\Helper\Helper
$this->is_basket = true;
$this->original_basket = $Basket;
} 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'));

View File

@@ -33,7 +33,7 @@ class WorkZone extends Helper
public function getContent($sort)
{
/* @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';
@@ -56,7 +56,7 @@ class WorkZone extends Helper
$validations = $repo_baskets->findActiveValidationByUser($this->app['authentication']->getUser(), $sort);
/* @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);

View File

@@ -31,7 +31,7 @@ class BasketConverter implements ConverterInterface
*/
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));
}

View File

@@ -31,7 +31,7 @@ class TaskConverter implements ConverterInterface
*/
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));
}

View File

@@ -439,7 +439,7 @@ class Session
* Get a module by its identifier
*
* @param integer $moduleId
* @return Alchemy\Phrasea\Model\Entities\SessionModule|null
* @return SessionModule|null
*/
public function getModuleById($moduleId)
{

View File

@@ -136,7 +136,7 @@ class UserManager
*/
private function cleanFtpExports(User $user)
{
$elements = $this->objectManager->getRepository('Alchemy\Phrasea\Model\Entities\FtpExport')
$elements = $this->objectManager->getRepository('Phraseanet:FtpExport')
->findBy(['usrId' => $user->getId()]);
foreach ($elements as $element) {
@@ -151,7 +151,7 @@ class UserManager
*/
private function cleanOrders(User $user)
{
$orders = $this->objectManager->getRepository('Alchemy\Phrasea\Model\Entities\Order')
$orders = $this->objectManager->getRepository('Phraseanet:Order')
->findBy(['usrId' => $user->getId()]);
foreach ($orders as $order) {

View File

@@ -178,6 +178,6 @@ class TaskManipulator implements ManipulatorInterface
*/
public function getRepository()
{
return $this->om->getRepository('Alchemy\Phrasea\Model\Entities\Task');
return $this->om->getRepository('Phraseanet:Task');
}
}

View File

@@ -46,7 +46,7 @@ class UserManipulator implements ManipulatorInterface
*/
public function getRepository()
{
return $this->manager->getObjectManager()->getRepository('Alchemy\Phrasea\Model\Entities\User');
return $this->manager->getObjectManager()->getRepository('Phraseanet:User');
}
/**

View File

@@ -26,7 +26,7 @@ class AuthFailureRepository extends EntityRepository
$date = new \DateTime($limit);
$dql = 'SELECT f
FROM Alchemy\Phrasea\Model\Entities\AuthFailure f
FROM Phraseanet:AuthFailure f
WHERE f.created < :date';
$params = ['date' => $date->format('Y-m-d h:i:s')];
@@ -40,7 +40,7 @@ class AuthFailureRepository extends EntityRepository
public function findLockedFailuresMatching($username, $ip)
{
$dql = 'SELECT f
FROM Alchemy\Phrasea\Model\Entities\AuthFailure f
FROM Phraseanet:AuthFailure f
WHERE (f.username = :username OR f.ip = :ip)
AND f.locked = true';

View File

@@ -27,7 +27,7 @@ class BasketElementRepository extends EntityRepository
public function findUserElement($element_id, \User_Adapter $user)
{
$dql = 'SELECT e
FROM Alchemy\Phrasea\Model\Entities\BasketElement e
FROM Phraseanet:BasketElement e
JOIN e.basket b
LEFT JOIN e.validation_datas vd
LEFT JOIN b.validation s
@@ -57,7 +57,7 @@ class BasketElementRepository extends EntityRepository
public function findElementsByRecord(\record_adapter $record)
{
$dql = 'SELECT e
FROM Alchemy\Phrasea\Model\Entities\BasketElement e
FROM Phraseanet:BasketElement e
JOIN e.basket b
LEFT JOIN b.validation s
LEFT JOIN s.participants p
@@ -78,7 +78,7 @@ class BasketElementRepository extends EntityRepository
public function findElementsByDatabox(\databox $databox)
{
$dql = 'SELECT e
FROM Alchemy\Phrasea\Model\Entities\BasketElement e
FROM Phraseanet:BasketElement e
JOIN e.basket b
LEFT JOIN b.validation s
LEFT JOIN s.participants p
@@ -103,7 +103,7 @@ class BasketElementRepository extends EntityRepository
public function findReceivedElementsByRecord(\record_adapter $record, \User_Adapter $user)
{
$dql = 'SELECT e
FROM Alchemy\Phrasea\Model\Entities\BasketElement e
FROM Phraseanet:BasketElement e
JOIN e.basket b
LEFT JOIN b.validation s
LEFT JOIN s.participants p
@@ -127,7 +127,7 @@ class BasketElementRepository extends EntityRepository
public function findReceivedValidationElementsByRecord(\record_adapter $record, \User_Adapter $user)
{
$dql = 'SELECT e
FROM Alchemy\Phrasea\Model\Entities\BasketElement e
FROM Phraseanet:BasketElement e
JOIN e.basket b
JOIN b.validation v
JOIN v.participants p

View File

@@ -30,7 +30,7 @@ class BasketRepository extends EntityRepository
public function findActiveByUser(\User_Adapter $user, $sort = null)
{
$dql = 'SELECT b
FROM Alchemy\Phrasea\Model\Entities\Basket b
FROM Phraseanet:Basket b
LEFT JOIN b.elements e
WHERE b.usr_id = :usr_id
AND b.archived = false';
@@ -56,7 +56,7 @@ class BasketRepository extends EntityRepository
public function findUnreadActiveByUser(\User_Adapter $user)
{
$dql = 'SELECT b
FROM Alchemy\Phrasea\Model\Entities\Basket b
FROM Phraseanet:Basket b
JOIN b.elements e
LEFT JOIN b.validation s
LEFT JOIN s.participants p
@@ -91,7 +91,7 @@ class BasketRepository extends EntityRepository
public function findActiveValidationByUser(\User_Adapter $user, $sort = null)
{
$dql = 'SELECT b
FROM Alchemy\Phrasea\Model\Entities\Basket b
FROM Phraseanet:Basket b
JOIN b.elements e
JOIN e.validation_datas v
JOIN b.validation s
@@ -115,7 +115,7 @@ class BasketRepository extends EntityRepository
{
$dql = 'SELECT b
FROM Alchemy\Phrasea\Model\Entities\Basket b
FROM Phraseanet:Basket b
JOIN b.elements e
WHERE e.record_id = :record_id AND e.sbas_id = e.sbas_id
AND b.usr_id = :usr_id';
@@ -138,7 +138,7 @@ class BasketRepository extends EntityRepository
switch ($type) {
case self::RECEIVED:
$dql = 'SELECT b
FROM Alchemy\Phrasea\Model\Entities\Basket b
FROM Phraseanet:Basket b
JOIN b.elements e
WHERE b.usr_id = :usr_id AND b.pusher_id IS NOT NULL';
$params = [
@@ -147,7 +147,7 @@ class BasketRepository extends EntityRepository
break;
case self::VALIDATION_DONE:
$dql = 'SELECT b
FROM Alchemy\Phrasea\Model\Entities\Basket b
FROM Phraseanet:Basket b
JOIN b.elements e
JOIN b.validation s
JOIN s.participants p
@@ -159,7 +159,7 @@ class BasketRepository extends EntityRepository
break;
case self::VALIDATION_SENT:
$dql = 'SELECT b
FROM Alchemy\Phrasea\Model\Entities\Basket b
FROM Phraseanet:Basket b
JOIN b.elements e
JOIN b.validation v
WHERE b.usr_id = :usr_id';
@@ -169,7 +169,7 @@ class BasketRepository extends EntityRepository
break;
default:
$dql = 'SELECT b
FROM Alchemy\Phrasea\Model\Entities\Basket b
FROM Phraseanet:Basket b
LEFT JOIN b.elements e
LEFT JOIN b.validation s
LEFT JOIN s.participants p
@@ -181,7 +181,7 @@ class BasketRepository extends EntityRepository
break;
case self::MYBASKETS:
$dql = 'SELECT b
FROM Alchemy\Phrasea\Model\Entities\Basket b
FROM Phraseanet:Basket b
LEFT JOIN b.elements e
LEFT JOIN b.validation s
LEFT JOIN s.participants p
@@ -228,7 +228,7 @@ class BasketRepository extends EntityRepository
public function findActiveValidationAndBasketByUser(\User_Adapter $user, $sort = null)
{
$dql = 'SELECT b
FROM Alchemy\Phrasea\Model\Entities\Basket b
FROM Phraseanet:Basket b
LEFT JOIN b.elements e
LEFT JOIN b.validation s
LEFT JOIN s.participants p

View File

@@ -32,7 +32,7 @@ class FeedEntryRepository extends EntityRepository
*/
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';
$query = $this->_em->createQuery($dql);

View File

@@ -35,7 +35,7 @@ class FeedItemRepository extends EntityRepository
public function isRecordInPublicFeed(Application $app, $sbas_id, $record_id)
{
$dql = 'SELECT i
FROM Alchemy\Phrasea\Model\Entities\FeedItem i
FROM Phraseanet:FeedItem i
JOIN i.entry e
JOIN e.feed f
WHERE i.sbasId = :sbas_id
@@ -63,7 +63,7 @@ class FeedItemRepository extends EntityRepository
do {
$dql = 'SELECT i
FROM Alchemy\Phrasea\Model\Entities\FeedItem i
FROM Phraseanet:FeedItem i
JOIN i.entry e
JOIN e.feed f
WHERE f.public = true ORDER BY i.createdOn DESC';

View File

@@ -50,7 +50,7 @@ class FtpExportRepository extends EntityRepository
public function findDoableExports()
{
$dql = 'SELECT f
FROM Alchemy\Phrasea\Model\Entities\FtpExport f
FROM Phraseanet:FtpExport f
INNER JOIN f.elements e
WHERE e.done = false';

View File

@@ -30,7 +30,7 @@ class LazaretFileRepository extends EntityRepository
$dql = '
SELECT f
FROM Alchemy\Phrasea\Model\Entities\LazaretFile f'
FROM Phraseanet:LazaretFile f'
. ('' === $base_ids ? '' : ' WHERE f.base_id IN (' . $base_ids . ')')
. ' ORDER BY f.id DESC';

View File

@@ -24,7 +24,7 @@ class SessionRepository extends EntityRepository
public function findByUser(\User_Adapter $user)
{
$dql = 'SELECT s
FROM Alchemy\Phrasea\Model\Entities\Session s
FROM Phraseanet:Session s
WHERE s.usr_id = :usr_id';
$query = $this->_em->createQuery($dql);

View File

@@ -27,7 +27,7 @@ class StoryWZRepository extends EntityRepository
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') {
$dql .= ' ORDER BY s.created DESC';
@@ -118,7 +118,7 @@ class StoryWZRepository extends EntityRepository
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';
$query = $this->_em->createQuery($dql);
@@ -144,7 +144,7 @@ class StoryWZRepository extends EntityRepository
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->setParameters([

View File

@@ -24,7 +24,7 @@ class UsrAuthProviderRepository extends EntityRepository
public function findByUser(\User_Adapter $user)
{
$dql = 'SELECT u
FROM Alchemy\Phrasea\Model\Entities\UsrAuthProvider u
FROM Phraseanet:UsrAuthProvider u
WHERE u.usr_id = :usrId';
$params = ['usrId' => $user->get_id()];
@@ -38,7 +38,7 @@ class UsrAuthProviderRepository extends EntityRepository
public function findWithProviderAndId($providerId, $distantId)
{
$dql = 'SELECT u
FROM Alchemy\Phrasea\Model\Entities\UsrAuthProvider u
FROM Phraseanet:UsrAuthProvider u
WHERE u.provider = :providerId AND u.distant_id = :distantId';
$params = ['providerId' => $providerId, 'distantId' => $distantId];

View File

@@ -34,7 +34,7 @@ class UsrListEntryRepository extends EntityRepository
*/
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';
$params = [
@@ -65,7 +65,7 @@ class UsrListEntryRepository extends EntityRepository
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
WHERE e.usr_id = :usr_id AND l.id = :list_id';

View File

@@ -58,7 +58,7 @@ class UsrListOwnerRepository extends EntityRepository
*/
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
WHERE l.id = :list_id AND o.usr_id = :usr_id';

View File

@@ -34,7 +34,7 @@ class UsrListRepository extends EntityRepository
*/
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
WHERE o.usr_id = :usr_id';
@@ -79,7 +79,7 @@ class UsrListRepository extends EntityRepository
*/
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
WHERE o.usr_id = :usr_id AND l.name LIKE :name';

View File

@@ -27,7 +27,7 @@ class ValidationParticipantRepository extends EntityRepository
{
$dql = '
SELECT p, s
FROM Alchemy\Phrasea\Model\Entities\ValidationParticipant p
FROM Phraseanet:ValidationParticipant p
JOIN p.session s
JOIN s.basket b
WHERE p.is_confirmed = 0

View File

@@ -74,7 +74,7 @@ class FtpJob extends AbstractJob
private function removeDeadExports(Application $app)
{
foreach ($app['EM']
->getRepository('Alchemy\Phrasea\Model\Entities\FtpExport')
->getRepository('Phraseanet:FtpExport')
->findCrashedExports(new \DateTime('-1 month')) as $export) {
$app['EM']->remove($export);
}
@@ -84,7 +84,7 @@ class FtpJob extends AbstractJob
private function retrieveExports(Application $app)
{
return $app['EM']
->getRepository('Alchemy\Phrasea\Model\Entities\FtpExport')
->getRepository('Phraseanet:FtpExport')
->findDoableExports();
}

View File

@@ -252,7 +252,7 @@ class ACL implements cache_cacheableInterface
$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;
}

View File

@@ -24,6 +24,7 @@ use Alchemy\Phrasea\Model\Entities\FeedItem;
use Alchemy\Phrasea\Model\Entities\LazaretFile;
use Alchemy\Phrasea\Model\Entities\Task;
use Alchemy\Phrasea\Model\Entities\UserQuery;
use Alchemy\Phrasea\Model\Entities\ValidationData;
use Alchemy\Phrasea\Model\Entities\ValidationParticipant;
use Silex\Application;
use Symfony\Component\HttpFoundation\Request;
@@ -724,7 +725,7 @@ class API_V1_adapter extends API_V1_Abstract
$lazaretFiles = [];
if (count($baseIds) > 0) {
$lazaretRepository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\LazaretFile');
$lazaretRepository = $app['EM']->getRepository('Phraseanet:LazaretFile');
$lazaretFiles = $lazaretRepository->findPerPage(
$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)
{
$lazaretFile = $app['EM']->find('Alchemy\Phrasea\Model\Entities\LazaretFile', $lazaret_id);
$lazaretFile = $app['EM']->find('Phraseanet:LazaretFile', $lazaret_id);
/* @var $lazaretFile LazaretFile */
if (null === $lazaretFile) {
@@ -1240,7 +1241,7 @@ class API_V1_adapter extends API_V1_Abstract
*/
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 */
$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) {
$participant = $validation_datas->getParticipant();
$user = $participant->getUser($this->app);
/* @var $validation_datas Alchemy\Phrasea\Model\Entities\ValidationData */
/* @var $validation_datas ValidationData */
$choices[] = [
'validation_user' => [
'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);
$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 = [];
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);
$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)) {
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);
$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);

View File

@@ -188,7 +188,7 @@ class Session_Logger
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) {
throw new SessionNotFound('No session found');

View File

@@ -676,7 +676,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
public function getFtpCredential()
{
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()
]);
@@ -731,22 +731,22 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
*/
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) {
$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) {
$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) {
$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) {
$this->app['EM']->remove($session);

View File

@@ -454,11 +454,11 @@ class databox extends base
$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);
}
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);
}

View File

@@ -133,7 +133,7 @@ class eventsmanager_notify_feed extends eventsmanager_notifyAbstract
{
$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) {
return [];

View File

@@ -49,7 +49,7 @@ class eventsmanager_notify_order extends eventsmanager_notifyAbstract
$users = [];
try {
$repository = $this->app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\OrderElement');
$repository = $this->app['EM']->getRepository('Phraseanet:OrderElement');
$results = $repository->findBy(['orderId' => $order_id]);

View File

@@ -98,7 +98,7 @@ class eventsmanager_notify_orderdeliver extends eventsmanager_notifyAbstract
$receiver = Receiver::fromUser($user_to);
$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']);
$readyToSend = true;

View File

@@ -80,7 +80,7 @@ class eventsmanager_notify_push extends eventsmanager_notifyAbstract
$readyToSend = false;
try {
$repository = $this->app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Basket');
$repository = $this->app['EM']->getRepository('Phraseanet:Basket');
$basket = $repository->find($params['ssel_id']);
$user_from = User_Adapter::getInstance($params['from'], $this->app);

View File

@@ -97,7 +97,7 @@ class eventsmanager_notify_validate extends eventsmanager_notifyAbstract
$user_to = User_Adapter::getInstance($params['to'], $this->app);
$basket = $this->app['EM']
->getRepository('Alchemy\Phrasea\Model\Entities\Basket')
->getRepository('Phraseanet:Basket')
->find($params['ssel_id']);
$title = $basket->getName();

View File

@@ -92,7 +92,7 @@ class eventsmanager_notify_validationdone extends eventsmanager_notifyAbstract
$user_to = User_Adapter::getInstance($params['to'], $this->app);
$basket = $this->app['EM']
->getRepository('Alchemy\Phrasea\Model\Entities\Basket')
->getRepository('Phraseanet:Basket')
->find($params['ssel_id']);
$title = $basket->getName();

View File

@@ -98,7 +98,7 @@ class eventsmanager_notify_validationreminder extends eventsmanager_notifyAbstra
$readyToSend = false;
try {
$basket = $this->app['EM']
->getRepository('Alchemy\Phrasea\Model\Entities\Basket')
->getRepository('Phraseanet:Basket')
->find($params['ssel_id']);
$title = $basket->getName();

View File

@@ -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;
$perPage = 100;

View File

@@ -69,13 +69,13 @@ class patch_383alpha1a implements patchInterface
$stmt->closeCursor();
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);
}
}
// 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%');
foreach ($query->getResult() as $session) {

View File

@@ -64,7 +64,7 @@ class patch_383alpha2a implements patchInterface
$stmt->closeCursor();
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);
}
}

View File

@@ -79,7 +79,7 @@ class patch_390alpha1b implements patchInterface
$n = 0;
$em = $app['EM'];
$em->getEventManager()->removeEventSubscriber(new TimestampableListener());
$basketRepository = $em->getRepository('Alchemy\Phrasea\Model\Entities\Basket');
$basketRepository = $em->getRepository('Phraseanet:Basket');
foreach ($rs as $row) {
$sql = 'SELECT count(id) as todo

View File

@@ -185,7 +185,7 @@ class patch_390alpha2a implements patchInterface
$n = 0;
$repository = $em->getRepository('Alchemy\Phrasea\Model\Entities\User');
$repository = $em->getRepository('Phraseanet:User');
foreach ($rows as $row) {
$template = $repository->findOneByLogin($row['usr_login']);

View File

@@ -101,7 +101,7 @@ class patch_390alpha9a implements patchInterface
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();
foreach ($users as $user) {

View File

@@ -189,7 +189,7 @@ class queries
$history = '<ul>';
$queries = $app['EM']
->getRepository('Alchemy\Phrasea\Model\Entities\UserQuery')
->getRepository('Phraseanet:UserQuery')
->findBy(['usrId' => $usrId], ['created' => 'ASC'], 25, 0);
foreach ($queries as $query) {

View File

@@ -1491,7 +1491,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
$stmt->execute([':record_id' => $this->get_record_id()]);
$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 */
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 */
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)
{
return $em
->getRepository('Alchemy\Phrasea\Model\Entities\Basket')
->getRepository('Phraseanet:Basket')
->findContainingRecordForUser($this, $user);
}

View File

@@ -170,7 +170,7 @@ class record_preview extends record_adapter
}
break;
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->total = count($entry->getItems());

View File

@@ -8,43 +8,43 @@ class BasketACLTest extends \PhraseanetTestCase
{
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']));
}
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']));
}
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']));
}
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']));
}
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']));
}
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']));
}
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']));
}
}

View File

@@ -100,10 +100,10 @@ abstract class ApiTestCase extends \PhraseanetWebTestCase
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);
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()
@@ -1331,7 +1331,7 @@ abstract class ApiTestCase extends \PhraseanetWebTestCase
{
$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();
$route = '/api/v1/baskets/' . $basket->getId() . '/content/';
@@ -1371,7 +1371,7 @@ abstract class ApiTestCase extends \PhraseanetWebTestCase
{
$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/';
@@ -1424,7 +1424,7 @@ abstract class ApiTestCase extends \PhraseanetWebTestCase
{
$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/';
@@ -1643,7 +1643,7 @@ abstract class ApiTestCase extends \PhraseanetWebTestCase
*/
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);
$route = '/api/v1/feeds/list/';
@@ -1693,7 +1693,7 @@ abstract class ApiTestCase extends \PhraseanetWebTestCase
$author = "W. Shakespeare";
$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->setAuthorEmail($author_email);
@@ -1749,7 +1749,7 @@ abstract class ApiTestCase extends \PhraseanetWebTestCase
->disableOriginalConstructor()
->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();
$this->setToken(self::$token);
@@ -1780,7 +1780,7 @@ abstract class ApiTestCase extends \PhraseanetWebTestCase
->disableOriginalConstructor()
->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_feed->setCollection(self::$DI['collection_no_access']);
@@ -1813,7 +1813,7 @@ abstract class ApiTestCase extends \PhraseanetWebTestCase
$entry_title = 'Superman';
$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->setTitle($entry_title);
$created_entry->setSubtitle($entry_subtitle);

View File

@@ -48,7 +48,7 @@ class LightboxTest extends \PhraseanetAuthenticatedWebTestCase
{
$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());
self::$DI['client']->request('GET', '/lightbox/?LOG='.$token);
@@ -59,7 +59,7 @@ class LightboxTest extends \PhraseanetAuthenticatedWebTestCase
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();
$this->set_user_agent(self::USER_AGENT_FIREFOX8MAC, self::$DI['app']);
@@ -83,7 +83,7 @@ class LightboxTest extends \PhraseanetAuthenticatedWebTestCase
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']);
@@ -128,7 +128,7 @@ class LightboxTest extends \PhraseanetAuthenticatedWebTestCase
{
$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();
$item = $entry->getItems()->first();
@@ -173,7 +173,7 @@ class LightboxTest extends \PhraseanetAuthenticatedWebTestCase
{
$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']);
@@ -198,7 +198,7 @@ class LightboxTest extends \PhraseanetAuthenticatedWebTestCase
{
$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']);
@@ -225,7 +225,7 @@ class LightboxTest extends \PhraseanetAuthenticatedWebTestCase
$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();
$crawler = self::$DI['client']->request('GET', '/lightbox/feeds/entry/' . $entry->getId() . '/');
@@ -247,7 +247,7 @@ class LightboxTest extends \PhraseanetAuthenticatedWebTestCase
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']);
self::$DI['client']->request('GET', '/lightbox/ajax/LOAD_REPORT/' . $validationBasket->getId() . '/');
@@ -257,7 +257,7 @@ class LightboxTest extends \PhraseanetAuthenticatedWebTestCase
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();
self::$DI['client']->request('POST', '/lightbox/ajax/SET_NOTE/' . $validationBasketElement->getId() . '/');
@@ -280,7 +280,7 @@ class LightboxTest extends \PhraseanetAuthenticatedWebTestCase
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();
$crawler = self::$DI['client']->request(
@@ -306,7 +306,7 @@ class LightboxTest extends \PhraseanetAuthenticatedWebTestCase
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() . '/');
$this->assertEquals(200, self::$DI['client']->getResponse()->getStatusCode());
@@ -318,7 +318,7 @@ class LightboxTest extends \PhraseanetAuthenticatedWebTestCase
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');

View File

@@ -209,7 +209,7 @@ class OverviewTest extends \PhraseanetAuthenticatedWebTestCase
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();
$item = $entry->getItems()->first();

View File

@@ -155,7 +155,7 @@ class AuthenticatorTest extends \PhraseanetTestCase
$em->expects($this->once())
->method('getRepository')
->with($this->equalTo('Alchemy\Phrasea\Model\Entities\Session'))
->with($this->equalTo('Phraseanet:Session'))
->will($this->returnValue($repo));
$authenticator = new Authenticator($app, $browser, $SFsession, $em);
@@ -197,7 +197,7 @@ class AuthenticatorTest extends \PhraseanetTestCase
$em->expects($this->once())
->method('getRepository')
->with($this->equalTo('Alchemy\Phrasea\Model\Entities\Session'))
->with($this->equalTo('Phraseanet:Session'))
->will($this->returnValue($repo));
$authenticator = new Authenticator($app, $browser, $SFsession, $em);

View File

@@ -41,7 +41,7 @@ class ManagerTest extends \PhraseanetTestCase
$em->expects($this->once())
->method('getRepository')
->with($this->equalTo('Alchemy\Phrasea\Model\Entities\Session'))
->with($this->equalTo('Phraseanet:Session'))
->will($this->returnValue($repo));
$encoder->expects($this->once())
@@ -86,7 +86,7 @@ class ManagerTest extends \PhraseanetTestCase
$em->expects($this->once())
->method('getRepository')
->with($this->equalTo('Alchemy\Phrasea\Model\Entities\Session'))
->with($this->equalTo('Phraseanet:Session'))
->will($this->returnValue($repo));
$encoder->expects($this->once())
@@ -119,7 +119,7 @@ class ManagerTest extends \PhraseanetTestCase
$em->expects($this->once())
->method('getRepository')
->with($this->equalTo('Alchemy\Phrasea\Model\Entities\Session'))
->with($this->equalTo('Phraseanet:Session'))
->will($this->returnValue($repo));
$this->assertFalse($manager->getSession($tokenValue));

View File

@@ -250,17 +250,17 @@ class FailureManagerTest extends \PhraseanetTestCase
->method('getClientIp')
->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());
$this->assertCount(12, self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\AuthFailure')
$this->assertCount(12, self::$DI['app']['EM']->getRepository('Phraseanet:AuthFailure')
->findAll());
$manager = new FailureManager(self::$DI['app']['EM'], $recaptcha, 9);
$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());
$this->assertCount(3, self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\AuthFailure')
$this->assertCount(3, self::$DI['app']['EM']->getRepository('Phraseanet:AuthFailure')
->findAll());
self::$DI['app']['EM']->getEventManager()->addEventSubscriber(new TimestampableListener());
@@ -285,7 +285,7 @@ class FailureManagerTest extends \PhraseanetTestCase
$em->expects($this->once())
->method('getRepository')
->with($this->equalTo('Alchemy\Phrasea\Model\Entities\AuthFailure'))
->with($this->equalTo('Phraseanet:AuthFailure'))
->will($this->returnValue($repo));
return $em;

View File

@@ -38,7 +38,7 @@ class Sha256Test extends \PhraseanetTestCase
*/
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);

View File

@@ -54,7 +54,7 @@ class ManagerTest extends \PhraseanetAuthenticatedWebTestCase
{
parent::setUp();
$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);
}
/**

View File

@@ -558,7 +558,7 @@ class AdminCollectionTest extends \PhraseanetAuthenticatedWebTestCase
$json = $this->getJson(self::$DI['client']->getResponse());
$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');
}
}

View File

@@ -680,7 +680,7 @@ class DataboxTest extends \PhraseanetAuthenticatedWebTestCase
$json = $this->getJson(self::$DI['client']->getResponse());
$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');
}

View File

@@ -19,7 +19,7 @@ class PublicationTest extends \PhraseanetAuthenticatedWebTestCase
$crawler = self::$DI['client']->request('GET', '/admin/publications/list/');
$pageContent = self::$DI['client']->getResponse()->getContent();
$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) {
$this->assertRegExp('/\/admin\/publications\/feed\/' . $feed->getId() . '/', $pageContent);
@@ -34,21 +34,21 @@ class PublicationTest extends \PhraseanetAuthenticatedWebTestCase
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);
$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/'));
$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);
$this->assertGreaterThan($count, $count_after);
}
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() . '/');
$this->assertTrue(self::$DI['client']->getResponse()->isOk());
$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()
{
$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/", [
'title' => 'test'
@@ -65,7 +65,7 @@ class PublicationTest extends \PhraseanetAuthenticatedWebTestCase
, '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(
strpos(
@@ -81,7 +81,7 @@ class PublicationTest extends \PhraseanetAuthenticatedWebTestCase
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/", [
'title' => 'test'
@@ -96,7 +96,7 @@ class PublicationTest extends \PhraseanetAuthenticatedWebTestCase
, '/admin/publications/list/'
) === 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']);
@@ -114,7 +114,7 @@ class PublicationTest extends \PhraseanetAuthenticatedWebTestCase
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']);
@@ -125,7 +125,7 @@ class PublicationTest extends \PhraseanetAuthenticatedWebTestCase
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(
"POST"
@@ -143,7 +143,7 @@ class PublicationTest extends \PhraseanetAuthenticatedWebTestCase
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(
"POST"
@@ -161,7 +161,7 @@ class PublicationTest extends \PhraseanetAuthenticatedWebTestCase
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' => [
@@ -189,7 +189,7 @@ class PublicationTest extends \PhraseanetAuthenticatedWebTestCase
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/", [
'usr_id' => self::$DI['user_alt1']->get_id()
@@ -198,7 +198,7 @@ class PublicationTest extends \PhraseanetAuthenticatedWebTestCase
$response = self::$DI['client']->getResponse();
$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();
$this->assertTrue($feed->isPublisher(self::$DI['user_alt1']));
@@ -211,11 +211,11 @@ class PublicationTest extends \PhraseanetAuthenticatedWebTestCase
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/");
$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();
$this->assertTrue($response->isRedirect());
$this->assertTrue(
@@ -227,7 +227,7 @@ class PublicationTest extends \PhraseanetAuthenticatedWebTestCase
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/", [
'usr_id' => self::$DI['user_alt1']->get_id()
@@ -236,7 +236,7 @@ class PublicationTest extends \PhraseanetAuthenticatedWebTestCase
$response = self::$DI['client']->getResponse();
$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();
$this->assertFalse(isset($publishers[self::$DI['user_alt1']->get_id()]));
@@ -249,14 +249,14 @@ class PublicationTest extends \PhraseanetAuthenticatedWebTestCase
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/");
$response = self::$DI['client']->getResponse();
$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(
strpos(
@@ -267,7 +267,7 @@ class PublicationTest extends \PhraseanetAuthenticatedWebTestCase
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/");

View File

@@ -85,12 +85,12 @@ class TaskManagerTest extends \PhraseanetAuthenticatedWebTestCase
$this->assertEquals(302, self::$DI['client']->getResponse()->getStatusCode());
$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()
{
$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');
$this->assertEquals(302, self::$DI['client']->getResponse()->getStatusCode());
@@ -101,7 +101,7 @@ class TaskManagerTest extends \PhraseanetAuthenticatedWebTestCase
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');
$this->assertEquals(302, self::$DI['client']->getResponse()->getStatusCode());
@@ -112,7 +112,7 @@ class TaskManagerTest extends \PhraseanetAuthenticatedWebTestCase
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');
$this->assertEquals(200, self::$DI['client']->getResponse()->getStatusCode());
@@ -123,7 +123,7 @@ class TaskManagerTest extends \PhraseanetAuthenticatedWebTestCase
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';
$period = 366;

View File

@@ -31,10 +31,10 @@ class BasketsTest extends \PhraseanetAuthenticatedWebTestCase
*/
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']);
$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);
}
@@ -43,14 +43,14 @@ class BasketsTest extends \PhraseanetAuthenticatedWebTestCase
*/
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/", [
'courChuId' => $basket->getId(),
'sbas' => self::$DI['record_1']->get_sbas_id(),
'p0' => self::$DI['record_1']->get_record_id()
]);
$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());
}
@@ -64,7 +64,7 @@ class BasketsTest extends \PhraseanetAuthenticatedWebTestCase
]);
$this->assertTrue(self::$DI['client']->getResponse()->isRedirect());
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');
} catch (\Exception $e) {
@@ -76,8 +76,8 @@ class BasketsTest extends \PhraseanetAuthenticatedWebTestCase
*/
public function testDeleteBasketElement()
{
$basket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 1);
$basketElement = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\BasketElement', 1);
$basket = self::$DI['app']['EM']->find('Phraseanet:Basket', 1);
$basketElement = self::$DI['app']['EM']->find('Phraseanet:BasketElement', 1);
self::$DI['client']->request("POST", "/client/baskets/delete-element/", [
'p0' => $basketElement->getId()

View File

@@ -35,13 +35,13 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
$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();
$this->assertEquals(5, $count);
$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();
$basket = array_pop($result);
@@ -50,7 +50,7 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
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();
$route = '/prod/baskets/';
@@ -70,7 +70,7 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
$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(200, $response->getStatusCode());
@@ -105,7 +105,7 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
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());
self::$DI['client']->request('GET', $route);
$response = self::$DI['client']->getResponse();
@@ -114,7 +114,7 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
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();
$this->assertEquals(1, $basket->getElements()->count());
@@ -131,8 +131,8 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
public function testBasketDeldeteElementPostJSON()
{
$basket = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Basket', 1);
$basket_element = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\BasketElement', 1);
$basket = self::$DI['app']['EM']->find('Phraseanet:Basket', 1);
$basket_element = self::$DI['app']['EM']->find('Phraseanet:BasketElement', 1);
$route = sprintf(
"/prod/baskets/%s/delete/%s/", $basket->getId(), $basket_element->getId()
@@ -151,13 +151,13 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
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());
self::$DI['client']->request('POST', $route);
$response = self::$DI['client']->getResponse();
$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();
$this->assertEquals(4, $count);
}
@@ -167,7 +167,7 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
$route = '/prod/baskets/1/delete/';
self::$DI['client']->request('POST', $route);
$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();
$this->assertEquals(3, $count);
$this->assertEquals(302, $response->getStatusCode());
@@ -178,7 +178,7 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
$route = '/prod/baskets/1/delete/';
self::$DI['client']->request('POST', $route, [], [], ["HTTP_ACCEPT" => "application/json"]);
$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();
$this->assertEquals(3, $count);
$this->assertEquals(200, $response->getStatusCode());
@@ -186,7 +186,7 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
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());
self::$DI['client']->request(
@@ -203,7 +203,7 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
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());
self::$DI['client']->request(
@@ -222,7 +222,7 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
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());
@@ -238,7 +238,7 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
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());
$crawler = self::$DI['client']->request(
@@ -260,7 +260,7 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
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());
self::$DI['client']->request('POST', $route);
$this->assertTrue($basket->getArchived());
@@ -274,7 +274,7 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
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());
self::$DI['client']->request(
@@ -300,7 +300,7 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
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());
$records = [
@@ -324,10 +324,10 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
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);
$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());
$route = sprintf('/prod/baskets/%s/addElements/', $basket->getId());
@@ -348,13 +348,13 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
$this->assertEquals(302, $response->getStatusCode());
$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);
}
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/';
$records = [
@@ -372,10 +372,10 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
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_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());
@@ -395,11 +395,11 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
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_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());
@@ -428,7 +428,7 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
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());
self::$DI['client']->request('POST', $route, [], [], ["HTTP_ACCEPT" => "application/json"]);
@@ -443,16 +443,16 @@ class BasketTest extends \PhraseanetAuthenticatedWebTestCase
$this->assertArrayHasKey('success', $datas);
$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());
$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());
$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());
$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());
}
}

View File

@@ -104,7 +104,7 @@ class DownloadTest extends \PhraseanetAuthenticatedWebTestCase
*/
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')
->disableOriginalConstructor()
@@ -136,7 +136,7 @@ class DownloadTest extends \PhraseanetAuthenticatedWebTestCase
*/
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')
->disableOriginalConstructor()

View File

@@ -12,7 +12,7 @@ class FeedTest extends \PhraseanetAuthenticatedWebTestCase
{
$crawler = self::$DI['client']->request('POST', '/prod/feeds/requestavailable/');
$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) {
if ($one_feed->isPublisher(self::$DI['user'])) {
$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')
->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 = [
"feed_id" => $feed->getId()
, "notify" => 1
@@ -67,7 +67,7 @@ class FeedTest extends \PhraseanetAuthenticatedWebTestCase
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')
->disableOriginalConstructor()
@@ -91,7 +91,7 @@ class FeedTest extends \PhraseanetAuthenticatedWebTestCase
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();
$crawler = self::$DI['client']->request('GET', '/prod/feeds/entry/' . $entry->getId() . '/edit/');
@@ -108,7 +108,7 @@ class FeedTest extends \PhraseanetAuthenticatedWebTestCase
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();
self::$DI['client']->request('GET', '/prod/feeds/entry/' . $entry->getId() . '/edit/');
@@ -118,7 +118,7 @@ class FeedTest extends \PhraseanetAuthenticatedWebTestCase
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();
$params = [
@@ -142,9 +142,9 @@ class FeedTest extends \PhraseanetAuthenticatedWebTestCase
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();
$newfeed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 2);
$newfeed = self::$DI['app']['EM']->find('Phraseanet:Feed', 2);
$params = [
"feed_id" => $newfeed->getId(),
@@ -164,15 +164,15 @@ class FeedTest extends \PhraseanetAuthenticatedWebTestCase
$this->assertTrue(is_string($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());
}
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();
$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']);
self::$DI['app']['EM']->persist($newfeed);
self::$DI['app']['EM']->flush();
@@ -192,7 +192,7 @@ class FeedTest extends \PhraseanetAuthenticatedWebTestCase
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();
$params = [
@@ -225,7 +225,7 @@ class FeedTest extends \PhraseanetAuthenticatedWebTestCase
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']);
$params = [
@@ -243,7 +243,7 @@ class FeedTest extends \PhraseanetAuthenticatedWebTestCase
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();
$params = [
@@ -261,7 +261,7 @@ class FeedTest extends \PhraseanetAuthenticatedWebTestCase
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();
$items = $entry->getItems()->toArray();
@@ -282,8 +282,8 @@ class FeedTest extends \PhraseanetAuthenticatedWebTestCase
self::$DI['client']->request('POST', '/prod/feeds/entry/' . $entry->getId() . '/update/', $params);
$this->assertTrue(self::$DI['client']->getResponse()->isOk());
$newItem1 = self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\FeedItem')->find($item1->getId());
$newItem2 = self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\FeedItem')->find($item2->getId());
$newItem1 = self::$DI['app']['EM']->getRepository('Phraseanet:FeedItem')->find($item1->getId());
$newItem2 = self::$DI['app']['EM']->getRepository('Phraseanet:FeedItem')->find($item2->getId());
$this->assertEquals($ord1, (int) $newItem2->getOrd());
$this->assertEquals($ord2, (int) $newItem1->getOrd());
@@ -291,7 +291,7 @@ class FeedTest extends \PhraseanetAuthenticatedWebTestCase
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();
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));
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");
} catch (\Exception $e) {
@@ -321,7 +321,7 @@ class FeedTest extends \PhraseanetAuthenticatedWebTestCase
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();
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/');
$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) {
$path = CssSelector::toXPath("ul.submenu a[href='/prod/feeds/feed/" . $one_feed->getId() . "/']");
@@ -348,8 +348,8 @@ class FeedTest extends \PhraseanetAuthenticatedWebTestCase
public function testGetFeed()
{
$feed = self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Feed', 1);
$feeds = self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Feed')->getAllForUser(self::$DI['app']['acl']->get(self::$DI['user']));
$feed = self::$DI['app']['EM']->find('Phraseanet:Feed', 1);
$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() . "/");
foreach ($feeds as $one_feed) {
@@ -398,7 +398,7 @@ class FeedTest extends \PhraseanetAuthenticatedWebTestCase
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')
->disableOriginalConstructor()

View File

@@ -57,7 +57,7 @@ class LazaretTest extends \PhraseanetAuthenticatedWebTestCase
$em->expects($this->once())
->method('getRepository')
->with($this->EqualTo('Alchemy\Phrasea\Model\Entities\LazaretFile'))
->with($this->equalTo('Phraseanet:LazaretFile'))
->will($this->returnValue($repo));
$route = '/prod/lazaret/';
@@ -94,7 +94,7 @@ class LazaretTest extends \PhraseanetAuthenticatedWebTestCase
$em->expects($this->any())
->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));
self::$DI['app']['EM'] = $em;
@@ -138,7 +138,7 @@ class LazaretTest extends \PhraseanetAuthenticatedWebTestCase
$em->expects($this->any())
->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));
self::$DI['app']['EM'] = $em;
@@ -208,13 +208,13 @@ class LazaretTest extends \PhraseanetAuthenticatedWebTestCase
//Expect the retrieval of the lazaret file with the provided id
$em->expects($this->any())
->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));
//In any case we expect the deletion of the lazaret file
$em->expects($this->once())
->method('remove')
->with($this->EqualTo($lazaretFile));
->with($this->equalTo($lazaretFile));
//Then flush
$em->expects($this->once())
@@ -259,7 +259,7 @@ class LazaretTest extends \PhraseanetAuthenticatedWebTestCase
//Expect the retrieval of the lazaret file with the provided id
$em->expects($this->any())
->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));
self::$DI['app']['EM'] = $em;
@@ -321,7 +321,7 @@ class LazaretTest extends \PhraseanetAuthenticatedWebTestCase
$this->assertResponseOk($response);
$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();
@@ -344,7 +344,7 @@ class LazaretTest extends \PhraseanetAuthenticatedWebTestCase
$this->assertGoodJsonContent(json_decode($response->getContent()));
$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();
@@ -430,13 +430,13 @@ class LazaretTest extends \PhraseanetAuthenticatedWebTestCase
//Expect the retrieval of the lazaret file with the provided id
$em->expects($this->any())
->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));
//In any case we expect the deletion of the lazaret file
$em->expects($this->once())
->method('remove')
->with($this->EqualTo($lazaretFile));
->with($this->equalTo($lazaretFile));
//Then flush
$em->expects($this->once())
@@ -496,7 +496,7 @@ class LazaretTest extends \PhraseanetAuthenticatedWebTestCase
//Expect the retrieval of the lazaret file with the provided id
$em->expects($this->any())
->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));
$id = 1;
@@ -551,7 +551,7 @@ class LazaretTest extends \PhraseanetAuthenticatedWebTestCase
//Expect the retrieval of the lazaret file with the provided id
$em->expects($this->any())
->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));
self::$DI['app']['EM'] = $em;
@@ -598,7 +598,7 @@ class LazaretTest extends \PhraseanetAuthenticatedWebTestCase
//Expect the retrieval of the lazaret file with the provided id
$em->expects($this->any())
->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));
self::$DI['app']['EM'] = $em;

View File

@@ -197,7 +197,7 @@ class OrderTest extends \PhraseanetAuthenticatedWebTestCase
}
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());
}
@@ -218,13 +218,13 @@ class OrderTest extends \PhraseanetAuthenticatedWebTestCase
$parameters = [$order->getElements()->first()->getId()];
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());
$parameters = [$orderElement->getId()];
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());
}

View File

@@ -190,7 +190,7 @@ class RecordsTest extends \PhraseanetAuthenticatedWebTestCase
public function testGetRecordDetailBasket()
{
$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/', [
'env' => 'BASK',
@@ -226,7 +226,7 @@ class RecordsTest extends \PhraseanetAuthenticatedWebTestCase
->disableOriginalConstructor()
->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();
$this->XMLHTTPRequest('POST', '/prod/records/', [

View File

@@ -27,7 +27,7 @@ class StoryTest extends \PhraseanetAuthenticatedWebTestCase
$this->assertEquals(302, $response->getStatusCode());
$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();

View File

@@ -84,7 +84,7 @@ class UsrListsTest extends \PhraseanetAuthenticatedWebTestCase
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();
$route = '/prod/lists/list/' . $list_id . '/';
@@ -104,7 +104,7 @@ class UsrListsTest extends \PhraseanetAuthenticatedWebTestCase
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();
$route = '/prod/lists/list/' . $list_id . '/update/';
@@ -140,7 +140,7 @@ class UsrListsTest extends \PhraseanetAuthenticatedWebTestCase
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();
$route = '/prod/lists/list/' . $list_id . '/delete/';
@@ -159,14 +159,14 @@ class UsrListsTest extends \PhraseanetAuthenticatedWebTestCase
$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));
}
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();
$usr_id = $entry->getUser(self::$DI['app'])->get_id();
$entry_id = $entry->getId();
@@ -187,14 +187,14 @@ class UsrListsTest extends \PhraseanetAuthenticatedWebTestCase
$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));
}
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());
@@ -218,7 +218,7 @@ class UsrListsTest extends \PhraseanetAuthenticatedWebTestCase
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());
@@ -256,7 +256,7 @@ class UsrListsTest extends \PhraseanetAuthenticatedWebTestCase
$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());
@@ -265,7 +265,7 @@ class UsrListsTest extends \PhraseanetAuthenticatedWebTestCase
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());
@@ -285,7 +285,7 @@ class UsrListsTest extends \PhraseanetAuthenticatedWebTestCase
$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());
@@ -304,7 +304,7 @@ class UsrListsTest extends \PhraseanetAuthenticatedWebTestCase
$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());
@@ -315,7 +315,7 @@ class UsrListsTest extends \PhraseanetAuthenticatedWebTestCase
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());
@@ -367,7 +367,7 @@ class UsrListsTest extends \PhraseanetAuthenticatedWebTestCase
$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());

View File

@@ -40,7 +40,7 @@ class WorkZoneTest extends \PhraseanetAuthenticatedWebTestCase
$em = self::$DI['app']['EM'];
/* @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();
@@ -62,7 +62,7 @@ class WorkZoneTest extends \PhraseanetAuthenticatedWebTestCase
$em = self::$DI['app']['EM'];
/* @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();
$this->assertEquals(2, $count);
@@ -73,7 +73,7 @@ class WorkZoneTest extends \PhraseanetAuthenticatedWebTestCase
$story = self::$DI['record_story_2'];
$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()]]);
$response = self::$DI['client']->getResponse();
@@ -83,7 +83,7 @@ class WorkZoneTest extends \PhraseanetAuthenticatedWebTestCase
$em = self::$DI['app']['EM'];
/* @var $em \Doctrine\ORM\EntityManager */
$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();
@@ -131,7 +131,7 @@ class WorkZoneTest extends \PhraseanetAuthenticatedWebTestCase
self::$DI['client']->request('POST', $attachRoute, ['stories' => [$story->get_serialize_key()]]);
$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();
@@ -144,7 +144,7 @@ class WorkZoneTest extends \PhraseanetAuthenticatedWebTestCase
$this->assertEquals(302, $response->getStatusCode());
$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();

View File

@@ -158,7 +158,7 @@ class RecordsRequestTest extends \PhraseanetAuthenticatedTestCase
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()]);
$records = RecordsRequest::fromRequest(self::$DI['app'], $request);
@@ -240,6 +240,6 @@ class RecordsRequestTest extends \PhraseanetAuthenticatedTestCase
private function getStoryWZ()
{
return self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\StoryWZ', 1);
return self::$DI['app']['EM']->find('Phraseanet:StoryWZ', 1);
}
}

View File

@@ -1017,7 +1017,7 @@ class LoginTest extends \PhraseanetAuthenticatedWebTestCase
$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']);
$this->assertCount(1, $ret);
@@ -1520,7 +1520,7 @@ class LoginTest extends \PhraseanetAuthenticatedWebTestCase
$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']);
$this->assertCount(1, $ret);
@@ -1595,7 +1595,7 @@ class LoginTest extends \PhraseanetAuthenticatedWebTestCase
$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']);
$this->assertCount(1, $ret);
@@ -1760,7 +1760,7 @@ class LoginTest extends \PhraseanetAuthenticatedWebTestCase
self::$DI['app']['EM']->expects($this->at(0))
->method('getRepository')
->with('Alchemy\Phrasea\Model\Entities\UsrAuthProvider')
->with('Phraseanet:UsrAuthProvider')
->will($this->returnValue($repo));
if ($participants) {
@@ -1774,7 +1774,7 @@ class LoginTest extends \PhraseanetAuthenticatedWebTestCase
self::$DI['app']['EM']->expects($this->at(1))
->method('getRepository')
->with('Alchemy\Phrasea\Model\Entities\ValidationParticipant')
->with('Phraseanet:ValidationParticipant')
->will($this->returnValue($repo));
}
}

View File

@@ -14,7 +14,7 @@ class RSSFeedTest extends \PhraseanetWebTestCase
{
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/');
$response = self::$DI['client']->getResponse();
@@ -59,7 +59,7 @@ class RSSFeedTest extends \PhraseanetWebTestCase
public function testPublicFeed()
{
$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/");
$response = self::$DI['client']->getResponse();
@@ -72,7 +72,7 @@ class RSSFeedTest extends \PhraseanetWebTestCase
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();
$this->logout(self::$DI['app']);
@@ -88,7 +88,7 @@ class RSSFeedTest extends \PhraseanetWebTestCase
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();
$this->logout(self::$DI['app']);
@@ -103,7 +103,7 @@ class RSSFeedTest extends \PhraseanetWebTestCase
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/");
$this->assertEquals("application/rss+xml", self::$DI['client']->getResponse()->headers->get("content-type"));
@@ -121,7 +121,7 @@ class RSSFeedTest extends \PhraseanetWebTestCase
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/");
$this->assertTrue(self::$DI['client']->getResponse()->isOk());
@@ -132,7 +132,7 @@ class RSSFeedTest extends \PhraseanetWebTestCase
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) {
$this->assertTrue($feed->isPublic());
@@ -146,7 +146,7 @@ class RSSFeedTest extends \PhraseanetWebTestCase
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) {
$this->assertTrue($feed->isPublic());
@@ -173,7 +173,7 @@ class RSSFeedTest extends \PhraseanetWebTestCase
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/");
$this->assertTrue(self::$DI['client']->getResponse()->isOk());
@@ -189,7 +189,7 @@ class RSSFeedTest extends \PhraseanetWebTestCase
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/");
$this->assertFalse(self::$DI['client']->getResponse()->isOk());
$this->assertEquals(403, self::$DI['client']->getResponse()->getStatusCode());

View File

@@ -39,7 +39,7 @@ class BasketMiddlewareProviderTest extends MiddlewareProviderTestCase
$this->authenticate(self::$DI['app']);
self::$DI['app']->register(new BasketMiddlewareProvider());
$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());
call_user_func(self::$DI['app']['middleware.basket.converter'], $request, self::$DI['app']);
$this->assertSame($basket, $request->attributes->get('basket'));
@@ -59,7 +59,7 @@ class BasketMiddlewareProviderTest extends MiddlewareProviderTestCase
$this->authenticate(self::$DI['app']);
self::$DI['app']->register(new BasketMiddlewareProvider());
$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);
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']);
self::$DI['app']->register(new BasketMiddlewareProvider());
$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);
$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']);

View File

@@ -12,7 +12,7 @@ class ORMServiceProviderTest extends ServiceProviderTestCase
return [
['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.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.events-manager', 'Doctrine\\Common\\EventManager'],
];

Some files were not shown because too many files have changed in this diff Show More