Esempio n. 1
0
 /**
  * execute処理
  *
  * @return	string アクション文字列
  * @access	public
  */
 function execute()
 {
     $circularId = $this->session->getParameter(array('circular_id', $this->block_id));
     if (empty($circularId)) {
         return "success";
     }
     $mail = $this->circularView->getConfig();
     if ($mail === false) {
         return 'error';
     }
     $this->mailMain->setSubject($mail['mail_subject']);
     $this->mailMain->setBody($mail["mail_body"]);
     $circularInfo = $this->circularView->getCircularInfo($circularId);
     if ($circularInfo === false) {
         return 'error';
     }
     $tags['X-CIRCULAR_SUBJECT'] = htmlspecialchars($circularInfo['circular_subject']);
     $tags['X-CIRCULAR_BODY'] = $circularInfo['circular_body'];
     $tags['X-CIRCULAR_CREATE_DATE'] = timezone_date($circularInfo['insert_time'], false, _FULL_DATE_FORMAT);
     $tags['X-CIRCULAR_URL'] = BASE_URL . INDEX_FILE_NAME . '?action=' . DEFAULT_ACTION . '&active_action=circular_view_main_detail' . '&circular_id=' . $circularId . '&block_id=' . $this->block_id . '#' . $this->block_id;
     $this->mailMain->assign($tags);
     $toUsers = $this->circularView->getToUsersInfo($circularId);
     $this->mailMain->setToUsers($toUsers);
     $this->mailMain->send();
     return 'success';
 }
Esempio n. 2
0
 /**
  * execute処理
  *
  * @return	string アクション文字列
  * @access	public
  */
 function execute()
 {
     if (empty($this->circular_id)) {
         return "success";
     }
     $this->mailMain->setSubject($this->mail_subject);
     $this->mailMain->setBody($this->mail_body);
     $circularInfo = $this->circularView->getCircularInfo($this->circular_id);
     if ($circularInfo === false) {
         return 'error';
     }
     $postscripts = $this->circularView->getPostscript();
     if ($postscripts === false) {
         return 'error';
     }
     $sendPostscript = $postscripts[count($postscripts) - 1];
     $tags['X-CIRCULAR_SUBJECT'] = htmlspecialchars($circularInfo['circular_subject']);
     $tags['X-CIRCULAR_BODY'] = $circularInfo['circular_body'];
     $tags['X-POSTSCRIPT_BODY'] = $sendPostscript['postscript_value'];
     $tags['X-POSTSCRIPT_DATE'] = timezone_date($sendPostscript['insert_time'], false, _FULL_DATE_FORMAT);
     $tags['X-CIRCULAR_URL'] = BASE_URL . INDEX_FILE_NAME . '?action=' . DEFAULT_ACTION . '&active_action=circular_view_main_detail' . '&circular_id=' . $this->circular_id . '&block_id=' . $this->block_id . '#' . $this->block_id;
     $this->mailMain->assign($tags);
     $toUsers = $this->circularView->getToUsersInfo($this->circular_id);
     $this->mailMain->setToUsers($toUsers);
     $this->mailMain->send();
     return 'success';
 }
Esempio n. 3
0
 /**
  * 月別一覧回数一覧を取得
  * @param string year
  * @param string month
  * @param int room_id
  * @param int user_id
  * @return array  array(login_label, monthly_list, monthly_numbers)
  * @access	public
  */
 function get($year = null, $month = null, $room_id = null, $user_id = null, $role_auth_id = null)
 {
     $login_label = null;
     $time = timezone_date();
     $year = $year == null ? intval(substr($time, 0, 4)) : intval($year);
     $month = $month == null ? intval(substr($time, 4, 2)) : intval($month);
     //$def_month = $month;
     $monthly_list = array();
     $monthly_login_list = array();
     if ($room_id == null) {
         //ルームIDの指定がなければ、ログイン回数を取得(会員管理)
         $monthly_login_list =& $this->getLoginNumber($year, $user_id);
         if ($monthly_login_list === false) {
             return $monthly_login_list;
         }
     }
     // アクセス回数-投稿回数等
     $result =& $this->getMonthlyNumberList($year, $room_id, $user_id, $role_auth_id);
     if ($result === false) {
         return $result;
     }
     list($monthly_list, $pages_list, $monthly_row_exists, $rowspan_list) = $result;
     ////$monthly_list = array_merge($monthly_list, $monthly_numbers);
     return array($month, $monthly_list, $pages_list, $monthly_row_exists, $rowspan_list, $monthly_login_list);
 }
 /**
  * validate実行
  *
  * @param   mixed   $attributes チェックする値
  * @param   string  $errStr     エラー文字列
  * @param   array   $params     オプション引数
  * @return  string  エラー文字列(エラーの場合)
  * @access  public
  */
 function validate($attributes, $errStr, $params)
 {
     $container =& DIContainerFactory::getContainer();
     $request =& $container->getComponent("Request");
     $reservationView =& $container->getComponent("reservationView");
     if (empty($attributes["repeat_time"])) {
         return;
     }
     $error = array();
     foreach ($attributes["repeat_time"] as $i => $time) {
         if (substr($time["start_time_full"], 0, 4) < RESERVATION_SELECT_MIN_YEAR || substr($time["start_time_full"], 0, 4) > RESERVATION_SELECT_MAX_YEAR) {
             return $errStr;
         }
         $result = $reservationView->checkReserveTime($time["start_time_full"], $time["end_time_full"]);
         if ($result == false) {
             $start_time_full = timezone_date($time["start_time_full"], true);
             $error[] = timezone_date($start_time_full, false, _DATE_FORMAT);
         }
     }
     if (!empty($error)) {
         $errStr .= "<br />";
         $errStr .= implode("<br />", $error);
         return $errStr;
     }
 }
