Esempio n. 1
0
 public static function executeCronTask()
 {
     $ts_module = new TrustedShops();
     $ts_common = new TSCommon();
     $common_count = 0;
     if (is_array(TSCommon::$available_languages)) {
         $to_remove = array();
         foreach (array_keys(TSCommon::$available_languages) as $iso) {
             $alerts_infos = RatingAlert::getAlertsInformations($iso);
             ///print_r($alerts_infos);
             if ($alerts_infos != false) {
                 $common_count += count($alerts_infos);
                 foreach ($alerts_infos as $infos) {
                     $cert = Configuration::get(TSCommon::PREFIX_TABLE . 'CERTIFICATE_' . Tools::strtoupper($infos['iso']));
                     $certificate = (array) Tools::jsonDecode(Tools::htmlentitiesDecodeUTF8($cert));
                     $subject = $ts_module->l('title_part_1') . ' ' . Configuration::get('PS_SHOP_NAME') . $ts_module->l('title_part_2');
                     $template_vars = array('{ts_id}' => $certificate['tsID'], '{button_url}' => TSCommon::getHttpHost(true, true) . _MODULE_DIR_ . $ts_module->name . '/views/img', '{rating_url}' => $ts_common->getRatingUrlWithBuyerEmail($infos['id_lang'], $infos['id_order'], $infos['email']));
                     $result = Mail::Send((int) $infos['id_lang'], self::MAIL_TEMPLATE, $subject, $template_vars, $infos['email'], null, Configuration::get('PS_SHOP_EMAIL'), Configuration::get('PS_SHOP_NAME'), null, null, dirname(__FILE__) . '/../mails/');
                     if ($result) {
                         $to_remove[] = (int) $infos['id_alert'];
                     }
                 }
             }
         }
         if (count($to_remove) > 0) {
             self::removeAlerts($to_remove);
         }
     }
     return count($to_remove) == $common_count;
 }
Esempio n. 2
0
<?php

/**
 * 2014 silbersaiten The module is based on the trustedshops module originally developed by PrestaShop
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to support@silbersaiten.de so we can send you a copy immediately.
 *
 * @author    silbersaiten www.silbersaiten.de <*****@*****.**>
 * @copyright 2014 silbersaiten
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
 */
include dirname(__FILE__) . '/../../config/config.inc.php';
include dirname(__FILE__) . '/../../init.php';
include dirname(__FILE__) . '/trustedshops.php';
if (Tools::getIsset('secure_key') && Tools::getValue('secure_key') != '' && Configuration::get(TSCommon::PREFIX_TABLE . 'SECURE_KEY') == Tools::getValue('secure_key')) {
    $ts_module = new TrustedShops();
    TSCommon::setTranslationObject($ts_module);
    $bp = new TSCommon();
    $bp->setModuleName($ts_module->name);
    $bp->cronTask();
}
Esempio n. 3
0
 public static function displaySeal()
 {
     if (!TrustedShops::$seal_displayed) {
         Context::getContext()->smarty->assign('ts_module_dir', __PS_BASE_URI__ . 'modules/trustedshops/');
         TrustedShops::$seal_displayed = true;
         return Context::getContext()->smarty->fetch(dirname(__FILE__) . '/views/templates/front/' . TSCommon::getTemplateByVersion('seal_of_approval'));
     }
     return '';
 }
Esempio n. 4
0
 private function displayFormEditCertificate($lang)
 {
     $certificate = TSCommon::$certificates[$lang];
     $payment_module_collection = array();
     $installed_modules = Module::getModulesInstalled();
     foreach ($installed_modules as $value) {
         if (TSCommon::isPaymentModule($value['name'])) {
             $payment_module_collection[$value['id_module']] = $value;
         }
     }
     TSCommon::$smarty->assign(array('site_uri' => $this->site_url, 'form_action' => $this->makeFormAction(strip_tags($_SERVER['REQUEST_URI']), $this->id_tab), 'lang' => $lang, 'certificate' => $certificate, 'payment_types' => TSCommon::$payments_type, 'payment_collection' => $payment_module_collection, 'payment_types_json' => Tools::jsonEncode(TSCommon::$payments_type), 'payment_collection_json' => Tools::jsonEncode($payment_module_collection)));
     return TSCommon::$smarty->fetch(dirname(__FILE__) . '/../views/templates/admin/' . self::getTemplateByVersion('edit_certificate'));
 }