From 71a04d2b2f4913d1abe60b32794f3e43e97c49e8 Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Thu, 30 Sep 2021 08:41:08 +0200 Subject: [PATCH] Small rework and few typo fixes Add constants for contribution types and use them Rename Contribution::isCotis() to Contribution::isFee() phpdoc Fix information is uncountable; fix conjugation Fix several typos Cleanup imports --- .../includes/routes/contributions.routes.php | 17 ++--- galette/includes/routes/groups.routes.php | 4 -- galette/includes/routes/management.routes.php | 11 --- galette/includes/routes/members.routes.php | 10 --- .../includes/routes/public_pages.routes.php | 2 - .../Crud/ContributionsController.php | 69 +++++++++---------- galette/lib/Galette/Entity/Adherent.php | 4 +- galette/lib/Galette/Entity/Contribution.php | 61 ++++++++-------- galette/lib/Galette/Entity/Entitled.php | 7 +- galette/lib/Galette/Entity/Transaction.php | 4 +- .../lib/Galette/Events/ContribListener.php | 4 +- galette/lib/Galette/Util/Password.php | 2 +- .../default/ajouter_contribution.tpl | 16 ++--- .../templates/default/ajouter_transaction.tpl | 8 +-- galette/templates/default/desktop.tpl | 2 +- .../default/gestion_contributions.tpl | 10 +-- galette/templates/default/group.tpl | 4 +- galette/templates/default/liste_membres.tpl | 4 +- galette/templates/default/page.tpl | 6 +- galette/templates/default/voir_adherent.tpl | 4 +- .../Entity/tests/units/Contribution.php | 2 +- 21 files changed, 109 insertions(+), 142 deletions(-) diff --git a/galette/includes/routes/contributions.routes.php b/galette/includes/routes/contributions.routes.php index eab836cc0..a0e82ee12 100644 --- a/galette/includes/routes/contributions.routes.php +++ b/galette/includes/routes/contributions.routes.php @@ -37,14 +37,7 @@ 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}]', @@ -57,22 +50,22 @@ $app->post( )->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); diff --git a/galette/includes/routes/groups.routes.php b/galette/includes/routes/groups.routes.php index 0839caff7..485eaca9d 100644 --- a/galette/includes/routes/groups.routes.php +++ b/galette/includes/routes/groups.routes.php @@ -36,10 +36,6 @@ 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+}]', diff --git a/galette/includes/routes/management.routes.php b/galette/includes/routes/management.routes.php index 98e220989..74161d603 100644 --- a/galette/includes/routes/management.routes.php +++ b/galette/includes/routes/management.routes.php @@ -43,17 +43,6 @@ use Galette\Controllers\PdfController; 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( diff --git a/galette/includes/routes/members.routes.php b/galette/includes/routes/members.routes.php index 4553030a9..d6c5e7b40 100644 --- a/galette/includes/routes/members.routes.php +++ b/galette/includes/routes/members.routes.php @@ -38,17 +38,7 @@ use Galette\Controllers\Crud; 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 diff --git a/galette/includes/routes/public_pages.routes.php b/galette/includes/routes/public_pages.routes.php index d58d8c207..c15552a2c 100644 --- a/galette/includes/routes/public_pages.routes.php +++ b/galette/includes/routes/public_pages.routes.php @@ -35,8 +35,6 @@ */ use Galette\Controllers\Crud; -use Galette\Repository\Members; -use Galette\Filters\MembersList; $showPublicPages = function ($request, $response, $next) use ($container) { $login = $container->get('login'); diff --git a/galette/lib/Galette/Controllers/Crud/ContributionsController.php b/galette/lib/Galette/Controllers/Crud/ContributionsController.php index fc7d0303e..b9ca44f43 100644 --- a/galette/lib/Galette/Controllers/Crud/ContributionsController.php +++ b/galette/lib/Galette/Controllers/Crud/ContributionsController.php @@ -85,11 +85,11 @@ class ContributionsController extends CrudController ): 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"); @@ -129,7 +129,7 @@ class ContributionsController extends CrudController } $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; @@ -162,7 +162,7 @@ class ContributionsController extends CrudController $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]]; @@ -197,9 +197,9 @@ class ContributionsController extends CrudController /** * 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 */ @@ -266,7 +266,7 @@ class ContributionsController extends CrudController // 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( @@ -484,9 +484,9 @@ class ContributionsController extends CrudController /** * 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 */ @@ -580,10 +580,10 @@ class ContributionsController extends CrudController /** * 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 */ @@ -619,10 +619,10 @@ class ContributionsController extends CrudController /** * 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 */ @@ -664,7 +664,6 @@ class ContributionsController extends CrudController } $error_detected = []; - $redirect_url = null; if ($this->session->contribution !== null) { $contrib = $this->session->contribution; @@ -685,24 +684,22 @@ class ContributionsController extends CrudController $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."); } } diff --git a/galette/lib/Galette/Entity/Adherent.php b/galette/lib/Galette/Entity/Adherent.php index 8e5b5cdc3..72fae4feb 100644 --- a/galette/lib/Galette/Entity/Adherent.php +++ b/galette/lib/Galette/Entity/Adherent.php @@ -1165,7 +1165,7 @@ class Adherent 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 ); @@ -1949,7 +1949,7 @@ class Adherent 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 ); diff --git a/galette/lib/Galette/Entity/Contribution.php b/galette/lib/Galette/Entity/Contribution.php index aa7a433f3..3c65644b5 100644 --- a/galette/lib/Galette/Entity/Contribution.php +++ b/galette/lib/Galette/Entity/Contribution.php @@ -4,6 +4,7 @@ /** * Contribution class for galette + * Manage membership fees and donations. * * PHP version 5 * @@ -47,6 +48,7 @@ use Galette\Repository\PaymentTypes; /** * Contribution class for galette + * Manage membership fees and donations. * * @category Entity * @name Contribution @@ -64,6 +66,9 @@ class 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; @@ -95,7 +100,7 @@ class Contribution * @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) { @@ -106,7 +111,7 @@ class Contribution * 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... @@ -143,7 +148,7 @@ class Contribution ), '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( @@ -176,7 +181,7 @@ class Contribution $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); @@ -255,7 +260,7 @@ class Contribution /** * 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 */ @@ -302,7 +307,7 @@ class Contribution $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; @@ -310,7 +315,7 @@ class Contribution $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' @@ -347,7 +352,7 @@ class Contribution $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']; @@ -475,11 +480,11 @@ class Contribution } } - 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; @@ -491,7 +496,7 @@ class Contribution 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 ); @@ -546,7 +551,7 @@ class Contribution 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; @@ -591,7 +596,7 @@ class Contribution } //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']); } @@ -646,10 +651,10 @@ class Contribution $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'); } } @@ -766,7 +771,7 @@ class Contribution 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 " " @@ -923,11 +928,11 @@ class Contribution } /** - * Is current contribution a cotisation + * Is current contribution a membership fee * * @return boolean */ - public function isCotis() + public function isFee() { return $this->_is_cotis; } @@ -1056,7 +1061,7 @@ class Contribution */ public function getRawType() { - if ($this->isCotis()) { + if ($this->isFee()) { return 'membership'; } else { return 'donation'; @@ -1070,7 +1075,7 @@ class Contribution */ public function getTypeLabel() { - if ($this->isCotis()) { + if ($this->isFee()) { return _T("Membership"); } else { return _T("Donation"); @@ -1095,7 +1100,7 @@ class Contribution /** * 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 */ @@ -1117,7 +1122,7 @@ class Contribution switch ($name) { case 'is_cotis': - return $this->isCotis(); + return $this->isFee(); break; default: throw new \RuntimeException("Call to __get for '$name' is forbidden!"); @@ -1187,7 +1192,7 @@ class Contribution if ($this->_is_cotis === null) { return null; } - return ($this->isCotis()) ? + return ($this->isFee()) ? PdfModel::INVOICE_MODEL : PdfModel::RECEIPT_MODEL; break; default: @@ -1356,7 +1361,7 @@ class Contribution 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 ); @@ -1373,15 +1378,13 @@ class Contribution */ 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; } } diff --git a/galette/lib/Galette/Entity/Entitled.php b/galette/lib/Galette/Entity/Entitled.php index f8f991587..c9cf560e1 100644 --- a/galette/lib/Galette/Entity/Entitled.php +++ b/galette/lib/Galette/Entity/Entitled.php @@ -74,6 +74,7 @@ abstract class Entitled public static $fields; protected static $defaults; + /** @var string|false */ protected $order_field = false; private $id; @@ -225,11 +226,11 @@ abstract class Entitled * 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(); @@ -277,7 +278,7 @@ abstract class Entitled /** * Complete list * - * @return array of all objects if succeed, false otherwise + * @return array of all objects if succeeded, false otherwise */ public function getCompleteList() { diff --git a/galette/lib/Galette/Entity/Transaction.php b/galette/lib/Galette/Entity/Transaction.php index 496abf443..a9199b7c4 100644 --- a/galette/lib/Galette/Entity/Transaction.php +++ b/galette/lib/Galette/Entity/Transaction.php @@ -351,7 +351,7 @@ class Transaction 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 ); @@ -621,7 +621,7 @@ class Transaction 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 ); diff --git a/galette/lib/Galette/Events/ContribListener.php b/galette/lib/Galette/Events/ContribListener.php index fa603b361..b2f53cbe8 100644 --- a/galette/lib/Galette/Events/ContribListener.php +++ b/galette/lib/Galette/Events/ContribListener.php @@ -188,7 +188,7 @@ class ContribListener implements ListenerProviderInterface ->setContribution($contrib); $text = 'contrib'; - if (!$contrib->isCotis()) { + if (!$contrib->isFee()) { $text = 'donation'; } $mtxt = $texts->getTexts($text, $member->language); @@ -282,7 +282,7 @@ class ContribListener implements ListenerProviderInterface // 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); diff --git a/galette/lib/Galette/Util/Password.php b/galette/lib/Galette/Util/Password.php index 995cbeac1..20f62e31f 100644 --- a/galette/lib/Galette/Util/Password.php +++ b/galette/lib/Galette/Util/Password.php @@ -241,7 +241,7 @@ class Password } /** - * Set member and calculate personal informations to blacklist + * Set member and calculate personal information to blacklist * * @param Adherent $adh Adherent instance * diff --git a/galette/templates/default/ajouter_contribution.tpl b/galette/templates/default/ajouter_contribution.tpl index 531bdb03d..69cb889be 100644 --- a/galette/templates/default/ajouter_contribution.tpl +++ b/galette/templates/default/ajouter_contribution.tpl @@ -47,14 +47,14 @@

