diff --git a/htdocs/admin/agenda_reminder.php b/htdocs/admin/agenda_reminder.php
index 36f0c572de4..373014e417e 100644
--- a/htdocs/admin/agenda_reminder.php
+++ b/htdocs/admin/agenda_reminder.php
@@ -184,7 +184,7 @@ print ''."\n";
print '
'."\n";
print '| '.$langs->trans('AGENDA_REMINDER_BROWSER').' | '."\n";
print ' | '."\n";
-print ''."\n";
+print ' | '."\n";
if (empty($conf->global->AGENDA_REMINDER_BROWSER)) {
if (!isHTTPS()) {
@@ -232,7 +232,7 @@ if (!empty($conf->cron->enabled)) {
}
print ' | '."\n";
print ' | '."\n";
-print ''."\n";
+print ' | '."\n";
if (empty($conf->cron->enabled)) {
print ''.$langs->trans("WarningModuleNotActive", $langs->transnoentitiesnoconv("Module2300Name")).'';
diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php
index 6f1e83103d5..e34dffd6223 100644
--- a/htdocs/comm/action/card.php
+++ b/htdocs/comm/action/card.php
@@ -1363,6 +1363,7 @@ if ($id > 0)
$now = dol_now();
$delay_warning = $conf->global->MAIN_DELAY_ACTIONS_TODO * 24 * 60 * 60;
+
// Confirmation suppression action
if ($action == 'delete')
{
@@ -1418,9 +1419,11 @@ if ($id > 0)
print ' |
| '.$langs->trans("Type").' | ';
if ($object->type_code != 'AC_OTH_AUTO')
{
- $formactions->select_type_actions(GETPOST("actioncode", 'aZ09') ?GETPOST("actioncode", 'aZ09') : $object->type_code, "actioncode", "systemauto");
+ print $formactions->select_type_actions(GETPOST("actioncode", 'aZ09') ? GETPOST("actioncode", 'aZ09') : $object->type_code, "actioncode", "systemauto", 0, 0, 0, 1);
} else {
- print ''.$langs->trans("Action".$object->type_code);
+ print '';
+ print $object->getTypePicto();
+ print $langs->trans("Action".$object->type_code);
}
print ' |
';
}
@@ -1430,7 +1433,7 @@ if ($id > 0)
// Full day event
print '| '.$langs->trans("EventOnFullDay").' | fulldayevent ? ' checked' : '').'> |
';
- print dol_print_date($object->datep, 'dayhour', 'gmt');
+
// Date start - end
print '| '.$langs->trans("DateActionStart").' - '.$langs->trans("DateActionEnd").' | ';
if (GETPOST("afaire") == 1) {
@@ -1510,7 +1513,7 @@ if ($id > 0)
// Location
if (empty($conf->global->AGENDA_DISABLE_LOCATION))
{
- print ' |
| '.$langs->trans("Location").' | |
';
+ print '| '.$langs->trans("Location").' | |
';
}
// Assigned to
@@ -1786,7 +1789,6 @@ if ($id > 0)
} else {
print dol_get_fiche_head($head, 'card', $langs->trans("Action"), -1, 'action');
-
// Clone event
if ($action == 'clone')
{
@@ -1873,7 +1875,9 @@ if ($id > 0)
// Type
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE))
{
- print '| '.$langs->trans("Type").' | '.$langs->trans($object->type).' |
';
+ print '| '.$langs->trans("Type").' | ';
+ print $object->getTypePicto();
+ print $langs->trans($object->type).' |
';
}
// Full day event
diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php
index f7e0ef6acb1..c2dc7f6b2a6 100644
--- a/htdocs/comm/action/class/actioncomm.class.php
+++ b/htdocs/comm/action/class/actioncomm.class.php
@@ -1508,6 +1508,39 @@ class ActionComm extends CommonObject
return $result;
}
+ /**
+ * Return Picto of type of event
+ *
+ * @return string HTML String
+ */
+ public function getTypePicto()
+ {
+ global $conf;
+
+ $imgpicto = '';
+ if (!empty($conf->global->AGENDA_USE_EVENT_TYPE))
+ {
+ if ($this->type_picto) {
+ $imgpicto = img_picto('', $this->type_picto, 'class="paddingright"');
+ } else {
+ if ($this->type_code == 'AC_RDV') $imgpicto = img_picto('', 'meeting', '', false, 0, 0, '', 'paddingright');
+ elseif ($this->type_code == 'AC_TEL') $imgpicto = img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright');
+ elseif ($this->type_code == 'AC_FAX') $imgpicto = img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright');
+ elseif ($this->type_code == 'AC_EMAIL' || $this->type_code == 'AC_EMAIL_IN') $imgpicto = img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright');
+ elseif ($this->type_code == 'AC_INT') $imgpicto = img_picto('', 'object_intervention', '', false, 0, 0, '', 'paddingright');
+ elseif ($this->type_code == 'AC_OTH' && $this->code == 'TICKET_MSG') $imgpicto = img_picto('', 'object_conversation', '', false, 0, 0, '', 'paddingright');
+ elseif (!preg_match('/_AUTO/', $this->type_code)) $imgpicto = img_picto('', 'user-cog', '', false, 0, 0, '', 'paddingright');
+ else $imgpicto = img_picto('', 'cog', '', false, 0, 0, '', 'paddingright');
+ }
+ } else {
+ // 2 picto: 1 for auto, 1 for manual
+ if (!preg_match('/_AUTO/', $this->type_code)) $imgpicto = img_picto('', 'user-cog', '', false, 0, 0, '', 'paddingright');
+ else $imgpicto = img_picto('', 'cog', '', false, 0, 0, '', 'paddingright');
+ }
+ return $imgpicto;
+ }
+
+
/**
* Sets object to supplied categories.
*
diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php
index b1d864589e8..03dc3b4881c 100644
--- a/htdocs/comm/action/list.php
+++ b/htdocs/comm/action/list.php
@@ -688,28 +688,10 @@ if ($resql)
if (!empty($arrayfields['c.libelle']['checked']))
{
print '';
- $actioncomm = $actionstatic;
- // TODO Code common with code into showactions
- $imgpicto = '';
- if (!empty($conf->global->AGENDA_USE_EVENT_TYPE))
- {
- if ($actioncomm->type_picto) {
- $imgpicto = img_picto('', $actioncomm->type_picto);
- } else {
- if ($actioncomm->type_code == 'AC_RDV') $imgpicto = img_picto('', 'object_group', '', false, 0, 0, '', 'paddingright').' ';
- elseif ($actioncomm->type_code == 'AC_TEL') $imgpicto = img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright').' ';
- elseif ($actioncomm->type_code == 'AC_FAX') $imgpicto = img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright').' ';
- elseif ($actioncomm->type_code == 'AC_EMAIL' || $actioncomm->type_code == 'AC_EMAIL_IN') $imgpicto = img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright').' ';
- elseif ($actioncomm->type_code == 'AC_INT') $imgpicto = img_picto('', 'object_intervention', '', false, 0, 0, '', 'paddingright').' ';
- elseif ($actioncomm->type_code == 'AC_OTH' && $actioncomm->code == 'TICKET_MSG') $imgpicto = img_picto('', 'object_conversation', '', false, 0, 0, '', 'paddingright').' ';
- elseif (!preg_match('/_AUTO/', $actioncomm->type_code)) $imgpicto = img_picto('', 'object_other', '', false, 0, 0, '', 'paddingright').' ';
- }
- }
- print $imgpicto;
-
+ print $actionstatic->getTypePicto();
$labeltype = $obj->type_code;
if (empty($conf->global->AGENDA_USE_EVENT_TYPE) && empty($arraylist[$labeltype])) $labeltype = 'AC_OTH';
- if ($actioncomm->type_code == 'AC_OTH' && $actioncomm->code == 'TICKET_MSG') {
+ if ($actionstatic->type_code == 'AC_OTH' && $actionstatic->code == 'TICKET_MSG') {
$labeltype = $langs->trans("Message");
} else {
if (!empty($arraylist[$labeltype])) $labeltype = $arraylist[$labeltype];
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 1d23953e4d4..a4a905d256d 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -4370,6 +4370,9 @@ class Form
$more .= ''."\n";
} elseif ($input['type'] == 'select')
{
+ if (empty($morecss)) {
+ $morecss = 'minwidth100';
+ }
$more .= '';
if (!empty($input['label'])) $more .= $input['label'].' ';
$more .= $this->selectarray($input['name'], $input['values'], $input['default'], 1, 0, 0, $moreattr, 0, 0, 0, '', $morecss);
diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php
index 0cccbe6ad8c..bfd5a6f64f7 100644
--- a/htdocs/core/class/html.formactions.class.php
+++ b/htdocs/core/class/html.formactions.class.php
@@ -263,23 +263,7 @@ class FormActions
// Type
print ' ';
- // TODO Code common with code into comm/action/list.php
- $imgpicto = '';
- if (!empty($conf->global->AGENDA_USE_EVENT_TYPE))
- {
- if ($actioncomm->type_picto) {
- $imgpicto = img_picto('', $actioncomm->type_picto);
- } else {
- if ($actioncomm->type_code == 'AC_RDV') $imgpicto = img_picto('', 'object_group', '', false, 0, 0, '', 'paddingright');
- elseif ($actioncomm->type_code == 'AC_TEL') $imgpicto = img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright');
- elseif ($actioncomm->type_code == 'AC_FAX') $imgpicto = img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright');
- elseif ($actioncomm->type_code == 'AC_EMAIL') $imgpicto = img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright');
- elseif ($actioncomm->type_code == 'AC_INT') $imgpicto = img_picto('', 'object_intervention', '', false, 0, 0, '', 'paddingright');
- elseif ($actioncomm->type_code == 'AC_OTH' && $actioncomm->code == 'TICKET_MSG') $imgpicto = img_picto('', 'object_conversation', '', false, 0, 0, '', 'paddingright');
- elseif (!preg_match('/_AUTO/', $actioncomm->type_code)) $imgpicto = img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright');
- }
- }
- print $imgpicto;
+ print $actioncomm->getTypePicto();
if ($actioncomm->type_code == 'AC_OTH' && $actioncomm->code == 'TICKET_MSG') {
print $langs->trans("Message");
} else {
diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php
index d7cf03c41e0..c310c352690 100644
--- a/htdocs/core/class/html.formticket.class.php
+++ b/htdocs/core/class/html.formticket.class.php
@@ -368,7 +368,9 @@ class FormTicket
if (response.num) {
var selecthtml_str = response.value;
var selecthtml_dom=$.parseHTML(selecthtml_str);
- $("#inputautocomplete"+htmlname).val(selecthtml_dom[0][0].innerHTML);
+ if (typeof(selecthtml_dom[0][0]) !== \'undefined\') {
+ $("#inputautocomplete"+htmlname).val(selecthtml_dom[0][0].innerHTML);
+ }
} else {
$("#inputautocomplete"+htmlname).val("");
}
diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php
index f8dd34ce0ac..739035f71a5 100644
--- a/htdocs/core/lib/ajax.lib.php
+++ b/htdocs/core/lib/ajax.lib.php
@@ -500,7 +500,9 @@ function ajax_combobox($htmlname, $events = array(), $minLengthToAutocomplete =
if (response.num) {
var selecthtml_str = response.value;
var selecthtml_dom=$.parseHTML(selecthtml_str);
- $("#inputautocomplete"+htmlname).val(selecthtml_dom[0][0].innerHTML);
+ if (typeof(selecthtml_dom[0][0]) !== \'undefined\') {
+ $("#inputautocomplete"+htmlname).val(selecthtml_dom[0][0].innerHTML);
+ }
} else {
$("#inputautocomplete"+htmlname).val("");
}
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 7b15edc8ad1..d328d4ae693 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -13,7 +13,7 @@
* Copyright (C) 2014 Cédric GROSS
* Copyright (C) 2014-2015 Marcos García
* Copyright (C) 2015 Jean-François Ferry
- * Copyright (C) 2018-2020 Frédéric France
+ * Copyright (C) 2018-2021 Frédéric France
* Copyright (C) 2019 Thibault Foucart
* Copyright (C) 2020 Open-Dsi
* Copyright (C) 2021 Gauthier VERDOL
@@ -2480,12 +2480,14 @@ function dol_print_socialnetworks($value, $cid, $socid, $type, $dictsocialnetwor
$htmllink = $value;
- if (empty($value)) return ' ';
+ if (empty($value)) {
+ return ' ';
+ }
if (!empty($type)) {
$htmllink = '';
- // TODO use dictionary definition for picto $dictsocialnetworks[$type]['icon']
- $htmllink .= img_picto($langs->trans(dol_ucfirst($type)), $type.'.png', '', false, 0, 0, '', 'paddingright', 0);
+ // Use dictionary definition for picto $dictsocialnetworks[$type]['icon']
+ $htmllink .= ' ';
if ($type == 'skype') {
$htmllink .= $value;
$htmllink .= ' ';
@@ -2501,7 +2503,9 @@ function dol_print_socialnetworks($value, $cid, $socid, $type, $dictsocialnetwor
if (($cid || $socid) && !empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) {
$addlink = 'AC_SKYPE';
$link = '';
- if (!empty($conf->global->AGENDA_ADDACTIONFORSKYPE)) $link = ' '.img_object($langs->trans("AddAction"), "calendar").'';
+ if (!empty($conf->global->AGENDA_ADDACTIONFORSKYPE)) {
+ $link = ' '.img_object($langs->trans("AddAction"), "calendar").'';
+ }
$htmllink .= ($link ? ' '.$link : '');
}
} else {
@@ -3262,12 +3266,12 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
if (empty($srconly) && in_array($pictowithouttext, array(
'1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected',
'accountancy', 'account', 'accountline', 'action', 'add', 'address', 'bank_account', 'barcode', 'bank', 'bill', 'billa', 'billr', 'billd', 'bookmark', 'bom', 'building',
- 'cash-register', 'category', 'check', 'clock', 'close_title', 'company', 'contact', 'contract', 'cron', 'cubes',
+ 'cash-register', 'category', 'check', 'clock', 'close_title', 'cog', 'company', 'contact', 'contract', 'cron', 'cubes',
'delete', 'dolly', 'dollyrevert', 'donation', 'download', 'edit', 'ellipsis-h', 'email', 'eraser', 'external-link-alt', 'external-link-square-alt',
'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'folder', 'folder-open', 'globe', 'globe-americas', 'grip', 'grip_title', 'group',
'help', 'holiday',
'intervention', 'label', 'language', 'link', 'list', 'listlight', 'loan', 'lot',
- 'margin', 'map-marker-alt', 'member', 'money-bill-alt', 'mrp', 'note', 'next',
+ 'margin', 'map-marker-alt', 'member', 'meeting', 'money-bill-alt', 'mrp', 'note', 'next',
'object_accounting', 'object_account', 'object_accountline', 'object_action', 'object_barcode', 'object_bill', 'object_billa', 'object_billd', 'object_bom',
'object_category', 'object_conversation', 'object_bookmark', 'object_bug', 'object_clock', 'object_dolly', 'object_dollyrevert', 'object_generic', 'object_folder',
'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser',
@@ -3290,7 +3294,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'payment', 'pencil-ruler', 'preview', 'project', 'projectpub', 'refresh', 'salary', 'supplier_invoice', 'ticket',
'error', 'warning',
'recruitmentcandidature', 'recruitmentjobposition', 'resource',
- 'shapes', 'supplier_proposal', 'supplier_order', 'supplier_invoice',
+ 'shapes', 'supplier_proposal', 'supplier_order', 'supplier_invoice', 'user-cog',
'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda',
'eventorganization', 'object_eventorganization'
)
@@ -3318,7 +3322,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'email'=>'at',
'edit'=>'pencil-alt', 'grip_title'=>'arrows-alt', 'grip'=>'arrows-alt', 'help'=>'question-circle',
'generic'=>'file', 'holiday'=>'umbrella-beach', 'label'=>'layer-group', 'loan'=>'money-bill-alt',
- 'member'=>'users', 'mrp'=>'cubes', 'next'=>'arrow-alt-circle-right',
+ 'member'=>'users', 'meeting'=>'chalkboard-teacher', 'mrp'=>'cubes', 'next'=>'arrow-alt-circle-right',
'trip'=>'wallet', 'group'=>'users', 'movement'=>'people-carry',
'sign-out'=>'sign-out-alt',
'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'check'=>'check', 'bookmark'=>'star', 'bookmark'=>'star',
@@ -3413,13 +3417,13 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
// Define $color
$arrayconvpictotocolor = array(
'address'=>'#6c6aa8', 'building'=>'#6c6aa8', 'bom'=>'#a69944',
- 'companies'=>'#6c6aa8', 'company'=>'#6c6aa8', 'contact'=>'#6c6aa8', 'dynamicprice'=>'#a69944',
+ 'cog'=>'#999', 'companies'=>'#6c6aa8', 'company'=>'#6c6aa8', 'contact'=>'#6c6aa8', 'dynamicprice'=>'#a69944',
'edit'=>'#444', 'note'=>'#999', 'error'=>'', 'help'=>'#bbb', 'listlight'=>'#999',
'dolly'=>'#a69944', 'dollyrevert'=>'#a69944', 'lot'=>'#a69944',
'map-marker-alt'=>'#aaa', 'mrp'=>'#a69944', 'product'=>'#a69944', 'service'=>'#a69944', 'stock'=>'#a69944', 'movement'=>'#a69944',
'other'=>'#ddd',
'playdisabled'=>'#ccc', 'printer'=>'#444', 'projectpub'=>'#986c6a', 'resize'=>'#444', 'rss'=>'#cba',
- 'shipment'=>'#a69944', 'stats'=>'#444', 'switch_off'=>'#999', 'uparrow'=>'#555', 'globe-americas'=>'#aaa',
+ 'shipment'=>'#a69944', 'stats'=>'#444', 'switch_off'=>'#999', 'uparrow'=>'#555', 'user-cog'=>'#999', 'globe-americas'=>'#aaa',
'website'=>'#304'
);
if (isset($arrayconvpictotocolor[$pictowithouttext])) {
| |