diff --git a/pkg/vtiger/modules/ExtensionStore/modules/ExtensionStore/ExtensionStore.js b/pkg/vtiger/modules/ExtensionStore/modules/ExtensionStore/ExtensionStore.js index 7cd67416c8b8de4cf8f44eeabffb402cfdf8d8bf..32795e7c1a6ff89405c104b52a3594e7ea239e93 100644 --- a/pkg/vtiger/modules/ExtensionStore/modules/ExtensionStore/ExtensionStore.js +++ b/pkg/vtiger/modules/ExtensionStore/modules/ExtensionStore/ExtensionStore.js @@ -1,149 +1,136 @@ -/* - * Copyright (C) www.vtiger.com. All rights reserved. - * @license Proprietary - */ +/*+********************************************************************************** + * The contents of this file are subject to the vtiger CRM Public License Version 1.1 + * ("License"); You may not use this file except in compliance with the License + * The Original Code is: vtiger CRM Open Source + * The Initial Developer of the Original Code is vtiger. + * Portions created by vtiger are Copyright (C) vtiger. + * All Rights Reserved. + ************************************************************************************/ -jQuery.Class("ExtensionStore_ExtensionStore_Js", {}, { - - /** - * Function to register events for banner - */ - registerEventsForBanner : function(){ - var bxTarget = jQuery('.bxslider'); - var items = jQuery('li', bxTarget); - if (items.length) { - bxTarget.bxSlider({ - mode: 'fade', - auto: true, - pager: items.length > 1, - speed: items.length > 1 ? 1500 : 0, - pause: 3000, - onSlideBefore : function(){ - jQuery('.bx-viewport').css({'height': '110px', 'overflow': 'hidden'}); - } - }); - } - }, - - /** - * Function to getPromotions from marketplace - */ - getPromotions : function(){ - var thisInstance = this; - var params = { - 'module': 'ExtensionStore', - 'view': 'Listings', - 'mode': 'getPromotions' - }; - AppConnector.request(params).then( - function(data) { - if((typeof data != 'undefined') && (jQuery(data).find('img').length > 0)){ - jQuery('.dashboardHeading').append(data); - thisInstance.registerEventsForBanner(); - }else{ - jQuery('.togglePromotion').trigger('click'); - } - }, - function(error) {} - ); - }, - - /** - * Function to request get promotions from market place based on promotion closed date - */ - getPromotionsFromMarketPlace : function(promotionClosedDate){ - var thisInstance = this; - if(promotionClosedDate != null){ - var maxPromotionParams = { - 'module' : 'ExtensionStore', - 'action' : 'Promotion', - 'mode' : 'maxCreatedOn' - }; - AppConnector.request(maxPromotionParams).then( - function(data) { - var date = data['result']; - var dateObj = new Date(date); - var closedDate = new Date(promotionClosedDate); - var dateDiff = ((dateObj.getTime()) - (closedDate.getTime()))/(1000*60*60*24); - if(dateDiff > 0){ - thisInstance.getPromotions(); - } - }); - }else if(promotionClosedDate == null){ - thisInstance.getPromotions(); - } - }, - - registerEventsForTogglePromotion : function() { - var thisInstance = this; - jQuery('.togglePromotion').on('click', function(e){ - var element = jQuery(e.currentTarget); - var bannerContainer = jQuery(".banner-container"); - - if(element.hasClass('up')){ - bannerContainer.slideUp(); - element.find('.icon-chevron-up').addClass('hide'); - element.find('.icon-chevron-down').removeClass('hide'); - element.addClass('down').removeClass('up'); - }else if(element.hasClass('down')){ - if(bannerContainer.find('img').length <= 0){ - thisInstance.getPromotionsFromMarketPlace(null); - } - bannerContainer.slideDown(); - element.find('.icon-chevron-down').addClass('hide'); - element.find('.icon-chevron-up').removeClass('hide'); - element.addClass('up').removeClass('down'); - } - }); - }, - - insertTogglePromotionHtml : function(){ - var toggleHtml = '<span class="btn-group">'+ - '<button class="btn addButton togglePromotion up">'+ - '<span id="hide" class="icon icon-chevron-up"></span>'+ - '<span id="show" class="icon icon-chevron-down hide"></span>'+ - '</button>'+ - '</span>'; - jQuery('.dashboardHeading').find('.btn-toolbar').append(toggleHtml); - }, - - registerEvents: function() { - var thisInstance = this; - var moduleName = app.getModuleName(); - var date = new Date(); - var promotionClosedDate = date.getUTCFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate(); - var getPromotion = false; - thisInstance.insertTogglePromotionHtml(); - if(promotionClosedDate == null){ - getPromotion = true; - }else if(promotionClosedDate.length > 0){ - var closedDate = promotionClosedDate.split("-"); - var closedOn = new Date(parseInt(closedDate[0]), parseInt(closedDate[1]), parseInt(closedDate[2])); - var currentDate = new Date(); - var diff = (currentDate.getTime()) - (closedOn.getTime()); - var days = diff/(1000*60*60*24); - if(days >= 7){ - getPromotion = true; - }else { - getPromotion = false; - } - } - - if ((moduleName == "Home") && getPromotion) { - thisInstance.getPromotionsFromMarketPlace(promotionClosedDate); - }else if((moduleName == "Home") && !getPromotion){ - jQuery('.togglePromotion').find('.icon-chevron-up').addClass('hide'); - jQuery('.togglePromotion').find('.icon-chevron-down').removeClass('hide'); - jQuery('.togglePromotion').addClass('down').removeClass('up'); - } - thisInstance.registerEventsForTogglePromotion(); - } +jQuery.Class('ExtensionStore_ExtensionStore_Js', {}, { + /** + * Function to register events for banner + */ + registerEventsForBanner: function () { + var bxTarget = jQuery('.bxslider'); + var items = jQuery('li', bxTarget); + if (items.length) { + bxTarget.bxSlider({ + mode: 'fade', + auto: true, + pager: items.length > 1, + speed: items.length > 1 ? 1500 : 0, + pause: 3000, + onSlideBefore: function () { + jQuery('.bx-viewport').css({'height': '150px', 'overflow': 'hidden'}); + } + }); + } + }, + /** + * Function to getPromotions from marketplace + */ + getPromotions: function () { + var thisInstance = this; + var params = { + 'module': 'ExtensionStore', + 'view': 'Listings', + 'mode': 'getPromotions' + }; + app.request.post({data:params}).then( + function (err, data) { + if ((typeof data != 'undefined') && (jQuery(data).find('img').length > 0)) { + jQuery('.dashboardHeading').append(data); + thisInstance.registerEventsForBanner(); + } else { + jQuery('.togglePromotion').addClass('hide'); + } + }, + function (error) { + } + ); + }, + + /** + * Function to request get promotions from market place based on promotion closed date + */ + getPromotionsFromMarketPlace: function (promotionClosedDate) { + var thisInstance = this; + if (promotionClosedDate != null) { + var maxPromotionParams = { + 'module': 'ExtensionStore', + 'action': 'Promotion', + 'mode': 'maxCreatedOn' + }; + app.request.post({data:maxPromotionParams}).then( + function (err, data) { + var date = data['result']; + var dateObj = new Date(date); + var closedDate = new Date(promotionClosedDate); + var dateDiff = ((dateObj.getTime()) - (closedDate.getTime())) / (1000 * 60 * 60 * 24); + if (dateDiff > 0) { + thisInstance.getPromotions(); + } else { + jQuery('.togglePromotion').addClass('hide'); + } + }); + } else if (promotionClosedDate == null) { + thisInstance.getPromotions(); + } + }, + + registerEventsForTogglePromotion: function () { + var thisInstance = this; + jQuery('.togglePromotion').on('click', function (e) { + var element = jQuery(e.currentTarget); + var bannerContainer = jQuery('.banner-container'); + + if (element.hasClass('up')) { + bannerContainer.slideUp(); + element.find('.icon-chevron-up').addClass('hide'); + element.find('.icon-chevron-down').removeClass('hide'); + element.addClass('down').removeClass('up'); + } else if (element.hasClass('down')) { + if (bannerContainer.find('img').length <= 0) { + thisInstance.getPromotionsFromMarketPlace(null); + } + bannerContainer.slideDown(); + element.find('.icon-chevron-down').addClass('hide'); + element.find('.icon-chevron-up').removeClass('hide'); + element.addClass('up').removeClass('down'); + } + }); + }, + + insertTogglePromotionHtml: function () { + var toggleHtml = '<span class="btn-group">'+ + '<button class="btn addButton togglePromotion up">'+ + '<span id="hide" class="icon icon-chevron-up"></span>'+ + '<span id="show" class="icon icon-chevron-down hide"></span>'+ + '</button>'+ + '</span>'; + jQuery('.dashboardHeading').find('.btn-toolbar').append(toggleHtml); + }, + + registerEvents: function () { + var thisInstance = this; + var moduleName = app.getModuleName(); + + if ((moduleName == 'Home')) { + thisInstance.insertTogglePromotionHtml(); + thisInstance.getPromotionsFromMarketPlace(); + jQuery('.togglePromotion').find('.icon-chevron-up').addClass('hide'); + jQuery('.togglePromotion').find('.icon-chevron-down').removeClass('hide'); + jQuery('.togglePromotion').addClass('down').removeClass('up'); + thisInstance.registerEventsForTogglePromotion(); + } + } }); -jQuery(document).ready(function() { - var moduleName = app.getModuleName(); - if (moduleName == "Home") { - var instance = new ExtensionStore_ExtensionStore_Js(); - instance.registerEvents(); - } +jQuery(document).ready(function () { + var moduleName = app.getModuleName(); + if (moduleName == 'Home') { + var instance = new ExtensionStore_ExtensionStore_Js(); + instance.registerEvents(); + } }); diff --git a/pkg/vtiger/modules/ExtensionStore/modules/ExtensionStore/ExtensionStore.php b/pkg/vtiger/modules/ExtensionStore/modules/ExtensionStore/ExtensionStore.php index a93ae9f3e973f9f66ad2203a4c984bdf65c8a054..890d4b4ede17840286a61a218eed520359713eba 100644 --- a/pkg/vtiger/modules/ExtensionStore/modules/ExtensionStore/ExtensionStore.php +++ b/pkg/vtiger/modules/ExtensionStore/modules/ExtensionStore/ExtensionStore.php @@ -1,9 +1,15 @@ <?php -/* -* Copyright (C) www.vtiger.com. All rights reserved. -* @license Proprietary -*/ -Class ExtensionStore{ +/* +********************************************************************************** + * The contents of this file are subject to the vtiger CRM Public License Version 1.1 + * ("License"); You may not use this file except in compliance with the License + * The Original Code is: vtiger CRM Open Source + * The Initial Developer of the Original Code is vtiger. + * Portions created by vtiger are Copyright (C) vtiger. + * All Rights Reserved. + * ***********************************************************************************/ +class ExtensionStore { + } + ?> diff --git a/pkg/vtiger/modules/ExtensionStore/modules/ExtensionStore/actions/Promotion.php b/pkg/vtiger/modules/ExtensionStore/modules/ExtensionStore/actions/Promotion.php index f212c50bf042113687687e2b273ee62ed4ef000d..d12daca4a4207c57780444038545030ab466861e 100644 --- a/pkg/vtiger/modules/ExtensionStore/modules/ExtensionStore/actions/Promotion.php +++ b/pkg/vtiger/modules/ExtensionStore/modules/ExtensionStore/actions/Promotion.php @@ -1,34 +1,37 @@ <?php +/* +********************************************************************************** + * The contents of this file are subject to the vtiger CRM Public License Version 1.1 + * ("License"); You may not use this file except in compliance with the License + * The Original Code is: vtiger CRM Open Source + * The Initial Developer of the Original Code is vtiger. + * Portions created by vtiger are Copyright (C) vtiger. + * All Rights Reserved. + * ***********************************************************************************/ -/* - * Copyright (C) www.vtiger.com. All rights reserved. - * @license Proprietary - */ +class ExtensionStore_Promotion_Action extends Vtiger_Index_View { + + public function __construct() { + parent::__construct(); + $this->exposeMethod('maxCreatedOn'); + } + + public function process(Vtiger_Request $request) { + $mode = $request->getMode(); + if (!empty($mode)) { + $this->invokeExposedMethod($mode, $request); + return; + } + } -class ExtensionStore_Promotion_Action extends Vtiger_Index_View{ - - public function __construct() { - parent::__construct(); - $this->exposeMethod('maxCreatedOn'); - } - - public function process(Vtiger_Request $request) { - $mode = $request->getMode(); - if (!empty($mode)) { - $this->invokeExposedMethod($mode, $request); - return; - } - } - protected function maxCreatedOn(Vtiger_Request $request){ - $modelInstance = Settings_ExtensionStore_Extension_Model::getInstance(); - $promotions = $modelInstance->getMaxCreatedOn('Promotion', 'max', 'createdon'); - $response = new Vtiger_Response(); - if ($promotions['success'] != 'true') { - $response->setError('', $promotions['error']); - } else { - $response->setResult($promotions['response']); - } - $response->emit(); - } -} \ No newline at end of file + $modelInstance = Settings_ExtensionStore_Extension_Model::getInstance(); + $promotions = $modelInstance->getMaxCreatedOn('Promotion', 'max', 'createdon'); + $response = new Vtiger_Response(); + if ($promotions['success'] != 'true') { + $response->setError('', $promotions['error']); + } else { + $response->setResult($promotions['response']); + } + $response->emit(); + } +} diff --git a/pkg/vtiger/modules/ExtensionStore/modules/ExtensionStore/views/Listings.php b/pkg/vtiger/modules/ExtensionStore/modules/ExtensionStore/views/Listings.php index 3632827920d767ef40114226dc7e5a378c2e535d..1b362fa4fd6dbcbe289c0ef58d8ab91fab24e969 100644 --- a/pkg/vtiger/modules/ExtensionStore/modules/ExtensionStore/views/Listings.php +++ b/pkg/vtiger/modules/ExtensionStore/modules/ExtensionStore/views/Listings.php @@ -1,36 +1,49 @@ <?php +/* +********************************************************************************** + * The contents of this file are subject to the vtiger CRM Public License Version 1.1 + * ("License"); You may not use this file except in compliance with the License + * The Original Code is: vtiger CRM Open Source + * The Initial Developer of the Original Code is vtiger. + * Portions created by vtiger are Copyright (C) vtiger. + * All Rights Reserved. + * ***********************************************************************************/ -/* - * Copyright (C) www.vtiger.com. All rights reserved. - * @license Proprietary - */ +class ExtensionStore_Listings_View extends Vtiger_Index_View { -class ExtensionStore_Listings_View extends Vtiger_Index_View{ - - public function __construct() { - parent::__construct(); - $this->exposeMethod('getPromotions'); - } - - public function process(Vtiger_Request $request) { - $mode = $request->getMode(); - if (!empty($mode)) { - $this->invokeExposedMethod($mode, $request); - return; - } - } - - /** - * Function to get news listings by passing type as News - */ - protected function getPromotions(Vtiger_Request $request) { - $modelInstance = Settings_ExtensionStore_Extension_Model::getInstance(); - $promotions = $modelInstance->getListings('','Promotion'); - $qualifiedModuleName = $request->getModule(false); + public function __construct() { + parent::__construct(); + $this->exposeMethod('getPromotions'); + } - $viewer = $this->getViewer($request); - $viewer->assign('PROMOTIONS', $promotions); - $viewer->assign('QUALIFIED_MODULE', $qualifiedModuleName); - $viewer->view('Promotions.tpl', $qualifiedModuleName); - } -} \ No newline at end of file + public function getHeaderScripts(Vtiger_Request $request) { + $jsFileNames = array( + "libraries.jquery.boxslider.jqueryBxslider", + ); + $jsScriptInstances = $this->checkAndConvertJsScripts($jsFileNames); + return $jsScriptInstances; + } + + public function process(Vtiger_Request $request) { + $mode = $request->getMode(); + if (!empty($mode)) { + $this->invokeExposedMethod($mode, $request); + return; + } + } + + /** + * Function to get news listings by passing type as News + */ + protected function getPromotions(Vtiger_Request $request) { + $modelInstance = Settings_ExtensionStore_Extension_Model::getInstance(); + $promotions = $modelInstance->getListings(null, 'Promotion'); + $qualifiedModuleName = $request->getModule(false); + + $viewer = $this->getViewer($request); + $viewer->assign('PROMOTIONS', $promotions); + $viewer->assign('QUALIFIED_MODULE', $qualifiedModuleName); + $viewer->assign('HEADER_SCRIPTS', $this->getHeaderScripts($request)); + $viewer->view('Promotions.tpl', $qualifiedModuleName); + } + +} diff --git a/pkg/vtiger/modules/ExtensionStore/settings/actions/Basic.php b/pkg/vtiger/modules/ExtensionStore/settings/actions/Basic.php index 9ac901c2132696dac7dd1321a5caabc5c2f662e8..d12bf1d0633ca5e1a48474f2dfbd964bfd691147 100644 --- a/pkg/vtiger/modules/ExtensionStore/settings/actions/Basic.php +++ b/pkg/vtiger/modules/ExtensionStore/settings/actions/Basic.php @@ -1,9 +1,12 @@ <?php - -/* - * Copyright (C) www.vtiger.com. All rights reserved. - * @license Proprietary - */ +/* +********************************************************************************** + * The contents of this file are subject to the vtiger CRM Public License Version 1.1 + * ("License"); You may not use this file except in compliance with the License + * The Original Code is: vtiger CRM Open Source + * The Initial Developer of the Original Code is vtiger. + * Portions created by vtiger are Copyright (C) vtiger. + * All Rights Reserved. + * ***********************************************************************************/ class Settings_ExtensionStore_Basic_Action extends Settings_Vtiger_IndexAjax_View { diff --git a/pkg/vtiger/modules/ExtensionStore/settings/connectors/ExtnStore.php b/pkg/vtiger/modules/ExtensionStore/settings/connectors/ExtnStore.php index 4e76c3f4eaeb31ec8a595e46019d05c8626e4dbf..a3e5ce16dcb2a65fab983d048f7acadb35d14ab2 100644 --- a/pkg/vtiger/modules/ExtensionStore/settings/connectors/ExtnStore.php +++ b/pkg/vtiger/modules/ExtensionStore/settings/connectors/ExtnStore.php @@ -1,9 +1,12 @@ <?php - -/* - * Copyright (C) www.vtiger.com. All rights reserved. - * @license Proprietary - */ +/* +********************************************************************************** + * The contents of this file are subject to the vtiger CRM Public License Version 1.1 + * ("License"); You may not use this file except in compliance with the License + * The Original Code is: vtiger CRM Open Source + * The Initial Developer of the Original Code is vtiger. + * Portions created by vtiger are Copyright (C) vtiger. + * All Rights Reserved. + * ***********************************************************************************/ include_once dirname(__FILE__).'/../libraries/NetClient.php'; @@ -467,4 +470,12 @@ class Settings_ExtensionStore_ExtnStore_Connector { } } + public function getNews() { + try { + $response = $this->api("/app/news", 'GET', '', false); + return array('success' => true, 'result' => $response); + } catch (Exception $ex) { + return array('success' => false, 'error' => $ex->getMessage()); + } + } } diff --git a/pkg/vtiger/modules/ExtensionStore/settings/libraries/LoaderSuggest.php b/pkg/vtiger/modules/ExtensionStore/settings/libraries/LoaderSuggest.php index 047ad18c100286735dcb1db6625410ee9d4d6f40..1d6214bce6092f5da5025a7b4cecebf562c565d0 100644 --- a/pkg/vtiger/modules/ExtensionStore/settings/libraries/LoaderSuggest.php +++ b/pkg/vtiger/modules/ExtensionStore/settings/libraries/LoaderSuggest.php @@ -6,25 +6,25 @@ * without explicit permission from Vtiger (www.vtiger.com). */ -Class Settings_ModuleManager_LoaderSuggest { +Class Settings_ModuleManager_LoaderSuggest { - function vtiger_extensionloader_suggest() { - $PHPVER = sprintf("%s.%s", PHP_MAJOR_VERSION, PHP_MINOR_VERSION); - $OSHWINFO= str_replace('Darwin', 'Mac', PHP_OS) . '_' . php_uname('m'); - - $WIN = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')? true : false; - - $EXTFNAME = 'vtigerextn_loader'; - $EXTNFILE = $EXTFNAME . ($WIN? '.dll' :'.so'); - - $DISTFILE = sprintf("%s_%s_%s.so", $EXTFNAME, $PHPVER, $OSHWINFO); - $DISTFILEZIP = sprintf("%s_%s_%s-yyyymmdd.zip", $EXTFNAME, $PHPVER, $OSHWINFO); - - return array( - 'loader_zip' => $DISTFILEZIP, - 'loader_file' => $DISTFILE, - 'php_ini' => php_ini_loaded_file(), - 'extensions_dir' => ini_get('extension_dir') - ); - } -} \ No newline at end of file + function vtiger_extensionloader_suggest() { + $PHPVER = sprintf("%s.%s", PHP_MAJOR_VERSION, PHP_MINOR_VERSION); + $OSHWINFO = str_replace('Darwin', 'Mac', PHP_OS).'_'.php_uname('m'); + + $WIN = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? true : false; + + $EXTFNAME = 'vtigerextn_loader'; + $EXTNFILE = $EXTFNAME.($WIN ? '.dll' : '.so'); + + $DISTFILE = sprintf("%s_%s_%s.so", $EXTFNAME, $PHPVER, $OSHWINFO); + $DISTFILEZIP = sprintf("%s_%s_%s-yyyymmdd.zip", $EXTFNAME, $PHPVER, $OSHWINFO); + + return array( + 'loader_zip' => $DISTFILEZIP, + 'loader_file' => $DISTFILE, + 'php_ini' => php_ini_loaded_file(), + 'extensions_dir' => ini_get('extension_dir') + ); + } +} diff --git a/pkg/vtiger/modules/ExtensionStore/settings/models/Extension.php b/pkg/vtiger/modules/ExtensionStore/settings/models/Extension.php index 66a716e24cd6b7455e35b1fca53e998e338765c7..cededb6fae0618338461580d62f6fa9c25f534f8 100644 --- a/pkg/vtiger/modules/ExtensionStore/settings/models/Extension.php +++ b/pkg/vtiger/modules/ExtensionStore/settings/models/Extension.php @@ -1,9 +1,12 @@ <?php - -/* - * Copyright (C) www.vtiger.com. All rights reserved. - * @license Proprietary - */ +/* +********************************************************************************** + * The contents of this file are subject to the vtiger CRM Public License Version 1.1 + * ("License"); You may not use this file except in compliance with the License + * The Original Code is: vtiger CRM Open Source + * The Initial Developer of the Original Code is vtiger. + * Portions created by vtiger are Copyright (C) vtiger. + * All Rights Reserved. + * ***********************************************************************************/ vimport('~~/vtlib/Vtiger/Package.php'); vimport('~/libraries/PHPMarkdown/Michelf/Markdown.inc.php'); @@ -210,6 +213,16 @@ class Settings_ExtensionStore_Extension_Model extends Vtiger_Base_Model { } } + public function getNews() { + $news = array(); + $extensionLookUpUrl = $this->getExtensionsLookUpUrl(); + if ($extensionLookUpUrl) { + $connector = Settings_ExtensionStore_ExtnStore_Connector::getInstance($extensionLookUpUrl); + $news = $connector->getNews(); + } + return $news; + } + /** * Function to get all availible extensions * @param <Object> $xmlContent @@ -487,45 +500,36 @@ class Settings_ExtensionStore_Extension_Model extends Vtiger_Base_Model { foreach ($listing as $key => $value) { switch ($key) { - case 'name' : $key = 'label'; - break; - case 'identifier': $key = 'name'; - break; - case 'version' : $key = 'pkgVersion'; - break; - case 'minrange': $key = 'vtigerVersion'; - break; - case 'maxrange': $key = 'vtigerMaxVersion'; - break; - case 'CustomerId': $key = 'publisher'; - break; - case 'price': $value = $value ? $value : 'Free'; - break; - case 'approvedon': $key = 'pubDate'; - break; - case 'ListingFileId': - if ($value) { - $key = 'downloadURL'; - $value = $this->getExtensionsLookUpUrl().'/customer/listingfiles?id='.$value; - } - break; - case 'thumbnail': - if ($value) { - $key = 'thumbnailURL'; - $value = str_replace('api', "_listingimages/$value", $this->getExtensionsLookUpUrl()); - } - break; - case 'banner' : - if ($value) { - $key = 'bannerURL'; - $value = str_replace('api', "_listingimages/$value", $this->getExtensionsLookUpUrl()); - } - break; - case 'description': - if ($value) { - $markDownInstance = new Michelf\Markdown(); - $value = $markDownInstance->transform($value); - } + case 'name' : $key = 'label'; break; + case 'identifier' : $key = 'name'; break; + case 'version' : $key = 'pkgVersion'; break; + case 'minrange' : $key = 'vtigerVersion'; break; + case 'maxrange' : $key = 'vtigerMaxVersion'; break; + case 'CustomerId' : $key = 'publisher'; break; + case 'approvedon' : $key = 'pubDate'; break; + case 'price' : if (!$value) { + $value = 'Free'; + } + break; + case 'ListingFileId': if ($value) { + $key = 'downloadURL'; + $value = $this->getExtensionsLookUpUrl().'/customer/listingfiles?id='.$value; + } + break; + case 'thumbnail' : if ($value) { + $key = 'thumbnailURL'; + $value = str_replace('api', "_listingimages/$value", $this->getExtensionsLookUpUrl()); + } + break; + case 'banner' : if ($value) { + $key = 'bannerURL'; + $value = str_replace('api', "_listingimages/$value", $this->getExtensionsLookUpUrl()); + } + break; + case 'description' : if ($value) { + $markDownInstance = new Michelf\Markdown(); + $value = $markDownInstance->transform($value); + } } $extensionModel->set($key, $value); } diff --git a/pkg/vtiger/modules/ExtensionStore/settings/models/Module.php b/pkg/vtiger/modules/ExtensionStore/settings/models/Module.php index 0f18eccdaafb83a15f1e9478eb331a2b5796a061..d6e5ff70879f3e3b0db5d7eed73408c65a2ba33d 100644 --- a/pkg/vtiger/modules/ExtensionStore/settings/models/Module.php +++ b/pkg/vtiger/modules/ExtensionStore/settings/models/Module.php @@ -1,12 +1,12 @@ <?php -/*+*********************************************************************************** - * The contents of this file are subject to the vtiger CRM Public License Version 1.0 +/* +********************************************************************************** + * The contents of this file are subject to the vtiger CRM Public License Version 1.1 * ("License"); You may not use this file except in compliance with the License - * The Original Code is: vtiger CRM Open Source + * The Original Code is: vtiger CRM Open Source * The Initial Developer of the Original Code is vtiger. * Portions created by vtiger are Copyright (C) vtiger. * All Rights Reserved. - *************************************************************************************/ + * ***********************************************************************************/ class Settings_ExtensionStore_Module_Model extends Vtiger_Module_Model { diff --git a/pkg/vtiger/modules/ExtensionStore/settings/views/ExtensionStore.php b/pkg/vtiger/modules/ExtensionStore/settings/views/ExtensionStore.php index 7c210e99a689be75eebc77e5bb9a22614c7c74c3..22272a0a3f4b84fc8a752d38decbf06a5ef1d620 100644 --- a/pkg/vtiger/modules/ExtensionStore/settings/views/ExtensionStore.php +++ b/pkg/vtiger/modules/ExtensionStore/settings/views/ExtensionStore.php @@ -1,9 +1,12 @@ <?php - -/* - * Copyright (C) www.vtiger.com. All rights reserved. - * @license Proprietary - */ +/* +********************************************************************************** + * The contents of this file are subject to the vtiger CRM Public License Version 1.1 + * ("License"); You may not use this file except in compliance with the License + * The Original Code is: vtiger CRM Open Source + * The Initial Developer of the Original Code is vtiger. + * Portions created by vtiger are Copyright (C) vtiger. + * All Rights Reserved. + * ***********************************************************************************/ include_once dirname(__FILE__).'/../libraries/LoaderSuggest.php';