From 2b2b43afb6b670944cfa21fbc663957b814ea94a Mon Sep 17 00:00:00 2001 From: aspangaro Date: Wed, 25 Mar 2015 22:37:14 +0100 Subject: [PATCH] Dir "Don" --- build/rpm/dolibarr_fedora.spec | 2 +- build/rpm/dolibarr_generic.spec | 2 +- build/rpm/dolibarr_mandriva.spec | 2 +- build/rpm/dolibarr_opensuse.spec | 2 +- htdocs/compta/bank/account.php | 2 +- htdocs/compta/index.php | 4 +- htdocs/compta/resultat/clientfourn.php | 2 +- htdocs/core/lib/donation.lib.php | 10 +- htdocs/core/menus/init_menu_auguria.sql | 8 +- htdocs/core/menus/standard/eldy.lib.php | 8 +- .../modules/dons/html_cerfafr.modules.php | 2 +- htdocs/core/modules/dons/modules_don.php | 2 +- htdocs/{donations => don}/admin/donation.php | 4 +- .../admin/donation_extrafields.php | 2 +- htdocs/{donations => don/admin}/index.html | 0 htdocs/don/admin/index.php | 117 ++++++++++++++++++ htdocs/{donations => don}/card.php | 54 ++++---- htdocs/{donations => don}/class/don.class.php | 78 ++++++------ .../class/donationstats.class.php | 4 +- htdocs/don/class/index.html | 0 .../class/paymentdonation.class.php | 8 +- htdocs/{donations => don}/document.php | 6 +- htdocs/don/index.html | 0 htdocs/{donations => don}/index.php | 4 +- htdocs/{donations => don}/info.php | 4 +- htdocs/{donations => don}/list.php | 4 +- htdocs/{donations => don}/payment/card.php | 10 +- htdocs/don/payment/index.html | 0 htdocs/{donations => don}/payment/payment.php | 12 +- htdocs/{donations => don}/stats/index.php | 8 +- htdocs/install/filelist.xml | 2 +- htdocs/product/class/product.class.php | 2 +- 32 files changed, 239 insertions(+), 126 deletions(-) rename htdocs/{donations => don}/admin/donation.php (99%) rename htdocs/{donations => don}/admin/donation_extrafields.php (98%) rename htdocs/{donations => don/admin}/index.html (100%) create mode 100644 htdocs/don/admin/index.php rename htdocs/{donations => don}/card.php (93%) rename htdocs/{donations => don}/class/don.class.php (93%) rename htdocs/{donations => don}/class/donationstats.class.php (96%) create mode 100644 htdocs/don/class/index.html rename htdocs/{donations => don}/class/paymentdonation.class.php (97%) rename htdocs/{donations => don}/document.php (92%) create mode 100644 htdocs/don/index.html rename htdocs/{donations => don}/index.php (98%) rename htdocs/{donations => don}/info.php (93%) rename htdocs/{donations => don}/list.php (98%) rename htdocs/{donations => don}/payment/card.php (95%) create mode 100644 htdocs/don/payment/index.html rename htdocs/{donations => don}/payment/payment.php (95%) rename htdocs/{donations => don}/stats/index.php (97%) diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index 463f3e94e86..c34cd4e9d61 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -172,7 +172,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/contrat %_datadir/dolibarr/htdocs/core %_datadir/dolibarr/htdocs/cron -%_datadir/dolibarr/htdocs/donations +%_datadir/dolibarr/htdocs/don %_datadir/dolibarr/htdocs/ecm %_datadir/dolibarr/htdocs/expedition %_datadir/dolibarr/htdocs/expensereport diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index adc5abbfd58..c3c3b2a7939 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -252,7 +252,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/contrat %_datadir/dolibarr/htdocs/core %_datadir/dolibarr/htdocs/cron -%_datadir/dolibarr/htdocs/donations +%_datadir/dolibarr/htdocs/don %_datadir/dolibarr/htdocs/ecm %_datadir/dolibarr/htdocs/expedition %_datadir/dolibarr/htdocs/expensereport diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index ecc5fb76b0c..efe55e2aa7a 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -169,7 +169,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/contrat %_datadir/dolibarr/htdocs/core %_datadir/dolibarr/htdocs/cron -%_datadir/dolibarr/htdocs/donations +%_datadir/dolibarr/htdocs/don %_datadir/dolibarr/htdocs/ecm %_datadir/dolibarr/htdocs/expedition %_datadir/dolibarr/htdocs/expensereport diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index 129f6dc8f0a..6a86f9e3ffa 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -180,7 +180,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/contrat %_datadir/dolibarr/htdocs/core %_datadir/dolibarr/htdocs/cron -%_datadir/dolibarr/htdocs/donations +%_datadir/dolibarr/htdocs/don %_datadir/dolibarr/htdocs/ecm %_datadir/dolibarr/htdocs/expedition %_datadir/dolibarr/htdocs/expensereport diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index a4bfe4c0c37..3213709a54e 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php' require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/salaries/class/paymentsalary.class.php'; -require_once DOL_DOCUMENT_ROOT.'/donations/class/don.class.php'; +require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/loan/class/loan.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 9af8296f84d..698676829d1 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -127,7 +127,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire) if (! empty($conf->don->enabled) && $user->rights->don->lire) { $langs->load("donations"); - print '
'; + print ''; print ''; print ''; print ''; @@ -497,7 +497,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- // Last donations if (! empty($conf->don->enabled) && $user->rights->societe->lire) { - include_once DOL_DOCUMENT_ROOT.'/donations/class/don.class.php'; + include_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; $langs->load("boxes"); $donationstatic=new Don($db); diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 4f1ff225417..a9e14030388 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -651,7 +651,7 @@ if ($conf->donation->enabled) $var = !$var; print ""; - print "\n"; + print "\n"; if ($modecompta == 'CREANCES-DETTES') print ''; print ''; diff --git a/htdocs/core/lib/donation.lib.php b/htdocs/core/lib/donation.lib.php index 93cbe889e4d..4155d5ce60e 100644 --- a/htdocs/core/lib/donation.lib.php +++ b/htdocs/core/lib/donation.lib.php @@ -34,7 +34,7 @@ function donation_admin_prepare_head() $h = 0; $head = array (); - $head[$h][0] = DOL_URL_ROOT . '/donations/admin/donation.php'; + $head[$h][0] = DOL_URL_ROOT . '/don/admin/donation.php'; $head[$h][1] = $langs->trans("Miscellaneous"); $head[$h][2] = 'general'; $h ++; @@ -45,7 +45,7 @@ function donation_admin_prepare_head() // $this->tabs = array('entity:-tabname); to remove a tab complete_head_from_modules($conf, $langs, $object, $head, $h, 'donation_admin'); - $head[$h][0] = DOL_URL_ROOT . '/donations/admin/donation_extrafields.php'; + $head[$h][0] = DOL_URL_ROOT . '/don/admin/donation_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields"); $head[$h][2] = 'attributes'; $h++; @@ -68,7 +68,7 @@ function donation_prepare_head($object) $h = 0; $head = array (); - $head[$h][0] = DOL_URL_ROOT . '/donations/card.php?id=' . $object->id; + $head[$h][0] = DOL_URL_ROOT . '/don/card.php?id=' . $object->id; $head[$h][1] = $langs->trans("Card"); $head[$h][2] = 'card'; $h ++; @@ -79,12 +79,12 @@ function donation_prepare_head($object) // $this->tabs = array('entity:-tabname); to remove a tab complete_head_from_modules($conf, $langs, $object, $head, $h, 'donation'); - $head[$h][0] = DOL_URL_ROOT . '/donations/document.php?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT . '/don/document.php?id='.$object->id; $head[$h][1] = $langs->trans("Documents"); $head[$h][2] = 'documents'; $h++; - $head[$h][0] = DOL_URL_ROOT . '/donations/info.php?id=' . $object->id; + $head[$h][0] = DOL_URL_ROOT . '/don/info.php?id=' . $object->id; $head[$h][1] = $langs->trans("Info"); $head[$h][2] = 'info'; $h++; diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 00579ab5f6d..3eab01619f1 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -172,10 +172,10 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left -- Accountancy - Orders to bill insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1900__+MAX_llx_menu__, 'accountancy', 'orders', 6__+MAX_llx_menu__, '/commande/list.php?leftmenu=orders&viewstatut=3', 'MenuOrdersToBill', 0, 'orders', '$user->rights->commande->lire', '', 0, 3, __ENTITY__); -- Donations -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled', __HANDLER__, 'left', 2000__+MAX_llx_menu__, 'accountancy', 'donations', 6__+MAX_llx_menu__, '/donations/index.php?leftmenu=donations&mainmenu=accountancy', 'Donations', 0, 'donations', '$user->rights->don->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2001__+MAX_llx_menu__, 'accountancy', '', 2000__+MAX_llx_menu__, '/donations/card.php?leftmenu=donations&mainmenu=accountancy&action=create', 'NewDonation', 1, 'donations', '$user->rights->don->creer', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2002__+MAX_llx_menu__, 'accountancy', '', 2000__+MAX_llx_menu__, '/donations/list.php?leftmenu=donations&mainmenu=accountancy', 'List', 1, 'donations', '$user->rights->don->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2003__+MAX_llx_menu__, 'accountancy', '', 2000__+MAX_llx_menu__, '/donations/stats/index.php?leftmenu=donations&mainmenu=accountancy', 'Statistics', 1, 'donations', '$user->rights->don->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled', __HANDLER__, 'left', 2000__+MAX_llx_menu__, 'accountancy', 'donations', 6__+MAX_llx_menu__, '/don/index.php?leftmenu=donations&mainmenu=accountancy', 'Donations', 0, 'donations', '$user->rights->don->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2001__+MAX_llx_menu__, 'accountancy', '', 2000__+MAX_llx_menu__, '/don/card.php?leftmenu=donations&mainmenu=accountancy&action=create', 'NewDonation', 1, 'donations', '$user->rights->don->creer', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2002__+MAX_llx_menu__, 'accountancy', '', 2000__+MAX_llx_menu__, '/don/list.php?leftmenu=donations&mainmenu=accountancy', 'List', 1, 'donations', '$user->rights->don->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2003__+MAX_llx_menu__, 'accountancy', '', 2000__+MAX_llx_menu__, '/don/stats/index.php?leftmenu=donations&mainmenu=accountancy', 'Statistics', 1, 'donations', '$user->rights->don->lire', '', 2, 2, __ENTITY__); -- Special expenses insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled || $conf->salaries->enabled', __HANDLER__, 'left', 2200__+MAX_llx_menu__, 'accountancy', 'tax', 6__+MAX_llx_menu__, '/compta/charges/index.php?leftmenu=tax&mainmenu=accountancy', 'MenuSpecialExpenses', 0, 'compta', '(! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) || (! empty($conf->salaries->enabled) && $user->rights->salaries->read)', '', 0, 6, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled', __HANDLER__, 'left', 2210__+MAX_llx_menu__, 'accountancy', 'tax_sal', 2200__+MAX_llx_menu__, '/compta/salaries/index.php?leftmenu=tax_salary&mainmenu=accountancy', 'Salaries', 1, 'salaries', '$user->rights->salaries->read', '', 0, 1, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index b6122c095a2..1d35db720b7 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -807,10 +807,10 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if (! empty($conf->don->enabled)) { $langs->load("donations"); - $newmenu->add("/donations/index.php?leftmenu=donations&mainmenu=accountancy",$langs->trans("Donations"), 0, $user->rights->don->lire, '', $mainmenu, 'donations'); - if (empty($leftmenu) || $leftmenu=="donations") $newmenu->add("/donations/card.php?action=create",$langs->trans("NewDonation"), 1, $user->rights->don->creer); - if (empty($leftmenu) || $leftmenu=="donations") $newmenu->add("/donations/list.php",$langs->trans("List"), 1, $user->rights->don->lire); - if ($leftmenu=="donations") $newmenu->add("/donations/stats/index.php",$langs->trans("Statistics"), 1, $user->rights->don->lire); + $newmenu->add("/don/index.php?leftmenu=donations&mainmenu=accountancy",$langs->trans("Donations"), 0, $user->rights->don->lire, '', $mainmenu, 'donations'); + if (empty($leftmenu) || $leftmenu=="donations") $newmenu->add("/don/card.php?action=create",$langs->trans("NewDonation"), 1, $user->rights->don->creer); + if (empty($leftmenu) || $leftmenu=="donations") $newmenu->add("/don/list.php",$langs->trans("List"), 1, $user->rights->don->lire); + if ($leftmenu=="donations") $newmenu->add("/don/stats/index.php",$langs->trans("Statistics"), 1, $user->rights->don->lire); } // Taxes and social contributions diff --git a/htdocs/core/modules/dons/html_cerfafr.modules.php b/htdocs/core/modules/dons/html_cerfafr.modules.php index 0efaf8c4524..8730b1041de 100644 --- a/htdocs/core/modules/dons/html_cerfafr.modules.php +++ b/htdocs/core/modules/dons/html_cerfafr.modules.php @@ -25,7 +25,7 @@ * \brief Form of donation */ require_once DOL_DOCUMENT_ROOT.'/core/modules/dons/modules_don.php'; -require_once DOL_DOCUMENT_ROOT.'/donations/class/don.class.php'; +require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; diff --git a/htdocs/core/modules/dons/modules_don.php b/htdocs/core/modules/dons/modules_don.php index abb7dd105ae..14045f20d11 100644 --- a/htdocs/core/modules/dons/modules_don.php +++ b/htdocs/core/modules/dons/modules_don.php @@ -25,7 +25,7 @@ * \brief File of class to manage donation document generation */ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; -require_once DOL_DOCUMENT_ROOT.'/donations/class/don.class.php'; +require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; diff --git a/htdocs/donations/admin/donation.php b/htdocs/don/admin/donation.php similarity index 99% rename from htdocs/donations/admin/donation.php rename to htdocs/don/admin/donation.php index fa785763cc0..41ea0a3d542 100644 --- a/htdocs/donations/admin/donation.php +++ b/htdocs/don/admin/donation.php @@ -19,14 +19,14 @@ */ /** - * \file htdocs/donations/admin/dons.php + * \file htdocs/don/admin/dons.php * \ingroup donations * \brief Page to setup the donation module */ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/donation.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/donations/class/don.class.php'; +require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $langs->load("admin"); diff --git a/htdocs/donations/admin/donation_extrafields.php b/htdocs/don/admin/donation_extrafields.php similarity index 98% rename from htdocs/donations/admin/donation_extrafields.php rename to htdocs/don/admin/donation_extrafields.php index f93b48bafca..6c964b46321 100644 --- a/htdocs/donations/admin/donation_extrafields.php +++ b/htdocs/don/admin/donation_extrafields.php @@ -16,7 +16,7 @@ */ /** - * \file htdocs/donations/admin/donation_extrafields.php + * \file htdocs/don/admin/donation_extrafields.php * \ingroup donations * \brief Page to setup extra fields of donations */ diff --git a/htdocs/donations/index.html b/htdocs/don/admin/index.html similarity index 100% rename from htdocs/donations/index.html rename to htdocs/don/admin/index.html diff --git a/htdocs/don/admin/index.php b/htdocs/don/admin/index.php new file mode 100644 index 00000000000..78ff3b48f9a --- /dev/null +++ b/htdocs/don/admin/index.php @@ -0,0 +1,117 @@ + + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * \file htdocs/admin/index.php + * \ingroup Donations + * \brief Setup page to configure donations module + */ + +require '../main.inc.php'; + +// Class +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; + +$langs->load("admin"); +$langs->load("donations"); + +// Security check +if (!$user->admin) + accessforbidden(); + +$action = GETPOST('action', 'alpha'); + +// Other parameters DONATIONS_* +$list = array ( + 'DONATIONS_ACCOUNTING_ACCOUNT_PRODUCT' +); + +/* + * Actions + */ + +if ($action == 'update') +{ + $error = 0; + + foreach ($list as $constname) { + $constvalue = GETPOST($constname, 'alpha'); + + if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) { + $error++; + } + } + + if (! $error) + { + setEventMessage($langs->trans("SetupSaved")); + } + else + { + setEventMessage($langs->trans("Error"),'errors'); + } +} + +/* + * View + */ + +llxHeader('',$langs->trans('DonationsSetup')); + +$form = new Form($db); + +$linkback=''.$langs->trans("BackToModuleList").''; +print_fiche_titre($langs->trans('DonationsSetup'),$linkback,'setup'); + +print ''; +print ''; +print ''; + +/* + * Params + */ +print '
'.$langs->trans("SearchADonation").'
 ".$langs->trans("Donation")." name."&search_name=".$obj->firstname." ".$obj->lastname."\">".$obj->name. " ".$obj->firstname." ".$obj->lastname."".$langs->trans("Donation")." name."&search_name=".$obj->firstname." ".$obj->lastname."\">".$obj->name. " ".$obj->firstname." ".$obj->lastname."'.price($obj->amount).''.price($obj->amount).'
