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

Conflicts:
	htdocs/filefunc.inc.php
	htdocs/projet/card.php
This commit is contained in:
Laurent Destailleur 2016-10-16 19:04:33 +02:00
commit 28933c31dd
18 changed files with 54 additions and 29 deletions

View File

@ -5,7 +5,7 @@
* Copyright (C) 2006-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2006-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com> * Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2013-2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013-2016 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2013-2016 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
@ -637,17 +637,19 @@ class Categorie extends CommonObject
{ {
if ($this->db->num_rows($resql) > 0) if ($this->db->num_rows($resql) > 0)
{ {
$objparent = $this->db->fetch_object($resql); $objparent = $this->db->fetch_object($resql);
if (!empty($objparent->fk_parent)) if (!empty($objparent->fk_parent))
{ {
$cat = new Categorie($this->db); $cat = new Categorie($this->db);
$cat->id=$objparent->fk_parent; $cat->id = $objparent->fk_parent;
$result=$cat->add_type($obj, $type); if (!$cat->containsObject($type, $obj->id)) {
if ($result < 0) $result = $cat->add_type($obj, $type);
{ if ($result < 0)
$this->error=$cat->error; {
$error++; $this->error = $cat->error;
$error++;
}
} }
} }
} }

View File

@ -846,7 +846,7 @@ if ($id > 0 || ! empty($ref))
{ {
$loanstatic->label=$links[$key]['label']; $loanstatic->label=$links[$key]['label'];
} }
$loanstatic->ref=$loanstatic->label; $loanstatic->ref=$links[$key]['url_id'];
print $loanstatic->getLinkUrl(1,16); print $loanstatic->getLinkUrl(1,16);
} }
else if ($links[$key]['type']=='member') else if ($links[$key]['type']=='member')

View File

@ -385,6 +385,11 @@ if (! $sall)
$sql.= ' f.datec, f.tms,'; $sql.= ' f.datec, f.tms,';
$sql.= ' s.rowid, s.nom, s.town, s.zip, s.fk_pays, s.code_client, s.client, typent.code'; $sql.= ' s.rowid, s.nom, s.town, s.zip, s.fk_pays, s.code_client, s.client, typent.code';
$sql.= ' ,state.code_departement, state.nom'; $sql.= ' ,state.code_departement, state.nom';
foreach ($extrafields->attribute_label as $key => $val) //prevent error with sql_mode=only_full_group_by
{
$sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key : '');
}
} }
else else
{ {

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2012-2014 Charles-François BENKE <charles.fr@benke.fr> /* Copyright (C) 2012-2014 Charles-François BENKE <charles.fr@benke.fr>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr> * Copyright (C) 2015 Frederic France <frederic.france@free.fr>
* Copyright (C) 2016 Juan José Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -79,8 +80,10 @@ class box_project extends ModeleBoxes
$sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut "; $sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut ";
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
if($user->socid) $sql.= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid=p.fk_soc";
$sql.= " WHERE p.entity = ".$conf->entity; $sql.= " WHERE p.entity = ".$conf->entity;
$sql.= " AND p.fk_statut = 1"; // Seulement les projets ouverts if($user->socid) $sql.= " AND s.rowid = ".$user->socid;
$sql.= " AND p.fk_statut = 1"; // Seulement les projets ouverts
$sql.= " ORDER BY p.datec DESC"; $sql.= " ORDER BY p.datec DESC";
$sql.= $db->plimit($max, 0); $sql.= $db->plimit($max, 0);

View File

@ -454,6 +454,10 @@ class ImportCsv extends ModeleImports
} }
if (empty($newval)) $arrayrecord[($key-1)]['type']=-1; // If we get empty value, we will use "null" if (empty($newval)) $arrayrecord[($key-1)]['type']=-1; // If we get empty value, we will use "null"
} }
elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='numeric')
{
$newval = price2num($newval);
}
//print 'Val to use as insert is '.$newval.'<br>'; //print 'Val to use as insert is '.$newval.'<br>';
} }

View File

@ -76,7 +76,10 @@ class modFTP extends DolibarrModules
$this->requiredby = array(); // List of modules id to disable if this one is disabled $this->requiredby = array(); // List of modules id to disable if this one is disabled
// Constants // Constants
$this->const = array(); // List of parameters $this->const = array(
1=>array('FTP_CONNECT_WITH_SSL','chaine','0','Use FTPS for FTP module', 1, 'current', 1),
2=>array('FTP_CONNECT_WITH_SFTP','chaine','0','Use SFTP for FTP module', 1, 'current', 1)
); // List of parameters
// Boxes // Boxes
$this->boxes = array(); // List of boxes $this->boxes = array(); // List of boxes

View File

@ -345,7 +345,8 @@ class modSociete extends DolibarrModules
's.code_client'=>array('rule'=>'getcustomercodeifauto'), 's.code_client'=>array('rule'=>'getcustomercodeifauto'),
's.code_fournisseur'=>array('rule'=>'getsuppliercodeifauto'), 's.code_fournisseur'=>array('rule'=>'getsuppliercodeifauto'),
's.code_compta'=>array('rule'=>'getcustomeraccountancycodeifauto'), 's.code_compta'=>array('rule'=>'getcustomeraccountancycodeifauto'),
's.code_compta_fournisseur'=>array('rule'=>'getsupplieraccountancycodeifauto') 's.code_compta_fournisseur'=>array('rule'=>'getsupplieraccountancycodeifauto'),
's.capital'=>array('rule'=>'numeric')
); );
//$this->import_convertvalue_array[$r]=array('s.fk_soc'=>array('rule'=>'lastrowid',table='t'); //$this->import_convertvalue_array[$r]=array('s.fk_soc'=>array('rule'=>'lastrowid',table='t');
$this->import_regex_array[$r]=array('s.status'=>'^[0|1]','s.client'=>'^[0|1|2|3]','s.fournisseur'=>'^[0|1]','s.fk_typent'=>'id@'.MAIN_DB_PREFIX.'c_typent','s.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]( [0-9][0-9]:[0-9][0-9]:[0-9][0-9])?$'); $this->import_regex_array[$r]=array('s.status'=>'^[0|1]','s.client'=>'^[0|1|2|3]','s.fournisseur'=>'^[0|1]','s.fk_typent'=>'id@'.MAIN_DB_PREFIX.'c_typent','s.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]( [0-9][0-9]:[0-9][0-9]:[0-9][0-9])?$');

View File

@ -173,7 +173,7 @@ else
print '<tr class="pair">'; print '<tr class="pair">';
print '<td width="100">'.$langs->trans("Port").'</td>'; print '<td width="100">'.$langs->trans("Port").'</td>';
print '<td><input type="text" name="FTP_PORT_'.($lastftpentry+1).'" value="'.GETPOST("FTP_PORT_" . ($lastftpentry+1)).'" size="64"></td>'; print '<td><input type="text" name="FTP_PORT_'.($lastftpentry+1).'" value="'.GETPOST("FTP_PORT_" . ($lastftpentry+1)).'" size="64"></td>';
print '<td>21</td>'; print '<td>21 for pure non crypted FTP or if option FTP_CONNECT_WITH_SSL (See Home-Setup-Other) is on (FTPS)<br>22 if option FTP_CONNECT_WITH_SFTP (See Home-Setup-Other) is on (SFTP)</td>';
print '</tr>'; print '</tr>';
print '<tr class="impair">'; print '<tr class="impair">';

View File

@ -458,7 +458,7 @@ else
// Construit liste des repertoires // Construit liste des repertoires
print '<table width="100%" class="nobordernopadding">'."\n"; print '<table width="100%" class="noborder">'."\n";
print '<tr class="liste_titre">'."\n"; print '<tr class="liste_titre">'."\n";
print '<td class="liste_titre" align="left">'.$langs->trans("Content").'</td>'."\n"; print '<td class="liste_titre" align="left">'.$langs->trans("Content").'</td>'."\n";

View File

@ -4,6 +4,7 @@ Loans=Loans
NewLoan=New Loan NewLoan=New Loan
ShowLoan=Show Loan ShowLoan=Show Loan
PaymentLoan=Loan payment PaymentLoan=Loan payment
LoanPayment=Loan payment
ShowLoanPayment=Show Loan Payment ShowLoanPayment=Show Loan Payment
LoanCapital=Capital LoanCapital=Capital
Insurance=Insurance Insurance=Insurance

View File

@ -512,6 +512,7 @@ ReportPeriod=Report period
ReportDescription=Description ReportDescription=Description
Report=Report Report=Report
Keyword=Keyword Keyword=Keyword
Origin=Origin
Legend=Legend Legend=Legend
Fill=Fill Fill=Fill
Reset=Reset Reset=Reset

View File

@ -491,7 +491,6 @@ if ($id > 0)
print '<td align="center">'.$langs->trans("Insurance").'</td>'; print '<td align="center">'.$langs->trans("Insurance").'</td>';
print '<td align="center">'.$langs->trans("Interest").'</td>'; print '<td align="center">'.$langs->trans("Interest").'</td>';
print '<td align="center">'.$langs->trans("LoanCapital").'</td>'; print '<td align="center">'.$langs->trans("LoanCapital").'</td>';
print '<td>&nbsp;</td>';
print '</tr>'; print '</tr>';
$var=True; $var=True;

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com> /* Copyright (C) 2014-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr> * Copyright (C) 2015 Frederic France <frederic.france@free.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -385,6 +385,7 @@ class PaymentLoan extends CommonObject
* All payment properties must have been set first like after a call to create(). * All payment properties must have been set first like after a call to create().
* *
* @param User $user Object of user making payment * @param User $user Object of user making payment
* @param int $fk_loan Id of fk_loan to do link with this payment
* @param string $mode 'payment_loan' * @param string $mode 'payment_loan'
* @param string $label Label to use in bank record * @param string $label Label to use in bank record
* @param int $accountid Id of bank account to do link with * @param int $accountid Id of bank account to do link with
@ -392,7 +393,7 @@ class PaymentLoan extends CommonObject
* @param string $emetteur_banque Name of bank * @param string $emetteur_banque Name of bank
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque) function addPaymentToBank($user, $fk_loan, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque)
{ {
global $conf; global $conf;
@ -445,11 +446,10 @@ class PaymentLoan extends CommonObject
} }
} }
// Add link 'company' in bank_url between invoice and bank transaction (for each invoice concerned by payment) // Add link 'loan' in bank_url between invoice and bank transaction (for each invoice concerned by payment)
//$linkaddedforthirdparty=array();
if ($mode == 'payment_loan') if ($mode == 'payment_loan')
{ {
$result=$acc->add_url_line($bank_line_id, $this->id, DOL_URL_ROOT.'/loan/card.php?id=', ($this->label?$this->label:''),'loan'); $result=$acc->add_url_line($bank_line_id, $fk_loan, DOL_URL_ROOT.'/loan/card.php?id=', ($this->label?$this->label:''),'loan');
if ($result <= 0) dol_print_error($this->db); if ($result <= 0) dol_print_error($this->db);
} }
} }

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com> /* Copyright (C) 2014-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

View File

@ -116,7 +116,7 @@ if ($action == 'add_payment')
if (! $error) if (! $error)
{ {
$result = $payment->addPaymentToBank($user, 'payment_loan', '(LoanPayment)', GETPOST('accountid', 'int'), '', ''); $result = $payment->addPaymentToBank($user, $chid, 'payment_loan', '(LoanPayment)', GETPOST('accountid', 'int'), '', '');
if (! $result > 0) if (! $result > 0)
{ {
setEventMessages($payment->error, $payment->errors, 'errors'); setEventMessages($payment->error, $payment->errors, 'errors');
@ -175,7 +175,7 @@ if ($action == 'create')
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="2">'.$loan->label."</td></tr>\n"; print '<tr><td>'.$langs->trans("Label").'</td><td colspan="2">'.$loan->label."</td></tr>\n";
print '<tr><td>'.$langs->trans("Amount").'</td><td colspan="2">'.price($loan->capital,0,$outputlangs,1,-1,-1,$conf->currency).'</td></tr>'; print '<tr><td>'.$langs->trans("Amount").'</td><td colspan="2">'.price($loan->capital,0,$outputlangs,1,-1,-1,$conf->currency).'</td></tr>';
$sql = "SELECT SUM(amount_capital + amount_insurance + amount_interest) as total"; $sql = "SELECT SUM(amount_capital) as total";
$sql.= " FROM ".MAIN_DB_PREFIX."payment_loan"; $sql.= " FROM ".MAIN_DB_PREFIX."payment_loan";
$sql.= " WHERE fk_loan = ".$chid; $sql.= " WHERE fk_loan = ".$chid;
$resql = $db->query($sql); $resql = $db->query($sql);

View File

@ -1242,6 +1242,9 @@ class Task extends CommonObject
// Load source object // Load source object
$clone_task->fetch($fromid); $clone_task->fetch($fromid);
$clone_task->fetch_optionals();
//var_dump($clone_task->array_options);exit;
$origin_task->fetch($fromid); $origin_task->fetch($fromid);
$defaultref=''; $defaultref='';

View File

@ -150,6 +150,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP
$day=''; $day='';
$month=''; $month='';
$year=''; $year='';
$search_array_options=array();
} }
if (empty($search_projectstatus) && $search_projectstatus == '') $search_projectstatus=1; if (empty($search_projectstatus) && $search_projectstatus == '') $search_projectstatus=1;

View File

@ -341,8 +341,9 @@ else dol_print_error($db);
$sql = "SELECT s.rowid, s.nom as name, s.name_alias, s.barcode, s.town, s.zip, s.datec, s.code_client, s.code_fournisseur, "; $sql = "SELECT s.rowid, s.nom as name, s.name_alias, s.barcode, s.town, s.zip, s.datec, s.code_client, s.code_fournisseur, ";
$sql.= " st.libelle as stcomm, s.fk_stcomm as stcomm_id, s.fk_prospectlevel, s.prefix_comm, s.client, s.fournisseur, s.canvas, s.status as status,"; $sql.= " st.libelle as stcomm, s.fk_stcomm as stcomm_id, s.fk_prospectlevel, s.prefix_comm, s.client, s.fournisseur, s.canvas, s.status as status,";
$sql.= " s.siren as idprof1, s.siret as idprof2, ape as idprof3, idprof4 as idprof4, s.fk_pays,"; $sql.= " s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4 as idprof4, s.fk_pays,";
$sql.= " s.tms as date_update, s.datec as date_creation,"; $sql.= " s.tms as date_update, s.datec as date_creation,";
$sql.= " s.code_compta,s.code_compta_fournisseur,";
$sql.= " typent.code as typent_code,"; $sql.= " typent.code as typent_code,";
$sql.= " state.code_departement as state_code, state.nom as state_name"; $sql.= " state.code_departement as state_code, state.nom as state_name";
// We'll need these fields in order to filter by sale (including the case where the user can only see his prospects) // We'll need these fields in order to filter by sale (including the case where the user can only see his prospects)
@ -439,7 +440,6 @@ if (! $resql)
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
$i = 0; $i = 0;
if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE)) if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE))
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
@ -980,6 +980,7 @@ while ($i < min($num, $limit))
print $s; print $s;
print '</td>'; print '</td>';
} }
if (! empty($arrayfields['s.fk_prospectlevel']['checked'])) if (! empty($arrayfields['s.fk_prospectlevel']['checked']))
{ {
// Prospect level // Prospect level
@ -987,6 +988,7 @@ while ($i < min($num, $limit))
print $companystatic->getLibProspLevel(); print $companystatic->getLibProspLevel();
print "</td>"; print "</td>";
} }
if (! empty($arrayfields['s.fk_stcomm']['checked'])) if (! empty($arrayfields['s.fk_stcomm']['checked']))
{ {
// Prospect status // Prospect status