diff options
author | priyankabhagwat | 2015-05-13 11:50:29 +0530 |
---|---|---|
committer | priyankabhagwat | 2015-05-13 11:50:29 +0530 |
commit | 8af46bf47d4e4b41f699ced5550a446a78d06ce0 (patch) | |
tree | c0b5136b933be3898f2ac718b5c121c3e30570b6 | |
parent | 581b90225634aacd4c544680c10236776411e836 (diff) | |
download | scilab-bulk-code-manages-master.tar.gz scilab-bulk-code-manages-master.tar.bz2 scilab-bulk-code-manages-master.zip |
-rwxr-xr-x | bulk_code.module | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/bulk_code.module b/bulk_code.module index 89ba381..010d02c 100755 --- a/bulk_code.module +++ b/bulk_code.module @@ -146,10 +146,38 @@ function bulk_code_all(){ exit(); } } else { - $data = "Book directory not present : " . $dir_path . ". Skipping deleting book directory."; + $data = "Book directory not present : " . $dir_path . ". Skip deleting book directory."; echo $data; - exit(); - } + $preference_q = db_query("SELECT * FROM {textbook_companion_preference} WHERE id = %d", $pref_id); + $preference_data = db_fetch_object($preference_q); + $proposal_id = $preference_data->proposal_id; + db_query("DELETE FROM {textbook_companion_preference} WHERE proposal_id = %d", $proposal_id); + db_query("DELETE FROM {textbook_companion_proposal} WHERE id = %d", $proposal_id); + $data .= 'Deleted Book Proposal.'; + /* email */ + $email_subject = t('Your uploaded examples including the book proposal have been deleted'); + $email_body = t('Your all the uploaded examples including the book have been deleted permanently. + +Reason for deletion: + +' . $disapproval_reason); + if ($email_subject) + { + $email_to = $user->mail; + $param['standard']['subject'] = $email_subject; + $param['standard']['body'] = $email_body; + if (!drupal_mail('textbook_companion', 'standard', $email_to, language_default(), $param, variable_get('textbook_companion_from_email', NULL), TRUE)) + $data .='Error sending email message.'; + echo $data; + exit(); + } + + else { + $data .= "Error Dis-Approving and Deleting Entire Book."; + echo $data; + exit(); + } + } /* deleting preference and proposal */ $preference_q = db_query("SELECT * FROM {textbook_companion_preference} WHERE id = %d", $pref_id); $preference_data = db_fetch_object($preference_q); |