Overview
Comment:Permettre d'avoir WWW_URL et ADMIN_URL dans des endroits différents
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | stable
Files: files | file ages | folders
SHA1: c1d8c7b3f38a6af4db1b962464b9e83a71eeab37
User & Date: bohwaz on 2018-01-10 02:26:47
Other Links: manifest | tags
References
2020-12-08
23:25 Wiki page "Changelog/0.9" artifact: b9c916b4d1 user: bohwaz
Context
2018-01-10
09:21
Correction : ADMIN_URL est dans un autre namespace check-in: 4fd085ee54 user: bohwaz tags: trunk, stable
02:26
Permettre d'avoir WWW_URL et ADMIN_URL dans des endroits différents check-in: c1d8c7b3f3 user: bohwaz tags: trunk, stable
2017-12-10
22:28
Corrige export champs multi lignes pour Excel, signalé par @David check-in: 82c8c1fade user: bohwaz tags: trunk, stable
Changes

Modified src/config.dist.php from [21bbfcec16] to [cba29bf5b8].

112
113
114
115
116
117
118







119
120
121
122
123
124
125
 * Adresse URL HTTP(S) de Garradin
 *
 * Défaut : découverte à partir de HTTP_HOST ou SERVER_NAME + WWW_URI
 */

//const WWW_URL = 'http://garradin.chezmoi.tld' . WWW_URI;








/**
 * Affichage des erreurs
 * Si "true" alors un message expliquant l'erreur et comment rapporter le bug s'affiche
 * en cas d'erreur. Sinon rien ne sera affiché.
 * 
 * Défaut : true
 */







>
>
>
>
>
>
>







112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
 * Adresse URL HTTP(S) de Garradin
 *
 * Défaut : découverte à partir de HTTP_HOST ou SERVER_NAME + WWW_URI
 */

//const WWW_URL = 'http://garradin.chezmoi.tld' . WWW_URI;

/**
 * Adresse URL HTTP(S) de l'admin Garradin
 *
 * Défaut : WWW_URL + 'admin/'
 */
//const ADMIN_URL = 'https://admin.garradin.chezmoi.tld/';

/**
 * Affichage des erreurs
 * Si "true" alors un message expliquant l'erreur et comment rapporter le bug s'affiche
 * en cas d'erreur. Sinon rien ne sera affiché.
 * 
 * Défaut : true
 */

Modified src/include/init.php from [0bbca1fd0e] to [8baaab3f9f].

103
104
105
106
107
108
109

110
111
112
113
114
115
116
    'USE_CRON'              => false,
    'ENABLE_XSENDFILE'      => false,
    'SMTP_HOST'             => false,
    'SMTP_USER'             => null,
    'SMTP_PASSWORD'         => null,
    'SMTP_PORT'             => 587,
    'SMTP_SECURITY'         => 'STARTTLS',

];

foreach ($default_config as $const => $value)
{
    $const = sprintf('Garradin\\%s', $const);

    if (!defined($const))







>







103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
    'USE_CRON'              => false,
    'ENABLE_XSENDFILE'      => false,
    'SMTP_HOST'             => false,
    'SMTP_USER'             => null,
    'SMTP_PASSWORD'         => null,
    'SMTP_PORT'             => 587,
    'SMTP_SECURITY'         => 'STARTTLS',
    'ADMIN_URL'             => WWW_URL . 'admin/',
];

foreach ($default_config as $const => $value)
{
    $const = sprintf('Garradin\\%s', $const);

    if (!defined($const))
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
 * Vérifications pour enclencher le processus d'installation ou de mise à jour
 */

if (!defined('Garradin\INSTALL_PROCESS') && !defined('Garradin\UPGRADE_PROCESS'))
{
    if (!file_exists(DB_FILE))
    {
        Utils::redirect('/admin/install.php');
    }

    $config = Config::getInstance();

    if (version_compare($config->getVersion(), garradin_version(), '<'))
    {
        Utils::redirect('/admin/upgrade.php');
    }
}







|






|


284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
 * Vérifications pour enclencher le processus d'installation ou de mise à jour
 */

if (!defined('Garradin\INSTALL_PROCESS') && !defined('Garradin\UPGRADE_PROCESS'))
{
    if (!file_exists(DB_FILE))
    {
        Utils::redirect(ADMIN_URL . 'install.php');
    }

    $config = Config::getInstance();

    if (version_compare($config->getVersion(), garradin_version(), '<'))
    {
        Utils::redirect(ADMIN_URL . 'upgrade.php');
    }
}

Modified src/include/lib/Garradin/Membres/Session.php from [d89df003fb] to [af346af7ba].

164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
		$id = base_convert($membre->id, 10, 36);
		$expire = base_convert($expire, 10, 36);

		$query = sprintf('%s.%s.%s', $id, $expire, $hash);

		$message = "Bonjour,\n\nVous avez oublié votre mot de passe ? Pas de panique !\n\n";
		$message.= "Il vous suffit de cliquer sur le lien ci-dessous pour recevoir un nouveau mot de passe.\n\n";
		$message.= WWW_URL . 'admin/password.php?c=' . $query;
		$message.= "\n\nSi vous n'avez pas demandé à recevoir ce message, ignorez-le, votre mot de passe restera inchangé.";

		Utils::mail($membre->email, '['.$config->get('nom_asso').'] Mot de passe perdu ?', $message, [], $membre->clef_pgp);
		return true;
	}

	static public function recoverPasswordConfirm($code)







|







164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
		$id = base_convert($membre->id, 10, 36);
		$expire = base_convert($expire, 10, 36);

		$query = sprintf('%s.%s.%s', $id, $expire, $hash);

		$message = "Bonjour,\n\nVous avez oublié votre mot de passe ? Pas de panique !\n\n";
		$message.= "Il vous suffit de cliquer sur le lien ci-dessous pour recevoir un nouveau mot de passe.\n\n";
		$message.= ADMIN_URL . 'password.php?c=' . $query;
		$message.= "\n\nSi vous n'avez pas demandé à recevoir ce message, ignorez-le, votre mot de passe restera inchangé.";

		Utils::mail($membre->email, '['.$config->get('nom_asso').'] Mot de passe perdu ?', $message, [], $membre->clef_pgp);
		return true;
	}

	static public function recoverPasswordConfirm($code)

Modified src/include/lib/Garradin/Rappels_Envoyes.php from [2380fe5451] to [c7cead62f7].

114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
		$tags = [
			'#NOM_ASSO'		=>	$config->get('nom_asso'),
			'#ADRESSE_ASSO'	=>	$config->get('adresse_asso'),
			'#EMAIL_ASSO'	=>	$config->get('email_asso'),
			'#SITE_ASSO'	=>	$config->get('site_asso'),
			'#URL_RACINE'	=>	WWW_URL,
			'#URL_SITE'		=>	WWW_URL,
			'#URL_ADMIN'	=>	WWW_URL . 'admin/',
		];

		if (!empty($data) && is_array($data))
		{
			foreach ($data as $key=>$value)
			{
				$key = '#' . strtoupper($key);







|







114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
		$tags = [
			'#NOM_ASSO'		=>	$config->get('nom_asso'),
			'#ADRESSE_ASSO'	=>	$config->get('adresse_asso'),
			'#EMAIL_ASSO'	=>	$config->get('email_asso'),
			'#SITE_ASSO'	=>	$config->get('site_asso'),
			'#URL_RACINE'	=>	WWW_URL,
			'#URL_SITE'		=>	WWW_URL,
			'#URL_ADMIN'	=>	ADMIN_URL,
		];

		if (!empty($data) && is_array($data))
		{
			foreach ($data as $key=>$value)
			{
				$key = '#' . strtoupper($key);

Modified src/include/lib/Garradin/Squelette.php from [8dd8374216] to [55a9f0b312].

208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
        $this->assign('email_asso', $config->get('email_asso'));
        $this->assign('site_asso', $config->get('site_asso'));

        $this->assign('url_racine', WWW_URL);
        $this->assign('url_site', WWW_URL);
        $this->assign('url_atom', WWW_URL . 'feed/atom/');
        $this->assign('url_elements', WWW_URL . 'squelettes/');
        $this->assign('url_admin', WWW_URL . 'admin/');

        $url = file_exists(DATA_ROOT . '/www/squelettes/default.css')
            ? WWW_URL . 'squelettes/default.css'
            : WWW_URL . 'squelettes-dist/default.css';

        $this->assign('url_css_defaut', $url);








|







208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
        $this->assign('email_asso', $config->get('email_asso'));
        $this->assign('site_asso', $config->get('site_asso'));

        $this->assign('url_racine', WWW_URL);
        $this->assign('url_site', WWW_URL);
        $this->assign('url_atom', WWW_URL . 'feed/atom/');
        $this->assign('url_elements', WWW_URL . 'squelettes/');
        $this->assign('url_admin', ADMIN_URL);

        $url = file_exists(DATA_ROOT . '/www/squelettes/default.css')
            ? WWW_URL . 'squelettes/default.css'
            : WWW_URL . 'squelettes-dist/default.css';

        $this->assign('url_css_defaut', $url);

821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
        elseif ($uri == '/feed/atom/')
        {
            header('Content-Type: application/atom+xml');
            $skel = 'atom.xml';
        }
        elseif ($uri == '/favicon.ico')
        {
            header('Location: ' . WWW_URI . 'admin/static/icon.png');
            exit;
        }
        elseif (substr($uri, -1) == '/')
        {
            $skel = 'rubrique.html';
            $_GET['uri'] = $_REQUEST['uri'] = substr($uri, 1, -1);
        }







|







821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
        elseif ($uri == '/feed/atom/')
        {
            header('Content-Type: application/atom+xml');
            $skel = 'atom.xml';
        }
        elseif ($uri == '/favicon.ico')
        {
            header('Location: ' . ADMIN_URL . 'static/icon.png');
            exit;
        }
        elseif (substr($uri, -1) == '/')
        {
            $skel = 'rubrique.html';
            $_GET['uri'] = $_REQUEST['uri'] = substr($uri, 1, -1);
        }

Modified src/include/lib/Garradin/Utils.php from [dc41f212bc] to [4a82bb682d].

654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
        return true;
    }

    static public function plugin_url($params = [])
    {
        if (isset($params['id']))
        {
            $url = WWW_URL . 'admin/plugin/' . $params['id'] . '/';
        }
        else
        {
            $url = PLUGIN_URL;
        }

        if (!empty($params['file']))







|







654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
        return true;
    }

    static public function plugin_url($params = [])
    {
        if (isset($params['id']))
        {
            $url = ADMIN_URL . 'plugin/' . $params['id'] . '/';
        }
        else
        {
            $url = PLUGIN_URL;
        }

        if (!empty($params['file']))

Modified src/templates/admin/_foot.tpl from [9a86bb1b00] to [ac8f1a0908].

1
2
3
4
5
6
7
8
9
10
11
</main>

<script type="text/javascript" defer="defer">
var keep_session_url = "{$www_url}admin/login.php?keepSessionAlive&";
{literal}
(function () {
    function refreshSession()
    {
        var i = new Image(1, 1);
        var d = +new Date;
        i.src = keep_session_url + d;



|







1
2
3
4
5
6
7
8
9
10
11
</main>

<script type="text/javascript" defer="defer">
var keep_session_url = "{$admin_url}login.php?keepSessionAlive&";
{literal}
(function () {
    function refreshSession()
    {
        var i = new Image(1, 1);
        var d = +new Date;
        i.src = keep_session_url + d;

Modified src/templates/admin/compta/banques/index.tpl from [d927ab0461] to [9584129965].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
{include file="admin/_head.tpl" title="Comptes bancaires" current="compta/banques"}

<ul class="actions">
    <li class="current"><a href="{$www_url}admin/compta/banques/">Comptes bancaires</a></li>
    <li><a href="{$www_url}admin/compta/comptes/journal.php?id={$id_caisse}&amp;suivi">Journal de caisse</a></li>
    <li><a href="{$www_url}admin/compta/comptes/journal.php?id={$id_cheque_a_encaisser}&amp;suivi">Chèques à encaisser</a></li>
    <li><a href="{$www_url}admin/compta/comptes/journal.php?id={$id_carte_a_encaisser}&amp;suivi">Paiements par carte à encaisser</a></li>
</ul>

{if !empty($liste)}
    <table class="list">
        <thead>
            <tr>
                <td>Banque</td>



|
|
|
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
{include file="admin/_head.tpl" title="Comptes bancaires" current="compta/banques"}

<ul class="actions">
    <li class="current"><a href="{$admin_url}compta/banques/">Comptes bancaires</a></li>
    <li><a href="{$admin_url}compta/comptes/journal.php?id={$id_caisse}&amp;suivi">Journal de caisse</a></li>
    <li><a href="{$admin_url}compta/comptes/journal.php?id={$id_cheque_a_encaisser}&amp;suivi">Chèques à encaisser</a></li>
    <li><a href="{$admin_url}compta/comptes/journal.php?id={$id_carte_a_encaisser}&amp;suivi">Paiements par carte à encaisser</a></li>
</ul>

{if !empty($liste)}
    <table class="list">
        <thead>
            <tr>
                <td>Banque</td>
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
            <tr>
                <td>{$compte.banque}</td>
                <th>{$compte.libelle}</th>
                <td><strong>{$compte.solde|escape|html_money} {$config.monnaie}</strong></td>
                <td>{$compte.iban|escape|format_iban}</td>
                <td>{$compte.bic}</td>
                <td class="actions">
                    <a class="icn" href="{$www_url}admin/compta/comptes/journal.php?id={$compte.id}&amp;suivi" title="Journal">𝍢</a>
                    {if $session->canAccess('compta', Garradin\Membres::DROIT_ECRITURE)}
                        <a class="icn" href="{$www_url}admin/compta/banques/rapprocher.php?id={$compte.id}" title="Rapprocher">☑</a>
                    {/if}
                    {if $session->canAccess('compta', Garradin\Membres::DROIT_ADMIN)}
                        <a class="icn" href="{$www_url}admin/compta/banques/modifier.php?id={$compte.id}" title="Modifier">✎</a>
                        <a class="icn" href="{$www_url}admin/compta/banques/supprimer.php?id={$compte.id}" title="Supprimer">✘</a>
                    {/if}
                </td>
            </tr>
        {/foreach}
        </tbody>
    </table>
    </dl>







|

|


|
|







24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
            <tr>
                <td>{$compte.banque}</td>
                <th>{$compte.libelle}</th>
                <td><strong>{$compte.solde|escape|html_money} {$config.monnaie}</strong></td>
                <td>{$compte.iban|escape|format_iban}</td>
                <td>{$compte.bic}</td>
                <td class="actions">
                    <a class="icn" href="{$admin_url}compta/comptes/journal.php?id={$compte.id}&amp;suivi" title="Journal">𝍢</a>
                    {if $session->canAccess('compta', Garradin\Membres::DROIT_ECRITURE)}
                        <a class="icn" href="{$admin_url}compta/banques/rapprocher.php?id={$compte.id}" title="Rapprocher">☑</a>
                    {/if}
                    {if $session->canAccess('compta', Garradin\Membres::DROIT_ADMIN)}
                        <a class="icn" href="{$admin_url}compta/banques/modifier.php?id={$compte.id}" title="Modifier">✎</a>
                        <a class="icn" href="{$admin_url}compta/banques/supprimer.php?id={$compte.id}" title="Supprimer">✘</a>
                    {/if}
                </td>
            </tr>
        {/foreach}
        </tbody>
    </table>
    </dl>

Modified src/templates/admin/compta/banques/rapprocher.tpl from [7ec3c5b39a] to [d9b0b07ead].

1
2
3
4
5
6
7
8
9
10
11
12
{include file="admin/_head.tpl" title="Rapprochement — %s"|args:$compte.id current="compta/banques" js=1}

<ul class="actions">
    <li><a href="{$www_url}admin/compta/banques/">Comptes bancaires</a></li>
    <li><a href="{$www_url}admin/compta/comptes/journal.php?id={$id_caisse}&amp;suivi">Journal de caisse</a></li>
    <li class="current"><a href="{$self_url_no_qs}?id={$compte.id}">Rapprochement</a></li>
</ul>

<form method="get" action="{$self_url_no_qs}">
    {if !empty($prev) && !empty($next)}
    <fieldset class="shortFormRight">
        <legend>Rapprochement par mois</legend>



|
|







1
2
3
4
5
6
7
8
9
10
11
12
{include file="admin/_head.tpl" title="Rapprochement — %s"|args:$compte.id current="compta/banques" js=1}

<ul class="actions">
    <li><a href="{$admin_url}compta/banques/">Comptes bancaires</a></li>
    <li><a href="{$admin_url}compta/comptes/journal.php?id={$id_caisse}&amp;suivi">Journal de caisse</a></li>
    <li class="current"><a href="{$self_url_no_qs}?id={$compte.id}">Rapprochement</a></li>
</ul>

<form method="get" action="{$self_url_no_qs}">
    {if !empty($prev) && !empty($next)}
    <fieldset class="shortFormRight">
        <legend>Rapprochement par mois</legend>

Modified src/templates/admin/compta/categories/index.tpl from [0b5a6fec57] to [7a1c1dcb5e].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{include file="admin/_head.tpl" title="Catégories" current="compta/categories"}

{include file="admin/compta/categories/_nav.tpl" current=$current_nav}

    {if !empty($liste)}
        <dl class="catList">
        {foreach from=$liste item="cat"}
            <dt>{$cat.intitule}</dt>
            {if !empty($cat.description)}
                <dd class="desc">{$cat.description}</dd>
            {/if}
            <dd class="compte"><strong>{$cat.compte}</strong> - {$cat.compte_libelle}</dd>
            <dd class="actions">
                <a class="icn" href="{$www_url}admin/compta/operations/?cat={$cat.id}" title="Lister les opérations de cette catégorie">𝍢</a>
                <a class="icn" href="{$www_url}admin/compta/categories/modifier.php?id={$cat.id}" title="Modifier">✎</a>
                <a class="icn" href="{$www_url}admin/compta/categories/supprimer.php?id={$cat.id}" title="Supprimer">✘</a>
            </dd>
        {/foreach}
        </dl>
    {else}
        <p class="alert">
            Aucune catégorie trouvée.
        </p>
    {/if}

{include file="admin/_foot.tpl"}













|
|
|










1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{include file="admin/_head.tpl" title="Catégories" current="compta/categories"}

{include file="admin/compta/categories/_nav.tpl" current=$current_nav}

    {if !empty($liste)}
        <dl class="catList">
        {foreach from=$liste item="cat"}
            <dt>{$cat.intitule}</dt>
            {if !empty($cat.description)}
                <dd class="desc">{$cat.description}</dd>
            {/if}
            <dd class="compte"><strong>{$cat.compte}</strong> - {$cat.compte_libelle}</dd>
            <dd class="actions">
                <a class="icn" href="{$admin_url}compta/operations/?cat={$cat.id}" title="Lister les opérations de cette catégorie">𝍢</a>
                <a class="icn" href="{$admin_url}compta/categories/modifier.php?id={$cat.id}" title="Modifier">✎</a>
                <a class="icn" href="{$admin_url}compta/categories/supprimer.php?id={$cat.id}" title="Supprimer">✘</a>
            </dd>
        {/foreach}
        </dl>
    {else}
        <p class="alert">
            Aucune catégorie trouvée.
        </p>
    {/if}

{include file="admin/_foot.tpl"}

Modified src/templates/admin/compta/comptes/index.tpl from [43f2dd33d5] to [452d349397].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{if empty($classe)}
    {include file="admin/_head.tpl" title="Comptes" current="compta/categories"}
    <ul class="accountList">
    {foreach from=$classes item="_classe"}
        <li><h4><a href="{$www_url}admin/compta/comptes/?classe={$_classe.id}">{$_classe.libelle}</a></h4></li>
    {/foreach}
    </ul>
{else}
    {include file="admin/_head.tpl" title=$classe_compte.libelle current="compta/categories"}

    <ul class="actions">
        <li><a href="{$www_url}admin/compta/comptes/">Liste des classes</a></li>
        <li><a href="{$www_url}admin/compta/comptes/ajouter.php?classe={$classe}">Ajouter un compte dans cette classe</a></li>
    </ul>

    <p class="help">
        Les comptes avec la mention <em>*</em> font partie du plan comptable standard
        et ne peuvent être modifiés ou supprimés.
    </p>





|






|
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{if empty($classe)}
    {include file="admin/_head.tpl" title="Comptes" current="compta/categories"}
    <ul class="accountList">
    {foreach from=$classes item="_classe"}
        <li><h4><a href="{$admin_url}compta/comptes/?classe={$_classe.id}">{$_classe.libelle}</a></h4></li>
    {/foreach}
    </ul>
{else}
    {include file="admin/_head.tpl" title=$classe_compte.libelle current="compta/categories"}

    <ul class="actions">
        <li><a href="{$admin_url}compta/comptes/">Liste des classes</a></li>
        <li><a href="{$admin_url}compta/comptes/ajouter.php?classe={$classe}">Ajouter un compte dans cette classe</a></li>
    </ul>

    <p class="help">
        Les comptes avec la mention <em>*</em> font partie du plan comptable standard
        et ne peuvent être modifiés ou supprimés.
    </p>

30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
                    {else}
                        {$compte.position|get_position}
                    {/if}
                </td>
                <td class="actions">
                    {if empty($compte.desactive)}
                        {if !$compte.plan_comptable}
                            <a class="icn" href="{$www_url}admin/compta/comptes/modifier.php?id={$compte.id}" title="Modifier">✎</a>
                            <a class="icn" href="{$www_url}admin/compta/comptes/supprimer.php?id={$compte.id}" title="Supprimer">✘</a>
                        {else}
                            <em>*</em>
                        {/if}
                    {/if}
                </td>
            </tr>
        {/foreach}







|
|







30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
                    {else}
                        {$compte.position|get_position}
                    {/if}
                </td>
                <td class="actions">
                    {if empty($compte.desactive)}
                        {if !$compte.plan_comptable}
                            <a class="icn" href="{$admin_url}compta/comptes/modifier.php?id={$compte.id}" title="Modifier">✎</a>
                            <a class="icn" href="{$admin_url}compta/comptes/supprimer.php?id={$compte.id}" title="Supprimer">✘</a>
                        {else}
                            <em>*</em>
                        {/if}
                    {/if}
                </td>
            </tr>
        {/foreach}

Modified src/templates/admin/compta/comptes/journal.tpl from [81671c2fe2] to [ac05873329].

1
2
3
4
5
6
7
8
9
10
11
12
13
{if $suivi}
    {include file="admin/_head.tpl" title="Journal : %s - %s"|args:$compte.id:$compte.libelle current="compta/banques" body_id="rapport"}

    <ul class="actions">
        <li><a href="{$www_url}admin/compta/banques/">Comptes bancaires</a></li>
        <li><a href="{$www_url}admin/compta/comptes/journal.php?id={$id_caisse}">Journal de caisse</a></li>
    </ul>
{else}
    {include file="admin/_head.tpl" title="Journal : %s - %s"|args:$compte.id:$compte.libelle current="compta/gestion" body_id="rapport"}
{/if}


<table class="list">




|
|







1
2
3
4
5
6
7
8
9
10
11
12
13
{if $suivi}
    {include file="admin/_head.tpl" title="Journal : %s - %s"|args:$compte.id:$compte.libelle current="compta/banques" body_id="rapport"}

    <ul class="actions">
        <li><a href="{$admin_url}compta/banques/">Comptes bancaires</a></li>
        <li><a href="{$admin_url}compta/comptes/journal.php?id={$id_caisse}">Journal de caisse</a></li>
    </ul>
{else}
    {include file="admin/_head.tpl" title="Journal : %s - %s"|args:$compte.id:$compte.libelle current="compta/gestion" body_id="rapport"}
{/if}


<table class="list">

Modified src/templates/admin/compta/exercices/index.tpl from [7db8d2a012] to [e945d5a3d0].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{include file="admin/_head.tpl" title="Exercices" current="compta/exercices"}

<ul class="actions">
    <li class="current"><a href="{$admin_url}compta/exercices/">Exercices</a></li>
    <li><a href="{$admin_url}compta/projets/">Projets (compta analytique)</a></li>
</ul>

{if !$current_exercice}
<ul class="actions">
    <li><strong><a href="{$www_url}admin/compta/exercices/ajouter.php">Commencer un nouvel exercice</a></strong></li>
</ul>
{/if}

{if !empty($liste)}
    <dl class="catList">
    {foreach from=$liste item="exercice"}
        <dt>{$exercice.libelle}</dt>
        <dd class="desc">
            {if $exercice.cloture}Clôturé{else}En cours{/if}
            | Du {$exercice.debut|date_fr:'d/m/Y'} au {$exercice.fin|date_fr:'d/m/Y'}
        </dd>
        <dd class="compte">
            <strong>{$exercice.nb_operations}</strong> opérations enregistrées.
        </dd>
        <dd class="desc">
            <a href="{$www_url}admin/compta/rapports/journal.php?exercice={$exercice.id}">Journal général</a>
            | <a href="{$www_url}admin/compta/rapports/grand_livre.php?exercice={$exercice.id}">Grand livre</a>
            | <a href="{$www_url}admin/compta/rapports/compte_resultat.php?exercice={$exercice.id}">Compte de résultat</a>
            | <a href="{$www_url}admin/compta/rapports/bilan.php?exercice={$exercice.id}">Bilan</a>
        </dd>
        {if $session->canAccess('compta', Garradin\Membres::DROIT_ADMIN)}
        <dd class="actions">
            {if !$exercice.cloture}
            <a class="icn" href="{$www_url}admin/compta/exercices/modifier.php?id={$exercice.id}" title="Modifier">✎</a>
            <a class="icn" href="{$www_url}admin/compta/exercices/supprimer.php?id={$exercice.id}" title="Supprimer">✘</a>
            <a class="icn" href="{$www_url}admin/compta/exercices/cloturer.php?id={$exercice.id}" title="Clôturer cet exercice">🔒</a>
            {elseif $exercice.cloture && $exercice.nb_operations == 0}
            <a class="icn" href="{$www_url}admin/compta/exercices/supprimer.php?id={$exercice.id}" title="Supprimer">✘</a>
            {/if}
        </dd>
        {/if}
    {/foreach}
    </dl>
{else}
    <p class="alert">
        Il n'y a pas d'exercice en cours.
    </p>
{/if}

{include file="admin/_foot.tpl"}









|















|
|
|
|




|
|
|

|












1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{include file="admin/_head.tpl" title="Exercices" current="compta/exercices"}

<ul class="actions">
    <li class="current"><a href="{$admin_url}compta/exercices/">Exercices</a></li>
    <li><a href="{$admin_url}compta/projets/">Projets (compta analytique)</a></li>
</ul>

{if !$current_exercice}
<ul class="actions">
    <li><strong><a href="{$admin_url}compta/exercices/ajouter.php">Commencer un nouvel exercice</a></strong></li>
</ul>
{/if}

{if !empty($liste)}
    <dl class="catList">
    {foreach from=$liste item="exercice"}
        <dt>{$exercice.libelle}</dt>
        <dd class="desc">
            {if $exercice.cloture}Clôturé{else}En cours{/if}
            | Du {$exercice.debut|date_fr:'d/m/Y'} au {$exercice.fin|date_fr:'d/m/Y'}
        </dd>
        <dd class="compte">
            <strong>{$exercice.nb_operations}</strong> opérations enregistrées.
        </dd>
        <dd class="desc">
            <a href="{$admin_url}compta/rapports/journal.php?exercice={$exercice.id}">Journal général</a>
            | <a href="{$admin_url}compta/rapports/grand_livre.php?exercice={$exercice.id}">Grand livre</a>
            | <a href="{$admin_url}compta/rapports/compte_resultat.php?exercice={$exercice.id}">Compte de résultat</a>
            | <a href="{$admin_url}compta/rapports/bilan.php?exercice={$exercice.id}">Bilan</a>
        </dd>
        {if $session->canAccess('compta', Garradin\Membres::DROIT_ADMIN)}
        <dd class="actions">
            {if !$exercice.cloture}
            <a class="icn" href="{$admin_url}compta/exercices/modifier.php?id={$exercice.id}" title="Modifier">✎</a>
            <a class="icn" href="{$admin_url}compta/exercices/supprimer.php?id={$exercice.id}" title="Supprimer">✘</a>
            <a class="icn" href="{$admin_url}compta/exercices/cloturer.php?id={$exercice.id}" title="Clôturer cet exercice">🔒</a>
            {elseif $exercice.cloture && $exercice.nb_operations == 0}
            <a class="icn" href="{$admin_url}compta/exercices/supprimer.php?id={$exercice.id}" title="Supprimer">✘</a>
            {/if}
        </dd>
        {/if}
    {/foreach}
    </dl>
{else}
    <p class="alert">
        Il n'y a pas d'exercice en cours.
    </p>
{/if}

{include file="admin/_foot.tpl"}

Modified src/templates/admin/compta/import.tpl from [20cc30ed8a] to [41a1fc641c].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{include file="admin/_head.tpl" title="Import / Export" current="compta"}

{form_errors}

{if $ok}
    <p class="confirm">
        L'import s'est bien déroulé.
    </p>
{/if}

<ul class="actions">
    <li class="current"><a href="{$www_url}admin/compta/import.php">Importer</a></li>
    <li><a href="{$www_url}admin/compta/import.php?export">Exporter en CSV</a></li>
</ul>

<form method="post" action="{$self_url}" enctype="multipart/form-data">

    <fieldset>
        <legend>Importer depuis un fichier</legend>
        <dl>











|
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{include file="admin/_head.tpl" title="Import / Export" current="compta"}

{form_errors}

{if $ok}
    <p class="confirm">
        L'import s'est bien déroulé.
    </p>
{/if}

<ul class="actions">
    <li class="current"><a href="{$admin_url}compta/import.php">Importer</a></li>
    <li><a href="{$admin_url}compta/import.php?export">Exporter en CSV</a></li>
</ul>

<form method="post" action="{$self_url}" enctype="multipart/form-data">

    <fieldset>
        <legend>Importer depuis un fichier</legend>
        <dl>

Modified src/templates/admin/compta/index.tpl from [8f94c4085d] to [07195fed01].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{include file="admin/_head.tpl" title="Comptabilité" current="compta"}

{if $session->canAccess('compta', Garradin\Membres::DROIT_ADMIN)}
<ul class="actions">
    <li><a href="{$www_url}admin/compta/import.php">Import / export</a></li>
    <li><a href="{$www_url}admin/compta/operations/recherche_sql.php">Recherche par requête SQL</a></li>
</ul>
{/if}

<div class="infos">
    <p>
        <img src="{$www_url}admin/compta/graph.php?g=recettes_depenses" />
        <img src="{$www_url}admin/compta/graph.php?g=banques_caisses" />
    </p>
    <p>
        <img src="{$www_url}admin/compta/pie.php?g=recettes" />
        <img src="{$www_url}admin/compta/pie.php?g=depenses" />
    </p>
</div>

{include file="admin/_foot.tpl"}




|
|





|
|


|
|




1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{include file="admin/_head.tpl" title="Comptabilité" current="compta"}

{if $session->canAccess('compta', Garradin\Membres::DROIT_ADMIN)}
<ul class="actions">
    <li><a href="{$admin_url}compta/import.php">Import / export</a></li>
    <li><a href="{$admin_url}compta/operations/recherche_sql.php">Recherche par requête SQL</a></li>
</ul>
{/if}

<div class="infos">
    <p>
        <img src="{$admin_url}compta/graph.php?g=recettes_depenses" />
        <img src="{$admin_url}compta/graph.php?g=banques_caisses" />
    </p>
    <p>
        <img src="{$admin_url}compta/pie.php?g=recettes" />
        <img src="{$admin_url}compta/pie.php?g=depenses" />
    </p>
</div>

{include file="admin/_foot.tpl"}

Modified src/templates/admin/compta/operations/index.tpl from [83582c111c] to [14d2513231].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{include file="admin/_head.tpl" title="Suivi des opérations" current="compta/gestion"}

<ul class="actions">
    <li class="recettes{if $type == Garradin\Compta\Categories::RECETTES} current{/if}"><a href="{$www_url}admin/compta/operations/?recettes">Recettes</a></li>
    <li class="depenses{if $type == Garradin\Compta\Categories::DEPENSES} current{/if}"><a href="{$www_url}admin/compta/operations/?depenses">Dépenses</a></li>
    <li class="autres{if $type == Garradin\Compta\Categories::AUTRES} current{/if}"><a href="{$www_url}admin/compta/operations/?autres">Autres</a></li>
    {*<li><a href="{$www_url}admin/compta/operations/recherche.php">Recherche d'opération</a></li>*}
    {if $session->canAccess('compta', Garradin\Membres::DROIT_ADMIN)}
        <li><a href="{$www_url}admin/compta/operations/recherche_sql.php">Recherche par requête SQL</a></li>
    {/if}
</ul>

{if $type != Garradin\Compta\Categories::AUTRES}
<form method="get" action="{$self_url}">
    <fieldset>
        <legend>Filtrer par catégorie</legend>



|
|
|
|

|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{include file="admin/_head.tpl" title="Suivi des opérations" current="compta/gestion"}

<ul class="actions">
    <li class="recettes{if $type == Garradin\Compta\Categories::RECETTES} current{/if}"><a href="{$admin_url}compta/operations/?recettes">Recettes</a></li>
    <li class="depenses{if $type == Garradin\Compta\Categories::DEPENSES} current{/if}"><a href="{$admin_url}compta/operations/?depenses">Dépenses</a></li>
    <li class="autres{if $type == Garradin\Compta\Categories::AUTRES} current{/if}"><a href="{$admin_url}compta/operations/?autres">Autres</a></li>
    {*<li><a href="{$admin_url}compta/operations/recherche.php">Recherche d'opération</a></li>*}
    {if $session->canAccess('compta', Garradin\Membres::DROIT_ADMIN)}
        <li><a href="{$admin_url}compta/operations/recherche_sql.php">Recherche par requête SQL</a></li>
    {/if}
</ul>

{if $type != Garradin\Compta\Categories::AUTRES}
<form method="get" action="{$self_url}">
    <fieldset>
        <legend>Filtrer par catégorie</legend>

Modified src/templates/admin/compta/operations/saisir.tpl from [0cbc8360ba] to [0de379c913].

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
        <li><input type="radio" name="type" value="avance" {form_field name=type checked=avance} id="f_type_avance" /><label for="f_type_avance">Saisie avancée</label></li>
    </ul>

    {form_errors}

    {if $ok}
        <p class="confirm">
            L'opération numéro <a href="{$www_url}admin/compta/operations/voir.php?id={$ok}">{$ok}</a> a été ajoutée.
            (<a href="{$www_url}admin/compta/operations/voir.php?id={$ok}">Voir l'opération</a>)
        </p>
    {/if}

    <fieldset>
        <legend>Informations sur l'opération</legend>
        <dl>
            <dt><label for="f_date">Date</label> <b title="(Champ obligatoire)">obligatoire</b></dt>







|
|







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
        <li><input type="radio" name="type" value="avance" {form_field name=type checked=avance} id="f_type_avance" /><label for="f_type_avance">Saisie avancée</label></li>
    </ul>

    {form_errors}

    {if $ok}
        <p class="confirm">
            L'opération numéro <a href="{$admin_url}compta/operations/voir.php?id={$ok}">{$ok}</a> a été ajoutée.
            (<a href="{$admin_url}compta/operations/voir.php?id={$ok}">Voir l'opération</a>)
        </p>
    {/if}

    <fieldset>
        <legend>Informations sur l'opération</legend>
        <dl>
            <dt><label for="f_date">Date</label> <b title="(Champ obligatoire)">obligatoire</b></dt>

Modified src/templates/admin/config/_menu.tpl from [bf691bf8f5] to [b62a4fdea8].

1
2
3
4
5
6
7
8
<ul class="actions">
    <li{if $current == 'index'} class="current"{/if}><a href="{$www_url}admin/config/">Général</a></li>
    <li{if $current == 'membres'} class="current"{/if}><a href="{$www_url}admin/config/membres.php">Fiche des membres</a></li>
    <li{if $current == 'site'} class="current"{/if}><a href="{$www_url}admin/config/site.php">Site public</a></li>
    <li{if $current == 'donnees'} class="current"{/if}><a href="{$www_url}admin/config/donnees.php">Données&nbsp;: sauvegarde et restauration</a></li>
    <li{if $current == 'import'} class="current"{/if}><a href="{$www_url}admin/config/import.php">Import &amp; export</a></li>
    <li{if $current == 'plugins'} class="current"{/if}><a href="{$www_url}admin/config/plugins.php">Extensions</a></li>
</ul>

|
|
|
|
|
|

1
2
3
4
5
6
7
8
<ul class="actions">
    <li{if $current == 'index'} class="current"{/if}><a href="{$admin_url}config/">Général</a></li>
    <li{if $current == 'membres'} class="current"{/if}><a href="{$admin_url}config/membres.php">Fiche des membres</a></li>
    <li{if $current == 'site'} class="current"{/if}><a href="{$admin_url}config/site.php">Site public</a></li>
    <li{if $current == 'donnees'} class="current"{/if}><a href="{$admin_url}config/donnees.php">Données&nbsp;: sauvegarde et restauration</a></li>
    <li{if $current == 'import'} class="current"{/if}><a href="{$admin_url}config/import.php">Import &amp; export</a></li>
    <li{if $current == 'plugins'} class="current"{/if}><a href="{$admin_url}config/plugins.php">Extensions</a></li>
</ul>

Modified src/templates/admin/login.tpl from [cecf8ffa2c] to [a6078916db].

39
40
41
42
43
44
45
46
47
48
49
50
51

    <p class="submit">
        {csrf_field key="login"}
        <input type="submit" name="login" value="Se connecter &rarr;" />
    </p>

    <p class="help">
        <a href="{$www_url}admin/password.php">Pas de mot de passe ou mot de passe perdu ?</a>
    </p>

</form>

{include file="admin/_foot.tpl"}







|





39
40
41
42
43
44
45
46
47
48
49
50
51

    <p class="submit">
        {csrf_field key="login"}
        <input type="submit" name="login" value="Se connecter &rarr;" />
    </p>

    <p class="help">
        <a href="{$admin_url}password.php">Pas de mot de passe ou mot de passe perdu ?</a>
    </p>

</form>

{include file="admin/_foot.tpl"}

Modified src/templates/admin/membres/fiche.tpl from [e28c9f3bc1] to [eded8d3b78].

69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
            {if $membre->$c}Oui{else}Non{/if}
        {elseif empty($membre->$c)}
            <em>(Non renseigné)</em>
        {elseif $c == 'nom'}
            <strong>{$membre->$c}</strong>
        {elseif $c == 'email'}
            <a href="mailto:{$membre->$c}">{$membre->$c}</a>
            | <a href="{$www_url}admin/membres/message.php?id={$membre.id}"><b class="icn action">✉</b> Envoyer un message</a>
        {elseif $config.type == 'email'}
            <a href="mailto:{$membre->$c}">{$membre->$c}</a>
        {elseif $config.type == 'tel'}
            <a href="tel:{$membre->$c}">{$membre->$c|format_tel}</a>
        {elseif $config.type == 'country'}
            {$membre->$c|get_country_name}
        {elseif $config.type == 'date' || $config.type == 'datetime'}







|







69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
            {if $membre->$c}Oui{else}Non{/if}
        {elseif empty($membre->$c)}
            <em>(Non renseigné)</em>
        {elseif $c == 'nom'}
            <strong>{$membre->$c}</strong>
        {elseif $c == 'email'}
            <a href="mailto:{$membre->$c}">{$membre->$c}</a>
            | <a href="{$admin_url}membres/message.php?id={$membre.id}"><b class="icn action">✉</b> Envoyer un message</a>
        {elseif $config.type == 'email'}
            <a href="mailto:{$membre->$c}">{$membre->$c}</a>
        {elseif $config.type == 'tel'}
            <a href="tel:{$membre->$c}">{$membre->$c|format_tel}</a>
        {elseif $config.type == 'country'}
            {$membre->$c|get_country_name}
        {elseif $config.type == 'date' || $config.type == 'datetime'}

Modified src/templates/admin/membres/import.tpl from [673573742c] to [b30cfa5d1f].

1
2
3
4
5
6
7
8
9
10
11
12
{include file="admin/_head.tpl" title="Import & export des membres" current="membres" js=1}

<ul class="actions">
    <li class="current"><a href="{$www_url}admin/membres/import.php">Importer</a></li>
    <li><a href="{$www_url}admin/membres/import.php?export">Exporter en CSV</a></li>
</ul>

{form_errors}

{if $ok}
    <p class="confirm">
        L'import s'est bien déroulé.



|
|







1
2
3
4
5
6
7
8
9
10
11
12
{include file="admin/_head.tpl" title="Import & export des membres" current="membres" js=1}

<ul class="actions">
    <li class="current"><a href="{$admin_url}membres/import.php">Importer</a></li>
    <li><a href="{$admin_url}membres/import.php?export">Exporter en CSV</a></li>
</ul>

{form_errors}

{if $ok}
    <p class="confirm">
        L'import s'est bien déroulé.

Modified src/templates/admin/membres/index.tpl from [cb8ba52e9b] to [346b3591a7].

101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
            <td></td>
        </thead>
        <tbody>
            {foreach from=$liste item="membre"}
                <tr>
                    <th>{$membre.identite}</th>
                    <td class="actions">
                        {if !empty($membre.email)}<a href="{$www_url}admin/membres/message.php?id={$membre.id}">Envoyer un message</a>{/if}
                    </td>
                </tr>
            {/foreach}
        </tbody>
    </table>

    {if !empty($pagination_url)}







|







101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
            <td></td>
        </thead>
        <tbody>
            {foreach from=$liste item="membre"}
                <tr>
                    <th>{$membre.identite}</th>
                    <td class="actions">
                        {if !empty($membre.email)}<a href="{$admin_url}membres/message.php?id={$membre.id}">Envoyer un message</a>{/if}
                    </td>
                </tr>
            {/foreach}
        </tbody>
    </table>

    {if !empty($pagination_url)}

Modified src/templates/admin/membres/recherche.tpl from [f0aae1c0da] to [a917988cc5].

83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
                        {if $champ == $c}
                            <th><strong>{$membre->$c|raw|display_champ_membre:$cfg}</strong></th>
                        {else}
                            <td>{$membre->$c|raw|display_champ_membre:$cfg}</td>
                        {/if}
                    {/foreach}
                    <td class="actions">
                        {if !empty($membre.email)}<a class="icn" href="{$www_url}admin/membres/message.php?id={$membre.id}" title="Envoyer un message">✉</a> {/if}
                        <a class="icn" href="modifier.php?id={$membre.id}" title="Modifier la fiche membre">✎</a>
                    </td>
                </tr>
            {/foreach}
        </tbody>
    </table>








|







83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
                        {if $champ == $c}
                            <th><strong>{$membre->$c|raw|display_champ_membre:$cfg}</strong></th>
                        {else}
                            <td>{$membre->$c|raw|display_champ_membre:$cfg}</td>
                        {/if}
                    {/foreach}
                    <td class="actions">
                        {if !empty($membre.email)}<a class="icn" href="{$admin_url}membres/message.php?id={$membre.id}" title="Envoyer un message">✉</a> {/if}
                        <a class="icn" href="modifier.php?id={$membre.id}" title="Modifier la fiche membre">✎</a>
                    </td>
                </tr>
            {/foreach}
        </tbody>
    </table>

152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
            <td></td>
        </thead>
        <tbody>
            {foreach from=$liste item="membre"}
                <tr>
                    <th>{$membre.identite}</th>
                    <td class="actions">
                        {if !empty($membre.email)}<a href="{$www_url}admin/membres/message.php?id={$membre.id}">Envoyer un message</a>{/if}
                    </td>
                </tr>
            {/foreach}
        </tbody>
    </table>
    {else}
    <p class="info">







|







152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
            <td></td>
        </thead>
        <tbody>
            {foreach from=$liste item="membre"}
                <tr>
                    <th>{$membre.identite}</th>
                    <td class="actions">
                        {if !empty($membre.email)}<a href="{$admin_url}membres/message.php?id={$membre.id}">Envoyer un message</a>{/if}
                    </td>
                </tr>
            {/foreach}
        </tbody>
    </table>
    {else}
    <p class="info">

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

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
        Si le message n'apparaît pas dans les prochaines minutes, vérifiez le dossier Spam ou Indésirables.
    </p>
{elseif !empty($new_sent)}
    <p class="confirm">
        <strong>Un e-mail contenant votre nouveau mot de passe vous a été envoyé.</strong>
        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>







|







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
        Si le message n'apparaît pas dans les prochaines minutes, vérifiez le dossier Spam ou Indésirables.
    </p>
{elseif !empty($new_sent)}
    <p class="confirm">
        <strong>Un e-mail contenant votre nouveau mot de passe vous a été envoyé.</strong>
        Si le message n'apparaît pas dans les prochaines minutes, vérifiez le dossier Spam ou Indésirables.
    </p>
    <p><a href="{$admin_url}login.php">Connexion &rarr;</a></p>
{else}

    {form_errors}

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

        <fieldset>

Modified src/templates/admin/wiki/chercher.tpl from [608bc4531d] to [779cd678e9].

1
2
3
4
5
6
7
8
9
10
{include file="admin/_head.tpl" title="Recherche" current="wiki/chercher"}

<form method="get" action="{$www_url}admin/wiki/chercher.php" class="wikiSearch">
    <fieldset>
        <legend>Rechercher une page</legend>
        <p>
            <input type="text" name="q" value="{$recherche}" size="25" />
            <input type="submit" value="Chercher" />
        </p>
    </fieldset>


|







1
2
3
4
5
6
7
8
9
10
{include file="admin/_head.tpl" title="Recherche" current="wiki/chercher"}

<form method="get" action="{$admin_url}wiki/chercher.php" class="wikiSearch">
    <fieldset>
        <legend>Rechercher une page</legend>
        <p>
            <input type="text" name="q" value="{$recherche}" size="25" />
            <input type="submit" value="Chercher" />
        </p>
    </fieldset>

Modified src/templates/admin/wiki/historique.tpl from [18904d2815] to [d5a6d6126a].

1
2
3
4
5
6
7
8
9
10
11
{include file="admin/_head.tpl" title="Historique : %s"|args:$page.titre current="wiki"}

<ul class="actions">
    <li><a href="{$www_url}admin/wiki/?{$page.uri}">Voir la page</a></li>
</ul>

{if !empty($revisions)}
    <table class="list wikiRevisions">
    {foreach from=$revisions item="rev"}
        <tr>
            <td>



|







1
2
3
4
5
6
7
8
9
10
11
{include file="admin/_head.tpl" title="Historique : %s"|args:$page.titre current="wiki"}

<ul class="actions">
    <li><a href="{$admin_url}wiki/?{$page.uri}">Voir la page</a></li>
</ul>

{if !empty($revisions)}
    <table class="list wikiRevisions">
    {foreach from=$revisions item="rev"}
        <tr>
            <td>
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
                        <a href="?id={$page.id}&amp;diff={$rev.revision-1}.{$rev.revision}">diff</a>
                    {/if}
                {/if}
            </td>
            <th>{$rev.date|date_fr:'d/m/Y à H:i'}</th>
            <td>
                {if $session->canAccess('membres', Garradin\Membres::DROIT_ACCES)}
                <a href="{$www_url}admin/membres/fiche.php?id={$rev.id_auteur}">{$rev.nom_auteur}</a>
                {/if}
            </td>
            <td class="length">
                {$rev.taille} octets
                {if $rev.revision > 1 && !$rev.chiffrement}
                    {if $rev.diff_taille > 0}
                        <ins>(+{$rev.diff_taille})</ins>







|







24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
                        <a href="?id={$page.id}&amp;diff={$rev.revision-1}.{$rev.revision}">diff</a>
                    {/if}
                {/if}
            </td>
            <th>{$rev.date|date_fr:'d/m/Y à H:i'}</th>
            <td>
                {if $session->canAccess('membres', Garradin\Membres::DROIT_ACCES)}
                <a href="{$admin_url}membres/fiche.php?id={$rev.id_auteur}">{$rev.nom_auteur}</a>
                {/if}
            </td>
            <td class="length">
                {$rev.taille} octets
                {if $rev.revision > 1 && !$rev.chiffrement}
                    {if $rev.diff_taille > 0}
                        <ins>(+{$rev.diff_taille})</ins>
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
        </tr>
    {/foreach}
    </table>
{elseif !empty($diff)}
    <div class="wikiRevision revisionLeft">
        <h3>Version du {$rev1.date|date_fr:'d/m/Y à H:i'}</h3>
        {if $session->canAccess('membres', Garradin\Membres::DROIT_ACCES)}
            <h4>De <a href="{$www_url}admin/membres/fiche.php?id={$rev1.id_auteur}">{$rev1.nom_auteur}</a></h4>
        {/if}
        {if $rev1.modification}
            <p><em>{$rev1.modification}</em></p>
        {/if}
    </div>
    <div class="wikiRevision revisionRight">
        <h3>Version {if $rev2.revision == $page.revision}actuelle en date{/if} du {$rev2.date|date_fr:'d/m/Y à H:i'}</h3>
        {if $session->canAccess('membres', Garradin\Membres::DROIT_ACCES)}
            <h4>De <a href="{$www_url}admin/membres/fiche.php?id={$rev2.id_auteur}">{$rev2.nom_auteur}</a></h4>
        {/if}
        {if $rev2.modification}
            <p><em>{$rev2.modification}</em></p>
        {/if}
    </div>
    {diff old=$rev1.contenu new=$rev2.contenu}
{else}







|








|







51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
        </tr>
    {/foreach}
    </table>
{elseif !empty($diff)}
    <div class="wikiRevision revisionLeft">
        <h3>Version du {$rev1.date|date_fr:'d/m/Y à H:i'}</h3>
        {if $session->canAccess('membres', Garradin\Membres::DROIT_ACCES)}
            <h4>De <a href="{$admin_url}membres/fiche.php?id={$rev1.id_auteur}">{$rev1.nom_auteur}</a></h4>
        {/if}
        {if $rev1.modification}
            <p><em>{$rev1.modification}</em></p>
        {/if}
    </div>
    <div class="wikiRevision revisionRight">
        <h3>Version {if $rev2.revision == $page.revision}actuelle en date{/if} du {$rev2.date|date_fr:'d/m/Y à H:i'}</h3>
        {if $session->canAccess('membres', Garradin\Membres::DROIT_ACCES)}
            <h4>De <a href="{$admin_url}membres/fiche.php?id={$rev2.id_auteur}">{$rev2.nom_auteur}</a></h4>
        {/if}
        {if $rev2.modification}
            <p><em>{$rev2.modification}</em></p>
        {/if}
    </div>
    {diff old=$rev1.contenu new=$rev2.contenu}
{else}

Modified src/templates/admin/wiki/page.tpl from [022471442d] to [9618962284].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{if !empty($page.titre) && $can_read}
    {include file="admin/_head.tpl" title=$page.titre current="wiki" js=1}
{else}
    {include file="admin/_head.tpl" title="Wiki" current="wiki"}
{/if}

<ul class="actions">
    {if $session->canAccess('wiki', Garradin\Membres::DROIT_ECRITURE)}
        <li><a href="{$www_url}admin/wiki/creer.php?parent={if $config.accueil_wiki == $page.uri}0{else}{$page.id}{/if}"><strong>Créer une nouvelle page</strong></a></li>
    {/if}
    {if $can_edit}
        <li><a href="{$www_url}admin/wiki/editer.php?id={$page.id}">Éditer</a></li>
    {/if}
    {if $can_read && $page && $page.contenu}
        <li><a href="{$www_url}admin/wiki/historique.php?id={$page.id}">Historique</a>
        {if $page.droit_lecture == Garradin\Wiki::LECTURE_PUBLIC}
            <li><a href="{$www_url}{$page.uri}{if $has_public_children}/{/if}">Voir sur le site</a>
        {/if}
    {/if}
    {if $session->canAccess('wiki', Garradin\Membres::DROIT_ADMIN)}
        <li><a href="{$www_url}admin/wiki/supprimer.php?id={$page.id}">Supprimer</a></li>
    {/if}
</ul>

{if !$can_read}
    <p class="alert">Vous n'avez pas le droit de lire cette page.</p>
{else}
    <div class="breadCrumbs">








|


|


|





|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{if !empty($page.titre) && $can_read}
    {include file="admin/_head.tpl" title=$page.titre current="wiki" js=1}
{else}
    {include file="admin/_head.tpl" title="Wiki" current="wiki"}
{/if}

<ul class="actions">
    {if $session->canAccess('wiki', Garradin\Membres::DROIT_ECRITURE)}
        <li><a href="{$admin_url}wiki/creer.php?parent={if $config.accueil_wiki == $page.uri}0{else}{$page.id}{/if}"><strong>Créer une nouvelle page</strong></a></li>
    {/if}
    {if $can_edit}
        <li><a href="{$admin_url}wiki/editer.php?id={$page.id}">Éditer</a></li>
    {/if}
    {if $can_read && $page && $page.contenu}
        <li><a href="{$admin_url}wiki/historique.php?id={$page.id}">Historique</a>
        {if $page.droit_lecture == Garradin\Wiki::LECTURE_PUBLIC}
            <li><a href="{$www_url}{$page.uri}{if $has_public_children}/{/if}">Voir sur le site</a>
        {/if}
    {/if}
    {if $session->canAccess('wiki', Garradin\Membres::DROIT_ADMIN)}
        <li><a href="{$admin_url}wiki/supprimer.php?id={$page.id}">Supprimer</a></li>
    {/if}
</ul>

{if !$can_read}
    <p class="alert">Vous n'avez pas le droit de lire cette page.</p>
{else}
    <div class="breadCrumbs">
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52

    {if !$page}
        <p class="error">
            Cette page n'existe pas.
        </p>

        {if $can_edit}
        <form method="post" action="{$www_url}admin/wiki/creer.php">
            <p class="submit">
                {csrf_field key="wiki_create"}
                <input type="hidden" name="titre" value="{$uri}" />
                <input type="submit" name="create" value="Créer cette page" />
            </p>
        </form>
        {/if}







|







38
39
40
41
42
43
44
45
46
47
48
49
50
51
52

    {if !$page}
        <p class="error">
            Cette page n'existe pas.
        </p>

        {if $can_edit}
        <form method="post" action="{$admin_url}wiki/creer.php">
            <p class="submit">
                {csrf_field key="wiki_create"}
                <input type="hidden" name="titre" value="{$uri}" />
                <input type="submit" name="create" value="Créer cette page" />
            </p>
        </form>
        {/if}
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
                {/if}
            </div>
            {/if}

            <p class="wikiFooter">
                Dernière modification le {$page.date_modification|date_fr:'d/m/Y à H:i'}
                {if $session->canAccess('membres', Garradin\Membres::DROIT_ACCES)}
                par <a href="{$www_url}admin/membres/fiche.php?id={$page.contenu.id_auteur}">{$auteur}</a>
                {/if}
            </p>
        {/if}
    {/if}
{/if}


{include file="admin/_foot.tpl"}







|








117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
                {/if}
            </div>
            {/if}

            <p class="wikiFooter">
                Dernière modification le {$page.date_modification|date_fr:'d/m/Y à H:i'}
                {if $session->canAccess('membres', Garradin\Membres::DROIT_ACCES)}
                par <a href="{$admin_url}membres/fiche.php?id={$page.contenu.id_auteur}">{$auteur}</a>
                {/if}
            </p>
        {/if}
    {/if}
{/if}


{include file="admin/_foot.tpl"}

Modified src/templates/admin/wiki/recent.tpl from [35548681bf] to [7d673143bc].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{include file="admin/_head.tpl" title="Pages modifiées récemment" current="wiki/recent"}

{if !empty($list)}
    <table class="list">
        <tbody>
        {foreach from=$list item="page"}
        <tr>
            <th><a href="{$www_url}admin/wiki/?{$page.uri}">{$page.titre}</a></th>
            <td>{$page.date_modification|date_fr:'d/m/Y à H:i'}</td>
        </tr>
        {/foreach}
        </tbody>
    </table>

    {pagination url="?p=[ID]" page=$current_page bypage=$bypage total=$total}
{else}
    <p class="alert">Pas de modification récente.</p>
{/if}

{include file="admin/_foot.tpl"}







|












1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{include file="admin/_head.tpl" title="Pages modifiées récemment" current="wiki/recent"}

{if !empty($list)}
    <table class="list">
        <tbody>
        {foreach from=$list item="page"}
        <tr>
            <th><a href="{$admin_url}wiki/?{$page.uri}">{$page.titre}</a></th>
            <td>{$page.date_modification|date_fr:'d/m/Y à H:i'}</td>
        </tr>
        {/foreach}
        </tbody>
    </table>

    {pagination url="?p=[ID]" page=$current_page bypage=$bypage total=$total}
{else}
    <p class="alert">Pas de modification récente.</p>
{/if}

{include file="admin/_foot.tpl"}

Modified src/templates/admin/wiki/supprimer.tpl from [24adc9aa6f] to [dc6d537e13].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
{include file="admin/_head.tpl" title="Supprimer : %s"|args:$page.titre current="wiki"}

<ul class="actions">
    <li><a href="{$www_url}admin/wiki/"><strong>Wiki</strong></a></li>
    <li><a href="{$www_url}admin/wiki/chercher.php">Rechercher</a></li>
    <li><a href="{$www_url}admin/wiki/?{$page.uri}">Voir la page</a></li>
    <li><a href="{$www_url}admin/wiki/editer.php?id={$page.id}">Éditer</a></li>
</ul>

{form_errors}

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

    <fieldset>



|
|
|
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
{include file="admin/_head.tpl" title="Supprimer : %s"|args:$page.titre current="wiki"}

<ul class="actions">
    <li><a href="{$admin_url}wiki/"><strong>Wiki</strong></a></li>
    <li><a href="{$admin_url}wiki/chercher.php">Rechercher</a></li>
    <li><a href="{$admin_url}wiki/?{$page.uri}">Voir la page</a></li>
    <li><a href="{$admin_url}wiki/editer.php?id={$page.id}">Éditer</a></li>
</ul>

{form_errors}

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

    <fieldset>

Modified src/www/admin/_inc.php from [4e850891ca] to [e0bbbc300b].

36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70

function qg($key)
{
    return isset($_GET[$key]) ? $_GET[$key] : null;
}

$tpl = Template::getInstance();
$tpl->assign('admin_url', WWW_URL . 'admin/');

$form = new Form;
$tpl->assign_by_ref('form', $form);

$session = new Session;

$tpl->assign('session', $session);
$tpl->assign('config', Config::getInstance()->getConfig());

if (!defined('Garradin\LOGIN_PROCESS'))
{
    if (!$session->isLogged())
    {
        if ($session->isOTPRequired())
        {
            Utils::redirect('/admin/login_otp.php');
        }
        else
        {
            Utils::redirect('/admin/login.php');
        }
    }

    $tpl->assign('is_logged', true);

    $user = $session->getUser();
    $tpl->assign('user', $user);







|















|



|







36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70

function qg($key)
{
    return isset($_GET[$key]) ? $_GET[$key] : null;
}

$tpl = Template::getInstance();
$tpl->assign('admin_url', ADMIN_URL);

$form = new Form;
$tpl->assign_by_ref('form', $form);

$session = new Session;

$tpl->assign('session', $session);
$tpl->assign('config', Config::getInstance()->getConfig());

if (!defined('Garradin\LOGIN_PROCESS'))
{
    if (!$session->isLogged())
    {
        if ($session->isOTPRequired())
        {
            Utils::redirect(ADMIN_URL . 'login_otp.php');
        }
        else
        {
            Utils::redirect(ADMIN_URL . 'login.php');
        }
    }

    $tpl->assign('is_logged', true);

    $user = $session->getUser();
    $tpl->assign('user', $user);

Modified src/www/admin/compta/banques/index.php from [eb4af51836] to [bec2040d3e].

33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
                'compte_debit'  =>  $solde < 0 ? null : $id,
                'numero_piece'  =>  null,
                'remarques'     =>  'Opération automatique à l\'ajout du compte dans la liste des comptes bancaires',
                'id_auteur'     =>  $user->id,
            ]);
        }

        Utils::redirect('/admin/compta/banques/');
    }
    catch (UserException $e)
    {
        $form->addError($e->getMessage());
    }
}








|







33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
                'compte_debit'  =>  $solde < 0 ? null : $id,
                'numero_piece'  =>  null,
                'remarques'     =>  'Opération automatique à l\'ajout du compte dans la liste des comptes bancaires',
                'id_auteur'     =>  $user->id,
            ]);
        }

        Utils::redirect(ADMIN_URL . 'compta/banques/');
    }
    catch (UserException $e)
    {
        $form->addError($e->getMessage());
    }
}

Modified src/www/admin/compta/banques/modifier.php from [9a9183f85e] to [580b266350].

21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
        $id = $banque->edit($compte->id, [
            'libelle' => f('libelle'),
            'banque'  => f('banque'),
            'iban'    => f('iban'),
            'bic'     =>  f('bic'),
        ]);

        Utils::redirect('/admin/compta/banques/');
    }
    catch (UserException $e)
    {
        $form->addError($e->getMessage());
    }
}

$tpl->assign('compte', $compte);

$tpl->display('admin/compta/banques/modifier.tpl');







|










21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
        $id = $banque->edit($compte->id, [
            'libelle' => f('libelle'),
            'banque'  => f('banque'),
            'iban'    => f('iban'),
            'bic'     =>  f('bic'),
        ]);

        Utils::redirect(ADMIN_URL . 'compta/banques/');
    }
    catch (UserException $e)
    {
        $form->addError($e->getMessage());
    }
}

$tpl->assign('compte', $compte);

$tpl->display('admin/compta/banques/modifier.tpl');

Modified src/www/admin/compta/banques/supprimer.php from [c38863ebf9] to [a80679a404].

16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
}

if (f('delete') && $form->check('compta_delete_banque_' . $compte->id))
{
	try
	{
		$banque->delete($compte->id);
		Utils::redirect('/admin/compta/banques/');
	}
	catch (UserException $e)
	{
		$form->addError($e->getMessage());
	}
}

$tpl->assign('compte', $compte);

$tpl->display('admin/compta/banques/supprimer.tpl');







|










16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
}

