1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-05 06:07:32 +02:00

More Admin->Mailout fixes and form inline fix for apostrophes.

This commit is contained in:
Cameron
2014-10-14 02:12:13 -07:00
parent f644b7b8a3
commit ca3be14770
3 changed files with 48 additions and 14 deletions

View File

@@ -2690,7 +2690,15 @@ class e_form
*/
private function renderInline($dbField, $pid, $fieldName, $curVal, $linkText, $type='text', $array=null)
{
$source = str_replace('"',"'",json_encode($array, JSON_FORCE_OBJECT)); // SecretR - force object, fix number of bugs
$jsonArray = array();
foreach($array as $k=>$v)
{
$jsonArray[$k] = str_replace("'", "`", $v);
}
$source = str_replace('"',"'",json_encode($jsonArray, JSON_FORCE_OBJECT)); // SecretR - force object, fix number of bugs
$mode = preg_replace('/[^\w]/', '', vartrue($_GET['mode'], ''));
$text = "<a class='e-tip e-editable editable-click' data-name='".$dbField."' ";
@@ -3276,10 +3284,15 @@ class e_form
// Inline Editing.
if(!vartrue($attributes['noedit']) && vartrue($parms['editable'])) // avoid bad markup, better solution coming up
{
$mode = preg_replace('/[^\w]/', '', vartrue($_GET['mode'], ''));
$methodParms = call_user_func_array(array($this, $method), array($value, 'inline', $parms));
$source = str_replace('"',"'",json_encode($methodParms, JSON_FORCE_OBJECT));
$value = "<a class='e-tip e-editable editable-click' data-type='select' data-value='".$_value."' data-name='".$field."' data-source=\"".$source."\" title=\"".LAN_EDIT." ".$attributes['title']."\" data-pk='".$id."' data-url='".e_SELF."?mode=&amp;action=inline&amp;id={$id}&amp;ajax_used=1' href='#'>".$value."</a>";
$xtype = 'select';
$value = $this->renderInline($field, $id, $attributes['title'], $_value, $value, $xtype, $methodParms);
// $source = str_replace('"',"'",json_encode($methodParms, JSON_FORCE_OBJECT));
// $value = "<a class='e-tip e-editable editable-click' data-type='select' data-value='".$_value."' data-name='".$field."' data-source=\"".$source."\" title=\"".LAN_EDIT." ".$attributes['title']."\" data-pk='".$id."' data-url='".e_SELF."?mode=&amp;action=inline&amp;id={$id}&amp;ajax_used=1' href='#'>".$value."</a>";
}
break;

View File

@@ -113,11 +113,10 @@ class core_mailout
$where = array();
$incExtended = array();
if ($selectVals === FALSE)
{
$selectVals = array('email_to' => 'all');
}
switch (varset($selectVals['email_to'], 'all'))
$emailTo = vartrue($selectVals['email_to'], false);
switch ($emailTo)
{
// Build the query for the user database
case 'all' :
@@ -137,7 +136,7 @@ class core_mailout
{
$where[] = "u.`user_class` REGEXP concat('(^|,)',{$selectVals['email_to']},'(,|$)')";
}
$where[] = "u.`user_ban`=0";
}
if (vartrue($selectVals['extended_1_name']) && vartrue($selectVals['extended_1_value']))
@@ -183,8 +182,19 @@ class core_mailout
}
}
}
if(empty($where) && empty($incExtended))
{
$this->mail_read = 0;
$this->mail_count = 0;
return $this->mail_count;
}
$where[] = "u.`user_email` != ''"; // Ignore all records with empty email address
// Now assemble the query from the pieces
// Determine which fields we actually need (u.user_sess is the signup link)
$qry = 'SELECT u.user_id, u.user_name, u.user_email, u.user_loginname, u.user_sess, u.user_lastvisit';
@@ -203,6 +213,9 @@ class core_mailout
$qry .= ' WHERE '.implode(' AND ',$where).' ORDER BY u.user_name';
// echo "Selector query: ".$qry.'<br />';
e107::getMessage()->addDebug("Selector query: ".$qry);
if (!( $this->mail_count = $sql->db_Select_gen($qry))) return FALSE;
$this->mail_read = 0;
return $this->mail_count;

View File

@@ -216,15 +216,23 @@ class newsletter_mailout
}
$c++;
}
return $var;
}
else
elseif($allow_edit == true)
{
return false; // Return Nothing to avoid confusion.
// $var[$c]['caption'] = NLLAN_50;
// $var[$c]['html'] = '';
$var[0]['caption'] = "No newsletters found";
$var[0]['html'] = '';
return $var;
}
else
{
return false; // Return Nothing to avoid confusion.
}
return $var;
}
}