Merge branch 'master' into PHRAS-2666_slow-notifications_4.1

This commit is contained in:
jygaulier
2019-09-23 12:04:11 +02:00
committed by GitHub
21 changed files with 284 additions and 180 deletions

14
composer.lock generated
View File

@@ -383,16 +383,16 @@
},
{
"name": "alchemy/phpexiftool",
"version": "0.7.0",
"version": "0.7.2",
"source": {
"type": "git",
"url": "https://github.com/alchemy-fr/PHPExiftool.git",
"reference": "7372ca4e43473328bf06bca810558fbad7bb2f95"
"reference": "ba1cb51eceb6562d7996023478977a8739de188b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/alchemy-fr/PHPExiftool/zipball/7372ca4e43473328bf06bca810558fbad7bb2f95",
"reference": "7372ca4e43473328bf06bca810558fbad7bb2f95",
"url": "https://api.github.com/repos/alchemy-fr/PHPExiftool/zipball/ba1cb51eceb6562d7996023478977a8739de188b",
"reference": "ba1cb51eceb6562d7996023478977a8739de188b",
"shasum": ""
},
"require": {
@@ -443,8 +443,8 @@
},
{
"name": "Benoit Burnichon",
"role": "Lead Developer",
"email": "bburnichon@alchemy.fr"
"email": "bburnichon@alchemy.fr",
"role": "Lead Developer"
}
],
"description": "Exiftool driver for PHP",
@@ -452,7 +452,7 @@
"exiftool",
"metadata"
],
"time": "2017-05-18T19:04:04+00:00"
"time": "2019-02-13T13:06:43+00:00"
},
{
"name": "alchemy/queue-bundle",

View File

@@ -665,7 +665,7 @@ class Application extends SilexApplication
private function setupGeonames()
{
$this['geonames.server-uri'] = $this->share(function (Application $app) {
return $app['conf']->get(['registry', 'webservices', 'geonames-server'], 'http://geonames.alchemyasp.com/');
return $app['conf']->get(['registry', 'webservices', 'geonames-server'], 'https://geonames.alchemyasp.com/');
});
}

View File

@@ -944,7 +944,7 @@ class V1Controller extends Controller
}
$originalName = $pi['filename'] . '.' . $pi['extension'];
$newPathname = $tempfile;
$uploadedFilename = $newPathname = $tempfile;
}
}
else {
@@ -956,8 +956,11 @@ class V1Controller extends Controller
if (!$file->isValid()) {
return $this->getBadRequestAction($request, 'Data corrupted, please try again');
}
$uploadedFilename = $file->getPathname();
$originalName = $file->getClientOriginalName();
$newPathname = $file->getPathname() . '.' . $file->getClientOriginalExtension();
if (false === rename($file->getPathname(), $newPathname)) {
return Result::createError($request, 403, 'Error while renaming file')->createResponse();
}
@@ -1010,6 +1013,11 @@ class V1Controller extends Controller
$nosubdef = $request->get('nosubdefs') === '' || \p4field::isyes($request->get('nosubdefs'));
$this->getBorderManager()->process($session, $Package, $callback, $behavior, $nosubdef);
// remove $newPathname on temporary directory
if ($newPathname !== $uploadedFilename) {
@rename($newPathname, $uploadedFilename);
}
$ret = ['entity' => null];
if ($output instanceof \record_adapter) {
@@ -1081,6 +1089,11 @@ class V1Controller extends Controller
}
}
// remove $newPathname on temporary directory
if ($renamedFilename !== $uploadedFilename) {
@rename($renamedFilename, $uploadedFilename);
}
return Result::create($request, $ret)->createResponse();
}

View File

