Beispiel #1
1
$parent_tab = getParentTab();
$smarty->assign("CATEGORY", $parent_tab);
$url = '';
$popuptype = '';
$popuptype = vtlib_purify($_REQUEST["popuptype"]);
$theme_path = "themes/" . $theme . "/";
$image_path = $theme_path . "images/";
$smarty->assign("MOD", $mod_strings);
$smarty->assign("APP", $app_strings);
$smarty->assign("THEME", $theme);
$smarty->assign("THEME_PATH", $theme_path);
$smarty->assign("MODULE", $currentModule);
// Gather the custom link information to display
include_once 'vtlib/Vtiger/Link.php';
$hdrcustomlink_params = array('MODULE' => $currentModule);
$COMMONHDRLINKS = Vtiger_Link::getAllByType(Vtiger_Link::IGNORE_MODULE, array('HEADERSCRIPT_POPUP', 'HEADERCSS_POPUP'), $hdrcustomlink_params);
$smarty->assign('HEADERSCRIPTS', $COMMONHDRLINKS['HEADERSCRIPT_POPUP']);
$smarty->assign('HEADERCSS', $COMMONHDRLINKS['HEADERCSS_POPUP']);
// END
$qc_modules = getQuickCreateModules();
for ($i = 0; $i < count($qc_modules); $i++) {
    $qcmod[$i] = $qc_modules[$i][1];
}
$smarty->assign("QCMODULEARRAY", $qcmod);
$suri = vtlib_purify($_SERVER["REQUEST_URI"]);
$suri = substr($suri, strpos($suri, '?') + 1);
$smarty->assign("POPUP", str_replace('&', '-a;', $suri) . '-a;popqc=true');
if (!empty($_REQUEST['popqc']) and $_REQUEST['popqc'] = 'true' and empty($_REQUEST['advft_criteria']) and !empty($_REQUEST['record'])) {
    $fldrs = $adb->query("SELECT vtiger_field.fieldlabel,vtiger_field.tablename,vtiger_field.columnname,vtiger_field.fieldname,vtiger_entityname.entityidfield\n\t\t\tFROM vtiger_field\n\t\t\tINNER JOIN vtiger_entityname on vtiger_field.tabid=vtiger_entityname.tabid and modulename='{$currentModule}' WHERE uitype=4");
    $row = $adb->fetch_array($fldrs);
    $fieldLabelEscaped = str_replace(" ", "_", $row['fieldlabel']);
require_once 'include/Menu.php';
//Assign the entered global search string to a variable and display it again
if ($_REQUEST['query_string'] != '') {
    $smarty_obj->assign("QUERY_STRING", htmlspecialchars($_REQUEST['query_string'], ENT_QUOTES, $default_charset));
} else {
    $smarty_obj->assign("QUERY_STRING", "{$app_strings['LBL_SEARCH_STRING']}");
}
global $module_menu;
require_once 'data/Tracker.php';
$tracFocus = new Tracker();
$list = $tracFocus->get_recently_viewed($current_user->id);
$smarty_obj->assign("TRACINFO", $list);
// Gather the custom link information to display
include_once 'vtlib/Vtiger/Link.php';
$hdrcustomlink_params = array('MODULE' => $currentModule);
$COMMONHDRLINKS = Vtiger_Link::getAllByType(Vtiger_Link::IGNORE_MODULE, array('ONDEMANDLINK', 'HEADERLINK', 'HEADERSCRIPT', 'HEADERCSS'), $hdrcustomlink_params);
$smarty_obj->assign('HEADERLINKS', $COMMONHDRLINKS['HEADERLINK']);
$smarty_obj->assign('ONDEMANDLINKS', $COMMONHDRLINKS['ONDEMANDLINK']);
$smarty_obj->assign('HEADERSCRIPTS', $COMMONHDRLINKS['HEADERSCRIPT']);
$smarty_obj->assign('HEADERCSS', $COMMONHDRLINKS['HEADERCSS']);
// END
// Pass on the version information
global $vtiger_current_version;
$smarty_obj->assign('VERSION', $vtiger_current_version);
// END
$sql = "select * from vtiger_organizationdetails";
$result = $adb->pquery($sql, array());
//Handle for allowed organation logo/logoname likes UTF-8 Character
$organization_logo = decode_html($adb->query_result($result, 0, 'logoname'));
$smarty_obj->assign("LOGO", $organization_logo);
$smarty_obj->display(vtlib_getModuleTemplate($currentModule, 'Reports4YouHeader.tpl'));
Beispiel #3
0
 /**
  * Function to get all the Vtiger Link Models for a module of the given list of link types
  * @param <Number> $tabid
  * @param <Array> $type
  * @param <Array> $parameters
  * @return <Array> - List of Vtiger_Link_Model instances
  */
 public static function getAllByType($tabid, $type = false, $parameters = false)
 {
     $links = Vtiger_Cache::get('links-' . $tabid, $type);
     if (!$links) {
         $links = parent::getAllByType($tabid, $type, $parameters);
         Vtiger_Cache::set('links-' . $tabid, $type, $links);
     }
     $linkModels = array();
     foreach ($links as $linkType => $linkObjects) {
         foreach ($linkObjects as $linkObject) {
             $linkModels[$linkType][] = self::getInstanceFromLinkObject($linkObject);
         }
     }
     if (!is_array($type)) {
         $type = array($type);
     }
     $diffTypes = array_diff($type, array_keys($linkModels));
     foreach ($diffTypes as $linkType) {
         $linkModels[$linkType] = array();
     }
     return $linkModels;
 }
$smarty->assign('VALIDATION_DATA_FIELDDATATYPE', $validationArray['datatype']);
$smarty->assign('VALIDATION_DATA_FIELDLABEL', $validationArray['fieldlabel']);
$smarty->assign('EDIT_PERMISSION', isPermitted($currentModule, 'EditView', $record));
$smarty->assign('CHECK', $tool_buttons);
if (PerformancePrefs::getBoolean('DETAILVIEW_RECORD_NAVIGATION', true) && isset($_SESSION[$currentModule . '_listquery'])) {
    $recordNavigationInfo = ListViewSession::getListViewNavigation($focus->id);
    VT_detailViewNavigation($smarty, $recordNavigationInfo, $focus->id);
}
$smarty->assign('IS_REL_LIST', isPresentRelatedLists($currentModule));
$smarty->assign('SinglePane_View', $singlepane_view);
if ($singlepane_view == 'true') {
    $related_array = getRelatedLists($currentModule, $focus);
    $smarty->assign("RELATEDLISTS", $related_array);
}
if (isPermitted($currentModule, 'EditView', $record) == 'yes') {
    $smarty->assign('EDIT_DUPLICATE', 'permitted');
}
if (isPermitted($currentModule, 'Delete', $record) == 'yes') {
    $smarty->assign('DELETE', 'permitted');
}
$smarty->assign('BLOCKS', getBlocks($currentModule, 'detail_view', '', $focus->column_fields));
// Gather the custom link information to display
include_once 'vtlib/Vtiger/Link.php';
$customlink_params = array('MODULE' => $currentModule, 'RECORD' => $focus->id, 'ACTION' => vtlib_purify($_REQUEST['action']));
$smarty->assign('CUSTOM_LINKS', Vtiger_Link::getAllByType($tabid, 'DETAILVIEW', $customlink_params));
// END
// Record Change Notification
$focus->markAsViewed($current_user->id);
// END
$smarty->assign('DETAILVIEW_AJAX_EDIT', PerformancePrefs::getBoolean('DETAILVIEW_AJAX_EDIT', true));
$smarty->display("Inventory/InventoryDetailView.tpl");
Beispiel #5
0
function insertDetailViewBlockWidgets($cfentries, $fld_module)
{
    $dvb = Vtiger_Link::getAllByType(getTabid($fld_module), array('DETAILVIEWWIDGET'));
    if (count($dvb['DETAILVIEWWIDGET']) > 0) {
        $dvb = $dvb['DETAILVIEWWIDGET'];
        $retarr = array();
        $totalcnt = count($cfentries);
        $idx = 0;
        for ($cnt = 1; $cnt <= $totalcnt; $cnt++) {
            $retarr[$idx++] = $cfentries[$cnt - 1];
            foreach ($dvb as $key => $CUSTOM_LINK_DETAILVIEWWIDGET) {
                if (preg_match("/^block:\\/\\/.*/", $CUSTOM_LINK_DETAILVIEWWIDGET->linkurl, $matches) and ($cnt == 1 and $CUSTOM_LINK_DETAILVIEWWIDGET->sequence <= 1 or $CUSTOM_LINK_DETAILVIEWWIDGET->sequence == $cnt or $cnt == $totalcnt and $CUSTOM_LINK_DETAILVIEWWIDGET->sequence >= $cnt)) {
                    list($void, $widgetControllerClass, $widgetControllerClassFile) = explode(':', $matches[0]);
                    $widgetControllerClass = substr($widgetControllerClass, 2);
                    if (!class_exists($widgetControllerClass)) {
                        checkFileAccessForInclusion($widgetControllerClassFile);
                        include_once $widgetControllerClassFile;
                    }
                    if (class_exists($widgetControllerClass)) {
                        $widgetControllerInstance = new $widgetControllerClass();
                        if (property_exists($widgetControllerClass, 'isSortable')) {
                            $isSortable = $widgetControllerInstance->isSortable;
                        } else {
                            $isSortable = true;
                        }
                        if ($isSortable) {
                            $widgetInstance = $widgetControllerInstance->getWidget($CUSTOM_LINK_DETAILVIEWWIDGET->linklabel);
                            if ($widgetInstance) {
                                $lbl = $widgetInstance->title();
                            } else {
                                $lbl = 'DetailViewBlock_' . $CUSTOM_LINK_DETAILVIEWWIDGET->linkid;
                            }
                        }
                    }
                    $retarr[$idx++] = array('DVB' => $CUSTOM_LINK_DETAILVIEWWIDGET->linkid, 'label' => $lbl);
                }
            }
        }
    } else {
        $retarr = $cfentries;
    }
    return $retarr;
}
Beispiel #6
0
// Module Search
$alphabetical = AlphabeticalSearch($currentModule,'index',$focus->def_basicsearch_col,'true','basic','','','','',$viewid);
$fieldnames = $controller->getAdvancedSearchOptionString();
$criteria = getcriteria_options();
$smarty->assign("ALPHABETICAL", $alphabetical);
$smarty->assign("FIELDNAMES", $fieldnames);
$smarty->assign("CRITERIA", $criteria);

$smarty->assign("AVALABLE_FIELDS", getMergeFields($currentModule,"available_fields"));
$smarty->assign("FIELDS_TO_MERGE", getMergeFields($currentModule,"fileds_to_merge"));

//Added to select Multiple records in multiple pages
$smarty->assign("SELECTEDIDS", vtlib_purify($_REQUEST['selobjs']));
$smarty->assign("ALLSELECTEDIDS", vtlib_purify($_REQUEST['allselobjs']));
$smarty->assign("CURRENT_PAGE_BOXES", implode(array_keys($listview_entries),";"));
$_SESSION[$currentModule.'_listquery'] = $list_query;

// Gather the custom link information to display
include_once('vtlib/Vtiger/Link.php');
$customlink_params = Array('MODULE'=>$currentModule, 'ACTION'=>vtlib_purify($_REQUEST['action']), 'CATEGORY'=> $category);
$smarty->assign('CUSTOM_LINKS', Vtiger_Link::getAllByType(getTabid($currentModule), Array('LISTVIEWBASIC','LISTVIEW'), $customlink_params));
// END

if(isset($_REQUEST['ajax']) && $_REQUEST['ajax'] != '')
	$smarty->display("ListViewEntries.tpl");
else
	$smarty->display('ListView.tpl');

?>
$smarty->assign("TODO_PERMISSION", CheckFieldPermission('parent_id', 'Calendar'));
$smarty->assign("EVENT_PERMISSION", CheckFieldPermission('parent_id', 'Events'));
$check_button = Button_Check($module);
$smarty->assign("CHECK", $check_button);
$smarty->assign("EDIT_PERMISSION", isPermitted($currentModule, 'EditView', $_REQUEST['record']));
$smarty->assign("IS_REL_LIST", isPresentRelatedLists($currentModule));
if ($singlepane_view == 'true') {
    $related_array = getRelatedLists($currentModule, $focus);
    $smarty->assign("RELATEDLISTS", $related_array);
    require_once 'include/ListView/RelatedListViewSession.php';
    if (!empty($_REQUEST['selected_header']) && !empty($_REQUEST['relation_id'])) {
        RelatedListViewSession::addRelatedModuleToSession(vtlib_purify($_REQUEST['relation_id']), vtlib_purify($_REQUEST['selected_header']));
    }
    $open_related_modules = RelatedListViewSession::getRelatedModulesFromSession();
    $smarty->assign("SELECTEDHEADERS", $open_related_modules);
}
$smarty->assign("SinglePane_View", $singlepane_view);
if (PerformancePrefs::getBoolean('DETAILVIEW_RECORD_NAVIGATION', true) && isset($_SESSION[$currentModule . '_listquery'])) {
    $recordNavigationInfo = ListViewSession::getListViewNavigation($focus->id);
    VT_detailViewNavigation($smarty, $recordNavigationInfo, $focus->id);
}
// Record Change Notification
$focus->markAsViewed($current_user->id);
// END
// Gather the custom link information to display
include_once 'vtlib/Vtiger/Link.php';
$customlink_params = array('MODULE' => $currentModule, 'RECORD' => $focus->id, 'ACTION' => vtlib_purify($_REQUEST['action']));
$smarty->assign('CUSTOM_LINKS', Vtiger_Link::getAllByType(getTabid($currentModule), array('DETAILVIEWBASIC', 'DETAILVIEW', 'DETAILVIEWWIDGET'), $customlink_params));
// END
$smarty->assign('DETAILVIEW_AJAX_EDIT', PerformancePrefs::getBoolean('DETAILVIEW_AJAX_EDIT', true));
$smarty->display("Inventory/InventoryDetailView.tpl");
$smarty->assign("ACTIVITYDATA", $data);
$smarty->assign("ID", vtlib_purify($_REQUEST['record']));
//get Description Information
if (isPermitted("Calendar", "EditView", $_REQUEST['record']) == 'yes') {
    $smarty->assign("EDIT_DUPLICATE", "permitted");
}
if (isPermitted("Calendar", "Delete", $_REQUEST['record']) == 'yes') {
    $smarty->assign("DELETE", "permitted");
}
$check_button = Button_Check($module);
$smarty->assign("CHECK", $check_button);
$tabid = getTabid($tab_type);
$validationData = getDBValidationData($focus->tab_name, $tabid);
$data2 = split_validationdataArray($validationData);
$smarty->assign("VALIDATION_DATA_FIELDNAME", $data2['fieldname']);
$smarty->assign("VALIDATION_DATA_FIELDDATATYPE", $data2['datatype']);
$smarty->assign("VALIDATION_DATA_FIELDLABEL", $data2['fieldlabel']);
$smarty->assign("MODULE", $currentModule);
$smarty->assign("EDIT_PERMISSION", isPermitted($currentModule, 'EditView', $_REQUEST['record']));
if (PerformancePrefs::getBoolean('DETAILVIEW_RECORD_NAVIGATION', true) && isset($_SESSION[$currentModule . '_listquery'])) {
    $recordNavigationInfo = ListViewSession::getListViewNavigation($focus->id);
    VT_detailViewNavigation($smarty, $recordNavigationInfo, $focus->id);
}
// Gather the custom link information to display
include_once 'vtlib/Vtiger/Link.php';
$customlink_params = array('MODULE' => $currentModule, 'RECORD' => $focus->id, 'ACTION' => vtlib_purify($_REQUEST['action']));
$smarty->assign('CUSTOM_LINKS', Vtiger_Link::getAllByType(getTabid($currentModule), 'DETAILVIEW', $customlink_params));
// END
$custom_fields_data = getCalendarCustomFields($tabid, 'detail_view', $focus->column_fields);
$smarty->assign("CUSTOM_FIELDS_DATA", $custom_fields_data);
$smarty->display("ActivityDetailView.tpl");