blue-mouse
Member
Hi,
I have made my own list template for multicolumn list. On my list i have standard fabrik calculations for some columns and my "manually written calculations". They are together on 1 list template.
My own calculations are written in default file for list template.
I can't create PDF for this list using my template with calculations.
I get an error:
Fatal error: Call to undefined method DOMText::getAttribute() in /var/www/cc.joomla/libraries/dompdf/include/cellmap.cls.php on line 437
Cellmap.cls.php is:
line 437 is:
$colspan = $node->getAttribute("colspan");
i use code like <td colspan="5"> for my custom calculations in file default.php
Exactly i would need in PDF "only summing part" on my list, = without table with records.
But now, on the beginning-to-get-PDF nothing is not send to PDF, PDF is not created at all.
Some piece of code for: /var/www/cc.joomla/components/com_fabrik/views/list/tmpl/default-2015-09-11-table-kp5/default.php
my list is here:
http://candc.katowice.pl/index.php/menu-karta-produkcji/adm-rejestr-pak-prod3
Neccessary is login, should be actual login for Fabrik Staff in my profile.
I have made my own list template for multicolumn list. On my list i have standard fabrik calculations for some columns and my "manually written calculations". They are together on 1 list template.
My own calculations are written in default file for list template.
I can't create PDF for this list using my template with calculations.
I get an error:
Fatal error: Call to undefined method DOMText::getAttribute() in /var/www/cc.joomla/libraries/dompdf/include/cellmap.cls.php on line 437
Cellmap.cls.php is:
PHP:
$node = $frame->get_node();
// Determine where this cell is going
$colspan = $node->getAttribute("colspan");
$rowspan = $node->getAttribute("rowspan");
if ( !$colspan ) {
$colspan = 1;
$node->setAttribute("colspan",1);
}
if ( !$rowspan ) {
$rowspan = 1;
$node->setAttribute("rowspan",1);
}
$key = $frame->get_id();
$bp = $style->get_border_properties();
line 437 is:
$colspan = $node->getAttribute("colspan");
i use code like <td colspan="5"> for my custom calculations in file default.php
Exactly i would need in PDF "only summing part" on my list, = without table with records.
But now, on the beginning-to-get-PDF nothing is not send to PDF, PDF is not created at all.
Some piece of code for: /var/www/cc.joomla/components/com_fabrik/views/list/tmpl/default-2015-09-11-table-kp5/default.php
PHP:
<?php
/**
* Fabrik List Template: Default
*
* @package Joomla
* @subpackage Fabrik
* @copyright Copyright (C) 2005 Fabrik. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
//===================================.......
<?php
foreach ($group as $this->_row) :
echo $this->loadTemplate('row');
endforeach;
?>
<?php if ($this->hasCalculations) : ?>
<tr class="fabrik_calculations">
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
<td>6</td>
<td>7</td>
<td>8</td>
<td>9</td>
<td>10</td>
<td>11</td>
<td>12</td>
<td>13</td>
<td>14</td>
<td>15</td>
<td>16</td>
<td>17</td>
<td>18</td>
<td>19</td>
<td>20</td>
</tr>
<td><table class="rysio1">
<?php $h=0;
foreach ($this->calculations as $cal) {
if($h <= 1) {
echo '<tr>';
echo "<td>";
echo array_key_exists($groupedby, $cal->grouped) ? $cal->grouped[$groupedby] : $cal->calc;
echo "</td>";
echo "</tr>";
}
$h++;
}
?>
</table></td>
<td colspan="5"><table class="rysio1">
<?php $j=0;
echo '<tr class="fabrik_calculations">';
echo "<td>";
$db =& JFactory::getDBO();
$order1 =FabrikHelperElement::filterValue(11152); //with 81
echo "<br/>";
if (isset($order1)) {
$query = "SELECT `ip2_zamowienie_symbol1` FROM `ccjom_cc_kk_ip2_zamowienie` WHERE `id`= ".$order1." ";
$db->setQuery($query);
$result = $db->loadResult();
$zam1 = $result;
}
if ($order1==0) {
$zam1 = "Razem wszystkie zam?wienia";
}
echo " ---- <strong><font color='blue'> Zam?wienie nr: $zam1 </font></strong> ---- <br/><br/>";
echo "</td>";
foreach ($this->calculations as $cal) {
if($j>=4 and $j<= 4) {
echo '<tr class="fabrik_calculations">';
echo "<td>";
echo array_key_exists($groupedby, $cal->grouped) ? $cal->grouped[$groupedby] : $cal->calc, $j;
echo "</td>";
echo "</tr>";
}
$j++;
} ?>
<?php $n=0;
foreach ($this->calculations as $cal) {
if($n >= 19 and $n<20) {
echo '<tr class="fabrik_calculations">';
echo "<td>";
echo "Test2 --- <strong>Suma pakietow AA, AB, AC, AD:</strong> <br/><br/>";
$db =& JFactory::getDBO();
for ($i=1; $i<=5; $i++){
if ($order1==0){
$query = "SELECT `is_pak_xxxx`, `field_pakiety_analogowe` FROM `ccjom_cc_kk_karta_rejestr` WHERE ( `rodzaj_karty_np_wzorzec`= '2' and `field_pakiety_analogowe`=".$i.") ORDER BY `id`";
}
else {
$query = "SELECT `is_pak_xxxx`, `field_pakiety_analogowe` FROM `ccjom_cc_kk_karta_rejestr` WHERE ( `zamow_symbol`=".$order1." and `field_pakiety_analogowe`=".$i.") ORDER BY `id`";
}
$db->setQuery($query);
$result = $db->loadResult();
$resaa = mysql_query($query);
$rrraa=array();
$n=0;
while($row = mysql_fetch_array($resaa))
{
$rrraa[$n]= $row['is_pak_xxxx'];
$n++; }
if ($order1==0){
$query = "SELECT `is_pak_xxab`, `field_pakiety_analogowe` FROM `ccjom_cc_kk_karta_rejestr` WHERE ( `rodzaj_karty_np_wzorzec`= '2' and `field_pakiety_analogowe`=".$i.") ORDER BY `id`";
}
else {
$query = "SELECT `is_pak_xxab`, `field_pakiety_analogowe` FROM `ccjom_cc_kk_karta_rejestr` WHERE ( `zamow_symbol`=".$order1." and `field_pakiety_analogowe`=".$i.") ORDER BY `id`";
}
$db->setQuery($query);
$result = $db->loadResult();
$resab = mysql_query($query);
while($row = mysql_fetch_array($resab))
{
$rrraa[$n]= $row['is_pak_xxab'];
$n++;
}
if ($order1==0){
$query = "SELECT `is_pak_xxac`, `field_pakiety_analogowe` FROM `ccjom_cc_kk_karta_rejestr` WHERE ( `rodzaj_karty_np_wzorzec`= '2' and `field_pakiety_analogowe`=".$i.") ORDER BY `id`";
}
else {
$query = "SELECT `is_pak_xxac`, `field_pakiety_analogowe` FROM `ccjom_cc_kk_karta_rejestr` WHERE (`zamow_symbol`=".$order1." and `field_pakiety_analogowe`=".$i.") ORDER BY `id`";
}
$db->setQuery($query);
$result = $db->loadResult();
$resac = mysql_query($query);
while($row = mysql_fetch_array($resac))
{
$rrraa[$n]= $row['is_pak_xxac'];
$n++; }
if ($order1==0){
$query = "SELECT `is_pak_xxad`, `field_pakiety_analogowe` FROM `ccjom_cc_kk_karta_rejestr` WHERE ( `rodzaj_karty_np_wzorzec`= '2' and `field_pakiety_analogowe`=".$i.") ORDER BY `id`";
}
else {
$query = "SELECT `is_pak_xxad`, `field_pakiety_analogowe` FROM `ccjom_cc_kk_karta_rejestr` WHERE ( `zamow_symbol`=".$order1." and `field_pakiety_analogowe`=".$i.") ORDER BY `id`";
}
$db->setQuery($query);
$result = $db->loadResult();
$resad = mysql_query($query);
while($row = mysql_fetch_array($resad))
{
$rrraa[$n]= $row['is_pak_xxad'];
$n++; }
$newrrraa = array_count_values($rrraa);
foreach ($newrrraa as $key => $value) {
$query = "SELECT `is_pak_wejsc_analog_aa` FROM `ccjom_cc_kk_is_aa` WHERE `id`=$key ";
$db->setQuery($query);
$result2 = $db->loadResult();
$query3 = "SELECT `is_pak_wejsc_analog_n_i_w` FROM `ccjom_cc_kk_is_pak_wa` WHERE `id`=$i ";
$db->setQuery($query3);
$result3 = $db->loadResult();
echo "<strong> $result3 -- $result2 ---- <font color='red'>$value</font></strong> <br />"; }
}
echo "<br/>";
echo "</td>";
echo "</tr>";
}
$n++;
} ?>
<?php $j=0;
foreach ($this->calculations as $cal) {
if($j>=6 and $j<= 7) {
echo '<tr class="fabrik_calculations">';
echo "<td>";
echo array_key_exists($groupedby, $cal->grouped) ? $cal->grouped[$groupedby] : $cal->calc, $j;
echo "</td>";
echo "</tr>";
}
$j++;
} ?>
</table></td>
<td>7</td>
<td colspan="3"><table class="rysio1">
<?php $k=0;
foreach ($this->calculations as $cal) {
if($k >= 8 and $k<=10) {
echo '<tr class="fabrik_calculations">';
echo "<td>";
echo array_key_exists($groupedby, $cal->grouped) ? $cal->grouped[$groupedby] : $cal->calc, $k;
echo "</td>";
echo "</tr>";
}
$k++;
}
?>
//=================........
<?php $i=0;
foreach ($this->calculations as $cal) {
if($i >= 11 and $i<=18) {
echo '<tr class="fabrik_calculations">';
echo "<td>";
echo array_key_exists($groupedby, $cal->grouped) ? $cal->grouped[$groupedby] : $cal->calc;
echo "</td>";
echo "</tr>";}
$i++;}
echo "</table>";
echo "</td>";
echo "</tr>";
?>
</table>
</td>
</tr>
<?php endif;?>
</tbody>
<?php
$gCounter++;
endforeach;
$this->showGroup = false;
// If using AJAX then we need to add in enough groupdata containers for additonal rows that may be shown
//===================.........
my list is here:
http://candc.katowice.pl/index.php/menu-karta-produkcji/adm-rejestr-pak-prod3
Neccessary is login, should be actual login for Fabrik Staff in my profile.
Attachments
Last edited: