* Please select any 3 books from the below available list.
";
- $page_content .= "Unable to propose particular book: Click here";
- $page_content .= "Do not wish to propose any of the below books: Click here";
+ $page_content .= "
* Please select any 3 books from the below list.
";
+ //$page_content .= "Unable to propose particular book: Click here";
+ //$page_content .= "Do not wish to propose any of the below books: Click here";
$page_content .= "Search : ";
$page_content .= "";
$page_content .= drupal_get_form("textbook_companion_aicte_report_form");
@@ -833,6 +849,65 @@ function textbook_companion_proposal_all() {
return $page_content;
}
+function textbook_companion_proposals_all() {
+ global $user;
+ $page_content = "";
+
+ // if (!$user->uid) {
+ // drupal_set_message('It is mandatory to login on this website to access the proposal form', 'error');
+ // return;
+ // }
+
+ /* check if user has already submitted a proposal */
+ $proposal_q = db_query("SELECT * FROM {textbook_companion_proposal} WHERE uid = %d ORDER BY id DESC LIMIT 1", $user->uid);
+ if ($proposal_q) {
+ if ($proposal_data = db_fetch_object($proposal_q)) {
+ switch ($proposal_data->proposal_status) {
+ case 0:
+ drupal_set_message(t('We have already received your proposal. We will get back to you soon.'), 'status');
+ drupal_goto('');
+ return;
+ break;
+ case 1:
+ drupal_set_message(t('Your proposal has been approved. Please go to ' . l('Code Submission', 'textbook_companion/code') . ' to upload your code'), 'status');
+ drupal_goto('');
+ return;
+ break;
+ case 2:
+ drupal_set_message(t('Your proposal has been dis-approved. Please create another proposal below.'), 'error');
+ break;
+ case 3:
+ drupal_set_message(t('Congratulations! You have completed your last book proposal. You can create another proposal below.'), 'status');
+ break;
+ default:
+ drupal_set_message(t('Invalid proposal state. Please contact site administrator for further information.'), 'error');
+ drupal_goto('');
+ return;
+ break;
+ }
+ }
+ }
+
+ $selections = variable_get("aicte_".$user->uid, "");
+ if($selections) {
+ $selections = implode(",", $selections);
+ $query = "
+ SELECT * FROM textbook_companion_aicte
+ WHERE id IN ({$selections})
+ ";
+ $result = db_query($query);
+ $row1 = db_fetch_object($result);
+ $row2 = db_fetch_object($result);
+ $row3 = db_fetch_object($result);
+ $page_content .= drupal_get_form("book_proposal_form", $row1, $row2, $row3);
+ } else {
+ $page_content .= drupal_get_form("book_proposal_form");
+ // drupal_goto("aicte_proposal");
+ }
+
+ return $page_content;
+}
+
function book_proposal_form($form_state, $row1=NULL, $row2=NULL, $row3=NULL)
{
global $user;
@@ -1383,7 +1458,8 @@ function textbook_companion_mail($key, &$message, $params)
$language = $message['lianguage'];
$tbc_bcc_emails = array(
'Bcc' => variable_get('textbook_companion_emails', ''),
- );
+ );
+
switch ($key)
{
case 'proposal_received':
@@ -1464,6 +1540,7 @@ Best Wishes,
$user_data = user_load($params['proposal_disapproved']['user_id']);
$message['subject'] = t('[!site_name] Your book proposal has been disapproved', array('!site_name' => variable_get('site_name', '')), $language->language);
+ if($proposal_data->proposal_type != 1){
$message['body'] = t('
Dear !user_name,
@@ -1510,8 +1587,141 @@ Year of publication : ' . $preference3_data->year . '
Best Wishes,
!site_name', array('!site_name' => variable_get('site_name', ''), '!user_name' => $user_data->name), $language->language);
+}
+else{
+//Non AICTE book proposal dissaprove//
+$message['body'] = t('
+Dear !user_name,
+
+Your following book proposal has been disapproved:
+
+Reason for disapproval: ' . $proposal_data->message . '
+
+Full Name : ' . $proposal_data->full_name . '
+Email : ' . $user_data->mail . '
+Mobile : ' . $proposal_data->mobile . '
+Course : ' . $proposal_data->course . '
+Department/Branch : ' . $proposal_data->branch . '
+University/Institute : ' . $proposal_data->university . '
+College Teacher / Professor : ' . $proposal_data->faculty . '
+Reviewer : ' . $proposal_data->reviewer . '
+Expected date of completion : ' . date('d-m-Y', $proposal_data->completion_date) . '
+
+Your Book Preferences :
+
+Book Preference :-
+Title of the book : ' . $preference1_data->book . '
+Author name : ' . $preference1_data->author . '
+ISBN No. : ' . $preference1_data->isbn . '
+Publisher and Place : ' . $preference1_data->publisher . '
+Edition : ' . $preference1_data->edition . '
+Year of publication : ' . $preference1_data->year . '
+
+
+
+Best Wishes,
+
+!site_name', array('!site_name' => variable_get('site_name', ''), '!user_name' => $user_data->name), $language->language);
+}
break;
+ /* Non AICTE Book Proposal */
+ case 'nonaicte_proposal_received':
+ // bcc to textbook_companion_emails
+ $message['headers'] += $tbc_bcc_emails;
+ /* initializing data */
+ $proposal_q = db_query("SELECT * FROM {textbook_companion_proposal} WHERE id = %d LIMIT 1", $params['proposal_received']['proposal_id']);
+ $proposal_data = db_fetch_object($proposal_q);
+ $preference1_q = db_query("SELECT * FROM {textbook_companion_preference} WHERE proposal_id = %d AND pref_number = %d LIMIT 1", $params['proposal_received']['proposal_id'], 1);
+ $preference1_data = db_fetch_object($preference1_q);
+
+ $user_data = user_load($params['proposal_received']['user_id']);
+
+ $message['subject'] = t('[!site_name] Your book proposal has been received', array('!site_name' => variable_get('site_name', '')), $language->language);
+ $message['body'] = t('
+Dear !user_name,
+
+We have received your following book proposal:
+
+Full Name : ' . $proposal_data->full_name . '
+Email : ' . $user_data->mail . '
+Mobile : ' . $proposal_data->mobile . '
+Course : ' . $proposal_data->course . '
+Department/Branch : ' . $proposal_data->branch . '
+University/Institute : ' . $proposal_data->university . '
+College Teacher / Professor : ' . $proposal_data->faculty . '
+Reviewer : ' . $proposal_data->reviewer . '
+Expected date of completion : ' . date('d-m-Y', $proposal_data->completion_date) . '
+
+Your Non AICTE Book Preferences :
+
+Book Preference :-
+Title of the book : ' . $preference1_data->book . '
+Author name : ' . $preference1_data->author . '
+ISBN No. : ' . $preference1_data->isbn . '
+Publisher and Place : ' . $preference1_data->publisher . '
+Edition : ' . $preference1_data->edition . '
+Year of publication : ' . $preference1_data->year . '
+
+
+Your proposal is under review and you will soon receive an email from us regarding the same.
+
+Best Wishes,
+
+!site_name', array('!site_name' => variable_get('site_name', ''), '!user_name' => $user_data->name), $language->language);
+ break;
+case 'nonaicte_proposal_to_pi':
+ // bcc to textbook_companion_emails
+ $message['headers'] += $tbc_bcc_emails;
+ /* initializing data */
+ $proposal_q = db_query("SELECT * FROM {textbook_companion_proposal} WHERE id = %d LIMIT 1", $params['proposal_received']['proposal_id']);
+ $proposal_data = db_fetch_object($proposal_q);
+ $preference1_q = db_query("SELECT * FROM {textbook_companion_preference} WHERE proposal_id = %d AND pref_number = %d LIMIT 1", $params['proposal_received']['proposal_id'], 1);
+ $preference1_data = db_fetch_object($preference1_q);
+
+ $user_data = user_load($params['proposal_received']['user_id']);
+
+ $message['subject'] = t('[!site_name] Your book proposal has been received', array('!site_name' => variable_get('site_name', '')), $language->language);
+ $message['body'] = t('
+Dear Sir,
+
+We have received following book proposal:
+
+Full Name : ' . $proposal_data->full_name . '
+Email : ' . $user_data->mail . '
+Mobile : ' . $proposal_data->mobile . '
+Course : ' . $proposal_data->course . '
+Department/Branch : ' . $proposal_data->branch . '
+University/Institute : ' . $proposal_data->university . '
+College Teacher / Professor : ' . $proposal_data->faculty . '
+Reviewer : ' . $proposal_data->reviewer . '
+Expected date of completion : ' . date('d-m-Y', $proposal_data->completion_date) . '
+
+Reason(s): '. $proposal_data->reason . '
+
+
+Your Non AICTE Book Preferences :
+
+Book Preference :-
+Title of the book : ' . $preference1_data->book . '
+Author name : ' . $preference1_data->author . '
+ISBN No. : ' . $preference1_data->isbn . '
+Publisher and Place : ' . $preference1_data->publisher . '
+Edition : ' . $preference1_data->edition . '
+Year of publication : ' . $preference1_data->year . '
+
+Reference :- '.$proposal_data->reference.'
+
+Please click here for further approval/disapproval : http://scilab.in/comments
+
+
+Best Wishes,
+
+!site_name', array('!site_name' => variable_get('site_name', ''), '!user_name' => $user_data->name), $language->language);
+ break;
+
+
+
case 'proposal_approved':
// bcc to textbook_companion_emails
$message['headers'] += $tbc_bcc_emails;
@@ -2048,7 +2258,7 @@ function delete_example($example_id)
return $status;
}
-function delete_chapter($chapter_id)
+function delete_chapter($chapter_id)
{
$status = TRUE;
$root_path = textbook_companion_path();
@@ -2164,6 +2374,371 @@ function delete_file($file_id)
}
}
+//Non aicte book proposal form
+
+function book_proposal_nonaicte_form($form_state)
+{
+
+ global $user;
+ $form = array();
+ $form['imp_notice'] = array(
+ '#type' => 'item',
+ '#value' => 'Please fill up this form carefully as the details entered here will be exactly written in the Textbook Companion and also follow the additional guidelines.',
+ );
+ $form['guidelines'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Guidelines'),
+ '#attributes' => array('style'=>'font-weight: bold'),
+ '#collapsible' => TRUE,
+ '#collapsed' => TRUE,
+ );
+ $form['guidelines']['book'] = array(
+ '#type' => 'item',
+ '#required' => TRUE,
+ '#value' => '
+
All the fields are compulsory
+
Proof (example: syllabus) to the usage/ popularity of the textbook must be provided in the references box below
+
Please make sure that the book proposed by you has at least 80 examples which include numerical computations and which can be coded in Scilab
+
If the book has less than 80 examples the honorarium will be provided on a pro-rata basis