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


PHP ProjectMilestones::getActiveMilestonesByUser方法代码示例

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


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

示例1: getActiveMilestones

 /**
 * Return all active milestones assigned to this user
 *
 * @param void
 * @return array
 */
 function getActiveMilestones() {
   if (is_null($this->all_active_milestons)) {
     $this->all_active_milestons = ProjectMilestones::getActiveMilestonesByUser($this);
   } // if
   return $this->all_active_milestons;
 } // getActiveMilestones
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:12,代码来源:User.class.php

示例2: get_ext_values

 private function get_ext_values($field, $manager = null)
 {
     $values = array(array('id' => '', 'name' => '-- ' . lang('select') . ' --'));
     if ($field == 'company_id' || $field == 'assigned_to_company_id') {
         $companies = Companies::getVisibleCompanies(logged_user());
         foreach ($companies as $company) {
             $values[] = array('id' => $company->getId(), 'name' => $company->getName());
         }
     } else {
         if ($field == 'user_id' || $field == 'created_by_id' || $field == 'updated_by_id' || $field == 'assigned_to_user_id' || $field == 'completed_by_id') {
             $users = Users::getVisibleUsers(logged_user());
             foreach ($users as $user) {
                 $values[] = array('id' => $user->getId(), 'name' => $user->getDisplayName());
             }
         } else {
             if ($field == 'milestone_id') {
                 $milestones = ProjectMilestones::getActiveMilestonesByUser(logged_user());
                 foreach ($milestones as $milestone) {
                     $values[] = array('id' => $milestone->getId(), 'name' => $milestone->getName());
                 }
             } else {
                 if ($field == 'workspace') {
                     $workspaces = logged_user()->getWorkspaces(false, 0);
                     foreach ($workspaces as $ws) {
                         $values[] = array('id' => $ws->getId(), 'name' => $ws->getName());
                     }
                 } else {
                     if ($field == 'tag') {
                         $tags = Tags::getTagNames();
                         foreach ($tags as $tag) {
                             $values[] = array('id' => $tag['name'], 'name' => $tag['name']);
                         }
                     } else {
                         if ($field == 'object_subtype') {
                             $object_types = ProjectCoTypes::findAll(array('conditions' => !is_null($manager) ? "`object_manager`='{$manager}'" : ""));
                             foreach ($object_types as $object_type) {
                                 $values[] = array('id' => $object_type->getId(), 'name' => $object_type->getName());
                             }
                         }
                     }
                 }
             }
         }
     }
     return $values;
 }
开发者ID:pnagaraju25,项目名称:fengoffice,代码行数:46,代码来源:ReportingController.class.php

示例3: select_milestone

/**
 * Renders select milestone box
 *
 * @param string $name
 * @param Project $project
 * @param integer $selected ID of selected milestone
 * @param array $attributes Array of additional attributes
 * @return string
 * @throws InvalidInstanceError
 */
function select_milestone($name, $context = null, $selected = null, $attributes = null) {
	if(is_array($attributes)) {
		if(!isset($attributes['class'])) $attributes['class'] = 'select_milestone';
	} else {
		$attributes = array('class' => 'select_milestone');
	}

	$options = array(option_tag(lang('none'), 0));
	$milestones = ProjectMilestones::getActiveMilestonesByUser(logged_user(), $context); 

	if(is_array($milestones)) {

		foreach($milestones as $milestone) {
			$option_attributes = $milestone->getId() == $selected ? array('selected' => 'selected') : null;
			$options[] = option_tag($milestone->getObjectName(), $milestone->getId(), $option_attributes);
		}
	}

	return select_box($name, $options, $attributes);
} // select_milestone
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:30,代码来源:application.php

