BUG 7344 Feature -> PDF Security settings

With this settings is possible to setup security for a PDF generated (Output Document).
In Output Document setup there is a new section available when the output document is either PDF or BOTH with the following fields:
Permissions: Must select wich permissions will be granted (if none is selected only VIEW is allowed)
Open Password: Is the password requested to open the document. (This open the document with selected permissions)
Owner Password: Is the password that allow owner to open and change permissions
This commit is contained in:
Hugo Loza
2011-07-29 17:46:22 -04:00
parent b47d9fa01e
commit daf7ac09b1
16 changed files with 844 additions and 258 deletions

View File

@@ -15,6 +15,7 @@ class Media {
var $size;
var $pixels;
var $is_landscape;
var $security;
function width() {
return $this->is_landscape ? $this->size['height'] : $this->size['width'] ;
@@ -32,6 +33,20 @@ class Media {
return $this->height() - $this->margins['bottom'] - $this->margins['top'];
}
function getSecurityOpenPassword(){
return $this->security['openPassword'];
}
function getSecurityOwnerPassword(){
return $this->security['ownerPassword'];
}
function getSecurityPermissions(){
$permissions=explode("|",$this->security['permissions']);
foreach($permissions as $key => $permName){
if($permName=="") unset($permissions[$key]);
}
return $this->security['permissions'];
}
function set_landscape($state) {
$this->is_landscape = (bool)$state;
}
@@ -45,6 +60,10 @@ class Media {
$this->pixels = $pixels;
}
function set_security($security) {
$this->security = $security;
}
// TODO: validity checking
function &predefined($name) {
global $g_predefined_media;

View File

@@ -3,6 +3,7 @@
require_once(HTML2PS_DIR.'pdf.fpdf.php');
require_once(HTML2PS_DIR.'pdf.fpdf.makefont.php');
require_once(HTML2PS_DIR.'pdf.fpdf.encryption.php');
// require_once(HTML2PS_DIR.'fpdf/font/makefont/makefont.php');
class OutputDriverFPDF extends OutputDriverGenericPDF {
@@ -333,8 +334,13 @@ class OutputDriverFPDF extends OutputDriverGenericPDF {
function reset(&$media) {
parent::reset($media);
$this->pdf =& new FPDF("P","pt",array(mm2pt($media->width()), mm2pt($media->height())));
if (is_array($media->security)){
$this->pdf =& new FPDF_Protection('P','pt',array(mm2pt($media->width()), mm2pt($media->height())));
//Set Protection
$this->pdf->SetProtection($media->getSecurityPermissions(),$media->getSecurityOpenPassword(),$media->getSecurityOwnerPassword());
}else{
$this->pdf =& new FPDF('P','pt',array(mm2pt($media->width()), mm2pt($media->height())));
}
if (defined('DEBUG_MODE')) {
$this->pdf->SetCompression(false);

View File

@@ -227,7 +227,7 @@ class PCLPrintJobPreamble {
}
class PCLPrintJobPage {
var $_control
var $_control;
var $_data;
function output(&$stream) {

View File

@@ -0,0 +1,222 @@
<?php
/****************************************************************************
* Software: FPDF_Protection *
* Version: 1.02 *
* Date: 2005/05/08 *
* Author: Klemen VODOPIVEC *
* License: Freeware *
* *
* You may use and modify this software as you wish as stated in original *
* FPDF package. *
* *
* Thanks: Cpdf (http://www.ros.co.nz/pdf) was my working sample of how to *
* implement protection in pdf. *
****************************************************************************/
//require('fpdf.php');
require_once(HTML2PS_DIR.'pdf.fpdf.php');
class FPDF_Protection extends FPDF
{
var $encrypted; //whether document is protected
var $Uvalue; //U entry in pdf document
var $Ovalue; //O entry in pdf document
var $Pvalue; //P entry in pdf document
var $enc_obj_id; //encryption object id
var $last_rc4_key; //last RC4 key encrypted (cached for optimisation)
var $last_rc4_key_c; //last RC4 computed key
function FPDF_Protection($orientation='P', $unit='mm', $format='A4')
{
parent::FPDF($orientation, $unit, $format);
$this->encrypted=false;
$this->last_rc4_key='';
$this->padding="\x28\xBF\x4E\x5E\x4E\x75\x8A\x41\x64\x00\x4E\x56\xFF\xFA\x01\x08".
"\x2E\x2E\x00\xB6\xD0\x68\x3E\x80\x2F\x0C\xA9\xFE\x64\x53\x69\x7A";
}
/**
* Function to set permissions as well as user and owner passwords
*
* - permissions is an array with values taken from the following list:
* copy, print, modify, annot-forms
* If a value is present it means that the permission is granted
* - If a user password is set, user will be prompted before document is opened
* - If an owner password is set, document can be opened in privilege mode with no
* restriction if that password is entered
*/
function SetProtection($permissions=array(), $user_pass='', $owner_pass=null)
{
$options = array('print' => 4, 'modify' => 8, 'copy' => 16, 'annot-forms' => 32 );
$protection = 192;
foreach($permissions as $permission){
if (!isset($options[$permission]))
$this->Error('Incorrect permission: '.$permission);
$protection += $options[$permission];
}
if ($owner_pass === null)
$owner_pass = uniqid(rand());
$this->encrypted = true;
$this->_generateencryptionkey($user_pass, $owner_pass, $protection);
}
/****************************************************************************
* *
* Private methods *
* *
****************************************************************************/
function _putstream($s)
{
if ($this->encrypted) {
$s = $this->_RC4($this->_objectkey($this->n), $s);
}
parent::_putstream($s);
}
function _textstring($s)
{
if ($this->encrypted) {
$s = $this->_RC4($this->_objectkey($this->n), $s);
}
return parent::_textstring($s);
}
/**
* Compute key depending on object number where the encrypted data is stored
*/
function _objectkey($n)
{
return substr($this->_md5_16($this->encryption_key.pack('VXxx', $n)), 0, 10);
}
/**
* Escape special characters
*/
function _escape($s)
{
$s=str_replace('\\', '\\\\', $s);
$s=str_replace(')', '\\)', $s);
$s=str_replace('(', '\\(', $s);
$s=str_replace("\r", '\\r', $s);
return $s;
}
function _putresources()
{
parent::_putresources();
if ($this->encrypted) {
$this->_newobj();
$this->enc_obj_id = $this->n;
$this->_out('<<');
$this->_putencryption();
$this->_out('>>');
$this->_out('endobj');
}
}
function _putencryption()
{
$this->_out('/Filter /Standard');
$this->_out('/V 1');
$this->_out('/R 2');
$this->_out('/O ('.$this->_escape($this->Ovalue).')');
$this->_out('/U ('.$this->_escape($this->Uvalue).')');
$this->_out('/P '.$this->Pvalue);
}
function _puttrailer()
{
parent::_puttrailer();
if ($this->encrypted) {
$this->_out('/Encrypt '.$this->enc_obj_id.' 0 R');
$this->_out('/ID [()()]');
}
}
/**
* RC4 is the standard encryption algorithm used in PDF format
*/
function _RC4($key, $text)
{
if ($this->last_rc4_key != $key) {
$k = str_repeat($key, 256/strlen($key)+1);
$rc4 = range(0, 255);
$j = 0;
for ($i=0; $i<256; $i++){
$t = $rc4[$i];
$j = ($j + $t + ord($k{$i})) % 256;
$rc4[$i] = $rc4[$j];
$rc4[$j] = $t;
}
$this->last_rc4_key = $key;
$this->last_rc4_key_c = $rc4;
} else {
$rc4 = $this->last_rc4_key_c;
}
$len = strlen($text);
$a = 0;
$b = 0;
$out = '';
for ($i=0; $i<$len; $i++){
$a = ($a+1)%256;
$t= $rc4[$a];
$b = ($b+$t)%256;
$rc4[$a] = $rc4[$b];
$rc4[$b] = $t;
$k = $rc4[($rc4[$a]+$rc4[$b])%256];
$out.=chr(ord($text{$i}) ^ $k);
}
return $out;
}
/**
* Get MD5 as binary string
*/
function _md5_16($string)
{
return pack('H*', md5($string));
}
/**
* Compute O value
*/
function _Ovalue($user_pass, $owner_pass)
{
$tmp = $this->_md5_16($owner_pass);
$owner_RC4_key = substr($tmp, 0, 5);
return $this->_RC4($owner_RC4_key, $user_pass);
}
/**
* Compute U value
*/
function _Uvalue()
{
return $this->_RC4($this->encryption_key, $this->padding);
}
/**
* Compute encryption key
*/
function _generateencryptionkey($user_pass, $owner_pass, $protection)
{
// Pad passwords
$user_pass = substr($user_pass.$this->padding, 0, 32);
$owner_pass = substr($owner_pass.$this->padding, 0, 32);
// Compute O value
$this->Ovalue = $this->_Ovalue($user_pass, $owner_pass);
// Compute encyption key
$tmp = $this->_md5_16($user_pass.$this->Ovalue.chr($protection)."\xFF\xFF\xFF");
$this->encryption_key = substr($tmp, 0, 5);
// Compute U value
$this->Uvalue = $this->_Uvalue();
// Compute P value
$this->Pvalue = -(($protection^255)+1);
}
}
?>

View File

@@ -618,6 +618,20 @@ class OutputDocument extends BaseOutputDocument {
$g_media->set_landscape($GLOBALS['g_config']['landscape']);
$g_media->set_margins($GLOBALS['g_config']['margins']);
$g_media->set_pixels($GLOBALS['g_config']['pagewidth']);
if(isset($GLOBALS['g_config']['pdfSecurity'])){
if (isset($GLOBALS['g_config']['pdfSecurity']['openPassword']) && $GLOBALS['g_config']['pdfSecurity']['openPassword'] != "") {
$GLOBALS['g_config']['pdfSecurity']['openPassword'] = G::decrypt($GLOBALS['g_config']['pdfSecurity']['openPassword'], $sUID);
}
if (isset($GLOBALS['g_config']['pdfSecurity']['ownerPassword']) && $GLOBALS['g_config']['pdfSecurity']['ownerPassword'] != "") {
$GLOBALS['g_config']['pdfSecurity']['ownerPassword'] = G::decrypt($GLOBALS['g_config']['pdfSecurity']['ownerPassword'], $sUID);
}
$g_media->set_security($GLOBALS['g_config']['pdfSecurity']);
require_once(HTML2PS_DIR . 'pdf.fpdf.encryption.php');
}
$pipeline = new Pipeline();
if (extension_loaded('curl'))
{

View File

@@ -94,6 +94,14 @@ class OutputDocumentMapBuilder {
$tMap->addColumn('OUT_DOC_TAGS', 'OutDocTags', 'string', CreoleTypes::LONGVARCHAR, false, null);
$tMap->addColumn('OUT_DOC_PDF_SECURITY_ENABLED', 'OutDocPdfSecurityEnabled', 'int', CreoleTypes::TINYINT, false, null);
$tMap->addColumn('OUT_DOC_PDF_SECURITY_OPEN_PASSWORD', 'OutDocPdfSecurityOpenPassword', 'string', CreoleTypes::VARCHAR, false, 32);
$tMap->addColumn('OUT_DOC_PDF_SECURITY_OWNER_PASSWORD', 'OutDocPdfSecurityOwnerPassword', 'string', CreoleTypes::VARCHAR, false, 32);
$tMap->addColumn('OUT_DOC_PDF_SECURITY_PERMISSIONS', 'OutDocPdfSecurityPermissions', 'string', CreoleTypes::VARCHAR, false, 150);
$tMap->addValidator('OUT_DOC_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Output Document UID can be no larger than 32 in size');
$tMap->addValidator('OUT_DOC_UID', 'required', 'propel.validator.RequiredValidator', '', 'Output Document UID is required.');

View File

@@ -573,43 +573,6 @@ abstract class BaseAppNotes extends BaseObject implements Persistent {
}
}
/**
* @todo This function must be moved to Propel Generator in the correct syntax.
*/
public function createFromArray($aData, $con = null, $sw=true)
{
if ($con === null) {
$con = Propel::getConnection(AppNotesPeer::DATABASE_NAME);
}
if ($sw) $con->begin();
try {
$this->fromArray ( $aData, BasePeer::TYPE_FIELDNAME );
if ($this->validate ()) {
$result = $this->save ($con, $sw);
} else {
if ($sw) $con->rollback ();
$e = new Exception ( "Failed Validation in class " . get_class ( $this ) . "." );
$e->aValidationFailures = $this->getValidationFailures ();
throw ($e);
}
if ($sw) $con->commit ();
return $result;
} catch ( Exception $e ) {
if ($sw) $con->rollback ();
throw ($e);
}
}
/**
* @todo This function must be moved to Propel Generator in the correct syntax.
*/
public function updateFromArray($aData, $con = null, $sw = true)
{
return 0;
}
/**
* Stores the object in the database.
*

View File

@@ -132,6 +132,34 @@ abstract class BaseOutputDocument extends BaseObject implements Persistent {
*/
protected $out_doc_tags;
/**
* The value for the out_doc_pdf_security_enabled field.
* @var int
*/
protected $out_doc_pdf_security_enabled = 0;
/**
* The value for the out_doc_pdf_security_open_password field.
* @var string
*/
protected $out_doc_pdf_security_open_password = '';
/**
* The value for the out_doc_pdf_security_owner_password field.
* @var string
*/
protected $out_doc_pdf_security_owner_password = '';
/**
* The value for the out_doc_pdf_security_permissions field.
* @var string
*/
protected $out_doc_pdf_security_permissions = '';
/**
* Flag to prevent endless save loop, if this object is referenced
* by another object which falls in this transaction.
@@ -311,6 +339,50 @@ abstract class BaseOutputDocument extends BaseObject implements Persistent {
return $this->out_doc_tags;
}
/**
* Get the [out_doc_pdf_security_enabled] column value.
*
* @return int
*/
public function getOutDocPdfSecurityEnabled()
{
return $this->out_doc_pdf_security_enabled;
}
/**
* Get the [out_doc_pdf_security_open_password] column value.
*
* @return string
*/
public function getOutDocPdfSecurityOpenPassword()
{
return $this->out_doc_pdf_security_open_password;
}
/**
* Get the [out_doc_pdf_security_owner_password] column value.
*
* @return string
*/
public function getOutDocPdfSecurityOwnerPassword()
{
return $this->out_doc_pdf_security_owner_password;
}
/**
* Get the [out_doc_pdf_security_permissions] column value.
*
* @return string
*/
public function getOutDocPdfSecurityPermissions()
{
return $this->out_doc_pdf_security_permissions;
}
/**
* Set the value of [out_doc_uid] column.
*
@@ -641,6 +713,94 @@ abstract class BaseOutputDocument extends BaseObject implements Persistent {
} // setOutDocTags()
/**
* Set the value of [out_doc_pdf_security_enabled] column.
*
* @param int $v new value
* @return void
*/
public function setOutDocPdfSecurityEnabled($v)
{
// Since the native PHP type for this column is integer,
// we will cast the input value to an int (if it is not).
if ($v !== null && !is_int($v) && is_numeric($v)) {
$v = (int) $v;
}
if ($this->out_doc_pdf_security_enabled !== $v || $v === 0) {
$this->out_doc_pdf_security_enabled = $v;
$this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_PDF_SECURITY_ENABLED;
}
} // setOutDocPdfSecurityEnabled()
/**
* Set the value of [out_doc_pdf_security_open_password] column.
*
* @param string $v new value
* @return void
*/
public function setOutDocPdfSecurityOpenPassword($v)
{
// Since the native PHP type for this column is string,
// we will cast the input to a string (if it is not).
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->out_doc_pdf_security_open_password !== $v || $v === '') {
$this->out_doc_pdf_security_open_password = $v;
$this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OPEN_PASSWORD;
}
} // setOutDocPdfSecurityOpenPassword()
/**
* Set the value of [out_doc_pdf_security_owner_password] column.
*
* @param string $v new value
* @return void
*/
public function setOutDocPdfSecurityOwnerPassword($v)
{
// Since the native PHP type for this column is string,
// we will cast the input to a string (if it is not).
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->out_doc_pdf_security_owner_password !== $v || $v === '') {
$this->out_doc_pdf_security_owner_password = $v;
$this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OWNER_PASSWORD;
}
} // setOutDocPdfSecurityOwnerPassword()
/**
* Set the value of [out_doc_pdf_security_permissions] column.
*
* @param string $v new value
* @return void
*/
public function setOutDocPdfSecurityPermissions($v)
{
// Since the native PHP type for this column is string,
// we will cast the input to a string (if it is not).
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->out_doc_pdf_security_permissions !== $v || $v === '') {
$this->out_doc_pdf_security_permissions = $v;
$this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_PDF_SECURITY_PERMISSIONS;
}
} // setOutDocPdfSecurityPermissions()
/**
* Hydrates (populates) the object variables with values from the database resultset.
*
@@ -688,12 +848,20 @@ abstract class BaseOutputDocument extends BaseObject implements Persistent {
$this->out_doc_tags = $rs->getString($startcol + 14);
$this->out_doc_pdf_security_enabled = $rs->getInt($startcol + 15);
$this->out_doc_pdf_security_open_password = $rs->getString($startcol + 16);
$this->out_doc_pdf_security_owner_password = $rs->getString($startcol + 17);
$this->out_doc_pdf_security_permissions = $rs->getString($startcol + 18);
$this->resetModified();
$this->setNew(false);
// FIXME - using NUM_COLUMNS may be clearer.
return $startcol + 15; // 15 = OutputDocumentPeer::NUM_COLUMNS - OutputDocumentPeer::NUM_LAZY_LOAD_COLUMNS).
return $startcol + 19; // 19 = OutputDocumentPeer::NUM_COLUMNS - OutputDocumentPeer::NUM_LAZY_LOAD_COLUMNS).
} catch (Exception $e) {
throw new PropelException("Error populating OutputDocument object", $e);
@@ -941,6 +1109,18 @@ abstract class BaseOutputDocument extends BaseObject implements Persistent {
case 14:
return $this->getOutDocTags();
break;
case 15:
return $this->getOutDocPdfSecurityEnabled();
break;
case 16:
return $this->getOutDocPdfSecurityOpenPassword();
break;
case 17:
return $this->getOutDocPdfSecurityOwnerPassword();
break;
case 18:
return $this->getOutDocPdfSecurityPermissions();
break;
default:
return null;
break;
@@ -976,6 +1156,10 @@ abstract class BaseOutputDocument extends BaseObject implements Persistent {
$keys[12] => $this->getOutDocVersioning(),
$keys[13] => $this->getOutDocDestinationPath(),
$keys[14] => $this->getOutDocTags(),
$keys[15] => $this->getOutDocPdfSecurityEnabled(),
$keys[16] => $this->getOutDocPdfSecurityOpenPassword(),
$keys[17] => $this->getOutDocPdfSecurityOwnerPassword(),
$keys[18] => $this->getOutDocPdfSecurityPermissions(),
);
return $result;
}
@@ -1052,6 +1236,18 @@ abstract class BaseOutputDocument extends BaseObject implements Persistent {
case 14:
$this->setOutDocTags($value);
break;
case 15:
$this->setOutDocPdfSecurityEnabled($value);
break;
case 16:
$this->setOutDocPdfSecurityOpenPassword($value);
break;
case 17:
$this->setOutDocPdfSecurityOwnerPassword($value);
break;
case 18:
$this->setOutDocPdfSecurityPermissions($value);
break;
} // switch()
}
@@ -1090,6 +1286,10 @@ abstract class BaseOutputDocument extends BaseObject implements Persistent {
if (array_key_exists($keys[12], $arr)) $this->setOutDocVersioning($arr[$keys[12]]);
if (array_key_exists($keys[13], $arr)) $this->setOutDocDestinationPath($arr[$keys[13]]);
if (array_key_exists($keys[14], $arr)) $this->setOutDocTags($arr[$keys[14]]);
if (array_key_exists($keys[15], $arr)) $this->setOutDocPdfSecurityEnabled($arr[$keys[15]]);
if (array_key_exists($keys[16], $arr)) $this->setOutDocPdfSecurityOpenPassword($arr[$keys[16]]);
if (array_key_exists($keys[17], $arr)) $this->setOutDocPdfSecurityOwnerPassword($arr[$keys[17]]);
if (array_key_exists($keys[18], $arr)) $this->setOutDocPdfSecurityPermissions($arr[$keys[18]]);
}
/**
@@ -1116,6 +1316,10 @@ abstract class BaseOutputDocument extends BaseObject implements Persistent {
if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_VERSIONING)) $criteria->add(OutputDocumentPeer::OUT_DOC_VERSIONING, $this->out_doc_versioning);
if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_DESTINATION_PATH)) $criteria->add(OutputDocumentPeer::OUT_DOC_DESTINATION_PATH, $this->out_doc_destination_path);
if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_TAGS)) $criteria->add(OutputDocumentPeer::OUT_DOC_TAGS, $this->out_doc_tags);
if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_PDF_SECURITY_ENABLED)) $criteria->add(OutputDocumentPeer::OUT_DOC_PDF_SECURITY_ENABLED, $this->out_doc_pdf_security_enabled);
if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OPEN_PASSWORD)) $criteria->add(OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OPEN_PASSWORD, $this->out_doc_pdf_security_open_password);
if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OWNER_PASSWORD)) $criteria->add(OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OWNER_PASSWORD, $this->out_doc_pdf_security_owner_password);
if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_PDF_SECURITY_PERMISSIONS)) $criteria->add(OutputDocumentPeer::OUT_DOC_PDF_SECURITY_PERMISSIONS, $this->out_doc_pdf_security_permissions);
return $criteria;
}
@@ -1198,6 +1402,14 @@ abstract class BaseOutputDocument extends BaseObject implements Persistent {
$copyObj->setOutDocTags($this->out_doc_tags);
$copyObj->setOutDocPdfSecurityEnabled($this->out_doc_pdf_security_enabled);
$copyObj->setOutDocPdfSecurityOpenPassword($this->out_doc_pdf_security_open_password);
$copyObj->setOutDocPdfSecurityOwnerPassword($this->out_doc_pdf_security_owner_password);
$copyObj->setOutDocPdfSecurityPermissions($this->out_doc_pdf_security_permissions);
$copyObj->setNew(true);

View File

@@ -24,7 +24,7 @@ abstract class BaseOutputDocumentPeer {
const CLASS_DEFAULT = 'classes.model.OutputDocument';
/** The total number of columns. */
const NUM_COLUMNS = 15;
const NUM_COLUMNS = 19;
/** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0;
@@ -75,6 +75,18 @@ abstract class BaseOutputDocumentPeer {
/** the column name for the OUT_DOC_TAGS field */
const OUT_DOC_TAGS = 'OUTPUT_DOCUMENT.OUT_DOC_TAGS';
/** the column name for the OUT_DOC_PDF_SECURITY_ENABLED field */
const OUT_DOC_PDF_SECURITY_ENABLED = 'OUTPUT_DOCUMENT.OUT_DOC_PDF_SECURITY_ENABLED';
/** the column name for the OUT_DOC_PDF_SECURITY_OPEN_PASSWORD field */
const OUT_DOC_PDF_SECURITY_OPEN_PASSWORD = 'OUTPUT_DOCUMENT.OUT_DOC_PDF_SECURITY_OPEN_PASSWORD';
/** the column name for the OUT_DOC_PDF_SECURITY_OWNER_PASSWORD field */
const OUT_DOC_PDF_SECURITY_OWNER_PASSWORD = 'OUTPUT_DOCUMENT.OUT_DOC_PDF_SECURITY_OWNER_PASSWORD';
/** the column name for the OUT_DOC_PDF_SECURITY_PERMISSIONS field */
const OUT_DOC_PDF_SECURITY_PERMISSIONS = 'OUTPUT_DOCUMENT.OUT_DOC_PDF_SECURITY_PERMISSIONS';
/** The PHP to DB Name Mapping */
private static $phpNameMap = null;
@@ -86,10 +98,10 @@ abstract class BaseOutputDocumentPeer {
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('OutDocUid', 'ProUid', 'OutDocLandscape', 'OutDocMedia', 'OutDocLeftMargin', 'OutDocRightMargin', 'OutDocTopMargin', 'OutDocBottomMargin', 'OutDocGenerate', 'OutDocType', 'OutDocCurrentRevision', 'OutDocFieldMapping', 'OutDocVersioning', 'OutDocDestinationPath', 'OutDocTags', ),
BasePeer::TYPE_COLNAME => array (OutputDocumentPeer::OUT_DOC_UID, OutputDocumentPeer::PRO_UID, OutputDocumentPeer::OUT_DOC_LANDSCAPE, OutputDocumentPeer::OUT_DOC_MEDIA, OutputDocumentPeer::OUT_DOC_LEFT_MARGIN, OutputDocumentPeer::OUT_DOC_RIGHT_MARGIN, OutputDocumentPeer::OUT_DOC_TOP_MARGIN, OutputDocumentPeer::OUT_DOC_BOTTOM_MARGIN, OutputDocumentPeer::OUT_DOC_GENERATE, OutputDocumentPeer::OUT_DOC_TYPE, OutputDocumentPeer::OUT_DOC_CURRENT_REVISION, OutputDocumentPeer::OUT_DOC_FIELD_MAPPING, OutputDocumentPeer::OUT_DOC_VERSIONING, OutputDocumentPeer::OUT_DOC_DESTINATION_PATH, OutputDocumentPeer::OUT_DOC_TAGS, ),
BasePeer::TYPE_FIELDNAME => array ('OUT_DOC_UID', 'PRO_UID', 'OUT_DOC_LANDSCAPE', 'OUT_DOC_MEDIA', 'OUT_DOC_LEFT_MARGIN', 'OUT_DOC_RIGHT_MARGIN', 'OUT_DOC_TOP_MARGIN', 'OUT_DOC_BOTTOM_MARGIN', 'OUT_DOC_GENERATE', 'OUT_DOC_TYPE', 'OUT_DOC_CURRENT_REVISION', 'OUT_DOC_FIELD_MAPPING', 'OUT_DOC_VERSIONING', 'OUT_DOC_DESTINATION_PATH', 'OUT_DOC_TAGS', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, )
BasePeer::TYPE_PHPNAME => array ('OutDocUid', 'ProUid', 'OutDocLandscape', 'OutDocMedia', 'OutDocLeftMargin', 'OutDocRightMargin', 'OutDocTopMargin', 'OutDocBottomMargin', 'OutDocGenerate', 'OutDocType', 'OutDocCurrentRevision', 'OutDocFieldMapping', 'OutDocVersioning', 'OutDocDestinationPath', 'OutDocTags', 'OutDocPdfSecurityEnabled', 'OutDocPdfSecurityOpenPassword', 'OutDocPdfSecurityOwnerPassword', 'OutDocPdfSecurityPermissions', ),
BasePeer::TYPE_COLNAME => array (OutputDocumentPeer::OUT_DOC_UID, OutputDocumentPeer::PRO_UID, OutputDocumentPeer::OUT_DOC_LANDSCAPE, OutputDocumentPeer::OUT_DOC_MEDIA, OutputDocumentPeer::OUT_DOC_LEFT_MARGIN, OutputDocumentPeer::OUT_DOC_RIGHT_MARGIN, OutputDocumentPeer::OUT_DOC_TOP_MARGIN, OutputDocumentPeer::OUT_DOC_BOTTOM_MARGIN, OutputDocumentPeer::OUT_DOC_GENERATE, OutputDocumentPeer::OUT_DOC_TYPE, OutputDocumentPeer::OUT_DOC_CURRENT_REVISION, OutputDocumentPeer::OUT_DOC_FIELD_MAPPING, OutputDocumentPeer::OUT_DOC_VERSIONING, OutputDocumentPeer::OUT_DOC_DESTINATION_PATH, OutputDocumentPeer::OUT_DOC_TAGS, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_ENABLED, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OPEN_PASSWORD, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OWNER_PASSWORD, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_PERMISSIONS, ),
BasePeer::TYPE_FIELDNAME => array ('OUT_DOC_UID', 'PRO_UID', 'OUT_DOC_LANDSCAPE', 'OUT_DOC_MEDIA', 'OUT_DOC_LEFT_MARGIN', 'OUT_DOC_RIGHT_MARGIN', 'OUT_DOC_TOP_MARGIN', 'OUT_DOC_BOTTOM_MARGIN', 'OUT_DOC_GENERATE', 'OUT_DOC_TYPE', 'OUT_DOC_CURRENT_REVISION', 'OUT_DOC_FIELD_MAPPING', 'OUT_DOC_VERSIONING', 'OUT_DOC_DESTINATION_PATH', 'OUT_DOC_TAGS', 'OUT_DOC_PDF_SECURITY_ENABLED', 'OUT_DOC_PDF_SECURITY_OPEN_PASSWORD', 'OUT_DOC_PDF_SECURITY_OWNER_PASSWORD', 'OUT_DOC_PDF_SECURITY_PERMISSIONS', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, )
);
/**
@@ -99,10 +111,10 @@ abstract class BaseOutputDocumentPeer {
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('OutDocUid' => 0, 'ProUid' => 1, 'OutDocLandscape' => 2, 'OutDocMedia' => 3, 'OutDocLeftMargin' => 4, 'OutDocRightMargin' => 5, 'OutDocTopMargin' => 6, 'OutDocBottomMargin' => 7, 'OutDocGenerate' => 8, 'OutDocType' => 9, 'OutDocCurrentRevision' => 10, 'OutDocFieldMapping' => 11, 'OutDocVersioning' => 12, 'OutDocDestinationPath' => 13, 'OutDocTags' => 14, ),
BasePeer::TYPE_COLNAME => array (OutputDocumentPeer::OUT_DOC_UID => 0, OutputDocumentPeer::PRO_UID => 1, OutputDocumentPeer::OUT_DOC_LANDSCAPE => 2, OutputDocumentPeer::OUT_DOC_MEDIA => 3, OutputDocumentPeer::OUT_DOC_LEFT_MARGIN => 4, OutputDocumentPeer::OUT_DOC_RIGHT_MARGIN => 5, OutputDocumentPeer::OUT_DOC_TOP_MARGIN => 6, OutputDocumentPeer::OUT_DOC_BOTTOM_MARGIN => 7, OutputDocumentPeer::OUT_DOC_GENERATE => 8, OutputDocumentPeer::OUT_DOC_TYPE => 9, OutputDocumentPeer::OUT_DOC_CURRENT_REVISION => 10, OutputDocumentPeer::OUT_DOC_FIELD_MAPPING => 11, OutputDocumentPeer::OUT_DOC_VERSIONING => 12, OutputDocumentPeer::OUT_DOC_DESTINATION_PATH => 13, OutputDocumentPeer::OUT_DOC_TAGS => 14, ),
BasePeer::TYPE_FIELDNAME => array ('OUT_DOC_UID' => 0, 'PRO_UID' => 1, 'OUT_DOC_LANDSCAPE' => 2, 'OUT_DOC_MEDIA' => 3, 'OUT_DOC_LEFT_MARGIN' => 4, 'OUT_DOC_RIGHT_MARGIN' => 5, 'OUT_DOC_TOP_MARGIN' => 6, 'OUT_DOC_BOTTOM_MARGIN' => 7, 'OUT_DOC_GENERATE' => 8, 'OUT_DOC_TYPE' => 9, 'OUT_DOC_CURRENT_REVISION' => 10, 'OUT_DOC_FIELD_MAPPING' => 11, 'OUT_DOC_VERSIONING' => 12, 'OUT_DOC_DESTINATION_PATH' => 13, 'OUT_DOC_TAGS' => 14, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, )
BasePeer::TYPE_PHPNAME => array ('OutDocUid' => 0, 'ProUid' => 1, 'OutDocLandscape' => 2, 'OutDocMedia' => 3, 'OutDocLeftMargin' => 4, 'OutDocRightMargin' => 5, 'OutDocTopMargin' => 6, 'OutDocBottomMargin' => 7, 'OutDocGenerate' => 8, 'OutDocType' => 9, 'OutDocCurrentRevision' => 10, 'OutDocFieldMapping' => 11, 'OutDocVersioning' => 12, 'OutDocDestinationPath' => 13, 'OutDocTags' => 14, 'OutDocPdfSecurityEnabled' => 15, 'OutDocPdfSecurityOpenPassword' => 16, 'OutDocPdfSecurityOwnerPassword' => 17, 'OutDocPdfSecurityPermissions' => 18, ),
BasePeer::TYPE_COLNAME => array (OutputDocumentPeer::OUT_DOC_UID => 0, OutputDocumentPeer::PRO_UID => 1, OutputDocumentPeer::OUT_DOC_LANDSCAPE => 2, OutputDocumentPeer::OUT_DOC_MEDIA => 3, OutputDocumentPeer::OUT_DOC_LEFT_MARGIN => 4, OutputDocumentPeer::OUT_DOC_RIGHT_MARGIN => 5, OutputDocumentPeer::OUT_DOC_TOP_MARGIN => 6, OutputDocumentPeer::OUT_DOC_BOTTOM_MARGIN => 7, OutputDocumentPeer::OUT_DOC_GENERATE => 8, OutputDocumentPeer::OUT_DOC_TYPE => 9, OutputDocumentPeer::OUT_DOC_CURRENT_REVISION => 10, OutputDocumentPeer::OUT_DOC_FIELD_MAPPING => 11, OutputDocumentPeer::OUT_DOC_VERSIONING => 12, OutputDocumentPeer::OUT_DOC_DESTINATION_PATH => 13, OutputDocumentPeer::OUT_DOC_TAGS => 14, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_ENABLED => 15, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OPEN_PASSWORD => 16, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OWNER_PASSWORD => 17, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_PERMISSIONS => 18, ),
BasePeer::TYPE_FIELDNAME => array ('OUT_DOC_UID' => 0, 'PRO_UID' => 1, 'OUT_DOC_LANDSCAPE' => 2, 'OUT_DOC_MEDIA' => 3, 'OUT_DOC_LEFT_MARGIN' => 4, 'OUT_DOC_RIGHT_MARGIN' => 5, 'OUT_DOC_TOP_MARGIN' => 6, 'OUT_DOC_BOTTOM_MARGIN' => 7, 'OUT_DOC_GENERATE' => 8, 'OUT_DOC_TYPE' => 9, 'OUT_DOC_CURRENT_REVISION' => 10, 'OUT_DOC_FIELD_MAPPING' => 11, 'OUT_DOC_VERSIONING' => 12, 'OUT_DOC_DESTINATION_PATH' => 13, 'OUT_DOC_TAGS' => 14, 'OUT_DOC_PDF_SECURITY_ENABLED' => 15, 'OUT_DOC_PDF_SECURITY_OPEN_PASSWORD' => 16, 'OUT_DOC_PDF_SECURITY_OWNER_PASSWORD' => 17, 'OUT_DOC_PDF_SECURITY_PERMISSIONS' => 18, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, )
);
/**
@@ -233,6 +245,14 @@ abstract class BaseOutputDocumentPeer {
$criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_TAGS);
$criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_PDF_SECURITY_ENABLED);
$criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OPEN_PASSWORD);
$criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OWNER_PASSWORD);
$criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_PDF_SECURITY_PERMISSIONS);
}
const COUNT = 'COUNT(OUTPUT_DOCUMENT.OUT_DOC_UID)';

View File

@@ -724,6 +724,10 @@
<column name="OUT_DOC_VERSIONING" type="TINYINT" required="true" default="0"/>
<column name="OUT_DOC_DESTINATION_PATH" type="LONGVARCHAR" required="false"/>
<column name="OUT_DOC_TAGS" type="LONGVARCHAR" required="false"/>
<column name="OUT_DOC_PDF_SECURITY_ENABLED" type="TINYINT" required="false" default="0"/>
<column name="OUT_DOC_PDF_SECURITY_OPEN_PASSWORD" type="VARCHAR" size="32" required="false" default=""/>
<column name="OUT_DOC_PDF_SECURITY_OWNER_PASSWORD" type="VARCHAR" size="32" required="false" default=""/>
<column name="OUT_DOC_PDF_SECURITY_PERMISSIONS" type="VARCHAR" size="150" required="false" default=""/>
<validator column="OUT_DOC_UID">
<rule name="maxLength" value="32" message="Output Document UID can be no larger than ${value} in size"/>
<rule name="required" message="Output Document UID is required."/>

View File

@@ -359,6 +359,10 @@ CREATE TABLE `OUTPUT_DOCUMENT`
`OUT_DOC_VERSIONING` TINYINT default 0 NOT NULL,
`OUT_DOC_DESTINATION_PATH` MEDIUMTEXT,
`OUT_DOC_TAGS` MEDIUMTEXT,
`OUT_DOC_PDF_SECURITY_ENABLED` TINYINT default 0,
`OUT_DOC_PDF_SECURITY_OPEN_PASSWORD` VARCHAR(32) default '',
`OUT_DOC_PDF_SECURITY_OWNER_PASSWORD` VARCHAR(32) default '',
`OUT_DOC_PDF_SECURITY_PERMISSIONS` VARCHAR(150) default '',
PRIMARY KEY (`OUT_DOC_UID`)
)ENGINE=MyISAM DEFAULT CHARSET='utf8';
#-----------------------------------------------------------------------------

View File

@@ -429,10 +429,13 @@
$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'],);
$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'], (boolean)$aOD['OUT_DOC_LANDSCAPE'], $aOD['OUT_DOC_GENERATE'],$aProperties );
$sFilename, $aOD['OUT_DOC_TEMPLATE'], (boolean)$aOD['OUT_DOC_LANDSCAPE'], $aOD['OUT_DOC_GENERATE'] );
$sFilename, $aOD['OUT_DOC_TEMPLATE'], (boolean)$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;

View File

@@ -1,4 +1,5 @@
<?php
/**
* outputdocs_Edit.php
*
@@ -41,8 +42,7 @@ try {
$ooutputDocument = new OutputDocument();
if (isset($_GET['OUT_DOC_UID'])) {
$aFields = $ooutputDocument->load($_GET['OUT_DOC_UID']);
}
else {
} else {
$aFields = array();
$aFields['PRO_UID'] = $_GET['PRO_UID'];
}
@@ -52,6 +52,16 @@ try {
$aFields['OUT_DOC_TAGS'] = isset($aFields['OUT_DOC_TAGS']) ? $aFields['OUT_DOC_TAGS'] : 'OUTPUT';
$aFields['OUT_DOC_VERSIONING'] = strval($aFields['OUT_DOC_VERSIONING']);
$aFields['OUT_DOC_LANDSCAPE'] = strval($aFields['OUT_DOC_LANDSCAPE']);
if(isset($aFields['OUT_DOC_PDF_SECURITY_ENABLED'])){
$aFields['OUT_DOC_PDF_SECURITY_ENABLED'] = strval($aFields['OUT_DOC_PDF_SECURITY_ENABLED']);
}
if (isset($aFields['OUT_DOC_PDF_SECURITY_OPEN_PASSWORD']) && $aFields['OUT_DOC_PDF_SECURITY_OPEN_PASSWORD'] != "") {
$aFields['OUT_DOC_PDF_SECURITY_OPEN_PASSWORD'] = G::decrypt($aFields['OUT_DOC_PDF_SECURITY_OPEN_PASSWORD'], $_GET['OUT_DOC_UID']);
$aFields['OUT_DOC_PDF_SECURITY_OWNER_PASSWORD'] = G::decrypt($aFields['OUT_DOC_PDF_SECURITY_OWNER_PASSWORD'], $_GET['OUT_DOC_UID']);
}
G::LoadClass('xmlfield_InputPM');
$G_PUBLISH = new Publisher();
switch ($type) {
@@ -76,7 +86,6 @@ try {
break;
}
G::RenderPage('publish', 'raw');
}
catch (Exception $oException) {
} catch (Exception $oException) {
die($oException->getMessage());
}

View File

@@ -1,4 +1,5 @@
<?php
/**
* outputdocs_Save.php
*
@@ -71,10 +72,10 @@ try {
$oDataset1->next();
$aRow1 = $oDataset1->getRow();
if($aRow1['OUTPUTS'])$flag=false;
if ($aRow1['OUTPUTS']
)$flag = false;
}
print $flag;
} else {
//default:
@@ -83,12 +84,30 @@ try {
$oOutputDocument = new OutputDocument();
if (isset($_POST['form']))
$aData = $_POST['form']; //For old process map form
else
$aData = $_POST; //For Extjs (Since we are not using form in ExtJS)
$oForm = new Form('outputdocs/outputdocs_Properties', PATH_XMLFORM);
$aData = $oForm->validatePost();
if(isset($aData['OUT_DOC_PDF_SECURITY_ENABLED'])&&$aData['OUT_DOC_PDF_SECURITY_ENABLED']=="0"){
$aData['OUT_DOC_PDF_SECURITY_OPEN_PASSWORD']="";
$aData['OUT_DOC_PDF_SECURITY_OWNER_PASSWORD']="";
$aData['OUT_DOC_PDF_SECURITY_PERMISSIONS']="";
}
if(isset($aData['OUT_DOC_PDF_SECURITY_OPEN_PASSWORD'])&&$aData['OUT_DOC_PDF_SECURITY_OPEN_PASSWORD']!=""){
$aData['OUT_DOC_PDF_SECURITY_OPEN_PASSWORD']=G::encrypt($aData['OUT_DOC_PDF_SECURITY_OPEN_PASSWORD'],$aData['OUT_DOC_UID']);
$aData['OUT_DOC_PDF_SECURITY_OWNER_PASSWORD']=G::encrypt($aData['OUT_DOC_PDF_SECURITY_OWNER_PASSWORD'],$aData['OUT_DOC_UID']);
}
if ($aData['OUT_DOC_UID'] == '') {
if ((isset($aData['OUT_DOC_TYPE'])) && ( $aData['OUT_DOC_TYPE'] == 'JRXML' )) {
$dynaformUid = $aData['DYN_UID'];
@@ -96,13 +115,10 @@ try {
G::LoadClass('javaBridgePM');
$jbpm = new JavaBridgePM ();
print $jbpm->generateJrxmlFromDynaform($outDocUid, $dynaformUid, 'classic');
}
else {
} else {
$outDocUid = $oOutputDocument->create($aData);
}
}
else {
} else {
$oOutputDocument->update($aData);
}
@@ -112,7 +128,6 @@ try {
$oCriteria = $oMap->getOutputDocumentsCriteria($aData['PRO_UID']);
}
}
}
catch (Exception $oException) {
} catch (Exception $oException) {
die($oException->getMessage());
}

View File

@@ -34,41 +34,77 @@
<td class="FormFieldContent" width="{$form_fieldContentWidth}">{$form.OUT_DOC_DESCRIPTION}</td>
</tr>
<tr>
<td class="FormLabel" width="{$form_labelWidth}">{$OUT_DOC_LANDSCAPE}</td>
<td class="FormLabel" width="{$form_labelWidth}">{$OUT_DOC_MEDIA}/ {$OUT_DOC_LANDSCAPE}</td>
<!-- <td class='FormFieldContent' width="{$form_width}" >{$form.OUT_DOC_LANDSCAPE} </td> //-->
<td class="FormFieldContent" width="{$form_fieldContentWidth}">{$form.OUT_DOC_LANDSCAPE}</td>
<td class="FormFieldContent" width="{$form_fieldContentWidth}">{$form.OUT_DOC_MEDIA}&nbsp;{$form.OUT_DOC_LANDSCAPE} </td>
</tr>
<tr>
<!--<tr>
<td class="FormLabel" width="{$form_labelWidth}">{$OUT_DOC_MEDIA}</td>
<!-- <td class='FormFieldContent' width="{$form_width}" >{$form.OUT_DOC_TAGS} </td> //-->
<td class="FormFieldContent" width="{$form_fieldContentWidth}">{$form.OUT_DOC_MEDIA}</td>
</tr>
-->
<tr>
<td>&nbsp;</td>
<td>
<fieldset>
<legend>Margin</legend>
{$OUT_DOC_LEFT_MARGIN}&nbsp;{$form.OUT_DOC_LEFT_MARGIN}&nbsp;&nbsp;&nbsp;&nbsp;{$OUT_DOC_RIGHT_MARGIN}&nbsp;&nbsp;&nbsp;{$form.OUT_DOC_RIGHT_MARGIN}<br />
{$OUT_DOC_TOP_MARGIN}&nbsp;{$form.OUT_DOC_TOP_MARGIN}&nbsp;&nbsp;&nbsp;&nbsp;{$OUT_DOC_BOTTOM_MARGIN}&nbsp;{$form.OUT_DOC_BOTTOM_MARGIN}<br />
</fieldset>
</td>
</tr>
<!-- <tr>
<td class="FormLabel" width="{$form_labelWidth}">{$OUT_DOC_LEFT_MARGIN}</td>
<!-- <td class='FormFieldContent' width="{$form_width}" >{$form.OUT_DOC_TAGS} </td> //-->
<td class="FormFieldContent" width="{$form_fieldContentWidth}">{$form.OUT_DOC_LEFT_MARGIN}</td>
</tr>
<tr>
<td class="FormLabel" width="{$form_labelWidth}">{$OUT_DOC_RIGHT_MARGIN}</td>
<!-- <td class='FormFieldContent' width="{$form_width}" >{$form.OUT_DOC_TAGS} </td> //-->
<td class="FormFieldContent" width="{$form_fieldContentWidth}">{$form.OUT_DOC_RIGHT_MARGIN}</td>
</tr>
<tr>
<td class="FormLabel" width="{$form_labelWidth}">{$OUT_DOC_TOP_MARGIN}</td>
<!-- <td class='FormFieldContent' width="{$form_width}" >{$form.OUT_DOC_TAGS} </td> //-->
<td class="FormFieldContent" width="{$form_fieldContentWidth}">{$form.OUT_DOC_TOP_MARGIN}</td>
</tr>
<tr>
<td class="FormLabel" width="{$form_labelWidth}">{$OUT_DOC_BOTTOM_MARGIN}</td>
<!-- <td class='FormFieldContent' width="{$form_width}" >{$form.OUT_DOC_TAGS} </td> //-->
<td class="FormFieldContent" width="{$form_fieldContentWidth}">{$form.OUT_DOC_BOTTOM_MARGIN}</td>
</tr>
-->
<tr>
<td class="FormLabel" width="{$form_labelWidth}">{$OUT_DOC_GENERATE}</td>
<!-- <td class='FormFieldContent' width="{$form_width}" >{$form.OUT_DOC_GENERATE} </td> //-->
<td class="FormFieldContent" width="{$form_fieldContentWidth}">{$form.OUT_DOC_GENERATE}</td>
</tr>
<tr>
<td class="FormLabel" width="{$form_labelWidth}">{$OUT_DOC_PDF_SECURITY_ENABLED}</td>
<td class="FormFieldContent" width="{$form_fieldContentWidth}">{$form.OUT_DOC_PDF_SECURITY_ENABLED}</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<fieldset id="form[PDF_SECURITY_SETTINGS]">
<legend></legend>
<table>
<tr><td>
{$OUT_DOC_PDF_SECURITY_OPEN_PASSWORD} &nbsp;{$form.OUT_DOC_PDF_SECURITY_OPEN_PASSWORD}
</td><td rowspan="2">{$OUT_DOC_PDF_SECURITY_PERMISSIONS}<br />{$form.OUT_DOC_PDF_SECURITY_PERMISSIONS}</td></tr>
<tr><td>
{$OUT_DOC_PDF_SECURITY_OWNER_PASSWORD}&nbsp;{$form.OUT_DOC_PDF_SECURITY_OWNER_PASSWORD}
{$form.test}
</td><td></td></tr>
</table>
</fieldset>
</td>
</tr>
<tr>
<td class="FormLabel" width="{$form_labelWidth}">{$OUT_DOC_VERSIONING}</td>
<!-- <td class='FormFieldContent' width="{$form_width}" >{$form.OUT_DOC_VERSIONING} </td> //-->

View File

@@ -59,16 +59,16 @@
</OUT_DOC_MEDIA>
<OUT_DOC_LEFT_MARGIN type="text" style="width:15%" validate="Int">
<en>Left Margin</en>
<en>Left</en>
</OUT_DOC_LEFT_MARGIN>
<OUT_DOC_RIGHT_MARGIN type="text" style="width:15%" validate="Int">
<en>Right Margin</en>
<en>Right</en>
</OUT_DOC_RIGHT_MARGIN>
<OUT_DOC_TOP_MARGIN type="text" style="width:15%" validate="Int">
<en>Top Margin</en>
<en>Top</en>
</OUT_DOC_TOP_MARGIN>
<OUT_DOC_BOTTOM_MARGIN type="text" style="width:15%" validate="Int">
<en>Bottom Margin</en>
<en>Bottom</en>
</OUT_DOC_BOTTOM_MARGIN>
<OUT_DOC_DESTINATION_PATH type="textpm" size="30" maxlength="200" showVars="1" process="@#PRO_UID" symbol="@#" validate="Path">
<en>Destination Path</en>
@@ -77,6 +77,26 @@
<en>Tags</en>
</OUT_DOC_TAGS>
<OUT_DOC_PDF_SECURITY_ENABLED type="dropdown">
<en>PDF Security<option name="0">Disabled</option><option name="1">Enabled</option></en>
</OUT_DOC_PDF_SECURITY_ENABLED>
<OUT_DOC_PDF_SECURITY_OPEN_PASSWORD type="password" >
<en>Open Password</en>
</OUT_DOC_PDF_SECURITY_OPEN_PASSWORD>
<OUT_DOC_PDF_SECURITY_OWNER_PASSWORD type="password" >
<en>Owner Password</en>
</OUT_DOC_PDF_SECURITY_OWNER_PASSWORD>
<OUT_DOC_PDF_SECURITY_PERMISSIONS type="listbox" mode="edit" options="Array">
<en>Allowed Permissions
<option name='print'>Print</option><!--print-->
<option name='modify'>Modify</option><!--print-->
<option name='copy'>Copy</option><!--print-->
<option name='annot-forms'>Forms</option><!--print-->
</en>
</OUT_DOC_PDF_SECURITY_PERMISSIONS>
<BTN_CANCEL type="button" onclick="cancel();">
<en>Cancel</en>
</BTN_CANCEL>
@@ -172,5 +192,36 @@ function cancel(){
currentPopupWindow.remove();
}
function showPdfSecuritySwitch(){
if ((getField('OUT_DOC_GENERATE').value == 'PDF')||(getField('OUT_DOC_GENERATE').value == 'BOTH')) {
showRow('OUT_DOC_PDF_SECURITY_ENABLED');
}
else {
hideRow('OUT_DOC_PDF_SECURITY_ENABLED');
getField('OUT_DOC_PDF_SECURITY_ENABLED').value=0;
}
togglePDFSecurity();
}
function togglePDFSecurity(){
if ((getField('OUT_DOC_PDF_SECURITY_ENABLED').value == '0')) {
hideRow('PDF_SECURITY_SETTINGS');
}
else {
showRow('PDF_SECURITY_SETTINGS');
}
}
leimnud.event.add(getField('OUT_DOC_GENERATE'), 'change', function() {
showPdfSecuritySwitch();
});
leimnud.event.add(getField('OUT_DOC_PDF_SECURITY_ENABLED'), 'change', function() {
togglePDFSecurity();
});
showPdfSecuritySwitch();
togglePDFSecurity();
]]></JS>
</dynaForm>