<?php if ($_valid && !is_callable('content_56059ed690268')) {function content_56059ed690268($_smarty_tpl) {?> <?php $_smarty_tpl->tpl_vars['CONTACT_INFO'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['CONTACT_INFO']->_loop = false; $_from = $_smarty_tpl->tpl_vars['RELATED_CONTACTS']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');} foreach ($_from as $_smarty_tpl->tpl_vars['CONTACT_INFO']->key => $_smarty_tpl->tpl_vars['CONTACT_INFO']->value){ $_smarty_tpl->tpl_vars['CONTACT_INFO']->_loop = true; ?><a href='<?php echo $_smarty_tpl->tpl_vars['CONTACT_INFO']->value['_model']->getDetailViewUrl();?> ' title='<?php echo vtranslate("Contacts","Contacts");?> '> <?php echo Vtiger_Util_Helper::getRecordName($_smarty_tpl->tpl_vars['CONTACT_INFO']->value['id']);?> </a><br><?php } ?><?php }} ?>
public function getInviteUserMailData() { $adb = PearDatabase::getInstance(); return []; // To do $return_id = $this->getId(); $cont_qry = "select * from vtiger_cntactivityrel where activityid=?"; $cont_res = $adb->pquery($cont_qry, array($return_id)); $noofrows = $adb->num_rows($cont_res); $cont_id = array(); if ($noofrows > 0) { for ($i = 0; $i < $noofrows; $i++) { $cont_id[] = $adb->query_result($cont_res, $i, "contactid"); } } $cont_name = ''; foreach ($cont_id as $key => $id) { if ($id != '') { $contact_name = Vtiger_Util_Helper::getRecordName($id); $cont_name .= $contact_name . ', '; } } $parentId = $this->get('parent_id'); $parentName = ''; if ($parentId != '') { $parentName = Vtiger_Util_Helper::getRecordName($parentId); } $cont_name = trim($cont_name, ', '); $mail_data = array(); $mail_data['user_id'] = $this->get('assigned_user_id'); $mail_data['subject'] = $this->get('subject'); $moduleName = $this->getModuleName(); $mail_data['status'] = $moduleName == 'Calendar' ? $this->get('taskstatus') : $this->get('eventstatus'); $mail_data['activity_mode'] = $moduleName == 'Calendar' ? 'Task' : 'Events'; $mail_data['taskpriority'] = $this->get('taskpriority'); $mail_data['relatedto'] = $parentName; $mail_data['contact_name'] = $cont_name; $mail_data['description'] = $this->get('description'); $mail_data['assign_type'] = $this->get('assigntype'); $mail_data['group_name'] = getGroupName($this->get('assigned_user_id')); $mail_data['mode'] = $this->get('mode'); //TODO : remove dependency on request; $value = getaddEventPopupTime($_REQUEST['time_start'], $_REQUEST['time_end'], '24'); $start_hour = $value['starthour'] . ':' . $value['startmin'] . '' . $value['startfmt']; if ($_REQUEST['activity_mode'] != 'Task') { $end_hour = $value['endhour'] . ':' . $value['endmin'] . '' . $value['endfmt']; } $startDate = new DateTimeField($_REQUEST['date_start'] . " " . $start_hour); $endDate = new DateTimeField($_REQUEST['due_date'] . " " . $end_hour); $mail_data['st_date_time'] = $startDate->getDBInsertDateTimeValue(); $mail_data['end_date_time'] = $endDate->getDBInsertDateTimeValue(); $mail_data['location'] = $this->get('location'); return $mail_data; }
function Events($request, $moduleName) { $currentUser = Users_Record_Model::getCurrentUserModel(); $viewer = $this->getViewer($request); $record = $request->get('record'); if (!empty($record) && $request->get('isDuplicate') == true) { $recordModel = Vtiger_Record_Model::getInstanceById($record, $moduleName); $viewer->assign('MODE', ''); } else { if (!empty($record)) { $recordModel = Vtiger_Record_Model::getInstanceById($record, $moduleName); $viewer->assign('MODE', 'edit'); $viewer->assign('RECORD_ID', $record); } else { $recordModel = Vtiger_Record_Model::getCleanInstance($moduleName); $viewer->assign('MODE', ''); } } $eventModule = Vtiger_Module_Model::getInstance($moduleName); $recordModel->setModuleFromInstance($eventModule); $moduleModel = $recordModel->getModule(); $fieldList = $moduleModel->getFields(); $requestFieldList = array_intersect_key($request->getAll(), $fieldList); foreach ($requestFieldList as $fieldName => $fieldValue) { $fieldModel = $fieldList[$fieldName]; $specialField = false; // We collate date and time part together in the EditView UI handling // so a bit of special treatment is required if we come from QuickCreate if (empty($record) && ($fieldName == 'time_start' || $fieldName == 'time_end') && !empty($fieldValue)) { $specialField = true; // Convert the incoming user-picked time to GMT time // which will get re-translated based on user-time zone on EditForm $fieldValue = DateTimeField::convertToDBTimeZone($fieldValue)->format("H:i"); } if (empty($record) && ($fieldName == 'date_start' || $fieldName == 'due_date') && !empty($fieldValue)) { if ($fieldName == 'date_start') { $startTime = Vtiger_Time_UIType::getTimeValueWithSeconds($requestFieldList['time_start']); $startDateTime = Vtiger_Datetime_UIType::getDBDateTimeValue($fieldValue . " " . $startTime); list($startDate, $startTime) = explode(' ', $startDateTime); $fieldValue = Vtiger_Date_UIType::getDisplayDateValue($startDate); } else { $endTime = Vtiger_Time_UIType::getTimeValueWithSeconds($requestFieldList['time_end']); $endDateTime = Vtiger_Datetime_UIType::getDBDateTimeValue($fieldValue . " " . $endTime); list($endDate, $endTime) = explode(' ', $endDateTime); $fieldValue = Vtiger_Date_UIType::getDisplayDateValue($endDate); } } if ($fieldModel->isEditable() || $specialField) { $recordModel->set($fieldName, $fieldModel->getDBInsertValue($fieldValue)); } } $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($recordModel, Vtiger_RecordStructure_Model::RECORD_STRUCTURE_MODE_EDIT); $viewMode = $request->get('view_mode'); if (!empty($viewMode)) { $viewer->assign('VIEW_MODE', $viewMode); } $userChangedEndDateTime = $request->get('userChangedEndDateTime'); //If followup value is passed from request to process the value and sent to client $requestFollowUpDate = $request->get('followup_date_start'); $requestFollowUpTime = $request->get('followup_time_start'); $followUpStatus = $request->get('followup'); $eventStatus = $request->get('eventstatus'); if (!empty($requestFollowUpDate)) { $followUpDate = $requestFollowUpDate; } if (!empty($requestFollowUpTime)) { $followUpTime = $requestFollowUpTime; } if ($followUpStatus == 'on') { $viewer->assign('FOLLOW_UP_STATUS', TRUE); } if ($eventStatus == 'Held') { $viewer->assign('SHOW_FOLLOW_UP', TRUE); } else { $viewer->assign('SHOW_FOLLOW_UP', FALSE); } $viewer->assign('USER_CHANGED_END_DATE_TIME', $userChangedEndDateTime); $viewer->assign('FOLLOW_UP_DATE', $followUpDate); $viewer->assign('FOLLOW_UP_TIME', $followUpTime); $viewer->assign('RECURRING_INFORMATION', $recordModel->getRecurrenceInformation()); $viewer->assign('TOMORROWDATE', Vtiger_Date_UIType::getDisplayDateValue(date('Y-m-d', time() + 86400))); $viewer->assign('RECORD_STRUCTURE_MODEL', $recordStructureInstance); $viewer->assign('RECORD_STRUCTURE', $recordStructureInstance->getStructure()); $viewer->assign('MODULE', $moduleName); $viewer->assign('CURRENTDATE', date('Y-n-j')); $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel()); $existingRelatedContacts = $recordModel->getRelatedContactInfo(); //To add contact ids that is there in the request . Happens in gotoFull form mode of quick create $requestContactIdValue = $request->get('contact_id'); if (!empty($requestContactIdValue)) { $existingRelatedContacts[] = array('name' => Vtiger_Util_Helper::getRecordName($requestContactIdValue), 'id' => $requestContactIdValue); } $viewer->assign('RELATED_CONTACTS', $existingRelatedContacts); $isRelationOperation = $request->get('relationOperation'); //if it is relation edit $viewer->assign('IS_RELATION_OPERATION', $isRelationOperation); if ($isRelationOperation) { $viewer->assign('SOURCE_MODULE', $request->get('sourceModule')); $viewer->assign('SOURCE_RECORD', $request->get('sourceRecord')); } $picklistDependencyDatasource = Vtiger_DependencyPicklist::getPicklistDependencyDatasource($moduleName); $accessibleUsers = $currentUser->getAccessibleUsers(); $viewer->assign('PICKIST_DEPENDENCY_DATASOURCE', Zend_Json::encode($picklistDependencyDatasource)); $viewer->assign('ACCESSIBLE_USERS', $accessibleUsers); $viewer->assign('INVITIES_SELECTED', $recordModel->getInvities()); $viewer->assign('CURRENT_USER', $currentUser); $viewer->view('EditView.tpl', $moduleName); }