Look and feel Debug v23

This commit is contained in:
Laurent Destailleur 2025-11-18 02:49:47 +01:00
parent e54cc9ab28
commit e96db77fda
28 changed files with 343 additions and 382 deletions

View file

@ -152,6 +152,53 @@ $linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/admin/modules.php', ['restore
print load_fiche_titre($langs->trans("BarcodeSetup"), $linkback, 'title_setup');
print '<br>';
/*
* Usage
*/
print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
print '<input type="hidden" name="token" value="'.newToken().'">';
print "<input type=\"hidden\" name=\"action\" value=\"update\">";
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Feature").'</td>';
print '<td width="60" class="center"></td>';
print '<td>&nbsp;</td>';
print '</tr>';
// Module products
if (isModEnabled('product')) {
print '<tr class="oddeven">';
print '<td>'.img_picto('', 'product', 'class="pictofixedwidth"').$langs->trans("UseBarCodeForProducts").'</td>';
print '<td width="60" class="right">';
print ajax_constantonoff('BARCODE_USE_ON_PRODUCT', array(), null, 0, 0, 1);
print '</td>';
print '<td>&nbsp;</td>';
print '</tr>';
}
// Module thirdparty
if (isModEnabled('societe')) {
print '<tr class="oddeven">';
print '<td>'.img_picto('', 'company', 'class="pictofixedwidth"').$langs->trans("UseBarCodeForThirdParties").'</td>';
print '<td width="60" class="right">';
print ajax_constantonoff('BARCODE_USE_ON_THIRDPARTY', array(), null, 0, 0, 1);
print '</td>';
print '<td>&nbsp;</td>';
print '</tr>';
}
print "</table>\n";
print '</div>';
print '<br>';
// 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 '<div class="div-table-responsive-no-min">';
@ -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 '<div class="div-table-responsive-no-min">';
@ -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 '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" id="form_engine">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="updateengine">';
}
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Description").'</td>';
print '<td width="200" class="center">'.$langs->trans("Example").'</td>';
print '<td class="center" width="60">'.$langs->trans("CodeBarGenerator").'</td>';
print "</tr>\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 '<tr class="oddeven">';
print '<td width="100">';
print dol_escape_htmltag($obj->label);
print "</td><td>\n";
print $langs->trans('BarcodeDesc'.$obj->encoding);
//print "L'EAN se compose de 8 characters, 7 chiffres plus une cle de verification.<br>";
//print "L'utilisation des symbologies EAN8 impose la souscription et l'abonnement aupres d'organismes comme GENCOD.<br>";
//print "Codes numeriques utilises exclusivement a l'identification des produits susceptibles d'etre vendus au grand public.";
print '</td>';
// Show example
print '<td class="center">';
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&amp;generator='.urlencode($obj->coder).'&amp;code='.urlencode($obj->example).'&amp;encoding='.urlencode($obj->encoding);
//print $url;
print '<img src="'.$url.'" title="'.$obj->example.'" border="0">';
} else {
print $langs->trans("FormatNotSupportedByGenerator");
}
} else {
print 'ErrorClassNotFoundInModule '.$classname.' '.$obj->coder;
}
}
} else {
print '<span class="opacitymedium">'.$langs->trans("ChooseABarCode").'</span>';
}
print '</td>';
print '<td class="center">';
print $formbarcode->setBarcodeEncoder($obj->coder, $barcodelist, $obj->rowid, 'form'.$i);
print "</td></tr>\n";
$i++;
if (empty($conf->use_javascript_ajax)) {
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" id="form_engine">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="updateengine">';
}
}
print "</table>\n";
print '</div>';
if (empty($conf->use_javascript_ajax)) {
print $form->buttonsSaveCancel("Save", '');
}
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Description").'</td>';
print '<td width="200" class="center">'.$langs->trans("Example").'</td>';
print '<td class="center" width="60">'.$langs->trans("CodeBarGenerator").'</td>';
print "</tr>\n";
print "<br>";
$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 '<tr class="oddeven">';
print '<td width="100">';
print dol_escape_htmltag($obj->label);
print "</td><td>\n";
print $langs->trans('BarcodeDesc'.$obj->encoding);
//print "L'EAN se compose de 8 characters, 7 chiffres plus une cle de verification.<br>";
//print "L'utilisation des symbologies EAN8 impose la souscription et l'abonnement aupres d'organismes comme GENCOD.<br>";
//print "Codes numeriques utilises exclusivement a l'identification des produits susceptibles d'etre vendus au grand public.";
print '</td>';
// Show example
print '<td class="center">';
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&amp;generator='.urlencode($obj->coder).'&amp;code='.urlencode($obj->example).'&amp;encoding='.urlencode($obj->encoding);
//print $url;
print '<img src="'.$url.'" title="'.$obj->example.'" border="0">';
} else {
print $langs->trans("FormatNotSupportedByGenerator");
}
} else {
print 'ErrorClassNotFoundInModule '.$classname.' '.$obj->coder;
}
}
} else {
print '<span class="opacitymedium">'.$langs->trans("ChooseABarCode").'</span>';
}
print '</td>';
print '<td class="center">';
print $formbarcode->setBarcodeEncoder($obj->coder, $barcodelist, $obj->rowid, 'form'.$i);
print "</td></tr>\n";
$i++;
}
}
print "</table>\n";
print '</div>';
if (empty($conf->use_javascript_ajax)) {
print $form->buttonsSaveCancel("Save", '');
}
print "<br>";
}
/*
* 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 "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
print '<input type="hidden" name="token" value="'.newToken().'">';
print "<input type=\"hidden\" name=\"action\" value=\"update\">";
print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
print '<input type="hidden" name="token" value="'.newToken().'">';
print "<input type=\"hidden\" name=\"action\" value=\"update\">";
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td width="60" class="center"></td>';
print '<td>&nbsp;</td>';
print '</tr>';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td width="60" class="center"></td>';
print '<td>&nbsp;</td>';
print '</tr>';
// Chemin du binaire genbarcode sous linux
if (!isset($_SERVER['WINDIR'])) {
print '<tr class="oddeven">';
print '<td>'.$langs->trans("GenbarcodeLocation").'</td>';
print '<td width="60" class="center">';
print '<input type="text" size="40" name="GENBARCODE_LOCATION" value="'.getDolGlobalString('GENBARCODE_LOCATION').'">';
if (getDolGlobalString('GENBARCODE_LOCATION') && !@file_exists($conf->global->GENBARCODE_LOCATION)) {
$langs->load("errors");
print '<br><span class="error">'.$langs->trans("ErrorFileNotFound", getDolGlobalString('GENBARCODE_LOCATION')).'</span>';
// Chemin du binaire genbarcode sous linux
if (!isset($_SERVER['WINDIR'])) {
print '<tr class="oddeven">';
print '<td>'.$langs->trans("GenbarcodeLocation").'</td>';
print '<td width="60" class="center">';
print '<input type="text" size="40" name="GENBARCODE_LOCATION" value="'.getDolGlobalString('GENBARCODE_LOCATION').'">';
if (getDolGlobalString('GENBARCODE_LOCATION') && !@file_exists($conf->global->GENBARCODE_LOCATION)) {
$langs->load("errors");
print '<br><span class="error">'.$langs->trans("ErrorFileNotFound", getDolGlobalString('GENBARCODE_LOCATION')).'</span>';
}
print '</td>';
print '<td>&nbsp;</td>';
print '</tr>';
}
print '</td>';
print '<td>&nbsp;</td>';
print '</tr>';
// Module products
if (getDolGlobalString('BARCODE_USE_ON_PRODUCT') && isModEnabled('product')) {
print '<tr class="oddeven">';
print '<td>'.img_picto('', 'product', 'class="pictofixedwidth"').$langs->trans("SetDefaultBarcodeTypeProducts").'</td>';
print '<td width="60" class="right">';
print $formbarcode->selectBarcodeType(getDolGlobalInt('PRODUIT_DEFAULT_BARCODE_TYPE'), "PRODUIT_DEFAULT_BARCODE_TYPE", 1);
print '</td>';
print '<td>&nbsp;</td>';
print '</tr>';
}
// Module thirdparty
if (getDolGlobalString('BARCODE_USE_ON_THIRDPARTY') && isModEnabled('societe')) {
print '<tr class="oddeven">';
print '<td>'.img_picto('', 'company', 'class="pictofixedwidth"').$langs->trans("SetDefaultBarcodeTypeThirdParties").'</td>';
print '<td width="60" class="right">';
print $formbarcode->selectBarcodeType(getDolGlobalInt('GENBARCODE_BARCODETYPE_THIRDPARTY'), "GENBARCODE_BARCODETYPE_THIRDPARTY", 1);
print '</td>';
print '<td>&nbsp;</td>';
print '</tr>';
}
print "</table>\n";
print '</div>';
print '<div class="tabsAction">';
print '<input type="submit" class="button" name="submit_GENBARCODE_BARCODETYPE_THIRDPARTY" value="'.$langs->trans("Modify").'">';
print "</div>";
print '</form>';
print '<br>';
}
// Module products
if (isModEnabled('product')) {
print '<tr class="oddeven">';
print '<td>'.img_picto('', 'product', 'class="pictofixedwidth"').$langs->trans("SetDefaultBarcodeTypeProducts").'</td>';
print '<td width="60" class="right">';
print $formbarcode->selectBarcodeType(getDolGlobalInt('PRODUIT_DEFAULT_BARCODE_TYPE'), "PRODUIT_DEFAULT_BARCODE_TYPE", 1);
print '</td>';
print '<td>&nbsp;</td>';
print '</tr>';
}
// Module thirdparty
if (isModEnabled('societe')) {
print '<tr class="oddeven">';
print '<td>'.img_picto('', 'company', 'class="pictofixedwidth"').$langs->trans("SetDefaultBarcodeTypeThirdParties").'</td>';
print '<td width="60" class="right">';
print $formbarcode->selectBarcodeType(getDolGlobalInt('GENBARCODE_BARCODETYPE_THIRDPARTY'), "GENBARCODE_BARCODETYPE_THIRDPARTY", 1);
print '</td>';
print '<td>&nbsp;</td>';
print '</tr>';
}
print "</table>\n";
print '</div>';
print '<div class="tabsAction">';
print '<input type="submit" class="button" name="submit_GENBARCODE_BARCODETYPE_THIRDPARTY" value="'.$langs->trans("Modify").'">';
print "</div>";
print '</form>';
print '<br>';
// End of page
llxFooter();

View file

@ -379,13 +379,6 @@ if ($object->id > 0) {
print $object->getTypeUrl(1);
print '</td></tr>';
// Prefix
if (getDolGlobalString('SOCIETE_USEPREFIX')) { // Old not used prefix field
print '<tr><td>'.$langs->trans("Prefix").'</td><td>';
print($object->prefix_comm ? $object->prefix_comm : '&nbsp;');
print '</td></tr>';
}
if ($object->client) {
$langs->loadLangs(array("compta", "accountancy"));

View file

@ -78,13 +78,6 @@ if ($socid > 0) {
// Name
print '<tr><td width="20%">'.$langs->trans("ThirdParty").'</td><td width="80%" colspan="3">'.$societe->getNomUrl(1).'</td></tr>';
// Prefix
if (getDolGlobalString('SOCIETE_USEPREFIX')) { // Old not used prefix field
print '<tr><td>'.$langs->trans("Prefix").'</td><td colspan="3">';
print($societe->prefix_comm ? $societe->prefix_comm : '&nbsp;');
print '</td></tr>';
}
print "</table>";
print "</td></tr></table>\n";

View file

@ -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 .= '<tr '.($html_id ? 'id="'.$html_id.'" ' : '').$csstyle.' class="field_options_'.$key.' '.$class.$this->element.'_extras_'.$key.' trextrafields_collapse'.$collapse_group.'" '.$domData.' >';
$out .= '<tr '.($html_id ? 'id="'.$html_id.'" ' : '').$csstyle.' class="field_options_'.$key.' '.$class.$this->element.'_extras_'.$key.' trextrafields trextrafields_collapse'.$collapse_group.'" '.$domData.' >';
if (getDolGlobalString('MAIN_VIEW_LINE_NUMBER') && ($action == 'view' || $action == 'valid' || $action == 'editline' || $action == 'confirm_valid' || $action == 'confirm_cancel')) {
$out .= '<td></td>';
}

View file

@ -57,10 +57,8 @@ trait CommonSocialNetworks
if ($nbofnetworks > 1) {
print '<tr><td colspan="'.$colspan.'"><br><a class="paddingtop paddingbottom socialnetworklnk onreposition" id="socialnetworklnk" href="#"></a>';
//print '</td>';
//print '<td'.($colspan ? ' colspan="'.($colspan-1).'"' : '').'>';
//print '<br>';
print ' <a class="paddingtop paddingbottom socialnetworklnk onreposition" href="#"><span class="badge badge-secondary socialnetworklnk">'.$nbactive.'</span></a>';
print ' <span class="soc_network">'.$form->textwithpicto("", $langs->transnoentitiesnoconv("YouCanChangeValuesForThisListFromModuleSetup", $langs->transnoentitiesnoconv("SocialNetworks"))).'</span>';
print '</td>';
print '</tr>';
}

View file

@ -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();

View file

@ -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';
}

View file

@ -251,11 +251,6 @@ if ($object->id > 0) {
print $object->getTypeUrl(1);
print '</td></tr>';
// Prefix
if (getDolGlobalString('SOCIETE_USEPREFIX')) { // Old not used prefix field
print '<tr><td>'.$langs->trans('Prefix').'</td><td>'.$object->prefix_comm.'</td></tr>';
}
if ($object->fournisseur) {
$langs->load('compta');

View file

@ -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);

View file

@ -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 <b>%s</b>
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

View file

@ -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

View file

@ -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 '<tr><td>'.$langs->trans('BarcodeType').'</td><td>';
@ -1624,9 +1624,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print '</tr>';
print '<tr>';
print '<td'.($modBarCodeProduct->code_null ? '' : ' class="fieldrequired"').'>'.$langs->trans("BarcodeValue").'</td><td>';
print '<td'.((is_object($modBarCodeProduct) && $modBarCodeProduct->code_null) ? '' : ' class="fieldrequired"').'>'.$langs->trans("BarcodeValue").'</td><td>';
$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 '<tr><td class="nowrap">';
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
print '<table class="centpercent nobordernopadding"><tr><td class="nowrap">';
print $langs->trans("BarcodeType");
print '</td>';
if (($action != 'editbarcodetype') && $usercancreate && $createbarcode) {
@ -2649,7 +2649,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
// Barcode value
print '<tr><td class="nowrap">';
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
print '<table class="centpercent nobordernopadding"><tr><td class="nowrap">';
print $langs->trans("BarcodeValue");
print '</td>';
if (($action != 'editbarcode') && $usercancreate && $createbarcode) {

View file

@ -71,10 +71,6 @@ if (empty($conf) || !is_object($conf)) {
<tr>
<td><span class="fieldrequired"><?php echo $langs->trans('ThirdPartyName'); ?></span></td>
<td><input type="text" size="30" maxlength="60" name="name" value="<?php echo $this->control->tpl['name']; ?>"></td>
<?php if (getDolGlobalString('SOCIETE_USEPREFIX')) { ?>
<td><?php echo $langs->trans('Prefix'); ?></td>
<td><input type="text" size="5" maxlength="5" name="prefix_comm" value="<?php echo $this->control->tpl['prefix_comm']; ?>"></td>
<?php } ?>
</tr>
<tr>

View file

@ -62,19 +62,6 @@ $contact = $GLOBALS['objcanvas']->control->object;
<td colspan="3"><input type="text" size="40" maxlength="60" name="name" value="<?php echo $this->control->tpl['name']; ?>"></td>
</tr>
<?php if (getDolGlobalString('SOCIETE_USEPREFIX')) { ?>
<tr>
<td><?php echo $langs->trans("Prefix"); ?></td>
<td colspan="3">
<?php if (($this->control->tpl['prefix_customercode'] || $this->control->tpl['prefix_suppliercode']) && $this->control->tpl['prefix_comm']) { ?>
<input type="hidden" name="prefix_comm" value="<?php echo $this->control->tpl['prefix_comm']; ?>">
<?php echo $this->control->tpl['prefix_comm']; ?>
<?php } else { ?>
<input type="text" size="5" maxlength="5" name="prefix_comm" value="<?php echo $this->control->tpl['prefix_comm']; ?>">
<?php } ?>
</td>
</tr>
<?php } ?>
<tr>
<td width="25%"><span class="fieldrequired"><?php echo $langs->trans('ProspectCustomer'); ?></span></td>

View file

@ -59,13 +59,6 @@ if ($this->control->tpl['js_checkVatPopup']) {
<td colspan="3"><?php echo $this->control->tpl['showrefnav']; ?></td>
</tr>
<?php if (getDolGlobalString('SOCIETE_USEPREFIX')) { ?>
<tr>
<td><?php echo $langs->trans('Prefix'); ?></td>
<td colspan="3"><?php echo $this->control->tpl['prefix_comm']; ?></td>
</tr>
<?php } ?>
<?php if ($this->control->tpl['client']) { ?>
<tr>
<td><?php echo $langs->trans('CustomerCode'); ?></td>

View file

@ -69,10 +69,6 @@ if (empty($conf) || !is_object($conf)) {
<tr>
<td><span class="fieldrequired"><?php echo $langs->trans('LastName'); ?></span></td>
<td><input type="text" size="30" maxlength="60" name="name" value="<?php echo $this->control->tpl['name']; ?>"></td>
<?php if (getDolGlobalString('SOCIETE_USEPREFIX')) { ?>
<td><?php echo $langs->trans('Prefix'); ?></td>
<td><input type="text" size="5" maxlength="5" name="prefix_comm" value="<?php echo $this->control->tpl['prefix_comm']; ?>"></td>
<?php } ?>
</tr>
<tr>

View file

@ -61,20 +61,6 @@ if (empty($conf) || !is_object($conf)) {
<td colspan="3"><input type="text" size="40" maxlength="60" name="name" value="<?php echo $this->control->tpl['name']; ?>"></td>
</tr>
<?php if (getDolGlobalString('SOCIETE_USEPREFIX')) { ?>
<tr>
<td><?php echo $langs->trans("Prefix"); ?></td>
<td colspan="3">
<?php if (($this->control->tpl['prefix_customercode'] || $this->control->tpl['prefix_suppliercode']) && $this->control->tpl['prefix_comm']) { ?>
<input type="hidden" name="prefix_comm" value="<?php echo $this->control->tpl['prefix_comm']; ?>">
<?php echo $this->control->tpl['prefix_comm']; ?>
<?php } else { ?>
<input type="text" size="5" maxlength="5" name="prefix_comm" value="<?php echo $this->control->tpl['prefix_comm']; ?>">
<?php } ?>
</td>
</tr>
<?php } ?>
<tr>
<td width="25%"><span class="fieldrequired"><?php echo $langs->trans('ProspectCustomer'); ?></span></td>
<td width="25%"><?php echo $this->control->tpl['select_customertype']; ?></td>

View file

@ -57,13 +57,6 @@ if ($this->control->tpl['action_delete']) {
<td colspan="3"><?php echo $this->control->tpl['showrefnav']; ?></td>
</tr>
<?php if (getDolGlobalString('SOCIETE_USEPREFIX')) { ?>
<tr>
<td><?php echo $langs->trans('Prefix'); ?></td>
<td colspan="3"><?php echo $this->control->tpl['prefix_comm']; ?></td>
</tr>
<?php } ?>
<?php if ($this->control->tpl['client']) { ?>
<tr>
<td><?php echo $langs->trans('CustomerCode'); ?></td>

View file

@ -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".'<script type="text/javascript">';
print '$(document).ready(function () {
@ -1275,12 +1276,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
var canHaveCustomerCategoryIfNotCustomerProspectSupplier = ' . (!getDolGlobalString('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '0' : '1') . ';
init_customer_categ();
$("#customerprospect").change(function() {
$("#prospectinput, #customerinput").change(function() {
init_customer_categ();
});
function init_customer_categ() {
console.log("is customer or prospect = "+jQuery("#customerprospect").val());
if (jQuery("#customerprospect").val() == 0 && !canHaveCustomerCategoryIfNotCustomerProspectSupplier) {
var iscustomerorprospect = jQuery("#prospectinput").is(":checked") + jQuery("#customerinput").is(":checked");
console.log("is customer or prospect = "+iscustomerorprospect);
if (iscustomerorprospect == 0 && !canHaveCustomerCategoryIfNotCustomerProspectSupplier) {
jQuery(".visibleifcustomer").hide();
} else {
jQuery(".visibleifcustomer").show();
@ -1288,12 +1290,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
}
init_supplier_categ();
$("#fournisseur").change(function() {
$("#supplierinput").change(function() {
init_supplier_categ();
});
function init_supplier_categ() {
console.log("is supplier = "+jQuery("#fournisseur").val());
if (jQuery("#fournisseur").val() == 0) {
var issupplier = jQuery("#supplierinput").is(":checked");
console.log("is supplier = "+issupplier);
if (issupplier == 0) {
jQuery(".visibleifsupplier").hide();
} else {
jQuery(".visibleifsupplier").show();
@ -1341,7 +1344,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
} else {
print '<span id="TypeName" class="fieldrequired">'.$form->editfieldkey('ThirdPartyName', 'name', '', $object, 0).'</span>';
}
print '</td><td'.(getDolGlobalString('SOCIETE_USEPREFIX') ? '' : ' colspan="3"').'>';
print '</td><td colspan="3">';
print '<input type="text" class="minwidth300" maxlength="128" name="name" id="name" value="'.dol_escape_htmltag($object->name).'" autofocus="autofocus" spellcheck="false">';
print $form->widgetForTranslation("name", $object, $permissiontoadd, 'string', 'alphanohtml', 'minwidth300'); // For some countries that need the company name in 2 languages
@ -1438,9 +1441,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
';
*/
print '</td>';
if (getDolGlobalString('SOCIETE_USEPREFIX')) { // Old not used prefix field
print '<td>'.$langs->trans('Prefix').'</td><td><input type="text" size="5" maxlength="5" name="prefix_comm" value="'.dol_escape_htmltag($object->prefix_comm).'" spellcheck="false"></td>';
}
print '</tr>';
// If javascript on, we show option individual
@ -1460,7 +1460,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
// Alias names (commercial, trademark or alias names)
print '<tr id="name_alias"><td>';
//print '<label for="name_alias_input">'.$langs->trans('AliasNames').'</label>';
print '<input type="hidden" name="status" value="1">';
print '</td>';
print '<td colspan="3"><input type="text" class="minwidth300" name="name_alias" id="name_alias_input" value="'.dol_escape_htmltag($object->name_alias).'" spellcheck="false" placeholder="'.dolPrintHTMLForAttribute($langs->trans('AliasNames')).'"></td></tr>';
@ -1590,12 +1590,14 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print '</tr>';
// Status
/* Useless at creation
print '<tr><td>'.$form->editfieldkey('Status', 'status', '', $object, 0).'</td><td colspan="3">';
print $form->selectarray('status', array('1' => $langs->trans('InActivity'), '0' => $langs->trans('ActivityCeased')), 1, 0, 0, 0, '', 0, 0, 0, '', 'minwidth100', 1);
print '</td></tr>';
*/
// Barcode
if (isModEnabled('barcode')) {
if (isModEnabled('barcode') && getDolGlobalString('BARCODE_USE_ON_THIRDPARTY')) {
print '<tr><td>'.$form->editfieldkey('Gencod', 'barcode', '', $object, 0).'</td>';
print '<td colspan="3">';
print img_picto('', 'barcode', 'class="pictofixedwidth"');
@ -1837,6 +1839,29 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print '<tr><td colspan="'.$colspan.'"><hr></td></tr>';
// Categories
if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) {
$langs->load('categories');
// Customer
print '<tr class="visibleifcustomer"><td class="toptd">'.$form->editfieldkey('CustomersProspectsCategoriesShort', 'custcats', '', $object, 0).'</td><td colspan="3">';
print $form->selectCategories(Categorie::TYPE_CUSTOMER, 'custcats', $object);
print "</td></tr>";
if (getDolGlobalString('THIRDPARTY_SUGGEST_ALSO_ADDRESS_CREATION')) {
print '<tr class="individualline"><td class="toptd">'.$form->editfieldkey('ContactCategoriesShort', 'contcats', '', $object, 0).'</td><td colspan="3">';
print $form->selectCategories(Categorie::TYPE_CONTACT, 'contcats', $object);
print "</td></tr>";
}
// Supplier
if (isModEnabled("supplier_proposal") || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) {
print '<tr class="visibleifsupplier"><td class="toptd">'.$form->editfieldkey('SuppliersCategoriesShort', 'suppcats', '', $object, 0).'</td><td colspan="3">';
print $form->selectCategories(Categorie::TYPE_SUPPLIER, 'suppcats', $object);
print "</td></tr>";
}
}
// Type - Workforce/Staff
print '<tr><td>'.$form->editfieldkey('ThirdPartyType', 'typent_id', '', $object, 0).'</td><td class="maxwidthonsmartphone"'.(($conf->browser->layout == 'phone' || getDolGlobalString('SOCIETE_DISABLE_WORKFORCE')) ? ' colspan="3"' : '').'>'."\n";
@ -1920,29 +1945,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print '</td></tr>';
}
// Categories
if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) {
$langs->load('categories');
// Customer
print '<tr class="visibleifcustomer"><td class="toptd">'.$form->editfieldkey('CustomersProspectsCategoriesShort', 'custcats', '', $object, 0).'</td><td colspan="3">';
print $form->selectCategories(Categorie::TYPE_CUSTOMER, 'custcats', $object);
print "</td></tr>";
if (getDolGlobalString('THIRDPARTY_SUGGEST_ALSO_ADDRESS_CREATION')) {
print '<tr class="individualline"><td class="toptd">'.$form->editfieldkey('ContactCategoriesShort', 'contcats', '', $object, 0).'</td><td colspan="3">';
print $form->selectCategories(Categorie::TYPE_CONTACT, 'contcats', $object);
print "</td></tr>";
}
// Supplier
if (isModEnabled("supplier_proposal") || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) {
print '<tr class="visibleifsupplier"><td class="toptd">'.$form->editfieldkey('SuppliersCategoriesShort', 'suppcats', '', $object, 0).'</td><td colspan="3">';
print $form->selectCategories(Categorie::TYPE_SUPPLIER, 'suppcats', $object);
print "</td></tr>";
}
}
// Multicurrency
if (isModEnabled("multicurrency")) {
print '<tr>';
@ -2227,33 +2229,29 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
var canHaveCustomerCategoryIfNotCustomerProspect = ' . (getDolGlobalInt('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '1' : '0') . ';
init_customer_categ();
$("#customerprospect").change(function() {
$("#prospectinput, #customerinput").change(function() {
init_customer_categ();
});
function init_customer_categ() {
console.log("is customer or prospect = "+jQuery("#customerprospect").val());
if (jQuery("#customerprospect").val() == 0 && !canHaveCustomerCategoryIfNotCustomerProspect)
{
var iscustomerorprospect = jQuery("#prospectinput").is(":checked") + jQuery("#customerinput").is(":checked");
console.log("is customer or prospect = "+iscustomerorprospect);
if (iscustomerorprospect == 0 && !canHaveCustomerCategoryIfNotCustomerProspect) {
jQuery(".visibleifcustomer").hide();
}
else
{
} else {
jQuery(".visibleifcustomer").show();
}
}
init_supplier_categ();
$("#fournisseur").change(function() {
$("#supplierinput").change(function() {
init_supplier_categ();
});
function init_supplier_categ() {
console.log("is supplier = "+jQuery("#fournisseur").val());
if (jQuery("#fournisseur").val() == 0)
{
var issupplier = jQuery("#supplierinput").is(":checked");
console.log("is supplier = "+issupplier);
if (issupplier == 0) {
jQuery(".visibleifsupplier").hide();
}
else
{
} else {
jQuery(".visibleifsupplier").show();
}
}
@ -2308,19 +2306,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print '</td>';
print '<td colspan="3"><input type="text" class="minwidth300" name="name_alias" id="name_alias_input" value="'.dol_escape_htmltag($object->name_alias).'" placeholder="'.dolPrintHTMLForAttribute($langs->trans('AliasNames')).'" spellcheck="false"></td></tr>';
// Prefix
if (getDolGlobalString('SOCIETE_USEPREFIX')) { // Old not used prefix field
print '<tr><td>'.$form->editfieldkey('Prefix', 'prefix', '', $object, 0).'</td><td colspan="3">';
// It does not change the prefix mode using the auto numbering prefix
if (($prefixCustomerIsUsed || $prefixSupplierIsUsed) && $object->prefix_comm) {
print '<input type="hidden" name="prefix_comm" value="'.dol_escape_htmltag($object->prefix_comm).'">';
print $object->prefix_comm;
} else {
print '<input type="text" size="5" maxlength="5" name="prefix_comm" id="prefix" value="'.dol_escape_htmltag($object->prefix_comm).'" spellcheck="false">';
}
print '</td>';
}
// Prospect/Customer/Supplier
$selected = $object->client;
$selectedcustomer = 0;
@ -2369,7 +2354,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
function refreshNatureCss() {
jQuery(".spannature").each(function( index ) {
id = $(this).attr("id").split("spannature")[1];
console.log(jQuery("#spannature"+(id)+" .checkforselect").is(":checked"));
console.log("id="+id+" "+jQuery("#spannature"+(id)+" .checkforselect").is(":checked"));
if (jQuery("#spannature"+(id)+" .checkforselect").is(":checked")) {
if (id == 1) {
jQuery("#spannature"+(id)).addClass("prospect-back").removeClass("nonature-back");
@ -2448,7 +2433,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
// Barcode
if (isModEnabled('barcode')) {
if (isModEnabled('barcode') && getDolGlobalString('BARCODE_USE_ON_THIRDPARTY')) {
print '<tr><td class="tdtop">'.$form->editfieldkey('Gencod', 'barcode', '', $object, 0).'</td>';
print '<td colspan="3">';
print img_picto('', 'barcode', 'class="pictofixedwidth"');
@ -2700,8 +2685,35 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print '<tr><td colspan="'.$colspan.'"><hr></td></tr>';
// Categories
if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) {
// Customer
print '<tr class="visibleifcustomer"><td>'.$form->editfieldkey('CustomersCategoriesShort', 'custcats', '', $object, 0).'</td>';
print '<td colspan="3">';
print $form->selectCategories(Categorie::TYPE_CUSTOMER, 'custcats', $object);
print "</td></tr>";
// Supplier
if ((isModEnabled("fournisseur") && $user->hasRight('fournisseur', 'lire') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire')) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire'))) {
print '<tr class="visibleifsupplier"><td>'.$form->editfieldkey('SuppliersCategoriesShort', 'suppcats', '', $object, 0).'</td>';
print '<td colspan="3">';
print $form->selectCategories(Categorie::TYPE_SUPPLIER, 'suppcats', $object);
print "</td></tr>";
}
}
print '<tr><td colspan="'.$colspan.'"><br><a class="paddingtop paddingbottom morefieldslnk onreposition" id="morefieldslnk" href="#">'.$langs->trans("More").'';
//print '</a>';
$nbactive = '...';
//print ' <a class="paddingtop paddingbottom socialnetworklnk onreposition" href="#">';
print '<span class="badge badge-secondary socialnetworklnk marginleftonly">'.$nbactive.'</span></a>';
print '</td>';
print '</tr>';
//print '<tr><td colspan="'.$colspan.'"></td></tr>';
// Type - Workforce/Staff
print '<tr><td>'.$form->editfieldkey('ThirdPartyType', 'typent_id', '', $object, 0).'</td><td class="maxwidthonsmartphone"'.(($conf->browser->layout == 'phone' || getDolGlobalString('SOCIETE_DISABLE_WORKFORCE')) ? ' colspan="3"' : '').'>';
print '<tr class="morefields"><td>'.$form->editfieldkey('ThirdPartyType', 'typent_id', '', $object, 0).'</td><td class="maxwidthonsmartphone"'.(($conf->browser->layout == 'phone' || getDolGlobalString('SOCIETE_DISABLE_WORKFORCE')) ? ' colspan="3"' : '').'>';
print $form->selectarray("typent_id", $formcompany->typent_array(0), $object->typent_id, 1, 0, 0, '', 0, 0, 0, (!getDolGlobalString('SOCIETE_SORT_ON_TYPEENT') ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT), '', 1);
if ($user->admin) {
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
@ -2722,19 +2734,19 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print '</td></tr>';
// Juridical type
print '<tr><td>'.$form->editfieldkey('JuridicalStatus', 'forme_juridique_code', '', $object, 0).'</td>';
print '<tr class="morefields"><td>'.$form->editfieldkey('JuridicalStatus', 'forme_juridique_code', '', $object, 0).'</td>';
print '<td class="maxwidthonsmartphone" colspan="3">';
print $formcompany->select_juridicalstatus($object->forme_juridique_code, $object->country_code, '', 'forme_juridique_code');
print '</td></tr>';
// Date birth
print '<tr><td>'.$form->editfieldkey('CompnanyBirthDate', 'birth', '', $object, 0).'</td>';
print '<tr class="morefields"><td>'.$form->editfieldkey('CompnanyBirthDate', 'birth', '', $object, 0).'</td>';
print '<td class="maxwidthonsmartphone" colspan="3">';
print $form->selectDate($object->birth, 'birth', 0, 0, 1, "", 1);
print '</td></tr>';
// Capital
print '<tr><td>'.$form->editfieldkey('Capital', 'capital', '', $object, 0).'</td>';
print '<tr class="morefields"><td>'.$form->editfieldkey('Capital', 'capital', '', $object, 0).'</td>';
print '<td colspan="3"><input type="text" name="capital" id="capital" class="width75" value="';
print ($object->capital !== null ? dolPrintHTMLForAttribute(price($object->capital)) : '');
if (isModEnabled("multicurrency")) {
@ -2745,7 +2757,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
// Default language
if (getDolGlobalInt('MAIN_MULTILANGS')) {
print '<tr><td>'.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).'</td><td colspan="3">'."\n";
print '<tr class="morefields"><td>'.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).'</td><td colspan="3">'."\n";
print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language($object->default_lang, 'default_lang', 0, array(), '1', 0, 0, 'maxwidth300 widthcentpercentminusx');
print '</td>';
print '</tr>';
@ -2753,33 +2765,16 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
// Incoterms
if (isModEnabled('incoterm')) {
print '<tr>';
print '<tr class="morefields">';
print '<td>'.$form->editfieldkey('IncotermLabel', 'incoterm_id', '', $object, 0).'</td>';
print '<td colspan="3" class="maxwidthonsmartphone">';
print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''));
print '</td></tr>';
}
// Categories
if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) {
// Customer
print '<tr class="visibleifcustomer"><td>'.$form->editfieldkey('CustomersCategoriesShort', 'custcats', '', $object, 0).'</td>';
print '<td colspan="3">';
print $form->selectCategories(Categorie::TYPE_CUSTOMER, 'custcats', $object);
print "</td></tr>";
// Supplier
if ((isModEnabled("fournisseur") && $user->hasRight('fournisseur', 'lire') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire')) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire'))) {
print '<tr class="visibleifsupplier"><td>'.$form->editfieldkey('SuppliersCategoriesShort', 'suppcats', '', $object, 0).'</td>';
print '<td colspan="3">';
print $form->selectCategories(Categorie::TYPE_SUPPLIER, 'suppcats', $object);
print "</td></tr>";
}
}
// Multicurrency
if (isModEnabled("multicurrency")) {
print '<tr>';
print '<tr class="morefields">';
print '<td>'.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).'</td>';
print '<td colspan="3" class="maxwidthonsmartphone">';
print img_picto('', 'currency', 'class="pictofixedwidth"');
@ -2793,7 +2788,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
// Parent company
if (!getDolGlobalString('SOCIETE_DISABLE_PARENTCOMPANY')) {
print '<tr>';
print '<tr class="morefields">';
print '<td>'.$langs->trans('ParentCompany').'</td>';
print '<td colspan="3" class="maxwidthonsmartphone">';
print img_picto('', 'company', 'class="pictofixedwidth"');
@ -2802,7 +2797,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
}
// Logo
print '<tr class="hideonsmartphone">';
print '<tr class="hideonsmartphone morefields">';
print '<td>'.$form->editfieldkey('Logo', 'photoinput', '', $object, 0).'</td>';
print '<td colspan="3">';
if ($object->logo) {
@ -2832,7 +2827,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print '</tr>';
// Assign sale representative
print '<tr>';
print '<tr class="morefields">';
print '<td>'.$form->editfieldkey('AllocateCommercial', 'commercial_id', '', $object, 0).'</td>';
print '<td colspan="3" class="maxwidthonsmartphone">';
$userlist = $form->select_dolusers('', '', 0, null, 0, '', '', '0', 0, 0, 'u.statut:=:1', 0, '', '', 0, 1);
@ -2845,6 +2840,33 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print '</table>';
print '<script nonce="'.getNonce().'" type="text/javascript">
$("document").ready(function() { toogleMoreFields(false); });
jQuery(".morefieldslnk").click(function() {
console.log("Click on link");
toogleMoreFields(true);
return false;
});
function toogleMoreFields(chgCookieState) {
const lnk = $("#morefieldslnk");
const items = $(".morefields, .trextrafields");
var cookieState = document.cookie.split(";").some((item) => item.trim().startsWith("DOLUSER_MOREFIELDS_SHOW=true")) == true;
if (!chgCookieState) cookieState = !cookieState ;
if (cookieState) {
items.hide();
if (chgCookieState) { document.cookie = "DOLUSER_MOREFIELDS_SHOW=false; SameSite=Strict"};
} else {
items.show();
if (chgCookieState) { document.cookie = "DOLUSER_MOREFIELDS_SHOW=true; SameSite=Strict";}
}
}
</script>
';
if (getDolGlobalString('ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY')) {
print '<br>';
print '<table class="border centpercent">';
@ -2966,12 +2988,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print $object->getTypeUrl(1);
print '</td></tr>';
// Prefix
if (getDolGlobalString('SOCIETE_USEPREFIX')) { // Old not used prefix field
print '<tr><td>'.$langs->trans('Prefix').'</td><td>'.dol_escape_htmltag($object->prefix_comm).'</td>';
print '</tr>';
}
// Customer code
if ($object->client) {
print '<tr><td>';
@ -3001,7 +3017,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
}
// Barcode
if (isModEnabled('barcode')) {
if (isModEnabled('barcode') && getDolGlobalString('BARCODE_USE_ON_THIRDPARTY')) {
print '<tr><td>';
print $langs->trans('Gencod').'</td><td>'.showValueWithClipboardCPButton(dol_escape_htmltag($object->barcode));
print '</td>';

View file

@ -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),

View file

@ -151,10 +151,6 @@ print '<tr><td class="titlefield">'.$langs->trans('NatureOfThirdParty').'</td><t
print $object->getTypeUrl(1);
print '</td></tr>';
if (getDolGlobalString('SOCIETE_USEPREFIX')) { // Old not used prefix field
print '<tr><td class="titlefield">'.$langs->trans('Prefix').'</td><td colspan="3">'.$object->prefix_comm.'</td></tr>';
}
//if (isModEnabled('agenda') && $user->hasRight('agenda', 'myactions', 'read')) $elementTypeArray['action']=$langs->transnoentitiesnoconv('Events');
$elementTypeArray = array();

View file

@ -154,11 +154,6 @@ print '<tr><td class="titlefield">'.$langs->trans('NatureOfThirdParty').'</td><t
print $object->getTypeUrl(1);
print '</td></tr>';
// Prefix
if (getDolGlobalString('SOCIETE_USEPREFIX')) { // Old not used prefix field
print '<tr><td class="titlefield">'.$langs->trans('Prefix').'</td><td colspan="3">'.$object->prefix_comm.'</td></tr>';
}
if ($object->client) {
print '<tr><td class="titlefield">';
print $langs->trans('CustomerCode').'</td><td colspan="3">';

View file

@ -124,10 +124,6 @@ if ($object->id > 0) {
print $object->getTypeUrl(1);
print '</td></tr>';
if (getDolGlobalString('SOCIETE_USEPREFIX')) { // Old not used prefix field
print '<tr><td class="'.$cssclass.'">'.$langs->trans('Prefix').'</td><td colspan="3">'.$object->prefix_comm.'</td></tr>';
}
if ($object->client) {
print '<tr><td class="'.$cssclass.'">';
print $langs->trans('CustomerCode').'</td><td colspan="3">';

View file

@ -187,11 +187,6 @@ if ($result > 0) {
print $object->getTypeUrl(1);
print '</td></tr>';
// Prefix
if (getDolGlobalString('SOCIETE_USEPREFIX')) { // Old not used prefix field
print '<tr><td class="titlefield">'.$langs->trans('Prefix').'</td><td colspan="3">'.$object->prefix_comm.'</td></tr>';
}
if ($object->client) {
print '<tr><td class="titlefield">';
print $langs->trans('CustomerCode').'</td><td colspan="3">';

View file

@ -974,10 +974,6 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
print $object->getTypeUrl(1);
print '</td></tr>';
if (getDolGlobalString('SOCIETE_USEPREFIX')) { // Old not used prefix field
print '<tr><td class="titlefield">'.$langs->trans('Prefix').'</td><td colspan="2">'.$object->prefix_comm.'</td></tr>';
}
if ($object->client) {
print '<tr><td class="titlefield">';
print $langs->trans('CustomerCode').'</td><td colspan="2">';

View file

@ -281,10 +281,6 @@ print '<tr><td class="titlefield">'.$langs->trans('NatureOfThirdParty').'</td><t
print $object->getTypeUrl(1);
print '</td></tr>';
if (getDolGlobalString('SOCIETE_USEPREFIX')) { // Old not used prefix field
print '<tr><td class="titlefield">'.$langs->trans('Prefix').'</td><td colspan="3">'.$object->prefix_comm.'</td></tr>';
}
if ($object->client) {
print '<tr><td class="titlefield">';
print $langs->trans('CustomerCode').'</td><td colspan="3">';

View file

@ -151,10 +151,6 @@ if ($socid) {
print $object->getTypeUrl(1);
print '</td></tr>';
if (getDolGlobalString('SOCIETE_USEPREFIX')) { // Old not used prefix field
print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$object->prefix_comm.'</td></tr>';
}
if ($object->client) {
print '<tr><td class="titlefield">';
print $langs->trans('CustomerCode').'</td><td colspan="3">';

View file

@ -185,10 +185,6 @@ if ($id > 0 || !empty($ref)) {
print yn($object->fournisseur);
print '</td></tr>';*/
if (getDolGlobalString('SOCIETE_USEPREFIX')) { // Old not used prefix field
print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$object->prefix_comm.'</td></tr>';
}
if ($object->client) {
print '<tr><td class="titlefield">';
print $langs->trans('CustomerCode').'</td><td colspan="3">';