if (f('delete') && $form->check('compta_delete_banque_' . $compte->id))
{
	try
	{
		$banque->delete($compte->id);
		Utils::redirect(ADMIN_URL . 'compta/banques/');
	}
	catch (UserException $e)
	{
		$form->addError($e->getMessage());
	}
}

$tpl->assign('compte', $compte);

$tpl->display('admin/compta/banques/supprimer.tpl');

Modified src/www/admin/compta/categories/ajouter.php from [532e949958] to [ccc6c6987b].

32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
            if (f('type') == Categories::DEPENSES)
                $type = 'depenses';
            elseif (f('type') == Categories::AUTRES)
                $type = 'autres';
            else
                $type = 'recettes';

            Utils::redirect('/admin/compta/categories/?'.$type);
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

$tpl->assign('type', f('type') !== null ? f('type') : Categories::RECETTES);
$tpl->assign('comptes', $comptes->listTree());
$tpl->assign('categories', $cats);

$tpl->display('admin/compta/categories/ajouter.tpl');







|













32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
            if (f('type') == Categories::DEPENSES)
                $type = 'depenses';
            elseif (f('type') == Categories::AUTRES)
                $type = 'autres';
            else
                $type = 'recettes';

            Utils::redirect(ADMIN_URL . 'compta/categories/?'.$type);
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

