$sorder = 'ASC';
}
$_SESSION['user_sorder'] = $sorder;
if ($_REQUEST['order_by'] != '') {
    $order_by = $adb->sql_escape_string($_REQUEST['order_by']);
} elseif ($_SESSION['user_orderby'] != '') {
    $order_by = $adb->sql_escape_string($_SESSION['user_orderby']);
} else {
    $order_by = 'last_name';
}
$_SESSION['user_orderby'] = $orderby;
$list_query .= ' ORDER BY ' . $order_by . ' ' . $sorder;
$list_result = $adb->query($list_query);
//Retreive the Navigation array
$navigation_array = getNavigationValues($start, $adb->num_rows($list_result), $no_of_users['user']);
$navigationOutput = getTableHeaderNavigation($navigation_array, $url_string, "Administration", "index", '');
$smarty->assign("MOD", return_module_language($current_language, 'Settings'));
$smarty->assign("CMOD", $mod_strings);
$smarty->assign("APP", $app_strings);
$smarty->assign("CURRENT_USERID", $current_user->id);
$smarty->assign("THEME", $theme);
$smarty->assign("IMAGE_PATH", $image_path);
$smarty->assign("CATEGORY", $category);
$smarty->assign("LIST_HEADER", getListViewHeader($focus, "Users", $url_string, $sorder, $order_by, "", ""));
$smarty->assign("LIST_ENTRIES", getListViewEntries($focus, "Users", $list_result, $navigation_array, "", "", "EditView", "Delete", ""));
$smarty->assign("USER_COUNT", $no_of_users);
$smarty->assign("RECORD_COUNTS", $record_string);
$smarty->assign("NAVIGATION", $navigationOutput);
$smarty->assign("USER_IMAGES", getUserImageNames());
if ($_REQUEST['ajax'] != '') {
    $smarty->display("UserListViewContents.tpl");
Example #2
0
    $start_rec = $navigation_array['start'];
    $end_rec = $navigation_array['end_val'];
    //By Raju Ends
    //limiting the query
    if ($start_rec == 0) {
        $limit_start_rec = 0;
    } else {
        $limit_start_rec = $start_rec - 1;
    }
    if ($adb->dbType == "pgsql") {
        $list_result = $adb->query($list_query . " OFFSET " . $limit_start_rec . " LIMIT " . $list_max_entries_per_page);
    } else {
        $list_result = $adb->query($list_query . " LIMIT " . $limit_start_rec . "," . $list_max_entries_per_page);
    }
    $record_string = $app_strings[LBL_SHOWING] . " " . $start_rec . " - " . $end_rec . " " . $app_strings[LBL_LIST_OF] . " " . $noofrows;
    $navigationOutput = getTableHeaderNavigation($navigation_array, $url_string, "Recyclebin", "index", "");
    $lvEntries = $controller->getListViewEntries($focus, $select_module, $list_result, $navigation_array, true);
}
$smarty->assign("NAVIGATION", $navigationOutput);
$smarty->assign("RECORD_COUNTS", $record_string);
//to get the field name that mentions the module
$query = "select fieldname from vtiger_entityname where modulename =?";
$module_fielaname = $adb->query_result($adb->pquery($query, array($select_module)), 0, 'fieldname');
if (strpos($module_fielaname, ',')) {
    $field_array = explode(',', $module_fielaname);
    $index_field = $field_array[0];
} else {
    $index_field = $module_fielaname;
}
$alphabetical = AlphabeticalSearch($currentModule, 'index', $index_field, 'true', 'basic', "", "", "", "", $viewid);
$category = getParentTab();
Example #3
0
$focus->popup_type = $popuptype;
$url_string .= '&popuptype=' . $popuptype;
if (isset($_REQUEST['select']) && $_REQUEST['select'] == 'enable') {
    $url_string .= '&select=enable';
}
if (isset($_REQUEST['return_module']) && $_REQUEST['return_module'] != '') {
    $url_string .= '&return_module=' . $_REQUEST['return_module'];
}
$smarty->assign("URLSTRING", $url_string);
if ($viewid != '') {
    $url_string .= "&viewname=" . $viewid;
}
$listview_header_search = getSearchListHeaderValues($focus, $currentModule, $url_string, $sorder, $order_by);
$smarty->assign("SEARCHLISTHEADER", $listview_header_search);
$smarty->assign("ALPHABETICAL", $alphabetical);
$listview_header = getSearchListViewHeader($focus, $currentModule, $url_string, $sorder, $order_by);
$smarty->assign("LISTHEADER", $listview_header);
$listview_entries = getSearchListViewEntries($focus, $currentModule, $list_result, $navigation_array);
$smarty->assign("LISTENTITY", $listview_entries);
$navigationOutput = getTableHeaderNavigation($navigation_array, $url_string, $currentModule, "Popup", $viewid);
$smarty->assign("NAVIGATION", $navigationOutput);
$smarty->assign("RECORD_COUNTS", $record_string);
$smarty->assign("POPUPTYPE", $popuptype);
if (isset($_REQUEST['ajax']) && $_REQUEST['ajax'] != '') {
    $smarty->display("PopupContents.tpl");
} else {
    $smarty->display("Popup.tpl");
}
?>

Example #4
0
/**
 * Function creates HTML to display Todos ListView
 * @param array  $todo_list     - collection of strings(Todo Information)
 * @param array  $cal           - collection of objects and strings 
 * return string $list_view     - html tags in string format
 */