Esempio n. 5
0
 /**
  * execute処理
  *
  * @access  public
  */
 function execute()
 {
     $this->details_flag = intval($this->details_flag);
     if ($this->details_flag == _ON) {
         $rrule_str = $this->calendarPlanAction->concatRRule($this->rrule);
     } else {
         $this->location = "";
         $this->contact = "";
         $this->description = "";
         $rrule_str = "";
     }
     $plan_params = array("room_id" => $this->plan_room_id, "title" => $this->title, "title_icon" => $this->icon_name, "allday_flag" => intval($this->allday_flag), "start_time_full" => $this->start_time_full, "end_time_full" => $this->end_time_full, "timezone_offset" => $this->timezone_offset, "location" => $this->location, "contact" => $this->contact, "description" => $this->description, "rrule" => $rrule_str);
     $this->date = timezone_date($this->start_time_full, false, "Ymd");
     $calendar_id = $this->calendarPlanAction->insertPlan($plan_params);
     if ($calendar_id === false) {
         return 'error';
     }
     $upload_id_arr = $this->uploadsAction->getUploadId($this->description);
     if (!empty($upload_id_arr)) {
         $params = array("room_id" => $plan_params["room_id"]);
         $where_params = array("upload_id IN (" . implode(",", $upload_id_arr) . ")" => null);
         $result = $this->uploadsAction->updUploads($params, $where_params);
         if ($result === false) {
             return 'error';
         }
     }
     $result = $this->calendarAction->setWhatsnew($plan_params);
     $this->notification_mail = intval($this->notification_mail);
     if ($this->notification_mail == _ON) {
         $this->session->setParameter("calendar_mail_calendar_id", $calendar_id);
     } else {
         $this->session->setParameter("calendar_mail_calendar_id", 0);
     }
     return 'success';
 }
Esempio n. 6
0
 /**
  * [[機能説明]]
  *
  * @access  public
  */
 function execute()
 {
     $this->categories = $this->journalView->getCatByJournalId($this->journal_obj['journal_id']);
     if ($this->categories === false) {
         return 'error';
     }
     if (!empty($this->post_id)) {
         $this->edit_flag = _ON;
         $result = $this->journalView->getPostDetail($this->post_id);
         if ($result === false || !isset($result[0])) {
             return 'error';
         }
         $this->post = $result[0];
         $mobile_flag = $this->session->getParameter('_mobile_flag');
         if ($mobile_flag == _ON) {
             $this->session->removeParameter('journal_current_mobile_image');
             if (preg_match('/<img[^>]+class\\s*=\\s*["\'][^>]*' . MOBILE_IMAGE . '[^>]+>/u', $this->post['content'], $match) > 0) {
                 $this->post['mobile_image'] = $match[0];
                 $this->session->setParameter('journal_current_mobile_image', $match[0]);
             }
         }
     } else {
         $this->edit_flag = _OFF;
         $this->post = array("journal_id" => $this->journal_obj['journal_id'], "journal_date" => timezone_date(null, true, "YmdHis"), "category_id" => 0, "title" => "", "content" => "");
     }
     return 'success';
 }
 /**
  * ポストフィルタ
  * @access private
  */
 function _postfilter()
 {
     $attributes = $this->getAttributes();
     $page_id = $this->_request->getParameter("page_id");
     $action_name = $this->_request->getParameter(ACTION_KEY) ? $this->_request->getParameter(ACTION_KEY) : DEFAULT_ACTION;
     $user_id = $this->_session->getParameter("_user_id");
     if (!isset($attributes["view"])) {
         //default値
         $attributes["view"] = "success";
     }
     $view = $this->_response->getView();
     $name = $attributes["name"];
     $time = timezone_date();
     $year = substr($time, 0, 4);
     $month = substr($time, 4, 2);
     if ($action_name == DEFAULT_ACTION) {
         //pages
         $module_id = 0;
     } else {
         $modules_obj =& $this->_getdata->getParameter("modules");
         $pathList = explode("_", $action_name);
         if (isset($modules_obj[$pathList[0]])) {
             $module_id = $modules_obj[$pathList[0]]['module_id'];
         } else {
             $module_id = 0;
         }
     }
     $pages =& $this->_getdata->getParameter("pages");
     if ($name == "_login_number") {
         //ログイン回数の場合、page_idが0でもOK
         $room_id = 0;
     } else {
         if (!isset($name) || !isset($page_id) || $page_id == 0 || !isset($pages[$page_id])) {
             //エラー
             return;
         } else {
             $room_id = $pages[$page_id]['room_id'];
         }
     }
     //sessionチェック
     $inc_flag = true;
     if (isset($attributes["session"]) && $attributes["session"] == true) {
         $monthlynumber_session = $this->_session->getParameter(array("_session_common", "_monthlynumber", $room_id, $user_id, $year, $month));
         if (isset($monthlynumber_session)) {
             $inc_flag = false;
         }
     }
     if ($attributes["view"] == $view && $inc_flag && $user_id != "0") {
         //ログインしている場合 インクリメント
         $monthlynumberAction =& $this->_container->getComponent("monthlynumberAction");
         $params = array("user_id" => $user_id, "room_id" => $room_id, "module_id" => $module_id, "name" => $name, "year" => $year, "month" => $month);
         $monthlynumberAction->incrementMonthlynumber($params);
         if (isset($attributes["session"]) && $attributes["session"] == true) {
             $this->_session->setParameter(array("_session_common", "_monthlynumber", $room_id, $user_id, $year, $month), 1);
         }
     }
 }
