Loading install/iso/iso-3166-final.js +1 −985 File changed.Preview size limit exceeded, changes collapsed. Show changes install/iso/iso-3166.js +4 −1 Original line number Diff line number Diff line Loading @@ -14,6 +14,10 @@ fs.readFile(__dirname + '/iso-3166-src.xml', function(err, data) { let alpha2 = tr.td[2]._.replace(/(\r\n|\n|\r)/gm, "").replace(/\s\s+/g, ' ').trim(); let alpha3 = tr.td[3]._.replace(/(\r\n|\n|\r)/gm, "").replace(/\s\s+/g, ' ').trim(); let numeric = tr.td[4]._.replace(/(\r\n|\n|\r)/gm, "").replace(/\s\s+/g, ' ').trim(); // Petit coup de propre fr = fr.replace(/^(.*) \((la |La|l'|le|la|les)?\)\*?$/gm, '$1'); output.push({ "en" : en, "fr" : fr, Loading @@ -21,7 +25,6 @@ fs.readFile(__dirname + '/iso-3166-src.xml', function(err, data) { "alpha3" : alpha3, "numeric" : numeric }) }); console.log(JSON.stringify(output)); }); Loading module/Oscar/src/Oscar/Entity/Country3166Repository.php +1 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,7 @@ class Country3166Repository extends EntityRepository public function getAllForSelects() { $out = []; $out = ["" => "Non-définit"]; /** @var Country3166 $country */ foreach ($this->getAll() as $country) { $out[$country->getFr()] = $country->getFr(); Loading module/Oscar/src/Oscar/Form/OrganizationIdentificationForm.php +4 −0 Original line number Diff line number Diff line Loading @@ -276,6 +276,10 @@ class OrganizationIdentificationForm extends \Zend\Form\Form implements InputFil 'dateEnd'=> [ 'required' => false, ], 'country' => [ 'required' => false ] ]; } } No newline at end of file module/Oscar/src/Oscar/Service/OrganizationService.php +7 −4 Original line number Diff line number Diff line Loading @@ -651,10 +651,6 @@ class OrganizationService implements UseOscarConfigurationService, UseEntityMana $datas = json_decode(file_get_contents($referencielFilePath), true); $exists = $this->getCountries3166Repository()->allKeyByAlpha2(); if( count($exists) ){ var_dump($exists); die(); } foreach ($datas as $data) { // Création du pays Loading @@ -666,6 +662,13 @@ class OrganizationService implements UseOscarConfigurationService, UseEntityMana ->setEn($data['en']) ->setFr($data['fr']) ->setNumeric(intval($data['numeric'])); } else { $country = $exists[$data['alpha2']]; $country->setAlpha2($data['alpha2']) ->setAlpha3($data['alpha3']) ->setEn($data['en']) ->setFr($data['fr']) ->setNumeric(intval($data['numeric'])); } } $this->getEntityManager()->flush(); Loading Loading
install/iso/iso-3166-final.js +1 −985 File changed.Preview size limit exceeded, changes collapsed. Show changes
install/iso/iso-3166.js +4 −1 Original line number Diff line number Diff line Loading @@ -14,6 +14,10 @@ fs.readFile(__dirname + '/iso-3166-src.xml', function(err, data) { let alpha2 = tr.td[2]._.replace(/(\r\n|\n|\r)/gm, "").replace(/\s\s+/g, ' ').trim(); let alpha3 = tr.td[3]._.replace(/(\r\n|\n|\r)/gm, "").replace(/\s\s+/g, ' ').trim(); let numeric = tr.td[4]._.replace(/(\r\n|\n|\r)/gm, "").replace(/\s\s+/g, ' ').trim(); // Petit coup de propre fr = fr.replace(/^(.*) \((la |La|l'|le|la|les)?\)\*?$/gm, '$1'); output.push({ "en" : en, "fr" : fr, Loading @@ -21,7 +25,6 @@ fs.readFile(__dirname + '/iso-3166-src.xml', function(err, data) { "alpha3" : alpha3, "numeric" : numeric }) }); console.log(JSON.stringify(output)); }); Loading
module/Oscar/src/Oscar/Entity/Country3166Repository.php +1 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,7 @@ class Country3166Repository extends EntityRepository public function getAllForSelects() { $out = []; $out = ["" => "Non-définit"]; /** @var Country3166 $country */ foreach ($this->getAll() as $country) { $out[$country->getFr()] = $country->getFr(); Loading
module/Oscar/src/Oscar/Form/OrganizationIdentificationForm.php +4 −0 Original line number Diff line number Diff line Loading @@ -276,6 +276,10 @@ class OrganizationIdentificationForm extends \Zend\Form\Form implements InputFil 'dateEnd'=> [ 'required' => false, ], 'country' => [ 'required' => false ] ]; } } No newline at end of file
module/Oscar/src/Oscar/Service/OrganizationService.php +7 −4 Original line number Diff line number Diff line Loading @@ -651,10 +651,6 @@ class OrganizationService implements UseOscarConfigurationService, UseEntityMana $datas = json_decode(file_get_contents($referencielFilePath), true); $exists = $this->getCountries3166Repository()->allKeyByAlpha2(); if( count($exists) ){ var_dump($exists); die(); } foreach ($datas as $data) { // Création du pays Loading @@ -666,6 +662,13 @@ class OrganizationService implements UseOscarConfigurationService, UseEntityMana ->setEn($data['en']) ->setFr($data['fr']) ->setNumeric(intval($data['numeric'])); } else { $country = $exists[$data['alpha2']]; $country->setAlpha2($data['alpha2']) ->setAlpha3($data['alpha3']) ->setEn($data['en']) ->setFr($data['fr']) ->setNumeric(intval($data['numeric'])); } } $this->getEntityManager()->flush(); Loading