Fix latest merge

This commit is contained in:
Nicolas Le Goff
2014-06-24 00:34:07 +02:00
parent e711f9002e
commit 3bdb63f94e
10 changed files with 25 additions and 136 deletions

View File

@@ -70,10 +70,6 @@ use Alchemy\Phrasea\Controller\Thesaurus\Xmlhttp as ThesaurusXMLHttp;
use Alchemy\Phrasea\Controller\User\Notifications; use Alchemy\Phrasea\Controller\User\Notifications;
use Alchemy\Phrasea\Controller\User\Preferences; use Alchemy\Phrasea\Controller\User\Preferences;
use Alchemy\Phrasea\Core\PhraseaExceptionHandler; use Alchemy\Phrasea\Core\PhraseaExceptionHandler;
use Alchemy\Phrasea\Core\Event\Subscriber\LogoutSubscriber;
use Alchemy\Phrasea\Core\Event\Subscriber\PhraseaLocaleSubscriber;
use Alchemy\Phrasea\Core\Event\Subscriber\MaintenanceSubscriber;
use Alchemy\Phrasea\Core\Event\Subscriber\CookiesDisablerSubscriber;
use Alchemy\Phrasea\Core\Event\Subscriber\PhraseaInstallSubscriber; use Alchemy\Phrasea\Core\Event\Subscriber\PhraseaInstallSubscriber;
use Alchemy\Phrasea\Core\Middleware\ApiApplicationMiddlewareProvider; use Alchemy\Phrasea\Core\Middleware\ApiApplicationMiddlewareProvider;
use Alchemy\Phrasea\Core\Middleware\BasketMiddlewareProvider; use Alchemy\Phrasea\Core\Middleware\BasketMiddlewareProvider;
@@ -156,9 +152,6 @@ use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpKernel\HttpKernelInterface; use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Generator\UrlGenerator;
use Symfony\Component\Form\FormFactory;
use Symfony\Component\Form\FormTypeInterface; use Symfony\Component\Form\FormTypeInterface;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormInterface; use Symfony\Component\Form\FormInterface;

View File

@@ -101,8 +101,8 @@ class Session implements ControllerProviderInterface
$ret['message'] .= _('The application is going down for maintenance, please logout.'); $ret['message'] .= _('The application is going down for maintenance, please logout.');
} }
if ($app['phraseanet.registry']->get('GV_message_on')) { if ($app['conf']->get(['registry', 'maintenance', 'enabled'], false)) {
$ret['message'] .= strip_tags($app['phraseanet.registry']->get('GV_message')); $ret['message'] .= strip_tags($app['conf']->get(['registry', 'maintenance', 'enabled']));
} }
} }

View File

@@ -43,7 +43,13 @@ class EmailFormType extends AbstractType
$builder->add('smtp-user', 'text', [ $builder->add('smtp-user', 'text', [
'label' => 'SMTP user', 'label' => 'SMTP user',
]); ]);
$builder->add('smtp-password', 'text', [ $builder->add('hidden-password', 'password', [
'label' => false,
'attr' => array(
'style' => 'display:none'
)
]);
$builder->add('smtp-password', 'password', [
'label' => 'SMTP password', 'label' => 'SMTP password',
]); ]);
} }

View File

@@ -59,7 +59,7 @@ class EmptyCollectionJob extends AbstractJob
$settings = simplexml_load_string($task->getSettings()); $settings = simplexml_load_string($task->getSettings());
$baseId = (string) $settings->base_id; $baseId = (string) $settings->bas_id;
$collection = \collection::get_from_base_id($app, $baseId); $collection = \collection::get_from_base_id($app, $baseId);
$collection->empty_collection(200); $collection->empty_collection(200);

View File

