Fix: possibility to hide free "to"

This commit is contained in:
Regis Houssin 2011-06-17 20:50:57 +00:00
parent a17d7c7ee0
commit 9a6cafdf18

View File

@ -48,6 +48,7 @@ class FormMail
var $withsubstit; // Show substitution array var $withsubstit; // Show substitution array
var $withfrom; var $withfrom;
var $withto; var $withto;
var $withtofree;
var $withtocc; var $withtocc;
var $withtopic; var $withtopic;
var $withfile; // 0=No attaches files, 1=Show attached files, 2=Can add new attached files var $withfile; // 0=No attaches files, 1=Show attached files, 2=Can add new attached files
@ -79,6 +80,7 @@ class FormMail
$this->withfrom=1; $this->withfrom=1;
$this->withto=1; $this->withto=1;
$this->withtofree=1;
$this->withtocc=1; $this->withtocc=1;
$this->withtoccc=0; $this->withtoccc=0;
$this->witherrorsto=0; $this->witherrorsto=0;
@ -331,8 +333,11 @@ class FormMail
$out.= (! is_array($this->withto) && ! is_numeric($this->withto))?$this->withto:""; $out.= (! is_array($this->withto) && ! is_numeric($this->withto))?$this->withto:"";
} }
else else
{
if ($this->withtofree)
{ {
$out.= '<input size="'.(is_array($this->withto)?"30":"60").'" id="sendto" name="sendto" value="'.(! is_array($this->withto) && ! is_numeric($this->withto)? (isset($_REQUEST["sendto"])?$_REQUEST["sendto"]:$this->withto) :"").'" />'; $out.= '<input size="'.(is_array($this->withto)?"30":"60").'" id="sendto" name="sendto" value="'.(! is_array($this->withto) && ! is_numeric($this->withto)? (isset($_REQUEST["sendto"])?$_REQUEST["sendto"]:$this->withto) :"").'" />';
}
if ($this->withtosocid > 0) if ($this->withtosocid > 0)
{ {
$liste=array(); $liste=array();
@ -343,7 +348,7 @@ class FormMail
{ {
$liste[$key]=$value; $liste[$key]=$value;
} }
$out.= " ".$langs->trans("or")." "; if ($this->withtofree) $out.= " ".$langs->trans("or")." ";
//var_dump($_REQUEST);exit; //var_dump($_REQUEST);exit;
$out.= $form->selectarray("receiver", $liste, isset($_REQUEST["receiver"])?$_REQUEST["receiver"]:0); $out.= $form->selectarray("receiver", $liste, isset($_REQUEST["receiver"])?$_REQUEST["receiver"]:0);
} }