diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php
index 784851a5308..d5b753b72ac 100644
--- a/htdocs/comm/action/card.php
+++ b/htdocs/comm/action/card.php
@@ -1505,9 +1505,9 @@ if ($action == 'create') {
$events[] = array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php?showempty=1', 1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled'));
//For external user force the company to user company
if (!empty($user->socid)) {
- print img_picto('', 'company', 'class="paddingrightonly"').$form->select_company($user->socid, 'socid', '', 1, 1, 0, $events, 0, 'minwidth300');
+ print img_picto('', 'company', 'class="paddingrightonly"').$form->select_company($user->socid, 'socid', '', 1, 1, 0, $events, 0, 'minwidth300 widthcentpercentminusxx maxwidth500');
} else {
- print img_picto('', 'company', 'class="paddingrightonly"').$form->select_company('', 'socid', '', 'SelectThirdParty', 1, 0, $events, 0, 'minwidth300');
+ print img_picto('', 'company', 'class="paddingrightonly"').$form->select_company('', 'socid', '', 'SelectThirdParty', 1, 0, $events, 0, 'minwidth300 widthcentpercentminusxx maxwidth500');
}
}
print '';
@@ -1520,7 +1520,7 @@ if ($action == 'create') {
}
if ($origin=='contact') $preselectedids[GETPOST('originid', 'int')] = GETPOST('originid', 'int');
print img_picto('', 'contact', 'class="paddingrightonly"');
- print $form->selectcontacts(empty($conf->global->MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT) ? GETPOST('socid', 'int') : 0, $preselectedids, 'socpeopleassigned[]', 1, '', '', 0, 'minwidth300 quatrevingtpercent', false, 0, array(), false, 'multiple', 'contactid');
+ print $form->selectcontacts(empty($conf->global->MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT) ? GETPOST('socid', 'int') : 0, $preselectedids, 'socpeopleassigned[]', 1, '', '', 0, 'minwidth300 widthcentpercentminusxx maxwidth500', false, 0, array(), false, 'multiple', 'contactid');
print '';
}
@@ -1532,7 +1532,7 @@ if ($action == 'create') {
print '
| '.$langs->trans("Project").' | ';
print img_picto('', 'project', 'class="pictofixedwidth"');
- print $formproject->select_projects(($object->socid > 0 ? $object->socid : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx');
+ print $formproject->select_projects(($object->socid > 0 ? $object->socid : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx maxwidth500');
print ' ';
print '';
@@ -2013,19 +2013,19 @@ if ($id > 0) {
// Related company
print ' |
| '.$langs->trans("ActionOnCompany").' | ';
print '';
- print '';
+ print ' ';
$events = array(); // 'method'=parameter action of url, 'url'=url to call that return new list of contacts
$events[] = array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php?showempty=1', 1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled'));
// TODO Refresh also list of project if $conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY not defined with list linked to socid ?
// FIXME If we change company, we may get a project that does not match
- print img_picto('', 'company', 'class="paddingrightonly"').$form->select_company($object->socid, 'socid', '', 'SelectThirdParty', 1, 0, $events, 0, 'minwidth200');
+ print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company($object->socid, 'socid', '', 'SelectThirdParty', 1, 0, $events, 0, 'minwidth200');
print ' ';
print ' |
';
// related contact
print '| '.$langs->trans("ActionOnContact").' | ';
print ' ';
- print img_picto('', 'contact', 'class="paddingrightonly"').$form->selectcontacts(empty($conf->global->MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT) ? $object->socid : 0, array_keys($object->socpeopleassigned), 'socpeopleassigned[]', 1, '', '', 1, 'quatrevingtpercent', false, 0, 0, array(), 'multiple', 'contactid');
+ print img_picto('', 'contact', 'class="paddingrightonly"').$form->selectcontacts(empty($conf->global->MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT) ? $object->socid : 0, array_keys($object->socpeopleassigned), 'socpeopleassigned[]', 1, '', '', 1, 'minwidth300 widthcentpercentminusx', false, 0, 0, array(), 'multiple', 'contactid');
print ' ';
print ' | ';
print '
';
@@ -2036,10 +2036,10 @@ if ($id > 0) {
$langs->load("projects");
print '| '.$langs->trans("Project").' | ';
- print img_picto('', 'project', 'class="paddingrightonly"');
- $numprojet = $formproject->select_projects(($object->socid > 0 ? $object->socid : -1), $object->fk_project, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 'maxwidth500');
+ print img_picto('', 'project', 'class="pictofixedwidth"');
+ $numprojet = $formproject->select_projects(($object->socid > 0 ? $object->socid : -1), $object->fk_project, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 'maxwidth500 widthcentpercentminusxx');
if ($numprojet == 0) {
- print ' id.'&action=edit').'">';
+ print ' id.'&action=edit').'">'.img_picto($langs->trans("AddProject"), 'project').'';
}
print ' |
';
}
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index f1fcf94a868..d01200d1ec3 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -2989,6 +2989,10 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs =
*/
function dol_getdate($timestamp, $fast = false, $forcetimezone = '')
{
+ if ($timestamp === '') {
+ return array();
+ }
+
$datetimeobj = new DateTime();
$datetimeobj->setTimestamp($timestamp); // Use local PHP server timezone
if ($forcetimezone) {
@@ -12888,7 +12892,8 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = '', $n
$url = DOL_URL_ROOT.'/comm/action/card.php?id='.$histo[$key]['id'];
$tmpa = dol_getdate($histo[$key]['datestart'], false);
- if ($actualCycleDate !== $tmpa['year'].'-'.$tmpa['yday']) {
+
+ if (isset($tmpa['year']) && isset($tmpa['yday']) && $actualCycleDate !== $tmpa['year'].'-'.$tmpa['yday']) {
$actualCycleDate = $tmpa['year'].'-'.$tmpa['yday'];
$out .= '';
$out .= '';
@@ -12911,10 +12916,10 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = '', $n
$out .= ''."\n";
- $out .= '