Overview
Comment:Correction gestion version
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b69e396deb1e4d0a39c9d41870cbab9a50b39fb9
User & Date: bohwaz on 2012-05-24 04:15:53
Other Links: manifest | tags
Context
2012-05-24
04:17
Fix [62107e66fa] check-in: 0f01dfe36f user: bohwaz tags: trunk
04:15
Correction gestion version check-in: b69e396deb user: bohwaz tags: trunk
04:01
Fix [c3c7240afe] check-in: 55444d7f88 user: bohwaz tags: trunk
Changes

Modified include/init.php from [357f7103f8] to [16b6e10922].

18
19
20
21
22
23
24






25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
        $version = trim(file_get_contents($file));
    }
    else
    {
        $version = 'unknown';
    }







    $file = __DIR__ . '/../manifest.uuid';

    if (file_exists($file))
    {
        $version .= '.' . substr(trim(file_get_contents($file)), 0, 10);
    }

    define('GARRADIN_VERSION', $version);
    return $version;
}

/*
 * Configuration globale
 */

// Configuration externalisée, pour projets futurs (fermes de garradins ?)







>
>
>
>
>
>




|


<
|







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
        $version = trim(file_get_contents($file));
    }
    else
    {
        $version = 'unknown';
    }

    define('GARRADIN_VERSION', $version);
    return $version;
}

function garradin_manifest()
{
    $file = __DIR__ . '/../manifest.uuid';

    if (file_exists($file))
    {
        return substr(trim(file_get_contents($file)), 0, 10);
    }


    return false;
}

/*
 * Configuration globale
 */

// Configuration externalisée, pour projets futurs (fermes de garradins ?)

Modified templates/admin/config/index.tpl from [68b7eaf55a] to [06f7b12e80].

16
17
18
19
20
21
22








23
24
25
26
27
28
29
    <li class="current"><a href="{$www_url}admin/config/">Général</a></li>
    <li><a href="{$www_url}admin/config/membres.php">Membres</a></li>
    <li><a href="{$www_url}admin/config/site.php">Site public</a></li>
</ul>

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









    <fieldset>
        <legend>Informations sur l'association</legend>
        <dl>
            <dt><label for="f_nom_asso">Nom</label> <b title="(Champ obligatoire)">obligatoire</b></dt>
            <dd><input type="text" name="nom_asso" id="f_nom_asso" value="{form_field data=$config name=nom_asso}" /></dd>
            <dt><label for="f_email_asso">Adresse E-Mail</label> <b title="(Champ obligatoire)">obligatoire</b></dt>
            <dd><input type="email" name="email_asso" id="f_email_asso" value="{form_field data=$config name=email_asso}" /></dd>







>
>
>
>
>
>
>
>







16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
    <li class="current"><a href="{$www_url}admin/config/">Général</a></li>
    <li><a href="{$www_url}admin/config/membres.php">Membres</a></li>
    <li><a href="{$www_url}admin/config/site.php">Site public</a></li>
</ul>

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

    <fieldset>
        <legend>Garradin</legend>
        <dl>
            <dt>Version installée</dt>
            <dd class="help">{$garradin_version|escape} <a href="http://dev.kd2.org/garradin/">[Vérifier la disponibilité d'une nouvelle version]</a></dd>
        </dl>
    </fieldset>

    <fieldset>
        <legend>Informations sur l'association</legend>
        <dl>
            <dt><label for="f_nom_asso">Nom</label> <b title="(Champ obligatoire)">obligatoire</b></dt>
            <dd><input type="text" name="nom_asso" id="f_nom_asso" value="{form_field data=$config name=nom_asso}" /></dd>
            <dt><label for="f_email_asso">Adresse E-Mail</label> <b title="(Champ obligatoire)">obligatoire</b></dt>
            <dd><input type="email" name="email_asso" id="f_email_asso" value="{form_field data=$config name=email_asso}" /></dd>

Modified templates/admin/index.tpl from [e272b304de] to [386daead73].

23
24
25
26
27
28
29
30
31
32
33
34
{elseif $verif_cotisation === true}
    <p class="confirm">Cotisation réglée le {$user.date_cotisation|date_fr:'d/m/Y'} :-)</p>
{else}
    <p class="alert">Cotisation en retard ! (dernier règlement le {$user.date_cotisation|date_fr:'d/m/Y'})</p>
{/if}
</div>

