Jump to content

Edit History

Janett

Janett

Pour le dashboard, il n'y a pas de modifications d'affichage entre les différentes versions 1.7, en revanche les pages qui sont migrées vers la nouvelle architecture changent les hooks. Par exemples récemment, les pages Paiement, Traduction, Taxes etc... En temps que développeur de module, cela impose d'adapter son code régulièrement pour maintenir nos modules en fonctionnement au fur et à mesure de la transition.

Pour en revenir aux modules, le premier cité ne sert à rien pour l'instant, une fois désactivé on a accès à la même page catalogue de modules.

Le second est un didacticiel donc à désactiver

Le troisième effectivement donne des badges mais ralenti considérablement l'espace d'administration à cause des appels vers l'API de PrestaShop

Le quatrième pareil, c'est du marketing inutile.

Pour les derniers blocs du dashboard, il ne s'agit malheureusement pas de modules mais on peut les désactiver en faisant des overrides, voici ceux que j'ai mis en place.

/override/classes/Tools.php

<?php

class Tools extends ToolsCore
{
    /**
     * @var boolean $is_addons_up Set to false to disabled calls to api.addons.prestashop.com
     */
    protected static $is_addons_up = false;
}

/override/classes/controller/AdminController.php

<?php

class AdminController extends AdminControllerCore
{
    /** @var bool Set to false to disabled calls to api.prestashop.com */
    protected static $is_prestashop_up = false;

    /**
     * Remove Help button
     */
    public function initPageHeaderToolbar()
    {
        parent::initPageHeaderToolbar();
        $this->context->smarty->clearAssign('help_link');
    }

    /**
     * Disable calls to help.prestashop.com
     */
    protected function ajaxProcessOpenHelp()
    {
        return;
    }

    public function setMedia($isNewTheme = false)
    {
        parent::setMedia($isNewTheme);
        $this->removeJS(__PS_BASE_URI__ . $this->admin_webpath.'/themes/' . $this->bo_theme . '/js/help.js');
    }
}

/override/controllers/admin/templates/dashboard/helpers/view/view.tpl

<script>
	var dashboard_ajax_url = '{$link->getAdminLink('AdminDashboard')}';
	var adminstats_ajax_url = '{$link->getAdminLink('AdminStats')}';
	var no_results_translation = '{l s='No result' js=1}';
	var dashboard_use_push = '{$dashboard_use_push|intval}';
	var read_more = '{l s='Read more' js=1}';
</script>

<div id="dashboard">
	<div class="row">
		<div class="col-lg-12">
{if $warning}
			<div class="alert alert-warning">{$warning}</div>
{/if}
			<div id="calendar" class="panel">
				<form action="{$action|escape}" method="post" id="calendar_form" name="calendar_form" class="form-inline">
					<div class="btn-group">
						<button type="button" name="submitDateDay" class="btn btn-default submitDateDay{if isset($preselect_date_range) && $preselect_date_range == 'day'} active{/if}">
							{l s='Day'}
						</button>
						<button type="button" name="submitDateMonth" class="btn btn-default submitDateMonth{if (!isset($preselect_date_range) || !$preselect_date_range) || (isset($preselect_date_range) && $preselect_date_range == 'month')} active{/if}">
							{l s='Month'}
						</button>
						<button type="button" name="submitDateYear" class="btn btn-default submitDateYear{if isset($preselect_date_range) && $preselect_date_range == 'year'} active{/if}">
							{l s='Year'}
						</button>
						<button type="button" name="submitDateDayPrev" class="btn btn-default submitDateDayPrev{if isset($preselect_date_range) && $preselect_date_range == 'prev-day'} active{/if}">
							{l s='Day'}-1
						</button>
						<button type="button" name="submitDateMonthPrev" class="btn btn-default submitDateMonthPrev{if isset($preselect_date_range) && $preselect_date_range == 'prev-month'} active{/if}">
							{l s='Month'}-1
						</button>
						<button type="button" name="submitDateYearPrev" class="btn btn-default submitDateYearPrev{if isset($preselect_date_range) && $preselect_date_range == 'prev-year'} active{/if}">
							{l s='Year'}-1
						</button>
					</div>
					<input type="hidden" name="datepickerFrom" id="datepickerFrom" value="{$date_from|escape}" class="form-control">
					<input type="hidden" name="datepickerTo" id="datepickerTo" value="{$date_to|escape}" class="form-control">
					<input type="hidden" name="preselectDateRange" id="preselectDateRange" value="{if isset($preselect_date_range)}{$preselect_date_range}{/if}" class="form-control">
					<div class="form-group pull-right">
						<button id="datepickerExpand" class="btn btn-default" type="button">
							<i class="icon-calendar-empty"></i>
							<span class="hidden-xs">
								{l s='From'}
								<strong class="text-info" id="datepicker-from-info">{$date_from|escape}</strong>
								{l s='To'}
								<strong class="text-info" id="datepicker-to-info">{$date_to|escape}</strong>
								<strong class="text-info" id="datepicker-diff-info"></strong>
							</span>
							<i class="icon-caret-down"></i>
						</button>
					</div>
					{$calendar}
				</form>
			</div>
		</div>
	</div>
	<div class="row">
		<div class="col-md-4 col-lg-3" id="hookDashboardZoneOne">
			{$hookDashboardZoneOne}
		</div>
		<div class="col-md-8 col-lg-9" id="hookDashboardZoneTwo">
			{$hookDashboardZoneTwo}
		</div>
	</div>
