Exemplo n.º 1
0
 public function install()
 {
     if (parent::install()) {
         $this->load->model('setting/setting');
         $rec = array('ka_ts_run_scheduler_key' => rand(0, 99999), 'ka_ts_stop_task_after_n_minutes' => 30, 'ka_ts_stop_task_after_n_failures' => 2, 'ka_ts_task_is_dead_after_n_minutes' => 5, 'ka_ts_send_email_on_completion' => 'Y');
         $this->model_setting_setting->editSetting('ka_scheduler', $rec);
         $this->load->model('user/user_group');
         $this->model_user_user_group->addPermission($this->user->getId(), 'access', 'tool/ka_tasks');
         $this->model_user_user_group->addPermission($this->user->getId(), 'modify', 'tool/ka_tasks');
         return true;
     }
     return false;
 }
Exemplo n.º 2
0
 public function install()
 {
     $this->init();
     //install task scheduler
     if (!$this->db->isKaInstalled('ka_scheduler')) {
         $this->addTopMessage('Task Scheduler extension has to be installed first', 'E');
         return false;
     }
     if (!parent::install()) {
         return false;
     }
     $this->load->model('tool/ka_tasks');
     $task = array('name' => 'Abandoned Cart Recovery', 'module' => 'sale/ka_abandoned_carts', 'period_type' => 'hour', 'active' => 'Y');
     $this->model_tool_ka_tasks->installTask($task, true);
     $this->load->model('setting/extension');
     $this->load->model('setting/setting');
     $rec = array('ka_acr_link_expires_in_hours' => 72, 'ka_acr_auto_login_link' => 'Y', 'ka_acr_show_unsubscribed' => 'Y', 'ka_acr_show_carts_wo_delay' => 'N');
     $this->model_setting_setting->editSetting('ka_acr', $rec);
     $this->load->model('user/user_group');
     $this->model_user_user_group->addPermission($this->user->getId(), 'access', 'sale/ka_abandoned_carts');
     $this->model_user_user_group->addPermission($this->user->getId(), 'modify', 'sale/ka_abandoned_carts');
     $this->model_user_user_group->addPermission($this->user->getId(), 'access', 'localisation/ka_reminder_emails');
     $this->model_user_user_group->addPermission($this->user->getId(), 'modify', 'localisation/ka_reminder_emails');
     $this->load->model('localisation/ka_reminder_emails');
     $this->model_localisation_ka_reminder_emails->prefillReminderEmails();
     $this->load->model('sale/ka_abandoned_carts');
     $this->model_sale_ka_abandoned_carts->importStandardCarts();
     return true;
 }