';
- }
-
$colspan=count($fieldlist)+3;
- if ($id == 4) $colspan++;
if (! empty($alabelisused)) // If there is one label among fields, we show legend of *
{
@@ -1175,7 +1148,7 @@ $db->close();
function fieldList($fieldlist, $obj='', $tabname='', $context='')
{
global $conf,$langs,$db;
- global $form;
+ global $form, $mysoc;
global $region_id;
global $elementList,$sourceList,$localtax_typeList;
global $bc;
@@ -1197,7 +1170,7 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
} // For state page, we do not show the country input (we link to region, not country)
print '
';
@@ -1207,7 +1219,7 @@ if ($resql)
// Transaction reconciliated or edit link
if ($bankaccount->canBeConciliated() > 0)
{
- if ($objp->rappro) // If line not conciliated and account can be conciliated
+ if ($objp->conciliated) // If line not conciliated and account can be conciliated
{
print ''.$objp->num_releve.'';
}
@@ -1220,10 +1232,18 @@ if ($resql)
if (! $i) $totalarray['nbfield']++;
}
+ if (! empty($arrayfields['b.conciliated']['checked']))
+ {
+ print '
';
}
diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php
index c20169270bf..7870824285a 100644
--- a/htdocs/core/lib/security.lib.php
+++ b/htdocs/core/lib/security.lib.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2008-2012 Regis Houssin
+ * Copyright (C) 2008-2017 Regis Houssin
*
* 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
@@ -74,7 +74,7 @@ function dol_decode($chain)
* If constant MAIN_SECURITY_SALT is defined, we use it as a salt.
*
* @param string $chain String to hash
- * @param int $type Type of hash (0:auto, 1:sha1, 2:sha1+md5, 3:md5). Use 3 here, if hash is not needed for security purpose, for security need, prefer 0.
+ * @param int $type Type of hash (0:auto, 1:sha1, 2:sha1+md5, 3:md5, 4:md5 for OpenLdap). Use 3 here, if hash is not needed for security purpose, for security need, prefer 0.
* @return string Hash of string
*/
function dol_hash($chain,$type=0)
@@ -87,6 +87,7 @@ function dol_hash($chain,$type=0)
if ($type == 1) return sha1($chain);
else if ($type == 2) return sha1(md5($chain));
else if ($type == 3) return md5($chain);
+ else if ($type == 4) return '{md5}'.base64_encode(mhash(MHASH_MD5,$chain)); // For OpenLdap with md5
else if (! empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1') return sha1($chain);
else if (! empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1md5') return sha1(md5($chain));
@@ -343,7 +344,7 @@ function restrictedArea($user, $features, $objectid=0, $tableandshare='', $featu
* This function is also called by restrictedArea
*
* @param User $user User to check
- * @param array $featuresarray Features/modules to check. Example: ('user','service')
+ * @param array $featuresarray Features/modules to check. Example: ('user','service')
* @param int $objectid Object ID if we want to check a particular record (optional) is linked to a owned thirdparty (optional).
* @param string $tableandshare 'TableName&SharedElement' with Tablename is table where object is stored. SharedElement is an optional key to define where to check entity for multicompany modume. Param not used if objectid is null (optional).
* @param string $feature2 Feature to check, second level of permission (optional). Can be or check with 'level1|level2'.
@@ -367,7 +368,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid=0, $tableandsh
// For backward compatibility
if ($feature == 'member') $feature='adherent';
-
+
$check = array('adherent','banque','user','usergroup','produit','service','produit|service','categorie'); // Test on entity only (Objects with no link to company)
$checksoc = array('societe'); // Test for societe object
$checkother = array('contact'); // Test on entity and link to societe. Allowed if link is empty (Ex: contacts...).
diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php
index 924a71020d8..c7ac721a3d4 100644
--- a/htdocs/core/menus/standard/eldy.lib.php
+++ b/htdocs/core/menus/standard/eldy.lib.php
@@ -1425,7 +1425,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
$newmenu->add('/compta/bank/card.php?id='.$objp->rowid,$objp->label,1,$user->rights->banque->lire);
if ($objp->rappro && $objp->courant != Account::TYPE_CASH && empty($objp->clos)) // If not cash account and not closed and can be reconciliate
{
- $newmenu->add('/compta/bank/bankentries.php?id='.$objp->rowid,$langs->trans("Conciliate"),2,$user->rights->banque->consolidate);
+ $newmenu->add('/compta/bank/bankentries.php?action=reconcile&contextpage=banktransactionlist-'.$objp->rowid.'&account='.$objp->rowid.'&id='.$objp->rowid.'&search_conciliated=0',$langs->trans("Conciliate"),2,$user->rights->banque->consolidate);
}
$i++;
}
diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php
index e4709facd9b..fd7c3e2633c 100644
--- a/htdocs/expedition/card.php
+++ b/htdocs/expedition/card.php
@@ -3,7 +3,7 @@
* Copyright (C) 2005-2016 Laurent Destailleur
* Copyright (C) 2005 Simon TOSSER
* Copyright (C) 2005-2012 Regis Houssin
- * Copyright (C) 2011-2012 Juanjo Menent
+ * Copyright (C) 2011-2017 Juanjo Menent
* Copyright (C) 2013 Florian Henry
* Copyright (C) 2013 Marcos García
* Copyright (C) 2014 Cedric GROSS
@@ -1744,10 +1744,10 @@ else if ($id || $ref)
{
$sql = "SELECT obj.rowid, obj.fk_product, obj.label, obj.description, obj.product_type as fk_product_type, obj.qty as qty_asked, obj.date_start, obj.date_end";
$sql.= ", ed.rowid as shipmentline_id, ed.qty as qty_shipped, ed.fk_expedition as expedition_id, ed.fk_origin_line, ed.fk_entrepot";
- $sql.= ", e.rowid as shipment_id, e.ref as shipment_ref, e.date_creation, e.date_valid, e.date_delivery, e.date_expedition,";
- //if ($conf->livraison_bon->enabled) $sql .= " l.rowid as livraison_id, l.ref as livraison_ref, l.date_delivery, ld.qty as qty_received,";
- $sql.= ' p.label as product_label, p.ref, p.fk_product_type, p.rowid as prodid, p.tobatch as product_tobatch';
- $sql.= ' p.description as product_desc';
+ $sql.= ", e.rowid as shipment_id, e.ref as shipment_ref, e.date_creation, e.date_valid, e.date_delivery, e.date_expedition";
+ //if ($conf->livraison_bon->enabled) $sql .= ", l.rowid as livraison_id, l.ref as livraison_ref, l.date_delivery, ld.qty as qty_received";
+ $sql.= ', p.label as product_label, p.ref, p.fk_product_type, p.rowid as prodid, p.tobatch as product_tobatch';
+ $sql.= ', p.description as product_desc';
$sql.= " FROM ".MAIN_DB_PREFIX."expeditiondet as ed";
$sql.= ", ".MAIN_DB_PREFIX."expedition as e";
$sql.= ", ".MAIN_DB_PREFIX.$origin."det as obj";
diff --git a/htdocs/exports/class/export.class.php b/htdocs/exports/class/export.class.php
index 858ad163cbb..dd9dc38efdf 100644
--- a/htdocs/exports/class/export.class.php
+++ b/htdocs/exports/class/export.class.php
@@ -329,7 +329,7 @@ class Export
$szFilterQuery=" ".$NameField."='".$ValueField."'";
break;
default:
- dol_syslog("Error we try to forge an sql export request with a condition on a field with type '".$InfoFieldList[0]."' (defined into module descriptor) but this type is unknown/not supported. It looks like a bug into module descriptor.", LOG_ERROR);
+ dol_syslog("Error we try to forge an sql export request with a condition on a field with type '".$InfoFieldList[0]."' (defined into module descriptor) but this type is unknown/not supported. It looks like a bug into module descriptor.", LOG_ERR);
}
return $szFilterQuery;
diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php
index 7407984a0d4..958ac64573c 100644
--- a/htdocs/filefunc.inc.php
+++ b/htdocs/filefunc.inc.php
@@ -31,7 +31,7 @@
*/
if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr');
-if (! defined('DOL_VERSION')) define('DOL_VERSION','6.0.0-alpha');
+if (! defined('DOL_VERSION')) define('DOL_VERSION','6.0.0-alpha'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c
if (! defined('EURO')) define('EURO',chr(128));
diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php
index fb1a3168c3d..c4e7811f4b3 100644
--- a/htdocs/fourn/class/fournisseur.commande.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.class.php
@@ -350,10 +350,10 @@ class CommandeFournisseur extends CommonOrder
$line->multicurrency_total_tva = $objp->multicurrency_total_tva;
$line->multicurrency_total_ttc = $objp->multicurrency_total_ttc;
- $this->special_code = $objp->special_code;
- $this->fk_parent_line = $objp->fk_parent_line;
+ $line->special_code = $objp->special_code;
+ $line->fk_parent_line = $objp->fk_parent_line;
- $this->rang = $objp->rang;
+ $line->rang = $objp->rang;
$this->lines[$i] = $line;
@@ -1399,7 +1399,7 @@ class CommandeFournisseur extends CommonOrder
if ($prod->fetch($fk_product) > 0)
{
$product_type = $prod->type;
- $label = $prod->libelle;
+ $label = $prod->label;
// We use 'none' instead of $fourn_ref, because fourn_ref may not exists anymore. So we will take the first supplier price ok.
// If we want a dedicated supplier price, we must provide $fk_prod_fourn_price.
@@ -1506,7 +1506,6 @@ class CommandeFournisseur extends CommonOrder
$this->line->product_type=$product_type;
$this->line->remise_percent=$remise_percent;
$this->line->subprice=$pu_ht;
- $this->line->rang=$this->rang;
$this->line->info_bits=$info_bits;
$this->line->vat_src_code=$vat_src_code;
@@ -3099,7 +3098,7 @@ class CommandeFournisseurLigne extends CommonOrderLine
$sql.= " total_ht, total_tva, total_localtax1, total_localtax2, total_ttc, fk_unit,";
$sql.= " fk_multicurrency, multicurrency_code, multicurrency_subprice, multicurrency_total_ht, multicurrency_total_tva, multicurrency_total_ttc";
$sql.= ")";
- $sql.= " VALUES (".$this->fk_commande.", '" . $this->db->escape($this->product_label) . "','" . $this->db->escape($this->desc) . "',";
+ $sql.= " VALUES (".$this->fk_commande.", '" . $this->db->escape($this->label) . "','" . $this->db->escape($this->desc) . "',";
$sql.= " ".($this->date_start?"'".$this->db->idate($this->date_start)."'":"null").",";
$sql.= " ".($this->date_end?"'".$this->db->idate($this->date_end)."'":"null").",";
if ($this->fk_product) { $sql.= $this->fk_product.","; }
diff --git a/htdocs/fourn/commande/orderstoinvoice.php b/htdocs/fourn/commande/orderstoinvoice.php
index 1f87cdf5929..f804a1d9ab7 100644
--- a/htdocs/fourn/commande/orderstoinvoice.php
+++ b/htdocs/fourn/commande/orderstoinvoice.php
@@ -5,7 +5,7 @@
* Copyright (C) 2005-2012 Regis Houssin
* Copyright (C) 2012 Andreu Bisquerra Gaya
* Copyright (C) 2012 David Rodriguez Martinez
- * Copyright (C) 2012 Juanjo Menent
+ * Copyright (C) 2012-2017 Juanjo Menent
* Copyright (C) 2014 Florian Henry
* Copyright (C) 2015 Marcos García
*
@@ -116,7 +116,7 @@ if (($action == 'create' || $action == 'add') && ! $error) {
$_GET['originid'] = $orders_id[0];
}
if (isset($_POST['orders_to_invoice'])) {
- $orders_id = GETPOST('orders_to_invoice','',1);
+ $orders_id = GETPOST('orders_to_invoice','',2);
$nn = count($orders_id);
$ii = 0;
diff --git a/htdocs/install/mysql/migration/4.0.0-5.0.0.sql b/htdocs/install/mysql/migration/4.0.0-5.0.0.sql
index 88f67ccfa5a..f542c096437 100644
--- a/htdocs/install/mysql/migration/4.0.0-5.0.0.sql
+++ b/htdocs/install/mysql/migration/4.0.0-5.0.0.sql
@@ -255,6 +255,10 @@ ALTER TABLE llx_contrat ADD COLUMN fk_user_modif integer;
UPDATE llx_accounting_account set account_parent = 0 where account_parent = '';
+-- VMYSQL4.3 ALTER TABLE llx_product_price MODIFY COLUMN date_price DATETIME NULL;
+-- VPGSQL8.2 ALTER TABLE llx_product_price ALTER COLUMN date_price DROP NOT NULL;
+ALTER TABLE llx_product_price ALTER COLUMN date_price SET DEFAULT NULL;
+
ALTER TABLE llx_product_price ADD COLUMN default_vat_code varchar(10) after tva_tx;
ALTER TABLE llx_product_fournisseur_price ADD COLUMN default_vat_code varchar(10) after tva_tx;
diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang
index a608875a752..8fc208e9e3f 100644
--- a/htdocs/langs/en_US/companies.lang
+++ b/htdocs/langs/en_US/companies.lang
@@ -401,7 +401,7 @@ LeopardNumRefModelDesc=The code is free. This code can be modified at any time.
ManagingDirectors=Manager(s) name (CEO, director, president...)
MergeOriginThirdparty=Duplicate third party (third party you want to delete)
MergeThirdparties=Merge third parties
-ConfirmMergeThirdparties=Are you sure you want to merge this third party into the current one? All linked objects (invoices, orders, ...) will be moved to current third party so you will be able to delete the duplicate one.
+ConfirmMergeThirdparties=Are you sure you want to merge this third party into the current one? All linked objects (invoices, orders, ...) will be moved to current third party, then the thirdparty will be deleted.
ThirdpartiesMergeSuccess=Thirdparties have been merged
SaleRepresentativeLogin=Login of sales representative
SaleRepresentativeFirstname=First name of sales representative
diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang
index a822a98650c..eed25cde0c8 100644
--- a/htdocs/langs/en_US/errors.lang
+++ b/htdocs/langs/en_US/errors.lang
@@ -184,6 +184,7 @@ ErrorUserNotAssignedToTask=User must be assigned to task to be able to enter tim
ErrorTaskAlreadyAssigned=Task already assigned to user
ErrorModuleFileSeemsToHaveAWrongFormat=The module package seems to have a wrong format.
ErrorFilenameDosNotMatchDolibarrPackageRules=The name of the module package (%s) does not match expected name syntax: %s
+ErrorDuplicateTrigger=Error, duplicate trigger name %s. Already loaded from %s.
# Warnings
WarningPasswordSetWithNoAccount=A password was set for this member. However, no user account was created. So this password is stored but can't be used to login to Dolibarr. It may be used by an external module/interface but if you don't need to define any login nor password for a member, you can disable option "Manage a login for each member" from Member module setup. If you need to manage a login but don't need any password, you can keep this field empty to avoid this warning. Note: Email can also be used as a login if the member is linked to a user.
diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php
index 90bc9d7296f..38b65ddfb4b 100644
--- a/htdocs/product/class/api_products.class.php
+++ b/htdocs/product/class/api_products.class.php
@@ -264,7 +264,7 @@ class Products extends DolibarrApi
*/
function getCategories($id, $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0) {
$categories = new Categories();
- return $categories->getListForItem('product', $sortfield, $sortorder, $limit, $page, $id);
+ return $categories->getListForItem($sortfield, $sortorder, $limit, $page, 'product', $id);
}
/**
diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php
index a65ffdd64e2..c50cbd014f7 100644
--- a/htdocs/projet/activity/perday.php
+++ b/htdocs/projet/activity/perday.php
@@ -415,11 +415,11 @@ if (! empty($conf->global->PROJECT_LINES_PERDAY_SHOW_THIRDPARTY))
{
print '
'.$langs->trans("ThirdParty").'
';
}
-print '
'.$langs->trans("PlannedWorkload").'
';
-print '
'.$langs->trans("ProgressDeclared").'
';
-print '
'.$langs->trans("TimeSpent").'
';
-if ($usertoprocess->id == $user->id) print '
'.$langs->trans("TimeSpentByYou").'
';
-else print '
'.$langs->trans("TimeSpentByUser").'
';
+print '
'.$langs->trans("PlannedWorkload").'
';
+print '
'.$langs->trans("ProgressDeclared").'
';
+print '
'.$langs->trans("TimeSpent").'
';
+if ($usertoprocess->id == $user->id) print '
'.$langs->trans("TimeSpentByYou").'
';
+else print '
'.$langs->trans("TimeSpentByUser").'
';
print '
'.$langs->trans("HourStart").'
';
print '
'.$langs->trans("Duration").'
';
print '
'.$langs->trans("Note").'
';
diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php
index 5847e91d46c..989424afd67 100644
--- a/htdocs/projet/activity/perweek.php
+++ b/htdocs/projet/activity/perweek.php
@@ -262,7 +262,7 @@ if ($action == 'addtime' && $user->rights->projet->lire)
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
// Redirect to avoid submit twice on back
- header('Location: '.$_SERVER["PHP_SELF"].($projectid?'?id='.$projectid:'?').($mode?'&mode='.$mode:''));
+ header('Location: '.$_SERVER["PHP_SELF"].($projectid?'?id='.$projectid:'?').($mode?'&mode='.$mode:'').($day?'&day='.$day:'').($month?'&month='.$month:'').($year?'&year='.$year:''));
exit;
}
}
@@ -410,17 +410,17 @@ if (! empty($conf->global->PROJECT_LINES_PERWEEK_SHOW_THIRDPARTY))
{
print '