diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 70953e58fbf..6062f6033dc 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -355,6 +355,7 @@ if ($resql) $soc = new Societe($db); $soc->fetch($socid); $title = $langs->trans('ListOfProposals') . ' - '.$soc->name; + if (empty($search_societe)) $search_societe = $soc->name; } else { diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 9e0b04ab6e9..565f39e62a2 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -578,6 +578,7 @@ if ($resql) $soc = new Societe($db); $soc->fetch($socid); $title = $langs->trans('ListOfOrders') . ' - '.$soc->name; + if (empty($search_company)) $search_company = $soc->name; } else { diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 72ea7e1a647..13e9a22d717 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -531,6 +531,7 @@ if ($resql) { $soc = new Societe($db); $soc->fetch($socid); + if (empty($search_societe)) $search_societe = $soc->name; } $param='&socid='.$socid; diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index e08e10a0966..46078931ebd 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1633,8 +1633,8 @@ class Contrat extends CommonObject if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($array_options) && count($array_options)>0) // For avoid conflicts if trigger used { $contractline = new ContratLigne($this->db); - $contractline->array_options=$array_option; - $contractline->id= $this->db->last_insert_id(MAIN_DB_PREFIX.$contractline->table_element); + $contractline->array_options=$array_options; + $contractline->id= $rowid; $result=$contractline->insertExtraFields(); if ($result < 0) { diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 4b638dcfef6..48a9afaaa56 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -305,8 +305,15 @@ if ($resql) $i = 0; $arrayofselected=is_array($toselect)?$toselect:array(); + + if ($socid > 0) + { + $soc = new Societe($db); + $soc->fetch($socid); + if (empty($search_name)) $search_name = $soc->name; + } - $param=''; + $param=''; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($sall != '') $param.='&sall='.$sall; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 0f16a25c43f..06736ba5c5f 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5604,6 +5604,14 @@ class Form { $listofidcompanytoscan=$object->thirdparty->id; if (($object->thirdparty->parent > 0) && ! empty($conf->global->THIRDPARTY_INCLUDE_PARENT_IN_LINKTO)) $listofidcompanytoscan.=','.$object->thirdparty->parent; + if (($object->fk_project > 0) && ! empty($conf->global->THIRDPARTY_INCLUDE_PROJECT_THIRDPARY_IN_LINKTO)) + { + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + $tmpproject=new Project($this->db); + $tmpproject->fetch($object->fk_project); + if ($tmpproject->socid > 0 && ($tmpproject->socid != $object->thirdparty->id)) $listofidcompanytoscan.=','.$tmpproject->socid; + unset($tmpproject); + } $possiblelinks=array( 'propal'=>array('enabled'=>$conf->propal->enabled, 'perms'=>1, 'label'=>'LinkToProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('propal').')'), diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index 9e6250f9f8d..c92558bf1d3 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -271,7 +271,7 @@ class SMTPs { $this->_moreinheader = $_val; } - + /** * get trackid * @@ -291,7 +291,7 @@ class SMTPs { return $this->_moreinheader; } - + /** * Set errors to * @@ -411,7 +411,7 @@ class SMTPs function _server_authenticate() { global $conf; - + // Send the RFC2554 specified EHLO. // This improvment as provided by 'SirSir' to // accomodate both SMTP AND ESMTP capable servers @@ -462,7 +462,7 @@ class SMTPs { $this->_setErr(126, '"' . $host . '" does not support authenticated connections.'); return $_retVal; - } + } } // Send Authentication to Server // Check for errors along the way @@ -903,7 +903,7 @@ class SMTPs if ( $_strReplyTo ) $this->_msgReplyTo = $this->_strip_email($_strReplyTo); } - + /** * Retrieves the Address from which mail will be the reply-to * @@ -913,15 +913,15 @@ class SMTPs function getReplyTo($_part = true) { $_retValue = ''; - + if ( $_part === true ) $_retValue = $this->_msgReplyTo; else $_retValue = $this->_msgReplyTo[$_part]; - + return $_retValue; } - + /** * Inserts given addresses into structured format. * This method takes a list of given addresses, via an array @@ -1217,6 +1217,8 @@ class SMTPs */ function getHeader() { + global $conf; + $_header = 'From: ' . $this->getFrom('org') . "\r\n" . 'To: ' . $this->getTO() . "\r\n"; @@ -1233,13 +1235,13 @@ class SMTPs if ( $this->getBCC() ) $_header .= 'Bcc: ' . $this->getBCC() . "\r\n"; */ - + $host=$this->getHost(); $host=preg_replace('@tcp://@i','',$host); // Remove prefix $host=preg_replace('@ssl://@i','',$host); // Remove prefix $host=dol_getprefix('email'); - + //NOTE: Message-ID should probably contain the username of the user who sent the msg $_header .= 'Subject: ' . $this->getSubject() . "\r\n"; $_header .= 'Date: ' . date("r") . "\r\n"; @@ -1258,7 +1260,7 @@ class SMTPs } if ( $this->getMoreInHeader() ) $_header .= $this->getMoreInHeader(); // Value must include the "\r\n"; - + //$_header .= // 'Read-Receipt-To: ' . $this->getFrom( 'org' ) . "\r\n" // 'Return-Receipt-To: ' . $this->getFrom( 'org' ) . "\r\n"; @@ -1279,9 +1281,10 @@ class SMTPs $_header .= "Reply-To: ".$this->getReplyTo('addr') ."\r\n"; $_header .= 'X-Mailer: Dolibarr version ' . DOL_VERSION .' (using SMTPs Mailer)' . "\r\n"; + $_header .= 'X-Dolibarr-Option: '.($conf->global->MAIN_MAIL_USE_MULTI_PART?'MAIN_MAIL_USE_MULTI_PART':'No MAIN_MAIL_USE_MULTI_PART') . "\r\n"; $_header .= 'Mime-Version: 1.0' . "\r\n"; - + return $_header; } @@ -1310,17 +1313,17 @@ class SMTPs $strContentAltText = html_entity_decode(strip_tags($strContent)); $strContentAltText = rtrim(wordwrap($strContentAltText, 75, "\r\n")); } - + // Make RFC2045 Compliant //$strContent = rtrim(chunk_split($strContent)); // Function chunck_split seems ko if not used on a base64 content $strContent = rtrim(wordwrap($strContent, 75, "\r\n")); // TODO Using this method creates unexpected line break on text/plain content. - + $this->_msgContent[$strType] = array(); $this->_msgContent[$strType]['mimeType'] = $strMimeType; $this->_msgContent[$strType]['data'] = $strContent; $this->_msgContent[$strType]['dataText'] = $strContentAltText; - + if ( $this->getMD5flag() ) $this->_msgContent[$strType]['md5'] = dol_hash($strContent, 3); //} @@ -1334,7 +1337,7 @@ class SMTPs function getBodyContent() { global $conf; - + // Generate a new Boundary string $this->_setBoundary(); @@ -1382,7 +1385,7 @@ class SMTPs $content .= "\r\n"; $content .= "--" . $this->_getBoundary('mixed') . "\r\n"; - + if (key_exists('image', $this->_msgContent)) // If inline image found { $content.= 'Content-Type: multipart/alternative; boundary="'.$this->_getBoundary('alternative').'"' . "\r\n"; @@ -1390,7 +1393,7 @@ class SMTPs $content .= "--" . $this->_getBoundary('alternative') . "\r\n"; } - + // $this->_msgContent must be sorted with key 'text' or 'html' first then 'image' then 'attachment' @@ -1450,18 +1453,18 @@ class SMTPs $content.= "\r\n"; $content.= "--" . $this->_getBoundary('related') . "\r\n"; } - + if (! key_exists('image', $this->_msgContent) && $_content['dataText'] && ! empty($conf->global->MAIN_MAIL_USE_MULTI_PART)) // Add plain text message part before html part { $content.= 'Content-Type: multipart/alternative; boundary="'.$this->_getBoundary('alternative').'"' . "\r\n"; $content .= "\r\n"; $content .= "--" . $this->_getBoundary('alternative') . "\r\n"; - + $content.= "Content-Type: text/plain; charset=" . $this->getCharSet() . "\r\n"; $content.= "\r\n". $_content['dataText'] . "\r\n"; $content.= "--" . $this->_getBoundary('alternative') . "\r\n"; - } - + } + $content .= 'Content-Type: ' . $_content['mimeType'] . '; ' // . 'charset="' . $this->getCharSet() . '"'; . 'charset=' . $this->getCharSet() . ''; @@ -1483,7 +1486,7 @@ class SMTPs { $content.= "--" . $this->_getBoundary('alternative') . "--". "\r\n"; } - + $content .= "\r\n"; } } diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 3acef343aa9..853506920b3 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -249,8 +249,15 @@ $sql.= $db->plimit($limit+1, $offset); $resql=$db->query($sql); if ($resql) { - $num = $db->num_rows($resql); - + $num = $db->num_rows($result); + + if ($socid > 0) + { + $soc = new Societe($db); + $soc->fetch($socid); + if (empty($search_company)) $search_company = $soc->name; + } + $arrayofselected=is_array($toselect)?$toselect:array(); $param=''; diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 3fadb82d067..7ecd7ba45fe 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -427,6 +427,7 @@ if ($resql) { $soc = new Societe($db); $soc->fetch($socid); + if (empty($search_societe)) $search_societe = $soc->name; } $param='&socid='.$socid; diff --git a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql index 7ed89ebb173..c67bd51b430 100644 --- a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql +++ b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql @@ -547,4 +547,6 @@ INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (178, -- VMYSQL4.1 ALTER TABLE llx_establishment CHANGE COLUMN fk_user_mod fk_user_mod integer NULL; -- VPGSQL8.2 ALTER TABLE llx_establishment ALTER COLUMN fk_user_mod DROP NOT NULL; -ALTER TABLE llx_multicurrency_rate ADD COLUMN entity integer DEFAULT 1; \ No newline at end of file +ALTER TABLE llx_multicurrency_rate ADD COLUMN entity integer DEFAULT 1; + +ALTER TABLE llx_user MODIFY COLUMN login varchar(50); \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_user.sql b/htdocs/install/mysql/tables/llx_user.sql index d033ba5eca4..9df2f57a22b 100644 --- a/htdocs/install/mysql/tables/llx_user.sql +++ b/htdocs/install/mysql/tables/llx_user.sql @@ -33,7 +33,7 @@ create table llx_user tms timestamp, fk_user_creat integer, fk_user_modif integer, - login varchar(24) NOT NULL, + login varchar(50) NOT NULL, pass varchar(128), pass_crypted varchar(128), pass_temp varchar(128), -- temporary password when asked for forget password diff --git a/htdocs/langs/fr_FR/withdrawals.lang b/htdocs/langs/fr_FR/withdrawals.lang index 07c87c60b23..d82237d0a64 100644 --- a/htdocs/langs/fr_FR/withdrawals.lang +++ b/htdocs/langs/fr_FR/withdrawals.lang @@ -76,7 +76,7 @@ ThisWillAlsoAddPaymentOnInvoice=Ceci créera également les paiements sur les fa StatisticsByLineStatus=Statistiques par statut des lignes RUM=RUM RUMLong=Référence Unique de Mandat -RUMWillBeGenerated=Le numéro de RUM sera généré une fois les informations de compte bancaire sont enregistrées +RUMWillBeGenerated=Si vide le numéro de RUM sera généré une fois les informations de compte bancaire sont enregistrées WithdrawMode=Mode de prélévement (FRST ou RECUR) WithdrawRequestAmount=Montant de la demande de prélèvement WithdrawRequestErrorNilAmount=Impossible de créer une demande de prélèvement pour un montant nul diff --git a/htdocs/societe/rib.php b/htdocs/societe/rib.php index 7385b466e34..97ae92e4044 100644 --- a/htdocs/societe/rib.php +++ b/htdocs/societe/rib.php @@ -204,7 +204,8 @@ if (empty($reshook)) $account->proprio = GETPOST('proprio','alpha'); $account->owner_address = GETPOST('owner_address','alpha'); $account->frstrecur = GETPOST('frstrecur'); - + $account->rum = GETPOST('rum','alpha'); + // This test can be done only once properties were set if ($account->needIBAN() == 1) { @@ -868,7 +869,7 @@ if ($socid && $action == 'create' && $user->rights->societe->creer) // RUM print ''.$langs->trans("RUM").''; - print ''.$langs->trans("RUMWillBeGenerated").''; + print '
'.$langs->trans("RUMWillBeGenerated").''; print ''.$langs->trans("WithdrawMode").''; $tblArraychoice = array("FRST" => $langs->trans("FRST"), "RECUR" => $langs->trans("RECUR"));