From 520645a02c19904dd2d2ab25141cb27b443214e0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 15 Oct 2020 10:15:37 +0200 Subject: [PATCH] Renamed all methods valide() into validate() --- ChangeLog | 2 + htdocs/cashdesk/tpl/facturation1.tpl.php | 2 +- htdocs/cashdesk/tpl/validation1.tpl.php | 2 +- htdocs/cashdesk/validation_verif.php | 6 +- htdocs/compta/paiement/card.php | 6 +- htdocs/compta/paiement/cheque/card.php | 4 +- .../compta/paiement/class/paiement.class.php | 16 +++- htdocs/compta/payment_sc/card.php | 53 ------------- .../class/rejetprelevement.class.php | 2 +- .../class/DataCollector/DolibarrCollector.php | 15 +++- htdocs/don/class/don.class.php | 16 ++-- htdocs/don/payment/card.php | 51 ------------- htdocs/expensereport/payment/card.php | 45 ----------- htdocs/fourn/paiement/card.php | 10 +-- htdocs/loan/card.php | 8 +- htdocs/loan/class/paymentloan.class.php | 24 ++++++ htdocs/loan/payment/card.php | 75 +++---------------- htdocs/loan/payment/payment.php | 24 +++--- htdocs/main.inc.php | 2 +- 19 files changed, 102 insertions(+), 261 deletions(-) diff --git a/ChangeLog b/ChangeLog index 60aa376f96d..27d9129c762 100644 --- a/ChangeLog +++ b/ChangeLog @@ -26,6 +26,8 @@ Following changes may create regressions for some external modules, but were nec * If you have links in your code with '&action=delete' as a parameter, you must also add '&token='.newToken() as another parameter to avoid CSRF protection errors. * The API addPayment for api_invoice has evolved to accept amount into a foreign currency. You must provide array(amount=>X,mutlicurrency_ammount=>Y) instead of amount. * The method select_thirdparty(), deprecated since 3.8, into html.form.class.php has been removed. +* Depreciate all methods with name valide(). Use instead methods validate(). + ***** ChangeLog for 12.0.3 compared to 12.0.2 ***** FIX: 10.0 - when the mime file name is different from the filesystem name, the attachment name should be the mime filename diff --git a/htdocs/cashdesk/tpl/facturation1.tpl.php b/htdocs/cashdesk/tpl/facturation1.tpl.php index e1dc53ed6e8..d9d12c5d84e 100644 --- a/htdocs/cashdesk/tpl/facturation1.tpl.php +++ b/htdocs/cashdesk/tpl/facturation1.tpl.php @@ -141,7 +141,7 @@ for ($i = 0; $i < $nbtoshow; $i++) -
+
trans("Amount"); ?> diff --git a/htdocs/cashdesk/tpl/validation1.tpl.php b/htdocs/cashdesk/tpl/validation1.tpl.php index 0434473d359..cc558cca058 100644 --- a/htdocs/cashdesk/tpl/validation1.tpl.php +++ b/htdocs/cashdesk/tpl/validation1.tpl.php @@ -97,7 +97,7 @@ if ($obj_facturation->amountReturned()) { - +

rights->facture-> } } -if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->facture->paiement) +if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->facture->paiement) { $db->begin(); $object->fetch($id); - if ($object->valide($user) > 0) + if ($object->validate($user) > 0) { $db->commit(); @@ -189,7 +189,7 @@ if ($action == 'delete') if ($action == 'valide') { $facid = $_GET['facid']; - print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide', '', 0, 2); + print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_validate', '', 0, 2); } $linkback = ''.$langs->trans("BackToList").''; diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index 71cd900f915..7e4e582b3d5 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -178,7 +178,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->banque->c } } -if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->banque->cheque) +if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->banque->cheque) { $result = $object->fetch($id); $result = $object->validate($user); @@ -324,7 +324,7 @@ if ($action == 'new') */ if ($action == 'valide') { - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("ValidateCheckReceipt"), $langs->trans("ConfirmValidateCheckReceipt"), 'confirm_valide', '', '', 1); + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("ValidateCheckReceipt"), $langs->trans("ConfirmValidateCheckReceipt"), 'confirm_validate', '', '', 1); } /* diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 5cb16bdcbe3..dbef7158782 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -858,13 +858,25 @@ class Paiement extends CommonObject return -1; //no num given or already validated } - /** + /** + * Validate payment + * + * @param User $user User making validation + * @return int <0 if KO, >0 if OK + * @deprecated + */ + public function valide(User $user = null) + { + return $this->validate($user); + } + + /** * Validate payment * * @param User $user User making validation * @return int <0 if KO, >0 if OK */ - public function valide(User $user = null) + public function validate(User $user = null) { $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element.' SET statut = 1 WHERE rowid = '.$this->id; diff --git a/htdocs/compta/payment_sc/card.php b/htdocs/compta/payment_sc/card.php index 0e71c83f6cb..8e00c25eac4 100644 --- a/htdocs/compta/payment_sc/card.php +++ b/htdocs/compta/payment_sc/card.php @@ -72,46 +72,6 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->tax->char } } -// Validate social contribution -/* -if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->tax->charges->creer) -{ - $db->begin(); - - $result=$object->valide(); - - if ($result > 0) - { - $db->commit(); - - $factures=array(); // TODO Get all id of invoices linked to this payment - foreach($factures as $id) - { - $fac = new Facture($db); - $fac->fetch($id); - - $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) - { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); - } - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { - $fac->generateDocument($fac->modelpdf, $outputlangs); - } - } - - header('Location: card.php?id='.$object->id); - exit; - } - else - { - setEventMessages($object->error, $object->errors, 'errors'); - $db->rollback(); - } -} -*/ - /* * View @@ -146,19 +106,6 @@ if ($action == 'delete') print $form->formconfirm('card.php?id='.$object->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete', '', 0, 2); } -/* - * Validation confirmation of payment - */ -/* -if ($action == 'valide') -{ - $facid = $_GET['facid']; - print $form->formconfirm('card.php?id='.$object->id.'&facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide','',0,2); - -} -*/ - - $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'id', ''); diff --git a/htdocs/compta/prelevement/class/rejetprelevement.class.php b/htdocs/compta/prelevement/class/rejetprelevement.class.php index 20d600bf9b4..d4f76548363 100644 --- a/htdocs/compta/prelevement/class/rejetprelevement.class.php +++ b/htdocs/compta/prelevement/class/rejetprelevement.class.php @@ -168,7 +168,7 @@ class RejetPrelevement } // Payment validation - if ($pai->valide() < 0) + if ($pai->validate($user) < 0) { $error++; dol_syslog("RejetPrelevement::Create Error payment validation"); diff --git a/htdocs/debugbar/class/DataCollector/DolibarrCollector.php b/htdocs/debugbar/class/DataCollector/DolibarrCollector.php index a03575f88e8..b1b31bc9154 100644 --- a/htdocs/debugbar/class/DataCollector/DolibarrCollector.php +++ b/htdocs/debugbar/class/DataCollector/DolibarrCollector.php @@ -59,14 +59,19 @@ class DolibarrCollector extends DataCollector implements Renderable, AssetProvid protected function getDolibarrInfo() { global $conf, $langs; + global $dolibarr_main_prod, $dolibarr_nocsrfcheck; $info = $langs->trans('Version').': '.DOL_VERSION.'
'; $info .= $langs->trans('Theme').': '.$conf->theme.'
'; $info .= $langs->trans('Locale').': '.$conf->global->MAIN_LANG_DEFAULT.'
'; $info .= $langs->trans('Currency').': '.$conf->currency.'
'; - $info .= $langs->trans('DolEntity').': '.$conf->entity.'
'; - $info .= $langs->trans('ListLimit').': '.($conf->liste_limit ?: $conf->global->MAIN_SIZE_LISTE_LIMIT).'
'; - $info .= $langs->trans('MaxSizeForUploadedFiles').': '.$conf->global->MAIN_UPLOAD_DOC.''; + $info .= $langs->trans('Entity').': '.$conf->entity.'
'; + $info .= $langs->trans('MaxSizeList').': '.($conf->liste_limit ?: $conf->global->MAIN_SIZE_LISTE_LIMIT).'
'; + $info .= $langs->trans('MaxSizeForUploadedFiles').': '.$conf->global->MAIN_UPLOAD_DOC.'
'; + $info .= '$dolibarr_main_prod = '.$dolibarr_main_prod.'
'; + $info .= '$dolibarr_nocsrfcheck = '.$dolibarr_nocsrfcheck.'
'; + $info .= 'MAIN_SECURITY_CSRF_WITH_TOKEN = '.$conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN.'
'; + $info .= 'MAIN_FEATURES_LEVEL = '.$conf->global->MAIN_FEATURES_LEVEL.'
'; return $info; } @@ -79,6 +84,7 @@ class DolibarrCollector extends DataCollector implements Renderable, AssetProvid protected function getMailInfo() { global $conf, $langs; + global $dolibarr_mailing_limit_sendbyweb; $info = $langs->trans('Method').': '.$conf->global->MAIN_MAIL_SENDMODE.'
'; $info .= $langs->trans('Server').': '.$conf->global->MAIN_MAIL_SMTP_SERVER.'
'; @@ -86,7 +92,8 @@ class DolibarrCollector extends DataCollector implements Renderable, AssetProvid $info .= $langs->trans('ID').': '.$conf->global->MAIN_MAIL_SMTPS_ID.'
'; $info .= $langs->trans('Pwd').': '.preg_replace('/./', '*', $conf->global->MAIN_MAIL_SMTPS_PW).'
'; $info .= $langs->trans('TLS/STARTTLS').': '.$conf->global->MAIN_MAIL_EMAIL_TLS.' / '.$conf->global->MAIN_MAIL_EMAIL_STARTTLS.'
'; - $info .= $langs->trans('MAIN_DISABLE_ALL_MAILS').': '.($conf->global->MAIN_DISABLE_ALL_MAILS ? $langs->trans('Yes') : $langs->trans('No')).''; + $info .= $langs->trans('MAIN_DISABLE_ALL_MAILS').': '.($conf->global->MAIN_DISABLE_ALL_MAILS ? $langs->trans('Yes') : $langs->trans('No')).'
'; + $info .= 'dolibarr_mailing_limit_sendbyweb = '.$dolibarr_mailing_limit_sendbyweb.'
'; return $info; } diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 3ccaa573e8c..b9ec7ebcaa7 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -167,14 +167,14 @@ class Don extends CommonObject { global $langs; $langs->load("donations"); - $this->labelStatus[-1] = $langs->trans("Canceled"); - $this->labelStatus[0] = $langs->trans("DonationStatusPromiseNotValidated"); - $this->labelStatus[1] = $langs->trans("DonationStatusPromiseValidated"); - $this->labelStatus[2] = $langs->trans("DonationStatusPaid"); - $this->labelStatusShort[-1] = $langs->trans("Canceled"); - $this->labelStatusShort[0] = $langs->trans("DonationStatusPromiseNotValidatedShort"); - $this->labelStatusShort[1] = $langs->trans("DonationStatusPromiseValidatedShort"); - $this->labelStatusShort[2] = $langs->trans("DonationStatusPaidShort"); + $this->labelStatus[-1] = $langs->transnoentitiesnoconv("Canceled"); + $this->labelStatus[0] = $langs->transnoentitiesnoconv("DonationStatusPromiseNotValidated"); + $this->labelStatus[1] = $langs->transnoentitiesnoconv("DonationStatusPromiseValidated"); + $this->labelStatus[2] = $langs->transnoentitiesnoconv("DonationStatusPaid"); + $this->labelStatusShort[-1] = $langs->transnoentitiesnoconv("Canceled"); + $this->labelStatusShort[0] = $langs->transnoentitiesnoconv("DonationStatusPromiseNotValidatedShort"); + $this->labelStatusShort[1] = $langs->transnoentitiesnoconv("DonationStatusPromiseValidatedShort"); + $this->labelStatusShort[2] = $langs->transnoentitiesnoconv("DonationStatusPaidShort"); } $statusType = 'status'.$status; diff --git a/htdocs/don/payment/card.php b/htdocs/don/payment/card.php index 26f540969ee..d3ecbe2a107 100644 --- a/htdocs/don/payment/card.php +++ b/htdocs/don/payment/card.php @@ -69,42 +69,6 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->don->supp } } -// Create payment -if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->don->creer) -{ - $db->begin(); - - $result = $object->valide(); - - if ($result > 0) - { - $db->commit(); - - $donations = array(); // TODO Get all id of donation linked to this payment - foreach ($donations as $id) - { - $donation = new Don($db); - $donation->fetch($id); - - $outputlangs = $langs; - if (!empty(GETPOST('lang_id'))) - { - $outputlangs = new Translate("", $conf); - $outputlangs->setDefaultLang(GETPOST('lang_id')); - } - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { - $donation->generateDocument($donation->model_pdf, $outputlangs); - } - } - - header('Location: card.php?id='.$object->id); - exit; - } else { - setEventMessages($object->error, $object->errors, 'errors'); - $db->rollback(); - } -} - /* * View @@ -132,14 +96,6 @@ if ($action == 'delete') print $form->formconfirm('card.php?id='.$object->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete', '', 0, 2); } -/* - * Confirm validation of the payment - */ -if ($action == 'valide') -{ - print $form->formconfirm('card.php?id='.$object->id, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide', '', 0, 2); -} - dol_banner_tab($object, 'id', '', 1, 'rowid', 'id'); @@ -148,13 +104,6 @@ print '

'; print ''; -// Ref -/*print ''; -*/ - // Date print ''; diff --git a/htdocs/expensereport/payment/card.php b/htdocs/expensereport/payment/card.php index 9bc50341973..718e96b12b0 100644 --- a/htdocs/expensereport/payment/card.php +++ b/htdocs/expensereport/payment/card.php @@ -70,42 +70,6 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->expensere } } -// Create payment -if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->expensereport->creer) -{ - $db->begin(); - - $result = $object->valide(); - - if ($result > 0) - { - $db->commit(); - - $factures = array(); // TODO Get all id of invoices linked to this payment - foreach ($factures as $invoiceid) - { - $fac = new Facture($db); - $fac->fetch($invoiceid); - - $outputlangs = $langs; - if (!empty($_REQUEST['lang_id'])) - { - $outputlangs = new Translate("", $conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); - } - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { - $fac->generateDocument($fac->model_pdf, $outputlangs); - } - } - - header('Location: card.php?id='.$object->id); - exit; - } else { - setEventMessages($object->error, $object->errors, 'errors'); - $db->rollback(); - } -} - /* * View @@ -127,15 +91,6 @@ if ($action == 'delete') print $form->formconfirm('card.php?id='.$object->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete', '', 0, 2); } -/* - * Confirm validation of the payment - */ -if ($action == 'valide') -{ - $facid = $_GET['facid']; - print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide', '', 0, 2); -} - $linkback = ''; // $linkback = '' . $langs->trans("BackToList") . ''; diff --git a/htdocs/fourn/paiement/card.php b/htdocs/fourn/paiement/card.php index 7ea1958c9e2..9d842481188 100644 --- a/htdocs/fourn/paiement/card.php +++ b/htdocs/fourn/paiement/card.php @@ -82,7 +82,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fournisse } } -if ($action == 'confirm_valide' && $confirm == 'yes' && +if ($action == 'confirm_validate' && $confirm == 'yes' && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->facture->creer)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->supplier_invoice_advance->validate))) ) @@ -90,7 +90,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $db->begin(); $object->fetch($id); - if ($object->valide() >= 0) + if ($object->validate() >= 0) { $db->commit(); header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); @@ -161,9 +161,9 @@ if ($result > 0) /* * Confirmation of payment's validation */ - if ($action == 'valide') + if ($action == 'validate') { - print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide'); + print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_validate'); } $linkback = ''.$langs->trans("BackToList").''; @@ -343,7 +343,7 @@ if ($result > 0) if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->facture->creer)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->supplier_invoice_advance->validate))) { - print ''.$langs->trans('Valid').''; + print ''.$langs->trans('Valid').''; } } } diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index 974f758bdc9..5ea03693eb8 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -52,6 +52,8 @@ $object = new Loan($db); $hookmanager->initHooks(array('loancard', 'globalcard')); +$error = 0; + /* * Actions @@ -62,7 +64,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e if (empty($reshook)) { // Classify paid - if ($action == 'confirm_paid' && $confirm == 'yes') + if ($action == 'confirm_paid' && $confirm == 'yes' && $user->rights->loan->write) { $object->fetch($id); $result = $object->set_paid($user); @@ -75,7 +77,7 @@ if (empty($reshook)) } // Delete loan - if ($action == 'confirm_delete' && $confirm == 'yes') + if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->loan->write) { $object->fetch($id); $result = $object->delete($user); @@ -146,7 +148,7 @@ if (empty($reshook)) if ($id <= 0) { $error++; - setEventMessages($object->db->lastqueryerror, $object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); $action = 'create'; } } diff --git a/htdocs/loan/class/paymentloan.class.php b/htdocs/loan/class/paymentloan.class.php index 9c5c1b559ad..508d1044d85 100644 --- a/htdocs/loan/class/paymentloan.class.php +++ b/htdocs/loan/class/paymentloan.class.php @@ -417,6 +417,30 @@ class PaymentLoan extends CommonObject } } + /** + * Retourne le libelle du statut d'une facture (brouillon, validee, abandonnee, payee) + * + * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto + * @return string Libelle + */ + public function getLibStatut($mode = 0) + { + return $this->LibStatut($this->statut, $mode); + } + + /** + * Renvoi le libelle d'un statut donne + * + * @param int $status Statut + * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto + * @return string Libelle du statut + */ + public function LibStatut($status, $mode = 0) + { + // + return ''; + } + /** * Add record into bank for payment with links between this bank record and invoices of payment. * All payment properties must have been set first like after a call to create(). diff --git a/htdocs/loan/payment/card.php b/htdocs/loan/payment/card.php index 51aa3f85a92..15759a8ce7b 100644 --- a/htdocs/loan/payment/card.php +++ b/htdocs/loan/payment/card.php @@ -71,42 +71,6 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->loan->del } } -// Create payment -if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->loan->write) -{ - $db->begin(); - - $result = $payment->valide(); - - if ($result > 0) - { - $db->commit(); - - $factures = array(); // TODO Get all id of invoices linked to this payment - foreach ($factures as $id) - { - $fac = new Facture($db); - $fac->fetch($id); - - $outputlangs = $langs; - if (!empty($_REQUEST['lang_id'])) - { - $outputlangs = new Translate("", $conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); - } - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { - $fac->generateDocument($fac->model_pdf, $outputlangs); - } - } - - header('Location: card.php?id='.$payment->id); - exit; - } else { - setEventMessages($payment->error, $payment->errors, 'errors'); - $db->rollback(); - } -} - /* * View @@ -124,7 +88,7 @@ $head[$h][1] = $langs->trans("PaymentLoan"); $hselected = $h; $h++; -dol_fiche_head($head, $hselected, $langs->trans("PaymentLoan"), 0, 'payment'); +dol_fiche_head($head, $hselected, $langs->trans("PaymentLoan"), -1, 'payment'); /* * Confirm deletion of the payment @@ -134,24 +98,17 @@ if ($action == 'delete') print $form->formconfirm('card.php?id='.$payment->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete', '', 0, 2); } -/* - * Confirm validation of the payment - */ -if ($action == 'valide') -{ - $facid = $_GET['facid']; - print $form->formconfirm('card.php?id='.$payment->id.'&facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide', '', 0, 2); -} +$linkback = ''; +$morehtmlref = ''; +$morehtmlright = ''; +dol_banner_tab($payment, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright); + +print '
'; +print '
'; print '
'; -print $form->showrefnav($object,'id','',1,'rowid','id'); -print '
'.$langs->trans('Date').''.dol_print_date($object->datep, 'day').'
'; -// Ref -print ''; -print ''; - // Date print ''; @@ -188,6 +145,8 @@ if (!empty($conf->banque->enabled)) print '
'.$langs->trans('Ref').''; -print $form->showrefnav($payment, 'id', '', 1, 'rowid', 'id'); -print '
'.$langs->trans('Date').''.dol_print_date($payment->datep, 'day').'
'; +print ''; + /* * List of loans payed @@ -262,20 +221,8 @@ print ''; /* * Actions buttons */ -print '
'; -/* -if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) -{ - if ($user->socid == 0 && $payment->statut == 0 && $_GET['action'] == '') - { - if ($user->rights->facture->paiement) - { - print ''.$langs->trans('Valid').''; - } - } -} -*/ +print '
'; if (empty($action) && !empty($user->rights->loan->delete)) { diff --git a/htdocs/loan/payment/payment.php b/htdocs/loan/payment/payment.php index 9aaa75b9845..82f114b7b20 100644 --- a/htdocs/loan/payment/payment.php +++ b/htdocs/loan/payment/payment.php @@ -272,14 +272,13 @@ if ($action == 'create') print ''; print ''; print ''; - print ''; + print ''; print ''; - dol_fiche_head(); + dol_fiche_head(); - print ''; - - print ''; + /* + print '
'.$langs->trans("Loan").'
'; print ''; if ($echance > 0) @@ -295,13 +294,9 @@ if ($action == 'create') print ''; print '
'.$langs->trans("Ref").''.$chid.'
'; + */ - print '
'; - - print ''; - print ''; - print ''; - print ''; + print '
'.$langs->trans("Payment").'
'; print '"; - print ''; print ''; print ''; print ''; // Number print ''; - print ''."\n"; + print ''."\n"; + print ""; print ''; print ''; @@ -344,6 +339,7 @@ if ($action == 'create') dol_fiche_end(); + print '
'.$langs->trans("Date").''; if (empty($datepaid)) @@ -310,7 +305,6 @@ if ($action == 'create') else $datepayment = $datepaid; print $form->selectDate($datepayment, '', '', '', '', "add_payment", 1, 1); print "
'.$langs->trans("PaymentMode").''; @@ -321,14 +315,15 @@ if ($action == 'create') print '
'.$langs->trans('AccountToDebit').''; - $form->select_comptes(isset($_POST["accountid"])?$_POST["accountid"]:$loan->accountid, "accountid", 0, 'courant = '.Account::TYPE_CURRENT, 1); // Show opend bank account list + $form->select_comptes(GETPOSTISSET("accountid") ? GETPOST("accountid", 'int') : $loan->accountid, "accountid", 0, 'courant = '.Account::TYPE_CURRENT, 1); // Show opend bank account list print '
'.$langs->trans('Numero'); print ' ('.$langs->trans("ChequeOrTransferNumber").')'; print '
'.$langs->trans("NotePrivate").'
'; print ''; print ''; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 689a3a0a4fc..77303e11e32 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -376,7 +376,7 @@ if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && !empty($conf->gl // Check all cases that need a token (all POST actions, all actions and mass actions on pages with CSRFCHECK_WITH_TOKEN set, all sensitive GET actions) if ($_SERVER['REQUEST_METHOD'] == 'POST' || ((GETPOSTISSET('action') || GETPOSTISSET('massaction')) && defined('CSRFCHECK_WITH_TOKEN')) || - in_array(GETPOST('action', 'aZ09'), array('add', 'addtimespent', 'update', 'install', 'delete', 'deleteprof', 'deletepayment', 'confirm_create_user', 'confirm_create_thirdparty'))) + in_array(GETPOST('action', 'aZ09'), array('add', 'addtimespent', 'update', 'install', 'delete', 'deleteprof', 'deletepayment', 'confirm_create_user', 'confirm_create_thirdparty', 'confirm_reject_check'))) { if (!GETPOSTISSET('token')) { if (GETPOST('uploadform', 'int')) {
'.$langs->trans("DateDue").'