Overview
Comment:Fix check of non-duplicate service
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 2d78d5785296ba3a793c92e3784528e3a7708013
User & Date: bohwaz on 2020-12-24 18:50:18
Other Links: manifest | tags
Context
2020-12-24
18:55
Fix default expiry date check-in: b4c1ee022b user: bohwaz tags: trunk
18:50
Fix check of non-duplicate service check-in: 2d78d57852 user: bohwaz tags: trunk
2020-12-21
21:49
Fix 486/487 account for 2018 chart check-in: 4e9a6a5bb5 user: bohwaz tags: trunk
Changes

Modified src/include/lib/Garradin/Entities/Services/Service_User.php from [e6951573f4] to [4e65f9f372].

37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
	protected $_service, $_fee;

	public function selfCheck(): void
	{
		$this->paid = (bool) $this->paid;
		$this->assert($this->id_service, 'Aucune activité spécifiée');
		$this->assert($this->id_user, 'Aucun membre spécifié');
		$this->assert(!$this->exists() && !DB::getInstance()->test(self::TABLE, 'id_user = ? AND id_service = ? AND date = ?', $this->id_user, $this->id_service, $this->date->format('Y-m-d')), 'Cette activité a déjà été enregistrée pour ce membre et cette date');
	}

	public function importForm(?array $source = null)
	{
		if (null === $source) {
			$source = $_POST;
		}







|







37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
	protected $_service, $_fee;

	public function selfCheck(): void
	{
		$this->paid = (bool) $this->paid;
		$this->assert($this->id_service, 'Aucune activité spécifiée');
		$this->assert($this->id_user, 'Aucun membre spécifié');
		$this->assert($this->id || !DB::getInstance()->test(self::TABLE, 'id_user = ? AND id_service = ? AND date = ?', $this->id_user, $this->id_service, $this->date->format('Y-m-d')), 'Cette activité a déjà été enregistrée pour ce membre et cette date');
	}

	public function importForm(?array $source = null)
	{
		if (null === $source) {
			$source = $_POST;
		}