本文整理汇总了PHP中Calendar::assignCalendarTo方法的典型用法代码示例。如果您正苦于以下问题:PHP Calendar::assignCalendarTo方法的具体用法?PHP Calendar::assignCalendarTo怎么用?PHP Calendar::assignCalendarTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Calendar
的用法示例。
在下文中一共展示了Calendar::assignCalendarTo方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create
public function create($data)
{
// setting defaults
$data['PRO_UID'] = array_key_exists('PRO_UID', $data) ? $data['PRO_UID'] : Common::generateUID();
$data['USR_UID'] = array_key_exists('PRO_CREATE_USER', $data) ? $data['PRO_CREATE_USER'] : null;
$data['PRO_TITLE'] = array_key_exists('PRO_TITLE', $data) ? trim($data['PRO_TITLE']) : "";
$data['PRO_CATEGORY'] = array_key_exists('PRO_CATEGORY', $data) ? $data['PRO_CATEGORY'] : "";
try {
self::log("Create Process with data:", $data);
//validate if process with specified name already exists
if (Process::existsByProTitle($data["PRO_TITLE"])) {
throw new Exception\ProjectAlreadyExists($this, $data["PRO_TITLE"]);
}
// Create project
$process = new Process();
$this->proUid = $process->create($data, false);
// Call Plugins
$pluginData['PRO_UID'] = $this->proUid;
$pluginData['PRO_TEMPLATE'] = empty($data["PRO_TEMPLATE"]) ? "" : $data["PRO_TEMPLATE"];
$pluginData['PROCESSMAP'] = null;
$pluginRegistry = \PMPluginRegistry::getSingleton();
$pluginRegistry->executeTriggers(PM_NEW_PROCESS_SAVE, $pluginData);
// Save Calendar ID for this process
if (!empty($data["PRO_CALENDAR"])) {
//G::LoadClass( "calendar" );
$calendar = new \Calendar();
$calendar->assignCalendarTo($this->proUid, $data["PRO_CALENDAR"], 'PROCESS');
}
self::log("Create Process Success!");
} catch (\Exception $e) {
self::log("Exception: ", $e->getMessage(), "Trace: ", $e->getTraceAsString());
throw $e;
}
}
示例2: Calendar
$aUser = $RBAC->userObj->load($_SESSION['USER_LOGGED']);
//$_SESSION['USR_FULLNAME'] = $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'];
$oConf->aConfig = $aConf;
$oConf->saveConfig('USER_PREFERENCES', '', '', $_SESSION['USER_LOGGED']);
}
if ($_SESSION['USER_LOGGED'] == $form['USR_UID']) {
/* UPDATING SESSION VARIABLES */
$aUser = $RBAC->userObj->load($_SESSION['USER_LOGGED']);
$_SESSION['USR_FULLNAME'] = $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'];
}
//Save Calendar assigment
if (isset($form['USR_CALENDAR'])) {
//Save Calendar ID for this user
G::LoadClass("calendar");
$calendarObj = new Calendar();
$calendarObj->assignCalendarTo($aData['USR_UID'], $form['USR_CALENDAR'], 'USER');
}
$result->success = true;
print G::json_encode($result);
} catch (Exception $e) {
$result->success = false;
$result->error = $e->getMessage();
print G::json_encode($result);
}
break;
case 'userData':
require_once 'classes/model/Users.php';
$_SESSION['CURRENT_USER'] = $_POST['USR_UID'];
$oUser = new Users();
$aFields = $oUser->loadDetailed($_POST['USR_UID']);
//Load Calendar options and falue for this user
示例3: saveProperties
/**
* Save process and task propeties
*
* @param object $httpData{UID, type, property, value}
*/
public function saveProperties($httpData)
{
switch ($httpData->type) {
case 'process':
require_once 'classes/model/ProcessCategory.php';
require_once 'classes/model/CalendarDefinition.php';
G::LoadClass('processMap');
$oProcessMap = new ProcessMap();
$process['PRO_UID'] = $httpData->UID;
switch ($httpData->property) {
case 'Title':
$fieldName = 'PRO_TITLE';
break;
case 'Description':
$fieldName = 'PRO_DESCRIPTION';
break;
case 'Debug':
$fieldName = 'PRO_DEBUG';
$httpData->value = $httpData->value == 'true' ? '1' : '0';
break;
case 'Category':
$fieldName = 'PRO_CATEGORY';
$category = ProcessCategory::loadByCategoryName($httpData->value);
$httpData->value = $category['CATEGORY_UID'];
break;
case 'Calendar':
$fieldName = 'PRO_CALENDAR';
$calendar = CalendarDefinition::loadByCalendarName($httpData->value);
G::LoadClass("calendar");
$calendarObj = new Calendar();
$calendarObj->assignCalendarTo($process['PRO_UID'], $calendar['CALENDAR_UID'], 'PROCESS');
break;
}
if ($fieldName != 'PRO_CALENDAR') {
$process[$fieldName] = $httpData->value;
$oProcessMap->updateProcess($process);
}
break;
case 'task':
require_once 'classes/model/Task.php';
$oTask = new Task();
$task['TAS_UID'] = $httpData->UID;
switch ($httpData->property) {
case 'Title':
$fieldName = 'TAS_TITLE';
break;
case 'Description':
$fieldName = 'TAS_DESCRIPTION';
break;
case 'Variable for case priority':
$fieldName = 'TAS_PRIORITY_VARIABLE';
break;
case 'Starting Task':
$fieldName = 'TAS_START';
$httpData->value = strtoupper($httpData->value);
break;
}
$task[$fieldName] = $httpData->value;
$oTask->update($task);
break;
}
$this->sucess = true;
}
示例4: saveProperties
public function saveProperties($param)
{
try {
$result->sucess = true;
$result->msg = '';
switch ($param['type']) {
case 'process':
require_once 'classes/model/ProcessCategory.php';
require_once 'classes/model/CalendarDefinition.php';
G::LoadClass('processMap');
$oProcessMap = new ProcessMap();
$process['PRO_UID'] = $param['UID'];
switch ($param['property']) {
case 'Title':
$fieldName = 'PRO_TITLE';
break;
case 'Description':
$fieldName = 'PRO_DESCRIPTION';
break;
case 'Debug':
$fieldName = 'PRO_DEBUG';
$param['value'] = $param['value'] == 'true' ? '1' : '0';
break;
case 'Category':
$fieldName = 'PRO_CATEGORY';
$category = ProcessCategory::loadByCategoryName($param['value']);
$param['value'] = $category[0]['CATEGORY_UID'];
break;
case 'Calendar':
$fieldName = 'PRO_CALENDAR';
$calendar = CalendarDefinition::loadByCalendarName($param['value']);
G::LoadClass("calendar");
$calendarObj = new Calendar();
$calendarObj->assignCalendarTo($process['PRO_UID'], $calendar['CALENDAR_UID'], 'PROCESS');
break;
}
if ($fieldName != 'PRO_CALENDAR') {
$process[$fieldName] = $param['value'];
$oProcessMap->updateProcess($process);
}
break;
case 'task':
require_once 'classes/model/Task.php';
$oTask = new Task();
$task['TAS_UID'] = $param['UID'];
switch ($param['property']) {
case 'Title':
$fieldName = 'TAS_TITLE';
break;
case 'Description':
$fieldName = 'TAS_DESCRIPTION';
break;
case 'Variable for case priority':
$fieldName = 'TAS_PRIORITY_VARIABLE';
break;
case 'Starting Task':
$fieldName = 'TAS_START';
$param['value'] = strtoupper($param['value']);
break;
}
$task[$fieldName] = $param['value'];
print_r($task);
$oTask->update($task);
break;
}
} catch (Exception $e) {
$result->sucess = false;
$result->msg = $e->getMessage();
}
print G::json_encode($result);
}
示例5: ProcessMap
G::LoadClass('processMap');
$oProcessMap = new ProcessMap();
if (!isset($_POST['form']['PRO_UID'])) {
$_POST['form']['USR_UID'] = $_SESSION['USER_LOGGED'];
$oJSON = new Services_JSON();
require_once 'classes/model/Task.php';
$sProUid = $oProcessMap->createProcess($_POST['form']);
//call plugins
$oData['PRO_UID'] = $sProUid;
$oData['PRO_TEMPLATE'] = isset($_POST['form']['PRO_TEMPLATE']) && $_POST['form']['PRO_TEMPLATE'] != '' ? $_POST['form']['PRO_TEMPLATE'] : '';
$oData['PROCESSMAP'] = $oProcessMap;
$oPluginRegistry =& PMPluginRegistry::getSingleton();
$oPluginRegistry->executeTriggers(PM_NEW_PROCESS_SAVE, $oData);
G::header('location: processes_Map?PRO_UID=' . $sProUid);
die;
} else {
$_POST['form']['PRO_DYNAFORMS'] = array();
$_POST['form']['PRO_DYNAFORMS']['PROCESS'] = isset($_POST['form']['PRO_SUMMARY_DYNAFORM']) ? $_POST['form']['PRO_SUMMARY_DYNAFORM'] : '';
unset($_POST['form']['PRO_SUMMARY_DYNAFORM']);
$oProcessMap->updateProcess($_POST['form']);
$sProUid = $_POST['form']['PRO_UID'];
}
//Save Calendar ID for this process
G::LoadClass("calendar");
$calendarObj = new Calendar();
$calendarObj->assignCalendarTo($sProUid, $_POST['form']['PRO_CALENDAR'], 'PROCESS');
if ($_POST['form']['THETYPE'] == '') {
G::header('location: main');
}
break;
}
示例6: setTasCalendar
public function setTasCalendar($taskUid, $calendarUid)
{
//Save Calendar ID for this process
G::LoadClass("calendar");
$calendarObj = new Calendar();
$calendarObj->assignCalendarTo($taskUid, $calendarUid, 'TASK');
}