if (!defined('W2P_BASE_DIR')) { die('You should not access this file directly.'); } global $search_string, $owner_filter_id, $currentTabId, $orderby, $orderdir; $types = w2PgetSysVal('DepartmentType'); $dept_type_filter = $currentTabId - 1; // get any records denied from viewing $dept = new CDepartment(); $depts = $dept->getFilteredDepartmentList(null, $dept_type_filter, $search_string, $owner_filter_id, $orderby, $orderdir); ?> <table width="100%" border="0" cellpadding="2" cellspacing="1" class="tbl list"> <tr> <?php $fieldList = array(); $fieldNames = array(); $module = new w2p_Core_Module(); $fields = $module->loadSettings('departments', 'index_list'); if (count($fields) > 0) { $fieldList = array_keys($fields); $fieldNames = array_values($fields); } else { // TODO: This is only in place to provide an pre-upgrade-safe // state for versions earlier than v3.0 // At some point at/after v4.0, this should be deprecated $fieldList = array('dept_name', 'countp', 'inactive', 'dept_type'); $fieldNames = array('Department Name', 'Active Projects', 'Archived Projects', 'Type'); } //TODO: The link below is commented out because this module doesn't support sorting... yet. foreach ($fieldNames as $index => $name) { ?> <th nowrap="nowrap">
/* $Id$ $URL$ */ if (!defined('W2P_BASE_DIR')) { die('You should not access this file directly.'); } $perms =& $AppUI->acl(); if (!canEdit('system')) { $AppUI->redirect('m=public&a=access_denied'); } ## ## Activate or move a module entry ## $cmd = w2PgetParam($_GET, 'cmd', '0'); $mod_id = (int) w2PgetParam($_GET, 'mod_id', '0'); $mod_directory = w2PgetParam($_GET, 'mod_directory', '0'); $obj = new w2p_Core_Module(); if ($mod_id) { $obj->load($mod_id); } else { $obj->mod_directory = $mod_directory; } $ok = (include_once W2P_BASE_DIR . '/modules/' . $obj->mod_directory . '/setup.php'); if (!$ok) { if ($obj->mod_type != 'core') { $AppUI->setMsg('Module setup file could not be found', UI_MSG_ERROR); if ($cmd == 'remove') { $obj->remove(); $AppUI->setMsg('Module has been removed from the modules list - please check your database for additional tables that may need to be removed', UI_MSG_ERROR); } $AppUI->redirect(); }
$i = count($projects[$row['task_project']]['tasks']) + 1; $row['task_number'] = $i; $row['node_id'] = 'node_' . $i . '-' . $row['task_id']; if (strpos($row['task_duration'], '.') && $row['task_duration_type'] == 1) { $row['task_duration'] = floor($row['task_duration']) . ':' . round(60 * ($row['task_duration'] - floor($row['task_duration']))); } //pull the final task row into array $projects[$row['task_project']]['tasks'][] = $row; } $showEditCheckbox = isset($canEditTasks) && $canEditTasks || canView('admin'); $durnTypes = w2PgetSysVal('TaskDurationType'); $tempoTask = new CTask(); $userAlloc = $tempoTask->getAllocation('user_id'); $fieldList = array(); $fieldNames = array(); $module = new w2p_Core_Module(); $fields = $module->loadSettings('projectdesigner', 'task_list_print'); if (count($fields) > 0) { $fieldList = array_keys($fields); $fieldNames = array_values($fields); } else { // TODO: This is only in place to provide an pre-upgrade-safe // state for versions earlier than v3.0 // At some point at/after v4.0, this should be deprecated $fieldList = array('task_name', 'task_percent_complete', 'task_start_date', 'task_end_date', 'task_updated'); $fieldNames = array('Task Name', 'Work', 'Start', 'Finish', 'Last Update'); //$module->storeSettings('projectdesigner', 'task_list_print', $fieldList, $fieldNames); } echo '<table width="100%" border="0" cellpadding="1" cellspacing="3" class="prjprint tbl list"><tr class="prjprint">'; foreach ($fieldNames as $index => $name) { ?>
} ?> </script> <form name="frmDelete2" action="./index.php?m=tasks" method="post" accept-charset="utf-8"> <input type="hidden" name="dosql" value="do_updatetask" /> <input type="hidden" name="del" value="1" /> <input type="hidden" name="task_log_id" value="0" /> </form> <a name="task_logs-tasks_view"> </a> <table width="100%" border="0" cellpadding="2" cellspacing="1" class="tbl list"> <tr> <?php $fieldList = array(); $fieldNames = array(); $module = new w2p_Core_Module(); $fields = $module->loadSettings('tasks', 'task_logs_tasks_view'); if (count($fields) > 0) { $fieldList = array_keys($fields); $fieldNames = array_values($fields); } else { // TODO: This is only in place to provide an pre-upgrade-safe // state for versions earlier than v3.0 // At some point at/after v4.0, this should be deprecated $fieldList = array('task_log_date', 'task_log_reference', 'task_log_name', 'task_log_related_url', 'task_log_creator', 'task_log_hours', 'task_log_costcode', 'task_log_description'); $fieldNames = array('Date', 'Ref', 'Summary', 'URL', 'User', 'Hours', 'Cost Code', 'Comments', ''); $module->storeSettings('tasks', 'task_logs_tasks_view', $fieldList, $fieldNames); } //TODO: The link below is commented out because this module doesn't support sorting... yet. echo '<th></th>'; foreach ($fieldNames as $index => $name) {
function projects_list_data($user_id = false) { global $AppUI, $addPwOiD, $buffer, $company, $company_id, $company_prefix, $deny, $department, $dept_ids, $w2Pconfig, $orderby, $orderdir, $tasks_problems, $owner, $projectTypeId, $search_text, $project_type; $addProjectsWithAssignedTasks = $AppUI->getState('addProjWithTasks') ? $AppUI->getState('addProjWithTasks') : 0; // get any records denied from viewing $obj = new CProject(); $deny = $obj->getDeniedRecords($AppUI->user_id); // Let's delete temproary tables $q = new w2p_Database_Query(); $q->setDelete('tasks_problems'); $q->exec(); $q->clear(); $q->setDelete('tasks_users'); $q->exec(); $q->clear(); // support task problem logs $q->addInsertSelect('tasks_problems'); $q->addTable('tasks'); $q->addQuery('task_project, task_log_problem'); $q->addJoin('task_log', 'tl', 'tl.task_log_task = task_id', 'inner'); $q->addWhere('task_log_problem = 1'); $q->addGroup('task_project'); $tasks_problems = $q->exec(); $q->clear(); if ($addProjectsWithAssignedTasks) { // support users tasks $q->addInsertSelect('tasks_users'); $q->addTable('tasks'); $q->addQuery('task_project'); $q->addQuery('ut.user_id'); $q->addJoin('user_tasks', 'ut', 'ut.task_id = tasks.task_id'); if ($user_id) { $q->addWhere('ut.user_id = ' . (int) $user_id); } $q->addOrder('task_end_date DESC'); $q->addGroup('task_project'); $tasks_users = $q->exec(); $q->clear(); } // add Projects where the Project Owner is in the given department if ($addPwOiD && isset($department)) { $owner_ids = array(); $q->addTable('users'); $q->addQuery('user_id'); $q->addJoin('contacts', 'c', 'c.contact_id = user_contact', 'inner'); $q->addWhere('c.contact_department = ' . (int) $department); $owner_ids = $q->loadColumn(); $q->clear(); } if (isset($department)) { //If a department is specified, we want to display projects from the department, and all departments under that, so we need to build that list of departments $dept_ids = array(); $q->addTable('departments'); $q->addQuery('dept_id, dept_parent'); $q->addOrder('dept_parent,dept_name'); $rows = $q->loadList(); addDeptId($rows, $department); $dept_ids[] = isset($department->dept_id) ? $department->dept_id : 0; $dept_ids[] = $department > 0 ? $department : 0; } $q->clear(); // retrieve list of records // modified for speed // by Pablo Roca (pabloroca@mvps.org) // 16 August 2003 // get the list of permitted companies $obj = new CCompany(); $companies = $obj->getAllowedRecords($AppUI->user_id, 'companies.company_id,companies.company_name', 'companies.company_name'); if (count($companies) == 0) { $companies = array(); } $q->addTable('projects', 'pr'); $q->addQuery('pr.project_id, project_status, project_color_identifier, project_type, project_name, project_description, project_scheduled_hours as project_duration, project_parent, project_original_parent, project_percent_complete, project_color_identifier, project_company, company_name, project_status, project_last_task as critical_task, tp.task_log_problem, user_username, project_active'); $fields = w2p_Core_Module::getSettings('projects', 'index_list'); unset($fields['department_list']); // added as an alias below foreach ($fields as $field => $text) { $q->addQuery($field); } $q->addQuery('CONCAT(ct.contact_first_name, \' \', ct.contact_last_name) AS owner_name'); $q->addJoin('users', 'u', 'pr.project_owner = u.user_id'); $q->addJoin('contacts', 'ct', 'ct.contact_id = u.user_contact'); $q->addJoin('tasks_problems', 'tp', 'pr.project_id = tp.task_project'); if ($addProjectsWithAssignedTasks) { $q->addJoin('tasks_users', 'tu', 'pr.project_id = tu.task_project'); } if (!isset($department) && $company_id && !$addPwOiD) { $q->addWhere('pr.project_company = ' . (int) $company_id); } if ($project_type > -1) { $q->addWhere('pr.project_type = ' . (int) $project_type); } if (isset($department) && !$addPwOiD) { $q->addWhere('project_departments.department_id in ( ' . implode(',', $dept_ids) . ' )'); } if ($user_id && $addProjectsWithAssignedTasks) { $q->addWhere('(tu.user_id = ' . (int) $user_id . ' OR pr.project_owner = ' . (int) $user_id . ' )'); } elseif ($user_id) { $q->addWhere('pr.project_owner = ' . (int) $user_id); } if ($owner > 0) { $q->addWhere('pr.project_owner = ' . (int) $owner); } if (mb_trim($search_text)) { $q->addWhere('pr.project_name LIKE \'%' . $search_text . '%\' OR pr.project_description LIKE \'%' . $search_text . '%\''); } // Show Projects where the Project Owner is in the given department if ($addPwOiD && !empty($owner_ids)) { $q->addWhere('pr.project_owner IN (' . implode(',', $owner_ids) . ')'); } $orderby = 'project_company' == $orderby ? 'company_name' : $orderby; $q->addGroup('pr.project_id'); $q->addOrder($orderby . ' ' . $orderdir); $prj = new CProject(); $prj->setAllowedSQL($AppUI->user_id, $q, null, 'pr'); $dpt = new CDepartment(); $projects = $q->loadList(); // get the list of permitted companies $companies = arrayMerge(array('0' => $AppUI->_('All')), $companies); $company_array = $companies; //get list of all departments, filtered by the list of permitted companies. $q->clear(); $q->addTable('companies'); $q->addQuery('company_id, company_name, dep.*'); $q->addJoin('departments', 'dep', 'companies.company_id = dep.dept_company'); $q->addOrder('company_name,dept_parent,dept_name'); $obj->setAllowedSQL($AppUI->user_id, $q); $dpt->setAllowedSQL($AppUI->user_id, $q); $rows = $q->loadList(); //display the select list $buffer = '<select name="department" id="department" onChange="document.pickCompany.submit()" class="text" style="width: 200px;">'; $company = ''; foreach ($company_array as $key => $c_name) { $buffer .= '<option value="' . $company_prefix . $key . '" style="font-weight:bold;"' . ($company_id == $key ? 'selected="selected"' : '') . '>' . $c_name . '</option>' . "\n"; foreach ($rows as $row) { if ($row['dept_parent'] == 0) { if ($key == $row['company_id']) { if ($row['dept_parent'] != null) { findchilddept($rows, $row['dept_id']); } } } } } $buffer .= '</select>'; return $projects; }
} else { $project_status_filter = $projectStatuses[0] ? $currentTabId : $currentTabId + 1; } $xpg_totalrecs = count($projects); $xpg_pagesize = count($projects); } ?> <form action="./index.php" method="get" accept-charset="utf-8"> <table id="tblProjects" width="100%" border="0" cellpadding="3" cellspacing="1" class="tbl"> <tr> <?php $fieldList = array(); $fieldNames = array(); $fields = w2p_Core_Module::getSettings('projects', 'index_list'); if (count($fields) > 0) { foreach ($fields as $field => $text) { $fieldList[] = $field; $fieldNames[] = $text; } } else { // TODO: This is only in place to provide a fail safe state pre-upgrade // from earlier versions to v2.3+ In v4.0+, we should deprecate this. $fieldList = array('project_color_identifier', 'project_priority', 'project_name', 'company_name', 'project_start_date', 'project_end_date', 'project_actual_end_date', 'task_log_problem', 'user_username', 'project_task_count'); $fieldNames = array('Color', 'P', 'Project Name', 'Company', 'Start', 'End', 'Actual', 'LP', 'Owner', 'Tasks'); } foreach ($fieldNames as $index => $name) { ?> <th nowrap="nowrap"> <a href="?m=projects&orderby=<?php
<?php if (!defined('W2P_BASE_DIR')) { die('You should not access this file directly.'); } $perms = $AppUI->acl(); $canEdit = canEdit('system'); if (!$canEdit) { $AppUI->redirect('m=public&a=access_denied'); } $mod_id = (int) w2PgetCleanParam($_POST, 'mod_id'); $module = new w2p_Core_Module(); $module->load($mod_id); $moduleName = $module->mod_directory; $configName = w2PgetParam($_POST, 'module_config_name', ''); $displayColumns = w2PgetParam($_POST, 'display', array()); $displayOrder = w2PgetParam($_POST, 'order', array()); $displayFields = w2PgetParam($_POST, 'displayFields', array()); $displayNames = w2PgetParam($_POST, 'displayNames', array()); $result = w2p_Core_Module::saveSettings($moduleName, $configName, $displayColumns, $displayOrder, $displayFields, $displayNames); $AppUI->redirect('m=system&u=modules&a=addedit&mod_id=' . $mod_id . '&v=' . $configName);
$AppUI->redirect('m=public&a=access_denied'); } $xpg_pagesize = w2PgetConfig('page_size', 50); $xpg_min = $xpg_pagesize * ($page - 1); // This is where we start our record set from // counts total recs from selection $xpg_totalrecs = count($links); $pageNav = buildPaginationNav($AppUI, $m, $tab, $xpg_totalrecs, $xpg_pagesize, $page); echo $pageNav; ?> <table width="100%" border="0" cellpadding="2" cellspacing="1" class="tbl list"> <tr> <?php $fieldList = array(); $fieldNames = array(); $module = new w2p_Core_Module(); $fields = $module->loadSettings('links', 'index_list'); if (count($fields) > 0) { $fieldList = array_keys($fields); $fieldNames = array_values($fields); } else { // TODO: This is only in place to provide an pre-upgrade-safe // state for versions earlier than v3.0 // At some point at/after v4.0, this should be deprecated $fieldList = array('link_name', 'link_description', 'link_category', 'link_task', 'link_owner', 'link_date'); $fieldNames = array('Link Name', 'Description', 'Category', 'Task Name', 'Owner', 'Date'); $module->storeSettings('links', 'index_list', $fieldList, $fieldNames); } //TODO: The link below is commented out because this module doesn't support sorting... yet. echo '<th></th>'; foreach ($fieldNames as $index => $name) {
<?php /* $Id$ $URL$ */ if (!defined('W2P_BASE_DIR')) { die('You should not access this file directly.'); } $perms =& $AppUI->acl(); if (!canEdit('system')) { $AppUI->redirect('m=public&a=access_denied'); } if (isset($_FILES['module_upload'])) { $upload = $_FILES['module_upload']; $module = new w2p_Core_Module(); $result = $module->deploy($upload); if (is_array($result)) { $AppUI->setMsg($result, UI_MSG_ERROR, true); } else { $AppUI->setMsg($AppUI->_('This module was expanded successfully.'), UI_MSG_OK, true); } } $AppUI->redirect('m=system&u=modules&a=viewmods');
<tr> <?php $fieldList = array(); $fieldNames = array(); $module = new w2p_Core_Module(); $fields = $module->loadSettings('projects', 'index_list'); if (count($fields) > 0) { $fieldList = array_keys($fields); $fieldNames = array_values($fields); } else { // TODO: This is only in place to provide an pre-upgrade-safe // state for versions earlier than v2.3 // At some point at/after v4.0, this should be deprecated $fieldList = array('project_color_identifier', 'project_priority', 'project_name', 'company_name', 'project_start_date', 'project_end_date', 'project_actual_end_date', 'task_log_problem', 'user_username', 'project_task_count'); $fieldNames = array('Color', 'P', 'Project Name', 'Company', 'Start', 'End', 'Actual', 'LP', 'Owner', 'Tasks'); $module = new w2p_Core_Module(); $module->storeSettings('projects', 'index_list', $fieldList, $fieldNames); } foreach ($fieldNames as $index => $name) { ?> <th nowrap="nowrap"> <a href="?m=projects&orderby=<?php echo $fieldList[$index]; ?> " class="hdr"> <?php echo $AppUI->_($fieldNames[$index]); ?> </a> </th><?php }
if (!defined('W2P_BASE_DIR')) { die('You should not access this file directly.'); } $filter = array('project_id', 'project_status', 'project_active', 'project_parent', 'project_color_identifier', 'project_original_parent', 'project_departments', 'project_contacts', 'project_private', 'project_type', 'project_last_task'); $project = new CProject(); $properties = get_class_vars(get_class($project)); foreach ($filter as $field => $value) { unset($properties[$value]); } $properties['department_list'] = ''; // setup the title block $titleBlock = new CTitleBlock('Configure Projects Module', 'modules/system/control-center.png', $m, $m . '.' . $a); $titleBlock->addCrumb('?m=system', 'system admin'); $titleBlock->addCrumb('?m=system&a=viewmods', 'modules list'); $titleBlock->show(); $fields = w2p_Core_Module::getSettings($m, 'index_list'); $fields = array_diff($fields, $filter); foreach ($fields as $field => $text) { $fieldList[] = $field; $fieldNames[] = $text; } $orderMax = count($properties) + count($fields); ?> <form name="frmConfig" id="frmConfig" action="./index.php?m=system" method="post" accept-charset="utf-8"> <input type="hidden" name="dosql" value="do_module_config" /> <input type="hidden" name="module_name" value="<?php echo $m; ?> " /> <input type="hidden" name="module_config_name" value="index_list" />
<?php /* $Id$ $URL$ */ if (!defined('W2P_BASE_DIR')) { die('You should not access this file directly.'); } // check permissions $perms =& $AppUI->acl(); $canEdit = canEdit('system'); $canRead = canView('system'); if (!$canRead) { $AppUI->redirect('m=public&a=access_denied'); } $AppUI->savePlace(); $module = new w2p_Core_Module(); $hidden_modules = array('public', 'install'); $q = new w2p_Database_Query(); $q->addQuery('*'); $q->addTable('modules'); foreach ($hidden_modules as $no_show) { $q->addWhere('mod_directory <> \'' . $no_show . '\''); } $q->addOrder('mod_ui_order'); $modules = $q->loadList(); // get the modules actually installed on the file system $modFiles = $AppUI->readDirs('modules'); $titleBlock = new w2p_Theme_TitleBlock('Modules', 'power-management.png', $m, "{$m}.{$a}"); $titleBlock->addCrumb('?m=system', 'System Admin'); $titleBlock->show(); ?>
<?php $moduleName = w2PgetParam($_POST, 'module_name', ''); $configName = w2PgetParam($_POST, 'module_config_name', ''); $displayColumns = w2PgetParam($_POST, 'display', array()); $displayOrder = w2PgetParam($_POST, 'order', array()); $displayFields = w2PgetParam($_POST, 'displayFields', array()); $displayNames = w2PgetParam($_POST, 'displayNames', array()); $result = w2p_Core_Module::saveSettings($moduleName, $configName, $displayColumns, $displayOrder, $displayFields, $displayNames); $AppUI->redirect('m=' . $moduleName . '&a=configure');
" onclick="javascript:window.location='./index.php?m=forums&a=viewer&forum_id=<?php echo $forum_id; ?> &post_message=1';" /> <?php } ?> </td> </tr> </table> </td></tr> <tr> <?php $fieldList = array(); $fieldNames = array(); $module = new w2p_Core_Module(); $fields = $module->loadSettings('forums', 'view_topics'); if (count($fields) > 0) { $fieldList = array_keys($fields); $fieldNames = array_values($fields); } else { // TODO: This is only in place to provide an pre-upgrade-safe // state for versions earlier than v3.0 // At some point at/after v4.0, this should be deprecated $fieldList = array('watch_user', 'message_name', 'message_author', 'replies', 'latest_reply'); $fieldNames = array('Watch', 'Topics', 'Author', 'Replies', 'Last Post'); $module->storeSettings('forums', 'view_topics', $fieldList, $fieldNames); } echo '<th></th>'; foreach ($fieldNames as $index => $name) { ?>