function constructTodoListView($todo_list, $cal, $subtab, $navigation_array = '')
{
    global $mod_strings, $cal_log, $adb, $theme;
    $cal_log->debug("Entering constructTodoListView() method...");
    global $current_user, $app_strings;
    $date_format = $current_user->date_format;
    $format = $cal['calendar']->hour_format;
    $hour_startat = timeString(array('hour' => date('H:i'), 'minute' => 0), '24');
    $hour_endat = timeString(array('hour' => date('H:i', time() + 60 * 60), 'minute' => 0), '24');
    $time_arr = getaddEventPopupTime($hour_startat, $hour_endat, $format);
    $temp_ts = $cal['calendar']->date_time->ts;
    //to get date in user selected date format
    $temp_date = $date_format == 'dd-mm-yyyy' ? date('d-m-Y', $temp_ts) : ($date_format == 'mm-dd-yyyy' ? date('m-d-Y', $temp_ts) : ($date_format == 'yyyy-mm-dd' ? date('Y-m-d', $temp_ts) : ''));
    if ($cal['calendar']->day_start_hour != 23) {
        $endtemp_date = $temp_date;
    } else {
        $endtemp_ts = $temp_ts + 1 * 24 * 60 * 60;
        $endtemp_date = $date_format == 'dd-mm-yyyy' ? date('d-m-Y', $endtemp_ts) : ($date_format == 'mm-dd-yyyy' ? date('m-d-Y', $endtemp_ts) : ($date_format == 'yyyy-mm-dd' ? date('Y-m-d', $endtemp_ts) : ''));
    }
    $list_view = "";
    //labels of listview header
    if ($cal['view'] == 'day') {
        $colspan = 9;
        $header = array('0' => '#', '1' => $mod_strings['LBL_TIME'], '2' => $mod_strings['LBL_LIST_DUE_DATE'], '3' => $mod_strings['LBL_TODO']);
        $header_width = array('0' => '5%', '1' => '10%', '2' => '10%', '3' => '38%');
        /*if(getFieldVisibilityPermission('Calendar',$current_user->id,'parent_id') == '0')
        		{
        			array_push($header,$mod_strings['LBL_RELATEDTO']);
        			array_push($header_width,'15%');
        		}
        		if(getFieldVisibilityPermission('Calendar',$current_user->id,'contact_id') == '0')
        		{
        			array_push($header,$mod_strings['LBL_CONTACT_NAME']);
        			array_push($header_width,'15%');
        		}*/
        if (getFieldVisibilityPermission('Calendar', $current_user->id, 'taskstatus') == '0') {
            array_push($header, $mod_strings['LBL_STATUS']);
            array_push($header_width, '10%');
        }
        if (isPermitted("Calendar", "EditView") == "yes" || isPermitted("Calendar", "Delete") == "yes") {
            array_push($header, $mod_strings['LBL_ACTION']);
            array_push($header_width, '10%');
        }
        array_push($header, $mod_strings['LBL_ASSINGEDTO']);
        array_push($header_width, '15%');
    } else {
        $colspan = 10;
        $header = array('0' => '#', '1' => $mod_strings['LBL_TIME'], '2' => $mod_strings['LBL_START_DATE'], '3' => $mod_strings['LBL_DUE_DATE'], '4' => $mod_strings['LBL_TODO']);
        $header_width = array('0' => '5%', '1' => '10%', '2' => '10%', '3' => '10%', '4' => '28%');
        /*if(getFieldVisibilityPermission('Calendar',$current_user->id,'parent_id') == '0')
        		{
        			array_push($header,$mod_strings['LBL_RELATEDTO']);
        			array_push($header_width,'15%');
        		}
        		if(getFieldVisibilityPermission('Calendar',$current_user->id,'contact_id') == '0')
        		{
        			array_push($header,$mod_strings['LBL_CONTACT_NAME']);
        			array_push($header_width,'15%');
        		}*/
        if (getFieldVisibilityPermission('Calendar', $current_user->id, 'taskstatus') == '0') {
            array_push($header, $mod_strings['LBL_STATUS']);
            array_push($header_width, '10%');
        }
        if (isPermitted("Calendar", "EditView") == "yes" || isPermitted("Calendar", "Delete") == "yes") {
            array_push($header, $mod_strings['LBL_ACTION']);
        }
        array_push($header, $mod_strings['LBL_ASSINGEDTO']);
        array_push($header_width, '15%');
    }
    if ($current_user->column_fields['is_admin'] == 'on') {
        $Res = $adb->pquery("select * from vtiger_activitytype", array());
    } else {
        $roleid = $current_user->roleid;
        $subrole = getRoleSubordinates($roleid);
        if (count($subrole) > 0) {
            $roleids = $subrole;
            array_push($roleids, $roleid);
        } else {
            $roleids = $roleid;
        }
        if (count($roleids) > 1) {
            $Res = $adb->pquery("select distinct activitytype from  vtiger_activitytype inner join vtiger_role2picklist on vtiger_role2picklist.picklistvalueid = vtiger_activitytype.picklist_valueid where roleid in (" . generateQuestionMarks($roleids) . ") and picklistid in (select picklistid from vtiger_activitytype) order by sortid asc", array($roleids));
        } else {
            $Res = $adb->pquery("select distinct activitytype from vtiger_activitytype inner join vtiger_role2picklist on vtiger_role2picklist.picklistvalueid = vtiger_activitytype.picklist_valueid where roleid = ? and picklistid in (select picklistid from vtiger_activitytype) order by sortid asc", array($roleid));
        }
    }
    $eventlist = '';
    for ($i = 0; $i < $adb->num_rows($Res); $i++) {
        $eventlist .= $adb->query_result($Res, $i, 'activitytype') . ";";
    }
    $list_view .= "<table align='center' border='0' cellpadding='5' cellspacing='0' width='98%'>\n\t\t\t<tr><td colspan='3'>&nbsp;</td></tr>";
    //checking permission for Create/Edit Operation
    if (isPermitted("Calendar", "EditView") == "yes") {
        $list_view .= "<tr>\n\t\t\t\t<td class='calAddButton' onMouseOver='fnAddEvent(this,\"addEventDropDown\",\"" . $temp_date . "\",\"" . $endtemp_date . "\",\"" . $time_arr['starthour'] . "\",\"" . $time_arr['startmin'] . "\",\"" . $time_arr['startfmt'] . "\",\"" . $time_arr['endhour'] . "\",\"" . $time_arr['endmin'] . "\",\"" . $time_arr['endfmt'] . "\",\"\",\"" . $subtab . "\",\"" . $eventlist . "\");'style='border: 1px solid #666666;cursor:pointer;height:30px' align='center' width='10%'>\n                                        " . $mod_strings['LBL_ADD'] . "\n                                        <img src='" . vtiger_imageurl('menuDnArrow.gif', $theme) . "' style='padding-left: 5px;' border='0'>                                                                                                                         </td>";
    } else {
        $list_view .= "<tr><td>&nbsp;</td>";
    }
    $list_view .= "<td align='center' width='60%'><span id='total_activities'>" . getTodoInfo($cal, 'listcnt') . "</span>&nbsp;</td>\n\t\t\t\t<td align='right' width='28%'>&nbsp;</td>\n\t\t\t</tr>\n\t\t</table>\n\n\t\t\t<br><table style='background-color: rgb(204, 204, 204);' class='small' align='center' border='0' cellpadding='5' cellspacing='1' width='98%'>\n                        ";
    $header_rows = count($header);
    $navigationOutput = getTableHeaderNavigation($navigation_array, $url_string, "Calendar", "index");
    if ($navigationOutput != '') {
        $list_view .= "<tr width=100% bgcolor=white><td align=center colspan={$header_rows}>";
        $list_view .= "<table align=center width='98%'><tr>" . $navigationOutput . "</tr></table></td></tr>";
    }
    $list_view .= "<tr>";
    for ($i = 0; $i < $header_rows; $i++) {
        $list_view .= "<td class='lvtCol' width='" . $header_width[$i] . "' nowrap='nowrap'>" . $header[$i] . "</td>";
    }
    $list_view .= "</tr>";
    $rows = count($todo_list);
    if ($rows != 0) {
        for ($i = 0; $i < count($todo_list); $i++) {
            $list_view .= "<tr style='height: 25px;' bgcolor='white'>";
            foreach ($todo_list[$i] as $key => $entry) {
                $list_view .= "<td>" . $entry . "</td>";
            }
            $list_view .= "</tr>";
        }
    } else {
        $list_view .= "<tr><td style='background-color:#efefef;height:340px' align='center' colspan='" . $colspan . "'>";
        $list_view .= "<div style='border: 3px solid rgb(153, 153, 153); background-color: rgb(255, 255, 255); width: 45%; position: relative; z-index: 5000;'>\n\t\t\t<table border='0' cellpadding='5' cellspacing='0' width='98%'>\n\t\t\t<tr>\n\t\t\t\t<td rowspan='2' width='25%'>\n\t\t\t\t\t<img src='" . vtiger_imageurl('empty.jpg', $theme) . "' height='60' width='61'></td>\n\t\t\t\t<td style='border-bottom: 1px solid rgb(204, 204, 204);' nowrap='nowrap' width='75%'><span class='genHeaderSmall'>" . $app_strings['LBL_NO'] . " " . $app_strings['Todos'] . " " . $app_strings['LBL_FOUND'] . " !</span></td>\n\t\t\t</tr>\n\t\t\t<tr>";
        //checking permission for Create/Edit Operation
        if (isPermitted("Calendar", "EditView") == "yes") {
            $list_view .= "<td class='small' align='left' nowrap='nowrap'>" . $app_strings['LBL_YOU_CAN_CREATE'] . "&nbsp;" . $app_strings['LBL_A'] . "&nbsp;" . $app_strings['Todo'] . "&nbsp;" . $app_strings['LBL_NOW'] . ".&nbsp;" . $app_strings['LBL_CLICK_THE_LINK'] . "&nbsp;:<br>\n\t\t\t\t\t&nbsp;&nbsp;-<a href='javascript:void(0);' onClick='gshow(\"createTodo\",\"todo\",\"" . $temp_date . "\",\"" . $temp_date . "\",\"" . $time_arr['starthour'] . "\",\"" . $time_arr['startmin'] . "\",\"" . $time_arr['startfmt'] . "\",\"" . $time_arr['endhour'] . "\",\"" . $time_arr['endmin'] . "\",\"" . $time_arr['endfmt'] . "\",\"listview\",\"todo\");'>" . $app_strings['LBL_CREATE'] . " " . $app_strings['LBL_A'] . " " . $app_strings['Todo'] . "</a>\n\t\t\t\t\t</td>";
        } else {
            $list_view .= "<td class='small' align='left' nowrap='nowrap'>" . $app_strings['LBL_YOU_ARE_NOT_ALLOWED_TO_CREATE'] . "&nbsp;" . $app_strings['LBL_A'] . "&nbsp;" . $app_strings['Todo'] . "<br></td>";
        }
        $list_view .= "</tr>\n\t\t\t</table>\n\t\t\t</div>";
        $list_view .= "</td></tr>";
    }
    $list_view .= "</table><br>";
    $cal_log->debug("Exiting constructTodoListView() method...");
    return $list_view;
}
Example #5
0
/** Function to return the duplicate records data as a formatted array */
function getDuplicateRecordsArr($module)
{
    global $adb, $app_strings, $list_max_entries_per_page, $theme;
    $field_values_array = getFieldValues($module);
    $field_values = $field_values_array['fieldnames_list'];
    $fld_arr = $field_values_array['fieldnames_array'];
    $col_arr = $field_values_array['columnnames_array'];
    $fld_labl_arr = $field_values_array['fieldlabels_array'];
    $ui_type = $field_values_array['fieldname_uitype'];
    $dup_query = getDuplicateQuery($module, $field_values, $ui_type);
    // added for page navigation
    $dup_count_query = substr($dup_query, stripos($dup_query, 'FROM'), strlen($dup_query));
    $dup_count_query = "SELECT count(*) as count " . $dup_count_query;
    $count_res = $adb->query($dup_count_query);
    $no_of_rows = $adb->query_result($count_res, 0, "count");
    if ($no_of_rows <= $list_max_entries_per_page) {
        $_SESSION['dup_nav_start' . $module] = 1;
    } else {
        if (isset($_REQUEST["start"]) && $_REQUEST["start"] != "" && $_SESSION['dup_nav_start' . $module] != $_REQUEST["start"]) {
            $_SESSION['dup_nav_start' . $module] = ListViewSession::getRequestStartPage();
        }
    }
    $start = $_SESSION['dup_nav_start' . $module] != "" ? $_SESSION['dup_nav_start' . $module] : 1;
    $navigation_array = getNavigationValues($start, $no_of_rows, $list_max_entries_per_page);
    $start_rec = $navigation_array['start'];
    $end_rec = $navigation_array['end_val'];
    $navigationOutput = getTableHeaderNavigation($navigation_array, "", $module, "FindDuplicate", "");
    if ($start_rec == 0) {
        $limit_start_rec = 0;
    } else {
        $limit_start_rec = $start_rec - 1;
    }
    $dup_query .= " LIMIT {$limit_start_rec}, {$list_max_entries_per_page}";
    //ends
    $nresult = $adb->query($dup_query);
    $no_rows = $adb->num_rows($nresult);
    require_once 'modules/Vtiger/layout_utils.php';
    if ($no_rows == 0) {
        if ($_REQUEST['action'] == 'FindDuplicateRecords') {
            //echo "<br><br><center>".$app_strings['LBL_NO_DUPLICATE']." <a href='javascript:window.history.back()'>".$app_strings['LBL_GO_BACK'].".</a></center>";
            //die;
            echo "<link rel='stylesheet' type='text/css' href='themes/{$theme}/style.css'>";
            echo "<table border='0' cellpadding='5' cellspacing='0' width='100%' height='450px'><tr><td align='center'>";
            echo "<div style='border: 3px solid rgb(153, 153, 153); background-color: rgb(255, 255, 255); width: 55%; position: relative; z-index: 10000000;'>\n\n\t\t\t\t<table border='0' cellpadding='5' cellspacing='0' width='98%'>\n\t\t\t\t<tbody><tr>\n\t\t\t\t<td rowspan='2' width='11%'><img src='" . vtiger_imageurl('empty.jpg', $theme) . "' ></td>\n\t\t\t\t<td style='border-bottom: 1px solid rgb(204, 204, 204);' nowrap='nowrap' width='70%'><span class='genHeaderSmall'>{$app_strings['LBL_NO_DUPLICATE']}</span></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t<td class='small' align='right' nowrap='nowrap'>\n\t\t\t\t<a href='javascript:window.history.back();'>{$app_strings['LBL_GO_BACK']}</a><br>     </td>\n\t\t\t\t</tr>\n\t\t\t\t</tbody></table>\n\t\t\t\t</div>";
            echo "</td></tr></table>";
            exit;
        } else {
            echo "<br><br><table align='center' class='reportCreateBottom big' width='95%'><tr><td align='center'>" . $app_strings['LBL_NO_DUPLICATE'] . "</td></tr></table>";
            die;
        }
    }
    $rec_cnt = 0;
    $temp = array();
    $sl_arr = array();
    $grp = "group0";
    $gcnt = 0;
    $ii = 0;
    //ii'th record in group
    while ($rec_cnt < $no_rows) {
        $result = $adb->fetchByAssoc($nresult);
        //echo '<pre>';print_r($result);echo '</pre>';
        if ($rec_cnt != 0) {
            $sl_arr = array_slice($result, 2);
            array_walk($temp, 'lower_array');
            array_walk($sl_arr, 'lower_array');
            $arr_diff = array_diff($temp, $sl_arr);
            if (count($arr_diff) > 0) {
                $gcnt++;
                $temp = $sl_arr;
                $ii = 0;
            }
            $grp = "group" . $gcnt;
        }
        $fld_values[$grp][$ii]['recordid'] = $result['recordid'];
        for ($k = 0; $k < count($col_arr); $k++) {
            if ($rec_cnt == 0) {
                $temp[$fld_labl_arr[$k]] = $result[$col_arr[$k]];
            }
            if ($ui_type[$fld_arr[$k]] == 56) {
                if ($result[$col_arr[$k]] == 0) {
                    $result[$col_arr[$k]] = $app_strings['no'];
                } else {
                    $result[$col_arr[$k]] = $app_strings['yes'];
                }
            }
            if ($ui_type[$fld_arr[$k]] == 75 || $ui_type[$fld_arr[$k]] == 81) {
                $vendor_id = $result[$col_arr[$k]];
                if ($vendor_id != '') {
                    $vendor_name = getVendorName($vendor_id);
                }
                $result[$col_arr[$k]] = $vendor_name;
            }
            if ($ui_type[$fld_arr[$k]] == 57) {
                $contact_id = $result[$col_arr[$k]];
                if ($contact_id != '') {
                    $parent_module = 'Contacts';
                    $displayValueArray = getEntityName($parent_module, $contact_id);
                    if (!empty($displayValueArray)) {
                        foreach ($displayValueArray as $key => $field_value) {
                            $contactname = $field_value;
                        }
                    }
                }
                $result[$col_arr[$k]] = $contactname;
            }
            if ($ui_type[$fld_arr[$k]] == 15 || $ui_type[$fld_arr[$k]] == 16) {
                $result[$col_arr[$k]] = getTranslatedString($result[$col_arr[$k]], $module);
            }
            if ($ui_type[$fld_arr[$k]] == 33) {
                $fieldvalue = explode(' |##| ', $result[$col_arr[$k]]);
                $result[$col_arr[$k]] = array();
                foreach ($fieldvalue as $picklistValue) {
                    $result[$col_arr[$k]][] = getTranslatedString($picklistValue, $module);
                }
                $result[$col_arr[$k]] = implode(', ', $result[$col_arr[$k]]);
            }
            if ($ui_type[$fld_arr[$k]] == 68) {
                $parent_id = $result[$col_arr[$k]];
                if ($parent_id != '') {
                    $parentname = getParentName($parent_id);
                }
                $result[$col_arr[$k]] = $parentname;
            }
            if ($ui_type[$fld_arr[$k]] == 53 || $ui_type[$fld_arr[$k]] == 52) {
                if ($result[$col_arr[$k]] != '') {
                    $owner = getOwnerName($result[$col_arr[$k]]);
                }
                $result[$col_arr[$k]] = $owner;
            }
            if ($ui_type[$fld_arr[$k]] == 50 or $ui_type[$fld_arr[$k]] == 51) {
                if ($module != 'Products') {
                    $entity_name = getAccountName($result[$col_arr[$k]]);
                } else {
                    $entity_name = getProductName($result[$col_arr[$k]]);
                }
                if ($entity_name != '') {
                    $result[$col_arr[$k]] = $entity_name;
                } else {
                    $result[$col_arr[$k]] = '';
                }
            }
            if ($ui_type[$fld_arr[$k]] == 58) {
                $campaign_name = getCampaignName($result[$col_arr[$k]]);
                if ($campaign_name != '') {
                    $result[$col_arr[$k]] = $campaign_name;
                } else {
                    $result[$col_arr[$k]] = '';
                }
            }
            if ($ui_type[$fld_arr[$k]] == 59) {
                $product_name = getProductName($result[$col_arr[$k]]);
                if ($product_name != '') {
                    $result[$col_arr[$k]] = $product_name;
                } else {
                    $result[$col_arr[$k]] = '';
                }
            }
            /*uitype 10 handling*/
            if ($ui_type[$fld_arr[$k]] == 10) {
                $result[$col_arr[$k]] = getRecordInfoFromID($result[$col_arr[$k]]);
            }
            if ($ui_type[$fld_arr[$k]] == 5 || $ui_type[$fld_arr[$k]] == 6 || $ui_type[$fld_arr[$k]] == 23) {
                if (${$result}[$col_arr[$k]] != '' && ${$result}[$col_arr[$k]] != '0000-00-00') {
                    $date = new DateTimeField(${$result}[$col_arr[$k]]);
                    $value = $date->getDisplayDate();
                    if (strpos(${$result}[$col_arr[$k]], ' ') > -1) {
                        $value .= ' ' . $date->getDisplayTime();
                    }
                } elseif (${$result}[$col_arr[$k]] == '0000-00-00') {
                    $value = '';
                } else {
                    $value = ${$result}[$col_arr[$k]];
                }
                $result[$col_arr[$k]] = $value;
            }
            if ($ui_type[$fld_arr[$k]] == 71) {
                $result[$col_arr[$k]] = CurrencyField::convertToUserFormat($result[$col_arr[$k]]);
            }
            if ($ui_type[$fld_arr[$k]] == 72) {
                $result[$col_arr[$k]] = CurrencyField::convertToUserFormat($result[$col_arr[$k]], null, true);
            }
            $fld_values[$grp][$ii][$fld_labl_arr[$k]] = $result[$col_arr[$k]];
        }
        $fld_values[$grp][$ii]['Entity Type'] = $result['deleted'];
        $ii++;
        $rec_cnt++;
    }
    $gro = "group";
    for ($i = 0; $i < $no_rows; $i++) {
        $ii = 0;
        $dis_group[] = $fld_values[$gro . $i][$ii];
        $count_group[$i] = count($fld_values[$gro . $i]);
        $ii++;
        $new_group[] = $dis_group[$i];
    }
    $fld_nam = $new_group[0];
    $ret_arr[0] = $fld_values;
    $ret_arr[1] = $fld_nam;
    $ret_arr[2] = $ui_type;
    $ret_arr["navigation"] = $navigationOutput;
    return $ret_arr;
}
Example #6
0
} else {
    $limit_start_rec = $start_rec - 1;
}
$list_result = $adb->limitQuery2($query, $limit_start_rec, $list_max_entries_per_page, $query_order_by, $sorder);
$record_string = $app_strings["LBL_SHOWING"] . " " . $start_rec . " - " . $end_rec . " " . $app_strings["LBL_LIST_OF"] . " " . $noofrows;
//Retreive the List View Table Header
if ($viewid != '') {
    $url_string .= "&viewname=" . $viewid;
}
$listview_header = getListViewHeader($focus, "Memdays", $url_string, $sorder, $order_by, "", $oCustomView);
$smarty->assign("LISTHEADER", $listview_header);
$listview_header_search = getSearchListHeaderValues($focus, "Memdays", $url_string, $sorder, $order_by, "", $oCustomView);
$smarty->assign("SEARCHLISTHEADER", $listview_header_search);
$listview_entries = getListViewEntries($focus, "Memdays", $list_result, $navigation_array, "", "", "EditView", "Delete", $oCustomView);
$smarty->assign("LISTENTITY", $listview_entries);
$navigationOutput = getTableHeaderNavigation($navigation_array, $url_string, "Memdays", "index", $viewid);
//setup alphabetical search field
$alphabetical = AlphabeticalSearch($currentModule, 'index', 'memdayname', 'true', 'basic', "", "", "", "", $viewid, "", $alpbtselectedvalue);
$fieldnames = getAdvSearchfields($module);
$criteria = getcriteria_options();
$smarty->assign("CRITERIA", $criteria);
$smarty->assign("FIELDNAMES", $fieldnames);
$smarty->assign("ALPHABETICAL", $alphabetical);
$smarty->assign("NAVIGATION", $navigationOutput);
$smarty->assign("RECORD_COUNTS", $record_string);
//changed by dingjianting on 2007-3-1 for security view scope
$viewscope = get_viewscope($module);
$smarty->assign("VIEWSCOPE_OPTION", getViewScopeFilterHTML($module, $viewscope));
$check_button = Button_Check($module);
$smarty->assign("CHECK", $check_button);
$smarty->assign("ISADMIN", $current_user->is_admin);
Example #7
0
$userid = vtlib_purify($_REQUEST['userid']);
$qry = "select * from vtiger_audit_trial where userid = ? ";
$qry_result = $adb->pquery($qry, array($userid));
$no_of_rows = $adb->num_rows($qry_result);
//Retreiving the start value from request
if (isset($_REQUEST['start']) && $_REQUEST['start'] != '') {
    $start = vtlib_purify($_REQUEST['start']);
} else {
    $start = 1;
}
//Retreive the Navigation array
$navigation_array = getNavigationValues($start, $no_of_rows, '100');
$start_rec = $navigation_array['start'];
$end_rec = $navigation_array['end_val'];
$record_string = $app_strings['LBL_SHOWING'] . " " . $start_rec . " - " . $end_rec . " " . $app_strings['LBL_LIST_OF'] . " " . $no_of_rows;
$navigationOutput = getTableHeaderNavigation($navigation_array, $url_string, "Settings", "ShowAuditTrail", '');
$smarty->assign("MOD", $current_module_strings);
$smarty->assign("CMOD", $mod_strings);
$smarty->assign("APP", $app_strings);
$smarty->assign("THEME", $theme);
$smarty->assign("IMAGE_PATH", $image_path);
$smarty->assign("THEME_PATH", $theme_path);
$smarty->assign("LIST_HEADER", $focus->getAuditTrailHeader());
$smarty->assign("LIST_ENTRIES", $focus->getAuditTrailEntries($userid, $navigation_array, $sorder, $sortby));
$smarty->assign("RECORD_COUNTS", $record_string);
$smarty->assign("NAVIGATION", $navigationOutput);
$smarty->assign("USERID", $userid);
$smarty->assign("CATEGORY", $category);
if ($_REQUEST['ajax'] != '') {
    $smarty->display("ShowAuditTrailContents.tpl");
} else {
$focus = new LoginHistory();
$smarty = new vtigerCRM_Smarty();
$category = getParenttab();
$userid = $_REQUEST['record'];
$username = getUserName($userid);
$qry = "Select * from vtiger_loginhistory where user_name= ?";
$qry_result = $adb->pquery($qry, array($username));
$no_of_rows = $adb->num_rows($qry_result);
//Retreiving the start value from request
if (isset($_REQUEST['start']) && $_REQUEST['start'] != '') {
    $start = vtlib_purify($_REQUEST['start']);
} else {
    $start = 1;
}
//Retreive the Navigation array
$navigation_array = getNavigationValues($start, $no_of_rows, '10');
$start_rec = $navigation_array['start'];
$end_rec = $navigation_array['end_val'];
$record_string = $app_strings[LBL_SHOWING] . " " . $start_rec . " - " . $end_rec . " " . $app_strings[LBL_LIST_OF] . " " . $no_of_rows;
$navigationOutput = getTableHeaderNavigation($navigation_array, $url_string, "Users", "ShowHistory", '');
$smarty->assign("CMOD", $mod_strings);
$smarty->assign("MOD", return_module_language($current_language, "Settings"));
$smarty->assign("APP", $app_strings);
$smarty->assign("THEME", $theme);
$smarty->assign("IMAGE_PATH", $image_path);
$smarty->assign("LIST_HEADER", $focus->getHistoryListViewHeader());
$smarty->assign("LIST_ENTRIES", $focus->getHistoryListViewEntries($username, $navigation_array, $sorder, $sortby));
$smarty->assign("RECORD_COUNTS", $record_string);
$smarty->assign("NAVIGATION", $navigationOutput);
$smarty->assign("CATEGORY", $category);
$smarty->display("ShowHistoryContents.tpl");
Example #9
0
     $smarty->assign("MODULE", $module_name);
     $smarty->assign("MODULELABEL", getTranslatedString($module_name, $module_name));
     $smarty->assign("SINGLE_MOD", $module_name);
     $smarty->assign("SHOW_MASS_SELECT", 'false');
     //Retreiving the start value from request
     if ($module_name == $_REQUEST['nav_module'] && isset($_REQUEST['start']) && $_REQUEST['start'] != '') {
         $start = vtlib_purify($_REQUEST['start']);
     } else {
         $start = 1;
     }
     $info_message = '&recordcount=' . vtlib_purify($_REQUEST['recordcount']) . '&noofrows=' . vtlib_purify($_REQUEST['noofrows']) . '&message=' . vtlib_purify($_REQUEST['message']) . '&skipped_record_count=' . vtlib_purify($_REQUEST['skipped_record_count']);
     $url_string = '&modulename=' . vtlib_purify($_REQUEST['modulename']) . '&nav_module=' . $module_name . $info_message;
     $viewid = '';
     //Retreive the Navigation array
     $navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page);
     $navigationOutput = getTableHeaderNavigation($navigation_array, $url_string, "Import", "ImportSteplast", $viewid);
     //Retreive the List View Header and Entries
     $listview_header = getListViewHeader($object, $module_name);
     $listview_entries = getListViewEntries($object, $module_name, $list_result, $navigation_array, "", "", "EditView", "Delete", "");
     //commented to remove navigation buttons from import list view
     //$smarty->assign("NAVIGATION", $navigationOutput);
     $smarty->assign("HIDE_CUSTOM_LINKS", 1);
     //Added to hide the CustomView links in imported records ListView
     // Remove all the links for the list view header as they do not work in this page.
     for ($i = 0; $i < count($listview_header); $i++) {
         $listview_header[$i] = strip_tags($listview_header[$i]);
     }
     $smarty->assign("LISTHEADER", $listview_header);
     $smarty->assign("LISTENTITY", $listview_entries);
     $smarty->display("ListViewEntries.tpl");
 }
Example #10
0
foreach ($listview_header as $key => $header) {
    if (in_array($key, $orderkeycol)) {
        $sorderimg = "";
        $newsorder = "asc";
        if ($order_by == $key) {
            if ($sorder == 'asc') {
                $newsorder = "desc";
                $sorderimg = "<img border=0 src='themes/softed/images/arrow_up.gif'>";
            } else {
                $sorderimg = "<img border=0 src='themes/softed/images/arrow_down.gif'>";
            }
        }
        $orderhtml = '<a href="javascript:;"  class="listFormHeaderLinks" 
						onclick="getOrderBy(\'order_by=' . $key . '&sorder=' . $newsorder . '\');return false;">' . $header . $sorderimg . '</a>';
    } else {
        $orderhtml = $header;
    }
    $headerhtml .= "<td class='lvtCol' nowrap>{$orderhtml}</td>";
}
$smarty->assign("headerhtml", $headerhtml);
$smarty->assign("MOD", return_module_language($current_language, 'Settings'));
$record_string = $app_strings["LBL_SHOWING"] . " " . $start_rec . " - " . $end_rec . " " . $app_strings["LBL_LIST_OF"] . " " . $noofrows;
$navigationOutput = getTableHeaderNavigation($navigation_array, '', "Settings", "SmsTcManage", '');
$smarty->assign("NAVIGATION", $navigationOutput);
$smarty->assign("RECORD_COUNTS", $record_string);
$smarty->assign("search_url", $search_url);
$smarty->assign("IMAGE_PATH", $image_path);
$smarty->assign("APP", $app_strings);
$smarty->assign("CMOD", $mod_strings);
$smarty->assign("SETTYPE", "SmsTcManage");
$smarty->display("Settings/SmsTcManage.tpl");
Example #11
0
foreach ($listview_header as $key => $header) {
    if (in_array($key, $orderkeycol)) {
        $sorderimg = "";
        $newsorder = "asc";
        if ($order_by == $key) {
            if ($sorder == 'asc') {
                $newsorder = "desc";
                $sorderimg = "<img border=0 src='themes/softed/images/arrow_up.gif'>";
            } else {
                $sorderimg = "<img border=0 src='themes/softed/images/arrow_down.gif'>";
            }
        }
        $orderhtml = '<a href="javascript:;"  class="listFormHeaderLinks" 
						onclick="getOrderBy(\'order_by=' . $key . '&sorder=' . $newsorder . '\');return false;">' . $header . $sorderimg . '</a>';
    } else {
        $orderhtml = $header;
    }
    $headerhtml .= "<td class='lvtCol' nowrap>{$orderhtml}</td>";
}
$smarty->assign("headerhtml", $headerhtml);
$smarty->assign("MOD", return_module_language($current_language, 'Settings'));
$record_string = $app_strings["LBL_SHOWING"] . " " . $start_rec . " - " . $end_rec . " " . $app_strings["LBL_LIST_OF"] . " " . $noofrows;
$navigationOutput = getTableHeaderNavigation($navigation_array, '', "Settings", "Maillists", '');
$smarty->assign("NAVIGATION", $navigationOutput);
$smarty->assign("RECORD_COUNTS", $record_string);
$smarty->assign("search_url", $search_url);
$smarty->assign("order_url", $order_url);
$smarty->assign("IMAGE_PATH", $image_path);
$smarty->assign("APP", $app_strings);
$smarty->assign("CMOD", $mod_strings);
$smarty->display("Relsettings/Maillists.tpl");
Example #12
0
    $limit_start_rec = $start_rec - 1;
}
$list_result = $adb->limitQuery2($list_query, $limit_start_rec, $list_max_entries_per_page, $query_order_by, $sorder);
$record_string = $app_strings["LBL_SHOWING"] . " " . $start_rec . " - " . $end_rec . " " . $app_strings["LBL_LIST_OF"] . " " . $noofrows;
//Retreive the List View Table Header
if ($viewid != '') {
    $url_string .= "&viewname=" . $viewid;
}
$listview_header = getListViewHeader($focus, "SalesOrder", $url_string, $sorder, $order_by, "", $oCustomView);
$smarty->assign("LISTHEADER", $listview_header);
$listview_header_search = getSearchListHeaderValues($focus, "SalesOrder", $url_string, $sorder, $order_by, "", $oCustomView);
$smarty->assign("SEARCHLISTHEADER", $listview_header_search);
$listview_entries = getListViewEntries($focus, "SalesOrder", $list_result, $navigation_array, '', '&return_module=SalesOrder&return_action=index', 'EditView', 'Delete', $oCustomView);
$smarty->assign("LISTENTITY", $listview_entries);
//$smarty->assign("SELECT_SCRIPT", $view_script);
$navigationOutput = getTableHeaderNavigation($navigation_array, $url_string, "SalesOrder", 'index', $viewid);
$fieldnames = getAdvSearchfields($module);
$criteria = getcriteria_options();
$smarty->assign("CRITERIA", $criteria);
$smarty->assign("FIELDNAMES", $fieldnames);
$smarty->assign("NAVIGATION", $navigationOutput);
$smarty->assign("RECORD_COUNTS", $record_string);
$smarty->assign("CUSTOMVIEW_OPTION", $customviewcombo_html);
$smarty->assign("VIEWID", $viewid);
$smarty->assign("BUTTONS", $other_text);
$smarty->assign("ISADMIN", $current_user->is_admin);
if (isset($_REQUEST['ajax']) && $_REQUEST['ajax'] != '') {
    $smarty->display("SalesOrder/ListViewEntries.tpl");
} else {
    $smarty->display("SalesOrder/ListView.tpl");
}
Example #13
0
$smarty->assign("LISTENTITY", $listview_entries);
foreach ($listview_header as $key => $header) {
    if (in_array($key, $orderkeycol)) {
        $sorderimg = "";
        $newsorder = "asc";
        if ($order_by == $key) {
            if ($sorder == 'asc') {
                $newsorder = "desc";
                $sorderimg = "<img border=0 src='themes/softed/images/arrow_up.gif'>";
            } else {
                $sorderimg = "<img border=0 src='themes/softed/images/arrow_down.gif'>";
            }
        }
        $orderhtml = '<a href="javascript:;"  class="listFormHeaderLinks" 
						onclick="getOrderBy(\'order_by=' . $key . '&sorder=' . $newsorder . '\');return false;">' . $header . $sorderimg . '</a>';
    } else {
        $orderhtml = $header;
    }
    $headerhtml .= "<td class='lvtCol' nowrap>{$orderhtml}</td>";
}
$smarty->assign("headerhtml", $headerhtml);
$smarty->assign("MOD", return_module_language($current_language, 'Settings'));
$record_string = $app_strings["LBL_SHOWING"] . " " . $start_rec . " - " . $end_rec . " " . $app_strings["LBL_LIST_OF"] . " " . $noofrows;
$navigationOutput = getTableHeaderNavigation($navigation_array, '', "Settings", "Liuyan", '');
$smarty->assign("NAVIGATION", $navigationOutput);
$smarty->assign("RECORD_COUNTS", $record_string);
$smarty->assign("search_url", $search_url);
$smarty->assign("IMAGE_PATH", $image_path);
$smarty->assign("APP", $app_strings);
$smarty->assign("CMOD", $mod_strings);
$smarty->display("Settings/Liuyan.tpl");
Example #14
0
                    $entries[] = "Yes";
                } else {
                    $entries[] = "No";
                }
            } elseif ($col == 'sendmsg') {
                $entries[] = wordwrap($row[$col], 10);
            } elseif ($col == 'id') {
                $entries[] = $i;
            } elseif ($col == 'sender') {
                $selectsql = "select user_name from ec_users where id=" . $row['userid'];
                $user_row = $adb->getFirstLine($selectsql);
                $entries[] = $user_row['user_name'];
            } else {
                $entries[] = $row[$col];
            }
        }
        $listview_entries[$id] = $entries;
        $i++;
    }
}
$smarty->assign("LISTENTITY", $listview_entries);
$smarty->assign("MOD", return_module_language($current_language, 'Settings'));
$record_string = $app_strings["LBL_SHOWING"] . " " . $start_rec . " - " . $end_rec . " " . $app_strings["LBL_LIST_OF"] . " " . $noofrows;
$navigationOutput = getTableHeaderNavigation($navigation_array, '', "Settings", "SmsUser", '');
$smarty->assign("NAVIGATION", $navigationOutput);
$smarty->assign("RECORD_COUNTS", $record_string);
$smarty->assign("search_url", $search_url);
$smarty->assign("IMAGE_PATH", $image_path);
$smarty->assign("APP", $app_strings);
$smarty->assign("CMOD", $mod_strings);
//$smarty->display("Relsettings/SmsLogs.tpl");
Example #15
0
     $limit_start_rec = 0;
 } else {
     $limit_start_rec = $start_rec - 1;
 }
 $list_result = $adb->limitQuery2($listquery, $limit_start_rec, $list_max_entries_per_page, $query_order_by, $sorder);
 $listview_header = getListViewHeader($focus, $module, "", "", "", "global", $oCustomView);
 $listview_entries = getListViewEntries($focus, $module, $list_result, $navigation_array, "", "", "", "", $oCustomView);
 //            echo $listquery;
 $record_string = $app_strings['LBL_SHOWING'] . " " . $start_rec . " - " . $end_rec . " " . $app_strings['LBL_LIST_OF'] . " " . $noofrows;
 //Do not display the Header if there are no entires in listview_entries
 if (count($listview_entries) > 0) {
     $display_header = 1;
 } else {
     $display_header = 0;
 }
 $navigationOutput = getTableHeaderNavigation($navigation_array, "", $module, "index");
 $smarty->assign("LISTHEADER", $listview_header);
 $smarty->assign("LISTENTITY", $listview_entries);
 $smarty->assign("DISPLAYHEADER", $display_header);
 $smarty->assign("HEADERCOUNT", count($listview_header));
 $smarty->assign("NAVIGATION", $navigationOutput);
 $smarty->assign("RECORD_COUNTS", $record_string);
 $total_record_count = $total_record_count + $noofrows;
 $smarty->assign("SEARCH_CRITERIA", "( {$noofrows} )--查找结果:" . $search_msg);
 $smarty->assign("MODULES_LIST", $object_array);
 if (isset($_REQUEST['ajax']) && $_REQUEST['ajax'] != '') {
     $smarty->display("GlobalListViewEntries.tpl");
 } else {
     $smarty->display("GlobalListView.tpl");
 }
 unset($_SESSION['lvs'][$module]);
