How to remove certain operation log?

hezinai

Member
Sometimes I need to modify and help manage customers list.
I don't want to customer find it out.. How to remove certain operation log from customer dashboard?
modify log.jpg
 
You can go to Customer > Views > and from there, go to appropriate view page.

You can modify there.
 
@hezinai - it's actually a bit more complicated, but you can do it but editing the file: apps/customer/components/behaviors/CustomerActionLogBehavior.php
If you look inside, all the actions are defined there, for example, when a list is created:
PHP:
public function listCreated($list)
{
    if (empty($this->owner->customer_id)) {
        return false;
    }
    
    $url        = Yii::app()->options->get('system.urls.customer_absolute_url');
    $url        = $url . sprintf('lists/%s/overview', $list->uid);
    $message    = 'The list "{listName}" has been successfully created!';
    $listLink   = CHtml::link($list->name, $url);
    $message    = Yii::t('lists', $message, array('{listName}' => $listLink)); 
    
    $model = new CustomerActionLog();
    $model->customer_id = $this->owner->customer_id;
    $model->category = CustomerActionLog::CATEGORY_LISTS_CREATED;
    $model->reference_id = $list->list_id;
    $model->message = $message;
    return $model->save();
}
So in order to disable logging this message, you place a return false; right at the start of the function:
PHP:
public function listCreated($list)
{
    return false; // add this.
    if (empty($this->owner->customer_id)) {
        return false;
    }
    
    $url        = Yii::app()->options->get('system.urls.customer_absolute_url');
    $url        = $url . sprintf('lists/%s/overview', $list->uid);
    $message    = 'The list "{listName}" has been successfully created!';
    $listLink   = CHtml::link($list->name, $url);
    $message    = Yii::t('lists', $message, array('{listName}' => $listLink)); 
    
    $model = new CustomerActionLog();
    $model->customer_id = $this->owner->customer_id;
    $model->category = CustomerActionLog::CATEGORY_LISTS_CREATED;
    $model->reference_id = $list->list_id;
    $model->message = $message;
    return $model->save();
}
 
Back
Top