From 4bd257f00780ea78365d8200000546404f9e1c0e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Aug 2014 03:23:16 +0200 Subject: [PATCH] New: Work on type of leave. --- htdocs/holiday/class/holiday.class.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index fdc43fe8106..aac5464fea5 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -1733,6 +1733,30 @@ class Holiday extends CommonObject } } + + /** + * Tous les types + * + * @return boolean Return array with list of types + */ + function getTypes() + { + $result = $this->db->query("SELECT rowid, type, affect FROM " . MAIN_DB_PREFIX . "holiday_types"); + $num = $this->db->num_rows($result); + if ($num) + { + while ($obj = $this->db->fetch_object($result)) + { + $types[] = array('rowid'=> $obj->rowid, 'type'=> $obj->type, 'affect'=>$obj->affect); + } + + return $types; + } + + return array(); + } + + /** * Initialise an instance with random values. * Used to build previews or test instances.