本文整理汇总了PHP中Review::createRow方法的典型用法代码示例。如果您正苦于以下问题:PHP Review::createRow方法的具体用法?PHP Review::createRow怎么用?PHP Review::createRow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Review
的用法示例。
在下文中一共展示了Review::createRow方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: assignReviewers
/**
* Assign a list of reviewers to the paper
*/
function assignReviewers($tabIds)
{
$reviewTbl = new Review();
// Loop on the reviewers ids
foreach ($tabIds as $id_user) {
// Check whether the review exists
$review = $reviewTbl->find($this->id, $id_user)->current();
// Never delete! Just insert
if (!is_object($review)) {
$review = $reviewTbl->createRow();
$review->idPaper = $this->id;
$review->id_user = $id_user;
$review->save();
}
}
}
示例2: papersReviews
//.........这里部分代码省略.........
$view->paper_overall = $overall;
$view->form_status = Zmax_View_Phplib::checkboxField("radio", "status[{$paper->id}]", $statusList, $paper->status, array("length" => 2));
// Now, loop on reviews
$qRev = "SELECT * FROM Review r, User u " . " WHERE idPaper='{$paper->id}' AND u.id=r.id_user";
$resRev = $db->query($qRev);
$countReviews = 0;
$mail_reviewers = $comma = "";
while ($review = $resRev->fetch(Zend_Db::FETCH_OBJ)) {
$countReviews++;
$mail_reviewers .= $comma . $review->email;
$comma = ", ";
}
$view->paper_nb_reviewers = Max(1, $countReviews);
//echo "Mail reviewers = $mail_reviewers<br/>";
$view->paper_email_reviewers = $mail_reviewers;
$view->append("PAPER_DATA", "PAPER_INFO");
$resRev = $db->query($qRev);
$iReview = 0;
while ($review = $resRev->fetch(Zend_Db::FETCH_OBJ)) {
$iReview++;
$view->reviewer_id = $review->id;
if ($anonymized == false) {
$view->reviewer_fname = $review->first_name;
$view->reviewer_lname = $review->last_name;
$view->external_reviewer_fname = $review->fname_ext_reviewer;
$view->external_reviewer_lname = $review->lname_ext_reviewer;
$view->review_comments = $review->comments;
} else {
$view->reviewer_fname = $iReview;
$view->reviewer_lname = "";
$view->external_reviewer_fname = "";
$view->external_reviewer_lname = "";
$view->review_comments = "";
}
$view->reviewer_email = $review->email;
$view->review_overall = $review->overall;
$view->review_summary = $review->summary;
$view->review_details = $review->details;
if ($review->reviewerExpertise >= 1 and $review->reviewerExpertise <= 3) {
$view->reviewer_expertise = Config::$Expertise[$review->reviewerExpertise];
}
// Avoid to introduce Latex commands in Latex files ....
if (!$html) {
$view->review_summary = str_replace("\\", "", $view->review_summary);
$view->review_details = str_replace("\\", "", $view->review_details);
$view->review_comments = str_replace("\\", "", $view->review_comments);
}
$view->assign("REVIEWER_INFO", "REVIEWER");
reset($listCriterias);
$view->set_var("REVIEW_MARKS", "");
foreach ($listCriterias as $criteria) {
$reviewMark = $reviewMarkTbl->find($review->idPaper, $review->id_user, $criteria->id)->current();
if (!is_object($reviewMark)) {
$reviewMark = $reviewMarkTbl->createRow();
// for default values
}
$reviewMark->putInView($view);
$view->criteria_label = $criteria->label;
$view->append("REVIEW_MARKS", "REVIEW_MARK");
}
$view->append("PAPERS", "PAPER_DETAIL");
// The paper data is shown only once for all the reviews
$view->set_var("PAPER_DATA", " ");
}
// Show the paper even without reviewer
if ($countReviews == 0) {
$review = $reviewTbl->createRow();
$review->putInView($view);
$view->set_var("REVIEW_MARKS", "");
foreach ($listCriterias as $id => $label) {
$reviewMark = $reviewMarkTbl->createRow();
$reviewMark->putInView($view);
$view->append("REVIEW_MARKS", "REVIEW_MARK");
}
$view->set_var("REVIEWER_INFO", "");
$view->append("PAPERS", "PAPER_DETAIL");
$view->set_var("PAPER_DATA", "");
}
// Summary for the paper
if ($html) {
$statPaper = Paper::getStats($paper->id, $listCriterias);
$markFieldName = "ReviewMark" . "->mark";
$overallFieldName = "review_overall";
$view->set_var("NB_REVIEWERS", 1);
if ($html) {
$view->set_var("PAPER_DATA", "<td> </td><th>Summary</th>");
}
$view->set_var("REVIEWER_INFO", " ");
$view->set_var($overallFieldName, $paper->overall);
reset($listCriterias);
$view->set_var("REVIEW_MARKS", "");
foreach ($listCriterias as $c) {
$view->setVar($markFieldName, $statPaper[$c->id]);
$view->append("REVIEW_MARKS", "REVIEW_MARK");
}
$view->append("PAPERS", "PAPER_DETAIL");
$view->set_var("PAPER_DATA", "");
}
}
}