Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
AdvancedSearchReviewerFilterForm.inc.php
1 <?php
2 
16 import('lib.pkp.classes.form.Form');
17 
20  var $_submission;
21 
23  var $_stageId;
24 
26  var $_reviewRoundId;
27 
34  function AdvancedSearchReviewerFilterForm($submission, $stageId, $reviewRoundId) {
35  parent::Form();
36  $this->_submission = $submission;
37  $this->_stageId = $stageId;
38  $this->_reviewRoundId = $reviewRoundId;
39  $this->setTemplate('controllers/grid/users/reviewer/form/advancedSearchReviewerFilterForm.tpl');
40  }
41 
46  function getSubmission() {
47  return $this->_submission;
48  }
49 
54  function getStageId() {
55  return $this->_stageId;
56  }
57 
62  function getReviewRoundId() {
63  return $this->_reviewRoundId;
64  }
65 
66  /*
67  * Initialize the filter form inputs
68  * @param $filterData array
69  * @param $request PKPRequest
70  */
71  function initData($filterData, $request) {
72  $this->_data = $filterData;
73 
74  $submission = $this->getSubmission();
75  $this->setData('submissionId', $submission->getId());
76  $this->setData('stageId', $this->getStageId());
77  $this->setData('reviewRoundId', $this->getReviewRoundId());
78 
79  return parent::initData($filterData, $request);
80  }
81 
86  function readInputData() {
87  $this->readUserVars(array(
88  'doneMin',
89  'doneMax',
90  'avgMin',
91  'avgMax',
92  'lastMin',
93  'lastMax',
94  'activeMin',
95  'activeMax',
96  'keywords')
97  );
98 
99  $keywords = $this->getData('keywords');
100  if (is_array($keywords) && array_key_exists('interests', $keywords)) {
101  $interests = $keywords['interests'];
102  if ($interests != null && is_array($interests)) {
103  // The interests are coming in encoded -- Decode them for DB storage
104  $this->setData('interestSearchKeywords', array_map('urldecode', $interests));
105  }
106  }
107  parent::readInputData();
108  }
109 
114  function getFilterSelectionData() {
115  $reviewerValues = array(
116  'doneMin' => (int) $this->getData('doneMin'),
117  'doneMax' => (int) $this->getData('doneMax'),
118  'avgMin' => (int) $this->getData('avgMin'),
119  'avgMax' => (int) $this->getData('avgMax'),
120  'lastMin' => (int) $this->getData('lastMin'),
121  'lastMax' => (int) $this->getData('lastMax'),
122  'activeMin' => (int) $this->getData('activeMin'),
123  'activeMax' => (int) $this->getData('activeMax')
124  );
125 
126  return $filterSelectionData = array(
127  'reviewerValues' => $reviewerValues,
128  'interestSearchKeywords' => $this->getData('interestSearchKeywords')
129  );
130  }
131 }
132 
133 ?>
setData($key, $value)
Definition: Form.inc.php:219
readUserVars($vars)
Definition: Form.inc.php:364
Class defining basic operations for handling HTML forms.
Definition: Form.inc.php:47
initData()
Definition: Form.inc.php:227
getData($key)
Definition: Form.inc.php:210
setTemplate($template)
Definition: Form.inc.php:121
Form to filter the reviewer select grid.
AdvancedSearchReviewerFilterForm($submission, $stageId, $reviewRoundId)