diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index d4f85e62269..365308a224b 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -1165,9 +1165,7 @@ if ($resql) $nbofsalesrepresentative = count($listsalesrepresentatives); if ($nbofsalesrepresentative > 3) // We print only number { - print ''; print $nbofsalesrepresentative; - print ''; } elseif ($nbofsalesrepresentative > 0) { diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 41834b8d0f6..c32e45c1b42 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -705,9 +705,7 @@ while ($i < min($num, $limit)) $nbofsalesrepresentative = count($listsalesrepresentatives); if ($nbofsalesrepresentative > 3) { // We print only number - print ''; print $nbofsalesrepresentative; - print ''; } elseif ($nbofsalesrepresentative > 0) { diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index ea8e98b6cbc..3447b76a2b7 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -75,6 +75,7 @@ class box_graph_product_distribution extends ModeleBoxes global $conf, $user, $langs; $this->max = $max; + $dir = $conf->user->dir_temp; $refreshaction = 'refresh_'.$this->boxcode; diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 5ddd0744ea8..d2ce4ebc230 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -568,12 +568,12 @@ abstract class CommonDocGenerator 'line_price_ttc_locale'=>price($line->total_ttc, 0, $outputlangs), 'line_price_vat_locale'=>price($line->total_tva, 0, $outputlangs), // Dates - 'line_date_start'=>dol_print_date($line->date_start, 'day', 'tzuser'), - 'line_date_start_locale'=>dol_print_date($line->date_start, 'day', 'tzuser', $outputlangs), - 'line_date_start_rfc'=>dol_print_date($line->date_start, 'dayrfc', 'tzuser'), - 'line_date_end'=>dol_print_date($line->date_end, 'day', 'tzuser'), - 'line_date_end_locale'=>dol_print_date($line->date_end, 'day', 'tzuser', $outputlangs), - 'line_date_end_rfc'=>dol_print_date($line->date_end, 'dayrfc', 'tzuser'), + 'line_date_start'=>dol_print_date($line->date_start, 'day'), + 'line_date_start_locale'=>dol_print_date($line->date_start, 'day', 'tzserver', $outputlangs), + 'line_date_start_rfc'=>dol_print_date($line->date_start, 'dayrfc'), + 'line_date_end'=>dol_print_date($line->date_end, 'day'), + 'line_date_end_locale'=>dol_print_date($line->date_end, 'day', 'tzserver', $outputlangs), + 'line_date_end_rfc'=>dol_print_date($line->date_end, 'dayrfc'), 'line_multicurrency_code' => price2num($line->multicurrency_code), 'line_multicurrency_subprice' => price2num($line->multicurrency_subprice), diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a20a8dd8526..96a56a3fb37 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5420,7 +5420,7 @@ abstract class CommonObject // Add field of attribute 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])."'"; } @@ -5522,7 +5522,7 @@ abstract class CommonObject $this->errors[] = $langs->trans("ExtraFieldHasWrongValue", $attributeLabel); return -1; } - elseif ($value == '') + elseif ($value === '') { $this->array_options["options_".$key] = null; } @@ -5535,7 +5535,7 @@ abstract class CommonObject $this->errors[] = $langs->trans("ExtraFieldHasWrongValue", $attributeLabel); return -1; } - elseif ($value == '') + elseif ($value === '') { $this->array_options["options_".$key] = null; } diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 282690edcf7..66d53398f96 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -5070,15 +5070,15 @@ function migrate_members_socialnetworks() print ''; $sql = 'SELECT rowid, socialnetworks'; $sql .= ', skype, twitter, facebook, linkedin, instagram, snapchat, googleplus, youtube, whatsapp FROM '.MAIN_DB_PREFIX.'adherent WHERE '; - $sql .= ' skype IS NOT NULL OR skype!=""'; - $sql .= ' OR twitter IS NOT NULL OR twitter!=""'; - $sql .= ' OR facebook IS NOT NULL OR facebook!=""'; - $sql .= ' OR linkedin IS NOT NULL OR linkedin!=""'; - $sql .= ' OR instagram IS NOT NULL OR instagram!=""'; - $sql .= ' OR snapchat IS NOT NULL OR snapchat!=""'; - $sql .= ' OR googleplus IS NOT NULL OR googleplus!=""'; - $sql .= ' OR youtube IS NOT NULL OR youtube!=""'; - $sql .= ' OR whatsapp IS NOT NULL OR whatsapp!=""'; + $sql .= " skype IS NOT NULL OR skype <> ''"; + $sql .= " OR twitter IS NOT NULL OR twitter <> ''"; + $sql .= " OR facebook IS NOT NULL OR facebook <> ''"; + $sql .= " OR linkedin IS NOT NULL OR linkedin <> ''"; + $sql .= " OR instagram IS NOT NULL OR instagram <> ''"; + $sql .= " OR snapchat IS NOT NULL OR snapchat <> ''"; + $sql .= " OR googleplus IS NOT NULL OR googleplus <> ''"; + $sql .= " OR youtube IS NOT NULL OR youtube <> ''"; + $sql .= " OR whatsapp IS NOT NULL OR whatsapp <> ''"; //print $sql; $resql = $db->query($sql); if ($resql) { @@ -5160,16 +5160,16 @@ function migrate_contacts_socialnetworks() print ''; $sql = 'SELECT rowid, socialnetworks'; $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 .= ' OR skype IS NOT NULL OR skype!=""'; - $sql .= ' OR twitter IS NOT NULL OR twitter!=""'; - $sql .= ' OR facebook IS NOT NULL OR facebook!=""'; - $sql .= ' OR linkedin IS NOT NULL OR linkedin!=""'; - $sql .= ' OR instagram IS NOT NULL OR instagram!=""'; - $sql .= ' OR snapchat IS NOT NULL OR snapchat!=""'; - $sql .= ' OR googleplus IS NOT NULL OR googleplus!=""'; - $sql .= ' OR youtube IS NOT NULL OR youtube!=""'; - $sql .= ' OR whatsapp IS NOT NULL OR whatsapp!=""'; + $sql .= " jabberid IS NOT NULL OR jabberid <> ''"; + $sql .= " OR skype IS NOT NULL OR skype <> ''"; + $sql .= " OR twitter IS NOT NULL OR twitter <> ''"; + $sql .= " OR facebook IS NOT NULL OR facebook <> ''"; + $sql .= " OR linkedin IS NOT NULL OR linkedin <> ''"; + $sql .= " OR instagram IS NOT NULL OR instagram <> ''"; + $sql .= " OR snapchat IS NOT NULL OR snapchat <> ''"; + $sql .= " OR googleplus IS NOT NULL OR googleplus <> ''"; + $sql .= " OR youtube IS NOT NULL OR youtube <> ''"; + $sql .= " OR whatsapp IS NOT NULL OR whatsapp <> ''"; //print $sql; $resql = $db->query($sql); if ($resql) { @@ -5255,15 +5255,15 @@ function migrate_thirdparties_socialnetworks() print ''; $sql = 'SELECT rowid, socialnetworks'; $sql .= ', skype, twitter, facebook, linkedin, instagram, snapchat, googleplus, youtube, whatsapp FROM '.MAIN_DB_PREFIX.'societe WHERE '; - $sql .= ' skype IS NOT NULL OR skype!=""'; - $sql .= ' OR twitter IS NOT NULL OR twitter!=""'; - $sql .= ' OR facebook IS NOT NULL OR facebook!=""'; - $sql .= ' OR linkedin IS NOT NULL OR linkedin!=""'; - $sql .= ' OR instagram IS NOT NULL OR instagram!=""'; - $sql .= ' OR snapchat IS NOT NULL OR snapchat!=""'; - $sql .= ' OR googleplus IS NOT NULL OR googleplus!=""'; - $sql .= ' OR youtube IS NOT NULL OR youtube!=""'; - $sql .= ' OR whatsapp IS NOT NULL OR whatsapp!=""'; + $sql .= " skype IS NOT NULL OR skype <> ''"; + $sql .= " OR twitter IS NOT NULL OR twitter <> ''"; + $sql .= " OR facebook IS NOT NULL OR facebook <> ''"; + $sql .= " OR linkedin IS NOT NULL OR linkedin <> ''"; + $sql .= " OR instagram IS NOT NULL OR instagram <> ''"; + $sql .= " OR snapchat IS NOT NULL OR snapchat <> ''"; + $sql .= " OR googleplus IS NOT NULL OR googleplus <> ''"; + $sql .= " OR youtube IS NOT NULL OR youtube <> ''"; + $sql .= " OR whatsapp IS NOT NULL OR whatsapp <> ''"; //print $sql; $resql = $db->query($sql); if ($resql) { diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index f7f7cce75e1..ca4f918c7d3 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -771,9 +771,7 @@ while ($i < min($num, $limit)) $nbofsalesrepresentative = count($listsalesrepresentatives); if ($nbofsalesrepresentative > 3) // We print only number { - print ''; print $nbofsalesrepresentative; - print ''; } elseif ($nbofsalesrepresentative > 0) { diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index 181973912e5..16978e06ee2 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -68,11 +68,12 @@ if (GETPOST('addfile', 'alpha') && !GETPOST('add', 'alpha')) { // Set tmp directory TODO Use a dedicated directory for temp mails files $vardir = $conf->ticket->dir_output; - $upload_dir_tmp = $vardir.'/temp'; + $upload_dir_tmp = $vardir.'/temp/'.session_id(); if (!dol_is_dir($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'; ////} } @@ -83,7 +84,7 @@ if (GETPOST('removedfile', 'alpha') && !GETPOST('add', 'alpha')) { // Set tmp directory $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 dol_remove_file_process($_POST['removedfile'], 0, 0); @@ -170,7 +171,7 @@ if ($action == 'create_ticket' && GETPOST('add', 'alpha')) { if (!$error && $id > 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 - $destdir = $conf->ticket->dir_output.'/'.$object->track_id; + $destdir = $conf->ticket->dir_output.'/'.$object->ref; if (!dol_is_dir($destdir)) { dol_mkdir($destdir); } diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index a76e9aa34cb..10cc427afcf 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -306,9 +306,7 @@ abstract class ActionsCardCommon $nbofsalesrepresentative=count($listsalesrepresentatives); if ($nbofsalesrepresentative > 3) // We print only number { - $this->tpl['sales_representatives'].= ''; $this->tpl['sales_representatives'].= $nbofsalesrepresentative; - $this->tpl['sales_representatives'].= ''; } elseif ($nbofsalesrepresentative > 0) {