forked from Wavyzz/dolibarr
Merge branch '15.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
@@ -39,15 +39,13 @@ RUN chmod +x /usr/local/bin/docker-run.sh
|
||||
|
||||
RUN pecl install xdebug && docker-php-ext-enable xdebug
|
||||
RUN echo 'zend_extension="/usr/local/lib/php/extensions/no-debug-non-zts-20180731/xdebug.so"' >> ${PHP_INI_DIR}/php.ini
|
||||
RUN echo 'xdebug.remote_autostart=1' >> ${PHP_INI_DIR}/php.ini
|
||||
RUN echo 'xdebug.remote_enable=1' >> ${PHP_INI_DIR}/php.ini
|
||||
RUN echo 'xdebug.default_enable=1' >> ${PHP_INI_DIR}/php.ini
|
||||
#RUN echo 'xdebug.remote_host=docker.host' >> ${PHP_INI_DIR}/php.ini
|
||||
RUN echo 'xdebug.remote_port=9000' >> ${PHP_INI_DIR}/php.ini
|
||||
RUN echo 'xdebug.remote_connect_back=1' >> ${PHP_INI_DIR}/php.ini
|
||||
RUN echo 'xdebug.profiler_enable=0' >> ${PHP_INI_DIR}/php.ini
|
||||
RUN echo 'xdebug.remote_log="/tmp/xdebug.log"' >> ${PHP_INI_DIR}/php.ini
|
||||
#RUN echo 'localhost docker.host' >> /etc/hosts
|
||||
RUN echo 'xdebug.mode=debug' >> ${PHP_INI_DIR}/php.ini
|
||||
RUN echo 'xdebug.start_with_request=yes' >> ${PHP_INI_DIR}/php.ini
|
||||
RUN echo 'xdebug.client_host=host.docker.internal' >> ${PHP_INI_DIR}/php.ini
|
||||
RUN echo 'xdebug.client_port=9003' >> ${PHP_INI_DIR}/php.ini
|
||||
RUN echo 'xdebug.discover_client_host=true' >> ${PHP_INI_DIR}/php.ini
|
||||
#RUN echo 'xdebug.log="/tmp/xdebug.log"' >> ${PHP_INI_DIR}/php.ini
|
||||
RUN echo 'xdebug.idekey="netbeans-xdebug"' >> ${PHP_INI_DIR}/php.ini
|
||||
|
||||
# set up sendmail config, to use maildev
|
||||
RUN echo "account default" > /etc/msmtprc
|
||||
|
||||
@@ -48,6 +48,7 @@ services:
|
||||
- external-pod
|
||||
extra_hosts:
|
||||
- "localhost.localdomain:127.0.0.1"
|
||||
- "host.docker.internal:host-gateway"
|
||||
|
||||
mail:
|
||||
image: maildev/maildev
|
||||
|
||||
@@ -94,9 +94,15 @@ class AdherentType extends CommonObject
|
||||
*/
|
||||
public $amount;
|
||||
|
||||
/** @var string Public note */
|
||||
/**
|
||||
* @var string Public note
|
||||
* @deprecated
|
||||
*/
|
||||
public $note;
|
||||
|
||||
/** @var string Public note */
|
||||
public $note_public;
|
||||
|
||||
/** @var integer Can vote */
|
||||
public $vote;
|
||||
|
||||
@@ -358,6 +364,10 @@ class AdherentType extends CommonObject
|
||||
|
||||
$this->label = trim($this->label);
|
||||
|
||||
if (empty($this->note_public) && !empty($this->note)) { // For backward compatibility
|
||||
$this->note_public = $this->note;
|
||||
}
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent_type ";
|
||||
@@ -368,14 +378,14 @@ class AdherentType extends CommonObject
|
||||
$sql .= "subscription = '".$this->db->escape($this->subscription)."',";
|
||||
$sql .= "amount = ".((empty($this->amount) && $this->amount == '') ? 'null' : ((float) $this->amount)).",";
|
||||
$sql .= "duration = '".$this->db->escape($this->duration_value.$this->duration_unit)."',";
|
||||
$sql .= "note = '".$this->db->escape($this->note)."',";
|
||||
$sql .= "note = '".$this->db->escape($this->note_public)."',";
|
||||
$sql .= "vote = ".(integer) $this->db->escape($this->vote).",";
|
||||
$sql .= "mail_valid = '".$this->db->escape($this->mail_valid)."'";
|
||||
$sql .= " WHERE rowid =".((int) $this->id);
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
if ($result) {
|
||||
$this->description = $this->db->escape($this->note);
|
||||
$this->description = $this->db->escape($this->note_public);
|
||||
|
||||
// Multilangs
|
||||
if (!empty($conf->global->MAIN_MULTILANGS)) {
|
||||
@@ -461,7 +471,7 @@ class AdherentType extends CommonObject
|
||||
{
|
||||
global $langs, $conf;
|
||||
|
||||
$sql = "SELECT d.rowid, d.libelle as label, d.morphy, d.statut as status, d.duration, d.subscription, d.amount, d.mail_valid, d.note, d.vote";
|
||||
$sql = "SELECT d.rowid, d.libelle as label, d.morphy, d.statut as status, d.duration, d.subscription, d.amount, d.mail_valid, d.note as note_public, d.vote";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as d";
|
||||
$sql .= " WHERE d.rowid = ".(int) $rowid;
|
||||
|
||||
@@ -483,7 +493,8 @@ class AdherentType extends CommonObject
|
||||
$this->subscription = $obj->subscription;
|
||||
$this->amount = $obj->amount;
|
||||
$this->mail_valid = $obj->mail_valid;
|
||||
$this->note = $obj->note;
|
||||
$this->note = $obj->note_public; // deprecated
|
||||
$this->note_public = $obj->note_public;
|
||||
$this->vote = $obj->vote;
|
||||
|
||||
// multilangs
|
||||
@@ -792,12 +803,16 @@ class AdherentType extends CommonObject
|
||||
// Object classes
|
||||
$info["objectclass"] = explode(',', $conf->global->LDAP_MEMBER_TYPE_OBJECT_CLASS);
|
||||
|
||||
if (empty($this->note_public) && !empty($this->note)) { // For backward compatibility
|
||||
$this->note_public = $this->note;
|
||||
}
|
||||
|
||||
// Champs
|
||||
if ($this->label && !empty($conf->global->LDAP_MEMBER_TYPE_FIELD_FULLNAME)) {
|
||||
$info[$conf->global->LDAP_MEMBER_TYPE_FIELD_FULLNAME] = $this->label;
|
||||
}
|
||||
if ($this->note && !empty($conf->global->LDAP_MEMBER_TYPE_FIELD_DESCRIPTION)) {
|
||||
$info[$conf->global->LDAP_MEMBER_TYPE_FIELD_DESCRIPTION] = dol_string_nohtmltag($this->note, 0, 'UTF-8', 1);
|
||||
if ($this->note_public && !empty($conf->global->LDAP_MEMBER_TYPE_FIELD_DESCRIPTION)) {
|
||||
$info[$conf->global->LDAP_MEMBER_TYPE_FIELD_DESCRIPTION] = dol_string_nohtmltag($this->note_public, 0, 'UTF-8', 1);
|
||||
}
|
||||
if (!empty($conf->global->LDAP_MEMBER_TYPE_FIELD_GROUPMEMBERS)) {
|
||||
$valueofldapfield = array();
|
||||
@@ -829,7 +844,7 @@ class AdherentType extends CommonObject
|
||||
$this->specimen = 1;
|
||||
|
||||
$this->label = 'MEMBERS TYPE SPECIMEN';
|
||||
$this->note = 'This is a note';
|
||||
$this->note_public = 'This is a public note';
|
||||
$this->mail_valid = 'This is welcome email';
|
||||
$this->subscription = 1;
|
||||
$this->vote = 0;
|
||||
|
||||
@@ -215,7 +215,7 @@ class Subscription extends CommonObject
|
||||
$sql .= " tms,";
|
||||
$sql .= " dateadh as dateh,";
|
||||
$sql .= " datef,";
|
||||
$sql .= " subscription, note, fk_bank";
|
||||
$sql .= " subscription, note as note_public, fk_bank";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."subscription";
|
||||
$sql .= " WHERE rowid=".((int) $rowid);
|
||||
|
||||
@@ -235,7 +235,8 @@ class Subscription extends CommonObject
|
||||
$this->dateh = $this->db->jdate($obj->dateh);
|
||||
$this->datef = $this->db->jdate($obj->datef);
|
||||
$this->amount = $obj->subscription;
|
||||
$this->note = $obj->note;
|
||||
$this->note = $obj->note_public; // deprecated
|
||||
$this->note_public = $obj->note_public;
|
||||
$this->fk_bank = $obj->fk_bank;
|
||||
return 1;
|
||||
} else {
|
||||
@@ -266,10 +267,14 @@ class Subscription extends CommonObject
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (empty($this->note_public) && !empty($this->note)) { // For backward compatibility
|
||||
$this->note_public = $this->note;
|
||||
}
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."subscription SET ";
|
||||
$sql .= " fk_type = ".((int) $this->fk_type).",";
|
||||
$sql .= " fk_adherent = ".((int) $this->fk_adherent).",";
|
||||
$sql .= " note=".($this->note ? "'".$this->db->escape($this->note)."'" : 'null').",";
|
||||
$sql .= " note=".($this->note_public ? "'".$this->db->escape($this->note_public)."'" : 'null').",";
|
||||
$sql .= " subscription = ".price2num($this->amount).",";
|
||||
$sql .= " dateadh='".$this->db->idate($this->dateh)."',";
|
||||
$sql .= " datef='".$this->db->idate($this->datef)."',";
|
||||
|
||||
@@ -400,8 +400,6 @@ print '</td>';
|
||||
print '</tr>';
|
||||
print '</table>';
|
||||
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
|
||||
|
||||
@@ -538,6 +536,8 @@ if (!empty($_SESSION["commandbackuptorun"])) {
|
||||
|
||||
print "</div> <!-- end div center button -->\n";
|
||||
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
print "</div> <!-- end div fichehalfleft -->\n";
|
||||
|
||||
|
||||
@@ -245,6 +245,8 @@ if ($id > 0) {
|
||||
$newcardbutton = '';
|
||||
if (!empty($conf->agenda->enabled)) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
|
||||
$backtopage = $_SERVER['PHP_SELF'].'?id='.$object->id;
|
||||
$out = '&origin='.$object->element.'&originid='.$object->id.'&backtopage='.urlencode($backtopage);
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7595,7 +7595,7 @@ abstract class CommonObject
|
||||
} else { return true; }
|
||||
} elseif (in_array($type, array('double', 'real', 'price'))) {
|
||||
// is numeric
|
||||
if (!$validate->isDuration($fieldValue)) {
|
||||
if (!$validate->isNumeric($fieldValue)) {
|
||||
$this->setFieldError($fieldKey, $validate->error);
|
||||
return false;
|
||||
} else { return true; }
|
||||
|
||||
@@ -55,18 +55,17 @@ class Validate
|
||||
{
|
||||
global $langs;
|
||||
|
||||
if ($outputLang) {
|
||||
if (empty($outputLang)) {
|
||||
$this->outputLang = $langs;
|
||||
} else {
|
||||
$this->outputLang = $outputLang;
|
||||
}
|
||||
|
||||
if (!is_object($this->outputLang) || !method_exists($outputLang, 'load')) {
|
||||
if (!is_object($this->outputLang) || !method_exists($this->outputLang, 'load')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/** @var Translate $outputLang */
|
||||
$outputLang->load('validate');
|
||||
$this->outputLang->loadLangs(array('validate', 'errors'));
|
||||
|
||||
$this->db = $db;
|
||||
}
|
||||
@@ -229,6 +228,21 @@ class Validate
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check numeric validity
|
||||
*
|
||||
* @param mixed $string to validate
|
||||
* @return boolean Validity is ok or not
|
||||
*/
|
||||
public function isNumeric($string)
|
||||
{
|
||||
if (!is_numeric($string)) {
|
||||
$this->error = $this->outputLang->trans('RequireValidNumeric');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for boolean validity
|
||||
*
|
||||
|
||||
@@ -1544,6 +1544,7 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename =
|
||||
// This is when PHP session is ran outside a web server, like from Linux command line (Not always defined, but usefull if OS defined it).
|
||||
$data['ip'] = '???@'.$_SERVER['LOGNAME'];
|
||||
}
|
||||
|
||||
// Loop on each log handler and send output
|
||||
foreach ($conf->loghandlers as $loghandlerinstance) {
|
||||
if ($restricttologhandler && $loghandlerinstance->code != $restricttologhandler) {
|
||||
|
||||
@@ -1252,20 +1252,30 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
|
||||
// Logo
|
||||
$logo = $conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo;
|
||||
if ($this->emetteur->logo) {
|
||||
if (is_readable($logo)) {
|
||||
$height = pdf_getHeightForLogo($logo);
|
||||
$pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto)
|
||||
if (empty($conf->global->PDF_DISABLE_MYCOMPANY_LOGO)) {
|
||||
if ($this->emetteur->logo) {
|
||||
$logodir = $conf->mycompany->dir_output;
|
||||
if (!empty($conf->mycompany->multidir_output[$object->entity])) {
|
||||
$logodir = $conf->mycompany->multidir_output[$object->entity];
|
||||
}
|
||||
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) {
|
||||
$logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small;
|
||||
} else {
|
||||
$logo = $logodir.'/logos/'.$this->emetteur->logo;
|
||||
}
|
||||
if (is_readable($logo)) {
|
||||
$height = pdf_getHeightForLogo($logo);
|
||||
$pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto)
|
||||
} else {
|
||||
$pdf->SetTextColor(200, 0, 0);
|
||||
$pdf->SetFont('', 'B', $default_font_size - 2);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L');
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L');
|
||||
}
|
||||
} else {
|
||||
$pdf->SetTextColor(200, 0, 0);
|
||||
$pdf->SetFont('', 'B', $default_font_size - 2);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L');
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToModuleSetup"), 0, 'L');
|
||||
$text = $this->emetteur->name;
|
||||
$pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, $ltrdirection);
|
||||
}
|
||||
} else {
|
||||
$text = $this->emetteur->name;
|
||||
$pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, $ltrdirection);
|
||||
}
|
||||
|
||||
$pdf->SetFont('', 'B', $default_font_size + 3);
|
||||
|
||||
@@ -1160,20 +1160,30 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
|
||||
// Logo
|
||||
$logo = $conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo;
|
||||
if ($this->emetteur->logo) {
|
||||
if (is_readable($logo)) {
|
||||
$height = pdf_getHeightForLogo($logo);
|
||||
$pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto)
|
||||
if (empty($conf->global->PDF_DISABLE_MYCOMPANY_LOGO)) {
|
||||
if ($this->emetteur->logo) {
|
||||
$logodir = $conf->mycompany->dir_output;
|
||||
if (!empty($conf->mycompany->multidir_output[$object->entity])) {
|
||||
$logodir = $conf->mycompany->multidir_output[$object->entity];
|
||||
}
|
||||
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) {
|
||||
$logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small;
|
||||
} else {
|
||||
$logo = $logodir.'/logos/'.$this->emetteur->logo;
|
||||
}
|
||||
if (is_readable($logo)) {
|
||||
$height = pdf_getHeightForLogo($logo);
|
||||
$pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto)
|
||||
} else {
|
||||
$pdf->SetTextColor(200, 0, 0);
|
||||
$pdf->SetFont('', 'B', $default_font_size - 2);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L');
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L');
|
||||
}
|
||||
} else {
|
||||
$pdf->SetTextColor(200, 0, 0);
|
||||
$pdf->SetFont('', 'B', $default_font_size - 2);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L');
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToModuleSetup"), 0, 'L');
|
||||
$text = $this->emetteur->name;
|
||||
$pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, $ltrdirection);
|
||||
}
|
||||
} else {
|
||||
$text = $this->emetteur->name;
|
||||
$pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, $ltrdirection);
|
||||
}
|
||||
|
||||
$pdf->SetFont('', 'B', $default_font_size + 3);
|
||||
|
||||
@@ -1295,20 +1295,30 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
|
||||
// Logo
|
||||
$logo = $conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo;
|
||||
if ($this->emetteur->logo) {
|
||||
if (is_readable($logo)) {
|
||||
$height = pdf_getHeightForLogo($logo);
|
||||
$pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto)
|
||||
if (empty($conf->global->PDF_DISABLE_MYCOMPANY_LOGO)) {
|
||||
if ($this->emetteur->logo) {
|
||||
$logodir = $conf->mycompany->dir_output;
|
||||
if (!empty($conf->mycompany->multidir_output[$object->entity])) {
|
||||
$logodir = $conf->mycompany->multidir_output[$object->entity];
|
||||
}
|
||||
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) {
|
||||
$logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small;
|
||||
} else {
|
||||
$logo = $logodir.'/logos/'.$this->emetteur->logo;
|
||||
}
|
||||
if (is_readable($logo)) {
|
||||
$height = pdf_getHeightForLogo($logo);
|
||||
$pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto)
|
||||
} else {
|
||||
$pdf->SetTextColor(200, 0, 0);
|
||||
$pdf->SetFont('', 'B', $default_font_size - 2);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L');
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L');
|
||||
}
|
||||
} else {
|
||||
$pdf->SetTextColor(200, 0, 0);
|
||||
$pdf->SetFont('', 'B', $default_font_size - 2);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L');
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L');
|
||||
$text = $this->emetteur->name;
|
||||
$pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, $ltrdirection);
|
||||
}
|
||||
} else {
|
||||
$text = $this->emetteur->name;
|
||||
$pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L');
|
||||
}
|
||||
|
||||
$pdf->SetFont('', 'B', $default_font_size + 3);
|
||||
|
||||
@@ -2365,8 +2365,9 @@ class EmailCollector extends CommonObject
|
||||
// this code action is hook..... for support this call
|
||||
global $hookmanager;
|
||||
|
||||
if (is_object($hookmanager)) {
|
||||
$hookmanager->initHooks(array('emailcollectorcard'));
|
||||
if (!is_object($hookmanager)) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||
$hookmanager = new HookManager($this->db);
|
||||
}
|
||||
|
||||
$parameters = array(
|
||||
|
||||
@@ -1370,29 +1370,35 @@ class CommandeFournisseur extends CommonOrder
|
||||
|
||||
// insert products details into database
|
||||
for ($i = 0; $i < $num; $i++) {
|
||||
$this->special_code = $this->lines[$i]->special_code; // TODO : remove this in 9.0 and add special_code param to addline()
|
||||
$line = $this->lines[$i];
|
||||
if (!is_object($line)) {
|
||||
$line = (object) $line;
|
||||
}
|
||||
|
||||
|
||||
$this->special_code = $line->special_code; // TODO : remove this in 9.0 and add special_code param to addline()
|
||||
|
||||
// This include test on qty if option SUPPLIER_ORDER_WITH_NOPRICEDEFINED is not set
|
||||
$result = $this->addline(
|
||||
$this->lines[$i]->desc,
|
||||
$this->lines[$i]->subprice,
|
||||
$this->lines[$i]->qty,
|
||||
$this->lines[$i]->tva_tx,
|
||||
$this->lines[$i]->localtax1_tx,
|
||||
$this->lines[$i]->localtax2_tx,
|
||||
$this->lines[$i]->fk_product,
|
||||
$line->desc,
|
||||
$line->subprice,
|
||||
$line->qty,
|
||||
$line->tva_tx,
|
||||
$line->localtax1_tx,
|
||||
$line->localtax2_tx,
|
||||
$line->fk_product,
|
||||
0,
|
||||
$this->lines[$i]->ref_fourn, // $this->lines[$i]->ref_fourn comes from field ref into table of lines. Value may ba a ref that does not exists anymore, so we first try with value of product
|
||||
$this->lines[$i]->remise_percent,
|
||||
$line->ref_fourn, // $line->ref_fourn comes from field ref into table of lines. Value may ba a ref that does not exists anymore, so we first try with value of product
|
||||
$line->remise_percent,
|
||||
'HT',
|
||||
0,
|
||||
$this->lines[$i]->product_type,
|
||||
$this->lines[$i]->info_bits,
|
||||
$line->product_type,
|
||||
$line->info_bits,
|
||||
false,
|
||||
$this->lines[$i]->date_start,
|
||||
$this->lines[$i]->date_end,
|
||||
$this->lines[$i]->array_options,
|
||||
$this->lines[$i]->fk_unit
|
||||
$line->date_start,
|
||||
$line->date_end,
|
||||
$line->array_options,
|
||||
$line->fk_unit
|
||||
);
|
||||
if ($result < 0) {
|
||||
dol_syslog(get_class($this)."::create ".$this->error, LOG_WARNING); // do not use dol_print_error here as it may be a functionnal error
|
||||
|
||||
@@ -101,6 +101,10 @@ $extrafields = new ExtraFields($db);
|
||||
// fetch optionals attributes and labels
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
if ($user->socid) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
|
||||
// Load object
|
||||
if ($id > 0 || !empty($ref)) {
|
||||
$ret = $object->fetch($id, $ref);
|
||||
@@ -124,7 +128,9 @@ if ($id > 0 || !empty($ref)) {
|
||||
}
|
||||
}
|
||||
|
||||
$result = restrictedArea($user, 'fournisseur', $id, 'commande_fournisseur', 'commande');
|
||||
// Security check
|
||||
$isdraft = (isset($object->statut) && ($object->statut == $object::STATUS_DRAFT) ? 1 : 0);
|
||||
$result = restrictedArea($user, 'fournisseur', $id, 'commande_fournisseur', 'commande', 'fk_soc', 'rowid', $isdraft);
|
||||
|
||||
// Common permissions
|
||||
$usercanread = ($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire);
|
||||
@@ -842,8 +848,7 @@ if (empty($reshook)) {
|
||||
} else {
|
||||
$db->rollback();
|
||||
|
||||
dol_print_error($db, $object->error);
|
||||
exit;
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -479,5 +479,3 @@ table.tablesupport {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -315,6 +315,7 @@ RequireAtLeastXString = Requires at least %s character(s)
|
||||
RequireXStringMax = Requires %s character(s) max
|
||||
RequireAtLeastXDigits = Requires at least %s digit(s)
|
||||
RequireXDigitsMax = Requires %s digit(s) max
|
||||
RequireValidNumeric = Requires a numeric value
|
||||
RequireValidEmail = Email address is not valid
|
||||
RequireMaxLength = Length must be less than %s chars
|
||||
RequireMinLength = Length must be more than %s char(s)
|
||||
|
||||
@@ -132,7 +132,7 @@ $upload_dir = $conf->mymodule->multidir_output[isset($object->entity) ? $object-
|
||||
// Security check (enable the most restrictive one)
|
||||
//if ($user->socid > 0) accessforbidden();
|
||||
//if ($user->socid > 0) $socid = $user->socid;
|
||||
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
||||
//$isdraft = (isset($object->status) && ($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
||||
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
|
||||
//if (empty($conf->mymodule->enabled)) accessforbidden();
|
||||
//if (!$permissiontoread) accessforbidden();
|
||||
|
||||
@@ -630,7 +630,10 @@ if ($object->id > 0) {
|
||||
errortab3 = [];
|
||||
errortab4 = [];
|
||||
|
||||
if(textarray[0] != ""){
|
||||
textarray = textarray.filter(function(value){
|
||||
return value != "";
|
||||
});
|
||||
if(textarray.some((element) => element != "")){
|
||||
$(".expectedqty").each(function(){
|
||||
id = this.id;
|
||||
console.log("Analyze line "+id+" in inventory");
|
||||
@@ -851,7 +854,7 @@ if ($object->id > 0) {
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Warehouse").'</td>';
|
||||
print '<td>'.$langs->trans("Product").'</td>';
|
||||
if ($conf->productbatch->enabled) {
|
||||
if (!empty($conf->productbatch->enabled)) {
|
||||
print '<td>';
|
||||
print $langs->trans("Batch");
|
||||
print '</td>';
|
||||
@@ -881,7 +884,7 @@ if ($object->id > 0) {
|
||||
print '<td>';
|
||||
print $form->select_produits((GETPOSTISSET('fk_product') ? GETPOST('fk_product', 'int') : $object->fk_product), 'fk_product', '', 0, 0, -1, 2, '', 0, null, 0, '1', 0, 'maxwidth300');
|
||||
print '</td>';
|
||||
if ($conf->productbatch->enabled) {
|
||||
if (!empty($conf->productbatch->enabled)) {
|
||||
print '<td>';
|
||||
print '<input type="text" name="batch" class="maxwidth100" value="'.(GETPOSTISSET('batch') ? GETPOST('batch') : '').'">';
|
||||
print '</td>';
|
||||
@@ -927,6 +930,7 @@ if ($object->id > 0) {
|
||||
}
|
||||
|
||||
// Load real stock we have now
|
||||
$option = '';
|
||||
if (isset($cacheOfProducts[$obj->fk_product])) {
|
||||
$product_static = $cacheOfProducts[$obj->fk_product];
|
||||
} else {
|
||||
@@ -948,7 +952,7 @@ if ($object->id > 0) {
|
||||
print $product_static->getNomUrl(1).' - '.$product_static->label;
|
||||
print '</td>';
|
||||
|
||||
if ($conf->productbatch->enabled) {
|
||||
if (!empty($conf->productbatch->enabled)) {
|
||||
print '<td id="id_'.$obj->rowid.'_batch">';
|
||||
print $obj->batch;
|
||||
print '</td>';
|
||||
@@ -959,7 +963,7 @@ if ($object->id > 0) {
|
||||
$valuetoshow = $obj->qty_stock;
|
||||
// For inventory not yet close, we overwrite with the real value in stock now
|
||||
if ($object->status == $object::STATUS_DRAFT || $object->status == $object::STATUS_VALIDATED) {
|
||||
if ($conf->productbatch->enabled && $product_static->hasbatch()) {
|
||||
if (!empty($conf->productbatch->enabled) && $product_static->hasbatch()) {
|
||||
$valuetoshow = $product_static->stock_warehouse[$obj->fk_warehouse]->detail_batch[$obj->batch]->qty;
|
||||
} else {
|
||||
$valuetoshow = $product_static->stock_warehouse[$obj->fk_warehouse]->real;
|
||||
|
||||
@@ -4870,7 +4870,7 @@ class Societe extends CommonObject
|
||||
{
|
||||
global $langs;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/parntership/class/partnership.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership.class.php';
|
||||
|
||||
|
||||
$this->partnerships[] = array();
|
||||
|
||||
@@ -204,6 +204,7 @@ if (!empty($conf->projet->enabled)) {
|
||||
}
|
||||
} else {
|
||||
if (!empty($object->fk_project)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref .= $proj->getNomUrl(1);
|
||||
|
||||
@@ -524,7 +524,7 @@ class User extends CommonObject
|
||||
$this->admin = $obj->admin;
|
||||
$this->note_public = $obj->note_public;
|
||||
$this->note_private = $obj->note_private;
|
||||
$this->note = $obj->note_private;
|
||||
$this->note = $obj->note_private; // deprecated
|
||||
$this->statut = $obj->statut;
|
||||
$this->photo = $obj->photo;
|
||||
$this->openid = $obj->openid;
|
||||
@@ -1905,7 +1905,7 @@ class User extends CommonObject
|
||||
// Update password
|
||||
if (!empty($this->pass)) {
|
||||
if ($this->pass != $this->pass_indatabase && $this->pass != $this->pass_indatabase_crypted) {
|
||||
// Si mot de passe saisi et different de celui en base
|
||||
// If a new value for password is set and different than the one crypted into database
|
||||
$result = $this->setPassword($user, $this->pass, 0, $notrigger, $nosyncmemberpass);
|
||||
if ($result < 0) {
|
||||
return -5;
|
||||
@@ -3080,7 +3080,7 @@ class User extends CommonObject
|
||||
$this->personal_mobile = '0999999996';
|
||||
$this->admin = 0;
|
||||
$this->login = 'dolibspec';
|
||||
$this->pass = 'dolibspec';
|
||||
$this->pass = 'dolibSpec+@123';
|
||||
//$this->pass_indatabase='dolibspec'; Set after a fetch
|
||||
//$this->pass_indatabase_crypted='e80ca5a88c892b0aaaf7e154853bccab'; Set after a fetch
|
||||
$this->datec = $now;
|
||||
|
||||
@@ -143,11 +143,13 @@ class UserTest extends PHPUnit\Framework\TestCase
|
||||
$langs=$this->savlangs;
|
||||
$db=$this->savdb;
|
||||
|
||||
print __METHOD__." USER_PASSWORD_GENERATED=".getDolGlobalString('USER_PASSWORD_GENERATED')."\n";
|
||||
|
||||
$localobject=new User($this->savdb);
|
||||
$localobject->initAsSpecimen();
|
||||
$result=$localobject->create($user);
|
||||
|
||||
$this->assertLessThan($result, 0);
|
||||
$this->assertLessThan($result, 0, 'Creation of user has failed: '.$localobject->error);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
# Remove this line and replace the ABC with X5 to get a file that is detected by antiviruses.
|
||||
ABO!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
|
||||
# Remove this line and replace the "AB" with "X5" at begin of line to get a file that is detected by antiviruses.
|
||||
ABO!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
|
||||
|
||||
Reference in New Issue
Block a user