|
@@ -57,8 +57,7 @@ require_once DOL_DOCUMENT_ROOT.'/partnership/lib/partnership.lib.php';
|
|
|
$langs->loadLangs(array("companies","members","partnership", "other"));
|
|
|
|
|
|
// Get parameters
|
|
|
-$id = GETPOST('id', 'int');
|
|
|
-$memberid = GETPOST('rowid', 'int');
|
|
|
+$id = GETPOST('rowid', 'int') ? GETPOST('rowid', 'int') : GETPOST('id', 'int');
|
|
|
$ref = GETPOST('ref', 'alpha');
|
|
|
$action = GETPOST('action', 'aZ09');
|
|
|
$confirm = GETPOST('confirm', 'alpha');
|
|
@@ -68,9 +67,9 @@ $backtopage = GETPOST('backtopage', 'alpha');
|
|
|
$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
|
|
|
//$lineid = GETPOST('lineid', 'int');
|
|
|
|
|
|
-$member = new Adherent($db);
|
|
|
-if ($memberid > 0) {
|
|
|
- $member->fetch($memberid);
|
|
|
+$object = new Adherent($db);
|
|
|
+if ($id > 0) {
|
|
|
+ $object->fetch($id);
|
|
|
}
|
|
|
|
|
|
// Initialize technical objects
|
|
@@ -112,19 +111,13 @@ if (empty($conf->partnership->enabled)) accessforbidden();
|
|
|
if (empty($permissiontoread)) accessforbidden();
|
|
|
if ($action == 'edit' && empty($permissiontoadd)) accessforbidden();
|
|
|
|
|
|
-$partnershipid = $object->fetch(0, "", $memberid);
|
|
|
-if (empty($action) && empty($partnershipid)) {
|
|
|
- $action = 'create';
|
|
|
-}
|
|
|
-if (($action == 'update' || $action == 'edit') && $object->status != $object::STATUS_DRAFT) accessforbidden();
|
|
|
-
|
|
|
-if (empty($memberid) && $object) {
|
|
|
- $memberid = $object->fk_member;
|
|
|
+if (($action == 'update' || $action == 'edit') && $object->status != $object::STATUS_DRAFT) {
|
|
|
+ accessforbidden();
|
|
|
}
|
|
|
|
|
|
|
|
|
// Security check
|
|
|
-$result = restrictedArea($user, 'adherent', $memberid, '', '', 'socid', 'rowid', 0);
|
|
|
+$result = restrictedArea($user, 'adherent', $id, '', '', 'socid', 'rowid', 0);
|
|
|
|
|
|
|
|
|
/*
|
|
@@ -143,102 +136,7 @@ $date_end = dol_mktime(0, 0, 0, GETPOST('date_partnership_endmonth', 'int'), GET
|
|
|
if (empty($reshook)) {
|
|
|
$error = 0;
|
|
|
|
|
|
- $backtopage = dol_buildpath('/partnership/partnership.php', 1).'?rowid='.($memberid > 0 ? $memberid : '__ID__');
|
|
|
-
|
|
|
- $triggermodname = 'PARTNERSHIP_MODIFY'; // Name of trigger action code to execute when we modify record
|
|
|
-
|
|
|
- if ($action == 'add' && $permissiontoread) {
|
|
|
- $error = 0;
|
|
|
-
|
|
|
- $db->begin();
|
|
|
-
|
|
|
- $now = dol_now();
|
|
|
-
|
|
|
- if (!$error) {
|
|
|
- $old_start_date = $object->date_partnership_start;
|
|
|
-
|
|
|
- $object->fk_member = $memberid;
|
|
|
- $object->date_partnership_start = (!GETPOST('date_partnership_start')) ? '' : $date_start;
|
|
|
- $object->date_partnership_end = (!GETPOST('date_partnership_end')) ? '' : $date_end;
|
|
|
- $object->note_public = GETPOST('note_public', 'restricthtml');
|
|
|
- $object->date_creation = $now;
|
|
|
- $object->fk_user_creat = $user->id;
|
|
|
- $object->entity = $conf->entity;
|
|
|
-
|
|
|
- // Fill array 'array_options' with data from add form
|
|
|
- $ret = $extrafields->setOptionalsFromPost(null, $object);
|
|
|
- if ($ret < 0) {
|
|
|
- $error++;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (!$error) {
|
|
|
- $result = $object->create($user);
|
|
|
- if ($result < 0) {
|
|
|
- $error++;
|
|
|
- if ($result == -4) {
|
|
|
- setEventMessages($langs->trans("ErrorRefAlreadyExists"), null, 'errors');
|
|
|
- } else {
|
|
|
- setEventMessages($object->error, $object->errors, 'errors');
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if ($error) {
|
|
|
- $db->rollback();
|
|
|
- $action = 'create';
|
|
|
- } else {
|
|
|
- $db->commit();
|
|
|
- }
|
|
|
- } elseif ($action == 'update' && $permissiontoread) {
|
|
|
- $error = 0;
|
|
|
-
|
|
|
- $db->begin();
|
|
|
-
|
|
|
- $now = dol_now();
|
|
|
-
|
|
|
- if (!$error) {
|
|
|
- $object->oldcopy = clone $object;
|
|
|
-
|
|
|
- $old_start_date = $object->date_partnership_start;
|
|
|
-
|
|
|
- $object->date_partnership_start = (!GETPOST('date_partnership_start')) ? '' : $date_start;
|
|
|
- $object->date_partnership_end = (!GETPOST('date_partnership_end')) ? '' : $date_end;
|
|
|
- $object->note_public = GETPOST('note_public', 'restricthtml');
|
|
|
- $object->fk_user_creat = $user->id;
|
|
|
- $object->fk_user_modif = $user->id;
|
|
|
-
|
|
|
- // Fill array 'array_options' with data from add form
|
|
|
- $ret = $extrafields->setOptionalsFromPost(null, $object);
|
|
|
- if ($ret < 0) {
|
|
|
- $error++;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (!$error) {
|
|
|
- $result = $object->update($user);
|
|
|
- if ($result < 0) {
|
|
|
- $error++;
|
|
|
- if ($result == -4) {
|
|
|
- setEventMessages($langs->trans("ErrorRefAlreadyExists"), null, 'errors');
|
|
|
- } else {
|
|
|
- setEventMessages($object->error, $object->errors, 'errors');
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if ($error) {
|
|
|
- $db->rollback();
|
|
|
- $action = 'edit';
|
|
|
- } else {
|
|
|
- $db->commit();
|
|
|
- }
|
|
|
- } elseif ($action == 'confirm_close' || $action == 'update_extras') {
|
|
|
- include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
|
|
|
-
|
|
|
- header("Location: ".$_SERVER['PHP_SELF']."?rowid=".$memberid);
|
|
|
- exit;
|
|
|
- }
|
|
|
+ $backtopage = dol_buildpath('/partnership/partnership.php', 1).'?rowid='.($id > 0 ? $id : '__ID__');
|
|
|
|
|
|
// Actions when linking object each other
|
|
|
include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
|
|
@@ -261,11 +159,11 @@ llxHeader('', $title);
|
|
|
|
|
|
$form = new Form($db);
|
|
|
|
|
|
-if ($memberid) {
|
|
|
+if ($id > 0) {
|
|
|
$langs->load("members");
|
|
|
|
|
|
- $member = new Adherent($db);
|
|
|
- $result = $member->fetch($memberid);
|
|
|
+ $object = new Adherent($db);
|
|
|
+ $result = $object->fetch($id);
|
|
|
|
|
|
if (!empty($conf->notification->enabled)) {
|
|
|
$langs->load("mails");
|
|
@@ -273,13 +171,13 @@ if ($memberid) {
|
|
|
|
|
|
$adht->fetch($object->typeid);
|
|
|
|
|
|
- $head = member_prepare_head($member);
|
|
|
+ $head = member_prepare_head($object);
|
|
|
|
|
|
print dol_get_fiche_head($head, 'partnership', $langs->trans("ThirdParty"), -1, 'user');
|
|
|
|
|
|
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
|
|
|
|
|
- dol_banner_tab($member, 'rowid', $linkback);
|
|
|
+ dol_banner_tab($object, 'rowid', $linkback);
|
|
|
|
|
|
print '<div class="fichecenter">';
|
|
|
|
|
@@ -288,21 +186,21 @@ if ($memberid) {
|
|
|
|
|
|
// Login
|
|
|
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
|
|
|
- print '<tr><td class="titlefield">'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.$member->login.' </td></tr>';
|
|
|
+ print '<tr><td class="titlefield">'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.$object->login.' </td></tr>';
|
|
|
}
|
|
|
|
|
|
// Type
|
|
|
print '<tr><td class="titlefield">'.$langs->trans("Type").'</td><td class="valeur">'.$adht->getNomUrl(1)."</td></tr>\n";
|
|
|
|
|
|
// Morphy
|
|
|
- print '<tr><td>'.$langs->trans("MemberNature").'</td><td class="valeur" >'.$member->getmorphylib().'</td>';
|
|
|
+ print '<tr><td>'.$langs->trans("MemberNature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>';
|
|
|
print '</tr>';
|
|
|
|
|
|
// Company
|
|
|
- print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$member->company.'</td></tr>';
|
|
|
+ print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$object->company.'</td></tr>';
|
|
|
|
|
|
// Civility
|
|
|
- print '<tr><td>'.$langs->trans("UserTitle").'</td><td class="valeur">'.$member->getCivilityLabel().' </td>';
|
|
|
+ print '<tr><td>'.$langs->trans("UserTitle").'</td><td class="valeur">'.$object->getCivilityLabel().' </td>';
|
|
|
print '</tr>';
|
|
|
|
|
|
print '</table>';
|
|
@@ -310,226 +208,84 @@ if ($memberid) {
|
|
|
print '</div>';
|
|
|
|
|
|
print dol_get_fiche_end();
|
|
|
-
|
|
|
- $params = '';
|
|
|
-
|
|
|
- print '<br>';
|
|
|
} else {
|
|
|
dol_print_error('', 'Parameter rowid not defined');
|
|
|
}
|
|
|
|
|
|
-// Part to create
|
|
|
-if ($action == 'create') {
|
|
|
- print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("Partnership")), '', '');
|
|
|
-
|
|
|
- $backtopageforcancel = DOL_URL_ROOT.'/partnership/partnership.php?rowid='.$memberid;
|
|
|
-
|
|
|
- print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
|
|
- print '<input type="hidden" name="token" value="'.newToken().'">';
|
|
|
- print '<input type="hidden" name="action" value="add">';
|
|
|
- print '<input type="hidden" name="rowid" value="'.$memberid.'">';
|
|
|
- print '<input type="hidden" name="fk_member" value="'.$memberid.'">';
|
|
|
-
|
|
|
- if ($backtopage) {
|
|
|
- print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
|
|
- }
|
|
|
- if ($backtopageforcancel) {
|
|
|
- print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
|
|
|
- }
|
|
|
-
|
|
|
- print dol_get_fiche_head(array(), '');
|
|
|
-
|
|
|
- print '<table class="border centpercent tableforfieldcreate">'."\n";
|
|
|
-
|
|
|
- // Common attributes
|
|
|
- include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php';
|
|
|
-
|
|
|
- // Other attributes
|
|
|
- include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
|
|
|
-
|
|
|
- print '</table>'."\n";
|
|
|
-
|
|
|
- print dol_get_fiche_end();
|
|
|
-
|
|
|
- print '<div class="center">';
|
|
|
- print '<input type="submit" class="button" name="add" value="'.dol_escape_htmltag($langs->trans("Validate")).'">';
|
|
|
- print ' ';
|
|
|
- // print '<input type="'.($backtopage ? "submit" : "button").'" class="button button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'"'.($backtopage ? '' : ' onclick="javascript:history.go(-1)"').'>'; // Cancel for create does not post form if we don't know the backtopage
|
|
|
- print '</div>';
|
|
|
-
|
|
|
- print '</form>';
|
|
|
-}
|
|
|
-
|
|
|
-// Part to edit record
|
|
|
-if (($partnershipid || $ref) && $action == 'edit') {
|
|
|
- print load_fiche_titre($langs->trans("Partnership"), '', '');
|
|
|
-
|
|
|
- $backtopageforcancel = DOL_URL_ROOT.'/partnership/partnership.php?rowid='.$memberid;
|
|
|
-
|
|
|
- print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
|
|
- print '<input type="hidden" name="token" value="'.newToken().'">';
|
|
|
- print '<input type="hidden" name="action" value="update">';
|
|
|
- print '<input type="hidden" name="rowid" value="'.$memberid.'">';
|
|
|
- print '<input type="hidden" name="fk_member" value="'.$memberid.'">';
|
|
|
- if ($backtopage) {
|
|
|
- print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
|
|
- }
|
|
|
- if ($backtopageforcancel) {
|
|
|
- print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
|
|
|
- }
|
|
|
-
|
|
|
- print dol_get_fiche_head();
|
|
|
-
|
|
|
- print '<table class="border centpercent tableforfieldedit">'."\n";
|
|
|
-
|
|
|
- // Common attributes
|
|
|
- include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php';
|
|
|
-
|
|
|
- // Other attributes
|
|
|
- include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php';
|
|
|
-
|
|
|
- print '</table>';
|
|
|
-
|
|
|
- print dol_get_fiche_end();
|
|
|
-
|
|
|
- print '<div class="center"><input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
|
|
|
- print ' <input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
|
|
|
- print '</div>';
|
|
|
-
|
|
|
- print '</form>';
|
|
|
-}
|
|
|
|
|
|
// Part to show record
|
|
|
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
|
|
|
- print load_fiche_titre($langs->trans("PartnershipDedicatedToThisMember", $langs->transnoentitiesnoconv("Partnership")), '', '');
|
|
|
-
|
|
|
- $res = $object->fetch_optionals();
|
|
|
-
|
|
|
- // $head = partnershipPrepareHead($object);
|
|
|
- // print dol_get_fiche_head($head, 'card', $langs->trans("Partnership"), -1, $object->picto);
|
|
|
-
|
|
|
- $linkback = '';
|
|
|
- dol_banner_tab($object, 'id', $linkback, 0, 'rowid', 'ref');
|
|
|
-
|
|
|
- $formconfirm = '';
|
|
|
-
|
|
|
- // Close confirmation
|
|
|
- if ($action == 'close') {
|
|
|
- // Create an array for form
|
|
|
- $formquestion = array();
|
|
|
- $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClose'), $langs->trans('ConfirmClosePartnershipAsk', $object->ref), 'confirm_close', $formquestion, 'yes', 1);
|
|
|
- }
|
|
|
- // Reopon confirmation
|
|
|
- if ($action == 'reopen') {
|
|
|
- // Create an array for form
|
|
|
- $formquestion = array();
|
|
|
- $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToReopon'), $langs->trans('ConfirmReoponAsk', $object->ref), 'confirm_reopen', $formquestion, 'yes', 1);
|
|
|
- }
|
|
|
-
|
|
|
- // Refuse confirmatio
|
|
|
- if ($action == 'refuse') {
|
|
|
- //Form to close proposal (signed or not)
|
|
|
- $formquestion = array(
|
|
|
- array('type' => 'text', 'name' => 'reason_decline_or_cancel', 'label' => $langs->trans("Note"), 'morecss' => 'reason_decline_or_cancel', 'value' => '') // Field to complete private note (not replace)
|
|
|
- );
|
|
|
-
|
|
|
- $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ReasonDecline'), $text, 'confirm_refuse', $formquestion, '', 1, 250);
|
|
|
- }
|
|
|
-
|
|
|
- // Call Hook formConfirm
|
|
|
- $parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid);
|
|
|
- $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
|
|
- if (empty($reshook)) {
|
|
|
- $formconfirm .= $hookmanager->resPrint;
|
|
|
- } elseif ($reshook > 0) {
|
|
|
- $formconfirm = $hookmanager->resPrint;
|
|
|
- }
|
|
|
-
|
|
|
- // Print form confirm
|
|
|
- print $formconfirm;
|
|
|
-
|
|
|
-
|
|
|
- // TODO Replace this card into a list of all partnerships.
|
|
|
-
|
|
|
-
|
|
|
- // Object card
|
|
|
- // ------------------------------------------------------------
|
|
|
- $linkback = '<a href="'.dol_buildpath('/partnership/partnership_list.php', 1).'?restore_lastsearch_values=1'.(!empty($memberid) ? '&rowid='.$memberid : '').'">'.$langs->trans("BackToList").'</a>';
|
|
|
+ // Buttons for actions
|
|
|
|
|
|
- print '<div class="fichecenter">';
|
|
|
- print '<div class="fichehalfleft">';
|
|
|
- print '<div class="underbanner clearboth"></div>';
|
|
|
- print '<table class="border centpercent tableforfield">'."\n";
|
|
|
-
|
|
|
- // Common attributes
|
|
|
- //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field
|
|
|
- //unset($object->fields['fk_project']); // Hide field already shown in banner
|
|
|
- //unset($object->fields['fk_member']); // Hide field already shown in banner
|
|
|
- include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
|
|
|
-
|
|
|
- // End of subscription date
|
|
|
- $fadherent = new Adherent($db);
|
|
|
- $fadherent->fetch($object->fk_member);
|
|
|
- print '<tr><td>'.$langs->trans("SubscriptionEndDate").'</td><td class="valeur">';
|
|
|
- if ($fadherent->datefin) {
|
|
|
- print dol_print_date($fadherent->datefin, 'day');
|
|
|
- if ($fadherent->hasDelay()) {
|
|
|
- print " ".img_warning($langs->trans("Late"));
|
|
|
+ if ($action != 'presend') {
|
|
|
+ print '<div class="tabsAction">'."\n";
|
|
|
+ $parameters = array();
|
|
|
+ $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
|
|
+ if ($reshook < 0) {
|
|
|
+ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
|
|
}
|
|
|
- } else {
|
|
|
- if (!$adht->subscription) {
|
|
|
- print $langs->trans("SubscriptionNotRecorded");
|
|
|
- if ($fadherent->statut > 0) {
|
|
|
- print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled
|
|
|
- }
|
|
|
- } else {
|
|
|
- print $langs->trans("SubscriptionNotReceived");
|
|
|
- if ($fadherent->statut > 0) {
|
|
|
- print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled
|
|
|
+
|
|
|
+ if (empty($reshook)) {
|
|
|
+ // Show
|
|
|
+ if ($permissiontoadd) {
|
|
|
+ print dolGetButtonAction($langs->trans('AddPartnership'), '', 'default', DOL_URL_ROOT.'/partnership/partnership_card.php?action=create&fk_member='.$object->id.'&backtopage='.urlencode(DOL_URL_ROOT.'/adherents/partnership.php?id='.$object->id), '', $permissiontoadd);
|
|
|
}
|
|
|
}
|
|
|
+ print '</div>'."\n";
|
|
|
}
|
|
|
- print '</td></tr>';
|
|
|
|
|
|
- // Other attributes. Fields from hook formObjectOptions and Extrafields.
|
|
|
- include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
|
|
|
|
|
- print '</table>';
|
|
|
- print '</div>';
|
|
|
+ //$morehtmlright = 'partnership/partnership_card.php?action=create&backtopage=%2Fdolibarr%2Fhtdocs%2Fpartnership%2Fpartnership_list.php';
|
|
|
+ $morehtmlright = '';
|
|
|
|
|
|
- print '<div class="clearboth"></div>';
|
|
|
+ print load_fiche_titre($langs->trans("PartnershipDedicatedToThisMember", $langs->transnoentitiesnoconv("Partnership")), $morehtmlright, '');
|
|
|
|
|
|
- print dol_get_fiche_end();
|
|
|
+ $memberid = $object->id;
|
|
|
|
|
|
|
|
|
+ // TODO Replace this card with the list of all partnerships.
|
|
|
|
|
|
+ $object = new Partnership($db);
|
|
|
+ $partnershipid = $object->fetch(0, "", $memberid);
|
|
|
|
|
|
- // Buttons for actions
|
|
|
+ if ($partnershipid > 0) {
|
|
|
+ print '<div class="fichecenter">';
|
|
|
+ print '<div class="fichehalfleft">';
|
|
|
+ print '<div class="underbanner clearboth"></div>';
|
|
|
+ print '<table class="border centpercent tableforfield">'."\n";
|
|
|
|
|
|
- if ($action != 'presend') {
|
|
|
- print '<div class="tabsAction">'."\n";
|
|
|
- $parameters = array();
|
|
|
- $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
|
|
- if ($reshook < 0) {
|
|
|
- setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
|
|
- }
|
|
|
+ // Common attributes
|
|
|
+ //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field
|
|
|
+ //unset($object->fields['fk_project']); // Hide field already shown in banner
|
|
|
+ //unset($object->fields['fk_member']); // Hide field already shown in banner
|
|
|
+ include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
|
|
|
|
|
|
- if (empty($reshook)) {
|
|
|
- // Show
|
|
|
- if ($permissiontoadd) {
|
|
|
- print dolGetButtonAction($langs->trans('ManagePartnership'), '', 'default', dol_buildpath('/partnership/partnership_card.php', 1).'?id='.$object->id, '', $permissiontoadd);
|
|
|
+ // End of subscription date
|
|
|
+ $fadherent = new Adherent($db);
|
|
|
+ $fadherent->fetch($object->fk_member);
|
|
|
+ print '<tr><td>'.$langs->trans("SubscriptionEndDate").'</td><td class="valeur">';
|
|
|
+ if ($fadherent->datefin) {
|
|
|
+ print dol_print_date($fadherent->datefin, 'day');
|
|
|
+ if ($fadherent->hasDelay()) {
|
|
|
+ print " ".img_warning($langs->trans("Late"));
|
|
|
}
|
|
|
-
|
|
|
- // Cancel
|
|
|
- /*
|
|
|
- if ($permissiontoadd) {
|
|
|
- if ($object->status == $object::STATUS_ACCEPTED) {
|
|
|
- print dolGetButtonAction($langs->trans('Cancel'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=close&token='.newToken(), '', $permissiontoadd);
|
|
|
+ } else {
|
|
|
+ if (!$adht->subscription) {
|
|
|
+ print $langs->trans("SubscriptionNotRecorded");
|
|
|
+ if ($fadherent->statut > 0) {
|
|
|
+ print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ print $langs->trans("SubscriptionNotReceived");
|
|
|
+ if ($fadherent->statut > 0) {
|
|
|
+ print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled
|
|
|
}
|
|
|
}
|
|
|
- */
|
|
|
}
|
|
|
- print '</div>'."\n";
|
|
|
+ print '</td></tr>';
|
|
|
+
|
|
|
+ print '</table>';
|
|
|
+ print '</div>';
|
|
|
}
|
|
|
}
|
|
|
|