mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-14 13:33:14 +00:00
Merge branch '3.8'
Conflicts: bower.json templates/web/common/index_bootstrap.html.twig templates/web/common/menubar.html.twig templates/web/login/layout/base-layout.html.twig templates/web/prod/Baskets/Reorder.html.twig
This commit is contained in:
@@ -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 */
|
||||
|
@@ -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')
|
||||
);
|
||||
|
||||
|
@@ -128,16 +128,16 @@
|
||||
<fieldset>
|
||||
<legend>{% trans 'setup::Tests d\'envois d\'emails' %}</legend>
|
||||
<div class="input-append">
|
||||
<input class="span3" id="appendedInputButton" type="text" placeholder="{% trans %}Email{% endtrans %}">
|
||||
<input name="email" class="span3" id="appendedInputButton" type="text" placeholder="{% trans %}Email{% endtrans %}">
|
||||
<input type="submit" class="btn btn-warning" value="{% trans 'Send' %}"/>
|
||||
</div>
|
||||
<div>
|
||||
{% if email_status %}
|
||||
<p>{% trans %}Email test result : {{ email_status }}{% endtrans %}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
{% if email_status %}
|
||||
<div class="alert-info">
|
||||
<p>{% trans %}Email test result : {{ email_status }}{% endtrans %}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if app['cache'].isServer() %}
|
||||
|
@@ -12,7 +12,7 @@
|
||||
|
||||
<!--[if lte IE 8]>
|
||||
<link rel="stylesheet" href="{{ path('minifier', { 'f' : 'assets/font-awesome/css/font-awesome-ie7.min.css' }) }}">
|
||||
<script type="text/javascript" src="{{ path('minifier', {'f' : 'assets/json3/json3.js'}) }}"></script>
|
||||
<script type="text/javascript" src="{{ path('minifier', {'f' : 'assets/json2/json2.js'}) }}"></script>
|
||||
<![endif]-->
|
||||
|
||||
<script type="text/javascript" src="{{ path('minifier', { 'f' : 'assets/jquery/jquery.js' }) }}"></script>
|
||||
|
@@ -2,8 +2,8 @@
|
||||
<div class="PNB" style="right:auto;overflow:hidden;">
|
||||
<ol>
|
||||
<li>
|
||||
<span class="title {% if module is defined and module == "prod" %}selected{% endif %}">
|
||||
Phraseanet
|
||||
<span class="title {% if module == "prod" %}selected{% endif %}">
|
||||
{% block menu_bar_title %}Phraseanet{% endblock %}
|
||||
</span>
|
||||
</li>
|
||||
{% if module is defined and module != "lightbox" and app['authentication'].isAuthenticated() %}
|
||||
|
@@ -8,17 +8,24 @@
|
||||
|
||||
{% set document = record.get_subdef('document') %}
|
||||
|
||||
{% block td_original_name %}
|
||||
{% trans 'Nom Original' %} :
|
||||
{{ record.get_original_name() }}
|
||||
{% endblock %}
|
||||
<br/>
|
||||
|
||||
{% block td_mime %}
|
||||
{{ record.get_mime() }}
|
||||
{% endblock %}
|
||||
|
||||
{% block td_weight %}
|
||||
{% if document and document.get_size() %}
|
||||
- {{document.get_size()| formatOctets}}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
<br/>
|
||||
|
||||
{% 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 %}
|
||||
<hr/>
|
||||
|
||||
{% 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')) }}
|
||||
<br />
|
||||
{% 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')) }}
|
||||
<br />
|
||||
{% 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')) }}
|
||||
<br />
|
||||
{% 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
|
||||
<br />
|
||||
{% 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')) }}
|
||||
<br />
|
||||
{% 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 %}
|
||||
<br />
|
||||
{% 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.
|
||||
<br />
|
||||
{% 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) }}
|
||||
<br />
|
||||
{% 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
|
||||
<br />
|
||||
{% 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
|
||||
<br />
|
||||
{% 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) }}
|
||||
<br />
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
{% block td_duration %}
|
||||
{% if record.get_formated_duration() %}
|
||||
{% trans 'Duree' %} :
|
||||
{{ record.get_formated_duration() }}
|
||||
<br />
|
||||
{% 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
|
||||
<br />
|
||||
{% 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')) }}
|
||||
<br />
|
||||
{% 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')) }}
|
||||
<br />
|
||||
{% 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
|
||||
<br />
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
{% endif %}
|
||||
|
||||
|
@@ -36,7 +36,7 @@
|
||||
|
||||
{% block header_javascript %}
|
||||
<!--[if lte IE 8]>
|
||||
<script type="text/javascript" src="{{ path('minifier', {'f' : 'assets/json3/json3.js'}) }}"></script>
|
||||
<script type="text/javascript" src="{{ path('minifier', {'f' : 'assets/json2/json2.js'}) }}"></script>
|
||||
<![endif]-->
|
||||
|
||||
{# include backbone templates #}
|
||||
|
@@ -1,7 +1,8 @@
|
||||
{% import 'common/thumbnail.html.twig' as thumbnail %}
|
||||
<div id="reorder_box" class="PNB" style="top:10px; overflow:auto; padding:10px;">
|
||||
<div id="reorder_options" style="height:32px; margin-bottom:10px;">
|
||||
<span>{% trans 'Reordonner automatiquement' %}</span>
|
||||
<div id="reorder_box">
|
||||
<div id="reorder_options" class="row-fluid">
|
||||
<form class="form-inline span10">
|
||||
<label for="auto_order">{% trans 'Reordonner automatiquement' %}</label>
|
||||
<select id="auto_order">
|
||||
<option value="">{% trans 'Choisir' %}</option>
|
||||
<option value="default">{% trans 'Re-initialiser' %}</option>
|
||||
@@ -9,14 +10,15 @@
|
||||
</select>
|
||||
<button type="button" class="autoorder btn btn-inverse">{% trans 'Re-ordonner' %}</button>
|
||||
<button type="button" class="reverseorder btn btn-inverse">{% trans 'Inverser' %}</button>
|
||||
<form name="reorder" method="POST" action="{{ path('prod_baskets_basket_reorder', { 'basket' : basket.getId() }) }}" style="display:inline;">
|
||||
</form>
|
||||
<form class="form-inline span2" name="reorder" method="POST" action="{{ path('prod_baskets_basket_reorder', { 'basket_id' : basket.getId() }) }}">
|
||||
{% for element in basket.getElements() %}
|
||||
<input type="hidden" name="element[{{ element.getId() }}]" value="{{ element.getOrd() }}"/>
|
||||
{% endfor %}
|
||||
<button class="btn btn-inverse">{% trans 'boutton::valider' %}</button>
|
||||
<input type="submit" class="btn btn-inverse" value="{% trans 'boutton::valider' %}" />
|
||||
</form>
|
||||
</div>
|
||||
<div class="elements">
|
||||
<div class="elements row-fluid">
|
||||
{% for element in basket.getElements() %}
|
||||
<div id="ORDER_{{ element.getId() }}" class="CHIM diapo" style="height:130px;overflow:hidden;">
|
||||
<div class="title" title="{{ element.getRecord(app).get_title() }}" style="position:relative;z-index:1200;height:30px;overflow:visible;text-align:center;">
|
||||
|
@@ -427,14 +427,14 @@
|
||||
<td style="padding-right: 5px;">
|
||||
<div class="input-prepend">
|
||||
<span class="add-on"><i class="icon-calendar"></i></span>
|
||||
<input onchange="checkFilters(true);" class="datepicker input-small" type="text" name="date_min" style="margin: 0;position: relative; z-index: 10001;" />
|
||||
<input onchange="checkFilters(true);" class="datepicker input-small" type="text" name="date_min" placeholder="YYYY/MM/DD" style="margin: 0;position: relative; z-index: 10001;" />
|
||||
</div>
|
||||
</td>
|
||||
<td>{% trans 'phraseanet::time:: a' %}</td>
|
||||
<td>
|
||||
<div class="input-prepend">
|
||||
<span class="add-on"><i class="icon-calendar"></i></span>
|
||||
<input onchange="checkFilters(true);" class="datepicker input-small" type="text" name="date_max" style="margin: 0;position: relative; z-index: 10001;" />
|
||||
<input onchange="checkFilters(true);" class="datepicker input-small" type="text" name="date_max" placeholder="YYYY/MM/DD" style="margin: 0;position: relative; z-index: 10001;" />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
@@ -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));
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -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 () {
|
||||
|
@@ -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 {
|
||||
|
@@ -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 {
|
||||
|
Reference in New Issue
Block a user