Add php files

This commit is contained in:
2025-05-12 15:44:39 +00:00
parent c951760058
commit 82d5804ac4
9534 changed files with 2638137 additions and 0 deletions

View File

@@ -0,0 +1,66 @@
<?php
/*****************************************************************************
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/rpl.php. Software distributed under the
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
* either express or implied.
*
* You may:
* a) Use and distribute this code exactly as you received without payment or
* a royalty or other fee.
* b) Create extensions for this code, provided that you make the extensions
* publicly available and document your modifications clearly.
* c) Charge for a fee for warranty or support or for accepting liability
* obligations for your customers.
*
* You may NOT:
* a) Charge for the use of the original code or extensions, including in
* electronic distribution models, such as ASP (Application Service
* Provider).
* b) Charge for the original source code or your extensions other than a
* nominal fee to cover distribution costs where such distribution
* involves PHYSICAL media.
* c) Modify or delete any pre-existing copyright notices, change notices,
* or License text in the Licensed Software
* d) Assert any patent claims against the Licensor or Contributors, or
* which would in any way restrict the ability of any third party to use the
* Licensed Software.
*
* You must:
* a) Document any modifications you make to this code including the nature of
* the change, the authors of the change, and the date of the change.
* b) Make the source code for any extensions you deploy available via an
* Electronic Distribution Mechanism such as FTP or HTTP download.
* c) Notify the licensor of the availability of source code to your extensions
* and include instructions on how to acquire the source code and updates.
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
* reproduce, perform, modify, sublicense, and distribute your extensions.
*
* The Original Code is: CommuniCore
* Olavo Farias
* 2006-04-7 olavo.farias@gmail.com
*
* The Initial Developer of the Original Code is CommuniCore.
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
* All Rights Reserved.
********************************************************************************/
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
require_once('modules/EcmDocumentTemplates/EcmDocumentTemplate.php');
$focus = new EcmDocumentTemplate();
// PERFORM THE DELETE IF GIVEN A RECORD TO DELETE
if(!isset($_REQUEST['record']))
sugar_die("A record number must be specified to delete the record.");
$focus->retrieve($_REQUEST['record']);
if(!$focus->ACLAccess('Delete')){
ACLController::displayNoAccess(true);
sugar_cleanup(true);
}
$focus->mark_deleted($_REQUEST['record']);
// NOW THAT THE DELETE HAS BEEN PERFORMED, RETURN TO GIVEN LOCATION
header("Location: index.php?module=".$_REQUEST['return_module']."&action=".$_REQUEST['return_action']."&record=".$_REQUEST['return_id']);
?>

View File

@@ -0,0 +1,51 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
global $sugar_version, $sugar_config, $current_user, $app_strings, $mod_strings, $current_user, $app_list_strings, $db;
require_once('modules/EcmDocumentTemplates/EcmDocumentTemplate.php');
require_once('modules/EcmDocumentTemplates/Forms.php');
require_once('include/time.php');
require_once('include/json_config.php');
$json_config = new json_config();
$focus = new EcmDocumentTemplate();
if(isset($_REQUEST['record'])){
$focus->retrieve($_REQUEST['record']);
}
$json = getJSONobj();
require_once('include/MVC/View/SugarView.php');
require_once('modules/EcmDocumentTemplates/views/DetailView/view.detail.my.php');
$detail = new ViewDetailEcmDocumentTemplates();
$detail->ss = new Sugar_Smarty();
$detail->module="EcmDocumentTemplates";
$detail->bean = $focus;
$detail->preDisplay();
$arr=unserialize(base64_decode($focus->template_files_defs));
$dir_path="modules/EcmDocumentTemplates/templates/";
$docs=$focus->docs;
$tf='<table cellspacing="0" cellpadding="0" border="0" width="100%">';
foreach($docs as $d){
//$r=mysql_fetch_array(mysql_query("select id from ".strtolower($d)." where deleted='0' order by id asc limit 1"));
//$id=$r['id'];
$tf.='<tr>
<td width="20%">'.$app_list_strings['moduleList'][$d].'</td>
<td width="20%">'.$arr[$d].'</td>
<td width="60%"><a style="cursor:pointer;" onclick="EcmPreviewPDF(\'index.php?module='.$d.'&action=previewPDF&method=I&record='.$id.'&to_pdf=1\',{zoom:75,toolbar:1});">'.$mod_strings['LBL_PREVIEW_PDF'].'</a></td>
</tr>';
}
$tf.='</table>';
$detail->ss->assign("TEMPLATE_FILES",$tf);
echo $detail->display();
require_once('include/SubPanel/SubPanelTiles.php');
$subpanel = new SubPanelTiles($focus, "EcmDocumentTemplates");
echo $subpanel->display();
?>

View File

@@ -0,0 +1,148 @@
<?php
/*****************************************************************************
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/rpl.php. Software distributed under the
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
* either express or implied.
*
* You may:
* a) Use and distribute this code exactly as you received without payment or
* a royalty or other fee.
* b) Create extensions for this code, provided that you make the extensions
* publicly available and document your modifications clearly.
* c) Charge for a fee for warranty or support or for accepting liability
* obligations for your customers.
*
* You may NOT:
* a) Charge for the use of the original code or extensions, including in
* electronic distribution models, such as ASP (Application Service
* Provider).
* b) Charge for the original source code or your extensions other than a
* nominal fee to cover distribution costs where such distribution
* involves PHYSICAL media.
* c) Modify or delete any pre-existing copyright notices, change notices,
* or License text in the Licensed Software
* d) Assert any patent claims against the Licensor or Contributors, or
* which would in any way restrict the ability of any third party to use the
* Licensed Software.
*
* You must:
* a) Document any modifications you make to this code including the nature of
* the change, the authors of the change, and the date of the change.
* b) Make the source code for any extensions you deploy available via an
* Electronic Distribution Mechanism such as FTP or HTTP download.
* c) Notify the licensor of the availability of source code to your extensions
* and include instructions on how to acquire the source code and updates.
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
* reproduce, perform, modify, sublicense, and distribute your extensions.
*
* The Original Code is: CommuniCore
* Olavo Farias
* 2006-04-7 olavo.farias@gmail.com
*
* The Initial Developer of the Original Code is CommuniCore.
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
* All Rights Reserved.
********************************************************************************/
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
require_once('XTemplate/xtpl.php');
require_once('data/Tracker.php');
require_once('modules/EcmDocumentTemplates/EcmDocumentTemplate.php');
require_once('modules/EcmDocumentTemplates/Forms.php');
require_once('include/DetailView/DetailView.php');
global $mod_strings;
global $app_strings;
$focus = new EcmDocumentTemplate();
$detailView = new DetailView();
$offset = 0;
// ONLY LOAD A RECORD IF A RECORD ID IS GIVEN;
// A RECORD ID IS NOT GIVEN WHEN VIEWING IN LAYOUT EDITOR
if (isset($_REQUEST['offset']) or isset($_REQUEST['record'])) {
$result = $detailView->processSugarBean("ECMDOCUMENTTEMPLATES", $focus, $offset);
if($result == null) {
sugar_die($app_strings['ERROR_NO_RECORD']);
}
$focus = $result;
}else{
header("Location: index.php?module={EcmDocumentTemplates}&action=index");
}
if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
$focus->id = "";
}
echo "\n<p>\n";
echo get_module_title($mod_strings['LBL_MODULE_ID'], $mod_strings['LBL_MODULE_NAME'].": ".$focus->name, true);
echo "\n</p>\n";
global $theme;
$theme_path = "themes/".$theme."/";
$image_path = $theme_path."images/";
require_once($theme_path.'layout_utils.php');
$GLOBALS['log']->info("EcmDocumentTemplates detail view");
$focus->format_all_fields();
$xtpl=new XTemplate ('modules/EcmDocumentTemplates/DetailView.html');
$xtpl->assign("MOD", $mod_strings);
$xtpl->assign("APP", $app_strings);
$xtpl->assign("THEME", $theme);
$xtpl->assign("GRIDLINE", isset($gridline)?$gridline:0);
$xtpl->assign("IMAGE_PATH", $image_path);
$xtpl->assign("PRINT_URL", "index.php?".$GLOBALS['request_string']);
$xtpl->assign("ID", $focus->id);
$xtpl->assign("ASSIGNED_TO", $focus->assigned_user_name);
$xtpl->assign("NAME", $focus->name);
$xtpl->assign("DATE_ENTERED", $focus->date_entered);
$xtpl->assign("DATE_MODIFIED", $focus->date_modified);
$xtpl->assign("LOGO_PATH", $focus->logo_path);
$xtpl->assign("ACCOUNT_NAME", $focus->account_name);
$xtpl->assign("ACCOUNT_ID", $focus->account_id);
$xtpl->assign("ACCOUNT_NUMBER", $focus->account_number);
$xtpl->assign("CURRENCY", $focus->currency);
$xtpl->assign("DOCUMENT_NUMBER_FORMAT", $app_list_strings['ecmdocumenttemplates_document_number_format_dom'][$focus->document_number_format_id]);
if ($focus->table_currency == '1') $xtpl->assign('TABLE_CURRENCY', "checked");
global $current_user;
if(is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])){
$xtpl->assign("ADMIN_EDIT","<a href='index.php?action=index&module=DynamicLayout&from_action=".$_REQUEST['action'] ."&from_module=".$_REQUEST['module'] ."&record=".$_REQUEST['record']. "'>".get_image($image_path."EditLayout","border='0' alt='Edit Layout' align='bottom'")."</a>");
}
$xtpl->assign("CREATED_BY", $focus->created_by_name);
$xtpl->assign("MODIFIED_BY", $focus->modified_by_name);
$detailView->processListNavigation($xtpl, "ECMDOCUMENTTEMPLATES", $offset, $focus->is_AuditEnabled());
// ADDING CUSTOM FIELDS:
require_once('modules/DynamicFields/templates/Files/DetailView.php');
if(!empty($focus->id)) {
$merge_button = <<<EOQ
<input title="{$app_strings['LBL_DUP_MERGE']}" accessKey="M" class="button" onclick="this.form.return_module.value='EcmDocumentTemplates'; this.form.return_action.value='DetailView';this.form.return_id.value='{$focus->id}'; this.form.action.value='Step1'; this.form.module.value='MergeRecords';" type="submit" name="Merge" value=" {$app_strings['LBL_DUP_MERGE']} "/>
EOQ;
$xtpl->assign("FIND_DUPES_MERGE_BUTTON", $merge_button);
}
$xtpl->parse("main");
$xtpl->out("main");
$sub_xtpl = $xtpl;
$old_contents = ob_get_contents();
ob_end_clean();
ob_start();
echo $old_contents;
require_once('modules/SavedSearch/SavedSearch.php');
$savedSearch = new SavedSearch();
$json = getJSONobj();
$savedSearchSelects = $json->encode(array($GLOBALS['app_strings']['LBL_SAVED_SEARCH_SHORTCUT'] . '<br>' . $savedSearch->getSelect('EcmDocumentTemplates')));
$str = "<script>
YAHOO.util.Event.addListener(window, 'load', SUGAR.util.fillShortcuts, $savedSearchSelects);
</script>";
echo $str;
?>

View File

@@ -0,0 +1,341 @@
<?php
define('FPDF_FONTPATH','modules/EcmDocumentTemplates/html2fpdf-3.0.2b/font/');
require_once('html2fpdf-3.0.2b/html2fpdf.php');
class DocumentPDF extends HTML2FPDF {
private $blnShowHeader = true;
private $blnShowFooter = true;
var $iconvFrom = "UTF-8";
var $iconvTo = "ISO-8859-2";
public function DocumentPDF($orientation='P',$unit='mm',$format='A4') {
parent::HTML2FPDF($orientation,$unit,$format);
$this->AddFont('arialpl', '', 'arial.php');
$this->AddFont('arialpl', 'I', 'ariali.php');
$this->AddFont('arialpl', 'B', 'arialbd.php');
$this->AddFont('arialpl', 'BI', 'arialbi.php');
$this->SetFont('arialpl', '', 9);
$this->rMargin = 15;
$this->lMargin = 25;
$this->bMargin = 19;
$this->SetTopMargin(10);
$this->SetAutoPageBreak(true,$this->bMargin+$this->tMarign+5);
$this->pgwidth = $this->fw - $this->lMargin - $this->rMargin ;
$this->ZoomMode = 73;
}
public function enableHeader() { $this->blnShowHeader = true; }
public function disableHeader() { $this->blnShowHeader = false; }
public function enableFooter() { $this->blnShowFooter = true; }
public function disableFooter() { $this->blnShowFooter = false; }
function iconvArray($from,$to,$arr) {
if(is_array($arr)) {
foreach($arr as $key => $value)
$arr[$key] = iconvArray($from,$to,$value);
} else $arr = iconv($from,$to,$arr);
return $arr;
}
/*
function Cell($w,$h=0,$txt='',$border=0,$ln=0,$align='',$fill=0,$link='',$currentx=0) {
return parent::Cell($w,$h=0,iconv("UTF-8","ISO-8859-2",$txt),$border,$ln,$align,$fill,$link,$currentx);
}
function MultiCell($w,$h,$txt,$border=0,$align='J',$fill=0,$link='') {
return parent::MultiCell($w,$h,iconv("UTF-8","ISO-8859-2",$txt),$border,$align,$fill,$link);
}
*/
public function Header($content='') {}
public function Footer() {}
function Main() {}
function DrawTable($table, $headers = null, $ctm = 1, $cbm = 1, $cth = 4) {
if(is_array($headers) && count($headers) > 0) {
$arr = array();
foreach($headers as $key => $value) $arr[] = $table[$value];
$headers = $arr;
}
foreach($table as $row)
$this->DrawTableRow($row, $headers, $ctm, $cbm, $cth);
}
function CalcCell($cell) {
$cell_tmp = array();
$cw=&$this->CurrentFont['cw'];
$w = $cell['width']*(($this->fw-$this->lMargin-$this->rMargin)/100);
$wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
$s=str_replace("\r",'',$cell['value']);
$nb=strlen($s);
if($nb>0 and $s[$nb-1]=="\n") $nb--;
$sep=-1;
$i=0;
$j=0;
$l=0;
$ns=0;
$nl=1;
$rc = 0;
while($i<$nb)
{
//Get next character
$c=$s{$i};
if($c=="\n")
{
//Explicit line break
//$rc++;
$cell_tmp[] = substr($s,$j,$i-$j); //$j=$i; $rc = 0;//add next full page
$i++;
$sep=-1;
$j=$i;
$l=0;
$ns=0;
$nl++;
continue;
}
if($c==' ')
{
$sep=$i;
$ls=$l;
$ns++;
}
$l+=$cw[$c];
if($l>$wmax)
{
//Automatic line break
if($sep==-1)
{
if($i==$j) $i++;
$rc++;
$cell_tmp[] = substr($s,$j,$i-$j); //$j=$i; $rc = 0;//add next full page
}
else
{
$rc++;
$cell_tmp[] = substr($s,$j,$sep-$j); //$j=$i; $rc = 0;//add next full page
$i=$sep+1;
}
$sep=-1;
$j=$i;
$l=0;
$ns=0;
$nl++;
//$cell_tmp[] = substr($s,$j,$i-$j); //$j=$i; $rc = 0;//add next full page
}
else $i++;
}
//Last chunk
//$this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill,$link);
$cell_tmp[] = substr($s,$j,$i-$j);
//$this->x=$this->lMargin;
return $cell_tmp;
}
function getScaledImageHeight($file, $w) {
$pos=strrpos($file,'.');
if(!$pos) $this->Error('Image file has no extension and no type was specified: '.$file);
$type=substr($file,$pos+1);
if($type=='jpg' or $type=='jpeg') $info=$this->_parsejpg($file);
elseif($type=='png') $info=$this->_parsepng($file);
elseif($type=='gif') $info=$this->_parsegif($file);
if(!isset($info)) return 0;
$h=$w*$info['h']/$info['w'];
return $h;
}
function DrawTableRow($row, $headers = null, $ctm = 1, $cbm = 1, $cth = 4) {
$lm = $this->lMargin;
$rm = $this->rMargin;
$fw = $this->fw-$lm-$rm;
$pr = $fw/100;
$img_result_bottom = 0;
//$ctm = 1; //cell top margin
//$cbm = 1; //cell bottom margin
//$cth = 4; //cell text height
//prepare row to draw
$row_tmp = array();
$maxRows = 0;
foreach($row as $key => $cell) {
// $row_tmp[$key] = $this->CalcCell($row[$key],$this->fh-($this->GetY()+$ctm)-($this->bMargin+$cbm),$ctm,$cbm);
$this->SetFont(
(isset($cell['font-family'])?$cell['font-family']:'arialpl'),
(isset($cell['font-style'])?$cell['font-style']:''),
(isset($cell['font-size'])?$cell['font-size']:8)
);
if(!isset($cell['image_path'])) {
$row_tmp[$key] = $this->CalcCell($row[$key]);
if(count($row_tmp[$key]) > $maxRows) $maxRows = count($row_tmp[$key]);
} else {
$row_tmp[$key] = '';
}
}
$img_path_bool = true;
$img_height = 0;
for($i=0;$i<$maxRows;$i++) {
$row_pre[$i] = $row;
foreach($row_tmp as $key => $cell) {
if(isset($row_pre[$i][$key]['image_path'])) {
if($row_pre[$i][$key]['image_path'] != '' && $img_path_bool == true) {
if(file_exists($row_pre[$i][$key]['image_path'])) {
$img_path_ = $row_pre[$i][$key]['image_path'];
$img_path_bool = false;
$img_height = $this->getScaledImageHeight($row_pre[$i][$key]['image_path'], $row_pre[$i][$key]['width']*$pr);
}
} else $img_path_ = 'none';
$row_pre[$i][$key]['image_path'] = $img_path_;
}
$row_pre[$i][$key]['value'] = isset($cell[$i])?$cell[$i]:'';
}
}
if(($this->GetY() + $img_height) > $this->getBreakLine()) {
$this->AddPage();
if(is_array($headers) && count($headers) > 0) $this->DrawTable($headers);
}
if($img_height != 0) {
$rows_height = count($row_pre) * $cth;
if($img_height > $rows_height) $cbm = $cbm + $img_height - $rows_height; else { $img_height = 0; }
}
$rows_height = count($row_pre) * ($cth + $ctm + $cbm);
if($this->GetY()+$rows_height > $this->fh-$this->bMargin) {
$this->AddPage();
$this->Ln(0);
$img_result_bottom = 0;
//table headers
if(is_array($headers) && count($headers) > 0) $this->DrawTable($headers);
$this->Ln(0);
}
for($rows=0; $rows<count($row_pre); $rows++) {
$row = $row_pre[$rows];
//row draw
$maxy = 0;
//drawing a row
if($this->GetY()+$cth*5 > $this->fh-$this->bMargin) {
$this->AddPage();
$mar = null;
if ($this->getX()!=$this->lMargin)
$mar = $this->getX();
$this->Ln(0, $mar);
$new_x = $this->getX();
$img_result_bottom = 0;
//table headers
if(is_array($headers) && count($headers) > 0) $this->DrawTable($headers);
$this->Ln(0, $mar);
}
/*if($this->GetY()> 130){
$this->AddPage();
} */
$cp1 = $this->page;
$cp2 = $this->page;
$cy = $this->GetY();
$sx = $this->GetX(); //start X
$sy = $this->GetY(); //start Y
$cx = $sx;
$cell_countner = 0;
foreach($row as $key => $cell) {
//set font
$this->SetFont(
(isset($cell['font-family'])?$cell['font-family']:'arialpl'),
(isset($cell['font-style'])?$cell['font-style']:''),
(isset($cell['font-size'])?$cell['font-size']:8)
);
//set text color
$this->SetTextColor((isset($cell['color'])?$cell['color']:'0,0,0'));
//set fill color
if(isset($cell['background']))
$this->SetFillColor($cell['background'][0],$cell['background'][1],$cell['background'][2]);
else
$this->SetFillColor(255,255,255);
//draw top cell margin
if($rows == 0) {
//if($this->GetY()+$cth*2 > $this->fh-$this->bMargin) { $this->AddPage(); $this->Ln(0); }
$xtmp = $this->GetX();
$ytmp = $this->GetY();
$this->Cell($cell['width']*$pr,$ctm,'',($cell['border']==1?'LTR':''),0,0,1);
$this->SetXY($xtmp,$ytmp+$ctm);
$cell['border'].='T';
}
if($rows == $maxRows-1) {
if($this->GetY()+$cth*2 > $this->fh-$this->bMargin) {
$this->AddPage();
$this->Ln(0);
//table headers
$img_result_bottom = 0;
$this->Ln(0);
}
$xtmp = $this->GetX();
$ytmp = $this->GetY();
$this->SetXY($xtmp,$ytmp+$cth);
if(isset($cell['image_path'])) {
} else
$this->Cell($cell['width']*$pr,$cbm,'',($cell['border']==1?'LBR':''),0,0,1);
$this->SetXY($xtmp,$ytmp);
//$this->Rect($this->GetX(),$this->GetY()+$cth,$cell['width']*$pr,$cbm,'DF');
}
//draw cell text
//if($this->GetY()+$cth*2 > $this->fh-$this->bMargin) { $this->AddPage(); $this->Ln(0); }
if(isset($cell['image_path']) && $cell['image_path'] != '') {
if(file_exists($cell['image_path'])) {
$img_y = $this->GetY();
$img_result = $this->Image($cell['image_path'],$this->GetX(),$img_y,$cell['width']*$pr,0);
$img_result_bottom = $img_y + $img_result['HEIGHT'];
$this->SetXY($this->GetX(), $img_y);
//if($img_y + $img_result['HEIGHT'] > $maxy) $maxy = $img_y + $img_result['HEIGHT'];
}
$c_tmp=$cell['width']*$pr;
} else
$this->Cell($c_tmp=$cell['width']*$pr,$cth,$cell['value'],($cell['border']==1?'LR':''),0,$cell['align'],1);
$this->SetXY($this->GetX(),$this->GetY()+$cth);
//draw bottom cell margin
if($rows == $maxRows-1) $this->SetXY($this->GetX(),$this->GetY()+$cbm);
//set end of text
if(($this->GetY()) > $maxy) $maxy = $this->GetY();
if($this->page > $cp1) { $cy = $this->tMargin; $img_result_bottom = 0; $cp1=$this->page; }
$this->SetXY($cx+=$c_tmp,$cy);
}
$this->SetXY($sx,$maxy);
}
if(isset($img_result_bottom) && $img_result_bottom > $this->GetY()) $this->SetXY($this->GetX(), $img_result_bottom);
}
function DrawHorizontalDottedLine($x1,$x2,$y,$r) {
for($i=$x1,$j=0;$i<$x2-$r;$i+=$r,$j++) {
if($j%2) $this->_out('1 1 1 RG'); else $this->_out($this->DrawColor);
$this->Line($i,$y,$i+$r,$y);
}
$this->_out($this->DrawColor);
}
}
?>

View File

@@ -0,0 +1,116 @@
<?php
error_reporting(LC_ALL);
require_once('modules/EcmDocumentTemplates/DocumentPDF.php');
class DocumentTemplatePDF extends DocumentPDF {
private $blnShowHeader = true;
private $blnShowFooter = true;
public $edt; // EcmDocumentTemplate
public function WorkReportPDF($orientation='P',$unit='mm',$format='A4') {
parent::DocumentPDF($orientation,$unit,$format);
}
public function enableHeader() { $this->blnShowHeader = true; }
public function disableHeader() { $this->blnShowHeader = false; }
public function enableFooter() { $this->blnShowFooter = true; }
public function disableFooter() { $this->blnShowFooter = false; }
public function Header($content='') {
$arr=$this->edt->getTemplateFile($_REQUEST['module']);
$nip=$this->edt->footer_nip;
$module_t=$_REQUEST['module'];
if($_REQUEST['module']=="EcmInsideOrders"){
$arr[0]="EcmInsideOrders";$arr[1]="e5";
}
include("modules/EcmDocumentTemplates/templates/".$arr[0]."/".$arr[1]."/header.php");
}
public function getBreakLine() {
return $this->fh-$this->bMargin+1;
}
public function Footer() {
global $mod_strings;
//if(!$this->blnShowFooter) return;
$arr=$this->edt->getTemplateFile($_REQUEST['module']);
if($_REQUEST['module']=="EcmInsideOrders"){
$arr[0]="EcmInsideOrders";$arr[1]="e5";
}
//manage pdf types
//sales
if ($_REQUEST['module']=='EcmSales') {
$s = new EcmSale();
$s->retrieve($_REQUEST['record']);
if ($s->invoice_type=='U' || $s->invoice_type=='I')
include("modules/EcmDocumentTemplates/templates/".$arr[0]."/".$arr[1]."/footer.en.php");
else
include("modules/EcmDocumentTemplates/templates/".$arr[0]."/".$arr[1]."/footer.pl.php");
return;
}
//invoices
if ($_REQUEST['module']=='EcmInvoiceOuts') {
$i = new EcmInvoiceOut();
$i->retrieve($_REQUEST['record']);
if ($i->pdf_type=='U' || $i->pdf_type=='I')
include("modules/EcmDocumentTemplates/templates/".$arr[0]."/".$arr[1]."/footer.en.php");
else
include("modules/EcmDocumentTemplates/templates/".$arr[0]."/".$arr[1]."/footer.pl.php");
return;
}
include("modules/EcmDocumentTemplates/templates/".$arr[0]."/".$arr[1]."/footer.php");
}
function Main() {
global $mod_strings;
$arr=$this->edt->getTemplateFile($_REQUEST['module']);
include_once("modules/EcmDocumentTemplates/templates/".$arr[0]."/".$arr[1]."/subheader.php");
//$this->edt->DrawPositions($this);
include_once("modules/EcmDocumentTemplates/templates/".$arr[0]."/".$arr[1]."/subfooter.php");
}
function DrawPositions($positions) {
$name_w = 55;
if($this->document_info['calc']['draw_discount']) $name_w -= 8;
if($this->document_info['calc']['draw_vat']) $name_w -= 8;
$table = array();
$table [0]['position'] = array('width' => 5, 'value' => $this->TEXT['LBL_PDF_POSITIONS_LIST_POSITION'], 'background' => array(233,233,233), 'border' => 1, 'overflow' => 1, 'align' => 'C');
$table [0]['quantity'] = array('width' => 6, 'value' => $this->TEXT['LBL_PDF_POSITIONS_LIST_QUANTITY'],'background' => array(233,233,233), 'border' => 1, 'overflow' => 1, 'align' => 'C');
$table [0]['unit'] = array('width' => 6, 'value' => $this->TEXT['LBL_PDF_POSITIONS_LIST_UNIT'],'background' => array(233,233,233), 'border' => 1, 'overflow' => 1, 'align' => 'C');
$table [0]['description'] = array('width' => $name_w, 'value' => $this->TEXT['LBL_PDF_POSITIONS_LIST_DESCRIPTION'], 'background' => array(233,233,233), 'border' => 1, 'overflow' => 1, 'align' => 'C');
$table [0]['unit_price'] = array('width' => 14, 'value' => $this->TEXT['LBL_PDF_POSITIONS_LIST_SELLING_PRICE'], 'background' => array(233,233,233), 'border' => 1, 'overflow' => 1, 'align' => 'C');
if($this->document_info['calc']['draw_discount']) $table [0]['discount'] = array('width' => 8, 'value' => $this->TEXT['LBL_PDF_POSITIONS_LIST_DISCOUNT'], 'background' => array(233,233,233), 'border' => 1, 'overflow' => 1, 'align' => 'C');
if($this->document_info['calc']['draw_vat']) $table [0]['vat_id'] = array('width' => 8, 'value' => $this->TEXT['LBL_PDF_POSITIONS_LIST_VAT'], 'background' => array(233,233,233), 'border' => 1, 'overflow' => 1, 'align' => 'C');
$table [0]['total'] = array('width' => 14, 'value' => $this->TEXT['LBL_PDF_POSITIONS_LIST_TOTAL'], 'background' => array(233,233,233), 'border' => 1, 'overflow' => 1, 'align' => 'C');
$i = 1;
if($positions != '')
foreach($positions as $p) {
$table [$i]['position'] = array('width' => 5, 'value' => $i, 'border' => 'LR', 'align' => 'C', );
$table [$i]['quantity'] = array('width' => 6, 'value' => $p['quantity'], 'border' => 1, 'align' => 'C', );
$table [$i]['unit'] = array('width' => 6, 'value' => $p['unit_id'], 'border' => 1, 'align' => 'C', );
$table [$i]['description'] = array('width' => $name_w, 'value' => $p['name'], 'border' => 1, 'align' => 'L', );
$table [$i]['unit_price'] = array('width' => 14, 'value' => $p['price'], 'border' => 1, 'align' => 'R', );
if($this->document_info['calc']['draw_discount']) $table [$i]['discount'] = array('width' => 8, 'value' => $p['discount'], 'border' => 1, 'align' => 'R', );
if($this->document_info['calc']['draw_vat']) $table [$i]['vat_id'] = array('width' => 8, 'value' => $p['vat_id'], 'border' => 1, 'align' => 'R', );
$table [$i]['total'] = array('width' => 14, 'value' => $p['total'], 'border' => 1, 'align' => 'R', );
$i++;
}
$this->DrawTable($table);
}
};
?>

View File

@@ -0,0 +1,644 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*****************************************************************************
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/rpl.php. Software distributed under the
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
* either express or implied.
*
* You may:
* a) Use and distribute this code exactly as you received without payment or
* a royalty or other fee.
* b) Create extensions for this code, provided that you make the extensions
* publicly available and document your modifications clearly.
* c) Charge for a fee for warranty or support or for accepting liability
* obligations for your customers.
*
* You may NOT:
* a) Charge for the use of the original code or extensions, including in
* electronic distribution models, such as ASP (Application Service
* Provider).
* b) Charge for the original source code or your extensions other than a
* nominal fee to cover distribution costs where such distribution
* involves PHYSICAL media.
* c) Modify or delete any pre-existing copyright notices, change notices,
* or License text in the Licensed Software
* d) Assert any patent claims against the Licensor or Contributors, or
* which would in any way restrict the ability of any third party to use the
* Licensed Software.
*
* You must:
* a) Document any modifications you make to this code including the nature of
* the change, the authors of the change, and the date of the change.
* b) Make the source code for any extensions you deploy available via an
* Electronic Distribution Mechanism such as FTP or HTTP download.
* c) Notify the licensor of the availability of source code to your extensions
* and include instructions on how to acquire the source code and updates.
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
* reproduce, perform, modify, sublicense, and distribute your extensions.
*
* The Original Code is: CommuniCore
* Olavo Farias
* 2006-04-7 olavo.farias@gmail.com
*
* The Initial Developer of the Original Code is CommuniCore.
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
* All Rights Reserved.
********************************************************************************/
require_once('data/SugarBean.php');
require_once('include/utils.php');
// SHOULD INCLUDE SELECTIVELY
$GLOBALS['db'] = new MysqlManager();
$GLOBALS['db']->connect();
class EcmDocumentTemplate extends SugarBean {
var $field_name_map = array();
// STANDARD FIELDS
var $id;
var $date_entered;
var $date_modified;
var $modified_user_id;
var $assigned_user_id;
var $name;
//TABLE COLUMNS
var $place_of_register;
var $logo_path;
var $logo_id;
var $logo_name;
var $account_name;
var $account_id;
var $account_number;
//footer
var $footer_account;
var $footer_address;
var $footer_phone;
var $footer_fax;
var $footer_krs;
var $footer_nip;
var $footer_regon;
var $footer_capital;
var $footer_management;
var $footer_swift;
var $footer_bankname;
var $footer_vatid;
var $document_number_format_id;
var $documents_per_day_id;
var $documents_per;
// var $document_number_letter;
// var $correct_number_letter;
var $ecmlanguage;
var $footer_text;
var $header_text;
var $show_header_on_all_pages;
var $show_footer_on_all_pages;
var $template_files_defs;
var $docs=array("EcmInsideOrders","EcmQuotes","EcmSales","EcmPurchaseOrders","EcmDeliveryNotes","EcmInvoiceOuts","EcmReceiptOuts","EcmStockDocIns","EcmStockDocOuts", "EcmStockDocInsideIns","EcmStockDocInsideOuts", "EcmStockDocMoves", "EcmTemplates", "EcmDocuments","EcmStockDocCorrects");
var $pdf;
var $account;
var $mfp;
// RELATED FIELDS
var $created_by;
var $created_by_name;
var $modified_by_name;
var $assigned_user_name;
// SUBPANELS RELATED
// MODULE OBJECT DETAILS
var $module_dir = 'EcmDocumentTemplates';
var $table_name = "ecmdocumenttemplates";
var $object_name = "EcmDocumentTemplate";
//RELATED TABLE NAMES
// USED TO RETRIEVE RELATED FIELDS FROM FORM POSTS.
var $additional_column_fields = Array(
'assigned_user_name',
'assigned_user_id',
'modified_user_id',
'created_by',
);
var $relationship_fields = Array(
//RELATIONSHIP FIELDS
);
function EcmDocumentTemplate() {
parent::SugarBean();
$this->setupCustomFields('EcmDocumentTemplates');
foreach ($this->field_defs as $field)
{
$this->field_name_map[$field['name']] = $field;
}
}
var $new_schema = true;
function get_summary_text(){
return "$this->name";
}
function create_list_query($order_by, $where, $show_deleted = 0){
// Fill in the assigned_user_name
$custom_join = $this->custom_fields->getJOIN();
$query = "SELECT ";
$query .= "
ecmdocumenttemplates.*
,users.user_name as assigned_user_name";
if($custom_join){
$query .= $custom_join['select'];
}
$query .= " FROM ecmdocumenttemplates
LEFT JOIN users
ON ecmdocumenttemplates.assigned_user_id=users.id";
$query .= " ";
if($custom_join){
$query .= $custom_join['join'];
}
$where_auto = '1=1';
if($show_deleted == 0){
$where_auto = " $this->table_name.deleted=0 ";
}else if($show_deleted == 1){
$where_auto = " $this->table_name.deleted=1 ";
}
if($where != "")
$query .= "where $where AND ".$where_auto;
else
$query .= "where ".$where_auto;
if(substr_count($order_by, '.') > 0){
$query .= " ORDER BY $order_by";
}
else if($order_by != "")
$query .= " ORDER BY $order_by";
else
$query .= " ORDER BY ecmdocumenttemplates.name";
return $query;
}
function create_export_query($order_by, $where){
$custom_join = $this->custom_fields->getJOIN();
$query = "SELECT
ecmdocumenttemplates.*,
users.user_name assigned_user_name";
if($custom_join){
$query .= $custom_join['select'];
}
$query .= " FROM ecmdocumenttemplates ";
$query .= " LEFT JOIN users
ON ecmdocumenttemplates.assigned_user_id=users.id";
if($custom_join){
$query .= $custom_join['join'];
}
$query .= "";
$where_auto = " ecmdocumenttemplates.deleted=0
";
if($where != "")
$query .= " where $where AND ".$where_auto;
else
$query .= " where ".$where_auto;
if($order_by != "")
$query .= " ORDER BY $order_by";
else
$query .= " ORDER BY ecmdocumenttemplates.name";
return $query;
}
function fill_in_additional_list_fields(){
}
function fill_in_additional_detail_fields(){
// FILL IN THE ASSIGNED_USER_NAME
$this->assigned_user_name = get_assigned_user_name($this->assigned_user_id);
$this->created_by_name = get_assigned_user_name($this->created_by);
$this->modified_by_name = get_assigned_user_name($this->modified_user_id);
}
function get_list_view_data(){
global $current_language;
$the_array = parent::get_list_view_data();
$app_list_strings = return_app_list_strings_language($current_language);
$mod_strings = return_module_language($current_language, 'EcmDocumentTemplates');
// THE NEW LISTVIEW CODE ONLY FETCHES COLUMNS THAT WE'RE DISPLAYING AND NOT ALL
// THE COLUMNS SO WE NEED THESE CHECKS.
$the_array['NAME'] = (($this->name == "") ? "<em>blank</em>" : $this->name);
$the_array['ENCODED_NAME'] = $this->name;
return $the_array;
}
/**
BUILDS A GENERIC SEARCH BASED ON THE QUERY STRING USING OR.
DO NOT INCLUDE ANY $THIS-> BECAUSE THIS IS CALLED ON WITHOUT HAVING THE CLASS INSTANTIATED.
*/
function build_generic_where_clause ($the_query_string) {
$where_clauses = Array();
$the_query_string = PearDatabase::quote(from_html($the_query_string));
array_push($where_clauses, "ecmdocumenttemplates.name like '$the_query_string%'");
$the_where = "";
foreach($where_clauses as $clause){
if($the_where != "") $the_where .= " or ";
$the_where .= $clause;
}
return $the_where;
}
function set_notification_body($xtpl, $simplemodule){
global $mod_strings, $app_list_strings;
$xtpl->assign("NAME", $simplemodule->name);
$xtpl->assign("ECMDOCUMENTTEMPLATES_DESCRIPTION", $ecmdocumenttemplates->description);
return $xtpl;
}
function bean_implements($interface){
switch($interface){
case 'ACL':return true;
}
return false;
}
function save($check_notify = FALSE){
if($this->polish_correct_format == 'on') $this->polish_correct_format = 1; else $this->polish_correct_format = 0;
if($this->change_all_old_records == 1) {
$this->UpdateFormatNumber("EcmQuotes", "ecmquotes");
$this->UpdateFormatNumber("EcmSales", "ecmsales");
$this->UpdateFormatNumber("EcmInvoiceOuts", "ecminvoiceouts");
$this->UpdateFormatNumber("EcmWorkReports", "ecmworkreports");
$this->UpdateFormatNumber("EcmDeliveryNotes", "ecmdeliverynotes");
}
$arr=array();
foreach($this->docs as $d){
$arr[$d]=$_REQUEST[$d."_file"];
}
$tfd=base64_encode(serialize($arr));
$this->template_files_defs=$tfd;
return parent::save($check_notify);
}
public function UpdateFormatNumber($module, $table_name, $field_number = 'number', $field_formatted_number = 'document_no', $field_template_id = 'template_id') {
$query = "SELECT `id`, `$field_number` as `number` FROM `$table_name` WHERE `$field_template_id`='$this->id' ORDER BY `date_entered` ASC";
$results = $GLOBALS['db']->query($query);
if(is_resource($results)) {
$numberPrefix = $this->getNumberPrefix($module);
while($row = $GLOBALS['db']->fetchByAssoc($results)) {
$new_number = $this->formatNumber($row['number'], $module, $table_name, $field_number, $numberPrefix);
$query = "UPDATE `$table_name` SET `$field_formatted_number`='$new_number' WHERE `id`='".$row['id']."'";
$this->db->query($query);
}
}
}
public function retrieveByAccountId($id) {
$query = "select id from ecmdocumenttemplates where account_id='".$id."' AND deleted=0 limit 1";
$result = mysql_query($query);
if(!$result) return '';
$idtmp = mysql_fetch_array($result);
$this->retrieve($idtmp[0]);
$this->unformat_all_fields();
}
function setPDF($id) {
$this->retrieve($id);
if($this->id == '') return;
$this->format_all_fields();
$this->setAccount();
$this->loadParser();
$this->header_text = $this->mfp->parseText($this->header_text);
$this->footer_text = $this->mfp->parseText($this->footer_text);
$address = $this->account->name;
if($this->account->billing_address_street) $address .= " - ".$this->account->billing_address_street;
if($this->account->billing_address_postalcode) $address .= " - ".$this->account->billing_address_postalcode;
if($this->account->billing_address_city) $address .= " ".$this->account->billing_address_city;
$this->address = $address;
require_once('modules/EcmDocumentTemplates/DocumentTemplatePDF.php');
$this->pdf = new DocumentTemplatePDF();
$this->pdf->edt = $this;
$this->pdf->SetXY(25,25);
$this->pdf->SetLineWidth(0);
$this->pdf->SetDrawColor(0,0,0);
$this->pdf->SetFont('Arial', '', 8);
$this->pdf->AddPage();
}
function outputPDF($name='auto_pdf.pdf',$method = 'I') {
if($method == "S")
echo $this->pdf->Output($name,$method);
else
$this->pdf->Output($name,$method);
}
function getPDF($id,$name='auto_pdf.pdf',$method = 'I') {
$this->setPDF($id);
$this->outputPDF($name,$method);
}
function setAccount() {
if(isset($this->account_id) && $this->account_id != '') {
require_once('modules/Accounts/Account.php');
$this->account = new Account();
$this->account->retrieve($this->account_id);
}
}
function loadParser() {
if(isset($this->mfp) && $this->mfp != '') return true;
$path = 'modules/EcmDocumentTemplates/ModuleFieldsParser/ModuleFieldsParser.php';
if(file_exists($path)) {
require_once($path);
$this->mfp = new ModuleFieldsParser();
$this->mfp->modules['EcmDocumentTemplates']['focus'] = $this;
if(!isset($this->account->id) || $this->account->id == '') {
if(isset($this->account_id) && $this->account_id != '') {
$this->setAccount();
$this->mfp->modules['Accounts']['focus'] = $this->account;
}
} else
$this->mfp->modules['Accounts']['focus'] = $this->account;
require_once('modules/Users/User.php');
$us = new User();
global $current_user;
$us->retrieve(($this->assigned_user_id)?$this->assigned_user_id:$current_user->id);
if(isset($us->id) && $us->id != '') {
$this->mfp->modules['Users']['focus'] = $us;
}
return true;
}
else
return false;
}
function generateNumber($table_name, $field_name = 'number') {
$number = date("Y");
if($table_name=="ecminvoiceouts")
$query = "SELECT COUNT(*) as `count` FROM `$table_name` WHERE `ecminvoiceout_id` is null and `".$field_name."` LIKE '".$number."%' AND deleted='0' ORDER BY `".$field_name."` DESC LIMIT 1";
else $query = "SELECT COUNT(*) as `count` FROM `$table_name` WHERE correct_id is null and `".$field_name."` LIKE '".$number."%' ORDER BY `".$field_name."` DESC LIMIT 1";
$GLOBALS['db'] = new MysqlManager();
$GLOBALS['db']->connect();
$result = $GLOBALS['db']->query($query);
if(is_resource($result)) {
$count = $GLOBALS['db']->fetchByAssoc($result);
$count = intval($count['count']);
//różnice między systemami - skasować po nowym roku:
} else $count = 1;
$number = date("Ymd");
$number .= sprintf("%d", ++$count);
return $number;
}
function getNumberPrefix($module) {
$mod_strings2 = array();
require_once('modules/EcmTexts/EcmText.php');
if(isset($this->ecmlanguage) && $this->ecmlanguage != '') {
$data = EcmText::LoadText(null,null,$module,$this->ecmlanguage);
if(isset($data[0]) && isset($data[0]['data']) && isset($data[0]['data']['labels'])) {
$data = $data[0]['data']['labels'];
foreach($data as $key => $value) {
$mod_strings2[$value['label']] = $value['translation'];
}
}
}
return $mod_strings2['LBL_PDF_CODE'];
}
function formatNumber($number, $module, $table_name = '', $field_name = 'number', $numberPrefix = null) {
if($table_name == '') $table_name = strtolower($module);
if($this->documents_per != "year") {
$from_number = strval(substr($number,0,4));
$GLOBALS['db'] = new MysqlManager();
$GLOBALS['db']->connect();
$query = "SELECT COUNT(*) as `count`";
$query .= " FROM `".$table_name."`";
$query .= " WHERE ";
if($table_name=="ecminvoiceouts")$query .= " ecminvoiceout_id is null and ";
else $query .= " correct_id is null and ";
$query .= " SUBSTRING(`number`, 1, 4) = '".$from_number."'";
if($this->documents_per == "month") {
$query .= " AND";
$query .= " SUBSTRING(`number`,1,6) = '".substr($number,0,6)."'";
$query .= " AND";
$query .= " CAST(`number` AS UNSIGNED) < ".$number;
}
else if($this->documents_per == "day") {
$query .= " AND";
$query .= " SUBSTRING(`number`,1,8) = '".substr($number,0,8)."'";
$query .= " AND";
$query .= " CAST(`number` AS UNSIGNED) < ".$number;
}
$query .= ";";
$result = $GLOBALS['db']->query($query);
if(is_resource($result)) {
$tmp = $GLOBALS['db']->fetchByAssoc($result);
$count = intval($tmp['count']);
$count ++;
}
$number = substr($number,0,8).strval($count);
}
if($numberPrefix == null)
$numberPrefix = $this->getNumberPrefix($module);
if($this->id=="57d2b950-00c8-62b7-16bb-4d678a086f05" || $this->id=="d48b9458-bf48-d30f-7f7c-4bb074833504"){
$a1=array("001/E","002/E","003/E","004/E","005/E","006/E","007/E","008/E","009/E","010/E","011/E","012/E","013/E","014/E","015/E","016/E","017/E","018/E","019/E");
$a2=array("1/E","2/E","3/E","4/E","5/E","6/E","7/E","8/E","9/E","10/E","11/E","12/E","13/E","14/E","15/E","16/E","17/E","18/E","19/E");
$nnoo=str_replace($a1,$a2,$this->formatDocumentNumber($number, $numberPrefix));
$t = explode("/", $nnoo);
if (substr($t[0],0,1) == "0") {
//return $t[0];
$t[0] = substr($t[0], 1, strlen($t[0]));
$nnoo = implode("/",$t);
}
if ($this->id=="57d2b950-00c8-62b7-16bb-4d678a086f05") return str_replace("E", "U", $nnoo);
return $nnoo;
}
else $nnoo=$this->formatDocumentNumber($number, $numberPrefix);
return $nnoo;
}
function generateNumberCorrect($table_name, $field_name = 'number') {
$number = date("Y");
if($table_name=="ecminvoiceouts"){
$query="SELECT COUNT(*) as count FROM ecminvoiceouts WHERE deleted='0' and (ecminvoiceout_id is not null or ecminvoiceout_id!='') and type='correct' and number LIKE '".$number."%' ORDER BY number DESC limit 1";
}
else $query = "SELECT COUNT(*) as `count` FROM `$table_name` WHERE `correct_id` is not null and `".$field_name."` LIKE '".$number."%' ORDER BY `".$field_name."` DESC LIMIT 1";
$GLOBALS['db'] = new MysqlManager();
$GLOBALS['db']->connect();
$result = $GLOBALS['db']->query($query);
if(is_resource($result)) {
$count = $GLOBALS['db']->fetchByAssoc($result);
$count = intval($count['count']);
//różnice między systemami - skasować po nowym roku:
if ($table_name=='ecminvoiceouts')
$count = $count - 6;
} else $count = 1;
$number = date("Ymd");
$number .=$count;
return $number;
}
function getNumberPrefixCorrect($module) {
$mod_strings2 = array();
require_once('modules/EcmTexts/EcmText.php');
if(isset($this->ecmlanguage) && $this->ecmlanguage != '') {
$data = EcmText::LoadText(null,null,$module,$this->ecmlanguage);
if(isset($data[0]) && isset($data[0]['data']) && isset($data[0]['data']['labels'])) {
$data = $data[0]['data']['labels'];
foreach($data as $key => $value) {
$mod_strings2[$value['label']] = $value['translation'];
}
}
}
return $mod_strings2['LBL_PDF_CODE_CORRECT'];
}
function formatNumberCorrect($number, $module, $table_name = '', $field_name = 'number', $numberPrefix = null) {
if($table_name == '') $table_name = strtolower($module);
if($this->documents_per != "year") {
$from_number = strval(substr($number,0,4));
$GLOBALS['db'] = new MysqlManager();
$GLOBALS['db']->connect();
$query = "SELECT COUNT(*) as `count`";
$query .= " FROM `".$table_name."`";
$query .= " WHERE ";
if($table_name=="ecminvoiceouts")$query .= " ecminvoiceout_id is not null and ";
else $query .= " correct_id is not null and ";
$query .= " SUBSTRING(`number`, 1, 4) = '".$from_number."'";
if($this->documents_per == "month") {
$query .= " AND";
$query .= " SUBSTRING(`number`,1,6) = '".substr($number,0,6)."'";
$query .= " AND";
$query .= " CAST(`number` AS UNSIGNED) < ".$number;
}
else if($this->documents_per == "day") {
$query .= " AND";
$query .= " SUBSTRING(`number`,1,8) = '".substr($number,0,8)."'";
$query .= " AND";
$query .= " CAST(`number` AS UNSIGNED) < ".$number;
}
$query .= ";";
$result = $GLOBALS['db']->query($query);
if(is_resource($result)) {
$tmp = $GLOBALS['db']->fetchByAssoc($result);
$count = intval($tmp['count']);
$count ++;
}
$number = substr($number,0,8).strval($count);
}
if($numberPrefix == null)
$numberPrefix = $this->getNumberPrefixCorrect($module);
return $this->formatDocumentNumber($number, $numberPrefix);
}
function formatDocumentNumber($documentNumber = '', $code = '') {
$cf = '';
$format = $this->document_number_format_id;
$format = str_replace('CODE', '[cOdE]', $format);
$ARR1 = array ('y', 'Y', 'M', 'D', 'NR', '[cOdE]');
$ARR2 = array (substr($documentNumber,2,2), substr($documentNumber,0,4), substr($documentNumber,4,2), substr($documentNumber,6,2), substr($documentNumber,8));
$ARR2[4] = sprintf("%0".$this->documents_per_day_id."d",$ARR2[4]);
$ARR2[5] = $code;
$nno=str_replace($ARR1,$ARR2,$format).$cf;
$exp=explode(" ",$nno);
if($exp[0]=="")$nno=$exp[1];
return $nno;;
}
function getListOfTemplateFiles($path,$module){
if(!file_exists($path.$module))$module="Other";
if($handle=opendir($path.$module)) {
while (false !== ($file = readdir($handle))) {
if($file!="." && $file!=".." && is_dir($path.$module."/".$file))$arr[]=$file;
}
closedir($handle);
}
return $arr;
}
function selectTemplateFile($module,$files,$value){
$html='<select name="'.$module.'_file" id="'.$module.'_file">';
foreach($files as $f){
$html.='<option value="'.$f.'"';
if($value==$f)$html.=' selected';
$html.='>'.$f.'</option>';
}
$html.='</select>';
return $html;
}
function getTemplateFile($module, $type = null){
$arr=unserialize(base64_decode($this->template_files_defs));
if(
file_exists("modules/EcmDocumentTemplates/templates/".$module."/".$arr[$module]."/header.php") &&
file_exists("modules/EcmDocumentTemplates/templates/".$module."/".$arr[$module]."/footer.php") &&
file_exists("modules/EcmDocumentTemplates/templates/".$module."/".$arr[$module]."/subheader.php") &&
file_exists("modules/EcmDocumentTemplates/templates/".$module."/".$arr[$module]."/subfooter.php")
)return array($module,$arr[$module]);
else return array("Other",$arr[$module]);
}
}
?>

View File

@@ -0,0 +1,48 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
global $sugar_version, $sugar_config, $current_user, $app_strings, $mod_strings, $current_user, $app_list_strings, $db;
$app_list_strings['ecmproducts_parent_dom'] = array (
'Accounts' => $app_list_strings['moduleList']['Accounts'],
'Leads' => $app_list_strings['moduleList']['Leads'],
);
require_once('modules/EcmDocumentTemplates/EcmDocumentTemplate.php');
require_once('modules/EcmDocumentTemplates/Forms.php');
require_once('include/time.php');
require_once('include/json_config.php');
$json_config = new json_config();
$focus = new EcmDocumentTemplate();
if(isset($_REQUEST['record'])){
$focus->retrieve($_REQUEST['record']);
}
$json = getJSONobj();
require_once('include/MVC/View/SugarView.php');
require_once('modules/EcmDocumentTemplates/views/EditView/view.edit.my.php');
$edit = new ViewEditEcmDocumentTemplates();
$edit->ss = new Sugar_Smarty();
$edit->bean = $focus;
$edit->preDisplay();
$arr=unserialize(base64_decode($focus->template_files_defs));
$dir_path="modules/EcmDocumentTemplates/templates/";
$docs=$focus->docs;
$tf='<table cellspacing="0" cellpadding="0" border="0" width="100%">';
foreach($docs as $d){
$tf.='<tr>
<td width="20%">'.$app_list_strings['moduleList'][$d].'</td>
<td width="80%">'.$focus->selectTemplateFile($d,$focus->getListOfTemplateFiles($dir_path,$d),$arr[$d]).'</td>
</tr>';
}
$tf.='</table>';
$edit->ss->assign("TEMPLATE_FILES",$tf);
echo $edit->display();
?>

View File

@@ -0,0 +1,362 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*****************************************************************************
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/rpl.php. Software distributed under the
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
* either express or implied.
*
* You may:
* a) Use and distribute this code exactly as you received without payment or
* a royalty or other fee.
* b) Create extensions for this code, provided that you make the extensions
* publicly available and document your modifications clearly.
* c) Charge for a fee for warranty or support or for accepting liability
* obligations for your customers.
*
* You may NOT:
* a) Charge for the use of the original code or extensions, including in
* electronic distribution models, such as ASP (Application Service
* Provider).
* b) Charge for the original source code or your extensions other than a
* nominal fee to cover distribution costs where such distribution
* involves PHYSICAL media.
* c) Modify or delete any pre-existing copyright notices, change notices,
* or License text in the Licensed Software
* d) Assert any patent claims against the Licensor or Contributors, or
* which would in any way restrict the ability of any third party to use the
* Licensed Software.
*
* You must:
* a) Document any modifications you make to this code including the nature of
* the change, the authors of the change, and the date of the change.
* b) Make the source code for any extensions you deploy available via an
* Electronic Distribution Mechanism such as FTP or HTTP download.
* c) Notify the licensor of the availability of source code to your extensions
* and include instructions on how to acquire the source code and updates.
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
* reproduce, perform, modify, sublicense, and distribute your extensions.
*
* The Original Code is: CommuniCore
* Olavo Farias
* 2006-04-7 olavo.farias@gmail.com
*
* The Initial Developer of the Original Code is CommuniCore.
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
* All Rights Reserved.
********************************************************************************/
// INCLUDE SUPPPORT MODULES
require_once('XTemplate/xtpl.php');
require_once('data/Tracker.php');
// INCLUDE MODULE OBJECT AND FORMS
require_once('modules/EcmDocumentTemplates/EcmDocumentTemplate.php');
require_once('modules/EcmDocumentTemplates/Forms.php');
global $app_strings;
global $mod_strings;
global $mod_strings;
global $current_user;
global $sugar_version, $sugar_config;
// INSTANTIATES THE MODULE CLASSES
$focus = new EcmDocumentTemplate();
// IF PROCESSING AN EXISTING RECORD, RETRIEVE IT
if(isset($_REQUEST['record'])) {
$focus->retrieve($_REQUEST['record']);
$focus->unformat_all_fields();
}
if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
$focus->id = "";
$focus->simplemodule_number = "";
}
$prefillArray = array(
'priority' => 'priority',
'name' => 'name',
'description' => 'description',
'status' => 'status',
'type' => 'type',
);
foreach($prefillArray as $requestKey => $focusVar) {
if (isset($_REQUEST[$requestKey]) && is_null($focus->$focusVar)) {
$focus->$focusVar = urldecode($_REQUEST[$requestKey]);
}
}
// BUILD MODULE TITLE LINE
echo "\n<p>\n";
echo get_module_title($mod_strings['LBL_MODULE_ID'], $mod_strings['LBL_MODULE_NAME'].": ".$focus->name, true);
echo "\n</p>\n";
global $theme;
$theme_path = "themes/".$theme."/";
$image_path = $theme_path."images/";
require_once ($theme_path.'layout_utils.php');
$GLOBALS['log']->info("EcmDocumentTemplates detail view");
// ASSIGN XTEMPLATE
$xtpl = new XTemplate ('modules/EcmDocumentTemplates/EditView.html');
// FILL XTEMPLATE MODULE & APPLICATION LANGUAGE STRINGS
$xtpl->assign("MOD", $mod_strings);
$xtpl->assign("APP", $app_strings);
$xtpl->assign("CALENDAR_DATEFORMAT", $timedate->get_cal_date_format());
if (isset($_REQUEST['return_module'])) $xtpl->assign("RETURN_MODULE", $_REQUEST['return_module']);
if (isset($_REQUEST['return_action'])) $xtpl->assign("RETURN_ACTION", $_REQUEST['return_action']);
if (isset($_REQUEST['return_id'])) $xtpl->assign("RETURN_ID", $_REQUEST['return_id']);
if (empty($_REQUEST['return_id'])) {
$xtpl->assign("RETURN_ACTION", 'index');
}
///////////////////////////////////////
// SETUP POPUPS START
// Users Popup
$json = getJSONobj();
$popup_request_data = array(
'call_back_function' => 'set_return',
'form_name' => 'EditView',
'field_to_name_array' => array(
'id' => 'assigned_user_id',
'user_name' => 'assigned_user_name',
),
);
$xtpl->assign('encoded_users_popup_request_data', $json->encode($popup_request_data));
$popup_request_data = array (
'call_back_function' => 'set_return',
'form_name' => 'EditView',
'field_to_name_array' => array (
'id' => 'account_id',
'name' => 'account_name',
),
);
$xtpl->assign("encoded_accounts_popup_request_data", $json->encode($popup_request_data));
/*
$popup_request_data = array(
'call_back_function' => 'set_return',
'form_name' => 'EditView',
'field_to_name_array' => array(
'id' => 'account_id',
'name' => 'account_name',
),
);
$json = getJSONobj();
$xtpl->assign('encoded_account_popup_request_data', $json->encode($popup_request_data));*/
//
////////////////////////////////////////////////////////////////////////////////
// ACCOUNT_ID WILL BE SET WHEN USER CHOOSES TO CREATE A NEW SIMPLEMODULE FROM ACCOUNT DETAIL VIEW.
if (isset($_REQUEST['account_id'])) $xtpl->assign("ACCOUNT_ID", $_REQUEST['account_id']);
if (isset($_REQUEST['contact_id'])) $xtpl->assign("CONTACT_ID", $_REQUEST['contact_id']);
// SET THE CASE_ID, IF SET.
// WITH NEW CONCEPT OF SUBPANELS IT,
// WHEN THE SUBPANEL IS DISPLAYED IT PULLS FROM THE CLASS NAME WHICH IN THE SITUATION OF CASES IS ACASE SO THE FORM IS GENERATED
// WITH ACASE_ID INSTEAD OF CASE_ID, SO I HAVE DONE THE MAPPING HERE
if (isset($_REQUEST['acase_id'])) $xtpl->assign("CASE_ID",$_REQUEST['acase_id']);
else if(isset($_REQUEST['case_id'])) $xtpl->assign("CASE_ID",$_REQUEST['case_id']);
////////////////////////////////////////////////////////////////////////////////
// QUICK SEARCH SETUP
require_once('include/QuickSearchDefaults.php');
$qsd = new QuickSearchDefaults();
$sqs_objects = array (
'assigned_user_name' => $qsd->getQSUser(),
'account_name' => array (
'method' => 'query',
'modules' => array('Accounts'),
'field_list' => array('name', 'id'),
'populate_list' => array('account_name', 'account_id'),
'conditions' => array (
array('name'=>'name','op'=>'like_custom','end'=>'%','value'=>''),
array('name'=>'name','op'=>'like_custom','begin'=>'% ','end'=>'%','value'=>'')
),
'group' => 'or',
'order' => 'name',
'limit' => '300',
'no_match_text' => $app_strings['ERR_SQS_NO_MATCH']
),
);
$quicksearch_js = $qsd->getQSScripts();
$quicksearch_js .= '<script type="text/javascript" language="javascript">sqs_objects = ' . $json->encode($sqs_objects) . '</script>';
// QUICK SEARCH SETUP
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// ASSIGN GLOBAL VARIABLES
$xtpl->assign("THEME", $theme);
$xtpl->assign("IMAGE_PATH", $image_path);
$xtpl->assign("PRINT_URL", "index.php?".$GLOBALS['request_string']);
$xtpl->assign("JAVASCRIPT", get_set_focus_js().get_validate_record_js(). $quicksearch_js);
$xtpl->assign("USER_DATEFORMAT", '('. $timedate->get_user_date_format().')');
$xtpl->assign("CALENDAR_DATEFORMAT", $timedate->get_cal_date_format());
// ASSIGN GLOBAL VARIABLES
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// ASSIGN MODULE DEFAULT VARIABLES
$xtpl->assign("ID", $focus->id);
if (!empty($focus->name))
$xtpl->assign("NAME", $focus->name);
else $xtpl->assign("NAME", "");
$xtpl->assign("DATE_ENTERED", $focus->date_entered);
$xtpl->assign("DATE_MODIFIED", $focus->date_modified);
$xtpl->assign("CREATED_BY", $focus->created_by_name);
$xtpl->assign("MODIFIED_BY", $focus->modified_by_name);
if (empty($focus->assigned_user_id) && empty($focus->id)) $focus->assigned_user_id = $current_user->id;
if (empty($focus->assigned_name) && empty($focus->id)) $focus->assigned_user_name = $current_user->user_name;
$xtpl->assign("ASSIGNED_USER_OPTIONS", get_select_options_with_id(get_user_array(TRUE, "Active", $focus->assigned_user_id), $focus->assigned_user_id));
$xtpl->assign("ASSIGNED_USER_NAME", $focus->assigned_user_name);
$xtpl->assign("ASSIGNED_USER_ID", $focus->assigned_user_id );
//footer
$xtpl->assign("FOOTER_ACCOUNT", $focus->footer_account );
$xtpl->assign("FOOTER_ADDRESS", $focus->footer_address );
$xtpl->assign("FOOTER_PHONE", $focus->footer_phone );
$xtpl->assign("FOOTER_FAX", $focus->footer_fax );
$xtpl->assign("FOOTER_KRS", $focus->footer_krs );
$xtpl->assign("FOOTER_NIP", $focus->footer_nip );
$xtpl->assign("FOOTER_REGON", $focus->footer_regon );
$xtpl->assign("FOOTER_CAPITAL", $focus->footer_capital );
$xtpl->assign("FOOTER_MANAGEMENT", $focus->footer_management );
$xtpl->assign("FOOTER_SWIFT", $focus->footer_swift );
$xtpl->assign("FOOTER_BANKNAME", $focus->footer_bankname );
$xtpl->assign("FOOTER_VATID", $focus->footer_vatid );
if(isset($focus->document_number_format_id)) $xtpl->assign("DOCUMENT_NUMBER_FORMAT_OPTIONS", get_select_options_with_id($app_list_strings['ecmdocumenttemplates_document_number_format_dom'], $focus->document_number_format_id));
else $xtpl->assign("DOCUMENT_NUMBER_FORMAT_OPTIONS", get_select_options_with_id($app_list_strings['ecmdocumenttemplates_document_number_format_dom'], ''));
if(isset($focus->documents_per_day_id)) $xtpl->assign("DOCUMENTS_PER_DAY_OPTIONS", get_select_options_with_id($app_list_strings['ecmdocumenttemplates_documents_per_day_dom'], $focus->documents_per_day_id));
else $xtpl->assign("DOCUMENTS_PER_DAY_OPTIONS", get_select_options_with_id($app_list_strings['ecmdocumenttemplates_documents_per_day_dom'], ''));
$xtpl->assign("DOCUMENT_NUMBER_LETTER", $focus->document_number_letter);
$xtpl->assign("CORRECT_NUMBER_LETTER", $focus->correct_number_letter);
// ASSIGN MODULE SPECIFIC VARIABLES
require_once('modules/EcmDocumentTemplates/FileUpload.php');
$f = new FileUpload();
// $xtpl->assign("FORMFILE", $f->getFormHTML());
$xtpl->assign("LOGO_PATH", $focus->logo_path);
$xtpl->assign("ACCOUNT_NAME", $focus->account_name);
$xtpl->assign("ACCOUNT_ID", $focus->account_id);
$xtpl->assign("ACCOUNT_NUMBER", $focus->account_number);
/*
$xtpl->assign("CURRENCY", $focus->currency);
if (!empty($_REQUEST['table_currency'])) {
$xtpl->assign("TABLE_CURRENCY", "checked");
}
if ($focus->table_currency == '1') $xtpl->assign("TABLE_CURRENCY", "checked");
*/
// ASSIGN MODULE DROPDOWNS WITH DEFAULT KEY
// ASSIGN MODULE VARIABLES AFFECTED BY DUPLICATE ACTION
if(!isset($_REQUEST['isDuplicate'])) {
$focus->id = "";
}
// ASSIGN MODULE DROPDOWNS WITHOUT DEFAULT KEY
//BUILDER:END of xtpl
// ADD CUSTOM FIELDS
require_once('modules/DynamicFields/templates/Files/EditView.php');
////////////////////////////////////////////////////////////////////////////////
// USER ASSIGNMENT
global $current_user;
if(is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])){
$record = '';
// USER ASSIGNMENT
////////////////////////////////////////////////////////////////////////////////
if(!empty($_REQUEST['record'])){
$record = $_REQUEST['record'];
}
$xtpl->assign("ADMIN_EDIT","<a href='index.php?action=index&module=DynamicLayout&from_action=".$_REQUEST['action'] ."&from_module=".$_REQUEST['module'] ."&record=".$record. "'>".get_image($image_path."EditLayout","border='0' alt='Edit Layout' align='bottom'")."</a>");
}
$currency="";
$currency.="<select name='currency'><option value='pln'";
if($focus->currency=="pln")$currency.=" selected";
$currency.=">PLN</option><option value='eur'";
if($focus->currency=="eur")$currency.=" selected";
$currency.=">EUR</option></select>";
$xtpl->assign("CURRENCY", $currency);
require_once('include/javascript/javascript.php');
$javascript = new javascript();
$javascript->setFormName('EditView');
$javascript->setSugarBean($focus);
$javascript->addAllFields('');
//BUILDER:START Pro only
// $javascript->addFieldGeneric( 'team_name', 'varchar', $app_strings['LBL_TEAM'] ,'true');
// $javascript->addToValidateBinaryDependency('team_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'] . $app_strings['LBL_TEAM'], 'false', '', 'team_id');
//BUILDER:END Pro only
$javascript->addToValidateBinaryDependency('assigned_user_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'] . $app_strings['LBL_ASSIGNED_TO'], 'false', '', 'assigned_user_id');
$xtpl->assign("JAVASCRIPT_VALIDATE", $javascript->getScript());
$xtpl->parse("main");
$xtpl->out("main");
////////////////////////////////////////////////////////////////////////////////
/// SELECT CHANGES TEXT INPUT FIELD
/*
$prob_array = $json->encode($app_list_strings['sales_probability_dom']);
$prePopProb = '';
if(empty($focus->id)) $prePopProb = 'document.getElementsByName(\'sales_stage\')[0].onchange();';
echo <<<EOQ
<script>
prob_array = $prob_array;
document.getElementsByName('sales_stage')[0].onchange = function() {
if(typeof(document.getElementsByName('sales_stage')[0].value) != "undefined" && prob_array[document.getElementsByName('sales_stage')[0].value]) {
document.getElementsByName('probability')[0].value = prob_array[document.getElementsByName('sales_stage')[0].value];
}
};
$prePopProb
</script>
EOQ;
*/
//
/// SELECT CHANGES TEXT INPUT FIELD
////////////////////////////////////////////////////////////////////////////////
require_once('modules/SavedSearch/SavedSearch.php');
$savedSearch = new SavedSearch();
$json = getJSONobj();
$savedSearchSelects = $json->encode(array($GLOBALS['app_strings']['LBL_SAVED_SEARCH_SHORTCUT'] . '<br>' . $savedSearch->getSelect('EcmDocumentTemplates')));
$str = "<script>
YAHOO.util.Event.addListener(window, 'load', SUGAR.util.fillShortcuts, $savedSearchSelects);
</script>";
echo $str;
?>

View File

@@ -0,0 +1,43 @@
<?php
class FileUpload {
var $name;
var $toPath;
var $newName;
var $location;
function upload_file($name, $toPath, $newName="") {
$file_tmp_name = $_FILES[$name]['tmp_name'];
$file_name = $_FILES[$name]['name'];
$file_size = $_FILES[$name]['size'];
if(is_uploaded_file($file_tmp_name)) {
$ext = strtolower(substr(strrchr($file_name, "."),1));
while(file_exists($p = $toPath.create_guid().".".$ext));
move_uploaded_file($file_tmp_name, $p);
}
return $p;
}
function getFormHTML($ajax = true) {
$html = '';
if($ajax == true) {
$html = '<iframe src="index.php?module=EcmDocumentTemplates&action=FileUpload&to_pdf=1&file=dfs">Yours browser not accept iframes!</iframe>';
} else {
}
return $html;
}
};
if(isset($_REQUEST['form']) && $_REQUEST['form']!='') {
echo '<form name="FileUpload" action="index.php" enctype="multipart/form-data">
<input type="hidden" name="module" value="EcmDocumentTemplates" />
<input type="hidden" name="action" value="FileUpload" />
<input type="hidden" name="to_pdf" value="1" />
<input type="file" id="logo_image" name="logo_image" value="" />
</form>
';
}
?>

View File

@@ -0,0 +1,9 @@
<?php
function get_validate_record_js () {
}
function get_new_record_form () {
}
?>

View File

@@ -0,0 +1,59 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*****************************************************************************
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/rpl.php. Software distributed under the
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
* either express or implied.
*
* You may:
* a) Use and distribute this code exactly as you received without payment or
* a royalty or other fee.
* b) Create extensions for this code, provided that you make the extensions
* publicly available and document your modifications clearly.
* c) Charge for a fee for warranty or support or for accepting liability
* obligations for your customers.
*
* You may NOT:
* a) Charge for the use of the original code or extensions, including in
* electronic distribution models, such as ASP (Application Service
* Provider).
* b) Charge for the original source code or your extensions other than a
* nominal fee to cover distribution costs where such distribution
* involves PHYSICAL media.
* c) Modify or delete any pre-existing copyright notices, change notices,
* or License text in the Licensed Software
* d) Assert any patent claims against the Licensor or Contributors, or
* which would in any way restrict the ability of any third party to use the
* Licensed Software.
*
* You must:
* a) Document any modifications you make to this code including the nature of
* the change, the authors of the change, and the date of the change.
* b) Make the source code for any extensions you deploy available via an
* Electronic Distribution Mechanism such as FTP or HTTP download.
* c) Notify the licensor of the availability of source code to your extensions
* and include instructions on how to acquire the source code and updates.
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
* reproduce, perform, modify, sublicense, and distribute your extensions.
*
* The Original Code is: CommuniCore
* Olavo Farias
* 2006-04-7 olavo.farias@gmail.com
*
* The Initial Developer of the Original Code is CommuniCore.
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
* All Rights Reserved.
********************************************************************************/
global $mod_strings;
if(ACLController::checkAccess('EcmDocumentTemplates', 'edit', true))
$module_menu [] = Array("index.php?module=EcmDocumentTemplates&action=EditView&return_module=EcmDocumentTemplates&return_action=DetailView", $mod_strings['LNK_NEW_ECMDOCUMENTTEMPLATES'],"CreateEcmDocumentTemplates", 'EcmDocumentTemplates');
if(ACLController::checkAccess('EcmDocumentTemplates', 'list', true))
$module_menu [] = Array("index.php?module=EcmDocumentTemplates&action=index&return_module=EcmDocumentTemplates&return_action=DetailView", $mod_strings['LNK_ECMDOCUMENTTEMPLATES_LIST'],"EcmDocumentTemplates", 'EcmDocumentTemplates');
if(ACLController::checkAccess('EcmDocumentTemplates','list', true)) $module_menu[] = Array('#', '<span style="display: none">wp_shortcut_fill_0</span>', '');
?>

View File

@@ -0,0 +1,128 @@
<?php
class ModuleFieldsParser {
var $modules;
var $name;
function ModuleFieldsParser($name = 'mfp') {
$this->modules = Array();
if(file_exists('modules/EcmDocumentTemplates/ModuleFieldsParser/config.php')) {
require_once('modules/EcmDocumentTemplates/ModuleFieldsParser/config.php');
$this->modules = $mfp_modules;
}
$this->name = $name;
}
function getModulesSelectOptions($fieldRealNames = false) {
global $app_list_strings;
$arr = array();
if(count($this->modules)>0) {
foreach($this->modules as $key => $value) {
if(isset($value['name']) && $value['name'] != '')
if(isset($app_list_strings['moduleList'][$value['name']]) && $app_list_strings['moduleList'][$value['name']] != '')
$value['name'] = $app_list_strings['moduleList'][$value['name']];
$arr[$key]['name'] = $value['name'];
$arr[$key]['fields'] = $this->getModuleFieldsSelectOptions($key,$fieldRealNames);
}
}
return $arr;
}
function getModuleFieldsSelectOptions($module,$fieldRealNames = false) {
global $beanList, $current_language, $GLOBALS;
$dict = null;
$file = 'cache/modules/'.$module.'/'.$beanList[$module].'vardefs.php';
if(file_exists($file)) {
include($file);
$dict = $GLOBALS['dictionary'][$beanList[$module]]['fields'];
}
else {
$file = 'modules/'.$module.'/vardefs.php';
if(file_exists($file)) { include($file); $dict = $dictionary[$beanList[$module]]['fields']; }
}
if($dict) {
$mod = return_module_language($current_language, $module);
$arr = array();
foreach($dict as $key => $value) {
$tmp = '$'.$this->modules[$module]['prefix'].$value['name'];
if(!$fieldRealNames)
$arr[$tmp] = ((isset($mod[$value['vname']]) && $mod[$value['vname']] != '') ? $mod[$value['vname']] : $value['name']);
else
$arr[$tmp] = $value['name'];
}
return $arr;
}
return array();
}
function getJS() {
$json = getJSONobj();
$js = '<script language="javascript">';
$js .= 'var '.$this->name.'_data = '.$json->encode($this->getModulesSelectOptions()).';';
$js .= 'function '.$this->name.'_loadModules() { var ms = document.getElementById("'.$this->name.'_module"); for(x in '.$this->name.'_data) { ms.options[ms.options.length] = new Option('.$this->name.'_data[x]["name"],x,false); }; }';
$js .= 'function '.$this->name.'_loadFields() { var ms = document.getElementById("'.$this->name.'_module"); var fs = document.getElementById("'.$this->name.'_fields"); while(fs.options.length>0) fs.remove(0); var fields = '.$this->name.'_data[ms.value]["fields"]; for(x in fields) fs.options[fs.options.length] = new Option(fields[x],x,false); fs.onchange(); };';
$js .= 'function '.$this->name.'_loadField() { var fs = document.getElementById("'.$this->name.'_fields"); var fe = document.getElementById("'.$this->name.'_field"); fe.value = fs.value; };';
$js .= $this->name.'_loadModules(); '.$this->name.'_loadFields(); '.$this->name.'_loadField();';
$js .= '</script>';
return $js;
}
function getFormHTML($smarty = false, $name = '') {
if($name != '') $this->name = $name;
$html = '
<span>
<select id="'.$this->name.'_module" name="'.$this->name.'_module" onChange="'.$this->name.'_loadFields();"></select>&nbsp;
<select id="'.$this->name.'_fields" name="'.$this->name.'_fields" onChange="'.$this->name.'_loadField()"></select>&nbsp;
<input id="'.$this->name.'_field" name="'.$this->name.'_field" value="" size="40">'
.($smarty ? '{literal}' : '').$this->getJS().($smarty ? '{/literal}' : '').
'</span>';
return $html;
}
function fillFocusToModules() {
foreach($this->modules as $key => $value) {
if((!isset($value['focus']) || $value['focus'] == '') && (isset($value['id']) && $value['id'] != '')) {
global $beanFiles, $beanList;
$path = $beanFiles[$beanList[$key]];
if(file_exists($path)) {
require_once($path);
$this->modules[$key]['focus'] = new $beanList[$key]();
$this->modules[$key]['focus']->format_all_fields();
}
}
}
}
function parseText($text) {
$this->fillFocusToModules();
$temp = $this->getModulesSelectOptions(true);
foreach($this->modules as $module => $arr) {
// var_dump($this->modules[$module]); echo '<br><br><br><br><br><br><br><br><br><br>';
if(isset($arr['focus']) && $arr['focus']!='') {
foreach($temp[$module]['fields'] as $field => $value) {
//var_dump($field.' - '.$value.' - '.((isset($this->modules[$module]['focus']->$value) && $this->modules[$module]['focus']->$value != '')?$this->modules[$module]['focus']->$value:''));
try {
$text = str_replace($field,((isset($this->modules[$module]['focus']->$value) && $this->modules[$module]['focus']->$value != '' && is_string($this->modules[$module]['focus']->$value))?$this->modules[$module]['focus']->$value:''),$text);
} catch(Exception $e) { }
}
}
}
return $text;
}
function clear() {
$this->modules = null;
$this->modules = array();
}
function add($module,$prefix,$focus,$name='') {
$this->modules[$module]['prefix'] = $prefix;
$this->modules[$module]['focus'] = $focus;
$this->modules[$module]['id'] = '';
$this->modules[$module]['name'] = $name;
}
};
?>

View File

@@ -0,0 +1,26 @@
<?php
global $app_list_strings;
$mfp_modules = Array(
'EcmDocumentTemplates' => array(
'name' => $app_list_strings['moduleList']['EcmDocumentTemplates'],
'prefix' => 'dt_',
'id' => '',
'focus' => ''
),
'Accounts' => array(
'name' => $app_list_strings['moduleList']['Accounts'],
'prefix' => 'acc_',
'id' => '',
'focus' => ''
),
'Users' => array(
'name' => $app_list_strings['moduleList']['Users'],
'prefix' => 'us_',
'id' => '',
'focus' => ''
),
);
?>

View File

@@ -0,0 +1,122 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*****************************************************************************
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/rpl.php. Software distributed under the
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
* either express or implied.
*
* You may:
* a) Use and distribute this code exactly as you received without payment or
* a royalty or other fee.
* b) Create extensions for this code, provided that you make the extensions
* publicly available and document your modifications clearly.
* c) Charge for a fee for warranty or support or for accepting liability
* obligations for your customers.
*
* You may NOT:
* a) Charge for the use of the original code or extensions, including in
* electronic distribution models, such as ASP (Application Service
* Provider).
* b) Charge for the original source code or your extensions other than a
* nominal fee to cover distribution costs where such distribution
* involves PHYSICAL media.
* c) Modify or delete any pre-existing copyright notices, change notices,
* or License text in the Licensed Software
* d) Assert any patent claims against the Licensor or Contributors, or
* which would in any way restrict the ability of any third party to use the
* Licensed Software.
*
* You must:
* a) Document any modifications you make to this code including the nature of
* the change, the authors of the change, and the date of the change.
* b) Make the source code for any extensions you deploy available via an
* Electronic Distribution Mechanism such as FTP or HTTP download.
* c) Notify the licensor of the availability of source code to your extensions
* and include instructions on how to acquire the source code and updates.
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
* reproduce, perform, modify, sublicense, and distribute your extensions.
*
* The Original Code is: CommuniCore
* Olavo Farias
* 2006-04-7 olavo.farias@gmail.com
*
* The Initial Developer of the Original Code is CommuniCore.
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
* All Rights Reserved.
********************************************************************************/
require_once('modules/EcmDocumentTemplates/EcmDocumentTemplate.php');
require_once('include/formbase.php');
require_once('modules/EcmDocumentTemplates/UploadFile.php');
//var_dump($_FILES); die();
/*
else
{
$z="select logo_name from ecmdocumenttemplates where id='".$_REQUEST['record']."'";
$w=mysql_query($z);
$r=mysql_fetch_array($w);
$logo=$r['logo_name'];
}
$_POST['logo_name']=$logo;
*/
$focus = new EcmDocumentTemplate();
$focus->retrieve($_POST['record']);
$oldid=$_POST['record'];
$_POST['record']="";
$focus->id="";
if(!isset($_POST['old_logo_name']) || $_POST['old_logo_name']=='') {
$focus->logo_id = '';
$focus->logo_name = '';
$focus->logo_path = '';
}
if(isset($_FILES['logo_name']['name']) && $_FILES['logo_name']['name']) {
$focus->logo_id = upload_file('logo_name','modules/EcmDocumentTemplates/files/');
$focus->logo_name = ($focus->logo_id == '') ? '' : $_FILES['logo_name']['name'];
$focus->logo_path = ($focus->logo_id == '') ? '' : 'modules/EcmDocumentTemplates/files/'.$focus->logo_id;
}
if(!$focus->ACLAccess('Save')){
ACLController::displayNoAccess(true);
sugar_cleanup(true);
}
if (!empty($_POST['assigned_user_id']) && ($focus->assigned_user_id != $_POST['assigned_user_id']) && ($_POST['assigned_user_id'] != $current_user->id)) {
$check_notify = TRUE;
}else{
$check_notify = FALSE;
}
foreach($focus->column_fields as $field){
if(isset($_POST[$field])){
$value = $_POST[$field];
$focus->$field = $value;
}
}
foreach($focus->additional_column_fields as $field){
if(isset($_POST[$field])){
$value = $_POST[$field];
$focus->$field = $value;
}
}
if(isset($_POST['show_header_on_all_pages']) && $_POST['show_header_on_all_pages']) $focus->show_header_on_all_pages = 1; else $focus->show_header_on_all_pages = 0;
if(isset($_POST['show_header_on_all_pages']) && $_POST['show_header_on_all_pages']) $focus->show_header_on_all_pages = 1; else $focus->show_header_on_all_pages = 0;
if(isset($_POST['change_all_old_records']) && $_POST['change_all_old_records']) $focus->change_all_old_records = 1; else $focus->change_all_old_records = 0;
$focus->save($check_notify);
$return_id = $focus->id;
mysql_query("update ecmdocumenttemplates set deleted='1' where id='".$oldid."'");
//handleRedirect($return_id,'EcmDocumentTemplates');
header("Location: index.php?module=EcmDocumentTemplates&action=DetailView&record=".$return_id);
?>

View File

@@ -0,0 +1,18 @@
<?php
function upload_file($name, $toPath, $newName="") {
$file_tmp_name = $_FILES[$name]['tmp_name'];
$file_name = $_FILES[$name]['name'];
$file_size = $_FILES[$name]['size'];
if(is_uploaded_file($file_tmp_name)) {
$ext = strtolower(substr(strrchr($file_name, "."),1));
if($ext != "jpg" && $ext != "png") return '';
while(file_exists($p = $toPath.($guid=create_guid()).".".$ext));
move_uploaded_file($file_tmp_name, $p);
}
return $guid.'.'.$ext;
}
?>

View File

@@ -0,0 +1,139 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*****************************************************************************
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/rpl.php. Software distributed under the
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
* either express or implied.
*
* You may:
* a) Use and distribute this code exactly as you received without payment or
* a royalty or other fee.
* b) Create extensions for this code, provided that you make the extensions
* publicly available and document your modifications clearly.
* c) Charge for a fee for warranty or support or for accepting liability
* obligations for your customers.
*
* You may NOT:
* a) Charge for the use of the original code or extensions, including in
* electronic distribution models, such as ASP (Application Service
* Provider).
* b) Charge for the original source code or your extensions other than a
* nominal fee to cover distribution costs where such distribution
* involves PHYSICAL media.
* c) Modify or delete any pre-existing copyright notices, change notices,
* or License text in the Licensed Software
* d) Assert any patent claims against the Licensor or Contributors, or
* which would in any way restrict the ability of any third party to use the
* Licensed Software.
*
* You must:
* a) Document any modifications you make to this code including the nature of
* the change, the authors of the change, and the date of the change.
* b) Make the source code for any extensions you deploy available via an
* Electronic Distribution Mechanism such as FTP or HTTP download.
* c) Notify the licensor of the availability of source code to your extensions
* and include instructions on how to acquire the source code and updates.
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
* reproduce, perform, modify, sublicense, and distribute your extensions.
*
* The Original Code is: CommuniCore
* Olavo Farias
* 2006-04-7 olavo.farias@gmail.com
*
* The Initial Developer of the Original Code is CommuniCore.
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
* All Rights Reserved.
********************************************************************************/
$fields_array['EcmDocumentTemplate'] = array (
'column_fields' => Array(
"id",
"name",
"date_entered",
"date_modified",
"modified_user_id",
"assigned_user_id",
"created_by",
"deleted",
//NEW COLUMN FIELDS
"place_of_regster",
"logo_path",
"logo_id",
"logo_name",
"account_name",
"account_id",
"account_number",
"currency",
"table_currency",
'footer_account',
'footer_address',
'footer_phone',
'footer_fax',
'footer_krs',
'footer_nip',
'footer_regon',
'footer_capital',
'footer_management',
'footer_swift',
'footer_bankname',
'footer_vatid',
'document_number_format_id',
'documents_per_day_id',
'documents_per',
//'document_number_letter',
//'correct_number_letter',
'ecmlanguage',
'footer_text',
'header_text',
'show_header_on_all_pages',
'show_footer_on_all_pages',
'change_all_old_records',
'template_files_defs',
),
'list_fields' => Array(
'id',
'name',
'assigned_user_name',
'assigned_user_id',
//NEW LIST_FIELDS
'logo_path',
"logo_id",
"logo_name",
'account_name',
'account_id',
'account_number',
'currency',
'table_currency',
'footer_account',
'footer_address',
'footer_phone',
'footer_fax',
'footer_krs',
'footer_nip',
'footer_regon',
'footer_capital',
'footer_management',
'footer_swift',
'footer_bankname',
'footer_vatid',
'document_number_format_id',
'documents_per_day_id',
'documents_per',
//'document_number_letter',
//'correct_number_letter',
'ecmlanguage',
'footer_text',
'header_text',
'show_header_on_all_pages',
'show_footer_on_all_pages',
'change_all_old_records',
'template_files_defs',
),
'required_fields' => array(
'name'=>1
),
);
?>

View File

@@ -0,0 +1,33 @@
<?php
/*
Default document number format to convert is YMDNR for example 20080501001
where Y - year, M - month, D - day, NR - 4 digits number.
Example 1:
echo formatDocumentNumber('200805010001','Y/M/D/NR');
Results:
2008/05/01/001
Example 2:
.../formatDocumentNumber.php?dn=20080501001&f=Y/M/D%20NR
Results:
2008/05/01 001
*/
function formatDocumentNumber($documentNumber, $format, $d = '3') {
$format = str_replace('CODE', '[cOdE]', $format);
$ARR1 = array ('y', 'Y', 'M', 'D', 'NR', '[cOdE]');
$ARR2 = array (substr($documentNumber,2,2), substr($documentNumber,0,4), substr($documentNumber,4,2), substr($documentNumber,6,2), substr($documentNumber,8));
$ARR2[4] = sprintf("%0".$d."d",$ARR2[4]);
$ARR2[5] = 'CODE';
return str_replace($ARR1,$ARR2,$format);
}
if(isset($_REQUEST['dn']) && $_REQUEST['dn']!='' && isset($_REQUEST['f']) && $_REQUEST['f']!='') {
echo formatDocumentNumber($_REQUEST['dn'],$_REQUEST['f']);
}
if(isset($_REQUEST['f']) && $_REQUEST['f']!='' && isset($_REQUEST['d']) && $_REQUEST['d']!='' && isset($_REQUEST['ex']) && $_REQUEST['ex']!='') {
echo formatDocumentNumber(date("Ymd").'1',$_REQUEST['f'],$_REQUEST['d']);
}
?>

View File

@@ -0,0 +1,170 @@
<?php
$module = $_REQUEST['module'];
$cM = $_REQUEST['createModule'];
$lA = $_REQUEST['loaderAction'];
$fN = $_REQUEST['loaderFieldName'];
$record = $_REQUEST['record'];
if($lA == "EditView") {
ob_start();
$_REQUEST['module'] = $cM;
$_REQUEST['action'] = "EditView";
$_REQUEST['record'] = $record;
$_POST['module'] = $cM;
$_POST['action'] = "EditView";
$_POST['record'] = $record;
$_GET['record'] = $record;
include('index.php');
$out = ob_get_contents();
ob_end_clean();
echo $out;
return;
}
if($lA == "get_module_fields") {
global $beanList, $beanFiles;
$file = 'cache/modules/'.$cM.'/'.$beanList[$cM].'vardefs.php';
if(file_exists($file)) {
include($file);
$dict = $GLOBALS['dictionary'][$beanList[$cM]]['fields'];
}
else {
$file = 'modules/'.$cM.'/vardefs.php';
if(file_exists($file)) { include($file); $dict = $dictionary[$beanList[$cM]]['fields']; } else return;
}
$file = $beanFiles[$beanList[$cM]];
if(file_exists($file)) {
require_once($file);
$bean = new $beanList[$cM]();
$bean->retrieve($record);
if(isset($bean->id) && $bean->id != '') {
$arr = array();
foreach($dict as $key => $value) {
if(isset($bean->$value['name']) && (is_string($bean->$value['name']) || is_float($bean->$value['name']) || is_int($bean->$value['name']) || is_bool($bean->$value['name'])))
$arr[$value['name']] = $bean->$value['name'];
}
$json = getJSONobj();
echo '['.$json->encode($arr).']';
} else return;
}
return;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1250">
<title></title>
<script type="text/javascript" src="include/javascript/sugar_grp1_yui.js?s=5.0.0c&c="></script>
</head>
<body>
<div id="hidder" style="position:absolute;left:0;top:0;width:105%;height:100%;background-color:white;visibility:visible;text-align:center;padding:40px;"><img src="themes/default/images/loading.gif"/></div>
<script language="javascript">
function doRequest(where,post,success,error) {
this.Display = function(result) { success(result.responseText); }
this.Fail = function(result){ if(error) error(result); }
YAHOO.util.Connect.asyncRequest('POST',where,{success:this.Display,failure:this.Fail},post);
}
function iframeLoad() {
var frame = document.getElementById("input_create");
var doc = frame.contentDocument;
if(doc == undefined || doc == null)
doc = frame.contentWindow.document;
if(doc && doc.forms && ((doc.forms.EditView || doc.forms.DetailView || doc.forms.Save) || doc.return_module_fields)) {
if(doc.forms.EditView) {
} else
if(doc.forms.DetailView) {
var record = doc.forms.DetailView.record;
if(record && record.value != "") {
doRequest(
"index.php",
"module="+module+"&action=formloader&loaderAction=get_module_fields&createModule="+cM+"&to_pdf=1&record="+record.value,
function(result) {
if(result == '')
window.close();
else {
var obj = eval(result);
if(obj) {
obj = obj[0];
eval('window.opener.'+fN+'.responseData(obj)');
}
window.close();
}
},
function(result) {
window.close();
}
);
} else window.close();
} else
if(doc.forms.Save) {
}
} else { window.close(); return; }
var main = doc.getElementById('main');
if(main) {
var div = doc.createElement('div');
div.innerHTML = main.innerHTML;
main.innerHTML = '';
var div2 = doc.createElement('div');
div2.style.display = 'none';
div2.innerHTML = doc.body.innerHTML;
doc.body.innerHTML = '';
doc.body.appendChild(div2);
doc.body.appendChild(div);
if(doc && doc.forms && !doc.forms.DetailView) doc.body.FormLoader = true;
}
}
var oldLocation = '';
setInterval(function(){
var frame = document.getElementById("input_create");
if(frame) {
var doc = frame.contentDocument;
if(doc == undefined || doc == null)
doc = frame.contentWindow.document;
if(doc && doc.body && doc.body.FormLoader) {
if(hidder.style.visibility = "visible") hidder.style.visibility = "hidden";
} else {
if(hidder.style.visibility = "hidden") hidder.style.visibility = "visible"
}
}
},60);
</script>
<?php
if($lA == "ViewForm") {
echo '<script language="javascript">
var module = "'.$module.'";
var cM = "'.$cM.'";
var lA = "'.$lA.'";
var fN = "'.$fN.'";
</script>';
$data = '';
foreach($_REQUEST as $key=>$value) {
if(strpos($key,"fl_") === 0) {
$data .= "&".substr($key,3)."=".$value;
}
}
echo "<iframe onload='iframeLoad();' frameborder='no' width='100%' height='100%' id='input_create' name='input_create' src='index.php?module=$module&action=formloader&to_pdf=1&loaderAction=EditView&createModule=$cM".$data."'></iframe>";
}
?>
</body>
</html>

View File

@@ -0,0 +1,25 @@
<?php
$type='Type1';
$name='ArialMT';
$desc=array('Ascent'=>905,'Descent'=>-212,'CapHeight'=>716,'Flags'=>32,'FontBBox'=>'[-46 -283 979 896]','ItalicAngle'=>0,'StemV'=>70,'MissingWidth'=>750);
$up=-106;
$ut=73;
$cw=array(
chr(0)=>750,chr(1)=>750,chr(2)=>750,chr(3)=>750,chr(4)=>750,chr(5)=>750,chr(6)=>750,chr(7)=>750,chr(8)=>750,chr(9)=>750,chr(10)=>750,chr(11)=>750,chr(12)=>750,chr(13)=>750,chr(14)=>750,chr(15)=>750,chr(16)=>750,chr(17)=>750,chr(18)=>750,chr(19)=>750,chr(20)=>750,chr(21)=>750,
chr(22)=>750,chr(23)=>750,chr(24)=>750,chr(25)=>750,chr(26)=>750,chr(27)=>750,chr(28)=>750,chr(29)=>750,chr(30)=>750,chr(31)=>750,' '=>278,'!'=>278,'"'=>355,'#'=>556,'$'=>556,'%'=>889,'&'=>667,'\''=>191,'('=>333,')'=>333,'*'=>389,'+'=>584,
','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>278,';'=>278,'<'=>584,'='=>584,'>'=>584,'?'=>556,'@'=>1015,'A'=>667,
'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>500,'K'=>667,'L'=>556,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
'X'=>667,'Y'=>667,'Z'=>611,'['=>278,'\\'=>278,']'=>278,'^'=>469,'_'=>556,'`'=>333,'a'=>556,'b'=>556,'c'=>500,'d'=>556,'e'=>556,'f'=>278,'g'=>556,'h'=>556,'i'=>222,'j'=>222,'k'=>500,'l'=>222,'m'=>833,
'n'=>556,'o'=>556,'p'=>556,'q'=>556,'r'=>333,'s'=>500,'t'=>278,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>500,'{'=>334,'|'=>260,'}'=>334,'~'=>584,chr(127)=>750,chr(128)=>750,chr(129)=>750,chr(130)=>750,chr(131)=>750,
chr(132)=>750,chr(133)=>750,chr(134)=>750,chr(135)=>750,chr(136)=>750,chr(137)=>750,chr(138)=>750,chr(139)=>750,chr(140)=>750,chr(141)=>750,chr(142)=>750,chr(143)=>750,chr(144)=>750,chr(145)=>750,chr(146)=>750,chr(147)=>750,chr(148)=>750,chr(149)=>750,chr(150)=>750,chr(151)=>750,chr(152)=>750,chr(153)=>750,
chr(154)=>750,chr(155)=>750,chr(156)=>750,chr(157)=>750,chr(158)=>750,chr(159)=>750,chr(160)=>278,chr(161)=>667,chr(162)=>333,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>667,chr(167)=>556,chr(168)=>333,chr(169)=>667,chr(170)=>667,chr(171)=>611,chr(172)=>611,chr(173)=>333,chr(174)=>611,chr(175)=>611,
chr(176)=>400,chr(177)=>556,chr(178)=>333,chr(179)=>222,chr(180)=>333,chr(181)=>292,chr(182)=>500,chr(183)=>333,chr(184)=>333,chr(185)=>500,chr(186)=>500,chr(187)=>375,chr(188)=>500,chr(189)=>333,chr(190)=>500,chr(191)=>500,chr(192)=>722,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>556,
chr(198)=>722,chr(199)=>722,chr(200)=>722,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>667,chr(205)=>278,chr(206)=>278,chr(207)=>722,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
chr(220)=>722,chr(221)=>667,chr(222)=>611,chr(223)=>611,chr(224)=>333,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>222,chr(230)=>500,chr(231)=>500,chr(232)=>500,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>556,chr(237)=>278,chr(238)=>278,chr(239)=>615,chr(240)=>556,chr(241)=>556,
chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>549,chr(248)=>333,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>278,chr(255)=>333);
$enc='iso-8859-2';
$diff='128 /.notdef 130 /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 142 /.notdef 145 /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 158 /.notdef /.notdef 161 /Aogonek /breve /Lslash 165 /Lcaron /Sacute 169 /Scaron /Scedilla /Tcaron /Zacute 174 /Zcaron /Zdotaccent 177 /aogonek /ogonek /lslash 181 /lcaron /sacute /caron 185 /scaron /scedilla /tcaron /zacute /hungarumlaut /zcaron /zdotaccent /Racute 195 /Abreve 197 /Lacute /Cacute 200 /Ccaron 202 /Eogonek 204 /Ecaron 207 /Dcaron /Dcroat /Nacute /Ncaron 213 /Ohungarumlaut 216 /Rcaron /Uring 219 /Uhungarumlaut 222 /Tcommaaccent 224 /racute 227 /abreve 229 /lacute /cacute 232 /ccaron 234 /eogonek 236 /ecaron 239 /dcaron /dcroat /nacute /ncaron 245 /ohungarumlaut 248 /rcaron /uring 251 /uhungarumlaut 254 /tcommaaccent /dotaccent';
$file='arial.z';
$size1=5917;
$size2=25247;
?>

View File

@@ -0,0 +1,25 @@
<?php
$type='Type1';
$name='Arial-BoldMT';
$desc=array('Ascent'=>905,'Descent'=>-212,'CapHeight'=>716,'Flags'=>32,'FontBBox'=>'[-46 -319 972 919]','ItalicAngle'=>0,'StemV'=>120,'MissingWidth'=>750);
$up=-106;
$ut=105;
$cw=array(
chr(0)=>750,chr(1)=>750,chr(2)=>750,chr(3)=>750,chr(4)=>750,chr(5)=>750,chr(6)=>750,chr(7)=>750,chr(8)=>750,chr(9)=>750,chr(10)=>750,chr(11)=>750,chr(12)=>750,chr(13)=>750,chr(14)=>750,chr(15)=>750,chr(16)=>750,chr(17)=>750,chr(18)=>750,chr(19)=>750,chr(20)=>750,chr(21)=>750,
chr(22)=>750,chr(23)=>750,chr(24)=>750,chr(25)=>750,chr(26)=>750,chr(27)=>750,chr(28)=>750,chr(29)=>750,chr(30)=>750,chr(31)=>750,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584,
','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722,
'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889,
'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,chr(127)=>750,chr(128)=>750,chr(129)=>750,chr(130)=>750,chr(131)=>750,
chr(132)=>750,chr(133)=>750,chr(134)=>750,chr(135)=>750,chr(136)=>750,chr(137)=>750,chr(138)=>750,chr(139)=>750,chr(140)=>750,chr(141)=>750,chr(142)=>750,chr(143)=>750,chr(144)=>750,chr(145)=>750,chr(146)=>750,chr(147)=>750,chr(148)=>750,chr(149)=>750,chr(150)=>750,chr(151)=>750,chr(152)=>750,chr(153)=>750,
chr(154)=>750,chr(155)=>750,chr(156)=>750,chr(157)=>750,chr(158)=>750,chr(159)=>750,chr(160)=>278,chr(161)=>722,chr(162)=>333,chr(163)=>611,chr(164)=>556,chr(165)=>611,chr(166)=>667,chr(167)=>556,chr(168)=>333,chr(169)=>667,chr(170)=>667,chr(171)=>611,chr(172)=>611,chr(173)=>333,chr(174)=>611,chr(175)=>611,
chr(176)=>400,chr(177)=>556,chr(178)=>333,chr(179)=>278,chr(180)=>333,chr(181)=>385,chr(182)=>556,chr(183)=>333,chr(184)=>333,chr(185)=>556,chr(186)=>556,chr(187)=>479,chr(188)=>500,chr(189)=>333,chr(190)=>500,chr(191)=>500,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>611,
chr(198)=>722,chr(199)=>722,chr(200)=>722,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>667,chr(205)=>278,chr(206)=>278,chr(207)=>722,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
chr(220)=>722,chr(221)=>667,chr(222)=>611,chr(223)=>611,chr(224)=>389,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>278,chr(230)=>556,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>556,chr(237)=>278,chr(238)=>278,chr(239)=>719,chr(240)=>611,chr(241)=>611,
chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>549,chr(248)=>389,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>333,chr(255)=>333);
$enc='iso-8859-2';
$diff='128 /.notdef 130 /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 142 /.notdef 145 /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 158 /.notdef /.notdef 161 /Aogonek /breve /Lslash 165 /Lcaron /Sacute 169 /Scaron /Scedilla /Tcaron /Zacute 174 /Zcaron /Zdotaccent 177 /aogonek /ogonek /lslash 181 /lcaron /sacute /caron 185 /scaron /scedilla /tcaron /zacute /hungarumlaut /zcaron /zdotaccent /Racute 195 /Abreve 197 /Lacute /Cacute 200 /Ccaron 202 /Eogonek 204 /Ecaron 207 /Dcaron /Dcroat /Nacute /Ncaron 213 /Ohungarumlaut 216 /Rcaron /Uring 219 /Uhungarumlaut 222 /Tcommaaccent 224 /racute 227 /abreve 229 /lacute /cacute 232 /ccaron 234 /eogonek 236 /ecaron 239 /dcaron /dcroat /nacute /ncaron 245 /ohungarumlaut 248 /rcaron /uring 251 /uhungarumlaut 254 /tcommaaccent /dotaccent';
$file='arialbd.z';
$size1=5932;
$size2=25747;
?>

View File

@@ -0,0 +1,25 @@
<?php
$type='Type1';
$name='Arial-BoldItalicMT';
$desc=array('Ascent'=>905,'Descent'=>-212,'CapHeight'=>716,'Flags'=>96,'FontBBox'=>'[-109 -298 1068 905]','ItalicAngle'=>-12,'StemV'=>120,'MissingWidth'=>750);
$up=-106;
$ut=105;
$cw=array(
chr(0)=>750,chr(1)=>750,chr(2)=>750,chr(3)=>750,chr(4)=>750,chr(5)=>750,chr(6)=>750,chr(7)=>750,chr(8)=>750,chr(9)=>750,chr(10)=>750,chr(11)=>750,chr(12)=>750,chr(13)=>750,chr(14)=>750,chr(15)=>750,chr(16)=>750,chr(17)=>750,chr(18)=>750,chr(19)=>750,chr(20)=>750,chr(21)=>750,
chr(22)=>750,chr(23)=>750,chr(24)=>750,chr(25)=>750,chr(26)=>750,chr(27)=>750,chr(28)=>750,chr(29)=>750,chr(30)=>750,chr(31)=>750,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584,
','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722,
'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889,
'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,chr(127)=>750,chr(128)=>750,chr(129)=>750,chr(130)=>750,chr(131)=>750,
chr(132)=>750,chr(133)=>750,chr(134)=>750,chr(135)=>750,chr(136)=>750,chr(137)=>750,chr(138)=>750,chr(139)=>750,chr(140)=>750,chr(141)=>750,chr(142)=>750,chr(143)=>750,chr(144)=>750,chr(145)=>750,chr(146)=>750,chr(147)=>750,chr(148)=>750,chr(149)=>750,chr(150)=>750,chr(151)=>750,chr(152)=>750,chr(153)=>750,
chr(154)=>750,chr(155)=>750,chr(156)=>750,chr(157)=>750,chr(158)=>750,chr(159)=>750,chr(160)=>278,chr(161)=>722,chr(162)=>333,chr(163)=>611,chr(164)=>556,chr(165)=>611,chr(166)=>667,chr(167)=>556,chr(168)=>333,chr(169)=>667,chr(170)=>667,chr(171)=>611,chr(172)=>611,chr(173)=>333,chr(174)=>611,chr(175)=>611,
chr(176)=>400,chr(177)=>556,chr(178)=>333,chr(179)=>278,chr(180)=>333,chr(181)=>396,chr(182)=>556,chr(183)=>333,chr(184)=>333,chr(185)=>556,chr(186)=>556,chr(187)=>479,chr(188)=>500,chr(189)=>333,chr(190)=>500,chr(191)=>500,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>611,
chr(198)=>722,chr(199)=>722,chr(200)=>722,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>667,chr(205)=>278,chr(206)=>278,chr(207)=>722,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
chr(220)=>722,chr(221)=>667,chr(222)=>611,chr(223)=>611,chr(224)=>389,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>278,chr(230)=>556,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>556,chr(237)=>278,chr(238)=>278,chr(239)=>740,chr(240)=>611,chr(241)=>611,
chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>549,chr(248)=>389,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>333,chr(255)=>333);
$enc='iso-8859-2';
$diff='128 /.notdef 130 /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 142 /.notdef 145 /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 158 /.notdef /.notdef 161 /Aogonek /breve /Lslash 165 /Lcaron /Sacute 169 /Scaron /Scedilla /Tcaron /Zacute 174 /Zcaron /Zdotaccent 177 /aogonek /ogonek /lslash 181 /lcaron /sacute /caron 185 /scaron /scedilla /tcaron /zacute /hungarumlaut /zcaron /zdotaccent /Racute 195 /Abreve 197 /Lacute /Cacute 200 /Ccaron 202 /Eogonek 204 /Ecaron 207 /Dcaron /Dcroat /Nacute /Ncaron 213 /Ohungarumlaut 216 /Rcaron /Uring 219 /Uhungarumlaut 222 /Tcommaaccent 224 /racute 227 /abreve 229 /lacute /cacute 232 /ccaron 234 /eogonek 236 /ecaron 239 /dcaron /dcroat /nacute /ncaron 245 /ohungarumlaut 248 /rcaron /uring 251 /uhungarumlaut 254 /tcommaaccent /dotaccent';
$file='arialbi.z';
$size1=5962;
$size2=26288;
?>

View File

@@ -0,0 +1,25 @@
<?php
$type='Type1';
$name='Arial-ItalicMT';
$desc=array('Ascent'=>905,'Descent'=>-212,'CapHeight'=>716,'Flags'=>96,'FontBBox'=>'[-121 -275 1062 894]','ItalicAngle'=>-12,'StemV'=>70,'MissingWidth'=>750);
$up=-106;
$ut=73;
$cw=array(
chr(0)=>750,chr(1)=>750,chr(2)=>750,chr(3)=>750,chr(4)=>750,chr(5)=>750,chr(6)=>750,chr(7)=>750,chr(8)=>750,chr(9)=>750,chr(10)=>750,chr(11)=>750,chr(12)=>750,chr(13)=>750,chr(14)=>750,chr(15)=>750,chr(16)=>750,chr(17)=>750,chr(18)=>750,chr(19)=>750,chr(20)=>750,chr(21)=>750,
chr(22)=>750,chr(23)=>750,chr(24)=>750,chr(25)=>750,chr(26)=>750,chr(27)=>750,chr(28)=>750,chr(29)=>750,chr(30)=>750,chr(31)=>750,' '=>278,'!'=>278,'"'=>355,'#'=>556,'$'=>556,'%'=>889,'&'=>667,'\''=>191,'('=>333,')'=>333,'*'=>389,'+'=>584,
','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>278,';'=>278,'<'=>584,'='=>584,'>'=>584,'?'=>556,'@'=>1015,'A'=>667,
'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>500,'K'=>667,'L'=>556,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
'X'=>667,'Y'=>667,'Z'=>611,'['=>278,'\\'=>278,']'=>278,'^'=>469,'_'=>556,'`'=>333,'a'=>556,'b'=>556,'c'=>500,'d'=>556,'e'=>556,'f'=>278,'g'=>556,'h'=>556,'i'=>222,'j'=>222,'k'=>500,'l'=>222,'m'=>833,
'n'=>556,'o'=>556,'p'=>556,'q'=>556,'r'=>333,'s'=>500,'t'=>278,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>500,'{'=>334,'|'=>260,'}'=>334,'~'=>584,chr(127)=>750,chr(128)=>750,chr(129)=>750,chr(130)=>750,chr(131)=>750,
chr(132)=>750,chr(133)=>750,chr(134)=>750,chr(135)=>750,chr(136)=>750,chr(137)=>750,chr(138)=>750,chr(139)=>750,chr(140)=>750,chr(141)=>750,chr(142)=>750,chr(143)=>750,chr(144)=>750,chr(145)=>750,chr(146)=>750,chr(147)=>750,chr(148)=>750,chr(149)=>750,chr(150)=>750,chr(151)=>750,chr(152)=>750,chr(153)=>750,
chr(154)=>750,chr(155)=>750,chr(156)=>750,chr(157)=>750,chr(158)=>750,chr(159)=>750,chr(160)=>278,chr(161)=>667,chr(162)=>333,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>667,chr(167)=>556,chr(168)=>333,chr(169)=>667,chr(170)=>667,chr(171)=>611,chr(172)=>611,chr(173)=>333,chr(174)=>611,chr(175)=>611,
chr(176)=>400,chr(177)=>556,chr(178)=>333,chr(179)=>222,chr(180)=>333,chr(181)=>281,chr(182)=>500,chr(183)=>333,chr(184)=>333,chr(185)=>500,chr(186)=>500,chr(187)=>354,chr(188)=>500,chr(189)=>333,chr(190)=>500,chr(191)=>500,chr(192)=>722,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>556,
chr(198)=>722,chr(199)=>722,chr(200)=>722,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>667,chr(205)=>278,chr(206)=>278,chr(207)=>722,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
chr(220)=>722,chr(221)=>667,chr(222)=>611,chr(223)=>611,chr(224)=>333,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>222,chr(230)=>500,chr(231)=>500,chr(232)=>500,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>556,chr(237)=>278,chr(238)=>278,chr(239)=>625,chr(240)=>556,chr(241)=>556,
chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>549,chr(248)=>333,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>278,chr(255)=>333);
$enc='iso-8859-2';
$diff='128 /.notdef 130 /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 142 /.notdef 145 /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 158 /.notdef /.notdef 161 /Aogonek /breve /Lslash 165 /Lcaron /Sacute 169 /Scaron /Scedilla /Tcaron /Zacute 174 /Zcaron /Zdotaccent 177 /aogonek /ogonek /lslash 181 /lcaron /sacute /caron 185 /scaron /scedilla /tcaron /zacute /hungarumlaut /zcaron /zdotaccent /Racute 195 /Abreve 197 /Lacute /Cacute 200 /Ccaron 202 /Eogonek 204 /Ecaron 207 /Dcaron /Dcroat /Nacute /Ncaron 213 /Ohungarumlaut 216 /Rcaron /Uring 219 /Uhungarumlaut 222 /Tcommaaccent 224 /racute 227 /abreve 229 /lacute /cacute 232 /ccaron 234 /eogonek 236 /ecaron 239 /dcaron /dcroat /nacute /ncaron 245 /ohungarumlaut 248 /rcaron /uring 251 /uhungarumlaut 254 /tcommaaccent /dotaccent';
$file='ariali.z';
$size1=5942;
$size2=26173;
?>

View File

@@ -0,0 +1,25 @@
<?php
$type='Type1';
$name='Arial-ItalicMT';
$desc=array('Ascent'=>905,'Descent'=>-212,'CapHeight'=>716,'Flags'=>96,'FontBBox'=>'[-121 -275 1062 894]','ItalicAngle'=>-12,'StemV'=>70,'MissingWidth'=>750);
$up=-106;
$ut=73;
$cw=array(
chr(0)=>750,chr(1)=>750,chr(2)=>750,chr(3)=>750,chr(4)=>750,chr(5)=>750,chr(6)=>750,chr(7)=>750,chr(8)=>750,chr(9)=>750,chr(10)=>750,chr(11)=>750,chr(12)=>750,chr(13)=>750,chr(14)=>750,chr(15)=>750,chr(16)=>750,chr(17)=>750,chr(18)=>750,chr(19)=>750,chr(20)=>750,chr(21)=>750,
chr(22)=>750,chr(23)=>750,chr(24)=>750,chr(25)=>750,chr(26)=>750,chr(27)=>750,chr(28)=>750,chr(29)=>750,chr(30)=>750,chr(31)=>750,' '=>278,'!'=>278,'"'=>355,'#'=>556,'$'=>556,'%'=>889,'&'=>667,'\''=>191,'('=>333,')'=>333,'*'=>389,'+'=>584,
','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>278,';'=>278,'<'=>584,'='=>584,'>'=>584,'?'=>556,'@'=>1015,'A'=>667,
'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>500,'K'=>667,'L'=>556,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
'X'=>667,'Y'=>667,'Z'=>611,'['=>278,'\\'=>278,']'=>278,'^'=>469,'_'=>556,'`'=>333,'a'=>556,'b'=>556,'c'=>500,'d'=>556,'e'=>556,'f'=>278,'g'=>556,'h'=>556,'i'=>222,'j'=>222,'k'=>500,'l'=>222,'m'=>833,
'n'=>556,'o'=>556,'p'=>556,'q'=>556,'r'=>333,'s'=>500,'t'=>278,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>500,'{'=>334,'|'=>260,'}'=>334,'~'=>584,chr(127)=>750,chr(128)=>750,chr(129)=>750,chr(130)=>750,chr(131)=>750,
chr(132)=>750,chr(133)=>750,chr(134)=>750,chr(135)=>750,chr(136)=>750,chr(137)=>750,chr(138)=>750,chr(139)=>750,chr(140)=>750,chr(141)=>750,chr(142)=>750,chr(143)=>750,chr(144)=>750,chr(145)=>750,chr(146)=>750,chr(147)=>750,chr(148)=>750,chr(149)=>750,chr(150)=>750,chr(151)=>750,chr(152)=>750,chr(153)=>750,
chr(154)=>750,chr(155)=>750,chr(156)=>750,chr(157)=>750,chr(158)=>750,chr(159)=>750,chr(160)=>278,chr(161)=>667,chr(162)=>333,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>667,chr(167)=>556,chr(168)=>333,chr(169)=>667,chr(170)=>667,chr(171)=>611,chr(172)=>611,chr(173)=>333,chr(174)=>611,chr(175)=>611,
chr(176)=>400,chr(177)=>556,chr(178)=>333,chr(179)=>222,chr(180)=>333,chr(181)=>281,chr(182)=>500,chr(183)=>333,chr(184)=>333,chr(185)=>500,chr(186)=>500,chr(187)=>354,chr(188)=>500,chr(189)=>333,chr(190)=>500,chr(191)=>500,chr(192)=>722,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>556,
chr(198)=>722,chr(199)=>722,chr(200)=>722,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>667,chr(205)=>278,chr(206)=>278,chr(207)=>722,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
chr(220)=>722,chr(221)=>667,chr(222)=>611,chr(223)=>611,chr(224)=>333,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>222,chr(230)=>500,chr(231)=>500,chr(232)=>500,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>556,chr(237)=>278,chr(238)=>278,chr(239)=>625,chr(240)=>556,chr(241)=>556,
chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>549,chr(248)=>333,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>278,chr(255)=>333);
$enc='iso-8859-2';
$diff='128 /.notdef 130 /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 142 /.notdef 145 /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 158 /.notdef /.notdef 161 /Aogonek /breve /Lslash 165 /Lcaron /Sacute 169 /Scaron /Scedilla /Tcaron /Zacute 174 /Zcaron /Zdotaccent 177 /aogonek /ogonek /lslash 181 /lcaron /sacute /caron 185 /scaron /scedilla /tcaron /zacute /hungarumlaut /zcaron /zdotaccent /Racute 195 /Abreve 197 /Lacute /Cacute 200 /Ccaron 202 /Eogonek 204 /Ecaron 207 /Dcaron /Dcroat /Nacute /Ncaron 213 /Ohungarumlaut 216 /Rcaron /Uring 219 /Uhungarumlaut 222 /Tcommaaccent 224 /racute 227 /abreve 229 /lacute /cacute 232 /ccaron 234 /eogonek 236 /ecaron 239 /dcaron /dcroat /nacute /ncaron 245 /ohungarumlaut 248 /rcaron /uring 251 /uhungarumlaut 254 /tcommaaccent /dotaccent';
$file='ariali.z';
$size1=5942;
$size2=26173;
?>

View File

@@ -0,0 +1,25 @@
<?php
$type='Type1';
$name='ArialMT';
$desc=array('Ascent'=>905,'Descent'=>-212,'CapHeight'=>716,'Flags'=>32,'FontBBox'=>'[-46 -283 979 896]','ItalicAngle'=>0,'StemV'=>70,'MissingWidth'=>750);
$up=-106;
$ut=73;
$cw=array(
chr(0)=>750,chr(1)=>750,chr(2)=>750,chr(3)=>750,chr(4)=>750,chr(5)=>750,chr(6)=>750,chr(7)=>750,chr(8)=>750,chr(9)=>750,chr(10)=>750,chr(11)=>750,chr(12)=>750,chr(13)=>750,chr(14)=>750,chr(15)=>750,chr(16)=>750,chr(17)=>750,chr(18)=>750,chr(19)=>750,chr(20)=>750,chr(21)=>750,
chr(22)=>750,chr(23)=>750,chr(24)=>750,chr(25)=>750,chr(26)=>750,chr(27)=>750,chr(28)=>750,chr(29)=>750,chr(30)=>750,chr(31)=>750,' '=>278,'!'=>278,'"'=>355,'#'=>556,'$'=>556,'%'=>889,'&'=>667,'\''=>191,'('=>333,')'=>333,'*'=>389,'+'=>584,
','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>278,';'=>278,'<'=>584,'='=>584,'>'=>584,'?'=>556,'@'=>1015,'A'=>667,
'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>500,'K'=>667,'L'=>556,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
'X'=>667,'Y'=>667,'Z'=>611,'['=>278,'\\'=>278,']'=>278,'^'=>469,'_'=>556,'`'=>333,'a'=>556,'b'=>556,'c'=>500,'d'=>556,'e'=>556,'f'=>278,'g'=>556,'h'=>556,'i'=>222,'j'=>222,'k'=>500,'l'=>222,'m'=>833,
'n'=>556,'o'=>556,'p'=>556,'q'=>556,'r'=>333,'s'=>500,'t'=>278,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>500,'{'=>334,'|'=>260,'}'=>334,'~'=>584,chr(127)=>750,chr(128)=>750,chr(129)=>750,chr(130)=>750,chr(131)=>750,
chr(132)=>750,chr(133)=>750,chr(134)=>750,chr(135)=>750,chr(136)=>750,chr(137)=>750,chr(138)=>750,chr(139)=>750,chr(140)=>750,chr(141)=>750,chr(142)=>750,chr(143)=>750,chr(144)=>750,chr(145)=>750,chr(146)=>750,chr(147)=>750,chr(148)=>750,chr(149)=>750,chr(150)=>750,chr(151)=>750,chr(152)=>750,chr(153)=>750,
chr(154)=>750,chr(155)=>750,chr(156)=>750,chr(157)=>750,chr(158)=>750,chr(159)=>750,chr(160)=>278,chr(161)=>667,chr(162)=>333,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>667,chr(167)=>556,chr(168)=>333,chr(169)=>667,chr(170)=>667,chr(171)=>611,chr(172)=>611,chr(173)=>333,chr(174)=>611,chr(175)=>611,
chr(176)=>400,chr(177)=>556,chr(178)=>333,chr(179)=>222,chr(180)=>333,chr(181)=>292,chr(182)=>500,chr(183)=>333,chr(184)=>333,chr(185)=>500,chr(186)=>500,chr(187)=>375,chr(188)=>500,chr(189)=>333,chr(190)=>500,chr(191)=>500,chr(192)=>722,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>556,
chr(198)=>722,chr(199)=>722,chr(200)=>722,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>667,chr(205)=>278,chr(206)=>278,chr(207)=>722,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
chr(220)=>722,chr(221)=>667,chr(222)=>611,chr(223)=>611,chr(224)=>333,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>222,chr(230)=>500,chr(231)=>500,chr(232)=>500,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>556,chr(237)=>278,chr(238)=>278,chr(239)=>615,chr(240)=>556,chr(241)=>556,
chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>549,chr(248)=>333,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>278,chr(255)=>333);
$enc='iso-8859-2';
$diff='128 /.notdef 130 /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 142 /.notdef 145 /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 158 /.notdef /.notdef 161 /Aogonek /breve /Lslash 165 /Lcaron /Sacute 169 /Scaron /Scedilla /Tcaron /Zacute 174 /Zcaron /Zdotaccent 177 /aogonek /ogonek /lslash 181 /lcaron /sacute /caron 185 /scaron /scedilla /tcaron /zacute /hungarumlaut /zcaron /zdotaccent /Racute 195 /Abreve 197 /Lacute /Cacute 200 /Ccaron 202 /Eogonek 204 /Ecaron 207 /Dcaron /Dcroat /Nacute /Ncaron 213 /Ohungarumlaut 216 /Rcaron /Uring 219 /Uhungarumlaut 222 /Tcommaaccent 224 /racute 227 /abreve 229 /lacute /cacute 232 /ccaron 234 /eogonek 236 /ecaron 239 /dcaron /dcroat /nacute /ncaron 245 /ohungarumlaut 248 /rcaron /uring 251 /uhungarumlaut 254 /tcommaaccent /dotaccent';
$file='arialpl.z';
$size1=5917;
$size2=25247;
?>

View File

@@ -0,0 +1,24 @@
<?php
$type='TrueType';
$name='ArialMT';
$desc=array('Ascent'=>905,'Descent'=>-212,'CapHeight'=>716,'Flags'=>32,'FontBBox'=>'[-46 -283 979 938]','ItalicAngle'=>0,'StemV'=>70,'MissingWidth'=>750);
$up=-106;
$ut=73;
$cw=array(
chr(0)=>750,chr(1)=>750,chr(2)=>750,chr(3)=>750,chr(4)=>750,chr(5)=>750,chr(6)=>750,chr(7)=>750,chr(8)=>750,chr(9)=>750,chr(10)=>750,chr(11)=>750,chr(12)=>750,chr(13)=>750,chr(14)=>750,chr(15)=>750,chr(16)=>750,chr(17)=>750,chr(18)=>750,chr(19)=>750,chr(20)=>750,chr(21)=>750,
chr(22)=>750,chr(23)=>750,chr(24)=>750,chr(25)=>750,chr(26)=>750,chr(27)=>750,chr(28)=>750,chr(29)=>750,chr(30)=>750,chr(31)=>750,' '=>278,'!'=>278,'"'=>355,'#'=>556,'$'=>556,'%'=>889,'&'=>667,'\''=>191,'('=>333,')'=>333,'*'=>389,'+'=>584,
','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>278,';'=>278,'<'=>584,'='=>584,'>'=>584,'?'=>556,'@'=>1015,'A'=>667,
'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>500,'K'=>667,'L'=>556,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
'X'=>667,'Y'=>667,'Z'=>611,'['=>278,'\\'=>278,']'=>278,'^'=>469,'_'=>556,'`'=>333,'a'=>556,'b'=>556,'c'=>500,'d'=>556,'e'=>556,'f'=>278,'g'=>556,'h'=>556,'i'=>222,'j'=>222,'k'=>500,'l'=>222,'m'=>833,
'n'=>556,'o'=>556,'p'=>556,'q'=>556,'r'=>333,'s'=>500,'t'=>278,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>500,'{'=>334,'|'=>260,'}'=>334,'~'=>584,chr(127)=>750,chr(128)=>750,chr(129)=>750,chr(130)=>750,chr(131)=>750,
chr(132)=>750,chr(133)=>750,chr(134)=>750,chr(135)=>750,chr(136)=>750,chr(137)=>750,chr(138)=>750,chr(139)=>750,chr(140)=>750,chr(141)=>750,chr(142)=>750,chr(143)=>750,chr(144)=>750,chr(145)=>750,chr(146)=>750,chr(147)=>750,chr(148)=>750,chr(149)=>750,chr(150)=>750,chr(151)=>750,chr(152)=>750,chr(153)=>750,
chr(154)=>750,chr(155)=>750,chr(156)=>750,chr(157)=>750,chr(158)=>750,chr(159)=>750,chr(160)=>278,chr(161)=>667,chr(162)=>333,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>667,chr(167)=>556,chr(168)=>333,chr(169)=>667,chr(170)=>667,chr(171)=>611,chr(172)=>611,chr(173)=>333,chr(174)=>611,chr(175)=>611,
chr(176)=>400,chr(177)=>556,chr(178)=>333,chr(179)=>222,chr(180)=>333,chr(181)=>292,chr(182)=>500,chr(183)=>333,chr(184)=>333,chr(185)=>500,chr(186)=>500,chr(187)=>375,chr(188)=>500,chr(189)=>333,chr(190)=>500,chr(191)=>500,chr(192)=>722,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>556,
chr(198)=>722,chr(199)=>722,chr(200)=>722,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>667,chr(205)=>278,chr(206)=>278,chr(207)=>722,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
chr(220)=>722,chr(221)=>667,chr(222)=>611,chr(223)=>611,chr(224)=>333,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>222,chr(230)=>500,chr(231)=>500,chr(232)=>500,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>556,chr(237)=>278,chr(238)=>278,chr(239)=>615,chr(240)=>556,chr(241)=>556,
chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>549,chr(248)=>333,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>278,chr(255)=>333);
$enc='iso-8859-2';
$diff='128 /.notdef 130 /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 142 /.notdef 145 /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 158 /.notdef /.notdef 161 /Aogonek /breve /Lslash 165 /Lcaron /Sacute 169 /Scaron /Scedilla /Tcaron /Zacute 174 /Zcaron /Zdot 177 /aogonek /ogonek /lslash 181 /lcaron /sacute /caron 185 /scaron /scedilla /tcaron /zacute /hungarumlaut /zcaron /zdot /Racute 195 /Abreve 197 /Lacute /Cacute 200 /Ccaron 202 /Eogonek 204 /Ecaron 207 /Dcaron /Dslash /Nacute /Ncaron 213 /Odblacute 216 /Rcaron /Uring 219 /Udblacute 222 /Tcedilla 224 /racute 227 /abreve 229 /lacute /cacute 232 /ccaron 234 /eogonek 236 /ecaron 239 /dcaron /dmacron /nacute /ncaron 245 /odblacute 248 /rcaron /uring 251 /udblacute 254 /tcedilla /dotaccent';
$file='';
$originalsize=0;
?>

View File

@@ -0,0 +1,24 @@
<?php
$type='TrueType';
$name='Arial-BoldItalicMT';
$desc=array('Ascent'=>905,'Descent'=>-212,'CapHeight'=>716,'Flags'=>96,'FontBBox'=>'[-109 -298 1068 939]','ItalicAngle'=>-12,'StemV'=>120,'MissingWidth'=>750);
$up=-106;
$ut=105;
$cw=array(
chr(0)=>750,chr(1)=>750,chr(2)=>750,chr(3)=>750,chr(4)=>750,chr(5)=>750,chr(6)=>750,chr(7)=>750,chr(8)=>750,chr(9)=>750,chr(10)=>750,chr(11)=>750,chr(12)=>750,chr(13)=>750,chr(14)=>750,chr(15)=>750,chr(16)=>750,chr(17)=>750,chr(18)=>750,chr(19)=>750,chr(20)=>750,chr(21)=>750,
chr(22)=>750,chr(23)=>750,chr(24)=>750,chr(25)=>750,chr(26)=>750,chr(27)=>750,chr(28)=>750,chr(29)=>750,chr(30)=>750,chr(31)=>750,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584,
','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722,
'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889,
'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,chr(127)=>750,chr(128)=>750,chr(129)=>750,chr(130)=>750,chr(131)=>750,
chr(132)=>750,chr(133)=>750,chr(134)=>750,chr(135)=>750,chr(136)=>750,chr(137)=>750,chr(138)=>750,chr(139)=>750,chr(140)=>750,chr(141)=>750,chr(142)=>750,chr(143)=>750,chr(144)=>750,chr(145)=>750,chr(146)=>750,chr(147)=>750,chr(148)=>750,chr(149)=>750,chr(150)=>750,chr(151)=>750,chr(152)=>750,chr(153)=>750,
chr(154)=>750,chr(155)=>750,chr(156)=>750,chr(157)=>750,chr(158)=>750,chr(159)=>750,chr(160)=>278,chr(161)=>722,chr(162)=>333,chr(163)=>611,chr(164)=>556,chr(165)=>611,chr(166)=>667,chr(167)=>556,chr(168)=>333,chr(169)=>667,chr(170)=>667,chr(171)=>611,chr(172)=>611,chr(173)=>333,chr(174)=>611,chr(175)=>611,
chr(176)=>400,chr(177)=>556,chr(178)=>333,chr(179)=>278,chr(180)=>333,chr(181)=>396,chr(182)=>556,chr(183)=>333,chr(184)=>333,chr(185)=>556,chr(186)=>556,chr(187)=>479,chr(188)=>500,chr(189)=>333,chr(190)=>500,chr(191)=>500,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>611,
chr(198)=>722,chr(199)=>722,chr(200)=>722,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>667,chr(205)=>278,chr(206)=>278,chr(207)=>722,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
chr(220)=>722,chr(221)=>667,chr(222)=>611,chr(223)=>611,chr(224)=>389,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>278,chr(230)=>556,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>556,chr(237)=>278,chr(238)=>278,chr(239)=>740,chr(240)=>611,chr(241)=>611,
chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>549,chr(248)=>389,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>333,chr(255)=>333);
$enc='iso-8859-2';
$diff='128 /.notdef 130 /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 142 /.notdef 145 /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 158 /.notdef /.notdef 161 /Aogonek /breve /Lslash 165 /Lcaron /Sacute 169 /Scaron /Scedilla /Tcaron /Zacute 174 /Zcaron /Zdot 177 /aogonek /ogonek /lslash 181 /lcaron /sacute /caron 185 /scaron /scedilla /tcaron /zacute /hungarumlaut /zcaron /zdot /Racute 195 /Abreve 197 /Lacute /Cacute 200 /Ccaron 202 /Eogonek 204 /Ecaron 207 /Dcaron /Dslash /Nacute /Ncaron 213 /Odblacute 216 /Rcaron /Uring 219 /Udblacute 222 /Tcedilla 224 /racute 227 /abreve 229 /lacute /cacute 232 /ccaron 234 /eogonek 236 /ecaron 239 /dcaron /dmacron /nacute /ncaron 245 /odblacute 248 /rcaron /uring 251 /udblacute 254 /tcedilla /dotaccent';
$file='arialzpl.z';
$originalsize=221756;
?>

View File

@@ -0,0 +1,7 @@
<?php
for($i=0;$i<=255;$i++)
$fpdf_charwidths['courier'][chr($i)]=600;
$fpdf_charwidths['courierB']=$fpdf_charwidths['courier'];
$fpdf_charwidths['courierI']=$fpdf_charwidths['courier'];
$fpdf_charwidths['courierBI']=$fpdf_charwidths['courier'];
?>

View File

@@ -0,0 +1,15 @@
<?php
$fpdf_charwidths['helvetica']=array(
chr(0)=>278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>278,'"'=>355,'#'=>556,'$'=>556,'%'=>889,'&'=>667,'\''=>191,'('=>333,')'=>333,'*'=>389,'+'=>584,
','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>278,';'=>278,'<'=>584,'='=>584,'>'=>584,'?'=>556,'@'=>1015,'A'=>667,
'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>500,'K'=>667,'L'=>556,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
'X'=>667,'Y'=>667,'Z'=>611,'['=>278,'\\'=>278,']'=>278,'^'=>469,'_'=>556,'`'=>333,'a'=>556,'b'=>556,'c'=>500,'d'=>556,'e'=>556,'f'=>278,'g'=>556,'h'=>556,'i'=>222,'j'=>222,'k'=>500,'l'=>222,'m'=>833,
'n'=>556,'o'=>556,'p'=>556,'q'=>556,'r'=>333,'s'=>500,'t'=>278,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>500,'{'=>334,'|'=>260,'}'=>334,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>222,chr(131)=>556,
chr(132)=>333,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>222,chr(146)=>222,chr(147)=>333,chr(148)=>333,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
chr(154)=>500,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>260,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>556,chr(182)=>537,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667,
chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>500,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>556,chr(241)=>556,
chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>584,chr(248)=>611,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500);
?>

View File

@@ -0,0 +1,15 @@
<?php
$fpdf_charwidths['helveticaB']=array(
chr(0)=>278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584,
','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722,
'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889,
'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>278,chr(131)=>556,
chr(132)=>500,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>278,chr(146)=>278,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
chr(154)=>556,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>280,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>611,chr(182)=>556,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722,
chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>611,chr(241)=>611,
chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>584,chr(248)=>611,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>611,chr(255)=>556);
?>

View File

@@ -0,0 +1,15 @@
<?php
$fpdf_charwidths['helveticaBI']=array(
chr(0)=>278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584,
','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722,
'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889,
'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>278,chr(131)=>556,
chr(132)=>500,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>278,chr(146)=>278,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
chr(154)=>556,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>280,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>611,chr(182)=>556,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722,
chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>611,chr(241)=>611,
chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>584,chr(248)=>611,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>611,chr(255)=>556);
?>

View File

@@ -0,0 +1,15 @@
<?php
$fpdf_charwidths['helveticaI']=array(
chr(0)=>278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>278,'"'=>355,'#'=>556,'$'=>556,'%'=>889,'&'=>667,'\''=>191,'('=>333,')'=>333,'*'=>389,'+'=>584,
','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>278,';'=>278,'<'=>584,'='=>584,'>'=>584,'?'=>556,'@'=>1015,'A'=>667,
'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>500,'K'=>667,'L'=>556,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
'X'=>667,'Y'=>667,'Z'=>611,'['=>278,'\\'=>278,']'=>278,'^'=>469,'_'=>556,'`'=>333,'a'=>556,'b'=>556,'c'=>500,'d'=>556,'e'=>556,'f'=>278,'g'=>556,'h'=>556,'i'=>222,'j'=>222,'k'=>500,'l'=>222,'m'=>833,
'n'=>556,'o'=>556,'p'=>556,'q'=>556,'r'=>333,'s'=>500,'t'=>278,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>500,'{'=>334,'|'=>260,'}'=>334,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>222,chr(131)=>556,
chr(132)=>333,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>222,chr(146)=>222,chr(147)=>333,chr(148)=>333,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
chr(154)=>500,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>260,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>556,chr(182)=>537,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667,
chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>500,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>556,chr(241)=>556,
chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>584,chr(248)=>611,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500);
?>

View File

@@ -0,0 +1,400 @@
<?php
/*******************************************************************************
* Utility to generate font definition files *
* Version: 1.12 *
* Date: 2003-12-30 *
*******************************************************************************/
function ReadMap($enc)
{
//Read a map file
$file=dirname(__FILE__).'/'.strtolower($enc).'.map';
$a=file($file);
if(empty($a))
die('<B>Error:</B> encoding not found: '.$enc);
$cc2gn=array();
foreach($a as $l)
{
if($l{0}=='!')
{
$e=preg_split('/[ \\t]+/',chop($l));
$cc=hexdec(substr($e[0],1));
$gn=$e[2];
$cc2gn[$cc]=$gn;
}
}
for($i=0;$i<=255;$i++)
if(!isset($cc2gn[$i]))
$cc2gn[$i]='.notdef';
return $cc2gn;
}
function ReadAFM($file,&$map)
{
//Read a font metric file
$a=file($file);
if(empty($a))
die('File not found');
$widths=array();
$fm=array();
$fix=array('Edot'=>'Edotaccent','edot'=>'edotaccent','Idot'=>'Idotaccent','Zdot'=>'Zdotaccent','zdot'=>'zdotaccent',
'Odblacute'=>'Ohungarumlaut','odblacute'=>'ohungarumlaut','Udblacute'=>'Uhungarumlaut','udblacute'=>'uhungarumlaut',
'Gcedilla'=>'Gcommaaccent','gcedilla'=>'gcommaaccent','Kcedilla'=>'Kcommaaccent','kcedilla'=>'kcommaaccent',
'Lcedilla'=>'Lcommaaccent','lcedilla'=>'lcommaaccent','Ncedilla'=>'Ncommaaccent','ncedilla'=>'ncommaaccent',
'Rcedilla'=>'Rcommaaccent','rcedilla'=>'rcommaaccent','Scedilla'=>'Scommaaccent','scedilla'=>'scommaaccent',
'Tcedilla'=>'Tcommaaccent','tcedilla'=>'tcommaaccent','Dslash'=>'Dcroat','dslash'=>'dcroat','Dmacron'=>'Dcroat','dmacron'=>'dcroat',
'combininggraveaccent'=>'gravecomb','combininghookabove'=>'hookabovecomb','combiningtildeaccent'=>'tildecomb',
'combiningacuteaccent'=>'acutecomb','combiningdotbelow'=>'dotbelowcomb','dongsign'=>'dong');
foreach($a as $l)
{
$e=explode(' ',chop($l));
if(count($e)<2)
continue;
$code=$e[0];
$param=$e[1];
if($code=='C')
{
//Character metrics
$cc=(int)$e[1];
$w=$e[4];
$gn=$e[7];
if(substr($gn,-4)=='20AC')
$gn='Euro';
if(isset($fix[$gn]))
{
//Fix incorrect glyph name
foreach($map as $c=>$n)
if($n==$fix[$gn])
$map[$c]=$gn;
}
if(empty($map))
{
//Symbolic font: use built-in encoding
$widths[$cc]=$w;
}
else
{
$widths[$gn]=$w;
if($gn=='X')
$fm['CapXHeight']=$e[13];
}
if($gn=='.notdef')
$fm['MissingWidth']=$w;
}
elseif($code=='FontName')
$fm['FontName']=$param;
elseif($code=='Weight')
$fm['Weight']=$param;
elseif($code=='ItalicAngle')
$fm['ItalicAngle']=(double)$param;
elseif($code=='Ascender')
$fm['Ascender']=(int)$param;
elseif($code=='Descender')
$fm['Descender']=(int)$param;
elseif($code=='UnderlineThickness')
$fm['UnderlineThickness']=(int)$param;
elseif($code=='UnderlinePosition')
$fm['UnderlinePosition']=(int)$param;
elseif($code=='IsFixedPitch')
$fm['IsFixedPitch']=($param=='true');
elseif($code=='FontBBox')
$fm['FontBBox']=array($e[1],$e[2],$e[3],$e[4]);
elseif($code=='CapHeight')
$fm['CapHeight']=(int)$param;
elseif($code=='StdVW')
$fm['StdVW']=(int)$param;
}
if(!isset($fm['FontName']))
die('FontName not found');
if(!empty($map))
{
if(!isset($widths['.notdef']))
$widths['.notdef']=600;
if(!isset($widths['Delta']) and isset($widths['increment']))
$widths['Delta']=$widths['increment'];
//Order widths according to map
for($i=0;$i<=255;$i++)
{
if(!isset($widths[$map[$i]]))
{
echo '<B>Warning:</B> character '.$map[$i].' is missing<BR>';
$widths[$i]=$widths['.notdef'];
}
else
$widths[$i]=$widths[$map[$i]];
}
}
$fm['Widths']=$widths;
return $fm;
}
function MakeFontDescriptor($fm,$symbolic)
{
//Ascent
$asc=(isset($fm['Ascender']) ? $fm['Ascender'] : 1000);
$fd="array('Ascent'=>".$asc;
//Descent
$desc=(isset($fm['Descender']) ? $fm['Descender'] : -200);
$fd.=",'Descent'=>".$desc;
//CapHeight
if(isset($fm['CapHeight']))
$ch=$fm['CapHeight'];
elseif(isset($fm['CapXHeight']))
$ch=$fm['CapXHeight'];
else
$ch=$asc;
$fd.=",'CapHeight'=>".$ch;
//Flags
$flags=0;
if(isset($fm['IsFixedPitch']) and $fm['IsFixedPitch'])
$flags+=1<<0;
if($symbolic)
$flags+=1<<2;
if(!$symbolic)
$flags+=1<<5;
if(isset($fm['ItalicAngle']) and $fm['ItalicAngle']!=0)
$flags+=1<<6;
$fd.=",'Flags'=>".$flags;
//FontBBox
if(isset($fm['FontBBox']))
$fbb=$fm['FontBBox'];
else
$fbb=array(0,$des-100,1000,$asc+100);
$fd.=",'FontBBox'=>'[".$fbb[0].' '.$fbb[1].' '.$fbb[2].' '.$fbb[3]."]'";
//ItalicAngle
$ia=(isset($fm['ItalicAngle']) ? $fm['ItalicAngle'] : 0);
$fd.=",'ItalicAngle'=>".$ia;
//StemV
if(isset($fm['StdVW']))
$stemv=$fm['StdVW'];
elseif(isset($fm['Weight']) and eregi('(bold|black)',$fm['Weight']))
$stemv=120;
else
$stemv=70;
$fd.=",'StemV'=>".$stemv;
//MissingWidth
if(isset($fm['MissingWidth']))
$fd.=",'MissingWidth'=>".$fm['MissingWidth'];
$fd.=')';
return $fd;
}
function MakeWidthArray($fm)
{
//Make character width array
$s="array(\n\t";
$cw=$fm['Widths'];
for($i=0;$i<=255;$i++)
{
if(chr($i)=="'")
$s.="'\\''";
elseif(chr($i)=="\\")
$s.="'\\\\'";
elseif($i>=32 and $i<=126)
$s.="'".chr($i)."'";
else
$s.="chr($i)";
$s.='=>'.$fm['Widths'][$i];
if($i<255)
$s.=',';
if(($i+1)%22==0)
$s.="\n\t";
}
$s.=')';
return $s;
}
function MakeFontEncoding($map)
{
//Build differences from reference encoding
$ref=ReadMap('cp1252');
$s='';
$last=0;
for($i=32;$i<=255;$i++)
{
if($map[$i]!=$ref[$i])
{
if($i!=$last+1)
$s.=$i.' ';
$last=$i;
$s.='/'.$map[$i].' ';
}
}
return chop($s);
}
function SaveToFile($file,$s,$mode='t')
{
$f=fopen($file,'w'.$mode);
if(!$f)
die('Can\'t write to file '.$file);
fwrite($f,$s,strlen($s));
fclose($f);
}
function ReadShort($f)
{
$a=unpack('n1n',fread($f,2));
return $a['n'];
}
function ReadLong($f)
{
$a=unpack('N1N',fread($f,4));
return $a['N'];
}
function CheckTTF($file)
{
//Check if font license allows embedding
$f=fopen($file,'rb');
if(!$f)
die('<B>Error:</B> Can\'t open '.$file);
//Extract number of tables
fseek($f,4,SEEK_CUR);
$nb=ReadShort($f);
fseek($f,6,SEEK_CUR);
//Seek OS/2 table
$found=false;
for($i=0;$i<$nb;$i++)
{
if(fread($f,4)=='OS/2')
{
$found=true;
break;
}
fseek($f,12,SEEK_CUR);
}
if(!$found)
{
fclose($f);
return;
}
fseek($f,4,SEEK_CUR);
$offset=ReadLong($f);
fseek($f,$offset,SEEK_SET);
//Extract fsType flags
fseek($f,8,SEEK_CUR);
$fsType=ReadShort($f);
$rl=($fsType & 0x02)!=0;
$pp=($fsType & 0x04)!=0;
$e=($fsType & 0x08)!=0;
fclose($f);
if($rl and !$pp and !$e)
echo '<B>Warning:</B> font license does not allow embedding';
}
/*******************************************************************************
* $fontfile: path to TTF file (or empty string if not to be embedded) *
* $afmfile: path to AFM file *
* $enc: font encoding (or empty string for symbolic fonts) *
* $patch: optional patch for encoding *
* $type : font type if $fontfile is empty *
*******************************************************************************/
function MakeFont($fontfile,$afmfile,$enc='cp1252',$patch=array(),$type='TrueType')
{
//Generate a font definition file
set_magic_quotes_runtime(0);
if($enc)
{
$map=ReadMap($enc);
foreach($patch as $cc=>$gn)
$map[$cc]=$gn;
}
else
$map=array();
if(!file_exists($afmfile))
die('<B>Error:</B> AFM file not found: '.$afmfile);
$fm=ReadAFM($afmfile,$map);
if($enc)
$diff=MakeFontEncoding($map);
else
$diff='';
$fd=MakeFontDescriptor($fm,empty($map));
//Find font type
if($fontfile)
{
$ext=strtolower(substr($fontfile,-3));
if($ext=='ttf')
$type='TrueType';
elseif($ext=='pfb')
$type='Type1';
else
die('<B>Error:</B> unrecognized font file extension: '.$ext);
}
else
{
if($type!='TrueType' and $type!='Type1')
die('<B>Error:</B> incorrect font type: '.$type);
}
//Start generation
$s='<?php'."\n";
$s.='$type=\''.$type."';\n";
$s.='$name=\''.$fm['FontName']."';\n";
$s.='$desc='.$fd.";\n";
if(!isset($fm['UnderlinePosition']))
$fm['UnderlinePosition']=-100;
if(!isset($fm['UnderlineThickness']))
$fm['UnderlineThickness']=50;
$s.='$up='.$fm['UnderlinePosition'].";\n";
$s.='$ut='.$fm['UnderlineThickness'].";\n";
$w=MakeWidthArray($fm);
$s.='$cw='.$w.";\n";
$s.='$enc=\''.$enc."';\n";
$s.='$diff=\''.$diff."';\n";
$basename=substr(basename($afmfile),0,-4);
if($fontfile)
{
//Embedded font
if(!file_exists($fontfile))
die('<B>Error:</B> font file not found: '.$fontfile);
if($type=='TrueType')
CheckTTF($fontfile);
$f=fopen($fontfile,'rb');
if(!$f)
die('<B>Error:</B> Can\'t open '.$fontfile);
$file=fread($f,filesize($fontfile));
fclose($f);
if($type=='Type1')
{
//Find first two sections and discard third one
$pos=strpos($file,'eexec');
if(!$pos)
die('<B>Error:</B> font file does not seem to be valid Type1');
$size1=$pos+6;
$pos=strpos($file,'00000000');
if(!$pos)
die('<B>Error:</B> font file does not seem to be valid Type1');
$size2=$pos-$size1;
$file=substr($file,0,$size1+$size2);
}
if(function_exists('gzcompress'))
{
$cmp=$basename.'.z';
SaveToFile($cmp,gzcompress($file),'b');
$s.='$file=\''.$cmp."';\n";
echo 'Font file compressed ('.$cmp.')<BR>';
}
else
{
$s.='$file=\''.basename($fontfile)."';\n";
echo '<B>Notice:</B> font file could not be compressed (gzcompress not available)<BR>';
}
if($type=='Type1')
{
$s.='$size1='.$size1.";\n";
$s.='$size2='.$size2.";\n";
}
else
$s.='$originalsize='.filesize($fontfile).";\n";
}
else
{
//Not embedded font
$s.='$file='."'';\n";
}
$s.="?>\n";
SaveToFile($basename.'.php',$s);
echo 'Font definition file generated ('.$basename.'.php'.')<BR>';
}
?>

View File

@@ -0,0 +1,15 @@
<?php
$fpdf_charwidths['symbol']=array(
chr(0)=>250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>713,'#'=>500,'$'=>549,'%'=>833,'&'=>778,'\''=>439,'('=>333,')'=>333,'*'=>500,'+'=>549,
','=>250,'-'=>549,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>278,';'=>278,'<'=>549,'='=>549,'>'=>549,'?'=>444,'@'=>549,'A'=>722,
'B'=>667,'C'=>722,'D'=>612,'E'=>611,'F'=>763,'G'=>603,'H'=>722,'I'=>333,'J'=>631,'K'=>722,'L'=>686,'M'=>889,'N'=>722,'O'=>722,'P'=>768,'Q'=>741,'R'=>556,'S'=>592,'T'=>611,'U'=>690,'V'=>439,'W'=>768,
'X'=>645,'Y'=>795,'Z'=>611,'['=>333,'\\'=>863,']'=>333,'^'=>658,'_'=>500,'`'=>500,'a'=>631,'b'=>549,'c'=>549,'d'=>494,'e'=>439,'f'=>521,'g'=>411,'h'=>603,'i'=>329,'j'=>603,'k'=>549,'l'=>549,'m'=>576,
'n'=>521,'o'=>549,'p'=>549,'q'=>521,'r'=>549,'s'=>603,'t'=>439,'u'=>576,'v'=>713,'w'=>686,'x'=>493,'y'=>686,'z'=>494,'{'=>480,'|'=>200,'}'=>480,'~'=>549,chr(127)=>0,chr(128)=>0,chr(129)=>0,chr(130)=>0,chr(131)=>0,
chr(132)=>0,chr(133)=>0,chr(134)=>0,chr(135)=>0,chr(136)=>0,chr(137)=>0,chr(138)=>0,chr(139)=>0,chr(140)=>0,chr(141)=>0,chr(142)=>0,chr(143)=>0,chr(144)=>0,chr(145)=>0,chr(146)=>0,chr(147)=>0,chr(148)=>0,chr(149)=>0,chr(150)=>0,chr(151)=>0,chr(152)=>0,chr(153)=>0,
chr(154)=>0,chr(155)=>0,chr(156)=>0,chr(157)=>0,chr(158)=>0,chr(159)=>0,chr(160)=>750,chr(161)=>620,chr(162)=>247,chr(163)=>549,chr(164)=>167,chr(165)=>713,chr(166)=>500,chr(167)=>753,chr(168)=>753,chr(169)=>753,chr(170)=>753,chr(171)=>1042,chr(172)=>987,chr(173)=>603,chr(174)=>987,chr(175)=>603,
chr(176)=>400,chr(177)=>549,chr(178)=>411,chr(179)=>549,chr(180)=>549,chr(181)=>713,chr(182)=>494,chr(183)=>460,chr(184)=>549,chr(185)=>549,chr(186)=>549,chr(187)=>549,chr(188)=>1000,chr(189)=>603,chr(190)=>1000,chr(191)=>658,chr(192)=>823,chr(193)=>686,chr(194)=>795,chr(195)=>987,chr(196)=>768,chr(197)=>768,
chr(198)=>823,chr(199)=>768,chr(200)=>768,chr(201)=>713,chr(202)=>713,chr(203)=>713,chr(204)=>713,chr(205)=>713,chr(206)=>713,chr(207)=>713,chr(208)=>768,chr(209)=>713,chr(210)=>790,chr(211)=>790,chr(212)=>890,chr(213)=>823,chr(214)=>549,chr(215)=>250,chr(216)=>713,chr(217)=>603,chr(218)=>603,chr(219)=>1042,
chr(220)=>987,chr(221)=>603,chr(222)=>987,chr(223)=>603,chr(224)=>494,chr(225)=>329,chr(226)=>790,chr(227)=>790,chr(228)=>786,chr(229)=>713,chr(230)=>384,chr(231)=>384,chr(232)=>384,chr(233)=>384,chr(234)=>384,chr(235)=>384,chr(236)=>494,chr(237)=>494,chr(238)=>494,chr(239)=>494,chr(240)=>0,chr(241)=>329,
chr(242)=>274,chr(243)=>686,chr(244)=>686,chr(245)=>686,chr(246)=>384,chr(247)=>384,chr(248)=>384,chr(249)=>384,chr(250)=>384,chr(251)=>384,chr(252)=>494,chr(253)=>494,chr(254)=>494,chr(255)=>0);
?>

View File

@@ -0,0 +1,15 @@
<?php
$fpdf_charwidths['times']=array(
chr(0)=>250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>408,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>180,'('=>333,')'=>333,'*'=>500,'+'=>564,
','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>278,';'=>278,'<'=>564,'='=>564,'>'=>564,'?'=>444,'@'=>921,'A'=>722,
'B'=>667,'C'=>667,'D'=>722,'E'=>611,'F'=>556,'G'=>722,'H'=>722,'I'=>333,'J'=>389,'K'=>722,'L'=>611,'M'=>889,'N'=>722,'O'=>722,'P'=>556,'Q'=>722,'R'=>667,'S'=>556,'T'=>611,'U'=>722,'V'=>722,'W'=>944,
'X'=>722,'Y'=>722,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>469,'_'=>500,'`'=>333,'a'=>444,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>333,'g'=>500,'h'=>500,'i'=>278,'j'=>278,'k'=>500,'l'=>278,'m'=>778,
'n'=>500,'o'=>500,'p'=>500,'q'=>500,'r'=>333,'s'=>389,'t'=>278,'u'=>500,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>444,'{'=>480,'|'=>200,'}'=>480,'~'=>541,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500,
chr(132)=>444,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>889,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>444,chr(148)=>444,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>980,
chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>444,chr(159)=>722,chr(160)=>250,chr(161)=>333,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>200,chr(167)=>500,chr(168)=>333,chr(169)=>760,chr(170)=>276,chr(171)=>500,chr(172)=>564,chr(173)=>333,chr(174)=>760,chr(175)=>333,
chr(176)=>400,chr(177)=>564,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>500,chr(182)=>453,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>310,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>444,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722,
chr(198)=>889,chr(199)=>667,chr(200)=>611,chr(201)=>611,chr(202)=>611,chr(203)=>611,chr(204)=>333,chr(205)=>333,chr(206)=>333,chr(207)=>333,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>564,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
chr(220)=>722,chr(221)=>722,chr(222)=>556,chr(223)=>500,chr(224)=>444,chr(225)=>444,chr(226)=>444,chr(227)=>444,chr(228)=>444,chr(229)=>444,chr(230)=>667,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>500,
chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>564,chr(248)=>500,chr(249)=>500,chr(250)=>500,chr(251)=>500,chr(252)=>500,chr(253)=>500,chr(254)=>500,chr(255)=>500);
?>

View File

@@ -0,0 +1,15 @@
<?php
$fpdf_charwidths['timesB']=array(
chr(0)=>250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>555,'#'=>500,'$'=>500,'%'=>1000,'&'=>833,'\''=>278,'('=>333,')'=>333,'*'=>500,'+'=>570,
','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>570,'='=>570,'>'=>570,'?'=>500,'@'=>930,'A'=>722,
'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>778,'I'=>389,'J'=>500,'K'=>778,'L'=>667,'M'=>944,'N'=>722,'O'=>778,'P'=>611,'Q'=>778,'R'=>722,'S'=>556,'T'=>667,'U'=>722,'V'=>722,'W'=>1000,
'X'=>722,'Y'=>722,'Z'=>667,'['=>333,'\\'=>278,']'=>333,'^'=>581,'_'=>500,'`'=>333,'a'=>500,'b'=>556,'c'=>444,'d'=>556,'e'=>444,'f'=>333,'g'=>500,'h'=>556,'i'=>278,'j'=>333,'k'=>556,'l'=>278,'m'=>833,
'n'=>556,'o'=>500,'p'=>556,'q'=>556,'r'=>444,'s'=>389,'t'=>333,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>444,'{'=>394,'|'=>220,'}'=>394,'~'=>520,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500,
chr(132)=>500,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>667,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>444,chr(159)=>722,chr(160)=>250,chr(161)=>333,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>220,chr(167)=>500,chr(168)=>333,chr(169)=>747,chr(170)=>300,chr(171)=>500,chr(172)=>570,chr(173)=>333,chr(174)=>747,chr(175)=>333,
chr(176)=>400,chr(177)=>570,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>556,chr(182)=>540,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>330,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722,
chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>389,chr(205)=>389,chr(206)=>389,chr(207)=>389,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>570,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
chr(220)=>722,chr(221)=>722,chr(222)=>611,chr(223)=>556,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>722,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>556,
chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>570,chr(248)=>500,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500);
?>

View File

@@ -0,0 +1,15 @@
<?php
$fpdf_charwidths['timesBI']=array(
chr(0)=>250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>389,'"'=>555,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>278,'('=>333,')'=>333,'*'=>500,'+'=>570,
','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>570,'='=>570,'>'=>570,'?'=>500,'@'=>832,'A'=>667,
'B'=>667,'C'=>667,'D'=>722,'E'=>667,'F'=>667,'G'=>722,'H'=>778,'I'=>389,'J'=>500,'K'=>667,'L'=>611,'M'=>889,'N'=>722,'O'=>722,'P'=>611,'Q'=>722,'R'=>667,'S'=>556,'T'=>611,'U'=>722,'V'=>667,'W'=>889,
'X'=>667,'Y'=>611,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>570,'_'=>500,'`'=>333,'a'=>500,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>333,'g'=>500,'h'=>556,'i'=>278,'j'=>278,'k'=>500,'l'=>278,'m'=>778,
'n'=>556,'o'=>500,'p'=>500,'q'=>500,'r'=>389,'s'=>389,'t'=>278,'u'=>556,'v'=>444,'w'=>667,'x'=>500,'y'=>444,'z'=>389,'{'=>348,'|'=>220,'}'=>348,'~'=>570,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500,
chr(132)=>500,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>944,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>389,chr(159)=>611,chr(160)=>250,chr(161)=>389,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>220,chr(167)=>500,chr(168)=>333,chr(169)=>747,chr(170)=>266,chr(171)=>500,chr(172)=>606,chr(173)=>333,chr(174)=>747,chr(175)=>333,
chr(176)=>400,chr(177)=>570,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>576,chr(182)=>500,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>300,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667,
chr(198)=>944,chr(199)=>667,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>389,chr(205)=>389,chr(206)=>389,chr(207)=>389,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>570,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
chr(220)=>722,chr(221)=>611,chr(222)=>611,chr(223)=>500,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>722,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>556,
chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>570,chr(248)=>500,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>444,chr(254)=>500,chr(255)=>444);
?>

View File

@@ -0,0 +1,15 @@
<?php
$fpdf_charwidths['timesI']=array(
chr(0)=>250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>420,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>214,'('=>333,')'=>333,'*'=>500,'+'=>675,
','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>675,'='=>675,'>'=>675,'?'=>500,'@'=>920,'A'=>611,
'B'=>611,'C'=>667,'D'=>722,'E'=>611,'F'=>611,'G'=>722,'H'=>722,'I'=>333,'J'=>444,'K'=>667,'L'=>556,'M'=>833,'N'=>667,'O'=>722,'P'=>611,'Q'=>722,'R'=>611,'S'=>500,'T'=>556,'U'=>722,'V'=>611,'W'=>833,
'X'=>611,'Y'=>556,'Z'=>556,'['=>389,'\\'=>278,']'=>389,'^'=>422,'_'=>500,'`'=>333,'a'=>500,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>278,'g'=>500,'h'=>500,'i'=>278,'j'=>278,'k'=>444,'l'=>278,'m'=>722,
'n'=>500,'o'=>500,'p'=>500,'q'=>500,'r'=>389,'s'=>389,'t'=>278,'u'=>500,'v'=>444,'w'=>667,'x'=>444,'y'=>444,'z'=>389,'{'=>400,'|'=>275,'}'=>400,'~'=>541,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500,
chr(132)=>556,chr(133)=>889,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>500,chr(139)=>333,chr(140)=>944,chr(141)=>350,chr(142)=>556,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>556,chr(148)=>556,chr(149)=>350,chr(150)=>500,chr(151)=>889,chr(152)=>333,chr(153)=>980,
chr(154)=>389,chr(155)=>333,chr(156)=>667,chr(157)=>350,chr(158)=>389,chr(159)=>556,chr(160)=>250,chr(161)=>389,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>275,chr(167)=>500,chr(168)=>333,chr(169)=>760,chr(170)=>276,chr(171)=>500,chr(172)=>675,chr(173)=>333,chr(174)=>760,chr(175)=>333,
chr(176)=>400,chr(177)=>675,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>500,chr(182)=>523,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>310,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>611,chr(193)=>611,chr(194)=>611,chr(195)=>611,chr(196)=>611,chr(197)=>611,
chr(198)=>889,chr(199)=>667,chr(200)=>611,chr(201)=>611,chr(202)=>611,chr(203)=>611,chr(204)=>333,chr(205)=>333,chr(206)=>333,chr(207)=>333,chr(208)=>722,chr(209)=>667,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>675,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
chr(220)=>722,chr(221)=>556,chr(222)=>611,chr(223)=>500,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>667,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>500,
chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>675,chr(248)=>500,chr(249)=>500,chr(250)=>500,chr(251)=>500,chr(252)=>500,chr(253)=>444,chr(254)=>500,chr(255)=>444);
?>

View File

@@ -0,0 +1,15 @@
<?php
$fpdf_charwidths['zapfdingbats']=array(
chr(0)=>0,chr(1)=>0,chr(2)=>0,chr(3)=>0,chr(4)=>0,chr(5)=>0,chr(6)=>0,chr(7)=>0,chr(8)=>0,chr(9)=>0,chr(10)=>0,chr(11)=>0,chr(12)=>0,chr(13)=>0,chr(14)=>0,chr(15)=>0,chr(16)=>0,chr(17)=>0,chr(18)=>0,chr(19)=>0,chr(20)=>0,chr(21)=>0,
chr(22)=>0,chr(23)=>0,chr(24)=>0,chr(25)=>0,chr(26)=>0,chr(27)=>0,chr(28)=>0,chr(29)=>0,chr(30)=>0,chr(31)=>0,' '=>278,'!'=>974,'"'=>961,'#'=>974,'$'=>980,'%'=>719,'&'=>789,'\''=>790,'('=>791,')'=>690,'*'=>960,'+'=>939,
','=>549,'-'=>855,'.'=>911,'/'=>933,'0'=>911,'1'=>945,'2'=>974,'3'=>755,'4'=>846,'5'=>762,'6'=>761,'7'=>571,'8'=>677,'9'=>763,':'=>760,';'=>759,'<'=>754,'='=>494,'>'=>552,'?'=>537,'@'=>577,'A'=>692,
'B'=>786,'C'=>788,'D'=>788,'E'=>790,'F'=>793,'G'=>794,'H'=>816,'I'=>823,'J'=>789,'K'=>841,'L'=>823,'M'=>833,'N'=>816,'O'=>831,'P'=>923,'Q'=>744,'R'=>723,'S'=>749,'T'=>790,'U'=>792,'V'=>695,'W'=>776,
'X'=>768,'Y'=>792,'Z'=>759,'['=>707,'\\'=>708,']'=>682,'^'=>701,'_'=>826,'`'=>815,'a'=>789,'b'=>789,'c'=>707,'d'=>687,'e'=>696,'f'=>689,'g'=>786,'h'=>787,'i'=>713,'j'=>791,'k'=>785,'l'=>791,'m'=>873,
'n'=>761,'o'=>762,'p'=>762,'q'=>759,'r'=>759,'s'=>892,'t'=>892,'u'=>788,'v'=>784,'w'=>438,'x'=>138,'y'=>277,'z'=>415,'{'=>392,'|'=>392,'}'=>668,'~'=>668,chr(127)=>0,chr(128)=>390,chr(129)=>390,chr(130)=>317,chr(131)=>317,
chr(132)=>276,chr(133)=>276,chr(134)=>509,chr(135)=>509,chr(136)=>410,chr(137)=>410,chr(138)=>234,chr(139)=>234,chr(140)=>334,chr(141)=>334,chr(142)=>0,chr(143)=>0,chr(144)=>0,chr(145)=>0,chr(146)=>0,chr(147)=>0,chr(148)=>0,chr(149)=>0,chr(150)=>0,chr(151)=>0,chr(152)=>0,chr(153)=>0,
chr(154)=>0,chr(155)=>0,chr(156)=>0,chr(157)=>0,chr(158)=>0,chr(159)=>0,chr(160)=>0,chr(161)=>732,chr(162)=>544,chr(163)=>544,chr(164)=>910,chr(165)=>667,chr(166)=>760,chr(167)=>760,chr(168)=>776,chr(169)=>595,chr(170)=>694,chr(171)=>626,chr(172)=>788,chr(173)=>788,chr(174)=>788,chr(175)=>788,
chr(176)=>788,chr(177)=>788,chr(178)=>788,chr(179)=>788,chr(180)=>788,chr(181)=>788,chr(182)=>788,chr(183)=>788,chr(184)=>788,chr(185)=>788,chr(186)=>788,chr(187)=>788,chr(188)=>788,chr(189)=>788,chr(190)=>788,chr(191)=>788,chr(192)=>788,chr(193)=>788,chr(194)=>788,chr(195)=>788,chr(196)=>788,chr(197)=>788,
chr(198)=>788,chr(199)=>788,chr(200)=>788,chr(201)=>788,chr(202)=>788,chr(203)=>788,chr(204)=>788,chr(205)=>788,chr(206)=>788,chr(207)=>788,chr(208)=>788,chr(209)=>788,chr(210)=>788,chr(211)=>788,chr(212)=>894,chr(213)=>838,chr(214)=>1016,chr(215)=>458,chr(216)=>748,chr(217)=>924,chr(218)=>748,chr(219)=>918,
chr(220)=>927,chr(221)=>928,chr(222)=>928,chr(223)=>834,chr(224)=>873,chr(225)=>828,chr(226)=>924,chr(227)=>924,chr(228)=>917,chr(229)=>930,chr(230)=>931,chr(231)=>463,chr(232)=>883,chr(233)=>836,chr(234)=>836,chr(235)=>867,chr(236)=>867,chr(237)=>696,chr(238)=>696,chr(239)=>874,chr(240)=>0,chr(241)=>874,
chr(242)=>760,chr(243)=>946,chr(244)=>771,chr(245)=>865,chr(246)=>771,chr(247)=>888,chr(248)=>967,chr(249)=>888,chr(250)=>831,chr(251)=>873,chr(252)=>927,chr(253)=>970,chr(254)=>918,chr(255)=>0);
?>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,253 @@
<?php
/*
This script is supposed to be used together with the HTML2FPDF.php class
Copyright (C) 2004-2005 Renato Coelho
*/
function ConvertColor($color="#000000"){
//returns an associative array (keys: R,G,B) from html code (e.g. #3FE5AA)
//W3C approved color array (disabled)
//static $common_colors = array('black'=>'#000000','silver'=>'#C0C0C0','gray'=>'#808080', 'white'=>'#FFFFFF','maroon'=>'#800000','red'=>'#FF0000','purple'=>'#800080','fuchsia'=>'#FF00FF','green'=>'#008000','lime'=>'#00FF00','olive'=>'#808000','yellow'=>'#FFFF00','navy'=>'#000080', 'blue'=>'#0000FF','teal'=>'#008080','aqua'=>'#00FFFF');
//All color names array
static $common_colors = array('antiquewhite'=>'#FAEBD7','aquamarine'=>'#7FFFD4','beige'=>'#F5F5DC','black'=>'#000000','blue'=>'#0000FF','brown'=>'#A52A2A','cadetblue'=>'#5F9EA0','chocolate'=>'#D2691E','cornflowerblue'=>'#6495ED','crimson'=>'#DC143C','darkblue'=>'#00008B','darkgoldenrod'=>'#B8860B','darkgreen'=>'#006400','darkmagenta'=>'#8B008B','darkorange'=>'#FF8C00','darkred'=>'#8B0000','darkseagreen'=>'#8FBC8F','darkslategray'=>'#2F4F4F','darkviolet'=>'#9400D3','deepskyblue'=>'#00BFFF','dodgerblue'=>'#1E90FF','firebrick'=>'#B22222','forestgreen'=>'#228B22','gainsboro'=>'#DCDCDC','gold'=>'#FFD700','gray'=>'#808080','green'=>'#008000','greenyellow'=>'#ADFF2F','hotpink'=>'#FF69B4','indigo'=>'#4B0082','khaki'=>'#F0E68C','lavenderblush'=>'#FFF0F5','lemonchiffon'=>'#FFFACD','lightcoral'=>'#F08080','lightgoldenrodyellow'=>'#FAFAD2','lightgreen'=>'#90EE90','lightsalmon'=>'#FFA07A','lightskyblue'=>'#87CEFA','lightslategray'=>'#778899','lightyellow'=>'#FFFFE0','limegreen'=>'#32CD32','magenta'=>'#FF00FF','mediumaquamarine'=>'#66CDAA','mediumorchid'=>'#BA55D3','mediumseagreen'=>'#3CB371','mediumspringgreen'=>'#00FA9A','mediumvioletred'=>'#C71585','mintcream'=>'#F5FFFA','moccasin'=>'#FFE4B5','navy'=>'#000080','olive'=>'#808000','orange'=>'#FFA500','orchid'=>'#DA70D6','palegreen'=>'#98FB98','palevioletred'=>'#D87093','peachpuff'=>'#FFDAB9','pink'=>'#FFC0CB','powderblue'=>'#B0E0E6','red'=>'#FF0000','royalblue'=>'#4169E1','salmon'=>'#FA8072','seagreen'=>'#2E8B57','sienna'=>'#A0522D','skyblue'=>'#87CEEB','slategray'=>'#708090','springgreen'=>'#00FF7F','tan'=>'#D2B48C','thistle'=>'#D8BFD8','turquoise'=>'#40E0D0','violetred'=>'#D02090','white'=>'#FFFFFF','yellow'=>'#FFFF00');
//http://www.w3schools.com/css/css_colornames.asp
if ( ($color{0} != '#') and ( strstr($color,'(') === false ) ) $color = $common_colors[strtolower($color)];
if ($color{0} == '#') //case of #nnnnnn or #nnn
{
$cor = strtoupper($color);
if (strlen($cor) == 4) // Turn #RGB into #RRGGBB
{
$cor = "#" . $cor{1} . $cor{1} . $cor{2} . $cor{2} . $cor{3} . $cor{3};
}
$R = substr($cor, 1, 2);
$vermelho = hexdec($R);
$V = substr($cor, 3, 2);
$verde = hexdec($V);
$B = substr($cor, 5, 2);
$azul = hexdec($B);
$color = array();
$color['R']=$vermelho;
$color['G']=$verde;
$color['B']=$azul;
}
else //case of RGB(r,g,b)
{
$color = str_replace("rgb(",'',$color); //remove <20>rgb(<28>
$color = str_replace("RGB(",'',$color); //remove <20>RGB(<28> -- PHP < 5 does not have str_ireplace
$color = str_replace(")",'',$color); //remove <20>)<29>
$cores = explode(",", $color);
$color = array();
$color['R']=$cores[0];
$color['G']=$cores[1];
$color['B']=$cores[2];
}
if (empty($color)) return array('R'=>255,'G'=>255,'B'=>255);
else return $color; // array['R']['G']['B']
}
function ConvertSize($size=5,$maxsize=0){
// Depends of maxsize value to make % work properly. Usually maxsize == pagewidth
//Identify size (remember: we are using 'mm' units here)
if ( stristr($size,'px') ) $size *= 0.2645; //pixels
elseif ( stristr($size,'cm') ) $size *= 10; //centimeters
elseif ( stristr($size,'mm') ) $size += 0; //millimeters
elseif ( stristr($size,'in') ) $size *= 25.4; //inches
elseif ( stristr($size,'pc') ) $size *= 38.1/9; //PostScript picas
elseif ( stristr($size,'pt') ) $size *= 25.4/72; //72dpi
elseif ( stristr($size,'%') )
{
$size += 0; //make "90%" become simply "90"
$size *= $maxsize/100;
}
else $size *= 0.2645; //nothing == px
return $size;
}
function value_entity_decode($html)
{
//replace each value entity by its respective char
preg_match_all('|&#(.*?);|',$html,$temparray);
foreach($temparray[1] as $val) $html = str_replace("&#".$val.";",chr($val),$html);
return $html;
}
function lesser_entity_decode($html)
{
//supports the most used entity codes
$html = str_replace("&nbsp;"," ",$html);
$html = str_replace("&amp;","&",$html);
$html = str_replace("&lt;","<",$html);
$html = str_replace("&gt;",">",$html);
$html = str_replace("&laquo;","<EFBFBD>",$html);
$html = str_replace("&raquo;","<EFBFBD>",$html);
$html = str_replace("&para;","<EFBFBD>",$html);
$html = str_replace("&euro;","<EFBFBD>",$html);
$html = str_replace("&trade;","<EFBFBD>",$html);
$html = str_replace("&copy;","<EFBFBD>",$html);
$html = str_replace("&reg;","<EFBFBD>",$html);
$html = str_replace("&plusmn;","<EFBFBD>",$html);
$html = str_replace("&tilde;","~",$html);
$html = str_replace("&circ;","^",$html);
$html = str_replace("&quot;",'"',$html);
$html = str_replace("&permil;","<EFBFBD>",$html);
$html = str_replace("&Dagger;","<EFBFBD>",$html);
$html = str_replace("&dagger;","<EFBFBD>",$html);
return $html;
}
function AdjustHTML($html,$usepre=true)
{
//Try to make the html text more manageable (turning it into XHTML)
//Remove javascript code from HTML (should not appear in the PDF file)
$regexp = '|<script.*?</script>|si';
$html = preg_replace($regexp,'',$html);
$html = str_replace("\r\n","\n",$html); //replace carriagereturn-linefeed-combo by a simple linefeed
$html = str_replace("\f",'',$html); //replace formfeed by nothing
$html = str_replace("\r",'',$html); //replace carriage return by nothing
if ($usepre) //used to keep \n on content inside <pre> and inside <textarea>
{
// Preserve '\n's in content between the tags <pre> and </pre>
$regexp = '#<pre(.*?)>(.+?)</pre>#si';
$thereispre = preg_match_all($regexp,$html,$temp);
// Preserve '\n's in content between the tags <textarea> and </textarea>
$regexp2 = '#<textarea(.*?)>(.+?)</textarea>#si';
$thereistextarea = preg_match_all($regexp2,$html,$temp2);
$html = str_replace("\n",' ',$html); //replace linefeed by spaces
$html = str_replace("\t",' ',$html); //replace tabs by spaces
$regexp3 = '#\s{2,}#s'; // turn 2+ consecutive spaces into one
$html = preg_replace($regexp3,' ',$html);
$iterator = 0;
while($thereispre) //Recover <pre attributes>content</pre>
{
$temp[2][$iterator] = str_replace("\n","<br>",$temp[2][$iterator]);
$html = preg_replace($regexp,'<erp'.$temp[1][$iterator].'>'.$temp[2][$iterator].'</erp>',$html,1);
$thereispre--;
$iterator++;
}
$iterator = 0;
while($thereistextarea) //Recover <textarea attributes>content</textarea>
{
$temp2[2][$iterator] = str_replace(" ","&nbsp;",$temp2[2][$iterator]);
$html = preg_replace($regexp2,'<aeratxet'.$temp2[1][$iterator].'>'.trim($temp2[2][$iterator]).'</aeratxet>',$html,1);
$thereistextarea--;
$iterator++;
}
//Restore original tag names
$html = str_replace("<erp","<pre",$html);
$html = str_replace("</erp>","</pre>",$html);
$html = str_replace("<aeratxet","<textarea",$html);
$html = str_replace("</aeratxet>","</textarea>",$html);
// (the code above might slowdown overall performance?)
} //end of if($usepre)
else
{
$html = str_replace("\n",' ',$html); //replace linefeed by spaces
$html = str_replace("\t",' ',$html); //replace tabs by spaces
$regexp = '/\\s{2,}/s'; // turn 2+ consecutive spaces into one
$html = preg_replace($regexp,' ',$html);
}
// remove redundant <br>'s before </div>, avoiding huge leaps between text blocks
// such things appear on computer-generated HTML code
$regexp = '/(<br[ \/]?[\/]?>)+?<\/div>/si'; //<?//fix PSPAD highlight bug
$html = preg_replace($regexp,'</div>',$html);
return $html;
}
function dec2alpha($valor,$toupper="true"){
// returns a string from A-Z to AA-ZZ to AAA-ZZZ
// OBS: A = 65 ASCII TABLE VALUE
if (($valor < 1) || ($valor > 18278)) return "?"; //supports 'only' up to 18278
$c1 = $c2 = $c3 = '';
if ($valor > 702) // 3 letters (up to 18278)
{
$c1 = 65 + floor(($valor-703)/676);
$c2 = 65 + floor((($valor-703)%676)/26);
$c3 = 65 + floor((($valor-703)%676)%26);
}
elseif ($valor > 26) // 2 letters (up to 702)
{
$c1 = (64 + (int)(($valor-1) / 26));
$c2 = (64 + (int)($valor % 26));
if ($c2 == 64) $c2 += 26;
}
else // 1 letter (up to 26)
{
$c1 = (64 + $valor);
}
$alpha = chr($c1);
if ($c2 != '') $alpha .= chr($c2);
if ($c3 != '') $alpha .= chr($c3);
if (!$toupper) $alpha = strtolower($alpha);
return $alpha;
}
function dec2roman($valor,$toupper=true){
//returns a string as a roman numeral
if (($valor >= 5000) || ($valor < 1)) return "?"; //supports 'only' up to 4999
$aux = (int)($valor/1000);
if ($aux!==0)
{
$valor %= 1000;
while($aux!==0)
{
$r1 .= "M";
$aux--;
}
}
$aux = (int)($valor/100);
if ($aux!==0)
{
$valor %= 100;
switch($aux){
case 3: $r2="C";
case 2: $r2.="C";
case 1: $r2.="C"; break;
case 9: $r2="CM"; break;
case 8: $r2="C";
case 7: $r2.="C";
case 6: $r2.="C";
case 5: $r2="D".$r2; break;
case 4: $r2="CD"; break;
default: break;
}
}
$aux = (int)($valor/10);
if ($aux!==0)
{
$valor %= 10;
switch($aux){
case 3: $r3="X";
case 2: $r3.="X";
case 1: $r3.="X"; break;
case 9: $r3="XC"; break;
case 8: $r3="X";
case 7: $r3.="X";
case 6: $r3.="X";
case 5: $r3="L".$r3; break;
case 4: $r3="XL"; break;
default: break;
}
}
switch($valor){
case 3: $r4="I";
case 2: $r4.="I";
case 1: $r4.="I"; break;
case 9: $r4="IX"; break;
case 8: $r4="I";
case 7: $r4.="I";
case 6: $r4.="I";
case 5: $r4="V".$r4; break;
case 4: $r4="IV"; break;
default: break;
}
$roman = $r1.$r2.$r3.$r4;
if (!$toupper) $roman = strtolower($roman);
return $roman;
}
?>

View File

@@ -0,0 +1,228 @@
<?php
/*
Copyright (C) 2004 Renato Coelho
(PHP)Source 2 Doc v0.5.0
This is a simple script created in order to update the HTML2FPDF page
It should make a php class documentation
LICENSE: Freeware.
Lacks: html_decode and the likes
Plans: make an independent table for each part?
Usage:
require_once('source2doc.php');
echo source2doc('filename.php'); //Print doc info on browser
HOW TO declare var types and HOW TO use @return and @desc: (//! is a one-line comment)
var $name; //! type
function name()
{
//! @return void
//! @desc Say something in one line, but dont use tags or ';' here
//! @desc Fale algo em uma linha, mas nao use tags ou ';' aqui
...}
*/
function source2doc($filename)
{
define('endl',"\n");
$classname = '';
$extends = '';
$file = fopen($filename,"r");
$tamarquivo = filesize($filename);
$buffer = fread($file, $tamarquivo);
fclose($file);
////
// Remove all PHP comments
// Leave only the special comments '//!'
////
//Remove /* multi-line comments */
$regexp = '|/\\*.*?\\*/|s';
$buffer = preg_replace($regexp,'',$buffer);
//Remove // one line comments
$regexp = '|//[^!].*|m';
$buffer = preg_replace($regexp,'',$buffer);
////
// Get class name and what it extends (or not)
////
$regexp = '|class\\s+?(\\S+)(\\s+?\\S+\\s+?(\\S+))?|mi';
preg_match($regexp,$buffer,$aux); //one class per source file
$classname = $aux[1];
if (!empty($aux[3])) $extends = $aux[3];
else $extends = '';
$html = '<b>CLASSNAME:</b> ' . $classname . '<br />' . endl;
if ($extends != '') $html .= '<b>EXTENDS:</b> ' . $extends . '<br />' . endl;
$html .= '<table border="1" width="100%">' . endl;
////
// Get constants from source code
////
$html .= '<tr>' . endl;
$html .= '<th bgcolor="#6191ff" colspan="2">' . endl;
$html .= 'CONSTANTS' . endl;
$html .= '</th>' . endl;
$html .= '</tr>' . endl;
$regexp = '/define[(](.*?);/si';
preg_match_all($regexp,$buffer,$const);
$const = $const[0];
for($i=0; $i < count($const) ; $i++)
{
$html .= '<tr>' . endl;
$html .= '<td colspan="2">' . endl;
$html .= '<font size=2>' . $const[$i] . '</font>' .endl;
$html .= '</td>' . endl;
$html .= '</tr>' . endl;
}
////
// Get imports from source code
////
$html .= '<tr>' . endl;
$html .= '<th bgcolor="#6191ff" colspan="2">' . endl;
$html .= 'IMPORTS' . endl;
$html .= '</th>' . endl;
$html .= '</tr>' . endl;
$regexp = '/((require|include)[(_].*?);/si';
preg_match_all($regexp,$buffer,$imports);
$imports = $imports[0];
for($i=0; $i < count($imports) ; $i++)
{
$html .= '<tr>' . endl;
$html .= '<td colspan="2">' . endl;
$html .= '<font size=2>' . $imports[$i] . '</font>' .endl;
$html .= '</td>' . endl;
$html .= '</tr>' . endl;
}
////
// Get attributes from class
////
$html .= '<tr>' . endl;
$html .= '<th bgcolor="#6191ff" colspan="2">' . endl;
$html .= 'ATTRIBUTES' . endl;
$html .= '</th>' . endl;
$html .= '</tr>' . endl;
$regexp = '|var\\s(.+);\\s*(//!\\s*?(\\S+))?|mi';
preg_match_all($regexp,$buffer,$atr);
$vname = $atr[1];
$vtype = $atr[3];
if(!empty($vname))
{
$html .= '<tr>' . endl;
$html .= '<td align="center" width="10%" bgcolor="#bbbbbb">' . endl;
$html .= 'TYPE' . endl;
$html .= '</td>' . endl;
$html .= '<td align="center" width="90%" bgcolor="#bbbbbb">' . endl;
$html .= 'NAME' . endl;
$html .= '</td>' . endl;
$html .= '</tr>' . endl;
}
for($i=0; $i < count($vname) ; $i++)
{
$html .= '<tr>' . endl;
$html .= '<td align="center">' . endl;
if (empty($vtype[$i])) $html .= '<font size=2><i>(???)</i></font>' . endl;
else $html .= '<font size=2><i>('. $vtype[$i] .')</i></font>' . endl;
$html .= '</td>' . endl;
$html .= '<td>' . endl;
$html .= '<font size=2><b>var</b> ' . $vname[$i] . ';</font>' . endl;
$html .= '</td>' . endl;
$html .= '</tr>' . endl;
}
/////
// Get class' methods
/////
$html .= '<tr>' . endl;
$html .= '<th bgcolor="#6191ff" colspan="2">' . endl;
$html .= 'METHODS' . endl;
$html .= '</th>' . endl;
$html .= '</tr>' . endl;
$regexp = '|function\\s([^)]*)[)].*?(//!.*?)*;|si';
preg_match_all($regexp,$buffer,$func);
$funcname = $func[1];
$funccomment = $func[0];
for($i=0; $i < count($funcname) ; $i++)
{
$html .= '<tr>' . endl;
$html .= '<td bgcolor="#33ff99" colspan="2">' . endl;
$html .= '<font size=2><b>function</b> ' . $funcname[$i] . ')</font>' . endl;
$html .= '</td>' . endl;
$html .= '</tr>' . endl;
$desc = '';
$ret = '';
$regexp = '|//!(.*)|mi';
preg_match_all($regexp,$funccomment[$i],$temp);
$temp = $temp[1];
if (empty($temp[0])) continue;
foreach($temp as $val)
{
if (strstr($val,'@desc'))
{
$regexp = '|.*?@desc(.*)|si';
preg_match($regexp,$val,$temp2);
$desc = $temp2[1];
}
elseif (strstr($val,'@return'))
{
$regexp = '|.*?@return(.*)|si';
preg_match($regexp,$val,$temp3);
$ret = $temp3[1];
}
}
if ($ret != '' or $desc != '')
{
$html .= '<tr>' . endl;
//@return column
$html .= '<td width="30%">' . endl;
if ($ret == '') $html .= '<font size=2><b>Return:</b> <i>?void?</i></font>' . endl;
else $html .= '<font size=2><b>Return:</b> <i>' . trim($ret) . '</i></font>' . endl;
$html .= '</td>' . endl;
//@desc column
$html .= '<td width="70%">' . endl;
if ($desc == '') $html .= '<font size=2><b>OBS:</b> </font>' . endl;
else $html .= '<font size=2><b>OBS:</b> ' . trim($desc) . '</font>' . endl;
$html .= '</td>' . endl;
$html .= '</tr>' . endl;
}
}
/////
$html .= '</table>';
return $html;
}
?>

View File

@@ -0,0 +1,123 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*****************************************************************************
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/rpl.php. Software distributed under the
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
* either express or implied.
*
* You may:
* a) Use and distribute this code exactly as you received without payment or
* a royalty or other fee.
* b) Create extensions for this code, provided that you make the extensions
* publicly available and document your modifications clearly.
* c) Charge for a fee for warranty or support or for accepting liability
* obligations for your customers.
*
* You may NOT:
* a) Charge for the use of the original code or extensions, including in
* electronic distribution models, such as ASP (Application Service
* Provider).
* b) Charge for the original source code or your extensions other than a
* nominal fee to cover distribution costs where such distribution
* involves PHYSICAL media.
* c) Modify or delete any pre-existing copyright notices, change notices,
* or License text in the Licensed Software
* d) Assert any patent claims against the Licensor or Contributors, or
* which would in any way restrict the ability of any third party to use the
* Licensed Software.
*
* You must:
* a) Document any modifications you make to this code including the nature of
* the change, the authors of the change, and the date of the change.
* b) Make the source code for any extensions you deploy available via an
* Electronic Distribution Mechanism such as FTP or HTTP download.
* c) Notify the licensor of the availability of source code to your extensions
* and include instructions on how to acquire the source code and updates.
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
* reproduce, perform, modify, sublicense, and distribute your extensions.
*
* The Original Code is: CommuniCore
* Olavo Farias
* 2006-04-7 olavo.farias@gmail.com
*
* The Initial Developer of the Original Code is CommuniCore.
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
* All Rights Reserved.
********************************************************************************/
$mod_strings = array (
//added 01.07.2009
'LBL_PLACE_OF_REGISTER'=>'Place of register',
//added 26.02.2009
'LBL_TEMPLATE_FILES_DEFS' => 'Template Files',
'LBL_PREVIEW_PDF' => 'Preview PDF',
'LBL_MODULE_NAME' => 'Document Templates',
'LBL_MODULE_TITLE' => 'Document Templates: Home',
'LBL_MODULE_ID' => 'Document Templates',
'LBL_SEARCH_FORM_TITLE' => 'Document Templates Search',
'LBL_LIST_FORM_TITLE' => 'Document Templates List',
'LBL_NEW_FORM_TITLE' => 'New Document Templates',
'LBL_ID' => 'Id',
'LBL_NAME' => 'Name',
'LBL_DATE_ENTERED' => 'Date entered',
'LBL_DATE_MODIFIED' => 'Date modified',
'LBL_MODIFIED_BY' => 'Modified by',
'LBL_ASSIGNED_TO' => 'Assigned to',
'LBL_CREATED_BY' => 'Created by',
'LBL_CREATED_BY_USER' => 'Created by',
'LBL_MODIFIED_BY_USER' => 'Modified by',
'LBL_ASSIGNED_TO_USER' => 'Assigned to',
'LBL_DELETED' => 'Deleted',
'LBL_LOGO_PATH' => 'Logo',
'LBL_LOGO_NAME' => 'Logo name',
'LBL_LOGO_ID' => 'Logo ID',
'LBL_LOGO_NO_LOGO' => 'No Image Logo',
'LBL_LOGO_INFO' => 'The image file format can be either .png or .jpg',
'LBL_LOGO_PREVIEW' => 'Logo Preview:',
'LBL_INFORMATIONS' => 'Informations',
'LBL_LOGO' => 'Add Logo',
'LBL_ACCOUNT_NAME' => 'Account name',
'LBL_ACCOUNT_ID' => 'Account id',
'LBL_ACCOUNT_NUMBER' => 'Account number',
'LBL_FOOTER_TEXT' => 'Footer Text',
'LBL_DEFAULT_FOOTER_TEXT' => "\$dt_account_name - Tel: \$dt_footer_phone - Fax: \$dt_footer_fax\nKonto: \$dt_footer_account - BLZ \$dt_footer_swift - Bank: \$dt_footer_bankname\nVAT-ID (UmSt. Nr.) \$dt_footer_vatid - TAX Nr. (Steuer Nr.) \$dt_footer_regon - HRB: \$dt_footer_krs - Amtsgericht: Neuss",
'LBL_HEADER_TEXT' => 'Header Text',
'LBL_DEFAULT_HEADER_TEXT' => "\$acc_name\n\$acc_billing_address_street\n\$acc_billing_address_postalcode \$acc_billing_address_city",
'LBL_TEMPLATE_TEXTS' => 'Template Texts',
'LBL_FOOTER_ACCOUNT' => 'Account',
'LBL_FOOTER_ADDRESS' => 'Address',
'LBL_FOOTER_PHONE' => 'Phone',
'LBL_FOOTER_FAX' => 'Fax',
'LBL_FOOTER_KRS' => 'KRS',
'LBL_FOOTER_NIP' => 'NIP',
'LBL_FOOTER_REGON' => 'REGON',
'LBL_FOOTER_CAPITAL' => 'Account capital',
'LBL_FOOTER_MANAGEMENT' => 'Management',
'LBL_FOOTER_SWIFT' => 'Swift',
'LBL_FOOTER_BANKNAME' => 'Bank name',
'LBL_FOOTER_VATID' => 'VAT-ID',
'LBL_DOCUMENT_NUMBER_FORMAT_ID' => 'Doc. number format',
'LBL_DOCUMENTS_PER_DAY_ID' => 'Number Of Documents',
'LBL_DOCUMENT_NUMBER_LETTER' => 'Doc. number letter',
'LBL_CORRECT_NUMBER_LETTER' => 'Correct number letter',
'LNK_NEW_ECMDOCUMENTTEMPLATES' => 'Create Document Tmplate',
'LNK_ECMDOCUMENTTEMPLATES_LIST' => 'Document Template list',
'LBL_ECMDOCUMENTTEMPLATE_PDF' => 'Show PDF',
'LBL_ECMDOCUMENTTEMPLATE_PDF_BUTTON_KEY' => 'Show PDF [Alt+P]',
'LBL_ECMDOCUMENTTEMPLATE_PDF_BUTTON_TITLE' => 'Show Work Report in PDF file.',
'LBL_DOCUMENTS_PER' => 'Documents Per',
'LBL_SHOW_HEADER_ON_ALL_PAGES' => 'Show Header On All Pages',
'LBL_SHOW_FOOTER_ON_ALL_PAGES' => 'Show Footer On All Pages',
'LBL_ECMLANGUAGE' => 'Language',
'LBL_CHANGE_ALL_OLD_RECORDS' => 'Change All Old Records',
);
?>

View File

@@ -0,0 +1,119 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*****************************************************************************
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/rpl.php. Software distributed under the
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
* either express or implied.
*
* You may:
* a) Use and distribute this code exactly as you received without payment or
* a royalty or other fee.
* b) Create extensions for this code, provided that you make the extensions
* publicly available and document your modifications clearly.
* c) Charge for a fee for warranty or support or for accepting liability
* obligations for your customers.
*
* You may NOT:
* a) Charge for the use of the original code or extensions, including in
* electronic distribution models, such as ASP (Application Service
* Provider).
* b) Charge for the original source code or your extensions other than a
* nominal fee to cover distribution costs where such distribution
* involves PHYSICAL media.
* c) Modify or delete any pre-existing copyright notices, change notices,
* or License text in the Licensed Software
* d) Assert any patent claims against the Licensor or Contributors, or
* which would in any way restrict the ability of any third party to use the
* Licensed Software.
*
* You must:
* a) Document any modifications you make to this code including the nature of
* the change, the authors of the change, and the date of the change.
* b) Make the source code for any extensions you deploy available via an
* Electronic Distribution Mechanism such as FTP or HTTP download.
* c) Notify the licensor of the availability of source code to your extensions
* and include instructions on how to acquire the source code and updates.
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
* reproduce, perform, modify, sublicense, and distribute your extensions.
*
* The Original Code is: CommuniCore
* Olavo Farias
* 2006-04-7 olavo.farias@gmail.com
*
* The Initial Developer of the Original Code is CommuniCore.
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
* All Rights Reserved.
********************************************************************************/
$mod_strings = array (
'LBL_MODULE_NAME' => 'Document Templates',
'LBL_MODULE_TITLE' => 'Document Templates: Home',
'LBL_MODULE_ID' => 'Document Templates',
'LBL_SEARCH_FORM_TITLE' => 'Document Templates Search',
'LBL_LIST_FORM_TITLE' => 'Document Templates List',
'LBL_NEW_FORM_TITLE' => 'New Document Templates',
'LBL_ID' => 'Id',
'LBL_NAME' => 'Name',
'LBL_DATE_ENTERED' => 'Date entered',
'LBL_DATE_MODIFIED' => 'Date modified',
'LBL_MODIFIED_BY' => 'Modified by',
'LBL_ASSIGNED_TO' => 'Assigned to',
'LBL_CREATED_BY' => 'Created by',
'LBL_CREATED_BY_USER' => 'Created by',
'LBL_MODIFIED_BY_USER' => 'Modified by',
'LBL_ASSIGNED_TO_USER' => 'Assigned to',
'LBL_DELETED' => 'Deleted',
'LBL_LOGO_PATH' => 'Logo',
'LBL_LOGO_NAME' => 'Logo name',
'LBL_LOGO_ID' => 'Logo ID',
'LBL_LOGO_NO_LOGO' => 'No Image Logo',
'LBL_LOGO_INFO' => 'The image file format can be either .png or .jpg',
'LBL_LOGO_PREVIEW' => 'Logo Preview:',
'LBL_INFORMATIONS' => 'Informations',
'LBL_LOGO' => 'Add Logo',
'LBL_ACCOUNT_NAME' => 'Account name',
'LBL_ACCOUNT_ID' => 'Account id',
// 'LBL_ACCOUNT_NUMBER' => 'Account number',
'LBL_FOOTER_TEXT' => 'Footer Text',
'LBL_DEFAULT_FOOTER_TEXT' => "\$dt_account_name - Tel: \$dt_footer_phone - Fax: \$dt_footer_fax\nKonto: \$dt_footer_account - BLZ \$dt_footer_swift - Bank: \$dt_footer_bankname\nVAT-ID (UmSt. Nr.) \$dt_footer_vatid - TAX Nr. (Steuer Nr.) \$dt_footer_regon - HRB: \$dt_footer_krs - Amtsgericht: Neuss",
'LBL_HEADER_TEXT' => 'Header Text',
'LBL_DEFAULT_HEADER_TEXT' => "\$acc_name\n\$acc_billing_address_street\n\$acc_billing_address_postalcode \$acc_billing_address_city",
'LBL_TEMPLATE_TEXTS' => 'Template Texts',
// 'LBL_FOOTER_ACCOUNT' => 'Account',
// 'LBL_FOOTER_ADDRESS' => 'Address',
// 'LBL_FOOTER_PHONE' => 'Phone',
// 'LBL_FOOTER_FAX' => 'Fax',
// 'LBL_FOOTER_KRS' => 'KRS',
// 'LBL_FOOTER_NIP' => 'NIP',
// 'LBL_FOOTER_REGON' => 'REGON',
// 'LBL_FOOTER_CAPITAL' => 'Account capital',
// 'LBL_FOOTER_MANAGEMENT' => 'Management',
// 'LBL_FOOTER_SWIFT' => 'Swift',
// 'LBL_FOOTER_BANKNAME' => 'Bank name',
// 'LBL_FOOTER_VATID' => 'VAT-ID',
'LBL_DOCUMENT_NUMBER_FORMAT_ID' => 'Doc. number format',
'LBL_DOCUMENTS_PER_DAY_ID' => 'Number Of Documents',
'LBL_DOCUMENT_NUMBER_LETTER' => 'Doc. number letter',
'LBL_CORRECT_NUMBER_LETTER' => 'Correct number letter',
'LNK_NEW_ECMDOCUMENTTEMPLATES' => 'Create Document Tmplate',
'LNK_ECMDOCUMENTTEMPLATES_LIST' => 'Document Template list',
'LBL_ECMDOCUMENTTEMPLATE_PDF' => 'Show PDF',
'LBL_ECMDOCUMENTTEMPLATE_PDF_BUTTON_KEY' => 'Show PDF [Alt+P]',
'LBL_ECMDOCUMENTTEMPLATE_PDF_BUTTON_TITLE' => 'Show Work Report in PDF file.',
'LBL_DOCUMENTS_PER' => 'Documents Per',
'LBL_SHOW_HEADER_ON_ALL_PAGES' => 'Show Header On All Pages',
'LBL_SHOW_FOOTER_ON_ALL_PAGES' => 'Show Footer On All Pages',
'LBL_ECMLANGUAGE' => 'Language',
'LBL_CHANGE_ALL_OLD_RECORDS' => 'Change All Old Records',
);
?>

View File

@@ -0,0 +1,121 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*****************************************************************************
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/rpl.php. Software distributed under the
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
* either express or implied.
*
* You may:
* a) Use and distribute this code exactly as you received without payment or
* a royalty or other fee.
* b) Create extensions for this code, provided that you make the extensions
* publicly available and document your modifications clearly.
* c) Charge for a fee for warranty or support or for accepting liability
* obligations for your customers.
*
* You may NOT:
* a) Charge for the use of the original code or extensions, including in
* electronic distribution models, such as ASP (Application Service
* Provider).
* b) Charge for the original source code or your extensions other than a
* nominal fee to cover distribution costs where such distribution
* involves PHYSICAL media.
* c) Modify or delete any pre-existing copyright notices, change notices,
* or License text in the Licensed Software
* d) Assert any patent claims against the Licensor or Contributors, or
* which would in any way restrict the ability of any third party to use the
* Licensed Software.
*
* You must:
* a) Document any modifications you make to this code including the nature of
* the change, the authors of the change, and the date of the change.
* b) Make the source code for any extensions you deploy available via an
* Electronic Distribution Mechanism such as FTP or HTTP download.
* c) Notify the licensor of the availability of source code to your extensions
* and include instructions on how to acquire the source code and updates.
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
* reproduce, perform, modify, sublicense, and distribute your extensions.
*
* The Original Code is: CommuniCore
* Olavo Farias
* 2006-04-7 olavo.farias@gmail.com
*
* The Initial Developer of the Original Code is CommuniCore.
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
* All Rights Reserved.
********************************************************************************/
$mod_strings = array (
//added 26.02.2009
'LBL_TEMPLATE_FILES_DEFS' => 'Pliki Szablonów',
'LBL_PREVIEW_PDF' => 'Podglad PDF',
'LBL_MODULE_NAME' => 'Szablony Dokumentów',
'LBL_MODULE_TITLE' => 'Szablony Dokumentów: Strona Glówna',
'LBL_MODULE_ID' => 'Szablony Dokumentów',
'LBL_SEARCH_FORM_TITLE' => 'Wyszukaj',
'LBL_LIST_FORM_TITLE' => 'Lista Szablonów Dokumentów',
'LBL_NEW_FORM_TITLE' => 'Nowy Szablon Dokumentów',
'LBL_ID' => 'Id',
'LBL_NAME' => 'Nazwa',
'LBL_DATE_ENTERED' => 'Date Utworzenia',
'LBL_DATE_MODIFIED' => 'Date Modzfikacji',
'LBL_MODIFIED_BY' => 'Zmodyfikowane przez',
'LBL_ASSIGNED_TO' => 'Przypisane Do',
'LBL_CREATED_BY' => 'Utworzeone Przez',
'LBL_CREATED_BY_USER' => 'Utworzeone Przez',
'LBL_MODIFIED_BY_USER' => 'Zmodyfikowane Przez',
'LBL_ASSIGNED_TO_USER' => 'Przypisane Do',
'LBL_DELETED' => 'Usuniete',
'LBL_LOGO_PATH' => 'Logo',
'LBL_LOGO_NAME' => 'Nazwa Logo',
'LBL_LOGO_ID' => 'Logo ID',
'LBL_LOGO_NO_LOGO' => 'Braka logo obrazka',
'LBL_LOGO_INFO' => 'Format pliku obrazka moze byc .png lub .jpg',
'LBL_LOGO_PREVIEW' => 'Podglad Logo:',
'LBL_INFORMATIONS' => 'Informacje:',
'LBL_LOGO' => 'Dodaj Logo',
'LBL_ACCOUNT_NAME' => 'Nazwa Firmy',
'LBL_ACCOUNT_ID' => 'Nazwa Firmy',
// 'LBL_ACCOUNT_NUMBER' => 'Account number',
'LBL_FOOTER_TEXT' => 'Tekst Stopki',
'LBL_DEFAULT_FOOTER_TEXT' => "\$dt_account_name - Tel: \$dt_footer_phone - Fax: \$dt_footer_fax\nKonto: \$dt_footer_account - BLZ \$dt_footer_swift - Bank: \$dt_footer_bankname\nVAT-ID (UmSt. Nr.) \$dt_footer_vatid - TAX Nr. (Steuer Nr.) \$dt_footer_regon - HRB: \$dt_footer_krs - Amtsgericht: Neuss",
'LBL_HEADER_TEXT' => 'Tekst Naglówka',
'LBL_DEFAULT_HEADER_TEXT' => "\$acc_name\n\$acc_billing_address_street\n\$acc_billing_address_postalcode \$acc_billing_address_city",
'LBL_TEMPLATE_TEXTS' => 'Template Texts',
// 'LBL_FOOTER_ACCOUNT' => 'Account',
// 'LBL_FOOTER_ADDRESS' => 'Address',
// 'LBL_FOOTER_PHONE' => 'Phone',
// 'LBL_FOOTER_FAX' => 'Fax',
// 'LBL_FOOTER_KRS' => 'KRS',
// 'LBL_FOOTER_NIP' => 'NIP',
// 'LBL_FOOTER_REGON' => 'REGON',
// 'LBL_FOOTER_CAPITAL' => 'Account capital',
// 'LBL_FOOTER_MANAGEMENT' => 'Management',
// 'LBL_FOOTER_SWIFT' => 'Swift',
// 'LBL_FOOTER_BANKNAME' => 'Bank name',
// 'LBL_FOOTER_VATID' => 'VAT-ID',
'LBL_DOCUMENT_NUMBER_FORMAT_ID' => 'Format Numeru Dokumenu',
'LBL_DOCUMENTS_PER_DAY_ID' => 'Ilosc Dokumentów',
'LBL_DOCUMENT_NUMBER_LETTER' => 'Doc. number letter',
'LBL_CORRECT_NUMBER_LETTER' => 'Correct number letter',
'LNK_NEW_ECMDOCUMENTTEMPLATES' => 'Nowy Szablon',
'LNK_ECMDOCUMENTTEMPLATES_LIST' => 'Lista Szablonów',
'LBL_ECMDOCUMENTTEMPLATE_PDF' => 'Pokaz PDF',
'LBL_ECMDOCUMENTTEMPLATE_PDF_BUTTON_KEY' => 'Pokaz PDF [Alt+P]',
'LBL_ECMDOCUMENTTEMPLATE_PDF_BUTTON_TITLE' => 'Pokaz Raport z Pracy w Pliku PDF.',
'LBL_DOCUMENTS_PER' => 'Documents Per',
'LBL_SHOW_HEADER_ON_ALL_PAGES' => 'Pokaz Naglówek na Wszystkich Stronach',
'LBL_SHOW_FOOTER_ON_ALL_PAGES' => 'Pokaz Stopke na Wszystkich Stronach',
'LBL_ECMLANGUAGE' => 'Jezyk',
'LBL_CHANGE_ALL_OLD_RECORDS' => 'Zamien Wszystkie Stare Rekordy',
);
?>

View File

@@ -0,0 +1,28 @@
<?php
if(isset($_REQUEST['logo']) && $_REQUEST['logo'] != '') {
$file_name = 'modules/EcmDocumentTemplates/files/'.$_REQUEST['logo'];
if(file_exists($file_name)) {
$ext = strtolower(substr(strrchr($file_name, "."),1));
if($ext == "jpg" || $ext == "png") {
header('Content-type: image/jpg');
header('Content-length: '.filesize($file_name));
readfile($file_name);
}
}
}
?>

View File

@@ -0,0 +1,45 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$searchFields['EcmDocumentTemplates'] = array (
'name' => array( 'query_type'=>'default'),
'account_name'=> array('query_type'=>'default'),
'date_entered'=> array('query_type'=>'default'),
'account_number'=> array('query_type'=>'default'),
);
?>

View File

@@ -0,0 +1,115 @@
<?php
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
* *******************************************************************************/
global $app_list_strings;
$viewdefs['EcmDocumentTemplates']['DetailView'] = array (
'templateMeta' => array (
'form' => array (
'buttons' => array ('EDIT', 'DUPLICATE', 'DELETE',
array(
'customCode' => '<input name="ecmdocumenttemplate_pdf" id="ecmdocumenttemplate_pdf" title="{$MOD.LBL_ECMDOCUMENTTEMPLATE_PDF_BUTTON_TITLE}" accessKey="{$MOD.LBL_ECMDOCUMENTTEMPLATE_PDF_BUTTON_KEY}" class="button" onclick="EcmPreviewPDF(\'index.php?module=EcmDocumentTemplates&action=previewPDF&to_pdf=1&record={$fields.id.value}\',{literal}{{/literal}zoom:75,toolbar:1{literal}}{/literal});" type="button" value="{$MOD.LBL_ECMDOCUMENTTEMPLATE_PDF}">'
),
)
),
'maxColumns' => '2',
'widths' => array (
array ('label' => '10', 'field' => '30'),
array ('label' => '10', 'field' => '30')
),
'includes' => array(
array('file'=>'include/ECM/EcmPreviewPDF/EcmPreviewPDF.js'),
),
),
'panels' => array (
'LBL_INFORMATIONS'=> array(
array('name', 'assigned_user_name'),
array('document_number_format_id', 'account_name'),
array('documents_per',
array(
'name' => 'show_header_on_all_pages',
'tabIndex' => '1',
'customCode' => '<input tabindex="1" disabled="disabled" type="checkbox" id="show_header_on_all_pages" name="show_header_on_all_pages" value="{$fields.show_header_on_all_pages.value}" {if $fields.show_header_on_all_pages.value == 1}checked{/if}>'
),
),//'document_number_letter'),
array('documents_per_day_id',
array(
'name' => 'show_footer_on_all_pages',
'tabIndex' => '1',
'customCode' => '<input tabindex="1" disabled="disabled" type="checkbox" id="show_footer_on_all_pages" name="show_footer_on_all_pages" value="{$fields.show_footer_on_all_pages.value}" {if $fields.show_footer_on_all_pages.value == 1}checked{/if}>'
),
),//'correct_number_letter'),
array('', 'account_number'),
array('footer_account', 'footer_krs'),
array('footer_address', 'footer_regon'),
array('footer_phone', 'footer_capital'),
array('footer_fax', 'footer_management'),
array('footer_swift', 'footer_nip'),
array('footer_bankname', 'footer_vatid'),
array ('place_of_register', 'ecmlanguage'),
),
'LBL_LOGO' => array(
array(array('name'=>'logo_name','customCode'=>'{$fields.logo_name.value}'), array('name'=>'logo_path','label'=>'LBL_LOGO_PREVIEW','customCode'=>'{if $fields.logo_id.value != \'\'}<img src="index.php?module=EcmDocumentTemplates&action=logo&to_pdf=1&logo={$fields.logo_id.value}" />{/if}')),
),
'LBL_TEMPLATE_TEXTS' => array (
/*
array(
array(
'name' => 'show_header_on_all_pages',
'tabIndex' => '1',
'customCode' => '<input tabindex="1" disabled="disabled" type="checkbox" id="show_header_on_all_pages" name="show_header_on_all_pages" value="{$fields.show_header_on_all_pages.value}" {if $fields.show_header_on_all_pages.value == 1}checked{/if}>'
),
array(
'name' => 'show_footer_on_all_pages',
'tabIndex' => '1',
'customCode' => '<input tabindex="1" disabled="disabled" type="checkbox" id="show_footer_on_all_pages" name="show_footer_on_all_pages" value="{$fields.show_footer_on_all_pages.value}" {if $fields.show_footer_on_all_pages.value == 1}checked{/if}>'
),
),
*/
array('header_text'),
array('footer_text'),
),
'LBL_TEMPLATE_FILES_DEFS' => array(
array(
array('label'=>'LBL_TEMPLATE_FILES_DEFS','customCode'=>'{$TEMPLATE_FILES}'),
),
),
),
);
?>

View File

@@ -0,0 +1,161 @@
<?php
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
* *******************************************************************************/
global $sugar_config;
$path = 'modules/EcmDocumentTemplates/ModuleFieldsParser/ModuleFieldsParser.php';
if(file_exists($path)) {
require_once($path);
$mfp = new ModuleFieldsParser();
}
if((!isset($focus->footer_text) || $focus->footer_text == '') && (!isset($focus->name) || $focus->name == '') && (!isset($focus->id) || $focus->id == '')) $focus->footer_text = translate('LBL_DEFAULT_FOOTER_TEXT', 'EcmDocumentTemplates');
if((!isset($focus->header_text) || $focus->header_text == '') && (!isset($focus->name) || $focus->name == '') && (!isset($focus->id) || $focus->id == '')) $focus->header_text = translate('LBL_DEFAULT_HEADER_TEXT', 'EcmDocumentTemplates');
$viewdefs['EcmDocumentTemplates']['EditView'] = array (
'templateMeta' => array (
'form' => array (
'enctype'=>'multipart/form-data',
'buttons'=>array(
'SAVE',
'CANCEL',
),
),
'maxColumns' => '2',
'widths' => array (
array('label' => '10', 'field' => '30'),
array('label' => '10', 'field' => '30'),
),
'includes' => array(
array('file'=>'include/JSON.js'),
array('file'=>'include/javascript/quicksearch.js'),
array('file'=>'modules/EcmDocumentTemplates/formloader.js'),
array('file'=>'modules/EcmDocumentTemplates/EcmDocumentTemplates.js'),
),
),
'panels' => array (
'LBL_INFORMATIONS'=> array(
array (
'name',
'assigned_user_name'
),
array (
'document_number_format_id',
'account_name'
),
array (
array(
'name' => 'change_all_old_records',
'tabIndex' => '1',
'customCode' => '<input tabindex="1" type="checkbox" id="change_all_old_records" name="change_all_old_records" {if $fields.change_all_old_records.value == 1}checked{/if}>'
),
array(
'name' => 'show_header_on_all_pages',
'tabIndex' => '1',
'customCode' => '<input tabindex="1" type="checkbox" id="show_header_on_all_pages" name="show_header_on_all_pages" {if $fields.show_header_on_all_pages.value == 1}checked{/if}>'
),
//'document_number_letter'
),
array (
'documents_per',
array(
'name' => 'show_footer_on_all_pages',
'tabIndex' => '1',
'customCode' => '<input tabindex="1" type="checkbox" id="show_footer_on_all_pages" name="show_footer_on_all_pages" {if $fields.show_footer_on_all_pages.value == 1}checked{/if}>'
),
//'correct_number_letter'
),
array ('place_of_register', 'ecmlanguage'),
array (
'',
'account_number'
),
array (
'footer_account',
'footer_krs',
),
array (
'footer_address',
'footer_regon'
),
array (
'footer_phone',
'footer_capital'
),
array (
'footer_fax',
'footer_management'
),
array (
'footer_swift',
'footer_nip'
),
array (
'footer_bankname',
'footer_vatid'
),
),
'LBL_LOGO' => array(
array (
array(
'name' => 'logo_name',
'label' => 'LBL_LOGO_PATH',
'tabIndex' => 'l',
'customCode' => '<input type="file" id="logo_name" name="logo_name" value="" onChange="{literal} var name=this.value.toLowerCase(); if(name.search(/.jpg/)==-1 && name.search(/.png/)==-1) { this.value=\'\'; }{/literal}" /><br>{$MOD.LBL_LOGO_INFO}',
),
array(
'label' => 'LBL_LOGO_PREVIEW',
'customCode' => '{if $fields.logo_id.value != ""}<div id="logoDiv"><input type="hidden" name="old_logo_name" id="old_logo_name" value="{$fields.logo_name.value}" /><img src="index.php?module=EcmDocumentTemplates&action=logo&to_pdf=1&logo={$fields.logo_id.value}" /><br>({$fields.logo_name.value})&nbsp;&nbsp;<a href="javascript:deleteLogo();">{$APP.LBL_DELETE_BUTTON_LABEL}</a></div>{/if}'
),
),
),
'LBL_TEMPLATE_TEXTS' => array (
// array(array('label' => 'LBL_HEADER_TEXT','customCode' => $mfp->getFormHTML(true, 'header')),),
array(array('label' => 'LBL_HEADER_TEXT','tabIndex'=>'f', 'customCode'=>'<textarea id="header_text" name="header_text" rows="5" style="width:100%;">{$fields.header_text.value}</textarea>')),
// array(array('label' => 'LBL_FOOTER_TEXT','customCode' => $mfp->getFormHTML(true, 'footer')),),
array(array('label' => 'LBL_FOOTER_TEXT','tabIndex'=>'f', 'customCode'=>'<textarea id="footer_text" name="footer_text" rows="5" style="width:100%;">{$fields.footer_text.value}</textarea>')),
),
'LBL_TEMPLATE_FILES_DEFS' => array(
array(
array('customCode'=>'{$TEMPLATE_FILES}'),
),
),
),
);
?>

View File

@@ -0,0 +1,75 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/**
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
*/
$listViewDefs['EcmDocumentTemplates'] = array(
'NAME' => array(
'width' => '35',
'label' => 'LBL_NAME',
'link' => true,
'default' => true,
'sortable' => false),
'ACCOUNT_NAME' => array(
'width' => '35',
'label' => 'LBL_ACCOUNT_NAME',
'link' => true,
'default' => true),
'DATE_ENTERED' => array(
'width' => '15',
'label' => 'LBL_DATE_ENTERED',
'default' => true,
),
'MODIFIED_BY_NAME' => array(
'width' => '10',
'label' => 'LBL_MODIFIED_USER',
'module' => 'Users',
'id' => 'USERS_ID',
'default' => false,
'sortable' => false,
'related_fields' => array('modified_user_id')
),
);
?>

View File

@@ -0,0 +1,61 @@
<?php
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$searchdefs['EcmDocumentTemplates'] = array(
'templateMeta' => array (
'maxColumns' => '3',
'widths' => array (
'label' => '10',
'field' => '30'
),
),
'layout' => array(
'basic_search' => array (
'name',
'account_name',
'date_entered',
),
'advanced_search' => array (
'name',
'account_name',
'date_entered',
'account_number',
),
),
);
?>

View File

@@ -0,0 +1,64 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*****************************************************************************
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/rpl.php. Software distributed under the
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
* either express or implied.
*
* You may:
* a) Use and distribute this code exactly as you received without payment or
* a royalty or other fee.
* b) Create extensions for this code, provided that you make the extensions
* publicly available and document your modifications clearly.
* c) Charge for a fee for warranty or support or for accepting liability
* obligations for your customers.
*
* You may NOT:
* a) Charge for the use of the original code or extensions, including in
* electronic distribution models, such as ASP (Application Service
* Provider).
* b) Charge for the original source code or your extensions other than a
* nominal fee to cover distribution costs where such distribution
* involves PHYSICAL media.
* c) Modify or delete any pre-existing copyright notices, change notices,
* or License text in the Licensed Software
* d) Assert any patent claims against the Licensor or Contributors, or
* which would in any way restrict the ability of any third party to use the
* Licensed Software.
*
* You must:
* a) Document any modifications you make to this code including the nature of
* the change, the authors of the change, and the date of the change.
* b) Make the source code for any extensions you deploy available via an
* Electronic Distribution Mechanism such as FTP or HTTP download.
* c) Notify the licensor of the availability of source code to your extensions
* and include instructions on how to acquire the source code and updates.
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
* reproduce, perform, modify, sublicense, and distribute your extensions.
*
* The Original Code is: CommuniCore
* Olavo Farias
* 2006-04-7 olavo.farias@gmail.com
*
* The Initial Developer of the Original Code is CommuniCore.
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
* All Rights Reserved.
********************************************************************************/
$GLOBALS['studioDefs']['EcmDocumentTemplates'] = array(
'LBL_DETAILVIEW'=>array(
'template' => 'xtpl',
'template_file' => 'modules/EcmDocumentTemplates/DetailView.html',
'php_file' => 'modules/EcmDocumentTemplates/DetailView.php',
'type' => 'DetailView',
),
'LBL_EDITVIEW'=>array(
'template' => 'xtpl',
'template_file' => 'modules/EcmDocumentTemplates/EditView.html',
'php_file' => 'modules/EcmDocumentTemplates/EditView.php',
'type' => 'EditView',
),
);

View File

@@ -0,0 +1,47 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$searchFields['Documents'] =
array (
'document_name' => array( 'query_type'=>'default'),
'category_id'=> array('query_type'=>'default', 'options' => 'document_category_dom', 'template_var' => 'CATEGORY_OPTIONS'),
'subcategory_id'=> array('query_type'=>'default', 'options' => 'document_subcategory_dom', 'template_var' => 'SUBCATEGORY_OPTIONS'),
'active_date'=> array('query_type'=>'default'),
'exp_date'=> array('query_type'=>'default'),
);
?>

View File

@@ -0,0 +1,121 @@
<?php
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$viewdefs['Documents']['EditView'] = array(
'templateMeta' => array('form' => array('enctype'=>'multipart/form-data',
'hidden'=>array('<input type="hidden" name="old_id" value="{$fields.document_revision_id.value}">',
'<input type="hidden" name="parent_id" value="{$smarty.request.parent_id}">',
'<input type="hidden" name="parent_type" value="{$smarty.request.parent_type}">',)),
'maxColumns' => '2',
'widths' => array(
array('label' => '10', 'field' => '30'),
array('label' => '10', 'field' => '30')
),
'javascript' => '<script type="text/javascript" src="include/javascript/popup_parent_helper.js?s={$SUGAR_VERSION}&c={$JS_CUSTOM_VERSION}"></script>
<script type="text/javascript" src="include/jsolait/init.js?s={$SUGAR_VERSION}&c={$JS_CUSTOM_VERSION}"></script>
<script type="text/javascript" src="include/jsolait/lib/urllib.js?s={$SUGAR_VERSION}&c={$JS_CUSTOM_VERSION}"></script>
<script type="text/javascript" src="include/javascript/jsclass_base.js"></script>
<script type="text/javascript" src="include/javascript/jsclass_async.js"></script>
<script type="text/javascript" src="modules/Documents/documents.js?s={$SUGAR_VERSION}&c={$JS_CUSTOM_VERSION}"></script>',
),
'panels' =>array (
'default' =>
array (
array (
'document_name',
),
array (
array('name'=>'uploadfile',
'customCode' => '<input type="hidden" name="escaped_document_name"><input name="uploadfile" type="{$FILE_OR_HIDDEN}" size="30" maxlength="" onchange="setvalue(this);" value="{$fields.filename.value}">{$fields.filename.value}',
'displayParams'=>array('required'=>true),
),
array('name'=>'revision',
'customCode' => '<input name="revision" type="text" value="{$fields.revision.value}" {$DISABLED}>'
),
),
array (
array (
'name' => 'is_template',
'label' => 'LBL_DET_IS_TEMPLATE',
),
array (
'name' => 'template_type',
'label' => 'LBL_DET_TEMPLATE_TYPE',
),
),
array (
'category_id',
'subcategory_id',
),
array (
'status_id',
),
array (
array('name'=>'active_date','displayParams'=>array('required'=>true)),
'exp_date',
),
array (
array('name'=>'related_doc_name',
'customCode' => '<input name="related_document_name" type="text" size="30" maxlength="255" value="{$RELATED_DOCUMENT_NAME}" readonly>' .
'<input name="related_doc_id" type="hidden" value="{$fields.related_doc_id.value}"/>&nbsp;' .
'<input title="{$APP.LBL_SELECT_BUTTON_TITLE}" accessKey="{$APP.LBL_SELECT_BUTTON_KEY}" type="{$RELATED_DOCUMENT_BUTTON_AVAILABILITY}" class="button" value="{$APP.LBL_SELECT_BUTTON_LABEL}" name="btn2" onclick=\'open_popup("Documents", 600, 400, "", true, false, {$encoded_document_popup_request_data}, "single", true);\'/>'),
array('name'=>'related_doc_rev_number',
'customCode' => '<select name="related_doc_rev_id" id="related_doc_rev_id" {$RELATED_DOCUMENT_REVISION_DISABLED}>{$RELATED_DOCUMENT_REVISION_OPTIONS}</select>',
),
),
array (
array('name'=>'description', 'displayParams'=>array('rows'=>10, 'cols'=>120)),
),
),
)
);
?>

View File

@@ -0,0 +1,57 @@
<?php
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$searchdefs['Documents'] = array(
'templateMeta' => array('maxColumns' => '3',
'widths' => array('label' => '10', 'field' => '30'),
),
'layout' => array(
'basic_search' => array(
'document_name',
'category_id',
'subcategory_id',
),
'advanced_search' => array(
'document_name',
'category_id',
'subcategory_id',
'active_date',
'exp_date',
),
),
);
?>

View File

@@ -0,0 +1,77 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
global $mod_strings;
$viewdefs['Documents']['SideQuickCreate'] = array(
'templateMeta' => array('form'=>array(
'enctype'=>'multipart/form-data',
'buttons'=>array('SAVE'),
'button_location'=>'bottom',
'headerTpl'=>'include/EditView/header.tpl',
'footerTpl'=>'include/EditView/footer.tpl',
),
'maxColumns' => '1',
'panelClass'=>'none',
'labelsOnTop'=>true,
'widths' => array(
array('label' => '10', 'field' => '30'),
),
),
'panels' =>array (
'DEFAULT' =>
array (
array (
array('name'=>'document_name', 'displayParams'=>array('size'=>20, 'required'=>true)),
),
array (
array('name'=>'uploadfile', 'displayParams'=>array('size'=>11, 'required'=>true)),
),
array (
array('name'=>'revision', 'displayParams'=>array('size'=>11, 'required'=>true)),
),
array (
array('name'=>'active_date', 'displayParams'=>array('size'=>11, 'required'=>true)),
),
),
)
);
?>

View File

@@ -0,0 +1,65 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/**
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
*/
$GLOBALS['studioDefs']['Documents'] = array(
'LBL_DETAILVIEW'=>array(
'template'=>'xtpl',
'template_file'=>'modules/Documents/DetailView.html',
'php_file'=>'modules/Documents/DetailView.php',
'type'=>'DetailView',
),
'LBL_EDITVIEW'=>array(
'template'=>'xtpl',
'template_file'=>'modules/Documents/EditView.html',
'php_file'=>'modules/Documents/EditView.php',
'type'=>'EditView',
),
'LBL_LISTVIEW'=>array(
'template'=>'listview',
'meta_file'=>'modules/Documents/listviewdefs.php',
'type'=>'ListView',
),
'LBL_SEARCHFORM'=>array(
'template'=>'xtpl',
'template_file'=>'modules/Documents/SearchForm.html',
'php_file'=>'modules/Documents/ListView.php',
'type'=>'SearchForm',
),
);

View File

@@ -0,0 +1,70 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/**
* Layout definition for Quotes
*
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
*/
$layout_defs['Documents'] = array(
// list of what Subpanels to show in the DetailView
'subpanel_setup' => array(
'therevisions' => array(
'order' => 10,
'sort_order' => 'desc',
'sort_by' => 'revision',
'module' => 'DocumentRevisions',
'subpanel_name' => 'default',
'title_key' => 'LBL_DOC_REV_HEADER',
'get_subpanel_data' => 'revisions',
'fill_in_additional_fields'=>true,
),
),
);
?>

View File

@@ -0,0 +1,90 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/**
* Subpanel Layout definition for Bugs
*
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
*/
// $Id$
$subpanel_layout = array(
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateButton'),
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'Documents','field_to_name_array'=>array('document_revision_id'=>'REL_ATTRIBUTE_document_revision_id')),
),
'where' => '',
'list_fields'=> array(
'document_name'=> array(
'name' => 'document_name',
'vname' => 'LBL_LIST_DOCUMENT_NAME',
'widget_class' => 'SubPanelDetailViewLink',
'width' => '30%',
),
'is_template'=>array(
'name' => 'is_template',
'vname' => 'LBL_LIST_IS_TEMPLATE',
'width' => '5%',
'widget_type'=>'checkbox',
),
'template_type'=>array(
'name' => 'template_types',
'vname' => 'LBL_LIST_TEMPLATE_TYPE',
'width' => '15%',
),
'latest_revision'=>array(
'name' => 'latest_revision',
'vname' => 'LBL_LATEST_REVISION',
'width' => '10%',
'sortable' => false
),
'edit_button'=>array(
'widget_class' => 'SubPanelEditButton',
'module' => 'Documents',
'width' => '5%',
),
'remove_button'=>array(
'widget_class' => 'SubPanelRemoveButton',
'module' => 'Documents',
'width' => '5%',
),
'document_revision_id'=>array(
'usage'=>'query_only'
),
),
);
?>

View File

@@ -0,0 +1,109 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/**
* Subpanel Layout definition for Bugs
*
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
*/
$subpanel_layout = array(
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateButton'),
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'Documents','field_to_name_array'=>array('document_revision_id'=>'REL_ATTRIBUTE_document_revision_id')),
),
'where' => '',
'list_fields'=> array(
'object_image'=>array(
'widget_class' => 'SubPanelIcon',
'width' => '2%',
'image2'=>'attachment',
'image2_url_field'=>array('id_field'=>'selected_revision_id','filename_field'=>'selected_revision_filename'),
'attachment_image_only'=>true,
),
'document_name'=> array(
'name' => 'document_name',
'vname' => 'LBL_LIST_DOCUMENT_NAME',
'widget_class' => 'SubPanelDetailViewLink',
'width' => '30%',
),
'is_template'=>array(
'name' => 'is_template',
'vname' => 'LBL_LIST_IS_TEMPLATE',
'width' => '5%',
'widget_type'=>'checkbox',
),
'template_type'=>array(
'name' => 'template_types',
'vname' => 'LBL_LIST_TEMPLATE_TYPE',
'width' => '15%',
),
'selected_revision_name'=>array(
'name' => 'selected_revision_name',
'vname' => 'LBL_LIST_SELECTED_REVISION',
'width' => '10%',
),
'latest_revision_name'=>array(
'name' => 'latest_revision_name',
'vname' => 'LBL_LIST_LATEST_REVISION',
'width' => '10%',
),
'get_latest'=>array(
'widget_class' => 'SubPanelGetLatestButton',
'module' => 'Documents',
'width' => '5%',
),
'load_signed'=>array(
'widget_class' => 'SubPanelLoadSignedButton',
'module' => 'Documents',
'width' => '5%',
),
'edit_button'=>array(
'widget_class' => 'SubPanelEditButton',
'module' => 'Documents',
'width' => '5%',
),
'remove_button'=>array(
'widget_class' => 'SubPanelRemoveButton',
'module' => 'Documents',
'width' => '5%',
),
),
);
?>

View File

@@ -0,0 +1,8 @@
<?php
if(isset($_REQUEST['record']) && $_REQUEST['record'] != '') {
require_once("modules/EcmDocumentTemplates/EcmDocumentTemplate.php");
$edt = new EcmDocumentTemplate();
$method = (isset($_REQUEST['method']) && $_REQUEST['method'] != '') ? $_REQUEST['record'] : 'I';
$edt->getPDF($_REQUEST['record']);
}
?>

View File

@@ -0,0 +1,77 @@
<?
$this->SetFont('arialpl', '', 8);
$this->SetY($this->fh-15);
$this->SetDrawColor(0,0,0);
$this->SetFillColor(255,255,255);
$this->Rect(0, $this->getBreakLine(), $this->fw, $this->bMargin+1, "F");
$this->SetDrawColor(0,0,0);
$this->Cell(0, 10, $this->PageNo().'/{nb}');
$this->Ln(5);
$this->AliasNbPages();
$this->SetLineWidth(0);
$this->SetDrawColor(0,0,0);
$this->Line($this->lMargin,$this->getBreakLine()-16,$this->fw-$this->rMargin,$this->fh-$this->bMargin-16+1);
if($this->edt->show_footer_on_all_pages == 0 && $this->page > 1) {
return;
}
$this->SetXY($this->lMargin,$this->fh-$this->bMargin+3-16);
$this->SetFont('arialpl','','7');
$this->Cell(110,4,$this->edt->footer_account);
$this->SetFont('arialpl','B','7');
$this->Cell(20,4,'KRS: ');
$this->SetFont('arialpl','','7');
$this->Cell(45,4,$this->edt->footer_krs,0,0,'L');
$this->Ln();
$this->SetFont('arialpl','','7');
$this->Cell(110,4,$this->edt->footer_address);
$this->SetFont('arialpl','B','7');
$this->Cell(20,4,'NIP: ');
$this->SetFont('arialpl','','7');
$this->Cell(45,4,$this->edt->footer_nip,0,0,'L');
$this->Ln();
$this->SetFont('arialpl','','7');
$this->Cell(110,4,$this->edt->footer_phone);
$this->SetFont('arialpl','B','7');
$this->Cell(20,4,'REGON: ');
$this->SetFont('arialpl','','7');
$this->Cell(45,4,$this->edt->footer_regon,0,0,'L');
$this->Ln();
$this->SetFont('arialpl','','7');
$this->Cell(110,4,$this->edt->footer_fax);
$this->SetFont('arialpl','B','7');
$this->Cell(20,4,'Bank: ');
$this->SetFont('arialpl','','7');
$this->Cell(45,4,$this->edt->footer_bankname,0,0,'L');
$this->Ln();
$this->SetFont('arialpl','','7');
$this->Cell(110,4,'www.e5.pl');
$this->SetFont('arialpl','B','7');
$this->Cell(20,4,'Numer konta: ');
$this->SetFont('arialpl','','7');
$this->Cell(45,4,$this->edt->account_number,0,0,'L');
$this->Ln();
$this->SetFont('arialpl','','7');
$this->Cell(110,4,'');
$this->SetFont('arialpl','B','7');
$this->Cell(20,4,'Numer GIOS: ');
$this->SetFont('arialpl','','7');
$this->Cell(45,4,"E0006254W",0,0,'L');
$this->Ln();
$this->SetFont("arialpl","B",8);
$this->SetXY(40,$this->GetY()+1);
$r=mysql_fetch_array(mysql_query("select document_no from ".strtolower($_REQUEST['module'])." where id='".$_REQUEST['record']."'"));
$this->Cell(45,4,$r['document_no'],0,0,'L');
?>

View File

@@ -0,0 +1,17 @@
<?
if(!$this->blnShowHeader) return;
if($this->edt->show_header_on_all_pages == 0 && $this->page > 1) return;
//logo
if(isset($this->edt->logo_path) && $this->edt->logo_path != '')
if(file_exists($this->edt->logo_path))
$this->Image($this->edt->logo_path,$this->rMargin+132,$this->tMargin,0,18.3);
//from address
$this->SetFont('arialpl', '', 8);
$this->SetXY($this->lMargin,$this->tMargin+3);
$this->MultiCell(100,3.15,$this->edt->header_text,0,'L');
$this->SetY(32);
?>

View File

@@ -0,0 +1,20 @@
<?
error_reporting(0);
if(!$this->blnShowHeader) return;
if($this->edt->show_header_on_all_pages == 0 && $this->page > 1) return;
//from address
$this->SetFont('arialpl', '', 8);
$this->SetXY($this->lMargin,$this->tMargin+2);
//$this->MultiCell(100,3.15,$this->edt->header_text.'
//'.translate('LBL_PDF_NIP',$module_t).': '.$nip,0,'L');
//$this->MultiCell(100,4,"Wystawca:\n".$this->edt->header_text,0,'L');
//logo
//$this->MultiCell(80,7,$this->edt->logo_path."mmm",0,'C');
if(isset($this->edt->logo_path) && $this->edt->logo_path != '' && file_exists($this->edt->logo_path)){
$this->Image($this->edt->logo_path,$this->lMargin,$this->tMargin+5,0,12.3);
}
?>

View File

@@ -0,0 +1,38 @@
<?
//payment conditions
if(!empty($this->ecmpaymentcondition_text)) {
$pdf->Ln(4);
$pdf->SetFont('arialpl','','8');
$pdf->MultiCell(0,4,$this->ecmpaymentcondition_text,0,'L');
}
//delivery conditions
if(!empty($this->ecmdeliverycondition_text)) {
$pdf->Ln(4);
$pdf->SetFont('arialpl','','8');
$pdf->MultiCell(0,4,$this->ecmdeliverycondition_text,0,'L');
}
//footer text
$pdf->Ln(10);
$pdf->SetFont('arialpl','','10');
$pdf->MultiCell(0,4,$this->footer_text,0,'J');
//header text
/*
$pdf->Ln(10);
$pdf->SetFont('arialpl','B','10');
$pdf->MultiCell(0,4,$this->ads_text,0,'J');
*/
?>

View File

@@ -0,0 +1,235 @@
<?
$pdf->Ln(2);
//to address
$address = $this->parent_name;
if($this->parent_contact_name) {
$address .= "\n".$this->parent_contact_name;
if($this->parent_contact_title) $address .= "\n".$this->parent_contact_title;
}
if($this->parent_address_street) $address .= "\n".$this->parent_address_street;
if($this->parent_address_postalcode) $address .= "\n".$this->parent_address_postalcode;
if($this->parent_address_city) $address .= " ".$this->parent_address_city;
if($this->to_vatid) $address .= "\n\n".$mod_strings['LBL_PDF_VATID']." ".$this->to_vatid;
$pdf->SetFont('arialpl', '', 10);
$pdf->Ln(2);
$current = $pdf->GetY();
//$pdf->MultiCell(0,4,$address,0,'L');
$current2 = $pdf->GetY();
//$current = $pdf->GetY();
//$pdf->Ln(7);
$pdf->SetXY($pdf->fw-$pdf->rMargin-30,$current);
$table = array();
$table [0]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_NUMBER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
$table [1]['data'] = array('width' => 30, 'value' => $this->document_no, 'border' => 0, 'overflow' => 1, 'align' => 'L');
$table [2]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_DATE_REGISTER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
$table [3]['data'] = array('width' => 30, 'value' => $this->register_date, 'border' => 0, 'overflow' => 1, 'align' => 'L');
$next = 4;
if(isset($this->validtill_date) && $this->validtill_date != '') {
$table [$next++]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_VALIDTILL_DATE'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
$table [$next++]['data'] = array('width' => 30, 'value' => $this->validtill_date, 'border' => 0, 'overflow' => 1, 'align' => 'L');
}
if($this->correct_id){
$table [$next++]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_CORRECT_TO'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
$r=mysql_fetch_array(mysql_query("select document_no from ecmstockdocins where id='".$this->correct_id."'"));
$table [$next++]['data'] = array('width' => 30, 'value' => $r['document_no'], 'border' => 0, 'overflow' => 1, 'align' => 'L');
}
$table [$next++]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_OWNER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
$table [$next++]['data'] = array('width' => 30, 'value' => $this->setUser()->full_name, 'border' => 0, 'overflow' => 1, 'align' => 'L');
$pdf->DrawTable($table, null, 0.5, 0.5, 3);
$pdf->SetY($current2);
$pdf->Ln(12);
$pdf->SetFont('arialpl','','22');
$pdf->SetY(45);
$pdf->SetX(65);
if($this->correct_id) $pdf->MultiCell(90,10,$mod_strings['LBL_PDF_DOCUMENT_NAME_CORRECT'],70,'C');
else $pdf->MultiCell(90,10,$mod_strings['LBL_PDF_DOCUMENT_NAME'],70,'C');
$yaftername=$pdf->GetY()+7;
if($this->correct_id)$yaftername+=7;
if(isset($this->validtill_date) && $this->validtill_date != '') $pdf->Ln(9);
$this->loadParser();
$this->header_text = $this->template->mfp->parseText($this->header_text);
$this->footer_text = $this->template->mfp->parseText($this->footer_text);
$this->ads_text = $this->template->mfp->parseText($this->ads_text);
//header text
$pdf->Ln(20);
$pdf->SetFont('arialpl','B','10');
$pdf->SetY(36);
$pdf->MultiCell(0,4,$mod_strings['LBL_PDF_QUOTE_FOR'],0,'J');
$pdf->Ln(1);
$pdf->SetFont('arialpl','','10');
$pdf->MultiCell(0,4,$address,0,'J');
$pdf->Ln(20);
$pdf->SetY($yaftername);
global $mod_strings;
if(!isset($this->position_list) || !is_array($this->position_list))
$this->position_list = $this->getPositionList(true);
$calc = $this->calculate($this->position_list,true);
$this->position_list = $this->formatPositions($this->position_list);
$calc['total'] .= ' '.$this->currency_symbol;
$calc['subtotal'] .= ' '.$this->currency_symbol;
if($calc['discount']) {
$calc['total2'] .= ' '.$this->currency_symbol;
$calc['discount']['value'] .= ' '.$this->currency_symbol;
}
if(isset($calc['vats']) && is_array($calc['vats']) && count($calc['vats']) > 0)
foreach($calc['vats'] as $key => $value) $calc['vats'][$key] .= ' '.$this->currency_symbol;
$name_w = 42;
$image_w = 10;
$recipient_code_w = 10;
if($this->show_images_on_offers){
$name_w -= $image_w;
}
if($this->show_recipient_code){
$name_w -= $recipient_code_w;
}
if($calc['draw_discount']){
$name_w -= 8;
}
if($calc['draw_vat']){
$name_w -= 8;
}
$table = array();
if($this->show_images_on_offers)
$table [0]['image'] = array('width' => $image_w, 'value' => $mod_strings['LBL_PDF_LIST_IMAGE'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'R');
$table [0]['position'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_POSITION'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
$table [0]['code'] = array('width' => 12, 'value' => $mod_strings['LBL_PDF_LIST_CODE'],'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
if($this->show_recipient_code)
$table [0]['recipient_code'] = array('width' => $recipient_code_w, 'value' => $mod_strings['LBL_PDF_LIST_RECIPIENT_CODE'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
//$table [0]['unit'] = array('width' => 10, 'value' => $mod_strings['LBL_PDF_LIST_UNIT'],'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
$table [0]['description'] = array('width' => $name_w, 'value' => $mod_strings['LBL_PDF_LIST_DESCRIPTION'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
$table [0]['quantity'] = array('width' => 8, 'value' => $mod_strings['LBL_PDF_LIST_QUANTITY'],'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
$table [0]['unit'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_UNIT'], 'border' => 0,'background' => array(233,233,233), 'overflow' => 1, 'align' => 'C');
$table [0]['unit_price'] = array('width' => 14, 'value' => $mod_strings['LBL_PDF_LIST_PRICE'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
if($calc['draw_discount']) $table [0]['discount'] = array('width' => 8, 'value' => $mod_strings['LBL_PDF_LIST_DISCOUNT'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'R');
if($calc['draw_vat']) $table [0]['vat_id'] = array('width' => 8, 'value' => $mod_strings['LBL_PDF_LIST_VAT'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'R');
$table [0]['total'] = array('width' => 14, 'value' => "Suma netto", 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'R');
$i = 1;
$lv=return_app_list_strings_language($this->ecmlanguage);
if($this->position_list != '')
foreach($this->position_list as $p) {
if($this->show_images_on_offers){
if(file_exists($this->getProductImage($p['id']))){$table [$i]['image'] = array('width' => $image_w, 'value' => '', 'border' => 0, 'align' => 'R', 'image_path' => $this->getProductImage($p['id']));
//$iarr[]=$this->getProductImage($p['id']);
}
else $table [$i]['image'] = array('width' => $image_w, 'value' => '', 'border' => 0, 'align' => 'R');
}
$table [$i]['position'] = array('width' => 5, 'value' => $i, 'border' => 0, 'align' => 'C', );
$table [$i]['code'] = array('width' => 12, 'value' => $p['code'], 'border' => 0, 'align' => 'C', );
if($this->show_recipient_code)
$table [$i]['recipient_code'] = array('width' => $recipient_code_w, 'value' => $p['recipient_code'], 'border' => 0, 'align' => 'C', );
//$table [$i]['unit'] = array('width' => 10, 'value' => $p['unit_id'], 'border' => 0, 'align' => 'C', );
/*
if($this->ecmlanguage=="en_us"){
$r=mysql_fetch_array(mysql_query("select short_description from ecmproduct_language_en_view where ecmproduct_id='".$p['id']."'"));
$dname=$r['short_description'];
}
elseif($this->ecmlanguage=="ge_ge"){
$r=mysql_fetch_array(mysql_query("select short_description from ecmproduct_language_de_view where ecmproduct_id='".$p['id']."'"));
$dname=$r['short_description'];
}
else $dname=$p['name'];
*/
$table [$i]['description'] = array('width' => $name_w, 'value' => htmlspecialchars_decode($p['name']), 'border' => 0, 'align' => 'L', );
$table [$i]['quantity'] = array('width' => 8, 'value' => $p['quantity'], 'border' => 0, 'align' => 'C', );
$table [$i]['unit'] = array('width' => 5, 'value' => $lv['ecmproducts_unit_dom'][$p['unit_id']], 'border' => 0, 'align' => 'C', 'font-size' => 7 );
$table [$i]['unit_price'] = array('width' => 14, 'value' => $p['price'], 'border' => 0, 'align' => 'C', );
if($calc['draw_discount']) $table [$i]['discount'] = array('width' => 8, 'value' => $p['discount'], 'border' => 0, 'align' => 'R', );
if($calc['draw_vat']) $table [$i]['vat_id'] = array('width' => 8, 'value' => $p['vat_name'], 'border' => 0, 'align' => 'R', );
$table [$i]['total'] = array('width' => 14, 'value' => $p['total'], 'border' => 0, 'align' => 'R', );
$i++;
}
$starttab=$pdf->GetY()+10;
$pdf->DrawTable($table,array(0));
$endtab=$pdf->GetY();
//for($n=0;$n<$i;$n++){
//if(file_exists($iarr[$n]))$pdf->Image($iarr[$n],$pdf->GetX()+1,$starttab+$n*18+1,15,0);
//}
$pdf->SetY($endtab);
//total, vat, subtotal
$pdf->Ln(4);
$pr = ($pdf->fw-$pdf->lMargin-$pdf->rMargin)/100;
//$pdf->SetX($pdf->fw-$pdf->rMargin-$pr*34);
$table = array();
if($calc['vats']) {
$table [] = array(
'subtotal1' => array('width' => 66, 'value' => "Suma netto", 'background' => array(255,255,255), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 9),
'subtotal2' => array('width' => 34, 'value' => $calc['subtotal'], 'border' => 0, 'overflow' => 1, 'align' => 'R', 'font-size' => 9), );
foreach($calc['vats'] as $key => $value){
$r=mysql_fetch_array(mysql_query("select name from ecmvats where id='".$key."'"));
$vvn=$r['name'];
$table [] = array(
'vat1' => array('width' => 66, 'value' => $mod_strings['LBL_PDF_VAT'].' ('.$vvn.')', 'background' => array(255,255,255), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 9),
'vat2' => array('width' => 34, 'value' => $value, 'border' => 0, 'overflow' => 1, 'align' => 'R', 'font-size' => 9), );
}
}
if(isset($calc['discount'])) {
$table [] = array(
'total21' => array('width' => 66, 'value' => $mod_strings['LBL_PDF_TOTAL'], 'background' => array(255,255,255), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 9, 'font-style' => 'b'),
'total22' => array('width' => 34, 'value' => $calc['total2'], 'border' => 0, 'overflow' => 1, 'align' => 'R' , 'font-size' => 9), );
$table [] = array(
'discount1' => array('width' => 66, 'value' => $mod_strings['LBL_PDF_DISCOUNT'].' '.$calc['discount']['procent'], 'background' => array(255,255,255), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 9, 'font-style' => 'b'),
'discount2' => array('width' => 34, 'value' => $calc['discount']['value'], 'border' => 0, 'overflow' => 1, 'align' => 'R' , 'font-size' => 9), );
}
$table [] = array(
'total1' => array('width' => 66, 'value' => "Suma brutto", 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 9, 'font-style' => 'b'),
'total2' => array('width' => 34, 'value' => $calc['total'], 'border' => 0, 'background' => array(233,233,233), 'overflow' => 1, 'align' => 'R' , 'font-size' => 9, 'font-style' => 'b'), );
$pdf->DrawTable($table);
?>

View File

@@ -0,0 +1,191 @@
<?
global $app_list_strings;
$address = str_replace("&lt;","<",str_replace("&gt;",">",$this->parent_name));
if($this->parent_contact_name) {
$address .= "\n".$this->parent_contact_name;
if($this->parent_contact_title) {
$address .= "\n".$this->parent_contact_title;
}
$personplus=5;
}
else $personplus=0;
if($this->parent_address_street) $address .= "\n".str_replace("\n","",$this->parent_address_street);
if($this->parent_address_postalcode) $address .= "\n".$this->parent_address_postalcode;
if($this->parent_address_city) $address .= " ".$this->parent_address_city;
if($this->to_nip) $address .= "\n".$mod_strings['LBL_PDF_NIP'].": ".$this->to_nip;
elseif(!$this->to_nip && $this->to_vatid) $address .= "\n".$mod_strings['LBL_PDF_NIP'].": ".$this->to_vatid;
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select iln from accounts where id='".$this->parent_id."'"));
if($r['iln'])$address .= "\nILN: ".$r['iln'];
//to address
$old_x=$pdf->GetX();
$old_y=$pdf->GetY();
$pdf->SetXY(25,37);
$pdf->SetFont('arialpl', 'B', 8);
$pdf->Cell(35,1,"WYSTAWCA:",0,0,'L',1);
$pdf->Ln(3);
$pdf->SetX(25);
$pdf->SetFont('arialpl', '', 8);
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select vatid from accounts where id='".$pdf->edt->account_id."'"));
if($r['vatid'])$pdf->edt->header_text .= "\nNip: ".$r['vatid'];
if($r['iln'])$pdf->edt->header_text .= "\nILN: ".$r['iln'];
$pdf->MultiCell(60,4,$pdf->edt->header_text,0,'L');
$pdf->SetXY(81,37);
$pdf->SetFont('arialpl', 'B', 8);
$pdf->Cell(35,1,"ODBIORCA:",0,0,'L',1);
$pdf->Ln(3);
$pdf->SetX(81);
$pdf->SetFont('arialpl', '', 8);
$pdf->MultiCell(60,4,$address,0,'L');
$pdf->SetXY(160,$old_y+10+$personplus);
$table = array();
$table [1]['date_reg'] = array('width' => 20, 'value' => $mod_strings['LBL_PDF_DATE_REGISTER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
$table [1]['date_reg_value'] = array('width' => 36, 'value' => $this->register_date, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
$table [2]['date_end'] = array('width' => 20, 'value' => "Data zakonczenia", 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
$table [2]['date_end_value'] = array('width' => 36, 'value' => $this->end_date, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
$table [3]['data'] = array('width' => 20, 'value' => $mod_strings['LBL_PDF_OWNER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
$table [3]['data_value'] = array('width' => 36, 'value' => $this->setUser()->full_name, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
$rs=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select name from ecmstocks where id='".$this->pw_stock_id."'"));
$table [4]['pw'] = array('width' => 20, 'value' => "Magazyn dokumentu PW", 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
$table [4]['pw_value'] = array('width' => 36, 'value' => $rs['name'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
$rs=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select name from ecmstocks where id='".$this->rw_stock_id."'"));
$table [5]['rw'] = array('width' => 20, 'value' => "Magazyn dokumentu RW", 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
$table [5]['rw_value'] = array('width' => 36, 'value' => $rs['name'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
$emp=str_replace("|","
",$this->employers);
$table [6]['data'] = array('width' => 20, 'value' => "Osoby", 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
$table [6]['data_value'] = array('width' => 36, 'value' => $emp, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
$pdf->SetXY(143,$pdf->tMargin);
$pdf->DrawTable($table, null, 0.5, 0.5, 3);
$pdf->Ln(9);
$pdf->SetFont('arialpl','','18');
$pdf->SetXY(60,$pdf->tMargin+10);
$pdf->MultiCell(80,7,$mod_strings['LBL_PDF_DOCUMENT_NAME']." ".$this->document_no,0,'C');
$pdf->SetFont('arialpl', 'B', 7);
$pdf->Ln(3);
$this->loadParser();
$this->header_text = $this->template->mfp->parseText($this->header_text);
$this->footer_text = $this->template->mfp->parseText($this->footer_text);
$this->ads_text = $this->template->mfp->parseText($this->ads_text);
$pdf->SetY($ynew);
$pdf->SetFont('arialpl','','7');
global $mod_strings;
$currency = new Currency();
$currency->retrieve($this->currency_id);
$this->currency_symbol=$currency->iso4217;
if(!isset($this->position_list) || !is_array($this->position_list))
$this->position_list = $this->getPositionList(true);
$calc = $this->calculate($this->position_list,true);
$calc['total'] .= ' '.$this->currency_symbol;
$calc['subtotal'] .= ' '.$this->currency_symbol;
if($calc['discount']) {
$calc['total2'] .= ' '.$this->currency_symbol;
$calc['discount']['value'] .= ' '.$this->currency_symbol;
}
if(isset($calc['vats']) && is_array($calc['vats']) && count($calc['vats']) > 0)
foreach($calc['vats'] as $key => $value) $calc['vats'][$key] .= ' '.$this->currency_symbol;
$pdf->Ln(7);
$name_w = 41;
$table = array();
$table [0]['position'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_POSITION'], 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
$table [0]['code'] = array('width' => 12, 'value' => "Index", 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
$table [0]['description'] = array('width' => $name_w, 'value' => $mod_strings['LBL_PDF_LIST_DESCRIPTION'], 'border' => 1, 'overflow' => 1, 'align' => 'C');
$table [0]['quantity'] = array('width' => 8, 'value' => $mod_strings['LBL_PDF_LIST_QUANTITY'], 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
$table [0]['prod_quantity'] = array('width' => 8, 'value' => "Il. prod", 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
$table [0]['unit_price'] = array('width' => 14, 'value' => $mod_strings['LBL_PDF_LIST_PRICE'], 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
$table [0]['total'] = array('width' => 14, 'value' => "Suma netto", 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'R');
$pdf->SetY(60);
if($this->header_text){
$pdf->MultiCell(80,4,$this->header_text,0,'L');$pdf->Ln();
}
$pdf->DrawTable($table,array(0));
$pdf->Ln(0);
$table=array();
$i = 1;
if($this->position_list != '')
foreach($this->position_list as $p) {
if($p['component']!=1){
$no++;
$n=$no;
$up=format_number($p['price']).' '.$this->currency_symbol;
$tot=format_number($p['total']).' '.$this->currency_symbol;
}
else {
$n="";
$up="";
$tot="";
}
if($p['prod_quantity']==0)$pq="";
else $pq=$p['prod_quantity'];
$table [$i]['position'] = array('width' => 5, 'value' => $n, 'border' => 1, 'align' => 'C', );
$table [$i]['code'] = array('width' => 12, 'value' => $p['code'], 'border' => 1, 'align' => 'C', );
$table [$i]['description'] = array('width' => $name_w, 'value' => htmlspecialchars_decode($p['name']), 'border' => 1, 'align' => 'L', );
$table [$i]['quantity'] = array('width' => 8, 'value' => $p['quantity'], 'border' => 1, 'align' => 'C', );
$table [$i]['prod_quantity'] = array('width' => 8, 'value' => $pq, 'border' => 1, 'align' => 'C', );
$table [$i]['unit_price'] = array('width' => 14, 'value' => $up, 'border' => 1, 'align' => 'C');
$table [$i]['total'] = array('width' => 14, 'value' => $tot, 'border' => 1, 'align' => 'R', );
$i++;
}
$pdf->DrawTable($table,array(0));
$pdf->Ln(4);
$pr = ($pdf->fw-$pdf->lMargin-$pdf->rMargin)/100;
$table = array();
$table [] = array(
'total1' => array('width' => 16,'font-style' => 'b', 'value' => "Suma netto",'border' => 1, 'overflow' => 1, 'align' => 'L', 'font-size' => 9, 'font-style' => 'b'),
'total2' => array('width' => 28, 'value' => $calc['total'], 'border' => 1, 'overflow' => 1, 'align' => 'R' , 'font-size' => 9, 'font-style' => 'b'),
);
if($pdf->GetY()+30>$pdf->fh-$pdf->bMargin)$pdf->AddPage();
$pdf->SetX(124);
$pdf->DrawTable($table);
$pdf->Ln(10);
$pdf->Cell(85,1,".........................................................",0,0,'L',1);
$pdf->Cell(85,1,".........................................................",0,0,'R',1);
$pdf->Ln(3);
$pdf->SetFont('arialpl','','5');
$pdf->Cell(85,1," (podpis produkujacego)",0,0,'L',1);
$pdf->Cell(85,1,"(podpis kontrolujacego) ",0,0,'R',1);
?>

View File

@@ -0,0 +1,31 @@
<?
$this->SetFont('arialpl', '', 8);
$this->SetY($this->fh-15);
$this->SetDrawColor(0,0,0);
$this->SetFillColor(255,255,255);
$this->Rect(0, $this->getBreakLine(), $this->fw, $this->bMargin+1, "F");
$this->SetDrawColor(0,0,0);
$this->Cell(0, 10, $this->PageNo().'/{nb}');
$this->Ln(5);
$this->AliasNbPages();
$this->SetLineWidth(0);
$this->SetDrawColor(0,0,0);
$this->Line($this->lMargin,$this->getBreakLine(),$this->fw-$this->rMargin,$this->fh-$this->bMargin+1);
if($this->edt->show_footer_on_all_pages == 0 && $this->page > 1) {
// $this->bMargin = 3;
// $this->SetAutoPageBreak(true,$this->bMargin);
return;
} else {
// $this->bMargin = 19;
// $this->SetAutoPageBreak(true,$this->bMargin+$this->tMarign+5);
}
$this->SetFont('arialpl','','8');
$this->SetXY($this->lMargin+10,$this->fh-$this->bMargin+3);
$this->MultiCell($this->fw-$this->lMargin-$this->rMargin-20,4,$this->edt->footer_text,0,'C');
?>

View File

@@ -0,0 +1,17 @@
<?
if(!$this->blnShowHeader) return;
if($this->edt->show_header_on_all_pages == 0 && $this->page > 1) return;
//logo
if(isset($this->edt->logo_path) && $this->edt->logo_path != '')
if(file_exists($this->edt->logo_path))
$this->Image($this->edt->logo_path,$this->rMargin+132,$this->tMargin,0,18.3);
//from address
$this->SetFont('arialpl', '', 8);
$this->SetXY($this->lMargin,$this->tMargin+3);
$this->MultiCell(100,3.15,$this->edt->header_text,0,'L');
$this->SetY(32);
?>

View File

@@ -0,0 +1,37 @@
<?
//payment conditions
/*if(!empty($this->ecmpaymentcondition_text)) {
$pdf->Ln(4);
$pdf->SetFont('arialpl','','8');
$pdf->MultiCell(0,4,$this->ecmpaymentcondition_text,0,'L');
}*/
//delivery conditions
/*if(!empty($this->ecmdeliverycondition_text)) {
$pdf->Ln(4);
$pdf->SetFont('arialpl','','8');
$pdf->MultiCell(0,4,$this->ecmdeliverycondition_text,0,'L');
}*/
//footer text
$pdf->Ln(10);
$pdf->SetFont('arialpl','','10');
$pdf->MultiCell(0,4,$this->footer_text,0,'J');
//ads text
$pdf->Ln(10);
$pdf->SetFont('arialpl','B','10');
$pdf->MultiCell(0,4,$this->ads_text,0,'J');
?>

View File

@@ -0,0 +1,91 @@
<?
$pdf->Ln(2);
//to address
$address = $this->parent_name;
if($this->parent_contact_name) {
$address .= "\n".$this->parent_contact_name;
if($this->parent_contact_title) $address .= "\n".$this->parent_contact_title;
}
if($this->parent_address_street) $address .= "\n".$this->parent_address_street;
if($this->parent_address_postalcode) $address .= "\n".$this->parent_address_postalcode;
if($this->parent_address_city) $address .= " ".$this->parent_address_city;
if($this->to_vatid) $address .= "\n\n".$mod_strings['LBL_PDF_VATID']." ".$this->to_vatid;
$pdf->SetFont('arialpl', '', 10);
$pdf->Ln(2);
$current = $pdf->GetY();
$pdf->MultiCell(0,4,$address,0,'L');
$current2 = $pdf->GetY();
//$current = $pdf->GetY();
//$pdf->Ln(7);
$pdf->SetXY($pdf->fw-$pdf->rMargin-20,$current);
$table = array();
$table [0]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_NUMBER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
$table [1]['data'] = array('width' => 30, 'value' => $this->document_no, 'border' => 0, 'overflow' => 1, 'align' => 'L');
$table [2]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_DATE_REGISTER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
$table [3]['data'] = array('width' => 30, 'value' => $this->register_date, 'border' => 0, 'overflow' => 1, 'align' => 'L');
$next = 4;
if(isset($this->validtill_date) && $this->validtill_date != '') {
$table [$next++]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_VALIDTILL_DATE'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
$table [$next++]['data'] = array('width' => 30, 'value' => $this->validtill_date, 'border' => 0, 'overflow' => 1, 'align' => 'L');
}
if(isset($this->delivery_date) && $this->delivery_date != '') {
$table [$next++]['data'] = array('width' => 30, 'value' => "Data dostawy", 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
$table [$next++]['data'] = array('width' => 30, 'value' => $this->delivery_date, 'border' => 0, 'overflow' => 1, 'align' => 'L');
}
$table [$next++]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_OWNER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
$table [$next++]['data'] = array('width' => 30, 'value' => $this->setUser()->full_name, 'border' => 0, 'overflow' => 1, 'align' => 'L');
$pdf->DrawTable($table, null, 0.5, 0.5, 3);
$pdf->SetY($current2);
$pdf->Ln(12);
$pdf->SetFont('arialpl','','16');
$pdf->SetY(55);
if($this->type=="sales_order")$pdf->MultiCell(0,3,$mod_strings['LBL_PDF_DOCUMENT_NAME'],0,'C');
elseif($this->type=="back")$pdf->MultiCell(0,3,"Zwrot Towaru",0,'C');
elseif($this->type=="serwis_back")$pdf->MultiCell(0,3,"Zwrot Serwisowy",0,'C');
elseif($this->type=="gratis")$pdf->MultiCell(0,3,"Gratis",0,'C');
else $pdf->MultiCell(0,3,$mod_strings['LBL_PDF_DOCUMENT_NAME'],0,'C');
if(isset($this->validtill_date) && $this->validtill_date != '') $pdf->Ln(9);
$this->loadParser();
$this->header_text = $this->template->mfp->parseText($this->header_text);
$this->footer_text = $this->template->mfp->parseText($this->footer_text);
$this->ads_text = $this->template->mfp->parseText($this->ads_text);
//header text
$pdf->Ln(10);
$pdf->SetFont('arialpl','B','10');
$pdf->MultiCell(0,4,$this->header_text,0,'J');
$pdf->Ln(4);
?>

View File

@@ -0,0 +1,31 @@
<?
$this->SetFont('arialpl', '', 8);
$this->SetY($this->fh-15);
$this->SetDrawColor(0,0,0);
$this->SetFillColor(255,255,255);
$this->Rect(0, $this->getBreakLine(), $this->fw, $this->bMargin+1, "F");
$this->SetDrawColor(0,0,0);
$this->Cell(0, 10, $this->PageNo().'/{nb}');
$this->Ln(5);
$this->AliasNbPages();
$this->SetLineWidth(0);
$this->SetDrawColor(0,0,0);
$this->Line($this->lMargin,$this->getBreakLine(),$this->fw-$this->rMargin,$this->fh-$this->bMargin+1);
if($this->edt->show_footer_on_all_pages == 0 && $this->page > 1) {
// $this->bMargin = 3;
// $this->SetAutoPageBreak(true,$this->bMargin);
return;
} else {
// $this->bMargin = 19;
// $this->SetAutoPageBreak(true,$this->bMargin+$this->tMarign+5);
}
$this->SetFont('arialpl','','8');
$this->SetXY($this->lMargin+10,$this->fh-$this->bMargin+3);
$this->MultiCell($this->fw-$this->lMargin-$this->rMargin-20,4,$this->edt->footer_text,0,'C');
?>

View File

@@ -0,0 +1,32 @@
<?
if(!$this->blnShowHeader) return;
if($this->edt->show_header_on_all_pages == 0 && $this->page > 1) return;
//from address
$this->SetFont('arialpl', '', 8);
$this->SetXY($this->fw-100-$this->rMargin,$this->tMargin);
$this->MultiCell(100,3.15,$this->edt->header_text,0,'R');
//logo
if(isset($this->edt->logo_path) && $this->edt->logo_path != '')
if(file_exists($this->edt->logo_path))
$this->Image($this->edt->logo_path,$this->lMargin,$this->tMargin,0,22.3);
/*
//line
$this->SetLineWidth(0);
$this->SetDrawColor(0,0,0);
$this->Line($this->lMargin,$this->tMargin-1,$this->fw-$this->rMargin,$this->tMargin-1);
*/
//if($this->GetY() < $this->tMargin) $this->SetY($this->tMargin); else
$this->Ln(6);
if($this->page == 1)
if($this->edt->address) {
$this->Ln(9);
$this->SetFont('arialpl', 'u', 8);
$this->SetX($this->lMargin);
$this->MultiCell(0,3.15,$this->edt->address,0,'L');
$this->Ln(5);
}
?>

View File

@@ -0,0 +1,37 @@
<?
//payment conditions
if(!empty($this->ecmpaymentcondition_text)) {
$pdf->Ln(4);
$pdf->SetFont('arialpl','','8');
$pdf->MultiCell(0,4,$this->ecmpaymentcondition_text,0,'L');
}
//delivery conditions
if(!empty($this->ecmdeliverycondition_text)) {
$pdf->Ln(4);
$pdf->SetFont('arialpl','','8');
$pdf->MultiCell(0,4,$this->ecmdeliverycondition_text,0,'L');
}
//footer text
$pdf->Ln(10);
$pdf->SetFont('arialpl','','10');
$pdf->MultiCell(0,4,$this->footer_text,0,'J');
//header text
$pdf->Ln(10);
$pdf->SetFont('arialpl','B','10');
$pdf->MultiCell(0,4,$this->ads_text,0,'J');
?>

View File

@@ -0,0 +1,99 @@
<?
/*
$pdf->Ln(10);
//$this->SetY($this->tMargin);
//from address
$this->template->setAccount();
$address = $this->template->account->name;
if($this->template->account->billing_address_street) $address .= " - ".$this->template->account->billing_address_street;
if($this->template->account->billing_address_postalcode) $address .= " - ".$this->template->account->billing_address_postalcode;
if($this->template->account->billing_address_city) $address .= " ".$this->template->account->billing_address_city;
$pdf->SetFont('arialpl', 'u', 8);
*/
$pdf->Ln(2);
//$pdf->MultiCell(0,5,$address,0,'L');
//to address
$address = $this->parent_name;
if($this->parent_contact_name) {
$address .= "\n".$this->parent_contact_name;
if($this->parent_contact_title) $address .= "\n".$this->parent_contact_title;
}
if($this->parent_address_street) $address .= "\n".$this->parent_address_street;
if($this->parent_address_postalcode) $address .= "\n\n".$this->parent_address_postalcode;
if($this->parent_address_city) $address .= " ".$this->parent_address_city;
if($this->to_vatid) $address .= "\n\n".$mod_strings['LBL_PDF_VATID']." ".$this->to_vatid;
$pdf->SetFont('arialpl', '', 10);
$pdf->Ln(2);
$current = $pdf->GetY();
$pdf->MultiCell(0,4,$address,0,'L');
$current2 = $pdf->GetY();
// $pdf->Ln(7);
$pdf->SetXY($pdf->fw-$pdf->rMargin-20,$current);
$table = array();
$table [0]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_NUMBER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
$table [1]['data'] = array('width' => 30, 'value' => $this->document_no, 'border' => 0, 'overflow' => 1, 'align' => 'L');
$table [2]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_DATE_REGISTER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
$table [3]['data'] = array('width' => 30, 'value' => $this->register_date, 'border' => 0, 'overflow' => 1, 'align' => 'L');
$table [4]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_OWNER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
$table [5]['data'] = array('width' => 30, 'value' => $this->setUser()->full_name, 'border' => 0, 'overflow' => 1, 'align' => 'L');
$pdf->DrawTable($table, null, 0.5, 0.5, 3);
$pdf->SetY($current2);
$pdf->Ln(12);
$pdf->SetFont('arialpl','','24');
$pdf->MultiCell(0,3,$mod_strings['LBL_PDF_DOCUMENT_NAME'],0,'L');
$this->loadParser();
$this->header_text = $this->template->mfp->parseText($this->header_text);
$this->footer_text = $this->template->mfp->parseText($this->footer_text);
$this->ads_text = $this->template->mfp->parseText($this->ads_text);
//header text
$pdf->Ln(12);
$pdf->SetFont('arialpl','','10');
$pdf->MultiCell(0,4,$this->header_text,0,'J');
$pdf->Ln(10);
?>

View File

@@ -0,0 +1,31 @@
<?
$this->SetFont('arialpl', '', 8);
$this->SetY($this->fh-15);
$this->SetDrawColor(0,0,0);
$this->SetFillColor(255,255,255);
$this->Rect(0, $this->getBreakLine(), $this->fw, $this->bMargin+1, "F");
$this->SetDrawColor(0,0,0);
$this->Cell(0, 10, $this->PageNo().'/{nb}');
$this->Ln(5);
$this->AliasNbPages();
$this->SetLineWidth(0);
$this->SetDrawColor(0,0,0);
$this->Line($this->lMargin,$this->getBreakLine(),$this->fw-$this->rMargin,$this->fh-$this->bMargin+1);
if($this->edt->show_footer_on_all_pages == 0 && $this->page > 1) {
// $this->bMargin = 3;
// $this->SetAutoPageBreak(true,$this->bMargin);
return;
} else {
// $this->bMargin = 19;
// $this->SetAutoPageBreak(true,$this->bMargin+$this->tMarign+5);
}
$this->SetFont('arialpl','','8');
$this->SetXY($this->lMargin+10,$this->fh-$this->bMargin+3);
$this->MultiCell($this->fw-$this->lMargin-$this->rMargin-20,4,$this->edt->footer_text,0,'C');
?>

View File

@@ -0,0 +1,17 @@
<?
if(!$this->blnShowHeader) return;
if($this->edt->show_header_on_all_pages == 0 && $this->page > 1) return;
//logo
if(isset($this->edt->logo_path) && $this->edt->logo_path != '')
if(file_exists($this->edt->logo_path))
$this->Image($this->edt->logo_path,$this->rMargin+132,$this->tMargin,0,18.3);
//from address
$this->SetFont('arialpl', '', 8);
$this->SetXY($this->lMargin,$this->tMargin+3);
$this->MultiCell(100,3.15,$this->edt->header_text,0,'L');
$this->SetY(32);
?>

View File

@@ -0,0 +1,3 @@
<?
$pdf->SetFont('arialpl','','10');
?>

View File

@@ -0,0 +1,9 @@
<?
$pdf->SetFont('arialpl','','10');
$pdf->UseCSS(true);
$pdf->noPPadding = true;
$this->document_text = "<p></p>".$this->document_text;
$this->document_text = str_replace(array("&lt;", "&gt;", "&quot;"), array("<", ">", "\""), $this->document_text);
$pdf->WriteHTML($this->getParsedDocumentText($this->document_text));
?>

View File

@@ -0,0 +1,31 @@
<?
$this->SetFont('arialpl', '', 8);
$this->SetY($this->fh-15);
$this->SetDrawColor(0,0,0);
$this->SetFillColor(255,255,255);
$this->Rect(0, $this->getBreakLine(), $this->fw, $this->bMargin+1, "F");
$this->SetDrawColor(0,0,0);
$this->Cell(0, 10, $this->PageNo().'/{nb}');
$this->Ln(5);
$this->AliasNbPages();
$this->SetLineWidth(0);
$this->SetDrawColor(0,0,0);
$this->Line($this->lMargin,$this->getBreakLine(),$this->fw-$this->rMargin,$this->fh-$this->bMargin+1);
if($this->edt->show_footer_on_all_pages == 0 && $this->page > 1) {
// $this->bMargin = 3;
// $this->SetAutoPageBreak(true,$this->bMargin);
return;
} else {
// $this->bMargin = 19;
// $this->SetAutoPageBreak(true,$this->bMargin+$this->tMarign+5);
}
$this->SetFont('arialpl','','8');
$this->SetXY($this->lMargin+10,$this->fh-$this->bMargin+3);
$this->MultiCell($this->fw-$this->lMargin-$this->rMargin-20,4,$this->edt->footer_text,0,'C');
?>

View File

@@ -0,0 +1,34 @@
<?
if(!$this->blnShowHeader) return;
if($this->edt->show_header_on_all_pages == 0 && $this->page > 1) return;
//from address
$this->SetFont('arialpl', '', 8);
$this->SetXY($this->fw-100-$this->rMargin,$this->tMargin);
$this->MultiCell(100,3.15,$this->edt->header_text,0,'R');
//logo
if(isset($this->edt->logo_path) && $this->edt->logo_path != '')
if(file_exists($this->edt->logo_path))
$this->Image($this->edt->logo_path,$this->lMargin,$this->tMargin,0,22.3);
/*
//line
$this->SetLineWidth(0);
$this->SetDrawColor(0,0,0);
$this->Line($this->lMargin,$this->tMargin-1,$this->fw-$this->rMargin,$this->tMargin-1);
*/
//if($this->GetY() < $this->tMargin) $this->SetY($this->tMargin); else
/*
$this->Ln(6);
if($this->page == 1)
if($this->edt->address) {
$this->Ln(9);
$this->SetFont('arialpl', 'u', 8);
$this->SetX($this->lMargin);
//$this->MultiCell(0,3.15,$this->edt->address,0,'L');
$this->Ln(5);
}
*/
?>

View File

@@ -0,0 +1,3 @@
<?
$pdf->SetFont('arialpl','','10');
?>

View File

@@ -0,0 +1,9 @@
<?
$pdf->SetFont('arialpl','','10');
$pdf->UseCSS(true);
$pdf->noPPadding = true;
$this->document_text = "<p></p>".$this->document_text;
$this->document_text = str_replace(array("&lt;", "&gt;", "&quot;"), array("<", ">", "\""), $this->document_text);
$pdf->WriteHTML($this->getParsedDocumentText($this->document_text));
?>

View File

@@ -0,0 +1,93 @@
<?
error_reporting(0);
$r=mysql_fetch_array(mysql_query("select document_no, ecmlanguage from ".strtolower($_REQUEST['module'])." where id='".$_REQUEST['record']."'"));
$this->SetFont('arialpl', '', 8);
$this->SetY($this->fh-15);
$this->SetDrawColor(0,0,0);
$this->SetFillColor(255,255,255);
$this->Rect(0, $this->getBreakLine(), $this->fw, $this->bMargin+1, "F");
$this->SetDrawColor(0,0,0);
$this->Cell(0, 10, $this->PageNo().'/{nb}');
$this->Ln(5);
$this->AliasNbPages();
$this->SetLineWidth(0);
$this->SetDrawColor(0,0,0);
$this->Line($this->lMargin,-17-16+1,$this->fw-$this->rMargin,-17-16+1);
if($this->edt->show_footer_on_all_pages == 0 && $this->page > 1) {
return;
}
$this->SetXY($this->lMargin,-20-16);
$this->SetFont('arialpl','','7');
$this->Cell(110,4,$this->edt->footer_account);
$this->SetFont('arialpl','B','7');
$this->Cell(20,4,'Bank: ');
$this->SetFont('arialpl','','7');
$this->Cell(45,4,$this->edt->footer_bankname,0,0,'L');
$this->Ln();
$this->SetFont('arialpl','','7');
if ($r['ecmlanguage']=='pl_pl')
$this->Cell(110,4,$this->edt->footer_address);
else
$this->Cell(110,4,$this->edt->footer_address.', Poland');
$this->SetFont('arialpl','B','7');
if ($r['ecmlanguage']=='pl_pl')
$this->Cell(20,4,'Numer konta: ');
else
$this->Cell(20,4,'Bank IBAN: ');
$this->SetFont('arialpl','','7');
$this->Cell(45,4,$this->edt->account_number,0,0,'L');
$this->Ln();
$this->SetFont('arialpl','','7');
$this->Cell(110,4,$this->edt->footer_phone);
if ($r['ecmlanguage']=='pl_pl') {
$this->SetFont('arialpl','B','7');
$this->Cell(20,4,'Numer GIOS: ');
$this->SetFont('arialpl','','7');
$this->Cell(45,4,"E0006254W",0,0,'L');
} else {
$this->SetFont('arialpl','B','7');
$this->Cell(20,4,'Bank SWIFT: ');
$this->SetFont('arialpl','','7');
$this->Cell(45,4,"BIGBPLPW",0,0,'L');
}
$this->Ln();
$this->SetFont('arialpl','','7');
$this->Cell(110,4,$this->edt->footer_fax);
$this->SetFont('arialpl','B','7');
$this->Cell(20,4,'KRS: ');
$this->SetFont('arialpl','','7');
$this->Cell(45,4,$this->edt->footer_krs,0,0,'L');
$this->Ln();
$this->SetFont('arialpl','','7');
$this->Cell(110,4,'www.e5.pl');
$this->SetFont('arialpl','B','7');
$this->Cell(20,4,'NIP: ');
$this->SetFont('arialpl','','7');
$this->Cell(45,4,$this->edt->footer_nip,0,0,'L');
$this->Ln();
$this->SetFont('arialpl','','7');
$this->Cell(110,4,'');
$this->SetFont('arialpl','B','7');
$this->Cell(20,4,'REGON: ');
$this->SetFont('arialpl','','7');
$this->Cell(45,4,$this->edt->footer_regon,0,0,'L');
$this->Ln();
$this->SetFont("arialpl","B",8);
$this->SetXY(40,$this->GetY()+1);
$this->Cell(45,4,$r['document_no'],0,0,'L');
?>

View File

@@ -0,0 +1,17 @@
<?
if(!$this->blnShowHeader) return;
if($this->edt->show_header_on_all_pages == 0 && $this->page > 1) return;
//logo
if(isset($this->edt->logo_path) && $this->edt->logo_path != '')
if(file_exists($this->edt->logo_path))
$this->Image($this->edt->logo_path,$this->rMargin+132,$this->tMargin,0,18.3);
//from address
$this->SetFont('arialpl', '', 8);
$this->SetXY($this->lMargin,$this->tMargin+3);
$this->MultiCell(100,3.15,$this->edt->header_text,0,'L');
$this->SetY(32);
?>

View File

@@ -0,0 +1,20 @@
<?
error_reporting(0);
if(!$this->blnShowHeader) return;
if($this->edt->show_header_on_all_pages == 0 && $this->page > 1) return;
//from address
$this->SetFont('arialpl', '', 8);
$this->SetXY($this->lMargin,$this->tMargin+2);
//$this->MultiCell(100,3.15,$this->edt->header_text.'
//'.translate('LBL_PDF_NIP',$module_t).': '.$nip,0,'L');
//$this->MultiCell(100,4,"Wystawca:\n".$this->edt->header_text,0,'L');
//logo
//$this->MultiCell(80,7,$this->edt->logo_path."mmm",0,'C');
if(isset($this->edt->logo_path) && $this->edt->logo_path != '' && file_exists($this->edt->logo_path)){
$this->Image($this->edt->logo_path,$this->lMargin,$this->tMargin+5,0,12.3);
}
?>

View File

@@ -0,0 +1,38 @@
<?
//payment conditions
if(!empty($this->ecmpaymentcondition_text)) {
$pdf->Ln(4);
$pdf->SetFont('arialpl','','8');
$pdf->MultiCell(0,4,$this->ecmpaymentcondition_text,0,'L');
}
//delivery conditions
if(!empty($this->ecmdeliverycondition_text)) {
$pdf->Ln(4);
$pdf->SetFont('arialpl','','8');
$pdf->MultiCell(0,4,$this->ecmdeliverycondition_text,0,'L');
}
//footer text
$pdf->Ln(10);
$pdf->SetFont('arialpl','','10');
$pdf->MultiCell(0,4,$this->footer_text,0,'J');
//header text
/*
$pdf->Ln(10);
$pdf->SetFont('arialpl','B','10');
$pdf->MultiCell(0,4,$this->ads_text,0,'J');
*/
?>

View File

@@ -0,0 +1,235 @@
<?
$pdf->Ln(2);
//to address
$address = $this->parent_name;
if($this->parent_contact_name) {
$address .= "\n".$this->parent_contact_name;
if($this->parent_contact_title) $address .= "\n".$this->parent_contact_title;
}
if($this->parent_address_street) $address .= "\n".$this->parent_address_street;
if($this->parent_address_postalcode) $address .= "\n".$this->parent_address_postalcode;
if($this->parent_address_city) $address .= " ".$this->parent_address_city;
if($this->to_vatid) $address .= "\n\n".$mod_strings['LBL_PDF_VATID']." ".$this->to_vatid;
$pdf->SetFont('arialpl', '', 10);
$pdf->Ln(2);
$current = $pdf->GetY();
//$pdf->MultiCell(0,4,$address,0,'L');
$current2 = $pdf->GetY();
//$current = $pdf->GetY();
//$pdf->Ln(7);
$pdf->SetXY($pdf->fw-$pdf->rMargin-30,$current);
$table = array();
$table [0]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_NUMBER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
$table [1]['data'] = array('width' => 30, 'value' => $this->document_no, 'border' => 0, 'overflow' => 1, 'align' => 'L');
$table [2]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_DATE_REGISTER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
$table [3]['data'] = array('width' => 30, 'value' => $this->register_date, 'border' => 0, 'overflow' => 1, 'align' => 'L');
$next = 4;
if(isset($this->validtill_date) && $this->validtill_date != '') {
$table [$next++]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_VALIDTILL_DATE'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
$table [$next++]['data'] = array('width' => 30, 'value' => $this->validtill_date, 'border' => 0, 'overflow' => 1, 'align' => 'L');
}
if($this->correct_id){
$table [$next++]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_CORRECT_TO'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
$r=mysql_fetch_array(mysql_query("select document_no from ecmstockdocins where id='".$this->correct_id."'"));
$table [$next++]['data'] = array('width' => 30, 'value' => $r['document_no'], 'border' => 0, 'overflow' => 1, 'align' => 'L');
}
$table [$next++]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_OWNER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
$table [$next++]['data'] = array('width' => 30, 'value' => $this->setUser()->full_name, 'border' => 0, 'overflow' => 1, 'align' => 'L');
$pdf->DrawTable($table, null, 0.5, 0.5, 3);
$pdf->SetY($current2);
$pdf->Ln(12);
$pdf->SetFont('arialpl','','22');
$pdf->SetY(45);
$pdf->SetX(65);
if($this->correct_id) $pdf->MultiCell(90,10,$mod_strings['LBL_PDF_DOCUMENT_NAME_CORRECT'],70,'C');
else $pdf->MultiCell(90,10,$mod_strings['LBL_PDF_DOCUMENT_NAME'],70,'C');
$yaftername=$pdf->GetY()+7;
if($this->correct_id)$yaftername+=7;
if(isset($this->validtill_date) && $this->validtill_date != '') $pdf->Ln(9);
$this->loadParser();
$this->header_text = $this->template->mfp->parseText($this->header_text);
$this->footer_text = $this->template->mfp->parseText($this->footer_text);
$this->ads_text = $this->template->mfp->parseText($this->ads_text);
//header text
$pdf->Ln(20);
$pdf->SetFont('arialpl','B','10');
$pdf->SetY(36);
$pdf->MultiCell(0,4,$mod_strings['LBL_PDF_QUOTE_FOR'],0,'J');
$pdf->Ln(1);
$pdf->SetFont('arialpl','','10');
$pdf->MultiCell(0,4,$address,0,'J');
$pdf->Ln(20);
$pdf->SetY($yaftername);
global $mod_strings;
if(!isset($this->position_list) || !is_array($this->position_list))
$this->position_list = $this->getPositionList(true);
$calc = $this->calculate($this->position_list,true);
$this->position_list = $this->formatPositions($this->position_list);
$calc['total'] .= ' '.$this->currency_symbol;
$calc['subtotal'] .= ' '.$this->currency_symbol;
if($calc['discount']) {
$calc['total2'] .= ' '.$this->currency_symbol;
$calc['discount']['value'] .= ' '.$this->currency_symbol;
}
if(isset($calc['vats']) && is_array($calc['vats']) && count($calc['vats']) > 0)
foreach($calc['vats'] as $key => $value) $calc['vats'][$key] .= ' '.$this->currency_symbol;
$name_w = 42;
$image_w = 10;
$recipient_code_w = 10;
if($this->show_images_on_offers){
$name_w -= $image_w;
}
if($this->show_recipient_code){
$name_w -= $recipient_code_w;
}
if($calc['draw_discount']){
$name_w -= 8;
}
if($calc['draw_vat']){
$name_w -= 8;
}
$table = array();
if($this->show_images_on_offers)
$table [0]['image'] = array('width' => $image_w, 'value' => $mod_strings['LBL_PDF_LIST_IMAGE'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'R');
$table [0]['position'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_POSITION'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
$table [0]['code'] = array('width' => 12, 'value' => $mod_strings['LBL_PDF_LIST_CODE'],'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
if($this->show_recipient_code)
$table [0]['recipient_code'] = array('width' => $recipient_code_w, 'value' => $mod_strings['LBL_PDF_LIST_RECIPIENT_CODE'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
//$table [0]['unit'] = array('width' => 10, 'value' => $mod_strings['LBL_PDF_LIST_UNIT'],'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
$table [0]['description'] = array('width' => $name_w, 'value' => $mod_strings['LBL_PDF_LIST_DESCRIPTION'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
$table [0]['quantity'] = array('width' => 8, 'value' => $mod_strings['LBL_PDF_LIST_QUANTITY'],'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
$table [0]['unit'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_UNIT'], 'border' => 0,'background' => array(233,233,233), 'overflow' => 1, 'align' => 'C');
$table [0]['unit_price'] = array('width' => 14, 'value' => $mod_strings['LBL_PDF_LIST_PRICE'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
if($calc['draw_discount']) $table [0]['discount'] = array('width' => 8, 'value' => $mod_strings['LBL_PDF_LIST_DISCOUNT'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'R');
if($calc['draw_vat']) $table [0]['vat_id'] = array('width' => 8, 'value' => $mod_strings['LBL_PDF_LIST_VAT'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'R');
$table [0]['total'] = array('width' => 14, 'value' => "Suma netto", 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'R');
$i = 1;
$lv=return_app_list_strings_language($this->ecmlanguage);
if($this->position_list != '')
foreach($this->position_list as $p) {
if($this->show_images_on_offers){
if(file_exists($this->getProductImage($p['id']))){$table [$i]['image'] = array('width' => $image_w, 'value' => '', 'border' => 0, 'align' => 'R', 'image_path' => $this->getProductImage($p['id']));
//$iarr[]=$this->getProductImage($p['id']);
}
else $table [$i]['image'] = array('width' => $image_w, 'value' => '', 'border' => 0, 'align' => 'R');
}
$table [$i]['position'] = array('width' => 5, 'value' => $i, 'border' => 0, 'align' => 'C', );
$table [$i]['code'] = array('width' => 12, 'value' => $p['code'], 'border' => 0, 'align' => 'C', );
if($this->show_recipient_code)
$table [$i]['recipient_code'] = array('width' => $recipient_code_w, 'value' => $p['recipient_code'], 'border' => 0, 'align' => 'C', );
//$table [$i]['unit'] = array('width' => 10, 'value' => $p['unit_id'], 'border' => 0, 'align' => 'C', );
/*
if($this->ecmlanguage=="en_us"){
$r=mysql_fetch_array(mysql_query("select short_description from ecmproduct_language_en_view where ecmproduct_id='".$p['id']."'"));
$dname=$r['short_description'];
}
elseif($this->ecmlanguage=="ge_ge"){
$r=mysql_fetch_array(mysql_query("select short_description from ecmproduct_language_de_view where ecmproduct_id='".$p['id']."'"));
$dname=$r['short_description'];
}
else $dname=$p['name'];
*/
$table [$i]['description'] = array('width' => $name_w, 'value' => htmlspecialchars_decode($p['name']), 'border' => 0, 'align' => 'L', );
$table [$i]['quantity'] = array('width' => 8, 'value' => $p['quantity'], 'border' => 0, 'align' => 'C', );
$table [$i]['unit'] = array('width' => 5, 'value' => $lv['ecmproducts_unit_dom'][$p['unit_id']], 'border' => 0, 'align' => 'C', 'font-size' => 7 );
$table [$i]['unit_price'] = array('width' => 14, 'value' => $p['price'], 'border' => 0, 'align' => 'C', );
if($calc['draw_discount']) $table [$i]['discount'] = array('width' => 8, 'value' => $p['discount'], 'border' => 0, 'align' => 'R', );
if($calc['draw_vat']) $table [$i]['vat_id'] = array('width' => 8, 'value' => $p['vat_name'], 'border' => 0, 'align' => 'R', );
$table [$i]['total'] = array('width' => 14, 'value' => $p['total'], 'border' => 0, 'align' => 'R', );
$i++;
}
$starttab=$pdf->GetY()+10;
$pdf->DrawTable($table,array(0));
$endtab=$pdf->GetY();
//for($n=0;$n<$i;$n++){
//if(file_exists($iarr[$n]))$pdf->Image($iarr[$n],$pdf->GetX()+1,$starttab+$n*18+1,15,0);
//}
$pdf->SetY($endtab);
//total, vat, subtotal
$pdf->Ln(4);
$pr = ($pdf->fw-$pdf->lMargin-$pdf->rMargin)/100;
//$pdf->SetX($pdf->fw-$pdf->rMargin-$pr*34);
$table = array();
if($calc['vats']) {
$table [] = array(
'subtotal1' => array('width' => 66, 'value' => "Suma netto", 'background' => array(255,255,255), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 9),
'subtotal2' => array('width' => 34, 'value' => $calc['subtotal'], 'border' => 0, 'overflow' => 1, 'align' => 'R', 'font-size' => 9), );
foreach($calc['vats'] as $key => $value){
$r=mysql_fetch_array(mysql_query("select name from ecmvats where id='".$key."'"));
$vvn=$r['name'];
$table [] = array(
'vat1' => array('width' => 66, 'value' => $mod_strings['LBL_PDF_VAT'].' ('.$vvn.')', 'background' => array(255,255,255), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 9),
'vat2' => array('width' => 34, 'value' => $value, 'border' => 0, 'overflow' => 1, 'align' => 'R', 'font-size' => 9), );
}
}
if(isset($calc['discount'])) {
$table [] = array(
'total21' => array('width' => 66, 'value' => $mod_strings['LBL_PDF_TOTAL'], 'background' => array(255,255,255), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 9, 'font-style' => 'b'),
'total22' => array('width' => 34, 'value' => $calc['total2'], 'border' => 0, 'overflow' => 1, 'align' => 'R' , 'font-size' => 9), );
$table [] = array(
'discount1' => array('width' => 66, 'value' => $mod_strings['LBL_PDF_DISCOUNT'].' '.$calc['discount']['procent'], 'background' => array(255,255,255), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 9, 'font-style' => 'b'),
'discount2' => array('width' => 34, 'value' => $calc['discount']['value'], 'border' => 0, 'overflow' => 1, 'align' => 'R' , 'font-size' => 9), );
}
$table [] = array(
'total1' => array('width' => 66, 'value' => "Suma brutto", 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 9, 'font-style' => 'b'),
'total2' => array('width' => 34, 'value' => $calc['total'], 'border' => 0, 'background' => array(233,233,233), 'overflow' => 1, 'align' => 'R' , 'font-size' => 9, 'font-style' => 'b'), );
$pdf->DrawTable($table);
?>

View File

@@ -0,0 +1,192 @@
<?
global $app_list_strings;
$address = str_replace("&lt;","<",str_replace("&gt;",">",$this->parent_name));
if($this->parent_contact_name) {
$address .= "\n".$this->parent_contact_name;
if($this->parent_contact_title) {
$address .= "\n".$this->parent_contact_title;
}
$personplus=5;
}
else $personplus=0;
if($this->parent_address_street) $address .= "\n".str_replace("\n","",$this->parent_address_street);
if($this->parent_address_postalcode) $address .= "\n".$this->parent_address_postalcode;
if($this->parent_address_city) $address .= " ".$this->parent_address_city;
if($this->to_nip) $address .= "\n".$mod_strings['LBL_PDF_NIP'].": ".$this->to_nip;
elseif(!$this->to_nip && $this->to_vatid) $address .= "\n".$mod_strings['LBL_PDF_NIP'].": ".$this->to_vatid;
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select iln from accounts where id='".$this->parent_id."'"));
if($r['iln'])$address .= "\nILN: ".$r['iln'];
//to address
$old_x=$pdf->GetX();
$old_y=$pdf->GetY();
$pdf->SetXY(25,37);
$pdf->SetFont('arialpl', 'B', 8);
$pdf->Cell(35,1,"WYSTAWCA:",0,0,'L',1);
$pdf->Ln(3);
$pdf->SetX(25);
$pdf->SetFont('arialpl', '', 8);
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select vatid from accounts where id='".$pdf->edt->account_id."'"));
if($r['vatid'])$pdf->edt->header_text .= "\nNip: ".$r['vatid'];
if($r['iln'])$pdf->edt->header_text .= "\nILN: ".$r['iln'];
$pdf->MultiCell(60,4,$pdf->edt->header_text,0,'L');
$pdf->SetXY(81,37);
$pdf->SetFont('arialpl', 'B', 8);
$pdf->Cell(35,1,"ODBIORCA:",0,0,'L',1);
$pdf->Ln(3);
$pdf->SetX(81);
$pdf->SetFont('arialpl', '', 8);
$pdf->MultiCell(60,4,$address,0,'L');
$pdf->SetXY(160,$old_y+10+$personplus);
$table = array();
$table [1]['date_reg'] = array('width' => 20, 'value' => $mod_strings['LBL_PDF_DATE_REGISTER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
$table [1]['date_reg_value'] = array('width' => 36, 'value' => $this->register_date, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
$table [2]['date_end'] = array('width' => 20, 'value' => "Data zakonczenia", 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
$table [2]['date_end_value'] = array('width' => 36, 'value' => $this->end_date, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
$table [3]['data'] = array('width' => 20, 'value' => $mod_strings['LBL_PDF_OWNER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
$table [3]['data_value'] = array('width' => 36, 'value' => $this->setUser()->full_name, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
$rs=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select name from ecmstocks where id='".$this->pw_stock_id."'"));
$table [4]['pw'] = array('width' => 20, 'value' => "Magazyn dokumentu PW", 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
$table [4]['pw_value'] = array('width' => 36, 'value' => $rs['name'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
$rs=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select name from ecmstocks where id='".$this->rw_stock_id."'"));
$table [5]['rw'] = array('width' => 20, 'value' => "Magazyn dokumentu RW", 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
$table [5]['rw_value'] = array('width' => 36, 'value' => $rs['name'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
$emp=str_replace("|","
",$this->employers);
$table [6]['data'] = array('width' => 20, 'value' => "Osoby", 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
$table [6]['data_value'] = array('width' => 36, 'value' => $emp, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
$pdf->SetXY(143,$pdf->tMargin);
$pdf->DrawTable($table, null, 0.5, 0.5, 3);
$pdf->Ln(9);
$pdf->SetFont('arialpl','','18');
$pdf->SetXY(60,$pdf->tMargin+10);
$pdf->MultiCell(80,7,$mod_strings['LBL_PDF_DOCUMENT_NAME']." ".$this->document_no,0,'C');
$pdf->SetFont('arialpl', 'B', 7);
$pdf->Ln(3);
//$this->loadParser();
$this->header_text = $this->template->mfp->parseText($this->header_text);
$this->footer_text = $this->template->mfp->parseText($this->footer_text);
$this->ads_text = $this->template->mfp->parseText($this->ads_text);
$pdf->SetY($ynew);
$pdf->SetFont('arialpl','','7');
global $mod_strings;
$currency = new Currency();
$currency->retrieve($this->currency_id);
$this->currency_symbol=$currency->iso4217;
if(!isset($this->position_list) || !is_array($this->position_list))
$this->position_list = $this->getPositionList(true);
$calc = $this->calculate($this->position_list,true);
$calc['total'] .= ' '.$this->currency_symbol;
$calc['subtotal'] .= ' '.$this->currency_symbol;
if($calc['discount']) {
$calc['total2'] .= ' '.$this->currency_symbol;
$calc['discount']['value'] .= ' '.$this->currency_symbol;
}
if(isset($calc['vats']) && is_array($calc['vats']) && count($calc['vats']) > 0)
foreach($calc['vats'] as $key => $value) $calc['vats'][$key] .= ' '.$this->currency_symbol;
$pdf->Ln(7);
$name_w = 41;
$table = array();
$table [0]['position'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_POSITION'], 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
$table [0]['code'] = array('width' => 12, 'value' => "Index", 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
$table [0]['description'] = array('width' => $name_w, 'value' => $mod_strings['LBL_PDF_LIST_DESCRIPTION'], 'border' => 1, 'overflow' => 1, 'align' => 'C');
$table [0]['quantity'] = array('width' => 8, 'value' => $mod_strings['LBL_PDF_LIST_QUANTITY'], 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
$table [0]['prod_quantity'] = array('width' => 8, 'value' => "Il. prod", 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
$table [0]['unit_price'] = array('width' => 14, 'value' => $mod_strings['LBL_PDF_LIST_PRICE'], 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
$table [0]['total'] = array('width' => 14, 'value' => "Suma netto", 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'R');
$pdf->SetY(60);
if($this->header_text){
$pdf->MultiCell(80,4,$this->header_text,0,'L');$pdf->Ln();
}
$pdf->DrawTable($table,array(0));
$pdf->Ln(0);
$table=array();
$i = 1;
if($this->position_list != '')
foreach($this->position_list as $p) {
if($p['component']!=1){
$no++;
$n=$no;
$up=format_number($p['price']).' '.$this->currency_symbol;
$tot=format_number($p['total']).' '.$this->currency_symbol;
}
else {
$n="";
$up="";
$tot="";
}
if($p['prod_quantity']==0)$pq="";
else $pq=$p['prod_quantity'];
$table [$i]['position'] = array('width' => 5, 'value' => $n, 'border' => 1, 'align' => 'C', );
$table [$i]['code'] = array('width' => 12, 'value' => $p['code'], 'border' => 1, 'align' => 'C', );
$table [$i]['description'] = array('width' => $name_w, 'value' => htmlspecialchars_decode($p['name']), 'border' => 1, 'align' => 'L', );
$table [$i]['quantity'] = array('width' => 8, 'value' => $p['quantity'], 'border' => 1, 'align' => 'C', );
$table [$i]['prod_quantity'] = array('width' => 8, 'value' => $pq, 'border' => 1, 'align' => 'C', );
$table [$i]['unit_price'] = array('width' => 14, 'value' => $up, 'border' => 1, 'align' => 'C');
$table [$i]['total'] = array('width' => 14, 'value' => $tot, 'border' => 1, 'align' => 'R', );
$i++;
}
$pdf->DrawTable($table,array(0));
/*
*/
$pdf->Ln(4);
$pr = ($pdf->fw-$pdf->lMargin-$pdf->rMargin)/100;
$table = array();
$table [] = array(
'total1' => array('width' => 16,'font-style' => 'b', 'value' => "Suma netto",'border' => 1, 'overflow' => 1, 'align' => 'L', 'font-size' => 9, 'font-style' => 'b'),
'total2' => array('width' => 28, 'value' => $calc['total'], 'border' => 1, 'overflow' => 1, 'align' => 'R' , 'font-size' => 9, 'font-style' => 'b'),
);
if($pdf->GetY()+30>$pdf->fh-$pdf->bMargin)$pdf->AddPage();
$pdf->SetX(124);
$pdf->DrawTable($table);
$pdf->Ln(10);
$pdf->Cell(85,1,".........................................................",0,0,'L',1);
$pdf->Cell(85,1,".........................................................",0,0,'R',1);
$pdf->Ln(3);
$pdf->SetFont('arialpl','','5');
$pdf->Cell(85,1," (podpis produkujacego)",0,0,'L',1);
$pdf->Cell(85,1,"(podpis kontrolujacego) ",0,0,'R',1);
?>

View File

@@ -0,0 +1,49 @@
<?php
/*
//if($this->edt->show_footer_on_all_pages == 0 && $this->page > 1) return;
if ($this->page > 1) {
$y = $this->fh - 20;
$this->Line(10, $y, 200, $y);
$this->SetFont('arialpl', '', 10);
$this->SetXY(10, $this->fh - 16);
$this->Cell(10, 0, 'Oferta nr ' . $this->focus->document_no);
$this->SetXY($this->fw / 2, $this->fh - 16);
$this->Cell(10, 0, $this->PageNo() . '/{nb}');
} else {
$y = $this->fh - 20;
$this->Line(10, $y, 200, $y);
$this->SetFont('arialpl', '', 7.5);
$this->SetXY(10, $this->fh - 16);
$this->Cell(49, 0, "Prezes Zarządu - J.Lasowy");
$this->Cell(40, 0, "NIP: 879-016-88-72");
$this->Cell(50, 0, "Sąd Rejonowy w Toruniu");
if($this->focus->pdf_type == 'K')
$this->Cell(30, 0, "Konto: Alior Bank S.A. Oddział w Toruniu");
else
$this->Cell(30, 0, "Bank: City Handlowy");
$this->SetXY(10, $this->fh - 12.5);
$this->Cell(49, 0, "Wiceprezes - M.Lasowy");
$this->Cell(40, 0, "REGON: 870525737");
$this->Cell(50, 0, "VII Wydział Gospodarczy KRS");
if($this->focus->pdf_type == 'K')
$this->Cell(30, 0, "14 2490 0005 0000 4530 1266 3471");
else
$this->Cell(30, 0, "IBAN: PL 02 1030 1090 0000 0000 5802 0503");
$this->SetXY(10, $this->fh - 9);
$this->Cell(49, 0, "");
$this->Cell(40, 0, "Kapitał zakładowy 50 000 PLN");
$this->Cell(50, 0, "KRS 0000160548");
if($this->focus->pdf_type != 'K')
$this->Cell(30, 0, "SWITF: CITIPLPX");
}

View File

@@ -0,0 +1,251 @@
<?php
//payment conditions
//
//if (!empty($this->ecmpaymentcondition_text)) {
// $pdf->Ln(4);
// $pdf->SetFont('arialpl', '', '8');
// $pdf->MultiCell(0, 4, $this->ecmpaymentcondition_text, 0, 'L');
// $pdf->Ln();
//}
//
//if ($this->type == "correct") {
// $pdf->SetFont('arialpl', 'b', '12');
// $pdf->Ln(3);
// $pdf->MultiCell(0, 4, $mod_strings['LBL_PDF_DOCUMENT_CORRECT_DIFFERENCE'] . '/' . $mod_strings2['LBL_PDF_DOCUMENT_CORRECT_DIFFERENCE'] . " " . format_number(abs(unformat_number($this->total) + unformat_number($this->ecminvoiceout->total))) . ' ' . $this->currency_symbol);
// $pdf->Ln(3);
//}
$pdf->writeHTML('</table>'); // fix background-color overflowing FROM table ... why ? //
if ($this->type == "correct") {
$qw = "SELECT price, ecmvat_value, quantity, ecminvoiceoutitem_id FROM ecminvoiceoutitems WHERE ecminvoiceout_id = '" . $this->id . "'";
$w = $GLOBALS['db']->query($qw);
while ($r = $GLOBALS['db']->fetchByAssoc($w)) {
$qrr = "SELECT price, quantity, ecmvat_value FROM ecminvoiceoutitems WHERE id = '" . $r['ecminvoiceoutitem_id'] . "'";
$rr_prepayment = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query($qrr));
$total += $r['price'] * $r['quantity'] + round($r['price'] * $r['quantity'] * $r['ecmvat_value'] / 100, 2);
$total -= $rr_prepayment['price'] * $rr_prepayment['quantity'] + round($rr_prepayment['price'] * $rr_prepayment['quantity'] * $rr_prepayment['ecmvat_value'] / 100, 2);
}
$total -= $this->paid_val;
if ($total > 0) {
$string = $mod_strings['LBL_PDF_TO_PAID'] . '/' . $mod_strings2['LBL_PDF_TO_PAID'];
} else {
$string = $mod_strings['LBL_PDF_TO_PAID_BACK'] . '/' . $mod_strings2['LBL_PDF_TO_PAID_BACK'];
}
$total = format_number(abs($total));
$pdf->SetX(10);
$pdf->SetFont('arialpl', '', '8');
$pdf->Cell(50, 4, 'Razem do zapłaty:', 0, 0, 'L', 1);
$pdf->SetFont('arialpl', 'B', '8');
$pdf->Cell(30, 4, format_number($brutto) . ' ' . $this->currency_symbol, 0, 0, 'L', 1);
} else {
$total = 0;
$qw = "SELECT price, ecmvat_value, quantity, ecminvoiceoutitem_id FROM ecminvoiceoutitems WHERE ecminvoiceout_id = '" . $this->id . "'";
$w = $GLOBALS['db']->query($qw);
while ($r = $GLOBALS['db']->fetchByAssoc($w)) {
$total+=$r['price'] * $r['quantity'] + round($r['price'] * $r['quantity'] * $r['ecmvat_value'] / 100, 2);
}
$total-=floatval(str_replace(",", ".", str_replace(".", "", $this->discount)));
//$total -= $this->paid_val;
if ($total > 0) {
$string = $mod_strings['LBL_PDF_TO_PAID'] . '/' . $mod_strings2['LBL_PDF_TO_PAID'];
} else {
$string = $mod_strings['LBL_PDF_TO_PAID_BACK'] . '/' . $mod_strings2['LBL_PDF_TO_PAID_BACK'];
}
$total = format_number(abs($total));
$pdf->SetX(10);
$pdf->SetFont('arialpl', '', '8');
$pdf->Cell(50, 4, 'Razem do zapłaty/Total to pay:', 0, 0, 'L', 1);
$pdf->SetFont('arialpl', 'B', '8');
$pdf->Cell(30, 4, format_number($brutto) . ' ' . $this->currency_symbol, 0, 0, 'R', 1);
}
$pdf->Ln(4);
$pdf->SetFont('arialpl', '', '8');
if ($this->prepaid) {
// $pdf->Cell(50, 4, $mod_strings['LBL_PDF_PREPAID_DOCUMENTS'] . '/' . $mod_strings2['LBL_PDF_PREPAID_DOCUMENTS'] . ':', 0, 0, 'L', 1);
// $pdf->Cell(30, 4, implode(', ', $rr_prepayment), 0, 0, 'L', 1);
//
// $pdf->Ln(4);
$pdf->SetX(10);
$pdf->Cell(50, 4, $mod_strings['LBL_PDF_PREPAID'] . '/' . $mod_strings2['LBL_PDF_PREPAID'] . ':', 0, 0, 'L', 1);
$pdf->SetFont('arialpl', 'B', '8');
$pdf->Cell(30, 4, format_number($this->prepaid) . ' ' . $this->currency_symbol, 0, 0, 'R', 1);
$pdf->Ln(4);
}
//$pdf->Ln(4);
$pdf->SetX(10);
$pdf->SetFont('arialpl', '', '8');
$pdf->Cell(50, 4, $mod_strings['LBL_PDF_PAID'] . '/' . $mod_strings2['LBL_PDF_PAID'] . ':', 0, 0, 'L', 1);
$pdf->SetFont('arialpl', 'B', '8');
$pdf->Cell(30, 4, format_number($this->paid_val) . ' ' . $this->currency_symbol, 0, 0, 'R', 1);
if($this->paid_val > 0) {
$pdf->SetX(100);
$pdf->SetFont('arialpl', '', '8');
$pdf->WriteHtml($app_list_strings['payment_method_dom'][$this->payment_method_paid] . '/' . $lv['payment_method_dom'][$this->payment_method_paid]);
}
$pdf->Ln(4);
//if ($pdf->GetY() > 240) {
// $pdf->AddPage();
//}
$total -= ($this->paid_val);
if(($pleft = $brutto - $this->prepaid - $this->paid_val) > 0) {
$pdf->SetX(10);
$pdf->SetFont('arialpl', '', '8');
$pdf->Cell(50, 4, 'Pozostało do zapłaty/To pay:', 0, 0, 'L', 1);
$pdf->SetFont('arialpl', 'B', '8');
$pdf->Cell(30, 4, format_number($pleft). ' ' . $this->currency_symbol, 0, 0, 'R', 1);
$pdf->SetX(100);
$pdf->SetFont('arialpl', '', '8');
$pdf->WriteHtml(sprintf($mod_strings['LBL_PDF_PAYMENT_METHOD_PATTERN'], $this->payment_date_d, $this->payment_date, $app_list_strings['payment_method_dom'][$this->payment_method]));
$pdf->Ln(4);
$pdf->SetX(100);
$pdf->SetFont('arialpl', '', '8');
$pdf->WriteHtml(sprintf($mod_strings2['LBL_PDF_PAYMENT_METHOD_PATTERN'], $this->payment_date_d, $this->payment_date, $lv['payment_method_dom'][$this->payment_method]));
//echo '<pre>' . var_export($cx, true) . '</pre>';
//echo '<pre>' . var_export($cy, true) . '</pre>'; exit;
}
//$pdf->Ln(4);
//$pdf->SetFont('arialpl', '', '8');
//
//if (false == is_null($pc)) {
// $pdf->Cell(50, 4, $mod_strings['LBL_PDF_PAYMENT_METHOD'] . ':', 0, 0, 'L', 1);
// $pdf->Cell(50, 4, $pc->name ? : '-', 0, 0, 'L', 1);
//
// $pdf->Ln(4);
//}
//
//$pdf->Cell(50, 4, $mod_strings['LBL_PDF_PAYMENT_TERMIN'] . ':', 0, 0, 'L', 1);
//$pdf->Cell(50, 4, $this->payment_date ? : '-', 0, 0, 'L', 1);
//
//$pdf->Ln(4);
//
//$pdf->SetFont('arialpl', '', '8');
//$pdf->Cell(30, 4, "Słownie:", 0, 0, 'L', 1);
//$pdf->SetFont('arialpl', 'B', '8');
//
//if ($this->type == "correct") {
// $tot = format_number(abs((float) $total - array_sum($inv_value)));
// $tot = str_replace(".", "", $tot);
// //$tot=str_replace(",",".",$tot);
// $sl = $this->slowniePL($tot);
//} else {
// $tot = str_replace(".", "", str_replace("PLN", "", $total - array_sum($inv_value)));
// $sl = $this->slowniePL($tot);
//}
//
//if ($this->document_no == "FV 1421/10") {
// $sl = "one thousand one hundred six EUR 41/100";
//}
//
//$pdf->Cell(150, 4, $sl, 0, 0, 'L', 1);
//echo '<pre>' . var_export(format_number('9.9999', 4, 4), true) . '</pre>'; exit;
//echo '<pre>' . var_export(gettype((double)$this->currency_value), true) . '</pre>'; exit;
if ($this->currency_value > 1 && $this->currency_symbol != 'EUR') {
$pdf->Ln(8);
$pdf->SetX(10);
$pdf->WriteHtml(sprintf('Ceny wyliczono wg kursu sprzedaży walut banku Citi Handlowego z dn. wystawienia faktury: 1 %s = %s %s', $this->currency_symbol, format_number($this->currency_value, 4, 4), 'PLN'));
$pdf->Ln(4);
$pdf->SetX(10);
$pdf->WriteHtml(sprintf('Prices are calculated by currency exchange rates of City Handlowy bank dated by invoice sale date: 1 %s = %s %s', $this->currency_symbol, format_number($this->currency_value, 4, 4), 'PLN'));
//$pdf->Cell(50, 4, 'Ceny wyliczono wg kursu sprzedaży walut banku Citi Handlowego z dn. wystawienia faktury: ' , 0, 0, 'L', 1); // $mod_strings['LBL_CURRENCY_VALUE'] . ':'
//$pdf->Cell(30, 4, '1 ' . $this->currency_symbol . ' = ' . format_number($this->currency_value, 4, 4) . ' zł', 0, 0, 'R', 1);
}
$pdf->Ln(8);
$pdf->SetFont('arialpl', 'B', '8');
$pdf->Ln(4);
$pdf->SetX(10);
$pdf->Cell(85, 1, 'Dla wszystkich pozycji faktury zastosowano stawkę VAT 0%', 0, 0, 'L', 1);
$pdf->Ln(4);
$pdf->SetX(10);
$pdf->Cell(85, 1, 'VAT is 0% for all invoice items', 0, 0, 'L', 1);
$pdf->Ln(4);
$pdf->SetX(10);
$pdf->Cell(85, 1, 'Zgodnie z art. 41 ust. 4 ustawy o podatku VAT', 0, 0, 'L', 1);
$pdf->Ln(16);
//$pdf->SetX(10);
//$pdf->SetFont('arialpl', '', '7');
//
//$pdf->Cell(95, 1, "...............................................................", 0, 0, 'L', 1);
//$pdf->Cell(95, 1, "...............................................................", 0, 0, 'R', 1);
//
//$pdf->Ln(4);
//
//$pdf->SetX(10);
//$pdf->Cell(43, 1, $mod_strings['LBL_PDF_OWNER_SIGNATURE'] . '/' . $mod_strings2['LBL_PDF_OWNER_SIGNATURE'], 0, 0, 'C', 1);
//
//$pdf->SetX(162);
//$pdf->Cell(35, 1, $mod_strings['LBL_PDF_RECEIVER_SIGNATURE'], 0, 0, 'C', 1);
//
//$pdf->Ln(4);
//$pdf->SetX(10);
//$pdf->Cell(43, 1, $this->setUser()->full_name, 0, 0, 'C', 1);
//footer text
$pdf->Ln(18);
$pdf->SetFont('arialpl', '', '8');
$pdf->MultiCell(0, 4, $this->footer_text, 0, 'J');
//header text
$pdf->Ln(6);
$pdf->SetFont('arialpl', 'B', '8');
$pdf->MultiCell(0, 4, $this->ads_text, 0, 'J');

View File

@@ -0,0 +1,241 @@
<?php
//payment conditions
//
//if (!empty($this->ecmpaymentcondition_text)) {
// $pdf->Ln(4);
// $pdf->SetFont('arialpl', '', '8');
// $pdf->MultiCell(0, 4, $this->ecmpaymentcondition_text, 0, 'L');
// $pdf->Ln();
//}
//
//if ($this->type == "correct") {
// $pdf->SetFont('arialpl', 'b', '12');
// $pdf->Ln(3);
// $pdf->MultiCell(0, 4, $mod_strings['LBL_PDF_DOCUMENT_CORRECT_DIFFERENCE'] . " " . format_number(abs(unformat_number($this->total) + unformat_number($this->ecminvoiceout->total))) . ' ' . $this->currency_symbol);
// $pdf->Ln(3);
//}
$pdf->writeHTML('</table>'); // fix background-color overflowing FROM table ... why ? //
if ($this->type == "correct") {
$qw = "SELECT price, ecmvat_value, quantity, ecminvoiceoutitem_id FROM ecminvoiceoutitems WHERE ecminvoiceout_id = '" . $this->id . "'";
$w = $GLOBALS['db']->query($qw);
while ($r = $GLOBALS['db']->fetchByAssoc($w)) {
$qrr = "SELECT price, quantity, ecmvat_value FROM ecminvoiceoutitems WHERE id = '" . $r['ecminvoiceoutitem_id'] . "'";
$rr_prepayment = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query($qrr));
$total += $r['price'] * $r['quantity'] + round($r['price'] * $r['quantity'] * $r['ecmvat_value'] / 100, 2);
$total -= $rr_prepayment['price'] * $rr_prepayment['quantity'] + round($rr_prepayment['price'] * $rr_prepayment['quantity'] * $rr_prepayment['ecmvat_value'] / 100, 2);
}
$total -= $this->paid_val;
if ($total > 0) {
$string = $mod_strings['LBL_PDF_TO_PAID'];
} else {
$string = $mod_strings['LBL_PDF_TO_PAID_BACK'];
}
$total = format_number(abs($total));
$pdf->SetX(10);
$pdf->SetFont('arialpl', '', '8');
$pdf->Cell(50, 4, 'Razem do zapłaty:', 0, 0, 'L', 1);
$pdf->SetFont('arialpl', 'B', '8');
$pdf->Cell(30, 4, format_number($brutto) . ' ' . $this->currency_symbol, 0, 0, 'L', 1);
} else {
$total = 0;
$qw = "SELECT price, ecmvat_value, quantity, ecminvoiceoutitem_id FROM ecminvoiceoutitems WHERE ecminvoiceout_id = '" . $this->id . "'";
$w = $GLOBALS['db']->query($qw);
while ($r = $GLOBALS['db']->fetchByAssoc($w)) {
$total+=$r['price'] * $r['quantity'] + round($r['price'] * $r['quantity'] * $r['ecmvat_value'] / 100, 2);
}
$total-=floatval(str_replace(",", ".", str_replace(".", "", $this->discount)));
//$total -= $this->paid_val;
if ($total > 0) {
$string = $mod_strings['LBL_PDF_TO_PAID'];
} else {
$string = $mod_strings['LBL_PDF_TO_PAID_BACK'];
}
$total = format_number(abs($total));
$pdf->SetX(10);
$pdf->SetFont('arialpl', '', '8');
$pdf->Cell(50, 4, 'Razem do zapłaty:', 0, 0, 'L', 1);
$pdf->SetFont('arialpl', 'B', '8');
$pdf->Cell(30, 4, format_number($brutto) . ' ' . $this->currency_symbol, 0, 0, 'R', 1);
}
$pdf->Ln(4);
$pdf->SetFont('arialpl', '', '8');
if ($this->prepaid) {
// $pdf->Cell(50, 4, $mod_strings['LBL_PDF_PREPAID_DOCUMENTS'] . ':', 0, 0, 'L', 1);
// $pdf->Cell(30, 4, implode(', ', $rr_prepayment), 0, 0, 'L', 1);
//
// $pdf->Ln(4);
$pdf->SetX(10);
$pdf->Cell(50, 4, $mod_strings['LBL_PDF_PREPAID'] . ':', 0, 0, 'L', 1);
$pdf->SetFont('arialpl', 'B', '8');
$pdf->Cell(30, 4, format_number($this->prepaid) . ' ' . $this->currency_symbol, 0, 0, 'R', 1);
$pdf->Ln(4);
}
//$pdf->Ln(4);
$pdf->SetX(10);
$pdf->SetFont('arialpl', '', '8');
$pdf->Cell(50, 4, $mod_strings['LBL_PDF_PAID'] . ':', 0, 0, 'L', 1);
$pdf->SetFont('arialpl', 'B', '8');
$pdf->Cell(30, 4, format_number($this->paid_val) . ' ' . $this->currency_symbol, 0, 0, 'R', 1);
if($this->paid_val > 0) {
$pdf->SetX(100);
$pdf->SetFont('arialpl', '', '8');
$pdf->WriteHtml($app_list_strings['payment_method_dom'][$this->payment_method_paid]);
}
$pdf->Ln(4);
//if ($pdf->GetY() > 240) {
// $pdf->AddPage();
//}
$total -= ($this->paid_val);
//var_export($numberLength);
//var_export($fNumber);
//var_export(str_pad(format_number($this->paid_val), $numberLength, '_', STR_PAD_LEFT));
//var_export(implode(array_fill(0, 10 - 5, '&nbsp;')) . format_number($pleft));exit;
if(($pleft = $brutto - $this->prepaid - $this->paid_val) > 0) {
$pdf->SetX(10);
$pdf->SetFont('arialpl', '', '8');
$pdf->Cell(50, 4, 'Pozostało do zapłaty:', 0, 0, 'L', 1);
$pdf->SetFont('arialpl', 'B', '8');
$pdf->Cell(30, 4, format_number($pleft) . ' ' . $this->currency_symbol, 0, 0, 'R', 1);
$pdf->SetX(100);
$pdf->SetFont('arialpl', '', '8');
$pdf->WriteHtml(sprintf($mod_strings['LBL_PDF_PAYMENT_METHOD_PATTERN'], $this->payment_date_d, $this->payment_date, $app_list_strings['payment_method_dom'][$this->payment_method]));
//$pdf->Ln(4);
//$pdf->SetX(90);
//$pdf->SetFont('arialpl', '', '8');
//$pdf->WriteHtml(sprintf($mod_strings2['LBL_PDF_PAYMENT_METHOD_PATTERN'], $this->payment_date_d, $this->payment_date, $this->payment_method));
//echo '<pre>' . var_export($cx, true) . '</pre>';
//echo '<pre>' . var_export($cy, true) . '</pre>'; exit;
}
//$pdf->Ln(4);
//$pdf->SetFont('arialpl', '', '8');
//
//if (false == is_null($pc)) {
// $pdf->Cell(50, 4, $mod_strings['LBL_PDF_PAYMENT_METHOD'] . ':', 0, 0, 'L', 1);
// $pdf->Cell(50, 4, $pc->name ? : '-', 0, 0, 'L', 1);
//
// $pdf->Ln(4);
//}
//
//$pdf->Cell(50, 4, $mod_strings['LBL_PDF_PAYMENT_TERMIN'] . ':', 0, 0, 'L', 1);
//$pdf->Cell(50, 4, $this->payment_date ? : '-', 0, 0, 'L', 1);
//
//$pdf->Ln(4);
//
//$pdf->SetFont('arialpl', '', '8');
//$pdf->Cell(30, 4, "Słownie:", 0, 0, 'L', 1);
//$pdf->SetFont('arialpl', 'B', '8');
//
//if ($this->type == "correct") {
// $tot = format_number(abs((float) $total - array_sum($inv_value)));
// $tot = str_replace(".", "", $tot);
// //$tot=str_replace(",",".",$tot);
// $sl = $this->slowniePL($tot);
//} else {
// $tot = str_replace(".", "", str_replace("PLN", "", $total - array_sum($inv_value)));
// $sl = $this->slowniePL($tot);
//}
//
//if ($this->document_no == "FV 1421/10") {
// $sl = "one thousand one hundred six EUR 41/100";
//}
//
//$pdf->Cell(150, 4, $sl, 0, 0, 'L', 1);
//echo '<pre>' . var_export(format_number('9.9999', 4, 4), true) . '</pre>'; exit;
//echo '<pre>' . var_export(gettype((double)$this->currency_value), true) . '</pre>'; exit;
if ($this->currency_value > 1 && $this->currency_symbol != 'EUR') {
$pdf->Ln(8);
$pdf->SetX(10);
$pdf->WriteHtml(sprintf('Ceny wyliczono wg kursu sprzedaży walut banku Citi Handlowego z dn. %s: 1 %s = %s %s', 'EUR', date('Y-m-d'), format_number($this->currency_value, 4, 4), $this->currency_symbol));
//$pdf->Cell(50, 4, 'Ceny wyliczono wg kursu sprzedaży walut banku Citi Handlowego z dn. wystawienia faktury: ' , 0, 0, 'L', 1); // $mod_strings['LBL_CURRENCY_VALUE'] . ':'
//$pdf->Cell(30, 4, '1 ' . $this->currency_symbol . ' = ' . format_number($this->currency_value, 4, 4) . ' zł', 0, 0, 'R', 1);
}
$pdf->Ln(20);
$pdf->SetX(10);
$pdf->SetFont('arialpl', '', '7');
$pdf->Cell(95, 1, "...............................................................", 0, 0, 'L', 1);
$pdf->Cell(95, 1, "...............................................................", 0, 0, 'R', 1);
$pdf->Ln(4);
$pdf->SetX(10);
$pdf->Cell(43, 1, $mod_strings['LBL_PDF_OWNER_SIGNATURE'], 0, 0, 'C', 1);
$pdf->SetX(162);
$pdf->Cell(35, 1, $mod_strings['LBL_PDF_RECEIVER_SIGNATURE'], 0, 0, 'C', 1);
$pdf->Ln(4);
$pdf->SetX(10);
$pdf->Cell(43, 1, $this->setUser()->full_name, 0, 0, 'C', 1);
//footer text
$pdf->Ln(18);
$pdf->SetFont('arialpl', '', '8');
$pdf->MultiCell(0, 4, $this->footer_text, 0, 'J');
//header text
$pdf->Ln(6);
$pdf->SetFont('arialpl', 'B', '8');
$pdf->MultiCell(0, 4, $this->ads_text, 0, 'J');
/*
error_reporting(E_ALL);
ini_set('display_errors', 1);
$pdf->DeletePage(6);exit;
*/

View File

@@ -0,0 +1,251 @@
<?php
//payment conditions
//
//if (!empty($this->ecmpaymentcondition_text)) {
// $pdf->Ln(4);
// $pdf->SetFont('arialpl', '', '8');
// $pdf->MultiCell(0, 4, $this->ecmpaymentcondition_text, 0, 'L');
// $pdf->Ln();
//}
//
//if ($this->type == "correct") {
// $pdf->SetFont('arialpl', 'b', '12');
// $pdf->Ln(3);
// $pdf->MultiCell(0, 4, $mod_strings['LBL_PDF_DOCUMENT_CORRECT_DIFFERENCE'] . '/' . $mod_strings2['LBL_PDF_DOCUMENT_CORRECT_DIFFERENCE'] . " " . format_number(abs(unformat_number($this->total) + unformat_number($this->ecminvoiceout->total))) . ' ' . $this->currency_symbol);
// $pdf->Ln(3);
//}
$pdf->writeHTML('</table>'); // fix background-color overflowing FROM table ... why ? //
if ($this->type == "correct") {
$qw = "SELECT price, ecmvat_value, quantity, ecminvoiceoutitem_id FROM ecminvoiceoutitems WHERE ecminvoiceout_id = '" . $this->id . "'";
$w = $GLOBALS['db']->query($qw);
while ($r = $GLOBALS['db']->fetchByAssoc($w)) {
$qrr = "SELECT price, quantity, ecmvat_value FROM ecminvoiceoutitems WHERE id = '" . $r['ecminvoiceoutitem_id'] . "'";
$rr_prepayment = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query($qrr));
$total += $r['price'] * $r['quantity'] + round($r['price'] * $r['quantity'] * $r['ecmvat_value'] / 100, 2);
$total -= $rr_prepayment['price'] * $rr_prepayment['quantity'] + round($rr_prepayment['price'] * $rr_prepayment['quantity'] * $rr_prepayment['ecmvat_value'] / 100, 2);
}
$total -= $this->paid_val;
if ($total > 0) {
$string = $mod_strings['LBL_PDF_TO_PAID'] . '/' . $mod_strings2['LBL_PDF_TO_PAID'];
} else {
$string = $mod_strings['LBL_PDF_TO_PAID_BACK'] . '/' . $mod_strings2['LBL_PDF_TO_PAID_BACK'];
}
$total = format_number(abs($total));
$pdf->SetX(10);
$pdf->SetFont('arialpl', '', '8');
$pdf->Cell(50, 4, 'Razem do zapłaty:', 0, 0, 'L', 1);
$pdf->SetFont('arialpl', 'B', '8');
$pdf->Cell(30, 4, format_number($brutto) . ' ' . $this->currency_symbol, 0, 0, 'L', 1);
} else {
$total = 0;
$qw = "SELECT price, ecmvat_value, quantity, ecminvoiceoutitem_id FROM ecminvoiceoutitems WHERE ecminvoiceout_id = '" . $this->id . "'";
$w = $GLOBALS['db']->query($qw);
while ($r = $GLOBALS['db']->fetchByAssoc($w)) {
$total+=$r['price'] * $r['quantity'] + round($r['price'] * $r['quantity'] * $r['ecmvat_value'] / 100, 2);
}
$total-=floatval(str_replace(",", ".", str_replace(".", "", $this->discount)));
//$total -= $this->paid_val;
if ($total > 0) {
$string = $mod_strings['LBL_PDF_TO_PAID'] . '/' . $mod_strings2['LBL_PDF_TO_PAID'];
} else {
$string = $mod_strings['LBL_PDF_TO_PAID_BACK'] . '/' . $mod_strings2['LBL_PDF_TO_PAID_BACK'];
}
$total = format_number(abs($total));
$pdf->SetX(10);
$pdf->SetFont('arialpl', '', '8');
$pdf->Cell(50, 4, 'Razem do zapłaty/Total to pay:', 0, 0, 'L', 1);
$pdf->SetFont('arialpl', 'B', '8');
$pdf->Cell(30, 4, format_number($brutto) . ' ' . $this->currency_symbol, 0, 0, 'R', 1);
}
$pdf->Ln(4);
$pdf->SetFont('arialpl', '', '8');
if ($this->prepaid) {
// $pdf->Cell(50, 4, $mod_strings['LBL_PDF_PREPAID_DOCUMENTS'] . '/' . $mod_strings2['LBL_PDF_PREPAID_DOCUMENTS'] . ':', 0, 0, 'L', 1);
// $pdf->Cell(30, 4, implode(', ', $rr_prepayment), 0, 0, 'L', 1);
//
// $pdf->Ln(4);
$pdf->SetX(10);
$pdf->Cell(50, 4, $mod_strings['LBL_PDF_PREPAID'] . '/' . $mod_strings2['LBL_PDF_PREPAID'] . ':', 0, 0, 'L', 1);
$pdf->SetFont('arialpl', 'B', '8');
$pdf->Cell(30, 4, format_number($this->prepaid) . ' ' . $this->currency_symbol, 0, 0, 'R', 1);
$pdf->Ln(4);
}
//$pdf->Ln(4);
$pdf->SetX(10);
$pdf->SetFont('arialpl', '', '8');
$pdf->Cell(50, 4, $mod_strings['LBL_PDF_PAID'] . '/' . $mod_strings2['LBL_PDF_PAID'] . ':', 0, 0, 'L', 1);
$pdf->SetFont('arialpl', 'B', '8');
$pdf->Cell(30, 4, format_number($this->paid_val) . ' ' . $this->currency_symbol, 0, 0, 'R', 1);
if($this->paid_val > 0) {
$pdf->SetX(100);
$pdf->SetFont('arialpl', '', '8');
$pdf->WriteHtml($app_list_strings['payment_method_dom'][$this->payment_method_paid] . '/' . $lv['payment_method_dom'][$this->payment_method_paid]);
}
$pdf->Ln(4);
//if ($pdf->GetY() > 240) {
// $pdf->AddPage();
//}
$total -= ($this->paid_val);
if(($pleft = $brutto - $this->prepaid - $this->paid_val) > 0) {
$pdf->SetX(10);
$pdf->SetFont('arialpl', '', '8');
$pdf->Cell(50, 4, 'Pozostało do zapłaty/To pay:', 0, 0, 'L', 1);
$pdf->SetFont('arialpl', 'B', '8');
$pdf->Cell(30, 4, format_number($pleft). ' ' . $this->currency_symbol, 0, 0, 'R', 1);
$pdf->SetX(100);
$pdf->SetFont('arialpl', '', '8');
$pdf->WriteHtml(sprintf($mod_strings['LBL_PDF_PAYMENT_METHOD_PATTERN'], $this->payment_date_d, $this->payment_date, $app_list_strings['payment_method_dom'][$this->payment_method]));
$pdf->Ln(4);
$pdf->SetX(100);
$pdf->SetFont('arialpl', '', '8');
$pdf->WriteHtml(sprintf($mod_strings2['LBL_PDF_PAYMENT_METHOD_PATTERN'], $this->payment_date_d, $this->payment_date, $lv['payment_method_dom'][$this->payment_method]));
//echo '<pre>' . var_export($cx, true) . '</pre>';
//echo '<pre>' . var_export($cy, true) . '</pre>'; exit;
}
//$pdf->Ln(4);
//$pdf->SetFont('arialpl', '', '8');
//
//if (false == is_null($pc)) {
// $pdf->Cell(50, 4, $mod_strings['LBL_PDF_PAYMENT_METHOD'] . ':', 0, 0, 'L', 1);
// $pdf->Cell(50, 4, $pc->name ? : '-', 0, 0, 'L', 1);
//
// $pdf->Ln(4);
//}
//
//$pdf->Cell(50, 4, $mod_strings['LBL_PDF_PAYMENT_TERMIN'] . ':', 0, 0, 'L', 1);
//$pdf->Cell(50, 4, $this->payment_date ? : '-', 0, 0, 'L', 1);
//
//$pdf->Ln(4);
//
//$pdf->SetFont('arialpl', '', '8');
//$pdf->Cell(30, 4, "Słownie:", 0, 0, 'L', 1);
//$pdf->SetFont('arialpl', 'B', '8');
//
//if ($this->type == "correct") {
// $tot = format_number(abs((float) $total - array_sum($inv_value)));
// $tot = str_replace(".", "", $tot);
// //$tot=str_replace(",",".",$tot);
// $sl = $this->slowniePL($tot);
//} else {
// $tot = str_replace(".", "", str_replace("PLN", "", $total - array_sum($inv_value)));
// $sl = $this->slowniePL($tot);
//}
//
//if ($this->document_no == "FV 1421/10") {
// $sl = "one thousand one hundred six EUR 41/100";
//}
//
//$pdf->Cell(150, 4, $sl, 0, 0, 'L', 1);
//echo '<pre>' . var_export(format_number('9.9999', 4, 4), true) . '</pre>'; exit;
//echo '<pre>' . var_export(gettype((double)$this->currency_value), true) . '</pre>'; exit;
if ($this->currency_value > 1 && $this->currency_symbol != 'EUR') {
$pdf->Ln(8);
$pdf->SetX(10);
$pdf->WriteHtml(sprintf('Ceny wyliczono wg kursu sprzedaży walut banku Citi Handlowego z dn. wystawienia faktury: 1 %s = %s %s', $this->currency_symbol, format_number($this->currency_value, 4, 4), 'PLN'));
$pdf->Ln(4);
$pdf->SetX(10);
$pdf->WriteHtml(sprintf('Prices are calculated by currency exchange rates of City Handlowy bank dated by invoice sale date: 1 %s = %s %s', $this->currency_symbol, format_number($this->currency_value, 4, 4), 'PLN'));
//$pdf->Cell(50, 4, 'Ceny wyliczono wg kursu sprzedaży walut banku Citi Handlowego z dn. wystawienia faktury: ' , 0, 0, 'L', 1); // $mod_strings['LBL_CURRENCY_VALUE'] . ':'
//$pdf->Cell(30, 4, '1 ' . $this->currency_symbol . ' = ' . format_number($this->currency_value, 4, 4) . ' zł', 0, 0, 'R', 1);
}
$pdf->Ln(8);
$pdf->SetFont('arialpl', 'B', '8');
$pdf->Ln(4);
$pdf->SetX(10);
$pdf->Cell(85, 1, 'Dla wszystkich pozycji faktury zastosowano stawkę VAT 0%', 0, 0, 'L', 1);
$pdf->Ln(4);
$pdf->SetX(10);
$pdf->Cell(85, 1, 'VAT is 0% for all invoice items', 0, 0, 'L', 1);
$pdf->Ln(4);
$pdf->SetX(10);
$pdf->Cell(85, 1, 'Zgodnie z art. 41 ust. 3 ustawy o podatku VAT', 0, 0, 'L', 1);
$pdf->Ln(16);
//$pdf->SetX(10);
//$pdf->SetFont('arialpl', '', '7');
//
//$pdf->Cell(95, 1, "...............................................................", 0, 0, 'L', 1);
//$pdf->Cell(95, 1, "...............................................................", 0, 0, 'R', 1);
//
//$pdf->Ln(4);
//
//$pdf->SetX(10);
//$pdf->Cell(43, 1, $mod_strings['LBL_PDF_OWNER_SIGNATURE'] . '/' . $mod_strings2['LBL_PDF_OWNER_SIGNATURE'], 0, 0, 'C', 1);
//
//$pdf->SetX(162);
//$pdf->Cell(35, 1, $mod_strings['LBL_PDF_RECEIVER_SIGNATURE'], 0, 0, 'C', 1);
//
//$pdf->Ln(4);
//$pdf->SetX(10);
//$pdf->Cell(43, 1, $this->setUser()->full_name, 0, 0, 'C', 1);
//footer text
$pdf->Ln(18);
$pdf->SetFont('arialpl', '', '8');
$pdf->MultiCell(0, 4, $this->footer_text, 0, 'J');
//header text
$pdf->Ln(6);
$pdf->SetFont('arialpl', 'B', '8');
$pdf->MultiCell(0, 4, $this->ads_text, 0, 'J');

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,84 @@
<?
error_reporting ( 0 );
$r = mysql_fetch_array ( mysql_query ( "select document_no, ecmlanguage from " . strtolower ( $_REQUEST ['module'] ) . " where id='" . $_REQUEST ['record'] . "'" ) );
$this->SetFont ( 'arialpl', '', 8 );
$this->SetY ( $this->fh - 15 );
$this->SetDrawColor ( 0, 0, 0 );
$this->SetFillColor ( 255, 255, 255 );
$this->Rect ( 0, $this->getBreakLine (), $this->fw, $this->bMargin + 1, "F" );
$this->SetDrawColor ( 0, 0, 0 );
$this->Cell ( 0, 10, $this->PageNo () . '/{nb}' );
$this->Ln ( 5 );
$this->AliasNbPages ();
$this->SetLineWidth ();
$this->SetDrawColor ( 0, 0, 0 );
$this->Line ( $this->lMargin, - 17 - 16 + 1, $this->fw - $this->rMargin, - 17 - 16 + 1 );
if ($this->edt->show_footer_on_all_pages == 0 && $this->page > 1) {
return;
}
$this->SetXY ( $this->lMargin, - 20 - 16 );
$this->Line(10,$this->fh-37,200,$this->fh-37);
$this->SetFont ( 'arialpl', '', '7' );
$this->Cell ( 110, 4, 'e5 Polska Sp. z o.o.' );
$this->SetFont ( 'arialpl', 'B', '7' );
$this->Cell ( 20, 4, 'Bank: ' );
$this->SetFont ( 'arialpl', '', '7' );
$this->Cell ( 45, 4, 'BANK MILLENIUM', 0, 0, 'L' );
$this->Ln ();
$this->SetFont ( 'arialpl', '', '7' );
$this->Cell ( 110, 4, 'ul. Wąwozowa 11, 02-796 Warszawa, Poland' );
$this->SetFont ( 'arialpl', 'B', '7' );
$this->Cell ( 20, 4, 'Bank IBAN: ' );
$this->SetFont ( 'arialpl', '', '7' );
$this->Cell ( 45, 4, 'PL36116022020000000064080587', 0, 0, 'L' );
$this->Ln ();
$this->SetFont ( 'arialpl', '', '7' );
$this->Cell ( 110, 4, '22 228 20 90');
$this->SetFont ( 'arialpl', 'B', '7' );
$this->Cell ( 20, 4, 'Bank SWIFT: ' );
$this->SetFont ( 'arialpl', '', '7' );
$this->Cell ( 45, 4, "BIGBPLPW", 0, 0, 'L' );
$this->Ln ();
$this->SetFont ( 'arialpl', '', '7' );
$this->Cell ( 110, 4, '+ 48 (56) 674 60 47' );
$this->SetFont ( 'arialpl', 'B', '7' );
$this->Cell ( 20, 4, 'KRS: ' );
$this->SetFont ( 'arialpl', '', '7' );
$this->Cell ( 45, 4, '28207', 0, 0, 'L' );
$this->Ln ();
$this->SetFont ( 'arialpl', '', '7' );
$this->Cell ( 110, 4, 'www.e5.pl' );
$this->SetFont ( 'arialpl', 'B', '7' );
$this->Cell ( 20, 4, 'NIP: ' );
$this->SetFont ( 'arialpl', '', '7' );
$this->Cell ( 45, 4, 'PL 525-21-73-990', 0, 0, 'L' );
$this->Ln ();
$this->SetFont ( 'arialpl', '', '7' );
$this->Cell ( 110, 4, '' );
$this->SetFont ( 'arialpl', 'B', '7' );
$this->Cell ( 20, 4, 'REGON: ' );
$this->SetFont ( 'arialpl', '', '7' );
$this->Cell ( 45, 4, '016280234', 0, 0, 'L' );
$this->Ln ();
$this->SetFont ( "arialpl", "B", 8 );
$this->SetXY ( 40, $this->GetY () + 1 );
$this->Cell ( 45, 4, $r ['document_no'], 0, 0, 'L' );
?>

View File

@@ -0,0 +1,51 @@
<?php
//if($this->edt->show_footer_on_all_pages == 0 && $this->page > 1) return;
if ($this->page > 1) {
$y = $this->fh - 20;
$this->Line(10, $y, 200, $y);
$this->SetFont('arialpl', '', 10);
$this->SetXY(10, $this->fh - 16);
$this->Cell(10, 0, $mod_strings['LBL_PDF_FOOTER_DOCUMENT_NAME'].' '.$this->focus->document_no);
$this->SetXY($this->fw-25,$this->fh-16);
$this->Cell(10, 0, $mod_strings['LBL_PDF_SITE'].' '.$this->PageNo().'/{nb}');
} else {
$y = $this->fh - 20;
$this->Line(10, $y, 200, $y);
$this->SetFont('arialpl', '', 7.5);
$this->SetXY(10, $this->fh - 16);
$this->Cell(49, 0, "Prezes Zarządu - J.Lasowy");
$this->Cell(40, 0, "NIP: 879-016-88-72");
$this->Cell(50, 0, "Sąd Rejonowy w Toruniu");
if($this->focus->currency_symbol == 'EUR')
$this->Cell(30, 0, "Bank: City Handlowy");
else
$this->Cell(30, 0, "Konto: Alior Bank S.A. Oddział w Toruniu");
$this->SetXY(10, $this->fh - 12.5);
$this->Cell(49, 0, "Wiceprezes - M.Lasowy");
$this->Cell(40, 0, "REGON: 870525737");
$this->Cell(50, 0, "VII Wydział Gospodarczy KRS");
if($this->focus->currency_symbol == 'EUR')
$this->Cell(30, 0, "IBAN: PL 02 1030 1090 0000 0000 5802 0503");
else
$this->Cell(30, 0, "14 2490 0005 0000 4530 1266 3471");
$this->SetXY(10, $this->fh - 9);
$this->Cell(49, 0, "");
$this->Cell(40, 0, "Kapitał zakładowy 50 000 PLN");
$this->Cell(50, 0, "KRS 0000160548");
if($this->focus->currency_symbol == 'EUR')
$this->Cell(30, 0, "SWITF: CITIPLPX");
$this->SetXY($this->fw-22,$this->fh-7);
$this->Cell(10, 0, $mod_strings['LBL_PDF_SITE'].' '.$this->PageNo().'/{nb}');
}

View File

@@ -0,0 +1,47 @@
<?
error_reporting ( 0 );
$r = mysql_fetch_array ( mysql_query ( "select document_no, ecmlanguage from " . strtolower ( $_REQUEST ['module'] ) . " where id='" . $_REQUEST ['record'] . "'" ) );
$this->SetFont ( 'arialpl', '', 8 );
$this->SetY ( $this->fh - 15 );
$this->SetDrawColor ( 0, 0, 0 );
$this->SetFillColor ( 255, 255, 255 );
$this->Rect ( 0, $this->getBreakLine (), $this->fw, $this->bMargin + 1, "F" );
$this->SetDrawColor ( 0, 0, 0 );
$this->Cell ( 0, 10, $this->PageNo () . '/{nb}' );
$this->Ln ( 5 );
$this->AliasNbPages ();
$this->SetLineWidth ();
$this->SetDrawColor ( 0, 0, 0 );
$this->Line ( $this->lMargin, - 17 - 16 + 1, $this->fw - $this->rMargin, - 17 - 16 + 1 );
if ($this->edt->show_footer_on_all_pages == 0 && $this->page > 1) {
return;
}
$doc = new EcmDocumentTemplate();
$doc->retrieve('97700b0d-fbe9-e366-4016-4b260f058a47');
$this->SetXY ( $this->lMargin, - 20 - 16 );
$this->Line(10,$this->fh-37,200,$this->fh-37);
$this->SetFont ( 'arialpl', '', '7' );
$this->Cell ( 110, 4,$doc->name );
$this->SetFont ( 'arialpl', 'B', '7' );
$this->Cell ( 20, 4, 'Bank: ' );
$this->SetFont ( 'arialpl', '', '7' );
$this->Cell ( 45, 4, 'PKO BP SA', 0, 0, 'L' );
$this->Ln ();
$this->SetFont ( 'arialpl', '', '7' );
$this->Cell ( 110, 4, $doc->footer_address );
$this->SetFont ( 'arialpl', 'B', '7' );
$this->Cell ( 20, 4, 'Numer konta: ' );
$this->SetFont ( 'arialpl', '', '7' );
$this->Cell ( 45, 4, '53 1020 5011 0000 9002 0270 6323', 0, 0, 'L' );
$this->Ln ();
?>

Some files were not shown because too many files have changed in this diff Show More