From c08abedc42a7ce924b1bbad50bc5f801ff4e44e5 Mon Sep 17 00:00:00 2001 From: fisharebest Date: Sat, 22 Oct 2011 20:00:51 +0000 Subject: #834142 - Yahrzeiten Block sorting --- modules_v3/yahrzeit/module.php | 70 +++++++++++++----------------------------- 1 file changed, 22 insertions(+), 48 deletions(-) diff --git a/modules_v3/yahrzeit/module.php b/modules_v3/yahrzeit/module.php index 98559ae154..0b3b2e2d90 100644 --- a/modules_v3/yahrzeit/module.php +++ b/modules_v3/yahrzeit/module.php @@ -118,8 +118,7 @@ class yahrzeit_WT_Module extends WT_Module implements WT_Module_Block { break; case 'table': default: - require_once WT_ROOT.'includes/functions/functions_print_lists.php'; - $table_id = "ID".floor(microtime()*1000000); // sorttable requires a unique ID + $table_id = "ID".floor(microtime()*1000000); // table requires a unique ID ?> '; - $content .= ''; - $content .= ''.WT_Gedcom_Tag::getLabel('NAME').''; - $content .= 'GIVN'; - $content .= ''.WT_Gedcom_Tag::getLabel('DATE').''; - $content .= ''.WT_I18N::translate('Anniversary').''; - $content .= ''.WT_Gedcom_Tag::getLabel('_YART').''; + $content .= ''; + $content .= ''.WT_Gedcom_Tag::getLabel('NAME').''; + $content .= ''.WT_Gedcom_Tag::getLabel('DEAT').''; + $content .= 'DEAT'; + $content .= ''.WT_I18N::translate('Anniversary').''; + $content .= ''.WT_Gedcom_Tag::getLabel('_YART').''; + $content .= '_YART'; $content .= ''; - $count=0; foreach ($yahrzeits as $yahrzeit) { if ($yahrzeit['jd']>=$startjd && $yahrzeit['jd']<$startjd+$days) { - ++$count; - $ind=WT_person::GetInstance($yahrzeit['id']); $content .= ''; - // Record name(s) + $ind=WT_person::GetInstance($yahrzeit['id']); + // Individual name(s) $name=$ind->getFullName(); $url=$ind->getHtmlUrl(); - $content .= ''; + $content .= ''; $content .= ''.$name.''; $content .= $ind->getSexImage(); $addname=$ind->getAddName(); @@ -170,48 +170,22 @@ class yahrzeit_WT_Module extends WT_Module implements WT_Module_Block { } $content .= ''; - // GIVN for sorting - $content .= ''; - $exp = explode(",", str_replace('<', ',', $name).","); - $content .= $exp[1]; - $content .= ''; - - $today=new WT_Date_Jewish($yahrzeit['jd']); - $td=new WT_Date($today->Format('%@ %A %O %E')); - // death/yahrzeit event date - $content .= ''; - $content .= "".$yahrzeit['date']->Display(true, NULL, array()).""; - $content .= ''; + $content .= ''.$yahrzeit['date']->Display().''.$yahrzeit['date']->minJD().''; // Anniversary - $content .= ''; - $anniv = $yahrzeit['anniv']; - if ($anniv==0) { - $content .= ' '; - } else { - $content .= "{$anniv}"; - } + $content .= ''.$yahrzeit['anniv'].''; // upcomming yahrzeit dates - $content .= ''; - $content .= ''.$td->Display(true, NULL, array('gregorian')).''; // hCalendar:url - $content .= ' '; + $today=new WT_Date_Jewish($yahrzeit['jd']); + $td=new WT_Date($today->Format('%@ %A %O %E')); + $content .= ''.$td->Display().''.$td->minJD().''; $content .= ''; } } - - // table footer - $content .= ''; - $content .= ''; - $content .= ' '.WT_Gedcom_Tag::getLabel('GIVN').'
'; - $content .= WT_I18N::translate('Total individuals: %s', WT_I18N::number($count)); - $content .= ''; - $content .= 'GIVN'; - $content .= '   '; - $content .= ''; $content .= ''; + break; } -- cgit v1.3