<div class="infos">
    <p>(Garradin version {$garradin_version|escape})</p>
</div>

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







<
<
<
<

23
24
25
26
27
28
29




30
{elseif $verif_cotisation === true}
    <p class="confirm">Cotisation réglée le {$user.date_cotisation|date_fr:'d/m/Y'} :-)</p>
{else}
    <p class="alert">Cotisation en retard ! (dernier règlement le {$user.date_cotisation|date_fr:'d/m/Y'})</p>
{/if}
</div>





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

Modified www/admin/config/index.php from [3fc45e5bfb] to [2548a60618].

38
39
40
41
42
43
44


45
46
47
48
        {
            $error = $e->getMessage();
        }
    }
}

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



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

?>







>
>




38
39
40
41
42
43
44
45
46
47
48
49
50
        {
            $error = $e->getMessage();
        }
    }
}

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

$tpl->assign('garradin_version', garradin_version() . ' [' . garradin_manifest() . ']');

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

?>

Modified www/admin/index.php from [8a9fd07497] to [93f2fa5ed9].

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

require_once __DIR__ . '/_inc.php';

require_once GARRADIN_ROOT . '/include/class.membres_categories.php';

$cats = new Garradin_Membres_Categories;
$categorie = $cats->get($user['id_categorie']);

$tpl->assign('categorie', $categorie);
$tpl->assign('verif_cotisation', Garradin_Membres::checkCotisation($user['date_cotisation'], $categorie['duree_cotisation']));

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

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

?>












<
<



1
2
3
4
5
6
7
8
9
10
11
12


13
14
15
<?php

require_once __DIR__ . '/_inc.php';

require_once GARRADIN_ROOT . '/include/class.membres_categories.php';

$cats = new Garradin_Membres_Categories;
$categorie = $cats->get($user['id_categorie']);

$tpl->assign('categorie', $categorie);
$tpl->assign('verif_cotisation', Garradin_Membres::checkCotisation($user['date_cotisation'], $categorie['duree_cotisation']));



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

?>

Modified www/admin/upgrade.php from [dfc5ee2f8f] to [aabd487358].

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
    utils::redirect('/admin/install.php');
}

require_once GARRADIN_ROOT . '/include/class.db.php';
require_once GARRADIN_ROOT . '/include/class.config.php';
$config = Garradin_Config::getInstance();



if (version_compare($config->getVersion(), garradin_version(), '>='))
{
    throw new UserException("Pas de mise à jour à faire.");
}

$db = Garradin_DB::getInstance();



switch ($config->getVersion())
{

    case 0:



        $db->exec('ALTER TABLE membres ADD COLUMN lettre_infos INTEGER DEFAULT 0;');
        $config->setVersion(garradin_version());
        break;
    default:
        throw new UserException("Version inconnue.");
}


utils::redirect('/admin/');



?>







>
>
|






>
>
|
|
>
|
>
>
>
|
<
<
<
<


>
|
>
>


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
    utils::redirect('/admin/install.php');
}

require_once GARRADIN_ROOT . '/include/class.db.php';
require_once GARRADIN_ROOT . '/include/class.config.php';
$config = Garradin_Config::getInstance();

$v = $config->getVersion();

if (version_compare($v, garradin_version(), '>='))
{
    throw new UserException("Pas de mise à jour à faire.");
}

$db = Garradin_DB::getInstance();

echo '<!DOCTYPE html>
<meta charset="utf-8" />
<h3>Mise à jour de Garradin '.$config->getVersion().' vers la version '.garradin_version().'...</h3>';

flush();

// versions pré-0.3.0
if (!$v)
{
    $db->exec('ALTER TABLE membres ADD COLUMN lettre_infos INTEGER DEFAULT 0;');




}

$config->setVersion(garradin_version());

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

?>