Fix: Can edit status of event.

New: Onto event summary of elements, end date and status are visible.
This commit is contained in:
Laurent Destailleur 2014-09-15 19:04:30 +02:00
parent 19e2bd8c90
commit 9ea3e33f94
7 changed files with 64 additions and 12 deletions

View File

@ -6,6 +6,7 @@ English Dolibarr ChangeLog
***** ChangeLog for 3.7 compared to 3.6.* *****
For users:
- New: PDF event report show project and status of event.
- New: Onto event summary of elements, end date and status are visible.
- New: Can filter on status on interventions.
- New: Add help info of field type into dictionary of payment types.
- New: Add proposals into referer page of thirdparty.

View File

@ -466,6 +466,8 @@ class ActionComm extends CommonObject
$sql.= ", fk_user_mod = '".$user->id."'";
$sql.= ", fk_user_action=".($this->usertodo->id > 0 ? "'".$this->usertodo->id."'":"null");
$sql.= ", fk_user_done=".($this->userdone->id > 0 ? "'".$this->userdone->id."'":"null");
if (! empty($this->fk_element)) $sql.= ", fk_element=".($this->fk_element?$this->fk_element:"null");
if (! empty($this->elementtype)) $sql.= ", elementtype=".($this->elementtype?"'".$this->elementtype."'":"null");
$sql.= " WHERE id=".$this->id;
dol_syslog(get_class($this)."::update", LOG_DEBUG);

View File

