GPT logo

The administration Panel

The administration panel is the main screen of the administration part of GPT. To access to it, you must

  1. have sufficient privileges (admin rights for this election)
  2. be currently authentified on GPT
  3. point your browser to http://domain.org/gpt/admin/ (assuming this is the URL where you installed GPT).

Then, you will get the following screen. Please note that if you are not currently authenticated, you must authenticate a the startup screen of GPT.

Administration panel of GPT

Populate GPT with existing Data

So, you have a running instance of GPT. You may want to populate with existing data without resorting to manually creating everything. This is where the bulk import is useful.

Generalities

To import data, you just need a CSV file with existing data. This may be an extract of a database or data gathered in a spreadsheet. At the moment, there are four CSV importer implemented in GPT,

  1. party import
  2. Constituency import
  3. candidate import
  4. local authority import

In all four cases, the procedure is the same:

  • click on the relevant link to begin the import
  • type in a CSV separator (if blank, a comma will be used)
  • specify if fields are enclosed with double-quotes
  • select a CSV file
  • click on the validation button to upload your file
  • in the next screen, associate each column to a field. Please note that all mandatory fields have to be set or an error will be triggered. Also, do NOT associate a field to two columns, or bad juju will happen.

Party import

Party import is straightforward, only two fields are available:

  • party name
  • party acronym

Local authority import

Local authority allows you to set several fields:

  • name : name of the local authority. Could be the region or city name, for instance.
  • number : administrative number of the local authority. For instance, in France all départements are numbered from 1 to 98(8). Please note that this is not necessarily strictly speaking a number, a combination of number and letters is possible.
  • numerical ID : internal database ID to use for this entry. Don't use it unless you have a pretty good reason and you know what you are doing (i.e. migrating from a previous installation of GPT and wanting to keep the same numerical ID for the same local authorities).
  • type : a string representing the local authority. Could be something like "Region", "City", "Department", etc..
  • parent : the name or number of the parent local authority. For instance, if you are importing cities and want to link them to the parent departments, make sure that you have already imported the departments first and that their numbers or names match.

Constituency import

To be documented.

Candidate import

A candidate is constituted of several mandatory fields :

  • name: candidate family name
  • firstname: candidate first name
  • party: party name (or acronym). If no party can be found, it will be created
  • constituency: name of the constituency the candidate depends of. If none can be found, it will be created.

And some optional fields as well:

  • civility: should be M, Mrs or Ms depending on the civility of the candidate
  • occupation: profession of the candidate
  • phone : phone of the candidate
  • fax : fax of the candidate
  • web site : website of the candidate, preferably his campaign website
  • address : address to write to the candidate
  • zip code : zip code to write to the candidate
  • city : city where to write to the candidate, not necessarily his constituency

Managing privileges

GPT uses a privilege system to define who has which rights.  The basic idea of a distributed system like GPT is that users request privileges on various "objects" (like candidates, constituencies, etc.) via GPT and administrators can accept or reject applications.  Administrators can also manually set privileges via the admin panel without moderation.

It is important to bear in mind that GPT cascades its privilege system, so that if a user has a responsibility on a constituency, it has in fact a local authority on ALL children constituencies or local authorities and eventually candidates depending on them.  Make sure you give privileges to the good persons.

A privilege is constituted of the following components:

  • volunteer : the volunteer to which this privilege apply
  • type : type of the privilege.  Could be one of:
    • admin : privilege on everything.  That means, access to all information and to the administration panel
    • local authority : volunteer will be able to submit and approve candidates on all children constituencies of this local authority
    • constituency : volunteer will be able to submit and approve candidates depending of this constituency
    • candidate : volunteer can modify any information on the candidate
  • object : depending on the privilege type, can be a local authority, a constituency, a candidate
  • validation : true if this privilege been confirmed by an admin

Managing data

Managing constituencies

Constituencies can be managed via the administration panel.  It is possible to create, link and delete constuencies.  Click on the Manage Constituencies link and you will obtain the following list :


The following field is mandatory:

  • name : name of the constituency

The following fields are optional :

  • zip code : zip code
  • number : constituency number, used in some elections, like in the French parliament elections
  • depends on : parent local authority  Of course, you need to have created local authorities first.

The following fields are not used yet but are planned for a future use, so if you plan on using GPT for the coming elections, these can be useful :

  • total population : total population of the constituency, will be used for statistical purposes
  • latitude : latitude, used to draw the constituency on a map
  • longitude : longitude, used to draw the constituency on a map

Managing local authorities


They are managed pretty much like constituencies.  The following fields are mandatory :

  • name : name of the local authority

