diff --git a/admin/index.php b/admin/index.php index 29d2d99..ee581d6 100644 --- a/admin/index.php +++ b/admin/index.php @@ -13,11 +13,19 @@ $form->runIf(f('archiver') && !$form->hasErrors(), function () use($facture) { foreach(f('selected') as $f) { - $facture->archiver($f); + $facture->archiver($f, 1); } }, 'archiver_factures'); +$form->runIf(f('desarchiver') && !$form->hasErrors(), + function () use($facture) + { + foreach(f('selected') as $f) { + $facture->archiver($f, 0); + } + + }, 'desarchiver_factures'); $archive = isset($_GET['archive']) && $_GET['archive'] == 1; $list = $facture->list(! $archive); diff --git a/lib/Facture.php b/lib/Facture.php index 761683f..e6f766e 100644 --- a/lib/Facture.php +++ b/lib/Facture.php @@ -559,10 +559,10 @@ class Facture return DB::getInstance()->delete('plugin_facturation_factures', 'id = '. (int)$id); } - public function archiver($id) + public function archiver($id, $archive) { $f = $this->get($id); - $f->archivee = 1; + $f->archivee = $archive; $f->date_emission = $f->date_emission->format('d/m/Y'); $f->date_echeance = $f->date_echeance->format('d/m/Y'); $id = $f->id; diff --git a/templates/_style.css b/templates/_style.css index f860f56..c38b377 100644 --- a/templates/_style.css +++ b/templates/_style.css @@ -18,4 +18,8 @@ div.aide ul { padding: 1em; } +div.flex { + display: flex; + justify-content : space-between; +} {/literal} diff --git a/templates/index.tpl b/templates/index.tpl index 92d727c..af0d181 100644 --- a/templates/index.tpl +++ b/templates/index.tpl @@ -13,7 +13,7 @@ {foreach from=$list->iterate() item="facture"}
- Export de la liste : - {linkbutton href="?export=csv" label="Export CSV" shape="download"} - {linkbutton href="?export=ods" label="Export tableur" shape="download"} -
-{if !$archive} -+
Aucun document, vous pouvez commencer par {link href="facture_ajouter.php" label="créer un nouveau document"}.
{/if}