{_T string="NB : The mandatory fields are in"} {_T string="red"}

- {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} "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"}"> @@ -93,7 +93,7 @@ {html_options options=$type_cotis_options selected=$selectedid}

- {if $type eq "fee"} + {if $type eq constant('Galette\Entity\Contribution::TYPE_FEE')}
- {if $type eq "fee"}{_T string="Details of membership fee"}{else}{_T string="Details of donation"}{/if} + {if $type eq constant('Galette\Entity\Contribution::TYPE_FEE')}{_T string="Details of membership fee"}{else}{_T string="Details of donation"}{/if}

@@ -124,7 +124,7 @@

- {if $type eq "fee"} + {if $type eq constant('Galette\Entity\Contribution::TYPE_FEE')}

{if $preferences->pref_membership_ext != ""} @@ -158,7 +158,7 @@

{_T string="Dispatch type:"} {_T string="Select a contribution type to create for dispatch transaction"} - +

@@ -209,7 +209,7 @@ buttonText: ' {_T string="Select a date" escape="js"}' }); - {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(); diff --git a/galette/templates/default/ajouter_transaction.tpl b/galette/templates/default/ajouter_transaction.tpl index c2b50c9f8..ba7e5bfa1 100644 --- a/galette/templates/default/ajouter_transaction.tpl +++ b/galette/templates/default/ajouter_transaction.tpl @@ -33,8 +33,8 @@

{_T string="Dispatch type:"} {_T string="Select a contribution type to create for dispatch transaction"} - - + +

{/if} @@ -55,14 +55,14 @@ {_T string="Attached contributions"} {if $transaction->getMissingAmount() > 0}
"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" > {_T string="Create a new fee that will be attached to the current transaction"} "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" > diff --git a/galette/templates/default/desktop.tpl b/galette/templates/default/desktop.tpl index cbf2c3b9e..4bf7f1032 100644 --- a/galette/templates/default/desktop.tpl +++ b/galette/templates/default/desktop.tpl @@ -37,7 +37,7 @@ {/if} {if $login->isAdmin()} {_T string="Settings"} - {_T string="Plugins"} + {_T string="Plugins"} {* Include plugins user dashboard *} {$plugins->getDashboard($tpl)} {/if} diff --git a/galette/templates/default/gestion_contributions.tpl b/galette/templates/default/gestion_contributions.tpl index 7c1ddbeb4..ea1b6d159 100644 --- a/galette/templates/default/gestion_contributions.tpl +++ b/galette/templates/default/gestion_contributions.tpl @@ -44,8 +44,8 @@ {if not $member->isActive() } ({_T string="Inactive"}){/if} {if $login->isAdmin() or $login->isStaff()} ( $member->id]}">{_T string="See member profile"} - - "fee"]}?id_adh={$member->id}">{_T string="Add a membership fee"} - - "donation"]}?id_adh={$member->id}">{_T string="Add a donation"}) + constant('Galette\Entity\Contribution::TYPE_FEE')]}?id_adh={$member->id}">{_T string="Add a membership fee"} - + constant('Galette\Entity\Contribution::TYPE_DONATION')]}?id_adh={$member->id}">{_T string="Add a donation"}) {/if} - {/if} @@ -178,10 +178,10 @@ {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} diff --git a/galette/templates/default/group.tpl b/galette/templates/default/group.tpl index 14ae87f87..a918089ca 100644 --- a/galette/templates/default/group.tpl +++ b/galette/templates/default/group.tpl @@ -1,12 +1,12 @@
$group->getId()]}" method="post" enctype="multipart/form-data" id="group_form">
- {_T string="Informations"} + {_T string="Information"}
{if $group->getId() }

