diff --git a/application/configs/menu.search.php b/application/configs/menu.search.php
index 9ce97884e..b7ee7387d 100644
--- a/application/configs/menu.search.php
+++ b/application/configs/menu.search.php
@@ -3,31 +3,31 @@ return array(
array(
'label' => "Entreprise",
'module' => 'search',
- 'controller' => 'index',
- 'action' => 'entreprise',
+ 'controller' => 'entreprise',
+ 'action' => 'index',
),
array(
'label' => "Dirigeant",
'module' => 'search',
- 'controller' => 'index',
- 'action' => 'dirigeant',
+ 'controller' => 'dirigeant',
+ 'action' => 'index',
),
array(
'label' => "Actionnaire",
'module' => 'search',
- 'controller' => 'index',
- 'action' => 'actionnaire',
+ 'controller' => 'actionnaire',
+ 'action' => 'index',
),
array(
'label' => "Annonce",
'module' => 'search',
- 'controller' => 'index',
- 'action' => 'annonce',
+ 'controller' => 'annonce',
+ 'action' => 'index',
),
array(
'label' => "Surveillance",
'module' => 'search',
- 'controller' => 'index',
- 'action' => 'surveillance',
+ 'controller' => 'surveillance',
+ 'action' => 'index',
),
);
\ No newline at end of file
diff --git a/application/modules/search/controllers/ActionnaireController.php b/application/modules/search/controllers/ActionnaireController.php
index af3de0beb..b54592f5a 100644
--- a/application/modules/search/controllers/ActionnaireController.php
+++ b/application/modules/search/controllers/ActionnaireController.php
@@ -1,6 +1,16 @@
getRequest();
+ $this->view->headTitle()->append('Recherche Actionnaire');
+ $form = new Application_Form_RechercheActionnaire();
+ if ( $request->isPost() || $request->isGet() ){
+ $form->populate($request->getParams());
+ }
+ $this->view->assign('form', $form);
+ }
+
public function listAction(){}
}
\ No newline at end of file
diff --git a/application/modules/search/controllers/DirigeantController.php b/application/modules/search/controllers/DirigeantController.php
index ed55c8c9d..43acf6ee7 100644
--- a/application/modules/search/controllers/DirigeantController.php
+++ b/application/modules/search/controllers/DirigeantController.php
@@ -1,6 +1,25 @@
theme = Zend_Registry::get('theme');
+ $this->view->inlineScript()->appendFile($this->theme->pathScript.'/recherche.js', 'text/javascript');
+ }
+
+ public function indexAction()
+ {
+ $request = $this->getRequest();
+ $this->view->headTitle()->prepend('Recherche Dirigeant');
+ $form = new Application_Form_RechercheDirigeant();
+ if ( $request->isPost() || $request->isGet() ){
+ $form->populate($request->getParams());
+ }
+ $this->view->assign('form', $form);
+ }
+
public function listAction(){}
}
\ No newline at end of file
diff --git a/application/modules/search/controllers/EntrepriseController.php b/application/modules/search/controllers/EntrepriseController.php
index e5b107edd..c7ca49fb5 100644
--- a/application/modules/search/controllers/EntrepriseController.php
+++ b/application/modules/search/controllers/EntrepriseController.php
@@ -7,6 +7,7 @@ class Search_EntrepriseController extends Zend_Controller_Action
{
// --- Theme
$this->theme = Zend_Registry::get('theme');
+ $this->view->inlineScript()->appendFile($this->theme->pathScript.'/recherche.js', 'text/javascript');
}
/**
diff --git a/application/modules/search/controllers/SurveillanceController.php b/application/modules/search/controllers/SurveillanceController.php
index faa5e81d9..525a7cb54 100644
--- a/application/modules/search/controllers/SurveillanceController.php
+++ b/application/modules/search/controllers/SurveillanceController.php
@@ -2,5 +2,150 @@
class Search_SurveillanceController extends Zend_Controller_Action
{
public function indexAction(){}
- public function listAction(){}
+
+ public function listAction()
+ {
+ $request = $this->getRequest();
+ $params = $request->getParams();
+ $type = $request->getParam('type', '');
+
+ $rechercheParams = new Scores_Session_Recherche();
+
+ //Si le formulaire a été soumis alors on enregistre en session et on redirige
+ if ( !empty($type) ) {
+ $rechercheParams->save($type, $params);
+ }
+
+ //On selectionne en session
+ if (count($rechercheParams->liste())>0){
+ $recherche = $rechercheParams->item(0);
+ $type = $recherche['type'];
+ $params = $recherche['params'];
+ }
+
+ $user = new Scores_Utilisateur();
+
+ $this->view->assign('login', $user->getLogin());
+
+ $page = $request->getParam('page', 1);
+ if ($page==0) $page = 1;
+ $page = $page-1;
+ $position = $page*$user->getNbRep();
+
+ $nbReponses = 0;
+ $nbReponsesTotal = 0;
+ $liste = array();
+
+ $ws = new WsScores();
+ $reponses = $ws->searchRefClient($params['ref'], $position, $user->getNbRep());
+ if ($reponses !== false){
+ $nbReponses = $reponses->nbReponses;
+ $nbReponsesTotal = $reponses->nbReponsesTotal;
+ $etabs = $reponses->result->item;
+
+ if (count($etabs)>0) {
+ foreach($etabs as $i => $etab) {
+ $item = array();
+ $item['position'] = ($position)+$i+1;
+ $item['id'] = $etab->id;
+ $item['siren'] = $etab->Siren;
+ $item['siret'] = $etab->Siren.$etab->Nic;
+ $item['InfoSiret'] = $etab->Siren.' '.$etab->Nic;
+ $item['InfoNom'] = $etab->Nom;
+
+ $nomDetail = '';
+ if ($etab->Nom2<>'' || $etab->Enseigne<>'' || $etab->Sigle<>'') {
+ $nomDetail.= '';
+ if ($etab->Nom2!='') $nomDetail.= $etab->Nom2.'
';
+ if ($etab->Enseigne<>'') $nomDetail.= 'Enseigne : '.$etab->Enseigne.' ';
+ if ($etab->Sigle<>'') $nomDetail.= 'Sigle : '.$etab->Sigle;
+ $nomDetail.= '
';
+ }
+ $item['InfoNomDetail'] = $nomDetail;
+ $item['InfoSiret'] = substr($etab->Siren,0,3).' '.
+ substr($etab->Siren,3,3).' '.
+ substr($etab->Siren,6,3).' '.
+ $etab->Nic;
+ $infoEtab = '';
+ if ($etab->Siege==1){
+ $infoEtab.= 'Établissement siège ';
+ } else {
+ $infoEtab.= 'Établissement secondaire ';
+ }
+ if ($etab->Actif==1){
+ $infoEtab.= 'actif';
+ } else {
+ $infoEtab.= 'inactif';
+ }
+ if (intval($etab->Nic)==0 || intval($item->Nic)>=99990) {
+ $infoEtab.=' provisoire';
+ }
+
+ if ($etab->Siege!=1 || ($etab->Siege==1 && $etab->Actif!=1)) {
+ $url = $this->view->url(array(
+ 'controller'=>'identite',
+ 'action'=>'fiche',
+ 'id' => $etab->id,
+ 'siret' => $etab->Siren,
+ ), 'default', true);
+ $infoEtab.= ' (Accès siège)';
+ }
+ $item['InfoEtab'] = $infoEtab;
+
+ $adresse = $etab->Adresse.'
';
+ if (isset($etab->Adresse2) && $etab->Adresse2 != '') {
+ $adresse.= $etab->Adresse2.'
';
+ }
+ $adresse.= "".$etab->CP." ".$etab->Ville."";
+ $item['InfoAdresse'] = $adresse;
+
+
+ $forme = '';
+ if (trim($etab->FJ)!='')
+ {
+ $forme = 'Forme : '.$etab->FJLib.' ('.$etab->FJ.')
';
+ }
+ $item['InfoForme'] = $forme;
+
+ $activite = '';
+ if (trim($etab->NafEnt)!='')
+ {
+ $activite = 'Activité : '.$etab->NafEntLib.' ('.$etab->NafEnt.')
';
+ }
+ $item['InfoActivite'] = $activite;
+
+ $item['login'] = $etab->Infos->login;
+ $item['email'] = $etab->Infos->email;
+ $item['source'] = $etab->Infos->source;
+ $item['ref'] = $etab->Infos->ref;
+
+ $date = new Zend_Date($etab->Infos->dateAjout, 'yyyy-MM-dd');
+ $item['dateAjout'] = $date->toString('dd/MM/yyyy');
+ if ( $etab->Infos->dateEnvoi!='0000-00-00' ) {
+ $date = new Zend_Date($etab->Infos->dateEnvoi, 'yyyy-MM-dd');
+ $item['dateEnvoi'] = $date->toString('dd/MM/yyyy');
+ } else {
+ $item['dateEnvoi'] = '';
+ }
+
+ $liste[] = $item;
+ }
+ }
+
+ }
+
+ if ($nbReponses < $nbReponsesTotal) {
+ $totPage = ceil($nbReponsesTotal/$user->getNbRep());
+ $curPage = $page+1;
+ } else {
+ $totPage = $curPage = 1;
+ }
+
+ $this->view->assign('nbReponses', $nbReponses);
+ $this->view->assign('nbReponsesTotal', $nbReponsesTotal);
+ $this->view->assign('totPage', $totPage);
+ $this->view->assign('curPage', $curPage);
+ $this->view->assign('liste', $liste);
+ }
}
\ No newline at end of file
diff --git a/application/modules/search/views/default/scripts/actionnaire/index.phtml b/application/modules/search/views/default/scripts/actionnaire/index.phtml
index e04d69420..48e3eeace 100644
--- a/application/modules/search/views/default/scripts/actionnaire/index.phtml
+++ b/application/modules/search/views/default/scripts/actionnaire/index.phtml
@@ -1,27 +1,59 @@
-form;
-?>
-