示例4: get_ext_values

 private function get_ext_values($field, $manager = null)
 {
     $values = array(array('id' => '', 'name' => '-- ' . lang('select') . ' --'));
     if ($field == 'contact_id' || $field == 'created_by_id' || $field == 'updated_by_id' || $field == 'assigned_to_contact_id' || $field == 'completed_by_id' || $field == 'approved_by_id') {
         $users = Contacts::getAllUsers();
         foreach ($users as $user) {
             $values[] = array('id' => $user->getId(), 'name' => $user->getObjectName());
         }
     } else {
         if ($field == 'milestone_id') {
             $milestones = ProjectMilestones::getActiveMilestonesByUser(logged_user());
             foreach ($milestones as $milestone) {
                 $values[] = array('id' => $milestone->getId(), 'name' => $milestone->getObjectName());
             }
             /*} else if($field == 'object_subtype'){
             		$object_types = ProjectCoTypes::findAll(array('conditions' => (!is_null($manager) ? "`object_manager`='$manager'" : "")));
             		foreach($object_types as $object_type){
             			$values[] = array('id' => $object_type->getId(), 'name' => $object_type->getName());
             		}*/
         }
     }
     return $values;
 }
开发者ID:rorteg,项目名称:fengoffice,代码行数:23,代码来源:ReportingController.class.php

示例5: select_milestone

/**
 * Renders select milestone box
 *
 * @param string $name
 * @param Project $project
 * @param integer $selected ID of selected milestone
 * @param array $attributes Array of additional attributes
 * @return string
 * @throws InvalidInstanceError
 */
function select_milestone($name, $context = null, $selected = null, $attributes = null)
{
    if (!isset($attributes['template_milestone'])) {
        $milestones = ProjectMilestones::getActiveMilestonesByUser(logged_user(), $context);
    } else {
        //add conditions
        if (isset($attributes['template_id']) && $attributes['template_id'] != 0) {
            $tmp_id = $attributes['template_id'];
            $conditions = '(`session_id` =  0 AND `template_id` = ' . $tmp_id . ' OR `session_id` =  ' . logged_user()->getId() . ')';
        } else {
            $conditions = '`session_id` =  ' . logged_user()->getId();
        }
        $milestones = TemplateMilestones::findAll(array('conditions' => $conditions));
    }
    if (is_array($attributes)) {
        if (!isset($attributes['class'])) {
            $attributes['class'] = 'select_milestone';
        }
    } else {
        $attributes = array('class' => 'select_milestone');
    }
    $options = array(option_tag(lang('none'), 0));
    if (is_array($milestones)) {
        foreach ($milestones as $milestone) {
            $option_attributes = $milestone->getId() == $selected ? array('selected' => 'selected') : null;
            $options[] = option_tag($milestone->getObjectName(), $milestone->getId(), $option_attributes);
        }
    }
    return select_box($name, $options, $attributes);
}
开发者ID:abhinay100,项目名称:feng_app,代码行数:40,代码来源:application.php

示例6: select_milestone

/**
 * Renders select milestone box
 *
 * @param string $name
 * @param Project $project
 * @param integer $selected ID of selected milestone
 * @param array $attributes Array of additional attributes
 * @return string
 * @throws InvalidInstanceError
 */
function select_milestone($name, $project = null, $selected = null, $attributes = null)
{
    if (is_array($attributes)) {
        if (!isset($attributes['class'])) {
            $attributes['class'] = 'select_milestone';
        }
    } else {
        $attributes = array('class' => 'select_milestone');
    }
    // if
    $options = array(option_tag(lang('none'), 0));
    if ($project) {
        $milestones = $project->getOpenMilestones();
    } else {
        $milestones = ProjectMilestones::getActiveMilestonesByUser(logged_user());
    }
    if (is_array($milestones)) {
        if ($selected) {
            //Fixes bug: If task is in a subworkspace of it's milestone's workspace, and user is standing on it, the assigned milestone is set to none when task is edited.
            $is_in_array = false;
            foreach ($milestones as $milestone) {
                if ($milestone->getId() == $selected) {
                    $is_in_array = true;
                }
            }
            if (!$is_in_array) {
                $milestone = ProjectMilestones::findById($selected);
                if ($milestone) {
                    $milestones[] = $milestone;
                }
            }
        }
        foreach ($milestones as $milestone) {
            $option_attributes = $milestone->getId() == $selected ? array('selected' => 'selected') : null;
            $options[] = option_tag($milestone->getName(), $milestone->getId(), $option_attributes);
        }
        // foreach
    }
    // if
    return select_box($name, $options, $attributes);
}
开发者ID:pnagaraju25,项目名称:fengoffice,代码行数:51,代码来源:application.php


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