當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Reminder::setRemindersFuture方法代碼示例

本文整理匯總了PHP中Reminder::setRemindersFuture方法的典型用法代碼示例。如果您正苦於以下問題:PHP Reminder::setRemindersFuture方法的具體用法?PHP Reminder::setRemindersFuture怎麽用?PHP Reminder::setRemindersFuture使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Reminder的用法示例。


在下文中一共展示了Reminder::setRemindersFuture方法的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::setRemindersFuture方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。