diff --git a/galette/templates/default/liste_membres.tpl b/galette/templates/default/liste_membres.tpl index fc7ae95e3..e70c4cbdf 100644 --- a/galette/templates/default/liste_membres.tpl +++ b/galette/templates/default/liste_membres.tpl @@ -50,7 +50,7 @@ {/if} - {_T string="Informations"} + {_T string="Information"} @@ -78,7 +78,7 @@ {if $login->isLogged()} {$member->email} {/if} - {$member->others_infos} + {$member->others_infos} {/foreach} diff --git a/galette/templates/default/page.tpl b/galette/templates/default/page.tpl index 47c709790..93021cab8 100644 --- a/galette/templates/default/page.tpl +++ b/galette/templates/default/page.tpl @@ -44,8 +44,8 @@ We have to use a template file, so Smarty will do its work (like replacing varia "contributions"]}" title="{_T string="View and filter contributions"}">{_T string="List of contributions"} "transactions"]}" title="{_T string="View and filter transactions"}">{_T string="List of transactions"} {_T string="Add a member"} - "fee"]}" title="{_T string="Add new membership fee in database"}">{_T string="Add a membership fee"} - "donation"]}" title="{_T string="Add new donation in database"}">{_T string="Add a donation"} + constant('Galette\Entity\Contribution::TYPE_FEE')]}" title="{_T string="Add new membership fee in database"}">{_T string="Add a membership fee"} + constant('Galette\Entity\Contribution::TYPE_DONATION')]}" title="{_T string="Add new donation in database"}">{_T string="Add a donation"} {_T string="Add a transaction"} {_T string="Reminders"} {_T string="Logs"} @@ -75,7 +75,7 @@ We have to use a template file, so Smarty will do its work (like replacing varia

{_T string="Configuration"}