File tree Expand file tree Collapse file tree
templates/CRM/Admin/Form/Setting Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626class CRM_Admin_Form_Setting_BankingSettings extends CRM_Core_Form {
2727
2828 public function buildQuickForm () {
29+ $ importerOptions = [
30+ 'standard ' => E::ts ('Standard ' ),
31+ 'quick ' => E::ts ('Quick ' ),
32+ // 'both' => E::ts('Both'),
33+ ];
34+ $ this ->add (
35+ 'select ' ,
36+ 'banking_importer ' ,
37+ E::ts ('Importer ' ),
38+ $ importerOptions ,
39+ // is not required
40+ FALSE
41+ );
42+
2943 // add new UI (#200) options
3044 $ ui_options = [
3145 '1 ' => E::ts ('Simplified user interface ' ),
@@ -250,6 +264,8 @@ public function postProcess(): void {
250264 $ logger = CRM_Banking_Helpers_Logger::getLogger ();
251265 $ logger ->logDebug ("Log level changed to ' {$ values ['banking_log_level ' ]}', file is: {$ values ['banking_log_file ' ]}" );
252266
267+ Civi::settings ()->set ('banking_importer ' , $ values ['banking_importer ' ]);
268+
253269 parent ::postProcess ();
254270 }
255271
Original file line number Diff line number Diff line change @@ -81,6 +81,22 @@ function banking_civicrm_pageRun(&$page) {
8181 $ pageName = $ page ->getVar ('_name ' );
8282 if ($ pageName == 'CRM_Contribute_Page_Tab ' ) {
8383 CRM_Banking_BAO_BankTransactionContribution::injectLinkedTransactions ($ page );
84+ return ;
85+ }
86+
87+ if ($ pageName === CRM_Banking_Page_Import::class) {
88+ $ importUi = \Civi::settings ()->get ('banking_importer ' );
89+
90+ switch ($ importUi ) {
91+ case 'quick ' :
92+ \Civi::resources ()->addScriptFile (E::LONG_NAME , 'elements/civi-banking-import.js ' );
93+ \Civi::resources ()->addBundle ('bootstrap3 ' );
94+
95+ \CRM_Core_Region::instance ('page-body ' )->clear ();
96+ \CRM_Core_Region::instance ('page-body ' )->addMarkup ('<civi-banking-import /> ' );
97+ return ;
98+ }
99+ return ;
84100 }
85101}
86102
Original file line number Diff line number Diff line change 3838 <mixin >mgd-php@1.0.0</mixin >
3939 <mixin >smarty-v2@1.0.3</mixin >
4040 <mixin >entity-types-php@1.0.0</mixin >
41+ <mixin >setting-php@1.0.0</mixin >
4142 </mixins >
4243 <upgrader >CRM_Banking_Upgrader</upgrader >
4344</extension >
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ use CRM_Banking_ExtensionUtil as E ;
4+
5+ return [
6+ 'banking_importer ' => [
7+ 'name ' => 'banking_importer ' ,
8+ 'type ' => 'String ' ,
9+ 'html_type ' => 'select ' ,
10+ 'options ' => [
11+ 'standard ' => E::ts ('Standard ' ),
12+ 'quick ' => E::ts ('Quick ' ),
13+ //'both' => E::ts('Both'),
14+ ],
15+ 'is_domain ' => 1 ,
16+ 'is_contact ' => 0 ,
17+ 'title ' => E::ts ('Importer ' ),
18+ 'description ' => E::ts ('Choose to use the standard importer or the "quick" importer. ' ),
19+ ],
20+ ];
Original file line number Diff line number Diff line change 1515
1616<h3 >{ ts domain= ' org.project60.banking' } General Settings{ /ts} </h3 >
1717
18+ <div class =" crm-section" >
19+ <div class =" label" >{ $form .banking_importer.label} </div >
20+ <div class =" content" >{ $form .banking_importer.html} </div >
21+ <div class =" clear" ></div >
22+ </div >
23+
1824<div class =" crm-section" >
1925 <div class =" label" >{ $form .new_ui.label} </div >
2026 <div class =" content" >{ $form .new_ui.html} </div >
You can’t perform that action at this time.
0 commit comments