本文整理汇总了PHP中set_datepicker_date_format函数的典型用法代码示例。如果您正苦于以下问题:PHP set_datepicker_date_format函数的具体用法?PHP set_datepicker_date_format怎么用?PHP set_datepicker_date_format使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_datepicker_date_format函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: execute
public function execute($request)
{
$leaveRequestService = $this->getLeaveRequestService();
$leaveRequestId = trim($request->getParameter("leaveRequestId"));
$leaveId = trim($request->getParameter("leaveId"));
$comment = trim($request->getParameter("leaveComment"));
$user = $this->getUser();
$loggedInUserId = $user->getAttribute('auth.userId');
$loggedInEmpNumber = $user->getAttribute('auth.empNumber');
if (!empty($loggedInEmpNumber)) {
$employee = $this->getEmployeeService()->getEmployee($loggedInEmpNumber);
$createdBy = $employee->getFullName();
} else {
$createdBy = $user->getAttribute('auth.firstName');
}
$savedComment = NULL;
if ($leaveRequestId != "") {
$savedComment = $leaveRequestService->saveLeaveRequestComment($leaveRequestId, $comment, $createdBy, $loggedInUserId, $loggedInEmpNumber);
}
if ($leaveId != "") {
$savedComment = $leaveRequestService->saveLeaveComment($leaveId, $comment, $createdBy, $loggedInUserId, $loggedInEmpNumber);
}
if (!empty($savedComment)) {
$created = new DateTime($savedComment->getCreated());
$createdAt = set_datepicker_date_format($created->format('Y-m-d')) . ' ' . $created->format('H:i');
$returnText = $createdAt . ' ' . $savedComment->getCreatedByName() . "\n\n" . $savedComment->getComments();
} else {
$returnText = 0;
}
if ($this->getUser()->hasFlash('myLeave')) {
$this->getUser()->setFlash('myLeave', true);
}
return $this->renderText($returnText);
}
开发者ID:abdocmd,项目名称:orangehrm-3.0.1,代码行数:34,代码来源:updateCommentAction.class.php
示例2: getStartAndEndDates
public function getStartAndEndDates($employeeId)
{
$timesheetService = new TimesheetService();
$timesheets = $timesheetService->getTimesheetByEmployeeId($employeeId);
$dateOptions = array();
$dateOptionsToDrpDwn = array();
$userRoleManager = sfContext::getInstance()->getUserRoleManager();
$user = $userRoleManager->getUser();
$excludeRoles = array();
$includeRoles = $employeeId == $user->getEmpNumber() ? array('ESS') : array();
$entities = array('Employee' => $employeeId);
$i = 0;
if ($timesheets != null) {
$dataGroupPermissions = $userRoleManager->getDataGroupPermissions(array('time_employee_timesheets'), array(), array(), $employeeId == $user->getEmpNumber(), $entities);
foreach ($timesheets as $timesheet) {
$allowedActions = $userRoleManager->getAllowedActions(WorkflowStateMachine::FLOW_TIME_TIMESHEET, $timesheet->getState(), $excludeRoles, $includeRoles, $entities);
if (isset($allowedActions[WorkflowStateMachine::TIMESHEET_ACTION_VIEW]) || $dataGroupPermissions->canRead()) {
$dateOptions[$i] = $timesheet->getStartDate() . " " . __("to") . " " . $timesheet->getEndDate();
$dateOptionsToDrpDwn[$i] = set_datepicker_date_format($timesheet->getStartDate()) . " " . __("to") . " " . set_datepicker_date_format($timesheet->getEndDate());
$i++;
}
}
}
$this->dateOptions = array_reverse($dateOptions);
return array_reverse($dateOptionsToDrpDwn);
}
开发者ID:lahirwisada,项目名称:orangehrm,代码行数:26,代码来源:startDaysListForm.php
示例3: __toString
public function __toString()
{
$name = $this->getPropertyValue('namePattern');
$id = $this->getPropertyValue('namePattern');
$imageHTML = tag('img', array('src' => theme_path('images/callout-left.png'), 'title' => 'Click here to edit', 'alt' => 'Edit', 'class' => 'callout dialogInvoker'));
$placeholderGetters = $this->getPropertyValue('placeholderGetters');
$id = $this->generateAttributeValue($placeholderGetters, $this->getPropertyValue('idPattern'));
$name = $this->generateAttributeValue($placeholderGetters, $this->getPropertyValue('namePattern'));
$comments = $this->getValue();
$commentExtract = '';
$allComments = '';
// show last comment only
if (count($comments) > 0) {
foreach ($comments as $comment) {
$created = new DateTime($comment->getCreated());
$createdAt = set_datepicker_date_format($created->format('Y-m-d')) . ' ' . $created->format('H:i');
$formatComment = $createdAt . ' ' . $comment->getCreatedByName() . "\n\n" . $comment->getComments();
$allComments = $formatComment . "\n\n" . $allComments;
}
$lastComment = $comments->getLast();
$commentExtract = $this->trimComment($lastComment->getComments());
}
$commentContainerHTML = content_tag('span', $commentExtract, array('id' => $this->generateAttributeValue($placeholderGetters, 'commentContainer-{id}')));
$hiddenFieldHTML = tag('input', array('type' => 'hidden', 'id' => $id, 'name' => $name, 'value' => $allComments));
$commentHTML = content_tag('span', $commentContainerHTML . $imageHTML . $hiddenFieldHTML, array('class' => 'commentContainerLong'));
if ($this->isHiddenOnCallback()) {
return ' ';
}
return $commentHTML . $this->getHiddenFieldHTML();
}
开发者ID:lahirwisada,项目名称:orangehrm,代码行数:30,代码来源:LeaveCommentCell.php
示例4: setDefaultDates
protected function setDefaultDates()
{
$now = time();
// If leave period defined, use leave period start and end date
$calenderYear = $this->getLeavePeriodService()->getCalenderYearByDate($now);
$this->setDefaults(array('calFromDate' => set_datepicker_date_format($calenderYear[0]), 'calToDate' => set_datepicker_date_format($calenderYear[1])));
}
开发者ID:lahirwisada,项目名称:orangehrm,代码行数:7,代码来源:HolidayListSearchForm.php
示例5: execute
public function execute($request)
{
sfConfig::set('sf_web_debug', false);
sfConfig::set('sf_debug', false);
$leaveId = $request->getParameter("leaveId");
$leaveRequestId = $request->getParameter('leaveRequestId');
$comments = array();
$leaveRequestService = $this->getLeaveRequestService();
if (!empty($leaveRequestId)) {
$comments = $leaveRequestService->getLeaveRequestComments($leaveRequestId);
} else {
if (!empty($leaveId)) {
$comments = $leaveRequestService->getLeaveComments($leaveId);
}
}
$returnData = array();
if (count($comments) > 0) {
foreach ($comments as $comment) {
$commentDate = new DateTime($comment->getCreated());
$row['date'] = set_datepicker_date_format($commentDate->format('Y-m-d'));
$row['time'] = $commentDate->format('H:i');
$row['author'] = $comment->getCreatedByName();
$row['comments'] = $comment->getComments();
$returnData[] = $row;
}
}
$response = $this->getResponse();
$response->setHttpHeader('Expires', '0');
$response->setHttpHeader("Cache-Control", "must-revalidate, post-check=0, pre-check=0, max-age=0");
$response->setHttpHeader("Cache-Control", "private", false);
return $this->renderText(json_encode($returnData));
}
开发者ID:lahirwisada,项目名称:orangehrm,代码行数:32,代码来源:getLeaveCommentsAjaxAction.class.php
示例6: configure
/**
*
*/
public function configure()
{
$this->candidateVacancyId = $this->getOption('candidateVacancyId');
$this->selectedAction = $this->getOption('selectedAction');
$this->id = $this->getOption('id');
if ($this->candidateVacancyId > 0 && $this->selectedAction != "") {
$stateMachine = new WorkflowStateMachine();
$this->actionName = $stateMachine->getRecruitmentActionName($this->selectedAction);
$this->selectedCandidateVacancy = $this->getCandidateService()->getCandidateVacancyById($this->candidateVacancyId);
}
if ($this->id > 0) {
$candidateHistory = $this->getCandidateService()->getCandidateHistoryById($this->id);
$this->selectedCandidateVacancy = $this->getCandidateService()->getCandidateVacancyByCandidateIdAndVacancyId($candidateHistory->getCandidateId(), $candidateHistory->getVacancyId());
$this->performedActionName = $candidateHistory->getActionName();
$date = explode(" ", $candidateHistory->getPerformedDate());
$this->performedDate = set_datepicker_date_format($date[0]);
$this->performedBy = $candidateHistory->getPerformerName();
$this->vacancyId = $candidateHistory->getVacancyId();
$this->selectedAction = $candidateHistory->getAction();
}
$this->candidateId = $this->selectedCandidateVacancy->getCandidateId();
$this->vacancyId = $this->selectedCandidateVacancy->getVacancyId();
$this->candidateName = $this->selectedCandidateVacancy->getCandidateName();
$this->vacancyName = $this->selectedCandidateVacancy->getVacancyName();
$this->hiringManagerName = $this->selectedCandidateVacancy->getHiringManager();
$this->currentStatus = ucwords(strtolower($this->selectedCandidateVacancy->getStatus()));
$this->setWidget('notes', new sfWidgetFormTextArea());
$this->setValidator('notes', new sfValidatorString(array('required' => false, 'max_length' => 2147483647)));
$this->widgetSchema->setNameFormat('candidateVacancyStatus[%s]');
if ($this->id > 0) {
$this->setDefault('notes', $candidateHistory->getNote());
$this->widgetSchema['notes']->setAttribute('disabled', 'disable');
$this->actionName = 'View Action History';
}
}
开发者ID:THM068,项目名称:orangehrm,代码行数:38,代码来源:CandidateVacancyStatusForm.php
示例7: configure
public function configure()
{
$employee = $this->getOption('employee');
$this->allowActivate = $this->getOption('allowActivate');
$this->allowTerminate = $this->getOption('allowTerminate');
$empTerminatedId = $employee->termination_id;
$terminateReasons = $this->__getTerminationReasons();
//creating widgets
$widgets = array('date' => new ohrmWidgetDatePickerNew(array(), array('id' => 'terminate_date')), 'reason' => new sfWidgetFormSelect(array('choices' => $terminateReasons)), 'note' => new sfWidgetFormTextArea());
if (!$this->allowTerminate && !$this->allowActivate) {
foreach ($widgets as $widget) {
$widget->setAttribute('disabled', 'disabled');
}
}
$this->setWidgets($widgets);
$inputDatePattern = sfContext::getInstance()->getUser()->getDateFormat();
//Setting validators
$this->setValidators(array('date' => new ohrmDateValidator(array('date_format' => $inputDatePattern, 'required' => true), array('invalid' => 'Date format should be ' . $inputDatePattern)), 'reason' => new sfValidatorChoice(array('required' => true, 'choices' => array_keys($terminateReasons))), 'note' => new sfValidatorString(array('required' => false, 'max_length' => 250, 'trim' => true))));
$this->setDefault('date', set_datepicker_date_format(date('Y-m-d')));
$this->setDefault('reason', 1);
if (!empty($empTerminatedId)) {
$employeeTerminationRecord = $employee->getEmployeeTerminationRecord();
$this->setDefault('date', set_datepicker_date_format($employeeTerminationRecord->getDate()));
$this->setDefault('reason', $employeeTerminationRecord->getReasonId());
$this->setDefault('note', $employeeTerminationRecord->getNote());
}
$this->widgetSchema->setNameFormat('terminate[%s]');
}
开发者ID:THM068,项目名称:orangehrm,代码行数:28,代码来源:EmployeeTerminateForm.php
示例8: getStartAndEndDates
public function getStartAndEndDates($employeeId)
{
$userEmployeeNumber = null;
$timesheetService = new TimesheetService();
$timesheets = $timesheetService->getTimesheetByEmployeeId($employeeId);
$dateOptions = array();
$dateOptionsToDrpDwn = array();
$userObj = sfContext::getInstance()->getUser()->getAttribute('user');
$userId = $userObj->getUserId();
$userEmployeeNumber = $userObj->getEmployeeNumber();
if ($userEmployeeNumber == $employeeId) {
$user = new User();
$decoratedUser = new EssUserRoleDecorator($user);
} else {
$userRoleFactory = new UserRoleFactory();
$decoratedUser = $userRoleFactory->decorateUserRole($userId, $employeeId, $userEmployeeNumber);
}
$i = 0;
if ($timesheets != null) {
foreach ($timesheets as $timesheet) {
$allowedActions = $decoratedUser->getAllowedActions(WorkflowStateMachine::FLOW_TIME_TIMESHEET, $timesheet->getState());
if (in_array(WorkflowStateMachine::TIMESHEET_ACTION_VIEW, $allowedActions)) {
$dateOptions[$i] = $timesheet->getStartDate() . " " . __("to") . " " . $timesheet->getEndDate();
$dateOptionsToDrpDwn[$i] = set_datepicker_date_format($timesheet->getStartDate()) . " " . __("to") . " " . set_datepicker_date_format($timesheet->getEndDate());
$i++;
}
}
}
$this->dateOptions = array_reverse($dateOptions);
return array_reverse($dateOptionsToDrpDwn);
}
开发者ID:THM068,项目名称:orangehrm,代码行数:31,代码来源:startDaysListForm.php
示例9: getLeaveBalances
function getLeaveBalances($postData)
{
$count = count($postData);
$data = array();
$leaveEntitlementService = new LeaveEntitlementService();
$leaveStrategy = $leaveEntitlementService->getLeaveEntitlementStrategy();
for ($i = 0; $i < $count; $i++) {
$empNumber = $postData[$i][0];
$leaveTypeId = $postData[$i][1];
$startDate = $postData[$i][2];
$endDate = $postData[$i][3];
if ($startDate == $endDate) {
$leaveBalance = $leaveEntitlementService->getLeaveBalance($empNumber, $leaveTypeId, $startDate);
} else {
$leavePeriodForStartDate = $leaveStrategy->getLeavePeriod($startDate, $empNumber, $leaveTypeId);
$leavePeriodForEndDate = $leaveStrategy->getLeavePeriod($endDate, $empNumber, $leaveTypeId);
if ($leavePeriodForStartDate[0] == $leavePeriodForEndDate[0] && $leavePeriodForStartDate[1] == $leavePeriodForEndDate[1]) {
$leaveBalance = $leaveEntitlementService->getLeaveBalance($empNumber, $leaveTypeId, $startDate);
} else {
$startPeriodBalance = $leaveEntitlementService->getLeaveBalance($empNumber, $leaveTypeId, $startDate);
$endPeriodBalance = $leaveEntitlementService->getLeaveBalance($empNumber, $leaveTypeId, $endDate);
$leaveBalance = array(array('start' => set_datepicker_date_format($leavePeriodForStartDate[0]), 'end' => set_datepicker_date_format($leavePeriodForStartDate[1]), 'balance' => $startPeriodBalance->getBalance()), array('start' => set_datepicker_date_format($leavePeriodForEndDate[0]), 'end' => set_datepicker_date_format($leavePeriodForEndDate[1]), 'balance' => $endPeriodBalance->getBalance()));
}
}
if ($leaveBalance instanceof LeaveBalance) {
$data[] = number_format($leaveBalance->getBalance(), 2);
} else {
$data[] = $leaveBalance;
}
}
return $data;
}
开发者ID:lahirwisada,项目名称:orangehrm,代码行数:32,代码来源:leaveListBalanceAjaxAction.class.php
示例10: configure
public function configure()
{
$widgets = array();
$labels = array();
$validators = array();
$defaults = array();
sfContext::getInstance()->getConfiguration()->loadHelpers(array('I18N', 'OrangeDate'));
$inputDatePattern = sfContext::getInstance()->getUser()->getDateFormat();
// From and To Date
$widgets['calFromDate'] = new ohrmWidgetDatePickerNew(array(), array('id' => 'calFromDate'));
$labels['calFromDate'] = __('From');
$widgets['calToDate'] = new ohrmWidgetDatePickerNew(array(), array('id' => 'calToDate'));
$labels['calToDate'] = __('To');
// Set default from/to to current leave period.
$leavePeriod = $this->getLeavePeriodService()->getCurrentLeavePeriod();
$defaults['calFromDate'] = set_datepicker_date_format($leavePeriod->getStartDate());
$endDateString = date('Y-m-d', strtotime($leavePeriod->getEndDate() . " +1 year"));
$endDate = new DateTime($endDateString);
$toDate = $endDate->format("Y-m-d");
$defaults['calToDate'] = set_datepicker_date_format($toDate);
$validators['calFromDate'] = new ohrmDateValidator(array('date_format' => $inputDatePattern, 'required' => false), array('invalid' => 'Date format should be' . $inputDatePattern));
$validators['calToDate'] = new ohrmDateValidator(array('date_format' => $inputDatePattern, 'required' => false), array('invalid' => 'Date format should be' . $inputDatePattern));
// Leave Statuses
$leaveStatusChoices = Leave::getStatusTextList();
if ($this->mode == self::MODE_MY_LEAVE_LIST) {
$defaultStatuses = array_keys($leaveStatusChoices);
} else {
$defaultStatuses = array(Leave::LEAVE_STATUS_LEAVE_PENDING_APPROVAL);
}
$widgets['chkSearchFilter'] = new ohrmWidgetCheckboxGroup(array('choices' => $leaveStatusChoices, 'show_all_option' => true, 'default' => $defaultStatuses));
$labels['chkSearchFilter'] = 'Show Leave with Status';
$defaults['chkSearchFilter'] = $defaultStatuses;
$validators['chkSearchFilter'] = new sfValidatorChoice(array('choices' => array_keys($leaveStatusChoices), 'required' => false, 'multiple' => true));
if ($this->mode != self::MODE_MY_LEAVE_LIST) {
$requiredPermissions = array(BasicUserRoleManager::PERMISSION_TYPE_ACTION => array('view_leave_list'));
$widgets['txtEmployee'] = new ohrmWidgetEmployeeNameAutoFill(array('employeeList' => $this->getEmployeeList(), 'requiredPermissions' => $requiredPermissions));
$labels['txtEmployee'] = __('Employee');
$validators['txtEmployee'] = new ohrmValidatorEmployeeNameAutoFill();
$widgets['cmbSubunit'] = new ohrmWidgetSubUnitDropDown();
$labels['cmbSubunit'] = __('Sub Unit');
$subUnitChoices = $widgets['cmbSubunit']->getValidValues();
$validators['cmbSubunit'] = new sfValidatorChoice(array('choices' => $subUnitChoices, 'required' => false));
// TODO check cmbWithTerminated if searching for terminated employee
$widgets['cmbWithTerminated'] = new sfWidgetFormInputCheckbox(array('value_attribute_value' => 'on'));
$labels['cmbWithTerminated'] = __('Include Past Employees');
$validators['cmbWithTerminated'] = new sfValidatorBoolean(array('true_values' => array('on'), 'required' => false));
}
$this->setWidgets($widgets);
$this->getWidgetSchema()->setLabels($labels);
$this->setvalidators($validators);
$this->setDefaults($defaults);
$this->getWidgetSchema()->setNameFormat('leaveList[%s]');
sfWidgetFormSchemaFormatterBreakTags::setNoOfColumns(1);
$this->getWidgetSchema()->setFormFormatterName('BreakTags');
// Validate that if both from and to date are given, form date is before to date.
$this->getValidatorSchema()->setPostValidator(new ohrmValidatorSchemaCompare('calFromDate', sfValidatorSchemaCompare::LESS_THAN_EQUAL, 'calToDate', array('throw_global_error' => true, 'skip_if_one_empty' => true), array('invalid' => 'The from date ("%left_field%") must be before the to date ("%right_field%")')));
}
开发者ID:THM068,项目名称:orangehrm,代码行数:57,代码来源:LeaveListForm.php
示例11: getPunchOutUserTimeAndZone
public function getPunchOutUserTimeAndZone()
{
$value = '';
if ($this->getPunchOutUserTime()) {
$outUserTimeArray = explode(" ", $this->getPunchOutUserTime());
$value = set_datepicker_date_format($outUserTimeArray[0]) . " " . $outUserTimeArray[1] . '<span class="helpText"> GMT ' . $this->getPunchOutTimeOffset() . '</span>';
}
return $value;
}
开发者ID:lahirwisada,项目名称:orangehrm,代码行数:9,代码来源:PluginAttendanceRecord.class.php
示例12: getLabel
protected function getLabel()
{
$label = parent::getLabel();
$default = $this->getPropertyValue('default');
if ($label != $default) {
$label = set_datepicker_date_format($label);
}
return $label;
}
开发者ID:lahirwisada,项目名称:orangehrm,代码行数:9,代码来源:LinkDateCell.php
示例13: setFormDefaults
protected function setFormDefaults($filters)
{
// convert back to localized format before setting in form
if (isset($filters['date']['from'])) {
$filters['date']['from'] = set_datepicker_date_format($filters['date']['from']);
}
if (isset($filters['date']['to'])) {
$filters['date']['to'] = set_datepicker_date_format($filters['date']['to']);
}
$this->form->setDefaults($filters);
}
开发者ID:abdocmd,项目名称:spmillen,代码行数:11,代码来源:viewLeaveEntitlementsAction.class.php
示例14: configure
public function configure()
{
$timeZone = $this->getOption('timezone');
$date = $this->getOption('date');
$this->formWidgets['timezone'] = new sfWidgetFormSelect(array('choices' => $this->getTimezoneArray()), array('class' => 'timezone'));
$this->setWidgets($this->formWidgets);
$this->formValidators['timezone'] = new sfValidatorString(array(), array('required' => __('Enter timezone')));
$this->setValidators($this->formValidators);
$this->widgetSchema->setNameFormat('attendance[%s]');
parent::configure();
$index = array_keys($this->getAttendanceService()->getTimezoneArray(), $timeZone);
$this->setDefault('timezone', $index[0]);
$this->setDefault('date', set_datepicker_date_format($date));
}
开发者ID:THM068,项目名称:orangehrm,代码行数:14,代码来源:ProxyPunchInPunchOutForm.php
示例15: configure
public function configure()
{
$date = $this->getOption('date');
$employeeId = $this->getOption('employeeId');
$trigger = $this->getOption('trigger');
$this->setWidgets(array('employeeName' => new sfWidgetFormInputText(array(), array('class' => 'inputFormatHint', 'id' => 'employee')), 'date' => new sfWidgetFormInputText(array(), array('class' => 'date', 'margin' => '0')), 'employeeId' => new sfWidgetFormInputHidden()));
if ($trigger) {
$this->setDefault('employeeName', $this->getEmployeeName($employeeId));
$this->setDefault('date', set_datepicker_date_format($date));
} else {
$this->setDefault('employeeName', __('Type for hints') . '...');
}
$this->widgetSchema->setNameFormat('attendance[%s]');
$this->setValidators(array('date' => new sfValidatorDate(array(), array('required' => __('Enter Date'))), 'employeeName' => new sfValidatorString(array(), array('required' => __('Enter Employee Name'))), 'employeeId' => new sfValidatorString()));
}
开发者ID:rabbitdigital,项目名称:HRM,代码行数:15,代码来源:AttendanceRecordSearchForm.php
示例16: formatLabel
protected function formatLabel($baseValuesArray, $fieldMap)
{
$formattedLabel = '';
if (is_array($fieldMap)) {
throw new Exception('Only one field can be used if the label format is not specified');
} else {
if (strtotime($baseValuesArray[$fieldMap]) > 0) {
$timeStamp = strtotime($baseValuesArray[$fieldMap]);
$formattedLabel = set_datepicker_date_format($timeStamp);
} else {
$formattedLabel = htmlspecialchars($baseValuesArray[$fieldMap]);
}
}
return $formattedLabel;
}
开发者ID:lahirwisada,项目名称:orangehrm,代码行数:15,代码来源:AbstractGraphDataFormatter.php
示例17: configure
public function configure()
{
$date = $this->getOption('date');
$employeeId = $this->getOption('employeeId');
$trigger = $this->getOption('trigger');
$this->setWidgets(array('employeeName' => new ohrmWidgetEmployeeNameAutoFill(array('jsonList' => $this->getEmployeeListAsJson()), array('class' => 'formInputText')), 'date' => new ohrmWidgetDatePicker(array(), array('id' => 'attendance_date'), array('class' => 'formDateInput'))));
if ($trigger) {
$this->setDefault('employeeName', $this->getEmployeeName($employeeId));
$this->setDefault('date', set_datepicker_date_format($date));
}
$this->widgetSchema->setNameFormat('attendance[%s]');
$inputDatePattern = sfContext::getInstance()->getUser()->getDateFormat();
$this->setValidators(array('date' => new ohrmDateValidator(array('date_format' => $inputDatePattern, 'required' => true), array('invalid' => 'Date format should be ' . $inputDatePattern)), 'employeeName' => new ohrmValidatorEmployeeNameAutoFill()));
$this->getWidgetSchema()->setLabels($this->getFormLabels());
}
开发者ID:lahirwisada,项目名称:orangehrm,代码行数:15,代码来源:AttendanceRecordSearchForm.php
示例18: getLeavePeriodChoices
/**
* Get Leave Period choices as an array.
* @return array Array of leave periods
*/
protected function getLeavePeriodChoices()
{
$leavePeriodChoices = array();
$leavePeriods = $this->getLeavePeriodService()->getLeavePeriodList();
if (empty($leavePeriods)) {
$leavePeriodChoices[0] = __('No Leave Periods');
} else {
foreach ($leavePeriods as $leavePeriod) {
$id = $leavePeriod->getLeavePeriodId();
$label = set_datepicker_date_format($leavePeriod->getStartDate()) . " " . __("to") . " " . set_datepicker_date_format($leavePeriod->getEndDate());
$leavePeriodChoices[$id] = $label;
}
}
return $leavePeriodChoices;
}
开发者ID:THM068,项目名称:orangehrm,代码行数:19,代码来源:HolidayListSearchForm.php
示例19: __setDefaultValues
private function __setDefaultValues()
{
$reviewId = $this->getOption('reviewId');
if (!empty($reviewId)) {
$review = $this->getPerformanceReviewService()->readPerformanceReview($reviewId);
$employee = array('empName' => $review->getEmployee()->getFullName(), 'empId' => $review->getEmployee()->getEmployeeId());
$reviewer = array('empName' => $review->getReviewer()->getFullName(), 'empId' => $review->getReviewer()->getEmployeeId());
$this->setDefaults(array('reviewId' => $review->getId(), 'employeeName' => $employee, 'reviewerName' => $reviewer, 'from_date' => set_datepicker_date_format($review->getPeriodFrom()), 'to_date' => set_datepicker_date_format($review->getPeriodTo()), 'dueDate' => set_datepicker_date_format($review->getDueDate())));
}
if ($this->getOption('redirect')) {
$employee = array('empName' => $this->getOption('empName'), 'empId' => $this->getOption('empId'));
$reviewer = array('empName' => $this->getOption('reviewerName'), 'empId' => $this->getOption('reviewerId'));
$this->setDefaults(array('employeeName' => $employee, 'reviewerName' => $reviewer, 'from_date' => $this->getOption('toDate'), 'to_date' => $this->getOption('fromDate'), 'dueDate' => $this->getOption('dueDate')));
}
}
开发者ID:CamilleCrespeau,项目名称:orangehrm,代码行数:15,代码来源:SaveReviewForm.php
示例20: __toString
public function __toString()
{
if ($this->isHiddenOnCallback()) {
return ' ';
}
$value = $this->getValue();
$default = $this->getPropertyValue('default');
$spliter = $this->getPropertyValue('dateSplit');
$isValueList = $this->getPropertyValue('isValueList', false);
if ($isValueList && is_array($value)) {
$lines = $value;
if (count($lines) >= 1) {
$value = '<table class="valueListCell"><tbody>';
foreach ($lines as $line) {
if (!$line && $default) {
$value .= '<tr><td>' . $default . '</td></tr>';
} else {
$value .= '<tr><td> • ' . set_datepicker_date_format($line) . '</td></tr>';
}
}
$value .= '</tbody></table>';
}
} else {
if ($spliter) {
$formatted = array();
$dates = split($spliter, $value);
foreach ($dates as $date) {
$formatted[] = set_datepicker_date_format($date);
}
$value = implode($spliter, $formatted);
} else {
if ($value != $default) {
$value = set_datepicker_date_format($value);
}
}
}
return $value . $this->getHiddenFieldHTML();
}
开发者ID:THM068,项目名称:orangehrm,代码行数:38,代码来源:LabelDateCell.php
注:本文中的set_datepicker_date_format函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论