Galette's documentation

Galette is a Free/Libre Open Source membership management web application dedicated towards non profit organizations.

installation manual

user manual

plugins documentation

developer guide

Installation manual

Galette installation is quite simple, really :) Just a few graphical steps to follow once the prerequisites are met.

First, download latest Galette release from official repository:

Get latest Galette!

Then, uncompress the archive. If you are running Windows, you will have to install a file archiver software supporting the TAR archive format, such as 7zip. If you are using Linux, run the following commands (adapt the version if needed):

$ cd /var/www/html/
$ wget https://download.tuxfamily.org/galette/galette-0.9.6.1.tar.bz2
$ tar xjvf galette-0.9.6.1.tar.bz2

The current stable version of Galette is 0.9.6.1. A nightly archive is build each night from the development branch, and you can also retrieve Galette development version as explained in the developer guide.

Alternatively, Hiob has created a community repository to provide Galette as a Docker image.

Prerequisites and hosting

To install Galette, you will need to meet the following requirements :

  • a web server (like Apache),
  • PHP 7.2 or more recent,
    • gd PHP module,
    • PDO module and mysql ou postgresql for PDO,
    • curl PHP module,
    • intl PHP module,
    • SSL support,
    • gettext PHP module (optional).
  • A database server, MariaDB (or MySQL) 5.5 minimum, or PostgreSQL 9.1 minimum.

Galette is tested continuously with recent versions of these components. If you encounter issues with a recent version, please let us know ;)

Galette does not work on the following hostings:

  • Free,
  • Olympe Networks.

Preparation

You have to follow some preparation steps for Galette installation. The way to go differs on what you want to achieve.

File permissions

Warning

A commonly used hack is to give all rights to everyone recursively on the directory (chmod 777). This is a very very bad idea from a security point of view. Please do not use that hack, you've been warned ;)

Some Galette directories need specific rights. The application will need to write in some of them, you have to ensure it will be possible. Here are directories that need a write access:

  • config [1],
  • data/attachments,
  • data/cache,
  • data/exports,
  • data/files,
  • data/imports,
  • data/logs,
  • data/photos,
  • data/tempimages,
  • data/templates_c
[1]write access on config directory is only needed for Galette installation, we advice you to remove the write access once Galette has been installed :)

Web server directory exposition

New in version 0.9.

Galette defaults installation (as well as for many other web applications) consists in copying a complete directory to a location the web server can read. This method works well, but this exposes from the web files and directories that should not be available this way.

It is possible to limit that by exposing only the webroot directory. All other directories are more safe: it is not possible to reach them from the web server!

Note

Exposing only webroot directory is the recommended way if you can create virtual hosts on your hosting solution.

And that will certainly not be possible for many free hostings.

Here is a virtual host configuration example, including the hide of index.php:

<VirtualHost *:80>
    ServerName galette.localhost

    #https - add *:443 in the <VirtualHost>
    #SSLEngine on
    #SSLProtocol all -SSLv2 -SSLv3
    #Header always add Strict-Transport-Security "max-age=15768000; includeSubDomains; preload"

    #SSLCertificateFile /etc/pki/tls/certs/galette.localhost.crt
    #SSLCertificateChainFile /etc/pki/tls/certs/galette.localhost.chain.crt
    #SSLCertificateKeyFile /etc/pki/tls/private/galette.localhost.key

    DocumentRoot /var/www/galette/galette/webroot/
    <Directory /var/www/galette/galette/webroot/>
        RewriteEngine On
        #You may need to set RewriteBase if you setup
        #rewritting in a .htaccess file for example.
        #RewriteBase /
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^(.*)$ index.php [QSA,L]
    </Directory>
</VirtualHost>

Nginx would be:

server {
    #http
    listen 80;
    listen [::]:80;

    # https
    #listen 443 ssl http2;
    #listen [::]:443 ssl http2;
    #ssl_certificate      /etc/ssl/certs/galette.localhost.pem;
    #ssl_certificate_key  /etc/ssl/private/galette.localhost.key;

    server_name galette.localhost;

    root /var/www/galette/galette/webroot;

    index index.html index.php;

    location / {
        try_files $uri $uri/ @galette;
    }

    location @galette {
        rewrite ^(.*)$ /index.php last;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        # You may have to adapt this path, depending on your distribution.
        fastcgi_pass unix:/var/run/php7.0-fpm.sock;
    }

    location ~ /(data|config|lib)/ {
        deny all;
    }
}

Linux/Unix

Installing Galette on Linux implies you have an access to the terminal on the server and required ACLs on directories.

As an example, on Fedora, you will run (as root):

# cd /var/www/galette/
# chown -R apache:apache config data

Under Debian, we'll replace apache:apache with www-data:www-data.

On SELinux enabled systems, we'll also add:

# semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/galette/config(/.*)?'
# semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/galette/data(/.*)?'
# restorecon -R -v /var/www/html/galette/

You will also have to authorize webserver to connect to the network, with a SELinux boolean:

# setsebool httpd_can_network_connect on

FTP

Warning

Some archive or FTP softwares may corrupt files... It is strongly adviced if you use windows that you use 7zip to uncompress and FileZilla for TFP transferts.

Once source code has been retrived locally, use tar xjvf galette.tar.bz2 command under Linux/Unix/MacOS or a graphical tool under Windows.

Just copy the uncompressed directory obtained, and all its sub directories and files, with your FTP client.

_images/filezilla.jpg

Specific cases

Ionos

If you're hosted on Ionos; and want to use a specific subdomain for Galette, you must create your subdomain from their UI, and make it points to the webroot directory. You also have to edit the .htaccess file it contains, and uncomment the RewriteBase / directive.

OVH

This hosting compay offers to change PHP version you use from your customer account.

Additionnal information are available at: https://docs.ovh.com/fr/fr/web/hosting/configurer-le-php-sur-son-hebergement-web-mutu-2014/

Warning

Many users have display images or emargement list issues on OVH hosts. The solution to this issue is to create a .ovhconfig file at your hosting root with the following contents:

app.engine=phpcgi
Nginx

Nginx webserver configuration is different from Apache one (see Nginx documentation for a more complete explanation).

So you have to convert restriction access files in Nginx configuration, as for example:

location ~ /(data|config|lib)/ {
    deny all;
}

Windows

Installation described here rely on XAMPP; other installation methods exist but are not listed here.

First of all, download XAMPP on your computer. Let's install it under C:\xampp.

_images/xampp_directory.jpg

Launch the xampp-control executable (you can find it in C:\xampp), so you can start Apache and MySQL services.

_images/xampp_control.jpg

Once those steps done, download galette and move it to C:\wampp\htdocs\galette, web application will be available from http://127.0.0.1/galette/. Just visit this URL so the installation process begin.

Note

Enabling PHP modules under XAMPP is done in xampp/php/php.ini. Most of the required extensions are already present, but commented (line begins with a ";"), just uncomment them and restart XAMPP.

openssl extension is missing in the file, to activate it just add the following to your php.ini: extension=php_openssl.dll

التنصيب

Galette installation is a web based process (once preparation steps are done). Go to http://localhost/galette. Update process is documented separately.

You should rely on latest stable release, but it is also possible (if your know what you are doing, this is more complex for non developers!) grab it from source code

Checks

Please check the following if you want Galette to install without problems:

  • your PHP version is high enough,
  • PHP timezone is set (required since PHP 5.3),
  • all required PHP extensions are installed and loaded,
  • some directories requires write access.

If one of the mandatory extensions is missing or if the timezone is not set, please ask you system administrator. Galette does not require any "exotic" extension.

The very first installation step will check those points, and will warn you if something gets wrong.

_images/1_checks.png

If all the installation steps has been properly followed, directories ACLs should be correct, please refer to files ACLs section and refresh page in your browser.

Installation type

Next screen ask you for installation type. You'll choose beetween "New installation" or "Update". Several of the steps that will follow will be specific to the type you will choose here.

_images/2_type_install.png

قاعدة البيانات

First of all, make sure the database exists, and prepare all required information:

  • host name
  • database user name
  • database user password
  • database name
  • database type (MariaDB/MySQL or PostgreSQL)
Create database

Note

Never use database root user!

For security reasons, it is stongly advised to rely on a specific user for Galette database, and give him only requested access on the single Galette database.

For the example, we will use a database named mygalette with a user mygaletteuser with mypass as password.

  • MariaDB

    $ mysql -u root -p
    mysql> CREATE DATABASE mygalette;
    mysql> GRANT ALL ON magalette.* to
        ->'mygaletteuser'@'localhost' IDENTIFIED BY 'mypass';
    
  • PostgreSQL

    $ su -
    # su - postgres
    $ createuser -P mygaletteuser
    $ createdb -O mygaletteuser mygalette
    

Those commands may vary, please refer to MariaDB or PostgreSQL documentations, or use a graphical tool:

Database parameters

On that screen, select your database type, and enter hostname, database name, user name and password. Tables prefix is usefull if you do not have a Galette dedicated database, default proposal should be ok but you can choose what you want :)

_images/3_bdd.png

This step is the same for installation and update processes. If a configuration file already exists, Galette will grab the information to pre fill the form (not for the password). When upgrading, double check the prefix fit the existing one.

Checks

Next screen will try to connect to the database using provided elements, than it will check database rights are correct (user can add/remove/alter tables, and can add/remove/edit rows, ...).

_images/4_bdd_rights.png

If there is a connexion error, go back to previous step, fix your setup and try again. If you see rights issues, get them fixed on your server and use the "Refresh" button.

Create tables

Note

Those instructions are only for installation. When updating, a database already exists.

If a connection can be established to the database, and all is correct; installer will now create the tables, and insert default values. You can show created tables from any graphical tool or in command line:

  • MariaDB:

    mysql> use mygalette;
    mysql> show tables;
    
  • PostgreSQL:

    postgres=# \c mygalette
    postgres=# \dt
    
_images/5_tables_creation.png

Admin parameters

Note

This screen is displayed from installation only. When updating, super admin user is already existing.

Next screen will ask you for information to create the Galette super admin user. Using Galette, you can set some members as administrators, but the one created at installation time is not a member, cannot be removed, and has some extra rights.

_images/6_admin.png

Initialyse

The last step will write the configuration file if needed, and initialyse some values in your fresh database, as exemple:

  • add Galette default preferences
  • add default contributions and status types,
  • fields configuration and permissions,
  • texts for administrative emails,
  • members default titles,
  • default PDF models
  • ...

When updating, only the missing preferences and the new default data if any will be handled.

Installation end

Installation is now finished, congratulations!

Warning

For security reasons, we advise you to remove the install directory if it is web exposed, or to drop access from your web configuration.

_images/8_the_end.png

You can now login to Galette, using super admin information you used at installation time. You can now go to the Galette user manual.

_images/9_login.png

Happy Galette!

Post installation

Various tasks

One Galette properly installed, you still have a few things to do:

  • remove write access to the config directory,
  • remove the whole install directory, or make it unavailable with a directive like (for Apache):
<Directory /var/www/html/galette/install>
    Order Deny,Allow
    Deny from all
 </Directory>

Configure paths

Some galette paths may be changed from a configuration parameter, such as exports, photos, etc

By default, Galette provides all those directories inside installation directory. That way, if installation is located at /var/www/galette, exports will be in /var/www/galette/data/exports, photos in /var/www/galette/data/photos/, and so on. Default configuration is done in config/paths.inc.php file that should not be changed.

Instead, you may override some or all of the values in a config/local_paths.inc.php, with paths you want declared as PHP constants. For exemple, to define a different path for photos:

<?php
define('GALETTE_PHOTOS_PATH', '/path/to/photos_dir/');
?>

All paths that originally resides in data directory must stay accessible read/write for the web server. All other directories should be set as read only, the web server should not have to write in them. Here is the complete list:

  • GALETTE_CONFIG_PATH : path to Galette configuration files,
  • GALETTE_DATA_PATH : path to Galette data directory (since 0.8),
  • GALETTE_LOGS_PATH : Galette logs path, change it as you want,
  • GALETTE_COMPILE_DIR : path for Smarty templating system compilation,
  • GALETTE_CACHE_DIR : caching directory for a few cases,
  • GALETTE_EXPORTS_PATH : path to the directory to store CSV exports,
  • GALETTE_IMPORTS_PATH : path to the directory that contains CSV files to import,
  • GALETTE_ATTACHMENTS_PATH : path to attached documents in mailing,
  • GALETTE_FILES_PATH : path to the dynamic files directory storage (from dynamic fields),
  • GALETTE_PHOTOS_PATH : path to store members photos and logos.

Data security

You and your members will login to Galette, using a login and a password. You must be aware that those information are transmitted as is to the server; and someone may intercept and read them sniffing your exchanges.

This problem is recurrent hen you have to send data over the internet, and this is why you must check if you are on a HTTPS secured page (your browser will tell you), when you enter any sensitive information such as login, passwords, credit card number, ...

And this is the same for Galette, you can use it walong with SSL, no problem. All data that will be transmitted to the server will be a bit more confident and secured :)

Updating

If you are using an old Galette release, it's time to update.

Warning

An update is often not something lite, your data may be modified. So, please make sure you made a backup of your current database, or you may lost all or a part of your data.

A backup of all Galette files is also recommended it would be helpfull if you find a bug that prevent you to migrate and have to restore an old version;

Note

Migrating a pre 0.7 release is theorically supported, but this is not tested (those releases are more than 10 years old!), and it is possible your attempt fail.

Nothing is really made to make such a time travel ;) If this is your case, you should first migrate to Galette 0.7.8 <https://download.tuxfamily.org/galette/archives/galette-0.7.8.tar.bz2>; and do another migration to the latest version.

Updating files

First, logout from your instance, and make sure to use a maintenance mode to prevent other users to reach the instance.

Then, download latest Galette version and replace the files. For more information on files installation, refer to the prepare installation section.

Some directories keep data and/or configurations and should be copied back to the new instance:

  • config/config.inc.php. If this file is missing, Galette update process will ask you the information and create a new one. If the file is present, it will be used to fill information excepted database password. It is the only file that can be edited during update process,
  • data/photos your members photos and logos,
  • data/exports contains CSv exports,
  • data/files contains files from dynamic fields of type file,
  • data/attachments contains mailing attached documents.
  • plugins your current plugins. It is a good idea to check if new plugins versions are available ;)

Once files are updated, go to your Galette instance. It will ask you if needed to proceed to the update of your database.

If so, visit the install URL /installer.php (ex: https://your.domain.name/installer.php) and choose Update when your are asked for the type of installation.

If it asks you nothing you're just done already ;)

Updating database

Warning

Installing a new Galette release does not strictly means a database update will be required! Sometimes, only updating the files will be enough; even for a major release.

Galette will tell you if an update is needed, no need to "force" an update.

Update process is very similar to Galette installation process, with some steps that change. All is motly transparent, information are provided on each step.

Database information

At "Installation type" step, you'll have to choose "update". Database information page will be pre filled with existing information, excepting password. Other information should not be changed.

Note

Note it is important that database name and prefixed used in previous database correspond to configuration.

Previous version selection

Next step is the choice of the previous Galette version. Installation process will try to "guess" what version it as, and will select this one per default (the one that will be displayed as bold text).

_images/5_update_version_select.png

If you try to update but your database version seems already correct, you will be warned. No entry will be displayed as bold text, please make sure to choose the right one:

_images/5bis_already_updated.png

Once update scripts have run, a summary will be displayed:

_images/5ter_update_success.png

User manual

Welcome to Galette user manual :) Following pages will guide you into Galette screens and features to manage your association.

Just after login screen, you will reach Galette dashboard:

Tableau de bord

Main dashboard part propose you a quick access to main Galette features :)

Generalities

Rights

We can see several rights level in Galette, allowing access to different parts and features of the application. Levels are:

  • super administrator is a special user (the only one that is not a member) created at installation,
  • administrators are members for who the "administrator" checkbox has been checked,
  • staff members have a specific status (President, Treasurer, Secretary, ...),
  • groups managers have only rights on the groups they manage,
  • up to date members are members whose account are active, and whose subscription are up to date,
  • members are members whose account is inactive or whose subscriptions are not up to date,
  • simple visitors.

Staff members, administrators as well as the super administrator can create, edit and remove members, contributions, transactions, send emailings, ...

Administrators have also access to the application configuration, excepted super admin information.

The super administrator has a full access to the application, but not to all features. Indeed, this is not a member account, and it cannot have some of required informations. He of course can change its own login informations from application preferences.

Members can change their own informations, and can see their contributions and transactions (as read only).

Visitors can - if this is parameted in preferences - access to public pages (trombinoscope, public members list) but can also register :)

Group managers

With the stricter configuration, groups managers can show and search on members of their groups, and see accessible data for members. On members and cards, you can configure which fields are accessible.

From the preferences, you can also give groups managers extra rights, like editing or creating members.

Management rules

Due dates are calculated by day. If a member pay into before the end of his membership, duration of this membership will be added to remaining days. Example:

Roger subscribed on 2004-01-01 for one year,
if he pays into for a year on 2004-12-13,
his due date will become 2006-01-01.
No day will be forget.

At the contrary, if a member renew his membership late, we evaluate again his membership duration:

Roger subscribed on 2004-01-01 for one year,
if he pays into for a year on 2006-01-13,
his due date will become 2006-01-13.

He is not an up to date member from 2006-01-01 to 2006-01-13... On paper at least :)

Those rules are flexible because you can freely change membership dates on contributions, if you have rights to add or update them. We can imagine an association who stores all contributions on the first day of the next month (offering its members a longer membership time).

Interface

We do our best for the Galette interface to be:

  • logical and consistent (you will always find icons at familiar places),
  • web standards compliant (HTML and CSS valid),
  • HTML semantic respectful,
  • working even if Javascript is disabled (as possible, but really you should enable Javascript to really take advantage of Galette),
  • accessible (without any WCAG, WAI or equivalent tests run).

If you find places where one of those points is incorrect, do not hesitate to tell us on the tracker or on the mailing list!

New in version 0.9.

Galette provide a "mobile compatible" UI, but it has not been designed for that. Therefore, it may be difficult or worst to use; in this case we do our best, but all devices cannot be tested!

Mobile display is currently a plus and not a fundation of the UI. Improvements can be done, this will just not be a priority. Note that we have in mind to rework the whole UI, with a better support.

Telemetry

New in version 0.9.

Galette propose to send some telemetry informations:

  • entirely anonymous: no information about your association or your members is sent,
  • deliberately blurred: we retrieve an estimation of members count, never a real count,
  • sent by a secured way (HTTPS) on https://telemetry.galette.eu.

Sending telemetry data is a manual process, nothing will be send until you explicitely ask it. With those informations, we can have a better knwownledge of different usages of Galette, their number of member or contributions, plugins used, ...

Those informations are useful for the project development and promotion. When you send those informations, you can review data that would be sent.

Preview Telemetry data

After data has been sent once, Galette will propose to send an update from time to time. You can also send them from Galette preferences.

Telemetry update reminder

It is also possible to register your association on the website, of course, not anonymously, but it is not possible to link telemetry and registration. New references are moderated.

You can update your registration informations from Galette preferences. The form will be blank (because it is not possible to retrieve data you've sent) but all data will be updated because your instance has a unique registration identifier designed for that.

Telemetry from preferences

A new panel has been added on Galette dashboard to send telemetry informations and/or register your instance. Once those steps has been completed, the panel will dissapear. You aslo can choose to just disable it.

Telemetry on dashboard

إدارة الأعضاء

One of the first contact with Galette interface after the installation, login and dashboard will be members list, main part of the system. Of course, this list will be empty for now :)

Note

You can use the "Generate fake data" from the "Configuration" menu to add demonstration data in your instance.

Let's start by creating a new member. As everywhere in Galette, mandatory fields are displayed with a red border; all other are optionnal. Different parts of the page (Identity, Contact informations, Galette related data and maybe Dynamic fields) can be retracted clicking on their respective title.

`Identity` screen part adding member `Identity` screen part editing member

On date fields, you can access a calendar:

Date selection

When storing a member (or any other object in Galette), page will be reloaded with all informations you've entered (excepting passwords).

قائمة الأعضاء

Members list allows you to:

  • filter and order members,
  • display members card,
  • removals,
  • send mailings,
  • generate PDF labels,
  • generate PDF emargement lists,
  • generate PDF members cards,
  • CSV exports,
  • mass changes.