@@ -463,6 +463,8 @@ class PushController extends Controller
}
try {
$manager = $this->getEntityManager();
$password = $this->getRandomGenerator()->generateString(128);
$user = $this->getUserManipulator()->createUser($email, $password, $email);
@@ -476,12 +478,15 @@ class PushController extends Controller
$user->setCompany($request->request->get('company'));
}
if ($request->request->get('job')) {
$user->setCompany($request->request->get('job'));
$user->setJob($request->request->get('job'));
}
if ($request->request->get('form_geonameid')) {
$this->getUserManipulator()->setGeonameId($user, $request->request->get('form_geonameid'));
if ($request->request->get('city')) {
$this->getUserManipulator()->setGeonameId($user, $request->request->get('city'));
}
$manager->persist($user);
$manager->flush();
$result['message'] = $this->app->trans('User successfully created');
$result['success'] = true;
$result['user'] = $this->formatUser($user);

View File

@@ -179,7 +179,6 @@ class QueryController extends Controller
};
$userManipulator->setUserSetting($user, 'last_jsonquery', (string)$request->request->get('jsQuery'));
$jsQuery = @json_decode((string)$request->request->get('jsQuery'), true);
if(($ft = $findFulltext($jsQuery['query'])) !== null) {
$userManipulator->setUserSetting($user, 'start_page_query', $ft);
@@ -317,7 +316,7 @@ class QueryController extends Controller
</tfoot>
</table></div></div>'
. '</div><a href="#" class="search-display-info" data-infos="' . str_replace('"', '&quot;', $explain) . '">'
. $this->app->trans('%total% reponses', ['%total%' => '<span>'.$result->getTotal().'</span>']) . '</a>';
. $this->app->trans('%total% reponses', ['%total%' => '<span>'.number_format($result->getTotal(),null, null, ' ').'</span>']) . '</a>';
$json['infos'] = $infoResult;
$json['navigationTpl'] = $string;

View File

@@ -265,7 +265,7 @@ class LoginController extends Controller
return $this->render('login/register-classic.html.twig', array_merge(
$this->getDefaultTemplateVariables($request),
[
'geonames_server_uri' => str_replace(sprintf('%s:', parse_url($url, PHP_URL_SCHEME)), '', $url),
'geonames_server_uri' => $url,
'form' => $form->createView()
]));
}

View File

@@ -146,7 +146,7 @@ class RegistryFormManipulator
],
'webservices' => [
'google-charts-enabled' => true,
'geonames-server' => 'http://geonames.alchemyasp.com/',
'geonames-server' => 'https://geonames.alchemyasp.com/',
'captchas-enabled' => false,
'recaptcha-public-key' => '',
'recaptcha-private-key' => '',

View File

@@ -61,7 +61,7 @@ class SubdefGenerator
public function generateSubdefs(\record_adapter $record, array $wanted_subdefs = null)
{
if ($record->get_hd_file() !== null) {
if ($record->get_hd_file() !== null && $record->get_hd_file()->getMimeType() == "application/x-indesign") {
$mediaSource = $this->mediavorus->guess($record->get_hd_file()->getPathname());
$metadatas = $mediaSource->getMetadatas();
@@ -69,15 +69,27 @@ class SubdefGenerator
if(!isset($this->tmpFilesystem)){
$this->tmpFilesystem = Manager::create();
}
$tmpDir = $this->tmpFilesystem->createTemporaryDirectory();
$tmpDir = $this->tmpFilesystem->createTemporaryDirectory(0777, 500);
try {
$this->app['filesystem']->dumpFile($tmpDir.'/file.jpg', $metadatas->get('XMP-xmp:PageImage')->getValue()->asString());
$this->tmpFilePath = $tmpDir.'/file.jpg';
} catch (\Exception $e) {
$this->logger->error(sprintf('Unable to write temporary file : %s', $e->getMessage()));
$files = $this->app['exiftool.preview-extractor']->extract($record->get_hd_file()->getPathname(), $tmpDir);
$selected = null;
$size = null;
foreach ($files as $file) {
if ($file->isDir() || $file->isDot()) {
continue;
}
if (is_null($selected) || $file->getSize() > $size) {
$selected = $file->getPathname();
$size = $file->getSize();
}
}
if ($selected) {
$this->tmpFilePath = $selected;
}
}
}

View File

@@ -65,7 +65,7 @@
"normalize-css": "^2.1.0",
"npm": "^6.0.0",
"npm-modernizr": "^2.8.3",
"phraseanet-production-client": "^0.34.53-d",
"phraseanet-production-client": "0.34.72-d",
"requirejs": "^2.3.5",
"tinymce": "^4.0.28",
"underscore": "^1.8.3",

View File

@@ -31,17 +31,13 @@ var commonModule = (function ($, p4) {
$(this).removeClass('context-menu-item-hover');
});
// $('#help-trigger').contextMenu('#mainMenu .helpcontextmenu', {openEvt: 'click', dropDown: true, theme: 'vista', dropDown: true,
// showTransition: 'slideDown',
// hideTransition: 'hide',
// shadow: false
// });
$('body').on('click', '.infoDialog', function (event) {
infoDialog($(this));
});
});
function showOverlay(n, appendto, callback, zIndex) {
var div = "OVERLAY";

View File

@@ -88,4 +88,20 @@ $mainMenuLinkBackgroundHoverColor: transparent;
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.39);
}
}
/*Help menu*/
.contextMenu.helpcontextmenu {
display: none;
&.shown {
display: block;
position: absolute;
z-index: 101;
}
}
.help-trigger {
display:inline-block;
cursor:pointer;
padding: 0 4px;
border:none;
margin-left: -12px;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 682 B

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 802 B

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -110,7 +110,7 @@ $select-height: 26px;
}
.input-prepend {
margin: 0;
.dmin, .dmax {
border: 0 none;
height: 16px;
@@ -203,7 +203,7 @@ $select-height: 26px;
height: $select-height;
}
.select-styled {
position: absolute;
position: absolute;
top: 0;
right: 0;
bottom: 0;
@@ -232,9 +232,9 @@ $select-height: 26px;
background-color: darken($select-background, 5);
}
}
.select-options {
display: none;
display: none;
position: absolute;
top: 12px;
right: -12px;
@@ -292,7 +292,7 @@ $select-height: 26px;
-webkit-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
&:hover {
background-color: #2c2c2c;
}
@@ -355,4 +355,8 @@ $select-height: 26px;
&.ui-widget-content{
background-color: #212121;
}
}
}
#mainMenu li .context-menu-item-inner a:hover {
color: #000;
}

View File

@@ -512,7 +512,7 @@
{{ 'admin::compte-utilisateur poste' | trans }}
</td>
<td>
<input type="text" name="function" value="{{main_user.getActivity()}}"/>
<input type="text" name="function" value="{{main_user.getJob()}}"/>
</td>
</tr>
<tr>
@@ -528,7 +528,7 @@
{{ 'admin::compte-utilisateur activite' | trans }}
</td>
<td>
<input type="text" name="activite" value="{{main_user.getJob()}}"/>
<input type="text" name="activite" value="{{main_user.getActivity()}}"/>
</td>
</tr>

View File

