Skip to content

Commit

Permalink
fixed: list email plugin gave sql error
Browse files Browse the repository at this point in the history
  • Loading branch information
pollen8 committed Aug 21, 2012
1 parent da362e6 commit 330fea7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ PLG_LIST_EMAIL_BUTTON_LOCATION_DESC="Where should the button to send the emails

;FRONT END

PLG_LIST_EMAIL_ERR_NO_TO_ELEMENT_SELECTED="No 'to' field selected"
PLG_LIST_EMAIL_EMAIL="Email"
PLG_LIST_EMAIL_ATTACHMENTS="Attachments"
PLG_LIST_EMAIL_EMAIL="Email"
Expand Down
25 changes: 16 additions & 9 deletions plugins/fabrik_list/email/models/email.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class plgFabrik_ListEmail extends plgFabrik_List
/**
* pop up window
*
* @depreacted - not used
* @deprecated - not used
*
* @return void
*/
Expand Down Expand Up @@ -114,11 +114,11 @@ function getToField()
{
$to = $params->get('emailtable_to');
$to = is_array($to) ? $to[$renderOrder] : $to;
return '<input name="order_by" id="order_by" value="' . $to . '" readonly="true" />';
return '<input name="list_email_to" id="list_email_to" value="' . $to . '" readonly="true" />';
}
else
{
return $this->formModel->getElementList('order_by');
return $this->formModel->getElementList('list_email_to');
}
}

Expand Down Expand Up @@ -149,8 +149,8 @@ public function getMessage()
/**
* Get the selected records
*
* @param string $key key
* @param bool $allData data
* @param string $key key
* @param bool $allData data
*
* @return array rows
*/
Expand Down Expand Up @@ -195,12 +195,11 @@ public function getRecords($key = 'ids', $allData = false)

/**
* Upload the attachments to the server
* @access private
*
* @return bol success/fail
*/

function _upload()
private function _upload()
{
jimport('joomla.filesystem.file');
jimport('joomla.client.helper');
Expand Down Expand Up @@ -242,18 +241,26 @@ public function doEmail()
{
return false;
}
$listModel->setId(JRequest::getInt('id', 0));
$listId = JRequest::getInt('id', 0);
$this->setId($listId);
$listModel->setId($listId);
$w = new FabrikWorker;
$config = JFactory::getConfig();
$params = $this->getParams();
$to = JRequest::getVar('order_by');
$to = JRequest::getVar('list_email_to');
$renderOrder = JRequest::getInt('renderOrder');
$toType = $params->get('emailtable_to_type', 'list');
$fromUser = $params->get('emailtable_from_user');
if ($toType == 'list')
{
$to = str_replace('.', '___', $to);
}

if ($toType == 'list' && $to == '')
{
JError::raiseError(500, JText::_('PLG_LIST_EMAIL_ERR_NO_TO_ELEMENT_SELECTED'));
exit;
}
$subject = JRequest::getVar('subject');
$message = JRequest::getVar('message', '', 'post', 'string', 4);
$data = $this->getRecords('recordids', true);
Expand Down

0 comments on commit 330fea7

Please sign in to comment.