From 9879a43cf4b713cee9c0753de82c90ece2840a6a Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 30 Dec 2019 21:17:41 +0100 Subject: [PATCH 1/6] NEW Add social networks of the company --- htdocs/admin/company.php | 72 +++++++++++++++++++------- htdocs/langs/en_US/companies.lang | 7 +++ htdocs/societe/class/societe.class.php | 9 ++++ 3 files changed, 69 insertions(+), 19 deletions(-) diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index ce75d83505a..f8b9556cf89 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -181,6 +181,13 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha')) } } + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FACEBOOK_URL", GETPOST("facebookurl", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TWITTER_URL", GETPOST("twitterurl", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LINKEDIN_URL", GETPOST("linkedinurl", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_INSTAGRAM_URL", GETPOST("instagramurl", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_YOUTUBE_URL", GETPOST("youtubeurl", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_GITHUB_URL", GETPOST("githuburl", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MANAGERS", GETPOST("MAIN_INFO_SOCIETE_MANAGERS", 'nohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_GDPR", GETPOST("MAIN_INFO_GDPR", 'nohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_CAPITAL", GETPOST("capital", 'nohtml'), 'chaine', 0, '', $conf->entity); @@ -407,32 +414,26 @@ print ''; print ''."\n"; // Name - print ''."\n"; -// Addresse - +// Address print ''."\n"; - print ''."\n"; - print ''."\n"; // Country - print ''."\n"; - print ''."\n"; - +// Currency print ''."\n"; - +// Phone print ''; print ''."\n"; - +// Fax print ''; print ''."\n"; - +// Email print ''; print ''."\n"; @@ -516,6 +517,45 @@ print ''; print '
'.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
'; print 'global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' autofocus="autofocus"').'>
'; print '
'; print '
'; print '
'; //if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // By default, country of localization print $form->select_country($mysoc->country_id, 'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print '
'; $state_id = 0; if (!empty($conf->global->MAIN_INFO_SOCIETE_STATE)) @@ -443,22 +444,22 @@ if (!empty($conf->global->MAIN_INFO_SOCIETE_STATE)) $formcompany->select_departement($state_id, $mysoc->country_code, 'state_id'); print '
'; print $form->selectCurrency($conf->currency, "currency"); print '
'; print '
'; print '
'; print '
'; +// Social networks +print '
'; +print ''; +print ''; +print ''; +print "\n"; + +// Facebook +print ''; +print ''."\n"; + +// Twitter +print ''; +print ''."\n"; + +// LinkedIn +print ''; +print ''."\n"; + +// Instagram +print ''; +print ''."\n"; + +// Youtube +print ''; +print ''."\n"; + +// Github +print ''; +print ''."\n"; + +print "
'.$langs->trans("SocialNetworksInformation").''.$langs->trans("Value").'
'; +print '
'; +print '
'; +print '
'; +print '
'; +print '
'; +print '
"; + print '
'; // IDs of the company (country-specific) @@ -525,24 +565,20 @@ print ''.$langs->trans("CompanyId $langs->load("companies"); // Managing Director(s) - print ''; print ''; // GDPR contact - print ''; print $form->textwithpicto($langs->trans("GDPRContact"), $langs->trans("GDPRContactDesc")); print ''; print ''; // Capital - print ''; print ''; // Juridical Status - print ''; if ($mysoc->country_code) { print $formcompany->select_juridicalstatus($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE, $mysoc->country_code, '', 'forme_juridique_code'); @@ -551,7 +587,7 @@ if ($mysoc->country_code) { } print ''; -// ProfID1 +// ProfId1 if ($langs->transcountry("ProfId1", $mysoc->country_code) != '-') { print ''; @@ -641,14 +677,12 @@ if ($langs->transcountry("ProfId6", $mysoc->country_code) != '-') print ''; } -// TVA Intra - +// Intra-community VAT number print ''; print ''; print ''; // Object of the company - print ''; print ''; print ''; diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 7439972e906..d34109961d3 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -406,6 +406,13 @@ AllocateCommercial=Assigned to sales representative Organization=Organization FiscalYearInformation=Fiscal Year FiscalMonthStart=Starting month of the fiscal year +SocialNetworksInformation=Social networks +SocialNetworksFacebookURL=Facebook URL +SocialNetworksTwitterURL=Twitter URL +SocialNetworksLinkedinURL=Linkedin URL +SocialNetworksInstagramURL=Instagram URL +SocialNetworksYoutubeURL=Youtube URL +SocialNetworksGithubURL=Github URL YouMustAssignUserMailFirst=You must create an email for this user prior to being able to add an email notification. YouMustCreateContactFirst=To be able to add email notifications, you must first define contacts with valid emails for the third party ListSuppliersShort=List of Vendors diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index cb595ce8410..4d42dbfa940 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3637,6 +3637,15 @@ class Societe extends CommonObject $this->phone = empty($conf->global->MAIN_INFO_SOCIETE_TEL) ? '' : $conf->global->MAIN_INFO_SOCIETE_TEL; $this->fax = empty($conf->global->MAIN_INFO_SOCIETE_FAX) ? '' : $conf->global->MAIN_INFO_SOCIETE_FAX; $this->url = empty($conf->global->MAIN_INFO_SOCIETE_WEB) ? '' : $conf->global->MAIN_INFO_SOCIETE_WEB; + + // Social networks + $this->facebook_url = empty($conf->global->MAIN_INFO_SOCIETE_FACEBOOK_URL) ? '' : $conf->global->MAIN_INFO_SOCIETE_FACEBOOK_URL; + $this->twitter_url = empty($conf->global->MAIN_INFO_SOCIETE_TWITTER_URL) ? '' : $conf->global->MAIN_INFO_SOCIETE_TWITTER_URL; + $this->linkedin_url = empty($conf->global->MAIN_INFO_SOCIETE_LINKEDIN_URL) ? '' : $conf->global->MAIN_INFO_SOCIETE_LINKEDIN_URL; + $this->instagram_url = empty($conf->global->MAIN_INFO_SOCIETE_INSTAGRAM_URL) ? '' : $conf->global->MAIN_INFO_SOCIETE_INSTAGRAM_URL; + $this->youtube_url = empty($conf->global->MAIN_INFO_SOCIETE_YOUTUBE_URL) ? '' : $conf->global->MAIN_INFO_SOCIETE_YOUTUBE_URL; + $this->github_url = empty($conf->global->MAIN_INFO_SOCIETE_GITHUB_URL) ? '' : $conf->global->MAIN_INFO_SOCIETE_GITHUB_URL; + // Id prof generiques $this->idprof1 = empty($conf->global->MAIN_INFO_SIREN) ? '' : $conf->global->MAIN_INFO_SIREN; $this->idprof2 = empty($conf->global->MAIN_INFO_SIRET) ? '' : $conf->global->MAIN_INFO_SIRET; From 95335f402e1eeb5ababa72fca3b8ae0e01eb9bdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 31 Dec 2019 14:03:08 +0100 Subject: [PATCH 2/6] NEW upload odt models for thirdparties --- .../modules/societe/doc/doc_generic_odt.modules.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php index cafacc6ac57..2f144d0d2ae 100644 --- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php +++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php @@ -1,7 +1,7 @@ * Copyright (C) 2016 Charlie Benke - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-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 @@ -100,7 +100,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc $form = new Form($this->db); $texte = $this->description.".
\n"; - $texte .= '
'; + $texte .= ''; $texte .= ''; $texte .= ''; $texte .= ''; @@ -160,7 +160,11 @@ class doc_generic_odt extends ModeleThirdPartyDoc } $texte .= ''; } - + // Add input to upload a new template file. + $texte.= '
'.$langs->trans("UploadNewTemplate").' '; + $texte.= ''; + $texte.= ''; + $texte.= '
'; $texte .= ''; $texte .= ''; From b6f7394959ebed56b18c15fed6558abc11deb1b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 31 Dec 2019 14:13:10 +0100 Subject: [PATCH 3/6] NEW upload odt models for invoices --- .../facture/doc/doc_generic_invoice_odt.modules.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index a6e28214335..0c3e9685861 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -3,7 +3,7 @@ * Copyright (C) 2012 Regis Houssin * Copyright (C) 2014 Marcos García * Copyright (C) 2016 Charlie Benke - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-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 @@ -118,7 +118,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures $form = new Form($this->db); $texte = $this->description.".
\n"; - $texte .= ''; + $texte .= ''; $texte .= ''; $texte .= ''; $texte .= ''; @@ -176,7 +176,11 @@ class doc_generic_invoice_odt extends ModelePDFFactures } $texte .= ''; } - + // Add input to upload a new template file. + $texte.= '
'.$langs->trans("UploadNewTemplate").' '; + $texte.= ''; + $texte.= ''; + $texte.= '
'; $texte .= ''; $texte .= ''; From 0c58df51d938470122b3e7ae42fdbbd594c364a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 31 Dec 2019 14:14:30 +0100 Subject: [PATCH 4/6] Update doc_generic_odt.modules.php --- .../core/modules/societe/doc/doc_generic_odt.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php index 2f144d0d2ae..2a7e0cf287f 100644 --- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php +++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php @@ -161,10 +161,10 @@ class doc_generic_odt extends ModeleThirdPartyDoc $texte .= ''; } // Add input to upload a new template file. - $texte.= '
'.$langs->trans("UploadNewTemplate").' '; - $texte.= ''; - $texte.= ''; - $texte.= '
'; + $texte .= '
'.$langs->trans("UploadNewTemplate").' '; + $texte .= ''; + $texte .= ''; + $texte .= '
'; $texte .= ''; $texte .= ''; From 596e2ccefc7bbb49a43b8a04218042fe2b2656d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 31 Dec 2019 14:15:17 +0100 Subject: [PATCH 5/6] Update doc_generic_invoice_odt.modules.php --- .../facture/doc/doc_generic_invoice_odt.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index 0c3e9685861..ef05b9b2df9 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -177,10 +177,10 @@ class doc_generic_invoice_odt extends ModelePDFFactures $texte .= ''; } // Add input to upload a new template file. - $texte.= '
'.$langs->trans("UploadNewTemplate").' '; - $texte.= ''; - $texte.= ''; - $texte.= '
'; + $texte .= '
'.$langs->trans("UploadNewTemplate").' '; + $texte .= ''; + $texte .= ''; + $texte .= '
'; $texte .= ''; $texte .= ''; From 530eeffed78d1a9e9d1eee53537527330753b1ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 31 Dec 2019 14:30:57 +0100 Subject: [PATCH 6/6] NEW upload odt templates for sendings --- .../doc/doc_generic_shipment_odt.modules.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php index 747096e852a..1ea817709e1 100644 --- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php +++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php @@ -4,7 +4,7 @@ * Copyright (C) 2014 Marcos García * Copyright (C) 2016 Charlie Benke * Copyright (C) 2018-2019 Philippe Grand - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-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 @@ -119,7 +119,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition $form = new Form($this->db); $texte = $this->description.".
\n"; - $texte .= ''; + $texte .= ''; $texte .= ''; $texte .= ''; $texte .= ''; @@ -177,7 +177,11 @@ class doc_generic_shipment_odt extends ModelePdfExpedition } $texte .= ''; } - + // Add input to upload a new template file. + $texte .= '
'.$langs->trans("UploadNewTemplate").' '; + $texte .= ''; + $texte .= ''; + $texte .= '
'; $texte .= ''; $texte .= '';