Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into

develop
This commit is contained in:
Laurent Destailleur 2020-11-29 19:42:42 +01:00
commit de98ef1718
7 changed files with 85 additions and 64 deletions

View File

@ -137,10 +137,18 @@ abstract class ModeleProductCode
global $langs;
$langs->load("admin");
if ($this->version == 'development') return $langs->trans("VersionDevelopment");
if ($this->version == 'experimental') return $langs->trans("VersionExperimental");
if ($this->version == 'dolibarr') return DOL_VERSION;
if ($this->version) return $this->version;
if ($this->version == 'development') {
return $langs->trans("VersionDevelopment");
}
if ($this->version == 'experimental') {
return $langs->trans("VersionExperimental");
}
if ($this->version == 'dolibarr') {
return DOL_VERSION;
}
if ($this->version) {
return $this->version;
}
return $langs->trans("NotAvailable");
}
@ -159,12 +167,10 @@ abstract class ModeleProductCode
$sql = "";
$resql = $db->query($sql);
if ($resql)
{
if ($resql) {
$num = $db->num_rows($resql);
$i = 0;
while ($i < $num)
{
while ($i < $num) {
$row = $db->fetch_row($resql);
$liste[$row[0]] = $row[1];
$i++;
@ -188,37 +194,37 @@ abstract class ModeleProductCode
global $conf;
$langs->load("admin");
$strikestart = '';
$strikeend = '';
if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) {
$strikestart = '<strike>';
$strikeend = '</strike> '.yn(1, 1, 2).' ('.$langs->trans("ForcedToByAModule", $langs->transnoentities("yes")).')';
}
$s = '';
if ($type == -1) {
$s .= $langs->trans("Name").': <b>'.$this->getNom($langs).'</b><br>';
$s .= $langs->trans("Version").': <b>'.$this->getVersion().'</b><br>';
} elseif ($type == 0) {
$s .= $langs->trans("ProductCodeDesc").'<br>';
} elseif ($type == 1) {
$s .= $langs->trans("ServiceCodeDesc").'<br>';
}
if ($type != -1) {
$s .= $langs->trans("ValidityControledByModule").': <b>'.$this->getNom($langs).'</b><br>';
}
if ($type == 0) $s .= $langs->trans("ProductCodeDesc").'<br>';
if ($type == 1) $s .= $langs->trans("ServiceCodeDesc").'<br>';
if ($type != -1) $s .= $langs->trans("ValidityControledByModule").': <b>'.$this->getNom($langs).'</b><br>';
$s .= '<br>';
$s .= '<u>'.$langs->trans("ThisIsModuleRules").':</u><br>';
if ($type == 0)
{
$s .= $langs->trans("RequiredIfProduct").': ';
if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) $s .= '<strike>';
$s .= yn(!$this->code_null, 1, 2);
if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) $s .= '</strike> '.yn(1, 1, 2).' ('.$langs->trans("ForcedToByAModule", $langs->transnoentities("yes")).')';
if ($type == 0) {
$s .= $langs->trans("RequiredIfProduct").': '.$strikestart;
$s .= yn(!$this->code_null, 1, 2).$strikeend;
$s .= '<br>';
} elseif ($type == 1)
{
$s .= $langs->trans("RequiredIfService").': ';
if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) $s .= '<strike>';
$s .= yn(!$this->code_null, 1, 2);
if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) $s .= '</strike> '.yn(1, 1, 2).' ('.$langs->trans("ForcedToByAModule", $langs->transnoentities("yes")).')';
} elseif ($type == 1) {
$s .= $langs->trans("RequiredIfService").': '.$strikestart;
$s .= yn(!$this->code_null, 1, 2).$strikeend;
$s .= '<br>';
} elseif ($type == -1)
{
$s .= $langs->trans("Required").': ';
if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) $s .= '<strike>';
$s .= yn(!$this->code_null, 1, 2);
if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) $s .= '</strike> '.yn(1, 1, 2).' ('.$langs->trans("ForcedToByAModule", $langs->transnoentities("yes")).')';
} elseif ($type == -1) {
$s .= $langs->trans("Required").': '.$strikestart;
$s .= yn(!$this->code_null, 1, 2).$strikeend;
$s .= '<br>';
}
$s .= $langs->trans("CanBeModifiedIfOk").': ';
@ -227,16 +233,18 @@ abstract class ModeleProductCode
$s .= $langs->trans("CanBeModifiedIfKo").': '.yn($this->code_modifiable_invalide, 1, 2).'<br>';
$s .= $langs->trans("AutomaticCode").': '.yn($this->code_auto, 1, 2).'<br>';
$s .= '<br>';
if ($type == 0 || $type == -1)
{
if ($type == 0 || $type == -1) {
$nextval = $this->getNextValue($product, 0);
if (empty($nextval)) $nextval = $langs->trans("Undefined");
if (empty($nextval)) {
$nextval = $langs->trans("Undefined");
}
$s .= $langs->trans("NextValue").($type == -1 ? ' ('.$langs->trans("Product").')' : '').': <b>'.$nextval.'</b><br>';
}
if ($type == 1 || $type == -1)
{
if ($type == 1 || $type == -1) {
$nextval = $this->getNextValue($product, 1);
if (empty($nextval)) $nextval = $langs->trans("Undefined");
if (empty($nextval)) {
$nextval = $langs->trans("Undefined");
}
$s .= $langs->trans("NextValue").($type == -1 ? ' ('.$langs->trans("Service").')' : '').': <b>'.$nextval.'</b>';
}
return $s;

View File

@ -85,8 +85,10 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode
$s1 = $form->textwithpicto('<input type="text" class="flat" size="4" name="value1" value="'.$conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER.'">', $tooltip, 1, 1);
$s2 = $form->textwithpicto('<input type="text" class="flat" size="4" name="value2" value="'.$conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER.'">', $tooltip, 1, 1);
$texte .= '<tr><td>';
$texte .= $langs->trans("ModuleCompanyCodeCustomer".$this->name, $s2)."<br>\n";
$texte .= $langs->trans("ModuleCompanyCodeSupplier".$this->name, $s1)."<br>\n";
// trans remove html entities
$texte .= $langs->trans("ModuleCompanyCodeCustomer".$this->name, '{s2}')."<br>\n";
$texte .= $langs->trans("ModuleCompanyCodeSupplier".$this->name, '{s1}')."<br>\n";
$texte = str_replace(array('{s1}', '{s2}'), array($s1, $s2), $texte);
$texte .= "<br>\n";
if (!isset($conf->global->COMPANY_AQUARIUM_REMOVE_SPECIAL) || !empty($conf->global->$conf->global->COMPANY_AQUARIUM_REMOVE_SPECIAL)) $texte .= $langs->trans('RemoveSpecialChars').' = '.yn(1)."<br>\n";
//if (! empty($conf->global->COMPANY_AQUARIUM_REMOVE_ALPHA)) $texte.=$langs->trans('COMPANY_AQUARIUM_REMOVE_ALPHA').' = '.yn($conf->global->COMPANY_AQUARIUM_REMOVE_ALPHA)."<br>\n";

View File

@ -99,8 +99,10 @@ class mod_codecompta_digitaria extends ModeleAccountancyCode
$s3 = $form->textwithpicto('<input type="text" class="flat" size="2" name="value3" value="'.$conf->global->COMPANY_DIGITARIA_MASK_NBCHARACTER_SUPPLIER.'">', $tooltip, 1, 1);
$s4 = $form->textwithpicto('<input type="text" class="flat" size="2" name="value4" value="'.$conf->global->COMPANY_DIGITARIA_MASK_NBCHARACTER_CUSTOMER.'">', $tooltip, 1, 1);
$texte .= '<tr><td>';
$texte .= $langs->trans("ModuleCompanyCodeCustomer".$this->name, $s2, $s4)."<br>\n";
$texte .= $langs->trans("ModuleCompanyCodeSupplier".$this->name, $s1, $s3)."<br>\n";
// trans remove html entities
$texte .= $langs->trans("ModuleCompanyCodeCustomer".$this->name, '{s2}', '{s4}')."<br>\n";
$texte .= $langs->trans("ModuleCompanyCodeSupplier".$this->name, '{s1}', '{s3}')."<br>\n";
$texte = str_replace(array('{s1}', '{s2}', '{s3}', '{s4}'), array($s1, $s2, $s3, $s4), $texte);
$texte .= "<br>\n";
// Remove special char if COMPANY_DIGITARIA_REMOVE_SPECIAL is set to 1 or not set (default)
if (!isset($conf->global->COMPANY_DIGITARIA_REMOVE_SPECIAL) || !empty($conf->global->$conf->global->COMPANY_DIGITARIA_REMOVE_SPECIAL)) $texte .= $langs->trans('RemoveSpecialChars').' = '.yn(1)."<br>\n";

View File

@ -168,12 +168,10 @@ abstract class ModeleThirdPartyCode
$sql = "";
$resql = $db->query($sql);
if ($resql)
{
if ($resql) {
$num = $db->num_rows($resql);
$i = 0;
while ($i < $num)
{
while ($i < $num) {
$row = $db->fetch_row($resql);
$liste[$row[0]] = $row[1];
$i++;
@ -197,6 +195,12 @@ abstract class ModeleThirdPartyCode
global $conf;
$langs->load("admin");
$strikestart = '';
$strikeend = '';
if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) {
$strikestart = '<strike>';
$strikeend = '</strike> '.yn(1, 1, 2).' ('.$langs->trans("ForcedToByAModule", $langs->transnoentities("yes")).')';
}
$s = '';
if ($type == -1) {
@ -207,28 +211,23 @@ abstract class ModeleThirdPartyCode
$s .= $langs->trans("CustomerCodeDesc").'<br>';
} elseif ($type == 1) {
$s .= $langs->trans("SupplierCodeDesc").'<br>';
} elseif ($type != -1) {
}
if ($type != -1) {
$s .= $langs->trans("ValidityControledByModule").': <b>'.$this->getNom($langs).'</b><br>';
}
$s .= '<br>';
$s .= '<u>'.$langs->trans("ThisIsModuleRules").':</u><br>';
if ($type == 0) {
$s .= $langs->trans("RequiredIfCustomer").': ';
if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) $s .= '<strike>';
$s .= yn(!$this->code_null, 1, 2);
if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) $s .= '</strike> '.yn(1, 1, 2).' ('.$langs->trans("ForcedToByAModule", $langs->transnoentities("yes")).')';
$s .= $langs->trans("RequiredIfCustomer").': '.$strikestart;
$s .= yn(!$this->code_null, 1, 2).$strikeend;
$s .= '<br>';
} elseif ($type == 1) {
$s .= $langs->trans("RequiredIfSupplier").': ';
if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) $s .= '<strike>';
$s .= yn(!$this->code_null, 1, 2);
if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) $s .= '</strike> '.yn(1, 1, 2).' ('.$langs->trans("ForcedToByAModule", $langs->transnoentities("yes")).')';
$s .= $langs->trans("RequiredIfSupplier").': '.$strikestart;
$s .= yn(!$this->code_null, 1, 2).$strikeend;
$s .= '<br>';
} elseif ($type == -1) {
$s .= $langs->trans("Required").': ';
if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) $s .= '<strike>';
$s .= yn(!$this->code_null, 1, 2);
if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) $s .= '</strike> '.yn(1, 1, 2).' ('.$langs->trans("ForcedToByAModule", $langs->transnoentities("yes")).')';
$s .= $langs->trans("Required").': '.$strikestart;
$s .= yn(!$this->code_null, 1, 2).$strikeend;
$s .= '<br>';
}
$s .= $langs->trans("CanBeModifiedIfOk").': ';
@ -239,12 +238,16 @@ abstract class ModeleThirdPartyCode
$s .= '<br>';
if ($type == 0 || $type == -1) {
$nextval = $this->getNextValue($soc, 0);
if (empty($nextval)) $nextval = $langs->trans("Undefined");
if (empty($nextval)) {
$nextval = $langs->trans("Undefined");
}
$s .= $langs->trans("NextValue").($type == -1 ? ' ('.$langs->trans("Customer").')' : '').': <b>'.$nextval.'</b><br>';
}
if ($type == 1 || $type == -1) {
$nextval = $this->getNextValue($soc, 1);
if (empty($nextval)) $nextval = $langs->trans("Undefined");
if (empty($nextval)) {
$nextval = $langs->trans("Undefined");
}
$s .= $langs->trans("NextValue").($type == -1 ? ' ('.$langs->trans("Supplier").')' : '').': <b>'.$nextval.'</b>';
}
return $s;
@ -360,13 +363,17 @@ abstract class ModeleAccountancyCode
if ($type == 0 || $type == -1) {
$result = $this->get_code($db, $soc, 'customer');
$nextval = $this->code;
if (empty($nextval)) $nextval = $langs->trans("Undefined");
if (empty($nextval)) {
$nextval = $langs->trans("Undefined");
}
$s .= $langs->trans("NextValue").($type == -1 ? ' ('.$langs->trans("Customer").')' : '').': <b>'.$nextval.'</b><br>';
}
if ($type == 1 || $type == -1) {
$result = $this->get_code($db, $soc, 'supplier');
$nextval = $this->code;
if (empty($nextval)) $nextval = $langs->trans("Undefined");
if (empty($nextval)) {
$nextval = $langs->trans("Undefined");
}
$s .= $langs->trans("NextValue").($type == -1 ? ' ('.$langs->trans("Supplier").')' : '').': <b>'.$nextval.'</b>';
}
return $s;