</div>

Entre autres. :)

Janett

Janett

Pour le dashboard, il n'y a pas de modifications d'affichage entre les différentes versions 1.7, en revanche les pages qui sont migrées vers la nouvelle architecture changent les hooks. Par exemples récemment, les pages Paiement, Traduction, Taxes etc... En temps que développeur de module, cela impose d'adapter son code régulièrement pour maintenir nos modules en fonctionnement au fur et à mesure de la transition.

Pour en revenir aux modules, le premier cité ne sert à rien pour l'instant, une fois désactivé on a accès à la même page catalogue de modules.

Le second est un didacticiel donc à désactiver

Le troisième effectivement donne des badges mais ralenti considérablement l'espace d'administration à cause des appels vers l'API de PrestaShop

Le quatrième pareil, c'est du marketing inutile.

Pour les derniers blocs du dashboard, il ne s'agit malheureusement pas de modules mais on peut les désactiver en faisant des overrides, voici ceux que j'ai mis en place.

/override/classes/Tools.php

<?php

class Tools extends ToolsCore
{
    /**
     * @var boolean $is_addons_up Set to false to disabled calls to api.addons.prestashop.com
     */
    protected static $is_addons_up = false;
}

/override/classes/controller/AdminController.php

<?php

class AdminController extends AdminControllerCore
{
    /** @var bool Set to false to disabled calls to api.prestashop.com */
    protected static $is_prestashop_up = false;

    /**
     * Remove Help button
     */
    public function initPageHeaderToolbar()
    {
        parent::initPageHeaderToolbar();
        $this->context->smarty->clearAssign('help_link');
    }

    /**
     * Disable calls to help.prestashop.com
     */
    protected function ajaxProcessOpenHelp()
    {
        return;
    }

    public function setMedia($isNewTheme = false)
    {
        parent::setMedia($isNewTheme);
        $this->removeJS(__PS_BASE_URI__ . $this->admin_webpath.'/themes/' . $this->bo_theme . '/js/help.js');
    }
}

/override/controllers/admin/templates/dashboard/helpers/view/view.tpl

<script>
	var dashboard_ajax_url = '{$link->getAdminLink('AdminDashboard')}';
	var adminstats_ajax_url = '{$link->getAdminLink('AdminStats')}';
	var no_results_translation = '{l s='No result' js=1}';
	var dashboard_use_push = '{$dashboard_use_push|intval}';
	var read_more = '{l s='Read more' js=1}';
</script>

