7Loc::loadMessages(__FILE__);
48 return 'b_idea_email_subscribe';
60 'data_type' =>
'integer',
62 'title' => Loc::getMessage(
'IDEA_NOTIFY_EMAIL_USER_ID'),
64 'SUBSCRIBE_TYPE' =>
array(
65 'data_type' =>
'enum',
67 'values' =>
array(self::SUBSCRIBE_TYPE_ALL, self::SUBSCRIBE_TYPE_NEW_IDEAS),
68 'title' => Loc::getMessage(
'IDEA_NOTIFY_EMAIL_SUBSCRIBE_TYPE')
70 'ENTITY_TYPE' =>
array(
71 'data_type' =>
'enum',
73 'values' =>
array(self::ENTITY_TYPE_IDEA, self::ENTITY_TYPE_CATEGORY),
74 'title' => Loc::getMessage(
'IDEA_NOTIFY_EMAIL_ENTITY_TYPE')
76 'ENTITY_CODE' =>
array(
77 'data_type' =>
'string',
80 'title' => Loc::getMessage(
'IDEA_NOTIFY_EMAIL_ENTITY_CODE')
83 'data_type' =>
'Bitrix\Main\User',
85 '=this.USER_ID' =>
'ref.ID'
93 'ASCENDED_CATEGORIES' =>
array(
94 'data_type' =>
'Bitrix\Iblock\Section',
96 '=this.ENTITY_TYPE' =>
array(
'?',
'CATEGORY'),
97 '=this.LOWER_ENTITY_CODE' =>
'ref.CODE'
115 \CIdeaManagment::getInstance()->idea()->setCategoryListId(
$IblockID);
118 $this->IblockID = \CIdeaManagment::getInstance()->idea()->getCategoryListID();
120 $this->userID =
$USER->getID();
125 if (array_key_exists(
"IDEA",
$params))
127 $id =
"IDEA_".$params[
"IDEA"];
131 $id =
"CATEGORY_".$this->IblockID.(empty(
$params[
"CATEGORY"]) ?
"" :
"_".
$params[
"CATEGORY"]);
139 if ($this->IblockID > 0 && $this->userID > 0)
143 "USER_ID" => $this->userID,
145 "ENTITY_CODE" => (empty($category) ?
"" : $category)
147 if (
$db_res->getSelectedRowsCount() <= 0)
150 "USER_ID" => $this->userID,
153 "ENTITY_CODE" => (empty($category) ?
"" : $category)
163 if ($this->userID > 0)
165 return NotifyEmailTable::delete(
array(
166 "USER_ID" => $this->userID,
168 "ENTITY_CODE" => (empty($category) ?
"" : $category)
176 if ($this->userID > 0)
180 "USER_ID" => $this->userID,
182 "ENTITY_CODE" => $id.
""
187 "USER_ID" => $this->userID,
190 "ENTITY_CODE" => $id.
""
202 if ($this->userID > 0)
204 return NotifyEmailTable::delete(
array(
205 "USER_ID" => $this->userID,
215 if (!array_key_exists(
$userId, self::$cache))
218 return (array_key_exists($id, self::$cache[
$userId]) ? self::$cache[
$userId][$id] :
false);
223 if (!array_key_exists(
$userId, self::$cache))
234 if ($this->IblockID > 0 &&
$userId > 0)
241 else if (empty($category))
248 "=ENTITY_CODE" => NULL
252 array_push($return,
$res);
254 else if (is_string($category) && ($categories = \CIdeaManagment::getInstance()->idea()->getCategoryList()) && !empty($categories))
256 $category = mb_strtoupper($category);
257 if (array_key_exists($category, $categories))
260 $category = $categories[$category];
265 "=ASCENDED_CATEGORIES.IBLOCK_ID" => \CIdeaManagment::getInstance()->idea()->getCategoryListID(),
266 "<=ASCENDED_CATEGORIES.DEPTH_LEVEL" => $category[
"DEPTH_LEVEL"],
267 "<=ASCENDED_CATEGORIES.LEFT_MARGIN" => $category[
"LEFT_MARGIN"],
268 ">=ASCENDED_CATEGORIES.RIGHT_MARGIN" => $category[
"RIGHT_MARGIN"]
272 array_push($return,
$res);
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
getCacheId($params=array())
setCache($userId, $params=array(), $data=array())
__construct($IblockID=null)
deleteCategory($category)
addCategory($category, $subscribeType=NotifyEmailTable::SUBSCRIBE_TYPE_NEW_IDEAS)
getAscendedCategories($category=null, $userId=null)
checkCache($userId, $params=array())
const ENTITY_TYPE_CATEGORY
const SUBSCRIBE_TYPE_NEW_IDEAS
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']