diff options
-rwxr-xr-x | code.inc | 6 | ||||
-rwxr-xr-x | email.inc | 83 | ||||
-rw-r--r-- | my_proposals.inc | 18 | ||||
-rwxr-xr-x | proposal.inc | 17 |
4 files changed, 97 insertions, 27 deletions
@@ -28,7 +28,7 @@ function upload_examples_form($form, &$form_state, $no_js_use = FALSE) { case 0: drupal_set_message(t('We have already received your proposal. We will get back to you soon.'), 'status'); - drupal_goto(''); + drupal_goto('arduino-projects'); return; break; case 2: @@ -43,11 +43,11 @@ function upload_examples_form($form, &$form_state, $no_js_use = FALSE) break; case 5: drupal_set_message(t('You have submitted your all codes.'), 'status'); - drupal_goto(''); + drupal_goto('arduino-projects'); return; default: drupal_set_message(t('Invalid proposal state. Please contact site administrator for further information.'), 'error'); - drupal_goto(''); + drupal_goto('arduino-projects'); return; break; } @@ -33,7 +33,7 @@ Full Name: ' . $proposal_data->contributor_name . ' Email: ' . $user_data->mail . ' University/Institute: ' . $proposal_data->university . ' City: ' . $proposal_data->city . ' -How did you hear about us:' . $proposal_data->how_did_you_hear_about_us . ' +How did you hear about us: ' . $proposal_data->how_did_you_hear_about_us . ' Project Title: ' . $proposal_data->project_title . ' Abstract: ' . $proposal_data->abstract . ' References: ' . $proposal_data->reference . ' @@ -51,6 +51,50 @@ FOSSEE, IIT Bombay', array( )) ); break; + case 'arduino_projects_blog_proposal_approved': + /* initializing data */ + $query = db_select('arduino_projects_blog_proposal'); + $query->fields('arduino_projects_blog_proposal'); + $query->condition('id', $params['arduino_projects_blog_proposal_approved']['proposal_id']); + $query->range(0, 1); + $proposal_data = $query->execute()->fetchObject(); + $user_data = user_load($params['arduino_projects_blog_proposal_approved']['user_id']); + $url = 'https://om.fossee.in/powersystems/pssp/coding-guidelines'; + $message['headers'] = $params['arduino_projects_blog_proposal_approved']['headers']; + $message['subject'] = t('[!site_name][Arduino Projects] Proposal for OSHW project approved', array( + '!site_name' => variable_get('site_name', '') + ), array( + 'language' => $language->language + )); + $message['body'] = array( + 'body' => t(' +Dear ' . $proposal_data->contributor_name . ', + +Congratulations! Your proposal for the Open Source Hardware Project with the following details, is approved. + + +Full Name: ' . $proposal_data->contributor_name . ' +Email: ' . $user_data->mail . ' +University/Institute: ' . $proposal_data->university . ' +City: ' . $proposal_data->city . ' +How did you hear about us: ' . $proposal_data->how_did_you_hear_about_us . ' +Project Title: ' . $proposal_data->project_title . ' +Abstract: ' . $proposal_data->abstract . ' +References: ' . $proposal_data->reference . ' + +Please ensure that ALL the guidelines for submissions are strictly followed. + +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 'arduino_projects_blog_proposal_resubmit': /* initializing data */ $query = db_select('arduino_projects_blog_proposal'); @@ -60,11 +104,12 @@ FOSSEE, IIT Bombay', array( $proposal_data = $query->execute()->fetchObject(); $user_data = user_load($params['arduino_projects_blog_proposal_resubmit']['user_id']); $message['headers'] = $params['arduino_projects_blog_proposal_resubmit']['headers']; - $message['subject'] = t('[!site_name][Arduino Project] Your Arduino Project proposal has been marked for resubmission', array( + $message['subject'] = t('[!site_name][Arduino Projects] Your OSHW proposal has been marked for resubmission', array( '!site_name' => variable_get('site_name', '') ), array( 'language' => $language->language )); + $url = l('here', '/arduino-projects/my-proposals'); $message['body'] = array( 'body' => t(' Dear ' . $proposal_data->contributor_name . ', @@ -75,7 +120,7 @@ Full Name: ' . $proposal_data->contributor_name . ' Email: ' . $user_data->mail . ' University/Institute: ' . $proposal_data->university . ' City: ' . $proposal_data->city . ' -How did you hear about us:' . $proposal_data->how_did_you_hear_about_us . ' +How did you hear about us: ' . $proposal_data->how_did_you_hear_about_us . ' Project Title: ' . $proposal_data->project_title . ' Abstract: ' . $proposal_data->abstract . ' References: ' . $proposal_data->reference . ' @@ -86,8 +131,9 @@ Comment: ' . $proposal_data->resubmit_comment . ' Failing to do so within 2 weeks from today, will automatically lead to disapproval of the proposal. Please note that once you resubmit the proposal, it will be reviewed again. -Thank you for participating in the Open Source Hardware Project and looking forward to your response. +You may edit and resubmit you proposal' . $url . '. +Thank you for participating in the Open Source Hardware Project and looking forward to your response. Best Wishes, @@ -109,7 +155,7 @@ FOSSEE, IIT Bombay', array( $proposal_data = $query->execute()->fetchObject(); $user_data = user_load($params['arduino_projects_blog_proposal_disapproved']['user_id']); $message['headers'] = $params['arduino_projects_blog_proposal_disapproved']['headers']; - $message['subject'] = t('[!site_name][Arduino Project] Your Arduino Project Project proposal has been disapproved', array( + $message['subject'] = t('[!site_name][Arduino Projects] Your OSHW proposal has been disapproved', array( '!site_name' => variable_get('site_name', '') ), array( 'language' => $language->language @@ -118,14 +164,16 @@ FOSSEE, IIT Bombay', array( 'body' => t(' Dear ' . $proposal_data->contributor_name . ', -We regret to inform you that your Arduino Project proposal, with following details, has been disapproved. +We regret to inform you that your Open Source Hardware Project proposal with the following details have been disapproved. Full Name: ' . $proposal_data->contributor_name . ' Email: ' . $user_data->mail . ' University/Institute: ' . $proposal_data->university . ' City: ' . $proposal_data->city . ' +How did you hear about us: ' . $proposal_data->how_did_you_hear_about_us . ' Project Title: ' . $proposal_data->project_title . ' Abstract: ' . $proposal_data->abstract . ' +References: ' . $proposal_data->reference . ' Reason(s) / Feedback: ' . $proposal_data->dissapproval_reason . ' @@ -133,8 +181,6 @@ Please note that any files that were uploaded along with the proposal form will Thank you for participating in the Open Source Hardware Project. You are welcome to submit a new proposal. - - Best Wishes, !site_name Team, @@ -146,38 +192,37 @@ FOSSEE, IIT Bombay', array( )) ); break; - case 'arduino_projects_blog_proposal_approved': + case 'arduino_projects_blog_proposal_resubmit_ack': /* initializing data */ $query = db_select('arduino_projects_blog_proposal'); $query->fields('arduino_projects_blog_proposal'); - $query->condition('id', $params['arduino_projects_blog_proposal_approved']['proposal_id']); + $query->condition('id', $params['arduino_projects_blog_proposal_resubmit_ack']['proposal_id']); $query->range(0, 1); $proposal_data = $query->execute()->fetchObject(); - $user_data = user_load($params['arduino_projects_blog_proposal_approved']['user_id']); - $url = 'https://om.fossee.in/powersystems/pssp/coding-guidelines'; - $message['headers'] = $params['arduino_projects_blog_proposal_approved']['headers']; - $message['subject'] = t('[!site_name][Power Simulation Simulation Project] Your Power Simulation Simulation Project proposal has been approved', array( + $user_data = user_load($params['arduino_projects_blog_proposal_resubmit_ack']['user_id']); + $message['headers'] = $params['arduino_projects_blog_proposal_resubmit_ack']['headers']; + $message['subject'] = t('[!site_name][Arduino Projects] Proposal Resubmission for OSHW project is successful', array( '!site_name' => variable_get('site_name', '') ), array( 'language' => $language->language )); + $url = l('here', '/arduino-projects/my-proposals'); $message['body'] = array( 'body' => t(' Dear ' . $proposal_data->contributor_name . ', -Congratulations! Your proposal for Arduino Project with the following details is approved. +Thank you for your re-submission. We have received your resubmitted proposal for the Open Source Hardware Project with the following details: Full Name: ' . $proposal_data->contributor_name . ' Email: ' . $user_data->mail . ' University/Institute: ' . $proposal_data->university . ' City: ' . $proposal_data->city . ' - +How did you hear about us: ' . $proposal_data->how_did_you_hear_about_us . ' Project Title: ' . $proposal_data->project_title . ' Abstract: ' . $proposal_data->abstract . ' +References: ' . $proposal_data->reference . ' - -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. - +Your proposal is under review. You will receive an email as soon as it has been reviewed. Best Wishes, diff --git a/my_proposals.inc b/my_proposals.inc index 7c7e3aa..10ba23d 100644 --- a/my_proposals.inc +++ b/my_proposals.inc @@ -432,6 +432,24 @@ function arduino_projects_blog_my_proposal_edit_form_submit($form, &$form_state) } drupal_set_message(t('Proposal Updated'), 'status'); + $user_data = user_load($proposal_data->uid); + $email_to = $user_data->mail; + $from = variable_get('arduino_projects_blog_from_email', ''); + $bcc = $user->mail . ', ' . variable_get('arduino_projects_blog_bcc_emails', ''); + $cc = variable_get('arduino_projects_blog_cc_emails', ''); + $params['arduino_projects_blog_proposal_resubmit_ack']['proposal_id'] = $proposal_data->id; + $params['arduino_projects_blog_proposal_resubmit_ack']['user_id'] = $proposal_data->uid; + $params['arduino_projects_blog_proposal_resubmit_ack']['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('arduino_projects_blog', 'arduino_projects_blog_proposal_resubmit_ack', $email_to, language_default(), $params, $from, TRUE)) + drupal_set_message('Error sending email message.', 'error'); drupal_goto('arduino-projects/my-proposals'); } diff --git a/proposal.inc b/proposal.inc index 695a598..9ddd45a 100755 --- a/proposal.inc +++ b/proposal.inc @@ -24,7 +24,7 @@ function arduino_projects_blog_proposal_form($form, &$form_state, $no_js_use = F { $msg = drupal_set_message(t('It is mandatory to ' . l('login', 'user') . ' on this website to access the proposal form. If you are new user please create a new account first.'), 'error'); //drupal_goto('/pssp'); - drupal_goto('user'); + drupal_goto('user/login', array('query' => drupal_get_destination())); return $msg; } //$user->uid == 0 $query = db_select('arduino_projects_blog_proposal'); @@ -39,7 +39,7 @@ function arduino_projects_blog_proposal_form($form, &$form_state, $no_js_use = F if ($proposal_data->approval_status == 0 || $proposal_data->approval_status == 1 || $proposal_data->approval_status == 2) { drupal_set_message(t('We have already received your proposal.'), 'status'); - drupal_goto(''); + drupal_goto('arduino-projects'); return; } //$proposal_data->approval_status == 0 || $proposal_data->approval_status == 1 } //$proposal_data @@ -512,9 +512,9 @@ function arduino_projects_blog_proposal_form_submit($form, &$form_state) $args = array( ":uid" => $user->uid, ":approver_uid" => 0, - ":contributor_name" => _df_sentence_case(trim($v['contributor_name'])), + ":contributor_name" => trim($v['contributor_name']), ":contact_no" => $v['contributor_contact_no'], - ":university" => _df_sentence_case($v['university']), + ":university" => $v['university'], ":city" => $v['city'], ":pincode" => $v['pincode'], ":state" => $v['all_state'], @@ -609,7 +609,7 @@ function arduino_projects_blog_proposal_form_submit($form, &$form_state) if (!drupal_mail('arduino_projects_blog', 'arduino_projects_blog_proposal_received', $email_to, user_preferred_language($user), $params, $form, TRUE)) drupal_set_message('Error sending email message.', 'error'); drupal_set_message(t('We have received your proposal. We will get back to you soon.'), 'status'); - drupal_goto(''); + drupal_goto('arduino-projects/my-proposals'); } @@ -617,6 +617,13 @@ function arduino_projects_blog_my_proposal() { global $user; /* get pending proposals to be approved */ + if ($user->uid == 0) + { + $msg = drupal_set_message(t('It is mandatory to login on this website to view your proposals. If you are new user please create a new account first.'), 'error'); + //drupal_goto('/pssp'); + drupal_goto('user/login', array('query' => drupal_get_destination())); + return $msg; + } $my_proposal_rows = array(); $query = db_select('arduino_projects_blog_proposal'); $query->fields('arduino_projects_blog_proposal'); |