issue #0001709: test environment

This commit is contained in:
Arman KYOKCHAN 2013-09-17 13:02:45 +00:00
parent 786a5b3305
commit a923e17eb0
8 changed files with 87 additions and 11 deletions

View File

@ -8,7 +8,7 @@ require_once 'common/dates.php';
class GiantController extends Zend_Controller_Action
{
protected $TestIndication = true;
protected $TestIndication = false;
protected $TestCompanies = array(
'BE' => array(
@ -32,6 +32,14 @@ class GiantController extends Zend_Controller_Action
),
);
protected $Companies = array(
'FR' =>'France',
'BE' => 'Belgium',
'ES' => 'Spain',
'GB' => 'United Kingdom',
'NL' => 'The Netherlands',
);
public function init()
{
@ -46,6 +54,8 @@ class GiantController extends Zend_Controller_Action
$params = $this->getRequest()->getParams();
$search = new GiantRechercheController($params['pays'], $this->TestIndication);
$result = $search->Liste($params, $this->getRequest()->getParam('page'));
$this->view->TestIndication= $this->TestIndication;
$this->view->TestCompanies = $this->TestCompanies[$params['pays']];
$this->view->label = $search->getObjet()->getLabelDesc();
$this->view->labelResults = $search->getObjet()->getLabelResults();
$this->view->pays = $params['pays'];
@ -63,6 +73,11 @@ class GiantController extends Zend_Controller_Action
{
$rechercheParams = new RechercheHistorique();
$giantFunction = new GiantFunction();
$test = $this->getRequest()->getParam('test');
if($test == true){
$this->TestIndication = true;
}
var_dump($this->TestIndication);
if (count($rechercheParams->liste()) > 0)
{
$recherche = $rechercheParams->item(0);
@ -77,6 +92,7 @@ class GiantController extends Zend_Controller_Action
$ListeRapport = new GiantRechercheController($params['pays'], $this->TestIndication);
$giantController = new GiantControllerLib($this->getRequest()->getParam('CompanyId'));
$result = $giantController->commandePays($this->getRequest()->getParam('CompanyId'),$params['pays'], $this->TestIndication);
$this->view->TestIndication = $this->TestIndication;
$this->view->total = $total;
$this->view->listeCommandes = $liste;
$this->view->modification = (isset($result->MonitoringOptions))?($ListeRapport->getModification($result->MonitoringOptions->MonitoringOption[0])):null;
@ -95,6 +111,11 @@ class GiantController extends Zend_Controller_Action
public function creditrecommendationAction()
{
$test = $this->getRequest()->getParam('test');
if($test == true){
$this->TestIndication = true;
}
var_dump($this->TestIndication);
$giantController = new GiantControllerLib($this->getRequest()->getParam('CompanyId'));
$id = $giantController->commande($this->getRequest()->getParam('CompanyId'),
$this->getRequest()->getParam('Type'),
@ -123,6 +144,11 @@ class GiantController extends Zend_Controller_Action
public function compactAction()
{
$test = $this->getRequest()->getParam('test');
if($test == true){
$this->TestIndication = true;
}
var_dump($this->TestIndication);
$giantController = new GiantControllerLib($this->getRequest()->getParam('CompanyId'));
$id = $giantController->commande($this->getRequest()->getParam('CompanyId'),
$this->getRequest()->getParam('Type'),
@ -154,6 +180,11 @@ class GiantController extends Zend_Controller_Action
public function fullAction()
{
$test = $this->getRequest()->getParam('test');
if($test == true){
$this->TestIndication = true;
}
var_dump($this->TestIndication);
$giantController = new GiantControllerLib($this->getRequest()->getParam('CompanyId').'-'.$this->getRequest()->getParam('Type'));
$id = $giantController->commande($this->getRequest()->getParam('CompanyId'),
$this->getRequest()->getParam('Type'),
@ -236,6 +267,13 @@ 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();
$result = new GiantControllerLib();
foreach($this->Companies as $key=>$pays){
if(($value = $result->getCache($key)) === false || empty($value->MonitoringOptions->MonitoringOption[0]->LanguageCodes->LanguageCode)) {
unset($this->Companies[$key]);
}
}
$this->view->countries = $this->Companies;
if ($this->getRequest()->isPost()) {
$giantController = new GiantControllerLib($this->getRequest()->getParam('CompanyId'));
$result = $giantController->startmonitoring($this->getRequest()->getParam('CompanyId'),

View File

@ -70,7 +70,7 @@
<td class="StyleInfoData lang_img <?=strtolower($rapport->DataSetType->_);?>">
<a id="r<?php echo $i?>" class="idpr id_cr" href="/giant/<?=strtolower($rapport->DataSetType->_)?>/Pays/<?=$this->Pays; ?>/Type/<?php echo $rapport->DataSetType->_?>/CompanyId/<?php echo $this->CompanyId;?>/Language/<?=$rapport->LanguageCodes->LanguageCode[0];?>" >Consulter le rapport en immédiat</a>
<a id="r<?php echo $i?>" class="idpr id_cr" href="/giant/<?=strtolower($rapport->DataSetType->_)?>/Pays/test/<?=$this->TestIndication?>/<?=$this->Pays; ?>/Type/<?php echo $rapport->DataSetType->_?>/CompanyId/<?php echo $this->CompanyId;?>/Language/<?=$rapport->LanguageCodes->LanguageCode[0];?>" >Consulter le rapport en immédiat</a>
<div id="pr<?php echo $i?>" class="hide" style="display:none;z-index: 1;margin-left: -340px;">
<center><img style="padding-top:30%" src="/themes/default/images/giant/19-1.gif" /></center>
</div>

View File

@ -1,4 +1,5 @@
<b>
<?if (in_array($this->resultat->CompanyId, $this->TestCompanies)):?>
<a href="<?php echo $this->url(
array('controller' => 'giant', 'action' => 'identite',
'raisonSociale' => $this->resultat->RegisteredName,
@ -6,9 +7,34 @@
'CompanyRegisterNumber' => $this->resultat->CompanyRegisterNumber,
'Pays' => $this->resultat->Address->Country,
'telephone' => $this->resultat->TelephoneNumbers->TelephoneNumber[0],
'test' => '0',
'Adresse' => $this->resultat->Address->HouseNumber.':'.$this->resultat->Address->Street.':'.$this->resultat->Address->PostCode.':'.$this->resultat->Address->City));?>">
<?php echo $this->resultat->RegisteredName.' -'; ?>
</a>
<span class='testSearch'><a href="<?php echo $this->url(
array('controller' => 'giant', 'action' => 'identite',
'raisonSociale' => $this->resultat->RegisteredName,
'CompanyId' => $this->resultat->CompanyId,
'CompanyRegisterNumber' => $this->resultat->CompanyRegisterNumber,
'Pays' => $this->resultat->Address->Country,
'telephone' => $this->resultat->TelephoneNumbers->TelephoneNumber[0],
'test' => '1',
'Adresse' => $this->resultat->Address->HouseNumber.':'.$this->resultat->Address->Street.':'.$this->resultat->Address->PostCode.':'.$this->resultat->Address->City));?>">
<?php echo ' TEST MODE'; ?>
</a></span>
<?else:?>
<a href="<?php echo $this->url(
array('controller' => 'giant', 'action' => 'identite',
'raisonSociale' => $this->resultat->RegisteredName,
'CompanyId' => $this->resultat->CompanyId,
'CompanyRegisterNumber' => $this->resultat->CompanyRegisterNumber,
'Pays' => $this->resultat->Address->Country,
'telephone' => $this->resultat->TelephoneNumbers->TelephoneNumber[0],
'test' => '0',
'Adresse' => $this->resultat->Address->HouseNumber.':'.$this->resultat->Address->Street.':'.$this->resultat->Address->PostCode.':'.$this->resultat->Address->City));?>">
<?php echo $this->resultat->RegisteredName; ?>
</a>
<?endif?>
</b>
<br />
<?php if(!empty($this->resultat->CompanyId)):?>

View File

@ -15,7 +15,7 @@
<?php echo $this->action('identite', 'debug', null, array('resultat' => $resultat, 'soap' => $this->soap));?>
<?php endif;?>
<li>
<?php echo $this->partial('giant/partials/rowSearch.phtml', array('resultat' => $resultat, 'pays', $this->pays));?>
<?php echo $this->partial('giant/partials/rowSearch.phtml', array('resultat' => $resultat, 'TestCompanies' => $this->TestCompanies, 'pays', $this->pays));?>
</li>
<?php endforeach;?>
</ol>

View File

@ -35,11 +35,9 @@
</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>
<?foreach($this->countries as $key=>$pays):?>
<option value="<?=$key?>"><?=$pays?></option>
<?endforeach?>
</select><br /><br />
<?endif?>
<strong>Preferred Start Date: </strong><br />

View File

@ -85,6 +85,10 @@ Class GiantControllerLib
'lifetime' => $this->configVal->cache->lifetime,
'automatic_serialization' => true
);
$path = '../data/cache/giant/';
if (!is_dir($path)) mkdir($path, 0777, true)
;
//No, create it
$backendOptions = array('cache_dir' => '../data/cache/giant/');
$cache = Zend_Cache::factory('Output','File',$frontendOptions,$backendOptions);
if(($result = $cache->load('Pays_'.$Pays)) === false) {

View File

@ -25,7 +25,8 @@ $(document).ready( function()
var values = $(this).attr('value');
//alert(values);
$.post('/giant/getpays',{Pays: values}, function(data) {
alert(data);
alert(data);
//alert($('select[name=LanguageCode]').html());
});
});
$('select[name=LanguageCode]').fadeIn(500);
@ -60,14 +61,14 @@ $(document).ready( function()
$('.lang_img').fadeOut();
$.alink = this.value.toLowerCase();
$.alink_h = this.value;
$(".id_cr").attr("href","/giant/"+$.alink+"/Pays/"+location.pathname.match(/\/Pays\/([^\/]+)/)[1]+"/Type/"+$.alink_h+"/CompanyId/"+location.pathname.match(/\/CompanyId\/([^\/]+)/)[1]+"/Language/"+$('.lang0').text().substr($('.lang0').text().length - 2));
$(".id_cr").attr("href","/giant/"+$.alink+"/Pays/"+location.pathname.match(/\/Pays\/([^\/]+)/)[1]+"/test/"+location.pathname.match(/\/test\/([^\/]+)/)[1]+"/Type/"+$.alink_h+"/CompanyId/"+location.pathname.match(/\/CompanyId\/([^\/]+)/)[1]+"/Language/"+$('.lang0').text().substr($('.lang0').text().length - 2));
$(".lang").attr("src","/themes/default/images/drapeaux/"+$('.lang0').text().substr($('.lang0').text().length - 2)+".png");
$(".lang_val").val($('.lang0').text().substr($('.lang0').text().length - 2));
$('.'+$.alink+'').fadeIn(500);
});
$('select.lang_val').on('change', function() {
$('.lang_img').fadeOut();
$(".id_cr").attr("href","/giant/"+$.alink+"/Pays/"+location.pathname.match(/\/Pays\/([^\/]+)/)[1]+"/Type/"+$.alink_h+"/CompanyId/"+location.pathname.match(/\/CompanyId\/([^\/]+)/)[1]+"/Language/"+this.value);
$(".id_cr").attr("href","/giant/"+$.alink+"/Pays/"+location.pathname.match(/\/Pays\/([^\/]+)/)[1]+"/test/"+location.pathname.match(/\/test\/([^\/]+)/)[1]+"/Type/"+$.alink_h+"/CompanyId/"+location.pathname.match(/\/CompanyId\/([^\/]+)/)[1]+"/Language/"+this.value);
$(".lang").attr("src","/themes/default/images/drapeaux/"+this.value+".png");
$('.'+$.alink+'').fadeIn(500);
});

View File

@ -357,3 +357,12 @@
.mon_type {
width: 140px;
}
.testSearch a:hover {
text-decoration: underline;
}
.testSearch a{
color: #008000;
font-style: italic;
}