diff --git a/htdocs/don/admin/donation.php b/htdocs/don/admin/donation.php index 97dc4b68d99..69736fdaca9 100644 --- a/htdocs/don/admin/donation.php +++ b/htdocs/don/admin/donation.php @@ -4,6 +4,7 @@ * Copyright (C) 2013-2017 Philippe Grand * Copyright (C) 2015-2017 Alexandre Spangaro * Copyright (C) 2015 Benoit Bruchard + * Copyright (C) 2019 Thibault FOUCART * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -153,6 +154,37 @@ if ($action == 'set_DONATION_MESSAGE') } } +/* + * Action + */ +if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg)) +{ + $code=$reg[1]; + if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0) + { + header("Location: ".$_SERVER["PHP_SELF"]); + exit; + } + else + { + dol_print_error($db); + } +} + +if (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg)) +{ + $code=$reg[1]; + if (dolibarr_del_const($db, $code, $conf->entity) > 0) + { + header("Location: ".$_SERVER["PHP_SELF"]); + exit; + } + else + { + dol_print_error($db); + } +} + /* * View */ @@ -317,11 +349,24 @@ print ''; print ''; print ''; +print ''; +print $form->textwithpicto($langs->trans("DonationUserThirdparties"), $langs->trans("DonationUserThirdpartiesDesc")); +print ''; +print ''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('DONATION_USE_THIRDPARTIES'); +} else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("DONATION_USE_THIRDPARTIES", $arrval, $conf->global->DONATION_USE_THIRDPARTIES); +} +print "\n"; +print "\n"; +print ''; print ''; $label = $langs->trans("AccountAccounting"); print ''; -print ''; +print ''; if (! empty($conf->accounting->enabled)) { print $formaccounting->select_account($conf->global->DONATION_ACCOUNTINGACCOUNT, 'DONATION_ACCOUNTINGACCOUNT', 1, '', 1, 1); @@ -330,7 +375,7 @@ else { print ''; } -print ''; +print ''; print ''; print "\n"; print ''; @@ -342,7 +387,7 @@ print ''; print ''; print $langs->trans("FreeTextOnDonations").' '.img_info($langs->trans("AddCRIfTooLong")).'
'; print ''; -print ''; +print ''; print ''; print "\n";