当前位置: 首页>>代码示例>>PHP>>正文


PHP DBQuery::loadHashList方法代码示例

本文整理汇总了PHP中DBQuery::loadHashList方法的典型用法代码示例。如果您正苦于以下问题:PHP DBQuery::loadHashList方法的具体用法?PHP DBQuery::loadHashList怎么用?PHP DBQuery::loadHashList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DBQuery的用法示例。


在下文中一共展示了DBQuery::loadHashList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: DBQuery

 function get_defaults()
 {
     $q = new DBQuery();
     $q->addTable('user_preferences');
     $q->addQuery('pref_name, pref_value');
     $q->addWhere('pref_user = 0');
     $this->_default_prefs = $q->loadHashList();
 }
开发者ID:illuminate3,项目名称:dotproject,代码行数:8,代码来源:system.class.php

示例2: _deDynamicLeafNodes

 protected function _deDynamicLeafNodes($projectId)
 {
     $q = new DBQuery();
     $q->addUpdate('task_dynamic', 0);
     $q->addWhere("task_project = {$projectId}");
     $q->addTable('tasks');
     $q->exec();
     $q->addQuery('distinct(task_parent)');
     $q->addTable('tasks');
     $q->addWhere("task_project = {$projectId}");
     $q->addWhere("task_id <> task_parent");
     $taskList = $q->loadHashList();
     foreach ($taskList as $id => $nothing) {
         $dynamicTasks .= $id . ',';
     }
     $dynamicTasks .= '0';
     $q->clear();
     $q->addUpdate('task_dynamic', 1);
     $q->addWhere("task_project = {$projectId}");
     $q->addWhere("task_id IN ({$dynamicTasks})");
     $q->addTable('tasks');
     $q->exec();
 }
开发者ID:hoodoogurus,项目名称:dotprojecteap,代码行数:23,代码来源:importers.class.php

示例3: getUsersArray

function getUsersArray()
{
    $q = new DBQuery();
    $q->addTable('users');
    $q->addQuery('user_id, user_username, contact_first_name, contact_last_name');
    $q->addJoin('contacts', 'con', 'contact_id = user_contact');
    $q->addOrder('contact_first_name, contact_last_name');
    return $q->loadHashList("user_id");
}
开发者ID:n2i,项目名称:xvnkb,代码行数:9,代码来源:main_functions.php

示例4: die

/* ADMIN $Id: vw_usr_perms.php 6038 2010-10-03 05:49:01Z ajdonnison $ */
if (!defined('DP_BASE_DIR')) {
    die('You should not access this file directly.');
}
global $AppUI, $user_id, $canEdit, $canDelete, $tab;
$perms =& $AppUI->acl();
$module_list = $perms->getModuleList();
//get list of 'real' modules
$pgos = array();
$q = new DBQuery();
$q->addTable('modules', 'm');
$q->addQuery('mod_id, mod_name, permissions_item_table');
$q->addWhere('permissions_item_table is not null');
$q->addWhere("permissions_item_table <> ''");
$module_pgo_list = $q->loadHashList('mod_name');
$q->clear();
//list of additional 'pseudo-modules'
$pseudo_module_pgo_list = array('File Folders' => array('mod_id' => -1, 'mod_name' => 'file_folders', 'permissions_item_table' => 'file_folders'));
//combine modules and 'pseudo-modules'
$pgo_list = arrayMerge($module_pgo_list, $pseudo_module_pgo_list);
// Build an intersection array for the modules and their listing
$modules = array();
$offset = 0;
foreach ($module_list as $module) {
    $modules[$module['type'] . "," . $module['id']] = $module['name'];
    if ($module['type'] = 'mod' && isset($pgo_list[$module['name']])) {
        $pgos[$offset] = $pgo_list[$module['name']]['permissions_item_table'];
    }
    $offset++;
}
开发者ID:222elm,项目名称:dotprojectFrame,代码行数:30,代码来源:vw_usr_perms.php

示例5: getAllowedRecords

 public function getAllowedRecords($uid)
 {
     global $AppUI;
     $q = new DBQuery();
     $q->addTable('file_folders');
     $q->addQuery('*');
     $q->addOrder('file_folder_parent');
     $q->addOrder('file_folder_name');
     return $q->loadHashList();
 }
开发者ID:joly,项目名称:web2project,代码行数:10,代码来源:files.class.php

示例6: CTimesheet

