Merge branch '11.0' of git@github.com:Dolibarr/dolibarr.git into develop

Conflicts:
	htdocs/core/boxes/box_graph_product_distribution.php
This commit is contained in:
Laurent Destailleur 2020-03-06 14:22:42 +01:00
commit d0f22c7bff
9 changed files with 44 additions and 50 deletions

View File

@ -1165,9 +1165,7 @@ if ($resql)
$nbofsalesrepresentative = count($listsalesrepresentatives); $nbofsalesrepresentative = count($listsalesrepresentatives);
if ($nbofsalesrepresentative > 3) // We print only number if ($nbofsalesrepresentative > 3) // We print only number
{ {
print '<a href="'.DOL_URL_ROOT.'/societe/commerciaux.php?socid='.$companystatic->id.'">';
print $nbofsalesrepresentative; print $nbofsalesrepresentative;
print '</a>';
} }
elseif ($nbofsalesrepresentative > 0) elseif ($nbofsalesrepresentative > 0)
{ {

View File

@ -705,9 +705,7 @@ while ($i < min($num, $limit))
$nbofsalesrepresentative = count($listsalesrepresentatives); $nbofsalesrepresentative = count($listsalesrepresentatives);
if ($nbofsalesrepresentative > 3) { if ($nbofsalesrepresentative > 3) {
// We print only number // We print only number
print '<a href="'.DOL_URL_ROOT.'/societe/commerciaux.php?socid='.$socstatic->id.'">';
print $nbofsalesrepresentative; print $nbofsalesrepresentative;
print '</a>';
} }
elseif ($nbofsalesrepresentative > 0) elseif ($nbofsalesrepresentative > 0)
{ {

View File

@ -75,6 +75,7 @@ class box_graph_product_distribution extends ModeleBoxes
global $conf, $user, $langs; global $conf, $user, $langs;
$this->max = $max; $this->max = $max;
$dir = $conf->user->dir_temp;
$refreshaction = 'refresh_'.$this->boxcode; $refreshaction = 'refresh_'.$this->boxcode;

View File

@ -568,12 +568,12 @@ abstract class CommonDocGenerator
'line_price_ttc_locale'=>price($line->total_ttc, 0, $outputlangs), 'line_price_ttc_locale'=>price($line->total_ttc, 0, $outputlangs),
'line_price_vat_locale'=>price($line->total_tva, 0, $outputlangs), 'line_price_vat_locale'=>price($line->total_tva, 0, $outputlangs),
// Dates // Dates
'line_date_start'=>dol_print_date($line->date_start, 'day', 'tzuser'), 'line_date_start'=>dol_print_date($line->date_start, 'day'),
'line_date_start_locale'=>dol_print_date($line->date_start, 'day', 'tzuser', $outputlangs), 'line_date_start_locale'=>dol_print_date($line->date_start, 'day', 'tzserver', $outputlangs),
'line_date_start_rfc'=>dol_print_date($line->date_start, 'dayrfc', 'tzuser'), 'line_date_start_rfc'=>dol_print_date($line->date_start, 'dayrfc'),
'line_date_end'=>dol_print_date($line->date_end, 'day', 'tzuser'), 'line_date_end'=>dol_print_date($line->date_end, 'day'),
'line_date_end_locale'=>dol_print_date($line->date_end, 'day', 'tzuser', $outputlangs), 'line_date_end_locale'=>dol_print_date($line->date_end, 'day', 'tzserver', $outputlangs),
'line_date_end_rfc'=>dol_print_date($line->date_end, 'dayrfc', 'tzuser'), 'line_date_end_rfc'=>dol_print_date($line->date_end, 'dayrfc'),
'line_multicurrency_code' => price2num($line->multicurrency_code), 'line_multicurrency_code' => price2num($line->multicurrency_code),
'line_multicurrency_subprice' => price2num($line->multicurrency_subprice), 'line_multicurrency_subprice' => price2num($line->multicurrency_subprice),

View File

@ -5420,7 +5420,7 @@ abstract class CommonObject
// Add field of attribute // Add field of attribute
if ($extrafields->attributes[$this->table_element]['type'][$attributeKey] != 'separate') // Only for other type than separator) if ($extrafields->attributes[$this->table_element]['type'][$attributeKey] != 'separate') // Only for other type than separator)
{ {
if ($new_array_options[$key] != '') if ($new_array_options[$key] != '' || $new_array_options[$key] == '0')
{ {
$sql .= ",'".$this->db->escape($new_array_options[$key])."'"; $sql .= ",'".$this->db->escape($new_array_options[$key])."'";
} }
@ -5522,7 +5522,7 @@ abstract class CommonObject
$this->errors[] = $langs->trans("ExtraFieldHasWrongValue", $attributeLabel); $this->errors[] = $langs->trans("ExtraFieldHasWrongValue", $attributeLabel);
return -1; return -1;
} }
elseif ($value == '') elseif ($value === '')
{ {
$this->array_options["options_".$key] = null; $this->array_options["options_".$key] = null;
} }
@ -5535,7 +5535,7 @@ abstract class CommonObject
$this->errors[] = $langs->trans("ExtraFieldHasWrongValue", $attributeLabel); $this->errors[] = $langs->trans("ExtraFieldHasWrongValue", $attributeLabel);
return -1; return -1;
} }
elseif ($value == '') elseif ($value === '')
{ {
$this->array_options["options_".$key] = null; $this->array_options["options_".$key] = null;
} }

View File

@ -5070,15 +5070,15 @@ function migrate_members_socialnetworks()
print '<tr><td colspan="4">'; print '<tr><td colspan="4">';
$sql = 'SELECT rowid, socialnetworks'; $sql = 'SELECT rowid, socialnetworks';
$sql .= ', skype, twitter, facebook, linkedin, instagram, snapchat, googleplus, youtube, whatsapp FROM '.MAIN_DB_PREFIX.'adherent WHERE '; $sql .= ', skype, twitter, facebook, linkedin, instagram, snapchat, googleplus, youtube, whatsapp FROM '.MAIN_DB_PREFIX.'adherent WHERE ';
$sql .= ' skype IS NOT NULL OR skype!=""'; $sql .= " skype IS NOT NULL OR skype <> ''";
$sql .= ' OR twitter IS NOT NULL OR twitter!=""'; $sql .= " OR twitter IS NOT NULL OR twitter <> ''";
$sql .= ' OR facebook IS NOT NULL OR facebook!=""'; $sql .= " OR facebook IS NOT NULL OR facebook <> ''";
$sql .= ' OR linkedin IS NOT NULL OR linkedin!=""'; $sql .= " OR linkedin IS NOT NULL OR linkedin <> ''";
$sql .= ' OR instagram IS NOT NULL OR instagram!=""'; $sql .= " OR instagram IS NOT NULL OR instagram <> ''";
$sql .= ' OR snapchat IS NOT NULL OR snapchat!=""'; $sql .= " OR snapchat IS NOT NULL OR snapchat <> ''";
$sql .= ' OR googleplus IS NOT NULL OR googleplus!=""'; $sql .= " OR googleplus IS NOT NULL OR googleplus <> ''";
$sql .= ' OR youtube IS NOT NULL OR youtube!=""'; $sql .= " OR youtube IS NOT NULL OR youtube <> ''";
$sql .= ' OR whatsapp IS NOT NULL OR whatsapp!=""'; $sql .= " OR whatsapp IS NOT NULL OR whatsapp <> ''";
//print $sql; //print $sql;
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) { if ($resql) {
@ -5160,16 +5160,16 @@ function migrate_contacts_socialnetworks()
print '<tr><td colspan="4">'; print '<tr><td colspan="4">';
$sql = 'SELECT rowid, socialnetworks'; $sql = 'SELECT rowid, socialnetworks';
$sql .= ', jabberid, skype, twitter, facebook, linkedin, instagram, snapchat, googleplus, youtube, whatsapp FROM '.MAIN_DB_PREFIX.'socpeople WHERE '; $sql .= ', jabberid, skype, twitter, facebook, linkedin, instagram, snapchat, googleplus, youtube, whatsapp FROM '.MAIN_DB_PREFIX.'socpeople WHERE ';
$sql .= ' jabberid IS NOT NULL OR jabberid!=""'; $sql .= " jabberid IS NOT NULL OR jabberid <> ''";
$sql .= ' OR skype IS NOT NULL OR skype!=""'; $sql .= " OR skype IS NOT NULL OR skype <> ''";
$sql .= ' OR twitter IS NOT NULL OR twitter!=""'; $sql .= " OR twitter IS NOT NULL OR twitter <> ''";
$sql .= ' OR facebook IS NOT NULL OR facebook!=""'; $sql .= " OR facebook IS NOT NULL OR facebook <> ''";
$sql .= ' OR linkedin IS NOT NULL OR linkedin!=""'; $sql .= " OR linkedin IS NOT NULL OR linkedin <> ''";
$sql .= ' OR instagram IS NOT NULL OR instagram!=""'; $sql .= " OR instagram IS NOT NULL OR instagram <> ''";
$sql .= ' OR snapchat IS NOT NULL OR snapchat!=""'; $sql .= " OR snapchat IS NOT NULL OR snapchat <> ''";
$sql .= ' OR googleplus IS NOT NULL OR googleplus!=""'; $sql .= " OR googleplus IS NOT NULL OR googleplus <> ''";
$sql .= ' OR youtube IS NOT NULL OR youtube!=""'; $sql .= " OR youtube IS NOT NULL OR youtube <> ''";
$sql .= ' OR whatsapp IS NOT NULL OR whatsapp!=""'; $sql .= " OR whatsapp IS NOT NULL OR whatsapp <> ''";
//print $sql; //print $sql;
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) { if ($resql) {
@ -5255,15 +5255,15 @@ function migrate_thirdparties_socialnetworks()
print '<tr><td colspan="4">'; print '<tr><td colspan="4">';
$sql = 'SELECT rowid, socialnetworks'; $sql = 'SELECT rowid, socialnetworks';
$sql .= ', skype, twitter, facebook, linkedin, instagram, snapchat, googleplus, youtube, whatsapp FROM '.MAIN_DB_PREFIX.'societe WHERE '; $sql .= ', skype, twitter, facebook, linkedin, instagram, snapchat, googleplus, youtube, whatsapp FROM '.MAIN_DB_PREFIX.'societe WHERE ';
$sql .= ' skype IS NOT NULL OR skype!=""'; $sql .= " skype IS NOT NULL OR skype <> ''";
$sql .= ' OR twitter IS NOT NULL OR twitter!=""'; $sql .= " OR twitter IS NOT NULL OR twitter <> ''";
$sql .= ' OR facebook IS NOT NULL OR facebook!=""'; $sql .= " OR facebook IS NOT NULL OR facebook <> ''";
$sql .= ' OR linkedin IS NOT NULL OR linkedin!=""'; $sql .= " OR linkedin IS NOT NULL OR linkedin <> ''";
$sql .= ' OR instagram IS NOT NULL OR instagram!=""'; $sql .= " OR instagram IS NOT NULL OR instagram <> ''";
$sql .= ' OR snapchat IS NOT NULL OR snapchat!=""'; $sql .= " OR snapchat IS NOT NULL OR snapchat <> ''";
$sql .= ' OR googleplus IS NOT NULL OR googleplus!=""'; $sql .= " OR googleplus IS NOT NULL OR googleplus <> ''";
$sql .= ' OR youtube IS NOT NULL OR youtube!=""'; $sql .= " OR youtube IS NOT NULL OR youtube <> ''";
$sql .= ' OR whatsapp IS NOT NULL OR whatsapp!=""'; $sql .= " OR whatsapp IS NOT NULL OR whatsapp <> ''";
//print $sql; //print $sql;
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) { if ($resql) {

View File

@ -771,9 +771,7 @@ while ($i < min($num, $limit))
$nbofsalesrepresentative = count($listsalesrepresentatives); $nbofsalesrepresentative = count($listsalesrepresentatives);
if ($nbofsalesrepresentative > 3) // We print only number if ($nbofsalesrepresentative > 3) // We print only number
{ {
print '<a href="'.DOL_URL_ROOT.'/societe/commerciaux.php?socid='.$socstatic->id.'">';
print $nbofsalesrepresentative; print $nbofsalesrepresentative;
print '</a>';
} }
elseif ($nbofsalesrepresentative > 0) elseif ($nbofsalesrepresentative > 0)
{ {

View File

@ -68,11 +68,12 @@ if (GETPOST('addfile', 'alpha') && !GETPOST('add', 'alpha')) {
// Set tmp directory TODO Use a dedicated directory for temp mails files // Set tmp directory TODO Use a dedicated directory for temp mails files
$vardir = $conf->ticket->dir_output; $vardir = $conf->ticket->dir_output;
$upload_dir_tmp = $vardir.'/temp'; $upload_dir_tmp = $vardir.'/temp/'.session_id();
if (!dol_is_dir($upload_dir_tmp)) { if (!dol_is_dir($upload_dir_tmp)) {
dol_mkdir($upload_dir_tmp); dol_mkdir($upload_dir_tmp);
} }
dol_add_file_process($upload_dir_tmp, 0, 0, 'addedfile');
dol_add_file_process($upload_dir_tmp, 0, 0, 'addedfile', '', null, '', 0);
$action = 'create_ticket'; $action = 'create_ticket';
////} ////}
} }
@ -83,7 +84,7 @@ if (GETPOST('removedfile', 'alpha') && !GETPOST('add', 'alpha')) {
// Set tmp directory // Set tmp directory
$vardir = $conf->ticket->dir_output.'/'; $vardir = $conf->ticket->dir_output.'/';
$upload_dir_tmp = $vardir.'/temp'; $upload_dir_tmp = $vardir.'/temp/'.session_id();
// TODO Delete only files that was uploaded from email form // TODO Delete only files that was uploaded from email form
dol_remove_file_process($_POST['removedfile'], 0, 0); dol_remove_file_process($_POST['removedfile'], 0, 0);
@ -170,7 +171,7 @@ if ($action == 'create_ticket' && GETPOST('add', 'alpha')) {
if (!$error && $id > 0) { if (!$error && $id > 0) {
if ($usertoassign > 0) { if ($usertoassign > 0) {
$object->add_contact($usertoassign, "SUPPORTCLI", 'external', $notrigger = 0); $object->add_contact($usertoassign, "SUPPORTCLI", 'external', 0);
} }
} }
@ -304,7 +305,7 @@ if ($action == 'create_ticket' && GETPOST('add', 'alpha')) {
} }
// Copy files into ticket directory // Copy files into ticket directory
$destdir = $conf->ticket->dir_output.'/'.$object->track_id; $destdir = $conf->ticket->dir_output.'/'.$object->ref;
if (!dol_is_dir($destdir)) { if (!dol_is_dir($destdir)) {
dol_mkdir($destdir); dol_mkdir($destdir);
} }

View File

@ -306,9 +306,7 @@ abstract class ActionsCardCommon
$nbofsalesrepresentative=count($listsalesrepresentatives); $nbofsalesrepresentative=count($listsalesrepresentatives);
if ($nbofsalesrepresentative > 3) // We print only number if ($nbofsalesrepresentative > 3) // We print only number
{ {
$this->tpl['sales_representatives'].= '<a href="'.DOL_URL_ROOT.'/societe/commerciaux.php?socid='.$this->object->id.'">';
$this->tpl['sales_representatives'].= $nbofsalesrepresentative; $this->tpl['sales_representatives'].= $nbofsalesrepresentative;
$this->tpl['sales_representatives'].= '</a>';
} }
elseif ($nbofsalesrepresentative > 0) elseif ($nbofsalesrepresentative > 0)
{ {