Each possible action per member is grouped at the end of the line, actions designed to be applied on a selection are at the bottom of the list. Plugins may add entries in both cases.

Filter and select members

Filtering members list is documented in search section. All possibilities can be used with actions on selection.

Mass changes

New in version 0.9.1.

Members selected in list can be edited (partially) at once.

Mass change selected members

Only fields with a checked checkbox at the beginning of the line will be changed. A summary will be displayed.

Summary of changes
Ordering

It is possible to order members list on following fields:

  • name,
  • nickname,
  • status,
  • contribution status,
  • modification date.

Most of the times, the result is transparent. Just note ordering on status will use status priority and ordering on contribution status will use creation date, contribution exemption and due date;

Configure CSV fields

Per default, CSV export for a members selection will provide same fields as the ones that are displayed on screen. It is possible to change this behavior specifiying yourself which fields must be exported in the galette/config/local_export_fields.inc.php file. If for example you only want identifier, first and last member names, the content of the file will be:

<?php
$fields = array(
    'id_adh', 'nom_adh', 'prenom_adh'
);

E-Mailing

Warning

Mailings in Galette are designed to work from the members list.

Direct mailing creation will work without problems, but members selection is harder.

From Galette, you can send mailings to a selection of members. Each sent mailing is stored in order to be reused, so you can select a stored mailing to be used as a template, retrieving selected members list, mailing subject and contents.

To send a new mailing, select members from the list and then use the Send an email button at the bottom of the list. If some of selected members does not have an email address, Galette will propose you to print corresponding labels.

Selected members for mailing

Note

Selecting members in the list must be done on one page only. Filtering features, as well as the possibility to display all members will be useful ;)

New in version 0.9.1.

You can choose a sender for each mailing:

  • from Galette preferences (default value): this will use informations stored in preferences,
  • current logged-in user: will use the name and the email of the current logged-in user (not available for super admin),
  • other: you can set any name and email address you want.
Sender selection

Once the subject has been filled, you can work on the contents. You can send email in text only, or in HTML (keep in mind sending HTML messages by mail is often not the way to go). A simple HTML WYSIWYG editor is provided.

Once the HTML editor is enabled, the checkbox to handle HTML tags is automatically checked, remember to check the box if you do not use the editor but want to send HTML!

Warning

Even if Galette is able to send HTML emails, this is discouraged. Messages lenght will be way larger (for almost nothing), and some (like me!) read their emails as text only. That is why Galette will always provide a text version of HTML emails.

It is also possible to add attachements, just click on the Browse button in that attachements section. If your browser is compatible, you can add several files at once (using Shift and Ctrl keys). All attachements are stored on disk, under a directory named with the mailing identifier (automatically defined from database).

Preview button let you preview your message before sending it.

Preview message

Any started emailings will be stored in your session to be retrieved in the future. An icon will be displayed in pages titles when a mailing is progress and will provide a link to go to it.

If you want, you can cancel this mailing using the Cancel mailing button, it will be deleted from your session. If you want to store it for a longer time, you can add the Save button. It will then be stored in the mailings list, and you will be able to grab it later.

Mailings history

Note

When you start a mailing, it is stored into your session. Session ends when users log out, or on a server defined timeout. Mailing history stores the mailing in the database, this ensure it will always be available in the future.

Every sent mailing is stored into the database, and can be used as a template to write a new one. In this case, a new mailing will be created using informations from the history, and the original one will be kept as is.

Mailings can be stored before they are sent. In this case, it is possible to continue it later. When you use history on a draft mailing, original entry will be replaced on sending.

When you use an existing history entry, here are the informations that will be used:

  • recipients,
  • attachements,
  • subject,
  • message,
  • html/text flag.

CSV imports

It is possible to import member data from a predefined model. A default model is provided, but you can configure it to suits your needs, using the Imports menu entry.

Model

Import model defines fields and their order in a CSV file. When importing, current model will be used to check your CSV file intergity.

To configure the model, click on the Configure button from the UI.

Default import model

If proposed model is not ok for you, click on Edit model and choose your fields:

Import model configuration

Once you have selected your fields, click on the Store new model button.

When in the current model tab, you can download an empty model from the Generate an empty CSV file button. Of course, you can change model if you want, or remove it to get the default model back.

Import

Once you have retrieved and fill the empty file, you have to send it using the form Send a new file. At this step, Galette will check your file extension is csv (or txt) and it size does not exceed maximum upload file size (2Mio per default in PHP).

Note

If you want to import a huge file, you can put it from your FTP client in the galette/data/imports directory, or split it into several smaller files you can import one by one.

Sent files are listed in the Existing files section. You can show, remove or import it:

Select and import file

The dry run checkbox (checked per default) is designed to test your file data are valid (mandatory fields filled, data formatting is correct, ...) without storing anything in the database.

When you import a CSV file, if one line is incorrect, previous ones may be stored in the database already; so it is advised to use the dry-run before to get error fixed.

You will have error messages than something went wrong (in dry-run mode or not):

Note

You may see mandatory missing fields even if import is ok. This may happen when all the fields you set as required in Galette configuration are not listed in your import model.

Impersonnating

New in version 0.9.

Some issues may be related to a particular account, because of its ACLs, groups, ... In this case, it is unfortuntely frequent to see some credentials sent by insecure emails; which should really be avoid.

As super admininistrator user, you wil see an extra icon in the members list, allowing you to log in as selected user without his credentials. Once you've impersonnated the user, you can reproduce the issue and fix it or get all required informations to report the issue upstream.

إدارة الإشتراكات

Galette allows you to manage contributions sent from your members. There are several types of contributions, and transactions are also proposed.

A transaction? What's that? Well, a simple example is better than a long text... We will use three members of a same association: Marc, Julie and Zac. Each one is member, independently of which group or else they are affected to, that does not matters.

Zac send you a check to pay his own membership, Marc and Julie ones and also a donation to the association. In this case, Zac's check will be handled in a transaction attached to his account, and which will be distributed in four contributions, each one attached to corresponding member.

Another example: Pierre pays his own contribution, his transaction will only contains his membership and will be distributed in only one contribution.

If Pierre, Zac, Julie or Marc are late, you can send them a reminder :p

الإشتراكات

A contribution can be a membership, a donation, a gift, ... Galette allows you to store all of that for each member.

نوع الإشتراك

Contributions are entirely configurable. There are two main types of contributions in Galette:

  • the ones that extends a membership (a montly or yearly membership for example),
  • the ones that do not extends membership, like donations.

Contribution types management allows you to define a label, and if it extends the memebrship or not.

المفكرات

Emails models to remind due dates are available from the emails contents ("Impending due date" and "Late due date").

The reminder button from the dashboard or the reminders entry of the menu will give you access to the reminders management interface.

Reminders management interface

Two categories can be selected:

  • members whose due date is close,
  • members whose due date is in the past.

Per default (this is currently not configurable), reminders are sent one month, then seven days before the due date; and then one and two months after the due date expiration. Reminders are stored in the database, if you never sent any reminder, all matching members will be reminded.

Galette will tell you if some members do not have an email address, you can print labels for those ones.

Finally, it is possible to automate reminders with a cron task which will call the galette/reminder.php file. If you want reminders to be sent every day at 8:30 AM, then you can add a /etc/cron.d/galette file (on Fedora and similar, look at your system documentation to know how to add a crontab) with the following content:

30  8  *  *  *  apache /usr/bin/php -f /var/www/galette/reminder.php
Invoices and receipts

In the contributions list, there is a PDF icon which is designed to generate invoice ou receipt for one contribution.

You can customize the PDF using PDF models.

التعاملات

As seen in the example from this chapter introduction, a transaction is a global payment for a member.

Only a few informations are required to add a new transaction:

  • a description,
  • the originator,
  • the date (current date per default),
  • the amount.
Transactions list

Each transaction is dispatched among contributions, in the limit of the transaction amount. A transaction has itself no effect on members due dates.

Add a transaction

After adding a new transaction, you will be redirected to a new contribution creation. If this new contribution does not dispatch the remaning amount of the transaction, galette will propose you to create another one. Per default, the amount of a new contribution from a transaction will be the remaning amount of the transaction.

Add a contribution linked to a partially dispatched transaction

Of course, it is also possible to edit a transaction:

Transaction edition

You can also attach an existing contribution instead of creating a new one.

Add an already existing contribution to a transaction

Members selection

The dropdown list to choose a member is available from contributions and transactions (as well as from several plugins) displays only a few members, for performances reasons.

You can display more members using the "Load following memebrs..." link, and you can also try to search entering any text (this will search in first name, last name and identifiers).

Fields Configuration

List fields

New in version 0.9.4.

You can choose which fields will appears on Galette members list and the order they will appear with a drag & drop interface. Related access rights can be set from core fields configuration (see below).

Note

Two fields are mandatory and cannot be moved: member number and name.

It is not possible to set access rights on id column, and parent will be accessible for staff members only.

List fields management

Mandatory fields and access rights

When you create or edit a member, some fields are mandatory. Default configuration may not suit your needs, but you can configure some elements easily ;)

From the Configuration, Core fields menu, you will get access to all fields available for members, and choose for each one if it is mandatory or not, as well as associated access rights:

  • inaccessible will make the field inaccessible for everyone,
  • administrator will make the field readable and writeable for administrators only,
  • staff members will make the field readable and writable for staff members and administrators,
  • groups managers will make the field readable and writable for groups managers on the memebrs of groups they own, and for staff memebrs and administrators,
  • read/write will make the field readable and writeable for member, groups managers, staff members and administrators,
  • read only will make the field read only for the members, but writable for groups managers, staff members and administrators.
Core fields management

حقول ديناميكية

Galette comes per default with many fields for members, contributions and transactions. Some of them will be useless, but you may need fields that does not exists...

In this case, that is quite simple : just add a new dynamic field with a label, define if it is mandatory or not, and that's all : Galette will handle them automatically, just show the result ;)

There are several types of dynamic fields:

  • separator: just a label, like a part title,
  • free text: multiline text area,
  • single line: one line text,
  • choice: a dropdown list,
  • date: a date field with a selector,
  • boolean: a checkbox,
  • file: add files.

While creating a new field (or editing an existing one); you also can:

  • mark it as required,
  • define access rights, the same as for core fields,
  • add extra information to help users.
A dynamic field

Some field types like separators, dates and booleans, does not need any extra information; for others:

  • free text:
    • width: define number of columns,
    • height: define number of rows.
  • single line:
    • width: field width,
    • size: number of characters,
    • repeat: number of possible ocurences.
  • choice:
    • values: possible values for the dropdown.
  • file:
    • size: maximum file size, in Kio (this size is limited to the one for the PHP configuration).

Labels translation

Galette handle several languages, but when you add a new dynamic field, there is only one value possible. Galette proposes an interface to translate those labels in each available language.

Note that each new label will be added with current Galette lang.

Emails contents

Depending on your configuration (see preferences), administrative emails cans be sent to users and/or administrators, when you add a new member or a new contribution, or from the lost password feature for example.

Defaults are provided, but you can change them.

Note

It is important to note that those textes contain variables - of the {VARIABLE} form - that will be replaced automatically on sending. Be carefull to not forget any of those, that could cause sending issues.

Edit mail send to a new member in french

An email will be send to member when:

  • he self subscribes. This mail contains authentication informations,
  • his card is added or edited by someone else (if the corresponding box is checked),
  • he uses lost password feature,
  • a new contribution is attache to his account (if the corresponding box is checked).

An email will be send to administrators when:

  • a new member is added or self subscribes,
  • a new contribution is attached to his account.

Of course, emails will be sent ony if Galette configuration allows it (and the setup is correct). Sending messages to administrators is configured globally from the preferences, while sending emails to members is conditionned on a checkbox from the user interface, excepting for self subscription messages that will always be send.

Several variables - automatically replaced on sending - are available for both subject and contents. Some of them may be used in all messages, but others will be only on some conditions. Refer to the inline help on Galette interface to know more.

PDF models

PDF models are provided for several outputs : an invoice model, a receipt model and a membership from model are currently available. All of them inherits from a Global model.

PDF models management

Models inheritance

The global model defines three distincts parts:

  • header,
  • footer,
  • CSS styles.

Each model which inherits from Global will automatically obtain same header and footer except if the new model redefines them, in which case only specific values will be applied.

For CSS properties it is a bit different: Global model properties will always be applied, and specific model properties will be appended (jsut like real CSS stylesheets).

Generalities

In addition of header, footer and CSS styles, a model defines a title, a sub title and a body.

Each of those fields can take some replacement values, refer to the inline help from the user interface to get details. They also can contains internationnalized texts like _T("My text") that relies on Galette standard translation capacities.

Models rely on HTML and CSS styles, but keep in mind we are building a PDF file, and not displaying a page in a recent brower; there are many limitations.

Invoices and receipts

Invoice and receipt models are the same, excepting their titles.

Invoice PDF model

As you can see in the above screenshot, invoice model does not define any header, footer or CSS styles, the ones form the Global model are used.

Membership form

It is a model that can be used to print a membership form. It can be empty (to print some of them for any event for example) or filled with one member informations.

Since there are many limitation, you may use the FullCard plugin that will replace this model. It is more complex to change, but you can do many more with it. You can also create your own plugin based on FullCard.

Galette preferences

You can configure several aspects of Galette from the preferences.

General

This tab defines some parameters related to your association:

Galette settings, general tab
  • Name: name of the association,
  • Description: a short description,
  • Footer text: a text (HTML is allowed) to display in the footer of each page (to add a link to particular legal notices as example),
  • Logo: set your own logo,
  • Address,
  • Zipcode,
  • Town,
  • Country,
  • Postal address: choose which postal address will be used:
    • either from the preferences to use the one entered in the form,
    • either from a member to use address from a staff member,
  • Website: website URL,
  • Telemetry date: date on which telemetry infomations was sent,
  • Registration date: date of registration of your Galette instance

Parameters

Galette related parameters:

Galette settings, parameters tab
  • Default lang: default instance lang (can be changed many ways by the user),
  • Lines / page: number of lines to display on lists for pagination,
  • After member creation: defines action to execute after a member has been added:
    • create a new contribution,
    • create a new transaction,
    • create another member,
    • show member,
    • go to members list,
    • go to main page,
  • Logging: handles internal history:
    • Enabled,
    • Disabled,
  • Default membership status: the status to affect to all new created users (can be changed on creation form if current user have rights),
  • Default account filter: default account filter to apply on members list,
  • Default membership extension: membership extension in months,
  • Beginning of membership: beginning date of the financial period,
  • Public pages enabled: enable or disable public pages,
  • Show public pages for: defines who can see public pages:
    • Everyone, including simple visitors,
    • Up to date members,
    • Administrators and staff members,
  • Self subscription enabled: enable or disable self subscription feature,
  • Post new contribution script URI: URI of a script that will be called after a new contribution has been added. Several prefixes are handled:
    • galette://: call a script provided by Galette that will be called with the HTTP POST method. Path must be relative to your Galette installation. For example, the URI for the galette/post_contribution_test.php example script would be galette://post_contribution_test.php.
    • get:// or post://: use HTTP GET or POST method to call a web address, prefix will be replaced with http://,
    • file://: call a file on the web server, full path must be provided. Destination script must be executable, and should define a shellbang if necessary. An email that contains contribution information and script return (if any) will be sent to the administrator if an error occurs. The behavior is the same as cron : if the script outputs something, a mail is sent.

Warning

Using file:// method can be dangerous, Galette just call the provided script, usage and security of the script is under your own responsability.

  • RSS feed URL: link to the RSS feed to display on dashboard,
  • Galette base URL: Galette instance URL, if the one proposed is incorrect,

Warning

This URL should be changed only if there are issues, this may cause instability.

A contextual help is provided, check it for more information.

  • Show identifiers: display database identifiers instead of simple counts on lists.

Rights

Define few extra rights:

  • Can members create child? if you enable this settings, any logged in member can create another members that will be attached to him as children.
  • Can group managers edit their groups? groups manager can edit their owned groups information (name, parent, order).
  • Can group managers create members? groups managers can create members attached to their groups.
  • Can group managers edit members? groups managers can edit member of their groups information.
  • Can group managers send mailings? groups manager can send mailings.
  • Can group managers do exports? groups managers cen export groups as PDF, generate attendance sheets, cards, labels and CSV exports for members of their groups.
Galette settings, rights tab

E-Mail

Sending email parameters:

Galette settings, e-mail tab
  • Sender name: name of the sender,
  • Sender email: email address of the sender,
  • Reply-to email: reply email address. If empty, sender email will be used,
  • Members administrator email: email address on which inscription notifications will be send, you can set several addresses separated with comas,
  • Send emails to administrators: whether to send emails to administrators on subscription,
  • Wrap text emails: automatically wraps long lines in emails. If you disable this options, make sure to wrap yourself,
  • Activate HTML editor: activate HTML format when sending emails (discouraged),
  • Emailing method: method used to send emails:
    • Emailing disabled: no email will be send from Galette,
    • PHP mail function: uses the PHP mail() fonctions and related parameters (recommended when possible),
    • Using a SMTP server: uses an external SMTP server to configure (will be slower than PHP mail() function),
    • Using GMail as SMTP: same as SMTP server, but GMail specific (will also be slower than PHP mail() function),
    • Using sendmail server: uses local server sendmail,
    • Using qmail server: uses local server qmail,
  • Mail signature: signature added to all sent emails. Available variables are displayed in the inline help from the application.

When using GMail as SMTP, you will have to configure user name and password to use.

SMTP configuration is a bit more complexe :

  • SMTP server: server address, required,
  • SMTP port: server port, required,
  • Use SMTP authentication: if your server requires an authentication. In this case, you will also have to set username and password,
  • Use TLS for SMTP: enable SSL support (always on for GMail),
  • Allow unsecure TLS: on some cases, SSL certificate may be invalid (self signed for example).

The Test mail settings button will send a test message to the email currently stored as members administrator.

Labels

Galette settings, labels tab

Cards

Galette settings, cards tab

الحماية

New in version 0.9.4.

Warning

Complex password rules are not user friendly; but security is mainly never :)

Of course, all passwords should be as secure as possible, but this is especially true for all accounts that have privileges (staff, admin, super-admin); you may explain your users why this is important.

You can enforce some rules for members (and super-admin) passwords:

  • minimum length (6 characters or more),
  • minimum "strength",
  • blacklist,
  • no personal information.
Galette settings, security tab

Length is still the only rule that is active per default, just configure the number of characters required. On passwords fields, failures will be displayed on the fly; as well as a "strength meter" displayed for information.

Note

If you enable password checks, it is not possible to know if some of existing ones does not respect them. Galette will display a warning at login if checks are not respected, but login will still be possible!

But wait... Password security is important, but Galette does not enforce nothing! Isn't that dumb? Well, not really. For tests or entirely private instances, security may be less important; and in some cases, being too restrictive may be an issue for your users; that's why this is up to you to secure as needed; just like using SSL or not :)

Password strength

Password strength calculation is quite simple. It is based on 4 rules:

  • contains lower case characters,
  • contains upper case characters,
  • contains number,
  • contains special characters.

You can choose between 5 values for strength configuration:

  • none: (default): disables strength checks and check for personal information,
  • weaker: enables check for personal information, only one of the rule is mandatory,
  • medium: two rules are mandatory,
  • strong: three rules are mandatory,
  • very strong: the four rules are mandatory.
Blacklisted passwords

A default list of 500 common passwords is provided as a blacklist you can enable, "galette" is also blacklisted.

Note

The galette/data/blacklist.txt file is used to list blacklisted terms (one per line). You can provide your own file, we advice you to complete the existing one.

Personal information as password

This check rely on strength activation (all but none level). For the super-admin account, this will just ensure you are not using login as password. For standard accounts, there are several information involved:

  • name,
  • surname,
  • nickname,
  • login,
  • email,
  • birthdate,
  • town

Basically, user cannot use verbatim any of those information as password. Some possible combinations are also checked, like surname and name couple (or name and surname), first letter of surname with name, etc. Birthdate will be checked in different formats as well (localized, international, and some variants).

Admin

Note

This tab wil be present only if you are logged in as super administrator.

Galette settings, admin tab

Experimented users

Warning

Use only following instructions if you know what you are doing... "The management is not responsable for any case of [...]" :D

Adapt to your graphical chart

