- added debug function
- fixed issues in acf fields use
This commit is contained in:
@@ -61,93 +61,20 @@ class PLGNTLS_class
|
||||
*
|
||||
*/
|
||||
// ACF
|
||||
const ACF_CARD_STATE = ['_name'=>'etat_carte', 'new'=>'Commande', 'renew'=>'Renouvellement'];
|
||||
const ACF_CARD_PAYMENT_METHOD = ['_name'=>'paiement', 'paypal'=>'Paypal', 'transfert'=>'Virement'];
|
||||
const ACF_CARD_PRICE_CHOICE = ['_name'=>'tarif', 'low'=>'10', 'high'=>'15'];
|
||||
const ACF_CARD_PRICE_DELIVERY = ['_name'=>'livraison', 'pdf'=>'PDF', 'post'=>'Fabrication'];
|
||||
const ACF_PROF_IS_ACTIV = ['_name'=>'compte-actif', 'activ'=>'Actif', 'inactiv'=>'Inactif'];
|
||||
const ACF_PROF_CGV = ['_name'=>'cgv', 'cgv'=>'cgv'];
|
||||
const ACF_PROF_CAN_RENEW = ['_name'=>'renouvellement_possible', 'can'=>true, 'cannot'=>false];
|
||||
const ACF_CARD_PRICE_TOTAL = ['_name'=>'somme_a_regler']; // input number
|
||||
const ACF_CARD_EXPIRATION = ['_name'=>'fin_de_validite']; // input date
|
||||
|
||||
/*
|
||||
const ACF_CARD_STATE = [
|
||||
'_name' => 'etat_carte',
|
||||
'new' => 'Commande',
|
||||
'renew' => 'Renouvellement',
|
||||
];
|
||||
|
||||
const ACF_CARD_PAYMENT_METHOD = [
|
||||
'_name' => 'paiement',
|
||||
'paypal' => 'Paypal',
|
||||
'transfert' => 'Virement',
|
||||
];
|
||||
|
||||
const ACF_CARD_PRICE_CHOICE = [
|
||||
'_name' => 'tarif',
|
||||
'low' => '10',
|
||||
'high' => '15',
|
||||
];
|
||||
|
||||
const ACF_CARD_PRICE_DELIVERY = [
|
||||
'_name' => 'livraison',
|
||||
'pdf' => 'PDF',
|
||||
'post' => 'Fabrication',
|
||||
];
|
||||
|
||||
const ACF_PROF_IS_ACTIV = [
|
||||
'_name' => 'compte-actif',
|
||||
'activ' => 'Actif',
|
||||
'inactiv' => 'Inactif',
|
||||
];
|
||||
|
||||
const ACF_PROF_CGV = [
|
||||
'_name' => 'cgv',
|
||||
'cgv' => 'cgv',
|
||||
];
|
||||
|
||||
const ACF_PROF_CAN_RENEW = [
|
||||
'_name' => 'renouvellement_possible',
|
||||
'can' => true,
|
||||
'cannot' => false,
|
||||
];
|
||||
|
||||
const ACF_CARD_PRICE_TOTAL = ['_name' => 'somme_a_regler']; // input number
|
||||
const ACF_CARD_EXPIRATION = ['_name' => 'fin_de_validite']; // input date
|
||||
*/
|
||||
|
||||
/*
|
||||
const ACF_CARD_STATE = 'etat_carte';
|
||||
const ACF_CARD_STATE__FIRST = 'Commande';
|
||||
const ACF_CARD_STATE__RENEW = 'Renouvellement';
|
||||
|
||||
const ACF_CARD_PAYMENT_METHOD = 'paiement';
|
||||
const ACF_CARD_PAYMENT_METHOD__PAYPAL = 'Paypal';
|
||||
const ACF_CARD_PAYMENT_METHOD__TRANSFERT = 'Virement';
|
||||
|
||||
const ACF_CARD_PRICE_CHOICE = 'tarif';
|
||||
const ACF_CARD_PRICE_CHOICE__LOW = '10';
|
||||
const ACF_CARD_PRICE_CHOICE__HIGH = '15';
|
||||
|
||||
const ACF_CARD_PRICE_DELIVERY = 'livraison';
|
||||
const ACF_CARD_PRICE_DELIVERY__PDF = 'PDF';
|
||||
const ACF_CARD_PRICE_DELIVERY__POST = 'Fabrication';
|
||||
|
||||
const ACF_PROF_IS_ACTIV = 'compte-actif';
|
||||
const ACF_PROF_IS_ACTIV__ACTIV = 'Actif';
|
||||
const ACF_PROF_IS_ACTIV__INACTIV = 'Inactif';
|
||||
|
||||
const ACF_PROF_CGV = 'cgv';
|
||||
const ACF_PROF_CGV__CGV = 'cgv';
|
||||
|
||||
const ACF_CARD_PRICE_TOTAL = 'somme_a_regler'; // input number
|
||||
const ACF_CARD_EXPIRATION = 'fin_de_validite'; // input date
|
||||
const ACF_PROF_CAN_RENEW = 'renouvellement_possible'; // input true/false
|
||||
*/
|
||||
const ACF_CARD_STATE = ['_name'=>'etat_carte', 'new'=>'Commande', 'renew'=>'Renouvellement']; // radio button
|
||||
const ACF_CARD_PAYMENT_METHOD = ['_name'=>'paiement', 'paypal'=>'Paypal', 'transfert'=>'Virement']; // radio button
|
||||
const ACF_CARD_PRICE_CHOICE = ['_name'=>'tarif', 'low'=>'10', 'high'=>'15']; // radio button
|
||||
const ACF_CARD_PRICE_DELIVERY = ['_name'=>'livraison', 'pdf'=>'PDF', 'post'=>'Fabrication']; // radio button
|
||||
const ACF_PROF_IS_ACTIV = ['_name'=>'compte-actif', 'activ'=>'Actif', 'inactiv'=>'Inactif']; // radio button
|
||||
const ACF_PROF_CGV = ['_name'=>'cgv', 'cgv'=>'cgv']; // checkbox
|
||||
const ACF_PROF_CAN_RENEW = ['_name'=>'renouvellement_possible', 'can'=>true, 'cannot'=>false]; // true/false
|
||||
const ACF_CARD_PRICE_TOTAL = ['_name'=>'somme_a_regler']; // number
|
||||
const ACF_CARD_CARD_NUMBER = ['_name'=>'numero_de_la_carte']; // number
|
||||
const ACF_CARD_EXPIRATION = ['_name'=>'fin_de_validite']; // date picker
|
||||
|
||||
// META
|
||||
const META_PAYEMENT_STATUS = 'cipf_payement_status';
|
||||
const META_ORDER_ID = 'cipf_order_id';
|
||||
|
||||
// SLUG
|
||||
const SLUG_PROF_INACTIV = 'validation-en-cours';
|
||||
@@ -163,6 +90,12 @@ class PLGNTLS_class
|
||||
const PAYPAL_MESSAGE_SUCCESS = '`paiement reussi`';
|
||||
const PAYPAL_MESSAGE_FAILURE = '`paiement raté`';
|
||||
|
||||
// ROLES
|
||||
const ROLE_PROF = 'professeur__professeure';
|
||||
const ROLE_PARTNER = 'partenaire';
|
||||
const ROLE_FIPF = 'fipf';
|
||||
const ROLE_ADMIN = 'administrator';
|
||||
|
||||
// OTHER
|
||||
const CARD_RENEW_PERIOD = 31; // int : number of days before expiration when renew card start to be possible
|
||||
const CARD_VALIDITY_TIME = '1 year'; // string : time of validity of the card (ex: '1 month' or '1 year' or '60 days')
|
||||
@@ -170,6 +103,7 @@ class PLGNTLS_class
|
||||
|
||||
|
||||
|
||||
private static $_DEBUG_INFOS = false;
|
||||
private static $_root_path;
|
||||
private static $_root_url;
|
||||
|
||||
@@ -210,6 +144,19 @@ class PLGNTLS_class
|
||||
return(self::$_root_url);
|
||||
}
|
||||
|
||||
/*
|
||||
* for debug purposes
|
||||
*/
|
||||
public static function debug_infos() {
|
||||
if (self::$_DEBUG_INFOS === false)
|
||||
return;
|
||||
$trace = debug_backtrace();
|
||||
$function = $trace[1]['function'];
|
||||
$file = $trace[0]['file'];
|
||||
$line = $trace[0]['line'];
|
||||
error_log("-debug: function '".$function."' (in ".$file.", line ".$line);
|
||||
}
|
||||
|
||||
|
||||
public function add_to_front($srcs_arr = null, $vars = null) {
|
||||
if (!is_array($vars))
|
||||
@@ -412,7 +359,6 @@ class PLGNTLS_class
|
||||
wp_add_inline_script($handle, $src->src, 'before');
|
||||
}
|
||||
private function add_inline_style($src) {
|
||||
error_log("inside add_inline_style");
|
||||
$handle = $src->depends;
|
||||
if ($handle === null || empty($handle))
|
||||
$handle = $this->_first_style;
|
||||
|
||||
Reference in New Issue
Block a user