Modification de giant

Le 7 Avril 2011

PatchNote :
Création de quelques fonctions ajax pour les chargement + modification de la base de donnée.
This commit is contained in:
Damien LASSERRE 2011-04-07 15:26:55 +00:00
parent 97edff1e1d
commit 157dd4be37
10 changed files with 128 additions and 33 deletions

View File

@ -10,5 +10,6 @@ Class rapport extends Doctrine_Record
$this->hasColumn('DataSetType', 'varchar', 50, array('notnull' => true));
$this->hasColumn('UrlObjectRapportFile', 'blob', null, array('notnull'=> true));
$this->hasColumn('DateTimeSave', 'date', null, array('notnull'=> true));
$this->hasColumn('Delivred', 'bool', null, array('notnull'=> true));
}
}

View File

@ -3,5 +3,6 @@ CREATE TABLE IF NOT EXISTS rapport (
CompanyId int COLLATE utf8_unicode_ci NOT NULL,
DataSetType varchar(50) NOT NULL,
UrlObjectRapportFile varchar(255) NOT NULL,
DateTimeSave date NOT NULL
DateTimeSave date NOT NULL,
Delivred boolean NOT NULL
)ENGINE = MYISAM;

View File

@ -26,6 +26,9 @@ define ('GIANT_CREDIT_PASS','ClaudeMonet');
define('NUM_ROWS', $_SESSION['tabInfo']['nbReponses']);
define('MAX_ROWS', 200);
//Permet de definir le temps de sauvegarde des rapports ! ce compte en jours !
define('_LIMIT_DATE_RAPPORT_', 30);
require_once (realpath(dirname(__FILE__)).'/modulesGiants/ClassWsdl/CreditDataPortType/IncludedFiles.php');
require_once (realpath(dirname(__FILE__)).'/modulesGiants/ClassWsdl/CreditDataPortType.php');
require_once (realpath(dirname(__FILE__)).'/modulesGiants/ClassWsdl/SearchPortType/IncludedFiles.php');

View File

@ -8,7 +8,7 @@ require_once (realpath(dirname(__FILE__)).'/Client.php');
require_once (realpath(dirname(__FILE__)).'/modulesGiants/Functions.php');
require_once ('dbbootstrap.php');
set_time_limit(60);
set_time_limit(100);
setDbConn('giantclient');
$OrderExists = Doctrine_Query::create()
@ -18,8 +18,19 @@ $OrderExists = Doctrine_Query::create()
->andWhere('DataSetType ="'.$_GET['type'].'"')
->fetchOne();
$InternalOrderId = $OrderExists->InternalOrderId;
if (empty($InternalOrderId))
$rapportExists = Doctrine_Query::create()
->select('CompanyId, UrlObjectRapportFile, DateTimeSave')
->from('rapport')
->where('CompanyId = '. $_GET['company'])
->andWhere('DataSetType = "'. $_GET['type'].'"')
->fetchOne();
$dateTime = new DateTime();
$dateTimeBDD = new DateTime($rapportExists->DateTimeSave);
$daysOfRapport = $dateTime->diff($dateTimeBDD);
if (!file_exists($rapportExists->UrlObjectRapportFile))
{
$soap_client = getClient($_GET['pays'], 'OrderDataSet');
$OrderDataSet = new CreditDataPortType();
@ -45,23 +56,13 @@ if (empty($InternalOrderId))
$request->OrderDateTime = $informations->Order->OrderDateTime;
$request->save();
$InternalOrderId = $informations->Order->InternalOrderId;
}
$rapportExists = Doctrine_Query::create()
->select('CompanyId, UrlObjectRapportFile')
->from('rapport')
->where('CompanyId = '. $_GET['company'])
->andWhere('DataSetType = "'. $_GET['type'].'"')
->fetchOne();
if (empty($rapportExists->CompanyId)) {
$nameFileRapport = 'rapport-'.date('Y-m-d').'-'.$_GET['pays'].'-'.$_GET['company'].'-'.$_GET['type'];
$soap_client2 = getClient($_GET['pays'], 'RetrieveDataSet');
$RetrieveDataSet = new CreditDataPortType();
$params = $RetrieveDataSet->RetrieveDataSet();
$params->RetrieveDataSet->InternalOrderId = $InternalOrderId;
$rapport = SwitchWSDLFunction('RetrieveDataSet', $params->RetrieveDataSet, $soap_client2);
@ -70,11 +71,11 @@ if (empty($rapportExists->CompanyId)) {
$saveRapport->CompanyId = $_GET['company'];
$saveRapport->DataSetType = $_GET['type'];
$saveRapport->UrlObjectRapportFile = $directory.$nameFileRapport;
(file_put_contents($directory.$nameFileRapport, serialize($rapport->DataSet))) ? true : EXIT_FAILURE;
(file_put_contents($directory.$nameFileRapport, serialize($rapport->DataSet))) ?
$saveRapport->Delivred = true : $saveRapport->Delivred = EXIT_FAILURE;
$saveRapport->DateTimeSave = date('Y-m-d');
$saveRapport->save();
$rapport = $rapport->DataSet;
} else {
} else
($rapport = unserialize(file_get_contents($rapportExists->UrlObjectRapportFile))) ? true : EXIT_FAILURE;
}
?>

