Пример #1
0
 public function listAction()
 {
     $request = $this->getRequest();
     $page = $this->_getParam('page', 1);
     $pageSize = $this->_getParam('pageSize', 10);
     $action = $this->view->url(array('controller' => $request->getControllerName(), 'action' => $request->getActionName()), null, true);
     $newButton = new Form_NewButton();
     $newButton->populate($request->getParams());
     $form = new Form_ReportFilter();
     $form->setAction($action);
     $form->populate($request->getParams());
     $reportFilter = $this->getReportFilterFromRequest($request);
     $reportFilter->orderBy = Kaltura_Client_Enum_ReportOrderBy::CREATED_AT_DESC;
     $newButton->getElement('newPartnerId')->setValue($reportFilter->partnerIdIn);
     // get results and paginate
     $client = Infra_ClientHelper::getClient();
     $adminConsolePlugin = Kaltura_Client_AdminConsole_Plugin::get($client);
     $paginatorAdapter = new Kaltura_FilterPaginatorWithPartnerLoader($adminConsolePlugin->reportAdmin, "listAction", null, $reportFilter);
     $paginator = new Infra_Paginator($paginatorAdapter, $request);
     $paginator->setCurrentPageNumber($page);
     $paginator->setItemCountPerPage($pageSize);
     // set view
     $this->view->form = $form;
     $this->view->newButton = $newButton;
     $this->view->paginator = $paginator;
 }
Пример #2
0
 public function doAction(Zend_Controller_Action $action)
 {
     $client = Infra_ClientHelper::getClient();
     $virusScanPlugin = Kaltura_Client_VirusScan_Plugin::get($client);
     //create new form
     $newForm = new Form_NewVirusScanProfile();
     $page = $this->_getParam('page', 1);
     $pageSize = $this->_getParam('pageSize', 10);
     //get PartnerId
     $partnerId = $this->_getParam('partnerId');
     //filter form
     $request = $action->getRequest();
     $virusScanFilterForm = new Form_VirusScanFilter();
     $virusScanFilterFormAction = $action->view->url(array('controller' => $request->getParam('controller'), 'action' => $request->getParam('action')), null, true);
     $virusScanFilterForm->setAction($virusScanFilterFormAction);
     $virusScanFilterForm->populate($request->getParams());
     $virusScanFilter = $this->getVirusScanFilterFromRequest($request);
     $newForm->getElement("newPartnerId")->setValue($virusScanFilter->partnerIdEqual);
     //filter also by partnerId
     if (!is_null($partnerId)) {
         $virusScanFilter->partnerIdEqual = $partnerId;
     }
     $paginatorAdapter = new Infra_FilterPaginator($virusScanPlugin->virusScanProfile, "listAction", null, $virusScanFilter);
     $paginator = new Infra_Paginator($paginatorAdapter);
     $paginator->setCurrentPageNumber($page);
     $paginator->setItemCountPerPage($pageSize);
     $action->view->virusScanFilterForm = $virusScanFilterForm;
     $action->view->newForm = $newForm;
     $action->view->paginator = $paginator;
 }
Пример #3
0
 public function doAction(Zend_Controller_Action $action)
 {
     $request = $action->getRequest();
     $page = $this->_getParam('page', 1);
     $pageSize = $this->_getParam('pageSize', 10);
     $partnerId = $this->_getParam('partnerId');
     // init filter
     $drmProfileFilter = $this->getDrmProfileFilterFromRequest($request);
     $drmProfileFilter->orderBy = "-createdAt";
     $client = Infra_ClientHelper::getClient();
     $drmPluginClient = Kaltura_Client_Drm_Plugin::get($client);
     // get results and paginate
     $paginatorAdapter = new Infra_FilterPaginator($drmPluginClient->drmProfile, "listAction", null, $drmProfileFilter);
     $paginator = new Infra_Paginator($paginatorAdapter, $request);
     $paginator->setCurrentPageNumber($page);
     $paginator->setItemCountPerPage($pageSize);
     // set view
     $drmProfileFilterForm = new Form_DrmProfileFilter();
     $drmProfileFilterForm->populate($request->getParams());
     $drmProfileFilterFormAction = $action->view->url(array('controller' => $request->getParam('controller'), 'action' => $request->getParam('action')), null, true);
     $drmProfileFilterForm->setAction($drmProfileFilterFormAction);
     $action->view->filterForm = $drmProfileFilterForm;
     $action->view->paginator = $paginator;
     $createProfileForm = new Form_CreateDrmProfile();
     $actionUrl = $action->view->url(array('controller' => 'plugin', 'action' => 'DrmProfileConfigure'), null, true);
     $createProfileForm->setAction($actionUrl);
     if ($drmProfileFilter && isset($drmProfileFilter->partnerIdEqual)) {
         $createProfileForm->getElement("newPartnerId")->setValue($drmProfileFilter->partnerIdEqual);
     }
     $action->view->newProfileForm = $createProfileForm;
 }
