Skip to content

Commit

Permalink
Hotfix 2.0.3 (#139)
Browse files Browse the repository at this point in the history
* refactoring

* refactoring

refactoring

refactoring & #46

Create help section for configuration and #47 #61

changelog

[tx-robot] updated from transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

[tx-robot] updated from transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

[tx-robot] updated from transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

[tx-robot] updated from transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

* transifex

* transifex

* test

* Translation

* translation

* hotfix

* #123

* Update lib/Migration/Version20002Date20220201085856.php

Co-authored-by: Vitor Mattos <vitor@php.rio>

* Update lib/Migration/Version20002Date20220201085856.php

Co-authored-by: Vitor Mattos <vitor@php.rio>

* Update lib/Migration/Version7Date20220125174818.php

Co-authored-by: Vitor Mattos <vitor@php.rio>

* Update lib/Migration/Version7Date20220125174818.php

Co-authored-by: Vitor Mattos <vitor@php.rio>

* Update lib/Migration/Version7Date20220125174818.php

Co-authored-by: Vitor Mattos <vitor@php.rio>

* #135

* Update lib/Migration/Version20002Date20220201085856.php

Co-authored-by: Vitor Mattos <vitor@php.rio>

* valide

* valide

* final

* Final

* Final

* Update lib/Migration/Version20002Date20220201085856.php

Co-authored-by: Vitor Mattos <vitor@php.rio>

* Update lib/Migration/Version20002Date20220201085856.php

Co-authored-by: Vitor Mattos <vitor@php.rio>

* Update lib/Migration/Version7Date20220125174818.php

Co-authored-by: Vitor Mattos <vitor@php.rio>

* Update lib/Migration/Version7Date20220125174818.php

Co-authored-by: Vitor Mattos <vitor@php.rio>

* Update lib/Migration/Version7Date20220125174818.php

Co-authored-by: Vitor Mattos <vitor@php.rio>

* [tx-robot] updated from transifex

Signed-off-by: Nextcloud bot <bot@nextcloud.com>

* 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 <bot@nextcloud.com>

* Update lib/Migration/Version20002Date20220201085856.php

Co-authored-by: Vitor Mattos <vitor@php.rio>

* valide

* valide

* final

* Final

* Final

* Hotfix 2.0.2

* Hotfix 2.0.3

Co-authored-by: Vitor Mattos <vitor@php.rio>
Co-authored-by: Nextcloud bot <bot@nextcloud.com>
Co-authored-by: rakekniven <2069590+rakekniven@users.noreply.github.com>
Co-authored-by: Valdnet <47037905+Valdnet@users.noreply.github.com>
  • Loading branch information
5 people committed Feb 4, 2022
1 parent 22b5cd9 commit 6d0aa85
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 14 deletions.
Empty file modified js/856.app.js.LICENSE.txt
100755 → 100644
Empty file.
Empty file modified js/856.devisShow.app.js.LICENSE.txt
100755 → 100644
Empty file.
Empty file modified js/856.factureShow.app.js.LICENSE.txt
100755 → 100644
Empty file.
Empty file modified js/client.app.js.LICENSE.txt
100755 → 100644
Empty file.
Empty file modified js/configuration.app.js.LICENSE.txt
100755 → 100644
Empty file.
Empty file modified js/devis.app.js.LICENSE.txt
100755 → 100644
Empty file.
Empty file modified js/devisShow.app.js.LICENSE.txt
100755 → 100644
Empty file.
Empty file modified js/facture.app.js.LICENSE.txt
100755 → 100644
Empty file.
Empty file modified js/factureShow.app.js.LICENSE.txt
100755 → 100644
Empty file.
Empty file modified js/main.app.js.LICENSE.txt
100755 → 100644
Empty file.
Empty file modified js/produit.app.js.LICENSE.txt
100755 → 100644
Empty file.
Empty file modified js/statistique.app.js.LICENSE.txt
100755 → 100644
Empty file.
37 changes: 23 additions & 14 deletions lib/Migration/Version20002Date20220201085856.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand All @@ -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;
}
}

Expand Down Expand Up @@ -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'])))
Expand All @@ -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();
}
}

}
}

0 comments on commit 6d0aa85

Please sign in to comment.