If you are comfortable with CSS stylesheets, you can adapt Galette CSS to fit your own colors. To achieve that, it is strongly discouraged to edit Galette CSS files, but rather the specific mecanism desinged for that. Create a galette_local.css file in your webroot/themes/default directory with your styles, it will be automatically included.

Try to keep things as simple as possible. For example, if you want to change association name color (displayed under pages titles), you will find in Galette the CSS rule #asso_name that defines several parameters including the color. Then, in your stylesheet, you will just need the following:

#asso_name {
    color: red;
}

This will be enough to display your association name in red. Note that local CSS file and all issues it may cause will not be took into account by the Galette team, no support will be provided.

You also can override the print stylesheet, just create a galette_local_print.css file.

Add and change strings

It is possible if needed to customize translated strings in Galette - without editing any Galette source file. Just create a galette_{mylang}_local_lang.php file (where {mylang} must be replaced with the language, like fr_FR.utf8 or en_US) in the lang directory. This file must contains a simple PHP array with the original string (the one in Galette source code) as index.

As example, we want to change the "Password" string on the login page in french, translated as Mot de passe :. The original string is Password: (see galette/templates/default/index.tpl), its french translation is Mot de passe : and we want to replace it with Secret :; so we will create the galette_fr_FR.utf8_local_lang.php with the following contents:

<?php
$lang['Password:'] = 'Secret&nbsp;:';
return $lang;

Since Galette uses a cache system for translations, changes may not be visible immediately; you may have to restart PHP (or to clear cache). It is important to take the original string verbatim, punctuation included; and take care to escape single quotes (with a backslash) in all the strings.

You also can override langs for plugins using the sam method, just place the file in plugins lang directory and name it {plugin}_{mylang}_local_lang.php where {plugin} is the routing name you can find in the _define.php file.

Note

This will work only if you use Galette translation features, and not with native gettext.

Change session lifetime

Per default, Galette will create session with default lifetime duration (and it seems browsers acts differently in this case). You can anyways define a constant named GALETTE_TIMEOUT to change session lifetime using behavior configuration:

<?php
//see https://www.php.net/manual/en/session.configuration.php#ini.session.cookie-lifetime
define('GALETTE_TIMEOUT', 0);

Log IP addresses behind a proxy

If your Galette instance is behind a proxy, IP address stored in history will be the proxy one, and not the user one :(

To fix that, use behavior configuration to create a constant named GALETTE_X_FORWARDED_FOR_INDEX like:

<?php
define('GALETTE_X_FORWARDED_FOR_INDEX', 1);

Each proxy server will add its own address on the list, example above will work only if there is only one proxy server.

Warning

For security reasons, do not use this if your instance is not behind a proxy!

External stats

New in version 0.9.

Many statistics plaftforms relies on an extra Javascript block to work. You can create a tracking.js file under webroot/themes/default directory, it will be automatically included.

Warning

Galette uses Javascript to work. If the code you add in the tracking.js file is incorrect, this may break Galette!

Cards size and count

New in version 0.9.

Galette preferences allows to specify spacing for cards, but not their with, nor the number of lines and columns. You can use behavior configuration to configure cards, following constants are provided:

Note

Changing those values may cause gaps; change them with caution, and do not forget to test the result ;)

  • GALETTE_CARD_WIDTH defines cards width,
  • GALETTE_CARD_HEIGHT defines cards height,
  • GALETTE_CARD_COLS defines the number of columns,
  • GALETTE_CARD_ROWS defines the number of lines.

CSV exports

Galette provides a parameted CSV exports system. Only one parameted export is provided, but you can add your own to the config/exports.xml file. Its configuration is done with several parts:

  • the SQL query to use,
  • the columns to export,
  • the CSV separator,
  • the strings separator character.

Warning

Configuration of CSV exports is done in a XML file, that must be vaild!

If it is not, no export will be proposed from the user interface. Under linux, you can use tools like xmlwf or xmllint to ensure your file is valid.

Let's examine contributions parameted export:

<export id="cotisations" name="Cotisations" description="Export de l'état des cotisations pour l'ensemble des adhérents" filename="galette_cotisations.csv">
    <!-- The Query to execute - mandatory -->
    <query>SELECT nom_adh, prenom_adh, ville_adh, montant_cotis, date_debut_cotis, date_fin_cotis FROM galette_cotisations INNER JOIN galette_adherents ON (galette_cotisations.id_adh=galette_adherents.id_adh)</query>
    <!-- CSV Headers - optionnal.
         If not set, fields name will be exported.
         If set to none (eg. <headers><none/></headers>, no headers will be outpoutted.
         You can alternatively use named columns in you query instead of header tags.
            -->
    <headers>
        <!--<none/>-->
        <header>Name</header>
        <header>Surname</header>
        <header>Town</header>
        <header>Amount</header>
        <header>Begin date</header>
        <header>End date</header>
    </headers>
    <!-- CSV separator to use - optionnal.
         If this tag is not present, it will defaults to ',' (see Csv::DEFAULT_SEPARATOR from classes/csv.class.php)
         Accepted values are also defined in Csv class.
    -->
    <separator>;</separator>
    <!-- How to quote values - optionnal.
         If this tag is not present, it will defaults to '"' (see Csv::DEFAULT_QUOTE from classes/csv.class.php)
         Accepted values are also defined in Csv class.
    -->
    <quote><![CDATA["]]></quote>
</export>

Each parameted export is defined inside a tag named export, which contains a unique identifier (id), a description displayed in the user interface (name) and output filename (filename). The query tag contains the SQL query to execute, there is no other limitation than the SQL engine ones.

The headers part defines columns that will be exported, the separator tag the CSV separator and the quote tag the strings separator.

الأدوات الإدارية

Warning

All the admin tools operation are destructive, use it with cautions, and make sure you did a database backup before!

There are a few tools provided for Galette admin that permits to:

  • reinitialize mailings contents will reset all emails contents to default values,
  • reinitialize fields configuration will reset all members core fields to their default value. This does not imply dynamic fields,
  • reinitialize PDF models will reset ll PDF models to default values,
  • generate empty logins and passwords those informations are required to improve security, but sometimes missing (if you import a CSV for example). This feature will set random values as login and password fields that would be empty in database.

Frequently Asked Question (FAQ)

What if Galette does not work?

Sometimes, after an update, a change on hosting, or a simple bug - even minor ones - may cause a fail in Galette. You may observe:

  • a simple error message id displayed,
  • a blank page,
  • a page with a backtace (usually, not in production mode),
  • ...

In all cases, you must check the logs. Most of errors are stored in those files, it is a very good start point to understand the problem and potentially solve it.

There are two types of log files: Galette ones, and system ones. Galette logs are stored in the galette/data/log per default.

Server logs are another subject. On shared webservers, they are often not accessible to you :( On a dedicated webserver, their location change with server configuration; it is related to the operating system used, PHP and/or web server configuration, ...

  • with php-fpm service logs are in /var/log/php-fpm/www-error.log (for GNU/Linux Red Hat like distributions),
  • with (the deprecated) mod_php, you'll find them in /var/log/httpd/error_log (on other GNU/Linux distributions, httpd may be named apache),
  • on Windows/MacOS with XAMPP like solutions, there is at least one log directory in installation; you may find what you look for there.

Displaying errors

If you cannot access system logs files (frequent on shared hostings), you can display errors directly on the page.

Warning

Displaying errors on a web page may provide information that should not be public. In production mode, is it strongly advised not to display them. Above solution is only a temporary debug tool.

Please also note that with routing integration, some of those displayed information may be "hidden" from a buggy redirection... Logs are safer on that point.

To temporary display errors on page, create a galette/config/behavior.inc.php file with the following contents:

<?php
define('GALETTE_DISPLAY_ERRORS', 1);

The next time you reproduce the issue, errors will be displayed on the page.

Globally, you can use Galette behavior configuration to help you grab additional information.

How to report a bug or ask for a feature?

Bugs reports as well as RFE (Request For Enhancement) must be done on the Galette tracker, for Galette itself, all official plugins and also documentation.

Note

Unless you are sure you know, please de not attribute the ticket and do not set target version. It will be done when it will be took into account.

If you have doubts, feel free to ask your questions on mailing lists ;)

Report a bug

Please, do not forget to:

  • tell us the Galette version you are using,
  • be clear and consise,
  • to provide all required information in order to reproduce the issue
  • to provide related logs entries.

Request For Enhancement

Make sure to be precise as well on RFEs. Developers may not guess what you have in mind, you have to explain them, event if this seems obvious to you ;) Requested enhancements are tagged as "Souhaits" (whishes, in french), and moved by developers when work begins most of the time.

Once you made your whishes, you can submit it to a vote, most wanted features may catch devs attention.

How to search in lists archives?

Mailing lists are the main communication channel for Galette, from its beginnings.

As a reminder, since 2017, two lists are available:

If you are looking for archives before 2017, see:

Unfortunately, there is no search mechanism in any of those lists archives. The alternative is to use the site: keyword from your favorite search engine (most of them supports that keyword):

site:https://listengine.tuxfamily.org/lists.galette.eu/users plugin

Above search will look for "plugin" in archives of users mailing list. Just adapt the URL to the list/period and keywords you want ;)

To improve the search, refer to your search engine documentation.

How to use same email address for several members?

This is a very frequent question; many would love to do that...

This is not possible.

Indeed, mail addresses must be unique in the database. It is a choice for the project on which several features are built:

  • lost password (since... always or almost),
  • login (since Galette 0.9),
  • ...

Making them non uniques is not a solution we want to rely on. This would be complicated, and should be source of many bugs.

However, it is possible in Galette to link several members. That way, some information such as email and postal addresses will be retrieved from the parent member if missing.

This allows finally to use a unique email address for several members in database; but they are not duplicates in database.

الإضافات

Plugins system allows to extend Galette with specific features that would not be useful for most of the users. Incompatible plugins will automatically be disabled, in which case you should consider upgrading to a more recent version.

Each plugin is a simple directory in {galette}/plugins/, then refer to the plugin documentation to install it.

You can disable a plugin creating a _disabled file in its directory.

Official Plugins

Official plugins are developed and maintained by the Galette team. Available official plugins are:

بايبال

This plugin provides:

  • possibility to associate an amount to a contribution type,
  • create a Paypal payment form,
  • an history,
  • automatic transaction storage once validated.
Paypal plugin preferences Paypal payment form

Warning

Due to the way Paypal payments are handled, especially the payment confirmation, your instance must be publically accessible.

التنصيب

First of all, download the plugin:

Get latest Paypal plugin!

Extract the downloaded archive in Galette plugins directory. For example, under linux (replacing {url} and {version} with correct values):

$ cd /var/www/html/galette/plugins
$ wget {url}
$ tar xjvf galette-plugin-Paypal-{version}.tar.bz2
تهيئة قاعدة البيانات

In order to work, this plugin requires several tables in the database. See Galette plugins management interface.

And this is finished; Paypal plugin is installed :)

Plugin configuration

Once plugin has been installed, a Paypal group is added to the menu, with some new entries:

  • Payment form: the payment form itself, which is accessible as a public page,
  • Preferences: plugin preferences, accessible for administrators and staff members.

In order to work properly, you need to fill a very important value: your Paypal account code. You can either use the email address associated with your Paypal account (but you will need to chang it in Galette if it changes on Paypal) or your merchant identifier. To find your merchant identifiant, log in to Paypal and you will find it in your account preferences. Changing identifier is only allowed for administrators.

Preferences screen also permit to edit amount related to contributions types, and to hide some types.

After that, any user can choose the contribution type, adjust the amount and pay from his Paypal account. If the user is a logged in member, and if the contribution type is a membershop extension, its membership wil be recalculated when the payment will be confirmed.

كيفية الحصول على المصادر؟

Please refer to Galette developer guide to get informations about souces retrieval, and development model.

Fullcard

This plugin was developed for Borsalinux-fr (previously Fedora-Fr). It generates a PDF member card that can be empty (to be used during events, etc) or filled with a member informations (that can be joined with a check for a membership as example).

Note

Since Galette 0.8.3, a PDF member card based on PDF models is provided. Installing Fullcard 1.6 or newer will replace this model.

التنصيب

First of all, download the plugin:

Get latest Fullcard plugin!

Extract the downloaded archive in Galette plugins directory. For example, under linux (replacing {url} and {version} with correct values):

$ cd /var/www/html/galette/plugins
$ wget {url}
$ tar xjvf galette-plugin-fullcard-{version}.tar.bz2
كيفية الحصول على المصادر؟

Please refer to Galette developer guide to get informations about souces retrieval, and development model.

الخرائط

This plugin provides:

  • possibility to store geogaphical coordinates for members (latitude and longitude),
  • a public map displaying up to date members that have choosen to be publically visible.
التنصيب

First of all, download the plugin:

Get latest Maps plugin!

Extract the downloaded archive in Galette plugins directory. For example, under linux (replacing {url} and {version} with correct values):

$ cd /var/www/html/galette/plugins
$ wget {url}
$ tar xjvf galette-plugin-maps-{version}.tar.gz
تهيئة قاعدة البيانات

In order to work, this plugin requires several tables in the database. See Galette plugins management interface.

And this is finished; Maps plugin is installed :)

Plugin usage

When the plugin is installed, a group Maps is added to Galette menu when a member is logged in, which contains My location entry. This page allow member to store its location.

A Geolocalize button is also added when displaying a member, that allows administrators to set member coordinates.

Also, a Map entry is added in public pages list, that displays geolocalized members that are up to date. Administrators and staff members will see all members, while simple members and visitors will only see up to date public ones.

First of all, members will enter their location coordinates. Several options are provided:

  • if town has been set in member informations, a list of possible places will be proposed (via Nominatim online service),
  • additionnaly, a search zone (provided from OpenStreetMap),
  • and also a geolocalize button using browser capacities.

The search zone can be used when saving members location, and when displaying the maps.

_images/towns_list.png

A member can define its location (with the precision he wants) on the map selecting one of the propositions:

_images/location_select.png

Using the geolocalization button will define its position from the browser:

_images/geoloc.png

Then, member location is displayed on map, and can be removed:

_images/location_selected.png
كيفية الحصول على المصادر؟

Please refer to Galette developer guide to get informations about souces retrieval, and development model.

Auto

This plugin provides vehicles management for automobile clubs, you can manage:

  • vehicles (owner, several informations, photo, etc),
  • vehicle history modification (owner, color, ...),
  • العلامات التجارية،
  • النماذج،
  • transmission types,
  • body types,
  • الألوان،
  • finitions,
  • states.

This plugin has been initially developed in collaboration with Anatole from Club 404, and François from club Fiat 500. A big thanks to them for their precious help during plugin development :)

التنصيب

First of all, download the plugin:

Get latest Auto plugin!

Extract the downloaded archive in Galette plugins directory. For example, under linux (replacing {url} and {version} with correct values):

$ cd /var/www/html/galette/plugins
$ wget {url}
$ tar xjvf galette-plugin-auto-{version}.tar.bz2
تهيئة قاعدة البيانات

In order to work, this plugin requires several tables in the database. See Galette plugins management interface.

And this is finished; Auto plugin is installed :)

There is no particular setup required, you can just enter data in the database.

Configure required fields

When adding a new vehicle in database, there are several fields that are required, but that may not fit your needs. In such case, you can define your own required fields: just create a local_auto_required.inc.php file in your Galette config directory and declare an array of the fields you want to require. As example, if you just want to require name and model for a car, you will need:

<?php
return array(
     'name'  => 1,
     'model' => 1
);
كيفية الحصول على المصادر؟

Please refer to Galette developer guide to get informations about souces retrieval, and development model.

Events

This plugin provides:

  • events management,
  • associate activities with events,
  • booking management.
التنصيب

Warning

This plugin requires Galette 0.9.1 to work!

First of all, download the plugin:

Get latest Events plugin!

Extract the downloaded archive in Galette plugins directory. For example, under linux (replacing {url} and {version} with correct values):

$ cd /var/www/html/galette/plugins
$ wget {url}
$ tar xjvf galette-plugin-events-{version}.tar.gz
تهيئة قاعدة البيانات

In order to work, this plugin requires several tables in the database. See Galette plugins management interface.

And this is finished; Events plugin is installed :)

Plugin usage

When the plugin is installed, an Events group is added to Galette menu when a user is logged in. There are various possibilities that change depending on user profile (simple member, group manager, administrator, ...).

النشاطات

You can define as much activities as you want, and associate them to an event. An activity may be an organized trip, a meal, a housing, ...

_images/list_activities.png

An activity is composed with a name, a status and an optionnal comment.

To add a new activity, just click on "New activity" link:

_images/new_activity.png
Events

Events are the main goal of the plugin. You can define several informations, like a name, begin and ending dates, location, ...

_images/new_event.png

Name, begin date and town are mandatory. All other informations are entirely optionnal.

Events that are not linked to a group will be available for all members. If a group is set, only members and managers of this group will have access.

Note

When a group manager creates a new event, he must choose one of the groups he owns!

You can attach one or several activities to each event, and for each one set if it is available, not available or even mandatory. Choose the activity to add, and click the button.

_images/event_activities.png

Warning

Adding or removing activity from an event will reload the page and ask you to fill mandatory informations. Nonetheless (and this is specified each time), the event will not be stored during this operation.

Ensure you save the event :)

From Events list, you can edit or remove entries, access to booking list ou export bookings as CSV.

_images/events_list.png
Bookings

Bookings can be registered for each event. As we said before, simple members and groups managers will be limited to their groups events, ou to the events that are not restricted to a group.

Adding a new booking can be achieved from the menu "New booking" or from the event bookings list.

_images/new_booking.png

Bookings are closed once the event is marked as close, or when the begin date is over. Administrators and staff members can always add new bookings.

Activities list is retrieved from the event; mandatory ones must of course be checked during booking.

_images/bookings_list.png

You can filter bookings list per event, payment type or payment status. You can then send a mailing to booked members, using the standard Galette mailing mechanism.

كيفية الحصول على المصادر؟

Please refer to Galette developer guide to get informations about souces retrieval, and development model.

Objects lend

This plugin provides:

  • objects management (description, size, lenght, price, ...)
  • groups objects by categories,
  • manage object state, and their presence in stock or not,
  • manage lending and/or renting objects,
  • contribution generation,
  • ...
التنصيب

First of all, download the plugin:

Get latest ObjectsLend plugin!

Extract the downloaded archive in Galette plugins directory. For example, under linux (replacing {url} and {version} with correct values):

$ cd /var/www/html/galette/plugins
$ wget {url}
$ tar xjvf galette-plugin-objectslend-{version}.tar.gz
تهيئة قاعدة البيانات

In order to work, this plugin requires several tables in the database. See Galette plugins management interface.

And this is finished; ObjectsLend plugin is installed :)

Plugin usage

Once plugin has been installed, a Object lend group is added to Galette menu.

Defaults status are provided at installation, but they can not fit your needs, you can of course define your own.

_images/status.png

Define status, create categories and objects; users can lend objects with a reason, then give them back with location.

A lend history is provided for administrators and staff members from object page.

Preferences

Several preferences allows to change plugin behavior.

_images/preferences.png

From this screen, you can define if members can lend objects or not, if it should create a new contribution (and its type and description), if image should be displayed in objects list, and thumbnails size.

New in version 0.5.

It is possible to activate the fullsize photo display.

Note

Photos sent with previous plugin version were always resized, only the thumbnail was stored. If you want to get fullsize display, you will have to send photos again.

كيفية الحصول على المصادر؟

Please refer to Galette developer guide to get informations about souces retrieval, and development model.

Third party plugins

Third party plugins are developed and maintained by community members. Some of them may not be translated, or available on only one database engine.

  • oAuth2 (Galette act as an oAuth2 provider), developped by Manuel,
  • Stripe (handle Stripe payments), developped by Mathieu,
  • Aéroclub (base management of a flying club), developed by Mélissa (no longer maintained),
  • QRCodes (QRCodes generation), developed by Frédéric (no longer maintained),
  • Grades (evaluations management), developed by Frédéric (no longer maintained).

A Github community has been created to manage third party plugins, if you want to add your plugin.

Third party plugins community

A Gitub organisation name galette-community has been created. Its goal is to centralize plugins that are not developed by Galette team, to provide them a source code repository, a ticket management system, a website, ... And possibly get punctual help from Galette team.

Prerequisites

