diff options
-rwxr-xr-x | abstract_bulk_approval.inc | 160 | ||||
-rwxr-xr-x | email.inc | 211 | ||||
-rwxr-xr-x | general_deletion.inc | 6 | ||||
-rwxr-xr-x | upload_code.inc | 40 |
4 files changed, 97 insertions, 320 deletions
diff --git a/abstract_bulk_approval.inc b/abstract_bulk_approval.inc index 9796931..967655f 100755 --- a/abstract_bulk_approval.inc +++ b/abstract_bulk_approval.inc @@ -33,7 +33,7 @@ function om_pssp_abstract_bulk_approval_form($form, &$form_state) ); $form['message'] = array( '#type' => 'textarea', - '#title' => t('If Dis-Approved please specify reason for Dis-Approval'), + '#title' => t('Please specify the reason for marking resubmit/disapproval'), '#prefix' => '<div id= "message_submit">', '#states' => array( 'visible' => array( @@ -45,7 +45,7 @@ function om_pssp_abstract_bulk_approval_form($form, &$form_state) 'or', array( ':input[name="om_pssp_actions"]' => array( - 'value' => 4 + 'value' => 2 ) ) ) @@ -121,6 +121,7 @@ function om_pssp_abstract_bulk_approval_form_submit($form, &$form_state) ':submitted_abstract_id' => $abstract_data->id )); } //$abstract_data = $abstracts_q->fetchObject() + drupal_goto('powersystems/pssp/manage-proposal/all'); drupal_set_message(t('Approved power system simulation project.'), 'status'); // email $email_subject = t('[!site_name][power system simulation Project] Your uploaded power system simulation project have been approved', array( @@ -131,13 +132,25 @@ function om_pssp_abstract_bulk_approval_form_submit($form, &$form_state) Dear !user_name, -Your uploaded abstract for the power system simulation project has been approved: +Congratulations! +Your simulation and abstract for Power Systems Simulation Project at FOSSEE with the following details have been approved. + +Full Name: ' . $user_info->name_title . ' ' . $user_info->contributor_name . ' +Email : ' . $user_data->mail . ' +University/Institute : ' . $user_info->university . ' +City : ' . $user_info->city . ' + +Project Title : ' . $user_info->project_title . ' +Description of the simulation: ' . $user_info->description .' + +Kindly send us the internship forms as early as possible for processing your honorarium on time. In case you have already sent these forms, please share the the consignment number or tracking id with us. + +Note: It will take upto 30 days from the time we receive your forms, to process your honorarium. -Title of power system simulation project : ' . $user_info->project_title . ' Best Wishes, -!site_name Team, +!site_name Power Systems Team, FOSSEE,IIT Bombay', array( '!site_name' => variable_get('site_name', ''), '!user_name' => $user_data->name @@ -166,6 +179,12 @@ FOSSEE,IIT Bombay', array( } //$form_state['values']['om_pssp_actions'] == 1 elseif ($form_state['values']['om_pssp_actions'] == 2) { + if (strlen(trim($form_state['values']['message'])) <= 30) + { + form_set_error('message', t('')); + $msg = drupal_set_message("Please mention the reason for marking resubmit. Minimum 30 character required", 'error'); + return $msg; + } //pending review entire project $query = db_select('om_pssp_submitted_abstracts'); $query->fields('om_pssp_submitted_abstracts'); @@ -197,12 +216,14 @@ FOSSEE,IIT Bombay', array( Dear !user_name, -Kindly resubmit the project files for the project : ' . $user_info->project_title . '. - +Kindly resubmit the project files for the project: ' . $user_info->project_title . '. +Description of the simulation: ' . $user_info->description . ' + +Reason: ' . $form_state['values']['message'] . ' Best Wishes, -!site_name Team, +!site_name Power Systems Team, FOSSEE,IIT Bombay', array( '!site_name' => variable_get('site_name', ''), '!user_name' => $user_data->name @@ -252,13 +273,25 @@ FOSSEE,IIT Bombay', array( 0 => t(' Dear !user_name, -Your uploaded power system simulation project files for the power system simulation project Title : ' . $user_info->project_title . ' have been marked as dis-approved. +We regret to inform you that your simulation and abstract for Power Systems Simulation Project at FOSSEE with the following details have been disapproved: + +Full Name: ' . $user_info->name_title . ' ' . $user_info->contributor_name . ' +Email : ' . $user_data->mail . ' +University/Institute : ' . $user_info->university . ' +City : ' . $user_info->city . ' + +Project Title : ' . $user_info->project_title . ' +Description of the simulation: ' . $user_info->description .' Reason for dis-approval: ' . $form_state['values']['message'] . ' +Kindly note that the incorrect files will be deleted from all our databases. + +Thank you for participating in the Power Systems Simulation Project. You are welcome to submit a new proposal. + Best Wishes, -!site_name Team, +!site_name Power Systems Team, FOSSEE,IIT Bombay', array( '!site_name' => variable_get('site_name', ''), '!user_name' => $user_data->name @@ -291,113 +324,6 @@ FOSSEE,IIT Bombay', array( // email } //$form_state['values']['om_pssp_actions'] == 3 - /*elseif ($form_state['values']['om_pssp_actions'] == 4) - { - if (strlen(trim($form_state['values']['message'])) <= 30) - { - form_set_error('message', t('')); - $msg = drupal_set_message("Please mention the reason for disapproval/deletion. Minimum 30 character required", 'error'); - return $msg; - } //strlen(trim($form_state['values']['message'])) <= 30 - $query = db_select('om_pssp_abstract_experiment'); - $query->fields('om_pssp_abstract_experiment'); - $query->condition('proposal_id', $form_state['values']['lab']); - $query->orderBy('number', 'ASC'); - $experiment_q = $query->execute(); - $experiment_list = ''; - while ($experiment_data = $experiment_q->fetchObject()) - { - $experiment_list .= '<p>' . $experiment_data->number . ') ' . $experiment_data->title . '<br> Description : ' . $experiment_data->description . '<br>'; - $experiment_list .= ' '; - $experiment_list .= '</p>'; - } //$experiment_data = $experiment_q->fetchObject() - if (!user_access('lab migration bulk delete code')) - { - $msg = drupal_set_message(t('You do not have permission to Bulk Delete Entire Lab Including Proposal.'), 'error'); - return $msg; - } //!user_access('lab migration bulk delete code') - // check if dependency files are present - $dep_q = db_query("SELECT * FROM {om_pssp_abstract_dependency_files} WHERE proposal_id = :proposal_id", array( - ":proposal_id" => $form_state['values']['lab'] - )); - if ($dep_data = $dep_q->fetchObject()) - { - $msg = drupal_set_message(t("Cannot delete lab since it has dependency files that can be used by others. First delete the dependency files before deleting the lab."), 'error'); - return $msg ; - } //$dep_data = $dep_q->fetchObject() - if (om_pssp_abstract_delete_lab($form_state['values']['lab'])) - { - drupal_set_message(t('Dis-Approved and Deleted Entire Lab solutions.'), 'status'); - $query = db_select('om_pssp_abstract_experiment'); - $query->fields('om_pssp_abstract_experiment'); - $query->condition('proposal_id', $form_state['values']['lab']); - $experiment_q = $query->execute()->fetchObject(); - $dir_path = $root_path . $experiment_q->directory_name; - if (is_dir($dir_path)) - { - $res = rmdir($dir_path); - if (!$res) - { - $msg = drupal_set_message(t("Cannot delete Lab directory : " . $dir_path . ". Please contact administrator."), 'error'); - return $msg; - } //!$res - } //is_dir($dir_path) - else - { - drupal_set_message(t("Lab directory not present : " . $dir_path . ". Skipping deleting lab directory."), 'status'); - } - $proposal_q = db_query("SELECT * FROM {om_pssp_abstract_proposal} WHERE id = :id", array( - ":id" => $form_state['values']['lab'] - )); - $proposal_data = $proposal_q->fetchObject(); - $proposal_id = $proposal_data->id; - db_query("DELETE FROM {om_pssp_abstract_experiment} WHERE proposal_id = :proposal_id", array( - ":proposal_id" => $proposal_id - )); - db_query("DELETE FROM {om_pssp_abstract_proposal} WHERE id = :id", array( - ":id" => $proposal_id - )); - drupal_set_message(t('Deleted Lab Proposal.'), 'status'); - //email - $email_subject = t('[!site_name] Your uploaded Lab Migration solutions including the Lab proposal have been deleted', array( - '!site_name' => variable_get('site_name', '') - )); - $email_body = array( - 0 => t(' - -Dear !user_name, - -We regret to inform you that all the uploaded Experiments of your Lab with following details have been deleted permanently. - -Title of Lab :' . $user_info->lab_title . ' - -List of experiments : ' . $experiment_list . ' - -Reason for dis-approval: ' . $form_state['values']['message'] . ' - -Best Wishes, - -!site_name Team, -FOSSEE,IIT Bombay', array( - '!site_name' => variable_get('site_name', ''), - '!user_name' => $user_data->name - )) - ); - // email - // $email_subject = t('Your uploaded Lab Migration solutions including the Lab proposal have been deleted'); - $email_body = array( - 0 => t('Your all the uploaded solutions including the Lab proposal have been deleted permanently.') - ); - } //om_pssp_abstract_delete_lab($form_state['values']['lab']) - else - { - $msg = drupal_set_message(t('Error Dis-Approving and Deleting Entire Lab.'), 'error'); - } - } //$form_state['values']['om_pssp_actions'] == 4 - else - { - $msg = drupal_set_message(t('You do not have permission to bulk manage code.'), 'error'); - }*/ } //user_access('om_pssp project bulk manage code') return $msg; } //$form_state['clicked_button']['#value'] == 'Submit' @@ -52,6 +52,7 @@ Email: ' . $user_data->mail . ' University/Institute: ' . $proposal_data->university . ' City: ' . $proposal_data->city . ' Project Title: ' . $proposal_data->project_title . ' +Description of the simulation: ' . $proposal_data->description . ' Your proposal is under review. You will be notified via email about the approval/disapproval within ten working days. @@ -59,7 +60,7 @@ Your proposal is under review. You will be notified via email about the approval Best Wishes, -!site_name Team, +!site_name Power Systems Team, FOSSEE,IIT Bombay', array( '!site_name' => variable_get('site_name', ''), '!user_name' => $user_data->name @@ -106,7 +107,13 @@ Dear !user_name, We regret to inform you that your Power Systems Simulation Project proposal, with following details, has been disapproved. Full Name: ' . $proposal_data->name_title . ' ' . $proposal_data->contributor_name . ' +Email: ' . $user_data->mail . ' +University/Institute: ' . $proposal_data->university . ' +City: ' . $proposal_data->city . ' + Project Title: ' . $proposal_data->project_title . ' +Description of the simulation: ' . $proposal_data->description . ' + Reason(s) / Feedback: ' . $proposal_data->dissapproval_reason . ' Please note that any files that were uploaded along with the proposal form will be deleted from all our database(s). @@ -116,7 +123,7 @@ Thank you for participating in the Power Systems Simulation Project. You are wel Best Wishes, -!site_name Team, +!site_name Power Systems Team, FOSSEE,IIT Bombay', array( '!site_name' => variable_get('site_name', ''), '!user_name' => $user_data->name @@ -133,7 +140,7 @@ FOSSEE,IIT Bombay', array( $query->range(0, 1); $proposal_data = $query->execute()->fetchObject(); $user_data = user_load($params['om_pssp_proposal_approved']['user_id']); - $url = 'https://dwsim.fossee.in/flowsheeting-project/coding-guidelines-flowsheeting'; + $url = 'https://om.fossee.in/powersystems/pssp/coding-guidelines'; if ($proposal_data->project_guide_name == "NULL" || $proposal_data->project_guide_name == "") { $project_guide_name = "Not Entered"; @@ -162,17 +169,21 @@ Dear !user_name, Congratulations! Your proposal for Power Systems Simulation Project with the following details is approved. -Full Name : ' . $proposal_data->name_title . ' ' . $proposal_data->contributor_name . ' -Project Title : ' . $proposal_data->project_title . ' -Name of compound for which process development is carried out : ' . $proposal_data->process_development_compound_name . ' +Full Name: ' . $proposal_data->name_title . ' ' . $proposal_data->contributor_name . ' +Email: ' . $user_data->mail . ' +University/Institute: ' . $proposal_data->university . ' +City: ' . $proposal_data->city . ' + +Project Title: ' . $proposal_data->project_title . ' +Description of the simulation: ' . $proposal_data->description . ' + -Please ensure that ALL the guidelines for coding at https://om.fossee.in/powersystems/pssp/coding-guidelines are strictly followed. Refer https://om.fossee.in/powersystems/pssp/internship for the further procedure for submission of the project. Kindly ensure that the flowsheet and abstract are submitted within 1 month. +Please ensure that ALL the guidelines for coding at https://om.fossee.in/powersystems/pssp/coding-guidelines are strictly followed. Refer https://om.fossee.in/powersystems/pssp/internship for the further procedure for submission of the project. Kindly ensure that the completed model and abstract are submitted within 1 month. -You can upload your abstract using abstract submission interface. Best Wishes, -!site_name Team, +!site_name Power Systems Team, FOSSEE,IIT Bombay', array( '!site_name' => variable_get('site_name', ''), '!user_name' => $user_data->name @@ -206,7 +217,7 @@ FOSSEE,IIT Bombay', array( $project_guide_email_id = $proposal_data->project_guide_email_id; } $message['headers'] = $params['om_pssp_proposal_completed']['headers']; - $message['subject'] = t('[!site_name][Flowsheeting Project] Your DWSIM Flowsheeting Project proposal has been completed', array( + $message['subject'] = t('[!site_name][Power System Simulation Project] Your OpenModelica Power System Simulation Project proposal has been completed', array( '!site_name' => variable_get('site_name', '') ), array( 'language' => $language->language @@ -215,22 +226,22 @@ FOSSEE,IIT Bombay', array( 'body' => t(' Dear !user_name, -Your DWSIM flowsheet and abstract on the following process have been published successfully. +Your simulation and abstract for Power Systems Simulation Project at FOSSEE on the following process have been published successfully. + Full Name : ' . $proposal_data->name_title . ' ' . $proposal_data->contributor_name . ' Project Title : ' . $proposal_data->project_title . ' Kindly access this link to download the same. -https://dwsim.fossee.in/flowsheeting-project/completed-flowsheet +https://om.fossee.in/powersystems/pssp/completed-pssp -You can now download your e-certificate after logging into the DWSIM website: dwsim.fossee.in. On the left-hand side panel, go to User Dashboard > Flowsheet Certificates > Download. In case of any difficulties, kindly let us know. -Thank you for participating in the DWSIM Flowsheeting Project. You are welcome to propose a new flowsheet. +Thank you for participating in the Power System Simulation Project. You are welcome to propose a new proposal. Best Wishes, -!site_name Team, +!site_name Power Systems Team, FOSSEE,IIT Bombay', array( '!site_name' => variable_get('site_name', ''), '!user_name' => $user_data->name @@ -265,7 +276,7 @@ FOSSEE,IIT Bombay', array( $project_guide_email_id = $proposal_data->project_guide_email_id; } $message['headers'] = $params['om_pssp_proposal_deleted']['headers']; - $message['subject'] = t('[!site_name][Flowsheeting Project] Your DWSIM Flowsheeting Project proposal has been deleted', array( + $message['subject'] = t('[!site_name][Power System Simulation Project] Your OpenModelica Power System Simulation Project proposal has been deleted', array( '!site_name' => variable_get('site_name', '') ), array( 'language' => $language->language @@ -274,32 +285,23 @@ FOSSEE,IIT Bombay', array( 'body' => t(' Dear !user_name, -Your DWSIM Flowsheeting Project proposal with the following details has been deleted : +Your Power Systems Simulation Project proposal with the following details has been deleted: Full Name : ' . $proposal_data->name_title . ' ' . $proposal_data->contributor_name . ' Email : ' . $user_data->mail . ' -Month and Year of Award of Degree : ' . $proposal_data->month_year_of_degree . ' University/Institute : ' . $proposal_data->university . ' City : ' . $proposal_data->city . ' -State : ' . $proposal_data->state . ' -Country : ' . $proposal_data->country . ' - -Project Guide : ' . $project_guide_name . ' -Project Guide Email : ' . $project_guide_email_id . ' - -DWSIM Version : ' . $proposal_data->version . ' Project Title : ' . $proposal_data->project_title . ' - -Name of compound for which process development is carried out : ' . $proposal_data->process_development_compound_name . ' +Description of the simulation: ' . $proposal_data->description .' -You can propose a new flowsheet project. +You can propose a new Power Systems Simulation project. Best Wishes, -!site_name Team, +!site_name Power Systems Team, FOSSEE,IIT Bombay', array( '!site_name' => variable_get('site_name', ''), '!user_name' => $user_data->name @@ -318,7 +320,7 @@ FOSSEE,IIT Bombay', array( $proposal_data = $query->execute()->fetchObject(); $user_data = user_load($params['abstract_uploaded']['user_id']); - $message['subject'] = t('[!site_name][Flowsheeting Project] You have uploaded DWSIM flowsheet abstract', array( + $message['subject'] = t('[!site_name][Power System Simulation Project] You have uploaded OpenModelica model and abstract', array( '!site_name' => variable_get('site_name', '') ), array( 'language' => $language->language @@ -328,154 +330,21 @@ FOSSEE,IIT Bombay', array( 'body' => t(' Dear !user_name, -You have successfully uploaded your DWSIM flowsheet and abstract with the following details. +You have successfully uploaded your simulation and abstract for Power Systems Simulation Project with the following details. Full Name : ' . $proposal_data->name_title . ' ' . $proposal_data->contributor_name . ' -Project Title : ' . $proposal_data->project_title . ' -Name of compound for which process development is carried out : ' . $proposal_data->process_development_compound_name . ' - -You shall be notified via email after the flowsheet and abstract are reviewed and approved / disapproved. This may take upto 30 working days. - -Best Wishes, - -!site_name Team, -FOSSEE,IIT Bombay', array( - '!site_name' => variable_get('site_name', ''), - '!user_name' => $user_data->name - ), array( - 'language' => $language->language - )) - ); - break; - case 'solution_approved': - //$solution_q = db_query("SELECT * FROM {om_pssp_solution} WHERE id = %d LIMIT 1", $params['solution_approved']['solution_id']); - $query = db_select('om_pssp_solution'); - $query->fields('om_pssp_solution'); - $query->condition('id', $params['solution_approved']['solution_id']); - $query->range(0, 1); - $solution_q = $query->execute(); - $solution_data = $solution_q->fetchObject(); - $query = db_select('om_pssp_experiment'); - $query->fields('om_pssp_experiment'); - $query->condition('id', $solution_data->experiment_id); - $query->range(0, 1); - $experiment_q = $query->execute(); - $experiment_data = $experiment_q->fetchObject(); - $user_data = user_load($params['solution_approved']['user_id']); - $message['headers'] = $params['solution_approved']['headers']; - $message['subject'] = t('[!site_name] Your uploaded DWSIM flowsheet solution has been approved', array( - '!site_name' => variable_get('site_name', '') - ), array( - 'language' => $language->language - )); - $message['body'] = array( - 'body' => t(' -Dear !user_name, - -Your following solution has been approved: - -Experiment Title : ' . $experiment_data->title . ' - -Solution number : ' . $solution_data->code_number . ' -Caption : ' . $solution_data->caption . ' - -Please ensure that ALL the codes follow guidelines at https://dwsim.fossee.in/dwsim-flowsheet-project/dwsim-flowsheet-guidelines - -Best Wishes, - -!site_name Team, -FOSSEE,IIT Bombay', array( - '!site_name' => variable_get('site_name', ''), - '!user_name' => $user_data->name - ), array( - 'language' => $language->language - )) - ); - break; - case 'solution_disapproved': - $user_data = user_load($params['solution_disapproved']['user_id']); - $message['headers'] = $params['solution_disapproved']['headers']; - $message['subject'] = t('[!site_name] Your uploaded DWSIM flowsheet solution has been disapproved', array( - '!site_name' => variable_get('site_name', '') - ), array( - 'language' => $language->language - )); - $message['body'] = array( - 'body' => t(' -Dear !user_name, - -Your following solution has been disapproved: - -Solution number : ' . $params['solution_disapproved']['solution_number'] . ' -Caption : ' . $params['solution_disapproved']['solution_caption'] . ' - -Reason for dis-approval : ' . $params['solution_disapproved']['message'] . ' - - -Best Wishes, - -!site_name Team, -FOSSEE,IIT Bombay', array( - '!site_name' => variable_get('site_name', ''), - '!user_name' => $user_data->name - ), array( - 'language' => $language->language - )) - ); - break; - case 'solution_deleted_user': - $user_data = user_load($params['solution_deleted_user']['user_id']); - $message['headers'] = $params['solution_deleted_user']['headers']; - $message['subject'] = t('[!site_name] User has deleted pending DWSIM flowsheet solution', array( - '!site_name' => variable_get('site_name', '') - ), array( - 'language' => $language->language - )); - $message['body'] = array( - 'body' => t(' -Dear !user_name, - -Your following pending solution has been deleted : - -Title of the Lab : ' . $params['solution_deleted_user']['lab_title'] . ' -Title of the Experiment : ' . $params['solution_deleted_user']['experiment_title'] . ' - -Solution number : ' . $params['solution_deleted_user']['solution_number'] . ' -Caption : ' . $params['solution_deleted_user']['solution_caption'] . ' - - -Best Wishes, - -!site_name Team, -FOSSEE,IIT Bombay', array( - '!site_name' => variable_get('site_name', ''), - '!user_name' => $user_data->name - ), array( - 'language' => $language->language - )) - ); - break; - case 'dependency_uploaded': - $user_data = user_load($params['dependency_uploaded']['user_id']); - $dependency_files = implode(',', $params['dependency_uploaded']['dependency_names']); - $message['headers'] = $params['dependency_uploaded']['headers']; - $message['subject'] = t('[!site_name] You have uploaded dependency file', array( - '!site_name' => variable_get('site_name', '') - ), array( - 'language' => $language->language - )); - $message['body'] = array( - 'body' => t(' -Dear !user_name, +Email : ' . $user_data->mail . ' +University/Institute : ' . $proposal_data->university . ' +City : ' . $proposal_data->city . ' -You have uploaded following dependency files : - ' . $dependency_files . ' +Project Title : ' . $proposal_data->project_title . ' +Description of the simulation: ' . $proposal_data->description .' -Please ensure that ALL the codes follow guidelines at https://dwsim.fossee.in/dwsim-flowsheet-project/dwsim-flowsheet-guidelines +You shall be notified via email after the model and abstract are reviewed and approved / disapproved. This may take upto 30 working days. Best Wishes, -!site_name Team, +!site_name Power Systems Team, FOSSEE,IIT Bombay', array( '!site_name' => variable_get('site_name', ''), '!user_name' => $user_data->name diff --git a/general_deletion.inc b/general_deletion.inc index 0edfc3a..e944c45 100755 --- a/general_deletion.inc +++ b/general_deletion.inc @@ -32,7 +32,7 @@ function om_pssp_abstract_delete_project($proposal_id) drupal_set_message('Invalid power system simulation project abstract.', 'error'); } db_delete('om_pssp_submitted_abstracts_file')->condition('proposal_id', $proposal_id)->execute(); - //!dwsim_flowsheet_delete_abstract_file($abstract_data->id) + //!om_pssp_delete_abstract_file($abstract_data->id) } $res = rmdir($root_path . $proposal_data->directory_name . '/project_files'); $dir_path_udc = $root_path . $proposal_data->directory_name; @@ -59,7 +59,7 @@ WHERE dfsa.id = :abstract_id", array( $abstract_data = $abstract_q->fetchObject(); if (!$abstract_data) { - drupal_set_message('Invalid flowsheet project abstract.', 'error'); + drupal_set_message('Invalid power system simualation project abstract.', 'error'); return FALSE; } //!$abstract_data /* deleting solutions */ @@ -136,7 +136,7 @@ WHERE dfsa.id = :abstract_id", array( $abstract_data = $abstract_q->fetchObject(); if (!$abstract_data) { - drupal_set_message('Invalid flowsheet project abstract.', 'error'); + drupal_set_message('Invalid power system simulation project abstract.', 'error'); return FALSE; } //!$abstract_data /* deleting abstract files diff --git a/upload_code.inc b/upload_code.inc index 6fec49d..1d0fcbc 100755 --- a/upload_code.inc +++ b/upload_code.inc @@ -152,7 +152,7 @@ function om_pssp_upload_abstract_code_form($form, &$form_state) '#title' => t('Other Modelica Libraries Used'), '#options' => array( '1' => 'Yes', - '0' => 'No' + '0' => 'No', ), '#default_value' => $abstracts_q->other_libraries_used, '#required' => TRUE @@ -275,6 +275,13 @@ function om_pssp_upload_abstract_code_form_submit($form, &$form_state) { global $user; $v = $form_state['values']; + if($form_state['values']['other_libraries'] == 1) + { + $other_libraries_used = 1; + } + else{ + $other_libraries_used = 0; + } $root_path = om_pssp_path(); $proposal_data = om_pssp_get_proposal(); $proposal_id = $proposal_data->id; @@ -299,30 +306,6 @@ function om_pssp_upload_abstract_code_form_submit($form, &$form_state) if (!$query_s_result) { /* creating solution database entry */ - if($v['other_libraries_used'] == 1){ - $query = "INSERT INTO {om_pssp_submitted_abstracts} ( - proposal_id, - approver_uid, - abstract_approval_status, - other_libraries_used, - abstract_upload_date, - abstract_approval_date, - is_submitted) VALUES (:proposal_id, :approver_uid, :abstract_approval_status, :other_libraries_used, :abstract_upload_date, :abstract_approval_date, :is_submitted)"; - $args = array( - ":proposal_id" => $proposal_id, - ":approver_uid" => 0, - ":abstract_approval_status" => 0, - ":other_libraries_used" => 1, - ":abstract_upload_date" => time(), - ":abstract_approval_date" => 0, - ":is_submitted" => 1 - ); - $submitted_abstract_id = db_query($query, $args, array( - 'return' => Database::RETURN_INSERT_ID - )); - } - else - { $query = "INSERT INTO {om_pssp_submitted_abstracts} ( proposal_id, approver_uid, @@ -335,7 +318,7 @@ function om_pssp_upload_abstract_code_form_submit($form, &$form_state) ":proposal_id" => $proposal_id, ":approver_uid" => 0, ":abstract_approval_status" => 0, - ":other_libraries_used" => 0, + ":other_libraries_used" => $other_libraries_used, ":abstract_upload_date" => time(), ":abstract_approval_date" => 0, ":is_submitted" => 1 @@ -343,7 +326,6 @@ function om_pssp_upload_abstract_code_form_submit($form, &$form_state) $submitted_abstract_id = db_query($query, $args, array( 'return' => Database::RETURN_INSERT_ID )); - } $query1 = "UPDATE {om_pssp_proposal} SET is_submitted = :is_submitted WHERE id = :id"; $args1 = array( @@ -357,13 +339,13 @@ function om_pssp_upload_abstract_code_form_submit($form, &$form_state) { $query = "UPDATE {om_pssp_submitted_abstracts} SET - + other_libraries_used = :other_libraries_used, abstract_upload_date =:abstract_upload_date, is_submitted= :is_submitted WHERE proposal_id = :proposal_id "; $args = array( - + ":other_libraries_used" => $other_libraries_used, ":abstract_upload_date" => time(), ":is_submitted" => 1, ":proposal_id" => $proposal_id |