Fix: remove deprecated function and avoid warnings

This commit is contained in:
Regis Houssin 2012-08-15 09:06:36 +02:00
parent 56c73192f1
commit 48efabc8a4
13 changed files with 77 additions and 60 deletions

View File

@ -77,6 +77,13 @@ class modProduct extends DolibarrModules
$this->const = array(); $this->const = array();
$r=0; $r=0;
$this->const[$r][0] = "PRODUCT_CODEPRODUCT_ADDON";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "mod_codeproduct_leopard";
$this->const[$r][3] = 'Module to control product codes';
$this->const[$r][4] = 0;
$r++;
$this->const[$r][0] = "MAIN_SEARCHFORM_PRODUITSERVICE"; $this->const[$r][0] = "MAIN_SEARCHFORM_PRODUITSERVICE";
$this->const[$r][1] = "yesno"; $this->const[$r][1] = "yesno";
$this->const[$r][2] = "1"; $this->const[$r][2] = "1";

View File

@ -75,6 +75,20 @@ class modSociete extends DolibarrModules
$this->const = array(); $this->const = array();
$r=0; $r=0;
$this->const[$r][0] = "SOCIETE_CODECLIENT_ADDON";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "mod_codeclient_leopard";
$this->const[$r][3] = 'Module to control third parties codes';
$this->const[$r][4] = 0;
$r++;
$this->const[$r][0] = "SOCIETE_CODECOMPTA_ADDON";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "mod_codecompta_panicum";
$this->const[$r][3] = 'Module to control third parties codes';
$this->const[$r][4] = 0;
$r++;
$this->const[$r][0] = "SOCIETE_FISCAL_MONTH_START"; $this->const[$r][0] = "SOCIETE_FISCAL_MONTH_START";
$this->const[$r][1] = "chaine"; $this->const[$r][1] = "chaine";
$this->const[$r][2] = "0"; $this->const[$r][2] = "0";

View File

