diff --git a/ChangeLog b/ChangeLog
index ed4498c342a5707e9754b9729ba481760ad5beb0..e845af8b95291e9f49a6214a55eb4f5d800687e2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -82,8 +82,9 @@ For users:
 - New: Add dunning into accountancy report.
 - New: Add favorite button into country dictionary to put value on top select list
 - Upgrade phpexcel lib to 1.7.8
-- New : Use of MAIN_USE_FILECACHE_EXPORT_EXCEL_DIR to use disk cache for big excel export
-- New : Option on extrafields to have them always editable regardless of the document status
+- New : Use of MAIN_USE_FILECACHE_EXPORT_EXCEL_DIR to use disk cache for big excel export.
+- New : Option on extrafields to have them always editable regardless of the document status.
+- New : New module PrintIPP to print without opening document is available as stable.
 - Fix: [ bug #1487 ] PAYMENT_DELETE trigger does not intercept trigger action
 - Fix: [ bug #1470, #1472, #1473] User trigger problem
 - Fix: [ bug #1489, #1491 ] Intervention trigger problem
diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php
index cb40b7b361b0daceb5547c3a4487711783805f74..663e763a9d3f3ca09da13b4d00c46972509cc61c 100644
--- a/htdocs/accountancy/customer/index.php
+++ b/htdocs/accountancy/customer/index.php
@@ -2,7 +2,7 @@
 /* Copyright (C) 2013      Olivier Geffroy		<jeff@jeffinfo.com>
  * Copyright (C) 2013-2014 Florian Henry		<florian.henry@open-concept.pro>
  * Copyright (C) 2013-2014 Alexandre Spangaro	<alexandre.spangaro@gmail.com>
- * Copyright (C) 2014	   Juanjo Menent		<jmenent@2byte.es> 
+ * Copyright (C) 2014	   Juanjo Menent		<jmenent@2byte.es>
  *
  * 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
@@ -26,7 +26,7 @@
  */
 
 require '../../main.inc.php';
-	
+
 // Class
 require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
 require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
@@ -43,7 +43,7 @@ if ($user->societe_id > 0)
 	accessforbidden();
 if (! $user->rights->accounting->ventilation->read)
 	accessforbidden();
-	
+
 // Filter
 $year = $_GET["year"];
 if ($year == 0) {
@@ -57,10 +57,10 @@ if ($year == 0) {
 // Validate History
 $action = GETPOST('action');
 if ($action == 'validatehistory') {
-	
+
 	$error = 0;
 	$db->begin();
-	
+
 	if ($db->type == 'pgsql') {
 		$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd";
 		$sql1 .= " SET fd.fk_code_ventilation = accnt.rowid";
@@ -75,8 +75,7 @@ if ($action == 'validatehistory') {
 		$sql1 .= " AND accnt.active = 1 AND p.accountancy_code_sell=accnt.account_number";
 		$sql1 .= " AND fd.fk_code_ventilation = 0";
 	}
-	
-	dol_syslog("/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG);
+
 	$resql1 = $db->query($sql1);
 	if (! $resql1) {
 		$error ++;
@@ -106,7 +105,6 @@ $sql .= " , " . MAIN_DB_PREFIX . "facture as f";
 $sql .= " WHERE fd.fk_code_ventilation = 0";
 $sql .= " AND f.rowid = fd.fk_facture AND f.fk_statut = 1;";
 
-dol_syslog("/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG);
 $result = $db->query($sql);
 if ($result) {
 	$row = $db->fetch_row($result);
@@ -162,15 +160,14 @@ if (! empty($conf->multicompany->enabled)) {
 
 $sql .= " GROUP BY fd.fk_code_ventilation";
 
-dol_syslog("/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG);
 $resql = $db->query($sql);
 if ($resql) {
 	$i = 0;
 	$num = $db->num_rows($resql);
-	
+
 	while ( $i < $num ) {
 		$row = $db->fetch_row($resql);
-		
+
 		print '<tr><td>' . length_accountg($row[0]) . '</td>';
 		print '<td align="left">' . $row[1] . '</td>';
 		print '<td align="right">' . price($row[2]) . '</td>';
@@ -235,15 +232,14 @@ if (! empty($conf->multicompany->enabled)) {
 	$sql .= " AND f.entity = '" . $conf->entity . "'";
 }
 
-dol_syslog('accountancy/customer/index.php:: $sql=' . $sql);
 $resql = $db->query($sql);
 if ($resql) {
 	$i = 0;
 	$num = $db->num_rows($resql);
-	
+
 	while ( $i < $num ) {
 		$row = $db->fetch_row($resql);
-		
+
 		print '<tr><td>' . $row[0] . '</td>';
 		print '<td align="right">' . price($row[1]) . '</td>';
 		print '<td align="right">' . price($row[2]) . '</td>';
@@ -284,7 +280,7 @@ if (! empty($conf->margin->enabled)) {
 	print '<td width="60" align="center">' . $langs->trans("NovemberMin") . '</td>';
 	print '<td width="60" align="center">' . $langs->trans("DecemberMin") . '</td>';
 	print '<td width="60" align="center"><b>' . $langs->trans("Total") . '</b></td></tr>';
-	
+
 	$sql = "SELECT '" . $langs->trans("Vide") . "' AS 'Marge',";
 	$sql .= "  ROUND(SUM(IF(MONTH(f.datef)=1,(fd.total_ht-(fd.qty * fd.buy_price_ht)),0)),2) AS 'Janvier',";
 	$sql .= "  ROUND(SUM(IF(MONTH(f.datef)=2,(fd.total_ht-(fd.qty * fd.buy_price_ht)),0)),2) AS 'Fevrier',";
@@ -303,20 +299,19 @@ if (! empty($conf->margin->enabled)) {
 	$sql .= "  LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
 	$sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
 	$sql .= "  AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
-	
+
 	if (! empty($conf->multicompany->enabled)) {
 		$sql .= " AND f.entity = '" . $conf->entity . "'";
 	}
-	
-	dol_syslog('accountancy/customer/index.php:: $sql=' . $sql);
+
 	$resql = $db->query($sql);
 	if ($resql) {
 		$i = 0;
 		$num = $db->num_rows($resql);
-		
+
 		while ( $i < $num ) {
 			$row = $db->fetch_row($resql);
-			
+
 			print '<tr><td>' . $row[0] . '</td>';
 			print '<td align="right">' . price($row[1]) . '</td>';
 			print '<td align="right">' . price($row[2]) . '</td>';
diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php
index 89a78b5d6da5292a5793347c057a2ebe323a32e7..a0f535c2b7b1363b7209d721c41afd6db994a292 100644
--- a/htdocs/admin/commande.php
+++ b/htdocs/admin/commande.php
@@ -249,7 +249,7 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
 print_fiche_titre($langs->trans("OrdersSetup"),$linkback,'setup');
 print '<br>';
 
-$head = order_admin_prepare_head(null);
+$head = order_admin_prepare_head();
 
 dol_fiche_head($head, 'general', $langs->trans("Orders"), 0, 'order');
 
diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php
index 3c251cf6c3b8cbe2d3ba1e161918315b5468caa6..a7692655a0a1db4b04ced4de10aacaa20000c62f 100644
--- a/htdocs/admin/facture.php
+++ b/htdocs/admin/facture.php
@@ -296,7 +296,7 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
 print_fiche_titre($langs->trans("BillsSetup"),$linkback,'setup');
 print '<br>';
 
-$head = invoice_admin_prepare_head(null);
+$head = invoice_admin_prepare_head();
 dol_fiche_head($head, 'general', $langs->trans("Invoices"), 0, 'invoice');
 
 /*
diff --git a/htdocs/admin/mailman.php b/htdocs/admin/mailman.php
index f4d2010ca74a549b4ea7b4818cc02d0799015063..3e4a2c14a98fb257e8d7882f9b94ea552832bb40 100644
--- a/htdocs/admin/mailman.php
+++ b/htdocs/admin/mailman.php
@@ -158,7 +158,8 @@ $head = mailmanspip_admin_prepare_head();
 
 dol_fiche_head($head, 'mailman', $langs->trans("Setup"), 0, 'user');
 
-$var=!$var;
+$var=true;
+
 if (! empty($conf->global->ADHERENT_USE_MAILMAN))
 {
     //$lien=img_picto($langs->trans("Active"),'tick').' ';
diff --git a/htdocs/admin/order_extrafields.php b/htdocs/admin/order_extrafields.php
index 90ceed434c22ae14ce9f1225a3fd1aa388172ed4..81b7e74a479dd295577c84c593c6251a803a2f8e 100644
--- a/htdocs/admin/order_extrafields.php
+++ b/htdocs/admin/order_extrafields.php
@@ -73,7 +73,7 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
 print_fiche_titre($langs->trans("OrdersSetup"),$linkback,'setup');
 print "<br>\n";
 
-$head = order_admin_prepare_head(null);
+$head = order_admin_prepare_head();
 
 dol_fiche_head($head, 'attributes', $langs->trans("Orders"), 0, 'order');
 
diff --git a/htdocs/admin/orderdet_extrafields.php b/htdocs/admin/orderdet_extrafields.php
index 8f1dfb805381a3f8c6f1a11384a7d6a8a482ddcc..515714a51e4b239e0b7d27de0ef941f4d245b045 100644
--- a/htdocs/admin/orderdet_extrafields.php
+++ b/htdocs/admin/orderdet_extrafields.php
@@ -74,7 +74,7 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
 print_fiche_titre($langs->trans("OrdersSetup"),$linkback,'setup');
 print "<br>\n";
 
-$head = order_admin_prepare_head(null);
+$head = order_admin_prepare_head();
 
 dol_fiche_head($head, 'attributeslines', $langs->trans("Orders"), 0, 'order');
 
diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php
index aef978ec6ad73e635fc565946d07df5e8d065295..01f3274003691a96209ace9741cb758918c9ac7a 100644
--- a/htdocs/admin/propal.php
+++ b/htdocs/admin/propal.php
@@ -263,7 +263,7 @@ $form=new Form($db);
 $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
 print_fiche_titre($langs->trans("PropalSetup"),$linkback,'setup');
 
-$head = propal_admin_prepare_head(null);
+$head = propal_admin_prepare_head();
 
 dol_fiche_head($head, 'general', $langs->trans("Proposals"), 0, 'propal');
 
@@ -602,7 +602,7 @@ if ($conf->banque->enabled)
 {
     $var=!$var;
     print '<tr '.$bc[$var].'><td>';
-    print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL").'</td><td>&nbsp</td><td align="center">';
+    print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL").'</td><td>&nbsp</td><td align="right">';
     if (! empty($conf->use_javascript_ajax))
     {
         print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL');
diff --git a/htdocs/admin/spip.php b/htdocs/admin/spip.php
index af46c074bb9ff9e0d1c0695206278c25b98f5cd7..9c81338562e312b4a9e9907e8d12c2dd72a76609 100644
--- a/htdocs/admin/spip.php
+++ b/htdocs/admin/spip.php
@@ -117,10 +117,11 @@ $head = mailmanspip_admin_prepare_head();
 
 dol_fiche_head($head, 'spip', $langs->trans("Setup"), 0, 'user');
 
+$var=true;
+
 /*
  * Spip
  */
-$var=!$var;
 if (! empty($conf->global->ADHERENT_USE_SPIP))
 {
     //$lien=img_picto($langs->trans("Active"),'tick').' ';
diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php
index 5745c5f82ba80c3cc8206b756fff056f7fa825a8..2f48eb2be79eb45f665fc3d57a64780c00dc6380 100644
--- a/htdocs/admin/supplier_invoice.php
+++ b/htdocs/admin/supplier_invoice.php
@@ -198,7 +198,7 @@ print_fiche_titre($langs->trans("SuppliersSetup"),$linkback,'setup');
 
 print "<br>";
 
-$head = supplierorder_admin_prepare_head(null);
+$head = supplierorder_admin_prepare_head();
 
 dol_fiche_head($head, 'invoice', $langs->trans("Suppliers"), 0, 'company');
 
diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php
index ac2ab8242335429fe692684f76d23071609a2b03..2d4be98f34a017bfaad4a7805ddcd584240eaba3 100644
--- a/htdocs/admin/supplier_order.php
+++ b/htdocs/admin/supplier_order.php
@@ -199,7 +199,7 @@ print_fiche_titre($langs->trans("SuppliersSetup"),$linkback,'setup');
 
 print "<br>";
 
-$head = supplierorder_admin_prepare_head(null);
+$head = supplierorder_admin_prepare_head();
 
 dol_fiche_head($head, 'order', $langs->trans("Suppliers"), 0, 'company');
 
diff --git a/htdocs/admin/supplierinvoice_extrafields.php b/htdocs/admin/supplierinvoice_extrafields.php
index 40494f9c286f89a18926b691d2f6dbc5aa3df7fb..e47c873804196121d74c5543c36e8ec30484ee46 100644
--- a/htdocs/admin/supplierinvoice_extrafields.php
+++ b/htdocs/admin/supplierinvoice_extrafields.php
@@ -76,7 +76,7 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
 print_fiche_titre($langs->trans("SuppliersSetup"),$linkback,'setup');
 print "<br>\n";
 
-$head = supplierorder_admin_prepare_head(null);
+$head = supplierorder_admin_prepare_head();
 
 dol_fiche_head($head, 'supplierinvoice', $langs->trans("Suppliers"), 0, 'company');
 
diff --git a/htdocs/admin/supplierorder_extrafields.php b/htdocs/admin/supplierorder_extrafields.php
index 4a2671942fa02337f81365ea25682649ccbd371d..96e20b92f1700de590deddb7a9f8407c906ed8ef 100644
--- a/htdocs/admin/supplierorder_extrafields.php
+++ b/htdocs/admin/supplierorder_extrafields.php
@@ -73,7 +73,7 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
 print_fiche_titre($langs->trans("SuppliersSetup"),$linkback,'setup');
 print "<br>\n";
 
-$head = supplierorder_admin_prepare_head(null);
+$head = supplierorder_admin_prepare_head();
 
 dol_fiche_head($head, 'supplierorder', $langs->trans("Suppliers"), 0, 'company');
 
diff --git a/htdocs/barcode/printsheet.php b/htdocs/barcode/printsheet.php
index d862cb5da8f9906e2270e57c59d0f9a6f47acb43..0ce692674b17235e5a1e715aba87518dbb4d48d2 100644
--- a/htdocs/barcode/printsheet.php
+++ b/htdocs/barcode/printsheet.php
@@ -121,8 +121,8 @@ if ($action == 'builddoc')
 	if (! $error)
 	{
 		$code=$forbarcode;
-		$generator=$stdobject->barcode_type_coder;
-		$encoding=strtoupper($stdobject->barcode_type_code);
+		$generator=$stdobject->barcode_type_coder;				// coder (loaded by fetch_barcode). Engine.
+		$encoding=strtoupper($stdobject->barcode_type_code);	// code (loaded by fetch_barcode). Example 'ean', 'isbn', ...
 		$barcodeimage=$conf->barcode->dir_temp.'/barcode_'.$code.'_'.$encoding.'.png';
 
 		$diroutput=$conf->barcode->dir_temp;
diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php
index 6f3b306af72ac52f624fd2d76929762c23c9ae57..a821cf8e94fb750812d51c47e471bdfe88cf57d1 100644
--- a/htdocs/bookmarks/card.php
+++ b/htdocs/bookmarks/card.php
@@ -44,6 +44,8 @@ $userid=GETPOST("userid","int");
 $position=GETPOST("position","int");
 $backtopage=GETPOST('backtopage','alpha');
 
+$bookmark=new Bookmark($db);
+
 
 /*
  * Actions
@@ -67,7 +69,6 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update')
 		exit;
 	}
 
-	$bookmark=new Bookmark($db);
 	if ($action == 'update') $bookmark->fetch($_POST["id"]);
 	$bookmark->fk_user=$userid;
 	$bookmark->title=$title;
@@ -127,6 +128,17 @@ llxHeader();
 $form=new Form($db);
 
 
+$head = array();
+$h=1;
+
+$head[$h][0] = $_SERVER["PHP_SELF"].($bookmark->id?'id='.$bookmark->id:'');
+$head[$h][1] = $langs->trans("Card");
+$head[$h][2] = 'card';
+$h++;
+
+$hselected='card';
+
+
 if ($action == 'create')
 {
 	/*
@@ -179,7 +191,6 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
 	/*
 	 * Fact bookmark mode or visually edition
 	 */
-	$bookmark=new Bookmark($db);
 	$bookmark->fetch($id);
 
 	$head = array(
diff --git a/htdocs/cashdesk/include/keypad.php b/htdocs/cashdesk/include/keypad.php
index 798c30c92fbb7a38eb17857a742d6e4c4f0cd454..7560180396a58628e1272bfae2d359e36647fac9 100644
--- a/htdocs/cashdesk/include/keypad.php
+++ b/htdocs/cashdesk/include/keypad.php
@@ -16,7 +16,7 @@
  */
 
 /**
- * Return a string to outptu a keypad
+ * Return a string to output a keypad
  *
  * @param	string		$keypadname		Key pad name
  * @param 	string		$formname		Form name
@@ -24,6 +24,8 @@
  */
 function genkeypad($keypadname, $formname)
 {
+	global $conf;
+
 	if (empty($conf->global->CASHDESK_SHOW_KEYPAD)) return '';
 
 	// défine the font size of button
diff --git a/htdocs/comm/admin/propal_extrafields.php b/htdocs/comm/admin/propal_extrafields.php
index d41dd27b362536cd6350b7ce476ff59cd2d6f81b..2a1a2286db511e82d5bc909ba3eb0ff07f57f613 100644
--- a/htdocs/comm/admin/propal_extrafields.php
+++ b/htdocs/comm/admin/propal_extrafields.php
@@ -69,7 +69,7 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
 print_fiche_titre($langs->trans("PropalSetup"),$linkback,'setup');
 
 
-$head = propal_admin_prepare_head(null);
+$head = propal_admin_prepare_head();
 
 dol_fiche_head($head, 'attributes', $langs->trans("Proposals"), 0, 'propal');
 
diff --git a/htdocs/comm/admin/propaldet_extrafields.php b/htdocs/comm/admin/propaldet_extrafields.php
index e83f31e993fdd33603b1ba270f207dc9303eba83..40dbad4ef9462cd6bd2eb93c6835d886f4ead456 100644
--- a/htdocs/comm/admin/propaldet_extrafields.php
+++ b/htdocs/comm/admin/propaldet_extrafields.php
@@ -74,7 +74,7 @@ llxHeader('',$langs->trans("PropalSetup"));
 $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
 print_fiche_titre($langs->trans("PropalSetup"),$linkback,'setup');
 
-$head = propal_admin_prepare_head(null);
+$head = propal_admin_prepare_head();
 
 dol_fiche_head($head, 'attributeslines', $langs->trans("Proposals"), 0, 'propal');
 
diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php
index 465fe5e2d767bfd301a1bf91de5fc91a7b707377..aa75945f0eac90271a552e790e7fe504373264ce 100644
--- a/htdocs/comm/propal.php
+++ b/htdocs/comm/propal.php
@@ -553,6 +553,8 @@ else if ($action == 'setstatut' && $user->rights->propal->cloturer && ! GETPOST(
 	}
 }
 
+include DOL_DOCUMENT_ROOT.'/core/actions_printipp.inc.php';
+
 
 /*
  * Send mail
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index 115b3248a0572ea2bb7885f8410b4864edcb78a8..309b0c35e1af25042d450f554b63fe10dc76e31c 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -1115,15 +1115,6 @@ else if ($action == 'remove_file') {
 	}
 }
 
-// Print file
-else if ($action == 'print_file' and $user->rights->printipp->read) {
-	require_once DOL_DOCUMENT_ROOT . '/core/class/dolprintipp.class.php';
-	$printer = new dolPrintIPP($db, $conf->global->PRINTIPP_HOST, $conf->global->PRINTIPP_PORT, $user->login, $conf->global->PRINTIPP_USER, $conf->global->PRINTIPP_PASSWORD);
-	$printer->print_file(GETPOST('file', 'alpha'), GETPOST('printer', 'alpha'));
-	setEventMessage($langs->trans("FileWasSentToPrinter", GETPOST('file')));
-	$action = '';
-}
-
 else if ($action == 'update_extras') {
 	// Fill array 'array_options' with data from update form
 	$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
@@ -1151,6 +1142,9 @@ else if ($action == 'update_extras') {
 		$action = 'edit_extras';
 }
 
+include DOL_DOCUMENT_ROOT.'/core/actions_printipp.inc.php';
+
+
 /*
  * Send mail
  */
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index 56b8cbd5e5f59b7c26368daadce8ae5399b0b67d..be6ad58764ac8e73f8067526dae992b673bb1fea 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -1615,14 +1615,7 @@ else if ($action == 'remove_file') {
 	}
 }
 
-// Print file
-else if ($action == 'print_file' and $user->rights->printipp->read) {
-	require_once DOL_DOCUMENT_ROOT . '/core/class/dolprintipp.class.php';
-	$printer = new dolPrintIPP($db, $conf->global->PRINTIPP_HOST, $conf->global->PRINTIPP_PORT, $user->login, $conf->global->PRINTIPP_USER, $conf->global->PRINTIPP_PASSWORD);
-	$printer->print_file(GETPOST('file', 'alpha'), GETPOST('printer', 'alpha'));
-	setEventMessage($langs->trans("FileWasSentToPrinter", GETPOST('file')));
-	$action = '';
-}
+include DOL_DOCUMENT_ROOT.'/core/actions_printipp.inc.php';
 
 if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->facture->creer)
 {
diff --git a/htdocs/compta/facture/admin/facture_cust_extrafields.php b/htdocs/compta/facture/admin/facture_cust_extrafields.php
index 4f5d2ba1bcf32dc43afdae3464bf440b7238b402..6d60180593ae708ce17dbd2837f98f9f2375f80f 100644
--- a/htdocs/compta/facture/admin/facture_cust_extrafields.php
+++ b/htdocs/compta/facture/admin/facture_cust_extrafields.php
@@ -70,7 +70,7 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
 print_fiche_titre($langs->trans("BillsSetup"),$linkback,'setup');
 print '<br>';
 
-$head = invoice_admin_prepare_head(null);
+$head = invoice_admin_prepare_head();
 
 dol_fiche_head($head, 'attributes', $langs->trans("Invoices"), 0, 'invoice');
 
diff --git a/htdocs/compta/facture/admin/facturedet_cust_extrafields.php b/htdocs/compta/facture/admin/facturedet_cust_extrafields.php
index 9c1240a28c92a721da2b8e9cd22d0aab2816ad18..fd4284a01dd8e8265efe94867353caa76bcb8aad 100644
--- a/htdocs/compta/facture/admin/facturedet_cust_extrafields.php
+++ b/htdocs/compta/facture/admin/facturedet_cust_extrafields.php
@@ -71,7 +71,7 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
 print_fiche_titre($langs->trans("BillsSetup"),$linkback,'setup');
 print '<br>';
 
-$head = invoice_admin_prepare_head(null);
+$head = invoice_admin_prepare_head();
 
 dol_fiche_head($head, 'attributeslines', $langs->trans("Invoices"), 0, 'invoice');
 
diff --git a/htdocs/core/actions_printipp.inc.php b/htdocs/core/actions_printipp.inc.php
new file mode 100644
index 0000000000000000000000000000000000000000..3c18faa813b19b6f6400c37e61221669c639de29
--- /dev/null
+++ b/htdocs/core/actions_printipp.inc.php
@@ -0,0 +1,45 @@
+<?php
+/* Copyright (C) 2014 Laurent Destailleur  <eldy@users.sourceforge.net>
+ *
+ * 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
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * or see http://www.gnu.org/
+ */
+
+/**
+ *	\file			htdocs/core/actions_printipp.inc.php
+ *  \brief			Code for actions print_file to print file using ipp
+ */
+
+
+// $action must be defined
+// $db, $user, $conf, $langs must be defined
+// Filename to print must be provided into 'file' parameter
+
+// Print file
+if ($action == 'print_file' and $user->rights->printipp->read) 
+{
+	$langs->load("printipp");
+	require_once DOL_DOCUMENT_ROOT . '/core/class/dolprintipp.class.php';
+	$printer = new dolPrintIPP($db, $conf->global->PRINTIPP_HOST, $conf->global->PRINTIPP_PORT, $user->login, $conf->global->PRINTIPP_USER, $conf->global->PRINTIPP_PASSWORD);
+	$result = $printer->print_file(GETPOST('file', 'alpha'), GETPOST('printer', 'alpha'));
+	if ($result)
+	{
+		setEventMessage($result,'warnings');
+	}
+	else
+	{
+		setEventMessage($langs->trans("FileWasSentToPrinter", basename(GETPOST('file'))));
+	}
+	$action = '';
+}
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index f4634c91e5c2f6ffb4497462a64a2339d7cd97f1..4cc8cd236720db583c57f58bb03f2a4ec8d272c8 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -633,7 +633,7 @@ abstract class CommonObject
 
     /**
      *	Load data for barcode into properties ->barcode_type*
-     *	Properties ->barcode_type that is id of barcode type is used to find other properties, but
+     *	Properties ->barcode_type that is id of barcode. Type is used to find other properties, but
      *  if it is not defined, ->element must be defined to know default barcode type.
      *
      *	@return		int			<0 if KO, 0 if can't guess type of barcode (ISBN, EAN13...), >0 if OK (all barcode properties loaded)
@@ -3029,7 +3029,7 @@ abstract class CommonObject
       	        });</script>';
     	    if (!empty($hidemargininfos)) print '<script>$(document).ready(function() {$(".margininfos").hide();});</script>';
 		}
-		
+
 		print '<table class="noborder margintable" width="100%">';
 		print '<tr class="liste_titre">';
 		print '<td class="liste_titre">'.$langs->trans('Margins').'</td>';
diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php
index 33888b057b7369f4d676e4ed2751e794b5b9f87a..c400dc151d3c523cce3e555791b437802935edd4 100644
--- a/htdocs/core/class/dolgraph.class.php
+++ b/htdocs/core/class/dolgraph.class.php
@@ -253,7 +253,7 @@ class DolGraph
 	/**
 	 * Set legend
 	 *
-	 * @param 	string	$legend		Legend
+	 * @param 	array	$legend		Legend. Example: array('seriename1','seriname2',...)
 	 * @return	void
 	 */
 	function SetLegend($legend)
diff --git a/htdocs/core/class/dolprintipp.class.php b/htdocs/core/class/dolprintipp.class.php
index 942ee3da3c3b9b8954594b591f9b3f529d397c9b..71ee2a1be37010c1e84d1a2aee247db865c8940c 100644
--- a/htdocs/core/class/dolprintipp.class.php
+++ b/htdocs/core/class/dolprintipp.class.php
@@ -83,19 +83,22 @@ class dolprintIPP
      * @param   string      $file       file
      * @param   string      $module     module
      *
-     *  @return void
+     * @return 	string					'' if OK, Error message if KO
      */
-    function print_file($file,$module)
+    function print_file($file, $module)
     {
         global $conf,$db;
+
         include_once DOL_DOCUMENT_ROOT.'/includes/printipp/CupsPrintIPP.php';
+        
         $ipp = new CupsPrintIPP();
-        $ipp->setLog(DOL_DATA_ROOT.'/printipp.log','file',3); // logging very verbose
+        $ipp->setLog(DOL_DATA_ROOT.'/dolibarr_printipp.log','file',3); // logging very verbose
         $ipp->setHost($this->host);
         $ipp->setPort($this->port);
         $ipp->setJobName($file,true);
         $ipp->setUserName($this->userid);
         if (! empty($this->user)) $ipp->setAuthentication($this->user,$this->password);
+
         // select printer uri for module order, propal,...
         $sql = 'SELECT rowid,printer_uri,copy FROM '.MAIN_DB_PREFIX.'printer_ipp WHERE module="'.$module.'"';
         $result = $this->db->query($sql);
@@ -108,13 +111,23 @@ class dolprintIPP
             }
             else
             {
-                $ipp->setPrinterURI($conf->global->PRINTIPP_URI_DEFAULT);
+            	if (! empty($conf->global->PRINTIPP_URI_DEFAULT))
+            	{
+                	$ipp->setPrinterURI($conf->global->PRINTIPP_URI_DEFAULT);
+            	}
+            	else
+            	{
+            		return 'NoDefaultPrinterDefined';
+            	}
             }
         }
+        
         // Set number of copy
         $ipp->setCopies($obj->copy);
         $ipp->setData(DOL_DATA_ROOT.'/'.$module.'/'.$file);
         $ipp->printJob();
+        
+        return '';
     }
 
     /**
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index 8f5a441967e0bf4dc61ae00f0b5df81026ed529f..9a419e53d89db98027ae9db514a3d0d844283274 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -270,7 +270,13 @@ class FormFile
         if (! empty($iconPDF)) {
         	return $this->getDocumentsLink($modulepart, $modulesubdir, $filedir);
         }
-        $printer = (!empty($user->rights->printipp->read) && !empty($conf->printipp->enabled))?true:false;
+        
+        $printer=0;
+        if (in_array($modulepart,array('facture','propal','proposal','order','commande')))	// This feature is implemented only for such elements
+        {
+        	$printer = (!empty($user->rights->printipp->read) && !empty($conf->printipp->enabled))?true:false;
+        }
+        
         $hookmanager->initHooks(array('formfile'));
         $forname='builddoc';
         $out='';
diff --git a/htdocs/core/lib/barcode.lib.php b/htdocs/core/lib/barcode.lib.php
index bc0422a5fb4ee57ef0509bbe52159eae9cc8fa7c..243b862ff8898be0be5016f552ae0c173a901714 100644
--- a/htdocs/core/lib/barcode.lib.php
+++ b/htdocs/core/lib/barcode.lib.php
@@ -52,7 +52,6 @@ if (empty($font_loc)) die('DOL_DEFAULT_TTF_BOLD must de defined with full path t
 
 if (defined('PHP-BARCODE_PATH_COMMAND')) $genbarcode_loc=constant('PHP-BARCODE_PATH_COMMAND');
 else $genbarcode_loc = $conf->global->GENBARCODE_LOCATION;
-//dol_syslog("genbarcode_loc=".$genbarcode_loc." - env_windows=".$_SERVER['WINDIR']);
 
 
 
diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php
index 964dcfbb0c6b1c78c20ede935e0692f50258b67a..4dd9a51d0b7b5dd6d7a447176e5ee0036d44f18d 100644
--- a/htdocs/core/lib/company.lib.php
+++ b/htdocs/core/lib/company.lib.php
@@ -217,10 +217,9 @@ function societe_prepare_head2($object)
 /**
  *  Return array head with list of tabs to view object informations.
  *
- *  @param	Object	$object		Thirdparty
  *  @return	array   	        head array with tabs
  */
-function societe_admin_prepare_head($object)
+function societe_admin_prepare_head()
 {
     global $langs, $conf, $user;
 
@@ -236,7 +235,7 @@ function societe_admin_prepare_head($object)
     // Entries must be declared in modules descriptor with line
     // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to add new tab
     // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to remove a tab
-    complete_head_from_modules($conf,$langs,$object,$head,$h,'company_admin');
+    complete_head_from_modules($conf,$langs,null,$head,$h,'company_admin');
 
     $head[$h][0] = DOL_URL_ROOT.'/societe/admin/societe_extrafields.php';
     $head[$h][1] = $langs->trans("ExtraFieldsThirdParties");
@@ -248,7 +247,7 @@ function societe_admin_prepare_head($object)
     $head[$h][2] = 'attributes_contacts';
     $h++;
 
-    complete_head_from_modules($conf,$langs,$object,$head,$h,'company_admin','remove');
+    complete_head_from_modules($conf,$langs,null,$head,$h,'company_admin','remove');
 
     return $head;
 }
diff --git a/htdocs/core/lib/fourn.lib.php b/htdocs/core/lib/fourn.lib.php
index c1e37f3c485cad5176f1badcaea0c2acde5e75f1..e4e7b04b0573d04e00ed94eae969e2aef2fc8512 100644
--- a/htdocs/core/lib/fourn.lib.php
+++ b/htdocs/core/lib/fourn.lib.php
@@ -160,10 +160,9 @@ function ordersupplier_prepare_head($object)
 /**
  *  Return array head with list of tabs to view object informations.
  *
- *  @param	Object	$object		order
  *  @return	array   	        head array with tabs
  */
-function supplierorder_admin_prepare_head($object)
+function supplierorder_admin_prepare_head()
 {
 	global $langs, $conf, $user;
 
@@ -180,7 +179,7 @@ function supplierorder_admin_prepare_head($object)
 	$head[$h][2] = 'invoice';
 	$h++;
 
-	complete_head_from_modules($conf,$langs,$object,$head,$h,'supplierorder_admin');
+	complete_head_from_modules($conf,$langs,null,$head,$h,'supplierorder_admin');
 
 	$head[$h][0] = DOL_URL_ROOT.'/admin/supplierorder_extrafields.php';
 	$head[$h][1] = $langs->trans("ExtraFieldsSupplierOrders");
@@ -192,7 +191,7 @@ function supplierorder_admin_prepare_head($object)
 	$head[$h][2] = 'supplierinvoice';
 	$h++;
 
-	complete_head_from_modules($conf,$langs,$object,$head,$h,'supplierorder_admin','remove');
+	complete_head_from_modules($conf,$langs,null,$head,$h,'supplierorder_admin','remove');
 
 	return $head;
 }
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 84bf351e7b958601c89c35e6b1ac5c1641a05225..3ad081b1158d6aafacb278f88cb20d268b9ce6de 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -4612,26 +4612,26 @@ function picto_from_langcode($codelang)
  *  Complete or removed entries into a head array (used to build tabs) with value added by external modules.
  *  Such values are declared into $conf->modules_parts['tab'].
  *
- *  @param	Conf		$conf           Object conf
- *  @param  Translate	$langs          Object langs
- *  @param  Object		$object         Object object
- *  @param  array		$head          Object head
- *  @param  int			$h             New position to fill
- *  @param  string		$type           Value for object where objectvalue can be
- *                              		'thirdparty'       to add a tab in third party view
- *		                              	'intervention'     to add a tab in intervention view
- *     		                         	'supplier_order'   to add a tab in supplier order view
- *          		                    'supplier_invoice' to add a tab in supplier invoice view
- *                  		            'invoice'          to add a tab in customer invoice view
- *                          		    'order'            to add a tab in customer order view
- *                      		        'product'          to add a tab in product view
- *                              		'propal'           to add a tab in propal view
- *                              		'user'             to add a tab in user view
- *                              		'group'            to add a tab in group view
- * 		        	                    'member'           to add a tab in fundation member view
- *      		                        'categories_x'	   to add a tab in category view ('x': type of category (0=product, 1=supplier, 2=customer, 3=member)
- *      								'ecm'			   to add a tab for another ecm view
- *  @param  string		$mode  	        'add' to complete head, 'remove' to remove entries
+ *  @param	Conf			$conf           Object conf
+ *  @param  Translate		$langs          Object langs
+ *  @param  Object|null		$object         Object object
+ *  @param  array			$head          	Object head
+ *  @param  int				$h				New position to fill
+ *  @param  string			$type           Value for object where objectvalue can be
+ *                              			'thirdparty'       to add a tab in third party view
+ *		                        	      	'intervention'     to add a tab in intervention view
+ *     		                    	     	'supplier_order'   to add a tab in supplier order view
+ *          		            	        'supplier_invoice' to add a tab in supplier invoice view
+ *                  		    	        'invoice'          to add a tab in customer invoice view
+ *                          			    'order'            to add a tab in customer order view
+ *                      			        'product'          to add a tab in product view
+ *                              			'propal'           to add a tab in propal view
+ *                              			'user'             to add a tab in user view
+ *                              			'group'            to add a tab in group view
+ * 		        	               	     	'member'           to add a tab in fundation member view
+ *      		                        	'categories_x'	   to add a tab in category view ('x': type of category (0=product, 1=supplier, 2=customer, 3=member)
+ *      									'ecm'			   to add a tab for another ecm view
+ *  @param  string		$mode  	        	'add' to complete head, 'remove' to remove entries
  *	@return	void
  */
 function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode='add')
diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php
index b26326ae5e75dbf75c0db129fb50e0ff11fef7ea..ac9da88bdc2cde7237630000258f12948244b77e 100644
--- a/htdocs/core/lib/invoice.lib.php
+++ b/htdocs/core/lib/invoice.lib.php
@@ -106,10 +106,9 @@ function facture_prepare_head($object)
 /**
  * Return array head with list of tabs to view object informations.
  *
- * @param Object $object Invoice
  * @return array head array with tabs
  */
-function invoice_admin_prepare_head($object)
+function invoice_admin_prepare_head()
 {
 	global $langs, $conf, $user;
 
@@ -125,7 +124,7 @@ function invoice_admin_prepare_head($object)
 	// Entries must be declared in modules descriptor with line
 	// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
 	// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
-	complete_head_from_modules($conf,$langs,$object,$head,$h,'invoice_admin');
+	complete_head_from_modules($conf,$langs,null,$head,$h,'invoice_admin');
 
 	$head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facture_cust_extrafields.php';
 	$head[$h][1] = $langs->trans("ExtraFieldsCustomerInvoices");
@@ -137,7 +136,7 @@ function invoice_admin_prepare_head($object)
 	$head[$h][2] = 'attributeslines';
 	$h++;
 
-	complete_head_from_modules($conf,$langs,$object,$head,$h,'invoice_admin','remove');
+	complete_head_from_modules($conf,$langs,null,$head,$h,'invoice_admin','remove');
 
 	return $head;
 }
diff --git a/htdocs/core/lib/ldap.lib.php b/htdocs/core/lib/ldap.lib.php
index caee12ed1359777136ed44cc1c474dfd94f503e3..d5a362663b71405ac7dca6216cda6d648dccfc2e 100644
--- a/htdocs/core/lib/ldap.lib.php
+++ b/htdocs/core/lib/ldap.lib.php
@@ -117,7 +117,7 @@ function show_ldap_test_button($butlabel,$testlabel,$key,$dn,$objectclass)
 /**
  * Show a LDAP array into an HTML output array.
  *
- * @param	string	$result	    Array to show. This array is already encoded into charset_output
+ * @param	array	$result	    Array to show. This array is already encoded into charset_output
  * @param   int		$level		Level
  * @param   int		$count		Count
  * @param   string	$var		Var
diff --git a/htdocs/core/lib/order.lib.php b/htdocs/core/lib/order.lib.php
index ba3e8344f4724feb4129a4f0e00e5930820ed201..abdf1b648a56e76bfac8f3bcf693cd54f11e3e2f 100644
--- a/htdocs/core/lib/order.lib.php
+++ b/htdocs/core/lib/order.lib.php
@@ -116,10 +116,9 @@ function commande_prepare_head($object)
 /**
  *  Return array head with list of tabs to view object informations.
  *
- *  @param	Object	$object		order
- *  @return	array   	        head array with tabs
+ *  @return	array   	    		    head array with tabs
  */
-function order_admin_prepare_head($object)
+function order_admin_prepare_head()
 {
 	global $langs, $conf, $user;
 
@@ -131,7 +130,7 @@ function order_admin_prepare_head($object)
 	$head[$h][2] = 'general';
 	$h++;
 
-	complete_head_from_modules($conf,$langs,$object,$head,$h,'order_admin');
+	complete_head_from_modules($conf,$langs,null,$head,$h,'order_admin');
 
 	$head[$h][0] = DOL_URL_ROOT.'/admin/order_extrafields.php';
 	$head[$h][1] = $langs->trans("ExtraFields");
@@ -143,7 +142,7 @@ function order_admin_prepare_head($object)
 	$head[$h][2] = 'attributeslines';
 	$h++;
 
-	complete_head_from_modules($conf,$langs,$object,$head,$h,'order_admin','remove');
+	complete_head_from_modules($conf,$langs,null,$head,$h,'order_admin','remove');
 
 	return $head;
 }
diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php
index 33ded69b802a98899df129f0ab1ae225655739c1..741dd98de6dfeece248913b7405d3dd0ce960f69 100644
--- a/htdocs/core/lib/product.lib.php
+++ b/htdocs/core/lib/product.lib.php
@@ -147,10 +147,9 @@ function product_prepare_head($object, $user)
 /**
 *  Return array head with list of tabs to view object informations.
 *
-*  @param	Object	$object		Product
 *  @return	array   	        head array with tabs
 */
-function product_admin_prepare_head($object=null)
+function product_admin_prepare_head()
 {
 	global $langs, $conf, $user;
 
@@ -166,14 +165,14 @@ function product_admin_prepare_head($object=null)
 	// Entries must be declared in modules descriptor with line
     // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to add new tab
     // $this->tabs = array('entity:-tabname);   												to remove a tab
-	complete_head_from_modules($conf,$langs,$object,$head,$h,'product_admin');
+	complete_head_from_modules($conf,$langs,null,$head,$h,'product_admin');
 
 	$head[$h][0] = DOL_URL_ROOT.'/product/admin/product_extrafields.php';
 	$head[$h][1] = $langs->trans("ExtraFields");
 	$head[$h][2] = 'attributes';
 	$h++;
 
-	complete_head_from_modules($conf,$langs,$object,$head,$h,'product_admin','remove');
+	complete_head_from_modules($conf,$langs,null,$head,$h,'product_admin','remove');
 
 	return $head;
 }
diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php
index b384ccceabed1f8830268341891a80ae146848c3..637d5e6cccae9c733b148e5602dba0c99bc63a00 100644
--- a/htdocs/core/lib/project.lib.php
+++ b/htdocs/core/lib/project.lib.php
@@ -357,7 +357,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
 				print '</td>';
 
 				// Planned Workload (in working hours)
-				print '<td align="center">';
+				print '<td align="right">';
 				$fullhour=convertSecondToTime($lines[$i]->planned_workload,'allhourmin');
 				$workingdelay=convertSecondToTime($lines[$i]->planned_workload,'all',86400,7);	// TODO Replace 86400 and 7 to take account working hours per day and working day per weeks
 				if ($lines[$i]->planned_workload)
@@ -422,7 +422,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
 		print '<td></td>';
 		print '<td></td>';
 		print '<td></td>';
-		print '<td align="center" class="nowrap liste_total">';
+		print '<td align="right" class="nowrap liste_total">';
 		print convertSecondToTime($total_projectlinesa_planned, 'allhourmin');
 		print '</td>';
 		print '<td></td>';
diff --git a/htdocs/core/lib/propal.lib.php b/htdocs/core/lib/propal.lib.php
index 8a96b86c96753d0438eeed441c51acb9fe0da7a1..fd227d512b725b80de0a857eb6083ccb47289ac0 100644
--- a/htdocs/core/lib/propal.lib.php
+++ b/htdocs/core/lib/propal.lib.php
@@ -110,10 +110,9 @@ function propal_prepare_head($object)
 /**
  *  Return array head with list of tabs to view object informations.
  *
- *  @param	Object	$object		Propal
  *  @return	array   	        head array with tabs
  */
-function propal_admin_prepare_head($object)
+function propal_admin_prepare_head()
 {
 	global $langs, $conf, $user;
 
@@ -129,7 +128,7 @@ function propal_admin_prepare_head($object)
 	// Entries must be declared in modules descriptor with line
 	// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to add new tab
 	// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to remove a tab
-	complete_head_from_modules($conf,$langs,$object,$head,$h,'propal_admin');
+	complete_head_from_modules($conf,$langs,null,$head,$h,'propal_admin');
 
 	$head[$h][0] = DOL_URL_ROOT.'/comm/admin/propal_extrafields.php';
 	$head[$h][1] = $langs->trans("ExtraFields");
@@ -141,7 +140,7 @@ function propal_admin_prepare_head($object)
     $head[$h][2] = 'attributeslines';
     $h++;
 
-	complete_head_from_modules($conf,$langs,$object,$head,$h,'propal_admin','remove');
+	complete_head_from_modules($conf,$langs,null,$head,$h,'propal_admin','remove');
 
 	return $head;
 }
diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php
index 5ae50b7629ab9e400e116aa9da7d945905ea2c5f..0abec31b6fd8e3d1ae0af440d7b7d1a40336511a 100644
--- a/htdocs/core/lib/usergroups.lib.php
+++ b/htdocs/core/lib/usergroups.lib.php
@@ -242,9 +242,9 @@ function entity_prepare_head($object, $aEntities)
 /**
  * 	Show list of themes. Show all thumbs of themes
  *
- * 	@param	User	$fuser				User concerned or null for global theme
- * 	@param	int		$edit				1 to add edit form
- * 	@param	boolean	$foruserprofile		Show for user profile view
+ * 	@param	User|null	$fuser				User concerned or null for global theme
+ * 	@param	int			$edit				1 to add edit form
+ * 	@param	boolean		$foruserprofile		Show for user profile view
  * 	@return	void
  */
 function show_theme($fuser,$edit=0,$foruserprofile=false)
diff --git a/htdocs/core/modules/modPrintIPP.class.php b/htdocs/core/modules/modPrintIPP.class.php
index d9e2166b4e6180aecbab283b4b0de55164510f16..3cdcd6cdfa65448208942199b75d1dd91cd73bbe 100644
--- a/htdocs/core/modules/modPrintIPP.class.php
+++ b/htdocs/core/modules/modPrintIPP.class.php
@@ -51,7 +51,7 @@ class modPrintIPP extends DolibarrModules
         // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
         $this->name = preg_replace('/^mod/i','',get_class($this));
         $this->description = "Print via Cups IPP Printer.";
-        $this->version = 'experimental';    // 'development' or 'experimental' or 'dolibarr' or version
+        $this->version = 'dolibarr';    // 'development' or 'experimental' or 'dolibarr' or version
         $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
         // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
         $this->special = 1;
@@ -67,10 +67,11 @@ class modPrintIPP extends DolibarrModules
         $this->config_page_url = array("printipp.php@printipp");
 
         // Dependances
+        $this->hidden =  (! empty($_SERVER["WINDIR"]));
         $this->depends = array();
         $this->requiredby = array();
-        $this->phpmin = array(5,1);                 // Minimum version of PHP required by module
-        $this->need_dolibarr_version = array(3,2);  // Minimum version of Dolibarr required by module
+        $this->phpmin = array(5,1);                 	// Minimum version of PHP required by module
+        $this->need_dolibarr_version = array(3,7,-2);  	// Minimum version of Dolibarr required by module
         $this->conflictwith = array();
         $this->langfiles = array("printipp");
 
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 3f8c5aa4f6cabe2b1e593fc4dd89faea8c75c919..2febc9288c36516c2049086a614c25b42c2a1ccc 100755
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -475,8 +475,8 @@ Module320Name=RSS Feed
 Module320Desc=Add RSS feed inside Dolibarr screen pages
 Module330Name=Bookmarks
 Module330Desc=Bookmark management
-Module400Name=Projects/Opportunity
-Module400Desc=Management of projects or opportunity. You can then assign all other elements (invoice, order, proposal, intervention, ...) to this projects
+Module400Name=Projects/Opportunities/Leads
+Module400Desc=Management of projects, opportunities or leads. You can then assign any element (invoice, order, proposal, intervention, ...) to a project and get a transversal view from the project view.
 Module410Name=Webcalendar
 Module410Desc=Webcalendar integration
 Module500Name=Special expenses (tax, social contributions, dividends)
@@ -531,7 +531,7 @@ Module50200Desc=Module to offer an online payment page by credit card with Paypa
 Module50400Name=Accounting (advanced)
 Module50400Desc=Accounting management (double parties)
 Module54000Name=PrintIPP
-Module54000Desc=Print via Cups IPP Printer.
+Module54000Desc=Direct print (without opening the documents) using Cups IPP interface (Printer must be visible from server, and CUPS must be installe on server).
 Module55000Name=Open Poll
 Module55000Desc=Module to make online polls (like Doodle, Studs, Rdvz, ...)
 Module59000Name=Margins
diff --git a/htdocs/langs/en_US/printipp.lang b/htdocs/langs/en_US/printipp.lang
index cc719fddded0cbbd47a55d83f5808b5cf5991f12..835e6827f12ee4e466c21f2ee540526389fa7e03 100644
--- a/htdocs/langs/en_US/printipp.lang
+++ b/htdocs/langs/en_US/printipp.lang
@@ -7,3 +7,8 @@ PRINTIPP_PORT=Port
 PRINTIPP_USER=Login
 PRINTIPP_PASSWORD=Password
 NoPrinterFound=No printers found (check your CUPS setup)
+FileWasSentToPrinter=File %s was sent to printer
+NoDefaultPrinterDefined=No default printer defined
+DefaultPrinter=Default printer
+Printer=Printer
+CupsServer=CUPS Server
diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang
index 32b7d57e9b01d73567f8b0a4e74b41f01f32d453..8d5d7c26a5396492d97bd308a7d37c624726d0c2 100644
--- a/htdocs/langs/en_US/projects.lang
+++ b/htdocs/langs/en_US/projects.lang
@@ -36,6 +36,8 @@ TaskTimeSpent=Time spent on tasks
 TaskTimeUser=User
 TaskTimeNote=Note
 TaskTimeDate=Date
+TasksOnOpenedProject=Tasks on opened projects
+WorkloadNotDefined=Workload not defined
 NewTimeSpent=New time spent
 MyTimeSpent=My time spent
 MyTasks=My tasks
diff --git a/htdocs/printipp/admin/printipp.php b/htdocs/printipp/admin/printipp.php
index 6aaf44f8bdd982d6429b6883d3c90bc659a0139a..28ad55453eb42b3874f557878eb79eb4627e7cc5 100644
--- a/htdocs/printipp/admin/printipp.php
+++ b/htdocs/printipp/admin/printipp.php
@@ -35,6 +35,7 @@ if (! $user->admin) accessforbidden();
 
 $action = GETPOST('action','alpha');
 $mode = GETPOST('mode','alpha');
+$value = GETPOST('value','alpha');
 
 if (!$mode) $mode='config';
 
@@ -68,6 +69,17 @@ if ($action == 'setvalue' && $user->admin)
     }
 }
 
+// Set default model
+else if ($action == 'setprinteruri')
+{
+	if (dolibarr_set_const($db, "PRINTIPP_URI_DEFAULT",$value,'chaine',0,'',$conf->entity))
+	{
+		// La constante qui a ete lue en avant du nouveau set
+		// on passe donc par une variable pour avoir un affichage coherent
+		$conf->global->PRINTIPP_URI_DEFAULT = $value;
+	}
+}
+
 
 /*
  * View
@@ -82,11 +94,6 @@ print_fiche_titre($langs->trans("PrintIPPSetup"),$linkback,'setup');
 
 $head=printippadmin_prepare_head();
 
-dol_fiche_head($head, $mode, $langs->trans("ModuleSetup"));
-
-print $langs->trans("PrintIPPDesc")."<br>\n";
-
-print '<br>';
 
 if ($mode == 'config' && $user->admin)
 {
@@ -94,8 +101,11 @@ if ($mode == 'config' && $user->admin)
     print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
     print '<input type="hidden" name="action" value="setvalue">';
 
+	dol_fiche_head($head, $mode, $langs->trans("ModuleSetup"), 0, 'technic');
 
-    print '<table class="nobordernopadding" width="100%">';
+	print $langs->trans("PrintIPPDesc")."<br><br>\n";
+    
+    print '<table class="noborder" width="100%">';
 
     $var=true;
     print '<tr class="liste_titre">';
@@ -103,8 +113,9 @@ if ($mode == 'config' && $user->admin)
     print '<td>'.$langs->trans("Value").'</td>';
     print "</tr>\n";
 
+    /*
     $var=!$var;
-    print '<tr '.$bc[$var].'><td class="fieldrequired">';
+    print '<tr '.$bc[$var].'><td>';
     print $langs->trans("PRINTIPP_ENABLED").'</td><td colspan="2" align="left">';
 
     if (! empty($conf->use_javascript_ajax))
@@ -123,7 +134,8 @@ if ($mode == 'config' && $user->admin)
          }
     }
     print '</td></tr>';
-
+	*/
+    
     $var=!$var;
     print '<tr '.$bc[$var].'><td class="fieldrequired">';
     print $langs->trans("PRINTIPP_HOST").'</td><td>';
@@ -139,13 +151,13 @@ if ($mode == 'config' && $user->admin)
     print '</td></tr>';
 
     $var=!$var;
-    print '<tr '.$bc[$var].'><td class="fieldrequired">';
+    print '<tr '.$bc[$var].'><td>';
     print $langs->trans("PRINTIPP_USER").'</td><td>';
     print '<input size="32" type="text" name="PRINTIPP_USER" value="'.$conf->global->PRINTIPP_USER.'">';
     print '</td></tr>';
 
     $var=!$var;
-    print '<tr '.$bc[$var].'><td class="fieldrequired">';
+    print '<tr '.$bc[$var].'><td>';
     print $langs->trans("PRINTIPP_PASSWORD").'</td><td>';
     print '<input size="32" type="text" name="PRINTIPP_PASSWORD" value="'.$conf->global->PRINTIPP_PASSWORD.'">';
     print '</td></tr>';
@@ -156,16 +168,22 @@ if ($mode == 'config' && $user->admin)
     //print '<td>'.$langs->trans("Value").'</td>';
     //print "</tr>\n";
 
-    print '<tr><td colspan="2" align="center"><br><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td></tr>';
-
     print '</table>';
 
+    dol_fiche_end();
+    
+    print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Modify")).'"></center>';
+    
     print '</form>';
 }
 
 if ($mode == 'test' && $user->admin)
 {
-    print '<table class="nobordernopadding" width="100%">';
+	dol_fiche_head($head, $mode, $langs->trans("ModuleSetup"), 0, 'technic');
+
+	print $langs->trans("PrintIPPDesc")."<br><br>\n";
+	
+	print '<table class="nobordernopadding" width="100%">';
     $printer = new dolPrintIPP($db,$conf->global->PRINTIPP_HOST,$conf->global->PRINTIPP_PORT,$user->login,$conf->global->PRINTIPP_USER,$conf->global->PRINTIPP_PASSWORD);
     $var=true;
     print '<table width="100%" class="noborder">';
@@ -180,6 +198,7 @@ if ($mode == 'test' && $user->admin)
     //print '<td>Device</td>';
     print '<td>Media</td>';
     print '<td>Supported</td>';
+    print '<td>'.$langs->trans("Select").'</td>';
     print "</tr>\n";
 
     $list = $printer->getlist_available_printers();
@@ -200,14 +219,26 @@ if ($mode == 'test' && $user->admin)
         //print '<td>'.$printer_det->device_uri->_value0.'</td>';
         print '<td>'.$printer_det->media_default->_value0.'</td>';
         print '<td>'.$printer_det->media_type_supported->_value1.'</td>';
+        // Defaut
+        print "<td align=\"center\">";
+        if ($conf->global->PRINTIPP_URI_DEFAULT == "$value")
+        {
+        	print img_picto($langs->trans("Default"),'on');
+        }
+        else
+        {
+        	print '<a href="'.$_SERVER["PHP_SELF"].'?action=setprinteruri&mode=test&value='.urlencode($value).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
+        }
+        print '</td>';
         print "</tr>\n";
     }
     print '</table>';
 
     if (count($list) == 0) print $langs->trans("NoPrinterFound");
+
+	dol_fiche_end();
 }
 
-dol_fiche_end();
 
 
 llxFooter();
diff --git a/htdocs/printipp/lib/printipp.lib.php b/htdocs/printipp/lib/printipp.lib.php
index c87080032f5dfe319652b91e73694a97822cae59..64c14609df5ffd19f837820ca80c98777b2930c0 100644
--- a/htdocs/printipp/lib/printipp.lib.php
+++ b/htdocs/printipp/lib/printipp.lib.php
@@ -36,12 +36,12 @@ function printippadmin_prepare_head()
     $head = array();
 
     $head[$h][0] = DOL_URL_ROOT."/printipp/admin/printipp.php?mode=config";
-    $head[$h][1] = $langs->trans("Config");
+    $head[$h][1] = $langs->trans("CupsServer");
     $head[$h][2] = 'config';
     $h++;
 
     $head[$h][0] = DOL_URL_ROOT."/printipp/admin/printipp.php?mode=test";
-    $head[$h][1] = $langs->trans("Test");
+    $head[$h][1] = $langs->trans("Printer");
     $head[$h][2] = 'test';
     $h++;
 
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index 4839549a9dcead38ee4d9a99728763974fdb9843..cc52bf38d87f4514fb2fed43e624f241d8eb6412 100755
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -124,9 +124,9 @@ class Product extends CommonObject
 	//! barcode
 	var $barcode;               // value
 	var $barcode_type;          // id
-	var $barcode_type_code;     // code (loaded by fetch_barcode). Example ean, isbn...
+	var $barcode_type_code;     // code  (loaded by fetch_barcode). Example 'ean', 'isbn', ...
 	var $barcode_type_label;    // label (loaded by fetch_barcode)
-	var $barcode_type_coder;    // coder (loaded by fetch_barcode)
+	var $barcode_type_coder;    // coder (loaded by fetch_barcode). Engine.
 
 	var $stats_propale=array();
 	var $stats_commande=array();
diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php
index 1d4218d1cb91872a8cf5da55da34245f70e68c8c..b1c59e430f2e9ed88f4e5c5ee9a86e50b69542ce 100644
--- a/htdocs/projet/element.php
+++ b/htdocs/projet/element.php
@@ -164,18 +164,21 @@ dol_fiche_end();
 
 $listofreferent=array(
 'propal'=>array(
+	'name'=>"Proposalq",
 	'title'=>"ListProposalsAssociatedProject",
 	'class'=>'Propal',
 	'table'=>'propal',
     'datefieldname'=>'datep',
 	'test'=>$conf->propal->enabled && $user->rights->propale->lire),
 'order'=>array(
+	'name'=>"CustomerOrderq",
 	'title'=>"ListOrdersAssociatedProject",
 	'class'=>'Commande',
 	'table'=>'commande',
 	'datefieldname'=>'date_commande',
 	'test'=>$conf->commande->enabled && $user->rights->commande->lire),
 'invoice'=>array(
+	'name'=>"CustomerInvoiceq",
 	'title'=>"ListInvoicesAssociatedProject",
 	'class'=>'Facture',
 	'margin'=>'add',
@@ -183,18 +186,21 @@ $listofreferent=array(
 	'datefieldname'=>'datef',
 	'test'=>$conf->facture->enabled && $user->rights->facture->lire),
 'invoice_predefined'=>array(
+	'name'=>"PredefinedInvoices",
 	'title'=>"ListPredefinedInvoicesAssociatedProject",
 	'class'=>'FactureRec',
 	'table'=>'facture_rec',
 	'datefieldname'=>'datec',
 	'test'=>$conf->facture->enabled && $user->rights->facture->lire),
 'order_supplier'=>array(
+	'name'=>"SuplierOrders",
 	'title'=>"ListSupplierOrdersAssociatedProject",
 	'class'=>'CommandeFournisseur',
 	'table'=>'commande_fournisseur',
 	'datefieldname'=>'date_commande',
 	'test'=>$conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire),
 'invoice_supplier'=>array(
+	'name'=>"BillsSuppliers",
 	'title'=>"ListSupplierInvoicesAssociatedProject",
 	'class'=>'FactureFournisseur',
 	'margin'=>'minus',
@@ -202,12 +208,14 @@ $listofreferent=array(
 	'datefieldname'=>'datef',
 	'test'=>$conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire),
 'contract'=>array(
+	'name'=>"Contracts",
 	'title'=>"ListContractAssociatedProject",
 	'class'=>'Contrat',
 	'table'=>'contrat',
 	'datefieldname'=>'date_contrat',
 	'test'=>$conf->contrat->enabled && $user->rights->contrat->lire),
 'intervention'=>array(
+	'name'=>"Interventions",
 	'title'=>"ListFichinterAssociatedProject",
 	'class'=>'Fichinter',
 	'table'=>'fichinter',
@@ -215,6 +223,7 @@ $listofreferent=array(
 	'disableamount'=>1,
 	'test'=>$conf->ficheinter->enabled && $user->rights->ficheinter->lire),
 'trip'=>array(
+	'name'=>"TripAndExpenses",
 	'title'=>"ListTripAssociatedProject",
 	'class'=>'Deplacement',
 	'table'=>'deplacement',
@@ -223,6 +232,7 @@ $listofreferent=array(
 	'disableamount'=>1,
 	'test'=>$conf->deplacement->enabled && $user->rights->deplacement->lire),
 'agenda'=>array(
+	'name'=>"Agenda",
 	'title'=>"ListActionsAssociatedProject",
 	'class'=>'ActionComm',
 	'table'=>'actioncomm',
@@ -445,8 +455,13 @@ foreach ($listofreferent as $key => $value)
 	}
 }
 
-// Margin display of the project
-print_titre("Margin");
+// Profit for all project
+$langs->load("suppliers");
+$langs->load("bills");
+$langs->load("orders");
+$langs->load("proposals");
+$langs->load("margin");
+print_titre($langs->trans("Profit"));
 print '<table class="noborder">';
 print '<tr class="liste_titre">';
 print '<td align="left" width="200">'.$langs->trans("Element").'</td>';
@@ -455,9 +470,9 @@ print '<td align="right" width="100">'.$langs->trans("AmountHT").'</td>';
 print '<td align="right" width="100">'.$langs->trans("AmountTTC").'</td>';
 print '</tr>';
 
-
 foreach ($listofreferent as $key => $value)
 {
+	$name=$langs->trans($value['name']);
 	$title=$value['title'];
 	$classname=$value['class'];
 	$tablename=$value['table'];
@@ -486,7 +501,7 @@ foreach ($listofreferent as $key => $value)
 			}
 
 			print '<tr >';
-			print '<td align="left" >'.$classname.'</td>';
+			print '<td align="left" >'.$name.'</td>';
 			print '<td align="right">'.$i.'</td>';
 			print '<td align="right">'.price($total_ht).'</td>';
 			print '<td align="right">'.price($total_ttc).'</td>';
diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php
index bba783bf51e3f4ac0b7f2982986cb4ea2525bf6c..36f53b02680a2c5b7828a043c9907ba6f5d9d77b 100644
--- a/htdocs/projet/index.php
+++ b/htdocs/projet/index.php
@@ -1,6 +1,6 @@
 <?php
 /* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
- * Copyright (C) 2004-2010 Laurent Destailleur  <eldy@users.sourceforge.net>
+ * Copyright (C) 2004-2014 Laurent Destailleur  <eldy@users.sourceforge.net>
  * Copyright (C) 2005-2010 Regis Houssin        <regis.houssin@capnetworks.com>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -49,6 +49,7 @@ $sortorder = GETPOST("sortorder",'alpha');
 
 $socstatic=new Societe($db);
 $projectstatic=new Project($db);
+$userstatic=new User($db);
 
 $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,($mine?$mine:(empty($user->rights->projet->all->lire)?0:2)),1);
 //var_dump($projectsListId);
@@ -156,20 +157,23 @@ print '</div></div></div>';
 // Tasks for all resources of all opened projects and time spent for each task/resource
 print '<div class="fichecenter">';
 
-$sql = "SELECT p.ref, p.title, p.rowid as projectid, t.label, t.rowid as taskid, u.rowid as userid, t.planned_workload, t.dateo, t.datee, SUM(tasktime.task_duration) as timespent";
+$max = (empty($conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA)?1000:$conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA);
+
+$sql = "SELECT p.ref, p.title, p.rowid as projectid, t.label, t.rowid as taskid, t.planned_workload, t.duration_effective, t.progress, t.dateo, t.datee, SUM(tasktime.task_duration) as timespent";
 $sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
 $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid";
-$sql.= " INNER JOIN ".MAIN_DB_PREFIX."projet_task as t on t.fk_projet = p.rowid";
-$sql.= " INNER JOIN ".MAIN_DB_PREFIX."projet_task_time as tasktime on tasktime.fk_task = t.rowid";
-$sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u on tasktime.fk_user = u.rowid";
+$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task as t on t.fk_projet = p.rowid";
+$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task_time as tasktime on tasktime.fk_task = t.rowid";
+$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on tasktime.fk_user = u.rowid";
 $sql.= " WHERE p.entity = ".$conf->entity;
-if ($mine || ! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")";
+if ($mine || empty($user->rights->projet->all->lire)) $sql.= " AND p.rowid IN (".$projectsListId.")";
 if ($socid)	$sql.= "  AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")";
 $sql.= " AND p.fk_statut=1";
-$sql.= " GROUP BY p.ref, p.title, p.rowid, t.label, t.rowid, u.rowid, t.planned_workload, t.dateo, t.datee";
-$sql.= " ORDER BY u.rowid, t.dateo, t.datee";
+$sql.= " GROUP BY p.ref, p.title, p.rowid, t.label, t.rowid, t.planned_workload, t.duration_effective, t.progress, t.dateo, t.datee";
+$sql.= " ORDER BY t.rowid, t.dateo, t.datee";
+$sql.= $db->plimit($max+1);	// We want more to know if we have more than limit
 
-$userstatic=new User($db);
+$var=true;
 
 dol_syslog('projet:index.php: affectationpercent', LOG_DEBUG);
 $resql = $db->query($sql);
@@ -178,75 +182,87 @@ if ( $resql )
 	$num = $db->num_rows($resql);
 	$i = 0;
 
-	if ($num > (empty($conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA)?1000:$conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA))
-	{
-/*		$langs->load("errors");
-  		print '<tr '.$bc[0].'>';
-		print '<td colspan="9">';
-		print $langs->trans("WarningTooManyDataPleaseUseMoreFilters");
-		print '</td></tr>';*/
-	}
-	else
-	{
-		print '<br>';
+	print '<br>';
+
+	print_fiche_titre($langs->trans("TasksOnOpenedProject"),'','').'<br>';
+
+	print '<table class="noborder" width="100%">';
+	print '<tr class="liste_titre">';
+	//print '<th>'.$langs->trans('TaskRessourceLinks').'</th>';
+	print '<th>'.$langs->trans('Projects').'</th>';
+	print '<th>'.$langs->trans('Task').'</th>';
+	print '<th>'.$langs->trans('DateStart').'</th>';
+	print '<th>'.$langs->trans('DateEnd').'</th>';
+	print '<th align="right">'.$langs->trans('PlannedWorkload').'</th>';
+	print '<th align="right">'.$langs->trans("ProgressDeclared").'</td>';
+	print '<th align="right">'.$langs->trans('TimeSpent').'</th>';
+	print '<th align="right">'.$langs->trans("ProgressCalculated").'</td>';
+	print '</tr>';
 
-		print_fiche_titre($langs->trans("TimeSpent"),'','').'<br>';
+	while ($i < $num && $i < $max)
+	{
+		$obj = $db->fetch_object($resql);
+		$var=!$var;
 
-		print '<table class="noborder" width="100%">';
-		print '<tr class="liste_titre">';
-		print '<th>'.$langs->trans('TaskRessourceLinks').'</th>';
-		print '<th>'.$langs->trans('Projects').'</th>';
-		print '<th>'.$langs->trans('Task').'</th>';
-		print '<th>'.$langs->trans('DateStart').'</th>';
-		print '<th>'.$langs->trans('DateEnd').'</th>';
-		print '<th>'.$langs->trans('TimeSpent').'</th>';
-		print '</tr>';
+		$username='';
+		if ($obj->userid && $userstatic->id != $obj->userid)	// We have a user and it is not last loaded user
+		{
+			$result=$userstatic->fetch($obj->userid);
+			if (! $result) $userstatic->id=0;
+		}
+		if ($userstatic->id) $username = $userstatic->getNomUrl(0,0);
 
-		while ($i < $num)
+		print "<tr ".$bc[$var].">";
+		//print '<td>'.$username.'</td>';
+		print '<td>';
+		$projectstatic->id=$obj->projectid;
+		$projectstatic->ref=$obj->ref;
+		$projectstatic->title=$obj->title;
+		print $projectstatic->getNomUrl(1,'',16);
+		//print '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$obj->projectid.'">'.$obj->title.'</a>';
+		print '</td>';
+		print '<td>';
+		if (! empty($obj->taskid))
 		{
-			$obj = $db->fetch_object($resql);
-			$var=!$var;
-
-			$username='';
-			if ($obj->userid && $userstatic->id != $obj->userid)	// We have a user and it is not last loaded user
-			{
-				$result=$userstatic->fetch($obj->userid);
-				if (! $result) $userstatic->id=0;
-			}
-			if ($userstatic->id) $username = $userstatic->getNomUrl(0,0);
-
-			print "<tr ".$bc[$var].">";
-			print '<td>'.$username.'</td>';
-			print '<td>';
-			$projectstatic->id=$obj->projectid;
-			$projectstatic->ref=$obj->ref;
-			$projectstatic->title=$obj->title;
-			print $projectstatic->getNomUrl(1,'',16);
-			//print '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$obj->projectid.'">'.$obj->title.'</a>';
-			print '</td>';
-			print '<td><a href="'.DOL_URL_ROOT.'/projet/tasks/task.php?id='.$obj->taskid.'&withproject=1">'.$obj->label.'</a></td>';
-			print '<td>'.dol_print_date($db->jdate($obj->dateo)).'</td>';
-			print '<td>'.dol_print_date($db->jdate($obj->datee)).'</td>';
-			/* I disable this because information is wrong. This percent has no meaning for a particular resource. What do we want ?
-			 * Percent of completion ?
-			 * If we want to show completion, we must remove "user" into list,
-			if (empty($obj->planned_workload)) {
-				$percentcompletion = $langs->trans("Unknown");
+			print '<a href="'.DOL_URL_ROOT.'/projet/tasks/task.php?id='.$obj->taskid.'&withproject=1">'.$obj->label.'</a>';
+		}
+		else print $langs->trans("NoTasks");
+		print '</td>';
+		print '<td>'.dol_print_date($db->jdate($obj->dateo),'day').'</td>';
+		print '<td>'.dol_print_date($db->jdate($obj->datee),'day').'</td>';
+		print '<td align="right"><a href="'.DOL_URL_ROOT.'/projet/tasks/time.php?id='.$obj->taskid.'&withproject=1">';
+		print convertSecondToTime($obj->planned_workload, 'all');
+		print '</a></td>';
+		print '<td align="right">';
+		print ($obj->taskid>0)?$obj->progress.'%':'';
+		print '</td>';
+		print '<td align="right"><a href="'.DOL_URL_ROOT.'/projet/tasks/time.php?id='.$obj->taskid.'&withproject=1">';
+		print convertSecondToTime($obj->timespent, 'all');
+		print '</a></td>';
+		print '<td align="right">';
+		if (! empty($obj->taskid))
+		{
+			if (empty($obj->planned_workload) > 0) {
+				$percentcompletion = $langs->trans("WorkloadNotDefined");
 			} else {
-				$percentcompletion = intval($obj->task_duration*100/$obj->planned_workload);
-			}*/
-			print '<td><a href="'.DOL_URL_ROOT.'/projet/tasks/time.php?id='.$obj->taskid.'&withproject=1">';
-			//print $percentcompletion.' %';
-			print convertSecondToTime($obj->timespent, 'all');
-			print '</a></td>';
-			print "</tr>\n";
-
-			$i++;
+				$percentcompletion = intval($obj->duration_effective*100/$obj->planned_workload).'%';
+			}
 		}
+		print $percentcompletion;
+		print '</td>';
+		print "</tr>\n";
+
+		$i++;
+	}
 
-		print "</table>";
+	if ($num > $max)
+	{	
+		print '<tr><td colspan="6">'.$langs->trans("WarningTooManyDataPleaseUseMoreFilters").'</td></tr>';		
 	}
+	
+	print "</table>";
 
+	
 	$db->free($resql);
 }
 else
diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php
index f89a7e3398ffc8fe5dbce55461240dae6368d9c2..850b76bd3b321a4350579f8cee997104533b64b0 100644
--- a/htdocs/projet/tasks.php
+++ b/htdocs/projet/tasks.php
@@ -417,7 +417,7 @@ else
 	print '<td>'.$langs->trans("LabelTask").'</td>';
 	print '<td align="center">'.$langs->trans("DateStart").'</td>';
 	print '<td align="center">'.$langs->trans("DateEnd").'</td>';
-	print '<td align="center">'.$langs->trans("PlannedWorkload").'</td>';
+	print '<td align="right">'.$langs->trans("PlannedWorkload").'</td>';
 	print '<td align="right">'.$langs->trans("ProgressDeclared").'</td>';
 	print '<td align="right">'.$langs->trans("TimeSpent").'</td>';
 	print '<td align="right">'.$langs->trans("ProgressCalculated").'</td>';
diff --git a/htdocs/projet/tasks/index.php b/htdocs/projet/tasks/index.php
index 4354fc23b2c24485abcb9c1bd3d55bfeabebaf96..c6ded20ecb427211230181f6df8cf3493cf53567 100644
--- a/htdocs/projet/tasks/index.php
+++ b/htdocs/projet/tasks/index.php
@@ -92,7 +92,7 @@ else
 $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,$mine,1,$socid);
 
 // Get list of tasks in tasksarray and taskarrayfiltered
-// We need all tasks (even not limited to a user because a task to user can have a parent that is not affected to him).
+// We need all tasks (even not limited to a user because a task assigned to a user can have a parent that is not assigned to him and we need such parents).
 $tasksarray=$taskstatic->getTasksArray(0, 0, $projectstatic->id, $socid, 0, $search_project, $search_status);
 // We load also tasks limited to a particular user
 $tasksrole=($mine ? $taskstatic->getUserRolesForProjectsOrTasks(0,$user,$projectstatic->id,0) : '');
@@ -133,7 +133,9 @@ print '<input type="image" class="liste_titre" name="button_search" src="'.img_p
 print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("RemoveFilter"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
 print '</td>';
 
-if (count($tasksarray) > (empty($conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA)?1000:$conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA))
+$max=1000;
+
+if (count($tasksarray) > (empty($conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA)?$max:$conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA))
 {
 	$langs->load("errors");
 	print '<tr '.$bc[0].'>';
diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php
index 5d5c4f08e40e0f2d16b36f01f751092369199e1b..3860122c6c23e519a1ddd20a7b52a379264111a0 100644
--- a/htdocs/projet/tasks/task.php
+++ b/htdocs/projet/tasks/task.php
@@ -295,9 +295,6 @@ if ($id > 0 || ! empty($ref))
 		//$arrayofuseridoftask=$object->getListContactId('internal');
 
 		$head=task_prepare_head($object);
-		dol_fiche_head($head, 'task_task', $langs->trans("Task"),0,'projecttask');
-
-
 
 		if ($action == 'edit' && $user->rights->projet->creer)
 		{
@@ -307,6 +304,8 @@ if ($id > 0 || ! empty($ref))
 			print '<input type="hidden" name="withproject" value="'.$withproject.'">';
 			print '<input type="hidden" name="id" value="'.$object->id.'">';
 
+			dol_fiche_head($head, 'task_task', $langs->trans("Task"),0,'projecttask');
+
 			print '<table class="border" width="100%">';
 
 			// Ref
@@ -372,9 +371,10 @@ if ($id > 0 || ! empty($ref))
 
 			print '</table>';
 
-			print '<br><div class="center">';
-			print '<input type="submit" class="button" name="update" value="'.$langs->trans("Modify").'">';
-			print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
+			dol_fiche_end();
+
+			print '<div align="center">';
+			print '<input type="submit" class="button" name="update" value="'.$langs->trans("Modify").'"> &nbsp; ';
 			print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
 			print '</div>';
 
@@ -388,6 +388,8 @@ if ($id > 0 || ! empty($ref))
 			$param=($withproject?'&withproject=1':'');
 			$linkback=$withproject?'<a href="'.DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.'">'.$langs->trans("BackToList").'</a>':'';
 
+			dol_fiche_head($head, 'task_task', $langs->trans("Task"),0,'projecttask');
+
 			if ($action == 'delete')
 			{
 				print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$_GET["id"].'&withproject='.$withproject,$langs->trans("DeleteATask"),$langs->trans("ConfirmDeleteATask"),"confirm_delete");
@@ -472,12 +474,11 @@ if ($id > 0 || ! empty($ref))
 
 			print '</table>';
 
+			dol_fiche_end();
 		}
 
-		dol_fiche_end();
-
 
-		if ($_GET["action"] != 'edit')
+		if ($action != 'edit')
 		{
 			/*
 			 * Actions
diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php
index 6e7ab74b94165789edc3bdf60ef52b2858403243..09ffb36ce530d76878086ec859569b166a5d183e 100644
--- a/htdocs/projet/tasks/time.php
+++ b/htdocs/projet/tasks/time.php
@@ -337,30 +337,6 @@ if ($id > 0 || ! empty($ref))
 			print '</td></tr>';
 		}
 
-		// Date start
-		print '<tr><td>'.$langs->trans("DateStart").'</td><td colspan="3">';
-		print dol_print_date($object->date_start,'dayhour');
-		print '</td></tr>';
-
-		// Date end
-		print '<tr><td>'.$langs->trans("DateEnd").'</td><td colspan="3">';
-		print dol_print_date($object->date_end,'dayhour');
-		print '</td></tr>';
-
-		// Planned workload
-		print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td colspan="3">'.convertSecondToTime($object->planned_workload,'allhourmin').'</td></tr>';
-
-		// Declared progress
-		print '<tr><td>'.$langs->trans("ProgressDeclared").'</td><td colspan="3">';
-		print $object->progress.' %';
-		print '</td></tr>';
-
-		// Calculated progress
-		print '<tr><td>'.$langs->trans("ProgressCalculated").'</td><td colspan="3">';
-		if ($object->planned_workload) print round(100 * $object->duration_effective / $object->planned_workload,2).' %';
-		else print '';
-		print '</td></tr>';
-
 		print '</table>';
 
 		dol_fiche_end();
@@ -412,7 +388,7 @@ if ($id > 0 || ! empty($ref))
 
 			// Note
 			print '<td class="nowrap">';
-			print '<textarea name="timespent_note" cols="80" rows="'.ROWS_3.'">'.($_POST['timespent_note']?$_POST['timespent_note']:'').'</textarea>';
+			print '<textarea name="timespent_note" cols="80" rows="'.ROWS_2.'">'.($_POST['timespent_note']?$_POST['timespent_note']:'').'</textarea>';
 			print '</td>';
 
 			// Progress declared
@@ -469,7 +445,8 @@ if ($id > 0 || ! empty($ref))
 		print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
 		print '<input type="hidden" name="action" value="updateline">';
 		print '<input type="hidden" name="id" value="'.$object->id.'">';
-
+		print '<input type="hidden" name="withproject" value="'.$withproject.'">';
+		
 		print '<table class="noborder" width="100%">';
 		print '<tr class="liste_titre">';
 		print '<td width="100">'.$langs->trans("Date").'</td>';
@@ -524,7 +501,7 @@ if ($id > 0 || ! empty($ref))
 			print '<td align="left">';
 			if ($_GET['action'] == 'editline' && $_GET['lineid'] == $task_time->rowid)
 			{
-				print '<textarea name="timespent_note_line" cols="80" rows="'.ROWS_3.'">'.$task_time->note.'</textarea>';
+				print '<textarea name="timespent_note_line" cols="80" rows="'.ROWS_2.'">'.$task_time->note.'</textarea>';
 			}
 			else
 			{
diff --git a/htdocs/societe/admin/contact_extrafields.php b/htdocs/societe/admin/contact_extrafields.php
index 9bb756ac7ee5ce8b7f5d63d32e0ae739ef3d3774..a0b72c80aead9890b5d482dba2908378b9454d58 100644
--- a/htdocs/societe/admin/contact_extrafields.php
+++ b/htdocs/societe/admin/contact_extrafields.php
@@ -68,7 +68,7 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
 print_fiche_titre($langs->trans("CompanySetup"),$linkback,'setup');
 
 
-$head = societe_admin_prepare_head(null);
+$head = societe_admin_prepare_head();
 
 dol_fiche_head($head, 'attributes_contacts', $langs->trans("ThirdParties"), 0, 'company');