Skip to content

Commit

Permalink
Evidence "changes" known now
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitexus committed Mar 6, 2024
1 parent 81aaac5 commit dfcec5f
Show file tree
Hide file tree
Showing 12 changed files with 96 additions and 42 deletions.
5 changes: 3 additions & 2 deletions debian/changelog
@@ -1,4 +1,4 @@
php-spojenet-abraflexi (2.25.2.137~bookworm.138~jammy.139~jammy.140~jammy) UNRELEASED; urgency=medium
php-spojenet-abraflexi (2.25.3) UNRELEASED; urgency=medium

[ Vítězslav Dvořák ]
* ease-core based
Expand Down Expand Up @@ -60,8 +60,9 @@ php-spojenet-abraflexi (2.25.2.137~bookworm.138~jammy.139~jammy.140~jammy) UNREL
* jenkins-Spoje.Net-php-spojenet-abraflexi-138
* jenkins-Spoje.Net-php-spojenet-abraflexi-139
* jenkins-Spoje.Net-php-spojenet-abraflexi-140
* Changes availble now as evidence

-- vitex <jenkins@vyvojar.spoje.net> Thu, 22 Feb 2024 08:56:30 +0000
-- vitex <info@vitexsoftware.cz> Wed, 06 Mar 2024 11:59:41 +0100

flexipeehp (1.12) experimental; urgency=medium