$tpl->assign('type', f('type') !== null ? f('type') : Categories::RECETTES);
$tpl->assign('comptes', $comptes->listTree());
$tpl->assign('categories', $cats);

$tpl->display('admin/compta/categories/ajouter.tpl');

Modified src/www/admin/compta/categories/modifier.php from [6f533a8d90] to [12706d60d1].

36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
            if ($cat->type == Compta\Categories::DEPENSES)
                $type = 'depenses';
            elseif ($cat->type == Compta\Categories::AUTRES)
                $type = 'autres';
            else
                $type = 'recettes';

            Utils::redirect('/admin/compta/categories/?'.$type);
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

$tpl->assign('cat', $cat);

$tpl->display('admin/compta/categories/modifier.tpl');







|











36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
            if ($cat->type == Compta\Categories::DEPENSES)
                $type = 'depenses';
            elseif ($cat->type == Compta\Categories::AUTRES)
                $type = 'autres';
            else
                $type = 'recettes';

            Utils::redirect(ADMIN_URL . 'compta/categories/?'.$type);
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

$tpl->assign('cat', $cat);

$tpl->display('admin/compta/categories/modifier.tpl');

Modified src/www/admin/compta/categories/supprimer.php from [9ae189a650] to [db80f3760b].

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
}

if (f('delete') && $form->check('delete_compta_cat_' . $cat->id))
{
    try
    {
        $cats->delete($id);
        Utils::redirect('/admin/compta/categories/');
    }
    catch (UserException $e)
    {
        $form->addError($e->getMessage());
    }
}

