Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated: Admin import controller to handle the csv files required in managing PMS. #965

Merged
merged 20 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
a614aee
Updated the adminimportcontroller to allow the admin to import rooms,…
vishal-singh-webkul Jan 16, 2024
4b9fc99
Optimized code by adding the previous missing validations
vishal-singh-webkul Jan 31, 2024
66044c0
Fixed the error and warning on hotel upload using the csv
vishal-singh-webkul Mar 13, 2024
ecde8d0
Added validation of the missing required fields from the csv file
vishal-singh-webkul Mar 13, 2024
8d96b12
Removed mails from being sent on booking import, added more optimized…
vishal-singh-webkul Mar 14, 2024
09ecc25
Merge remote-tracking branch 'origin/develop' into gli-1584
vishal-singh-webkul Mar 27, 2024
84bf37b
Merge branch 'develop' into gli-1584
vishal-singh-webkul Jun 13, 2024
514e43e
Created new file CsvOrder to handle the imported orders
vishal-singh-webkul Jun 14, 2024
0b2f074
Merge branch 'develop' into gli-1584
vishal-singh-webkul Jul 2, 2024
568cb24
Merge branch 'develop' into gli-1584
vishal-singh-webkul Jul 17, 2024
0b1862c
Removed the address from the csv bookings import process
vishal-singh-webkul Jul 17, 2024
555f096
Merge branch 'develop' into gli-1584
vishal-singh-webkul Jul 23, 2024
22d5d7f
removed the non required commented code from admin Import, updated th…
vishal-singh-webkul Jul 27, 2024
7b545d2
updated the validate order for the adminimport
vishal-singh-webkul Jul 27, 2024
5aa7b92
added max quantity validation on bookings import
vishal-singh-webkul Jul 29, 2024
83d4352
Merge branch 'develop' into gli-1584
vishal-singh-webkul Jul 30, 2024
ca04536
Fixed: the categories and service product delete process
vishal-singh-webkul Aug 2, 2024
950521d
Merge branch 'develop' into gli-1584
vishal-singh-webkul Aug 5, 2024
addc803
Merge branch 'develop' of https://github.com/vishal-singh-webkul/QloA…
vishal-singh-webkul Aug 12, 2024
264e152
Merge branch 'develop' into gli-1584
vishal-singh-webkul Aug 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 57 additions & 65 deletions admin/themes/default/template/controllers/import/helpers/form/form.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<div class="leadin">{block name="leadin"}{/block}</div>
{if $module_confirmation}
<div class="alert alert-success clearfix">
{l s='Your .CSV file has been successfully imported into your shop. Don\'t forget to re-build the products\' search index.'}
{l s='Your .CSV file has been successfully imported to your website.'}
</div>
{/if}
<div class="row">
Expand Down Expand Up @@ -63,7 +63,6 @@
<div class="alert alert-warning import_products_categories">
<ul>
<li>{l s='Note that the Category import does not support having two categories with the same name.'}</li>
<li>{l s='Note that you can have several products with the same reference.'}</li>
</ul>
</div>
<div class="alert alert-warning import_supply_orders_details">
Expand Down Expand Up @@ -166,12 +165,12 @@
</div>
</div>
<div class="form-group" id="csv_file_selected" style="display: none;">
<div class="alert alert-success clearfix">
<div class="alert alert-success clearfix" style="display:flex; align-items:center;">
<input type="hidden" value="{$csv_selected}" name="csv" id="csv_selected_value" />
<div class="col-lg-8">
<div class="col-xs-8">
<span id="csv_selected_filename">{$csv_selected|escape:'html':'UTF-8'}</span>
</div>
<div class="col-lg-4">
<div class="col-xs-4">
<div class="btn-group pull-right">
<button id="file-remove-button" type="button" class="btn btn-default">
<i class="icon-refresh"></i>
Expand Down Expand Up @@ -199,42 +198,40 @@
<div class="form-group">
<label for="convert" class="control-label col-lg-4">{l s='ISO 8859-1 encoded file?'}</label>
<div class="col-lg-8">
<label class="switch-light prestashop-switch fixed-width-lg">
<input name="convert" id="convert" type="checkbox" />
<span>
<span>{l s='Yes'}</span>
<span>{l s='No'}</span>
</span>
<span class="switch prestashop-switch fixed-width-lg">
<input type="radio" name="convert" id="convert_on" value="1">
<label for="convert_on">{l s='Yes'}</label>
<input type="radio" name="convert" id="convert_off" value="0" checked="checked">
<label for="convert_off">{l s='No'}</label>
<a class="slide-button btn"></a>
</label>
</span>
</div>
</div>
<div class="form-group">
<label for="separator" class="control-label col-lg-4">{l s='Field separator'}</label>
<div class="col-lg-8">
<input id="separator" name="separator" class="fixed-width-xs form-control" type="text" value="{if isset($separator_selected)}{$separator_selected|escape:'html':'UTF-8'}{else};{/if}" />
<div class="help-block">{l s='e.g. '} 1; Blouse; 129.90; 5</div>
<div class="help-block">{l s='e.g. '} 6; 1; The Sunshine Luxury</div>
</div>
</div>
<div class="form-group">
<label for="multiple_value_separator" class="control-label col-lg-4">{l s='Multiple value separator'}</label>
<div class="col-lg-8">
<input id="multiple_value_separator" name="multiple_value_separator" class="fixed-width-xs form-control" type="text" value="{if isset($multiple_value_separator_selected)}{$multiple_value_separator_selected|escape:'html':'UTF-8'}{else},{/if}" />
<div class="help-block">{l s='e.g. '} Blouse; red.jpg, blue.jpg, green.jpg; 129.90</div>
<div class="help-block">{l s='e.g. '} The Sunshine Luxury; News Paper:2.jpg, Gym:7.jpg</div>
</div>
</div>
<hr />
<div class="form-group">
<label for="truncate" class="control-label col-lg-4">{l s='Delete all'} <span id="entitie">{l s='categories'}</span> {l s='before import'} </label>
<div class="col-lg-8">
<label class="switch-light prestashop-switch fixed-width-lg">
<input id="truncate" name="truncate" type="checkbox"/>
<span>
<span>{l s='Yes'}</span>
<span>{l s='No'}</span>
</span>
<span class="switch prestashop-switch fixed-width-lg">
<input type="radio" name="truncate" id="truncate_on" value="1">
<label for="truncate_on">{l s='Yes'}</label>
<input type="radio" name="truncate" id="truncate_off" value="0" checked="checked">
<label for="truncate_off">{l s='No'}</label>
<a class="slide-button btn"></a>
</label>
</span>
</div>
</div>
<div class="form-group" style="display: none">
Expand All @@ -244,52 +241,49 @@
</span>
</label>
<div class="col-lg-8">
<label class="switch-light prestashop-switch fixed-width-lg">
<input id="match_ref" name="match_ref" type="checkbox" />
<span>
<span>{l s='Yes'}</span>
<span>{l s='No'}</span>
</span>
<span class="switch prestashop-switch fixed-width-lg">
<input type="radio" name="match_ref" id="match_ref_on" value="1">
<label for="match_ref_on">{l s='Yes'}</label>
<input type="radio" name="match_ref" id="match_ref_off" value="0" checked="checked">
<label for="match_ref_off">{l s='No'}</label>
<a class="slide-button btn"></a>
</label>
</span>
</div>
</div>
<div class="form-group">
<label for="regenerate" class="control-label col-lg-4">{l s='Skip thumbnails regeneration'}</label>
<div class="col-lg-8">
<label class="switch-light prestashop-switch fixed-width-lg">
<input id="regenerate" name="regenerate" type="checkbox" />
<span>
<span>{l s='Yes'}</span>
<span>{l s='No'}</span>
</span>
<span class="switch prestashop-switch fixed-width-lg">
<input type="radio" name="regenerate" id="regenerate_on" value="1">
<label for="regenerate_on">{l s='Yes'}</label>
<input type="radio" name="regenerate" id="regenerate_off" value="0" checked="checked">
<label for="regenerate_off">{l s='No'}</label>
<a class="slide-button btn"></a>
</label>
</span>
</div>
</div>
<div class="form-group">
<label for="forceIDs" class="control-label col-lg-4">
<span data-toggle="tooltip" class="label-tooltip" data-original-title="{l s='If you enable this option, your imported items\' ID number will be used as-is. If you do not enable this option, the imported ID number will be ignored, and PrestaShop will instead create auto-incremented ID numbers for all the imported items.'}">
<span data-toggle="tooltip" class="label-tooltip" data-original-title="{l s='If you enable this option, your imported items\' ID number will be used as-is. If you do not enable this option, the imported ID number will be ignored, and QloApps will instead create auto-incremented ID numbers for all the imported items.'}">
{l s='Force all ID numbers'}
</span>
</label>
<div class="col-lg-8">
<label class="switch-light prestashop-switch fixed-width-lg">
<input id="forceIDs" name="forceIDs" type="checkbox"/>
<span>
<span>{l s='Yes'}</span>
<span>{l s='No'}</span>
</span>
<span class="switch prestashop-switch fixed-width-lg">
<input type="radio" name="forceIDs" id="forceIDs_on" value="1">
<label for="forceIDs_on">{l s='Yes'}</label>
<input type="radio" name="forceIDs" id="forceIDs_off" value="0" checked="checked">
<label for="forceIDs_off">{l s='No'}</label>
<a class="slide-button btn"></a>
</label>
</span>
</div>
</div>
<!--
<!--
{*if empty($files_to_import)*}
<div class="alert alert-info">{l s='You must upload a file in order to proceed to the next step'}</div>
{*if !count($files_to_import)*}
<p>{l s='There is no CSV file available. Please upload one using the \'Upload\' button above.'}</p>
-->
-->
<div class="panel-footer">
<button type="submit" name="submitImportFile" id="submitImportFile" class="btn btn-default pull-right" >
<i class="process-icon-next"></i> <span>{l s='Next step'}</span>
Expand Down Expand Up @@ -317,29 +311,26 @@
</div>

