Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CiviCRM Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
CiviCRM Core
Commits
12990eb2
Unverified
Commit
12990eb2
authored
2 years ago
by
totten
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #23747 from eileenmcnaughton/import_contribution
Remove some more unused code
parents
1298898b
603928dc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CRM/Contribute/Import/Parser/Contribution.php
+8
-28
8 additions, 28 deletions
CRM/Contribute/Import/Parser/Contribution.php
templates/CRM/Contribute/Import/Form/Preview.tpl
+1
-1
1 addition, 1 deletion
templates/CRM/Contribute/Import/Form/Preview.tpl
with
9 additions
and
29 deletions
CRM/Contribute/Import/Parser/Contribution.php
+
8
−
28
View file @
12990eb2
...
...
@@ -201,6 +201,8 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Import_Parser {
* The initializer code, called before the processing
*/
public
function
init
()
{
// Force re-load of user job.
unset
(
$this
->
userJob
);
$this
->
setFieldMetadata
();
foreach
(
$this
->
getImportableFieldsMetadata
()
as
$name
=>
$field
)
{
$this
->
addField
(
$name
,
$field
[
'title'
],
$field
[
'type'
],
$field
[
'headerPattern'
],
$field
[
'dataPattern'
]);
...
...
@@ -212,7 +214,7 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Import_Parser {
*/
protected
function
setFieldMetadata
()
{
if
(
empty
(
$this
->
importableFieldsMetadata
))
{
$fields
=
CRM_Contribute_BAO_Contribution
::
importableFields
(
$this
->
_c
ontactType
,
FALSE
);
$fields
=
CRM_Contribute_BAO_Contribution
::
importableFields
(
$this
->
getC
ontactType
()
,
FALSE
);
$fields
=
array_merge
(
$fields
,
[
...
...
@@ -220,6 +222,7 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Import_Parser {
'title'
=>
ts
(
'Soft Credit'
),
'softCredit'
=>
TRUE
,
'headerPattern'
=>
'/Soft Credit/i'
,
'options'
=>
FALSE
,
],
]
);
...
...
@@ -250,29 +253,6 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Import_Parser {
}
}
/**
* Handle the values in summary mode.
*
* @param array $values
* The array of values belonging to this line.
*
* @return int
* CRM_Import_Parser::VALID or CRM_Import_Parser::ERROR
*/
public
function
summary
(
&
$values
)
{
$rowNumber
=
(
int
)
(
$values
[
array_key_last
(
$values
)]);
$params
=
$this
->
getMappedRow
(
$values
);
$errorMessage
=
implode
(
';'
,
$this
->
getInvalidValues
(
$params
));
$params
[
'contact_type'
]
=
'Contribution'
;
if
(
$errorMessage
)
{
$this
->
setImportStatus
(
$rowNumber
,
'ERROR'
,
"Invalid value for field(s) :
$errorMessage
"
);
return
CRM_Import_Parser
::
ERROR
;
}
return
CRM_Import_Parser
::
VALID
;
}
/**
* Handle the values in import mode.
*
...
...
@@ -302,15 +282,15 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Import_Parser {
if
(
$this
->
isSkipDuplicates
()
&&
(
!
empty
(
$paramValues
[
'contribution_contact_id'
])
||
!
empty
(
$paramValues
[
'external_identifier'
]))
)
{
$paramValues
[
'contact_type'
]
=
$this
->
_c
ontactType
;
$paramValues
[
'contact_type'
]
=
$this
->
getC
ontactType
()
;
}
elseif
(
$this
->
isUpdateExisting
()
&&
(
!
empty
(
$paramValues
[
'contribution_id'
])
||
!
empty
(
$values
[
'trxn_id'
])
||
!
empty
(
$paramValues
[
'invoice_id'
]))
)
{
$paramValues
[
'contact_type'
]
=
$this
->
_c
ontactType
;
$paramValues
[
'contact_type'
]
=
$this
->
getC
ontactType
()
;
}
elseif
(
!
empty
(
$paramValues
[
'pledge_payment'
]))
{
$paramValues
[
'contact_type'
]
=
$this
->
_c
ontactType
;
$paramValues
[
'contact_type'
]
=
$this
->
getC
ontactType
()
;
}
$formatError
=
$this
->
deprecatedFormatParams
(
$paramValues
,
$formatted
);
...
...
@@ -451,7 +431,7 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Import_Parser {
// Using new Dedupe rule.
$ruleParams
=
[
'contact_type'
=>
$this
->
_c
ontactType
,
'contact_type'
=>
$this
->
getC
ontactType
()
,
'used'
=>
'Unsupervised'
,
];
$fieldsArray
=
CRM_Dedupe_BAO_DedupeRule
::
dedupeRuleFields
(
$ruleParams
);
...
...
This diff is collapsed.
Click to expand it.
templates/CRM/Contribute/Import/Form/Preview.tpl
+
1
−
1
View file @
12990eb2
...
...
@@ -27,7 +27,7 @@
<p>
{
ts
}
Click 'Import Now' if you are ready to proceed.
{/
ts
}
</p>
</div>
<div
class=
"crm-submit-buttons"
>
{
include
file
=
"CRM/common/formButtons.tpl"
location
=
"top"
}
</div>
{
include
file
=
"CRM/common/importProgress.tpl"
}
{* Summary Preview (record counts) *}
<table
id=
"preview-counts"
class=
"report"
>
<tr><td
class=
"label crm-grid-cell"
>
{
ts
}
Total Rows
{/
ts
}
</td>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment