Issue #0001667: lienrefsaveAction() modified.

Changed also wdate from static to dynamic
This commit is contained in:
Aram HARUTYUNYAN 2013-07-26 13:34:01 +00:00
parent c06ef199f0
commit a10faaafc0

View File

@ -1,6 +1,7 @@
<?php
class SaisieController extends Zend_Controller_Action
{
protected $wDate;
/**
* Enter description here ...
@ -336,6 +337,7 @@ class SaisieController extends Zend_Controller_Action
require_once 'common/dates.php';
$ws = new WsScores();
$this->wDate = new WDate();
$countries = json_decode($ws->getCatalogCountry(),true);
if ($countries!==false) {
$lib = array();
@ -908,15 +910,15 @@ class SaisieController extends Zend_Controller_Action
$saisie = array(
'source' => isset($_SESSION['source']) ? $_SESSION['source'] : $idanResult->source,
'dateParution' => isset($_SESSION['dateParution']) ? $_SESSION['dateParution'] :
WDate::dateT('Y-m-d', 'd/m/Y', substr($idanResult->dateSource,0,10)),
$this->wDate->dateT('Y-m-d', 'd/m/Y', substr($idanResult->dateSource,0,10)),
'numParution' => isset($_SESSION['numParution']) ? $_SESSION['numParution'] : '',
'dateJugement' => WDate::dateT('Y-m-d', 'd/m/Y', $idanResult->dateEffetFinP),
'dateJugement' => $this->wDate->dateT('Y-m-d', 'd/m/Y', $idanResult->dateEffetFinP),
'tribunal' => $idanResult->tribunal,
'even' => $idanResult->even->item,
'eventNum' => $eventLimit,
'comp' => $idanResult->complement,
'montant' => $idanResult->montant,
'dateFinPeriode' => WDate::dateT('Y-m-d', 'd/m/Y', $idanResult->dateJugement),
'dateFinPeriode' => $this->wDate->dateT('Y-m-d', 'd/m/Y', $idanResult->dateJugement),
);
$intervenants = array();
@ -1643,7 +1645,7 @@ class SaisieController extends Zend_Controller_Action
$this->view->assign('PDetention', $infos['PDetention']);
$this->view->assign('Pvote', $infos['Pvote']);
$this->view->assign('MajMin', $infos['MajMin']);
$this->view->assign('dateEffetLien', WDate::dateT('Y-m-d', 'd/m/Y', $infos['dateEffetLien']));
$this->view->assign('dateEffetLien', $this->wDate->dateT('Y-m-d', 'd/m/Y', $infos['dateEffetLien']));
}
//Mode = edit / add
@ -1671,7 +1673,7 @@ class SaisieController extends Zend_Controller_Action
$this->view->assign('PDetention', $infos['PDetention']);
$this->view->assign('Pvote', $infos['Pvote']);
$this->view->assign('MajMin', $infos['MajMin']);
$this->view->assign('dateEffetLien', WDate::dateT('Y-m-d', 'd/m/Y', $infos['dateEffetLien']));
$this->view->assign('dateEffetLien', $this->wDate->dateT('Y-m-d', 'd/m/Y', $infos['dateEffetLien']));
} else {
@ -1852,7 +1854,7 @@ class SaisieController extends Zend_Controller_Action
'nom' => strtoupper(trim($params['nom'])),
'prenom' => ucfirst(trim($params['prenom'])),
'nom_usage' => strtoupper(trim($params['nom_usage'])),
'naissance_date' => empty($params['naissance_date']) ? '' : WDate::dateT('d/m/Y','Ymd',$params['naissance_date']),
'naissance_date' => empty($params['naissance_date']) ? '' : $this->wDate->dateT('d/m/Y','Ymd',$params['naissance_date']),
'naissance_dept_pays' => $params['naissance_dept_pays'],
'naissance_lieu' => $params['naissance_lieu'],
'nat' => $params['nat'],
@ -1871,8 +1873,9 @@ class SaisieController extends Zend_Controller_Action
'dateSaisie' => date('YmdHis'),
'capital' => empty($params['capital']) ? '' : trim($params['capital']),
'deviseCapital' => empty($params['deviseCapital']) ? 'EUR' : $params['deviseCapital'],
'dateCapital' => empty($params['dateCapital']) ? '' : WDate::dateT('d/m/Y', 'Ymd', $params['dateCapital']),
'dateCapital' => empty($params['dateCapital']) ? '' : $this->wDate->dateT('d/m/Y', 'Ymd', $params['dateCapital']),
'nbActions' => empty($params['nbActions']) ? '' : $params['nbActions'],
'dateNbActions' => empty($params['dateNbActions']) ? '' : $this->wDate->dateT('d/m/Y', 'Ymd', $params['dateNbActions']),
'idLoc1Type' => $params['idLoc1Type'],
'idLoc1Num' => trim($params['idLoc1Num']),
'idLoc2Type' => $params['idLoc2Type'],
@ -1913,7 +1916,7 @@ class SaisieController extends Zend_Controller_Action
if ($params['mode']=='delete') {
$infos = array(
'actif' => 0,
'dateEffetLien' => empty($params['dateEffetLien']) ? date('Ymd') : WDate::dateT('d/m/Y', 'Ymd', $params['dateEffetLien']),
'dateEffetLien' => empty($params['dateEffetLien']) ? date('Ymd') : $this->wDate->dateT('d/m/Y', 'Ymd', $params['dateEffetLien']),
'motifUpdate' => empty($params['motifUpdate']) ? '' : $params['motifUpdate'],
);
} else {
@ -1933,7 +1936,7 @@ class SaisieController extends Zend_Controller_Action
'Pvote' => ($params['Pvote']=='') ? null : $params['Pvote'],
'MajMin' => $params['MajMin'],
'idPar' => $idPar,
'dateEffetLien' => empty($params['dateEffetLien']) ? date('Ymd') : WDate::dateT('d/m/Y', 'Ymd', $params['dateEffetLien']),
'dateEffetLien' => empty($params['dateEffetLien']) ? date('Ymd') : $this->wDate->dateT('d/m/Y', 'Ymd', $params['dateEffetLien']),
'motifUpdate' => empty($params['motifUpdate']) ? '' : $params['motifUpdate'],
);
}
@ -2004,7 +2007,7 @@ class SaisieController extends Zend_Controller_Action
'capital' => $identite->Bilan->Capital,
'deviseCapital' => 'EUR',
'dateCapital' => empty($identite->Bilan->Cloture) ? '' :
WDate::dateT('Ymd','d/m/Y',$identite->Bilan->Cloture),
$this->wDate->dateT('Ymd','d/m/Y',$identite->Bilan->Cloture),
'nbActions' => '',
'idLoc1Type' => '',
'idLoc1Num' => '',
@ -2054,7 +2057,7 @@ class SaisieController extends Zend_Controller_Action
if (!file_exists($path)) { mkdir($path); }
$date = WDate::dateT('d/m/Y', 'Ymd', $params['fileDate']);
$date = $this->wDate->dateT('d/m/Y', 'Ymd', $params['fileDate']);
$name = 'INTERNE-'.$params['idNum'].'-'.$params['fileType'].'-'.$date;
$n = $_FILES['fichier']['name'];
@ -2172,7 +2175,7 @@ class SaisieController extends Zend_Controller_Action
$this->view->assign('ape',$result->NafEnt);
$this->view->assign('capital',$result->Bilan->Capital);
$this->view->assign('deviseCapital', 'EUR');
$this->view->assign('dateCapital', Wdate::dateT('Ymd','d/m/Y',$result->Bilan->Cloture));
$this->view->assign('dateCapital', $this->wDate->dateT('Ymd','d/m/Y',$result->Bilan->Cloture));
$this->view->assign('bilDev', 'EUR');
$this->view->assign('bilMillesime', $result->Bilan->Millesime);
$this->view->assign('bilFL', $result->Bilan->CA);
@ -2230,7 +2233,7 @@ class SaisieController extends Zend_Controller_Action
case 'dateNbActions':
case 'naissance_date':
if (!empty($val) && $val!='0000-00-00')
$this->view->assign($key, WDate::dateT('Y-m-d', 'd/m/Y', $val));
$this->view->assign($key, $this->wDate->dateT('Y-m-d', 'd/m/Y', $val));
break;
default:
$this->view->assign($key, $val);