diff --git a/classes/Tools.php b/classes/Tools.php index b2125148f..8557b5151 100644 --- a/classes/Tools.php +++ b/classes/Tools.php @@ -3449,8 +3449,8 @@ exit; $post_data .= (isset($params['controller']) ? $params['controller'] : Context::getContext()->controller->controller_name); $post_data .= defined('_PS_HOST_MODE_') ? '-od' : ''; break; - case 'notification': - $post_data .= '&method=notification&data='.urlencode(json_encode($params['notification_data'])); + case 'register-install': + $post_data .= '&method=register-install&data='.urlencode(json_encode($params['install_data'])); break; case 'check-version': $post_data .= '&method=check-version&autoupgrade='.(int)(Module::isInstalled('qloautoupgrade') && Module::isEnabled('qloautoupgrade')); diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index edb3065b1..4723e29a1 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -3003,6 +3003,12 @@ class AdminControllerCore extends Controller Media::addJsDef(array('host_cluster' => defined('_PS_HOST_CLUSTER_') ? _PS_HOST_CLUSTER_ : 'fr1')); } + // upgrade info is read from cache only, the cache is refreshed in background by ajaxProcessCheckUpgrade() + Media::addJsDef(array( + 'upgrade_check_needed' => !Tools::isFresh(Upgrader::CACHE_FILE_UPGRADE_AVAILABE, _TIME_1_DAY_), + 'upgrade_check_url' => 'index.php?controller='.$this->controller_name.'&ajax=1&action=checkUpgrade&token='.$this->token, + )); + // Execute Hook AdminController SetMedia Hook::exec('actionAdminControllerSetMedia'); } @@ -3112,10 +3118,6 @@ class AdminControllerCore extends Controller )); // get upgrade available info from cache only, the cache is refreshed in background by ajaxProcessCheckUpgrade() - Media::addJsDef(array( - 'upgrade_check_needed' => !Tools::isFresh(Upgrader::CACHE_FILE_UPGRADE_AVAILABE, _TIME_1_DAY_), - 'upgrade_check_url' => 'index.php?controller='.$this->controller_name.'&ajax=1&action=checkUpgrade&token='.$this->token, - )); if (file_exists(_PS_ROOT_DIR_.Upgrader::CACHE_FILE_UPGRADE_AVAILABE)) { $content = Tools::file_get_contents( _PS_ROOT_DIR_.Upgrader::CACHE_FILE_UPGRADE_AVAILABE); $upgradeInfo = simplexml_load_string($content); diff --git a/install-dev/controllers/http/configure.php b/install-dev/controllers/http/configure.php index 990f19f78..c4a7101a4 100644 --- a/install-dev/controllers/http/configure.php +++ b/install-dev/controllers/http/configure.php @@ -64,7 +64,7 @@ class InstallControllerHttpConfigure extends InstallControllerHttp 'marketingConsent' => Tools::getValue('marketing_consent'), ]; $objModelInstall = new InstallModelInstall(); - $objModelInstall->setNotification($qloData); + $objModelInstall->registerInstall($qloData); // END } diff --git a/install-dev/models/install.php b/install-dev/models/install.php index 145f4989f..c72f1ae78 100644 --- a/install-dev/models/install.php +++ b/install-dev/models/install.php @@ -622,27 +622,27 @@ class InstallModelInstall extends InstallAbstractModel 'marketingConsent' => $data['marketing_consent'], ]; - // Qlo Notification - $this->setNotification($qloData); + // Register install + $this->registerInstall($qloData); return true; } /** - * @param array $notificationData + * @param array $installData * @return bool */ - public function setNotification($notificationData) + public function registerInstall($installData) { - Tools::addonsRequest('notification', array( - 'notification_data' => $notificationData, + Tools::addonsRequest('register-install', array( + 'install_data' => $installData, 'version' => _QLO_INSTALL_VERSION_, 'iso_lang' => $this->language->getLanguageIso(), - 'iso_country' => $notificationData['countryCode'], - 'shop_url' => $notificationData['shopDomain'], - 'shop_url_ssl' => $notificationData['shopDomainSsl'], - 'physical_uri' => $notificationData['physicalUri'], - 'email' => $notificationData['email'], + 'iso_country' => $installData['countryCode'], + 'shop_url' => $installData['shopDomain'], + 'shop_url_ssl' => $installData['shopDomainSsl'], + 'physical_uri' => $installData['physicalUri'], + 'email' => $installData['email'], )); return true;