Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SUD Éducation
Cartable
Commits
7d64c2ed
Commit
7d64c2ed
authored
3 years ago
by
Bastien Ho
Browse files
Options
Download
Email Patches
Plain Diff
Add per Syndicate membership settings #3
parent
8e18cf45
main
102-summer-break
104-syndicate-contribution-page
111-styler-le-bloc-membership-to-complete
114-undefined-array-key-1
115-contribution-template
117-wall-test
118-mise-a-jour-de-l-etat-d-adhesion-dans-un-sepa
119-nombre-de-contribution-periodique-se-concatene-a-chaque-ouverture-de-fenetre
120-etiquettes-postales-ajouter-le-nom-de-l-etablissement-dans-l-adresse-work
125-test-SEPA
126-more-CB-tests
126-test-cb
129-nouvelle-civirule-pour-garantir-une-relation-membre-de
130-enddate
141-SP-Rest
145-fix-frequency-front
146-fine-vads-desc
147-no-sepa-prorata
151-readable-membership-amount
164-civirule-alerte-si-une-personne-est-en-relation-adhesion-avec-deux-syndicats
172-fix-le-search-recherche-des-paiements-recap-annee-le-renommer-par-periode-et-non-annee
178-notifications-de-paiement-mensuel-ne-pas-mettre-le-syndicat-en-cc
93-script-for-replation
99-membership-ratio-general-non-pris-en-compte
More-Tests
civicrm-5.69
civix-23
filter-cases
fix-address-work-match
fix-sepa-restrict
show-test-scenarios
stable
staging
traduction
v1.10.11
v2.10-fixes
2.15.0
2.14.0
2.13.0
2.12.0
2.11.1
2.11.0
2.10.0
2.9.1
2.9.0
2.8.1
2.8.0
2.7.0
2.6.2
2.6.1
2.6.0
2.5.0
2.4.0
2.3.3
2.3.2
2.3.1
2.3.0
2.2.4
2.2.3
2.2.2
2.2.1
2.2.0
2.1.3
2.1.2
2.1.1
2.1.0
2.0.0
1.10
1.9.1
1.9
1.8.5
1.8.5-beta3
1.8.4
1.8.3
1.8.2
1.8.1
1.8
1.7.1
1.7
1.6.1
1.6
1.5
1.4
1.3
1.2
1.1
1.0.2
1.0
0.9
0.8
0.7
0.6
0.5
0.4
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
CRM/Cartable/Upgrader.php
+3
-0
CRM/Cartable/Upgrader.php
CRM/Cartable/Upgrader/Uninstall.php
+4
-0
CRM/Cartable/Upgrader/Uninstall.php
CRM/Cartable/Upgrader/upgrade_0011.php
+53
-0
CRM/Cartable/Upgrader/upgrade_0011.php
cartable.php
+10
-1
cartable.php
src/js/membership.js
+5
-3
src/js/membership.js
with
75 additions
and
4 deletions
+75
-4
CRM/Cartable/Upgrader.php
+
3
-
0
View file @
7d64c2ed
...
...
@@ -74,6 +74,9 @@ class CRM_Cartable_Upgrader extends CRM_Cartable_Upgrader_Base {
public
function
upgrade_0010
()
{
return
$this
->
include_upgrade_version
(
__FUNCTION__
);
}
public
function
upgrade_0011
()
{
return
$this
->
include_upgrade_version
(
__FUNCTION__
);
}
public
function
include_upgrade_version
(
$version
)
{
if
(
file_exists
(
__DIR__
.
"/Upgrader/
{
$version
}
.php"
)){
...
...
This diff is collapsed.
Click to expand it.
CRM/Cartable/Upgrader/Uninstall.php
+
4
-
0
View file @
7d64c2ed
...
...
@@ -38,6 +38,9 @@ delete_entities(
"Corps"
,
"TypeDePoste"
,
"Discipline"
,
"FrequencesPaiement"
,
"GrilleCotisation"
,
"RatioSupplementaire"
,
]
);
...
...
@@ -46,6 +49,7 @@ delete_entities(
[
"DonneesSyndicat"
,
"DonneesParticulier"
,
"ParametresAdhesion"
,
]
);
...
...
This diff is collapsed.
Click to expand it.
CRM/Cartable/Upgrader/upgrade_0011.php
0 → 100644
+
53
-
0
View file @
7d64c2ed
<?php
civicrm_api3
(
'CustomGroup'
,
'create'
,
[
'title'
=>
"Paramètres d’adhésion"
,
'name'
=>
'ParametresAdhesion'
,
'extends'
=>
[
'Organization'
,
'SyndicatSUD'
],
'column_name'
=>
'parametres_adhesion'
,
'weight'
=>
1
,
'collapse_display'
=>
0
,
'is_active'
=>
1
,
'style'
=>
"Inline"
,
'api.CustomField.create'
=>
[
[
'label'
=>
'Fréquences de paiement'
,
'name'
=>
'FrequencesPaiement'
,
'column_name'
=>
'frequence_paiement'
,
'html_type'
=>
'Multi-Select'
,
'weight'
=>
1
,
'is_required'
=>
1
,
'is_searchable'
=>
1
,
'is_active'
=>
1
,
'is_reserved'
=>
1
,
'option_values'
=>
[
'oneoff'
=>
'Une fois'
,
'monthly'
=>
'Renouvellement Mensuel'
,
'yearly'
=>
'Renouvellement Annuel'
,
],
],
[
'label'
=>
'Grille de cotisation'
,
'name'
=>
'GrilleCotisation'
,
'column_name'
=>
'grille_cotisation'
,
'html_type'
=>
'TextArea'
,
'weight'
=>
2
,
'is_required'
=>
1
,
'is_searchable'
=>
1
,
'is_active'
=>
1
,
'is_reserved'
=>
1
,
'help_post'
=>
"Un par ligne. salaire|montant d'adhésion. Laisser vide pour utiliser les valeurs globales."
],
[
'label'
=>
'Ratio supplémentaire'
,
'name'
=>
'RatioSupplementaire'
,
'column_name'
=>
'ratio_supplementaire'
,
'html_type'
=>
'Text'
,
'weight'
=>
3
,
'is_required'
=>
1
,
'is_searchable'
=>
1
,
'is_active'
=>
1
,
'is_reserved'
=>
1
,
'help_post'
=>
"Pourcentage pour les salaires supérieurs."
],
]
]);
This diff is collapsed.
Click to expand it.
cartable.php
+
10
-
1
View file @
7d64c2ed
...
...
@@ -333,13 +333,16 @@ function cartable_get_membership_vars($vars){
function
cartable_get_indexed_syndicates_and_provinces
(
$vars
){
$ProvinceField
=
cartable_get_custom_field_id
(
'Departements'
,
'DonneesSyndicat'
);
$FrequencesPaiementField
=
cartable_get_custom_field_id
(
'FrequencesPaiement'
,
'ParametresAdhesion'
);
$GrilleCotisationField
=
cartable_get_custom_field_id
(
'GrilleCotisation'
,
'ParametresAdhesion'
);
$RatioSupplementaireField
=
cartable_get_custom_field_id
(
'RatioSupplementaire'
,
'ParametresAdhesion'
);
if
(
!
$ProvinceField
){
return
false
;
}
// First get all needed values
$CountryId
=
civicrm_api3
(
'Country'
,
'getvalue'
,
[
'return'
=>
"id"
,
'name'
=>
"france"
]);
$Provinces
=
civicrm_api3
(
'StateProvince'
,
'get'
,
[
'country_id'
=>
$CountryId
,
'options'
=>
[
'limit'
=>
0
],
'sequential'
=>
1
]);
$Syndicates
=
civicrm_api3
(
'Contact'
,
'get'
,
[
'return'
=>
"id,display_name,
{
$ProvinceField
}
"
,
'contact_sub_type'
=>
"SyndicatSUD"
,
'options'
=>
[
'limit'
=>-
1
],
'sequential'
=>
1
]);
$Syndicates
=
civicrm_api3
(
'Contact'
,
'get'
,
[
'return'
=>
"id,display_name,
{
$ProvinceField
}
,
{
$FrequencesPaiementField
}
,
{
$GrilleCotisationField
}
,
{
$RatioSupplementaireField
}
"
,
'contact_sub_type'
=>
"SyndicatSUD"
,
'options'
=>
[
'limit'
=>-
1
],
'sequential'
=>
1
]);
$MembershipTypes
=
civicrm_api3
(
'MembershipType'
,
'get'
,
[
'options'
=>
[
'limit'
=>
0
]]);
$membershipFieldID
=
$vars
[
'membershipFieldID'
];
...
...
@@ -373,7 +376,13 @@ function cartable_get_indexed_syndicates_and_provinces($vars){
?
'CIVICRM_QFID_'
.
$IndexedMembershipFields
[
$IndexedMembershipTypes
[
$syndicate
[
'id'
]][
'id'
]][
'id'
]
.
'_price_'
.
$IndexedMembershipFields
[
$IndexedMembershipTypes
[
$syndicate
[
'id'
]][
'id'
]][
'price_field_id'
]
:
null
;
$syndicate
[
'Departements'
]
=
$syndicate
[
$ProvinceField
];
$syndicate
[
'PaymentFrequency'
]
=
$syndicate
[
$FrequencesPaiementField
];
$syndicate
[
'MembershipRates'
]
=
cartable_parse_rates
(
$syndicate
[
$GrilleCotisationField
]);
$syndicate
[
'membershipRatio'
]
=
$syndicate
[
$RatioSupplementaireField
];
unset
(
$syndicate
[
$ProvinceField
]);
unset
(
$syndicate
[
$FrequencesPaiementField
]);
unset
(
$syndicate
[
$GrilleCotisationField
]);
unset
(
$syndicate
[
$RatioSupplementaireField
]);
unset
(
$syndicate
[
'contact_sub_type'
]);
unset
(
$syndicate
[
'contact_is_deleted'
]);
...
...
This diff is collapsed.
Click to expand it.
src/js/membership.js
+
5
-
3
View file @
7d64c2ed
var
AnnualContributionAmount
=
null
;
var
ToPayAmount
=
null
;
var
otherAmountField
;
var
Syndicate
;
var
SyndicateId
;
var
membershipType
;
...
...
@@ -20,6 +21,7 @@ const cartable_reset_membership_amount = function(){
var
chosenSyndicateButton
=
CRM
.
$
(
'
.cartable-syndicate.active
'
);
SyndicateId
=
chosenSyndicateButton
.
attr
(
'
data-id
'
);
Syndicate
=
cartable
.
Syndicates
.
Syndicates
[
SyndicateId
];
membershipType
=
cartable
.
Syndicates
.
IndexedMembershipTypes
[
SyndicateId
];
MembershipSelector
.
append
(
...
...
@@ -46,9 +48,9 @@ const cartable_reset_membership_amount = function(){
;
var
membershipRates
=
cartable
.
Membership
.
membershipRates
;
// TODO:
// Allow MembershipTypes to override r
ates
// with a custom field
if
(
Syndicate
.
MembershipRates
!==
undefined
&&
Object
.
keys
(
Syndicate
.
MembershipRates
).
length
){
membershipRates
=
Syndicate
.
MembershipR
ates
;
}
for
(
var
Salary
in
membershipRates
){
SalarySelect
.
append
(
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets