Esempio n. 1
0
$adradmenhDAO = handleADRADMENH($srcBase, $uttrekkMySQLBase, $table_names['ADRADMENH_TABLE'], $logger);
$adrPersonDAO = handleADRPERSON($srcBase, $uttrekkMySQLBase, $table_names['ADRPERSON_TABLE'], $logger);
$aliasAdmDAO = handleALIASADM($srcBase, $uttrekkMySQLBase, $table_names['ALIASADM_TABLE'], $logger);
$avsmotDAO = handleAVSMOT($srcBase, $uttrekkMySQLBase, $table_names['AVSMOT_TABLE'], $logger);
$dokTilknDAO = handleDOKTILKN($srcBase, $uttrekkMySQLBase, $table_names['DOKTILKN_TABLE'], $logger);
$enhTypeDAO = handleENHTYPE($srcBase, $uttrekkMySQLBase, $table_names['ENHTYPE_TABLE'], $logger);
$medadrgrDAO = handleMEDADADRGR($srcBase, $uttrekkMySQLBase, $table_names['MEDADRGR_TABLE'], $logger);
//$perklarDAO = handlePERKLAR($srcBase, $uttrekkMySQLBase, $table_names['PERKLAR_TABLE'], $logger);
//$tilleggDAO =  handleTILLEGG($srcBase, $uttrekkMySQLBase, $table_names['TILLEGG_TABLE'], $logger);
$sakPartDAO = handleSAKPART($srcBase, $uttrekkMySQLBase, $table_names['SAKPART_TABLE'], $logger);
$statMDokDAO = handleSTATMDOK($srcBase, $uttrekkMySQLBase, $table_names['SAKPART_TABLE'], $logger);
$polsakgDAO = handlePOLSAKG($srcBase, $uttrekkMySQLBase, $table_names['POLSAKG_TABLE'], $logger);
$tlKodeDAO = handleTLKODE($srcBase, $uttrekkMySQLBase, $table_names['TLKODE_TABLE'], $logger);
// dokLink / dokVers / dokBesk are handled inside JOURPST, Creating DAO objects
// only to create extraction to XML
$dokVersDAO = new DokLinkDAO($srcBase, $uttrekkMySQLBase, $table_names['DOKLINK_TABLE'], $kommuneName, $logger);
$dokLinkDAO = new DokVersDAO($srcBase, $uttrekkMySQLBase, $table_names['DOKVERS_TABLE'], $kommuneName, $logger);
$dokBeskDAO = new DokBeskDAO($srcBase, $uttrekkMySQLBase, $table_names['DOKBESK_TABLE'], $kommuneName, $logger);
$utDokTypDAO = handleUTDOKTYPE($srcBase, $uttrekkMySQLBase, $table_names['UTVDOKTYPE_TABLE'], $logger);
$utvMoteDAO = handleUTVMOTE($srcBase, $uttrekkMySQLBase, $table_names['UTVMOTE_TABLE'], $logger);
$utvMoteDokDAO = new UtvMoteDokDAO($srcBase, $uttrekkMySQLBase, $table_names['UTVMOTEDOK_TABLE'], $logger);
$utvBehDoDAO = new UtvBehDoDAO($srcBase, $uttrekkMySQLBase, $table_names['UTVBEHDO_TABLE'], $logger);
$utvSakDAO = new UtvSakDAO($srcBase, $uttrekkMySQLBase, $table_names['UTVSAK_TABLE'], $logger, $utvBehDoDAO);
$utvBehDAO = handleUTVBEH($srcBase, $uttrekkMySQLBase, $table_names['UTVBEH_TABLE'], $logger, $utvSakDAO, $utvBehDoDAO);
$emneOrdDAO = new EmneOrdDAO($srcBase, $uttrekkMySQLBase, 'UNKNOWN', $logger);
//PERKLAR STATMDOK UTVDOKTYPE
$adminDelDAO->createXML($extractor);
$adradmenhDAO->createXML($extractor);
$adressekpDAO->createXML($extractor);
$adrPersonDAO->createXML($extractor);
$adrTypeDAO->createXML($extractor);
 function processTable()
 {
     $this->srcBase->createAndExecuteQuery($this->selectQuery);
     $counter = 1;
     $dokLinkDAO = new DokLinkDAO($this->srcBase, $this->uttrekksBase, Constants::getXMLFilename('JOURNPST'), $this->kommuneName, $this->logger);
     while ($result = $this->srcBase->getQueryResult($this->selectQuery)) {
         $journPst = new JournPst();
         // 				TODO : Do I ned this??
         //				if (substr($noarkJP->JP_ID, 0 , 2) > 30)
         //  					$journPst->JP_ID = "19" . $result['REFAARNR'];
         //    				else
         //					$journPst->JP_ID = "20" . $result['REFAARNR'];
         $journPst->JP_ID = $result['REFAARNR'];
         $journPst->JP_JAAR = $result['JOURAAR'];
         $journPst->JP_SEKNR = $result['REFNR'];
         $journPst->JP_SAID = $result['JOURAARNR'];
         // 				TODO : Do I ned this??
         //				if (substr($result['JOURAARNR'], 0, 2) > 30)
         //					$journPst->JP_SAID = "19" . $result['JOURAARNR'];
         //				else
         //					$journPst->JP_SAID = "20" . $result['JOURAARNR'];
         $journPst->JP_JDATO = Utility::fixDateFormat($result['REGDATO']);
         if (isset($result['TYPE']) == true) {
             $journPst->JP_NDOKTYPE = $result['TYPE'];
         } else {
             $journPst->JP_NDOKTYPE = Constants::DOKTYPE_IKKE_ANNGITT;
             $this->logger->log($this->XMLfilename, "JOURNALPOST JP_ID (" . $journPst->JP_ID . ") has null for JP.NDOKTYPE. Setting JP.NDOKTYPE to IA which stands for IKKE ANGITT. ", Constants::LOG_WARNING);
             $this->warningIssued = true;
         }
         $journPst->JP_DOKDATO = $result['DATERT'];
         $journPst->JP_UDATERT = 0;
         // $result['']; // TODO, why 0
         if (strcmp($result['STATUS'], '?') == 0) {
             $this->logger->log($this->XMLfilename, "JOURNALPOST JP_ID (" . $journPst->JP_ID . ") has status (" . $result['STATUS'] . ") Setting status to AVSLUTTET ", Constants::LOG_WARNING);
             $this->warningIssued = true;
             $journPst->JP_STATUS = 'A';
         } else {
             $journPst->JP_STATUS = $result['STATUS'];
         }
         $journPst->JP_INNHOLD = mysql_real_escape_string($result['INNH1']) . mysql_real_escape_string($result['INNH2']);
         if (isset($result['INNH1']) == false && isset($result['INNH2']) == false) {
             $journPst->JP_INNHOLD = "Ingen beskrivelse tigjenlig i kilde databasen";
             $this->logger->log($this->XMLfilename, "JOURNALPOST JP_ID (" . $journPst->JP_ID . ") is missing JP_INNHOLD. Set to 'Ingen beskrivelse tigjenlig i kilde databasen'", Constants::LOG_WARNING);
             $this->warningIssued = true;
         }
         // Check field isn't just whitespave
         if (strlen($journPst->JP_INNHOLD) > 0 && strlen(trim($journPst->JP_INNHOLD)) == 0) {
             $journPst->JP_INNHOLD = "Mangler innhold fra ESA. Bare mellomrom var innhold";
             $this->logger->log($this->XMLfilename, "JOURNALPOST JP_ID (" . $journPst->JP_ID . ") JP_INNHOLD only contains whitespace. Set to 'Mangler innhold fra ESA. Bare mellomrom var innhold'", Constants::LOG_WARNING);
             $this->warningIssued = true;
         }
         if (isset($result['U1']) == true) {
             $journPst->JP_U1 = $result['U1'];
         } else {
             $journPst->JP_U1 = '0';
         }
         $journPst->JP_AVSKDATO = Utility::fixDateFormat($result['AVSKRDATO']);
         $journPst->JP_FORFDATO = Utility::fixDateFormat($result['SVARFRIST']);
         $journPst->JP_UOFF = $result['HJEMMEL'];
         $journPst->JP_OVDATO = null;
         $journPst->JP_AGDATO = null;
         $journPst->JP_AGKODE = "";
         $journPst->JP_JPOSTNR = '1';
         $journPst->JP_TGKODE = $result['UNNTOFF'];
         $journPst->JP_TGGRUPPE = "";
         //				$journPst->JP_OVDATO = Utility::fixDateFormat($result['']);
         //				$journPst->JP_AGDATO = Utility::fixDateFormat($result['']);
         $journPst->JP_PAPIR = $result['PAPIR'];
         if ($result['VEDLEGG'] != null) {
             $journPst->JP_ANTVED = $result['VEDLEGG'];
         } else {
             $journPst->JP_ANTVED = 0;
         }
         $this->writeToDestination($journPst);
         $dokLinkDAO->processDokLinks($journPst, $result['SBHID'], $result['DOKKAT'], $result['PAPIR'], $result['LOKPAPIR'], $result['DOKSTATUS']);
         //				processDokBeskriv($journPst, $filerInfo);
         //	processDokVers($journPst, $filerInfo);
         $register = "S";
         /*				$nokkel = $result->SA_ID;
         				$untoff = $result->SA_TGKODE;
         				$gruppeId = $result->SA_TGGRUPPE;
         				$merknad = $result['MERKNAD'];
         				$sbhId = $noarkSak->SA_ANSVID;
         				//$this->merknad->processMerknadFromSakOrJP($register, $nokkel, $untoff, $gruppeId, $merknad, $sbhId);
         */
         if ($counter++ % Constants::DOT_MARKER_COUNT == 0) {
             echo ".";
         }
     }
     $this->srcBase->endQuery($this->selectQuery);
 }