本文整理汇总了PHP中Vtiger_Date_UIType类的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Date_UIType类的具体用法?PHP Vtiger_Date_UIType怎么用?PHP Vtiger_Date_UIType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Vtiger_Date_UIType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
public function save(Vtiger_Request $request)
{
$fieldId = $request->get('fieldid');
$fieldInstance = Vtiger_Field_Model::getInstance($fieldId);
$fields = ['presence', 'quickcreate', 'summaryfield', 'helpinfo', 'generatedtype', 'masseditable', 'displaytype'];
foreach ($request->getAll() as $key => $value) {
if ($key == 'mandatory') {
$fieldInstance->updateTypeofDataFromMandatory($value);
}
if (in_array($key, $fields)) {
$fieldInstance->set($key, $value);
}
}
$defaultValue = $request->get('fieldDefaultValue');
if ($fieldInstance->getFieldDataType() == 'date') {
$dateInstance = new Vtiger_Date_UIType();
$defaultValue = $dateInstance->getDBInsertedValue($defaultValue);
}
if ($request->has('fieldMask')) {
$fieldInstance->set('fieldparams', $request->get('fieldMask'));
}
if (is_array($defaultValue)) {
$defaultValue = implode(' |##| ', $defaultValue);
}
$fieldInstance->set('defaultvalue', $defaultValue);
$response = new Vtiger_Response();
try {
$fieldInstance->save();
$response->setResult(array('success' => true, 'presence' => $request->get('presence'), 'mandatory' => $fieldInstance->isMandatory(), 'label' => vtranslate($fieldInstance->get('label'), $request->get('sourceModule'))));
} catch (Exception $e) {
$response->setError($e->getCode(), $e->getMessage());
}
$response->emit();
}
示例2: preProcess
function preProcess(Vtiger_Request $request, $display = true)
{
parent::preProcess($request, false);
$viewer = $this->getViewer($request);
$menuModelsList = Vtiger_Menu_Model::getAll(true);
$selectedModule = $request->getModule();
$menuStructure = Vtiger_MenuStructure_Model::getInstanceFromMenuList($menuModelsList, $selectedModule);
$companyDetails = Vtiger_CompanyDetails_Model::getInstanceById();
$companyLogo = $companyDetails->getLogo();
$currentDate = Vtiger_Date_UIType::getDisplayDateValue(date('Y-n-j'));
$viewer->assign('CURRENTDATE', $currentDate);
$viewer->assign('MODULE', $selectedModule);
$viewer->assign('MODULE_NAME', $selectedModule);
$viewer->assign('QUALIFIED_MODULE', $selectedModule);
$viewer->assign('PARENT_MODULE', $request->get('parent'));
$viewer->assign('VIEW', $request->get('view'));
// Order by pre-defined automation process for QuickCreate.
uksort($menuModelsList, array('Vtiger_MenuStructure_Model', 'sortMenuItemsByProcess'));
$viewer->assign('MENUS', $menuModelsList);
$viewer->assign('MENU_STRUCTURE', $menuStructure);
$viewer->assign('MENU_SELECTED_MODULENAME', $selectedModule);
$viewer->assign('MENU_TOPITEMS_LIMIT', $menuStructure->getLimit());
$viewer->assign('COMPANY_LOGO', $companyLogo);
$viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
$homeModuleModel = Vtiger_Module_Model::getInstance('Home');
$viewer->assign('HOME_MODULE_MODEL', $homeModuleModel);
$viewer->assign('HEADER_LINKS', $this->getHeaderLinks());
$viewer->assign('ANNOUNCEMENT', $this->getAnnouncement());
$viewer->assign('SEARCHABLE_MODULES', Vtiger_Module_Model::getSearchableModules());
if ($display) {
$this->preProcessDisplay($request);
}
}
示例3: process
public function process(Vtiger_Request $request)
{
$currentUser = Users_Record_Model::getCurrentUserModel();
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$linkId = $request->get('linkid');
$createdTime = $request->get('createdtime');
$owner = $request->get('owner');
//Date conversion from user to database format
if (!empty($createdTime)) {
$dates['start'] = Vtiger_Date_UIType::getDBInsertedValue($createdTime['start']);
$dates['end'] = Vtiger_Date_UIType::getDBInsertedValue($createdTime['end']);
}
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
$data = $moduleModel->getLeadsCreated($owner, $dates);
$widget = Vtiger_Widget_Model::getInstance($linkId, $currentUser->getId());
//Include special script and css needed for this widget
$viewer->assign('SCRIPTS', $this->getHeaderScripts($request));
$viewer->assign('WIDGET', $widget);
$viewer->assign('MODULE_NAME', $moduleName);
$viewer->assign('DATA', $data);
$viewer->assign('CURRENTUSER', $currentUser);
$accessibleUsers = $currentUser->getAccessibleUsersForModule('Leads');
$viewer->assign('ACCESSIBLE_USERS', $accessibleUsers);
$content = $request->get('content');
if (!empty($content)) {
$viewer->view('dashboards/DashBoardWidgetContents.tpl', $moduleName);
} else {
$viewer->view('dashboards/LeadsCreated.tpl', $moduleName);
}
}
示例4: getListViewEntries
public function getListViewEntries($pagingModel)
{
$db = PearDatabase::getInstance();
$moduleModel = Vtiger_Module_Model::getInstance('Portal');
$listQuery = $this->getQuery();
$startIndex = $pagingModel->getStartIndex();
$pageLimit = $pagingModel->getPageLimit();
$orderBy = $this->get('orderby');
$sortOrder = $this->get('sortorder');
if (!empty($orderBy)) {
$listQuery .= ' ORDER BY ' . $orderBy . ' ' . $sortOrder;
}
$listQuery .= " LIMIT {$startIndex}," . $pageLimit;
$listResult = $db->pquery($listQuery, array());
$listViewEntries = array();
while ($row = $db->fetchByAssoc($listResult)) {
$listViewEntries[$row['portalid']] = array();
$listViewEntries[$row['portalid']]['portalname'] = $row['portalname'];
$listViewEntries[$row['portalid']]['portalurl'] = $row['portalurl'];
$listViewEntries[$row['portalid']]['createdtime'] = Vtiger_Date_UIType::getDisplayDateValue($row['createdtime']);
}
$index = 0;
foreach ($listViewEntries as $recordId => $record) {
$rawData = $db->query_result_rowdata($listResult, $index++);
$record['id'] = $recordId;
$listViewRecordModels[$recordId] = $moduleModel->getRecordFromArray($record, $rawData);
}
return $listViewRecordModels;
}
示例5: process
public function process(Vtiger_Request $request)
{
$currentUser = Users_Record_Model::getCurrentUserModel();
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$linkId = $request->get('linkid');
$owner = $request->get('owner');
$dates = $request->get('expectedclosedate');
//Date conversion from user to database format
if (!empty($dates)) {
$dates['start'] = Vtiger_Date_UIType::getDBInsertedValue($dates['start']);
$dates['end'] = Vtiger_Date_UIType::getDBInsertedValue($dates['end']);
}
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
$data = $moduleModel->getCampaignsWidget($owner, $dates);
$listViewUrl = $moduleModel->getListViewUrl();
for ($i = 0; $i < count($data); $i++) {
$data[$i][] = $listViewUrl . $this->getSearchParams($data[$i][0], $owner, $dates);
}
$widget = Vtiger_Widget_Model::getInstance($linkId, $currentUser->getId());
$viewer->assign('WIDGET', $widget);
$viewer->assign('MODULE_NAME', $moduleName);
$viewer->assign('DATA', $data);
//Include special script and css needed for this widget
$viewer->assign('STYLES', $this->getHeaderCss($request));
$viewer->assign('CURRENTUSER', $currentUser);
$content = $request->get('content');
if (!empty($content)) {
$viewer->view('dashboards/CampaignsWidget.tpl', $moduleName);
} else {
$viewer->view('dashboards/CampaignsWidget.tpl', $moduleName);
}
}
示例6: process
public function process(Vtiger_Request $request)
{
$currentUser = Users_Record_Model::getCurrentUserModel();
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$linkId = $request->get('linkid');
$owner = $request->get('owner');
$dates = $request->get('expectedclosedate');
//Date conversion from user to database format
if (!empty($dates)) {
$dates['start'] = Vtiger_Date_UIType::getDBInsertedValue($dates['start']);
$dates['end'] = Vtiger_Date_UIType::getDBInsertedValue($dates['end']);
}
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
$data = $moduleModel->getPotentialsCountBySalesStage($owner, $dates);
$widget = Vtiger_Widget_Model::getInstance($linkId, $currentUser->getId());
$viewer->assign('WIDGET', $widget);
$viewer->assign('MODULE_NAME', $moduleName);
$viewer->assign('DATA', $data);
//Include special script and css needed for this widget
$viewer->assign('SCRIPTS', $this->getHeaderScripts($request));
$viewer->assign('STYLES', $this->getHeaderCss($request));
$viewer->assign('CURRENTUSER', $currentUser);
$content = $request->get('content');
if (!empty($content)) {
$viewer->view('dashboards/DashBoardWidgetContents.tpl', $moduleName);
} else {
$viewer->view('dashboards/GroupBySalesStage.tpl', $moduleName);
}
}
示例7: process
public function process(Vtiger_Request $request)
{
$currentUser = Users_Record_Model::getCurrentUserModel();
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$linkId = $request->get('linkid');
$expectedclosedate = $request->get('expectedclosedate');
//Date conversion from user to database format
if (!empty($expectedclosedate)) {
$closingdates['start'] = Vtiger_Date_UIType::getDBInsertedValue($expectedclosedate['start']);
$closingdates['end'] = Vtiger_Date_UIType::getDBInsertedValue($expectedclosedate['end']);
}
$createdTime = $request->get('createdtime');
//Date conversion from user to database format
if (!empty($createdTime)) {
$dates['start'] = Vtiger_Date_UIType::getDBInsertedValue($createdTime['start']);
$dates['end'] = Vtiger_Date_UIType::getDBInsertedValue($createdTime['end']);
}
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
$data = $moduleModel->getForecast($closingdates, $dates);
$widget = Vtiger_Widget_Model::getInstance($linkId, $currentUser->getId());
//Include special script and css needed for this widget
$viewer->assign('SCRIPTS', $this->getHeaderScripts($request));
$viewer->assign('WIDGET', $widget);
$viewer->assign('MODULE_NAME', $moduleName);
$viewer->assign('DATA', $data);
$content = $request->get('content');
if (!empty($content)) {
$viewer->view('dashboards/DashBoardWidgetContents.tpl', $moduleName);
} else {
$viewer->view('dashboards/Forecast.tpl', $moduleName);
}
}
示例8: process
public function process(Vtiger_Request $request)
{
$currentUser = Users_Record_Model::getCurrentUserModel();
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$linkId = $request->get('linkid');
$data = $request->get('data');
$createdTime = $request->get('createdtime');
//Date conversion from user to database format
if (!empty($createdTime)) {
$dates['start'] = Vtiger_Date_UIType::getDBInsertedValue($createdTime['start']);
$dates['end'] = Vtiger_Date_UIType::getDBInsertedValue($createdTime['end']);
}
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
$data = $moduleModel->getCountriesByRating($request->get('owner'), $dates);
$listViewUrl = $moduleModel->getListViewUrl();
for ($i = 0; $i < count($data); $i++) {
$data[$i]["links"] = $listViewUrl . $this->getSearchParams($data[$i][2], $request->get('owner'), $dates);
}
$widget = Vtiger_Widget_Model::getInstance($linkId, $currentUser->getId());
//Include special script and css needed for this widget
$viewer->assign('WIDGET', $widget);
$viewer->assign('MODULE_NAME', $moduleName);
$viewer->assign('DATA', $data);
$viewer->assign('CURRENTUSER', $currentUser);
$accessibleUsers = $currentUser->getAccessibleUsersForModule($moduleName);
$viewer->assign('ACCESSIBLE_USERS', $accessibleUsers);
$content = $request->get('content');
if (!empty($content)) {
$viewer->view('dashboards/DashBoardWidgetContents.tpl', $moduleName);
} else {
$viewer->view('dashboards/CountriesByRating.tpl', $moduleName);
}
}
示例9: preProcess
function preProcess(Vtiger_Request $request, $display = true)
{
parent::preProcess($request, false);
$viewer = $this->getViewer($request);
$selectedModule = $request->getModule();
$companyDetails = Vtiger_CompanyDetails_Model::getInstanceById();
$companyLogo = $companyDetails->getLogo();
$currentDate = Vtiger_Date_UIType::getDisplayDateValue(date('Y-n-j'));
$viewer->assign('CURRENTDATE', $currentDate);
$viewer->assign('MODULE', $selectedModule);
$viewer->assign('MODULE_NAME', $selectedModule);
$viewer->assign('QUALIFIED_MODULE', $selectedModule);
$viewer->assign('PARENT_MODULE', $request->get('parent'));
$viewer->assign('MENUS', Vtiger_Menu_Model::getAll(true));
$viewer->assign('VIEW', $request->get('view'));
$viewer->assign('COMPANY_LOGO', $companyLogo);
$viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
$homeModuleModel = Vtiger_Module_Model::getInstance('Home');
$viewer->assign('HOME_MODULE_MODEL', $homeModuleModel);
$viewer->assign('HEADER_LINKS', $this->getHeaderLinks());
$viewer->assign('ANNOUNCEMENT', $this->getAnnouncement());
$viewer->assign('SEARCHABLE_MODULES', Vtiger_Module_Model::getSearchableModules());
$viewer->assign('CHAT_ACTIVE', vtlib_isModuleActive('AJAXChat'));
if ($display) {
$this->preProcessDisplay($request);
}
}
示例10: preProcess
public function preProcess(Vtiger_Request $request, $display=true) {
if($this->checkPermission($request)) {
$viewer = $this->getViewer($request);
$currentUser = Users_Record_Model::getCurrentUserModel();
$selectedModule = $request->getModule();
$companyDetails = Vtiger_CompanyDetails_Model::getInstanceById();
$companyLogo = $companyDetails->getLogo();
$currentDate = Vtiger_Date_UIType::getDisplayDateValue(date('Y-n-j'));
$viewer->assign('CURRENTDATE', $currentDate);
$viewer->assign('MODULE', $selectedModule);
$viewer->assign('MODULE_NAME', $selectedModule);
$viewer->assign('QUALIFIED_MODULE', $selectedModule);
$viewer->assign('PARENT_MODULE', $request->get('parent'));
$viewer->assign('MENUS', Vtiger_Menu_Model::getAll(true));
$viewer->assign('VIEW', $request->get('view'));
$viewer->assign('COMPANY_LOGO',$companyLogo);
$viewer->assign('USER_MODEL', $currentUser);
$homeModuleModel = Vtiger_Module_Model::getInstance('Home');
$viewer->assign('HOME_MODULE_MODEL', $homeModuleModel);
$viewer->assign('HEADER_LINKS',$this->getHeaderLinks());
$viewer->assign('ANNOUNCEMENT', $this->getAnnouncement());
$viewer->assign('SEARCHABLE_MODULES', Vtiger_Module_Model::getSearchableModules());
$viewer->assign('CHAT_ACTIVE', vtlib_isModuleActive('AJAXChat'));
//Additional parameters
$recordId = $request->get('record');
$moduleName = $request->getModule();
$detailViewModel = Vtiger_DetailView_Model::getInstance($moduleName, $recordId);
$recordModel = $detailViewModel->getRecord();
$detailViewLinkParams = array('MODULE'=>$moduleName,'RECORD'=>$recordId);
$detailViewLinks = $detailViewModel->getDetailViewLinks($detailViewLinkParams);
$viewer->assign('RECORD', $recordModel);
$viewer->assign('MODULE_MODEL', $detailViewModel->getModule());
$viewer->assign('DETAILVIEW_LINKS', $detailViewLinks);
$viewer->assign('IS_EDITABLE', $detailViewModel->getRecord()->isEditable($moduleName));
$viewer->assign('IS_DELETABLE', $detailViewModel->getRecord()->isDeletable($moduleName));
$linkParams = array('MODULE'=>$moduleName, 'ACTION'=>$request->get('view'));
$linkModels = $detailViewModel->getSideBarLinks($linkParams);
$viewer->assign('QUICK_LINKS', $linkModels);
$viewer->assign('PAGETITLE', $this->getPageTitle($request));
$viewer->assign('FOOTER_SCRIPTS',$this->getFooterScripts($request));
$viewer->assign('STYLES',$this->getHeaderCss($request));
$viewer->assign('LANGUAGE_STRINGS', $this->getJSLanguageStrings($request));
$viewer->assign('CURRENT_VIEW', $request->get('view'));
$viewer->assign('SKIN_PATH', Vtiger_Theme::getCurrentUserThemePath());
$viewer->assign('HTMLLANG', Vtiger_Language_Handler::getShortLanguageName());
$viewer->assign('LANGUAGE', $currentUser->get('language'));
$viewer->assign('HEADER_SCRIPTS',$this->getHeaderScripts($request));
if($display) {
$this->preProcessDisplay($request);
}
}
}
示例11: if
<?php if ($_valid && !is_callable('content_56059e760aa14')) {function content_56059e760aa14($_smarty_tpl) {?>
<?php $_smarty_tpl->tpl_vars["dateFormat"] = new Smarty_variable($_smarty_tpl->tpl_vars['USER_MODEL']->value->get('date_format'), null, 0);?>
<?php $_smarty_tpl->tpl_vars["currentDate"] = new Smarty_variable(Vtiger_Date_UIType::getDisplayDateValue(''), null, 0);?>
<?php $_smarty_tpl->tpl_vars["time"] = new Smarty_variable(Vtiger_Time_UIType::getDisplayTimeValue(null), null, 0);?>
<?php $_smarty_tpl->tpl_vars["currentTimeInVtigerFormat"] = new Smarty_variable(Vtiger_Time_UIType::getTimeValueInAMorPM($_smarty_tpl->tpl_vars['time']->value), null, 0);?>
<?php if ($_smarty_tpl->tpl_vars['COUNTER']->value==2){?>
</tr><tr class="<?php if (!($_smarty_tpl->tpl_vars['SHOW_FOLLOW_UP']->value)){?>hide <?php }?>followUpContainer massEditActiveField">
<?php $_smarty_tpl->tpl_vars['COUNTER'] = new Smarty_variable(1, null, 0);?>
<?php }else{ ?>
<?php $_smarty_tpl->tpl_vars['COUNTER'] = new Smarty_variable($_smarty_tpl->tpl_vars['COUNTER']->value+1, null, 0);?>
<?php }?>
<?php ob_start();?><?php echo vtranslate('LBL_HOLD_FOLLOWUP_ON',$_smarty_tpl->tpl_vars['MODULE']->value);?>
<?php $_tmp1=ob_get_clean();?><?php $_smarty_tpl->tpl_vars['FOLLOW_UP_LABEL'] = new Smarty_variable($_tmp1, null, 0);?>
<td class="fieldLabel">
<label class="muted pull-right marginRight10px">
<input name="followup" type="checkbox" class="alignTop" <?php if ($_smarty_tpl->tpl_vars['FOLLOW_UP_STATUS']->value){?> checked<?php }?>/>
<?php echo $_smarty_tpl->tpl_vars['FOLLOW_UP_LABEL']->value;?>
</label>
</td>
<?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['FOLLOW_UP_LABEL']->value;?>
<?php $_tmp2=ob_get_clean();?><?php $_smarty_tpl->createLocalArrayVariable('FIELD_INFO', null, 0);
$_smarty_tpl->tpl_vars['FIELD_INFO']->value['label'] = $_tmp2;?>
<td class="fieldValue">
<div>
<div class="input-append row-fluid">
<div class="span10 row-fluid date">
<input name="followup_date_start" type="text" class="span9 dateField" data-date-format="<?php echo $_smarty_tpl->tpl_vars['dateFormat']->value;?>
" type="text" data-fieldinfo= '<?php echo Vtiger_Util_Helper::toSafeHTML(ZEND_JSON::encode($_smarty_tpl->tpl_vars['FIELD_INFO']->value));?>
'
value="<?php if (!empty($_smarty_tpl->tpl_vars['FOLLOW_UP_DATE']->value)){?><?php echo $_smarty_tpl->tpl_vars['FOLLOW_UP_DATE']->value;?>
<?php }else{ ?><?php echo $_smarty_tpl->tpl_vars['currentDate']->value;?>
<?php }?>" data-validation-engine="validate[funcCall[Vtiger_greaterThanDependentField_Validator_Js.invokeValidation]]" />
<span class="add-on"><i class="icon-calendar"></i></span>
</div>
</div>
</div>
<div>
<div class="input-append time">
<input type="text" name="followup_time_start" class="timepicker-default input-small"
value="<?php if (!empty($_smarty_tpl->tpl_vars['FOLLOW_UP_TIME']->value)){?><?php echo $_smarty_tpl->tpl_vars['FOLLOW_UP_TIME']->value;?>
<?php }else{ ?><?php echo $_smarty_tpl->tpl_vars['currentTimeInVtigerFormat']->value;?>
<?php }?>" />
<span class="add-on cursorPointer">
<i class="icon-time"></i>
</span>
</div>
</div>
</td>
<td></td><td></td><?php }} ?>
开发者ID:jeremyevans6,项目名称:kulturedTiger-,代码行数:50,代码来源:049059a7f7cc56add07f33ccecce5661b1f7109b.file.FollowUp.tpl.php
示例12: preProcess
public function preProcess(Vtiger_Request $request, $display = true)
{
if ($this->checkPermission($request)) {
$currentUser = Users_Record_Model::getCurrentUserModel();
$viewer = $this->getViewer($request);
$selectedModule = $request->getModule();
$companyDetails = Vtiger_CompanyDetails_Model::getInstanceById();
$companyLogo = $companyDetails->getLogo();
$currentDate = Vtiger_Date_UIType::getDisplayDateValue(date('Y-n-j'));
$viewer->assign('CURRENTDATE', $currentDate);
$viewer->assign('MODULE', $selectedModule);
$viewer->assign('MODULE_NAME', $selectedModule);
$viewer->assign('QUALIFIED_MODULE', $selectedModule);
$viewer->assign('PARENT_MODULE', $request->get('parent'));
$viewer->assign('MENUS', Vtiger_Menu_Model::getAll(true));
$viewer->assign('VIEW', $request->get('view'));
$viewer->assign('COMPANY_LOGO', $companyLogo);
$viewer->assign('USER_MODEL', $currentUser);
$homeModuleModel = Vtiger_Module_Model::getInstance('Home');
$viewer->assign('HOME_MODULE_MODEL', $homeModuleModel);
$viewer->assign('HEADER_LINKS', $this->getHeaderLinks());
$viewer->assign('ANNOUNCEMENT', $this->getAnnouncement());
$viewer->assign('SEARCHABLE_MODULES', Vtiger_Module_Model::getSearchableModules());
$viewer->assign('CHAT_ACTIVE', vtlib_isModuleActive('AJAXChat'));
//Additional parameters
$viewer->assign('CURRENT_VIEW', $request->get('view'));
$viewer->assign('PAGETITLE', $this->getPageTitle($request));
$viewer->assign('FOOTER_SCRIPTS', $this->getFooterScripts($request));
$viewer->assign('STYLES', $this->getHeaderCss($request));
$viewer->assign('LANGUAGE_STRINGS', $this->getJSLanguageStrings($request));
$viewer->assign('SKIN_PATH', Vtiger_Theme::getCurrentUserThemePath());
$viewer->assign('IS_PREFERENCE', true);
$viewer->assign('HTMLLANG', Vtiger_Language_Handler::getShortLanguageName());
$viewer->assign('LANGUAGE', $currentUser->get('language'));
$allUsers = Users_Record_Model::getAll(true);
$sharedUsers = Calendar_Module_Model::getCaledarSharedUsers($currentUser->id);
$sharedType = Calendar_Module_Model::getSharedType($currentUser->id);
$viewer->assign('ALL_USERS', $allUsers);
$viewer->assign('SHAREDUSERS', $sharedUsers);
$viewer->assign('SHARED_TYPE', $sharedType);
$viewer->assign('HEADER_SCRIPTS', $this->getHeaderScripts($request));
if ($display) {
$this->preProcessDisplay($request);
}
}
}
示例13: save
public function save(Vtiger_Request $request)
{
$fieldId = $request->get('fieldid');
$fieldInstance = Vtiger_Field_Model::getInstance($fieldId);
$fieldInstance->updateTypeofDataFromMandatory($request->get('mandatory'))->set('presence', $request->get('presence'))->set('quickcreate', $request->get('quickcreate'))->set('summaryfield', $request->get('summaryfield'))->set('masseditable', $request->get('masseditable'));
$defaultValue = $request->get('fieldDefaultValue');
if ($fieldInstance->getFieldDataType() == 'date') {
$dateInstance = new Vtiger_Date_UIType();
$defaultValue = $dateInstance->getDBInsertedValue($defaultValue);
}
if (is_array($defaultValue)) {
$defaultValue = implode(' |##| ', $defaultValue);
}
$fieldInstance->set('defaultvalue', $defaultValue);
$response = new Vtiger_Response();
try {
$fieldInstance->save();
$response->setResult(array('success' => true, 'presence' => $request->get('presence'), 'mandatory' => $fieldInstance->isMandatory(), 'label' => vtranslate($fieldInstance->get('label'), $request->get('sourceModule'))));
} catch (Exception $e) {
$response->setError($e->getCode(), $e->getMessage());
}
$response->emit();
}
示例14: process
public function process(Vtiger_Request $request)
{
$currentUser = Users_Record_Model::getCurrentUserModel();
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$linkId = $request->get('linkid');
$data = $request->get('data');
$createdTime = $request->get('createdtime');
$widget = Vtiger_Widget_Model::getInstance($linkId, $currentUser->getId());
if (!$request->has('owner')) {
$owner = Settings_WidgetsManagement_Module_Model::getDefaultUserId($widget, 'Leads');
} else {
$owner = $request->get('owner');
}
$ownerForwarded = $owner;
if ($owner == 'all') {
$owner = '';
}
//Date conversion from user to database format
if (!empty($createdTime)) {
$dates['start'] = Vtiger_Date_UIType::getDBInsertedValue($createdTime['start']);
$dates['end'] = Vtiger_Date_UIType::getDBInsertedValue($createdTime['end']);
}
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
$data = $owner === false ? array() : $moduleModel->getLeadsByStatusConverted($owner, $dates);
$listViewUrl = $moduleModel->getListViewUrl();
for ($i = 0; $i < count($data); $i++) {
$data[$i]["links"] = $listViewUrl . $this->getSearchParams($data[$i][2], $owner, $dates);
}
//Include special script and css needed for this widget
$viewer->assign('WIDGET', $widget);
$viewer->assign('MODULE_NAME', $moduleName);
$viewer->assign('DATA', $data);
$viewer->assign('CURRENTUSER', $currentUser);
$accessibleUsers = $currentUser->getAccessibleUsersForModule('Leads');
$accessibleGroups = $currentUser->getAccessibleGroupForModule('Leads');
$viewer->assign('ACCESSIBLE_USERS', $accessibleUsers);
$viewer->assign('ACCESSIBLE_GROUPS', $accessibleGroups);
$viewer->assign('OWNER', $ownerForwarded);
$content = $request->get('content');
if (!empty($content)) {
$viewer->view('dashboards/DashBoardWidgetContents.tpl', $moduleName);
} else {
$viewer->view('dashboards/LeadsByStatusConverted.tpl', $moduleName);
}
}
示例15: getDrafts
public function getDrafts($page, $limit, $folder, $where = null)
{
$currentUserModel = Users_Record_Model::getCurrentUserModel();
$handler = vtws_getModuleHandlerFromName('Emails', $currentUserModel);
$meta = $handler->getMeta();
if (!$meta->hasReadAccess()) {
return false;
}
if (!empty($page)) {
$limitClause = "LIMIT " . $limit * $page . ", " . $limit;
} else {
$limitClause = "LIMIT 0, " . $limit;
}
$query = "SELECT * FROM Emails where email_flag='SAVED' {$where} {$limitClause};";
$draftMails = vtws_query($query, $currentUserModel);
for ($i = 0; $i < count($draftMails); $i++) {
foreach ($draftMails[$i] as $fieldname => $fieldvalue) {
if ($fieldname == "saved_toid" || $fieldname == "ccmail" || $fieldname == "bccmail") {
if (!empty($fieldvalue)) {
$value = implode(',', Zend_Json::decode($fieldvalue));
if (strlen($value) > 45) {
$value = substr($value, 0, 45) . "....";
}
$draftMails[$i][$fieldname] = $value;
}
} elseif ($fieldname == "date_start") {
if (!empty($fieldvalue)) {
$value = Vtiger_Date_UIType::getDisplayDateValue($fieldvalue);
$draftMails[$i][$fieldname] = $value;
}
} elseif ($fieldname == "id") {
$emailId = vtws_getIdComponents($fieldvalue);
$draftMails[$i][$fieldname] = $emailId[1];
}
}
}
if ($where) {
$folder->setPaging($limit * $page + 1, $limit * $page + $limit, $limit, count($draftMails), $page);
} else {
$total = $this->getTotalDraftCount();
$folder->setPaging($limit * $page + 1, $limit * $page + $limit, $limit, $total, $page);
}
$folder->setMails($draftMails);
return $draftMails;
}