Hello,
I think this is hardcoded somewhere in the BreezingForms code so you can use only those values that are already inside the PDF template. Therefore, unfortunatelly, you can't access the submitter user name and user full name.
The only way to do it is to add elements for names in your form as you said you knew you could.
I will give you instructions on how to do that, just in case:
1) Create a Hidden input element named
username and in the Value field put this code:
<?php $user = JFactory::getUser(); return $user->username;?>
2) Create a Hidden input element named
fullname and in the Value field put this code:
<?php $user = JFactory::getUser(); return "$user->name"; ?>
This part so far will solve including user name and user full name in the pdf attachments. To use that names in the title of pdf attachment do the following:
3) Go to
\components\com_breezingforms\ and open the file
facileforms.process.php.
Around line
5129 you have to replace this code:
$pdfname = $this->uploads . '/ffexport-pdf-' . $date_stamp . '-' . mt_rand(0, mt_getrandmax()) . '.pdf';
with this one:
foreach($xmldata as $data){
if ($data[_FF_DATA_TITLE]== "username"){$username=$data[_FF_DATA_VALUE];}
if ($data[_FF_DATA_TITLE]== "fullname"){$fullname=$data[_FF_DATA_VALUE];}
}
if($this->formrow->name=='formname'){
$pdfname = $ff_compath . '/exports/'.$username.'_'.$fullname .'_'. $date_stamp.'.pdf';
}
else{
$pdfname = $ff_compath . '/exports/ffexport-pdf-' . $date_stamp . '-' . mt_rand(0, mt_getrandmax()) . '.pdf';
}
NOTE: In the code that I have sent you replace
formname with the
Name of your form. Also, if you gave other
Titles to
username and
fullname, replace that as well.
Save the changes you've made and that should do the trick. Let me know if this will be acceptable solution for you.
Regards,
Mihaela