Commit 8b0533f0 authored by eileen's avatar eileen Committed by deb.monish

CRM-20572 Remove jcalendar from Contrib Sybunt custom Search

parent 6736b6f7
......@@ -83,7 +83,7 @@ class CRM_Contact_Form_Search_Custom_ContribSYBNT extends CRM_Contact_Form_Searc
foreach ($this->_dates as $name => $title) {
if (!empty($this->_formValues[$name])) {
$this->{$name} = CRM_Utils_Date::processDate($this->_formValues[$name]);
$this->{$name} = $this->_formValues[$name];
}
}
}
......@@ -101,7 +101,7 @@ class CRM_Contact_Form_Search_Custom_ContribSYBNT extends CRM_Contact_Form_Searc
}
foreach ($this->_dates as $name => $title) {
$form->addDate($name, $title, FALSE, array('formatType' => 'custom'));
$form->add('datepicker', $name, $title, array(), FALSE, array('time' => FALSE));
}
foreach ($this->_checkboxes as $name => $title) {
......@@ -194,7 +194,7 @@ ORDER BY donation_amount desc
if ($justIDs) {
CRM_Core_DAO::executeQuery("DROP TEMPORARY TABLE IF EXISTS CustomSearch_SYBNT_temp");
$query = "CREATE TEMPORARY TABLE CustomSearch_SYBNT_temp AS ({$sql})";
$dao = CRM_Core_DAO::executeQuery($query);
CRM_Core_DAO::executeQuery($query);
$sql = "SELECT contact_a.id as contact_id FROM CustomSearch_SYBNT_temp as contact_a";
}
return $sql;
......@@ -246,22 +246,22 @@ count(contrib_1.id) AS donation_count
$clauses = array();
if (!empty($this->start_date_1)) {
$clauses[] = "contrib_1.receive_date >= {$this->start_date_1}";
$clauses[] = CRM_Core_DAO::composeQuery('contrib_1.receive_date >= %1', array(1 => array($this->start_date_1, 'String')));
}
if (!empty($this->end_date_1)) {
$clauses[] = "contrib_1.receive_date <= {$this->end_date_1}";
$clauses[] = CRM_Core_DAO::composeQuery('contrib_1.receive_date <= %1', array(1 => array($this->end_date_1, 'String')));
}
if (!empty($this->start_date_2) || !empty($this->end_date_2)) {
$clauses[] = "contrib_2.is_test = 0";
if (!empty($this->start_date_2)) {
$clauses[] = "contrib_2.receive_date >= {$this->start_date_2}";
$clauses[] = CRM_Core_DAO::composeQuery('contrib_2.receive_date >= %1', array(1 => array($this->start_date_2, 'String')));
}
if (!empty($this->end_date_2)) {
$clauses[] = "contrib_2.receive_date <= {$this->end_date_2}";
$clauses[] = CRM_Core_DAO::composeQuery('contrib_2.receive_date <= %1', array(1 => array($this->end_date_2, 'String')));
}
}
......@@ -279,11 +279,11 @@ count(contrib_1.id) AS donation_count
$excludeClauses = array();
if ($this->exclude_start_date) {
$excludeClauses[] = "c.receive_date >= {$this->exclude_start_date}";
$excludeClauses[] = CRM_Core_DAO::composeQuery('c.receive_date >= %1', array(1 => array($this->exclude_start_date, 'String')));
}
if ($this->exclude_end_date) {
$excludeClauses[] = "c.receive_date <= {$this->exclude_end_date}";
$excludeClauses[] = CRM_Core_DAO::composeQuery('c.receive_date <= %1', array(1 => array($this->exclude_end_date, 'String')));
}
$excludeClause = NULL;
......@@ -317,7 +317,7 @@ GROUP BY c.contact_id
$havingClause
";
$dao = CRM_Core_DAO::executeQuery($query);
CRM_Core_DAO::executeQuery($query);
}
// now ensure we dont consider donors that are not first time
......@@ -329,7 +329,7 @@ FROM civicrm_contribution c
WHERE c.is_test = 0
AND c.receive_date < {$this->start_date_1}
";
$dao = CRM_Core_DAO::executeQuery($query);
CRM_Core_DAO::executeQuery($query);
}
$clauses[] = " xg.contact_id IS NULL ";
......
......@@ -297,7 +297,7 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector {
$contactQueryObj = $this->_search->getQueryObj();
}
$dao = CRM_Core_DAO::executeQuery($sql, CRM_Core_DAO::$_nullArray);
$dao = CRM_Core_DAO::executeQuery($sql);
$columns = $this->_search->columns();
$columnNames = array_values($columns);
......
......@@ -42,8 +42,8 @@
</tr>
<tr class="crm-contact-custom-search-contribSYBNT-form-block-inclusion_date_one">
<td><label>Inclusion Date One: Start/End</label></td>
<td>{include file="CRM/common/jcalendar.tpl" elementName=start_date_1}</td>
<td>{include file="CRM/common/jcalendar.tpl" elementName=end_date_1}</td>
<td>{$form.start_date_1.html}</td>
<td>{$form.end_date_1.html}</td>
<td>{$form.is_first_amount.html}&nbsp;{ts}First time donor only?{/ts}</td>
</tr>
<tr class="crm-contact-custom-search-contribSYBNT-form-block-min_amount_2">
......@@ -54,8 +54,8 @@
</tr>
<tr class="crm-contact-custom-search-contribSYBNT-form-block-inclusion_date_two">
<td><label>Inclusion Date Two: Start/End</label></td>
<td>{include file="CRM/common/jcalendar.tpl" elementName=start_date_2}</td>
<td>{include file="CRM/common/jcalendar.tpl" elementName=end_date_2}</td>
<td>{$form.start_date_2.html}</td>
<td>{$form.end_date_2.html}</td>
<td>&nbsp;</td>
</tr>
<tr class="crm-contact-custom-search-contribSYBNT-form-block-exclude_min_amount">
......@@ -66,8 +66,8 @@
</tr>
<tr class="crm-contact-custom-search-contribSYBNT-form-block-exclusion_date">
<td><label>Exclusion Date: Start/End</label></td>
<td>{include file="CRM/common/jcalendar.tpl" elementName=exclude_start_date}</td>
<td>{include file="CRM/common/jcalendar.tpl" elementName=exclude_end_date}</td>
<td>{$form.exclude_start_date.html}</td>
<td>{$form.exclude_end_date.html}</td>
<td>&nbsp;</td>
</tr>
</table>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment