Hallo Leute,
ich habe mir das Modul nun etwas angepasst.
1. Wenn man kein Endjahr im Zeitraum angibt, wird nun das aktuelle Jahr verwendet.
2. Wenn man kein Datumsformat auswählt, wird das in den Einstellungen hinterlegte Datumsformat verwendet.
3. Wenn man bei Voreinstellung kein Datum gewählt hat, dann wird das heutige Datum verwendet.
Hierfür habe ich folgende Änderungen vorgenommen:
config/database.sql
Hier habe ich "dsDefaultDate" zu einem Varchar Feld geändert.
PHP-Code:
-- **********************************************************
-- * *
-- * IMPORTANT NOTE *
-- * *
-- * Do not import this file manually but use the TYPOlight *
-- * install tool to create and maintain database tables! *
-- * *
-- **********************************************************
--
-- Table `tl_form_field`
--
CREATE TABLE `tl_form_field` (
`dsDateFormat` varchar(255) NOT NULL default '',
`dsTimeframe` varchar(255) NOT NULL default '',
`dsDefaultDate` varchar(255) NOT NULL default '',
`dsSeparator` int(1) NOT NULL default '1',
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
dca/tl_form_field.php
Hier wurden die Fields "dsTimeframe", "dsDefaultDate" und "dsDateFormat" angepasst.
PHP-Code:
/**
* Fields
*/
$GLOBALS['TL_DCA']['tl_form_field']['fields']['dsTimeframe'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_form_field']['dsTimeframe'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('multiple'=>true, 'size'=>2, 'rgxp'=>'digit', 'tl_class'=>'w50')
);
$GLOBALS['TL_DCA']['tl_form_field']['fields']['dsDefaultDate'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_form_field']['dsDefaultDate'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('alwaysSave' => true, 'rgxp'=>'date', 'tl_class'=>'w50 wizard', 'datepicker'=>$this->getDatePickerString())
);
$GLOBALS['TL_DCA']['tl_form_field']['fields']['dsDateFormat'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_form_field']['dsDateFormat'],
'default' => $GLOBALS['TL_CONFIG']['dateFormat'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('helpwizard'=>true, 'tl_class'=>'w50'),
'explanation' => 'dateFormat'
);
FormDateSelection.php
Hier wurden Änderungen innerhalb der __set function vorgeommen.
PHP-Code:
public function __set($strKey, $varValue)
{
switch ($strKey)
{
case 'dsTimeframe':
$arrSize = deserialize($varValue);
$this->intYearStart = !empty($arrSize[0]) ? $arrSize[0] : 1970 ;
$this->intYearEnd = !empty($arrSize[1]) ? $arrSize[1] : date('Y', time()) ;
break;
case 'dsDefaultDate':
if($varValue==NULL || empty($varValue)){
$varValue = time();
}
$this->intDefaultDate = $varValue;
break;
case 'dsDateFormat':
if($varValue==NULL){
$varValue = $GLOBALS['TL_CONFIG']['dateFormat'];
}
$this->strDateFormat = $varValue;
break;
case 'dsSeparator':
$this->bolSeparator = $varValue ? true : false;
break;
case 'mandatory':
$this->arrConfiguration['mandatory'] = $varValue ? true : false;
break;
default:
parent::__set($strKey, $varValue);
break;
}
}
Ich hoffe, das der Entwickler des Moduls diese Änderungen in eine neue Version packt.
Viele Grüße
Daniel
Lesezeichen