View | Details | Raw Unified | Return to bug 4737 | Differences between
and this patch

Collapse All | Expand All

(-)classes/submission/director/DirectorSubmissionDAO.inc.php (-100 / +73 lines)
 Lines 163-173    Link Here 
163
	 * @param $dateField int Symbolic SUBMISSION_FIELD_DATE_... identifier
163
	 * @param $dateField int Symbolic SUBMISSION_FIELD_DATE_... identifier
164
	 * @param $dateFrom String date to search from
164
	 * @param $dateFrom String date to search from
165
	 * @param $dateTo String date to search to
165
	 * @param $dateTo String date to search to
166
	 * @param $statusSql string Extra SQL conditions to match
166
	 * @param $additionalWhereSql string Extra SQL conditions to match
167
	 * @param $rangeInfo object
167
	 * @param $rangeInfo object
168
	 * @return array result
168
	 * @return array result
169
	 */
169
	 */
170
	function &getUnfilteredDirectorSubmissions($schedConfId, $trackId = 0, $directorId = 0, $searchField = null, $searchMatch = null, $search = null, $dateField = null, $dateFrom = null, $dateTo = null, $statusSql = null, $rangeInfo = null, $sortBy = null, $sortDirection = SORT_DIRECTION_ASC) {
170
	function &_getUnfilteredDirectorSubmissions($schedConfId, $trackId = 0, $directorId = 0, $searchField = null, $searchMatch = null, $search = null, $dateField = null, $dateFrom = null, $dateTo = null, $additionalWhereSql = '', $rangeInfo = null, $sortBy = null, $sortDirection = SORT_DIRECTION_ASC) {
171
		$primaryLocale = Locale::getPrimaryLocale();
171
		$primaryLocale = Locale::getPrimaryLocale();
172
		$locale = Locale::getLocale();
172
		$locale = Locale::getLocale();
173
		$params = array(
173
		$params = array(
 Lines 233-240    Link Here 
233
				LEFT JOIN paper_authors pap ON (pap.paper_id = p.paper_id AND pap.primary_contact = 1)
233
				LEFT JOIN paper_authors pap ON (pap.paper_id = p.paper_id AND pap.primary_contact = 1)
234
				LEFT JOIN published_papers pp ON (pp.paper_id = p.paper_id)
234
				LEFT JOIN published_papers pp ON (pp.paper_id = p.paper_id)
235
				LEFT JOIN tracks t ON (t.track_id = p.track_id)
235
				LEFT JOIN tracks t ON (t.track_id = p.track_id)
236
				LEFT JOIN edit_assignments ea ON (ea.paper_id = p.paper_id)
236
				LEFT JOIN edit_assignments e ON (e.paper_id = p.paper_id)
237
				LEFT JOIN users ed ON (ea.director_id = ed.user_id)
237
				LEFT JOIN users ed ON (e.director_id = ed.user_id)
238
				LEFT JOIN review_assignments ra ON (ra.paper_id = p.paper_id)
238
				LEFT JOIN review_assignments ra ON (ra.paper_id = p.paper_id)
239
				LEFT JOIN users re ON (re.user_id = ra.reviewer_id AND cancelled = 0)
239
				LEFT JOIN users re ON (re.user_id = ra.reviewer_id AND cancelled = 0)
240
				LEFT JOIN track_settings ttpl ON (t.track_id = ttpl.track_id AND ttpl.setting_name = ? AND ttpl.locale = ?)
240
				LEFT JOIN track_settings ttpl ON (t.track_id = ttpl.track_id AND ttpl.setting_name = ? AND ttpl.locale = ?)
 Lines 243-252    Link Here 
243
				LEFT JOIN track_settings tal ON (t.track_id = tal.track_id AND tal.setting_name = ? AND tal.locale = ?)
243
				LEFT JOIN track_settings tal ON (t.track_id = tal.track_id AND tal.setting_name = ? AND tal.locale = ?)
244
				LEFT JOIN paper_settings pptl ON (p.paper_id = pptl.paper_id AND pptl.setting_name = ? AND pptl.locale = ?)
244
				LEFT JOIN paper_settings pptl ON (p.paper_id = pptl.paper_id AND pptl.setting_name = ? AND pptl.locale = ?)
245
				LEFT JOIN paper_settings ptl ON (p.paper_id = ptl.paper_id AND ptl.setting_name = ? AND pptl.locale = ?)
245
				LEFT JOIN paper_settings ptl ON (p.paper_id = ptl.paper_id AND ptl.setting_name = ? AND pptl.locale = ?)
246
			WHERE	p.sched_conf_id = ?';
246
				LEFT JOIN edit_assignments ea ON (p.paper_id = ea.paper_id)
247
247
				LEFT JOIN edit_assignments ea2 ON (p.paper_id = ea2.paper_id AND ea.edit_id < ea2.edit_id)
248
		if ($statusSql !== null) $sql .= " AND ($statusSql)";
248
			WHERE	p.sched_conf_id = ?
249
		else $sql .= ' AND p.status = ' . STATUS_QUEUED;
249
				AND ea2.edit_id IS NULL' .
250
				(!empty($additionalWhereSql)?" AND ($additionalWhereSql)":'') . '
251
				AND (p.submission_progress = 0 OR (p.review_mode = ' . REVIEW_MODE_BOTH_SEQUENTIAL . ' AND p.submission_progress <> 1))';
250
252
251
		if ($trackId) {
253
		if ($trackId) {
252
			$searchSql .= ' AND p.track_id = ?';
254
			$searchSql .= ' AND p.track_id = ?';
 Lines 307-334    Link Here 
307
	 * @return array DirectorSubmission
309
	 * @return array DirectorSubmission
308
	 */
310
	 */
309
	function &getDirectorSubmissionsUnassigned($schedConfId, $trackId, $directorId, $searchField = null, $searchMatch = null, $search = null, $dateField = null, $dateFrom = null, $dateTo = null, $rangeInfo = null, $sortBy = null, $sortDirection = SORT_DIRECTION_ASC) {
311
	function &getDirectorSubmissionsUnassigned($schedConfId, $trackId, $directorId, $searchField = null, $searchMatch = null, $search = null, $dateField = null, $dateFrom = null, $dateTo = null, $rangeInfo = null, $sortBy = null, $sortDirection = SORT_DIRECTION_ASC) {
310
		$directorSubmissions = array();
312
		$result =& $this->_getUnfilteredDirectorSubmissions(
311
313
			$schedConfId, $trackId, $directorId,
312
		// FIXME Does not pass $rangeInfo else we only get partial results
314
			$searchField, $searchMatch, $search,
313
		$result = $this->getUnfilteredDirectorSubmissions($schedConfId, $trackId, $directorId, $searchField, $searchMatch, $search, $dateField, $dateFrom, $dateTo, null, null, $sortBy, $sortDirection);
315
			$dateField, $dateFrom, $dateTo,
314
316
			'p.status = ' . STATUS_QUEUED . ' AND ea.edit_id IS NULL',
315
		while (!$result->EOF) {
317
			$rangeInfo, $sortBy, $sortDirection
316
			$directorSubmission =& $this->_returnDirectorSubmissionFromRow($result->GetRowAssoc(false));
318
		);
317
319
		$returner = new DAOResultFactory($result, $this, '_returnDirectorSubmissionFromRow');
318
			// used to check if director exists for this submission
319
			$editAssignments =& $directorSubmission->getEditAssignments();
320
321
			if (empty($editAssignments) && $directorSubmission->isOriginalSubmissionComplete()) {
322
				$directorSubmissions[] =& $directorSubmission;
323
			}
324
			unset($directorSubmission);
325
			$result->MoveNext();
326
		}
327
		$result->Close();
328
		unset($result);
329
330
		import('core.ArrayItemIterator');
331
		$returner =& ArrayItemIterator::fromRangeInfo($directorSubmissions, $rangeInfo);
332
		return $returner;
320
		return $returner;
333
	}
321
	}
334
322
 Lines 347-387    Link Here 
347
	 * @return array DirectorSubmission
335
	 * @return array DirectorSubmission
348
	 */
336
	 */
349
	function &getDirectorSubmissionsInReview($schedConfId, $trackId, $directorId, $searchField = null, $searchMatch = null, $search = null, $dateField = null, $dateFrom = null, $dateTo = null, $rangeInfo = null, $sortBy = null, $sortDirection = SORT_DIRECTION_ASC) {
337
	function &getDirectorSubmissionsInReview($schedConfId, $trackId, $directorId, $searchField = null, $searchMatch = null, $search = null, $dateField = null, $dateFrom = null, $dateTo = null, $rangeInfo = null, $sortBy = null, $sortDirection = SORT_DIRECTION_ASC) {
350
		$directorSubmissions = array();
338
		$result =& $this->_getUnfilteredDirectorSubmissions(
351
339
			$schedConfId, $trackId, $directorId,
352
		// FIXME Does not pass $rangeInfo else we only get partial results
340
			$searchField, $searchMatch, $search,
353
		$result = $this->getUnfilteredDirectorSubmissions($schedConfId, $trackId, $directorId, $searchField, $searchMatch, $search, $dateField, $dateFrom, $dateTo, null, null, $sortBy, $sortDirection);
341
			$dateField, $dateFrom, $dateTo,
354
342
			'p.status = ' . STATUS_QUEUED . ' AND ea.edit_id IS NOT NULL',
355
		$reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
343
			$rangeInfo, $sortBy, $sortDirection
356
344
		);
357
		// If the submission has passed this review stage, it's out of review.
345
		$returner = new DAOResultFactory($result, $this, '_returnDirectorSubmissionFromRow');
358
		$schedConfDao =& DAORegistry::getDao('SchedConfDAO');
359
		$schedConf =& $schedConfDao->getSchedConf($schedConfId);
360
361
		while (!$result->EOF) {
362
			$directorSubmission =& $this->_returnDirectorSubmissionFromRow($result->GetRowAssoc(false));
363
			$paperId = $directorSubmission->getPaperId();
364
			for ($i = 1; $i <= $directorSubmission->getCurrentStage(); $i++) {
365
				$reviewAssignment =& $reviewAssignmentDao->getReviewAssignmentsByPaperId($paperId, $i);
366
				if (!empty($reviewAssignment)) {
367
					$directorSubmission->setReviewAssignments($reviewAssignment, $i);
368
				}
369
			}
370
371
			// used to check if director exists for this submission
372
			$editAssignments =& $directorSubmission->getEditAssignments();
373
374
			if (!empty($editAssignments) && $directorSubmission->isOriginalSubmissionComplete()) {
375
				$directorSubmissions[] =& $directorSubmission;
376
			}
377
			unset($directorSubmission);
378
			$result->MoveNext();
379
		}
380
		$result->Close();
381
		unset($result);
382
383
		import('core.ArrayItemIterator');
384
		$returner =& ArrayItemIterator::fromRangeInfo($directorSubmissions, $rangeInfo);
385
		return $returner;
346
		return $returner;
386
	}
347
	}
387
348
 Lines 400-409    Link Here 
400
	 * @return array DirectorSubmission
361
	 * @return array DirectorSubmission
401
	 */
362
	 */
402
	function &getDirectorSubmissionsAccepted($schedConfId, $trackId, $directorId, $searchField = null, $searchMatch = null, $search = null, $dateField = null, $dateFrom = null, $dateTo = null, $rangeInfo = null, $sortBy = null, $sortDirection = "ASC") {
363
	function &getDirectorSubmissionsAccepted($schedConfId, $trackId, $directorId, $searchField = null, $searchMatch = null, $search = null, $dateField = null, $dateFrom = null, $dateTo = null, $rangeInfo = null, $sortBy = null, $sortDirection = "ASC") {
403
		$directorSubmissions = array();
364
		$result =& $this->_getUnfilteredDirectorSubmissions(
404
365
			$schedConfId, $trackId, $directorId,
405
		$result = $this->getUnfilteredDirectorSubmissions($schedConfId, $trackId, $directorId,  $searchField, $searchMatch, $search, $dateField, $dateFrom, $dateTo, 'p.status = ' . STATUS_PUBLISHED, $rangeInfo, $sortBy, $sortDirection);
366
			$searchField, $searchMatch, $search,
406
367
			$dateField, $dateFrom, $dateTo,
368
			'p.status = ' . STATUS_PUBLISHED,
369
			$rangeInfo, $sortBy, $sortDirection
370
		);
407
		$returner = new DAOResultFactory($result, $this, '_returnDirectorSubmissionFromRow');
371
		$returner = new DAOResultFactory($result, $this, '_returnDirectorSubmissionFromRow');
408
		return $returner;
372
		return $returner;
409
	}
373
	}
 Lines 423-432    Link Here 
423
	 * @return array DirectorSubmission
387
	 * @return array DirectorSubmission
424
	 */
388
	 */
425
	function &getDirectorSubmissionsArchives($schedConfId, $trackId, $directorId, $searchField = null, $searchMatch = null, $search = null, $dateField = null, $dateFrom = null, $dateTo = null, $rangeInfo = null, $sortBy = null, $sortDirection = "ASC") {
389
	function &getDirectorSubmissionsArchives($schedConfId, $trackId, $directorId, $searchField = null, $searchMatch = null, $search = null, $dateField = null, $dateFrom = null, $dateTo = null, $rangeInfo = null, $sortBy = null, $sortDirection = "ASC") {
426
		$directorSubmissions = array();
390
		$result =& $this->_getUnfilteredDirectorSubmissions(
427
391
			$schedConfId, $trackId, $directorId,
428
		$result = $this->getUnfilteredDirectorSubmissions($schedConfId, $trackId, $directorId, $searchField, $searchMatch, $search, $dateField, $dateFrom, $dateTo, 'p.status <> ' . STATUS_QUEUED . ' AND p.status <> ' . STATUS_PUBLISHED, $rangeInfo, $sortBy, $sortDirection);
392
			$searchField, $searchMatch, $search,
429
393
			$dateField, $dateFrom, $dateTo,
394
			'p.status <> ' . STATUS_QUEUED . ' AND p.status <> ' . STATUS_PUBLISHED,
395
			$rangeInfo, $sortBy, $sortDirection
396
		);
430
		$returner = new DAOResultFactory($result, $this, '_returnDirectorSubmissionFromRow');
397
		$returner = new DAOResultFactory($result, $this, '_returnDirectorSubmissionFromRow');
431
		return $returner;
398
		return $returner;
432
	}
399
	}
 Lines 435-471    Link Here 
435
	 * Function used for counting purposes for right nav bar
402
	 * Function used for counting purposes for right nav bar
436
	 */
403
	 */
437
	function &getDirectorSubmissionsCount($schedConfId) {
404
	function &getDirectorSubmissionsCount($schedConfId) {
438
439
		$schedConfDao =& DAORegistry::getDao('SchedConfDAO');
440
		$schedConf =& $schedConfDao->getSchedConf($schedConfId);
441
442
		$submissionsCount = array();
405
		$submissionsCount = array();
443
		for($i = 0; $i < 2; $i++) {
444
			$submissionsCount[$i] = 0;
445
		}
446
447
		$result = $this->getUnfilteredDirectorSubmissions($schedConfId);
448
406
449
		while (!$result->EOF) {
407
		// Fetch a count of unassigned submissions.
450
			$directorSubmission =& $this->_returnDirectorSubmissionFromRow($result->GetRowAssoc(false));
408
		// "e2" and "e" are used to fetch only a single assignment
451
409
		// if several exist.
452
			// used to check if director exists for this submission
410
		$result =& $this->retrieve(
453
			$editAssignments = $directorSubmission->getEditAssignments();
411
			'SELECT	COUNT(*) AS unassigned_count
454
412
			FROM	papers p
455
			if (!$directorSubmission->isOriginalSubmissionComplete()) {
413
				LEFT JOIN edit_assignments e ON (p.paper_id = e.paper_id)
456
				// Do not include incomplete submissions
414
				LEFT JOIN edit_assignments e2 ON (p.paper_id = e2.paper_id AND e.edit_id < e2.edit_id)
457
			} elseif (empty($editAssignments)) {
415
			WHERE	p.sched_conf_id = ?
458
				// unassigned submissions
416
				AND p.status = ' . STATUS_QUEUED . '
459
				$submissionsCount[0] += 1;
417
				AND e2.edit_id IS NULL
460
			} elseif ($directorSubmission->getStatus() == STATUS_QUEUED) {
418
				AND e.edit_id IS NULL
461
				// in review submissions
419
				AND (p.submission_progress = 0 OR (p.review_mode = ' . REVIEW_MODE_BOTH_SEQUENTIAL . ' AND p.submission_progress <> 1))',
462
				$submissionsCount[1] += 1;
420
			array((int) $schedConfId)
463
			}
421
		);
422
		$submissionsCount[0] = $result->Fields('unassigned_count');
423
		$result->Close();
464
424
465
			$result->MoveNext();
425
		// Fetch a count of submissions in review.
466
		}
426
		// "e2" and "e" are used to fetch only a single assignment
427
		// if several exist.
428
		$result =& $this->retrieve(
429
			'SELECT	COUNT(*) AS review_count
430
			FROM	papers p
431
				LEFT JOIN edit_assignments e ON (p.paper_id = e.paper_id)
432
				LEFT JOIN edit_assignments e2 ON (p.paper_id = e2.paper_id AND e.edit_id < e2.edit_id)
433
			WHERE	p.sched_conf_id = ?
434
				AND p.status = ' . STATUS_QUEUED . '
435
				AND e2.edit_id IS NULL
436
				AND e.edit_id IS NOT NULL
437
				AND (p.submission_progress = 0 OR (p.review_mode = ' . REVIEW_MODE_BOTH_SEQUENTIAL . ' AND p.submission_progress <> 1))',
438
			array((int) $schedConfId)
439
		);
440
		$submissionsCount[1] = $result->Fields('review_count');
467
		$result->Close();
441
		$result->Close();
468
		unset($result);
469
442
470
		return $submissionsCount;
443
		return $submissionsCount;
471
	}
444
	}
(-)classes/submission/trackDirector/TrackDirectorSubmission.inc.php (-7 lines)
 Lines 450-462    Link Here 
450
	}
450
	}
451
451
452
	function isOriginalSubmissionComplete() {
452
	function isOriginalSubmissionComplete() {
453
		$schedConf =& Request::getSchedConf();
454
		if (!$schedConf || $this->getSchedConfId() != $schedConf->getId()) {
455
			unset($schedConf);
456
			$schedConfDao =& DAORegistry::getDAO('SchedConfDAO');
457
			$schedConf =& $schedConfDao->getSchedConf($this->getSchedConfId());
458
		}
459
460
		$reviewMode = $this->getReviewMode();
453
		$reviewMode = $this->getReviewMode();
461
		if ($reviewMode == REVIEW_MODE_BOTH_SEQUENTIAL) {
454
		if ($reviewMode == REVIEW_MODE_BOTH_SEQUENTIAL) {
462
			return ($this->getSubmissionProgress() != 1);
455
			return ($this->getSubmissionProgress() != 1);
(-)classes/submission/trackDirector/TrackDirectorSubmissionDAO.inc.php (-52 / +61 lines)
 Lines 18-28    Link Here 
18
18
19
19
20
import('submission.trackDirector.TrackDirectorSubmission');
20
import('submission.trackDirector.TrackDirectorSubmission');
21
import('submission.author.AuthorSubmission'); // Bring in director decision constants
22
import('submission.reviewer.ReviewerSubmission'); // Bring in director decision constants
23
21
24
class TrackDirectorSubmissionDAO extends DAO {
22
// Bring in director decision constants
23
import('submission.common.Action');
24
import('submission.author.AuthorSubmission');
25
import('submission.reviewer.ReviewerSubmission');
25
26
27
class TrackDirectorSubmissionDAO extends DAO {
26
	var $paperDao;
28
	var $paperDao;
27
	var $authorDao;
29
	var $authorDao;
28
	var $userDao;
30
	var $userDao;
 Lines 266-272    Link Here 
266
	/**
268
	/**
267
	 * Retrieve unfiltered track director submissions
269
	 * Retrieve unfiltered track director submissions
268
	 */
270
	 */
269
	function &getUnfilteredTrackDirectorSubmissions($trackDirectorId, $schedConfId, $trackId = 0, $searchField = null, $searchMatch = null, $search = null, $dateField = null, $dateFrom = null, $dateTo = null, $statusSql = null, $rangeInfo = null, $sortBy = null, $sortDirection = SORT_DIRECTION_ASC) {
271
	function &_getUnfilteredTrackDirectorSubmissions($trackDirectorId, $schedConfId, $trackId = 0, $searchField = null, $searchMatch = null, $search = null, $dateField = null, $dateFrom = null, $dateTo = null, $additionalWhereSql = '', $rangeInfo = null, $sortBy = null, $sortDirection = SORT_DIRECTION_ASC) {
270
		$primaryLocale = Locale::getPrimaryLocale();
272
		$primaryLocale = Locale::getPrimaryLocale();
271
		$locale = Locale::getLocale();
273
		$locale = Locale::getLocale();
272
274
 Lines 367-377    Link Here 
367
				LEFT JOIN track_settings tal ON (t.track_id = tal.track_id AND tal.setting_name = ? AND tal.locale = ?)
369
				LEFT JOIN track_settings tal ON (t.track_id = tal.track_id AND tal.setting_name = ? AND tal.locale = ?)
368
				LEFT JOIN paper_settings ptl ON (p.paper_id = ptl.paper_id AND ptl.setting_name = ?)
370
				LEFT JOIN paper_settings ptl ON (p.paper_id = ptl.paper_id AND ptl.setting_name = ?)
369
				LEFT JOIN paper_settings pptl ON (p.paper_id = pptl.paper_id AND pptl.setting_name = ? AND pptl.locale = ?)
371
				LEFT JOIN paper_settings pptl ON (p.paper_id = pptl.paper_id AND pptl.setting_name = ? AND pptl.locale = ?)
370
			WHERE	p.sched_conf_id = ? AND
372
			WHERE	p.sched_conf_id = ?
371
				e.director_id = ?';
373
				' . (!empty($additionalWhereSql)?" AND ($additionalWhereSql)":'') . '
372
374
				AND e.director_id = ?';
373
		if ($statusSql !== null) $sql .= " AND ($statusSql)";
374
		else $sql .= ' AND p.status = ' . STATUS_QUEUED;
375
375
376
		if ($trackId) {
376
		if ($trackId) {
377
			$params[] = $trackId;
377
			$params[] = $trackId;
 Lines 401-410    Link Here 
401
	 * @return array DirectorSubmission
401
	 * @return array DirectorSubmission
402
	 */
402
	 */
403
	function &getTrackDirectorSubmissionsInReview($trackDirectorId, $schedConfId, $trackId, $searchField = null, $searchMatch = null, $search = null, $dateField = null, $dateFrom = null, $dateTo = null, $rangeInfo = null, $sortBy = null, $sortDirection = SORT_DIRECTION_ASC) {
403
	function &getTrackDirectorSubmissionsInReview($trackDirectorId, $schedConfId, $trackId, $searchField = null, $searchMatch = null, $search = null, $dateField = null, $dateFrom = null, $dateTo = null, $rangeInfo = null, $sortBy = null, $sortDirection = SORT_DIRECTION_ASC) {
404
		$submissions = array();
404
		$result = $this->_getUnfilteredTrackDirectorSubmissions(
405
405
			$trackDirectorId, $schedConfId, $trackId,
406
		// FIXME Does not pass $rangeInfo else we only get partial results
406
			$searchField, $searchMatch, $search,
407
		$result = $this->getUnfilteredTrackDirectorSubmissions($trackDirectorId, $schedConfId, $trackId, $searchField, $searchMatch, $search, $dateField, $dateFrom, $dateTo, null, null, $sortBy, $sortDirection);
407
			$dateField, $dateFrom, $dateTo,
408
			'p.status = ' . STATUS_QUEUED,
409
			$rangeInfo, $sortBy, $sortDirection
410
		);
408
411
409
		$returner = new DAOResultFactory($result, $this, '_returnTrackDirectorSubmissionFromRow');
412
		$returner = new DAOResultFactory($result, $this, '_returnTrackDirectorSubmissionFromRow');
410
		return $returner;
413
		return $returner;
 Lines 426-435    Link Here 
426
	 * @return array DirectorSubmission
429
	 * @return array DirectorSubmission
427
	 */
430
	 */
428
	function &getTrackDirectorSubmissionsAccepted($trackDirectorId, $schedConfId, $trackId, $searchField = null, $searchMatch = null, $search = null, $dateField = null, $dateFrom = null, $dateTo = null, $rangeInfo = null, $sortBy = null, $sortDirection = SORT_DIRECTION_ASC) {
431
	function &getTrackDirectorSubmissionsAccepted($trackDirectorId, $schedConfId, $trackId, $searchField = null, $searchMatch = null, $search = null, $dateField = null, $dateFrom = null, $dateTo = null, $rangeInfo = null, $sortBy = null, $sortDirection = SORT_DIRECTION_ASC) {
429
		$submissions = array();
432
		$result = $this->_getUnfilteredTrackDirectorSubmissions(
430
433
			$trackDirectorId, $schedConfId, $trackId,
431
		// FIXME Does not pass $rangeInfo else we only get partial results
434
			$searchField, $searchMatch, $search,
432
		$result = $this->getUnfilteredTrackDirectorSubmissions($trackDirectorId, $schedConfId, $trackId, $searchField, $searchMatch, $search, $dateField, $dateFrom, $dateTo, 'p.status = ' . STATUS_PUBLISHED, $rangeInfo, $sortBy, $sortDirection);
435
			$dateField, $dateFrom, $dateTo,
436
			'p.status = ' . STATUS_PUBLISHED,
437
			$rangeInfo, $sortBy, $sortDirection
438
		);
433
439
434
		$returner = new DAOResultFactory($result, $this, '_returnTrackDirectorSubmissionFromRow');
440
		$returner = new DAOResultFactory($result, $this, '_returnTrackDirectorSubmissionFromRow');
435
		return $returner;
441
		return $returner;
 Lines 450-458    Link Here 
450
	 * @return array DirectorSubmission
456
	 * @return array DirectorSubmission
451
	 */
457
	 */
452
	function &getTrackDirectorSubmissionsArchives($trackDirectorId, $schedConfId, $trackId, $searchField = null, $searchMatch = null, $search = null, $dateField = null, $dateFrom = null, $dateTo = null, $rangeInfo = null, $sortBy = null, $sortDirection = SORT_DIRECTION_ASC) {
458
	function &getTrackDirectorSubmissionsArchives($trackDirectorId, $schedConfId, $trackId, $searchField = null, $searchMatch = null, $search = null, $dateField = null, $dateFrom = null, $dateTo = null, $rangeInfo = null, $sortBy = null, $sortDirection = SORT_DIRECTION_ASC) {
453
		$submissions = array();
459
		$result = $this->_getUnfilteredTrackDirectorSubmissions(
454
460
			$trackDirectorId, $schedConfId, $trackId,
455
		$result = $this->getUnfilteredTrackDirectorSubmissions($trackDirectorId, $schedConfId, $trackId, $searchField, $searchMatch, $search, $dateField, $dateFrom, $dateTo, 'p.status <> ' . STATUS_QUEUED . ' AND p.status <> ' . STATUS_PUBLISHED, $rangeInfo, $sortBy, $sortDirection);
461
			$searchField, $searchMatch, $search,
462
			$dateField, $dateFrom, $dateTo,
463
			'p.status <> ' . STATUS_QUEUED . ' AND p.status <> ' . STATUS_PUBLISHED,
464
			$rangeInfo, $sortBy, $sortDirection
465
		);
456
466
457
		$returner = new DAOResultFactory($result, $this, '_returnTrackDirectorSubmissionFromRow');
467
		$returner = new DAOResultFactory($result, $this, '_returnTrackDirectorSubmissionFromRow');
458
		return $returner;
468
		return $returner;
 Lines 462-502    Link Here 
462
	 * Function used for counting purposes for right nav bar
472
	 * Function used for counting purposes for right nav bar
463
	 */
473
	 */
464
	function &getTrackDirectorSubmissionsCount($trackDirectorId, $schedConfId) {
474
	function &getTrackDirectorSubmissionsCount($trackDirectorId, $schedConfId) {
465
466
		$submissionsCount = array();
475
		$submissionsCount = array();
467
		for($i = 0; $i < 4; $i++) {
468
			$submissionsCount[$i] = 0;
469
		}
470
471
		$result = $this->getUnfilteredTrackDirectorSubmissions($trackDirectorId, $schedConfId);
472
473
		while (!$result->EOF) {
474
			$row = $result->GetRowAssoc(false);
475
			$trackDirectorSubmission =& $this->_returnTrackDirectorSubmissionFromRow($row);
476
477
			// check if submission is still in review
478
			$inReview = true;
479
			$decisions = $trackDirectorSubmission->getDecisions();
480
			$decision = array_pop($decisions);
481
			if (!empty($decision)) {
482
				$latestDecision = array_pop($decision);
483
				if ($latestDecision['decision'] == SUBMISSION_DIRECTOR_DECISION_ACCEPT) {
484
					$inReview = false;
485
				}
486
			}
487
488
			if ($inReview) {
489
				$submissionsCount[0] += 1;
490
			} else {
491
				$submissionsCount[1] += 1;
492
			}
493
			unset($trackDirectorDecision);
494
			$result->MoveNext();
495
		}
496
476
477
		// Fetch a count of submissions in review.
478
		// "d2" and "d" are used to fetch the single most recent
479
		// editor decision.
480
		$result =& $this->retrieve(
481
			'SELECT	COUNT(*) AS review_count
482
			FROM	papers p
483
				LEFT JOIN edit_assignments e ON (p.paper_id = e.paper_id)
484
			WHERE	p.sched_conf_id = ?
485
				AND e.director_id = ?
486
				AND p.status = ' . STATUS_QUEUED,
487
			array((int) $schedConfId, (int) $trackDirectorId)
488
		);
489
		$submissionsCount[0] = $result->Fields('review_count');
497
		$result->Close();
490
		$result->Close();
498
		unset($result);
499
491
492
		// Fetch a count of submissions in editing.
493
		// "d2" and "d" are used to fetch the single most recent
494
		// editor decision.
495
		$result =& $this->retrieve(
496
			'SELECT	COUNT(*) AS editing_count
497
			FROM	papers p
498
				LEFT JOIN edit_assignments e ON (p.paper_id = e.paper_id)
499
				LEFT JOIN edit_decisions d ON (p.paper_id = d.paper_id)
500
				LEFT JOIN edit_decisions d2 ON (p.paper_id = d2.paper_id AND d.edit_decision_id < d2.edit_decision_id)
501
			WHERE	p.sched_conf_id = ?
502
				AND e.director_id = ?
503
				AND p.status = ' . STATUS_QUEUED . '
504
				AND d2.edit_decision_id IS NULL
505
				AND d.decision = ' . SUBMISSION_DIRECTOR_DECISION_ACCEPT,
506
			array((int) $schedConfId, (int) $trackDirectorId)
507
		);
508
		$submissionsCount[1] = $result->Fields('editing_count');
509
		$result->Close();
500
		return $submissionsCount;
510
		return $submissionsCount;
501
	}
511
	}
502
512
 Lines 808-814    Link Here 
808
			default: return null;
818
			default: return null;
809
		}
819
		}
810
	}
820
	}
811
812
}
821
}
813
822
814
?>
823
?>
(-)templates/user/index.tpl (-13 / +10 lines)
 Lines 57-69    Link Here 
57
							<a href="{url conference=$conferencePath schedConf=$schedConfPath  page="director" op="submissions" path="submissionsUnassigned"}">{$directorSubmissionsCount[0]} {translate key="common.queue.short.submissionsUnassigned"}</a>
57
							<a href="{url conference=$conferencePath schedConf=$schedConfPath  page="director" op="submissions" path="submissionsUnassigned"}">{$directorSubmissionsCount[0]} {translate key="common.queue.short.submissionsUnassigned"}</a>
58
						{else}<span class="disabled">0 {translate key="common.queue.short.submissionsUnassigned"}</span>{/if}
58
						{else}<span class="disabled">0 {translate key="common.queue.short.submissionsUnassigned"}</span>{/if}
59
					</td>
59
					</td>
60
					<td>{if $directorSubmissionsCount[1]}
60
					<td colspan="2">
61
						{if $directorSubmissionsCount[1]}
61
							<a href="{url conference=$conferencePath schedConf=$schedConfPath  page="director" op="submissions" path="submissionsInReview"}">{$directorSubmissionsCount[1]} {translate key="common.queue.short.submissionsInReview"}</a>
62
							<a href="{url conference=$conferencePath schedConf=$schedConfPath  page="director" op="submissions" path="submissionsInReview"}">{$directorSubmissionsCount[1]} {translate key="common.queue.short.submissionsInReview"}</a>
62
						{else}<span class="disabled">0 {translate key="common.queue.short.submissionsInReview"}</span>{/if}
63
						{else}
63
					</td>
64
							<span class="disabled">0 {translate key="common.queue.short.submissionsInReview"}</span>
64
					<td>{if $directorSubmissionsCount[2]}
65
						{/if}
65
							<a href="{url conference=$conferencePath schedConf=$schedConfPath  page="director" op="submissions" path="submissionsInEditing"}">{$directorSubmissionsCount[2]} {translate key="common.queue.short.submissionsInEditing"}</a>
66
						{else}<span class="disabled">0 {translate key="common.queue.long.submissionsAccepted"}</span>{/if}
67
					</td>
66
					</td>
68
					<td align="right">[<a href="{url conference=$conferencePath schedConf=$schedConfPath  page="director" op="notifyUsers"}">{translate key="director.notifyUsers"}</a>]</td>
67
					<td align="right">[<a href="{url conference=$conferencePath schedConf=$schedConfPath  page="director" op="notifyUsers"}">{translate key="director.notifyUsers"}</a>]</td>
69
				</tr>
68
				</tr>
 Lines 73-87    Link Here 
73
				<tr>
72
				<tr>
74
					<td>&#187; <a href="{url conference=$conferencePath schedConf=$schedConfPath  page="trackDirector"}">{translate key="user.role.trackDirector"}</a></td>
73
					<td>&#187; <a href="{url conference=$conferencePath schedConf=$schedConfPath  page="trackDirector"}">{translate key="user.role.trackDirector"}</a></td>
75
					<td></td>
74
					<td></td>
76
					<td>{if $trackDirectorSubmissionsCount[0]}
75
					<td colspan="3">
76
						{if $trackDirectorSubmissionsCount[0]}
77
							<a href="{url conference=$conferencePath schedConf=$schedConfPath  page="trackDirector" op="index" path="submissionsInReview"}">{$trackDirectorSubmissionsCount[0]} {translate key="common.queue.short.submissionsInReview"}</a>
77
							<a href="{url conference=$conferencePath schedConf=$schedConfPath  page="trackDirector" op="index" path="submissionsInReview"}">{$trackDirectorSubmissionsCount[0]} {translate key="common.queue.short.submissionsInReview"}</a>
78
						{else}<span class="disabled">0 {translate key="common.queue.short.submissionsInReview"}</span>{/if}
78
						{else}
79
					</td>
79
							<span class="disabled">0 {translate key="common.queue.short.submissionsInReview"}</span>
80
					<td>{if $trackDirectorSubmissionsCount[1]}
80
						{/if}
81
							<a href="{url conference=$conferencePath schedConf=$schedConfPath  page="trackDirector" op="index" path="submissionsInEditing"}">{$trackDirectorSubmissionsCount[1]} {translate key="common.queue.short.submissionsInEditing"}</a>
82
						{else}<span class="disabled">0 {translate key="common.queue.short.submissionsAccepted"}</span>{/if}
83
					</td>
81
					</td>
84
					<td align="right"></td>
85
				</tr>
82
				</tr>
86
			{/if}
83
			{/if}
87
			{if $isValid.Author.$conferenceId.$schedConfId || $isValid.Reviewer.$conferenceId.$schedConfId}
84
			{if $isValid.Author.$conferenceId.$schedConfId || $isValid.Reviewer.$conferenceId.$schedConfId}

Return to bug 4737