Add php files
This commit is contained in:
34
include/ECM/EcmSendPdfButton/EcmSendPdfButtonController.php
Executable file
34
include/ECM/EcmSendPdfButton/EcmSendPdfButtonController.php
Executable file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
require_once 'include/ECM/EcmSendPdfButton/EcmSendPdfButton.inc';
|
||||
|
||||
class EcmSendPdfButtonController
|
||||
{
|
||||
|
||||
public function renderButtom ($module, $id)
|
||||
{
|
||||
$t = new EcmSendPdfButton($module, $id);
|
||||
echo $t->showButtom();
|
||||
}
|
||||
|
||||
public function sendEmailAjaxWithDocument ($module, $id,$adress,$text,$pdf_opt)
|
||||
{
|
||||
$t = new EcmSendPdfButton($module, $id,$adress);
|
||||
$t->generatePdf($pdf_opt);
|
||||
$t->setAdress($adress);
|
||||
$EcmSysInfo = new EcmSysInfo();
|
||||
|
||||
$t->setSubject('Dokument od '.$EcmSysInfo->getShortName());
|
||||
//$t->setSubject($pdf_opt);
|
||||
$t->setBody($text);
|
||||
$t->setAttachment();
|
||||
return $t->sendEmail();
|
||||
}
|
||||
}
|
||||
|
||||
switch ($_REQUEST['action']){
|
||||
|
||||
case 'DetailView':
|
||||
$c=new EcmSendPdfButtonController();
|
||||
$c->renderButtom ($_REQUEST['module'], $_REQUEST['record']);
|
||||
break;
|
||||
}
|
||||
Reference in New Issue
Block a user