Esempio n. 8
0
 /**
  * execute実行
  *
  * @access  public
  */
 function execute()
 {
     if (!empty($this->start_date)) {
         $this->date = $this->start_date;
         $this->request->setParameter("date", $this->date);
     }
     $mobile_flag = $this->session->getParameter("_mobile_flag");
     $this->details_flag = intval($this->details_flag);
     $this->notification_mail = intval($this->notification_mail);
     if ($mobile_flag == _ON) {
         if (empty($this->date)) {
             $this->date = $this->session->getParameter(array("calendar_mobile", "current_date"));
         }
     } else {
         if (empty($this->date) || !preg_match("/^([0-9]{4})([0-9]{2})([0-9]{2})\$/", $this->date, $matches) || !checkdate($matches[2], $matches[3], $matches[1])) {
             $this->date = timezone_date(null, false, "Ymd");
         }
     }
     if (isset($this->allday_flag)) {
         $this->allday_flag = intval($this->allday_flag);
     } elseif (empty($this->time) && empty($this->start_time) && empty($this->end_time)) {
         $this->allday_flag = _ON;
     } else {
         $this->allday_flag = _OFF;
     }
     if (empty($this->time) && empty($this->start_time) && empty($this->end_time)) {
         if (date("H") == "23") {
             $this->time = date("H") . "00";
         } else {
             $this->time = sprintf("%02d", intval(date("H")) + 1) . "00";
         }
     }
     if (empty($this->start_time)) {
         $this->start_time = $this->time . "00";
     }
     if (empty($this->end_time)) {
         if (substr($this->time, 0, 2) == "23") {
             $this->end_time = "240000";
         } else {
             $this->end_time = sprintf("%02d", intval(substr($this->time, 0, 2)) + 1) . substr($this->time, 2, 2) . "00";
         }
     }
     $current_timestamp = mktime(0, 0, 0, substr($this->date, 4, 2), substr($this->date, 6, 2), substr($this->date, 0, 4));
     $user_id = $this->session->getParameter("_user_id");
     if (!empty($user_id)) {
         $this->room_arr[0][0][0] = array("page_id" => CALENDAR_ALL_MEMBERS_ID, "parent_id" => 0, "page_name" => CALENDAR_ALL_MEMBERS_LANG, "thread_num" => 0, "space_type" => _SPACE_TYPE_UNDEFINED, "private_flag" => _OFF, "authority_id" => $this->session->getParameter("_user_auth_id"));
     }
     $timezoneMain =& $this->commonMain->registerClass(WEBAPP_DIR . '/components/timezone/Main.class.php', "Timezone_Main", "timezoneMain");
     $this->calendar_obj = array("calendar_id" => 0, "room_id" => $this->plan_room_id > 0 ? $this->plan_room_id : $this->session->getParameter('_main_room_id'), "title" => $this->title, "title_icon" => $this->title_icon, "allday_flag" => $this->allday_flag, "start_date" => date("Ymd", $current_timestamp), "input_start_date" => date(_INPUT_DATE_FORMAT, $current_timestamp), "start_time" => $this->start_time, "end_date" => date("Ymd", $current_timestamp), "input_end_date" => date(_INPUT_DATE_FORMAT, $current_timestamp), "end_time" => $this->end_time, "timezone_offset" => $this->session->getParameter("_timezone_offset"), "timezone_offset_key" => $timezoneMain->getLangTimeZone($this->session->getParameter("_timezone_offset"), false), "location" => "", "contact" => "", "description" => "", "rrule_arr" => $this->calendarView->parseRRule("", true));
     if ($this->details_flag == _ON) {
         $this->edit_rrule = CALENDAR_PLAN_EDIT_ALL;
     }
     $this->timezone_list = explode("|", CALENDAR_DEF_TIMEZONE);
     $this->block = $this->calendarView->getBlock();
     return 'success';
 }
 /**
  * validate実行
  *
  * @param   mixed   $attributes チェックする値
  * @param   string  $errStr     エラー文字列
  * @param   array   $params     オプション引数
  * @return  string  エラー文字列(エラーの場合)
  * @access  public
  */
 function validate($attributes, $errStr, $params)
 {
     $this->_cabinet = $attributes["cabinet"];
     $file = $attributes["file"];
     $container =& DIContainerFactory::getContainer();
     $commonMain =& $container->getComponent("commonMain");
     $this->_fileAction =& $commonMain->registerClass(WEBAPP_DIR . '/components/file/Action.class.php', "File_Action", "fileAction");
     $this->_fileView =& $commonMain->registerClass(WEBAPP_DIR . '/components/file/View.class.php', "File_View", "fileView");
     $this->_uploadsView =& $container->getComponent("uploadsView");
     $file_path = "cabinet/" . strtolower(session_id()) . timezone_date();
     if (file_exists(FILEUPLOADS_DIR . $file_path)) {
         $result = $this->_fileAction->delDir(FILEUPLOADS_DIR . $file_path);
         if ($result === false) {
             return $errStr;
         }
     }
     mkdir(FILEUPLOADS_DIR . $file_path, octdec(_UPLOAD_FOLDER_MODE));
     $request =& $container->getComponent("Request");
     $request->setParameter("file_path", $file_path);
     $result = $this->_uploadsView->getUploadById($file["upload_id"]);
     if ($result === false) {
         return $errStr;
     }
     $upload = $result[0];
     File_Archive::extract(File_Archive::read(FILEUPLOADS_DIR . $upload["file_path"] . $upload["physical_file_name"] . "/"), $dest = FILEUPLOADS_DIR . $file_path);
     $configView =& $container->getComponent("configView");
     $config = $configView->getConfigByConfname(_SYS_CONF_MODID, "allow_extension");
     if (!isset($config["conf_value"])) {
         return $errStr;
     }
     $this->_allow_extension = $config["conf_value"];
     $cabinetView =& $container->getComponent("cabinetView");
     $used_size = $cabinetView->getUsedSize();
     if ($used_size === false) {
         return $errStr;
     }
     $total_size = $used_size;
     $result = $this->_check(FILEUPLOADS_DIR . $file_path, $total_size);
     if ($result !== true) {
         $this->_fileAction->delDir(FILEUPLOADS_DIR . $file_path);
         return $result;
     }
     $decompress_size = $this->_fileView->getSize(FILEUPLOADS_DIR . $file_path);
     if ($this->_cabinet["cabinet_max_size"] != 0 && $this->_cabinet["cabinet_max_size"] < $used_size + $decompress_size) {
         $this->_fileAction->delDir(FILEUPLOADS_DIR . $file_path);
         $suffix_compresssize = $this->_fileView->formatSize($used_size + $decompress_size);
         $suffix_maxsize = $this->_fileView->formatSize($this->_cabinet["cabinet_max_size"]);
         return sprintf(CABINET_ERROR_DECOMPRESS_MAX_SIZE, $suffix_compresssize, $suffix_maxsize);
     }
     $result = $cabinetView->checkCapacitySize($decompress_size);
     if ($result !== true) {
         $this->_fileAction->delDir(FILEUPLOADS_DIR . $file_path);
         return $result;
     }
 }
