Update retailcrm.tpl

This commit is contained in:
klaos27 2018-07-24 10:30:59 +02:00 committed by GitHub
parent 9eecfcffb8
commit a829cb8f17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,4 @@
<?php echo $header; ?> <?php echo $header; ?><?php echo $column_left;?>
<?php echo $column_left;?>
<div id="content"> <div id="content">
<div class="page-header"> <div class="page-header">
<div class="container-fluid"> <div class="container-fluid">
@ -10,7 +8,8 @@
<?php endif; ?> <?php endif; ?>
<button type="button" id="icml" data-toggle="tooltip" title="<?php echo $text_button_catalog; ?>" class="btn btn-success"><i class="fa fa-file-text-o"></i></button> <button type="button" id="icml" data-toggle="tooltip" title="<?php echo $text_button_catalog; ?>" class="btn btn-success"><i class="fa fa-file-text-o"></i></button>
<button type="submit" form="form-retailcrm" data-toggle="tooltip" title="<?php echo $button_save; ?>" class="btn btn-primary"><i class="fa fa-save"></i></button> <button type="submit" form="form-retailcrm" data-toggle="tooltip" title="<?php echo $button_save; ?>" class="btn btn-primary"><i class="fa fa-save"></i></button>
<a href="<?php echo $cancel; ?>" data-toggle="tooltip" title="<?php echo $button_cancel; ?>" class="btn btn-default"><i class="fa fa-reply"></i></a></div> <a href="<?php echo $cancel; ?>" data-toggle="tooltip" title="<?php echo $button_cancel; ?>" class="btn btn-default"><i class="fa fa-reply"></i></a>
</div>
<h1><?php echo $heading_title; ?></h1> <h1><?php echo $heading_title; ?></h1>
<ul class="breadcrumb"> <ul class="breadcrumb">
<?php foreach ($breadcrumbs as $breadcrumb) { ?> <?php foreach ($breadcrumbs as $breadcrumb) { ?>
@ -32,12 +31,10 @@
<?php echo $text_notice; ?> <?php echo $text_notice; ?>
<a href="<?php echo $saved_settings['retailcrm_url']; ?>/admin/settings#t-main"><?php echo $saved_settings['retailcrm_url']; ?>/admin/settings#t-main</a> <a href="<?php echo $saved_settings['retailcrm_url']; ?>/admin/settings#t-main"><?php echo $saved_settings['retailcrm_url']; ?>/admin/settings#t-main</a>
</div> </div>
<?php endif; ?> <?php endif; ?>
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-body"> <div class="panel-body">
<form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form-retailcrm"> <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form-retailcrm" class="form-horizontal">
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li class="active"><a href="#tab-general" data-toggle="tab"><?php echo $general_tab_text; ?></a></li> <li class="active"><a href="#tab-general" data-toggle="tab"><?php echo $general_tab_text; ?></a></li>
<?php if (isset($saved_settings['retailcrm_apikey']) && $saved_settings['retailcrm_apikey'] != '' && isset($saved_settings['retailcrm_url']) && $saved_settings['retailcrm_url'] != ''): ?> <?php if (isset($saved_settings['retailcrm_apikey']) && $saved_settings['retailcrm_apikey'] != '' && isset($saved_settings['retailcrm_url']) && $saved_settings['retailcrm_url'] != ''): ?>
@ -49,32 +46,40 @@
<li><a href="#tab-logs" data-toggle="tab"><?php echo $logs_tab_text; ?></a></li> <li><a href="#tab-logs" data-toggle="tab"><?php echo $logs_tab_text; ?></a></li>
<?php endif; ?> <?php endif; ?>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
<div class="tab-pane active" id="tab-general"> <div class="tab-pane active" id="tab-general">
<input type="hidden" name="retailcrm_status" value="1"> <input type="hidden" name="retailcrm_status" value="1">
<fieldset>
<h3><?php echo $retailcrm_base_settings; ?></h3> <legend><?php echo $retailcrm_base_settings; ?></legend>
<div class="retailcrm_unit"> <div class="form-group retailcrm_unit">
<label for="retailcrm_url"><?php echo $retailcrm_apiversion; ?></label><br> <label class="col-sm-2 control-label" for="retailcrm_url"><?php echo $retailcrm_apiversion; ?></label>
<select name="retailcrm_apiversion"> <div class="col-lg-1 col-md-2 col-sm-2">
<select name="retailcrm_apiversion" class="form-control">
<?php foreach($api_versions as $version) : ?> <?php foreach($api_versions as $version) : ?>
<option value="<?php echo $version; ?>" <?php if (isset($saved_settings['retailcrm_apiversion']) && $saved_settings['retailcrm_apiversion'] == $version) echo "selected='selected'"; elseif (!isset($saved_settings['retailcrm_apiversion']) && $default_apiversion == $version) echo "selected='selected'"; ?>><?php echo $version; ?></option> <option value="<?php echo $version; ?>" <?php if (isset($saved_settings['retailcrm_apiversion']) && $saved_settings['retailcrm_apiversion'] == $version) echo "selected='selected'"; elseif (!isset($saved_settings['retailcrm_apiversion']) && $default_apiversion == $version) echo "selected='selected'"; ?>><?php echo $version; ?></option>
<?php endforeach ?> <?php endforeach ?>
</select> </select>
</div> </div>
<div class="retailcrm_unit">
<label for="retailcrm_url"><?php echo $retailcrm_url; ?></label><br>
<input id="retailcrm_url" type="text" name="retailcrm_url" value="<?php if (isset($saved_settings['retailcrm_url'])): echo $saved_settings['retailcrm_url']; endif; ?>">
</div> </div>
<div class="retailcrm_unit"> <div class="form-group retailcrm_unit">
<label for="retailcrm_apikey"><?php echo $retailcrm_apikey; ?></label><br> <label class="col-sm-2 control-label" for="retailcrm_url"><?php echo $retailcrm_url; ?></label>
<input id="retailcrm_apikey" type="text" name="retailcrm_apikey" value="<?php if (isset($saved_settings['retailcrm_apikey'])): echo $saved_settings['retailcrm_apikey']; endif;?>"> <div class="col-lg-4 col-md-6 col-sm-10">
<input id="retailcrm_url" type="text" name="retailcrm_url" value="<?php if (isset($saved_settings['retailcrm_url'])): echo $saved_settings['retailcrm_url']; endif; ?>" class="form-control" />
</div> </div>
</div>
<h3><?php echo $retailcrm_countries_settings; ?></h3> <div class="form-group retailcrm_unit">
<div class="retailcrm_unit"> <label class="col-sm-2 control-label" for="retailcrm_apikey"><?php echo $retailcrm_apikey; ?></label>
<div class="well well-sm" style="height: 150px; overflow: auto; width: 30%;"> <div class="col-lg-4 col-md-6 col-sm-10">
<input id="retailcrm_apikey" type="text" name="retailcrm_apikey" value="<?php if (isset($saved_settings['retailcrm_apikey'])): echo $saved_settings['retailcrm_apikey']; endif;?>" class="form-control" />
</div>
</div>
</fieldset>
<fieldset>
<legend><?php echo $retailcrm_countries_settings; ?></legend>
<div class="form-group retailcrm_unit">
<label class="col-sm-2 control-label">Страны</label>
<div class="col-lg-4 col-md-6 col-sm-10">
<div class="well well-sm" style="height: 150px; overflow: auto;">
<?php foreach($countries as $country) : ?> <?php foreach($countries as $country) : ?>
<div class="checkbox"> <div class="checkbox">
<label> <label>
@ -85,24 +90,37 @@
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
</div> </div>
</div>
</fieldset>
<?php if (isset($saved_settings['retailcrm_apikey']) && $saved_settings['retailcrm_apikey'] != '' && isset($saved_settings['retailcrm_url']) && $saved_settings['retailcrm_url'] != ''): ?> <?php if (isset($saved_settings['retailcrm_apikey']) && $saved_settings['retailcrm_apikey'] != '' && isset($saved_settings['retailcrm_url']) && $saved_settings['retailcrm_url'] != ''): ?>
<?php if (!empty($retailcrm_errors)) : ?> <?php if (!empty($retailcrm_errors)) : ?>
<?php foreach($retailcrm_errors as $retailcrm_error): ?> <?php foreach($retailcrm_errors as $retailcrm_error): ?>
<div class="warning"><?php echo $retailcrm_error ?></div> <div class="warning"><?php echo $retailcrm_error ?></div>
<?php endforeach; ?> <?php endforeach; ?>
<?php else: ?> <?php else: ?>
<h3><?php echo $retailcrm_upload_order; ?></h3> <fieldset>
<div class="retailcrm_unit"> <legend><?php echo $retailcrm_upload_order; ?></legend>
<label><?php echo $text_button_export_order; ?> № </label><input type="text" name="order_id"> <div class="form-group retailcrm_unit">
<button type="button" id="export_order" data-toggle="tooltip" title="<?php echo $text_button_export_order; ?>" class="btn btn-success"><i class="fa fa-download"></i></button> <label class="col-sm-2 control-label"><?php echo $text_button_export_order; ?> №</label>
<div class="col-sm-10">
<div class="row">
<div class="col-lg-3 col-md-6 col-sm-6">
<input type="text" name="order_id" class="form-control" />
</div> </div>
<div class="col-lg-3 col-md-4 col-sm-6">
<button type="button" id="export_order" class="btn btn-success"><i class="fa fa-download"></i> <?php echo $text_button_export_order; ?></button>
</div>
</div>
</div>
</div>
</fieldset>
<?php if (isset($saved_settings['retailcrm_apiversion']) && $saved_settings['retailcrm_apiversion'] != 'v3') : ?> <?php if (isset($saved_settings['retailcrm_apiversion']) && $saved_settings['retailcrm_apiversion'] != 'v3') : ?>
<h3><?php echo $special_price_settings; ?></h3> <fieldset>
<div class="retailcrm_unit"> <legend><?php echo $special_price_settings; ?></legend>
<label><?php echo $special_price_settings; ?></label> <div class="form-group retailcrm_unit">
<select id="retailcrm_special" name="retailcrm_special"> <label class="col-sm-2 control-label"><?php echo $special_price_settings; ?></label>
<div class="col-md-4 col-sm-10">
<select id="retailcrm_special" name="retailcrm_special" class="form-control">
<?php foreach ($priceTypes as $priceType) :?> <?php foreach ($priceTypes as $priceType) :?>
<?php if ($priceType['active'] == true) :?> <?php if ($priceType['active'] == true) :?>
<option value="<?php echo $priceType['code']; ?>" <?php if(isset($saved_settings['retailcrm_special']) && $saved_settings['retailcrm_special'] == $priceType['code']):?>selected="selected"<?php endif;?>> <option value="<?php echo $priceType['code']; ?>" <?php if(isset($saved_settings['retailcrm_special']) && $saved_settings['retailcrm_special'] == $priceType['code']):?>selected="selected"<?php endif;?>>
@ -112,30 +130,39 @@
<?php endforeach; ?> <?php endforeach; ?>
</select> </select>
</div> </div>
</div>
</fieldset>
<?php endif; ?> <?php endif; ?>
</div> </div>
<div class="tab-pane" id="tab-references"> <div class="tab-pane" id="tab-references">
<h3><?php echo $retailcrm_dict_settings; ?></h3> <fieldset>
<legend><?php echo $retailcrm_dict_settings; ?></legend>
<h4><?php echo $retailcrm_dict_delivery; ?></h4> <div class="form-group">
<label class="col-sm-2 control-label"><?php echo $retailcrm_dict_delivery; ?></label>
<div class="col-sm-10">
<div class="row">
<?php if ($delivery['opencart']) :?> <?php if ($delivery['opencart']) :?>
<?php foreach($delivery['opencart'] as $value): ?> <?php foreach($delivery['opencart'] as $value): ?>
<div class="col-sm-12" style="margin-bottom:10px;">
<div class="pm"><?php echo $value['title'].':'; ?></div> <div class="pm" style="margin-bottom:5px;"><?php echo $value['title'].':'; ?></div>
<?php unset($value['title']); ?> <?php unset($value['title']); ?>
<?php foreach ($value as $key => $val): ?> <?php foreach ($value as $key => $val): ?>
<div class="retailcrm_unit"> <div class="row retailcrm_unit">
<select id="retailcrm_delivery_<?php echo $val['code']; ?>" name="retailcrm_delivery[<?php echo $val['code']; ?>]" > <div class="col-lg-4 col-md-6 col-sm-6">
<select id="retailcrm_delivery_<?php echo $val['code']; ?>" name="retailcrm_delivery[<?php echo $val['code']; ?>]" class="form-control">
<?php foreach ($delivery['retailcrm'] as $k => $v): ?> <?php foreach ($delivery['retailcrm'] as $k => $v): ?>
<option value="<?php echo $v['code'];?>" <?php if(isset($saved_settings['retailcrm_delivery'][$key]) && $v['code'] == $saved_settings['retailcrm_delivery'][$key]):?>selected="selected"<?php endif;?>> <option value="<?php echo $v['code'];?>" <?php if(isset($saved_settings['retailcrm_delivery'][$key]) && $v['code'] == $saved_settings['retailcrm_delivery'][$key]):?>selected="selected"<?php endif;?>>
<?php echo $v['name'];?> <?php echo $v['name'];?>
</option> </option>
<?php endforeach; ?> <?php endforeach; ?>
</select> </select>
<label for="retailcrm_pm_<?php echo $val['code']; ?>"><?php echo $val['title']; ?></label> </div>
<div class="col-lg-4 col-md-6 col-sm-6">
<label class="control-label" style="text-align:left!important;" for="retailcrm_pm_<?php echo $val['code']; ?>"><?php echo $val['title']; ?></label>
</div>
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>
</div>
<?php endforeach; ?> <?php endforeach; ?>
<?php else :?> <?php else :?>
<div class="alert alert-info"><i class="fa fa-exclamation-circle"></i> <div class="alert alert-info"><i class="fa fa-exclamation-circle"></i>
@ -143,47 +170,79 @@
<?php echo $text_error_delivery; ?> <?php echo $text_error_delivery; ?>
</div> </div>
<?php endif; ?> <?php endif; ?>
<h4><?php echo $retailcrm_dict_status; ?></h4> </div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label"><?php echo $retailcrm_dict_status; ?></label>
<div class="col-sm-10">
<?php foreach ($statuses['opencart'] as $status): ?> <?php foreach ($statuses['opencart'] as $status): ?>
<?php $uid = $status['order_status_id']?> <?php $uid = $status['order_status_id']?>
<div class="retailcrm_unit"> <div class="row retailcrm_unit">
<select id="retailcrm_status_<?php echo $uid; ?>" name="retailcrm_status[<?php echo $uid; ?>]" > <div class="col-lg-4 col-md-6 col-sm-6">
<select id="retailcrm_status_<?php echo $uid; ?>" name="retailcrm_status[<?php echo $uid; ?>]" class="form-control">
<?php foreach ($statuses['retailcrm'] as $k => $v): ?> <?php foreach ($statuses['retailcrm'] as $k => $v): ?>
<option value="<?php echo $v['code'];?>" <?php if(isset($saved_settings['retailcrm_status'][$uid]) && $v['code'] == $saved_settings['retailcrm_status'][$uid]):?>selected="selected"<?php endif;?>> <option value="<?php echo $v['code'];?>" <?php if(isset($saved_settings['retailcrm_status'][$uid]) && $v['code'] == $saved_settings['retailcrm_status'][$uid]):?>selected="selected"<?php endif;?>>
<?php echo $v['name'];?> <?php echo $v['name'];?>
</option> </option>
<?php endforeach; ?> <?php endforeach; ?>
</select> </select>
<label for="retailcrm_status_<?php echo $status['order_status_id']; ?>"><?php echo $status['name']; ?></label> </div>
<div class="col-lg-4 col-md-6 col-sm-6">
<label class="control-label" style="text-align:left!important;" for="retailcrm_status_<?php echo $status['order_status_id']; ?>"><?php echo $status['name']; ?></label>
</div>
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>
</div>
<h4><?php echo $retailcrm_dict_payment; ?></h4> </div>
<div class="form-group">
<label class="col-sm-2 control-label"><?php echo $retailcrm_dict_payment; ?></label>
<div class="col-sm-10">
<?php foreach ($payments['opencart'] as $key => $value): ?> <?php foreach ($payments['opencart'] as $key => $value): ?>
<div class="retailcrm_unit"> <div class="row retailcrm_unit">
<select id="retailcrm_payment_<?php echo $key; ?>" name="retailcrm_payment[<?php echo $key; ?>]" > <div class="col-lg-4 col-md-6 col-sm-6">
<select id="retailcrm_payment_<?php echo $key; ?>" name="retailcrm_payment[<?php echo $key; ?>]" class="form-control">
<?php foreach ($payments['retailcrm'] as $k => $v): ?> <?php foreach ($payments['retailcrm'] as $k => $v): ?>
<option value="<?php echo $v['code'];?>" <?php if(isset($saved_settings['retailcrm_payment'][$key]) && $v['code'] == $saved_settings['retailcrm_payment'][$key]):?>selected="selected"<?php endif;?>> <option value="<?php echo $v['code'];?>" <?php if(isset($saved_settings['retailcrm_payment'][$key]) && $v['code'] == $saved_settings['retailcrm_payment'][$key]):?>selected="selected"<?php endif;?>>
<?php echo $v['name'];?> <?php echo $v['name'];?>
</option> </option>
<?php endforeach; ?> <?php endforeach; ?>
</select> </select>
<label for="retailcrm_payment_<?php echo $key; ?>"><?php echo $value; ?></label> </div>
<div class="col-lg-4 col-md-6 col-sm-6">
<label class="control-label" for="retailcrm_payment_<?php echo $key; ?>"><?php echo $value; ?></label>
</div>
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>
<h4><?php echo $retailcrm_dict_default; ?></h4> </div>
<div class="retailcrm_unit"> </div>
<select id="retailcrm_default_payment" name="retailcrm_default_payment" >
<div class="form-group">
<label class="col-sm-2 control-label"><?php echo $retailcrm_dict_default; ?></label>
<div class="col-sm-10">
<div class="row">
<div class="retailcrm_unit col-sm-12">
<div class="row">
<div class="col-lg-4 col-md-6 col-sm-6">
<select id="retailcrm_default_payment" name="retailcrm_default_payment" class="form-control">
<?php foreach ($payments['opencart'] as $k => $v): ?> <?php foreach ($payments['opencart'] as $k => $v): ?>
<option value="<?php echo $k;?>" <?php if(isset($saved_settings['retailcrm_default_payment']) && $k == $saved_settings['retailcrm_default_payment']):?>selected="selected"<?php endif;?>> <option value="<?php echo $k;?>" <?php if(isset($saved_settings['retailcrm_default_payment']) && $k == $saved_settings['retailcrm_default_payment']):?>selected="selected"<?php endif;?>>
<?php echo $v;?> <?php echo $v;?>
</option> </option>
<?php endforeach; ?> <?php endforeach; ?>
</select> </select>
<label for="retailcrm_default_payment"><?php echo $text_payment; ?></label>
</div> </div>
<div class="retailcrm_unit"> <div class="col-lg-4 col-md-6 col-sm-6">
<select id="retailcrm_default_shipping" name="retailcrm_default_shipping" > <label class="control-label" for="retailcrm_default_payment"><?php echo $text_payment; ?></label>
</div>
</div>
</div>
<div class="retailcrm_unit col-sm-12">
<div class="row">
<div class="col-lg-4 col-md-6 col-sm-6">
<select id="retailcrm_default_shipping" name="retailcrm_default_shipping" class="form-control">
<?php foreach ($delivery['opencart'] as $key => $value): ?> <?php foreach ($delivery['opencart'] as $key => $value): ?>
<optgroup label="<?php echo $value['title']; ?>"> <optgroup label="<?php echo $value['title']; ?>">
<?php unset($value['title']); ?> <?php unset($value['title']); ?>
@ -195,12 +254,22 @@
</optgroup> </optgroup>
<?php endforeach; ?> <?php endforeach; ?>
</select> </select>
<label for="retailcrm_default_payment"><?php echo $text_shipping; ?></label>
</div> </div>
<h4><?php echo $retailcrm_missing_status; ?></h4> <div class="col-lg-4 col-md-6 col-sm-6">
<div class="retailcrm_unit"> <label class="control-label" for="retailcrm_default_payment"><?php echo $text_shipping; ?></label>
<select id="retailcrm_missing_status" name="retailcrm_missing_status"> </div>
<option></option> </div>
</div>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label"><?php echo $retailcrm_missing_status; ?></label>
<div class="col-sm-10">
<div class="row">
<div class="col-lg-4 col-md-6 col-sm-6">
<select id="retailcrm_missing_status" name="retailcrm_missing_status" class="form-control">
<option>-- Выберите --</option>
<?php foreach ($statuses['retailcrm'] as $k => $v): ?> <?php foreach ($statuses['retailcrm'] as $k => $v): ?>
<option value="<?php echo $k;?>" <?php if(isset($saved_settings['retailcrm_missing_status']) && $k == $saved_settings['retailcrm_missing_status']):?>selected="selected"<?php endif;?>> <option value="<?php echo $k;?>" <?php if(isset($saved_settings['retailcrm_missing_status']) && $k == $saved_settings['retailcrm_missing_status']):?>selected="selected"<?php endif;?>>
<?php echo $v['name'];?> <?php echo $v['name'];?>
@ -208,34 +277,42 @@
<?php endforeach; ?> <?php endforeach; ?>
</select> </select>
</div> </div>
</div>
</div>
</div>
</fieldset>
<?php endif; ?> <?php endif; ?>
<?php endif; ?> <?php endif; ?>
</div> </div>
<div class="tab-pane" id="tab-collector"> <div class="tab-pane" id="tab-collector">
<h3><?php echo $daemon_collector; ?></h3> <fieldset>
<div class="retailcrm_unit"> <legend><?php echo $daemon_collector; ?></legend>
<label for="retailcrm_collector_active" class="col-md-4"><?php echo $text_collector_activity; ?></label> <div class="form-group">
<label class="col-sm-2 control-label" for="retailcrm_collector_active"><?php echo $text_collector_activity; ?></label>
<div class="col-sm-10">
<label class="radio-inline"> <label class="radio-inline">
<input type="radio" name="retailcrm_collector_active" value="1" <?php if (isset($saved_settings['retailcrm_collector_active']) && <input type="radio" name="retailcrm_collector_active" value="1" <?php if (isset($saved_settings['retailcrm_collector_active']) &&
$saved_settings['retailcrm_collector_active'] == 1) : $saved_settings['retailcrm_collector_active'] == 1) :
echo 'checked'; endif; ?>> echo 'checked'; endif; ?> />
<?php echo $text_yes; ?> <?php echo $text_yes; ?>
</label> </label>
<label class="radio-inline"> <label class="radio-inline">
<input type="radio" name="retailcrm_collector_active" value="0" <?php if (!isset($saved_settings['retailcrm_collector_active']) || <input type="radio" name="retailcrm_collector_active" value="0" <?php if (!isset($saved_settings['retailcrm_collector_active']) ||
$saved_settings['retailcrm_collector_active'] == 0) : $saved_settings['retailcrm_collector_active'] == 0) :
echo 'checked'; endif; ?>> echo 'checked'; endif; ?> />
<?php echo $text_no; ?> <?php echo $text_no; ?>
</label> </label>
</div> </div>
<div class="retailcrm_unit">
<label for="retailcrm_collector" class="col-md-4"><?php echo $collector_site_key; ?></label>
<input id="retailcrm_collector_site_key" type="text" name="retailcrm_collector[site_key]" value="<?php if (isset($saved_settings['retailcrm_collector']['site_key'])): echo $saved_settings['retailcrm_collector']['site_key']; endif; ?>">
</div> </div>
<div class="retailcrm_unit"> <div class="form-group">
<label for="retailcrm_collector" class="col-md-4"><?php echo $text_collector_form_capture; ?></label> <label class="col-sm-2 control-label" for="retailcrm_collector" class="col-md-4"><?php echo $collector_site_key; ?></label>
<div class="col-sm-10">
<input id="retailcrm_collector_site_key" type="text" name="retailcrm_collector[site_key]" value="<?php if (isset($saved_settings['retailcrm_collector']['site_key'])): echo $saved_settings['retailcrm_collector']['site_key']; endif; ?>" class="form-control" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="retailcrm_collector"><?php echo $text_collector_form_capture; ?></label>
<div class="col-sm-10">
<label class="radio-inline"> <label class="radio-inline">
<input type="radio" name="retailcrm_collector[form_capture]" value="1" <?php if (isset($saved_settings['retailcrm_collector']['form_capture']) && <input type="radio" name="retailcrm_collector[form_capture]" value="1" <?php if (isset($saved_settings['retailcrm_collector']['form_capture']) &&
$saved_settings['retailcrm_collector']['form_capture'] == 1) : $saved_settings['retailcrm_collector']['form_capture'] == 1) :
@ -249,20 +326,28 @@
<?php echo $text_no; ?> <?php echo $text_no; ?>
</label> </label>
</div> </div>
<div class="retailcrm_unit">
<label for="retailcrm_collector" class="col-md-4"><?php echo $text_collector_period; ?></label>
<input id="retailcrm_collector_period" type="text" name="retailcrm_collector[period]" value="<?php if (isset($saved_settings['retailcrm_collector']['period'])): echo $saved_settings['retailcrm_collector']['period']; endif; ?>">
</div> </div>
<div class="retailcrm_unit"> <div class="form-group">
<label for="retailcrm_collector" class="col-md-4"><?php echo $text_label_promo; ?></label> <label class="col-sm-2 control-label" for="retailcrm_collector_period" class="col-md-4"><?php echo $text_collector_period; ?></label>
<input id="retailcrm_collector[]" type="text" name="retailcrm_collector[label_promo]" value="<?php if (isset($saved_settings['retailcrm_collector']['label_promo'])): echo $saved_settings['retailcrm_collector']['label_promo']; endif; ?>"> <div class="col-sm-4">
<input id="retailcrm_collector_period" type="text" name="retailcrm_collector[period]" value="<?php if (isset($saved_settings['retailcrm_collector']['period'])): echo $saved_settings['retailcrm_collector']['period']; endif; ?>" class="form-control" />
</div> </div>
<div class="retailcrm_unit">
<label for="retailcrm_collector" class="col-md-4"><?php echo $text_label_send; ?></label>
<input id="retailcrm_collector_label_send" type="text" name="retailcrm_collector[label_send]" value="<?php if (isset($saved_settings['retailcrm_collector']['label_send'])): echo $saved_settings['retailcrm_collector']['label_send']; endif; ?>">
</div> </div>
<div class="retailcrm_unit"> <div class="form-group">
<label for="retailcrm_collector" class="col-md-4"><?php echo $collector_custom_text; ?></label> <label class="col-sm-2 control-label" for="retailcrm_collector[]"><?php echo $text_label_promo; ?></label>
<div class="col-sm-10">
<input id="retailcrm_collector[]" type="text" name="retailcrm_collector[label_promo]" value="<?php if (isset($saved_settings['retailcrm_collector']['label_promo'])): echo $saved_settings['retailcrm_collector']['label_promo']; endif; ?>" class="form-control" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="retailcrm_collector_label_send"><?php echo $text_label_send; ?></label>
<div class="col-sm-10">
<input id="retailcrm_collector_label_send" type="text" name="retailcrm_collector[label_send]" value="<?php if (isset($saved_settings['retailcrm_collector']['label_send'])): echo $saved_settings['retailcrm_collector']['label_send']; endif; ?>" class="form-control" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="retailcrm_collector"><?php echo $collector_custom_text; ?></label>
<div class="col-sm-10">
<label class="radio-inline"> <label class="radio-inline">
<input type="radio" name="retailcrm_collector[custom_form]" value="1" <?php if (isset($saved_settings['retailcrm_collector']['custom_form']) && <input type="radio" name="retailcrm_collector[custom_form]" value="1" <?php if (isset($saved_settings['retailcrm_collector']['custom_form']) &&
$saved_settings['retailcrm_collector']['custom_form'] == 1) : $saved_settings['retailcrm_collector']['custom_form'] == 1) :
@ -276,64 +361,95 @@
<?php echo $text_no; ?> <?php echo $text_no; ?>
</label> </label>
</div> </div>
</div>
<?php foreach ($collectorFields as $field => $label) : ?> <?php foreach ($collectorFields as $field => $label) : ?>
<div class="retailcrm_unit"> <div class="form-group">
<label for="retailcrm_collector" class="col-md-4"><?php echo $label; ?></label> <label class="col-sm-2 control-label" for="retailcrm_collector"><?php echo $label; ?></label>
<div class="col-md-8"> <div class="col-sm-10">
<input id="retailcrm_collector" type="text" name="retailcrm_collector[custom][<?php echo $field; ?>]" value="<?php if (isset($saved_settings['retailcrm_collector']['custom'][$field])) : echo $saved_settings['retailcrm_collector']['custom'][$field]; endif; ?>"> <div class="row">
<input type="checkbox" name="retailcrm_collector[require][<?php echo $field; ?>_require]" value="1" <?php if (isset($saved_settings['retailcrm_collector']['require'][$field.'_require'])) : echo 'checked'; endif;?>> <div class="col-md-4 col-sm-6">
<label for="retailcrm_collector"><?php echo $text_require; ?></label> <input id="retailcrm_collector" type="text" name="retailcrm_collector[custom][<?php echo $field; ?>]" value="<?php if (isset($saved_settings['retailcrm_collector']['custom'][$field])) : echo $saved_settings['retailcrm_collector']['custom'][$field]; endif; ?>" class="form-control" />
</div>
<div class="col-md-8 col-sm-6" style="margin-top: 8px;">
<input style="margin-top: 0; vertical-align: middle;" type="checkbox" name="retailcrm_collector[require][<?php echo $field; ?>_require]" value="1" <?php if (isset($saved_settings['retailcrm_collector']['require'][$field.'_require'])) : echo 'checked'; endif;?> />
<label style="margin-bottom: 0; vertical-align: middle; margin-left: 5px;" for="retailcrm_collector"><?php echo $text_require; ?></label>
</div>
</div>
</div> </div>
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>
</fieldset>
</div> </div>
<?php if (isset($saved_settings['retailcrm_apiversion']) && $saved_settings['retailcrm_apiversion'] == 'v5' && isset($customFields)) : ?> <?php if (isset($saved_settings['retailcrm_apiversion']) && $saved_settings['retailcrm_apiversion'] == 'v5' && isset($customFields)) : ?>
<div class="tab-pane" id="tab-custom_fields"> <div class="tab-pane" id="tab-custom_fields">
<h3><?php echo $retailcrm_dict_custom_fields; ?></h3> <fieldset>
<legend><?php echo $retailcrm_dict_custom_fields; ?></legend>
<?php if ($customFields['retailcrm'] && $customFields['opencart']) : ?> <?php if ($customFields['retailcrm'] && $customFields['opencart']) : ?>
<div class="retailcrm_unit"> <div class="form-group">
<label for="retailcrm_custom_field_active"><?php echo $text_custom_field_activity; ?></label> <label class="col-sm-2 control-label" for="retailcrm_custom_field_active"><?php echo $text_custom_field_activity; ?></label>
<div class="col-sm-10">
<label class="radio-inline"> <label class="radio-inline">
<input type="radio" name="retailcrm_custom_field_active" value="1" <?php if (isset($saved_settings['retailcrm_custom_field_active']) && <input type="radio" name="retailcrm_custom_field_active" value="1" <?php if (isset($saved_settings['retailcrm_custom_field_active']) &&
$saved_settings['retailcrm_custom_field_active'] == 1) : $saved_settings['retailcrm_custom_field_active'] == 1) :
echo 'checked'; endif; ?>> echo 'checked'; endif; ?> />
<?php echo $text_yes; ?> <?php echo $text_yes; ?>
</label> </label>
<label class="radio-inline"> <label class="radio-inline">
<input type="radio" name="retailcrm_custom_field_active" value="0" <?php if (!isset($saved_settings['retailcrm_custom_field_active']) || <input type="radio" name="retailcrm_custom_field_active" value="0" <?php if (!isset($saved_settings['retailcrm_custom_field_active']) ||
$saved_settings['retailcrm_custom_field_active'] == 0) : $saved_settings['retailcrm_custom_field_active'] == 0) :
echo 'checked'; endif; ?>> echo 'checked'; endif; ?> />
<?php echo $text_no; ?> <?php echo $text_no; ?>
</label> </label>
</div> </div>
<h4><?php echo $text_customers_custom_fields; ?></h4> </div>
<div class="form-group">
<label class="col-sm-2 control-label"><?php echo $text_customers_custom_fields; ?></label>
<div class="col-sm-10">
<div class="row">
<?php foreach ($customFields['opencart'] as $customField) : ?> <?php foreach ($customFields['opencart'] as $customField) : ?>
<div class="col-sm-12" style="margin-bottom:5px;">
<div class="row">
<?php $fid = 'c_' . $customField['custom_field_id'] ?> <?php $fid = 'c_' . $customField['custom_field_id'] ?>
<div class="retailcrm_unit"> <div class="col-sm-4">
<select id="retailcrm_custom_field_<?php echo $fid; ?>" name="retailcrm_custom_field[<?php echo $fid; ?>]" > <select id="retailcrm_custom_field_<?php echo $fid; ?>" name="retailcrm_custom_field[<?php echo $fid; ?>]" class="form-control">
<?php foreach ($customFields['retailcrm']['customers'] as $v): ?> <?php foreach ($customFields['retailcrm']['customers'] as $v): ?>
<option value="<?php echo $v['code'];?>" <?php if(isset($saved_settings['retailcrm_custom_field'][$fid]) && $v['code'] == $saved_settings['retailcrm_custom_field'][$fid]):?>selected="selected"<?php endif;?>> <option value="<?php echo $v['code'];?>" <?php if(isset($saved_settings['retailcrm_custom_field'][$fid]) && $v['code'] == $saved_settings['retailcrm_custom_field'][$fid]):?>selected="selected"<?php endif;?>>
<?php echo $v['name'];?> <?php echo $v['name'];?>
</option> </option>
<?php endforeach; ?> <?php endforeach; ?>
</select> </select>
<label for="retailcrm_custom_field_<?php echo $fid; ?>"><?php echo $customField['name']; ?></label> </div>
<label style="padding-top: 9px;" for="retailcrm_custom_field_<?php echo $fid; ?>"><?php echo $customField['name']; ?></label>
</div>
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>
<h4><?php echo $text_orders_custom_fields; ?></h4> </div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label"><?php echo $text_orders_custom_fields; ?></label>
<div class="col-sm-10">
<div class="row">
<?php foreach ($customFields['opencart'] as $customField) : ?> <?php foreach ($customFields['opencart'] as $customField) : ?>
<div class="col-sm-12" style="margin-bottom:5px;">
<div class="row">
<?php $fid = 'o_' . $customField['custom_field_id'] ?> <?php $fid = 'o_' . $customField['custom_field_id'] ?>
<div class="retailcrm_unit"> <div class="col-sm-4">
<select id="retailcrm_custom_field_<?php echo $fid; ?>" name="retailcrm_custom_field[<?php echo $fid; ?>]" > <select id="retailcrm_custom_field_<?php echo $fid; ?>" name="retailcrm_custom_field[<?php echo $fid; ?>]" class="form-control">
<?php foreach ($customFields['retailcrm']['orders'] as $v): ?> <?php foreach ($customFields['retailcrm']['orders'] as $v): ?>
<option value="<?php echo $v['code'];?>" <?php if(isset($saved_settings['retailcrm_custom_field'][$fid]) && $v['code'] == $saved_settings['retailcrm_custom_field'][$fid]):?>selected="selected"<?php endif;?>> <option value="<?php echo $v['code'];?>" <?php if(isset($saved_settings['retailcrm_custom_field'][$fid]) && $v['code'] == $saved_settings['retailcrm_custom_field'][$fid]):?>selected="selected"<?php endif;?>>
<?php echo $v['name'];?> <?php echo $v['name'];?>
</option> </option>
<?php endforeach; ?> <?php endforeach; ?>
</select> </select>
<label for="retailcrm_custom_field_<?php echo $fid; ?>"><?php echo $customField['name']; ?></label> </div>
<label style="padding-top: 9px;" for="retailcrm_custom_field_<?php echo $fid; ?>"><?php echo $customField['name']; ?></label>
</div>
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>
</div>
</div>
</div>
<?php elseif (!$customFields['retailcrm'] && !$customFields['opencart']) : ?> <?php elseif (!$customFields['retailcrm'] && !$customFields['opencart']) : ?>
<div class="alert alert-info"><i class="fa fa-exclamation-circle"></i> <div class="alert alert-info"><i class="fa fa-exclamation-circle"></i>
<button type="button" class="close" data-dismiss="alert">&times;</button> <button type="button" class="close" data-dismiss="alert">&times;</button>
@ -350,35 +466,44 @@
<?php echo $text_error_cf_opencart; ?> <?php echo $text_error_cf_opencart; ?>
</div> </div>
<?php endif; ?> <?php endif; ?>
</fieldset>
</div> </div>
<?php endif; ?> <?php endif; ?>
<div class="tab-pane" id="tab-logs"> <div class="tab-pane" id="tab-logs">
<fieldset style="margin-bottom: 30px;">
<legend>Retailcrm API error log</legend>
<div class="retailcrm_unit"> <div class="retailcrm_unit">
<span>Retailcrm API error log</span> <a onclick="confirm('<?php echo $text_confirm_log; ?>') ? location.href='<?php echo $clear_retailcrm; ?>' : false;" data-toggle="tooltip" title="<?php echo $button_clear; ?>" class="btn btn-danger"><i class="fa fa-eraser"></i> <span class="hidden-xs"><?php echo $button_clear; ?></span></a>
<a onclick="confirm('<?php echo $text_confirm_log; ?>') ? location.href='<?php echo $clear_retailcrm; ?>' : false;" data-toggle="tooltip" title="<?php echo $button_clear; ?>" class="btn btn-danger"><i class="fa fa-eraser"></i></a>
</div> </div>
<?php if (isset($logs['retailcrm_log'])) : ?> <?php if (isset($logs['retailcrm_log'])) : ?>
<div class="panel-body"> <div class="row">
<div class="col-sm-12">
<textarea wrap="off" rows="15" readonly class="form-control"><?php echo $logs['retailcrm_log']; ?></textarea> <textarea wrap="off" rows="15" readonly class="form-control"><?php echo $logs['retailcrm_log']; ?></textarea>
</div> </div>
</div>
<?php elseif (isset($logs['retailcrm_error'])) : ?> <?php elseif (isset($logs['retailcrm_error'])) : ?>
<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> <?php echo $logs['retailcrm_error']; ?> <div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> <?php echo $logs['retailcrm_error']; ?>
<button type="button" class="close" data-dismiss="alert">&times;</button> <button type="button" class="close" data-dismiss="alert">&times;</button>
</div> </div>
<?php endif; ?> <?php endif; ?>
</fieldset>
<fieldset>
<legend>Opencart API error log</legend>
<div class="retailcrm_unit"> <div class="retailcrm_unit">
<span>Opencart API error log</span> <a onclick="confirm('<?php echo $text_confirm_log; ?>') ? location.href='<?php echo $clear_opencart; ?>' : false;" data-toggle="tooltip" title="<?php echo $button_clear; ?>" class="btn btn-danger"><i class="fa fa-eraser"></i> <span class="hidden-xs"><?php echo $button_clear; ?></span></a>
<a onclick="confirm('<?php echo $text_confirm_log; ?>') ? location.href='<?php echo $clear_opencart; ?>' : false;" data-toggle="tooltip" title="<?php echo $button_clear; ?>" class="btn btn-danger"><i class="fa fa-eraser"></i></a>
</div> </div>
<?php if (isset($logs['oc_api_log'])) : ?> <?php if (isset($logs['oc_api_log'])) : ?>
<div class="panel-body"> <div class="row">
<div class="col-sm-12">
<textarea wrap="off" rows="15" readonly class="form-control"><?php echo $logs['oc_api_log']; ?></textarea> <textarea wrap="off" rows="15" readonly class="form-control"><?php echo $logs['oc_api_log']; ?></textarea>
</div> </div>
</div>
<?php elseif (isset($logs['oc_error'])) : ?> <?php elseif (isset($logs['oc_error'])) : ?>
<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> <?php echo $logs['oc_error']; ?> <div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> <?php echo $logs['oc_error']; ?>
<button type="button" class="close" data-dismiss="alert">&times;</button> <button type="button" class="close" data-dismiss="alert">&times;</button>
</div> </div>
<?php endif; ?> <?php endif; ?>
</fieldset>
</div> </div>
</div> </div>
</form> </form>
@ -386,7 +511,6 @@
</div> </div>
</div> </div>
</div> </div>
<?php echo $footer; ?> <?php echo $footer; ?>
<script type="text/javascript"> <script type="text/javascript">
@ -457,4 +581,3 @@
} }
}); });
</script> </script>