--- /tmp/dsg/dolibarr/htdocs/societe/admin/github_19.0.3_contact_extrafields.php +++ /tmp/dsg/dolibarr/htdocs/societe/admin/client_contact_extrafields.php @@ -27 +26,0 @@ -// Load Dolibarr environment @@ -40,3 +39 @@ -foreach ($tmptype2label as $key => $val) { - $type2label[$key] = $langs->transnoentitiesnoconv($val); -} +foreach ($tmptype2label as $key => $val) $type2label[$key] = $langs->transnoentitiesnoconv($val); @@ -44 +41 @@ -$action = GETPOST('action', 'aZ09'); +$action = GETPOST('action', 'alpha'); @@ -48,3 +45 @@ -if (!$user->admin) { - accessforbidden(); -} +if (!$user->admin) accessforbidden(); @@ -77 +72 @@ -print dol_get_fiche_head($head, 'attributes_contacts', $langs->trans("ThirdParties"), -1, 'company'); +dol_fiche_head($head, 'attributes_contacts', $langs->trans("ThirdParties"), -1, 'company'); @@ -81 +76 @@ -print dol_get_fiche_end(); +dol_fiche_end(); @@ -84,2 +79,17 @@ -// Creation of an optional field -if ($action == 'create') { +// Buttons +if ($action != 'create' && $action != 'edit') +{ + print '
'; + print "".$langs->trans("NewAttribute").""; + print "
"; +} + + +/* ************************************************************************** */ +/* */ +/* Creation of an optional field */ +/* */ +/* ************************************************************************** */ + +if ($action == 'create') +{ @@ -92,2 +102,7 @@ -// Edition of an optional field -if ($action == 'edit' && !empty($attrname)) { +/* ************************************************************************** */ +/* */ +/* Edition of an optional field */ +/* */ +/* ************************************************************************** */ +if ($action == 'edit' && !empty($attrname)) +{ --- /tmp/dsg/dolibarr/htdocs/societe/admin/github_19.0.3_societe.php +++ /tmp/dsg/dolibarr/htdocs/societe/admin/client_societe.php @@ -2,5 +2,5 @@ -/* Copyright (C) 2004 Rodolphe Quiedeville - * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2005-2011 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2011-2012 Juanjo Menent +/* Copyright (C) 2004 Rodolphe Quiedeville + * Copyright (C) 2004 Eric Seigne + * Copyright (C) 2005-2011 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2011-2012 Juanjo Menent @@ -28 +27,0 @@ -// Load Dolibarr environment @@ -36 +35 @@ -$action = GETPOST('action', 'aZ09'); +$action = GETPOST('action', 'alpha'); @@ -38,5 +37,2 @@ -$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php - -if (!$user->admin) { - accessforbidden(); -} + +if (!$user->admin) accessforbidden(); @@ -54,3 +50,9 @@ -if ($action == 'setcodeclient') { - $result = dolibarr_set_const($db, "SOCIETE_CODECLIENT_ADDON", $value, 'chaine', 0, '', $conf->entity); - if ($result <= 0) { +if ($action == 'setcodeclient') +{ + if (dolibarr_set_const($db, "SOCIETE_CODECLIENT_ADDON", $value, 'chaine', 0, '', $conf->entity) > 0) + { + header("Location: ".$_SERVER["PHP_SELF"]); + exit; + } + else + { @@ -61,3 +63,9 @@ -if ($action == 'setcodecompta') { - $result = dolibarr_set_const($db, "SOCIETE_CODECOMPTA_ADDON", $value, 'chaine', 0, '', $conf->entity); - if ($result <= 0) { +if ($action == 'setcodecompta') +{ + if (dolibarr_set_const($db, "SOCIETE_CODECOMPTA_ADDON", $value, 'chaine', 0, '', $conf->entity) > 0) + { + header("Location: ".$_SERVER["PHP_SELF"]); + exit; + } + else + { @@ -68,2 +76,4 @@ -if ($action == 'updateoptions') { - if (GETPOST('COMPANY_USE_SEARCH_TO_SELECT')) { +if ($action == 'updateoptions') +{ + if (GETPOST('COMPANY_USE_SEARCH_TO_SELECT')) + { @@ -72,11 +82,13 @@ - if (!($res > 0)) { - $error++; - } - if (!$error) { - setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } else { - setEventMessages($langs->trans("Error"), null, 'errors'); - } - } - - if (GETPOST('CONTACT_USE_SEARCH_TO_SELECT')) { + if (!$res > 0) $error++; + if (!$error) + { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } + else + { + setEventMessages($langs->trans("Error"), null, 'errors'); + } + } + + if (GETPOST('CONTACT_USE_SEARCH_TO_SELECT')) + { @@ -85,4 +97,3 @@ - if (!($res > 0)) { - $error++; - } - if (!$error) { + if (!$res > 0) $error++; + if (!$error) + { @@ -90 +101,3 @@ - } else { + } + else + { @@ -95 +108,2 @@ - if (GETPOST('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')) { + if (GETPOST('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')) + { @@ -98,4 +112,3 @@ - if (!($res > 0)) { - $error++; - } - if (!$error) { + if (!$res > 0) $error++; + if (!$error) + { @@ -103 +116,3 @@ - } else { + } + else + { @@ -110 +125,2 @@ -if ($action == 'set') { +if ($action == 'set') +{ @@ -116 +132 @@ - $sql .= " VALUES ('".$db->escape($value)."', '".$db->escape($type)."', ".((int) $conf->entity).", "; + $sql .= " VALUES ('".$db->escape($value)."','".$type."',".$conf->entity.", "; @@ -122,3 +138 @@ - if (!$resql) { - dol_print_error($db); - } + if (!$resql) dol_print_error($db); @@ -128 +142,2 @@ -if ($action == 'del') { +if ($action == 'del') +{ @@ -131 +146 @@ - $sql .= " WHERE nom='".$db->escape($value)."' AND type='".$db->escape($type)."' AND entity=".((int) $conf->entity); + $sql .= " WHERE nom='".$db->escape($value)."' AND type='".$type."' AND entity=".$conf->entity; @@ -133,3 +148 @@ - if (!$resql) { - dol_print_error($db); - } + if (!$resql) dol_print_error($db); @@ -139 +152,2 @@ -if ($action == 'setdoc') { +if ($action == 'setdoc') +{ @@ -151,3 +165,3 @@ - $sql_del .= " AND type = '".$db->escape($type)."'"; - $sql_del .= " AND entity = ".((int) $conf->entity); - dol_syslog("societe.php ".$sql); + $sql_del .= " AND type = '".$type."'"; + $sql_del .= " AND entity = ".$conf->entity; + dol_syslog("societe.php ".$sql); @@ -157 +171 @@ - $sql .= " VALUES ('".$db->escape($value)."', '".$db->escape($type)."', ".((int) $conf->entity).", "; + $sql .= " VALUES ('".$db->escape($value)."', '".$type."', ".$conf->entity.", "; @@ -161 +175 @@ - dol_syslog("societe.php", LOG_DEBUG); + dol_syslog("societe.php", LOG_DEBUG); @@ -163 +177,2 @@ - if ($result1 && $result2) { + if ($result1 && $result2) + { @@ -165,30 +180,4 @@ - } else { - $db->rollback(); - } -} - -//Activate Set accountancy code customer invoice mandatory -if ($action == "setaccountancycodecustomerinvoicemandatory") { - $setaccountancycodecustomerinvoicemandatory = GETPOST('value', 'int'); - $res = dolibarr_set_const($db, "SOCIETE_ACCOUNTANCY_CODE_CUSTOMER_INVOICE_MANDATORY", $setaccountancycodecustomerinvoicemandatory, 'yesno', 0, '', $conf->entity); - if (!($res > 0)) { - $error++; - } - if (!$error) { - setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } else { - setEventMessages($langs->trans("Error"), null, 'errors'); - } -} - -//Activate Set vat id unique -if ($action == "setvatintraunique") { - $setvatintraunique = GETPOST('value', 'int'); - $res = dolibarr_set_const($db, "SOCIETE_VAT_INTRA_UNIQUE", $setvatintraunique, 'yesno', 0, '', $conf->entity); - if (!($res > 0)) { - $error++; - } - if (!$error) { - setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } else { - setEventMessages($langs->trans("Error"), null, 'errors'); + } + else + { + $db->rollback(); @@ -202,4 +191,3 @@ - if (!($res > 0)) { - $error++; - } - if (!$error) { + if (!$res > 0) $error++; + if (!$error) + { @@ -207,15 +195,3 @@ - } else { - setEventMessages($langs->trans("Error"), null, 'errors'); - } -} - -//Activate Set vat in list -if ($action == "setvatinlist") { - $setvatinlist = GETPOST('value', 'int'); - $res = dolibarr_set_const($db, "SOCIETE_SHOW_VAT_IN_LIST", $setvatinlist, 'yesno', 0, '', $conf->entity); - if (!($res > 0)) { - $error++; - } - if (!$error) { - setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } else { + } + else + { @@ -230,4 +206,3 @@ - if (!($res > 0)) { - $error++; - } - if (!$error) { + if (!$res > 0) $error++; + if (!$error) + { @@ -235,15 +210,3 @@ - } else { - setEventMessages($langs->trans("Error"), null, 'errors'); - } -} - -//Activate Set email phone town in contact list -if ($action == "setaddemailphonetownincontactlist") { - $val = GETPOST('value', 'int'); - $res = dolibarr_set_const($db, "CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST", $val, 'yesno', 0, '', $conf->entity); - if (!($res > 0)) { - $error++; - } - if (!$error) { - setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } else { + } + else + { @@ -258,4 +221,3 @@ - if (!($res > 0)) { - $error++; - } - if (!$error) { + if (!$res > 0) $error++; + if (!$error) + { @@ -263 +225,3 @@ - } else { + } + else + { @@ -268 +232 @@ -// Activate "Disable prospect/customer type" +//Activate "Disable prospect/customer type" @@ -270,10 +234,11 @@ - $setdisableprospectcustomer = GETPOST('value', 'int'); - $res = dolibarr_set_const($db, "SOCIETE_DISABLE_PROSPECTSCUSTOMERS", $setdisableprospectcustomer, 'yesno', 0, '', $conf->entity); - if (!($res > 0)) { - $error++; - } - if (!$error) { - setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } else { - setEventMessages($langs->trans("Error"), null, 'errors'); - } + $setdisableprospectcustomer = GETPOST('value', 'int'); + $res = dolibarr_set_const($db, "SOCIETE_DISABLE_PROSPECTSCUSTOMERS", $setdisableprospectcustomer, 'yesno', 0, '', $conf->entity); + if (!$res > 0) $error++; + if (!$error) + { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } + else + { + setEventMessages($langs->trans("Error"), null, 'errors'); + } @@ -283 +248,2 @@ -if ($action == 'setprofid') { +if ($action == 'setprofid') +{ @@ -287,2 +253,7 @@ - $result = dolibarr_set_const($db, $idprof, $status, 'chaine', 0, '', $conf->entity); - if ($result <= 0) { + if (dolibarr_set_const($db, $idprof, $status, 'chaine', 0, '', $conf->entity) > 0) + { + //header("Location: ".$_SERVER["PHP_SELF"]); + //exit; + } + else + { @@ -294 +265,2 @@ -if ($action == 'setprofidmandatory') { +if ($action == 'setprofidmandatory') +{ @@ -298,2 +270,7 @@ - $result = dolibarr_set_const($db, $idprof, $status, 'chaine', 0, '', $conf->entity); - if ($result <= 0) { + if (dolibarr_set_const($db, $idprof, $status, 'chaine', 0, '', $conf->entity) > 0) + { + //header("Location: ".$_SERVER["PHP_SELF"]); + //exit; + } + else + { @@ -305 +282,2 @@ -if ($action == 'setprofidinvoicemandatory') { +if ($action == 'setprofidinvoicemandatory') +{ @@ -309,2 +287,7 @@ - $result = dolibarr_set_const($db, $idprof, $status, 'chaine', 0, '', $conf->entity); - if ($result <= 0) { + if (dolibarr_set_const($db, $idprof, $status, 'chaine', 0, '', $conf->entity) > 0) + { + //header("Location: ".$_SERVER["PHP_SELF"]); + //exit; + } + else + { @@ -316 +299,2 @@ -if ($action == 'sethideinactivethirdparty') { +if ($action == 'sethideinactivethirdparty') +{ @@ -319,2 +303,7 @@ - $result = dolibarr_set_const($db, "COMPANY_HIDE_INACTIVE_IN_COMBOBOX", $status, 'chaine', 0, '', $conf->entity); - if ($result <= 0) { + if (dolibarr_set_const($db, "COMPANY_HIDE_INACTIVE_IN_COMBOBOX", $status, 'chaine', 0, '', $conf->entity) > 0) + { + header("Location: ".$_SERVER["PHP_SELF"]); + exit; + } + else + { @@ -325,12 +314,12 @@ - $setonsearchandlistgooncustomerorsuppliercard = GETPOST('value', 'int'); - $res = dolibarr_set_const($db, "SOCIETE_ON_SEARCH_AND_LIST_GO_ON_CUSTOMER_OR_SUPPLIER_CARD", $setonsearchandlistgooncustomerorsuppliercard, 'yesno', 0, '', $conf->entity); - if (!($res > 0)) { - $error++; - } - if (!$error) { - setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } else { - setEventMessages($langs->trans("Error"), null, 'errors'); - } -} - + $setonsearchandlistgooncustomerorsuppliercard = GETPOST('value', 'int'); + $res = dolibarr_set_const($db, "SOCIETE_ON_SEARCH_AND_LIST_GO_ON_CUSTOMER_OR_SUPPLIER_CARD", $setonsearchandlistgooncustomerorsuppliercard, 'yesno', 0, '', $conf->entity); + if (!$res > 0) $error++; + if (!$error) + { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } + else + { + setEventMessages($langs->trans("Error"), null, 'errors'); + } +} @@ -355 +344 @@ -print dol_get_fiche_head($head, 'general', $langs->trans("ThirdParties"), -1, 'company'); +dol_fiche_head($head, 'general', $langs->trans("ThirdParties"), -1, 'company'); @@ -358,3 +347 @@ -foreach ($conf->modules_parts['models'] as $mo) { - $dirsociete[] = $mo.'core/modules/societe/'; //Add more models -} +foreach ($conf->modules_parts['models'] as $mo) $dirsociete[] = $mo.'core/modules/societe/'; //Add more models @@ -378 +365,2 @@ -foreach ($dirsociete as $dirroot) { +foreach ($dirsociete as $dirroot) +{ @@ -381,28 +369,29 @@ - $handle = @opendir($dir); - if (is_resource($handle)) { - // Loop on each module find in opened directory - while (($file = readdir($handle)) !== false) { - if (substr($file, 0, 15) == 'mod_codeclient_' && substr($file, -3) == 'php') { - $file = substr($file, 0, dol_strlen($file) - 4); - - try { - dol_include_once($dirroot.$file.'.php'); - } catch (Exception $e) { - dol_syslog($e->getMessage(), LOG_ERR); - } - - $modCodeTiers = new $file(); - - // Show modules according to features level - if ($modCodeTiers->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) { - continue; - } - if ($modCodeTiers->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) { - continue; - } - - $arrayofmodules[$file] = $modCodeTiers; - } - } - closedir($handle); - } + $handle = @opendir($dir); + if (is_resource($handle)) + { + // Loop on each module find in opened directory + while (($file = readdir($handle)) !== false) + { + if (substr($file, 0, 15) == 'mod_codeclient_' && substr($file, -3) == 'php') + { + $file = substr($file, 0, dol_strlen($file) - 4); + + try { + dol_include_once($dirroot.$file.'.php'); + } + catch (Exception $e) + { + dol_syslog($e->getMessage(), LOG_ERR); + } + + $modCodeTiers = new $file; + + // Show modules according to features level + if ($modCodeTiers->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; + if ($modCodeTiers->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; + + $arrayofmodules[$file] = $modCodeTiers; + } + } + closedir($handle); + } @@ -413 +402,2 @@ -foreach ($arrayofmodules as $file => $modCodeTiers) { +foreach ($arrayofmodules as $file => $modCodeTiers) +{ @@ -419 +409,2 @@ - if ($conf->global->SOCIETE_CODECLIENT_ADDON == "$file") { + if ($conf->global->SOCIETE_CODECLIENT_ADDON == "$file") + { @@ -423,2 +414,4 @@ - } else { - $disabled = (isModEnabled('multicompany') && (is_object($mc) && !empty($mc->sharings['referent']) && $mc->sharings['referent'] != $conf->entity) ? true : false); + } + else + { + $disabled = (!empty($conf->multicompany->enabled) && (is_object($mc) && !empty($mc->sharings['referent']) && $mc->sharings['referent'] != $conf->entity) ? true : false); @@ -426,3 +419 @@ - if (!$disabled) { - print ''; - } + if (!$disabled) print ''; @@ -430,3 +421 @@ - if (!$disabled) { - print ''; - } + if (!$disabled) print ''; @@ -465 +454,2 @@ -foreach ($dirsociete as $dirroot) { +foreach ($dirsociete as $dirroot) +{ @@ -469,18 +459,23 @@ - if (is_resource($handle)) { - while (($file = readdir($handle)) !== false) { - if (substr($file, 0, 15) == 'mod_codecompta_' && substr($file, -3) == 'php') { - $file = substr($file, 0, dol_strlen($file) - 4); - - try { - dol_include_once($dirroot.$file.'.php'); - } catch (Exception $e) { - dol_syslog($e->getMessage(), LOG_ERR); - } - - $modCodeCompta = new $file(); - - $arrayofmodules[$file] = $modCodeCompta; - } - } - closedir($handle); - } + if (is_resource($handle)) + { + while (($file = readdir($handle)) !== false) + { + if (substr($file, 0, 15) == 'mod_codecompta_' && substr($file, -3) == 'php') + { + $file = substr($file, 0, dol_strlen($file) - 4); + + try { + dol_include_once($dirroot.$file.'.php'); + } + catch (Exception $e) + { + dol_syslog($e->getMessage(), LOG_ERR); + } + + $modCodeCompta = new $file; + + $arrayofmodules[$file] = $modCodeCompta; + } + } + closedir($handle); + } @@ -492,21 +487,25 @@ -foreach ($arrayofmodules as $file => $modCodeCompta) { - print ''; - print ''.$modCodeCompta->name."\n"; - print $modCodeCompta->info($langs); - print ''; - print ''.$modCodeCompta->getExample($langs)."\n"; - - if ($conf->global->SOCIETE_CODECOMPTA_ADDON == "$file") { - print ''; - print img_picto($langs->trans("Activated"), 'switch_on'); - print ''; - } else { - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - print ''; - } - print ''; - $s = $modCodeCompta->getToolTip($langs, null, -1); - print $form->textwithpicto('', $s, 1); - print ''; - print "\n"; +foreach ($arrayofmodules as $file => $modCodeCompta) +{ + print ''; + print ''.$modCodeCompta->name."\n"; + print $modCodeCompta->info($langs); + print ''; + print ''.$modCodeCompta->getExample($langs)."\n"; + + if ($conf->global->SOCIETE_CODECOMPTA_ADDON == "$file") + { + print ''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ''; + } + else + { + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print ''; + } + print ''; + $s = $modCodeCompta->getToolTip($langs, null, -1); + print $form->textwithpicto('', $s, 1); + print ''; + print "\n"; @@ -531 +530,2 @@ -if ($resql) { +if ($resql) +{ @@ -534 +534,2 @@ - while ($i < $num_rows) { + while ($i < $num_rows) + { @@ -539 +540,3 @@ -} else { +} +else +{ @@ -553 +556,2 @@ -foreach ($dirsociete as $dirroot) { +foreach ($dirsociete as $dirroot) +{ @@ -557,3 +561,6 @@ - if (is_resource($handle)) { - while (($file = readdir($handle)) !== false) { - if (preg_match('/\.modules\.php$/i', $file)) { + if (is_resource($handle)) + { + while (($file = readdir($handle)) !== false) + { + if (preg_match('/\.modules\.php$/i', $file)) + { @@ -563,7 +570,9 @@ - try { - dol_include_once($dirroot.'doc/'.$file); - } catch (Exception $e) { - dol_syslog($e->getMessage(), LOG_ERR); - } - - $module = new $classname($db); + try { + dol_include_once($dirroot.'doc/'.$file); + } + catch (Exception $e) + { + dol_syslog($e->getMessage(), LOG_ERR); + } + + $module = new $classname($db); @@ -573,5 +582,2 @@ - if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) { - $modulequalified = 0; - } elseif ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) { - $modulequalified = 0; - } + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified = 0; + elseif ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified = 0; @@ -580 +586,2 @@ - if ($modulequalified) { + if ($modulequalified) + { @@ -582 +589 @@ - print dol_escape_htmltag($module->name); + print $module->name; @@ -584,5 +591,2 @@ - if (method_exists($module, 'info')) { - print $module->info($langs); - } else { - print $module->description; - } + if (method_exists($module, 'info')) print $module->info($langs); + else print $module->description; @@ -592 +596,2 @@ - if (in_array($name, $def)) { + if (in_array($name, $def)) + { @@ -596,3 +601,3 @@ - print 'scandir.'&label='.urlencode($module->name).'">'; - print img_picto($langs->trans("Enabled"), 'switch_on'); - print ''; + print 'scandir.'&label='.urlencode($module->name).'">'; + print img_picto($langs->trans("Enabled"), 'switch_on'); + print ''; @@ -605,3 +610,6 @@ - } else { - if (versioncompare($module->phpmin, versionphparray()) > 0) { - print ''."\n"; + } + else + { + if (versioncompare($module->phpmin, versionphparray()) > 0) + { + print "\n"; @@ -610,3 +618,5 @@ - } else { - print ''."\n"; - print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + } + else + { + print "\n"; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; @@ -620 +630,2 @@ - if ($module->type == 'pdf') { + if ($module->type == 'pdf') + { @@ -632,3 +643,6 @@ - if ($module->type == 'pdf') { - $linkspec = ''.img_object($langs->trans("Preview"), 'pdf').''; - } else { + if ($module->type == 'pdf') + { + $linkspec = ''.img_object($langs->trans("Preview"), 'bill').''; + } + else + { @@ -679,6 +692,0 @@ -if (isModEnabled('accounting')) { - $profid['ACCOUNTANCY_CODE_CUSTOMER'][0] = $langs->trans("CustomerAccountancyCodeShort"); - $profid['ACCOUNTANCY_CODE_CUSTOMER'][1] = $langs->trans('CustomerAccountancyCodeShort'); - $profid['ACCOUNTANCY_CODE_SUPPLIER'][0] = $langs->trans("SupplierAccountancyCodeShort"); - $profid['ACCOUNTANCY_CODE_SUPPLIER'][1] = $langs->trans('SupplierAccountancyCodeShort'); -} @@ -687,2 +695,4 @@ -foreach ($profid as $key => $val) { - if ($profid[$key][1] != '-') { +foreach ($profid as $key => $val) +{ + if ($profid[$key][1] != '-') + { @@ -698,6 +708,7 @@ - $verif = (empty($conf->global->$idprof_unique) ? false : true); - $mandatory = (empty($conf->global->$idprof_mandatory) ? false : true); - $invoice_mandatory = (empty($conf->global->$idprof_invoice_mandatory) ? false : true); - - if ($verif) { - print ''; + $verif = (empty($conf->global->$idprof_unique) ?false:true); + $mandatory = (empty($conf->global->$idprof_mandatory) ?false:true); + $invoice_mandatory = (empty($conf->global->$idprof_invoice_mandatory) ?false:true); + + if ($verif) + { + print ''; @@ -706,2 +717,4 @@ - } else { - print ''; + } + else + { + print ''; @@ -712,2 +725,3 @@ - if ($mandatory) { - print ''; + if ($mandatory) + { + print ''; @@ -716,2 +730,4 @@ - } else { - print ''; + } + else + { + print ''; @@ -722,2 +738,3 @@ - if ($invoice_mandatory) { - print ''; + if ($invoice_mandatory) + { + print ''; @@ -726,2 +743,4 @@ - } else { - print ''; + } + else + { + print ''; @@ -737,16 +755,0 @@ -// VAT ID -print ''; -print ''.$langs->trans('VATIntra')."\n"; - -if (getDolGlobalString('SOCIETE_VAT_INTRA_UNIQUE')) { - print ''; - print img_picto($langs->trans("Activated"), 'switch_on'); - print ''; -} else { - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - print ''; -} -print ''; -print "\n"; - @@ -765 +767,0 @@ -print ''; @@ -779 +781,2 @@ -if (!$conf->use_javascript_ajax) { +if (!$conf->use_javascript_ajax) +{ @@ -783 +786,27 @@ -} else { +} +else +{ + print ''; + $arrval = array('0'=>$langs->trans("No"), + '1'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 1).')', + '2'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 2).')', + '3'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 3).')', + ); + print $form->selectarray("activate_COMPANY_USE_SEARCH_TO_SELECT", $arrval, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, 0, 0, '', 0, 0, 0, '', 'minwidth75imp'); + print ''; + print ''; + print ""; +} +print ''; + + +print ''; +print ''.$form->textwithpicto($langs->trans("DelaiedFullListToSelectContact"), $langs->trans('UseSearchToSelectContactTooltip'), 1).''; +if (!$conf->use_javascript_ajax) +{ + print ''; + print $langs->trans("NotAvailableWhenAjaxDisabled"); + print ""; +} +else +{ @@ -790 +819 @@ - print $form->selectarray("activate_COMPANY_USE_SEARCH_TO_SELECT", $arrval, getDolGlobalString('COMPANY_USE_SEARCH_TO_SELECT'), 0, 0, 0, '', 0, 0, 0, '', 'minwidth75imp'); + print $form->selectarray("activate_CONTACT_USE_SEARCH_TO_SELECT", $arrval, $conf->global->CONTACT_USE_SEARCH_TO_SELECT, 0, 0, 0, '', 0, 0, 0, '', 'minwidth75imp'); @@ -792,22 +821 @@ - print ''; - print ""; -} -print ''; - - -print ''; -print ''.$form->textwithpicto($langs->trans("DelaiedFullListToSelectContact"), $langs->trans('UseSearchToSelectContactTooltip'), 1).''; -if (!$conf->use_javascript_ajax) { - print ''; - print $langs->trans("NotAvailableWhenAjaxDisabled"); - print ""; -} else { - print ''; - $arrval = array('0'=>$langs->trans("No"), - '1'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 1).')', - '2'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 2).')', - '3'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 3).')', - ); - print $form->selectarray("activate_CONTACT_USE_SEARCH_TO_SELECT", $arrval, getDolGlobalString('CONTACT_USE_SEARCH_TO_SELECT'), 0, 0, 0, '', 0, 0, 0, '', 'minwidth75imp'); - print ''; - print ''; + print ''; @@ -822 +830 @@ -print ' '; +print ' '; @@ -824,2 +832,3 @@ -if (getDolGlobalString('SOCIETE_ADD_REF_IN_LIST')) { - print ''; +if (!empty($conf->global->SOCIETE_ADD_REF_IN_LIST)) +{ + print ''; @@ -827,2 +836,4 @@ -} else { - print ''; +} +else +{ + print ''; @@ -835,2 +846,2 @@ -print ''.$langs->trans("AddVatInList").''; -print ' '; +print ''.$langs->trans("AddAdressInList").''; +print ' '; @@ -838,2 +849,3 @@ -if (getDolGlobalString('SOCIETE_SHOW_VAT_IN_LIST')) { - print ''; +if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) +{ + print ''; @@ -841,2 +853,4 @@ -} else { - print ''; +} +else +{ + print ''; @@ -847,0 +862,2 @@ + + @@ -849,2 +865,2 @@ -print ''.$langs->trans("AddAdressInList").''; -print ' '; +print ''.$langs->trans("AskForPreferredShippingMethod").''; +print ' '; @@ -852,2 +868,3 @@ -if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) { - print ''; +if (!empty($conf->global->SOCIETE_ASK_FOR_SHIPPING_METHOD)) +{ + print ''; @@ -855,2 +872,4 @@ -} else { - print ''; +} +else +{ + print ''; @@ -861,32 +879,0 @@ - -print ''; -print ''.$langs->trans("AddEmailPhoneTownInContactList").''; -print ' '; -print ''; -if (getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) { - print ''; - print img_picto($langs->trans("Activated"), 'switch_on'); -} else { - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); -} -print ''; -print ''; - -if (isModEnabled("expedition")) { - if (getDolGlobalInt('MAIN_FEATURES_LEVEL') > 0) { // Visible on experimental only because seems to not be implemented everywhere (only on proposal) - print ''; - print ''.$langs->trans("AskForPreferredShippingMethod").''; - print ' '; - print ''; - if (getDolGlobalString('SOCIETE_ASK_FOR_SHIPPING_METHOD')) { - print ''; - print img_picto($langs->trans("Activated"), 'switch_on'); - } else { - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - } - print ''; - print ''; - } -} @@ -897 +884 @@ -print ' '; +print ' '; @@ -899,6 +886,9 @@ -if (getDolGlobalString('SOCIETE_DISABLE_PROSPECTSCUSTOMERS')) { - print ''; - print img_picto($langs->trans("Activated"), 'switch_on'); -} else { - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); +if (!empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS)) +{ + print ''; + print img_picto($langs->trans("Activated"), 'switch_on'); +} +else +{ + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); @@ -909,12 +899,10 @@ -if (!getDolGlobalString('SOCIETE_DISABLE_PROSPECTSCUSTOMERS')) { - // Default Prospect/Customer thirdparty type on customer création - print ''; - print ''.$langs->trans("DefaultCustomerType").''; - print ''; - print $formcompany->selectProspectCustomerType(getDolGlobalString('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT'), 'defaultcustomertype', 'defaultcustomertype', 'admin'); - print ''; - print ''; - print ''; - print ''; - print ''; -} +// Default Prospect/Customer thirdparty type on customer création +print ''; +print ''.$langs->trans("DefaultCustomerType").''; +print ''; +print $formcompany->selectProspectCustomerType($conf->global->THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT, 'defaultcustomertype', 'defaultcustomertype', 'admin'); +print ''; +print ''; +print ''; +print ''; +print ''; @@ -928 +916 @@ -print dol_get_fiche_end(); +dol_fiche_end(); --- /tmp/dsg/dolibarr/htdocs/societe/admin/github_19.0.3_societe_extrafields.php +++ /tmp/dsg/dolibarr/htdocs/societe/admin/client_societe_extrafields.php @@ -27 +26,0 @@ -// Load Dolibarr environment @@ -40,3 +39 @@ -foreach ($tmptype2label as $key => $val) { - $type2label[$key] = $langs->transnoentitiesnoconv($val); -} +foreach ($tmptype2label as $key => $val) $type2label[$key] = $langs->transnoentitiesnoconv($val); @@ -44 +41 @@ -$action = GETPOST('action', 'aZ09'); +$action = GETPOST('action', 'alpha'); @@ -48,3 +45 @@ -if (!$user->admin) { - accessforbidden(); -} +if (!$user->admin) accessforbidden(); @@ -77 +72 @@ -print dol_get_fiche_head($head, 'attributes', $langs->trans("ThirdParties"), -1, 'company'); +dol_fiche_head($head, 'attributes', $langs->trans("ThirdParties"), -1, 'company'); @@ -81 +76 @@ -print dol_get_fiche_end(); +dol_fiche_end(); @@ -84,2 +79,17 @@ -// Creation of an optional field -if ($action == 'create') { +// Buttons +if ($action != 'create' && $action != 'edit') +{ + print '"; +} + + +/* ************************************************************************** */ +/* */ +/* Creation d'un champ optionnel + /* */ +/* ************************************************************************** */ + +if ($action == 'create') +{ @@ -92,2 +102,7 @@ -// Edition of an optional field -if ($action == 'edit' && !empty($attrname)) { +/* ************************************************************************** */ +/* */ +/* Edition d'un champ optionnel */ +/* */ +/* ************************************************************************** */ +if ($action == 'edit' && !empty($attrname)) +{