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


PHP ProjectMilestones类代码示例

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


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

示例1: getMilestone

 function getMilestone()
 {
     if ($this->getMilestoneId() > 0 && !$this->milestone) {
         $this->milestone = ProjectMilestones::findById($this->getMilestoneId());
     }
     return $this->milestone;
 }
开发者ID:rorteg,项目名称:fengoffice,代码行数:7,代码来源:ProjectTask.class.php

示例2: addObject

 /**
  * 
  * @author Ignacio Vazquez - elpepe.uy@gmail.com
  * @param ProjectTask $object
  */
 function addObject($object)
 {
     if ($this->hasObject($object)) {
         return;
     }
     if (!$object->isTemplate() && $object->canBeTemplate()) {
         // the object isn't a template but can be, create a template copy
         $copy = $object->copy();
         $copy->setColumnValue('is_template', true);
         if ($copy instanceof ProjectTask) {
             // don't copy milestone and parent task
             $copy->setMilestoneId(0);
             $copy->setParentId(0);
         }
         $copy->save();
         //Also copy members..
         // 			$memberIds = json_decode(array_var($_POST, 'members'));
         // 			$controller  = new ObjectController() ;
         // 			$controller->add_to_members($copy, $memberIds);
         // copy subtasks
         if ($copy instanceof ProjectTask) {
             ProjectTasks::copySubTasks($object, $copy, true);
         } else {
             if ($copy instanceof ProjectMilestone) {
                 ProjectMilestones::copyTasks($object, $copy, true);
             }
         }
         // copy custom properties
         $copy->copyCustomPropertiesFrom($object);
         // copy linked objects
         $linked_objects = $object->getAllLinkedObjects();
         if (is_array($linked_objects)) {
             foreach ($linked_objects as $lo) {
                 $copy->linkObject($lo);
             }
         }
         // copy reminders
         $reminders = ObjectReminders::getByObject($object);
         foreach ($reminders as $reminder) {
             $copy_reminder = new ObjectReminder();
             $copy_reminder->setContext($reminder->getContext());
             $copy_reminder->setDate(EMPTY_DATETIME);
             $copy_reminder->setMinutesBefore($reminder->getMinutesBefore());
             $copy_reminder->setObject($copy);
             $copy_reminder->setType($reminder->getType());
             // $copy_reminder->setContactId($reminder->getContactId()); //TODO Feng 2 -  No  anda
             $copy_reminder->save();
         }
         $template = $copy;
     } else {
         // the object is already a template or can't be one, use it as it is
         $template = $object;
     }
     $to = new TemplateObject();
     $to->setObject($template);
     $to->setTemplate($this);
     $to->save();
     return $template->getObjectId();
 }
开发者ID:rorteg,项目名称:fengoffice,代码行数:64,代码来源:COTemplate.class.php

