use Galette\Controllers\GaletteController;
use Galette\Controllers\Crud;
use Galette\Controllers\PdfController;
-use Galette\Repository\Contributions;
-use Galette\Entity\Transaction;
-use Galette\Repository\Transactions;
-use Galette\Repository\Members;
-use Galette\Entity\Adherent;
-use Galette\Entity\ContributionsTypes;
-use Galette\Core\GaletteMail;
-use Galette\Repository\PaymentTypes;
+use Galette\Entity\Contribution;
$app->get(
'/{type:transactions|contributions}[/{option:page|order|member}/{value:\d+|all}]',
)->setName('payments_filter')->add($authenticate);
$app->get(
- '/contribution/{type:fee|donation}/add',
+ '/contribution/{type:' . Contribution::TYPE_FEE . '|' . Contribution::TYPE_DONATION . '}/add',
[Crud\ContributionsController::class, 'add']
)->setName('addContribution')->add($authenticate);
$app->get(
- '/contribution/{type:fee|donation}/edit/{id:\d+}',
+ '/contribution/{type:' . Contribution::TYPE_FEE . '|' . Contribution::TYPE_DONATION . '}/edit/{id:\d+}',
[Crud\ContributionsController::class, 'edit']
)->setName('editContribution')->add($authenticate);
$app->post(
- '/contribution/{type:fee|donation}/add',
+ '/contribution/{type:' . Contribution::TYPE_FEE . '|' . Contribution::TYPE_DONATION . '}/add',
[Crud\ContributionsController::class, 'doAdd']
)->setName('doAddContribution')->add($authenticate);
$app->post(
- '/contribution/{type:fee|donation}/edit/{id:\d+}',
+ '/contribution/{type:' . Contribution::TYPE_FEE . '|' . Contribution::TYPE_DONATION . '}/edit/{id:\d+}',
[Crud\ContributionsController::class, 'doEdit']
)->setName('doEditContribution')->add($authenticate);
use Galette\Controllers\Crud;
use Galette\Controllers\PdfController;
-use Galette\Entity\Adherent;
-use Galette\Entity\Group;
-use Galette\Repository\Groups;
-use Galette\Repository\Members;
$app->get(
'/groups[/{id:\d+}]',
use Galette\Controllers\CsvController;
use Galette\Controllers\AdminToolsController;
use Galette\Controllers\TextController;
-use Galette\DynamicFields\DynamicField;
-use Galette\Repository\Members;
-use Galette\IO\News;
-use Analog\Analog;
-use Galette\IO\Csv;
-use Galette\IO\CsvOut;
-use Galette\IO\CsvIn;
-use Galette\Entity\Title;
-use Galette\Repository\Titles;
-use Galette\Core\Install;
-use Galette\Entity\Status;
//galette's dashboard
$app->get(
use Galette\Controllers\CsvController;
use Galette\Controllers\GaletteController;
use Galette\Controllers\PdfController;
-use Analog\Analog;
-use Galette\Core\Password;
-use Galette\Repository\Members;
-use Galette\Filters\MembersList;
-use Galette\Repository\Groups;
-use Galette\Repository\Reminders;
use Galette\Entity\Adherent;
-use Galette\Entity\Status;
-use Galette\Repository\Titles;
-use Galette\Entity\Group;
-use Galette\IO\File;
use Galette\Middleware\MembersNavigate;
//self subscription
*/
use Galette\Controllers\Crud;
-use Galette\Repository\Members;
-use Galette\Filters\MembersList;
$showPublicPages = function ($request, $response, $next) use ($container) {
$login = $container->get('login');
): Response {
// contribution types
$ct = new ContributionsTypes($this->zdb);
- $contributions_types = $ct->getList($type === 'fee');
+ $contributions_types = $ct->getList($type === Contribution::TYPE_FEE);
// template variable declaration
$title = null;
- if ($type === 'fee') {
+ if ($type === Contribution::TYPE_FEE) {
$title = _T("Membership fee");
} else {
$title = _T("Donation");
}
$ext_membership = '';
- if ($contrib->isCotis() || !isset($contrib) && $type === 'fee') {
+ if ($contrib->isFee() || !isset($contrib) && $type === Contribution::TYPE_FEE) {
$ext_membership = $this->preferences->pref_membership_ext;
}
$params['pref_membership_ext'] = $ext_membership;
$get = $request->getQueryParams();
$ct = new ContributionsTypes($this->zdb);
- $contributions_types = $ct->getList($type === 'fee');
+ $contributions_types = $ct->getList($type === Contribution::TYPE_FEE);
$cparams = ['type' => array_keys($contributions_types)[0]];
/**
* Add action
*
- * @param Request $request PSR Request
- * @param Response $response PSR Response
- * @param string $type Contribution type
+ * @param Request $request PSR Request
+ * @param Response $response PSR Response
+ * @param string|null $type Contribution type
*
* @return Response
*/
// contribution types
$ct = new ContributionsTypes($this->zdb);
- $contributions_types = $ct->getList($type === 'fee');
+ $contributions_types = $ct->getList($type === Contribution::TYPE_FEE);
// display page
$this->view->render(
/**
* Filtering
*
- * @param Request $request PSR Request
- * @param Response $response PSR Response
- * @param string $type Contribution type
+ * @param Request $request PSR Request
+ * @param Response $response PSR Response
+ * @param string|null $type Contribution type
*
* @return Response
*/
/**
* Edit page
*
- * @param Request $request PSR Request
- * @param Response $response PSR Response
- * @param int $id Contribution id
- * @param string $type Contribution type
+ * @param Request $request PSR Request
+ * @param Response $response PSR Response
+ * @param int $id Contribution id
+ * @param string|null $type Contribution type
*
* @return Response
*/
/**
* Edit action
*
- * @param Request $request PSR Request
- * @param Response $response PSR Response
- * @param integer $id Contribution id
- * @param string $type Contribution type
+ * @param Request $request PSR Request
+ * @param Response $response PSR Response
+ * @param integer $id Contribution id
+ * @param string|null $type Contribution type
*
* @return Response
*/
}
$error_detected = [];
- $redirect_url = null;
if ($this->session->contribution !== null) {
$contrib = $this->session->contribution;
$error_detected = array_merge($error_detected, $valid);
}
+ //all goes well, we can proceed
if (count($error_detected) == 0) {
- //all goes well, we can proceed
- if (count($error_detected) == 0) {
- // send email to member
- if (isset($post['mail_confirm']) && $post['mail_confirm'] == '1') {
- $contrib->setSendmail(); //flag to send creation email
- }
+ // send email to member
+ if (isset($post['mail_confirm']) && $post['mail_confirm'] == '1') {
+ $contrib->setSendmail(); //flag to send creation email
+ }
- $store = $contrib->store();
- if ($store === true) {
- $this->flash->addMessage(
- 'success_detected',
- _T('Contribution has been successfully stored')
- );
- } else {
- //something went wrong :'(
- $error_detected[] = _T("An error occurred while storing the contribution.");
- }
+ $store = $contrib->store();
+ if ($store === true) {
+ $this->flash->addMessage(
+ 'success_detected',
+ _T('Contribution has been successfully stored')
+ );
+ } else {
+ //something went wrong :'(
+ $error_detected[] = _T("An error occurred while storing the contribution.");
}
}
if (count($this->errors) > 0) {
Analog::log(
- 'Some errors has been throwed attempting to edit/store a member' . "\n" .
+ 'Some errors has been thew attempting to edit/store a member' . "\n" .
print_r($this->errors, true),
Analog::ERROR
);
if (count($this->errors) > 0) {
Analog::log(
- 'Some errors has been throwed attempting to edit/store a member files' . "\n" .
+ 'Some errors has been thew attempting to edit/store a member files' . "\n" .
print_r($this->errors, true),
Analog::ERROR
);
/**
* Contribution class for galette
+ * Manage membership fees and donations.
*
* PHP version 5
*
/**
* Contribution class for galette
+ * Manage membership fees and donations.
*
* @category Entity
* @name Contribution
public const TABLE = 'cotisations';
public const PK = 'id_cotis';
+ public const TYPE_FEE = 'fee';
+ public const TYPE_DONATION = 'donation';
+
private $_id;
private $_date;
private $_member;
* @param Login $login Login instance
* @param null|int|ResultSet $args Either a ResultSet row to load
* a specific contribution, or an type id
- * to just instanciate object
+ * to just instantiate object
*/
public function __construct(Db $zdb, Login $login, $args = null)
{
* Fields configuration. Each field is an array and must reflect:
* array(
* (string)label,
- * (string) propname
+ * (string) property name
* )
*
* I'd prefer a static private variable for this...
),
'date_debut_cotis' => array(
'label' => _T("Date of contribution:"),
- 'cotlabel' => _T("Start date of membership:"), //if contribution is a cotisation, label differs
+ 'cotlabel' => _T("Start date of membership:"), //if contribution is a membership fee, label differs
'propname' => 'begin_date'
),
'date_fin_cotis' => array(
$this->_amount = $this->_transaction->getMissingAmount();
}
$this->type = (int)$args['type'];
- //calculate begin date for cotisation
+ //calculate begin date for membership fee
$this->_begin_date = $this->_date;
if ($this->_is_cotis) {
$curend = self::getDueDate($this->zdb, $this->_member);
/**
* Loads a contribution from its id
*
- * @param int $id the identifiant for the contribution to load
+ * @param int $id the identifier for the contribution to load
*
* @return bool true if query succeed, false otherwise
*/
$this->_id = (int)$r->$pk;
$this->_date = $r->date_enreg;
$this->_amount = $r->montant_cotis;
- //save original amount, we need it for transactions parts calulations
+ //save original amount, we need it for transactions parts calculations
$this->_orig_amount = $r->montant_cotis;
$this->_payment_type = $r->type_paiement_cotis;
$this->_info = $r->info_cotis;
$enddate = $r->date_fin_cotis;
//do not work with knows bad dates...
//the one with BC comes from 0.63/pgsl demo... Why the hell a so
- //strange date? dont know :(
+ //strange date? don't know :(
if (
$enddate !== '0000-00-00'
&& $enddate !== '1901-01-01'
$fields = array_keys($this->_fields);
foreach ($fields as $key) {
- //first of all, let's sanitize values
+ //first, let's sanitize values
$key = strtolower($key);
$prop = '_' . $this->_fields[$key]['propname'];
}
}
- if ($this->isCotis() && count($this->errors) == 0) {
+ if ($this->isFee() && count($this->errors) == 0) {
$overlap = $this->checkOverlap();
if ($overlap !== true) {
if ($overlap === false) {
- $this->errors[] = _T("An error occurred checking overlaping fees :(");
+ $this->errors[] = _T("An error occurred checking overlapping fees :(");
} else {
//method directly return error message
$this->errors[] = $overlap;
if (count($this->errors) > 0) {
Analog::log(
- 'Some errors has been throwed attempting to edit/store a contribution' .
+ 'Some errors has been threw attempting to edit/store a contribution' .
print_r($this->errors, true),
Analog::ERROR
);
return true;
} catch (Throwable $e) {
Analog::log(
- 'An error occurred checking overlaping fee. ' . $e->getMessage(),
+ 'An error occurred checking overlapping fee. ' . $e->getMessage(),
Analog::ERROR
);
return false;
}
//no end date, let's take database defaults
- if (!$this->isCotis() && !$this->_end_date) {
+ if (!$this->isFee() && !$this->_end_date) {
unset($values['date_fin_cotis']);
}
$event = 'contribution.edit';
}
//update deadline
- if ($this->isCotis()) {
+ if ($this->isFee()) {
$deadline = $this->updateDeadline();
if ($deadline !== true) {
- //if something went wrong, we rollback transaction
+ //if something went wrong, we roll back transaction
throw new \Exception('An error occurred updating member\'s deadline');
}
}
public function getFieldLabel($field)
{
$label = $this->_fields[$field]['label'];
- if ($this->isCotis() && $field == 'date_debut_cotis') {
+ if ($this->isFee() && $field == 'date_debut_cotis') {
$label = $this->_fields[$field]['cotlabel'];
}
//replace " "
}
/**
- * Is current contribution a cotisation
+ * Is current contribution a membership fee
*
* @return boolean
*/
- public function isCotis()
+ public function isFee()
{
return $this->_is_cotis;
}
*/
public function getRawType()
{
- if ($this->isCotis()) {
+ if ($this->isFee()) {
return 'membership';
} else {
return 'donation';
*/
public function getTypeLabel()
{
- if ($this->isCotis()) {
+ if ($this->isFee()) {
return _T("Membership");
} else {
return _T("Donation");
/**
* Global getter method
*
- * @param string $name name of the property we want to retrive
+ * @param string $name name of the property we want to retrieve
*
* @return false|object the called property
*/
switch ($name) {
case 'is_cotis':
- return $this->isCotis();
+ return $this->isFee();
break;
default:
throw new \RuntimeException("Call to __get for '$name' is forbidden!");
if ($this->_is_cotis === null) {
return null;
}
- return ($this->isCotis()) ?
+ return ($this->isFee()) ?
PdfModel::INVOICE_MODEL : PdfModel::RECEIPT_MODEL;
break;
default:
if (count($this->errors) > 0) {
Analog::log(
- 'Some errors has been throwed attempting to edit/store a contribution files' . "\n" .
+ 'Some errors has been threw attempting to edit/store a contribution files' . "\n" .
print_r($this->errors, true),
Analog::ERROR
);
*/
public function getRequired(): array
{
- // required fields
- $required = [
+ return [
'id_type_cotis' => 1,
'id_adh' => 1,
'date_enreg' => 1,
'date_debut_cotis' => 1,
- 'date_fin_cotis' => $this->isCotis(),
- 'montant_cotis' => $this->isCotis() ? 1 : 0
+ 'date_fin_cotis' => $this->isFee(),
+ 'montant_cotis' => $this->isFee() ? 1 : 0
];
- return $required;
}
}
public static $fields;
protected static $defaults;
+ /** @var string|false */
protected $order_field = false;
private $id;
* Get list in an array built as:
* $array[id] = "translated label"
*
- * @param boolean $extent Filter on (non) cotisations types
+ * @param boolean|null $extent Filter on (non) cotisations types
*
* @return array|false
*/
- public function getList($extent = null)
+ public function getList(bool $extent = null)
{
$list = array();
/**
* Complete list
*
- * @return array of all objects if succeed, false otherwise
+ * @return array of all objects if succeeded, false otherwise
*/
public function getCompleteList()
{
if (count($this->errors) > 0) {
Analog::log(
- 'Some errors has been throwed attempting to edit/store a transaction' .
+ 'Some errors has been thew attempting to edit/store a transaction' .
print_r($this->errors, true),
Analog::DEBUG
);
if (count($this->errors) > 0) {
Analog::log(
- 'Some errors has been throwed attempting to edit/store a transaction files' . "\n" .
+ 'Some errors has been thew attempting to edit/store a transaction files' . "\n" .
print_r($this->errors, true),
Analog::ERROR
);
->setContribution($contrib);
$text = 'contrib';
- if (!$contrib->isCotis()) {
+ if (!$contrib->isFee()) {
$text = 'donation';
}
$mtxt = $texts->getTexts($text, $member->language);
// Sent email to admin if pref checked
// Get email text in database
$text = 'newcont';
- if (!$contrib->isCotis()) {
+ if (!$contrib->isFee()) {
$text = 'newdonation';
}
$texts->getTexts($text, $this->preferences->pref_lang);
}
/**
- * Set member and calculate personal informations to blacklist
+ * Set member and calculate personal information to blacklist
*
* @param Adherent $adh Adherent instance
*
<p>{_T string="NB : The mandatory fields are in"} <span class="required">{_T string="red"}</span></p>
<fieldset class="cssform">
<legend class="ui-state-active ui-corner-top">
- {if $type eq "fee"}
+ {if $type eq constant('Galette\Entity\Contribution::TYPE_FEE')}
{_T string="Select contributor and membership fee type"}
{else}
{_T string="Select contributor and donation type"}
{/if}
{if $contribution->isTransactionPart() && $contribution->transaction->getMissingAmount() > 0}
<a
- href="{path_for name="addContribution" data=["type" => "fee"]}?trans_id={$contribution->transaction->id}"
+ href="{path_for name="addContribution" data=["type" => constant('Galette\Entity\Contribution::TYPE_FEE')]}?trans_id={$contribution->transaction->id}"
class="button fright tooltip"
title="{_T string="Create a new fee that will be attached to the current transaction"}">
<i class="fas fa-user-check"></i>
{html_options options=$type_cotis_options selected=$selectedid}
</select>
</p>
- {if $type eq "fee"}
+ {if $type eq constant('Galette\Entity\Contribution::TYPE_FEE')}
<noscript>
<div class="button-container" id="reloadcont">
<input type="submit" id="btnreload" name="btnreload" value="{_T string="Reload"}" title="{_T string="Reload date information according to selected member and contribution type"}"/>
</fieldset>
<fieldset class="cssform">
- <legend class="ui-state-active ui-corner-top">{if $type eq "fee"}{_T string="Details of membership fee"}{else}{_T string="Details of donation"}{/if}</legend>
+ <legend class="ui-state-active ui-corner-top">{if $type eq constant('Galette\Entity\Contribution::TYPE_FEE')}{_T string="Details of membership fee"}{else}{_T string="Details of donation"}{/if}</legend>
<p>
<label class="bline" for="montant_cotis">{_T string="Amount:"}</label>
<input type="text" name="montant_cotis" id="montant_cotis" value="{$contribution->amount}" maxlength="10"{if isset($required.montant_cotis) && ($required.montant_cotis eq 1)} required="required"{/if}/>
<p>
<label class="bline" for="date_debut_cotis">
- {if $type eq "fee"}
+ {if $type eq constant('Galette\Entity\Contribution::TYPE_FEE')}
{_T string="Start date of membership:"}
{else}
{_T string="Date of contribution:"}
<input class="past-date-pick" type="text" name="date_debut_cotis" id="date_debut_cotis" value="{$contribution->begin_date}" maxlength="10"{if isset($required.date_debut_cotis) && ($required.date_debut_cotis eq 1)} required="required"{/if}/>
<span class="exemple">{_T string="(yyyy-mm-dd format)"}</span>
</p>
- {if $type eq "fee"}
+ {if $type eq constant('Galette\Entity\Contribution::TYPE_FEE')}
<p>
{if $preferences->pref_membership_ext != ""}
<label class="bline" for="duree_mois_cotis">{_T string="Membership extension:"}</label>
<p>
<span class="bline tooltip" title="{_T string="Select a contribution type to create for dispatch transaction"}">{_T string="Dispatch type:"}</span>
<span class="tip">{_T string="Select a contribution type to create for dispatch transaction"}</span>
- <input type="radio" name="contrib_type" id="contrib_type_fee" value="fee" checked="checked"/> <label for="contrib_type_fee">{_T string="Membership fee"}</label>
+ <input type="radio" name="contrib_type" id="contrib_type_fee" value="{constant('Galette\Entity\Contribution::TYPE_FEE')}" checked="checked"/> <label for="contrib_type_fee">{_T string="Membership fee"}</label>
<input type="radio" name="contrib_type" id="contrib_type_donation" value="donation"/> <label for="contrib_type_donation">{_T string="Donation"}</label>
</p>
</fieldset>
buttonText: '<i class="far fa-calendar-alt"></i> <span class="sr-only">{_T string="Select a date" escape="js"}</span>'
});
- {if $type eq "fee" and !$contribution->id}
+ {if $type eq constant('Galette\Entity\Contribution::TYPE_FEE') and !$contribution->id}
$('#id_adh, #id_type_cotis').on('change', function() {
var _this = $(this);
var _member = $('#id_adh').val();
<p>
<span class="bline tooltip" title="{_T string="Select a contribution type to create for dispatch transaction"}">{_T string="Dispatch type:"}</span>
<span class="tip">{_T string="Select a contribution type to create for dispatch transaction"}</span>
- <input type="radio" name="contrib_type" id="contrib_type_fee" value="fee" checked="checked"/> <label for="contrib_type_fee">{_T string="Membership fee"}</label>
- <input type="radio" name="contrib_type" id="contrib_type_donation" value="donation"/> <label for="contrib_type_donation">{_T string="Donation"}</label>
+ <input type="radio" name="contrib_type" id="contrib_type_fee" value="{constant('Galette\Entity\Contribution::TYPE_FEE')}" checked="checked"/> <label for="contrib_type_fee">{_T string="Membership fee"}</label>
+ <input type="radio" name="contrib_type" id="contrib_type_donation" value="{constant('Galette\Entity\Contribution::TYPE_DONATION')}"/> <label for="contrib_type_donation">{_T string="Donation"}</label>
</p>
{/if}
</fieldset>
{_T string="Attached contributions"}
{if $transaction->getMissingAmount() > 0}
<a
- href="{path_for name="addContribution" data=["type" => "fee"]}?trans_id={$transaction->id}"
+ href="{path_for name="addContribution" data=["type" => constant('Galette\Entity\Contribution::TYPE_FEE')]}?trans_id={$transaction->id}"
class="button fright tooltip"
>
<i class="fas fa-user-check"></i>
<span class="sr-only">{_T string="Create a new fee that will be attached to the current transaction"}</span>
</a>
<a
- href="{path_for name="addContribution" data=["type" => "donation"]}?trans_id={$transaction->id}"
+ href="{path_for name="addContribution" data=["type" => constant('Galette\Entity\Contribution::TYPE_DONATION')]}?trans_id={$transaction->id}"
class="button fright tooltip"
>
<i class="fas fa-gift"></i>
{/if}
{if $login->isAdmin()}
<a id="prefs" href="{path_for name="preferences"}" title="{_T string="Set applications preferences (address, website, member's cards configuration, ...)"}">{_T string="Settings"}</a>
- <a id="plugins" href="{path_for name="plugins"}" title="{_T string="Informations about available plugins"}">{_T string="Plugins"}</a>
+ <a id="plugins" href="{path_for name="plugins"}" title="{_T string="Information about available plugins"}">{_T string="Plugins"}</a>
{* Include plugins user dashboard *}
{$plugins->getDashboard($tpl)}
{/if}
{if not $member->isActive() } ({_T string="Inactive"}){/if}
{if $login->isAdmin() or $login->isStaff()}
(<a href="{path_for name="member" data=["id" => $member->id]}">{_T string="See member profile"}</a> -
- <a href="{path_for name="addContribution" data=["type" => "fee"]}?id_adh={$member->id}">{_T string="Add a membership fee"}</a> -
- <a href="{path_for name="addContribution" data=["type" => "donation"]}?id_adh={$member->id}">{_T string="Add a donation"}</a>)
+ <a href="{path_for name="addContribution" data=["type" => constant('Galette\Entity\Contribution::TYPE_FEE')]}?id_adh={$member->id}">{_T string="Add a membership fee"}</a> -
+ <a href="{path_for name="addContribution" data=["type" => constant('Galette\Entity\Contribution::TYPE_DONATION')]}?id_adh={$member->id}">{_T string="Add a donation"}</a>)
{/if}
-
{/if}
{foreach from=$list item=contribution key=ordre}
{assign var="mid" value=$contribution->member}
{assign var="cclass" value=$contribution->getRowClass()}
- {if $contribution->isCotis()}
- {assign var="ctype" value="fee"}
+ {if $contribution->isFee()}
+ {assign var="ctype" value=constant('Galette\Entity\Contribution::TYPE_FEE')}
{else}
- {assign var="ctype" value="donation"}
+ {assign var="ctype" value=constant('Galette\Entity\Contribution::TYPE_DONATION')}
{/if}
<tr{if $mode eq 'ajax'} class="contribution_row" id="row_{$contribution->id}"{/if}>
<form class="tabbed" action="{path_for name="doEditGroup" data=["id" => $group->getId()]}" method="post" enctype="multipart/form-data" id="group_form">
<div id="group">
<ul>
- <li><a href="#group_information">{_T string="Informations"}</a></li>
+ <li><a href="#group_information">{_T string="Information"}</a></li>
<li><a href="#group_managers">{_T string="Managers"}</a></li>
<li><a href="#group_members">{_T string="Members"}</a></li>
</ul>
<fieldset class="cssform" id="group_information">
- <legend >{_T string="Informations"}</legend>
+ <legend >{_T string="Information"}</legend>
<div>
{if $group->getId() }
<p>
</th>
{/if}
<th class="left">
- {_T string="Informations"}
+ {_T string="Information"}
</th>
</tr>
</thead>
{if $login->isLogged()}
<td class="{$member->getRowClass(true)} nowrap" data-title="{_T string="Email"}"><a href="mailto:{$member->email}">{$member->email}</a></td>
{/if}
- <td class="{$member->getRowClass(true)} nowrap" data-title="{_T string="Informations"}">{$member->others_infos}</td>
+ <td class="{$member->getRowClass(true)} nowrap" data-title="{_T string="Information"}">{$member->others_infos}</td>
</tr>
{/foreach}
</tbody>
<li{if $cur_route eq "contributions" and $cur_subroute eq "contributions"} class="selected"{/if}><a href="{path_for name="contributions" data=["type" => "contributions"]}" title="{_T string="View and filter contributions"}">{_T string="List of contributions"}</a></li>
<li{if $cur_route eq "contributions" and $cur_subroute eq "transactions"} class="selected"{/if}><a href="{path_for name="contributions" data=["type" => "transactions"]}" title="{_T string="View and filter transactions"}">{_T string="List of transactions"}</a></li>
<li{if $cur_route eq "editMember" or $cur_route eq "addMember"} class="selected"{/if}><a href="{path_for name="addMember"}" title="{_T string="Add new member in database"}">{_T string="Add a member"}</a></li>
- <li{if $cur_route eq "addContribution" and $cur_subroute eq "fee"} class="selected"{/if}><a href="{path_for name="addContribution" data=["type" => "fee"]}" title="{_T string="Add new membership fee in database"}">{_T string="Add a membership fee"}</a></li>
- <li{if $cur_route eq "addContribution" and $cur_subroute eq "donation"} class="selected"{/if}><a href="{path_for name="addContribution" data=["type" => "donation"]}" title="{_T string="Add new donation in database"}">{_T string="Add a donation"}</a></li>
+ <li{if $cur_route eq "addContribution" and $cur_subroute eq constant('Galette\Entity\Contribution::TYPE_FEE')} class="selected"{/if}><a href="{path_for name="addContribution" data=["type" => constant('Galette\Entity\Contribution::TYPE_FEE')]}" title="{_T string="Add new membership fee in database"}">{_T string="Add a membership fee"}</a></li>
+ <li{if $cur_route eq "addContribution" and $cur_subroute eq constant('Galette\Entity\Contribution::TYPE_DONATION')} class="selected"{/if}><a href="{path_for name="addContribution" data=["type" => constant('Galette\Entity\Contribution::TYPE_DONATION')]}" title="{_T string="Add new donation in database"}">{_T string="Add a donation"}</a></li>
<li{if $cur_route eq "addTransaction" or $cur_route eq "editTransaction"} class="selected"{/if}><a href="{path_for name="addTransaction"}" title="{_T string="Add new transaction in database"}">{_T string="Add a transaction"}</a></li>
<li{if $cur_route eq "reminders"} class="selected"{/if}><a href="{path_for name="reminders"}" title="{_T string="Send reminders to late members"}">{_T string="Reminders"}</a></li>
<li{if $cur_route eq "history"} class="selected"{/if}><a href="{path_for name="history"}" title="{_T string="View application's logs"}">{_T string="Logs"}</a></li>
<h1 class="nojs">{_T string="Configuration"}</h1>
<ul>
<li{if $cur_route eq "preferences"} class="selected"{/if}><a href="{path_for name="preferences"}" title="{_T string="Set applications preferences (address, website, member's cards configuration, ...)"}">{_T string="Settings"}</a></li>
- <li{if $cur_route eq "plugins"} class="selected"{/if}><a href="{path_for name="plugins"}" title="{_T string="Informations about available plugins"}">{_T string="Plugins"}</a></li>
+ <li{if $cur_route eq "plugins"} class="selected"{/if}><a href="{path_for name="plugins"}" title="{_T string="Information about available plugins"}">{_T string="Plugins"}</a></li>
<li{if $cur_route eq "configureListFields"} class="selected"{/if}><a href="{path_for name="configureListFields" data=["table" => "adherents"]}" title="{_T string="Customize lists fields and order"}">{_T string="Core lists"}</a></li>
<li{if $cur_route eq "configureCoreFields"} class="selected"{/if}><a href="{path_for name="configureCoreFields"}" title="{_T string="Customize fields order, set which are required, and for who they're visibles"}">{_T string="Core fields"}</a></li>
<li{if $cur_route eq "configureDynamicFields" or $cur_route eq 'editDynamicField' or $cur_route eq 'addDynamicField'} class="selected"{/if}><a href="{path_for name="configureDynamicFields"}" title="{_T string="Manage additional fields for various forms"}">{_T string="Dynamic fields"}</a></li>
</li>
<li>
<a
- href="{path_for name="addContribution" data=["type" => "fee"]}?id_adh={$member->id}"
+ href="{path_for name="addContribution" data=["type" => constant('Galette\Entity\Contribution::TYPE_FEE')]}?id_adh={$member->id}"
class="button bigbutton tooltip"
>
<i class="fas fa-user-check fa-fw fa-2x"></i>
</li>
<li>
<a
- href="{path_for name="addContribution" data=["type" => "donation"]}?id_adh={$member->id}"
+ href="{path_for name="addContribution" data=["type" => constant('Galette\Entity\Contribution::TYPE_DONATION')]}?id_adh={$member->id}"
class="button bigbutton tooltip"
>
<i class="fas fa-gift fa-fw fa-2x"></i>
{
$contrib = $this->contrib;
$this->variable($contrib->id)->isNull();
- $this->variable($contrib->isCotis())->isNull();
+ $this->variable($contrib->isFee())->isNull();
$this->variable($contrib->is_cotis)->isNull();
$this->variable($contrib->date)->isNull();
$this->variable($contrib->begin_date)->isNull();