';
diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php
index 5fea2cee66f..cb09745b24f 100644
--- a/htdocs/contrat/list.php
+++ b/htdocs/contrat/list.php
@@ -380,7 +380,7 @@ print '';
print '';
print '';
-print_barre_liste($langs->trans("ListOfContracts"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $totalnboflines, 'title_commercial.png', 0, $newcardbutton, '', $limit);
+print_barre_liste($langs->trans("ListOfContracts"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $totalnboflines, 'commercial', 0, $newcardbutton, '', $limit);
$topicmail="SendContractRef";
$modelmail="contract";
diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php
index 9371a9ea835..f26b11c6b08 100644
--- a/htdocs/contrat/services_list.php
+++ b/htdocs/contrat/services_list.php
@@ -336,7 +336,7 @@ if ($mode == "0") $title=$langs->trans("ListOfInactiveServices"); // Must use ==
if ($mode == "4" && $filter != "expired") $title=$langs->trans("ListOfRunningServices");
if ($mode == "4" && $filter == "expired") $title=$langs->trans("ListOfExpiredServices");
if ($mode == "5") $title=$langs->trans("ListOfClosedServices");
-print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_commercial.png', 0, '', '', $limit);
+print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'commercial', 0, '', '', $limit);
if ($sall)
{
diff --git a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php
index faf81a230a0..326a9297ce8 100644
--- a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php
+++ b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php
@@ -70,7 +70,7 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes
public function loadBox($max = 5)
{
global $conf, $user, $langs;
- $langs->loadLangs(array("boxes", "sendings"));
+ $langs->loadLangs(array("boxes", "sendings", "orders"));
$this->max = $max;
diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php
index 864f2869b82..da5e1ebc1a3 100644
--- a/htdocs/core/class/CMailFile.class.php
+++ b/htdocs/core/class/CMailFile.class.php
@@ -129,19 +129,32 @@ class CMailFile
* @param string $css Css option
* @param string $trackid Tracking string (contains type and id of related element)
* @param string $moreinheader More in header. $moreinheader must contains the "\r\n" (TODO not supported for other MAIL_SEND_MODE different than 'phpmail' and 'smtps' for the moment)
- * @param string $sendcontext 'standard', 'emailing', ... (used to define with sending mode and parameters to use)
+ * @param string $sendcontext 'standard', 'emailing', ... (used to define which sending mode and parameters to use)
* @param string $replyto Reply-to email (will be set to same value than From by default if not provided)
*/
public function __construct($subject, $to, $from, $msg, $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array(), $addr_cc = "", $addr_bcc = "", $deliveryreceipt = 0, $msgishtml = 0, $errors_to = '', $css = '', $trackid = '', $moreinheader = '', $sendcontext = 'standard', $replyto = '')
{
global $conf, $dolibarr_main_data_root;
+ $this->subject = $subject;
+ $this->addr_to = $to;
+ $this->addr_from = $from;
+ $this->msg = $msg;
+ $this->filename_list = $filename_list;
+ $this->mimetype_list = $mimetype_list;
+ $this->mimefilename_list = $mimefilename_list;
+ $this->addr_cc = $addr_cc;
+ $this->addr_bcc = $addr_bcc;
+ $this->deliveryreceipt = $deliveryreceipt;
+ if (empty($replyto)) $replyto = $from;
+ $this->reply_to = $replyto;
+ $this->errors_to = $errors_to;
+ $this->trackid = $trackid;
$this->sendcontext = $sendcontext;
$this->filename_list = $filename_list;
$this->mimetype_list = $mimetype_list;
$this->mimefilename_list = $mimefilename_list;
- if (empty($replyto)) $replyto=$from;
// Define this->sendmode
$this->sendmode = '';
@@ -262,16 +275,6 @@ class CMailFile
$files_encoded = "";
// Define smtp_headers
- $this->subject = $subject;
- $this->addr_from = $from;
- $this->reply_to = $replyto;
- $this->errors_to = $errors_to;
- $this->addr_to = $to;
- $this->addr_cc = $addr_cc;
- $this->addr_bcc = $addr_bcc;
- $this->deliveryreceipt = $deliveryreceipt;
- $this->trackid = $trackid;
-
$smtp_headers = $this->write_smtpheaders();
if (! empty($moreinheader)) $smtp_headers.=$moreinheader; // $moreinheader contains the \r\n
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 95798e7c269..b18bade5fa4 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -6588,10 +6588,19 @@ abstract class CommonObject
$out .= '| attributes[$this->table_element]['required'][$key])) $out .= ' fieldrequired';
- $out .= '">';
- if (! empty($extrafields->attributes[$this->table_element]['help'][$key])) $out .= $form->textwithpicto($labeltoshow, $extrafields->attributes[$this->table_element]['help'][$key]);
- else $out .= $labeltoshow;
+ // BUG #11554 : For public page, use red dot for required fields, instead of bold label
+ $context = isset($params["context"]) ? $params["context"] : "none";
+ if ($context=="public") { // Public page : red dot instead of bold ble characters
+ $out .= '">';
+ if (! empty($extrafields->attributes[$this->table_element]['help'][$key])) $out .= $form->textwithpicto($labeltoshow, $extrafields->attributes[$this->table_element]['help'][$key]);
+ else $out .= $labeltoshow;
+ if ($mode != 'view' && ! empty($extrafields->attributes[$this->table_element]['required'][$key])) $out .= ' *';
+ } else {
+ if ($mode != 'view' && ! empty($extrafields->attributes[$this->table_element]['required'][$key])) $out .= ' fieldrequired';
+ $out .= '">';
+ if (! empty($extrafields->attributes[$this->table_element]['help'][$key])) $out .= $form->textwithpicto($labeltoshow, $extrafields->attributes[$this->table_element]['help'][$key]);
+ else $out .= $labeltoshow;
+ }
$out .= ' | ';
$html_id = !empty($this->id) ? $this->element.'_extras_'.$key.'_'.$this->id : '';
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index df7753501e4..cd227de0f2c 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -7509,7 +7509,7 @@ class Form
*/
public function showFilterAndCheckAddButtons($addcheckuncheckall = 0, $cssclass = 'checkforaction', $calljsfunction = 0)
{
- $out.=$this->showFilterButtons();
+ $out=$this->showFilterButtons();
if ($addcheckuncheckall)
{
$out.=$this->showCheckAddButtons($cssclass, $calljsfunction);
diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php
index a7797f91833..577430592cf 100644
--- a/htdocs/core/class/html.formticket.class.php
+++ b/htdocs/core/class/html.formticket.class.php
@@ -981,7 +981,7 @@ class FormTicket
include_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
$uselocalbrowser = true;
- $doleditor = new DolEditor('mail_intro', $mail_intro, '100%', 140, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_2, 70);
+ $doleditor = new DolEditor('mail_intro', $mail_intro, '100%', 90, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_2, 70);
$doleditor->Create();
print '';
diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php
index 27d087b2fde..104247bf1c5 100644
--- a/htdocs/core/class/notify.class.php
+++ b/htdocs/core/class/notify.class.php
@@ -541,7 +541,12 @@ class Notify
'',
'',
0,
- -1
+ -1,
+ '',
+ '',
+ '',
+ '',
+ 'notification'
);
if ($mailfile->sendfile())
@@ -769,7 +774,12 @@ class Notify
'',
'',
0,
- 1
+ 1,
+ '',
+ '',
+ '',
+ '',
+ 'notification'
);
if ($mailfile->sendfile())
diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php
index da7b2918ec7..230c98a1d3c 100644
--- a/htdocs/core/lib/company.lib.php
+++ b/htdocs/core/lib/company.lib.php
@@ -1568,7 +1568,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
$out.=' | ';
// Author of event
- $out.='';
+ $out.=' | ';
//$userstatic->id=$histo[$key]['userid'];
//$userstatic->login=$histo[$key]['login'];
//$out.=$userstatic->getLoginUrl(1);
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index a807fc14684..287623c6c55 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -3010,36 +3010,43 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
$moreatt = str_replace('class="'.$reg[1].'"', '', $moreatt);
}
} else {
- $pictowithoutext = preg_replace('/(\.png|\.gif|\.svg)$/', '', $picto);
+ $pictowithouttext = preg_replace('/(\.png|\.gif|\.svg)$/', '', $picto);
//if (in_array($picto, array('switch_off', 'switch_on', 'off', 'on')))
- if (empty($srconly) && in_array($pictowithoutext, array(
- 'bank', 'close_title', 'delete', 'edit', 'ellipsis-h', 'filter', 'grip', 'grip_title', 'list', 'listlight', 'note', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize',
+ if (empty($srconly) && in_array($pictowithouttext, array(
+ 'bank', 'close_title', 'delete', 'edit', 'ellipsis-h', 'filter', 'grip', 'grip_title', 'list', 'listlight', 'note',
+ 'object_list','object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser',
+ 'off', 'on', 'play', 'playdisabled', 'printer', 'resize',
'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', '1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected',
'jabber','skype','twitter','facebook','linkedin',
- 'chevron-left','chevron-right','chevron-down','chevron-top'
+ 'chevron-left','chevron-right','chevron-down','chevron-top',
+ 'home', 'companies', 'products', 'commercial', 'invoicing', 'accountancy', 'project', 'hrm', 'members', 'ticket', 'generic'
)
)) {
- $fa='fa';
+ $fa='fa';
if (empty($conf->global->MAIN_DISABLE_FONT_AWESOME_5)) $fa='fas';
- $fakey = $pictowithoutext;
- $facolor = ''; $fasize = '';
+ $fakey = $pictowithouttext;
+ $facolor = ''; $fasize = '';
- if ($pictowithoutext == 'setup') {
- $fakey = 'fa-cog';
- $fasize = '1.4em';
- }
- elseif ($pictowithoutext == 'switch_off') {
- $fakey = 'fa-toggle-off';
+ $arrayconvpictotofa = array(
+ 'setup'=>'cog', 'companies'=>'building', 'products'=>'box_open', 'commercial'=>'box-tie', 'invoicing'=>'file-invoice', 'accountancy'=>'coins', 'project'=>'project-diagram',
+ 'hrm'=>'umbrella-beach', 'members'=>'user-friends', 'ticket'=>'sticky-note', 'generic'=>'folder-open',
+ 'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on',
+ 'bank'=>'bank', 'close_title'=>'window-close', 'delete'=>'trash', 'edit'=>'pencil', 'filter'=>'filter', 'split'=>'code-fork',
+ 'object_list'=>'list-alt','object_calendar'=>'calendar-alt', 'object_calendarweek'=>'calendar-week', 'object_calendarmonth'=>'calendar-alt', 'object_calendarday'=>'calendar-day', 'object_calendarperuser'=>'table'
+ );
+
+ if ($pictowithouttext == 'switch_off') {
$facolor = '#999';
$fasize = '2em';
+ $fakey = 'fa-'.$arrayconvpictotofa[$pictowithouttext];
}
- elseif ($pictowithoutext == 'switch_on') {
- $fakey = 'fa-toggle-on';
+ elseif ($pictowithouttext == 'switch_on') {
$facolor = '#227722';
$fasize = '2em';
+ $fakey = 'fa-'.$arrayconvpictotofa[$pictowithouttext];
}
- elseif ($pictowithoutext == 'off') {
+ elseif ($pictowithouttext == 'off') {
$fakey = 'fa-square-o';
if (empty($conf->global->MAIN_DISABLE_FONT_AWESOME_5))
{
@@ -3048,7 +3055,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
}
$fasize = '1.3em';
}
- elseif ($pictowithoutext == 'on') {
+ elseif ($pictowithouttext == 'on') {
$fakey = 'fa-check-square-o';
if (empty($conf->global->MAIN_DISABLE_FONT_AWESOME_5))
{
@@ -3057,44 +3064,38 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
}
$fasize = '1.3em';
}
- elseif ($pictowithoutext == 'bank') {
- $fakey = 'fa-bank';
+ elseif ($pictowithouttext == 'bank') {
+ $fakey = 'fa-'.$arrayconvpictotofa[$pictowithouttext];
$facolor = '#444';
}
- elseif ($pictowithoutext == 'close_title') {
- $fakey = 'fa-window-close';
- }
- elseif ($pictowithoutext == 'delete') {
- $fakey = 'fa-trash';
+ elseif ($pictowithouttext == 'delete') {
+ $fakey = 'fa-'.$arrayconvpictotofa[$pictowithouttext];
$facolor = '#444';
}
- elseif ($pictowithoutext == 'edit') {
- $fakey = 'fa-pencil';
+ elseif ($pictowithouttext == 'edit') {
$facolor = '#444';
+ $fakey = 'fa-'.$arrayconvpictotofa[$pictowithouttext];
if (empty($conf->global->MAIN_DISABLE_FONT_AWESOME_5)) $fakey = 'fa-pencil-alt';
}
- elseif ($pictowithoutext == 'filter') {
- $fakey = 'fa-'.$pictowithoutext;
- }
- elseif ($pictowithoutext == 'grip_title' || $pictowithoutext == 'grip') {
+ elseif ($pictowithouttext == 'grip_title' || $pictowithouttext == 'grip') {
$fakey = 'fa-arrows';
if (empty($conf->global->MAIN_DISABLE_FONT_AWESOME_5)) $fakey = 'fa-arrows-alt';
}
- elseif ($pictowithoutext == 'listlight') {
+ elseif ($pictowithouttext == 'listlight') {
$fakey = 'fa-download';
$facolor = '#999';
$marginleftonlyshort=1;
}
- elseif ($pictowithoutext == 'printer') {
+ elseif ($pictowithouttext == 'printer') {
$fakey = 'fa-print';
$fasize = '1.2em';
$facolor = '#444';
}
- elseif ($pictowithoutext == 'resize') {
+ elseif ($pictowithouttext == 'resize') {
$fakey = 'fa-crop';
$facolor = '#444';
}
- elseif ($pictowithoutext == 'note') {
+ elseif ($pictowithouttext == 'note') {
$fakey = 'fa-sticky-note-o';
if (empty($conf->global->MAIN_DISABLE_FONT_AWESOME_5))
{
@@ -3103,45 +3104,53 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
$facolor = '#999';
$marginleftonlyshort=1;
}
- elseif ($pictowithoutext == 'uparrow') {
+ elseif ($pictowithouttext == 'uparrow') {
$fakey = 'fa-mail-forward';
$facolor = '#555';
}
- elseif (in_array($pictowithoutext, array('1uparrow', '1downarrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected'))) {
+ elseif (in_array($pictowithouttext, array('1uparrow', '1downarrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected'))) {
$convertarray=array('1uparrow'=>'caret-up', '1downarrow'=>'caret-down', '1leftarrow'=>'caret-left', '1rightarrow'=>'caret-right', '1uparrow_selected'=>'caret-up', '1downarrow_selected'=>'caret-down', '1leftarrow_selected'=>'caret-left', '1rightarrow_selected'=>'caret-right');
- $fakey = 'fa-'.$convertarray[$pictowithoutext];
- if (preg_match('/selected/', $pictowithoutext)) $facolor = '#888';
+ $fakey = 'fa-'.$convertarray[$pictowithouttext];
+ if (preg_match('/selected/', $pictowithouttext)) $facolor = '#888';
$marginleftonlyshort = 1;
}
- elseif ($pictowithoutext == 'sign-out') {
+ elseif ($pictowithouttext == 'sign-out') {
$fakey = 'fa-sign-out';
$marginleftonlyshort=0;
if (empty($conf->global->MAIN_DISABLE_FONT_AWESOME_5)) $fakey = 'fa-sign-out-alt';
}
- elseif ($pictowithoutext == 'unlink') {
+ elseif ($pictowithouttext == 'unlink') {
$fakey = 'fa-chain-broken';
$facolor = '#555';
}
- elseif ($pictowithoutext == 'playdisabled') {
+ elseif ($pictowithouttext == 'playdisabled') {
$fakey = 'fa-play';
$facolor = '#ccc';
}
- elseif ($pictowithoutext == 'play') {
+ elseif ($pictowithouttext == 'play') {
$fakey = 'fa-play';
$facolor = '#444';
}
- elseif ($pictowithoutext == 'jabber') {
+ elseif ($pictowithouttext == 'jabber') {
$fakey = 'fa-comment-o';
}
- elseif (in_array($pictowithoutext, array('skype', 'twitter', 'facebook', 'linkedin'))) {
- $fakey = 'fa-'.$pictowithoutext;
+ elseif (in_array($pictowithouttext, array('skype', 'twitter', 'facebook', 'linkedin'))) {
+ $fakey = 'fa-'.$pictowithouttext;
if (empty($conf->global->MAIN_DISABLE_FONT_AWESOME_5)) $fa = 'fab';
}
- elseif ($pictowithoutext == 'split') {
- $fakey = 'fa-code-fork';
+ // Img for type of views
+ elseif (in_array($pictowithouttext, array('object_list', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser'))) {
+ $fakey = 'imgforviewmode fa-'.$arrayconvpictotofa[$pictowithouttext];
+ $marginleftonlyshort=0;
+ }
+ elseif (! empty($arrayconvpictotofa[$pictowithouttext]))
+ {
+ $fakey = 'fa-'.$arrayconvpictotofa[$pictowithouttext];
+ $facolor = '#444';
+ $marginleftonlyshort=0;
}
else {
- $fakey = 'fa-'.$pictowithoutext;
+ $fakey = 'fa-'.$pictowithouttext;
$facolor = '#444';
$marginleftonlyshort=0;
}
@@ -4073,7 +4082,7 @@ function print_titre($title)
* @return void
* @deprecated Use print load_fiche_titre instead
*/
-function print_fiche_titre($title, $mesg = '', $picto = 'title_generic.png', $pictoisfullpath = 0, $id = '')
+function print_fiche_titre($title, $mesg = '', $picto = 'generic', $pictoisfullpath = 0, $id = '')
{
print load_fiche_titre($title, $mesg, $picto, $pictoisfullpath, $id);
}
@@ -4091,13 +4100,13 @@ function print_fiche_titre($title, $mesg = '', $picto = 'title_generic.png', $pi
* @return string
* @see print_barre_liste()
*/
-function load_fiche_titre($titre, $morehtmlright = '', $picto = 'title_generic.png', $pictoisfullpath = 0, $id = '', $morecssontable = '', $morehtmlcenter = '')
+function load_fiche_titre($titre, $morehtmlright = '', $picto = 'generic', $pictoisfullpath = 0, $id = '', $morecssontable = '', $morehtmlcenter = '')
{
global $conf;
$return='';
- if ($picto == 'setup') $picto='title_generic.png';
+ if ($picto == 'setup') $picto='generic';
$return.= "\n";
$return.= ''; // maring bottom must be same than into print_barre_list
@@ -4139,7 +4148,7 @@ function load_fiche_titre($titre, $morehtmlright = '', $picto = 'title_generic.p
* @param int $hidenavigation Force to hide all navigation tools
* @return void
*/
-function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '', $sortorder = '', $morehtmlcenter = '', $num = -1, $totalnboflines = '', $picto = 'title_generic.png', $pictoisfullpath = 0, $morehtmlright = '', $morecss = '', $limit = -1, $hideselectlimit = 0, $hidenavigation = 0)
+function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '', $sortorder = '', $morehtmlcenter = '', $num = -1, $totalnboflines = '', $picto = 'generic', $pictoisfullpath = 0, $morehtmlright = '', $morecss = '', $limit = -1, $hideselectlimit = 0, $hidenavigation = 0)
{
global $conf,$langs;
@@ -4148,7 +4157,7 @@ function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '',
$totalnboflines=abs($totalnboflines);
if ($picto == 'setup') $picto='title_setup.png';
- if (($conf->browser->name == 'ie') && $picto=='title_generic.png') $picto='title.gif';
+ if (($conf->browser->name == 'ie') && $picto=='generic') $picto='title.gif';
if ($limit < 0) $limit = $conf->liste_limit;
if ($savlimit != 0 && (($num > $limit) || ($num == -1) || ($limit == 0)))
{
@@ -8235,7 +8244,7 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url =
*
* @param string $label label of button
* @param string $helpText optional : content for help tooltip
- * @param string $iconClass class for icon element
+ * @param string $iconClass class for icon element (Example: 'fa fa-file')
* @param string $url the url for link
* @param string $id attribute id of button
* @param int $status 0 no user rights, 1 active, -1 Feature Disabled, -2 disable Other reason use helpText as tooltip
@@ -8251,12 +8260,12 @@ function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $u
return '';
}
- $class = 'btnTitle' ;
-
+ $class = 'btnTitle';
// hidden conf keep during button transition TODO: remove this block
- if(empty($conf->global->MAIN_USE_NEW_TITLE_BUTTON)){
+ if (empty($conf->global->MAIN_USE_NEW_TITLE_BUTTON)) {
$class = 'butActionNew';
}
+ if (! empty($params['morecss'])) $class.=' '.$params['morecss'];
$attr=array(
'class' => $class
@@ -8322,9 +8331,9 @@ function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $u
$TCompiledAttr[] = $key.'="'.$value.'"';
}
- $compiledAttributes = !empty($TCompiledAttr)?implode(' ', $TCompiledAttr):'';
+ $compiledAttributes = (empty($TCompiledAttr) ? '' : implode(' ', $TCompiledAttr));
- $tag = !empty($attr['href'])?'a':'span';
+ $tag = (empty($attr['href']) ? 'span' : 'a');
$button ='<'.$tag.' '.$compiledAttributes.' >';
diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php
index c1d42bf25b7..0b27e003b5f 100644
--- a/htdocs/core/lib/ticket.lib.php
+++ b/htdocs/core/lib/ticket.lib.php
@@ -108,7 +108,21 @@ function ticket_prepare_head($object)
// History
- $head[$h][0] = DOL_URL_ROOT.'/ticket/agenda.php?track_id=' . $object->track_id;
+ $ticketViewType = "messaging";
+ if(empty($_SESSION['ticket-view-type'])){
+ $_SESSION['ticket-view-type'] = $ticketViewType;
+ }
+ else{
+ $ticketViewType = $_SESSION['ticket-view-type'];
+ }
+
+ if($ticketViewType == "messaging"){
+ $head[$h][0] = DOL_URL_ROOT.'/ticket/messaging.php?track_id=' . $object->track_id;
+ }
+ else{
+ // $ticketViewType == "list"
+ $head[$h][0] = DOL_URL_ROOT.'/ticket/agenda.php?track_id=' . $object->track_id;
+ }
$head[$h][1] = $langs->trans('Events');
if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) ))
{
@@ -187,3 +201,612 @@ function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $
print '';
}
+
+
+
+/**
+ * Show html area with actions for ticket messaging.
+ * Note: Global parameter $param must be defined.
+ *
+ * @param Conf $conf Object conf
+ * @param Translate $langs Object langs
+ * @param DoliDB $db Object db
+ * @param mixed $filterobj Filter on object Adherent|Societe|Project|Product|CommandeFournisseur|Dolresource|Ticket|... to list events linked to an object
+ * @param Contact $objcon Filter on object contact to filter events on a contact
+ * @param int $noprint Return string but does not output it
+ * @param string $actioncode Filter on actioncode
+ * @param string $donetodo Filter on event 'done' or 'todo' or ''=nofilter (all).
+ * @param array $filters Filter on other fields
+ * @param string $sortfield Sort field
+ * @param string $sortorder Sort order
+ * @return string|void Return html part or void if noprint is 1
+ */
+function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $noprint = 0, $actioncode = '', $donetodo = 'done', $filters = array(), $sortfield = 'a.datep,a.id', $sortorder = 'DESC')
+{
+ global $user, $conf;
+ global $form;
+
+ global $param, $massactionbutton;
+
+ dol_include_once('/comm/action/class/actioncomm.class.php');
+
+ // Check parameters
+ if (! is_object($filterobj) && ! is_object($objcon)) dol_print_error('', 'BadParameter');
+
+ $out='';
+ $histo=array();
+ $numaction = 0 ;
+ $now=dol_now('tzuser');
+
+ // Open DSI -- Fix order by -- Begin
+ $sortfield_list = explode(',', $sortfield);
+ $sortfield_label_list = array('a.id' => 'id', 'a.datep' => 'dp', 'a.percent' => 'percent');
+ $sortfield_new_list = array();
+ foreach ($sortfield_list as $sortfield_value) {
+ $sortfield_new_list[] = $sortfield_label_list[trim($sortfield_value)];
+ }
+ $sortfield_new = implode(',', $sortfield_new_list);
+
+ if (! empty($conf->agenda->enabled))
+ {
+ // Recherche histo sur actioncomm
+ if (is_object($objcon) && $objcon->id > 0) {
+ $sql = "SELECT DISTINCT a.id, a.label as label,";
+ }
+ else
+ {
+ $sql = "SELECT a.id, a.label as label,";
+ }
+ $sql.= " a.datep as dp,";
+ $sql.= " a.note as message,";
+ $sql.= " a.datep2 as dp2,";
+ $sql.= " a.percent as percent, 'action' as type,";
+ $sql.= " a.fk_element, a.elementtype,";
+ $sql.= " a.fk_contact,";
+ $sql.= " c.code as acode, c.libelle as alabel, c.picto as apicto,";
+ $sql.= " u.rowid as user_id, u.login as user_login, u.photo as user_photo, u.firstname as user_firstname, u.lastname as user_lastname";
+ if (is_object($filterobj) && get_class($filterobj) == 'Societe') $sql.= ", sp.lastname, sp.firstname";
+ elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent') $sql.= ", m.lastname, m.firstname";
+ elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') $sql.= ", o.ref";
+ elseif (is_object($filterobj) && get_class($filterobj) == 'Product') $sql.= ", o.ref";
+ elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') $sql.= ", o.ref";
+ elseif (is_object($filterobj) && get_class($filterobj) == 'BOM') $sql.= ", o.ref";
+ elseif (is_object($filterobj) && get_class($filterobj) == 'Contrat') $sql.= ", o.ref";
+ $sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
+ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_action";
+ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON a.fk_action = c.id";
+
+ $force_filter_contact = false;
+ if (is_object($objcon) && $objcon->id > 0) {
+ $force_filter_contact = true;
+ $sql.= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm_resources as r ON a.id = r.fk_actioncomm";
+ $sql.= " AND r.element_type = '" . $db->escape($objcon->table_element) . "' AND r.fk_element = " . $objcon->id;
+ }
+
+ if (is_object($filterobj) && get_class($filterobj) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
+ elseif (is_object($filterobj) && get_class($filterobj) == 'Dolresource') {
+ $sql.= " INNER JOIN ".MAIN_DB_PREFIX."element_resources as er";
+ $sql.= " ON er.resource_type = 'dolresource'";
+ $sql.= " AND er.element_id = a.id";
+ $sql.= " AND er.resource_id = ".$filterobj->id;
+ }
+ elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m";
+ elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') $sql.= ", ".MAIN_DB_PREFIX."commande_fournisseur as o";
+ elseif (is_object($filterobj) && get_class($filterobj) == 'Product') $sql.= ", ".MAIN_DB_PREFIX."product as o";
+ elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') $sql.= ", ".MAIN_DB_PREFIX."ticket as o";
+ elseif (is_object($filterobj) && get_class($filterobj) == 'BOM') $sql.= ", ".MAIN_DB_PREFIX."bom_bom as o";
+ elseif (is_object($filterobj) && get_class($filterobj) == 'Contrat') $sql.= ", ".MAIN_DB_PREFIX."contrat as o";
+
+ $sql.= " WHERE a.entity IN (".getEntity('agenda').")";
+ if ($force_filter_contact === false) {
+ if (is_object($filterobj) && in_array(get_class($filterobj), array('Societe', 'Client', 'Fournisseur')) && $filterobj->id) $sql.= " AND a.fk_soc = ".$filterobj->id;
+ elseif (is_object($filterobj) && get_class($filterobj) == 'Project' && $filterobj->id) $sql.= " AND a.fk_project = ".$filterobj->id;
+ elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent')
+ {
+ $sql.= " AND a.fk_element = m.rowid AND a.elementtype = 'member'";
+ if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id;
+ }
+ elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur')
+ {
+ $sql.= " AND a.fk_element = o.rowid AND a.elementtype = 'order_supplier'";
+ if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id;
+ }
+ elseif (is_object($filterobj) && get_class($filterobj) == 'Product')
+ {
+ $sql.= " AND a.fk_element = o.rowid AND a.elementtype = 'product'";
+ if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id;
+ }
+ elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket')
+ {
+ $sql.= " AND a.fk_element = o.rowid AND a.elementtype = 'ticket'";
+ if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id;
+ }
+ elseif (is_object($filterobj) && get_class($filterobj) == 'BOM')
+ {
+ $sql.= " AND a.fk_element = o.rowid AND a.elementtype = 'bom'";
+ if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id;
+ }
+ elseif (is_object($filterobj) && get_class($filterobj) == 'Contrat')
+ {
+ $sql.= " AND a.fk_element = o.rowid AND a.elementtype = 'contract'";
+ if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id;
+ }
+ }
+
+ // Condition on actioncode
+ if (! empty($actioncode))
+ {
+ if (empty($conf->global->AGENDA_USE_EVENT_TYPE))
+ {
+ if ($actioncode == 'AC_NON_AUTO') $sql.= " AND c.type != 'systemauto'";
+ elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND c.type = 'systemauto'";
+ else
+ {
+ if ($actioncode == 'AC_OTH') $sql.= " AND c.type != 'systemauto'";
+ elseif ($actioncode == 'AC_OTH_AUTO') $sql.= " AND c.type = 'systemauto'";
+ }
+ }
+ else
+ {
+ if ($actioncode == 'AC_NON_AUTO') $sql.= " AND c.type != 'systemauto'";
+ elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND c.type = 'systemauto'";
+ else $sql.= " AND c.code = '".$db->escape($actioncode)."'";
+ }
+ }
+ if ($donetodo == 'todo') $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))";
+ elseif ($donetodo == 'done') $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))";
+ if (is_array($filters) && $filters['search_agenda_label']) $sql.= natural_search('a.label', $filters['search_agenda_label']);
+ }
+
+ // Add also event from emailings. TODO This should be replaced by an automatic event ? May be it's too much for very large emailing.
+ if (! empty($conf->mailing->enabled) && ! empty($objcon->email)
+ && (empty($actioncode) || $actioncode == 'AC_OTH_AUTO' || $actioncode == 'AC_EMAILING'))
+ {
+ $langs->load("mails");
+
+ $sql2 = "SELECT m.rowid as id, m.titre as label, mc.date_envoi as dp, mc.date_envoi as dp2, '100' as percent, 'mailing' as type";
+ $sql2.= ", '' as fk_element, '' as elementtype, '' as contact_id";
+ $sql2.= ", 'AC_EMAILING' as acode, '' as alabel, '' as apicto";
+ $sql2.= ", u.rowid as user_id, u.login as user_login, u.photo as user_photo, u.firstname as user_firstname, u.lastname as user_lastname"; // User that valid action
+ if (is_object($filterobj) && get_class($filterobj) == 'Societe') $sql2.= ", '' as lastname, '' as firstname";
+ elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent') $sql2.= ", '' as lastname, '' as firstname";
+ elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') $sql2.= ", '' as ref";
+ elseif (is_object($filterobj) && get_class($filterobj) == 'Product') $sql2.= ", '' as ref";
+ elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') $sql2.= ", '' as ref";
+ $sql2.= " FROM ".MAIN_DB_PREFIX."mailing as m, ".MAIN_DB_PREFIX."mailing_cibles as mc, ".MAIN_DB_PREFIX."user as u";
+ $sql2.= " WHERE mc.email = '".$db->escape($objcon->email)."'"; // Search is done on email.
+ $sql2.= " AND mc.statut = 1";
+ $sql2.= " AND u.rowid = m.fk_user_valid";
+ $sql2.= " AND mc.fk_mailing=m.rowid";
+ }
+
+ if (!empty($sql) && !empty($sql2)) {
+ $sql = $sql . " UNION " . $sql2;
+ } elseif (empty($sql) && !empty($sql2)) {
+ $sql = $sql2;
+ }
+
+ //TODO Add limit in nb of results
+ $sql.= $db->order($sortfield_new, $sortorder);
+ dol_syslog("company.lib::show_actions_done", LOG_DEBUG);
+ $resql=$db->query($sql);
+ if ($resql)
+ {
+ $i = 0 ;
+ $num = $db->num_rows($resql);
+
+ while ($i < $num)
+ {
+ $obj = $db->fetch_object($resql);
+
+ if ($obj->type == 'action') {
+ $contactaction = new ActionComm($db);
+ $contactaction->id=$obj->id;
+ $result = $contactaction->fetchResources();
+ if ($result<0) {
+ dol_print_error($db);
+ setEventMessage("company.lib::show_actions_done Error fetch ressource", 'errors');
+ }
+
+ //if ($donetodo == 'todo') $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))";
+ //elseif ($donetodo == 'done') $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))";
+ $tododone='';
+ if (($obj->percent >= 0 and $obj->percent < 100) || ($obj->percent == -1 && $obj->datep > $now)) $tododone='todo';
+
+ $histo[$numaction]=array(
+ 'type'=>$obj->type,
+ 'tododone'=>$tododone,
+ 'id'=>$obj->id,
+ 'datestart'=>$db->jdate($obj->dp),
+ 'dateend'=>$db->jdate($obj->dp2),
+ 'note'=>$obj->label,
+ 'message'=>$obj->message,
+ 'percent'=>$obj->percent,
+
+ 'userid'=>$obj->user_id,
+ 'login'=>$obj->user_login,
+ 'userfirstname'=>$obj->user_firstname,
+ 'userlastname'=>$obj->user_lastname,
+ 'userphoto'=>$obj->user_photo,
+
+ 'contact_id'=>$obj->fk_contact,
+ 'socpeopleassigned' => $contactaction->socpeopleassigned,
+ 'lastname'=>$obj->lastname,
+ 'firstname'=>$obj->firstname,
+ 'fk_element'=>$obj->fk_element,
+ 'elementtype'=>$obj->elementtype,
+ // Type of event
+ 'acode'=>$obj->acode,
+ 'alabel'=>$obj->alabel,
+ 'libelle'=>$obj->alabel, // deprecated
+ 'apicto'=>$obj->apicto
+ );
+ } else {
+ $histo[$numaction]=array(
+ 'type'=>$obj->type,
+ 'tododone'=>'done',
+ 'id'=>$obj->id,
+ 'datestart'=>$db->jdate($obj->dp),
+ 'dateend'=>$db->jdate($obj->dp2),
+ 'note'=>$obj->label,
+ 'message'=>$obj->message,
+ 'percent'=>$obj->percent,
+ 'acode'=>$obj->acode,
+
+ 'userid'=>$obj->user_id,
+ 'login'=>$obj->user_login,
+ 'userfirstname'=>$obj->user_firstname,
+ 'userlastname'=>$obj->user_lastname,
+ 'userphoto'=>$obj->user_photo
+ );
+ }
+
+ $numaction++;
+ $i++;
+ }
+ }
+ else
+ {
+ dol_print_error($db);
+ }
+
+ if (! empty($conf->agenda->enabled) || (! empty($conf->mailing->enabled) && ! empty($objcon->email)))
+ {
+ $delay_warning=$conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60;
+
+ require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
+ include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
+ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
+ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
+
+ $formactions=new FormActions($db);
+
+ $actionstatic=new ActionComm($db);
+ $userstatic=new User($db);
+ $contactstatic = new Contact($db);
+ $userGetNomUrlCache = array();
+
+ $out.=' ';
+ // Bill time
+ if (empty($conf->global->PROJECT_HIDE_TASKS) && ! empty($conf->global->PROJECT_BILL_TIME_SPENT))
+ {
+ print '| '.$langs->trans("BillTime").' | ';
+ print yn($object->usage_bill_time);
+ print ' | ';
+ }
+
// Categories
if($conf->categorie->enabled) {
print '| '.$langs->trans("Categories").' | ';
@@ -234,10 +242,10 @@ if ($user->rights->projet->all->creer || $user->rights->projet->creer) {
$linktocreatetask = dolGetButtonTitle($langs->trans('AddTask'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id.'&action=create'.$param.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$object->id), '', $linktocreatetaskUserRight, $linktocreatetaskParam);
-$linktolist = dolGetButtonTitle($langs->trans('GoToListOfTasks'), '', 'fa fa-tasks paddingleft', DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id);
+$linktolist = dolGetButtonTitle($langs->trans('GoToListOfTasks'), '', 'fa fa-list-alt paddingleft imgforviewmode', DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id, '', 1, array('morecss'=>'reposition'));
-//print_barre_liste($title, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $linktotasks, $num, $totalnboflines, 'title_generic.png', 0, '', '', 0, 1);
-print load_fiche_titre($title, $linktolist.' '.$linktocreatetask, 'title_generic.png');
+//print_barre_liste($title, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $linktotasks, $num, $totalnboflines, 'generic', 0, '', '', 0, 1);
+print load_fiche_titre($title, $linktolist.' '.$linktocreatetask, 'generic');
// Get list of tasks in tasksarray and taskarrayfiltered
diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php
index 6b9247530fd..ba15aef57cf 100644
--- a/htdocs/projet/index.php
+++ b/htdocs/projet/index.php
@@ -88,7 +88,7 @@ $morehtml.='';
$morehtml.='';
$morehtml.='';
-print_barre_liste($title, 0, $_SERVER["PHP_SELF"], '', '', '', '', 0, -1, 'title_project.png', 0, $morehtml);
+print_barre_liste($title, 0, $_SERVER["PHP_SELF"], '', '', '', '', 0, -1, 'project', 0, $morehtml);
// Show description of content
print '';
diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php
index dd29a401bf7..fef42957bab 100644
--- a/htdocs/projet/tasks.php
+++ b/htdocs/projet/tasks.php
@@ -669,10 +669,10 @@ elseif ($id > 0 || ! empty($ref))
print ' ';
$title=$langs->trans("ListOfTasks");
- $linktotasks = dolGetButtonTitle($langs->trans('GoToGanttView'), '', 'fa fa-calendar-minus-o paddingleft', DOL_URL_ROOT.'/projet/ganttview.php?id='.$object->id.'&withproject=1');
+ $linktotasks = dolGetButtonTitle($langs->trans('GoToGanttView'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/projet/ganttview.php?id='.$object->id.'&withproject=1', '', 1, array('morecss'=>'reposition'));
- //print_barre_liste($title, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $linktotasks, $num, $totalnboflines, 'title_generic.png', 0, '', '', 0, 1);
- print load_fiche_titre($title, $linktotasks.' '.$linktocreatetask, 'title_generic.png');
+ //print_barre_liste($title, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $linktotasks, $num, $totalnboflines, 'generic', 0, '', '', 0, 1);
+ print load_fiche_titre($title, $linktotasks.' '.$linktocreatetask, 'generic');
// Get list of tasks in tasksarray and taskarrayfiltered
// We need all tasks (even not limited to a user because a task to user can have a parent that is not affected to him).
diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php
index d4c4a6d8473..9e8e71f5b32 100644
--- a/htdocs/projet/tasks/time.php
+++ b/htdocs/projet/tasks/time.php
@@ -941,7 +941,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
$title=$langs->trans("ListTaskTimeUserProject");
- print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_generic', 0, $linktocreatetime, '', $limit);
+ print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'generic', 0, $linktocreatetime, '', $limit);
}
else
{
@@ -949,7 +949,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
$title=$langs->trans("ListTaskTimeForTask");
- print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_generic', 0, $linktocreatetime, '', $limit);
+ print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'generic', 0, $linktocreatetime, '', $limit);
}
$i = 0;
diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php
index 81f46897cc6..151f8486577 100644
--- a/htdocs/public/members/new.php
+++ b/htdocs/public/members/new.php
@@ -645,6 +645,7 @@ print ' | '.$langs->trans("URLPhoto").' | | | '."\n";
// Other attributes
+$tpl_context = 'public'; //BUG #11554 : define templae context to public
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
// Comments
print ' ';
diff --git a/htdocs/resource/card.php b/htdocs/resource/card.php
index 4ec52539188..02f9fbc1073 100644
--- a/htdocs/resource/card.php
+++ b/htdocs/resource/card.php
@@ -226,7 +226,7 @@ if ($action == 'create' || $object->fetch($id) > 0)
{
if ($action == 'create')
{
- print load_fiche_titre($title, '', 'title_generic');
+ print load_fiche_titre($title, '', 'generic');
dol_fiche_head('');
}
else
diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php
index d9547ad441b..8151cebf05f 100644
--- a/htdocs/resource/list.php
+++ b/htdocs/resource/list.php
@@ -199,7 +199,7 @@ if($ret == -1) {
$newcardbutton.= dolGetButtonTitle($langs->trans('MenuResourceAdd'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/resource/card.php?action=create');
}
- print_barre_liste($pagetitle, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $ret+1, $nbtotalofrecords, 'title_generic.png', 0, $newcardbutton, '', $limit);
+ print_barre_liste($pagetitle, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $ret+1, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit);
}
$moreforfilter = '';
diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php
index ab224245de8..074c71a76b3 100644
--- a/htdocs/societe/card.php
+++ b/htdocs/societe/card.php
@@ -1513,7 +1513,7 @@ else
print '| '.$form->editfieldkey('AllocateCommercial', 'commercial_id', '', $object, 0).' | ';
print '';
$userlist = $form->select_dolusers('', '', 0, null, 0, '', '', 0, 0, 0, '', 0, '', '', 0, 1);
- // Note: If user has no right to "see all thirdparties", we for selection of sale representative to him, so after creation he can see the record.
+ // Note: If user has no right to "see all thirdparties", we force selection of sale representative to him, so after creation he can see the record.
$selected = (count(GETPOST('commercial', 'array')) > 0 ? GETPOST('commercial', 'array') : (GETPOST('commercial', 'int') > 0 ? array(GETPOST('commercial', 'int')) : (empty($user->rights->societe->client->voir)?array($user->id):array())));
print $form->multiselectarray('commercial', $userlist, $selected, null, null, null, null, "90%");
print ' | ';
diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php
index 2010edeb217..acfd42a064d 100644
--- a/htdocs/societe/index.php
+++ b/htdocs/societe/index.php
@@ -55,7 +55,7 @@ $helpurl='EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Terceros';
llxHeader("", $langs->trans("ThirdParties"), $helpurl);
$linkback='';
-print load_fiche_titre($transAreaType, $linkback, 'title_companies.png');
+print load_fiche_titre($transAreaType, $linkback, 'companies');
//print ' ';
diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php
index 0c65ae5150f..dd678b51605 100644
--- a/htdocs/supplier_proposal/list.php
+++ b/htdocs/supplier_proposal/list.php
@@ -403,7 +403,7 @@ if ($resql)
print '';
print '';
- print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_commercial.png', 0, $newcardbutton, '', $limit);
+ print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'commercial', 0, $newcardbutton, '', $limit);
$topicmail="SendSupplierProposalRef";
$modelmail="supplier_proposal_send";
diff --git a/htdocs/takepos/admin/receipt.php b/htdocs/takepos/admin/receipt.php
new file mode 100644
index 00000000000..92333394edc
--- /dev/null
+++ b/htdocs/takepos/admin/receipt.php
@@ -0,0 +1,153 @@
+
+ * Copyright (C) 2011-2017 Juanjo Menent
+ * Copyright (C) 2019 Andreu Bisquerra Gaya
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+/**
+ * \file htdocs/takepos/admin/terminal.php
+ * \ingroup takepos
+ * \brief Setup page for TakePos module
+ */
+
+require '../../main.inc.php'; // Load $user and permissions
+require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
+require_once DOL_DOCUMENT_ROOT."/core/lib/takepos.lib.php";
+
+// Security check
+if (!$user->admin) accessforbidden();
+
+$langs->loadLangs(array("admin", "cashdesk", "commercial"));
+
+/*
+ * Actions
+ */
+
+if (GETPOST('action', 'alpha') == 'set')
+{
+ $db->begin();
+
+ $res = dolibarr_set_const($db, "TAKEPOS_HEADER", GETPOST('TAKEPOS_HEADER', 'alpha'), 'chaine', 0, '', $conf->entity);
+ $res = dolibarr_set_const($db, "TAKEPOS_FOOTER", GETPOST('TAKEPOS_FOOTER', 'alpha'), 'chaine', 0, '', $conf->entity);
+ $res = dolibarr_set_const($db, "TAKEPOS_RECEIPT_NAME", GETPOST('TAKEPOS_RECEIPT_NAME', 'alpha'), 'chaine', 0, '', $conf->entity);
+ $res = dolibarr_set_const($db, "TAKEPOS_SHOW_CUSTOMER", GETPOST('TAKEPOS_SHOW_CUSTOMER', 'alpha'), 'chaine', 0, '', $conf->entity);
+
+ dol_syslog("admin/cashdesk: level ".GETPOST('level', 'alpha'));
+
+ if (! $res > 0) $error++;
+
+ if (! $error)
+ {
+ $db->commit();
+ setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
+ }
+ else
+ {
+ $db->rollback();
+ setEventMessages($langs->trans("Error"), null, 'errors');
+ }
+}
+
+
+/*
+ * View
+ */
+
+$form=new Form($db);
+$formproduct=new FormProduct($db);
+
+llxHeader('', $langs->trans("CashDeskSetup"));
+
+$linkback=''.$langs->trans("BackToModuleList").'';
+print load_fiche_titre($langs->trans("CashDeskSetup").' (TakePOS)', $linkback, 'title_setup');
+$head = takepos_prepare_head();
+dol_fiche_head($head, 'receipt', 'TakePOS', -1);
+print ' ';
+
+
+// Mode
+print '\n";
+
+print ' ';
+
+llxFooter();
+$db->close();
diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php
index 23e6eb05c48..5d7d2057ca1 100644
--- a/htdocs/takepos/admin/setup.php
+++ b/htdocs/takepos/admin/setup.php
@@ -75,11 +75,10 @@ if (GETPOST('action', 'alpha') == 'set')
$res = dolibarr_set_const($db, "TAKEPOS_ORDER_NOTES", GETPOST('TAKEPOS_ORDER_NOTES', 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_PHONE_BASIC_LAYOUT", GETPOST('TAKEPOS_PHONE_BASIC_LAYOUT', 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_AUTO_PRINT_TICKETS", GETPOST('TAKEPOS_AUTO_PRINT_TICKETS', 'int'), 'int', 0, '', $conf->entity);
- $res = dolibarr_set_const($db, "TAKEPOS_HEADER", GETPOST('TAKEPOS_HEADER', 'alpha'), 'chaine', 0, '', $conf->entity);
- $res = dolibarr_set_const($db, "TAKEPOS_FOOTER", GETPOST('TAKEPOS_FOOTER', 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_NUMPAD", GETPOST('TAKEPOS_NUMPAD', 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_NUM_TERMINALS", GETPOST('TAKEPOS_NUM_TERMINALS', 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_DIRECT_PAYMENT", GETPOST('TAKEPOS_DIRECT_PAYMENT', 'int'), 'int', 0, '', $conf->entity);
+ $res = dolibarr_set_const($db, "TAKEPOS_CUSTOM_RECEIPT", GETPOST('TAKEPOS_CUSTOM_RECEIPT', 'int'), 'int', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_EMAIL_TEMPLATE_INVOICE", GETPOST('TAKEPOS_EMAIL_TEMPLATE_INVOICE', 'alpha'), 'chaine', 0, '', $conf->entity);
if ($conf->global->TAKEPOS_ORDER_NOTES==1)
@@ -232,6 +231,13 @@ print '';
print $form->selectyesno("TAKEPOS_DIRECT_PAYMENT", $conf->global->TAKEPOS_DIRECT_PAYMENT, 1);
print " | \n";
+// Custom Receipt
+print '| ';
+print $langs->trans('CustomReceipt');
+print ' | ';
+print $form->selectyesno("TAKEPOS_CUSTOM RECEIPT", $conf->global->TAKEPOS_CUSTOM_RECEIPT, 1);
+print " | \n";
+
// Email template for send invoice
print '| ';
print $langs->trans('EmailTemplate');
@@ -256,44 +262,6 @@ if (is_array($formmail->lines_model))
print $form->selectarray('TAKEPOS_EMAIL_TEMPLATE_INVOICE', $arrayofmessagename, $conf->global->TAKEPOS_EMAIL_TEMPLATE_INVOICE, 'None', 1, 0, '', 0, 0, 0, '', '', 1);
print " | \n";
-$substitutionarray=pdf_getSubstitutionArray($langs, null, null, 2);
-$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
-$htmltext = ''.$langs->trans("AvailableVariables").': ';
-foreach($substitutionarray as $key => $val) $htmltext.=$key.' ';
-$htmltext.='';
-
-print '';
-print $form->textwithpicto($langs->trans("FreeLegalTextOnInvoices")." - ".$langs->trans("Header"), $htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').' ';
-print ' | ';
-$variablename='TAKEPOS_HEADER';
-if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
-{
- print '';
-}
-else
-{
- include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
- $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
- print $doleditor->Create();
-}
-print " | \n";
-
-print '';
-print $form->textwithpicto($langs->trans("FreeLegalTextOnInvoices")." - ".$langs->trans("Footer"), $htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').' ';
-print ' | ';
-$variablename='TAKEPOS_FOOTER';
-if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
-{
- print '';
-}
-else
-{
- include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
- $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
- print $doleditor->Create();
-}
-print " | \n";
-
print ' ';
print ' ';
diff --git a/htdocs/takepos/receipt.php b/htdocs/takepos/receipt.php
index 5905592607c..35e3bd7f836 100644
--- a/htdocs/takepos/receipt.php
+++ b/htdocs/takepos/receipt.php
@@ -28,7 +28,7 @@
require '../main.inc.php'; // Load $user and permissions
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
-$langs->loadLangs(array("main", "cashdesk"));
+$langs->loadLangs(array("main", "cashdesk", "companies"));
$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant
@@ -54,6 +54,14 @@ if ($place > 0)
$object=new Facture($db);
$object->fetch($facid);
+// Call to external receipt modules if exist
+$hookmanager->initHooks(array('takeposfrontend'), $facid);
+$reshook=$hookmanager->executeHooks('TakeposReceipt', $parameters, $object);
+if (!empty($hookmanager->resPrint)) {
+ print $hookmanager->resPrint;
+ exit;
+}
+
// IMPORTANT: This file is sended to 'Takepos Printing' application. Keep basic file. No external files as css, js... If you need images use absolute path.
?>
@@ -77,19 +85,34 @@ $object->fetch($facid);
global->TAKEPOS_HEADER))
+if ($conf->global->TAKEPOS_CUSTOM_RECEIPT)
{
- $newfreetext=make_substitutions($conf->global->TAKEPOS_HEADER, $substitutionarray);
- echo $newfreetext;
+ $substitutionarray=getCommonSubstitutionArray($langs);
+ if (! empty($conf->global->TAKEPOS_HEADER))
+ {
+ $newfreetext=make_substitutions($conf->global->TAKEPOS_HEADER, $substitutionarray);
+ echo $newfreetext;
+ }
}
?>
trans('Date')." ".dol_print_date($object->date, 'day').' ';
-if ($mysoc->country_code == 'ES') print "Factura simplificada ";
+if ($conf->global->TAKEPOS_CUSTOM_RECEIPT) print $conf->global->TAKEPOS_RECEIPT_NAME." ";
print $object->ref;
+if ($conf->global->TAKEPOS_CUSTOM_RECEIPT && $conf->global->TAKEPOS_SHOW_CUSTOMER)
+{
+ $soc = new Societe($db);
+ $soc->fetch($invoice->socid);
+ if ($invoice->socid != $conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"]})
+ {
+ $soc = new Societe($db);
+ if ($invoice->socid > 0) $soc->fetch($invoice->socid);
+ else $soc->fetch($conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"]});
+ print " ".$langs->trans("Customer").': '.$soc->name;
+ }
+}
?>
@@ -160,11 +183,13 @@ print $object->ref;
global->TAKEPOS_FOOTER))
+if ($conf->global->TAKEPOS_CUSTOM_RECEIPT)
{
- $newfreetext=make_substitutions($conf->global->TAKEPOS_FOOTER, $substitutionarray);
- echo $newfreetext;
+ $substitutionarray=getCommonSubstitutionArray($langs);
+ if (! empty($conf->global->TAKEPOS_FOOTER)){
+ $newfreetext=make_substitutions($conf->global->TAKEPOS_FOOTER, $substitutionarray);
+ echo $newfreetext;
+ }
}
?>
diff --git a/htdocs/theme/eldy/btn.inc.php b/htdocs/theme/eldy/btn.inc.php
index 2ba1d8e3b3b..a3000715712 100644
--- a/htdocs/theme/eldy/btn.inc.php
+++ b/htdocs/theme/eldy/btn.inc.php
@@ -68,19 +68,29 @@ span.butActionNewRefused>span.fa-plus-circle, span.butActionNewRefused>span.fa-p
a.butActionNew>span.fa-list-alt, a.butActionNew>span.fa-list-alt:hover,
span.butActionNew>span.fa-list-alt, span.butActionNew>span.fa-list-alt:hover,
a.butActionNewRefused>span.fa-list-alt, a.butActionNewRefused>span.fa-list-alt:hover,
-span.butActionNewRefused>span.fa-list-alt, span.butActionNewRefused>span.fa-list-alt:hover {
+span.butActionNewRefused>span.fa-list-alt, span.butActionNewRefused>span.fa-list-alt:hover
+{
font-size: 1em;
padding-left: 0px;
}
-a.butActionNew>span.fa-plus-circle, a.butActionNew>span.fa-plus-circle:hover,
+/*a.butActionNew>span.fa-plus-circle, a.butActionNew>span.fa-plus-circle:hover,
span.butActionNew>span.fa-plus-circle, span.butActionNew>span.fa-plus-circle:hover,
a.butActionNewRefused>span.fa-plus-circle, a.butActionNewRefused>span.fa-plus-circle:hover,
span.butActionNewRefused>span.fa-plus-circle, span.butActionNewRefused>span.fa-plus-circle:hover,
a.butActionNew>span.fa-list-alt, a.butActionNew>span.fa-list-alt:hover,
span.butActionNew>span.fa-list-alt, span.butActionNew>span.fa-list-alt:hover,
a.butActionNewRefused>span.fa-list-alt, a.butActionNewRefused>span.fa-list-alt:hover,
-span.butActionNewRefused>span.fa-list-alt, span.butActionNewRefused>span.fa-list-alt:hover {
+span.butActionNewRefused>span.fa-list-alt, span.butActionNewRefused>span.fa-list-alt:hover,
+a.butActionNew>span.fa-comment-dots, a.butActionNew>span.fa-comment-dots:hover,
+span.butActionNew>span.fa-comment-dots, span.butActionNew>span.fa-comment-dots:hover,
+a.butActionNewRefused>span.fa-comment-dots, a.butActionNewRefused>span.fa-comment-dots:hover,
+span.butActionNewRefused>span.fa-comment-dots, span.butActionNewRefused>span.fa-comment-dots:hover,*/
+a.butActionNew>span.fa, a.butActionNew>span.fa:hover,
+span.butActionNew>span.fa, span.butActionNew>span.fa:hover,
+a.butActionNewRefused>span.fa, a.butActionNewRefused>span.fa:hover,
+span.butActionNewRefused>span.fa, span.butActionNewRefused>span.fa:hover
+{
padding-: 6px;
font-size: 1.5em;
border: none;
@@ -224,8 +234,14 @@ TITLE BUTTON
display: block;
}
+div.pagination li:first-child a.btnTitle{
+ margin-left: 10px;
+}
+.imgforviewmode {
+ color: #aaa;
+}
global->MAIN_BUTTON_HIDE_UNAUTHORIZED) && (! $user->admin)) { ?>
diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php
index 561da969cdd..7e1a52bf59b 100644
--- a/htdocs/theme/eldy/global.inc.php
+++ b/htdocs/theme/eldy/global.inc.php
@@ -249,8 +249,9 @@ select.flat, form.flat select {
select:invalid {
color: gray;
}
-input:disabled {
- background:#ddd;
+input:disabled, textarea:disabled, select[disabled='disabled']
+{
+ background:#eee;
}
input.liste_titre {
@@ -261,9 +262,6 @@ input.removedfile {
border: 0px !important;
vertical-align: text-bottom;
}
-textarea:disabled {
- background:#ddd;
-}
input[type=file ] { background-color: transparent; border-top: none; border-left: none; border-right: none; box-shadow: none; }
input[type=checkbox] { background-color: transparent; border: none; box-shadow: none; }
input[type=radio] { background-color: transparent; border: none; box-shadow: none; }
@@ -5861,3 +5859,4 @@ div.tabsElem a.tab {
include dol_buildpath($path.'/theme/'.$theme.'/dropdown.inc.php', 0);
include dol_buildpath($path.'/theme/'.$theme.'/info-box.inc.php', 0);
include dol_buildpath($path.'/theme/'.$theme.'/progress.inc.php', 0);
+include dol_buildpath($path.'/theme/'.$theme.'/timeline.inc.php', 0);
diff --git a/htdocs/theme/eldy/timeline.inc.php b/htdocs/theme/eldy/timeline.inc.php
new file mode 100644
index 00000000000..2cb3461d713
--- /dev/null
+++ b/htdocs/theme/eldy/timeline.inc.php
@@ -0,0 +1,197 @@
+
+ * License: Open source - MIT
+ * Please visit http://opensource.org/licenses/MIT for more information
+ */
+
+if (! defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
+/* |
|