Example #16
0
    }
}
if ($start_rec == 0) {
    $limit_start_rec = 0;
} else {
    $limit_start_rec = $start_rec - 1;
}
$list_result = $adb->limitQuery2($query, $limit_start_rec, $list_max_entries_per_page, $query_order_by, $sorder);
$record_string = $app_strings["LBL_SHOWING"] . " " . $start_rec . " - " . $end_rec . " " . $app_strings["LBL_LIST_OF"] . " " . $noofrows;
//Retreive the List View Table Header
if ($viewid != '') {
    $url_string .= "&viewname=" . $viewid;
}
$listview_header = getListViewHeader($focus, "Maillisttmps", $url_string, $sorder, $order_by, "", $oCustomView);
$smarty->assign("LISTHEADER", $listview_header);
$listview_header_search = getSearchListHeaderValues($focus, "Maillisttmps", $url_string, $sorder, $order_by, "", $oCustomView);
$smarty->assign("SEARCHLISTHEADER", $listview_header_search);
$listview_entries = getListViewEntries($focus, "Maillisttmps", $list_result, $navigation_array, "", "", "EditView", "Delete", $oCustomView);
$smarty->assign("LISTENTITY", $listview_entries);
$navigationOutput = getTableHeaderNavigation($navigation_array, $url_string, "Maillisttmps", "index", $viewid);
$fieldnames = getAdvSearchfields($module);
$criteria = getcriteria_options();
$smarty->assign("CRITERIA", $criteria);
$smarty->assign("FIELDNAMES", $fieldnames);
$smarty->assign("NAVIGATION", $navigationOutput);
$smarty->assign("RECORD_COUNTS", $record_string);
if (isset($_REQUEST['ajax']) && $_REQUEST['ajax'] != '') {
    $smarty->display("Maillisttmps/ListViewEntries.tpl");
} else {
    $smarty->display("Maillisttmps/ListView.tpl");
}