From 86b4e8305435d4b2f174c992b8c7dfadf08c8a32 Mon Sep 17 00:00:00 2001 From: Nicolas Le Goff Date: Tue, 26 Nov 2013 14:42:08 +0100 Subject: [PATCH 1/9] Fix #1590 IE popup Error message: "A script on this page is causing Internet Explorer to run slowly" --- bower.json | 2 +- templates/web/common/index_bootstrap.html.twig | 2 +- templates/web/login/layout/base-layout.html.twig | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bower.json b/bower.json index e7c108c0c8..f32f9c81ef 100644 --- a/bower.json +++ b/bower.json @@ -9,7 +9,7 @@ "underscore": "~1.4.4", "modernizr": "~2.6.2", "normalize-css" : "~2.1.0", - "json3" : "3.2.4", + "json2" : "latest", "humane-js": "~3.0.6", "qunit": "https://github.com/jquery/qunit.git#1.11.0", "jquery-file-upload": "~8.3.2", diff --git a/templates/web/common/index_bootstrap.html.twig b/templates/web/common/index_bootstrap.html.twig index e27232ceb0..e82a695c61 100644 --- a/templates/web/common/index_bootstrap.html.twig +++ b/templates/web/common/index_bootstrap.html.twig @@ -12,7 +12,7 @@ diff --git a/templates/web/login/layout/base-layout.html.twig b/templates/web/login/layout/base-layout.html.twig index bacdf737f7..91add9e4a7 100644 --- a/templates/web/login/layout/base-layout.html.twig +++ b/templates/web/login/layout/base-layout.html.twig @@ -36,7 +36,7 @@ {% block header_javascript %} {# include backbone templates #} From 52a8d9672cdcbe244e1fd6890947999e0ad33158 Mon Sep 17 00:00:00 2001 From: Nicolas Le Goff Date: Mon, 25 Nov 2013 15:04:22 +0100 Subject: [PATCH 2/9] Fix #1584 Unable to order medias Conflicts: templates/web/prod/Baskets/Reorder.html.twig --- templates/web/prod/Baskets/Reorder.html.twig | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/templates/web/prod/Baskets/Reorder.html.twig b/templates/web/prod/Baskets/Reorder.html.twig index 38755b3287..99c74b26fd 100644 --- a/templates/web/prod/Baskets/Reorder.html.twig +++ b/templates/web/prod/Baskets/Reorder.html.twig @@ -1,7 +1,8 @@ {% import 'common/thumbnail.html.twig' as thumbnail %} -
-
- {% trans 'Reordonner automatiquement' %} +
+
+
+ - +
+
{% for element in basket.getElements() %} {% endfor %} - +
-
+
{% for element in basket.getElements() %}
From afde85140f2a75444fe4b0f0132121ea1cc40f90 Mon Sep 17 00:00:00 2001 From: Nicolas Le Goff Date: Thu, 28 Nov 2013 11:08:42 +0100 Subject: [PATCH 3/9] Fix #1600 Can not save a deleted field in admin field app --- www/scripts/apps/admin/fields/views/edit.js | 3 ++- www/scripts/apps/admin/fields/views/save.js | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/www/scripts/apps/admin/fields/views/edit.js b/www/scripts/apps/admin/fields/views/edit.js index 4e297e47a1..2d9f475864 100644 --- a/www/scripts/apps/admin/fields/views/edit.js +++ b/www/scripts/apps/admin/fields/views/edit.js @@ -195,7 +195,8 @@ define([ AdminFieldApp.fieldsToDelete.push(self.model); AdminFieldApp.fieldListView.collection.remove(self.model); self._selectModelView(index); - AdminFieldApp.saveView.updateStateButton(); + // Enable state button, models is out of sync + AdminFieldApp.saveView.updateStateButton(false); }); return this; diff --git a/www/scripts/apps/admin/fields/views/save.js b/www/scripts/apps/admin/fields/views/save.js index 887d64aac6..0f3385bbd6 100644 --- a/www/scripts/apps/admin/fields/views/save.js +++ b/www/scripts/apps/admin/fields/views/save.js @@ -84,8 +84,9 @@ define([ return this; }, - updateStateButton: function () { - this._disableSaveButton(!this._isModelDesync()); + updateStateButton: function (disable) { + var toDisable = disable || !this._isModelDesync(); + this._disableSaveButton(toDisable); }, // check whether model has changed or not _isModelDesync: function () { From 7384a376b62e4e407697024a59a44b04318ce54b Mon Sep 17 00:00:00 2001 From: Nicolas Le Goff Date: Thu, 28 Nov 2013 11:24:08 +0100 Subject: [PATCH 4/9] Fix #1588 Error 400 when send email test --- templates/web/admin/dashboard.html.twig | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/templates/web/admin/dashboard.html.twig b/templates/web/admin/dashboard.html.twig index 2c05534a83..cd874128b2 100644 --- a/templates/web/admin/dashboard.html.twig +++ b/templates/web/admin/dashboard.html.twig @@ -128,16 +128,16 @@
{% trans 'setup::Tests d\'envois d\'emails' %}
- +
-
- {% if email_status %} -

