Disable campaign update during sending process

nemesis82

Active Member
Hy guys,
there is an option for disabling the "update" button once a campaign is started then paused ?
Eg:
With a running campaign, if I pause the sending process I can update anche change campaign information.

Can I disable it ( option in backend or in php file ) ?
Thanks
 
This is the answer to the issue for anyone wondering:

If you place this code in apps/init-custom.php
PHP:
<?php

Yii::app()->hooks->addFilter('grid_view_columns', function($columns) {
   
   if (Yii::app()->controller->id != 'campaigns') {
      return $columns;
   }
   
   foreach ($columns as $index => $column) {
      
      if (!isset($column['class']) || $column['class'] != 'CButtonColumn') {
         continue;
      }
      
      if (!isset($column['buttons']['update'])) {
         continue;
      }
      
      $columns[$index]['buttons']['update']['visible'] = '$data->editable && !$data->isPaused';
      break;
   }
   
   return $columns;
});

Then campaigns which are paused will not show the edit button anymore.
 
Back
Top