Esempio n. 10
0
 /**
  * execute実行
  *
  * @access  public
  */
 function execute()
 {
     $this->today = timezone_date(null, false, "Ymd");
     $mobile_flag = $this->session->getParameter("_mobile_flag");
     if ($mobile_flag == _ON) {
         $this->display_type = $this->session->getParameter(array("calendar_mobile", "display_type"));
     }
     $this->display_type = intval($this->display_type);
     $this->format_date = date(_INPUT_DATE_FORMAT, mktime(0, 0, 0, substr($this->date, 4, 2), substr($this->date, 6, 2), substr($this->date, 0, 4)));
     return 'success';
 }
 /**
  * 登録フォーム期限チェックバリデータ
  *
  * @param mixed $attributes チェックする値
  * @param string $errStr	 エラー文字列
  * @param array $params	 オプション引数
  * @return string エラー文字列(エラーの場合)
  * @access public
  */
 function validate($attributes, $errStr, $params)
 {
     if (empty($attributes['registration']['period'])) {
         return;
     }
     $gmt = timezone_date();
     if ($attributes['registration']['period'] <= $gmt) {
         return $errStr;
     }
     return;
 }
Esempio n. 12
0
 /**
  * カウンターをインクリメントする
  *
  * @return boolean true or false
  * @access	public
  */
 function incrementCounter()
 {
     $container =& DIContainerFactory::getContainer();
     $session =& $container->getComponent("Session");
     $params = array(timezone_date(), $session->getParameter("_site_id"), $session->getParameter("_user_id"), $session->getParameter("_handle"), $this->_request->getParameter("block_id"));
     $sql = "UPDATE {counter} SET " . "counter_num = counter_num + 1, " . "update_time = ?, " . "update_site_id = ?, " . "update_user_id = ?, " . "update_user_name = ? " . " WHERE block_id = ?";
     if (!$this->_db->execute($sql, $params)) {
         $this->_db->addError();
         return false;
     }
     return true;
 }
Esempio n. 13
0
 /**
  * execute実行
  *
  * @access  public
  */
 function execute()
 {
     $config = $this->reservationView->getMailConfig();
     if ($config === false) {
         return 'error';
     }
     if ($config["mail_send"] == _OFF) {
         return 'success';
     }
     $reserve_id = $this->session->getParameter("reservation_mail_reserve_id");
     $reserve_id = intval($reserve_id);
     if ($reserve_id == 0) {
         return 'success';
     }
     $reserve = $this->reservationView->getReserve($reserve_id);
     if ($reserve === false) {
         return 'error';
     }
     $location = $this->reservationView->getLocation($reserve["location_id"]);
     if ($location === false) {
         return 'error';
     }
     $this->mailMain->setSubject($config["mail_subject"]);
     $this->mailMain->setBody($config["mail_body"]);
     $tags["X-LOCATION_NAME"] = htmlspecialchars($reserve["location_name"]);
     $tags["X-TITLE"] = htmlspecialchars($reserve["title"]);
     if ($reserve["reserve_flag"] == RESERVATION_MEMBERS) {
         $tags["X-RESERVE_FLAG"] = RESERVATION_NO_RESERVE_FLAG;
     } else {
         $tags["X-RESERVE_FLAG"] = htmlspecialchars($reserve["page_name"]);
     }
     if ($reserve["start_date_view"] == $reserve["end_date_view"]) {
         $tags["X-RESERVE_TIME"] = $reserve["start_date_str"] . " " . sprintf(RESERVATION_TIME_FMTO_FORMAT, $reserve["start_time_str"], $reserve["end_time_str"]);
     } else {
         $tags["X-RESERVE_TIME"] = sprintf(RESERVATION_TIME_FMTO_FORMAT, $reserve["start_date_str"] . " " . $reserve["start_time_str"], $reserve["end_date_str"] . " " . $reserve["end_time_str"]);
     }
     $tags["X-CONTACT"] = htmlspecialchars($reserve["contact"]);
     $tags["X-USER"] = htmlspecialchars($reserve["insert_user_name"]);
     $tags["X-INPUT_TIME"] = timezone_date($reserve["insert_time"], false, _FULL_DATE_FORMAT);
     $tags["X-BODY"] = $reserve["description"] == "" ? RESERVATION_MAIL_NO_DISCRIPTION : $reserve["description"];
     $rrule_str = $this->reservationView->stringRRule($reserve["rrule"]);
     $tags["X-RRULE"] = $rrule_str == "" ? RESERVATION_MAIL_NO_RRULE : $rrule_str;
     $this->request->setParameter("reserve_room_id", $reserve["room_id"]);
     $block_id = $this->reservationView->getBlockIdByWhatsnew();
     $tags["X-URL"] = BASE_URL . INDEX_FILE_NAME . "?action=" . DEFAULT_ACTION . "&active_action=reservation_view_main_init" . "&reserve_id=" . $reserve_id . "&view_date=" . $reserve["start_date"] . "&block_id=" . $block_id . "#_" . $block_id;
     $this->mailMain->assign($tags);
     $users = $this->usersView->getSendMailUsers($reserve["room_id"], $config["mail_authority"]);
     $this->mailMain->setToUsers($users);
     $this->mailMain->send();
     $this->session->removeParameter("reservation_mail_reserve_id");
     return 'success';
 }