@@ -25,103 +25,103 @@
<div id="nav_menu_container" class="desktopmenu">
<div class="arrow-up"></div>
<ol class="nav_menu">
<li class="menu-bar-item">
<a target="_blank" href="{{ path('prod') }}">
<img src="/assets/common/images/icons/menu-prod.png" class="mobilemenu"/>
<span class="{% if module is defined and module == "prod" %}selected{% endif %}">
<li class="menu-bar-item">
<a target="_blank" href="{{ path('prod') }}">
<img src="/assets/common/images/icons/menu-prod.png" class="mobilemenu"/>
<span class="{% if module is defined and module == "prod" %}selected{% endif %}">
{{ 'admin::monitor: production' | trans }}
</span>
</a>
</li>
</a>
</li>
{% if app['browser'].isNewGeneration and app['conf'].get(['registry', 'modules', 'thesaurus']) == true and app.getAclForUser(app.getAuthenticatedUser()).has_access_to_module('thesaurus') %}
<li class="menu-bar-item">
<a target="_blank" href="{{ path('thesaurus') }}">
<img src="/assets/common/images/icons/menu-thesaurus.png" class="mobilemenu"/>
<span class="{% if module is defined and module == "thesaurus" %}selected{% endif %}">
{% if app['browser'].isNewGeneration and app['conf'].get(['registry', 'modules', 'thesaurus']) == true and app.getAclForUser(app.getAuthenticatedUser()).has_access_to_module('thesaurus') %}
<li class="menu-bar-item">
<a target="_blank" href="{{ path('thesaurus') }}">
<img src="/assets/common/images/icons/menu-thesaurus.png" class="mobilemenu"/>
<span class="{% if module is defined and module == "thesaurus" %}selected{% endif %}">
{{ 'admin::monitor: module thesaurus' | trans }}
</span>
</a>
</li>
{% endif %}
{# MODULE #}
{% if app.getAclForUser(app.getAuthenticatedUser()).has_access_to_module('admin') %}
<li class="menu-bar-item">
<a target="_blank" href="{{ path('admin') }}">
<img src="/assets/common/images/icons/menu-admin.png" class="mobilemenu"/>
<span class="{% if module is defined and module == "admin" %}selected{% endif %}">
{{ 'admin::monitor: module admin' | trans }}
</span>
</a>
</li>
{% endif %}
{# MODULE #}
{% if app.getAclForUser(app.getAuthenticatedUser()).has_access_to_module('report') %}
<li class="menu-bar-item">
<a target="_blank" href="{{ path('report_dashboard') }}">
<img src="/assets/common/images/icons/menu-report.png" class="mobilemenu"/>
<span class="{% if module is defined and module == "report" %}selected{% endif %}">
{{ 'admin::monitor: module report' | trans }}
</span>
</a>
</li>
{% endif %}
{# MODULE #}
<li class="menu-bar-item">
<a id="validation_link" target="_blank" href="{{ path('lightbox') }}">
<img src="/assets/common/images/icons/menu-lightbox.png" class="mobilemenu"/>
<span>
{{ 'admin::monitor: module validation' | trans }}
</span>
</a>
</li>
{% endif %}
{# MODULE #}
{% if module is defined and module == "prod" %}
{% if app.getAclForUser(app.getAuthenticatedUser()).has_access_to_module('upload') %}
<li class="menu-bar-item">
{% set link = path('upload_html5_form') %}
{% if not app['browser'].supportFileAPI() %}
{% set link = path('upload_flash_form') %}
{% endif %}
{# MODULE #}
{% if app.getAclForUser(app.getAuthenticatedUser()).has_access_to_module('admin') %}
<li class="menu-bar-item">
<a target="_blank" href="{{ path('admin') }}">
<img src="/assets/common/images/icons/menu-admin.png" class="mobilemenu"/>
<span class="{% if module is defined and module == "admin" %}selected{% endif %}">
{{ 'admin::monitor: module admin' | trans }}
</span>
</a>
</li>
{% endif %}
<a href="{{ link }}" class="uploader-open-action"
title="{{ 'Upload' | trans }}">
<img src="/assets/common/images/icons/menu-upload.png" class="mobilemenu"/>
<span>
{# MODULE #}
{% if app.getAclForUser(app.getAuthenticatedUser()).has_access_to_module('report') %}
<li class="menu-bar-item">
<a target="_blank" href="{{ path('report_dashboard') }}">
<img src="/assets/common/images/icons/menu-report.png" class="mobilemenu"/>
<span class="{% if module is defined and module == "report" %}selected{% endif %}">
{{ 'admin::monitor: module report' | trans }}
</span>
</a>
</li>
{% endif %}
{# MODULE #}
<li class="menu-bar-item">
<a id="validation_link" target="_blank" href="{{ path('lightbox') }}">
<img src="/assets/common/images/icons/menu-lightbox.png" class="mobilemenu"/>
<span>
{{ 'admin::monitor: module validation' | trans }}
</span>
</a>
</li>
{# MODULE #}
{% if module is defined and module == "prod" %}
{% if app.getAclForUser(app.getAuthenticatedUser()).has_access_to_module('upload') %}
<li class="menu-bar-item">
{% set link = path('upload_html5_form') %}
{% if not app['browser'].supportFileAPI() %}
{% set link = path('upload_flash_form') %}
{% endif %}
<a href="{{ link }}" class="uploader-open-action"
title="{{ 'Upload' | trans }}">
<img src="/assets/common/images/icons/menu-upload.png" class="mobilemenu"/>
<span>
{{ 'admin::monitor: module upload' | trans }}
</span>
</a>
</li>
{% endif %}
{% endif %}
{# MODULE #}
{% if module == "prod" %}
<li class="menu-bar-item">
<a href="#" class="state-navigation" data-state="publication">
<img src="/assets/common/images/icons/menu-publication.png" class="mobilemenu"/>
<span>
{{ 'Publications' | trans }}
</span>
</a>
</li>
{% endif %}
{% endif %}
{% if module is defined and module == "prod" and app.getAclForUser(app.getAuthenticatedUser()).has_right(constant('\\ACL::ORDER_MASTER')) %}
<li class="menu-bar-item">
<a href="#" class="order-open-action" title="{{ 'Orders manager' | trans }}">
{# MODULE #}
{% if module == "prod" %}
<li class="menu-bar-item">
<a href="#" class="state-navigation" data-state="publication">
<img src="/assets/common/images/icons/menu-publication.png" class="mobilemenu"/>
<span>
{{ 'Publications' | trans }}
</span>
</a>
</li>
{% endif %}
{% if module is defined and module == "prod" and app.getAclForUser(app.getAuthenticatedUser()).has_right(constant('\\ACL::ORDER_MASTER')) %}
<li class="menu-bar-item">
<a href="#" class="order-open-action" title="{{ 'Orders manager' | trans }}">
<span>
{{ 'Commandes' | trans }}
</span>
</a>
</li>
{% endif %}
</a>
</li>
{% endif %}
</ol>
</div>
@@ -235,11 +235,10 @@
<a target="_blank" href="https://docs.phraseanet.com/4.0/">
<span>
{{ 'phraseanet:: aide' | trans }}
<span style="display:inline-block;cursor:pointer;padding:0;border:none;padding-right:4px;padding-left:4px;"
id="help-trigger"> <i class="fa fa-caret-down" aria-hidden="true"></i></span>
</span>
</a>
<table cellspacing="0" cellpadding="0" style="display:none;" class="contextMenu helpcontextmenu">
<span id="help-trigger" class="help-trigger"> <i class="fa fa-caret-down" aria-hidden="true"></i></span>
<table cellspacing="0" cellpadding="0" class="contextMenu helpcontextmenu context-menu-theme-vistamenu-bar">
<tbody>
<tr>
<td>
@@ -301,6 +300,10 @@
<script type="text/javascript">
$(document).ready(function () {
$('body').on('click', '#help-trigger', function (event) {
$('#mainMenu .helpcontextmenu').toggleClass('shown');
console.log('mety');
});
// var key = 'help';
var configurationSettingLinks = {{ configuration|json_encode|raw }};
//seperate array based on location of link

View File

@@ -1,7 +1,7 @@
<div class="PNB" id="BasketBrowser">
<div class="PNB BasketBrowser" id="BasketBrowser">
<div class="PNB10 Browser">
<div class="PNB10" style="width:190px;right:auto;">
<div class="PNB10 leftBrowser">
<form name="BasketBrowser" method="GET" action="{{ path('prod_workzone_search') }}">
<input name="Query" class="Query search" placeholder="{{ 'Search baskets' | trans }}" type="text"/>
@@ -78,9 +78,46 @@
</form>
</div>
<div class="PNB results" style="left:220px;">
<div class="PNB results rightBrowser">
</div>
</div>
<div class="PNB10 Basket">
</div>
</div>
<style>
.dialog-Medium {
height: 523px!important;
}
.paginator a {
background: none!important;
border: 0;
border-radius: 0;
padding: 0 9px;
font-weight: bold;
}
.result_loader {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
</style>
<script>
//load the next result page
jQuery(document).ready(function(){
jQuery('.next_res').click(function(){
jQuery('.results').append('<img class="result_loader" src="/assets/common/images/icons/loading.svg">');
jQuery('.results').load($(this).attr('href'));
return false;
});
});
//load the prev result page
jQuery(document).ready(function(){
jQuery('.prev_res').click(function(){
jQuery('.results').append('<img class="result_loader" src="/assets/common/images/icons/loading.svg">');
jQuery('.results').load($(this).attr('href'));
return false;
});
});
</script>

View File

@@ -4,28 +4,9 @@
<table>
<tr>
<td>
{% if Total == 0 %}
{{ 'No results' | trans }}
{% elseif Total == 1 %}
{{ '1 result' | trans }}
{% else %}
{% trans with {'%Total%' : Total} %}%Total% results{% endtrans %}
{% endif %}
</td>
<td class="paginator">
{% if Page - 1 > 0 %}
<a href="{{ path('prod_workzone_search', { 'Query' : Query, 'Year' : Year, 'Type' : Type, 'Page' : (Page - 1) }) }}" class="result">
<img src="/assets/prod/images/Basket/Browser/left.png" />
</a>
{% endif %}
<span>
Page {{ Page }} / {{ MaxPage }}
</span>
{% if Page + 1 <= MaxPage %}
<a href="{{ path('prod_workzone_search', { 'Query' : Query, 'Year' : Year, 'Type' : Type, 'Page' : (Page + 1) }) }}" class="result">
<img src="/assets/prod/images/Basket/Browser/right.png" />
</a>
{% endif %}
{% transchoice Total %}
{0} No results|{1} Result|]1,Inf[ Results
{% endtranschoice %}
</td>
</tr>
</table>
@@ -33,43 +14,39 @@
<div class="PNB datas">
<div class="PNB" style="right:10px">
{% for Basket in Baskets %}
<div class="result {% if loop.index is odd %}odd{% endif %}">
<a href="{{ path('basket_delete', {basket: Basket.getId()}) }}" class="delete-basket close" title="{% trans %}Delete basket{% endtrans %}" style="color:#fff;padding:2px">×</a>
<div class="PNB10" style="right:15px;">
<table>
<tr>
<td class="thumbnail">
<div class="result {{ Basket.getArchived ? '' : 'unarchived' }}">
<a href="{{ path('basket_delete', {basket: Basket.getId()}) }}" class="delete-basket close icon-baseline-close-24px" title="{% trans %}Delete basket{% endtrans %}" style="color:#fff;padding:2px">&nbsp;</a>
<div class="PNB10 rightBrowserInner">
<div class="item-table">
<div class="thumbnail">
{% set BasketElement = Basket.getElements().first() %}
{% if BasketElement %}
{{thumbnail.format(BasketElement.getRecord(app).get_thumbnail(), 80, 80, '', true, false)}}
{{thumbnail.format(BasketElement.getRecord(app).get_thumbnail(), 150, 106, '', true, false)}}
{% endif %}
<div class="counter">
{{ Basket.getElements().count() }}
</div>
</td>
<td class="content">
</div>
<div class="content">
<h1 class="title">
<img class="loader" src="/assets/prod/images/Basket/Browser/loader.gif" />
{% if Basket.getValidation() is empty or Basket.getValidation().isInitiator(app.getAuthenticatedUser()) %}
<a href="{{ path('prod_baskets_basket_archive', { 'basket' : Basket.getId(), 'archive' : 1 }) }}" class="archiver archive_toggler" style="display:{{ Basket.getArchived ? 'none' : '' }};">
<span>
<img src="/assets/prod/images/Basket/Browser/archive.png"/>
</span>
&nbsp;
</a>
<a href="{{ path('prod_baskets_basket_archive', { 'basket' : Basket.getId(), 'archive' : 0 }) }}" class="unarchiver archive_toggler" style="display:{{ Basket.getArchived ? '' : 'none' }};">
<span>
<img src="/assets/prod/images/Basket/Browser/archived.png"/>
</span>
&nbsp;
</a>
{% endif %}
<a class="basket_link" href="{{ path('prod_workzone_basket', { basket : Basket.getId() }) }}">
{{ Basket.getName() }}
</a>
<span>{{ Basket.getName() }}</span>
<br><span class="basketCount">
{{ Basket.getElements().count() }} {{ ' records' }}
</span></a>
</h1>
{% if Basket.getPusher() %}
<p>
{% set user_name = '<a href="/user/' ~ Basket.getPusher().get_id() ~ '/" tooltipsrc="' ~ path('prod_tooltip_user', { 'usr_id' : Basket.getPusher(app).getId() }) ~ '" class="UserTips">' ~ Basket.getPusher(app).get_display_name() ~ '</a>' %}
{% set user_name = '<a href="/user/' ~ Basket.getPusher().getId() ~ '/" tooltipsrc="' ~ path('prod_tooltip_user', { 'usr_id' : Basket.getPusher(app).getId() }) ~ '" class="UserTips">' ~ Basket.getPusher(app).getDisplayName() ~ '</a>' %}
{% trans with {'%user_name%' : user_name} %}Received from %user_name%{% endtrans %}
</p>
{% endif %}
@@ -92,12 +69,11 @@
</p>
{% endif %}
</td>
</div>
<td>
</td>
</tr>
</table>
</div>
</div>
</div>
{% endfor %}
@@ -117,19 +93,16 @@
</td>
<td class="paginator">
{% if Page - 1 > 0 %}
<a href="{{ path('prod_workzone_search', { 'Query' : Query, 'Year' : Year, 'Type' : Type, 'Page' : (Page - 1) }) }}" class="result">
<img src="/assets/prod/images/Basket/Browser/left.png" />
</a>
<a href="{{ path('prod_workzone_search', { 'Query' : Query, 'Year' : Year, 'Type' : Type, 'Page' : (Page - 1) }) }}" class="result prev_res icon-round-chevron_left-24px">&nbsp;</a>
{% endif %}
<span>
Page {{ Page }} / {{ MaxPage }}
</span>
{% if Page + 1 <= MaxPage %}
<a href="{{ path('prod_workzone_search', { 'Query' : Query, 'Year' : Year, 'Type' : Type, 'Page' : (Page + 1) }) }}" class="result">
<img src="/assets/prod/images/Basket/Browser/right.png" />
</a>
<a href="{{ path('prod_workzone_search', { 'Query' : Query, 'Year' : Year, 'Type' : Type, 'Page' : (Page + 1) }) }}" class="result next_res icon-round-chevron_right-24px">&nbsp;</a>
{% endif %}
</td>
</tr>
</table>
</div>

View File

@@ -196,8 +196,10 @@
<div style="position:absolute; top:0px; left:0px; right:70px; height:17px;">
<input type='text' style="font-size:15px; position:absolute; top:0px; left:0px; width:100%; height:100%;" id="EditTextMultiValued" value="" />
</div>
<div style="position:absolute; top:6px; width:60px; right:0px; height:11px;">
<img id="EditButAddMultiValued add-multivalued-field-action" style="cursor:pointer" src="/assets/common/images/icons/plus16.png" />
<div style="position:absolute; top:4px; width:60px; right:6px; height:24px;">
<button type="submit" class="submit-multivalued">
<img id="EditButAddMultiValued" style="cursor:pointer" src="/assets/common/images/icons/plus16.png" />
</button>
</div>
</form>
<div id="ZTextMultiValued_values"></div>

View File

@@ -14,6 +14,7 @@ use Alchemy\Phrasea\Model\Entities\LazaretSession;
use Alchemy\Phrasea\Model\Entities\Task;
use Alchemy\Phrasea\Model\Entities\User;
use Alchemy\Phrasea\SearchEngine\SearchEngineOptions;
use Alchemy\Phrasea\Status\StatusStructureProviderInterface;
use Doctrine\Common\Collections\ArrayCollection;
use Guzzle\Common\Exception\GuzzleException;
use Ramsey\Uuid\Uuid;
@@ -1256,13 +1257,33 @@ class ApiJsonTest extends ApiTestCase
$record1 = $this->getRecord1();
$route = '/api/v1/records/' . $record1->getDataboxId() . '/' . $record1->getRecordId() . '/setstatus/';
$record_status = strrev($record1->getStatus());
$initialRecordStatus = $record_status = strrev($record1->getStatus());
/** @var StatusStructureProviderInterface $statusProvider */
$statusProvider = $app['status.provider'];
// initialize status structure for test eg: 4 to 15 bit
foreach (range(4, 15) as $n) {
$properties = [
'searchable' => '0',
'printable' => '0',
'name' => 'status_test_' . $n,
'labelon' => '',
'labeloff' => '',
'labels_on' => [],
'labels_off' => [],
];
$statusProvider->updateStatus($record1->getStatusStructure(), $n, $properties);
}
$statusStructure = $record1->getStatusStructure();
$tochange = [];
foreach ($statusStructure as $n => $datas) {
$tochange[$n] = substr($record_status, ($n - 1), 1) == '0' ? '1' : '0';
}
$this->evaluateMethodNotAllowedRoute($route, ['GET', 'PUT', 'DELETE']);
$response = $this->request('POST', $route, $this->getParameters(['status' => $tochange]), ['HTTP_Accept' => $this->getAcceptMimeType()]);
@@ -1281,6 +1302,27 @@ class ApiJsonTest extends ApiTestCase
$this->assertEquals(substr($record_status, ($n), 1), $tochange[$n]);
}
// test record_status in string
$record_status_expected = $record_status;
$pos = strpos($record_status, '1');
$bitToChange[$pos] = '1';
$response = $this->request('POST', $route, $this->getParameters(['status' => $bitToChange]), ['HTTP_Accept' => $this->getAcceptMimeType()]);
$content = $this->unserialize($response->getContent());
// Get fresh record_1
$testRecord = new \record_adapter($app, $testRecord->getDataboxId(), $testRecord->getRecordId());
$this->evaluateResponse200($response);
$this->evaluateMeta200($content);
$this->evaluateRecordsStatusResponse($testRecord, $content);
$record_new_status = strrev($testRecord->getStatus());
$this->assertEquals($record_status_expected, $record_new_status);
foreach ($tochange as $n => $value) {
$tochange[$n] = $value == '0' ? '1' : '0';
}
@@ -1301,6 +1343,8 @@ class ApiJsonTest extends ApiTestCase
$this->assertEquals(substr($record_status, ($n), 1), $tochange[$n]);
}
$this->assertEquals($initialRecordStatus, $record_status);
$record1->setStatus(str_repeat('0', 32));
}

View File

@@ -7555,10 +7555,10 @@ phraseanet-common@^0.4.1:
js-cookie "^2.1.0"
pym.js "^1.3.1"
phraseanet-production-client@^0.34.53-d:
version "0.34.53-d"
resolved "https://registry.yarnpkg.com/phraseanet-production-client/-/phraseanet-production-client-0.34.53-d.tgz#517e5d9ccae2f1f0f3cdb7ac194e70579cbcc65f"
integrity sha512-/Vd5kd/YRapDpUWzBZZvm5hHwieXdU2cBEtC3D/FPbeSEI3dmYEDnuznDxBafPZvep65KdAtufPw+B6ulWNgBQ==
phraseanet-production-client@0.34.72-d:
version "0.34.72-d"
resolved "https://registry.yarnpkg.com/phraseanet-production-client/-/phraseanet-production-client-0.34.72-d.tgz#028a5ccd589e696b5433eea9d53d9367966613c8"
integrity sha512-IPaDRqXwyJegoKmzr56bggxTzN4TnmuAqU4O7rDEhh0aqdCiuC8rlH/yzKoLeEIMSrESCw5mBhrI//ccntvv9w==
dependencies:
"@mapbox/mapbox-gl-language" "^0.9.2"
"@turf/turf" "^5.1.6"