本文整理匯總了PHP中Vtiger_Util_Helper::setCalendarDefaultActivityTypesForUser方法的典型用法代碼示例。如果您正苦於以下問題:PHP Vtiger_Util_Helper::setCalendarDefaultActivityTypesForUser方法的具體用法?PHP Vtiger_Util_Helper::setCalendarDefaultActivityTypesForUser怎麽用?PHP Vtiger_Util_Helper::setCalendarDefaultActivityTypesForUser使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Vtiger_Util_Helper
的用法示例。
在下文中一共展示了Vtiger_Util_Helper::setCalendarDefaultActivityTypesForUser方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: save
/** Function to save the user information into the database
* @param $module -- module name:: Type varchar
*
*/
function save($module_name) {
global $log, $adb;
//Save entity being called with the modulename as parameter
$this->saveentity($module_name);
// Added for Reminder Popup support
$query_prev_interval = $adb->pquery("SELECT reminder_interval from vtiger_users where id=?",
array($this->id));
$prev_reminder_interval = $adb->query_result($query_prev_interval,0,'reminder_interval');
//$focus->imagename = $image_upload_array['imagename'];
$this->saveHomeStuffOrder($this->id);
SaveTagCloudView($this->id);
// Added for Reminder Popup support
$this->resetReminderInterval($prev_reminder_interval);
//Creating the Privileges Flat File
if(isset($this->column_fields['roleid'])) {
updateUser2RoleMapping($this->column_fields['roleid'],$this->id);
}
//After adding new user, set the default activity types for new user
Vtiger_Util_Helper::setCalendarDefaultActivityTypesForUser($this->id);
require_once('modules/Users/CreateUserPrivilegeFile.php');
createUserPrivilegesfile($this->id);
createUserSharingPrivilegesfile($this->id);
}
示例2: save
/** Function to save the user information into the database
* @param $module -- module name:: Type varchar
*
*/
function save($module_name)
{
$adb = PearDatabase::getInstance();
$log = vglobal('log');
//Event triggering code
require_once "include/events/include.inc";
//In Bulk mode stop triggering events
if (!self::isBulkSaveMode()) {
$em = new VTEventsManager($adb);
// Initialize Event trigger cache
$em->initTriggerCache();
$entityData = VTEntityData::fromCRMEntity($this);
$em->triggerEvent("vtiger.entity.beforesave.modifiable", $entityData);
$em->triggerEvent("vtiger.entity.beforesave", $entityData);
$em->triggerEvent("vtiger.entity.beforesave.final", $entityData);
}
if ($this->mode != 'edit') {
$sql = 'SELECT id FROM vtiger_users WHERE user_name = ? OR email1 = ?';
$result = $adb->pquery($sql, array($this->column_fields['user_name'], $this->column_fields['email1']));
if ($adb->num_rows($result) > 0) {
Vtiger_Functions::throwNewException('LBL_USER_EXISTS');
throw new WebServiceException(WebServiceErrorCode::$DATABASEQUERYERROR, vtws_getWebserviceTranslatedString('LBL_USER_EXISTS'));
return false;
}
} else {
$query = 'SELECT `roleid` FROM `vtiger_user2role` WHERE `userid` = ? LIMIT 1;';
$oldRoleResult = $adb->pquery($query, [$this->id]);
$oldRole = $adb->query_result($oldRoleResult, 0, 'roleid');
if ($oldRole != $this->column_fields['roleid']) {
$query = 'DELETE FROM `vtiger_module_dashboard_widgets` WHERE `userid` = ?;';
$adb->pquery($query, [$this->id]);
}
}
//Save entity being called with the modulename as parameter
$this->saveentity($module_name);
if ($em) {
//Event triggering code
$em->triggerEvent("vtiger.entity.aftersave", $entityData);
$em->triggerEvent("vtiger.entity.aftersave.final", $entityData);
//Event triggering code ends
}
// Added for Reminder Popup support
$query_prev_interval = $adb->pquery("SELECT reminder_interval from vtiger_users where id=?", array($this->id));
$prev_reminder_interval = $adb->query_result($query_prev_interval, 0, 'reminder_interval');
//$focus->imagename = $image_upload_array['imagename'];
$this->saveHomeStuffOrder($this->id);
SaveTagCloudView($this->id);
// Added for Reminder Popup support
$this->resetReminderInterval($prev_reminder_interval);
//Creating the Privileges Flat File
if (isset($this->column_fields['roleid'])) {
updateUser2RoleMapping($this->column_fields['roleid'], $this->id);
}
//After adding new user, set the default activity types for new user
Vtiger_Util_Helper::setCalendarDefaultActivityTypesForUser($this->id);
require_once 'modules/Users/CreateUserPrivilegeFile.php';
createUserPrivilegesfile($this->id);
createUserSharingPrivilegesfile($this->id);
}
示例3: save
/** Function to save the user information into the database
* @param $module -- module name:: Type varchar
*
*/
function save($module_name)
{
$adb = PearDatabase::getInstance();
$log = vglobal('log');
if ($this->mode != 'edit') {
$sql = 'SELECT id FROM vtiger_users WHERE user_name = ? OR email1 = ?';
$result = $adb->pquery($sql, array($this->column_fields['user_name'], $this->column_fields['email1']));
if ($adb->num_rows($result) > 0) {
Vtiger_Functions::throwNewException('LBL_USER_EXISTS');
throw new WebServiceException(WebServiceErrorCode::$DATABASEQUERYERROR, vtws_getWebserviceTranslatedString('LBL_USER_EXISTS'));
return false;
}
}
//Save entity being called with the modulename as parameter
$this->saveentity($module_name);
// Added for Reminder Popup support
$query_prev_interval = $adb->pquery("SELECT reminder_interval from vtiger_users where id=?", array($this->id));
$prev_reminder_interval = $adb->query_result($query_prev_interval, 0, 'reminder_interval');
//$focus->imagename = $image_upload_array['imagename'];
$this->saveHomeStuffOrder($this->id);
SaveTagCloudView($this->id);
// Added for Reminder Popup support
$this->resetReminderInterval($prev_reminder_interval);
//Creating the Privileges Flat File
if (isset($this->column_fields['roleid'])) {
updateUser2RoleMapping($this->column_fields['roleid'], $this->id);
}
//After adding new user, set the default activity types for new user
Vtiger_Util_Helper::setCalendarDefaultActivityTypesForUser($this->id);
require_once 'modules/Users/CreateUserPrivilegeFile.php';
createUserPrivilegesfile($this->id);
createUserSharingPrivilegesfile($this->id);
}