增加了邮件模板标题调用

emailtext视图微调
This commit is contained in:
Li Jianxuan 2011-10-13 09:11:35 +00:00
parent bd7392f5d1
commit 43434c27f2
2 changed files with 26 additions and 23 deletions

View File

@ -302,22 +302,24 @@ class Admin_ReviewController extends Zend_Controller_Action
$update = "update mdstatus set status=2 where uuid='$uuid'"; $update = "update mdstatus set status=2 where uuid='$uuid'";
@$this->db->exec($update); @$this->db->exec($update);
} }
$mailtp=new EmailText();
$mailtp->db = $this->db; $mailtp=new EmailText(); //实例化EmailText
$mailtp->tmpid = "expinvite"; $mailtp->db = $this->db; //传入PDO类型数据库对象
$mailtp->data = array( $mailtp->tmpid = "expinvite"; //传入模板ID或标示符传入ID是使用int类型
'user' => $expinfo['realname'], $mailtp->data = array( //传入要替换的数据
'uuid' => $uuid, 'user' => $expinfo['realname'], //用户名 {user}
'title' => $md['title'] 'uuid' => $uuid, //uuid {uuid}
'title' => $md['title'] //元数据标题 {title}
); );
$body = $mailtp->loadtmp(); $body = $mailtp->loadtmp(); //加载模板
$subject = $mailtp->tmpinfo['subject']; //标题(顺序不能变,必须先加载模板后调用标题,减少数据库查询的次数)
if($body === false) if($body === false)
{ {
$this->messenger->addMessage('模板加载失败'); $this->messenger->addMessage('模板加载失败');
$this->_redirect("/admin/review/invite/?id=$id"); $this->_redirect("/admin/review/invite/?id=$id");
} }
$subject = "西部数据中心-元数据评审邀请函";
$email = "la5c@qq.com"; $email = "la5c@qq.com";
$mail=new WestdcMailer($this->view->config->smtp); $mail=new WestdcMailer($this->view->config->smtp);

View File

@ -2,10 +2,10 @@
$this->headTitle($this->config->title->site); $this->headTitle($this->config->title->site);
$this->headTitle('后台管理'); $this->headTitle('后台管理');
$this->headTitle()->setSeparator(' - '); $this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/admin.css'); $this->headLink()->appendStylesheet('/css/admin.css');
$this->breadcrumb('<a href="/">首页</a>'); $this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/admin">后台首页</a>'); $this->breadcrumb('<a href="/admin">后台首页</a>');
$this->breadcrumb('<a href="/admin/sys">系统管理</a>'); $this->breadcrumb('<a href="/admin/sys">系统管理</a>');
$this->breadcrumb('邮件模板管理'); $this->breadcrumb('邮件模板管理');
$this->breadcrumb()->setSeparator(' > '); $this->breadcrumb()->setSeparator(' > ');
?> ?>
@ -28,22 +28,23 @@
<?php endif; ?> <?php endif; ?>
<a class="" href="/admin/sys/emailtext/ac/add">创建新模板</a> <a class="" href="/admin/sys/emailtext/ac/add">创建新模板</a>
<a class="" href="/admin/sys/emailtext/ac/help">查看邮件模板编写说明</a>
<table><thead><tr> <table><thead><tr>
<th>模板标识</th> <th>模板标识</th>
<th width="30%">邮件主题</th> <th width="30%">邮件主题</th>
<th>创建时间</th> <th>创建时间</th>
<th>更新时间</th> <th>更新时间</th>
<th>操作</th> <th>操作</th>
</tr></thead><tbody> </tr></thead><tbody>
<?php <?php
if (count($this->paginator)): if (count($this->paginator)):
$autoindex=0; $autoindex=0;
foreach ($this->paginator as $item): foreach ($this->paginator as $item):
$autoindex++;?> $autoindex++;?>
<tr class="<?php if($autoindex%2 == 0) echo 'even'; else echo 'odd'; ?>"> <tr class="<?php if($autoindex%2 == 0) echo 'even'; else echo 'odd'; ?>">
<td><?php echo $item['template'];?></td> <td><?php echo $item['template'];?></td>
<td><?php echo $item['subject'];?></td> <td><?php echo $item['subject'];?></td>
<td><?php echo date("Y-m-d H:i",strtotime($item['ts_created']));?></td> <td><?php echo date("Y-m-d H:i",strtotime($item['ts_created']));?></td>
<td><?php if (!empty($item['ts_changed'])) echo date("Y-m-d H:i",strtotime($item['ts_changed']));?></td> <td><?php if (!empty($item['ts_changed'])) echo date("Y-m-d H:i",strtotime($item['ts_changed']));?></td>
<td> <td>
<a href="/admin/sys/emailtext/ac/del/id/<?php echo $item['id'];?>">删除</a> | <a href="/admin/sys/emailtext/ac/del/id/<?php echo $item['id'];?>">删除</a> |