当前位置: 首页>>代码示例>>PHP>>正文


PHP OutputDocument::generate方法代码示例

本文整理汇总了PHP中OutputDocument::generate方法的典型用法代码示例。如果您正苦于以下问题:PHP OutputDocument::generate方法的具体用法?PHP OutputDocument::generate怎么用?PHP OutputDocument::generate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OutputDocument的用法示例。


在下文中一共展示了OutputDocument::generate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: PMFGenerateOutputDocument


//.........这里部分代码省略.........
        }
    } else {
        ////No versioning so Update a current Output or Create new if no exist
        if ($aRow = $oDataset->getRow()) {
            //Update
            $aFields = array('APP_DOC_UID' => $aRow['APP_DOC_UID'], 'APP_UID' => $sApplication, 'DEL_INDEX' => $index, 'DOC_UID' => $outputID, 'DOC_VERSION' => $lastDocVersion, 'USR_UID' => $sUserLogged, 'APP_DOC_TYPE' => 'OUTPUT', 'APP_DOC_CREATE_DATE' => date('Y-m-d H:i:s'), 'APP_DOC_FILENAME' => $sFilename, 'FOLDER_UID' => $folderId, 'APP_DOC_TAGS' => $fileTags);
            $oAppDocument = new AppDocument();
            $oAppDocument->update($aFields);
            $sDocUID = $aRow['APP_DOC_UID'];
        } else {
            //we are creating the appdocument row
            //create
            if ($lastDocVersion == 0) {
                $lastDocVersion++;
            }
            $aFields = array('APP_UID' => $sApplication, 'DEL_INDEX' => $index, 'DOC_UID' => $outputID, 'DOC_VERSION' => $lastDocVersion, 'USR_UID' => $sUserLogged, 'APP_DOC_TYPE' => 'OUTPUT', 'APP_DOC_CREATE_DATE' => date('Y-m-d H:i:s'), 'APP_DOC_FILENAME' => $sFilename, 'FOLDER_UID' => $folderId, 'APP_DOC_TAGS' => $fileTags);
            $oAppDocument = new AppDocument();
            $aFields['APP_DOC_UID'] = $sDocUID = $oAppDocument->create($aFields);
        }
    }
    $sFilename = $aFields['APP_DOC_UID'] . "_" . $lastDocVersion;
    $pathOutput = PATH_DOCUMENT . G::getPathFromUID($sApplication) . PATH_SEP . 'outdocs' . PATH_SEP;
    //G::pr($sFilename);die;
    G::mk_dir($pathOutput);
    $aProperties = array();
    if (!isset($aOD['OUT_DOC_MEDIA'])) {
        $aOD['OUT_DOC_MEDIA'] = 'Letter';
    }
    if (!isset($aOD['OUT_DOC_LEFT_MARGIN'])) {
        $aOD['OUT_DOC_LEFT_MARGIN'] = '15';
    }
    if (!isset($aOD['OUT_DOC_RIGHT_MARGIN'])) {
        $aOD['OUT_DOC_RIGHT_MARGIN'] = '15';
    }
    if (!isset($aOD['OUT_DOC_TOP_MARGIN'])) {
        $aOD['OUT_DOC_TOP_MARGIN'] = '15';
    }
    if (!isset($aOD['OUT_DOC_BOTTOM_MARGIN'])) {
        $aOD['OUT_DOC_BOTTOM_MARGIN'] = '15';
    }
    $aProperties['media'] = $aOD['OUT_DOC_MEDIA'];
    $aProperties['margins'] = array('left' => $aOD['OUT_DOC_LEFT_MARGIN'], 'right' => $aOD['OUT_DOC_RIGHT_MARGIN'], 'top' => $aOD['OUT_DOC_TOP_MARGIN'], 'bottom' => $aOD['OUT_DOC_BOTTOM_MARGIN']);
    if (isset($aOD['OUT_DOC_REPORT_GENERATOR'])) {
        $aProperties['report_generator'] = $aOD['OUT_DOC_REPORT_GENERATOR'];
    }
    $oOutputDocument->generate($outputID, $Fields['APP_DATA'], $pathOutput, $sFilename, $aOD['OUT_DOC_TEMPLATE'], (bool) $aOD['OUT_DOC_LANDSCAPE'], $aOD['OUT_DOC_GENERATE'], $aProperties);
    //Plugin Hook PM_UPLOAD_DOCUMENT for upload document
    //G::LoadClass('plugin');
    $oPluginRegistry =& PMPluginRegistry::getSingleton();
    if ($oPluginRegistry->existsTrigger(PM_UPLOAD_DOCUMENT) && class_exists('uploadDocumentData')) {
        $triggerDetail = $oPluginRegistry->getTriggerInfo(PM_UPLOAD_DOCUMENT);
        $aFields['APP_DOC_PLUGIN'] = $triggerDetail->sNamespace;
        $oAppDocument1 = new AppDocument();
        $oAppDocument1->update($aFields);
        $sPathName = PATH_DOCUMENT . G::getPathFromUID($sApplication) . PATH_SEP;
        $oData['APP_UID'] = $sApplication;
        $oData['ATTACHMENT_FOLDER'] = true;
        switch ($aOD['OUT_DOC_GENERATE']) {
            case "BOTH":
                $documentData = new uploadDocumentData($sApplication, $sUserLogged, $pathOutput . $sFilename . '.pdf', $sFilename . '.pdf', $sDocUID, $oAppDocument->getDocVersion());
                $documentData->sFileType = "PDF";
                $documentData->bUseOutputFolder = true;
                $uploadReturn = $oPluginRegistry->executeTriggers(PM_UPLOAD_DOCUMENT, $documentData);
                if ($uploadReturn) {
                    //Only delete if the file was saved correctly
                    unlink($pathOutput . $sFilename . '.pdf');
                }
                $documentData = new uploadDocumentData($sApplication, $sUserLogged, $pathOutput . $sFilename . '.doc', $sFilename . '.doc', $sDocUID, $oAppDocument->getDocVersion());
                $documentData->sFileType = "DOC";
                $documentData->bUseOutputFolder = true;
                $uploadReturn = $oPluginRegistry->executeTriggers(PM_UPLOAD_DOCUMENT, $documentData);
                if ($uploadReturn) {
                    //Only delete if the file was saved correctly
                    unlink($pathOutput . $sFilename . '.doc');
                }
                break;
            case "PDF":
                $documentData = new uploadDocumentData($sApplication, $sUserLogged, $pathOutput . $sFilename . '.pdf', $sFilename . '.pdf', $sDocUID, $oAppDocument->getDocVersion());
                $documentData->sFileType = "PDF";
                $documentData->bUseOutputFolder = true;
                $uploadReturn = $oPluginRegistry->executeTriggers(PM_UPLOAD_DOCUMENT, $documentData);
                if ($uploadReturn) {
                    //Only delete if the file was saved correctly
                    unlink($pathOutput . $sFilename . '.pdf');
                }
                break;
            case "DOC":
                $documentData = new uploadDocumentData($sApplication, $sUserLogged, $pathOutput . $sFilename . '.doc', $sFilename . '.doc', $sDocUID, $oAppDocument->getDocVersion());
                $documentData->sFileType = "DOC";
                $documentData->bUseOutputFolder = true;
                $uploadReturn = $oPluginRegistry->executeTriggers(PM_UPLOAD_DOCUMENT, $documentData);
                if ($uploadReturn) {
                    //Only delete if the file was saved correctly
                    unlink($pathOutput . $sFilename . '.doc');
                }
                break;
        }
    }
    $g->sessionVarRestore();
}
开发者ID:ralpheav,项目名称:processmaker,代码行数:101,代码来源:class.pmFunctions.php