Esempio n. 14
0
 /**
  * execute実行
  *
  * @access  public
  */
 function execute()
 {
     if (empty($this->date) || !preg_match("/^([0-9]{4})([0-9]{2})([0-9]{2})\$/", $this->date, $matches) || !checkdate($matches[2], $matches[3], $matches[1])) {
         $this->date = timezone_date(null, false, "Ymd");
     }
     $this->today = timezone_date(null, false, "Ymd");
     $this->current_timestamp = mktime(0, 0, 0, substr($this->date, 4, 2), substr($this->date, 6, 2), substr($this->date, 0, 4));
     $this->plan_data = $this->calendarView->getPlanByDate($this->date, $this->date, CALENDAR_DAILY);
     if ($this->plan_data === false) {
         return 'error';
     }
     return 'success';
 }
 function execute()
 {
     //
     //削除ブロック取得
     // getDataから取得した場合、Uninstall時に複数ブロック削除した場合におかしくなるため
     // コメント
     //$blocks_obj =& $this->getData->getParameter("blocks");
     //if(!$blocks_obj) {
     $blocks =& $this->blocksView->getBlockById($this->block_id);
     $blocks_obj[$this->block_id] =& $blocks;
     //}
     $time = timezone_date();
     //$site_id = $this->session->getParameter("_site_id");
     $user_id = $this->session->getParameter("_user_id");
     $user_name = $this->session->getParameter("_handle");
     //表示カウント++
     $this->pagesAction->updShowCount($this->page_id);
     //$this->show_count++;
     // --------------------------------------
     // --- 前詰め処理(移動元)		    ---
     // --------------------------------------
     $params = array("update_time" => $time, "update_user_id" => $user_id, "update_user_name" => $user_name, "page_id" => $blocks_obj[$this->block_id]['page_id'], "block_id" => $blocks_obj[$this->block_id]['block_id'], "parent_id" => $blocks_obj[$this->block_id]['parent_id'], "col_num" => $blocks_obj[$this->block_id]['col_num'], "row_num" => $blocks_obj[$this->block_id]['row_num']);
     $result = $this->blocksAction->decrementRowNum($params);
     if (!$result) {
         return 'error';
     }
     $params_row_count = array("page_id" => $blocks_obj[$this->block_id]['page_id'], "parent_id" => $blocks_obj[$this->block_id]['parent_id'], "col_num" => $blocks_obj[$this->block_id]['col_num']);
     $count_row_num = $this->blocksView->getCountRownumByColnum($params_row_count);
     if ($count_row_num == 1) {
         //移動前の列が1つしかなかったので
         //列--
         $params = array("update_time" => $time, "update_user_id" => $user_id, "update_user_name" => $user_name, "page_id" => $blocks_obj[$this->block_id]['page_id'], "block_id" => $blocks_obj[$this->block_id]['block_id'], "parent_id" => $blocks_obj[$this->block_id]['parent_id'], "col_num" => $blocks_obj[$this->block_id]['col_num']);
         $result = $this->blocksAction->decrementColNum($params);
         if (!$result) {
             return 'error';
         }
     }
     // --------------------------------------
     // --- ブロック削除処理     	     ---
     // --------------------------------------
     $result = $this->_deleteBlock($blocks_obj[$this->block_id]);
     if (!$result) {
         return 'error';
     }
     //グループ化した空ブロック削除処理
     if ($count_row_num == 1) {
         $this->blocksAction->delGroupingBlock($blocks_obj[$this->block_id]['parent_id']);
     }
     return 'success';
 }
 /**
  * 期限チェックバリデータ
  *
  * @param   mixed   $attributes チェックする値
  * @param   string  $errStr	 エラー文字列
  * @param   array   $params	 オプション引数
  * @return  string  エラー文字列(エラーの場合)
  * @access  public
  */
 function validate($attributes, $errStr, $params)
 {
     $container =& DIContainerFactory::getContainer();
     $request =& $container->getComponent("Request");
     if (empty($attributes["period_checkbox"])) {
         $request->setParameter("period", "");
         return;
     }
     $period = $attributes["period"] . "240000";
     $period = timezone_date($period, true);
     $gmt = timezone_date();
     if ($period < $gmt) {
         return $errStr;
     }
     $request->setParameter("period", $period);
     return;
 }
Esempio n. 17
0
 /**
  * csvインポート
  *
  * @access  public
  */
 function execute()
 {
     $row_data = $this->session->getParameter(array("multidatabase_csv_data", $this->multidatabase_id));
     $this->session->removeParameter(array("multidatabase_csv_data", $this->multidatabase_id));
     $metadatas = $this->mdbView->getMetadatas(array("multidatabase_id" => intval($this->multidatabase_id)));
     if ($metadatas === false) {
         return 'error';
     }
     $insert_params = array("multidatabase_id" => $this->multidatabase_id, "temporary_flag" => _OFF);
     $display_sequence = $this->db->maxExecute("multidatabase_content", "display_sequence", array("multidatabase_id" => $this->multidatabase_id));
     foreach ($row_data as $row) {
         $display_sequence++;
         $content_id = $this->db->insertExecute("multidatabase_content", array_merge($insert_params, array("display_sequence" => $display_sequence)), true, "content_id");
         if ($content_id === false) {
             return 'error';
         }
         $count = 0;
         foreach (array_keys($metadatas) as $i) {
             if ($metadatas[$i]['type'] == MULTIDATABASE_META_TYPE_FILE || $metadatas[$i]['type'] == MULTIDATABASE_META_TYPE_IMAGE || $metadatas[$i]['type'] == MULTIDATABASE_META_TYPE_INSERT_TIME || $metadatas[$i]['type'] == MULTIDATABASE_META_TYPE_UPDATE_TIME) {
                 $row[$count] = "";
             } elseif ($metadatas[$i]['type'] == MULTIDATABASE_META_TYPE_DATE) {
                 $row[$count] = $this->mdbView->checkDate($row[$count]);
                 if (!empty($row[$count])) {
                     $row[$count] = timezone_date($row[$count] . "000000", true);
                 }
             } elseif ($metadatas[$i]['type'] == MULTIDATABASE_META_TYPE_AUTONUM) {
                 $row[$count] = $this->mdbView->getAutoNumber($metadatas[$i]['metadata_id']);
             }
             $params = array("metadata_id" => $metadatas[$i]['metadata_id'], "content_id" => $content_id, "content" => isset($row[$count]) ? $row[$count] : "");
             $metadata_content_id = $this->db->insertExecute("multidatabase_metadata_content", $params, true, "metadata_content_id");
             if ($metadata_content_id === false) {
                 return 'error';
             }
             $count++;
         }
         //--URL短縮形関連 Start--
         $container =& DIContainerFactory::getContainer();
         $abbreviateurlAction =& $container->getComponent("abbreviateurlAction");
         $result = $abbreviateurlAction->setAbbreviateUrl($this->multidatabase_id, $content_id);
         if ($result === false) {
             return 'error';
         }
         //--URL短縮形関連 End--
     }
     return 'success';
 }
