issue #0001649: Update monitoring works

This commit is contained in:
Arman KYOKCHAN 2013-06-18 13:28:22 +00:00
parent 0255b5120b
commit 95a803a502
5 changed files with 109 additions and 19 deletions

View File

@ -244,7 +244,8 @@ class GiantController extends Zend_Controller_Action
$this->getRequest()->getParam('EndDate'),
$this->getRequest()->getParam('Version'),
$this->getRequest()->getParam('LanguageCode'),
$this->getRequest()->getParam('Pays')
$this->getRequest()->getParam('Pays'),
$this->TestIndication
);
$this->view->result = $result;
}
@ -266,7 +267,34 @@ class GiantController extends Zend_Controller_Action
$result = $giantController->stopmonitoring($this->getRequest()->getParam('CompanyId'),
$this->getRequest()->getParam('EndDate'),
$this->getRequest()->getParam('InternalOrderId'),
$this->getRequest()->getParam('Pays')
$this->getRequest()->getParam('Pays'),
$this->TestIndication
);
$this->view->result = $result;
}
}
public function updatemonitoringAction()
{
$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->Pays = $this->getRequest()->getParam('Pays');
$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->updatemonitoring($this->getRequest()->getParam('CompanyId'),
$this->getRequest()->getParam('InternalOrderId'),
$this->getRequest()->getParam('CategoryName'),
$this->getRequest()->getParam('EventType'),
$this->getRequest()->getParam('StartDate'),
$this->getRequest()->getParam('Version'),
$this->getRequest()->getParam('LanguageCode'),
$this->getRequest()->getParam('Pays'),
$this->TestIndication
);
$this->view->result = $result;
}

View File

@ -134,7 +134,8 @@
<h1>Liste des monitoring<img style="margin-top:4px;float:right" src="/themes/default/images/giant/expanded.gif" ></h1>
<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><br />
<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="Stop Monitoring" href='/giant/stopmonitoring/CompanyId/<?=$this->CompanyId?>/Pays/<?=$this->Pays?>/CompanyName/<?=str_replace(' ', '+', $this->raisonSociale)?>'>Stop monitoring</a><br />
<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>
<?php echo'<pre>';print_r($this->modification); ?>

View File

@ -0,0 +1,46 @@
<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?>" />
<p>
<strong>CompanyId: </strong><?=$this->CompanyId?><br /><br />
<strong>Company Name: </strong><?=$this->CompanyName?><br /><br />
<div style='width: 250px; float: left;'>
<strong>Internal Order Id: </strong><br />
<input type="text" name="InternalOrderId" value="" required /><br /><br />
<strong>New Category Name: </strong><br />
<select name="CategoryName" class="all_select">
<option value=''></option>
<option value='All'>All</option>
<option value='CreditRecommendation'>CreditRecommendation</option>
</select> optional<br /><br />
<strong>New Event Type: </strong><br />
<select name="EventType" class="all_select">
<option value=''></option>
<option value='EventOnly'>EventOnly</option>
<option value='EventWithData'>EventWithData</option>
</select> optional<br /><br />
</div>
<div>
<strong>Preferred Start Date: </strong><br />
<input type="text" class='datepicker' name="StartDate" value=""/> optional<br /><br />
<strong>New Monitoring Version: </strong><br />
<input type="text" name="Version" value="" /> optional<br /><br />
<strong>New Language Code: </strong><br />
<select name="LanguageCode" class="all_select">
<option value=''></option>
<?php foreach (unserialize($this->lang) as $key=>$language):?>
<option class="lang<?=$key;?>" value=<?=$language;?>><?=$language;?></option>
<?php endforeach;?>
</select> optional<br /><br />
</div>
</p>
</form>
<div id="loading" class="hide_monitor" style="display:none;z-index: 1;">
<center><img style="padding-top:30%" src="/themes/default/images/giant/19-1.gif" /></center>
</div>
<?php echo'<pre>'; print_r($this->values);print_r($this->result);?>
</div>
<script type="text/javascript" src="/themes/default/scripts/giant_monitoring.js" />

View File