<div class="list-group">
<a class="list-group-item _blank" href="../docs/csv_import/categories_import.csv">
{l s='Sample Categories file'}
<a class="list-group-item _blank" href="../docs/csv_import/hotels_import.csv">
{l s='Sample Hotels file'}
</a>
<a class="list-group-item _blank" href="../docs/csv_import/products_import.csv">
{l s='Sample Products file'}
<a class="list-group-item _blank" href="../docs/csv_import/room_types_import.csv">
{l s='Sample Room Types file'}
</a>
<a class="list-group-item _blank" href="../docs/csv_import/combinations_import.csv">
{l s='Sample Combinations file'}
<a class="list-group-item _blank" href="../docs/csv_import/rooms_import.csv">
{l s='Sample Rooms file'}
</a>
<a class="list-group-item _blank" href="../docs/csv_import/customers_import.csv">
{l s='Sample Customers file'}
<a class="list-group-item _blank" href="../docs/csv_import/service_products_import.csv">
{l s='Sample Service Products file'}
</a>
<a class="list-group-item _blank" href="../docs/csv_import/addresses_import.csv">
{l s='Sample Addresses file'}
</a>
<a class="list-group-item _blank" href="../docs/csv_import/manufacturers_import.csv">
{l s='Sample Manufacturers file'}
<a class="list-group-item _blank" href="../docs/csv_import/categories_import.csv">
{l s='Sample Categories file'}
</a>
<a class="list-group-item _blank" href="../docs/csv_import/suppliers_import.csv">
{l s='Sample Suppliers file'}
<a class="list-group-item _blank" href="../docs/csv_import/customers_import.csv">
{l s='Sample Customers file'}
</a>
<a class="list-group-item _blank" href="../docs/csv_import/alias_import.csv">
{l s='Sample Aliases file'}
<a class="list-group-item _blank" href="../docs/csv_import/bookings_import.csv">
{l s='Sample Bookings file'}
</a>
{if $PS_ADVANCED_STOCK_MANAGEMENT}
<a class="list-group-item _blank" href="../docs/csv_import/supply_orders_import.csv">
Expand All @@ -352,9 +343,9 @@
</div>
</div>
</div>
</div>
</div>

<script type="text/javascript">
<script type="text/javascript">

function humanizeSize(bytes) {
if (typeof bytes !== 'number')
Expand Down Expand Up @@ -506,12 +497,13 @@
else {
$("#match_ref").closest('.form-group').hide();
}
if ($("#entity > option:selected").val() == 1 || $("#entity > option:selected").val() == 0) {
if ($("#entity > option:selected").val() == 3) {
$(".import_products_categories").show();
}
else {
$(".import_products_categories").hide();
}

if ($("#entity > option:selected").val() == 0 || $("#entity > option:selected").val() == 1 ||
$("#entity > option:selected").val() == 5 || $("#entity > option:selected").val() == 6) {
$("#regenerate").closest('.form-group').show();
Expand Down
Loading