/** * Create a new Cronjob model */ protected function actionCreate() { $model = new \GO\Base\Cron\CronJob(); if (\GO\Base\Util\Http::isPostRequest()) { $model->setAttributes($_POST); $model->save(); echo $this->renderSubmit($model); } else { echo $this->renderForm($model, array(), array('select' => false)); } }
public function install() { parent::install(); $cron = new \GO\Base\Cron\CronJob(); $cron->name = 'Dropbox sync'; $cron->active = true; $cron->runonce = false; $cron->minutes = '*'; $cron->hours = '*'; $cron->monthdays = '*'; $cron->months = '*'; $cron->weekdays = '*'; $cron->job = 'GO\\Dropbox\\Cron\\Sync'; $cron->save(); }
public function install() { parent::install(); $cron = new \GO\Base\Cron\CronJob(); $cron->name = 'Filesearch index'; $cron->active = true; $cron->runonce = false; $cron->minutes = '0'; $cron->hours = '1'; $cron->monthdays = '*'; $cron->months = '*'; $cron->weekdays = '*'; $cron->job = 'GO\\Filesearch\\Cron\\FileIndex'; $cron->save(); return true; }
public static function runOnce() { if (!\GO::cronIsRunning()) { throw new \GO\Base\Exception\NoCron(); } $jobClass = get_called_class(); $job = new $jobClass(); $cron = new \GO\Base\Cron\CronJob(); $cron->name = $job->getLabel(); $cron->active = true; $cron->autodestroy = true; $cron->minutes = '*'; $cron->hours = '*'; $cron->monthdays = '*'; $cron->months = '*'; $cron->weekdays = '*'; $cron->job = $jobClass; if (!$cron->save()) { throw new Exception("Failed to save cron job '{$jobClass}'"); } return $cron; }
public function install() { parent::install(); $group = new Model\Group(); $group->name = \GO::t('calendars', 'calendar'); $group->save(); $cron = new \GO\Base\Cron\CronJob(); $cron->name = 'Calendar publisher'; $cron->active = true; $cron->runonce = false; $cron->minutes = '0'; $cron->hours = '*'; $cron->monthdays = '*'; $cron->months = '*'; $cron->weekdays = '*'; $cron->job = 'GO\\Calendar\\Cron\\CalendarPublisher'; $cron->save(); }
public function install() { parent::install(); $template = new Model\Template(); $template->name = \GO::t('template_default_name', 'tickets'); $template->content = \GO::t('template_default_content', 'tickets'); $template->autoreply = 0; $template->default_template = 1; $template->ticket_created_for_client = 0; $template->save(); $template = new Model\Template(); $template->name = \GO::t('template_created_by_client_name', 'tickets'); $template->content = \GO::t('template_created_by_client_content', 'tickets'); $template->autoreply = 1; $template->default_template = 0; $template->ticket_created_for_client = 0; $template->save(); $template = new Model\Template(); $template->name = \GO::t('template_created_for_client_name', 'tickets'); $template->content = \GO::t('template_created_for_client_content', 'tickets'); $template->autoreply = 0; $template->default_template = 0; $template->ticket_created_for_client = 1; $template->save(); $type = new Model\Type(); $type->publish_on_site = true; $type->name = \GO::t('example_type1', 'tickets'); $type->save(); $type->acl->addGroup(\GO::config()->group_everyone, \GO\Base\Model\Acl::WRITE_PERMISSION); $type = new Model\Type(); $type->name = \GO::t('example_type2', 'tickets'); $type->save(); $type->acl->addGroup(\GO::config()->group_everyone, \GO\Base\Model\Acl::WRITE_PERMISSION); $status = new Model\Status(); $status->name = \GO::t('example_status1', 'tickets'); $status->save(); $status = new Model\Status(); $status->name = \GO::t('example_status2', 'tickets'); $status->save(); $settings = new Model\Settings(); $settings->id = 1; $settings->save(); $cron = new \GO\Base\Cron\CronJob(); $cron->name = 'Close inactive tickets'; $cron->active = true; $cron->runonce = false; $cron->minutes = '0'; $cron->hours = '2'; $cron->monthdays = '*'; $cron->months = '*'; $cron->weekdays = '*'; $cron->job = 'GO\\Tickets\\Cron\\CloseInactive'; $cron->save(); $cron = new \GO\Base\Cron\CronJob(); $cron->name = 'Ticket reminders'; $cron->active = true; $cron->runonce = false; $cron->minutes = '*/5'; $cron->hours = '*'; $cron->monthdays = '*'; $cron->months = '*'; $cron->weekdays = '*'; $cron->job = 'GO\\Tickets\\Cron\\Reminder'; $cron->save(); $cron = new \GO\Base\Cron\CronJob(); $cron->name = 'Import tickets from IMAP'; $cron->active = true; $cron->runonce = false; $cron->minutes = '0,5,10,15,20,25,30,35,40,45,50,55'; $cron->hours = '*'; $cron->monthdays = '*'; $cron->months = '*'; $cron->weekdays = '*'; $cron->job = 'GO\\Tickets\\Cron\\ImportImap'; $cron->save(); }
<?php $cron = new \GO\Base\Cron\CronJob(); $cron->name = 'Recalculate user quota'; $cron->active = true; $cron->runonce = true; $cron->minutes = '24'; $cron->hours = '2'; $cron->monthdays = '*'; $cron->months = '*'; $cron->weekdays = '*'; $cron->job = 'GO\\Files\\Cron\\RecalculateDiskUsage'; $cron->save();