Overview
Comment:Fix input of money amounts < 1
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | stable
Files: files | file ages | folders
SHA3-256: b9dde10b950d10fb334279b1d2bc7c11178b07838a24c473bb55277b2a73fd6c
User & Date: bohwaz on 2022-02-04 23:33:13
Other Links: manifest | tags
Context
2022-02-05
00:25
Fix PHP 8.1 errors check-in: 38ca403881 user: bohwaz tags: trunk
2022-02-04
23:33
Fix input of money amounts < 1 check-in: b9dde10b95 user: bohwaz tags: trunk, stable
13:27
Fix bug with required amount check-in: 9ad130f8b0 user: bohwaz tags: trunk, stable
Changes

Modified src/include/lib/Garradin/Template.php from [d00883882f] to [121bf94bfa].

467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
			$input = sprintf('<span id="%s_container" class="input-list">%s%s</span>', $this->escape($attributes['id']), $button, $values);
		}
		elseif ($type == 'money') {
			if (null !== $current_value && !$current_value_from_user) {
				$current_value = Utils::money_format($current_value, ',', '');
			}

			if ($current_value == 0) {
				$current_value = '';
			}

			$currency = Config::getInstance()->get('monnaie');
			$input = sprintf('<nobr><input type="text" pattern="[0-9]*([.,][0-9]{1,2})?" inputmode="decimal" size="8" class="money" %s value="%s" /><b>%s</b></nobr>', $attributes_string, $this->escape($current_value), $currency);
		}
		else {







|







467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
			$input = sprintf('<span id="%s_container" class="input-list">%s%s</span>', $this->escape($attributes['id']), $button, $values);
		}
		elseif ($type == 'money') {
			if (null !== $current_value && !$current_value_from_user) {
				$current_value = Utils::money_format($current_value, ',', '');
			}

			if ((string) $current_value === '0') {
				$current_value = '';
			}

			$currency = Config::getInstance()->get('monnaie');
			$input = sprintf('<nobr><input type="text" pattern="[0-9]*([.,][0-9]{1,2})?" inputmode="decimal" size="8" class="money" %s value="%s" /><b>%s</b></nobr>', $attributes_string, $this->escape($current_value), $currency);
		}
		else {