wip migratie
This commit is contained in:
parent
8ed2f567fe
commit
ebb97de46b
|
@ -1,18 +0,0 @@
|
||||||
<?php
|
|
||||||
use CRM_Bij1migratie_ExtensionUtil as E;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Groepen aanmaken bij migratie als ze nog niet bestaan
|
|
||||||
*
|
|
||||||
* @author Erik Hommel(CiviCooP) <erik.hommel@civicoop.org>
|
|
||||||
* @license AGPL-3.0
|
|
||||||
*/
|
|
||||||
class CRM_Bij1migratie_Bij1Groep {
|
|
||||||
public function maakGroep(array $groepsData) {
|
|
||||||
|
|
||||||
}
|
|
||||||
public function bestaatGroep(string $groepsNaam) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -6,14 +6,14 @@
|
||||||
*
|
*
|
||||||
* Generated from bij1migratie/xml/schema/CRM/Bij1migratie/MigratieLog.xml
|
* Generated from bij1migratie/xml/schema/CRM/Bij1migratie/MigratieLog.xml
|
||||||
* DO NOT EDIT. Generated by CRM_Core_CodeGen
|
* DO NOT EDIT. Generated by CRM_Core_CodeGen
|
||||||
* (GenCodeChecksum:fa04d6440a14bf79c827d6d6564866c8)
|
* (GenCodeChecksum:186c4c3ad500e8ffcedca1378455c6d9)
|
||||||
*/
|
*/
|
||||||
use CRM_Bij1migratie_ExtensionUtil as E;
|
use CRM_Bij1migratie_ExtensionUtil as E;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Database access object for the MigratieLog entity.
|
* Database access object for the MigratieLog entity.
|
||||||
*/
|
*/
|
||||||
class CRM_Pcvmigratie_DAO_MigratieLog extends CRM_Core_DAO {
|
class CRM_Bij1migratie_DAO_MigratieLog extends CRM_Core_DAO {
|
||||||
const EXT = E::LONG_NAME;
|
const EXT = E::LONG_NAME;
|
||||||
const TABLE_ADDED = '';
|
const TABLE_ADDED = '';
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ class CRM_Pcvmigratie_DAO_MigratieLog extends CRM_Core_DAO {
|
||||||
'where' => 'civicrm_migratie_log.id',
|
'where' => 'civicrm_migratie_log.id',
|
||||||
'table_name' => 'civicrm_migratie_log',
|
'table_name' => 'civicrm_migratie_log',
|
||||||
'entity' => 'MigratieLog',
|
'entity' => 'MigratieLog',
|
||||||
'bao' => 'CRM_Pcvmigratie_DAO_MigratieLog',
|
'bao' => 'CRM_Bij1migratie_DAO_MigratieLog',
|
||||||
'localizable' => 0,
|
'localizable' => 0,
|
||||||
'html' => [
|
'html' => [
|
||||||
'type' => 'Number',
|
'type' => 'Number',
|
||||||
|
@ -125,7 +125,7 @@ class CRM_Pcvmigratie_DAO_MigratieLog extends CRM_Core_DAO {
|
||||||
'where' => 'civicrm_migratie_log.mollie_customer_id',
|
'where' => 'civicrm_migratie_log.mollie_customer_id',
|
||||||
'table_name' => 'civicrm_migratie_log',
|
'table_name' => 'civicrm_migratie_log',
|
||||||
'entity' => 'MigratieLog',
|
'entity' => 'MigratieLog',
|
||||||
'bao' => 'CRM_Pcvmigratie_DAO_MigratieLog',
|
'bao' => 'CRM_Bij1migratie_DAO_MigratieLog',
|
||||||
'localizable' => 0,
|
'localizable' => 0,
|
||||||
'html' => [
|
'html' => [
|
||||||
'type' => 'Text',
|
'type' => 'Text',
|
||||||
|
@ -140,7 +140,7 @@ class CRM_Pcvmigratie_DAO_MigratieLog extends CRM_Core_DAO {
|
||||||
'where' => 'civicrm_migratie_log.migratiedatum',
|
'where' => 'civicrm_migratie_log.migratiedatum',
|
||||||
'table_name' => 'civicrm_migratie_log',
|
'table_name' => 'civicrm_migratie_log',
|
||||||
'entity' => 'MigratieLog',
|
'entity' => 'MigratieLog',
|
||||||
'bao' => 'CRM_Pcvmigratie_DAO_MigratieLog',
|
'bao' => 'CRM_Bij1migratie_DAO_MigratieLog',
|
||||||
'localizable' => 0,
|
'localizable' => 0,
|
||||||
'html' => [
|
'html' => [
|
||||||
'type' => 'Select Date',
|
'type' => 'Select Date',
|
||||||
|
@ -158,7 +158,7 @@ class CRM_Pcvmigratie_DAO_MigratieLog extends CRM_Core_DAO {
|
||||||
'where' => 'civicrm_migratie_log.type_migratie',
|
'where' => 'civicrm_migratie_log.type_migratie',
|
||||||
'table_name' => 'civicrm_migratie_log',
|
'table_name' => 'civicrm_migratie_log',
|
||||||
'entity' => 'MigratieLog',
|
'entity' => 'MigratieLog',
|
||||||
'bao' => 'CRM_Pcvmigratie_DAO_MigratieLog',
|
'bao' => 'CRM_Bij1migratie_DAO_MigratieLog',
|
||||||
'localizable' => 0,
|
'localizable' => 0,
|
||||||
'html' => [
|
'html' => [
|
||||||
'type' => 'Text',
|
'type' => 'Text',
|
||||||
|
@ -175,7 +175,7 @@ class CRM_Pcvmigratie_DAO_MigratieLog extends CRM_Core_DAO {
|
||||||
'where' => 'civicrm_migratie_log.type_melding',
|
'where' => 'civicrm_migratie_log.type_melding',
|
||||||
'table_name' => 'civicrm_migratie_log',
|
'table_name' => 'civicrm_migratie_log',
|
||||||
'entity' => 'MigratieLog',
|
'entity' => 'MigratieLog',
|
||||||
'bao' => 'CRM_Pcvmigratie_DAO_MigratieLog',
|
'bao' => 'CRM_Bij1migratie_DAO_MigratieLog',
|
||||||
'localizable' => 0,
|
'localizable' => 0,
|
||||||
'html' => [
|
'html' => [
|
||||||
'type' => 'Text',
|
'type' => 'Text',
|
||||||
|
@ -192,7 +192,7 @@ class CRM_Pcvmigratie_DAO_MigratieLog extends CRM_Core_DAO {
|
||||||
'where' => 'civicrm_migratie_log.melding',
|
'where' => 'civicrm_migratie_log.melding',
|
||||||
'table_name' => 'civicrm_migratie_log',
|
'table_name' => 'civicrm_migratie_log',
|
||||||
'entity' => 'MigratieLog',
|
'entity' => 'MigratieLog',
|
||||||
'bao' => 'CRM_Pcvmigratie_DAO_MigratieLog',
|
'bao' => 'CRM_Bij1migratie_DAO_MigratieLog',
|
||||||
'localizable' => 0,
|
'localizable' => 0,
|
||||||
'html' => [
|
'html' => [
|
||||||
'type' => 'TextArea',
|
'type' => 'TextArea',
|
|
@ -4,7 +4,7 @@ namespace Civi\Api4;
|
||||||
/**
|
/**
|
||||||
* MigratieLog entity.
|
* MigratieLog entity.
|
||||||
*
|
*
|
||||||
* Provided by the FIXME extension.
|
* Provided by the Bij1Migratie extension.
|
||||||
*
|
*
|
||||||
* @package Civi\Api4
|
* @package Civi\Api4
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
* @date 13 Oct 2021
|
* @date 13 Oct 2021
|
||||||
* @license AGPL-3.0
|
* @license AGPL-3.0
|
||||||
*/
|
*/
|
||||||
namespace Civi\Pcvmigratie;
|
namespace Civi\Bij1migratie;
|
||||||
|
|
||||||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
||||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||||
use Symfony\Component\DependencyInjection\Definition;
|
use Symfony\Component\DependencyInjection\Definition;
|
||||||
use CRM_Aivlcsvimports_ExtensionUtil as E;
|
use CRM_Bij1migratie_ExtensionUtil as E;
|
||||||
|
|
||||||
class PcvMigratieContainer implements CompilerPassInterface {
|
class Bij1MigratieContainer implements CompilerPassInterface {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* You can modify the container here before it is dumped to PHP code.
|
* You can modify the container here before it is dumped to PHP code.
|
||||||
|
@ -23,67 +23,14 @@ class PcvMigratieContainer implements CompilerPassInterface {
|
||||||
$this->setAanhef($definition);
|
$this->setAanhef($definition);
|
||||||
$this->setGeslacht($definition);
|
$this->setGeslacht($definition);
|
||||||
$this->setFinancieelType($definition);
|
$this->setFinancieelType($definition);
|
||||||
$this->setLocationType($definition);
|
|
||||||
$this->setContributionStatus($definition);
|
$this->setContributionStatus($definition);
|
||||||
$this->setPaymentInstrument($definition);
|
$this->setPaymentInstrument($definition);
|
||||||
$this->setGroup($definition);
|
|
||||||
$this->setBankAccountReference($definition);
|
|
||||||
$definition->setPublic(TRUE);
|
$definition->setPublic(TRUE);
|
||||||
$container->setDefinition('paxMigratie', $definition);
|
$container->setDefinition('bij1Migratie', $definition);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method om iban bank account reference in te stellen
|
* Zet property voor betaal methode Mollie
|
||||||
*
|
|
||||||
* @param $definition
|
|
||||||
*/
|
|
||||||
private function setBankAccountReference(&$definition) {
|
|
||||||
$query = "SELECT cov.value
|
|
||||||
FROM civicrm_option_group AS cog JOIN civicrm_option_value AS cov ON cog.id = cov.option_group_id
|
|
||||||
WHERE cog.name = %1 AND cov.name = %2";
|
|
||||||
$ibanValue = \CRM_Core_DAO::singleValueQuery($query, [
|
|
||||||
1 => ["civicrm_banking.reference_types", "String"],
|
|
||||||
2 => ["IBAN", "String"],
|
|
||||||
]);
|
|
||||||
if ($ibanValue) {
|
|
||||||
$definition->addMethodCall('setIbanAccountReference', [$ibanValue]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method om groepsids op te slaan
|
|
||||||
*
|
|
||||||
* @param $definition
|
|
||||||
*/
|
|
||||||
private function setGroups(&$definition) {
|
|
||||||
$query = "SELECT id, name FROM civicrm_group WHERE name IN(%1, %2, %3, %4, %5, %6, %7)";
|
|
||||||
$dao = \CRM_Core_DAO::executeQuery($query, [
|
|
||||||
1 => ["bij1_migratie_groep", "String"],
|
|
||||||
2 => ["bij1_leden", "String"],
|
|
||||||
3 => ["bij1_betaling_gemist", "String"],
|
|
||||||
4 => ["bij1_ex_leden", "String"],
|
|
||||||
5 => ["bij1_nieuwe_leden", "String"],
|
|
||||||
6 => ["bij1_sociaal_tarief_leden", "String"],
|
|
||||||
7 => ["bij1_standaard_leden", "String"],
|
|
||||||
]);
|
|
||||||
while ($dao->fetch()) {
|
|
||||||
switch ($dao->name) {
|
|
||||||
case "bij1_migratie_groep":
|
|
||||||
$definition->addMethodCall('setMigratieGroepId', [(int) $dao->id]);
|
|
||||||
break;
|
|
||||||
case "bij1_leden":
|
|
||||||
$definition->addMethodCall('setLedenGroepId', [(int) $dao->id]);
|
|
||||||
break;
|
|
||||||
case "bij1_betaling_gemist":
|
|
||||||
$definition->addMethodCall('setBetalingGemistGroepId', [(int) $dao->id]);
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Zet property voor betaal methode cash
|
|
||||||
*
|
*
|
||||||
* @param $definition
|
* @param $definition
|
||||||
*/
|
*/
|
||||||
|
@ -131,19 +78,6 @@ class PcvMigratieContainer implements CompilerPassInterface {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Zet properties voor standaard locatie type
|
|
||||||
*
|
|
||||||
* @param $definition
|
|
||||||
*/
|
|
||||||
private function setLocationType(&$definition) {
|
|
||||||
$query = "SELECT id FROM civicrm_location_type WHERE is_default = TRUE;";
|
|
||||||
$id = \CRM_Core_DAO::singleValueQuery($query);
|
|
||||||
if ($id) {
|
|
||||||
$definition->addMethodCall('setLocationTypeId', [(int) $id]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Zet properties voor geslacht
|
* Zet properties voor geslacht
|
||||||
*
|
*
|
||||||
|
|
1
info.xml
1
info.xml
|
@ -20,6 +20,7 @@
|
||||||
<compatibility>
|
<compatibility>
|
||||||
<ver>5.0</ver>
|
<ver>5.0</ver>
|
||||||
</compatibility>
|
</compatibility>
|
||||||
|
<requires><ext>bij1algemeen</ext></requires>
|
||||||
<comments>Specifieke migratie extensie</comments>
|
<comments>Specifieke migratie extensie</comments>
|
||||||
<classloader>
|
<classloader>
|
||||||
<psr4 prefix="Civi\" path="Civi"/>
|
<psr4 prefix="Civi\" path="Civi"/>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="iso-8859-1" ?>
|
<?xml version="1.0" encoding="iso-8859-1" ?>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<base>CRM/Pcvmigratie</base>
|
<base>CRM/Bij1migratie</base>
|
||||||
<class>MigratieLog</class>
|
<class>MigratieLog</class>
|
||||||
<name>civicrm_migratie_log</name>
|
<name>civicrm_migratie_log</name>
|
||||||
<comment>Migratie Log Bij1</comment>
|
<comment>Migratie Log Bij1</comment>
|
||||||
|
|
Loading…
Reference in New Issue