示例2: array

     }
     if (!isset($aOD['OUT_DOC_RIGHT_MARGIN'])) {
         $aOD['OUT_DOC_RIGHT_MARGIN'] = '15';
     }
     if (!isset($aOD['OUT_DOC_TOP_MARGIN'])) {
         $aOD['OUT_DOC_TOP_MARGIN'] = '15';
     }
     if (!isset($aOD['OUT_DOC_BOTTOM_MARGIN'])) {
         $aOD['OUT_DOC_BOTTOM_MARGIN'] = '15';
     }
     $aProperties['media'] = $aOD['OUT_DOC_MEDIA'];
     $aProperties['margins'] = array('left' => $aOD['OUT_DOC_LEFT_MARGIN'], 'right' => $aOD['OUT_DOC_RIGHT_MARGIN'], 'top' => $aOD['OUT_DOC_TOP_MARGIN'], 'bottom' => $aOD['OUT_DOC_BOTTOM_MARGIN']);
     if ($aOD['OUT_DOC_PDF_SECURITY_ENABLED'] == '1') {
         $aProperties['pdfSecurity'] = array('openPassword' => $aOD['OUT_DOC_PDF_SECURITY_OPEN_PASSWORD'], 'ownerPassword' => $aOD['OUT_DOC_PDF_SECURITY_OWNER_PASSWORD'], 'permissions' => $aOD['OUT_DOC_PDF_SECURITY_PERMISSIONS']);
     }
     $oOutputDocument->generate($_GET['UID'], $Fields['APP_DATA'], $pathOutput, $sFilename, $aOD['OUT_DOC_TEMPLATE'], (bool) $aOD['OUT_DOC_LANDSCAPE'], $aOD['OUT_DOC_GENERATE'], $aProperties);
     //$sFilename, $aOD['OUT_DOC_TEMPLATE'], (boolean)$aOD['OUT_DOC_LANDSCAPE'], $aOD['OUT_DOC_GENERATE'] );
     break;
 case 'JRXML':
     //creating the xml with the application data;
     $xmlData = "<dynaform>\n";
     foreach ($Fields['APP_DATA'] as $key => $val) {
         $xmlData .= "  <{$key}>{$val}</{$key}>\n";
     }
     $xmlData .= "</dynaform>\n";
     $iSize = file_put_contents($javaOutput . 'addressBook.xml', $xmlData);
     G::LoadClass('javaBridgePM');
     $JBPM = new JavaBridgePM();
     $JBPM->checkJavaExtension();
     $util = new Java("com.processmaker.util.pmutils");
     $util->setInputPath($javaInput);
