format = EDIT_FORMAT_DATE; } function addJSFiles() { global $locale_info; $dateEditType = $this->getDateEditType(); if( $dateEditType == EDIT_DATE_SIMPLE_INLINE || $dateEditType == EDIT_DATE_DD_INLINE ) { $this->pageObject->AddJSFile("include/jquery-ui/jquery-ui.min.js"); } if ( $this->pageObject->getLayoutVersion() == BOOTSTRAP_LAYOUT ) { $this->pageObject->AddJSFile("include/bootstrap/js/moment.js", "include/bootstrap/js/bootstrap.min.js"); $this->pageObject->AddJSFile("include/bootstrap/js/bootstrap-datetimepicker.js", "include/bootstrap/js/moment.js"); } } function addCSSFiles() { $dateEditType = $this->getDateEditType(); if( $dateEditType == EDIT_DATE_SIMPLE_INLINE || $dateEditType == EDIT_DATE_DD_INLINE ) { $this->pageObject->AddCSSFile("include/jquery-ui/smoothness/jquery-ui.min.css"); $this->pageObject->AddCSSFile("include/jquery-ui/smoothness/jquery-ui.theme.min.css"); } if ( $this->pageObject->getLayoutVersion() == BOOTSTRAP_LAYOUT ) { $this->pageObject->AddCSSFile("include/bootstrap/css/bootstrap-datetimepicker.min.css"); } } function getProjectSettings() { if($this->pageObject->pageType == PAGE_LIST) return new ProjectSettings($this->pageObject->tName, PAGE_SEARCH); else return $this->pageObject->pSetEdit; } function getDateEditType( $pSet = null ) { if( !$pSet ) $pSet = $this->getProjectSettings(); $dateEditType = $pSet->getDateEditType($this->field); if( $this->pageObject->getLayoutVersion() == BOOTSTRAP_LAYOUT ) { // search panel control if( ( $this->pageObject->pageType == PAGE_LIST || $this->pageObject->pageType == PAGE_CHART || $this->pageObject->pageType == PAGE_REPORT) || $this->pageObject->pageType == PAGE_SEARCH && $this->pageObject->mode == SEARCH_LOAD_CONTROL) { if( $dateEditType == EDIT_DATE_DD ) return EDIT_DATE_SIMPLE; if( $dateEditType == EDIT_DATE_DD_DP ) return EDIT_DATE_SIMPLE_DP; if( $dateEditType == EDIT_DATE_DD_INLINE ) return EDIT_DATE_SIMPLE_INLINE; } } return $dateEditType; } function buildControl($value, $mode, $fieldNum, $validate, $additionalCtrlParams, $data) { global $locale_info; parent::buildControl($value, $mode, $fieldNum, $validate, $additionalCtrlParams, $data); if($fieldNum) $this->cfield = "value".$fieldNum."_".GoodFieldName($this->field).'_'.$this->id; $pSet = $this->getProjectSettings(); $dateEditType = $this->getDateEditType( $pSet ); //if( $this->pageObject->pageType == PAGE_LIST ) // echo ''; $tvalue = $value; $time = db2time($tvalue); if(!count($time)) $time = array(0, 0, 0, 0, 0, 0); $classString = ''; if( $this->pageObject->getLayoutVersion() == BOOTSTRAP_LAYOUT ) $classString = ' form-control'; $dp = 0; $hasImgCal = true; $showTime = $pSet->dateEditShowTime($this->field); switch( $dateEditType ) { case EDIT_DATE_SIMPLE_INLINE: $hasImgCal = false; case EDIT_DATE_SIMPLE_DP: $ovalue = $value; if($locale_info["LOCALE_IDATE"] == 1) $fmt = "dd".$locale_info["LOCALE_SDATE"]."MM".$locale_info["LOCALE_SDATE"]."yyyy"; else if($locale_info["LOCALE_IDATE"] == 0) $fmt = "MM".$locale_info["LOCALE_SDATE"]."dd".$locale_info["LOCALE_SDATE"]."yyyy"; else $fmt = "yyyy".$locale_info["LOCALE_SDATE"]."MM".$locale_info["LOCALE_SDATE"]."dd"; if($showTime || $time[3] || $time[4] || $time[5]){ $timeAttrs = $this->pageObject->pSetEdit->getFormatTimeAttrs($this->field); $fmt.= " " . $locale_info["LOCALE_STIMEFORMAT"]; } if($time[0]) $ovalue = format_datetime_custom($time, $fmt); $ovalue1 = $time[2]."-".$time[1]."-".$time[0]; if($showTime || $time[3] || $time[4] || $time[5]) $ovalue1.= " ".$time[3].":".$time[4].":".$time[5]; $ret= 'inputStyle.' class="'.$classString.'" type="Text" name="'.$this->cfield.'" value="'.$ovalue.'">'; $ret.= ''; if( $this->pageObject->getLayoutVersion() == BOOTSTRAP_LAYOUT ) $ret .= ''; elseif ( $hasImgCal ) $ret .= ''; if( $this->pageObject->getLayoutVersion() == BOOTSTRAP_LAYOUT ) { if ( isRTL() ) { $ret .= ""; // for bootstrap calend icon anomaly } $ret = '