Overview
SHA1:32bff893e8fb86ee0f9431b61f947b08147539f7
Date: 2016-08-30 08:57:54
User: bohwaz
Comment:Ne pas cacher les cotisations dépassées
Timelines: family | ancestors | descendants | both | trunk | stable
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2016-08-30
09:11
[eed84af616] Ne pas permettre de modifier sa propre catégorie de membre, sinon risque de se tirer une balle dans le pied (user: bohwaz, tags: trunk, stable)
08:57
[32bff893e8] Ne pas cacher les cotisations dépassées (user: bohwaz, tags: trunk, stable)
2016-08-21
21:21
[c7e0066828] Fix référence à HTTP_ACCEPT_LANG qui n'est pas toujours présent (user: bohwaz, tags: trunk, stable)
Changes

Modified src/Makefile from [c42112d0d8] to [2766485477].

1
2
3
4
5
6
7
8
9
10
11
KD2_BRANCH=dev

deps:
	$(eval TMP_KD2=$(shell mktemp -d))
	cd ${TMP_KD2}

	wget https://fossil.kd2.org/kd2fw/zip/KD2+Framework-${KD2_BRANCH}.zip -O ${TMP_KD2}/kd2.zip
	unzip "${TMP_KD2}/kd2.zip" -d ${TMP_KD2}

	mv "${TMP_KD2}/KD2 Framework-${KD2_BRANCH}/src/lib/kd2" "include/lib/KD2"
	rm -rf ${TMP_KD2}
|










1
2
3
4
5
6
7
8
9
10
11
KD2_BRANCH=trunk

deps:
	$(eval TMP_KD2=$(shell mktemp -d))
	cd ${TMP_KD2}

	wget https://fossil.kd2.org/kd2fw/zip/KD2+Framework-${KD2_BRANCH}.zip -O ${TMP_KD2}/kd2.zip
	unzip "${TMP_KD2}/kd2.zip" -d ${TMP_KD2}

	mv "${TMP_KD2}/KD2 Framework-${KD2_BRANCH}/src/lib/kd2" "include/lib/KD2"
	rm -rf ${TMP_KD2}

Modified src/include/lib/Garradin/Cotisations.php from [f70e628896] to [331a22cb80].

158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
	public function listCurrent()
	{
		$db = DB::getInstance();
		return $db->simpleStatementFetch('SELECT * FROM cotisations WHERE fin >= date(\'now\') OR fin IS NULL
			ORDER BY transliterate_to_ascii(intitule) COLLATE NOCASE;');
	}

	public function listCurrentWithStats()
	{
		$db = DB::getInstance();
		return $db->simpleStatementFetch('SELECT co.*,
			(SELECT COUNT(DISTINCT id_membre) FROM cotisations_membres WHERE id_cotisation = co.id) AS nb_membres,
			(SELECT COUNT(DISTINCT id_membre) FROM cotisations_membres AS cm WHERE id_cotisation = co.id
				AND ((co.duree IS NOT NULL AND date(cm.date, \'+\'||co.duree||\' days\') >= date())
					OR (co.fin IS NOT NULL AND co.debut <= cm.date AND co.fin >= cm.date))) AS nb_a_jour
			FROM cotisations AS co WHERE fin >= date(\'now\') OR fin IS NULL
			ORDER BY transliterate_to_ascii(intitule) COLLATE NOCASE;');
	}
}

?>







|







|



<
<
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176


	public function listCurrent()
	{
		$db = DB::getInstance();
		return $db->simpleStatementFetch('SELECT * FROM cotisations WHERE fin >= date(\'now\') OR fin IS NULL
			ORDER BY transliterate_to_ascii(intitule) COLLATE NOCASE;');
	}

	public function listWithStats()
	{
		$db = DB::getInstance();
		return $db->simpleStatementFetch('SELECT co.*,
			(SELECT COUNT(DISTINCT id_membre) FROM cotisations_membres WHERE id_cotisation = co.id) AS nb_membres,
			(SELECT COUNT(DISTINCT id_membre) FROM cotisations_membres AS cm WHERE id_cotisation = co.id
				AND ((co.duree IS NOT NULL AND date(cm.date, \'+\'||co.duree||\' days\') >= date())
					OR (co.fin IS NOT NULL AND co.debut <= cm.date AND co.fin >= cm.date))) AS nb_a_jour
			FROM cotisations AS co
			ORDER BY transliterate_to_ascii(intitule) COLLATE NOCASE;');
	}
}


Modified src/www/admin/membres/cotisations/index.php from [2819199d61] to [0477202564].

50
51
52
53
54
55
56
57
58
59
60
61
	}

	$tpl->assign('error', $error);
	$tpl->assign('categories', $cats->getList(Compta\Categories::RECETTES));
}


$tpl->assign('liste', $cotisations->listCurrentWithStats());

$tpl->display('admin/membres/cotisations/index.tpl');

?>







|


<
<
50
51
52
53
54
55
56
57
58
59


	}

	$tpl->assign('error', $error);
	$tpl->assign('categories', $cats->getList(Compta\Categories::RECETTES));
}


$tpl->assign('liste', $cotisations->listWithStats());

$tpl->display('admin/membres/cotisations/index.tpl');