TOPIC:

Change PDF attachement name according to field 4 months 1 week ago #241076

  • Topic Author
  • Leni14
  • Offline
  • Senior Breezer
  • Senior Breezer
  • Posts: 129
  • Thanks: 0
Hi,

I used this to change my pdf's attachement name.
if($this->formrow->name=='FORMNAME'){

                    $pdfname = 'XY.pdf';
                    }
                    else{
                $pdfname = $ff_compath . '/exports/ffexport-pdf-' . $date_stamp . '-' . mt_rand(0, mt_getrandmax()) . '.pdf';

But now I would need something more specific.

I would need the name of the pdf attachment to be depending on 2 selectlist value within the form.

So the selectlist value of the first selectlist would be
1;-please select-;
0;a;a
0;b;b

and the second selectlist would be
1;-please select-;
0;c;c
0;d;d

I would need the code to check which of the selecfields has a value and give it back.

So the pdf's name should be a,b,c or d.

Can someone help me with the code?

Thx,
Leni

Please Log in or Create an account to join the conversation.

Change PDF attachement name according to field 4 months 1 week ago #241112

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Posts: 10063
  • Karma: 167
  • Thanks: 800
Hi,

I took the time to build that into BF because this solution from the previous posting would be hacking and you'd need to revert back after every update.

What I did now - exclusively for pdf attachments, not exports (because these are multiple record exports) - to allow to specify the filemask right in your pdf template (the location doesn't matter, can be anywhere within the html output).

For example:
<!-- fm = {name:value}{filemask:_separator}{lastname:value}{filemask:_separator}{select:value} -->

The placeholders in curly brackets are addressing the values from the submission from the desired fields.

The basic structure is

{FIELDNAME:value}

So the above would automatically being translated into a filename like:

Mark_Wallenberg_Selection1.pdf

Since it works with dropdowns, too, you will be able to add values from several concurrent dropdowns, as well.

There are also a few system placeholders you can use:

{filemask:_separator}
{filemask:_username}
{filemask:_userid}
{filemask:_name}
{filemask:_datetime}
{filemask:_timestamp}
{filemask:_random}

Unlike the upload filemasks, you cannot specify a custom folder location. All files are backup'ed in the folder "/path/to/site/media/breezingforms/uploads/".

Please download, unzip and copy the file attached and copy it to "/components/com_breezingforms/".

If that solution is ok for you, it will be included with the next update.

File Attachment:

File Name: facileform...5-21.zip
File Size:60 KB


Regards,
Markus
Attachments:

Please Log in or Create an account to join the conversation.

Last edit: Post by TheMuffinMan.

Change PDF attachement name according to field 4 months 5 hours ago #241762

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Posts: 10063
  • Karma: 167
  • Thanks: 800
Hi,

since your yahoo account keeps blocking me (I can barely send you messages), please read the email I was trying to send you (regarding your CB list view and vertical images display problem):

Sorry, but I am not sure if I can follow.

The topic you referred to was this:
crosstec.org/en/forums/3-breezingforms-f...-updates.html#241341

There I suggested my custom file path addition to BreezingForms for PDFs:

crosstec.org/en/forums/40-club-forums-su...to-field.html#241112

But this is a completely different file than the one you just sent me.

In both cases I didn't touch the output of the list view layouts or the image scale or download plugins of contentbuilder (also not recently).

I think we need to clarify this in order to proceed.

However, regarding your list view issue where the images are displayed vertically:

This is definitely due to the report column taking space and there hasn't been any update in that regard in the recent past.
However, it is solvable as I mentioned before by adding some CSS to force fixed widths such that the images stay rendered horzontally.

I can add that for you if you want.

Regards,
Markus

Please Log in or Create an account to join the conversation.

Change PDF attachement name according to field 3 months 2 weeks ago #242442

  • Topic Author
  • Leni14
  • Offline
  • Senior Breezer
  • Senior Breezer
  • Posts: 129
  • Thanks: 0
Hi Markus,

thank you. The file i sent to you was regarding a different topic.

I have no yahoo email and I have no problem with "CB list view and vertical images display problem" - maybe you mixed up 2 different topics?

I think I am going to send you an email with all my problems as I think there are to many forum topics now and it can be confusing now :-)

Thank you,
Leni

Please Log in or Create an account to join the conversation.

Change PDF attachement name according to field 4 weeks 10 hours ago #247534

  • jhdesign
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 14
  • Thanks: 0
Hi Markus,

I have applied this to some of my templates.

Client is asking for the filename to not contain the timestamp, which is added when the filename already exists, so if I use FormName, first submission goes well, second, the pdf is named FormName-Timestamp

Is there an option to not store this PDF at all and send only through email?
I understand they have to be created and placed so they can be sent on the email, can it be allowed for the filename to be overriden if exists?

I know this can be done by modifying the core file, but, looking for your input as I tried to avoid this kind of modifications where possible.

Thank you!

Juan.

Please Log in or Create an account to join the conversation.

Change PDF attachement name according to field 3 weeks 6 days ago #247576

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Posts: 10063
  • Karma: 167
  • Thanks: 800
Hi,

sure, please add this in form => advanced => more options => form pieces => before form => custom:
JFactory::getSession()->set('bfFileUploadOverride', false)

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2
Moderators: ForumSupport
Time to create page: 0.052 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!