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

This commit is contained in:
Laurent Destailleur 2017-07-21 15:03:21 +02:00
commit 3716645b8b
20 changed files with 130 additions and 92 deletions

View File

@ -355,6 +355,7 @@ if ($resql)
$soc = new Societe($db); $soc = new Societe($db);
$soc->fetch($socid); $soc->fetch($socid);
$title = $langs->trans('ListOfProposals') . ' - '.$soc->name; $title = $langs->trans('ListOfProposals') . ' - '.$soc->name;
if (empty($search_societe)) $search_societe = $soc->name;
} }
else else
{ {

View File

@ -578,6 +578,7 @@ if ($resql)
$soc = new Societe($db); $soc = new Societe($db);
$soc->fetch($socid); $soc->fetch($socid);
$title = $langs->trans('ListOfOrders') . ' - '.$soc->name; $title = $langs->trans('ListOfOrders') . ' - '.$soc->name;
if (empty($search_company)) $search_company = $soc->name;
} }
else else
{ {

View File

@ -531,6 +531,7 @@ if ($resql)
{ {
$soc = new Societe($db); $soc = new Societe($db);
$soc->fetch($socid); $soc->fetch($socid);
if (empty($search_societe)) $search_societe = $soc->name;
} }
$param='&socid='.$socid; $param='&socid='.$socid;

View File

@ -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 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 = new ContratLigne($this->db);
$contractline->array_options=$array_option; $contractline->array_options=$array_options;
$contractline->id= $this->db->last_insert_id(MAIN_DB_PREFIX.$contractline->table_element); $contractline->id= $rowid;
$result=$contractline->insertExtraFields(); $result=$contractline->insertExtraFields();
if ($result < 0) if ($result < 0)
{ {

View File

@ -306,6 +306,13 @@ if ($resql)
$arrayofselected=is_array($toselect)?$toselect:array(); $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 (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;

View File

@ -391,6 +391,9 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
$object->trackid = $trackid; $object->trackid = $trackid;
$object->fk_element = $object->id; $object->fk_element = $object->id;
$object->elementtype = $object->element; $object->elementtype = $object->element;
if (is_array($attachedfiles) && count($attachedfiles)>0) {
$object->attachedfiles = $attachedfiles;
}
// Call of triggers // Call of triggers
if (! empty($trigger_name)) if (! empty($trigger_name))

View File

@ -5604,6 +5604,14 @@ class Form
{ {
$listofidcompanytoscan=$object->thirdparty->id; $listofidcompanytoscan=$object->thirdparty->id;
if (($object->thirdparty->parent > 0) && ! empty($conf->global->THIRDPARTY_INCLUDE_PARENT_IN_LINKTO)) $listofidcompanytoscan.=','.$object->thirdparty->parent; 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( $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').')'), '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').')'),

View File

@ -1217,6 +1217,8 @@ class SMTPs
*/ */
function getHeader() function getHeader()
{ {
global $conf;
$_header = 'From: ' . $this->getFrom('org') . "\r\n" $_header = 'From: ' . $this->getFrom('org') . "\r\n"
. 'To: ' . $this->getTO() . "\r\n"; . 'To: ' . $this->getTO() . "\r\n";
@ -1279,6 +1281,7 @@ class SMTPs
$_header .= "Reply-To: ".$this->getReplyTo('addr') ."\r\n"; $_header .= "Reply-To: ".$this->getReplyTo('addr') ."\r\n";
$_header .= 'X-Mailer: Dolibarr version ' . DOL_VERSION .' (using SMTPs Mailer)' . "\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"; $_header .= 'Mime-Version: 1.0' . "\r\n";

View File

@ -263,10 +263,10 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetDrawColor(128,128,128); $pdf->SetDrawColor(128,128,128);
$pdf->SetTitle($outputlangs->convToOutputCharset($object->ref)); $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
$pdf->SetSubject($outputlangs->transnoentities("Order")); $pdf->SetSubject($outputlangs->transnoentities("PdfOrderTitle"));
$pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
$pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Order")." ".$outputlangs->convToOutputCharset($object->thirdparty->name)); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("PdfOrderTitle")." ".$outputlangs->convToOutputCharset($object->thirdparty->name));
if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false);
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
@ -1201,7 +1201,7 @@ class pdf_einstein extends ModelePDFCommandes
* @param string $titlekey Translation key to show as title of document * @param string $titlekey Translation key to show as title of document
* @return void * @return void
*/ */
function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlekey="Order") function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlekey="PdfOrderTitle")
{ {
global $conf,$langs,$hookmanager; global $conf,$langs,$hookmanager;

View File

@ -284,10 +284,10 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetDrawColor(128,128,128); $pdf->SetDrawColor(128,128,128);
$pdf->SetTitle($outputlangs->convToOutputCharset($object->ref)); $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
$pdf->SetSubject($outputlangs->transnoentities("Invoice")); $pdf->SetSubject($outputlangs->transnoentities("PdfInvoiceTitle"));
$pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
$pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Invoice")." ".$outputlangs->convToOutputCharset($object->thirdparty->name)); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("PdfInvoiceTitle")." ".$outputlangs->convToOutputCharset($object->thirdparty->name));
if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false);
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
@ -1559,7 +1559,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetFont('','B', $default_font_size + 3); $pdf->SetFont('','B', $default_font_size + 3);
$pdf->SetXY($posx,$posy); $pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
$title=$outputlangs->transnoentities("Invoice"); $title=$outputlangs->transnoentities("PdfInvoiceTitle");
if ($object->type == 1) $title=$outputlangs->transnoentities("InvoiceReplacement"); if ($object->type == 1) $title=$outputlangs->transnoentities("InvoiceReplacement");
if ($object->type == 2) $title=$outputlangs->transnoentities("InvoiceAvoir"); if ($object->type == 2) $title=$outputlangs->transnoentities("InvoiceAvoir");
if ($object->type == 3) $title=$outputlangs->transnoentities("InvoiceDeposit"); if ($object->type == 3) $title=$outputlangs->transnoentities("InvoiceDeposit");

View File

@ -292,10 +292,10 @@ class pdf_azur extends ModelePDFPropales
$pdf->SetDrawColor(128,128,128); $pdf->SetDrawColor(128,128,128);
$pdf->SetTitle($outputlangs->convToOutputCharset($object->ref)); $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
$pdf->SetSubject($outputlangs->transnoentities("CommercialProposal")); $pdf->SetSubject($outputlangs->transnoentities("PdfCommercialProposalTitle"));
$pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
$pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("CommercialProposal")." ".$outputlangs->convToOutputCharset($object->thirdparty->name)); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("PdfCommercialProposalTitle")." ".$outputlangs->convToOutputCharset($object->thirdparty->name));
if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false);
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
@ -1428,7 +1428,7 @@ class pdf_azur extends ModelePDFPropales
$pdf->SetFont('','B',$default_font_size + 3); $pdf->SetFont('','B',$default_font_size + 3);
$pdf->SetXY($posx,$posy); $pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
$title=$outputlangs->transnoentities("CommercialProposal"); $title=$outputlangs->transnoentities("PdfCommercialProposalTitle");
$pdf->MultiCell(100, 4, $title, '', 'R'); $pdf->MultiCell(100, 4, $title, '', 'R');
$pdf->SetFont('','B',$default_font_size); $pdf->SetFont('','B',$default_font_size);

View File

@ -249,7 +249,14 @@ $sql.= $db->plimit($limit+1, $offset);
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) 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(); $arrayofselected=is_array($toselect)?$toselect:array();

View File

@ -427,6 +427,7 @@ if ($resql)
{ {
$soc = new Societe($db); $soc = new Societe($db);
$soc->fetch($socid); $soc->fetch($socid);
if (empty($search_societe)) $search_societe = $soc->name;
} }
$param='&socid='.$socid; $param='&socid='.$socid;

View File

@ -548,3 +548,5 @@ INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (178,
-- VPGSQL8.2 ALTER TABLE llx_establishment ALTER COLUMN fk_user_mod DROP NOT 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; ALTER TABLE llx_multicurrency_rate ADD COLUMN entity integer DEFAULT 1;
ALTER TABLE llx_user MODIFY COLUMN login varchar(50);

View File

@ -33,7 +33,7 @@ create table llx_user
tms timestamp, tms timestamp,
fk_user_creat integer, fk_user_creat integer,
fk_user_modif integer, fk_user_modif integer,
login varchar(24) NOT NULL, login varchar(50) NOT NULL,
pass varchar(128), pass varchar(128),
pass_crypted varchar(128), pass_crypted varchar(128),
pass_temp varchar(128), -- temporary password when asked for forget password pass_temp varchar(128), -- temporary password when asked for forget password

View File

@ -45,6 +45,7 @@ InvoiceHasAvoir=Was source of one or several credit notes
CardBill=Invoice card CardBill=Invoice card
PredefinedInvoices=Predefined Invoices PredefinedInvoices=Predefined Invoices
Invoice=Invoice Invoice=Invoice
PdfInvoiceTitle=Invoice
Invoices=Invoices Invoices=Invoices
InvoiceLine=Invoice line InvoiceLine=Invoice line
InvoiceCustomer=Customer invoice InvoiceCustomer=Customer invoice

View File

@ -4,6 +4,7 @@ SuppliersOrdersArea=Suppliers orders area
OrderCard=Order card OrderCard=Order card
OrderId=Order Id OrderId=Order Id
Order=Order Order=Order
PdfOrderTitle=Order
Orders=Orders Orders=Orders
OrderLine=Order line OrderLine=Order line
OrderDate=Order date OrderDate=Order date

View File

@ -6,6 +6,7 @@ ProposalsDraft=Draft commercial proposals
ProposalsOpened=Open commercial proposals ProposalsOpened=Open commercial proposals
Prop=Commercial proposals Prop=Commercial proposals
CommercialProposal=Commercial proposal CommercialProposal=Commercial proposal
PdfCommercialProposalTitle=Commercial proposal
ProposalCard=Proposal card ProposalCard=Proposal card
NewProp=New commercial proposal NewProp=New commercial proposal
NewPropal=New proposal NewPropal=New proposal

View File

@ -76,7 +76,7 @@ ThisWillAlsoAddPaymentOnInvoice=Ceci créera également les paiements sur les fa
StatisticsByLineStatus=Statistiques par statut des lignes StatisticsByLineStatus=Statistiques par statut des lignes
RUM=RUM RUM=RUM
RUMLong=Référence Unique de Mandat 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) WithdrawMode=Mode de prélévement (FRST ou RECUR)
WithdrawRequestAmount=Montant de la demande de prélèvement WithdrawRequestAmount=Montant de la demande de prélèvement
WithdrawRequestErrorNilAmount=Impossible de créer une demande de prélèvement pour un montant nul WithdrawRequestErrorNilAmount=Impossible de créer une demande de prélèvement pour un montant nul

View File

@ -204,6 +204,7 @@ if (empty($reshook))
$account->proprio = GETPOST('proprio','alpha'); $account->proprio = GETPOST('proprio','alpha');
$account->owner_address = GETPOST('owner_address','alpha'); $account->owner_address = GETPOST('owner_address','alpha');
$account->frstrecur = GETPOST('frstrecur'); $account->frstrecur = GETPOST('frstrecur');
$account->rum = GETPOST('rum','alpha');
// This test can be done only once properties were set // This test can be done only once properties were set
if ($account->needIBAN() == 1) if ($account->needIBAN() == 1)
@ -868,7 +869,7 @@ if ($socid && $action == 'create' && $user->rights->societe->creer)
// RUM // RUM
print '<tr><td class="titlefieldcreate">'.$langs->trans("RUM").'</td>'; print '<tr><td class="titlefieldcreate">'.$langs->trans("RUM").'</td>';
print '<td>'.$langs->trans("RUMWillBeGenerated").'</td></tr>'; print '<td colspan="4"><input size="30" type="text" name="rum" value="'.dol_escape_htmltag($account->rum).'"><br>'.$langs->trans("RUMWillBeGenerated").'</td></tr>';
print '<tr><td>'.$langs->trans("WithdrawMode").'</td><td>'; print '<tr><td>'.$langs->trans("WithdrawMode").'</td><td>';
$tblArraychoice = array("FRST" => $langs->trans("FRST"), "RECUR" => $langs->trans("RECUR")); $tblArraychoice = array("FRST" => $langs->trans("FRST"), "RECUR" => $langs->trans("RECUR"));