For a plugin to be accepted, it must fit some prerequisites:

  • be a Galette plugin,
  • be licensed under a license compatible with Galette (GPLv3 or compatible) and respect it,
  • be compatible with a "decent" Galette version.

Plugins should (this is a strong recommandation, not an obligation) be localized and respect Galette coding conventions.

Join community

Github organization system does not allow to request inclusion, you will have to contact Galette team from mailing lists, giving them your Github account name. An invitation will then be send to you.

Add a plugin

Once the invitation has been accepted, you will get right to create a repository for your plugin.

If your plugin does not yet exist, just create it. If it already exist on github, you can transfer ownership to the organization from your existing repository settings.

موقع الويب

A website ala Github can be added to your project. Concretely, configuration and contents will be stored in a specific branch of the repository name gh-pages that will only be used for the website.

The goal is to have a certain unicity on all third party plugins website. Galette team may help you for the initial setup of the website; contents and updates are in charge of the author.

Plugins management interface

A plugins management interface is provided, you will find it from the dashboard or in the configuration menu. After you have downloaded plugin(s) in Galette plugins directory, a list will be displayed:

Plugins management

If web server has read access to your plugins directory, then you can enable or disable any plugin from the related icon.

If plugin requires a database to work, you can play installation and update scripts from the interface. As example, the Paypal plugin database installation:

Initialize plugin database step 1: select installation type

Database ACLs will then be checked. Unlike Galette, no information will be asked to you, since all is already available from your current instance:

Initialize plugin database step 2: database checks

Scripts themselves will then be run:

Initialize plugin database step 3: execute scripts

And this is finished!

Initialize plugin database step 4: end :)

Developer manual

This documentation aims to help you understand the development rules of Galette, how the code is managed, ...

It is available in english only.

Galette sources

All Galette sources are stored in their own Git repository hosted by Tuxfamily (big thanks to them!). A Galette organization is also available on github, in which all repositories are mirrored.

All GIT repositories follow the adopted development model, therefore you will find two branches on each repository:

  • master: this is always the latest stable release,
  • develop: the development version, may be unstable.
Project Tuxfamily Github
Galette core
git.tuxfamily.org/gitroot/galette/galette.git
https://github.com/galette/galette
Documentation
git.tuxfamily.org/gitroot/galette/galettedoc.git
https://github.com/galette/galettedoc
Website
git.tuxfamily.org/gitroot/galette/website.git
https://github.com/galette/website
Auto plugin
git.tuxfamily.org/gitroot/galette/plugin-auto.git
https://github.com/galette/plugin-auto
Events plugin
git.tuxfamily.org/gitroot/galette/plugin-events.git
https://github.com/galette/plugin-events
Paypal plugin
git.tuxfamily.org/gitroot/galette/plugin-paypal.git
https://github.com/galette/plugin-paypal
Objectslend plugin
git.tuxfamily.org/gitroot/galette/plugin-objectslend.git
https://github.com/galette/plugin-objectslend
Maps plugin
git.tuxfamily.org/gitroot/galette/plugin-maps.git
https://github.com/galette/plugin-maps

To clone one repository, use the following along with your Tuxfamily credentials:

$ git clone ssh://YOURUSER@git.tuxfamily.org/gitroot/galette/galette.git

Or as anonymous user:

$ git clone git://git.tuxfamily.org/gitroot/galette/galette.git

The galette directory will then contain a working copy of Galette's source code.

Third party librarires

Galette's third party dependencies are not included in the repository. Instead, PHP dependencies are handled with Composer dependency manager and Javascript ones with Node Package Manager (npm) and gulpjs.

Once composer is installed on your workstation, just go in Galette directory (where you will find composer.json and composer.lock files) and run composer:

$ cd galette/galette
$ composer install -o

New in version 0.9.4.

To get Javascript dependencies up and running, go to the main directory (where you will find package.json and package-lock.json files), and run following commands:

$ cd galette
$ npm install
$ npm run-script gulp

The first command will install all javascript dependencies into the node_modules directory; while the second one will merge, minify (among others) and then copy all javascript and CSS files to a directory the web server can read.

Note

With this workflow, changes done on Galette CSS or JS files won't be visible until you run gulp again. To avoid this, you can use the watch gulp task; which will look for modifed files on disk and automatically rebuild when changed:

$ npm run-script gulp watch

How to contribute

There are numerous ways to contribute to an Open Source project like Galette. You may:

This documentation is a technical overview of the contribution process to the source code of Galette and its plugins. Read the how to contribute to Galette page on our website if your are looking for an introduction of the global process.

Writting code

To fix a bug on the stable version, you have to work on the master branch. Use the development version on the develop branch to implement new features or fix issues in the next release.

Working on separate branches is a well-known GIT good practice I advise you to follow :)

Note

If you just want to have look at the development version, download Galette nightly build archive which is updated each night.

To send us a code modification, read our sending patch practical example.

Development model

Vincent Driessen published in 2010 a development model for GIT branches I found very pertinent, and that I decided to use for Galette. With the git-flow tool from the same author, the workflow is quite simple to follow. Having doubts? Let's take a look at this article which explains why you should use git-flow.

This is perfectible (well, among many, many others :D), but this does the job, and ensures everyone works the same way.

Git configuration

First, set your name and email in git configuration:

$ git config --global user.name "Victor Hugo"
$ git config --global user.email "victor@hugo.fr"

It is the minimal configuration required to use GIT :) Of course, there are a lot of other options available, see this chapter about GIT configuration.

Note

The commands above sets the configuration globally for all your Git repositories.

Removing the --global option will set the configuation locally in the repository your working on. It is usefull when you use different identities on several projects. But in this case, don't forget to configure your repository after the initial clone.

Commit messages

Commit messages are not normalized, but we intend to follow the official documentation note about them:

Though not required, it’s a good idea to begin the commit message with a single short (less than 50 character) line summarizing the change, followed by a blank line and then a more thorough description. The text up to the first blank line in a commit message is treated as the commit title, and that title is used throughout Git. For example, git-format-patch[1] turns a commit into email, and it uses the title on the Subject line and the rest of the commit in the body.

The Galette tracker can automatically link a commit to any issue, just use refs keyword in your commit message to reference a ticket, and fixes or closes to get it closed aswell. For example:

Do something, fixes #1

Also refs #2 and #3

This will close ticket 1, and add the commit as a reference in both tickets 2 and 3.

Practical example : code modifications

Note

If you want to use git-flow, please make sure it is properly installed

Prepare the working copy

First of all, you'll have to clone Galette repository, and properly instanciate your working copy (installing all third party dependencies, etc). Please rely on Galette source code page to find all details about it.

Then, initialize git-flow:

$ git flow init

Which branch should be used for bringing forth production releases?
   - master
Branch name for production releases: [master]
Branch name for "next release" development: [develop]

How to name your supporting branch prefixes?
Feature branches? [feature/]
Release branches? [release/]
Hotfix branches? [hotfix/]
Support branches? [support/]
Version tag prefix? []
$ git branch
* develop
  master

Note

When you clone the Galette GIT repository, you land on the master branch. This documentation assumes you are working on the develop branch.

$ git checkout -b develop origin/develop

Then, since git-flow gives the details of what it does, just check the output ;)

Add a feature

To start working on a feature that we will name killer for the example :

$ git flow feature start killer
Switched to a new branch 'feature/killer'

Summary of actions:
- A new branch 'feature/killer' was created, based on 'develop'
- You are now on branch 'feature/killer'

Now, start committing on your feature. When done, use:

     git flow feature finish killer

And voila! Now you can work on your killer feature, congratulations!

While coding, it is a good pratice to bring back the last changes from the develop branch. First make sure develop is up to date, then run a rebase command from your feature/killer branch:

$ git pull origin develop:develop
$ git flow feature rebase
or
$ git rebase develop

Once the development is over, send us the patch. The feature's finishings only happens on the main repository itself.

Fix a bug

To fix a bug, you'll use git-flow with the hotfix keyword instead of feature:

$ git flow hotfix start 0.9.3.1

The main difference, as already explained, is that this branch will be based on the master branch.

Practical example: send a new feature

Note

For technical reasons, we have created mirrors of all our GIT repositories on github. All the source code is on github, and you may prefer to use their fork/pull request capacities. It is ok as well.

From your working branch (let's say you are sending the killer feature), generate a patch you can send to us:

$ git branch
  develop
* feature/killer
  master
$ git fetch origin
$ git format-patch origin/develop
0001-Placebo-commit.patch
0002-Destructive-commit.patch

You can now attach those patches files to the related ticket on Galette tracker :) Please precise which branch you chose to start from.

A few hints:

  • try to respect as possible our coding standards,
  • test your work, and other features it may affect,
  • try to add unit tests.

Galette source code

Galette is a free software licensed under GPL version 3 and written in PHP. Galette is only compatible with PHP 7.1 or more recent.

Note

While developing, you may find useful to do a bit of debug...

It is also possible to change some Galette behaviors (verbosity level, application mode, ...).

The complete API documentation for Galette is available for reference.

Filesystem hierarchy

Here is a plan of Galette used directories and some explanations about them:

  • config: configuration files
  • data: directory to store data
    • attachments: files attached to emailings
    • cache: caching directory
    • exports: where CSV exports are stored
    • files: files attached to members with dynamic fields of type file
    • imports: where to place CSV files you want to import
    • logs: log files
    • photos: members photos, and logos
    • tempimages: temporary captcha images
    • templates_c: used to store Smarty compiled templates
  • docs
  • includes: libraries, functions and Galette instantiation
    • fields_def: definition of the fields for some objects. A huge fields definition in class cause performances issues...
    • routes: routes configuration for Slim
    • smarty_plugins: specific Smarty plugin for Translation
    • dependencies.php: dependencies configuration for Slim. This handle all routes ACLs
    • galette.inc.php: one of main Galette instantiation files
    • ...
    • ...
  • install: installation script
  • lang: translation files and scripts
  • lib: internal framework
    • Galette: Galette framework
      • Common: Galette\Commons classes
      • Core: Galette\Core classes
        • Authentication.php
        • CheckModules.php
        • ...
      • Controllers: Controllers classes (since 0.9.4)
        • PdfController.php
        • CsvController.php
        • ImagesController.php
        • Crud: CRUD (Create, Read, Update, Delete) controllers
          • MembersController.php
          • PaymentTypesController.php
          • ...
        • ...
      • ...
    • ...
  • plugins: directory to install plugins
  • templates: Smarty templates source code
    • default: default Galette theme
    • ...
  • ...

Writting Conventions

Galette source code must follow PSR2 writting conventions. To respect a writting convention make the source code more easy to read, the syntax is the same from a file to another.

You can use PHP Code Sniffer to your changed code in order to be sure coding rules are respected. Some warnings may be ignored, but errors must be all fixed. An example of phpcs:

$ phpcs --standard=PSR2 lib/Galette/Core/Authentication.php

FILE: .../galette/lib/Galette/Core/Authentication.php
----------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
 225 | ERROR | [x] Expected 0 spaces after opening bracket; 1 found
 225 | ERROR | [x] Expected 0 spaces before closing bracket; 1 found
 252 | ERROR | [x] Incorrect spacing between argument "$only_name"
     |       |     and equals sign; expected 1 but found 0
 252 | ERROR | [x] Incorrect spacing between default value and equals
     |       |     sign for argument "$only_name"; expected 1 but
     |       |     found 0
----------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

Time: 105ms; Memory: 6.75Mb

Galette is licensed under GPL version 3. Each PHP source file must contain the following mention (this example is from Galette Authentication class):

<?php

/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
 * Abstract authentication class for galette
 *
 * PHP version 5
 *
 * Copyright © 2009-2011 The Galette Team
 *
 * This file is part of Galette (https://galette.eu).
 *
 * Galette is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Galette is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Galette. If not, see <https://www.gnu.org/licenses/>.
 *
 * @category  Authentication
 * @package   Galette
 *
 * @author    Johan Cwiklinski <johan@x-tnd.be>
 * @copyright 2009-2011 The Galette Team
 * @license   https://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or later
 * @version   SVN: $Id$
 * @link      https://galette.eu
 * @since     Available since 0.7dev - 2009-02-28
 */

/**
 * Abstract authentication class for galette
 *
 * @category  Classes
 * @name      Authentication
 * @package   Galette
 * @author    Johan Cwiklinski <johan@x-tnd.be>
 * @copyright 2009-2011 The Galette Team
 * @license   https://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or later
 * @link      https://galette.eu
 * @since     Available since 0.7dev - 2009-02-28
*/
abstract class Authentication()
{
   /**
    * Main constructor
    */
   public function __construct()
   {
      //do something :)
   }
}

If your php file is not a class, use the same model, but just remove the class declaration and docblock.

To help other developers to understand the code, we will try to document the code as well as possible.

Create a release

Releases are created against tags in the GIT repository. As an example to get an archive for Galette 0.9:

$ git archive --prefix=galette-0.9/ 0.9 | bzip2 > galette-0.9.tar.bz2

Note this archive will not embed external libraries (Smarty, Zend, tcpdf, ...); you will have to add them to the galette-0.9.tar.bz2 file.

Here is the script used for Galette nightly build:

cd /path/to/galette/clone
git archive --prefix=galette-dev/ develop galette | bzip2 > /tmp/galette-dev.tar.bz2
cd /tmp
tar xjf galette-dev.tar.bz2 && rm -f galette-dev.tar.bz2
cd galette-dev/galette
echo -n "Installing deps..."
composer install --no-dev -o --quiet
echo " Done"
pushd vendor > /dev/null
# Cleanup vendors
echo -n "Cleaning deps..."
find ./ -name test -or -name tests -type d -exec rm -rf {} \; 2>1 > /dev/null
find ./ -name doc -or -name docs -type d -exec rm -rf {} \; 2>1 > /dev/null
find ./ -name example -or -name examples -type d -exec rm -rf {} \; 2>1 > /dev/null
pushd tecnickcom/tcpdf > /dev/null
cp -a fonts fonts.orig
rm -rf fonts/*
cp -a fonts.orig/dejavusans.* fonts/
cp -a fonts.orig/dejavusansb.* fonts/
cp -a fonts.orig/dejavusansbi.* fonts/
cp -a fonts.orig/dejavusansi.* fonts/
cp -a fonts.orig/dejavu-fonts-ttf-2.34 fonts/
cp -a fonts.orig/helvetica.php fonts/
cp -a fonts.orig/zapfdingbats.php fonts/
rm -rf fonts.orig
popd > /dev/null
echo " Done"
popd > /dev/null
echo -n "Compressing..."
tar cjf galette-dev.tar.bz2 galette-dev
echo " Done"

Finaly, archive may be signed (to check download integrity):

$ gpg --detach-sign --armor ./galette-0.9.tar.bz2

Writting plugins

New in version 0.7.

From plugins, you can benefit from the entire Galette API, extends or complete it with classes, you can create specific pages, menu entries, and action buttons on members.

Plugin system was inspired from DotClear blogging solution.

A plugins directory in Galette will host plugins, one directory per plugin is expected:

  • plugins
    • Auto
    • Paypal
    • ...

Just as in Galette, you will find a lang directory used for translation files, a template/default directory for Smarty templates, a lib directory for classes, ...

None of those directories are mandatory, plugin may have no need for them :)

Note

All Galette development information also apply to plugins. You may need to debug a bit or change application behavior

License

Official Galette plugins are licensed under GPL version 3.

License must:

  • be included in the root directory (LICENSE or COPYING file),
  • be present in all source file headers - if the selected license wants it.

Plugins Configuration

A _define.php file must be present for each plugin. It defines plugin name, its author, ...

<?php
$this->register(
    'Galette My Plugin',         //Name
    'Plugin that does nothing',  //Short description
    'Your name',                 //Author
    '0.0.1',                     //Version
    '0.9',                       //Galette version compatibility
    'myplugin',                  //routing name and translation domain
    '2019-10-04',                //Release date
    [                            //Permissions needed
        'myplugin_main' => 'staff'
    ]
);
?>

If the file is missing or incorrect, plugin will not be loaded at all.

Plugins compatibility

Plugins compatibility is a quite simple system: Galette define a compatibility version that does not change on every Galette release, and plugins declare a Galette compatible version. Those versions are compared, and plugin is marked as compatible if it declare to support current Galette version.

On Galette side, compatibility version is declared with GALETTE_COMPAT_VERSION constant in galette/includes/galette.inc.php. On plugin side, compatibility version is declared in the _define.php plugin file.

Routes

New in version 0.9.

Changed in version 0.9.5.

You will need some URLs for your plugin. Galette rely on Slim framework to expose routes. Each URL fit a route, with a name, possible arguments, HTTP method, ...

In plugins, you must add a _routes.php file. In this file, you will declare all your plugin URLs. Galette provide URL similar to {galette}/plugins/myplugin on which your own routes wil be append.

A route is constitued of the following elements:

  • an URL,
  • maybe some URL parameters, some may be required,
  • a controller class and method to be called,
  • a name (unique),
  • access restriction,
  • a HTTP method (GET and/or POST).

A simple route example would look like:

<?php
$this->get(
    '/main',
    [TheController::class, 'welcome']
)->setName('myplugin_main');

And the corresponding method in controller would look like:

<?php

 public function welcome(Request $request, Response $response): Response
 {
     $response->getBody()->write('Welcome to the main page');
     return $response;
 }

This will respond to the URL {galette}/plugins/myplugin/main; and it will just display Welcome to the main page.

Warning

Routes names must be unique. To prevent any collision, all plugins routes names must be prefixed with plugin name.

Routes can have parameters, mandatory or not. Following example add the arg1 required parameter, and the arg2 optionnal one:

<?php
$this->get(
    '/test/{arg1}[/{arg2}]',
    [TheController::class, 'test']
)->setName('monplugin_test');

And the corresponding method in controller would look like:

<?php

 public function test(Request $request, Response $response, int $arg1, string $arg2 = null): Response
 {
     //with an URL like /test/1/value2
     $response->getBody()->write(
         $arg1 . //1
         ' ' .
         $arg2 ?? '' //value2
     ); //1 value2
     return $response;
 }

It is also possible to restrict a parameter value using regular expressions. See Slim routing documentation to know more.

Controller

As we've just seen; you have to create at least one controller class which inerits from Galette\Controllers\AbstractPluginController and contains a $module_info class parameter used to inject plugins information.

<?php
namespace GaletteMaps\Controllers;

use Galette\Controllers\AbstractPluginController;
use Psr\Container\ContainerInterface;
use Slim\Http\Request;
use Slim\Http\Response;

/**
 * MyPlugin controller
 *
 * @category  Controllers
 * @name      TheController
 * @package   Galette
 * @author    Johan Cwiklinski <johan@x-tnd.be>
 * @copyright 2021 The Galette Team
 * @license   http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
 * @link      https://galette.eu
 */

class TheController extends AbstractPluginController
{
    /**
     * @Inject("Plugin Galette My Plugin")
     * @var integer
     */
    protected $module_info;
}
Routes and templates

Of course, you will probably need something more than simple echo from a display point of view;

Globally, inside Galette, GET routes displays information (lists, forms, ...) and POST routes do actions. That way, forms will have a POST action, that will do the job, and then will redirect on a GET page.

Displaying a page from a Smarty template would look like:

<?php
// display page
$this->view->render(
   $response,
   'file:[' . $this->getModuleRoute() . ']file.tpl', [
       'require_dialog' => true,
       'list_values'    => $myvalues
   ]
);

The use of the $this->getModuleRoute() ensures the file you are trying to load is the one from your plugin. Without that, if Galette or another plugin provides a file.tpl file, it may be loaded instead of the one from your plugin, and this won't work. Then, file:file.tpl is core template file, while file:[myplugin]file.tpl the template from plugin which identifier is myplugin.

Note

Galette is in charge to attribute identifiers to plugins. Do no try to guess it, and use $this->getModuleRoute() which is unique per plugin.

Redirections are simple to do:

<?php
return $response
   ->withStatus(301)
   ->withHeader('Location', $this->router->pathFor('slash'));
Access restrictions

Galette provides a middleware <https://www.slimframework.com/docs/concepts/middleware.html> which restricts routes access.

Following roles can be used:

  • superadmin (super-administrator),
  • admin (administrators),
  • staff (staff members)
  • groupmanager (groups managers)
  • member (logged in user)

groupmanager and member roles requires additional work. A route that is accessible for groups managers, but their access must certainly be restricted to the groups they owns.

To add a restriction access to a route, call the $authenticate middleware on your route:

<?php
$this->get(
    'myplugin_routes',
    [TheController::class, 'welcome']
)->setName('myplugin_main')->add($authenticate);

Along with that, you have to define the access to that route in your _define.php file. In the example from the begginning of the doc, myplugin_main route has been restricted to staff members only.

Pages which does not need any specific restriction will just not call the middleware. It is the same for pages which may be displayed for boths logged in and not. In that case, you must have logic in your route and/or in your classes to manage access.

Public pages

Some of pages may be accessible without authentication, this is a Galette preference. For such pages, you will have to check if public pages are active for current logged in user in controller method:

<?php
 public function welcome(Request $request, Response $response): Response
 {
     if (!$this->preferences->showPublicPages($login)) {
         //public pages are not actives
         return $response
            ->withStatus(301)
            ->withHeader('Location', $this->router->pathFor('slash'));
     }
    //content if accessible
     return $response;
 }
Usage

You will need to use links to your different routes, either in Smarty templates or in routes themselves (redirection case for example).

From PHP code, you will use pathFor method. If route is waiting for parameters, send them as an indexed array:

<?php
$this->router->pathFor('myplugin_main');
$this->router->pathFor('myplugin_test', ['arg1' => 1, 'arg2' => 'value2']);

From a Smarty template, use the path_for function:

{path_for name="myplugin_main"}
{path_for name="myplugin_test" data=["arg1" => 1, "arg2" => "value2"]}

Note

If a required parameter is missing, path will not be generated and this will produce an error.

Web resources

In Galette, all resources that must be read from the server (images, CSS and javascript files) must be in the webroot directory in your plugin. This one will be kind of mapped to be served from the web.

Smarty

Heritage

Before Galette 0.9, templates was providing a page part only, and PHP code was in charge to include it in the page. But now, template files must declare their heritage.

Three parent templates are provided:

  • page.tpl for most of the pages,
  • public_page.tpl for public pages,
  • ajax.tpl for AJAX called pages.

Parents templates provide a content block to display page contents. page.tpl and public_page.tpl also provide a javascript to include all <script> elements at the right place. None of those blocks is mandatory, but an empty page would not make sense ;)

