first commit

This commit is contained in:
2024-11-11 18:46:54 +01:00
commit a630d17338
25634 changed files with 4923715 additions and 0 deletions

View File

@@ -0,0 +1,73 @@
{*
* Registration Fields
*
* NOTICE OF LICENSE
*
* You are not authorized to modify, copy or redistribute this file.
* Permissions are reserved by FME Modules.
*
* @author FME Modules
* @copyright 2019 FME Modules All right reserved
* @license FMM Modules
* @package Registration Fields
*}
{if $version < 1.6}<div class="separation"></div>{/if}
<div class="panel col-lg-12" style="background: #FFF; padding: 15px;">
<h2 class="panel-heading">
<img width="16" src="{$smarty.const.__PS_BASE_URI__|escape:'htmlall':'UTF-8'}modules/customfields/views/img/AdminCustom.png"/>&nbsp;
{if isset($customfields_heading) AND $customfields_heading}{$customfields_heading|escape:'htmlall':'UTF-8'}{else}{l s='Custom Fields' mod='customfields' pdf='true'}{/if}
</h2>
<div {if $version >= 1.6}class="row"{/if}>
{foreach from=$checkout_steps key=key item=title}
{if !empty($grouped_fields.$key)|escape:'htmlall':'UTF-8'}
<div class="col-12">
<h4 class="panel-heading">{$title|escape:'htmlall':'UTF-8'}</h4>
{foreach from=$grouped_fields.$key item=field name=custom_fields}
<div class="form-group col-lg-12">
<label class="control-label col-lg-3">
{$field.field_name|escape:'htmlall':'UTF-8'} :
</label>
<div class="col-lg-9">
<strong><p class="form-control-static">
{if in_array($field.field_type, array('multiselect', 'radio', 'checkbox', 'select'))}
{assign var='field_value' value=$field.field_value}
{elseif $field.field_type == 'message'}
{assign var='field_value' value=$field.default_value}
{else}
{assign var='field_value' value=$obj_model->getFormatedValue($field)}
{/if}
{if $field.field_type == 'attachment' AND $field_value AND file_exists($field_value)}
<a class="btn btn-default button" href="{$downloadLink|escape:'htmlall':'UTF-8'}&downloadFile&l={base64_encode($field_value)|escape:'htmlall':'UTF-8'}" target="_blank">
{l s='Download Attachment' mod='customfields'} <img src="{$smarty.const.__PS_BASE_URI__|escape:'htmlall':'UTF-8'}modules/customfields/views/img/download.png" alt="{l s='Download Attachment' mod='customfields'}" title="{l s='Download Attachment' mod='customfields'}"/>
</a>
{else}
{if $field_value == "Yes"}
Tak
{elseif $field_value == 'No'}
Nie
{else}
{$field_value|escape:'htmlall':'UTF-8'}
{/if}
{/if}
</p></strong>
</div>
</div>
{/foreach}
<div class="clearfix"></div>
</div>
{/if}
{/foreach}
</div>
<div class="clearfix"></div>
</div>
<div class="clearfix"></div>
<!-- <div class="separation"></div> -->
{literal}
<style type="text/css">
body.adminorders #addressInvoice {
display: none;
}
</style>
{/literal}

View File

