From 899bf027757a9c21a3885e9061776f7561822ee3 Mon Sep 17 00:00:00 2001 From: Noizette Date: Fri, 4 Aug 2023 17:41:29 +0200 Subject: [PATCH] Fix install, use Paheko sign, fix $plugin vars --- admin/index.php | 2 +- admin/pdf.php | 5 +++-- data/default_sign.png | Bin 5689 -> 0 bytes install.php | 3 --- {www/public => public}/cerfa-1.png | Bin {www/public => public}/cerfa-2.png | Bin templates/aide.tpl | 2 +- templates/client.tpl | 2 +- templates/client_modifier.tpl | 2 +- templates/client_supprimer.tpl | 2 +- templates/clients.tpl | 2 +- templates/facture.tpl | 2 +- templates/facture_ajouter.tpl | 2 +- templates/facture_modifier.tpl | 2 +- templates/facture_supprimer.tpl | 2 +- templates/index.tpl | 2 +- 16 files changed, 14 insertions(+), 16 deletions(-) delete mode 100644 data/default_sign.png rename {www/public => public}/cerfa-1.png (100%) rename {www/public => public}/cerfa-2.png (100%) diff --git a/admin/index.php b/admin/index.php index e402ec5..3a6df02 100644 --- a/admin/index.php +++ b/admin/index.php @@ -12,4 +12,4 @@ $list->loadFromQueryString(); $tpl->assign(compact('list')); -$tpl->display(PLUGIN_ROOT . '/templates/index.tpl'); +$tpl->display(PLUGIN_ROOT . '/templates/index.tpl'); \ No newline at end of file diff --git a/admin/pdf.php b/admin/pdf.php index 8c0fd6a..1b07649 100644 --- a/admin/pdf.php +++ b/admin/pdf.php @@ -9,6 +9,7 @@ $users = new Users\Users; f(['id' => 'required|numeric']); $id = (int) qg('id'); $id_field = Users\DynamicFields::getNameFieldsSQL(); +$sign_tag = UserTemplate\Functions::signature(); // Vérification que le document existe if (!$f = $facture->get($id)) @@ -94,7 +95,7 @@ if ($f->type_facture != CERFA) { $echeance = ($f->type_facture?'Échéance de paiement':'Échéance du devis')." : ".$echeance; $reglee = !$f->reglee?'Cette facture est en attente de règlement.':'Cette facture a été reglée.'; - $footer = str_replace("\n", '
', $plugin->getConfig('footer')); + $footer = str_replace("\n", '
', $plugin->getConfig('footer') ?? '[Pied de page à configurer]'); $ttc = $plugin->getConfig('ttc') ? 'TTC':'HT'; // Génération du contenu de la facture @@ -480,7 +481,7 @@ elseif ($f->type_facture == CERFA)
{$t['m2']}
{$t['Y2']}
-
+
{$sign_tag}
diff --git a/data/default_sign.png b/data/default_sign.png deleted file mode 100644 index 38aa69f5125704713a5cb9ed6b24542f3a2b37cc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5689 zcmb_==QkXV^YxM-dRcZwh~784s3BUSmqb}Xuv#S1d$;;pC030Z@=>BM5iM9^_1;T# zqFW_8>zD7}@H}VEy>rfeF*9f8#hh~y`noSE$(YCh005Uv@pq04* z06~PKii*C5iVB;nyNkW!M>_z3FDWSLnfkBi%veja!UBe9Z@$$}`Ld=oZLSjn^!dsq z3~#(d8vl}KN^tQDC4_xwZ%@RQh9he$sVc+RE(lit{P}N-gBvf*|2^htxq%gT@a$lb z0RJNLoBcH7m-lH&x;zmdosAx}7El{R&~~JBY6t1kzdmHPJU=`-6&kAjIeaT~mHM+6 zkoR1^-}4v8B3tg_ch8~gPFiCW{i?^RLAa3mO^?^?hSZQ+^sT%&%y#UglNOdg)9y}E zi^`|dqwA(O`WhHAWfyq@a;SS{QxR|sjyj&}6PtFVVn?V!lp+8RB~uLGkPqtnWmMF5FzO)o4 z|5Hd^)lEGB03pu*fxx#=(fglB;;EsdMzTT92&85~E#4dcCq493gLRjt)X>p4fm4A20D4*tRV72;x&0i!pB8J4-EEuM+V_(_vmq$LCY(A` zO4+-RjHMC+|HU)*sj1b~$2K+0WeRB;ZMR5%k7CrE^mMc+9V^W@N6{GS7=<^t5*-Om)R&u;^VHn{@YKJ2$l`7NC)oZM4>z#c*K|C~(hr~!`I0|#= zRj?jR>D!L|MsoZ3K~gUPhHjbDDlzW7>QL=iq}nb)yOsFx$+8n`fH|cl&e!TifzMtM zKbwH)L|zdR?&9!s=~2T7?}Us@fx6!E3)YhY!TP$MD~vE)4P%BuT%91_dy+UG_O>uy zxOZjjhqe*EF3aBK#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E zu7Pr=t?)}L9-Bgc?45&SBMkn-qxwBRFO3drRKn%LJ~9x?#>}f*xp1gKZ6mzzN!TXu5r?8PdtmJ1*W~_lH0E{SGto; zYo@KCuj)FMPG~1v4MOo<{_;YqJ@WvJPNP4hq6eX#haSNL^BJ5qfyIm(Ro26{n#tHAv>TyoA-iF*i)`WC1;AXoKMP4OX7lZOyvEIf(YB z(d48NKo`|XYhkG#B53n1^2(cN+j4T_F)AKa9U%SR6OTn!-S2NB^Nb;@r4O zMRpC^|xxjo4C~JJX=O|stW1JqSgvnvey-+GRkWBFhF8TwDgWF_>aG8TR-I$ zFy_tX1DHaOC&X4^c=^@0i}~Y`M`iPcVQvLNGkG)TH%8@5YcB*Z#n*$tUW5AO&PLVd z3%I6^K0bkGgu9iefLWc0h>}M|1Z|yUwuQ;GPGM=(Eu}AiM7ips~%i@~_7q1rk#$Ddf`N~pT>fTqcM`{kX5+DxN zzX`YET^}{(r>64}+w%zZsaU@Y9w$~R5KosRgF^3e-c4gt*TQC z1RXZG3|$w~_0uwJXEneDj~re%-fW9P%&e4SGP$ZgsVvz>HStvXvp+MpqZq%L(0Tp^@zM77}V9 z*sICzPUtvR@32+;zU-#+{fV^bL!%O~WS=Z%7-8XEFW_s=I*MMGls&r1#pP7pQ=d1CI{h;FWT?|&G4j7S}8rcV( z_GGq-O#N5ETA}#Ij~bo`2FWimW$;Tw5b@d0Fvb6O|sgKln3rNXnWq4_mVxtfgm}5OnXvU4w1e7_A zMi2>FuH5+7^?nf-atD%P$JeR&H(?*$SxV5p(X54|Arz;M zz9?72fWKu!xmAk`<)`00SuRnnS*`2ieyE diff --git a/install.php b/install.php index 7ae8274..9393594 100644 --- a/install.php +++ b/install.php @@ -7,7 +7,4 @@ $db = DB::getInstance(); $db->import(dirname(__FILE__) . "/data/schema.sql"); -$path = __DIR__.'/data/default_sign.png'; -$png = (new File)->createAndStore('skel/plugin/facturation','sign.png', $path, null); - $plugin->registerSignal('menu.item', [Facture::class, 'menuItem']); \ No newline at end of file diff --git a/www/public/cerfa-1.png b/public/cerfa-1.png similarity index 100% rename from www/public/cerfa-1.png rename to public/cerfa-1.png diff --git a/www/public/cerfa-2.png b/public/cerfa-2.png similarity index 100% rename from www/public/cerfa-2.png rename to public/cerfa-2.png diff --git a/templates/aide.tpl b/templates/aide.tpl index 62ac020..d82931e 100644 --- a/templates/aide.tpl +++ b/templates/aide.tpl @@ -1,4 +1,4 @@ -{include file="_head.tpl" title="Aide — %s"|args:$plugin.nom current="plugin_%s"|args:$plugin.id} +{include file="_head.tpl" title="Aide — %s"|args:$plugin.name current="plugin_%s"|args:$plugin.id} {include file="%s/templates/_menu.tpl"|args:$plugin_root current="aide"}
diff --git a/templates/client.tpl b/templates/client.tpl index 8ac2c7f..08cb1d9 100644 --- a/templates/client.tpl +++ b/templates/client.tpl @@ -1,4 +1,4 @@ -{include file="_head.tpl" title="Client — %s"|args:$plugin.nom current="plugin_%s"|args:$plugin.id js=0} +{include file="_head.tpl" title="Client — %s"|args:$plugin.name current="plugin_%s"|args:$plugin.id js=0} {include file="%s/templates/_menu_client.tpl"|args:$plugin_root current="client"}
diff --git a/templates/client_modifier.tpl b/templates/client_modifier.tpl index 65c4dbe..d3a3f38 100644 --- a/templates/client_modifier.tpl +++ b/templates/client_modifier.tpl @@ -1,4 +1,4 @@ -{include file="_head.tpl" title="Modifier un client — %s"|args:$plugin.nom current="plugin_%s"|args:$plugin.id js=0} +{include file="_head.tpl" title="Modifier un client — %s"|args:$plugin.name current="plugin_%s"|args:$plugin.id js=0} {include file="%s/templates/_menu_client.tpl"|args:$plugin_root current="client_modifier"} {form_errors} diff --git a/templates/client_supprimer.tpl b/templates/client_supprimer.tpl index 7940b33..de3becb 100644 --- a/templates/client_supprimer.tpl +++ b/templates/client_supprimer.tpl @@ -1,4 +1,4 @@ -{include file="_head.tpl" title="Supprimer un client — %s"|args:$plugin.nom current="plugin_%s"|args:$plugin.id js=0} +{include file="_head.tpl" title="Supprimer un client — %s"|args:$plugin.name current="plugin_%s"|args:$plugin.id js=0} {include file="%s/templates/_menu_client.tpl"|args:$plugin_root current="client_supprimer"} {if !$deletable} diff --git a/templates/clients.tpl b/templates/clients.tpl index 38d5619..6c6bb9d 100644 --- a/templates/clients.tpl +++ b/templates/clients.tpl @@ -1,4 +1,4 @@ -{include file="_head.tpl" title="Clients — %s"|args:$plugin.nom current="plugin_%s"|args:$plugin.id js=1} +{include file="_head.tpl" title="Clients — %s"|args:$plugin.name current="plugin_%s"|args:$plugin.id js=1} {include file="%s/templates/_menu.tpl"|args:$plugin_root current="clients"} {if $list->count()} diff --git a/templates/facture.tpl b/templates/facture.tpl index 8ea6ca0..9248779 100644 --- a/templates/facture.tpl +++ b/templates/facture.tpl @@ -1,4 +1,4 @@ -{include file="_head.tpl" title="Document — %s"|args:$plugin.nom current="plugin_%s"|args:$plugin.id} +{include file="_head.tpl" title="Document — %s"|args:$plugin.name current="plugin_%s"|args:$plugin.id} {include file="%s/templates/_menu.tpl"|args:$plugin_root current="index"} {form_errors} diff --git a/templates/facture_ajouter.tpl b/templates/facture_ajouter.tpl index c97ee4f..e4add63 100644 --- a/templates/facture_ajouter.tpl +++ b/templates/facture_ajouter.tpl @@ -1,4 +1,4 @@ -{include file="_head.tpl" title="Créer un document — %s"|args:$plugin.nom current="plugin_%s"|args:$plugin.id js=1} +{include file="_head.tpl" title="Créer un document — %s"|args:$plugin.name current="plugin_%s"|args:$plugin.id js=1} {include file="%s/templates/_menu.tpl"|args:$plugin_root current="facture"} {include file="%s/templates/_form.tpl"|args:$plugin_root} diff --git a/templates/facture_modifier.tpl b/templates/facture_modifier.tpl index d2d9496..77dd30b 100644 --- a/templates/facture_modifier.tpl +++ b/templates/facture_modifier.tpl @@ -1,4 +1,4 @@ -{include file="_head.tpl" title="Modifier un document — %s"|args:$plugin.nom current="plugin_%s"|args:$plugin.id js=1} +{include file="_head.tpl" title="Modifier un document — %s"|args:$plugin.name current="plugin_%s"|args:$plugin.id js=1} {include file="%s/templates/_menu.tpl"|args:$plugin_root current="index"} {include file="%s/templates/_form.tpl"|args:$plugin_root} diff --git a/templates/facture_supprimer.tpl b/templates/facture_supprimer.tpl index 0d13668..4ba5791 100644 --- a/templates/facture_supprimer.tpl +++ b/templates/facture_supprimer.tpl @@ -1,4 +1,4 @@ -{include file="_head.tpl" title="Supprimer un document — %s"|args:$plugin.nom current="plugin_%s"|args:$plugin.id js=0} +{include file="_head.tpl" title="Supprimer un document — %s"|args:$plugin.name current="plugin_%s"|args:$plugin.id js=0} {include file="%s/templates/_menu.tpl"|args:$plugin_root current="index"} {form_errors} diff --git a/templates/index.tpl b/templates/index.tpl index f759a75..94093b5 100644 --- a/templates/index.tpl +++ b/templates/index.tpl @@ -1,4 +1,4 @@ -{include file="_head.tpl" title="Documents — %s"|args:$plugin.nom current="plugin_%s"|args:$plugin.id} +{include file="_head.tpl" title="Documents — %s"|args:$plugin.name current="plugin_%s"|args:$plugin.id} {include file="%s/templates/_menu.tpl"|args:$plugin_root current="index"} {form_errors}