mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-12 20:41:26 +01:00
Fix: Corrections mineures sur import adherent depuis ldap avec statut > 1
This commit is contained in:
@@ -1782,7 +1782,7 @@ class Adherent
|
|||||||
if ($mode == 0)
|
if ($mode == 0)
|
||||||
{
|
{
|
||||||
if ($statut == -1) return $langs->trans("MemberStatusDraft");
|
if ($statut == -1) return $langs->trans("MemberStatusDraft");
|
||||||
if ($statut == 1)
|
if ($statut >= 1)
|
||||||
{
|
{
|
||||||
if (! $date_end_subscription) return $langs->trans("MemberStatusActive");
|
if (! $date_end_subscription) return $langs->trans("MemberStatusActive");
|
||||||
elseif ($date_end_subscription < time()) return $langs->trans("MemberStatusActiveLate");
|
elseif ($date_end_subscription < time()) return $langs->trans("MemberStatusActiveLate");
|
||||||
@@ -1793,7 +1793,7 @@ class Adherent
|
|||||||
if ($mode == 1)
|
if ($mode == 1)
|
||||||
{
|
{
|
||||||
if ($statut == -1) return $langs->trans("MemberStatusDraft");
|
if ($statut == -1) return $langs->trans("MemberStatusDraft");
|
||||||
if ($statut == 1)
|
if ($statut >= 1)
|
||||||
{
|
{
|
||||||
if (! $date_end_subscription) return $langs->trans("MemberStatusActiveShort");
|
if (! $date_end_subscription) return $langs->trans("MemberStatusActiveShort");
|
||||||
elseif ($date_end_subscription < time()) return $langs->trans("MemberStatusActiveLateShort");
|
elseif ($date_end_subscription < time()) return $langs->trans("MemberStatusActiveLateShort");
|
||||||
@@ -1804,7 +1804,7 @@ class Adherent
|
|||||||
if ($mode == 2)
|
if ($mode == 2)
|
||||||
{
|
{
|
||||||
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0').' '.$langs->trans("MemberStatusDraft");
|
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0').' '.$langs->trans("MemberStatusDraft");
|
||||||
if ($statut == 1)
|
if ($statut >= 1)
|
||||||
{
|
{
|
||||||
if (! $date_end_subscription) return img_picto($langs->trans('MemberStatusActive'),'statut1').' '.$langs->trans("MemberStatusActiveShort");
|
if (! $date_end_subscription) return img_picto($langs->trans('MemberStatusActive'),'statut1').' '.$langs->trans("MemberStatusActiveShort");
|
||||||
elseif ($date_end_subscription < time()) return img_picto($langs->trans('MemberStatusActiveLate'),'statut3').' '.$langs->trans("MemberStatusActiveLateShort");
|
elseif ($date_end_subscription < time()) return img_picto($langs->trans('MemberStatusActiveLate'),'statut3').' '.$langs->trans("MemberStatusActiveLateShort");
|
||||||
@@ -1815,7 +1815,7 @@ class Adherent
|
|||||||
if ($mode == 3)
|
if ($mode == 3)
|
||||||
{
|
{
|
||||||
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0');
|
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0');
|
||||||
if ($statut == 1)
|
if ($statut >= 1)
|
||||||
{
|
{
|
||||||
if (! $date_end_subscription) return img_picto($langs->trans('MemberStatusActive'),'statut1');
|
if (! $date_end_subscription) return img_picto($langs->trans('MemberStatusActive'),'statut1');
|
||||||
elseif ($date_end_subscription < time()) return img_picto($langs->trans('MemberStatusActiveLate'),'statut3');
|
elseif ($date_end_subscription < time()) return img_picto($langs->trans('MemberStatusActiveLate'),'statut3');
|
||||||
@@ -1826,7 +1826,7 @@ class Adherent
|
|||||||
if ($mode == 4)
|
if ($mode == 4)
|
||||||
{
|
{
|
||||||
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0').' '.$langs->trans("MemberStatusDraft");
|
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0').' '.$langs->trans("MemberStatusDraft");
|
||||||
if ($statut == 1)
|
if ($statut >= 1)
|
||||||
{
|
{
|
||||||
if (! $date_end_subscription) return img_picto($langs->trans('MemberStatusActive'),'statut1').' '.$langs->trans("MemberStatusActive");
|
if (! $date_end_subscription) return img_picto($langs->trans('MemberStatusActive'),'statut1').' '.$langs->trans("MemberStatusActive");
|
||||||
elseif ($date_end_subscription < time()) return img_picto($langs->trans('MemberStatusActiveLate'),'statut3').' '.$langs->trans("MemberStatusActiveLate");
|
elseif ($date_end_subscription < time()) return img_picto($langs->trans('MemberStatusActiveLate'),'statut3').' '.$langs->trans("MemberStatusActiveLate");
|
||||||
@@ -1837,7 +1837,7 @@ class Adherent
|
|||||||
if ($mode == 5)
|
if ($mode == 5)
|
||||||
{
|
{
|
||||||
if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'),'statut0');
|
if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'),'statut0');
|
||||||
if ($statut == 1)
|
if ($statut >= 1)
|
||||||
{
|
{
|
||||||
if (! $date_end_subscription) return $langs->trans("MemberStatusActive").' '.img_picto($langs->trans('MemberStatusActive'),'statut1');
|
if (! $date_end_subscription) return $langs->trans("MemberStatusActive").' '.img_picto($langs->trans('MemberStatusActive'),'statut1');
|
||||||
elseif ($date_end_subscription < time()) return $langs->trans("MemberStatusActiveLate").' '.img_picto($langs->trans('MemberStatusActiveLate'),'statut3');
|
elseif ($date_end_subscription < time()) return $langs->trans("MemberStatusActiveLate").' '.img_picto($langs->trans('MemberStatusActiveLate'),'statut3');
|
||||||
|
|||||||
@@ -604,7 +604,6 @@ if ($action == 'edit')
|
|||||||
$morphys["phy"] = $langs->trans("Physical");
|
$morphys["phy"] = $langs->trans("Physical");
|
||||||
$morphys["mor"] = $langs->trans("Morale");
|
$morphys["mor"] = $langs->trans("Morale");
|
||||||
print "<tr><td>".$langs->trans("Person")."</td><td>";
|
print "<tr><td>".$langs->trans("Person")."</td><td>";
|
||||||
print $adh->morphy;
|
|
||||||
$htmls->select_array("morphy", $morphys, $adh->morphy);
|
$htmls->select_array("morphy", $morphys, $adh->morphy);
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
|
|||||||
@@ -215,6 +215,7 @@ if ($result >= 0)
|
|||||||
$member->datevalid=dolibarr_stringtotime($ldapuser[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE]);
|
$member->datevalid=dolibarr_stringtotime($ldapuser[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE]);
|
||||||
$member->statut=$ldapuser[$conf->global->LDAP_FIELD_MEMBER_STATUS];
|
$member->statut=$ldapuser[$conf->global->LDAP_FIELD_MEMBER_STATUS];
|
||||||
}
|
}
|
||||||
|
//if ($member->statut > 1) $member->statut=1;
|
||||||
|
|
||||||
//print_r($ldapuser);
|
//print_r($ldapuser);
|
||||||
|
|
||||||
@@ -238,36 +239,48 @@ if ($result >= 0)
|
|||||||
|
|
||||||
//print_r($member);
|
//print_r($member);
|
||||||
|
|
||||||
// Insertion premi<6D>re adh<64>sion
|
|
||||||
$datefirst='';
|
$datefirst='';
|
||||||
if ($conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE)
|
if ($conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE)
|
||||||
{
|
{
|
||||||
$datefirst=dolibarr_stringtotime($ldapuser[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE]);
|
$datefirst=dolibarr_stringtotime($ldapuser[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE]);
|
||||||
}
|
$pricefirst=price2num($ldapuser[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT]);
|
||||||
if ($datefirst)
|
|
||||||
{
|
|
||||||
// Cree premiere cotisation et met a jour datefin dans adherent
|
|
||||||
$price=price2num($ldapuser[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT]);
|
|
||||||
//print "xx".$datefirst."\n";
|
|
||||||
$crowid=$member->cotisation($datefirst, $price, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Insertion derni<6E>re adh<64>sion
|
|
||||||
$datelast='';
|
$datelast='';
|
||||||
if ($conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE)
|
if ($conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE)
|
||||||
{
|
{
|
||||||
$datelast=dolibarr_stringtotime($ldapuser[$conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE]);
|
$datelast=dolibarr_stringtotime($ldapuser[$conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE]);
|
||||||
|
$pricelast=price2num($ldapuser[$conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT]);
|
||||||
}
|
}
|
||||||
elseif ($conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION)
|
elseif ($conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION)
|
||||||
{
|
{
|
||||||
$datelast=dolibarr_time_plus_duree(dolibarr_stringtotime($ldapuser[$conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION]),-1,'y')+60*60*24;
|
$datelast=dolibarr_time_plus_duree(dolibarr_stringtotime($ldapuser[$conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION]),-1,'y')+60*60*24;
|
||||||
|
$pricelast=price2num($ldapuser[$conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT]);
|
||||||
|
|
||||||
|
// Cas special ou date derniere <= date premiere
|
||||||
|
if ($datefirst && $datelast && $datelast <= $datefirst)
|
||||||
|
{
|
||||||
|
// On ne va inserer que la premiere
|
||||||
|
$datelast=0;
|
||||||
|
if (! $pricefirst && $pricelast) $pricefirst = $pricelast;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Insertion premi<6D>re adh<64>sion
|
||||||
|
if ($datefirst)
|
||||||
|
{
|
||||||
|
// Cree premiere cotisation et met a jour datefin dans adherent
|
||||||
|
//print "xx".$datefirst."\n";
|
||||||
|
$crowid=$member->cotisation($datefirst, $pricefirst, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Insertion derni<6E>re adh<64>sion
|
||||||
if ($datelast)
|
if ($datelast)
|
||||||
{
|
{
|
||||||
// Cree derniere cotisation et met a jour datefin dans adherent
|
// Cree derniere cotisation et met a jour datefin dans adherent
|
||||||
$price=price2num($ldapuser[$conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT]);
|
|
||||||
//print "yy".dolibarr_print_date($datelast)."\n";
|
//print "yy".dolibarr_print_date($datelast)."\n";
|
||||||
$crowid=$member->cotisation($datelast, $price, 0);
|
$crowid=$member->cotisation($datelast, $pricelast, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user