public function unsubscribeAction()
    {
        $orgId = urldecode($this->getRequest()->getParam('org'));

        if ($orgId && ($orgId != $this->currentUser->getCurrentOrganizationId())) {
            $allowedOrganizations = $this->currentUser->getAllowedOrganizations();
            if ((! $this->currentUser->isActive()) || isset($allowedOrganizations[$orgId])) {
                $this->currentUser->setCurrentOrganization($orgId);
            }
        }

        $this->html->h1($this->_('Unsubscribe'));

        $screen = $this->currentUser->getCurrentOrganization()->getUnsubscribeScreen();

        if ($screen instanceof UnsubscribeScreenInterface) {
            $params   = $screen->getUnsubscribeParameters();
            $snippets = $screen->getUnsubscribeSnippets();
        } else {
            $list = $this->_getScreenOrgs('gor_respondent_unsubscribe');
            if ($list) {
                $params   = [
                    'action' => 'unsubscribe',
                    'info'   => $this->_('Select an organization to unsubscribe from:'),
                    'orgs'   => $list,
                    ];
                $snippets = ['Organization\\ChooseListedOrganizationSnippet'];
            } else {
                $params   = [];
                $snippets = ['Unsubscribe\\NoUnsubscriptionsSnippet'];
            }
        }

        $this->addSnippets($snippets, $params);
    }
public function unsubscribeAction()
    {
        $orgId = urldecode($this->getRequest()->getParam('org'));

        if ($orgId && ($orgId != $this->currentUser->getCurrentOrganizationId())) {
            $allowedOrganizations = $this->currentUser->getAllowedOrganizations();
            if ((! $this->currentUser->isActive()) || isset($allowedOrganizations[$orgId])) {
                $this->currentUser->setCurrentOrganization($orgId);
            }
        }

        $this->html->h1($this->_('Unsubscribe'));

        $screen = $this->currentUser->getCurrentOrganization()->getUnsubscribeScreen();

        if ($screen instanceof UnsubscribeScreenInterface) {
            $params   = $screen->getUnsubscribeParameters();
            $snippets = $screen->getUnsubscribeSnippets();
        } else {
            $list = $this->_getScreenOrgs('gor_respondent_unsubscribe');
            if ($list) {
                $params   = [
                    'action' => 'unsubscribe',
                    'info'   => $this->_('Select an organization to unsubscribe from:'),
                    'orgs'   => $list,
                    ];
                $snippets = ['Organization\\ChooseListedOrganizationSnippet'];
            } else {
                $params   = [];
                $snippets = ['Unsubscribe\\NoUnsubscriptionsSnippet'];
            }
        }

        $this->addSnippets($snippets, $params);
    }
public function unsubscribeAction ( ) { $ orgId = urldecode ( $ this -> getRequest ( ) -> getParam ( 'org' ) ) ; if ( $ orgId && ( $ orgId != $ this -> currentUser -> getCurrentOrganizationId ( ) ) ) { $ allowedOrganizations = $ this -> currentUser -> getAllowedOrganizations ( ) ; if ( ( ! $ this -> currentUser -> isActive ( ) ) || isset ( $ allowedOrganizations [ $ orgId ] ) ) { $ this -> currentUser -> setCurrentOrganization ( $ orgId ) ; } } $ this -> html -> h1 ( $ this -> _ ( 'Unsubscribe' ) ) ; $ screen = $ this -> currentUser -> getCurrentOrganization ( ) -> getUnsubscribeScreen ( ) ; if ( $ screen instanceof UnsubscribeScreenInterface ) { $ params = $ screen -> getUnsubscribeParameters ( ) ; $ snippets = $ screen -> getUnsubscribeSnippets ( ) ; } else { $ list = $ this -> _getScreenOrgs ( 'gor_respondent_unsubscribe' ) ; if ( $ list ) { $ params = [ 'action' => 'unsubscribe' , 'info' => $ this -> _ ( 'Select an organization to unsubscribe from:' ) , 'orgs' => $ list , ] ; $ snippets = [ 'Organization\\ChooseListedOrganizationSnippet' ] ; } else { $ params = [ ] ; $ snippets = [ 'Unsubscribe\\NoUnsubscriptionsSnippet' ] ; } } $ this -> addSnippets ( $ snippets , $ params ) ; }
Ask the user which organization to unsubscribe from

@return void
Ask the user which organization to unsubscribe from