{extends file="page.tpl"}
{block name="content"}
    Your content here
{/block}
{block name="javascript"}
    <script>alert('Hello from javascript.');</script>
{/block}

Parent template can be conditionned if you use a variable:

if $mode eq 'ajax'}
    {assign var="extend" value='ajax.tpl'}
{else}
    {assign var="extend" value='page.tpl'}
{/if}
{extends file=$extend}
Variables assignement

It is possible to pass global variables to Smarty (with $tpl->assign('my_var', 'my_value');). To achieve that, add a _smarties.php file to your plugin. It may currently provide only one array named _tpl_assignments:

<?php
$_tpl_assignments = array(
    'my_var'             => 'my_value',
    'dossier_includes'   => '__plugin_include_dir__dossier',
    'nomplugin_tpl_dir'  => '__plugin_templates_dir__',
    'nomplugin_dir'      => '__plugin_dir__'
);
?>

All declared variables will be accessible from Smarty templates like all other variables: {$my_var}.

Automatic replacements may occurs in declared variable, using specific strings:

  • __plugin_include_dir__ will look for includes directory in your plugin (will be ./plugins/dir_name/includes/dossier for our example)
  • __plugin_templates_dir__ will be replaced with plugin templates directory (will be ./plugins/dir_name/templates/ for our example)
  • __plugin_dir__ will be replaced with path to your plugin (will ./plugins/dir_name/ for our exemple)

That way, whatever the directory name used, you'll find the good one :)

Add HTML headers

When present, the content of header.tpl file will add its content in HTML pages headers (the <head> tag), just after core ones.

<link
   rel="stylesheet"
   type="text/css"
   href="{path_for name="plugin_res" data=["plugin" => $module_id, "path" => "galette_pluginname.css"]}"/>

Headers added this way will be used in the entire application. For CSS stylesheet files, please make sure not to change existing Galette rules, this may cause display issues.

Also note the path to the CSS file must be obtained using a route.

Add actions on members

It is possible for a plugin to add actions on members, adding one or more entries in members list "actions" column, or displaying one member information.

An adh_actions.tpl file in your plugin templates will add new actions in members list, with a simple list of links:

<a href="{path_for name="myroute" data=["id" => $member->id]}">
   <img
      src="{path_for name="plugin_res" data=["plugin" => $module_id, "path" => "images/icon-plugin.png"]}"
      alt="{_T string="Plugin menu entry" domain="myplugin"}"
      width="16" height="16"/>
</a>

Another file named adh_fiche_action.tpl in your plugin templates will add actions displaying a member for edition, as a HTML list element (li tag):

<li>
   <a
      href="{path_for name="myotherroute" data=["id" => $member->id]}"
      id="btn_plugins_myplugin">
      {_T string="Plugin menu entry" domain="myplugin"}
   </a>
</li>

Each added action must of course add a PHP code that will handle sent data.

Add combined actions on members

New in version 0.8.

Some actions are available to be run combined with a members selection from the list, like mailings, CSV exports, labels generations, ... It is also possible to add that kind of action from a plugin. Create a adh_batch_action.tpl file in your plugin templates, it will contain a HTML list element (li tag) with a send button (<input type="submit"/>):

<li>
    <input type="submit"
        name="pluginname_actionname"
        value="{_T string="My plugin batch action" domain="myplugin"}"
    />
</li>

Constants declaration

If your plugin must own his own tables in database, it is adivsed to declare an extra prefix so each table can be easily identified in the database. You can declare constants in a _config.inc.php file to achieve that:

<?php
define('PLUGIN_PREFIX', 'myplugin_');
?>

Call to a table in the code will then look like:

<?php
[...]
const TABLE = 'mytable';
[...]
// ==> 'SELECT * FROM galette_myplugin_mytable'
$query = 'SELECT * FROM ' . PREFIX_DB . PLUGIN_PREXFIX . self::TABLE;
[...]
?>

Internationalisation

Every plugin must provide translations for new string it proposes. Galette global internationalisation system applies here. The main task (exepted files update while developing plugin) consists to set up translation files the first time.

Use an official plugin up to date as references, and copy lang/Makefile and lang/xgettext.py files in your own lang directory:

$ cd plugins/MyPlugin/lang
$ cp ../../MapsPlugin/lang/Makefile ../../MapsPlugin/lang/xgettext.py .

You will have to adapt Makefile file to your plugin:

  • change DOMAINS value to reflect translation(s) domain(s) of your plugin;
  • change LANGUAGES value to reflect available langs of your plugin;
  • adapt PHP_SOURCES value.

PHP_SOURCES variables will list all files that mays contains strings to translate. Regarding your needs and your plugins directory hierarchy; they may vary. For example, for a plugin with only a few PHP classes and some Smarty templates, you would use:

PHP_SOURCES = $(shell find ../ -maxdepth 1 -name \*.php) \
              $(shell find ../lib/GaletteMonPlugin/ -name \*.php) \
              $(shell find ../templates -name \*.tpl)

If you follow Galette development standards, you should not have to change PHP_SOURCES. Advanced editing of the Makefile is out of the gaols of the documentation.

First time you will launch make, you may see a lot of errors. You should ignore them, the script is not happy to work with empty PO files :) All required directories and files will be created, and you can now use your translation tool to work on them.

Update scripts

In a new version, your plugin may need to add/change/drop new tables/columns/else in your tables. To achieve that, you must create a scripts directory. It is handled the exact same ay as {galette}/install/scripts/, and must follow the same rules:

  • installation and update scripts must be provided for both MariaDB (MySQL) and PostgreSQL,
  • installation script names must be mysql.sql and pgsql.sql in order to be found from Galette,
  • update scripts must also follow a naming convention: upgrade-to-{version}-{dbtype}.sql or upgrade-to-{version}.php, where {version} is the new plugin version and {dbtype} the database type (mysql or pgsql). PHP update scripts does not rely on database engine, if there are specificities, they'll be handled in code itself.

Respecting those rules ensures plugin will be supported from the Galette plugins management interface, and user will be able to install or update easily your plugin.

PHP classes

Plugins may need their own classes. For Galette, class name and namespace (namespace) are importants.

All classes must be in the lib/{namespace} directory of your plugin. Each class is a PHP file which name is the class name (including case). Namespace is built with plugin name as declared in _define.php. In our example, plugin name is Galette My Plugin and therefore the namespace will be GaletteMyPlugin.

The MyClass class will will be written in lib/GaletteMyPlugin/MyClass.php:

<?php
namespace GaletteMyPlugin;

class MyClass {
    [...]
}

And to call it:

<?php
[...]
use GaletteMyPlugin\MClass;
$instance = new MyClasse();
//or
$instance = new \GaletteMyPlugin\MyClass();

Warning

When you use namespaces, all other libraries or PHP objects used them aswell. In your MyClass, names of classes will be resolved that way:

<?php
namespace GaletteMyPlugin;

class MyClass {
    public myMethod() {
        $object = new stdClass(); // ==> instanciate a \GaletteMyPlugin\stdClass() - that does not exists
        $otherobject = new \stdClass(); // ==> instanciate a PHP stdClass object
    }
}

Third party libraries

Third party dependencies must not be included in plugin sources, but in releases only.

Galette uses composer to handle third party libraries, plugins can do the same if needed.

File system hierarchy

Finally, a plugin directory should look like:

  • plugins
    • galette-myplugin
      • includes
        • ...
      • lang
        • ...
      • lib
        • GaletteMyPlugin
          • Controllers
            • TheController.php
          • ...
      • templates
        • default
          • headers.tpl
          • menu.tpl
          • ...
      • webroot
        • ...
          • images
            • ...
      • _config.inc.php
      • _define.php
      • _smarties.php
      • _routes.php
      • ...

And for all remaining development questions... Well, rely on PHP manual, Smarty manual, a mail client to write to mailing lists, and potentially an IRC client to join Galette IRC channel ;-)

Just like Galette core source code, plugins must follow PSR2 coding standards: https://www.php-fig.org/psr/psr-2/

Since Galette provide support for both MariaDB and PostgreSQL, it would be logicial for plugins to do the same.

Registration form

New in version 0.8.3.

Changed in version 0.9.

It is possible to reconfigure the registration form. A basic version is provided in Galette, that uses PDF models, but it may not suit everyone needs. The fullcard plugin for example, will override to provide its own version, without any change in the browsers URL (completely invisible for users).

This is enabled by creating a _preferences.php file in your plugin, with a content like:

<?php
$_preferences = [
    'pref_adhesion_form' => '\GaletteFullcard\PdfFullcard'
];

Galette events

New in version 0.9.4.

Galette emit some events when members, contributions and transactions are added, updated or removed. This is provided using PHP league Event library.

All possible events are:

  • adherent.add,
  • adherent.edit,
  • adherent.remove,
  • contribution.add,
  • contribution.edit,
  • contribution.remove,
  • transaction.add,
  • transaction.edit,
  • transaction.remove.

In order to catch any of those events, you will need a PHP class named PluginEventProvider in your plugin namespace, which must provide a provideListeners method:

<?php
namespace GaletteMyPlugin;

use League\Event\ListenerAcceptorInterface;
use League\Event\ListenerProviderInterface;
use Analog\Analog;

class PluginEventProvider implements ListenerProviderInterface
{
    public function provideListeners(ListenerAcceptorInterface $acceptor)
    {
        $acceptor->addListener('member.add', function ($event, $member) {
            Analog::log(
                sprintf(
                    '[%1$s] Event emitted: member %2$s has been added.',
                    get_class($this),
                    $member->sfullname
                ),
                Analog::DEBUG
            );
        });
    }
}

First argument of your listener is the event name, and the second an anonymous function that will receive the event itself as first argumennt, and an instance of the related Galette object. You can of course add several listeners on possible events.

Internationnalisation (i18n)

Galette source code is entirely internationnalised thanks to GNU Gettext. All translatable strings in the source code must be in english.

The lang directory contains:

  • Makefile, make_lang_l12n.py, xgettext.py: utilities to manage translations,
  • *.pot: transaltions template files, one per domain,
  • *.po: translation files, one per lang and per domain.

Galette core, all oficial plugins as well as documentations are translated using Weblate platform.

Syntax

Two different types of syntax are used:

  • PHP syntax,
  • Smarty syntax.
PHP

For PHP syntax, this is the _T function that is used. There is a second optionnal argument for translation domain, which defaults to galette.

<?php
echo _T("Hello world!");
echo _T("Hello world!", "galette"); //galette is the default domain
?>

Note

Another method, __() is very similar to _T(). This one will not mark strings which miss a translation.

This was used to translate routes mainly; but this is no longer possible.

Often, you will have to use variables in translated strings. To do that, use a placeholder in the string to translate, and use something like str_replace or preg_replace to do the effective replacement:

<?php
echo str_replace('%name', $adh->name, _T("Hello %name!"));
?>
<?php
$search = array(
   '/%name/',
   '/%surname/',
   '/%town/'
);
$replace = array(
   $adh->name,
   $adh->surname,
   $adh->town
);
echo preg_replace(
   $search,
   $replace,
   _T("Hello %name %surname from %town")
);
?>

Note

You can use any word you want as pattern, just try to keep simple for others :) There are several other ways to handle string replacements, check PHP documentation.

Smarty

Smarty translation is done with a custom plugin:

<p>{_T string="Hello world!"}</p>
<p>{_T string="Hello world!" domain="galette"}</p>

Smarty comes with modifiers that may be used to do remplacements among others. But it is done before the text is sent to the plugin, so translation cannot be found (it already contains a replacement value for our pattern). Our Smarty plugin can take two optionnal arguments to handle properly replacements:

<p>{_T string="Hello %name!" pattern="/%name/" replace=$adh->name}</p>
Translation domains

New in version 0.9.

Galette uses translation domains to prevent string replacements from external sources. Default domain name (implicit if not specified) is galette

Each plugin will come with at least one domain of its own.

You must then tell the functions which domain you want to use:

<?php
echo _T('Hello, you'); //uses default domain, french will be 'Bonjour, vous'
echo _T('Hello, you', 'another'); //use another doamin ; french will be 'Salut, toi'

Same example, with Smarty:

{_T string="Hello, you!"}
{_T string="Hello, you!" domain="another"}

Generate lang files

There are several steps to update Galette translations:

  • extract strings from source code and update translation templats (POT files) (run make extract from lang directory and commit updated POT file),
  • (let translators do their job)
  • retrieve translated files (PO) from translation platform
  • compile translation files (MO)

Note

It is possible to generate local PO files with make po, but all mecanisms assume the translation platform is used.

Once the updated POT file has been pushed to the Github mirror, an update is triggered on the Weblate platform. Weblate translations are commited in a forked Git repository, and must be merged back to Galette:

$ git remote add weblate https://hosted.weblate.org/git/galette/galette/
$ git fetch weblate
$ git merge weblate/develop

Finally, you must compile translations (compiled files are the ones used):

$ make mo

In order to refresh known languages, you will have to logout/login from your Galette instance. You may have to restart PHP as well.

Controllers

New in version 0.9.4.

Controllers are - in a MVC model - in charge of make relation between an URL and Objects that does the job behind the scenes. Since Galette uses Slim Framework, we've used anonymous functions in routes; but that makes all that code not reusable; therefore there were plenty of code that was very similar in several places.

This includes two steps removal mechanisms, outputs, and so on.

With new controllers, is is now possible to add specific methods that ease the development, and makes it less dependent on the framework. Check the Slim documentation about container resolution to known more.

Note

Of course, plugins can inherit of existing controllers and benefit of existing automations!

Abstract controller

Galette provides an AbstractController class all controllers must inherit. It declares in its constructor all properties from dependency injection used:

  • $zdb database instance,
  • $login current logged in user instance,
  • $preferences Galette configuration instance,
  • $view Smarty instance,
  • ...

All those properties are then accessible like $this->zdb inside controllers.

CRUD controllers

CRUD stands for Create, Read, Update, Delete. Galette provides a Galette\Controllers\CrudController abstract class all objects that suits CRUD should rely on. By extending this class, you must declare all abstract methods:

  • add for the add page,
  • doAdd that will handle the add code,
  • list for a list,
  • filter for list filtering,
  • edit for the edit page,
  • doEdit that will handle the edit code,
  • ...

For most of the pages, add and edit as well as doAdd and doEdit may be very similar; then you can use another new method (say store) that does the real job (that was not possible with anonymous functions previousely used):

<?php

use Slim\Http\Request;
use Slim\Http\Response;

public function doAdd(Request $request, Response $response, array $args = []) :Response
{
    return $this->store($request, $Response, $args);
}

public function doEdit(Request $request, Response $response, array $args = []) :Response
{
    return $this->store($request, $Response, $args);
}

public function store(Request $request, Response $response, array $args = []) :Response
{
    //do the magic
    return $response;
}

Two steps removal (one for removal confirmation, and then real removal) is quite simple: most of the code is automatically handled from the CrudController; you will have to define a few methods, to set the confirmation page title, the form and redirection URLs, and the removal itself; without taking care of what will be output. As an example, for payment types removal, this looks like the following:

<?php

public function redirectUri(array $args = [])
{
    return $this->router->pathFor('paymentTypes');
}

public function formUri(array $args = [])
{

    return $this->router->pathFor(
        'doRemovePaymentType',
        ['id' => $args['id'] ?? null]
    );
}

public function confirmRemoveTitle(array $args = [])
{
    $ptype = new PaymentType($this->zdb, (int)$args['id']);
    return sprintf(
        _T('Remove payment type %1$s'),
        $ptype->getName()
    );
}

protected function doDelete(array $args, array $post)
{
    $ptype = new PaymentType($this->zdb, (int)$args['id']);
    return $ptype->remove();
}

As you can see, we remove only one payment type at once; but you can also handle batch removal, with a few adaptations from the example below, and redefinition of the getIdsToRemove method that rely per default on a id argument set in URL.

<?php

protected function getIdsToRemove($args)
{
    if (isset($args['id'])) {
        return $args['id'];
    } else {
        $filters =  $this->session->filter_members;
        return $filters->selected;
    }
}

PDF and CSV controllers

The PdfController and CsvController in Galette centralize all PDF/CSV outputs, but the most interesting point is the sendResponse method that set correct headers and contents for those specific outputs.

The PdfController::sendResponse method waits for a Slim\Http\Response and a Galette\IO\Pdf objects to work.

The CsvController::sendResponse method waits for a Slim\Http\Response, path to the file on disk, and file name for download.

Usage in routes

Instead of using anonymous function directly in routes, you will call controller's methods. For example , for members it would look like:

<?php

//members list
$app->get(
    '/members[/{option:page|order}/{value:\d+}]',
    Crud\MembersController::class . ':list'
)->setName('members')->add($authenticate);

//members list filtering
$app->post(
    '/members/filter',
    Crud\MembersController::class . ':filter'
)->setName('filter-memberslist')->add($authenticate);

$app->get(
    '/member/remove/{id:\d+}',
    Crud\MembersController::class . ':confirmDelete'
)->setName('removeMember')->add($authenticate);

$app->get(
    '/members/remove',
    Crud\MembersController::class . ':confirmDelete'
)->setName('removeMembers')->add($authenticate);

$app->post(
    '/member/remove' . '[/{id:\d+}]',
    Crud\MembersController::class . ':delete'
)->setName('doRemoveMember')->add($authenticate);

Debug

Logs

Galette writes in logs files (one file per day) stored in galette/data/logs if you do not change the log path configuration. But be aware that some errors will only be displayed in system PHP logs.

Verbosity level is fixed to INFO on a standard installation; you can change log level.

Note

Writting in logs files takes ressources (writes to disk). The more logs are verbose, the more Galette will be "slow".

Please also note it is possible some "sensitive" data are stored in the logs. DEBUG mode for example will store every query executed in the database!

Several logs levels exists, you can find many use cases in the source code. They are defined by the logs lib (Analog), from the most critical to the less critical:

  • URGENT
  • ALERT
  • CRITICAL
  • ERROR
  • WARNING
  • NOTICE
  • INFO
  • DEBUG

Galette modes

