mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-16 14:33:14 +00:00
PHRAS-1038 - fix story navigation in workzone context
This commit is contained in:

committed by
Benoît Burnichon

parent
4910beb251
commit
755aac9e3e
@@ -39,7 +39,7 @@ class eventsmanager_notify_push extends eventsmanager_notifyAbstract
|
|||||||
$sender = $user->getDisplayName();
|
$sender = $user->getDisplayName();
|
||||||
|
|
||||||
$ret = [
|
$ret = [
|
||||||
'text' => $this->app->trans('%user% vous a envoye un %before_link% panier %after_link%', ['%user%' => $sender, '%before_link%' => '<a href="#" onclick="openPreview(\'BASK\',1,\''
|
'text' => $this->app->trans('%user% vous a envoye un %before_link% panier %after_link%', ['%user%' => $sender, '%before_link%' => '<a href="#" onclick="openPreview(this, \'BASK\',1,\''
|
||||||
. $data['ssel_id'] . '\');return false;">', '%after_link%' => '</a>'])
|
. $data['ssel_id'] . '\');return false;">', '%after_link%' => '</a>'])
|
||||||
, 'class' => ($unread == 1 ? 'reload_baskets' : '')
|
, 'class' => ($unread == 1 ? 'reload_baskets' : '')
|
||||||
];
|
];
|
||||||
|
@@ -53,7 +53,7 @@ class eventsmanager_notify_validationreminder extends eventsmanager_notifyAbstra
|
|||||||
$basket_name = $this->app->trans('Une selection');
|
$basket_name = $this->app->trans('Une selection');
|
||||||
}
|
}
|
||||||
|
|
||||||
$bask_link = '<a href="#" onclick="openPreview(\'BASK\',1,\''
|
$bask_link = '<a href="#" onclick="openPreview(this, \'BASK\',1,\''
|
||||||
. $ssel_id . '\');return false;">'
|
. $ssel_id . '\');return false;">'
|
||||||
. $basket_name . '</a>';
|
. $basket_name . '</a>';
|
||||||
|
|
||||||
|
@@ -34,13 +34,21 @@ function getNewVideoToken(lst, obj) {
|
|||||||
* @param contId
|
* @param contId
|
||||||
* @param reload
|
* @param reload
|
||||||
*/
|
*/
|
||||||
function openPreview(env, pos, contId, reload) {
|
function openPreview(event, env, pos, contId, reload) {
|
||||||
|
|
||||||
if (contId == undefined)
|
if (contId == undefined)
|
||||||
contId = '';
|
contId = '';
|
||||||
var roll = 0;
|
var roll = 0;
|
||||||
var justOpen = false;
|
var justOpen = false;
|
||||||
|
|
||||||
|
var options_serial = p4.tot_options;
|
||||||
|
var query = p4.tot_query;
|
||||||
|
var navigation = p4.navigation;
|
||||||
|
var navigationContext = '';
|
||||||
|
|
||||||
|
// keep relative position for answer train:
|
||||||
|
var relativePos = pos;
|
||||||
|
var absolutePos = 0;
|
||||||
|
|
||||||
if (!p4.preview.open) {
|
if (!p4.preview.open) {
|
||||||
showOverlay();
|
showOverlay();
|
||||||
|
|
||||||
@@ -66,6 +74,15 @@ function openPreview(env, pos, contId, reload) {
|
|||||||
if (env == 'BASK')
|
if (env == 'BASK')
|
||||||
roll = 1;
|
roll = 1;
|
||||||
|
|
||||||
|
// if comes from story and in workzone
|
||||||
|
if (env == 'REG') {
|
||||||
|
navigationContext = 'storyFromResults';
|
||||||
|
var $source = $(event);
|
||||||
|
if( $source.hasClass('CHIM')) {
|
||||||
|
navigationContext = 'storyFromWorkzone';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reload === true)
|
if (reload === true)
|
||||||
@@ -78,21 +95,14 @@ function openPreview(env, pos, contId, reload) {
|
|||||||
|
|
||||||
$('#PREVIEWIMGCONT').empty();
|
$('#PREVIEWIMGCONT').empty();
|
||||||
|
|
||||||
var options_serial = p4.tot_options;
|
if (navigationContext === 'storyFromWorkzone') {
|
||||||
var query = p4.tot_query;
|
// if event comes from workzone, set to relative position (CHIM == chutier image)
|
||||||
var navigation = p4.navigation;
|
absolutePos = relativePos;
|
||||||
|
} else if (navigationContext === 'storyFromResults') {
|
||||||
// keep relative position for answer train:
|
|
||||||
var relativePos = pos;
|
|
||||||
// update real absolute position with pagination:
|
|
||||||
var absolutePos = parseInt(navigation.perPage,10) * (parseInt(navigation.page, 10) - 1) + parseInt(pos,10);
|
|
||||||
|
|
||||||
// if comes from story, work with relative positionning
|
|
||||||
if (env == 'REG') {
|
|
||||||
// @TODO - if event comes from workzone (basket|story),
|
|
||||||
// we can use the relative position in order to display the doubleclicked records
|
|
||||||
// except we can't know the original event in this implementation
|
|
||||||
absolutePos = 0;
|
absolutePos = 0;
|
||||||
|
} else {
|
||||||
|
// update real absolute position with pagination for records:
|
||||||
|
absolutePos = parseInt(navigation.perPage, 10) * (parseInt(navigation.page, 10) - 1) + parseInt(pos, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
prevAjax = $.ajax({
|
prevAjax = $.ajax({
|
||||||
@@ -361,7 +371,7 @@ function getNext() {
|
|||||||
if (p4.preview.mode == 'RESULT') {
|
if (p4.preview.mode == 'RESULT') {
|
||||||
posAsk = parseInt(p4.preview.current.pos) + 1;
|
posAsk = parseInt(p4.preview.current.pos) + 1;
|
||||||
posAsk = (posAsk >= parseInt(p4.tot) || isNaN(posAsk)) ? 0 : posAsk;
|
posAsk = (posAsk >= parseInt(p4.tot) || isNaN(posAsk)) ? 0 : posAsk;
|
||||||
openPreview('RESULT', posAsk, '', false);
|
openPreview(false, 'RESULT', posAsk, '', false);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!$('#PREVIEWCURRENT li.selected').is(':last-child'))
|
if (!$('#PREVIEWCURRENT li.selected').is(':last-child'))
|
||||||
@@ -383,7 +393,7 @@ function getPrevious() {
|
|||||||
// may go to last result
|
// may go to last result
|
||||||
posAsk = (posAsk < 0) ? ((parseInt(p4.tot) - 1)) : posAsk;
|
posAsk = (posAsk < 0) ? ((parseInt(p4.tot) - 1)) : posAsk;
|
||||||
}
|
}
|
||||||
openPreview('RESULT', posAsk, '', false);
|
openPreview(false, 'RESULT', posAsk, '', false);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!$('#PREVIEWCURRENT li.selected').is(':first-child'))
|
if (!$('#PREVIEWCURRENT li.selected').is(':first-child'))
|
||||||
@@ -431,7 +441,7 @@ function setCurrent(current) {
|
|||||||
var absolutePos = jsopt[1];
|
var absolutePos = jsopt[1];
|
||||||
var relativePos = parseInt(absolutePos, 10) - parseInt(p4.navigation.perPage, 10) * (parseInt(p4.navigation.page, 10) - 1);
|
var relativePos = parseInt(absolutePos, 10) - parseInt(p4.navigation.perPage, 10) * (parseInt(p4.navigation.page, 10) - 1);
|
||||||
// keep relative position for answer train:
|
// keep relative position for answer train:
|
||||||
openPreview(jsopt[0], relativePos, jsopt[2],false);
|
openPreview(this, jsopt[0], relativePos, jsopt[2],false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -277,7 +277,7 @@
|
|||||||
|
|
||||||
{% import 'common/thumbnail.html.twig' as thumbnail %}
|
{% import 'common/thumbnail.html.twig' as thumbnail %}
|
||||||
|
|
||||||
<div ondblclick="{% if wz_scope == 'groupings' %}openPreview('REG',{{ ord }},'{{container.get_sbas_id()}}_{{container.get_record_id()}}');{% else %}openPreview('BASK',{{ ord }},{{container.getId()}});{% endif %}"
|
<div ondblclick="{% if wz_scope == 'groupings' %}openPreview(this, 'REG',{{ ord }},'{{container.get_sbas_id()}}_{{container.get_record_id()}}');{% else %}openPreview(this, 'BASK',{{ ord }},{{container.getId()}});{% endif %}"
|
||||||
class="CHIM diapo CHIM_{{record.get_serialize_key()}}" style="height:{{box_height}}px;"
|
class="CHIM diapo CHIM_{{record.get_serialize_key()}}" style="height:{{box_height}}px;"
|
||||||
id="CHIM_{% if wz_scope == 'groupings' %}{{record.get_serialize_key()}}{% else %}{{ contained.getId() }}{% endif %}">
|
id="CHIM_{% if wz_scope == 'groupings' %}{{record.get_serialize_key()}}{% else %}{{ contained.getId() }}{% endif %}">
|
||||||
<input type="hidden" name="id" value="{{ record.get_serialize_key() }}"/>
|
<input type="hidden" name="id" value="{{ record.get_serialize_key() }}"/>
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li class="title">{{ 'Apparait aussi dans ces reportages' | trans }}</li>
|
<li class="title">{{ 'Apparait aussi dans ces reportages' | trans }}</li>
|
||||||
{% for par in parents %}
|
{% for par in parents %}
|
||||||
<li onclick="openPreview('REG',0,'{{par.get_serialize_key()}}', true); return(false);"
|
<li onclick="openPreview(this, 'REG',0,'{{par.get_serialize_key()}}', true); return(false);"
|
||||||
class="otherRegToolTip" {% if app['conf'].get(['registry', 'classic', 'stories-preview']) %}tooltipsrc="{{ path('prod_tooltip_caption', { 'sbas_id' : par.get_sbas_id(), 'record_id' : par.get_record_id(), 'context' : 'basket' }) }}" {% endif %}>
|
class="otherRegToolTip" {% if app['conf'].get(['registry', 'classic', 'stories-preview']) %}tooltipsrc="{{ path('prod_tooltip_caption', { 'sbas_id' : par.get_sbas_id(), 'record_id' : par.get_record_id(), 'context' : 'basket' }) }}" {% endif %}>
|
||||||
<img src="{{par.get_thumbnail().get_url()}}" style="width:25px;height:25px;"/>
|
<img src="{{par.get_thumbnail().get_url()}}" style="width:25px;height:25px;"/>
|
||||||
<span class="title" title="{{ par.get_title() }}"> {{ par.get_title() }} </span>
|
<span class="title" title="{{ par.get_title() }}"> {{ par.get_title() }} </span>
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li class="title">{{ 'Apparait aussi dans ces paniers' | trans }}</li>
|
<li class="title">{{ 'Apparait aussi dans ces paniers' | trans }}</li>
|
||||||
{% for basket in baskets %}
|
{% for basket in baskets %}
|
||||||
<li onclick="openPreview('BASK',0,'{{basket.getId()}}',true); return(false);"
|
<li onclick="openPreview(this, 'BASK',0,'{{basket.getId()}}',true); return(false);"
|
||||||
class="otherBaskToolTip" title="{{basket.getDescription()}}">
|
class="otherBaskToolTip" title="{{basket.getDescription()}}">
|
||||||
{#<img style="vertical-align:middle" src="/assets/common/images/icons/basket.png" width="16">#}
|
{#<img style="vertical-align:middle" src="/assets/common/images/icons/basket.png" width="16">#}
|
||||||
|
|
||||||
|
@@ -25,7 +25,7 @@
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
<div id="PREVMAINREG" class="PNB10">
|
<div id="PREVMAINREG" class="PNB10">
|
||||||
<img onclick="openPreview('REG',0,'{{story.get_serialize_key}}')"
|
<img onclick="openPreview(this, 'REG',0,'{{story.get_serialize_key}}')"
|
||||||
src="{{url}}"
|
src="{{url}}"
|
||||||
style="
|
style="
|
||||||
width:{{fit_size.width}}px;
|
width:{{fit_size.width}}px;
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
sbas="{{ record.databoxId }}"
|
sbas="{{ record.databoxId }}"
|
||||||
id="{{'PUBLI_' ~ entry.id ~ '_' ~ record.id }}"
|
id="{{'PUBLI_' ~ entry.id ~ '_' ~ record.id }}"
|
||||||
class="IMGT diapo type-{{ record.type }}"
|
class="IMGT diapo type-{{ record.type }}"
|
||||||
onDblClick="openPreview('FEED',{{ record.getNumber }},{{ entry.id }});"
|
onDblClick="openPreview(this, 'FEED',{{ record.getNumber }},{{ entry.id }});"
|
||||||
>
|
>
|
||||||
<div style="padding: 4px;">
|
<div style="padding: 4px;">
|
||||||
<div style="height:40px; position: relative; z-index: 95;margin-bottom:0;border-bottom:none;">
|
<div style="height:40px; position: relative; z-index: 95;margin-bottom:0;border-bottom:none;">
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
sbas="{{ record.databoxId }}"
|
sbas="{{ record.databoxId }}"
|
||||||
id="{{ prefix|default('IMGT') }}_{{ record.id }}"
|
id="{{ prefix|default('IMGT') }}_{{ record.id }}"
|
||||||
class="IMGT diapo {% if record.story %}grouping{% endif %} type-{{ record.type }}"
|
class="IMGT diapo {% if record.story %}grouping{% endif %} type-{{ record.type }}"
|
||||||
onDblClick="openPreview('{{ record.story ? 'REG' : 'RESULT' }}', '{{ record.position|default(0) }}', '{{ record.id }}');">
|
onDblClick="openPreview(this, '{{ record.story ? 'REG' : 'RESULT' }}', '{{ record.position|default(0) }}', '{{ record.id }}');">
|
||||||
<div style="padding: 4px;">
|
<div style="padding: 4px;">
|
||||||
<div style="height:40px; position: relative; z-index: 95;margin-bottom:0;border-bottom:none;">
|
<div style="height:40px; position: relative; z-index: 95;margin-bottom:0;border-bottom:none;">
|
||||||
<div class="title" style="max-height:100%" title="{{ record.title(app.locale) }}">
|
<div class="title" style="max-height:100%" title="{{ record.title(app.locale) }}">
|
||||||
|
Reference in New Issue
Block a user