Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
This commit is contained in:
commit
3fe9b6b57c
@ -1439,6 +1439,10 @@ if ($id > 0) {
|
||||
$("#fullday").change(function() {
|
||||
setdatefields();
|
||||
});
|
||||
$("#actioncode").change(function() {
|
||||
if ($("#actioncode").val() == \'AC_RDV\') $("#dateend").addClass("fieldrequired");
|
||||
else $("#dateend").removeClass("fieldrequired");
|
||||
});
|
||||
})';
|
||||
print '</script>'."\n";
|
||||
}
|
||||
@ -1483,7 +1487,12 @@ if ($id > 0) {
|
||||
print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td colspan="3"><input type="checkbox" id="fullday" name="fullday" '.($object->fulldayevent ? ' checked' : '').'></td></tr>';
|
||||
|
||||
// Date start - end
|
||||
print '<tr><td class="nowrap"><span class="fieldrequired">'.$langs->trans("DateActionStart").' - '.$langs->trans("DateActionEnd").'</span></td><td colspan="3">';
|
||||
print '<tr><td class="nowrap">';
|
||||
print '<span class="fieldrequired">'.$langs->trans("DateActionStart").'</span>';
|
||||
print ' - ';
|
||||
print '<span id="dateend"'.($object->type_code == 'AC_RDV' ? ' class="fieldrequired"' : '').'>'.$langs->trans("DateActionEnd").'</span>';
|
||||
print '</td><td td colspan="3">';
|
||||
//print '<tr><td class="nowrap"><span class="fieldrequired">'.$langs->trans("DateActionStart").' - '.$langs->trans("DateActionEnd").'</span></td><td colspan="3">';
|
||||
if (GETPOST("afaire") == 1) {
|
||||
print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 0, "action", 1, 1, 0, 'fulldaystart', '', '', '', 1, '', '', 'tzuser');
|
||||
} elseif (GETPOST("afaire") == 2) {
|
||||
|
||||
@ -231,8 +231,11 @@ if (empty($reshook)) {
|
||||
// Remove line
|
||||
$result = $object->deleteline($lineid);
|
||||
// reorder lines
|
||||
if ($result) {
|
||||
if ($result > 0) {
|
||||
$object->line_order(true);
|
||||
} else {
|
||||
$langs->load("errors");
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
||||
|
||||
@ -980,6 +980,8 @@ class Propal extends CommonObject
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
} else {
|
||||
$this->error = $line->error;
|
||||
$this->errors = $line->errors;
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
@ -4166,36 +4168,40 @@ class PropaleLigne extends CommonObjectLine
|
||||
$error = 0;
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."propaldet WHERE rowid = ".((int) $this->rowid);
|
||||
dol_syslog("PropaleLigne::delete", LOG_DEBUG);
|
||||
if ($this->db->query($sql)) {
|
||||
// Remove extrafields
|
||||
if (!$error) {
|
||||
$this->id = $this->rowid;
|
||||
$result = $this->deleteExtraFields();
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR);
|
||||
}
|
||||
if (!$notrigger) {
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('LINEPROPAL_DELETE', $user);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
// End call triggers
|
||||
|
||||
if (!$error && !$notrigger) {
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('LINEPROPAL_DELETE', $user);
|
||||
if ($result < 0) {
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
if (!$error) {
|
||||
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "propaldet WHERE rowid = " . ((int) $this->rowid);
|
||||
dol_syslog("PropaleLigne::delete", LOG_DEBUG);
|
||||
if ($this->db->query($sql)) {
|
||||
// Remove extrafields
|
||||
if (!$error) {
|
||||
$this->id = $this->rowid;
|
||||
$result = $this->deleteExtraFields();
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
dol_syslog(get_class($this) . "::delete error -4 " . $this->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->error = $this->db->error() . " sql=" . $sql;
|
||||
$error++;
|
||||
}
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
$this->db->commit();
|
||||
|
||||
return 1;
|
||||
} else {
|
||||
$this->error = $this->db->error()." sql=".$sql;
|
||||
if ($error) {
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
} else {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user