Merge from trunk

This commit is contained in:
Michael RICOIS 2013-08-30 15:12:56 +00:00
commit 6fd02854f8
7 changed files with 285 additions and 6 deletions

View File

@ -330,4 +330,35 @@ class GiantController extends Zend_Controller_Action
endforeach;
$this->view->val = $merged;
}
public function retriveAction()
{
$this->view->headScript()->appendFile('/themes/default/scripts/giant_monitoring.js', 'text/javascript');
$giantController = new GiantControllerLib();
$result = $giantController->retrive(
1,
$this->TestIndication,
'RetrieveMonitoringEventsForCustomer'
);
$this->view->result = $result;
$merged =Array();
foreach ($result->MonitoringEvents->MonitoringEvent as $MonitoringEvent):
if ($merged[$MonitoringEvent->ProviderOrderId]){
array_push($merged[$MonitoringEvent->ProviderOrderId],$MonitoringEvent) ;
} else {
$merged[$MonitoringEvent->ProviderOrderId][]=$MonitoringEvent;
}
endforeach;
$this->view->val = $merged;
$merged_siren =Array();
foreach ($result->MonitoringEvents->MonitoringEvent as $MonitoringEvent):
if ($merged_siren[$MonitoringEvent->Company->CompanyId]){
array_push($merged_siren[$MonitoringEvent->Company->CompanyId],$MonitoringEvent) ;
} else {
$merged_siren[$MonitoringEvent->Company->CompanyId][]=$MonitoringEvent;
}
endforeach;
$this->view->val_siren = $merged_siren;
}
}

View File

