diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 9b28cc6473e..6235ea1fa5b 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -937,17 +937,14 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { document.formsoc.action.value="create"; document.formsoc.submit(); }); - function initfieldrequired() - { + function initfieldrequired() { jQuery("#tdcompany").removeClass("fieldrequired"); jQuery("#tdlastname").removeClass("fieldrequired"); jQuery("#tdfirstname").removeClass("fieldrequired"); - if (jQuery("#morphy").val() == \'mor\') - { + if (jQuery("#morphy").val() == \'mor\') { jQuery("#tdcompany").addClass("fieldrequired"); } - if (jQuery("#morphy").val() == \'phy\') - { + if (jQuery("#morphy").val() == \'phy\') { jQuery("#tdlastname").addClass("fieldrequired"); jQuery("#tdfirstname").addClass("fieldrequired"); } @@ -1167,17 +1164,14 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { document.formsoc.action.value="edit"; document.formsoc.submit(); }); - function initfieldrequired() - { + function initfieldrequired() { jQuery("#tdcompany").removeClass("fieldrequired"); jQuery("#tdlastname").removeClass("fieldrequired"); jQuery("#tdfirstname").removeClass("fieldrequired"); - if (jQuery("#morphy").val() == \'mor\') - { + if (jQuery("#morphy").val() == \'mor\') { jQuery("#tdcompany").addClass("fieldrequired"); } - if (jQuery("#morphy").val() == \'phy\') - { + if (jQuery("#morphy").val() == \'phy\') { jQuery("#tdlastname").addClass("fieldrequired"); jQuery("#tdfirstname").addClass("fieldrequired"); } @@ -1747,12 +1741,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print $langs->trans("SubscriptionNotNeeded"); } elseif (!$adht->subscription) { print $langs->trans("SubscriptionNotRecorded"); - if ($object->statut > 0) { + if (Adherent::STATUS_VALIDATED == $object->statut) { print " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft, not excluded and not resiliated } } else { print $langs->trans("SubscriptionNotReceived"); - if ($object->statut > 0) { + if (Adherent::STATUS_VALIDATED == $object->statut) { print " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft, not excluded and not resiliated } } @@ -1862,7 +1856,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if ($action != 'editlogin' && $action != 'editthirdparty') { // Send if (empty($user->socid)) { - if ($object->statut == 1) { + if (Adherent::STATUS_VALIDATED == $object->statut) { print '
'.$langs->trans('SendMail').'
'."\n"; } } @@ -1870,20 +1864,14 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Send card by email // TODO Remove this to replace with a template /* - if ($user->rights->adherent->creer) - { - if ($object->statut >= 1) - { + if ($user->rights->adherent->creer) { + if (Adherent::STATUS_VALIDATED == $object->statut) { if ($object->email) print '
'.$langs->trans("SendCardByMail")."
\n"; else print '
'.$langs->trans("SendCardByMail")."
\n"; - } - else - { + } else { print '
'.$langs->trans("SendCardByMail")."
"; } - } - else - { + } else { print '
'.$langs->trans("SendCardByMail")."
"; }*/ @@ -1895,7 +1883,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Validate - if ($object->statut == -1) { + if (Adherent::STATUS_DRAFT == $object->statut) { if ($user->rights->adherent->creer) { print '
'.$langs->trans("Validate").'
'."\n"; } else { @@ -1904,7 +1892,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Reactivate - if ($object->statut == 0 || $object->statut == -2) { + if (Adherent::STATUS_RESILIATED == $object->statut || Adherent::STATUS_EXCLUDED == $Object->statut) { if ($user->rights->adherent->creer) { print '
'.$langs->trans("Reenable")."
\n"; } else { @@ -1913,7 +1901,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Resiliate - if ($object->statut >= 1) { + if (Adherent::STATUS_VALIDATED == $object->statut) { if ($user->rights->adherent->supprimer) { print '
'.$langs->trans("Resiliate")."
\n"; } else { @@ -1922,7 +1910,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Exclude - if ($object->statut >= 1) { + if (Adherent::STATUS_VALIDATED == $object->statut) { if ($user->rights->adherent->supprimer) { print '
'.$langs->trans("Exclude")."
\n"; } else { @@ -1933,7 +1921,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Create third party if (!empty($conf->societe->enabled) && !$object->socid) { if ($user->rights->societe->creer) { - if ($object->statut != -1) { + if (Adherent::STATUS_DRAFT != $object->statut) { print '
'.$langs->trans("CreateDolibarrThirdParty").'
'."\n";; } else { print '
'.$langs->trans("CreateDolibarrThirdParty").'
'."\n"; @@ -1946,7 +1934,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Create user if (!$user->socid && !$object->user_id) { if ($user->rights->user->user->creer) { - if ($object->statut != -1) { + if (Adherent::STATUS_DRAFT != $object->statut) { print '
'.$langs->trans("CreateDolibarrLogin").'
'."\n"; } else { print '
'.$langs->trans("CreateDolibarrLogin").'
'."\n"; @@ -2010,7 +1998,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Show links to link elements /*$linktoelem = $form->showLinkToObjectBlock($object,array('order')); - if ($linktoelem) print ($somethingshown?'':'
').$linktoelem; + if ($linktoelem) { + print ($somethingshown?'':'
').$linktoelem; + } */ // Show online payment link