-
Notifications
You must be signed in to change notification settings - Fork 0
/
PrereviewExportPluginDAO.inc.php
72 lines (57 loc) · 1.52 KB
/
PrereviewExportPluginDAO.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
<?php
/**
* @file plugins/importexport/prereview/PrereviewExportPluginDAO.inc.php
*
* @class PrereviewPluginDAO
* @ingroup plugins.importexport.prereview
*
*/
class PrereviewExportPluginDAO extends DAO {
var $_result;
var $_loadId;
/**
* Constructor
*/
function __construct() {
parent::__construct();
$this->_result = false;
$this->_loadId = null;
}
function getDataPrereview($id) {
$result = $this->retrieve(
'SELECT setting_value, status
FROM prereview_settings WHERE publication_id = ?',
array((int) $id)
);
$returner = $result->current();
return $returner;
}
function getAllData($contextId) {
$result = $this->retrieve(
'SELECT submissions.submission_id id, publication_settings.setting_value doi, prereview_settings.setting_value prereview, prereview_settings.status prereview_status
FROM submissions
INNER JOIN publications
INNER JOIN publication_settings
INNER JOIN prereview_settings
WHERE submissions.current_publication_id = publications.publication_id
AND publications.publication_id = publication_settings.publication_id
AND submissions.submission_id = prereview_settings.publication_id
AND publication_settings.setting_name="pub-id::doi"
AND context_id = ? AND submissions.status = 3',
array((int) $contextId)
);
return $result;
}
function updateStatus($status, $id) {
$this->update(
'UPDATE prereview_settings
SET status = ?
WHERE publication_id = ?',
array(
$status,
$id,
)
);
return true;
}
}