/**
  * @see Form::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     // display branding
     require_once WCF_DIR . 'lib/util/ContestUtil.class.php';
     ContestUtil::assignVariablesBranding();
     $this->sidebar->assignVariables();
     WCF::getTPL()->assign(array('entry' => $this->entry, 'contestID' => $this->contestID, 'templateName' => $this->templateName, 'allowSpidersToIndexThisPage' => true, 'contestmenu' => ContestMenu::getInstance()));
 }
 /**
  * @see Form::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     // display branding
     require_once WCF_DIR . 'lib/util/ContestUtil.class.php';
     ContestUtil::assignVariablesBranding();
     if ($this->entry->isOwner()) {
         require_once WCF_DIR . 'lib/form/ContestParticipantInviteForm.class.php';
         new ContestParticipantInviteForm($this->entry);
     }
     // init form
     if ($this->action == 'edit') {
         require_once WCF_DIR . 'lib/form/ContestParticipantEditForm.class.php';
         new ContestParticipantEditForm($this->entry);
     } else {
         if ($this->entry->isParticipantable()) {
             require_once WCF_DIR . 'lib/form/ContestParticipantAddForm.class.php';
             new ContestParticipantAddForm($this->entry);
         }
     }
     if ($this->entry->enableParticipantCheck) {
         WCF::getTPL()->append('userMessages', '<p class="info">' . WCF::getLanguage()->get('wcf.contest.enableParticipantCheck.info') . '</p>');
     }
     $this->sidebar->assignVariables();
     WCF::getTPL()->assign(array('entry' => $this->entry, 'contestID' => $this->contestID, 'userID' => $this->entry->userID, 'participants' => $this->participantList->getObjects(), 'todos' => $this->todoList ? $this->todoList->getObjects() : array(), 'templateName' => $this->templateName, 'allowSpidersToIndexThisPage' => true, 'contestmenu' => ContestMenu::getInstance()));
 }
 /**
  * @see Form::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     // display branding
     require_once WCF_DIR . 'lib/util/ContestUtil.class.php';
     ContestUtil::assignVariablesBranding();
     // save invitations
     if ($this->entry->isOwner()) {
         require_once WCF_DIR . 'lib/form/ContestJuryInviteForm.class.php';
         new ContestJuryInviteForm($this->entry);
     }
     // init form
     if ($this->action == 'edit') {
         require_once WCF_DIR . 'lib/form/ContestJuryEditForm.class.php';
         new ContestJuryEditForm($this->entry);
     } else {
         if ($this->entry->isJuryable()) {
             require_once WCF_DIR . 'lib/form/ContestJuryAddForm.class.php';
             new ContestJuryAddForm($this->entry);
         }
     }
     if ($this->entry->state != 'closed') {
         WCF::getTPL()->append('userMessages', '<p class="info">' . WCF::getLanguage()->get('wcf.contest.jury.closed.info') . '</p>');
         // init todo list
         require_once WCF_DIR . 'lib/data/contest/jury/todo/ContestJuryTodoList.class.php';
         $this->todoList = new ContestJuryTodoList();
         $this->todoList->sqlConditions .= 'contest_jury.contestID = ' . $this->contestID;
         $this->todoList->readObjects();
     }
     $this->sidebar->assignVariables();
     WCF::getTPL()->assign(array('entry' => $this->entry, 'isJury' => $this->isJury, 'contestID' => $this->contestID, 'userID' => $this->entry->userID, 'jurys' => $this->juryList->getObjects(), 'todos' => $this->todoList ? $this->todoList->getObjects() : array(), 'templateName' => $this->templateName, 'allowSpidersToIndexThisPage' => true, 'contestmenu' => ContestMenu::getInstance()));
 }
 /**
  * @see Form::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     // display branding
     require_once WCF_DIR . 'lib/util/ContestUtil.class.php';
     ContestUtil::assignVariablesBranding();
     if (!$this->entry->enableOpenSolution && $this->entry->state != 'closed' && ($this->entry->state != 'scheduled' || !($this->entry->fromTime < TIME_NOW && TIME_NOW < $this->entry->untilTime))) {
         WCF::getTPL()->append('userMessages', '<p class="info">' . WCF::getLanguage()->get('wcf.contest.enableOpenSolution.info') . '</p>');
     }
     if ($this->entry->enableParticipantCheck) {
         WCF::getTPL()->append('userMessages', '<p class="info">' . WCF::getLanguage()->get('wcf.contest.enableParticipantCheck.info') . '</p>');
     }
     $this->sidebar->assignVariables();
     WCF::getTPL()->assign(array('entry' => $this->entry, 'contestID' => $this->contestID, 'userID' => $this->entry->userID, 'solutions' => $this->solutionList->getObjects(), 'todos' => $this->todoList ? $this->todoList->getObjects() : array(), 'templateName' => $this->templateName, 'allowSpidersToIndexThisPage' => true, 'contestmenu' => ContestMenu::getInstance()));
 }
 /**
  * @see Form::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     // display branding
     require_once WCF_DIR . 'lib/util/ContestUtil.class.php';
     ContestUtil::assignVariablesBranding();
     // init form
     if ($this->action == 'edit') {
         require_once WCF_DIR . 'lib/form/ContestSponsortalkEditForm.class.php';
         new ContestSponsortalkEditForm($this->entry);
     } else {
         if ($this->entry->isSponsortalkable()) {
             require_once WCF_DIR . 'lib/form/ContestSponsortalkAddForm.class.php';
             new ContestSponsortalkAddForm($this->entry);
         }
     }
     $this->sidebar->assignVariables();
     WCF::getTPL()->assign(array('entry' => $this->entry, 'contestID' => $this->contestID, 'userID' => $this->entry->userID, 'sponsortalks' => $this->sponsortalkList->getObjects(), 'templateName' => $this->templateName, 'allowSpidersToIndexThisPage' => true, 'contestmenu' => ContestMenu::getInstance()));
 }
 /**
  * @see Page::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     $this->sidebar->assignVariables();
     WCF::getTPL()->assign(array('group' => $this->group, 'categories' => $this->categories, 'informationFields' => $this->informationFields, 'userlist' => $this->userlist, 'allowSpidersToIndexThisPage' => true));
 }
    /**
     * @see Form::assignVariables()
     */
    public function assignVariables()
    {
        parent::assignVariables();
        if ($this->success) {
            $l = 'wcf.contest.price.' . StringUtil::encodeHTML($this->success) . '.success';
            WCF::getTPL()->append('userMessages', '<p class="success">' . WCF::getLanguage()->get($l) . '</p>');
        }
        // display branding
        require_once WCF_DIR . 'lib/util/ContestUtil.class.php';
        ContestUtil::assignVariablesBranding();
        // save price position
        if ($this->entry->isOwner()) {
            require_once WCF_DIR . 'lib/form/ContestPricePositionForm.class.php';
            new ContestPricePositionForm($this->entry);
        }
        // init form
        if ($this->action == 'edit') {
            require_once WCF_DIR . 'lib/form/ContestPriceEditForm.class.php';
            new ContestPriceEditForm($this->entry);
        } else {
            if ($this->entry->isPriceable()) {
                require_once WCF_DIR . 'lib/form/ContestPriceAddForm.class.php';
                new ContestPriceAddForm($this->entry);
            }
        }
        // become sponsor
        if ($this->entry->enableSponsorCheck && !$this->entry->isSponsor() && $this->entry->isSponsorable(false)) {
            WCF::getTPL()->append('additionalContentBecomeSponsor', '<p class="info">' . WCF::getLanguage()->get('wcf.contest.enableSponsorCheck.info') . '</p>');
        }
        // if contest is finished, show todo list
        // who is able to pick the prices
        $isWinner = false;
        if ($this->entry->state == 'closed') {
            // need winners
            require_once WCF_DIR . 'lib/data/contest/solution/ContestSolutionList.class.php';
            $solutionList = new ContestSolutionList();
            $solutionList->sqlConditions .= 'contest_solution.contestID = ' . intval($this->contestID);
            $solutionList->sqlLimit = $this->countItems();
            $solutionList->readObjects();
            $winners = array();
            foreach ($solutionList->getObjects() as $solution) {
                $winners[] = $solution->participantID;
                $isWinner = $isWinner || $solution->isOwner();
            }
            if (count($winners)) {
                // init todo list
                require_once WCF_DIR . 'lib/data/contest/price/todo/ContestPriceTodoList.class.php';
                $this->todoList = new ContestPriceTodoList();
                $this->todoList->sqlConditions .= '
					contest_solution.participantID IN (' . implode(',', $winners) . ')
					AND contest_solution.contestID = ' . intval($this->contestID);
                $this->todoList->sqlOrderBy = 'FIND_IN_SET(contest_solution.participantID, \'' . implode(',', $winners) . '\')';
                $this->todoList->sqlLimit = $this->countItems();
                $this->todoList->readObjects();
            }
        }
        // which price is pickable be the current user NOW?
        $solution = null;
        $didPick = false;
        if ($isWinner) {
            foreach ($this->priceList->getObjects() as $price) {
                if ($price->isPickable()) {
                    $solution = $price->pickableByWinner();
                    break;
                } else {
                    if ($price->isOwner()) {
                        $didPick = true;
                    }
                }
            }
        } else {
            if ($this->entry->state == 'scheduled' && $this->entry->untilTime > TIME_NOW) {
                WCF::getTPL()->append('userMessages', '<p class="info">' . WCF::getLanguage()->get('wcf.contest.price.closed.info') . '</p>');
            } else {
                if ($this->entry->enablePricechoice) {
                    WCF::getTPL()->append('userMessages', '<p class="info">' . WCF::getLanguage()->get('wcf.contest.price.pick.info') . '</p>');
                }
            }
        }
        $this->sidebar->assignVariables();
        WCF::getTPL()->assign(array('entry' => $this->entry, 'isSponsor' => $this->isSponsor, 'contestID' => $this->contestID, 'userID' => $this->entry->userID, 'solution' => $solution, 'isWinner' => $isWinner, 'didPick' => $didPick, 'prices' => $this->priceList->getObjects(), 'todos' => $this->todoList ? $this->todoList->getObjects() : array(), 'templateName' => $this->templateName, 'allowSpidersToIndexThisPage' => true, 'contestmenu' => ContestMenu::getInstance()));
    }
