This commit is contained in:
gRoussac
2013-12-10 16:18:44 +01:00
11 changed files with 1199 additions and 1449 deletions
@@ -48,193 +48,193 @@
var fileName = data.getAttribute("filename");
if (result == "error")
{
$("#upload-confirmation").hide();
$("#upload-error td").html('<div class="error">{l s='Error:'} ' + msg + '</div>');
$("#upload-error").show();
$("#upload-confirmation").closest('.form-group.').hide();
$("#upload-error").html('{l s='Error:'} ' + msg);
$("#upload-error").closest('.form-group.').show();
}
else
{
$('#upload-error').hide();
$('#file_missing').hide();
$('#upload-error').closest('.form-group.').hide();
$('#file_missing').closest('.form-group.').hide();
$('#virtual_product_name').attr('value', fileName);
$("#upload-confirmation .error").remove();
$('#upload-confirmation div').find('span').remove();
$('#upload-confirmation div').prepend('<span>{l s='The file'}&nbsp;"<a class="link" href="get-file-admin.php?file='+msg+'&filename='+fileName+'">'+fileName+'</a>"&nbsp;{l s='has successfully been uploaded'}' +
$('#upload-confirmation').find('span').remove();
$('#upload-confirmation').prepend('<span>{l s='The file'}&nbsp;"<a class="link" href="get-file-admin.php?file='+msg+'&filename='+fileName+'">'+fileName+'</a>"&nbsp;{l s='has successfully been uploaded'}&nbsp;' +
'<input type="hidden" id="virtual_product_filename" name="virtual_product_filename" value="' + msg + '" /></span>');
$("#upload-confirmation").show();
$("#upload-confirmation").closest('.form-group.').show();
}
}
}
);
}
function uploadFile2()
{
var link = '';
$.ajaxFileUpload (
$(document).ready(function(){
$('#virtual_product_file-selectbutton').click(function(e) {
$('#virtual_product_file').trigger('click');
});
$('#virtual_product_file-name').click(function(e) {
$('#virtual_product_file').trigger('click');
});
$('#virtual_product_file').change(function(e) {
if ($(this)[0].files !== undefined)
{
url:'./uploadProductFileAttribute.php',
secureuri:false,
fileElementId:'virtual_product_file_attribute',
dataType: 'xml',
success: function (data, status)
{
data = data.getElementsByTagName('return')[0];
var result = data.getAttribute("result");
var msg = data.getAttribute("msg");
var fileName = data.getAttribute("filename");
if(result == "error")
$("#upload-confirmation2").html('<p>error: ' + msg + '</p>');
else
{
$('#virtual_product_file_attribute').remove();
$('#virtual_product_file_label').hide();
$('#file_missing').hide();
$('#delete_downloadable_product_attribute').show();
$('#upload-confirmation2').html(
'<a class="link" href="get-file-admin.php?file='+msg+'&filename='+fileName+'">{l s='The file'}&nbsp;"' + fileName + '"&nbsp;{l s='has successfully been uploaded'}</a>' +
'<input type="hidden" id="virtual_product_filename_attribute" name="virtual_product_filename_attribute" value="' + msg + '" />');
$('#virtual_product_name_attribute').attr('value', fileName);
var files = $(this)[0].files;
var name = '';
link = $("#delete_downloadable_product_attribute").attr('href');
$("#delete_downloadable_product_attribute").attr('href', link+"&file="+msg);
}
}
$.each(files, function(index, value) {
name += value.name+', ';
});
$('#virtual_product_file-name').val(name.slice(0, -2));
}
);
}
else // Internet Explorer 9 Compatibility
{
var name = $(this).val().split(/[\\/]/);
$('#virtual_product_file-name').val(name[name.length-1]);
}
uploadFile();
});
});
</script>
<input type="hidden" name="submitted_tabs[]" value="VirtualProduct" />
<h4>{l s='Virtual Product (services, booking or downloadable products)'}</h4>
<div class="separation"></div>
<div>
<div class="is_virtual_good">
<input type="checkbox" id="is_virtual_good" name="is_virtual_good" value="true" {if $product->is_virtual && $product->productDownload->active}checked="checked"{/if} />
<label for="is_virtual_good" class="t bold">{l s='Is this a virtual product?'}</label>
</div>
{* [begin] virtual product *}
<div id="virtual_good" {if !$product->productDownload->id || $product->productDownload->active}style="display:none"{/if} >
<div>
<label>{l s='Does this product have an associated file?'}</label>
<label style="width:50px"><input type="radio" value="1" name="is_virtual_file" {if $product_downloaded}checked="checked"{/if} />{l s='Yes'}</label>
<label style="width:50px;"><input type="radio" value="0" name="is_virtual_file" {if !$product_downloaded}checked="checked"{/if} />{l s='No'}</label>
</div><br />
<div class="separation"></div>
{if $download_product_file_missing}
<p class="alert" id="file_missing">
<b>{$download_product_file_missing} :<br/>
{$smarty.const._PS_DOWNLOAD_DIR_}/{$product->productDownload->filename}</b>
</p>
{/if}
<div id="is_virtual_file_product" style="display:none;">
{if !$download_dir_writable}
<p class="alert">
{l s='Your download repository is not writable.'}<br/>
{$smarty.const._PS_DOWNLOAD_DIR_}
</p>
{/if}
{* Don't display file form if the product has combinations *}
{if empty($product->cache_default_attribute)}
{if $product->productDownload->id}
<input type="hidden" id="virtual_product_id" name="virtual_product_id" value="{$product->productDownload->id}" />
<div id="product-virtualproduct" class="panel product-tab">
<input type="hidden" name="submitted_tabs[]" value="VirtualProduct" />
<h3>{l s='Virtual Product (services, booking or downloadable products)'}</h3>
<div class="is_virtual_good" class="form-group">
<input type="checkbox" id="is_virtual_good" name="is_virtual_good" value="true" {if $product->is_virtual && $product->productDownload->active}checked="checked"{/if} />
<label for="is_virtual_good" class="t bold">{l s='Is this a virtual product?'}</label>
</div>
<div id="virtual_good" {if !$product->productDownload->id || $product->productDownload->active}style="display:none"{/if} class="form-group">
<div class="form-group">
<label class="control-label col-lg-3">{l s='Does this product have an associated file?'}</label>
<div class="col-lg-9">
<label class="switch-light prestashop-switch fixed-width-lg">
<input name="is_virtual_file" id="is_virtual_file" type="checkbox"{if $product_downloaded} checked="checked"{/if} value="{if $product_downloaded}1{else}0{/if}" />
<span>
<span>{l s='Yes'}</span>
<span>{l s='No'}</span>
</span>
<a class="slide-button btn btn-default"></a>
</label>
</div>
</div>
<div id="is_virtual_file_product" style="display:none;">
{if $download_product_file_missing}
<div class="form-group">
<div class="col-lg-push-3 col-lg-9">
<div class="alert alert-danger" id="file_missing">
{$download_product_file_missing} :<br/>
<strong>{l s='Server file name : %s'|sprintf:$product->productDownload->filename}</strong>
</div>
</div>
</div>
{/if}
<table cellpadding="5" style="float: left; margin-left: 10px;">
<tr id="upload_input" {if $is_file}style="display:none"{/if}>
<td class="col-left">
<label id="virtual_product_file_label" for="virtual_product_file" class="t">{l s='Upload a file'}</label>
</td>
<td class="col-right">
<input type="file" id="virtual_product_file" name="virtual_product_file" onchange="uploadFile();" maxlength="{$upload_max_filesize}" />
<p class="preference_description">{l s='Your server\'s maximum file-upload size is'}:&nbsp;{$upload_max_filesize} {l s='MB'}</p>
</td>
</tr>
<tr id="upload-error" style="display:none">
<td colspan=2></td>
</tr>
<tr id="upload-confirmation" style="display:none">
<td colspan=2>
{if $up_filename}
<input type="hidden" id="virtual_product_filename" name="virtual_product_filename" value="{$up_filename}" />
{/if}
<div class="alert">
<script>
delete_this_file = '{l s='Delete this file'}';
</script>
<a class="delete_virtual_product" id="delete_downloadable_product" href="{$currentIndex}&deleteVirtualProduct=true&token={$token}&id_product={$product->id}" class="red">
<img src="../img/admin/delete.gif" alt="{l s='Delete this file'}"/>
{if !$download_dir_writable}
<div class="form-group">
<div class="col-lg-push-3 col-lg-9">
<div class="alert alert-danger">
{l s='Your download repository is not writable.'}
</div>
</div>
</div>
{/if}
{* Don't display file form if the product has combinations *}
{if empty($product->cache_default_attribute)}
{if $product->productDownload->id}
<input type="hidden" id="virtual_product_id" name="virtual_product_id" value="{$product->productDownload->id}" />
{/if}
<div class="form-group"{if $is_file} style="display:none"{/if}>
<label id="virtual_product_file_label" for="virtual_product_file" class="control-label col-lg-3">{l s='Upload a file'}</label>
<div class="col-lg-9">
<input id="virtual_product_file" type="file" name="virtual_product_file" class="hide" maxlength="{$upload_max_filesize}" />
<div class="dummyfile input-group">
<span class="input-group-addon"><i class="icon-file"></i></span>
<input id="virtual_product_file-name" type="text" class="disabled" name="filename" readonly />
<span class="input-group-btn">
<button id="virtual_product_file-selectbutton" type="button" name="submitAddAttachments" class="btn btn-default">
<i class="icon-folder-open"></i> {l s='Add file'}
</button>
</span>
</div>
<p class="help-block">{l s='Your server\'s maximum file-upload size is'}:&nbsp;{$upload_max_filesize} {l s='MB'}</p>
</div>
</div>
<div class="form-group" style="display:none">
<div class="col-lg-push-3 col-lg-9">
<div class="alert alert-error col-lg-push-3 col-lg-9" id="upload-error"></div>
</div>
</div>
<div class="form-group" style="display:none">
<div class="col-lg-push-3 col-lg-9">
{if $up_filename}
<input type="hidden" id="virtual_product_filename" name="virtual_product_filename" value="{$up_filename}" />
{/if}
<div class="alert alert-info" id="upload-confirmation">
<a class="btn btn-default" id="delete_downloadable_product" href="{$currentIndex}&deleteVirtualProduct=true&token={$token}&id_product={$product->id}"><i class="icon-trash"></i> {l s='Delete this file'}
</a>
</div>
</td>
</tr>
</div>
</div>
{if $is_file}
<tr>
<td class="col-left">
<input type="hidden" id="virtual_product_filename" name="virtual_product_filename" value="{$product->productDownload->filename}" />
<label class="t">{l s='Link to the file:'}</label>
</td>
<td class="col-right">
{$product->productDownload->getHtmlLink(false, true)}
<a href="{$currentIndex}&deleteVirtualProduct=true&token={$token}&id_product={$product->id}" class="red delete_virtual_product">
<img src="../img/admin/delete.gif" alt="{l s='Delete this file'}"/>
</a>
</td>
</tr>
<div class="form-group">
<label class="control-label col-lg-3">{l s='Link to the file:'}</label>
<div class="col-lg-9">
<input type="hidden" id="virtual_product_filename" name="virtual_product_filename" value="{$product->productDownload->filename}" />
<a href="{$product->productDownload->getTextLink(true)}" class="btn btn-default"><i class="icon-download"></i> {l s='Download file'}</a>
<a href="{$currentIndex}&deleteVirtualProduct=true&token={$token}&id_product={$product->id}" class="btn btn-default"><i class="icon-trash"></i> {l s='Delete this file'}</a>
</div>
</div>
{/if}
<tr>
<td class="col-left">
<label for="virtual_product_name" class="t">{l s='Filename'}</label>
</td>
<td class="col-right">
<div class="form-group">
<label class="control-label col-lg-3">{l s='Filename'}</label>
<div class="col-lg-9">
<input type="text" id="virtual_product_name" name="virtual_product_name" style="width:200px" value="{$product->productDownload->display_filename|escape:'html':'UTF-8'}" />
<p class="preference_description" name="help_box">{l s='The full filename with its extension (e.g. Book.pdf)'}</p>
</td>
</tr>
<tr>
<td class="col-left">
<label for="virtual_product_nb_downloable" class="t">{l s='Number of allowed downloads'}</label>
</td>
<td class="col-right">
<p class="help-block">{l s='The full filename with its extension (e.g. Book.pdf)'}</p>
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-3">{l s='Number of allowed downloads'}</label>
<div class="col-lg-9">
<input type="text" id="virtual_product_nb_downloable" name="virtual_product_nb_downloable" value="{$product->productDownload->nb_downloadable|htmlentities}" class="" size="6" />
<p class="preference_description">{l s='Number of downloads allowed per customer. (Set to 0 for unlimited downloads)'}</p>
</td>
</tr>
<tr>
<td class="col-left">
<label for="virtual_product_expiration_date" class="t">{l s='Expiration date'}</label>
</td>
<td class="col-right">
<input class="datepicker" type="text" id="virtual_product_expiration_date" name="virtual_product_expiration_date" value="{$product->productDownload->date_expiration}" size="11" maxlength="10" autocomplete="off" /> {l s='Format: YYYY-MM-DD'}
<p class="preference_description">{l s='If set, the file will not be downloadable after this date. Leave blank if you do not wish to attach an expiration date.'}</p>
</td>
</tr>
<td class="col-left">
<label for="virtual_product_nb_days" class="t">{l s='Number of days'}</label>
</td>
<td class="col-right">
<input type="text" id="virtual_product_nb_days" name="virtual_product_nb_days" value="{$product->productDownload->nb_days_accessible|htmlentities}" class="" size="4" /><sup> *</sup>
<p class="preference_description">{l s='Number of days this file can be accessed by customers'} - <em>({l s='Set to zero for unlimited access.'})</em></p>
</td>
</tr>
<p class="help-block">{l s='Number of downloads allowed per customer. (Set to 0 for unlimited downloads)'}</p>
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-3">
<span class="label-tooltip" data-toggle="tooltip" title="" data-original-title="{l s='Format: YYYY-MM-DD'}">
{l s='Expiration date'}
</span>
</label>
<div class="col-lg-9">
<input class="datepicker" type="text" id="virtual_product_expiration_date" name="virtual_product_expiration_date" value="{$product->productDownload->date_expiration}" size="11" maxlength="10" autocomplete="off" />
<p class="help-block">{l s='If set, the file will not be downloadable after this date. Leave blank if you do not wish to attach an expiration date.'}</p>
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-3 required">{l s='Number of days'}</label>
<div class="col-lg-9">
<input type="text" id="virtual_product_nb_days" name="virtual_product_nb_days" value="{$product->productDownload->nb_days_accessible|htmlentities}" class="" size="4" />
<p class="help-block">{l s='Number of days this file can be accessed by customers'} - <em>({l s='Set to zero for unlimited access.'})</em></p>
</div>
</div>
{* Feature not implemented *}
{*<tr>*}
{*<td class="col-left">*}
{*<label for="virtual_product_is_shareable" class="t">{l s='is shareable'}</label>*}
{*</td>*}
{*<td class="col-right">*}
{*<div class="form-group">*}
{*<label for="virtual_product_is_shareable" class="control-label col-lg-3">{l s='is shareable'}</label>*}
{*<div class="col-lg-9">*}
{*<input type="checkbox" id="virtual_product_is_shareable" name="virtual_product_is_shareable" value="1" {if $product->productDownload->is_shareable}checked="checked"{/if} />*}
{*<span class="alert alert-info" name="help_box" style="display:none">{l s='Please specify if the file can be shared.'}</span>*}
{*</td>*}
{*</tr>*}
{else}
<div class="alert alert-info" style="display: block;width: 70%;">{l s='You cannot edit your file here because you used combinations. Please edit this file in the Combinations tab.'}</div>
<br />
{*</div>*}
{*</div>*}
<div class="alert alert-info">
{l s='You cannot edit your file here because you used combinations. Please edit this file in the Combinations tab.'}
</div>
{if isset($error_product_download)}{$error_product_download}{/if}
{/if}
</table>
</div>
</div>
</div>
<div style="clear:both"></div>
</div>
+1 -14
View File
@@ -1332,33 +1332,20 @@ product_tabs['VirtualProduct'] = new function(){
if ($('#is_virtual_good').prop('checked'))
{
$('#virtual_good').show();
$('#virtual_good_more').show();
}
$('.is_virtual_good').hide();
if ( $('input[name=is_virtual_file]:checked').val() == 1)
{
$('#virtual_good_more').show();
$('#is_virtual_file_product').show();
}
else
{
$('#virtual_good_more').hide();
$('#is_virtual_file_product').hide();
}
$('input[name=is_virtual_file]').live('change', function(e) {
if($(this).val() == '1')
{
$('#virtual_good_more').show();
if($(this).prop('checked'))
$('#is_virtual_file_product').show();
}
else
{
$('#virtual_good_more').hide();
$('#is_virtual_file_product').hide();
}
});
// Bind file deletion
+8 -1
View File
@@ -39,7 +39,7 @@ class BlockCms extends Module
{
$this->name = 'blockcms';
$this->tab = 'front_office_features';
$this->version = '1.3';
$this->version = '1.4';
$this->author = 'PrestaShop';
$this->need_instance = 0;
@@ -61,6 +61,7 @@ class BlockCms extends Module
|| !$this->registerHook('actionObjectCmsUpdateAfter')
|| !$this->registerHook('actionObjectCmsDeleteAfter')
|| !$this->registerHook('actionShopDataDuplication')
|| !$this->registerHook('actionAdminStoresControllerUpdate_optionsAfter')
|| !BlockCMSModel::createTables()
|| !Configuration::updateValue('FOOTER_CMS', '')
|| !Configuration::updateValue('FOOTER_BLOCK_ACTIVATION', 1)
@@ -684,6 +685,12 @@ class BlockCms extends Module
return parent::getCacheId('blockcms|'.$name);
}
public function hookActionAdminStoresControllerUpdate_optionsAfter()
{
if (Tools::getIsset('PS_STORES_DISPLAY_FOOTER'))
$this->_clearCache('blockcms.tpl');
}
public function hookActionObjectCmsUpdateAfter()
{
$this->_clearCache('blockcms.tpl');
+1 -1
View File
@@ -2,7 +2,7 @@
<module>
<name>blockcms</name>
<displayName><![CDATA[CMS Block]]></displayName>
<version><![CDATA[1.3]]></version>
<version><![CDATA[1.4]]></version>
<description><![CDATA[Adds a block with several CMS links.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[front_office_features]]></tab>
+9
View File
@@ -0,0 +1,9 @@
<?php
if (!defined('_PS_VERSION_'))
exit;
function upgrade_module_1_4($object)
{
return ($object->registerHook('actionAdminStoresControllerUpdate_optionsAfter'));
}
@@ -3,7 +3,6 @@
<legend><img src="{$uri}/img/cogs.gif" alt="{l s='Configuration' mod='blocklayered'}" /> {l s='New filters template' mod='blocklayered'}</legend>
<form action="{$current_url}" method="post" class="form-horizontal" onsubmit="return checkForm();">
<input type="hidden" name="id_layered_filter" id="id_layered_filter" value="{$id_layered_filter}" />
<input type="hidden" name="n_existing" id="n_existing" value="{$filters_templates|count}" />
<table class="table-configurations">
<tbody>
<tr>
@@ -3,7 +3,6 @@
<h3><i class="icon-cogs"></i> {l s='New filters template' mod='blocklayered'}</h3>
<form action="{$current_url}" method="post" class="form-horizontal" onsubmit="return checkForm();">
<input type="hidden" name="id_layered_filter" id="id_layered_filter" value="{$id_layered_filter}" />
<input type="hidden" name="n_existing" id="n_existing" value="{$filters_templates|count}" />
<div class="form-group">
<label class="control-label col-lg-3">{l s='Template name:' mod='blocklayered'}</label>
<div class="col-lg-9">
+10 -8
View File
@@ -206,14 +206,16 @@
{/if}
{/if}
</div>
<!-- <div class="functional-buttons clearfix">
{hook h='displayProductListFunctionalButtons' product=$product}
{if isset($comparator_max_item) && $comparator_max_item}
<div class="compare">
<a class="addToCompare" href="#" data-id-product="{$product.id_product}" onClick="addToCompare('{$product.id_product|intval}'); return false;">{l s='Add to Compare'}</a>
</div>
{/if}
</div> -->
{if $page_name != 'index'}
<div class="functional-buttons clearfix">
{hook h='displayProductListFunctionalButtons' product=$product}
{if isset($comparator_max_item) && $comparator_max_item}
<div class="compare">
<a class="addToCompare" href="#" data-id-product="{$product.id_product}" onClick="addToCompare('{$product.id_product|intval}'); return false;">{l s='Add to Compare'}</a>
</div>
{/if}
</div>
{/if}
</div><!-- .product-container> -->
</li>
{/foreach}
@@ -2,14 +2,12 @@
@import 'bootstrap_lib/_variables';
//------- FONTS
$font-famaly: Arial, Helvetica, sans-serif;
$font: normal 13px/18px $font-famaly;
$font-custom: 'Open Sans', sans-serif;
$font-icon: "FontAwesome";
//-------- BORDERS
$base-border-color: #d6d4d4;
$main_border: 1px solid $base-border-color;
$dark-border-color: #333;
@@ -17,8 +15,6 @@ $light-border-color: #fff;
$homepage-footer-border: #d9d9d9;
//--------- BACKGROUNDS
// -------------------------
$base-box-bg: #fbfbfb;
$table-background: $base-box-bg;
$dark-background: #333;
@@ -26,7 +22,6 @@ $light-background: #fff;
$homepage-footer-bg: #f2f2f2;
//--------- COLORS
$base-body-color: #777;
$base-text-color: #333;
$base-heading-color: #555454;
@@ -38,15 +33,11 @@ $description-color: #666;
//--------- Indents
//--------------------------
$base-page-indent: $grid-gutter-width;
$base-box-padding: 14px 18px 13px;
$base-box-indent: 0 0 30px 0;
//---------- Product Elements
//---------------------------
$product-name-color: #3a3939;
$product-name-hover-color: #515151;
$price-color: $base-body-color;
@@ -56,47 +47,35 @@ $product-special-price-color: #f13340;
$product-old-price-color: #6f6f6f;
//---------- Buttons
//----------------------------
$button-text-color: $light-text-color;
//------ Buttons +/- ---
$button-pm-color: #c0c0c0;
$button-pm-hover-color: $base-text-color;
//------ Button Small --
$button-small-bg: #6f6f6f;
$button-small-hover-bg: #575757;
//-------Button exclusive-medium
$button-em-color: $base-text-color;
//---------- Product Listing
//--------------------------
$base-listing-border-color: $base-border-color;
$base-listing-grid-padding: $base-box-padding;
//-------------- Grid/List vars
//---------------------------
$GL-text-color: #808080;
$GL-title-color: $base-text-color;
$GL-icon-color: #e1e0e0;
$GL-icon-color-hover: $base-text-color;
//-------------- Pagination vars
//------------------------------
$pagination-prevnext-color: #777676;
$pagination-bgcolor: $base-box-bg;
$pagination-hover-bg: #f6f6f6;
//---------- Product Info
//--------------------------
$top-line-color: #C4C4C4;
$product-image-border: #dbdbdb;
$scroll-button-color: #c0c0c0;
@@ -105,7 +84,6 @@ $scroll-button-hover-color: $base-text-color;
$tr-even-bg: #fdfdfd;
//sub heading (h2,h3) define
@mixin sub-heading {
color: $base-heading-color;
text-transform: uppercase;
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -62,7 +62,7 @@
<div class="content_sortPagiBar">
<div class="bottom-pagination-content clearfix">
{include file="./product-compare.tpl"}
{if !isset($instant_search) || (isset($instant_search) && !$instant_search)}{include file="$tpl_dir./pagination.tpl"}{/if}
{if !isset($instant_search) || (isset($instant_search) && !$instant_search)}{include file="$tpl_dir./pagination.tpl" paginationId='bottom'}{/if}
</div>
</div>
{/if}