20 import(
'classes.monograph.Chapter');
21 import(
'classes.monograph.ChapterAuthor');
30 function getAuthors($publicationId =
null, $chapterId =
null) {
32 if (isset($publicationId)) $params[] = (int) $publicationId;
33 if (isset($chapterId)) $params[] = (
int) $chapterId;
42 p.locale AS submission_locale
44 JOIN publications p ON (p.publication_id = a.publication_id)
45 JOIN submission_chapter_authors sca ON (a.author_id = sca.author_id)
46 JOIN user_groups ug ON (a.user_group_id = ug.user_group_id)' .
47 ( (count($params)> 0)?
' WHERE':
'' ) .
48 ( isset($publicationId)?
' a.publication_id = ?':
'' ) .
49 ( (isset($publicationId) && isset($chapterId))?
' AND':
'' ) .
50 ( isset($chapterId)?
' sca.chapter_id = ?':
'' ) .
51 ' ORDER BY sca.chapter_id, sca.seq';
53 $result = $this->
retrieve($sql, $params);
66 FROM submission_chapter_authors
67 WHERE chapter_id = ?',
72 while (!$result->EOF) {
73 $authorIds[] = $result->fields[0];
92 'INSERT INTO submission_chapter_authors
93 (author_id, chapter_id, primary_contact, seq)
110 $params = array((
int) $authorId);
111 if ($chapterId) $params[] = (int) $chapterId;
114 'DELETE FROM submission_chapter_authors WHERE author_id = ?' .
115 ($chapterId?
' AND chapter_id = ?':
''),
126 'DELETE FROM submission_chapter_authors WHERE chapter_id = ?',
147 $author = $authorDao->_fromRow($row);
150 $chapterAuthor->setId((
int) $author->getId());
151 $chapterAuthor->setGivenName($author->getGivenName(
null),
null);
152 $chapterAuthor->setFamilyName($author->getFamilyName(
null),
null);
153 $chapterAuthor->setAffiliation($author->getAffiliation(
null),
null);
154 $chapterAuthor->setCountry($author->getCountry());
155 $chapterAuthor->setEmail($author->getEmail());
156 $chapterAuthor->setUrl($author->getUrl());
157 $chapterAuthor->setUserGroupId($author->getUserGroupId());
160 $chapterAuthor->setPrimaryContact($row[
'primary_contact']);
161 $chapterAuthor->setSequence((
int) $row[
'seq']); ;
162 $chapterAuthor->setChapterId((
int) $row[
'chapter_id']);
164 return $chapterAuthor;