Esempio n. 18
0
 /**
  * execute処理
  *
  * @access  public
  */
 function execute()
 {
     if (!isset($this->year)) {
         $this->year = timezone_date(null, false, "Y");
     }
     $this->session->setParameter("holiday_year", $this->year);
     if (!isset($this->lang)) {
         $this->lang = $this->session->getParameter("_lang");
     }
     $this->session->setParameter("holiday_lang", $this->lang);
     $this->lang_list = $this->languagesView->getLanguagesList();
     $this->holiday_list = $this->holidayView->getYear($this->year, $this->lang);
     if ($this->holiday_list === false) {
         return 'error';
     }
     $this->count = count($this->holiday_list);
     return 'success';
 }
 /**
  * パスワード紛失、メール送信処理
  *
  * @access  public
  */
 function execute()
 {
     $config = $this->configView->getConfigByCatid(_SYS_CONF_MODID, _ENTER_EXIT_CONF_CATID);
     $userInfo = LOGIN_HANDLE . _SEPARATOR2 . $this->user['handle'] . "\n" . LOGIN_NAME . _SEPARATOR2 . $this->user['login_id'] . "\n";
     if ($this->code_date == null) {
         $new_code_date = substr($this->user['password'], 0, 10);
         $mail_get_password_subject = $config['mail_get_password_subject']['conf_value'];
         $mail_get_password_body = $config['mail_get_password_body']['conf_value'];
         $mail_get_password_body .= "<br /><br />";
         $mail_get_password_body .= htmlspecialchars($userInfo) . '<br />' . BASE_URL . INDEX_FILE_NAME . '?action=login_action_main_forgetpass' . '&email=' . $this->send_email . '&code_date=' . $new_code_date . '&_header=' . _OFF . '<br />';
         $this->mailMain->setSubject($mail_get_password_subject);
         $this->mailMain->setBody($mail_get_password_body);
     } else {
         // 新規パスワード発行処理
         $newpass = $this->makePassword();
         $this->redirect_url = BASE_URL . INDEX_FILE_NAME;
         $this->redirect_message = LOGIN_MES_NEW_PASS;
         $mail_new_password_subject = $config['mail_new_password_subject']['conf_value'];
         $mail_new_password_body = $config['mail_new_password_body']['conf_value'];
         $mail_new_password_body .= "<br /><br />";
         $userInfo .= LOGIN_PASSWORD . _SEPARATOR2 . $newpass . "\n";
         $mail_new_password_body .= htmlspecialchars($userInfo) . '<br />' . '<br />' . $this->redirect_url . '<br />';
         $this->mailMain->setSubject($mail_new_password_subject);
         $this->mailMain->setBody($mail_new_password_body);
         // パスワード変更日時更新
         $params = array("password" => md5($newpass), "password_regist_time" => timezone_date());
         $where_params = array("user_id" => $this->user['user_id']);
         $result = $this->usersAction->updUsers($params, $where_params);
         if ($result === false) {
             return 'error';
         }
     }
     $this->user['email'] = $this->send_email;
     $this->user['type'] = "text";
     // Text固定(html or text)
     $this->mailMain->addToUser($this->user);
     $this->mailMain->send();
     if ($this->code_date != null) {
         $renderer =& SmartyTemplate::getInstance();
         $renderer->assign('header_field', $this->configView->getMetaHeader());
         return 'success_new_pass';
     }
     return 'success';
 }
 /**
  * validate実行
  *
  * @param   mixed   $attributes チェックする値
  * @param   string  $errStr     エラー文字列
  * @param   array   $params     オプション引数
  * @return  string  エラー文字列(エラーの場合)
  * @access  public
  */
 function validate($attributes, $errStr, $params)
 {
     $container =& DIContainerFactory::getContainer();
     $request =& $container->getComponent("Request");
     $session =& $container->getComponent("Session");
     $calendarView =& $container->getComponent("calendarView");
     $request->setParameter("today", timezone_date(null, false, "Ymd"));
     $mobile_flag = $session->getParameter("_mobile_flag");
     if ($mobile_flag == _ON) {
         return;
     }
     $block_id = $attributes["block_id"];
     $display_type = isset($attributes["display_type"]) ? intval($attributes["display_type"]) : null;
     $calendar_block = $calendarView->getBlock($display_type);
     if ($calendar_block === false) {
         return $errStr;
     }
     $request->setParameter("calendar_block", $calendar_block);
 }
 /**
  * validate処理
  *
  * @param   mixed   $attributes チェックする値
  * @param   string  $errStr     エラー文字列
  * @param   array   $params     オプション引数
  * @return  string  エラー文字列(エラーの場合)
  * @access  public
  */
 function validate($attributes, $errStr, $params)
 {
     if ($attributes["activity"] == _OFF) {
         return;
     }
     $container =& DIContainerFactory::getContainer();
     $assignmentView =& $container->getComponent("assignmentView");
     $assignment = $assignmentView->getAssignment();
     if (empty($assignment)) {
         return _INVALID_INPUT;
     }
     if (empty($assignment["period"])) {
         return;
     }
     $gmt = timezone_date();
     if ($assignment["period"] < $gmt) {
         return $errStr;
     }
     return;
 }
 /**
  * 小テスト期限切れチェックバリデータ
  *
  * @param   mixed   $attributes チェックする値
  * @param   string  $errStr     エラー文字列
  * @param   array   $params     オプション引数
  * @return  string  エラー文字列(エラーの場合)
  * @access  public
  */
 function validate($attributes, $errStr, $params)
 {
     if (empty($attributes["quiz"]["period"])) {
         return;
     }
     $gmt = timezone_date();
     if ($gmt < $attributes["quiz"]["period"]) {
         return;
     }
     $container =& DIContainerFactory::getContainer();
     $quizAction =& $container->getComponent("quizAction");
     $params = array("quiz_id" => $attributes["quiz"]["quiz_id"], "status" => QUIZ_STATUS_END_VALUE);
     if (!$quizAction->updateQuiz($params)) {
         return $errStr;
     }
     $attributes["quiz"]["status"] = QUIZ_STATUS_END_VALUE;
     $request =& $container->getComponent("Request");
     $request->setParameter("quiz", $attributes["quiz"]);
     return;
 }
 /**
  * validate実行
  *
  * @param   mixed   $attributes チェックする値
  * @param   string  $errStr     エラー文字列
  * @param   array   $params     オプション引数
  * @return  string  エラー文字列(エラーの場合)
  * @access  public
  */
 function validate($attributes, $errStr, $params)
 {
     $container =& DIContainerFactory::getContainer();
     $request =& $container->getComponent("Request");
     $actionChain =& $container->getComponent("ActionChain");
     $actionName = $actionChain->getCurActionName();
     $today = timezone_date(null, false, "Ymd");
     $request->setParameter("today", $today);
     if ($actionName == "reservation_view_main_reserve_add" || $actionName == "reservation_view_main_reserve_modify") {
         if (empty($attributes["date"])) {
             return;
         }
         $view_date = $attributes["date"];
         $key = "reserve_date";
     } else {
         if (empty($attributes["view_date"])) {
             $request->setParameter("view_date", $today);
             return;
         }
         $view_date = $attributes["view_date"];
         $key = "view_date";
     }
     if (strlen($view_date) == 8 || strlen($view_date) == 6) {
     } else {
         return $errStr;
     }
     if (strlen($view_date) == 6) {
         $view_date .= "01";
     }
     $pattern = "/^([0-9]{4})([0-9]{2})([0-9]{2})\$/";
     if (!preg_match($pattern, $view_date, $matches)) {
         return $errStr;
     }
     if ($matches[1] < RESERVATION_SELECT_MIN_YEAR) {
         $view_date = RESERVATION_SELECT_MIN_YEAR . "0101";
     }
     if ($matches[1] > RESERVATION_SELECT_MAX_YEAR - 1) {
         $view_date = RESERVATION_SELECT_MAX_YEAR - 1 . "1231";
     }
     $request->setParameter($key, $view_date);
 }
 /**
  * 期限チェックバリデータ
  *
  * @param   mixed   $attributes チェックする値
  * @param   string  $errStr     エラー文字列
  * @param   array   $params     オプション引数
  * @return  string  エラー文字列(エラーの場合)
  * @access  public
  */
 function validate($attributes, $errStr, $params)
 {
     if (empty($attributes["period"])) {
         return;
     }
     // TODO:期限の時間設定
     $attributes["period_hour"] = "24";
     $attributes["period_minute"] = "00";
     $attributes["period_hour"] = intval($attributes["period_hour"]);
     $attributes["period_minute"] = intval($attributes["period_minute"]);
     $container =& DIContainerFactory::getContainer();
     $request =& $container->getComponent("Request");
     $period = $attributes["period"] . sprintf("%02d", $attributes["period_hour"]) . sprintf("%02d", $attributes["period_minute"]) . "00";
     $period = timezone_date($period, true);
     $gmt = timezone_date();
     if ($attributes["task"]["period"] != $period && $period < $gmt) {
         return $errStr;
     }
     $request->setParameter("period", $period);
     return;
 }
 /**
  * 登録フォーム期限チェックバリデータ
  *
  * @param mixed $attributes チェックする値
  * @param string $errStr	 エラー文字列
  * @param array $params	 オプション引数
  * @return string エラー文字列(エラーの場合)
  * @access public
  */
 function validate($attributes, $errStr, $params)
 {
     // TODO:期限の時間設定
     $attributes['period_hour'] = '24';
     $attributes['period_minute'] = '00';
     $attributes['period_hour'] = intval($attributes['period_hour']);
     $attributes['period_minute'] = intval($attributes['period_minute']);
     $container =& DIContainerFactory::getContainer();
     $request =& $container->getComponent('Request');
     if (empty($attributes['period'])) {
         $request->setParameter('period', '');
         return;
     }
     $period = $attributes['period'] . sprintf('%02d', $attributes['period_hour']) . sprintf('%02d', $attributes['period_minute']) . '00';
     $period = timezone_date($period, true);
     $gmt = timezone_date();
     if ($period < $gmt) {
         return $errStr;
     }
     $request->setParameter('period', $period);
     return;
 }
 /**
  * validate実行
  *
  * @param   mixed   $attributes チェックする値
  * @param   string  $errStr     エラー文字列
  * @param   array   $params     オプション引数
  * @return  string  エラー文字列(エラーの場合)
  * @access  public
  */
 function validate($attributes, $errStr, $params)
 {
     if (empty($attributes)) {
         $attributes = timezone_date(null, false, "Ymd");
     }
     $pattern = "/^([0-9]{4})/";
     if (!preg_match($pattern, $attributes, $matches)) {
         return $errStr;
     } else {
         $year = $matches[1];
     }
     $pattern = "/^([0-9]{4})([0-9]{2})/";
     if (!preg_match($pattern, $attributes, $matches)) {
         $month = timezone_date(null, false, "m");
     } else {
         $month = $matches[2];
     }
     $pattern = "/^([0-9]{4})([0-9]{2})([0-9]{2})\$/";
     if (!preg_match($pattern, $attributes, $matches)) {
         $day = "01";
     } else {
         $day = $matches[3];
     }
     if (!checkdate($month, $day, $year)) {
         $attributes = timezone_date(null, false, "Ymd");
     } else {
         $attributes = $year . $month . $day;
     }
     if ($attributes < CALENDAR_MIN_DATE) {
         $attributes = CALENDAR_MIN_DATE;
     }
     if ($attributes > CALENDAR_MAX_DATE) {
         $attributes = CALENDAR_MAX_DATE;
     }
     $container =& DIContainerFactory::getContainer();
     $request =& $container->getComponent("Request");
     $key = $this->getKeys(0);
     $request->setParameter($key, $attributes);
 }
