当前位置: 首页>>代码示例>>PHP>>正文


PHP getOwnerName函数代码示例

本文整理汇总了PHP中getOwnerName函数的典型用法代码示例。如果您正苦于以下问题:PHP getOwnerName函数的具体用法?PHP getOwnerName怎么用?PHP getOwnerName使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getOwnerName函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getEditViewDisplayValue

	/**
	 * Function to get the display value in detail view
	 * @param <Integer> crmid of record
	 * @return <String>
	 */
	public function getEditViewDisplayValue($value)
	{
		if ($value) {
			$userName = getOwnerName($value);
			return $userName;
		}
	}
开发者ID:rubichcube,项目名称:YetiForceCRM,代码行数:12,代码来源:UserReference.php

示例2: getDisplayValue

 /**
  * Function to get the Display Value, for the current field type with given DB Insert Value
  * @param <Object> $value
  * @return <Object>
  */
 public function getDisplayValue($values, $record = false, $recordInstance = false, $rawText = false)
 {
     $db = PearDatabase::getInstance();
     $currentUser = Users_Record_Model::getCurrentUserModel();
     $displayValue = '';
     if ($recordInstance !== false) {
         $moduleName = $recordInstance->getModuleName();
     } elseif ($record !== false) {
         $recordMetaData = Vtiger_Functions::getCRMRecordMetadata($record);
         $moduleName = $recordMetaData['setype'];
     }
     $shownersTable = self::getShownerTable($moduleName);
     $result = $db->pquery('SELECT DISTINCT userid FROM ' . $shownersTable . ' WHERE crmid = ?', [$record]);
     while (($shownerid = $db->getSingleValue($result)) !== false) {
         if (Vtiger_Owner_UIType::getOwnerType($shownerid) === 'User') {
             if ($currentUser->isAdminUser() && !$rawText) {
                 $displayValue .= '<a href="index.php?module=User&view=Detail&record=' . $shownerid . '">' . rtrim(getOwnerName($shownerid)) . '</a>,';
             } else {
                 $displayValue .= rtrim(getOwnerName($shownerid)) . ',';
             }
         } else {
             if ($currentUser->isAdminUser() && !$rawText) {
                 $displayValue .= '<a href="index.php?module=Groups&parent=Settings&view=Detail&record=' . $shownerid . '">' . rtrim(getOwnerName($shownerid)) . '</a>,';
             } else {
                 $displayValue .= rtrim(getOwnerName($shownerid)) . ',';
             }
         }
     }
     return rtrim($displayValue, ',');
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:35,代码来源:SharedOwner.php

示例3: CustomerCommentFromPortal

function CustomerCommentFromPortal($entityData)
{
    $adb = PearDatabase::getInstance();
    $data = $entityData->getData();
    $customerWSId = $data['customer'];
    $relatedToWSId = $data['related_to'];
    $relatedToId = explode('x', $relatedToWSId);
    $moduleName = getSalesEntityType($relatedToId[1]);
    if ($moduleName == 'HelpDesk' && !empty($customerWSId)) {
        $ownerIdInfo = getRecordOwnerId($relatedToId[1]);
        if (!empty($ownerIdInfo['Users'])) {
            $ownerId = $ownerIdInfo['Users'];
            $ownerName = getOwnerName($ownerId);
            $toEmail = getUserEmailId('id', $ownerId);
        }
        if (!empty($ownerIdInfo['Groups'])) {
            $ownerId = $ownerIdInfo['Groups'];
            $groupInfo = getGroupName($ownerId);
            $ownerName = $groupInfo[0];
            $toEmail = implode(',', getDefaultAssigneeEmailIds($ownerId));
        }
        $subject = getTranslatedString('LBL_RESPONDTO_TICKETID', $moduleName) . "##" . $relatedToId[1] . "## " . getTranslatedString('LBL_CUSTOMER_PORTAL', $moduleName);
        $contents = getTranslatedString('Dear', $moduleName) . " " . $ownerName . "," . "<br><br>" . getTranslatedString('LBL_CUSTOMER_COMMENTS', $moduleName) . "<br><br>\n\t\t\t\t\t<b>" . $data['commentcontent'] . "</b><br><br>" . getTranslatedString('LBL_RESPOND', $moduleName) . "<br><br>" . getTranslatedString('LBL_REGARDS', $moduleName) . "<br>" . getTranslatedString('LBL_SUPPORT_ADMIN', $moduleName);
        $customerId = explode('x', $customerWSId);
        $result = $adb->pquery("SELECT email FROM vtiger_contactdetails WHERE contactid=?", array($customerId[0]));
        $fromEmail = $adb->query_result($result, 0, 'email');
        send_mail('HelpDesk', $toEmail, '', $fromEmail, $subject, $contents);
    }
}
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:29,代码来源:ModCommentsHandler.php

示例4: getDisplayValue

	/**
	 * Function to get the Display Value, for the current field type with given DB Insert Value
	 * @param <Object> $value
	 * @return <Object>
	 */
	public function getDisplayValue($values)
	{
		if ($values == '')
			return;

		foreach (Vtiger_Functions::getArrayFromValue($values) as $value) {
			if (Vtiger_Owner_UIType::getOwnerType($value) === 'User') {
				$userModel = Users_Record_Model::getCleanInstance('Users');
				$userModel->set('id', $value);
				$detailViewUrl = $userModel->getDetailViewUrl();
				$currentUser = Users_Record_Model::getCurrentUserModel();
				if ($currentUser->isAdminUser()) {
					$displayvalue[] = '<a href=' . $detailViewUrl . '>' . rtrim(getOwnerName($value)) . '</a>';
				} else {
					$displayvalue[] = rtrim(getOwnerName($value));
				}
			} else {
				$currentUser = Users_Record_Model::getCurrentUserModel();
				if ($currentUser->isAdminUser()) {
					$recordModel = new Settings_Groups_Record_Model();
					$recordModel->set('groupid', $value);
					$detailViewUrl = $recordModel->getDetailViewUrl();
					$displayvalue[] = '<a href=' . $detailViewUrl . '>' . rtrim(getOwnerName($value)) . '</a>';
				} else {
					$displayvalue[] = rtrim(getOwnerName($value));
				}
			}
		}
		$displayvalue = implode(', ', $displayvalue);
		return $displayvalue;
	}
开发者ID:rubichcube,项目名称:YetiForceCRM,代码行数:36,代码来源:SharedOwner.php

示例5: getDisplayValue

	/**
	 * Function to get the Display Value, for the current field type with given DB Insert Value
	 * @param <Object> $value
	 * @return <Object>
	 */
	public function getDisplayValue($values)
	{
		if ($values == NULL && !is_array($values))
			return;
		foreach ($values as $value) {
			if (self::getOwnerType($value) === 'User') {
				$userModel = Users_Record_Model::getCleanInstance('Users');
				$userModel->set('id', $value);
				$detailViewUrl = $userModel->getDetailViewUrl();
				$currentUser = Users_Record_Model::getCurrentUserModel();
				if (!$currentUser->isAdminUser()) {
					return getOwnerName($value);
				}
			} else {
				$currentUser = Users_Record_Model::getCurrentUserModel();
				if (!$currentUser->isAdminUser()) {
					return getOwnerName($value);
				}
				$recordModel = new Settings_Groups_Record_Model();
				$recordModel->set('groupid', $value);
				$detailViewUrl = $recordModel->getDetailViewUrl();
			}
			$displayvalue[] = "<a href=" . $detailViewUrl . ">" . getOwnerName($value) . "</a>&nbsp";
		}
		$displayvalue = implode(',', $displayvalue);
		return $displayvalue;
	}
开发者ID:rubichcube,项目名称:YetiForceCRM,代码行数:32,代码来源:Multiowner.php

示例6: author

 function author()
 {
     $authorid = $this->data['smcreatorid'];
     if (!isset(self::$ownerNamesCache[$authorid])) {
         self::$ownerNamesCache[$authorid] = getOwnerName($authorid);
     }
     return self::$ownerNamesCache[$authorid];
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:8,代码来源:Comments.php

示例7: getEditViewDisplayValue

 /**
  * Function to get the display value in detail view
  * @param <Integer> crmid of record
  * @return <String>
  */
 public function getEditViewDisplayValue($value)
 {
     global $log;
     $log->debug("Entering ./uitypes/UserReference.php::getEditViewDisplayValue");
     if ($value) {
         $userName = getOwnerName($value);
         return $userName;
     }
 }
开发者ID:cin-system,项目名称:cinrepo,代码行数:14,代码来源:UserReference.php

示例8: sendPrdStckMail

/**
 * This function sends a mail to the handler whenever the product reaches the reorder level.
 * Param $product_id - product id
 * Param $upd_qty - updated product quantity in no's
 * Param $prod_name - product name
 * Param $qtyinstk - quantity in stock
 * Param $qty - quantity
 * Param $module - module name
 * return type void
 */
function sendPrdStckMail($product_id, $upd_qty, $prod_name, $qtyinstk, $qty, $module)
{
    global $log;
    $log->debug("Entering sendPrdStckMail(" . $product_id . "," . $upd_qty . "," . $prod_name . "," . $qtyinstk . "," . $qty . "," . $module . ") method ...");
    global $current_user;
    global $adb;
    $reorderlevel = getPrdReOrderLevel($product_id);
    $log->debug("Inside sendPrdStckMail function, module=" . $module);
    $log->debug("Prd reorder level " . $reorderlevel);
    if ($upd_qty < $reorderlevel) {
        //send mail to the handler
        $handler = getRecordOwnerId($product_id);
        foreach ($handler as $type => $id) {
            $handler = $id;
        }
        $handler_name = getOwnerName($handler);
        if (vtws_isRecordOwnerUser($handler)) {
            $to_address = getUserEmail($handler);
        } else {
            $to_address = implode(',', getDefaultAssigneeEmailIds($handler));
        }
        //Get the email details from database;
        if ($module == 'SalesOrder') {
            $notification_table = 'SalesOrderNotification';
            $quan_name = '{SOQUANTITY}';
        }
        if ($module == 'Quotes') {
            $notification_table = 'QuoteNotification';
            $quan_name = '{QUOTEQUANTITY}';
        }
        if ($module == 'Invoice') {
            $notification_table = 'InvoiceNotification';
        }
        $query = "select * from vtiger_inventorynotification where notificationname=?";
        $result = $adb->pquery($query, array($notification_table));
        $subject = $adb->query_result($result, 0, 'notificationsubject');
        $body = $adb->query_result($result, 0, 'notificationbody');
        $status = $adb->query_result($result, 0, 'status');
        if ($status == 0 || $status == '') {
            return false;
        }
        $subject = str_replace('{PRODUCTNAME}', $prod_name, $subject);
        $body = str_replace('{HANDLER}', $handler_name, $body);
        $body = str_replace('{PRODUCTNAME}', $prod_name, $body);
        if ($module == 'Invoice') {
            $body = str_replace('{CURRENTSTOCK}', $upd_qty, $body);
            $body = str_replace('{REORDERLEVELVALUE}', $reorderlevel, $body);
        } else {
            $body = str_replace('{CURRENTSTOCK}', $qtyinstk, $body);
            $body = str_replace($quan_name, $qty, $body);
        }
        $body = str_replace('{CURRENTUSER}', $current_user->user_name, $body);
        $mail_status = send_mail($module, $to_address, $current_user->user_name, $current_user->email1, decode_html($subject), nl2br(to_html($body)));
    }
    $log->debug("Exiting sendPrdStckMail method ...");
}
开发者ID:nouphet,项目名称:vtigercrm-6.0.0-ja,代码行数:66,代码来源:InventoryUtils.php

示例9: getDisplayValue

 /**
  * Function to get the Display Value, for the current field type with given DB Insert Value
  * @param <Object> $value
  * @return <Object>
  */
 public function getDisplayValue($value)
 {
     if (self::getOwnerType($value) === 'User') {
         $userModel = Users_Record_Model::getCleanInstance('Users');
         $userModel->set('id', $value);
         $detailViewUrl = $userModel->getDetailViewUrl();
     } else {
         $currentUser = Users_Record_Model::getCurrentUserModel();
         if (!$currentUser->isAdminUser()) {
             return getOwnerName($value);
         }
         $recordModel = new Settings_Groups_Record_Model();
         $recordModel->set('groupid', $value);
         $detailViewUrl = $recordModel->getDetailViewUrl();
     }
     return "<a href=" . $detailViewUrl . ">" . getOwnerName($value) . "</a>";
 }
开发者ID:nouphet,项目名称:vtigercrm-6.0.0-ja,代码行数:22,代码来源:Owner.php

示例10: getDisplayValue

 /**
  * Function to get the Display Value, for the current field type with given DB Insert Value
  * @param <Object> $value
  * @return <Object>
  */
 public function getDisplayValue($values)
 {
     if ($values == NULL) {
         return;
     }
     foreach (Vtiger_Functions::getArrayFromValue($values) as $value) {
         $userModel = Users_Record_Model::getCleanInstance('Users');
         $userModel->set('id', $value);
         $detailViewUrl = $userModel->getDetailViewUrl();
         $currentUser = Users_Record_Model::getCurrentUserModel();
         if (!$currentUser->isAdminUser()) {
             return getOwnerName($value);
         }
         $displayvalue[] = "<a href=" . $detailViewUrl . ">" . getOwnerName($value) . "</a>&nbsp";
     }
     $displayvalue = implode(',', $displayvalue);
     return $displayvalue;
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:23,代码来源:SharedOwner.php

示例11: HelpDesk_notifyOnPortalTicketComment

function HelpDesk_notifyOnPortalTicketComment($entityData)
{
    $adb = PearDatabase::getInstance();
    $moduleName = $entityData->getModuleName();
    $wsId = $entityData->getId();
    $parts = explode('x', $wsId);
    $entityId = $parts[1];
    $ownerIdInfo = getRecordOwnerId($entityId);
    if (!empty($ownerIdInfo['Users'])) {
        $ownerId = $ownerIdInfo['Users'];
        $ownerName = getOwnerName($ownerId);
        $to_email = getUserEmailId('id', $ownerId);
    }
    if (!empty($ownerIdInfo['Groups'])) {
        $ownerId = $ownerIdInfo['Groups'];
        $groupInfo = getGroupName($ownerId);
        $ownerName = $groupInfo[0];
        $to_email = implode(',', getDefaultAssigneeEmailIds($ownerId));
    }
    $wsParentId = $entityData->get('contact_id');
    $parentIdParts = explode('x', $wsParentId);
    $parentId = $parentIdParts[1];
    $entityDelta = new VTEntityDelta();
    $oldComments = $entityDelta->getOldValue($entityData->getModuleName(), $entityId, 'comments');
    $newComments = $entityDelta->getCurrentValue($entityData->getModuleName(), $entityId, 'comments');
    $commentDiff = str_replace($oldComments, '', $newComments);
    $latestComment = strip_tags($commentDiff);
    //send mail to the assigned to user when customer add comment
    // SalesPlatform.ru begin
    $subject = getTranslatedString('LBL_RESPONDTO_TICKETID', $moduleName) . " " . $entityData->get('ticket_no') . " " . getTranslatedString('LBL_CUSTOMER_PORTAL', $moduleName);
    //$subject = getTranslatedString('LBL_RESPONDTO_TICKETID', $moduleName)."##". $entityId."##". getTranslatedString('LBL_CUSTOMER_PORTAL', $moduleName);
    // SalesPlatform.ru end
    $contents = getTranslatedString('Dear', $moduleName) . " " . $ownerName . "," . "<br><br>" . getTranslatedString('LBL_CUSTOMER_COMMENTS', $moduleName) . "<br><br>\n\t\t\t\t\t\t<b>" . $latestComment . "</b><br><br>" . getTranslatedString('LBL_RESPOND', $moduleName) . "<br><br>" . getTranslatedString('LBL_REGARDS', $moduleName) . "<br>" . getTranslatedString('LBL_SUPPORT_ADMIN', $moduleName);
    //get the contact email id who creates the ticket from portal and use this email as from email id in email
    $result = $adb->pquery("SELECT lastname, firstname, email FROM vtiger_contactdetails WHERE contactid=?", array($parentId));
    $customername = $adb->query_result($result, 0, 'firstname') . ' ' . $adb->query_result($result, 0, 'lastname');
    $customername = decode_html($customername);
    //Fix to display the original UTF-8 characters in sendername instead of ascii characters
    $from_email = $adb->query_result($result, 0, 'email');
    send_mail('HelpDesk', $to_email, '', $from_email, $subject, $contents);
}
开发者ID:gitter-badger,项目名称:openshift-salesplatform,代码行数:41,代码来源:HelpDeskHandler.php

示例12: content_56970bf26f937


//.........这里部分代码省略.........
                    if ($_smarty_tpl->tpl_vars['HEADER_FIELD']->value != null) {
                        $_smarty_tpl->tpl_vars['RELATED_HEADERNAME'] = new Smarty_variable($_smarty_tpl->tpl_vars['HEADER_FIELD']->value->get('name'), null, 0);
                        ?>
<td class="<?php 
                        echo $_smarty_tpl->tpl_vars['WIDTHTYPE']->value;
                        ?>
"><?php 
                        if ($_smarty_tpl->tpl_vars['HEADER_FIELD']->value->isNameField() == true || $_smarty_tpl->tpl_vars['HEADER_FIELD']->value->get('uitype') == '4') {
                            ?>
<a><?php 
                            echo $_smarty_tpl->tpl_vars['RELATED_RECORD']->value->getDisplayValue($_smarty_tpl->tpl_vars['RELATED_HEADERNAME']->value);
                            ?>
</a><?php 
                        } elseif ($_smarty_tpl->tpl_vars['RELATED_HEADERNAME']->value == 'access_count') {
                            echo $_smarty_tpl->tpl_vars['RELATED_RECORD']->value->getAccessCountValue($_smarty_tpl->tpl_vars['PARENT_RECORD']->value->getId());
                        } elseif ($_smarty_tpl->tpl_vars['RELATED_HEADERNAME']->value == 'date_start') {
                            if ($_smarty_tpl->tpl_vars['EMAIL_FLAG']->value != 'SAVED') {
                                echo $_smarty_tpl->tpl_vars['RELATED_RECORD']->value->getDisplayValue($_smarty_tpl->tpl_vars['RELATED_HEADERNAME']->value);
                            } elseif ($_smarty_tpl->tpl_vars['RELATED_RECORD']->value->isFromMailManager()) {
                                ?>
<span class="label label-warning"><?php 
                                echo vtranslate('LBL_ATTACHED', $_smarty_tpl->tpl_vars['RELATED_MODULE_NAME']->value);
                                ?>
</span><?php 
                            }
                        } elseif ($_smarty_tpl->tpl_vars['RELATED_HEADERNAME']->value == 'time_start') {
                            if ($_smarty_tpl->tpl_vars['EMAIL_FLAG']->value != 'SAVED') {
                                echo $_smarty_tpl->tpl_vars['RELATED_RECORD']->value->getDisplayValue($_smarty_tpl->tpl_vars['RELATED_HEADERNAME']->value);
                            } elseif ($_smarty_tpl->tpl_vars['RELATED_RECORD']->value->isFromMailManager()) {
                                ?>
<span class="label label-warning"><?php 
                                echo vtranslate('LBL_ATTACHED', $_smarty_tpl->tpl_vars['RELATED_MODULE_NAME']->value);
                                ?>
</span><?php 
                            }
                        } elseif ($_smarty_tpl->tpl_vars['RELATED_HEADERNAME']->value == 'parent_id') {
                            $_smarty_tpl->tpl_vars['REFERENCE_RECORD'] = new Smarty_variable($_smarty_tpl->tpl_vars['RELATED_RECORD']->value->get($_smarty_tpl->tpl_vars['RELATED_HEADERNAME']->value), null, 0);
                            $_smarty_tpl->tpl_vars['RECORD_MODULE_MODEL'] = new Smarty_variable($_smarty_tpl->tpl_vars['RELATED_RECORD']->value->getModule(), null, 0);
                            $_smarty_tpl->tpl_vars['RECORD_FIELD_MODEL'] = new Smarty_variable($_smarty_tpl->tpl_vars['RECORD_MODULE_MODEL']->value->getField($_smarty_tpl->tpl_vars['RELATED_HEADERNAME']->value), null, 0);
                            $_smarty_tpl->tpl_vars['UI_TYPE_MODEL'] = new Smarty_variable(Vtiger_Base_UIType::getInstanceFromField($_smarty_tpl->tpl_vars['RECORD_FIELD_MODEL']->value), null, 0);
                            $_smarty_tpl->tpl_vars['REFERENCE_MODULE_MODEL'] = new Smarty_variable($_smarty_tpl->tpl_vars['UI_TYPE_MODEL']->value->getReferenceModule($_smarty_tpl->tpl_vars['REFERENCE_RECORD']->value), null, 0);
                            $_smarty_tpl->tpl_vars['REFERENCE_MODULE_NAME'] = new Smarty_variable($_smarty_tpl->tpl_vars['REFERENCE_MODULE_MODEL']->value->get('name'), null, 0);
                            $_smarty_tpl->tpl_vars['REFERENCE_RECORD_ENTIYNAME_LIST'] = new Smarty_variable(getEntityName($_smarty_tpl->tpl_vars['REFERENCE_MODULE_NAME']->value, $_smarty_tpl->tpl_vars['REFERENCE_RECORD']->value), null, 0);
                            ?>
<a href="index.php?module=<?php 
                            echo $_smarty_tpl->tpl_vars['REFERENCE_MODULE_NAME']->value;
                            ?>
&view=<?php 
                            echo $_smarty_tpl->tpl_vars['REFERENCE_MODULE_MODEL']->value->getDetailViewName();
                            ?>
&record=<?php 
                            echo $_smarty_tpl->tpl_vars['REFERENCE_RECORD']->value;
                            ?>
"title="<?php 
                            echo vtranslate($_smarty_tpl->tpl_vars['REFERENCE_MODULE_NAME']->value, $_smarty_tpl->tpl_vars['REFERENCE_MODULE_NAME']->value);
                            ?>
"onclick="if(event.stopPropagation){event.stopPropagation();}else{event.cancelBubble=true;}"><?php 
                            echo $_smarty_tpl->tpl_vars['REFERENCE_RECORD_ENTIYNAME_LIST']->value[$_smarty_tpl->tpl_vars['REFERENCE_RECORD']->value];
                            ?>
</a><?php 
                        } elseif ($_smarty_tpl->tpl_vars['HEADER_FIELD']->value->getFieldDataType() == 'owner') {
                            echo getOwnerName($_smarty_tpl->tpl_vars['RELATED_RECORD']->value->get($_smarty_tpl->tpl_vars['RELATED_HEADERNAME']->value));
                        } else {
                            echo $_smarty_tpl->tpl_vars['RELATED_RECORD']->value->getDisplayValue($_smarty_tpl->tpl_vars['RELATED_HEADERNAME']->value);
                        }
                        if ($_smarty_tpl->tpl_vars['HEADER_FIELD']->last) {
                            ?>
<div class="pull-right actions"><span class="actionImages"><a name="emailsDetailView"><i title="<?php 
                            echo vtranslate('LBL_SHOW_COMPLETE_DETAILS', $_smarty_tpl->tpl_vars['MODULE']->value);
                            ?>
" class="icon-th-list alignMiddle"></i></a>&nbsp;<?php 
                            if (!$_smarty_tpl->tpl_vars['RELATED_RECORD']->value->isSentMail()) {
                                ?>
<a name="emailsEditView"><i title="<?php 
                                echo vtranslate('LBL_EDIT', $_smarty_tpl->tpl_vars['MODULE']->value);
                                ?>
" class="icon-pencil alignMiddle"></i></a><?php 
                            }
                            if ($_smarty_tpl->tpl_vars['IS_DELETABLE']->value) {
                                ?>
<a class="relationDelete"><i title="<?php 
                                echo vtranslate('LBL_DELETE', $_smarty_tpl->tpl_vars['MODULE']->value);
                                ?>
" class="icon-trash alignMiddle"></i></a><?php 
                            }
                            ?>
</span></div><?php 
                        }
                        ?>
</td><?php 
                    }
                }
                ?>
</tr><?php 
            }
        }
        ?>
