function getblock_fieldlist($block_array) { $list = ''; $z = 0; $field_count = count($block_array); if ($field_count != 0) { $list .= '<div style = "clear:both;"></div>'; for ($i = 0; $i < $field_count; $i++, $z++) { $blockname = $block_array[$i]['blockname']; // SalesPlatform.ru begin localization $data = getTranslatedString($block_array[$i]['fieldvalue']); //$data = $block_array[$i]['fieldvalue']; // SalesPlatform.ru end if ($block_array[$i]['fieldlabel'] == 'Note') { $data = html_entity_decode($data); } // SalesPlatform.ru begin localization if ($block_array[$i]['fieldlabel'] == 'Акцизный сбор' || $block_array[$i]['fieldlabel'] == 'Комиссия' || $block_array[$i]['fieldlabel'] == 'Курс' || $block_array[$i]['fieldlabel'] == 'Индивидуальный налог' || $block_array[$i]['fieldlabel'] == 'Получен' || $block_array[$i]['fieldlabel'] == 'Баланс' || $block_array[$i]['fieldlabel'] == 'Годовой доход') { $data = number_format($data, 2); } // SalesPlatform.ru end if ($data == '') { $data = ' '; } if (strcmp($blockname, $block_array[$i - 1]['blockname'])) { if ($z != 0) { $list .= '</div></div></div></div>'; } if ($blockname != 'Ticket Information') { //hardcoded for tickets information block so that it ll not be displayed $list .= '<div class="widget-box"><div class = "widget-header"> <h5 class = "widget-title">' . getblock_header($blockname) . '</h5></div>'; } $z = 0; $list .= '<div class = "widget-body"><div class="widget-main no-padding single-entity-view"> <div style="width:auto;padding:12px;display:block;" id="tblLeadInformation">'; } if ($z == 0 || $z % 2 == 0) { $list .= '<div class="row">'; } $list .= '<div class="form-group col-sm-6"><label class="col-sm-3 control-label no-padding-right">' . getTranslatedString($block_array[$i]['fieldlabel']) . '</label>'; if (($z == 0 || $z % 2 == 0) && $i == $field_count - 1) { $list .= '<div class="col-sm-9 dvtCellInfo" align="left" valign="top">' . $data . '</div></div>'; } else { $list .= '<div class="col-sm-9 dvtCellInfo" align="left" valign="top"> ' . $data . '</div></div>'; } if ($z % 2 == 1 || $i == $field_count - 1) { $list .= '</div>'; } } } $list .= '<tr><td colspan="4"> </td></tr>'; return $list; }
function getblock_fieldlistview_product($block_array, $module) { $header = array(); $header[0] = getTranslatedString($module); $header[1] = getTranslatedString('QUOTE_RELATED') . getTranslatedString($module); $header[2] = getTranslatedString('INVOICE_RELATED') . getTranslatedString($module); if ($block_array == '') { $list .= '<tr><td>' . $module . " " . getTranslatedString('LBL_NOT_AVAILABLE') . '</td></tr>'; return $list; } for ($k = 0; $k <= 2; $k++) { $header_arr = $block_array[$k][$module]['head'][0]; $nooffields = count($header_arr); $data_arr = $block_array[$k][$module]['data']; $noofdata = count($data_arr); $list .= getblock_header($header[$k], $nooffields); if ($block_array[$k][$module]['data'] == '') { $list .= '<tr><td>' . $header[$k] . " " . getTranslatedString('LBL_NOT_AVAILABLE') . '</td></tr>'; } if ($nooffields != '') { $list .= '<tr class="detailedViewHeader" align="center">'; for ($i = 0; $i < $nooffields; $i++) { $list .= "<td>" . getTranslatedString($header_arr[$i]['fielddata']) . "</td>"; } $list .= '</tr>'; } if ($noofdata != '') { for ($j = 0; $j < $noofdata; $j++) { if ($j == 0 || $j % 2 == 0) { $list .= '<tr class="dvtLabel">'; } else { $list .= '<tr class="dvtInfo">'; } for ($i = 0; $i < $nooffields; $i++) { $data = $data_arr[$j][$i]['fielddata']; if ($data == '') { $data = ' '; } $list .= "<td>" . $data . "</td>"; } $list .= '</tr>'; } } $list .= '<tr><td colspan ="' . $nooffields . '"> </td></tr>'; } return $list; }
$ticket_status = ''; foreach ($ticketinfo as $key => $value) { $fieldlabel = $value['fieldlabel']; $fieldvalue = $value['fieldvalue']; if ($fieldlabel == 'Status') { $ticket_status = $fieldvalue; break; } } //If the ticket is created by this customer and status is not Closed then allow him to Close this ticket otherwise not if ($ticket_status != 'Closed' && $ticket_status != '') { $ticket_close_link = '<a href=index.php?module=HelpDesk&action=index&fun=close_ticket&ticketid=' . $ticketid . '><b>' . getTranslatedString('LBL_CLOSE_TICKET') . '</b></a> '; } else { $ticket_close_link = ''; } echo getblock_header('Ticket Information', '4', $ticket_close_link); echo getblock_fieldlist($ticketinfo); if ($commentscount >= 1 && is_array($commentresult)) { $list .= ' <tr><td colspan="5" class="detailedViewHeader"><b>' . getTranslatedString('LBL_TICKET_COMMENTS') . '</b></td></tr> <tr> <td colspan="4" class="dvtCellInfo"> <div id="scrollTab2"> <table width="100%" border="0" cellspacing="5" cellpadding="5">'; //Form the comments in between tr tags for ($j = 0; $j < $commentscount; $j++) { $list .= ' <tr> <td width="5%" valign="top">' . ($commentscount - $j) . '</td> <td width="95%">' . $commentresult[$j]['comments'] . '<br><span class="hdr">' . getTranslatedString('LBL_COMMENT_BY') . ' : ' . $commentresult[$j]['owner'] . ' ' . getTranslatedString('LBL_ON') . ' ' . $commentresult[$j]['createdtime'] . '</span></td> </tr>';