Revize 461d73de
Přidáno uživatelem Ondřej Fibich před více než 8 roky(ů)
application/controllers/work_reports.php | ||
---|---|---|
$vote_model = new Vote_Model();
|
||
|
||
$vote_model->transaction_start();
|
||
|
||
// check if not already paid off
|
||
$work_report_model->reload(); // need to reload in transaction
|
||
if ($work_report_model->transfer_id)
|
||
{
|
||
throw new Exception('This work report is already paied off,'
|
||
. ' you cannot vote anymore');
|
||
}
|
||
|
||
$work_ids = $_POST['ids'];
|
||
$votes = $_POST['vote'];
|
||
... | ... | |
Vote_Model::STATE_APPROVED => array()
|
||
);
|
||
|
||
$votes_count = 0;
|
||
$added_votes_count = 0;
|
||
|
||
// voting user
|
||
$user = new User_Model($this->user_id);
|
||
... | ... | |
$aro_group->id
|
||
);
|
||
|
||
$votes_count++;
|
||
$added_votes_count++;
|
||
}
|
||
|
||
// set up state of work
|
||
... | ... | |
}
|
||
|
||
// any vote has been added
|
||
if ($votes_count)
|
||
if ($added_votes_count)
|
||
{
|
||
// send message about adding vote to all watchers
|
||
$subject = mail_message::format('work_report_vote_add_subject');
|
Také k dispozici: Unified diff
refs #1034: Work report cannot be revoted after it is paied off