Esempio n. 27
0
 /**
  * execute実行
  *
  * @access  public
  */
 function execute()
 {
     $today = timezone_date(null, false, "Ymd");
     $timestamp = mktime(0, 0, 0, substr($today, 4, 2) - 1, substr($today, 6, 2), substr($today, 0, 4));
     $date_from = date("Ymd", $timestamp);
     $timestamp = mktime(0, 0, 0, substr($date_from, 4, 2), substr($date_from, 6, 2), substr($date_from, 0, 4));
     //		$this->date_from = date(_INPUT_DATE_FORMAT, $timestamp);
     $date_to = $today;
     $timestamp = mktime(0, 0, 0, substr($date_to, 4, 2), substr($date_to, 6, 2), substr($date_to, 0, 4));
     $this->date_to = date(_INPUT_DATE_FORMAT, $timestamp);
     $section_params = array('multidatabase_id' => intval($this->multidatabase_id), 'type IN (' . MULTIDATABASE_META_TYPE_SECTION . ',' . MULTIDATABASE_META_TYPE_MULTIPLE . ')' => null);
     $this->section_metadatas = $this->mdbView->getMetadatas($section_params);
     if ($this->section_metadatas === false) {
         return 'error';
     }
     $sort_params = array("multidatabase_id" => intval($this->multidatabase_id), "sort_flag" => _ON);
     $this->sort_metadatas = $this->mdbView->getMetadatas($sort_params);
     if ($this->sort_metadatas === false) {
         return 'error';
     }
     return 'success';
 }
