public function getHtmlImpressionItem($item, $options) { global $formxSession; global $compteurItem; if ($item->hasAttribute('dontPrintwhenNull')) { $options['dontPrintwhenNull'] = true; } $etape = $item->parentNode; //eko($item->getAttribute('id')); //eko($item->getElementsByTagname('rururu')->length); //Certains items ne peuvent être affichés if (in_array($item->getAttribute('type'), array('CLOSER', 'HIDDEN'))) { return ''; } //Certains items ne doivent pas être imprmmés if ($item->hasAttribute('dontPrint')) { return ''; } //print '<br />'.$domEtape->getAttribute('no_etape')._.$item['id'] ; if ($item->hasAttribute('access') && !$this->getSession()->getDroit($item->getAttribute('access'))) { return ''; } $hideItem = false; //---------------------------------------- if (count($item->getElementsByTagname('Cond')) > 0 && $item->getAttribute('lasttestcond') == 'n') { return ''; } $data = array(); $data['idItem'] = $item->getAttribute('id'); $data['print_lib_style'] = $item->getAttribute('print_lib_style'); $data['print_lib_class'] = $item->getAttribute('print_lib_class'); $data['print_val_style'] = $item->getAttribute('print_val_style'); $data['print_val_class'] = $item->getAttribute('print_val_class'); //eko('*'.$data['print_val_class'].'*'); $data['explication'] = $item->getElementsByTagname('Explication')->item(0)->nodeValue; $data['libelle'] = $item->getElementsByTagname('Libelle')->item(0)->nodeValue; $internalVal = $item->getElementsByTagname('Val')->item(0)->nodeValue; //si demande de saut de l'item quand il est nul if ($options['dontPrintwhenNull'] and !$internalVal || in_array((string) $internalVal, $this->session->getNullValues())) { //eko( (string) $item->Val); //eko( "<xmp>".$item->asXML()."</xmp>"); return; } //si demande de saut de l'item quand il est nul if ($item->hasAttribute('printOnlyWhenNull') and $internalVal and formxTools::transfo_str_2_bool($internalVal)) { //eko($this->session->getNullValues()); //eko( (string) $item->Val); //eko( "<xmp>".$item->asXML()."</xmp>"); return; } $nullvals = array('#', ''); $txt = $item->getElementsByTagname('Val')->item(0)->nodeValue; //eko($txt); //si cal; et qu'une valeur d'affichage differe de valeur de stockage if ($item->getAttribute('type') == 'CAL' && $item->getElementsByTagname('Val2')->length) { $txt = $item->getElementsByTagname('Val2')->item(0)->nodeValue; } //si check, et valeur de libelle différente if ($item->getAttribute('type') == 'CHECK' && $item->getElementsByTagname('FromListLibelles')->length) { $tablibsPossibles = formxTools::transfo_typeliste_2_array($item->getElementsByTagname('FromListLibelles')->item(0)->nodeValue); $tabValsPossibles = formxTools::transfo_typeliste_2_array($item->getElementsByTagname('FromList')->item(0)->nodeValue); $tabVals = formxTools::transfo_typeliste_2_array($item->getElementsByTagname('Val')->item(0)->nodeValue); $tabLibs = array(); for ($i = 0; $i < count($tabVals); $i++) { for ($j = 0; $j < count($tabValsPossibles); $j++) { if ($tabVals[$i] == $tabValsPossibles[$j]) { $tabLibs[] = $tablibsPossibles[$j]; } } } $txt = implode(' , ', $tablibsPossibles); } else { if ($item->getAttribute('type') == 'CHECK') { //eko("GNA"); $tabVals = formxTools::transfo_typeliste_2_array($item->getElementsByTagname('Val')->item(0)->nodeValue); $txt = implode(' , ', $tabVals); //eko($txt); } } if (in_array($txt, $nullvals)) { $txt = ''; } //si un code barre est demandé if ($item->hasAttribute('barcode')) { $txt = clFoRmXtOoLs::helper_html_barcode($txt, $item->getAttribute('barcode')); $data['print_val_class'] = 'barcode'; } if (preg_match('/^(.*)[\\t]{15}(.*)/', $txt, $tabMatches)) { $txt = $tabMatches[1]; } $valeur = $txt; if ($valeur == '') { $valeur = ' '; } //eko($valeur); $data['valeur'] = $valeur; //eko($valeur); $data['valeur'] = clFoRmXtOoLs::helper_str_mef($valeur); //application de styles return clFoRmXtOoLs::helpers_readTemplate('pdf_impression_item', $data); }