From bf5c98218c192d660e6bdaf2e083b841144ce0d5 Mon Sep 17 00:00:00 2001 From: max-baranikov Date: Tue, 3 Aug 2021 18:39:40 +0300 Subject: [PATCH] Enable and reset web jobs within the settings page --- retailcrm/lib/RetailcrmCli.php | 27 +- retailcrm/lib/RetailcrmTools.php | 2 +- retailcrm/retailcrm.php | 51 +++- retailcrm/views/css/less/styles.less | 34 ++- retailcrm/views/css/styles.min.css | 2 +- retailcrm/views/js/retailcrm-advanced.js | 77 +++++ retailcrm/views/js/retailcrm-advanced.min.js | 38 +++ retailcrm/views/js/retailcrm-export.js | 13 +- retailcrm/views/js/retailcrm.js | 8 + retailcrm/views/js/retailcrm.min.js | 2 +- retailcrm/views/templates/admin/settings.tpl | 281 +++++++++++-------- 11 files changed, 389 insertions(+), 146 deletions(-) create mode 100644 retailcrm/views/js/retailcrm-advanced.js create mode 100644 retailcrm/views/js/retailcrm-advanced.min.js diff --git a/retailcrm/lib/RetailcrmCli.php b/retailcrm/lib/RetailcrmCli.php index 8dbc8fa..0a6385b 100644 --- a/retailcrm/lib/RetailcrmCli.php +++ b/retailcrm/lib/RetailcrmCli.php @@ -118,11 +118,11 @@ class RetailcrmCli } elseif (isset($options['reset-all'])) { $this->resetAll(); } elseif (isset($options['query-web-jobs'])) { - $this->queryWebJobs(); + $this->queryWebJobs($shopId); } elseif (isset($options['run-jobs'])) { RetailcrmTools::startJobManager(); } elseif (isset($options['set-web-jobs'])) { - $this->setWebJobs(self::getBool($options['set-web-jobs'])); + $this->setWebJobs(self::getBool($options['set-web-jobs']), $shopId); } elseif (empty($jobName)) { $this->help(); } else { @@ -245,21 +245,36 @@ class RetailcrmCli * Sets new web jobs state * * @param bool $state + * @param $shopId */ - private function setWebJobs($state) + private function setWebJobs($state, $shopId = null) { + if ($shopId === null) { + RetailcrmLogger::output('You must specify shop id'); + return; + } + + RetailcrmTools::setShopContext($shopId); $this->loadConfiguration(); - Configuration::updateGlobalValue(RetailCRM::ENABLE_WEB_JOBS, $state ? '1' : '0'); + Configuration::updateValue(RetailCRM::ENABLE_WEB_JOBS, $state ? '1' : '0'); RetailcrmLogger::output('Updated web jobs state.'); - $this->queryWebJobs(); + $this->queryWebJobs($shopId); } /** * Prints web jobs status + * + * @param $shopId */ - private function queryWebJobs() + private function queryWebJobs($shopId = null) { + if ($shopId === null) { + RetailcrmLogger::output('You must specify shop id'); + return; + } + + RetailcrmTools::setShopContext($shopId); $this->loadConfiguration(); RetailcrmLogger::output(sprintf( diff --git a/retailcrm/lib/RetailcrmTools.php b/retailcrm/lib/RetailcrmTools.php index 8a3b15e..1a38c27 100644 --- a/retailcrm/lib/RetailcrmTools.php +++ b/retailcrm/lib/RetailcrmTools.php @@ -486,7 +486,7 @@ class RetailcrmTools public static function isWebJobsEnabled() { - return '0' !== Configuration::getGlobalValue(RetailCRM::ENABLE_WEB_JOBS); + return '0' !== Configuration::get(RetailCRM::ENABLE_WEB_JOBS); } /** diff --git a/retailcrm/retailcrm.php b/retailcrm/retailcrm.php index 2e82f0d..c6c946b 100644 --- a/retailcrm/retailcrm.php +++ b/retailcrm/retailcrm.php @@ -81,6 +81,7 @@ class RetailCRM extends Module const CONSULTANT_SCRIPT = 'RETAILCRM_CONSULTANT_SCRIPT'; const CONSULTANT_RCCT = 'RETAILCRM_CONSULTANT_RCCT'; const ENABLE_WEB_JOBS = 'RETAILCRM_ENABLE_WEB_JOBS'; + const RESET_JOBS = 'RETAILCRM_RESET_JOBS'; const JOBS_NAMES = [ 'RetailcrmAbandonedCartsEvent' => 'Abandoned Carts', 'RetailcrmIcmlEvent' => 'Icml generation', @@ -246,6 +247,7 @@ class RetailCRM extends Module Configuration::deleteByName(static::ENABLE_ORDER_NUMBER_SENDING) && Configuration::deleteByName(static::ENABLE_ORDER_NUMBER_RECEIVING) && Configuration::deleteByName(static::ENABLE_DEBUG_MODE) && + Configuration::deleteByName(static::ENABLE_WEB_JOBS) && Configuration::deleteByName('RETAILCRM_LAST_SYNC') && Configuration::deleteByName('RETAILCRM_LAST_ORDERS_SYNC') && Configuration::deleteByName('RETAILCRM_LAST_CUSTOMERS_SYNC') && @@ -289,8 +291,8 @@ class RetailCRM extends Module $exportOrders = (int)(Tools::getValue(static::EXPORT_ORDERS)); $exportCustomers = (int)(Tools::getValue(static::EXPORT_CUSTOMERS)); $updateSinceId = (bool)(Tools::getValue(static::UPDATE_SINCE_ID)); - $logNames = (string)(Tools::getValue(static::DOWNLOAD_LOGS_NAME)); $downloadLogs = (bool)(Tools::getValue(static::DOWNLOAD_LOGS)); + $resetJobs = (bool)(Tools::getValue(static::RESET_JOBS)); if (!empty($ordersIds)) { $output .= $this->uploadOrders(RetailcrmTools::partitionId($ordersIds)); @@ -303,7 +305,9 @@ class RetailCRM extends Module } elseif ($updateSinceId) { return $this->updateSinceId(); } elseif ($downloadLogs) { - return $this->downloadLogs($logNames); + return $this->downloadLogs(); + } elseif ($resetJobs) { + return $this->resetJobs(); } else { $output .= $this->saveSettings(); } @@ -517,12 +521,13 @@ class RetailCRM extends Module return RetailcrmJsonResponse::successfullResponse(); } - public function downloadLogs($name = '') + public function downloadLogs() { if (!Tools::getValue('ajax')) { return false; } + $name = (string)(Tools::getValue(static::DOWNLOAD_LOGS_NAME)); if (!empty($name)) { if (false === ($filePath = RetailcrmLogger::checkFileName($name))) { return false; @@ -558,6 +563,30 @@ class RetailCRM extends Module return true; } + /** + * Resets JobManager and cli internal lock + */ + public function resetJobs() + { + $errors = array(); + try { + if (!RetailcrmJobManager::reset()) { + $errors[] = 'Job manager internal state was NOT cleared.'; + } + if (!RetailcrmCli::clearCurrentJob(null)) { + $errors[] = 'CLI job was NOT cleared'; + } + + if (!empty($errors)) { + return RetailcrmJsonResponse::invalidResponse(implode(' ', $errors)); + } + + return RetailcrmJsonResponse::successfullResponse(); + } catch (\Exception $exception) { + return RetailcrmJsonResponse::invalidResponse($exception->getMessage()); + } + } + public function hookActionCustomerAccountAdd($params) { if ($this->api) { @@ -962,25 +991,26 @@ class RetailCRM extends Module $settings = array( 'url' => rtrim($url, '/'), 'apiKey' => $apiKey, - 'address' => (string)(Tools::getValue(static::API_URL)), + 'address' => (string) (Tools::getValue(static::API_URL)), 'delivery' => json_encode(Tools::getValue(static::DELIVERY)), 'status' => json_encode(Tools::getValue(static::STATUS)), 'payment' => json_encode(Tools::getValue(static::PAYMENT)), 'deliveryDefault' => json_encode(Tools::getValue(static::DELIVERY_DEFAULT)), 'paymentDefault' => json_encode(Tools::getValue(static::PAYMENT_DEFAULT)), - 'statusExport' => (string)(Tools::getValue(static::STATUS_EXPORT)), + 'statusExport' => (string) (Tools::getValue(static::STATUS_EXPORT)), 'enableCorporate' => (Tools::getValue(static::ENABLE_CORPORATE_CLIENTS) !== false), 'enableHistoryUploads' => (Tools::getValue(static::ENABLE_HISTORY_UPLOADS) !== false), 'enableBalancesReceiving' => (Tools::getValue(static::ENABLE_BALANCES_RECEIVING) !== false), 'enableOrderNumberSending' => (Tools::getValue(static::ENABLE_ORDER_NUMBER_SENDING) !== false), 'enableOrderNumberReceiving' => (Tools::getValue(static::ENABLE_ORDER_NUMBER_RECEIVING) !== false), 'debugMode' => (Tools::getValue(static::ENABLE_DEBUG_MODE) !== false), + 'webJobs' => (Tools::getValue(static::ENABLE_WEB_JOBS) !== false ? '1' : '0'), 'collectorActive' => (Tools::getValue(static::COLLECTOR_ACTIVE) !== false), - 'collectorKey' => (string)(Tools::getValue(static::COLLECTOR_KEY)), + 'collectorKey' => (string) (Tools::getValue(static::COLLECTOR_KEY)), 'clientId' => Configuration::get(static::CLIENT_ID), 'synchronizeCartsActive' => (Tools::getValue(static::SYNC_CARTS_ACTIVE) !== false), - 'synchronizedCartStatus' => (string)(Tools::getValue(static::SYNC_CARTS_STATUS)), - 'synchronizedCartDelay' => (string)(Tools::getValue(static::SYNC_CARTS_DELAY)) + 'synchronizedCartStatus' => (string) (Tools::getValue(static::SYNC_CARTS_STATUS)), + 'synchronizedCartDelay' => (string) (Tools::getValue(static::SYNC_CARTS_DELAY)) ); $output .= $this->validateForm($settings, $output); @@ -1005,6 +1035,7 @@ class RetailCRM extends Module Configuration::updateValue(static::SYNC_CARTS_STATUS, $settings['synchronizedCartStatus']); Configuration::updateValue(static::SYNC_CARTS_DELAY, $settings['synchronizedCartDelay']); Configuration::updateValue(static::ENABLE_DEBUG_MODE, $settings['debugMode']); + Configuration::updateValue(static::ENABLE_WEB_JOBS, $settings['webJobs']); $this->apiUrl = $settings['url']; $this->apiKey = $settings['apiKey']; @@ -1384,7 +1415,8 @@ class RetailCRM extends Module 'enableBalancesReceiving' => (bool)(Configuration::get(static::ENABLE_BALANCES_RECEIVING)), 'enableOrderNumberSending' => (bool)(Configuration::get(static::ENABLE_ORDER_NUMBER_SENDING)), 'enableOrderNumberReceiving' => (bool)(Configuration::get(static::ENABLE_ORDER_NUMBER_RECEIVING)), - 'debugMode' => (bool)(Configuration::get(static::ENABLE_DEBUG_MODE)), + 'debugMode' => RetailcrmTools::isDebug(), + 'webJobs' => RetailcrmTools::isWebJobsEnabled() ); } @@ -1419,6 +1451,7 @@ class RetailCRM extends Module 'enableOrderNumberSendingName' => static::ENABLE_ORDER_NUMBER_SENDING, 'enableOrderNumberReceivingName' => static::ENABLE_ORDER_NUMBER_RECEIVING, 'debugModeName' => static::ENABLE_DEBUG_MODE, + 'webJobsName' => static::ENABLE_WEB_JOBS, 'jobsNames' => static::JOBS_NAMES ); } diff --git a/retailcrm/views/css/less/styles.less b/retailcrm/views/css/less/styles.less index 05d9719..913eb45 100644 --- a/retailcrm/views/css/less/styles.less +++ b/retailcrm/views/css/less/styles.less @@ -611,11 +611,17 @@ body, html { td, th { color: #333; font-size: 14px; - line-height: 60px; - padding: 4px 4px 4px 6px; + line-height: 40px; + padding: 4px 6px; max-width: 300px; vertical-align: middle; } + &-wrapper { + width: 100%; + max-height: 500px; + overflow-y: scroll; + overflow-x: hidden; + } &__row { &-bold { font-weight: bold; @@ -627,6 +633,9 @@ body, html { &-center { text-align: center; } + &-right { + text-align: right; + } &-sort { &__btn, &__switch { cursor: pointer; @@ -637,7 +646,7 @@ body, html { &__btn { float: left; clear: both; - line-height: 15px; + line-height: 20px; font-size: 20px; padding-left: 10px; padding-right: 10px; @@ -648,12 +657,10 @@ body, html { } } &__asc { - padding-top: 15px; - padding-bottom: 0; + //padding-bottom: 0; } &__desc { - padding-top: 0; - padding-bottom: 15px; + //padding-top: 0; } & thead th:hover &__btn, & thead td:hover &__btn { opacity: 1; @@ -748,4 +755,17 @@ body, html { color: @blue; } } + &-btn-svg { + width: 15px; + cursor: pointer; + //transition: transform .3s ease-out; + &_wrapper { + cursor: pointer; + &:hover { + //transform: scale(1.1); + fill: @gray; + color: @gray; + } + } + } } diff --git a/retailcrm/views/css/styles.min.css b/retailcrm/views/css/styles.min.css index 421b90b..c256d80 100644 --- a/retailcrm/views/css/styles.min.css +++ b/retailcrm/views/css/styles.min.css @@ -1 +1 @@ -@font-face{font-family:'OpenSans';src:url('../fonts/OpenSans/opensans-regular.eot');src:url('../fonts/OpenSans/opensans-regular.eot?#iefix') format('embedded-opentype'),url('../fonts/OpenSans/opensans-regular.woff2') format('woff2'),url('../fonts/OpenSans/opensans-regular.woff') format('woff'),url('../fonts/OpenSans/opensans-regular.ttf') format('truetype'),url('../fonts/OpenSans/opensans-regular.svg#open_sansregular') format('svg');font-weight:normal;font-style:normal}@font-face{font-family:'OpenSans';src:url('../fonts/OpenSansBold/opensans-bold.eot');src:url('../fonts/OpenSansBold/opensans-bold.eot?#iefix') format('embedded-opentype'),url('../fonts/OpenSansBold/opensans-bold.woff2') format('woff2'),url('../fonts/OpenSansBold/opensans-bold.woff') format('woff'),url('../fonts/OpenSansBold/opensans-bold.ttf') format('truetype'),url('../fonts/OpenSansBold/opensans-bold.svg#open_sansbold') format('svg');font-weight:600;font-style:normal}body,html{margin:0;padding:0;height:100%}.hidden{visibility:hidden}.retail-wrap{font-family:OpenSans,Arial,sans-serif;padding:0 15px;height:100%}.retail-wrap *,.retail-wrap *::before,.retail-wrap *::after{box-sizing:border-box}.retail-container{margin:0 auto;width:100%;max-width:950px}.retail-title{margin:60px 0 0;font-weight:400;text-align:center;font-size:28px;line-height:38px}.retail-title_content{text-align:left;margin-top:40px}.retail-txt{color:#7A7A7A;font-size:18px;line-height:26px}.retail-descript{margin-top:45px;text-align:center}.retail-tab__enabled{display:block}.retail-tab__disabled{display:none !important}.retail-video{margin:30px auto 0;text-align:center;position:relative}.retail-video-trigger{position:absolute;top:0;bottom:0;right:0;left:0;width:100%;height:100%;cursor:pointer}.retail-video iframe{pointer-events:none}.retail-video__btn{position:absolute;left:0;right:0;top:0;bottom:0;margin:auto;width:100px;height:100px;cursor:pointer;opacity:.4;transition:.25s ease}.retail-video__btn svg{width:100%}.retail-video__btn:hover{opacity:.6}.retail-btns{margin:56px auto 0;display:flex;justify-content:space-between;max-width:815px;transition:.05s ease}.retail-btns__separate{padding:0 20px;display:flex;align-items:center;color:#7A7A7A;font-size:16px}.retail-btns_hide{opacity:0}.retail-form{margin-top:60px}.retail-form__title{font-size:16px;font-weight:600;line-height:24px;margin-bottom:22px}.retail-form__title_link{color:#0068FF;transition:.25s ease;float:right}.retail-form__title_link:hover{color:#005add}.retail-form__label{width:100% !important;text-align:left !important;margin:15px 12px;font-size:15px}.retail-form__row{margin-top:15px}.retail-form__row_submit{margin-top:23px}.retail-form__message-warning{padding:13px 18px;margin:1px 13px;border-radius:8px;border:1px solid #fcf3b5;font-size:1rem;box-shadow:0 0 6px 0 #fdd0d0}.retail-form__checkbox{display:flex;flex-direction:row;align-items:center;padding:4px 12px}.retail-form__checkbox input[type=checkbox]{width:24px;height:24px}.retail-form__checkbox label{width:auto;margin-left:8px;font-size:16px}.retail-form__area{display:inline-block !important;vertical-align:top;width:430px !important;height:60px !important;border:1px solid rgba(122,122,122,0.15) !important;box-shadow:none !important;border-radius:58px !important;padding:0 28px !important;line-height:normal;color:#7A7A7A !important;font-size:16px !important;appearance:none}.retail-form__area:focus{color:#363A41}.retail-form__area:focus::-webkit-input-placeholder{color:#363A41}.retail-form__area:focus::-moz-placeholder{color:#363A41}.retail-form__area:focus:-moz-placeholder{color:#363A41}.retail-form__area:focus:-ms-input-placeholder{color:#363A41}.retail-form__area_txt{padding:20px 28px !important;line-height:24px !important;height:487px !important;border-radius:20px !important;resize:none !important;font-family:OpenSans,Arial,sans-serif !important}.retail-form input:focus,.retail-form textarea:focus{outline:none !important}.retail-form_main{margin-top:34px;max-width:900px;width:100%}.retail-form_main .retail-form__area{width:100% !important}.retail-tabs{margin-top:60px}.retail-tabs__btn{display:inline-block;vertical-align:top;padding:19px 30px;font-size:16px;font-weight:600;line-height:22px;color:#7A7A7A;text-align:center;min-width:152px;text-decoration:none !important;position:relative;transition:.25s ease}.retail-tabs__btn:hover{color:#363A41}.retail-tabs__btn::after{content:"";height:3px;width:100%;position:absolute;bottom:-1px;left:0;right:0;opacity:0;visibility:hidden;background:#0068FF;transition:.25s ease}.retail-tabs__btn_active{color:#363A41}.retail-tabs__btn_active::after{opacity:1;visibility:visible}.retail-tabs__head{display:flex;justify-content:space-between;border-bottom:1px solid #DFDFDF}.retail-tabs__body{padding-top:18px}.retail-tabs__body p{margin-top:23px;margin-bottom:0;color:#7A7A7A;font-size:16px;line-height:24px}.retail-tabs__item{display:none}.retail-list{margin:0;padding:0;list-style:none}.retail-list__item{padding-left:2px;position:relative;color:#7A7A7A;font-size:16px;line-height:24px}.retail-list__item::before{content:"-";display:inline-block;vertical-align:top;color:#7A7A7A;font-size:16px;line-height:24px;margin-right:3px}.retail-tile{display:flex;flex-wrap:wrap}.retail-tile__col{width:48%;padding-right:35px}.retail-tile__col:nth-child(1){width:52%}.retail-tile__col_contacts{padding-right:0}.retail-tile__row{display:flex;justify-content:center;margin-bottom:30px}.retail-tile__row:nth-last-child(1){margin-bottom:0}.retail-tile__item{margin-top:34px}.retail-tile__item:nth-child(1){margin-top:20px}.retail-tile__title{color:#363A41;font-size:16px;font-weight:600;line-height:24px}.retail-tile__descript{color:#7A7A7A;font-size:16px;line-height:24px;margin-top:10px}.retail-tile__link{color:#0068FF;font-size:16px;font-weight:600;line-height:24px;transition:.25s ease}.retail-tile__link:hover{color:#005add}.retail-popup{position:absolute;width:90%;height:90%;background:white;left:0;right:0;top:0;bottom:0;margin:auto;transform:translate3d(0, -1000%, 0) scale(.1);transition:.25s ease}.retail-popup__close{position:absolute;top:-30px;right:-30px;width:30px;height:30px;cursor:pointer}.retail-popup__close::before,.retail-popup__close::after{content:"";position:absolute;left:0;right:0;top:0;bottom:0;margin:auto;height:30px;width:2px;background:white}.retail-popup__close::before{transform:rotate(45deg)}.retail-popup__close::after{transform:rotate(-45deg)}.retail-popup.open{transform:translate3d(0, 0, 0) scale(1)}.retail-popup-wrap{position:fixed;left:0;right:0;top:0;bottom:0;background:rgba(0,0,0,0.6);z-index:1000;display:none}.retail-column{display:flex;max-width:1389px;height:100%}.retail-column__aside{width:253px;background:#EAEBEC;min-height:300px}.retail-column__content{flex:1 0 auto;padding:0 58px;min-height:300px}.retail-menu{padding:8px 20px 8px 15px}.retail-menu__btn{display:inline-flex;align-items:center;justify-content:center;vertical-align:top;width:100%;height:60px;background:rgba(122,122,122,0.1) !important;font-weight:bold;font-size:16px;color:#363A41 !important;text-decoration:none !important;padding:0 30px;margin-top:20px;border-radius:5px;text-align:center;transition:.25s ease}.retail-menu__btn span{display:block}.retail-menu__btn:hover{background:rgba(122,122,122,0.15) !important}.retail-menu__btn:nth-child(1){margin-top:0}.retail-menu__btn_active{color:white !important;background:#0068FF !important}.retail-menu__btn_active:hover{background:#005add !important}.retail-menu__btn_active.retail-menu__btn_error{background:#da4932 !important}.retail-menu__btn_error{color:white !important;background:#ff553b !important}.retail-menu__btn_error:hover{background:#da4932 !important}.retail-menu__btn_big{font-size:18px}.retail-menu__btn_hidden{display:none}.retail-full-height{height:100%}.retail .btn{display:inline-block;vertical-align:top;background:rgba(122,122,122,0.1);border-radius:58px;height:60px;line-height:60px;padding:0 30px;font-size:18px;font-weight:600;text-align:center;color:#0068FF;text-decoration:none;cursor:pointer;appearance:none;border:none;box-shadow:none;transition:.25s ease}.retail .btn:hover{background:rgba(122,122,122,0.15)}.retail .btn:active{background:rgba(122,122,122,0.25)}.retail .btn_max{min-width:356px}.retail .btn_invert{background:#0068FF;color:white}.retail .btn_invert:hover{background:#005add}.retail .btn_invert:active{background:#0045aa}.retail .btn_whatsapp{background:#33D16B;color:white;padding:0 62px}.retail .btn_whatsapp:hover{background:#22CA5D}.retail .btn_submit{min-width:218px}.retail .btn_warning{min-width:218px;background:#fcc94f}.retail .btn_warning:hover{background:#edbe4c}.retail .toggle-box{display:none}.retail-table{width:100%;border:none;border-radius:20px}.retail-table thead th{background:rgba(122,122,122,0.15);font-size:16px}.retail-table tbody tr td{border-bottom:1px solid #ccc}.retail-table td,.retail-table th{color:#333;font-size:14px;line-height:60px;padding:4px 4px 4px 6px;max-width:300px;vertical-align:middle}.retail-table__row-bold{font-weight:bold}.retail-table-no-wrap{white-space:nowrap}.retail-table-center{text-align:center}.retail-table-sort__btn,.retail-table-sort__switch{cursor:pointer}.retail-table-sort__btn:hover,.retail-table-sort__switch:hover{color:#005add}.retail-table-sort__btn{float:left;clear:both;line-height:15px;font-size:20px;padding-left:10px;padding-right:10px;opacity:0;transition:opacity .2s ease-out}.retail-table-sort__btn-wrap{position:absolute}.retail-table-sort__asc{padding-top:15px;padding-bottom:0}.retail-table-sort__desc{padding-top:0;padding-bottom:15px}.retail-table-sort thead th:hover .retail-table-sort__btn,.retail-table-sort thead td:hover .retail-table-sort__btn{opacity:1}.retail-collapsible__input{display:none}label.retail-collapsible__title{cursor:pointer;font-weight:normal;text-align:center;padding:0;position:relative;line-height:1;width:100%}label.retail-collapsible__title:before{content:'\25B6';opacity:0;transition:opacity .2s ease-out}label.retail-collapsible__title:hover:before{opacity:1}.retail-collapsible__content{text-align:left;font-size:12px;line-height:1.5;background:#fff;border:1px solid rgba(122,122,122,0.15);position:absolute;z-index:5;top:20px;left:0;padding:18px;margin:0;border-radius:20px;overflow:hidden;max-height:0;transition-duration:.2s;transition-timing-function:ease-out;transition-property:max-height,visibility;visibility:hidden}.retail-collapsible__input:checked+.retail-collapsible__title .retail-collapsible__content{max-height:100vh;visibility:visible}.retail-error-msg,.retail-error-msg:after,.retail-error-msg:before{color:#dd2e44}.retail-alert{position:relative;height:60px;padding:0 50px;line-height:30px}.retail-alert-text{font-size:1.5em}.retail-alert-note{color:#7A7A7A;font-size:1.2em}.retail-alert:before{display:block;position:absolute;left:0;top:0;padding:10px 5px;font:normal normal normal 40px/1 FontAwesome}.retail-alert-success:before{content:"\F058";color:#33D16B}.retail-alert-warning:before{content:"\F06A";color:#fcc94f}.retail-alert-danger:before{content:"\F071";color:#ff553b}.retail-alert-info:before{content:"\F059";color:#0068FF} \ No newline at end of file +@font-face{font-family:'OpenSans';src:url('../fonts/OpenSans/opensans-regular.eot');src:url('../fonts/OpenSans/opensans-regular.eot?#iefix') format('embedded-opentype'),url('../fonts/OpenSans/opensans-regular.woff2') format('woff2'),url('../fonts/OpenSans/opensans-regular.woff') format('woff'),url('../fonts/OpenSans/opensans-regular.ttf') format('truetype'),url('../fonts/OpenSans/opensans-regular.svg#open_sansregular') format('svg');font-weight:normal;font-style:normal}@font-face{font-family:'OpenSans';src:url('../fonts/OpenSansBold/opensans-bold.eot');src:url('../fonts/OpenSansBold/opensans-bold.eot?#iefix') format('embedded-opentype'),url('../fonts/OpenSansBold/opensans-bold.woff2') format('woff2'),url('../fonts/OpenSansBold/opensans-bold.woff') format('woff'),url('../fonts/OpenSansBold/opensans-bold.ttf') format('truetype'),url('../fonts/OpenSansBold/opensans-bold.svg#open_sansbold') format('svg');font-weight:600;font-style:normal}body,html{margin:0;padding:0;height:100%}.hidden{visibility:hidden}.retail-wrap{font-family:OpenSans,Arial,sans-serif;padding:0 15px;height:100%}.retail-wrap *,.retail-wrap *::before,.retail-wrap *::after{box-sizing:border-box}.retail-container{margin:0 auto;width:100%;max-width:950px}.retail-title{margin:60px 0 0;font-weight:400;text-align:center;font-size:28px;line-height:38px}.retail-title_content{text-align:left;margin-top:40px}.retail-txt{color:#7A7A7A;font-size:18px;line-height:26px}.retail-descript{margin-top:45px;text-align:center}.retail-tab__enabled{display:block}.retail-tab__disabled{display:none !important}.retail-video{margin:30px auto 0;text-align:center;position:relative}.retail-video-trigger{position:absolute;top:0;bottom:0;right:0;left:0;width:100%;height:100%;cursor:pointer}.retail-video iframe{pointer-events:none}.retail-video__btn{position:absolute;left:0;right:0;top:0;bottom:0;margin:auto;width:100px;height:100px;cursor:pointer;opacity:.4;transition:.25s ease}.retail-video__btn svg{width:100%}.retail-video__btn:hover{opacity:.6}.retail-btns{margin:56px auto 0;display:flex;justify-content:space-between;max-width:815px;transition:.05s ease}.retail-btns__separate{padding:0 20px;display:flex;align-items:center;color:#7A7A7A;font-size:16px}.retail-btns_hide{opacity:0}.retail-form{margin-top:60px}.retail-form__title{font-size:16px;font-weight:600;line-height:24px;margin-bottom:22px}.retail-form__title_link{color:#0068FF;transition:.25s ease;float:right}.retail-form__title_link:hover{color:#005add}.retail-form__label{width:100% !important;text-align:left !important;margin:15px 12px;font-size:15px}.retail-form__row{margin-top:15px}.retail-form__row_submit{margin-top:23px}.retail-form__message-warning{padding:13px 18px;margin:1px 13px;border-radius:8px;border:1px solid #fcf3b5;font-size:1rem;box-shadow:0 0 6px 0 #fdd0d0}.retail-form__checkbox{display:flex;flex-direction:row;align-items:center;padding:4px 12px}.retail-form__checkbox input[type=checkbox]{width:24px;height:24px}.retail-form__checkbox label{width:auto;margin-left:8px;font-size:16px}.retail-form__area{display:inline-block !important;vertical-align:top;width:430px !important;height:60px !important;border:1px solid rgba(122,122,122,0.15) !important;box-shadow:none !important;border-radius:58px !important;padding:0 28px !important;line-height:normal;color:#7A7A7A !important;font-size:16px !important;appearance:none}.retail-form__area:focus{color:#363A41}.retail-form__area:focus::-webkit-input-placeholder{color:#363A41}.retail-form__area:focus::-moz-placeholder{color:#363A41}.retail-form__area:focus:-moz-placeholder{color:#363A41}.retail-form__area:focus:-ms-input-placeholder{color:#363A41}.retail-form__area_txt{padding:20px 28px !important;line-height:24px !important;height:487px !important;border-radius:20px !important;resize:none !important;font-family:OpenSans,Arial,sans-serif !important}.retail-form input:focus,.retail-form textarea:focus{outline:none !important}.retail-form_main{margin-top:34px;max-width:900px;width:100%}.retail-form_main .retail-form__area{width:100% !important}.retail-tabs{margin-top:60px}.retail-tabs__btn{display:inline-block;vertical-align:top;padding:19px 30px;font-size:16px;font-weight:600;line-height:22px;color:#7A7A7A;text-align:center;min-width:152px;text-decoration:none !important;position:relative;transition:.25s ease}.retail-tabs__btn:hover{color:#363A41}.retail-tabs__btn::after{content:"";height:3px;width:100%;position:absolute;bottom:-1px;left:0;right:0;opacity:0;visibility:hidden;background:#0068FF;transition:.25s ease}.retail-tabs__btn_active{color:#363A41}.retail-tabs__btn_active::after{opacity:1;visibility:visible}.retail-tabs__head{display:flex;justify-content:space-between;border-bottom:1px solid #DFDFDF}.retail-tabs__body{padding-top:18px}.retail-tabs__body p{margin-top:23px;margin-bottom:0;color:#7A7A7A;font-size:16px;line-height:24px}.retail-tabs__item{display:none}.retail-list{margin:0;padding:0;list-style:none}.retail-list__item{padding-left:2px;position:relative;color:#7A7A7A;font-size:16px;line-height:24px}.retail-list__item::before{content:"-";display:inline-block;vertical-align:top;color:#7A7A7A;font-size:16px;line-height:24px;margin-right:3px}.retail-tile{display:flex;flex-wrap:wrap}.retail-tile__col{width:48%;padding-right:35px}.retail-tile__col:nth-child(1){width:52%}.retail-tile__col_contacts{padding-right:0}.retail-tile__row{display:flex;justify-content:center;margin-bottom:30px}.retail-tile__row:nth-last-child(1){margin-bottom:0}.retail-tile__item{margin-top:34px}.retail-tile__item:nth-child(1){margin-top:20px}.retail-tile__title{color:#363A41;font-size:16px;font-weight:600;line-height:24px}.retail-tile__descript{color:#7A7A7A;font-size:16px;line-height:24px;margin-top:10px}.retail-tile__link{color:#0068FF;font-size:16px;font-weight:600;line-height:24px;transition:.25s ease}.retail-tile__link:hover{color:#005add}.retail-popup{position:absolute;width:90%;height:90%;background:white;left:0;right:0;top:0;bottom:0;margin:auto;transform:translate3d(0, -1000%, 0) scale(.1);transition:.25s ease}.retail-popup__close{position:absolute;top:-30px;right:-30px;width:30px;height:30px;cursor:pointer}.retail-popup__close::before,.retail-popup__close::after{content:"";position:absolute;left:0;right:0;top:0;bottom:0;margin:auto;height:30px;width:2px;background:white}.retail-popup__close::before{transform:rotate(45deg)}.retail-popup__close::after{transform:rotate(-45deg)}.retail-popup.open{transform:translate3d(0, 0, 0) scale(1)}.retail-popup-wrap{position:fixed;left:0;right:0;top:0;bottom:0;background:rgba(0,0,0,0.6);z-index:1000;display:none}.retail-column{display:flex;max-width:1389px;height:100%}.retail-column__aside{width:253px;background:#EAEBEC;min-height:300px}.retail-column__content{flex:1 0 auto;padding:0 58px;min-height:300px}.retail-menu{padding:8px 20px 8px 15px}.retail-menu__btn{display:inline-flex;align-items:center;justify-content:center;vertical-align:top;width:100%;height:60px;background:rgba(122,122,122,0.1) !important;font-weight:bold;font-size:16px;color:#363A41 !important;text-decoration:none !important;padding:0 30px;margin-top:20px;border-radius:5px;text-align:center;transition:.25s ease}.retail-menu__btn span{display:block}.retail-menu__btn:hover{background:rgba(122,122,122,0.15) !important}.retail-menu__btn:nth-child(1){margin-top:0}.retail-menu__btn_active{color:white !important;background:#0068FF !important}.retail-menu__btn_active:hover{background:#005add !important}.retail-menu__btn_active.retail-menu__btn_error{background:#da4932 !important}.retail-menu__btn_error{color:white !important;background:#ff553b !important}.retail-menu__btn_error:hover{background:#da4932 !important}.retail-menu__btn_big{font-size:18px}.retail-menu__btn_hidden{display:none}.retail-full-height{height:100%}.retail .btn{display:inline-block;vertical-align:top;background:rgba(122,122,122,0.1);border-radius:58px;height:60px;line-height:60px;padding:0 30px;font-size:18px;font-weight:600;text-align:center;color:#0068FF;text-decoration:none;cursor:pointer;appearance:none;border:none;box-shadow:none;transition:.25s ease}.retail .btn:hover{background:rgba(122,122,122,0.15)}.retail .btn:active{background:rgba(122,122,122,0.25)}.retail .btn_max{min-width:356px}.retail .btn_invert{background:#0068FF;color:white}.retail .btn_invert:hover{background:#005add}.retail .btn_invert:active{background:#0045aa}.retail .btn_whatsapp{background:#33D16B;color:white;padding:0 62px}.retail .btn_whatsapp:hover{background:#22CA5D}.retail .btn_submit{min-width:218px}.retail .btn_warning{min-width:218px;background:#fcc94f}.retail .btn_warning:hover{background:#edbe4c}.retail .toggle-box{display:none}.retail-table{width:100%;border:none;border-radius:20px}.retail-table thead th{background:rgba(122,122,122,0.15);font-size:16px}.retail-table tbody tr td{border-bottom:1px solid #ccc}.retail-table td,.retail-table th{color:#333;font-size:14px;line-height:40px;padding:4px 6px;max-width:300px;vertical-align:middle}.retail-table-wrapper{width:100%;max-height:500px;overflow-y:scroll;overflow-x:hidden}.retail-table__row-bold{font-weight:bold}.retail-table-no-wrap{white-space:nowrap}.retail-table-center{text-align:center}.retail-table-right{text-align:right}.retail-table-sort__btn,.retail-table-sort__switch{cursor:pointer}.retail-table-sort__btn:hover,.retail-table-sort__switch:hover{color:#005add}.retail-table-sort__btn{float:left;clear:both;line-height:20px;font-size:20px;padding-left:10px;padding-right:10px;opacity:0;transition:opacity .2s ease-out}.retail-table-sort__btn-wrap{position:absolute}.retail-table-sort thead th:hover .retail-table-sort__btn,.retail-table-sort thead td:hover .retail-table-sort__btn{opacity:1}.retail-collapsible__input{display:none}label.retail-collapsible__title{cursor:pointer;font-weight:normal;text-align:center;padding:0;position:relative;line-height:1;width:100%}label.retail-collapsible__title:before{content:'\25B6';opacity:0;transition:opacity .2s ease-out}label.retail-collapsible__title:hover:before{opacity:1}.retail-collapsible__content{text-align:left;font-size:12px;line-height:1.5;background:#fff;border:1px solid rgba(122,122,122,0.15);position:absolute;z-index:5;top:20px;left:0;padding:18px;margin:0;border-radius:20px;overflow:hidden;max-height:0;transition-duration:.2s;transition-timing-function:ease-out;transition-property:max-height,visibility;visibility:hidden}.retail-collapsible__input:checked+.retail-collapsible__title .retail-collapsible__content{max-height:100vh;visibility:visible}.retail-error-msg,.retail-error-msg:after,.retail-error-msg:before{color:#dd2e44}.retail-alert{position:relative;height:60px;padding:0 50px;line-height:30px}.retail-alert-text{font-size:1.5em}.retail-alert-note{color:#7A7A7A;font-size:1.2em}.retail-alert:before{display:block;position:absolute;left:0;top:0;padding:10px 5px;font:normal normal normal 40px/1 FontAwesome}.retail-alert-success:before{content:"\F058";color:#33D16B}.retail-alert-warning:before{content:"\F06A";color:#fcc94f}.retail-alert-danger:before{content:"\F071";color:#ff553b}.retail-alert-info:before{content:"\F059";color:#0068FF}.retail-btn-svg{width:15px;cursor:pointer}.retail-btn-svg_wrapper{cursor:pointer}.retail-btn-svg_wrapper:hover{fill:#7A7A7A;color:#7A7A7A} \ No newline at end of file diff --git a/retailcrm/views/js/retailcrm-advanced.js b/retailcrm/views/js/retailcrm-advanced.js new file mode 100644 index 0000000..6c02e60 --- /dev/null +++ b/retailcrm/views/js/retailcrm-advanced.js @@ -0,0 +1,77 @@ +/** + * MIT License + * + * Copyright (c) 2020 DIGITAL RETAIL TECHNOLOGIES SL + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade PrestaShop to newer + * versions in the future. If you wish to customize PrestaShop for your + * needs please refer to http://www.prestashop.com for more information. + * + * @author DIGITAL RETAIL TECHNOLOGIES SL + * @copyright 2020 DIGITAL RETAIL TECHNOLOGIES SL + * @license https://opensource.org/licenses/MIT The MIT License + * + * Don't forget to prefix your containers with your own identifier + * to avoid any conflicts with others containers. + */ +$(function () { + function RetailcrmAdvancedSettings() { + this.resetButton = $('input[id="reset-jobs-submit"]').get(0); + this.form = $(this.resetButton).closest('form').get(0); + + this.resetAction = this.resetAction.bind(this); + + $(this.resetButton).click(this.resetAction); + } + + RetailcrmAdvancedSettings.prototype.resetAction = function (event) { + event.preventDefault(); + + this.resetButton.disabled = true; + let data = { + submitretailcrm: 1, + ajax: 1, + RETAILCRM_RESET_JOBS: 1 + }; + + let _this = this; + + $.ajax({ + url: this.form.action, + method: this.form.method, + timeout: 0, + data: data, + dataType: 'json', + }) + .done(function (response) { + alert('Reset completed successfully') + _this.resetButton.disabled = false; + }) + .fail(function (error) { + alert('Error: ' + error.responseJSON.errorMsg); + _this.resetButton.disabled = false; + }) + } + + window.RetailcrmAdvancedSettings = RetailcrmAdvancedSettings; +}); diff --git a/retailcrm/views/js/retailcrm-advanced.min.js b/retailcrm/views/js/retailcrm-advanced.min.js new file mode 100644 index 0000000..6a260db --- /dev/null +++ b/retailcrm/views/js/retailcrm-advanced.min.js @@ -0,0 +1,38 @@ +/** + * MIT License + * + * Copyright (c) 2020 DIGITAL RETAIL TECHNOLOGIES SL + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade PrestaShop to newer + * versions in the future. If you wish to customize PrestaShop for your + * needs please refer to http://www.prestashop.com for more information. + * + * @author DIGITAL RETAIL TECHNOLOGIES SL + * @copyright 2020 DIGITAL RETAIL TECHNOLOGIES SL + * @license https://opensource.org/licenses/MIT The MIT License + * + * Don't forget to prefix your containers with your own identifier + * to avoid any conflicts with others containers. + */ +$(function(){function t(){this.resetButton=$('input[id="reset-jobs-submit"]').get(0),this.form=$(this.resetButton).closest("form").get(0),this.resetAction=this.resetAction.bind(this),$(this.resetButton).click(this.resetAction)}t.prototype.resetAction=function(t){t.preventDefault(),this.resetButton.disabled=!0;let e=this;$.ajax({url:this.form.action,method:this.form.method,timeout:0,data:{submitretailcrm:1,ajax:1,RETAILCRM_RESET_JOBS:1},dataType:"json"}).done(function(t){alert("Reset completed successfully"),e.resetButton.disabled=!1}).fail(function(t){alert("Error: "+t.responseJSON.errorMsg),e.resetButton.disabled=!1})},window.RetailcrmAdvancedSettings=t}); +//# sourceMappingURL=retailcrm-advanced.min.js.map \ No newline at end of file diff --git a/retailcrm/views/js/retailcrm-export.js b/retailcrm/views/js/retailcrm-export.js index 2be10c8..4d2348b 100644 --- a/retailcrm/views/js/retailcrm-export.js +++ b/retailcrm/views/js/retailcrm-export.js @@ -35,7 +35,8 @@ * to avoid any conflicts with others containers. */ $(function () { - function RetailcrmExportForm() { + function RetailcrmExportForm() + { this.form = $('input[name=RETAILCRM_EXPORT_ORDERS_COUNT]').closest('form').get(0); if (typeof this.form === 'undefined') { @@ -96,8 +97,8 @@ $(function () { data: data }) .done(function (response) { - if(_this.isDone) { - return _this.exportDone(); + if (_this.isDone) { + return _this.exportDone(); } _this.updateProgressBar(); @@ -116,12 +117,14 @@ $(function () { RetailcrmExportForm.prototype.updateProgressBar = function () { let processedOrders = this.ordersStep * this.ordersStepSize; - if (processedOrders > this.ordersCount) + if (processedOrders > this.ordersCount) { processedOrders = this.ordersCount; + } let processedCustomers = this.customersStep * this.customersStepSize; - if (processedCustomers > this.customersCount) + if (processedCustomers > this.customersCount) { processedCustomers = this.customersCount; + } const processed = processedOrders + processedCustomers; const total = this.ordersCount + this.customersCount; diff --git a/retailcrm/views/js/retailcrm.js b/retailcrm/views/js/retailcrm.js index f62a05f..682171e 100644 --- a/retailcrm/views/js/retailcrm.js +++ b/retailcrm/views/js/retailcrm.js @@ -43,6 +43,7 @@ $(function(){ this.player.init(); this.tabs.init(); this.eventForm.init(this.settingsTabs.init()); + this.advancedSettings.init(); this.popup.init(); this.toggleBox(); this.trimConsultant(); @@ -240,6 +241,13 @@ $(function(){ } }, }, + advancedSettings: { + init: function () { + if (!(typeof RetailcrmAdvancedSettings === 'undefined')) { + new RetailcrmAdvancedSettings(); + } + } + }, tabs: { init: function () { $('.retail-tabs__btn').on('click', this.swithTab); diff --git a/retailcrm/views/js/retailcrm.min.js b/retailcrm/views/js/retailcrm.min.js index dbd2866..bfed8d8 100644 --- a/retailcrm/views/js/retailcrm.min.js +++ b/retailcrm/views/js/retailcrm.min.js @@ -34,5 +34,5 @@ * Don't forget to prefix your containers with your own identifier * to avoid any conflicts with others containers. */ -$(function(){var i={init:function(){this.selects.init(),this.tableSort.init(),this.player.init(),this.tabs.init(),this.eventForm.init(this.settingsTabs.init()),this.popup.init(),this.toggleBox(),this.trimConsultant(),this.showSettings()},selects:{init:function(){var t=this;try{$(".jq-select").SumoSelect(),$("li.opt").each((t,e)=>{if(0===$(e).find("label").html().length){let t=$(e).closest("ul").closest("div").parent().find("select");$(e).find("label").html(t.attr("placeholder")),$(e).addClass("disabled")}}),t.update(),$(document).on("change",".jq-select",function(){t.update()})}catch(t){console.warn("Cannot initialize select: "+t.message)}},update:function(){var n={};let t=$(".retail-tab__enabled").find("select:not(#RETAILCRM_API_DELIVERY_DEFAULT, #RETAILCRM_API_PAYMENT_DEFAULT)");t.each((t,e)=>{var a=$(e).val();a&&a.length&&(n[t]=$('option[value="'+$(e).val()+'"]',$(e)).index())});let s=Object.values(n);t.each((a,i)=>{$("option",i).each((t,e)=>{-1===$.inArray(t,s)||void 0!==n[a]&&n[a]==t?i.sumo.enableItem(t):i.sumo.disableItem(t)})})}},tableSort:{init:function(){var n=this;$(".retail-table-sort").each((t,i)=>{$(i).find(".retail-table-sort__switch").each((t,e)=>{const a=$(e).closest("th,td").index();$(e).click(t=>{t.preventDefault(),n.sort(i,a)})}),$(i).find(".retail-table-sort__asc").each((t,e)=>{const a=$(e).closest("th,td").index();$(e).click(t=>{t.preventDefault(),n.sort(i,a,"asc")})}),$(i).find(".retail-table-sort__desc").each((t,e)=>{const a=$(e).closest("th,td").index();$(e).click(t=>{t.preventDefault(),n.sort(i,a,"desc")})}),$(i).find(".retail-table-sort__initial").click()})},sort:function(t,e,a=void 0){let i,n,s,r,o,l,c,d=0;for(n=!0,c=a||"asc";n;){for(n=!1,i=t.rows,s=1;so.innerHTML.toLowerCase()){l=!0;break}}else if("desc"===c&&r.innerHTML.toLowerCase(){if(0===$(e).find("label").html().length){let t=$(e).closest("ul").closest("div").parent().find("select");$(e).find("label").html(t.attr("placeholder")),$(e).addClass("disabled")}}),t.update(),$(document).on("change",".jq-select",function(){t.update()})}catch(t){console.warn("Cannot initialize select: "+t.message)}},update:function(){var n={};let t=$(".retail-tab__enabled").find("select:not(#RETAILCRM_API_DELIVERY_DEFAULT, #RETAILCRM_API_PAYMENT_DEFAULT)");t.each((t,e)=>{var i=$(e).val();i&&i.length&&(n[t]=$('option[value="'+$(e).val()+'"]',$(e)).index())});let s=Object.values(n);t.each((i,a)=>{$("option",a).each((t,e)=>{-1===$.inArray(t,s)||void 0!==n[i]&&n[i]==t?a.sumo.enableItem(t):a.sumo.disableItem(t)})})}},tableSort:{init:function(){var n=this;$(".retail-table-sort").each((t,a)=>{$(a).find(".retail-table-sort__switch").each((t,e)=>{const i=$(e).closest("th,td").index();$(e).click(t=>{t.preventDefault(),n.sort(a,i)})}),$(a).find(".retail-table-sort__asc").each((t,e)=>{const i=$(e).closest("th,td").index();$(e).click(t=>{t.preventDefault(),n.sort(a,i,"asc")})}),$(a).find(".retail-table-sort__desc").each((t,e)=>{const i=$(e).closest("th,td").index();$(e).click(t=>{t.preventDefault(),n.sort(a,i,"desc")})}),$(a).find(".retail-table-sort__initial").click()})},sort:function(t,e,i=void 0){let a,n,s,r,o,l,c,d=0;for(n=!0,c=i||"asc";n;){for(n=!1,a=t.rows,s=1;so.innerHTML.toLowerCase()){l=!0;break}}else if("desc"===c&&r.innerHTML.toLowerCase()
+ style="height: 60px; margin-bottom: 20px; margin-top: 50px; clear:both;"> @@ -385,138 +385,186 @@
{l s='Advanced' mod='retailcrm'}
-
- -
- +
+ +
+
+ +
+
- - - - - - - - - - - {foreach from=$lastRunDetails key=key item=item} - - - - + + + {/foreach} + +
- {l s='Job name' mod='retailcrm'} -
- - -
- {l s='Last Run' mod='retailcrm'}
- {l s='Status' mod='retailcrm'} - {l s='Comment' mod='retailcrm'}
- {if isset($jobsNames[$key]) } - {l s=$jobsNames[$key] mod='retailcrm'} - {else} - {$key|escape:'htmlall':'UTF-8'} - {/if} - {if isset($item['lastRun'])}{$item['lastRun']|date_format:'Y-m-d H:i:s'|escape:'htmlall':'UTF-8'}{/if} - {if $key === $currentJob || $key === $currentJobCli} - - {else} - {if isset($item['success'])} - {if $item['success'] === true} - - {else} - +
+ + + + + + + + + + + {foreach from=$lastRunDetails key=key item=item} + + + + - - - {/foreach} - -
+ {l s='Job name' mod='retailcrm'} +
+ + +
+ {l s='Last Run' mod='retailcrm'} +
+ {l s='Status' mod='retailcrm'} + {l s='Comment' mod='retailcrm'}
+ {if isset($jobsNames[$key]) } + {l s=$jobsNames[$key] mod='retailcrm'} + {else} + {$key|escape:'htmlall':'UTF-8'} + {/if} + {if isset($item['lastRun'])}{$item['lastRun']|date_format:'Y-m-d H:i:s'|escape:'htmlall':'UTF-8'}{/if} + {if $key === $currentJob || $key === $currentJobCli} + + {else} + {if isset($item['success'])} + {if $item['success'] === true} + + {else} + + {/if} {/if} {/if} - {/if} - - {if isset($item['error']['message'])} - - - {/if} -
+
+ {if isset($item['error']['message'])} + + + {/if} +
+
+
+ +
+
+ +
- - - - - - - - - - - {foreach from=$retailcrmLogsInfo key=key item=logItem} - - - - - +
+
{l s='File name' mod='retailcrm'} -
- - -
- {l s='Modified date' mod='retailcrm'} -
-
- - -
- {l s='Size' mod='retailcrm'} -
{l s='Actions' mod='retailcrm'}
{$logItem.name|escape:'htmlall':'UTF-8'}{$logItem.modified|escape:'htmlall':'UTF-8'}{$logItem.size|escape:'htmlall':'UTF-8'} -
- - - - -
-
+ + + + + + - {/foreach} - - - - - -
{l s='File name' mod='retailcrm'} +
+ + +
+ {l s='Modified date' mod='retailcrm'} +
+
+ + +
+ {l s='Size' mod='retailcrm'} +
{l s='Actions' mod='retailcrm'}
-
- - - -
-
- + + + {foreach from=$retailcrmLogsInfo key=key item=logItem} + + {$logItem.name|escape:'htmlall':'UTF-8'} + {$logItem.modified|escape:'htmlall':'UTF-8'} + {$logItem.size|escape:'htmlall':'UTF-8'} + +
+ + + + + +
+ + + {/foreach} + + +
+
+
+ + + +
+
@@ -533,4 +581,5 @@ +