@ -59,19 +59,27 @@ Class GiantControllerLib
return ($id);
}
public function startmonitoring($CompanyId, $CategorieName, $EventType, $PreferredStartDate, $PreferredEndDate, $Version, $LanguageCode,$Pays)
public function startmonitoring($CompanyId, $CategorieName, $EventType, $PreferredStartDate, $PreferredEndDate, $Version, $LanguageCode,$Pays,$TestIndication)
{
$rapport = new GiantRechercheController($Pays, $TestIndication);
$result = $rapport->GetStartMonitoring($CompanyId, $CategorieName, $EventType, $PreferredStartDate, $PreferredEndDate, $Version, $LanguageCode);
return ($result);
}
public function stopmonitoring($CompanyId, $PreferredEndDate,$InternalOrderId,$Pays)
public function stopmonitoring($CompanyId, $PreferredEndDate,$InternalOrderId,$Pays,$TestIndication)
{
$rapport = new GiantRechercheController($Pays, $TestIndication);
$result = $rapport->GetStopMonitoring($CompanyId, $PreferredEndDate,$InternalOrderId);
return ($result);
}
public function updatemonitoring($CompanyId, $InternalOrderId, $CategorieName, $EventType, $PreferredStartDate, $Version, $LanguageCode, $Pays,$TestIndication)
{
$rapport = new GiantRechercheController($Pays, $TestIndication);
$result = $rapport->GetUpdateMonitoring($CompanyId, $InternalOrderId, $CategorieName, $EventType, $PreferredStartDate, $Version, $LanguageCode);
return ($result);
}
protected function parcourTableau($array)
{
$tableau = array();
@ -146,7 +154,7 @@ Class GiantRechercheController extends GiantFunction
$this->Provider = new stdClass();
$this->Provider->CountryCode = $CountryCode;
$this->Provider->ProviderId = parent::setCountryCode($CountryCode, $this->listAutorized);
$this->Provider->TestIndication = $TestIndication;
$this->Provider->TestIndication = true;
$this->soapG = new WSgiant($this->Provider);
}
@ -258,6 +266,14 @@ Class GiantRechercheController extends GiantFunction
return ($result);
}
public function GetUpdateMonitoring($CompanyId, $InternalOrderId, $CategorieName, $EventType, $PreferredStartDate, $Version, $LanguageCode)
{
$this->CreditData = new CreditData($this->soapG, $CompanyId);
$result = $this->CreditData->getMethode('UpdateMonitoringOptions', array($CompanyId, $InternalOrderId, $CategorieName, $EventType, $PreferredStartDate, $Version, $LanguageCode));
return ($result);
}
public function ListeRapport($CompanyId)
{
$this->CreditData = new CreditData($this->soapG, $CompanyId);

View File

@ -246,15 +246,15 @@ Class CreditData extends GiantFunction
return ($result);
}
protected function UpdateMonitoringOptions($InternalOrderId, $NewCategorieName, $NewEventType, $NewPreferredStartDate, $NewVersion = null, $NewLanguageCode = null)
protected function UpdateMonitoringOptions($CompanyId, $InternalOrderId, $CategorieName, $EventType, $PreferredStartDate, $Version, $LanguageCode)
{
$parametres = new stdClass();
$parametres->InternalOrderId = $InternalOrderId;
$parametres->NewCategorieName = $NewCategorieName;
$parametres->NewEventType = $NewEventType;
$parametres->NewPreferredStartDate = $NewPreferredStartDate;
$parametres->NewVersion = $NewVersion;
$parametres->NewLanguageCode = $NewLanguageCode;
$parametres->ProviderOrderId = $InternalOrderId;
if (!empty($CategorieName)) {$parametres->NewCategoryName = $CategorieName;}
if (!empty($EventType)) {$parametres->NewEventType = $EventType;}
if (!empty($PreferredStartDate)) {$parametres->PreferredStartDate = $PreferredStartDate;}
if (!empty($Version)) {$parametres->NewMonitoringVersion = $Version;}
if (!empty($LanguageCode)) {$parametres->NewLanguageCode = $LanguageCode;}
try {
$result = $this->soapG->UpdateMonitoringOptions($parametres);
} catch (SoapFault $soapFault) {
@ -269,7 +269,6 @@ Class CreditData extends GiantFunction
$parametres->CompanyId = $CompanyId;
$parametres->PreferredEndDate = $PreferredEndDate;
$parametres->InternalOrderId = $InternalOrderId;
print_r($InternalOrderId);
try {
$result = $this->soapG->StopMonitoring($parametres);
} catch (SoapFault $soapFault) {