From 6d0aa858f5e8f99038125f8bc2f8be42d6c8b817 Mon Sep 17 00:00:00 2001 From: Benjamin Date: Fri, 4 Feb 2022 13:55:01 +0100 Subject: [PATCH] Hotfix 2.0.3 (#139) * refactoring * refactoring refactoring refactoring & #46 Create help section for configuration and #47 #61 changelog [tx-robot] updated from transifex Signed-off-by: Nextcloud bot [tx-robot] updated from transifex Signed-off-by: Nextcloud bot [tx-robot] updated from transifex Signed-off-by: Nextcloud bot [tx-robot] updated from transifex Signed-off-by: Nextcloud bot * transifex * transifex * test * Translation * translation * hotfix * https://github.com/baimard/gestion/issues/123 * Update lib/Migration/Version20002Date20220201085856.php Co-authored-by: Vitor Mattos * Update lib/Migration/Version20002Date20220201085856.php Co-authored-by: Vitor Mattos * Update lib/Migration/Version7Date20220125174818.php Co-authored-by: Vitor Mattos * Update lib/Migration/Version7Date20220125174818.php Co-authored-by: Vitor Mattos * Update lib/Migration/Version7Date20220125174818.php Co-authored-by: Vitor Mattos * https://github.com/baimard/gestion/issues/135 * Update lib/Migration/Version20002Date20220201085856.php Co-authored-by: Vitor Mattos * valide * valide * final * Final * Final * Update lib/Migration/Version20002Date20220201085856.php Co-authored-by: Vitor Mattos * Update lib/Migration/Version20002Date20220201085856.php Co-authored-by: Vitor Mattos * Update lib/Migration/Version7Date20220125174818.php Co-authored-by: Vitor Mattos * Update lib/Migration/Version7Date20220125174818.php Co-authored-by: Vitor Mattos * Update lib/Migration/Version7Date20220125174818.php Co-authored-by: Vitor Mattos * [tx-robot] updated from transifex Signed-off-by: Nextcloud bot * l10n: Fixed grammar Reported at Transifex. Signed-off-by: rakekniven <2069590+rakekniven@users.noreply.github.com> * l10n: Improve styling A more selected description of the function setting. * l10n: Improve styling A more selected description of the function setting. * l10n: Add "an" * l10n: Add "an" * l10n: Replace a word * l10n: Replace a word * [tx-robot] updated from transifex Signed-off-by: Nextcloud bot * Update lib/Migration/Version20002Date20220201085856.php Co-authored-by: Vitor Mattos * valide * valide * final * Final * Final * Hotfix 2.0.2 * Hotfix 2.0.3 Co-authored-by: Vitor Mattos Co-authored-by: Nextcloud bot Co-authored-by: rakekniven <2069590+rakekniven@users.noreply.github.com> Co-authored-by: Valdnet <47037905+Valdnet@users.noreply.github.com> --- js/856.app.js.LICENSE.txt | 0 js/856.devisShow.app.js.LICENSE.txt | 0 js/856.factureShow.app.js.LICENSE.txt | 0 js/client.app.js.LICENSE.txt | 0 js/configuration.app.js.LICENSE.txt | 0 js/devis.app.js.LICENSE.txt | 0 js/devisShow.app.js.LICENSE.txt | 0 js/facture.app.js.LICENSE.txt | 0 js/factureShow.app.js.LICENSE.txt | 0 js/main.app.js.LICENSE.txt | 0 js/produit.app.js.LICENSE.txt | 0 js/statistique.app.js.LICENSE.txt | 0 .../Version20002Date20220201085856.php | 37 ++++++++++++------- 13 files changed, 23 insertions(+), 14 deletions(-) mode change 100755 => 100644 js/856.app.js.LICENSE.txt mode change 100755 => 100644 js/856.devisShow.app.js.LICENSE.txt mode change 100755 => 100644 js/856.factureShow.app.js.LICENSE.txt mode change 100755 => 100644 js/client.app.js.LICENSE.txt mode change 100755 => 100644 js/configuration.app.js.LICENSE.txt mode change 100755 => 100644 js/devis.app.js.LICENSE.txt mode change 100755 => 100644 js/devisShow.app.js.LICENSE.txt mode change 100755 => 100644 js/facture.app.js.LICENSE.txt mode change 100755 => 100644 js/factureShow.app.js.LICENSE.txt mode change 100755 => 100644 js/main.app.js.LICENSE.txt mode change 100755 => 100644 js/produit.app.js.LICENSE.txt mode change 100755 => 100644 js/statistique.app.js.LICENSE.txt diff --git a/js/856.app.js.LICENSE.txt b/js/856.app.js.LICENSE.txt old mode 100755 new mode 100644 diff --git a/js/856.devisShow.app.js.LICENSE.txt b/js/856.devisShow.app.js.LICENSE.txt old mode 100755 new mode 100644 diff --git a/js/856.factureShow.app.js.LICENSE.txt b/js/856.factureShow.app.js.LICENSE.txt old mode 100755 new mode 100644 diff --git a/js/client.app.js.LICENSE.txt b/js/client.app.js.LICENSE.txt old mode 100755 new mode 100644 diff --git a/js/configuration.app.js.LICENSE.txt b/js/configuration.app.js.LICENSE.txt old mode 100755 new mode 100644 diff --git a/js/devis.app.js.LICENSE.txt b/js/devis.app.js.LICENSE.txt old mode 100755 new mode 100644 diff --git a/js/devisShow.app.js.LICENSE.txt b/js/devisShow.app.js.LICENSE.txt old mode 100755 new mode 100644 diff --git a/js/facture.app.js.LICENSE.txt b/js/facture.app.js.LICENSE.txt old mode 100755 new mode 100644 diff --git a/js/factureShow.app.js.LICENSE.txt b/js/factureShow.app.js.LICENSE.txt old mode 100755 new mode 100644 diff --git a/js/main.app.js.LICENSE.txt b/js/main.app.js.LICENSE.txt old mode 100755 new mode 100644 diff --git a/js/produit.app.js.LICENSE.txt b/js/produit.app.js.LICENSE.txt old mode 100755 new mode 100644 diff --git a/js/statistique.app.js.LICENSE.txt b/js/statistique.app.js.LICENSE.txt old mode 100755 new mode 100644 diff --git a/lib/Migration/Version20002Date20220201085856.php b/lib/Migration/Version20002Date20220201085856.php index e95e57f8..e1abc491 100755 --- a/lib/Migration/Version20002Date20220201085856.php +++ b/lib/Migration/Version20002Date20220201085856.php @@ -14,6 +14,8 @@ class Version20002Date20220201085856 extends SimpleMigrationStep { private $rows_client = []; private $rows_configuration = []; private IDbConnection $db; + private $detect_client = false; + private $detect_configuration = false; public function __construct(IDbConnection $db){ $this->db = $db; @@ -34,6 +36,7 @@ public function preSchemaChange(IOutput $output, Closure $schemaClosure, array $ $query ->select('id', 'siret') ->from($tableprefix.'client'); $this->rows_client = $query->execute()->fetchAll(); + $this->detect_client = true; } //Configuration @@ -42,6 +45,7 @@ public function preSchemaChange(IOutput $output, Closure $schemaClosure, array $ $query ->select('id', 'siret', 'siren') ->from($tableprefix.'configuration'); $this->rows_configuration = $query->execute()->fetchAll(); + $this->detect_configuration = true; } } @@ -91,20 +95,25 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt * @param array $options */ public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void { - //Client - foreach ($this->rows_client as $row) { - $qb = $this->db->getQueryBuilder(); - $qb - ->update('gestion_client') - ->set('legal_one', $qb->createNamedParameter($row['siret'])) - ->where($qb->expr()->eq('id', $qb->createNamedParameter($row['id']))) - ->execute(); - } + $schema = $schemaClosure(); + $tableprefix = "gestion_"; - //Configuration - foreach ($this->rows_configuration as $row) { - $qb = $this->db->getQueryBuilder(); - $qb + if($this->detect_client){ + //Client + foreach ($this->rows_client as $row) { + $qb = $this->db->getQueryBuilder(); + $qb + ->update('gestion_client') + ->set('legal_one', $qb->createNamedParameter($row['siret'])) + ->where($qb->expr()->eq('id', $qb->createNamedParameter($row['id']))) + ->execute(); + } + } + if($this->detect_configuration){ + //Configuration + foreach ($this->rows_configuration as $row) { + $qb = $this->db->getQueryBuilder(); + $qb ->update('gestion_configuration') ->set('legal_one', $qb->createNamedParameter($row['siret'])) ->where($qb->expr()->eq('id', $qb->createNamedParameter($row['id']))) @@ -115,7 +124,7 @@ public function postSchemaChange(IOutput $output, Closure $schemaClosure, array ->set('legal_two', $qb->createNamedParameter($row['siren'])) ->where($qb->expr()->eq('id', $qb->createNamedParameter($row['id']))) ->execute(); + } } - } }