Overview
Comment:Improve UX: move transaction reference, add optional label
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | dev | 1.0.0-alpha4
Files: files | file ages | folders
SHA1: 5f80e039453e189b0cb0c2711520fc1196bd56a4
User & Date: bohwaz on 2020-11-03 23:24:19
Other Links: branch diff | manifest | tags
Context
2020-11-04
01:21
Fix migration when accounts come from a category that is not suited to the type check-in: 41ba247dab user: bohwaz tags: dev, 1.0.0-alpha4
2020-11-03
23:24
Improve UX: move transaction reference, add optional label check-in: 5f80e03945 user: bohwaz tags: dev, 1.0.0-alpha4
16:43
Improve UX for new transactions and accounts journals check-in: 27d02f3f9f user: bohwaz tags: dev, 1.0.0-alpha4
Changes

Modified src/include/lib/Garradin/Template.php from [7b61bf8318] to [ec256363eb].

334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358







359
360
361
362
363
364
365
366
		}

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

		$required_label = array_key_exists('required', $attributes) ? ' <b title="Champ obligatoire">(obligatoire)</b>' : '';

		if ($type == 'file') {
			$input .= sprintf('<input type="hidden" name="MAX_FILE_SIZE" value="%d" id="f_maxsize" />', Utils::return_bytes(Utils::getMaxUploadSize()));
		}

		$label = sprintf('<label for="%s">%s</label>%s', $attributes['id'], $this->escape($label), $required_label);

		if ($type == 'radio' || $type == 'checkbox') {
			$out = sprintf('<dd>%s %s', $input, $label);

			if (isset($help)) {
				$out .= sprintf(' <em class="help">(%s)</em>', $this->escape($help));
			}

			$out .= '</dd>';
		}
		else {







			$out = sprintf('<dt>%s</dt><dd>%s</dd>', $label, $input);

			if (isset($help)) {
				$out .= sprintf('<dd class="help">%s</dd>', $this->escape($help));
			}
		}

		return $out;







<
<




|











>
>
>
>
>
>
>
|







334
335
336
337
338
339
340


341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
		}

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



		if ($type == 'file') {
			$input .= sprintf('<input type="hidden" name="MAX_FILE_SIZE" value="%d" id="f_maxsize" />', Utils::return_bytes(Utils::getMaxUploadSize()));
		}

		$label = sprintf('<label for="%s">%s</label>', $attributes['id'], $this->escape($label));

		if ($type == 'radio' || $type == 'checkbox') {
			$out = sprintf('<dd>%s %s', $input, $label);

			if (isset($help)) {
				$out .= sprintf(' <em class="help">(%s)</em>', $this->escape($help));
			}

			$out .= '</dd>';
		}
		else {
			if (array_key_exists('required', $attributes)) {
				$required_label =  ' <b title="Champ obligatoire">(obligatoire)</b>';
			}
			else {
				$required_label =  ' <i>(facultatif)</i>';
			}

			$out = sprintf('<dt>%s%s</dt><dd>%s</dd>', $label, $required_label, $input);

			if (isset($help)) {
				$out .= sprintf('<dd class="help">%s</dd>', $this->escape($help));
			}
		}

		return $out;

Modified src/templates/acc/transactions/new.tpl from [c4b719a329] to [fdbb569d57].

38
39
40
41
42
43
44

45
46
47
48
49
50
51
	{/if}

	<fieldset>
		<legend>Informations</legend>
		<dl>
			{input type="date" name="date" default=$date label="Date" required=1 source=$transaction}
			{input type="text" name="label" label="Libellé" required=1 source=$transaction}

		</dl>
		<dl data-types="all-but-advanced">
			{input type="money" name="amount" label="Montant" required=1 default=$amount}
		</dl>
	</fieldset>

	{if !$payoff_for}







>







38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
	{/if}

	<fieldset>
		<legend>Informations</legend>
		<dl>
			{input type="date" name="date" default=$date label="Date" required=1 source=$transaction}
			{input type="text" name="label" label="Libellé" required=1 source=$transaction}
			{input type="text" name="reference" label="Numéro de pièce comptable" help="Numéro de facture, de note de frais, etc."}
		</dl>
		<dl data-types="all-but-advanced">
			{input type="money" name="amount" label="Montant" required=1 default=$amount}
		</dl>
	</fieldset>

	{if !$payoff_for}
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83

	<fieldset>
		<legend>Détails facultatifs</legend>
		<dl data-types="t{$transaction::TYPE_REVENUE} t{$transaction::TYPE_EXPENSE} t{$transaction::TYPE_TRANSFER}">
			{input type="text" name="payment_reference" label="Référence de paiement" help="Numéro de chèque, numéro de transaction CB, etc." source=$transaction}
		</dl>
		<dl>
			{input type="text" name="reference" label="Numéro de pièce comptable" help="Numéro de facture, de note de frais, etc."}
			{input type="list" multiple=true name="users" label="Membres associés" target="membres/selector.php"}
			{input type="textarea" name="notes" label="Remarques" rows=4 cols=30}

			{input type="file" name="file" label="Fichier joint"}
		</dl>
		<dl data-types="all-but-advanced">
			{if count($analytical_accounts) > 0}







<







70
71
72
73
74
75
76

77
78
79
80
81
82
83

	<fieldset>
		<legend>Détails facultatifs</legend>
		<dl data-types="t{$transaction::TYPE_REVENUE} t{$transaction::TYPE_EXPENSE} t{$transaction::TYPE_TRANSFER}">
			{input type="text" name="payment_reference" label="Référence de paiement" help="Numéro de chèque, numéro de transaction CB, etc." source=$transaction}
		</dl>
		<dl>

			{input type="list" multiple=true name="users" label="Membres associés" target="membres/selector.php"}
			{input type="textarea" name="notes" label="Remarques" rows=4 cols=30}

			{input type="file" name="file" label="Fichier joint"}
		</dl>
		<dl data-types="all-but-advanced">
			{if count($analytical_accounts) > 0}

Modified src/www/admin/static/admin.css from [983e39caa1] to [33baa11446].

313
314
315
316
317
318
319







320
321
322
323
324
325
326

dl dt label {
    font-weight: bold;
}

fieldset dl dt b {
    color: #900;







    font-size: 0.7em;
    font-weight: normal;
    vertical-align: super;
}

fieldset dl dd.tip {
    color: #666;







>
>
>
>
>
>
>







313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333

dl dt label {
    font-weight: bold;
}

fieldset dl dt b {
    color: #900;
    font-size: 0.7em;
    font-weight: normal;
    vertical-align: super;
}

fieldset dl dt i {
    color: #999;
    font-size: 0.7em;
    font-weight: normal;
    vertical-align: super;
}

fieldset dl dd.tip {
    color: #666;