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

This commit is contained in:
Laurent Destailleur 2012-10-19 00:48:52 +02:00
commit a75143842b
27 changed files with 201 additions and 118 deletions

View File

@ -1591,9 +1591,6 @@ print '</table><br>';
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{ {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
$formcompany= new FormCompany($db);
$blocname = 'contacts'; $blocname = 'contacts';
$title = $langs->trans('ContactsAddresses'); $title = $langs->trans('ContactsAddresses');
include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';

View File

@ -1260,9 +1260,9 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
} }
} }
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->commande->creer)
{ {
if ($action == 'addcontact' && $user->rights->commande->creer) if ($action == 'addcontact')
{ {
if ($object->id > 0) if ($object->id > 0)
{ {
@ -1290,7 +1290,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
} }
// bascule du statut d'un contact // bascule du statut d'un contact
else if ($action == 'swapstatut' && $user->rights->commande->creer) else if ($action == 'swapstatut')
{ {
if ($object->id > 0) if ($object->id > 0)
{ {
@ -1303,7 +1303,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
} }
// Efface un contact // Efface un contact
else if ($action == 'deletecontact' && $user->rights->commande->creer) else if ($action == 'deletecontact')
{ {
$result = $object->delete_contact($lineid); $result = $object->delete_contact($lineid);
@ -2101,9 +2101,6 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{ {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
$formcompany= new FormCompany($db);
$blocname = 'contacts'; $blocname = 'contacts';
$title = $langs->trans('ContactsAddresses'); $title = $langs->trans('ContactsAddresses');
include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';

View File

@ -1629,9 +1629,9 @@ else if ($action == 'remove_file')
} }
} }
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->facture->creer)
{ {
if ($action == 'addcontact' && $user->rights->facture->creer) if ($action == 'addcontact')
{ {
$result = $object->fetch($id); $result = $object->fetch($id);
@ -1661,7 +1661,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
} }
// bascule du statut d'un contact // bascule du statut d'un contact
else if ($action == 'swapstatut' && $user->rights->facture->creer) else if ($action == 'swapstatut')
{ {
if ($object->fetch($id)) if ($object->fetch($id))
{ {
@ -1674,7 +1674,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
} }
// Efface un contact // Efface un contact
else if ($action == 'deletecontact' && $user->rights->facture->creer) else if ($action == 'deletecontact')
{ {
$object->fetch($id); $object->fetch($id);
$result = $object->delete_contact($lineid); $result = $object->delete_contact($lineid);
@ -2980,10 +2980,6 @@ else if ($id > 0 || ! empty($ref))
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{ {
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
$formcompany= new FormCompany($db);
$blocname = 'contacts'; $blocname = 'contacts';
$title = $langs->trans('ContactsAddresses'); $title = $langs->trans('ContactsAddresses');
include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';

View File

@ -486,9 +486,9 @@ else if ($action == 'setnote' && $user->rights->contrat->creer)
if ($result < 0) dol_print_error($db,$object->error); if ($result < 0) dol_print_error($db,$object->error);
} }
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->contrat->creer)
{ {
if ($action == 'addcontact' && $user->rights->contrat->creer) if ($action == 'addcontact')
{ {
$result = $object->fetch($id); $result = $object->fetch($id);
@ -518,7 +518,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
} }
// bascule du statut d'un contact // bascule du statut d'un contact
else if ($action == 'swapstatut' && $user->rights->contrat->creer) else if ($action == 'swapstatut')
{ {
if ($object->fetch($id)) if ($object->fetch($id))
{ {
@ -531,7 +531,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
} }
// Efface un contact // Efface un contact
else if ($action == 'deletecontact' && $user->rights->contrat->creer) else if ($action == 'deletecontact')
{ {
$object->fetch($id); $object->fetch($id);
$result = $object->delete_contact(GETPOST('lineid')); $result = $object->delete_contact(GETPOST('lineid'));
@ -814,9 +814,6 @@ else
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{ {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
$formcompany= new FormCompany($db);
$blocname = 'contacts'; $blocname = 'contacts';
$title = $langs->trans('ContactsAddresses'); $title = $langs->trans('ContactsAddresses');
include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';
@ -830,7 +827,7 @@ else
} }
$servicepos=(isset($_REQUEST["servicepos"])?$_REQUEST["servicepos"]:1); $servicepos=(GETPOST('servicepos')?GETPOST('servicepos'):1); // FIXME : not used ?
$colorb='666666'; $colorb='666666';
$arrayothercontracts=$object->getListOfContracts('others'); $arrayothercontracts=$object->getListOfContracts('others');

View File

@ -1488,24 +1488,28 @@ class Form
if (dol_strlen($currencytext) > 10) $currencytext=$conf->currency; // If text is too long, we use the short code if (dol_strlen($currencytext) > 10) $currencytext=$conf->currency; // If text is too long, we use the short code
if (dol_strlen($currencytextnoent) > 10) $currencytextnoent=$conf->currency; // If text is too long, we use the short code if (dol_strlen($currencytextnoent) > 10) $currencytextnoent=$conf->currency; // If text is too long, we use the short code
$opt.= price($objp->fprice).' '.$currencytext."/".$objp->quantity;
$outval.= price($objp->fprice).' '.$currencytextnoent."/".$objp->quantity;
$outqty=$objp->quantity; $outqty=$objp->quantity;
$outdiscount=$objp->remise_percent; $outdiscount=$objp->remise_percent;
if ($objp->quantity == 1) if ($objp->quantity == 1)
{ {
$opt.= strtolower($langs->trans("Unit")); $opt.= price($objp->fprice).' '.$currencytext."/";
$outval.=strtolower($langs->transnoentities("Unit")); $outval.= price($objp->fprice).' '.$currencytextnoent."/";
$opt.= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
$outval.=$langs->transnoentities("Unit");
} }
else else
{ {
$opt.= strtolower($langs->trans("Units")); $opt.= price($objp->fprice).' '.$currencytext."/".$objp->quantity;
$outval.=strtolower($langs->transnoentities("Units")); $outval.= price($objp->fprice).' '.$currencytextnoent."/".$objp->quantity;
$opt.= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
$outval.=$langs->transnoentities("Units");
} }
if ($objp->quantity >= 1) if ($objp->quantity >= 1)
{ {
$opt.=" (".price($objp->unitprice).' '.$currencytext."/".strtolower($langs->trans("Unit")).")"; $opt.=" (".price($objp->unitprice).' '.$currencytext."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
$outval.=" (".price($objp->unitprice).' '.$currencytextnoent."/".strtolower($langs->transnoentities("Unit")).")"; $outval.=" (".price($objp->unitprice).' '.$currencytextnoent."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
} }
if ($objp->remise_percent >= 1) if ($objp->remise_percent >= 1)
{ {
@ -1530,11 +1534,20 @@ class Form
} }
$opt .= "</option>\n"; $opt .= "</option>\n";
// Add new entry // Add new entry
// "key" value of json key array is used by jQuery automatically as selected value // "key" value of json key array is used by jQuery automatically as selected value
// "label" value of json key array is used by jQuery automatically as text for combo box // "label" value of json key array is used by jQuery automatically as text for combo box
$outselect.=$opt; $outselect.=$opt;
array_push($outjson, array('key'=>$outkey, 'value'=>$outref, 'label'=>$outval, 'qty'=>$outqty, 'discount'=>$outdiscount, 'disabled'=>(empty($objp->idprodfournprice)?true:false))); array_push($outjson, array('key'=>$outkey, 'value'=>$outref, 'label'=>$outval, 'qty'=>$outqty, 'discount'=>$outdiscount, 'disabled'=>(empty($objp->idprodfournprice)?true:false)));
// Exemple of var_dump $outjson
// array(1) {[0]=>array(6) {[key"]=>string(1) "2" ["value"]=>string(3) "ppp"
// ["label"]=>string(76) "ppp (<strong>f</strong>ff2) - ppp - 20,00 Euros/1unité (20,00 Euros/unité)"
// ["qty"]=>string(1) "1" ["discount"]=>string(1) "0" ["disabled"]=>bool(false)
//}
//var_dump($outval); var_dump(utf8_check($outval)); var_dump(json_encode($outval));
//$outval=array('label'=>'ppp (<strong>f</strong>ff2) - ppp - 20,00 Euros/ Unité (20,00 Euros/unité)');
//var_dump($outval); var_dump(utf8_check($outval)); var_dump(json_encode($outval));
$i++; $i++;
} }

View File

@ -446,6 +446,30 @@ function dol_escape_htmltag($stringtoescape,$keepb=0)
return dol_htmlentities($tmp,ENT_COMPAT,'UTF-8'); return dol_htmlentities($tmp,ENT_COMPAT,'UTF-8');
} }
/**
* Convert a string to lower. Never use strtolower because it does not works with UTF8 strings.
*
* @param string $utf8_string String to encode
* @return string String converted
*/
function dol_strtolower($utf8_string)
{
return mb_strtolower($utf8_string, "UTF-8");
}
/**
* Convert a string to upper. Never use strtolower because it does not works with UTF8 strings.
*
* @param string $utf8_string String to encode
* @return string String converted
*/
function dol_strtoupper($utf8_string)
{
return mb_strtoupper($utf8_string, "UTF-8");
}
/** /**
* Write log message into outputs. Possible outputs can be: * Write log message into outputs. Possible outputs can be:
* A file if SYSLOG_FILE_ON defined: file name is then defined by SYSLOG_FILE * A file if SYSLOG_FILE_ON defined: file name is then defined by SYSLOG_FILE

View File

@ -33,7 +33,8 @@ if (! function_exists('json_encode'))
*/ */
function json_encode($elements) function json_encode($elements)
{ {
return dol_json_encode($elements); return 'ttt';
//return dol_json_encode($elements);
} }
} }

View File

@ -1,6 +1,7 @@
<?php <?php
/* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org> /* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org>
* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Juanjo 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
@ -157,6 +158,25 @@ class modCategorie extends DolibarrModules
$this->export_sql_end[$r] .=' WHERE u.rowid = cp.fk_categorie AND cp.fk_member = p.rowid'; $this->export_sql_end[$r] .=' WHERE u.rowid = cp.fk_categorie AND cp.fk_member = p.rowid';
$this->export_sql_end[$r] .=' AND u.entity = '.$conf->entity; $this->export_sql_end[$r] .=' AND u.entity = '.$conf->entity;
$this->export_sql_end[$r] .=' AND u.type = 3'; // Supplier categories $this->export_sql_end[$r] .=' AND u.type = 3'; // Supplier categories
// Imports
//--------
$r=0;
$r++;
$this->import_code[$r]=$this->rights_class.'_'.$r;
$this->import_label[$r]="CatList"; // Translation key
$this->import_icon[$r]=$this->picto;
$this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon
$this->import_tables_array[$r]=array('ca'=>MAIN_DB_PREFIX.'categorie');
$this->import_fields_array[$r]=array('ca.label'=>"Label*",
'ca.type'=>"Type*",'ca.description'=>"Description"
);
$this->import_regex_array[$r]=array('ca.type'=>'^[0|1|2|3]');
$this->import_examplevalues_array[$r]=array('ca.label'=>"Supplier Category",
'ca.type'=>"1", 'ca.description'=>"Imported category");
} }

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2012 Juanjo 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

View File

@ -4,6 +4,7 @@
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org> * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2012 Juanjo 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
@ -188,7 +189,37 @@ class modProduct extends DolibarrModules
// End add extra fields // End add extra fields
$this->import_fieldshidden_array[$r]=array('extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'product'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent) $this->import_fieldshidden_array[$r]=array('extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'product'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent)
$this->import_regex_array[$r]=array('p.ref'=>'[^ ]','p.tosell'=>'^[0|1]$','p.tobuy'=>'^[0|1]$','p.fk_product_type'=>'^[0|1]$','p.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$'); $this->import_regex_array[$r]=array('p.ref'=>'[^ ]','p.tosell'=>'^[0|1]$','p.tobuy'=>'^[0|1]$','p.fk_product_type'=>'^[0|1]$','p.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$');
$this->import_examplevalues_array[$r]=array('p.ref'=>"PR123456",'p.label'=>"My product",'p.description'=>"This is a description example for record",'p.note'=>"Some note",'p.price'=>"100",'p.price_ttc'=>"110",'p.tva_tx'=>'10','p.tosell'=>"0 or 1",'p.tobuy'=>"0 or 1",'p.fk_product_type'=>"0 for product/1 for service",'p.finished'=>'','p.duration'=>"1y",'p.datec'=>'2008-12-31'); $this->import_examplevalues_array[$r]=array('p.ref'=>"PREF123456",'p.label'=>"My product",'p.description'=>"This is a description example for record",'p.note'=>"Some note",'p.price'=>"100",'p.price_ttc'=>"110",'p.tva_tx'=>'10','p.tosell'=>"0 or 1",'p.tobuy'=>"0 or 1",'p.fk_product_type'=>"0 for product/1 for service",'p.finished'=>'','p.duration'=>"1y",'p.datec'=>'2008-12-31');
if (! empty($conf->fournisseur->enabled))
{
// Import product suppliers
$r++;
$this->import_code[$r]=$this->rights_class.'_'.$r;
$this->import_label[$r]="SuppliersPrices"; // Translation key
$this->import_icon[$r]='product';
$this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon
$this->import_tables_array[$r]=array('sp'=>MAIN_DB_PREFIX.'product_fournisseur_price');
$this->import_tables_creator_array[$r]=array('sp'=>'fk_user');
$this->import_fields_array[$r]=array('sp.fk_product'=>"Product*",
'sp.fk_soc'=>"Supplier*", 'sp.ref_fourn'=>'SupplierRef', 'sp.quantity'=>"QtyMin*", 'sp.tva_tx'=>'VATRate',
'sp.price'=>"PriceQtyMinHT*",
'sp.unitprice'=>'UnitPriceHT*', // TODO Make this file not required and calculate it from price and qty
'sp.remise_percent'=>'DiscountQtyMin'
);
$this->import_convertvalue_array[$r]=array(
'sp.fk_soc'=>array('rule'=>'fetchidfromref','classfile'=>'/societe/class/societe.class.php','class'=>'Societe','method'=>'fetch','element'=>'ThirdParty'),
'sp.fk_product'=>array('rule'=>'fetchidfromref','classfile'=>'/product/class/product.class.php','class'=>'Product','method'=>'fetch','element'=>'Product')
);
$this->import_examplevalues_array[$r]=array('sp.fk_product'=>"PREF123456",
'sp.fk_soc'=>"My Supplier",'sp.ref_fourn'=>"SupplierRef", 'sp.quantity'=>"1", 'sp.tva_tx'=>'21',
'sp.price'=>"50",
'sp.unitprice'=>'50',
'sp.remise_percent'=>'0'
);
}
} }

View File

@ -16,6 +16,13 @@
* *
*/ */
if (! class_exists('Contact')) {
require DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
}
if (! class_exists('FormCompany')) {
require DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
}
$module = $object->element; $module = $object->element;
// Special cases // Special cases
@ -25,6 +32,7 @@ elseif ($module == 'invoice_supplier') { $permission=$user->rights->fournisseur-
elseif ($module == 'order_supplier') { $permission=$user->rights->fournisseur->commande->creer; } elseif ($module == 'order_supplier') { $permission=$user->rights->fournisseur->commande->creer; }
elseif (! isset($permission)) { $permission=$user->rights->$module->creer; } // If already defined by caller page elseif (! isset($permission)) { $permission=$user->rights->$module->creer; } // If already defined by caller page
$formcompany= new FormCompany($db);
$companystatic=new Societe($db); $companystatic=new Societe($db);
$contactstatic=new Contact($db); $contactstatic=new Contact($db);
$userstatic=new User($db); $userstatic=new User($db);

View File

@ -648,9 +648,9 @@ if ($action == 'send' && ! GETPOST('cancel','alpha') && (empty($conf->global->MA
$action='presend'; $action='presend';
} }
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->ficheinter->creer)
{ {
if ($action == 'addcontact' && $user->rights->ficheinter->creer) if ($action == 'addcontact')
{ {
$result = $object->fetch($id); $result = $object->fetch($id);
@ -680,7 +680,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
} }
// bascule du statut d'un contact // bascule du statut d'un contact
else if ($action == 'swapstatut' && $user->rights->ficheinter->creer) else if ($action == 'swapstatut')
{ {
if ($object->fetch($id)) if ($object->fetch($id))
{ {
@ -693,7 +693,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
} }
// Efface un contact // Efface un contact
else if ($action == 'deletecontact' && $user->rights->ficheinter->creer) else if ($action == 'deletecontact')
{ {
$object->fetch($id); $object->fetch($id);
$result = $object->delete_contact(GETPOST('lineid','int')); $result = $object->delete_contact(GETPOST('lineid','int'));
@ -957,10 +957,6 @@ else if ($id > 0 || ! empty($ref))
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{ {
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
$formcompany= new FormCompany($db);
$blocname = 'contacts'; $blocname = 'contacts';
$title = $langs->trans('ContactsAddresses'); $title = $langs->trans('ContactsAddresses');
include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';

View File

@ -876,9 +876,9 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
} }
} }
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->fournisseur->commande->creer)
{ {
if ($action == 'addcontact' && $user->rights->fournisseur->commande->creer) if ($action == 'addcontact')
{ {
$result = $object->fetch($id); $result = $object->fetch($id);
@ -908,7 +908,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
} }
// bascule du statut d'un contact // bascule du statut d'un contact
else if ($action == 'swapstatut' && $user->rights->fournisseur->commande->creer) else if ($action == 'swapstatut')
{ {
if ($object->fetch($id)) if ($object->fetch($id))
{ {
@ -921,7 +921,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
} }
// Efface un contact // Efface un contact
else if ($action == 'deletecontact' && $user->rights->fournisseur->commande->creer) else if ($action == 'deletecontact')
{ {
$object->fetch($id); $object->fetch($id);
$result = $object->delete_contact($_GET["lineid"]); $result = $object->delete_contact($_GET["lineid"]);
@ -1253,10 +1253,6 @@ if ($id > 0 || ! empty($ref))
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{ {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
$formcompany= new FormCompany($db);
$blocname = 'contacts'; $blocname = 'contacts';
$title = $langs->trans('ContactsAddresses'); $title = $langs->trans('ContactsAddresses');
include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';

View File

@ -842,9 +842,9 @@ elseif ($action == 'remove_file')
} }
} }
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->fournisseur->facture->creer)
{ {
if ($action == 'addcontact' && $user->rights->fournisseur->facture->creer) if ($action == 'addcontact')
{ {
$result = $object->fetch($id); $result = $object->fetch($id);
@ -874,7 +874,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
} }
// bascule du statut d'un contact // bascule du statut d'un contact
else if ($action == 'swapstatut' && $user->rights->fournisseur->facture->creer) else if ($action == 'swapstatut')
{ {
if ($object->fetch($id)) if ($object->fetch($id))
{ {
@ -887,7 +887,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
} }
// Efface un contact // Efface un contact
else if ($action == 'deletecontact' && $user->rights->fournisseur->facture->creer) else if ($action == 'deletecontact')
{ {
$object->fetch($id); $object->fetch($id);
$result = $object->delete_contact($_GET["lineid"]); $result = $object->delete_contact($_GET["lineid"]);
@ -1526,11 +1526,6 @@ else
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{ {
print '<br>'; print '<br>';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
$formcompany= new FormCompany($db);
$blocname = 'contacts'; $blocname = 'contacts';
$title = $langs->trans('ContactsAddresses'); $title = $langs->trans('ContactsAddresses');
include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';

View File

@ -77,7 +77,8 @@ $contentlinevalues=array();
$i = 0; $i = 0;
foreach($fieldstarget as $code=>$label) foreach($fieldstarget as $code=>$label)
{ {
$headerlinefields[]=$fieldstarget[$code].' ('.$code.')'; $withoutstar=preg_replace('/\*/','',$fieldstarget[$code]);
$headerlinefields[]=$langs->transnoentities($withoutstar).($withoutstar != $fieldstarget[$code]?'*':'').' ('.$code.')';
$contentlinevalues[]=$valuestarget[$code]; $contentlinevalues[]=$valuestarget[$code];
} }
//var_dump($headerlinefields); //var_dump($headerlinefields);

View File

@ -733,7 +733,7 @@ if ($step == 4 && $datatoimport)
print '<input type="text" size="1" name="separator" value="'.htmlentities($separator).'"/>'; print '<input type="text" size="1" name="separator" value="'.htmlentities($separator).'"/>';
print '&nbsp;&nbsp;&nbsp;&nbsp;'.$langs->trans("Enclosure").' : '; print '&nbsp;&nbsp;&nbsp;&nbsp;'.$langs->trans("Enclosure").' : ';
print '<input type="text" size="1" name="enclosure" value="'.htmlentities($enclosure).'"/>'; print '<input type="text" size="1" name="enclosure" value="'.htmlentities($enclosure).'"/>';
print '<input type="submit" value="'.$langs->trans('Update').'" />'; print '<input type="submit" value="'.$langs->trans('Update').'" class="button" />';
print '</form>'; print '</form>';
print '</td></tr>'; print '</td></tr>';
} }

View File

@ -116,3 +116,7 @@ Excel95FormatDesc=Arxiu amb format <b>Excel</b> (.xls)<br>Aquest és el format n
Excel2007FormatDesc=Arxiu amb format <b>Excel</b> (.xlsx)<br>Aquest és el format natiu d'Excel 2007 (SpreadsheetML). Excel2007FormatDesc=Arxiu amb format <b>Excel</b> (.xlsx)<br>Aquest és el format natiu d'Excel 2007 (SpreadsheetML).
TsvFormatDesc=Arxiu amb format <b>Valors separats per tabulador</b> (. Tsv)<br> Aquest és un format d'arxiu de text en què els camps són separats per un tabulador [tab]. TsvFormatDesc=Arxiu amb format <b>Valors separats per tabulador</b> (. Tsv)<br> Aquest és un format d'arxiu de text en què els camps són separats per un tabulador [tab].
ExportFieldAutomaticallyAdded=S'ha afegit automàticament el camp <b>%s</b>, ja que evitarà que línies idèntiques siguin considerades com duplicades (amb aquest camp, cada línia tindrà un id propi). ExportFieldAutomaticallyAdded=S'ha afegit automàticament el camp <b>%s</b>, ja que evitarà que línies idèntiques siguin considerades com duplicades (amb aquest camp, cada línia tindrà un id propi).
CsvOptions=Opcions de l'arxiu CSV
Separator=Separador
Enclosure=Delimitador de camps
SuppliersProducts=Productes de proveïdors

View File

@ -119,3 +119,4 @@ ExportFieldAutomaticallyAdded=Field <b>%s</b> was automatically added. It will a
CsvOptions=Csv Options CsvOptions=Csv Options
Separator=Separator Separator=Separator
Enclosure=Enclosure Enclosure=Enclosure
SuppliersProducts=Suppliers Products

View File

@ -116,3 +116,7 @@ Excel95FormatDesc=Archivo con formato <b>Excel</b> (.xls)<br>Este es el formato
Excel2007FormatDesc=Archivo con formato <b>Excel</b> (.xlsx)<br>Este es el formato nativo de Excel 2007 (SpreadsheetML). Excel2007FormatDesc=Archivo con formato <b>Excel</b> (.xlsx)<br>Este es el formato nativo de Excel 2007 (SpreadsheetML).
TsvFormatDesc=Archivo con formato <b>Valores separados por tabulador</b> (.tsv)<br>Este es un formato de archivo de texto en el que los campos son separados por un tabulador [tab]. TsvFormatDesc=Archivo con formato <b>Valores separados por tabulador</b> (.tsv)<br>Este es un formato de archivo de texto en el que los campos son separados por un tabulador [tab].
ExportFieldAutomaticallyAdded=Se ha añadido automáticamente el campo <b>%s</b>, ya que evitará que líneas idénticas sean consideradas como duplicadas (con este campo, cada línea tendrá un id propio). ExportFieldAutomaticallyAdded=Se ha añadido automáticamente el campo <b>%s</b>, ya que evitará que líneas idénticas sean consideradas como duplicadas (con este campo, cada línea tendrá un id propio).
CsvOptions=Opciones del archivo CSV
Separator=Separador
Enclosure=Delimitador de campos
SuppliersProducts=Productos de proveedores

View File

@ -117,5 +117,6 @@ Excel2007FormatDesc=Format <b>Excel</b> (.xls).<br>Format standard Excel 2007 (S
TsvFormatDesc=Format de fichier à <b>Valeurs Séparées par des Tabulations</b> (.tsv).<br>C'est un fichier texte dont les champs sont séparés par des tabulations [tab]. TsvFormatDesc=Format de fichier à <b>Valeurs Séparées par des Tabulations</b> (.tsv).<br>C'est un fichier texte dont les champs sont séparés par des tabulations [tab].
ExportFieldAutomaticallyAdded=Le champ <b>%s</b> a été ajouté automatiquement car il évitera que des lignes identiques soient considérées comme des doublons (avec ce champ, aucune ligne ne sera identique mais aura un id propre). ExportFieldAutomaticallyAdded=Le champ <b>%s</b> a été ajouté automatiquement car il évitera que des lignes identiques soient considérées comme des doublons (avec ce champ, aucune ligne ne sera identique mais aura un id propre).
CsvOptions=Options du fichier Csv CsvOptions=Options du fichier Csv
Separator=Séparateur Separator=Séparateur de champs
Enclosure=Délimiteur de champs Enclosure=Encadrement des chaines de textes
SuppliersProducts=Produits Fournisseurs

View File

@ -470,7 +470,7 @@ if ($id || $ref)
print vatrate($productfourn->fourn_tva_tx,true); print vatrate($productfourn->fourn_tva_tx,true);
print '</td>'; print '</td>';
// Price quantity // Price for the quantity
print '<td align="right">'; print '<td align="right">';
print $productfourn->fourn_price?price($productfourn->fourn_price):""; print $productfourn->fourn_price?price($productfourn->fourn_price):"";
print '</td>'; print '</td>';