@ -69,11 +69,10 @@ class mod_codeproduct_elephant extends ModeleProductCode
function info($langs) function info($langs)
{ {
global $conf, $mc; global $conf, $mc;
global $form;
$langs->load("products"); $langs->load("products");
$form = new Form($this->db);
$disabled = ((! empty($mc->sharings['referent']) && $mc->sharings['referent'] != $conf->entity) ? ' disabled="disabled"' : ''); $disabled = ((! empty($mc->sharings['referent']) && $mc->sharings['referent'] != $conf->entity) ? ' disabled="disabled"' : '');
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n"; $texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
@ -91,7 +90,7 @@ class mod_codeproduct_elephant extends ModeleProductCode
// Parametrage du prefix customers // Parametrage du prefix customers
$texte.= '<tr><td>'.$langs->trans("Mask").' ('.$langs->trans("ProductCodeModel").'):</td>'; $texte.= '<tr><td>'.$langs->trans("Mask").' ('.$langs->trans("ProductCodeModel").'):</td>';
$texte.= '<td align="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="value1" value="'.$conf->global->PRODUCT_ELEPHANT_MASK_PRODUCT.'"'.$disabled.'>',$tooltip,1,1).'</td>'; $texte.= '<td align="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="value1" value="'.(! empty($conf->global->PRODUCT_ELEPHANT_MASK_PRODUCT)?$conf->global->PRODUCT_ELEPHANT_MASK_PRODUCT:'').'"'.$disabled.'>',$tooltip,1,1).'</td>';
$texte.= '<td align="left" rowspan="2">&nbsp; <input type="submit" class="button" value="'.$langs->trans("Modify").'" name="Button"'.$disabled.'></td>'; $texte.= '<td align="left" rowspan="2">&nbsp; <input type="submit" class="button" value="'.$langs->trans("Modify").'" name="Button"'.$disabled.'></td>';
@ -99,7 +98,7 @@ class mod_codeproduct_elephant extends ModeleProductCode
// Parametrage du prefix suppliers // Parametrage du prefix suppliers
$texte.= '<tr><td>'.$langs->trans("Mask").' ('.$langs->trans("ServiceCodeModel").'):</td>'; $texte.= '<tr><td>'.$langs->trans("Mask").' ('.$langs->trans("ServiceCodeModel").'):</td>';
$texte.= '<td align="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="value2" value="'.$conf->global->PRODUCT_ELEPHANT_MASK_SERVICE.'"'.$disabled.'>',$tooltip,1,1).'</td>'; $texte.= '<td align="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="value2" value="'.(! empty($conf->global->PRODUCT_ELEPHANT_MASK_SERVICE)?$conf->global->PRODUCT_ELEPHANT_MASK_SERVICE:'').'"'.$disabled.'>',$tooltip,1,1).'</td>';
$texte.= '</tr>'; $texte.= '</tr>';
$texte.= '</table>'; $texte.= '</table>';
@ -166,9 +165,12 @@ class mod_codeproduct_elephant extends ModeleProductCode
// Get Mask value // Get Mask value
$mask = ''; $mask = '';
if ($type==0) $mask = $conf->global->PRODUCT_ELEPHANT_MASK_PRODUCT; if ($type == 0 && ! empty($conf->global->PRODUCT_ELEPHANT_MASK_PRODUCT))
if ($type==1) $mask = $conf->global->PRODUCT_ELEPHANT_MASK_SERVICE; $mask = $conf->global->PRODUCT_ELEPHANT_MASK_PRODUCT;
if (! $mask) else if ($type == 1 && ! empty($conf->global->PRODUCT_ELEPHANT_MASK_SERVICE))
$mask = $conf->global->PRODUCT_ELEPHANT_MASK_SERVICE;
if (empty($mask))
{ {
$this->error='NotConfigured'; $this->error='NotConfigured';
return ''; return '';

View File

@ -69,11 +69,10 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode
function info($langs) function info($langs)
{ {
global $conf, $mc; global $conf, $mc;
global $form;
$langs->load("companies"); $langs->load("companies");
$form = new Form($this->db);
$disabled = ((! empty($mc->sharings['referent']) && $mc->sharings['referent'] != $conf->entity) ? ' disabled="disabled"' : ''); $disabled = ((! empty($mc->sharings['referent']) && $mc->sharings['referent'] != $conf->entity) ? ' disabled="disabled"' : '');
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n"; $texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";

View File

@ -60,11 +60,10 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode
function info($langs) function info($langs)
{ {
global $conf; global $conf;
global $form;
$langs->load("companies"); $langs->load("companies");
$form = new Form($this->db);
$tooltip=''; $tooltip='';
$texte = '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'; $texte = '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
$texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; $texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@ -110,14 +109,14 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode
$i = 0; $i = 0;
$this->db = $db; $this->db = $db;
dol_syslog("mod_codecompta_aquarium::get_code search code for type=".$type." company=".$societe->nom); dol_syslog("mod_codecompta_aquarium::get_code search code for type=".$type." company=".(! empty($societe->nom)?$societe->nom:''));
// Regle gestion compte compta // Regle gestion compte compta
$codetouse=''; $codetouse='';
if ($type == 'customer') $codetouse = $this->prefixcustomeraccountancycode; if ($type == 'customer') $codetouse = $this->prefixcustomeraccountancycode;
if ($type == 'supplier') $codetouse = $this->prefixsupplieraccountancycode; if ($type == 'supplier') $codetouse = $this->prefixsupplieraccountancycode;
if ($type == 'customer') $codetouse.= ($societe->code_client?$societe->code_client:'CUSTCODE'); if ($type == 'customer') $codetouse.= (! empty($societe->code_client)?$societe->code_client:'CUSTCODE');
if ($type == 'supplier') $codetouse.= ($societe->code_fournisseur?$societe->code_fournisseur:'SUPPCODE'); if ($type == 'supplier') $codetouse.= (! empty($societe->code_fournisseur)?$societe->code_fournisseur:'SUPPCODE');
$codetouse=strtoupper(preg_replace('/([^a-z0-9])/i','',$codetouse)); $codetouse=strtoupper(preg_replace('/([^a-z0-9])/i','',$codetouse));
$is_dispo = $this->verif($db, $codetouse, $societe, $type); $is_dispo = $this->verif($db, $codetouse, $societe, $type);
@ -154,7 +153,7 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode
if ($type == 'customer') $sql.= "code_compta"; if ($type == 'customer') $sql.= "code_compta";
if ($type == 'supplier') $sql.= "code_compta_fournisseur"; if ($type == 'supplier') $sql.= "code_compta_fournisseur";
$sql.= " = '".$this->db->escape($code)."'"; $sql.= " = '".$this->db->escape($code)."'";
if ($societe->id > 0) $sql.= " AND rowid <> ".$societe->id; if (! empty($societe->id)) $sql.= " AND rowid <> ".$societe->id;
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) if ($resql)

View File

@ -77,10 +77,14 @@ class mod_codecompta_panicum extends ModeleAccountancyCode
*/ */
function get_code($db, $societe, $type='') function get_code($db, $societe, $type='')
{ {
// Renvoie toujours ok $this->code='';
if ($type == 'supplier') $this->code = $societe->code_compta_fournisseur;
else $this->code = $societe->code_compta; if (is_object($societe)) {
return 0; if ($type == 'supplier') $this->code = (! empty($societe->code_compta_fournisseur)?$societe->code_compta_fournisseur:'');
else $this->code = (! empty($societe->code_compta)?$societe->code_compta:'');
}
return 0; // return ok
} }
} }

View File

@ -3,7 +3,7 @@
-- Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net> -- Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> -- Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
-- Copyright (C) 2004 Guillaume Delecourt <guillaume.delecourt@opensides.be> -- Copyright (C) 2004 Guillaume Delecourt <guillaume.delecourt@opensides.be>
-- Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr> -- Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
-- Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com> -- Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
-- --
-- This program is free software; you can redistribute it and/or modify -- This program is free software; you can redistribute it and/or modify
@ -79,17 +79,10 @@ insert into llx_const (name, value, type, note, visible) values ('MAIN_DELAY_TRA
-- --
-- Tiers -- Tiers
-- --
insert into llx_const (name, value, type, note, visible, entity) values('SOCIETE_NOLIST_COURRIER','1','yesno','Liste les fichiers du repertoire courrier',0,0); insert into llx_const (name, value, type, note, visible, entity) values ('SOCIETE_NOLIST_COURRIER','1','yesno','Liste les fichiers du repertoire courrier',0,0);
insert into llx_const (name, value, type, note, visible) values('SOCIETE_CODECLIENT_ADDON','mod_codeclient_leopard','yesno','Module to control third parties codes',0);
insert into llx_const (name, value, type, note, visible) values('SOCIETE_CODECOMPTA_ADDON','mod_codecompta_panicum','yesno','Module to control third parties codes',0);
-- --
-- Mail Mailing -- Mail Mailing
-- --
insert into llx_const (name, value, type, note, visible) values ('MAILING_EMAIL_FROM','dolibarr@domain.com','chaine','EMail emmetteur pour les envois d emailings',0); insert into llx_const (name, value, type, note, visible) values ('MAILING_EMAIL_FROM','dolibarr@domain.com','chaine','EMail emmetteur pour les envois d emailings',0);
--
-- Product
--
insert into llx_const (name, value, type, note, visible) values('PRODUCT_CODEPRODUCT_ADDON','mod_codeproduct_leopard','yesno','Module to control product codes',0);

View File

@ -43,8 +43,8 @@ ALTER TABLE llx_mailing MODIFY COLUMN body mediumtext;
ALTER TABLE llx_mailing ADD COLUMN extraparams varchar(255); ALTER TABLE llx_mailing ADD COLUMN extraparams varchar(255);
ALTER TABLE llx_product MODIFY ref varchar(128) NOT NULL; ALTER TABLE llx_product MODIFY ref varchar(128) NOT NULL;
ALTER TABLE llx_product MODIFY ref_ext varchar(128); ALTER TABLE llx_product MODIFY ref_ext varchar(128);
ALTER TABLE llx_product_fournisseur_price DROP COLUMN fk_product_fournisseur; ALTER TABLE llx_product_fournisseur_price DROP COLUMN fk_product_fournisseur;
ALTER TABLE llx_product_fournisseur_price ADD charges DOUBLE( 24, 8 ) DEFAULT 0 AFTER unitprice; ALTER TABLE llx_product_fournisseur_price ADD charges DOUBLE( 24, 8 ) DEFAULT 0 AFTER unitprice;
@ -68,3 +68,4 @@ ALTER TABLE llx_commande CHANGE fk_demand_reason fk_input_reason INT(11) NULL DE
ALTER TABLE llx_propal CHANGE fk_demand_reason fk_input_reason INT(11) NULL DEFAULT NULL; ALTER TABLE llx_propal CHANGE fk_demand_reason fk_input_reason INT(11) NULL DEFAULT NULL;
ALTER TABLE llx_commande_fournisseur CHANGE fk_methode_commande fk_input_method INT(11) NULL DEFAULT 0; ALTER TABLE llx_commande_fournisseur CHANGE fk_methode_commande fk_input_method INT(11) NULL DEFAULT 0;
INSERT INTO llx_const (name, value, type, note, visible) values ('PRODUCT_CODEPRODUCT_ADDON','mod_codeproduct_leopard','yesno','Module to control product codes',0);

View File

@ -229,7 +229,7 @@ foreach ($dirproduct as $dirroot)
print '<td>'.$modCodeProduct->info($langs).'</td>'."\n"; print '<td>'.$modCodeProduct->info($langs).'</td>'."\n";
print '<td nowrap="nowrap">'.$modCodeProduct->getExample($langs).'</td>'."\n"; print '<td nowrap="nowrap">'.$modCodeProduct->getExample($langs).'</td>'."\n";
if ($conf->global->PRODUCT_CODEPRODUCT_ADDON == "$file") if (! empty($conf->global->PRODUCT_CODEPRODUCT_ADDON) && $conf->global->PRODUCT_CODEPRODUCT_ADDON == $file)
{ {
print '<td align="center">'."\n"; print '<td align="center">'."\n";
print img_picto($langs->trans("Activated"),'switch_on'); print img_picto($langs->trans("Activated"),'switch_on');
@ -295,7 +295,7 @@ print '</form>';
// multiprix nombre de prix a proposer // multiprix nombre de prix a proposer
if($conf->global->PRODUIT_MULTIPRICES) if (! empty($conf->global->PRODUIT_MULTIPRICES))
{ {
$var=!$var; $var=!$var;
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">'; print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
@ -331,7 +331,7 @@ print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="usesearchtoselectproduct">'; print '<input type="hidden" name="action" value="usesearchtoselectproduct">';
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td>'.$langs->trans("UseSearchToSelectProduct").'</td>'; print '<td>'.$langs->trans("UseSearchToSelectProduct").'</td>';
if (! $conf->use_javascript_ajax) if (empty($conf->use_javascript_ajax))
{ {
print '<td nowrap="nowrap" align="right" colspan="2">'; print '<td nowrap="nowrap" align="right" colspan="2">';
print $langs->trans("NotAvailableWhenAjaxDisabled"); print $langs->trans("NotAvailableWhenAjaxDisabled");
@ -392,7 +392,7 @@ if (! empty($conf->global->MAIN_MULTILANGS))
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td>'.$langs->trans("ViewProductDescInThirdpartyLanguageAbility").'</td>'; print '<td>'.$langs->trans("ViewProductDescInThirdpartyLanguageAbility").'</td>';
print '<td width="60" align="right">'; print '<td width="60" align="right">';
print $form->selectyesno("activate_viewProdTextsInThirdpartyLanguage",$conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE,1); print $form->selectyesno("activate_viewProdTextsInThirdpartyLanguage", (! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)?$conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE:0), 1);
print '</td><td align="right">'; print '</td><td align="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print '</td>'; print '</td>';
@ -401,7 +401,7 @@ if (! empty($conf->global->MAIN_MULTILANGS))
} }
if ($conf->global->PRODUCT_CANVAS_ABILITY) if (! empty($conf->global->PRODUCT_CANVAS_ABILITY))
{ {
// Add canvas feature // Add canvas feature
$dir = DOL_DOCUMENT_ROOT . "/product/canvas/"; $dir = DOL_DOCUMENT_ROOT . "/product/canvas/";

View File

@ -698,8 +698,7 @@ else
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php"); require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
// Load object modCodeProduct // Load object modCodeProduct
$module=$conf->global->PRODUCT_CODEPRODUCT_ADDON; $module=(! empty($conf->global->PRODUCT_CODEPRODUCT_ADDON)?$conf->global->PRODUCT_CODEPRODUCT_ADDON:'mod_codeproduct_leopard');
if (! $module) dolibarr_error('',$langs->trans("ErrorModuleThirdPartyCodeInCompanyModuleNotDefined"));
if (substr($module, 0, 16) == 'mod_codeproduct_' && substr($module, -3) == 'php') if (substr($module, 0, 16) == 'mod_codeproduct_' && substr($module, -3) == 'php')
{ {
$module = substr($module, 0, dol_strlen($module)-4); $module = substr($module, 0, dol_strlen($module)-4);
@ -711,7 +710,7 @@ else
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="add">'; print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="type" value="'.$type.'">'."\n"; print '<input type="hidden" name="type" value="'.$type.'">'."\n";
if ($modCodeProduct->code_auto) print '<input type="hidden" name="code_auto" value="1">'; if (! empty($modCodeProduct->code_auto)) print '<input type="hidden" name="code_auto" value="1">';
if ($type==1) $title=$langs->trans("NewService"); if ($type==1) $title=$langs->trans("NewService");
else $title=$langs->trans("NewProduct"); else $title=$langs->trans("NewProduct");
@ -721,7 +720,7 @@ else
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print '<tr>'; print '<tr>';
if ($modCodeProduct->code_auto) $tmpcode=$modCodeProduct->getNextValue($object,$type); if (! empty($modCodeProduct->code_auto)) $tmpcode=$modCodeProduct->getNextValue($object,$type);
print '<td class="fieldrequired" width="20%">'.$langs->trans("Ref").'</td><td><input name="ref" size="40" maxlength="32" value="'.$tmpcode.'">'; print '<td class="fieldrequired" width="20%">'.$langs->trans("Ref").'</td><td><input name="ref" size="40" maxlength="32" value="'.$tmpcode.'">';
if ($_error) if ($_error)
{ {

View File

@ -433,8 +433,10 @@ foreach ($dirsociete as $dirroot)
$module = new $classname($db); $module = new $classname($db);
$modulequalified=1; $modulequalified=1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0; if (! empty($module->version)) {
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0; if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0;
else if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0;
}
if ($modulequalified) if ($modulequalified)
{ {
@ -481,16 +483,16 @@ foreach ($dirsociete as $dirroot)
// Info // Info
$htmltooltip = ''.$langs->trans("Name").': '.$module->name; $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); $htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
if ($modele->type == 'pdf') if ($module->type == 'pdf')
{ {
$htmltooltip.='<br>'.$langs->trans("Height").'/'.$langs->trans("Width").': '.$module->page_hauteur.'/'.$module->page_largeur; $htmltooltip.='<br>'.$langs->trans("Height").'/'.$langs->trans("Width").': '.$module->page_hauteur.'/'.$module->page_largeur;
} }
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>'; $htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
$htmltooltip.='<br>'.$langs->trans("WatermarkOnDraft").': '.yn($module->option_draft_watermark,1,1); $htmltooltip.='<br>'.$langs->trans("WatermarkOnDraft").': '.yn((! empty($module->option_draft_watermark)?$module->option_draft_watermark:''), 1, 1);
print '<td align="center" nowrap="nowrap">'; print '<td align="center" nowrap="nowrap">';
if ($modele->type == 'pdf') if ($module->type == 'pdf')
{ {
$linkspec='<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'bill').'</a>'; $linkspec='<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'bill').'</a>';
} }
@ -547,16 +549,16 @@ while ($i < $nbofloop)
switch($i) switch($i)
{ {
case 0: case 0:
$verif=(!$conf->global->SOCIETE_IDPROF1_UNIQUE?false:true); $verif=(empty($conf->global->SOCIETE_IDPROF1_UNIQUE)?false:true);
break; break;
case 1: case 1:
$verif=(!$conf->global->SOCIETE_IDPROF2_UNIQUE?false:true); $verif=(empty($conf->global->SOCIETE_IDPROF2_UNIQUE)?false:true);
break; break;
case 2: case 2:
$verif=(!$conf->global->SOCIETE_IDPROF3_UNIQUE?false:true); $verif=(empty($conf->global->SOCIETE_IDPROF3_UNIQUE)?false:true);
break; break;
case 3: case 3:
$verif=(!$conf->global->SOCIETE_IDPROF4_UNIQUE?false:true); $verif=(empty($conf->global->SOCIETE_IDPROF4_UNIQUE)?false:true);
break; break;
} }

View File

@ -425,8 +425,7 @@ abstract class ActionsCardCommon
} }
// Load object modCodeClient // Load object modCodeClient
$module=$conf->global->SOCIETE_CODECLIENT_ADDON; $module=(! empty($conf->global->SOCIETE_CODECLIENT_ADDON)?$conf->global->SOCIETE_CODECLIENT_ADDON:'mod_codeclient_leopard');
if (! $module) dolibarr_error('',$langs->trans("ErrorModuleThirdPartyCodeInCompanyModuleNotDefined"));
if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php')
{ {
$module = substr($module, 0, dol_strlen($module)-4); $module = substr($module, 0, dol_strlen($module)-4);
@ -437,7 +436,7 @@ abstract class ActionsCardCommon
$res=dol_include_once($dirroot.$module.".php"); $res=dol_include_once($dirroot.$module.".php");
if ($res) break; if ($res) break;
} }
$modCodeClient = new $module; $modCodeClient = new $module($db);
$this->tpl['auto_customercode'] = $modCodeClient->code_auto; $this->tpl['auto_customercode'] = $modCodeClient->code_auto;
// We verified if the tag prefix is used // We verified if the tag prefix is used
if ($modCodeClient->code_auto) $this->tpl['prefix_customercode'] = $modCodeClient->verif_prefixIsUsed(); if ($modCodeClient->code_auto) $this->tpl['prefix_customercode'] = $modCodeClient->verif_prefixIsUsed();

View File

@ -514,8 +514,7 @@ else
*/ */
// Load object modCodeTiers // Load object modCodeTiers
$module=$conf->global->SOCIETE_CODECLIENT_ADDON; $module=(! empty($conf->global->SOCIETE_CODECLIENT_ADDON)?$conf->global->SOCIETE_CODECLIENT_ADDON:'mod_codeclient_leopard');
if (! $module) dolibarr_error('',$langs->trans("ErrorModuleThirdPartyCodeInCompanyModuleNotDefined"));
if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php')
{ {
$module = substr($module, 0, dol_strlen($module)-4); $module = substr($module, 0, dol_strlen($module)-4);
@ -1003,8 +1002,7 @@ else
// Load object modCodeTiers // Load object modCodeTiers
$module=$conf->global->SOCIETE_CODECLIENT_ADDON; $module=(! empty($conf->global->SOCIETE_CODECLIENT_ADDON)?$conf->global->SOCIETE_CODECLIENT_ADDON:'mod_codeclient_leopard');
if (! $module) dolibarr_error('',$langs->trans("ErrorModuleThirdPartyCodeInCompanyModuleNotDefined"));
if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php')
{ {
$module = substr($module, 0, dol_strlen($module)-4); $module = substr($module, 0, dol_strlen($module)-4);
@ -1015,7 +1013,7 @@ else
$res=dol_include_once($dirroot.$module.".php"); $res=dol_include_once($dirroot.$module.".php");
if ($res) break; if ($res) break;
} }
$modCodeClient = new $module; $modCodeClient = new $module($db);
// We verified if the tag prefix is used // We verified if the tag prefix is used
if ($modCodeClient->code_auto) if ($modCodeClient->code_auto)
{ {
@ -1033,7 +1031,7 @@ else
$res=dol_include_once($dirroot.$module.".php"); $res=dol_include_once($dirroot.$module.".php");
if ($res) break; if ($res) break;
} }
$modCodeFournisseur = new $module; $modCodeFournisseur = new $module($db);
// On verifie si la balise prefix est utilisee // On verifie si la balise prefix est utilisee
if ($modCodeFournisseur->code_auto) if ($modCodeFournisseur->code_auto)
{ {