View File

@ -1,3 +1,10 @@
<script>
$("#reset").click(function(){
pct=0;
$("#progressbar").reportprogress(0);
});
</script>
<?php
/**
* Fichier de gestion des affichages des différents rapport disponnibles.
@ -5,6 +12,7 @@
*/
require_once 'giant/Config.php';
require_once 'giant/Client.php';
$i = 0;
foreach($DataSetOptions as $params)
{
@ -13,7 +21,8 @@ foreach($DataSetOptions as $params)
<tr>
<td width="">&nbsp;</td>
<td width="200" valign="top">
<img title="<?php echo SelectTrueLabel($config['Section_rapport'], 'RapportType') . $type->DataSetType->_;?>" src="img/icones/page_white_magnify.png" />
<img title="
<?php echo SelectTrueLabel($config['Section_rapport'], 'RapportType') . $type->DataSetType->_;?>" src="img/icones/page_white_magnify.png" />
<b><?php echo $type->DataSetType->_;?></b>
</td>
<td width="100">
@ -24,18 +33,20 @@ foreach($DataSetOptions as $params)
?>
</td>
<td>
<a href="./?
<a style="margin-left:6px" id="r<?php echo $i?>" class="idpr" href="/?
page=RapportGiant
&pays=<?php echo $_GET['pays']; ?>
&company=<?php echo $_GET['company'];?>
&level=Immediate
&type=<?php echo $type->DataSetType->_;?>
&lang=<?php echo $Language;?>
">
">
Consulter le rapport en immédiat.
</a>
<img id="pr<?php echo $i?>" style="display:none" src="img/icones/loading11.gif" />
</td>
</tr>
<?php $i++; ?>
<?php }
}
?>

View File

@ -1,5 +1,42 @@
@CHARSET "ISO-8859-1";
/* Barre de progression JQuery */
/* progress bar container */
#progressbar
{
border:1px solid black;
width:200px;
height:20px;
position:relative;
color:black;
}
/* color bar */
#progressbar div.progress
{
position:absolute;
width:0;
height:100%;
overflow:hidden;
background-color:#369;
}
/* text on bar */
#progressbar div.progress .text
{
position:absolute;
text-align:center;
color:white;
}
/* text off bar */
#progressbar div.text
{
position:absolute;
width:100%;
height:100%;
text-align:center;
}
/* Fin Barre de progression JQuery */
/* Gestion du template PaymentBehaviourGiant */
.PaymentBehaviourGiant
{

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -60,8 +60,8 @@ $tabScripts = array(
'pages' => array('liasse'),
),
'script_giant' => array(
'list' => array('giant.js'),
'pages' => array('RapportGiant')
'list' => array('jqueryprogressbar.js', 'giant.js'),
'pages' => array('RapportGiant', 'GiantIdentiteSociete')
),
);
?>

View File

@ -1,7 +1,17 @@
var pct=0;
var handle=0;
function update(){
$("#progressbar").reportprogress(++pct);
if(pct == 500)
pct=0;
}
$(document).ready(function(){
$('.idpr').live('click', function(e){
e.preventDefault();
$('.idpr').live('click', function(){
//e.preventDefault();
var n = $(this).attr('id');
$('#'+n).css('display', 'none');
if ($('#p'+n).css('display')=='none'){
$('#p'+n).css('display', 'block');
} else {
@ -19,5 +29,10 @@ $(document).ready(function(){
tooltip: 'topMiddle' } }
});
});
$("#run").click(function(){
handle = setInterval("update()",400);
//clearInterval(handle);
});
});

View File

@ -14,20 +14,46 @@
CompanyWebSite = ""
CompanyEmail = ""
[Section_rapport]
DesciptionLanguage = ""
FullDescription = "<table>
<tr>
<b>Information sur le rapport</b>
</tr>
<tr>
<td>Ce rapport est composés en plusieurs parties</td>
</tr>
<tr>
<td>
<ol>
<li>Identite et raison sociale</li>
<li>CreditRecommandation</li>
<li>Dirigeants</li>
<li>Les Bilans (actifs, Passifs, Compte de résultats)</li>
<li>Les Etablissements financiés</li>
<li>Comportement de paiement</li>
<li>Les partenaires financiés</li>
<li>Les actionnaires</li>
<li>Les annonces légales</li>
<li>Le Score</li>
</ol>
</td>
</tr>
</table>"
CompactDescription = ""
rapportDescription = ""
[Section_rapportTitre]
Dirigeants = ""
IdentiteDeLentreprise = ""
ElementsFinancies = ""
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Fiche de rapport ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[Section_rapport]
RapportType = ""
DesciptionLanguage = ""
[Section_rapportTitre]
Dirigeants = ""
IdentiteDeLentreprise = ""
ElementsFinancies = ""
[Section_rapportCreditRecommendation]
CreditRecommendation = ""