Exemplo n.º 8
0
 /**
  * @see Page::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     // display branding
     require_once WCF_DIR . 'lib/util/ContestUtil.class.php';
     ContestUtil::assignVariablesBranding();
     // init form
     if ($this->action == 'edit') {
         require_once WCF_DIR . 'lib/form/ContestCommentEditForm.class.php';
         new ContestCommentEditForm($this->entry);
     } else {
         if ($this->entry->isCommentable()) {
             require_once WCF_DIR . 'lib/form/ContestCommentAddForm.class.php';
             new ContestCommentAddForm($this->entry);
         }
     }
     $this->sidebar->assignVariables();
     WCF::getTPL()->assign(array('entry' => $this->entry, 'contestID' => $this->contestID, 'tags' => MODULE_TAGGING ? $this->entry->getTags(WCF::getSession()->getVisibleLanguageIDArray()) : array(), 'events' => $this->eventmixList->getObjects(), 'todos' => $this->todoList ? $this->todoList->getObjects() : array(), 'classes' => $this->entry->getClasses(), 'jurys' => $this->entry->getJurys(), 'participants' => $this->entry->getParticipants(), 'attachments' => $this->attachments, 'location' => $this->entry->location, 'action' => $this->action, 'commentID' => $this->commentID, 'previousEntry' => $this->previousEntry, 'nextEntry' => $this->nextEntry, 'templateName' => $this->templateName, 'allowSpidersToIndexThisPage' => true, 'contestmenu' => ContestMenu::getInstance()));
 }
 /**
  * @see Page::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     // display branding
     require_once WCF_DIR . 'lib/util/ContestUtil.class.php';
     ContestUtil::assignVariablesBranding();
     $this->sidebar->assignVariables();
     WCF::getTPL()->assign(array('entries' => $this->entryList->getObjects(), 'description' => $this->description, 'classes' => $this->entryList->getClasses(), 'todos' => $this->todoList ? $this->todoList->getObjects() : array(), 'tags' => $this->entryList->getTags(), 'availableTags' => $this->tags, 'tagID' => $this->tagID, 'juryID' => $this->juryID, 'participantID' => $this->participantID, 'classID' => $this->classID, 'tag' => $this->tag, 'taggableID' => $this->taggable !== null ? $this->taggable->getTaggableID() : 0, 'allowSpidersToIndexThisPage' => true));
 }
 /**
  * @see Form::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     // display branding
     require_once WCF_DIR . 'lib/util/ContestUtil.class.php';
     ContestUtil::assignVariablesBranding();
     // save ratings
     if ($this->solutionObj->isRateable()) {
         require_once WCF_DIR . 'lib/form/ContestSolutionRatingUpdateForm.class.php';
         new ContestSolutionRatingUpdateForm($this->solutionObj);
     }
     // init form
     if ($this->action == 'edit') {
         require_once WCF_DIR . 'lib/form/ContestSolutionCommentEditForm.class.php';
         new ContestSolutionCommentEditForm($this->solutionObj);
     } else {
         if ($this->entry->isCommentable()) {
             require_once WCF_DIR . 'lib/form/ContestSolutionCommentAddForm.class.php';
             new ContestSolutionCommentAddForm($this->solutionObj);
         }
     }
     if (!$this->entry->enableOpenSolution && $this->entry->state != 'closed' && ($this->entry->state != 'scheduled' || !($this->entry->fromTime < TIME_NOW && TIME_NOW < $this->entry->untilTime))) {
         WCF::getTPL()->append('userMessages', '<p class="info">' . WCF::getLanguage()->get('wcf.contest.enableOpenSolution.info') . '</p>');
     }
     if ($this->entry->enableParticipantCheck) {
         WCF::getTPL()->append('userMessages', '<p class="info">' . WCF::getLanguage()->get('wcf.contest.enableParticipantCheck.info') . '</p>');
     }
     $this->sidebar->assignVariables();
     WCF::getTPL()->assign(array('entry' => $this->entry, 'solutionObj' => $this->solutionObj, 'contestID' => $this->contestID, 'solutionID' => $this->solutionID, 'userID' => $this->entry->userID, 'comments' => $this->commentList->getObjects(), 'ratings' => $this->ratingList->getObjects(), 'todos' => $this->todoList ? $this->todoList->getObjects() : array(), 'templateName' => $this->templateName, 'allowSpidersToIndexThisPage' => true, 'attachments' => $this->attachments, 'contestmenu' => ContestMenu::getInstance()));
 }