</table></div></div></div>
<?php 
    }
开发者ID:cin-system,项目名称:vtigercrm-cin,代码行数:101,代码来源:d6287c66edbeee6efdab73c9f3427a5b6b347317.file.EmailRelatedList.tpl.php

示例13: computeSheetBodyDCInventory


//.........这里部分代码省略.........
                    $devSpec['Cabinet'] = $cab->Location;
                    $devSpec['Position'] = 1;
                    $devSpec['Height'] = $cab->CabinetHeight;
                    $devSpec['Device'] = '__EMPTY';
                    $invData[] = $devSpec;
                } else {
                    usort($device_list, 'cmpDevPos');
                    $low_idx = 1;
                    foreach ($device_list as $dev) {
                        if ($low_idx < $dev->Position) {
                            // range of empty slots
                            if ($dev->Position <= $cab_height) {
                                $height = $dev->Position - $low_idx;
                            } else {
                                $height = $cab_height - $low_idx + 1;
                            }
                            if ($height > 0) {
                                $dcStats['Rk_UtE'] += $height;
                                $devSpec = makeEmptySpec($sheetColumns, $dcContainerList);
                                ${$devSpec}['Zone'] = $zoneName;
                                $devSpec['Row'] = $rowName;
                                $devSpec['DC Name'] = $dc->Name;
                                $devSpec['Cabinet'] = $cab->Location;
                                $devSpec['Position'] = $low_idx;
                                $devSpec['Height'] = $height;
                                $devSpec['Device'] = '__EMPTY';
                                $invData[] = $devSpec;
                            }
                            $low_idx = $dev->Position;
                        }
                        // device in cabinet
                        $reserved = $dev->Reservation ? 'reserved' : null;
                        list($manufacturer, $model) = getDeviceTemplateName($devTemplates, $dev);
                        $devSpec = makeEmptySpec($sheetColumns, $dcContainerList);
                        $devSpec['DevID'] = $dev->DeviceID;
                        $devSpec['Zone'] = $zoneName;
                        $devSpec['Row'] = $rowName;
                        $devSpec['DC Name'] = $dc->Name;
                        $devSpec['Cabinet'] = $cab->Location;
                        $devSpec['Position'] = $dev->Position;
                        $devSpec['Half Depth'] = getDeviceDepthPos($dev);
                        $devSpec['Height'] = $dev->Height;
                        $devSpec['Device'] = $dev->Label;
                        $devSpec['Parent Device'] = null;
                        $devSpec['Manufacturer'] = $manufacturer;
                        $devSpec['Model'] = $model;
                        $devSpec['Device Type'] = $dev->DeviceType;
                        $devSpec['Asset Number'] = $dev->AssetTag;
                        $devSpec['Serial No.'] = $dev->SerialNo;
                        $devSpec['Install Date'] = $dev->InstallDate;
                        $devSpec['Warranty End'] = $dev->WarrantyExpire;
                        $devSpec['Owner'] = getOwnerName($dev, $deptList);
                        $devSpec['Power (W)'] = $dev->NominalWatts;
                        $devSpec['Reservation'] = $reserved;
                        $devSpec['Contact'] = getContactName($contactList, $dev->PrimaryContact);
                        $devSpec['Tags'] = getTagsString($dev);
                        $devSpec['Notes'] = html_entity_decode(strip_tags($dev->Notes), ENT_COMPAT, 'UTF-8');
                        $invData[] = $devSpec;
                        $dcStats['Watts'] += $dev->NominalWatts;
                        // devices can be installed at the same position and
                        // could be of different height; count only the free
                        // rack units which are not covered by any device
                        if ($low_idx == $dev->Position) {
                            $low_idx += $dev->Height;
                            $dcStats['Rk_UtU'] += $dev->Height;
                        } else {
                            $rest_height = $dev->Position + $dev->Height - $low_idx;
                            $rest_height = $rest_height > 0 ? $rest_height : 0;
                            $low_idx += $rest_height;
                            $dcStats['Rk_UtU'] += $rest_height;
                        }
                        if ($dev->DeviceType == 'Chassis') {
                            list($watts, $invData) = computeDeviceChildren($sheetColumns, $invData, $dev, $dc->Name, $cab, $devTemplates, $deptList, $contactList, $dcContainerList);
                            $dcStats['Watts'] += $watts;
                        }
                    }
                    if ($low_idx <= $cab->CabinetHeight) {
                        // empty range at the top of the cabinet, $low_idx is
                        // the potentially free location
                        $height = $cab->CabinetHeight - $low_idx + 1;
                        $dcStats['Rk_UtE'] += $height;
                        $devSpec = makeEmptySpec($sheetColumns, $dcContainerList);
                        $devSpec['Zone'] = $zoneName;
                        $devSpec['Row'] = $rowName;
                        $devSpec['DC Name'] = $dc->Name;
                        $devSpec['Cabinet'] = $cab->Location;
                        $devSpec['Position'] = $low_idx;
                        $devSpec['Height'] = $height;
                        $devSpec['Device'] = '__EMPTY';
                        $invData[] = $devSpec;
                    }
                }
            }
        }
        assignStatsVal($Stats, $dc, $dcStats);
        $percentDone += $incrementalPercent;
        JobQueue::updatePercentage($sessID, $percentDone);
    }
    return array($Stats, $invData, $invCab, $limitedUser);
}
开发者ID:dc-admin,项目名称:openDCIM,代码行数:101,代码来源:report_asset_Excel-new.php

