-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSSHRCReportSettingsForm.inc.php
88 lines (68 loc) · 2.3 KB
/
SSHRCReportSettingsForm.inc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?php
/**
* @file SSHRCReportSettingsForm.inc.php
*
* Copyright (c) 2003-2010 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* @class SSHRCReportSettingsForm
* @ingroup plugins_generic_sshrcReport
*
* @brief Form for journal managers generate SSHRC Reports
*/
// $Id$
import('lib.pkp.classes.form.Form');
class SSHRCReportSettingsForm extends Form {
/** @var $journalId int */
var $journalId;
/** @var $plugin object */
var $plugin;
/**
* Constructor
* @param $plugin object
* @param $journalId int
*/
function SSHRCReportSettingsForm(&$plugin, $journalId) {
$this->journalId =& $journalId;
$this->plugin =& $plugin;
parent::Form($plugin->getTemplatePath() . 'settingsForm.tpl');
}
/**
* Initialize form data.
*/
function initData() {
$plugin =& $this->plugin;
$journal =& Request::getJournal();
$this->_data = array(
'impact' => $journal->getSetting('impact'),
'researchRecord' => $journal->getSetting('researchRecord'),
'editorialBoardFunc' => $journal->getSetting('editorialBoardFunc'),
'subscriptionInfo' => $journal->getSetting('subscriptionInfo'),
'ojsFields' => $journal->getSetting('sshrcPluginOJSFields'),
);
}
/**
* Assign form data to user-submitted data.
*/
function readInputData() {
$this->readUserVars(array('impact', 'researchRecord', 'editorialBoardFunc', 'subscriptionInfo', 'focusScopeDesc', 'authorGuidelines', 'reviewPolicy', 'reviewGuidelines', 'pubFreqPolicy'));
}
/**
* Save settings.
*/
function execute() {
$journal =& Request::getJournal();
$journal->updateSetting('impact', $this->getData('impact'), 'string', true);
$journal->updateSetting('researchRecord', $this->getData('researchRecord'), 'string', true);
$journal->updateSetting('editorialBoardFunc', $this->getData('editorialBoardFunc'), 'string', true);
$journal->updateSetting('subscriptionInfo', $this->getData('subscriptionInfo'), 'string', true);
$fields = array('focusScopeDesc', 'authorGuidelines', 'reviewPolicy', 'reviewGuidelines', 'pubFreqPolicy');
$sshrcPluginOJSFields = array();
foreach ($fields as $field) {
$sshrcPluginOJSFields[$field] = (boolean) $this->getData($field);
}
$journal->updateSetting('sshrcPluginOJSFields', $sshrcPluginOJSFields, 'object', false);
parent::execute();
}
}
?>