@@ -786,12 +786,6 @@ class set_export extends set_abstract
} }
} }
$export_types = array(
'download' => 0,
'mail-export' => 2,
'ftp' => 4
);
$list_base = array_unique(array_keys($tmplog)); $list_base = array_unique(array_keys($tmplog));
if (!$anonymous) { if (!$anonymous) {

View File

@@ -28,34 +28,6 @@
bodySize.x = $(window).width(); bodySize.x = $(window).width();
} }
function pollNotifications(){
$.ajax({
type: "POST",
url: "{{ path('list_notifications') }}",
dataType: 'json',
data: {
module : 3,
usr : {{ app['authentication'].getUser().getId() }}
},
error: function(){
window.setTimeout("pollNotifications();", 10000);
},
timeout: function(){
window.setTimeout("pollNotifications();", 10000);
},
success: function(data){
if (data) {
manageSession(data);
}
var t = 120000;
if (data.apps && parseInt(data.apps) > 1) {
t = Math.round((Math.sqrt(parseInt(data.apps)-1) * 1.3 * 120000));
}
window.setTimeout("pollNotifications();", t);
}
});
}
var language = { var language = {
serverName: '{{ app['conf'].get('servername') | e('js') }}', serverName: '{{ app['conf'].get('servername') | e('js') }}',
serverError: '{{ 'phraseanet::erreur: Une erreur est survenue, si ce probleme persiste, contactez le support technique' | trans | e('js') }}', serverError: '{{ 'phraseanet::erreur: Une erreur est survenue, si ce probleme persiste, contactez le support technique' | trans | e('js') }}',
@@ -79,88 +51,14 @@
reset_template_ask_choice: '{{ 'Would you like to reset rights before applying the template?' | trans | e('js') }}' reset_template_ask_choice: '{{ 'Would you like to reset rights before applying the template?' | trans | e('js') }}'
}; };
//
// function enableFormsCallback(datas)
// {
// $('#right-ajax').removeClass('loading').html(datas);
// enableForms($('#right-ajax form:not(.no-ajax)'));
//
// $.each($('#right-ajax a:not(.no-ajax)'),function(i, el){
// enableLink($(el));
// });
// return;
// }
//
// function enableLink(link) {
// $(link).bind('click',function(event){
// var dest = link.attr('href');
//
// if(dest && dest.indexOf('#') !== 0) {
// $('#right-ajax').empty().addClass('loading').parent().show();
//
// $.get(dest, function(data) {
// enableFormsCallback(data);
// });
// }
// });
// }
// function activeTree(click) {
// $('#FNDR').treeview({
// collapsed: true,
// animated: "medium"
// });
//
// $.each($('#tree a[target=right]'),function(){
// var dest = $(this).attr('href');
//
// $(this).bind('click',function(){
// $('#right-ajax').empty().addClass('loading').parent().show();
//
// $.get(dest, function(data) {
// enableFormsCallback(data);
// });
//
// $('#tree .selected').removeClass('selected');
// $(this).parent().addClass('selected');
//
// return false;
// });
//
// $(this).removeAttr('target');
// });
//
// if(click === true) {
// if($('#tree .selected').length > 0)
// $('#tree .selected a').trigger('click');
// else
// $('.zone_online_users').trigger('click');
// }
// }
$(window).bind('resize',function(){resize();}); $(window).bind('resize',function(){resize();});
// function reloadTree(position, click){
// $.ajax({
// type: "GET",
// url: "/admin/tree/",
// data: {
// position : position
// },
// success: function(datas){
// $('#FNDR').empty().append(datas);
// activeTree(click);
//
// return;
// }
// });
// }
</script> </script>
<script type="text/javascript" src="{{ path('minifier', { 'f' : '/assets/requirejs/require.js,/scripts/apps/admin/require.config.js,/scripts/apps/admin/main/main.js' }) }}"></script> <script type="text/javascript" src="{{ path('minifier', { 'f' : '/assets/requirejs/require.js,/scripts/apps/admin/require.config.js,/scripts/apps/admin/main/main.js' }) }}"></script>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div id="admin-app" data-usr="{{ app['authentication'].getUser().getId() }}"> <div id="admin-app" data-usr="{{ app['authentication'].getUser().getId() }}" data-notif-url="{{ path('list_notifications') }}">
<div id="left" class="PNB left-view" style="width:250px;right:auto;" data-tree-url="{{ path("admin_display_tree") }}" data-websocket="{{ "ws://" ~ app["conf"].get(["main" ,"websocket-server", "host"]) ~ ":" ~ app["conf"].get(["main" ,"websocket-server", "port"]) ~ "/websockets" }}"> <div id="left" class="PNB left-view" style="width:250px;right:auto;" data-tree-url="{{ path("admin_display_tree") }}" data-websocket="{{ "ws://" ~ app["conf"].get(["main" ,"websocket-server", "host"]) ~ ":" ~ app["conf"].get(["main" ,"websocket-server", "port"]) ~ "/websockets" }}">
<div class="PNB10" style="right:0"> <div class="PNB10" style="right:0">
<div id="FNDR"> <div id="FNDR">

View File

