本文整理汇总了PHP中ProjectTasks::getWorkspaceString方法的典型用法代码示例。如果您正苦于以下问题:PHP ProjectTasks::getWorkspaceString方法的具体用法?PHP ProjectTasks::getWorkspaceString怎么用?PHP ProjectTasks::getWorkspaceString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProjectTasks
的用法示例。
在下文中一共展示了ProjectTasks::getWorkspaceString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getUsersMilestones
/**
* Return array of milestones that are assigned to specific user or his company
*
* @param User $user
* @return array
*/
function getUsersMilestones(User $user)
{
$conditions = DB::prepareString(ProjectTasks::getWorkspaceString() . ' AND ((`assigned_to_user_id` = ? AND `assigned_to_company_id` = ?) OR (`assigned_to_user_id` = ? AND `assigned_to_company_id` = ?) OR (`assigned_to_user_id` = ? AND `assigned_to_company_id` = ?)) AND `completed_on` = ?', array($this->getId(), $user->getId(), $user->getCompanyId(), 0, $user->getCompanyId(), 0, 0, EMPTY_DATETIME));
if (!$user->isMemberOfOwnerCompany()) {
$conditions .= DB::prepareString(' AND `is_private` = ?', array(0));
}
// if
return ProjectMilestones::findAll(array('conditions' => $conditions, 'order' => '`due_date`'));
}
示例2: new_list_tasks
function new_list_tasks()
{
//load config options into cache for better performance
load_user_config_options_by_category_name('task panel');
// get query parameters, save user preferences if necessary
$status = array_var($_GET, 'status', null);
if (is_null($status) || $status == '') {
$status = user_config_option('task panel status', 2);
} else {
if (user_config_option('task panel status') != $status) {
set_user_config_option('task panel status', $status, logged_user()->getId());
}
}
$previous_filter = user_config_option('task panel filter', 'assigned_to');
$filter = array_var($_GET, 'filter');
if (is_null($filter) || $filter == '') {
$filter = user_config_option('task panel filter', 'assigned_to');
} else {
if (user_config_option('task panel filter') != $filter) {
set_user_config_option('task panel filter', $filter, logged_user()->getId());
}
}
if ($filter != 'no_filter') {
$filter_value = array_var($_GET, 'fval');
if (is_null($filter_value) || $filter_value == '') {
$filter_value = user_config_option('task panel filter value', logged_user()->getCompanyId() . ':' . logged_user()->getId());
set_user_config_option('task panel filter value', $filter_value, logged_user()->getId());
$filter = $previous_filter;
set_user_config_option('task panel filter', $filter, logged_user()->getId());
} else {
if (user_config_option('task panel filter value') != $filter_value) {
set_user_config_option('task panel filter value', $filter_value, logged_user()->getId());
}
}
}
$isJson = array_var($_GET, 'isJson', false);
if ($isJson) {
ajx_current("empty");
}
$project = active_project();
$tag = active_tag();
$template_condition = "`is_template` = 0 ";
//Get the task query conditions
$task_filter_condition = "";
switch ($filter) {
case 'assigned_to':
$assigned_to = explode(':', $filter_value);
$assigned_to_user = array_var($assigned_to, 1, 0);
$assigned_to_company = array_var($assigned_to, 0, 0);
if ($assigned_to_user > 0) {
$task_filter_condition = " AND (`assigned_to_user_id` = " . $assigned_to_user . " OR (`assigned_to_company_id` = " . $assigned_to_company . " AND `assigned_to_user_id` = 0)) ";
} else {
if ($assigned_to_company > 0) {
$task_filter_condition = " AND `assigned_to_company_id` = " . $assigned_to_company . " AND `assigned_to_user_id` = 0";
} else {
if ($assigned_to_company == -1 && $assigned_to_user == -1) {
$task_filter_condition = " AND `assigned_to_company_id` = 0 AND `assigned_to_user_id` = 0 ";
}
}
}
break;
case 'assigned_by':
if ($filter_value != 0) {
$task_filter_condition = " AND `assigned_by_id` = " . $filter_value . " ";
}
break;
case 'created_by':
if ($filter_value != 0) {
$task_filter_condition = " AND `created_by_id` = " . $filter_value . " ";
}
break;
case 'completed_by':
if ($filter_value != 0) {
$task_filter_condition = " AND `completed_by_id` = " . $filter_value . " ";
}
break;
case 'milestone':
$task_filter_condition = " AND `milestone_id` = " . $filter_value . " ";
break;
case 'priority':
$task_filter_condition = " AND `priority` = " . $filter_value . " ";
break;
case 'subtype':
if ($filter_value != 0) {
$task_filter_condition = " AND `object_subtype` = " . $filter_value . " ";
}
break;
case 'no_filter':
$task_filter_condition = "";
break;
default:
flash_error(lang('task filter criteria not recognised', $filter));
}
if ($project instanceof Project) {
$pids = $project->getAllSubWorkspacesQuery(true);
$projectstr = " AND " . ProjectTasks::getWorkspaceString($pids);
} else {
$pids = "";
$projectstr = "";
}
//.........这里部分代码省略.........
示例3: getDashboardObjectQueries
/**
* Returns array of queries that will return Dashboard Objects
*
* @param string $proj_ids
* @param string $tag
* @param boolean $count if false the query will return objects, if true it will return object count
*/
static function getDashboardObjectQueries($project = null, $tag = null, $count = false, $trashed = false, $linkedObject = null, $order = 'updatedOn', $filterName = '', $archived = false, $filterManager = '')
{
if ($trashed && $trashed !== 'all') {
$order = 'trashedOn';
} else {
if ($archived) {
$order = 'archivedOn';
}
}
switch ($order) {
case 'dateCreated':
$order_crit_companies = '`created_on`';
$order_crit_contacts = '`created_on`';
$order_crit_file_revisions = '`created_on`';
$order_crit_calendar = '`created_on`';
$order_crit_tasks = '`created_on`';
$order_crit_milestones = '`created_on`';
$order_crit_webpages = '`created_on`';
$order_crit_files = '`created_on`';
$order_crit_emails = '`received_date`';
$order_crit_comments = '`created_on`';
$order_crit_messages = '`created_on`';
$order_crit_workspaces = '`created_on`';
break;
case 'trashedOn':
$order_crit_companies = '`trashed_on`';
$order_crit_contacts = '`trashed_on`';
$order_crit_file_revisions = '`trashed_on`';
$order_crit_calendar = '`trashed_on`';
$order_crit_tasks = '`trashed_on`';
$order_crit_milestones = '`trashed_on`';
$order_crit_webpages = '`trashed_on`';
$order_crit_files = '`trashed_on`';
$order_crit_emails = '`trashed_on`';
$order_crit_comments = '`trashed_on`';
$order_crit_messages = '`trashed_on`';
$order_crit_workspaces = '`updated_on`';
break;
case 'archivedOn':
$order_crit_companies = '`archived_on`';
$order_crit_contacts = '`archived_on`';
$order_crit_file_revisions = '`updated_on`';
$order_crit_calendar = '`archived_on`';
$order_crit_tasks = '`archived_on`';
$order_crit_milestones = '`archived_on`';
$order_crit_webpages = '`archived_on`';
$order_crit_files = '`archived_on`';
$order_crit_emails = '`archived_on`';
$order_crit_comments = '`updated_on`';
$order_crit_messages = '`archived_on`';
$order_crit_workspaces = '`completed_on`';
break;
case 'name':
$order_crit_companies = '`name`';
$order_crit_contacts = "TRIM(CONCAT(' ', `lastname`, `firstname`, `middlename`))";
$order_crit_file_revisions = "'zzzzzzzzzzzzzz'";
//Revisar
$order_crit_calendar = '`subject`';
$order_crit_tasks = '`title`';
$order_crit_milestones = '`name`';
$order_crit_webpages = '`title`';
$order_crit_files = '`filename`';
$order_crit_emails = '`subject`';
$order_crit_comments = '`text`';
$order_crit_messages = '`title`';
$order_crit_workspaces = '`name`';
break;
default:
$order_crit_companies = '`updated_on`';
$order_crit_contacts = '`updated_on`';
$order_crit_file_revisions = '`updated_on`';
$order_crit_calendar = '`updated_on`';
$order_crit_tasks = '`updated_on`';
$order_crit_milestones = '`updated_on`';
$order_crit_webpages = '`updated_on`';
$order_crit_files = '`updated_on`';
$order_crit_emails = '`received_date`';
$order_crit_comments = '`updated_on`';
$order_crit_messages = '`updated_on`';
$order_crit_workspaces = '`updated_on`';
break;
}
if ($project instanceof Project) {
$proj_ids = $project->getAllSubWorkspacesQuery(true);
$proj_cond_companies = Companies::getWorkspaceString($proj_ids);
$proj_cond_messages = ProjectMessages::getWorkspaceString($proj_ids);
$proj_cond_documents = ProjectFiles::getWorkspaceString($proj_ids);
$proj_cond_emails = MailContents::getWorkspaceString($proj_ids);
$proj_cond_events = ProjectEvents::getWorkspaceString($proj_ids);
$proj_cond_tasks = ProjectTasks::getWorkspaceString($proj_ids);
$proj_cond_charts = ProjectCharts::getWorkspaceString($proj_ids);
$proj_cond_milestones = ProjectMilestones::getWorkspaceString($proj_ids);
$proj_cond_weblinks = ProjectWebpages::getWorkspaceString($proj_ids);
//.........这里部分代码省略.........