本文整理汇总了PHP中Vtiger_Date_UIType类的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Date_UIType类的具体用法?PHP Vtiger_Date_UIType怎么用?PHP Vtiger_Date_UIType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Vtiger_Date_UIType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
}
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:34,代码来源:Field.php
示例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);
}
}
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:33,代码来源:Basic.php
示例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);
}
}
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:31,代码来源:LeadsCreated.php
示例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;
}
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:29,代码来源:ListView.php
示例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);
}
}
开发者ID:yozhi,项目名称:YetiForceCRM,代码行数:33,代码来源:CampaignsWidget.php
示例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);
}
}
开发者ID:nouphet,项目名称:vtigercrm-6.0.0-ja,代码行数:30,代码来源:GroupedBySalesStage.php
示例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);
}
}
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:33,代码来源:Forecast.php
示例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);
}
}
开发者ID:andreadanzi,项目名称:sws,代码行数:34,代码来源:CountriesByRating.php
示例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);
}
}
开发者ID:artisan4710,项目名称:YetiForceCRM,代码行数:27,代码来源:Basic.php
示例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);
}
}
}
开发者ID:rubichcube,项目名称:YetiForceCRM,代码行数:55,代码来源:PreferenceDetail.php
示例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);
}
}
}
开发者ID:rubichcube,项目名称:YetiForceCRM,代码行数:50,代码来源:PreferenceEdit.php
示例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();
}
开发者ID:nouphet,项目名称:vtigercrm-6.0.0-ja,代码行数:23,代码来源:Field.php
示例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);
}
}
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:46,代码来源:LeadsByStatusConverted.php
示例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;
}
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:45,代码来源:Draft.php
示例16: process
public function process(Vtiger_Request $request)
{
$currentUser = Users_Record_Model::getCurrentUserModel();
$viewer = $this->getViewer($request);
$moduleName = "ITS4YouReports";
$recordId = $request->get("record");
$viewer->assign('recordid', $recordId);
$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);
$recordModel = ITS4YouReports_Record_Model::getInstanceById($recordId);
$data = $moduleModel->getReports4You($recordId, $request->get('smownerid'), $dates);
$detailViewUrl = 'index.php?module=ITS4YouReports&view=Detail&record=' . $recordId;
$viewer->assign('detailViewUrl', $detailViewUrl);
//echo "<pre>";print_r("<textarea>".$data."</textarea>");echo "</pre>";
$widget = Vtiger_Widget_Model::getInstance($linkId, $currentUser->getId());
$widget->set('title', $recordModel->getName());
//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');
$viewer->assign('ACCESSIBLE_USERS', $accessibleUsers);
$viewer->assign('SETTING_EXIST', false);
$content = $request->get('content');
if (!empty($content)) {
$display_widget_header = false;
} else {
$display_widget_header = true;
}
$viewer->assign('display_widget_header', $display_widget_header);
$viewer->view('dashboards/DashBoardWidgetContents.tpl', $moduleName);
}
开发者ID:cin-system,项目名称:cinrepo,代码行数:40,代码来源:GetReports.php
示例17: process
public function process(Vtiger_Request $request)
{
$log = vglobal('log');
$log->debug('Start ' . __CLASS__ . ':' . __FUNCTION__);
$db = PearDatabase::getInstance();
$qualifiedModule = $request->getModule(false);
$moduleModel = Settings_CurrencyUpdate_Module_Model::getCleanInstance();
$currentUser = Users_Record_Model::getCurrentUserModel();
// synchronise bank list
$moduleModel->refreshBanks();
$downloadBtn = !$request->isEmpty('download') ? $request->get('download') : false;
$date = !$request->isEmpty('duedate') ? Vtiger_Datetime_UIType::getDBInsertedValue($request->get('duedate')) : false;
$dateCur = '';
if ($date) {
// if its future date change it to present one
if (strtotime($date) > strtotime(date('Y-m-d'))) {
$date = date('Y-m-d');
}
$dateCur = $date;
} else {
$dateCur = date('Y-m-d');
}
// take currency rates for yesterday
if (strcmp(date('Y-m-d'), $dateCur) == 0) {
$dateCur = strtotime("-1 day", strtotime($dateCur));
$dateCur = date('Y-m-d', $dateCur);
}
$dateCur = Vtiger_Functions::getLastWorkingDay($dateCur);
// get currency if not already archived
if ($downloadBtn) {
$moduleModel->fetchCurrencyRates($dateCur);
}
$selectBankId = $moduleModel->getActiveBankId();
$history = $moduleModel->getRatesHistory($selectBankId, $dateCur, $request);
$bankTab = array();
$bankSQL = "SELECT * FROM yetiforce_currencyupdate_banks";
$bankResult = $db->query($bankSQL, true);
$i = 0;
while ($row = $db->fetchByAssoc($bankResult)) {
$bankTab[$i]['id'] = $row['id'];
$bankName = $row['bank_name'];
$bankTab[$i]['bank_name'] = $bankName;
$bankTab[$i]['active'] = $row['active'];
$i++;
}
// number of currencies
$curr_num = $moduleModel->getCurrencyNum();
// get info about main currency
$mainCurrencyInfo = Vtiger_Functions::getDefaultCurrencyInfo();
$viewer = $this->getViewer($request);
$viewer->assign('QUALIFIED_MODULE', $qualifiedModule);
$viewer->assign('USER_MODEL', $currentUser);
$viewer->assign('MODULE_MODEL', $moduleModel);
$viewer->assign('MODULENAME', 'CurrencyUpdate');
$viewer->assign('DATE', $request->has('duedate') ? Vtiger_Date_UIType::getDisplayValue($dateCur) : '');
$viewer->assign('CURRNUM', $curr_num);
$viewer->assign('BANK', $bankTab);
$viewer->assign('HISTORIA', $history);
$viewer->assign('MAINCURR', $mainCurrencyInfo);
$viewer->assign('SUPPORTED_CURRENCIES', $moduleModel->getSupportedCurrencies());
$viewer->assign('UNSUPPORTED_CURRENCIES', $moduleModel->getUnSupportedCurrencies());
$viewer->view('Index.tpl', $qualifiedModule);
$log->debug('End ' . __CLASS__ . ':' . __FUNCTION__);
}
开发者ID:yozhi,项目名称:YetiForceCRM,代码行数:64,代码来源:Index.php
示例18: getRecordModelFromRequest
/**
* Function to get the record model based on the request parameters
* @param Vtiger_Request $request
* @return Vtiger_Record_Model or Module specific Record Model instance
*/
public function getRecordModelFromRequest(Vtiger_Request $request)
{
$recordModel = parent::getRecordModelFromRequest($request);
$startDate = $request->get('date_start');
if (!empty($startDate)) {
//Start Date and Time values
$startTime = Vtiger_Time_UIType::getTimeValueWithSeconds($request->get('time_start'));
$startDate = Vtiger_Date_UIType::getDBInsertedValue($request->get('date_start'));
if ($startTime) {
$startDateTime = Vtiger_Datetime_UIType::getDBDateTimeValue($request->get('date_start') . " " . $startTime);
list($startDate, $startTime) = explode(' ', $startDateTime);
}
$recordModel->set('date_start', $startDate);
$recordModel->set('time_start', $startTime);
}
$endDate = $request->get('due_date');
if (!empty($endDate)) {
//End Date and Time values
$endTime = $request->get('time_end');
$endDate = Vtiger_Date_UIType::getDBInsertedValue($request->get('due_date'));
if ($endTime) {
$endTime = Vtiger_Time_UIType::getTimeValueWithSeconds($endTime);
$endDateTime = Vtiger_Datetime_UIType::getDBDateTimeValue($request->get('due_date') . " " . $endTime);
list($endDate, $endTime) = explode(' ', $endDateTime);
}
$recordModel->set('time_end', $endTime);
$recordModel->set('due_date', $endDate);
}
$record = $request->get('record');
if (!$record) {
$activityType = $request->get('activitytype');
$visibility = $request->get('visibility');
if (empty($activityType)) {
$recordModel->set('activitytype', 'Task');
$visibility = 'Private';
$recordModel->set('visibility', $visibility);
}
}
if (empty($visibility)) {
$assignedUserId = $recordModel->get('assigned_user_id');
$sharedType = Calendar_Module_Model::getSharedType($assignedUserId);
if ($sharedType == 'selectedusers') {
$sharedType = 'public';
}
$recordModel->set('visibility', ucfirst($sharedType));
}
$time = strtotime($endTime) - strtotime($startTime);
$diffinSec = strtotime($endDate) - strtotime($startDate);
$diff_days = floor($diffinSec / (60 * 60 * 24));
$hours = (double) $time / 3600 + $diff_days * 24;
$minutes = ((double) $hours - (int) $hours) * 60;
$recordModel->set('duration_hours', (int) $hours);
$recordModel->set('duration_minutes', round($minutes, 0));
return $recordModel;
}
开发者ID:rcrrich,项目名称:YetiForceCRM,代码行数:60,代码来源:SaveAjax.php
示例19: content_567aca6bd2404
function content_567aca6bd2404($_smarty_tpl)
{
$_smarty_tpl->tpl_vars["dateFormat"] = new Smarty_variable($_smarty_tpl->tpl_vars['USER_MODEL']->value->get('date_format'), null, 0);
$_smarty_tpl->tpl_vars["currentD
|
请发表评论