The Addons logic?

Before you ask about IDnR Addon see the VirtueMart - Invoice, Delivery Note and Receipt Addon
User avatar
akerman
Phoca Member
Phoca Member
Posts: 42
Joined: 07 Jul 2008, 18:42
Location: Sweden - Stockholm
Contact:

The Addons logic?

Post by akerman »

Hi Jan,

I don't have any issue or problem with your nice Addon. It works fine in all aspects! :D

However, I'm trying to learn how it works, or actually how the Addon, TCPDF and VM classes work together.

So, let me just state how I understand things, and then correct me where ever I'm wrong, OK?
---------------------------------------------------------------------------------------------------------------------------------
1. All logic and presentation in regards of retrieving database fields, presenting pdf icons and
creating tabs for insert,edit,delete of deliverables in admin backend - are handled in ps_delivery.php and
ps_order_delivery.php

2. The ps_delivery.php is calling the delivery.pdf.php, which in its turn utilize the parameters already set in
ps_delivery.php. delivery.pdf.php sets some basic parameters to be used later in phoca.tcpdf.pdf.

3. The delivery.pdf.php then calls phoca.tcpdf.php which does the actual placement of fields in the PDF.

.............................................................................................................................
So the things I don't understand here are:

1. Where/when is the 'printpdf' directory being called?
2. How does printpdf 'know' that it should include the phoca.tcpdf.php code in order to render PDF?

Why I'm asking is c'ause I'm trying to understand the workflow in order to insert some new fields.

Happy if you have the time to give me some pointers.
(And again, the Addon works nicely. It's just me trying to enhance my site... :wink: )

Regards
Akerman
http://www.AkermansCove.com - CMS Addons! & Royalty Free Images
http://www.InfoClip.se - Swedish site for Practical knowledge.
Ubuntu LAMP / Joomla 1.5.8 / VM 1.1.2 Stable / JoomFish / Mosets Tree
/ Joomsuite / Phoca / JoomGallery /
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49134
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: The Addons logic?

Post by Jan »

Hi,

1. the printpdf is called after clicking the link with following code:

format=printpdf&tmpl=component ... printpdf doesn't include phoca.tcpdf.php

2. phoca.tcpdf.php is called by pdf_output function which is a method of deliveryNoteAsPDF function name

So I misunderstand you in previous post, because deliveryNoteAsPDF (pdf_output function in ps_delivery.php) calls the phoca.tcpdf.php ....


Jan
If you find Phoca extensions useful, please support the project
Post Reply