Merge branch 'ticket/15116-nous-contacter-display' into develop

This commit is contained in:
Michael RICOIS 2017-12-13 16:20:02 +01:00
commit f939fe0928
7 changed files with 32 additions and 8 deletions

View File

@ -17,4 +17,7 @@
height: 150px;
padding: 5px;
width: 700px;
}
input#email2 {
display: none;
}

View File

@ -52,7 +52,13 @@ if (Tools::isSubmit('submitMessage')) {
$fileAttachment['mime'] = $_FILES['fileUpload']['type'];
}
$message = Tools::htmlentitiesUTF8(Tools::getValue('message'));
if (!($from = trim(Tools::getValue('from'))) OR !Validate::isEmail($from)){
if (Tools::getValue('email2') != '') {
$this->errors[] = Tools::displayError('Invalid');
}
elseif (preg_match("/\p{Han}+/u", $message)) {
$this->errors[] = Tools::displayError('Invalid message');
}
elseif (!($from = trim(Tools::getValue('from'))) OR !Validate::isEmail($from)){
$errors[] = Tools::displayError('Invalid e-mail address');
}
elseif ($alert_mode && Suspect::isBannished($from)){

View File

@ -34,8 +34,10 @@
<label for="email">{l s='E-mail address' mod='ant_support_form'}</label>
{if isset($customerThread.email)}
<input type="text" id="email" name="from" value="{$customerThread.email}" readonly="readonly" />
<input type="text" id="email2" name="email2" value="{$customerThread.email}" />
{else}
<input type="text" id="email" name="from" value="{$email}" />
<input type="text" id="email2" name="email2" value="{if empty($email)}-{else}{$email}{/if}" />
{/if}
</p>
{if !$PS_CATALOG_MODE}
@ -184,6 +186,7 @@
{literal}
<script>
$(function() {
$('input#email2').val('').hide();
if($('.cant-submit').length>0) {
$('#submitMessage').hide();
}

View File

@ -56,7 +56,13 @@ class ContactController extends ContactControllerCore {
$fileAttachment['mime'] = $_FILES['fileUpload']['type'];
}
$message = Tools::htmlentitiesUTF8(Tools::getValue('message'));
if (!($from = trim(Tools::getValue('from'))) OR !Validate::isEmail($from)){
if (Tools::getValue('email2') != '') {
$this->errors[] = Tools::displayError('Invalid');
}
elseif (preg_match("/\p{Han}+/u", $message)) {
$this->errors[] = Tools::displayError('Invalid message');
}
elseif (!($from = trim(Tools::getValue('from'))) OR !Validate::isEmail($from)){
$this->errors[] = Tools::displayError('Invalid e-mail address');
}
elseif ($alert_mode AND Suspect::isBannished($from)){

View File

@ -73,10 +73,12 @@
<label for="email">{l s='E-mail address'}</label>
{if isset($customerThread.email)}
<input type="text" id="email" name="from" value="{$customerThread.email}" readonly="readonly" />
<input type="text" id="email2" name="email2" value="{$customerThread.email}" />
{else}
<input type="text" id="email" name="from" value="{$email}" />
{/if}
</p>
<input type="text" id="email2" name="email2" value="{if empty($email)}-{else}{$email}{/if}" />
{/if}
</p>
{if !$PS_CATALOG_MODE}
{*{if (!isset($customerThread.id_order) || $customerThread.id_order > 0)}
<p class="text">
@ -137,6 +139,7 @@
{literal}
<script>
$(function() {
$('input#email2').val('').hide();
if($("option:selected", $('#id_contact')).val() == 9 || $("option:selected", $('#id_contact')).val() == 1 || $("option:selected", $('#id_contact')).val() == 2){
$('.overlay_bbb').fadeIn();
$('.box_waiting').fadeIn();

View File

@ -7215,7 +7215,7 @@ table#carrierTable tbody td {
/* Contact form */
#contact-form form{
#contact-form form.std {
background: #ffffff url(/img/logo_2.png) no-repeat 360px 120px;
padding: 20px;
margin-bottom: 20px;
@ -7499,7 +7499,7 @@ div.addresses ul.address,
.block-paypal,
.ant_support .section-help,
#cms #center_column .rte,
#contact-form form,
#contact-form form.std,
.ajax_block_product,
#order_conf_detail .detail_invoice,
#order_conf_detail .detail_delivery{
@ -7526,7 +7526,7 @@ div.addresses ul.address,
#discount #block_discount,
.ant_support .section-help,
#cms #center_column .rte,
#contact-form form{
#contact-form form.std {
padding: 20px;
}
#order-detail-content,
@ -7545,7 +7545,7 @@ div.addresses ul.address,
.block-paypal,
.ant_support .section-help,
#cms #center_column .rte,
#contact-form form{
#contact-form form.std {
width: 755px;
}
#after_cart_summary{

View File

@ -74,8 +74,10 @@
<label for="email">{l s='E-mail address'}</label>
{if isset($customerThread.email)}
<input type="text" id="email" name="from" value="{$customerThread.email}" readonly="readonly" />
<input type="text" id="email2" name="email2" value="{$customerThread.email}" />
{else}
<input type="text" id="email" name="from" value="{$email}" />
<input type="text" id="email2" name="email2" value="{if empty($email)}-{else}{$email}{/if}" />
{/if}
</p>
{if !$PS_CATALOG_MODE}
@ -140,6 +142,7 @@
{literal}
<script>
$(function() {
$('input#email2').val('').hide();
if($("option:selected", $('#id_contact')).val() == 9 || $("option:selected", $('#id_contact')).val() == 1 || $("option:selected", $('#id_contact')).val() == 2){
$('.overlay_bbb').fadeIn();
$('.box_waiting').fadeIn();