ocs  2.3.6
About: OCS (Open Conference System) is a Web publishing tool that will create a complete Web presence for your scholarly conference.
  Fossies Dox: ocs-2.3.6.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

PublishedPaperDAO.inc.php
Go to the documentation of this file.
1 <?php
2 
16 //$Id$
17 
18 import('paper.PublishedPaper');
19 
20 define('PAPER_SORT_ORDER_NATURAL', 0);
21 define('PAPER_SORT_ORDER_TIME', 1);
22 
23 class PublishedPaperDAO extends DAO {
24  var $paperDao;
28 
32  function PublishedPaperDAO() {
33  parent::DAO();
34  $this->paperDao =& DAORegistry::getDAO('PaperDAO');
35  $this->authorDao =& DAORegistry::getDAO('AuthorDAO');
36  $this->galleyDao =& DAORegistry::getDAO('PaperGalleyDAO');
37  $this->suppFileDao =& DAORegistry::getDAO('SuppFileDAO');
38  }
39 
46  function &getPublishedPapers($schedConfId, $sortOrder = PAPER_SORT_ORDER_NATURAL) {
47  $primaryLocale = AppLocale::getPrimaryLocale();
48  $locale = AppLocale::getLocale();
49 
50  $params = array(
51  'title',
52  $primaryLocale,
53  'title',
54  $locale,
55  'abbrev',
56  $primaryLocale,
57  'abbrev',
58  $locale,
59  $schedConfId
60  );
61 
62  $publishedPapers = array();
63 
64  $sql = 'SELECT pp.*,
65  p.*,
66  COALESCE(ttl.setting_value, ttpl.setting_value) AS track_title,
67  COALESCE(tal.setting_value, tapl.setting_value) AS track_abbrev,
68  t.seq AS track_seq, pp.seq
69  FROM published_papers pp,
70  papers p
71  LEFT JOIN tracks t ON t.track_id = p.track_id
72  LEFT JOIN track_settings ttpl ON (t.track_id = ttpl.track_id AND ttpl.setting_name = ? AND ttpl.locale = ?)
73  LEFT JOIN track_settings ttl ON (t.track_id = ttl.track_id AND ttl.setting_name = ? AND ttl.locale = ?)
74  LEFT JOIN track_settings tapl ON (t.track_id = tapl.track_id AND tapl.setting_name = ? AND tapl.locale = ?)
75  LEFT JOIN track_settings tal ON (t.track_id = tal.track_id AND tal.setting_name = ? AND tal.locale = ?)
76  WHERE pp.paper_id = p.paper_id
77  AND pp.sched_conf_id = ?
78  AND p.status = ' . STATUS_PUBLISHED;
79 
80  switch ($sortOrder) {
82  $sql .= ' ORDER BY p.start_time ASC, p.end_time ASC';
83  break;
85  default:
86  $sql .= ' ORDER BY track_seq ASC, pp.seq ASC';
87  break;
88  }
89 
90  $result =& $this->retrieve($sql, $params);
91  $returner = new DAOResultFactory($result, $this, '_returnPublishedPaperFromRow');
92  return $returner;
93  }
94 
98  function getPublishedPaperCountBySchedConfId($schedConfId) {
99  $result =& $this->retrieve(
100  'SELECT count(*) FROM published_papers pa, papers a WHERE pa.paper_id = a.paper_id AND a.sched_conf_id = ? AND a.status = ' . STATUS_PUBLISHED,
101  $schedConfId
102  );
103  list($count) = $result->fields;
104  $result->Close();
105  return $count;
106  }
107 
113  function &getPublishedPapersBySchedConfId($schedConfId, $rangeInfo = null) {
114  $primaryLocale = AppLocale::getPrimaryLocale();
115  $locale = AppLocale::getLocale();
116 
117  $result =& $this->retrieveRange(
118  'SELECT pp.*,
119  p.*,
120  COALESCE(ttl.setting_value, ttpl.setting_value) AS track_title,
121  COALESCE(tal.setting_value, tapl.setting_value) AS track_abbrev
122  FROM published_papers pp,
123  papers p
124  LEFT JOIN tracks t ON t.track_id = p.track_id
125  LEFT JOIN track_settings ttpl ON (t.track_id = ttpl.track_id AND ttpl.setting_name = ? AND ttpl.locale = ?)
126  LEFT JOIN track_settings ttl ON (t.track_id = ttl.track_id AND ttl.setting_name = ? AND ttl.locale = ?)
127  LEFT JOIN track_settings tapl ON (t.track_id = tapl.track_id AND tapl.setting_name = ? AND tapl.locale = ?)
128  LEFT JOIN track_settings tal ON (t.track_id = tal.track_id AND tal.setting_name = ? AND tal.locale = ?)
129  WHERE pp.paper_id = p.paper_id
130  AND p.sched_conf_id = ?
131  AND p.status = ' . STATUS_PUBLISHED,
132  array(
133  'title',
134  $primaryLocale,
135  'title',
136  $locale,
137  'abbrev',
138  $primaryLocale,
139  'abbrev',
140  $locale,
141  $schedConfId
142  ),
143  $rangeInfo
144  );
145 
146  $returner = new DAOResultFactory($result, $this, '_returnPublishedPaperFromRow');
147  return $returner;
148  }
149 
160  function &getPublishedPapersInTracks($schedConfId, $trackId = null, $searchField = null, $searchMatch = null, $search = null, $previewAbstracts = false) {
161  $primaryLocale = AppLocale::getPrimaryLocale();
162  $locale = AppLocale::getLocale();
163 
164  $publishedPapers = array();
165 
166  $params = array(
167  'title', // Paper title
168  $primaryLocale,
169  'title', // Paper title
170  $locale,
171  'title', // Track title
172  $primaryLocale,
173  'title', // Track title
174  $locale,
175  'abbrev',
176  $primaryLocale,
177  'abbrev',
178  $locale,
179  $schedConfId
180  );
181 
182  if ($trackId) $params[] = $trackId;
183  $searchSql = '';
184  if (!empty($search)) switch ($searchField) {
186  if ($searchMatch === 'is') {
187  $searchSql = ' AND LOWER(COALESCE(ptl.setting_value, ptpl.setting_value)) = LOWER(?)';
188  } else {
189  $searchSql = ' AND LOWER(COALESCE(ptl.setting_value, ptpl.setting_value)) LIKE LOWER(?)';
190  $search = '%' . $search . '%';
191  }
192  $params[] = $search;
193  break;
195  $directorSubmissionDao =& DAORegistry::getDAO('DirectorSubmissionDAO');
196  $searchSql = $directorSubmissionDao->_generateUserNameSearchSQL($search, $searchMatch, 'pp.', $params);
197  break;
198  }
199 
200  $result =& $this->retrieve(
201  'SELECT DISTINCT
202  pa.*,
203  p.*,
204  COALESCE(ttl.setting_value, ttpl.setting_value) AS track_title,
205  COALESCE(tal.setting_value, tapl.setting_value) AS track_abbrev,
206  t.seq AS track_seq,
207  pa.seq
208  FROM paper_authors pp,
209  papers p
210  LEFT JOIN published_papers pa ON (p.paper_id = pa.paper_id)
211  LEFT JOIN paper_settings ptl ON (p.paper_id = ptl.paper_id AND ptl.setting_name = ? AND ptl.locale = ?)
212  LEFT JOIN paper_settings ptpl ON (p.paper_id = ptpl.paper_id AND ptpl.setting_name = ? AND ptpl.locale = ?)
213  LEFT JOIN tracks t ON t.track_id = p.track_id
214  LEFT JOIN track_settings ttpl ON (t.track_id = ttpl.track_id AND ttpl.setting_name = ? AND ttpl.locale = ?)
215  LEFT JOIN track_settings ttl ON (t.track_id = ttl.track_id AND ttl.setting_name = ? AND ttl.locale = ?)
216  LEFT JOIN track_settings tapl ON (t.track_id = tapl.track_id AND tapl.setting_name = ? AND tapl.locale = ?)
217  LEFT JOIN track_settings tal ON (t.track_id = tal.track_id AND tal.setting_name = ? AND tal.locale = ?)
218  WHERE p.sched_conf_id = ?
219  AND (
220  (p.status = ' . STATUS_PUBLISHED . ' AND pa.paper_id IS NOT NULL)' .
221  ($previewAbstracts ? 'OR (p.review_mode <> ' . REVIEW_MODE_BOTH_SIMULTANEOUS . ' AND p.status = ' . STATUS_QUEUED . ' AND p.current_stage = ' . REVIEW_STAGE_PRESENTATION . ')':'') . '
222  )
223  AND pp.paper_id = p.paper_id
224  ' . ($trackId?'AND p.track_id = ?' : ''). '
225  ' . $searchSql . '
226  ORDER BY track_seq ASC, pa.seq ASC', $params
227  );
228 
229  $currTrackId = 0;
230  while (!$result->EOF) {
231  $row =& $result->GetRowAssoc(false);
232  $publishedPaper =& $this->_returnPublishedPaperFromRow($row);
233  if ($publishedPaper->getTrackId() != $currTrackId) {
234  $currTrackId = $publishedPaper->getTrackId();
235  $publishedPapers[$currTrackId] = array(
236  'papers'=> array(),
237  'title' => ''
238  );
239  $publishedPapers[$currTrackId]['title'] = $publishedPaper->getTrackTitle();
240  }
241  $publishedPapers[$currTrackId]['papers'][] = $publishedPaper;
242  $result->moveNext();
243  }
244 
245  $result->Close();
246  unset($result);
247 
248  return $publishedPapers;
249  }
250 
256  function &getPublishedPapersByTrackId($trackId, $schedConfId) {
257  $primaryLocale = AppLocale::getPrimaryLocale();
258  $locale = AppLocale::getLocale();
259 
260  $publishedPapers = array();
261 
262  $result =& $this->retrieve(
263  'SELECT pa.*,
264  a.*,
265  COALESCE(ttl.setting_value, ttpl.setting_value) AS track_title,
266  COALESCE(tal.setting_value, tapl.setting_value) AS track_abbrev
267  FROM published_papers pa,
268  papers a,
269  tracks t
270  LEFT JOIN track_settings ttpl ON (t.track_id = ttpl.track_id AND ttpl.setting_name = ? AND ttpl.locale = ?)
271  LEFT JOIN track_settings ttl ON (t.track_id = ttl.track_id AND ttl.setting_name = ? AND ttl.locale = ?)
272  LEFT JOIN track_settings tapl ON (t.track_id = tapl.track_id AND tapl.setting_name = ? AND tapl.locale = ?)
273  LEFT JOIN track_settings tal ON (t.track_id = tal.track_id AND tal.setting_name = ? AND tal.locale = ?)
274  WHERE a.track_id = t.track_id
275  AND pa.paper_id = a.paper_id
276  AND a.track_id = ?
277  AND pa.sched_conf_id = ?
278  AND a.status = ' . STATUS_PUBLISHED . '
279  ORDER BY pa.seq ASC', array(
280  'title',
281  $primaryLocale,
282  'title',
283  $locale,
284  'abbrev',
285  $primaryLocale,
286  'abbrev',
287  $locale,
288  $trackId,
289  $schedConfId
290  )
291  );
292 
293  $currTrackId = 0;
294  while (!$result->EOF) {
295  $publishedPaper =& $this->_returnPublishedPaperFromRow($result->GetRowAssoc(false));
296  $publishedPapers[] = $publishedPaper;
297  $result->moveNext();
298  }
299 
300  $result->Close();
301  unset($result);
302 
303  return $publishedPapers;
304  }
305 
311  function &getPublishedPaperById($pubId) {
312  $result =& $this->retrieve(
313  'SELECT * FROM published_papers WHERE pub_id = ?', $pubId
314  );
315  $row = $result->GetRowAssoc(false);
316 
317  $publishedPaper = new PublishedPaper();
318  $publishedPaper->setPubId($row['pub_id']);
319  $publishedPaper->setId($row['paper_id']);
320  $publishedPaper->setSchedConfId($row['sched_conf_id']);
321  $publishedPaper->setDatePublished($this->datetimeFromDB($row['date_published']));
322  $publishedPaper->setSeq($row['seq']);
323  $publishedPaper->setViews($row['views']);
324  $publishedPaper->setRoomId($row['room_id']);
325 
326  $publishedPaper->setSuppFiles($this->suppFileDao->getSuppFilesByPaper($row['paper_id']));
327 
328  $result->Close();
329  unset($result);
330 
331  return $publishedPaper;
332  }
333 
341  function &getPublishedPaperByPaperId($paperId, $schedConfId = null, $previewAbstracts = null) {
342  $primaryLocale = AppLocale::getPrimaryLocale();
343  $locale = AppLocale::getLocale();
344  $params = array(
345  'title',
346  $primaryLocale,
347  'title',
348  $locale,
349  'abbrev',
350  $primaryLocale,
351  'abbrev',
352  $locale,
353  $paperId
354  );
355  if ($schedConfId) $params[] = $schedConfId;
356 
357  $result =& $this->retrieve(
358  'SELECT pa.*,
359  a.*,
360  COALESCE(ttl.setting_value, ttpl.setting_value) AS track_title,
361  COALESCE(tal.setting_value, tapl.setting_value) AS track_abbrev
362  FROM papers a
363  LEFT JOIN published_papers pa ON (pa.paper_id = a.paper_id)
364  LEFT JOIN tracks t ON t.track_id = a.track_id
365  LEFT JOIN track_settings ttpl ON (t.track_id = ttpl.track_id AND ttpl.setting_name = ? AND ttpl.locale = ?)
366  LEFT JOIN track_settings ttl ON (t.track_id = ttl.track_id AND ttl.setting_name = ? AND ttl.locale = ?)
367  LEFT JOIN track_settings tapl ON (t.track_id = tapl.track_id AND tapl.setting_name = ? AND tapl.locale = ?)
368  LEFT JOIN track_settings tal ON (t.track_id = tal.track_id AND tal.setting_name = ? AND tal.locale = ?)
369  WHERE a.paper_id = ?' .
370  (isset($schedConfId)?' AND a.sched_conf_id = ?':'') .
371  ($previewAbstracts!==true?' AND pa.paper_id IS NOT NULL':'') .
372  ($previewAbstracts===true?' AND (a.status = ' . STATUS_PUBLISHED . ' OR (a.review_mode <> ' . REVIEW_MODE_BOTH_SIMULTANEOUS . ' AND a.status = ' . STATUS_QUEUED . ' AND a.current_stage = ' . REVIEW_STAGE_PRESENTATION . '))':'') .
373  ($previewAbstracts===false?' AND a.status = ' . STATUS_PUBLISHED:''),
374  $params
375  );
376 
377  $publishedPaper = null;
378  if ($result->RecordCount() != 0) {
379  $publishedPaper =& $this->_returnPublishedPaperFromRow($result->GetRowAssoc(false));
380  }
381 
382  $result->Close();
383  unset($result);
384 
385  return $publishedPaper;
386  }
387 
394  function &getPublishedPaperByPublicPaperId($schedConfId, $publicPaperId) {
395  $primaryLocale = AppLocale::getPrimaryLocale();
396  $locale = AppLocale::getLocale();
397 
398  $result =& $this->retrieve(
399  'SELECT pa.*,
400  a.*,
401  COALESCE(ttl.setting_value, ttpl.setting_value) AS track_title,
402  COALESCE(tal.setting_value, tapl.setting_value) AS track_abbrev
403  FROM published_papers pa,
404  papers a
405  LEFT JOIN tracks t ON t.track_id = a.track_id
406  LEFT JOIN track_settings ttpl ON (t.track_id = ttpl.track_id AND ttpl.setting_name = ? AND ttpl.locale = ?)
407  LEFT JOIN track_settings ttl ON (t.track_id = ttl.track_id AND ttl.setting_name = ? AND ttl.locale = ?)
408  LEFT JOIN track_settings tapl ON (t.track_id = tapl.track_id AND tapl.setting_name = ? AND tapl.locale = ?)
409  LEFT JOIN track_settings tal ON (t.track_id = tal.track_id AND tal.setting_name = ? AND tal.locale = ?)
410  WHERE pa.paper_id = a.paper_id
411  AND pa.public_paper_id = ?
412  AND a.sched_conf_id = ?',
413  array(
414  'title',
415  $primaryLocale,
416  'title',
417  $locale,
418  'abbrev',
419  $primaryLocale,
420  'abbrev',
421  $locale,
422  $publicPaperId,
423  $schedConfId
424  )
425  );
426 
427  $publishedPaper = null;
428  if ($result->RecordCount() != 0) {
429  $publishedPaper =& $this->_returnPublishedPaperFromRow($result->GetRowAssoc(false));
430  }
431 
432  $result->Close();
433  unset($result);
434 
435  return $publishedPaper;
436  }
437 
446  function &getPublishedPaperByBestPaperId($schedConfId, $paperId, $previewAbstracts = null) {
447  $paper =& $this->getPublishedPaperByPublicPaperId($schedConfId, $paperId);
448  if (!isset($paper) && ctype_digit("$paperId")) $paper =& $this->getPublishedPaperByPaperId((int) $paperId, $schedConfId, $previewAbstracts);
449  return $paper;
450  }
451 
460  function &getPublishedPaperIdsAlphabetizedByTitle($conferenceId = null, $schedConfId = null, $rangeInfo = null) {
461  $params = array(
462  'cleanTitle',
464  'cleanTitle',
466  );
467  if ($conferenceId) $params[] = $conferenceId;
468  if ($schedConfId) $params[] = $schedConfId;
469 
470  $paperIds = array();
471 
472  $result =& $this->retrieveCached(
473  'SELECT p.paper_id,
474  COALESCE(ptl.setting_value, ptpl.setting_value) AS paper_title
475  FROM published_papers pp,
476  papers p
477  ' . ($conferenceId?'LEFT JOIN sched_confs sc ON sc.sched_conf_id = p.sched_conf_id':'') . '
478  LEFT JOIN paper_settings ptl ON (ptl.setting_name = ? AND ptl.paper_id = p.paper_id AND ptl.locale = ?)
479  LEFT JOIN paper_settings ptpl ON (ptpl.setting_name = ? AND ptpl.paper_id = p.paper_id AND ptpl.locale = ?)
480  WHERE pp.paper_id = p.paper_id AND
481  p.status = ' . STATUS_PUBLISHED . '
482  ' . ($conferenceId?'AND sc.conference_id = ?':'') . '
483  ' . ($schedConfId?'AND p.sched_conf_id = ?':'') . '
484  ORDER BY paper_title',
485  $params
486  );
487 
488  while (!$result->EOF) {
489  $row = $result->getRowAssoc(false);
490  $paperIds[] = $row['paper_id'];
491  $result->MoveNext();
492  }
493 
494  $result->Close();
495  unset($result);
496 
497  return $paperIds;
498  }
499 
508  function &getPublishedPaperIdsAlphabetizedBySchedConf($conferenceId = null, $schedConfId = null, $rangeInfo = null) {
509  $params = array();
510  if ($conferenceId) $params[] = $conferenceId;
511  if ($schedConfId) $params[] = $schedConfId;
512 
513  $paperIds = array();
514 
515  $result =& $this->retrieveCached(
516  'SELECT p.paper_id AS pub_id
517  FROM published_papers pa,
518  papers p
519  ' . ($conferenceId?'LEFT JOIN sched_confs e ON e.sched_conf_id = p.sched_conf_id':'') . '
520  WHERE pa.paper_id = p.paper_id
521  AND p.status = ' . STATUS_PUBLISHED .
522  ($conferenceId?' AND e.conference_id = ?':'') .
523  ($schedConfId?' AND p.sched_conf_id = ?':'') .
524  ' ORDER BY p.sched_conf_id',
525  $params
526  );
527 
528  while (!$result->EOF) {
529  $row = $result->getRowAssoc(false);
530  $paperIds[] = $row['pub_id'];
531  $result->moveNext();
532  }
533 
534  $result->Close();
535  unset($result);
536 
537  return $paperIds;
538  }
539 
546  $publishedPaper = new PublishedPaper();
547  $publishedPaper->setPubId($row['pub_id']);
548  $publishedPaper->setSchedConfId($row['sched_conf_id']);
549  $publishedPaper->setDatePublished($this->datetimeFromDB($row['date_published']));
550  $publishedPaper->setSeq($row['seq']);
551  $publishedPaper->setViews($row['views']);
552  $publishedPaper->setPublicPaperId($row['public_paper_id']);
553  $publishedPaper->setRoomId($row['room_id']);
554 
555  // Paper attributes
556  $this->paperDao->_paperFromRow($publishedPaper, $row);
557 
558  $publishedPaper->setGalleys($this->galleyDao->getGalleysByPaper($row['paper_id']));
559 
560  $publishedPaper->setSuppFiles($this->suppFileDao->getSuppFilesByPaper($row['paper_id']));
561 
562  HookRegistry::call('PublishedPaperDAO::_returnPublishedPaperFromRow', array(&$publishedPaper, &$row));
563 
564  return $publishedPaper;
565  }
566 
573  function insertPublishedPaper(&$publishedPaper) {
574  $this->update(
575  sprintf('INSERT INTO published_papers
576  (paper_id, sched_conf_id, date_published, seq, public_paper_id, room_id)
577  VALUES
578  (?, ?, %s, ?, ?, ?)',
579  $this->datetimeToDB($publishedPaper->getDatePublished())),
580  array(
581  $publishedPaper->getId(),
582  $publishedPaper->getSchedConfId(),
583  $publishedPaper->getSeq(),
584  $publishedPaper->getPublicPaperId(),
585  $publishedPaper->getRoomId()
586  )
587  );
588 
589  $publishedPaper->setPubId($this->getInsertPublishedPaperId());
590  return $publishedPaper->getPubId();
591  }
592 
598  return $this->getInsertId('published_papers', 'pub_id');
599  }
600 
605  function deletePublishedPaperById($pubId) {
606  $this->update(
607  'DELETE FROM published_papers WHERE pub_id = ?', $pubId
608  );
609  }
610 
616  function deletePublishedPaperByPaperId($paperId) {
617  return $this->update(
618  'DELETE FROM published_papers WHERE paper_id = ?', $paperId
619  );
620  }
621 
626  function deletePublishedPapersByTrackId($trackId) {
627  $result =& $this->retrieve(
628  'SELECT pa.paper_id AS paper_id FROM published_papers pa, papers a WHERE pa.paper_id = a.paper_id AND a.track_id = ?', $trackId
629  );
630 
631  while (!$result->EOF) {
632  $row = $result->GetRowAssoc(false);
633  $this->update(
634  'DELETE FROM published_papers WHERE paper_id = ?', $row['paper_id']
635  );
636  }
637 
638  $result->Close();
639  unset($result);
640  }
641 
646  function deletePublishedPapersBySchedConfId($schedConfId) {
647  return $this->update(
648  'DELETE FROM published_papers WHERE sched_conf_id = ?', $schedConfId
649  );
650  }
651 
656  function updatePublishedPaper($publishedPaper) {
657  $this->update(
658  sprintf('UPDATE published_papers
659  SET
660  paper_id = ?,
661  sched_conf_id = ?,
662  date_published = %s,
663  seq = ?,
664  public_paper_id = ?,
665  room_id = ?
666  WHERE pub_id = ?',
667  $this->datetimeToDB($publishedPaper->getDatePublished())),
668  array(
669  $publishedPaper->getId(),
670  $publishedPaper->getSchedConfId(),
671  $publishedPaper->getSeq(),
672  $publishedPaper->getPublicPaperId(),
673  $publishedPaper->getRoomId(),
674  $publishedPaper->getPubId()
675  )
676  );
677  }
678 
685  function updatePublishedPaperField($pubId, $field, $value) {
686  $this->update(
687  "UPDATE published_papers SET $field = ? WHERE pub_id = ?", array($value, $pubId)
688  );
689  }
690 
694  function resequencePublishedPapers($trackId, $schedConfId) {
695  $result =& $this->retrieve(
696  'SELECT pa.pub_id FROM published_papers pa, papers a WHERE a.track_id = ? AND a.paper_id = pa.paper_id AND pa.sched_conf_id = ? ORDER BY pa.seq',
697  array($trackId, $schedConfId)
698  );
699 
700  for ($i=1; !$result->EOF; $i++) {
701  list($pubId) = $result->fields;
702  $this->update(
703  'UPDATE published_papers SET seq = ? WHERE pub_id = ?',
704  array($i, $pubId)
705  );
706 
707  $result->moveNext();
708  }
709 
710  $result->close();
711  unset($result);
712  }
713 
719  function getPublishedPaperAuthors($schedConfId) {
720  $authors = array();
721  $result =& $this->retrieve(
722  'SELECT aa.* FROM paper_authors aa, published_papers pa WHERE aa.paper_id = pa.paper_id AND pa.sched_conf_id = ? ORDER BY pa.sched_conf_id', $schedConfId
723  );
724 
725  while (!$result->EOF) {
726  $row = $result->GetRowAssoc(false);
727  $author = new Author();
728  $author->setId($row['author_id']);
729  $author->setPaperId($row['paper_id']);
730  $author->setFirstName($row['first_name']);
731  $author->setMiddleName($row['middle_name']);
732  $author->setLastName($row['last_name']);
733  $author->setAffiliation($row['affiliation']);
734  $author->setEmail($row['email']);
735  $author->setBiography($row['biography']);
736  $author->setPrimaryContact($row['primary_contact']);
737  $author->setSequence($row['seq']);
738  $authors[] = $author;
739  $result->moveNext();
740  }
741 
742  $result->Close();
743  unset($result);
744 
745  return $authors;
746  }
747 
752  function incrementViewsByPaperId($paperId) {
753  return $this->update(
754  'UPDATE published_papers SET views = views + 1 WHERE paper_id = ?',
755  $paperId
756  );
757  }
758 
766  function publicPaperIdExists($publicPaperId, $paperId, $schedConfId) {
767  $result =& $this->retrieve(
768  'SELECT COUNT(*) FROM published_papers pa, papers a WHERE pa.paper_id = a.paper_id AND a.sched_conf_id = ? AND pa.public_paper_id = ? AND pa.paper_id <> ?',
769  array($schedConfId, $publicPaperId, $paperId)
770  );
771  $returner = $result->fields[0] ? true : false;
772 
773  $result->Close();
774  unset($result);
775 
776  return $returner;
777  }
778 
784  function getPaperYearRange($conferenceId = null) {
785  $result =& $this->retrieve(
786  'SELECT MAX(pp.date_published), MIN(pp.date_published) FROM published_papers pp, papers p, sched_confs sc WHERE pp.paper_id = p.paper_id AND pp.sched_conf_id = sc.sched_conf_id ' . (isset($conferenceId)?' AND sc.conference_id = ?':''),
787  isset($conferenceId)?$conferenceId:false
788  );
789  $returner = array($result->fields[0], $result->fields[1]);
790 
791  $result->Close();
792  unset($result);
793 
794  return $returner;
795  }
796 }
797 
798 ?>
const STATUS_QUEUED
Definition: Paper.inc.php:26
deletePublishedPaperByPaperId($paperId)
config TEMPLATE inc php
Definition: config.inc.php:4
& getPublishedPapers($schedConfId, $sortOrder=PAPER_SORT_ORDER_NATURAL)
Operations for retrieving and modifying objects from a database.
Definition: DAO.inc.php:30
insertPublishedPaper(&$publishedPaper)
getPublishedPaperAuthors($schedConfId)
& getPublishedPaperIdsAlphabetizedByTitle($conferenceId=null, $schedConfId=null, $rangeInfo=null)
& retrieve($sql, $params=false, $callHooks=true)
Definition: DAO.inc.php:62
deletePublishedPapersBySchedConfId($schedConfId)
Paper author metadata class.
Definition: Author.inc.php:21
const REVIEW_STAGE_PRESENTATION
Definition: Paper.inc.php:37
getInsertId($table='', $id='', $callHooks=true)
Definition: DAO.inc.php:225
const PAPER_SORT_ORDER_NATURAL
resequencePublishedPapers($trackId, $schedConfId)
& getPublishedPaperIdsAlphabetizedBySchedConf($conferenceId=null, $schedConfId=null, $rangeInfo=null)
& retrieveRange($sql, $params=false, $dbResultRange=null, $callHooks=true)
Definition: DAO.inc.php:152
const PAPER_SORT_ORDER_TIME
const SUBMISSION_FIELD_TITLE
Definition: Paper.inc.php:42
datetimeFromDB($dt)
Definition: DAO.inc.php:276
& getPublishedPapersInTracks($schedConfId, $trackId=null, $searchField=null, $searchMatch=null, $search=null, $previewAbstracts=false)
& getPublishedPaperByPublicPaperId($schedConfId, $publicPaperId)
& getPublishedPaperByPaperId($paperId, $schedConfId=null, $previewAbstracts=null)
Published paper class.
& getPublishedPapersBySchedConfId($schedConfId, $rangeInfo=null)
Wrapper around ADORecordSet providing "factory" features for generating objects from DAOs.
updatePublishedPaperField($pubId, $field, $value)
getPublishedPaperCountBySchedConfId($schedConfId)
& getDAO($name, $dbconn=null)
Operations for retrieving and modifying PublishedPaper objects.
const REVIEW_MODE_BOTH_SIMULTANEOUS
& retrieveCached($sql, $params=false, $secsToCache=3600, $callHooks=true)
Definition: DAO.inc.php:91
call($hookName, $args=null)
publicPaperIdExists($publicPaperId, $paperId, $schedConfId)
& getPublishedPaperByBestPaperId($schedConfId, $paperId, $previewAbstracts=null)
& getPublishedPapersByTrackId($trackId, $schedConfId)
datetimeToDB($dt)
Definition: DAO.inc.php:258
update($sql, $params=false, $callHooks=true, $dieOnError=true)
Definition: DAO.inc.php:186
const SUBMISSION_FIELD_AUTHOR
Definition: Paper.inc.php:40
getPaperYearRange($conferenceId=null)
deletePublishedPapersByTrackId($trackId)
updatePublishedPaper($publishedPaper)
const STATUS_PUBLISHED
Definition: Paper.inc.php:27