1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
event.php
См. документацию.
1<?php
8namespace Bitrix\Vote;
9use Bitrix\Main\ArgumentException;
10use Bitrix\Main\ArgumentNullException;
11use Bitrix\Main\ArgumentTypeException;
12use \Bitrix\Main\Entity;
13use Bitrix\Main\Error;
14use Bitrix\Main\ErrorCollection;
15use \Bitrix\Main\Localization\Loc;
16use Bitrix\Main\DB\MssqlConnection;
17use Bitrix\Main\DB\MysqlCommonConnection;
18use Bitrix\Main\DB\OracleConnection;
19use Bitrix\Main\Application;
20use Bitrix\Main\ORM\Fields\BooleanField;
21use Bitrix\Main\ORM\Fields\DatetimeField;
22use Bitrix\Main\ORM\Fields\EnumField;
23use Bitrix\Main\ORM\Fields\ExpressionField;
24use Bitrix\Main\ORM\Fields\IntegerField;
25use Bitrix\Main\ORM\Fields\Relations\Reference;
26use Bitrix\Main\ORM\Fields\StringField;
27use Bitrix\Main\ORM\Fields\TextField;
28use Bitrix\Main\ORM\Query\Join;
29use Bitrix\Main\Type\Dictionary as EventResult;
30use Bitrix\Vote\Base\BaseObject;
31
32Loc::loadMessages(__FILE__);
33
48class EventTable extends Entity\DataManager
49{
55 public static function getTableName()
56 {
57 return 'b_vote_event';
58 }
59
65 public static function getMap()
66 {
67 return array(
68 (new IntegerField('ID', ['primary' => true, 'autocomplete' => true])),
69 (new IntegerField('VOTE_ID')),
70 (new IntegerField('VOTE_USER_ID', ["required" => true])),
71 (new DatetimeField('DATE_VOTE')),
72 (new IntegerField('STAT_SESSION_ID')),
73 (new StringField('IP', ['size' => 15])),
74 (new BooleanField('VALID', ['values' => ['N', 'Y'], 'default_value' => 'Y'])),
75 (new BooleanField('VISIBLE', ['values' => ['N', 'Y'], 'default_value' => 'Y'])),
76 (new Reference('QUESTION', \Bitrix\Vote\EventQuestionTable::class, Join::on('this.ID', 'ref.EVENT_ID'))),
77 (new Reference('USER', \Bitrix\Vote\UserTable::class, Join::on('this.VOTE_USER_ID', 'ref.ID'))),
78 );
79 }
80}
81
91class EventQuestionTable extends Entity\DataManager
92{
98 public static function getTableName()
99 {
100 return 'b_vote_event_question';
101 }
102
108 public static function getMap()
109 {
110 return array(
111 'ID' => array(
112 'data_type' => 'integer',
113 'primary' => true,
114 'autocomplete' => true,
115 ),
116 'EVENT_ID' => array(
117 'data_type' => 'integer',
118 ),
119 'QUESTION_ID' => array(
120 'data_type' => 'integer',
121 ),
122 'VOTE' => array(
123 'data_type' => '\Bitrix\Vote\EventTable',
124 'reference' => array(
125 '=this.EVENT_ID' => 'ref.ID',
126 ),
127 'join_type' => 'RIGHT',
128 ),
129 'ANSWER' => array(
130 'data_type' => '\Bitrix\Vote\EventAnswerTable',
131 'reference' => array(
132 '=this.ID' => 'ref.EVENT_QUESTION_ID',
133 ),
134 'join_type' => 'LEFT',
135 )
136 );
137 }
138}
139
162class EventAnswerTable extends Entity\DataManager
163{
169 public static function getTableName()
170 {
171 return 'b_vote_event_answer';
172 }
173
179 public static function getMap()
180 {
181 return array(
182 'ID' => array(
183 'data_type' => 'integer',
184 'primary' => true,
185 'autocomplete' => true,
186 ),
187 'EVENT_QUESTION_ID' => array(
188 'data_type' => 'integer',
189 ),
190 'ANSWER_ID' => array(
191 'data_type' => 'integer',
192 ),
193 'MESSAGE' => array(
194 'data_type' => 'text',
195 )
196 );
197 }
198}
199
200class Event extends BaseObject
201{
202 private $vote;
207 const EVENT_FIELD_NAME = "bx_vote_event"; //
208 const EVENT_FIELD_BALLOT_TEMPLATE = self::EVENT_FIELD_NAME."[#ID#][BALLOT][#QUESTION_ID#]"; // this is template for voting
209 const EVENT_FIELD_MESSAGE_TEMPLATE = self::EVENT_FIELD_NAME."[#ID#][MESSAGE][#QUESTION_ID#][#ANSWER_ID#]"; // this is template for voting
210 const EVENT_FIELD_EXTRAS_TEMPLATE = self::EVENT_FIELD_NAME."[#ID#][EXTRAS][#ENTITY_ID#]";
211
218 function __construct(\Bitrix\Vote\Vote $vote)
219 {
220 $this->vote = $vote;
221 $this->errorCollection = new ErrorCollection;
222 }
223
228 public static function calculateStatistic($voteId)
229 {
230 $connection = Application::getInstance()->getConnection();
231 if ($connection instanceof MysqlCommonConnection)
232 {
233 $connection->executeSqlBatch(<<<SQL
234UPDATE b_vote V SET V.COUNTER=(
235 SELECT COUNT(VE.ID)
236 FROM b_vote_event VE
237 WHERE VE.VOTE_ID=V.ID)
238WHERE V.ID={$voteId};
239UPDATE b_vote_question VQ SET VQ.COUNTER=(
240 SELECT COUNT(VEQ.ID)
241 FROM b_vote_event_question VEQ
242 WHERE VEQ.QUESTION_ID=VQ.ID)
243WHERE VQ.VOTE_ID={$voteId};
244UPDATE b_vote_answer VA, b_vote_question VQ SET VA.COUNTER=(
245 SELECT COUNT(VEA.ID)
246 FROM b_vote_event_answer VEA
247 WHERE VEA.ANSWER_ID=VA.ID)
248WHERE VQ.ID = VA.QUESTION_ID AND VQ.VOTE_ID={$voteId};
249UPDATE b_vote_user VU, b_vote_event VE SET VU.COUNTER=(
250 SELECT COUNT(VE.ID)
251 FROM b_vote_event VE
252 WHERE VU.ID=VE.VOTE_USER_ID AND VE.VALID='Y')
253WHERE VU.ID IN (SELECT VOTE_USER_ID FROM b_vote_event WHERE VOTE_ID={$voteId});
254SQL
255 );
256 }
257 else if ($connection instanceof MssqlConnection)
258 {
259 $connection->executeSqlBatch(<<<SQL
260UPDATE b_vote SET b_vote.COUNTER=E.COUNTER
261FROM (
262 SELECT COUNT(ID) COUNTER, VOTE_ID
263 FROM b_vote_event
264 WHERE VOTE_ID={$voteId}
265 GROUP BY VOTE_ID) E
266WHERE b_vote.ID=E.VOTE_ID AND b_vote.ID={$voteId}
267GO
268UPDATE b_vote_question SET COUNTER=E.COUNTER
269FROM (
270 SELECT COUNT(EQ.ID) COUNTER, EQ.QUESTION_ID
271 FROM b_vote_event_question EQ
272 JOIN b_vote_question Q ON (Q.ID = EQ.QUESTION_ID)
273 WHERE Q.VOTE_ID={$voteId}
274 GROUP BY EQ.QUESTION_ID) E
275WHERE b_vote_question.ID=E.QUESTION_ID AND b_vote_question.VOTE_ID={$voteId}
276GO
277UPDATE b_vote_answer SET b_vote_answer.COUNTER=E.COUNTER
278FROM (
279 SELECT COUNT(VEA.ID) COUNTER, VEA.ANSWER_ID
280 FROM b_vote_event_answer VEA
281 INNER JOIN b_vote_answer VA ON (VA.ID=VEA.ANSWER_ID)
282 INNER JOIN b_vote_question VQ ON (VQ.ID=VA.QUESTION_ID)
283 WHERE VQ.VOTE_ID={$voteId}
284 GROUP BY VEA.ANSWER_ID
285) E
286WHERE b_vote_answer.ID=E.ANSWER_ID
287GO
288UPDATE b_vote_user SET b_vote_user.COUNTER=E.COUNTER
289FROM (
290 SELECT COUNT(ID) COUNTER, VOTE_USER_ID
291 FROM b_vote_event
292 WHERE VALID='Y'
293 GROUP BY VOTE_USER_ID
294) E
295WHERE b_vote_user.ID=E.VOTE_USER_ID AND b_vote_user.ID IN (SELECT VOTE_USER_ID FROM b_vote_event WHERE VOTE_ID={$voteId})
296GO
297SQL
298 );
299 }
301 {
302 $connection->executeSqlBatch(<<<SQL
303UPDATE b_vote V SET V.COUNTER=(
304 SELECT COUNT(VE.ID)
305 FROM b_vote_event VE
306 WHERE VE.VOTE_ID=V.ID)
307WHERE V.ID={$voteId}
308/
309UPDATE b_vote_question VQ SET VQ.COUNTER=(
310 SELECT COUNT(VEQ.ID)
311 FROM b_vote_event_question VEQ
312 WHERE VEQ.QUESTION_ID=VQ.ID)
313WHERE VQ.VOTE_ID={$voteId}
314/
315UPDATE b_vote_answer VA SET VA.COUNTER=(
316 SELECT COUNT(ID)
317 FROM b_vote_event_answer
318 WHERE ANSWER_ID=VA.ID)
319WHERE VA.QUESTION_ID IN (
320 SELECT ID
321 FROM b_vote_question
322 WHERE VOTE_ID={$voteId}
323)
324/
325UPDATE b_vote_user VU SET VU.COUNTER=(
326 SELECT COUNT(ID)
327 FROM b_vote_event
328 WHERE VU.ID=VOTE_USER_ID AND VALID='Y')
329WHERE VU.ID IN (SELECT VOTE_USER_ID FROM b_vote_event WHERE VOTE_ID={$voteId})
330/
331SQL
332 );
333 }
334 }
335
340 public static function resetStatistic($voteId)
341 {
342 $voteId = (int)$voteId;
343 $connection = Application::getInstance()->getConnection();
344 $helper = $connection->getSqlHelper();
345
346 $connection->query($helper->prepareCorrelatedUpdate(
347 'b_vote_user',
348 'U',
349 [
350 'COUNTER' => '(CASE WHEN U.COUNTER - E.COUNTER > 0 THEN U.COUNTER - E.COUNTER ELSE 0 END)'
351 ],
352 "( SELECT count(ID) as COUNTER, VOTE_USER_ID
353 FROM b_vote_event
354 WHERE VOTE_ID={$voteId}
355 GROUP BY VOTE_USER_ID ) E",
356 'E.VOTE_USER_ID=U.ID'
357 ));
358
359 $connection->query("UPDATE b_vote set COUNTER = 0 WHERE ID = {$voteId}");
360
361 $connection->query("UPDATE b_vote_question SET COUNTER=0 WHERE VOTE_ID = {$voteId}");
362
363 $connection->query("UPDATE b_vote_answer SET COUNTER=0
364 WHERE QUESTION_ID IN (
365 SELECT ID FROM b_vote_question WHERE VOTE_ID={$voteId}
366 )");
367
368 $connection->query("DELETE FROM b_vote_event WHERE VOTE_ID = {$voteId}");
369
370 $connection->query("DELETE FROM b_vote_event_question
371 WHERE QUESTION_ID IN (
372 SELECT ID from b_vote_question WHERE VOTE_ID = {$voteId}
373 )");
374
375 $connection->query("DELETE FROM b_vote_event_answer
376 WHERE ANSWER_ID IN (
377 SELECT A.ID
378 FROM b_vote_answer A
379 JOIN b_vote_question Q ON (Q.ID = A.QUESTION_ID)
380 WHERE Q.VOTE_ID = {$voteId}
381 )");
382
383 /***************** Event OnVoteReset *******************************/
384 foreach (GetModuleEvents("vote", "onVoteReset", true) as $event)
385 {
387 }
388 /***************** /Event ******************************************/
389 }
390
395 public static function deleteEvent($eventId)
396 {
397 if (!is_integer($eventId))
398 throw new ArgumentTypeException("event ID");
399 else if ($eventId <= 0)
400 throw new ArgumentNullException("event ID");
401
402 self::setValid($eventId, "N");
403 $connection = Application::getInstance()->getConnection();
404 $connection->queryExecute("DELETE FROM b_vote_event_answer WHERE EVENT_QUESTION_ID IN (SELECT VEQ.ID FROM b_vote_event_question VEQ WHERE VEQ.EVENT_ID={$eventId})");
405 $connection->queryExecute("DELETE FROM b_vote_event_question WHERE EVENT_ID={$eventId}");
406 $connection->queryExecute("DELETE FROM b_vote_event WHERE ID={$eventId}");
407 return $connection->getAffectedRowsCount() > 0;
408 }
409
414 public static function setValid($eventId, $valid)
415 {
416 $valid = ($valid == "Y" ? "Y" : "N");
417 $eventId = intval($eventId);
418 if ($eventId <= 0)
419 return false;
420
421 $dbRes = EventTable::getList(array(
422 'select' => array(
423 'V_' => '*',
424 'Q_' => 'QUESTION.*',
425 'A_' => 'QUESTION.ANSWER.*'),
426 'filter' => array(
427 'ID' => $eventId,
428 '!=VALID' => $valid),
429 'order' => array(
430 'ID' => 'ASC',
431 'QUESTION.ID' => 'ASC',
432 'QUESTION.ANSWER.ID' => 'ASC')));
433 if (($res = $dbRes->fetch()) && $res)
434 {
435 $questions = array();
436 $answers = array();
437 EventTable::update($eventId, array("VALID" => $valid));
438 VoteTable::setCounter(array($res["V_VOTE_ID"]), ($valid == "Y"));
439 UserTable::setCounter(array($res["V_VOTE_USER_ID"]), ($valid == "Y"));
440 do
441 {
442 $questions[] = $res["Q_QUESTION_ID"];
443 $answers[] = $res["A_ANSWER_ID"];
444 } while ($res = $dbRes->fetch());
445
446 QuestionTable::setCounter(array_unique($questions), ($valid == "Y"));
447 AnswerTable::setCounter($answers, ($valid == "Y"));
448 return true;
449 }
450 return false;
451 }
452
453 public static function getFieldName($id, $questionId)
454 {
455 return str_replace(array("#ID#", "#QUESTION_ID#"), array($id, $questionId), self::EVENT_FIELD_BALLOT_TEMPLATE);
456 }
457 public static function getMessageFieldName($id, $questionId, $answerId)
458 {
459 return str_replace(array("#ID#", "#QUESTION_ID#", "#ANSWER_ID#"), array($id, $questionId, $answerId), self::EVENT_FIELD_MESSAGE_TEMPLATE);
460 }
461 public static function getExtrasFieldName($id, $name)
462 {
463 return str_replace(array("#ID#", "#ENTITY_ID#"), array($id, $name), self::EVENT_FIELD_EXTRAS_TEMPLATE);
464 }
465
466 public static function getDataFromRequest($id, array $request)
467 {
468 if (
469 array_key_exists(self::EVENT_FIELD_NAME, $request) &&
470 is_array($request[self::EVENT_FIELD_NAME]) &&
471 array_key_exists($id, $request[self::EVENT_FIELD_NAME]) &&
472 is_array($request[self::EVENT_FIELD_NAME][$id])
473 )
474 {
475 $data = [];
476 if (array_key_exists("BALLOT", $request[self::EVENT_FIELD_NAME][$id]))
477 {
478 foreach ($request[self::EVENT_FIELD_NAME][$id]["BALLOT"] as $qId => $answerIds)
479 {
480 $answerIds = is_array($answerIds) ? $answerIds : array($answerIds);
481 foreach ($answerIds as $answerId)
482 {
483 $data["BALLOT"] = isset($data["BALLOT"]) && is_array($data["BALLOT"]) ? $data["BALLOT"] : [];
484 $data["BALLOT"][$qId] = isset($data["BALLOT"][$qId]) && is_array($data["BALLOT"][$qId]) ? $data["BALLOT"][$qId] : [];
485 $data["BALLOT"][$qId][$answerId] = true;
486 }
487 }
488 }
489 if (array_key_exists("MESSAGE", $request[self::EVENT_FIELD_NAME][$id]))
490 {
491 foreach ($request[self::EVENT_FIELD_NAME][$id]["MESSAGE"] as $qId => $answerIds)
492 {
493
494 foreach ($answerIds as $answerId => $message)
495 {
496 $message = trim($message);
497 if ($message <> '')
498 {
499 $data["MESSAGE"][$qId] = is_array($data["MESSAGE"][$qId]) ? $data["MESSAGE"][$qId] : [];
500 $data["MESSAGE"][$qId][$answerId] = $message;
501 }
502 }
503 }
504 }
505 if (array_key_exists("EXTRAS", $request[self::EVENT_FIELD_NAME][$id]))
506 {
507 $data["EXTRAS"] = $request[self::EVENT_FIELD_NAME][$id]["EXTRAS"];
508 }
509 if (!empty($data))
510 return $data;
511 }
512 return null;
513 }
514
518 public function check(array $ballot)
519 {
520 $questions = $this->vote->getQuestions();
521 $fields = array();
522 $data = (array_key_exists("BALLOT", $ballot) ? $ballot["BALLOT"] : []);
523 $message = (array_key_exists("MESSAGE", $ballot) ? $ballot["MESSAGE"] : []);
524 foreach ($questions as $questionId => $question)
525 {
526 if (array_key_exists($question["ID"], $data) && is_array($data[$question["ID"]]))
527 {
528 $answers = array_intersect_key($data[$question["ID"]], $question["ANSWERS"]);
529 if ($question["FIELD_TYPE"] === QuestionTypes::COMPATIBILITY && array_key_exists($question["ID"], $message))
530 {
531 foreach($message[$question["ID"]] as $id => $value)
532 {
533 $value = trim($value);
534 if ($value <> '')
535 {
536 $answers[$id] = true;
537 }
538 }
539 }
540 if (!empty($answers))
541 {
542 //region this code should not exists
543 if ($question["FIELD_TYPE"] == QuestionTypes::COMPATIBILITY)
544 {
545 $singleVal = array(AnswerTypes::RADIO => false, AnswerTypes::DROPDOWN => false);
546 $res = [];
547 foreach ($answers as $id => $value)
548 {
549 $answer = $question["ANSWERS"][$id];
550 switch ($answer["FIELD_TYPE"])
551 {
552 case AnswerTypes::RADIO :
554 if (!$singleVal[$answer["FIELD_TYPE"]])
555 {
556 $singleVal[$answer["FIELD_TYPE"]] = true;
557 $res[$id] = $value;
558 }
559 break;
560 default :
561 $res[$id] = $value;
562 break;
563 }
564 }
565 if (!empty($res))
566 {
567 $fields[$question["ID"]] = $res;
568 }
569 }
570 //endregion
571 else if ($question["FIELD_TYPE"] == QuestionTypes::RADIO ||
572 $question["FIELD_TYPE"] == QuestionTypes::DROPDOWN)
573 {
574 $val = reset($answers);
575 $fields[$question["ID"]] = array(
576 key($answers) => $val
577 );
578 }
579 else
580 {
581 $fields[$question["ID"]] = $answers;
582 }
583 //region Check for message text from form
584 $res = $fields[$question["ID"]];
585 if (array_key_exists($question["ID"], $message))
586 {
587 $message[$question["ID"]] = is_array($message[$question["ID"]]) ? $message[$question["ID"]] : [];
588 foreach ($fields[$question["ID"]] as $id => $value)
589 {
590 if (array_key_exists($id, $message[$question["ID"]]))
591 $fields[$question["ID"]][$id] = trim($message[$question["ID"]][$id]);
592 }
593 }
594 if (empty($fields[$question["ID"]]))
595 {
596 unset($fields[$question["ID"]]);
597 }
598 //endregion
599 }
600 }
601 if ($question['REQUIRED'] === 'Y' && $question['ACTIVE'] === 'Y' && !array_key_exists($question["ID"], $fields))
602 {
603 $this->errorCollection->add(array(new Error(Loc::getMessage("VOTE_REQUIRED_MISSING"), "QUESTION_".$questionId)));
604 }
605 }
606 if (empty($fields))
607 $this->errorCollection->add(array(new Error(Loc::getMessage("USER_VOTE_EMPTY"), "VOTE_".$this->vote->getId())));
608
609 return $fields;
610 }
611
612 public function add(array $eventFields, array $ballot, $setCounter = true): ?EventResult
613 {
614 $this->errorCollection->clear();
615 $fields = $this->check($ballot);
616 if (!$this->errorCollection->isEmpty())
617 {
618 return null;
619 }
620 $eventFields = array(
621 "VOTE_ID" => $this->vote->getId(),
622 "VOTE_USER_ID" => $eventFields["VOTE_USER_ID"],
623 "DATE_VOTE" => (array_key_exists("DATE_VOTE", $eventFields) ? $eventFields["DATE_VOTE"] : new \Bitrix\Main\Type\DateTime()),
624 "STAT_SESSION_ID" => $eventFields["STAT_SESSION_ID"],
625 "IP" => $eventFields["IP"],
626 "VALID" => $eventFields["VALID"] ?: "Y",
627 "VISIBLE" => ($eventFields["VISIBLE"] ?: "Y")
628 );
629 if (array_key_exists("EXTRAS", $ballot) && is_array($ballot["EXTRAS"]) && array_key_exists("VISIBLE", $ballot["EXTRAS"]))
630 $eventFields["VISIBLE"] = ($ballot["EXTRAS"]["VISIBLE"] === "N" ? "N" : "Y");
631
632 // Compatibility
633 $sqlAnswers = array();
634 foreach ($fields as $questionId => $fieldsAnswer)
635 {
636 foreach ($fieldsAnswer as $answerId => $value)
637 {
638 $sqlAnswers[$questionId][$answerId] = array(
639 "ANSWER_ID" => $answerId,
640 "MESSAGE" => is_string($value)? mb_substr($value, 0, 2000) : "");
641 }
642 }
643
644 /***************** Event onBeforeVoting ****************************/
645 foreach (GetModuleEvents("vote", "onBeforeVoting", true) as $event)
646 {
647 if (ExecuteModuleEventEx($event, array(&$eventFields, &$sqlAnswers)) === false)
648 {
649 $this->errorCollection->add(array(new Error("onBeforeVoting error", "VOTE_".$eventFields["VOTE_ID"])));
650 return null;
651 }
652 }
653 /***************** /Event ******************************************/
654 if (!empty($sqlAnswers) && ($eventId = EventTable::add($eventFields)->getId()) && $eventId > 0)
655 {
656 $ids = array();
657 $answerIdsForCounter = array();
658 foreach ($sqlAnswers as $questionId => $fieldsAnswer)
659 {
660 if (($eventQId = EventQuestionTable::add(array("EVENT_ID" => $eventId, "QUESTION_ID" => $questionId))->getId()) && $eventQId > 0)
661 {
662 $ids[$questionId] = [
663 "EVENT_ID" => $eventQId,
664 "ANSWERS" => []
665 ];
666 foreach ($fieldsAnswer as $answerId => $res)
667 {
668 if (($eventAId = EventAnswerTable::add(array(
669 "EVENT_QUESTION_ID" => $eventQId,
670 "ANSWER_ID" => $res["ANSWER_ID"],
671 "MESSAGE" => $res["MESSAGE"]))->getId()
672 ) && $eventAId > 0)
673 {
674 $ids[$questionId]["ANSWERS"][$answerId] = [
675 "EVENT_ID" => $eventAId,
676 "EVENT_QUESTION_ID" => $eventQId,
677 "ANSWER_ID" => $res["ANSWER_ID"],
678 "MESSAGE" => $res["MESSAGE"]
679 ];
680 $answerIdsForCounter[] = $answerId;
681 }
682 }
683 if (empty($ids[$questionId]))
684 {
685 EventQuestionTable::delete($eventQId);
686 unset($ids[$questionId]);
687 }
688 }
689 }
690
691 if (!empty($ids))
692 {
693 if ($setCounter)
694 {
695 VoteTable::setCounter(array($this->vote->getId()), true);
696 QuestionTable::setCounter(array_keys($ids), true);
697 AnswerTable::setCounter($answerIdsForCounter, true);
698 }
699
700 return new EventResult(array(
701 "EVENT_ID" => $eventId,
702 "VOTE_ID" => $eventFields["VOTE_ID"],
703 "VOTE_USER_ID" => $eventFields["VOTE_USER_ID"],
704 "DATE_VOTE" => $eventFields["DATE_VOTE"],
705 "STAT_SESSION_ID" => $eventFields["SESS_SESSION_ID"] ?? null,
706 "IP" => $eventFields["IP"],
707 "VISIBLE" => $eventFields["VISIBLE"],
708 "VALID" => $eventFields["VALID"],
709 "BALLOT" => $ids
710 ));
711 }
712 EventTable::delete($eventId);
713 }
714 return null;
715 }
716}
$connection
Определения actionsdefinitions.php:38
if(!Loader::includeModule('catalog')) if(!AccessController::getCurrent() ->check(ActionDictionary::ACTION_PRICE_EDIT)) if(!check_bitrix_sessid()) $request
Определения catalog_reindex.php:36
static getInstance()
Определения application.php:98
Определения error.php:15
Определения event.php:5
static setCounter(array $id, $increment=true)
Определения answer.php:115
const RADIO
Определения answertypes.php:15
const DROPDOWN
Определения answertypes.php:17
static getMap()
Определения event.php:179
static getTableName()
Определения event.php:169
static deleteEvent($eventId)
Определения event.php:395
static getExtrasFieldName($id, $name)
Определения event.php:461
static getMessageFieldName($id, $questionId, $answerId)
Определения event.php:457
const EVENT_FIELD_EXTRAS_TEMPLATE
Определения event.php:210
const EVENT_FIELD_MESSAGE_TEMPLATE
Определения event.php:209
static getDataFromRequest($id, array $request)
Определения event.php:466
$errorCollection
Определения event.php:213
static calculateStatistic($voteId)
Определения event.php:228
add(array $eventFields, array $ballot, $setCounter=true)
Определения event.php:612
static resetStatistic($voteId)
Определения event.php:340
const EVENT_FIELD_BALLOT_TEMPLATE
Определения event.php:208
static getFieldName($id, $questionId)
Определения event.php:453
__construct(\Bitrix\Vote\Vote $vote)
Определения event.php:218
check(array $ballot)
Определения event.php:518
static setValid($eventId, $valid)
Определения event.php:414
const EVENT_FIELD_NAME
Определения event.php:207
static getMap()
Определения event.php:108
static getTableName()
Определения event.php:98
Определения event.php:49
static getMap()
Определения event.php:65
static getTableName()
Определения event.php:55
static setCounter(array $id, $increment=true)
Определения question.php:161
const COMPATIBILITY
Определения questiontypes.php:19
const RADIO
Определения questiontypes.php:15
const DROPDOWN
Определения questiontypes.php:17
static setCounter(array $id, $increment=true)
Определения user.php:121
static setCounter(array $id, $increment=true)
Определения vote.php:439
$data['IS_AVAILABLE']
Определения .description.php:13
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$res
Определения filter_act.php:7
ExecuteModuleEventEx($arEvent, $arParams=[])
Определения tools.php:5214
GetModuleEvents($MODULE_ID, $MESSAGE_ID, $bReturnArray=false)
Определения tools.php:5177
$name
Определения menu_edit.php:35
Определения collection.php:2
Определения anonymity.php:8
$message
Определения payment.php:8
$event
Определения prolog_after.php:141
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393
$val
Определения options.php:1793
$dbRes
Определения yandex_detail.php:168
$fields
Определения yandex_run.php:501