<commit_before><?php

require_once(dirname(__FILE__).'/../../odtphp/library/odf.php');
require_once(dirname(__FILE__).'/../../htmlconverter/library/htmlConverter.php');

/**
 * Zim
 * 
 * This class has been auto-generated by the Doctrine ORM Framework
 * 
 * @package    openZIM
 * @subpackage model
 * @author     <NAME>
 * @version    SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
 */
class Zim extends BaseZim
{
	public function getStunden()
	{
		return StundeTable::getStundenSorted($this->getId());
	}

        public function generateOdf()
	{
		$odf = new odf(dirname(__FILE__).'/../../odftmp/Zim_template.odt');
		$htmlConverter = new htmlConverter(true);
		$odf->setVars('nameZim',$this->getName(),true,'UTF-8');
		$odf->setVars('zieleZim',$htmlConverter->getODF($this->getZiele()),false,'UTF-8');
		$odf->setVars('zielGruppe',$htmlConverter->getODF($this->getZielGruppe()),false,'UTF-8');
		$odf->setVars('roterFaden',$htmlConverter->getODF($this->getRoterFaden()),false,'UTF-8');
		$koffer = $odf->setSegment('koffer');
		foreach($this->getStunden() AS $stunde) {
			foreach($stunde->getAnlagen() AS $anlage) {
			    $koffer->kuerzel($anlage->getKuerzel());
			    $koffer->lnr($anlage->getLnr());
			    $koffer->setVars('kofferInhalt',$htmlConverter->getODF($anlage->getKofferInfo()),false,'UTF-8');
			    $koffer->merge();
			}
		}
		$odf->mergeSegment($koffer);
		$stunden = $odf->setSegment('stunden');
		foreach($this->getStunden() AS $stunde) {
			$stunden->setVars('lnrStunde',$stunde->getLnr());
			$stunden->setVars('nameStunde',$stunde->getName(),true,'UTF-8');
			foreach($stunde->getAnlagen() AS $anlage) {
			    $stunden->anlagen->name($anlage->getName());
			    $stunden->anlagen->zeit($anlage->getZeit());
			    $stunden->anlagen->setVars('ziel',
				$htmlConverter->getODF($anlage->getZiel()), false,'UTF-8');
			    $stunden->anlagen->setVars('kurzinhalt',
				$htmlConverter->getODF($anlage->getKurzinhalt()), false,'UTF-8');
			    $stunden->anlagen->setVars('methode',
				$htmlConverter->getODF($anlage->getMethode()), false,'UTF-8');
			    $stunden->anlagen->setVars('rolletm',
				$htmlConverter->getODF($anlage->getRolleTm()), false,'UTF-8');
			    $stunden->anlagen->name2($anlage->getName());
			    $stunden->anlagen->setVars('material',
				$htmlConverter->getODF($anlage->getMaterial()), false,'UTF-8');
			    $stunden->anlagen->merge();
			}
			$stunden->merge();
		}
		$odf->mergeSegment($stunden);
		$odf->exportAsAttachedFile ('neuesZim.odt');  
        }
}
<commit_msg>Zim: use Anlage lnrStr for export<commit_after><?php

require_once(dirname(__FILE__).'/../../odtphp/library/odf.php');
require_once(dirname(__FILE__).'/../../htmlconverter/library/htmlConverter.php');

/**
 * Zim
 * 
 * This class has been auto-generated by the Doctrine ORM Framework
 * 
 * @package    openZIM
 * @subpackage model
 * @author     <NAME>
 * @version    SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
 */
class Zim extends BaseZim
{
	public function getStunden()
	{
		return StundeTable::getStundenSorted($this->getId());
	}

        public function generateOdf()
	{
		$odf = new odf(dirname(__FILE__).'/../../odftmp/Zim_template.odt');
		$htmlConverter = new htmlConverter(true);
		$odf->setVars('nameZim',$this->getName(),true,'UTF-8');
		$odf->setVars('zieleZim',$htmlConverter->getODF($this->getZiele()),false,'UTF-8');
		$odf->setVars('zielGruppe',$htmlConverter->getODF($this->getZielGruppe()),false,'UTF-8');
		$odf->setVars('roterFaden',$htmlConverter->getODF($this->getRoterFaden()),false,'UTF-8');
		$koffer = $odf->setSegment('koffer');
		foreach($this->getStunden() AS $stunde) {
			foreach($stunde->getAnlagen() AS $anlage) {
			    $koffer->kuerzel($anlage->getKuerzel());
			    $koffer->lnr($anlage->getLnrStr());
			    $koffer->setVars('kofferInhalt',$htmlConverter->getODF($anlage->getKofferInfo()),false,'UTF-8');
			    $koffer->merge();
			}
		}
		$odf->mergeSegment($koffer);
		$stunden = $odf->setSegment('stunden');
		foreach($this->getStunden() AS $stunde) {
			$stunden->setVars('lnrStunde',$stunde->getLnr());
			$stunden->setVars('nameStunde',$stunde->getName(),true,'UTF-8');
			foreach($stunde->getAnlagen() AS $anlage) {
			    $stunden->anlagen->name($anlage->getName());
			    $stunden->anlagen->zeit($anlage->getZeit());
			    $stunden->anlagen->setVars('ziel',
				$htmlConverter->getODF($anlage->getZiel()), false,'UTF-8');
			    $stunden->anlagen->setVars('kurzinhalt',
				$htmlConverter->getODF($anlage->getKurzinhalt()), false,'UTF-8');
			    $stunden->anlagen->setVars('methode',
				$htmlConverter->getODF($anlage->getMethode()), false,'UTF-8');
			    $stunden->anlagen->setVars('rolletm',
				$htmlConverter->getODF($anlage->getRolleTm()), false,'UTF-8');
			    $stunden->anlagen->name2($anlage->getName());
			    $stunden->anlagen->setVars('material',
				$htmlConverter->getODF($anlage->getMaterial()), false,'UTF-8');
			    $stunden->anlagen->merge();
			}
			$stunden->merge();
		}
		$odf->mergeSegment($stunden);
		$odf->exportAsAttachedFile ('neuesZim.odt');  
        }
}

{'fraction_non_alphanumeric': 0.218707015130674, 'fraction_numerical': 0.011790135586559246, 'mean_word_length': 4.618101545253863, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 135, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4801426', 'n_tokens_mistral': 2070, 'n_tokens_neox': 1916, 'n_words': 197}