diff --git a/ChangeLog b/ChangeLog index d685811b926..3bbd3412f22 100644 --- a/ChangeLog +++ b/ChangeLog @@ -40,18 +40,19 @@ For users: - New: Add Maghreb regions and departments. - New: A more responsive desgin for statistic box of home page. - Qual: Implement same rule for return value of all command line scripts (0 when success, <>0 if error). -- New: [ task #1005 ] Adapting to Spanish legislation bill numbering. -- New: [ task #1011 ] Now supplier order and invoice deal with payment terms and mode. -- New: [ task #1014 ] Add option to recursivly add parent category. -- New: [ task #1016 ] Can define a specific numbering for deposits. -- New: [ task #918 ] Stock replenishment. -- Fix: [ bug #992 ] Proforma invoices don't have a separated numeric count. -- New: Add pdf link into supplier invoice list and supplier order list. -- New: Genrate auto the PDF for supplier invoice. -- New: Add category into filter webservice thirdparty method getListOfThirdParties. -- New: Allow to define margin or mark rate during quoting, ordering, invoicing. -- New: User permissions on margin module. -- New: Add ref supplier into muscadet model. +- New: [ task #1005 ] Adapting to Spanish legislation bill numbering +- New: [ task #1011 ] Now supplier order and invoice deal with payment terms and mode +- New: [ task #1014 ] Add option to recursivly add parent category +- New: [ task #1016 ] Can define a specific numbering for deposits +- New: [ task #918 ] Stock replenishment +- Fix: [ bug #992 ] Proforma invoices don't have a separated numeric count +- New : Add pdf link into supplier invoice list and supplier order list +- New : Genrate auto the PDF for supplier invoice +- New : Add category into filter webservice thirdparty method getListOfThirdParties +- New : Allow to define margin or mark rate during quoting, ordering, invoicing +- New : User permissions on margin module +- New : Add ref supplier into muscadet model +- New : Add ability to copy contact address to clipboard - New: Can use tag {mm} before {yy} even when there is a reset into numbering masks. - New: [ task #1060 ] Register fields localtax(1|2)_type into details tables. - New: [ task #923 ] Localtax support for ODT templates. diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index f9c731c097a..5d57abe119c 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -5,7 +5,8 @@ * Copyright (C) 2010-2012 Regis Houssin * Copyright (C) 2013 Florian Henry * Copyright (C) 2013 Juanjo Menent - * + * Copyright (C) 2013 Christophe Battarel + * * * 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 @@ -546,7 +547,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') print "\n".''."\n"; - $colspan=6; + $colspan=8; print ''; print ''; print ''; @@ -561,10 +562,16 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') $colspan++; print ''; } + if ($user->rights->societe->contact->creer) + { + $colspan++; + print ''; + } print ""; $sql = "SELECT p.rowid, p.lastname, p.firstname, p.fk_pays, p.poste, p.phone, p.phone_mobile, p.fax, p.email, p.statut "; + $sql .= ", p.civilite, p.address, p.zip, p.town"; $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p"; $sql .= " WHERE p.fk_soc = ".$object->id; $sql .= " ORDER by p.datec"; @@ -592,17 +599,17 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') print ''; - $country_code = getCountry($obj->fk_pays, 2); + $country_code = getCountry($obj->fk_pays, 'all'); // Lien click to dial print ''; print ''; print ''; print ''; elseif ($obj->statut==1) print ''; + + // copy in clipboard + $coords = ''; + if (!empty($object->name)) + $coords .= addslashes($object->name)."
"; + if (!empty($obj->civilite)) + $coords .= addslashes($obj->civilite).' '; + if (!empty($obj->firstname)) + $coords .= addslashes($obj->firstname).' '; + if (!empty($obj->lastname)) + $coords .= addslashes($obj->lastname); + $coords .= "
"; + if (!empty($obj->address)) + { + $coords .= addslashes(dol_nl2br($obj->address,1,true))."
"; + if (!empty($obj->cp)) + $coords .= addslashes($obj->zip).' '; + if (!empty($obj->ville)) + $coords .= addslashes($obj->town); + if (!empty($obj->pays)) + $coords .= "
".addslashes($country_code['label']); + } + elseif (!empty($object->address)) + { + $coords .= addslashes(dol_nl2br($object->address,1,true))."
"; + if (!empty($object->zip)) + $coords .= addslashes($object->zip).' '; + if (!empty($object->town)) + $coords .= addslashes($object->town); + if (!empty($object->country)) + $coords .= "
".addslashes($object->country); + } + print ''; + if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) { print '
'.$langs->trans("Name").''.$langs->trans("Poste").'  
'.$obj->poste.''; - print dol_print_phone($obj->phone,$country_code,$obj->rowid,$object->id,'AC_TEL'); + print dol_print_phone($obj->phone,$country_code['code'],$obj->rowid,$object->id,'AC_TEL'); print ''; - print dol_print_phone($obj->phone_mobile,$country_code,$obj->rowid,$object->id,'AC_TEL'); + print dol_print_phone($obj->phone_mobile,$country_code['code'],$obj->rowid,$object->id,'AC_TEL'); print ''; - print dol_print_phone($obj->fax,$country_code,$obj->rowid,$object->id,'AC_FAX'); + print dol_print_phone($obj->fax,$country_code['code'],$obj->rowid,$object->id,'AC_FAX'); print ''; print dol_print_email($obj->email,$obj->rowid,$object->id,'AC_EMAIL'); @@ -610,6 +617,42 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') if ($obj->statut==0) print ''.$langs->trans('Disabled').' '.img_picto($langs->trans('StatusContactDraftShort'),'statut0').''.$langs->trans('Enabled').' '.img_picto($langs->trans('StatusContactValidatedShort'),'statut1').''; + print img_picto($langs->trans("Address"), 'object_address.png'); + print ''; @@ -648,6 +691,20 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') print "\n
\n"; print "
\n"; +?> + + + function copyToClipboard (text) { + text = text.replace(/
/g,"\n"); + var newElem = "

'.$langs->trans('HelpCopyToClipboard').'"; + $("#dialog").html(newElem); + $( "#dialog" ).dialog(); + $("#coords").select(); + return false; + } + '; return $i; } diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 35788d208fa..d3396ea788a 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -658,6 +658,7 @@ Deductible=Deductible from=from toward=toward Access=Access +HelpCopyToClipboard=Use Ctrl+C to copy to clipboard # Week day Monday=Monday diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index ee591bb4535..b34b784165a 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -658,6 +658,7 @@ Deductible=Déductible from=de toward=vers Access=Accès +HelpCopyToClipboard=Ctrl+C pour copier dans le presse-papier # Week day Monday=Lundi