示例14: content_5698d11f3c1a7


//.........这里部分代码省略.........
</span></span><span class="span9"><span class="row-fluid"><?php 
            echo $_smarty_tpl->tpl_vars['BCC']->value;
            ?>
</span></span></span></div><?php 
        }
        ?>
<div class="row-fluid padding-bottom1per"><span class="span12 row-fluid"><span class="span2"><span class="pull-right muted"><?php 
        echo vtranslate('LBL_SUBJECT', $_smarty_tpl->tpl_vars['MODULE']->value);
        ?>
</span></span><span class="span9"><span class="row-fluid"><?php 
        echo $_smarty_tpl->tpl_vars['RECORD']->value->get('subject');
        ?>
</span></span></span></div><div class="row-fluid padding-bottom1per"><span class="span12 row-fluid"><span class="span2"><span class="pull-right muted"><?php 
        echo vtranslate('LBL_ATTACHMENT', $_smarty_tpl->tpl_vars['MODULE']->value);
        ?>
</span></span><span class="span9"><span class="row-fluid"><?php 
        $_smarty_tpl->tpl_vars['ATTACHMENT_DETAILS'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['ATTACHMENT_DETAILS']->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['RECORD']->value->getAttachmentDetails();
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['ATTACHMENT_DETAILS']->key => $_smarty_tpl->tpl_vars['ATTACHMENT_DETAILS']->value) {
            $_smarty_tpl->tpl_vars['ATTACHMENT_DETAILS']->_loop = true;
            ?>
<a &nbsp;<?php 
            if (array_key_exists('docid', $_smarty_tpl->tpl_vars['ATTACHMENT_DETAILS']->value)) {
                ?>
&nbsp; href="index.php?module=Documents&action=DownloadFile&record=<?php 
                echo $_smarty_tpl->tpl_vars['ATTACHMENT_DETAILS']->value['docid'];
                ?>
&fileid=<?php 
                echo $_smarty_tpl->tpl_vars['ATTACHMENT_DETAILS']->value['fileid'];
                ?>
"<?php 
            } else {
                ?>
&nbsp; href="index.php?module=Emails&action=DownloadFile&attachment_id=<?php 
                echo $_smarty_tpl->tpl_vars['ATTACHMENT_DETAILS']->value['fileid'];
                ?>
"<?php 
            }
            ?>
><?php 
            echo $_smarty_tpl->tpl_vars['ATTACHMENT_DETAILS']->value['attachment'];
            ?>
</a>&nbsp;&nbsp;<?php 
        }
        ?>
