mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 09:53:15 +00:00
PHRAS-350 Deprecate client
This commit is contained in:
@@ -63,7 +63,7 @@
|
|||||||
"doctrine/data-fixtures" : "1.0.x@dev",
|
"doctrine/data-fixtures" : "1.0.x@dev",
|
||||||
"phpunit/phpunit" : "~3.7",
|
"phpunit/phpunit" : "~3.7",
|
||||||
"behat/behat" : "~2.4",
|
"behat/behat" : "~2.4",
|
||||||
"behat/mink" : "~1.4",
|
"behat/mink" : "~1.4",
|
||||||
"behat/mink-extension" : "~1.0",
|
"behat/mink-extension" : "~1.0",
|
||||||
"behat/mink-goutte-driver" : "~1.0",
|
"behat/mink-goutte-driver" : "~1.0",
|
||||||
"behat/mink-selenium2-driver" : "~1.0",
|
"behat/mink-selenium2-driver" : "~1.0",
|
||||||
|
@@ -27,6 +27,17 @@ class Root implements ControllerProviderInterface
|
|||||||
$controllers = $app['controllers_factory'];
|
$controllers = $app['controllers_factory'];
|
||||||
|
|
||||||
$controllers->before(function (Request $request) use ($app) {
|
$controllers->before(function (Request $request) use ($app) {
|
||||||
|
/**
|
||||||
|
* /!\/!\/!\/!\/!\/!\/!\/!\/!\
|
||||||
|
*
|
||||||
|
* Client is not longer used
|
||||||
|
*
|
||||||
|
* Redirect to production with a nice message
|
||||||
|
*/
|
||||||
|
$app['session']->getFlashBag()->add('client_deprecated');
|
||||||
|
|
||||||
|
return $app->redirectPath('prod');
|
||||||
|
|
||||||
if (!$app['authentication']->isAuthenticated() && null !== $request->query->get('nolog')) {
|
if (!$app['authentication']->isAuthenticated() && null !== $request->query->get('nolog')) {
|
||||||
return $app->redirectPath('login_authenticate_as_guest', array('redirect' => 'client'));
|
return $app->redirectPath('login_authenticate_as_guest', array('redirect' => 'client'));
|
||||||
}
|
}
|
||||||
|
@@ -8,29 +8,11 @@
|
|||||||
</li>
|
</li>
|
||||||
{% if module != "lightbox" and app['authentication'].isAuthenticated() %}
|
{% if module != "lightbox" and app['authentication'].isAuthenticated() %}
|
||||||
<li>
|
<li>
|
||||||
{% if module == "prod" %}
|
<a target="_blank" href="{{ path('prod') }}">
|
||||||
<a target="_self" href="{{ path('get_client') }}">
|
|
||||||
<span class="">
|
<span class="">
|
||||||
{% trans 'admin::monitor: Ancienne version (client)' %}
|
{% trans 'admin::monitor: production' %}
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
{% else %}
|
|
||||||
{% if app['browser'].isNewGeneration %}
|
|
||||||
{% if module == "client" %}
|
|
||||||
<a target="_self" href="{{ path('prod') }}">
|
|
||||||
<span class="">
|
|
||||||
{% trans 'admin::monitor: Nouvelle version (prod)' %}
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
{% else %}
|
|
||||||
<a target="_blank" href="{{ path('prod') }}">
|
|
||||||
<span class="">
|
|
||||||
{% trans 'admin::monitor: production' %}
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
{% if app['browser'].isNewGeneration and app['phraseanet.registry'].get('GV_thesaurus') == true and app['authentication'].getUser().ACL.has_access_to_module('thesaurus') %}
|
{% if app['browser'].isNewGeneration and app['phraseanet.registry'].get('GV_thesaurus') == true and app['authentication'].getUser().ACL.has_access_to_module('thesaurus') %}
|
||||||
@@ -95,7 +77,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{# MODULE #}
|
{# MODULE #}
|
||||||
{% if module == "prod" or module == "client" %}
|
{% if module == "prod" %}
|
||||||
<li>
|
<li>
|
||||||
<a href="#" onclick="getHome('PUBLI');" >
|
<a href="#" onclick="getHome('PUBLI');" >
|
||||||
<span>
|
<span>
|
||||||
@@ -122,7 +104,7 @@
|
|||||||
<div class="PNB" style="left:auto;overflow:hidden;">
|
<div class="PNB" style="left:auto;overflow:hidden;">
|
||||||
<ol>
|
<ol>
|
||||||
|
|
||||||
{% if app['authentication'].isAuthenticated() and (module == "client" or module == "prod") %}
|
{% if app['authentication'].isAuthenticated() and module == "prod" %}
|
||||||
<li id="notification_trigger">
|
<li id="notification_trigger">
|
||||||
<a href="#" style="font-weight:bold;text-decoration:none;">
|
<a href="#" style="font-weight:bold;text-decoration:none;">
|
||||||
<span>
|
<span>
|
||||||
@@ -192,7 +174,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if app['authentication'].isAuthenticated() and (module == "client" or module == "prod") %}
|
{% if app['authentication'].isAuthenticated() and module == "prod" %}
|
||||||
<div style="display:none;z-index:30000;" id="notification_box">
|
<div style="display:none;z-index:30000;" id="notification_box">
|
||||||
{% set notifications = app['events-manager'].get_notifications %}
|
{% set notifications = app['events-manager'].get_notifications %}
|
||||||
{% include 'prod/notifications.html.twig' %}
|
{% include 'prod/notifications.html.twig' %}
|
||||||
|
@@ -119,6 +119,20 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="desktop" class="PNB" style="overflow:hidden;">
|
<div id="desktop" class="PNB" style="overflow:hidden;">
|
||||||
|
{% if app.flash('client_deprecated') %}
|
||||||
|
<div id="clientModal" class="modal hide fade" >
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||||
|
<h3>{{ 'Client application is deprecated'|trans }}</h3>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<p>{{ 'You have been redirected to production application.'|trans }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$('#clientModal').modal();
|
||||||
|
</script>
|
||||||
|
{% endif %}
|
||||||
{% set ratio = app['authentication'].getUser().getPrefs('search_window') %}
|
{% set ratio = app['authentication'].getUser().getPrefs('search_window') %}
|
||||||
{% if ratio == 0 %}
|
{% if ratio == 0 %}
|
||||||
{% set ratio = '0.333' %}
|
{% set ratio = '0.333' %}
|
||||||
|
@@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
namespace Alchemy\Tests\Phrasea\Controller\Client;
|
namespace Alchemy\Tests\Phrasea\Controller\Client;
|
||||||
|
|
||||||
use Alchemy\Phrasea\SearchEngine\SearchEngineOptions;
|
|
||||||
|
|
||||||
class RootTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
class RootTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||||
{
|
{
|
||||||
protected $client;
|
protected $client;
|
||||||
@@ -25,57 +23,6 @@ class RootTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
{
|
{
|
||||||
$this->authenticate(self::$DI['app']);
|
$this->authenticate(self::$DI['app']);
|
||||||
self::$DI['client']->request("GET", "/client/");
|
self::$DI['client']->request("GET", "/client/");
|
||||||
$this->assertTrue(self::$DI['client']->getResponse()->isOk());
|
$this->assertTrue(self::$DI['client']->getResponse()->isRedirect());
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Alchemy\Phrasea\Controller\Client\Root::getClientLanguage
|
|
||||||
*/
|
|
||||||
public function testGetLanguage()
|
|
||||||
{
|
|
||||||
self::$DI['client']->request("GET", "/client/language/");
|
|
||||||
$this->assertTrue(self::$DI['client']->getResponse()->isOk());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Alchemy\Phrasea\Controller\Client\Root::getClientPublications
|
|
||||||
*/
|
|
||||||
public function testGetPublications()
|
|
||||||
{
|
|
||||||
self::$DI['client']->request("GET", "/client/publications/");
|
|
||||||
$this->assertTrue(self::$DI['client']->getResponse()->isOk());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Alchemy\Phrasea\Controller\Client\Root::getClientHelp
|
|
||||||
*/
|
|
||||||
public function testGetClientHelp()
|
|
||||||
{
|
|
||||||
self::$DI['client']->request("GET", "/client/help/");
|
|
||||||
$this->assertTrue(self::$DI['client']->getResponse()->isOk());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Alchemy\Phrasea\Controller\Client\Root::query
|
|
||||||
* @covers Alchemy\Phrasea\Controller\Client\Root::buildQueryFromRequest
|
|
||||||
*/
|
|
||||||
public function testExecuteQuery()
|
|
||||||
{
|
|
||||||
$queryParameters = array();
|
|
||||||
$queryParameters["mod"] = self::$DI['user']->getPrefs('client_view') ? : '3X6';
|
|
||||||
$queryParameters["bas"] = array_keys(self::$DI['user']->ACL()->get_granted_base());
|
|
||||||
$queryParameters["qry"] = self::$DI['user']->getPrefs('start_page_query') ? : 'all';
|
|
||||||
$queryParameters["pag"] = 0;
|
|
||||||
$queryParameters["search_type"] = SearchEngineOptions::RECORD_RECORD;
|
|
||||||
$queryParameters["qryAdv"] = '';
|
|
||||||
$queryParameters["opAdv"] = array();
|
|
||||||
$queryParameters["status"] = array();
|
|
||||||
$queryParameters["recordtype"] = SearchEngineOptions::TYPE_ALL;
|
|
||||||
$queryParameters["sort"] = self::$DI['app']['phraseanet.registry']->get('GV_phrasea_sort', '');
|
|
||||||
$queryParameters["infield"] = array();
|
|
||||||
$queryParameters["ord"] = SearchEngineOptions::SORT_MODE_DESC;
|
|
||||||
|
|
||||||
self::$DI['client']->request("POST", "/client/query/", $queryParameters);
|
|
||||||
$this->assertTrue(self::$DI['client']->getResponse()->isOk());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -4253,3 +4253,11 @@ ui-dialog-titlebar {
|
|||||||
position: relative;
|
position: relative;
|
||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#clientModal, #clientModal .modal-footer {
|
||||||
|
background-color: #404040;
|
||||||
|
}
|
||||||
|
|
||||||
|
#clientModal .close {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
@@ -4376,3 +4376,12 @@ ui-dialog-titlebar {
|
|||||||
position: relative;
|
position: relative;
|
||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#clientModal, #clientModal .modal-footer {
|
||||||
|
background-color: #999999;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#clientModal .close {
|
||||||
|
color: #404040;
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user