summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmanage_proposal.inc23
-rwxr-xr-xtextbook_companion.module17
2 files changed, 31 insertions, 9 deletions
diff --git a/manage_proposal.inc b/manage_proposal.inc
index 0e14809..29f178d 100755
--- a/manage_proposal.inc
+++ b/manage_proposal.inc
@@ -279,9 +279,14 @@ function proposal_approval_form($form, &$form_state)
);
$form['reference'] = array(
'#type' => 'item',
- '#markup' => $row->reference,
+ '#markup' => l($row->reference, $row->reference),
'#title' => t('References')
);
+ $form['book_download_link'] = array(
+ '#type' => 'item',
+ '#markup' => l($row->book_download_link, $row->book_download_link),
+ '#title' => t('Input download link for the proposed textbook')
+ );
$form['reason'] = array(
'#type' => 'item',
'#markup' => $row->reason,
@@ -592,11 +597,7 @@ function proposal_status_form($from, $form_state)
'#markup' => $proposal_data->reason,
'#title' => t('Reason')
);
- $form['reference'] = array(
- '#type' => 'hidden',
- '#markup' => $proposal_data->reference,
- '#title' => t('References')
- );
+
}
/* get book preference */
$preference_html = '<ul>';
@@ -618,6 +619,16 @@ function proposal_status_form($from, $form_state)
'#markup' => $preference_html,
'#title' => t('Book Preferences')
);
+ $form['reference'] = array(
+ '#type' => 'item',
+ '#markup' => l($proposal_data->reference, $proposal_data->reference),
+ '#title' => t('References')
+ );
+ $form['book_download_link'] = array(
+ '#type' => 'item',
+ '#markup' => l($proposal_data->book_download_link, $proposal_data->book_download_link),
+ '#title' => t('Input download link for the proposed textbook')
+ );
$proposal_status = '';
switch ($proposal_data->proposal_status) {
case 0:
diff --git a/textbook_companion.module b/textbook_companion.module
index 83b7928..b03f46a 100755
--- a/textbook_companion.module
+++ b/textbook_companion.module
@@ -1406,6 +1406,16 @@ function book_proposal_form($form, &$form_state)
'#default_value' => '1',
'#required' => FALSE
);
+ $form['book_download_link'] = array(
+ '#type' => 'textarea',
+ '#title' => t('Input download link for the proposed textbook'),
+ '#required' => TRUE,
+ '#size' => 500,
+ '#maxlength' => 500,
+ '#attributes' => array(
+ 'placeholder' => 'Please add a link to download the proposed textbook from an online source. In case of a hard copy, kindly create a pdf of the entire textbook along with the cover and back page using a mobile application like CamScanner or some other method of choice. Then upload the pdf on google drive and enter the download link here.'
+ )
+ );
$form['reference'] = array(
'#type' => 'textarea',
'#title' => t('Reference'),
@@ -1670,9 +1680,9 @@ function book_proposal_form_submit($form, &$form_state, $directory_name = NULL)
$form_state['values']['reason'] = $my_reason;
} //isset($_POST['reason'])
$query = "INSERT INTO {textbook_companion_proposal}
- (uid, approver_uid, name_title, full_name, mobile, how_project, course, branch, university,city,pincode,state,country, faculty, reviewer,reference, completion_date, creation_date, approval_date, proposal_status, r_version, operating_system, teacher_email,reason,samplefilepath,proposal_type,proposed_completion_date) VALUES (:uid, :approver_uid, :name_title, :full_name, :mobile, :how_project, :course, :branch, :university, :city,:pincode,:state,:country, :faculty, :reviewer,:reference, :completion_date,
+ (uid, approver_uid, name_title, full_name, mobile, how_project, course, branch, university,city,pincode,state,country, faculty, reviewer,reference, completion_date, creation_date, approval_date, proposal_status, r_version, operating_system, teacher_email,reason,samplefilepath,proposal_type,proposed_completion_date, book_download_link) VALUES (:uid, :approver_uid, :name_title, :full_name, :mobile, :how_project, :course, :branch, :university, :city,:pincode,:state,:country, :faculty, :reviewer,:reference, :completion_date,
:creation_date, :approval_date, :proposal_status, :r_version, :operating_system,
-:teacher_email,:reason,:samplefilepath,:proposal_type, :proposed_completion_date)";
+:teacher_email,:reason,:samplefilepath,:proposal_type, :proposed_completion_date, :book_download_link)";
$args = array(
":uid" => $user->uid,
":approver_uid" => 0,
@@ -1700,7 +1710,8 @@ function book_proposal_form_submit($form, &$form_state, $directory_name = NULL)
":reason" => $form_state['values']['reason'],
":samplefilepath" => "",
":proposal_type" => 0,
- ":proposed_completion_date" => $completion_date_timestamp
+ ":proposed_completion_date" => $completion_date_timestamp,
+ ":book_download_link" => $form_state['values']['book_download_link']
);
$result = db_query($query, $args, array(
'return' => Database::RETURN_INSERT_ID