The following fields are optional :

  • number : local authority number, used in some countries
  • type : can be Region, Departement, Community of cities, City.  If you need more, ask us or hack the code
  • depends on : parent local authority  Of course, this will be empty for the first local authority you create.  Pay attention not to create infinite loops!
  • comments : additional comments on the local autority

Managing parties

Managing parties is pretty straightforward, there are only two fields associated to a party :

  • name : full name of the party
  • acronym : acronym if any

Managing candidates

Adding candidates is not implemented in the admin interface as there is a form to do that in the "user" interface.  Please refer to the GPT User Guide as a reference.

Using additional fields

GPT offers you the possibility to define additional fields so that it is very easy to add your custom fields to a candidate entry.  So, if you need to record, say, the fact that the candidate signed a previous version of the pact in a previous campaign, you could add a yes/no field on its entry.  Or if you want to record, say, a global note on how friendly this candidate is to Free Software, just add a number from 1 to 10.


To manage additional fields, click on the Additional candidates fields in the administrative interface.  Then, click on New additional field and configure it.  The following parameters are possible :

  • name : name of the field.  It can only be constituted of letters, digits and underscores.  If you use underscores, they will be converted to spaces in the candidate edition forms.  For example, this can be : candidate_favourable_to_free_software and it will be displayed as Candidate favourable to free software

  • type : type of the additional field.  Just choose how you want it to be stored in the database.  Note that if you choose integer and you type in letters in the candidate form after that, value will be 0

  • default : default value if not value has been specified when a candidate is created

  • mandatory : if set, it is mandatory to use this field.

Customizing GPT

Customizing mails

GPT sends mails to volunteers to notify them of various actions.  Here are the four different mails it sends:

  1. new-password-request.tpl : mail sent to a volunteer when she asks for a new password (i.e. he forgot its password) ;

  2. responsability-demand.tpl : mail sent to a responsible when a volunteer asks for a responsibility in her jurisdiction ;
  3. responsibility-ack.tpl : mail sent to a volunteer when her responsibility request has been accepted by a responsible ;

  4. subscription-ack.tpl : mail sent to a volunteer just after she register to GPT.  This mail contains an activation key in order to validate the user account.

All of these mails are translatable using the standard procedure in the GPT Translation Guide.  They can be customized too.  To change them, just go to the templates/mail subdirectory and modify the mails accordingly.  These templates are processed by the smarty engine so it is conceivably possible to insert conditionals, loops and  the like, People interested in customizing the mails and inserting other GPT variables than the standard ones in the default templates should browse the PHP source of GPT and particularly the mail.php source file.

Customizing the theme

Customizing the theme is simple.  You just have to modify the header and footer pages in teh  templates/smarty/common subdirectory.  The header is contained in the header.tpl file and the footer in the footer.tpl file.  Just open them in a text editor and modify them at your needs.

The template engine that is used is Smarty.  So you may want to use it to do some "programing" in your templates.  Also, there are several Smarty variables that are defined by GPT.  To insert the content of a variable in the header or footer, just use the following syntax : {$var} (assuming the variable name is var).  Here is the list of defined variables:

  • isadmin : set to 1 if currently logged user is a global administrator
  • second_tour : set to 1 is the election has a second ballot and this ballot is currently in engaged
  • notice : a notification message (header.tpl is charged of displaying it)
  • warning : a warning message (header.tpl is charged of displaying it)
  • error : an error message (header.tpl is charged of displaying it)
  • language : currently used language (two letters code)
  • langs : an array containing all possible languages
  • base_url : base URL for GPT
  • election : election ID
  • election_name : election name (can be translated)
  • nom_circonscription : constituency name (can be translated)
  • subdir : set to admin if the currently viewed page is in the admin subdirectory

These are set only for the homepage :

  • responsabilites : an array of responsibilities requests (see default template for reference)
  • responsabilites_a_valider : an array of responsibilities requests to validate (if responsible of them, see default template for reference)
  • limit : number of recent modifications to display
  • modifications : an array representing recent modifications (see default template for reference)
  • candidats_a_valider :an array of candidates to validate (if responsible of them, see default template for reference)
  • signataires : an array of signatories
  • additional : additional stuff, see default template for reference

Customizing the front page

You can customize the few text lines on the front page just after the controls.  To do that, just edit the templates/smarty/common/headline.tpl file and put whatever you think is relevant.  The following variables are defined :

  • nb_elus : number of elected candidates (should be non null only after election)
  • nb_elus_signataires : number of elected candidates that are signatories
  • nb_volontaires : number of volunteers
  • signataires : number of signatories