mirror of
https://github.com/e107inc/e107.git
synced 2025-04-15 10:02:02 +02:00
Mail and progressBar fixes.
This commit is contained in:
parent
5e867b378e
commit
01f0751c04
@ -91,11 +91,16 @@ require_once(e_HANDLER.'mail_manager_class.php'); // Mail DB API
|
||||
*/
|
||||
function sendProgress($id)
|
||||
{
|
||||
|
||||
// return rand(92,100);
|
||||
|
||||
$pref = e107::getPref();
|
||||
|
||||
ob_start();
|
||||
|
||||
$mailManager = new e107MailManager();
|
||||
$mailManager->doEmailTask(varset($pref['mail_workpertick'],5));
|
||||
|
||||
|
||||
$sqld = e107::getDb();
|
||||
|
||||
$sqld->select("mail_content","mail_togo_count,mail_sent_count,mail_fail_count","mail_source_id= ".intval($id) );
|
||||
@ -104,10 +109,14 @@ function sendProgress($id)
|
||||
$rand = ($row['mail_sent_count'] + $row['mail_fail_count']);
|
||||
$total = ($row['mail_togo_count'] + $row['mail_sent_count'] + $row['mail_fail_count']);
|
||||
|
||||
// $rand = rand(90,100);
|
||||
// return $rand;
|
||||
$errors = ob_get_clean();
|
||||
|
||||
e107::getMessage()->addDebug($errors);
|
||||
|
||||
// file_put_contents(e_LOG.'send-mail-progress.txt',$errors);
|
||||
|
||||
$inc = round(($rand / $total) * 100);
|
||||
e107::getMessage()->addDebug("Returned: ".$inc);
|
||||
|
||||
return $inc;
|
||||
|
||||
@ -117,7 +126,6 @@ function sendProgress($id)
|
||||
if(e_AJAX_REQUEST)
|
||||
{
|
||||
$id = intval($_GET['mode']);
|
||||
// echo rand(92,100);
|
||||
echo sendProgress($id);
|
||||
exit;
|
||||
|
||||
@ -212,12 +220,12 @@ class mailout_admin extends e_admin_dispatcher
|
||||
protected $adminMenu = array(
|
||||
// 'makemail/makemail' => array('caption'=> LAN_MAILOUT_190, 'perm' => 'W', 'url'=>e_SELF),
|
||||
'main/list' => array('caption'=> LAN_MANAGE, 'perm'=> 'W'),
|
||||
'main/create' => array('caption'=> LAN_MAILOUT_190, 'perm' => 'W'),
|
||||
'main/create' => array('caption'=> LAN_CREATE, 'perm' => 'W'),
|
||||
|
||||
'recipients/list' => array('caption'=> "Recipients", 'perm' => 'W'),
|
||||
// 'main/send' => array('caption'=> "Send", 'perm' => 'W'),
|
||||
'other' => array('divider'=> true),
|
||||
'saved/list' => array('caption'=> LAN_MAILOUT_191, 'perm' => 'W'),
|
||||
// 'saved/list' => array('caption'=> LAN_MAILOUT_191, 'perm' => 'W'),
|
||||
'pending/list' => array('caption'=> LAN_MAILOUT_193, 'perm' => 'W'),
|
||||
'held/list' => array('caption'=> LAN_MAILOUT_194, 'perm' => 'W'),
|
||||
'sent/list' => array('caption'=> LAN_MAILOUT_192, 'perm' => 'W'),
|
||||
@ -244,7 +252,7 @@ class mailout_main_ui extends e_admin_ui
|
||||
protected $pluginName = LAN_MAILOUT_15;
|
||||
protected $table = "mail_content";
|
||||
|
||||
// protected $listQry = "SELECT * FROM #mail_content WHERE mail_content_status = 20 ";
|
||||
// protected $listQry = null;
|
||||
|
||||
|
||||
// protected $editQry = "SELECT * FROM #mail_content WHERE cust_id = {ID}";
|
||||
@ -269,9 +277,11 @@ class mailout_main_ui extends e_admin_ui
|
||||
'mail_copy_to' => array('title' => LAN_MAILOUT_151,'tab'=>1, 'type'=>'method','data'=>false),
|
||||
'mail_bcopy_to' => array('title' => LAN_MAILOUT_152,'tab'=>1, 'type'=>'method','data'=>false),
|
||||
'mail_subject' => array('title' => LAN_MAILOUT_06, 'type'=>'text', 'forced' => TRUE,'data'=>'str', 'inline'=>true, 'writeParms'=>'size=xxlarge&required=1'),
|
||||
'mail_content_status' => array('title' => LAN_MAILOUT_136, 'tab'=>1, 'type'=> 'dropdown', 'data'=>'int', 'filter'=>false, 'inline'=>true, 'thclass' => 'left', 'class'=>'left'),
|
||||
'mail_togo_count' => array('title' => LAN_MAILOUT_83, 'noedit'=>true, 'type'=>'number'),
|
||||
'mail_content_status' => array('title' => LAN_MAILOUT_136, 'tab'=>1, 'type'=> 'dropdown', 'data'=>'int', 'filter'=>false, 'inline'=>false, 'thclass' => 'left', 'class'=>'left'),
|
||||
'mail_total_count' => array('title' => "Total Recipients", 'noedit'=>true, 'type'=>'number'),
|
||||
'mail_sent_count' => array('title' => LAN_MAILOUT_82, 'noedit'=>true, 'type'=>'number'),
|
||||
'mail_togo_count' => array('title' => LAN_MAILOUT_83, 'noedit'=>true, 'type'=>'number'),
|
||||
|
||||
'mail_fail_count' => array('title' => LAN_MAILOUT_128, 'noedit'=>true, 'type'=>'number'),
|
||||
'mail_bounce_count' => array('title' => LAN_MAILOUT_144, 'noedit'=>true, 'type'=>'number'),
|
||||
'mail_start_send' => array('title' => LAN_MAILOUT_131,'noedit'=>true, 'type'=>'number', 'proc' => 'sdatetime'),
|
||||
@ -369,9 +379,15 @@ class mailout_main_ui extends e_admin_ui
|
||||
{
|
||||
$this->listQry = "SELECT * FROM #mail_content WHERE mail_content_status = ".varset($qr[$action],20);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
// $this->fields['options']['type'] = '';
|
||||
$this->listQry = "SELECT * FROM #mail_content WHERE (mail_content_status = ".MAIL_STATUS_TEMP ." OR mail_content_status = ".MAIL_STATUS_SAVED.")";
|
||||
}
|
||||
|
||||
|
||||
if($action == 'sent' || $action == 'pending' || $action == 'held')
|
||||
{
|
||||
$this->fieldpref = array('checkboxes', 'mail_source_id', 'mail_title', 'mail_subject','mail_total_count', 'mail_togo_count', 'mail_sent_count', 'mail_fail_count', 'mail_bounce_count', 'options');
|
||||
}
|
||||
|
||||
$this->fields['mail_content_status']['writeParms'] = $types;
|
||||
@ -445,19 +461,14 @@ class mailout_main_ui extends e_admin_ui
|
||||
private function processSendActions()
|
||||
{
|
||||
|
||||
if((vartrue($_POST['email_sendnow']) || vartrue($_POST['email_send']) || vartrue($_POST['email_hold']) || vartrue($_POST['email_cancel'])) && !vartrue($_POST['email_id']))
|
||||
if((vartrue($_POST['email_send']) || vartrue($_POST['email_hold']) || vartrue($_POST['email_cancel'])) && !vartrue($_POST['email_id']))
|
||||
{
|
||||
e107::getMessage()->addError("No Message ID submitted");
|
||||
return;
|
||||
}
|
||||
|
||||
$id = intval($_POST['email_id']);
|
||||
|
||||
if(vartrue($_POST['email_sendnow']))
|
||||
{
|
||||
$this->emailSendNow($id);
|
||||
}
|
||||
|
||||
|
||||
if(vartrue($_POST['email_send']))
|
||||
{
|
||||
$this->emailSend($id);
|
||||
@ -478,13 +489,7 @@ class mailout_main_ui extends e_admin_ui
|
||||
|
||||
private function emailSendNow($id)
|
||||
{
|
||||
$mes = e107::getMessage();
|
||||
$text = e107::getForm()->progressBar('mail-progress',1, array('btn-label'=>'Start', 'url'=> e_SELF));
|
||||
|
||||
$mes->setTitle('Ready to Process Mail Queue', E_MESSAGE_INFO)->addInfo($text);
|
||||
return '';
|
||||
|
||||
//; e107::getRender()->tablerender("Sending...", $mes->render());
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -601,7 +606,29 @@ class mailout_main_ui extends e_admin_ui
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
function sendnowPage()
|
||||
{
|
||||
$id = $this->getId();
|
||||
|
||||
e107::getDb()->update('mail_content', 'mail_content_status='.MAIL_STATUS_PENDING.' WHERE mail_source_id = '.intval($id));
|
||||
e107::getDb()->update('mail_recipients', 'mail_status='.MAIL_STATUS_PENDING.' WHERE mail_detail_id = '.intval($id));
|
||||
|
||||
if(E107_DEBUG_LEVEL > 0)
|
||||
{
|
||||
echo "<h4>Debug Mode : Mail is sent and data displayed below. </h4>";
|
||||
sendProgress($id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$text = "<h4>Ready to Process Mail Queue</h4>";
|
||||
$text .= e107::getForm()->progressBar('mail-progress',1, array('btn-label'=>'Start', 'url'=> e_SELF));
|
||||
}
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
|
||||
function sendPage()
|
||||
{
|
||||
|
||||
@ -618,6 +645,10 @@ class mailout_main_ui extends e_admin_ui
|
||||
$fromHold = false;
|
||||
|
||||
$mailData = $this->mailAdmin->dbToMail($mailData);
|
||||
|
||||
e107::getMessage()->addDebug("Regenerating recipient list");
|
||||
|
||||
e107::getDb()->delete('mail_recipients','mail_detail_id='.intval($id));
|
||||
|
||||
return $this->mailAdmin->sendEmailCircular($mailData, $fromHold);
|
||||
|
||||
@ -1206,6 +1237,15 @@ class mailout_admin_form_ui extends e_admin_form_ui
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
if($mode == 'sent' || $mode == 'pending' || $mode == 'held')
|
||||
{
|
||||
$link = e_SELF."?searchquery=&filter_options=mail_detail_id__".$id."&mode=recipients&action=list";
|
||||
$text .= "<a href='".$link."' class='btn' title='Recipients'>".E_32_USER."</a>";
|
||||
$att['readParms']['editClass'] = e_UC_NOBODY;
|
||||
$text .= $this->renderValue('options',$value,$att,$id);
|
||||
return $text;
|
||||
}
|
||||
|
||||
$mode = $controller->getMode();
|
||||
$mailData = $controller->getListModel()->getData();
|
||||
@ -1272,7 +1312,7 @@ class mailout_recipients_ui extends e_admin_ui
|
||||
while($row = $sql->fetch())
|
||||
{
|
||||
$id = $row['mail_detail_id'];
|
||||
$array[$id] = varset($row['mail_title'], "(No Name)");
|
||||
$array[$id] = vartrue($row['mail_title'], "(No Name)");
|
||||
}
|
||||
$this->fields['mail_detail_id']['writeParms'] = $array;
|
||||
|
||||
@ -1729,7 +1769,7 @@ switch ($midAction)
|
||||
|
||||
if(isset($_POST['email_sendnow']))
|
||||
{
|
||||
sendImmediately($mailId);
|
||||
// sendImmediately($mailId);
|
||||
}
|
||||
|
||||
// --------------------- Display errors and results ------------------------
|
||||
@ -1805,7 +1845,7 @@ switch ($action)
|
||||
{
|
||||
$mailData = array(); // Empty array just in case
|
||||
}
|
||||
$mailAdmin->show_mailform($mailData);
|
||||
// $mailAdmin->show_mailform($mailData);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -255,6 +255,7 @@ CREATE TABLE mail_recipients (
|
||||
CREATE TABLE mail_content (
|
||||
mail_source_id int(10) unsigned NOT NULL auto_increment,
|
||||
mail_content_status tinyint(1) unsigned NOT NULL default '0',
|
||||
mail_total_count int(10) unsigned NOT NULL default '0',
|
||||
mail_togo_count int(10) unsigned NOT NULL default '0',
|
||||
mail_sent_count int(10) unsigned NOT NULL default '0',
|
||||
mail_fail_count int(10) unsigned NOT NULL default '0',
|
||||
|
@ -1095,6 +1095,7 @@ class e_form
|
||||
* @param string $name
|
||||
* @param number $value
|
||||
* @param array $options
|
||||
* @example Use
|
||||
*/
|
||||
public function progressBar($name,$value,$options=array())
|
||||
{
|
||||
@ -1114,9 +1115,13 @@ class e_form
|
||||
|
||||
$loading = vartrue($options['loading'],'Please wait...');
|
||||
|
||||
$buttonId = $target.'-start';
|
||||
|
||||
if(vartrue($options['btn-label']))
|
||||
{
|
||||
$text .= '<a id="mail-progress-start" data-loading-text="'.$loading.'" data-progress-target="'.$target.'" data-progress="' . $options['url'] . '" data-progress-mode="'.$id.'" data-progress-show="'.$nextStep.'" data-progress-hide="'.$thisStep.'" class="btn btn-primary e-progress" >'.$options['btn-label'].'</a>';
|
||||
$text .= '<a id="'.$buttonId.'" data-loading-text="'.$loading.'" data-progress-target="'.$target.'" data-progress="' . $options['url'] . '" data-progress-mode="'.varset($options['mode'],0).'" data-progress-show="'.$nextStep.'" data-progress-hide="'.$buttonId.'" class="btn btn-primary e-progress" >'.$options['btn-label'].'</a>';
|
||||
$text .= ' <a data-progress-target="'.$target.'" class="btn btn-danger e-progress-cancel" >'.LAN_CANCEL.'</a>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -138,7 +138,7 @@ define('MAIL_LOG_PATH',e_LOG);
|
||||
class e107Email extends PHPMailer
|
||||
{
|
||||
private $general_opts = array();
|
||||
private $logEnable = 1; // 0 = log disabled, 1 = 'dry run' (debug and log, no send). 2 = 'log all' (send, and log result)
|
||||
private $logEnable = 2; // 0 = log disabled, 1 = 'dry run' (debug and log, no send). 2 = 'log all' (send, and log result)
|
||||
private $logHandle = FALSE; // Save handle of log file if opened
|
||||
|
||||
private $localUseVerp = FALSE; // Use our own variable - PHPMailer one doesn't work with all mailers
|
||||
@ -154,7 +154,7 @@ class e107Email extends PHPMailer
|
||||
private $pause_time = 1; // Time to pause after sending a block of emails
|
||||
|
||||
public $legacyBody = false; // TRUE enables legacy conversion of plain text body to HTML in HTML emails
|
||||
private $debug = false; // echos various debug info when set to true.
|
||||
private $debug = true; // echos various debug info when set to true.
|
||||
private $pref = array(); // Store code prefs.
|
||||
|
||||
/**
|
||||
@ -196,7 +196,12 @@ class e107Email extends PHPMailer
|
||||
$this->allow_html = varset($pref['mail_sendstyle'],'textonly') == 'texthtml' ? true : 1;
|
||||
|
||||
if (varsettrue($pref['mail_options'])) $this->general_opts = explode(',',$pref['mail_options'],'');
|
||||
if ($this->debug) echo 'Mail_options: '.$pref['mail_options'].' Count: '.count($this->general_opts).'<br />';
|
||||
|
||||
if ($this->debug)
|
||||
{
|
||||
echo 'Mail_options: '.$pref['mail_options'].' Count: '.count($this->general_opts).'<br />';
|
||||
}
|
||||
|
||||
foreach ($this->general_opts as $k => $v)
|
||||
{
|
||||
$v = trim($v);
|
||||
@ -609,7 +614,7 @@ class e107Email extends PHPMailer
|
||||
|
||||
if($tmpl = e107::getCoreTemplate('email', $eml['template'], 'front', true)) //FIXME - Core template is failing with template 'notify'. Works with theme template. Issue with core template registry?
|
||||
{
|
||||
$eml['shortcodes']['BODY'] = $eml['email_body'];
|
||||
$eml['shortcodes']['BODY'] = $tp->toEmail($eml['email_body']);
|
||||
$eml['shortcodes']['SUBJECT'] = $eml['email_subject'];
|
||||
$eml['shortcodes']['THEME'] = e_THEME.$this->pref['sitetheme'].'/'; // Always use front-end theme path.
|
||||
|
||||
@ -732,6 +737,7 @@ class e107Email extends PHPMailer
|
||||
$eml['wordwrap'] - Set wordwrap value
|
||||
$eml['split'] - If true, sends an individual email to each recipient
|
||||
$eml['template'] - template to use. 'default'
|
||||
$eml['shortcodes'] - array of shortcode values. eg. array('MY_SHORTCODE'=>'12345');
|
||||
|
||||
* @param string $send_to - recipient email address
|
||||
* @param string $to_name - recipient name
|
||||
@ -743,9 +749,12 @@ class e107Email extends PHPMailer
|
||||
public function sendEmail($send_to, $to_name, $eml = '', $bulkmail = FALSE)
|
||||
{
|
||||
if (count($eml))
|
||||
{ // Set parameters from list
|
||||
$ret = $this->arraySet($eml); // returns error on fail and nothing if all is okay.
|
||||
if ($ret) return $ret;
|
||||
{
|
||||
if($error = $this->arraySet($eml)) // Set parameters from list
|
||||
{
|
||||
return $error;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ($bulkmail && $this->localUseVerp && $this->save_bouncepath && (strpos($this->save_bouncepath,'@') !== FALSE))
|
||||
|
@ -797,8 +797,8 @@ class e107MailManager
|
||||
//'extra_header' - additional headers (format is name: value
|
||||
//'wordwrap' - Set wordwrap value
|
||||
//'split' - If true, sends an individual email to each recipient
|
||||
'template' => 'template', // required
|
||||
'shortcodes' => 'shortcodes' // required
|
||||
'template' => 'mail_send_style', // required
|
||||
'shortcodes' => 'mail_target_info' // required
|
||||
);
|
||||
$result = array();
|
||||
if (!isset($email['mail_source_id'])) $email['mail_source_id'] = 0;
|
||||
@ -853,8 +853,14 @@ class e107MailManager
|
||||
}
|
||||
if (isset($email['mail_overrides']) && is_array($email['mail_overrides'])) $result = array_merge($result, $email['mail_overrides']);
|
||||
|
||||
e107::getAdminLog()->addDebug(print_a($email,true),false);
|
||||
e107::getAdminLog()->addDebug(print_a($email,true),true);
|
||||
|
||||
print_a($email);
|
||||
|
||||
// $result['template'] = $email['mail_send_style'];
|
||||
|
||||
echo "<h4>".__METHOD__." Line: ".__LINE__."</h4>";
|
||||
print_a($result);
|
||||
return $result;
|
||||
}
|
||||
|
||||
@ -882,7 +888,7 @@ class e107MailManager
|
||||
}
|
||||
else
|
||||
{
|
||||
e107::getAdminLog()->addDebug("Couldn't select emails", false);
|
||||
e107::getAdminLog()->addDebug("Couldn't select emails", true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1046,6 +1052,11 @@ class e107MailManager
|
||||
if (($handle <= 0) || !is_numeric($handle)) return FALSE;
|
||||
if (!isset($this->mailCounters[$handle])) return 'nocounter';
|
||||
$this->checkDB(2); // Make sure DB object created
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$query = '`mail_togo_count`='.intval($this->mailCounters[$handle]['add']).' WHERE `mail_source_id`='.$handle;
|
||||
if ($this->db2->db_Update('mail_content', $query))
|
||||
{
|
||||
@ -1055,6 +1066,22 @@ class e107MailManager
|
||||
}
|
||||
|
||||
|
||||
public function updateCounter($id, $type, $count)
|
||||
{
|
||||
if(empty($id) || empty($type))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$update = array(
|
||||
'mail_'.$type.'_count' => intval($count),
|
||||
'WHERE' => "mail_source_id=".intval($id)
|
||||
);
|
||||
|
||||
return e107::getDb('mail')->update('mail_content', $update) ? $count : false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve the counters for a mail record
|
||||
@ -1489,8 +1516,8 @@ class e107MailManager
|
||||
public function sendEmails($templateName, $emailData, $recipientData, $extra = FALSE)
|
||||
{
|
||||
$log = e107::getAdminLog();
|
||||
$log->addDebug(print_a($emailData, true),false);
|
||||
$log->addDebug(print_a($recipientData, true),false);
|
||||
$log->addDebug(print_a($emailData, true),true);
|
||||
$log->addDebug(print_a($recipientData, true),true);
|
||||
$log->toFile('mail_manager','Main Manager Log',true);
|
||||
|
||||
|
||||
@ -1559,6 +1586,8 @@ class e107MailManager
|
||||
|
||||
if($this->debugMode)
|
||||
{
|
||||
|
||||
echo "<h4>".__CLASS__." :: ".__METHOD__." - Line ".__LINE__."</h4>";
|
||||
print_a($emailData);
|
||||
print_a($recipientData);
|
||||
|
||||
|
@ -886,6 +886,13 @@ class mailoutAdminClass extends e107MailManager
|
||||
{
|
||||
$text .= '<tr><td>' . $this->fields['mail_content'][$k]['title'] . '</td><td>';
|
||||
$val = $mailSource[$k];
|
||||
|
||||
if($k == 'mail_body')
|
||||
{
|
||||
$text .= $tp->toHtml($val,true);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(is_numeric($v))
|
||||
{
|
||||
$text .= ($v > 1)? $tp->text_truncate($val, $v, '...'): $val;
|
||||
@ -901,6 +908,7 @@ class mailoutAdminClass extends e107MailManager
|
||||
$text .= $gen->convert_date($val, 'short');
|
||||
break;
|
||||
case 'trunc200':
|
||||
|
||||
$text .= e107::getParser()->text_truncate($val, 200, '...');
|
||||
break;
|
||||
case 'chars':
|
||||
@ -1541,33 +1549,40 @@ class mailoutAdminClass extends e107MailManager
|
||||
|
||||
$text .= $this->showMailDetail($mailData, 'send');
|
||||
|
||||
$text .= '<tr><td>' . LAN_MAILOUT_03 . '</td><td>'; // TO
|
||||
|
||||
// Add in core and any plugin selectors here
|
||||
foreach($this->mailHandlers as $key => $m)
|
||||
{
|
||||
|
||||
if($m->mailerEnabled && ($contentArray = $m->showSelect(FALSE, $mailData['mail_selectors'][$key])))
|
||||
{
|
||||
$text .= '<tr><td>' . LAN_MAILOUT_180 . '<br />' . $m->mailerName . '</td>';
|
||||
$text .= '<td><ul>';
|
||||
|
||||
$text .= $m->mailerName.':<ul>';
|
||||
foreach($contentArray as $val)
|
||||
{
|
||||
$text .= "<li>" . $val['caption'] . " : " . $val['html'] . "</li>";
|
||||
}
|
||||
$text .= '</ul></td></tr>';
|
||||
$text .= '</ul>';
|
||||
}
|
||||
}
|
||||
|
||||
$text .= '</td></tr>';
|
||||
|
||||
// Figures - number of emails to send, number of duplicates stripped
|
||||
$text .= '<tr><td>' . LAN_MAILOUT_173 . '</td><td>' . ($mailData['mail_togo_count']) . "<input type='hidden' name='mailIDConf' value='{$mailMainID}' /></td></tr>";
|
||||
$text .= '<tr><td>' . LAN_MAILOUT_71 . '</td><td> ' . $counters['add'] . ' ' . LAN_MAILOUT_69 . $counters['dups'] . LAN_MAILOUT_70 . '</td></tr>';
|
||||
$text .= "</tbody></table>\n</fieldset>";
|
||||
|
||||
$this->updateCounter($mailMainID,'total',$counters['add']);
|
||||
|
||||
$text .= $this->makeAdvancedOptions(TRUE);
|
||||
// Show the table of advanced options
|
||||
|
||||
$text .= "<div class='buttons-bar center'>";
|
||||
|
||||
$text .= $frm->admin_button('email_sendnow', "Send Now", 'primary');
|
||||
$text .= "<a href='".e_SELF."?mode=main&action=sendnow&id=".$mailMainID."' class='btn btn-primary'>Send Now</a>";
|
||||
|
||||
// $text .= $frm->admin_button('email_sendnow', "Send Now", 'primary');
|
||||
$text .= $frm->admin_button('email_send', "Send Later");
|
||||
|
||||
// $text .= "<input type='submit' name='email_send' value=\"".LAN_SEND."\" />";
|
||||
|
@ -197,7 +197,7 @@ class newsletter_mailout
|
||||
|
||||
$selects = array_flip(explode(',', $selectVals));
|
||||
|
||||
if ($sql->db_Select('newsletter', 'newsletter_id, newsletter_title', '`newsletter_parent`=0'))
|
||||
if ($sql->select('newsletter', 'newsletter_id, newsletter_title', '`newsletter_parent`=0'))
|
||||
{
|
||||
$c=0;
|
||||
while ($row = $sql->db_Fetch(MYSQL_ASSOC))
|
||||
@ -219,8 +219,9 @@ class newsletter_mailout
|
||||
}
|
||||
else
|
||||
{
|
||||
$var[$c]['caption'] = NLLAN_50;
|
||||
$var[$c]['html'] = '';
|
||||
return false; // Return Nothing to avoid confusion.
|
||||
// $var[$c]['caption'] = NLLAN_50;
|
||||
// $var[$c]['html'] = '';
|
||||
}
|
||||
|
||||
return $var;
|
||||
|
@ -5,31 +5,32 @@ $(document).ready(function()
|
||||
var hash = event.target.href.toString().split('#')[1], form = $(event.target).parents('form')[0];
|
||||
window.location.hash = '/' + hash;
|
||||
if(form) {
|
||||
$(form).attr('action', $(form).attr('action').split('#')[0] + '#/' + hash);
|
||||
$(form).attr('action', $(form).attr('action').split('#')[0] + '#/' + hash);
|
||||
}
|
||||
});
|
||||
|
||||
// tabs hash
|
||||
if(/^#\/\w+/.test(window.location.hash)) {
|
||||
var hash = window.location.hash.substr(2);
|
||||
if(hash.match('^tab')) $('.nav-tabs a[href=#' + hash + ']').tab('show');
|
||||
if(hash.match('^tab')){ $('.nav-tabs a[href=#' + hash + ']').tab('show'); }
|
||||
}
|
||||
|
||||
$('.e-typeahead').each(function() {
|
||||
|
||||
$('.e-typeahead').each( function(){
|
||||
|
||||
var id = $(this).attr("id");
|
||||
var name = '#' + id.replace('-usersearch', '');
|
||||
var newval = $(this).attr("data-value");
|
||||
$(this).typeahead({
|
||||
source: $(this).attr("data-source"),
|
||||
updater: function(text, type){
|
||||
if(type == 'value')
|
||||
{
|
||||
$(name).val(text);
|
||||
}
|
||||
return text;
|
||||
}
|
||||
})
|
||||
|
||||
$(this).typeahead({
|
||||
source: $(this).attr("data-source"),
|
||||
updater: function(text, type){
|
||||
if(type === 'value')
|
||||
{
|
||||
$(name).val(text);
|
||||
}
|
||||
return text;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
/* Switch to Tab containing invalid form field. */
|
||||
@ -48,8 +49,8 @@ $(document).ready(function()
|
||||
found = true;
|
||||
//alert(node.id+' : '+tab);
|
||||
}
|
||||
// var label = $('label[for=' + node.id + ']');
|
||||
})
|
||||
// var label = $('label[for=' + node.id + ']');
|
||||
});
|
||||
|
||||
return true;
|
||||
});
|
||||
@ -124,7 +125,8 @@ $(document).ready(function()
|
||||
$('button[data-loading-text],a[data-loading-text]').on('click', function()
|
||||
{
|
||||
var caption = $(this).attr('data-loading-text');
|
||||
$(this).removeClass('btn-success');
|
||||
$(this).removeClass('btn-success');
|
||||
$(this).removeClass('btn-primary');
|
||||
$(this).html(caption);
|
||||
if($(this).attr('data-disable') == 'true')
|
||||
{
|
||||
@ -139,6 +141,7 @@ $(document).ready(function()
|
||||
var caption = $(this).attr('data-loading-text');
|
||||
$(this).val(caption);
|
||||
$(this).removeClass('btn-success');
|
||||
$(this).removeClass('btn-primary');
|
||||
//$(this).attr('disabled', 'disabled').val(caption);
|
||||
return true;
|
||||
}
|
||||
@ -203,8 +206,16 @@ $(document).ready(function()
|
||||
|
||||
|
||||
|
||||
var progresspump = null;
|
||||
|
||||
|
||||
$('.e-progress-cancel').on('click', function(e)
|
||||
{
|
||||
clearInterval(progresspump);
|
||||
var target = $(this).attr('data-progress-target');
|
||||
$("#"+target).closest('.progress').removeClass("active");
|
||||
progresspump = null;
|
||||
alert('stopped');
|
||||
});
|
||||
|
||||
$('.e-progress').on('click', function(e)
|
||||
{
|
||||
@ -224,33 +235,33 @@ $(document).ready(function()
|
||||
|
||||
$("#"+target).css('width','1%'); // so we know it's running.
|
||||
|
||||
var progresspump = setInterval(function(){
|
||||
|
||||
progresspump = setInterval(function(){
|
||||
|
||||
$.get(script, { mode: mode }).done( function(data){
|
||||
|
||||
// alert(data);
|
||||
$("#"+target).css('width',data+'%'); // update the progress bar width */
|
||||
$("#"+target).html(data+'%'); // display the numeric value */
|
||||
// alert(data);
|
||||
$("#"+target).css('width', data+'%'); // update the progress bar width */
|
||||
$("#"+target).html(data+'%'); // display the numeric value */
|
||||
|
||||
if(data > 99.999) {
|
||||
|
||||
clearInterval(progresspump);
|
||||
|
||||
clearInterval(progresspump);
|
||||
$("#"+target).closest('.progress').removeClass("active");
|
||||
|
||||
$("#"+target).html("Done");
|
||||
|
||||
if(hide !== 'undefined')
|
||||
{
|
||||
$('#'+hide).hide();
|
||||
$('#'+hide).hide();
|
||||
}
|
||||
|
||||
if(show !== 'undefined')
|
||||
{
|
||||
$('#'+show).show('slow');
|
||||
$('#'+show).show('slow');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@ -695,7 +706,7 @@ $(document).ready(function()
|
||||
|
||||
// Text-area AutoGrow
|
||||
// $("textarea.e-autoheight").elastic();
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user