开发者ID:rodriquelca,项目名称:processmaker,代码行数:31,代码来源:cases_Step.php

示例3: AppDocument

if (sizeof($CheckDocuments1) == 0) {
    $oAppDocument = new AppDocument();
    $lastDocVersion = $oAppDocument->getLastDocVersion($uidOuput, $appuid);
    $oCriteria = new Criteria('workflow');
    $oCriteria->add(AppDocumentPeer::APP_UID, $appuid);
    $oCriteria->add(AppDocumentPeer::DOC_UID, $uidOuput);
    $oCriteria->add(AppDocumentPeer::DOC_VERSION, $lastDocVersion);
    $oCriteria->add(AppDocumentPeer::APP_DOC_TYPE, 'OUTPUT');
    $oDataset = AppDocumentPeer::doSelectRS($oCriteria);
    $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
    $oDataset->next();
    $aFields = array('APP_UID' => $appuid, 'DEL_INDEX' => $index, 'DOC_UID' => $uidOuput, 'DOC_VERSION' => $lastDocVersion + 1, 'USR_UID' => $_SESSION['USER_LOGGED'], 'APP_DOC_TYPE' => 'OUTPUT', 'APP_DOC_CREATE_DATE' => date('Y-m-d H:i:s'), 'APP_DOC_FILENAME' => $sFilename, 'FOLDER_UID' => '', 'APP_DOC_TAGS' => '');
    $oAppDocument = new AppDocument();
    $oAppDocument->create($aFields);
}
$Generated = $oOutputDocument->generate($uidOuput, $DataOutPutDoc, $pathOutput, $sFilename, $aOD['OUT_DOC_TEMPLATE'], (bool) $aOD['OUT_DOC_LANDSCAPE'], $aOD['OUT_DOC_GENERATE'], $aProperties);
//$templateHTML=G::replaceDataField ( $aOD ['OUT_DOC_TEMPLATE'],$APP_DATA );
$templateHTML = G::replaceDataField($aOD['OUT_DOC_TEMPLATE'], $APP_DATA);
$fileNamePDF = G::replaceDataField($aOD['OUT_DOC_FILENAME'], $APP_DATA);
########################################################################################################################################################
if (ini_get("pcre.backtrack_limit") < 1000000) {
    ini_set("pcre.backtrack_limit", 1000000);
}
if (ini_get("memory_limit") < 256) {
    //ini_set ( 'memory_limit', '512M' );
    ini_set('memory_limit', '-1');
}
@set_time_limit(10000);
class MYPDF extends TCPDF
{
    //Page header
开发者ID:rme,项目名称:er2,代码行数:31,代码来源:GenerateExpenseReport2.php


注:本文中的OutputDocument::generate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。