Skip to content
Snippets Groups Projects
Commit d190e924 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix: Update of type was not working.

parent 8b244b0d
No related branches found
No related tags found
No related merge requests found
...@@ -460,6 +460,7 @@ class ActionComm extends CommonObject ...@@ -460,6 +460,7 @@ class ActionComm extends CommonObject
//print 'eeea'.$this->datep.'-'.(strval($this->datep) != '').'-'.$this->db->idate($this->datep); //print 'eeea'.$this->datep.'-'.(strval($this->datep) != '').'-'.$this->db->idate($this->datep);
$sql = "UPDATE ".MAIN_DB_PREFIX."actioncomm "; $sql = "UPDATE ".MAIN_DB_PREFIX."actioncomm ";
$sql.= " SET percent = '".$this->percentage."'"; $sql.= " SET percent = '".$this->percentage."'";
if ($this->fk_action > 0) $sql.= ", fk_action = '".$this->fk_action."'";
$sql.= ", label = ".($this->label ? "'".$this->db->escape($this->label)."'":"null"); $sql.= ", label = ".($this->label ? "'".$this->db->escape($this->label)."'":"null");
$sql.= ", datep = ".(strval($this->datep)!='' ? "'".$this->db->idate($this->datep)."'" : 'null'); $sql.= ", datep = ".(strval($this->datep)!='' ? "'".$this->db->idate($this->datep)."'" : 'null');
$sql.= ", datep2 = ".(strval($this->datef)!='' ? "'".$this->db->idate($this->datef)."'" : 'null'); $sql.= ", datep2 = ".(strval($this->datef)!='' ? "'".$this->db->idate($this->datef)."'" : 'null');
......
...@@ -311,6 +311,7 @@ if ($action == 'update') ...@@ -311,6 +311,7 @@ if ($action == 'update')
$datep=dol_mktime($fulldayevent?'00':$aphour, $fulldayevent?'00':$apmin, 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]); $datep=dol_mktime($fulldayevent?'00':$aphour, $fulldayevent?'00':$apmin, 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]);
$datef=dol_mktime($fulldayevent?'23':$p2hour, $fulldayevent?'59':$p2min, $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]); $datef=dol_mktime($fulldayevent?'23':$p2hour, $fulldayevent?'59':$p2min, $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]);
$actioncomm->fk_action = dol_getIdFromCode($db, $_POST["actioncode"], 'c_actioncomm');
$actioncomm->label = $_POST["label"]; $actioncomm->label = $_POST["label"];
$actioncomm->datep = $datep; $actioncomm->datep = $datep;
$actioncomm->datef = $datef; $actioncomm->datef = $datef;
...@@ -467,16 +468,7 @@ if ($action == 'create') ...@@ -467,16 +468,7 @@ if ($action == 'create')
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
{ {
print '<tr><td width="30%"><span class="fieldrequired">'.$langs->trans("Type").'</span></b></td><td>'; print '<tr><td width="30%"><span class="fieldrequired">'.$langs->trans("Type").'</span></b></td><td>';
if (GETPOST("actioncode") && ! GETPOST('actioncode')) // Force selection only if not a post that fails $htmlactions->select_type_actions(GETPOST("actioncode")?GETPOST("actioncode"):$actioncomm->type_code, "actioncode","systemauto");
{
print '<input type="hidden" name="actioncode" value="'.GETPOST("actioncode").'">'."\n";
$cactioncomm->fetch(GETPOST("actioncode"));
print $cactioncomm->getNomUrl();
}
else
{
$htmlactions->select_type_actions($actioncomm->type_code, "actioncode","systemauto");
}
print '</td></tr>'; print '</td></tr>';
} }
else print '<input type="hidden" name="actioncode" value="AC_OTH">'; else print '<input type="hidden" name="actioncode" value="AC_OTH">';
...@@ -739,7 +731,9 @@ if ($id > 0) ...@@ -739,7 +731,9 @@ if ($id > 0)
// Type // Type
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
{ {
print '<tr><td class="fieldrequired">'.$langs->trans("Type").'</td><td colspan="3">'.$act->type.'</td></tr>'; print '<tr><td class="fieldrequired">'.$langs->trans("Type").'</td><td colspan="3">';
$htmlactions->select_type_actions(GETPOST("actioncode")?GETPOST("actioncode"):$act->type_code, "actioncode","systemauto");
print '</td></tr>';
} }
// Title // Title
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment