getName().$block_id;
if ($ctype=='gedcom' && WT_USER_GEDCOM_ADMIN || $ctype=='user' && WT_USER_ID) {
$title="";
} else {
$title='';
}
$title.= i18n::translate('Upcoming Yahrzeiten').help_link('yahrzeit', $this->getName());
$content='';
// The standard anniversary rules cover most of the Yahrzeit rules, we just
// need to handle a few special cases.
// Fetch normal anniversaries...
$yahrzeits=array();
for ($jd=$startjd-1; $jd<=$endjd+30;++$jd) {
foreach (get_anniversary_events($jd, 'DEAT _YART') as $fact) {
// Extract hebrew dates only
if ($fact['date']->date1->CALENDAR_ESCAPE()=='@#DHEBREW@' && $fact['date']->MinJD()==$fact['date']->MaxJD()) {
// Apply privacy
if (canDisplayRecord(WT_GED_ID, find_person_record($fact['id'], WT_GED_ID)) && canDisplayFact($fact['id'], WT_GED_ID, $fact['factrec'])) {
$yahrzeits[]=$fact;
}
}
}
}
// ...then adjust dates
foreach ($yahrzeits as $key=>$yahrzeit) {
if (strpos('1 DEAT', $yahrzeit['factrec'])!==false) { // Just DEAT, not _YART
$today=new JewishDate($yahrzeit['jd']);
$hd=$yahrzeit['date']->MinDate();
$hd1=new JewishDate($hd);
$hd1->y+=1;
$hd1->SetJDFromYMD();
// Special rules. See http://www.hebcal.com/help/anniv.html
// Everything else is taken care of by our standard anniversary rules.
if ($hd->d==30 && $hd->m==2 && $hd->y!=0 && $hd1->DaysInMonth()<30) { // 30 CSH
// Last day in CSH
$yahrzeit[$key]['jd']=JewishDate::YMDtoJD($today->y, 3, 1)-1;
}
if ($hd->d==30 && $hd->m==3 && $hd->y!=0 && $hd1->DaysInMonth()<30) { // 30 KSL
// Last day in KSL
$yahrzeit[$key]['jd']=JewishDate::YMDtoJD($today->y, 4, 1)-1;
}
if ($hd->d==30 && $hd->m==6 && $hd->y!=0 && $today->DaysInMonth()<30 && !$today->IsLeapYear()) { // 30 ADR
// Last day in SHV
$yahrzeit[$key]['jd']=JewishDate::YMDtoJD($today->y, 6, 1)-1;
}
}
}
switch ($infoStyle) {
case 'list':
foreach ($yahrzeits as $yahrzeit)
if ($yahrzeit['jd']>=$startjd && $yahrzeit['jd']<$startjd+$days) {
$ind=person::GetInstance($yahrzeit['id']);
$content .= "getHtmlUrl()."\" class=\"list_item name2\">".$ind->getFullName()."".$ind->getSexImage();
$content .= "
| ".translate_fact('NAME')." | "; $content .= ""; $content .= "".translate_fact('DATE')." | "; $content .= "![]() | ";
$content .= "".translate_fact('_YART')." | "; $content .= "
|---|---|---|---|
| ";
$content .= "".PrintReady($name)."";
$content .= $ind->getSexImage();
$addname=$ind->getAddName();
if ($addname) {
$content .= " ".PrintReady($addname).""; } $content .= " | ";
// GIVN for sorting
$content .= "";
$today=new JewishDate($yahrzeit['jd']);
$td=new GedcomDate($today->Format('%@ %A %O %E'));
// death/yahrzeit event date
$content .= ""; $content .= "".$yahrzeit['date']->Display(true, NULL, array()).""; $content .= " | "; // Anniversary $content .= ""; $anniv = $yahrzeit['anniv']; if ($anniv==0) { $content .= ' '; } else { $content .= "{$anniv}"; } // upcomming yahrzeit dates $content .= " | "; $content .= "".$td->Display(true, NULL, array('gregorian')).""; // hCalendar:url $content .= " | "; $content .= "
";
$content .= ' '.translate_fact('GIVN').''; $content .= i18n::translate('Total Names').": ".$count; $content .= ' | ';
$content .= '';
$content .= '