Пример #4
0
 public function deliveryProfilesConfigurationAction()
 {
     $request = $this->getRequest();
     $page = $this->_getParam('page', 1);
     $pageSize = $this->_getParam('pageSize', 10);
     $client = Infra_ClientHelper::getClient();
     $form = new Form_PartnerIdFilter();
     $form->populate($request->getParams());
     $newForm = new Form_NewDeliveryProfile();
     $newForm->populate($request->getParams());
     $action = $this->view->url(array('controller' => 'delivery', 'action' => 'delivery-profiles-configuration'), null, true);
     $form->setAction($action);
     $partnerId = null;
     if ($request->getParam('filter_input') != '') {
         $partnerId = $request->getParam('filter_input');
         $newForm->getElement('newPartnerId')->setValue($partnerId);
     }
     $filter = new Kaltura_Client_Type_DeliveryProfileFilter();
     $filter->partnerIdEqual = $partnerId;
     // get results and paginate
     $paginatorAdapter = new Infra_FilterPaginator($client->deliveryProfile, "listAction", $partnerId, $filter);
     $paginator = new Infra_Paginator($paginatorAdapter, $request);
     $paginator->setCurrentPageNumber($page);
     $paginator->setItemCountPerPage($pageSize);
     // popule the form
     $form->populate($request->getParams());
     // set view
     $this->view->form = $form;
     $this->view->newForm = $newForm;
     $this->view->paginator = $paginator;
 }