View File

@ -895,16 +895,16 @@ class EcmFiles extends CommonObject
global $conf, $user;
$this->id = 0;
$this->specimen = 1;
$this->label = '0a1b2c3e4f59999999';
$this->entity = '1';
$this->entity = 1;
$this->filename = 'myspecimenfilefile.pdf';
$this->filepath = '/aaa/bbb';
$this->fullpath_orig = 'c:/file on my disk.pdf';
$this->description = 'This is a long description of file';
$this->keywords = 'key1,key2';
$this->cover = '1';
$this->position = '5';
$this->position = 5;
$this->gen_or_uploaded = 'uploaded';
$this->extraparams = '';
$this->date_c = (dol_now() - 3600 * 24 * 10);

View File

@ -106,6 +106,7 @@ ALTER TABLE llx_user DROP COLUMN googleplus;
ALTER TABLE llx_user DROP COLUMN youtube;
ALTER TABLE llx_user DROP COLUMN whatsapp;
ALTER TABLE llx_user ADD COLUMN datelastpassvalidation datetime;
ALTER TABLE llx_user ADD COLUMN datestartvalidity datetime;
ALTER TABLE llx_user ADD COLUMN dateendvalidity datetime;

View File

@ -80,6 +80,7 @@ create table llx_user
model_pdf varchar(255) DEFAULT NULL,
datelastlogin datetime,
datepreviouslogin datetime,
datelastpassvalidation datetime,
datestartvalidity datetime,
dateendvalidity datetime,
iplastlogin varchar(250),