Exemplo n.º 1
0
                     $oPresetManager = CTaskColumnPresetManager::getInstance($loggedInUserId, $columnContextId);
                     $oPresetManager->selectPresetId(CTaskColumnPresetManager::PRESET_DEFAULT);
                     // reset sort order
                     CUserOptions::SetOption('tasks:list:sort', 'sort' . '_' . $columnContextId, 'none', false, $loggedInUserId);
                 } else {
                     if ($_POST['mode'] === 'moveColumnAfter') {
                         CTaskAssert::assert(isset($_POST['movedColumnId'], $_POST['movedAfterColumnId'], $_POST['columnContextId']));
                         $loggedInUserId = $USER->getId();
                         $movedColumnId = (int) $_POST['movedColumnId'];
                         $movedAfterColumnId = (int) $_POST['movedAfterColumnId'];
                         $columnContextId = (int) $_POST['columnContextId'];
                         $knownColumnsIds = array_keys(CTaskColumnList::get());
                         CTaskAssert::assert($loggedInUserId >= 1);
                         CTaskAssert::assert(in_array($movedColumnId, $knownColumnsIds));
                         CTaskAssert::assert($movedAfterColumnId == 0 || in_array($movedAfterColumnId, $knownColumnsIds));
                         CTaskAssert::assert(in_array($columnContextId, CTaskColumnContext::get()));
                         $oPresetManager = CTaskColumnPresetManager::getInstance($loggedInUserId, $columnContextId);
                         $oColumnManager = new CTaskColumnManager($oPresetManager);
                         $oColumnManager->moveColumnAfter($movedColumnId, $movedAfterColumnId);
                     } else {
                         if ($_POST['mode'] === 'groupAction') {
                             CTaskAssert::assert(isset($_POST['action']));
                         }
                     }
                 }
             }
         }
     }
 } catch (Exception $e) {
     if ($jsonReply === null) {
         $jsonReply = array('status' => 'failure');
Exemplo n.º 2
0
 /**
  * @param $userId
  * @param $contextId
  */
 private function __construct($userId, $contextId)
 {
     $this->userId = (int) $userId;
     CTaskAssert::assertLaxIntegers($contextId);
     $contextId = (int) $contextId;
     $arKnownContexts = CTaskColumnContext::get();
     CTaskAssert::assert(in_array($contextId, $arKnownContexts));
     $this->contextId = $contextId;
 }