From 04d7edfe445843c1b157529e28c3ed18a8e1c45f Mon Sep 17 00:00:00 2001 From: systopia Date: Fri, 24 Jan 2014 20:52:05 +0100 Subject: [PATCH 1/5] fixed some defaults --- extension/CRM/Banking/PluginImpl/CSVImporter.php | 2 +- .../CRM/Banking/PluginImpl/Matcher/ExistingContribution.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extension/CRM/Banking/PluginImpl/CSVImporter.php b/extension/CRM/Banking/PluginImpl/CSVImporter.php index bd009e73..eb99a56a 100755 --- a/extension/CRM/Banking/PluginImpl/CSVImporter.php +++ b/extension/CRM/Banking/PluginImpl/CSVImporter.php @@ -309,7 +309,7 @@ protected function apply_rule($rule, $line, &$btx, $header) { // TRIM will strip the string of $params = explode(":", $rule->type); if (isset($params[1])) { - // the user provided a date format + // the user provided a the trim parameters $btx[$rule->to] = trim($value, $params[1]); } else { $btx[$rule->to] = trim($value); diff --git a/extension/CRM/Banking/PluginImpl/Matcher/ExistingContribution.php b/extension/CRM/Banking/PluginImpl/Matcher/ExistingContribution.php index 7033425c..8f10293e 100644 --- a/extension/CRM/Banking/PluginImpl/Matcher/ExistingContribution.php +++ b/extension/CRM/Banking/PluginImpl/Matcher/ExistingContribution.php @@ -20,7 +20,7 @@ function __construct($config_name) { $config = $this->_plugin_config; if (!isset($config->threshold)) $config->threshold = 0.5; if (!isset($config->mode)) $config->mode = "default"; // other mode is "cancellation" - if (!isset($config->accepted_contribution_states)) $config->accepted_contribution_states = ["Completed", "Pending"]; + if (!isset($config->accepted_contribution_states)) $config->accepted_contribution_states = array("Completed", "Pending"); if (!isset($config->received_date_minimum)) $config->received_date_minimum = "-100 days"; if (!isset($config->received_date_maximum)) $config->received_date_maximum = "+1 days"; if (!isset($config->date_penalty)) $config->date_penalty = 1.0; From d03c4671fa028d082f1b29f83a32c3c77d6b7c31 Mon Sep 17 00:00:00 2001 From: systopia Date: Fri, 24 Jan 2014 20:52:38 +0100 Subject: [PATCH 2/5] fixed a bug in the value propagation --- extension/CRM/Banking/PluginModel/Matcher.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/extension/CRM/Banking/PluginModel/Matcher.php b/extension/CRM/Banking/PluginModel/Matcher.php index 30591b90..80f42bfe 100755 --- a/extension/CRM/Banking/PluginModel/Matcher.php +++ b/extension/CRM/Banking/PluginModel/Matcher.php @@ -217,8 +217,9 @@ public function getPropagationValue($btx, $key) { return $btx->$key_bits[1]; } else { // look in the parsed values - if (isset($btx->getDataParsed()->$key_bits[1])) { - return $btx->getDataParsed()->$key_bits[1]; + $data = $btx->getDataParsed(); + if (isset($data[$key_bits[1]])) { + return $data[$key_bits[1]]; } else { return NULL; } From 9a9a286de862e468d28931e1a1a4651c8bc055c8 Mon Sep 17 00:00:00 2001 From: systopia Date: Wed, 29 Jan 2014 15:25:33 +0100 Subject: [PATCH 3/5] FIX: move bank accounts when merging contacts --- extension/hooks.php | 21 +++++++++++++++++++++ extension/info.xml | 2 +- extension/versions.txt | 4 ++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/extension/hooks.php b/extension/hooks.php index 81a3606d..211612d9 100755 --- a/extension/hooks.php +++ b/extension/hooks.php @@ -148,4 +148,25 @@ function banking_civicrm_tabs( &$tabs, $contactID ) { 'title' => ts("Bank Accounts"), 'weight' => 95, 'count' => $count_query->acCount)); +} + + +/* bank accounts in merge operations + */ +function banking_civicrm_merge ( $type, &$data, $mainId = NULL, $otherId = NULL, $tables = NULL ) { + switch ($type) { + case 'relTables': + // Offer user to merge SEPA Mandates + $data['rel_table_bankaccounts'] = array( + 'title' => ts('Bank Accounts'), + 'tables' => array('civicrm_bank_account'), + 'url' => CRM_Utils_System::url('civicrm/contact/view', 'reset=1&cid=$cid&selectedChild=bank_accounts'), // '$cid' will be automatically replaced + ); + break; + + case 'cidRefs': + // this is the only field that needs to be modified + $data['civicrm_bank_account'] = array('contact_id'); + break; + } } \ No newline at end of file diff --git a/extension/info.xml b/extension/info.xml index 969fde69..afd75e1c 100755 --- a/extension/info.xml +++ b/extension/info.xml @@ -9,7 +9,7 @@ project-60@ml.foebud.org 2014-01-15 - 0.3.1 + 0.3.2 alpha 4.4 diff --git a/extension/versions.txt b/extension/versions.txt index 6ce7f56b..f396145c 100644 --- a/extension/versions.txt +++ b/extension/versions.txt @@ -1,6 +1,10 @@ Version History =============== +version 0.3.2 +============= +- FIX: move bank accounts when merging contacts + version 0.3.1 ============= From 41796066e650f477cc9315303db485acc10fe8ec Mon Sep 17 00:00:00 2001 From: systopia Date: Wed, 29 Jan 2014 15:34:28 +0100 Subject: [PATCH 4/5] menu translation --- extension/hooks.php | 12 ++++++------ extension/versions.txt | 2 +- l10n/CiviBanking.pot | 16 ++++++++++------ l10n/CiviBanking_de_DE.po | 17 +++++++++++------ 4 files changed, 28 insertions(+), 19 deletions(-) diff --git a/extension/hooks.php b/extension/hooks.php index 211612d9..37ee8fb3 100755 --- a/extension/hooks.php +++ b/extension/hooks.php @@ -31,7 +31,7 @@ function banking_civicrm_navigationMenu(&$params) { 'child' => array( $level => array( 'attributes' => array( - 'label' => 'Dashboard', + 'label' => ts('Dashboard'), 'name' => 'Dashboard', 'url' => 'civicrm/banking/dashboard', 'permission' => 'access CiviContribute', @@ -45,7 +45,7 @@ function banking_civicrm_navigationMenu(&$params) { ), $level => array( 'attributes' => array( - 'label' => 'Payments', + 'label' => ts('Show Statements'), 'name' => 'Payments', 'url' => 'civicrm/banking/payments', 'permission' => 'access CiviContribute', @@ -59,7 +59,7 @@ function banking_civicrm_navigationMenu(&$params) { ), $level => array( 'attributes' => array( - 'label' => 'Find Accounts', + 'label' => ts('Find Accounts'), 'name' => 'Find Accounts', 'url' => 'civicrm/banking/search', 'permission' => 'access CiviContribute', @@ -73,7 +73,7 @@ function banking_civicrm_navigationMenu(&$params) { ), $level => array( 'attributes' => array( - 'label' => 'Manage Accounts', + 'label' => ts('Manage Accounts'), 'name' => 'Manage Accounts', 'url' => 'civicrm/banking/accounts', 'permission' => 'access CiviContribute', @@ -87,7 +87,7 @@ function banking_civicrm_navigationMenu(&$params) { ), $level => array( 'attributes' => array( - 'label' => 'Import Payments', + 'label' => ts('Import Payments'), 'name' => 'Import Payments', 'url' => 'civicrm/banking/import', 'permission' => 'access CiviContribute', @@ -101,7 +101,7 @@ function banking_civicrm_navigationMenu(&$params) { ), $level => array( 'attributes' => array( - 'label' => 'Configuration', + 'label' => ts('Configuration'), 'name' => 'Configuration', 'url' => 'civicrm/banking/manager', 'permission' => 'access CiviContribute', diff --git a/extension/versions.txt b/extension/versions.txt index f396145c..7c0cf6c0 100644 --- a/extension/versions.txt +++ b/extension/versions.txt @@ -4,7 +4,7 @@ Version History version 0.3.2 ============= - FIX: move bank accounts when merging contacts - +- FIX: translated menu version 0.3.1 ============= diff --git a/l10n/CiviBanking.pot b/l10n/CiviBanking.pot index 8bbd202d..712d30a0 100644 --- a/l10n/CiviBanking.pot +++ b/l10n/CiviBanking.pot @@ -238,7 +238,7 @@ msgstr "" msgid "Warning: bad matcher evidence" msgstr "" -#: on/CRM/Banking/Page/AccountSearch.php +#: on/CRM/Banking/Page/AccountSearch.php on/hooks.php msgid "Find Accounts" msgstr "" @@ -291,7 +291,7 @@ msgid "Manage CiviBanking Components" msgstr "" #: on/CRM/Banking/Page/Payments.php -#: on/CRM/Banking/PluginImpl/Matcher/Batches.php +#: on/CRM/Banking/PluginImpl/Matcher/Batches.php on/hooks.php msgid "Payments" msgstr "" @@ -496,7 +496,7 @@ msgstr "" msgid "Show Statements" msgstr "" -#: templates/CRM/Banking/Page/Payments.tpl +#: templates/CRM/Banking/Page/Payments.tpl on/hooks.php msgid "Show Payments" msgstr "" @@ -806,15 +806,15 @@ msgstr "" msgid "Back" msgstr "" -#: menu entry +#: menu entry on/hooks.php msgid "Manage Accounts" msgstr "" -#: menu entry +#: menu entry on/hooks.php msgid "Import Payments" msgstr "" -#: menu entry +#: menu entry on/hooks.php msgid "Configuration" msgstr "" @@ -1088,3 +1088,7 @@ msgstr "" #: templates/CRM/Banking/Page/Review.tpl msgid "Skip Processed" msgstr "" + +#: on/hooks.php +msgid "Dashboard" +msgstr "" diff --git a/l10n/CiviBanking_de_DE.po b/l10n/CiviBanking_de_DE.po index 1f0ada23..44bc4114 100644 --- a/l10n/CiviBanking_de_DE.po +++ b/l10n/CiviBanking_de_DE.po @@ -237,7 +237,7 @@ msgstr "Programmfehler: Wahrscheinlichkeitsangabe außerhalb von [0..1], wird al msgid "Warning: bad matcher evidence" msgstr "Warnung: Schlechte Matcher-Evidenzen" -#: on/CRM/Banking/Page/AccountSearch.php +#: on/CRM/Banking/Page/AccountSearch.php on/hooks.php msgid "Find Accounts" msgstr "Konten finden" @@ -290,7 +290,7 @@ msgid "Manage CiviBanking Components" msgstr "CiviBanking-Komponenten verwalten" #: on/CRM/Banking/Page/Payments.php -#: on/CRM/Banking/PluginImpl/Matcher/Batches.php +#: on/CRM/Banking/PluginImpl/Matcher/Batches.php on/hooks.php msgid "Payments" msgstr "Zahlungen" @@ -495,7 +495,7 @@ msgstr "Profil hinzufügen" msgid "Show Statements" msgstr "Kontoauszüge anzeigen" -#: templates/CRM/Banking/Page/Payments.tpl +#: templates/CRM/Banking/Page/Payments.tpl on/hooks.php msgid "Show Payments" msgstr "Zahlungen anzeigen" @@ -799,15 +799,15 @@ msgstr "Keine Kontoauszüge mit dem gewählten Stats gefunden. Wählen Sie ggf. msgid "Back" msgstr "Zurück" -#: menu entry +#: menu entry on/hooks.php msgid "Manage Accounts" msgstr "Konten verwalten" -#: menu entry +#: menu entry on/hooks.php msgid "Import Payments" msgstr "Zahlungen importieren" -#: menu entry +#: menu entry on/hooks.php msgid "Configuration" msgstr "Konfiguration" @@ -1074,6 +1074,11 @@ msgstr "" msgid "Skip Processed" msgstr "Nächste Unbearbeitete" +#: on/hooks.php +#, fuzzy +msgid "Dashboard" +msgstr "CiviBanking Übersicht" + #, fuzzy #~ msgid "Payment count<" #~ msgstr "Anzahl" From 821de9dbf11935a26eb46e179a84c7146da6adc5 Mon Sep 17 00:00:00 2001 From: systopia Date: Thu, 30 Jan 2014 10:07:50 +0100 Subject: [PATCH 5/5] added value propagation fix release note --- extension/versions.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extension/versions.txt b/extension/versions.txt index 7c0cf6c0..db57e3b5 100644 --- a/extension/versions.txt +++ b/extension/versions.txt @@ -5,6 +5,8 @@ version 0.3.2 ============= - FIX: move bank accounts when merging contacts - FIX: translated menu +- FIX: value propagation in some matchers + version 0.3.1 =============