// therefore create a new instance of the Timesheet Class
$obj = new CTimesheet();
$df = $AppUI->getPref('SHDATEFORMAT');
// pull users
// pull users
$q = new DBQuery();
$q->addTable('tasks', 't');
$q->addTable('projects', 'p');
$q->addTable('user_tasks', 'u');
$q->addQuery('t.task_id');
$q->addQuery('CONCAT_WS(" - ",p.project_short_name, t.task_name)');
$q->addOrder('p.project_short_name, t.task_name');
$q->addWhere('t.task_project = p.project_id and t.task_dynamic = 0 and t.task_percent_complete!=100 and u.task_id=t.task_id and u.user_id=' . $user_id);
//Devido a possibilidade de edição de registros, as tarefas de projetos arquivados e em espera serão apresentadas.
//$q->addWhere('p.project_status!=7 and p.project_status!=4');//[7] Projetos Arquivados e [4] Projetos Em Espera
$tasks = $q->loadHashList();
// load the record data in case of that this script is used to edit the log qith task_log_id (transmitted via GET)
if (!$obj->load($task_log_id, false) && $task_log_id > 0) {
    // show some error messages using the dPFramework if loadOperation failed
    // these error messages are nicely integrated with the frontend of dP
    // use detailed error messages as often as possible
    $AppUI->setMsg('Timesheet');
    $AppUI->setMsg("invalidID", UI_MSG_ERROR, true);
    $AppUI->redirect();
    // go back to the calling location
}
// check if this record has dependancies to prevent deletion
$msg = '';
// setup the title block
// Fill the title block either with 'Edit' or with 'New' depending on if task_log_id has been transmitted via GET or is empty
$ttl = $task_log_id > 0 ? "Edit Log" : "New Log";
开发者ID:seatecnologia,项目名称:dotproject_timesheet,代码行数:31,代码来源:addedit.php

示例7: CTask

