TOPIC:

"Ticket ID" when submit form 1 week 1 day ago #243576

  • fragolan
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 8
  • Thanks: 0
What is happening with PDF form which is sent to user which register ticket? I used this procedure for joining text and record id, but user gets email with PDF form which does not include correct value for ID field (for example, value should be FMG-001, FMG-002...). It gets value 0 which is default value for ID field. Is there any solution for this or this is not working in my form, site.

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

Last edit: Post by fragolan. Reason: adding example

"Ticket ID" when submit form 1 week 1 day ago #243598

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Posts: 9076
  • Karma: 167
  • Thanks: 737
Hi,

the record ID should be available in your pdf_attachment.php template.
Are you using "$this->record_id" inside the PDF template to retrieve the record id or where is it coming from in your case? (you can also attach your PDF template, so I can check).

Regards,
Markus

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

"Ticket ID" when submit form 4 days 14 hours ago #243789

  • fragolan
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 8
  • Thanks: 0
This code is in my Begin Submit
$this->execPieceByName('ff_InitLib');

$db = JFactory::getDbo();
$db->setQuery("Select Max(id) From #__facileforms_records");
$next_record_id = intval($db->loadResult()) + 1;

// here we retrieve the record id and put prefix
// since this is an end submit piece, we know the record id already

$ID = $next_record_id;

// adding the text code before ID
$ID = "FMG-22" . $ID;

// here we are updating the field ID for every possible output (PDF, XML, CSV, Record Manager)
foreach($this->submitdata As $key => $data){
   if( $data[_FF_DATA_NAME] == 'ID' ) {
     $this->submitdata[$key][_FF_DATA_VALUE] = $ID;
     break; 
   }
}
foreach($this->maildata As $key => $data){
   if( $data[_FF_DATA_NAME] == 'ID' ) {
     $this->maildata[$key][_FF_DATA_VALUE] = $ID;
     break; 
   }
}
foreach($this->xmldata As $key => $data){
   if( $data[_FF_DATA_NAME] == 'ID' ) {
     $this->xmldata[$key][_FF_DATA_VALUE] = $ID;
     break; 
   }
}

This is code in End Submit
$db = JFactory::getDbo();
$ID = "FMG-22" . $this->record_id;

foreach($this->savedata As $key => $data){
   if( $data[_FF_DATA_NAME] == 'ID' ) {

     $this->savedata[$key][_FF_DATA_VALUE] = $ID;
     
     $db->setQuery("Select * From #__facileforms_subrecords Where element = " . $db->quote( $data[_FF_DATA_ID]  ) . " And record = " . $db->quote( $this->record_id ));
     
      $_subs = $db->loadObject();
      $_subrecord = new facileFormsSubrecords($db);
      $_subrecord->load($_subs->id);
      $_subrecord->value = $ID;
      $_subrecord->store();
       
     break; 
   }
}

When visitor fills form I want to send him email with PDF in which he gets TicketID which in my case is Hidden Input element with name ID and label TicketID, with default value 0. User gets PDF in which TicketID (ID) is 0, not FMG-221, FMG-222
When I as admin create PDF from Records, I get good PDF which I have to send manually to Visitor because he does not know his TicketID. Seems that value ID is not passed to the PDF attachment after creation of record in db and email doesn't get correct PDF attachment.

I didn't change default pdf_attachment.php and visitor gets id record value, but I want to have field TicketID in my PDF since we use code FMG-221 which record_id is 1.
Attachments:

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

"Ticket ID" when submit form 4 days 13 hours ago #243793

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Posts: 9076
  • Karma: 167
  • Thanks: 737
Hi,

I am a bit confused why you need the end submit piece altogether for your purpose.

I think you only need a begin submit piece if you add savedata, like this
$this->execPieceByName('ff_InitLib');

$db = JFactory::getDbo();
$db->setQuery("Select Max(id) From #__facileforms_records");
$next_record_id = intval($db->loadResult()) + 1;

// here we retrieve the record id and put prefix
// since this is an end submit piece, we know the record id already

$ID = $next_record_id;

// adding the text code before ID
$ID = "FMG-22" . $ID;

// here we are updating the field ID for every possible output (PDF, XML, CSV, Record Manager)
foreach($this->submitdata As $key => $data){
   if( $data[_FF_DATA_NAME] == 'ID' ) {
     $this->submitdata[$key][_FF_DATA_VALUE] = $ID;
     break; 
   }
}
foreach($this->maildata As $key => $data){
   if( $data[_FF_DATA_NAME] == 'ID' ) {
     $this->maildata[$key][_FF_DATA_VALUE] = $ID;
     break; 
   }
}
foreach($this->xmldata As $key => $data){
   if( $data[_FF_DATA_NAME] == 'ID' ) {
     $this->xmldata[$key][_FF_DATA_VALUE] = $ID;
     break; 
   }
}
foreach($this->savedata As $key => $data){
   if( $data[_FF_DATA_NAME] == 'ID' ) {
     $this->savedata[$key][_FF_DATA_VALUE] = $ID;
     break; 
   }
}

By this all the data is set prior the PDF being generated and sent.

Regards,
Markus

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

"Ticket ID" when submit form 3 days 21 hours ago #243833

  • fragolan
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 8
  • Thanks: 0
Well, seems that you are right, now it works perfect. I looked at the example from the user Tihomir and didn't think too much about code. Thank you very much.

Another question, maybe not for this topic, but in my form I have some upload files elements. Some visitors experienced that their files are not uploaded, and they don't get any message about problem during submit. I have validation script is flashupload_notempty. Im not sure what is happening since I personally always upload docs with success, but I watch some users which do the same thing and they did not upload files and did not get any warning message.

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

"Ticket ID" when submit form 3 days 21 hours ago #243835

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Posts: 9076
  • Karma: 167
  • Thanks: 737
Hi,

can you ask these users what browser and device they used?
If the validation isn't triggered, it usually happens on javascript error but then the entire form shouldn't submit.

But what you are saying is that the form submits, just with empty files?

Regards,
Markus

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

Moderators: ForumSupport
Time to create page: 0.054 seconds

July Sale!

Discounts for all of our extensions + support. Ending July 31st!

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!