PDF Templates for AOS Contracts

I’ve got the same issue as several other posts in making the ā€œGenerate Letterā€ option for pdf templates available in Contracts and other custom modules. i’ve read the topics and have no idea what steps to take to insert ā€˜require_once(ā€˜modules/AOS_PDF_Templates/formLetter.php’);’. There is not a view.detail.php for contracts or any of my custom modules and this directory doesn’t exist: /custom/modules//views/view.detail.php for any custom module.

Please help clear my confusion…

Hi dgreene,

Have you tried creating the view.detail.php and adding the following:

<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');

require_once('include/MVC/View/views/view.detail.php');

class YourmoduleViewDetail extends ViewDetail {
require_once('modules/AOS_PDF_Templates/formLetter.php');
formLetter::DVPopupHtml('yourcustommodule');
}

Thanks,

Will.

What else needs to be in that file?

I created the file and only included the text you provided and my view for that module will not load. Obviously i’m missing something.

Hi dgreene,

Is there a standard detail view for the module? Can you base the custom detail view from that?

Thanks,

Will.

Ok, to clarify - i’m trying to get this to work with AOS_Contracts - which is SalesAgility’s module. As I indicated earlier, There is not a view.detail.php for contracts or any of my custom modules and this directory doesn’t exist: /custom/modules//views/view.detail.php for any custom module.

Forgive me, i’m not a programmer - I’m just trying to get this working as simply as possible.

Hi I have made this work with the following code ;

require_once(ā€˜modules/CustomModule/views/view.detail.php’);

class CUstomModuleViewDetail extends ViewDetail{
public function display(){
global $sugar_config;

    $aop_portal_enabled = !empty($sugar_config['aop']['enable_portal']);

    $this->ss->assign("AOP_PORTAL_ENABLED", $aop_portal_enabled);

    require_once('modules/AOS_PDF_Templates/formLetter.php');
    formLetter::DVPopupHtml('CustomModule');

    parent::display();
}

}

The PopUp come up with the list of templates however when I click to create the template I get the following error :

Fatal error: Class ā€˜CustomModule’ not found in
…\modules\AOS_PDF_Templates\formLetterPdf.php on line 39

Any idea of what needs to be done ?