Several modes are provided in Galette you can configure with GALETTE_MODE constant (see Galette behavior configuration). This directive can take the following values:

  • PROD: production mode (non production instance should be on an other mode). This is the default mode for releases, but it may change in development branch.
  • DEV: development mode:
    • unstable/not finished parts will be activated,
    • some data will not be stored in session,
    • default log level is set to DEBUG,
    • news won't be cached,
    • database verion check will not be done.
  • DEMO: demonstration mode, the same as PROD but with some features disabled like sending emails, modifying superadmin data, ...
  • TEST: reserved for unit tests.
  • MAINT: maintainance mode. Only super admin will be able to login.

Behavior configuration

It is possible to change some of Galette behaviors:

  • GALETTE_MODE: see Galette modes ;
  • GALETTE_DISPLAY_ERRORS: true to display error details in page. Really discouraged for production environments! You will not see errors if there is a routing redirect... And there are plenty of them.
  • GALETTE_LOG_LVL: log level;
  • NON_UTF_DBCONNECT : disable explicitely UTf-8 connection to the database (for users who see encoding issues);
  • you'll find in related part of the documentation you can use behavior configuration for some other usages (such as PDF cards settings, session lifetime, ...).

You can add those directives by declaring constants in the config/behavior.inc.php.

For example:

<?php
define('GALETTE_MODE', 'DEV');
define('GALETTE_DISPLAY_ERRORS', true);
define('GALETTE_LOG_LVL', 7);

Build documentation

First, clone repository, please refer to the Galette Documentation GIT documentation to get its source.

