Add debug mode option in settings and little fix debug info
This commit is contained in:
parent
58e0e8b22c
commit
30f16915d9
@ -276,3 +276,13 @@ msgstr "Presionando el botón «Exportar» puedes descargar a todos los pedidos
|
||||
|
||||
msgid "Debug information"
|
||||
msgstr "Información Debug"
|
||||
|
||||
msgid "Debug mode"
|
||||
msgstr "Modo de depuración"
|
||||
|
||||
msgid "Enable debug mode in module"
|
||||
msgstr "Activar el modo de depuración en el módulo"
|
||||
|
||||
msgid "Is required to enable debug mode for advanced logs"
|
||||
msgstr "Se requiere el modo de depuración para habilitar el registro avanzado de logs"
|
||||
|
||||
|
@ -286,5 +286,14 @@ msgstr "Вы можете экспортировать все заказы и к
|
||||
msgid "Debug information"
|
||||
msgstr "Отладочная информация"
|
||||
|
||||
msgid "Debug mode"
|
||||
msgstr "Режим отладки"
|
||||
|
||||
msgid "Enable debug mode in module"
|
||||
msgstr "Активировать режим отладки в модуле"
|
||||
|
||||
msgid "Is required to enable debug mode for advanced logs"
|
||||
msgstr "Требуется включить режим отладки для расширенного логирования"
|
||||
|
||||
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
jQuery(function () {
|
||||
function RetailcrmCronInfo()
|
||||
{
|
||||
this.title = jQuery('h2[id="woocommerce_integration-retailcrm_16"]').get(0);
|
||||
this.title = jQuery('.debug_info_options').get(0)
|
||||
|
||||
if (typeof this.title === 'undefined') {
|
||||
return false;
|
||||
|
@ -533,14 +533,21 @@ abstract class WC_Retailcrm_Abstracts_Settings extends WC_Integration
|
||||
'type' => 'checkbox'
|
||||
);
|
||||
|
||||
$this->form_fields['debug_mode'] = array(
|
||||
'label' => __('Enable debug mode in module', 'retailcrm'),
|
||||
'title' => __('Debug mode', 'retailcrm'),
|
||||
'description' => __('Is required to enable debug mode for advanced logs', 'retailcrm'),
|
||||
'class' => 'checkbox',
|
||||
'type' => 'checkbox'
|
||||
);
|
||||
|
||||
/**
|
||||
* Debug information
|
||||
*/
|
||||
$this->form_fields[] = array(
|
||||
'title' => __('Debug information', 'retailcrm'),
|
||||
'type' => 'heading',
|
||||
'description' => '',
|
||||
'id' => 'cron_info_options'
|
||||
'class' => 'debug_info_options'
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -760,6 +767,7 @@ abstract class WC_Retailcrm_Abstracts_Settings extends WC_Integration
|
||||
'title' => __('Simla.com', 'retailcrm')
|
||||
)
|
||||
);
|
||||
|
||||
$wp_admin_bar->add_menu(
|
||||
array(
|
||||
'id' => 'retailcrm_ajax_generate_icml',
|
||||
@ -769,6 +777,7 @@ abstract class WC_Retailcrm_Abstracts_Settings extends WC_Integration
|
||||
'class' => 'retailcrm_ajax_generate_icml'
|
||||
)
|
||||
);
|
||||
|
||||
$wp_admin_bar->add_menu(
|
||||
array(
|
||||
'id' => 'retailcrm_ajax_generate_setings',
|
||||
|
@ -118,6 +118,7 @@ if (!class_exists('WC_Retailcrm_Base')) {
|
||||
add_action('retailcrm_deactivate', array($this, 'deactivate'));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Init settings fields
|
||||
*/
|
||||
@ -127,6 +128,7 @@ if (!class_exists('WC_Retailcrm_Base')) {
|
||||
$this->init_settings();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $settings
|
||||
*
|
||||
@ -165,6 +167,7 @@ if (!class_exists('WC_Retailcrm_Base')) {
|
||||
return $settings;
|
||||
}
|
||||
|
||||
|
||||
public function generate_icml()
|
||||
{
|
||||
/*
|
||||
@ -219,6 +222,7 @@ if (!class_exists('WC_Retailcrm_Base')) {
|
||||
$retailcrm_history->getHistory();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $order_id
|
||||
*/
|
||||
@ -227,6 +231,7 @@ if (!class_exists('WC_Retailcrm_Base')) {
|
||||
$this->orders->orderCreate($order_id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load stock from retailCRM
|
||||
*/
|
||||
@ -236,6 +241,7 @@ if (!class_exists('WC_Retailcrm_Base')) {
|
||||
$inventories->updateQuantity();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Upload selected orders
|
||||
*
|
||||
@ -246,6 +252,7 @@ if (!class_exists('WC_Retailcrm_Base')) {
|
||||
$this->uploader->uploadSelectedOrders();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Upload archive customers and order to retailCRM
|
||||
*/
|
||||
@ -261,6 +268,7 @@ if (!class_exists('WC_Retailcrm_Base')) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create customer in retailCRM
|
||||
*
|
||||
@ -322,6 +330,7 @@ if (!class_exists('WC_Retailcrm_Base')) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Edit customer in retailCRM
|
||||
* @param int $customer_id
|
||||
@ -339,6 +348,7 @@ if (!class_exists('WC_Retailcrm_Base')) {
|
||||
$this->customers->updateCustomer($customer_id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create order in retailCRM from admin panel
|
||||
*
|
||||
@ -351,6 +361,7 @@ if (!class_exists('WC_Retailcrm_Base')) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Edit order in retailCRM
|
||||
*
|
||||
@ -367,6 +378,7 @@ if (!class_exists('WC_Retailcrm_Base')) {
|
||||
$this->orders->updateOrder($order_id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Init google analytics code
|
||||
*/
|
||||
@ -380,6 +392,7 @@ if (!class_exists('WC_Retailcrm_Base')) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Google analytics send code
|
||||
*/
|
||||
@ -393,6 +406,7 @@ if (!class_exists('WC_Retailcrm_Base')) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Daemon collector
|
||||
*/
|
||||
@ -406,6 +420,7 @@ if (!class_exists('WC_Retailcrm_Base')) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initialize online consultant
|
||||
*/
|
||||
@ -560,6 +575,7 @@ if (!class_exists('WC_Retailcrm_Base')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Deactivate module in marketplace retailCRM
|
||||
*
|
||||
@ -574,6 +590,7 @@ if (!class_exists('WC_Retailcrm_Base')) {
|
||||
delete_option('retailcrm_active_in_crm');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $settings
|
||||
*
|
||||
|
@ -105,8 +105,12 @@ function retailcrm_get_wc_product($id, $settings) {
|
||||
* @return bool
|
||||
*/
|
||||
function retailcrm_is_debug() {
|
||||
return (defined('WP_DEBUG') && WP_DEBUG == true)
|
||||
|| (defined('RCRM_DEBUG') && RCRM_DEBUG == true);
|
||||
|
||||
$options = get_option(WC_Retailcrm_Base::$option_key);
|
||||
|
||||
if (isset($options['debug_mode']) === true && $options['debug_mode'] === WC_Retailcrm_Base::YES) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user