summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSashi202018-04-26 18:55:10 +0530
committerSashi202018-04-26 18:55:10 +0530
commit4ce569845326ed1a6d05831100289043b87b6036 (patch)
treeb1ffc1acd8fdd054d73065d03044423743994517
parentc020a3e5c4ea5a90316c8cafabb5679702d7fc6f (diff)
downloaddwsim_flowsheet-4ce569845326ed1a6d05831100289043b87b6036.tar.gz
dwsim_flowsheet-4ce569845326ed1a6d05831100289043b87b6036.tar.bz2
dwsim_flowsheet-4ce569845326ed1a6d05831100289043b87b6036.zip
Minor changes in folder deletion
-rwxr-xr-xgeneral_deletion.inc76
1 files changed, 1 insertions, 75 deletions
diff --git a/general_deletion.inc b/general_deletion.inc
index fc916c9..3622d7a 100755
--- a/general_deletion.inc
+++ b/general_deletion.inc
@@ -112,78 +112,4 @@ function dwsim_flowsheet_abstract_delete_project($proposal_id)
db_delete('dwsim_flowsheet_submitted_abstracts')->condition('proposal_id', $proposal_data->id)->execute();
db_delete('dwsim_flowsheet_submitted_abstracts_file')->condition('id', $abstract_f_data->id)->execute();
return $status;
-}/*
-function _dwsim_flowsheet_delete_abstract_file($abstract_id)
-{
- global $user;
- $root_path = dwsim_flowsheet_path();
- $query = db_select('dwsim_flowsheet_proposal');
- $query->fields('dwsim_flowsheet_proposal');
- $query->condition('id', $abstract_id);
- $abstract_q = $query->execute();
- $abstract_data = $abstract_q->fetchObject();
- $abstract_q = db_query("SELECT * from dwsim_flowsheet_proposal dfp
-LEFT JOIN dwsim_flowsheet_submitted_abstracts dfsa ON dfp.id = dfsa.proposal_id
-WHERE dfsa.id = :abstract_id", array(
- ":abstract_id" => $abstract_id
- ));
- $abstract_data = $abstract_q->fetchObject();
- if (!$abstract_data)
- {
- drupal_set_message('Invalid flowsheet project abstract.', 'error');
- return FALSE;
- } //!$abstract_data
- /* deleting abstract files */
- /*$query = db_select('dwsim_flowsheet_submitted_abstracts_file');
- $query->fields('dwsim_flowsheet_submitted_abstracts_file');
- $query->condition('submitted_abstract_id', $abstract_id);
- $abstract_f_q = $query->execute();
- while ($abstract_f_data = $abstract_f_q->fetchObject())
- {
- if (!file_exists($root_path . $abstract_data->directory_name . '/' . $abstract_f_data->filepath))
- {
- $status = FALSE;
- drupal_set_message(t('Error deleting !file. File does not exists.', array(
- '!file' => $abstract_data->directory_name . '/' . $abstract_f_data->filepath
- )), 'error');
- continue;
- } //!file_exists($root_path . $abstract_data->directory_name . '/' . $abstract_f_data->filepath)
- /* removing solution file */
- /* if (!unlink($root_path . $abstract_data->directory_name . '/' . $abstract_f_data->filepath))
- {
- $status = FALSE;
- drupal_set_message(t('Error deleting !file', array(
- '!file' => $abstract_data->directory_name . '/' . $abstract_f_data->filepath
- )), 'error');
- /* sending email to admins */
- /* $from = variable_get('dwsim_flowsheet_from_email', '');
- $bcc = variable_get('dwsim_flowsheet_emails', '');
- $cc = variable_get('dwsim_flowsheet_cc_emails', '');
- $params['standard']['subject'] = "[ERROR] Error deleting example file";
- $params['standard']['body'] = "Error deleting solution files by " . $user->uid . " at " . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . " :
- file id : " . $abstract_data->id . "
- file path : " . $abstract_data->directory_name . '/' . $abstract_f_data->filepath;
- $params['standard']['headers'] = array(
- 'From' => $from,
- 'MIME-Version' => '1.0',
- 'Content-Type' => 'text/plain; charset=UTF-8; format=flowed; delsp=yes',
- 'Content-Transfer-Encoding' => '8Bit',
- 'X-Mailer' => 'Drupal',
- 'Cc' => $cc,
- 'Bcc' => $bcc
- );
- if (!drupal_mail('dwsim_flowsheet', 'standard', $email_to, language_default(), $params, $from, TRUE))
- drupal_set_message('Error sending email message.', 'error');
- } //!unlink($root_path . $abstract_data->directory_name . '/' . $abstract_f_data->filepath)
- else
- {
- /* deleting example files database entries */
- //db_delete('dwsim_flowsheet_submitted_abstracts_file')->condition('id', $abstract_f_data->id)->execute();
-/* }
- } //$abstract_f_data = $abstract_f_q->fetchObject()
- if (!$status)
- {
- return FALSE;
- } //!$status
- return $status;
-}
+} \ No newline at end of file