diff --git a/VERSION.txt b/VERSION.txt index 5955dc01d7b..2c3b046077e 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -Tucana-20.18.0 +Tucana-20.20.0 diff --git a/admin_console/configs/lang/en.php b/admin_console/configs/lang/en.php index baa1074156e..8177df33464 100644 --- a/admin_console/configs/lang/en.php +++ b/admin_console/configs/lang/en.php @@ -393,6 +393,7 @@ 'Kaltura_Client_Enum_UiConfObjType::WEBCASTING' => 'Kaltura Webcasting Studio', 'Kaltura_Client_Enum_UiConfObjType::CLIPPER' => 'KMC Clipper', 'Kaltura_Client_Enum_UiConfObjType::SAP' => 'Slim Audio Player', + 'Kaltura_Client_Enum_UiConfObjType::REELS' => 'Reels Player', //audit trail 'Kaltura_Client_Enum_AuditTrailObjectType::ACCESS_CONTROL' => 'ACCESS_CONTROL', diff --git a/alpha/apps/kaltura/lib/KSecureEntryHelper.class.php b/alpha/apps/kaltura/lib/KSecureEntryHelper.class.php index a62fdae54ca..a132ef56f76 100644 --- a/alpha/apps/kaltura/lib/KSecureEntryHelper.class.php +++ b/alpha/apps/kaltura/lib/KSecureEntryHelper.class.php @@ -159,7 +159,7 @@ public function validateApiAccessControl() public function validateForPlay($performApiAccessCheck = true) { if ($this->entry->getDisplayInSearch() === EntryDisplayInSearchType::RECYCLED && - !($this->entry->isOwnerActionsAllowed(kCurrentContext::getCurrentKsKuserId()) || $this->isKsAdmin())) + !($this->entry->isOwnerActionsAllowed($this->ks->getKuserId()) || $this->isKsAdmin())) { KExternalErrors::dieError(KExternalErrors::RECYCLED_ENTRY_UNAVAILABLE); } diff --git a/alpha/apps/kaltura/lib/clipconcat/kClipManager.php b/alpha/apps/kaltura/lib/clipconcat/kClipManager.php index 3e535a8ca2f..bec36f080bc 100644 --- a/alpha/apps/kaltura/lib/clipconcat/kClipManager.php +++ b/alpha/apps/kaltura/lib/clipconcat/kClipManager.php @@ -898,7 +898,14 @@ protected function setConversionParamsOnResourcesData(&$resourcesData, $conversi { $imageToVideo = $resourceData[self::IMAGE_TO_VIDEO]; $mediaInfoObj = $resourceData[self::MEDIA_INFO_OBJECT]; - $subtitles = isset($resourceData[self::SUBTITLES_DATA_ARRAY]) && count($resourceData[self::SUBTITLES_DATA_ARRAY]) > 0; + $subtitles = false; + if(isset($resourceData[self::SUBTITLES_DATA_ARRAY])) + { + foreach ($resourceData[self::SUBTITLES_DATA_ARRAY] as $subtitlesArray) + { + $subtitles = $subtitles || count($subtitlesArray) > 0; + } + } $currentConversionParams = array(); $currentConversionParams[self::TARGET_HEIGHT] = $targetHeight; @@ -968,7 +975,7 @@ protected function setConversionParamsOnResourcesData(&$resourcesData, $conversi if($subtitles) { $prevParams = isset($currentConversionParams[self::EXTRA_CONVERSION_PARAMS]) ? $currentConversionParams[self::EXTRA_CONVERSION_PARAMS] : ""; - $currentConversionParams[self::EXTRA_CONVERSION_PARAMS] = $prevParams . " -copyts"; + $currentConversionParams[self::EXTRA_CONVERSION_PARAMS] = "$prevParams -copyts "; } $resourcesData[$key][self::CONVERSION_PARAMS] = json_encode($currentConversionParams, true); diff --git a/alpha/apps/kaltura/lib/db/DbManager.php b/alpha/apps/kaltura/lib/db/DbManager.php index 0de0f956ec9..b0a7cc241ed 100644 --- a/alpha/apps/kaltura/lib/db/DbManager.php +++ b/alpha/apps/kaltura/lib/db/DbManager.php @@ -233,6 +233,12 @@ protected static function getSphinxConnIndexByLastUpdatedAt($dataSources) } list($hostToLag, $hostToIndex) = self::filterLagsAndHosts($dataSources, $lastUpdatedAtPerSphinx); + if(!count($hostToLag)) + { + KalturaLog::debug("failed to map sphinx host to sphinx lag data, no sphinx index will be chosen by updatedAt"); + return false; + } + return self::getPreferredSphinxIndexByWeight($hostToLag, $hostToIndex); } diff --git a/alpha/apps/kaltura/lib/kPermissionManager.php b/alpha/apps/kaltura/lib/kPermissionManager.php index a7cbc058ecc..4ac47f5aaf6 100644 --- a/alpha/apps/kaltura/lib/kPermissionManager.php +++ b/alpha/apps/kaltura/lib/kPermissionManager.php @@ -1093,20 +1093,32 @@ public function objectCreated(BaseObject $object) return true; } - protected static function handlePermissions($object) + protected static function handlePermissions($permission) { - switch ($object->getName()) + switch ($permission->getName()) { case PermissionName::FEATURE_RECYCLE_BIN: - self::handleRecycleBinPermission($object); + self::handleRecycleBinPermission($permission); return; case PermissionName::GAME_PLUGIN_PERMISSION: - self::handleGamePluginPermission($object); + self::handleGamePluginPermission($permission); + return; + + case PermissionName::FEATURE_MEDIA_REPURPOSING_NG_PERMISSION: + self::handleMediaRepurposingNGPermission($permission); return; } } + protected static function handleMediaRepurposingNGPermission($permission) + { + if ($permission->getStatus() == PermissionStatus::ACTIVE) + { + MediaRepurposingHandler::enableMrPermission($permission->getPartnerId()); + } + } + protected static function handleGamePluginPermission($permission) { $partner = PartnerPeer::retrieveByPK($permission->getPartnerId()); @@ -1120,12 +1132,23 @@ protected static function handleRecycleBinPermission($permission) if ($permission->getStatus() == PermissionStatus::ACTIVE) { self::enableRecycleBinScheduledTaskProfile($permission->getPartnerId()); + self::enableRequiredPluginsPermissions($permission->getPartnerId(), PermissionName::SCHEDULEDTASK_PLUGIN_PERMISSION); } elseif ($permission->getStatus() == PermissionStatus::BLOCKED) { self::disableRecycleBinScheduledTaskProfile($permission->getPartnerId()); } } + + protected static function enableRequiredPluginsPermissions($partnerId, $permissionName) + { + $requiredPluginPermission = PermissionPeer::getByNameAndPartner($permissionName, array($partnerId)); + if ($requiredPluginPermission->getStatus() != PermissionStatus::ACTIVE) + { + $requiredPluginPermission->setStatus(PermissionStatus::ACTIVE); + $requiredPluginPermission->save(); + } + } protected static function enableRecycleBinScheduledTaskProfile($partnerId) { diff --git a/alpha/apps/kaltura/lib/microservice/MicroServiceBaseService.php b/alpha/apps/kaltura/lib/microservice/MicroServiceBaseService.php index 6e8777f4d4a..2add7ca6481 100644 --- a/alpha/apps/kaltura/lib/microservice/MicroServiceBaseService.php +++ b/alpha/apps/kaltura/lib/microservice/MicroServiceBaseService.php @@ -47,7 +47,7 @@ private function generateSession($partnerId) * @return string * @throws Exception */ - public static function buildServiceUrl($hostName, $serviceName) + public static function buildServiceUrl($hostName, $serviceName, $isApi = true) { $serviceUrl = kConf::get("microservice_url", 'local', null); if(!$serviceUrl) @@ -61,6 +61,10 @@ public static function buildServiceUrl($hostName, $serviceName) { $serviceUrl = $serviceUrl . '/' . trim($serviceName, "\/"); } + if(!$isApi) + { + return str_replace('/api', '', $serviceUrl); + } return $serviceUrl; } diff --git a/alpha/apps/kaltura/lib/microservice/MicroServiceUnisphereLoader.php b/alpha/apps/kaltura/lib/microservice/MicroServiceUnisphereLoader.php new file mode 100644 index 00000000000..8459e212621 --- /dev/null +++ b/alpha/apps/kaltura/lib/microservice/MicroServiceUnisphereLoader.php @@ -0,0 +1,15 @@ +hostName = self::$host; + parent::__construct(); + } +} diff --git a/alpha/apps/kaltura/lib/myEntryUtils.class.php b/alpha/apps/kaltura/lib/myEntryUtils.class.php index b6d7f541360..e412d0bff93 100644 --- a/alpha/apps/kaltura/lib/myEntryUtils.class.php +++ b/alpha/apps/kaltura/lib/myEntryUtils.class.php @@ -1015,7 +1015,7 @@ public static function resizeEntryImage( entry $entry, $version, $width, $height if (!$success) { - $success = self::captureLocalThumb($entry, $capturedThumbPath, $calc_vid_sec, $cache, $cacheLockKey, $cacheLockKeyProcessing, $flavorAssetId, $fileToDelete); + $success = self::captureLocalThumb($entry, $capturedThumbPath, $calc_vid_sec, $cache, $cacheLockKey, $cacheLockKeyProcessing, $flavorAssetId, -1, -1, $fileToDelete); } } diff --git a/alpha/apps/kaltura/lib/reports/kKavaEventPlatformReports.php b/alpha/apps/kaltura/lib/reports/kKavaEventPlatformReports.php index 67d33f1a487..3d8ae62297e 100644 --- a/alpha/apps/kaltura/lib/reports/kKavaEventPlatformReports.php +++ b/alpha/apps/kaltura/lib/reports/kKavaEventPlatformReports.php @@ -319,6 +319,29 @@ class kKavaEventPlatformReports extends kKavaReportsMgr self::METRIC_UNIQUE_VOD_VIEW_PERIOD_USERS, self::METRIC_VOD_UNIQUE_PERCENTILES_RATIO ) + ), + + ReportType::EP_WEBCAST_ENGAGEMENT_OVER_TIME => array( + self::REPORT_DIMENSION_MAP => array( + 'position' => self::DIMENSION_POSITION + ), + self::REPORT_FILTER => array( + self::DRUID_TYPE => self::DRUID_NOT, + self::DRUID_FILTER => array( + self::DRUID_DIMENSION => self::DIMENSION_POSITION, + self::DRUID_VALUES => array(self::VALUE_UNKNOWN, "0", "") + ) + ), + self::REPORT_JOIN_REPORTS => array( + array( + self::REPORT_UNION_DATA_SOURCES => array(self::DATASOURCE_HISTORICAL, self::DATASOURCE_MEETING_HISTORICAL), + self::REPORT_METRICS => array(self::METRIC_UNIQUE_COMBINED_LIVE_VIEW_PERIOD_USERS, self::METRIC_COMBINED_LIVE_ENGAGED_USERS_RATIO) + ), + array( + self::REPORT_DATA_SOURCE => self::DATASOURCE_CNC_EVENTS, + self::REPORT_METRICS => array(self::EVENT_TYPE_MESSAGE_LIKED, self::EVENT_TYPE_REACTION_CLICKED, self::EVENT_TYPE_GROUP_MESSAGE_SENT) + ) + ) ) ); diff --git a/alpha/apps/kaltura/lib/reports/kKavaReportsMgr.class.php b/alpha/apps/kaltura/lib/reports/kKavaReportsMgr.class.php index 9b47e7b3e1c..572f517771e 100644 --- a/alpha/apps/kaltura/lib/reports/kKavaReportsMgr.class.php +++ b/alpha/apps/kaltura/lib/reports/kKavaReportsMgr.class.php @@ -2833,6 +2833,12 @@ protected static function getEntryKuserDimension($data_source) return in_array($data_source, array(self::DATASOURCE_ENTRY_LIFECYCLE, self::DATASOURCE_STORAGE_USAGE)) ? self::DIMENSION_KUSER_ID : self::DIMENSION_ENTRY_OWNER_ID; } + protected static function getEntryIdDimension($data_source) + { + return $data_source === self::DATASOURCE_CNC_EVENTS ? self::DIMENSION_CONTEXT_ID : self::DIMENSION_ENTRY_ID; + } + + protected static function getDruidFilter($partner_id, $report_def, $input_filter, $object_ids, $response_options) { $druid_filter = array(); @@ -2888,6 +2894,7 @@ protected static function getDruidFilter($partner_id, $report_def, $input_filter ); } + $entry_id_dimension = self::getEntryIdDimension($data_source); $field_dim_map = array( 'categoriesIds' => array(self::DRUID_DIMENSION => self::DIMENSION_CATEGORIES), 'countries' => array(self::DRUID_DIMENSION => self::DIMENSION_LOCATION_COUNTRY), @@ -2906,8 +2913,8 @@ protected static function getDruidFilter($partner_id, $report_def, $input_filter 'cities' => array(self::DRUID_DIMENSION => self::DIMENSION_LOCATION_CITY), 'media_types' => array(self::DRUID_DIMENSION => self::DIMENSION_MEDIA_TYPE), 'source_types' => array(self::DRUID_DIMENSION => self::DIMENSION_SOURCE_TYPE), - 'entries_ids' => array(self::DRUID_DIMENSION => self::DIMENSION_ENTRY_ID), - 'entries_ids_not_in' => array(self::DRUID_DIMENSION => self::DIMENSION_ENTRY_ID, self::DRUID_TYPE => self::DRUID_NOT), + 'entries_ids' => array(self::DRUID_DIMENSION => $entry_id_dimension), + 'entries_ids_not_in' => array(self::DRUID_DIMENSION => $entry_id_dimension, self::DRUID_TYPE => self::DRUID_NOT), 'playback_context_ids' => array(self::DRUID_DIMENSION => self::DIMENSION_PLAYBACK_CONTEXT), 'root_entries_ids' => array(self::DRUID_DIMENSION => self::DIMENSION_ROOT_ENTRY_ID), 'event_var1' => array(self::DRUID_DIMENSION => self::DIMENSION_EVENT_VAR1), @@ -3066,7 +3073,7 @@ protected static function getDruidFilter($partner_id, $report_def, $input_filter if (count($entry_ids_from_db)) { $druid_filter[] = array( - self::DRUID_DIMENSION => self::DIMENSION_ENTRY_ID, + self::DRUID_DIMENSION => $entry_id_dimension, self::DRUID_VALUES => array_values(array_unique($entry_ids_from_db)) ); } diff --git a/alpha/apps/kaltura/lib/v2RedirectUtils.class.php b/alpha/apps/kaltura/lib/v2RedirectUtils.class.php new file mode 100644 index 00000000000..83336c443ae --- /dev/null +++ b/alpha/apps/kaltura/lib/v2RedirectUtils.class.php @@ -0,0 +1,106 @@ + ["playkitscreen", "playkit-js-info"], + "quiz" => ["playkit-ivq", "ivq"], + "moderation" => ["playkit-moderation", "playkit-js-moderation"], + "playlistAPI" => ["playkit-playlist", "playlist"], + "liveStatus" => ["playkit-kaltura-live","kaltura-live"], + "related" => ["playkit-related", "related"], + "dualScreen" => ["playkit-dual-screen", "dualscreen"], + "video360" => ["playkit-vr" ,"vr"], + "raptMedia" => ["rapt", "rapt"], + "transcript" => ["playkit-transcript", "playkit-js-transcript"], + "qna" => ["playkit-qna", "qna"], + "bumper" => [ "playkit-bumper" , "bumper" ], + "infoScreen" => ["playkit-info", "playkit-js-info"]]; + + if(isset($translation[$v2PluginName])) + { + $v7PluginInfo = $translation[$v2PluginName]; + KalturaLog::log("Found " . print_r($v7PluginInfo, true)); + return $v7PluginInfo; + } + else + { + throw new Exception ($v2PluginName); + } + } + + static function addV2toV7plugins($flashvars, &$bundleConfig, &$playerConfig) + { + if(!$flashvars) + { + return; + } + $unHandledPlugins = array(); + + //Merge v7 config + foreach ($flashvars as $key => $value) + { + if(self::isVarPlugin($key)) + { + //get plugin name + KalturaLog::log("V2 to V7 adding plugin: " . $key. " value:" . $value); + if ($value) + { + if (!$bundleConfig) + { + $bundleConfig = []; + } + $key = trim(trim($key, '"'), "'"); + $v2PluginName = explode(".", $key); + try + { + $v7PluginName = self::getV7PluginInfo($v2PluginName[0]); + $bundleConfig = array_merge($bundleConfig, [$v7PluginName[0] => "{latest}"]); + $v7PluginConfig = $v7PluginName[1]; + if (!isset($playerConfig->plugins)) + { + $playerConfig->plugins = new stdClass(); + } + if (!isset($playerConfig->plugins->$v7PluginConfig)) + { + $playerConfig->plugins->$v7PluginConfig = new stdClass(); + } + } + catch (Exception $e){ + $unHandledPlugins[] = $e->getMessage(); + } + } + } + } + if(sizeof($unHandledPlugins)) + { + throw new Exception ("Unhandled plugins: " . implode(", ", $unHandledPlugins)); + } + } + + static function addV2toV7config($flashvars, $uiconfId) + { + $config = []; + if($flashvars) + { foreach ($flashvars as $key => $value) + { + $key = trim(trim($key, '"'), "'"); + $config[$key] = json_decode($value); + } + } + $config["uiconf_id"] = $uiconfId; + return $config; + } + + private static function isVarPlugin($varKeyName) + { + return str_contains($varKeyName, ".plugin"); + } +} diff --git a/alpha/apps/kaltura/modules/extwidget/actions/embedIframeJsAction.class.php b/alpha/apps/kaltura/modules/extwidget/actions/embedIframeJsAction.class.php index 454531a8d5b..101ae10d3bf 100644 --- a/alpha/apps/kaltura/modules/extwidget/actions/embedIframeJsAction.class.php +++ b/alpha/apps/kaltura/modules/extwidget/actions/embedIframeJsAction.class.php @@ -47,7 +47,6 @@ public function execute() $ui_conf_html5_url = $uiConf->getHtml5Url(); - if (array_key_exists($partner_id, $optimizedPlayback)) { // force a specific kdp for the partner @@ -61,6 +60,17 @@ public function execute() $autoEmbed = $this->getRequestParameter('autoembed'); $iframeEmbed = $this->getRequestParameter('iframeembed'); + + //redirect the call to V7 + if( $uiConf->getV2Redirect() && + $uiConf->getV2Redirect()->getV7id() && + ( $uiConf->getV2Redirect()->getIsApproved() || $this->getRequestParameter(v2RedirectUtils::V2REDIRECT_PARAM_NAME) ) + ) + { + $this->redirectToV7($uiConf->getV2Redirect()->getV7id(), $uiconf_id, $partner_id, $uiConf->getV2Redirect()->getTranslatePlugins() ); + } + + $scriptName = ($iframeEmbed) ? 'mwEmbedFrame.php' : 'mwEmbedLoader.php'; if($ui_conf_html5_url && $iframeEmbed) { $ui_conf_html5_url = str_replace('mwEmbedLoader.php', 'mwEmbedFrame.php', $ui_conf_html5_url); @@ -143,4 +153,38 @@ public function execute() header("Location:$url"); KExternalErrors::dieGracefully(); } + + private function redirectToV7($v7Id, $v2UiConfId, $partnerId, $shouldTranslatePlugins) : void + { + //validate all the params are handled + try + { + $config = array(); + $config['bundleConfig'] = null; + $config['playerConfig'] = new stdClass(); + v2RedirectUtils::addV2toV7config($this->getRequestParameter(v2RedirectUtils::FLASHVARS_PARAM_NAME),$v7Id); + if($shouldTranslatePlugins) + { + v2RedirectUtils::addV2toV7plugins( + $this->getRequestParameter(v2RedirectUtils::FLASHVARS_PARAM_NAME), + $config['bundleConfig'], + $config['playerConfig']); + } + } + catch(Exception $e) + { + //if we failed, then should not redirect! + KalturaLog::log('V2toV7 was rejected because: ' . $e->getMessage() . ' v2 id:' . $v2UiConfId. ' v7 id:' . $v2UiConfId); + return; + } + + $shouldTranslatePluginsQueryParam = $shouldTranslatePlugins ? '&' . v2RedirectUtils::SHOULD_TRANSLATE_PLUGINS . '=true' : '' ; + $host = myPartnerUtils::getCdnHost($partnerId, null , 'api'); + $url = $host . '/p/' . $partnerId . '/embedPlaykitJs/uiconf_id/' . $v7Id . '?' + . $_SERVER['QUERY_STRING'] . "&" + . v2RedirectUtils::V2REDIRECT_PARAM_NAME .'=true' + . $shouldTranslatePluginsQueryParam; + header("Location:$url"); + KExternalErrors::dieGracefully(); + } } diff --git a/alpha/apps/kaltura/modules/extwidget/actions/embedPlaykitJsAction.class.php b/alpha/apps/kaltura/modules/extwidget/actions/embedPlaykitJsAction.class.php index e7a2880c809..596648e414d 100644 --- a/alpha/apps/kaltura/modules/extwidget/actions/embedPlaykitJsAction.class.php +++ b/alpha/apps/kaltura/modules/extwidget/actions/embedPlaykitJsAction.class.php @@ -1,5 +1,4 @@ uiConfId = $this->uiconfId; $ks = $this->getRequestParameter(self::KS_PARAM_NAME); - if ($ks) { $config["provider"]->ks = $ks; } $config["targetId"] = $targetId; - $config = json_encode($config); if ($config === false) { KExternalErrors::dieError(KExternalErrors::INVALID_PARAMETER, "Invalid config object"); } + $v2tov7ConfigJs=''; + if($this->getRequestParameter(v2RedirectUtils::V2REDIRECT_PARAM_NAME)) + { + $v2ToV7config = v2RedirectUtils::addV2toV7config($this->getRequestParameter(v2RedirectUtils::FLASHVARS_PARAM_NAME), $this->uiconfId); + $v2tov7ConfigJs = 'config = window.__buildV7Config('.JSON_encode($v2ToV7config).',config)'; + + } + $autoEmbedCode = " try { - var kalturaPlayer = KalturaPlayer.setup($config); + var config=$config; + $v2tov7ConfigJs + var kalturaPlayer = KalturaPlayer.setup(config); $loadContentMethod } catch (e) { console.error(e.message); @@ -543,7 +550,7 @@ private function getIfarmEmbedCode($bundleContent)
- + '; @@ -813,6 +820,21 @@ private function initMembers() } $this->mergeVersionsParamIntoConfig(); + + if($this->getRequestParameter(v2RedirectUtils::V2REDIRECT_PARAM_NAME)) + { + $this->bundleConfig[v2RedirectUtils::SCRIPT_PLUGIN_NAME] = + kConf::getArrayValue('v2RedirectPluginVersion', + 'playkit-js', 'local', v2RedirectUtils::SCRIPT_PLUGIN_VERSION); + if($this->getRequestParameter(v2RedirectUtils::SHOULD_TRANSLATE_PLUGINS)) + { + v2RedirectUtils::addV2toV7plugins( + $this->getRequestParameter(v2RedirectUtils::FLASHVARS_PARAM_NAME), + $this->bundleConfig, + $this->playerConfig); + } + } + if (!$this->bundleConfig) { KExternalErrors::dieError(KExternalErrors::MISSING_PARAMETER, "unable to resolve bundle config"); } @@ -843,5 +865,4 @@ public function getRequestParameter($name, $default = null) $returnValue = parent::getRequestParameter($name, $default); return $returnValue ? $returnValue : $default; } - } diff --git a/alpha/apps/kaltura/modules/kmcng/actions/kmcngAction.class.php b/alpha/apps/kaltura/modules/kmcng/actions/kmcngAction.class.php index 1c055594b97..db1392eba60 100644 --- a/alpha/apps/kaltura/modules/kmcng/actions/kmcngAction.class.php +++ b/alpha/apps/kaltura/modules/kmcng/actions/kmcngAction.class.php @@ -299,7 +299,8 @@ private function initConfig($deployUrl, $kmcngParams, $enforceSecureProtocol, $r 'userProfileEndpoint' => array('uri' => MicroServiceUserProfile::buildServiceUrl(MicroServiceUserProfile::$host, MicroServiceUserProfile::$service)), 'userReportsEndpoint' => array('uri' => MicroServiceUserReports::buildServiceUrl(MicroServiceUserReports::$host, MicroServiceUserReports::$service)), 'mrEndpoint' => array('uri' => MicroServiceMediaRepurposing::buildServiceUrl(MicroServiceMediaRepurposing::$host, MicroServiceMediaRepurposing::$service)), - 'vendorIntegrationsEndpoint' => array('uri' => MicroServiceVendorIntegrations::buildServiceUrl(MicroServiceVendorIntegrations::$host, MicroServiceVendorIntegrations::$service)) + 'vendorIntegrationsEndpoint' => array('uri' => MicroServiceVendorIntegrations::buildServiceUrl(MicroServiceVendorIntegrations::$host, MicroServiceVendorIntegrations::$service)), + 'unisphereLoaderEndpoint' => array('uri' => MicroServiceUnisphereLoader::buildServiceUrl(MicroServiceUnisphereLoader::$host, MicroServiceUnisphereLoader::$service, false)) ), ); diff --git a/alpha/config/schema.xml b/alpha/config/schema.xml index 2bc814e4757..2df2e4ca10e 100644 --- a/alpha/config/schema.xml +++ b/alpha/config/schema.xml @@ -2103,6 +2103,9 @@ + + + diff --git a/alpha/data/sql/schema.sql b/alpha/data/sql/schema.sql index 6c239137f47..06b8df1962a 100644 --- a/alpha/data/sql/schema.sql +++ b/alpha/data/sql/schema.sql @@ -2387,6 +2387,7 @@ CREATE TABLE `kuser_kgroup` KEY `partner_kuser_index`(`kuser_id`, `status`), KEY `partner_kgroup_index`(`kgroup_id`, `status`), KEY `partner_index`(`partner_id`, `status`), + KEY `updated_at`(`updated_at`), CONSTRAINT `kuser_kgroup_FK_1` FOREIGN KEY (`kgroup_id`) REFERENCES `kuser` (`id`), diff --git a/alpha/lib/enums/PermissionName.php b/alpha/lib/enums/PermissionName.php index ff8aa5ce32f..a088d5f1aff 100644 --- a/alpha/lib/enums/PermissionName.php +++ b/alpha/lib/enums/PermissionName.php @@ -93,8 +93,10 @@ interface PermissionName extends BaseEnum const FEATURE_ALLOW_VAST_CUE_POINT_NO_URL = 'FEATURE_ALLOW_VAST_CUE_POINT_NO_URL'; const VIRTUALEVENT_PLUGIN_PERMISSION = 'VIRTUALEVENT_PLUGIN_PERMISSION'; const GAME_PLUGIN_PERMISSION = 'GAME_PLUGIN_PERMISSION'; + const FEATURE_MEDIA_REPURPOSING_NG_PERMISSION = 'FEATURE_MEDIA_REPURPOSING_NG_PERMISSION'; const FEATURE_ALLOW_CNC_PERMISSION = 'FEATURE_ALLOW_CNC_PERMISSION'; const FEATURE_RECYCLE_BIN = 'FEATURE_RECYCLE_BIN'; + const SCHEDULEDTASK_PLUGIN_PERMISSION = 'SCHEDULEDTASK_PLUGIN_PERMISSION'; const SSO_ADMIN_PERMISSION = 'SSO_ADMIN_PERMISSION'; const ALLOW_SSO_PER_USER = 'ALLOW_SSO_PER_USER'; const FEATURE_THEME_EDITOR_PERMISSION = 'FEATURE_THEME_EDITOR_PERMISSION'; @@ -297,4 +299,5 @@ interface PermissionName extends BaseEnum const FEATURE_DISABLE_PREVIEW_PAGE = 'FEATURE_DISABLE_PREVIEW_PAGE'; const FEATURE_SYNC_VOD_LIVE_METADATA = 'FEATURE_SYNC_VOD_LIVE_METADATA'; + const FEATURE_CONTENT_LAB = 'FEATURE_CONTENT_LAB'; } diff --git a/alpha/lib/enums/ReportType.php b/alpha/lib/enums/ReportType.php index df477437701..492922346c3 100644 --- a/alpha/lib/enums/ReportType.php +++ b/alpha/lib/enums/ReportType.php @@ -229,6 +229,7 @@ interface ReportType extends BaseEnum const EP_VIEWTIME = 60015; const EP_TOP_MOMENTS = 60016; const EP_TOP_SESSIONS = 60017; + const EP_WEBCAST_ENGAGEMENT_OVER_TIME = 60018; const CNC_PARTICIPATION = 70001; } diff --git a/alpha/lib/model/Partner.php b/alpha/lib/model/Partner.php index 550b2baac6d..6965952a08b 100644 --- a/alpha/lib/model/Partner.php +++ b/alpha/lib/model/Partner.php @@ -18,6 +18,7 @@ class Partner extends BasePartner const PLAY_SERVER_PARTNER_ID = -6; const EP_PARTNER_ID = -11; const SELF_SERVE_PARTNER_ID = -12; + const KME_PARTNER_ID = -13; const BI_PARTNER_ID = -15; const AUTH_BROKER_PARTNER = -17; diff --git a/alpha/lib/model/uiConf.php b/alpha/lib/model/uiConf.php index 7c3b67c1388..7939257a0b2 100644 --- a/alpha/lib/model/uiConf.php +++ b/alpha/lib/model/uiConf.php @@ -35,6 +35,7 @@ class uiConf extends BaseuiConf implements ISyncableFile, IRelatedObject const UI_CONF_TYPE_KUPLOAD = 20; const UI_CONF_TYPE_WEBCASTING = 21; const UI_CONF_TYPE_SAP = 22; + const UI_CONF_TYPE_REELS = 23; const UI_CONF_CREATION_MODE_MANUAL = 1; @@ -84,6 +85,7 @@ class uiConf extends BaseuiConf implements ISyncableFile, IRelatedObject self::UI_CONF_TYPE_KUPLOAD => "KUpload.swf", self::UI_CONF_TYPE_WEBCASTING => "", self::UI_CONF_TYPE_SAP => "", + self::UI_CONF_TYPE_REELS => "", ); private static $swf_directory_map = array ( @@ -109,11 +111,14 @@ class uiConf extends BaseuiConf implements ISyncableFile, IRelatedObject self::UI_CONF_TYPE_KUPLOAD => "kupload", self::UI_CONF_TYPE_WEBCASTING => "", self::UI_CONF_TYPE_SAP => "", + self::UI_CONF_TYPE_REELS => "", ); const CUSTOM_DATA_CON_FILE_VERSION = 'conf_file_version'; const CUSTOM_DATA_CONF_FILE_FEATURES_VERSION = 'conf_file_features_version'; - + + const CUSTOM_DATA_V2REDIRECT = "v2redirect"; + public function save(PropelPDO $con = null) { try @@ -212,6 +217,7 @@ private static function initUiConfTypeMap() self::UI_CONF_TYPE_KUPLOAD => "Kaltura Simple Uploader", self::UI_CONF_TYPE_WEBCASTING => "Kaltura Webcasting Studio", self::UI_CONF_TYPE_SAP => "Slim Audio Player", + self::UI_CONF_TYPE_REELS => "Reels Player", ); } } @@ -809,4 +815,16 @@ public function setVersion($v, $subType = self::FILE_SYNC_UICONF_SUB_TYPE_CONFIG return parent::setVersion($v); } + + //v2 to v7 + public function getV2Redirect() + { + return $this->getFromCustomData( self::CUSTOM_DATA_V2REDIRECT); + } + + public function setV2Redirect($v) + { + KalturaLog::log(JSON_encode($v)); + return $this->putInCustomData(self::CUSTOM_DATA_V2REDIRECT, $v); + } } diff --git a/alpha/lib/model/uiConfV2Redirect.php b/alpha/lib/model/uiConfV2Redirect.php new file mode 100644 index 00000000000..d00f6c28139 --- /dev/null +++ b/alpha/lib/model/uiConfV2Redirect.php @@ -0,0 +1,49 @@ +v7Id = $v; + } + + public function setIsApproved($v) + { + $this->isApproved = $v; + } + + public function setTranslatePlugins($v) + { + $this->translatePlugins = $v; + } + + public function getV7Id() + { + return $this->v7Id; + } + + public function getIsApproved() + { + return $this->isApproved; + } + + public function getTranslatePlugins() + { + return $this->translatePlugins; + } +} \ No newline at end of file diff --git a/api_v3/lib/types/KalturaUiConf.php b/api_v3/lib/types/KalturaUiConf.php index 5f5e47e9f89..82b6a58a4ca 100644 --- a/api_v3/lib/types/KalturaUiConf.php +++ b/api_v3/lib/types/KalturaUiConf.php @@ -155,8 +155,14 @@ class KalturaUiConf extends KalturaObject implements IFilterable * @filter mlikeor, mlikeand */ public $partnerTags; - - + + + /** + * @var KalturaUiConfV2Redirect + */ + public $v2Redirect; + + private static $map_between_objects = array ( "id" , @@ -181,8 +187,9 @@ class KalturaUiConf extends KalturaObject implements IFilterable "updatedAt", "html5Url", "config", - "version", + "version", "partnerTags", + "v2Redirect" ); public function getMapBetweenObjects ( ) diff --git a/api_v3/lib/types/KalturaUiConfV2Redirect.php b/api_v3/lib/types/KalturaUiConfV2Redirect.php new file mode 100644 index 00000000000..5c11e1d9a1d --- /dev/null +++ b/api_v3/lib/types/KalturaUiConfV2Redirect.php @@ -0,0 +1,52 @@ +validatePropertyNumeric('v7id'); + $this->validatePropertyNotNull('isApproved'); + $this->validatePropertyNotNull('translatePlugins'); + $uiConfV2Redirect = new uiConfV2Redirect(); + return parent::toObject($uiConfV2Redirect, $props_to_skip); + } + + public function doFromObject($srcObj, KalturaDetachedResponseProfile $responseProfile = null) + { + $this->v7id = $srcObj->getV7Id(); + $this->isApproved = $srcObj->getIsApproved(); + $this->translatePlugins = $srcObj->getTranslatePlugins(); + parent::doFromObject($srcObj, $responseProfile); + } +} diff --git a/api_v3/lib/types/enums/KalturaUiConfObjType.php b/api_v3/lib/types/enums/KalturaUiConfObjType.php index c7989eb2406..0fad97a5c88 100644 --- a/api_v3/lib/types/enums/KalturaUiConfObjType.php +++ b/api_v3/lib/types/enums/KalturaUiConfObjType.php @@ -27,4 +27,5 @@ class KalturaUiConfObjType extends KalturaEnum const KUPLOAD = 20; const WEBCASTING = 21; const SAP = 22; + const REELS = 23; } diff --git a/batch/batches/Import/KAsyncImport.class.php b/batch/batches/Import/KAsyncImport.class.php index 4f8b6bc412a..df6b738e215 100644 --- a/batch/batches/Import/KAsyncImport.class.php +++ b/batch/batches/Import/KAsyncImport.class.php @@ -606,7 +606,8 @@ protected function getTempFilePath($remotePath, $fileSize = null) $rootPath = self::$taskConfig->params->localTempPath; $fileSizeThreshold = isset(self::$taskConfig->params->fileSizeThreshold) ? self::$taskConfig->params->fileSizeThreshold : null; $shardTempPath = isset(self::$taskConfig->params->sharedTempPath) ? self::$taskConfig->params->sharedTempPath : null; - if ($fileSize && $fileSizeThreshold && $shardTempPath && $fileSize > $fileSizeThreshold ) + + if ($shardTempPath && (!$fileSize || ($fileSizeThreshold && $fileSize > $fileSizeThreshold))) { $rootPath = $shardTempPath; } diff --git a/configurations/admin.template.ini b/configurations/admin.template.ini index 211c57546ae..da5b194ad2b 100644 --- a/configurations/admin.template.ini +++ b/configurations/admin.template.ini @@ -47,6 +47,7 @@ settings.uiConfTypes[] = Kaltura_Client_Enum_UiConfObjType::CLIPPER settings.uiConfTypes[] = Kaltura_Client_Enum_UiConfObjType::KSR settings.uiConfTypes[] = Kaltura_Client_Enum_UiConfObjType::WEBCASTING settings.uiConfTypes[] = Kaltura_Client_Enum_UiConfObjType::SAP +settings.uiConfTypes[] = Kaltura_Client_Enum_UiConfObjType::REELS ; disable KCW visual editor for on-prem/ce (editor is enabled if property is true or missing) settings.enableKCWVisualEditor = false; @@ -1232,6 +1233,12 @@ moduls.cncAISentimentAnalysis.label = "Enable AI in CNC - Sentiment Analysis" moduls.cncAISentimentAnalysis.permissionName = FEATURE_CNC_AI_SENTIMENT_ANALYSIS_PERMISSION moduls.cncAISentimentAnalysis.group = GROUP_ENABLE_DISABLE_FEATURES +moduls.contentLab.enabled = true +moduls.contentLab.permissionType = 2 +moduls.contentLab.label = "Enable Content Lab" +moduls.contentLab.permissionName = FEATURE_CONTENT_LAB +moduls.contentLab.group = GROUP_ENABLE_DISABLE_FEATURES + ; ACCESS PERMISSIONS access.error = * diff --git a/deployment/base/sql/01.kaltura_ce_tables.sql b/deployment/base/sql/01.kaltura_ce_tables.sql index 79e0e7f1792..f6f4f8eaa93 100644 --- a/deployment/base/sql/01.kaltura_ce_tables.sql +++ b/deployment/base/sql/01.kaltura_ce_tables.sql @@ -1440,7 +1440,8 @@ CREATE TABLE IF NOT EXISTS `kuser_kgroup` ( PRIMARY KEY (`id`), KEY `partner_kuser_index` (`kuser_id`,`status`), KEY `partner_kgroup_index` (`kgroup_id`,`status`), - KEY `partner_index` (`partner_id`,`status`) + KEY `partner_index` (`partner_id`,`status`), + KEY `updated_at` (`updated_at`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; CREATE TABLE IF NOT EXISTS `kuser_to_user_role` ( diff --git a/infra/storage/shared_file_system_managers/kS3SharedFileSystemMgr.php b/infra/storage/shared_file_system_managers/kS3SharedFileSystemMgr.php index cf0772953a1..44ad70b8606 100644 --- a/infra/storage/shared_file_system_managers/kS3SharedFileSystemMgr.php +++ b/infra/storage/shared_file_system_managers/kS3SharedFileSystemMgr.php @@ -20,6 +20,7 @@ use Aws\S3\Exception\S3Exception; use Aws\Exception\AwsException; +use Aws\S3\Exception\S3MultipartUploadException; class kS3SharedFileSystemMgr extends kSharedFileSystemMgr { @@ -46,6 +47,7 @@ class kS3SharedFileSystemMgr extends kSharedFileSystemMgr protected $concurrency; protected $userAgentRegex; protected $userAgentPartner; + protected $multiPartUploadState; /* @var S3Client $s3Client */ protected $s3Client; @@ -76,7 +78,6 @@ public function __construct(array $options = null) $this->endPoint = isset($options['endPoint']) ? $options['endPoint'] : null; $this->accessKeySecret = isset($options['accessKeySecret']) ? $options['accessKeySecret'] : null; $this->accessKeyId = isset($options['accessKeyId']) ? $options['accessKeyId'] : null; - $this->endPoint = isset($options['endPoint']) ? $options['endPoint'] : null; $this->s3Arn = isset($options['arnRole']) ? $options['arnRole'] : $arnRole; $this->userAgentRegex = isset($options['userAgentRegex']) ? $options['userAgentRegex'] : null; } @@ -242,7 +243,7 @@ private function doPutFileHelper($filePath , $fileContent, $params) $filePath, $fileContent, $this->filesAcl, - array('params' => $params) + array('params' => $params) + (isset($this->multiPartUploadState) ? array('state' => $this->multiPartUploadState) : array()) ); KalturaLog::debug("File uploaded to s3, info: " . print_r($res, true)); @@ -251,6 +252,20 @@ private function doPutFileHelper($filePath , $fileContent, $params) catch (Exception $e) { KalturaLog::warning("Failed to uploaded to s3, info with message: " . $e->getMessage()); + + if ($e instanceof S3MultipartUploadException) + { + KalturaLog::debug("S3MultiPartUpload exception - attempting to resume failed parts"); + $this->multiPartUploadState = $e->getState(); + + // To resume S3MultiPartUpload, if the 'body' ($fileContent) is a resource of type 'stream' + // Need to rewind the pointer (https://docs.aws.amazon.com/en_us/aws-sdk-php/guide/latest/service/s3-multipart-upload.html) + if (is_resource($fileContent) && get_resource_type($fileContent) === 'stream') + { + rewind($fileContent); + } + } + return array(false, $e->getMessage()); } } diff --git a/plugins/bulk_upload/csv/batch/BulkUploadVendorCatalogItemEngineCsv.php b/plugins/bulk_upload/csv/batch/BulkUploadVendorCatalogItemEngineCsv.php index aa2e4baa166..027bc76f1db 100644 --- a/plugins/bulk_upload/csv/batch/BulkUploadVendorCatalogItemEngineCsv.php +++ b/plugins/bulk_upload/csv/batch/BulkUploadVendorCatalogItemEngineCsv.php @@ -29,7 +29,7 @@ class BulkUploadVendorCatalogItemEngineCsv extends BulkUploadEngineCsv private $bulkUploadResultParams = array( 'vendorPartnerId', 'name', 'systemName', 'serviceType', 'turnAroundTime', 'sourceLanguage', 'targetLanguage', 'outputFormat', 'enableSpeakerId', 'fixedPriceAddons', - 'pricing', 'flavorParamsId', 'clearAudioFlavorParamsId', 'allowResubmission', 'stage', 'contract', 'notes', 'createdBy'); + 'pricing', 'flavorParamsId', 'clearAudioFlavorParamsId', 'allowResubmission', 'requireSource', 'stage', 'contract', 'notes', 'createdBy'); /** * (non-PHPdoc) diff --git a/plugins/reach/admin/CatalogItemListAction.php b/plugins/reach/admin/CatalogItemListAction.php index cbd0b3ef145..2747bacf660 100644 --- a/plugins/reach/admin/CatalogItemListAction.php +++ b/plugins/reach/admin/CatalogItemListAction.php @@ -25,38 +25,19 @@ public function getTemplatePath() public function doAction(Zend_Controller_Action $action) { $request = $action->getRequest(); - $page = $this->_getParam('page', 1); - $pageSize = $this->_getParam('pageSize', 10); - $vendorPartnerId = $this->_getParam('filter_input') ? $this->_getParam('filter_input') : $request->getParam('partnerId'); - $serviceFeature = $this->_getParam('filterServiceFeature') != "" ? $this->_getParam('filterServiceFeature') : null; - $serviceType = $this->_getParam('filterServiceType') != "" ? $this->_getParam('filterServiceType') : null; - $turnAroundTime = $this->_getParam('filterTurnAroundTime') != "" ? $this->_getParam('filterTurnAroundTime') : null; - $sourceLanguage = $this->_getParam('filterSourceLanguage') != "" ? $this->_getParam('filterSourceLanguage') : null; - $targetLanguage = $this->_getParam('filterTargetLanguage') != "" ? $this->_getParam('filterTargetLanguage') : null; - $partnerId = null; - $action->view->allowed = $this->isAllowedForPartner($partnerId); + $catalogItemFilter = $this->getCatalogItemFilter($action); - // init filter - $catalogItemProfileFilter = $this->getCatalogItemFilter($serviceFeature); - $catalogItemProfileFilter->orderBy = "-id"; - $catalogItemProfileFilter->serviceFeatureEqual = $serviceFeature; - $catalogItemProfileFilter->serviceTypeEqual = $serviceType; - $catalogItemProfileFilter->turnAroundTimeEqual = $turnAroundTime; - $catalogItemProfileFilter->vendorPartnerIdEqual = $vendorPartnerId; - $catalogItemProfileFilter->sourceLanguageEqual = $sourceLanguage; - - if(in_array($serviceFeature, array(Kaltura_Client_Reach_Enum_VendorServiceFeature::TRANSLATION, Kaltura_Client_Reach_Enum_VendorServiceFeature::DUBBING))) - { - $catalogItemProfileFilter->targetLanguageEqual = $targetLanguage; - } + $action->view->allowed = $this->isAllowedForPartner(null); $client = Infra_ClientHelper::getClient(); $reachPluginClient = Kaltura_Client_Reach_Plugin::get($client); // get results and paginate - $paginatorAdapter = new Infra_FilterPaginator($reachPluginClient->vendorCatalogItem, "listAction", $partnerId, $catalogItemProfileFilter); + $paginatorAdapter = new Infra_FilterPaginator($reachPluginClient->vendorCatalogItem, "listAction", null, $catalogItemFilter); $paginator = new Infra_Paginator($paginatorAdapter, $request); + $page = $this->_getParam('page', 1); + $pageSize = $this->_getParam('pageSize', 10); $paginator->setCurrentPageNumber($page); $paginator->setItemCountPerPage($pageSize); @@ -73,13 +54,10 @@ public function doAction(Zend_Controller_Action $action) $actionUrl = $action->view->url(array('controller' => 'plugin', 'action' => 'CatalogItemConfigure'), null, true); $createProfileForm->setAction($actionUrl); - if ($partnerId) - $createProfileForm->getElement("newPartnerId")->setValue($partnerId); - $action->view->newCatalogItemFolderForm = $createProfileForm; } - protected function getCatalogItemFilter($serviceFeature) + protected function getCatalogItemFilterByServiceFeature($serviceFeature) { if ($serviceFeature == Kaltura_Client_Reach_Enum_VendorServiceFeature::CAPTIONS) return new Kaltura_Client_Reach_Type_VendorCaptionsCatalogItemFilter(); @@ -103,6 +81,38 @@ protected function getCatalogItemFilter($serviceFeature) return new Kaltura_Client_Reach_Type_VendorCatalogItemFilter(); } + protected function getCatalogItemFilter($action) + { + $request = $action->getRequest(); + + $serviceFeature = $this->_getParam('filterServiceFeature') != "" ? $this->_getParam('filterServiceFeature') : null; + $serviceType = $this->_getParam('filterServiceType') != "" ? $this->_getParam('filterServiceType') : null; + $turnAroundTime = $this->_getParam('filterTurnAroundTime') != "" ? $this->_getParam('filterTurnAroundTime') : null; + $sourceLanguage = $this->_getParam('filterSourceLanguage') != "" ? $this->_getParam('filterSourceLanguage') : null; + $targetLanguage = $this->_getParam('filterTargetLanguage') != "" ? $this->_getParam('filterTargetLanguage') : null; + + $catalogItemFilter = $this->getCatalogItemFilterByServiceFeature($serviceFeature); + $catalogItemFilter->orderBy = "-id"; + $catalogItemFilter->serviceFeatureEqual = $serviceFeature; + $catalogItemFilter->serviceTypeEqual = $serviceType; + $catalogItemFilter->turnAroundTimeEqual = $turnAroundTime; + $catalogItemFilter->sourceLanguageEqual = $sourceLanguage; + + $filterInput = $request->getParam('filter_input'); + if (strlen($filterInput)) + { + $filterType = $request->getParam('filter_type'); + $catalogItemFilter->$filterType = $filterInput; + } + + if(in_array($serviceFeature, array(Kaltura_Client_Reach_Enum_VendorServiceFeature::TRANSLATION, Kaltura_Client_Reach_Enum_VendorServiceFeature::DUBBING))) + { + $catalogItemFilter->targetLanguageEqual = $targetLanguage; + } + + return $catalogItemFilter; + } + public function getInstance($interface) { if ($this instanceof $interface) @@ -131,8 +141,7 @@ public function isAllowedForPartner($partnerId) $isAllowed = ($result->totalCount > 0) && ($result->objects[0]->status == Kaltura_Client_Enum_PermissionStatus::ACTIVE); return $isAllowed; } - - + /** * @return array - array of */ diff --git a/plugins/reach/admin/ReachRequestsListAction.php b/plugins/reach/admin/ReachRequestsListAction.php index a218ec8a173..0122d0ac97a 100644 --- a/plugins/reach/admin/ReachRequestsListAction.php +++ b/plugins/reach/admin/ReachRequestsListAction.php @@ -38,12 +38,14 @@ public function doAction(Zend_Controller_Action $action) $entryVendorTaskFilterForm = self::getFilterForm($request, $action); $action->view->filterForm = $entryVendorTaskFilterForm; $action->view->paginator = $paginator; + + $this->addCreatedAtParamsToFilter($request, $action, $entryVendorTaskFilter); } protected function initFilter($request) { $entryVendorTaskFilter = $this->getEntryVendorTaskFilter($request); - $this->setCreatedAtFilter($entryVendorTaskFilter); + $entryVendorTaskFilter->orderBy = '-createdAt'; $this->setStatusFilter($request, $entryVendorTaskFilter); kReachUtils::setSelectedRelativeTime($request->getParam('from_time'), $entryVendorTaskFilter); return $entryVendorTaskFilter; @@ -91,12 +93,6 @@ protected function getEntryVendorTaskFilter(Zend_Controller_Request_Abstract $re return $filter; } - protected function setCreatedAtFilter($entryVendorTaskFilter) - { - $entryVendorTaskFilter->updatedAtGreaterThanOrEqual = time() - (VendorServiceTurnAroundTime::TEN_DAYS + VendorServiceTurnAroundTime::TWENTY_FOUR_HOURS); - $entryVendorTaskFilter->orderBy = '-createdAt'; - } - protected function setStatusFilter($request, $entryVendorTaskFilter) { $filterStatusInput = $request->getParam('filter_status'); @@ -106,7 +102,7 @@ protected function setStatusFilter($request, $entryVendorTaskFilter) } else { - $entryVendorTaskFilter->statusIn = EntryVendorTaskStatus::PENDING . ',' . EntryVendorTaskStatus::PROCESSING . ',' . EntryVendorTaskStatus::ERROR . ',' . EntryVendorTaskStatus::SCHEDULED; + $entryVendorTaskFilter->statusIn = EntryVendorTaskStatus::READY . ',' . EntryVendorTaskStatus::PENDING . ',' . EntryVendorTaskStatus::PROCESSING . ',' . EntryVendorTaskStatus::ERROR . ',' . EntryVendorTaskStatus::SCHEDULED; } } @@ -131,4 +127,42 @@ public function isAllowedForPartner($partnerId) $isAllowed = ($result->totalCount > 0) && ($result->objects[0]->status == Kaltura_Client_Enum_PermissionStatus::ACTIVE); return $isAllowed; } -} \ No newline at end of file + + private function addCreatedAtParamsToFilter($request, $action, &$entryVendorTaskFilter) + { + if ($request->getParam('createdAtFrom', false)) + { + $createdAtFrom = new Zend_Date($this->_getParam('createdAtFrom'), 'MM/DD/YYYY'); + $entryVendorTaskFilter->createdAtGreaterThanOrEqual = $createdAtFrom->toString(Zend_Date::TIMESTAMP); + } + else + { + $createdAtFrom = $action->view->filterForm->getElement('createdAtFrom'); + $createdAtFrom->setValue(date('m/d/Y', $this->getDefaultFromDate())); + $entryVendorTaskFilter->createdAtGreaterThanOrEqual = $this->getDefaultFromDate(); + } + + if ($request->getParam('createdAtTo', false)) + { + $createdAtTo = new Zend_Date($this->_getParam('createdAtTo'), 'MM/DD/YYYY'); + $createdAtTo->addDay(1); + $entryVendorTaskFilter->createdAtLessThanOrEqual = $createdAtTo->toString(Zend_Date::TIMESTAMP); + } + else + { + $createdAtTo = $action->view->filterForm->getElement('createdAtTo'); + $createdAtTo->setValue(date('m/d/Y', $this->getDefaultToDate())); + $entryVendorTaskFilter->createdAtLessThanOrEqual = $this->getDefaultToDate(); + } + } + + private function getDefaultFromDate() + { + return time() - (60 * 60 * 12); + } + + private function getDefaultToDate() + { + return time() + (60 * 60 * 12); + } +} diff --git a/plugins/reach/admin/forms/CatalogItemConfigure.php b/plugins/reach/admin/forms/CatalogItemConfigure.php index 5beece43c2a..6fdc6cbe627 100644 --- a/plugins/reach/admin/forms/CatalogItemConfigure.php +++ b/plugins/reach/admin/forms/CatalogItemConfigure.php @@ -50,7 +50,6 @@ public function init() 'required' => true, 'filters' => array('StringTrim'), 'placement' => 'prepend', - 'readonly' => $this->disableAttributes, )); $this->addElement('text', 'systemName', array( diff --git a/plugins/reach/admin/forms/CatalogItemFilter.php b/plugins/reach/admin/forms/CatalogItemFilter.php index c4eae04a928..d90d37c1676 100644 --- a/plugins/reach/admin/forms/CatalogItemFilter.php +++ b/plugins/reach/admin/forms/CatalogItemFilter.php @@ -13,7 +13,7 @@ public function init() $filterType = $this->getElement('filter_type'); $filterType->setMultiOptions(array( 'vendorPartnerIdEqual' => 'Vendor Partner ID', -// 'idEqual' => 'Catalog Item ID', + 'idEqual' => 'Catalog Item ID', )); $filterServiceFeature = new Kaltura_Form_Element_EnumSelect('filterServiceFeature', array( diff --git a/plugins/reach/admin/forms/EntryVendorTasksFilter.php b/plugins/reach/admin/forms/EntryVendorTasksFilter.php index 13b8be03dc3..577f18ee2d0 100644 --- a/plugins/reach/admin/forms/EntryVendorTasksFilter.php +++ b/plugins/reach/admin/forms/EntryVendorTasksFilter.php @@ -14,6 +14,7 @@ public function init() $filterType = $this->getElement('filter_type'); $filterType->setMultiOptions(array( + 'idEqual' => 'Task ID', 'vendorPartnerIdEqual' => 'Vendor Partner ID', 'partnerIdEqual' => 'Partner ID' )); @@ -24,6 +25,7 @@ public function init() 'decorators' => array('ViewHelper'), 'multiOptions' => array( '' => 'Status', + EntryVendorTaskStatus::READY => 'READY', EntryVendorTaskStatus::PENDING => 'PENDING', EntryVendorTaskStatus::SCHEDULED => 'SCHEDULED', EntryVendorTaskStatus::PROCESSING => 'PROCESSING', @@ -51,6 +53,26 @@ public function init() 'decorators' => array('ViewHelper'), )); + $this->addElement('hidden', 'newLine1', array( + 'decorators' => array('ViewHelper', array('Label', array('placement' => 'append')), array('HtmlTag', array('tag' => 'br', 'class' => 'newLine'))) + )); + + $this->addElement('hidden', 'newLine2', array( + 'decorators' => array('ViewHelper', array('Label', array('placement' => 'append')), array('HtmlTag', array('tag' => 'br', 'class' => 'newLine'))) + )); + + $this->addElement('text', 'createdAtFrom', array( + 'label' => 'From Date:', + )); + + $this->addElement('hidden', 'newLine3', array( + 'decorators' => array('ViewHelper', array('Label', array('placement' => 'append')), array('HtmlTag', array('tag' => 'br', 'class' => 'newLine'))) + )); + + $this->addElement('text', 'createdAtTo', array( + 'label' => 'To Date:', + )); + $this->addElement('hidden', 'crossLine', array( 'decorators' => array('ViewHelper', array('Label', array('placement' => 'append')), array('HtmlTag', array('tag' => 'hr', 'class' => 'crossLine'))) )); diff --git a/plugins/reach/admin/forms/ReachProfileFilter.php b/plugins/reach/admin/forms/ReachProfileFilter.php index 630036a9e5b..00fbc0a7517 100644 --- a/plugins/reach/admin/forms/ReachProfileFilter.php +++ b/plugins/reach/admin/forms/ReachProfileFilter.php @@ -10,7 +10,7 @@ public function init() parent::init(); $filterType = $this->getElement('filter_type'); $filterType->setMultiOptions(array( - 'partnerIdEqual' => 'Publisher ID', + 'partnerIdEqual' => 'Partner ID', )); } -} \ No newline at end of file +} diff --git a/plugins/reach/admin/scripts/plugin/partner-catalog-item-list-action.phtml b/plugins/reach/admin/scripts/plugin/partner-catalog-item-list-action.phtml index 3f48beddcf5..a254587f5ba 100644 --- a/plugins/reach/admin/scripts/plugin/partner-catalog-item-list-action.phtml +++ b/plugins/reach/admin/scripts/plugin/partner-catalog-item-list-action.phtml @@ -24,12 +24,15 @@ + + + - @@ -59,6 +62,13 @@ else echo null;?> + + +
translate('Source Language'); ?> translate('Target Language'); ?> translate('Output Format'); ?>translate('Stage'); ?>translate('Contract'); ?>translate('Notes'); ?> translate('Action'); ?>
+ paginator; ?>
stage)) + echo $this->enumTranslate('Kaltura_Client_Reach_Enum_VendorCatalogItemStage', $catalogItem->stage); + else + echo null;?> + contract; ?>notes; ?>