本文整理汇总了PHP中Projects::setProjectId方法的典型用法代码示例。如果您正苦于以下问题:PHP Projects::setProjectId方法的具体用法?PHP Projects::setProjectId怎么用?PHP Projects::setProjectId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Projects
的用法示例。
在下文中一共展示了Projects::setProjectId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: projectObjArr
/**
* Build the project object array from the given result set
*
* @param resource $result Result set from the database
* @return array Array of Project objects
*/
public static function projectObjArr($result)
{
$objArr = null;
while ($row = mysql_fetch_assoc($result)) {
$tmpcusArr = new Projects();
$tmpcusArr->setProjectId($row[self::PROJECT_DB_FIELD_PROJECT_ID]);
$tmpcusArr->setCustomerId($row[self::PROJECT_DB_FIELD_CUSTOMER_ID]);
$tmpcusArr->setProjectName($row[self::PROJECT_DB_FIELD_NAME]);
$tmpcusArr->setProjectDescription($row[self::PROJECT_DB_FIELD_DESCRIPTION]);
$tmpcusArr->setDeleted($row[self::PROJECT_DB_FIELD_DELETED]);
$objArr[] = $tmpcusArr;
}
return $objArr;
}
示例2: editTimesheetGrid
public function editTimesheetGrid($messageType = null, $message = null, $showComments = 'No')
{
$timesheet = $this->objTime;
/* Setting Grid array: Begins */
$timeEventObj = new TimeEvent();
$timeEventObj->setTimesheetId($timesheet->getTimesheetId());
$timeEventObj->setEmployeeId($timesheet->getEmployeeId());
$timeEventObj->setStartTime($timesheet->getStartDate());
$timeEventObj->setEndTime($timesheet->getEndDate());
$timeEvents = $timeEventObj->fetchTimeEvents();
$eventsCount = count($timeEvents);
$grid = array();
$activityObj = new ProjectActivity();
if ($eventsCount > 0) {
for ($i = 0; $i < $eventsCount; $i++) {
$projectId = $timeEvents[$i]->getProjectId();
$activityId = $timeEvents[$i]->getActivityId();
$gridKey = $timeEvents[$i]->getEmployeeId() . '-' . $projectId . '-' . $activityId;
$dateKey = strtotime($timeEvents[$i]->getReportedDate());
if (!isset($grid[$gridKey])) {
$activityObj->setId($activityId);
$activityObj->fetch();
$projectObj = new Projects();
$projectObj->setProjectId($projectId);
$projectObj->fetch();
$grid[$gridKey]['projectId'] = $projectId;
// TODO: Remove this and use project object in the template
$grid[$gridKey]['projectObj'] = $projectObj;
$grid[$gridKey]['activityId'] = $activityId;
// TODO: Remove this and use activity object in the template
$grid[$gridKey]['activityName'] = $activityObj->getName();
$grid[$gridKey]['isActivityDeleted'] = $activityObj->isDeleted();
$grid[$gridKey]['activityList'] = $activityObj->getActivityList($projectId);
}
$grid[$gridKey][$dateKey]['duration'] = round($timeEvents[$i]->getDuration() / 3600, 2);
$grid[$gridKey][$dateKey]['eventId'] = $timeEvents[$i]->getTimeEventId();
$grid[$gridKey][$dateKey]['comment'] = $timeEvents[$i]->getDescription();
}
$records['grid'] = $grid;
} else {
$records['grid'] = null;
}
/* Setting Grid array: Ends */
/* Setting Projects List: Begins */
$projectObj = new Projects();
$projectObj->setDeleted(Projects::PROJECT_NOT_DELETED);
$projects = $projectObj->fetchProjects(false);
$projectsCount = count($projects);
if ($projectsCount > 0) {
for ($i = 0; $i < $projectsCount; $i++) {
$projectId = $projects[$i]->getProjectId();
$projectsList[$i]['name'] = $projects[$i]->retrieveCustomerName($projectId) . ' - ' . $projects[$i]->getProjectName();
$projectsList[$i]['id'] = $projectId;
$projectsList[$i]['deleted'] = $projects[$i]->getDeleted();
}
$records['projectsList'] = $projectsList;
} else {
$records['projectsList'] = null;
}
/* Setting Projects List: Ends */
$records['employeeId'] = $timesheet->getEmployeeId();
$records['timesheetId'] = $timesheet->getTimesheetId();
$records['timesheetPeriodId'] = $timesheet->getTimesheetPeriodId();
$records['startDateStamp'] = strtotime($timesheet->getStartDate());
$records['endDateStamp'] = strtotime($timesheet->getEndDate());
if (isset($messageType)) {
$records['messageType'] = $messageType;
$records['message'] = $message;
}
$records['showComments'] = $showComments;
$path = '/templates/time/editTimesheetGrid.php';
$template = new TemplateMerger($records, $path);
$template->display();
}