Hallo Johannes,
Am 09.01.2013 22:02, schrieb JCL - Johannes C. Laxander:
Hallo,
dank der geposteten Lösung von Raphael Weber vom 9.11.2011 (Formhandler
Validator bzw prioriCalc Problem) habe ich genau das gefunden, was mir auch
prinzipiell mein Problem löst - dafür Dank an Raphael.
Ein Startdatum soll nicht in der Vergangenheit liegen und auch nicht mehr als
ein Jahr in der Zukunft. Diese Prüfung habe ich dank Raphaels Beispiel gelöst.
Ein Enddatum soll mind. 1 Woche (7 Tage) nach dem Startdatum liegen, und auch
nicht mehr als 4 Wochen (28 Tage) nach dem Startdatum.
Ich bekomme aber immer einen Fehler angezeigt, auch wenn das Datum im
zulässigen Zeitraum liegt, z.B.
Startdatum = 1.6.2013
Enddatum = 20.6.2013
Das ist die Codierung für den Error Check (gekürzt) - Wo liegt der Fehler ??? :
[TypoScript]
enddatum.errorCheck {
1 = required
2 = date
2.pattern = d.m.y
3 = dateRange
3.pattern < .2.pattern
3.min = TEXT
3.min {
# Enddatum mind. 7 Tage nach Startdatum
setCurrent.data = GP : formhandler | startdatum
setCurrent.preUserFunc = user_strtotime->main
setCurrent.wrap = (60 * 60 * 24 * 7) + |
current = 1
prioriCalc = 1
strftime = %d.%m.%Y
}
3.max = TEXT
3.max {
# Enddatum nicht mehr als 28 Tage nach Startdatum
setCurrent.data = GP : formhandler | startdatum
setCurrent.preUserFunc = user_strtotime->main
setCurrent.wrap = (60 * 60 * 24 * 28) + |
current = 1
prioriCalc = 1
strftime = %d.%m.%Y
}
}
[/TypoScript]
[PHP]
<?php
class user_strtotime {
var $cObj; // The backReference to the mother cObj object set at call
time
/*
* Call it from a USER cObject with 'userFunc = user_strtotime->main'
*/
function main($content,$conf) {
$content = trim($content);
$op = strtotime($content);
return $op;
}
}
?>
[/PHP]
Johannes.
Ist der Zugriff auf "formhandler|startdatum" richtig?
Statt "formhandler" muss hier der verwendete "formValuesPrefix" stehen
oder nichts.
z.B.:
GP:meinFormular|feld
oder
GP:feld
Viele Grüße,
Reinhard
--
http://www.typo3-formhandler.com
_______________________________________________
TYPO3-german mailing list
TYPO3-german@lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-german