original_string: public function addStaffPage($label, array $other = array())
      {
          if ($this->user->hasPrivilege('pr.staff.edit.all')) {
              $filter = array_keys($this->escort->getUtil()->getDbLookup()->getOrganizations());
          } else {
              $filter = array_keys($this->user->getAllowedOrganizations());
          }
  
          $page = $this->addPage($label, 'pr.staff', 'staff', 'index', $other);
          $page->addAutofilterAction();
          $createPage = $page->addCreateAction();
          $showPage = $page->addShowAction();
  
          $pages[] = $showPage->addEditAction();
          $pages[] = $showPage->addAction($this->_('Reset password'), 'pr.staff.edit', 'reset')
                  ->setModelParameters(1)
                  ->addParameterFilter('gsf_active', 1);
          $pages[] = $showPage->addAction($this->_('Reset 2FA'), 'pr.staff.edit', 'reset2fa')
                  ->setModelParameters(1)
                  ->addParameterFilter('gsf_active', 1, 'has_2factor', 2);
          $showPage->addAction($this->_('Send Mail'), 'pr.staff.edit', 'mail')
                  ->setModelParameters(1)
                  ->addParameterFilter('can_mail', 1, 'gsf_active', 1, 'gsf_id_organization', $filter);
  
          $pages = $pages + $showPage->addDeReactivateAction('gsf_active', 1, 0);
  
          // LOG CONTROLLER
          $logPage = $showPage->addPage($this->_('Activity overview'), 'pr.staff-log', 'staff-log', 'index')
                  ->setModelParameters(1)
                  ->addParameterFilter('gsf_id_organization', $filter);
          $logPage->addAutofilterAction();
          $logPage->addShowAction()->setModelParameters(1)->addNamedParameters('log', 'gla_id');
  
          $page->addExportAction();
          $page->addImportAction();
  
          if (! $this->user->hasPrivilege('pr.staff.edit.all')) {
              foreach ($pages as $subPage) {
                  $subPage->addParameterFilter('gsf_id_organization', $filter, 'accessible_role', 1);
              }
          }
  
          return $page;
      }
code: public function addStaffPage($label, array $other = array())
      {
          if ($this->user->hasPrivilege('pr.staff.edit.all')) {
              $filter = array_keys($this->escort->getUtil()->getDbLookup()->getOrganizations());
          } else {
              $filter = array_keys($this->user->getAllowedOrganizations());
          }
  
          $page = $this->addPage($label, 'pr.staff', 'staff', 'index', $other);
          $page->addAutofilterAction();
          $createPage = $page->addCreateAction();
          $showPage = $page->addShowAction();
  
          $pages[] = $showPage->addEditAction();
          $pages[] = $showPage->addAction($this->_('Reset password'), 'pr.staff.edit', 'reset')
                  ->setModelParameters(1)
                  ->addParameterFilter('gsf_active', 1);
          $pages[] = $showPage->addAction($this->_('Reset 2FA'), 'pr.staff.edit', 'reset2fa')
                  ->setModelParameters(1)
                  ->addParameterFilter('gsf_active', 1, 'has_2factor', 2);
          $showPage->addAction($this->_('Send Mail'), 'pr.staff.edit', 'mail')
                  ->setModelParameters(1)
                  ->addParameterFilter('can_mail', 1, 'gsf_active', 1, 'gsf_id_organization', $filter);
  
          $pages = $pages + $showPage->addDeReactivateAction('gsf_active', 1, 0);
  
          // LOG CONTROLLER
          $logPage = $showPage->addPage($this->_('Activity overview'), 'pr.staff-log', 'staff-log', 'index')
                  ->setModelParameters(1)
                  ->addParameterFilter('gsf_id_organization', $filter);
          $logPage->addAutofilterAction();
          $logPage->addShowAction()->setModelParameters(1)->addNamedParameters('log', 'gla_id');
  
          $page->addExportAction();
          $page->addImportAction();
  
          if (! $this->user->hasPrivilege('pr.staff.edit.all')) {
              foreach ($pages as $subPage) {
                  $subPage->addParameterFilter('gsf_id_organization', $filter, 'accessible_role', 1);
              }
          }
  
          return $page;
      }
code_tokens: public function addStaffPage ( $ label , array $ other = array ( ) ) { if ( $ this -> user -> hasPrivilege ( 'pr.staff.edit.all' ) ) { $ filter = array_keys ( $ this -> escort -> getUtil ( ) -> getDbLookup ( ) -> getOrganizations ( ) ) ; } else { $ filter = array_keys ( $ this -> user -> getAllowedOrganizations ( ) ) ; } $ page = $ this -> addPage ( $ label , 'pr.staff' , 'staff' , 'index' , $ other ) ; $ page -> addAutofilterAction ( ) ; $ createPage = $ page -> addCreateAction ( ) ; $ showPage = $ page -> addShowAction ( ) ; $ pages [ ] = $ showPage -> addEditAction ( ) ; $ pages [ ] = $ showPage -> addAction ( $ this -> _ ( 'Reset password' ) , 'pr.staff.edit' , 'reset' ) -> setModelParameters ( 1 ) -> addParameterFilter ( 'gsf_active' , 1 ) ; $ pages [ ] = $ showPage -> addAction ( $ this -> _ ( 'Reset 2FA' ) , 'pr.staff.edit' , 'reset2fa' ) -> setModelParameters ( 1 ) -> addParameterFilter ( 'gsf_active' , 1 , 'has_2factor' , 2 ) ; $ showPage -> addAction ( $ this -> _ ( 'Send Mail' ) , 'pr.staff.edit' , 'mail' ) -> setModelParameters ( 1 ) -> addParameterFilter ( 'can_mail' , 1 , 'gsf_active' , 1 , 'gsf_id_organization' , $ filter ) ; $ pages = $ pages + $ showPage -> addDeReactivateAction ( 'gsf_active' , 1 , 0 ) ; // LOG CONTROLLER $ logPage = $ showPage -> addPage ( $ this -> _ ( 'Activity overview' ) , 'pr.staff-log' , 'staff-log' , 'index' ) -> setModelParameters ( 1 ) -> addParameterFilter ( 'gsf_id_organization' , $ filter ) ; $ logPage -> addAutofilterAction ( ) ; $ logPage -> addShowAction ( ) -> setModelParameters ( 1 ) -> addNamedParameters ( 'log' , 'gla_id' ) ; $ page -> addExportAction ( ) ; $ page -> addImportAction ( ) ; if ( ! $ this -> user -> hasPrivilege ( 'pr.staff.edit.all' ) ) { foreach ( $ pages as $ subPage ) { $ subPage -> addParameterFilter ( 'gsf_id_organization' , $ filter , 'accessible_role' , 1 ) ; } } return $ page ; }
docstring: Add a staff browse edit page to the menu,
  
  @param string $label
  @param array $other
  @return \Gems_Menu_SubMenuItem
docstring_tokens: Add a staff browse edit page to the menu