$tpl->assign('cat', $cat);

$tpl->display('admin/compta/categories/supprimer.tpl');







|










19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
}

if (f('delete') && $form->check('delete_compta_cat_' . $cat->id))
{
    try
    {
        $cats->delete($id);
        Utils::redirect(ADMIN_URL . 'compta/categories/');
    }
    catch (UserException $e)
    {
        $form->addError($e->getMessage());
    }
}

$tpl->assign('cat', $cat);

$tpl->display('admin/compta/categories/supprimer.tpl');

Modified src/www/admin/compta/comptes/ajouter.php from [3acb83e2fa] to [7be03dc1f5].

21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
            $id = $comptes->add([
                'id'       =>  f('numero'),
                'libelle'  =>  f('libelle'),
                'parent'   =>  f('parent'),
                'position' =>  f('position'),
            ]);

            Utils::redirect('/admin/compta/comptes/?classe='.$classe);
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}







|







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
            $id = $comptes->add([
                'id'       =>  f('numero'),
                'libelle'  =>  f('libelle'),
                'parent'   =>  f('parent'),
                'position' =>  f('position'),
            ]);

            Utils::redirect(ADMIN_URL . 'compta/comptes/?classe='.$classe);
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

Modified src/www/admin/compta/comptes/modifier.php from [869c173d06] to [61a3177e1f].

20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
        try
        {
            $id = $comptes->edit($compte->id, [
                'libelle'  =>  f('libelle'),
                'position' =>  f('position'),
            ]);

            Utils::redirect('/admin/compta/comptes/?classe='.substr($compte->id, 0, 1));
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

$tpl->assign('positions', $comptes->getPositions());
$tpl->assign('position', f('position') ?: $compte->position);
$tpl->assign('compte', $compte);

$tpl->display('admin/compta/comptes/modifier.tpl');







|













20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
        try
        {
            $id = $comptes->edit($compte->id, [
                'libelle'  =>  f('libelle'),
                'position' =>  f('position'),
            ]);

            Utils::redirect(ADMIN_URL . 'compta/comptes/?classe='.substr($compte->id, 0, 1));
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

$tpl->assign('positions', $comptes->getPositions());
$tpl->assign('position', f('position') ?: $compte->position);
$tpl->assign('compte', $compte);

$tpl->display('admin/compta/comptes/modifier.tpl');

Modified src/www/admin/compta/comptes/supprimer.php from [bd3d2bd55c] to [6d0ff3b7ef].

14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
}

if (f('delete') && $form->check('compta_delete_compte_' . $compte->id))
{
    try
    {
        $comptes->delete($compte->id);
        Utils::redirect('/admin/compta/comptes/?classe=' . substr($compte->id, 0, 1));
    }
    catch (UserException $e)
    {
        $form->addError($e->getMessage());
    }
}
elseif (f('disable') && $form->check('compta_disable_compte_' . $compte->id))
{
    try
    {
        $comptes->disable($compte->id);
        Utils::redirect('/admin/compta/comptes/?classe='.substr($compte->id, 0, 1));
    }
    catch (UserException $e)
    {
        $form->addError($e->getMessage());
    }
}

$tpl->assign('can_delete', $comptes->canDelete($compte->id));
$tpl->assign('can_disable', $comptes->canDisable($compte->id));

$tpl->assign('compte', $compte);

$tpl->display('admin/compta/comptes/supprimer.tpl');







|











|













14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
}

if (f('delete') && $form->check('compta_delete_compte_' . $compte->id))
{
    try
    {
        $comptes->delete($compte->id);
        Utils::redirect(ADMIN_URL . 'compta/comptes/?classe=' . substr($compte->id, 0, 1));
    }
    catch (UserException $e)
    {
        $form->addError($e->getMessage());
    }
}
elseif (f('disable') && $form->check('compta_disable_compte_' . $compte->id))
{
    try
    {
        $comptes->disable($compte->id);
        Utils::redirect(ADMIN_URL . 'compta/comptes/?classe='.substr($compte->id, 0, 1));
    }
    catch (UserException $e)
    {
        $form->addError($e->getMessage());
    }
}

$tpl->assign('can_delete', $comptes->canDelete($compte->id));
$tpl->assign('can_disable', $comptes->canDisable($compte->id));

$tpl->assign('compte', $compte);

$tpl->display('admin/compta/comptes/supprimer.tpl');

Modified src/www/admin/compta/exercices/ajouter.php from [e0a18a0e20] to [6ab96d643e].

21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
        {
            $id = $e->add([
                'libelle' =>  f('libelle'),
                'debut'   =>  f('debut'),
                'fin'     =>  f('fin'),
            ]);

            Utils::redirect('/admin/compta/exercices/');
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

$tpl->display('admin/compta/exercices/ajouter.tpl');







|









21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
        {
            $id = $e->add([
                'libelle' =>  f('libelle'),
                'debut'   =>  f('debut'),
                'fin'     =>  f('fin'),
            ]);

            Utils::redirect(ADMIN_URL . 'compta/exercices/');
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

$tpl->display('admin/compta/exercices/ajouter.tpl');

Modified src/www/admin/compta/exercices/cloturer.php from [15ebcb6b96] to [27ad552537].

28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
            $id = $e->close($exercice->id, f('fin'));
        
            if ($id && f('reports'))
            {
                $e->doReports($exercice->id, Utils::modifyDate(f('fin'), '+1 day'));
            }

            Utils::redirect('/admin/compta/exercices/');
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

$tpl->assign('exercice', $exercice);

$tpl->display('admin/compta/exercices/cloturer.tpl');







|











28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
            $id = $e->close($exercice->id, f('fin'));
        
            if ($id && f('reports'))
            {
                $e->doReports($exercice->id, Utils::modifyDate(f('fin'), '+1 day'));
            }

            Utils::redirect(ADMIN_URL . 'compta/exercices/');
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

$tpl->assign('exercice', $exercice);

$tpl->display('admin/compta/exercices/cloturer.tpl');

Modified src/www/admin/compta/exercices/modifier.php from [fb07ad0c31] to [566d206828].

33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
        {
            $id = $e->edit($exercice->id, [
                'libelle'   =>  f('libelle'),
                'debut'     =>  f('debut'),
                'fin'       =>  f('fin'),
            ]);

            Utils::redirect('/admin/compta/exercices/');
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

$tpl->assign('exercice', $exercice);

$tpl->display('admin/compta/exercices/modifier.tpl');







|











33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
        {
            $id = $e->edit($exercice->id, [
                'libelle'   =>  f('libelle'),
                'debut'     =>  f('debut'),
                'fin'       =>  f('fin'),
            ]);

            Utils::redirect(ADMIN_URL . 'compta/exercices/');
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

$tpl->assign('exercice', $exercice);

$tpl->display('admin/compta/exercices/modifier.tpl');

Modified src/www/admin/compta/exercices/supprimer.php from [a021784f75] to [47c6a4fb3d].

23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{
    if ($form->check('compta_supprimer_exercice_'.$exercice->id))
    {
        try
        {
            $id = $e->delete($exercice->id);

            Utils::redirect('/admin/compta/exercices/');
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

$tpl->assign('exercice', $exercice);

$tpl->display('admin/compta/exercices/supprimer.tpl');







|











23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{
    if ($form->check('compta_supprimer_exercice_'.$exercice->id))
    {
        try
        {
            $id = $e->delete($exercice->id);

            Utils::redirect(ADMIN_URL . 'compta/exercices/');
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

$tpl->assign('exercice', $exercice);

$tpl->display('admin/compta/exercices/supprimer.tpl');

Modified src/www/admin/compta/import.php from [9b4e3790c6] to [cbf52a3a51].

36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
                $import->fromCSV($_FILES['upload']['tmp_name']);
            }
            else
            {
                throw new UserException('Import inconnu.');
            }

            Utils::redirect('/admin/compta/import.php?ok');
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

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

$tpl->display('admin/compta/import.tpl');







|











36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
                $import->fromCSV($_FILES['upload']['tmp_name']);
            }
            else
            {
                throw new UserException('Import inconnu.');
            }

            Utils::redirect(ADMIN_URL . 'compta/import.php?ok');
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

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

$tpl->display('admin/compta/import.tpl');

Modified src/www/admin/compta/operations/modifier.php from [7c8e198965] to [6e0e877ba5].

118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
                    'numero_piece'  =>  f('numero_piece'),
                    'remarques'     =>  f('remarques'),
                    'id_categorie'  =>  (int)$cat->id,
                    'id_projet'     =>  f('id_projet'),
                ]);
            }

            Utils::redirect('/admin/compta/operations/voir.php?id='.(int)$operation->id);
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}







|







118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
                    'numero_piece'  =>  f('numero_piece'),
                    'remarques'     =>  f('remarques'),
                    'id_categorie'  =>  (int)$cat->id,
                    'id_projet'     =>  f('id_projet'),
                ]);
            }

            Utils::redirect(ADMIN_URL . 'compta/operations/voir.php?id='.(int)$operation->id);
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

Modified src/www/admin/compta/operations/saisir.php from [a99f67bfb3] to [20d760aa75].

142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
                    'id_auteur'     =>  $user->id,
                    'id_projet'     =>  f('projet') ?: null,
                ]);
            }

            $session->set('context_compta_date', f('date'));

            Utils::redirect('/admin/compta/operations/saisir.php?ok='.(int)$id);
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}







