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

133 lines
5.6 KiB
Smarty

<script>
var should_match = JSON.parse('{$should_match}');
</script>
{include file='./../parts/import_steps.tpl' step=3}
<p>&nbsp;</p>
{include file='./../parts/config.tpl'}
<div class="clearfix">
</div>
<div class="col-sm-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;">
{*<div class="alert alert-info hidden tip" id="before_work_with_xml">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<p>
{l s='Before starting work, see the information from this address:' mod='pshowimporter'}
<a href="https://pl.wikipedia.org/wiki/XML">{l s='XML' mod='pshowimporter'}</a>
</p>
</div>*}
<pre ng-show="filecontents" style="width:3000px; height: 95%;"><code class="xml">[[filecontents]]</code></pre>
</div>
</div>
</div>
<form class="col-xs-12 defaultForm form-horizontal" id="matchingFields" method="post" action="{$link->getAdminLink('PShowImporterConfig', true)}&file={$smarty.get.file}&step=2">
<div class="alert alert-info">
<div class="col-xs-9">
<p>{l s='You can match two or more the same fields to merge data. ' mod='pshowimporter'}</p>
<p>{l s='For example select twice \'product name\' and check \'merge\' field to merge two file fields into product name.' mod='pshowimporter'}</p>
</div>
<div class="col-xs-3">
<img class="img-responsive" src="{$smarty.const._PS_BASE_URI_}/modules/pshowimporter/views/img/merge_fields.png">
</div>
<div class="clearfix"></div>
</div>
<div class="panel">
<div class="panel-content">
<div class="col-md-12">
<div class="col-md-3 text-right">
<strong>{l s='First column values from CSV file' mod='pshowimporter'}</strong>
</div>
<div class="col-md-2">
<strong>{l s='PrestaShop field' mod='pshowimporter'}</strong>
</div>
<div class="col-md-1 text-center">
<strong>{l s='Merge the same fields' mod='pshowimporter'}</strong>
</div>
<div class="col-md-2 text-right">
<strong>{l s='Prepend' mod='pshowimporter'}</strong>
</div>
<div class="col-md-2">
<strong>{l s='Append' mod='pshowimporter'}</strong>
</div>
<div class="col-md-1 text-right">
<strong>{l s='Cut from start' mod='pshowimporter'}</strong>
</div>
<div class="col-md-1">
<strong>{l s='Cut from end' mod='pshowimporter'}</strong>
</div>
</div>
<table class="table col-md-12">
{assign var='number' value=1}
{assign var='fieldId' value=0}
{foreach from=reset($rows) key='k' item='own'}
<tr>
<td class="col-md-3 text-right">
{$own}
</td>
<td class="col-md-2">
{include file="../helpers/config_matchxml_dbfield.tpl" fieldId=$number matched=$matched attr='own' elem="own"|cat:$number db_tables=$db_tables val=($matched_fields[$number][0]|cat:'.'|cat:$matched_fields[$number][1])}
</td>
<td class="col-md-1 text-center">
<input type="checkbox" name="merge{{$number}}" class="" value="1" {if $merge[$number]}checked="checked"{/if}>
</td>
<td class="col-md-2 has-success">
<input type="text" name="prepend{{$number}}" class="form-control text-right" value="{$prepend[$number]}">
</td>
<td class="col-md-2 has-success">
<input type="text" name="append{{$number}}" class="form-control" value="{$append[$number]}">
</td>
<td class="col-md-1 has-error">
<input type="number" name="cutStart{{$number}}" min="0" class="form-control text-right" value="{$cutStart[$number]}">
</td>
<td class="col-md-1 has-error">
<input type="number" name="cutEnd{{$number}}" min="0" class="form-control" value="{$cutEnd[$number]}">
</td>
</tr>
{assign var='number' value=($number+1)}
{assign var='fieldId' value=($fieldId+1)}
{/foreach}
</table>
</div>
<div class="clearfix"></div>
<div class="panel-footer">
{include file="./../helpers/config_buttons.tpl" f='config_matchfields' category_matching=$category_matching}
</div>
</div>
</form>
<div class="clearfix"></div>