diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php
index cd1c9ecfd1b..80cfce40c32 100644
--- a/htdocs/comm/action/card.php
+++ b/htdocs/comm/action/card.php
@@ -98,9 +98,11 @@ $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('actioncard','globalcard'));
+
/*
* Actions
*/
+
$listUserAssignedUpdated = false;
// Remove user to assigned list
if (GETPOST('removedassigned') || GETPOST('removedassigned') == '0')
@@ -644,8 +646,8 @@ if ($action == 'create')
if ($backtopage) print '';
if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) print '';
- if (GETPOST("actioncode") == 'AC_RDV') print load_fiche_titre($langs->trans("AddActionRendezVous"));
- else print load_fiche_titre($langs->trans("AddAnAction"));
+ if (GETPOST("actioncode") == 'AC_RDV') print load_fiche_titre($langs->trans("AddActionRendezVous"), '', 'title_agenda');
+ else print load_fiche_titre($langs->trans("AddAnAction"), '', 'title_agenda');
dol_fiche_head();
@@ -1183,33 +1185,51 @@ if ($id > 0)
print $formconfirm;
}
+ $linkback =img_picto($langs->trans("BackToList"),'object_list','class="hideonsmartphone pictoactionview"');
+ $linkback.= ''.$langs->trans("BackToList").'';
+
+ // Link to other agenda views
+ $out='';
+ $out.=img_picto($langs->trans("ViewPerUser"),'object_calendarperuser','class="hideonsmartphone pictoactionview"');
+ $out.=''.$langs->trans("ViewPerUser").'';
+ $out.='
';
+ $out.=img_picto($langs->trans("ViewCal"),'object_calendar','class="hideonsmartphone pictoactionview"');
+ $out.=''.$langs->trans("ViewCal").'';
+ $out.=img_picto($langs->trans("ViewWeek"),'object_calendarweek','class="hideonsmartphone pictoactionview"');
+ $out.=''.$langs->trans("ViewWeek").'';
+ $out.=img_picto($langs->trans("ViewDay"),'object_calendarday','class="hideonsmartphone pictoactionview"');
+ $out.=''.$langs->trans("ViewDay").'';
+ $linkback.=$out;
+
+ dol_banner_tab($object, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', '');
+
+ print '
| '.$langs->trans("Ref").' | '; + /*print ' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("Ref").' | '; print $form->showrefnav($object, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', ''); - print ' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("Type").' | '.$object->type.' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("Type").' | '.$object->type.' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("Title").' | '.dol_htmlentities($object->label).' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("Title").' | '.dol_htmlentities($object->label).' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("EventOnFullDay").' | '.yn($object->fulldayevent, 3).' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("EventOnFullDay").' | '.yn($object->fulldayevent, 3).' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("DateActionStart").' | '; + print ' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("DateActionStart").' | '; if (! $object->fulldayevent) print dol_print_date($object->datep,'dayhour'); 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")); @@ -1224,9 +1244,9 @@ if ($id > 0) print ' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("Status").' / '.$langs->trans("Percentage").' | '; + /*print ' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("Status").' / '.$langs->trans("Percentage").' | '; print $object->getLibStatut(4); - print ' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("ActionAssignedTo").' | '; + print ' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("ActionAssignedTo").' | '; $listofuserid=array(); if (empty($donotclearsession)) { @@ -1291,7 +1311,7 @@ if ($id > 0) // Third party - Contact if ($conf->societe->enabled) { - print ' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("ActionOnCompany").' | '.($object->thirdparty->id?$object->thirdparty->getNomUrl(1):$langs->trans("None")); + print ' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("ActionOnCompany").' | '.($object->thirdparty->id?$object->thirdparty->getNomUrl(1):$langs->trans("None")); if (is_object($object->thirdparty) && $object->thirdparty->id > 0 && $object->type_code == 'AC_TEL') { if ($object->thirdparty->fetch($object->thirdparty->id)) @@ -1323,7 +1343,7 @@ if ($id > 0) // Project if (! empty($conf->projet->enabled)) { - print ' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("Project").' | '; + print ' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("Project").' | '; if ($object->fk_project) { $project=new Project($db); @@ -1334,7 +1354,7 @@ if ($id > 0) } // Priority - print ' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("Priority").' | '; + print ' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("Priority").' | '; print ($object->priority?$object->priority:''); print ' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("Ref").' | '; + /*print ' | ||
| '.$langs->trans("Ref").' | '; print $form->showrefnav($object, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', ''); - print ' | ||
| '.$langs->trans("Type").' | '.$object->type.' | ||
| '.$langs->trans("Type").' | '.$object->type.' | ||
| '.$langs->trans("Title").' | '.$object->label.' | ||
| '.$langs->trans("Title").' | '.$object->label.' | ||
| '.$langs->trans("EventOnFullDay").' | '.yn($object->fulldayevent, 3).' | ||
| '.$langs->trans("EventOnFullDay").' | '.yn($object->fulldayevent, 3).' | ||
| '.$langs->trans("DateActionStart").' | '; + print ' | ||
| '.$langs->trans("DateActionStart").' | '; if (! $object->fulldayevent) print dol_print_date($object->datep,'dayhour'); 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")); @@ -161,9 +180,9 @@ if ($object->id > 0) print ' | ||
| '.$langs->trans("Status").' / '.$langs->trans("Percentage").' | '; + /*print ' | ||
| '.$langs->trans("Status").' / '.$langs->trans("Percentage").' | '; print $object->getLibStatut(4); - print ' | ||
| '.$langs->trans("ActionAffectedTo").' | '; + print ' | ||
| '.$langs->trans("ActionAffectedTo").' | '; $listofuserid=array(); if (empty($donotclearsession)) { @@ -206,11 +225,15 @@ if ($object->id > 0) } print ' | ||
| '.$langs->trans("ActionOnCompany").' | '.($object->thirdparty->id?$object->thirdparty->getNomUrl(1):$langs->trans("None")); + print ' | ||
| '.$langs->trans("ActionOnCompany").' | '.($object->thirdparty->id?$object->thirdparty->getNomUrl(1):$langs->trans("None")); if (is_object($object->thirdparty) && $object->thirdparty->id > 0 && $object->type_code == 'AC_TEL') { if ($object->thirdparty->fetch($object->thirdparty->id)) @@ -281,7 +304,7 @@ if ($object->id > 0) } - print ' | ||
| '.$langs->trans("NbOfAttachedFiles").' | '.count($filearray).' | ||
| '.$langs->trans("NbOfAttachedFiles").' | '.count($filearray).' | ||
| '.$langs->trans("TotalSizeOfAttachedFiles").' | '.$totalsize.' '.$langs->trans("bytes").' | ||
| '; -dol_print_object_info($act); +dol_print_object_info($object); print ' |
| '; + print ' | ';
print '
| '; + print ' | '; if ($action == 'editwarehouse') { $formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->warehouse_id, 'warehouse_id', 1); } else { @@ -2117,14 +2174,14 @@ if ($action == 'create' && $user->rights->commande->creer) } // Terms of payment - print ' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '; + print ' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
';
print '
| '; + print ' | '; if ($action == 'editconditions') { $form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->cond_reglement_id, 'cond_reglement_id', 1); } else { @@ -2135,14 +2192,14 @@ if ($action == 'create' && $user->rights->commande->creer) print ' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '; + print ' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
';
print '
| '; + print ' | '; if ($action == 'editmode') { $form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'mode_reglement_id'); } else { @@ -2155,14 +2212,14 @@ if ($action == 'create' && $user->rights->commande->creer) { // Multicurrency code print ' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '; + print ' | ';
print '
| '; + print ' | '; if ($action == 'editmulticurrencycode') { $form->form_multicurrency_code($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_code, 'multicurrency_code'); } else { @@ -2172,14 +2229,14 @@ if ($action == 'create' && $user->rights->commande->creer) // Multicurrency rate print ' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '; + print ' | ';
print '
| '; + print ' | '; if ($action == 'editmulticurrencyrate') { $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx', $object->multicurrency_code); } else { @@ -2196,7 +2253,7 @@ if ($action == 'create' && $user->rights->commande->creer) if ($action != 'editavailability') print ' | id . '">' . img_edit($langs->trans('SetAvailability'), 1) . ' | '; print '||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ' . $langs->trans('AmountHT') . ' | '; print '' . price($object->total_ht, 1, '', 1, - 1, - 1, $conf->currency) . ' | '; - // Margin Infos - if (! empty($conf->margin->enabled)) { - print ''; - $formmargin->displayMarginInfos($object); - print ' | '; - } else - print ''; - - print ' | ||
| ' . $langs->trans('AmountVAT') . ' | ' . price($object->total_tva, 1, '', 1, - 1, - 1, $conf->currency) . ' | ||||
| ' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . ' | '; - print '' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . ' | '; + print '' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . ' | '; print '|||
| ' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . ' | '; - print '' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . ' | '; + print '' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . ' | '; print '|||
| ' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . ' | '; - print '' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . ' | '; + print '' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . ' | '; print '|||
| ' . $langs->trans('Status') . ' | ' . $object->getLibStatut(4) . ' | ||||
| ' . $langs->trans('Status') . ' | ' . $object->getLibStatut(4) . ' | ||||
| '.$langs->trans('Margins').' | '; print ''.$langs->trans('SellingPrice').' | '; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 68087c31e80..dfa724e7c64 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -951,7 +951,13 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r { $morehtmlleft.='|||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("Ref").' | '; + print $form->showrefnav($act, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', ''); + print ' | |||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("Ref").' | '; - print $form->showrefnav($act, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', ''); - print ' | ||
| '.$langs->trans("Type").' | '.$act->type.' | ||
| '.$langs->trans("Type").' | '.$act->type.' | ||
| '.$langs->trans("Title").' | '.$act->label.' | ||
| '.$langs->trans("EventOnFullDay").' | '.yn($act->fulldayevent, 3).' | ||
| '.$langs->trans("DateActionStart").' | '; + if (! $act->fulldayevent) print dol_print_date($act->datep,'dayhour'); + else print dol_print_date($act->datep,'day'); + if ($act->percentage == 0 && $act->datep && $act->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late")); + print ' | '; + print '||
| '.$langs->trans("DateActionEnd").' | '; + if (! $act->fulldayevent) print dol_print_date($act->datef,'dayhour'); + else print dol_print_date($act->datef,'day'); + if ($act->percentage > 0 && $act->percentage < 100 && $act->datef && $act->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late")); + print ' | ||
| '.$langs->trans("Status").' / '.$langs->trans("Percentage").' | '; + print $act->getLibStatut(4); + print ' | ||
| '.$langs->trans("Location").' | '.$act->location.' | ||
| '.$langs->trans("ActionAffectedTo").' | ';
+ $listofuserid=array();
+ if (empty($donotclearsession))
+ {
+ if ($act->userownerid > 0) $listofuserid[$act->userownerid]=array('id'=>$act->userownerid,'transparency'=>$act->transparency); // Owner first
+ if (! empty($act->userassigned)) // Now concat assigned users
+ {
+ // Restore array with key with same value than param 'id'
+ $tmplist1=$act->userassigned; $tmplist2=array();
+ foreach($tmplist1 as $key => $val)
+ {
+ if ($val['id'] && $val['id'] != $act->userownerid) $listofuserid[$val['id']]=$val;
+ }
+ }
+ $_SESSION['assignedtouser']=json_encode($listofuserid);
+ }
+ else
+ {
+ if (!empty($_SESSION['assignedtouser']))
+ {
+ $listofuserid=json_decode($_SESSION['assignedtouser'], true);
+ }
+ }
+ print ' ';
+ print $form->select_dolusers_forevent('view', 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
+ print ' ';
+ if (in_array($user->id,array_keys($listofuserid)))
+ {
+ print '';
+ print $langs->trans("MyAvailability").': '.(($act->userassigned[$user->id]['transparency'] > 0)?$langs->trans("Busy"):$langs->trans("Available")); // We show nothing if event is assigned to nobody
+ print ' ';
+ }
+ print ' | ||
| '.$langs->trans('AliasNames').' | '; + print ' | ||
| ' . $langs->trans('AliasNames') . ' | '; print $socstatic->name_alias; print " | ||