ここの情報は古いです。ご理解頂いた上でお取り扱いください。

source: OpenPNE3/plugins/opMessagePlugin/trunk/apps/pc_frontend/modules/message/templates/_list.php @ 10056

Last change on this file since 10056 was 10056, checked in by maki, 12 years ago

#3410 form_delete bug fix

File size: 5.5 KB
Line 
1<?php use_helper('Date', 'JavascriptBase'); ?>
2<?php echo javascript_tag("
3function checkAll() {
4    var sm = document.delete_message;
5    var len = sm.elements.length;
6    for (var i = 0; i < len; i++) {
7        sm.elements[i].checked = true;
8    }
9    return false;
10}
11function clearAll() {
12    var sm = document.delete_message;
13    var len = sm.elements.length;
14    for (var i = 0; i < len; i++) {
15        sm.elements[i].checked = false;
16    }
17    return false;
18}
19") ?>
20<?php 
21switch ($message_type):
22  case 'receive':
23    $title = __('Inbox');
24    $page_url = "message/receiveList";
25    $sender_title = __('From');
26    break;
27  case 'send':
28    $title = __('Sent Message');
29    $page_url = "message/sendList";
30    $sender_title = __('To');
31    break;
32  case 'draft':
33    $title = __('Drafts');
34    $page_url = "message/draftList";
35    $sender_title = __('To');
36    break;
37  case 'dust':
38    $title = __('Trash');
39    $page_url = "message/dustList";
40    $sender_title = __('From/To');
41    break;
42endswitch;
43?>
44<div class="dparts searchResultList"><div class="parts">
45<div class="partsHeading"><h3><?php echo $title ?></h3></div>
46<?php if ($pager->getNbResults()): ?>
47<div class="pagerRelativeMulti">
48<?php if ($message_type == 'receive'): ?>
49<p class="icons"> 
50<span>
51<?php echo image_tag('/plugins/opMessagePlugin/images/icon_mail_4.gif', array('alt' => __('Replied'))) ?>
52<?php echo __('Replied') ?>
53</span>
54</p>
55<?php endif; ?>
56</div>
57<div class="pagerRelative">
58<p class="number"><?php echo pager_navigation($pager, $page_url."?page=%d"); ?></p>
59</div>
60
61<form action="<?php echo url_for($page_url) ?>" method="post" name="delete_message">
62<?php echo $form["object_name"] ?>
63<?php echo $form["object_name"]->renderError() ?>
64<table> 
65<col class="status" /> 
66<col class="delete" /> 
67<col class="target" /> 
68<col class="title" /> 
69<col class="date" /> 
70<tr> 
71<th></th> 
72<th class="delete"><?php echo __('Delete') ?></th>
73<th><?php echo $sender_title ?></th>
74<th><?php echo __('Subject') ?></th>
75<th><?php echo __('Created At') ?></th>
76</tr>
77<?php foreach ($pager->getResults() as $message): ?>
78<?php 
79switch ($message_type):
80  case 'receive':
81    $form_delete = $form["message_ids[".$message->getId()."]"];
82    $form_delete_error = $form["message_ids[".$message->getId()."]"]->renderError();
83    $sender = $message->getSendMessageData()->getMember()->getName();
84    $detail_title = $message->getSendMessageData()->getSubject();
85    $detail_url = '@readMessage?id='.$message->getMessageId();
86    break;
87  case 'send':
88    $form_delete = $form["message_ids[".$message->getId()."]"];
89    $form_delete_error = $form["message_ids[".$message->getId()."]"]->renderError();
90    $sender = $message->getSendTo();
91    $detail_title = $message->getSubject();
92    $detail_url = '@readSendMessage?id='.$message->getId();
93    break;
94  case 'draft':
95    $form_delete = $form["message_ids[".$message->getId()."]"];
96    $form_delete_error = $form["message_ids[".$message->getId()."]"]->renderError();
97    $sender = $message->getSendTo();
98    $detail_title = $message->getSubject();
99    $detail_url = 'message/edit?id='.$message->getId();
100    break;
101  case 'dust':
102    $form_delete = $form["message_ids[".$message->getId()."]"];
103    $form_delete_error = $form["message_ids[".$message->getId()."]"]->renderError();
104    $sender = $message->getSender();
105    $detail_title = $message->getSubject();
106    $detail_url = '@readDeletedMessage?id='.$message->getViewMessageId();
107    break;
108endswitch;
109?>
110<tr <?php if ($message_type == 'receive' && $message->getIsRead() == 0): ?>class="unread"<?php endif; ?>>
111<td class="status"><span>
112<?php if ($message_type == 'send'): ?>
113<?php echo image_tag('/plugins/opMessagePlugin/images/icon_mail_3.gif') ?>
114<?php elseif ($message_type == 'draft'): ?>
115<?php echo image_tag('/plugins/opMessagePlugin/images/icon_mail_1.gif') ?>
116<?php elseif ($message_type == 'dust'): ?>
117  <?php if ($message->getIcon() && $message->getIconAlt()): ?>
118  <?php echo image_tag('/plugins/opMessagePlugin/images/'.$message->getIcon(), array('alt' => $message->getIconAlt())) ?>
119  <?php endif; ?>
120<?php elseif ($message->getIsHensin() == 1): ?>
121<?php echo image_tag('/plugins/opMessagePlugin/images/icon_mail_4.gif', array('alt' => __('Replied'))) ?>
122<?php elseif ($message->getIsRead() == 1): ?>
123<?php echo image_tag('/plugins/opMessagePlugin/images/icon_mail_2.gif', array('alt' => __('Open'))) ?>
124<?php else: ?>
125<?php echo image_tag('/plugins/opMessagePlugin/images/icon_mail_1.gif', array('alt' => __('Unopened'))) ?>
126<?php endif; ?>
127</span></td>
128<td><span>
129<?php echo $form_delete ?>
130<?php echo $form_delete_error ?>
131</span></td>
132<td><span><?php echo $sender ?></span></td>
133<td><span><?php echo link_to($detail_title, $detail_url)?></span></td>
134<td><span><?php echo format_datetime($message->getCreatedAt(), 'f') ?></span></td>
135</tr>
136<?php endforeach; ?>
137</table>
138<div class="pagerRelative">
139<p class="number"><?php echo pager_navigation($pager, $page_url.'?page=%d'); ?></p>
140</div>
141<div class="operation"> 
142<p>
143<?php echo link_to_function('全てをチェック', "checkAll()", array('onkeypress' => 'checkAll();')) ?> /
144<?php echo link_to_function('全てのチェックをはずす', "clearAll()", array('onkeypress' => 'clearAll();')) ?>
145</p>
146<ul class="moreInfo button"> 
147<?php if ($message_type == 'dust'): ?>
148<li>
149<input type="submit" class="input_submit" name="restore" value="<?php echo __('Restore') ?>" />
150</li>
151<?php endif; ?>
152<li>
153<input type="submit" class="input_submit" value="<?php echo __('Delete') ?>" />
154</li>
155</ul>
156</div>
157 
158</form>
159<?php else: ?>
160<div class="body">
161<?php echo __('There are no messages') ?>
162</div>
163<?php endif; ?>
164</div></div>
165
Note: See TracBrowser for help on using the repository browser.