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

This commit is contained in:
atm-lena 2020-09-01 09:43:14 +02:00
commit d2ed43d913
9 changed files with 45 additions and 26 deletions

View File

@ -466,6 +466,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<input type="hidden" name="id" value="'.$object->id.'">'; print '<input type="hidden" name="id" value="'.$object->id.'">';
// Filters // Filters
print '<div class="div-table-responsive">';
print '<table class="border centpercent tableforfield">'; print '<table class="border centpercent tableforfield">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Filters").'</td><td></td><td></td>'; print '<td>'.$langs->trans("Filters").'</td><td></td><td></td>';
@ -499,7 +500,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
'isnotanswer'=>array('label'=>'IsNotAnAnswer', 'data-noparam'=>1), 'isnotanswer'=>array('label'=>'IsNotAnAnswer', 'data-noparam'=>1),
'isanswer'=>array('label'=>'IsAnAnswer', 'data-noparam'=>1) 'isanswer'=>array('label'=>'IsAnAnswer', 'data-noparam'=>1)
); );
print $form->selectarray('filtertype', $arrayoftypes, '', 1, 0, 0, '', 1, 0, 0, '', '', 0, '', 2); print $form->selectarray('filtertype', $arrayoftypes, '', 1, 0, 0, '', 1, 0, 0, '', 'maxwidth500', 0, '', 2);
print "\n"; print "\n";
print '<script>'; print '<script>';
@ -544,10 +545,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '</tr>'; print '</tr>';
print '</table>'; print '</table>';
print '</div>';
print '<div class="clearboth"></div><br>'; print '<div class="clearboth"></div><br>';
// Operations // Operations
print '<div class="div-table-responsive">';
print '<table id="tablelines" class="noborder noshadow tableforfield">'; print '<table id="tablelines" class="noborder noshadow tableforfield">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("EmailcollectorOperations").'</td><td></td><td></td><td></td>'; print '<td>'.$langs->trans("EmailcollectorOperations").'</td><td></td><td></td><td></td>';
@ -635,6 +638,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '</tr>'; print '</tr>';
print '</table>'; print '</table>';
print '</div>';
if (!empty($conf->use_javascript_ajax)) { if (!empty($conf->use_javascript_ajax)) {
$urltorefreshaftermove = DOL_URL_ROOT.'/admin/emailcollector_card.php?id='.$id; $urltorefreshaftermove = DOL_URL_ROOT.'/admin/emailcollector_card.php?id='.$id;

View File

@ -1579,9 +1579,11 @@ if ($id > 0)
} }
// Priority // Priority
if (! empty($conf->global->AGENDA_SUPPORT_PRIORITY_IN_EVENTS)) {
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("Priority").'</td><td>'; print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("Priority").'</td><td>';
print '<input type="text" name="priority" value="'.($object->priority ? $object->priority : '').'" size="5">'; print '<input type="text" name="priority" value="'.($object->priority ? $object->priority : '').'" size="5">';
print '</td></tr>'; print '</td></tr>';
}
// Object linked // Object linked
if (!empty($object->fk_element) && !empty($object->elementtype)) if (!empty($object->fk_element) && !empty($object->elementtype))

View File

@ -716,7 +716,7 @@ if ($resql)
// Label // Label
if (!empty($arrayfields['a.label']['checked'])) { if (!empty($arrayfields['a.label']['checked'])) {
print '<td class="tdoverflowmax200">'; print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($actionstatic->label).'">';
print $actionstatic->label; print $actionstatic->label;
print '</td>'; print '</td>';
} }

View File