{% trans %}Email test result : {{ email_status }}{% endtrans %}

- {% endif %} -
+ {% if email_status %} +
+

{% trans %}Email test result : {{ email_status }}{% endtrans %}

+
+ {% endif %}
{% if app['cache'].isServer() %} From deb5e7ea755652ead9f08980c4af42a9f1864456 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Thu, 28 Nov 2013 11:29:04 +0100 Subject: [PATCH 5/9] Fix #1596 : Add datepicker input placeholder --- templates/web/prod/index.html.twig | 4 ++-- www/skins/prod/000000/prodcolor.css | 5 +++++ www/skins/prod/959595/prodcolor.css | 5 +++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/templates/web/prod/index.html.twig b/templates/web/prod/index.html.twig index c7de406d9b..fdd7f139b4 100644 --- a/templates/web/prod/index.html.twig +++ b/templates/web/prod/index.html.twig @@ -423,14 +423,14 @@
- +
{% trans 'phraseanet::time:: a' %}
- +
diff --git a/www/skins/prod/000000/prodcolor.css b/www/skins/prod/000000/prodcolor.css index 7dd36cc001..b705ca38a2 100644 --- a/www/skins/prod/000000/prodcolor.css +++ b/www/skins/prod/000000/prodcolor.css @@ -1784,6 +1784,11 @@ H4 { margin: 0 0 0 10px; } +#searchForm input.input-small.datepicker::-webkit-input-placeholder { font-size:12px; } +#searchForm input.input-small.datepicker::-moz-placeholder { font-size:12px; } /* firefox 19+ */ +#searchForm input.input-small.datepicker:-ms-input-placeholder { font-size:12px; } /* ie */ +#searchForm input.input-small.datepicker:-moz-placeholder { font-size:12px; } + #adv_search .sbasglob hr, .adv_options .sbasglob hr, .adv_options #sbasfiltercont hr { diff --git a/www/skins/prod/959595/prodcolor.css b/www/skins/prod/959595/prodcolor.css index 9042ab4d5e..f6b069a351 100644 --- a/www/skins/prod/959595/prodcolor.css +++ b/www/skins/prod/959595/prodcolor.css @@ -1814,6 +1814,11 @@ H4 { margin: 0 0 0 10px; } +#searchForm input.input-small.datepicker::-webkit-input-placeholder { font-size:12px; } +#searchForm input.input-small.datepicker::-moz-placeholder { font-size:12px; } /* firefox 19+ */ +#searchForm input.input-small.datepicker:-ms-input-placeholder { font-size:12px; } /* ie */ +#searchForm input.input-small.datepicker:-moz-placeholder { font-size:12px; } + #adv_search .sbasglob hr, .adv_options .sbasglob hr, .adv_options #sbasfiltercont hr { From 94d547d897fd3f3c2741ed91bf179594ad376cab Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Thu, 28 Nov 2013 11:49:19 +0100 Subject: [PATCH 6/9] Fix #1593 : "download" query parameter is not working anymore on permalink URIs --- .../Phrasea/Controller/AbstractDelivery.php | 4 +++- .../Tests/Phrasea/Application/OverviewTest.php | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/lib/Alchemy/Phrasea/Controller/AbstractDelivery.php b/lib/Alchemy/Phrasea/Controller/AbstractDelivery.php index f179dfb03d..abc9cd7090 100644 --- a/lib/Alchemy/Phrasea/Controller/AbstractDelivery.php +++ b/lib/Alchemy/Phrasea/Controller/AbstractDelivery.php @@ -52,7 +52,9 @@ abstract class AbstractDelivery implements ControllerProviderInterface } - $response = $app['phraseanet.file-serve']->deliverFile($pathOut, $file->get_file(), DeliverDataInterface::DISPOSITION_INLINE, $file->get_mime()); + $disposition = $request->query->get('download') ? DeliverDataInterface::DISPOSITION_ATTACHMENT : DeliverDataInterface::DISPOSITION_INLINE; + + $response = $app['phraseanet.file-serve']->deliverFile($pathOut, $file->get_file(), $disposition, $file->get_mime()); $response->setPrivate(); /* @var $response \Symfony\Component\HttpFoundation\Response */ diff --git a/tests/Alchemy/Tests/Phrasea/Application/OverviewTest.php b/tests/Alchemy/Tests/Phrasea/Application/OverviewTest.php index 6e4e86f264..075d1cefdf 100644 --- a/tests/Alchemy/Tests/Phrasea/Application/OverviewTest.php +++ b/tests/Alchemy/Tests/Phrasea/Application/OverviewTest.php @@ -94,6 +94,20 @@ class ApplicationOverviewTest extends \PhraseanetWebTestCaseAuthenticatedAbstrac $this->get_a_permaview(array("Content-Type" => "text/html; charset=UTF-8")); } + public function testPermalinkAuthenticatedWithDownloadQuery() + { + $token = self::$DI['record_1']->get_preview()->get_permalink()->get_token(); + $url = '/permalink/v1/' . self::$DI['record_1']->get_sbas_id() . '/' . self::$DI['record_1']->get_record_id() . '/preview/whateverIwannt.jpg?token=' . $token . '&download=1'; + + self::$DI['client']->request('GET', $url); + $response = self::$DI['client']->getResponse(); + + $this->assertRegExp('/^attachment;/', $response->headers->get('content-disposition')); + + $this->assertEquals(rtrim(self::$DI['app']['phraseanet.configuration']['main']['servername'], '/') . "/permalink/v1/1/". self::$DI['record_1']->get_record_id()."/caption/?token=".$token, $response->headers->get("Link")); + $this->assertEquals(200, $response->getStatusCode()); + } + public function testPermalinkNotAuthenticated() { $this->logout(self::$DI['app']); @@ -244,6 +258,7 @@ class ApplicationOverviewTest extends \PhraseanetWebTestCaseAuthenticatedAbstrac $crawler = self::$DI['client']->request('GET', $url); $response = self::$DI['client']->getResponse(); + $this->assertRegExp('/^inline;/', $response->headers->get('content-disposition')); foreach ($headers as $name => $value) { $this->assertEquals($value, $response->headers->get($name)); } From d1973bdc06f9894cb556c666f7c4611553773593 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Thu, 28 Nov 2013 11:56:40 +0100 Subject: [PATCH 7/9] Fix #1595 : Export document with its title returns a document named with its filename --- lib/Alchemy/Phrasea/Controller/Prod/Download.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Download.php b/lib/Alchemy/Phrasea/Controller/Prod/Download.php index 086fbfa166..ee567fb3f0 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Download.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Download.php @@ -72,7 +72,7 @@ class Download implements ControllerProviderInterface $app['authentication']->getUser(), $app['filesystem'], $subdefs, - $request->request->get('title') === 'title' ? true : false, + $request->request->get('type') === 'title' ? true : false, $request->request->get('businessfields') ); From e2fcd816cc5f8a2bb2061682a42a9b8eb832855f Mon Sep 17 00:00:00 2001 From: Nicolas Le Goff Date: Thu, 28 Nov 2013 12:38:24 +0100 Subject: [PATCH 8/9] Add block to override menu bar title --- templates/web/common/menubar.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/web/common/menubar.html.twig b/templates/web/common/menubar.html.twig index 5b363b9c3c..68bd021006 100644 --- a/templates/web/common/menubar.html.twig +++ b/templates/web/common/menubar.html.twig @@ -3,7 +3,7 @@
  1. - Phraseanet + {% block menu_bar_title %}Phraseanet{% endblock %}
  2. {% if module != "lightbox" and app['authentication'].isAuthenticated() %} From 7bbf00ff4b77cdebae9763e081a1aafdc46e4c3a Mon Sep 17 00:00:00 2001 From: Nicolas Le Goff Date: Thu, 28 Nov 2013 13:29:25 +0100 Subject: [PATCH 9/9] Wrap technical data into blocks --- .../web/common/technical_datas.html.twig | 44 +++++++++++++++++-- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/templates/web/common/technical_datas.html.twig b/templates/web/common/technical_datas.html.twig index f5b2bb895f..ed1ab1ea99 100644 --- a/templates/web/common/technical_datas.html.twig +++ b/templates/web/common/technical_datas.html.twig @@ -8,17 +8,24 @@ {% set document = record.get_subdef('document') %} +{% block td_original_name %} {% trans 'Nom Original' %} : {{ record.get_original_name() }} +{% endblock %}
    +{% block td_mime %} {{ record.get_mime() }} +{% endblock %} +{% block td_weight %} {% if document and document.get_size() %} - {{document.get_size()| formatOctets}} {% endif %} +{% endblock %}
    +{% block td_size %} {% if document and document.get_width() and document.get_height() %} {% trans 'Size' %} : {{document.get_width()}} x {{document.get_height()}} px @@ -32,33 +39,44 @@ {{ size_w|round(1) }} x {{ size_h|round(1) }} cm (72dpi) {% endif %} {% endif %} +{% endblock %}
    - +{% block td_camera_model %} {% if record.get_technical_infos(constant('media_subdef::TC_DATA_CAMERAMODEL')) is not empty %} {% trans 'Camera Model' %} : {{ record.get_technical_infos(constant('media_subdef::TC_DATA_CAMERAMODEL')) }}
    {% endif %} +{% endblock %} +{% block td_color_space %} {% if record.get_technical_infos(constant('media_subdef::TC_DATA_COLORSPACE')) is not empty %} {% trans 'Color space' %} : {{ record.get_technical_infos(constant('media_subdef::TC_DATA_COLORSPACE')) }}
    {% endif %} +{% endblock %} +{% block td_channels %} {% if record.get_technical_infos(constant('media_subdef::TC_DATA_CHANNELS')) is not empty %} {% trans 'Channels' %} : {{ record.get_technical_infos(constant('media_subdef::TC_DATA_CHANNELS')) }}
    {% endif %} +{% endblock %} +{% block td_color_depth %} {% if record.get_technical_infos(constant('media_subdef::TC_DATA_COLORDEPTH')) is not empty %} {% trans 'Color Depth' %} : {{ record.get_technical_infos(constant('media_subdef::TC_DATA_COLORDEPTH')) }} bits
    {% endif %} +{% endblock %} +{% block td_iso_sensibility %} {% if record.get_technical_infos(constant('media_subdef::TC_DATA_ISO')) is not empty %} {% trans 'ISO sensibility' %} : {{ record.get_technical_infos(constant('media_subdef::TC_DATA_ISO')) }}
    {% endif %} +{% endblock %} +{% block td_flash %} {% if record.get_technical_infos(constant('media_subdef::TC_DATA_FLASHFIRED')) is not empty %} {% trans 'Flash' %} : {% if record.get_technical_infos(constant('media_subdef::TC_DATA_FLASHFIRED')) %} @@ -68,57 +86,75 @@ {% endif %}
    {% endif %} +{% endblock %} +{% block td_shutter_speed %} {% if record.get_technical_infos(constant('media_subdef::TC_DATA_SHUTTERSPEED')) is not empty %} {% trans 'Shutter speed' %} : {{ record.get_technical_infos(constant('media_subdef::TC_DATA_SHUTTERSPEED')) }} s.
    {% endif %} +{% endblock %} +{% block td_apeture %} {% if record.get_technical_infos(constant('media_subdef::TC_DATA_APERTURE')) is not empty %} {% trans 'Aperture' %} : {{ record.get_technical_infos(constant('media_subdef::TC_DATA_APERTURE')) | round(2) }}
    {% endif %} +{% endblock %} +{% block td_focal_length %} {% if record.get_technical_infos(constant('media_subdef::TC_DATA_FOCALLENGTH')) is not empty %} {% trans 'Focal length' %} : {{ record.get_technical_infos(constant('media_subdef::TC_DATA_FOCALLENGTH')) }} mm
    {% endif %} +{% endblock %} +{% block td_hyperfocal_distance %} {% if record.get_technical_infos(constant('media_subdef::TC_DATA_HYPERFOCALDISTANCE')) is not empty %} {% trans 'Hyperfocal distance' %} : {{ record.get_technical_infos(constant('media_subdef::TC_DATA_HYPERFOCALDISTANCE')) | round(2) }} mm
    {% endif %} +{% endblock %} +{% block td_light_value %} {% if record.get_technical_infos(constant('media_subdef::TC_DATA_LIGHTVALUE')) is not empty %} {% trans 'Light Value' %} : {{ record.get_technical_infos(constant('media_subdef::TC_DATA_LIGHTVALUE')) | round(2) }}
    {% endif %} - +{% endblock %} +{% block td_duration %} {% if record.get_formated_duration() %} {% trans 'Duree' %} : {{ record.get_formated_duration() }}
    {% endif %} +{% endblock %} +{% block td_framerate %} {% if record.get_technical_infos(constant('media_subdef::TC_DATA_FRAMERATE')) is not empty %} {% trans 'Images par secondes' %} : {{ record.get_technical_infos(constant('media_subdef::TC_DATA_FRAMERATE')) | round(2) }} ips
    {% endif %} +{% endblock %} +{% block td_codec_audio %} {% if record.get_technical_infos(constant('media_subdef::TC_DATA_AUDIOCODEC')) %} {% trans 'Codec Audio' %} : {{ record.get_technical_infos(constant('media_subdef::TC_DATA_AUDIOCODEC')) }}
    {% endif %} +{% endblock %} +{% block td_codec_video %} {% if record.get_technical_infos(constant('media_subdef::TC_DATA_VIDEOCODEC')) %} {% trans 'Codec Video' %} : {{ record.get_technical_infos(constant('media_subdef::TC_DATA_VIDEOCODEC')) }}
    {% endif %} +{% endblock %} +{% block td_audio_rate %} {% if record.get_technical_infos(constant('media_subdef::TC_DATA_AUDIOSAMPLERATE')) %} {% trans 'Frequence d\'echantillonage' %} : {{ record.get_technical_infos(constant('media_subdef::TC_DATA_AUDIOSAMPLERATE')) | round(2) }} kHz
    {% endif %} - +{% endblock %} {% endif %} -