/** * Import tasks * * @access public * @return void **/ public function tasks() { /* INIT */ $vars = $this->getVars(); $output = array(); $errors = array(); if (file_exists($this->app_full_path . 'xml/' . $vars['app_directory'] . '_tasks.xml')) { /* Get the language class */ require_once IPS_ROOT_PATH . 'applications/core/modules_admin/system/taskmanager.php'; $task_obj = new admin_core_system_taskmanager($this->registry); $task_obj->makeRegistryShortcuts($this->registry); $task_obj->tasksImportFromXML($this->app_full_path . 'xml/' . $vars['app_directory'] . '_tasks.xml', true); } $output[] = $this->registry->output->global_message ? $this->registry->output->global_message : $this->lang->words['no_tasks_for_import']; /* Clear main msg */ $this->registry->output->global_message = ''; /* Show redirect... */ $this->showRedirectScreen($vars['app_directory'], $output, $errors, $this->getNextURL('bbcode', $vars)); }
/** * Install Tasks * * @return void */ public function install_tasks() { //----------------------------------------- // INIT //----------------------------------------- $previous = $_REQUEST['previous']; //----------------------------------------- // Fetch next 'un //----------------------------------------- $next = IPSSetUp::fetchNextApplication($previous, '{app}_tasks.xml', $this->settings['gb_char_set']); /* Set up DB driver */ $extra_install = $this->_setUpDBDriver(FALSE); //----------------------------------------- // Insert tasks //----------------------------------------- if ($next['key']) { $output[] = $next['title'] . ": Добавление задач"; $_PATH = IPSLib::getAppDir($next['key']) . '/xml/'; if (is_file($_PATH . $next['key'] . '_tasks.xml')) { //----------------------------------------- // Adjust the table? //----------------------------------------- if ($extra_install and method_exists($extra_install, 'before_inserts_run')) { $q = $extra_install->before_inserts_run('tasks'); } //----------------------------------------- // Continue //----------------------------------------- require_once IPS_ROOT_PATH . 'applications/core/modules_admin/system/taskmanager.php'; /*noLibHook*/ $tasks = new admin_core_system_taskmanager(); $tasks->makeRegistryShortcuts($this->registry); $tasks->tasksImportFromXML($_PATH . $next['key'] . '_tasks.xml', 1); //----------------------------------------- // Adjust the table? //----------------------------------------- if ($extra_install and method_exists($extra_install, 'after_inserts_run')) { $q = $extra_install->after_inserts_run('tasks'); } } //----------------------------------------- // Done.. so get some more! //----------------------------------------- $this->_finishStep($output, "Установка: Задачи", 'install&do=tasks&previous=' . $next['key']); } else { //----------------------------------------- // Next... //----------------------------------------- $output[] = "Задачи добавлены"; $this->_finishStep($output, "Установка: Задачи", 'install&do=languages'); } }
/** * Install Tasks * * @return void */ public function install_tasks() { //----------------------------------------- // INIT //----------------------------------------- $previous = $_REQUEST['previous']; //----------------------------------------- // Fetch next 'un //----------------------------------------- $next = IPSSetUp::fetchNextApplication($previous, '{app}_tasks.xml', $this->settings['gb_char_set']); //----------------------------------------- // Insert tasks //----------------------------------------- if ($next['key']) { $output[] = $next['title'] . ": Обновление задач"; $_PATH = IPSLib::getAppDir($next['key']) . '/xml/'; if (is_file($_PATH . $next['key'] . '_tasks.xml')) { //----------------------------------------- // Continue //----------------------------------------- require_once IPS_ROOT_PATH . 'applications/core/modules_admin/system/taskmanager.php'; /*noLibHook*/ $tasks = new admin_core_system_taskmanager(); $tasks->makeRegistryShortcuts($this->registry); $tasks->tasksImportFromXML($_PATH . $next['key'] . '_tasks.xml', 1); } //----------------------------------------- // Done.. so get some more! //----------------------------------------- $this->_finishStep($output, "Обновление: Задачи", 'upgrade&do=tasks&previous=' . $next['key']); } else { //----------------------------------------- // Next... //----------------------------------------- $output[] = "Все задачи обновлены"; $this->_finishStep($output, "Обновление: Задачи", 'upgrade&do=languages'); } }
/** * Install Tasks * * @return void */ public function install_tasks() { //----------------------------------------- // INIT //----------------------------------------- $previous = $_REQUEST['previous']; //----------------------------------------- // Fetch next 'un //----------------------------------------- $next = IPSSetUp::fetchNextApplication($previous, '{app}_tasks.xml'); //----------------------------------------- // Insert tasks //----------------------------------------- if ($next['key']) { $output[] = $next['title'] . ": Upgrading tasks..."; $_PATH = IPSLib::getAppDir($next['key']) . '/xml/'; if (file_exists($_PATH . $next['key'] . '_tasks.xml')) { //----------------------------------------- // Continue //----------------------------------------- require_once IPS_ROOT_PATH . 'applications/core/modules_admin/system/taskmanager.php'; $tasks = new admin_core_system_taskmanager(); $tasks->makeRegistryShortcuts($this->registry); $tasks->tasksImportFromXML($_PATH . $next['key'] . '_tasks.xml', 1); } //----------------------------------------- // Done.. so get some more! //----------------------------------------- $this->_finishStep($output, "Upgrade: Tasks", 'upgrade&do=tasks&previous=' . $next['key']); } else { //----------------------------------------- // Next... //----------------------------------------- $output[] = "All tasks upgraded..."; $this->_finishStep($output, "Upgrade: Tasks", 'upgrade&do=languages'); } }