</form>
<?php 
echo $AppUI->_('P') . '&nbsp;=&nbsp;' . $AppUI->_('User specific Task Priority');
if ($do_report) {
    // get Users with all Allocation info (e.g. their freeCapacity)
    $tempoTask = new CTask();
    $userAlloc = $tempoTask->getAllocation("user_id");
    // Let's figure out which users we have
    $sql = new DBQuery();
    $sql->addTable('users');
    $sql->addQuery('user_id, user_username');
    if ($log_userfilter != 0) {
        $sql->addWhere('user_id = ' . $log_userfilter);
    }
    $sql->addOrder('user_username');
    $user_list = $sql->loadHashList('user_id');
    $sql->clear();
    $ss = $start_date->format(FMT_DATETIME_MYSQL);
    $se = $end_date->format(FMT_DATETIME_MYSQL);
    $sql->addTable('tasks', 't');
    $sql->innerJoin('projects', 'p', 'p.project_id = t.task_project');
    if ($log_userfilter != 0) {
        $sql->innerJoin('user_tasks', 'ut', 'ut.task_id = t.task_id');
    }
    $sql->addQuery('t.*');
    if ($use_period) {
        $sql->addWhere("((task_start_date >= '{$ss}' AND task_start_date <= '{$se}') " . " OR (task_end_date <= '{$se}' AND task_end_date >= '{$ss}'))");
    }
    $sql->addWhere('task_percent_complete < 100');
    if ($project_id != 'all') {
        $sql->addWhere('t.task_project = \'' . $project_id . '\'');
开发者ID:srinivasulurao,项目名称:jonel,代码行数:31,代码来源:tasksperuser_sub.php

示例8: DBQuery

    case "departments":
        $id_field = "dept_id";
        $name_field = "dept_name";
        $selection_string = "Department";
        $filter = "dept_company = " . $_GET["company_id"];
        $additional_get_information = "company_id=" . $_GET["company_id"];
        break;
}
$q = new DBQuery();
$q->addTable($table_name);
$q->addQuery("{$id_field}, {$name_field}");
if ($filter != null) {
    $q->addWhere($filter);
}
$q->addOrder($name_field);
$company_list = array("0" => "") + $q->loadHashList();
?>

<?php 
if (dPgetParam($_POST, $id_field, 0) != 0) {
    $q = new DBQuery();
    $q->addTable($table_name);
    $q->addQuery('*');
    $q->addWhere("{$id_field}=" . $_POST[$id_field]);
    $sql = $q->prepare();
    $q->clear();
    db_loadHash($sql, $r_data);
    $data_update_script = "";
    $update_address = isset($_POST["overwrite_address"]);
    if ($table_name == "companies") {
        $update_fields = array();
开发者ID:illuminate3,项目名称:dotproject,代码行数:31,代码来源:select_contact_company.php

示例9: getActiveModules

 /**
 * Gets a list of the active modules
 * @return array Named array list in the form 'module directory'=>'module name'
 */
 function getActiveModules()
 {
     $q = new DBQuery();
     $q->addTable('modules');
     $q->addQuery('mod_directory, mod_ui_name');
     $q->addWhere('mod_active > 0');
     $q->addOrder('mod_directory');
     return $q->loadHashList();
 }
开发者ID:klr2003,项目名称:sourceread,代码行数:13,代码来源:ui.class.php

示例10: array

// Get the list of projects associated with this user.
// We need to get all projects that are owned by the user
// or where the user is a project contact.
// We then need to add all projects where a user is assigned a task, is a
// task contact, or is the owner of a task within that project.
// This should cover all situations that we need to correct.
$projects = array();
$q = new DBQuery();
$q->addQuery('user_contact');
$q->addTable('users');
$q->addWhere('user_id = ' . (int) $user_id);
$contact_id = $q->loadResult();
$q->addQuery('distinct project_id, project_name');
$q->addTable('projects');
$q->addWhere('project_owner = ' . (int) $user_id);
$projects += $q->loadHashList();
$q->addQuery('distinct prj.project_id, prj.project_name');
$q->addTable('projects', 'prj');
$q->innerJoin('project_contacts', 'prc', array('project_id'));
$q->addWhere('prc.contact_id = ' . (int) $contact_id);
$projects += $q->loadHashList();
$q->addQuery('distinct prj.project_id, prj.project_name');
$q->addTable('tasks', 't');
$q->innerJoin('projects', 'prj', 'prj.project_id = t.task_project');
$q->leftJoin('user_tasks', 'ut', 'ut.task_id = t.task_id');
$q->addWhere('t.task_owner = ' . (int) $user_id . ' OR ut.user_id = ' . (int) $user_id);
$projects += $q->loadHashList();
$q->addQuery('distinct prj.project_id, prj.project_name');
$q->addTable('tasks', 't');
$q->innerJoin('projects', 'prj', 'prj.project_id = t.task_project');
$q->innerJoin('task_contacts', 'tc', 'tc.task_id = t.task_id');
开发者ID:hoodoogurus,项目名称:dotprojecteap,代码行数:31,代码来源:vw_usr_transfer.php

示例11: DBQuery

$task_log_costcodes = $q->loadHashList();
// Show deleted codes separately (at the end)
$q->addTable('billingcode');
$q->addQuery('billingcode_id, billingcode_name');
$q->addOrder('billingcode_name');
$q->addWhere('billingcode_status = 1');
$q->addWhere('(company_id = 0 OR company_id = ' . $company_id . ')');
$task_log_costcodes = array_merge(array(0 => 'None'), $task_log_costcodes, $q->loadHashList());
$q = new DBQuery();
$q->addTable('users', 'u');
$q->addQuery('user_id, concat(contact_first_name," ",contact_last_name)');
$q->addJoin('contacts', 'c', 'u.user_contact = c.contact_id');
$q->addJoin('project_contacts', 'p', 'p.contact_id = u.user_id');
$q->addOrder('contact_first_name, contact_last_name');
$q->addWhere('p.project_id = ' . $project_id);
$users = arrayMerge(array('-1' => $AppUI->_('All members')), $q->loadHashList());
$cost_code = dPgetParam($_GET, 'cost_code', '0');
if (isset($_GET['user_id'])) {
    $AppUI->setState('ProjectsTaskLogsUserFilter', $_GET['user_id']);
}
$user_id = $AppUI->getState('ProjectsTaskLogsUserFilter') ? $AppUI->getState('ProjectsTaskLogsUserFilter') : $AppUI->user_id;
if (isset($_GET['hide_inactive'])) {
    $AppUI->setState('ProjectsTaskLogsHideArchived', true);
} else {
    $AppUI->setState('ProjectsTaskLogsHideArchived', false);
}
$hide_inactive = $AppUI->getState('ProjectsTaskLogsHideArchived');
if (isset($_GET['hide_complete'])) {
    $AppUI->setState('ProjectsTaskLogsHideComplete', true);
} else {
    $AppUI->setState('ProjectsTaskLogsHideComplete', false);
开发者ID:n2i,项目名称:xvnkb,代码行数:31,代码来源:vw_logs.php

示例12: getUsersWithRole

 public function getUsersWithRole()
 {
     $q = new DBQuery();
     $q->addTable($this->_db_acl_prefix . 'groups_aro_map', 'g');
     $q->addQuery('DISTINCT(g.aro_id)');
     $result = $q->loadHashList();
     $q->clear();
     if (count($result)) {
         return $result;
     } else {
         return false;
     }
 }
开发者ID:joly,项目名称:web2project,代码行数:13,代码来源:permissions.class.php

示例13: dPformSafe

$search_text = $AppUI->getState('searchtext') ? $AppUI->getState('searchtext') : '';
$search_text = dPformSafe($search_text);
$titleBlock->addCell('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $AppUI->_('Search') . ':');
$titleBlock->addCell('<input type="text" class="text" SIZE="20" name="searchtext"' . ' onChange="document.searchfilter.submit();" value="' . $search_text . '"title="' . $AppUI->_('Search in name and description fields') . '"/><!--<input type="submit" class="button" value=">" title="' . $AppUI->_('Search in name and description fields') . '"/>-->', '', '<form action="?m=tasks" method="post" id="searchfilter">', '</form>');
// Let's see if this user has admin privileges
if (getPermission('admin', 'view')) {
    $titleBlock->addCell();
    $titleBlock->addCell($AppUI->_('User') . ':');
    $q = new DBQuery();
    $q->addTable('users', 'u');
    $q->addTable('contacts', 'con');
    $q->addQuery('user_id');
    $q->addQuery("CONCAT(contact_last_name, ', ', contact_first_name, ' (', user_username, ')')" . ' AS label');
    $q->addOrder('contact_last_name');
    $q->addWhere('u.user_contact = con.contact_id');
    $user_list = $q->loadHashList();
    $titleBlock->addCell(arraySelect($user_list, 'user_id', 'size="1" class="text"' . ' onChange="document.userIdForm.submit();"', $user_id, false, true), '', '<form action="?m=tasks" method="post" name="userIdForm">', '</form>');
}
$titleBlock->addCell();
$titleBlock->addCell($AppUI->_('Company') . '/' . $AppUI->_('Department') . ':');
//get list of all departments, filtered by the list of permitted companies.
$q = new DBQuery();
$q->addTable('companies', 'c');
$q->addQuery('c.company_id, c.company_name, dep.*');
$q->addJoin('departments', 'dep', 'c.company_id = dep.dept_company');
$q->addOrder('c.company_name, dep.dept_parent, dep.dept_name');
$rows = $q->loadList();
//display the select list
$cBuffer = '<select name="department" onChange="document.companyFilter.submit()" class="text">';
$cBuffer .= '<option value="' . $company_prefix . '0" style="font-weight:bold;">' . $AppUI->_('All') . '</option>' . "\n";
$company = '';
开发者ID:hightechcompany,项目名称:dotproject,代码行数:31,代码来源:index.php

示例14: getCompanies

 public function getCompanies($AppUI)
 {
     $q = new DBQuery();
     $q->addTable('companies');
     $q->addQuery('company_id, company_name');
     $where = $this->getAllowedSQL($AppUI->user_id, 'company_id');
     $q->addWhere($where);
     return $q->loadHashList('company_id');
 }
开发者ID:joly,项目名称:web2project,代码行数:9,代码来源:companies.class.php

示例15: DBQuery

</table>
</form>
<center>
	<table class="std">
<?php 
if ($do_report) {
    // Let's figure out which users we have
    $query = new DBQuery();
    $query->addTable('users', 'u');
    $query->leftJoin('contacts', 'c', 'c.contact_id = u.user_contact');
    $query->addQuery('u.user_id, u.user_username, c.contact_first_name, c.contact_last_name');
    if ($log_userfilter) {
        $query->addWhere('user_id = ' . $log_userfilter);
    }
    $query->addOrder('user_username');
    $user_list = $query->loadHashList('user_id');
    $query->clear();
    $proj = new CProject();
    $task = new CTask();
    $ss = $start_date->format(FMT_DATETIME_MYSQL);
    $se = $end_date->format(FMT_DATETIME_MYSQL);
    $query->addTable('tasks', 't');
    $query->leftJoin('projects', 'p', 'p.project_id = t.task_project');
    $query->addQuery('t.*');
    if ($use_period) {
        $query->addWhere("((task_start_date >= '{$ss}' AND task_start_date <= '{$se}') " . " OR (task_end_date <= '{$se}' AND task_end_date >= '{$ss}'))");
    }
    if ($project_id) {
        $query->addWhere('t.task_project = ' . $project_id);
    }
    // Now add the required restrictions.
开发者ID:klr2003,项目名称:sourceread,代码行数:31,代码来源:tasksperuser.php


注:本文中的DBQuery::loadHashList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。