Index: src/include/lib/Garradin/Template.php
==================================================================
--- src/include/lib/Garradin/Template.php
+++ src/include/lib/Garradin/Template.php
@@ -72,11 +72,12 @@
$this->register_function('csrf_field', function ($params) {
return Form::tokenHTML($params['key']);
});
$this->register_function('icon', [$this, 'widgetIcon']);
- $this->register_function('button', [$this, 'widgetLinkButton']);
+ $this->register_function('button', [$this, 'widgetButton']);
+ $this->register_function('linkbutton', [$this, 'widgetLinkButton']);
$this->register_modifier('strlen', 'strlen');
$this->register_modifier('dump', ['KD2\ErrorManager', 'dump']);
$this->register_modifier('get_country_name', ['Garradin\Utils', 'getCountryName']);
$this->register_modifier('format_sqlite_date_to_french', ['Garradin\Utils', 'sqliteDateToFrench']);
@@ -170,10 +171,25 @@
return sprintf('%s', Utils::iconUnicode($params['shape']));
}
return sprintf('%s', $this->escape(ADMIN_URL . $params['href']), $this->escape($params['label']), Utils::iconUnicode($params['shape']));
}
+
+ protected function widgetButton(array $params): string
+ {
+ $icon = Utils::iconUnicode($params['shape']);
+ $label = $this->escape($params['label']);
+ unset($params['label'], $params['shape']);
+
+ array_walk($params, function (&$v, $k) {
+ $v = sprintf('%s="%s"', $k, $this->escape($v));
+ });
+
+ $params = implode(' ', $params);
+
+ return sprintf('', $params, $icon, $label);
+ }
protected function widgetLinkButton(array $params): string
{
return sprintf('%s', Utils::iconUnicode($params['shape']), $this->escape(ADMIN_URL . $params['href']), $this->escape($params['label']));
}
Index: src/templates/acc/accounts/selector.tpl
==================================================================
--- src/templates/acc/accounts/selector.tpl
+++ src/templates/acc/accounts/selector.tpl
@@ -19,14 +19,41 @@
{/foreach}
{/foreach}
+{else}
+
+
+
+
+
+ {foreach from=$accounts item="account"}
+
+ {$account.code} |
+ {$account.label} |
+
+
+ |
+
+ {/foreach}
+
+
+
{/if}
{literal}
{/literal}
{include file="admin/_foot.tpl"}
Index: src/templates/acc/transactions/new.tpl
==================================================================
--- src/templates/acc/transactions/new.tpl
+++ src/templates/acc/transactions/new.tpl
@@ -76,11 +76,11 @@
{* Saisie avancée *}