Issue #0001766: Afficher correctement en cas s'il n'y a pas de date ou lieu de naissance

This commit is contained in:
Aram HARUTYUNYAN 2014-03-18 14:55:44 +00:00
parent 1b1485e624
commit 483b657f8e

View File

@ -1,28 +1,26 @@
<div>
<?php if ($this->result->PpPm == 'PP') {?>
<?php if (!empty($this->result->civilite)) {?>
<?=$this->result->civilite?>&nbsp;
<?php $sexe=($this->result->civilite=='M')?'':'e';?>
<?php }?>
<?php if (!empty($this->result->nom)) {?>
<?=$this->result->nom?>&nbsp;
<?php }?>
<?php if (!empty($this->result->prenom)) {?>
<?=$this->result->prenom?>&nbsp;
<?php }?>
<?php if (!empty($this->result->nomUsage)) {?>
(<?=$this->result->nomUsage?>)&nbsp;
<?php }?>
<?php if (!empty($this->result->naissanceDate) && $this->result->naissanceDate!='0000-00-00') {?>
<?php $date = new Zend_Date($this->result->naissanceDate, 'YYYY-MM-dd')?>
<br/><?=$sexe;?> le <?=$date->toString('dd/MM/yyyy');?>&nbsp;
<?php }?>
<?php if (!empty($this->result->naissanceLieu)) {?>
à <?=$this->result->naissanceLieu?>&nbsp;
<?php }?>
<?php if (!empty($this->result->naissanceDeptPays)) {?>
(<?=$this->result->naissanceDeptPays?>)
<?php }?>
<?php
$message = '';
if (!empty($this->result->naissanceDate) && $this->result->naissanceDate!='0000-00-00') {
$date = new Zend_Date($this->result->naissanceDate, 'yyyy-MM-dd');
$message = $message.' '.$this->translate("le").' '.$date->toString('dd/MM/yyyy');
}
if (!empty($this->result->naissanceLieu) || !empty($this->result->naissanceDeptPays)) {
$message = $message.' '.$this->translate("à").' '.$this->result->naissanceLieu.' '.$this->result->naissanceDeptPays;
}
if ($message!='') {
if ($this->result->civilite=='' || $this->result->civilite==null) {
$message = $this->translate("Né(e)").' '.$message;
} else if ($this->result->civilite=='M') {
$message = $this->translate("Né").' '.$message;
} else {
$message = $this->translate("Née").' '.$message;
}?>
<?=$message;?>
<?php } ?>
<?php } else {?>