Esempio n. 28
0
 /**
  * コメント追加
  *
  * @access  public
  */
 function execute()
 {
     if (empty($this->comment_id)) {
         $params = array("content_id" => intval($this->content_id), "comment_content" => $this->comment_content);
         $comment_id = $this->db->insertExecute("multidatabase_comment", $params, true, "comment_id");
     } else {
         $params = array("comment_content" => $this->comment_content);
         $comment_id = $this->db->updateExecute("multidatabase_comment", $params, array("comment_id" => $this->comment_id), true);
     }
     if ($comment_id === false) {
         return 'error';
     }
     //--新着情報関連 Start--
     $content = $this->db->selectExecute("multidatabase_content", array("content_id" => $this->content_id));
     if ($content === false && !isset($content[0])) {
         return 'error';
     }
     $count = $this->db->countExecute("multidatabase_comment", array("content_id" => $this->content_id));
     if ($count === false) {
         return 'error';
     }
     $multidatabase = $this->db->selectExecute("multidatabase", array("multidatabase_id" => $content[0]['multidatabase_id']));
     if (empty($multidatabase)) {
         return 'error';
     }
     $result = $this->mdbAction->getWhatsnewTitle($this->content_id, $multidatabase[0]['title_metadata_id']);
     if ($result === false) {
         return 'error';
     }
     $whatsnew = array("unique_id" => $this->content_id, "title" => $result['title'], "description" => $result['description'], "action_name" => "multidatabase_view_main_detail", "parameters" => "content_id=" . $this->content_id . "multidatabase_id=" . $content[0]["multidatabase_id"], "count_num" => $count, "child_flag" => _ON, "insert_time" => timezone_date(), "insert_user_id" => $content[0]['insert_user_id'], "insert_user_name" => $content[0]['insert_user_name']);
     $result = $this->whatsnewAction->auto($whatsnew);
     if ($result === false) {
         return 'error';
     }
     //--新着情報関連 End--
     return 'success';
 }
 /**
  * validate実行
  *
  * @param   mixed   $attributes チェックする値
  * @param   string  $errStr     エラー文字列
  * @param   array   $params     オプション引数
  * @return  string  エラー文字列(エラーの場合)
  * @access  public
  */
 function validate($attributes, $errStr, $params)
 {
     $container =& DIContainerFactory::getContainer();
     $request =& $container->getComponent("Request");
     $reservationView =& $container->getComponent("reservationView");
     // このValidatorの前にlocationTimetable Validatorが実行されていることが前提
     // 指定された時刻をGMTに修正したうえでチェック
     $start_time = timezone_date($request->getParameter('start_time'), true, 'His');
     $end_time = timezone_date($request->getParameter('end_time'), true, 'His');
     // 0:00-24:00 の場合だけあり得る
     if ($start_time == $end_time) {
         $end_time = strval(intval($end_time) + 240000);
     }
     $ret = $reservationView->getTimeframeDuplicate($attributes['timeframe_id'], $start_time, $end_time);
     if ($ret == false) {
         return $errStr;
     }
     // 差分チェックは入力データで行う
     $diff = $reservationView->TimeDiff($request->getParameter('start_time'), $request->getParameter('end_time'));
     if ($diff < RESERVATION_SELECT_MIN_TIME) {
         return RESERVATION_ERR_TIMEFRAME_MIN_TIME;
     }
     return;
 }
 /**
  * validate実行
  *
  * @param   mixed   $attributes チェックする値
  * @param   string  $errStr     エラー文字列
  * @param   array   $params     オプション引数
  * @return  string  エラー文字列(エラーの場合)
  * @access  public
  */
 function validate($attributes, $errStr, $params)
 {
     $container =& DIContainerFactory::getContainer();
     $request =& $container->getComponent("Request");
     $calendarView =& $container->getComponent("calendarView");
     $db =& $container->getComponent("DbObject");
     $actionChain =& $container->getComponent("ActionChain");
     $actionName = $actionChain->getCurActionName();
     if (!empty($attributes["plan_id"]) && $actionName == "calendar_view_main_init") {
         $params = array("plan_id" => $attributes["plan_id"]);
         $attributes["calendar_id"] = $db->minExecute("calendar_plan", "calendar_id", $params);
         $request->setParameter("calendar_id", $attributes["calendar_id"]);
     }
     if (empty($attributes["calendar_id"]) && $actionName == "calendar_view_main_init") {
         return;
     }
     $calendar_id = $attributes["calendar_id"];
     $calendar_obj = $calendarView->getCalendar($calendar_id);
     if (empty($calendar_obj) && $actionName == "calendar_view_main_init") {
         return;
     }
     if (empty($calendar_obj)) {
         return $errStr;
     }
     $request->setParameter("date", timezone_date($calendar_obj["db_start_date"] . $calendar_obj["db_start_time"], false, "Ymd"));
     $calendar_obj["rrule_str"] = $calendarView->stringRRule($calendar_obj["rrule"]);
     $calendar_obj["rrule_arr"] = $calendarView->parseRRule($calendar_obj["rrule"], true);
     $request->setParameter("calendar_obj", $calendar_obj);
     if ($actionName == "calendar_view_main_init") {
         $request->setParameter("display_type", CALENDAR_DAILY);
     } elseif ($actionName == "calendar_view_main_plan_details") {
         $params = array("plan_id" => $calendar_obj["plan_id"]);
         $rrule_calendar_id = $db->minExecute("calendar_plan", "calendar_id", $params);
         $request->setParameter("rrule_calendar_id", $rrule_calendar_id);
     }
 }