';
print '';
@@ -1580,11 +1580,11 @@ else
}
print ' ';
print ' ';
-
+
// Company
print ''.$langs->trans('Company').' '.$soc->getNomUrl(1).' ';
print ' ';
-
+
// Ligne info remises tiers
print ''.$langs->trans('Discounts').' ';
if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client);
@@ -1614,7 +1614,7 @@ else
}
if (! $absolute_discount && ! $absolute_creditnote) print $langs->trans("CompanyHasNoAbsoluteDiscount").'.';
print ' ';
-
+
// Date of proposal
print '';
print '';
@@ -1645,7 +1645,7 @@ else
}
}
print ' ';
-
+
// Date end proposal
print ' ';
print '';
@@ -1678,7 +1678,7 @@ else
}
print ' ';
print ' ';
-
+
// Payment term
print '';
print '';
@@ -1697,7 +1697,7 @@ else
}
print ' ';
print ' ';
-
+
// Delivery date
$langs->load('deliveries');
print '';
@@ -1722,7 +1722,7 @@ else
}
print ' ';
print ' ';
-
+
// Delivery delay
print '';
print '';
@@ -1740,10 +1740,10 @@ else
{
$form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id,$object->availability_id,'none',1);
}
-
+
print ' ';
print ' ';
-
+
// Origin of demand
print '';
print '';
@@ -1761,10 +1761,10 @@ else
{
$form->form_demand_reason($_SERVER['PHP_SELF'].'?id='.$object->id,$object->demand_reason_id,'none');
}
-
+
print ' ';
print ' ';
-
+
// Payment mode
print '';
print '';
@@ -1783,7 +1783,7 @@ else
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->mode_reglement_id,'none');
}
print ' ';
-
+
// Project
if (! empty($conf->projet->enabled))
{
@@ -1825,7 +1825,7 @@ else
}
print '';
}
-
+
// Other attributes
$parameters=array('colspan' => ' colspan="3"');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
@@ -1841,12 +1841,12 @@ else
print ''."\n";
}
}
-
+
// Amount HT
print ''.$langs->trans('AmountHT').' ';
print ''.price($object->total_ht).' ';
print ''.$langs->trans("Currency".$conf->currency).' ';
-
+
// Margin Infos
if (! empty($conf->margin->enabled)) {
print '';
@@ -1854,12 +1854,12 @@ else
print ' ';
}
print ' ';
-
+
// Amount VAT
print ''.$langs->trans('AmountVAT').' ';
print ''.price($object->total_tva).' ';
print ''.$langs->trans("Currency".$conf->currency).' ';
-
+
// Amount Local Taxes
if ($mysoc->localtax1_assuj=="1") //Localtax1
{
@@ -1873,55 +1873,55 @@ else
print ''.price($object->total_localtax2).' ';
print ''.$langs->trans("Currency".$conf->currency).' ';
}
-
-
+
+
// Amount TTC
print ''.$langs->trans('AmountTTC').' ';
print ''.price($object->total_ttc).' ';
print ''.$langs->trans("Currency".$conf->currency).' ';
-
+
// Statut
print ''.$langs->trans('Status').' '.$object->getLibStatut(4).' ';
-
+
print '
';
-
+
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
$blocname = 'contacts';
$title = $langs->trans('ContactsAddresses');
include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';
}
-
+
if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB))
{
$blocname = 'notes';
$title = $langs->trans('Notes');
include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';
}
-
+
/*
* Lines
*/
-
+
if (! empty($conf->use_javascript_ajax) && $object->statut == 0)
{
include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
}
-
+
print '';
-
+
// Show object lines
$result = $object->getLinesArray();
if (! empty($object->lines))
$ret=$object->printObjectLines($action,$mysoc,$soc,$lineid);
-
+
// Form to add new line
if ($object->statut == 0 && $user->rights->propal->creer)
{
if ($action != 'editline')
{
$var=true;
-
+
if ($conf->global->MAIN_FEATURES_LEVEL > 1)
{
// Add free or predefined products/services
@@ -1931,7 +1931,7 @@ else
{
// Add free products/services
$object->formAddFreeProduct(0,$mysoc,$soc);
-
+
// Add predefined products/services
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled))
{
@@ -1939,17 +1939,17 @@ else
$object->formAddPredefinedProduct(0,$mysoc,$soc);
}
}
-
+
$parameters=array();
$reshook=$hookmanager->executeHooks('formAddObjectLine',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
}
}
-
+
print '
';
-
+
print '';
print "\n";
-
+
if ($action == 'statut')
{
/*
@@ -1975,18 +1975,18 @@ else
$form_close.= ' ';
$form_close.= ' ';
$form_close.= '
';
-
+
print $form_close;
}
-
-
+
+
/*
* Boutons Actions
*/
if ($action != 'presend')
{
print '';
print " \n";
}
-
+
if ($action != 'presend')
{
print '';
print ' '; // ancre
-
-
+
+
/*
* Documents generes
*/
@@ -2083,28 +2083,28 @@ else
$urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id;
$genallowed=$user->rights->propal->creer;
$delallowed=$user->rights->propal->supprimer;
-
+
$var=true;
-
+
$somethingshown=$formfile->show_documents('propal',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'',0,'',$soc->default_lang);
-
-
+
+
/*
* Linked object block
*/
$somethingshown=$object->showLinkedObjectBlock();
-
+
print ' ';
-
+
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions=new FormActions($db);
$somethingshown=$formactions->showactions($object,'propal',$socid);
-
+
print '
';
}
-
-
+
+
/*
* Action presend
*
@@ -2115,7 +2115,7 @@ else
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($object->ref,'/'));
$file=$fileparams['fullname'];
-
+
// Build document if it not exists
if (! $file || ! is_readable($file))
{
@@ -2129,7 +2129,7 @@ else
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
}
-
+
$result=propale_pdf_create($db, $object, GETPOST('model')?GETPOST('model'):$object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result <= 0)
{
@@ -2139,10 +2139,10 @@ else
$fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($object->ref,'/'));
$file=$fileparams['fullname'];
}
-
+
print ' ';
print_titre($langs->trans('SendPropalByMail'));
-
+
// Create form object
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
@@ -2151,18 +2151,17 @@ else
$formmail->fromname = $user->getFullName($langs);
$formmail->frommail = $user->email;
$formmail->withfrom=1;
- $formmail->withto=empty($_POST["sendto"])?1:$_POST["sendto"];
- $formmail->withtosocid=$soc->id;
- $formmail->withtocc=1;
- $formmail->withtoccsocid=0;
+ $liste=array();
+ foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value;
+ $formmail->withto=GETPOST("sendto")?GETPOST("sendto"):$liste;
+ $formmail->withtocc=$liste;
$formmail->withtoccc=(! empty($conf->global->MAIN_EMAIL_USECCC)?$conf->global->MAIN_EMAIL_USECCC:false);
- $formmail->withtocccsocid=0;
$formmail->withtopic=$langs->trans('SendPropalRef','__PROPREF__');
$formmail->withfile=2;
$formmail->withbody=1;
$formmail->withdeliveryreceipt=1;
$formmail->withcancel=1;
-
+
// Tableau des substitutions
$formmail->substit['__PROPREF__']=$object->ref;
$formmail->substit['__SIGNATURE__']=$user->signature;
@@ -2172,16 +2171,16 @@ else
$formmail->param['models']='propal_send';
$formmail->param['id']=$object->id;
$formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id;
-
+
// Init list of files
if (GETPOST("mode")=='init')
{
$formmail->clear_attached_files();
$formmail->add_attached_files($file,basename($file),dol_mimetype($file));
}
-
+
$formmail->show_form();
-
+
print ' ';
}
}
diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php
index ccaadefe2ee..03dde1a24ff 100644
--- a/htdocs/commande/fiche.php
+++ b/htdocs/commande/fiche.php
@@ -2418,12 +2418,11 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
$formmail->fromname = $user->getFullName($langs);
$formmail->frommail = $user->email;
$formmail->withfrom=1;
- $formmail->withto=GETPOST('sendto')?GETPOST('sendto'):1;
- $formmail->withtosocid=$soc->id;
- $formmail->withtocc=1;
- $formmail->withtoccsocid=0;
+ $liste=array();
+ foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value;
+ $formmail->withto=GETPOST('sendto')?GETPOST('sendto'):$liste;
+ $formmail->withtocc=$liste;
$formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC;
- $formmail->withtocccsocid=0;
$formmail->withtopic=$langs->trans('SendOrderRef','__ORDERREF__');
$formmail->withfile=2;
$formmail->withbody=1;
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index 4295e1f6fa9..bccac8d8354 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -3403,12 +3403,11 @@ else if ($id > 0 || ! empty($ref))
$formmail->fromname = $user->getFullName($langs);
$formmail->frommail = $user->email;
$formmail->withfrom=1;
- $formmail->withto=empty($_POST["sendto"])?1:$_POST["sendto"];
- $formmail->withtosocid=$soc->id;
- $formmail->withtocc=1;
- $formmail->withtoccsocid=0;
+ $liste=array();
+ foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value;
+ $formmail->withto=GETPOST('sendto')?GETPOST('sendto'):$liste;
+ $formmail->withtocc=$liste;
$formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC;
- $formmail->withtocccsocid=0;
$formmail->withtopic=$langs->transnoentities($topicmail,'__FACREF__');
$formmail->withfile=2;
$formmail->withbody=1;
diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php
index f499bcb6b68..bca6463055b 100644
--- a/htdocs/core/class/html.formmail.class.php
+++ b/htdocs/core/class/html.formmail.class.php
@@ -49,6 +49,7 @@ class FormMail
var $withto;
var $withtofree;
var $withtocc;
+ var $withtoccc;
var $withtopic;
var $withfile; // 0=No attaches files, 1=Show attached files, 2=Can add new attached files
var $withbody;
@@ -428,23 +429,11 @@ class FormMail
else
{
$out.= ' withtocc) : (isset($_POST["sendtocc"])?$_POST["sendtocc"]:"") ).'" />';
- if (! empty($this->withto) && is_array($this->withto))
+ if (! empty($this->withtocc) && is_array($this->withtocc))
{
$out.= " ".$langs->trans("or")." ";
$out.= $form->selectarray("receivercc", $this->withto, GETPOST("receivercc"), 1);
}
- if (! empty($this->withtoccsocid) && $this->withtoccsocid > 0) // deprecated. TODO Remove this. Instead, fill withto with array before calling method.
- {
- $liste=array();
- $soc=new Societe($this->db);
- $soc->fetch($this->withtoccsocid);
- foreach ($soc->thirdparty_and_contact_email_array(1) as $key=>$value)
- {
- $liste[$key]=$value;
- }
- $out.= " ".$langs->trans("or")." ";
- $out.= $form->selectarray("receivercc", $liste, GETPOST("receivercc"), 1);
- }
}
$out.= " \n";
}
@@ -462,23 +451,11 @@ class FormMail
else
{
$out.= ' withtoccc) : (isset($_POST["sendtoccc"])?$_POST["sendtoccc"]:"") ).'" />';
- if (! empty($this->withto) && is_array($this->withto))
+ if (! empty($this->withtoccc) && is_array($this->withtoccc))
{
$out.= " ".$langs->trans("or")." ";
$out.= $form->selectarray("receiverccc", $this->withto, GETPOST("receiverccc"), 1);
}
- if (! empty($this->withtocccsocid) && $this->withtocccsocid > 0) // deprecated. TODO Remove this. Instead, fill withto with array before calling method.
- {
- $liste=array();
- $soc=new Societe($this->db);
- $soc->fetch($this->withtosocid);
- foreach ($soc->thirdparty_and_contact_email_array(1) as $key=>$value)
- {
- $liste[$key]=$value;
- }
- $out.= " ".$langs->trans("or")." ";
- $out.= $form->selectarray("receiverccc", $liste, GETPOST("receiverccc"), 1);
- }
}
//if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_TO)) print ' '.info_admin("+ ".$conf->global->MAIN_MAIL_AUTOCOPY_TO,1);
$out.= "\n";
diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php
index 90850fce683..21289f60864 100644
--- a/htdocs/expedition/fiche.php
+++ b/htdocs/expedition/fiche.php
@@ -1443,12 +1443,11 @@ else
$formmail->fromname = $user->getFullName($langs);
$formmail->frommail = $user->email;
$formmail->withfrom=1;
- $formmail->withto=GETPOST('sendto','int')?GETPOST('sendto','int'):1;
- $formmail->withtosocid=$soc->id;
- $formmail->withtocc=1;
- $formmail->withtoccsocid=0;
+ $liste=array();
+ foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value;
+ $formmail->withto=GETPOST("sendto")?GETOST("sendto"):$liste;
+ $formmail->withtocc=$liste;
$formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC;
- $formmail->withtocccsocid=0;
$formmail->withtopic=$langs->trans('SendShippingRef','__SHIPPINGREF__');
$formmail->withfile=2;
$formmail->withbody=1;
diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php
index 11e1eabd782..b2db591eefc 100644
--- a/htdocs/fichinter/fiche.php
+++ b/htdocs/fichinter/fiche.php
@@ -1487,12 +1487,11 @@ else if ($id > 0 || ! empty($ref))
$formmail->fromname = $user->getFullName($langs);
$formmail->frommail = $user->email;
$formmail->withfrom=1;
- $formmail->withto=(!GETPOST('sendto','alpha'))?1:GETPOST('sendto','alpha');
- $formmail->withtosocid=$societe->id;
- $formmail->withtocc=1;
- $formmail->withtoccsocid=0;
+ $liste=array();
+ foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value;
+ $formmail->withto=GETPOST("sendto")?GETOST("sendto"):$liste;
+ $formmail->withtocc=$liste;
$formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC;
- $formmail->withtocccsocid=0;
$formmail->withtopic=$langs->trans('SendInterventionRef','__FICHINTERREF__');
$formmail->withfile=2;
$formmail->withbody=1;
diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php
index ee802c3dc0f..24ecd0690b0 100644
--- a/htdocs/fourn/commande/fiche.php
+++ b/htdocs/fourn/commande/fiche.php
@@ -1819,12 +1819,11 @@ if (! empty($object->id))
$formmail->fromname = $user->getFullName($langs);
$formmail->frommail = $user->email;
$formmail->withfrom=1;
- $formmail->withto=empty($_POST["sendto"])?1:$_POST["sendto"];
- $formmail->withtosocid=$object->thirdparty->id;
- $formmail->withtocc=1;
- $formmail->withtoccsocid=0;
+ $liste=array();
+ foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value;
+ $formmail->withto=GETPOST("sendto")?GETOST("sendto"):$liste;
+ $formmail->withtocc=$liste;
$formmail->withtoccc=(! empty($conf->global->MAIN_EMAIL_USECCC)?$conf->global->MAIN_EMAIL_USECCC:false);
- $formmail->withtocccsocid=0;
$formmail->withtopic=$langs->trans('SendOrderRef','__ORDERREF__');
$formmail->withfile=2;
$formmail->withbody=1;
diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php
index be8b7f6664d..571742a977d 100644
--- a/htdocs/fourn/facture/fiche.php
+++ b/htdocs/fourn/facture/fiche.php
@@ -2075,12 +2075,11 @@ else
$formmail->fromname = $user->getFullName($langs);
$formmail->frommail = $user->email;
$formmail->withfrom=1;
- $formmail->withto=empty($_POST["sendto"])?1:$_POST["sendto"];
- $formmail->withtosocid=$societe->id;
- $formmail->withtocc=1;
- $formmail->withtoccsocid=0;
+ $liste=array();
+ foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value;
+ $formmail->withto=GETPOST("sendto")?GETOST("sendto"):$liste;
+ $formmail->withtocc=$liste;
$formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC;
- $formmail->withtocccsocid=0;
$formmail->withtopic=$langs->trans('SendBillRef','__FACREF__');
$formmail->withfile=2;
$formmail->withbody=1;