diff --git a/lib/Alchemy/Phrasea/Controller/AbstractDelivery.php b/lib/Alchemy/Phrasea/Controller/AbstractDelivery.php index 890edcbb1f..7a293c152b 100644 --- a/lib/Alchemy/Phrasea/Controller/AbstractDelivery.php +++ b/lib/Alchemy/Phrasea/Controller/AbstractDelivery.php @@ -46,7 +46,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/lib/Alchemy/Phrasea/Controller/Prod/Download.php b/lib/Alchemy/Phrasea/Controller/Prod/Download.php index 8006d6ecba..a8d41b5cc7 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Download.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Download.php @@ -60,7 +60,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') ); 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() %} diff --git a/templates/web/common/index_bootstrap.html.twig b/templates/web/common/index_bootstrap.html.twig index d3c2644635..7a0765f9d7 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/common/menubar.html.twig b/templates/web/common/menubar.html.twig index 16a19f6492..51214e07d3 100644 --- a/templates/web/common/menubar.html.twig +++ b/templates/web/common/menubar.html.twig @@ -2,8 +2,8 @@
  1. - - Phraseanet + + {% block menu_bar_title %}Phraseanet{% endblock %}
  2. {% if module is defined and module != "lightbox" and app['authentication'].isAuthenticated() %} @@ -75,7 +75,7 @@ - {# MODULE #} + {# MODULE #} {% if module is defined and module == "prod" %} {% if app['acl'].get(app['authentication'].getUser()).has_access_to_module('upload') %}
  3. 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 %} - diff --git a/templates/web/login/layout/base-layout.html.twig b/templates/web/login/layout/base-layout.html.twig index 46cbac338c..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 #} diff --git a/templates/web/prod/Baskets/Reorder.html.twig b/templates/web/prod/Baskets/Reorder.html.twig index fcb8797b86..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() %}
    diff --git a/templates/web/prod/index.html.twig b/templates/web/prod/index.html.twig index cdde6a9564..d9a4db5a64 100644 --- a/templates/web/prod/index.html.twig +++ b/templates/web/prod/index.html.twig @@ -427,14 +427,14 @@
    - +
    {% trans 'phraseanet::time:: a' %}
    - +
    diff --git a/tests/Alchemy/Tests/Phrasea/Application/OverviewTest.php b/tests/Alchemy/Tests/Phrasea/Application/OverviewTest.php index f9e6086760..0aa143b797 100644 --- a/tests/Alchemy/Tests/Phrasea/Application/OverviewTest.php +++ b/tests/Alchemy/Tests/Phrasea/Application/OverviewTest.php @@ -89,6 +89,20 @@ class OverviewTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $this->get_a_permaview(["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() { self::$DI['app']['authentication']->closeAccount(); @@ -234,6 +248,7 @@ class OverviewTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $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)); } 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 () { 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 {