Пример #5
0
 public function indexAction()
 {
     $request = $this->getRequest();
     $page = $this->_getParam('page', 1);
     $pageSize = $this->_getParam('pageSize', 10);
     $client = Infra_ClientHelper::getClient();
     // reset form url
     $action = $this->view->url(array('controller' => $request->getParam('controller'), 'action' => $request->getParam('action')), null, true);
     $form = new Form_UserFilter();
     $form->setAction($action);
     $userRoles = $client->userRole->listAction();
     $config = Zend_Registry::get('config');
     // init filter
     $userFilter = $this->getUserFilterFromRequest($request);
     $userFilter->partnerIdEqual = $config->settings->partnerId;
     $userFilter->orderBy = Kaltura_Client_Enum_UserOrderBy::CREATED_AT_DESC;
     $paginatorAdapter = new Infra_FilterPaginator($client->user, "listAction", null, $userFilter);
     $paginator = new Infra_Paginator($paginatorAdapter);
     $paginator->setCurrentPageNumber($page);
     $paginator->setItemCountPerPage($pageSize);
     $this->view->myEmail = Infra_AuthHelper::getAuthInstance()->getIdentity()->getUser()->email;
     $this->view->paginator = $paginator;
     // populate the form
     $form->populate($request->getParams());
     // set view
     $this->view->form = $form;
 }
 public function doAction(Zend_Controller_Action $action)
 {
     $request = $action->getRequest();
     $page = $this->_getParam('page', 1);
     $pageSize = $this->_getParam('pageSize', 10);
     $form = new Form_PartnerIdFilter();
     $form->populate($request->getParams());
     $newForm = new Form_NewEventNotificationTemplate();
     $actionUrl = $action->view->url(array('controller' => 'plugin', 'action' => 'EventNotificationTemplatesListAction'), null, true);
     $form->setAction($actionUrl);
     // init filter
     $partnerFilter = $this->getPartnerFilterFromRequest($request);
     $client = Infra_ClientHelper::getClient();
     $eventNotificationPlugin = Kaltura_Client_EventNotification_Plugin::get($client);
     // get results and paginate
     $paginatorAdapter = new Infra_FilterPaginator($eventNotificationPlugin->eventNotificationTemplate, "listByPartner", null, $partnerFilter);
     $paginator = new Infra_Paginator($paginatorAdapter, $request);
     $paginator->setCurrentPageNumber($page);
     $paginator->setItemCountPerPage($pageSize);
     if ($partnerFilter) {
         $newForm->getElement('newPartnerId')->setValue($partnerFilter->idIn);
     }
     // set view
     $action->view->form = $form;
     $action->view->newForm = $newForm;
     $action->view->paginator = $paginator;
 }
 public function doAction(Zend_Controller_Action $action)
 {
     $request = $action->getRequest();
     $page = $this->_getParam('page', 1);
     $pageSize = $this->_getParam('pageSize', 10);
     $form = new Form_PartnerIdFilter();
     $form->populate($request->getParams());
     $newForm = new Form_NewDistributionProfile();
     $actionUrl = $action->view->url(array('controller' => 'plugin', 'action' => 'DistributionProfileListAction'), null, true);
     $form->setAction($actionUrl);
     // init filter
     $partnerFilter = $this->getPartnerFilterFromRequest($request);
     $client = Infra_ClientHelper::getClient();
     $contentDistributionPlugin = Kaltura_Client_ContentDistribution_Plugin::get($client);
     // get results and paginate
     $paginatorAdapter = new Infra_FilterPaginator($contentDistributionPlugin->distributionProfile, "listByPartner", null, $partnerFilter);
     $paginator = new Infra_Paginator($paginatorAdapter, $request);
     $paginator->setCurrentPageNumber($page);
     $paginator->setItemCountPerPage($pageSize);
     $providers = array(Kaltura_Client_ContentDistribution_Enum_DistributionProviderType::GENERIC => 'Generic', Kaltura_Client_ContentDistribution_Enum_DistributionProviderType::SYNDICATION => 'Syndication');
     $genericProviders = array();
     $client = Infra_ClientHelper::getClient();
     $contentDistributionClientPlugin = Kaltura_Client_ContentDistribution_Plugin::get($client);
     $providersList = $contentDistributionClientPlugin->distributionProvider->listAction();
     if ($providersList) {
         foreach ($providersList->objects as $provider) {
             if ($provider->type == Kaltura_Client_ContentDistribution_Enum_DistributionProviderType::GENERIC) {
                 $genericProviders[$provider->id] = $provider->name;
             } else {
                 $providers[$provider->type] = $provider->name;
             }
         }
     }
     $newForm->setProviders($providers);
     $newPartnerElement = $newForm->getElement('newPartnerId');
     if ($newPartnerElement) {
         $newPartnerElement->setValue($partnerFilter->idIn);
     }
     // set view
     $action->view->form = $form;
     $action->view->newForm = $newForm;
     $action->view->paginator = $paginator;
     $action->view->providers = $providers;
     $action->view->genericProviders = $genericProviders;
 }
 public function doAction(Zend_Controller_Action $action)
 {
     $request = $action->getRequest();
     $page = $this->_getParam('page', 1);
     $pageSize = $this->_getParam('pageSize', 10);
     $newForm = new Form_NewGenericProvider();
     // init filter
     $genericProviderFilter = new Kaltura_Client_ContentDistribution_Type_GenericDistributionProviderFilter();
     $client = Infra_ClientHelper::getClient();
     $contentDistributionPlugin = Kaltura_Client_ContentDistribution_Plugin::get($client);
     // get results and paginate
     $paginatorAdapter = new Infra_FilterPaginator($contentDistributionPlugin->genericDistributionProvider, "listAction", null, $genericProviderFilter);
     $paginator = new Infra_Paginator($paginatorAdapter, $request);
     $paginator->setCurrentPageNumber($page);
     $paginator->setItemCountPerPage($pageSize);
     // set view
     $action->view->newForm = $newForm;
     $action->view->paginator = $paginator;
 }
