From 8217eebf9cf79414158f1df65dab890987d76bd2 Mon Sep 17 00:00:00 2001 From: prashant Date: Thu, 29 Jan 2015 15:26:35 +0530 Subject: added book suggestion form --- js/textbook_companion.js | 6 +- manage_proposal.inc | 58 ++++- search.inc | 6 +- settings.inc | 10 + textbook_companion.module | 589 +++++++++++++++++++++++++++++++++++++++++++++- 5 files changed, 651 insertions(+), 18 deletions(-) diff --git a/js/textbook_companion.js b/js/textbook_companion.js index ff9dd6e..bbbb851 100755 --- a/js/textbook_companion.js +++ b/js/textbook_companion.js @@ -120,17 +120,15 @@ $('#edit-version').change(function() { else { $('#edit-older-wrapper').hide(); - } - + } }); /* hide nonaicte_proposal form textbox of other reason */ $('#edit-other-reason-wrapper').hide(); $(function() { enable_cb(); - $("#edit-reason-4").click(enable_cb); + $("#edit-reason-Other-reason").click(enable_cb); }); - function enable_cb() { if (this.checked) { $('#edit-other-reason-wrapper').show(); diff --git a/manage_proposal.inc b/manage_proposal.inc index 7e117ec..9df2ddf 100755 --- a/manage_proposal.inc +++ b/manage_proposal.inc @@ -59,7 +59,7 @@ function _proposal_all() $proposal_rows[] = array( date('d-m-Y', $proposal_data->creation_date), - "{$preference_data->book}
by {$preference_data->author}", + "{$preference_data->book}
by {$preference_data->author}", l($proposal_data->full_name, 'user/' . $proposal_data->uid), date('d-m-Y', $proposal_data->completion_date), $proposal_status, @@ -199,6 +199,16 @@ function proposal_approval_form($form_state) '#value' => $row->scilab_version, '#title' => t('Scilab Version'), ); + $form['reference'] = array( + '#type' => 'item', + '#value' => $row->reference, + '#title' => t('References'), + ); + $form['reason'] = array( + '#type' => 'item', + '#value' => $row->reason, + '#title' => t('Reasons'), + ); /* get book preference */ $preference_rows = array(); @@ -207,16 +217,27 @@ function proposal_approval_form($form_state) { $preference_rows[$preference_data->id] = $preference_data->book . ' (Written by ' . $preference_data->author . ')'; } - + if($row->proposal_type == 1){ + $form['book_preference'] = array( + '#type' => 'radios', + '#options' => $preference_rows, + '#title' => t('Book Preferences'), + '#required' => TRUE, + + ); + } + else{ $form['book_preference'] = array( '#type' => 'radios', '#title' => t('Book Preferences'), '#options' => $preference_rows, - ); + '#required' => TRUE, + );} $form['disapprove'] = array( '#type' => 'checkbox', '#title' => t('Disapprove all the above book preferences'), + ); $form['message'] = array( @@ -395,6 +416,20 @@ function proposal_status_form($form_state) '#value' => $proposal_data->scilab_version, '#title' => t('Scilab Version'), ); + if($proposal_data->proposal_type == 1) + { + $form['reason'] = array( + '#type' => 'item', + '#value' => $proposal_data->reason, + '#title' => t('Reason'), + ); + $form['reference'] = array( + '#type' => 'item', + '#value' => $proposal_data->reference, + '#title' => t('References'), + ); + } + /* get book preference */ $preference_html = '