<div id="dashboard">
	<div class="row">
		<div class="col-lg-12">
{if $warning}
			<div class="alert alert-warning">{$warning}</div>
{/if}
			<div id="calendar" class="panel">
				<form action="{$action|escape}" method="post" id="calendar_form" name="calendar_form" class="form-inline">
					<div class="btn-group">
						<button type="button" name="submitDateDay" class="btn btn-default submitDateDay{if isset($preselect_date_range) && $preselect_date_range == 'day'} active{/if}">
							{l s='Day'}
						</button>
						<button type="button" name="submitDateMonth" class="btn btn-default submitDateMonth{if (!isset($preselect_date_range) || !$preselect_date_range) || (isset($preselect_date_range) && $preselect_date_range == 'month')} active{/if}">
							{l s='Month'}
						</button>
						<button type="button" name="submitDateYear" class="btn btn-default submitDateYear{if isset($preselect_date_range) && $preselect_date_range == 'year'} active{/if}">
							{l s='Year'}
						</button>
						<button type="button" name="submitDateDayPrev" class="btn btn-default submitDateDayPrev{if isset($preselect_date_range) && $preselect_date_range == 'prev-day'} active{/if}">
							{l s='Day'}-1
						</button>
						<button type="button" name="submitDateMonthPrev" class="btn btn-default submitDateMonthPrev{if isset($preselect_date_range) && $preselect_date_range == 'prev-month'} active{/if}">
							{l s='Month'}-1
						</button>
						<button type="button" name="submitDateYearPrev" class="btn btn-default submitDateYearPrev{if isset($preselect_date_range) && $preselect_date_range == 'prev-year'} active{/if}">
							{l s='Year'}-1
						</button>
						<!--
						<button type="submit" name="submitDateRealTime" class="hide btn btn-default submitDateRealTime {if $dashboard_use_push}active{/if}" value="{!$dashboard_use_push|intval}">
							{l s='Real Time'}
						</button> -->
					</div>
					<input type="hidden" name="datepickerFrom" id="datepickerFrom" value="{$date_from|escape}" class="form-control">
					<input type="hidden" name="datepickerTo" id="datepickerTo" value="{$date_to|escape}" class="form-control">
					<input type="hidden" name="preselectDateRange" id="preselectDateRange" value="{if isset($preselect_date_range)}{$preselect_date_range}{/if}" class="form-control">
					<div class="form-group pull-right">
						<button id="datepickerExpand" class="btn btn-default" type="button">
							<i class="icon-calendar-empty"></i>
							<span class="hidden-xs">
								{l s='From'}
								<strong class="text-info" id="datepicker-from-info">{$date_from|escape}</strong>
								{l s='To'}
								<strong class="text-info" id="datepicker-to-info">{$date_to|escape}</strong>
								<strong class="text-info" id="datepicker-diff-info"></strong>
							</span>
							<i class="icon-caret-down"></i>
						</button>
					</div>
					{$calendar}
				</form>
			</div>
		</div>
	</div>
	<div class="row">
		<div class="col-md-4 col-lg-3" id="hookDashboardZoneOne">
			{$hookDashboardZoneOne}
		</div>
		<div class="col-md-8 col-lg-9" id="hookDashboardZoneTwo">
			{$hookDashboardZoneTwo}
		</div>
	</div>
</div>

Entre autres. :)

Janett

Janett

Pour le dashboard, il n'y a pas de modifications d'affichage entre les différentes versions 1.7, en revanche les pages qui sont migrées vers la nouvelle architecture changent les hooks. Par exemples récemment, les pages Paiement, Traduction, Taxes etc... En temps que développeur de module, cela impose d'adapter son code régulièrement pour maintenir nos modules en fonctionnement au fur et à mesure de la transition.

Pour en revenir aux modules, le premier cité ne sert à rien pour l'instant, une fois désactivé on a accès à la même page catalogue de modules.

Le second est un didacticiel donc à désactivé

Le troisième effectivement donne des badges mais ralenti considérablement l'espace d'administration à cause des appels vers l'API de PrestaShop

Le quatrième pareil, c'est du marketing inutile.

Pour les derniers blocs du dashboard, il ne s'agit malheureusement pas de modules mais on peut les désactiver en faisant des overrides, voici ceux que j'ai mis en place.

/override/classes/Tools.php

<?php

class Tools extends ToolsCore
{
    /**
     * @var boolean $is_addons_up Set to false to disabled calls to api.addons.prestashop.com
     */
    protected static $is_addons_up = false;
}

/override/classes/controller/AdminController.php

<?php

class AdminController extends AdminControllerCore
{
    /** @var bool Set to false to disabled calls to api.prestashop.com */
    protected static $is_prestashop_up = true;

    /**
     * Remove Help button
     */
    public function initPageHeaderToolbar()
    {
        parent::initPageHeaderToolbar();
        $this->context->smarty->clearAssign('help_link');
    }