@@ -1,12 +1,10 @@
{% macro audio_player(thumbnail, url, original_w, original_h, fit) %} {% macro audio_player(thumbnail, url, original_w, original_h, fit) %}
{% set random = thumbnail.get_random() %} {% set random = thumbnail.get_random() %}
<div class="record record_audio audioTips" style="width:{{fit.width}}px;height:{{fit.height}}px;top:{{fit.top}}px;"> <div class="record record_audio audioTips" style="width:{{fit.width}}px;height:{{fit.height}}px;top:{{fit.top}}px;">
<div id="preview_{{thumbnail.get_sbas_id()}}_{{thumbnail.get_record_id()}}_{{random}}" class="PNB" style=""></div> <div id="preview_{{thumbnail.get_sbas_id()}}_{{thumbnail.get_record_id()}}_{{random}}" class="PNB" style=""></div>
<input type="hidden" name="width" value="{{original_w}}"/> <input type="hidden" name="width" value="{{original_w}}"/>
<input type="hidden" name="height" value="{{original_h}}"/> <input type="hidden" name="height" value="{{original_h}}"/>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
swfobject.embedSWF( swfobject.embedSWF(
"/include/jslibs/audio-player/player.swf", "/include/jslibs/audio-player/player.swf",

View File

@@ -91,7 +91,7 @@
</div> </div>
<div style="display:none"> <div style="display:none">
<form name="download" action="{{ path('document_download', {'token': token.getValue()}) }}" method="post" target="file_frame"> <form name="download" action="{{ path('document_download', {'token': token.getValue(), 'type': type, 'anonymous': anonymous}) }}" method="post" target="file_frame">
{% if anonymous %} {% if anonymous %}
<input type="hidden" name="anonymous" value="1" /> <input type="hidden" name="anonymous" value="1" />
{% endif%} {% endif%}

View File

@@ -587,7 +587,7 @@ class LoginTest extends \PhraseanetAuthenticatedWebTestCase
$crawler = self::$DI['client']->request('POST', '/login/register-classic/'); $crawler = self::$DI['client']->request('POST', '/login/register-classic/');
$this->assertFalse(self::$DI['client']->getResponse()->isRedirect()); $this->assertFalse(self::$DI['client']->getResponse()->isRedirect());
$this->assertFormOrFlashError($crawler, self::$DI['app']['conf']->get(['registry', 'registration', 'auto-select-collections']) ? 6 : 7); $this->assertFormOrFlashError($crawler, self::$DI['app']['conf']->get(['registry', 'registration', 'auto-select-collections']) ? 7 : 8);
} }
public function provideInvalidRegistrationData() public function provideInvalidRegistrationData()

View File

@@ -22,32 +22,32 @@ define([
eventManager: _.extend({}, Backbone.Events) eventManager: _.extend({}, Backbone.Events)
}; };
var sessionActive = function() { var pullNotifications = function (){
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "/session/update/", url: AdminApp.$scope.data("notif-url"),
dataType: 'json', dataType: 'json',
data: { data: {
module : 3, module : 3,
usr : AdminApp.$scope.data("usr") usr : AdminApp.$scope.data("usr")
}, },
error: function(){ error: function(){
window.setTimeout(function() {sessionActive();}, 10000); window.setTimeout("pollNotifications();", 10000);
}, },
timeout: function(){ timeout: function(){
window.setTimeout(function() {sessionActive();}, 10000); window.setTimeout("pollNotifications();", 10000);
}, },
success: function(data){ success: function(data){
if(data) { if (data) {
manageSession(data); manageSession(data);
}
var t = 120000; var t = 120000;
if(data.apps && parseInt(data.apps)>1) { if (data.apps && parseInt(data.apps) > 1) {
t = Math.round((Math.sqrt(parseInt(data.apps)-1) * 1.3 * 120000)); t = Math.round((Math.sqrt(parseInt(data.apps)-1) * 1.3 * 120000));
} }
window.setTimeout(function() {sessionActive();}, t); window.setTimeout("pollNotifications();", t);
} }
} });
})
}; };
var create = function() { var create = function() {
@@ -77,7 +77,7 @@ define([
AdminApp.LeftView.activeTree(); AdminApp.LeftView.activeTree();
AdminApp.LeftView.clickSelected(); AdminApp.LeftView.clickSelected();
window.setTimeout(function() {sessionActive();}, 15000); window.setTimeout(function() {pullNotifications();}, 15000);
}; };
return { return {