Exemplo n.º 1
0
 /** Get map of: task id => array of operations ids
  */
 public static function getTasksOperations()
 {
     $result = TaskTable::getList(array('select' => array('TASK' => 'ID', 'OPERATION' => 'Bitrix\\Main\\TaskOperationTable:TASK.OPERATION_ID'), 'filter' => array('=MODULE_ID' => 'sale', '=BINDING' => 'status'), 'order' => array('Bitrix\\Main\\TaskOperationTable:TASK.OPERATION_ID' => 'ASC')));
     $tasks = array();
     while ($row = $result->fetch()) {
         if (!$tasks[$row['TASK']]) {
             $tasks[$row['TASK']] = array();
         }
         if ($row['OPERATION']) {
             $tasks[$row['TASK']][] = $row['OPERATION'];
         }
     }
     return $tasks;
 }
Exemplo n.º 2
0
// initialise variables
$statusId = $_REQUEST['ID'] ? $DB->ForSql($_REQUEST['ID'], 2) : null;
$status = array();
// TYPE, SORT, NOTIFY
$translations = array();
// LID => LID, NAME, DESCRIPTION
$groupTasks = array();
// GROUP_ID => GROUP_ID, TASK_ID
$languages = array();
// LID => NAME
$groups = array();
// ID => NAME
$errors = array();
$tasks = array();
// ID => TASK
$result = TaskTable::getList(array('select' => array('*'), 'filter' => array('=MODULE_ID' => 'sale', '=BINDING' => 'status')));
while ($row = $result->fetch()) {
    $tasks[$row['ID']] = $row;
}
asort($tasks);
$statusFields = StatusTable::getEntity()->getFields();
$statusLangFields = StatusLangTable::getEntity()->getFields();
// get languages
$result = LanguageTable::getList(array('select' => array('LID', 'NAME'), 'filter' => array('=ACTIVE' => 'Y')));
while ($row = $result->fetch()) {
    $languages[$row['LID']] = $row['NAME'];
}
// get groups
$saleGroupIds = array();
$result = $APPLICATION->GetGroupRightList(array('MODULE_ID' => 'sale', 'G_ACCESS' => 'U'));
while ($row = $result->Fetch()) {