This commit is contained in:
Laurent Destailleur 2022-06-14 16:21:12 +02:00
commit 866fc4d83e
3 changed files with 485 additions and 479 deletions

View File

@ -276,6 +276,13 @@ RESTLER:
$loaders = array_unique(static::$rogueLoaders, SORT_REGULAR);
* Replace CommentParser.php line 423
elseif (count($value) && is_numeric($value[0]))
with
elseif (count($value) && isset($value[0]) && is_numeric($value[0]))
+With swagger 2 provided into /explorer:
----------------------------------------

View File

@ -124,7 +124,7 @@ $usercancreateorder = $user->rights->commande->creer;
$usercancreateinvoice = $user->rights->facture->creer;
$usercancreatecontract = $user->rights->contrat->creer;
$usercancreateintervention = $user->hasRight('ficheinter', 'creer');
$usercancreatepurchaseorder = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer);
$usercancreatepurchaseorder = ($user->hasRight('fournisseur', 'commande', 'creer') || $user->hasRight('supplier_order', 'creer'));
$permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php
$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php

View File

@ -107,7 +107,6 @@ class CommentParser
$p->extractData($comment);
return $p->_data;
}
/**
@ -153,7 +152,7 @@ class CommentParser
foreach ($comments as $line) {
$line = trim($line);
$newParam = false;
if (empty ($line)) {
if (empty($line)) {
if ($mode == 0) {
$mode++;
} else {
@ -271,7 +270,7 @@ class CommentParser
}
$value[self::$embeddedDataName] = $embedded;
}
if (empty ($data[$param])) {
if (empty($data[$param])) {
if ($allowMultiple) {
$data[$param] = array(
$value
@ -295,7 +294,7 @@ class CommentParser
+= $data[$param][self::$embeddedDataName];
}
if (!is_array($data[$param])) {
$data[$param] = array('description' => (string)$data[$param]);
$data[$param] = array('description' => (string) $data[$param]);
}
if (is_array($value)) {
$data[$param] = $value + $data[$param];
@ -344,13 +343,13 @@ class CommentParser
while (preg_match(self::$embeddedDataPattern, $subject, $matches)) {
$subject = str_replace($matches[0], '', $subject);
$str = $matches[self::$embeddedDataIndex];
if (isset ($this->restler)
if (isset($this->restler)
&& self::$embeddedDataIndex > 1
&& !empty ($name)
&& !empty($name)
) {
$extension = $name;
$formatMap = $this->restler->getFormatMap();
if (isset ($formatMap[$extension])) {
if (isset($formatMap[$extension])) {
/**
* @var \Luracast\Restler\Format\iFormat
*/
@ -420,7 +419,7 @@ class CommentParser
$exception = $v1;
array_shift($value);
}
} elseif (count($value) && is_numeric($value[0])) {
} elseif (count($value) && isset($value[0]) && is_numeric($value[0])) {
$code = $value[0];
array_shift($value);
}