From 1cf786acff1dc3c31c0006e47238c349e5179fb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnter=20Lukas?= Date: Tue, 22 Jan 2019 00:09:36 +0100 Subject: [PATCH 01/46] Fix #10278 Fix #10278 --- htdocs/core/class/commonobject.class.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 676e76fe16a..d8d27a0378a 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4932,8 +4932,6 @@ abstract class CommonObject $new_array_options[$key] = price2num($this->array_options[$key]); break; case 'date': - $new_array_options[$key] = $this->db->idate($this->array_options[$key]); - break; case 'datetime': // If data is a string instead of a timestamp, we convert it if (! is_int($this->array_options[$key])) { From b017213131e278ab1603d0e1a78402bed704e100 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 17 Feb 2019 20:59:39 +0100 Subject: [PATCH 02/46] selectMulticurrency avoid malformed empty value --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 58df0ad4e22..c451a83a4fb 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4517,7 +4517,7 @@ class Form $out=''; $out.= ''; +print ''; + +// Define main accounts for closure +print ''; + +foreach ($list_account_main as $key) { + + print ''; + // Param + $label = $langs->trans($key); + $keydesc=$key.'_Desc'; + + $htmltext = $langs->trans($keydesc); + print ''; + // Value + print ''; + print ''; +} + +// Journal +print ''; +print ''; +print ''; + +print "
'; + print $form->textwithpicto($label, $htmltext); + print ''; // Do not force align=right, or it align also the content of the select box + print $formaccounting->select_account($conf->global->$key, $key, 1, '', 1, 1); + print '
' . $langs->trans("ACCOUNTING_CLOSURE_DEFAULT_JOURNAL") . ''; +$defaultjournal=$conf->global->ACCOUNTING_CLOSURE_DEFAULT_JOURNAL; +print $formaccounting->select_journal($defaultjournal, "ACCOUNTING_CLOSURE_DEFAULT_JOURNAL", 9, 1, 0, 0); +print '
\n"; + +print '
'; + +print ''; + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/accountancy/admin/defaultaccounts.php b/htdocs/accountancy/admin/defaultaccounts.php index fc5f5980df5..5b39a38657f 100644 --- a/htdocs/accountancy/admin/defaultaccounts.php +++ b/htdocs/accountancy/admin/defaultaccounts.php @@ -53,8 +53,6 @@ $list_account_main = array ( ); $list_account = array ( - 'ACCOUNTING_RESULT_PROFIT', - 'ACCOUNTING_RESULT_LOSS', 'ACCOUNTING_PRODUCT_BUY_ACCOUNT', 'ACCOUNTING_PRODUCT_SOLD_ACCOUNT', 'ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT', diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index 028e6569378..a5b0a574c35 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -89,7 +89,7 @@ class FormAccounting extends Form $sql.= " FROM " . MAIN_DB_PREFIX . "accounting_journal"; $sql.= " WHERE active = 1"; $sql.= " AND entity = ".$conf->entity; - //if ($nature && is_numeric($nature)) $sql .= " AND nature = ".$nature; + if ($nature && is_numeric($nature)) $sql .= " AND nature = ".$nature; $sql.= " ORDER BY code"; dol_syslog(get_class($this) . "::select_journal", LOG_DEBUG); diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index f49c4cb6027..50d1862f39f 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -249,7 +249,8 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left 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->accounting->enabled && $conf->expensereport->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2462__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_expensereport', 2451__+MAX_llx_menu__, '/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuExpenseReportAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 54, __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->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2463__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_product', 2451__+MAX_llx_menu__, '/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuProductsAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 55, __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->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2464__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_export', 2451__+MAX_llx_menu__, '/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'ExportOptions', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 60, __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->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2464__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_export', 2451__+MAX_llx_menu__, '/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'ExportOptions', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 60, __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->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2465__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_closure', 2451__+MAX_llx_menu__, '/accountancy/admin/closure.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuClosureAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 70, __ENTITY__); -- Accounting period 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->accounting->enabled && $leftmenu=="accountancy_admin" && $conf->global->MAIN_FEATURES_LEVEL > 0', __HANDLER__, 'left', 2450__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_period', 2451__+MAX_llx_menu__, '/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'FiscalPeriod', 1, 'admin', '', '', 2, 80, __ENTITY__); -- Binding diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 7a43aa43d60..ab2599728d8 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1058,6 +1058,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM } $newmenu->add("/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuProductsAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_product', 55); $newmenu->add("/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ExportOptions"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_export', 60); + $newmenu->add("/accountancy/admin/closure.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuClosureAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_closure', 70); // Fiscal year if ($conf->global->MAIN_FEATURES_LEVEL > 1) { diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 1a153d1f80d..014cc9827f9 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -96,6 +96,7 @@ MenuTaxAccounts=Tax accounts MenuExpenseReportAccounts=Expense report accounts MenuLoanAccounts=Loan accounts MenuProductsAccounts=Product accounts +MenuClosureAccounts=Closure accounts ProductsBinding=Products accounts Ventilation=Binding to accounts CustomersVentilation=Customer invoice binding @@ -149,8 +150,9 @@ ACCOUNTING_EXPENSEREPORT_JOURNAL=Expense report journal ACCOUNTING_SOCIAL_JOURNAL=Social journal ACCOUNTING_HAS_NEW_JOURNAL=Has new Journal -ACCOUNTING_RESULT_PROFIT=Accounting account of profit result -ACCOUNTING_RESULT_LOSS=Accounting account of loss result +ACCOUNTING_RESULT_PROFIT=Result accounting account (Profit) +ACCOUNTING_RESULT_LOSS=Result accounting account (Loss) +ACCOUNTING_CLOSURE_DEFAULT_JOURNAL=Journal of closure ACCOUNTING_ACCOUNT_TRANSFER_CASH=Accounting account of transfer ACCOUNTING_ACCOUNT_SUSPENSE=Accounting account of wait @@ -289,6 +291,7 @@ ChartofaccountsId=Chart of accounts Id InitAccountancy=Init accountancy InitAccountancyDesc=This page can be used to initialize an accounting account on products and services that does not have accounting account defined for sales and purchases. DefaultBindingDesc=This page can be used to set a default account to use to link transactions record about payment salaries, donation, taxes and vat when no specific accounting account were already set. +DefaultClosureDesc=This page can be used to set accounts to use to enclose a balance sheet. Options=Options OptionModeProductSell=Mode sales OptionModeProductBuy=Mode purchases From f5b5859089958d21c8019958aeb4ce669c41105d Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 18 Feb 2019 07:16:00 +0100 Subject: [PATCH 05/46] Language --- htdocs/langs/en_US/accountancy.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 014cc9827f9..86c510dfe00 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -291,7 +291,7 @@ ChartofaccountsId=Chart of accounts Id InitAccountancy=Init accountancy InitAccountancyDesc=This page can be used to initialize an accounting account on products and services that does not have accounting account defined for sales and purchases. DefaultBindingDesc=This page can be used to set a default account to use to link transactions record about payment salaries, donation, taxes and vat when no specific accounting account were already set. -DefaultClosureDesc=This page can be used to set accounts to use to enclose a balance sheet. +DefaultClosureDesc=This page can be used to set parameters to use to enclose a balance sheet. Options=Options OptionModeProductSell=Mode sales OptionModeProductBuy=Mode purchases From c22be202d9d16022efa87c4752170a2fda3e3f09 Mon Sep 17 00:00:00 2001 From: bomuux Date: Mon, 18 Feb 2019 23:17:03 +0100 Subject: [PATCH 06/46] SQL error in box_project.php Corrected a bug : for an internal user with no rights to see all projects, the project box on home cause an error in log. Finally a lot of simplification because Project::getProjectsAuthorizedForUser do most of the filtering. --- htdocs/core/boxes/box_project.php | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index 7ab97832637..a969d2126e6 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -89,21 +89,14 @@ class box_project extends ModeleBoxes include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $projectstatic = new Project($this->db); - $socid=$user->societe_id; - - // Get list of project id allowed to user (in a string list separated by coma) + // Get list of project id allowed to user (in a string list separated by coma) $projectsListId=''; - if (! $user->rights->projet->all->lire) $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1, $socid); + if (! $user->rights->projet->all->lire) $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1, $user->socid); $sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut, p.public"; $sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; - if($user->socid) $sql.= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid=p.fk_soc"; - $sql.= " WHERE p.entity IN (".getEntity('project').')'; - if (! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")"; // public and assigned to, or restricted to company for external users - if ($user->socid) $sql.= " AND s.rowid = ".$user->socid; - $sql.= " AND p.fk_statut = 1"; // Seulement les projets ouverts - if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; - if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND ((s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id.") OR (s.rowid IS NULL))"; + $sql.= " WHERE p.fk_statut = 1"; // Only open projects + if (! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")"; // public and assigned to, or restricted to company for external users $sql.= " ORDER BY p.datec DESC"; //$sql.= $db->plimit($max, 0); From d3627c143808a01ba73979876ec05686e0b77216 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 19 Feb 2019 15:49:54 +0100 Subject: [PATCH 07/46] NEW options for alternative method payment request api (ex apple pay) and sepa direct debit --- htdocs/stripe/admin/stripe.php | 56 ++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 20 deletions(-) diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index 100a85f6c30..056c993bcec 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -2,7 +2,7 @@ /* Copyright (C) 2017 Alexandre Spangaro * Copyright (C) 2017 Olivier Geffroy * Copyright (C) 2017 Saasprov - * Copyright (C) 2018 ptibogxiv + * Copyright (C) 2018-2019 Thibault FOUCART * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -78,9 +78,6 @@ if ($action == 'setvalue' && $user->admin) $result = dolibarr_set_const($db, "STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS", GETPOST('STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS', 'int'), 'chaine', 0, '', $conf->entity); if (! $result > 0) $error ++; - $result = dolibarr_set_const($db, "STRIPE_MINIMAL_3DSECURE", GETPOST('STRIPE_MINIMAL_3DSECURE', 'int'), 'chaine', 0, '', $conf->entity); - if (! $result > 0) - $error ++; $result = dolibarr_set_const($db, "ONLINE_PAYMENT_CSS_URL", GETPOST('ONLINE_PAYMENT_CSS_URL', 'alpha'), 'chaine', 0, '', $conf->entity); if (! $result > 0) $error ++; @@ -166,17 +163,11 @@ print "\n"; print ''; print ''; print $langs->trans("StripeLiveEnabled").''; -if (!empty($conf->global->STRIPE_LIVE)) -{ - print ''; - print img_picto($langs->trans("Activated"), 'switch_on'); - print ''; -} -else -{ - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('STRIPE_LIVE'); +} else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("STRIPE_LIVE", $arrval, $conf->global->STRIPE_LIVE); } print ''; @@ -272,16 +263,36 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // What is this for ? print ''; } -// Minimal amount for force 3Dsecure if it's optionnal +// Activate Payment Request API +if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // TODO Not used by current code +{ + print ''; + print $langs->trans("STRIPE_PAYMENT_REQUEST_API").''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('STRIPE_PAYMENT_REQUEST_API'); +} else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("STRIPE_PAYMENT_REQUEST_API", $arrval, $conf->global->STRIPE_PAYMENT_REQUEST_API); +} + print ''; +} + +// Activate SEPA DIRECT_DEBIT if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // TODO Not used by current code { print ''; - print $langs->trans("STRIPE_MINIMAL_3DSECURE").''; - print ''.$langs->getCurrencySymbol($conf->currency).''; + print $langs->trans("STRIPE_SEPA_DIRECT_DEBIT").''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('STRIPE_SEPA_DIRECT_DEBIT'); +} else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("STRIPE_SEPA_DIRECT_DEBIT", $arrval, $conf->global->STRIPE_SEPA_DIRECT_DEBIT); +} + print ''; } // Warehouse for automatic decrement -if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // What is this for ? +if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // warehouse to reduce stock for online payment { print ''; print $langs->trans("ONLINE_PAYMENT_WAREHOUSE").''; @@ -329,7 +340,12 @@ print ''; print ''; print $langs->trans("SecurityTokenIsUnique").''; -print $form->selectyesno("PAYMENT_SECURITY_TOKEN_UNIQUE", (empty($conf->global->PAYMENT_SECURITY_TOKEN)?0:$conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE), 1); +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('PAYMENT_SECURITY_TOKEN_UNIQUE'); +} else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("PAYMENT_SECURITY_TOKEN_UNIQUE", $arrval, $conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE); +} print ''; print ''; From 97620e91c948c65808ea01cd490a0d3eaa0fccc5 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 19 Feb 2019 16:31:39 +0100 Subject: [PATCH 08/46] add link to webhook --- htdocs/stripe/admin/stripe.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index 056c993bcec..dc63efbd99b 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -2,7 +2,7 @@ /* Copyright (C) 2017 Alexandre Spangaro * Copyright (C) 2017 Olivier Geffroy * Copyright (C) 2017 Saasprov - * Copyright (C) 2018-2019 Thibault FOUCART + * Copyright (C) 2018 ptibogxiv * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -186,9 +186,14 @@ if (empty($conf->stripeconnect->enabled)) print ''; print ''; - print ''.$langs->trans("STRIPE_TEST_WEBHOOK_KEY").''; + print ''.$langs->trans("STRIPE_TEST_WEBHOOK_KEY").''; print ''; print '   '.$langs->trans("Example").': whsec_xxxxxxxxxxxxxxxxxxxxxxxx'; + $out = img_picto('', 'object_globe.png').' '.$langs->trans("ToOfferALinkForTestWebhook").'
'; + $url = dol_buildpath('/public/stripe/ipn.php?test', 2); + $out.= ''; + $out.= ajax_autoselect("onlinetestwebhookurl", 0); + print '
'.$out; print ''; } else { print ''.$langs->trans("StripeConnect").''; @@ -216,9 +221,14 @@ if (empty($conf->stripeconnect->enabled)) print ''; print ''; - print ''.$langs->trans("STRIPE_LIVE_WEBHOOK_KEY").''; + print ''.$langs->trans("STRIPE_LIVE_WEBHOOK_KEY").''; print ''; print '   '.$langs->trans("Example").': whsec_xxxxxxxxxxxxxxxxxxxxxxxx'; + $out = img_picto('', 'object_globe.png').' '.$langs->trans("ToOfferALinkForLiveWebhook").'
'; + $url = dol_buildpath('/public/stripe/ipn.php', 2); + $out.= ''; + $out.= ajax_autoselect("onlinelivewebhookurl", 0); + print '
'.$out; print ''; } else From 8e55802e92e55aa321dabc971dc8dc4050fc70e2 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 19 Feb 2019 19:40:47 +0100 Subject: [PATCH 09/46] Update stripe.php --- htdocs/stripe/admin/stripe.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index dc63efbd99b..ac86a893903 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -165,7 +165,7 @@ print ''; print $langs->trans("StripeLiveEnabled").''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('STRIPE_LIVE'); -} else { + } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); print $form->selectarray("STRIPE_LIVE", $arrval, $conf->global->STRIPE_LIVE); } @@ -193,7 +193,7 @@ if (empty($conf->stripeconnect->enabled)) $url = dol_buildpath('/public/stripe/ipn.php?test', 2); $out.= ''; $out.= ajax_autoselect("onlinetestwebhookurl", 0); - print '
'.$out; + print '
'.$out; print ''; } else { print ''.$langs->trans("StripeConnect").''; @@ -228,7 +228,7 @@ if (empty($conf->stripeconnect->enabled)) $url = dol_buildpath('/public/stripe/ipn.php', 2); $out.= ''; $out.= ajax_autoselect("onlinelivewebhookurl", 0); - print '
'.$out; + print '
'.$out; print ''; } else @@ -280,7 +280,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // TODO Not used by current code print $langs->trans("STRIPE_PAYMENT_REQUEST_API").''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('STRIPE_PAYMENT_REQUEST_API'); -} else { + } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); print $form->selectarray("STRIPE_PAYMENT_REQUEST_API", $arrval, $conf->global->STRIPE_PAYMENT_REQUEST_API); } @@ -294,7 +294,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // TODO Not used by current code print $langs->trans("STRIPE_SEPA_DIRECT_DEBIT").''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('STRIPE_SEPA_DIRECT_DEBIT'); -} else { + } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); print $form->selectarray("STRIPE_SEPA_DIRECT_DEBIT", $arrval, $conf->global->STRIPE_SEPA_DIRECT_DEBIT); } From ea6e397d18a9bffc78d5e943e739151a9441295a Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 19 Feb 2019 22:28:26 +0100 Subject: [PATCH 10/46] Update stripe.php --- htdocs/stripe/admin/stripe.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index ac86a893903..4a3b189a71e 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -168,7 +168,7 @@ print $langs->trans("StripeLiveEnabled").''; } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); print $form->selectarray("STRIPE_LIVE", $arrval, $conf->global->STRIPE_LIVE); -} + } print ''; if (empty($conf->stripeconnect->enabled)) @@ -282,8 +282,8 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // TODO Not used by current code print ajax_constantonoff('STRIPE_PAYMENT_REQUEST_API'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("STRIPE_PAYMENT_REQUEST_API", $arrval, $conf->global->STRIPE_PAYMENT_REQUEST_API); -} + print $form->selectarray("STRIPE_PAYMENT_REQUEST_API", $arrval, $conf->global->STRIPE_PAYMENT_REQUEST_API): + } print ''; } @@ -297,7 +297,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // TODO Not used by current code } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); print $form->selectarray("STRIPE_SEPA_DIRECT_DEBIT", $arrval, $conf->global->STRIPE_SEPA_DIRECT_DEBIT); -} + } print ''; } From 0a3e0bc2682592987b24c2f083a000f1f8d64b03 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 19 Feb 2019 22:56:07 +0100 Subject: [PATCH 11/46] Update stripe.php --- htdocs/stripe/admin/stripe.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index 4a3b189a71e..46c12801c51 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -282,7 +282,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // TODO Not used by current code print ajax_constantonoff('STRIPE_PAYMENT_REQUEST_API'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("STRIPE_PAYMENT_REQUEST_API", $arrval, $conf->global->STRIPE_PAYMENT_REQUEST_API): + print $form->selectarray("STRIPE_PAYMENT_REQUEST_API", $arrval, $conf->global->STRIPE_PAYMENT_REQUEST_API); } print ''; } From 0af6426f8c7ec6fb924e35eafafd6612c02b46dc Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 19 Feb 2019 23:36:59 +0100 Subject: [PATCH 12/46] Update stripe.php --- htdocs/stripe/admin/stripe.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index 46c12801c51..172e1897417 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -193,7 +193,7 @@ if (empty($conf->stripeconnect->enabled)) $url = dol_buildpath('/public/stripe/ipn.php?test', 2); $out.= ''; $out.= ajax_autoselect("onlinetestwebhookurl", 0); - print '
'.$out; + print '
'.$out; print ''; } else { print ''.$langs->trans("StripeConnect").''; @@ -228,7 +228,7 @@ if (empty($conf->stripeconnect->enabled)) $url = dol_buildpath('/public/stripe/ipn.php', 2); $out.= ''; $out.= ajax_autoselect("onlinelivewebhookurl", 0); - print '
'.$out; + print '
'.$out; print ''; } else From 0428e026c9a53c8a5ab0e04ecf7d78b2520b60be Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Thu, 21 Feb 2019 15:08:19 +0100 Subject: [PATCH 13/46] Update stripe.php --- htdocs/stripe/admin/stripe.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index 172e1897417..0c6e195910d 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -187,7 +187,7 @@ if (empty($conf->stripeconnect->enabled)) print ''; print ''.$langs->trans("STRIPE_TEST_WEBHOOK_KEY").''; - print ''; + print ''; print '   '.$langs->trans("Example").': whsec_xxxxxxxxxxxxxxxxxxxxxxxx'; $out = img_picto('', 'object_globe.png').' '.$langs->trans("ToOfferALinkForTestWebhook").'
'; $url = dol_buildpath('/public/stripe/ipn.php?test', 2); @@ -222,7 +222,7 @@ if (empty($conf->stripeconnect->enabled)) print ''; print ''.$langs->trans("STRIPE_LIVE_WEBHOOK_KEY").''; - print ''; + print ''; print '   '.$langs->trans("Example").': whsec_xxxxxxxxxxxxxxxxxxxxxxxx'; $out = img_picto('', 'object_globe.png').' '.$langs->trans("ToOfferALinkForLiveWebhook").'
'; $url = dol_buildpath('/public/stripe/ipn.php', 2); From 6ba5708814627d346a3cf1d8d0a7c7d2e500c368 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 23 Feb 2019 19:26:52 +0100 Subject: [PATCH 14/46] disable online payment warehouse --- htdocs/stripe/admin/stripe.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index 0c6e195910d..5e2c27dd392 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -94,9 +94,9 @@ if ($action == 'setvalue' && $user->admin) if (! $result > 0) $error ++; // Stock decrement - $result = dolibarr_set_const($db, "ONLINE_PAYMENT_WAREHOUSE", (GETPOST('ONLINE_PAYMENT_WAREHOUSE', 'alpha') > 0 ? GETPOST('ONLINE_PAYMENT_WAREHOUSE', 'alpha') : ''), 'chaine', 0, '', $conf->entity); - if (! $result > 0) - $error ++; + //$result = dolibarr_set_const($db, "ONLINE_PAYMENT_WAREHOUSE", (GETPOST('ONLINE_PAYMENT_WAREHOUSE', 'alpha') > 0 ? GETPOST('ONLINE_PAYMENT_WAREHOUSE', 'alpha') : ''), 'chaine', 0, '', $conf->entity); + //if (! $result > 0) + // $error ++; // Payment token for URL $result = dolibarr_set_const($db, "PAYMENT_SECURITY_TOKEN", GETPOST('PAYMENT_SECURITY_TOKEN', 'alpha'), 'chaine', 0, '', $conf->entity); @@ -302,13 +302,13 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // TODO Not used by current code } // Warehouse for automatic decrement -if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // warehouse to reduce stock for online payment -{ - print ''; - print $langs->trans("ONLINE_PAYMENT_WAREHOUSE").''; - print $formproduct->selectWarehouses($conf->global->ONLINE_PAYMENT_WAREHOUSE, 'ONLINE_PAYMENT_WAREHOUSE', '', 1, $disabled); - print ''; -} +//if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // warehouse to reduce stock for online payment +//{ +// print ''; +// print $langs->trans("ONLINE_PAYMENT_WAREHOUSE").''; +// print $formproduct->selectWarehouses($conf->global->ONLINE_PAYMENT_WAREHOUSE, 'ONLINE_PAYMENT_WAREHOUSE', '', 1, $disabled); +// print ''; +//} print ''; print $langs->trans("CSSUrlForPaymentForm").''; From 435b416f939b7d906abb246c711acca8a8d25914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 24 Feb 2019 11:50:06 +0100 Subject: [PATCH 15/46] fix #10656 --- htdocs/fourn/facture/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 98a6956a809..4d2c81dbbfa 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -387,6 +387,7 @@ if (! $search_all) $sql.= " f.total_ht, f.total_ttc, f.total_tva, f.paye, f.fk_statut, f.libelle, f.datec, f.tms,"; $sql.= " f.localtax1, f.localtax2,"; $sql.= ' s.rowid, s.nom, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,'; + $sql .= ' p.title,'; $sql.= " typent.code,"; $sql.= " state.code_departement, state.nom,"; $sql.= ' country.code,'; From ca2eba866c641d799f378a834ef99ccd652f9179 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 24 Feb 2019 11:56:17 +0100 Subject: [PATCH 16/46] Update list.php --- htdocs/fourn/facture/list.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 4d2c81dbbfa..4b208a99af7 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -387,11 +387,10 @@ if (! $search_all) $sql.= " f.total_ht, f.total_ttc, f.total_tva, f.paye, f.fk_statut, f.libelle, f.datec, f.tms,"; $sql.= " f.localtax1, f.localtax2,"; $sql.= ' s.rowid, s.nom, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,'; - $sql .= ' p.title,'; $sql.= " typent.code,"; $sql.= " state.code_departement, state.nom,"; $sql.= ' country.code,'; - $sql.= " p.rowid, p.ref"; + $sql.= " p.rowid, p.ref, p.title"; foreach ($extrafields->attribute_label as $key => $val) //prevent error with sql_mode=only_full_group_by { From 2ad91213b2dd5c2bcd136b51f8a281f688df6378 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 24 Feb 2019 12:09:57 +0100 Subject: [PATCH 17/46] Update combinations.php --- htdocs/variants/combinations.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index 04f53e55d21..8c8f669c0e0 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -1,6 +1,7 @@ * Copyright (C) 2017 Laurent Destailleur + * Copyright (C) 2019 Frédéric France * * 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 @@ -30,9 +31,9 @@ $langs->load("other"); $var = false; $id = GETPOST('id', 'int'); $valueid = GETPOST('valueid', 'int'); -$ref = GETPOST('ref'); -$weight_impact = (float) GETPOST('weight_impact'); -$price_impact = (float) GETPOST('price_impact'); +$ref = GETPOST('ref', 'alpha'); +$weight_impact = GETPOST('weight_impact', 'alpha'); +$price_impact = GETPOST('price_impact', 'alpha'); $price_impact_percent = (bool) GETPOST('price_impact_percent'); $form = new Form($db); From 46a6bbe62cf7049672d318461a22a8cbc5d553a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 24 Feb 2019 14:16:29 +0100 Subject: [PATCH 18/46] phpcs fix in 9.0 --- htdocs/compta/facture/class/facture.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index fd050297fe5..cab95ff7a97 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1324,7 +1324,7 @@ class Facture extends CommonInvoice $sql.= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle'; $sql.= ', c.code as cond_reglement_code, c.libelle as cond_reglement_libelle, c.libelle_facture as cond_reglement_libelle_doc'; $sql.= ', f.fk_incoterms, f.location_incoterms'; - $sql.= ', f.module_source, f.pos_source'; + $sql.= ', f.module_source, f.pos_source'; $sql.= ", i.libelle as libelle_incoterms"; $sql.= ' FROM '.MAIN_DB_PREFIX.'facture as f'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as c ON f.fk_cond_reglement = c.rowid'; @@ -1402,7 +1402,7 @@ class Facture extends CommonInvoice $this->libelle_incoterms = $obj->libelle_incoterms; $this->module_source = $obj->module_source; - $this->pos_source = $obj->pos_source; + $this->pos_source = $obj->pos_source; // Multicurrency $this->fk_multicurrency = $obj->fk_multicurrency; From 47f5ff3303393a0a025a791ddf7d695de764463b Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 24 Feb 2019 16:11:52 +0100 Subject: [PATCH 19/46] Fix declare functions2.lib.php for donations API --- htdocs/core/lib/functions2.lib.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index aae70adfb62..faa149305a2 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -2260,6 +2260,9 @@ function getModuleDirForApiClass($module) elseif ($module == 'adherent' || $module == 'members' || $module == 'memberstypes' || $module == 'subscriptions') { $moduledirforclass = 'adherents'; } + elseif ($module == 'don' || $module == 'donations') { + $moduledirforclass = 'don'; + } elseif ($module == 'banque' || $module == 'bankaccounts') { $moduledirforclass = 'compta/bank'; } From c781eeb17d46cfb74b723c81fda1d99e50edf618 Mon Sep 17 00:00:00 2001 From: Cristian Torres Date: Wed, 20 Feb 2019 11:45:07 -0600 Subject: [PATCH 20/46] [FIX] ORDER BY before custom filters for where When filtering data "and cac.libelle" would be appended after ORDER BY --- htdocs/core/modules/modAgenda.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index 2324bfad616..86157eb98f6 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -418,6 +418,6 @@ class modAgenda extends DolibarrModules $this->export_sql_end[$r] .=' WHERE ac.entity IN ('.getEntity('agenda').')'; if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' AND (sc.fk_user = '.(empty($user)?0:$user->id).' OR ac.fk_soc IS NULL)'; if (empty($user->rights->agenda->allactions->read)) $this->export_sql_end[$r] .=' AND acr.fk_element = '.(empty($user)?0:$user->id); - $this->export_sql_end[$r] .=' ORDER BY ac.datep'; + $this->export_sql_order[$r] .=' ORDER BY ac.datep'; } } From 57ee8b7991be9fec477cf497ec9d8b5ccfceecd7 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sun, 24 Feb 2019 21:15:11 +0100 Subject: [PATCH 21/46] Fix no JPG images in TakePOS and other image improvements. --- htdocs/takepos/css/pos.css | 12 +++++ htdocs/takepos/genimg/add.jpg | Bin 5419 -> 0 bytes htdocs/takepos/genimg/empty.jpg | Bin 2239 -> 0 bytes htdocs/takepos/genimg/empty.png | Bin 0 -> 156 bytes htdocs/takepos/genimg/index.php | 87 +++++++++----------------------- htdocs/takepos/takepos.php | 34 ++++++++----- 6 files changed, 57 insertions(+), 76 deletions(-) delete mode 100644 htdocs/takepos/genimg/add.jpg delete mode 100644 htdocs/takepos/genimg/empty.jpg create mode 100644 htdocs/takepos/genimg/empty.png diff --git a/htdocs/takepos/css/pos.css b/htdocs/takepos/css/pos.css index 87c74c8952d..cac9a23a8d9 100644 --- a/htdocs/takepos/css/pos.css +++ b/htdocs/takepos/css/pos.css @@ -110,6 +110,18 @@ div.description{ text-align:center; } +div.catwatermark{ + position:absolute; + top:3%; + left:3%; + width:20%; + background-color:black; + color:white; + text-align:center; + font-size: 20px; + display: none; +} + @media only screen and (max-aspect-ratio: 6/4) { div.description{ min-height:20%; diff --git a/htdocs/takepos/genimg/add.jpg b/htdocs/takepos/genimg/add.jpg deleted file mode 100644 index 976fd10697d47e06cc9d74f7efed36ab17d95ed7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5419 zcmeHL4OA0X7QRCW2>}g3z`xd@Kt-T>s!)GR01XNrgn$bE)KnDtJ1(^qLB$N>A7U*< zMYri9KPrf#DL*bA*117Cuv;;C3&)y~- zL^jWL(}#!$=JbnJ2Udw}f7VU?0Na`eP@0MEz;rOfFw^~GV=x(}W?^p5V6rS&ER(P; ztt{DW4x7c|4B&9Atm($G9LODDJ_g=$=LwOYrCD+u1`ioJ%;mk&u4CLhy*`{cY4VimGlc## zX9Wa?&7C(tJYvDZWy_;hM90L&eZD$zO;YmOb(=PC*}5%#d&aKad$RZL`|H=zf&&K+ z6&4*XK2la*apLcl-~Hp{`Ksy*7cYH(x#q^ry82rUw;P*U+wR?O|KUN$!%lV26U|d? zuTI}*!i53jIjk4Reuaxi<1(Yyz?@~mg_$MM!r+-RM}A;o>nma{T{URb_>F8kzpVVy zbCymMLRI#WpUF86&YrCl%>|>|Rss`|}-< zK7~>UT6PmXJH|B@QJ2HFAkfI;efT~ip&k4r;c6BFW+Z|=h13m&c3z4ILDBjnl)_!N ziC(x;ye15fO)$8faYb> zsR&%lNGYz&P8K5wa;U&GOgoX!3&Cx0)%%5k!Sw;P)k+ly&vI_2*lE{_gk` z%afEs1Qr>Rt3*YSQmoq6_TfM8C4A{1Rb(3N4%C3`KMForEdS+7d>FsATm%1X*2qd+9-LxA5{Q|M9E`)Xe4YnNKnWTKG z3Y$$zDJ+@adTq<9!yk9-2Nk((t47~_*ZHKh`C8M|+Zd@Aij88ke}6nWwXD$HGIdFugAK~%GNwc{9@V{b`wg$ zx^!A@U8gIfhxH0CWcJ4hq@*BK;E2D<3v`D2HPy%(-e|+_dO2As;l$$Q;;wx4`WK#8 zA1`k`?Y+J?U~FM!`59^R=d?HBhWe3 zBhW{Szxp3A-k|x|z)Oj*$76$U6Rq6pm1`8i6}OBVT8<5`mTq?7oqACMAHVi!$l4*U z(UCATa;@Ne4&GlF=W+91F5#c;c)aB?(KK5dPgZ!3OPO4IYLLpidxna;Gck9-!zYT4 zzJvS17Bwn@5(d>=K3w3r#VPcH$k(~mrv(?*_ZPmY-V~kr>WR37J{vq5fsxlqKgthK zPV>oPqQjTWMWC8_6hY55!Z9X~+t97sxky_`7uqZ>PVa^hG6Ywq2->_7n!cen^BYae zYrc*^;PI%(A_GXt8*klMO6E(vI_XN_lH#2d|Av(sLr}t{W=BH(UOsbk!n-9C2k#rd zI55k-{N%+E{+yw=Q!OI)2lIbh!Tz>5e|y+@d)WCy4v)o(@&@C(4Tb>8RUA%nRS*1B z!DkJp2c7lif2(TF{fNpu5|HS1I;UcddRmDz!)aEim&ZIi+c|avS?xRRus*UsR+-rk zSxJ24K75&?KgwGDDp@t$AMghmPt-3n_!*y(N9LJHx}C@GJk-)Bl2gwMV0QD=h`)>* ZyZpQCQQ^@qmB0JF|GfWsej+2(_-~uMLm2=7 diff --git a/htdocs/takepos/genimg/empty.jpg b/htdocs/takepos/genimg/empty.jpg deleted file mode 100644 index 8883f7c9957bf151875278b6ded394d9594c8b25..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2239 zcmex=}T+5Ri6|E+FFJVCMj-APxLK zz#z!MsL5!;%&5e`B*@4t$oT&VgFMistiX@}1qKu_GBLBTvH_jM#SK)jRRHLGW@aX! zV_8{%-es%>$}_MCvI;30I#U-U>$dGXcJ4ZK_{h;?$4{I*b?NeztJkjIxOwa0 zqsLF4K70P+<*SdMK7aZ8?fZ|Pzd-(CWMGDP3+^*Ce+dHp#RQB47Iu)o7@5j}m|2j8 zRnd@5$T5&Tu~1masF6d&Y2w0-2RW6EgFc8R6KQ!#m{`Vr(cu+NC|SQA-3gL@3& ruUiZ}z=X*p$SlZU&+zxpqAm@FQ9K$3qiJ9?4UDFNVV?$=|K9`vEy2T8 diff --git a/htdocs/takepos/genimg/empty.png b/htdocs/takepos/genimg/empty.png new file mode 100644 index 0000000000000000000000000000000000000000..63163e9f86953a5a1b1ef0a16f5e8189e63b8f1e GIT binary patch literal 156 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H1|$#LC7uRSjKx9jP7LeL$-D$|!aQ9ZLn>~) qJ!r@Xfetch($id); + $upload_dir = $conf->categorie->multidir_output[$object->entity]; $pdir = get_exdir($object->id, 2, 0, 0, $object, 'category') . $object->id ."/photos/"; $dir = $upload_dir.'/'.$pdir; + foreach ($object->liste_photos($dir) as $key => $obj) - { - $filename=$obj['photo']; - } - - // The file - $filename = $dir.$filename; - if (!file_exists($filename)) $filename="empty.jpg"; - - // Dimensions - list($width, $height) = getimagesize($filename); - $new_width = $w; - $new_height = $h; - - // Resample - $image_p = imagecreatetruecolor($new_width, $new_height); - $image = imagecreatefromjpeg($filename); - imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height); - - // Add icon - $icon = imagecreatefromjpeg('add.jpg'); - list($width, $height) = getimagesize('add.jpg'); - $new_width = $w*0.3; - $new_height = $h*0.3; - $icon_p = imagecreatetruecolor($new_width, $new_height); - imagecopyresampled($icon_p, $icon, 0, 0, 0, 0, $new_width, $new_height, $width, $height); - imagecopymerge($image_p, $icon_p, 0, 0, 0, 0, $new_width, $new_height, 100); - - // Output - imagejpeg($image_p, null, 100); + { + if ($obj['photo_vignette']) + { + $filename=$obj['photo_vignette']; + } + else + { + $filename=$obj['photo']; + } + $viewfilename=$obj['photo']; + $file=DOL_URL_ROOT.'/viewimage.php?modulepart=category&entity='.$object->entity.'&file='.urlencode($pdir.$filename); + header('Location: '.$file); + exit; + } + header('Location: ../../public/theme/common/nophoto.png'); } elseif ($query=="pro") { @@ -89,39 +76,13 @@ elseif ($query=="pro") $objProd = new Product($db); $objProd->fetch($id); - - $dir .= get_exdir(0, 0, 0, 0, $objProd, 'product').$objProd->ref.'/'; - $pdir .= get_exdir(0, 0, 0, 0, $objProd, 'product').$objProd->ref.'/'; - - foreach ($objProd->liste_photos($dir) as $key => $obj) - { - $filename=$obj['photo']; - } - $filename = $dir.$filename; - - if (!file_exists($filename)){ - $dir = $conf->product->multidir_output[$objProd->entity].'/'.$pdir; - foreach ($objProd->liste_photos($dir) as $key => $obj) - { - $filename=$obj['photo']; - } - $filename = $dir.$filename; - } - - if (!file_exists($filename)) $filename="empty.jpg"; - - // Dimensions - list($width, $height) = getimagesize($filename); - $new_width = $w; - $new_height = $h; - - // Resample - $image_p = imagecreatetruecolor($new_width, $new_height); - $image = imagecreatefromjpeg($filename); - imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height); - - // Output - imagejpeg($image_p, null, 100); + $image=$objProd->show_photos('product', $conf->product->multidir_output[$entity], 'small', 1); + + preg_match( '@src="([^"]+)"@' , $image, $match ); + $file = array_pop($match); + if ($file=="") header('Location: ../../public/theme/common/nophoto.png'); + else header('Location: '.$file); + } else { diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php index 4edab6c9bee..4b36bbbdd81 100644 --- a/htdocs/takepos/takepos.php +++ b/htdocs/takepos/takepos.php @@ -93,8 +93,9 @@ function PrintCategories(first){ for (i = 0; i < 14; i++) { if (typeof (categories[parseInt(i)+parseInt(first)]) == "undefined") break; $("#catdesc"+i).text(categories[parseInt(i)+parseInt(first)]['label']); - $("#catimg"+i).attr("src","genimg/?query=cat&w=55&h=50&id="+categories[parseInt(i)+parseInt(first)]['rowid']); + $("#catimg"+i).attr("src","genimg/?query=cat&id="+categories[parseInt(i)+parseInt(first)]['rowid']); $("#catdiv"+i).data("rowid",categories[parseInt(i)+parseInt(first)]['rowid']); + $("#catwatermark"+i).show(); } } @@ -117,12 +118,14 @@ function MoreCategories(moreorless){ for (i = 0; i < 14; i++) { if (typeof (categories[i+(14*pagecategories)]) == "undefined"){ $("#catdesc"+i).text(""); - $("#catimg"+i).attr("src",""); + $("#catimg"+i).attr("src","genimg/empty.png"); + $("#catwatermark"+i).hide(); continue; } $("#catdesc"+i).text(categories[i+(14*pagecategories)]['label']); - $("#catimg"+i).attr("src","genimg/?query=cat&w=55&h=50&id="+categories[i+(14*pagecategories)]['rowid']); + $("#catimg"+i).attr("src","genimg/?query=cat&id="+categories[i+(14*pagecategories)]['rowid']); $("#catdiv"+i).data("rowid",categories[i+(14*pagecategories)]['rowid']); + $("#catwatermark"+i).show(); } } @@ -131,16 +134,17 @@ function LoadProducts(position, issubcat=false){ $('#catimg'+position).animate({opacity: '1'}, 100); if (issubcat==true) currentcat=$('#prodiv'+position).data('rowid'); else currentcat=$('#catdiv'+position).data('rowid'); - if (currentcat=="") return; + if (currentcat==undefined) return; pageproducts=0; ishow=0; //product to show counter jQuery.each(subcategories, function(i, val) { if (currentcat==val.fk_parent){ $("#prodesc"+ishow).text(val.label); - $("#proimg"+ishow).attr("src","genimg/?query=cat&w=55&h=50&id="+val.rowid); + $("#proimg"+ishow).attr("src","genimg/?query=cat&id="+val.rowid); $("#prodiv"+ishow).data("rowid",val.rowid); $("#prodiv"+ishow).data("iscat",1); + $("#prowatermark"+ishow).show(); ishow++; } }); @@ -150,18 +154,19 @@ function LoadProducts(position, issubcat=false){ while (idata < 30 && ishow < 30) { if (typeof (data[idata]) == "undefined") { $("#prodesc"+ishow).text(""); - $("#proimg"+ishow).attr("src",""); + $("#proimg"+ishow).attr("src","genimg/empty.png"); $("#prodiv"+ishow).data("rowid",""); ishow++; //Next product to show after print data product } else if ((data[idata]['status']) == "1") { //Only show products with status=1 (for sell) $("#prodesc"+ishow).text(data[parseInt(idata)]['label']); - $("#proimg"+ishow).attr("src","genimg/?query=pro&w=55&h=50&id="+data[idata]['id']); + $("#proimg"+ishow).attr("src","genimg/?query=pro&id="+data[idata]['id']); $("#prodiv"+ishow).data("rowid",data[idata]['id']); $("#prodiv"+ishow).data("iscat",0); ishow++; //Next product to show after print data product } + $("#prowatermark"+ishow).hide(); idata++; //Next data everytime } }); @@ -189,18 +194,19 @@ function MoreProducts(moreorless){ while (idata < (30*pageproducts)+30) { if (typeof (data[idata]) == "undefined") { $("#prodesc"+ishow).text(""); - $("#proimg"+ishow).attr("src",""); + $("#proimg"+ishow).attr("src","genimg/empty.png"); $("#prodiv"+ishow).data("rowid",""); ishow++; //Next product to show after print data product } else if ((data[idata]['status']) == "1") { //Only show products with status=1 (for sell) $("#prodesc"+ishow).text(data[parseInt(idata)]['label']); - $("#proimg"+ishow).attr("src","genimg/?query=pro&w=55&h=50&id="+data[idata]['id']); + $("#proimg"+ishow).attr("src","genimg/?query=pro&id="+data[idata]['id']); $("#prodiv"+ishow).data("rowid",data[idata]['id']); $("#prodiv"+ishow).data("iscat",0); ishow++; //Next product to show after print data product } + $("#prowatermark"+ishow).hide(); idata++; //Next data everytime } }); @@ -261,12 +267,12 @@ function Search2(){ for (i = 0; i < 30; i++) { if (typeof (data[i]) == "undefined"){ $("#prodesc"+i).text(""); - $("#proimg"+i).attr("src",""); + $("#proimg"+i).attr("src","genimg/empty.png"); $("#prodiv"+i).data("rowid",""); continue; } $("#prodesc"+i).text(data[parseInt(i)]['label']); - $("#proimg"+i).attr("src","genimg/?query=pro&w=55&h=50&id="+data[i]['rowid']); + $("#proimg"+i).attr("src","genimg/?query=pro&id="+data[i]['rowid']); $("#prodiv"+i).data("rowid",data[i]['rowid']); $("#prodiv"+i).data("iscat",0); } @@ -491,10 +497,11 @@ foreach($menus as $menu) { { ?>
id='catdiv'> - width="98%" id='catimg'/> + width="100%" height="85%" id='catimg'/>
+
+
onclick="MoreProducts('less');" onclick="MoreProducts('more');" > - width="95%" id='proimg'/> + width="100%" height="85%" id='proimg'/>
+
+
Date: Sun, 24 Feb 2019 23:40:32 +0100 Subject: [PATCH 22/46] phpcs fix --- htdocs/datapolicy/class/datapolicy.class.php | 92 ++++++++++---------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/htdocs/datapolicy/class/datapolicy.class.php b/htdocs/datapolicy/class/datapolicy.class.php index b3cb0ce3cd9..b9ff3e8b6bd 100644 --- a/htdocs/datapolicy/class/datapolicy.class.php +++ b/htdocs/datapolicy/class/datapolicy.class.php @@ -219,68 +219,68 @@ Class DataPolicy */ function sendMailDataPolicyCompany($societe) { - global $langs, $conf, $db, $user; + global $langs, $conf, $db, $user; - $error = 0; + $error = 0; - $from = $user->getFullName($langs) . ' <' . $user->email . '>'; + $from = $user->getFullName($langs) . ' <' . $user->email . '>'; - $sendto = $societe->email; + $sendto = $societe->email; - $code= md5($societe->email); - if (!empty($societe->default_lang)) { - $l = $societe->default_lang; - } else { - $l = $langs->defaultlang; - } - $s = "DATAPOLICIESSUBJECT_" . $l; - $ma = "DATAPOLICIESCONTENT_" . $l; - $la = 'TXTLINKDATAPOLICIESACCEPT_' . $l; - $lr = 'TXTLINKDATAPOLICIESREFUSE_' . $l; + $code= md5($societe->email); + if (!empty($societe->default_lang)) { + $l = $societe->default_lang; + } else { + $l = $langs->defaultlang; + } + $s = "DATAPOLICIESSUBJECT_" . $l; + $ma = "DATAPOLICIESCONTENT_" . $l; + $la = 'TXTLINKDATAPOLICIESACCEPT_' . $l; + $lr = 'TXTLINKDATAPOLICIESREFUSE_' . $l; - $subject = $conf->global->$s; - $message = $conf->global->$ma; - $linka = $conf->global->$la; - $linkr = $conf->global->$lr; - $sendtocc = $sendtobcc = ''; - $filepath = $mimetype = $filename = array(); - $deliveryreceipt = 0; + $subject = $conf->global->$s; + $message = $conf->global->$ma; + $linka = $conf->global->$la; + $linkr = $conf->global->$lr; + $sendtocc = $sendtobcc = ''; + $filepath = $mimetype = $filename = array(); + $deliveryreceipt = 0; - $substitutionarray = array( + $substitutionarray = array( '__LINKACCEPT__' => ''.$linka.'', '__LINKREFUSED__' => ''.$linkr.'', - ); - $subject = make_substitutions($subject, $substitutionarray); - $message = make_substitutions($message, $substitutionarray); + ); + $subject = make_substitutions($subject, $substitutionarray); + $message = make_substitutions($message, $substitutionarray); - $actiontypecode = 'AC_EMAIL'; - $actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto; - if ($message) { - if ($sendtocc) { - $actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc); + $actiontypecode = 'AC_EMAIL'; + $actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto; + if ($message) { + if ($sendtocc) { + $actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc); } $actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject); $actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":"); $actionmsg .= dol_concatdesc($actionmsg, $message); } - // Send mail - require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, -1); - if ($mailfile->error) { - $resultmasssend .= '
' . $mailfile->error . '
'; - } else { - $result4 = $mailfile->sendfile(); + // Send mail + require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; + $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, -1); + if ($mailfile->error) { + $resultmasssend .= '
' . $mailfile->error . '
'; + } else { + $result4 = $mailfile->sendfile(); - if (!$error) { - $resultmasssend .= $langs->trans("MailSent") . ': ' . $sendto . "
"; - $societe->array_options['options_datapolicy_send'] = date('Y-m-d', time()); - $societe->update($societe->id); - } else { - dol_print_error($db); - } - } - setEventMessage($resultmasssend); + if (!$error) { + $resultmasssend .= $langs->trans("MailSent") . ': ' . $sendto . "
"; + $societe->array_options['options_datapolicy_send'] = date('Y-m-d', time()); + $societe->update($societe->id); + } else { + dol_print_error($db); + } + } + setEventMessage($resultmasssend); } /** From acb9cfe07ac2d13f1a1d7918bd5233adab4f0b38 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 25 Feb 2019 09:07:58 +0100 Subject: [PATCH 23/46] NEW: Add LinkedIn field --- htdocs/adherents/card.php | 23 +++++++++-- htdocs/adherents/class/adherent.class.php | 17 ++++++-- htdocs/admin/socialnetworks.php | 3 +- htdocs/contact/card.php | 24 +++++++++--- htdocs/contact/class/contact.class.php | 9 ++++- htdocs/contact/list.php | 29 +++++++++++--- htdocs/core/class/commonobject.class.php | 2 + htdocs/core/lib/functions.lib.php | 2 +- .../install/mysql/migration/9.0.0-10.0.0.sql | 7 +++- htdocs/install/mysql/tables/llx_adherent.sql | 1 + htdocs/install/mysql/tables/llx_societe.sql | 1 + htdocs/install/mysql/tables/llx_socpeople.sql | 1 + htdocs/install/mysql/tables/llx_user.sql | 1 + htdocs/societe/card.php | 33 ++++++++++++---- htdocs/societe/class/societe.class.php | 13 ++++++- htdocs/user/card.php | 39 ++++++++++++++++++- htdocs/user/class/user.class.php | 14 ++++++- 17 files changed, 185 insertions(+), 34 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index b9a2d15c5cd..9903255e52f 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -305,6 +305,7 @@ if (empty($reshook)) $object->skype = trim(GETPOST("skype", 'alpha')); $object->twitter = trim(GETPOST("twitter", 'alpha')); $object->facebook = trim(GETPOST("facebook", 'alpha')); + $object->linkedin = trim(GETPOST("linkedin", 'alpha')); $object->birth = $birthdate; $object->typeid = GETPOST("typeid", 'int'); @@ -450,6 +451,7 @@ if (empty($reshook)) $skype=GETPOST("member_skype", 'alpha'); $twitter=GETPOST("member_twitter", 'alpha'); $facebook=GETPOST("member_facebook", 'alpha'); + $linkedin=GETPOST("member_linkedin", 'alpha'); $email=preg_replace('/\s+/', '', GETPOST("member_email", 'alpha')); $login=GETPOST("member_login", 'alpha'); $pass=GETPOST("password", 'alpha'); @@ -479,6 +481,7 @@ if (empty($reshook)) $object->skype = $skype; $object->twitter = $twitter; $object->facebook = $facebook; + $object->linkedin = $linkedin; $object->email = $email; $object->login = $login; @@ -1029,6 +1032,12 @@ else print ''.$langs->trans("Facebook").''; } + // LinkedIn + if (! empty($conf->socialnetworks->enabled)) + { + print ''.$langs->trans("LinkedIn").''; + } + // Birthday print "".$langs->trans("Birthday")."\n"; print $form->selectDate(($object->birth ? $object->birth : -1), 'birth', '', '', 1, 'formsoc'); @@ -1281,10 +1290,16 @@ else } // Facebook - if (! empty($conf->socialnetworks->enabled)) - { - print ''.$langs->trans("Facebook").'facebook).'">'; - } + if (! empty($conf->socialnetworks->enabled)) + { + print ''.$langs->trans("Facebook").'facebook).'">'; + } + + // LinkedIn + if (! empty($conf->socialnetworks->enabled)) + { + print ''.$langs->trans("LinkedIn").'linkedin).'">'; + } // Birthday print "".$langs->trans("Birthday")."\n"; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 22429de9200..66ee5ee16f2 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -137,6 +137,11 @@ class Adherent extends CommonObject */ public $facebook; + /** + * @var string linkedin account + */ + public $linkedin; + /** * @var string Phone number */ @@ -550,6 +555,7 @@ class Adherent extends CommonObject $sql.= ", skype = '".$this->db->escape($this->skype)."'"; $sql.= ", twitter = '".$this->db->escape($this->twitter)."'"; $sql.= ", facebook = '".$this->db->escape($this->facebook)."'"; + $sql.= ", linkedin = '".$this->db->escape($this->linkedin)."'"; $sql.= ", phone = ".($this->phone?"'".$this->db->escape($this->phone)."'":"null"); $sql.= ", phone_perso = ".($this->phone_perso?"'".$this->db->escape($this->phone_perso)."'":"null"); $sql.= ", phone_mobile = ".($this->phone_mobile?"'".$this->db->escape($this->phone_mobile)."'":"null"); @@ -660,6 +666,7 @@ class Adherent extends CommonObject $luser->skype=$this->skype; $luser->twitter=$this->twitter; $luser->facebook=$this->facebook; + $luser->linkedin=$this->linkedin; $luser->office_phone=$this->phone; $luser->user_mobile=$this->phone_mobile; @@ -701,6 +708,7 @@ class Adherent extends CommonObject $lthirdparty->skype=$this->skype; $lthirdparty->twitter=$this->twitter; $lthirdparty->facebook=$this->facebook; + $lthirdparty->linkedin=$this->linkedin; $lthirdparty->phone=$this->phone; $lthirdparty->state_id=$this->state_id; $lthirdparty->country_id=$this->country_id; @@ -1189,7 +1197,7 @@ class Adherent extends CommonObject $sql = "SELECT d.rowid, d.ref_ext, d.civility as civility_id, d.gender, d.firstname, d.lastname, d.societe as company, d.fk_soc, d.statut, d.public, d.address, d.zip, d.town, d.note_private,"; $sql.= " d.note_public,"; - $sql.= " d.email, d.skype, d.twitter, d.facebook, d.phone, d.phone_perso, d.phone_mobile, d.login, d.pass, d.pass_crypted,"; + $sql.= " d.email, d.skype, d.twitter, d.facebook, d.linkedin, d.phone, d.phone_perso, d.phone_mobile, d.login, d.pass, d.pass_crypted,"; $sql.= " d.photo, d.fk_adherent_type, d.morphy, d.entity,"; $sql.= " d.datec as datec,"; $sql.= " d.tms as datem,"; @@ -1266,6 +1274,7 @@ class Adherent extends CommonObject $this->skype = $obj->skype; $this->twitter = $obj->twitter; $this->facebook = $obj->facebook; + $this->linkedin = $obj->linkedin; $this->photo = $obj->photo; $this->statut = $obj->statut; @@ -2362,6 +2371,7 @@ class Adherent extends CommonObject $this->skype = 'skypepseudo'; $this->twitter = 'twitterpseudo'; $this->facebook = 'facebookpseudo'; + $this->linkedin = 'linkedinpseudo'; $this->phone = '0999999999'; $this->phone_perso = '0999999998'; $this->phone_mobile = '0999999997'; @@ -2469,8 +2479,9 @@ class Adherent extends CommonObject if ($this->country_code && ! empty($conf->global->LDAP_MEMBER_FIELD_COUNTRY)) $info[$conf->global->LDAP_MEMBER_FIELD_COUNTRY] = $this->country_code; if ($this->skype && ! empty($conf->global->LDAP_MEMBER_FIELD_SKYPE)) $info[$conf->global->LDAP_MEMBER_FIELD_SKYPE] = $this->skype; if ($this->twitter && ! empty($conf->global->LDAP_MEMBER_FIELD_TWITTER)) $info[$conf->global->LDAP_MEMBER_FIELD_TWITTER] = $this->twitter; - if ($this->facebook && ! empty($conf->global->LDAP_MEMBER_FIELD_FACEBOOK)) $info[$conf->global->LDAP_MEMBER_FIELD_FACEBOOK] = $this->facebook; - if ($this->phone && ! empty($conf->global->LDAP_MEMBER_FIELD_PHONE)) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE] = $this->phone; + if ($this->facebook && ! empty($conf->global->LDAP_MEMBER_FIELD_FACEBOOK)) $info[$conf->global->LDAP_MEMBER_FIELD_FACEBOOK] = $this->facebook; + if ($this->linkedin && ! empty($conf->global->LDAP_MEMBER_FIELD_LINKEDIN)) $info[$conf->global->LDAP_MEMBER_FIELD_LINKEDIN] = $this->linkedin; + if ($this->phone && ! empty($conf->global->LDAP_MEMBER_FIELD_PHONE)) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE] = $this->phone; if ($this->phone_perso && ! empty($conf->global->LDAP_MEMBER_FIELD_PHONE_PERSO)) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE_PERSO] = $this->phone_perso; if ($this->phone_mobile && ! empty($conf->global->LDAP_MEMBER_FIELD_MOBILE)) $info[$conf->global->LDAP_MEMBER_FIELD_MOBILE] = $this->phone_mobile; if ($this->fax && ! empty($conf->global->LDAP_MEMBER_FIELD_FAX)) $info[$conf->global->LDAP_MEMBER_FIELD_FAX] = $this->fax; diff --git a/htdocs/admin/socialnetworks.php b/htdocs/admin/socialnetworks.php index f723d13d540..8b7c061dc64 100644 --- a/htdocs/admin/socialnetworks.php +++ b/htdocs/admin/socialnetworks.php @@ -1,5 +1,6 @@ + * Copyright (C) 2019 Alexandre Spangaro * * 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 @@ -96,7 +97,7 @@ dol_fiche_head($head, 'setup', '', 0, 'user'); print '
'; -$arrayofsocialnetworks=array('jabber'=>'Jabber', 'skype'=>'Skype', 'twitter'=>'Twitter', 'facebook'=>'Facebook'); +$arrayofsocialnetworks=array('jabber'=>'Jabber', 'skype'=>'Skype', 'twitter'=>'Twitter', 'facebook'=>'Facebook', 'linkedin'=>'LinkedIn'); foreach($arrayofsocialnetworks as $snkey => $snlabel) { $consttocheck = 'SOCIALNETWORKS_'.strtoupper($snkey); diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 63704ab6bca..1eb9a13f877 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -189,6 +189,7 @@ if (empty($reshook)) $object->skype = GETPOST("skype", 'alpha'); $object->twitter = GETPOST("twitter", 'alpha'); $object->facebook = GETPOST("facebook", 'alpha'); + $object->linkedin = GETPOST("linkedin", 'alpha'); $object->email = GETPOST("email", 'alpha'); $object->phone_pro = GETPOST("phone_pro", 'alpha'); $object->phone_perso = GETPOST("phone_perso", 'alpha'); @@ -362,6 +363,7 @@ if (empty($reshook)) $object->skype = GETPOST("skype", 'alpha'); $object->twitter = GETPOST("twitter", 'alpha'); $object->facebook = GETPOST("facebook", 'alpha'); + $object->linkedin = GETPOST("linkedin", 'alpha'); $object->phone_pro = GETPOST("phone_pro", 'alpha'); $object->phone_perso = GETPOST("phone_perso", 'alpha'); $object->phone_mobile = GETPOST("phone_mobile", 'alpha'); @@ -698,6 +700,12 @@ else print ''; print 'facebook).'">'; } + // LinkedIn + if (! empty($conf->global->SOCIALNETWORKS_LINKEDIN)) + { + print ''; + print 'linkedin.'">'; + } } // Visibility @@ -979,11 +987,17 @@ else print 'twitter).'">'; } // Facebook - if (! empty($conf->global->SOCIALNETWORKS_FACEBOOK)) - { - print ''; - print 'facebook).'">'; - } + if (! empty($conf->global->SOCIALNETWORKS_FACEBOOK)) + { + print ''; + print 'facebook).'">'; + } + // LinkedIn + if (! empty($conf->global->SOCIALNETWORKS_LINKEDIN)) + { + print ''; + print 'linkedin).'">'; + } } // Visibility diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 67b3900ec06..58204ae0c94 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -359,6 +359,7 @@ class Contact extends CommonObject $sql .= ", skype='".$this->db->escape($this->skype)."'"; $sql .= ", twitter='".$this->db->escape($this->twitter)."'"; $sql .= ", facebook='".$this->db->escape($this->facebook)."'"; + $sql .= ", linkedin='".$this->db->escape($this->linkedin)."'"; $sql .= ", photo='".$this->db->escape($this->photo)."'"; $sql .= ", birthday=".($this->birthday ? "'".$this->db->idate($this->birthday)."'" : "null"); $sql .= ", note_private = ".(isset($this->note_private)?"'".$this->db->escape($this->note_private)."'":"null"); @@ -455,6 +456,11 @@ class Contact extends CommonObject $tmpobj->facebook = $this->facebook; $usermustbemodified++; } + if ($tmpobj->linkedin != $this->linkedin) + { + $tmpobj->linkedin = $this->linkedin; + $usermustbemodified++; + } if ($usermustbemodified) { $result=$tmpobj->update($user, 0, 1, 1, 1); @@ -705,7 +711,7 @@ class Contact extends CommonObject $sql.= " c.fk_pays as country_id,"; $sql.= " c.fk_departement,"; $sql.= " c.birthday,"; - $sql.= " c.poste, c.phone, c.phone_perso, c.phone_mobile, c.fax, c.email, c.jabberid, c.skype, c.twitter, c.facebook,"; + $sql.= " c.poste, c.phone, c.phone_perso, c.phone_mobile, c.fax, c.email, c.jabberid, c.skype, c.twitter, c.facebook, c.linkedin,"; $sql.= " c.photo,"; $sql.= " c.priv, c.note_private, c.note_public, c.default_lang, c.canvas,"; $sql.= " c.import_key,"; @@ -779,6 +785,7 @@ class Contact extends CommonObject $this->skype = $obj->skype; $this->twitter = $obj->twitter; $this->facebook = $obj->facebook; + $this->linkedin = $obj->linkedin; $this->photo = $obj->photo; $this->priv = $obj->priv; $this->mail = $obj->email; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 244dffcc0e1..6677e882860 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -70,6 +70,7 @@ $search_email=GETPOST("search_email", 'alpha'); $search_skype=GETPOST("search_skype", 'alpha'); $search_twitter=GETPOST("search_twitter", 'alpha'); $search_facebook=GETPOST("search_facebook", 'alpha'); +$search_linkedin=GETPOST("search_linkedin", 'alpha'); $search_priv=GETPOST("search_priv", 'alpha'); $search_categ=GETPOST("search_categ", 'int'); $search_categ_thirdparty=GETPOST("search_categ_thirdparty", 'int'); @@ -162,6 +163,7 @@ $arrayfields=array( 'p.skype'=>array('label'=>"Skype", 'checked'=>1, 'enabled'=>(! empty($conf->socialnetworks->enabled))), 'p.twitter'=>array('label'=>"Twitter", 'checked'=>1, 'enabled'=>(! empty($conf->socialnetworks->enabled))), 'p.facebook'=>array('label'=>"Facebook", 'checked'=>1, 'enabled'=>(! empty($conf->socialnetworks->enabled))), + 'p.linkedin'=>array('label'=>"LinkedIn", 'checked'=>1, 'enabled'=>(! empty($conf->socialnetworks->enabled))), 'p.thirdparty'=>array('label'=>"ThirdParty", 'checked'=>1, 'enabled'=>empty($conf->global->SOCIETE_DISABLE_CONTACTS)), 'p.priv'=>array('label'=>"ContactVisibility", 'checked'=>1, 'position'=>200), 'p.datec'=>array('label'=>"DateCreationShort", 'checked'=>0, 'position'=>500), @@ -224,6 +226,7 @@ if (empty($reshook)) $search_skype=""; $search_twitter=""; $search_facebook=""; + $search_linkedin=""; $search_priv=""; $search_status=-1; $search_categ=''; @@ -320,6 +323,7 @@ if (strlen($search_fax)) $sql.= natural_search('p.fax', $search_fax); if (strlen($search_skype)) $sql.= natural_search('p.skype', $search_skype); if (strlen($search_twitter)) $sql.= natural_search('p.twitter', $search_twitter); if (strlen($search_facebook)) $sql.= natural_search('p.facebook', $search_facebook); +if (strlen($search_linkedin)) $sql.= natural_search('p.linkedin', $search_linkedin); if (strlen($search_email)) $sql.= natural_search('p.email', $search_email); if (strlen($search_zip)) $sql.= natural_search("p.zip", $search_zip); if (strlen($search_town)) $sql.= natural_search("p.town", $search_town); @@ -624,6 +628,12 @@ if (! empty($arrayfields['p.facebook']['checked'])) print ''; print ''; } +if (! empty($arrayfields['p.linkedin']['checked'])) +{ + print ''; + print ''; + print ''; +} if (! empty($arrayfields['p.thirdparty']['checked'])) { print ''; @@ -696,6 +706,7 @@ if (! empty($arrayfields['p.email']['checked'])) print_liste_field if (! empty($arrayfields['p.skype']['checked'])) print_liste_field_titre($arrayfields['p.skype']['label'], $_SERVER["PHP_SELF"], "p.skype", $begin, $param, '', $sortfield, $sortorder); if (! empty($arrayfields['p.twitter']['checked'])) print_liste_field_titre($arrayfields['p.twitter']['label'], $_SERVER["PHP_SELF"], "p.twitter", $begin, $param, '', $sortfield, $sortorder); if (! empty($arrayfields['p.facebook']['checked'])) print_liste_field_titre($arrayfields['p.facebook']['label'], $_SERVER["PHP_SELF"], "p.facebook", $begin, $param, '', $sortfield, $sortorder); +if (! empty($arrayfields['p.linkedin']['checked'])) print_liste_field_titre($arrayfields['p.linkedin']['label'], $_SERVER["PHP_SELF"], "p.linkedin", $begin, $param, '', $sortfield, $sortorder); if (! empty($arrayfields['p.thirdparty']['checked'])) print_liste_field_titre($arrayfields['p.thirdparty']['label'], $_SERVER["PHP_SELF"], "s.nom", $begin, $param, '', $sortfield, $sortorder); if (! empty($arrayfields['p.priv']['checked'])) print_liste_field_titre($arrayfields['p.priv']['label'], $_SERVER["PHP_SELF"], "p.priv", $begin, $param, 'align="center"', $sortfield, $sortorder); // Extra fields @@ -843,12 +854,18 @@ while ($i < min($num, $limit)) if (! $i) $totalarray['nbfield']++; } // Facebook - if (! empty($arrayfields['p.facebook']['checked'])) - { - if (! empty($conf->socialnetworks->enabled)) { print ''.dol_print_socialnetworks($obj->facebook, $obj->rowid, $obj->socid, 'facebook').''; } - if (! $i) $totalarray['nbfield']++; - } - // Company + if (! empty($arrayfields['p.facebook']['checked'])) + { + if (! empty($conf->socialnetworks->enabled)) { print ''.dol_print_socialnetworks($obj->facebook, $obj->rowid, $obj->socid, 'facebook').''; } + if (! $i) $totalarray['nbfield']++; + } + // LinkedIn + if (! empty($arrayfields['p.linkedin']['checked'])) + { + if (! empty($conf->socialnetworks->enabled)) { print ''.dol_print_socialnetworks($obj->linkedin, $obj->rowid, $obj->socid, 'linkedin').''; } + if (! $i) $totalarray['nbfield']++; + } + // Company if (! empty($arrayfields['p.thirdparty']['checked'])) { print ''; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 1f86d60598c..98b9d93580a 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -672,6 +672,8 @@ abstract class CommonObject $outdone++; if ($this->facebook) $out.=dol_print_socialnetworks($this->facebook, $this->id, $object->id, 'facebook'); $outdone++; + if ($this->linkedin) $out.=dol_print_socialnetworks($this->linkedin, $this->id, $object->id, 'linkedin'); + $outdone++; } $out.=''; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index be046ae889d..6826122b93b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2976,7 +2976,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ if (empty($srconly) && in_array($pictowithoutext, array( 'bank', 'close_title', 'delete', 'edit', 'ellipsis-h', 'filter', 'grip', 'grip_title', 'list', 'listlight', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize', 'note', 'sign-out', 'split', 'switch_off', 'switch_on', 'unlink', 'uparrow', '1downarrow', '1uparrow', - 'jabber','skype','twitter','facebook' + 'jabber','skype','twitter','facebook','linkedin' ) )) { $fakey = $pictowithoutext; diff --git a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql index 1bac8ec18e6..e1d8cb69b78 100644 --- a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql +++ b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql @@ -94,4 +94,9 @@ ALTER TABLE llx_actioncomm ADD COLUMN calling_duration integer; ALTER TABLE llx_don ADD COLUMN fk_soc integer NULL; -ALTER TABLE llx_payment_various ADD COLUMN subledger_account varchar(32); \ No newline at end of file +ALTER TABLE llx_payment_various ADD COLUMN subledger_account varchar(32); + +ALTER TABLE llx_societe ADD COLUMN linkedin varchar(255) after whatsapp; +ALTER TABLE llx_socpeople ADD COLUMN linkedin varchar(255) after whatsapp; +ALTER TABLE llx_adherent ADD COLUMN linkedin varchar(255) after whatsapp; +ALTER TABLE llx_user ADD COLUMN linkedin varchar(255) after whatsapp; diff --git a/htdocs/install/mysql/tables/llx_adherent.sql b/htdocs/install/mysql/tables/llx_adherent.sql index ede4de2e487..588fb323dae 100644 --- a/htdocs/install/mysql/tables/llx_adherent.sql +++ b/htdocs/install/mysql/tables/llx_adherent.sql @@ -51,6 +51,7 @@ create table llx_adherent skype varchar(255), twitter varchar(255), -- facebook varchar(255), -- + linkedin varchar(255), -- instagram varchar(255), -- snapchat varchar(255), -- googleplus varchar(255), -- diff --git a/htdocs/install/mysql/tables/llx_societe.sql b/htdocs/install/mysql/tables/llx_societe.sql index 6225ae416e8..ed4919c3fc5 100644 --- a/htdocs/install/mysql/tables/llx_societe.sql +++ b/htdocs/install/mysql/tables/llx_societe.sql @@ -54,6 +54,7 @@ create table llx_societe skype varchar(255), -- twitter varchar(255), -- facebook varchar(255), -- + linkedin varchar(255), -- instagram varchar(255), -- snapchat varchar(255), -- googleplus varchar(255), -- diff --git a/htdocs/install/mysql/tables/llx_socpeople.sql b/htdocs/install/mysql/tables/llx_socpeople.sql index 00456e3ece6..4ed401e39da 100644 --- a/htdocs/install/mysql/tables/llx_socpeople.sql +++ b/htdocs/install/mysql/tables/llx_socpeople.sql @@ -46,6 +46,7 @@ create table llx_socpeople skype varchar(255), twitter varchar(255), -- facebook varchar(255), -- + linkedin varchar(255), -- instagram varchar(255), -- snapchat varchar(255), -- googleplus varchar(255), -- diff --git a/htdocs/install/mysql/tables/llx_user.sql b/htdocs/install/mysql/tables/llx_user.sql index 90dc8a835ef..ef00ae046af 100644 --- a/htdocs/install/mysql/tables/llx_user.sql +++ b/htdocs/install/mysql/tables/llx_user.sql @@ -58,6 +58,7 @@ create table llx_user skype varchar(255), twitter varchar(255), -- facebook varchar(255), -- + linkedin varchar(255), -- instagram varchar(255), -- snapchat varchar(255), -- googleplus varchar(255), -- diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index a8a41527af0..95dc554ef71 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -146,7 +146,7 @@ if (empty($reshook)) $object->client = $object->client | $soc_origin->client; $object->fournisseur = $object->fournisseur | $soc_origin->fournisseur; $listofproperties=array( - 'address', 'zip', 'town', 'state_id', 'country_id', 'phone', 'phone_pro', 'fax', 'email', 'skype', 'twitter', 'facebook', 'url', 'barcode', + 'address', 'zip', 'town', 'state_id', 'country_id', 'phone', 'phone_pro', 'fax', 'email', 'skype', 'twitter', 'facebook', 'linkedin', 'url', 'barcode', 'idprof1', 'idprof2', 'idprof3', 'idprof4', 'idprof5', 'idprof6', 'tva_intra', 'effectif_id', 'forme_juridique', 'remise_percent', 'remise_supplier_percent', 'mode_reglement_supplier_id', 'cond_reglement_supplier_id', 'name_bis', 'stcomm_id', 'outstanding_limit', 'price_level', 'parent', 'default_lang', 'ref', 'ref_ext', 'import_key', 'fk_incoterms', 'fk_multicurrency', @@ -407,6 +407,7 @@ if (empty($reshook)) $object->skype = GETPOST('skype', 'alpha'); $object->twitter = GETPOST('twitter', 'alpha'); $object->facebook = GETPOST('facebook', 'alpha'); + $object->linkedin = GETPOST('linkedin', 'alpha'); $object->phone = GETPOST('phone', 'alpha'); $object->fax = GETPOST('fax', 'alpha'); $object->email = trim(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL)); @@ -970,6 +971,7 @@ else $object->skype = GETPOST('skype', 'alpha'); $object->twitter = GETPOST('twitter', 'alpha'); $object->facebook = GETPOST('facebook', 'alpha'); + $object->linkedin = GETPOST('linkedin', 'alpha'); $object->phone = GETPOST('phone', 'alpha'); $object->fax = GETPOST('fax', 'alpha'); $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); @@ -1304,13 +1306,21 @@ else print ''; } // Facebook - if (! empty($conf->global->SOCIALNETWORKS_FACEBOOK)) - { - print ''.$form->editfieldkey('Facebook', 'facebook', '', $object, 0).''; - print ''; - print 'facebook).'">'; - print ''; - } + if (! empty($conf->global->SOCIALNETWORKS_FACEBOOK)) + { + print ''.$form->editfieldkey('Facebook', 'facebook', '', $object, 0).''; + print ''; + print 'facebook).'">'; + print ''; + } + // LinkedIn + if (! empty($conf->global->SOCIALNETWORKS_LINKEDIN)) + { + print ''.$form->editfieldkey('LinkedIn', 'linkedin', '', $object, 0).''; + print ''; + print 'linkedin).'">'; + print ''; + } } // Phone / Fax @@ -1591,6 +1601,7 @@ else $object->skype = GETPOST('skype', 'alpha'); $object->twitter = GETPOST('twitter', 'alpha'); $object->facebook = GETPOST('facebook', 'alpha'); + $object->linkedin = GETPOST('linkedin', 'alpha'); $object->phone = GETPOST('phone', 'alpha'); $object->fax = GETPOST('fax', 'alpha'); $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); @@ -1916,6 +1927,12 @@ else print ''.$form->editfieldkey('Facebook', 'facebook', '', $object, 0).''; print ''; } + // LinkedIn + if (! empty($conf->global->SOCIALNETWORKS_LINKEDIN)) + { + print ''.$form->editfieldkey('LinkedIn', 'linkedin', '', $object, 0).''; + print ''; + } } // Phone / Fax diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 4c964f591d0..3fb29a17db4 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -203,6 +203,11 @@ class Societe extends CommonObject * @var string */ public $facebook; + /** + * LinkedIn username + * @var string + */ + public $linkedin; /** * Webpage * @var string @@ -848,6 +853,7 @@ class Societe extends CommonObject $this->skype = trim($this->skype); $this->twitter = trim($this->twitter); $this->facebook = trim($this->facebook); + $this->linkedin = trim($this->linkedin); $this->url = $this->url?clean_url($this->url, 0):''; $this->note_private = trim($this->note_private); $this->note_public = trim($this->note_public); @@ -991,6 +997,7 @@ class Societe extends CommonObject $sql .= ",skype = ".(! empty($this->skype)?"'".$this->db->escape($this->skype)."'":"null"); $sql .= ",twitter = ".(! empty($this->twitter)?"'".$this->db->escape($this->twitter)."'":"null"); $sql .= ",facebook = ".(! empty($this->facebook)?"'".$this->db->escape($this->facebook)."'":"null"); + $sql .= ",linkedin = ".(! empty($this->linkedin)?"'".$this->db->escape($this->linkedin)."'":"null"); $sql .= ",url = ".(! empty($this->url)?"'".$this->db->escape($this->url)."'":"null"); $sql .= ",parent = " . ($this->parent > 0 ? $this->parent : "null"); @@ -1132,6 +1139,7 @@ class Societe extends CommonObject $lmember->skype=$this->skype; $lmember->twitter=$this->twitter; $lmember->facebook=$this->facebook; + $lmember->linkedin=$this->linkedin; $lmember->phone=$this->phone; $result=$lmember->update($user, 0, 1, 1, 1); // Use nosync to 1 to avoid cyclic updates @@ -1235,7 +1243,7 @@ class Societe extends CommonObject $sql .= ', s.status'; $sql .= ', s.price_level'; $sql .= ', s.tms as date_modification, s.fk_user_creat, s.fk_user_modif'; - $sql .= ', s.phone, s.fax, s.email, s.skype, s.twitter, s.facebook, s.url, s.zip, s.town, s.note_private, s.note_public, s.model_pdf, s.client, s.fournisseur'; + $sql .= ', s.phone, s.fax, s.email, s.skype, s.twitter, s.facebook, s.linkedin, s.url, s.zip, s.town, s.note_private, s.note_public, s.model_pdf, s.client, s.fournisseur'; $sql .= ', s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4, s.idprof5, s.idprof6'; $sql .= ', s.capital, s.tva_intra'; $sql .= ', s.fk_typent as typent_id'; @@ -1332,6 +1340,7 @@ class Societe extends CommonObject $this->skype = $obj->skype; $this->twitter = $obj->twitter; $this->facebook = $obj->facebook; + $this->linkedin = $obj->linkedin; $this->url = $obj->url; $this->phone = $obj->phone; $this->fax = $obj->fax; @@ -3337,6 +3346,7 @@ class Societe extends CommonObject $this->skype=$member->skype; $this->twitter=$member->twitter; $this->facebook=$member->facebook; + $this->linkedin=$member->linkedin; $this->client = 1; // A member is a customer by default $this->code_client = ($customercode?$customercode:-1); @@ -3480,6 +3490,7 @@ class Societe extends CommonObject $this->skype='tom.hanson'; $this->twitter='tomhanson'; $this->facebook='tomhanson'; + $this->linkedin='tomhanson'; $this->url='http://www.specimen.com'; $this->phone='0909090901'; diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 859b2220b28..884faf33c3d 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -214,6 +214,7 @@ if (empty($reshook)) { $object->skype = GETPOST("skype", 'alphanohtml'); $object->twitter = GETPOST("twitter", 'alphanohtml'); $object->facebook = GETPOST("facebook", 'alphanohtml'); + $object->linkedin = GETPOST("linkedin", 'alphanohtml'); $object->email = preg_replace('/\s+/', '', GETPOST("email", 'alpha')); $object->job = GETPOST("job", 'alpha'); @@ -364,6 +365,7 @@ if (empty($reshook)) { $object->skype = GETPOST("skype", 'alpha'); $object->twitter = GETPOST("twitter", 'alpha'); $object->facebook = GETPOST("facebook", 'alpha'); + $object->linkedin = GETPOST("linkedin", 'alpha'); $object->email = preg_replace('/\s+/', '', GETPOST("email", 'alpha')); $object->job = GETPOST("job", 'alpha'); $object->signature = GETPOST("signature", 'none'); @@ -606,6 +608,7 @@ if (empty($reshook)) { $ldap_skype = $attribute[$conf->global->LDAP_FIELD_SKYPE]; $ldap_twitter = $attribute[$conf->global->LDAP_FIELD_TWITTER]; $ldap_facebook = $attribute[$conf->global->LDAP_FIELD_FACEBOOK]; + $ldap_linkedin = $attribute[$conf->global->LDAP_FIELD_LINKEDIN]; $ldap_mail = $attribute[$conf->global->LDAP_FIELD_MAIL]; $ldap_sid = $attribute[$conf->global->LDAP_FIELD_SID]; } @@ -1067,6 +1070,23 @@ if ($action == 'create' || $action == 'adduserldap') print ''; } + // LinkedIn + if (! empty($conf->socialnetworks->enabled)) + { + print ''.$langs->trans("LinkedIn").''; + print ''; + if (! empty($ldap_linkedin)) + { + print ''; + print $ldap_linkedin; + } + else + { + print ''; + } + print ''; + } + // EMail print 'global->USER_MAIL_REQUIRED)?' class="fieldrequired"':'').'>'.$langs->trans("EMail").''; print ''; @@ -2287,7 +2307,7 @@ else print ''; } - // Skype + // Facebook if (! empty($conf->socialnetworks->enabled)) { print ''.$langs->trans("Facebook").''; @@ -2304,6 +2324,23 @@ else print ''; } + // LinkedIn + if (! empty($conf->socialnetworks->enabled)) + { + print ''.$langs->trans("LinkedIn").''; + print ''; + if ($caneditfield && empty($object->ldap_sid)) + { + print ''; + } + else + { + print ''; + print $object->linkedin; + } + print ''; + } + // EMail print "".'global->USER_MAIL_REQUIRED)?' class="fieldrequired"':'').'>'.$langs->trans("EMail").''; print ''; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index a6bc202d17f..ef6e2c23971 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -73,6 +73,7 @@ class User extends CommonObject public $skype; public $twitter; public $facebook; + public $linkedin; public $job; // job position public $signature; @@ -227,7 +228,7 @@ class User extends CommonObject $login=trim($login); // Get user - $sql = "SELECT u.rowid, u.lastname, u.firstname, u.employee, u.gender, u.birth, u.email, u.job, u.skype, u.twitter, u.facebook,"; + $sql = "SELECT u.rowid, u.lastname, u.firstname, u.employee, u.gender, u.birth, u.email, u.job, u.skype, u.twitter, u.facebook, u.linkedin,"; $sql.= " u.signature, u.office_phone, u.office_fax, u.user_mobile,"; $sql.= " u.address, u.zip, u.town, u.fk_state as state_id, u.fk_country as country_id,"; $sql.= " u.admin, u.login, u.note,"; @@ -335,6 +336,7 @@ class User extends CommonObject $this->skype = $obj->skype; $this->twitter = $obj->twitter; $this->facebook = $obj->facebook; + $this->linkedin = $obj->linkedin; $this->job = $obj->job; $this->signature = $obj->signature; $this->admin = $obj->admin; @@ -1252,6 +1254,7 @@ class User extends CommonObject $this->skype = $contact->skype; $this->twitter = $contact->twitter; $this->facebook = $contact->facebook; + $this->linkedin = $contact->linkedin; $this->office_phone = $contact->phone_pro; $this->office_fax = $contact->fax; $this->user_mobile = $contact->phone_mobile; @@ -1469,6 +1472,7 @@ class User extends CommonObject $this->skype = trim($this->skype); $this->twitter = trim($this->twitter); $this->facebook = trim($this->facebook); + $this->linkedin = trim($this->linkedin); $this->job = trim($this->job); $this->signature = trim($this->signature); @@ -1521,6 +1525,7 @@ class User extends CommonObject $sql.= ", skype = '".$this->db->escape($this->skype)."'"; $sql.= ", twitter = '".$this->db->escape($this->twitter)."'"; $sql.= ", facebook = '".$this->db->escape($this->facebook)."'"; + $sql.= ", linkedin = '".$this->db->escape($this->linkedin)."'"; $sql.= ", job = '".$this->db->escape($this->job)."'"; $sql.= ", signature = '".$this->db->escape($this->signature)."'"; $sql.= ", accountancy_code = '".$this->db->escape($this->accountancy_code)."'"; @@ -1609,6 +1614,7 @@ class User extends CommonObject $adh->skype=$this->skype; $adh->twitter=$this->twitter; $adh->facebook=$this->facebook; + $adh->linkedin=$this->linkedin; $adh->phone=$this->office_phone; $adh->phone_mobile=$this->user_mobile; @@ -1661,6 +1667,7 @@ class User extends CommonObject $tmpobj->skype=$this->skype; $tmpobj->twitter=$this->twitter; $tmpobj->facebook=$this->facebook; + $tmpobj->linkedin=$this->linkedin; $tmpobj->phone_pro=$this->office_phone; $tmpobj->phone_mobile=$this->user_mobile; @@ -2528,7 +2535,8 @@ $mailfile = new CMailFile( 'LDAP_FIELD_SID' => 'ldap_sid', 'LDAP_FIELD_SKYPE' => 'skype', 'LDAP_FIELD_TWITTER' => 'twitter', - 'LDAP_FIELD_FACEBOOK' => 'facebook' + 'LDAP_FIELD_FACEBOOK' => 'facebook', + 'LDAP_FIELD_LINKEDIN' => 'linkedin' ); // Champs @@ -2642,6 +2650,7 @@ $mailfile = new CMailFile( $this->skype='skypepseudo'; $this->twitter='twitterpseudo'; $this->facebook='facebookpseudo'; + $this->linkedin='linkedinpseudo'; $this->office_phone='0999999999'; $this->office_fax='0999999998'; $this->user_mobile='0999999997'; @@ -2796,6 +2805,7 @@ $mailfile = new CMailFile( $this->skype=$ldapuser->{$conf->global->LDAP_FIELD_SKYPE}; $this->twitter=$ldapuser->{$conf->global->LDAP_FIELD_TWITTER}; $this->facebook=$ldapuser->{$conf->global->LDAP_FIELD_FACEBOOK}; + $this->linkedin=$ldapuser->{$conf->global->LDAP_FIELD_LINKEDIN}; $this->ldap_sid=$ldapuser->{$conf->global->LDAP_FIELD_SID}; $this->job=$ldapuser->{$conf->global->LDAP_FIELD_TITLE}; From c0be66b5e5c496b4f18ca7df2f62ab617f801735 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 Feb 2019 14:55:29 +0100 Subject: [PATCH 24/46] FXI Remove duplicate record before trying to create unique key --- htdocs/install/mysql/migration/8.0.0-9.0.0.sql | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql index 8e9d82c5fd1..966058e88d7 100644 --- a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql +++ b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql @@ -266,8 +266,12 @@ CREATE TABLE llx_pos_cash_fence( UPDATE llx_const set name = 'PRELEVEMENT_END_TO_END' where name = 'END_TO_END'; UPDATE llx_const set name = 'PRELEVEMENT_USTRD' where name = 'USTRD'; --- Delete duplicate accounting account not used +-- Delete duplicate accounting account, but only if not used +DROP TABLE tmp_llx_accouting_account; +CREATE TABLE tmp_llx_accouting_account AS SELECT MIN(rowid) as MINID, account_number, entity, fk_pcg_version, count(*) AS NB FROM llx_accounting_account group BY account_number, entity, fk_pcg_version HAVING count(*) >= 2 order by account_number, entity, fk_pcg_version; +--SELECT * from tmp_llx_accouting_account; +DELETE from llx_accounting_account where rowid in (select minid from tmp_llx_accouting_account where minid NOT IN (SELECT fk_code_ventilation from llx_facturedet) AND minid NOT IN (SELECT fk_code_ventilation from llx_facture_fourn_det) AND minid NOT IN (SELECT fk_code_ventilation from llx_expensereport_det)) ALTER TABLE llx_accounting_account DROP INDEX uk_accounting_account; From 1be1ee16709c7ff16ea99868c8e2e32636d760e0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 Feb 2019 14:56:28 +0100 Subject: [PATCH 25/46] Remove duplicate record --- htdocs/install/mysql/migration/repair.sql | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index 22409441eac..6a2fe099fdd 100755 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -376,6 +376,16 @@ update llx_bank_url as bu set url_id = (select e.fk_user_author from tmp_bank_ur drop table tmp_bank_url_expense_user; +-- Delete duplicate accounting account, but only if not used +DROP TABLE tmp_llx_accouting_account; +CREATE TABLE tmp_llx_accouting_account AS SELECT MIN(rowid) as MINID, account_number, entity, fk_pcg_version, count(*) AS NB FROM llx_accounting_account group BY account_number, entity, fk_pcg_version HAVING count(*) >= 2 order by account_number, entity, fk_pcg_version; +--SELECT * from tmp_llx_accouting_account; +DELETE from llx_accounting_account where rowid in (select minid from tmp_llx_accouting_account where minid NOT IN (SELECT fk_code_ventilation from llx_facturedet) AND minid NOT IN (SELECT fk_code_ventilation from llx_facture_fourn_det) AND minid NOT IN (SELECT fk_code_ventilation from llx_expensereport_det)) + +ALTER TABLE llx_accounting_account DROP INDEX uk_accounting_account; +ALTER TABLE llx_accounting_account ADD UNIQUE INDEX uk_accounting_account (account_number, entity, fk_pcg_version); + + -- VMYSQL4.1 update llx_projet_task_time set task_datehour = task_date where task_datehour < task_date or task_datehour > DATE_ADD(task_date, interval 1 day); From 3ba69fc93a182ef3bba70256900f753b20fc3b28 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 Feb 2019 15:06:55 +0100 Subject: [PATCH 26/46] Fix missing ; after sql request --- htdocs/install/mysql/migration/8.0.0-9.0.0.sql | 2 +- htdocs/install/mysql/migration/repair.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql index 966058e88d7..31689120cfc 100644 --- a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql +++ b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql @@ -271,7 +271,7 @@ UPDATE llx_const set name = 'PRELEVEMENT_USTRD' where name = 'USTRD'; DROP TABLE tmp_llx_accouting_account; CREATE TABLE tmp_llx_accouting_account AS SELECT MIN(rowid) as MINID, account_number, entity, fk_pcg_version, count(*) AS NB FROM llx_accounting_account group BY account_number, entity, fk_pcg_version HAVING count(*) >= 2 order by account_number, entity, fk_pcg_version; --SELECT * from tmp_llx_accouting_account; -DELETE from llx_accounting_account where rowid in (select minid from tmp_llx_accouting_account where minid NOT IN (SELECT fk_code_ventilation from llx_facturedet) AND minid NOT IN (SELECT fk_code_ventilation from llx_facture_fourn_det) AND minid NOT IN (SELECT fk_code_ventilation from llx_expensereport_det)) +DELETE from llx_accounting_account where rowid in (select minid from tmp_llx_accouting_account where minid NOT IN (SELECT fk_code_ventilation from llx_facturedet) AND minid NOT IN (SELECT fk_code_ventilation from llx_facture_fourn_det) AND minid NOT IN (SELECT fk_code_ventilation from llx_expensereport_det)); ALTER TABLE llx_accounting_account DROP INDEX uk_accounting_account; diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index 6a2fe099fdd..b678cab18b7 100755 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -380,7 +380,7 @@ drop table tmp_bank_url_expense_user; DROP TABLE tmp_llx_accouting_account; CREATE TABLE tmp_llx_accouting_account AS SELECT MIN(rowid) as MINID, account_number, entity, fk_pcg_version, count(*) AS NB FROM llx_accounting_account group BY account_number, entity, fk_pcg_version HAVING count(*) >= 2 order by account_number, entity, fk_pcg_version; --SELECT * from tmp_llx_accouting_account; -DELETE from llx_accounting_account where rowid in (select minid from tmp_llx_accouting_account where minid NOT IN (SELECT fk_code_ventilation from llx_facturedet) AND minid NOT IN (SELECT fk_code_ventilation from llx_facture_fourn_det) AND minid NOT IN (SELECT fk_code_ventilation from llx_expensereport_det)) +DELETE from llx_accounting_account where rowid in (select minid from tmp_llx_accouting_account where minid NOT IN (SELECT fk_code_ventilation from llx_facturedet) AND minid NOT IN (SELECT fk_code_ventilation from llx_facture_fourn_det) AND minid NOT IN (SELECT fk_code_ventilation from llx_expensereport_det)); ALTER TABLE llx_accounting_account DROP INDEX uk_accounting_account; ALTER TABLE llx_accounting_account ADD UNIQUE INDEX uk_accounting_account (account_number, entity, fk_pcg_version); From f6fc9190f373c14ad4f5bcf60ff2d4f83c44c870 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josep=20Llu=C3=ADs?= Date: Mon, 25 Feb 2019 19:41:40 +0100 Subject: [PATCH 27/46] Add no_email field in contact list Add no_email field in contact list --- htdocs/contact/list.php | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index aa27e43ee71..783c887efda 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -10,6 +10,7 @@ * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2018 Juanjo Menent * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019 Josep Lluís Amador * * 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 @@ -68,6 +69,7 @@ $search_phone_pro=GETPOST("search_phone_pro", 'alpha'); $search_phone_mobile=GETPOST("search_phone_mobile", 'alpha'); $search_fax=GETPOST("search_fax", 'alpha'); $search_email=GETPOST("search_email", 'alpha'); +$search_no_email=GETPOST("search_no_email",'int'); $search_skype=GETPOST("search_skype", 'alpha'); $search_twitter=GETPOST("search_twitter", 'alpha'); $search_facebook=GETPOST("search_facebook", 'alpha'); @@ -159,6 +161,7 @@ $arrayfields=array( 'p.phone_mobile'=>array('label'=>"PhoneMobile", 'checked'=>1), 'p.fax'=>array('label'=>"Fax", 'checked'=>0), 'p.email'=>array('label'=>"EMail", 'checked'=>1), + 'p.no_email'=>array('label'=>"No_Email", 'checked'=>0, 'enabled'=>(! empty($conf->mailing->enabled))), 'p.jabberid'=>array('label'=>"Jabber", 'checked'=>1, 'enabled'=>(! empty($conf->socialnetworks->enabled))), 'p.skype'=>array('label'=>"Skype", 'checked'=>1, 'enabled'=>(! empty($conf->socialnetworks->enabled))), 'p.twitter'=>array('label'=>"Twitter", 'checked'=>1, 'enabled'=>(! empty($conf->socialnetworks->enabled))), @@ -222,6 +225,7 @@ if (empty($reshook)) $search_phone_mobile=""; $search_fax=""; $search_email=""; + $search_no_email=-1; $search_skype=""; $search_twitter=""; $search_facebook=""; @@ -258,7 +262,7 @@ $contactstatic=new Contact($db); $title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")); $sql = "SELECT s.rowid as socid, s.nom as name,"; -$sql.= " p.rowid, p.lastname as lastname, p.statut, p.firstname, p.zip, p.town, p.poste, p.email, p.skype,"; +$sql.= " p.rowid, p.lastname as lastname, p.statut, p.firstname, p.zip, p.town, p.poste, p.email, p.no_email, p.skype,"; $sql.= " p.phone as phone_pro, p.phone_mobile, p.phone_perso, p.fax, p.fk_pays, p.priv, p.datec as date_creation, p.tms as date_update,"; $sql.= " co.code as country_code"; // Add fields from extrafields @@ -325,6 +329,7 @@ if (strlen($search_email)) $sql.= natural_search('p.email', $search_ema if (strlen($search_zip)) $sql.= natural_search("p.zip", $search_zip); if (strlen($search_town)) $sql.= natural_search("p.town", $search_town); +if ($search_no_email != '' && $search_no_email >= 0) $sql.= " AND p.no_email = ".$db->escape($search_no_email); if ($search_status != '' && $search_status >= 0) $sql.= " AND p.statut = ".$db->escape($search_status); if ($search_import_key) $sql.= natural_search("p.import_key", $search_import_key); if ($type == "o") // filtre sur type @@ -422,6 +427,7 @@ if ($search_phone_perso != '') $param.='&search_phone_perso='.urlencode($sea if ($search_phone_mobile != '') $param.='&search_phone_mobile='.urlencode($search_phone_mobile); if ($search_fax != '') $param.='&search_fax='.urlencode($search_fax); if ($search_email != '') $param.='&search_email='.urlencode($search_email); +if ($search_no_email != '') $param.='&search_no_email='.urlencode($search_no_email); if ($search_status != '') $param.='&search_status='.urlencode($search_status); if ($search_priv == '0' || $search_priv == '1') $param.="&search_priv=".urlencode($search_priv); if ($search_import_key != '') $param.='&search_import_key='.urlencode($search_import_key); @@ -607,6 +613,12 @@ if (! empty($arrayfields['p.email']['checked'])) print ''; print ''; } +if (! empty($arrayfields['p.no_email']['checked'])) +{ + print ''; + print $form->selectarray('search_no_email', array('-1'=>'', '0'=>$langs->trans('No'),'1'=>$langs->trans('Yes')),$search_no_email); + print ''; +} if (! empty($arrayfields['p.skype']['checked'])) { print ''; @@ -696,6 +708,7 @@ if (! empty($arrayfields['p.phone_perso']['checked'])) print_liste_field if (! empty($arrayfields['p.phone_mobile']['checked'])) print_liste_field_titre($arrayfields['p.phone_mobile']['label'], $_SERVER["PHP_SELF"], "p.phone_mobile", $begin, $param, '', $sortfield, $sortorder); if (! empty($arrayfields['p.fax']['checked'])) print_liste_field_titre($arrayfields['p.fax']['label'], $_SERVER["PHP_SELF"], "p.fax", $begin, $param, '', $sortfield, $sortorder); if (! empty($arrayfields['p.email']['checked'])) print_liste_field_titre($arrayfields['p.email']['label'], $_SERVER["PHP_SELF"], "p.email", $begin, $param, '', $sortfield, $sortorder); +if (! empty($arrayfields['p.no_email']['checked'])) print_liste_field_titre($arrayfields['p.no_email']['label'],$_SERVER["PHP_SELF"],"p.no_email", $begin, $param, '', $sortfield, $sortorder, 'center '); if (! empty($arrayfields['p.skype']['checked'])) print_liste_field_titre($arrayfields['p.skype']['label'], $_SERVER["PHP_SELF"], "p.skype", $begin, $param, '', $sortfield, $sortorder); if (! empty($arrayfields['p.twitter']['checked'])) print_liste_field_titre($arrayfields['p.twitter']['label'], $_SERVER["PHP_SELF"], "p.twitter", $begin, $param, '', $sortfield, $sortorder); if (! empty($arrayfields['p.facebook']['checked'])) print_liste_field_titre($arrayfields['p.facebook']['label'], $_SERVER["PHP_SELF"], "p.facebook", $begin, $param, '', $sortfield, $sortorder); @@ -839,7 +852,12 @@ while ($i < min($num, $limit)) print ''.dol_print_email($obj->email, $obj->rowid, $obj->socid, 'AC_EMAIL', 18).''; if (! $i) $totalarray['nbfield']++; } - + // No EMail + if (! empty($arrayfields['p.no_email']['checked'])) + { + print ''.yn($obj->no_email).''; + if (! $i) $totalarray['nbfield']++; + } // Skype if (! empty($arrayfields['p.skype']['checked'])) { From 1e6ed94c5ea09efede8448a288a009f7da1e9c11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 25 Feb 2019 21:39:45 +0100 Subject: [PATCH 28/46] Update extrafields.class.php The property $errno was declared of type integer, but $this->db->lasterrno() is of type string --- htdocs/core/class/extrafields.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 0ef7f8d295b..c23f40a0283 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -148,7 +148,7 @@ class ExtraFields public $errors = array(); /** - * @var integer DB Error number + * @var string DB Error number */ public $errno; From 1c5955480645be6fb412e5f10e57265cf2ff53fb Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 25 Feb 2019 22:22:31 +0100 Subject: [PATCH 29/46] NEW: Add graphic option for ACCOUNTANCY_COMBO_FOR_AUX --- htdocs/accountancy/admin/index.php | 27 ++++++++++++++++++++++++++- htdocs/langs/en_US/accountancy.lang | 1 + 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index b3b8a67241b..965b63ba9b9 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2018 Alexandre Spangaro + * Copyright (C) 2013-2019 Alexandre Spangaro * Copyright (C) 2014-2015 Ari Elbaz (elarifr) * Copyright (C) 2014 Marcos García * Copyright (C) 2014 Juanjo Menent @@ -144,6 +144,18 @@ if ($action == 'setenabledraftexport') { } } +if ($action == 'setenablesubsidiarylist') { + $setenablesubsidiarylist = GETPOST('value', 'int'); + $res = dolibarr_set_const($db, "ACCOUNTANCY_COMBO_FOR_AUX", $setenablesubsidiarylist, 'yesno', 0, '', $conf->entity); + if (! $res > 0) + $error ++; + if (! $error) { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } else { + setEventMessages($langs->trans("Error"), null, 'mesgs'); + } +} + /* * View */ @@ -251,6 +263,19 @@ if (! empty($user->admin)) } print ''; + print ''; + print '' . $langs->trans("ACCOUNTANCY_COMBO_FOR_AUX") . ''; + if (! empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) { + print ''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ''; + } else { + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print ''; + } + print ''; + print ''; print '' . $langs->trans("ACCOUNTING_MANAGE_ZERO") . ''; if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) { diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 472e2166f6b..ca1f98bf64c 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -142,6 +142,7 @@ ACCOUNTING_LENGTH_AACCOUNT=Length of the third-party accounting accounts (If you ACCOUNTING_MANAGE_ZERO=Allow to manage different number of zeros at the end of an accounting account. Needed by some countries (like Switzerland). If set to off (default), you can set the following two parameters to ask the application to add virtual zeros. BANK_DISABLE_DIRECT_INPUT=Disable direct recording of transaction in bank account ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL=Enable draft export on journal +ACCOUNTANCY_COMBO_FOR_AUX=Enable combo list for subsidiary account ACCOUNTING_SELL_JOURNAL=Sell journal ACCOUNTING_PURCHASE_JOURNAL=Purchase journal From 35762c0d4e01b0a940c104be378cf4b387532f9d Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Tue, 26 Feb 2019 10:22:20 +0100 Subject: [PATCH 30/46] add data elem on task list --- htdocs/core/tpl/extrafields_list_print_fields.tpl.php | 7 ++++--- htdocs/core/tpl/extrafields_list_search_title.tpl.php | 2 +- htdocs/projet/tasks/list.php | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index 6b6d22cf822..739126cd2a8 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -20,9 +20,10 @@ if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_ { $align=$extrafields->getAlignFlag($key, $extrafieldsobjectkey); print ''; - $tmpkey='options_'.$key; + if ($align) print ' align="'.$align.'"'; + print ' data-key="'.$key.'"'; + print '>'; + $tmpkey='options_'.$key; if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$key], array('date', 'datetime', 'timestamp')) && !is_numeric($obj->$tmpkey)) { $datenotinstring = $obj->$tmpkey; diff --git a/htdocs/core/tpl/extrafields_list_search_title.tpl.php b/htdocs/core/tpl/extrafields_list_search_title.tpl.php index 8020739d5cb..36bdf662b54 100644 --- a/htdocs/core/tpl/extrafields_list_search_title.tpl.php +++ b/htdocs/core/tpl/extrafields_list_search_title.tpl.php @@ -22,7 +22,7 @@ if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_ $sortonfield = "ef.".$key; if (! empty($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key])) $sortonfield=''; if ($extrafields->attributes[$extrafieldsobjectkey]['type'][$key] == 'separate') print ''; - else print getTitleFieldOfList($langs->trans($extralabels[$key]), 0, $_SERVER["PHP_SELF"], $sortonfield, "", $param, ($align?'align="'.$align.'"':''), $sortfield, $sortorder)."\n"; + else print getTitleFieldOfList($langs->trans($extralabels[$key]), 0, $_SERVER["PHP_SELF"], $sortonfield, "", $param, ($align?'align="'.$align.'" data-titlekey="'.$key.'"':'data-titlekey="'.$key.'"'), $sortfield, $sortorder)."\n"; } } } diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index e1a77f0b824..17d4bf60df7 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -625,7 +625,7 @@ while ($i < min($num,$limit)) $userAccess = $projectstatic->restrictedProjectArea($user); // why this ? if ($userAccess >= 0) { - print ''; + print ''; // Ref if (! empty($arrayfields['t.ref']['checked'])) From e0c7c32faed5e10a98616bd6cd8fc12bf9df8ce0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Feb 2019 11:44:16 +0100 Subject: [PATCH 31/46] Fix preselection when key is '0' --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index ee0c35ac3a9..bd87fda5799 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6095,7 +6095,7 @@ class Form foreach ($array as $key => $value) { $out.= '