From 5e2dd0216a1aa0203bc55ed1716415820efcfa5c Mon Sep 17 00:00:00 2001 From: Nicolas Le Goff Date: Tue, 24 Jun 2014 14:56:09 +0200 Subject: [PATCH] Fix latest merge --- .travis.yml | 3 +- composer.json | 9 +- composer.lock | 43 +++--- lib/Alchemy/Phrasea/Controller/Api/V1.php | 6 +- lib/Alchemy/Phrasea/Controller/Prod/Feed.php | 2 +- .../web/login/layout/base-layout.html.twig | 1 - .../prod/actions/publish/publish.html.twig | 128 ++++++++-------- .../actions/publish/publish_edit.html.twig | 142 +++++++++--------- .../web/prod/feeds/entry_macro.html.twig | 2 +- templates/web/prod/index.html.twig | 1 - templates/web/prod/results/record.html.twig | 1 - www/skins/prod/000000/prodcolor.css | 27 ---- www/skins/prod/959595/prodcolor.css | 26 ---- www/skins/prod/jquery.main-prod.js | 81 +++++----- 14 files changed, 203 insertions(+), 269 deletions(-) diff --git a/.travis.yml b/.travis.yml index b4cd208cfa..b5fadb26aa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -65,4 +65,5 @@ script: #sqlite db generation should occur once Phraseanet is up to date : - bin/developer phraseanet:regenerate-sqlite - ./node_modules/.bin/grunt test - - bin/phpunit + - phpunit --version + - phpunit diff --git a/composer.json b/composer.json index 62ecab7dfb..e3a25a51fd 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,6 @@ "url": "https://github.com/nlegoff/Media-Alchemyst" } ], - "minimum-stability" : "dev", "require": { "php" : ">=5.4", "alchemy/oauth2php" : "1.0.0", @@ -89,12 +88,6 @@ "behat/mink-selenium2-driver" : "~1.0", "fabpot/goutte" : "~1.0" }, - "repositories": [ - { - "type": "git", - "url": "https://github.com/alchemy-fr/tcpdf-clone" - } - ], "autoload": { "psr-0": { "" : "lib/classes", @@ -104,7 +97,7 @@ "include-path": ["vendor/zend/gdata/library"], "extra": { "branch-alias": { - "dev-master": "3.9-dev" + "dev-master": "3.9.x-dev" } } } diff --git a/composer.lock b/composer.lock index f293c7521e..eea880c49f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "0100d89768804d2f4b902a41e75b64d1", + "hash": "ec7feed650089f0abf08f741e3ee9768", "packages": [ { "name": "alchemy-fr/tcpdf-clone", @@ -1075,16 +1075,16 @@ }, { "name": "doctrine/orm", - "version": "2.4.x-dev", + "version": "v2.4.3", "source": { "type": "git", "url": "https://github.com/doctrine/doctrine2.git", - "reference": "84f8ef5ca46f02f3001af47ba25fc917c776a247" + "reference": "8a13376d42b5ea467727ffe730aa0e14ca3c5e29" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/doctrine2/zipball/84f8ef5ca46f02f3001af47ba25fc917c776a247", - "reference": "84f8ef5ca46f02f3001af47ba25fc917c776a247", + "url": "https://api.github.com/repos/doctrine/doctrine2/zipball/8a13376d42b5ea467727ffe730aa0e14ca3c5e29", + "reference": "8a13376d42b5ea467727ffe730aa0e14ca3c5e29", "shasum": "" }, "require": { @@ -1147,7 +1147,7 @@ "database", "orm" ], - "time": "2014-06-10 11:49:09" + "time": "2014-06-10 11:49:08" }, { "name": "elasticsearch/elasticsearch", @@ -4784,39 +4784,38 @@ }, { "name": "phpunit/phpunit", - "version": "3.7.31", + "version": "3.7.37", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "d24e9877331039582497052cc3c4d9f465b88210" + "reference": "ae6cefd7cc84586a5ef27e04bae11ee940ec63dc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/d24e9877331039582497052cc3c4d9f465b88210", - "reference": "d24e9877331039582497052cc3c4d9f465b88210", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ae6cefd7cc84586a5ef27e04bae11ee940ec63dc", + "reference": "ae6cefd7cc84586a5ef27e04bae11ee940ec63dc", "shasum": "" }, "require": { + "ext-ctype": "*", "ext-dom": "*", + "ext-json": "*", "ext-pcre": "*", "ext-reflection": "*", "ext-spl": "*", "php": ">=5.3.3", - "phpunit/php-code-coverage": "~1.2.1", - "phpunit/php-file-iterator": ">=1.3.1", - "phpunit/php-text-template": ">=1.1.1", - "phpunit/php-timer": ">=1.0.4", - "phpunit/phpunit-mock-objects": "~1.2.0", + "phpunit/php-code-coverage": "~1.2", + "phpunit/php-file-iterator": "~1.3", + "phpunit/php-text-template": "~1.1", + "phpunit/php-timer": "~1.0", + "phpunit/phpunit-mock-objects": "~1.2", "symfony/yaml": "~2.0" }, "require-dev": { - "pear-pear/pear": "1.9.4" + "pear-pear.php.net/pear": "1.9.4" }, "suggest": { - "ext-json": "*", - "ext-simplexml": "*", - "ext-tokenizer": "*", - "phpunit/php-invoker": ">=1.1.0,<1.2.0" + "phpunit/php-invoker": "~1.1" }, "bin": [ "composer/bin/phpunit" @@ -4854,7 +4853,7 @@ "testing", "xunit" ], - "time": "2014-02-03 07:46:27" + "time": "2014-04-30 12:24:19" }, { "name": "phpunit/phpunit-mock-objects", @@ -4920,7 +4919,7 @@ "package": "php-ffmpeg/php-ffmpeg" } ], - "minimum-stability": "dev", + "minimum-stability": "stable", "stability-flags": { "alchemy/task-manager": 20, "alchemy/zippy": 20, diff --git a/lib/Alchemy/Phrasea/Controller/Api/V1.php b/lib/Alchemy/Phrasea/Controller/Api/V1.php index 65bdfa5c0b..020aae1b5b 100644 --- a/lib/Alchemy/Phrasea/Controller/Api/V1.php +++ b/lib/Alchemy/Phrasea/Controller/Api/V1.php @@ -1413,10 +1413,10 @@ class V1 implements ControllerProviderInterface return Result::create($request, [])->createResponse(); } - $offset_start = (int) ($request->get('offset_start') ? : 0); - $per_page = (int) ($request->get('per_page') ? : 5); + $offset_start = (int) $request->get('offset_start', 0); + $per_page = (int) $request->get('per_page', 5); - $per_page = (($per_page >= 1) && ($per_page <= 20)) ? $per_page : 5; + $per_page = (($per_page >= 1) && ($per_page <= 100)) ? $per_page : 100; $data = [ 'feed' => $this->list_publication($feed, $user), diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Feed.php b/lib/Alchemy/Phrasea/Controller/Prod/Feed.php index 5986696591..a710342273 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Feed.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Feed.php @@ -107,7 +107,7 @@ class Feed implements ControllerProviderInterface return new Response($datas); }) - ->bind('feed_entry_edit') + ->bind('prod_feeds_entry_edit') ->assert('id', '\d+') ->before(function (Request $request) use ($app) { $app['firewall']->requireRight('bas_chupub'); diff --git a/templates/web/login/layout/base-layout.html.twig b/templates/web/login/layout/base-layout.html.twig index 711765e89c..74503d7930 100644 --- a/templates/web/login/layout/base-layout.html.twig +++ b/templates/web/login/layout/base-layout.html.twig @@ -19,7 +19,6 @@ - {% endblock header_meta %} diff --git a/templates/web/prod/actions/publish/publish.html.twig b/templates/web/prod/actions/publish/publish.html.twig index 097df8697a..b41541105f 100644 --- a/templates/web/prod/actions/publish/publish.html.twig +++ b/templates/web/prod/actions/publish/publish.html.twig @@ -14,71 +14,73 @@ } -
-
- {% for record in publishing %} -
- {{ _self.format_diapo(record) }} -
- - -
-
- {% endfor %} + - -
- -
-
-
- {% set title = '' %} - {% set desc = '' %} - {% if publishing.basket() is not null %} - {% set title = publishing.basket().getName() %} - {% set desc = publishing.basket().getDescription() %} - {% endif %} - -
- - - - - - - - -
-
-
-
-