'; +print ''; +print ''; +print "\n"; + +foreach ($list as $key) +{ + $var=!$var; + + print ''; + + // Param + $label = $langs->trans($key); + print ''; + + // Value + print ''; +} + +print ''; + +print ''; +print "
' . $langs->trans('Options') . '
'; + print ''; + print '
\n"; + +print '
'; + +llxFooter(); +$db->close(); \ No newline at end of file diff --git a/htdocs/donations/card.php b/htdocs/don/card.php similarity index 93% rename from htdocs/donations/card.php rename to htdocs/don/card.php index 6c2bd28a2d0..7e4039f760f 100644 --- a/htdocs/donations/card.php +++ b/htdocs/don/card.php @@ -20,7 +20,7 @@ */ /** - * \file htdocs/donations/card.php + * \file htdocs/don/card.php * \ingroup donations * \brief Page of donation card */ @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/dons/modules_don.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/donation.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -require_once DOL_DOCUMENT_ROOT.'/donations/class/don.class.php'; +require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; if (! empty($conf->projet->enabled)) @@ -111,7 +111,7 @@ if ($action == 'update') $object->note_public = GETPOST("note_public"); // Fill array 'array_options' with data from add form - $ret = $extrafields->setOptionalsFromPost($extralabels,$object); + $ret = $extrafields->setOptionalsFromPost($extralabels,$object); if ($ret < 0) $error++; if ($object->update($user) > 0) @@ -164,7 +164,7 @@ if ($action == 'add') $object->fk_project = GETPOST("fk_project"); // Fill array 'array_options' with data from add form - $ret = $extrafields->setOptionalsFromPost($extralabels,$object); + $ret = $extrafields->setOptionalsFromPost($extralabels,$object); if ($ret < 0) $error++; if ($object->create($user) > 0) @@ -355,13 +355,13 @@ if ($action == 'create') } // Other attributes - $parameters=array(); - $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - if (empty($reshook) && ! empty($extrafields->attribute_label)) - { - print $object->showOptionals($extrafields,'edit'); - } - + $parameters=array('colspan' => 3); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + if (empty($reshook) && ! empty($extrafields->attribute_label)) + { + print $object->showOptionals($extrafields,'edit',$parameters); + } + print "\n"; print '
   
'; print "\n"; @@ -461,13 +461,13 @@ if (! empty($id) && $action == 'edit') } // Other attributes - $parameters=array(); - $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - if (empty($reshook) && ! empty($extrafields->attribute_label)) - { - print $object->showOptionals($extrafields,'edit'); - } - + $parameters=array('colspan' => ' colspan="2"'); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + if (empty($reshook) && ! empty($extrafields->attribute_label)) + { + print $object->showOptionals($extrafields,'edit'); + } + print "\n"; print '
   
'; @@ -502,7 +502,7 @@ if (! empty($id) && $action != 'edit') print ''; print ''; - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $nbrows=12; if (! empty($conf->projet->enabled)) $nbrows++; @@ -570,7 +570,7 @@ if (! empty($id) && $action != 'edit') $objp = $db->fetch_object($resql); $var=!$var; print "'; + print ''.img_object($langs->trans("Payment"),"payment").' '.$objp->rowid.''; print '\n"; $labeltype=$langs->trans("PaymentType".$object->type_code)!=("PaymentType".$object->type_code)?$langs->trans("PaymentType".$object->type_code):$object->paiement_type; print "\n"; @@ -639,12 +639,12 @@ if (! empty($id) && $action != 'edit') } // Other attributes - $parameters=array(); - $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - if (empty($reshook) && ! empty($extrafields->attribute_label)) - { - print $object->showOptionals($extrafields); - } + $parameters=array('colspan' => ' colspan="2"'); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + if (empty($reshook) && ! empty($extrafields->attribute_label)) + { + print $object->showOptionals($extrafields); + } print "
"; - print ''.img_object($langs->trans("Payment"),"payment").' '.$objp->rowid.''.dol_print_date($db->jdate($objp->dp),'day')."".$labeltype.' '.$object->num_paiement."
\n"; print "\n"; @@ -679,7 +679,7 @@ if (! empty($id) && $action != 'edit') } else { - print ''; + print ''; } } diff --git a/htdocs/donations/class/don.class.php b/htdocs/don/class/don.class.php similarity index 93% rename from htdocs/donations/class/don.class.php rename to htdocs/don/class/don.class.php index e02ecefccbc..c9f776e5ce6 100644 --- a/htdocs/donations/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -20,7 +20,7 @@ */ /** - * \file htdocs/donations/class/don.class.php + * \file htdocs/don/class/don.class.php * \ingroup Donation * \brief File of class to manage donations */ @@ -369,24 +369,22 @@ class Don extends CommonObject $result = $this->db->query($sql); if ($result) { - // Actions on extra fields (by external module) - /*$hookmanager->initHooks(array('dondao')); - $parameters=array('id'=>$this->id); - $action=''; - $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks - if (empty($reshook)) - { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used - { - $result=$this->insertExtraFields(); - if ($result < 0) - { - $error++; - } - } - } - else if ($reshook < 0) $error++; - */ + // Actions on extra fields (by external module or standard code) + $hookmanager->initHooks(array('donationdao')); + $parameters=array('id'=>$this->id); + $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if (empty($reshook)) + { + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + { + $result=$this->insertExtraFields(); + if ($result < 0) + { + $error++; + } + } + } + else if ($reshook < 0) $error++; $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."don"); @@ -448,23 +446,22 @@ class Don extends CommonObject $result = $this->db->query($sql); if ($result) { - // Actions on extra fields (by external module) - $hookmanager->initHooks(array('dondao')); - $parameters=array('id'=>$this->id); - $action=''; - $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks - if (empty($reshook)) - { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used - { - $result=$this->insertExtraFields(); - if ($result < 0) - { - $error++; - } - } - } - else if ($reshook < 0) $error++; + // Actions on extra fields (by external module or standard code) + $hookmanager->initHooks(array('donationdao')); + $parameters=array('id'=>$this->id); + $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if (empty($reshook)) + { + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + { + $result=$this->insertExtraFields(); + if ($result < 0) + { + $error++; + } + } + } + else if ($reshook < 0) $error++; // Call trigger $result=$this->call_trigger('DON_UPDATE',$user); @@ -500,15 +497,14 @@ class Don extends CommonObject { if ( $this->db->affected_rows($resql) ) { - // Removed extrafields - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + // Remove extrafields + if ((! $error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used { $result=$this->deleteExtraFields(); if ($result < 0) { $error++; - $errorflag=-4; - dol_syslog(get_class($this)."::delete error ".$errorflag." ".$this->error, LOG_ERR); + dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR); } } @@ -779,7 +775,7 @@ class Don extends CommonObject $result=''; $label=$langs->trans("ShowDonation").': '.$this->id; - $link = ''; + $link = ''; $linkend=''; $picto='generic'; diff --git a/htdocs/donations/class/donationstats.class.php b/htdocs/don/class/donationstats.class.php similarity index 96% rename from htdocs/donations/class/donationstats.class.php rename to htdocs/don/class/donationstats.class.php index b26617d651b..63105da07d2 100644 --- a/htdocs/donations/class/donationstats.class.php +++ b/htdocs/don/class/donationstats.class.php @@ -19,13 +19,13 @@ */ /** - * \file htdocs/donations/class/donationstats.class.php + * \file htdocs/don/class/dontats.class.php * \ingroup donations * \brief File of class to manage donations statistics */ include_once DOL_DOCUMENT_ROOT . '/core/class/stats.class.php'; -include_once DOL_DOCUMENT_ROOT . '/donations/class/don.class.php'; +include_once DOL_DOCUMENT_ROOT . '/don/class/don.class.php'; include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; diff --git a/htdocs/don/class/index.html b/htdocs/don/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/donations/class/paymentdonation.class.php b/htdocs/don/class/paymentdonation.class.php similarity index 97% rename from htdocs/donations/class/paymentdonation.class.php rename to htdocs/don/class/paymentdonation.class.php index 9125ea68d57..4a42c677ec9 100644 --- a/htdocs/donations/class/paymentdonation.class.php +++ b/htdocs/don/class/paymentdonation.class.php @@ -16,7 +16,7 @@ */ /** - * \file htdocs/donations/class/paymentdonation.class.php + * \file htdocs/don/class/paymentdonation.class.php * \ingroup Donation * \brief File of class to manage payment of donations */ @@ -510,7 +510,7 @@ class PaymentDonation extends CommonObject // Add link 'payment', 'payment_supplier', 'payment_donation' in bank_url between payment and bank transaction $url=''; - if ($mode == 'payment_donation') $url=DOL_URL_ROOT.'/donations/payment/card.php?rowid='; + if ($mode == 'payment_donation') $url=DOL_URL_ROOT.'/don/payment/card.php?rowid='; if ($url) { $result=$acc->add_url_line($bank_line_id, $this->id, $url, '(paiement)', $mode); @@ -529,7 +529,7 @@ class PaymentDonation extends CommonObject { $don = new Don($this->db); $don->fetch($key); - $result=$acc->add_url_line($bank_line_id, $don->rowid, DOL_URL_ROOT.'/donations/card.php?rowid=', $don->type_libelle.(($don->lib && $don->lib!=$don->type_libelle)?' ('.$don->lib.')':''),'donation'); + $result=$acc->add_url_line($bank_line_id, $don->rowid, DOL_URL_ROOT.'/don/card.php?rowid=', $don->type_libelle.(($don->lib && $don->lib!=$don->type_libelle)?' ('.$don->lib.')':''),'donation'); if ($result <= 0) dol_print_error($this->db); } } @@ -593,7 +593,7 @@ class PaymentDonation extends CommonObject if (!empty($this->id)) { - $link = ''; + $link = ''; $linkend=''; if ($withpicto) $result.=($link.img_object($label, 'payment', 'class="classfortooltip"').$linkend.' '); diff --git a/htdocs/donations/document.php b/htdocs/don/document.php similarity index 92% rename from htdocs/donations/document.php rename to htdocs/don/document.php index 0cfb0447630..200e4180252 100644 --- a/htdocs/donations/document.php +++ b/htdocs/don/document.php @@ -16,13 +16,13 @@ */ /** - * \file htdocs/donations/document.php + * \file htdocs/don/document.php * \ingroup donations * \brief Page of linked files into donations */ require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/donations/class/don.class.php'; +require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/donation.lib.php'; @@ -96,7 +96,7 @@ if ($object->id) print ''; - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; // Ref print ''; - print ''; + print ''; print '\n"; print ''; diff --git a/htdocs/donations/stats/index.php b/htdocs/don/stats/index.php similarity index 97% rename from htdocs/donations/stats/index.php rename to htdocs/don/stats/index.php index 0a58751b8ed..798b1b5a392 100644 --- a/htdocs/donations/stats/index.php +++ b/htdocs/don/stats/index.php @@ -18,14 +18,14 @@ */ /** - * \file htdocs/donations/stats/index.php + * \file htdocs/don/stats/index.php * \ingroup donations * \brief Page with donations statistics */ require '../../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/donations/class/don.class.php'; -require_once DOL_DOCUMENT_ROOT.'/donations/class/donationstats.class.php'; +require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; +require_once DOL_DOCUMENT_ROOT.'/don/class/dontats.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $WIDTH=DolGraph::getDefaultGraphSizeForStats('width'); @@ -213,7 +213,7 @@ if (! count($arrayyears)) $arrayyears[$nowyear]=$nowyear; $h=0; $head = array(); -$head[$h][0] = DOL_URL_ROOT . '/donations/stats/index.php?mode='.$mode; +$head[$h][0] = DOL_URL_ROOT . '/don/stats/index.php?mode='.$mode; $head[$h][1] = $langs->trans("ByMonthYear"); $head[$h][2] = 'byyear'; $h++; diff --git a/htdocs/install/filelist.xml b/htdocs/install/filelist.xml index e9ae4ec5dd1..7b7ed9c36ef 100644 --- a/htdocs/install/filelist.xml +++ b/htdocs/install/filelist.xml @@ -5893,7 +5893,7 @@ d41d8cd98f00b204e9800998ecf8427e8ea20800d43bbdfdb20363355521c20c - + 9029f09e1592da49626e9fb5b6399e1e d71afb404b4f1946d241bc44ab27df8b 823e0c612e7de62db2d41adf37214bea diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index f66a007e93a..d08ed699b7f 100755 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1563,7 +1563,7 @@ class Product extends CommonObject $this->db->free($resql); - // Retreive all extrafield for thirdparty + // Retrieve all extrafield for thirdparty // fetch optionals attributes and labels require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'); $extrafields=new ExtraFields($this->db);
'.$langs->trans("Ref").''; diff --git a/htdocs/don/index.html b/htdocs/don/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/donations/index.php b/htdocs/don/index.php similarity index 98% rename from htdocs/donations/index.php rename to htdocs/don/index.php index ac64d6b2dde..b276e21dc50 100644 --- a/htdocs/donations/index.php +++ b/htdocs/don/index.php @@ -18,13 +18,13 @@ */ /** - * \file htdocs/donations/index.php + * \file htdocs/don/index.php * \ingroup donations * \brief Home page of donation module */ require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/donations/class/don.class.php'; +require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; $langs->load("donations"); diff --git a/htdocs/donations/info.php b/htdocs/don/info.php similarity index 93% rename from htdocs/donations/info.php rename to htdocs/don/info.php index a85b734fcf6..04cbae7a587 100644 --- a/htdocs/donations/info.php +++ b/htdocs/don/info.php @@ -16,7 +16,7 @@ */ /** - * \file htdocs/donations/info.php + * \file htdocs/don/info.php * \ingroup donations * \brief Page to show a donation information */ @@ -24,7 +24,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/donation.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/donations/class/don.class.php'; +require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; $langs->load("donations"); diff --git a/htdocs/donations/list.php b/htdocs/don/list.php similarity index 98% rename from htdocs/donations/list.php rename to htdocs/don/list.php index f277dc0b671..ee7a6f5e6f9 100644 --- a/htdocs/donations/list.php +++ b/htdocs/don/list.php @@ -19,13 +19,13 @@ */ /** - * \file htdocs/donations/list.php + * \file htdocs/don/list.php * \ingroup donations * \brief List of donations */ require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/donations/class/don.class.php'; +require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $langs->load("companies"); diff --git a/htdocs/donations/payment/card.php b/htdocs/don/payment/card.php similarity index 95% rename from htdocs/donations/payment/card.php rename to htdocs/don/payment/card.php index 6b30fdcc89b..5cdb7f20446 100644 --- a/htdocs/donations/payment/card.php +++ b/htdocs/don/payment/card.php @@ -16,14 +16,14 @@ */ /** - * \file htdocs/donations/payment/card.php + * \file htdocs/don/payment/card.php * \ingroup donations * \brief Tab payment of a donation */ require '../../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/donations/class/don.class.php'; -require_once DOL_DOCUMENT_ROOT.'/donations/class/paymentdonation.class.php'; +require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; +require_once DOL_DOCUMENT_ROOT.'/don/class/paymentdonation.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php'; if (! empty($conf->banque->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; @@ -61,7 +61,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->don->supp if ($result > 0) { $db->commit(); - header("Location: ".DOL_URL_ROOT."/donations/index.php"); + header("Location: ".DOL_URL_ROOT."/don/index.php"); exit; } else @@ -121,7 +121,7 @@ $form = new Form($db); $h=0; -$head[$h][0] = DOL_URL_ROOT.'/donations/payment/card.php?id='.$id; +$head[$h][0] = DOL_URL_ROOT.'/don/payment/card.php?id='.$id; $head[$h][1] = $langs->trans("Card"); $hselected = $h; $h++; diff --git a/htdocs/don/payment/index.html b/htdocs/don/payment/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/donations/payment/payment.php b/htdocs/don/payment/payment.php similarity index 95% rename from htdocs/donations/payment/payment.php rename to htdocs/don/payment/payment.php index 871bbaa1056..52cf8f38a12 100644 --- a/htdocs/donations/payment/payment.php +++ b/htdocs/don/payment/payment.php @@ -16,14 +16,14 @@ */ /** - * \file htdocs/donations/payment.php + * \file htdocs/don/payment.php * \ingroup donations * \brief Page to add payment of a donation */ require '../../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/donations/class/don.class.php'; -require_once DOL_DOCUMENT_ROOT.'/donations/class/paymentdonation.class.php'; +require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; +require_once DOL_DOCUMENT_ROOT.'/don/class/paymentdonation.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $langs->load("bills"); @@ -50,7 +50,7 @@ if ($action == 'add_payment') if ($_POST["cancel"]) { - $loc = DOL_URL_ROOT.'/donations/card.php?rowid='.$chid; + $loc = DOL_URL_ROOT.'/don/card.php?rowid='.$chid; header("Location: ".$loc); exit; } @@ -129,7 +129,7 @@ if ($action == 'add_payment') if (! $error) { $db->commit(); - $loc = DOL_URL_ROOT.'/donations/card.php?rowid='.$chid; + $loc = DOL_URL_ROOT.'/don/card.php?rowid='.$chid; header('Location: '.$loc); exit; } @@ -180,7 +180,7 @@ if (GETPOST("action") == 'create') print '
'.$langs->trans("Donation").'
'.$langs->trans("Ref").''.$chid.'
'.$langs->trans("Ref").''.$chid.'
'.$langs->trans("Date")."".dol_print_date($don->date,'day')."
'.$langs->trans("Amount")."".price($don->amount,0,$outputlangs,1,-1,-1,$conf->currency).'