-
-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert pledge date fields to use datepicker rather than jcalendar #15170
Convert pledge date fields to use datepicker rather than jcalendar #15170
Conversation
(Standard links)
|
2e9af46
to
e162553
Compare
CRM/Pledge/Form/Search.php
Outdated
$this->addSearchFieldMetadata(['Pledge' => CRM_Pledge_BAO_Query::getSearchFieldMetadata()]); | ||
$this->addSearchFieldMetadata(['PledgePayment' => CRM_Pledge_BAO_Query::getPledgePaymentSearchFieldMetadata()]); | ||
$this->addFormFieldsFromMetadata(); | ||
$this->setFormValues(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this is a change from the approach elsewhere - if I look at CRM_Contribute_Form_Search we are relying on this being done in parent::setDefaults (which would run here too) or in preProcess - which is not very 'mature' in that the forms are not sharing a function.
I'm gonna poke around a bit more on this one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't see how parent::setDefaults was setting the formValues where as setFormValues was calling setDefaults() and this is in the situation where we have &force=1 in the URL param
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok i think re-looking at the Contribute search this function is actually called in the postProcess function so i'll move it there
CRM/Pledge/BAO/Query.php
Outdated
@@ -82,6 +82,12 @@ public static function select(&$query) { | |||
$query->_tables['civicrm_pledge'] = $query->_whereTables['civicrm_pledge'] = 1; | |||
} | |||
|
|||
if (!empty($query->_returnProperties['pledge_end_date'])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm this shouldn't be needed - I will look & try to see why it was
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was how i fixed an issue with the api_v3_SyntaxConformanceTest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK - it's in SELECT not WHERE - which I guess is where we've been focussing cleanup
xml/schema/Pledge/Pledge.xml
Outdated
</html> | ||
<uniqueName>pledge_end_date</uniqueName> | ||
<uniqueTitle>Payments Ended Date</uniqueTitle> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK this confused me - I think it should be pledge end date
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eileenmcnaughton why? i thought unique title was for the search form but title would be the more standard pledge end date
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK - I looks like it's unchanged in the UI so perhaps it's just me that thought pledge end made sense
e162553
to
18b01ec
Compare
@seamuslee001 so when all the metadata is being called all those _low & _high bits are obsolete (which is good because they do bad stuff). I've been trying this - but I haven't tried the payment one yet. Perhaps we should do all the xml changes first & merge?
|
possibly but the XML change will require the change to the return properties stuff tho. I guess i can see where your going with that |
@seamuslee001 we need to stop them being converted because otherwise it saves a fixed date not a relative one & relies on magic that won't work to make relative |
@eileenmcnaughton i think i got the relative dates sorted but i found that i still needed the code in the |
5b99a12
to
15a4e98
Compare
@eileenmcnaughton i have rebased this now that the xml changes have been merged |
Add support for url variables Standardise search form as per contribute form Add in pledge payment xml change
15a4e98
to
c485300
Compare
test this please |
In my tests I found
|
@eileenmcnaughton do we need to update civicrm_mapping_field and civicrm_uf_field at all? |
@seamuslee001 for mapping I believe you had to update ExportTest in order to change the field names - if so I guess we could update those fields in mapping_field. For import I wouldn't touch it - the way that code works it's using labels instead of names! |
@seamuslee001 I also figured out what has to happen for urlsearch params to work in advanced search - this makes it work for contribute civicrm-core/CRM/Contact/Form/Search.php Line 917 in f90f8d3
|
@eileenmcnaughton in terms of the mapping_field_id i just wonder if it needs to be name spaced, maybe should leave it and see if anyone jumps? |
@seamuslee001 yes perhaps - I think we have in practice handled updates to export mappings sometimes & not been called out when we have missed a beat - probably because mappings are generally used infrequently and there is no major ramification of it not being updated, unlike smart groups which can have complex unexpected outcomes |
yay |
Overview
This PR converts the pledge form dates to use date picker rather than jcalendar and in the process renames the field pledge_payment_date on search forms to be pledge_payment_scheduled_date
Before
Jcalendar date field used
After
date picker used
Sideeffects are
civicrm/pledge/search?reset=1&pledge_end_date_relative=this.month&force=1
civicrm/pledge/search?reset=1&pledge_start_date_relative=this.month&force=1
ping @eileenmcnaughton