{{ 'Fils disponibles' | trans }}

-
- {% for feed in feeds %} - {% if feed.isPublisher(app['authentication'].getUser()) %} -
- {{ feed.getTitle() }} - {% if feed.isPublic() %} - - {% endif %} - -
- {% endif %} - {% endfor %} - -
-
-
-
-
-
- - -
-
-
- diff --git a/templates/web/prod/feeds/entry_macro.html.twig b/templates/web/prod/feeds/entry_macro.html.twig index a3f509d4ac..2edf5ce097 100644 --- a/templates/web/prod/feeds/entry_macro.html.twig +++ b/templates/web/prod/feeds/entry_macro.html.twig @@ -20,7 +20,7 @@ {% if entry.getFeed().isOwner(app['authentication'].getUser()) or entry.isPublisher(app['authentication'].getUser()) %} - + diff --git a/templates/web/prod/index.html.twig b/templates/web/prod/index.html.twig index f3c1cad9be..872368ff7f 100644 --- a/templates/web/prod/index.html.twig +++ b/templates/web/prod/index.html.twig @@ -1012,7 +1012,6 @@
- diff --git a/templates/web/prod/results/record.html.twig b/templates/web/prod/results/record.html.twig index 17ebc3db63..cc15c3d44b 100644 --- a/templates/web/prod/results/record.html.twig +++ b/templates/web/prod/results/record.html.twig @@ -94,6 +94,5 @@
- {% endmacro %} diff --git a/www/skins/prod/000000/prodcolor.css b/www/skins/prod/000000/prodcolor.css index f472f948f3..0810495f11 100644 --- a/www/skins/prod/000000/prodcolor.css +++ b/www/skins/prod/000000/prodcolor.css @@ -3134,7 +3134,6 @@ dans l'onglet thesaurus : arbres, menus contextuels } .PushBox .theme-bg .btn, -#modal_feed form .btn, #QuickAddUser .btn { font-family: verdana,"Helvetica Neue",Helvetica,Arial,sans-serif; font-size: 12px; @@ -3145,22 +3144,16 @@ dans l'onglet thesaurus : arbres, menus contextuels } .PushBox .theme-bg .btn-inverse, -#modal_feed form .btn-inverse, #QuickAddUser .btn-inverse { *border: 1px solid #515151; color: #AAAAAA; } .PushBox .theme-bg .btn-inverse:hover, -#modal_feed form .btn-inverse:hover, #QuickAddUser .btn-inverse:hover { color: #FFFFFF; } -#modal_feed form .fields { - overflow: auto; -} - #modal_feed form .feeds { overflow: auto; } @@ -3201,26 +3194,6 @@ dans l'onglet thesaurus : arbres, menus contextuels border: 1px solid red; } -#modal_feed form input, -#modal_feed form textarea { - width: 90%; - height: 20px; - margin: 3px 0 10px 0; -} - -#modal_feed form label { - display:inline; -} - -#modal_feed form input.checkbox { - width: 20px; -} - -#modal_feed form textarea { - height: 60px; - resize: none; -} - /******* FEEDS ****************************************************************/ #answers .feed { diff --git a/www/skins/prod/959595/prodcolor.css b/www/skins/prod/959595/prodcolor.css index 00c35bf4fc..b85aff8db9 100644 --- a/www/skins/prod/959595/prodcolor.css +++ b/www/skins/prod/959595/prodcolor.css @@ -3206,7 +3206,6 @@ dans l'onglet thesaurus : arbres, menus contextuels } .PushBox .theme-bg .btn-inverse, -#modal_feed form .btn-inverse, #QuickAddUser .btn-inverse { background-color: #D6D6D6; *background-color: #D6D6D6; @@ -3226,7 +3225,6 @@ dans l'onglet thesaurus : arbres, menus contextuels } .PushBox .theme-bg .btn-inverse:hover, -#modal_feed form .btn-inverse:hover, #QuickAddUser .btn-inverse:hover { background-color: #D6D6D6; *background-color: #D6D6D6; @@ -3234,10 +3232,6 @@ dans l'onglet thesaurus : arbres, menus contextuels color: #FFFFFF; } -#modal_feed form .fields { - overflow:auto; -} - #modal_feed form .feeds { color: #333333; overflow: auto; @@ -3281,26 +3275,6 @@ dans l'onglet thesaurus : arbres, menus contextuels border: 1px solid red; } -#modal_feed form input, -#modal_feed form textarea { - width: 90%; - height: 20px; - margin: 3px 0 10px 0; -} - -#modal_feed form label { - display:inline; -} - -#modal_feed form input.checkbox { - width: 20px; -} - -#modal_feed form textarea { - height: 60px; - resize: none; -} - /******* FEEDS ****************************************************************/ #answers .feed { diff --git a/www/skins/prod/jquery.main-prod.js b/www/skins/prod/jquery.main-prod.js index 9fe34d5f7b..a9dcdc9079 100644 --- a/www/skins/prod/jquery.main-prod.js +++ b/www/skins/prod/jquery.main-prod.js @@ -1848,7 +1848,6 @@ function activeIcons() { }); function feedThis(type, value) { - var $feed_box = $('#modal_feed'); var options = { lst: '', ssel: '', @@ -2747,35 +2746,12 @@ function autoorder() { } function set_up_feed_box(data) { - var $feed_box = $('#modal_feed'); - $feed_box.empty().append(data).dialog({ - modal: true, - width: 800, - height: 500, - resizable: false, - draggable: false - }); - - var $feeds_item = $('.feeds .feed', $feed_box); - var $form = $('form.main_form', $feed_box); - - $feeds_item.bind('click',function () { - $feeds_item.removeClass('selected'); - $(this).addClass('selected'); - $('input[name="feed_id"]', $form).val($('input', this).val()); - }).hover(function () { - $(this).addClass('hover'); - }, function () { - $(this).removeClass('hover'); - }); - - $form.bind('submit', function () { - return false; - }); - - $('button.valid_form').bind('click', function () { + var buttons = {}; + buttons[language.valider] = function () { + var dialog = p4.Dialog.get(1); var error = false; + var $form = $('form.main_form', dialog.getDomElement()); $('.required_text', $form).each(function (i, el) { if ($.trim($(el).val()) === '') { @@ -2803,23 +2779,23 @@ function set_up_feed_box(data) { data: $form.serializeArray(), dataType: 'json', beforeSend: function () { - $('button', $feed_box).attr('disabled', 'disabled'); + $('button', dialog.getDomElement()).attr('disabled', 'disabled'); }, error: function () { - $('button', $feed_box).removeAttr('disabled'); + $('button', dialog.getDomElement()).removeAttr('disabled'); }, timeout: function () { - $('button', $feed_box).removeAttr('disabled'); + $('button', dialog.getDomElement()).removeAttr('disabled'); }, success: function (data) { - $('button', $feed_box).removeAttr('disabled'); + $('button', dialog.getDomElement()).removeAttr('disabled'); if (data.error === true) { alert(data.message); return; } - if ($('form.main_form', $feed_box).hasClass('entry_update')) { - var id = $('form input[name="entry_id"]', $feed_box).val(); + if ($('form.main_form', dialog.getDomElement()).hasClass('entry_update')) { + var id = $('form input[name="entry_id"]', dialog.getDomElement()).val(); var container = $('#entry_' + id); container.replaceWith(data.datas); @@ -2833,20 +2809,39 @@ function set_up_feed_box(data) { }); } - if ($feed_box.data("ui-dialog")) { - $feed_box.dialog('destroy'); - } + p4.Dialog.Close(1); } }); - return false; - }); - $('button.close_dialog').bind('click', function () { - if ($feed_box.data("ui-dialog")) { - $feed_box.dialog('destroy'); - } + p4.Dialog.Close(1); + }; + var dialog = p4.Dialog.Create({ + size: 'Full', + closeOnEscape: true, + closeButton: true, + buttons: buttons + }); + + dialog.setContent(data); + + var $feeds_item = $('.feeds .feed', dialog.getDomElement()); + var $form = $('form.main_form', dialog.getDomElement()); + + $feeds_item.bind('click',function () { + console.log("clcik"); + $feeds_item.removeClass('selected'); + $(this).addClass('selected'); + $('input[name="feed_id"]', $form).val($('input', this).val()); + }).hover(function () { + $(this).addClass('hover'); + }, function () { + $(this).removeClass('hover'); + }); + + $form.bind('submit', function () { return false; }); + return; }