From e96db77fdaeaa459fa5c7f5778ee2c07ab1d86e6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Nov 2025 02:49:47 +0100 Subject: [PATCH] Look and feel Debug v23 --- htdocs/admin/barcode.php | 357 ++++++++++-------- htdocs/comm/card.php | 7 - htdocs/comm/recap-client.php | 7 - htdocs/core/class/commonobject.class.php | 2 +- .../core/class/commonsocialnetworks.class.php | 4 +- htdocs/core/modules/modBarcode.class.php | 13 +- htdocs/core/modules/modSociete.class.php | 3 - htdocs/fourn/card.php | 5 - .../mysql/data/llx_c_socialnetworks.sql | 8 +- htdocs/langs/en_US/main.lang | 1 + htdocs/langs/en_US/products.lang | 2 + htdocs/product/card.php | 20 +- .../canvas/company/tpl/card_create.tpl.php | 4 - .../canvas/company/tpl/card_edit.tpl.php | 13 - .../canvas/company/tpl/card_view.tpl.php | 7 - .../canvas/individual/tpl/card_create.tpl.php | 4 - .../canvas/individual/tpl/card_edit.tpl.php | 14 - .../canvas/individual/tpl/card_view.tpl.php | 7 - htdocs/societe/card.php | 212 ++++++----- htdocs/societe/class/societe.class.php | 1 - htdocs/societe/consumption.php | 4 - htdocs/societe/document.php | 5 - htdocs/societe/note.php | 4 - htdocs/societe/notify/card.php | 5 - htdocs/societe/paymentmodes.php | 4 - htdocs/societe/price.php | 4 - htdocs/societe/project.php | 4 - htdocs/societe/societecontact.php | 4 - 28 files changed, 343 insertions(+), 382 deletions(-) diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index 14e773bf017..fac4b259edd 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -152,6 +152,53 @@ $linkback = ''; + +/* + * Usage + */ + +print "
"; +print ''; +print ""; + +print '
'; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; + +// Module products +if (isModEnabled('product')) { + print ''; + print ''; + print ''; + print ''; + print ''; +} + +// Module thirdparty +if (isModEnabled('societe')) { + print ''; + print ''; + print ''; + print ''; + print ''; +} + +print "
'.$langs->trans("Feature").' 
'.img_picto('', 'product', 'class="pictofixedwidth"').$langs->trans("UseBarCodeForProducts").''; + print ajax_constantonoff('BARCODE_USE_ON_PRODUCT', array(), null, 0, 0, 1); + print ' 
'.img_picto('', 'company', 'class="pictofixedwidth"').$langs->trans("UseBarCodeForThirdParties").''; + print ajax_constantonoff('BARCODE_USE_ON_THIRDPARTY', array(), null, 0, 0, 1); + print ' 
\n"; +print '
'; + + +print '
'; + + // Detect bar codes modules $barcodelist = array(); @@ -175,6 +222,7 @@ foreach ($dirbarcode as $reldir) { while (($file = readdir($handle)) !== false) { if (substr($file, 0, 1) != '.' && substr($file, 0, 3) != 'CVS') { if (is_readable($newdir.$file)) { + $reg = array(); if (preg_match('/(.*)\.modules\.php$/i', $file, $reg)) { $filebis = $reg[1]; @@ -206,7 +254,7 @@ foreach ($dirbarcode as $reldir) { // Select barcode numbering module -if (isModEnabled('product')) { +if (getDolGlobalString('BARCODE_USE_ON_PRODUCT') && isModEnabled('product')) { print load_fiche_titre($langs->trans("BarCodeNumberManager")." (".$langs->trans("Product").")", '', 'product'); print '
'; @@ -273,7 +321,7 @@ if (isModEnabled('product')) { } // Select barcode numbering module -if (isModEnabled('societe')) { +if (getDolGlobalString('BARCODE_USE_ON_THIRDPARTY') && isModEnabled('societe')) { print load_fiche_titre($langs->trans("BarCodeNumberManager")." (".$langs->trans("ThirdParty").")", '', 'company'); print '
'; @@ -343,172 +391,175 @@ if (isModEnabled('societe')) { /* * CHOOSE ENCODING */ +if (getDolGlobalString('BARCODE_USE_ON_PRODUCT') || getDolGlobalString('BARCODE_USE_ON_THIRDPARTY')) { + print load_fiche_titre($langs->trans("BarcodeEncodeModule"), '', ''); -print load_fiche_titre($langs->trans("BarcodeEncodeModule"), '', ''); - -if (empty($conf->use_javascript_ajax)) { - print ''; - print ''; - print ''; -} - -print '
'; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print "\n"; - -$sql = "SELECT rowid, code as encoding, libelle as label, coder, example"; -$sql .= " FROM ".MAIN_DB_PREFIX."c_barcode_type"; -$sql .= " WHERE entity = ".$conf->entity; -$sql .= " ORDER BY code"; - -dol_syslog("admin/barcode.php", LOG_DEBUG); -$resql = $db->query($sql); -if ($resql) { - $num = $db->num_rows($resql); - $i = 0; - - while ($i < $num) { - $obj = $db->fetch_object($resql); - - print ''; - print ''; - - // Show example - print ''; - - print '\n"; - - $i++; + if (empty($conf->use_javascript_ajax)) { + print ''; + print ''; + print ''; } -} -print "
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Example").''.$langs->trans("CodeBarGenerator").'
'; - print dol_escape_htmltag($obj->label); - print "\n"; - print $langs->trans('BarcodeDesc'.$obj->encoding); - //print "L'EAN se compose de 8 characters, 7 chiffres plus une cle de verification.
"; - //print "L'utilisation des symbologies EAN8 impose la souscription et l'abonnement aupres d'organismes comme GENCOD.
"; - //print "Codes numeriques utilises exclusivement a l'identification des produits susceptibles d'etre vendus au grand public."; - print '
'; - if ($obj->coder && $obj->coder != -1) { - $result = 0; - - foreach ($dirbarcode as $reldir) { - $dir = dol_buildpath($reldir, 0); - $newdir = dol_osencode($dir); - - // Check if directory exists (we do not use dol_is_dir to avoid loading files.lib.php) - if (!is_dir($newdir)) { - continue; - } - - $result = @include_once $newdir.$obj->coder.'.modules.php'; - if ($result) { - break; - } - } - if ($result) { - $classname = "mod".ucfirst($obj->coder); - if (class_exists($classname)) { - $module = new $classname($db); - '@phan-var-force ModeleBarCode $module'; - if ($module->encodingIsSupported($obj->encoding)) { - // Build barcode on disk (not used, this is done to make debug easier) - $result = $module->writeBarCode($obj->example, $obj->encoding, 'Y'); - // Generate on the fly and output barcode with generator - $url = DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($obj->coder).'&code='.urlencode($obj->example).'&encoding='.urlencode($obj->encoding); - //print $url; - print ''; - } else { - print $langs->trans("FormatNotSupportedByGenerator"); - } - } else { - print 'ErrorClassNotFoundInModule '.$classname.' '.$obj->coder; - } - } - } else { - print ''.$langs->trans("ChooseABarCode").''; - } - print ''; - print $formbarcode->setBarcodeEncoder($obj->coder, $barcodelist, $obj->rowid, 'form'.$i); - print "
\n"; -print '
'; -if (empty($conf->use_javascript_ajax)) { - print $form->buttonsSaveCancel("Save", ''); -} + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; -print "
"; + $sql = "SELECT rowid, code as encoding, libelle as label, coder, example"; + $sql .= " FROM ".MAIN_DB_PREFIX."c_barcode_type"; + $sql .= " WHERE entity = ".$conf->entity; + $sql .= " ORDER BY code"; + + dol_syslog("admin/barcode.php", LOG_DEBUG); + $resql = $db->query($sql); + if ($resql) { + $num = $db->num_rows($resql); + $i = 0; + + while ($i < $num) { + $obj = $db->fetch_object($resql); + + print ''; + print ''; + + // Show example + print ''; + + print '\n"; + + $i++; + } + } + print "
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Example").''.$langs->trans("CodeBarGenerator").'
'; + print dol_escape_htmltag($obj->label); + print "\n"; + print $langs->trans('BarcodeDesc'.$obj->encoding); + //print "L'EAN se compose de 8 characters, 7 chiffres plus une cle de verification.
"; + //print "L'utilisation des symbologies EAN8 impose la souscription et l'abonnement aupres d'organismes comme GENCOD.
"; + //print "Codes numeriques utilises exclusivement a l'identification des produits susceptibles d'etre vendus au grand public."; + print '
'; + if ($obj->coder && $obj->coder != -1) { + $result = 0; + + foreach ($dirbarcode as $reldir) { + $dir = dol_buildpath($reldir, 0); + $newdir = dol_osencode($dir); + + // Check if directory exists (we do not use dol_is_dir to avoid loading files.lib.php) + if (!is_dir($newdir)) { + continue; + } + + $result = @include_once $newdir.$obj->coder.'.modules.php'; + if ($result) { + break; + } + } + if ($result) { + $classname = "mod".ucfirst($obj->coder); + if (class_exists($classname)) { + $module = new $classname($db); + '@phan-var-force ModeleBarCode $module'; + if ($module->encodingIsSupported($obj->encoding)) { + // Build barcode on disk (not used, this is done to make debug easier) + $result = $module->writeBarCode($obj->example, $obj->encoding, 'Y'); + // Generate on the fly and output barcode with generator + $url = DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($obj->coder).'&code='.urlencode($obj->example).'&encoding='.urlencode($obj->encoding); + //print $url; + print ''; + } else { + print $langs->trans("FormatNotSupportedByGenerator"); + } + } else { + print 'ErrorClassNotFoundInModule '.$classname.' '.$obj->coder; + } + } + } else { + print ''.$langs->trans("ChooseABarCode").''; + } + print ''; + print $formbarcode->setBarcodeEncoder($obj->coder, $barcodelist, $obj->rowid, 'form'.$i); + print "
\n"; + print '
'; + + if (empty($conf->use_javascript_ajax)) { + print $form->buttonsSaveCancel("Save", ''); + } + + print "
"; +} /* * Other options */ -print load_fiche_titre($langs->trans("OtherOptions"), '', ''); +if (getDolGlobalString('BARCODE_USE_ON_PRODUCT') || getDolGlobalString('BARCODE_USE_ON_THIRDPARTY')) { + print load_fiche_titre($langs->trans("OtherOptions"), '', ''); -print ""; -print ''; -print ""; + print ""; + print ''; + print ""; -print '
'; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; + print '
'; + print '
'.$langs->trans("Parameter").' 
'; + print ''; + print ''; + print ''; + print ''; + print ''; -// Chemin du binaire genbarcode sous linux -if (!isset($_SERVER['WINDIR'])) { - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; } - print ''; - print ''; - print ''; + + // Module products + if (getDolGlobalString('BARCODE_USE_ON_PRODUCT') && isModEnabled('product')) { + print ''; + print ''; + print ''; + print ''; + print ''; + } + + // Module thirdparty + if (getDolGlobalString('BARCODE_USE_ON_THIRDPARTY') && isModEnabled('societe')) { + print ''; + print ''; + print ''; + print ''; + print ''; + } + + print "
'.$langs->trans("Parameter").' 
'.$langs->trans("GenbarcodeLocation").''; - print ''; - if (getDolGlobalString('GENBARCODE_LOCATION') && !@file_exists($conf->global->GENBARCODE_LOCATION)) { - $langs->load("errors"); - print '
'.$langs->trans("ErrorFileNotFound", getDolGlobalString('GENBARCODE_LOCATION')).''; + // Chemin du binaire genbarcode sous linux + if (!isset($_SERVER['WINDIR'])) { + print '
'.$langs->trans("GenbarcodeLocation").''; + print ''; + if (getDolGlobalString('GENBARCODE_LOCATION') && !@file_exists($conf->global->GENBARCODE_LOCATION)) { + $langs->load("errors"); + print '
'.$langs->trans("ErrorFileNotFound", getDolGlobalString('GENBARCODE_LOCATION')).''; + } + print '
 
 
'.img_picto('', 'product', 'class="pictofixedwidth"').$langs->trans("SetDefaultBarcodeTypeProducts").''; + print $formbarcode->selectBarcodeType(getDolGlobalInt('PRODUIT_DEFAULT_BARCODE_TYPE'), "PRODUIT_DEFAULT_BARCODE_TYPE", 1); + print ' 
'.img_picto('', 'company', 'class="pictofixedwidth"').$langs->trans("SetDefaultBarcodeTypeThirdParties").''; + print $formbarcode->selectBarcodeType(getDolGlobalInt('GENBARCODE_BARCODETYPE_THIRDPARTY'), "GENBARCODE_BARCODETYPE_THIRDPARTY", 1); + print ' 
\n"; + print '
'; + + print '
'; + print ''; + print "
"; + print ''; + + print '
'; } -// Module products -if (isModEnabled('product')) { - print ''; - print ''.img_picto('', 'product', 'class="pictofixedwidth"').$langs->trans("SetDefaultBarcodeTypeProducts").''; - print ''; - print $formbarcode->selectBarcodeType(getDolGlobalInt('PRODUIT_DEFAULT_BARCODE_TYPE'), "PRODUIT_DEFAULT_BARCODE_TYPE", 1); - print ''; - print ' '; - print ''; -} - -// Module thirdparty -if (isModEnabled('societe')) { - print ''; - print ''.img_picto('', 'company', 'class="pictofixedwidth"').$langs->trans("SetDefaultBarcodeTypeThirdParties").''; - print ''; - print $formbarcode->selectBarcodeType(getDolGlobalInt('GENBARCODE_BARCODETYPE_THIRDPARTY'), "GENBARCODE_BARCODETYPE_THIRDPARTY", 1); - print ''; - print ' '; - print ''; -} - -print "\n"; -print '
'; - -print '
'; -print ''; -print "
"; -print ''; - -print '
'; - // End of page llxFooter(); diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index b62b2dd8521..7091a3a0041 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -379,13 +379,6 @@ if ($object->id > 0) { print $object->getTypeUrl(1); print ''; - // Prefix - if (getDolGlobalString('SOCIETE_USEPREFIX')) { // Old not used prefix field - print ''.$langs->trans("Prefix").''; - print($object->prefix_comm ? $object->prefix_comm : ' '); - print ''; - } - if ($object->client) { $langs->loadLangs(array("compta", "accountancy")); diff --git a/htdocs/comm/recap-client.php b/htdocs/comm/recap-client.php index f50a69286ed..4ba864c59b9 100644 --- a/htdocs/comm/recap-client.php +++ b/htdocs/comm/recap-client.php @@ -78,13 +78,6 @@ if ($socid > 0) { // Name print ''.$langs->trans("ThirdParty").''.$societe->getNomUrl(1).''; - // Prefix - if (getDolGlobalString('SOCIETE_USEPREFIX')) { // Old not used prefix field - print ''.$langs->trans("Prefix").''; - print($societe->prefix_comm ? $societe->prefix_comm : ' '); - print ''; - } - print ""; print "\n"; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 84497518015..29379743f84 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -9554,7 +9554,7 @@ abstract class CommonObject $labeltoshow = $langs->trans($label); $helptoshow = $langs->trans($extrafields->attributes[$this->table_element]['help'][$key]); if ($display_type == 'card') { - $out .= ''; + $out .= ''; if (getDolGlobalString('MAIN_VIEW_LINE_NUMBER') && ($action == 'view' || $action == 'valid' || $action == 'editline' || $action == 'confirm_valid' || $action == 'confirm_cancel')) { $out .= ''; } diff --git a/htdocs/core/class/commonsocialnetworks.class.php b/htdocs/core/class/commonsocialnetworks.class.php index 320711735d8..f7cc8c95c3a 100644 --- a/htdocs/core/class/commonsocialnetworks.class.php +++ b/htdocs/core/class/commonsocialnetworks.class.php @@ -57,10 +57,8 @@ trait CommonSocialNetworks if ($nbofnetworks > 1) { print '
'; - //print ''; - //print ''; - //print '
'; print ' '.$nbactive.''; + print ' '.$form->textwithpicto("", $langs->transnoentitiesnoconv("YouCanChangeValuesForThisListFromModuleSetup", $langs->transnoentitiesnoconv("SocialNetworks"))).''; print ''; print ''; } diff --git a/htdocs/core/modules/modBarcode.class.php b/htdocs/core/modules/modBarcode.class.php index b6ac87127b3..537146ff9ac 100644 --- a/htdocs/core/modules/modBarcode.class.php +++ b/htdocs/core/modules/modBarcode.class.php @@ -63,13 +63,12 @@ class modBarcode extends DolibarrModules $this->config_page_url = array("barcode.php"); // Constants - // Example: $this->const=array(0=>array('MYMODULE_MYNEWCONST1','chaine','myvalue','This is a constant to add',0), - // 1=>array('MYMODULE_MYNEWCONST2','chaine','myvalue','This is another constant to add',0) ); - $this->const = array(); - //$this->const[0] = array('BARCODE_LABEL_LEFT_TEXT','chaine','%BARCODE%','Print barcode on left side of label',1); - //$this->const[1] = array('BARCODE_LABEL_RIGHT_TEXT','chaine','%LOGO%','Print Company logo on right side',1); - //$this->const[2] = array('BARCODE_LABEL_HEADER_TEXT','chaine','My header','Print header text on label',1); - //$this->const[3] = array('BARCODE_LABEL_FOOTER_TEXT','chaine','My footer','Print footer text on label',1); + // List of particular constants to add when module is enabled (key, 'chaine', value, desc, visible, 'current' or 'allentities', deleteonunactive) + // Example: $this->const=array(1 => array('MYMODULE_MYNEWCONST1', 'chaine', 'myvalue', 'This is a constant to add', 1), + // 2 => array('MYMODULE_MYNEWCONST2', 'chaine', 'myvalue', 'This is another constant to add', 0, 'current', 1) + $this->const = array( + 0 => array('BARCODE_USE_ON_PRODUCT', 'chaine', '1', 'Constant to activate barcode for products', 0) + ); // Boxes $this->boxes = array(); diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index 577c69a370d..0f66ad1f8ea 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -285,9 +285,6 @@ class modSociete extends DolibarrModules 'st.code' => 'ProspectStatus', 'payterm.libelle' => 'PaymentConditions', 'paymode.libelle' => 'PaymentMode', 's.outstanding_limit' => 'OutstandingBill', 'pbacc.ref' => 'PaymentBankAccount', 'incoterm.code' => 'IncotermLabel' ); - if (getDolGlobalString('SOCIETE_USEPREFIX')) { - $this->export_fields_array[$r]['s.prefix'] = 'Prefix'; - } if (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) { $this->export_fields_array[$r]['s.price_level'] = 'PriceLevel'; } diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index e664e2d7f0a..cd50c8d6fca 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -251,11 +251,6 @@ if ($object->id > 0) { print $object->getTypeUrl(1); print ''; - // Prefix - if (getDolGlobalString('SOCIETE_USEPREFIX')) { // Old not used prefix field - print ''.$langs->trans('Prefix').''.$object->prefix_comm.''; - } - if ($object->fournisseur) { $langs->load('compta'); diff --git a/htdocs/install/mysql/data/llx_c_socialnetworks.sql b/htdocs/install/mysql/data/llx_c_socialnetworks.sql index 3a608ecf758..18a9483dc3f 100644 --- a/htdocs/install/mysql/data/llx_c_socialnetworks.sql +++ b/htdocs/install/mysql/data/llx_c_socialnetworks.sql @@ -36,9 +36,9 @@ INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'gifycat', 'Gificat', '{socialid}', '', 0); INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'giphy', 'Giphy', '{socialid}', '', 0); INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'github', 'GitHub', 'https://www.github.com/{socialid}', '', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'instagram', 'Instagram', 'https://www.instagram.com/{socialid}', 'fa-instagram', 1); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'instagram', 'Instagram', 'https://www.instagram.com/{socialid}', 'fa-instagram', 0); INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'linkedin', 'LinkedIn', 'https://www.linkedin.com/in/{socialid}', 'fa-linkedin', 1); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'mastodon', 'Mastodon', '{socialid}', 'fa-mastodon', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'mastodon', 'Mastodon', '{socialid}', 'fa-mastodon', 1); INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'meetup', 'Meetup', '{socialid}', 'fa-meetup', 0); INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'periscope', 'Periscope', '{socialid}', '', 0); INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'pinterest', 'Pinterest', '{socialid}', 'fa-pinterest', 0); @@ -46,8 +46,8 @@ INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'quora', 'Quora', '{socialid}', '', 0); INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'reddit', 'Reddit', '{socialid}', 'fa-reddit', 0); INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'slack', 'Slack', '{socialid}', 'fa-slack', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'snapchat', 'Snapchat', '{socialid}', 'fa-snapchat', 1); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'skype', 'Skype', 'https://www.skype.com/{socialid}', 'fa-skype', 1); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'snapchat', 'Snapchat', '{socialid}', 'fa-snapchat', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'skype', 'Skype', 'https://www.skype.com/{socialid}', 'fa-skype', 0); INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'tripadvisor', 'Tripadvisor', '{socialid}', '', 0); INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'tumblr', 'Tumblr', 'https://www.tumblr.com/{socialid}', 'fa-tumblr', 0); INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'twitch', 'Twitch', '{socialid}', '', 0); diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 0010322f6aa..1130fd18023 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -771,6 +771,7 @@ TotalWoman=Total NeverReceived=Never received Canceled=Canceled YouCanChangeValuesForThisListFromDictionarySetup=You can change values for this list from menu Setup - Dictionaries +YouCanChangeValuesForThisListFromModuleSetup=You can change values for this list from the setup page of module %s YouCanChangeValuesForThisListFrom=You can change values for this list from menu %s YouCanSetDefaultValueInModuleSetup=You can set the default value used when creating a new record in module setup Color=Color diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 5d5666b71f4..b21c9f1433b 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -459,3 +459,5 @@ PriceByCustomeAndMultiPricesAbility=Different prices for each customer + Multipl WhenProductVirtualOnOptionAreForced=When the option 'Enable Kits' (Product module) is on, some modes for automatic stock decrease or increase may be not available. The other options have no restriction. UpdatedRecently=Updated recently ProductType=Type of product +UseBarCodeForProducts=Use barcode for products +UseBarCodeForThirdParties=Use barcode for third parties diff --git a/htdocs/product/card.php b/htdocs/product/card.php index b0cb32bd483..3b798eb0725 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -230,7 +230,7 @@ if ($cancel) { $action = ''; } -$createbarcode = isModEnabled('barcode'); +$createbarcode = (isModEnabled('barcode') && getDolGlobalString('BARCODE_USE_ON_PRODUCT')); if (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !$user->hasRight('barcode', 'creer_advance')) { $createbarcode = 0; } @@ -1406,7 +1406,7 @@ llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-product page-card'); // Load object modBarCodeProduct $res = 0; $modBarCodeProduct = null; -if (isModEnabled('barcode') && getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM')) { +if (isModEnabled('barcode') && getDolGlobalString('BARCODE_USE_ON_PRODUCT') && getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM')) { $module = strtolower(getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM')); $dirbarcode = array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']); foreach ($dirbarcode as $dirroot) { @@ -1599,12 +1599,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio } } - $showbarcode = isModEnabled('barcode'); + $showbarcode = (isModEnabled('barcode') && getDolGlobalString('BARCODE_USE_ON_PRODUCT')); if (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !$user->hasRight('barcode', 'lire_advance')) { $showbarcode = 0; } - if ($showbarcode && is_object($modBarCodeProduct)) { + if ($showbarcode) { //var_dump($modBarCodeProduct); exit; print ''.$langs->trans('BarcodeType').''; @@ -1624,9 +1624,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio print ''; print ''; - print 'code_null ? '' : ' class="fieldrequired"').'>'.$langs->trans("BarcodeValue").''; + print 'code_null) ? '' : ' class="fieldrequired"').'>'.$langs->trans("BarcodeValue").''; $tmpcode = GETPOSTISSET('barcode') ? GETPOST('barcode') : $object->barcode; - if (empty($tmpcode) && !empty($modBarCodeProduct->code_auto)) { + if (empty($tmpcode) && is_object($modBarCodeProduct) && !empty($modBarCodeProduct->code_auto)) { $tmpcode = $modBarCodeProduct->getNextValue($object, $fk_barcode_type); } print img_picto('', 'barcode', 'class="pictofixedwidth"'); @@ -2233,7 +2233,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio } // Barcode - $showbarcode = isModEnabled('barcode'); + $showbarcode = (isModEnabled('barcode') && getDolGlobalString('BARCODE_USE_ON_PRODUCT')); if (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !$user->hasRight('barcode', 'lire_advance')) { $showbarcode = 0; } @@ -2578,7 +2578,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio } else { // Card in view mode - $showbarcode = isModEnabled('barcode'); + $showbarcode = (isModEnabled('barcode')&& getDolGlobalString('BARCODE_USE_ON_PRODUCT')); if (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !$user->hasRight('barcode', 'lire_advance')) { $showbarcode = 0; } @@ -2623,7 +2623,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio if ($showbarcode) { // Barcode type print ''; - print '
'; + print ''; if (($action != 'editbarcodetype') && $usercancreate && $createbarcode) { @@ -2649,7 +2649,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio // Barcode value print '
'; print $langs->trans("BarcodeType"); print '
'; - print '
'; + print ''; if (($action != 'editbarcode') && $usercancreate && $createbarcode) { diff --git a/htdocs/societe/canvas/company/tpl/card_create.tpl.php b/htdocs/societe/canvas/company/tpl/card_create.tpl.php index 09de6b1d86a..c82a0f5b769 100644 --- a/htdocs/societe/canvas/company/tpl/card_create.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_create.tpl.php @@ -71,10 +71,6 @@ if (empty($conf) || !is_object($conf)) { - - - - diff --git a/htdocs/societe/canvas/company/tpl/card_edit.tpl.php b/htdocs/societe/canvas/company/tpl/card_edit.tpl.php index 58db2269cb9..8c3ecde934d 100644 --- a/htdocs/societe/canvas/company/tpl/card_edit.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_edit.tpl.php @@ -62,19 +62,6 @@ $contact = $GLOBALS['objcanvas']->control->object; - - - - - - diff --git a/htdocs/societe/canvas/company/tpl/card_view.tpl.php b/htdocs/societe/canvas/company/tpl/card_view.tpl.php index 9526b60176a..23ddf3812c4 100644 --- a/htdocs/societe/canvas/company/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_view.tpl.php @@ -59,13 +59,6 @@ if ($this->control->tpl['js_checkVatPopup']) { - - - - - - - control->tpl['client']) { ?> diff --git a/htdocs/societe/canvas/individual/tpl/card_create.tpl.php b/htdocs/societe/canvas/individual/tpl/card_create.tpl.php index b317439024b..8567b3af286 100644 --- a/htdocs/societe/canvas/individual/tpl/card_create.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_create.tpl.php @@ -69,10 +69,6 @@ if (empty($conf) || !is_object($conf)) { - - - - diff --git a/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php b/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php index 50f5ac032cd..bff947df5a3 100644 --- a/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php @@ -61,20 +61,6 @@ if (empty($conf) || !is_object($conf)) { - - - - - - - diff --git a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php index 07e2afc2ae0..2a6072ee104 100644 --- a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php @@ -57,13 +57,6 @@ if ($this->control->tpl['action_delete']) { - - - - - - - control->tpl['client']) { ?> diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 4ad56d3b54e..070dd12de0b 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1198,6 +1198,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio print load_fiche_titre($langs->trans("NewThirdParty"), $linkback, 'building'); if (!empty($conf->use_javascript_ajax)) { + // If option to also create a contact if (getDolGlobalString('THIRDPARTY_SUGGEST_ALSO_ADDRESS_CREATION')) { print "\n".' + '; + if (getDolGlobalString('ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY')) { print '
'; print '
'; print $langs->trans("BarcodeValue"); print '
trans('ThirdPartyName'); ?> trans('Prefix'); ?>
trans("Prefix"); ?> - control->tpl['prefix_customercode'] || $this->control->tpl['prefix_suppliercode']) && $this->control->tpl['prefix_comm']) { ?> - - control->tpl['prefix_comm']; ?> - - - -
trans('ProspectCustomer'); ?>control->tpl['showrefnav']; ?>
trans('Prefix'); ?>control->tpl['prefix_comm']; ?>
trans('CustomerCode'); ?>
trans('LastName'); ?> trans('Prefix'); ?>
trans("Prefix"); ?> - control->tpl['prefix_customercode'] || $this->control->tpl['prefix_suppliercode']) && $this->control->tpl['prefix_comm']) { ?> - - control->tpl['prefix_comm']; ?> - - - -
trans('ProspectCustomer'); ?> control->tpl['select_customertype']; ?>control->tpl['showrefnav']; ?>
trans('Prefix'); ?>control->tpl['prefix_comm']; ?>
trans('CustomerCode'); ?>
'; @@ -2966,12 +2988,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio print $object->getTypeUrl(1); print ''; - // Prefix - if (getDolGlobalString('SOCIETE_USEPREFIX')) { // Old not used prefix field - print ''; - print ''; - } - // Customer code if ($object->client) { print ''; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 241ddea823b..1efd7e10ff8 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -221,7 +221,6 @@ class Societe extends CommonObject 'fk_stcomm' => array('type' => 'integer', 'label' => 'CommercialStatus', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 220), 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 225), 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 230), - 'prefix_comm' => array('type' => 'varchar(5)', 'label' => 'Prefix comm', 'enabled' => "getDolGlobalInt('SOCIETE_USEPREFIX')", 'visible' => -1, 'position' => 235), 'client' => array('type' => 'tinyint(4)', 'label' => 'Client', 'enabled' => 1, 'visible' => -1, 'position' => 240), 'fournisseur' => array('type' => 'tinyint(4)', 'label' => 'Fournisseur', 'enabled' => 1, 'visible' => -1, 'position' => 245), 'supplier_account' => array('type' => 'varchar(32)', 'label' => 'Supplier account', 'enabled' => 1, 'visible' => -1, 'position' => 250), diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index d6d8168681c..f9b4fe84da0 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -151,10 +151,6 @@ print 'getTypeUrl(1); print ''; -if (getDolGlobalString('SOCIETE_USEPREFIX')) { // Old not used prefix field - print ''; -} - //if (isModEnabled('agenda') && $user->hasRight('agenda', 'myactions', 'read')) $elementTypeArray['action']=$langs->transnoentitiesnoconv('Events'); $elementTypeArray = array(); diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php index 11fa134163a..79908aeb1c5 100644 --- a/htdocs/societe/document.php +++ b/htdocs/societe/document.php @@ -154,11 +154,6 @@ print 'getTypeUrl(1); print ''; -// Prefix -if (getDolGlobalString('SOCIETE_USEPREFIX')) { // Old not used prefix field - print ''; -} - if ($object->client) { print ''; - if (getDolGlobalString('SOCIETE_USEPREFIX')) { // Old not used prefix field - print ''; - } - if ($object->client) { print ''; - // Prefix - if (getDolGlobalString('SOCIETE_USEPREFIX')) { // Old not used prefix field - print ''; - } - if ($object->client) { print ''; - if (getDolGlobalString('SOCIETE_USEPREFIX')) { // Old not used prefix field - print ''; - } - if ($object->client) { print 'getTypeUrl(1); print ''; -if (getDolGlobalString('SOCIETE_USEPREFIX')) { // Old not used prefix field - print ''; -} - if ($object->client) { print ''; - if (getDolGlobalString('SOCIETE_USEPREFIX')) { // Old not used prefix field - print ''; - } - if ($object->client) { print '';*/ - if (getDolGlobalString('SOCIETE_USEPREFIX')) { // Old not used prefix field - print ''; - } - if ($object->client) { print '
'.$langs->trans('Prefix').''.dol_escape_htmltag($object->prefix_comm).'
'; @@ -3001,7 +3017,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio } // Barcode - if (isModEnabled('barcode')) { + if (isModEnabled('barcode') && getDolGlobalString('BARCODE_USE_ON_THIRDPARTY')) { print '
'; print $langs->trans('Gencod').''.showValueWithClipboardCPButton(dol_escape_htmltag($object->barcode)); print '
'.$langs->trans('NatureOfThirdParty').'
'.$langs->trans('Prefix').''.$object->prefix_comm.'
'.$langs->trans('NatureOfThirdParty').'
'.$langs->trans('Prefix').''.$object->prefix_comm.'
'; print $langs->trans('CustomerCode').''; diff --git a/htdocs/societe/note.php b/htdocs/societe/note.php index 29419145ba6..3b56f05223b 100644 --- a/htdocs/societe/note.php +++ b/htdocs/societe/note.php @@ -124,10 +124,6 @@ if ($object->id > 0) { print $object->getTypeUrl(1); print '
'.$langs->trans('Prefix').''.$object->prefix_comm.'
'; print $langs->trans('CustomerCode').''; diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index 7899a1c5f4d..a4158bc5d99 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -187,11 +187,6 @@ if ($result > 0) { print $object->getTypeUrl(1); print '
'.$langs->trans('Prefix').''.$object->prefix_comm.'
'; print $langs->trans('CustomerCode').''; diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index c229af69105..cc3c1c458f0 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -974,10 +974,6 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print $object->getTypeUrl(1); print '
'.$langs->trans('Prefix').''.$object->prefix_comm.'
'; print $langs->trans('CustomerCode').''; diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index ee118c31231..9061140628d 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -281,10 +281,6 @@ print '
'.$langs->trans('NatureOfThirdParty').'
'.$langs->trans('Prefix').''.$object->prefix_comm.'
'; print $langs->trans('CustomerCode').''; diff --git a/htdocs/societe/project.php b/htdocs/societe/project.php index a792034d160..113883bb615 100644 --- a/htdocs/societe/project.php +++ b/htdocs/societe/project.php @@ -151,10 +151,6 @@ if ($socid) { print $object->getTypeUrl(1); print '
'.$langs->trans('Prefix').''.$object->prefix_comm.'
'; print $langs->trans('CustomerCode').''; diff --git a/htdocs/societe/societecontact.php b/htdocs/societe/societecontact.php index 6e364467f35..0106dbc5627 100644 --- a/htdocs/societe/societecontact.php +++ b/htdocs/societe/societecontact.php @@ -185,10 +185,6 @@ if ($id > 0 || !empty($ref)) { print yn($object->fournisseur); print '
'.$langs->trans('Prefix').''.$object->prefix_comm.'
'; print $langs->trans('CustomerCode').'';