@ -32,7 +32,7 @@
/** /**
* Class to send emails (with attachments or not) * Class to send emails (with attachments or not)
* Usage: $mailfile = new CMailFile($subject,$sendto,$replyto,$message,$filepath,$mimetype,$filename,$cc,$ccc,$deliveryreceipt,$msgishtml,$errors_to,$css,$trackid,$moreinheader,$sendcontext); * Usage: $mailfile = new CMailFile($subject,$sendto,$replyto,$message,$filepath,$mimetype,$filename,$cc,$ccc,$deliveryreceipt,$msgishtml,$errors_to,$css,$trackid,$moreinheader,$sendcontext,$replyto);
* $mailfile->sendfile(); * $mailfile->sendfile();
*/ */
class CMailFile class CMailFile
@ -195,7 +195,7 @@ class CMailFile
// On defini alternative_boundary // On defini alternative_boundary
$this->alternative_boundary = 'mul_'.dol_hash(uniqid("dolibarr3"), 3); // Force md5 hash (does not contains special chars) $this->alternative_boundary = 'mul_'.dol_hash(uniqid("dolibarr3"), 3); // Force md5 hash (does not contains special chars)
dol_syslog("CMailFile::CMailfile: sendmode=".$this->sendmode." charset=".$conf->file->character_set_client." from=$from, to=$to, addr_cc=$addr_cc, addr_bcc=$addr_bcc, errors_to=$errors_to, trackid=$trackid sendcontext=$sendcontext", LOG_DEBUG); dol_syslog("CMailFile::CMailfile: sendmode=".$this->sendmode." charset=".$conf->file->character_set_client." from=$from, to=$to, addr_cc=$addr_cc, addr_bcc=$addr_bcc, errors_to=$errors_to, replyto=$replyto trackid=$trackid sendcontext=$sendcontext", LOG_DEBUG);
dol_syslog("CMailFile::CMailfile: subject=".$subject.", deliveryreceipt=".$deliveryreceipt.", msgishtml=".$msgishtml, LOG_DEBUG); dol_syslog("CMailFile::CMailfile: subject=".$subject.", deliveryreceipt=".$deliveryreceipt.", msgishtml=".$msgishtml, LOG_DEBUG);
if (empty($subject)) if (empty($subject))
@ -358,7 +358,7 @@ class CMailFile
$smtps->setTO($this->getValidAddress($this->addr_to, 0, 1)); $smtps->setTO($this->getValidAddress($this->addr_to, 0, 1));
$smtps->setFrom($this->getValidAddress($this->addr_from, 0, 1)); $smtps->setFrom($this->getValidAddress($this->addr_from, 0, 1));
$smtps->setTrackId($this->trackid); $smtps->setTrackId($this->trackid);
$smtps->setReplyTo($this->getValidAddress($this->replyto, 0, 1)); $smtps->setReplyTo($this->getValidAddress($this->reply_to, 0, 1));
if (!empty($moreinheader)) $smtps->setMoreInHeader($moreinheader); if (!empty($moreinheader)) $smtps->setMoreInHeader($moreinheader);
@ -527,7 +527,7 @@ class CMailFile
if (! empty($this->addr_cc)) $this->message->setCc($this->getArrayAddress($this->addr_cc)); if (! empty($this->addr_cc)) $this->message->setCc($this->getArrayAddress($this->addr_cc));
if (! empty($this->addr_bcc)) $this->message->setBcc($this->getArrayAddress($this->addr_bcc)); if (! empty($this->addr_bcc)) $this->message->setBcc($this->getArrayAddress($this->addr_bcc));
//if (! empty($errors_to)) $this->message->setErrorsTo($this->getArrayAddress($errors_to); //if (! empty($this->errors_to)) $this->message->setErrorsTo($this->getArrayAddress($this->errors_to));
if (isset($this->deliveryreceipt) && $this->deliveryreceipt == 1) $this->message->setReadReceiptTo($this->getArrayAddress($this->addr_from)); if (isset($this->deliveryreceipt) && $this->deliveryreceipt == 1) $this->message->setReadReceiptTo($this->getArrayAddress($this->addr_from));
} else { } else {
// Send mail method not correctly defined // Send mail method not correctly defined

View File

@ -302,3 +302,7 @@ ALTER TABLE llx_actioncomm_reminder ADD COLUMN entity integer NOT NULL DEFAULT 1
ALTER TABLE llx_actioncomm_reminder ADD COLUMN fk_actioncomm integer NOT NULL; ALTER TABLE llx_actioncomm_reminder ADD COLUMN fk_actioncomm integer NOT NULL;
ALTER TABLE llx_actioncomm_reminder ADD COLUMN fk_email_template integer; ALTER TABLE llx_actioncomm_reminder ADD COLUMN fk_email_template integer;
ALTER TABLE llx_actioncomm_reminder DROP INDEX uk_actioncomm_reminder_unique, ADD UNIQUE uk_actioncomm_reminder_unique (fk_user, typeremind, offsetvalue, offsetunit, fk_actioncomm); ALTER TABLE llx_actioncomm_reminder DROP INDEX uk_actioncomm_reminder_unique, ADD UNIQUE uk_actioncomm_reminder_unique (fk_user, typeremind, offsetvalue, offsetunit, fk_actioncomm);
ALTER TABLE llx_inventorydet ADD UNIQUE uk_inventorydet(fk_inventory, fk_warehouse, fk_product, batch);

View File

@ -20,3 +20,6 @@
ALTER TABLE llx_inventorydet ADD INDEX idx_inventorydet_tms (tms); ALTER TABLE llx_inventorydet ADD INDEX idx_inventorydet_tms (tms);
ALTER TABLE llx_inventorydet ADD INDEX idx_inventorydet_datec (datec); ALTER TABLE llx_inventorydet ADD INDEX idx_inventorydet_datec (datec);
ALTER TABLE llx_inventorydet ADD INDEX idx_inventorydet_fk_inventory (fk_inventory); ALTER TABLE llx_inventorydet ADD INDEX idx_inventorydet_fk_inventory (fk_inventory);
ALTER TABLE llx_inventorydet ADD UNIQUE uk_inventorydet(fk_inventory, fk_warehouse, fk_product, batch);

View File

@ -19,15 +19,15 @@
CREATE TABLE llx_inventorydet CREATE TABLE llx_inventorydet
( (
rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY, rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY,
datec datetime DEFAULT NULL, datec datetime DEFAULT NULL,
tms timestamp, tms timestamp,
fk_inventory integer DEFAULT 0, fk_inventory integer DEFAULT 0,
fk_warehouse integer DEFAULT 0, fk_warehouse integer DEFAULT 0,
fk_product integer DEFAULT 0, fk_product integer DEFAULT 0,
batch varchar(128) DEFAULT NULL, -- Lot or serial number batch varchar(128) DEFAULT NULL, -- Lot or serial number
qty_stock double DEFAULT NULL, -- The targeted value. can be filled during draft edition qty_stock double DEFAULT NULL, -- The targeted value. can be filled during draft edition
qty_view double DEFAULT NULL, -- must be filled once regulation is done qty_view double DEFAULT NULL, -- must be filled once regulation is done
qty_regulated double DEFAULT NULL -- must be filled once regulation is done qty_regulated double DEFAULT NULL -- must be filled once regulation is done
) )
ENGINE=innodb; ENGINE=innodb;

View File

@ -238,5 +238,6 @@ StockAtDatePastDesc=You can view here the stock (real stock) at a given date in
StockAtDateFutureDesc=You can view here the stock (virtual stock) at a given date in future StockAtDateFutureDesc=You can view here the stock (virtual stock) at a given date in future
CurrentStock=Current stock CurrentStock=Current stock
InventoryRealQtyHelp=Set value to 0 to reset qty<br>Keep field empty, or remove line, to keep unchanged InventoryRealQtyHelp=Set value to 0 to reset qty<br>Keep field empty, or remove line, to keep unchanged
UpdateByScaning=Update by scaning
UpdateByScaningProductBarcode=Update by scan (product barcode) UpdateByScaningProductBarcode=Update by scan (product barcode)
UpdateByScaningLot=Update by scan (lot|serial barcode) UpdateByScaningLot=Update by scan (lot|serial barcode)

View File

@ -132,7 +132,8 @@ if (empty($reshook))
$error++; $error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Product")), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Product")), null, 'errors');
} }
if (! $error) {
if (! $error && ! empty($conf->productbatch->enabled)) {
$tmpproduct = new Product($db); $tmpproduct = new Product($db);
$result = $tmpproduct->fetch($fk_product); $result = $tmpproduct->fetch($fk_product);
@ -157,10 +158,14 @@ if (empty($reshook))
$result = $tmp->create($user); $result = $tmp->create($user);
if ($result < 0) { if ($result < 0) {
if ($db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
setEventMessages($langs->trans("DuplicateRecord"), null, 'errors');
} else {
dol_print_error($db, $tmp->error, $tmp->errors); dol_print_error($db, $tmp->error, $tmp->errors);
} }
} }
} }
}
} }
@ -336,16 +341,16 @@ if ($object->id > 0)
{ {
if ($permissiontoadd) if ($permissiontoadd)
{ {
//print '<a href="'.DOL_URL_ROOT.'/product/inventory/inventory.php?id='.$object->id.'&action=addline" class="butAction">'.$langs->trans("AddLine").'</a>'; /*
if ($conf->barcode->enabled) { if ($conf->barcode->enabled) {
print '<a href="#" class="butAction">'.$langs->trans("UpdateByScaningProductBarcode").'</a>'; print '<a href="#" class="butAction">'.$langs->trans("UpdateByScaningProductBarcode").'</a>';
} }
if ($conf->productbatch->enabled) { if ($conf->productbatch->enabled) {
print '<a href="#" class="butAction">'.$langs->trans('UpdateByScaningLot').'</a>'; print '<a href="#" class="butAction">'.$langs->trans('UpdateByScaningLot').'</a>';
}*/
if ($conf->barcode->enabled || $conf->productbatch->enabled) {
print '<a href="#" class="butAction">'.$langs->trans("UpdateByScaning").'</a>';
} }
//print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=savecurrent">'.$langs->trans("Save").'</a>'."\n";
} else { } else {
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Save').'</a>'."\n"; print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Save').'</a>'."\n";
} }