|







142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
                    'id_auteur'     =>  $user->id,
                    'id_projet'     =>  f('projet') ?: null,
                ]);
            }

            $session->set('context_compta_date', f('date'));

            Utils::redirect(ADMIN_URL . 'compta/operations/saisir.php?ok='.(int)$id);
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

Modified src/www/admin/compta/operations/supprimer.php from [ad64e3417f] to [0f0bd1e03f].

18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
if (f('delete'))
{
    if ($form->check('compta_supprimer_' . $operation->id))
    {
        try
        {
            $journal->delete($operation->id);
            Utils::redirect('/admin/compta/operations/');
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

$tpl->assign('operation', $operation);

$tpl->display('admin/compta/operations/supprimer.tpl');







|











18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
if (f('delete'))
{
    if ($form->check('compta_supprimer_' . $operation->id))
    {
        try
        {
            $journal->delete($operation->id);
            Utils::redirect(ADMIN_URL . 'compta/operations/');
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

$tpl->assign('operation', $operation);

$tpl->display('admin/compta/operations/supprimer.tpl');

Modified src/www/admin/compta/projets/index.php from [2b530a4b42] to [439392048d].

37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78

if (f('ajouter') && $form->check('ajout_projet'))
{
	$session->requireAccess('compta', Membres::DROIT_ADMIN);

	try {
		$projets->add(f('libelle'));
		Utils::redirect('/admin/compta/projets/');
	}
	catch (UserException $e)
	{
		$form->addError($e->getMessage());
	}
}
elseif (f('modifier') && $form->check('modifier_projet_' . $id))
{
	try {
		$projets->edit($id, f('libelle'));
		Utils::redirect('/admin/compta/projets/');
	}
	catch (UserException $e)
	{
		$form->addError($e->getMessage());
	}
}
elseif (f('supprimer') && $form->check('supprimer_projet_' . $id))
{
	try {
		$projets->remove($id);
		Utils::redirect('/admin/compta/projets/');
	}
	catch (UserException $e)
	{
		$form->addError($e->getMessage());
	}
}


$tpl->assign('action', $action);
$tpl->assign('liste', $projets->getList());

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







|










|










|












37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78

if (f('ajouter') && $form->check('ajout_projet'))
{
	$session->requireAccess('compta', Membres::DROIT_ADMIN);

	try {
		$projets->add(f('libelle'));
		Utils::redirect(ADMIN_URL . 'compta/projets/');
	}
	catch (UserException $e)
	{
		$form->addError($e->getMessage());
	}
}
elseif (f('modifier') && $form->check('modifier_projet_' . $id))
{
	try {
		$projets->edit($id, f('libelle'));
		Utils::redirect(ADMIN_URL . 'compta/projets/');
	}
	catch (UserException $e)
	{
		$form->addError($e->getMessage());
	}
}
elseif (f('supprimer') && $form->check('supprimer_projet_' . $id))
{
	try {
		$projets->remove($id);
		Utils::redirect(ADMIN_URL . 'compta/projets/');
	}
	catch (UserException $e)
	{
		$form->addError($e->getMessage());
	}
}


$tpl->assign('action', $action);
$tpl->assign('liste', $projets->getList());

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

Modified src/www/admin/config/donnees.php from [fd934fbfc9] to [7a456875f0].

16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
    if (!$form->hasErrors())
    {
        try {
            $config->set('frequence_sauvegardes', f('frequence_sauvegardes'));
            $config->set('nombre_sauvegardes', f('nombre_sauvegardes'));
            $config->save();

            Utils::redirect('/admin/config/donnees.php?ok=config');
        } catch (UserException $e) {
            $form->addError($e->getMessage());
        }
    }
}
elseif (f('create'))
{
    $form->check('backup_create');

    if (!$form->hasErrors())
    {
        try {
            $s->create();
            Utils::redirect('/admin/config/donnees.php?ok=create');
        } catch (UserException $e) {
            $form->addError($e->getMessage());
        }
    }
}
elseif (f('download'))
{







|













|







16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
    if (!$form->hasErrors())
    {
        try {
            $config->set('frequence_sauvegardes', f('frequence_sauvegardes'));
            $config->set('nombre_sauvegardes', f('nombre_sauvegardes'));
            $config->save();

            Utils::redirect(ADMIN_URL . 'config/donnees.php?ok=config');
        } catch (UserException $e) {
            $form->addError($e->getMessage());
        }
    }
}
elseif (f('create'))
{
    $form->check('backup_create');

    if (!$form->hasErrors())
    {
        try {
            $s->create();
            Utils::redirect(ADMIN_URL . 'config/donnees.php?ok=create');
        } catch (UserException $e) {
            $form->addError($e->getMessage());
        }
    }
}
elseif (f('download'))
{
58
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
{
    $form->check('backup_manage');

    if (!$form->hasErrors())
    {
        try {
            $r = $s->restoreFromLocal(f('file'));
            Utils::redirect('/admin/config/donnees.php?ok=restore&code=' . (int)$r);
        } catch (UserException $e) {
            $form->addError($e->getMessage());
        }
    }
}
elseif (f('remove'))
{
    $form->check('backup_manage');

    if (!$form->hasErrors())
    {
        try {
            $s->remove(f('file'));
            Utils::redirect('/admin/config/donnees.php?ok=remove');
        } catch (UserException $e) {
            $form->addError($e->getMessage());
        }
    }
}
elseif (f('restore_file'))
{
    $form->check('backup_restore');

    if (!$form->hasErrors())
    {
        // Ignorer la vérification d'intégrité si autorisé et demandé
        $check = (ALLOW_MODIFIED_IMPORT && f('force_import')) ? false : true;

        try {
            $r = $s->restoreFromUpload($_FILES['file'], $user->id, $check);
            Utils::redirect('/admin/config/donnees.php?ok=restore&code=' . (int)$r);
        } catch (UserException $e) {
            $form->addError($e->getMessage());
            $code = $e->getCode();
        }
    }
}








|













|
















|







58
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
{
    $form->check('backup_manage');

    if (!$form->hasErrors())
    {
        try {
            $r = $s->restoreFromLocal(f('file'));
            Utils::redirect(ADMIN_URL . 'config/donnees.php?ok=restore&code=' . (int)$r);
        } catch (UserException $e) {
            $form->addError($e->getMessage());
        }
    }
}
elseif (f('remove'))
{
    $form->check('backup_manage');

    if (!$form->hasErrors())
    {
        try {
            $s->remove(f('file'));
            Utils::redirect(ADMIN_URL . 'config/donnees.php?ok=remove');
        } catch (UserException $e) {
            $form->addError($e->getMessage());
        }
    }
}
elseif (f('restore_file'))
{
    $form->check('backup_restore');

    if (!$form->hasErrors())
    {
        // Ignorer la vérification d'intégrité si autorisé et demandé
        $check = (ALLOW_MODIFIED_IMPORT && f('force_import')) ? false : true;

        try {
            $r = $s->restoreFromUpload($_FILES['file'], $user->id, $check);
            Utils::redirect(ADMIN_URL . 'config/donnees.php?ok=restore&code=' . (int)$r);
        } catch (UserException $e) {
            $form->addError($e->getMessage());
            $code = $e->getCode();
        }
    }
}

Modified src/www/admin/config/index.php from [76e88cf2fb] to [cf79456e90].

40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
            $config->set('couleur1', null);
            $config->set('couleur2', null);
            $config->set('image_fond', null);
        }

        $config->save();

        Utils::redirect('/admin/config/?ok');
    }
    catch (UserException $e)
    {
        $form->addError($e->getMessage());
    }
}








|







40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
            $config->set('couleur1', null);
            $config->set('couleur2', null);
            $config->set('image_fond', null);
        }

        $config->save();

        Utils::redirect(ADMIN_URL . 'config/?ok');
    }
    catch (UserException $e)
    {
        $form->addError($e->getMessage());
    }
}

Modified src/www/admin/config/membres.php from [5ecc83e171] to [7610ec7561].

37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{
    $form->check('config_membres');

    if (!$form->hasErrors())
    {
        if (f('reset'))
        {
            Utils::redirect('/admin/config/membres.php');
        }
        elseif (f('add'))
        {
            try {
                if (f('preset'))
                {
                    $presets = Membres\Champs::listUnusedPresets($champs);







|







37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{
    $form->check('config_membres');

    if (!$form->hasErrors())
    {
        if (f('reset'))
        {
            Utils::redirect(ADMIN_URL . 'config/membres.php');
        }
        elseif (f('add'))
        {
            try {
                if (f('preset'))
                {
                    $presets = Membres\Champs::listUnusedPresets($champs);
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
                $form->addError($e->getMessage());
            }
        }
        elseif (f('save'))
        {
            try {
                $champs->save();
                Utils::redirect('/admin/config/membres.php?ok');
            }
            catch (UserException $e)
            {
                $form->addError($e->getMessage());
            }
        }
    }







|







88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
                $form->addError($e->getMessage());
            }
        }
        elseif (f('save'))
        {
            try {
                $champs->save();
                Utils::redirect(ADMIN_URL . 'config/membres.php?ok');
            }
            catch (UserException $e)
            {
                $form->addError($e->getMessage());
            }
        }
    }

Modified src/www/admin/config/plugins.php from [b5fb4adb93] to [e71350c226].

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
        'plugin' => 'required',
    ]);

    if (!$form->hasErrors())
    {
        try {
            Plugin::install(f('plugin'), false);
            Utils::redirect('/admin/config/plugins.php');
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

if (f('delete'))
{
    $form->check('delete_plugin_' . qg('delete'), [
        'plugin' => 'required',
    ]);

    if (!$form->hasErrors())
    {
        try {
            $plugin = new Plugin(qg('delete'));
            $plugin->uninstall();
            
            Utils::redirect('/admin/config/plugins.php');
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}







|




















|







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
        'plugin' => 'required',
    ]);

    if (!$form->hasErrors())
    {
        try {
            Plugin::install(f('plugin'), false);
            Utils::redirect(ADMIN_URL . 'config/plugins.php');
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

if (f('delete'))
{
    $form->check('delete_plugin_' . qg('delete'), [
        'plugin' => 'required',
    ]);

    if (!$form->hasErrors())
    {
        try {
            $plugin = new Plugin(qg('delete'));
            $plugin->uninstall();
            
            Utils::redirect(ADMIN_URL . 'config/plugins.php');
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

Modified src/www/admin/config/site.php from [b5431c03a1] to [6929129da8].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
namespace Garradin;

require_once __DIR__ . '/_inc.php';

if (f('save') && $form->check('config_site'))
{
    try {
        $config->set('champs_obligatoires', f('champs_obligatoires'));
        $config->set('champs_modifiables_membre', f('champs_modifiables_membre'));
        $config->set('categorie_membres', f('categorie_membres'));
        $config->save();

        Utils::redirect('/admin/config/site.php?ok');
    }
    catch (UserException $e)
    {
        $form->addError($e->getMessage());
    }
}

if (f('select') && f('reset') && $form->check('squelettes'))
{
    try {
        foreach (f('select') as $source)
        {
            if (!Squelette::resetSource($source))
            {
                throw new UserException('Impossible de réinitialiser le squelette.');
            }
        }
    
        Utils::redirect('/admin/config/site.php?reset_ok');
    }
    catch (UserException $e)
    {
        $form->addError($e->getMessage());
    }
}














|


















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
namespace Garradin;

require_once __DIR__ . '/_inc.php';

if (f('save') && $form->check('config_site'))
{
    try {
        $config->set('champs_obligatoires', f('champs_obligatoires'));
        $config->set('champs_modifiables_membre', f('champs_modifiables_membre'));
        $config->set('categorie_membres', f('categorie_membres'));
        $config->save();

        Utils::redirect(ADMIN_URL . 'config/site.php?ok');
    }
    catch (UserException $e)
    {
        $form->addError($e->getMessage());
    }
}

if (f('select') && f('reset') && $form->check('squelettes'))
{
    try {
        foreach (f('select') as $source)
        {
            if (!Squelette::resetSource($source))
            {
                throw new UserException('Impossible de réinitialiser le squelette.');
            }
        }
    
        Utils::redirect(ADMIN_URL . 'config/site.php?reset_ok');
    }
    catch (UserException $e)
    {
        $form->addError($e->getMessage());
    }
}

51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
    $csrf_key = 'edit_skel_' . md5(qg('edit'));

    if (f('save') && $form->check($csrf_key))
    {
        if (Squelette::editSource(qg('edit'), f('content')))
        {
            $fullscreen = null !== qg('fullscreen') ? '#fullscreen' : '';
            Utils::redirect('/admin/config/site.php?edit='.rawurlencode(qg('edit')).'&ok'.$fullscreen);
        }
        else
        {
            $form->addError("Impossible d'enregistrer le squelette.");
        }
    }








|







51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
    $csrf_key = 'edit_skel_' . md5(qg('edit'));

    if (f('save') && $form->check($csrf_key))
    {
        if (Squelette::editSource(qg('edit'), f('content')))
        {
            $fullscreen = null !== qg('fullscreen') ? '#fullscreen' : '';
            Utils::redirect(ADMIN_URL . 'config/site.php?edit='.rawurlencode(qg('edit')).'&ok'.$fullscreen);
        }
        else
        {
            $form->addError("Impossible d'enregistrer le squelette.");
        }
    }

Modified src/www/admin/install.php from [a663d967b6] to [0d0c1e0547].

71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
{
    // Renommage du fichier sqlite à la version 0.5.0
    $old_file = str_replace('.sqlite', '.db', DB_FILE);

    if (file_exists($old_file))
    {
        rename($old_file, DB_FILE);
        Utils::redirect('/admin/upgrade.php');
    }
}

function f($key)
{
    return \KD2\Form::get($key);
}

$tpl = Template::getInstance();
$tpl->assign('admin_url', WWW_URL . 'admin/');

$form = new Form;
$tpl->assign_by_ref('form', $form);

if (file_exists(DB_FILE))
{
    $tpl->assign('disabled', true);







|









|







71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
{
    // Renommage du fichier sqlite à la version 0.5.0
    $old_file = str_replace('.sqlite', '.db', DB_FILE);

    if (file_exists($old_file))
    {
        rename($old_file, DB_FILE);
        Utils::redirect(ADMIN_URL . 'upgrade.php');
    }
}

function f($key)
{
    return \KD2\Form::get($key);
}

$tpl = Template::getInstance();
$tpl->assign('admin_url', ADMIN_URL);

$form = new Form;
$tpl->assign_by_ref('form', $form);

if (file_exists(DB_FILE))
{
    $tpl->assign('disabled', true);
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
        if (!$form->hasErrors())
        {
            try {
            	Install::install(f('nom_asso'), f('adresse_asso'), f('email_asso'),
            		f('cat_membre'), f('nom_membre'), f('email_membre'), f('passe'),
            		WWW_URL);

            	Utils::redirect('/admin/login.php');
            }
            catch (UserException $e)
            {
                @unlink(DB_FILE);

                $form->addError($e->getMessage());
            }
        }
    }
}

$tpl->assign('passphrase', Utils::suggestPassword());
$tpl->display('admin/install.tpl');







|













112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
        if (!$form->hasErrors())
        {
            try {
            	Install::install(f('nom_asso'), f('adresse_asso'), f('email_asso'),
            		f('cat_membre'), f('nom_membre'), f('email_membre'), f('passe'),
            		WWW_URL);

            	Utils::redirect(ADMIN_URL . 'login.php');
            }
            catch (UserException $e)
            {
                @unlink(DB_FILE);

                $form->addError($e->getMessage());
            }
        }
    }
}

$tpl->assign('passphrase', Utils::suggestPassword());
$tpl->display('admin/install.tpl');

Modified src/www/admin/login.php from [eee45cc104] to [65b282fb8b].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php
namespace Garradin;

const LOGIN_PROCESS = true;

require_once __DIR__ . '/_inc.php';

// L'utilisateur est déjà connecté
if ($session->isLogged())
{
    Utils::redirect('/admin/');
}

// Relance session_start et renvoie une image de 1px transparente
if (qg('keepSessionAlive') !== null)
{
    $session->keepAlive();











|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php
namespace Garradin;

const LOGIN_PROCESS = true;

require_once __DIR__ . '/_inc.php';

// L'utilisateur est déjà connecté
if ($session->isLogged())
{
    Utils::redirect(ADMIN_URL . '');
}

// Relance session_start et renvoie une image de 1px transparente
if (qg('keepSessionAlive') !== null)
{
    $session->keepAlive();

34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
        '_id'       => 'required|string',
        'passe'     => 'required|string',
        'permanent' => 'boolean',
    ]);

    if (!$form->hasErrors() && ($login = $session->login(f('_id'), f('passe'), (bool) f('permanent'))))
    {
        Utils::redirect('/admin/');
    }
}

$champs = $config->get('champs_membres');

$champ = $champs->get($config->get('champ_identifiant'));








|







34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
        '_id'       => 'required|string',
        'passe'     => 'required|string',
        'permanent' => 'boolean',
    ]);

    if (!$form->hasErrors() && ($login = $session->login(f('_id'), f('passe'), (bool) f('permanent'))))
    {
        Utils::redirect(ADMIN_URL);
    }
}

$champs = $config->get('champs_membres');

$champ = $champs->get($config->get('champ_identifiant'));

Modified src/www/admin/login_otp.php from [b06ea20dcd] to [b90ba55b18].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php

namespace Garradin;

const LOGIN_PROCESS = true;

require_once __DIR__ . '/_inc.php';

if (!$session->isOTPRequired())
{
    Utils::redirect('/admin/');
}

$login = null;

if (f('login'))
{
    $form->check('otp', [
        'code' => 'numeric|required',
    ]);

    if (!$form->hasErrors() && ($login = $session->loginOTP(f('code'))))
    {
        Utils::redirect('/admin/');
    }
}

$tpl->assign('fail', $login === false);

$tpl->assign('time', time());

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










|












|








1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php

namespace Garradin;

const LOGIN_PROCESS = true;

require_once __DIR__ . '/_inc.php';

if (!$session->isOTPRequired())
{
    Utils::redirect(ADMIN_URL . '');
}

$login = null;

if (f('login'))
{
    $form->check('otp', [
        'code' => 'numeric|required',
    ]);

    if (!$form->hasErrors() && ($login = $session->loginOTP(f('code'))))
    {
        Utils::redirect(ADMIN_URL);
    }
}

$tpl->assign('fail', $login === false);

$tpl->assign('time', time());

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

Modified src/www/admin/membres/action.php from [572e76b6c5] to [c6d0a5fc14].

35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
        'selected' => 'required|array',
        'id_categorie' => 'required|numeric',
    ]);

    if (!$form->hasErrors())
    {
        $membres->changeCategorie(f('id_categorie'), f('selected'));
        Utils::redirect('/admin/membres/');
    }
}
elseif ($action == 'delete' && f('confirm'))
{
    $form->check('membres_action', [
        'selected' => 'required|array',
    ]);

    if (!$form->hasErrors())
    {
        $membres->delete(f('selected'));
        Utils::redirect('/admin/membres/');
    }
}

