当前位置: 首页>>代码示例>>PHP>>正文


PHP Reminder::setReportsIncludeActivity方法代码示例

本文整理汇总了PHP中Reminder::setReportsIncludeActivity方法的典型用法代码示例。如果您正苦于以下问题:PHP Reminder::setReportsIncludeActivity方法的具体用法?PHP Reminder::setReportsIncludeActivity怎么用?PHP Reminder::setReportsIncludeActivity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Reminder的用法示例。


在下文中一共展示了Reminder::setReportsIncludeActivity方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Reminder

 function update_prefs()
 {
     prepare_company_website_controller($this, 'account');
     $user = logged_user();
     if (!$user instanceof User) {
         flash_error(lang('user dnx'));
         $this->redirectTo('dashboard');
     }
     // if
     $company = $user->getCompany();
     if (!$company instanceof Company) {
         flash_error(lang('company dnx'));
         $this->redirectToReferer(get_url('administration'));
     }
     // if
     if (!$user->canUpdateProfile(logged_user())) {
         flash_error(lang('no access permissions'));
         $this->redirectTo('dashboard');
     }
     // if
     $redirect_to = array_var($_GET, 'redirect_to');
     if (trim($redirect_to) == '' || !is_valid_url($redirect_to)) {
         $redirect_to = $user->getCardUrl();
     }
     // if
     $this->setTemplate('edit_preferences');
     $reminder_prefs = Reminders::findById(logged_user()->getId());
     if (!$reminder_prefs instanceof Reminder) {
         $reminder_prefs = new Reminder();
     }
     $prefs_form = array_var($_POST, 'prefs_form');
     $reminder_prefs->setUserId(logged_user()->getId());
     $reminder_prefs->setRemindersEnabled($prefs_form['reminders_enabled']);
     $reminder_prefs->setSummarizedBy($prefs_form['summarized_by']);
     $reminder_prefs->setRemindersFuture($prefs_form['future']);
     $reminder_prefs->setIncludeEveryone($prefs_form['ivsteam']);
     $weekArray = array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');
     $days = '';
     for ($i = 0; $i < 7; $i++) {
         if (isset($prefs_form[$weekArray[$i]])) {
             $days .= "" . $weekArray[$i] . ",";
         }
     }
     $reminder_prefs->setReminderDaysToSend($days);
     $reminder_prefs->setReportsEnabled($prefs_form['reports_enabled']);
     $reminder_prefs->setReportsSummarizedBy($prefs_form['reports_summarized']);
     $reminder_prefs->setReportsIncludeEveryone($prefs_form['ivsteam2']);
     $reminder_prefs->setReportDay($prefs_form['reportDay']);
     $reminder_prefs->setReportsIncludeActivity($prefs_form['report_activity']);
     try {
         DB::beginWork();
         $reminder_prefs->save();
         DB::commit();
         flash_success(lang('prefs updated'));
     } catch (Exception $e) {
         DB::rollback();
         flash_error('Error: ' . $e);
     }
     $dayOfWeek = ConfigOptions::getByName('calendar_first_day_of_week');
     tpl_assign('dayOfWeek', $dayOfWeek->getValue());
     tpl_assign('redirect_to', $redirect_to);
     tpl_assign('user', $user);
     tpl_assign('company', $company);
     tpl_assign('reminder_prefs', $reminder_prefs);
 }
开发者ID:bklein01,项目名称:Project-Pier,代码行数:65,代码来源:RemindersController.class.php


注:本文中的Reminder::setReportsIncludeActivity方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。