Overview
Comment:Prototype of advanced select, using external list from an iframe
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | dev
Files: files | file ages | folders
SHA1: a527b1e7f9cfe5f10cc3d914cb6ac4ecfe12867d
User & Date: bohwaz on 2020-09-10 00:41:18
Other Links: branch diff | manifest | tags
Context
2020-09-10
15:36
Sélecteur de compte fonctionnel check-in: b7d307b8a5 user: bohwaz tags: dev
00:41
Prototype of advanced select, using external list from an iframe check-in: a527b1e7f9 user: bohwaz tags: dev
00:20
Remove journals, they are in the account list already check-in: 2a5e843600 user: bohwaz tags: dev
Changes

Modified src/include/lib/Garradin/Template.php from [b87b02ae79] to [291822c871].

212
213
214
215
216
217
218




219
220
221
222
223
224
225
...
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261

		// Create attributes string
		if (array_key_exists('required', $attributes)) {
			$attributes['required'] = 'required';
		}

		$attributes_string = $attributes;





		array_walk($attributes_string, function (&$v, $k) {
			$v = sprintf('%s="%s"', $k, $v);
		});

		$attributes_string = implode(' ', $attributes_string);

................................................................................

			$input .= '</select>';
		}
		elseif ($type == 'textarea') {
			$input = sprintf('<textarea %s>%s</textarea>', $attributes_string, $this->escape($current_value));
		}
		elseif ($type == 'list') {
			$input = sprintf('<span id="%s_container" class="input-list"><input type="hidden" name="%s" value="%s" /><span class="value">%3$s</span><button type="button" id="%1$s" data-icon="%s" name="list_selector[%2$s]" class="icn-btn" value="%s">%s</button></span>', $this->escape($attributes['id']), $this->escape($name), $this->escape($current_value), Utils::iconUnicode('menu'), $this->escape($attributes['target']), 'Sélectionner');
		}
		else {
			$input = sprintf('<input type="%s" %s value="%s" />', $type, $attributes_string, $this->escape($current_value));
		}

		// No label? then we only want the input without the widget
		if (empty($label)) {







>
>
>
>







 







|







212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
...
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265

		// Create attributes string
		if (array_key_exists('required', $attributes)) {
			$attributes['required'] = 'required';
		}

		$attributes_string = $attributes;

		if ($type == 'list') {
			unset($attributes_string['target']);
		}

		array_walk($attributes_string, function (&$v, $k) {
			$v = sprintf('%s="%s"', $k, $v);
		});

		$attributes_string = implode(' ', $attributes_string);

................................................................................

			$input .= '</select>';
		}
		elseif ($type == 'textarea') {
			$input = sprintf('<textarea %s>%s</textarea>', $attributes_string, $this->escape($current_value));
		}
		elseif ($type == 'list') {
			$input = sprintf('<span id="%s_container" class="input-list"><input type="hidden" value="%s" %s /><span class="value">%2$s</span><button type="button" data-icon="%s" name="list_selector[%2$s]" class="icn-btn" value="%s">%s</button></span>', $this->escape($attributes['id']), $this->escape($current_value), $attributes_string, Utils::iconUnicode('menu'), $this->escape($attributes['target']), 'Sélectionner');
		}
		else {
			$input = sprintf('<input type="%s" %s value="%s" />', $type, $attributes_string, $this->escape($current_value));
		}

		// No label? then we only want the input without the widget
		if (empty($label)) {

Modified src/templates/acc/transactions/new.tpl from [f1b8abb95a] to [55ceff898a].

33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
			{input type="text" name="reference_paiement" label="Référence de paiement" help="Numéro de chèque, numéro de transaction CB, etc."}
		</dl>
	</fieldset>

	<fieldset data-types="transfer">
		<legend>Virement</legend>
		<dl>
			{input type="list" target="bank cash outstanding" name="from" label="De" required=1}
			{input type="list" target="bank cash outstanding" name="to" label="Vers" required=1}
		</dl>
	</fieldset>

	<fieldset data-types="revenue">
		<legend>Recette</legend>
		<dl>
			{input type="list" target="revenue" name="from" label="Type de recette" required=1}
			{input type="list" target="bank cash outstanding" name="to" label="Compte d'encaissement" required=1}
		</dl>
	</fieldset>

	<fieldset data-types="expense">
		<legend>Dépense</legend>
		<dl>
			{input type="list" target="expense" name="to" label="Type de dépense" required=1}
			{input type="list" target="bank cash outstanding" name="from" label="Compte de décaissement" required=1}
		</dl>
	</fieldset>

	<fieldset data-types="debt">
		<legend>Dette</legend>
		<dl>
			{input type="list" target="thirdparty" name="to" label="Compte de tiers" required=1}
			{input type="list" target="bank cash outstanding" name="from" label="Type de dette" required=1}
		</dl>
	</fieldset>

	<fieldset data-types="debt">
		<legend>Créance</legend>
		<dl>
			{input type="list" target="thirdparty" name="to" label="Compte de tiers" required=1}
			{input type="list" target="bank cash outstanding" name="from" label="Type de dette" required=1}
		</dl>
	</fieldset>

	<fieldset>
		<legend>Détails</legend>
		<dl>
			{input type="ajax-complete" multiple=true name="membre" label="Membres associés"}
			{input type="text" name="numero_piece" label="Numéro de pièce comptable"}
			{input type="textarea" name="remarques" label="Remarques" rows=4 cols=30}

			{if count($analytical_accounts) > 0}
				{input type="select" name="analytical_account" label="Compte analytique (projet)" options=$analytical_accounts}
			{/if}
		</dl>







|
|







|







|







|







|






|







33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
			{input type="text" name="reference_paiement" label="Référence de paiement" help="Numéro de chèque, numéro de transaction CB, etc."}
		</dl>
	</fieldset>

	<fieldset data-types="transfer">
		<legend>Virement</legend>
		<dl>
			{input type="list" target="common" name="from" label="De" required=1}
			{input type="list" target="common" name="to" label="Vers" required=1}
		</dl>
	</fieldset>

	<fieldset data-types="revenue">
		<legend>Recette</legend>
		<dl>
			{input type="list" target="revenue" name="from" label="Type de recette" required=1}
			{input type="list" target="common" name="to" label="Compte d'encaissement" required=1}
		</dl>
	</fieldset>

	<fieldset data-types="expense">
		<legend>Dépense</legend>
		<dl>
			{input type="list" target="expense" name="to" label="Type de dépense" required=1}
			{input type="list" target="common" name="from" label="Compte de décaissement" required=1}
		</dl>
	</fieldset>

	<fieldset data-types="debt">
		<legend>Dette</legend>
		<dl>
			{input type="list" target="thirdparty" name="to" label="Compte de tiers" required=1}
			{input type="list" target="common" name="from" label="Type de dette" required=1}
		</dl>
	</fieldset>

	<fieldset data-types="debt">
		<legend>Créance</legend>
		<dl>
			{input type="list" target="thirdparty" name="to" label="Compte de tiers" required=1}
			{input type="list" target="common" name="from" label="Type de dette" required=1}
		</dl>
	</fieldset>

	<fieldset>
		<legend>Détails</legend>
		<dl>
			{input type="list" multiple=true name="membre" label="Membres associés" target="add"}
			{input type="text" name="numero_piece" label="Numéro de pièce comptable"}
			{input type="textarea" name="remarques" label="Remarques" rows=4 cols=30}

			{if count($analytical_accounts) > 0}
				{input type="select" name="analytical_account" label="Compte analytique (projet)" options=$analytical_accounts}
			{/if}
		</dl>