Files
Phraseanet/templates/web/client/index.html.twig
2013-05-29 14:22:50 +02:00

510 lines
41 KiB
Twig

<html lang="{{ app['locale.I18n'] }}">
<head>
<title>{{ app['phraseanet.registry'].get('GV_homeTitle') }} Client</title>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" type="image/x-icon" href="/skins/client/favicon.ico" />
<style ID="MYS" type="text/css">
IMG.hthbimg {
WIDTH: 108px;
}
IMG.vthbimg {
HEIGHT: 108px;
}
.w160px {
WIDTH: 128px;
}
.h160px {
HEIGHT: 128px;
}
</style>
<link rel="stylesheet" type="text/css" href="/include/jslibs/jquery-ui-1.8.17/css/dark-hive/jquery-ui-1.8.17.custom.css" />
<link type="text/css" rel="stylesheet" href="/include/minify/?f=include/jslibs/jquery.contextmenu.css,skins/common/main.css" />
<link type="text/css" rel="stylesheet" href="/include/minify/?f=skins/client/clientcolor.css" />
{% if css_file %}
<link id="skinCss" type="text/css" rel="stylesheet" href="/include/minify/?f={{ css_file }}" />
{% endif %}
<style>
#PREVIEWCURRENTCONT {
top:0;
left:0;
right:0;
bottom:0;
}
</style>
<!--[if IE 6]>
<link type="text/css" rel="stylesheet" href="/include/minify/?f=skins/client/ie6.css" >
<![endif]-->
<script type="text/javascript" src="/include/minify/?f=include/jslibs/jquery-1.7.1.js"></script>
<script type="text/javascript" src="/include/minify/?f=include/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript" src="/include/jslibs/jquery-ui-1.8.17/js/jquery-ui-1.8.17.custom.min.js"></script>
<script type="text/javascript" src="/include/minify/?g=client"></script>
<script type="text/javascript" src="/include/jslibs/flowplayer/flowplayer-3.2.11.min.js"></script>
</head>
<body class="PNB" style="overflow:hidden;width:100%;height:100%;">
<div id="container" style="position:absolute;top:0;left:0;overflow:hidden;width:100%;height:100%;">
{{ menubar|raw }}
<div style="top:30px;position:relative;float:left;">
<div id="left" style="height:100%;width:265px;position:relative;float:left;">
<div style="overflow:hidden;border:none;padding:0;margin:0;position:relative;top:0px;height:0px;width:265px;" id="search">
<div class="bodyLeft" style="top:3px;">
<div id="bigTabsBckg">
<table align="center" border="0" style="table-layout:fixed; top:1px; left:2px;height:22px; width:253px;" cellpadding="0" cellspacing="0">
<tr>
{% set active_tab = '' %}
{% for key_tab, tab in tabs_setup %}
{% if key_tab != 0 %}
{% set tab_active = key_tab == app['phraseanet.registry'].get('GV_ong_actif') ? 'actif' : 'inactif' %}
{% if tab == 1 %}
{% if tab_active == 'actif' %}
{% set active_tab = 'ongSearch' %}
{% endif %}
<td class="bigTabs {{ tab_active }}" id="ongSearch" onclick="chgOngSearch('ongSearch');">{% trans 'client:: recherche' %}</td>
{% elseif tab == 2 %}
{% if tab_active == 'actif' %}
{% set active_tab = 'ongAdvSearch' %}
{% endif %}
<td class="bigTabs {{ tab_active }}" id="ongAdvSearch" onclick="chgOngSearch('ongAdvSearch');return(false);">{% trans 'client:: recherche avancee' %}</td>
{% elseif tab == 3 %}
{% if tab_active == 'actif' %}
{% set active_tab = 'ongTopic' %}
{% endif %}
<td class="bigTabs {{ tab_active }}" id="ongTopic" onclick="chgOngSearch('ongTopic');return(false);"><{% trans 'client:: topics' %}</td>
{% endif %}
{% endif %}
{% endfor %}
</tr>
</table>
</div>
<form style="margin:0px; padding:0px;" name="search" id="searchForm" action="{{ path('client_query') }}" onkeypress="if(event.keyCode==13){ doSearch();return false;}" method="post">
<div id="idongSearch">
<div id="mainSearch" style="overflow:hidden;">
<div>
<div>
<input type="text" name="qry" value="{{ start_page_query }}" id="qry" style="width:245px;">
</div>
<div id="idongAdvSearch" style="display:none;">
<div>
<select name="opAdv[]" style="width:54px">
<option value="{% trans "phraseanet::technique:: et" %}">{% trans "phraseanet::technique:: et" %}</option>
<option value="{% trans "phraseanet::technique:: or" %}">{% trans "phraseanet::technique:: or" %}</option>
<option value="{% trans "phraseanet::technique:: except" %}">{% trans "phraseanet::technique:: except" %}</option>
</select>
<input type="text" name="qryAdv[]" id="qryAdv1" style="width:185px">
</div>
<div>
<select name="opAdv[]" style="width:54px">
<option value="{% trans "phraseanet::technique:: et" %}">{% trans "phraseanet::technique:: et" %}</option>
<option value="{% trans "phraseanet::technique:: or" %}">{% trans "phraseanet::technique:: or" %}</option>
<option value="{% trans "phraseanet::technique:: except" %}">{% trans "phraseanet::technique:: except" %}</option>
</select>
<input type="text" name="qryAdv[]" id="qryAdv2" style="width:185px">
</div>
</div>
{% if app['phraseanet.registry'].get('GV_client_coll_ckbox') == 'popup' %}
<div>
{% trans "client::recherche: rechercher dans les bases :" %}
{% if app['phraseanet.appbox'].get_databoxes()|length > 0 %}
<select id="basSelector" onchange="beforeAnswer();" style="width:245px;">
<option value="{{ storage_access['collections']|keys|join(';') }}">{% trans "client::recherche: rechercher dans toutes les bases" %}</option>
{% for sbasId, databoxWrapper in storage_access['databoxes'] %}
{% set databox = databoxWrapper['databoxes'] %}
{% set collections = databoxWrapper['collections'] %}
{% if collections|length > 0 %}
<optgroup label="{{ databox.get_viewname() }}">
<option value="{{ collection|keys|join(';') }}">{{ databox.get_viewname() }}</option>
{% for collId, collection in collections %}
<option value="{{ collId }}" checked="checked">{{ collection.get_name() }}</option>
{% endfor %}
</optgroup>
{% endif %}
{% endfor %}
</select>
{% endif %}
</div>
{% endif %}
<div>
<select title="{% trans "phraseanet:: presentation des resultats" %}" name="mod" id="mod" onChange="changeModCol();" >
{% for property in grid_properties %}
{% set selected = '' %}
{% if mod_pres is empty %}
{% if property['selected'] == '1' %}
{% set selected = 'selected' %}
{% endif %}
{% elseif mod_pres == property['h'] ~ 'X' ~ property['w'] %}
{% set selected = 'selected' %}
{% endif %}
<option {{ selected }} value="{{ property['h'] ~ 'X' ~ property['w'] }}"> {{ property['name'] }}</option>
{% endfor %}
</select>
<input type="radio" value="0" class="checkbox" {% if app['phraseanet.registry'].get('GV_defaultQuery_type') == 0 %}checked="checked"{% endif %} id="search_type_docs" name="search_type" /><label for="search_type_docs">{% trans "phraseanet::type:: documents" %}</label>
<input type="radio" value="1" class="checkbox" {% if app['phraseanet.registry'].get('GV_defaultQuery_type') != 0 %}checked="checked"{% endif %} id="search_type_group" name="search_type" /><label for="search_type_group">{% trans "phraseanet::type:: reportages" %}</label>
<input type="hidden" name="sort" value="{{ app['phraseanet.registry'].get('GV_phrasea_sort') }}"/>
<input type="hidden" name="ord" id="searchOrd" value="{{ search_order }}" />
</div>
<div>
<div style="text-align:center;"><input class="pointer" type="button" onclick="doSearch();" value="{% trans "boutton::rechercher" %}" /></div>
</div>
</div>
<input type="hidden" name="pag" id="formAnswerPage" value="">
<input type="hidden" name="nba" value="">
<div class="onglets" style="white-space: nowrap; margin-left: 5px; width: 227px;">
{% if app['phraseanet.registry'].get('GV_client_coll_ckbox') == 'checkbox' %}
<span id="idOnglet1" class="actif actives" onclick="chgOng(1);">
{% trans "phraseanet:: collections" %} <img onclick="removeFilters();" id="filter_danger" src="/skins/icons/alert.png" title="{% trans "client::recherche: cliquez ici pour desactiver tous les filtres de toutes base" %}" style="vertical-align:bottom;width:12px;height:12px;display:none;"/>
</span>
{% endif %}
{% if app['phraseanet.registry'].get('GV_thesaurus') %}
<span id="idOnglet4" class="{{ app['phraseanet.registry'].get('GV_client_coll_ckbox') == 'checkbox' ? "inactif" : "actif" }} actives" onclick="chgOng(4);">
{% trans "phraseanet:: propositions" %}
</span>
{% endif %}
<span id="idOnglet5" class="{{ not app['phraseanet.registry'].get('GV_client_coll_ckbox') == 'checkbox' and not app['phraseanet.registry'].get('GV_thesaurus') ? 'actif' : 'inactif' }} actives" onclick="chgOng(5);">
{% trans "phraseanet:: historique" %}
</span>
</div>
</div>
<div id="searchMiddle" style="">
{% if app['phraseanet.registry'].get('GV_client_coll_ckbox') == 'checkbox' %}
<div id="onglet1" style="display:block;height:100%;overflow-x: hidden; overflow-y: auto;" class="searchZone" >
<div>
<div style="text-align:center;margin:5px;">
<input id="bases_all" class="actives" type="button" value="{% trans 'boutton:: selectionner toutes les bases' %}" onclick="checkBases(true);"/>
<input id="bases_none" class="actives" type="button" value="{% trans 'boutton:: selectionner aucune base' %}" onclick="checkBases(false);"/>
</div>
</div>
<div>
<div class="basesContainer">
{% for sbasId, databoxWrapper in storage_access['databoxes'] %}
{% set databox = databoxWrapper['databox'] %}
{% if app['phraseanet.registry'].get('GV_view_bas_and_coll') %}
<div class="basContainer">
<div class="basContTitle">
<div class="basTitle">
<input class="basChecker checkbox" id="basChecker{{ sbasId }}" type="checkbox" onclick="chkSbas({{ sbasId }},this)" />
<label for="basChecker{{ sbasId }}">{{ databox.get_viewname() }}</label>
<img onclick="removeFilters({{ sbasId }});" id="filter_danger{{ sbasId }}" class="filter_danger" src="/skins/icons/alert.png" title="{% trans "client::recherche: cliquez ici pour desactiver tous les filtres de cette base" %}" style="vertical-align:bottom;width:12px;height:12px;display:none;"/>
</div>
{% set status_bit_filters = '' %}
{% for bit, data in databox.get_statusbits() if data['searchable'] %}
{% set html_status_bit %}
<div style="text-align:center;overflow:hidden;">' .
<table style="table-layout:fixed;width:90%;text-align:left;" cellspacing="0" cellpadding="0">
<tr>
<td style="width:50%" nowrap>
<input class="checkbox" db="{{ sbasId }}" onchange="checkFilters();" type="checkbox" name="status[]" id="statusfil_{{ sbasId }}_off{{ sbasId }}" value="{{ sbasId }}_of{{ sbasId }}"/>
<label title="{{ data['labeloff'] }}" for="statusfil_{{ sbasId }}_off{{ bit }}">{% if data['img_off'] %}<img src="'{{ datas['img_off'] }}" title="{{ datas['labeloff'] }}" style="width:16px;height:16px;vertical-align:bottom" />{% endif %}{{ data['labeloff'] }}</label>
</td>
<td style="width:50%" nowrap>
<input class="checkbox" db="{{ sbasId }}" onchange="checkFilters();" type="checkbox" name="status[]" id="statusfil_{{ sbasId }}_on{{ sbasId }}" value="{{ sbasId }}_on{{ sbasId }}"/>
<label title="{{ data['labelon'] }}" for="statusfil_{{ sbasId }}_on{{ bit }}">{% if data['img_on']%}<img src="{{ datas['img_on'] }}" title="{{ datas['labelon'] }}" style="width:16px;height:16px;vertical-align:bottom" />{% endif %}{{ data['labelon'] }}</label>
</td>
</tr>
</table>
</div>
{% endset %}
{% set status_bit_filters = status_bit_filters ~ '' ~ html_status_bit %}
{% endfor %}
{% set xml_structure = databox.get_sxml_structure() %}
{% if xml_structure %}
{% set date_filters = '' %}
{% set fields_filters = '' %}
{% if xml_structure.description %}
{% for f, field in xml_structure.description.children() %}
{% set field_type = '' %}
{% set field_searchclient = '' %}
{% for name, value in field.attributes() %}
{% if name == "type" %}
{% set field_type = value %}
{% endif %}
{% if name == "searchclient" %}
{% set field_searchclient = value %}
{% endif %}
{% endfor %}
{% if field_type == 'date' and field_searchclient == '1' %}
{% set date_filter_html %}
<div>
<table style="width:98%;text-align:left;" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2">
{{ f }}
</td>
</tr>
<tr>
<td style="width:50%;">
{% trans "phraseanet::time:: de" %}
</td>
<td style="width:50%;">
{% trans "phraseanet::time:: a" %}
</td>
</tr>
<tr>
<td style="width:50%;">
<input type="hidden" name="dateminfield[]" value="{{ sbasId }}_{{ f }}">
<input db="{{ sbasId }}" onchange="checkFilters();" class="datepicker" type="text" name="datemin[]">
</td>
<td style="width:50%;">
<input type="hidden" name="datemaxfield[]" value="{{ sbasId }}_{{ f }}">
<input db="{{ sbasId }}" onchange="checkFilters();" class="datepicker" type="text" name="datemax[]">
</td>
</tr>
</table>
</div>
{% endset %}
{% set date_filters = date_filters ~ '' ~ date_filter_html %}
{% elseif field_type != 'date' %}
{% set field_filter_html %}
<option value="{{ sbasId }}_{{ f }}">{{ f }}</option>
{% endset %}
{% set fields_filters = fields_filters ~ '' ~ field_filter_html %}
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
{% if status_bit_filters is not empty or fields_filters is not empty or date_filters is not empty %}
<div class="filter">
<span class="actives" onclick="toggleFilter('Filters{{sbasId}}',this);">
{% trans "client::recherche: filter sur" %}
</span>
</div>
<div id="Filters{{ sbasId }}" class="base_filter" style="display:none;">
{% if date_filters is not empty %}
<div class="filterTitle">{% trans "client::recherche: filtrer par dates" %}</div>
{{ date_filters|raw }}
{% endif %}
{% if status_bit_filters is not empty %}
<div class="filterTitle">{% trans "client::recherche: filtrer par status" %}</div>
{{ status_bit_filters|raw }}
{% endif %}
{% if fields_filters is not empty %}
<div class="filterTitle">{% trans "client::recherche: filtrer par champs" %}</div>
<div>
<select db="{{sbasId}}" onchange="checkFilters();" name="infield[]" style="width:165px;">
<option value="" selected="selected">{% trans 'client::recherche: filtrer par champs : tous les champs' %}</option>
{{ fields_filters|raw }}
</select>
</div>
{% endif %}
</div>
<div style="height:4px;">&nbsp;</div>
{% endif %}
</div>
</div>
{% endif %} {# decalage ici a verifier l 421 fichier original #}
<div class="basGrp">
{% for collId, collection in storage_access['collections'] %}
<div>
<input type="checkbox" class="checkbox basItem basItem{{ sbasId }}" checked name="bas[]" id="basChk{{ collId}}" value="{{ collId }}">
<label for="basChk{{ collId }}">{{ collection.get_name() }}</label>
</div>
{% endfor %}
</div>
{% endfor %}
</div>
</div>
</div>
{% endif %}
{% if app['phraseanet.registry'].get('GV_thesaurus') %}
<div id="onglet4" style="{% if app['phraseanet.registry'].get('GV_client_coll_ckbox') == 'checkbox' %}display:none;{% endif %}height:100%;overflow-x: hidden; overflow-y: auto;" class="searchZone" >
<div>
<div id="proposals" style="width:235px; overflow:hidden"></div>
</div>
</div>
{% endif %}
<div id="onglet5" style="{% if app['phraseanet.registry'].get('GV_client_coll_ckbox') == 'checkbox' or app['phraseanet.registry'].get('GV_thesaurus') %}display:none;{% endif %}height:100%;overflow-x: hidden; overflow-y: auto;" class="searchZone" >
<div id="history"></div>
</div>
</div>
</form>
<div id="idongTopic" style="overflow-x:hidden;overflow-y:auto;">
{{ render_topics|raw }}
</div>
<div class="bodySearchBottom">
</div>
</div>
</div>
</div>
<div id="baskets" class="loading" style="overflow:hidden;border:none;padding:0;margin:0;position:relative;bottom:0;width:265px;height:320px;">
</div>
</div>
<div id="right" style="position:relative;top:0;height:100%;float:right;">
<div id="nb_answersEXT">
<div id="nb_answers"></div>
</div>
<div id="answers" style="overflow-x:auto;overflow-y:auto;border:none;padding:0;margin:0;position:relative;left:0;top:0;margin:10px 0;">
{{ phrasea_home|raw }}
</div>
<div class="divNavig" id="navigation"></div>
</div>
</div>
<div id="OVERLAY" style="display:none;"></div>
<div id="PREVIEWBOX" style="overflow:hidden;">
<div id="PREVIEWTITLE" style="height:50px;">
<div style="margin:0 20px 8px;height:34px;">
<span id="SPANTITLE" style="font-size:16px;font-weight:bold;"> </span>
<div style="position:absolute;right:0;top:0;">
<div onclick="closePreview();" style="cursor:pointer;color:#CCCCCC;font-size:12px;font-weight:bold;text-align:right;text-decoration:underline;">
{% trans 'boutton::fermer' %}
</div>
</div>
</div>
</div>
<div id="PREVIEWLEFT" class="preview_col" style="width:49%;position:relative;float:left;overflow:hidden;">
<div id="PREVIEWCURRENT" class="debug preview_col_film" style="margin-left:20px;">
<div id="PREVIEWCURRENTGLOB" style="position:relative;float:left;">
</div>
</div>
<div id="PREVIEWIMGCONT" class="preview_col_cont" style="overflow-x:hidden;overflow-y:hidden;text-align:left;"></div>
</div>
<div id="PREVIEWRIGHT" class="preview_col" style="width:49%;position:relative;float:right;overflow:hidden;">
<div style="margin-right:10px;">
<div id="PREVIEWIMGDESC" class="preview_col_cont" style="overflow-x:hidden;overflow-y:auto;">
<ul style="height:30px;overflow:hidden;">
<li><a href="#PREVIEWIMGDESCINNER-BOX">{% trans 'preview:: Description' %}</a></li>
<li><a href="#HISTORICOPS-BOX">{% trans 'preview:: Historique' %}</a></li>
<li><a href="#popularity-BOX">{% trans 'preview:: Popularite' %}</a></li>
</ul>
<div id="PREVIEWIMGDESCINNER-BOX" class="descBoxes">
<div id="PREVIEWIMGDESCINNER" style="margin:10px;overflow-x:hidden;overflow-y:auto;">
</div>
</div>
<div id="HISTORICOPS-BOX" class="descBoxes">
<div id="HISTORICOPS" style="margin:10px;overflow-x:hidden;overflow-y:auto;">
</div>
</div>
<div id="popularity-BOX" class="descBoxes">
<div id="popularity" style="margin:10px;overflow-x:hidden;overflow-y:auto;">
</div>
</div>
</div>
<div id="PREVIEWOTHERS" class="preview_col_film" style="overflow-x:hidden;overflow-y:auto;">
<div id="PREVIEWOTHERSINNER" style="margin:0 0 0 20px;position:relative;float:left;width:100%;"></div>
</div>
</div>
</div>
</div>
<div id="PREVIEWHD"></div>
<div id="DIALOG"></div>
<div id="MESSAGE"></div>
</div>
<iframe id="MODALDL" class="modalbox" src="" name="download" frameborder="0"></iframe>
<div id="dialog_dwnl" title="{% trans 'action : exporter' %}" style="display:none;z-index:12000;">
</div>
<form name="formChu" id="formChu" action="/client/baskets/" method="post" style="visibility:hidden; display:none" >
<input type="hidden" name="sbas" id="formChubas" value="">
{#<input type="hidden" name="act" id="formChuact" value="">#}
<input type="hidden" name="p0" id="formChup0" value="">
<input type="hidden" name="ssel_id" value="">
<input type="hidden" name="courChuId" id="formChuBaskId" value="">
</form>
<form name="validatorEject" target="wVal" id="validatorEject" action="/lightbox/" method="get" style="visibility:hidden; display:none" >
<input type="hidden" name="ssel_id" id="ssel2val" value="">
<input type="hidden" name="mode" value="0">
</form>
<form name="logout" target="_self" id="logout" action="/login/logout/" method="post" style="visibility:hidden; display:none" >
<input type="hidden" name="app" value="client">
</form>
<script type="text/javascript">
function reModCol()
{
var mod_col = $('#mod')[0].options[$('#mod')[0].selectedIndex].value.split('X');
if(mod_col[0])
mod_col = mod_col[1]
var w = Math.round((bodyW - 16) / (mod_col==1?4:mod_col)) - 12;
if(w < 128)
w = 128;
var propname = document.styleSheets[0].cssRules ? "cssRules":"rules"; // firefox=cssRules ; safari,ie=rules
document.styleSheets[0][propname][0].style.width = (w-20)+"px"; // IMG.hthbimg
document.styleSheets[0][propname][1].style.height = (w-20)+"px"; // IMG.vthbimg
document.styleSheets[0][propname][2].style.width = (w)+"px"; // .w160px
document.styleSheets[0][propname][3].style.height = (w)+"px"; // .h160px
}
function sessionactive(){
$.ajax({
type: "POST",
url: "/session/update/",
dataType: 'json',
data: {
app : 2,
usr : {{ app['authentication'].getUser().get_id() }}
},
error: function(){
window.setTimeout("sessionactive();", 10000);
},
timeout: function(){
window.setTimeout("sessionactive();", 10000);
},
success: function(data){
if(data)
manageSession(data);
var t = 120000;
if(data.apps && parseInt(data.apps)>1)
t = Math.round((Math.sqrt(parseInt(data.apps)-1) * 1.3 * 120000));
window.setTimeout("sessionactive();", t);
return;
}
})
};
</script>
<script type="text/javascript" language="javascript">
var lastAct = null;
var baskDisplay = true;
$(document).ready(function(){
chgOngSearch('{{ active_tab }}');
checkBases(true);
{% if last_action is not none %}
lastAct = $.parseJSON('{{ last_action }}');
execLastAct(lastAct);
{% endif %}
{% if basket_status == '0' %}
baskDisplay = false;
{% else %}
baskDisplay = true;
{% endif %}
setBaskStatus();
});
</script>
{% if app['phraseanet.registry'].get('GV_googleAnalytics') is not empty %}
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("{{ app['phraseanet.registry'].get('GV_googleAnalytics') }}");
pageTracker._setDomainName("none");
pageTracker._setAllowLinker(true);
pageTracker._trackPageview();
} catch(err) {}
</script>
{% endif %}
</body>
</html>