Files
interblue.pl/modules/pshowimporter/views/templates/admin/config_index.tpl
2024-10-25 14:16:28 +02:00

388 lines
20 KiB
Smarty

{include file='./../parts/import_steps.tpl' step=2}
<p>&nbsp;</p>
{if isset($correct_file) && !$correct_file}
<div class="alert alert-danger">
<p>{l s='Your file is probably incorrect.' mod='pshowimporter'} {l s='Check the file structure.' mod='pshowimporter'}</p>
<p>&nbsp;</p>
<p>{l s='An example of the correct structure of the csv file' mod='pshowimporter'}:</p>
<p><i>id,name,reference,description,price</i></p>
<p><i>1,"Name 1",REF1,"&lt;span style=\"color: red;\"&gt;description&lt;span&gt;",1.00</i></p>
<p><i>2,"Name 2",REF2,"&lt;span style=\"color: green;\"&gt;next description&lt;span&gt;",5.00</i></p>
</div>
{/if}
<div class="clearfix"></div>
<br>
<div class="col-xs-12">
<div class="panel panel-filecontents">
<div class="panel-heading">
<a ng-show="ableToHightlight" ng-click="highlightContents()"
class="pull-right btn btn-default">{l s='Highlight syntax' mod='pshowimporter'}</a>
<a ng-show="fileNotLoaded" ng-click="loadFileContents()"
class="pull-right btn btn-success">{l s='Load file' mod='pshowimporter'}</a>
<span id="fileloadstatus" class="pull-right">[[fileloadstatus]]</span>
({l s='grab to move' mod='pshowimporter'})&nbsp;&nbsp;&nbsp;
{l s='File contents' mod='pshowimporter'}
</div>
<div class="panel-wrapper" style="min-height: 120px; max-height: 500px; height: 90%; overflow: scroll;">
<pre ng-show="filecontents" style="width:3000px; height: 95%;"><code class="xml">[[filecontents]]</code></pre>
</div>
</div>
</div>
<div class="col-xs-12" style="min-height: 500px;">
<div class="alert alert-info dataLoader">
<p>{l s='Loading data' mod='pshowimporter'}... <span class="dots"></span></p>
</div>
<div class="loadedData" style="display: none;">
<form class="defaultForm form-horizontal" id="primaryConfiguration" method="post" action="">
<div class="panel">
{if isset($fromURL) && $fromURL}
<div class="panel-heading clearfix">
{l s='You added this file by URL address, do you want to update this file before importing?' mod='pshowimporter'}
</div>
<div class="panel-wrapper">
<div class="form-group">
<div class="col-md-12">
<label for="updateWithDownload" class="control-label col-md-4"></label>
<div class="col-md-4">
<input name="updateWithDownload" type="checkbox" value="1" id="updateWithDownload">
{l s='Update this file from URL address before every import' mod='pshowimporter'}
</div>
</div>
</div>
</div>
<p>&nbsp;</p>
{/if}
<div class="panel-wrapper">
<div class="form-group">
<label class="control-label col-lg-4">
{l s='Re-encode file with UTF-8' mod='pshowimporter'}
</label>
<div class="col-lg-8">
<span class="switch prestashop-switch fixed-width-lg">
<input type="radio" name="re_encode_utf8" id="re_encode_utf8_on" value="1"
{if $primary_config['re_encode_utf8']}checked='checked'{/if}>
<label for="re_encode_utf8_on">Tak</label>
<input type="radio" name="re_encode_utf8" id="re_encode_utf8_off" value="0"
{if !$primary_config['re_encode_utf8']}checked='checked'{/if}>
<label for="re_encode_utf8_off">Nie</label>
<a class="slide-button btn"></a>
</span>
<p class="help-block">
{l s='With large files it can slow down the transition to step 5.' mod='pshowimporter'}
</p>
<p class="help-block">
{l s='Enable this option if you have problems with XML encoding' mod='pshowimporter'} {l s='(Eg if you see errors in the log such as: %s)' mod='pshowimporter' sprintf='"Error in XML reading: Input is not proper UTF-8, indicate encoding !"'}<br>
<u>{l s='If you have the correct encoding in the file - DO NOT TURN ON THE OPTION!' mod='pshowimporter'}</u>
</p>
</div>
</div>
</div>
{*<p>&nbsp;</p>
<div class="panel-wrapper">
<div class="form-group">
<label class="control-label col-lg-4">
{l s='Number of threads' mod='pshowimporter'}<br>[experimental]
</label>
<div class="col-lg-8">
<input type='number' name='number_of_threads' max='24' min='1'
value='{if isset($primary_config['number_of_threads'])}{$primary_config['number_of_threads']}{else}1{/if}'>
<p class="help-block">
{l s='The higher number of threads increases the speed of import, but it also puts a strain on the server.' mod='pshowimporter'}
</p>
<p class="help-block">
<strong>{l s='Warning!' mod='pshowimporter'}</strong>
{l s='Activate only if the order of imported objects does not matter!' mod='pshowimporter'}
</p>
</div>
</div>
</div>*}
<p>&nbsp;</p>
<div class="panel-heading clearfix">
{l s='Main import options' mod='pshowimporter'}
</div>
<div class="panel-wrapper">
<div class="col-md-12">
<label class="control-label col-md-4 required">
<span title="" data-toggle="tooltip" class="label-tooltip" data-original-title="">
{l s='What to do with object which has got incorrect one or more fields?' mod='pshowimporter'}:
</span>
</label>
<div class="col-md-6">
<p>
<label class="radioCheck">
<input type="radio" name="objectWithError" value="alwaysTry"
{if (isset($primary_config['objectWithError']) && $primary_config['objectWithError'] == 'alwaysTry' || !isset($primary_config['objectWithError']))}checked{/if}>
{l s='Always try to fix and import even if the values contain errors' mod='pshowimporter'} ({l s='default' mod='pshowimporter'})
</label>
</p>
<p>
<label class="radioCheck">
<input type="radio" name="objectWithError" value="skipObject"
{if (isset($primary_config['objectWithError']) && $primary_config['objectWithError'] == 'skipObject')}checked{/if}>
{l s='Skip object' mod='pshowimporter'}
</label>
</p>
<p>
<label class="radioCheck">
<input type="radio" name="objectWithError" value="tryFixAndSkip"
{if isset($primary_config['objectWithError']) && $primary_config['objectWithError'] == 'tryFixAndSkip'}checked{/if}>
{l s='Try to fix incorrect value (e.g. by removing characters from value) and skip object if module cannot fix incorrect value' mod='pshowimporter'}
</label>
</p>
<p>
<label class="radioCheck">
<input type="radio" name="objectWithError" value="tryFixAndSetEmpty"
{if isset($primary_config['objectWithError']) && $primary_config['objectWithError'] == 'tryFixAndSetEmpty'}checked{/if}>
{l s='Try to fix incorrect value (e.g. by removing characters from value), next try to set empty or default value and skip object if module cannot fix incorrect value' mod='pshowimporter'}
</label>
</p>
{*<p>
<label class="radioCheck">
<input type="radio" name="objectWithError" value="forceImport"
{if (isset($primary_config['objectWithError']) && $primary_config['objectWithError'] == 'forceImport')}checked{/if}>
{l s='Force import even if the values contain errors' mod='pshowimporter'}
</label>
</p>*}
</div>
</div>
{if count($languages) > 1}
<p>&nbsp;</p>
<div class="col-md-12">
<label for="lang" class="control-label col-md-4 required">
<span title="" data-toggle="tooltip" class="label-tooltip" data-original-title="">
{l s='Select import language' mod='pshowimporter'}:
</span>
</label>
<div class="col-md-6">
<select name="lang" ng-model="importlang"
ng-init="importlang = '{if isset($primary_config['lang_id'])}{$primary_config['lang_id']}{else}0{/if}'">
<option value="0">{l s='All languages' mod='pshowimporter'}</option>
{foreach from=$languages item='lang'}
<option value="{$lang['id_lang']}">{$lang['name']}</option>
{/foreach}
</select>
</div>
</div>
{else}
<input type="hidden" name="lang" value="0">
{/if}
{if isset($shops) && count($shops) > 1}
<p>&nbsp;</p>
<div class="col-md-12 shopsList">
<label for="shop" class="control-label col-md-4 required">
<span title="" data-toggle="tooltip" class="label-tooltip" data-original-title="">
{l s='Select import shops' mod='pshowimporter'}:
</span>
</label>
<div class="col-md-6">
<ul class="nav nav-tabs" style="margin-left: 10px;">
{assign active "active"}
{foreach from=$shop_groups item='s'}
<li class="{$active}">
<a data-toggle="tab" href="#shop-group-{$s->id}">
{$s->name}
</a>
</li>
{assign active ""}
{/foreach}
</ul>
<div class="tab-content">
{assign active "in active"}
{foreach from=$shop_groups item='s'}
<div id="shop-group-{$s->id}" class="tab-pane fade {$active} panel">
{foreach from=$shops item='shop'}
{if $shop['id_shop_group'] != $s->id}
{continue}
{/if}
<div class="form-group">
<input type="checkbox" name="import_shop_{$shop['id_shop']}" id="import_shop_{$shop['id_shop']}"
value="1" {if !$multistore_addon}disabled="disabled"{/if}
{if !$multistore_addon and $shop == $shops|reset}checked="checked"{/if}>
&nbsp;&nbsp;&nbsp;<label for="import_shop_{$shop['id_shop']}">{$shop['name']}</label>
</div>
{/foreach}
</div>
{assign active ""}
{/foreach}
</div>
{if !$multistore_addon}
<div class="alert alert-info">
<a href="http://prestashow.pl/en//26-.html" target="_blank">
{l s='Buy multistore addon to change shops.' mod='pshowimporter'}
</a>
</div>
{/if}
</div>
</div>
{else}
<input type="hidden" name="shop" value="0">
{/if}
{if isset($shop_groups) && count($shop_groups)}
{else}
<input type="hidden" name="shopgroup" value="0">
{/if}
</div>
<div class="clearfix"></div>
<p>&nbsp;</p>
<div class="panel-heading clearfix">
{l s='What the file contains?' mod='pshowimporter'}
</div>
<div class="panel-wrapper">
<div class="col-md-12">
<label for="file_contains" class="control-label col-md-4 required">
<span title="" data-toggle="tooltip" class="label-tooltip" data-original-title="">
{l s='Select data type to import' mod='pshowimporter'}:
</span>
</label>
<div class="col-md-6">
<select name="file_contains" id="file_contains" ng-model="file_contains" required
{if isset($primary_config['file_contains'])}ng-init="file_contains = '{$primary_config['file_contains']}'"{/if}>
<option value="data_product">{l s='Products data' mod='pshowimporter'}</option>
<option value="data_feature">{l s='Product features' mod='pshowimporter'}</option>
<option value="data_category">{l s='Product categories' mod='pshowimporter'}</option>
<option value="data_attributegroup">{l s='Product attributes' mod='pshowimporter'}</option>
<option value="data_combination">{l s='Product combinations' mod='pshowimporter'}</option>
</select>
</div>
</div>
<p ng-show="file_contains">&nbsp;</p>
<div class="col-md-12" ng-show="file_contains">
<label for="what_import" class="control-label col-md-4 required"
{if isset($primary_config['what_import'])}ng-init="what_import = '{$primary_config['what_import']}'"{/if}>
<span title="" data-toggle="tooltip" class="label-tooltip" data-original-title="">
{l s='Which data do you want to import from this file?' mod='pshowimporter'}:
</span>
</label>
<div class="col-md-6">
<select name="what_import" ng-model="what_import">
<option value="all">
{l s='Import all data from file' mod='pshowimporter'}
</option>
<option value="not_exists" ng-hide="(['data_attributegroup','data_feature']).indexOf(file_contains) > -1">
{l s='Import only data which not exists in store database' mod='pshowimporter'}
</option>
<option value="exists" ng-hide="(['data_attributegroup','data_feature']).indexOf(file_contains) > -1">
{l s='Update only data which exists in store database' mod='pshowimporter'}
</option>
<option value="exists_or_not" ng-hide="(['data_attributegroup','data_feature']).indexOf(file_contains) > -1">
{l s='Update existing, add non existing in store database' mod='pshowimporter'}
</option>
</select><br>
{*<div class="alert alert-info" ng-hide="(['data_combination']).indexOf(file_contains) <= -1">
<p>{l s='If you want to update combinations in the future you must import combination reference.' mod='pshowimporter'}</p>
</div>
<div class="alert alert-info" ng-hide="(['data_combination']).indexOf(file_contains) <= -1">
<p>{l s='If combination from file exists in store, PShowImporter will remove old combination and add new one' mod='pshowimporter'} - <u>{l s='always import full combination data' mod='pshowimporter'}</u>.</p>
</div>*}
</div>
</div>
<div class="clearfix"></div>
</div>
<p>&nbsp;</p>
<div ng-show="file_contains == 'data_product' && what_import">
{include file="./config_index_products.tpl"}
</div>
<div ng-show="file_contains == 'data_category' && what_import">
{include file="./config_index_categories.tpl"}
</div>
<div ng-show="file_contains == 'data_attributegroup' && what_import">
{include file="./config_index_attributes.tpl"}
</div>
<div ng-show="file_contains == 'data_combination' && what_import">
{include file="./config_index_combinations.tpl"}
</div>
<div class="panel-footer">
{include file="./../helpers/config_buttons.tpl" f='config_index'}
</div>
</div>
</form>
</div>
</div>
<div class="clearfix"></div>