/** * Automatic uninstall function for plugins * * @return array * * This code is automatically uninstalling the plugin. * It passes an array to the core code function that removes * tables, groups, features and php blocks from the tables. * Additionally, this code can perform special actions that cannot be * foreseen by the core code (interactions with other plugins for example) * */ function plugin_autouninstall_nexproject() { global $_PRJCONF, $_TABLES; $out = array('tables' => array('prj_category', 'prj_department', 'prj_location', 'prj_objective', 'prj_permissions', 'prj_users', 'prj_projects', 'prj_sorting', 'prj_task_users', 'prj_tasks', 'prj_statuslog', 'prj_session', 'prj_filters', 'prj_lockcontrol', 'prj_projPerms', 'prj_taskSemaphore', 'prj_config'), 'groups' => array('nexProject Admin'), 'features' => array('nexproject.admin'), 'php_blocks' => array('phpblock_projectFilter'), 'vars' => array()); if (prj_forumExists()) { //using this row's config value, we'll delete all forums with this ID as the parent and then chuck out the category itself... $sql = "SELECT * FROM {$_TABLES['gf_forums']} where forum_cat={$_PRJCONF['forum_parent']}"; $forumres = DB_query($sql); while ($X = DB_fetchArray($forumres)) { forum_deleteForum($X['forum_id']); } DB_query("DELETE FROM {$_TABLES['gf_categories']} where id={$_PRJCONF['forum_parent']}"); } if (prj_nexFileExists()) { PLG_itemDeleted($_PRJCONF['nexfile_parent'], 'nexproject_filefolder'); } DB_query("DELETE FROM {$_TABLES['nexlistitems']} WHERE lid={$_PRJCONF['nexlist_locations']}"); DB_query("DELETE FROM {$_TABLES['nexlistfields']} WHERE lid={$_PRJCONF['nexlist_locations']}"); DB_query("DELETE FROM {$_TABLES['nexlist']} WHERE id={$_PRJCONF['nexlist_locations']}"); DB_query("DELETE FROM {$_TABLES['nexlistitems']} WHERE lid={$_PRJCONF['nexlist_departments']}"); DB_query("DELETE FROM {$_TABLES['nexlistfields']} WHERE lid={$_PRJCONF['nexlist_departments']}"); DB_query("DELETE FROM {$_TABLES['nexlist']} WHERE id={$_PRJCONF['nexlist_departments']}"); DB_query("DELETE FROM {$_TABLES['nexlistitems']} WHERE lid={$_PRJCONF['nexlist_category']}"); DB_query("DELETE FROM {$_TABLES['nexlistfields']} WHERE lid={$_PRJCONF['nexlist_category']}"); DB_query("DELETE FROM {$_TABLES['nexlist']} WHERE id={$_PRJCONF['nexlist_category']}"); DB_query("DELETE FROM {$_TABLES['nexlistitems']} WHERE lid={$_PRJCONF['nexlist_objective']}"); DB_query("DELETE FROM {$_TABLES['nexlistfields']} WHERE lid={$_PRJCONF['nexlist_objective']}"); DB_query("DELETE FROM {$_TABLES['nexlist']} WHERE id={$_PRJCONF['nexlist_objective']}"); return $out; }
$test = COM_optionList($_TABLES['users'], 'uid,fullname', $selected = '', $sortcol = 1, 'status = 0 and uid>1'); $p = new Template($_CONF['path_layout'] . 'nexproject'); $p->set_file('project', 'editproject.thtml'); $p->set_var('breadcrumb_trail', prj_breadcrumbs(0, 0, $strings["add_project"])); $p->set_var($pluginLangLabels); // Set template variable for all the language variable keys $p->set_var('site_url', $_CONF['site_url']); $p->set_var('layout_url', $_CONF['layout_url']); $p->set_var('mode', 'create'); $p->set_var('show_owner', 'none'); $p->set_var('show_changelog', 'none'); $p->set_var('LANG_heading', $pluginLangLabels['LANG_add_project']); $p->set_var('priority_options', selectBox2($priority)); $p->set_var('status_options', selectBox2($status)); $p->set_var('progress_options', selectBox2($progress)); $nexfile = prj_nexFileExists(); $forum = prj_forumExists(); $p->set_var('linked_content_disabled', $nexfile ? '' : 'disabled="disabled"'); $p->set_var('discussion_board_disabled', $forum ? '' : 'disabled="disabled"'); $p->set_var('objective_options', nexlistOptionList('options', '', $_PRJCONF['nexlist_objective'])); $p->set_var('location_options', nexlistOptionList('options', '', $_PRJCONF['nexlist_locations'], 0, '', '', -1, true)); $p->set_var('department_options', nexlistOptionList('options', '', $_PRJCONF['nexlist_departments'], 0, '', '', -1, true)); $p->set_var('category_options', nexlistOptionList('options', '', $_PRJCONF['nexlist_category'], 0, '', '', -1, true)); $p->set_var('resource_options', COM_optionList($_TABLES['users'], 'uid,fullname', $selected = '', $sortcol = 1, "uid>1")); $p->set_var('VALUE_notification_enabled_flag', 'CHECKED'); if ($nexfile) { $p->set_var('VALUE_is_using_docmgmt_flag_on', 'CHECKED'); $p->set_var('VALUE_is_using_docmgmt_flag_off', ''); } else { $p->set_var('VALUE_is_using_docmgmt_flag_on', ''); $p->set_var('VALUE_is_using_docmgmt_flag_off', 'CHECKED');