Skip to content

Commit

Permalink
support for multi-checks and message deletion from customer modules
Browse files Browse the repository at this point in the history
  • Loading branch information
chilek committed Sep 9, 2016
1 parent cf90cfb commit 777f2d5
Showing 1 changed file with 57 additions and 22 deletions.
79 changes: 57 additions & 22 deletions templates/default/customer/customermessages.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,55 +19,65 @@
<TR id="messagespanel" style="display:none;">
<TD style="width: 100%;" colspan="2">
<TABLE class="lmsbox-inner">
<COLGROUP>
<COL style="width: 1%;">
<COL style="width: 95%;">
<COL style="width: 1%;">
<COL style="width: 1%;">
<COL style="width: 1%;">
<COL style="width: 1%;">
</COLGROUP>
<THEAD>
<TR>
<TD style="width: 1%;" class="nobr">
<TD class="nobr">
{trans("Date:")}
</TD>
<TD style="width: 95%;" class="bold nobr">
<TD class="bold nobr">
{trans("Subject:")}
</TD>
<TD style="width: 1%;" class="nobr">
<TD class="nobr">
{trans("Destination:")}
</TD>
<TD style="width: 1%;" class="nobr">
<TD class="nobr">
{trans("Last read on:")}
</TD>
<TD style="width: 1%;" class="nobr">
<TD class="nobr">
{trans("Was confirm on:")} ({trans("only userpanel message")})
</TD>
<TD style="width: 1%;" class="nobr"></TD>
<TD class="nobr"></TD>
</TR>
</THEAD>
<TBODY>
<TBODY class="multi-check">
<form method="post" name="customermessages" action="?m=messagedel">
{cycle values="light,lucid" print=false name=messages}
{foreach from=$messagelist item=item}
<TR class="highlight {cycle name=messages}{if $item.status==$smarty.const.MSG_ERROR} alert{elseif $item.status==$smarty.const.MSG_SENT} blend{elseif $item.status==$smarty.const.MSG_DELIVERED} green{/if}">
<TD style="width: 1%;" class="nobr" onClick="return self.location.href='?m=messageinfo&amp;id={$item.id}'">
<TD class="nobr" onClick="return self.location.href='?m=messageinfo&id={$item.id}'">
{$item.cdate|date_format:"%Y/%m/%d"}
</TD>
<TD style="width: 95%;" class="bold" onClick="return self.location.href='?m=messageinfo&amp;id={$item.id}'">
{if $item.type == $smarty.const.MSG_MAIL}
<img src="img/email.gif" alt="email">
{elseif $item.type == $smarty.const.MSG_WWW}
<img src="img/network.gif" alt="www">
{elseif $item.type == $smarty.const.MSG_USERPANEL || $item.type == $smarty.const.MSG_USERPANEL_URGENT}
<img src="img/cms.gif" alt="userpanel">
{else}
<img src="img/sms.gif" alt="sms">
{/if}
<TD class="bold" onClick="return self.location.href='?m=messageinfo&id={$item.id}'">
{if $item.type == $smarty.const.MSG_MAIL}
<img src="img/email.gif" alt="email">
{elseif $item.type == $smarty.const.MSG_WWW}
<img src="img/network.gif" alt="www">
{elseif $item.type == $smarty.const.MSG_USERPANEL || $item.type == $smarty.const.MSG_USERPANEL_URGENT}
<img src="img/cms.gif" alt="userpanel">
{else}
<img src="img/sms.gif" alt="sms">
{/if}
{$item.subject}
</TD>
<TD style="width: 1%;" class="text-right nobr" onClick="return self.location.href='?m=messageinfo&amp;id={$item.id}'">
<TD class="text-right nobr" onClick="return self.location.href='?m=messageinfo&id={$item.id}'">
{$item.destination}
</TD>
<TD style="width: 1%;" class="text-right nobr" onClick="return self.location.href='?m=messageinfo&amp;id={$item.id}'">
<TD class="text-right nobr">
{if $item.lastreaddate}{$item.lastreaddate|date_format:"%Y/%m/%d %H:%M"}{else} - {/if}
</TD>
<TD style="width: 1%;" class="text-right nobr" onClick="return self.location.href='?m=messageinfo&amp;id={$item.id}'">
<TD class="text-right nobr">
{if $item.status == $smarty.const.MSG_SENT && ($item.type == $smarty.const.MSG_USERPANEL || $item.type == $smarty.const.MSG_USERPANEL_URGENT) && $item.lastdate}{$item.lastdate|date_format:"%Y/%m/%d %H:%M"}{else} - {/if}
</TD>
<TD style="width: 1%;" class="text-right nobr">
<TD class="text-right nobr">
<input type="checkbox" class="multi-check" name="marks[{$item.id}]" value="{$item.id}">
</TD>
</TR>
{foreachelse}
Expand All @@ -77,6 +87,31 @@
</TD>
</TR>
{/foreach}
<TR class="ftop">
<TD colspan="6" class="buttons">
<A id="delete-messages">{trans("Delete")} <img src="img/delete.gif" alt="{trans("Delete")}"></A>
<label>
{trans("Check All")}
<input type="checkbox" class="multi-check-all">
</label>
</TD>
</TR>
<script type="text/javascript">
<!--
$(function() {
$('#delete-messages').click(function(e) {
if (confirm('{trans("Are you sure, you want to delete all selected messages?")}')) {
$('form[name=customermessages]').attr('action', function(index, attr) {
return attr + '&is_sure=1';
});
$('form[name=customermessages]').submit();
} else
return false;
});
});
//-->
</script>
</form>
</TBODY>
</TABLE>
</TD>
Expand Down

0 comments on commit 777f2d5

Please sign in to comment.