@@ -0,0 +1,507 @@
{*
* FMM Custom Fields
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
*
* @author FME Modules
* @copyright 2019 fmemodules.com All right reserved
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* @category FMM Modules
* @package Customfields
*}
<script type="text/javascript">
var selected_shops = "{$selected_shops|escape:'htmlall':'UTF-8'}";
var mod_url = "{$action_url|escape:'htmlall':'UTF-8'}";
$(document).ready(function()
{
$('.language_flags').css('float','left').hide();
$(".pointer").addClass("btn btn-default dropdown-toggle");
// shop association
$(".tree-item-name input[type=checkbox]").each(function()
{
$(this).prop("checked", false);
$(this).removeClass("tree-selected");
$(this).parent().removeClass("tree-selected");
if ($.inArray($(this).val(), selected_shops) != -1)
{
$(this).prop("checked", true);
$(this).parent().addClass("tree-selected");
$(this).parents("ul.tree").each(
function()
{
$(this).children().children().children(".icon-folder-close")
.removeClass("icon-folder-close")
.addClass("icon-folder-open");
$(this).show();
}
);
}
});
});
function rfCheckDepend(el) {
_value = parseInt($(el).val());
if (_value > 0) {
$('#rf_dependant_field').show();
}
else {
$('#rf_dependant_field').hide();
}
}
function rfGetRelativeVals(_el) {
_val_f = parseInt($(_el).val());
var _list = '';
if (_val_f > 0) {
$('#dependant_value').removeAttr('disabled');
$.ajax({
type: 'GET',
dataType: 'json',
url: mod_url+'&ajax=1&id_dep='+_val_f,
success: function(data)
{
var _count = parseInt(data.exist);
if (_count > 0) {
var _raw = data.vals;
$('#dependant_value').removeAttr('disabled');
$.each(_raw, function(index,value){
_list += '<option value="'+_raw[index]['field_value_id']+'">'+_raw[index]['field_value']+'</option>';
});
$('#dependant_value').html(_list);
console.log('count '+_count);
}
else {
$('#dependant_value').attr('disabled', true);
}
},
error : function(XMLHttpRequest, textStatus, errorThrown) {
console.log(textStatus);
}
});
}
else {
$('#dependant_value').attr('disabled', true);
}
}
function checkAllChilds(__el) {
if ($(__el).is(':checked')) {
$(__el).parent().parent().parent().parent().find('input[type="checkbox"]').attr('checked', true);
}
else {
$(__el).parent().parent().parent().parent().find('input[type="checkbox"]').attr('checked', false);
}
}
</script>
<fieldset id="top">
{if $version < 1.6}<legend>{else}<h3 class="panel-heading">{/if}
{l s='Custom Field' mod='customfields'}
{if $version < 1.6}</legend>{else}</h3>{/if}
<label class="col-lg-3 control-label required">{l s='Field Name ' mod='customfields'}</label>
<div class="margin-form form-group">
<div class="col-lg-8">
<div class="translatable">
{foreach from=$languages item=language}
<div class="lang_{$language.id_lang|intval} col-lg-9" style="display:{if $language.id_lang == $id_lang_default}block{else}none{/if};float:left;margin-bottom:10px;">
<input type="text" id="field_name_{$language.id_lang|intval}" name="field_name_{$language.id_lang|intval}" value="{$currentTab->getFieldValue($currentObject, 'field_name', $language.id_lang|intval)|escape:'htmlall':'UTF-8'}" />
</div>
{/foreach}
</div>
<p class="preference_description"></p>
</div>
</div>
<div class="clearfix"></div>
<label class="col-lg-3 control-label required">{l s='Default Value' mod='customfields'}</label>
<div class="margin-form form-group">
<div class="col-lg-8">
<div class="translatable">
{foreach from=$languages item=language}
<div class="lang_{$language.id_lang|intval} col-lg-9" style="display:{if $language.id_lang == $id_lang_default}block{else}none{/if};float:left;margin-bottom:10px;">
<input type="text" id="default_value_{$language.id_lang|intval}" name="default_value_{$language.id_lang|intval}" value="{$currentTab->getFieldValue($currentObject, 'default_value', $language.id_lang|intval)|escape:'htmlall':'UTF-8'}" />
</div>
{/foreach}
</div>
<p class="preference_description"></p>
</div>
</div>
<div class="clearfix"></div>
<label class="col-lg-3 control-label">{l s='Block Heading ' mod='customfields'}</label>
<div class="margin-form form-group">
<div class="col-lg-8">
{*headings_collection*}
<select id="id_heading" name="id_heading">
{assign var=var_field_heading value=$currentTab->getFieldValue($currentObject, 'id_heading')}
{foreach from=$headings_collection item=heading}
<option value="{$heading.id_custom_field_headings|escape:'htmlall':'UTF-8'}" {if $var_field_heading == $heading.id_custom_field_headings}selected="selected"{/if}>{$heading.title|escape:'htmlall':'UTF-8'}</option>
{/foreach}
</select>
<p class="help-block">{l s='Select a heading to make it as a block of fields.' mod='customfields'}</p>
</div>
</div>
<label class="col-lg-3 control-label">{l s='Field Type' mod='customfields'}</label>
<div class="margin-form form-group">
<div class="col-lg-4">
{assign var=var_field_type value=$currentTab->getFieldValue($currentObject, 'field_type')}
<select id="field_type" name="field_type">
{foreach from=$customFieldTypes key=fieldk item=fieldv}
<option value="{$fieldk|escape:'htmlall':'UTF-8'}" {if $var_field_type eq $fieldk}selected="selected"{/if}>{l s=$fieldv mod='customfields'}</option>
{/foreach}
</select>
<p class="preference_description"></p>
</div>
</div>
<div class="clearfix"></div>
<div class="form-wrapper" id="setting-attachment" style="{if isset($var_field_type) AND $var_field_type AND $var_field_type == 'image' OR $var_field_type == 'attachment'}display:block;{else}display:none;{/if}">
<div class="form-group">
<label class="control-label col-lg-3">
<span class="label-tooltip">{l s='Maximum size' mod='customfields'}</span>
</label>
<div class="col-lg-2">
<div class="input-group">
<input type="text" value="{$currentTab->getFieldValue($currentObject, 'attachment_size')|escape:'htmlall':'UTF-8'}" name="attachment_size" size="5" class="form-control">
<span class="input-group-addon">MB</span>
</div>
</div>
</div>
<div class="clearfix"></div>
<div class="form-group">
<label class="control-label col-lg-3">
<span class="label-tooltip">{l s='File Types' mod='customfields'}</span>
</label>
<div class="col-lg-6">
<input type="text" value="{$currentTab->getFieldValue($currentObject, 'extensions')|escape:'htmlall':'UTF-8'}" name="extensions" class="form-control">
<p class="help-block hint-block">{l s='Enter comma(,) separated values.' mod='customfields'}</p>
</div>
</div>
<div class="clearfix"></div>
</div>
<div class="clearfix"></div>
<div id="field_validation_holder">
<label class="col-lg-3 control-label">{l s='Field Validation' mod='customfields'}</label>
<div class="margin-form form-group">
<div class="col-lg-4">
{assign var=var_field_validation value=$currentTab->getFieldValue($currentObject, 'field_validation')}
<select id="field_validation" name="field_validation">
<option value="" {if $var_field_validation eq ''}selected="selected"{/if}>{l s='None' mod='customfields'}</option>
<option value="isFloat" {if $var_field_validation eq 'isFloat'}selected="selected"{/if}>{l s='Decimal Number' mod='customfields'}</option>
<option value="isInt" {if $var_field_validation eq 'isInt'}selected="selected"{/if}>{l s='Integer Number' mod='customfields'}</option>
<option value="isEmail" {if $var_field_validation eq 'isEmail'}selected="selected"{/if}>{l s='Email Address' mod='customfields'}</option>
<option value="isUrl" {if $var_field_validation eq 'isUrl'}selected="selected"{/if}>{l s='Website Url Address' mod='customfields'}</option>
<option value="isGenericName" {if $var_field_validation eq 'isGenericName'}selected="selected"{/if}>{l s='Letters Only' mod='customfields'}</option>
<option value="isString" {if $var_field_validation eq 'isString'}selected="selected"{/if}>{l s='Letters and/or Numbers' mod='customfields'}</option>
<option value="isDate" {if $var_field_validation eq 'isDate'}selected="selected"{/if}>{l s='Date' mod='customfields'}</option>
</select>
<p class="preference_description"></p>
</div>
</div>
</div>
<div class="clearfix"></div>
<label class="col-lg-3 control-label">{l s='Checkout Step' mod='customfields'}</label>
<div class="margin-form form-group">
<div class="col-lg-4">
{assign var=var_field_placement value=$currentTab->getFieldValue($currentObject, 'field_placement')}
<select id="field_placement" name="field_placement">
<option value="summary" {if $var_field_placement eq 'summary'}selected="selected"{/if}>{l s='Summary Information' mod='customfields'}</option>
<option value="delivery" {if $var_field_placement eq 'delivery'}selected="selected"{/if}>{l s='Shipping Address' mod='customfields'}</option>
<option value="billing" {if $var_field_placement eq 'billing'}selected="selected"{/if}>{l s='Billing Address' mod='customfields'}</option>
<option value="shipping" {if $var_field_placement eq 'shipping'}selected="selected"{/if}>{l s='Shipping Information' mod='customfields'}</option>
<option value="payment" {if $var_field_placement eq 'payment'}selected="selected"{/if}>{l s='Payment Information' mod='customfields'}</option>
</select>
<p class="preference_description"></p>
</div>
</div>
<div class="clearfix"></div>
<div class="margin-form form-group">
<label class="col-lg-3 control-label">{l s='Category Rule' mod='customfields'}</label>
<div class="col-lg-9">
<div class="col-lg-9 rcg_max_height">
<table class="table table-bordered">
<thead>
<tr>
<th> </th>
<th>
<span class="title_box">
{l s='ID' mod='customfields'}
</span>
</th>
<th>
<span class="title_box">
{l s='Name' mod='customfields'}
</span>
</th>
</tr>
</thead>
<tbody>
{if !isset($categories) || empty($categories)}
<tr>
<td>{l s='No categories found.' mod='customfields'}</td>
</tr>
{else}
{foreach from=$categories item=category}
<tr>
<td>
<input type="checkbox" name="category[]" value="{$category.id_category}"{if isset($category.checked) && $category.checked > 0} checked="checked"{/if} />
</td>
<td>
{$category.id_category}
</td>
<td>
{$category.name}
</td>
</tr>
{/foreach}
{/if}
</tbody>
</table>
<p class="help-block">{l s='Please select categories if any, field will only show if any product of category finds in cart.' mod='customfields'}</p>
</div>
</div>
</div>
<div class="clearfix"></div>
<!-- Product rule -->
<label class="col-lg-3 control-label">{l s='Product Rule' mod='customfields'}</label>
<div class="margin-form form-group">
<div class="col-lg-8">
<div class="input-group col-lg-7 text ac_input">
<input type="text" class="col-lg-6 text ac_input" id="CUSTOMFIELDS_PRODUCT" name="CUSTOMFIELDS_PRODUCT" autocomplete="off">
<span class="input-group-addon"><i class="icon-search"></i> {l s='Search' mod='customfields'}</span>
</div>
<div class="clearfix"></div>
<p class="help-block preference_description">{l s='Field will be shown if cart has following product(s).' mod='customfields'}</p>
<div class="input-group col-lg-9">
{include file='./products.tpl'}
</div>
<div class="clearfix"></div>
</div>
</div>
<div class="clearfix"></div>
<!-- Multishop -->
{if isset($shops) AND $shops}
<label class="col-lg-3 control-label">{l s='Shop Association' mod='customfields'}</label>
<div class="margin-form form-group">
<div class="col-lg-6">{$shops}{* html content *}
</div>
</div>
<div class="clearfix"></div>
{/if}
<div class="margin-form form-group">
<label class="col-lg-3 control-label required">{l s='Select Group' mod='customfields'}</label>
<div class="col-lg-9">
<div class="col-lg-8">
<table class="table table-bordered">
<thead>
<tr>
<th><input type="checkbox" onclick="checkAllChilds(this);" /></th>
<th>
<span class="title_box">
{l s='ID' mod='customfields'}
</span>
</th>
<th>
<span class="title_box">
{l s='Name' mod='customfields'}
</span>
</th>
</tr>
</thead>
<tbody>
{foreach from=$customer_groups item=group}
<tr>
<td>
<input type="checkbox" name="groups[]" value="{$group.id_group}"{if isset($group.checked) && $group.checked > 0} checked="checked"{/if} />
</td>
<td>
{$group.id_group}
</td>
<td>
{$group.name}
</td>
</tr>
{/foreach}
</tbody>
</table>
<p class="help-block">{l s='Please select customer Group access for this field.' mod='customfields'}</p>
</div>
</div>
</div>
<div class="clearfix"></div>
<div id="field-editable" style="{if isset($var_field_type) AND $var_field_type AND in_array($var_field_type, array('text', 'textarea', 'date', 'attachment'))}display:block;{else}display:none;{/if}">
<label class="col-lg-3 control-label">{l s='Editable' mod='customfields'}</label>
<div class="margin-form form-group col-lg-9">
{if $version < 1.6}
<div class="col-lg-4">
<input type="radio" name="editable" id="editable_on" value="1" {if $currentTab->getFieldValue($currentObject, 'editable')|escape:'htmlall':'UTF-8'}checked="checked"{/if} />
<label class="t" for="editable_on"> <img src="../img/admin/enabled.gif" alt="{l s='Yes' mod='customfields'}" title="{l s='Yes' mod='customfields'}" style="cursor:pointer" /></label>
<input type="radio" name="editable" id="editable_off" value="0" {if !$currentTab->getFieldValue($currentObject, 'editable')|escape:'htmlall':'UTF-8'}checked="checked"{/if} />
<label class="t" for="editable_off"> <img src="../img/admin/disabled.gif" alt="{l s='No' mod='customfields'}" title="{l s='No' mod='customfields'}" style="cursor:pointer" /></label>
</div>
{else}
<div class="col-lg-9">
<span class="switch prestashop-switch fixed-width-lg">
<input id="editable_on" type="radio" {if $currentTab->getFieldValue($currentObject, 'editable') == 1}checked="checked"{/if} value="1" name="editable" class="form-control">
<label class="t" for="editable_on">{l s='Yes' mod='customfields'}</label>
<input id="editable_off" type="radio" {if $currentTab->getFieldValue($currentObject, 'editable') == 0}checked="checked"{/if} value="0" name="editable" class="form-control">
<label class="t" for="editable_off">{l s='No' mod='customfields'}</label>
<a class="slide-button btn"></a>
</span>
</div>
{/if}
</div>
<div class="clearfix"></div>
</div>
<label class="col-lg-3 control-label">{l s='Values Required' mod='customfields'}</label>
<div class="margin-form form-group col-lg-9">
{if $version < 1.6}
<div class="col-lg-4">
&nbsp;&nbsp;
<input type="radio" name="value_required" id="required_on" value="1" {if $currentTab->getFieldValue($currentObject, 'value_required')|intval}checked="checked"{/if} />
<label class="t" for="required_on"> <img src="../img/admin/enabled.gif" alt="{l s='Enabled' mod='customfields'}" title="{l s='Enabled' mod='customfields'}" style="cursor:pointer" /></label>
&nbsp;&nbsp;
<input type="radio" name="value_required" id="required_off" value="0" {if !$currentTab->getFieldValue($currentObject, 'value_required')|intval}checked="checked"{/if} />
<label class="t" for="required_off"> <img src="../img/admin/disabled.gif" alt="{l s='Disabled' mod='customfields'}" title="{l s='Disabled' mod='customfields'}" style="cursor:pointer" /></label>
</div>
{else}
<div class="col-lg-4">
<span class="switch prestashop-switch fixed-width-lg">
<input id="value_required_on" type="radio" {if $currentTab->getFieldValue($currentObject, 'value_required') == 1}checked="checked"{/if} value="1" name="value_required" class="form-control">
<label class="t" for="value_required_on">{l s='Yes' mod='customfields'}</label>
<input id="value_required_off" type="radio" {if $currentTab->getFieldValue($currentObject, 'value_required') == 0}checked="checked"{/if} value="0" name="value_required" class="form-control">
<label class="t" for="value_required_off">{l s='No' mod='customfields'}</label>
<a class="slide-button btn"></a>
</span>
</div>
{/if}
</div>
<div class="clearfix"></div>
<label class="col-lg-3 control-label">{l s='Show in Customer Account' mod='customfields'}</label>
<div class="margin-form form-group col-lg-9">
{if $version < 1.6}
<div class="col-lg-4">
&nbsp;&nbsp;
<input type="radio" name="show_customer" id="show_customer_on" value="1" {if $currentTab->getFieldValue($currentObject, 'show_customer')|intval}checked="checked"{/if} />
<label class="t" for="show_customer_on"> <img src="../img/admin/enabled.gif" alt="{l s='Enabled' mod='customfields'}" title="{l s='Enabled' mod='customfields'}" style="cursor:pointer" /></label>
&nbsp;&nbsp;
<input type="radio" name="show_customer" id="show_customer_off" value="0" {if !$currentTab->getFieldValue($currentObject, 'show_customer')|intval}checked="checked"{/if} />
<label class="t" for="show_customer_off"> <img src="../img/admin/disabled.gif" alt="{l s='Disabled' mod='customfields'}" title="{l s='Disabled' mod='customfields'}" style="cursor:pointer" /></label>
</div>
{else}
<div class="col-lg-4">
<span class="switch prestashop-switch fixed-width-lg">
<input id="show_customer_on" type="radio" {if $currentTab->getFieldValue($currentObject, 'show_customer') == 1}checked="checked"{/if} value="1" name="show_customer" class="form-control">
<label class="t" for="show_customer_on">{l s='Yes' mod='customfields'}</label>
<input id="show_customer_off" type="radio" {if $currentTab->getFieldValue($currentObject, 'show_customer') == 0}checked="checked"{/if} value="0" name="show_customer" class="form-control">
<label class="t" for="show_customer_off">{l s='No' mod='customfields'}</label>
<a class="slide-button btn"></a>
</span>
</div>
{/if}
</div>
<div class="clearfix"></div>
<label class="col-lg-3 control-label">{l s='Show in Admin Order' mod='customfields'}</label>
<div class="margin-form form-group col-lg-9">
{if $version < 1.6}
<div class="col-lg-4">
&nbsp;&nbsp;
<input type="radio" name="show_admin" id="show_admin_on" value="1" {if $currentTab->getFieldValue($currentObject, 'show_admin')|intval}checked="checked"{/if} />
<label class="t" for="show_admin_on"> <img src="../img/admin/enabled.gif" alt="{l s='Enabled' mod='customfields'}" title="{l s='Enabled' mod='customfields'}" style="cursor:pointer" /></label>
&nbsp;&nbsp;
<input type="radio" name="show_admin" id="show_admin_off" value="0" {if !$currentTab->getFieldValue($currentObject, 'show_admin')|intval}checked="checked"{/if} />
<label class="t" for="show_admin_off"> <img src="../img/admin/disabled.gif" alt="{l s='Disabled' mod='customfields'}" title="{l s='Disabled' mod='customfields'}" style="cursor:pointer" /></label>
</div>
{else}
<div class="col-lg-4">
<span class="switch prestashop-switch fixed-width-lg">
<input id="show_admin_on" type="radio" {if $currentTab->getFieldValue($currentObject, 'show_admin') == 1}checked="checked"{/if} value="1" name="show_admin" class="form-control">
<label class="t" for="show_admin_on">{l s='Yes' mod='customfields'}</label>
<input id="show_admin_off" type="radio" {if $currentTab->getFieldValue($currentObject, 'show_admin') == 0}checked="checked"{/if} value="0" name="show_admin" class="form-control">
<label class="t" for="show_admin_off">{l s='No' mod='customfields'}</label>
<a class="slide-button btn"></a>
</span>
</div>
{/if}
</div>
<div class="clearfix"></div>
<label class="col-lg-3 control-label">{l s='Field Status' mod='customfields'}</label>
<div class="margin-form form-group">
{if $version < 1.6}
<div class="col-lg-4">
&nbsp;&nbsp;
<input type="radio" name="active" id="active_on" value="1" {if $currentTab->getFieldValue($currentObject, 'active')|intval}checked="checked"{/if} />
<label class="t" for="active_on"> <img src="../img/admin/enabled.gif" alt="{l s='Enabled' mod='customfields'}" title="{l s='Enabled' mod='customfields'}" style="cursor:pointer" /></label>
&nbsp;&nbsp;
<input type="radio" name="active" id="active_off" value="0" {if !$currentTab->getFieldValue($currentObject, 'active')|intval}checked="checked"{/if} />
<label class="t" for="active_off"> <img src="../img/admin/disabled.gif" alt="{l s='Disabled' mod='customfields'}" title="{l s='Disabled' mod='customfields'}" style="cursor:pointer" /></label>
</div>
{else}
<div class="col-lg-4">
<span class="switch prestashop-switch fixed-width-lg">
<input id="active_on" type="radio" {if $currentTab->getFieldValue($currentObject, 'active') == 1}checked="checked"{/if} value="1" name="active" class="form-control">
<label class="t" for="active_on">{l s='Yes' mod='customfields'}</label>
<input id="active_off" type="radio" {if $currentTab->getFieldValue($currentObject, 'active') == 0}checked="checked"{/if} value="0" name="active" class="form-control">
<label class="t" for="active_off">{l s='No' mod='customfields'}</label>
<a class="slide-button btn"></a>
</span>
</div>
{/if}
</div>
<div class="clearfix"></div>
<label class="col-lg-3 control-label">{l s='Dependant Field' mod='customfields'}</label>
<div class="col-lg-9">
<span class="switch prestashop-switch fixed-width-lg">
<input id="dependant_on" onclick="rfCheckDepend(this)" type="radio" {if $currentTab->getFieldValue($currentObject, 'dependant') == 1}checked="checked"{/if} value="1" name="dependant" class="form-control">
<label class="t" for="dependant_on">{l s='Yes' mod='customfields'}</label>
<input id="dependant_off" onclick="rfCheckDepend(this)" type="radio" {if $currentTab->getFieldValue($currentObject, 'dependant') == 0}checked="checked"{/if} value="0" name="dependant" class="form-control">
<label class="t" for="dependant_off">{l s='No' mod='customfields'}</label>
<a class="slide-button btn"></a>
</span>
</div>
<div class="clearfix"></div>
<div id="rf_dependant_field" style="{if $currentTab->getFieldValue($currentObject, 'dependant') > 0}display: block;{else}display: none;{/if} padding-top: 15px;">
<label class="col-lg-3 control-label">{l s='Select Dependant Field' mod='customfields'}</label>
<div class="col-lg-9">
<select name="dependant_field" class="col-lg-8" onchange="rfGetRelativeVals(this);">
<option value="0">-</option>
{if !empty($fields_collection)}
{foreach from=$fields_collection item=field}
{if $field.id_custom_field != $id_custom_field && in_array($field.field_type, ['select', 'checkbox', 'radio', 'boolean'])}<option value="{$field.id_custom_field|escape:'htmlall':'UTF-8'}"{if isset($field.dep_check) && $field.dep_check == $field.id_custom_field} selected="selected"{/if}>{$field.id_custom_field|escape:'htmlall':'UTF-8'} - {$field.field_name|escape:'htmlall':'UTF-8'}</option>{/if}
{/foreach}
{/if}
</select>
</div>
<div class="clearfix" style="clear: both;padding-top: 15px;"></div>
<label class="col-lg-3 control-label">{l s='Select Dependant Value' mod='customfields'}</label>
<div class="col-lg-9">
<select name="dependant_value" class="col-lg-8" id="dependant_value">
{if empty($field_values)}
<option value="0">-</option>
{else}
{foreach from=$field_values item=field}
<option value="{$field.field_value_id|escape:'htmlall':'UTF-8'}"{if $field.check && $field.check == $field.field_value_id} selected="selected"{/if}>{$field.field_value|escape:'htmlall':'UTF-8'}</option>
{/foreach}
{/if}
</select>
<small class="form-text help-block" style="display: block; clear: both; padding-top: 5px;">{l s='Choose dependant field first so this option is populated.' mod='customfields'}</small>
</div>
</div>
<div class="clearfix"></div>
</fieldset>

View File

@@ -0,0 +1,160 @@
{*
* FMM Custom Fields
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
*
* @author FME Modules
* @copyright 2017 fmemodules.com All right reserved
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* @category FMM Modules
* @package Customfields
*}
{if $version < 1.6}{include file="toolbar.tpl" toolbar_btn=$toolbar_btn toolbar_scroll=$toolbar_scroll title=$title}{/if}
<div class="leadin">{block name="leadin"}{/block}</div>
<form class="panel form-horizontal" action="{$currentIndex|escape}&token={$currentToken|escape:'htmlall':'UTF-8'}&addcustom_field" name="custom_field_form" id="custom_field_form" method="post" enctype="multipart/form-data">
{if $currentObject->id}<input type="hidden" name="id_custom_field" value="{$currentObject->id|intval}" />{/if}
<input type="hidden" id="currentFormTab" name="currentFormTab" value="informations" />
{include file=$fieldinfo}
<div class="separation"></div>
{if $version >= 1.6}
<div class="panel-footer">
<a href="{$link->getAdminLink('AdminFields')|escape:'htmlall':'UTF-8'}" class="btn btn-default"><i class="process-icon-cancel"></i> {l s='Cancel' mod='customfields'}</a>
<button type="submit" name="submitAddcustom_field" class="btn btn-default pull-right">
<i class="process-icon-save"></i> {l s='Save' mod='customfields'}
</button>
<button type="submit" name="submitAddcustom_fieldAndStay" class="btn btn-default pull-right">
<i class="process-icon-save"></i> {l s='Save and stay' mod='customfields'}
</button>
</div>
{else}
<div style="text-align:center">
<input type="submit" value="{l s='Save' mod='customfields'}" class="button" name="submitAddcustom_field" id="{$table|escape:'htmlall':'UTF-8'}_form_submit_btn" />
</div>
{/if}
</form>
<script language="javascript">
var editableFields = ['boolean', 'message'];
var currentToken = "{$currentToken|escape:'htmlall':'UTF-8'}";
var currentFormTab = "{if isset($smarty.post.currentFormTab)}{$smarty.post.currentFormTab|escape:'htmlall':'UTF-8'}{else}informations{/if}";
var languages = new Array();
{foreach from=$languages item=language key=k}
languages[{$k|escape:'htmlall':'UTF-8'}] = {
id_lang: {$language.id_lang|escape:'htmlall':'UTF-8'},
iso_code: "{$language.iso_code|escape:'htmlall':'UTF-8'}",
name: "{$language.name|escape:'htmlall':'UTF-8'}"
};
{/foreach}
displayFlags(languages, {$id_lang_default|escape:'htmlall':'UTF-8'});
function displayCartRuleTab(tab)
{
$('.cart_rule_tab').hide();
$('.tab-page').removeClass('selected');
$('#advance_blog_' + tab).show();
$('#advance_blog_link_' + tab).addClass('selected');
$('#currentFormTab').val(tab);
}
$('.cart_rule_tab').hide();
$('.tab-page').removeClass('selected');
$('#advance_blog_' + currentFormTab).show();
$('#advance_blog_link_' + currentFormTab).addClass('selected');
function checkOptions(){
var field_type = $('#field_type').val();
if (jQuery.inArray(field_type, editableFields) === -1) {
$('#field-editable').show();
} else {
$('#field-editable').hide();
}
if (field_type == 'attachment') {
$('#setting-attachment').show();
} else {
$('#setting-attachment').hide();
}
if( field_type == "multiselect" || field_type == "select" || field_type == "checkbox" || field_type == "radio"){
$("#show_label").show();
$("#show_options").show();
}else{
$("#show_label").hide();
$("#show_options").hide();
}
if( field_type == "text" || field_type == "textarea" || field_type == "message"){
$("#default_value_holder").show();
}else{
$("#default_value_holder").hide();
}
if( field_type == "text" || field_type == "textarea"){
$("#field_validation_holder").show();
}else{
$("#field_validation_holder").hide();
}
}
function updateRequriedOptions() {
$("#field_type").parent().parent().after(`
<div class='margin-form form-group' id='show_options'>
<label class='col-lg-3 control-label' id='show_label'>{l s='Field Option(s)' mod='customfields' js=1}:</label>
<div class='col-lg-9'>
<div class='col-lg-12 form-group'>
<a id='new_option' class='btn btn-default button' href='javascript:void(0);'>
<img src='../img/admin/add.gif'>{l s='Add Option' mod='customfields'}
</a>
</div>
<ul class='col-lg-8' style='list-style:none;' id='valuesOptions'></ul><div class="clearfix"></div>
</div>
</div>`);
$("#new_option").click(function(){
newOption();
});
$('.delopt').live('click',function(){
$(this).closest('.option_line').remove();
});
$("#field_type").change(function(){
checkOptions();
});
checkOptions();
}
function newOption(id,value){
var newlist = $(`<li class='col-lg-12 option_line' style='cursor: pointer;margin-bottom:5px;margin-left: -15px;'>
<div class="col-lg-9">
<input type='text' id='options' name='options[]' />
</div>
<div class="col-lg-2">
<a href='javascript:void(0);' class='delopt btn btn-danger button'>
<img src='{$this_module_path|escape:'htmlall':'UTF-8'}img/forbbiden.gif'/>{l s='Remove' mod='customfields' js=1}
</a>
</li>`);
//$(newlist).prependTo("#valuesOptions");
$('#valuesOptions').append(newlist);
var input = newlist.find('input');
if (value){
input.val(value);
var name = "options["+id+"]";
}
}
updateRequriedOptions();
{$jqueryOptions}//html code, cannot be escaped
</script>

View File