</span></span></span></div><div class="row-fluid padding-bottom1per"><span class="span12 row-fluid"><span class="span2"><span class="pull-right muted"><?php 
        echo vtranslate('LBL_DESCRIPTION', $_smarty_tpl->tpl_vars['MODULE']->value);
        ?>
</span></span><span class="span9"><span class="row-fluid"><?php 
        echo decode_html($_smarty_tpl->tpl_vars['RECORD']->value->get('description'));
        ?>
</span></span></span></div><div class="row-fluid"><span class="span1">&nbsp;</span><span class="span10 margin0px"><hr/></span></div><div class="row-fluid"><span class="span4">&nbsp;</span><span class="span4 textAlignCenter"><span class="muted"><?php 
        if ($_smarty_tpl->tpl_vars['RECORD']->value->get('email_flag') == "SAVED") {
            ?>
<small><em><?php 
            echo vtranslate('LBL_DRAFTED_ON', $_smarty_tpl->tpl_vars['MODULE']->value);
            ?>
</em></small><span><small><em>&nbsp;<?php 
            echo Vtiger_Util_Helper::formatDateTimeIntoDayString($_smarty_tpl->tpl_vars['RECORD']->value->get('createdtime'));
            ?>
</em></small></span><?php 
        } elseif ($_smarty_tpl->tpl_vars['RECORD']->value->get('email_flag') == "MailManager") {
            ?>
<small><em><?php 
            echo vtranslate('LBL_MAIL_DATE', $_smarty_tpl->tpl_vars['MODULE']->value);
            ?>
 : </em></small><?php 
            $_smarty_tpl->tpl_vars["MAIL_DATE"] = new Smarty_variable($_smarty_tpl->tpl_vars['RECORD']->value->get('date_start') . ' ' . $_smarty_tpl->tpl_vars['RECORD']->value->get('time_start'), null, 0);
            ?>
<span><small><em>&nbsp;<?php 
            echo Vtiger_Util_Helper::formatDateTimeIntoDayString($_smarty_tpl->tpl_vars['MAIL_DATE']->value);
            ?>
</em></small></span><?php 
        } else {
            ?>
<small><em><?php 
            echo vtranslate('LBL_SENT_ON', $_smarty_tpl->tpl_vars['MODULE']->value);
            ?>
</em></small><?php 
            $_smarty_tpl->tpl_vars["SEND_TIME"] = new Smarty_variable($_smarty_tpl->tpl_vars['RECORD']->value->get('date_start') . ' ' . $_smarty_tpl->tpl_vars['RECORD']->value->get('time_start'), null, 0);
            ?>
<span><small><em>&nbsp;<?php 
            echo Vtiger_Util_Helper::formatDateTimeIntoDayString($_smarty_tpl->tpl_vars['SEND_TIME']->value);
            ?>
</em></small></span><?php 
        }
        ?>
