Merge branch 'master' of https://github.com/alchemy-fr/Phraseanet into PHRAS-2430_Port_to_41-Advance_search_refacto_Restore_Query

This commit is contained in:
Harrys Ravalomanana
2019-04-30 13:48:29 +04:00
49 changed files with 1514 additions and 474 deletions

View File

@@ -232,12 +232,93 @@
</div>
</div>
<div class="well well-large" style="border: 1px solid #333333;">
<div style="max-width: 400px;margin-left: 52px">
<div style="max-width: 400px;margin-left: 2%;display: inline-block;width: 47%;margin-right: 1%;">
<input type="submit" class="btn btn-info btn-block btn-large" value="{{ 'boutton::valider' | trans }}"/>
</div>
<div style="max-width: 400px;margin-left: 1%;width: 47%;display: inline-block;margin-right: 2%;float: right;">
{% if not user.isadmin() and not user.hasLdapCreated() and (owned_feeds|length == 0) and (initiated_validations|length == 0) %}
<a href="#delete-account-process" type="button" role="button" data-toggle="modal" class="btn btn-danger btn-block btn-large">{{ 'phraseanet::account: Delete my account' | trans }}</a>
<!-- Modal -->
<div id="delete-account-process" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">{{ "phraseanet::account: Process to delete account" }}</h3>
</div>
<div class="modal-body">
<p>{{ "phraseanet::account: Are you sure you want to delete your account?" | trans }} </p>
<h6>{{ "phraseanet::account: List of data to be deleted" | trans }}</h6>
{% if baskets|length > 0 %}
- {{ 'Paniers' | trans }}
<ul style="padding-left: 30px">
{% for basket in baskets %}
<li>{{ basket.getName() }}</li>
{% endfor %}
</ul>
{% endif %}
{% if api_accounts|length > 0 %}
- {{ "My application " | trans }}
<ul style="padding-left: 30px">
{% for api_account in api_accounts %}
<li>{{ api_account.getApplication().getName() ~ " => Client_id: " ~ api_account.getApplication().getClientId() }}</li>
{% endfor %}
</ul>
{% endif%}
- {{ "phraseanet::account: My phraseanet account" | trans }}
<ul style="padding-left: 30px">
<li>Name : {{ user.getFirstName() ~ ' ' ~ user.getLastName() }}</li>
<li>Login : {{ user.getLogin() }}</li>
</ul>
</div>
<div class="modal-footer">
<label style="text-align: left;" class="form_label checkbox" for="delete_account_aggree">
{% if app['conf'].get(['user_account', 'deleting_policies', 'email_confirmation']) %}
{{ "phraseanet::account: I am agree to delete my account, need confirmation on mail" | trans }}
{% else %}
{{ "phraseanet::account: I am agree to delete my account" | trans }}
{% endif %}
<input class="input_element input-xlarge" type="checkbox" id="delete_account_aggree"/>
</label>
<button class="btn" data-dismiss="modal" aria-hidden="true">{{ "No" | trans }}</button>
<a id="delete_account_confirm" class="btn btn-info" style="opacity:0.5;pointer-events: none;" >{{ "Yes" | trans }}</a>
</div>
</div>
{% else %}
<p style="font-size: 12px"> {{ "phraseanet::account: << your account can be deleted via admin interface >> " | trans }}</p>
{% endif %}
</div>
</div>
</div>
</form>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
var deleteButton = $("#delete_account_confirm");
$("#delete_account_aggree").bind("click", function(e) {
if ($(this).is(":checked")) {
deleteButton.attr("href", '{{ path("account_process_delete") }}');
deleteButton.css({"opacity": "1", "pointer-events": "auto"});
} else {
deleteButton.removeAttr("href");
deleteButton.css({"opacity": "0.5", "pointer-events": "none"});
}
});
});
</script>
{% endblock %}

View File

@@ -94,7 +94,7 @@
<tbody>
{% for session in data['sessions'] %}
{% set row = session['session'] %}
<tr title="{{ _self.tooltip_connected_users(row) | raw }}" class="{% if loop.index is odd %}odd{% else %}even{% endif %} usrTips" id="TREXP_{{ row.getId()}}">
<tr title="{{ _self.tooltip_connected_users(row) | e }}" class="{% if loop.index is odd %}odd{% else %}even{% endif %} usrTips" id="TREXP_{{ row.getId()}}">
{% if row.getId() == app['session'].get('session_id') %}
<td style="color:#ff0000"><i>{{ row.getUser().getDisplayName() }}</i></td>

View File

@@ -49,7 +49,13 @@
<!-- End of header table -->
<!-- Subject table -->
<table width="90%" cellpadding="0" cellspacing="0" border="0" align="center" style="width:90% !important;">
<tr style="background-color:#a6aab0">
<tr style=
{% if mailSkin == constant('Alchemy\\Phrasea\\Notification\\Mail\\MailRequestAccountDelete::MAIL_SKIN') %}
"background: linear-gradient(to bottom, #ee5f5b, #bd362f)"
{% elseif mailSkin == constant('Alchemy\\Phrasea\\Notification\\Mail\\AbstractMail::MAIL_SKIN') %}
"background-color:#a6aab0"
{% endif %}
>
<td height="50" valign="center" align="center" style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size:16px; line-height:19px; font-weight:bold; color:#ffffff;">
{{ subject }}
</td>
@@ -72,7 +78,7 @@
<span style="color:#FFA500; color:#FFA500 !important; text-decoration:underline; cursor:pointer;">{{ senderMail }}</span></a><br/>
{% endif %}
<br/>
{{ messageText | nl2br }}
{{ messageText | raw | nl2br }}
<br/>
</td>
</tr>