@@ -0,0 +1,167 @@
{*
* FMM Custom Fields
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
*
* @author FME Modules
* @copyright 2019 fmemodules.com All right reserved
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* @category FMM Modules
* @package Customfields
*}
{if $version < 1.6}{include file="toolbar.tpl" toolbar_btn=$toolbar_btn toolbar_scroll=$toolbar_scroll title=$title}{/if}
<div class="leadin">{block name="leadin"}{/block}</div>
<form class="panel form-horizontal" action="{$currentIndex|escape}&token={$currentToken|escape:'htmlall':'UTF-8'}&addcustom_field" name="custom_field_form" id="custom_field_form" method="post" enctype="multipart/form-data">
{if $currentObject->id}<input type="hidden" name="id_custom_field" value="{$currentObject->id|intval}" />{/if}
<input type="hidden" id="currentFormTab" name="currentFormTab" value="informations" />
{include file=$fieldinfo}
<div class="separation"></div>
{if $version >= 1.6}
<div class="panel-footer">
<a href="{$link->getAdminLink('AdminFields')|escape:'htmlall':'UTF-8'}" class="btn btn-default"><i class="process-icon-cancel"></i> {l s='Cancel' mod='customfields'}</a>
<button type="submit" name="submitAddcustom_field" class="btn btn-default pull-right">
<i class="process-icon-save"></i> {l s='Save' mod='customfields'}
</button>
<button type="submit" name="submitAddcustom_fieldAndStay" class="btn btn-default pull-right">
<i class="process-icon-save"></i> {l s='Save and stay' mod='customfields'}
</button>
</div>
{else}
<div style="text-align:center">
<input type="submit" value="{l s='Save' mod='customfields'}" class="button" name="submitAddcustom_field" id="{$table|escape:'htmlall':'UTF-8'}_form_submit_btn" />
</div>
{/if}
</form>
<script language="javascript">
var editableFields = ['boolean', 'message'];
var currentToken = "{$currentToken|escape:'htmlall':'UTF-8'}";
var currentFormTab = "{if isset($smarty.post.currentFormTab)}{$smarty.post.currentFormTab|escape:'htmlall':'UTF-8'}{else}informations{/if}";
var languages = new Array();
{foreach from=$languages item=language key=k}
languages[{$k|escape:'htmlall':'UTF-8'}] = {
id_lang: {$language.id_lang|escape:'htmlall':'UTF-8'},
iso_code: "{$language.iso_code|escape:'htmlall':'UTF-8'}",
name: "{$language.name|escape:'htmlall':'UTF-8'}"
};
{/foreach}
displayFlags(languages, {$id_lang_default|escape:'htmlall':'UTF-8'});
function displayCartRuleTab(tab)
{
$('.cart_rule_tab').hide();
$('.tab-page').removeClass('selected');
$('#advance_blog_' + tab).show();
$('#advance_blog_link_' + tab).addClass('selected');
$('#currentFormTab').val(tab);
}
$('.cart_rule_tab').hide();
$('.tab-page').removeClass('selected');
$('#advance_blog_' + currentFormTab).show();
$('#advance_blog_link_' + currentFormTab).addClass('selected');
function checkOptions(){
var field_type = $('#field_type').val();
if (jQuery.inArray(field_type, editableFields) === -1) {
$('#field-editable').show();
} else {
$('#field-editable').hide();
}
if (field_type == 'attachment') {
$('#setting-attachment').show();
} else {
$('#setting-attachment').hide();
}
if (field_type == 'message') {
$('#alert-types').show();
} else {
$('#alert-types').hide();
}
if (field_type == "multiselect" || field_type == "select" || field_type == "checkbox" || field_type == "radio") {
$("#show_label").show();
$("#show_options").show();
} else {
$("#show_label").hide();
$("#show_options").hide();
}
if ( field_type == "text" || field_type == "textarea" || field_type == "message") {
$("#default_value_holder").show();
} else{
$("#default_value_holder").hide();
}
if( field_type == "text" || field_type == "textarea"){
$("#field_validation_holder").show();
}else{
$("#field_validation_holder").hide();
}
}
function updateRequriedOptions() {
$("#field_type").parent().parent().after(`
<div class='margin-form form-group' id='show_options'>
<label class='col-lg-3 control-label' id='show_label'>{l s='Field Option(s)' mod='customfields' js=1}:</label>
<div class='col-lg-9'>
<div class='col-lg-12 form-group'>
<a id='new_option' class='btn btn-default button' href='javascript:void(0);'>
<img src='../img/admin/add.gif'>{l s='Add Option' mod='customfields'}
</a>
</div>
<ul class='col-lg-8' style='list-style:none;' id='valuesOptions'></ul><div class="clearfix"></div>
</div>
</div>`);
$("#new_option").click(function(){
newOption();
});
$('.delopt').live('click',function(){
$(this).closest('.option_line').remove();
});
$("#field_type").change(function(){
checkOptions();
});
checkOptions();
}
function newOption(id,value){
var newlist = $(`<li class='col-lg-12 option_line' style='cursor: pointer;margin-bottom:5px;margin-left: -15px;'>
<div class="col-lg-9">
<input type='text' id='options' name='options[]' />
</div>
<div class="col-lg-2">
<a href='javascript:void(0);' class='delopt btn btn-danger button'>
<img src='{$this_module_path|escape:'htmlall':'UTF-8'}img/forbbiden.gif'/>{l s='Remove' mod='customfields' js=1}
</a>
</li>`);
//$(newlist).prependTo("#valuesOptions");
$('#valuesOptions').append(newlist);
var input = newlist.find('input');
if (value){
input.val(value);
var name = "options["+id+"]";
}
}
updateRequriedOptions();
{$jqueryOptions}//html code, cannot be escaped
</script>

View File

@@ -0,0 +1,36 @@
<?php
/*
* 2007-2014 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2014 PrestaShop SA
* @version Release: $Revision$
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@@ -0,0 +1,36 @@
<?php
/*
* 2007-2014 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2014 PrestaShop SA
* @version Release: $Revision$
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@@ -0,0 +1,36 @@
<?php
/*
* 2007-2014 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2014 PrestaShop SA
* @version Release: $Revision$
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@@ -0,0 +1,112 @@
{*
* FMM Custom Fields
*
* NOTICE OF LICENSE
*
* You are not authorized to modify, copy or redistribute this file.
* Permissions are reserved by FMM Modules.
*
* @author FMM Modules
* @copyright 2018 FMM Modules All right reserved
* @license FMM Modules
*}
<table id="customfields_product_list" class="std table">
<thead>
<tr>
<th class="center">{l s='ID' mod='customfields'}</th>
<th class="left">{l s='Product' mod='customfields'}</th>
<th class="col-sm-1">{l s='Actions' mod='customfields'}</th>
</tr>
</thead>
<tbody id="customProducts">
{if isset($products) AND $products}
{foreach from=$products item=id_product}
<tr id="selected_product_{$id_product|escape:'htmlall':'UTF-8'}" class="row_product">
<input type="hidden" name="products[]" value="{$id_product|escape:'htmlall':'UTF-8'}" class="products"/>
<td class="center">{$id_product|escape:'htmlall':'UTF-8'}</td>
<td class="left">{Product::getProductName($id_product|escape:'htmlall':'UTF-8', null, $id_lang)}</td>
<td class="center">
<a class="btn btn-danger button" href="javascript:void(0);" title="{l s='Delete' mod='customfields'}" onclick="deleteProduct({$id_product|escape:'htmlall':'UTF-8'})">
<i class="icon-trash"></i>
{if $version < 1.6}
<img src="{$smarty.const._PS_ADMIN_IMG_}delete.gif" alt="{l s='Delete' mod='customfields'}" />
{/if}
</a>
</td>
</tr>
{/foreach}
{/if}
</tbody>
</table>
<script type="text/javascript">
var link = "{$link->getAdminLink('AdminFields')}";
var lang = '{$id_lang}';
var version = "{$version}";
var img = "";
var delete_label = "{l s='Delete' mod='customfields' js=1}";
if (parseFloat(version) < 1.6) {
img = '<img src="../img/admin/delete.gif" />';
}
$(document).ready(function() {
$("#customProducts").parent().removeClass("hide");
var options = {
minChars: 3,
max: 10,
width: 500,
selectFirst: false,
scroll: false,
dataType: "json",
formatItem: function(data, i, max, value, term) {
return value;
},
parse: function(data) {
var mytab = new Array();
for (var i = 0; i < data.length; i++) {
mytab[mytab.length] = {
data: data[i],
value: data[i].id_product + ' - ' + data[i].pname
};
}
return mytab;
},
extraParams: {
action : 'searchProduct',
ajaxSearch: true,
id_lang: lang
}
};
/* Autocomplete */
$("#CUSTOMFIELDS_PRODUCT")
.autocomplete(link, options)
.result(function(event, data, formatted) {
var $customProducts = $("#customProducts");
if (data.id_product.length > 0 && data.pname.length > 0) {
var exclude = [];
var selected = $(".products");
for (var i = 0; i < selected.length; i++) {
exclude.push(selected[i].value);
}
var ps_div = "";
if ($.inArray(data.id_product, exclude) == -1) {
ps_div = '<tr id="selected_product_' + data.id_product + '">'
+'<input type="hidden" name="products[]" value="' + data.id_product + '" class="products"/>'
+'<td class="center">' + data.id_product + '</td>'
+'<td class="left">'+ data.pname +'</td>'
+'<td class="center">'
+'<a class="btn btn-danger button" href="javascript:void(0);" title="' + delete_label + '" onclick="deleteProduct('+ data.id_product +')">'+ img +'<i class="icon-trash"></i></a>'
'</td>'
+'</tr>';
$customProducts.show().html($customProducts.html() + ps_div);
}
}
});
});
function deleteProduct(id) {
$("#selected_product_"+id).remove();
}
</script>

View File

