issue #0001687: improving Start, Stop, Update monitoring
This commit is contained in:
parent
746a539ea8
commit
84a0cd709d
@ -229,6 +229,8 @@ class GiantController extends Zend_Controller_Action
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->view->headLink()->appendStylesheet('/themes/default/styles/giant.css', 'all');
|
||||
$form = new Application_Form_RechercheEntreprise();
|
||||
$this->view->assign('form', $form);
|
||||
$this->view->lang = $this->getRequest()->getParam('lang');
|
||||
$this->view->CompanyId = $this->getRequest()->getParam('CompanyId');
|
||||
$this->view->Pays = $this->getRequest()->getParam('Pays');
|
||||
@ -257,6 +259,7 @@ class GiantController extends Zend_Controller_Action
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->view->headLink()->appendStylesheet('/themes/default/styles/giant.css', 'all');
|
||||
$this->view->CompanyId = $this->getRequest()->getParam('CompanyId');
|
||||
$this->view->InternalOrderId = $this->getRequest()->getParam('InternalOrderId');
|
||||
$this->view->Pays = $this->getRequest()->getParam('Pays');
|
||||
$this->view->InternalOrderId = $this->getRequest()->getParam('InternalOrderId');
|
||||
$this->view->CompanyName = $this->getRequest()->getParam('CompanyName');
|
||||
@ -280,6 +283,7 @@ class GiantController extends Zend_Controller_Action
|
||||
$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->InternalOrderId = $this->getRequest()->getParam('InternalOrderId');
|
||||
$this->view->Pays = $this->getRequest()->getParam('Pays');
|
||||
$this->view->CompanyName = $this->getRequest()->getParam('CompanyName');
|
||||
$this->view->action = $this->getRequest()->getParam('action');
|
||||
|
@ -130,9 +130,9 @@
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
<?php if(!empty($this->modification)): ?>
|
||||
<h1>Liste des monitoring<img style="margin-top:4px;float:right" src="/themes/default/images/giant/expanded.gif" ></h1>
|
||||
<!-- <div class='monitor_but'>
|
||||
<?php //if(!empty($this->modification)): ?>
|
||||
<!--<h1>Liste des monitoring<img style="margin-top:4px;float:right" src="/themes/default/images/giant/expanded.gif" ></h1>
|
||||
<div class='monitor_but'>
|
||||
<a class="dial" title="Start Monitoring" href='/giant/startmonitoring/CompanyId/<?=$this->CompanyId?>/Pays/<?=$this->Pays?>/lang/<?=serialize($this->listeRapport->MonitoringOptions->MonitoringOption[0]->LanguageCodes->LanguageCode)?>/CompanyName/<?=str_replace(' ', '+', $this->raisonSociale)?>'>Start monitoring</a>
|
||||
<a class="dial" title="Stop Monitoring" href='/giant/stopmonitoring/CompanyId/<?=$this->CompanyId?>/Pays/<?=$this->Pays?>/CompanyName/<?=str_replace(' ', '+', $this->raisonSociale)?>'>Stop monitoring</a>
|
||||
<a class="dial" title="Update Monitoring" href='/giant/updatemonitoring/CompanyId/<?=$this->CompanyId?>/Pays/<?=$this->Pays?>/lang/<?=serialize($this->listeRapport->MonitoringOptions->MonitoringOption[0]->LanguageCodes->LanguageCode)?>/CompanyName/<?=str_replace(' ', '+', $this->raisonSociale)?>'>Update monitoring</a>
|
||||
@ -156,7 +156,7 @@
|
||||
</fieldset>
|
||||
</form>
|
||||
</div> -->
|
||||
<?php echo'<pre>';print_r($this->modification); ?>
|
||||
<?php// echo'<pre>';print_r($this->modification); ?>
|
||||
|
||||
<?php endif;?>
|
||||
<?php //endif;?>
|
||||
</div>
|
||||
|
@ -82,13 +82,21 @@ if ( empty($this->source) ){
|
||||
endforeach;
|
||||
?>
|
||||
<?$resultDB=unserialize($this->action('ret', 'giant',null,array('date_st'=>current($merged_type)[0]->ProviderOrderId)));?>
|
||||
<pre><?var_dump($resultDB);?></pre>
|
||||
<? $frontendOptions = array('lifetime' => $this->configVal->cache->lifetime,'automatic_serialization' => true);
|
||||
$backendOptions = array('cache_dir' => '../data/cache/giant/');
|
||||
$cache = Zend_Cache::factory('Output','File',$frontendOptions,$backendOptions);
|
||||
if(($lang = $cache->load('Pays_'.$resultDB['Pays'])) === false) {
|
||||
$lang = 'en';
|
||||
}
|
||||
$language =$lang->MonitoringOptions->MonitoringOption[0]->LanguageCodes->LanguageCode;
|
||||
?>
|
||||
<pre><?//var_dump($resultDB);?></pre>
|
||||
<tr>
|
||||
<td>
|
||||
<p><?=$MonitoringEv[0]->Company->CompanyName['0']->_ ?> (<?=$MonitoringEv[0]->Company->CompanyId ?>)</p>
|
||||
<a class="dialogsurv dial" title="Start Monitoring" href='/giant/startmonitoring/CompanyId/<?=$MonitoringEv[0]->Company->CompanyId?>/Pays/<?=$resultDB->Pays?>/lang/<?=serialize($resultDB->Language)?>/CompanyName/<?=str_replace(' ', '+',$MonitoringEv[0]->Company->CompanyName['0']->_)?>'><img src="/themes/default/images/interfaces/ajouter.png"/></a>
|
||||
<a class="dialogsurv dial" title="Stop Monitoring" href='/giant/stopmonitoring/CompanyId/<?=$MonitoringEv[0]->Company->CompanyId?>/Pays/<?=$resultDB->Pays?>/CompanyName/<?=str_replace(' ', '+', $MonitoringEv[0]->Company->CompanyName['0']->_)?>'><img src="/themes/default/images/interfaces/supprimer.png"/></a>
|
||||
<a class="dialogsurv dial" title="Update Monitoring" href='/giant/updatemonitoring/CompanyId/<?=$MonitoringEv[0]->Company->CompanyId?>/Pays/<?=$resultDB->Pays?>/lang/<?=serialize($resultDB->Language)?>/CompanyName/<?=str_replace(' ', '+', $MonitoringEv[0]->Company->CompanyName['0']->_)?>'><img src="/themes/default/images/interfaces/editer.png"/></a>
|
||||
<a class="dialogsurv dial" title="Start Monitoring" href='/giant/startmonitoring/CompanyId/<?=$MonitoringEv[0]->Company->CompanyId?>/Pays/<?=$resultDB['Pays']?>/lang/<?=serialize($language)?>/CompanyName/<?=str_replace(' ', '+',$MonitoringEv[0]->Company->CompanyName['0']->_)?>'><img src="/themes/default/images/interfaces/ajouter.png"/></a>
|
||||
<a class="dialogsurv dial" title="Stop Monitoring" href='/giant/stopmonitoring/CompanyId/<?=$MonitoringEv[0]->Company->CompanyId?>/Pays/<?=$resultDB['Pays']?>/InternalOrderId/<?=$resultDB['InternalOrderId']?>/CompanyName/<?=str_replace(' ', '+', $MonitoringEv[0]->Company->CompanyName['0']->_)?>'><img src="/themes/default/images/interfaces/supprimer.png"/></a>
|
||||
<a class="dialogsurv dial" title="Update Monitoring" href='/giant/updatemonitoring/CompanyId/<?=$MonitoringEv[0]->Company->CompanyId?>/Pays/<?=$resultDB['Pays']?>/lang/<?=serialize($language)?>/InternalOrderId/<?=$resultDB['InternalOrderId']?>/CompanyName/<?=str_replace(' ', '+', $MonitoringEv[0]->Company->CompanyName['0']->_)?>'><img src="/themes/default/images/interfaces/editer.png"/></a>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
@ -116,7 +124,7 @@ if ( empty($this->source) ){
|
||||
<td style='text-align: left'>
|
||||
<?php
|
||||
foreach ($merged_type as $monitor_type) {
|
||||
$name = explode('.', $monitor_type[0]->Company->Event[0]->EventCode);
|
||||
$name = explode('.', $monitor_type[0]->Company->Event[0]->EventCode);
|
||||
echo "<a class='ev_code' title='".$monitor_type[0]->Company->Event[0]->EventCode."' href='/giant/retevents/Type/".$monitor_type[0]->Company->Event[0]->EventCode."/Id/".$monitor_type[0]->ProviderOrderId."'><p>".$name[1]."</p></a>";
|
||||
} //Fin foreach?>
|
||||
</td>
|
||||
|
@ -1,14 +1,14 @@
|
||||
<div id="center">
|
||||
<form>
|
||||
<input type="hidden" name="CompanyId" value="<?=$this->CompanyId?>" />
|
||||
<input type="hidden" name="Pays" value="<?=$this->Pays?>" />
|
||||
<input type="hidden" name="action" value="<?=$this->action?>" />
|
||||
<input type="hidden" name="CompanyName" value="<?=$this->CompanyName?>" />
|
||||
<p>
|
||||
<strong>CompanyId: </strong><?=$this->CompanyId?><br /><br />
|
||||
<strong>Company Name: </strong><?=$this->CompanyName?><br /><br />
|
||||
|
||||
|
||||
<div style='width: 250px; float: left;'>
|
||||
<strong>CompanyId: </strong><br />
|
||||
<input type="text" name="CompanyId" value="<?=$this->CompanyId?>" <?if (!empty($this->CompanyId)):?>disabled="disabled"<?endif?> required /><br /><br />
|
||||
<strong>Category Name: </strong><br />
|
||||
<select name="CategoryName" class="all_select">
|
||||
<option value='All'>All</option>
|
||||
@ -27,6 +27,21 @@
|
||||
</select><br /><br />
|
||||
</div>
|
||||
<div>
|
||||
<strong>Country: </strong><br />
|
||||
<?if (!empty($this->CompanyId)):?>
|
||||
<?php $country = array ('FR'=>'France','BE'=>'Belgium','ES'=>'Spain','GB'=>'United Kingdom','NL'=>'The Netherlands',)?>
|
||||
<select name="Pays" class="all_select" required>
|
||||
<option value="FR"><?= $country[$this->Pays] ?></option>
|
||||
</select><br /><br />
|
||||
<?else:?>
|
||||
<select name="Pays" class="all_select" required>
|
||||
<option value="FR">France</option>
|
||||
<option value="BE">Belgium</option>
|
||||
<option value="ES">Spain</option>
|
||||
<option value="GB">United Kingdom</option>
|
||||
<option value="NL">The Netherlands</option>
|
||||
</select><br /><br />
|
||||
<?endif?>
|
||||
<strong>Preferred Start Date: </strong><br />
|
||||
<input type="text" class='datepicker' name="StartDate" value=""/> optional<br /><br />
|
||||
<strong>Preferred End Date: </strong><br />
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
<div style='width: 250px; float: left;'>
|
||||
<strong>Internal Order Id: </strong><br />
|
||||
<input type="text" name="InternalOrderId" value="" required /><br /><br />
|
||||
<input type="text" name="InternalOrderId" value="<?=$this->InternalOrderId?>" required /><br /><br />
|
||||
</div>
|
||||
<div>
|
||||
<strong>Preferred End Date: </strong><br />
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
<div style='width: 250px; float: left;'>
|
||||
<strong>Internal Order Id: </strong><br />
|
||||
<input type="text" name="InternalOrderId" value="" required /><br /><br />
|
||||
<input type="text" name="InternalOrderId" value="<?=$this->InternalOrderId?>" required /><br /><br />
|
||||
<strong>New Category Name: </strong><br />
|
||||
<select name="CategoryName" class="all_select">
|
||||
<option value=''></option>
|
||||
|
@ -128,15 +128,33 @@ Class GiantControllerLib
|
||||
|
||||
public function stopmonitoring($CompanyId, $PreferredEndDate,$InternalOrderId,$Pays,$TestIndication)
|
||||
{
|
||||
$Commande = new Commandes();
|
||||
$CommandeP = new stdClass();
|
||||
$CommandeP->PreferredEndDate = $PreferredEndDate;
|
||||
$CommandeP->InternalOrderId = $InternalOrderId;
|
||||
$rapport = new GiantRechercheController($Pays, $TestIndication);
|
||||
$result = $rapport->GetStopMonitoring($CompanyId, $PreferredEndDate,$InternalOrderId);
|
||||
if(!empty($result)){
|
||||
$Commande->updateMonitoring($CommandeP);
|
||||
}
|
||||
return ($result);
|
||||
}
|
||||
|
||||
public function updatemonitoring($CompanyId, $InternalOrderId, $CategorieName, $EventType, $PreferredStartDate, $Version, $LanguageCode, $Pays,$TestIndication)
|
||||
{
|
||||
$Commande = new Commandes();
|
||||
$CommandeP = new stdClass();
|
||||
$CommandeP->CategorieName = $CategorieName;
|
||||
$CommandeP->EventType = $EventType;
|
||||
$CommandeP->Language = $LanguageCode;
|
||||
$CommandeP->PreferredStartDate = $PreferredStartDate;
|
||||
$CommandeP->Version = $Version;
|
||||
$CommandeP->InternalOrderId = $InternalOrderId;
|
||||
$rapport = new GiantRechercheController($Pays, $TestIndication);
|
||||
$result = $rapport->GetUpdateMonitoring($CompanyId, $InternalOrderId, $CategorieName, $EventType, $PreferredStartDate, $Version, $LanguageCode);
|
||||
if(!empty($result)){
|
||||
$Commande->updateMonitoring($CommandeP);
|
||||
}
|
||||
return ($result);
|
||||
}
|
||||
public function retrivemonitoring($CompanyId, $StartFrom,$InternalOrderId,$Pays,$TestIndication,$EventType,$CompanyName)
|
||||
|
@ -45,6 +45,27 @@ Class Commandes
|
||||
);
|
||||
$commandes->insert($data);
|
||||
}
|
||||
public function updateMonitoring($parametres)
|
||||
{
|
||||
$commandes = new Application_Model_MonitoringGiants();
|
||||
$data = array(
|
||||
'Category' => $parametres->CategorieName,
|
||||
'EventType' => $parametres->EventType,
|
||||
'Language' => $parametres->Language,
|
||||
'PreferredStartDate' => $parametres->PreferredStartDate,
|
||||
'PreferredEndDate' => $parametres->PreferredEndDate,
|
||||
'Version' => $parametres->Version,
|
||||
'ActualStartDate' => $parametres->PreferredStartDate,
|
||||
'ActualEndDate' => $parametres->PreferredEndDate,
|
||||
);
|
||||
foreach ($data as $key=>$val){
|
||||
if (empty($val)) {
|
||||
unset($data[$key]);
|
||||
}
|
||||
}
|
||||
$where['InternalOrderId = ?'] = $parametres->InternalOrderId;
|
||||
$commandes->update($data,$where);
|
||||
}
|
||||
public function setRetrive($parametres)
|
||||
{
|
||||
$commandes = new Application_Model_RetriveGiants();
|
||||
|
@ -3,4 +3,4 @@ test = "0"
|
||||
snd = "7"
|
||||
other = "10"
|
||||
[cache]
|
||||
lifetime = "30"
|
||||
lifetime = "86403"
|
||||
|
@ -79,7 +79,7 @@ class Menu
|
||||
'controller' => 'recherche',
|
||||
'action' => 'worldcheck',
|
||||
'forceVisible' => false,
|
||||
'permission' => 'WORLDCHECK',
|
||||
'permission' => 'SEARCHACT',
|
||||
),
|
||||
array(
|
||||
'label' => "Dernière recherche",
|
||||
|
Loading…
Reference in New Issue
Block a user