@ -0,0 +1,226 @@
<div id="center">
<h1 class="titre">SURVEILLANCE</h1>
<div class="paragraph">
<?php
if ( empty($this->source) ){
?>
<table id="info">
<tr>
<td width="200" class="StyleInfoLib">Nombre d'entités affichées</td>
<td><?=count($this->result->MonitoringEvents->MonitoringEvent)?></td>
</tr>
<tr>
<td width="200" class="StyleInfoLib">Nombre de surveillances</td>
<td><?=count($this->val)?></td>
</tr>
</table>
<?php
} else {
?>
<table id="info">
<tr>
<td width="200" class="StyleInfoLib">Nombre de surveillances <?=$this->source?></td>
<td><?=$this->nbSurveillances?></td>
</tr>
</table>
<?php
}
?>
</div>
<h2>Options de recherche</h2>
<div class="paragraph">
<label>Afficher uniquement les suveillances de type</label>
<select name="type">
<option value="">toutes</option>
<?=$this->selectTri?>
</select>
</div>
<div class="paragraph">
Tri
<select name="triMode">
<option value="asc"<?=($this->triMode=='asc')? ' selected' : ''?>>croissant</option>
<option value="desc"<?=($this->triMode=='desc')? ' selected' : ''?>>décroissant</option>
</select>
par
<select name="tri">
<option value="siren"<?=($this->tri=='siren')? ' selected' : ''?>>Siren</option>
<option value="ref"<?=($this->tri=='ref')? ' selected' : ''?>>Référence</option>
<option value="rs"<?=($this->tri=='rs')? ' selected' : ''?>>Raison Sociale</option>
<option value="dateAjout"<?=($this->tri=='dateAjout')? ' selected' : ''?>>Date d'ajout</option>
<option value="dateDerEnvoi"<?=($this->tri=='dateDerEnvoi')? ' selected' : ''?>>Date d'envoi</option>
</select>
</div>
<div class="paragraph" id="formSurveillance">
<form name="recherche" action="<?=$this->url(array('controller'=>'surveillance', 'action'=>'liste'))?>">
<input type="text" name="q" class="search" value="<?=($this->q != null)? $this->q : "Siren, Référence, Raison Sociale"?>" />
<input type="submit" value="Rechercher" class="submit"/>
</form>
</div>
<h2>Liste des surveillances</h2>
<div class="paragraph">
<?php if ($this->curPage>=1) { ?>
<a class="pagination" href="<?=$this->url(array('action' => 'liste', 'page' => $this->curPage-1))?>"
title="Page précédente..."> &lt;&lt; </a>
<?php } ?>
<?php if ($this->curPage!=$this->totPage) { ?>
<span>Page <select name="page">
<?php for ($i=1;$i<$this->totPage+1;$i++) {?>
<option value="<?=$this->url(array('action' => 'liste', 'page' => $i-1))?>"
<?=($i==$this->curPage+1)? ' selected' : ''?>><?=$i?></option>
<?php }?></select> / <?=$this->totPage?>
</span>
<?php } ?>
<?php if ($this->curPage+1<$this->totPage) { ?>
<a class="pagination" href="<?=$this->url(array('action' => 'liste', 'page' => $this->curPage+1))?>"
title="Page suivante..."> &gt;&gt; </a>
<?php } ?>
</div>
<div class="paragraph">
<table class="tablesorter" id="surveillance" width="570">
<thead>
<tr>
<th width="75">Siren</th>
<th width="150">Raison Sociale</th>
<th width="90">Référence</th>
<th width="150">Surveillance</th>
<th width="75">Ajout le</th>
<th width="75">Envoyé le</th>
</tr>
</thead>
<tbody>
<?php foreach ($this->val_siren as $monitor) {?>
<pre><? print_r($monitor);?></pre>
<tr>
<td class="aleft">
<p><?=$monitor[0]->Company->CompanyId ?></p>
</td>
<td>
<p><?=$monitor[0]->Company->CompanyName['0']->_ ?></p>
</td>
<td>
<?php
foreach ($monitor as $monitor_order) {
?><p><?=$monitor_order->ProviderOrderId?></p><?
}
?>
</td>
<td style='text-align: left'>
<?php
foreach ($monitor as $monitor_type) {
echo "<p>".$monitor_type->Company->Event[0]->EventCode."</p>";
} //Fin foreach?>
</td>
<td>
<?php
foreach ($monitor as $monitor_type) {
echo "<p>".$monitor_type->Company->Event[0]->Date->_."</p>";
}
?>
</td>
<td>
<?php
foreach ($monitor as $monitor_type) {
echo "<p>".$monitor_type->Company->Event[0]->Date->_."</p>";
}
?>
</td>
<?php } ?>
</tbody>
</table>
</div>
<div class="paragraph">
<?php if ($this->curPage>=1) { ?>
<a class="pagination" href="<?=$this->url(array('action' => 'liste', 'page' => $this->curPage-1))?>"
title="Page précédente..."> &lt;&lt; </a>
<?php } ?>
<?php if ($this->curPage!=$this->totPage) { ?>
<span>Page <select name="page">
<?php for ($i=1;$i<$this->totPage+1;$i++) {?>
<option value="<?=$this->url(array('action' => 'liste', 'page' => $i-1))?>"
<?=($i==$this->curPage+1)? ' selected' : ''?>><?=$i?></option>
<?php }?></select> / <?=$this->totPage?>
</span>
<?php } ?>
<?php if ($this->curPage+1<$this->totPage) { ?>
<a class="pagination" href="<?=$this->url(array('action' => 'liste', 'page' => $this->curPage+1))?>"
title="Page suivante..."> &gt;&gt; </a>
<?php } ?>
</div>
</div>
<script type="text/javascript">
function submitTri() {
var tri = $('select[name=tri] option:selected').val();
var triMode = $('select[name=triMode] option:selected').val();
var source = $('select[name=type] option:selected').val();
window.location.href = '<?=$this->url(array(
'controller'=>'surveillance' ,
'action'=>'liste',
'q' => $this->q,
), null, true)?>/source/'+source+'/tri/'+tri+'/triMode/'+triMode;
}
$(document).ready(function() {
$('select[name=page]').change(function(){
window.location.href = $(this).val();
});
$('select[name=type]').change(function() {
submitTri();
});
$('select[name=tri]').change(function() {
submitTri();
});
$('input[name=q]').focusin(function(){
var txt = 'Siren, Référence, Raison Sociale';
var val = $(this).val();
if ( val == '' || val == txt ) { $(this).val(''); }
}).focusout(function(){
var txt = 'Siren, Référence, Raison Sociale';
var val = $(this).val();
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>

View File

@ -100,6 +100,7 @@ Class GiantControllerLib
$result = $rapport->GetStartMonitoring($CompanyId, $CategorieName, $EventType, $PreferredStartDate, $PreferredEndDate, $Version, $LanguageCode);
$CommandeP->InternalOrderId = $result->Order->InternalOrderId;
$CommandeP->ProviderOrderId = $result->Order->ProviderOrderId;
$Commande->setMonitoring($CommandeP);
return ($result);
}
@ -135,6 +136,13 @@ Class GiantControllerLib
$result = $rapport->GetRetriveMonitoring($CompanyId, $StartFrom,$InternalOrderId,$EventType);
return ($result);
}
public function retrive($StartFrom,$TestIndication,$EventType)
{
$Utilisateur = new Scores_Utilisateur();
$rapport = new GiantRechercheController('FR', $TestIndication);
$result = $rapport->GetRetrive($StartFrom,$TestIndication,$EventType);
return ($result);
}
protected function parcourTableau($array)
{
$tableau = array();
@ -334,6 +342,12 @@ Class GiantRechercheController extends GiantFunction
$result = $this->CreditData->getMethode('RetrieveMonitoringEventsFor'.$EventType, array($CompanyId, $StartFrom, $InternalOrderId));
return ($result);
}
public function GetRetrive($StartFrom,$TestIndication, $EventType)
{
$this->CreditData = new CreditData($this->soapG);
$result = $this->CreditData->getMethode($EventType, array($CompanyId,$StartFrom));
return ($result);
}
public function ListeRapport($CompanyId)
{
$this->CreditData = new CreditData($this->soapG, $CompanyId);

View File

@ -41,6 +41,7 @@ Class Commandes
'ActualStartDate' => $parametres->ActualStartDate,
'ActualEndDate' => $parametres->ActualEndDate,
'InternalOrderId' => $parametres->InternalOrderId,
'ProviderOrderId' => $parametres->ProviderOrderId,
);
$commandes->insert($data);
}

View File

@ -33,7 +33,7 @@ class WSgiant extends Zend_Soap_Client
$giantHeader = new stdClass();
$giantHeader->ConsumerId = $this->wsService->header->ConsumerId;
$giantHeader->CustomerId = $utilisateur->getLogin();
$giantHeader->CustomerId = '001';
$giantHeader->Provider = new stdClass();
$giantHeader->Provider->CountryCode = $parametres->CountryCode;

View File

@ -18,13 +18,18 @@ class Scores_Utilisateur
/**
* Récupére les valeurs du profil depuis le webservice
* @param stdClass $InfosLogin
* @params string $password
* @return stdClass
*/
public function updateProfil($InfosLogin)
public function updateProfil($InfosLogin, $password = null)
{
$identity = new stdClass;
$identity->username = $login;
$identity->password = $password;
$identity->username = $InfosLogin->result->login;
if ($password === null) {
$identity->password = $this->identity->password;
} else {
$identity->password = $password;
}
$identity->email = $InfosLogin->result->email;
$identity->profil = $InfosLogin->result->profil;
$identity->pref = $InfosLogin->result->pref;
@ -56,6 +61,8 @@ class Scores_Utilisateur
$identity->langtmp = $lang;
$identity->browser = $this->getBrowserInfo();
$this->identity = $identity;
return $identity;
}

View File

@ -277,11 +277,11 @@ foreach ($tabCommandes as $ref => $commande){
if (preg_match('/^([0-9]{4}_).*?$/', $refC, $matches)){
$path = $infogreffe->bilanPath($refC);
$nomCible = $infogreffe->bilanFilename($sirenC, $refC);
$type = 'acte';
$type = 'bilan';
} else {
$path = $infogreffe->actePath($refC);
$nomCible = $infogreffe->acteFilename($sirenC, $refC);
$type = 'bilan';
$type = 'acte';
}
if (file_exists(ACTES_IGNUM_LOCAL_DIR.$fichier)