diff --git a/plugins/cipf_plugin/php/profs_states.php b/plugins/cipf_plugin/php/profs_states.php index 3572ece..cef41ff 100644 --- a/plugins/cipf_plugin/php/profs_states.php +++ b/plugins/cipf_plugin/php/profs_states.php @@ -81,7 +81,7 @@ function get_field_init_CIPF($acf_field_name, $acf_id) { * global 'setter' and 'izzer' for this file * */ -function is_acf_state_CIPF($user_id = null, $acf_field, $state_name) { +function is_acf_state_CIPF($acf_field, $state_name, $user_id = null) { PLGNTLS_class::debug_infos(); if (is_null($user_id)) { @@ -109,7 +109,7 @@ function is_acf_state_CIPF($user_id = null, $acf_field, $state_name) { } return false; } -function set_acf_state_CIPF($user_id = null, $acf_field, $state_name) { +function set_acf_state_CIPF($acf_field, $state_name, $user_id = null) { PLGNTLS_class::debug_infos(); if (is_null($user_id)) { @@ -138,66 +138,66 @@ function set_acf_state_CIPF($user_id = null, $acf_field, $state_name) { * or one of the specific functions * */ -function is_account_state_CIPF($user_id = null, $state_name) { +function is_account_state_CIPF($state_name, $user_id = null) { PLGNTLS_class::debug_infos(); $acf_account_state = PLGNTLS_class::ACF_ACCOUNT_STATE; - return is_acf_state_CIPF($user_id, $acf_account_state, $state_name); + return is_acf_state_CIPF($acf_account_state, $state_name, $user_id); } function is_account_new_CIPF($user_id = null) { PLGNTLS_class::debug_infos(); - return is_account_state_CIPF($user_id, 'new'); + return is_account_state_CIPF('new', $user_id); } function is_account_to_pay_CIPF($user_id = null) { PLGNTLS_class::debug_infos(); - return is_account_state_CIPF($user_id, 'to_pay'); + return is_account_state_CIPF('to_pay', $user_id); } function is_account_valid_CIPF($user_id = null) { PLGNTLS_class::debug_infos(); - return is_account_state_CIPF($user_id, 'valid'); + return is_account_state_CIPF('valid', $user_id); } function is_account_waiting_invalid_CIPF($user_id = null) { PLGNTLS_class::debug_infos(); - return is_account_state_CIPF($user_id, 'waiting_invalid'); + return is_account_state_CIPF('waiting_invalid', $user_id); } function is_account_waiting_valid_CIPF($user_id = null) { PLGNTLS_class::debug_infos(); - return is_account_state_CIPF($user_id, 'waiting_valid'); + return is_account_state_CIPF('waiting_valid', $user_id); } function is_account_expired_CIPF($user_id = null) { PLGNTLS_class::debug_infos(); - return is_account_state_CIPF($user_id, 'expired'); + return is_account_state_CIPF('expired', $user_id); } /* * setters : */ -function set_account_state_CIPF($user_id = null, $state_name) { +function set_account_state_CIPF($state_name, $user_id = null) { PLGNTLS_class::debug_infos(); $acf_account_state = PLGNTLS_class::ACF_ACCOUNT_STATE; - set_acf_state_CIPF($user_id, $acf_account_state, $state_name); + set_acf_state_CIPF($acf_account_state, $state_name, $user_id); } function set_account_new_CIPF($user_id = null) { PLGNTLS_class::debug_infos(); - set_account_state_CIPF($user_id, 'new'); + set_account_state_CIPF('new', $user_id); } function set_account_to_pay_CIPF($user_id = null) { PLGNTLS_class::debug_infos(); - set_account_state_CIPF($user_id, 'to_pay'); + set_account_state_CIPF('to_pay', $user_id); } function set_account_valid_CIPF($user_id = null) { PLGNTLS_class::debug_infos(); - set_account_state_CIPF($user_id, 'valid'); + set_account_state_CIPF('valid', $user_id); } function set_account_waiting_invalid_CIPF($user_id = null) { PLGNTLS_class::debug_infos(); - set_account_state_CIPF($user_id, 'waiting_invalid'); + set_account_state_CIPF('waiting_invalid', $user_id); } function set_account_waiting_valid_CIPF($user_id = null) { PLGNTLS_class::debug_infos(); - set_account_state_CIPF($user_id, 'waiting_valid'); + set_account_state_CIPF('waiting_valid', $user_id); } function set_account_expired_CIPF($user_id = null) { PLGNTLS_class::debug_infos(); - set_account_state_CIPF($user_id, 'expired'); + set_account_state_CIPF('expired', $user_id); } @@ -214,22 +214,22 @@ function set_account_expired_CIPF($user_id = null) { function is_card_new_CIPF($user_id = null) { PLGNTLS_class::debug_infos(); $acf_card_state = PLGNTLS_class::ACF_CARD_STATE; - return is_acf_state_CIPF($user_id, $acf_card_state, 'new'); + return is_acf_state_CIPF($acf_card_state, 'new', $user_id); } function is_card_renew_CIPF($user_id = null) { PLGNTLS_class::debug_infos(); $acf_card_state = PLGNTLS_class::ACF_CARD_STATE; - return is_acf_state_CIPF($user_id, $acf_card_state, 'renew'); + return is_acf_state_CIPF($acf_card_state, 'renew', $user_id); } function set_card_new_CIPF($user_id = null) { PLGNTLS_class::debug_infos(); $acf_card_state = PLGNTLS_class::ACF_CARD_STATE; - set_acf_state_CIPF($user_id, $acf_card_state, 'new'); + set_acf_state_CIPF($acf_card_state, 'new', $user_id); } function set_card_renew_CIPF($user_id = null) { PLGNTLS_class::debug_infos(); $acf_card_state = PLGNTLS_class::ACF_CARD_STATE; - set_acf_state_CIPF($user_id, $acf_card_state, 'renew'); + set_acf_state_CIPF($acf_card_state, 'renew', $user_id); } @@ -246,12 +246,12 @@ function set_card_renew_CIPF($user_id = null) { function is_payment_method_paypal_CIPF($user_id = null) { PLGNTLS_class::debug_infos(); $acf_card_payment_method = PLGNTLS_class::ACF_CARD_PAYMENT_METHOD; - return is_acf_state_CIPF($user_id, $acf_card_payment_method, 'paypal'); + return is_acf_state_CIPF($acf_card_payment_method, 'paypal', $user_id); } function is_payment_method_transfert_CIPF($user_id = null) { PLGNTLS_class::debug_infos(); $acf_card_payment_method = PLGNTLS_class::ACF_CARD_PAYMENT_METHOD; - return is_acf_state_CIPF($user_id, $acf_card_payment_method, 'transfert'); + return is_acf_state_CIPF($acf_card_payment_method, 'transfert', $user_id); } @@ -269,50 +269,50 @@ function is_payment_method_transfert_CIPF($user_id = null) { * 'started'=>'en_cours', 'success'=>'reussi', 'failure'=>'echec', 'nothing'=>'aucun' * */ -function is_payment_state_CIPF($user_id = null, $type) { +function is_payment_state_CIPF($type, $user_id = null) { PLGNTLS_class::debug_infos(); $acf_card_payment_state = PLGNTLS_class::ACF_CARD_PAYMENT_STATE; - return is_acf_state_CIPF($user_id, $acf_card_payment_state, $type); + return is_acf_state_CIPF($acf_card_payment_state, $type, $user_id); } function is_payment_started_CIPF($user_id = null) { PLGNTLS_class::debug_infos(); - return is_payment_state_CIPF($user_id, 'started'); + return is_payment_state_CIPF('started', $user_id); } function is_payment_success_CIPF($user_id = null) { PLGNTLS_class::debug_infos(); - return is_payment_state_CIPF($user_id, 'success'); + return is_payment_state_CIPF('success', $user_id); } function is_payment_failure_CIPF($user_id = null) { PLGNTLS_class::debug_infos(); - return is_payment_state_CIPF($user_id, 'failure'); + return is_payment_state_CIPF('failure', $user_id); } function is_payment_nothing_CIPF($user_id = null) { PLGNTLS_class::debug_infos(); - return is_payment_state_CIPF($user_id, 'nothing'); + return is_payment_state_CIPF('nothing', $user_id); } /* * setters */ -function set_payment_state_CIPF($user_id = null, $type) { +function set_payment_state_CIPF($type, $user_id = null) { PLGNTLS_class::debug_infos(); $acf_card_payment_state = PLGNTLS_class::ACF_CARD_PAYMENT_STATE; - set_acf_state_CIPF($user_id, $acf_card_payment_state, $type); + set_acf_state_CIPF($acf_card_payment_state, $type, $user_id); } function set_payment_started_CIPF($user_id = null) { PLGNTLS_class::debug_infos(); - set_payment_state_CIPF($user_id, 'started'); + set_payment_state_CIPF('started', $user_id); } function set_payment_success_CIPF($user_id = null) { PLGNTLS_class::debug_infos(); - set_payment_state_CIPF($user_id, 'success'); + set_payment_state_CIPF('success', $user_id); } function set_payment_failure_CIPF($user_id = null) { PLGNTLS_class::debug_infos(); - set_payment_state_CIPF($user_id, 'failure'); + set_payment_state_CIPF('failure', $user_id); } function set_payment_nothing_CIPF($user_id = null) { PLGNTLS_class::debug_infos(); - set_payment_state_CIPF($user_id, 'nothing'); + set_payment_state_CIPF('nothing', $user_id); }