18 require_once SQ_INCLUDE_PATH.
'/asset.inc';
43 $this->
Asset($assetid);
56 $lock_types = parent::lockTypes();
57 $lock_types[
'mail'] = max($lock_types) * 2;
73 $link = $GLOBALS[
'SQ_SYSTEM']->am->getLink($this->
id, SQ_LINK_TYPE_2,
'user', FALSE,
'',
'minor',
'1');
75 $user = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($link[
'majorid'], $link[
'major_type_code']);
110 if (is_null($user)) {
111 return parent::_checkPermissionAccess($perm, $assetids);
114 return $user->_checkPermissionAccess($perm, $assetids);
129 $GLOBALS[
'SQ_SYSTEM']->paintLogin(translate(
'login'), translate(
'cannot_access_asset', $this->name));
149 if (isset($_REQUEST[
'gettrash'])) {
152 $ms = $GLOBALS[
'SQ_SYSTEM']->getMessagingService();
153 $messages = $ms->getMessages($user->id, NULL, Array(SQ_MSG_DELETED), Array(), NULL, NULL,
'name');
155 foreach ($messages as $key => $message) {
156 echo
'<message from="'.$message[
'from_name'].
'" id="'.$message[
'msgid'].
'" date="'.$GLOBALS[
'SQ_SYSTEM']->datetime($message[
'sent']).
'"';
157 echo
' subject="'.$message[
'subject'].
'">'.$message[
'body'].
'</message>';
163 parent::paintBackend($o);
177 if (isset($_REQUEST[
'msgid'])) {
179 $edit->paintMessage($_REQUEST[
'msgid']);
182 if (!SQ_IN_BACKEND) {
183 $GLOBALS[
'SQ_SYSTEM']->am->acquireLock($this->
id,
'mail');
186 <script
type=
"text/javascript" src=
"<?php echo sq_web_path('lib'); ?>/js/general.js"></script>
187 <script type=
"text/javascript" src=
"<?php echo sq_web_path('lib'); ?>/html_form/html_form.js"></script>
188 <h2 style=
"margin-bottom: 2px">
Inbox for <?php echo $user->attr(
'first_name').
' '.$user->attr(
'last_name'); ?></h2>
189 <form method=
"POST" action=
"<?php echo htmlentities($_SERVER['REQUEST_URI'], ENT_COMPAT, SQ_CONF_DEFAULT_CHARACTER_SET); ?>" name=
"main_form" id=
"main_form">
194 $edit->paintInbox($this, $null,
'inbox');
196 if (!SQ_IN_BACKEND) {
232 if ($name ==
'name') {
235 return parent::attr($name);