diff --git a/install/OpensisSchemaMysqlInc.sql b/install/OpensisSchemaMysqlInc.sql index 28b283bb..c4e8d8c3 100644 --- a/install/OpensisSchemaMysqlInc.sql +++ b/install/OpensisSchemaMysqlInc.sql @@ -1309,6 +1309,7 @@ ALTER TABLE `mail_groupmembers` ADD INDEX `mail_groupmembers_ind` (`school_id`) CREATE TABLE IF NOT EXISTS `msg_inbox` ( `mail_id` int(11) NOT NULL AUTO_INCREMENT, + `mail_uuid` varchar(50) NOT NULL, `to_user` varchar(211) NOT NULL, `from_user` varchar(211) NOT NULL, `mail_Subject` varchar(211) NULL, diff --git a/install/OpensisTriggerMysqlInc.sql b/install/OpensisTriggerMysqlInc.sql index 026f543a..bb4eb438 100644 --- a/install/OpensisTriggerMysqlInc.sql +++ b/install/OpensisTriggerMysqlInc.sql @@ -139,6 +139,13 @@ CREATE TRIGGER `ti_user_file_upload` BEFORE INSERT ON user_file_upload FOR EACH ROW SET NEW.download_id = UUID(); + +DROP TRIGGER IF EXISTS `ti_msg_inbox`; +CREATE TRIGGER `ti_mail_uuid` + BEFORE INSERT ON msg_inbox + FOR EACH ROW + SET NEW.mail_uuid = UUID(); + DROP TRIGGER IF EXISTS `tu_login_authentication`; DELIMITER $$ CREATE TRIGGER `tu_login_authentication` diff --git a/modules/messaging/Inbox.php b/modules/messaging/Inbox.php index c1438630..d6661da4 100644 --- a/modules/messaging/Inbox.php +++ b/modules/messaging/Inbox.php @@ -432,7 +432,7 @@ echo '
'; echo '
'; $mail_id = $_REQUEST['mail_id']; - $mail_body = "select mail_body,mail_attachment,mail_Subject,from_user,mail_datetime,to_cc_multiple,to_multiple_users,to_bcc_multiple,mail_read_unread from msg_inbox where mail_id='$mail_id'"; + $mail_body = "select mail_body,mail_attachment,mail_Subject,from_user,mail_datetime,to_cc_multiple,to_multiple_users,to_bcc_multiple,mail_read_unread from msg_inbox where mail_uuid='$mail_id'"; $mail_body_info = DBGet(DBQuery($mail_body)); $sub = $mail_body_info[1]['MAIL_SUBJECT']; @@ -521,7 +521,7 @@ // } // for($i=0;$i<(count($attach));$i++) // { - echo "" . $img['NAME'] . ""; + echo "" . $img['NAME'] . ""; echo '
   
'; } @@ -637,7 +637,7 @@ $columns = $LO_columns; } $link['MAIL_SUBJECT']['link'] = "Modules.php?modname=messaging/Inbox.php&modfunc=body"; - $link['MAIL_SUBJECT']['variables'] = array('mail_id' => 'MAIL_ID'); + $link['MAIL_SUBJECT']['variables'] = array('mail_id' => 'MAIL_UUID'); $link['remove']['link'] = "Modules.php?modname=$_REQUEST[modname]&modfunc=trash"; $options['search'] = 'asdad'; diff --git a/modules/messaging/Trash.php b/modules/messaging/Trash.php index 5476b636..ad4682d5 100644 --- a/modules/messaging/Trash.php +++ b/modules/messaging/Trash.php @@ -80,7 +80,7 @@ if (isset($_REQUEST['modfunc']) && $_REQUEST['modfunc'] == 'body') { PopTable('header', _messageDetails); $mail_id = $_REQUEST['mail_id']; - $mail_body = "select mail_body,to_user,from_user,mail_datetime,mail_attachment from msg_inbox where mail_id='$mail_id'"; + $mail_body = "select mail_body,to_user,from_user,mail_datetime,mail_attachment from msg_inbox where mail_uuid='$mail_id'"; $mail_body_info = DBGet(DBQuery($mail_body)); foreach ($mail_body_info as $k => $v) { echo " @@ -271,7 +271,7 @@ $columns = $LO_columns; } $link['MAIL_SUBJECT']['link'] = "Modules.php?modname=messaging/Trash.php&modfunc=body"; - $link['MAIL_SUBJECT']['variables'] = array('mail_id' => 'MAIL_ID'); + $link['MAIL_SUBJECT']['variables'] = array('mail_id' => 'MAIL_UUID'); $link['remove']['link'] = "Modules.php?modname=messaging/Trash.php&modfunc=delete"; foreach ($trash_info as $id => $value) {