    /**
     * Disable calls to help.prestashop.com
     */
    protected function ajaxProcessOpenHelp()
    {
        return;
    }

    public function setMedia($isNewTheme = false)
    {
        parent::setMedia($isNewTheme);
        $this->removeJS(__PS_BASE_URI__ . $this->admin_webpath.'/themes/' . $this->bo_theme . '/js/help.js');
    }
}

/override/controllers/admin/templates/dashboard/helpers/view/view.tpl

<script>
	var dashboard_ajax_url = '{$link->getAdminLink('AdminDashboard')}';
	var adminstats_ajax_url = '{$link->getAdminLink('AdminStats')}';
	var no_results_translation = '{l s='No result' js=1}';
	var dashboard_use_push = '{$dashboard_use_push|intval}';
	var read_more = '{l s='Read more' js=1}';
</script>

<div id="dashboard">
	<div class="row">
		<div class="col-lg-12">
{if $warning}
			<div class="alert alert-warning">{$warning}</div>
{/if}
			<div id="calendar" class="panel">
				<form action="{$action|escape}" method="post" id="calendar_form" name="calendar_form" class="form-inline">
					<div class="btn-group">
						<button type="button" name="submitDateDay" class="btn btn-default submitDateDay{if isset($preselect_date_range) && $preselect_date_range == 'day'} active{/if}">
							{l s='Day'}
						</button>
						<button type="button" name="submitDateMonth" class="btn btn-default submitDateMonth{if (!isset($preselect_date_range) || !$preselect_date_range) || (isset($preselect_date_range) && $preselect_date_range == 'month')} active{/if}">
							{l s='Month'}
						</button>
						<button type="button" name="submitDateYear" class="btn btn-default submitDateYear{if isset($preselect_date_range) && $preselect_date_range == 'year'} active{/if}">
							{l s='Year'}
						</button>
						<button type="button" name="submitDateDayPrev" class="btn btn-default submitDateDayPrev{if isset($preselect_date_range) && $preselect_date_range == 'prev-day'} active{/if}">
							{l s='Day'}-1
						</button>
						<button type="button" name="submitDateMonthPrev" class="btn btn-default submitDateMonthPrev{if isset($preselect_date_range) && $preselect_date_range == 'prev-month'} active{/if}">
							{l s='Month'}-1
						</button>
						<button type="button" name="submitDateYearPrev" class="btn btn-default submitDateYearPrev{if isset($preselect_date_range) && $preselect_date_range == 'prev-year'} active{/if}">
							{l s='Year'}-1
						</button>
						<!--
						<button type="submit" name="submitDateRealTime" class="hide btn btn-default submitDateRealTime {if $dashboard_use_push}active{/if}" value="{!$dashboard_use_push|intval}">
							{l s='Real Time'}
						</button> -->
					</div>
					<input type="hidden" name="datepickerFrom" id="datepickerFrom" value="{$date_from|escape}" class="form-control">
					<input type="hidden" name="datepickerTo" id="datepickerTo" value="{$date_to|escape}" class="form-control">
					<input type="hidden" name="preselectDateRange" id="preselectDateRange" value="{if isset($preselect_date_range)}{$preselect_date_range}{/if}" class="form-control">
					<div class="form-group pull-right">
						<button id="datepickerExpand" class="btn btn-default" type="button">
							<i class="icon-calendar-empty"></i>
							<span class="hidden-xs">
								{l s='From'}
								<strong class="text-info" id="datepicker-from-info">{$date_from|escape}</strong>
								{l s='To'}
								<strong class="text-info" id="datepicker-to-info">{$date_to|escape}</strong>
								<strong class="text-info" id="datepicker-diff-info"></strong>
							</span>
							<i class="icon-caret-down"></i>
						</button>
					</div>
					{$calendar}
				</form>
			</div>
		</div>
	</div>
	<div class="row">
		<div class="col-md-4 col-lg-3" id="hookDashboardZoneOne">
			{$hookDashboardZoneOne}
		</div>
		<div class="col-md-8 col-lg-9" id="hookDashboardZoneTwo">
			{$hookDashboardZoneTwo}
		</div>
	</div>
</div>

Entre autres. :)

×
×
  • Create New...