getRequest(); $source = $request->getParam('source', ''); $siret = $request->getParam('siret'); $sourceTxt = array( 'annonces' => 'Annonces', 'insee' => 'Insee', 'bilans' => 'Bilans', 'score' => 'IndiScore', 'actes' => 'Actes', 'dirigeants' => 'Dirigeants', 'privileges' => 'Privilèges', ); $sourceDroit = array( 'annonces' => 'survannonce', 'insee' => 'survinsee', 'bilans' => 'survbilan', 'score' => 'survscore', 'actes' => 'survactes', 'dirigeants' => 'survdirigeants', 'privileges' => 'survpriv', ); $user = new Utilisateur(); //if ($user->checkPref()) //if ($user->checkPerm()) $listSurv = array(); $ws = new WsScores(); $infos = $ws->getSurveillances('siren', $source, $siret); $surveillances = $infos->result->item; if (count($surveillances)>0) { $titre = 'Ajouter une surveillance'; $texte = "L'entité est sous surveillance"; foreach($surveillances as $surv){ $tooltipTexte = ''; $ref = $surv->ref; $tooltipTexte.= "Ref : ".$ref; $tooltipTexte.= "
Date d'ajout :".WDate::dateT('Y-m-d', 'd/m/Y', $surv->dateAjout); if ($surv->dateDerEnvoi!='0000-00-00 00:00:00') { $tooltipTexte.= "
Date de dernier envoi : ". WDate::dateT('Y-m-d', 'd/m/Y', substr($surv->dateDerEnvoi,0,10)); } $listSurv[] = array( 'tooltipTexte' => $tooltipTexte, 'sourceTexte' => $sourceTxt[$surv->source] ); } } else { $titre = 'Ajouter une surveillance'; $texte = 'Mettre sous surveillance'; } if (!empty($ref)) { $this->view->assign('ref', $ref); } else { $this->view->assign('ref', $ref); } $this->view->assign('surveillances', $listSurv); $this->view->assign('dialogTitre', $titre); $this->view->assign('dialogTexte', $texte); $this->view->assign('daialogSource', $source); } /** * Liste les surveillances */ public function listeAction() { $this->view->headLink()->appendStylesheet('/themes/default/styles/surveillance.css', 'all'); $this->view->headScript() ->appendFile('/themes/default/scripts/jquery.qtip.js', 'text/javascript') ->appendFile('/themes/default/scripts/jquery.tablesorter.js', 'text/javascript') ->appendFile('/themes/default/scripts/surveillance.js', 'text/javascript'); $firebug = Zend_Registry::get('firebug'); $request = $this->getRequest(); $page = $request->getParam('page', 0); $source = $request->getParam('source', ''); $tri = $request->getParam('tri', 'siren'); $detail = true; $nbAffichage = 100; $position = $page*$nbAffichage; switch($tri){ default: case 'siren': $triws = 'siren'; break; case 'rs': $triws = 'rs'; break; case 'reference': $triws = 'ref'; break; case 'dateajout': $triws = 'dateAjout'; break; case 'datederenvoi': $triws = 'dateDerEnvoi'; break; } // Source => Permission $tabSource = array( 'annonces' => 'annonce', 'insee' => 'insee', 'bilans' => 'bilan', 'score' => 'score', 'actes' => 'actes', 'dirigeants' => 'dirigeants', 'privileges' => 'priv', ); $user = new Utilisateur(); //Select Tri + Liste des sources autorisée $selectTri = ''; $permSource = array(); foreach ($tabSource as $s => $perm) { if ($user->checkPerm('surv'.$perm)) { $permSource[] = $s; $selectTri.= '