$tpl->assign('selected', f('selected'));
$tpl->assign('nb_selected', count(f('selected')));

if ($action == 'move')







|











|







35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
        'selected' => 'required|array',
        'id_categorie' => 'required|numeric',
    ]);

    if (!$form->hasErrors())
    {
        $membres->changeCategorie(f('id_categorie'), f('selected'));
        Utils::redirect(ADMIN_URL . 'membres/');
    }
}
elseif ($action == 'delete' && f('confirm'))
{
    $form->check('membres_action', [
        'selected' => 'required|array',
    ]);

    if (!$form->hasErrors())
    {
        $membres->delete(f('selected'));
        Utils::redirect(ADMIN_URL . 'membres/');
    }
}

$tpl->assign('selected', f('selected'));
$tpl->assign('nb_selected', count(f('selected')));

if ($action == 'move')

Modified src/www/admin/membres/ajouter.php from [864047be64] to [855d0663f7].

33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
            foreach ($champs->getAll() as $key=>$dismiss)
            {
                $data[$key] = f($key);
            }

            $id = $membres->add($data);

            Utils::redirect('/admin/membres/fiche.php?id='.(int)$id);
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}







|







33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
            foreach ($champs->getAll() as $key=>$dismiss)
            {
                $data[$key] = f($key);
            }

            $id = $membres->add($data);

            Utils::redirect(ADMIN_URL . 'membres/fiche.php?id='.(int)$id);
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

Modified src/www/admin/membres/categories/index.php from [7aa637066f] to [a435abf714].

15
16
17
18
19
20
21
22
23
24
25
26
27
28

    if (!$form->hasErrors())
    {
        $cats->add([
            'nom' => f('nom'),
        ]);

        Utils::redirect('/admin/membres/categories/');
    }
}

$tpl->assign('liste', $cats->listCompleteWithStats());

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







|






15
16
17
18
19
20
21
22
23
24
25
26
27
28

    if (!$form->hasErrors())
    {
        $cats->add([
            'nom' => f('nom'),
        ]);

        Utils::redirect(ADMIN_URL . 'membres/categories/');
    }
}

$tpl->assign('liste', $cats->listCompleteWithStats());

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

Modified src/www/admin/membres/categories/modifier.php from [9838347dda] to [624c7118d6].

69
70
71
72
73
74
75
76
77
78
79
80
81
82
83

            if ($id == $user->id_categorie)
            {
                // Mise à jour de la session courante
                $session->refresh();
            }

            Utils::redirect('/admin/membres/categories/');
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}







|







69
70
71
72
73
74
75
76
77
78
79
80
81
82
83

            if ($id == $user->id_categorie)
            {
                // Mise à jour de la session courante
                $session->refresh();
            }

            Utils::redirect(ADMIN_URL . 'membres/categories/');
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

Modified src/www/admin/membres/categories/supprimer.php from [e114fcd96a] to [43f9a12d7b].

27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
    $form->check('delete_cat_' . $id);

    if (!$form->hasErrors())
    {
        try {
            $cats->remove($id);
            Utils::redirect('/admin/membres/categories/');
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

$tpl->assign('cat', $cat);

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







|











27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
    $form->check('delete_cat_' . $id);

    if (!$form->hasErrors())
    {
        try {
            $cats->remove($id);
            Utils::redirect(ADMIN_URL . 'membres/categories/');
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

$tpl->assign('cat', $cat);

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

Modified src/www/admin/membres/cotisations/ajout.php from [b23cdfe11b] to [392b5f9081].

63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
                'numero_piece'   =>  f('numero_piece'),
                'remarques'      =>  f('remarques'),
                'a_encaisser'    =>  f('a_encaisser'),
            ];

            $m_cotisations->add($data, $compta);

            Utils::redirect('/admin/membres/cotisations.php?id=' . $id_membre);
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}







|







63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
                'numero_piece'   =>  f('numero_piece'),
                'remarques'      =>  f('remarques'),
                'a_encaisser'    =>  f('a_encaisser'),
            ];

            $m_cotisations->add($data, $compta);

            Utils::redirect(ADMIN_URL . 'membres/cotisations.php?id=' . $id_membre);
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

Modified src/www/admin/membres/cotisations/gestion/modifier.php from [8acb887d25] to [c6ecbc69e3].

34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
            'montant'             => (float) f('montant'),
            'duree'               => $duree,
            'debut'               => $debut,
            'fin'                 => $fin,
            'id_categorie_compta' => $id_cat,
        ]);

        Utils::redirect('/admin/membres/cotisations/');
    }
    catch (UserException $e)
    {
        $form->addError($e->getMessage());
    }
}








|







34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
            'montant'             => (float) f('montant'),
            'duree'               => $duree,
            'debut'               => $debut,
            'fin'                 => $fin,
            'id_categorie_compta' => $id_cat,
        ]);

        Utils::redirect(ADMIN_URL . 'membres/cotisations/');
    }
    catch (UserException $e)
    {
        $form->addError($e->getMessage());
    }
}

Modified src/www/admin/membres/cotisations/gestion/rappel_modifier.php from [c65c98d3c1] to [dfb1636402].

34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
        $rappels->edit($rappel->id, [
            'sujet'         => f('sujet'),
            'texte'         => f('texte'),
            'delai'         => $delai,
            'id_cotisation' => f('id_cotisation'),
        ]);

        Utils::redirect('/admin/membres/cotisations/gestion/rappels.php');
    }
    catch (UserException $e)
    {
        $form->addError($e->getMessage());
    }
}








|







34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
        $rappels->edit($rappel->id, [
            'sujet'         => f('sujet'),
            'texte'         => f('texte'),
            'delai'         => $delai,
            'id_cotisation' => f('id_cotisation'),
        ]);

        Utils::redirect(ADMIN_URL . 'membres/cotisations/gestion/rappels.php');
    }
    catch (UserException $e)
    {
        $form->addError($e->getMessage());
    }
}

Modified src/www/admin/membres/cotisations/gestion/rappel_supprimer.php from [45609acaa5] to [91fa0c34f6].

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
    throw new UserException("Ce rappel n'existe pas.");
}

if (f('delete') && $form->check('delete_rappel_' . $rappel->id))
{
    try {
        $rappels->delete($rappel->id, (bool) f('delete_history'));
        Utils::redirect('/admin/membres/cotisations/gestion/rappels.php');
    }
    catch (UserException $e)
    {
        $form->addError($e->getMessage());
    }
}

$tpl->assign('rappel', $rappel);

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







|










19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
    throw new UserException("Ce rappel n'existe pas.");
}

if (f('delete') && $form->check('delete_rappel_' . $rappel->id))
{
    try {
        $rappels->delete($rappel->id, (bool) f('delete_history'));
        Utils::redirect(ADMIN_URL . 'membres/cotisations/gestion/rappels.php');
    }
    catch (UserException $e)
    {
        $form->addError($e->getMessage());
    }
}

$tpl->assign('rappel', $rappel);

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

Modified src/www/admin/membres/cotisations/gestion/rappels.php from [cc1d420b98] to [d8c9502290].

21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
        $rappels->add([
            'sujet'         => f('sujet'),
            'texte'         => f('texte'),
            'delai'         => $delai,
            'id_cotisation' => f('id_cotisation'),
        ]);

        Utils::redirect('/admin/membres/cotisations/gestion/rappels.php');
    }
    catch (UserException $e)
    {
        $form->addError($e->getMessage());
    }
}








|







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
        $rappels->add([
            'sujet'         => f('sujet'),
            'texte'         => f('texte'),
            'delai'         => $delai,
            'id_cotisation' => f('id_cotisation'),
        ]);

        Utils::redirect(ADMIN_URL . 'membres/cotisations/gestion/rappels.php');
    }
    catch (UserException $e)
    {
        $form->addError($e->getMessage());
    }
}

Modified src/www/admin/membres/cotisations/gestion/supprimer.php from [922d19657c] to [c3a9f9323c].

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
    throw new UserException("Cette cotisation n'existe pas.");
}

if (f('delete') && $form->check('delete_co_' . $co->id))
{
    try {
        $cotisations->delete($co->id);
        Utils::redirect('/admin/membres/cotisations/');
    }
    catch (UserException $e)
    {
        $form->addError($e->getMessage());
    }
}

$tpl->assign('cotisation', $co);

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







|










19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
    throw new UserException("Cette cotisation n'existe pas.");
}

if (f('delete') && $form->check('delete_co_' . $co->id))
{
    try {
        $cotisations->delete($co->id);
        Utils::redirect(ADMIN_URL . 'membres/cotisations/');
    }
    catch (UserException $e)
    {
        $form->addError($e->getMessage());
    }
}

$tpl->assign('cotisation', $co);

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

Modified src/www/admin/membres/cotisations/index.php from [0bd0159ea0] to [b198d992d0].

38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
					'montant'           =>  (float) f('montant'),
					'duree'             =>  $duree,
					'debut'             =>  $debut,
					'fin'               =>  $fin,
					'id_categorie_compta'=> $id_cat,
				]);

				Utils::redirect('/admin/membres/cotisations/');
			}
			catch (UserException $e)
			{
				$form->addError($e->getMessage());
			}
		}
	}







|







38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
					'montant'           =>  (float) f('montant'),
					'duree'             =>  $duree,
					'debut'             =>  $debut,
					'fin'               =>  $fin,
					'id_categorie_compta'=> $id_cat,
				]);

				Utils::redirect(ADMIN_URL . 'membres/cotisations/');
			}
			catch (UserException $e)
			{
				$form->addError($e->getMessage());
			}
		}
	}

Modified src/www/admin/membres/cotisations/rappels.php from [249872b4ce] to [3c87990373].

36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
				'id_rappel'     => NULL,
				'id_cotisation'	=> f('id_cotisation'),
				'id_membre'		=> $membre->id,
				'media'			=> f('media'),
				'date'			=> f('date'),
			]);

			Utils::redirect('/admin/membres/cotisations/rappels.php?id=' . $membre->id . '&ok');
		}
		catch (UserException $e)
		{
			$form->addError($e->getMessage());
		}
	}
}







|







36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
				'id_rappel'     => NULL,
				'id_cotisation'	=> f('id_cotisation'),
				'id_membre'		=> $membre->id,
				'media'			=> f('media'),
				'date'			=> f('date'),
			]);

			Utils::redirect(ADMIN_URL . 'membres/cotisations/rappels.php?id=' . $membre->id . '&ok');
		}
		catch (UserException $e)
		{
			$form->addError($e->getMessage());
		}
	}
}

Modified src/www/admin/membres/cotisations/supprimer.php from [8fae79bc11] to [298dee0445].

30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