Expand Down
21 changes: 11 additions & 10 deletions src/AbraFlexi/EvidenceList.php
Expand Up @@ -3,7 +3,7 @@
/**
* AbraFlexi - List of Evidencies.
*
* Generated: Wed, 06 Mar 2024 10:50:03 +0000
* Generated: Wed, 06 Mar 2024 11:18:55 +0000
* From: https://flexibee-dev.spoje.net:5434
*
* @author Vítězslav Dvořák <vitex@arachne.cz>
Expand Down Expand Up @@ -166,7 +166,6 @@ class EvidenceList extends RO
'faktura-vydana-polozka' => 'Položky vydaných faktur a prodejek',
'banka-polozka' => 'Položky vzájemných zápočtů',
'poplatek' => 'Poplatky',
'changes' => 'Poslední změny',
'psc' => 'Poštovní směrovací čísla',
'pracovni-pomer' => 'Pracovní poměr',
'pracovni-pomer-hlavicka' => 'Pracovní poměr',
Expand Down Expand Up @@ -287,6 +286,7 @@ class EvidenceList extends RO
'zakazka' => 'Zakázky',
'zamek' => 'Zamykání období',
'forma-uhrady-zauctovani' => 'Zaúčtování formy úhrady',
'changes' => 'Změny',
'intrastat-zvlastni-pohyb' => 'Zvláštní pohyby',
'zapujcka' => 'Zápůjčky',
'rada' => 'dokladové řady',
Expand Down Expand Up @@ -336,14 +336,6 @@ class EvidenceList extends RO
'className' => 'cz.winstrom.vo.w.Uzivatel',
'formCode' => 'cisOsoby',
],
'changes' => [
'evidenceType' => 'ZMENY',
'evidenceName' => 'Poslední změny',
'evidencePath' => 'changes',
'importStatus' => 'UNSUPPORTRED',
'className' => '',
'formCode' => '',
],
'analyza-nakupu' => [
'evidenceType' => 'ANALYZA_NAKUPU',
'evidenceName' => 'Analýza nákupu',
Expand Down Expand Up @@ -596,6 +588,15 @@ class EvidenceList extends RO
'formCode' => 'vykazVysledovkaPoUctech',
'extIdSupported' => 'false',
],
'changes' => [
'evidenceType' => 'ZMENY',
'evidenceName' => 'Změny',
'evidencePath' => 'changes',
'importStatus' => 'UNSUPPORTRED',
'extIdSupported' => true,
'className' => '',
'formCode' => '',
],
'adresar-bankovni-ucet' => [
'evidenceType' => 'ADR_BANKOVNI_UCET',
'evidenceName' => 'Bankovní spojení',
Expand Down
22 changes: 11 additions & 11 deletions src/AbraFlexi/Formats.php
Expand Up @@ -1418,17 +1418,6 @@ public static function contentTypeToSuffix($contentType)
'JSON' => 'json',
'CSV' => 'csv',
];
/**
* Evidence changes (Poslední změny) Formats.
*
* @var array
*/
public static $changes = [
'HTML' => 'html',
'XML' => 'xml',
'JSON' => 'json',
'CSV' => 'csv',
];
/**
* Evidence psc (Poštovní směrovací čísla) Formats.
*
Expand Down Expand Up @@ -2749,6 +2738,17 @@ public static function contentTypeToSuffix($contentType)
'JSON' => 'json',
'CSV' => 'csv',
];
/**
* Evidence changes (Změny) Formats.
*
* @var array
*/
public static $changes = [
'HTML' => 'html',
'XML' => 'xml',
'JSON' => 'json',
'CSV' => 'csv',
];
/**
* Evidence intrastat-zvlastni-pohyb (Zvláštní pohyby) Formats.
*
Expand Down
2 changes: 1 addition & 1 deletion static/EvidenceFullList.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion static/EvidenceList.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion static/Formats.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions static/Properties.changes.json
@@ -0,0 +1 @@
{"id":{"showToUser":"false","propertyName":"id","name":"ID","title":"ID","type":"integer","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"true","inSummary":"true","inDetail":"true","mandatory":"false","isWritable":"false","isOverWritable":"false","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null},"external-ids":{"showToUser":"false","propertyName":"external-ids","fkEvidencePath":"external-ids","dbName":"extid","name":"external-ids","title":"extIDs","type":"relation","isVisible":"true","isSortable":"false","isHighlight":"false","inId":"true","inSummary":"true","inDetail":"true","inExpensive":"false","mandatory":"false","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null}}
27 changes: 27 additions & 0 deletions tools/changes-properties.json
@@ -0,0 +1,27 @@
{
"properties": {
"@version": "1.0",
"evidenceName": "Změny",
"tagName": "changes",
"property": [{
"showToUser": "false",
"propertyName": "id",
"name": "ID",
"title": "ID",
"type": "integer",
"isVisible": "true",
"isSortable": "true",
"isHighlight": "false",
"inId": "true",
"inSummary": "true",
"inDetail": "true",
"mandatory": "false",
"isWritable": "false",
"isOverWritable": "false",
"hasBusinessLogic": "false",
"isUpperCase": "false",
"isLowerCase": "false",
"links": null
}]
}
}
3 changes: 3 additions & 0 deletions tools/update_actions_class.php
Expand Up @@ -124,6 +124,9 @@ class Actions
$pos = 0;
foreach (EvidenceList::$name as $evidencePath => $evidenceName) {
$pos++;
if ($evidencePath == 'changes') {
continue;
}
$structure = getEvidenceActions($evidencePath, $syncer);
$structures[$evidencePath] = $structure;
if (count($structure)) {
Expand Down
21 changes: 16 additions & 5 deletions tools/update_evidencelist_class.php
Expand Up @@ -6,7 +6,7 @@
define('EASE_LOGGER', 'console|syslog');

require_once '../test/bootstrap.php';
require_once __DIR__ . '/common.php';
require_once __DIR__ . '/common.php';

$outFile = 'EvidenceList.php';
$outJson = 'EvidenceList.json';
Expand All @@ -19,7 +19,8 @@
* @param RO $syncer Class to read from FlexiBee
* @return array Evidence structure
*/
function getColumnsInfo($evidence, RO $syncer) {
function getColumnsInfo($evidence, RO $syncer)
{
$useKeywords = [];
$flexinfo = $syncer->performRequest($evidence . '/properties.json');
if (count($flexinfo) && array_key_exists('properties', $flexinfo)) {
Expand All @@ -43,7 +44,7 @@ function getColumnsInfo($evidence, RO $syncer) {
* From: ' . $statuser->url . '
*
* @author Vítězslav Dvořák <vitex@arachne.cz>
* @copyright (C) 2016-'.date('Y').' Spoje.Net
* @copyright (C) 2016-' . date('Y') . ' Spoje.Net
*/
namespace AbraFlexi;
Expand Down Expand Up @@ -91,7 +92,7 @@ class EvidenceList extends RO
';

$syncer = new EvidenceList();
$syncer->addStatusMessage('Updating Evidences List');
$syncer->addStatusMessage('♻️ Updating Evidences List');

$evidencies = $syncer->getColumnsFromAbraFlexi(['evidencePath', 'evidenceName']);

Expand All @@ -114,13 +115,23 @@ class EvidenceList extends RO
"formCode" => "cisOsoby"
];

$evidencies[] = [
"evidenceType" => "ZMENY",
"evidenceName" => "Změny",
"evidencePath" => "changes",
"importStatus" => "UNSUPPORTRED",
'extIdSupported' => true,
"className" => "",
"formCode" => ""
];

$evlist = [];
foreach ($evidencies as $evidenceID => $evidence) {
if (array_key_exists('evidencePath', $evidence)) {
$evlist[$evidence['evidencePath']] = $evidence['evidenceName'];
$fullList[$evidence['evidencePath']] = $evidence;
}

if (array_key_exists('extIdSupported', $evidence)) {
$evidencies[$evidenceID]['extIdSupported'] = ($evidencies[$evidenceID]['extIdSupported'] == 'true');
} else {
Expand Down
24 changes: 15 additions & 9 deletions tools/update_properties_class.php
Expand Up @@ -45,14 +45,21 @@ class Properties
foreach (EvidenceList::$name as $evidencePath => $evidenceName) {
$pos++;
$evidenceInfo = EvidenceList::$evidences[$evidencePath];
if ($evidencePath == 'nastaveni') {
$info = json_decode(file_get_contents('nastaveni-properties.json'),
true);
$structure = \Ease\Functions::reindexArrayBy($info['properties']['property'], 'propertyName');
} else {
$structure = $syncer->getOnlineColumnsInfo($evidencePath);

switch ($evidencePath) {
case 'nastaveni':
$info = json_decode(file_get_contents('nastaveni-properties.json'), true);
$structure = \Ease\Functions::reindexArrayBy($info['properties']['property'], 'propertyName');
break;
case 'changes':
$info = json_decode(file_get_contents('changes-properties.json'), true);
$structure = \Ease\Functions::reindexArrayBy($info['properties']['property'], 'propertyName');
break;
default:
$structure = $syncer->getOnlineColumnsInfo($evidencePath);
break;
}

if (array_key_exists('extIdSupported', $evidenceInfo) && ($evidenceInfo['extIdSupported'] == true)) {
$structure['external-ids'] = [
"showToUser" => "false",
Expand Down Expand Up @@ -141,8 +148,7 @@ class Properties
$syncer->addStatusMessage($pos . ' of ' . count(EvidenceList::$name) . ' ' . $evidencePath . ': structure problem',
'error');
}
file_put_contents('Properties.' . $evidencePath . '.json',
json_encode($structure));
file_put_contents('Properties.' . $evidencePath . '.json', json_encode($structure));

$evidenceClass = evidenceToClass($evidencePath);
$evidenceClassFile = '../src/AbraFlexi/' . $evidenceClass . '.php';
Expand Down
8 changes: 6 additions & 2 deletions tools/update_relations_class.php
Expand Up @@ -6,7 +6,7 @@
define('EASE_LOGGER', 'console|syslog');

require_once '../test/bootstrap.php';
require_once __DIR__ . '/common.php';
require_once __DIR__ . '/common.php';

$outFile = 'Relations.php';
$outJson = 'Relations.json';
Expand All @@ -20,7 +20,8 @@
*
* @return array Relations structure
*/
function getEvidenceRelations($evidence, RO $syncer) {
function getEvidenceRelations($evidence, RO $syncer)
{
$relations = [];

if ($evidence == 'atribut') {
Expand Down Expand Up @@ -83,6 +84,9 @@ class Relations
$pos = 0;
foreach (EvidenceList::$name as $evidencePath => $evidenceName) {
$pos++;
if ($evidencePath == 'changes') {
continue;
}
$structure = getEvidenceRelations($evidencePath, $syncer);

$relations[$evidencePath] = $structure;
Expand Down

0 comments on commit dfcec5f

Please sign in to comment.