Fix edit of automatic event should keep its type.

This commit is contained in:
Laurent Destailleur 2017-07-08 00:19:30 +02:00
parent fbca244212
commit e1ba69eee0
2 changed files with 14 additions and 5 deletions

View File

@ -955,8 +955,15 @@ if ($id > 0)
// Type of event
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
{
print '<tr><td class="fieldrequired">'.$langs->trans("Type").'</td><td colspan="3">';
$formactions->select_type_actions(GETPOST("actioncode")?GETPOST("actioncode"):$object->type_code, "actioncode","systemauto");
print '<tr><td class="fieldrequired">'.$langs->trans("Type").'</td><td colspan="3">';
if ($object->type_code != 'AC_OTH_AUTO')
{
$formactions->select_type_actions(GETPOST("actioncode")?GETPOST("actioncode"):$object->type_code, "actioncode","systemauto");
}
else
{
print '<input type="hidden" name="actioncode" value="'.$object->type_code.'">'.$langs->trans("Action".$object->type_code);
}
print '</td></tr>';
}

View File

@ -347,11 +347,13 @@ if ($resql)
if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create)
{
$newparam.='&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$year;
$tmpforcreatebutton=dol_getdate(dol_now(), true);
$newparam.='&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$tmpforcreatebutton['year'];
//$param='month='.$monthshown.'&year='.$year;
$hourminsec='100000';
$link = '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d",$year,$month,$day).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam?'?'.$newparam:'')).'">';
$link = '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d",$tmpforcreatebutton['year'],$tmpforcreatebutton['mon'],$tmpforcreatebutton['mday']).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam?'?'.$newparam:'')).'">';
$link.= $langs->trans("NewAction");
$link.= '</a>';
}
@ -527,7 +529,7 @@ if ($resql)
// Status/Percent
$datep=$db->jdate($obj->datep);
print '<td align="center" class="nowrap">'.$actionstatic->LibStatut($obj->percent,3,1,$datep).'</td>';
print '<td align="center" class="nowrap">'.$actionstatic->LibStatut($obj->percent,3,0,$datep).'</td>';
print '<td></td>';