Overview
Comment:Conserve l'ordre de tri dans la pagination des listes de cotisations, et conserve la catégorie lors de la modif d'ordre dans la liste des membres
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | dev
Files: files | file ages | folders
SHA1: d8156f78659d505f0b64218cd73790e481757c56
User & Date: bohwaz on 2017-08-04 06:19:50
Other Links: branch diff | manifest | tags
Context
2017-08-04
06:59
Correction : doit être un objet check-in: 34b11356bc user: bohwaz tags: dev
06:19
Conserve l'ordre de tri dans la pagination des listes de cotisations, et conserve la catégorie lors de la modif d'ordre dans la liste des membres check-in: d8156f7865 user: bohwaz tags: dev
06:02
Corrige problèmes de mise à jour avec encore des dates bizarres pour le wiki, et l'ordre des colonnes qui a changé pour rappels_envoyes check-in: 6274ecf443 user: bohwaz tags: dev
Changes

Modified src/include/lib/Garradin/Template.php from [5392e23abe] to [44be2cd115].

22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
        self::setCompileDir(CACHE_ROOT . '/compiled');
        self::setTemplateDir(ROOT . '/templates');

        parent::__construct();

        $this->assign('www_url', WWW_URL);
        $this->assign('self_url', Utils::getSelfUrl());
        $this->assign('self_url_no_qs', Utils::getSelfUrl(true));

        $this->assign('is_logged', false);

        $this->register_compile_function('continue', function ($pos, $block, $name, $raw_args) {
            if ($block == 'continue')
            {
                return 'continue;';







|







22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
        self::setCompileDir(CACHE_ROOT . '/compiled');
        self::setTemplateDir(ROOT . '/templates');

        parent::__construct();

        $this->assign('www_url', WWW_URL);
        $this->assign('self_url', Utils::getSelfUrl());
        $this->assign('self_url_no_qs', Utils::getSelfUrl(false));

        $this->assign('is_logged', false);

        $this->register_compile_function('continue', function ($pos, $block, $name, $raw_args) {
            if ($block == 'continue')
            {
                return 'continue;';
277
278
279
280
281
282
283

284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306

    $pagination = Utils::getGenericPagination($params['page'], $params['total'], $params['bypage']);

    if (empty($pagination))
        return '';

    $out = '<ul class="pagination">';


    foreach ($pagination as &$page)
    {
        $attributes = '';

        if (!empty($page['class']))
            $attributes .= ' class="' . htmlspecialchars($page['class']) . '" ';

        $out .= '<li'.$attributes.'>';

        $attributes = '';

        if (!empty($page['accesskey']))
            $attributes .= ' accesskey="' . htmlspecialchars($page['accesskey']) . '" ';

        $out .= '<a' . $attributes . ' href="' . str_replace('[ID]', htmlspecialchars($page['id']), $params['url']) . '">';
        $out .= htmlspecialchars($page['label']);
        $out .= '</a>';
        $out .= '</li>' . "\n";
    }

    $out .= '</ul>';








>















|







277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307

    $pagination = Utils::getGenericPagination($params['page'], $params['total'], $params['bypage']);

    if (empty($pagination))
        return '';

    $out = '<ul class="pagination">';
    $encoded_url = rawurlencode('[ID]');

    foreach ($pagination as &$page)
    {
        $attributes = '';

        if (!empty($page['class']))
            $attributes .= ' class="' . htmlspecialchars($page['class']) . '" ';

        $out .= '<li'.$attributes.'>';

        $attributes = '';

        if (!empty($page['accesskey']))
            $attributes .= ' accesskey="' . htmlspecialchars($page['accesskey']) . '" ';

        $out .= '<a' . $attributes . ' href="' . str_replace(['[ID]', $encoded_url], htmlspecialchars($page['id']), $params['url']) . '">';
        $out .= htmlspecialchars($page['label']);
        $out .= '</a>';
        $out .= '</li>' . "\n";
    }

    $out .= '</ul>';

Modified src/include/lib/Garradin/Utils.php from [b7e5ac2f67] to [abf5be7fb1].

116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135





136
137
138
139
140
141
142
    {
        if (!empty($_SERVER['REQUEST_URI']))
            return $_SERVER['REQUEST_URI'];
        else
            return false;
    }

    static public function getSelfURL($no_qs = false)
    {
        $uri = self::getRequestUri();

        if (strpos($uri, WWW_URI) === 0)
        {
            $uri = substr($uri, strlen(WWW_URI));
        }

        if ($no_qs && (strpos($uri, '?') !== false))
        {
            $uri = substr($uri, 0, strpos($uri, '?'));
        }






        return WWW_URL . $uri;
    }

    static public function disableHttpCaching()
    {
        header("Cache-Control: no-cache, must-revalidate");







|








|



>
>
>
>
>







116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
    {
        if (!empty($_SERVER['REQUEST_URI']))
            return $_SERVER['REQUEST_URI'];
        else
            return false;
    }

    static public function getSelfURL($qs = true)
    {
        $uri = self::getRequestUri();

        if (strpos($uri, WWW_URI) === 0)
        {
            $uri = substr($uri, strlen(WWW_URI));
        }

        if ($qs !== true && (strpos($uri, '?') !== false))
        {
            $uri = substr($uri, 0, strpos($uri, '?'));
        }

        if (is_array($qs))
        {
            $uri .= '?' . http_build_query($qs);
        }

        return WWW_URL . $uri;
    }

    static public function disableHttpCaching()
    {
        header("Cache-Control: no-cache, must-revalidate");

Modified src/templates/admin/membres/index.tpl from [432dc2550b] to [a7b4f693eb].

48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
    {if !empty($liste)}
    <table class="list">
        <thead class="userOrder">
            <tr>
                {if $user.droits.membres == Garradin\Membres::DROIT_ADMIN}<td class="check"><input type="checkbox" title="Tout cocher / décocher" /></td>{/if}
                <td class="{if $order == 'id'} cur {if $desc}desc{else}asc{/if}{/if}" title="Numéro unique"><a href="?o=id&amp;a" class="icn up">&uarr;</a><a href="?o=id&amp;d" class="icn dn">&darr;</a></td>
                {foreach from=$champs key="c" item="champ"}
                    <td class="{if $order == $c} cur {if $desc}desc{else}asc{/if}{/if}">{$champ.title} <a href="?o={$c}&amp;a" class="icn up">&uarr;</a><a href="?o={$c}&amp;d" class="icn dn">&darr;</a></td>
                {/foreach}
                <td></td>
            </tr>
        </thead>
        <tbody>
            {foreach from=$liste item="membre"}
                <tr>







|







48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
    {if !empty($liste)}
    <table class="list">
        <thead class="userOrder">
            <tr>
                {if $user.droits.membres == Garradin\Membres::DROIT_ADMIN}<td class="check"><input type="checkbox" title="Tout cocher / décocher" /></td>{/if}
                <td class="{if $order == 'id'} cur {if $desc}desc{else}asc{/if}{/if}" title="Numéro unique"><a href="?o=id&amp;a" class="icn up">&uarr;</a><a href="?o=id&amp;d" class="icn dn">&darr;</a></td>
                {foreach from=$champs key="c" item="champ"}
                    <td class="{if $order == $c} cur {if $desc}desc{else}asc{/if}{/if}">{$champ.title} <a href="?o={$c}&amp;a&amp;cat={$current_cat}" class="icn up">&uarr;</a><a href="?o={$c}&amp;d&amp;cat={$current_cat}" class="icn dn">&darr;</a></td>
                {/foreach}
                <td></td>
            </tr>
        </thead>
        <tbody>
            {foreach from=$liste item="membre"}
                <tr>

Modified src/templates/admin/password.tpl from [1feb370da9] to [c6dcbedba5].

15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
        Si le message n'apparaît pas dans les prochaines minutes, vérifiez le dossier Spam ou Indésirables.
    </p>
    <p><a href="{$www_url}admin/login.php">Connexion &rarr;</a></p>
{else}

    {form_errors}

    <form method="post" action="{$admin_url}password.php">

        <fieldset>
            <legend>Recevoir un e-mail avec un nouveau mot de passe</legend>
            <p class="help">
                Inscrivez ici votre {$champ.title}.
                Nous vous enverrons un message vous indiquant un lien permettant de recevoir un
                nouveau mot de passe.







|







15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
        Si le message n'apparaît pas dans les prochaines minutes, vérifiez le dossier Spam ou Indésirables.
    </p>
    <p><a href="{$www_url}admin/login.php">Connexion &rarr;</a></p>
{else}

    {form_errors}

    <form method="post" action="{$self_url_no_qs}">

        <fieldset>
            <legend>Recevoir un e-mail avec un nouveau mot de passe</legend>
            <p class="help">
                Inscrivez ici votre {$champ.title}.
                Nous vous enverrons un message vous indiquant un lien permettant de recevoir un
                nouveau mot de passe.

Modified src/www/admin/membres/cotisations/voir.php from [40bc6d371e] to [5e91281c68].

20
21
22
23
24
25
26
27





28
29
30
31
32
33
34
35
}

$page = (int) qg('p') ?: 1;

$tpl->assign('page', $page);
$tpl->assign('bypage', Membres\Cotisations::ITEMS_PER_PAGE);
$tpl->assign('total', $m_cotisations->countMembersForCotisation($co->id));
$tpl->assign('pagination_url', Utils::getSelfUrl(true) . '?id=' . $co->id . '&amp;p=[ID]');






$tpl->assign('cotisation', $co);
$tpl->assign('order', qg('o') ?: 'date');
$tpl->assign('desc', !null !== qg('a'));
$tpl->assign('liste', $m_cotisations->listMembersForCotisation(
	$co->id, $page, qg('o'), null !== qg('a') ? false : true));

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







|
>
>
>
>
>








20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
}

$page = (int) qg('p') ?: 1;

$tpl->assign('page', $page);
$tpl->assign('bypage', Membres\Cotisations::ITEMS_PER_PAGE);
$tpl->assign('total', $m_cotisations->countMembersForCotisation($co->id));
$tpl->assign('pagination_url', Utils::getSelfUrl([
	'id' => $co->id,
	'o' => qg('o'),
	(qg('a') !== null ? 'a' : 'd') => '',
	'p'  => '[ID]',
]));

$tpl->assign('cotisation', $co);
$tpl->assign('order', qg('o') ?: 'date');
$tpl->assign('desc', !null !== qg('a'));
$tpl->assign('liste', $m_cotisations->listMembersForCotisation(
	$co->id, $page, qg('o'), null !== qg('a') ? false : true));

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

Modified src/www/admin/membres/index.php from [f61218542f] to [1aa05ee07f].

59
60
61
62
63
64
65


66





67
68
69
70
71
72
73
74
75
76
77
78
79
	$tpl->assign('desc', $desc);

	$tpl->assign('champs', $fields);

	$tpl->assign('liste', $membres->listByCategory($cat_id, array_keys((array) $fields), $page, $order, $desc));
	$tpl->assign('total', $membres->countByCategory($cat_id));



	$tpl->assign('pagination_url', Utils::getSelfUrl(true) . '?p=[ID]&amp;o=' . $order . ($desc ? '&amp;d' : '') . ($cat_id? '&amp;cat='. (int) qg('cat') : ''));






	$tpl->assign('membres_cats', $membres_cats);
	$tpl->assign('membres_cats_cachees', $membres_cats_cachees);
	$tpl->assign('current_cat', $cat_id);

	$tpl->assign('page', $page);
	$tpl->assign('bypage', Membres::ITEMS_PER_PAGE);

}

$tpl->assign('sent', null !== qg('sent'));

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







>
>
|
>
>
>
>
>













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
	$tpl->assign('desc', $desc);

	$tpl->assign('champs', $fields);

	$tpl->assign('liste', $membres->listByCategory($cat_id, array_keys((array) $fields), $page, $order, $desc));
	$tpl->assign('total', $membres->countByCategory($cat_id));

	$cat_id = is_array($cat_id) ? 0 : $cat_id;

	$tpl->assign('pagination_url', Utils::getSelfUrl([
		'p' => '[ID]',
		'o' => $order,
		($desc ? 'd' : 'a') => '',
		'cat' => $cat_id,
	]));

	$tpl->assign('membres_cats', $membres_cats);
	$tpl->assign('membres_cats_cachees', $membres_cats_cachees);
	$tpl->assign('current_cat', $cat_id);

	$tpl->assign('page', $page);
	$tpl->assign('bypage', Membres::ITEMS_PER_PAGE);

}

$tpl->assign('sent', null !== qg('sent'));

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