To build the documentation, go to the root of the project (galettedoc directory if you've cloned the GIT repository) and then run make with one of the formats you want to compile (html, epub, latexpdf). In order to build the documentation for all three formats, we would run:

$ make html epub latexpdf
  sphinx-build -b html -d build/doctrees  source build/html
  Running Sphinx v1.8.4
  loading translations [fr]... done
  making output directory...
  building [mo]: targets for 0 po files that are out of date
  building [html]: targets for 41 source files that are out of date
  [...]
  Build finished. The HTML pages are in build/html.
  sphinx-build -b epub -d build/doctrees  source build/epub
  Running Sphinx v1.8.4
  loading translations [fr]... done
  making output directory...
  loading pickled environment... done
  building [mo]: targets for 0 po files that are out of date
  building [epub]: targets for 41 source files that are out of date
  [...]
  Build finished. The epub file is in build/epub.
  sphinx-build -b latex -d build/doctrees  source build/latex
  Running Sphinx v1.8.4
  loading translations [fr]... done
  making output directory...
  loading pickled environment... done
  building [mo]: targets for 0 po files that are out of date
  building [latex]: all documents
  [...]
  Running LaTeX files through pdflatex...
  [...]
  pdflatex finished; the PDF files are in build/latex.

Translations

In order to update translations, it is necessary to update POT files from the sources rst files. This can be achieved running the following command:

$ sphinx-build -b gettext source source/locale

In order to test your modifications locally on your workstation, you will need to build the documentation using an additional parameter with the make command. For example, to build the documentation in HTML in French, run :

$ make -e SPHINXOPTS="-D language='fr'" html

Note

By default, the make command will build the documentation in English.

Changelog

0.9.6 => 0.9.6.1

  • Fix language detection priority not respected (#1603)
  • No composer platform check (#1600)
  • Fix html2text for php 8 (#1601)
  • Fix social networks replacements (#1606)

0.9.5.2 => 0.9.6

  • Social networks/contact externalization (#1585)
  • Add member number (#190)
  • Export contributions as CSV (#1581)
  • Drop group name uniqueness at same level (#366)
  • Add information to display for dynamic fields (#1190)
  • Add preferences for groups manager to edit, create members, edit groups, send mailing and perform exports (#499)
  • Fix various XSS issues
  • Fix possible SQL injection
  • Add CSRF protection
  • Fix address escaping at display (#1592)
  • Prevent issue creating contribution with an empty amount (#1593)
  • Fix undefined index when locale is missing on system
  • Fix issue reusing a saved search from advanced search
  • Update translations

0.9.5.1 => 0.9.5.2

  • Update translations
  • Work on PHP 8.1 compatibility and tests improvements (#1570)
  • Fix members list issue with titles column displayed (#1584)
  • Fix members list ordering (#1586)
  • Fix missing emails texts insertion (#1587)
  • Drop duplicate check on saved searches
  • Fix some silent errors
  • Some data were missing checking passwords against personal data
  • Fix gateway timeout sending emails with SSL SMTP (#1591)

0.9.5 => 0.9.5.1

Added

  • Add a preference to send emails to member by default (#1536)
  • Add a preference to always send contributions emails (#1481)
  • Mass change dynamic fields (#1194)
  • Mass add contributions (#1381)
  • Add a preference to choose default payment type (#1578)
  • Members can manage their children and create new ones (if preference is on) (#946)
  • Prevent installation page access if Galette is already installed (#1574)

Fixed

  • Fix overlapping menu in mobile (#1559)
  • Adjust members state of dues chart (#1558)
  • Rely on more powerfull WYSIWYG html editor in emails (#1568)
  • Replace jQuery Cookie with JS Cookie (#1569)
  • Fix close expiries filter and impending reminders (#1566)
  • Fix address with a quote (#1567)
  • Fix undefined constant on Alpine (#1572)
  • Fix transactions list (#1576)
  • Fix advanced search with dynamic fields (#1575)
  • Fix new user registration email (#1577)
  • Fix contributions ordered on payment type (#1579)
  • Fix public list ordering (#1580)

0.9.4.2 => 0.9.5

This release contains security fixes; updating is highly recommended!

The security issues that has been reported is an XSS injection, issued as CVE-2021-21319.

  • PHP8 compatibility (#1492),
  • Cannot create new members (#1523)
  • Inactive accounts can renew their password (#1529)
  • Error on removing contribution type (#1531)
  • Cannot cascade remove groups (#1533)
  • Ability to order on contributions and transactions ID (#1502)
  • Variables available in emails and PDF are now the same, dynamic fields has been added, ... (#1445, #1393, #1520)
  • Fix late reminders PDF labels (#1506)
  • Third party dependencies has been updated and cleaned (#1515, #1299), some for security reasons
  • Add dynamic files on contributions and transactions, fixes (#1552, #1548, #1546)
  • Improve self subscription captcha (#1516)
  • Few fixes on members views (#1512)
  • Fix auto generated logins that contains @ (#1542)
  • Change some database fields so they can store more characters (#1499, #1534)
  • Under the hood, the dependency management system has been changed (#1372). This unfortunately affects all plugins, none of them will be compatible.

Dependency management changes unfortunately makes all plugins incompatible with this release.

0.9.4.1 => 0.9.4.2

  • Issues on mailing instantiation, in core and plugins (#1495)
  • Fix issues on mailings attachmments (#1497)
  • Post contribution script was called too early (#1496)
  • Fix cards colors on new installations (#1508)
  • First and last name were inverted in core PDF member card
  • Print logo was the one used, but not the one displayed in preferences

0.9.4 => 0.9.4.1

Added

  • Many improvements on string translations (add support for plurals, contexts and comments, #1444
  • Use events to send administrative emails (account creation, edition, contribution added)
  • Many locales updates thantks to Weblate translators!

Fixed

  • Fix displayed version number (#1446)
  • Missing "Next" button in members dynamic dropdown (#1449)
  • Error creating dynamic field with empty name (#1452)
  • Pagination was missing on public pages (#1453)
  • Fix reminders wrong count (#1454)
  • Members cannot print their own cards (#1462)
  • Fix direct links to download documents (#1463)
  • Fix compagnies/natural persons graph (#1465)
  • Do not notify member on contribution change (#1467)
  • Cannot print labels or change members in mailings (#1468)
  • Fix search on dates in contributions list (#1469)
  • Unable to unset booleans on mass change (#1471)
  • Unable to unset booleans on dynamic fields (#1472)
  • Captcha issue on self subscritpion page (#1478)
  • Wrong JS action in mailings (#1482)
  • SQL error on invoices/receipt direct download (#1483)
  • Issues with images in dynamic files (#1486)
  • Fix several issues sending reminders (#1487, #1455)
  • Change log in URL (#1447)
  • Do not display inactive members as late (#1451)
  • Fix several issues in distribued archive (remove symlinks, fix tar format, ... - #1448)

0.9.3.1 -> 0.9.4

Note

A very big thanks to APiCy for their donation to support this release by including direct links to members cards, invoices and receipts!

Added

  • Configurable password security enforcement (on strength, blacklist, ...) (#1039)
  • Import dynamic fields from CSV (#940)
  • Handle already encrypted passwords on imports (#1215)
  • Manage members list displayed fields (#979)
  • Emit events when members, contributions or transactions are added, edited or removed (#1400 - thanks to Nicolas B.)
  • Add direct download links to member card, invoice/receipt in sent emails (#1004)
  • Advanced search on groups with AND/OR (experimental) (#907 - thanks to Alain C.)
  • Handle RTL on PDF (#1430)
  • Administrative emails can now be translated in all available languages (and are present on translation platform) (#1330)
  • Offer last months when using beginning of membership date (#1407 -thanks to Manuel H.)
  • Members can print their own invoices/receipts (#1409 - thanks to Nicolas B.)
  • Send member and contribution IDs to post script (#1406)
  • Possibility to use member's deadline instead of year in PDF cards (#1425)

Fixed

  • Fix member card with PHP 7.4 (#1423)
  • Fix contribution PDF on some cases (#1411 - thanks to Manuel H.)
  • Fix date calculation issue with new contributions types (#1410 - thanks to Manuel H.)
  • Fix wrong value in history creating new member (#1405)
  • Several fixes on CSV imports (#1403)
  • Fix some issues using MySQL (#1219)
  • Fix some issues on member duplication (#1432)

Under the hood...

  • Improve routes ACLs to support regular expressions (#1426)
  • Rely on GulpJS and NPMJS to handle Javascript dependencies (#1341)
  • Switch to Laminas (#1385)
  • Rework routes using controllers (#1354)
  • Use of Weblate for translations

0.9.3 -> 0.9.3.1

  • Use new icons in titles management (#1375)
  • Ensure PHP 7.4 is supported
  • Handle properly and test sequences in PostgreSQL for titles, payment types, PDF models, texts and fields categories (#1374, #1378)
  • Fix Telemetry from PostgreSQL instances (#1376)
  • Fix dynamic translations removal
  • Check for session extension presence (#1380)
  • Redo multiple status selection in advanced search (#1390)
  • Fix user search by nickname in dropdowns (#1383)

0.9.2.1 -> 0.9.3

Added

  • New translations has been added!
  • Galette translation are now done on weblate platform
  • Save searches (#691)
  • Ability to use several admins email addresses from preferences (#643)
  • Send a mail to admins when a member edit his card (#756)
  • Flexible redirect after member creation (#1136)
  • Add current date variable (DATE_NOW) in PDF models (#1260)

Fixed

  • Fix translation issue on memebrs page fieldsets (#1125)
  • Fix dynamic date fields check (#1213)
  • Fix blank page at install on some environments (#1236)
  • Fix javascript escaping on mailings (#1247)
  • Fix groups members removal error (#1251)
  • Fix pagination on trombinoscope (#1252)
  • Fix logo path on some web server configurations (#1255)
  • Dynamic fields order was not stored (#1262)
  • Various fixes related to new dropdowns (#1263, #1264, #1265)
  • Add missing date fields changes on mysql (#1266)
  • Missing date selectors on advanced search and dynamic fields (#1267)
  • Fix PDF extension and content type (#1271)
  • Fix upper case removal from composed names (#1272)
  • Remove company name when checkbox is unchecked (#1277)
  • Fix call from wrong object in mailing (#1280)
  • Reply-to in preferences was not used (#1349)
  • Fix issues with HTTP 2.0 servers (#1342, #1343, #1348, #1347)
  • Use PDF models header and footer on emargement lists (#1346)

0.9.2 -> 0.9.2.1

  • Unable to store Galette URL in preferences (#1246)
  • Fix dropdowns filtering (#1234)
  • Imcompatible locales files (#1232)
  • Fix required fields on children cards (#1230 and #1229)
  • Fix contributions storage (#1228)
  • Fix distribution type in transaction (#1227)
  • Redirection issues (#1226)
  • Rework PHP version and extensions checks (#1225)
  • Fix members search when adding a new contribution (#1224)
  • Remove routes translations (#1223)

0.9.1.2 -> 0.9.2

Note

A very big thanks to Danielle C. and "Les Amis de la Gendarmerie" for their generous donation to support this release!

Added

  • Add a variable for the identifier in PDF models and emails texts (#1222)
  • Search (name, email, id, ...) for members when adding transactions and contributions (#1218)
  • PHP 7.1 minimum,
  • Manage payment types (#1084)
  • Remove passwords in emails (#1171)
  • Duplicate members (#633)
  • Configure default account filter (#345)
  • Rework translation system, which now requires the PHP intl extension
  • Display count for members and managers in groups

Fixed

  • Dry run mode of imports has been reworked to fix several issues
  • Fix version detection when updating
  • Document PDF models variables (#1066)
  • Admit more than 100 years old members (#452)
  • Fix birth dates range
  • Add checks on birthdate when storing
  • Fix contributions list filtering (#1185)
  • Use sender information on preview (#1188)
  • Fix mail sender storage in history (#1188)
  • Remove "not translated" message on dynamic fields labels
  • Fix search on boolean dynamic fields (#1186)
  • Fix contributions mass removal (#1192)
  • Remove dynamic field content when it is removed (#1191)
  • Fix PostgreSQL update script
  • Fix redirection issues on some cases (mainly when using proxies)
  • Dynamic fields now works in PDF forms (thanks to Jérôme B.!)
  • Fix Csv fields configuration (#1208)
  • Fix rights on dynamic fields (#1201)

Under the hood...

  • Use InnoDB engine for all tables (#1006)
  • Automatic send of telemetry
  • Use of Zanata for translations
  • Use of Zend Translator
  • Update third party libraries

0.9.1.1 -> 0.9.1.2

  • Fix member storage on unchecking checkboxes (#1181)
  • Fix member storage when title field is not displayed (#1181)

0.9.1 -> 0.9.1.1

  • Fix unopportune group removal on member update (#1178)
  • Fix URL for reverse proxies (#1176)
  • Fix redirection when member is not logged in (#1175)

0.9 -> 0.9.1

Note

Thanks to the "Association Bretonne des Amis de Saint Jacques de Compostelle" who has sponsorised sender choice!

Added

  • Mass change on members (#696)
  • Choose default state for new members in preferences (#963)
  • Customizabe text in pages footer (#1107)
  • Add German translation (#1165, thanks to Arnold W.)
  • Choose sender information when sending a mail (#1142)

Fixed

  • Check PDF models are present (#1134)
  • Take into account logs preferences (#440)
  • Update a dynamic field now updates member's modification date (#1002)
  • GPG key field was too short (#1032)
  • Fix differences beetween MySQL and PostgreSQL schemas (#1072)
  • Clean data from 0.9RC (#1093)
  • Change email field size to suits standards (#1121)
  • Fix update issues
  • Fix contribution end date calculation (#1144)
  • Fix redirection after creating a new contribution (#1145)
  • Fix dynamic fields on transactions and contributions (#1146)
  • Fix static resources path on some configurations (#1152)
  • Admin information fields was emptied when a member was edited from a non admin account (#1154)
  • Fix required dynamic file fields updating member (#1160)
  • Fix security Checks generating PDF members cards (#1164)
  • Add expiration on RSS feed calls to prevent freezes (#989)

0.8.3.4 -> 0.9

Added

  • Use two steps removal everywhere; with a real confirmation required (not relying on a Javascript event)
  • Cascade removal on groups children
  • Change all URLs (#417), and translate them
  • Super admin can impersonate another account without its authentication information
  • Responsive display
  • Configure connection delay
  • Test mail parameters from preferences (#588)
  • Check for duplicates created using imports dry-run (#729)
  • Check statuses using imports dry-run (#999)
  • Preview attached files on mailing preview (#735)
  • Select all and reverse selection on top and bottom of list (#795)
  • Statuses are no longer uniques (#887)
  • Authenticate from email address (#919)
  • Handle reverse proxy on logs (#997 and #1029 - thanks to Georges R.!)
  • Autocomplete towns, zip codes, countries and birth places (#1005)
  • A behavior configuration file whith some examples has been added in config directory (#1011)
  • Warning message when application is configured to display errors (#1011)
  • Handle non secure SMTP connections (self-signed certificates, etc. #1020)
  • Minimum PHP version is now 5.6
  • It is possible to expose only a sub directory (webroot, whith limited contents) on the web server
  • Type free search fields (thanks to Guillaume R.!)
  • Improve access control on fields by adding new roles (thanks to Guillaume R.!)
  • Integrate AdminTools plugin (#1071)
  • Free search on status texts (#1061)
  • Improve fields management in free search (thanks to Guillaume R.!)
  • Script for extrernal statistics (#787)
  • Send telemetry information and registration :)

Fixed

  • Better PDF errors management (#249)
  • Add version number to sessions (#315)
  • Missing translation in messages headers (#673)
  • Members listed several times when searching on groups (final fix for #687)
  • Error on calculated late days in some cases (#902)
  • Parent group was lost when a group manager edit a group (#990)
  • Remove parent field from fields configuration (#1033)
  • Error sending reminder mail (#1046)

Under the hood...

  • Update third party libraries
  • Rely on Slim for URL management
  • Manage third party libraries with Composer
  • Use PSR2 coding standards (with PEAR comment rules)

Legacy versions

0.8.3.3 -> 0.8.3.4

  • Problème avec l'URL du formulaire adhérent en enregistrant les préférences (#1027)
  • Envoi d'images avec un nom composé d'un seul caractère (#1028)
  • Correction de la sauvegarde des emailings (#998)

0.8.3.2 -> 0.8.3.3

  • Correction du bug d'enregistrement (#996)
  • L'exension mcrypt n'est plus requise

0.8.3.1 -> 0.8.3.2

  • Correction d'un régréssion introduite dans la version précédente

0.8.3 -> 0.8.3.1

  • Corrections de bogues relatifs au mode strict de MySQL 5.7
  • Correction de l'adresse dans les PDF des fiches des membres

0.8.2.3 -> 0.8.3

Fixed
  • Améliorations sur la gestion des groupes (merci à Remi),
  • Validation des données sur les champs cachés (#958)
  • Corrections visuelles mineures
  • Désactivation du champ mot de passe (#957)
  • Pas d'ajout de contribution sur la création d'un adhérent exempt (#966)
  • Correction d'un problème MySQL survenant parfois sous Windows (#954)
  • Affichage des adhérents exempts actifs uniquement sur le spages publiques (#971)
  • Certains champs n'étaient pas marqués comme étant requis (#974)
  • Correction sur certains types de données dans la configuration des champs
Added
  • Fiche adhérent PDF modifiable via les modèles
  • Ajout d'une addresse multi-ligne pour les modèles PDF
  • Support des champs dynamiques dans les modèles PDF
  • Support RSS pour les news (#956)
  • Remplacement de chaînes dans les modèles PDF
  • Utilisation de l'adresse postale de la fiche parente si celle de l'adhérent n'est pas renseignée
  • Utilisation de l'adresse email de la fiche parent (suite et fin)
  • Modification des nom, prénom, genre et titre par l'adhérent lui même

0.8.2.2 -> 0.8.2.3

  • Compatibilité PHP 7 (#953)
  • Correction d'un problème de recherche avancée avec des champs dynamiques (#948)
  • Le module mbstring est requis (#943)
  • Empêcher les utilisateurs inactifs de se connecter (#941)

0.8.2.1 -> 0.8.2.2

  • Envoi de courriels à un membre attaché (#931)
  • La case à cocher « personne morale » était toujours décochée, provoquant l'effacement de la raison sociale (#929)
  • Problème avec les listes déroulantes sous Firefox (#933)

0.8.2 -> 0.8.2.1

  • Problème avec le champs "Autres infos (admin)"

0.8.1 -> 0.8.2

Note

Merci à Hélène de l'association Le Pic qui a subventionné cette version !

Fixed
  • Mots de passe de base de données contenant le caractère « $ » (entre autres)
  • Mise à jour des plugins
  • Génération des identifiants vides
  • Stockage des images des membres manquantes dans la base de données
  • Guillemets dans le script de mise à jour PostgreSQL
  • Suppression des caractères « : » dans les en-têtes des exports CSV
  • Exclusion des dons dans le calcul des dates de fin de cotisation
  • Import des sociétés depuis un fichier CSV
  • Soumission du formulaire de recherche avancée après sélection d'un groupe
Added
  • Formulaire adhérent dynamique et paramétrable
  • Attachement d'adhérents
  • Numéro adhérent
  • Suppression des anciens fichiers de log
  • Affichage des membres d'un groupe par nom d'adhérent
  • Suppression du support SQLite.
  • Export des groupes sélectionnés ainsi que leurs sous groupes
  • Utilisation du filtre courant pour naviguer entre les fiches adhérents
  • Ajout du mode maintenance
Under the hood...
  • Mise à jour des bilitohèques tierces
  • Ajout d'un paramètre pour régler les problèmes d'encodage sur certaines instances utilisant MySQL

0.8 -> 0.8.1

Note

Merci à Danielle qui a subventionné cette version !

  • Ajout des groupes de l'adhérent dans les modèles PDF,
  • Correction du nom de la table des champs dynamique de type liste,
  • Correction du bouton retour lors de l'ajout d'une contribution,
  • Un brin de nettoyage,
  • Correction de l'initialisation des catégories de champs,
  • Correction des champs dynamiques de type fichier,
  • Utilisation des traits PHP pour les ficheirs, images et imports CSV,
  • Les valeurs des champs dynamiques de type liste n'étaient pas affichées,
  • Correction de la détection de la classe SMTP pour l'envoi de courriels,
  • Suppression de l'entrée "Tous" dans les préférences pour le nombre d'enregistrements affichés,
  • Correction de champs dynamiques marqués répétables mais qui ne le sont pas,
  • Amélioration du thème, notamment pour les formulaires,
  • Correction de HTML invalide,
  • Correction de problèmes sur la page d'auto adhésion,
  • Ajout d'un flux RSS configurable.

0.7.8 -> 0.8

Note

Cette nouvelle version met fin au support des versions 0.7 de Galette, qui auront été fort utiles :-)

Fixed
  • Le champ "genre" ne pouvait être désactivé,
  • Suppression de la fonction SQL NOW() iconnue de SQLite,
  • Corrections cosmétiques,
  • Droits sur les champs dynamiques,
  • Courriels multiples envoyés pour relance,
  • Problème d'encodage de caractères lors de mises à jour depuis Galette 0.6x,
  • Message d'avertissements dans la fenêtre de recherche avancée.
Added
  • Refonte complète du système d'installation et de mise à jour,
  • Relocalisation des données dans un répertoire commun,
  • Actions combinées sur les membres pour les plugins,
  • Utilisation du logo dans les modèles PDF (merci à Guillaume R.),
  • Augmentation de la taille des étiquettes des status et des types de cotisations,
  • Choix de la date lors du filtrage des contributions,
  • Filtrage des transactions par date,
  • Compatibilité IPV6,
  • Changement du pictogramme des messages d'erreur (merci à Daniela D.),
  • Étiquettes ordonnées par noms et prénoms,
  • Possibilité de scinder ou non les versions texte des courriels par configuration,
  • Prévisualisation des courriels textes scindés,
  • Affichage des adresses courriel dans la liste publique des membres pour les adhérents connectés,
  • Textes de courriels pour les dons,
  • Date de naissance dans la recherche avancée,
  • Détection des types de fichiers si les fonctions relatives de PHP sont désactivées,
  • Possibilité de modifier la date de saisie d'une contribution,
  • Support de champs dynamiques de type fichier (merci à Guillaume R.),
  • Amélioration de la fenêtre de sélection des membres (utilisée dans les mailings, la gestion des groupes, le plugin auto, ...),
  • Suppression de groupes non vides.
Under the hood...

Quelques modifications, d'ordre un peu plus technique ont également été apportées :

  • Compatible PHP 5.4 et supérieurs,
  • Utilisation de Zend DB version 2 - en lieu et place de la version 1 - pour la gestion des bases de données.

0.7.7 -> 0.7.8

Note

Merci à Roland qui a subventionné cette version (ainsi que la mise à jour consécutive des plugins Maps et Paypal) !

  • Pages publiques pour les plugins (#635)
  • Ajout de la date de sortie des plugins (#544)
  • La ventilation de transactions en dons ne fonctionnait pas (#755)

0.7.6.1 -> 0.7.7

Note

Merci à l'association Club 404 qui a subventionné cette version ainsi que la première version officielle du plugin Auto :-)

  • Ajouts de pièces jointes aux mailings (#187)
  • Amélioration du système de génération de mots de passe et login aléatoires, pour éviter les doublons (#731)
  • Affichage d'un message explicatif lorsque l'on tente un import CSV avec un statut inexistant (#739)
  • Les données des graphiques n'avaient pas toujours le bon type (#742)
  • Correction des champs dynamiques des transactions (#745)
  • Correction d'un problème de date de création lors de l'import CSV

0.7.6 -> 0.7.6.1

  • Date de création d'un adhérent incorrecte (#741)
  • L'export CSV de la liste des adhérents résultait en un fichier vide (#732)
  • Le modèle d'import ne pouvait être modifé (#728)

0.7.5.5 -> 0.7.6

Note

Un très grand merci à Loïs Taulelle, qui a subventionné cette Galette 0.7.6 :-)

  • Imports CSV (#176)
  • Filtrage des non membres (#677)
  • PostgreSQL est désormais requis en version 9.1 au minimum (#693)
  • Suppression de la méthode de stockage des mots de passe pour les vieilles versions de PHP (#694)
  • Le décompte des jours n'est plus affiché pour les comptes désactivés (#716)
  • Correction d'une incohérence lors de la vérification de l'unicité des champs dynamiques (#642)
  • Un échec (voulu ou non) lors de la tentative de suppression d'un membre ne donnait pas lieu à un message dans l'interface (#680)
  • L'activation du bouton de création de la carte de membre se basait sur l'état des cotisations de l'adhérent connecté, et non celui consulté (#725)

0.7.5.4 -> 0.7.5.5

  • Le super administrateur ne pouvait plus modifier certains champs (#721)

0.7.5.3 -> 0.7.5.4

  • Restriction de l'affichage des dossiers tempimages et templates_c depuis le serveur web
  • Une contrainte en base Postgres qui n'éxistait pas était supprimée (#681)
  • Correction d'une anomalie sur le filtrage par groupe des responsables de groupes (#712)
  • Restriction des boutons de gestion des membres et responsables de groupes, ainsi que le bouton de création de nouveaux groupes aux administrateurs et membres du bureau (#709)
  • Correction de divers problèmes relatifs aux droits des responsables de groupes (#686, #499)
  • Correction d'une inversion causant un bogue dans les champs dynamiques
  • La résolution de l'anomalie #687 bloquait la liste des membres sous PostgreSQL et a été supprimée

0.7.5.2 -> 0.7.5.3

  • Le bouton d'ajout de membres ou de responsables à un groupe avait disparu (#707)
  • Un membre appartenant à plusieurs sous groupes d'un même parent était affiché plusieurs fois si l'on cherchait le groupe parent (#687)
  • Les responsables de groupes ne pouvaient éditer la fiche d'un membre (#686)
  • Les responsables de groupes ne pouvaient visualiser la photo d'un membre

0.7.5.1 -> 0.7.5.2

  • Correction d'un problème Javascript lors de l'ajout des champs dynamiques aux contributions ou aux transactions
  • Ajout du login au remplacement possibles dans les rappels
  • Correction de la license de deux fichiers utilisés par les traductions

0.7.5 -> 0.7.5.1

  • Correction d'una page blanche à l'export PDF des groupes (#676)
  • Correction du script de mise à jour MySQL (#678)
  • Correction du chemin de l'interpréteur dans le script de test post contribution
  • Typos
  • Le sujet des textes était trop court dans l'interface
  • Correction de notices PHP au lancement du script cron
  • Amélioration des données JSON du script post contribution (#682)
  • Correction du script d'installation SQLite

0.7.4.5 -> 0.7.5

Note

Un très grand merci à Debian France, qui a subventionné cette version 0.7.5 :-)

Fixed
  • Les tables vides étaient exportées, mais ne pouvaient pas être récupérées ou supprimées (#628)
  • Traduction manquante dans l'historique lors de la suppression de contributions (#644)
Added
  • Modèles de courriels de rappel d'échéance (#376)
  • Envoi automatique de courriels de rappel d'échéance de cotisation (#368)
  • Automatisation (via cron) des rappels d'échéance (#377)
  • Édition de factures et de reçus, avec possibilité de personnaliser les modèles (#394)
  • Appel d'un script après l'enregistrement d'une nouvelle contribution (pour un enregistrement en comptabilité par exemple - #490)
  • L'envoi de courriels comporte toujours un destinataire (pour éviter d'être bloqué par certains système de listes de diffusion par exemple - #595)
  • Ajout des montants et types de contribution sur les courriels automatiques (#620)
  • Ajout de champs dynamiques de type date (#191) - Merci à Guillaume R. !
  • Ajout de champs dynamiques de type booléen (#624) - Merci à Guillaume R. !
  • Possibilité de surcharger la feuille CSS d'impression (#634)
  • Suppression des nouvelles Twitter et Google+ sur le tableau de bord

0.7.4.4 -> 0.7.4.5

  • La suppression d'un adhérent se faisait sans confirmation (#638)
  • Mise à jour des biliothèques tierces dans leurs dernières versions

0.7.4.3 -> 0.7.4.4

  • Attribution de groupes impossible depuis la fiche adhérent (#625)
  • Amélioration de la feuille CSS pour l'impression (#631)
  • De multiples messages étaient affichés lorsque l'on cliquait sur le bouton supprimer sans avoir sélectionné d'adhérents (#627)
  • Désactivation de la carte adhérents pour les membres qui ne sont pas à jour de cotisation (#546)
  • Utilisation de la chaîne non traduite lors de l'édition des types de contributions (#630)

0.7.4.2 -> 0.7.4.3

  • Le type de contribution n'était pas correctement sélectionné dans la seconde étape (#618)
  • La recherche avancée dans plusieurs champs dynamiques de type choix provoquait une erreur (#619)
  • Vérification de l'existance de la langue lors du chargement de textes (#621)
  • Le contributions qui se chevauchent ne doivent pas être enregistrées (#622)

0.7.4.1 -> 0.7.4.2

  • Les titres, status, dates et genres apparaissent désormais en texte plutôt que par leurs identifiants (#611)
  • La pagination de la liste publique des membres était cassée (#603)
  • Correction d'un problème de recherche avancée sur les dates de fin de contribution (#601)

0.7.4 -> 0.7.4.1

  • Taille incorrecte du mot de passe temporaire (#587)
  • Correction d'une erreur HTML sur le sélecteur de date de fin de contribution dans l'interface de recherche avancée (#600)
  • La liste des adhérents pour les rappels n'était plus filtrée (#599)
  • L'export de la liste des membres filtrée se limite aux champs de la table des adhérents
  • Correction d'erreurs sur les exports CSV de la liste des membres sous MySQL
  • Implémentation d'une méthode moins sécurisée de stockage des mots de passe pour les vielles versions de PHP (#597)
  • Les titres dans la tables des adhérents doivent être optionnels (merci à Raphaël)
  • Les modules PHP requis et manquants n'étaient pas affichés (#598)
  • Vérification de la présence du module PHP mcrypt à l'installation (#596)
  • Vérification du support de la méthode de stockage du mot de passe à l'installation
  • L'Affichage de la requête après une recherche avancée ne fonctionnait que si l'on obtenait des résultats
  • Erreur SQL sur certaines recherches avancées (merci à Raphaël)
  • Correction de bogues mineurs HTML dans la page des préférences
  • Lors de la mise à jour d'une base existante, les adhérents ayant pour titre mademoiselle se retrouvaient du troisième sexe (#572)
  • Problèmes de booléens false sous PostgreSQL
  • Les mailings en cours n'étaient plus détectés (#591)
  • Modification du séparateur CSV par défaut (le défaut est désormais le point-virgule ; Excel n'aime pas les virgules apparemment...)
  • L'export CSV de la liste filtrée ne prenait pas compte du filtre (#584)
  • Le chemin de téléchargement suite à un export était incorrect (#589)
  • Ré-écriture des procédures de vérification et de réinitialisation de la configuration des champs (#577)
  • Suppression du bouton pour enlever les titres fixes (#570)
  • Type de colonne incorrect pour la visiblité des champs sous PostgreSQL (#577)
  • Certains champs étaient requis, mais désactivés (#571)
  • Problèmes SQL lors de l'installation sous MySQL (#575)
  • Les versions longues des titres étaient incorrectes sous MySQL (#569)

0.7.3.2 -> 0.7.4

Note

Un très grand merci de nouveau à Exsequenda, qui a de nouveau subventionné cette version :-)

Fixed
  • Suppression du statut non membre (#455)
  • Calcul de la date de fin d'adhésion erroné après suppression de toutes les contributions d'un membre (#515)
  • Suppression d'un adhérent impossible (#520)
  • Amélioration de l'interface de saisie des contributions si aucun adhérent n'existe (#534)
  • Les informations de l'utilisateur authentifié n'étaient pas accessibles pour les plugins (#449)
  • Les champs dynamiques n'étaient pas enregistrés lorsque l'adhérent d'inscrivait lui même (#539)
  • Le lien dans la courriel de perte de mot de passe utilisait invariablement le protocole HTTP (#557)
  • Récupération des champs requis lors de la mise à jour en 0.7.3 (#523)
Added
  • Gestion des civilités (subventionné - #174)
  • Recherche des adhérents via leurs contributions (subventionné - #498)
  • Export CSV de la liste des membres filtrée (subventionné - #501)
  • Support SQLite (#482)
  • Sécurité du stockage des mot de passe accrue (#487)
  • Suppression des exports générés (#271)
  • Possibilité d'utiliser séparément les nom et prénom de l'adhérent dans les textes des courriels (#312)
  • Navigation entre les fiches en mode édition (#456)
  • Tri des listes de contributions et de transactions par ordre chronologique inversé (#465)
  • Génération de graphiques (#157)
  • Liste PDF des adhérents par groupes (#484)
  • Affichage des informations sur le status des cotisations de l'adhérent (#545)

0.7.3.1 -> 0.7.3.2

  • Affichage des groupes gérés mais dont l'adhérent n'est pas membre (#480)
  • Le mot de passe était réinitialisé lors de la modification d'une fiche (#488)
  • Ajout du type de paiement à l'initialisation d'une contribution (#486)

0.7.3 -> 0.7.3.1

  • L'installation se bloque (#473)
  • L'image « captcha » ne s'affiche pas (#474)
  • Amélioration de la validation de la configuration des champs (#475)

0.7.2.9 -> 0.7.3

Note

Un très grand merci à Exsequenda, qui a subventionné cette version :-)

Fixed
  • Traduction des libellés des champs dynamiques (#398)
Added
  • Login et mot de passes peuvent être non requis (#303)
  • Paramétrage de la visibilité des champs (#369)
  • Recherche avancée (#370)
  • Les traductions dynamiques inexistantes sont désormais créées (#468)
  • Pagination des pages publiques (#460)
Under the hood...
  • Remplacement du logger (#415)

0.7.2.8 -> 0.7.2.9

  • Champs complémentaires des contributions non enregistrés et/ou non chargés (#396)
  • L'upload de fichiers avec une extension en majuscules générati des fichiers vides (#450)
  • Les photos des adhérents sont requises pour de la génération des cartes (#461)
  • Régénération de l'image depuis la base donnait parfois un fichier vide (#463)
  • Impossible d'enregistrer une fiche adhérent (entre autres), les définitions de champs étaient manquantes (#466)
  • Les rappels ne doivent pas inclure les comptes inactifs (#462)
  • Les liens des nouveaux exports étaient incorrects

0.7.2.7 -> 0.7.2.8

  • Diverses améliorations des performances lors de la récupération de listes de membres (#458)

0.7.2.6 -> 0.7.2.7

  • L'interface de gestion des groupes n'était pas accessible aux responsables (#404)
  • Différents problèmes se manifestaient avec la langue de l'adhérent (#451)
  • Correction d'un problème de log mineur

0.7.2.5 -> 0.7.2.6

  • Problème de sélection des membres dans un nouveau mailing (#442)
  • Impossible d'annuler le filtrage des transactions (#436)
  • Le code postal n'aparaissait pas sur les cartes de membres (#441)
  • Correction de diverses notices

0.7.2.4 -> 0.7.2.5

  • Compatibilité PostgreSQL 8.4 (#439)

0.7.2.3 -> 0.7.2.4

  • Erreur à l'intialisation des bases des plugins (#432)

0.7.2.1 -> 0.7.2.3

  • L'affichage de groupes vides causait des erreurs SQL (#437)
  • Impossible de lister les groupes sous Postgres 8.4 (#430)

0.7.2.1 -> 0.7.2.2

  • Le filtrage des groupes est désormais effectifs sur les enfants directs du groupe (#301)

0.7.2 -> 0.7.2.1

  • Les champs dynamiques de type zone de texte étaient répétés indéfiniment (#422)
  • Les champs dynamiques de type choix étaient répétés sous MySQL (#419, #422)

0.7.1 -> 0.7.2

Note

Un très grand merci à l'AFUL, qui a subventionné cette version :-)

Fixed
  • Erreur d'objet incomplet lors d'une mise à jour (#393)
  • Détection correcte du module PHP Curl à l'installation (#395)
Added
  • Amélioration de l'interface des champs complémentaires multiples (#289)
  • Présentation des champs dynamiques contenant une URL ou une adresse courriel sous forme d'hyperlien (#355)
  • Modification des tailles minimales des identifiants (désormais, respectivement 2 et 6 caractères pour le login et le mot de passe - #374)
  • Ajout d'un bouton au tableau de bord pour effectuer des relances facilement vers les adhértents en retard (#375)
Under the hood...
  • Passage en objet de la gestion des champs dynamiques (#194)

0.7 -> 0.7.1

Fixed
  • Problèmes lors de l'envoi de logo transparent ou de types non supportés (#164, #165),
  • Chemin parfois incorect dans les entrées de menu des plugins (#203),
  • Envoi de mailings via la fonction mail() de PHP (#215),
  • Le chemin de téléchargement des exports CSV était incorrect,
  • Les informations dans l'interface d'administration des plugins n'étaient pas remises à jour après l'activation ou la désactivation d'un plugin (#210),
  • Amélioration de la conversion texte automatique des mailings HTML (#218),
  • Correction de différents problèmes liés à l'internationnalisation des dates, notamment avec l'interface en anglais (#161),
  • Correction de problèmes aléatoires avec les images (photos et logos),
  • Suppression d'une certaine ambiguité lors de la demande d'un nouveau mot de passe (#252),
  • Modification de la taille de certains champs : les nom et prénom de l'adhérent peuvent désormais contenir 50 caractères, 200 pour la raison sociale, et 150 pour les descriptions de transactions (#263),
  • Les prénoms composés prenaient une majuscule sur la toute première lettre uniquement (#319).
Added
  • Filtrage de la liste des adhérents par groupe (#169),
  • Test de la présence des modules PHP requis et conseillés à l'installation (#172),
  • Refonte de l'affichage des pages d'installation (#235),
  • Vérification de la compatibilité des plugins (#241),
  • Limitation des différents rôles du bureau à une seule instance. Il n'est plus possible d'avoir deux présidents :) (#177),
  • Ajout de la description des transactions lors du rappel dans les contributions ; ainsi qu'un lien vers la transaction depuis la liste des contributions (#255, #256),
  • Affichage d'un message lorsqu'un mailing est déjà en cours pour le reprendre ou de l'annuler (#276),
  • Affichage de la raison sociale dans la liste des membres ; et recherche dans les raison sociales également lors d'une recherche sur le nom (#286),
  • Enregistrement des erreurs PHP dans les logs de Galette, pour pallier le manque d'informations sur les hébergements dédiés (#207),
  • Ajout d'une page d'informations système utiles lors de la déclaration de bogues (#257).
Under the hood...

Quelques modifications, d'ordre un peu plus technique ont également été apportées :

  • Implémentation d'un mode démo qui bloque certaines fonctionnalités (l'envoi de mails, certaines directives de configuration, ...) (#205),
  • Chargement dynamique des classes PHP à la demande (#206),
  • Réorganisation des classes métier et utilisation des espaces de nom PHP,
  • Mise à jour de phpMailer en version 5.2.1 (#216),
  • Remplacement de PEAR::Log par KLoger (modifié pour l'occasion) et suppression des bibliothèques PEAR qui ne sont plus utiles,
  • Passage à Smarty 3 (#238),
  • Compatibilité des différents fichiers .htaccess pour Apache 2.4.

0.64 -> 0.7

Added and changed
  • Refonte complète de l'interface,
  • Validation HTML 5 et CSS 3,
  • Nouvelle gestion de l'historique,
  • Gestion de mailings (avec historique),
  • Gestion de groupes,
  • Intégration d'un tableau de bord (avec affichage des dernières news du projet),
  • Pages publiques (liste des membres et trombinoscope),
  • Système de plugins (voir la liste des plugins disponibles),
  • Export au format CSV des tables de la base courante et/ou export de requêtes paramétrées (https://download.tuxfamily.org/galette/listes-galette/mail.gna.org/public/galette-devel/2009-02/msg00006.html),
  • Paramétrage des champs obligatoires pour l'enregistrement et la modification d'adhérents,
  • Gestion multilingue des sujets et messages des mails envoyés automatiquement par Galette (inscription, perte de mot de passe, ...),
  • Gestion des statuts utilisateur,
  • Gestion des types de contributions,
  • Refonte de la gestion des transactions,
  • Refonte de l'interface d'envoi d'e-mailings,
  • Intégration de JQuery UI pour améliorer l'interface (menus, onglets dans les préférences, date/color picker, ...),
  • Impression de cartes de membres,
  • ...
Removals
  • Suppression du support IE6 et IE7,
  • Suppression de l'espagnol (qui n'est plus maintenu :'( )
Under the hood...

Quelques modifications, d'ordre un peu plus technique ont également été apportées :

  • Compatible PHP 5.3 et supérieurs,
  • Ré-écriture de la presque totalité du code en POO,
  • Utilisation de la bibliothèque PEAR::LOG,
  • Utilisation de Zend DB pour la gestion des bases de données en lieu et place de AdoDB,
  • Utilisation de la bibliothèque phpMailer pour l'envoi des emails (support https, gmail, etc),
  • Mise en place de relations dans la base de données pour assurer l'intégrité référentielle.
Plugins

Quelques plugins sont dores et déjà disponibles pour Galette !

  • Auto : Gestion d'associations automobiles (gestion des véhicules et de l'historique des modifications).
  • Paypal : Gestion des différents montants de cotisation, formulaire de paiement ; à venir : ajout de la contribution dans la base Galette lorsque le paiement est validé par Paypal.
  • Fiche Adhérent : Génération au format PDF d'une fiche adhérent avec les principales informations pré-remplies.
  • TinyMCE : Éditeur HTML WYSIWYG complet en remplacement du plus simple éditeur fourni par défaut.
  • Sport (à venir) : Intégration des fonctionnalités supplémentaires existantes dans galette-sport

0.63.3 -> 0.64

  • Prise en charge de la fonction 'stripos' lorsqu'elle est manquante afin d'assurer le support php4 pour Galette 0.63.x
  • Mise à jour de Adodb en 4992
  • Mise à jour de Smarty en 2.6.22, remplacement des anciens hacks pour les traductions par un plus élégant plugin
  • Remplacement de la bibliothèque phppdflib par tcpdf
  • Suppression du lien symbolique adodb, on utilise maintenant un fichier php qui définit les versions des bibliothèques utilisées
  • Amélioration de la pagination : seules 20 pages apparaissent désormais, au lieu de l'intégralité
  • Suppression de l'espagnol qui n'est plus maintenu depuis longtemps
  • Utilisation de l'encodage UTF-8 pour les fichiers de traduction
  • Correction d'un bogue dans le calcul de la date de fin d'adhésion lors de l'utilisation d'une date de début d'exercice dans les préférences
  • Suppression des pages « publiques » qui ne sont ni fonctionnelles, ni utilisées
  • Suppression de fichiers inutilisés
  • Prise en charge de la fonction 'mb_strtoupper' lorsqu'elle est manquante pour éviter des erreurs lors de la génération des étiquettes si l'extension php mb n'est pas présente
  • Déplacement du fichier de configuration du dossier includes vers le dossier config. Les droits en écriture sur le dossier includes ne sont désormais plus requis à l'installation
  • Seul le super-administrateur peut désormais changer ses propres identifiant et mot de passe. Les administrateurs standards ne peuvent désormais plus faire cela

0.63.2 -> 0.63.3

  • Correction d'un problème de sécurité qui permettait à un tiers d'envoyer des fichiers PHP divers sur certains serveurs
  • Lorsque le formulaire d'adhésion était invalide, les lignes des champs dynamiques étaient répétées (bogue #10187)
  • Quelques problèmes d'encodage ont été remarqués sur certains serveurs MySQL en UTF-8. La connexion est désormais forcée en LATIN1 (merci à Cédric)
  • Des espaces insécables apparaissaient sur certains courriels non html (merci à Cédric)
  • L'utilisation de caractères XML dans le sujet d'un mailing causait des erreurs d'analyse XML sur la page de prévisualisation (bogue #14571)
  • Des informations inutiles étaient stockées dans les logs (et n'étaient pas au bon endroit) lors de l'envoi de courriels (bogue #14569)
  • Des erreurs d'analyse XML étaient rencontrées sur les pages de l'historique quand la carte de membre contenait des caractères réservés (bogue #14561)
  • Les balises html lors de la prévisualisation de mailings ne s'affichaient pas sous Firefox (bogue #14465)

0.63.1 -> 0.63.2

  • La fin de l'adhésion était incorrecte pour une année fiscale (bogue #13010)
  • Les donation n'apparaissaient pas avec la bonne couleur dans le tableau (bogue #13009)
  • Les entrées de l'historique ne comprenaient pas le login de l'adhérent lors de l'ajout ou de l'édition des contributions ou de la fiche adhérent (bogue #13011)
  • Sous windows, certains caractères n'étaient pas correctement interprétés (bogue #14162)
  • Lors de la sauvegarde d'une photo (au format PNG), le canal alpha n'était pas conservé, l'image prenait ainsi une couleur de fond par défaut (bogue #14327)
  • Les restrictions d'affichage des images (depuis la 0.63.1) empêchaient l'affichage du logo personnalisé (bogue #14442)
  • Lorsque l'on modifiait la langue d'un utilisateur, la langue de la session était changée également (bogue #14443)
  • Certains caractères - comme les guillemets simples - étaient mal encodés dans les sujets des mailings (bogue #14449)
  • L'envoi de mails était toujours actif, même s'il était désactivé dans les préférences (bogue #14450)

0.63 -> 0.63.1

  • Certaines préférences n'étaient pas mises à jour lors de l'installation
  • Sur certains services d'hébergement, les fonctions exif ne sont pas disponibles. Dans ce cas, on utilise désormais GD (bogue #12836)
  • Le XHTML était parfois mal formé à cause des sessions PHP (bogue #13071)
  • Correction de notices PHP dans l'historique (patch #1133)
  • Suppression des fonctions posix qui sont supprimées dans PHP 5.3
  • Ajout d'un fichier .htaccess pour empêcher l'affichage direct des photos envoyées

0.62 -> 0.63

  • Project leader has changed :-)
  • Add transactions management
  • Add dynamic fields, to add extra fields to members, as well as their label translation
  • Members can now self subscribe
  • Use Smarty templating system to generate pages. This causes the rewriting of all pages to XHTML
  • Update ADODB from 4.7.1 to 4.9.2
  • Use gettext capabilities for translations
  • Add spanih translation (all strings are not yet translated)
  • Capacity to use a custom logo
  • Fix of numerous bugs

0.62.1 -> 0.62.2

0.62 -> 0.62.1

  • correct bug #590 : date before 1970 [Frédéric Jacquot]
  • Typos fixed [Roland Telle]
  • replace logo by new one [Frédéric Jacquot]
  • add an empty config.inc.php [Loïs Taulelle]

0.61 -> 0.62

  • More documentation
  • Typos fixed
  • Recoded the html_entity_decode() function to preserve compatibility with pre-4.3 PHP
  • Defined a maxsize for the text fields (preferences)
  • First version of the Upgrade documentation using a Linux shell (in French)
  • Font size for table headers defined
  • "Update complete" string translated
  • Errors on DROP and RENAME operations can now be safely be ignored
  • Structure of the 'preferences' table enhanced
  • Font size defined for form labels
  • Bugfix concerning a call to imagegif when the function wasn't available (reported by Vincent Bossuet)
  • Fixed a bug reported by Lois Taulelle. Membership ending date wasn't updated when removing the "Freed of dues" attribute
  • Added the possibility to be visible or not in the members list (if you wan't to list members outside from Galette). Courtesy of Stephane Sales
  • Removed many PHP warnings (Galette should be running fine when error_reporting = E_ALL)
  • The log can now be sorted

0.60 -> 0.61

  • Bugfix in member edition form (admin)
  • Merged ajouter_adherent.php and gestion_contributions.php (member edition)
  • Table prefixes are now allowed
  • Removed all eval() functions (potentially dangerous)
  • Picture resizing if GD is available
  • HTML equivalents in members' names were badly displayed
  • Go back to the member's contributions after adding one
  • "1 days left" was not correct ;)
  • Date filter added in contribution listing
  • Correction of a few spelling mistake
  • Navigation links when on a member's contributions list added
  • Clicking on a member's name in the contributions list shows his contributions intead of his profile
  • Lost password recovery added
  • Removed the Galette acronym meaning
  • Header corrections
  • Better language file detection
  • Bugfix in thumbnail display
  • DROP permission wasn't checked during install process
  • English translation

Plugins migration 0.8 => 0.9

Plugin system in Galette 0.9 is incompatible with previous versions. This does not means that you must rewrite your plugin completely, but you will have to do some adaptations.

Generalities

Of course, you have to refer to the plugins development guide for all details.

Several Galette core objects has been modified to remove some globals. This is now mandatory to send them those information, like:

<?php
//old call
$obj = new \Galette\Core\Object();
//new call - $this->zdb is accessible from routes
$obj = new \Galette\Core\Object($this->zdb);

We've based our examples on the ObjectsLend plugin, you can refer to the related commit (`326b52f4) <https://git.tuxfamily.org/galette/plugin-objectslend.git/commit/?h=develop&id=326b52f486c6dccd5896d9db13e3a074d3896b19>`_.

_define.php

Two new parameters has been added:

  • a name, used for the routing and translation domains, a single string to add beetween Galette compatibility version and plugin date,
  • limited access URLs list (when $authenticate middleware is used) configuration, in an array at the end of the existing configuration.

A define.php file for Galette 0.8:

<?php
$this->register(
    'Galette Objects Lend',             //Name
    'Manage rent/lend of object',       //Short description
    'Mélissa Djebel, Johan Cwiklinski', //Author
    '0.5-alpha',                        //Version
    '0.8.0',                            //Galette version compatibility
    '2017-01-21',                       //Date
    null //Permissions needed - not yet implemented
);

After being updated to Galette 0.9, the file will look like:

<?php
$this->register(
    'Galette Objects Lend',             //Name
    'Manage rent/lend of object',       //Short description
    'Mélissa Djebel, Johan Cwiklinski', //Author
    '0.5-alpha',                        //Version
    '0.8.0',                            //Galette version compatibility
    'objectslend',                      //routing name and translation domain
    '2017-01-21',                       //Date
    [   //Permissions needed - not yet implemented
        'routename'      => 'acl',
        'anotherroute'   => 'anotheracl'
    ]
);

Routes ACLs are handled while plugin development.

_config.php

It was advised to create a variable to prefix display template, this is no longer needed.

_routes.php

This file is now the core of your plugin. All old PHP files that was directly called in URL in older versions will now be dispatched in several routes (one per PHP file, or not).

As an example, take the preferences.php page of our plugin. The source code for the 0.8 version was:

<?php
use Galette\Entity\ContributionsTypes;
use GaletteObjectsLend\Preferences;

define('GALETTE_BASE_PATH', '../../');
require_once GALETTE_BASE_PATH . 'includes/galette.inc.php';
if (!$login->isLogged() || !$login->isAdmin()) {
    header('location: ' . GALETTE_BASE_PATH . 'index.php');
    die();
}

require_once '_config.inc.php';

$lendsprefs = new Preferences($zdb);

if (isset($_POST['saveprefs'])) {
    unset($_POST['saveprefs']);
    if ($lendsprefs->store($_POST, $error_detected)) {
        $success_detected[] = _T("Preferences have been successfully stored!");
    }
}

$tpl->assign('page_title', _T("ObjectsLend preferences"));

$ctypes = new ContributionsTypes();
$tpl->assign('ctypes', $ctypes->getList());
$tpl->assign('lendsprefs', $lendsprefs->getpreferences());

//Set the path to the current plugin's templates,
//but backup main Galette's template path before
$orig_template_path = $tpl->template_dir;
$tpl->template_dir = 'templates/' . $preferences->pref_theme;

//display success and error messages
$tpl->assign('error_detected', $error_detected);
$tpl->assign('success_detected', $success_detected);

$content = $tpl->fetch('preferences.tpl', LEND_SMARTY_PREFIX);
$tpl->assign('content', $content);
//Set path to main Galette's template
$tpl->template_dir = $orig_template_path;
$tpl->display('page.tpl', LEND_SMARTY_PREFIX);

This page was providing both display and storage of the preferences of the plugin. We will replace this behavior with two distinct routes: one with HTTP GET method that will handle display and another one with HTTP POST method to handle the storage. In our _routes.php file, we will have:

<?php
use Galette\Entity\ContributionsTypes;
use GaletteObjectsLend\Preferences;

//Constants and classes from plugin
require_once $module['root'] . '/_config.inc.php';

$this->get(
    __('/preferences', 'routes'),
    function ($request, $response, $args) use ($module, $module_id) {
        if ($this->session->objectslend_preferences !== null) {
            $lendsprefs = $this->session->objectslend_preferences;
            $this->session->objectslend_preferences = null;
        } else {
            $lendsprefs = new Preferences($this->zdb);
        }

        $ctypes = new ContributionsTypes($this->zdb);

        $params = [
            'page_title'    => _T('ObjectsLend preferences', 'objectslend'),
            'ctypes'        => $ctypes->getList(),
            'lendsprefs'    => $lendsprefs->getpreferences()
        ];

        // display page
        $this->view->render(
            $response,
            'file:[' . $module['route'] . ']preferences.tpl',
            $params
        );
        return $response;
    }
)->setName('objectslend_preferences')->add($authenticate);

$this->post(
    __('/preferences', 'routes'),
    function ($request, $response, $args) use ($module, $module_id) {
        $post = $request->getParsedBody();
        $lendsprefs = new Preferences($thiszdb);

        $error_detected = [];
        if ($lendsprefs->store($pos, $error_detected)) {
            $this->flash->addMessage(
                'success_detected',
                _T("Preferences have been successfully stored!", "objectslend")
            );
        } else {
            //store object in session to keep entered values in case of error
            $this->session->objectslend_preferences = $lendsprefs;
            foreach ($error_detected as $error) {
                $this->flash->addMessage(
                    'error_detected',
                    $error
                );
            }
        }

        return $response
            ->withStatus(301)
            ->withHeader(
                'Location',
                $this->router->pathFor('objectslend_preferences')
            );
    }
)->setName('store_objectlend_preferences')->add($authenticate);

You can observe that the two routes URLs are the same, but with HTTP methods (an of course routes names!) that differs. For the needs of our plugin, access will be restricted to administratore. We have already setted up the middleware call in the previous example, we now need to add those new routes to the ACLs configuration of _define.php:

<?php
//[...]
    [   //Permissions needed - not yet implemented
        'objectslend_preferences'        => 'admin',
        'store_objectlend_preferences'   => 'admin'
    ]

All treatments from preferences.php file has been moved, we can now remove the file.

templates/default/menu.tpl

Since our plugin preferences page URL has changed, we need to adapt menu.tpl:

<li{if $PAGENAME eq "preferences.php"} class="selected"{/if}>
    <a href="{$galette_base_path}{$lend_dir}preferences.php">{_T string="Preferences"}</a>
</li>
<li{if $cur_route eq "objectslend_preferences"} class="selected"{/if}>
    <a href="{path_for name="objectslend_preferences"}">{_T string="Preferences" domain="objectslend"}</a>
</li>

There are three changes here:

  • PHP file call has been replaced with a call to the route,
  • selection class condition must be changed, this could no longer rely on file name,
  • translation domain has been used for translatable strings, it is not striclty mandatory if you use Galette core strings verbatim (which should have been the case here).

Web resources

All resources that must be accessible from browsers must be handled specifically. You have to move all of them in the webroot directory of the plugin:

$ mkdir webroot
$ git move includes/featherlight-1.7.0 webroot
$ git move templates/default/galette_lend.css webroot
$ git move templates/default/lend.js webroot
$ git move templates/default/images webroot

Then, you have to change paths to those files. As an example, see the header.tpl file, which looks like the following in 0.8:

<link rel="stylesheet" type="text/css" href="{$galette_base_path}{$lend_tpl_dir}galette_lend.css" media="screen"/>
{if isset($olendsprefs) && $olendsprefs->showFullsize()}
<link rel="stylesheet" type="text/css" href="{$galette_base_path}{$lendc_dir}featherlight-1.7.0/featherlight.min.css" media="screen"/>
<script type="text/javascript" src="{$galette_base_path}{$lendc_dir}featherlight-1.7.0/featherlight.min.js"></script>
{/if}
<script type="text/javascript" src="{$galette_base_path}{$lend_tpl_dir}lend.js"></script>

That will become in 0.9:

<link rel="stylesheet" type="text/css" href="{path_for name="plugin_res" data=["plugin" => $module_id, "path" => "galette_lend.css"]}" media="screen"/>
{if isset($olendsprefs) && $olendsprefs->showFullsize()}
<link rel="stylesheet" type="text/css" href="{path_for name="plugin_res" data=["plugin" => $module_id, "path" => "featherlight-1.7.O/featherlight.min.css"]}" media="screen"/>
<script type="text/javascript" src="{path_for name="plugin_res" data=["plugin" => $module_id, "path" => "featherlight-1.7.O/featherlight.min.js"]}"></script>
{/if}
<script type="text/javascript" src="{path_for name="plugin_res" data=["plugin" => $module_id, "path" => "lend.js"]}"></script>

Note

Directory names of resources does not matter, their paths are conditionned by the plugin unique id ($module_id).

Template files

Smarty templates files must declare their heritage, that was previousely done in PHP calls.

For all templates file in the plugin, you need at least to add {block name="content"} and {/block} around the whole content and add heritage instruction. Javascript calls must be moved together into the optionnal javascript block.

To follow our example, the preferences.tpl file of the plugin must be changed as follows:

{extends file="page.tpl"}
{block name="content"}
    <form action="{path_for name="store_objectlend_preferences"}" method="post">
       <!-- contenu -->
    </form>
{/block}

Note

The form action has also been changed to suit defined routes.

Langs

Locales in Galette now rely on translation domains. Makefile and xgettext.py must be updated, just copy them from an up to date official plugin.

Makefile must be adapted to declare langs and used domains:

LANGUAGES = en_US fr_FR.utf8
DOMAINS = objectslend

Existing files must be renamed to fit langs and domains, PHP files are no longer used, you may remove them:

$ git mv messages.po objectslend.pot
$ git mv en_US.po objectslend_en_US.po
$ git mv fr_FR.utf8.po objectslend_fr_FR.utf8.po
$ git mv en_US/LC_MESSAGES/galette_objectslend.mo en_US/LC_MESSAGES/objectslend.mo
$ git mv fr_FR.utf8/LC_MESSAGES/galette_objectslend.mo fr_FR.utf8/LC_MESSAGES/objectslend.mo
$ git rm lang_french.php
$ git rm lang_english.php

And finally, you will have to add the domain when needed in your code. It is certainly possible to use a script to do it at once, but that was not needed for this plugin.

About Galette

The Galette project is kindly hosted by TuxFamily:

There are also a few external services:

Galette documentation is released under the terms of the Attribution-ShareAlike 3.0 Unported license, written using reStructuredText and built with Sphinx documentation builder.

Sphinx allows to build documentation in various formats from the same sources. Galette's documentation is therefore available as HTML, PDF and EPUB formats; thanks to Read the docs.