From 2c0c0d2a408f17aaec4e9ecac6c0e2061f4c13c6 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 4 Jun 2001 18:23:22 +0000 Subject: [PATCH] sbox2 extends now sbox, new function getDate --- phpgwapi/inc/class.sbox2.inc.php | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/phpgwapi/inc/class.sbox2.inc.php b/phpgwapi/inc/class.sbox2.inc.php index 96e87a5c12..507d7f3620 100644 --- a/phpgwapi/inc/class.sbox2.inc.php +++ b/phpgwapi/inc/class.sbox2.inc.php @@ -23,8 +23,9 @@ /* $Id$ */ - class sbox2 { - + include(PHPGW_API_INC."/class.sbox.inc.php"); + + class sbox2 extends sbox { /* * Function: search for an id of an db-entry, eg. an address * Parameter: $name base name for all template-vars and of the submitted vars (not to conflict with other template-var-names !!!) @@ -299,4 +300,20 @@ } return $this->getArrayItem($name,$selected,$aarr,1); } + + function getDate($n_year,$n_month,$n_day,$date) + { + global $phpgw; + + if (!$date) { + $day = $month = $year = 0; + } else { + $day = date('d',$date); + $month = date('m',$date); + $year = date('Y',$date); + } + return $phpgw->common->dateformatorder($this->getYears($n_year,$year), + $this->getMonthText($n_month,$month), + $this->getDays($n_day,$day)); + } }