issue #0001659: Start Monitoring log

This commit is contained in:
Arman KYOKCHAN 2013-07-16 12:36:10 +00:00
parent b4166686bf
commit f245a2dda1
5 changed files with 63 additions and 3 deletions

View File

@ -234,7 +234,6 @@ class GiantController extends Zend_Controller_Action
$this->view->CompanyName = $this->getRequest()->getParam('CompanyName');
$this->view->action = $this->getRequest()->getParam('action');
$this->view->values = $this->getRequest()->getParams();
if ($this->getRequest()->isPost()) {
$giantController = new GiantControllerLib($this->getRequest()->getParam('CompanyId'));
$result = $giantController->startmonitoring($this->getRequest()->getParam('CompanyId'),
@ -245,7 +244,8 @@ class GiantController extends Zend_Controller_Action
$this->getRequest()->getParam('Version'),
$this->getRequest()->getParam('LanguageCode'),
$this->getRequest()->getParam('Pays'),
$this->TestIndication
$this->TestIndication,
$this->getRequest()->getParam('CompanyName')
);
$this->view->result = $result;
}

View File

@ -0,0 +1,13 @@
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
class Application_Model_MonitoringGiants extends Zend_Db_Table_Abstract
{
protected $_name = 'monitoring_giants';
}
?>

View File

@ -3,6 +3,7 @@
<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 />

View File

@ -59,8 +59,34 @@ Class GiantControllerLib
return ($id);
}
public function startmonitoring($CompanyId, $CategorieName, $EventType, $PreferredStartDate, $PreferredEndDate, $Version, $LanguageCode,$Pays,$TestIndication)
public function startmonitoring($CompanyId, $CategorieName, $EventType, $PreferredStartDate, $PreferredEndDate, $Version, $LanguageCode,$Pays,$TestIndication,$CompanyName)
{
$Utilisateur = new Scores_Utilisateur();
$Commande = new Commandes();
$CommandeP = new stdClass();
$CommandeP->login = $Utilisateur->getLogin();
$CommandeP->CompanyId = $CompanyId;
$CommandeP->CategorieName = $CategorieName;
$CommandeP->EventType = $EventType;
$CommandeP->Language = $LanguageCode;
$CommandeP->PreferredStartDate = $PreferredStartDate;
$CommandeP->PreferredEndDate = $PreferredEndDate;
$CommandeP->Version = $Version;
$CommandeP->Pays = $Pays;
$CommandeP->TestIndication = $TestIndication;
$CommandeP->CompanyName = $CompanyName;
if (!empty($PreferredStartDate)) {
$CommandeP->ActualStartDate = $PreferredStartDate;
} else {
$CommandeP->ActualStartDate = date("Y-m-d");
}
if (!empty($PreferredEndDate)) {
$CommandeP->ActualEndDate = $PreferredEndDate;
} else {
$CommandeP->ActualEndDate = date('Y-m-d', strtotime('+6 month'));
}
$Commande->setMonitoring($CommandeP);
$rapport = new GiantRechercheController($Pays, $TestIndication);
$result = $rapport->GetStartMonitoring($CompanyId, $CategorieName, $EventType, $PreferredStartDate, $PreferredEndDate, $Version, $LanguageCode);
return ($result);

View File

@ -24,6 +24,26 @@ Class Commandes
);
$commandes->insert($data);
}
public function setMonitoring($parametres)
{
$commandes = new Application_Model_MonitoringGiants();
$data = array( 'login' => $parametres->login,
'CompanyId' => $parametres->CompanyId,
'CompanyName' => $parametres->CompanyName,
'Category' => $parametres->CategorieName,
'EventType' => $parametres->EventType,
'Pays' => $parametres->Pays,
'Language' => $parametres->Language,
'PreferredStartDate' => $parametres->PreferredStartDate,
'PreferredEndDate' => $parametres->PreferredEndDate,
'Version' => $parametres->Version,
'TestIndication' => $parametres->TestIndication,
'ActualStartDate' => $parametres->ActualStartDate,
'ActualEndDate' => $parametres->ActualEndDate,
);
$commandes->insert($data);
}
public function getCommandesByLogin($login)
{
$commandes = new Application_Model_CommandesGiants();