이 문서는 더 이상 사용되지 않는 Google Calendar API v2를 다룹니다. 최신 Google Calendar API v3에 대한 정보는 여기를 참고하세요.
동기화를 시작하기 전에 php_curl.dll 확장 기능이 활성화되어 있는지 확인하세요.
활성화되어 있지 않은 경우, 웹 서버에서 사용하는 php.ini 파일에서 다음 줄의 세미콜론을 제거하여 활성화하세요:
;extension=php_curl.dll
확장 기능이 활성화된 것을 확인한 후, 설정을 진행할 수 있습니다.
Scheduler와 Google Calendar를 동기화하려면 다음 단계를 따르세요:
서버 측:
<?php
$email = "";
$pass = "";
$cal = "";
include('google_proxy.php');
$calendar = new GoogleCalendarProxy($email, $pass, $cal);
//$calendar->map("location", "details");
$calendar->connect();
?>
값이 올바른지 다시 한번 확인하세요. 예를 들어, 캘린더 이름이 test@googlemail.com 인데 test@gmail.com 을 사용하면 오류가 발생합니다.
클라이언트 측:
scheduler.load("../gCal_proxy/server/01_proxy.php");
양방향 동기화를 위해 dataProcessor를 초기화합니다.
스크립트 파일을 하나 더 포함하세요.
<script src="../gCal_proxy/sample/codebase/dhtmlxdataprocessor.js"></script>
var dp = scheduler.createDataProcessor("../gCal_proxy/server/01_proxy.php");
dp.init(scheduler);//'scheduler'는 스케줄러 인스턴스의 이름입니다.
동기화 설정이 완료되었습니다. [rootFolder] gCal_proxy sample에 위치한 'sample.html' 파일에서 바로 사용할 수 있는 예제를 확인할 수 있습니다.
Google Calendar에서 데이터베이스로 이벤트를 내보내려면 아래 지침을 따르세요:
'export()' 함수는 Google Calendar에서 내보낸 레코드 개수를 반환합니다.
데이터베이스에서 Google Calendar로 이벤트를 가져오려면 아래 지침을 따르세요:
'import()' 함수는 Google Calendar에 가져온 레코드 개수를 반환합니다.
Google Calendar와 Scheduler는 서로 다른 필드 집합을 사용합니다. 이벤트 정보를 정확히 동기화(가져오기 또는 내보내기)하려면 두 캘린더 간에 관련 필드를 매핑해야 합니다.
기본적으로 Google Calendar와 Scheduler 간에는 다음과 같은 매핑이 존재합니다:
Google Calendar -> Scheduler
추가적인 Google Calendar 필드를 포함할 수도 있습니다:
필드 | 설명 |
canEdit | 로그인한 사용자가 이벤트를 편집할 수 있는지 여부. 값: '0' 또는 '1' |
created | Google Calendar 형식의 이벤트 생성 날짜 |
details | 이벤트 세부 정보 |
updated | Google Calendar 형식의 이벤트 마지막 업데이트 날짜 |
location | 이벤트 위치 |
status | 이벤트의 현재 상태: cancelled (이벤트 취소), confirmed (이벤트 확정), tentative (임시 일정) |
추가 정보를 포함하려면 다음 단계를 따르세요:
서버 측:
$calendar->map("location", "place");
place - 대응되는 Scheduler 필드 이름(임의로 지정 가능).
변경 후 파일을 저장하고 닫으세요.
클라이언트 측:
lightbox 섹션에:
scheduler.config.lightbox.sections=[
...
{name:"placeField", height:50, map_to:"place", type:"textarea"}
];
map_to 값은 서버 측에서 지정한 이름(위 예시에서는 "place")과 일치해야 합니다.
scheduler.locale.labels.section_placeField = 'Place';
"placeField"는 섹션 이름에 맞게 변경하세요.