View File

@@ -51,7 +51,7 @@
<tr>
<td>
<h2 class="title15">
{{basket.getName()|raw}}
{{basket.getName()|e}}
</h2>
{% if basket.getValidation().isFinished() %}
{{ '(validation) session terminee' | trans }}
@@ -116,7 +116,7 @@
<tr>
<td>
<h2 class="title15">
{{ basket.getName()|raw}}
{{ basket.getName()|e}}
</h2>
</td>
<td class="right">

View File

@@ -19,7 +19,7 @@
<img src='/assets/common/images/icons/basket_push_unread.png' title=''/>
{% endif %}
<img src='/assets/common/images/icons/basket.png' title=''/>
{{basket.getName()}}
{{basket.getName()|e}}
</span>
</a>
<div class="menu">
@@ -99,7 +99,7 @@
{% else %}
<img src='/assets/common/images/icons/basket.png' title=''/>
{% endif %}
{{basket.getName()}}
{{basket.getName()|e}}
</span>
</a>
<div class="menu">

View File

@@ -12,17 +12,17 @@
<table>
<tr>
<td>
<span class="name"><%= item.display_name %></span>
<span class="name"><%= htmlEncode(item.display_name) %></span>
</td>
</tr>
<tr>
<td>
<span class="email"><i><%= item.email %></i></span>
<span class="email"><i><%= htmlEncode(item.email) %></i></span>
</td>
</tr>
<tr>
<td>
<span class="subtite"><%= item.subtitle || '' %></span>
<span class="subtite"><%= htmlEncode(item.subtitle) || '' %></span>
</td>
</tr>
</table>
@@ -47,7 +47,7 @@
<table>
<tr>
<td>
<span class="name"><%= item.name %></span>
<span class="name"><%= htmlEncode(item.name) %></span>
</td>
</tr>
<tr>
@@ -81,12 +81,12 @@
<table>
<tr>
<td colspan="3">
<span class="name"><%= user.display_name %></span>
<span class="name"><%= htmlEncode(user.display_name) %></span>
</td>
</tr>
<tr>
<td colspan="3">
<span class="subtite"><%= user.subtitle || '' %></span>
<span class="subtite"><%= htmlEncode(user.subtitle) || '' %></span>
</td>
</tr>
<tr class="toggles">
@@ -201,12 +201,12 @@
<table>
<tr>
<td colspan="3">
<span class="name"><%= user.display_name %></span>
<span class="name"><%= htmlEncode(user.display_name) %></span>
</td>
</tr>
<tr>
<td colspan="3">
<span class="subtite"><%= user.subtitle || '' %></span>
<span class="subtite"><%= htmlEncode(user.subtitle) || '' %></span>
</td>
</tr>
<tr class="toggles">
@@ -242,12 +242,12 @@
<table>
<tr>
<td colspan="3">
<span class="name"><%= user.display_name %></span>
<span class="name"><%= htmlEncode(user.display_name) %></span>
</td>
</tr>
<tr>
<td colspan="3">
<span class="subtite"><%= user.subtitle || '' %></span>
<span class="subtite"><%= htmlEncode(user.subtitle) || '' %></span>
</td>
</tr>
<tr class="toggles">
@@ -267,3 +267,22 @@
</div>
</script>
<script>
function htmlEncode(str) {
return str.replace(/[&"'<>]/g, function(c){
switch (c)
{
case "&":
return "&amp;";
case "'":
return "&#39;";
case '"':
return "&quot;";
case "<":
return "&lt;";
case ">":
return "&gt;";
}
});
}
</script>

View File

@@ -16,11 +16,11 @@
{% if context %}
{% set zterm %}
{% trans with {'%term%' : term, '%context%' : context} %}thesaurus:: le terme %term% avec contexte %context%{% endtrans %}
{% trans with {'%term%' : term | e, '%context%' : context | e} %}thesaurus:: le terme %term% avec contexte %context%{% endtrans %}
{% endset %}
{% else %}
{% set zterm %}
{% trans with {'%term%' : term} %}thesaurus:: le terme %term% sans contexte{% endtrans %}
{% trans with {'%term%' : term | e} %}thesaurus:: le terme %term% sans contexte{% endtrans %}
{% endset %}
{% endif %}

View File

@@ -338,6 +338,8 @@
for(var sy=syl.item(0).firstChild; sy; sy=sy.nextSibling )
{
var lng = sy.getAttribute("lng");
var v = escapeHtmlDataFromXML(sy.getAttribute("v"));
html += "<tr>";
if(lng)
if(tFlags[lng])
@@ -347,7 +349,7 @@
else
html += "<td><span style='background-color:#cccccc'>&nbsp;?&nbsp;</span></td>";
html += "<td>&nbsp;"+sy.getAttribute("v")+"</td>";
html += "<td>&nbsp;"+ v +"</td>";
var hits = 0+sy.getAttribute("hits");
if(hits == 1)
@@ -361,6 +363,12 @@
return(html);
}
// Let the browser to do it
function escapeHtmlDataFromXML(data){
var d = document.createElement('div');
d.appendChild(document.createTextNode(data));
return d.innerHTML;
}
// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//