Пример #9
0
 public function indexAction()
 {
     $request = $this->getRequest();
     $page = $this->_getParam('page', 1);
     $pageSize = $this->_getParam('pageSize', 10);
     $from = new Zend_Date($this->_getParam('from_date', $this->getDefaultFromDate()));
     $to = new Zend_Date($this->_getParam('to_date', $this->getDefaultToDate()));
     $client = Infra_ClientHelper::getClient();
     $systemPartnerPlugin = Kaltura_Client_SystemPartner_Plugin::get($client);
     $form = new Form_PartnerUsageFilter();
     $partnerPackages = $systemPartnerPlugin->systemPartner->getPackages();
     Form_PackageHelper::addPackagesToForm($form, $partnerPackages, 'partner_package');
     $this->view->partnerPackages = array();
     foreach ($partnerPackages as $package) {
         $this->view->partnerPackages[$package->id] = $package->name;
     }
     $form->populate($request->getParams());
     // when no statuses selected
     if (!$form->getElement('include_active')->getValue() && !$form->getElement('include_blocked')->getValue() && !$form->getElement('include_removed')->getValue()) {
         $form->getElement('include_active')->setValue(1);
         $form->getElement('include_blocked')->setValue(1);
         $form->getElement('include_removed')->setValue(1);
     }
     // init filters
     $partnerFilter = $this->getPartnerFilterFromForm($form);
     $usageFilter = new Kaltura_Client_SystemPartner_Type_SystemPartnerUsageFilter();
     $usageFilter->fromDate = $from->toString(Zend_Date::TIMESTAMP);
     $usageFilter->toDate = $to->toString(Zend_Date::TIMESTAMP);
     $usageFilter->timezoneOffset = Infra_AuthHelper::getAuthInstance()->getIdentity()->getTimezoneOffset();
     // get results and paginate
     $paginatorAdapter = new Infra_FilterPaginator($systemPartnerPlugin->systemPartner, "getUsage", null, $partnerFilter, $usageFilter);
     $paginator = new Infra_Paginator($paginatorAdapter, $request);
     $paginator->setCurrentPageNumber($page);
     $paginator->setItemCountPerPage($pageSize);
     Form_PackageHelper::addPackagesToForm($form, $systemPartnerPlugin->systemPartner->getPackages(), 'partner_package', true, 'All Service Editions');
     // set view
     $this->view->from = $from;
     $this->view->to = $to;
     $this->view->form = $form;
     $this->view->paginator = $paginator;
 }
Пример #10
0
 public function userRoleAction()
 {
     $client = Infra_ClientHelper::getClient();
     $page = $this->_getParam('page', 1);
     $pageSize = $this->_getParam('pageSize', 10);
     $config = Zend_Registry::get('config');
     $filter = new Kaltura_Client_Type_UserRoleFilter();
     $filter->partnerIdEqual = $config->settings->partnerId;
     $filter->orderBy = Kaltura_Client_Enum_UserOrderBy::CREATED_AT_DESC;
     $paginatorAdapter = new Infra_FilterPaginator($client->userRole, "listAction", null, $filter);
     $paginator = new Infra_Paginator($paginatorAdapter);
     $paginator->setCurrentPageNumber($page);
     $paginator->setItemCountPerPage($pageSize);
     $this->view->myEmail = Infra_AuthHelper::getAuthInstance()->getIdentity()->getUser()->email;
     $this->view->paginator = $paginator;
 }
Пример #11
0
 public function kmcUsersAction()
 {
     $this->_helper->layout->disableLayout();
     $partnerId = $this->_getParam('partner_id');
     if (!$partnerId) {
         //TODO: error
     }
     $page = $this->_getParam('page', 1);
     $pageSize = $this->_getParam('pageSize', 10);
     $filter = new Kaltura_Client_Type_UserFilter();
     $filter->isAdminEqual = true;
     $filter->partnerIdEqual = $partnerId;
     $filter->statusEqual = Kaltura_Client_Enum_UserStatus::ACTIVE;
     $client = Infra_ClientHelper::getClient();
     $paginatorAdapter = new Infra_FilterPaginator($client->user, "listAction", $partnerId, $filter);
     $paginator = new Infra_Paginator($paginatorAdapter);
     $paginator->setCurrentPageNumber($page);
     $paginator->setItemCountPerPage($pageSize);
     $paginator->setIndex(2);
     $this->view->partnerId = $partnerId;
     $this->view->paginator = $paginator;
 }