forked from Wavyzz/dolibarr
Fix: Les paramtres des factures n'tait pas ditables (constantes non visibles)
This commit is contained in:
@@ -101,7 +101,7 @@ class DolibarrModules
|
||||
$type = $this->const[$key][1];
|
||||
$val = $this->const[$key][2];
|
||||
$note = $this->const[$key][3];
|
||||
$visible= $this->const[$key][4]||'0';
|
||||
$visible= $this->const[$key][4];
|
||||
|
||||
$sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."const WHERE name ='".$name."'";
|
||||
|
||||
@@ -112,16 +112,18 @@ class DolibarrModules
|
||||
|
||||
if ($row[0] == 0)
|
||||
{
|
||||
// Si non trouve // '$visible'
|
||||
if (strlen($note)){
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."const (name,type,value,note,visible) VALUES ('$name','$type','$val','$note',0);";
|
||||
}elseif (strlen($val))
|
||||
if (! $visible) $visible='0';
|
||||
if (strlen($note))
|
||||
{
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."const (name,type,value,visible) VALUES ('$name','$type','$val',0);";
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."const (name,type,value,note,visible) VALUES ('$name','$type','$val','$note','$visible');";
|
||||
}
|
||||
elseif (strlen($val))
|
||||
{
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."const (name,type,value,visible) VALUES ('$name','$type','$val','$visible');";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."const (name,type,visible) VALUES ('$name','$type',0);";
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."const (name,type,visible) VALUES ('$name','$type','$visible');";
|
||||
}
|
||||
|
||||
if (! $this->db->query($sql) )
|
||||
|
||||
@@ -77,30 +77,49 @@ class modFacture extends DolibarrModules
|
||||
$this->const[0][0] = "FAC_PDF_INTITULE";
|
||||
$this->const[0][1] = "chaine";
|
||||
$this->const[0][2] = "Facture Dolibarr";
|
||||
$this->const[0][4] = 1;
|
||||
|
||||
$this->const[1][0] = "FAC_PDF_ADRESSE";
|
||||
$this->const[1][1] = "texte";
|
||||
$this->const[1][2] = "Adresse";
|
||||
$this->const[1][4] = 1;
|
||||
|
||||
$this->const[2][0] = "FAC_PDF_TEL";
|
||||
$this->const[2][1] = "chaine";
|
||||
$this->const[2][2] = "02 97 42 42 42";
|
||||
$this->const[2][4] = 1;
|
||||
|
||||
$this->const[3][0] = "FAC_PDF_FAX";
|
||||
$this->const[3][1] = "chaine";
|
||||
$this->const[3][2] = "02 97 00 00 00";
|
||||
$this->const[3][4] = 1;
|
||||
|
||||
$this->const[4][0] = "FAC_PDF_INTITULE2";
|
||||
$this->const[4][0] = "FAC_PDF_MEL";
|
||||
$this->const[4][1] = "chaine";
|
||||
$this->const[4][2] = "";
|
||||
$this->const[4][2] = "02 97 00 00 00";
|
||||
$this->const[4][4] = 1;
|
||||
|
||||
$this->const[5][0] = "FACTURE_ADDON_PDF";
|
||||
$this->const[5][0] = "FAC_PDF_WWW";
|
||||
$this->const[5][1] = "chaine";
|
||||
$this->const[5][2] = "bulot";
|
||||
$this->const[5][2] = "www.masociete.com";
|
||||
$this->const[5][4] = 1;
|
||||
|
||||
$this->const[6][0] = "FACTURE_ADDON";
|
||||
$this->const[6][0] = "FAC_PDF_LOGO";
|
||||
$this->const[6][1] = "chaine";
|
||||
$this->const[6][2] = "pluton";
|
||||
$this->const[6][2] = "/documents/logo/mylogo.png";
|
||||
$this->const[6][4] = 1;
|
||||
|
||||
$this->const[7][0] = "FACTURE_ADDON_PDF";
|
||||
$this->const[7][1] = "chaine";
|
||||
$this->const[7][2] = "bulot";
|
||||
|
||||
$this->const[7][0] = "FACTURE_ADDON";
|
||||
$this->const[7][1] = "chaine";
|
||||
$this->const[7][2] = "pluton";
|
||||
|
||||
$this->const[8][0] = "FAC_FORCE_DATE_VALIDATION";
|
||||
$this->const[8][1] = "yesno";
|
||||
$this->const[8][2] = "0";
|
||||
|
||||
// Boites
|
||||
$this->boxes = array();
|
||||
|
||||
Reference in New Issue
Block a user