@@ -0,0 +1,36 @@
<?php
/*
* 2007-2014 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2014 PrestaShop SA
* @version Release: $Revision$
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@@ -0,0 +1,36 @@
<?php
/*
* 2007-2014 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2014 PrestaShop SA
* @version Release: $Revision$
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@@ -0,0 +1,35 @@
{**
* Registration Fields
*
* NOTICE OF LICENSE
*
* You are not authorized to modify, copy or redistribute this file.
* Permissions are reserved by FME Modules.
*
* @author FME Modules
* @copyright 2018 fmemodules All right reserved
* @license FMM Modules
* @package Registration Fields
*}
<!-- registration fields heading -->
{foreach from=$checkout_steps key=key item=title}
{if isset($grouped_fields[$key]) AND $grouped_fields[$key]}
{foreach from=$grouped_fields.$key item=field name=custom_fields}
{if in_array($field.field_type, array('multiselect', 'radio', 'checkbox', 'select'))}
{assign var='field_value' value=$field.field_value}
{elseif $field.field_type == 'message'}
{assign var='field_value' value=$field.default_value}
{else}
{assign var='field_value' value=$obj_model->getFormatedValue($field)}
{/if}
{cycle values=["color_line_even", "color_line_odd"] assign=bgcolor_class}
{if $field.field_type == 'attachment'}
{continue}
{else}
<span>
{$field.field_name|escape:'htmlall':'UTF-8'} <strong>{$field_value|escape:'htmlall':'UTF-8'}</strong><br/>
</span>
{/if}
{/foreach}
{/if}
{/foreach}

View File

@@ -0,0 +1,59 @@
{**
* Registration Fields
*
* NOTICE OF LICENSE
*
* You are not authorized to modify, copy or redistribute this file.
* Permissions are reserved by FME Modules.
*
* @author FME Modules
* @copyright 2018 fmemodules All right reserved
* @license FMM Modules
* @package Registration Fields
*}
<!-- registration fields heading -->
<table id="summary-tab">
<tr>
<td class="center grey bold">
{if isset($customfields_heading) AND $customfields_heading}
{$customfields_heading|escape:'htmlall':'UTF-8'}
{else}
{l s='Custom Fields' mod='customfields' pdf='true'}
{/if}
</td>
</tr>
</table>
<!-- registration fields -->
<table id="summary-tab">
{foreach from=$checkout_steps key=key item=title}
{if isset($grouped_fields[$key]) AND $grouped_fields[$key]}
<tr>
<td colspan="2" class="header" valign="middle" style="border-top:1px solid #000;border-bottom:1px solid #000;text-align:center">{$title|escape:'htmlall':'UTF-8'}
</td>
</tr>
{foreach from=$grouped_fields.$key item=field name=custom_fields}
{if in_array($field.field_type, array('multiselect', 'radio', 'checkbox', 'select'))}
{assign var='field_value' value=$field.field_value}
{elseif $field.field_type == 'message'}
{assign var='field_value' value=$field.default_value}
{else}
{assign var='field_value' value=$obj_model->getFormatedValue($field)}
{/if}
{cycle values=["color_line_even", "color_line_odd"] assign=bgcolor_class}
{if $field.field_type == 'attachment'}
{continue}
{else}
<tr class="product {$bgcolor_class|escape:'htmlall':'UTF-8'}">
<td class="left grey bold" width="45%" style="margin-left:15px;">
{$field.field_name|escape:'htmlall':'UTF-8'}
</td>
<td class="left white" width="55%" style="margin-left:15px;">
{$field_value|escape:'htmlall':'UTF-8'}
</td>
</tr>
{/if}
{/foreach}
{/if}
{/foreach}
</table>

View File

@@ -0,0 +1,36 @@
<?php
/*
* 2007-2014 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2014 PrestaShop SA
* @version Release: $Revision$
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@@ -0,0 +1,79 @@
{*
* auction Products
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
*
* @author FME Modules
* @copyright 2019 fmemodules All right reserved
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*}
{*Tools::version_compare(_PS_VERSION_, '1.7.0.0', '>=')*}
<div class="panel" id="fmm_promo_panel">
<div class="col-lg-3">
<ul>
<li><a href="{$smarty.const.__PS_BASE_URI__|escape:'htmlall':'UTF-8'}modules/customfields/readme_en.pdf" target="_blank" title="Need Help">{if Tools::version_compare(_PS_VERSION_, '1.7.0.0', '>=') > 0}<i class="material-icons">&#xE887;</i>{else}<i class="icon-question-circle"></i>{/if}Help?</a></li>
<li class="color_red"><a href="https://addons.prestashop.com/contact-form.php?id_product=19008" target="_blank" title="Need Support">{if Tools::version_compare(_PS_VERSION_, '1.7.0.0', '>=') > 0}<i class="material-icons">&#xE0C6;</i>{else}<i class="icon-comments"></i>{/if}Support</a></li>
<li class="color_blue"><a href="https://addons.prestashop.com/en/registration-ordering-process/19008-custom-fields-add-extra-field-to-checkout-order-page.html" target="_blank" title="Need Details">{if Tools::version_compare(_PS_VERSION_, '1.7.0.0', '>=') > 0}<i class="material-icons">&#xE8F4;</i>{else}<i class="icon-eye"></i>{/if}Details</a></li>
<li class="color_orange"><a href="http://addons.prestashop.com/en/ratings.php" target="_blank" title="Rate us 5 stars">{if Tools::version_compare(_PS_VERSION_, '1.7.0.0', '>=') > 0}<i class="material-icons">&#xE8D0;</i>{else}<i class="icon-gratipay"></i>{/if}Rate Us</a></li>
</ul>
</div>
<div class="col-lg-7 fmm_promo_modules">
<ol>
<li class="fmm_promo_maylike">Modules you may like...</li>
<li><a href="https://addons.prestashop.com/en/url-redirects/16633-pretty-urls-remove-ids-numbers-for-seo-friendly-url.html" target="_blank" title="Pretty URLs"><img src="https://www.fmemodules.com/1249-home_default/pretty-urls.jpg" alt="" /><i>Pretty URLs Module</i></a></li>
<li><a href="https://addons.prestashop.com/en/seo-natural-search-engine-optimization/17273-seo-optimizer-add-meta-sitemap-robots-url-redirect.html" target="_blank" title="Advance SEO"><img src="https://www.fmemodules.com/1662-home_default/advance-seo.jpg" alt="" /><i>Advance SEO Module</i></a></li>
<li><a href="https://addons.prestashop.com/en/registration-ordering-process/19294-registration-fields-add-custom-fields-attributes.html" target="_blank" title="Registration Fields"><img src="https://www.fmemodules.com/1521-home_default/additional-customer-registration-fields.jpg" alt="" /><i>Registration Fields Module</i></a></li>
</ol>
</div>
<div class="col-lg-2 fmm_promo_basecamp">
<a href="https://addons.prestashop.com/en/139_fme-modules" title="FME Modules" target="_blank">
<i>See all modules</i>
<img src="https://www.fmemodules.com/img/prestashop-modules-and-addons-logo-1456381524.jpg" />
</a>
</div>
</div>
{literal}
<style type="text/css">
.panel:after { content: "."; clear: both; width: 100%; visibility: hidden; height: 0px; display: block;}
#fmm_promo_panel ul { padding: 0; margin: 0; list-style: none; font-size: 12px; color: #6ab233;}
#fmm_promo_panel ul a { text-decoration: none; color: #6ab233;}
#fmm_promo_panel ul a:hover,
#fmm_promo_panel ul a:focus,
#fmm_promo_panel ul a:active { text-decoration: none; color: #515151 !important;}
#fmm_promo_panel ul li { list-style: none; display: inline-block; width: 23%; margin-right: 1%; text-align: center;}
#fmm_promo_panel ul li i { display: block; clear: both; font-size: 42px;}
#fmm_promo_panel ul li.color_red,
#fmm_promo_panel ul li.color_red a { color: red;}
#fmm_promo_panel ul li.color_blue,
#fmm_promo_panel ul li.color_blue a { color: #4169E1;}
#fmm_promo_panel ul li.color_orange,
#fmm_promo_panel ul li.color_orange a { color: #fbbb22;}
.fmm_promo_modules ol { padding: 0; margin: 0; list-style: none; font-size: 11px; color: #6ab233; display: inline-block;}
.fmm_promo_modules ol li { list-style: none; display: inline-block; width: 22%; margin-right: 1%; text-align: center; vertical-align: middle}
.fmm_promo_modules ol li.fmm_promo_maylike { width: 20%;font-size: 12px; color: #6ab233; text-transform: uppercase;padding: 0; margin: 0 3% 0 0;
font-weight: bold;}
.fmm_promo_modules ol li a {display: block; line-height: 18px;text-decoration: none; color: #6ab233;}
.fmm_promo_modules ol li a img { display: inline-block; padding-right: 1%; max-width: 49%; vertical-align: middle; width: 49%;}
.fmm_promo_modules ol li i { font-style: normal; display: inline-block; vertical-align: middle; width: 50%;}
.fmm_promo_basecamp { text-align: center;}
.fmm_promo_basecamp a { text-decoration: none;color:#6ab233;}
.fmm_promo_basecamp a:hover,
.fmm_promo_basecamp a:active,
.fmm_promo_basecamp a:focus { text-decoration: none; color:#515151 !important; }
.fmm_promo_basecamp i { font-style: normal; text-transform: uppercase; font-weight: 700; padding: 4px;
border: 1px solid #6ab233; border-radius: 4px; display: block; clear: both; margin-bottom: 5px; }
.fmm_promo_basecamp a:hover i {color:#515151 !important; border-color:#515151 !important; }
.fmm_promo_basecamp img { max-width: 100%; width: 150px;}
@media (min-width: 200px) and (max-width: 1190px) {
.fmm_promo_modules,
.fmm_promo_basecamp { padding-top: 15px;}
}
@media (min-width: 200px) and (max-width:430px) {
.fmm_promo_modules { display: none}
}
</style>{/literal}

View File

@@ -0,0 +1,344 @@
{*
* Customfields
*
* NOTICE OF LICENSE
*
* You are not authorized to modify, copy or redistribute this file.
* Permissions are reserved by FMM Modules.
*
* @author FMM Modules
* @copyright 2019 FMM Modules All right reserved
* @license FMM Modules
* @package Customfields
*}
{if isset($checkout_fields) AND count($checkout_fields) > 0}
<div class="clearfix box card card-block" id="checkoutblock-wrapper">
<h4>{if $language.id == 2}Billing{else}Dane do faktury{/if}</h4><hr>
<ul>
{foreach from=$checkout_fields key=key item=summary_fields}
{if isset($summary_fields) AND $summary_fields AND count($summary_fields) > 0}
<li>
<div class="clearfix accordion {if $version < 1.7}psOld{/if}" id="customfieldsblock_{$key|escape:'htmlall':'UTF-8'}">
<form class="std checkout_form well accordion-content" id="{$key|escape:'htmlall':'UTF-8'}_form" method="post" action="{$action_controller|escape:'htmlall':'UTF-8'}" data-step="{$key|escape:'htmlall':'UTF-8'}">
{foreach from=$summary_fields item=field}
<div class="clearfix"></div>
<div class="input_wrapper required form-group text form-group row{if $field['dependant'] > 0} rf_no_display rf_no_display_{$field['dependant_field']|escape:'htmlall':'UTF-8'}_{$field['dependant_value']|escape:'htmlall':'UTF-8'}{/if} rf_only_f_{$field['dependant_field']|escape:'htmlall':'UTF-8'}"
data-id="{$field.id_custom_field|escape:'htmlall':'UTF-8'}"
data-f="{$field['dependant_field']|escape:'htmlall':'UTF-8'}"
data-v="{$field['dependant_value']|escape:'htmlall':'UTF-8'}"
data-dependant-field="{$field['dependant']|escape:'htmlall':'UTF-8'}">
<label class="input_label {if $field['value_required']} required {/if}{if $version >= 1.7}col-md-3{/if} form-control-label">
{$field.field_name|escape:'htmlall':'UTF-8'}
</label>
<div class="{if $version >= 1.7}col-md-6{/if}">
{if $field.field_type neq 'message'}
{assign var='field_value' value=$model->getFormatedValue($field)}
{/if}
{if $field.field_type eq 'text'}
{assign var="text_default_value" value=$field['default_value']}
{if $field.editable == 0}
{if isset($field_value) AND $field_value}
<span class="form-control">{$field_value|escape:'htmlall':'UTF-8'}</span>
{else}
<input type="text" name="fields[{$field['id_custom_field']|escape:'htmlall':'UTF-8'}]" value="" class="text {if $field['value_required']}is_required {/if}{if isset($field['field_validation']) AND $field['field_validation'] }validate_field{/if} form-control" {if isset($field['field_validation']) AND $field['field_validation']} data-validate="{$field['field_validation']|escape:'htmlall':'UTF-8'}"{/if}/>
{/if}
{else}
<input type="text"
name="fields[{$field['id_custom_field']|escape:'htmlall':'UTF-8'}]"
value="{if !empty($field_value) AND $field_value}{$field_value|escape:'htmlall':'UTF-8'}{elseif !empty($text_default_value) AND $text_default_value}{$text_default_value|escape:'htmlall':'UTF-8'}{/if}"
class="text {if $field['value_required']}is_required {/if}{if isset($field['field_validation']) AND $field['field_validation'] }validate_field{/if} form-control"
{if isset($field['field_validation']) AND $field['field_validation']} data-validate="{$field['field_validation']|escape:'htmlall':'UTF-8'}"{/if}/>
{/if}
{elseif $field.field_type eq 'textarea'}
{assign var="texta_default_value" value=$field['default_value']}
{if $field.editable == 0}
{if isset($field_value) AND $field_value}
<span class="form-control">{$field_value|escape:'htmlall':'UTF-8'}</span>
{else}
<textarea name="fields[{$field['id_custom_field']|escape:'htmlall':'UTF-8'}]" class="form-control {if $field['value_required']}is_required{/if}" {if isset($field['field_validation']) AND $field['field_validation']}data-validate="{$field['field_validation']|escape:'htmlall':'UTF-8'}"{/if}></textarea>
{/if}
{else}
<textarea name="fields[{$field['id_custom_field']|escape:'htmlall':'UTF-8'}]" class="form-control {if $field['value_required']}is_required{/if}" {if isset($field['field_validation']) AND $field['field_validation']}data-validate="{$field['field_validation']|escape:'htmlall':'UTF-8'}"{/if}>{if !empty($field_value) AND $field_value}{$field_value|escape:'htmlall':'UTF-8'}{elseif !empty($text_default_value) AND $text_default_value}{$text_default_value|escape:'htmlall':'UTF-8'}{/if}</textarea>
{/if}
{elseif $field.field_type eq 'date'}
{if $field.editable == 0}
{if isset($field_value) AND $field_value}
<span class="form-control">{$field_value|escape:'htmlall':'UTF-8'}</span>
{else}
<input class="fields_datapicker form-control {if $field['value_required']} is_required {/if} validate_field" type="text" name="fields[{$field['id_custom_field']|escape:'htmlall':'UTF-8'}]" value="" data-validate="isDate"/>
{/if}
{else}
<input class="fields_datapicker form-control {if $field['value_required']} is_required {/if} validate_field"
type="text"
name="fields[{$field['id_custom_field']|escape:'htmlall':'UTF-8'}]"
value="{if !empty($field_value) AND $field_value}{$field_value|escape:'htmlall':'UTF-8'}{/if}"
data-validate="isDate"/>
{/if}
{elseif $field.field_type eq 'boolean'}
{if $field.editable == 0}
{if isset($field_value) AND $field_value}
<span class="form-control">{$field_value|escape:'htmlall':'UTF-8'}</span>
{else}
<select class="select form-control {if $field['value_required']}is_required {/if}"
name="fields[{$field['id_custom_field']|escape:'htmlall':'UTF-8'}]"
data-field="{$field['id_custom_field']|escape:'htmlall':'UTF-8'}"
data-type="{$field.field_type|escape:'htmlall':'UTF-8'}">
<option value="No">{l s='No' mod='customfields'}</option>
<option value="Yes">{l s='Yes' mod='customfields'}</option>
</select>
{/if}
{else}
<select class="select form-control {if $field['value_required']}is_required {/if}"
name="fields[{$field['id_custom_field']|escape:'htmlall':'UTF-8'}]"
data-field="{$field['id_custom_field']|escape:'htmlall':'UTF-8'}"
data-type="{$field.field_type|escape:'htmlall':'UTF-8'}">
<option value="No" {if !empty($field_value) AND $field_value == 'No'}selected="selected"{/if}>{l s='No' mod='customfields'}</option>
<option value="Yes" {if !empty($field_value) AND $field_value == 'Yes'}selected="selected"{/if}>{l s='Yes' mod='customfields'}</option>
</select>
{/if}
{elseif $field.field_type eq 'select'}
{assign var='summary_fields_values' value=$model->getCustomFieldsValues($field['id_custom_field'])}
{if $field.editable == 0}
{if isset($field_value) AND $field_value}
{$field_value = FieldsModel::getFieldsValueById($field_value)}
<span class="form-control">{$field_value|escape:'htmlall':'UTF-8'}</span>
{else}
<select class="select form-control {if $field['value_required']}is_required {/if}" name="fields[{$field['id_custom_field']|escape:'htmlall':'UTF-8'}]" >
<option value="">{l s='Select Option' mod='customfields'}</option>
{foreach from=$summary_fields_values item=summary_fields_value}
<option value="{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}">{$summary_fields_value['field_value']|escape:'htmlall':'UTF-8'}
</option>
{/foreach}
</select>
{/if}
{else}
<select class="select form-control {if $field['value_required']}is_required {/if}" name="fields[{$field['id_custom_field']|escape:'htmlall':'UTF-8'}]" >
<option value="">{l s='Select Option' mod='customfields'}</option>
{foreach from=$summary_fields_values item=summary_fields_value}
<option value="{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}"
{if isset($field_value) AND $summary_fields_value.field_value_id == $field_value}selected="selected"{/if}>{$summary_fields_value['field_value']|escape:'htmlall':'UTF-8'}
</option>
{/foreach}
</select>
{/if}
{elseif $field.field_type eq 'radio'}
<input class="checkboxes" type="hidden" data-required="{$field['value_required']}" value="{count($field_value)}">
{assign var='summary_fields_values' value=$model->getCustomFieldsValues($field['id_custom_field'])}
{if $field.editable == 0}
{if isset($field_value) AND $field_value}
{$field_value = FieldsModel::getFieldsValueById($field_value)}
<span class="form-control">{$field_value|escape:'htmlall':'UTF-8'}</span>
{else}
{foreach from=$summary_fields_values item=summary_fields_value}
<div class="type_multiboxes" id="uniform-{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}">
<input type="radio"
id="radio_{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}"
class="{if $field['value_required']}is_required {/if}"
data-type="{$field.field_type|escape:'htmlall':'UTF-8'}"
data-field="{$field['id_custom_field']|escape:'htmlall':'UTF-8'}"
name="fields[{$field['id_custom_field']|escape:'htmlall':'UTF-8'}][]"
value="{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}"/>
<label class="type_multiboxes top" for="radio_{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}">
<span><span></span></span>{$summary_fields_value['field_value']|escape:'htmlall':'UTF-8'}
</label>
</div>
<div class="clearfix"></div>
{/foreach}
{/if}
{else}
<!-- <div class="clearfix"> -->
{foreach from=$summary_fields_values item=summary_fields_value}
<!-- <div class="radio-inline"> -->
<div class="type_multiboxes" id="uniform-{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}">
<input type="radio"
id="radio_{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}"
class="{if $field['value_required']}is_required {/if}"
data-type="{$field.field_type|escape:'htmlall':'UTF-8'}"
data-field="{$field['id_custom_field']|escape:'htmlall':'UTF-8'}"
name="fields[{$field['id_custom_field']|escape:'htmlall':'UTF-8'}][]"
value="{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}"
{if isset($field_value) AND $summary_fields_value.field_value_id == $field_value}checked="checked"{/if}
/>
<label class="type_multiboxes top" for="radio_{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}">
<span><span></span></span>{$summary_fields_value['field_value']|escape:'htmlall':'UTF-8'}
</label>
</div>
<div class="clearfix"></div>
<!-- </div> -->
{/foreach}
<!-- </div> -->
{/if}
{elseif $field.field_type eq 'checkbox'}
{if isset($field_value) AND $field_value}
{assign var='options' value=explode(',', $field_value)}
{else}
{assign var='options' value=[]}
{/if}
<input class="checkboxes"
type="hidden"
data-required="{$field['value_required']}"
data-type="{$field.field_type|escape:'htmlall':'UTF-8'}"
value="{if $field['dependant'] > 0}1{else}{count($options)}{/if}"{if $field['dependant'] > 0} data-depend="1"{else} data-depend="0"{/if}>
{assign var='summary_fields_values' value=$model->getCustomFieldsValues($field['id_custom_field'])}
{if $field.editable == 0}
{if isset($field_value) AND $field_value}
{assign var='opts' value=[]}
{if isset($options) AND is_array($options)}
{foreach from=$options item=id_value}
{$opts[] = FieldsModel::getFieldsValueById($id_value)}
{/foreach}
{/if}
{if isset($opts) AND $opts AND is_array($opts)}
{$field_value = implode(',', $opts)}
{/if}
<span class="form-control">{$field_value|escape:'htmlall':'UTF-8'}</span>
{else}
{foreach from=$summary_fields_values item=summary_fields_value}
<!-- <div class="checkbox"> -->
<div class="type_multiboxes checker" id="uniform-{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}">
<input type="checkbox"
value="{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}"
name="fields[{$field['id_custom_field']|escape:'htmlall':'UTF-8'}][]" id="checkbox_{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}"
class="{if $field['value_required']}is_required{/if}"/>
<label class="type_multiboxes" for="checkbox_{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}">
<span></span>{$summary_fields_value['field_value']|escape:'htmlall':'UTF-8'}
</label>
</div>
<div class="clearfix"></div>
<!-- </div> -->
{/foreach}
{/if}
{else}
{foreach from=$summary_fields_values item=summary_fields_value}
<!-- <div class="checkbox"> -->
<div class="type_multiboxes" id="checkbox-{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}">
<input type="checkbox"
data-field="{$field['id_custom_field']|escape:'htmlall':'UTF-8'}"
data-type="{$field.field_type|escape:'htmlall':'UTF-8'}"
value="{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}"
name="fields[{$field['id_custom_field']|escape:'htmlall':'UTF-8'}][]" id="checkbox_{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}"
class="{if $field['value_required']}is_required{/if} form-control"
{if isset($options) AND is_array($options) AND in_array($summary_fields_value.field_value_id, $options)}checked="checked"{/if}/>
<label class="type_multiboxes" for="checkbox_{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}">
<span></span>{$summary_fields_value['field_value']|escape:'htmlall':'UTF-8'}
</label>
</div>
<div class="clearfix"></div>
<!-- </div> -->
{/foreach}
{/if}
{elseif $field.field_type eq 'multiselect'}
{if isset($field_value) AND $field_value}
{assign var='options' value=explode(',', $field_value)}
{else}
{assign var='options' value=[]}
{/if}
<input class="checkboxes" type="hidden" data-required="{$field['value_required']}" value="{count($options)}">
{assign var='summary_fields_values' value=$model->getCustomFieldsValues($field['id_custom_field'])}
{if $field.editable == 0}
{if isset($field_value) AND $field_value}
{assign var='opts' value=[]}
{if isset($options) AND is_array($options)}
{foreach from=$options item=id_value}
{$opts[] = FieldsModel::getFieldsValueById($id_value)}
{/foreach}
{/if}
{if isset($opts) AND $opts AND is_array($opts)}
{$field_value = implode(',', $opts)}
{/if}
<span class="form-control">{$field_value|escape:'htmlall':'UTF-8'}</span>
{else}
<select name="fields[{$field['id_custom_field']|escape:'htmlall':'UTF-8'}][]" multiple="multiple" class="type_multiboxes multiselect form-control {if $field['value_required']}is_required {/if}">
{foreach from=$summary_fields_values item=summary_fields_value}
<option value="{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}">{$summary_fields_value['field_value']|escape:'htmlall':'UTF-8'}
</option>
{/foreach}
</select>
<p><small>{l s='Hold CTRL/Command key to select multiple values.' mod='customfields'}</small></p>
{/if}
{else}
<select name="fields[{$field['id_custom_field']|escape:'htmlall':'UTF-8'}][]" multiple="multiple" class="type_multiboxes multiselect form-control {if $field['value_required']}is_required {/if}">
{foreach from=$summary_fields_values item=summary_fields_value}
<option value="{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}" {if isset($options) AND is_array($options) AND in_array($summary_fields_value.field_value_id, $options)}selected="selected"{/if}>{$summary_fields_value['field_value']|escape:'htmlall':'UTF-8'}
</option>
{/foreach}
</select>
<p><small>{l s='Hold CTRL/Command key to select multiple values.' mod='customfields'}</small></p>
{/if}
{elseif $field.field_type eq 'attachment'}
<div id="field_attachment_{$field['id_custom_field']|escape:'htmlall':'UTF-8'}">
{assign var='root_dir' value=($smarty.const._PS_ROOT_DIR_|cat:'/')}
{if $field.editable == 0}
<!-- {*assign var='field_value' value=''*} -->
{if isset($field_value) AND $field_value}
<p><a class="btn btn-primary button" href="{$action_controller|escape:'htmlall':'UTF-8'}&downloadFile&l={base64_encode({$field_value|escape:'htmlall':'UTF-8'})}">{l s='Download' mod='customfields'} {pathinfo($field_value|replace:$root_dir:''|escape:'htmlall':'UTF-8', $smarty.const.PATHINFO_FILENAME)}</a></p>
{else}
<input type="file" name="fields[{$field.id_custom_field|escape:'htmlall':'UTF-8'}]" value="" class="form-control attachment {if $field['value_required']}is_required {/if}{if isset($field['field_validation']) AND $field['field_validation'] }validate_field{/if}" {if isset($field['field_validation']) AND $field['field_validation']} data-validate="{$field['field_validation']|escape:'htmlall':'UTF-8'}"{/if} {if isset($field.extensions) AND $field.extensions} data-extensions="{$field.extensions|escape:'htmlall':'UTF-8'}"{/if}>
{if isset($field.extensions) AND $field.extensions} <p><small>{l s='Allowed file types' mod='customfields'}: {$field.extensions|escape:'htmlall':'UTF-8'}</small></p>{/if}
<p class="alert alert-danger error extension_error">{l s='Image type not allowed.' mod='customfields'}</p>
{/if}
{else}
{if !empty($field_value) AND $field_value}
<p><a class="btn btn-primary button" href="{$action_controller|escape:'htmlall':'UTF-8'}&downloadFile&l={base64_encode({$field_value|escape:'htmlall':'UTF-8'})}">{l s='Download' mod='customfields'} {pathinfo($field_value|replace:$root_dir:''|escape:'htmlall':'UTF-8', $smarty.const.PATHINFO_FILENAME)}</a></p>
{/if}
<input type="file" name="fields[{$field.id_custom_field|escape:'htmlall':'UTF-8'}]" value="" class="form-control attachment {if $field['value_required']}is_required {/if}{if isset($field['field_validation']) AND $field['field_validation'] }validate_field{/if}" {if isset($field['field_validation']) AND $field['field_validation']} data-validate="{$field['field_validation']|escape:'htmlall':'UTF-8'}"{/if} {if isset($field.extensions) AND $field.extensions} data-extensions="{$field.extensions|escape:'htmlall':'UTF-8'}"{/if}>
{if isset($field.extensions) AND $field.extensions} <p><small>{l s='Allowed file types' mod='customfields'}: {$field.extensions|escape:'htmlall':'UTF-8'}</small></p>{/if}
<p class="alert alert-danger error extension_error">{l s='Image type not allowed.' mod='customfields'}</p>
{/if}
</div>
{elseif $field.field_type eq 'message'}
<b>{$field['default_value']|escape:'htmlall':'UTF-8'}</b>
{/if}
</div>
<div class="clearfix"></div>
</div>
{/foreach}
<input type="hidden" name="type" value="{$key|escape:'htmlall':'UTF-8'}"/>
<input type="hidden" name="id_order" value="{$id_order|escape:'htmlall':'UTF-8'}"/>
<input type="hidden" name="id_cart" value="{$id_cart|escape:'htmlall':'UTF-8'}"/>
</form>
</div>
</li>
{/if}
{/foreach}
</ul>
<hr>
{if (isset($is_editable) AND $is_editable > 0) OR (isset($nbrMissingFields) AND $nbrMissingFields > 0) OR (isset($nbrNonEditableValues) AND $nbrNonEditableValues > 0)}
<form action="javascript:void(0);">
<footer class="form-footer text-sm-center">
<div class="form-group row">
<div class="col-lg-12">
{hook h='displayGDPRConsent' mod='psgdpr' id_module=$id_module}
</div>
</div>
<button class="btn btn-primary form-control-submit" name="saveCustomFields" type="submit">
{l s='Save Fields' mod='customfields'}
</button>
</footer>
<div class="sending_loader" style="display: none;"></div>
</form>
{/if}
</div>
{/if}

View File

@@ -0,0 +1,294 @@
{*
* Customfields
*
* NOTICE OF LICENSE
*
* You are not authorized to modify, copy or redistribute this file.
* Permissions are reserved by FMM Modules.
*
* @author FMM Modules
* @copyright 2019 FMM Modules All right reserved
* @license FMM Modules
* @package Customfields
*}
{if count($summary_fields) > 0}
<div class="clearfix box card card-block" id="customfieldsblock_{$type|escape:'htmlall':'UTF-8'}">
<form class="checkout_form" id="{$type|escape:'htmlall':'UTF-8'}_form" method="post" action="{$action_controller|escape:'htmlall':'UTF-8'}" data-step="{$type|escape:'htmlall':'UTF-8'}">
{foreach from=$summary_fields item=field}
{if !empty($field['sub_heading'])}<h3 class="page-subheading">{$field['sub_heading']|escape:'htmlall':'UTF-8'}</h3>{/if}
<div class="clearfix"></div>
<div class="input_wrapper required form-group text form-group row{if $field.dependant > 0} rf_no_display rf_no_display_{$field.dependant_field|escape:'htmlall':'UTF-8'}_{$field.dependant_value|escape:'htmlall':'UTF-8'}{/if} rf_only_f_{$field.dependant_field|escape:'htmlall':'UTF-8'}" data-id="{$field.id_custom_field|escape:'htmlall':'UTF-8'}" data-f="{$field.dependant_field|escape:'htmlall':'UTF-8'}" data-v="{$field.dependant_value|escape:'htmlall':'UTF-8'}" data-dependant-field="{$field['dependant']|escape:'htmlall':'UTF-8'}">
<label class="input_label {if $field['value_required']} required {/if}{if $version >= 1.7}col-md-5{/if} form-control-label">
{$field.field_name|escape:'htmlall':'UTF-8'}
</label>
<div class="{if $version >= 1.7}col-md-7{/if}">
{if $field.field_type neq 'message'}
{assign var='field_value' value=$model->getFormatedValue($field)}
{/if}
{if $field.field_type eq 'text'}
{assign var="text_default_value" value=$field['default_value']}
{if $field.editable == 0}
{if isset($field_value) AND $field_value}
<span class="form-control">{$field_value|escape:'htmlall':'UTF-8'}</span>
{else}
<input type="text" name="fields[{$field['id_custom_field']|escape:'htmlall':'UTF-8'}]" value="" class="text {if $field['value_required']}is_required {/if}{if isset($field['field_validation']) AND $field['field_validation'] }validate_field{/if} form-control" {if isset($field['field_validation']) AND $field['field_validation']} data-validate="{$field['field_validation']|escape:'htmlall':'UTF-8'}" {/if} />
{/if}
{else}
<input type="text" data-type="{$field.field_type|escape:'htmlall':'UTF-8'}" name="fields[{$field['id_custom_field']|escape:'htmlall':'UTF-8'}]" value="{if !empty($field_value) AND $field_value}{$field_value|escape:'htmlall':'UTF-8'}{elseif !empty($text_default_value) AND $text_default_value}{$text_default_value|escape:'htmlall':'UTF-8'}{/if}" class="text {if $field['value_required']}is_required {/if}{if isset($field['field_validation']) AND $field['field_validation'] }validate_field{/if} form-control" {if isset($field['field_validation']) AND $field['field_validation']} data-validate="{$field['field_validation']|escape:'htmlall':'UTF-8'}" {/if} />
{/if}
{elseif $field.field_type eq 'textarea'}
{assign var="texta_default_value" value=$field['default_value']}
{if $field.editable == 0}
{if isset($field_value) AND $field_value}
<span class="form-control">{$field_value|escape:'htmlall':'UTF-8'}</span>
{else}
<textarea name="fields[{$field['id_custom_field']|escape:'htmlall':'UTF-8'}]" data-type="{$field.field_type|escape:'htmlall':'UTF-8'}" class="form-control {if $field['value_required']}is_required{/if}" {if isset($field['field_validation']) AND $field['field_validation']}data-validate="{$field['field_validation']|escape:'htmlall':'UTF-8'}" {/if}></textarea>
{/if}
{else}
<textarea name="fields[{$field['id_custom_field']|escape:'htmlall':'UTF-8'}]" data-type="{$field.field_type|escape:'htmlall':'UTF-8'}" class="form-control {if $field['value_required']}is_required{/if}" {if isset($field['field_validation']) AND $field['field_validation']}data-validate="{$field['field_validation']|escape:'htmlall':'UTF-8'}" {/if}>{if !empty($field_value) AND $field_value}{$field_value|escape:'htmlall':'UTF-8'}{elseif !empty($text_default_value) AND $text_default_value}{$text_default_value|escape:'htmlall':'UTF-8'}{/if}</textarea>
{/if}
{elseif $field.field_type eq 'date'}
{if $field.editable == 0}
{if isset($field_value) AND $field_value}
<span class="form-control">{$field_value|escape:'htmlall':'UTF-8'}</span>
{else}
<input class="fields_datapicker form-control {if $field['value_required']} is_required {/if} validate_field" type="text" data-type="{$field.field_type|escape:'htmlall':'UTF-8'}" name="fields[{$field['id_custom_field']|escape:'htmlall':'UTF-8'}]" data-validate="isDate" />
{/if}
{else}
<input class="fields_datapicker form-control {if $field['value_required']} is_required {/if} validate_field" type="text" name="fields[{$field['id_custom_field']|escape:'htmlall':'UTF-8'}]" value="{if !empty($field_value) AND $field_value}{$field_value|escape:'htmlall':'UTF-8'}{/if}" data-validate="isDate" />
{/if}
{elseif $field.field_type eq 'boolean'}
{if $field.editable == 0}
<select class="select form-control {if $field['value_required']}is_required {/if}" name="fields[{$field['id_custom_field']|escape:'htmlall':'UTF-8'}]" data-field="{$field['id_custom_field']|escape:'htmlall':'UTF-8'}" data-type="{$field.field_type|escape:'htmlall':'UTF-8'}">
<option value="No">{l s='No' mod='customfields'}</option>
<option value="Yes">{l s='Yes' mod='customfields'}</option>
</select>
{else}
<select class="select form-control {if $field['value_required']}is_required {/if}" name="fields[{$field['id_custom_field']|escape:'htmlall':'UTF-8'}]" data-field="{$field['id_custom_field']|escape:'htmlall':'UTF-8'}" data-type="{$field.field_type|escape:'htmlall':'UTF-8'}">
<option value="No" {if !empty($value_reg_fields) AND $value_reg_fields}{foreach from=$value_reg_fields item=field_edit}{if !empty($field_edit) AND $field_edit AND $field_edit['id_custom_field'] == $field['id_custom_field'] AND !empty($field_edit['value']) AND $field_edit['value'] == 'No'}selected="selected" {/if}{/foreach}{/if}>{l s='No' mod='customfields'}</option>
<option value="Yes" {if !empty($value_reg_fields) AND $value_reg_fields}{foreach from=$value_reg_fields item=field_edit}{if !empty($field_edit) AND $field_edit AND $field_edit['id_custom_field'] == $field['id_custom_field'] AND !empty($field_edit['value']) AND $field_edit['value'] == 'Yes'}selected="selected" {/if}{/foreach}{/if}>{l s='Yes' mod='customfields'}</option>
</select>
{/if}
{elseif $field.field_type eq 'select'}
{assign var='summary_fields_values' value=$model->getCustomFieldsValues($field['id_custom_field'])}
{if $field.editable == 0}
{if isset($field_value) AND $field_value}
{$field_value = FieldsModel::getFieldsValueById($field_value)}bbbb
<span class="form-control">{$field_value|escape:'htmlall':'UTF-8'}</span>
{else}
<select class="select form-control {if $field['value_required']}is_required {/if}" data-type="{$field.field_type|escape:'htmlall':'UTF-8'}" name="fields[{$field['id_custom_field']|escape:'htmlall':'UTF-8'}]" data-field="{$field['id_custom_field']|escape:'htmlall':'UTF-8'}">
<option value="">{l s='Select Option' mod='customfields'}</option>
{foreach from=$summary_fields_values item=summary_fields_value}
<option value="{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}">{$summary_fields_value['field_value']|escape:'htmlall':'UTF-8'}
</option>
{/foreach}
</select>
{/if}
{else}
<select class="select form-control {if $field['value_required']}is_required {/if}" name="fields[{$field['id_custom_field']|escape:'htmlall':'UTF-8'}]" data-type="{$field.field_type|escape:'htmlall':'UTF-8'}" data-field="{$field['id_custom_field']|escape:'htmlall':'UTF-8'}">
<option value="">{l s='Select Option' mod='customfields'}</option>
{foreach from=$summary_fields_values item=summary_fields_value}
<option value="{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}" {if isset($field_value) AND $summary_fields_value.field_value_id == $field_value}selected="selected" {/if}>{$summary_fields_value['field_value']|escape:'htmlall':'UTF-8'}
</option>
{/foreach}
</select>
{/if}
{elseif $field.field_type eq 'radio'}
<input class="checkboxes" type="hidden" data-required="{$field['value_required']}" value="{if $field['dependant'] > 0}1{else}{$field_value|intval|escape:'htmlall':'UTF-8'}{/if}" {if $field['dependant'] > 0} data-depend="1" {else} data-depend="0" {/if}>
{assign var='summary_fields_values' value=$model->getCustomFieldsValues($field['id_custom_field'])}
{if $field.editable == 0}
{if isset($field_value) AND $field_value}
{$field_value = FieldsModel::getFieldsValueById($field_value)}
<span class="form-control">{$field_value|escape:'htmlall':'UTF-8'}</span>
{else}
{foreach from=$summary_fields_values item=summary_fields_value}
<div class="type_multiboxes" id="radio-{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}">
<input type="radio" id="radio_{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}" class="{if $field['value_required']}is_required {/if}" data-type="{$field.field_type|escape:'htmlall':'UTF-8'}" data-field="{$field['id_custom_field']|escape:'htmlall':'UTF-8'}" name="fields[{$field['id_custom_field']|escape:'htmlall':'UTF-8'}][]" value="{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}" />
</div>
<label class="type_multiboxes top" for="radio_{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}">
<span><span></span></span>{$summary_fields_value['field_value']|escape:'htmlall':'UTF-8'}
</label>
<div class="clearfix"></div>
{/foreach}
{/if}
{else}
<!-- <div class="clearfix"> -->
{foreach from=$summary_fields_values item=summary_fields_value}
<!-- <div class="radio-inline"> -->
<div class="type_multiboxes" id="radio-{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}">
<input type="radio" id="radio_{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}" class="{if $field['value_required']}is_required {/if}" data-type="{$field.field_type|escape:'htmlall':'UTF-8'}" data-field="{$field['id_custom_field']|escape:'htmlall':'UTF-8'}" name="fields[{$field['id_custom_field']|escape:'htmlall':'UTF-8'}][]" value="{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}" {if isset($field_value) AND $summary_fields_value.field_value_id == $field_value}checked="checked" {/if} />
<label class="type_multiboxes top" for="radio_{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}">
<span><span></span></span>{$summary_fields_value['field_value']|escape:'htmlall':'UTF-8'}
</label>
</div>
<div class="clearfix"></div>
<!-- </div> -->
{/foreach}
<!-- </div> -->
{/if}
{elseif $field.field_type eq 'checkbox'}
{if isset($field_value) AND $field_value}
{assign var='options' value=explode(',', $field_value)}
{else}
{assign var='options' value=[]}
{/if}
<input class="checkboxes" type="hidden" data-required="{$field['value_required']}" data-type="{$field.field_type|escape:'htmlall':'UTF-8'}" value="{if $field['dependant'] > 0}1{else}{count($options)}{/if}" {if $field['dependant'] > 0} data-depend="1" {else} data-depend="0" {/if}>
{assign var='summary_fields_values' value=$model->getCustomFieldsValues($field['id_custom_field'])}
{if $field.editable == 0}
{if isset($field_value) AND $field_value}
{assign var='opts' value=[]}
{if isset($options) AND is_array($options)}
{foreach from=$options item=id_value}
{$opts[] = FieldsModel::getFieldsValueById($id_value)}
{/foreach}
{/if}
{if isset($opts) AND $opts AND is_array($opts)}
{$field_value = implode(',', $opts)}
{/if}
<span class="form-control">{$field_value|escape:'htmlall':'UTF-8'}</span>
{else}
{foreach from=$summary_fields_values item=summary_fields_value}
<!-- <div class="checkbox"> -->
<div class="type_multiboxes" id="checkbox-{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}">
<input type="checkbox" data-field="{$field['id_custom_field']|escape:'htmlall':'UTF-8'}" data-type="{$field.field_type|escape:'htmlall':'UTF-8'}" value="{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}" name="fields[{$field['id_custom_field']|escape:'htmlall':'UTF-8'}][]" id="checkbox_{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}" class="{if $field['value_required']}is_required{/if}" />
<label class="type_multiboxes" for="checkbox_{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}">
<span></span>{$summary_fields_value['field_value']|escape:'htmlall':'UTF-8'}
</label>
</div>
<div class="clearfix"></div>
<!-- </div> -->
{/foreach}
{/if}
{else}
{foreach from=$summary_fields_values item=summary_fields_value}
<!-- <div class="checkbox"> -->
<div class="type_multiboxes" id="checkbox-{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}">
<input type="checkbox" data-field="{$field['id_custom_field']|escape:'htmlall':'UTF-8'}" data-type="{$field.field_type|escape:'htmlall':'UTF-8'}" value="{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}" name="fields[{$field['id_custom_field']|escape:'htmlall':'UTF-8'}][]" id="checkbox_{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}" class="{if $field['value_required']}is_required{/if} form-control" {if isset($options) AND is_array($options) AND in_array($summary_fields_value.field_value_id, $options)}checked="checked" {/if} />
<label class="type_multiboxes" for="checkbox_{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}">
<span></span>{$summary_fields_value['field_value']|escape:'htmlall':'UTF-8'}
</label>
</div>
<div class="clearfix"></div>
<!-- </div> -->
{/foreach}
{/if}
{elseif $field.field_type eq 'multiselect'}
{if isset($field_value) AND $field_value}
{assign var='options' value=explode(',', $field_value)}
{else}
{assign var='options' value=[]}
{/if}
<input class="checkboxes" type="hidden" data-required="{$field['value_required']}" value="{count($options)}">
{assign var='summary_fields_values' value=$model->getCustomFieldsValues($field['id_custom_field'])}
{if $field.editable == 0}
{if isset($field_value) AND $field_value}
{assign var='opts' value=[]}
{if isset($options) AND is_array($options)}
{foreach from=$options item=id_value}
{$opts[] = FieldsModel::getFieldsValueById($id_value)}
{/foreach}
{/if}
{if isset($opts) AND $opts AND is_array($opts)}
{$field_value = implode(',', $opts)}
{/if}
<span class="form-control">{$field_value|escape:'htmlall':'UTF-8'}</span>
{else}
<select name="fields[{$field['id_custom_field']|escape:'htmlall':'UTF-8'}][]" multiple="multiple" data-type="{$field.field_type|escape:'htmlall':'UTF-8'}" class="type_multiboxes multiselect form-control {if $field['value_required']}is_required {/if}">
{foreach from=$summary_fields_values item=summary_fields_value}
<option value="{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}">{$summary_fields_value['field_value']|escape:'htmlall':'UTF-8'}
</option>
{/foreach}
</select>
<p><small>{l s='Hold CTRL/Command key to select multiple values.' mod='customfields'}</small></p>
{/if}
{else}
<select name="fields[{$field['id_custom_field']|escape:'htmlall':'UTF-8'}][]" multiple="multiple" class="type_multiboxes multiselect form-control {if $field['value_required']}is_required {/if}">
{foreach from=$summary_fields_values item=summary_fields_value}
<option value="{$summary_fields_value['field_value_id']|escape:'htmlall':'UTF-8'}" {if isset($options) AND is_array($options) AND in_array($summary_fields_value.field_value_id, $options)}selected="selected" {/if}>{$summary_fields_value['field_value']|escape:'htmlall':'UTF-8'}
</option>
{/foreach}
</select>
<p><small>{l s='Hold CTRL/Command key to select multiple values.' mod='customfields'}</small></p>
{/if}
{elseif $field.field_type eq 'attachment'}
<div id="field_attachment_{$field['id_custom_field']|escape:'htmlall':'UTF-8'}">
{assign var='root_dir' value=($smarty.const._PS_ROOT_DIR_|cat:'/')}
{if $field.editable == 0}
<!-- {*assign var='field_value' value=''*} -->
{if isset($field_value) AND $field_value}
<p><a class="btn btn-primary button" href="{$action_controller|escape:'htmlall':'UTF-8'}&downloadFile&l={base64_encode({$field_value|escape:'htmlall':'UTF-8'})}">{l s='Download' mod='customfields'} {pathinfo($field_value|replace:$root_dir:''|escape:'htmlall':'UTF-8', $smarty.const.PATHINFO_FILENAME)}</a></p>
{else}
<input type="file" name="fields[{$field.id_custom_field|escape:'htmlall':'UTF-8'}]" data-type="{$field.field_type|escape:'htmlall':'UTF-8'}" class="form-control attachment {if $field['value_required']}is_required {/if}{if isset($field['field_validation']) AND $field['field_validation'] }validate_field{/if}" {if isset($field['field_validation']) AND $field['field_validation']} data-validate="{$field['field_validation']|escape:'htmlall':'UTF-8'}" {/if} {if isset($field.extensions) AND $field.extensions} data-extensions="{$field.extensions|escape:'htmlall':'UTF-8'}" {/if}>
{if isset($field.extensions) AND $field.extensions} <p><small>{l s='Allowed file types' mod='customfields'}: {$field.extensions|escape:'htmlall':'UTF-8'}</small></p>{/if}
<p class="alert alert-danger error extension_error">{l s='Image type not allowed.' mod='customfields'}</p>
{/if}
{else}
{if !empty($field_value) AND $field_value}
<p><a class="btn btn-primary button" href="{$action_controller|escape:'htmlall':'UTF-8'}&downloadFile&l={base64_encode({$field_value|escape:'htmlall':'UTF-8'})}">{l s='Download' mod='customfields'} {pathinfo($field_value|replace:$root_dir:''|escape:'htmlall':'UTF-8', $smarty.const.PATHINFO_FILENAME)}</a></p>
{/if}
<input type="file" name="fields[{$field.id_custom_field|escape:'htmlall':'UTF-8'}]" value="" class="form-control attachment {if $field['value_required']}is_required {/if}{if isset($field['field_validation']) AND $field['field_validation'] }validate_field{/if}" {if isset($field['field_validation']) AND $field['field_validation']} data-validate="{$field['field_validation']|escape:'htmlall':'UTF-8'}" {/if} {if isset($field.extensions) AND $field.extensions} data-extensions="{$field.extensions|escape:'htmlall':'UTF-8'}" {/if}>
{if isset($field.extensions) AND $field.extensions} <p><small>{l s='Allowed file types' mod='customfields'}: {$field.extensions|escape:'htmlall':'UTF-8'}</small></p>{/if}
<p class="alert alert-danger error extension_error">{l s='Image type not allowed.' mod='customfields'}</p>
{/if}
</div>
{elseif $field.field_type eq 'message'}
<b>{$field['default_value']|escape:'htmlall':'UTF-8'}</b>
{/if}
</div>
<div class="clearfix"></div>
</div>
{/foreach}
<input type="hidden" name="type" value="{$type|escape:'htmlall':'UTF-8'}" />
</form>
</div>
{if $customer.is_logged == 1}
{literal}
<script src="https://code.jquery.com/jquery-3.6.0.slim.min.js" integrity="sha256-u7e5khyithlIdTpu22PHhENmPcRdFiHRjhAuHcs05RI=" crossorigin="anonymous"></script>
<script type='text/javascript'>
$(function() {
$.ajax({
type: 'POST',
cache: false,
url: '/ajax.php',
data: {
a: 'load-customer-b2b-data',
customer_id: {/literal}{$customer.id}{literal}
},
beforeSend: function() {},
success: function(response) {
data = jQuery.parseJSON(response);
if (data.fvat == 'Yes') {
$( '#customfieldsblock_payment select[name="fields[1]"]' ).val( "Yes" ).trigger( 'change' );
$('#customfieldsblock_payment input[name="fields[2]"]').val(data.firm);
$('#customfieldsblock_payment input[name="fields[3]"]').val(data.nip);
$('#customfieldsblock_payment input[name="fields[4]"]').val(data.street);
$('#customfieldsblock_payment input[name="fields[5]"]').val(data.city);
$('#customfieldsblock_payment input[name="fields[6]"]').val(data.postal_code);
}
}
});
});
</script>
{/literal}
{/if}
{/if}

View File

@@ -0,0 +1,36 @@
<?php
/*
* 2007-2014 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2014 PrestaShop SA
* @version Release: $Revision$
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;