|
15 | 15 | */ |
16 | 16 | class FlexiBeeRO extends \Ease\Sand |
17 | 17 | { |
| 18 | + |
18 | 19 | use \Ease\RecordKey; |
19 | 20 | /** |
20 | 21 | * Where to get JSON files with evidence stricture etc. |
@@ -109,7 +110,7 @@ class FlexiBeeRO extends \Ease\Sand |
109 | 110 | public $company = null; |
110 | 111 |
|
111 | 112 | /** |
112 | | - * Server[:port] |
| 113 | + * [protocol://]Server[:port] |
113 | 114 | * @var string |
114 | 115 | */ |
115 | 116 | public $url = null; |
@@ -275,43 +276,43 @@ class FlexiBeeRO extends \Ease\Sand |
275 | 276 | * @var array |
276 | 277 | */ |
277 | 278 | public $urlParams = [ |
278 | | - 'add-global-version', |
279 | | - 'add-row-count', |
280 | | - 'as-gui', |
281 | | - 'auth', |
282 | | - 'authSessionId', |
283 | | - 'code-as-id', |
284 | | - 'code-in-response', |
285 | | - 'delimeter', |
286 | | - 'detail', //See: https://www.flexibee.eu/api/dokumentace/ref/detail-levels |
287 | | - 'dir', |
288 | | - 'dry-run', // See: https://www.flexibee.eu/api/dokumentace/ref/dry-run/ |
289 | | - 'encoding', |
290 | | - 'export-settings', |
291 | | - 'fail-on-warning', |
292 | | - 'filter', |
293 | | - 'format', |
294 | | - 'idUcetniObdobi', |
295 | | - 'includes', |
296 | | - 'inDesktopApp', // Note: Undocumented function (html only) |
297 | | - 'limit', |
298 | | - 'mode', |
299 | | - 'no-ext-ids', |
300 | | - 'no-http-errors', |
301 | | - 'no-ids', |
302 | | - 'only-ext-ids', |
303 | | - 'order', |
304 | | - 'relations', |
305 | | - 'report-lang', |
306 | | - 'report-name', |
307 | | - 'report-sign', |
308 | | - 'skupina-stitku', |
309 | | - 'sort', |
310 | | - 'start', |
311 | | - 'stitky-as-ids', |
312 | | - 'use-ext-id', |
313 | | - 'use-internal-id', |
314 | | - 'xpath', // See: https://www.flexibee.eu/api/dokumentace/ref/xpath/ |
| 279 | + 'add-global-version' => 'boolean', |
| 280 | + 'add-row-count' => 'boolean', |
| 281 | + 'as-gui' => 'boolean', |
| 282 | + 'auth' => 'string', |
| 283 | + 'authSessionId' => 'string', |
| 284 | + 'code-as-id' => 'boolean', |
| 285 | + 'code-in-response' => 'boolean', |
| 286 | + 'delimeter' => 'string', |
| 287 | + 'detail' => 'string', //See: https://www.flexibee.eu/api/dokumentace/ref/detail-levels |
| 288 | + 'dir' => 'string', |
| 289 | + 'dry-run' => 'boolean', // See: https://www.flexibee.eu/api/dokumentace/ref/dry-run/ |
| 290 | + 'encoding' => 'string', |
| 291 | + 'export-settings' => 'boolean', |
| 292 | + 'fail-on-warning' => 'boolean', |
| 293 | + 'filter' => 'string', |
| 294 | + 'format' => 'string', |
| 295 | + 'idUcetniObdobi' => 'string', //See: https://www.flexibee.eu/api/dokumentace/ref/stavy-uctu/ |
| 296 | + 'includes' => 'string', |
| 297 | + 'inDesktopApp' => 'boolean', // Note: Undocumented function (html only) |
| 298 | + 'limit' => 'integer', |
| 299 | + 'mode' => 'string', |
| 300 | + 'no-ext-ids' => 'boolean', |
| 301 | + 'no-http-errors' => 'boolean', |
| 302 | + 'no-ids' => 'boolean', |
| 303 | + 'only-ext-ids' => 'boolean', |
| 304 | + 'order' => 'string', |
| 305 | + 'relations' => 'string', |
| 306 | + 'report-lang' => 'string', |
| 307 | + 'report-name' => 'string', |
| 308 | + 'report-sign' => 'string', |
| 309 | + 'skupina-stitku' => 'string', |
| 310 | + 'sort' => 'string', |
| 311 | + 'start' => 'integer', |
| 312 | + 'stitky-as-ids' => 'boolean', |
| 313 | + 'use-ext-id' => 'boolean', |
| 314 | + 'use-internal-id' => 'boolean', |
| 315 | + 'xpath' => 'string', // See: https://www.flexibee.eu/api/dokumentace/ref/xpath/ |
315 | 316 | ]; |
316 | 317 |
|
317 | 318 | /** |
@@ -1296,7 +1297,7 @@ public function getFlexiRow($recordID) |
1296 | 1297 | */ |
1297 | 1298 | public function extractUrlParams(&$conditions, &$urlParams) |
1298 | 1299 | { |
1299 | | - foreach ($this->urlParams as $urlParam) { |
| 1300 | + foreach (array_keys($this->urlParams) as $urlParam) { |
1300 | 1301 | if (isset($conditions[$urlParam])) { |
1301 | 1302 | \Ease\Functions::divDataArray($conditions, $urlParams, $urlParam); |
1302 | 1303 | } |
@@ -1768,8 +1769,8 @@ public function logResult($resultData = null, $url = null) |
1768 | 1769 | { |
1769 | 1770 | $logResult = false; |
1770 | 1771 | if (isset($resultData['success']) && ($resultData['success'] == 'false')) { |
1771 | | - $this->addStatusMessage('Error '.$this->lastResponseCode.': '.urldecode($url) . (array_key_exists('message', |
1772 | | - $resultData) ? ' ' . $resultData['message'] : '') , 'warning'); |
| 1772 | + $this->addStatusMessage('Error '.$this->lastResponseCode.': '.urldecode($url).(array_key_exists('message', |
| 1773 | + $resultData) ? ' '.$resultData['message'] : ''), 'warning'); |
1773 | 1774 | unset($url); |
1774 | 1775 | } |
1775 | 1776 | if (is_null($resultData)) { |
@@ -1820,11 +1821,11 @@ public function saveDebugFiles() |
1820 | 1821 | $fname = $this->evidence.'-'.$this->curlInfo['when'].'.'.$this->format; |
1821 | 1822 | $reqname = $tmpdir.'/request-'.$fname; |
1822 | 1823 | $respname = $tmpdir.'/response-'.$fname; |
1823 | | - $header = '# '. (new \DateTime())->format('Y-m-d\TH:i:s.u') .' '. $this->curlInfo['url']. ' ('.urldecode($this->curlInfo['url']).')'; |
1824 | | - if (file_put_contents($reqname, $header . "\n".$this->postFields)) { |
| 1824 | + $header = '# '.(new \DateTime())->format('Y-m-d\TH:i:s.u').' '.$this->curlInfo['url'].' ('.urldecode($this->curlInfo['url']).')'; |
| 1825 | + if (file_put_contents($reqname, $header."\n".$this->postFields)) { |
1825 | 1826 | $this->addStatusMessage($reqname, 'debug'); |
1826 | 1827 | } |
1827 | | - if (file_put_contents($respname, $header . "\n".$this->lastCurlResponse)) { |
| 1828 | + if (file_put_contents($respname, $header."\n".$this->lastCurlResponse)) { |
1828 | 1829 | $this->addStatusMessage($respname, 'debug'); |
1829 | 1830 | } |
1830 | 1831 | } |
@@ -2221,10 +2222,10 @@ public function getOnlineColumnsInfo($evidence = null) |
2221 | 2222 | $flexinfo = $this->performRequest('/c/'.$this->company.'/'.$evidence.'/properties.json'); |
2222 | 2223 | if (!empty($flexinfo) && array_key_exists('properties', $flexinfo)) { |
2223 | 2224 | foreach ($flexinfo['properties']['property'] as $evidenceProperty) { |
2224 | | - $key = $evidenceProperty['propertyName']; |
2225 | | - $properties[$key] = $evidenceProperty; |
2226 | | - if(array_key_exists('name', $evidenceProperty)){ |
2227 | | - $proerties[$key]['name'] = $evidenceProperty['name']; |
| 2225 | + $key = $evidenceProperty['propertyName']; |
| 2226 | + $properties[$key] = $evidenceProperty; |
| 2227 | + if (array_key_exists('name', $evidenceProperty)) { |
| 2228 | + $proerties[$key]['name'] = $evidenceProperty['name']; |
2228 | 2229 | } |
2229 | 2230 | $properties[$key]['type'] = $evidenceProperty['type']; |
2230 | 2231 | if (array_key_exists('url', $evidenceProperty)) { |
@@ -2448,7 +2449,7 @@ public function setMyKey($myKeyValue) |
2448 | 2449 | $extIds); |
2449 | 2450 | } |
2450 | 2451 | } else { |
2451 | | - $res = $this->setDataValue($this->getMyKey(), $myKeyValue); |
| 2452 | + $res = $this->setDataValue($this->getMyKey(), $myKeyValue); |
2452 | 2453 | } |
2453 | 2454 | $this->updateApiURL(); |
2454 | 2455 | return $res; |
|
0 commit comments