if (f('delete'))
{
    if ($form->check('del_cotisation_' . $co->id))
    {
        try {
            $m_cotisations->delete($co->id);
            Utils::redirect('/admin/membres/cotisations.php?id=' . $membre->id);
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

$tpl->assign('membre', $membre);
$tpl->assign('cotisation', $co);
$tpl->assign('nb_operations', $m_cotisations->countOperationsCompta($co->id));

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







|













30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

if (f('delete'))
{
    if ($form->check('del_cotisation_' . $co->id))
    {
        try {
            $m_cotisations->delete($co->id);
            Utils::redirect(ADMIN_URL . 'membres/cotisations.php?id=' . $membre->id);
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

$tpl->assign('membre', $membre);
$tpl->assign('cotisation', $co);
$tpl->assign('nb_operations', $m_cotisations->countOperationsCompta($co->id));

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

Modified src/www/admin/membres/import.php from [cc287776b5] to [1b75882f9f].

39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
                $import->fromCSV($_FILES['upload']['tmp_name']);
            }
            else
            {
                throw new UserException('Import inconnu.');
            }

            Utils::redirect('/admin/membres/import.php?ok');
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}







|







39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
                $import->fromCSV($_FILES['upload']['tmp_name']);
            }
            else
            {
                throw new UserException('Import inconnu.');
            }

            Utils::redirect(ADMIN_URL . 'membres/import.php?ok');
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

Modified src/www/admin/membres/message.php from [b96c032f9e] to [7c97469c92].

33
34
35
36
37
38
39
40
41
42
43
44
45
46
47

    if (!$form->hasErrors())
    {
        try {
            $session->sendMessage($membre->email, f('sujet'),
                f('message'), (bool) f('copie'));

            Utils::redirect('/admin/membres/?sent');
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}







|







33
34
35
36
37
38
39
40
41
42
43
44
45
46
47

    if (!$form->hasErrors())
    {
        try {
            $session->sendMessage($membre->email, f('sujet'),
                f('message'), (bool) f('copie'));

            Utils::redirect(ADMIN_URL . 'membres/?sent');
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

Modified src/www/admin/membres/message_collectif.php from [9ac4678b30] to [2bd7d9d11b].

14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
        'subscribed' => 'boolean',
    ]);

    if (!$form->hasErrors())
    {
        try {
            $membres->sendMessageToCategory(f('dest'), f('sujet'), f('message'), (bool) f('subscribed'));
            Utils::redirect('/admin/membres/?sent');
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}







|







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
        'subscribed' => 'boolean',
    ]);

    if (!$form->hasErrors())
    {
        try {
            $membres->sendMessageToCategory(f('dest'), f('sujet'), f('message'), (bool) f('subscribed'));
            Utils::redirect(ADMIN_URL . 'membres/?sent');
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

Modified src/www/admin/membres/modifier.php from [e17230f4e3] to [1cc5572967].

54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
            $membres->edit($id, $data);

            if (isset($data['id']) && $data['id'] != $id)
            {
                $id = (int)$data['id'];
            }

            Utils::redirect('/admin/membres/fiche.php?id='.(int)$id);
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}







|







54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
            $membres->edit($id, $data);

            if (isset($data['id']) && $data['id'] != $id)
            {
                $id = (int)$data['id'];
            }

            Utils::redirect(ADMIN_URL . 'membres/fiche.php?id='.(int)$id);
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

Modified src/www/admin/membres/recherche.php from [5fde7c59ec] to [f11a643a77].

37
38
39
40
41
42
43
44
45
46
47
48
49
50
51

if ($recherche != '')
{
    $result = $membres->search($champ, $recherche);

    if (count($result) == 1 && $auto)
    {
        Utils::redirect('/admin/membres/fiche.php?id=' . (int)$result[0]->id);
    }
}

$champs_liste = $champs->getList();
$champs_entete = $champs->getListedFields();

if (!isset($champs_entete->$champ))







|







37
38
39
40
41
42
43
44
45
46
47
48
49
50
51

if ($recherche != '')
{
    $result = $membres->search($champ, $recherche);

    if (count($result) == 1 && $auto)
    {
        Utils::redirect(ADMIN_URL . 'membres/fiche.php?id=' . (int)$result[0]->id);
    }
}

$champs_liste = $champs->getList();
$champs_entete = $champs->getListedFields();

if (!isset($champs_entete->$champ))

Modified src/www/admin/membres/supprimer.php from [5dd74ed6f8] to [628b9e4ac1].

23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{
    $form->check('delete_membre_'.$membre->id);

    if (!$form->hasErrors())
    {
        try {
            $membres->delete($membre->id);
            Utils::redirect('/admin/membres/');
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

$tpl->assign('membre', $membre);

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







|











23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{
    $form->check('delete_membre_'.$membre->id);

    if (!$form->hasErrors())
    {
        try {
            $membres->delete($membre->id);
            Utils::redirect(ADMIN_URL . 'membres/');
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

$tpl->assign('membre', $membre);

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

Modified src/www/admin/mes_infos.php from [b50076e4e6] to [132bd75c18].

20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
                {
                    $data[$key] = f($key);
                }
            }

            $session->editUser($data);

            Utils::redirect('/admin/');
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

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

$tpl->assign('membre', $session->getUser());

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







|













20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
                {
                    $data[$key] = f($key);
                }
            }

            $session->editUser($data);

            Utils::redirect(ADMIN_URL);
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

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

$tpl->assign('membre', $session->getUser());

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

Modified src/www/admin/mes_infos_securite.php from [28a0163964] to [a4c11759e5].

41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
            }
            elseif (f('otp_secret') !== null)
            {
                $data['secret_otp'] = f('otp_secret');
            }

            $session->editSecurity($data);
            Utils::redirect('/admin/mes_infos_securite.php?ok');
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }








|







41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
            }
            elseif (f('otp_secret') !== null)
            {
                $data['secret_otp'] = f('otp_secret');
            }

            $session->editSecurity($data);
            Utils::redirect(ADMIN_URL . 'mes_infos_securite.php?ok');
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }

Modified src/www/admin/password.php from [6531c1aca8] to [3ac4dae618].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php

namespace Garradin;

const LOGIN_PROCESS = true;

require_once __DIR__ . '/_inc.php';

if (trim(qg('c')))
{
    if ($session->recoverPasswordConfirm(qg('c')))
    {
        Utils::redirect('/admin/password.php?new_sent');
    }

    $form->addError('Le lien que vous avez suivi est invalide ou a expiré.');
}
elseif (f('recover'))
{
    $form->check('recoverPassword', [
        'id' => 'required'
    ]);

    if (!$form->hasErrors())
    {
        if (trim(f('id')) && $session->recoverPasswordCheck(f('id')))
        {
            Utils::redirect('/admin/password.php?sent');
        }

        $form->addError('Ce membre n\'a pas d\'adresse email enregistrée ou n\'a pas le droit de se connecter.');
    }
}

if (!$form->hasErrors() && null !== qg('sent'))












|














|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php

namespace Garradin;

const LOGIN_PROCESS = true;

require_once __DIR__ . '/_inc.php';

if (trim(qg('c')))
{
    if ($session->recoverPasswordConfirm(qg('c')))
    {
        Utils::redirect(ADMIN_URL . 'password.php?new_sent');
    }

    $form->addError('Le lien que vous avez suivi est invalide ou a expiré.');
}
elseif (f('recover'))
{
    $form->check('recoverPassword', [
        'id' => 'required'
    ]);

    if (!$form->hasErrors())
    {
        if (trim(f('id')) && $session->recoverPasswordCheck(f('id')))
        {
            Utils::redirect(ADMIN_URL . 'password.php?sent');
        }

        $form->addError('Ce membre n\'a pas d\'adresse email enregistrée ou n\'a pas le droit de se connecter.');
    }
}

if (!$form->hasErrors() && null !== qg('sent'))

Modified src/www/admin/plugin.php from [3c55898e96] to [5ea508d23b].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php

namespace Garradin;

require_once __DIR__ . '/_inc.php';

$page = qg('_u') ?: 'index.php';

$plugin = new Plugin(qg('_p'));

define('Garradin\PLUGIN_ROOT', $plugin->path());
define('Garradin\PLUGIN_URL', WWW_URL . 'admin/plugin/' . $plugin->id() . '/');
define('Garradin\PLUGIN_QSP', '?');

$tpl->assign('plugin', $plugin->getInfos());
$tpl->assign('plugin_root', PLUGIN_ROOT);

$plugin->call('admin/' . $page);











|






1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php

namespace Garradin;

require_once __DIR__ . '/_inc.php';

$page = qg('_u') ?: 'index.php';

$plugin = new Plugin(qg('_p'));

define('Garradin\PLUGIN_ROOT', $plugin->path());
define('Garradin\PLUGIN_URL', ADMIN_URL . 'plugin/' . $plugin->id() . '/');
define('Garradin\PLUGIN_QSP', '?');

$tpl->assign('plugin', $plugin->getInfos());
$tpl->assign('plugin_root', PLUGIN_ROOT);

$plugin->call('admin/' . $page);

Modified src/www/admin/upgrade.php from [82ce8b560d] to [55a79f3198].

311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
Utils::clearCaches();

$config->setVersion(garradin_version());

Static_Cache::remove('upgrade');

echo '<h2>Mise à jour terminée.</h2>
<p><a href="'.WWW_URL.'admin/">Retour</a></p>';

if ($redirect)
{
    echo '
    <script type="text/javascript">
    window.setTimeout(function () { 
        window.location.href = "'.WWW_URL.'admin/"; 
        stopAnimatedLoader();
    }, 1000);
    </script>';
}

echo '
</main>
</body>
</html>';







|






|









311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
Utils::clearCaches();

$config->setVersion(garradin_version());

Static_Cache::remove('upgrade');

echo '<h2>Mise à jour terminée.</h2>
<p><a href="'.ADMIN_URL.'">Retour</a></p>';

if ($redirect)
{
    echo '
    <script type="text/javascript">
    window.setTimeout(function () { 
        window.location.href = "'.ADMIN_URL.'"; 
        stopAnimatedLoader();
    }, 1000);
    </script>';
}

echo '
</main>
</body>
</html>';

Modified src/www/admin/wiki/_fichiers.php from [b668ea1e80] to [abf2d3676b].

28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
            
            if (!$fichier->checkAccess($session))
            {
                throw new UserException('Vous n\'avez pas accès à ce fichier.');
            }

            $fichier->remove();
            Utils::redirect('/admin/wiki/_fichiers.php?page=' . $page->id);
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}







|







28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
            
            if (!$fichier->checkAccess($session))
            {
                throw new UserException('Vous n\'avez pas accès à ce fichier.');
            }

            $fichier->remove();
            Utils::redirect(ADMIN_URL . 'wiki/_fichiers.php?page=' . $page->id);
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
            else
            {
                $fichier = Fichiers::upload($_FILES['fichier']);
            }

            // Lier le fichier à la page wiki
            $fichier->linkTo(Fichiers::LIEN_WIKI, $page->id);
            $uri = '/admin/wiki/_fichiers.php?page=' . $page->id . '&sent';

            if (f('uploadHelper_status') !== null)
            {
                echo json_encode([
                    'redirect'  =>  WWW_URL . $uri,
                    'callback'  =>  'insertHelper',
                    'file'      =>  [
                        'image' =>  (int)$fichier->image,
                        'id'    =>  (int)$fichier->id,
                        'nom'   =>  $fichier->nom,
                        'thumb' =>  $fichier->image ? $fichier->getURL(200) : false
                    ],







|




|







69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
            else
            {
                $fichier = Fichiers::upload($_FILES['fichier']);
            }

            // Lier le fichier à la page wiki
            $fichier->linkTo(Fichiers::LIEN_WIKI, $page->id);
            $uri = ADMIN_URL . 'wiki/_fichiers.php?page=' . $page->id . '&sent';

            if (f('uploadHelper_status') !== null)
            {
                echo json_encode([
                    'redirect'  =>  $uri,
                    'callback'  =>  'insertHelper',
                    'file'      =>  [
                        'image' =>  (int)$fichier->image,
                        'id'    =>  (int)$fichier->id,
                        'nom'   =>  $fichier->nom,
                        'thumb' =>  $fichier->image ? $fichier->getURL(200) : false
                    ],

Modified src/www/admin/wiki/creer.php from [d9cf6828f1] to [fcf6294705].

15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    try {
        $id = $wiki->create([
            'titre'  => f('titre'),
            'parent' => $parent,
            'droit_lecture' => qg('public') !== null ? Wiki::LECTURE_PUBLIC : Wiki::LECTURE_NORMAL,
        ]);

        Utils::redirect('/admin/wiki/editer.php?id='.$id);
    }
    catch (UserException $e)
    {
        $form->addError($e->getMessage());
    }
}

$tpl->display('admin/wiki/creer.tpl');







|








15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    try {
        $id = $wiki->create([
            'titre'  => f('titre'),
            'parent' => $parent,
            'droit_lecture' => qg('public') !== null ? Wiki::LECTURE_PUBLIC : Wiki::LECTURE_NORMAL,
        ]);

        Utils::redirect(ADMIN_URL . 'wiki/editer.php?id='.$id);
    }
    catch (UserException $e)
    {
        $form->addError($e->getMessage());
    }
}

$tpl->display('admin/wiki/creer.tpl');

Modified src/www/admin/wiki/editer.php from [4efdb79d82] to [85c2033cca].

58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
                'modification' =>  f('modification'),
                'id_auteur'    =>  $user->id,
                'chiffrement'  =>  f('chiffrement'),
            ]);

            $page = $wiki->getById($page->id);

            Utils::redirect('/admin/wiki/?'.$page->uri);
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}







|







58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
                'modification' =>  f('modification'),
                'id_auteur'    =>  $user->id,
                'chiffrement'  =>  f('chiffrement'),
            ]);

            $page = $wiki->getById($page->id);

            Utils::redirect(ADMIN_URL . 'wiki/?'.$page->uri);
        }
        catch (UserException $e)
        {
            $form->addError($e->getMessage());
        }
    }
}

Modified src/www/admin/wiki/supprimer.php from [ad2a98e1d6] to [cc76953c4e].

16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

if (f('delete'))
{
    if ($form->check('delete_wiki_' . $page->id))
    {
        if ($wiki->delete($page->id))
        {
            Utils::redirect('/admin/wiki/');
        }
        else
        {
            $form->addError('D\'autres pages utilisent cette page comme rubrique parente.');
        }
    }
}

$tpl->assign('page', $page);

$tpl->display('admin/wiki/supprimer.tpl');







|











16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

if (f('delete'))
{
    if ($form->check('delete_wiki_' . $page->id))
    {
        if ($wiki->delete($page->id))
        {
            Utils::redirect(ADMIN_URL . 'wiki/');
        }
        else
        {
            $form->addError('D\'autres pages utilisent cette page comme rubrique parente.');
        }
    }
}

$tpl->assign('page', $page);

$tpl->display('admin/wiki/supprimer.tpl');