</span></span></div><div class="row-fluid"><span class="span3">&nbsp;</span><span class="span5 textAlignCenter"><span><strong> <?php 
        echo vtranslate('LBL_OWNER', $_smarty_tpl->tpl_vars['MODULE']->value);
        ?>
 : <?php 
        echo getOwnerName($_smarty_tpl->tpl_vars['RECORD']->value->get('assigned_user_id'));
        ?>
</strong></span></span></div></form></div></div><?php 
        echo $_smarty_tpl->getSubTemplate(vtemplate_path('JSResources.tpl'), $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);
    }
开发者ID:cin-system,项目名称:vtigercrm-cin,代码行数:101,代码来源:ab650c039d16f720cd19933780c9d3a12c3c3277.file.EmailPreview.tpl.php

示例15: getTreeEntries

 public function getTreeEntries()
 {
     $db = PearDatabase::getInstance();
     $recordId = $this->getParentRecordModel()->getId();
     $relModuleId = $this->getRelatedModuleModel()->getId();
     $relModuleName = $this->getRelatedModuleModel()->getName();
     $treeViewModel = $this->getTreeViewModel();
     $relationModel = $this->getRelationModel();
     $fields = $treeViewModel->getTreeField();
     $template = $treeViewModel->getTemplate();
     $result = $db->pquery('SELECT tr.*,rel.crmid,rel.rel_created_time,rel.rel_created_user,rel.rel_comment FROM vtiger_trees_templates_data tr ' . 'INNER JOIN u_yf_crmentity_rel_tree rel ON rel.tree = tr.tree ' . 'WHERE tr.templateid = ? AND rel.crmid = ? AND rel.relmodule = ?', [$template, $recordId, $relModuleId]);
     $trees = [];
     while ($row = $db->getRow($result)) {
         $treeID = $row['tree'];
         $pieces = explode('::', $row['parenttrre']);
         end($pieces);
         $parent = prev($pieces);
         $parentName = '';
         if ($row['depth'] > 0) {
             $result2 = $db->pquery('SELECT name FROM vtiger_trees_templates_data WHERE templateid = ? AND tree = ?', [$template, $parent]);
             $parentName = $db->getSingleValue($result2);
             $parentName = '(' . vtranslate($parentName, $relModuleName) . ') ';
         }
         $tree = ['id' => $treeID, 'name' => $parentName . vtranslate($row['name'], $relModuleName), 'parent' => $parent == 0 ? '#' : $parent];
         if ($relationModel->showCreatorDetail()) {
             $tree['relCreatedUser'] = getOwnerName($row['rel_created_user']);
             $tree['relCreatedTime'] = Vtiger_Datetime_UIType::getDisplayDateTimeValue($row['rel_created_time']);
         }
         if ($relationModel->showComment()) {
             if (strlen($row['rel_comment']) > AppConfig::relation('COMMENT_MAX_LENGTH')) {
                 $tree['relCommentFull'] = $row['rel_comment'];
             }
             $tree['relComment'] = Vtiger_Functions::textLength($row['rel_comment'], AppConfig::relation('COMMENT_MAX_LENGTH'));
         }
         if (!empty($row['icon'])) {
             $tree['icon'] = $row['icon'];
         }
         $trees[] = $tree;
     }
     return $trees;
 }
开发者ID:HoererUndFlamme,项目名称:YetiForceCRM,代码行数:41,代码来源:RelationListView.php


注:本文中的getOwnerName函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。