';
+print '
';
+print '
';
- print '
';
- print '
';
+print '';
+print '';
- // Login
- if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
- print ''.$langs->trans("Login").' / '.$langs->trans("Id").' | '.dol_escape_htmltag($object->login).' |
';
- }
+// Login
+if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
+ print ''.$langs->trans("Login").' / '.$langs->trans("Id").' | '.dol_escape_htmltag($object->login).' |
';
+}
- // Type
- print ''.$langs->trans("Type").' | ';
- print ''.$adht->getNomUrl(1)." |
\n";
+// Type
+print ''.$langs->trans("Type").' | ';
+print ''.$adht->getNomUrl(1)." |
\n";
- // Morphy
- print ''.$langs->trans("MemberNature").' | ';
- print ''.$object->getmorphylib('', 1).' | ';
- print '
';
+// Morphy
+print ''.$langs->trans("MemberNature").' | ';
+print ''.$object->getmorphylib('', 1).' | ';
+print '
';
- // Company
- print ''.$langs->trans("Company").' | '.dol_escape_htmltag($object->company).' |
';
+// Company
+print ''.$langs->trans("Company").' | '.dol_escape_htmltag($object->company).' |
';
- // Civility
- print ''.$langs->trans("UserTitle").' | '.$object->getCivilityLabel().' | ';
- print '
';
+// Civility
+print ''.$langs->trans("UserTitle").' | '.$object->getCivilityLabel().' | ';
+print '
';
- // Password
- if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
- print ''.$langs->trans("Password").' | ';
- if ($object->pass) {
- print preg_replace('/./i', '*', $object->pass);
- } else {
- if ($user->admin) {
- print '';
- }
- print ''.$langs->trans("Hidden").'';
- }
- if (!empty($object->pass_indatabase) && empty($object->user_id)) { // Show warning only for old password still in clear (does not happen anymore)
- $langs->load("errors");
- $htmltext = $langs->trans("WarningPasswordSetWithNoAccount");
- print ' '.$form->textwithpicto('', $htmltext, 1, 'warning');
+// Password
+if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
+ print ' |
'.$langs->trans("Password").' | ';
+ if ($object->pass) {
+ print preg_replace('/./i', '*', $object->pass);
+ } else {
+ if ($user->admin) {
+ print '';
}
- print ' |
';
+ print ''.$langs->trans("Hidden").'';
+ }
+ if (!empty($object->pass_indatabase) && empty($object->user_id)) { // Show warning only for old password still in clear (does not happen anymore)
+ $langs->load("errors");
+ $htmltext = $langs->trans("WarningPasswordSetWithNoAccount");
+ print ' '.$form->textwithpicto('', $htmltext, 1, 'warning');
}
+ print '';
+}
- // Date end subscription
- print ''.$langs->trans("SubscriptionEndDate").' | ';
- if ($object->datefin) {
- print dol_print_date($object->datefin, 'day');
- if ($object->hasDelay()) {
- print " ".img_warning($langs->trans("Late"));
+// Date end subscription
+print ' |
'.$langs->trans("SubscriptionEndDate").' | ';
+if ($object->datefin) {
+ print dol_print_date($object->datefin, 'day');
+ if ($object->hasDelay()) {
+ print " ".img_warning($langs->trans("Late"));
+ }
+} else {
+ if ($object->need_subscription == 0) {
+ print $langs->trans("SubscriptionNotNeeded");
+ } elseif (!$adht->subscription) {
+ print $langs->trans("SubscriptionNotRecorded");
+ 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 {
- if ($object->need_subscription == 0) {
- print $langs->trans("SubscriptionNotNeeded");
- } elseif (!$adht->subscription) {
- print $langs->trans("SubscriptionNotRecorded");
- 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 (Adherent::STATUS_VALIDATED == $object->statut) {
- print " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft, not excluded and not resiliated
- }
+ print $langs->trans("SubscriptionNotReceived");
+ 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
}
}
- print ' |
';
+}
+print '';
- print '
';
+print '
';
- print '
';
+print '
';
- print '
';
- print '
';
+print '
';
+print '
';
- print '
';
+print '';
- // Tags / Categories
- if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) {
- print ''.$langs->trans("Categories").' | ';
- print '';
- print $form->showCategories($object->id, Categorie::TYPE_MEMBER, 1);
- print ' |
';
- }
+// Tags / Categories
+if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) {
+ print ''.$langs->trans("Categories").' | ';
+ print '';
+ print $form->showCategories($object->id, Categorie::TYPE_MEMBER, 1);
+ print ' |
';
+}
- // Birth Date
- print ''.$langs->trans("DateOfBirth").' | '.dol_print_date($object->birth, 'day').' |
';
-
- // Default language
- if (getDolGlobalInt('MAIN_MULTILANGS')) {
- require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
- print ''.$langs->trans("DefaultLang").' | ';
- //$s=picto_from_langcode($object->default_lang);
- //print ($s?$s.' ':'');
- $langs->load("languages");
- $labellang = ($object->default_lang ? $langs->trans('Language_'.$object->default_lang) : '');
- print picto_from_langcode($object->default_lang, 'class="paddingrightonly saturatemedium opacitylow"');
- print $labellang;
- print ' |
';
- }
+// Birth Date
+print ''.$langs->trans("DateOfBirth").' | '.dol_print_date($object->birth, 'day').' |
';
+
+// Default language
+if (getDolGlobalInt('MAIN_MULTILANGS')) {
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
+ print ''.$langs->trans("DefaultLang").' | ';
+ //$s=picto_from_langcode($object->default_lang);
+ //print ($s?$s.' ':'');
+ $langs->load("languages");
+ $labellang = ($object->default_lang ? $langs->trans('Language_'.$object->default_lang) : '');
+ print picto_from_langcode($object->default_lang, 'class="paddingrightonly saturatemedium opacitylow"');
+ print $labellang;
+ print ' |
';
+}
- // Public
- print ''.$langs->trans("Public").' | '.yn($object->public).' |
';
+// Public
+print ''.$langs->trans("Public").' | '.yn($object->public).' |
';
- // Other attributes
- $cols = 2;
- include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
+// Other attributes
+$cols = 2;
+include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
- // Third party Dolibarr
- if (isModEnabled('societe')) {
- print '';
- print '';
- print ' | ';
- if ($action == 'editthirdparty') {
- $htmlname = 'socid';
- print '';
- } else {
- if ($object->fk_soc) {
- $company = new Societe($db);
- $result = $company->fetch($object->fk_soc);
- print $company->getNomUrl(1);
-
- // Show link to invoices
- $tmparray = $company->getOutstandingBills('customer');
- if (!empty($tmparray['refs'])) {
- print ' - '.img_picto($langs->trans("Invoices"), 'bill', 'class="paddingright"').''.$langs->trans("Invoices").' ('.count($tmparray['refs']).')';
- // TODO Add alert if warning on at least one invoice late
- print '';
- }
- } else {
- print ''.$langs->trans("NoThirdPartyAssociatedToMember").'';
- }
- }
- print ' |
';
- }
-
- // Login Dolibarr - Link to user
+// Third party Dolibarr
+if (isModEnabled('societe')) {
print '';
print '';
print ' | ';
- if ($action == 'editlogin') {
- $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'userid', '');
+ if ($action == 'editthirdparty') {
+ $htmlname = 'socid';
+ print '';
} else {
- if ($object->user_id) {
- $linkeduser = new User($db);
- $linkeduser->fetch($object->user_id);
- print $linkeduser->getNomUrl(-1);
+ if ($object->fk_soc) {
+ $company = new Societe($db);
+ $result = $company->fetch($object->fk_soc);
+ print $company->getNomUrl(1);
+
+ // Show link to invoices
+ $tmparray = $company->getOutstandingBills('customer');
+ if (!empty($tmparray['refs'])) {
+ print ' - '.img_picto($langs->trans("Invoices"), 'bill', 'class="paddingright"').''.$langs->trans("Invoices").' ('.count($tmparray['refs']).')';
+ // TODO Add alert if warning on at least one invoice late
+ print '';
+ }
} else {
- print ''.$langs->trans("NoDolibarrAccess").'';
+ print ''.$langs->trans("NoThirdPartyAssociatedToMember").'';
}
}
print ' |
';
+}
- print "
\n";
+// Login Dolibarr - Link to user
+print '';
+print '';
+print $langs->trans("LinkedToDolibarrUser");
+print ' | ';
+if ($action != 'editlogin' && $user->hasRight('adherent', 'creer')) {
+ print '';
+ if ($user->hasRight("user", "user", "creer")) {
+ print 'id.'">'.img_edit($langs->trans('SetLinkToUser'), 1).'';
+ }
+ print ' | ';
+}
+print ' ';
+print ' | ';
+if ($action == 'editlogin') {
+ $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'userid', '');
+} else {
+ if ($object->user_id) {
+ $linkeduser = new User($db);
+ $linkeduser->fetch($object->user_id);
+ print $linkeduser->getNomUrl(-1);
+ } else {
+ print ''.$langs->trans("NoDolibarrAccess").'';
+ }
+}
+print ' |
';
- print "\n";
- print '';
+print "
\n";
- print dol_get_fiche_end();
+print "
\n";
+print '
';
+print dol_get_fiche_end();
- /*
- * Action bar
- */
- // Button to create a new subscription if member no draft (-1) neither resiliated (0) neither excluded (-2)
- if ($user->hasRight('adherent', 'cotisation', 'creer')) {
- if ($action != 'addsubscription' && $action != 'create_thirdparty') {
- print '
';
+/*
+ * Action bar
+ */
- if ($object->statut > 0) {
- print '
";
- } else {
- print '
';
- }
+// Button to create a new subscription if member no draft (-1) neither resiliated (0) neither excluded (-2)
+if ($user->hasRight('adherent', 'cotisation', 'creer')) {
+ if ($action != 'addsubscription' && $action != 'create_thirdparty') {
+ print '
';
- print '
';
+ if ($object->statut > 0) {
+ print '
";
+ } else {
+ print '
';
}
- }
- /*
- * List of subscriptions
- */
- if ($action != 'addsubscription' && $action != 'create_thirdparty') {
- $sql = "SELECT d.rowid, d.firstname, d.lastname, d.societe, d.fk_adherent_type as type,";
- $sql .= " c.rowid as crowid, c.subscription,";
- $sql .= " c.datec, c.fk_type as cfk_type,";
- $sql .= " c.dateadh as dateh,";
- $sql .= " c.datef,";
- $sql .= " c.fk_bank,";
- $sql .= " b.rowid as bid,";
- $sql .= " ba.rowid as baid, ba.label, ba.bank, ba.ref, ba.account_number, ba.fk_accountancy_journal, ba.number, ba.currency_code";
- $sql .= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."subscription as c";
- $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON c.fk_bank = b.rowid";
- $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid";
- $sql .= " WHERE d.rowid = c.fk_adherent AND d.rowid=".((int) $rowid);
- $sql .= $db->order($sortfield, $sortorder);
-
- $result = $db->query($sql);
- if ($result) {
- $subscriptionstatic = new Subscription($db);
-
- $num = $db->num_rows($result);
-
- print '
'."\n";
-
- print '';
- print_liste_field_titre('Ref', $_SERVER["PHP_SELF"], 'c.rowid', '', $param, '', $sortfield, $sortorder);
- print_liste_field_titre('DateCreation', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center ');
- print_liste_field_titre('Type', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center ');
- print_liste_field_titre('DateStart', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center ');
- print_liste_field_titre('DateEnd', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center ');
- print_liste_field_titre('Amount', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right ');
- if (isModEnabled('banque')) {
- print_liste_field_titre('Account', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right ');
- }
- print "
\n";
+ print '';
+ }
+}
- $accountstatic = new Account($db);
- $adh = new Adherent($db);
- $adht = new AdherentType($db);
+/*
+ * List of subscriptions
+ */
+if ($action != 'addsubscription' && $action != 'create_thirdparty') {
+ $sql = "SELECT d.rowid, d.firstname, d.lastname, d.societe, d.fk_adherent_type as type,";
+ $sql .= " c.rowid as crowid, c.subscription,";
+ $sql .= " c.datec, c.fk_type as cfk_type,";
+ $sql .= " c.dateadh as dateh,";
+ $sql .= " c.datef,";
+ $sql .= " c.fk_bank,";
+ $sql .= " b.rowid as bid,";
+ $sql .= " ba.rowid as baid, ba.label, ba.bank, ba.ref, ba.account_number, ba.fk_accountancy_journal, ba.number, ba.currency_code";
+ $sql .= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."subscription as c";
+ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON c.fk_bank = b.rowid";
+ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid";
+ $sql .= " WHERE d.rowid = c.fk_adherent AND d.rowid=".((int) $rowid);
+ $sql .= $db->order($sortfield, $sortorder);
+
+ $result = $db->query($sql);
+ if ($result) {
+ $subscriptionstatic = new Subscription($db);
+
+ $num = $db->num_rows($result);
+
+ print ''."\n";
+
+ print '';
+ print_liste_field_titre('Ref', $_SERVER["PHP_SELF"], 'c.rowid', '', $param, '', $sortfield, $sortorder);
+ print_liste_field_titre('DateCreation', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center ');
+ print_liste_field_titre('Type', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center ');
+ print_liste_field_titre('DateStart', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center ');
+ print_liste_field_titre('DateEnd', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center ');
+ print_liste_field_titre('Amount', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right ');
+ if (isModEnabled('banque')) {
+ print_liste_field_titre('Account', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right ');
+ }
+ print "
\n";
- $i = 0;
- while ($i < $num) {
- $objp = $db->fetch_object($result);
+ $accountstatic = new Account($db);
+ $adh = new Adherent($db);
+ $adht = new AdherentType($db);
- $adh->id = $objp->rowid;
- $adh->typeid = $objp->type;
+ $i = 0;
+ while ($i < $num) {
+ $objp = $db->fetch_object($result);
- $subscriptionstatic->ref = $objp->crowid;
- $subscriptionstatic->id = $objp->crowid;
+ $adh->id = $objp->rowid;
+ $adh->typeid = $objp->type;
- $typeid = $objp->cfk_type;
- if ($typeid > 0) {
- $adht->fetch($typeid);
- }
+ $subscriptionstatic->ref = $objp->crowid;
+ $subscriptionstatic->id = $objp->crowid;
- print '';
- print ''.$subscriptionstatic->getNomUrl(1).' | ';
- print ''.dol_print_date($db->jdate($objp->datec), 'dayhour')." | \n";
- print '';
- if ($typeid > 0) {
- print $adht->getNomUrl(1);
- }
- print ' | ';
- print ''.dol_print_date($db->jdate($objp->dateh), 'day')." | \n";
- print ''.dol_print_date($db->jdate($objp->datef), 'day')." | \n";
- print ''.price($objp->subscription).' | ';
- if (isModEnabled('banque')) {
- print '';
- if ($objp->bid) {
- $accountstatic->label = $objp->label;
- $accountstatic->id = $objp->baid;
- $accountstatic->number = $objp->number;
- $accountstatic->account_number = $objp->account_number;
- $accountstatic->currency_code = $objp->currency_code;
-
- if (isModEnabled('accounting') && $objp->fk_accountancy_journal > 0) {
- $accountingjournal = new AccountingJournal($db);
- $accountingjournal->fetch($objp->fk_accountancy_journal);
-
- $accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1, '', 1);
- }
+ $typeid = $objp->cfk_type;
+ if ($typeid > 0) {
+ $adht->fetch($typeid);
+ }
- $accountstatic->ref = $objp->ref;
- print $accountstatic->getNomUrl(1);
- } else {
- print ' ';
- }
- print ' | ';
- }
- print "
";
- $i++;
+ print '';
+ print ''.$subscriptionstatic->getNomUrl(1).' | ';
+ print ''.dol_print_date($db->jdate($objp->datec), 'dayhour')." | \n";
+ print '';
+ if ($typeid > 0) {
+ print $adht->getNomUrl(1);
}
+ print ' | ';
+ print ''.dol_print_date($db->jdate($objp->dateh), 'day')." | \n";
+ print ''.dol_print_date($db->jdate($objp->datef), 'day')." | \n";
+ print ''.price($objp->subscription).' | ';
+ if (isModEnabled('banque')) {
+ print '';
+ if ($objp->bid) {
+ $accountstatic->label = $objp->label;
+ $accountstatic->id = $objp->baid;
+ $accountstatic->number = $objp->number;
+ $accountstatic->account_number = $objp->account_number;
+ $accountstatic->currency_code = $objp->currency_code;
+
+ if (isModEnabled('accounting') && $objp->fk_accountancy_journal > 0) {
+ $accountingjournal = new AccountingJournal($db);
+ $accountingjournal->fetch($objp->fk_accountancy_journal);
+
+ $accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1, '', 1);
+ }
- if (empty($num)) {
- $colspan = 6;
- if (isModEnabled('banque')) {
- $colspan++;
+ $accountstatic->ref = $objp->ref;
+ print $accountstatic->getNomUrl(1);
+ } else {
+ print ' ';
}
- print ' |
'.$langs->trans("None").' |
';
+ print '';
}
-
- print "
";
- } else {
- dol_print_error($db);
+ print "";
+ $i++;
}
- }
+ if (empty($num)) {
+ $colspan = 6;
+ if (isModEnabled('banque')) {
+ $colspan++;
+ }
+ print ''.$langs->trans("None").' |
';
+ }
- if (($action != 'addsubscription' && $action != 'create_thirdparty')) {
- // Shon online payment link
- $useonlinepayment = (isModEnabled('paypal') || isModEnabled('stripe') || isModEnabled('paybox'));
+ print "
";
+ } else {
+ dol_print_error($db);
+ }
+}
- if ($useonlinepayment) {
- print '
';
- require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
- print showOnlinePaymentUrl('membersubscription', $object->ref);
- print '
';
- }
- }
+if (($action != 'addsubscription' && $action != 'create_thirdparty')) {
+ // Shon online payment link
+ $useonlinepayment = (isModEnabled('paypal') || isModEnabled('stripe') || isModEnabled('paybox'));
- /*
- * Add new subscription form
- */
- if (($action == 'addsubscription' || $action == 'create_thirdparty') && $user->hasRight('adherent', 'cotisation', 'creer')) {
+ if ($useonlinepayment) {
print '
';
- print load_fiche_titre($langs->trans("NewCotisation"));
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
+ print showOnlinePaymentUrl('membersubscription', $object->ref);
+ print '
';
+ }
+}
- // Define default choice for complementary actions
- $bankdirect = 0; // 1 means option by default is write to bank direct with no invoice
- $invoiceonly = 0; // 1 means option by default is invoice only
- $bankviainvoice = 0; // 1 means option by default is write to bank via invoice
- if (GETPOST('paymentsave')) {
- if (GETPOST('paymentsave') == 'bankdirect') {
- $bankdirect = 1;
- }
- if (GETPOST('paymentsave') == 'invoiceonly') {
- $invoiceonly = 1;
- }
- if (GETPOST('paymentsave') == 'bankviainvoice') {
- $bankviainvoice = 1;
- }
- } else {
- if (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankviainvoice' && isModEnabled('banque') && isModEnabled('societe') && isModEnabled('facture')) {
- $bankviainvoice = 1;
- } elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankdirect' && isModEnabled('banque')) {
- $bankdirect = 1;
- } elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'invoiceonly' && isModEnabled('banque') && isModEnabled('societe') && isModEnabled('facture')) {
- $invoiceonly = 1;
- }
+/*
+ * Add new subscription form
+ */
+if (($action == 'addsubscription' || $action == 'create_thirdparty') && $user->hasRight('adherent', 'cotisation', 'creer')) {
+ print '
';
+
+ print load_fiche_titre($langs->trans("NewCotisation"));
+
+ // Define default choice for complementary actions
+ $bankdirect = 0; // 1 means option by default is write to bank direct with no invoice
+ $invoiceonly = 0; // 1 means option by default is invoice only
+ $bankviainvoice = 0; // 1 means option by default is write to bank via invoice
+ if (GETPOST('paymentsave')) {
+ if (GETPOST('paymentsave') == 'bankdirect') {
+ $bankdirect = 1;
+ }
+ if (GETPOST('paymentsave') == 'invoiceonly') {
+ $invoiceonly = 1;
+ }
+ if (GETPOST('paymentsave') == 'bankviainvoice') {
+ $bankviainvoice = 1;
}
+ } else {
+ if (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankviainvoice' && isModEnabled('banque') && isModEnabled('societe') && isModEnabled('facture')) {
+ $bankviainvoice = 1;
+ } elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankdirect' && isModEnabled('banque')) {
+ $bankdirect = 1;
+ } elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'invoiceonly' && isModEnabled('banque') && isModEnabled('societe') && isModEnabled('facture')) {
+ $invoiceonly = 1;
+ }
+ }
- print "\n\n\n";
-
- if ($conf->use_javascript_ajax) {
- //var_dump($bankdirect.'-'.$bankviainvoice.'-'.$invoiceonly.'-'.empty($conf->global->ADHERENT_BANK_USE));
- print "\n".''."\n";
+ }
+ else
+ {
+ $(".fieldrequireddyn").removeClass("fieldrequired");
+ }
+ });
+ ';
+ if (GETPOST('paymentsave')) {
+ print '$("#'.GETPOST('paymentsave', 'aZ09').'").prop("checked", true);';
}
+ print '});';
+ print ''."\n";
+ }
- // Confirm create third party
- if ($action == 'create_thirdparty') {
- $companyalias = '';
- $fullname = $object->getFullName($langs);
+ // Confirm create third party
+ if ($action == 'create_thirdparty') {
+ $companyalias = '';
+ $fullname = $object->getFullName($langs);
- if ($object->morphy == 'mor') {
- $companyname = $object->company;
- if (!empty($fullname)) {
- $companyalias = $fullname;
- }
- } else {
- $companyname = $fullname;
- if (!empty($object->company)) {
- $companyalias = $object->company;
- }
+ if ($object->morphy == 'mor') {
+ $companyname = $object->company;
+ if (!empty($fullname)) {
+ $companyalias = $fullname;
}
-
- // Create a form array
- $formquestion = array(
- array('label' => $langs->trans("NameToCreate"), 'type' => 'text', 'name' => 'companyname', 'value' => $companyname, 'morecss' => 'minwidth300', 'moreattr' => 'maxlength="128"'),
- array('label' => $langs->trans("AliasNames"), 'type' => 'text', 'name' => 'companyalias', 'value' => $companyalias, 'morecss' => 'minwidth300', 'moreattr' => 'maxlength="128"')
- );
- // If customer code was forced to "required", we ask it at creation to avoid error later
- if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED)) {
- $tmpcompany = new Societe($db);
- $tmpcompany->name = $companyname;
- $tmpcompany->get_codeclient($tmpcompany, 0);
- $customercode = $tmpcompany->code_client;
- $formquestion[] = array(
- 'label' => $langs->trans("CustomerCode"),
- 'type' => 'text',
- 'name' => 'customercode',
- 'value' => $customercode,
- 'morecss' => 'minwidth300',
- 'moreattr' => 'maxlength="128"',
- );
+ } else {
+ $companyname = $fullname;
+ if (!empty($object->company)) {
+ $companyalias = $object->company;
}
- // @todo Add other extrafields mandatory for thirdparty creation
+ }
- print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id, $langs->trans("CreateDolibarrThirdParty"), $langs->trans("ConfirmCreateThirdParty"), "confirm_create_thirdparty", $formquestion, 1);
+ // Create a form array
+ $formquestion = array(
+ array('label' => $langs->trans("NameToCreate"), 'type' => 'text', 'name' => 'companyname', 'value' => $companyname, 'morecss' => 'minwidth300', 'moreattr' => 'maxlength="128"'),
+ array('label' => $langs->trans("AliasNames"), 'type' => 'text', 'name' => 'companyalias', 'value' => $companyalias, 'morecss' => 'minwidth300', 'moreattr' => 'maxlength="128"')
+ );
+ // If customer code was forced to "required", we ask it at creation to avoid error later
+ if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED)) {
+ $tmpcompany = new Societe($db);
+ $tmpcompany->name = $companyname;
+ $tmpcompany->get_codeclient($tmpcompany, 0);
+ $customercode = $tmpcompany->code_client;
+ $formquestion[] = array(
+ 'label' => $langs->trans("CustomerCode"),
+ 'type' => 'text',
+ 'name' => 'customercode',
+ 'value' => $customercode,
+ 'morecss' => 'minwidth300',
+ 'moreattr' => 'maxlength="128"',
+ );
}
+ // @todo Add other extrafields mandatory for thirdparty creation
+ print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id, $langs->trans("CreateDolibarrThirdParty"), $langs->trans("ConfirmCreateThirdParty"), "confirm_create_thirdparty", $formquestion, 1);
+ }
- print '
';
- print '';
+ print dol_get_fiche_end();
- print "\n\n\n";
+ print '
';
+ $parameters = array();
+ $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action);
+ if (empty($reshook)) {
+ print '';
+ print ' ';
+ print '';
}
+ print '
';
- //print '';
- //print '';
-} else {
- $langs->load("errors");
- print $langs->trans("ErrorRecordNotFound");
+ print '';
+
+ print "\n\n\n";
}
+
// End of page
llxFooter();
$db->close();
diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php
index d6ce54a20e9a0..6ff55e13a3a3d 100644
--- a/htdocs/adherents/subscription/card.php
+++ b/htdocs/adherents/subscription/card.php
@@ -148,7 +148,7 @@
header("Location: ".DOL_URL_ROOT."/adherents/card.php?rowid=".$object->fk_adherent);
exit;
} else {
- $mesg = $adh->error;
+ $errmesg = $adh->error;
}
}
@@ -194,45 +194,51 @@
// Ref
print '
'.$langs->trans("Ref").' | ';
- print '';
+ print ' | ';
print $form->showrefnav($object, 'rowid', $linkback, 1);
print ' |
';
// Member
$adh->ref = $adh->getFullName($langs);
print '
';
- print ''.$langs->trans("Member").' | '.$adh->getNomUrl(1, 0, 'subscription').' | ';
+ print ''.$langs->trans("Member").' | ';
+ print ''.$adh->getNomUrl(1, 0, 'subscription').' | ';
print '
';
// Type
print '
';
- print ''.$langs->trans("Type").' | ';
+ print ' | '.$langs->trans("Type").' | ';
+ print '';
print $form->selectarray("typeid", $adht->liste_array(), (GETPOSTISSET("typeid") ? GETPOST("typeid") : $object->fk_type));
print' |
';
// Date start subscription
- print '
'.$langs->trans("DateSubscription").' | ';
+ print ' |
'.$langs->trans("DateSubscription").' | ';
+ print '';
print $form->selectDate($object->dateh, 'datesub', 1, 1, 0, 'update', 1);
print ' | ';
print '
';
// Date end subscription
- print '
'.$langs->trans("DateEndSubscription").' | ';
+ print ' |
'.$langs->trans("DateEndSubscription").' | ';
+ print '';
print $form->selectDate($object->datef, 'datesubend', 0, 0, 0, 'update', 1);
print ' | ';
print '
';
// Amount
- print '
'.$langs->trans("Amount").' | ';
- print ' |
';
+ print '
'.$langs->trans("Amount").' | ';
+ print '';
+ print ' |
';
// Label
- print '
'.$langs->trans("Label").' | ';
- print ' |
';
+ print '
'.$langs->trans("Label").' | ';
+ print '';
+ print ' |
';
// Bank line
if (isModEnabled("banque") && (!empty($conf->global->ADHERENT_BANK_USE) || $object->fk_bank)) {
- print '
'.$langs->trans("BankTransactionLine").' | ';
+ print ' |
'.$langs->trans("BankTransactionLine").' | ';
if ($object->fk_bank) {
$bankline = new AccountLine($db);
$result = $bankline->fetch($object->fk_bank);
diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php
index 4225bad36f4b7..e0475e0d8648f 100644
--- a/htdocs/compta/bank/class/account.class.php
+++ b/htdocs/compta/bank/class/account.class.php
@@ -2570,8 +2570,9 @@ public function getNomUrl($withpicto = 0, $maxlen = 0, $option = '', $notooltip
$result .= $langs->trans("BankLineConciliated").': ';
$result .= yn($this->rappro);
}
- if ($option == 'showall' || $option == 'showconciliatedandaccounted') {
- $sql = "SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX."accounting_bookkeeping WHERE doc_type = 'bank' AND fk_doc = ".((int) $this->id);
+ if (isModEnabled('accounting') && ($option == 'showall' || $option == 'showconciliatedandaccounted')) {
+ $sql = "SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX."accounting_bookkeeping";
+ $sql .= " WHERE doc_type = 'bank' AND fk_doc = ".((int) $this->id);
$resql = $this->db->query($sql);
if ($resql) {
$obj = $this->db->fetch_object($resql);
|