Merge branch 'develop'

This commit is contained in:
Michael RICOIS 2017-03-10 11:08:55 +01:00
commit 5d23396a7a
3 changed files with 36 additions and 33 deletions

View File

@ -25,11 +25,11 @@
<div class="panel-body">
<ol>
<?php foreach ($this->serviceMethods as $method) {?>
<li>
<b><?php echo $method['name'];?></b>
<a href="#<?php echo $method['name'];?>"><i>Détail</i></a>
</li>
<?php } ?>
<li>
<b><?php echo $method['name'];?></b>
<a href="#<?php echo $method['name'];?>"><i>Détail</i></a>
</li>
<?php }?>
</ol>
</div>
</div>
@ -60,6 +60,7 @@
<h5>Retour</h5>
<div class="bs-callout bs-callout-php">
<?php if ($method['returnDesc'] != '') {?><?=$method['returnDesc']?><br/><br/><?php }?>
<?=$this->docReturn($method['return'], $this->serviceTypes);?>
</div>

View File

@ -39,8 +39,7 @@ class Scores_Ws_Doc
private function parseService()
{
$class = new Zend_Server_Reflection();
$methods = $class->reflectClass($this->serviceClass)
->getMethods();
$methods = $class->reflectClass($this->serviceClass)->getMethods();
$methodsElement = array();
foreach ($methods as $method) {
$prototype = null;
@ -56,9 +55,9 @@ class Scores_Ws_Doc
$paramsElement = array();
foreach ($prototype->getParameters() as $param) {
$paramElement = array(
'type' => $param->getType(),
'name' => $param->getName(),
'description' => $param->getDescription(),
'type' => $param->getType(),
'name' => $param->getName(),
'description' => $param->getDescription(),
);
if ($param->isOptional()) {
@ -68,11 +67,14 @@ class Scores_Ws_Doc
$paramsElement[] = $paramElement;
}
$return = $prototype->getReturnValue();
$methodElement = array(
'name' => $method->getName(),
'desc' => $method->getDescription(),
'params' => $paramsElement,
'return' => $prototype->getReturnType(),
'name' => $method->getName(),
'desc' => $method->getDescription(),
'params' => $paramsElement,
'return' => $prototype->getReturnType(),
'returnDesc' => $return->getDescription(),
);
$methodsElement[] = $methodElement;
@ -101,8 +103,8 @@ class Scores_Ws_Doc
$docBlock = preg_replace('/\n/', '', $property->getDocComment());
if (preg_match('/\/\*\*(.+) \* @var\s+[^\s]+\s+(?:\*|@)/m', $docBlock, $docBlockMatches)) {
$comment.= preg_replace(
array('/\r/', '/\*/' ),
array('', ''), $docBlockMatches[1]
array('/\r/', '/\*/' ),
array('', ''), $docBlockMatches[1]
);
}
@ -147,17 +149,17 @@ class Scores_Ws_Doc
switch ($ref[1]) {
case 'fichier':
$urlFichier = $view->url(array(
'controller' => 'ref',
'action' => 'fichier',
'q' => $ref[3],
'controller' => 'ref',
'action' => 'fichier',
'q' => $ref[3],
), null, true);
$comment.= '<a href="'.$urlFichier.'">'.$ref[2].'</a>';
break;
case 'mysql':
$urlMysql = $view->url(array(
'controller' => 'ref',
'action' => 'table',
'q' => $ref[3],
'controller' => 'ref',
'action' => 'table',
'q' => $ref[3],
), null, true);
$comment.= '<a href="'.$urlMysql.'">'.$ref[2].'</a>';
break;
@ -166,9 +168,9 @@ class Scores_Ws_Doc
}
}
$paramElement = array(
'name' => $name,
'type' => $type,
'description' => trim($comment)
'name' => $name,
'type' => $type,
'description' => trim($comment)
);
}
$paramsElement[] = $paramElement;

View File

@ -4,11 +4,11 @@ require_once __DIR__ . '/Types.php';
class Order extends Scores_Ws_Server
{
/**
* Financial account : Placing an order to have the entered numbers in the database
* Financial account : Placing an order to have the entered numbers in the database.
* @param string $siren
* Le siren de l'entité
* @param string $date
* Date de cloture du bilan
* Date de cloture du bilan. Format: Y-m-d
* @param string $type
* N:Normal, S:Simplifié, C:Consolidé
* @param string $source
@ -19,17 +19,17 @@ class Order extends Scores_Ws_Server
* @return string
* Retourne la référence de commande
*/
public function setBilanInput($siren, $date, $type, $source, $private = 0)
public function setBilanInput($siren, $date, $type, $source='client', $private = 0)
{
$this->authenticate();
$this->permission('UPLOADBILAN');
// Check source
if (in_array($source, array('extranet', 'infogreffe'))) {
if (!in_array($source, array('extranet', 'infogreffe'))) {
$source = 'client';
}
// Check Siren
else {
if ($source == 'client') {
if (strlen($siren) != 9 || intval($siren) == 0) {
throw new SoapFault('ERR', "SIREN invalid");
}
@ -106,8 +106,8 @@ class Order extends Scores_Ws_Server
// Generate filename
$siren = $commandeResult->siren;
$type = $commandeResult->type;
$cloture = $commandeResult->bilanCloture;
$type = $commandeResult->bilanType;
$cloture = str_replace('-', '', $commandeResult->bilanCloture);
$ref = $commandeResult->refCommande;
$filename = $siren.'_'.$type.'_'.$cloture.'_'.$ref.'.pdf';