issue #0001649: Start monitoring for monitoring client

This commit is contained in:
Arman KYOKCHAN 2013-06-14 09:06:17 +00:00
parent 45aaf0818f
commit ceb36fcda5
7 changed files with 182 additions and 64 deletions

View File

@ -9,29 +9,29 @@ require_once 'common/dates.php';
class GiantController extends Zend_Controller_Action
{
protected $TestIndication = true;
protected $TestCompanies = array(
'BE' => array(
'0439546194', '0436576412', '0430459076', '0430000604', '0404869783', '0404869783',
'0406952018'
),
'ES' => array(
'A00000000', 'A80192727'
),
'GB' => array(
'00000086', '00082932', '98888888', '214436', '1777777', '991581', '1800000'
),
'NL' => array(
'533885', '1383988', '1383989', '891962239', '891974008', '892130032', '896614719',
'896614735', '896614735', '896615243'
),
'FR' => array(
'55214450300018', '49496793800031', '47997411500012', '48765114300017',
'43235433000040', '39435613300022', '39504742600014', '76980020200020',
'35379698000020', '56202109700018', '70204756400068', '70204756400068'
),
'BE' => array(
'0439546194', '0436576412', '0430459076', '0430000604', '0404869783', '0404869783',
'0406952018'
),
'ES' => array(
'A00000000', 'A80192727'
),
'GB' => array(
'00000086', '00082932', '98888888', '214436', '1777777', '991581', '1800000'
),
'NL' => array(
'533885', '1383988', '1383989', '891962239', '891974008', '892130032', '896614719',
'896614735', '896614735', '896615243'
),
'FR' => array(
'55214450300018', '49496793800031', '47997411500012', '48765114300017',
'43235433000040', '39435613300022', '39504742600014', '76980020200020',
'35379698000020', '56202109700018', '70204756400068', '70204756400068'
),
);
public function init()
{
@ -63,32 +63,32 @@ class GiantController extends Zend_Controller_Action
{
$rechercheParams = new RechercheHistorique();
$giantFunction = new GiantFunction();
if (count($rechercheParams->liste()) > 0)
{
$recherche = $rechercheParams->item(0);
$type = $recherche['type'];
$params = $recherche['params'];
}
$Commande = new Commandes();
$user = new Scores_Utilisateur();
$listeCommandes = $Commande->getCommandesByLogin($user->getLogin());
$total = 0;
$liste = $giantFunction->divCommande($listeCommandes, $total);
$ListeRapport = new GiantRechercheController($params['pays'], $this->TestIndication);
$result = $ListeRapport->ListeRapport($this->getRequest()->getParam('CompanyId'));
$this->view->total = $total;
$this->view->listeCommandes = $liste;
$this->view->modification = (isset($result->MonitoringOptions))?($ListeRapport->getModification($result->MonitoringOptions->MonitoringOption[0])):null;
$this->view->description = $ListeRapport->getDescription();
$this->view->raisonSociale = $this->getRequest()->getParam('raisonSociale');
$this->view->listeRapport = $result;
$this->view->telephone = $this->getRequest()->getParam('telephone');
$this->view->CompanyId = $this->getRequest()->getParam('CompanyId');
$this->view->raisonSociale = $this->getRequest()->getParam('raisonSociale');
$this->view->CompanyRegisterNumber = $this->getRequest()->getParam('CompanyRegisterNumber');
$this->view->Pays = $this->getRequest()->getParam('Pays');
$this->view->Adresse = explode(':', $this->getRequest()->getParam('Adresse'));
if($this->view->debug)
if (count($rechercheParams->liste()) > 0)
{
$recherche = $rechercheParams->item(0);
$type = $recherche['type'];
$params = $recherche['params'];
}
$Commande = new Commandes();
$user = new Scores_Utilisateur();
$listeCommandes = $Commande->getCommandesByLogin($user->getLogin());
$total = 0;
$liste = $giantFunction->divCommande($listeCommandes, $total);
$ListeRapport = new GiantRechercheController($params['pays'], $this->TestIndication);
$result = $ListeRapport->ListeRapport($this->getRequest()->getParam('CompanyId'));
$this->view->total = $total;
$this->view->listeCommandes = $liste;
$this->view->modification = (isset($result->MonitoringOptions))?($ListeRapport->getModification($result->MonitoringOptions->MonitoringOption[0])):null;
$this->view->description = $ListeRapport->getDescription();
$this->view->raisonSociale = $this->getRequest()->getParam('raisonSociale');
$this->view->listeRapport = $result;
$this->view->telephone = $this->getRequest()->getParam('telephone');
$this->view->CompanyId = $this->getRequest()->getParam('CompanyId');
$this->view->raisonSociale = $this->getRequest()->getParam('raisonSociale');
$this->view->CompanyRegisterNumber = $this->getRequest()->getParam('CompanyRegisterNumber');
$this->view->Pays = $this->getRequest()->getParam('Pays');
$this->view->Adresse = explode(':', $this->getRequest()->getParam('Adresse'));
if($this->view->debug)
$this->view->soap = $ListeRapport->soapG;
}
@ -96,10 +96,10 @@ class GiantController extends Zend_Controller_Action
{
$giantController = new GiantControllerLib($this->getRequest()->getParam('CompanyId'));
$id = $giantController->commande($this->getRequest()->getParam('CompanyId'),
$this->getRequest()->getParam('Type'),
$this->getRequest()->getParam('Pays'),
$this->getRequest()->getParam('Language'),
$this->TestIndication
$this->getRequest()->getParam('Type'),
$this->getRequest()->getParam('Pays'),
$this->getRequest()->getParam('Language'),
$this->TestIndication
);
$creditrecommendationAction = array('getAvisDeCredit' => 'CreditRecommendation');
$creditrecommendation = unserialize(base64_decode($id));
@ -124,13 +124,13 @@ class GiantController extends Zend_Controller_Action
{
$giantController = new GiantControllerLib($this->getRequest()->getParam('CompanyId'));
$id = $giantController->commande($this->getRequest()->getParam('CompanyId'),
$this->getRequest()->getParam('Type'),
$this->getRequest()->getParam('Pays'),
$this->getRequest()->getParam('Language'),
$this->TestIndication
$this->getRequest()->getParam('Type'),
$this->getRequest()->getParam('Pays'),
$this->getRequest()->getParam('Language'),
$this->TestIndication
);
$compactAction = array('getAvisDeCredit' => 'CreditRecommendation', 'getPositionFinanciere' => 'FinancialSummary',
'getStructureEntreprise' => 'Associated', 'getDirigeant' => 'Position'
'getStructureEntreprise' => 'Associated', 'getDirigeant' => 'Position'
);
$compact = unserialize(base64_decode($id));
$identiteController = new GiantIdentiteController($compact);
@ -155,14 +155,14 @@ class GiantController extends Zend_Controller_Action
{
$giantController = new GiantControllerLib($this->getRequest()->getParam('CompanyId').'-'.$this->getRequest()->getParam('Type'));
$id = $giantController->commande($this->getRequest()->getParam('CompanyId'),
$this->getRequest()->getParam('Type'),
$this->getRequest()->getParam('Pays'),
$this->getRequest()->getParam('Language'),
$this->TestIndication
$this->getRequest()->getParam('Type'),
$this->getRequest()->getParam('Pays'),
$this->getRequest()->getParam('Language'),
$this->TestIndication
);
$fullAction = array('getAvisDeCredit' => 'CreditRecommendation', 'getComptesAnnuels' => 'AnnualAccounts', 'getPositionFinanciere' => 'FinancialSummary',
'getComportementPaiement' => 'PaymentBehaviour', 'getStructureEntreprise' => 'Associated', 'getDirigeant' => 'Position',
'getComparaisonValeurs'=> 'PeerGroup', 'getHistoriques' => 'Event'
'getComportementPaiement' => 'PaymentBehaviour', 'getStructureEntreprise' => 'Associated', 'getDirigeant' => 'Position',
'getComparaisonValeurs'=> 'PeerGroup', 'getHistoriques' => 'Event'
);
$full = unserialize(base64_decode($id));
$full->DataSet->Company->CompanyId= $this->getRequest()->getParam('CompanyId');
@ -187,7 +187,7 @@ class GiantController extends Zend_Controller_Action
{
$form = new Zend_Form();
$form->setMethod('post')
->setAction('investigation');
->setAction('investigation');
$reference = $form->createElement('text', 'reference', array('label' => 'Votre Reference'));
$reference->setRequired(true);
@ -224,4 +224,12 @@ class GiantController extends Zend_Controller_Action
} else
$this->view->form = $this->getForm();
}
public function startmonitoringAction()
{
$this->_helper->layout()->disableLayout();
$this->view->headLink()->appendStylesheet('/themes/default/styles/giant.css', 'all');
$this->view->lang = $this->getRequest()->getParam('lang');
$this->view->CompanyId = $this->getRequest()->getParam('CompanyId');
$this->view->values = $this->getRequest()->getParam('values');
}
}

View File

@ -129,4 +129,12 @@
</table>
</div>
<?php endif;?>
<h1>Liste des monitoring<img style="margin-top:4px;float:right" src="/themes/default/images/giant/expanded.gif" ></h1>
<a class="dial" title="monitoring" href='/giant/startmonitoring/CompanyId/<?=$this->CompanyId?>/lang/<?=serialize($this->listeRapport->MonitoringOptions->MonitoringOption[0]->LanguageCodes->LanguageCode)?>'>Start monitoring</a>
<?php echo'<pre>';print_r($this->modification); ?>
</div>

View File

@ -0,0 +1,32 @@
<div id="center">
<form>
<p>
<strong>CompanyId: </strong><?=$this->CompanyId?><br /><br />
<strong>LanguageCode: </strong><br />
<select name="LanguageCode" class="all_select">
<?php foreach (unserialize($this->lang) as $key=>$language):?>
<option class="lang<?=$key;?>" value=<?=$language;?>><?=$language;?></option>
<?php endforeach;?>
</select><br /><br />
<strong>CategoryName: </strong><br />
<select name="CategoryName" class="all_select">
<option value='All'>All</option>
<option value='CreditRecommendation'>CreditRecommendation</option>
</select><br /><br />
<strong>EventType: </strong><br />
<select name="EventType" class="all_select">
<option value='EventOnly'>EventOnly</option>
<option value='EventWithData'>EventWithData</option>
</select><br /><br />
<strong>PreferredStartDate: </strong><br />
<input type="text" id='datepicker' name="StartDate" value=""/> optional<br /><br />
<strong>PreferredEndDate: </strong><br />
<input type="text" id='datepicker1' name="EndDate" value="" /> optional<br /><br />
<strong>MonitoringVersion: </strong><br />
<input type="text" name="CategoryName" value="1.0" required /><br /><br />
</p>
</form>
</div>
<script type="text/javascript" src="/themes/default/scripts/giant_monitoring.js" />

View File

@ -70,7 +70,7 @@ Class GiantFunction
$array[$valeur[0]][] = $valeur[1];
}
}
$html = '<fieldset><legend><center><b>Modifications au '.date('d/m/Y').'</b></center></legend><br />';
//$html = '<fieldset><legend><center><b>Modifications au '.date('d/m/Y').'</b></center></legend><br />';
$html .= '<ol style="list-style:none">';
foreach($array as $name => $ar) {
$html .= '<li><b>'.$name.' :</b></li>';

View File

@ -1,5 +1,25 @@
$(document).ready( function()
{
$('a.dial').on('click', function(e){
e.preventDefault();
var title = $(this).attr('title');
var href = $(this).attr('href');
var dlgOpts = {
bgiframe: true,
title: title,
width: 710,
height: 530,
modal: true,
open: function(event, ui) {
$(this).html('Chargement...');
$(this).load(href);
},
buttons: {'Fermer': function() { $(this).dialog('close'); }},
close: function() { $('#dial').remove(); }};
$('<div id="dial"></div>').dialog(dlgOpts);
return false;
});
$('.idpr,.id_cr').on('click', function(){
//e.preventDefault();
var n = $(this).attr('id');
@ -40,4 +60,6 @@ $(document).ready( function()
$(".lang").attr("src","/themes/default/images/drapeaux/"+this.value+".png");
$('.'+$.alink+'').fadeIn(500);
});
});

View File

@ -0,0 +1,39 @@
function validate() {
$("[required]").each(function() {
if (!$(this).val()) {
$(this).addClass('brsr');
} else {
$(this).removeClass('brsr');
}
});
};
$('[required]').blur(function() {
validate();
});
$(document).ready(function() {
validate();
$(function() {
$("#datepicker").datepicker($.datepicker.regional[ "fr" ]);
});
$(function() {
$("#datepicker1").datepicker($.datepicker.regional[ "fr" ]);
});
$('#dial').dialog({ buttons: [
{ text: "Valider", click: function() {
var values = $(this).find('form').serialize();
$.post('/giant/startmonitoring', values, function(data) {
$('#dial').html(data);
alert(data);
});
}},
{ text: "Fermer", click: function() {
if($(".message p").text()=='Cut-off mis à jour.') { location.reload(); }
$(this).dialog('close');
}
}
] });
});

View File

@ -270,4 +270,13 @@
float:right;
margin-left:3px;
}
.brsr {
border-style:solid;
border-width:1px;
border-color:red;
}
.all_select
{
width: 140px;
}