Merge from trunk

This commit is contained in:
Michael RICOIS 2015-07-15 13:34:41 +00:00
commit f2148d106d
195 changed files with 17052 additions and 358 deletions

View File

@ -1,6 +1,7 @@
<?php <?php
// Generated by ZF's ./bin/classmap_generator.php // Generated by ZF's ./bin/classmap_generator.php
return array( return array(
<<<<<<< .working
'Bootstrap' => dirname(__FILE__) . '//Bootstrap.php', 'Bootstrap' => dirname(__FILE__) . '//Bootstrap.php',
'AccountController' => dirname(__FILE__) . '//controllers/AccountController.php', 'AccountController' => dirname(__FILE__) . '//controllers/AccountController.php',
'AdminController' => dirname(__FILE__) . '//controllers/AdminController.php', 'AdminController' => dirname(__FILE__) . '//controllers/AdminController.php',
@ -38,4 +39,41 @@ return array(
'Zend_View_Helper_SirenTexte' => dirname(__FILE__) . '//views/default2015/helpers/SirenTexte.php', 'Zend_View_Helper_SirenTexte' => dirname(__FILE__) . '//views/default2015/helpers/SirenTexte.php',
'Zend_View_Helper_SiretTexte' => dirname(__FILE__) . '//views/default2015/helpers/SiretTexte.php', 'Zend_View_Helper_SiretTexte' => dirname(__FILE__) . '//views/default2015/helpers/SiretTexte.php',
'Zend_View_Helper_TrueLabel' => dirname(__FILE__) . '//views/default2015/helpers/TrueLabel.php', 'Zend_View_Helper_TrueLabel' => dirname(__FILE__) . '//views/default2015/helpers/TrueLabel.php',
=======
'Bootstrap' => dirname(__FILE__) . '//Bootstrap.php',
'AideController' => dirname(__FILE__) . '//controllers/AideController.php',
'AuthController' => dirname(__FILE__) . '//controllers/AuthController.php',
'BdfController' => dirname(__FILE__) . '//controllers/BdfController.php',
'DashboardController' => dirname(__FILE__) . '//controllers/DashboardController.php',
'DirigeantController' => dirname(__FILE__) . '//controllers/DirigeantController.php',
'ErrorController' => dirname(__FILE__) . '//controllers/ErrorController.php',
'EvaluationController' => dirname(__FILE__) . '//controllers/EvaluationController.php',
'FichierController' => dirname(__FILE__) . '//controllers/FichierController.php',
'FinanceController' => dirname(__FILE__) . '//controllers/FinanceController.php',
'GiantController' => dirname(__FILE__) . '//controllers/GiantController.php',
'IdentiteController' => dirname(__FILE__) . '//controllers/IdentiteController.php',
'IndexController' => dirname(__FILE__) . '//controllers/IndexController.php',
'JuridiqueController' => dirname(__FILE__) . '//controllers/JuridiqueController.php',
'LogoController' => dirname(__FILE__) . '//controllers/LogoController.php',
'MandataireController' => dirname(__FILE__) . '//controllers/MandataireController.php',
'OrderController' => dirname(__FILE__) . '//controllers/OrderController.php',
'PiecesController' => dirname(__FILE__) . '//controllers/PiecesController.php',
'PrintController' => dirname(__FILE__) . '//controllers/PrintController.php',
'RechercheController' => dirname(__FILE__) . '//controllers/RechercheController.php',
'SaisieController' => dirname(__FILE__) . '//controllers/SaisieController.php',
'SurveillanceController' => dirname(__FILE__) . '//controllers/SurveillanceController.php',
'TelechargementController' => dirname(__FILE__) . '//controllers/TelechargementController.php',
'UserController' => dirname(__FILE__) . '//controllers/UserController.php',
'WorldcheckController' => dirname(__FILE__) . '//controllers/WorldcheckController.php',
'Zend_View_Helper_CssHelper' => dirname(__FILE__) . '//views/default/helpers/CssHelper.php',
'Zend_View_Helper_Editable' => dirname(__FILE__) . '//views/default/helpers/Editable.php',
'Zend_View_Helper_FormatPct' => dirname(__FILE__) . '//views/default/helpers/FormatPct.php',
'Zend_View_Helper_JavascriptHelper' => dirname(__FILE__) . '//views/default/helpers/JavascriptHelper.php',
'Zend_View_Helper_MenuScript' => dirname(__FILE__) . '//views/default/helpers/MenuScript.php',
'Zend_View_Helper_NewsDate' => dirname(__FILE__) . '//views/mobile/helpers/NewsDate.php',
'Zend_View_Helper_RemplaceSiren' => dirname(__FILE__) . '//views/default/helpers/RemplaceSiren.php',
'Zend_View_Helper_SirenTexte' => dirname(__FILE__) . '//views/default/helpers/SirenTexte.php',
'Zend_View_Helper_SiretTexte' => dirname(__FILE__) . '//views/default/helpers/SiretTexte.php',
'Zend_View_Helper_TrueLabel' => dirname(__FILE__) . '//views/default/helpers/TrueLabel.php',
>>>>>>> .merge-right.r7277
); );

View File

@ -1,6 +1,13 @@
<?php <?php
class AideController extends Zend_Controller_Action class AideController extends Zend_Controller_Action
{ {
protected $theme;
public function init()
{
// --- Theme
$this->theme = Zend_Registry::get('theme');
}
/** /**
* Afficher bulle pour les nouveautés * Afficher bulle pour les nouveautés

View File

@ -1,6 +1,8 @@
<?php <?php
class AuthController extends Zend_Controller_Action class AuthController extends Zend_Controller_Action
{ {
protected $theme;
protected $partnerConfig = array( protected $partnerConfig = array(
'inextenso' => array( 'inextenso' => array(
'logo' => 'logo-in-extenso.gif', 'logo' => 'logo-in-extenso.gif',
@ -12,6 +14,12 @@ class AuthController extends Zend_Controller_Action
) )
); );
public function init()
{
// --- Theme
$this->theme = Zend_Registry::get('theme');
}
/** /**
* Point d'entrée pour les connexions partenaires. * Point d'entrée pour les connexions partenaires.
* L'utilisateur s'identifie sur son portail habituel. * L'utilisateur s'identifie sur son portail habituel.
@ -21,7 +29,7 @@ class AuthController extends Zend_Controller_Action
//Désactiver le layout //Désactiver le layout
$this->_helper->layout()->disableLayout(); $this->_helper->layout()->disableLayout();
$this->view->headLink()->appendStylesheet('/themes/default/styles/user.css', 'all'); $this->view->headLink()->appendStylesheet($this->themes->pathStyle.'/user.css', 'all');
$request = $this->getRequest(); $request = $this->getRequest();

View File

@ -1,6 +1,13 @@
<?php <?php
class BdfController extends Zend_Controller_Action class BdfController extends Zend_Controller_Action
{ {
protected $theme;
public function init()
{
// --- Theme
$this->theme = Zend_Registry::get('theme');
}
public function indexAction() public function indexAction()
{ {

View File

@ -1,7 +1,9 @@
<?php <?php
class DashboardController extends Zend_Controller_Action class DashboardController extends Zend_Controller_Action
{ {
protected $typeActes= array( protected $theme;
protected $typeActes= array(
'a00' => 'MODIFICATION', 'a00' => 'MODIFICATION',
'a01' => 'MODIFICATION', 'a01' => 'MODIFICATION',
'a02' => 'DISSOLUTION', 'a02' => 'DISSOLUTION',
@ -126,6 +128,9 @@ class DashboardController extends Zend_Controller_Action
public function init() public function init()
{ {
// --- Theme
$this->theme = Zend_Registry::get('theme');
require_once 'Scores/WsScores.php'; require_once 'Scores/WsScores.php';
} }
@ -238,7 +243,7 @@ class DashboardController extends Zend_Controller_Action
*/ */
public function commandesAction() public function commandesAction()
{ {
$this->view->headScript()->appendFile('/themes/default/scripts/dashboard.js', 'text/javascript'); $this->view->headScript()->appendFile($this->theme->pathScript.'/dashboard.js', 'text/javascript');
$request = $this->getRequest(); $request = $this->getRequest();
$type = $request->getParam('type', ''); $type = $request->getParam('type', '');
@ -568,8 +573,7 @@ class DashboardController extends Zend_Controller_Action
$this->_forward('perms', 'error'); $this->_forward('perms', 'error');
} }
$this->view->headScript() $this->view->headScript()->appendFile($this->theme->pathScript.'/dashboard.js', 'text/javascript');
->appendFile('/themes/default/scripts/dashboard.js', 'text/javascript');
$ws = new WsScores(); $ws = new WsScores();
$reponse = $ws->getListeClients(); $reponse = $ws->getListeClients();
@ -641,7 +645,7 @@ class DashboardController extends Zend_Controller_Action
public function usersAction() public function usersAction()
{ {
$this->view->headLink()->appendStylesheet('/themes/default/styles/user.css', 'all'); $this->view->headLink()->appendStylesheet($this->themes->pathStyle.'/user.css', 'all');
$user = new Scores_Utilisateur(); $user = new Scores_Utilisateur();
@ -668,10 +672,8 @@ class DashboardController extends Zend_Controller_Action
public function userAction() public function userAction()
{ {
$this->view->headLink() $this->view->headLink()->appendStylesheet($this->themes->pathStyle.'/user.css', 'all');
->appendStylesheet('/themes/default/styles/user.css', 'all') $this->view->headScript()->appendFile($this->theme->pathScript.'/user.js', 'text/javascript');
->appendStylesheet('/themes/default/styles/form.css', 'all');
$this->view->headScript()->appendFile('/themes/default/scripts/user.js', 'text/javascript');
$request = $this->getRequest(); $request = $this->getRequest();

View File

@ -1,11 +1,15 @@
<?php <?php
class DirigeantController extends Zend_Controller_Action class DirigeantController extends Zend_Controller_Action
{ {
protected $siret; protected $theme;
protected $siret;
protected $id; protected $id;
public function init() public function init()
{ {
// --- Theme
$this->theme = Zend_Registry::get('theme');
$request = $this->getRequest(); $request = $this->getRequest();
$this->siret = $request->getParam('siret'); $this->siret = $request->getParam('siret');
$this->id = $request->getParam('id', 0); $this->id = $request->getParam('id', 0);

View File

@ -1,7 +1,13 @@
<?php <?php
class ErrorController extends Zend_Controller_Action class ErrorController extends Zend_Controller_Action
{ {
public function init(){} protected $theme;
public function init()
{
// --- Theme
$this->theme = Zend_Registry::get('theme');
}
public function errorAction() public function errorAction()
{ {

View File

@ -1,11 +1,15 @@
<?php <?php
class EvaluationController extends Zend_Controller_Action class EvaluationController extends Zend_Controller_Action
{ {
protected $siret = null; protected $theme;
protected $siret = null;
protected $id = 0; protected $id = 0;
public function init() public function init()
{ {
// --- Theme
$this->theme = Zend_Registry::get('theme');
$request = $this->getRequest(); $request = $this->getRequest();
$this->siret = $request->getParam('siret'); $this->siret = $request->getParam('siret');
$this->id = $request->getParam('id', 0); $this->id = $request->getParam('id', 0);
@ -61,11 +65,8 @@ class EvaluationController extends Zend_Controller_Action
*/ */
public function scoreshistoAction() public function scoreshistoAction()
{ {
$this->view->headLink() $this->view->headLink()->appendStylesheet('/libs/tablesorter/themes/blue/style.css', 'all');
->appendStylesheet('/libs/tablesorter/themes/blue/style.css', 'all'); $this->view->headScript()->appendFile('/libs/tablesorter/jquery.tablesorter.js', 'text/javascript');
$this->view->headScript()
->appendFile('/libs/tablesorter/jquery.tablesorter.js', 'text/javascript');
$sessionEntreprise = new Scores_Session_Entreprise($this->siret, $this->id); $sessionEntreprise = new Scores_Session_Entreprise($this->siret, $this->id);
$siren = substr($this->siret,0,9); $siren = substr($this->siret,0,9);
@ -242,7 +243,7 @@ class EvaluationController extends Zend_Controller_Action
*/ */
public function indiscore2Action() public function indiscore2Action()
{ {
$this->view->headScript()->appendFile('/themes/default/scripts/finance.js', 'text/javascript'); $this->view->headScript()->appendFile($this->theme->pathScript.'/finance.js', 'text/javascript');
$this->view->headTitle()->prepend("Rapport de synthèse"); $this->view->headTitle()->prepend("Rapport de synthèse");
$this->view->headTitle()->prepend("Siret ".$this->siret); $this->view->headTitle()->prepend("Siret ".$this->siret);
@ -408,7 +409,7 @@ class EvaluationController extends Zend_Controller_Action
*/ */
public function indiscore3Action() public function indiscore3Action()
{ {
$this->view->headScript()->appendFile('/themes/default/scripts/evaluation.js', 'text/javascript'); $this->view->headScript()->appendFile($this->theme->pathScript.'/evaluation.js', 'text/javascript');
$this->view->headTitle()->prepend("Rapport complet"); $this->view->headTitle()->prepend("Rapport complet");
$this->view->headTitle()->prepend("Siret ".$this->siret); $this->view->headTitle()->prepend("Siret ".$this->siret);
@ -637,7 +638,7 @@ class EvaluationController extends Zend_Controller_Action
*/ */
public function enquetecAction() public function enquetecAction()
{ {
$this->view->headScript()->appendFile('/themes/default/scripts/enquetec.js', 'text/javascript'); $this->view->headScript()->appendFile($this->theme->pathScript.'/enquetec.js', 'text/javascript');
$this->view->headTitle()->prepend("Enquete commerciale"); $this->view->headTitle()->prepend("Enquete commerciale");
$this->view->headTitle()->prepend("Siret ".$this->siret); $this->view->headTitle()->prepend("Siret ".$this->siret);

View File

@ -1,7 +1,6 @@
<?php <?php
class FichierController extends Zend_Controller_Action class FichierController extends Zend_Controller_Action
{ {
public function init() public function init()
{ {
$this->_helper->layout()->disableLayout(); $this->_helper->layout()->disableLayout();

View File

@ -1,18 +1,22 @@
<?php <?php
class FinanceController extends Zend_Controller_Action class FinanceController extends Zend_Controller_Action
{ {
protected $theme;
protected $siret = null; protected $siret = null;
protected $id = 0; protected $id = 0;
public function init() public function init()
{ {
// --- Theme
$this->theme = Zend_Registry::get('theme');
require_once 'Scores/WsScores.php'; require_once 'Scores/WsScores.php';
$request = $this->getRequest(); $request = $this->getRequest();
$this->siret = $request->getParam('siret'); $this->siret = $request->getParam('siret');
$this->id = $request->getParam('id', 0); $this->id = $request->getParam('id', 0);
$this->view->headScript()->appendFile('/themes/default/scripts/finance.js', 'text/javascript'); $this->view->headScript()->appendFile($this->theme->pathScript.'/finance.js', 'text/javascript');
} }
public function indexAction() public function indexAction()

View File

@ -6,7 +6,8 @@ require_once 'Giant/Functions.lib.php';
class GiantController extends Zend_Controller_Action class GiantController extends Zend_Controller_Action
{ {
protected $TestIndication = false; protected $theme;
protected $TestIndication = false;
protected $config = array(); protected $config = array();
protected $TestCompanies = array( protected $TestCompanies = array(
@ -42,9 +43,11 @@ class GiantController extends Zend_Controller_Action
public function init() public function init()
{ {
// --- Theme
$this->theme = Zend_Registry::get('theme');
$this->view->headLink()->appendStylesheet('/themes/default/styles/giant.css', 'all'); $this->view->headLink()->appendStylesheet($this->themes->pathStyle.'/giant.css', 'all');
$this->view->headScript()->appendFile('/themes/default/scripts/giant.js', 'text/javascript'); $this->view->headScript()->appendFile($this->theme->pathScript.'/giant.js', 'text/javascript');
$this->view->debug = false; $this->view->debug = false;
$this->config = new Zend_Config_Ini( APPLICATION_PATH.'/../library/Giant/giant.ini' ); $this->config = new Zend_Config_Ini( APPLICATION_PATH.'/../library/Giant/giant.ini' );
$this->TestIndication = $this->config->test->TestIndication; $this->TestIndication = $this->config->test->TestIndication;
@ -257,8 +260,8 @@ class GiantController extends Zend_Controller_Action
public function startmonitoringAction() public function startmonitoringAction()
{ {
$this->_helper->layout()->disableLayout(); $this->_helper->layout()->disableLayout();
$this->view->headLink()->appendStylesheet('/themes/default/styles/giant.css', 'all'); $this->view->headLink()->appendStylesheet($this->themes->pathStyle.'/giant.css', 'all');
$this->view->headScript()->appendFile('/themes/default/scripts/giant.js', 'text/javascript'); $this->view->headScript()->appendFile($this->theme->pathScript.'/giant.js', 'text/javascript');
$this->view->lang = $this->getRequest()->getParam('lang'); $this->view->lang = $this->getRequest()->getParam('lang');
$this->view->CompanyId = $this->getRequest()->getParam('CompanyId'); $this->view->CompanyId = $this->getRequest()->getParam('CompanyId');
$this->view->Pays = $this->getRequest()->getParam('Pays'); $this->view->Pays = $this->getRequest()->getParam('Pays');
@ -292,7 +295,7 @@ class GiantController extends Zend_Controller_Action
public function stopmonitoringAction() public function stopmonitoringAction()
{ {
$this->_helper->layout()->disableLayout(); $this->_helper->layout()->disableLayout();
$this->view->headLink()->appendStylesheet('/themes/default/styles/giant.css', 'all'); $this->view->headLink()->appendStylesheet($this->themes->pathStyle.'/giant.css', 'all');
$this->view->CompanyId = $this->getRequest()->getParam('CompanyId'); $this->view->CompanyId = $this->getRequest()->getParam('CompanyId');
$this->view->InternalOrderId = $this->getRequest()->getParam('InternalOrderId'); $this->view->InternalOrderId = $this->getRequest()->getParam('InternalOrderId');
$this->view->Pays = $this->getRequest()->getParam('Pays'); $this->view->Pays = $this->getRequest()->getParam('Pays');
@ -315,7 +318,7 @@ class GiantController extends Zend_Controller_Action
public function updatemonitoringAction() public function updatemonitoringAction()
{ {
$this->_helper->layout()->disableLayout(); $this->_helper->layout()->disableLayout();
$this->view->headLink()->appendStylesheet('/themes/default/styles/giant.css', 'all'); $this->view->headLink()->appendStylesheet($this->themes->pathStyle.'/giant.css', 'all');
$this->view->lang = $this->getRequest()->getParam('lang'); $this->view->lang = $this->getRequest()->getParam('lang');
$this->view->CompanyId = $this->getRequest()->getParam('CompanyId'); $this->view->CompanyId = $this->getRequest()->getParam('CompanyId');
$this->view->InternalOrderId = $this->getRequest()->getParam('InternalOrderId'); $this->view->InternalOrderId = $this->getRequest()->getParam('InternalOrderId');
@ -342,7 +345,7 @@ class GiantController extends Zend_Controller_Action
} }
public function retriveAction() public function retriveAction()
{ {
$this->view->headScript()->appendFile('/themes/default/scripts/giant_monitoring.js', 'text/javascript'); $this->view->headScript()->appendFile($this->theme->pathScript.'/giant_monitoring.js', 'text/javascript');
$giantController = new GiantControllerLib(); $giantController = new GiantControllerLib();
$auth = Zend_Auth::getInstance(); $auth = Zend_Auth::getInstance();
if ( $auth->hasIdentity() ) { if ( $auth->hasIdentity() ) {
@ -405,8 +408,8 @@ class GiantController extends Zend_Controller_Action
public function reteventsAction() public function reteventsAction()
{ {
$this->_helper->layout()->disableLayout(); $this->_helper->layout()->disableLayout();
$this->view->headScript()->appendFile('/themes/default/scripts/giant_monitoring.js', 'text/javascript'); $this->view->headScript()->appendFile($this->theme->pathScript.'/giant_monitoring.js', 'text/javascript');
$this->view->headScript()->appendFile('/themes/default/scripts/giant.js', 'text/javascript'); $this->view->headScript()->appendFile$this->theme->pathScript.'/giant.js', 'text/javascript');
$auth = Zend_Auth::getInstance(); $auth = Zend_Auth::getInstance();
$identity = $auth->getIdentity(); $identity = $auth->getIdentity();
$result = $auth->getStorage()->read($identity); $result = $auth->getStorage()->read($identity);

View File

@ -1,15 +1,17 @@
<?php <?php
class IdentiteController extends Zend_Controller_Action class IdentiteController extends Zend_Controller_Action
{ {
protected $siret = null; protected $theme;
protected $siret = null;
protected $id = 0; protected $id = 0;
public function init() public function init()
{ {
$request = $this->getRequest(); // --- Theme
$theme = Zend_Registry::get('theme'); $this->theme = Zend_Registry::get('theme');
//Get standard parameters // --- Get standard parameters
$request = $this->getRequest();
$this->siret = $request->getParam('siret'); $this->siret = $request->getParam('siret');
$this->id = $request->getParam('id', 0); $this->id = $request->getParam('id', 0);
@ -424,6 +426,22 @@ class IdentiteController extends Zend_Controller_Action
{ {
$request = $this->getRequest(); $request = $this->getRequest();
$user = new Scores_Utilisateur();
$userAccessEdition = $user->checkModeEdition();
$this->view->AuthorizeGeocode = $userAccessEdition;
// --- Gestion source
$mapSource = 'google';
if ($mapSource == 'google') {
$this->view->headScript()->appendFile('http://maps.google.com/maps/api/js?sensor=false', 'text/javascript');
}
if ($mapSource == 'openstreetmap') {
$this->view->headLink()->appendStylesheet('/libs/openstreetmap/ol.css', 'all');
$this->view->headScript()->appendFile('/libs/openstreetmap/ol.js', 'text/javascript');
}
$this->view->source = $mapSource;
// --- Marker
$siren = substr($this->siret,0,9); $siren = substr($this->siret,0,9);
$actif = $request->getParam('actif', -1); $actif = $request->getParam('actif', -1);
@ -438,15 +456,14 @@ class IdentiteController extends Zend_Controller_Action
$ws = new WsScores(); $ws = new WsScores();
$infos = $ws->getEtablissementsGeo($siren, $actif, $position, $nbAffichage); $infos = $ws->getEtablissementsGeo($siren, $actif, $position, $nbAffichage);
Zend_Registry::get('firebug')->info($infos); Zend_Registry::get('firebug')->info($infos);
if ($infos === false) $this->_forward('soap', 'error'); if ($infos === false) $this->forward('soap', 'error');
$etabs = $infos->result->item; $etabs = $infos->result->item;
$marqueurs = array(); $marqueurs = array();
if ( count($etabs)>0 ) { if ( count($etabs)>0 ) {
foreach ($etabs as $i => $etab) foreach ($etabs as $i => $etab) {
{
if ($etab->Siege == 1) { if ($etab->Siege == 1) {
$type = 'Siège '; $type = 'Siège ';
} else { } else {
@ -642,6 +659,7 @@ class IdentiteController extends Zend_Controller_Action
{ {
$nbMonthForRecentLien = 3; $nbMonthForRecentLien = 3;
$this->view->headScript()->appendFile($this->theme->pathScript.'/identite-groupe.js', 'text/javascript');
$request = $this->getRequest(); $request = $this->getRequest();
$autrePage = $this->getRequest()->getParam('apage'); $autrePage = $this->getRequest()->getParam('apage');
$lienRef = $request->getParam('lienref', null); $lienRef = $request->getParam('lienref', null);
@ -1559,7 +1577,8 @@ class IdentiteController extends Zend_Controller_Action
*/ */
public function groupeAction() public function groupeAction()
{ {
$this->view->headTitle()->prepend("Groupe"); $this->view->headScript()->appendFile($this->theme->pathScript.'/identite-groupe.js', 'text/javascript');
$this->view->headTitle()->prepend("Groupe");
$this->view->headTitle()->prepend("Siret ".$this->siret); $this->view->headTitle()->prepend("Siret ".$this->siret);
$siren = substr($this->siret,0,9); $siren = substr($this->siret,0,9);

View File

@ -1,6 +1,7 @@
<?php <?php
class IndexController extends Zend_Controller_Action class IndexController extends Zend_Controller_Action
{ {
protected $theme;
/** /**
* Page d'accueil et de redirection * Page d'accueil et de redirection

View File

@ -1,11 +1,15 @@
<?php <?php
class JuridiqueController extends Zend_Controller_Action class JuridiqueController extends Zend_Controller_Action
{ {
protected $siret = null; protected $theme;
protected $siret = null;
protected $id = 0; protected $id = 0;
public function init() public function init()
{ {
// --- Theme
$this->theme = Zend_Registry::get('theme');
$request = $this->getRequest(); $request = $this->getRequest();
$this->siret = $request->getParam('siret'); $this->siret = $request->getParam('siret');
$this->id = $request->getParam('id', 0); $this->id = $request->getParam('id', 0);
@ -112,7 +116,7 @@ class JuridiqueController extends Zend_Controller_Action
if (!empty($idAnn) && in_array($vue, array('bodacc', 'abod', 'balo', 'asso', 'bomp')) ) { if (!empty($idAnn) && in_array($vue, array('bodacc', 'abod', 'balo', 'asso', 'bomp')) ) {
if ( $user->checkModeEdition() ){ if ( $user->checkModeEdition() ){
$this->view->headScript()->appendFile('/themes/default/scripts/saisieannonces.js', 'text/javascript'); $this->view->headScript()->appendFile($this->theme->pathScript.'/saisieannonces.js', 'text/javascript');
} }
$classType = 'annonces'.ucfirst($vue); $classType = 'annonces'.ucfirst($vue);
@ -215,7 +219,7 @@ class JuridiqueController extends Zend_Controller_Action
$this->view->assign($classType, $annonces); $this->view->assign($classType, $annonces);
} }
} }
$this->view->headScript()->appendFile('/themes/default/scripts/annonces.js', 'text/javascript'); $this->view->headScript()->appendFile($this->theme->pathScript.'/annonces.js', 'text/javascript');
} }
} }
} }
@ -345,7 +349,7 @@ class JuridiqueController extends Zend_Controller_Action
$this->view->headTitle()->prepend("Marques Déposées"); $this->view->headTitle()->prepend("Marques Déposées");
$this->view->headTitle()->prepend("Siret ".$this->siret); $this->view->headTitle()->prepend("Siret ".$this->siret);
$this->view->headScript()->appendFile('/themes/default/scripts/marques.js', 'text/javascript'); $this->view->headScript()->appendFile($this->theme->pathScript.'/marques.js', 'text/javascript');
$request = $this->getRequest(); $request = $this->getRequest();
$idObject = $request->getParam('idObject', 0); $idObject = $request->getParam('idObject', 0);

View File

@ -1,11 +1,15 @@
<?php <?php
class LogoController extends Zend_Controller_Action class LogoController extends Zend_Controller_Action
{ {
protected $pathLogo = ''; protected $theme;
protected $pathLogo = '';
public function init() public function init()
{ {
$c = Zend_Registry::get('config'); // --- Theme
$this->theme = Zend_Registry::get('theme');
$c = Zend_Registry::get('config');
$this->pathLogo = $c->profil->path->data.'/logos'; $this->pathLogo = $c->profil->path->data.'/logos';
} }

View File

@ -13,6 +13,8 @@
*/ */
class MandataireController extends Zend_Controller_Action class MandataireController extends Zend_Controller_Action
{ {
protected $theme;
protected $coursAppel = array( protected $coursAppel = array(
array( "triId"=>"1756", "triCode"=>"AIXPRL", "triNom"=>"Cour d'Appel d'Aix-en-Provence", "triCP"=>"13616" ), array( "triId"=>"1756", "triCode"=>"AIXPRL", "triNom"=>"Cour d'Appel d'Aix-en-Provence", "triCP"=>"13616" ),
array( "triId"=>"1757", "triCode"=>"AMIENL", "triNom"=>"Cour d'Appel d'Amiens", "triCP"=>"80027" ), array( "triId"=>"1757", "triCode"=>"AMIENL", "triNom"=>"Cour d'Appel d'Amiens", "triCP"=>"80027" ),
@ -54,7 +56,10 @@ class MandataireController extends Zend_Controller_Action
public function init() public function init()
{ {
require_once 'Scores/WsScores.php'; // --- Theme
$this->theme = Zend_Registry::get('theme');
require_once 'Scores/WsScores.php';
} }

View File

@ -1,6 +1,14 @@
<?php <?php
class OrderController extends Zend_Controller_Action class OrderController extends Zend_Controller_Action
{ {
protected $theme;
public function init()
{
// --- Theme
$this->theme = Zend_Registry::get('theme');
}
public function indexAction(){} public function indexAction(){}
public function kbisAction() public function kbisAction()

View File

@ -1,7 +1,9 @@
<?php <?php
class PiecesController extends Zend_Controller_Action class PiecesController extends Zend_Controller_Action
{ {
protected $association_cj = array( protected $theme;
protected $association_cj = array(
'9150', // Association syndicale libre '9150', // Association syndicale libre
'9220', // Association déclarée '9220', // Association déclarée
'9221', // Association déclarée "entreprises d'insertion par l'économique" '9221', // Association déclarée "entreprises d'insertion par l'économique"
@ -18,6 +20,9 @@ class PiecesController extends Zend_Controller_Action
public function init() public function init()
{ {
// --- Theme
$this->theme = Zend_Registry::get('theme');
require_once 'Scores/WsScores.php'; require_once 'Scores/WsScores.php';
$request = $this->getRequest(); $request = $this->getRequest();
@ -108,7 +113,7 @@ class PiecesController extends Zend_Controller_Action
*/ */
public function actesAction() public function actesAction()
{ {
$this->view->headScript()->appendFile('/themes/default/scripts/pieces.js', 'text/javascript'); $this->view->headScript()->appendFile($this->theme->pathScript.'/pieces.js', 'text/javascript');
$user = new Scores_Utilisateur(); $user = new Scores_Utilisateur();
$session = new Scores_Session_Entreprise($this->siret, $this->id); $session = new Scores_Session_Entreprise($this->siret, $this->id);
@ -270,7 +275,7 @@ class PiecesController extends Zend_Controller_Action
$user = new Scores_Utilisateur(); $user = new Scores_Utilisateur();
$session = new Scores_Session_Entreprise($this->siret, $this->id); $session = new Scores_Session_Entreprise($this->siret, $this->id);
$this->view->headScript()->appendFile('/themes/default/scripts/pieces.js', 'text/javascript'); $this->view->headScript()->appendFile($this->theme->pathScript.'/pieces.js', 'text/javascript');
//Catégorie Juridique //Catégorie Juridique
$cj = $session->getFormeJuridique(); $cj = $session->getFormeJuridique();
@ -708,7 +713,7 @@ class PiecesController extends Zend_Controller_Action
public function commandeAction() public function commandeAction()
{ {
$request = $this->getRequest(); $request = $this->getRequest();
$this->view->headScript()->appendFile('/themes/default/scripts/pieces.js', 'text/javascript'); $this->view->headScript()->appendFile($this->theme->pathScript.'/pieces.js', 'text/javascript');
$siren = substr($this->siret, 0, 9); $siren = substr($this->siret, 0, 9);

View File

@ -1,8 +1,13 @@
<?php <?php
class PrintController extends Zend_Controller_Action class PrintController extends Zend_Controller_Action
{ {
protected $theme;
public function init(){} public function init()
{
// --- Theme
$this->theme = Zend_Registry::get('theme');
}
/** /**
* Renvoie les paramètres pour l'impression * Renvoie les paramètres pour l'impression

View File

@ -5,6 +5,9 @@ class RechercheController extends Zend_Controller_Action
public function init() public function init()
{ {
// --- Theme
$this->theme = Zend_Registry::get('theme');
/** Pour Giant **/ /** Pour Giant **/
if(isset($_SESSION['recherche']['giant'])) if(isset($_SESSION['recherche']['giant']))
unset($_SESSION['recherche']['giant']); unset($_SESSION['recherche']['giant']);

View File

@ -1,8 +1,8 @@
<?php <?php
class SaisieController extends Zend_Controller_Action class SaisieController extends Zend_Controller_Action
{ {
protected $countries; protected $theme;
protected $countries;
protected $currencies; protected $currencies;
/** /**
@ -244,7 +244,10 @@ class SaisieController extends Zend_Controller_Action
public function init() public function init()
{ {
require_once 'Scores/WsScores.php'; // --- Theme
$this->theme = Zend_Registry::get('theme');
require_once 'Scores/WsScores.php';
require_once 'Scores/IdentiteEntreprise.php'; require_once 'Scores/IdentiteEntreprise.php';
$ws = new WsScores(); $ws = new WsScores();
@ -270,7 +273,7 @@ class SaisieController extends Zend_Controller_Action
$this->currencies = $currencies; $this->currencies = $currencies;
} }
$this->view->headLink()->appendStylesheet('/themes/default/styles/saisie.css', 'all'); $this->view->headLink()->appendStylesheet($this->themes->pathStyle.'/saisie.css', 'all');
} }
/** /**
@ -288,7 +291,7 @@ class SaisieController extends Zend_Controller_Action
public function ficheAction() public function ficheAction()
{ {
$this->view->headScript() $this->view->headScript()
->appendFile('/themes/default/scripts/saisie.js', 'text/javascript') ->appendFile($this->theme->pathScript.'/saisie.js', 'text/javascript')
->appendFile('/libs/form/jquery.form.min.js', 'text/javascript'); ->appendFile('/libs/form/jquery.form.min.js', 'text/javascript');
$request = $this->getRequest(); $request = $this->getRequest();

View File

@ -1,6 +1,8 @@
<?php <?php
class SurveillanceController extends Zend_Controller_Action class SurveillanceController extends Zend_Controller_Action
{ {
protected $theme;
/** /**
* Association source => texte * Association source => texte
* @var array * @var array
@ -35,6 +37,9 @@ class SurveillanceController extends Zend_Controller_Action
public function init() public function init()
{ {
// --- Theme
$this->theme = Zend_Registry::get('theme');
require_once 'Scores/WsScores.php'; require_once 'Scores/WsScores.php';
} }
@ -143,11 +148,19 @@ class SurveillanceController extends Zend_Controller_Action
$validateur = new Zend_Validate_EmailAddress(); $validateur = new Zend_Validate_EmailAddress();
//Vérification siret / email / ref // --- Vérification siret
if (empty($siret) || empty($email) || empty($ref)){ if ( empty($siret) ){
$msg = 'Erreur email ou reférence non définie !'; $msg = 'Erreur SIRET non définie !';
}
// --- Vérification email
elseif ( empty($email) ){
$msg = 'Erreur email non définie !';
}
// --- Vérification ref
elseif ( empty($ref) ){
$msg = 'Erreur reférence non définie !';
} else { } else {
// --- Vérification des emails
$emails = explode(';', $email); $emails = explode(';', $email);
$emailsValid = true; $emailsValid = true;
foreach ( $emails as $email ) { foreach ( $emails as $email ) {
@ -156,7 +169,6 @@ class SurveillanceController extends Zend_Controller_Action
break; break;
} }
} }
if ( $emailsValid ) { if ( $emailsValid ) {
//Vérification de l'encours (chiffres) //Vérification de l'encours (chiffres)
if (!preg_match('/([0-9]+)/', $encours)){ if (!preg_match('/([0-9]+)/', $encours)){
@ -283,7 +295,7 @@ class SurveillanceController extends Zend_Controller_Action
$this->view->headScript() $this->view->headScript()
->appendFile('/libs/tablesorter/jquery.tablesorter.js', 'text/javascript') ->appendFile('/libs/tablesorter/jquery.tablesorter.js', 'text/javascript')
->appendFile('/themes/default/scripts/surveillance.js', 'text/javascript'); ->appendFile($this->theme->pathScript.'/surveillance.js', 'text/javascript');
$request = $this->getRequest(); $request = $this->getRequest();
@ -424,7 +436,7 @@ class SurveillanceController extends Zend_Controller_Action
$this->_forward('perms', 'error'); $this->_forward('perms', 'error');
} }
$this->view->headScript()->appendFile('/themes/default/scripts/surveillance.js', 'text/javascript'); $this->view->headScript()->appendFile($this->theme->pathScript.'/surveillance.js', 'text/javascript');
$request = $this->getRequest(); $request = $this->getRequest();
@ -629,7 +641,7 @@ class SurveillanceController extends Zend_Controller_Action
*/ */
public function portefeuillecsvAction() public function portefeuillecsvAction()
{ {
$this->view->headScript()->appendFile('/themes/default/scripts/portefeuillecsv.js', 'text/javascript'); $this->view->headScript()->appendFile($this->theme->pathScript.'/portefeuillecsv.js', 'text/javascript');
} }
/** /**
@ -637,7 +649,7 @@ class SurveillanceController extends Zend_Controller_Action
*/ */
public function surveillancecsvAction() public function surveillancecsvAction()
{ {
$this->view->headScript()->appendFile('/themes/default/scripts/surveillancecsv.js', 'text/javascript'); $this->view->headScript()->appendFile($this->theme->pathScript.'/surveillancecsv.js', 'text/javascript');
$user = new Scores_Utilisateur(); $user = new Scores_Utilisateur();

View File

@ -1,6 +1,8 @@
<?php <?php
class UserController extends Zend_Controller_Action class UserController extends Zend_Controller_Action
{ {
protected $theme;
/** /**
* Return a ramdom password * Return a ramdom password
* @param int $length * @param int $length
@ -28,6 +30,9 @@ class UserController extends Zend_Controller_Action
public function init() public function init()
{ {
// --- Theme
$this->theme = Zend_Registry::get('theme');
require_once 'Scores/WsScores.php'; require_once 'Scores/WsScores.php';
} }
@ -53,8 +58,7 @@ class UserController extends Zend_Controller_Action
$this->view->assign('device_type', $user->getBrowserInfo()->mobile); $this->view->assign('device_type', $user->getBrowserInfo()->mobile);
$this->view->assign('browser_info', $user->getBrowserInfo()->name.' '.$user->getBrowserInfo()->version); $this->view->assign('browser_info', $user->getBrowserInfo()->name.' '.$user->getBrowserInfo()->version);
$this->view->headLink()->appendStylesheet('/themes/default/styles/form.css', 'all'); $this->view->headScript()->appendFile($this->theme->pathScript.'/user.js', 'text/javascript');
$this->view->headScript()->appendFile('/themes/default/scripts/user.js', 'text/javascript');
$request = $this->getRequest(); $request = $this->getRequest();
@ -320,7 +324,7 @@ class UserController extends Zend_Controller_Action
*/ */
public function consoAction() public function consoAction()
{ {
$this->view->headScript()->appendFile('/themes/default/scripts/conso.js', 'text/javascript'); $this->view->headScript()->appendFile($this->theme->pathScript.'/conso.js', 'text/javascript');
$user = new Scores_Utilisateur(); $user = new Scores_Utilisateur();

View File

@ -1,11 +1,15 @@
<?php <?php
class WorldcheckController extends Zend_Controller_Action class WorldcheckController extends Zend_Controller_Action
{ {
protected $wcConfig; protected $theme;
protected $wcConfig;
public function init() public function init()
{ {
require_once 'WorldCheck/WsWorldCheck.php'; // --- Theme
$this->theme = Zend_Registry::get('theme');
require_once 'WorldCheck/WsWorldCheck.php';
require_once 'Scores/Cache.php'; require_once 'Scores/Cache.php';
$configWC = new Zend_Config_Ini(APPLICATION_PATH . '/../library/WorldCheck/applicationWC.ini'); $configWC = new Zend_Config_Ini(APPLICATION_PATH . '/../library/WorldCheck/applicationWC.ini');

View File

@ -1,5 +1,6 @@
<div id="carte" style="width:100%;height:500px">Préparation de la carte ...</div> <div id="map" class="map">Préparation de la carte ...</div>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<?php if ($this->source == 'google') {?>
<script type="text/javascript"> <script type="text/javascript">
<?php echo 'var marks = '.$this->marks.';'?> <?php echo 'var marks = '.$this->marks.';'?>
var timer; var timer;
@ -40,42 +41,6 @@ function createMarker(m) {
}); });
// --- Extend map by adding marker // --- Extend map by adding marker
zoneMarker.extend(marker.getPosition()); zoneMarker.extend(marker.getPosition());
// --- Geocode
if (m.gps.lat && m.gps.lon) {
// --- Do nothing
} else {
var locations = [];
locations.push(m.location);
// --- Create an ElevationService
var elevator = new google.maps.ElevationService();
// Create a LocationElevationRequest object using the array's one value
var positionalRequest = {
'locations': locations
}
// Initiate the location request
elevator.getElevationForLocations(positionalRequest, function(results, status) {
if (status == google.maps.ElevationStatus.OK) {
if (results[0]) {
var alt = results[0].elevation;
if (results[0].elevation<-500) {
alt = 0;
}
if (results[0].resolution>500) {
alt = 0;
}
$.post('/saisie/geocode', {
siret: m.siret,
lat: m.locationLat,
lng: m.locationLng,
alt: alt,
address: m.locationAddress,
precis: m.locationType
});
}
}
});
}
} }
// --- Load Google Map // --- Load Google Map
@ -84,7 +49,7 @@ function loadGoogleMap() {
zoom: 8, zoom: 8,
mapTypeId: google.maps.MapTypeId.ROADMAP mapTypeId: google.maps.MapTypeId.ROADMAP
}; };
map = new google.maps.Map(document.getElementById('carte'), mapOptions); map = new google.maps.Map(document.getElementById('map'), mapOptions);
zoneMarker = new google.maps.LatLngBounds(); zoneMarker = new google.maps.LatLngBounds();
$.each(marks, function (i, item){ $.each(marks, function (i, item){
if (item.location) { if (item.location) {
@ -108,6 +73,7 @@ $(document).ready(function(){
marks[i].location = new google.maps.LatLng(item.gps.lat, item.gps.lon); marks[i].location = new google.maps.LatLng(item.gps.lat, item.gps.lon);
markDone++; markDone++;
} else { } else {
<?php if ($this->AuthorizeGeocode) {?>
geocoder.geocode({ address:item.address, region:'FR' }, function(results, status) { geocoder.geocode({ address:item.address, region:'FR' }, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) { if (status == google.maps.GeocoderStatus.OK) {
if (results[0]) { if (results[0]) {
@ -117,12 +83,107 @@ $(document).ready(function(){
marks[i].locationLng = results[0].geometry.location.lng(); marks[i].locationLng = results[0].geometry.location.lng();
marks[i].locationType = results[0].geometry.location_type; marks[i].locationType = results[0].geometry.location_type;
marks[i].locationAddress = results[0].formatted_address marks[i].locationAddress = results[0].formatted_address
// --- Altitude
var alt = 0;
var locations = [];
locations.push(marks[i].location);
// --- Create an ElevationService
var elevator = new google.maps.ElevationService();
// Create a LocationElevationRequest object using the array's one value
var positionalRequest = {
'locations': locations
}
// Initiate the location request
elevator.getElevationForLocations(positionalRequest, function(results, status) {
if (status == google.maps.ElevationStatus.OK) {
if (results[0]) {
var alt = results[0].elevation;
if (results[0].elevation<-500) {
alt = 0;
}
if (results[0].resolution>500) {
alt = 0;
}
}
}
});
// --- Send to webservice
$.post('/saisie/geocode', {
siret: marks[i].siret,
lat: marks[i].locationLat,
lng: marks[i].locationLng,
alt: alt,
address: marks[i].locationAddress,
precis: marks[i].locationType
});
} }
} }
markDone++; markDone++;
//console.log("GeoCode: " + status + ' - index: ' + i); //console.log("GeoCode: " + status + ' - index: ' + i);
}); });
<?php }?>
} }
}); });
}); });
</script> </script>
<?php }?>
<?php if ($this->source == 'openstreetmap') {?>
<script type="text/javascript">
<?php echo 'var marks = '.$this->marks.';'?>
var zoneMarker;
var zoom = 6;
var FCenterLng = 1.87528;
var FCenterLat = 46.60611;
//--- Wait the document is ready
$(document).ready(function(){
// --- Load Map
var map = new ol.Map({
target: 'map',
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
})
],
view: new ol.View({
center: ol.proj.transform([FCenterLng, FCenterLat], 'EPSG:4326', 'EPSG:3857'),
zoom: zoom
})
});
// --- Zone des markers
// --- Create Markers
$.each(marks, function (i, item){
if (item.gps.lat && item.gps.lon) {
}
});
});
function createMarker(m){
// --- Info Window, Create event marker
var icon = $('<img src="' + m.icon + '">');
//.tooltip({title: 'Hello, world!', trigger: 'click'})
// --- Marker options
var marker = new ol.Overlay({
position: ol.proj.transform([2, 46], 'EPSG:4326', 'EPSG:3857'),
element: icon
});
map.addOverlay(marker);
// --- Extend map by adding marker
//ol.control.ZoomToExtent ol.extent.boundingExtent
}
</script>
<?php }?>

View File

@ -103,20 +103,24 @@ function survSubmit(){
} }
$('#frmSurv').replaceWith('<div id="frmSurv">Mise sous surveillance en cours...</div>'); $('#frmSurv').replaceWith('<div id="frmSurv">Mise sous surveillance en cours...</div>');
if (source.length>0) { if (source.length>0) {
var i = 0;
$.each( source, function( key, value ) { $.each( source, function( key, value ) {
$.post(action, {siret: siret, ref: ref, email: email, encours: encours, source: value} , $.post(action, {siret: siret, ref: ref, email: email, encours: encours, source: value}, function(data) {
function(data) { $('#frmSurv').append('<br/>'+data); $('#frmSurv').append('<br/>'+data);
}, 'text'); }, 'text');
i++;
if (i == source.length) {
$('#frmSurv').append('<br/>Mise sous surveillance terminé.');
}
}); });
$('#frmSurv').append('<br/>Mise sous surveillance terminé.'); $('#dialogsurv').dialog({ buttons: [ {
$('#dialogsurv').dialog({ buttons: [ text: "Fermer", click: function() { window.location.href = windowhref; }
{ text: "Fermer", click: function() { window.location.href = windowhref; } } } ]});
]});
} else { } else {
$('#frmSurv').replaceWith('<div id="frmSurv">Aucune source !</div>'); $('#frmSurv').replaceWith('<div id="frmSurv">Aucune source !</div>');
$('#dialogsurv').dialog({ buttons: [ $('#dialogsurv').dialog({ buttons: [ {
{ text: "Fermer", click: function() { window.location.href = windowhref; } } text: "Fermer", click: function() { window.location.href = windowhref; }
]}); } ]});
} }
} }
</script> </script>

View File

@ -1,6 +1,5 @@
<div id="center"> <div class="row"><h1 class="titre"><?=$this->translate("Surveillance")?></h1></div>
<h1 class="titre">SURVEILLANCE</h1>
<div class="paragraph">
<?php <?php
if ( empty($this->source) ){ if ( empty($this->source) ){
?> ?>
@ -26,13 +25,11 @@ if ( empty($this->source) ){
<?php <?php
} }
?> ?>
</div>
<h2>Extraction des surveillances</h2> <div class="row"><h2><?=$this->translate("Extraction des surveillances")?></h2></div>
<?=$this->action('surveillancecsv', 'surveillance')?> <?=$this->action('surveillancecsv', 'surveillance')?>
<h2>Options de recherche</h2> <div class="row"><h2><?=$this->translate("Options de recherche")?></h2></div>
<div class="paragraph"> <div class="paragraph">
<label>Afficher uniquement les suveillances de type</label> <label>Afficher uniquement les suveillances de type</label>
<select name="type"> <select name="type">
@ -63,8 +60,7 @@ par
</form> </form>
</div> </div>
<div class="row"><h2><?=$this->translate("Liste des surveillances")?></h2></div>
<h2>Liste des surveillances</h2>
<?php if ($this->PageTotal>1) {?> <?php if ($this->PageTotal>1) {?>
<div class="paragraph"> <div class="paragraph">
<div class="pagination clearfix"> <div class="pagination clearfix">
@ -77,8 +73,7 @@ par
</div> </div>
<?php }?> <?php }?>
<div class="paragraph"> <table class="table table-bordered" id="surveillance">
<table class="tablesorter" id="surveillance" width="570">
<thead> <thead>
<tr> <tr>
<th width="75">Siren</th> <th width="75">Siren</th>
@ -119,7 +114,7 @@ par
?> ?>
</td> </td>
<td> <td style="white-space: nowrap;">
<?php <?php
foreach ($this->listSources as $source) { foreach ($this->listSources as $source) {
$ok = false; $ok = false;
@ -127,7 +122,7 @@ par
if ( $surveillance['source'] == $source ) { if ( $surveillance['source'] == $source ) {
?> ?>
<div class="action"> <div class="action">
<p><?=ucfirst($surveillance['source'])?></p> <?=ucfirst($surveillance['source'])?>
<a class="dialogsurv" href="<?=$this->url(array( <a class="dialogsurv" href="<?=$this->url(array(
'controller' => 'surveillance', 'controller' => 'surveillance',
'action' => 'ajouter', 'action' => 'ajouter',
@ -164,7 +159,7 @@ par
if ( $ok === false ) { if ( $ok === false ) {
?> ?>
<div class="action"> <div class="action">
<p><?=ucfirst($source)?></p> <?=ucfirst($source)?>
<a class="dialogsurv" href="<?=$this->url(array( <a class="dialogsurv" href="<?=$this->url(array(
'controller' => 'surveillance', 'controller' => 'surveillance',
'action' => 'ajouter', 'action' => 'ajouter',
@ -221,7 +216,6 @@ par
<?php } ?> <?php } ?>
</tbody> </tbody>
</table> </table>
</div>
<?php if ($this->PageTotal>1) {?> <?php if ($this->PageTotal>1) {?>
<div class="paragraph"> <div class="paragraph">
@ -235,7 +229,6 @@ par
</div> </div>
<?php }?> <?php }?>
</div>
<script type="text/javascript"> <script type="text/javascript">
function submitTri() { function submitTri() {
var tri = $('select[name=tri] option:selected').val(); var tri = $('select[name=tri] option:selected').val();
@ -270,29 +263,6 @@ $(document).ready(function() {
var val = $(this).val(); var val = $(this).val();
if ( val == '' ){ $(this).val(txt); } if ( val == '' ){ $(this).val(txt); }
}); });
<?php
if ($source == '') {
?>
$('#surveillance').tablesorter({
headers: {
2: { sorter: false },
3: { sorter: false },
4: { sorter: false },
5: { sorter: false }
}
});
<?php
} else {
?>
$('#surveillance').tablesorter({
headers: {
3: { sorter: false }
}
});
<?php
}
?>
}); });
</script> </script>

View File

@ -1,7 +1,4 @@
<div id="center"> <div class="row"><h1 class="titre"><?=$this->translate("Portefeuille")?></h1></div>
<h1>Portefeuille</h1>
<div class="paragraph">
<table class="table"> <table class="table">
<tr> <tr>
<td width="200" class="StyleInfoLib">Nombre d'entités affichées</td> <td width="200" class="StyleInfoLib">Nombre d'entités affichées</td>
@ -12,15 +9,12 @@
<td><?=$this->nbSurveillances?></td> <td><?=$this->nbSurveillances?></td>
</tr> </tr>
</table> </table>
</div>
<h2>Extraction de votre portefeuille</h2> <div class="row"><h2 class="titre"><?=$this->translate("Extraction de votre portefeuille")?></h2></div>
<div class="paragraph">
<?=$this->action('portefeuillecsv', 'surveillance')?> <?=$this->action('portefeuillecsv', 'surveillance')?>
</div>
<h2>Affichage</h2> <div class="row"><h2 class="titre"><?=$this->translate("Affichage")?></h2></div>
<div class="paragraph" id="formSurveillance"> <div id="formSurveillance">
<form name="recherche" action="<?=$this->url(array('controller'=>'surveillance', 'action'=>'portefeuille'))?>"> <form name="recherche" action="<?=$this->url(array('controller'=>'surveillance', 'action'=>'portefeuille'))?>">
<input type="text" name="siren" class="search" value="<?=($this->siren != null)? $this->siren : "Siren"?>" /> <input type="text" name="siren" class="search" value="<?=($this->siren != null)? $this->siren : "Siren"?>" />
<input type="text" name="ref" class="search" value="<?=($this->ref != null)? $this->ref : "Référence"?>" /> <input type="text" name="ref" class="search" value="<?=($this->ref != null)? $this->ref : "Référence"?>" />
@ -40,9 +34,7 @@ Tri par
</select> </select>
</div> </div>
<h2>Surveillance Score</h2> <div class="row"><h2 class="titre"><?=$this->translate("Surveillance Score")?></h2></div>
<div class="paragraph">
<?php if (count($this->portefeuille)>0) { ?> <?php if (count($this->portefeuille)>0) { ?>
<table class="table table-bordered table-striped"> <table class="table table-bordered table-striped">
<thead> <thead>
@ -94,7 +86,6 @@ Tri par
<?php } else {?> <?php } else {?>
Aucune surveillance Score. Aucune surveillance Score.
<?php }?> <?php }?>
</div>
<?php if ($this->PageTotal>1) {?> <?php if ($this->PageTotal>1) {?>
<div class="paragraph"> <div class="paragraph">
@ -108,8 +99,6 @@ Aucune surveillance Score.
</div> </div>
<?php }?> <?php }?>
</div>
<script> <script>
function submitTri() { function submitTri() {
var tri = $('select[name=tri] option:selected').val(); var tri = $('select[name=tri] option:selected').val();

View File

@ -21,8 +21,8 @@ class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract
$checkAuth = false; $checkAuth = false;
} }
if ($checkAuth) if ($checkAuth) {
{
$login = $request->getParam('login'); $login = $request->getParam('login');
$pass = $request->getParam('pass', ''); $pass = $request->getParam('pass', '');
$hach = $request->getParam('hach'); $hach = $request->getParam('hach');
@ -30,17 +30,22 @@ class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract
$auth = Zend_Auth::getInstance(); $auth = Zend_Auth::getInstance();
//Est ce que l'on a checkIp=only lors de la requête $mode = null;
$iponly = false; // --- Mode checkIp=only
if ($checkIp=='only') { if ($checkIp == 'only') {
$hach = 'iponly:'.$_SERVER['REMOTE_ADDR']; $hach = 'iponly:'.$_SERVER['REMOTE_ADDR'];
$iponly = true; $mode = 'iponly';
} }
// --- On vérifie le tout lors d'une connexion par url // --- On vérifie le tout lors d'une connexion par url
if ( !empty($login) && !empty($hach) ) { if ( !empty($login) && !empty($hach) ) {
$authAdapter = new Scores_Auth_Adapter_Ws($login, $hach, $iponly); // --- Mode hach
if ($mode === null) {
$mode = 'hach';
}
$authAdapter = new Scores_Auth_Adapter_Ws($login, $hach, $mode);
$result = $auth->authenticate($authAdapter); $result = $auth->authenticate($authAdapter);
if ( $result->isValid() ) { if ( $result->isValid() ) {

View File

@ -146,76 +146,6 @@ class Application_Controller_Plugin_Theme extends Zend_Controller_Plugin_Abstrac
->appendFile($paramsTheme->pathScript.'/script.js', 'text/javascript'); ->appendFile($paramsTheme->pathScript.'/script.js', 'text/javascript');
} }
/**
* ===> Specific Style and Script by Controller/Action
* Specialized Controller - Action javascript
* controllerName.js || controllerName-actionName.js
* array(
* 'controller-action' => array('file.js'=> 'inline|file')
* )
*/
$scripts = array(
'identite-fiche' => array(
'identite-fiche.js' => 'inline',
),
'identite-fichepc' => array(
'identite-fiche.js' => 'inline',
),
'identite-groupe' => array(
'identite-groupe.js' => 'inline',
),
'identite-liens' => array(
'identite-groupe.js' => 'inline',
),
'evaluation-indiscore3' => array(
'identite-fiche.js' => 'inline',
),
);
if ( count($scripts)>0 ) {
//Controller
$key = null;
if ( array_key_exists($controller, $scripts) ) {
$key = $controller;
}
if ( $key ) {
$options = $scripts[$key];
if ( is_array($options) ) {
foreach ( $options as $file => $type ) {
switch ( $type ) {
case 'inline':
$view->inlineScript()->appendFile($paramsTheme->pathScript.'/'.$file);
break;
case 'file':
$view->headScript()->appendFile($paramsTheme->pathScript.'/'.$file, 'text/javascript');
break;
}
}
}
}
//Controller-Action
$key = null;
if ( array_key_exists($controller.'-'.$action, $scripts) ) {
$key = $controller.'-'.$action;
}
if ( $key ) {
$options = $scripts[$key];
if ( is_array($options) ) {
foreach ( $options as $file => $type ) {
switch ( $type ) {
case 'inline':
$view->inlineScript()->appendFile($paramsTheme->pathScript.'/'.$file);
break;
case 'file':
$view->headScript()->appendFile($paramsTheme->pathScript.'/'.$file, 'text/javascript');
break;
}
}
}
}
}
break; break;
/** /**

View File

@ -25,6 +25,12 @@ class Scores_Auth_Adapter_Ws implements Zend_Auth_Adapter_Interface
*/ */
protected $_checkIp = false; protected $_checkIp = false;
/**
* Marqueur de vérification de hach
* @var boolean
*/
protected $_checkHach = false;
/** /**
* Liste des IPs des frontends (proxy) * Liste des IPs des frontends (proxy)
* @var array * @var array
@ -37,20 +43,25 @@ class Scores_Auth_Adapter_Ws implements Zend_Auth_Adapter_Interface
* Authentification par WS * Authentification par WS
* @param string $username * @param string $username
* @param string $password * @param string $password
* @param boolean $iponly * @param string $mode
*/ */
public function __construct($username, $password, $iponly = false) public function __construct($username, $password, $mode = null)
{ {
$this->_username = $username; $this->_username = $username;
$this->_password = $password; $this->_password = $password;
if ($iponly){
if ($mode == 'hach') {
$this->_checkHach = true;
}
if ($mode == 'iponly'){
$ip = $_SERVER['REMOTE_ADDR']; $ip = $_SERVER['REMOTE_ADDR'];
if ( isset($_SERVER['HTTP_X_FORWARDED_FOR']) && in_array($ip, $this->listProxyIp)) { if ( isset($_SERVER['HTTP_X_FORWARDED_FOR']) && in_array($ip, $this->listProxyIp)) {
$ip = $_SERVER['HTTP_X_FORWARDED_FOR']; $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
} }
$this->_password = 'iponly:'.$ip; $this->_password = 'iponly:'.$ip;
$this->_checkIp = true;
} }
$this->_checkIp = $iponly;
} }
/** /**
@ -71,10 +82,18 @@ class Scores_Auth_Adapter_Ws implements Zend_Auth_Adapter_Interface
if ( is_string($InfosLogin) || $InfosLogin->error->errnum != 0 ) { if ( is_string($InfosLogin) || $InfosLogin->error->errnum != 0 ) {
$message = $InfosLogin; $message = $InfosLogin;
return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID, $identity, array($message)); return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID, $identity, array($message));
} elseif ( $InfosLogin !== false && !empty($InfosLogin->result->login)) { }
// --- Assignation identity
elseif ( $InfosLogin !== false && !empty($InfosLogin->result->login)) {
$identity = new stdClass(); $identity = new stdClass();
if ($this->_checkIp || $this->_checkHach) {
Zend_Registry::get('firebug')->info("IN");
$identity->password = $this->_password;
} else {
$identity->password = md5($InfosLogin->result->login.'|'.$this->_password);
}
Zend_Registry::get('firebug')->info($identity->password);
$identity->username = $InfosLogin->result->login; $identity->username = $InfosLogin->result->login;
$identity->password = md5($InfosLogin->result->login.'|'.$this->_password);
$identity->email = $InfosLogin->result->email; $identity->email = $InfosLogin->result->email;
$identity->profil = $InfosLogin->result->profil; $identity->profil = $InfosLogin->result->profil;
$identity->pref = $InfosLogin->result->pref; $identity->pref = $InfosLogin->result->pref;

View File

@ -120,7 +120,7 @@ class Scores_Mail_Method extends Zend_Mail
//We suppose that character encoding of strings is UTF-8 on PHP script. //We suppose that character encoding of strings is UTF-8 on PHP script.
protected function txtConvert($string) protected function txtConvert($string)
{ {
return mb_convert_encoding($string, 'ISO-8859-1', 'UTF-8'); return mb_convert_encoding($string, 'ISO-8859-15', 'UTF-8');
} }
protected function recipientFilename($transport) protected function recipientFilename($transport)

View File

@ -94,7 +94,7 @@ class Scores_Session_Entreprise
if ( $this->get('Adresse2') != '' ) { if ( $this->get('Adresse2') != '' ) {
$adresse.= ' '.$this->get('Adresse2'); $adresse.= ' '.$this->get('Adresse2');
} }
if ( intval($this->identite->CP) != 0 ) { if ( $this->get('CP') != '' ) {
$adresse.= ' '.$this->get('CP'); $adresse.= ' '.$this->get('CP');
} }
$adresse.= ' '.$this->get('Ville'); $adresse.= ' '.$this->get('Ville');

View File

@ -53,6 +53,10 @@ class Scores_Ws_Client extends Zend_Soap_Client
*/ */
protected $url = null; protected $url = null;
/**
* Objet de cache
* @var object
*/
protected $cache; protected $cache;
/** /**
@ -66,7 +70,7 @@ class Scores_Ws_Client extends Zend_Soap_Client
*/ */
public function __construct($name, $version, $user = null) public function __construct($name, $version, $user = null)
{ {
//Configuration de l'application // --- Configuration de l'application
if (Zend_Registry::isRegistered('config')) { if (Zend_Registry::isRegistered('config')) {
$c = Zend_Registry::get('config'); $c = Zend_Registry::get('config');
$this->url = $c->profil->webservice->url; $this->url = $c->profil->webservice->url;
@ -75,7 +79,7 @@ class Scores_Ws_Client extends Zend_Soap_Client
$this->url = $c->profil->webservice->url; $this->url = $c->profil->webservice->url;
} }
//Configuration du service // --- Configuration du service
$config = include __DIR__ . '/Client/' . ucfirst($name) . '.php'; $config = include __DIR__ . '/Client/' . ucfirst($name) . '.php';
if ($config === false) { if ($config === false) {
throw new Exception('Impossible de charger la configuration du service'); throw new Exception('Impossible de charger la configuration du service');
@ -87,7 +91,7 @@ class Scores_Ws_Client extends Zend_Soap_Client
$this->config = $config[$version]; $this->config = $config[$version];
// Create WSDL url // --- Create WSDL url
$wsdl = $this->url . '/' . $name . '/v' . $version; $wsdl = $this->url . '/' . $name . '/v' . $version;
if (APPLICATION_ENV == 'development') { if (APPLICATION_ENV == 'development') {
$wsdl.= '?wsdl-auto'; $wsdl.= '?wsdl-auto';
@ -107,7 +111,7 @@ class Scores_Ws_Client extends Zend_Soap_Client
$this->setHttpPassword($user->getPassword()); $this->setHttpPassword($user->getPassword());
} }
//Add default options // --- Add default options
$options = array( $options = array(
'features' => SOAP_USE_XSI_ARRAY_TYPE + SOAP_SINGLE_ELEMENT_ARRAYS, 'features' => SOAP_USE_XSI_ARRAY_TYPE + SOAP_SINGLE_ELEMENT_ARRAYS,
'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | SOAP_COMPRESSION_DEFLATE, 'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | SOAP_COMPRESSION_DEFLATE,
@ -116,9 +120,9 @@ class Scores_Ws_Client extends Zend_Soap_Client
); );
$this->setOptions($options); $this->setOptions($options);
// Create Cache // --- Create Cache
$frontend = array( $frontend = array(
'lifetime' => 28800, 'lifetime' => 14400,
'automatic_seralization' => true 'automatic_seralization' => true
); );
$backend = array( $backend = array(
@ -139,7 +143,7 @@ class Scores_Ws_Client extends Zend_Soap_Client
$methodConfig = $this->config[$name]; $methodConfig = $this->config[$name];
//Cache // --- Cache
$cacheEnable = false; $cacheEnable = false;
if ( array_key_exists('cache', $methodConfig) ) { if ( array_key_exists('cache', $methodConfig) ) {
if ( $methodConfig['cache'] === true ) { if ( $methodConfig['cache'] === true ) {
@ -153,7 +157,7 @@ class Scores_Ws_Client extends Zend_Soap_Client
} }
} }
//Cache // --- Cache
if ( $cacheEnable === true ) { if ( $cacheEnable === true ) {
$response = $this->cache->load($cacheId); $response = $this->cache->load($cacheId);
if ( $response !== false ) { if ( $response !== false ) {
@ -161,7 +165,7 @@ class Scores_Ws_Client extends Zend_Soap_Client
} }
} }
//Debug // --- Debug
if ( array_key_exists('debug', $methodConfig) ) { if ( array_key_exists('debug', $methodConfig) ) {
Zend_Registry::get('firebug')->info(__CLASS__.'->'.$name); Zend_Registry::get('firebug')->info(__CLASS__.'->'.$name);
Zend_Registry::get('firebug')->info($arguments); Zend_Registry::get('firebug')->info($arguments);
@ -171,12 +175,12 @@ class Scores_Ws_Client extends Zend_Soap_Client
$response = parent::__call($name, $arguments); $response = parent::__call($name, $arguments);
//Debug // --- Debug
if ( array_key_exists('debug', $methodConfig) ) { if ( array_key_exists('debug', $methodConfig) ) {
Zend_Registry::get('firebug')->info($response); Zend_Registry::get('firebug')->info($response);
} }
//Cache // --- Cache
if ( $cacheEnable === true ) { if ( $cacheEnable === true ) {
$this->cache->save($response->{$name.'Result'}, $cacheId); $this->cache->save($response->{$name.'Result'}, $cacheId);
} }
@ -185,21 +189,46 @@ class Scores_Ws_Client extends Zend_Soap_Client
} catch ( SoapFault $fault ) { } catch ( SoapFault $fault ) {
//Debug // --- Debug
if ( array_key_exists('debug', $methodConfig) ) { if ( array_key_exists('debug', $methodConfig) ) {
Zend_Registry::get('firebug')->info($fault->faultcode.' - '.$fault->faultstring); Zend_Registry::get('firebug')->info($fault->faultcode.' - '.$fault->faultstring);
} }
//Gestion des SOAP fault // --- Gestion des SOAP fault
if ( array_key_exists('errorMsg', $methodConfig) ) { if ( array_key_exists('errorMsg', $methodConfig) ) {
if ( in_array($fault->faultcode, $methodConfig['errorMsg']) ) { if ( in_array($fault->faultcode, $methodConfig['errorMsg']) ) {
throw new Exception($fault->faultstring); throw new Exception($fault->faultstring);
} }
} }
//Logging // --- Logging
if ( array_key_exists('log', $methodConfig) ) { if ( array_key_exists('log', $methodConfig) ) {
// --- Envoi email de contexte
if( $methodConfig['log'] == 'mail' ) {
$message = '';
$message.= 'Erreur SOAP - Code : '.$fault->faultcode.' - Message : '.$fault->faultstring;
$message.= ' - Utilisateur : '.$this->getHttpLogin();
$message.= "\n\n";
$message.= "Method : ".$name.", File :".$fault->getFile().", Ligne : ".$fault->getLine();
$message.= "\n\n";
$message.= "Detail :\n".$fault->getTraceAsString();
$message.= "\n\n";
if ( $controller = Zend_Controller_Front::getInstance() ) {
$message.= "Request Parameters :\n ".print_r($controller->getRequest()->getParams(), true);
$message.= "\n\n";
}
$message.= "Referer : ".$_SERVER['HTTP_REFERER']."\n\n";
$message.= "Requete :\n ".$requete."\n";
$message.= "Reponse :\n ".$reponse."\n";
$c = Zend_Registry::get('config');
$mail = new Scores_Mail_Method();
$mail->setSubject('[ERREUR SOAP] - '.$c->profil->server->name.' -'.date('Ymd'));
$mail->setBodyTextC($message);
$mail->setFromKey('supportdev');
$mail->addToKey('supportdev');
$mail->execute();
}
} }
return false; return false;
@ -208,7 +237,7 @@ class Scores_Ws_Client extends Zend_Soap_Client
/** /**
* *
* @param unknown $url * @param string $url
*/ */
protected function setUrl($url) protected function setUrl($url)
{ {

Some files were not shown because too many files have changed in this diff Show More