Index: civicrm/trunk/sites/all/modules/civicrm/CRM/Utils/Rule.php |
— | — | @@ -161,7 +161,7 @@ |
162 | 162 | { |
163 | 163 | $result = $default; |
164 | 164 | if ( is_string( $value ) && |
165 | | - preg_match( '/^\d\d\d\d-?\d\d-?\d\d(\s\d\d:\d{1,2})?$/', $value ) ) { |
| 165 | + preg_match( '/^\d\d\d\d-?\d\d-?\d\d(\s\d\d:\d\d:\d\d|\d\d\d\d\d\d)?$/', $value ) ) { |
166 | 166 | $result = $value; |
167 | 167 | } |
168 | 168 | |
Index: civicrm/trunk/sites/all/modules/civicrm/CRM/Contribute/Form/Contribution.php |
— | — | @@ -494,8 +494,6 @@ |
495 | 495 | |
496 | 496 | if ( $this->_id ) { |
497 | 497 | $this->_contactID = $defaults['contact_id']; |
498 | | - } else { |
499 | | - list( $defaults['receive_date'] ) = CRM_Utils_Date::setDateDefaults( ); |
500 | 498 | } |
501 | 499 | |
502 | 500 | require_once 'CRM/Utils/Money.php'; |
— | — | @@ -567,11 +565,17 @@ |
568 | 566 | $dates = array( 'receive_date', 'receipt_date', 'cancel_date', 'thankyou_date' ); |
569 | 567 | foreach( $dates as $key ) { |
570 | 568 | if ( CRM_Utils_Array::value( $key, $defaults ) ) { |
571 | | - list( $defaults[$key] ) = CRM_Utils_Date::setDateDefaults( CRM_Utils_Array::value( $key, $defaults ) ); |
| 569 | + list( $defaults[$key], |
| 570 | + $defaults[$key.'_time'] ) = CRM_Utils_Date::setDateDefaults( CRM_Utils_Array::value( $key, $defaults ), 'activityDateTime' ); |
572 | 571 | } |
573 | 572 | } |
574 | 573 | |
575 | | - $this->assign( 'receive_date', CRM_Utils_Date::processDate( $defaults['receive_date'] ) ); |
| 574 | + if ( !$this->_id && !CRM_Utils_Array::value( 'receive_date', $defaults ) ) { |
| 575 | + list( $defaults['receive_date'], |
| 576 | + $defaults['receive_date_time'] ) = CRM_Utils_Date::setDateDefaults( null, 'activityDateTime' ); |
| 577 | + } |
| 578 | + |
| 579 | + $this->assign( 'receive_date', CRM_Utils_Date::processDate( $defaults['receive_date'], $params['receive_date_time'] ) ); |
576 | 580 | $this->assign( 'currency', CRM_Utils_Array::value( 'currency', $defaults ) ); |
577 | 581 | $this->assign( 'totalAmount', CRM_Utils_Array::value( 'total_amount', $defaults ) ); |
578 | 582 | |
Index: civicrm/trunk/sites/all/modules/civicrm/CRM/Contribute/Form/AdditionalInfo.php |
— | — | @@ -100,7 +100,7 @@ |
101 | 101 | |
102 | 102 | $attributes = CRM_Core_DAO::getAttribute( 'CRM_Contribute_DAO_Contribution' ); |
103 | 103 | |
104 | | - $this->addDate( 'thankyou_date', ts('Thank-you Sent'), false, array( 'formatType' => 'activityDate') ); |
| 104 | + $this->addDateTime( 'thankyou_date', ts('Thank-you Sent'), false, array( 'formatType' => 'activityDateTime') ); |
105 | 105 | |
106 | 106 | // add various amounts |
107 | 107 | $element =& $form->add( 'text', 'non_deductible_amount', ts('Non-deductible Amount'), |
— | — | @@ -254,7 +254,7 @@ |
255 | 255 | } |
256 | 256 | |
257 | 257 | if ( CRM_Utils_Array::value('thankyou_date', $params ) && ! CRM_Utils_System::isNull( $params['thankyou_date'] ) ) { |
258 | | - $formatted['thankyou_date'] = CRM_Utils_Date::processDate( $params['thankyou_date'] ); |
| 258 | + $formatted['thankyou_date'] = CRM_Utils_Date::processDate( $params['thankyou_date'], $params['thankyou_date_time'] ); |
259 | 259 | } else { |
260 | 260 | $formatted['thankyou_date'] = 'null'; |
261 | 261 | } |
Index: civicrm/trunk/sites/all/modules/civicrm/templates/CRM/Contribute/Form/ContributionView.tpl |
— | — | @@ -70,7 +70,7 @@ |
71 | 71 | |
72 | 72 | <tr> |
73 | 73 | <td class="label">{ts}Received{/ts}</td> |
74 | | - <td>{if $receive_date}{$receive_date|truncate:10:''|crmDate}{else}({ts}pending{/ts}){/if}</td> |
| 74 | + <td>{if $receive_date}{$receive_date|crmDate}{else}({ts}pending{/ts}){/if}</td> |
75 | 75 | </tr> |
76 | 76 | <tr> |
77 | 77 | <td class="label">{ts}Contribution Status{/ts}</td> |
— | — | @@ -81,7 +81,7 @@ |
82 | 82 | {if $cancel_date} |
83 | 83 | <tr> |
84 | 84 | <td class="label">{ts}Cancelled Date{/ts}</td> |
85 | | - <td>{$cancel_date|truncate:10:''|crmDate}</td> |
| 85 | + <td>{$cancel_date|crmDate}</td> |
86 | 86 | </tr> |
87 | 87 | {if $cancel_reason} |
88 | 88 | <tr> |
— | — | @@ -108,7 +108,7 @@ |
109 | 109 | {if $receipt_date} |
110 | 110 | <tr> |
111 | 111 | <td class="label">{ts}Receipt Sent{/ts}</td> |
112 | | - <td>{$receipt_date|truncate:10:''|crmDate}</td> |
| 112 | + <td>{$receipt_date|crmDate}</td> |
113 | 113 | </tr> |
114 | 114 | {/if} |
115 | 115 | {foreach from=$note item="rec"} |
— | — | @@ -143,7 +143,7 @@ |
144 | 144 | {if $thankyou_date} |
145 | 145 | <tr> |
146 | 146 | <td class="label">{ts}Thank-you Sent{/ts}</td> |
147 | | - <td>{$thankyou_date|truncate:10:''|crmDate}</td> |
| 147 | + <td>{$thankyou_date|crmDate}</td> |
148 | 148 | </tr> |
149 | 149 | {/if} |
150 | 150 | |
Index: civicrm/trunk/sites/all/modules/civicrm/templates/CRM/Contribute/Form/Contribution.tpl |
— | — | @@ -123,7 +123,7 @@ |
124 | 124 | {if !$contributionMode} |
125 | 125 | <tr> |
126 | 126 | <td class="label">{$form.receive_date.label}</td> |
127 | | - <td{$valueStyle}>{if $hideCalender neq true}{include file="CRM/common/jcalendar.tpl" elementName=receive_date}{else}{$receive_date|truncate:10:''|crmDate}{/if}<br /> |
| 127 | + <td{$valueStyle}>{if $hideCalender neq true}{include file="CRM/common/jcalendar.tpl" elementName=receive_date}{else}{$receive_date|crmDate}{/if}<br /> |
128 | 128 | <span class="description">{ts}The date this contribution was received.{/ts}</span> |
129 | 129 | </td> |
130 | 130 | </tr> |
Index: civicrm/trunk/sites/all/modules/civicrm/templates/CRM/Contribute/Form/Selector.tpl |
— | — | @@ -65,12 +65,12 @@ |
66 | 66 | </td> |
67 | 67 | <td>{$row.contribution_type}</td> |
68 | 68 | <td>{$row.contribution_source}</td> |
69 | | - <td>{$row.receive_date|truncate:10:''|crmDate}</td> |
70 | | - <td>{$row.thankyou_date|truncate:10:''|crmDate}</td> |
| 69 | + <td>{$row.receive_date|crmDate}</td> |
| 70 | + <td>{$row.thankyou_date|crmDate}</td> |
71 | 71 | <td> |
72 | 72 | {$row.contribution_status_id}<br /> |
73 | 73 | {if $row.cancel_date} |
74 | | - {$row.cancel_date|truncate:10:''|crmDate} |
| 74 | + {$row.cancel_date|crmDate} |
75 | 75 | {/if} |
76 | 76 | </td> |
77 | 77 | <td>{$row.product_name}</td> |
Index: civicrm/trunk/sites/all/modules/civicrm/api/v2/Contribute.php |
— | — | @@ -62,9 +62,11 @@ |
63 | 63 | return civicrm_create_error( ts( 'Input parameters is not an array' ) ); |
64 | 64 | } |
65 | 65 | |
66 | | - $error = _civicrm_contribute_check_params( $params ); |
67 | | - if ( civicrm_error( $error ) ) { |
68 | | - return $error; |
| 66 | + if ( !CRM_Utils_Array::value( 'id', $params ) ) { |
| 67 | + $error = _civicrm_contribute_check_params( $params ); |
| 68 | + if ( civicrm_error( $error ) ) { |
| 69 | + return $error; |
| 70 | + } |
69 | 71 | } |
70 | 72 | |
71 | 73 | $values = array( ); |