@ -105,9 +105,14 @@ if ($object->id > 0)
$author->fetch($object->author->id);
$object->author=$author;
if ($object->contact->id) $object->fetch_contact($object->contact->id);
if ($object->contact->id > 0) $object->fetch_contact($object->contact->id);
if ($object->usertodo->id > 0) { $tmpuser=new User($db); $res=$tmpuser->fetch($object->usertodo->id); $object->usertodo=$tmpuser; }
$head=actions_prepare_head($object);
$now=dol_now();
$delay_warning=$conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60;
dol_fiche_head($head, 'documents', $langs->trans("Action"),0,'action');
// Affichage fiche action en mode visu
@ -138,7 +143,7 @@ if ($object->id > 0)
else print dol_print_date($object->datep,'day');
if ($object->percentage == 0 && $object->datep && $object->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late"));
print '</td>';
print '<td rowspan="4" align="center" valign="middle" width="180">'."\n";
print '<td rowspan="5" align="center" valign="middle" width="180">'."\n";
print '<form name="listactionsfiltermonth" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="show_month">';
@ -146,7 +151,7 @@ if ($object->id > 0)
print '<input type="hidden" name="month" value="'.dol_print_date($object->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
print img_picto($langs->trans("ViewCal"),'object_calendar').' <input type="submit" style="width: 120px" class="button" name="viewcal" value="'.$langs->trans("ViewCal").'">';
print img_picto($langs->trans("ViewCal"),'object_calendar','class="hideonsmartphone"').' <input type="submit" style="min-width: 120px" class="button" name="viewcal" value="'.$langs->trans("ViewCal").'">';
print '</form>'."\n";
print '<form name="listactionsfilterweek" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@ -155,7 +160,7 @@ if ($object->id > 0)
print '<input type="hidden" name="month" value="'.dol_print_date($object->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
print img_picto($langs->trans("ViewCal"),'object_calendarweek').' <input type="submit" style="width: 120px" class="button" name="viewweek" value="'.$langs->trans("ViewWeek").'">';
print img_picto($langs->trans("ViewCal"),'object_calendarweek','class="hideonsmartphone"').' <input type="submit" style="min-width: 120px" class="button" name="viewweek" value="'.$langs->trans("ViewWeek").'">';
print '</form>'."\n";
print '<form name="listactionsfilterday" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@ -164,9 +169,18 @@ if ($object->id > 0)
print '<input type="hidden" name="month" value="'.dol_print_date($object->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
print img_picto($langs->trans("ViewCal"),'object_calendarday').' <input type="submit" style="width: 120px" class="button" name="viewday" value="'.$langs->trans("ViewDay").'">';
print img_picto($langs->trans("ViewCal"),'object_calendarday','class="hideonsmartphone"').' <input type="submit" style="min-width: 120px" class="button" name="viewday" value="'.$langs->trans("ViewDay").'">';
print '</form>'."\n";
print '</td>';
print '<form name="listactionsfilterperuser" action="'.DOL_URL_ROOT.'/comm/action/peruser.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="show_peruser">';
print '<input type="hidden" name="year" value="'.dol_print_date($object->datep,'%Y').'">';
print '<input type="hidden" name="month" value="'.dol_print_date($object->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
print img_picto($langs->trans("ViewCal"),'object_calendarperuser','class="hideonsmartphone"').' <input type="submit" style="min-width: 120px" class="button" name="viewperuser" value="'.$langs->trans("ViewPerUser").'">';
print '</form>'."\n";
print '</td>';
print '</tr>';
// Date end
@ -184,7 +198,11 @@ if ($object->id > 0)
// Location
print '<tr><td>'.$langs->trans("Location").'</td><td colspan="2">'.$object->location.'</td></tr>';
// Assigned to
print '<tr><td width="30%" class="nowrap">'.$langs->trans("ActionAffectedTo").'</td><td>';
if ($object->usertodo->id > 0) print $object->usertodo->getNomUrl(1);
print '</td></tr>';
print '</table><br><br><table class="border" width="100%">';

View File

@ -101,7 +101,7 @@ if (GETPOST('addassignedtouser'))
$action='create';
}
// Add action
if ($action == 'add_action')
if ($action == 'add')
{
$error=0;
@ -317,7 +317,7 @@ if ($action == 'update')
$apmin=GETPOST('apmin');
$p2hour=GETPOST('p2hour');
$p2min=GETPOST('p2min');
$percentage=in_array(GETPOST('status'),array(-1,100))?GETPOST('status'):GETPOST("percentage"); // If status is -1 or 100, percentage is not defined and we must use status
$percentage=in_array(GETPOST('status'),array(-1,100))?GETPOST('status'):(in_array(GETPOST('complete'),array(-1,100))?GETPOST('complete'):GETPOST("percentage")); // If status is -1 or 100, percentage is not defined and we must use status
// Clean parameters
if ($aphour == -1) $aphour='0';
@ -345,6 +345,7 @@ if ($action == 'update')
$object->pnote = $_POST["note"];
$object->fk_element = $_POST["fk_element"];
$object->elementtype = $_POST["elementtype"];
if (! $datef && $percentage == 100)
{
$error=$langs->trans("ErrorFieldRequired",$langs->trans("DateEnd"));
@ -512,7 +513,7 @@ if ($action == 'create')
print '<form name="formaction" action="'.$_SERVER['PHP_SELF'].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="add_action">';
print '<input type="hidden" name="action" value="add">';
if ($backtopage) print '<input type="hidden" name="backtopage" value="'.($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"]).'">';
if (GETPOST("actioncode") == 'AC_RDV') print_fiche_titre($langs->trans("AddActionRendezVous"));

View File

@ -187,6 +187,7 @@ class FormActions
print '<th class="liste_titre">'.$langs->trans('Action').'</th>';
print '<th class="liste_titre">'.$langs->trans('Date').'</th>';
print '<th class="liste_titre">'.$langs->trans('By').'</th>';
print '<th class="liste_titre" align="right">'.$langs->trans('Status').'</th>';
print '</tr>';
print "\n";
@ -204,7 +205,15 @@ class FormActions
print '<tr '.$bc[$var].'>';
print '<td>'.$ref.'</td>';
print '<td>'.$label.'</td>';
print '<td>'.dol_print_date($action->datep,'day').'</td>';
print '<td>'.dol_print_date($action->datep,'dayhour');
if ($action->datef)
{
$tmpa=dol_getdate($action->datep);
$tmpb=dol_getdate($action->datef);
if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) print '-'.dol_print_date($action->datef,'hour');
else print '-'.dol_print_date($action->datef,'dayhour');
}
print '</td>';
print '<td>';
if (! empty($action->author->id))
{
@ -214,6 +223,12 @@ class FormActions
print $userstatic->getNomUrl(1);
}
print '</td>';
print '<td align="right">';
if (! empty($action->author->id))
{
print $action->getLibStatut(3);
}
print '</td>';
print '</tr>';
}
print '</table>';

View File

@ -1643,6 +1643,20 @@ else if ($id > 0 || ! empty($ref))
else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#">'.$langs->trans('SendByMail').'</a></div>';
}
// Event agenda
if (! empty($conf->global->FICHINTER_ADDLINK_TO_EVENT))
{
if (! empty($conf->agenda->enabled) && $object->statut > 0)
{
$langs->load("agenda");
if ($object->statut < 2)
{
if ($user->rights->agenda->myactions->create) print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid.'">'.$langs->trans("AddEvent").'</a></div>';
else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("AddEvent").'</a></div>';
}
}
}
// Proposal
if (! empty($conf->propal->enabled) && $object->statut > 0)
{

View File

@ -87,4 +87,5 @@ AgendaExtNb=Calendar nb %s
ExtSiteUrlAgenda=URL to access .ical file
ExtSiteNoLabel=No Description
WorkingTimeRange=Working time range
WorkingDaysRange=Working days range
WorkingDaysRange=Working days range
AddEvent=Create event