示例3: getProjectsByUser

 /**
  * Return all projects that this user is part of
  *
  * @access public
  * @param User $user
  * @param 
  * @return array
  */
 function getProjectsByUser(User $user, $additional_conditions = null, $additional_sort = null)
 {
     trace(__FILE__, "getProjectsByUser(user, {$additional_conditions}, {$additional_sort})");
     $projects_table = Projects::instance()->getTableName(true);
     trace(__FILE__, "getProjectsByUser():1");
     $project_users_table = ProjectUsers::instance()->getTableName(true);
     trace(__FILE__, "getProjectsByUser():2");
     $project_milestones_table = ProjectMilestones::instance()->getTableName(true);
     trace(__FILE__, "getProjectsByUser():3");
     $empty_datetime = DB::escape(EMPTY_DATETIME);
     $projects = array();
     if (trim($additional_sort) == 'milestone') {
         $sql = "SELECT distinct {$projects_table}.* FROM {$projects_table}";
         $sql .= " left outer join {$project_milestones_table} on {$project_milestones_table}.`project_id` = {$projects_table}.`id`";
         $sql .= " inner join {$project_users_table} on {$projects_table}.`id` = {$project_users_table}.`project_id`";
         $sql .= " where {$project_users_table}.`user_id` = " . DB::escape($user->getId()) . " and ({$project_milestones_table}.`completed_on` = {$empty_datetime} or isnull({$project_milestones_table}.`completed_on`))";
     } else {
         $sql = "SELECT {$projects_table}.* FROM {$projects_table}, {$project_users_table} WHERE ({$projects_table}.`id` = {$project_users_table}.`project_id` AND {$project_users_table}.`user_id` = " . DB::escape($user->getId()) . ')';
     }
     if (trim($additional_conditions) != '') {
         $sql .= " AND ({$additional_conditions})";
     }
     // if
     if (trim($additional_sort) == 'priority') {
         $sql .= " ORDER BY isnull({$projects_table}.`priority`), {$projects_table}.`priority`, {$projects_table}.`name`";
     } elseif (trim($additional_sort) == 'milestone') {
         $sql .= " ORDER BY isnull({$project_milestones_table}.`due_date`), {$project_milestones_table}.`due_date`, {$projects_table}.`name` ";
     } else {
         $sql .= " ORDER BY {$projects_table}.`name`";
     }
     trace(__FILE__, "getProjectsByUser(): sql={$sql}");
     $rows = DB::executeAll($sql);
     trace(__FILE__, "getProjectsByUser(): sql={$sql} ok");
     if (is_array($rows)) {
         foreach ($rows as $row) {
             $projects[] = Projects::instance()->loadFromRow($row);
         }
         // foreach
     }
     // if
     return count($projects) ? $projects : null;
 }
开发者ID:bklein01,项目名称:Project-Pier,代码行数:50,代码来源:ProjectUsers.class.php

示例4: 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('`project_id` = ? 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`'));
 }
开发者ID:swenson,项目名称:projectpier,代码行数:15,代码来源:Project.class.php

示例5: manager

 /**
 * Return manager instance
 *
 * @access protected
 * @param void
 * @return ProjectMilestones 
 */
 function manager() {
   if(!($this->manager instanceof ProjectMilestones)) $this->manager = ProjectMilestones::instance();
   return $this->manager;
 } // manager
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:11,代码来源:BaseProjectMilestone.class.php

示例6: stylesheet_tag

    $timeformat = 'g:i A';
}
echo stylesheet_tag('event/day.css');
$today = DateTimeValueLib::now();
$today->add('h', logged_user()->getTimezone());
$currentday = $today->format("j");
$currentmonth = $today->format("n");
$currentyear = $today->format("Y");
$drawHourLine = $day == $currentday && $month == $currentmonth && $year == $currentyear;
$dtv = DateTimeValueLib::make(0, 0, 0, $month, $day, $year);
$result = ProjectEvents::getDayProjectEvents($dtv, $tags, active_project(), $user_filter, $status_filter);
if (!$result) {
    $result = array();
}
$alldayevents = array();
$milestones = ProjectMilestones::getRangeMilestonesByUser($dtv, $dtv, $user_filter != -1 ? $user : null, $tags, active_project());
$tasks = ProjectTasks::getRangeTasksByUser($dtv, $dtv, $user_filter != -1 ? $user : null, $tags, active_project());
$birthdays = Contacts::instance()->getRangeContactsByBirthday($dtv, $dtv);
foreach ($result as $key => $event) {
    if ($event->getTypeId() > 1) {
        $alldayevents[] = $event;
        unset($result[$key]);
    }
}
if ($milestones) {
    $alldayevents = array_merge($alldayevents, $milestones);
}
if ($tasks) {
    $tmp_tasks = array();
    $dtv_end = new DateTimeValue($dtv->getTimestamp() + 60 * 60 * 24);
    foreach ($tasks as $task) {
开发者ID:pnagaraju25,项目名称:fengoffice,代码行数:31,代码来源:viewdate.php

示例7: new_list_tasks


//.........这里部分代码省略.........
             break;
         case 14:
             // Today + Overdue tasks
             $task_status_condition = " AND `completed_on` = " . DB::escape(EMPTY_DATETIME) . " AND `due_date` <= '{$now}'";
             break;
         case 20:
             // Actives task by current user
             $task_status_condition = " AND `completed_on` = " . DB::escape(EMPTY_DATETIME) . " AND `start_date` <= '{$now}' AND `assigned_to_contact_id` = " . logged_user()->getId();
             break;
         case 21:
             // Subscribed tasks by current user
             $res20 = DB::execute("SELECT object_id FROM " . TABLE_PREFIX . "object_subscriptions WHERE `contact_id` = " . logged_user()->getId());
             $subs_rows = $res20->fetchAll($res20);
             foreach ($subs_rows as $row) {
                 $subs[] = $row['object_id'];
             }
             unset($res20, $subs_rows, $row);
             $task_status_condition = " AND `completed_on` = " . DB::escape(EMPTY_DATETIME) . " AND `id` IN(" . implode(',', $subs) . ")";
             break;
         case 2:
             // All tasks
             break;
         default:
             throw new Exception('Task status "' . $status . '" not recognised');
     }
     $conditions = "AND {$template_condition} {$task_filter_condition} {$task_status_condition}";
     //Now get the tasks
     //$tasks = ProjectTasks::getContentObjects(active_context(), ObjectTypes::findById(ProjectTasks::instance()->getObjectTypeId()), null, null, $conditions,null)->objects;
     $tasks = ProjectTasks::instance()->listing(array("extra_conditions" => $conditions, "start" => 0, "limit" => 501, "count_results" => false))->objects;
     $pendingstr = $status == 0 ? " AND `completed_on` = " . DB::escape(EMPTY_DATETIME) . " " : "";
     $milestone_conditions = " AND `is_template` = false " . $pendingstr;
     //Find all internal milestones for these tasks
     //$internalMilestones = ProjectMilestones::getContentObjects(active_context(), ObjectTypes::findById(ProjectMilestones::instance()->getObjectTypeId()), null, null, $milestone_conditions,null)->objects;
     $internalMilestones = ProjectMilestones::instance()->listing(array("extra_conditions" => $milestone_conditions))->objects;
     //Find all external milestones for these tasks, external milestones are the ones that belong to a parent member and have tasks in the current member
     $milestone_ids = array();
     if ($tasks) {
         foreach ($tasks as $task) {
             if ($task->getMilestoneId() != 0) {
                 $milestone_ids[$task->getMilestoneId()] = $task->getMilestoneId();
             }
         }
     }
     $int_milestone_ids = array();
     foreach ($internalMilestones as $milestone) {
         $int_milestone_ids[] = $milestone->getId();
     }
     $milestone_ids = array_diff($milestone_ids, $int_milestone_ids);
     if (count($milestone_ids) == 0) {
         $milestone_ids[] = 0;
     }
     $ext_milestone_conditions = " `is_template` = false " . $pendingstr . ' AND `object_id` IN (' . implode(',', $milestone_ids) . ')';
     $externalMilestones = ProjectMilestones::findAll(array('conditions' => $ext_milestone_conditions));
     // Get Users Info
     $users = allowed_users_in_context(ProjectTasks::instance()->getObjectTypeId(), active_context(), ACCESS_LEVEL_READ);
     $allUsers = Contacts::getAllUsers();
     $user_ids = array(-1);
     foreach ($users as $user) {
         $user_ids[] = $user->getId();
     }
     // only companies with users
     $companies = Contacts::findAll(array("conditions" => "e.is_company = 1", "join" => array("table" => Contacts::instance()->getTableName(), "jt_field" => "object_id", "j_sub_q" => "SELECT xx.object_id FROM " . Contacts::instance()->getTableName(true) . " xx WHERE \n\t\t\t\t\txx.is_company=0 AND xx.company_id = e.object_id AND xx.object_id IN (" . implode(",", $user_ids) . ") LIMIT 1")));
     tpl_assign('tasks', $tasks);
     if (config_option('use tasks dependencies')) {
         $dependency_count = array();
         foreach ($tasks as $task) {
开发者ID:rorteg,项目名称:fengoffice,代码行数:67,代码来源:TaskController.class.php

示例8: getOverdueAndUpcomingObjects

	static function getOverdueAndUpcomingObjects($limit = null) {
		$conditions_tasks = " AND is_template = 0 AND `e`.`completed_by_id` = 0 AND `e`.`due_date` > 0";
		$conditions_milestones = " AND is_template = 0 AND `e`.`completed_by_id` = 0 AND `e`.`due_date` > 0";
		
		if (!SystemPermissions::userHasSystemPermission(logged_user(), 'can_see_assigned_to_other_tasks')) {
			$conditions_tasks .= " AND assigned_to_contact_id = ".logged_user()->getId();
		}
		
		$tasks_result = self::instance()->listing(array(
			"limit" => $limit, 
			"extra_conditions" => $conditions_tasks, 
			"order"=>  array('due_date', 'priority'), 
			"order_dir" => "ASC"
		));
		$tasks = $tasks_result->objects;
		
		$milestones_result = ProjectMilestones::instance()->listing(array(
			"limit" => $limit, 
			"extra_conditions" => $conditions_milestones, 
			"order" => array('due_date'), 
			"order_dir" => "ASC"
		));
		$milestones = $milestones_result->objects;
		
		$ordered = array();
		foreach ($tasks as $task) { /* @var $task ProjectTask */
			if (!$task->isCompleted() && $task->getDueDate() instanceof  DateTimeValue ) {
				if (!isset($ordered[$task->getDueDate()->getTimestamp()])){ 
					$ordered[$task->getDueDate()->getTimestamp()] = array();
				}
				$ordered[$task->getDueDate()->getTimestamp()][] = $task;
			}
		}
		foreach ($milestones as $milestone) {
			if (!isset($ordered[$milestone->getDueDate()->getTimestamp()])) {
				$ordered[$milestone->getDueDate()->getTimestamp()] = array();
			}
			$ordered[$milestone->getDueDate()->getTimestamp()][] = $milestone;
		}
		
		ksort($ordered, SORT_NUMERIC);
		
		$ordered_flat = array();
		foreach ($ordered as $k => $values) {
			foreach ($values as $v) $ordered_flat[] = $v;
		}
		
		return $ordered_flat;
	}
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:49,代码来源:ProjectTasks.class.php

示例9: new_list_tasks

 function new_list_tasks()
 {
     //load config options into cache for better performance
     load_user_config_options_by_category_name('task panel');
     $isJson = array_var($_GET, 'isJson', false);
     if ($isJson) {
         ajx_current("empty");
     }
     $request_conditions = $this->get_tasks_request_conditions();
     $conditions = $request_conditions['conditions'];
     $filter_value = $request_conditions['filterValue'];
     $filter = $request_conditions['filter'];
     $status = $request_conditions['status'];
     $tasks = array();
     $pendingstr = $status == 0 ? " AND `e`.`completed_on` = " . DB::escape(EMPTY_DATETIME) . " " : "";
     $milestone_conditions = " AND `is_template` = false " . $pendingstr;
     //Find all internal milestones for these tasks
     $internalMilestones = ProjectMilestones::instance()->listing(array("extra_conditions" => $milestone_conditions))->objects;
     //Find all external milestones for these tasks, external milestones are the ones that belong to a parent member and have tasks in the current member
     $milestone_ids = array();
     $task_ids = array();
     if ($tasks) {
         foreach ($tasks as $task) {
             $task_ids[] = $task['id'];
             if ($task['milestone_id'] != 0) {
                 $milestone_ids[$task['milestone_id']] = $task['milestone_id'];
             }
         }
         // generate request cache
         ObjectMembers::instance()->getCachedObjectMembers(0, $task_ids);
         ProjectTasks::instance()->findByRelatedCached(0, $task_ids);
     }
     $cp_values = array();
     if (count($task_ids) > 0) {
         $cp_rows = DB::executeAll("SELECT * FROM " . TABLE_PREFIX . "custom_property_values WHERE object_id IN (" . implode(',', $task_ids) . ")");
         if (is_array($cp_rows)) {
             foreach ($cp_rows as $row) {
                 if (!isset($cp_values[$row['object_id']])) {
                     $cp_values[$row['object_id']] = array();
                 }
                 if (!isset($cp_values[$row['object_id']][$row['custom_property_id']])) {
                     $cp_values[$row['object_id']][$row['custom_property_id']] = array();
                 }
                 $cp_values[$row['object_id']][$row['custom_property_id']][] = $row['value'];
             }
         }
     }
     tpl_assign('cp_values', $cp_values);
     $int_milestone_ids = array();
     foreach ($internalMilestones as $milestone) {
         $int_milestone_ids[] = $milestone->getId();
     }
     $milestone_ids = array_diff($milestone_ids, $int_milestone_ids);
     if (count($milestone_ids) == 0) {
         $milestone_ids[] = 0;
     }
     $ext_milestone_conditions = " `is_template` = false " . $pendingstr . ' AND `object_id` IN (' . implode(',', $milestone_ids) . ')';
     $externalMilestones = ProjectMilestones::findAll(array('conditions' => $ext_milestone_conditions));
     // Get Users Info
     if (logged_user()->isGuest()) {
         $users = array(logged_user());
     } else {
         $users = allowed_users_in_context(ProjectTasks::instance()->getObjectTypeId(), active_context(), ACCESS_LEVEL_READ, '', true);
     }
     $allUsers = Contacts::getAllUsers(null, true);
     $user_ids = array(-1);
     foreach ($allUsers as $user) {
         $user_ids[] = $user->getId();
     }
     // only companies with users
     $companies = Contacts::findAll(array("conditions" => "e.is_company = 1", "join" => array("table" => Contacts::instance()->getTableName(), "jt_field" => "object_id", "j_sub_q" => "SELECT xx.object_id FROM " . Contacts::instance()->getTableName(true) . " xx WHERE \r\n\t\t\t\t\txx.is_company=0 AND xx.company_id = e.object_id AND xx.object_id IN (" . implode(",", $user_ids) . ") LIMIT 1")));
     tpl_assign('tasks', $tasks);
     if (!$isJson) {
         $all_templates = COTemplates::findAll(array('conditions' => '`trashed_by_id` = 0 AND `archived_by_id` = 0'));
         tpl_assign('all_templates', $all_templates);
         if (user_config_option('task_display_limit') > 0 && count($tasks) > user_config_option('task_display_limit')) {
             tpl_assign('displayTooManyTasks', true);
             array_pop($tasks);
         }
         tpl_assign('object_subtypes', array());
         tpl_assign('internalMilestones', $internalMilestones);
         tpl_assign('externalMilestones', $externalMilestones);
         tpl_assign('users', $users);
         tpl_assign('allUsers', $allUsers);
         tpl_assign('companies', $companies);
         if (strtotime(user_config_option('tasksDateStart'))) {
             //this return null if date is 0000-00-00 00:00:00
             $dateStart = new DateTime('@' . strtotime(user_config_option('tasksDateStart')));
             $dateStart = $dateStart->format(user_config_option('date_format'));
         } else {
             $dateStart = '';
         }
         if (strtotime(user_config_option('tasksDateEnd'))) {
             //this return null if date is 0000-00-00 00:00:00
             $dateEnd = new DateTime('@' . strtotime(user_config_option('tasksDateEnd')));
             $dateEnd = $dateEnd->format(user_config_option('date_format'));
         } else {
             $dateEnd = '';
         }
         $userPref = array();
//.........这里部分代码省略.........
开发者ID:abhinay100,项目名称:feng_app,代码行数:101,代码来源:TaskController.class.php

示例10: 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

示例11: get_assignable_milestones

	/**
	 * Returns the milestones included in the present workspace and all of its parents. This is because tasks from a particular workspace
	 * can only be assigned to milestones from that workspace and from any of its parents.
	 */
	function get_assignable_milestones() {
		ajx_current("empty");
		$ms = ProjectMilestones::findAll();
		if ($ms === null) $ms = array();
		$ms_info = array();
		foreach ($ms as $milestone) {
			$ms_info[] = $milestone->getArrayInfo();
		}
		ajx_extra_data(array('milestones' => $ms_info));
	}
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:14,代码来源:MilestoneController.class.php

示例12: instantiate

 function instantiate()
 {
     $id = get_id();
     $template = COTemplates::findById($id);
     if (!$template instanceof COTemplate) {
         flash_error(lang("template dnx"));
         ajx_current("empty");
         return;
     }
     $parameters = TemplateParameters::getParametersByTemplate($id);
     $parameterValues = array_var($_POST, 'parameterValues');
     if (count($parameters) > 0 && !isset($parameterValues)) {
         ajx_current("back");
         return;
     }
     $objects = $template->getObjects();
     foreach ($objects as $object) {
         if (!$object instanceof ProjectDataObject) {
             continue;
         }
         // copy object
         $copy = $object->copy();
         if ($copy->columnExists('is_template')) {
             $copy->setColumnValue('is_template', false);
         }
         if ($copy instanceof ProjectTask) {
             // don't copy parent task and milestone
             $copy->setMilestoneId(0);
             $copy->setParentId(0);
         }
         $copy->save();
         $wsId = array_var($_POST, 'project_id', active_or_personal_project()->getId());
         // if specified, set workspace
         $workspace = Projects::findById($wsId);
         if (!$workspace instanceof Project) {
             $workspace = active_or_personal_project();
         }
         $copy->addToWorkspace($workspace);
         // add object tags and specified tags
         $tags = implode(',', $object->getTagNames());
         $copy->setTagsFromCSV($tags . "," . array_var($_POST, 'tags'));
         // copy linked objects
         $copy->copyLinkedObjectsFrom($object);
         // copy subtasks if applicable
         if ($copy instanceof ProjectTask) {
             ProjectTasks::copySubTasks($object, $copy, false);
             $manager = new ProjectTask();
         } else {
             if ($copy instanceof ProjectMilestone) {
                 ProjectMilestones::copyTasks($object, $copy, false);
                 $manager = new ProjectMilestone();
             }
         }
         // copy custom properties
         $copy->copyCustomPropertiesFrom($object);
         // set property values as defined in template
         $objProp = TemplateObjectProperties::getPropertiesByTemplateObject($id, $object->getId());
         foreach ($objProp as $property) {
             $propName = $property->getProperty();
             $value = $property->getValue();
             if ($manager->getColumnType($propName) == DATA_TYPE_STRING) {
                 if (is_array($parameterValues)) {
                     foreach ($parameterValues as $param => $val) {
                         $value = str_replace('{' . $param . '}', $val, $value);
                     }
                 }
             } else {
                 if ($manager->getColumnType($propName) == DATA_TYPE_DATE || $manager->getColumnType($propName) == DATA_TYPE_DATETIME) {
                     $operator = '+';
                     if (strpos($value, '+') === false) {
                         $operator = '-';
                     }
                     $opPos = strpos($value, $operator);
                     if ($opPos !== false) {
                         $dateParam = substr($value, 1, strpos($value, '}') - 1);
                         $dateUnit = substr($value, strlen($value) - 1);
                         // d, w or m (for days, weeks or months)
                         if ($dateUnit == 'm') {
                             $dateUnit = 'M';
                             // make month unit uppercase to call DateTimeValue::add with correct parameter
                         }
                         $dateNum = (int) substr($value, strpos($value, $operator), strlen($value) - 2);
                         $date = $parameterValues[$dateParam];
                         $date = DateTimeValueLib::dateFromFormatAndString(user_config_option('date_format'), $date);
                         $value = $date->add($dateUnit, $dateNum);
                     }
                 } else {
                     if ($manager->getColumnType($propName) == DATA_TYPE_INTEGER) {
                         if (is_array($parameterValues)) {
                             foreach ($parameterValues as $param => $val) {
                                 $value = str_replace('{' . $param . '}', $val, $value);
                             }
                         }
                     }
                 }
             }
             if ($value != '') {
                 $copy->setColumnValue($propName, $value);
                 $copy->save();
             }
//.........这里部分代码省略.........
开发者ID:pnagaraju25,项目名称:fengoffice,代码行数:101,代码来源:TemplateController.class.php

示例13: replace_milestone_link_callback

/**
 * Call back function for milestone link
 * 
 * @param mixed $matches
 * @return
 */
function replace_milestone_link_callback($matches)
{
    if (count($matches) < 2) {
        return null;
    }
    // if
    if (!logged_user()->isMemberOfOwnerCompany()) {
        $object = ProjectMilestones::findOne(array('conditions' => array('`id` = ? AND `project_id` = ? AND `is_private` = 0 ', $matches[1], active_project()->getId())));
    } else {
        $object = ProjectMilestones::findOne(array('conditions' => array('`id` = ? AND `project_id` = ?', $matches[1], active_project()->getId())));
    }
    // if
    if (!$object instanceof ProjectMilestone) {
        return '<del>' . lang('invalid reference') . '</del>';
    } else {
        return '<a href="' . $object->getViewUrl() . '">' . $object->getName() . '</a>';
    }
    // if
}
开发者ID:bahmany,项目名称:PythonPurePaperless,代码行数:25,代码来源:init.php

示例14: getExternalColumnValue

	function getExternalColumnValue($field, $id, $manager = null){
		$value = '';
		if($field == 'user_id' || $field == 'contact_id' || $field == 'created_by_id' || $field == 'updated_by_id' || $field == 'assigned_to_contact_id' || $field == 'completed_by_id'|| $field == 'approved_by_id'){
			$contact = Contacts::findById($id);
			if($contact instanceof Contact) $value = $contact->getObjectName();
		} else if($field == 'milestone_id'){
			$milestone = ProjectMilestones::findById($id);
			if($milestone instanceof ProjectMilestone) $value = $milestone->getObjectName();
		} else if($field == 'company_id'){
			$company = Contacts::findById($id);
			if($company instanceof Contact && $company->getIsCompany()) $value = $company->getObjectName();
		} else if ($manager instanceof ContentDataObjects) {
			$value = $manager->getExternalColumnValue($field, $id);
		}
		return $value;
	}
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:16,代码来源:Reports.class.php

示例15: project_ical

 /**
  * Show calendar for specific project
  *
  * @param void
  * @return null
  */
 function project_ical()
 {
     $this->setLayout('ical');
     $user = $this->loginUserByToken();
     if (!$user instanceof User) {
         header('HTTP/1.0 404 Not Found');
         die;
     }
     // if
     $project = Projects::findById(array_var($_GET, 'project'));
     if (!$project instanceof Project) {
         header('HTTP/1.0 404 Not Found');
         die;
     }
     // if
     if (!$user->isProjectUser($project)) {
         header('HTTP/1.0 404 Not Found');
         die;
     }
     // if
     $this->renderCalendar($user, lang('project calendar', $project->getName()), ProjectMilestones::getActiveMilestonesByUserAndProject($user, $project));
 }
开发者ID:pnagaraju25,项目名称:fengoffice,代码行数:28,代码来源:FeedController.class.php


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