Ejemplo n.º 1
0
 /**
  * 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)
 {
     $allSkins = Vtiger_Theme::getAllSkins();
     $skinColor = $allSkins[$value];
     $value = ucfirst($value);
     return "<div class='span4' style='width:230px; background-color:{$skinColor};' title='{$value}'>&nbsp;</div>";
 }
Ejemplo n.º 2
0
 /**
  * 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, $record = false, $recordInstance = false, $rawText = false)
 {
     $allSkins = Vtiger_Theme::getAllSkins();
     $skinColor = $allSkins[$value];
     $value = ucfirst($value);
     return "<div class='col-md-4' style='width:230px; background-color:{$skinColor};' title='{$value}'>&nbsp;</div>";
 }
Ejemplo n.º 3
0
 public function getSettingLinks()
 {
     $settingsLinks = parent::getSettingLinks();
     $layoutEditorImagePath = Vtiger_Theme::getImagePath('LayoutEditor.gif');
     $db = PearDatabase::getInstance();
     $result = $db->query("SELECT fieldid FROM vtiger_settings_field WHERE name =  'OSSMailView' AND description =  'OSSMailView'", true);
     $settingsLinks[] = array('linktype' => 'LISTVIEWSETTING', 'linklabel' => 'Konfiguracja modułu', 'linkurl' => 'index.php?module=OSSMailView&parent=Settings&view=index&block=4&fieldid=' . $db->query_result($result, 0, 'fieldid'), 'linkicon' => $layoutEditorImagePath);
     return $settingsLinks;
 }
Ejemplo n.º 4
0
 /**
  * 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)
 {
     global $log;
     $log->debug("Entering ./uitypes/Theme.php::getDisplayValue");
     $allSkins = Vtiger_Theme::getAllSkins();
     $skinColor = $allSkins[$value];
     $value = ucfirst($value);
     return "<div class='span4' style='width:230px; background-color:{$skinColor};' title='{$value}'>&nbsp;</div>";
 }
Ejemplo n.º 5
0
 public function getSettingLinks()
 {
     vimport('~~modules/com_vtiger_workflow/VTWorkflowUtils.php');
     $layoutEditorImagePath = Vtiger_Theme::getImagePath('LayoutEditor.gif');
     $settingsLinks = array();
     $db = PearDatabase::getInstance();
     $result = $db->query("SELECT fieldid FROM vtiger_settings_field WHERE name =  'OSSMail' AND description =  'OSSMail'", true);
     $settingsLinks[] = array('linktype' => 'LISTVIEWSETTING', 'linklabel' => 'LBL_MODULE_CONFIGURATION', 'linkurl' => 'index.php?module=OSSMail&parent=Settings&view=index&block=4&fieldid=' . $db->query_result($result, 0, 'fieldid'), 'linkicon' => $layoutEditorImagePath);
     return $settingsLinks;
 }
Ejemplo n.º 6
0
 /**
  * Function to get Settings links
  * @return <Array>
  */
 public function getSettingLinks()
 {
     vimport('~~modules/com_vtiger_workflow/VTWorkflowUtils.php');
     $editWorkflowsImagePath = Vtiger_Theme::getImagePath('EditWorkflows.png');
     $settingsLinks = array();
     if (VTWorkflowUtils::checkModuleWorkflow($this->getName())) {
         $settingsLinks[] = array('linktype' => 'LISTVIEWSETTING', 'linklabel' => 'LBL_EDIT_WORKFLOWS', 'linkurl' => 'index.php?parent=Settings&module=Workflows&view=List&sourceModule=' . $this->getName(), 'linkicon' => $editWorkflowsImagePath);
     }
     return $settingsLinks;
 }
Ejemplo n.º 7
0
 public function preProcess(Vtiger_Request $request, $display = true)
 {
     if ($this->checkPermission($request)) {
         $currentUser = Users_Record_Model::getCurrentUserModel();
         $recordId = $request->get('record');
         $moduleName = $request->getModule();
         $detailViewModel = Vtiger_DetailView_Model::getInstance($moduleName, $recordId);
         $recordModel = $detailViewModel->getRecord();
         $detailViewLinkParams = array('MODULE' => $moduleName, 'RECORD' => $recordId);
         $detailViewLinks = $detailViewModel->getDetailViewLinks($detailViewLinkParams);
         $viewer = $this->getViewer($request);
         $viewer->assign('RECORD', $recordModel);
         $viewer->assign('MODULE_MODEL', $detailViewModel->getModule());
         $viewer->assign('DETAILVIEW_LINKS', $detailViewLinks);
         $viewer->assign('IS_EDITABLE', $detailViewModel->getRecord()->isEditable($moduleName));
         $viewer->assign('IS_DELETABLE', $detailViewModel->getRecord()->isDeletable($moduleName));
         $linkParams = array('MODULE' => $moduleName, 'ACTION' => $request->get('view'));
         $linkModels = $detailViewModel->getSideBarLinks($linkParams);
         $viewer->assign('QUICK_LINKS', $linkModels);
         $viewer->assign('PAGETITLE', $this->getPageTitle($request));
         $viewer->assign('SCRIPTS', $this->getHeaderScripts($request));
         $viewer->assign('STYLES', $this->getHeaderCss($request));
         $viewer->assign('LANGUAGE_STRINGS', $this->getJSLanguageStrings($request));
         $viewer->assign('SEARCHABLE_MODULES', Vtiger_Module_Model::getSearchableModules());
         $menuModelsList = Vtiger_Menu_Model::getAll(true);
         $selectedModule = $request->getModule();
         $menuStructure = Vtiger_MenuStructure_Model::getInstanceFromMenuList($menuModelsList, $selectedModule);
         // Order by pre-defined automation process for QuickCreate.
         uksort($menuModelsList, array('Vtiger_MenuStructure_Model', 'sortMenuItemsByProcess'));
         $companyDetails = Vtiger_CompanyDetails_Model::getInstanceById();
         $companyLogo = $companyDetails->getLogo();
         $viewer->assign('CURRENTDATE', date('Y-n-j'));
         $viewer->assign('MODULE', $selectedModule);
         $viewer->assign('PARENT_MODULE', $request->get('parent'));
         $viewer->assign('VIEW', $request->get('view'));
         $viewer->assign('MENUS', $menuModelsList);
         $viewer->assign('MENU_STRUCTURE', $menuStructure);
         $viewer->assign('MENU_SELECTED_MODULENAME', $selectedModule);
         $viewer->assign('MENU_TOPITEMS_LIMIT', $menuStructure->getLimit());
         $viewer->assign('COMPANY_LOGO', $companyLogo);
         $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
         $homeModuleModel = Vtiger_Module_Model::getInstance('Home');
         $viewer->assign('HOME_MODULE_MODEL', $homeModuleModel);
         $viewer->assign('HEADER_LINKS', $this->getHeaderLinks());
         $viewer->assign('ANNOUNCEMENT', $this->getAnnouncement());
         $viewer->assign('CURRENT_VIEW', $request->get('view'));
         $viewer->assign('SKIN_PATH', Vtiger_Theme::getCurrentUserThemePath());
         $viewer->assign('LANGUAGE', $currentUser->get('language'));
         if ($display) {
             $this->preProcessDisplay($request);
         }
     }
 }
Ejemplo n.º 8
0
 public function preProcess(Vtiger_Request $request, $display = true)
 {
     if ($this->checkPermission($request)) {
         $viewer = $this->getViewer($request);
         $currentUser = Users_Record_Model::getCurrentUserModel();
         $selectedModule = $request->getModule();
         $companyDetails = Vtiger_CompanyDetails_Model::getInstanceById();
         $companyLogo = $companyDetails->getLogo();
         $currentDate = Vtiger_Date_UIType::getDisplayDateValue(date('Y-n-j'));
         $viewer->assign('CURRENTDATE', $currentDate);
         $viewer->assign('MODULE', $selectedModule);
         $viewer->assign('MODULE_NAME', $selectedModule);
         $viewer->assign('QUALIFIED_MODULE', $selectedModule);
         $viewer->assign('PARENT_MODULE', $request->get('parent'));
         $viewer->assign('MENUS', Vtiger_Menu_Model::getAll(true));
         $viewer->assign('VIEW', $request->get('view'));
         $viewer->assign('COMPANY_LOGO', $companyLogo);
         $viewer->assign('USER_MODEL', $currentUser);
         $homeModuleModel = Vtiger_Module_Model::getInstance('Home');
         $viewer->assign('HOME_MODULE_MODEL', $homeModuleModel);
         $viewer->assign('HEADER_LINKS', $this->getHeaderLinks());
         $viewer->assign('ANNOUNCEMENT', $this->getAnnouncement());
         $viewer->assign('SEARCHABLE_MODULES', Vtiger_Module_Model::getSearchableModules());
         $viewer->assign('CHAT_ACTIVE', vtlib_isModuleActive('AJAXChat'));
         //Additional parameters
         $recordId = $request->get('record');
         $moduleName = $request->getModule();
         $detailViewModel = Vtiger_DetailView_Model::getInstance($moduleName, $recordId);
         $recordModel = $detailViewModel->getRecord();
         $detailViewLinkParams = array('MODULE' => $moduleName, 'RECORD' => $recordId);
         $detailViewLinks = $detailViewModel->getDetailViewLinks($detailViewLinkParams);
         $viewer->assign('RECORD', $recordModel);
         $viewer->assign('MODULE_MODEL', $detailViewModel->getModule());
         $viewer->assign('DETAILVIEW_LINKS', $detailViewLinks);
         $viewer->assign('IS_EDITABLE', $detailViewModel->getRecord()->isEditable($moduleName));
         $viewer->assign('IS_DELETABLE', $detailViewModel->getRecord()->isDeletable($moduleName));
         $linkParams = array('MODULE' => $moduleName, 'ACTION' => $request->get('view'));
         $linkModels = $detailViewModel->getSideBarLinks($linkParams);
         $viewer->assign('QUICK_LINKS', $linkModels);
         $viewer->assign('PAGETITLE', $this->getPageTitle($request));
         $viewer->assign('SCRIPTS', $this->getHeaderScripts($request));
         $viewer->assign('STYLES', $this->getHeaderCss($request));
         $viewer->assign('LANGUAGE_STRINGS', $this->getJSLanguageStrings($request));
         $viewer->assign('CURRENT_VIEW', $request->get('view'));
         $viewer->assign('SKIN_PATH', Vtiger_Theme::getCurrentUserThemePath());
         $viewer->assign('HTMLLANG', Vtiger_Language_Handler::getShortLanguageName());
         $viewer->assign('LANGUAGE', $currentUser->get('language'));
         if ($display) {
             $this->preProcessDisplay($request);
         }
     }
 }
Ejemplo n.º 9
0
 /**
  * Function to get the list of listview links for the module
  * @param <Array> $linkParams
  * @return <Array> - Associate array of Link Type to List of Vtiger_Link_Model instances
  */
 public function getListViewLinks($linkParams)
 {
     $links = parent::getListViewLinks($linkParams);
     $currentUserModel = Users_Record_Model::getCurrentUserModel();
     $moduleModel = $this->getModule();
     unset($links['LISTVIEW']);
     unset($links['LISTVIEWSETTING']);
     if ($currentUserModel->isAdminUser()) {
         $settingsLink = array('linktype' => 'LISTVIEWSETTING', 'linklabel' => 'LBL_EDIT_WORKFLOWS', 'linkurl' => 'index.php?parent=Settings&module=Workflow&sourceModule=' . $this->getName(), 'linkicon' => Vtiger_Theme::getImagePath('EditWorkflows.png'));
         $links['LISTVIEWSETTING'][] = Vtiger_Link_Model::getInstanceFromValues($settingsLink);
     }
     return $links;
 }
Ejemplo n.º 10
0
	public function preProcess(Vtiger_Request $request, $display = true)
	{
		if ($this->checkPermission($request)) {
			$currentUser = Users_Record_Model::getCurrentUserModel();
			$viewer = $this->getViewer($request);

			$selectedModule = $request->getModule();
			$companyDetails = Vtiger_CompanyDetails_Model::getInstanceById();
			$companyLogo = $companyDetails->getLogo();
			$currentDate = Vtiger_Date_UIType::getDisplayDateValue(date('Y-n-j'));
			$viewer->assign('CURRENTDATE', $currentDate);
			$viewer->assign('MODULE', $selectedModule);
			$viewer->assign('MODULE_NAME', $selectedModule);
			$viewer->assign('QUALIFIED_MODULE', $selectedModule);
			$viewer->assign('PARENT_MODULE', $request->get('parent'));
			$viewer->assign('MENUS', Vtiger_Menu_Model::getAll(true));
			$viewer->assign('VIEW', $request->get('view'));
			$viewer->assign('COMPANY_LOGO', $companyLogo);
			$viewer->assign('USER_MODEL', $currentUser);

			$homeModuleModel = Vtiger_Module_Model::getInstance('Home');
			$viewer->assign('HOME_MODULE_MODEL', $homeModuleModel);
			$viewer->assign('HEADER_LINKS', $this->getHeaderLinks());
			$viewer->assign('ANNOUNCEMENT', $this->getAnnouncement());
			$viewer->assign('SEARCHABLE_MODULES', Vtiger_Module_Model::getSearchableModules());
			$viewer->assign('CHAT_ACTIVE', vtlib_isModuleActive('AJAXChat'));

			//Additional parameters
			$viewer->assign('CURRENT_VIEW', $request->get('view'));
			$viewer->assign('PAGETITLE', $this->getPageTitle($request));
			$viewer->assign('FOOTER_SCRIPTS', $this->getFooterScripts($request));
			$viewer->assign('STYLES', $this->getHeaderCss($request));
			$viewer->assign('LANGUAGE_STRINGS', $this->getJSLanguageStrings($request));
			$viewer->assign('SKIN_PATH', Vtiger_Theme::getCurrentUserThemePath());
			$viewer->assign('IS_PREFERENCE', true);
			$viewer->assign('HTMLLANG', Vtiger_Language_Handler::getShortLanguageName());
			$viewer->assign('LANGUAGE', $currentUser->get('language'));

			$allUsers = Users_Record_Model::getAll(true);
			$sharedUsers = Calendar_Module_Model::getCaledarSharedUsers($currentUser->id);
			$sharedType = Calendar_Module_Model::getSharedType($currentUser->id);
			$viewer->assign('ALL_USERS', $allUsers);
			$viewer->assign('SHAREDUSERS', $sharedUsers);
			$viewer->assign('SHARED_TYPE', $sharedType);
			$viewer->assign('HEADER_SCRIPTS', $this->getHeaderScripts($request));
			if ($display) {
				$this->preProcessDisplay($request);
			}
		}
	}
Ejemplo n.º 11
0
 public function preProcess(Vtiger_Request $request, $display = true)
 {
     if ($this->checkPermission($request)) {
         $currentUser = Users_Record_Model::getCurrentUserModel();
         $viewer = $this->getViewer($request);
         $menuModelsList = Vtiger_Menu_Model::getAll(true);
         $selectedModule = $request->getModule();
         $menuStructure = Vtiger_MenuStructure_Model::getInstanceFromMenuList($menuModelsList, $selectedModule);
         // Order by pre-defined automation process for QuickCreate.
         uksort($menuModelsList, array('Vtiger_MenuStructure_Model', 'sortMenuItemsByProcess'));
         $companyDetails = Vtiger_CompanyDetails_Model::getInstanceById();
         $companyLogo = $companyDetails->getLogo();
         $viewer->assign('CURRENTDATE', date('Y-n-j'));
         $viewer->assign('MODULE', $selectedModule);
         $viewer->assign('PARENT_MODULE', $request->get('parent'));
         $viewer->assign('VIEW', $request->get('view'));
         $viewer->assign('MENUS', $menuModelsList);
         $viewer->assign('MENU_STRUCTURE', $menuStructure);
         $viewer->assign('MENU_SELECTED_MODULENAME', $selectedModule);
         $viewer->assign('MENU_TOPITEMS_LIMIT', $menuStructure->getLimit());
         $viewer->assign('COMPANY_LOGO', $companyLogo);
         $viewer->assign('USER_MODEL', $currentUser);
         $viewer->assign('SEARCHABLE_MODULES', Vtiger_Module_Model::getSearchableModules());
         $homeModuleModel = Vtiger_Module_Model::getInstance('Home');
         $viewer->assign('HOME_MODULE_MODEL', $homeModuleModel);
         $viewer->assign('HEADER_LINKS', $this->getHeaderLinks());
         $viewer->assign('ANNOUNCEMENT', $this->getAnnouncement());
         $viewer->assign('CURRENT_VIEW', $request->get('view'));
         $viewer->assign('PAGETITLE', $this->getPageTitle($request));
         $viewer->assign('SCRIPTS', $this->getHeaderScripts($request));
         $viewer->assign('STYLES', $this->getHeaderCss($request));
         $viewer->assign('LANGUAGE_STRINGS', $this->getJSLanguageStrings($request));
         $viewer->assign('SKIN_PATH', Vtiger_Theme::getCurrentUserThemePath());
         $viewer->assign('IS_PREFERENCE', true);
         $viewer->assign('LANGUAGE', $currentUser->get('language'));
         $allUsers = Users_Record_Model::getAll(true);
         $sharedUsers = Calendar_Module_Model::getCaledarSharedUsers($currentUser->id);
         $sharedType = Calendar_Module_Model::getSharedType($currentUser->id);
         $viewer->assign('ALL_USERS', $allUsers);
         $viewer->assign('SHAREDUSERS', $sharedUsers);
         $viewer->assign('SHARED_TYPE', $sharedType);
         // OpenSaaS
         $OSSMenu = OSSMenuManager_Record_Model::getMenu();
         $viewer->assign('MENU_STRUCTURE', $OSSMenu);
         //  OpenSaaS
         if ($display) {
             $this->preProcessDisplay($request);
         }
     }
 }
Ejemplo n.º 12
0
 /**
  * Function to get Settings links
  * @return <Array>
  */
 public function getSettingLinks()
 {
     if (!$this->isEntityModule()) {
         return array();
     }
     vimport('~~modules/com_vtiger_workflow/VTWorkflowUtils.php');
     $layoutEditorImagePath = Vtiger_Theme::getImagePath('LayoutEditor.gif');
     $editWorkflowsImagePath = Vtiger_Theme::getImagePath('EditWorkflows.png');
     $settingsLinks = array();
     if (VTWorkflowUtils::checkModuleWorkflow($this->getName())) {
         $settingsLinks[] = array('linktype' => 'LISTVIEWSETTING', 'linklabel' => 'LBL_EDIT_WORKFLOWS', 'linkurl' => 'index.php?parent=Settings&module=Workflows&view=List&sourceModule=' . $this->getName(), 'linkicon' => $editWorkflowsImagePath);
     }
     $settingsLinks[] = array('linktype' => 'LISTVIEWSETTINGS', 'linklabel' => 'LBL_SERVER_CONFIGURATION', 'linkurl' => 'index.php?parent=Settings&module=PBXManager&view=Index', 'linkicon' => '');
     return $settingsLinks;
 }
Ejemplo n.º 13
0
 public function getSettingLinks()
 {
     vimport('~~modules/com_vtiger_workflow/VTWorkflowUtils.php');
     $layoutEditorImagePath = Vtiger_Theme::getImagePath('LayoutEditor.gif');
     $editWorkflowsImagePath = Vtiger_Theme::getImagePath('EditWorkflows.png');
     $settingsLinks = array();
     $settingsLinks[] = array('linktype' => 'LISTVIEWSETTING', 'linklabel' => 'LBL_EDIT_FIELDS', 'linkurl' => 'index.php?parent=Settings&module=LayoutEditor&sourceModule=' . $this->getName(), 'linkicon' => $layoutEditorImagePath);
     if (VTWorkflowUtils::checkModuleWorkflow($this->getName())) {
         $settingsLinks[] = array('linktype' => 'LISTVIEWSETTING', 'linklabel' => 'LBL_EDIT_WORKFLOWS', 'linkurl' => 'index.php?parent=Settings&module=Workflow&sourceModule=' . $this->getName(), 'linkicon' => $editWorkflowsImagePath);
     }
     $settingsLinks[] = array('linktype' => 'LISTVIEWSETTING', 'linklabel' => 'LBL_EDIT_PICKLIST_VALUES', 'linkurl' => 'index.php?parent=Settings&module=Picklist&source_module=' . $this->getName(), 'linkicon' => '');
     if ($this->hasSequenceNumberField()) {
         $settingsLinks[] = array('linktype' => 'LISTVIEWSETTING', 'linklabel' => 'LBL_MODULE_SEQUENCE_NUMBERING', 'linkurl' => 'index.php?parent=Settings&module=Vtiger&view=CustomRecordNumbering&sourceModule=' . $this->getName(), 'linkicon' => '');
     }
     return $settingsLinks;
 }
Ejemplo n.º 14
0
 public function GetAvailableSettings()
 {
     $menu_array = array();
     $menu_array["ITS4YouReportsLicense"]["location"] = "index.php?module=ITS4YouReports&view=License";
     $menu_array["ITS4YouReportsLicense"]["image_src"] = Vtiger_Theme::getImagePath('proxy.gif');
     $menu_array["ITS4YouReportsLicense"]["desc"] = "LBL_LICENSE_DESC";
     $menu_array["ITS4YouReportsLicense"]["label"] = "LBL_LICENSE";
     /*
     $menu_array["ITS4YouReportsUninstall"]["location"] = "index.php?module=ITS4YouReports&view=Uninstall";
     $menu_array["ITS4YouReportsUninstall"]["desc"] = "LBL_UNINSTALL_DESC";
     $menu_array["ITS4YouReportsUninstall"]["label"] = "LBL_UNINSTALL";
     */
     $menu_array["ITS4YouReportsUpgrade"]["location"] = "index.php?module=ModuleManager&parent=Settings&view=ModuleImport&mode=importUserModuleStep1";
     $menu_array["ITS4YouReportsUpgrade"]["desc"] = "LBL_UPGRADE";
     $menu_array["ITS4YouReportsUpgrade"]["label"] = "LBL_UPGRADE";
     return $menu_array;
 }
Ejemplo n.º 15
0
 /**
  * Function to get Settings links
  * @return <Array>
  */
 public function getSettingLinks()
 {
     if (!$this->isEntityModule()) {
         return array();
     }
     vimport('~~modules/com_vtiger_workflow/VTWorkflowUtils.php');
     $layoutEditorImagePath = Vtiger_Theme::getImagePath('LayoutEditor.gif');
     $editWorkflowsImagePath = Vtiger_Theme::getImagePath('EditWorkflows.png');
     $settingsLinks = array();
     $settingsLinks[] = array('linktype' => 'LISTVIEWSETTING', 'linklabel' => 'LBL_EDIT_FIELDS', 'linkurl' => 'index.php?parent=Settings&module=LayoutEditor&sourceModule=' . $this->getName(), 'linkicon' => $layoutEditorImagePath);
     if (VTWorkflowUtils::checkModuleWorkflow($this->getName())) {
         $settingsLinks[] = array('linktype' => 'LISTVIEWSETTING', 'linklabel' => 'LBL_EDIT_WORKFLOWS', 'linkurl' => 'index.php?parent=Settings&module=Workflows&view=List&sourceModule=' . $this->getName(), 'linkicon' => $editWorkflowsImagePath);
     }
     $settingsLinks[] = array('linktype' => 'LISTVIEWSETTING', 'linklabel' => 'LBL_EDIT_PICKLIST_VALUES', 'linkurl' => 'index.php?parent=Settings&module=Picklist&view=Index&source_module=' . $this->getName(), 'linkicon' => '');
     if ($this->hasSequenceNumberField()) {
         $settingsLinks[] = array('linktype' => 'LISTVIEWSETTING', 'linklabel' => 'LBL_MODULE_SEQUENCE_NUMBERING', 'linkurl' => 'index.php?parent=Settings&module=Vtiger&view=CustomRecordNumbering&sourceModule=' . $this->getName(), 'linkicon' => '');
     }
     $webformSupportedModule = Settings_Webforms_Module_Model::getSupportedModulesList();
     if (array_key_exists($this->getName(), $webformSupportedModule)) {
         $settingsLinks[] = array('linktype' => 'LISTVIEWSETTING', 'linklabel' => 'LBL_SETUP_WEBFORMS', 'linkurl' => 'index.php?module=Webforms&parent=Settings&view=Edit&sourceModule=' . $this->getName(), 'linkicon' => '');
     }
     return $settingsLinks;
 }
Ejemplo n.º 16
0
Archivo: utils.php Proyecto: yunter/crm
/**
 * Return an array of directory names.
 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
 * All Rights Reserved.
 * Contributor(s): ______________________________________..
 */
function get_themes()
{
    return Vtiger_Theme::getAllSkins();
}
Ejemplo n.º 17
0
 /**
  * Function returns Settings Links
  * @return Array
  */
 public function getSettingLinks()
 {
     $currentUserModel = Users_Record_Model::getCurrentUserModel();
     $settingLinks = array();
     if ($currentUserModel->isAdminUser()) {
         $settingLinks[] = array('linktype' => 'LISTVIEWSETTING', 'linklabel' => 'LBL_EDIT_FIELDS', 'linkurl' => 'index.php?parent=Settings&module=LayoutEditor&sourceModule=' . $this->getName(), 'linkicon' => Vtiger_Theme::getImagePath('LayoutEditor.gif'));
         $settingLinks[] = array('linktype' => 'LISTVIEWSETTING', 'linklabel' => 'LBL_EDIT_PICKLIST_VALUES', 'linkurl' => 'index.php?parent=Settings&module=Picklist&view=Index&source_module=' . $this->getName(), 'linkicon' => '');
     }
     return $settingLinks;
 }
Ejemplo n.º 18
0
 function preProcess(Vtiger_Request $request, $display = true)
 {
     $moduleName = $request->getModule();
     $viewer = $this->getViewer($request);
     $viewer->assign('PAGETITLE', $this->getPageTitle($request));
     $viewer->assign('BREADCRUMB_TITLE', $this->getBreadcrumbTitle($request));
     $viewer->assign('HEADER_SCRIPTS', $this->getHeaderScripts($request));
     $viewer->assign('STYLES', $this->getHeaderCss($request));
     $viewer->assign('SKIN_PATH', Vtiger_Theme::getCurrentUserThemePath());
     $viewer->assign('LAYOUT_PATH', 'layouts' . '/' . Yeti_Layout::getActiveLayout());
     $viewer->assign('LANGUAGE_STRINGS', $this->getJSLanguageStrings($request));
     $viewer->assign('HTMLLANG', Vtiger_Language_Handler::getShortLanguageName());
     $viewer->assign('LANGUAGE', Vtiger_Language_Handler::getLanguage());
     $viewer->assign('SHOW_BODY_HEADER', $this->showBodyHeader());
     $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
     $viewer->assign('MODULE', $moduleName);
     $viewer->assign('VIEW', $request->get('view'));
     $viewer->assign('MODULE_NAME', $moduleName);
     $viewer->assign('PARENT_MODULE', $request->get('parent'));
     if ($display) {
         $this->preProcessDisplay($request);
     }
 }
    function content_5674dd282e457($_smarty_tpl)
    {
        $_smarty_tpl->tpl_vars["topMenus"] = new Smarty_variable($_smarty_tpl->tpl_vars['MENU_STRUCTURE']->value->getTop(), null, 0);
        $_smarty_tpl->tpl_vars["moreMenus"] = new Smarty_variable($_smarty_tpl->tpl_vars['MENU_STRUCTURE']->value->getMore(), null, 0);
        $_smarty_tpl->tpl_vars['NUMBER_OF_PARENT_TABS'] = new Smarty_variable(count(array_keys($_smarty_tpl->tpl_vars['moreMenus']->value)), null, 0);
        ?>
<div class="navbar" id="topMenus" style="overflow: hidden;height:40px;"><div class="navbar-inner" id="nav-inner"><div class="menuBar row-fluid"><div class="span9"><ul class="nav modulesList" id="largeNav"><li class="tabs"><a class="alignMiddle <?php 
        if ($_smarty_tpl->tpl_vars['MODULE']->value == 'Home') {
            ?>
 selected <?php 
        }
        ?>
" href="<?php 
        echo $_smarty_tpl->tpl_vars['HOME_MODULE_MODEL']->value->getDefaultUrl();
        ?>
"><img src="<?php 
        echo vimage_path('home.png');
        ?>
" alt="<?php 
        echo vtranslate('LBL_HOME', $_smarty_tpl->tpl_vars['moduleName']->value);
        ?>
" title="<?php 
        echo vtranslate('LBL_HOME', $_smarty_tpl->tpl_vars['moduleName']->value);
        ?>
" /></a></li><?php 
        $_smarty_tpl->tpl_vars['moduleModel'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['moduleModel']->_loop = false;
        $_smarty_tpl->tpl_vars['moduleName'] = new Smarty_Variable();
        $_from = $_smarty_tpl->tpl_vars['topMenus']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        $_smarty_tpl->tpl_vars['smarty']->value['foreach']['topmenu']['index'] = -1;
        foreach ($_from as $_smarty_tpl->tpl_vars['moduleModel']->key => $_smarty_tpl->tpl_vars['moduleModel']->value) {
            $_smarty_tpl->tpl_vars['moduleModel']->_loop = true;
            $_smarty_tpl->tpl_vars['moduleName']->value = $_smarty_tpl->tpl_vars['moduleModel']->key;
            $_smarty_tpl->tpl_vars['smarty']->value['foreach']['topmenu']['index']++;
            $_smarty_tpl->tpl_vars['translatedModuleLabel'] = new Smarty_variable(vtranslate($_smarty_tpl->tpl_vars['moduleModel']->value->get('label'), $_smarty_tpl->tpl_vars['moduleName']->value), null, 0);
            $_smarty_tpl->tpl_vars["topmenuClassName"] = new Smarty_variable("tabs", null, 0);
            if ($_smarty_tpl->getVariable('smarty')->value['foreach']['topmenu']['index'] > $_smarty_tpl->tpl_vars['MENU_TOPITEMS_LIMIT']->value && $_smarty_tpl->tpl_vars['MENU_SELECTED_MODULENAME']->value != $_smarty_tpl->tpl_vars['moduleName']->value) {
                $_smarty_tpl->tpl_vars["topmenuClassName"] = new Smarty_variable("tabs opttabs", null, 0);
            }
            ?>
<li class="<?php 
            echo $_smarty_tpl->tpl_vars['topmenuClassName']->value;
            ?>
"><a id="menubar_item_<?php 
            echo $_smarty_tpl->tpl_vars['moduleName']->value;
            ?>
" href="<?php 
            echo $_smarty_tpl->tpl_vars['moduleModel']->value->getDefaultUrl();
            ?>
" <?php 
            if ($_smarty_tpl->tpl_vars['MODULE']->value == $_smarty_tpl->tpl_vars['moduleName']->value) {
                ?>
 class="selected" <?php 
            }
            ?>
><strong><?php 
            echo $_smarty_tpl->tpl_vars['translatedModuleLabel']->value;
            ?>
</strong></a></li><?php 
        }
        ?>
</ul><ul class="nav" id="shortNav"><li class="tabs"><a class="alignMiddle <?php 
        if ($_smarty_tpl->tpl_vars['MODULE']->value == 'Home') {
            ?>
 selected <?php 
        }
        ?>
" href="<?php 
        echo $_smarty_tpl->tpl_vars['HOME_MODULE_MODEL']->value->getDefaultUrl();
        ?>
"><img src="<?php 
        echo vimage_path('home.png');
        ?>
" alt="<?php 
        echo vtranslate('LBL_HOME', $_smarty_tpl->tpl_vars['moduleName']->value);
        ?>
" title="<?php 
        echo vtranslate('LBL_HOME', $_smarty_tpl->tpl_vars['moduleName']->value);
        ?>
" /></a></li><li class="dropdown tabs" id="collapsedMenu"><a class="dropdown-toggle" data-toggle="dropdown" href="#collapsedMenu"><?php 
        echo vtranslate('LBL_ALL', $_smarty_tpl->tpl_vars['MODULE']->value);
        ?>
<b class="caret"></b></a><div class="dropdown-menu"><div class="shortDropdown"><?php 
        $_smarty_tpl->tpl_vars['moduleList'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['moduleList']->_loop = false;
        $_smarty_tpl->tpl_vars['parent'] = new Smarty_Variable();
        $_from = $_smarty_tpl->tpl_vars['moreMenus']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        $_smarty_tpl->tpl_vars['moduleList']->total = $_smarty_tpl->_count($_from);
        $_smarty_tpl->tpl_vars['moduleList']->iteration = 0;
        $_smarty_tpl->tpl_vars['smarty']->value['foreach']['more']['index'] = -1;
        foreach ($_from as $_smarty_tpl->tpl_vars['moduleList']->key => $_smarty_tpl->tpl_vars['moduleList']->value) {
            $_smarty_tpl->tpl_vars['moduleList']->_loop = true;
            $_smarty_tpl->tpl_vars['parent']->value = $_smarty_tpl->tpl_vars['moduleList']->key;
            $_smarty_tpl->tpl_vars['moduleList']->iteration++;
            $_smarty_tpl->tpl_vars['moduleList']->last = $_smarty_tpl->tpl_vars['moduleList']->iteration === $_smarty_tpl->tpl_vars['moduleList']->total;
            $_smarty_tpl->tpl_vars['smarty']->value['foreach']['more']['index']++;
            $_smarty_tpl->tpl_vars['smarty']->value['foreach']['more']['last'] = $_smarty_tpl->tpl_vars['moduleList']->last;
            if ($_smarty_tpl->tpl_vars['moduleList']->value) {
                ?>
<strong><?php 
                echo vtranslate("LBL_" . $_smarty_tpl->tpl_vars['parent']->value, $_smarty_tpl->tpl_vars['moduleName']->value);
                ?>
</strong><hr><?php 
                $_smarty_tpl->tpl_vars['moduleModel'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['moduleModel']->_loop = false;
                $_smarty_tpl->tpl_vars['moduleName'] = new Smarty_Variable();
                $_from = $_smarty_tpl->tpl_vars['moduleList']->value;
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['moduleModel']->key => $_smarty_tpl->tpl_vars['moduleModel']->value) {
                    $_smarty_tpl->tpl_vars['moduleModel']->_loop = true;
                    $_smarty_tpl->tpl_vars['moduleName']->value = $_smarty_tpl->tpl_vars['moduleModel']->key;
                    $_smarty_tpl->tpl_vars['translatedModuleLabel'] = new Smarty_variable(vtranslate($_smarty_tpl->tpl_vars['moduleModel']->value->get('label'), $_smarty_tpl->tpl_vars['moduleName']->value), null, 0);
                    ?>
<label class="moduleNames"><a id="menubar_item_<?php 
                    echo $_smarty_tpl->tpl_vars['moduleName']->value;
                    ?>
" href="<?php 
                    echo $_smarty_tpl->tpl_vars['moduleModel']->value->getDefaultUrl();
                    ?>
"><?php 
                    echo $_smarty_tpl->tpl_vars['translatedModuleLabel']->value;
                    ?>
</a></label><?php 
                }
            }
        }
        ?>
</div></div></li></ul><ul class="nav modulesList" id="mediumNav"><li class="tabs"><a class="alignMiddle <?php 
        if ($_smarty_tpl->tpl_vars['MODULE']->value == 'Home') {
            ?>
 selected <?php 
        }
        ?>
" href="<?php 
        echo $_smarty_tpl->tpl_vars['HOME_MODULE_MODEL']->value->getDefaultUrl();
        ?>
"><img src="<?php 
        echo vimage_path('home.png');
        ?>
" alt="<?php 
        echo vtranslate('LBL_HOME', $_smarty_tpl->tpl_vars['moduleName']->value);
        ?>
" title="<?php 
        echo vtranslate('LBL_HOME', $_smarty_tpl->tpl_vars['moduleName']->value);
        ?>
" /></a></li><?php 
        $_smarty_tpl->tpl_vars['COUNTER'] = new Smarty_variable(0, null, 0);
        $_smarty_tpl->tpl_vars['moduleModel'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['moduleModel']->_loop = false;
        $_smarty_tpl->tpl_vars['moduleName'] = new Smarty_Variable();
        $_from = $_smarty_tpl->tpl_vars['topMenus']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        $_smarty_tpl->tpl_vars['smarty']->value['foreach']['topmenu']['index'] = -1;
        foreach ($_from as $_smarty_tpl->tpl_vars['moduleModel']->key => $_smarty_tpl->tpl_vars['moduleModel']->value) {
            $_smarty_tpl->tpl_vars['moduleModel']->_loop = true;
            $_smarty_tpl->tpl_vars['moduleName']->value = $_smarty_tpl->tpl_vars['moduleModel']->key;
            $_smarty_tpl->tpl_vars['smarty']->value['foreach']['topmenu']['index']++;
            $_smarty_tpl->tpl_vars['translatedModuleLabel'] = new Smarty_variable(vtranslate($_smarty_tpl->tpl_vars['moduleModel']->value->get('label'), $_smarty_tpl->tpl_vars['moduleName']->value), null, 0);
            $_smarty_tpl->tpl_vars["topmenuClassName"] = new Smarty_variable("tabs", null, 0);
            if ($_smarty_tpl->getVariable('smarty')->value['foreach']['topmenu']['index'] > 2 && $_smarty_tpl->tpl_vars['MENU_SELECTED_MODULENAME']->value != $_smarty_tpl->tpl_vars['moduleName']->value) {
                $_smarty_tpl->tpl_vars["topmenuClassName"] = new Smarty_variable("tabs opttabs", null, 0);
            }
            ?>
<li class="<?php 
            echo $_smarty_tpl->tpl_vars['topmenuClassName']->value;
            ?>
"><a id="menubar_item_<?php 
            echo $_smarty_tpl->tpl_vars['moduleName']->value;
            ?>
" href="<?php 
            echo $_smarty_tpl->tpl_vars['moduleModel']->value->getDefaultUrl();
            ?>
" <?php 
            if ($_smarty_tpl->tpl_vars['MODULE']->value == $_smarty_tpl->tpl_vars['moduleName']->value) {
                ?>
 class="selected" <?php 
            }
            ?>
><strong><?php 
            echo $_smarty_tpl->tpl_vars['translatedModuleLabel']->value;
            ?>
</strong></a></li><?php 
        }
        ?>
</ul><ul class="nav" id="commonMoreMenu"><li class="dropdown" id="moreMenu"><a class="dropdown-toggle" data-toggle="dropdown" href="#moreMenu"><strong><?php 
        echo vtranslate('LBL_ALL', $_smarty_tpl->tpl_vars['MODULE']->value);
        ?>
&nbsp;</strong><b class="caret"></b></a><div class="dropdown-menu moreMenus" <?php 
        if ($_smarty_tpl->tpl_vars['NUMBER_OF_PARENT_TABS']->value <= 2 && $_smarty_tpl->tpl_vars['NUMBER_OF_PARENT_TABS']->value != 0) {
            ?>
style="width: 30em;"<?php 
        } elseif ($_smarty_tpl->tpl_vars['NUMBER_OF_PARENT_TABS']->value == 0) {
            ?>
style="width: 10em;"<?php 
        }
        ?>
><?php 
        $_smarty_tpl->tpl_vars['moduleList'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['moduleList']->_loop = false;
        $_smarty_tpl->tpl_vars['parent'] = new Smarty_Variable();
        $_from = $_smarty_tpl->tpl_vars['moreMenus']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        $_smarty_tpl->tpl_vars['moduleList']->total = $_smarty_tpl->_count($_from);
        $_smarty_tpl->tpl_vars['moduleList']->iteration = 0;
        $_smarty_tpl->tpl_vars['smarty']->value['foreach']['more']['index'] = -1;
        foreach ($_from as $_smarty_tpl->tpl_vars['moduleList']->key => $_smarty_tpl->tpl_vars['moduleList']->value) {
            $_smarty_tpl->tpl_vars['moduleList']->_loop = true;
            $_smarty_tpl->tpl_vars['parent']->value = $_smarty_tpl->tpl_vars['moduleList']->key;
            $_smarty_tpl->tpl_vars['moduleList']->iteration++;
            $_smarty_tpl->tpl_vars['moduleList']->last = $_smarty_tpl->tpl_vars['moduleList']->iteration === $_smarty_tpl->tpl_vars['moduleList']->total;
            $_smarty_tpl->tpl_vars['smarty']->value['foreach']['more']['index']++;
            $_smarty_tpl->tpl_vars['smarty']->value['foreach']['more']['last'] = $_smarty_tpl->tpl_vars['moduleList']->last;
            if ($_smarty_tpl->tpl_vars['NUMBER_OF_PARENT_TABS']->value >= 4) {
                $_smarty_tpl->tpl_vars['SPAN_CLASS'] = new Smarty_variable('span3', null, 0);
            } elseif ($_smarty_tpl->tpl_vars['NUMBER_OF_PARENT_TABS']->value == 3) {
                $_smarty_tpl->tpl_vars['SPAN_CLASS'] = new Smarty_variable('span4', null, 0);
            } elseif ($_smarty_tpl->tpl_vars['NUMBER_OF_PARENT_TABS']->value <= 2) {
                $_smarty_tpl->tpl_vars['SPAN_CLASS'] = new Smarty_variable('span6', null, 0);
            }
            if ($_smarty_tpl->getVariable('smarty')->value['foreach']['more']['index'] % 4 == 0) {
                ?>
<div class="row-fluid"><?php 
            }
            ?>
<span class="<?php 
            echo $_smarty_tpl->tpl_vars['SPAN_CLASS']->value;
            ?>
"><strong><?php 
            echo vtranslate("LBL_" . $_smarty_tpl->tpl_vars['parent']->value, $_smarty_tpl->tpl_vars['moduleName']->value);
            ?>
</strong><hr><?php 
            $_smarty_tpl->tpl_vars['moduleModel'] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars['moduleModel']->_loop = false;
            $_smarty_tpl->tpl_vars['moduleName'] = new Smarty_Variable();
            $_from = $_smarty_tpl->tpl_vars['moduleList']->value;
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars['moduleModel']->key => $_smarty_tpl->tpl_vars['moduleModel']->value) {
                $_smarty_tpl->tpl_vars['moduleModel']->_loop = true;
                $_smarty_tpl->tpl_vars['moduleName']->value = $_smarty_tpl->tpl_vars['moduleModel']->key;
                $_smarty_tpl->tpl_vars['translatedModuleLabel'] = new Smarty_variable(vtranslate($_smarty_tpl->tpl_vars['moduleModel']->value->get('label'), $_smarty_tpl->tpl_vars['moduleName']->value), null, 0);
                ?>
<label class="moduleNames"><a id="menubar_item_<?php 
                echo $_smarty_tpl->tpl_vars['moduleName']->value;
                ?>
" href="<?php 
                echo $_smarty_tpl->tpl_vars['moduleModel']->value->getDefaultUrl();
                ?>
"><?php 
                echo $_smarty_tpl->tpl_vars['translatedModuleLabel']->value;
                ?>
</a></label><?php 
            }
            ?>
</span><?php 
            if ($_smarty_tpl->getVariable('smarty')->value['foreach']['more']['last'] || ($_smarty_tpl->getVariable('smarty')->value['foreach']['more']['index'] + 1) % 4 == 0) {
                ?>
</div><?php 
            }
        }
        if ($_smarty_tpl->tpl_vars['USER_MODEL']->value->isAdminUser()) {
            ?>
<div class="row-fluid"><a id="menubar_item_moduleManager" href="index.php?module=MenuEditor&parent=Settings&view=Index" class="pull-right"><?php 
            echo vtranslate('LBL_CUSTOMIZE_MAIN_MENU', $_smarty_tpl->tpl_vars['MODULE']->value);
            ?>
</a></div><div class="row-fluid"><a id="menubar_item_moduleManager" href="index.php?module=ModuleManager&parent=Settings&view=List" class="pull-right"><?php 
            echo vtranslate('LBL_ADD_MANAGE_MODULES', $_smarty_tpl->tpl_vars['MODULE']->value);
            ?>
</a></div><?php 
        }
        ?>
</div></li></ul></div><div class="span3 marginLeftZero pull-right" id="headerLinks"><span id="headerLinksBig" class="pull-right headerLinksContainer"><span class="dropdown span settingIcons"><a class="dropdown-toggle" data-toggle="dropdown" href="#"><img src="<?php 
        echo vimage_path('theme_brush.png');
        ?>
" alt="theme roller" title="Theme Roller" /></a><ul class="dropdown-menu themeMenuContainer"><div id="themeContainer"><?php 
        $_smarty_tpl->tpl_vars['COUNTER'] = new Smarty_variable(0, null, 0);
        $_smarty_tpl->tpl_vars['THEMES_LIST'] = new Smarty_variable(Vtiger_Theme::getAllSkins(), null, 0);
        ?>
<div class="row-fluid themeMenu"><?php 
        $_smarty_tpl->tpl_vars['SKIN_COLOR'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['SKIN_COLOR']->_loop = false;
        $_smarty_tpl->tpl_vars['SKIN_NAME'] = new Smarty_Variable();
        $_from = $_smarty_tpl->tpl_vars['THEMES_LIST']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['SKIN_COLOR']->key => $_smarty_tpl->tpl_vars['SKIN_COLOR']->value) {
            $_smarty_tpl->tpl_vars['SKIN_COLOR']->_loop = true;
            $_smarty_tpl->tpl_vars['SKIN_NAME']->value = $_smarty_tpl->tpl_vars['SKIN_COLOR']->key;
            if ($_smarty_tpl->tpl_vars['COUNTER']->value == 3) {
                ?>
</div><div class="row-fluid themeMenu"><?php 
                $_smarty_tpl->tpl_vars['COUNTER'] = new Smarty_variable(1, null, 0);
            } else {
                $_smarty_tpl->tpl_vars['COUNTER'] = new Smarty_variable($_smarty_tpl->tpl_vars['COUNTER']->value + 1, null, 0);
            }
            ?>
<div class="span4 themeElement <?php 
            if ($_smarty_tpl->tpl_vars['USER_MODEL']->value->get('theme') == $_smarty_tpl->tpl_vars['SKIN_NAME']->value) {
                ?>
themeSelected<?php 
            }
            ?>
" data-skin-name="<?php 
            echo $_smarty_tpl->tpl_vars['SKIN_NAME']->value;
            ?>
" title="<?php 
            echo ucfirst($_smarty_tpl->tpl_vars['SKIN_NAME']->value);
            ?>
" style="background-color:<?php 
            echo $_smarty_tpl->tpl_vars['SKIN_COLOR']->value;
            ?>
;"></div><?php 
        }
        ?>
</div></div><div id="progressDiv"></div></ul></span><?php 
        $_smarty_tpl->tpl_vars['obj'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['obj']->_loop = false;
        $_smarty_tpl->tpl_vars['index'] = new Smarty_Variable();
        $_from = $_smarty_tpl->tpl_vars['HEADER_LINKS']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['obj']->key => $_smarty_tpl->tpl_vars['obj']->value) {
            $_smarty_tpl->tpl_vars['obj']->_loop = true;
            $_smarty_tpl->tpl_vars['index']->value = $_smarty_tpl->tpl_vars['obj']->key;
            $_smarty_tpl->tpl_vars["src"] = new Smarty_variable($_smarty_tpl->tpl_vars['obj']->value->getIconPath(), null, 0);
            $_smarty_tpl->tpl_vars["icon"] = new Smarty_variable($_smarty_tpl->tpl_vars['obj']->value->getIcon(), null, 0);
            $_smarty_tpl->tpl_vars["title"] = new Smarty_variable($_smarty_tpl->tpl_vars['obj']->value->getLabel(), null, 0);
            $_smarty_tpl->tpl_vars["childLinks"] = new Smarty_variable($_smarty_tpl->tpl_vars['obj']->value->getChildLinks(), null, 0);
            ?>
<span class="dropdown span<?php 
            if (!empty($_smarty_tpl->tpl_vars['src']->value)) {
                ?>
 settingIcons <?php 
            }
            ?>
"><?php 
            if (!empty($_smarty_tpl->tpl_vars['src']->value)) {
                ?>
<a id="menubar_item_right_<?php 
                echo $_smarty_tpl->tpl_vars['title']->value;
                ?>
" class="dropdown-toggle" data-toggle="dropdown" href="#"><img src="<?php 
                echo $_smarty_tpl->tpl_vars['src']->value;
                ?>
" alt="<?php 
                echo vtranslate($_smarty_tpl->tpl_vars['title']->value, $_smarty_tpl->tpl_vars['MODULE']->value);
                ?>
" title="<?php 
                echo vtranslate($_smarty_tpl->tpl_vars['title']->value, $_smarty_tpl->tpl_vars['MODULE']->value);
                ?>
" /></a><?php 
            } else {
                $_smarty_tpl->tpl_vars['title'] = new Smarty_variable($_smarty_tpl->tpl_vars['USER_MODEL']->value->get('first_name'), null, 0);
                if (empty($_smarty_tpl->tpl_vars['title']->value)) {
                    $_smarty_tpl->tpl_vars['title'] = new Smarty_variable($_smarty_tpl->tpl_vars['USER_MODEL']->value->get('last_name'), null, 0);
                }
                ?>
<span class="dropdown-toggle" data-toggle="dropdown" href="#"><a id="menubar_item_right_<?php 
                echo $_smarty_tpl->tpl_vars['title']->value;
                ?>
"  class="userName textOverflowEllipsis" title="<?php 
                echo $_smarty_tpl->tpl_vars['title']->value;
                ?>
"><strong><?php 
                echo $_smarty_tpl->tpl_vars['title']->value;
                ?>
</strong>&nbsp;<i class="caret"></i> </a> </span><?php 
            }
            if (!empty($_smarty_tpl->tpl_vars['childLinks']->value)) {
                ?>
<ul class="dropdown-menu pull-right"><?php 
                $_smarty_tpl->tpl_vars['obj'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['obj']->_loop = false;
                $_smarty_tpl->tpl_vars['index'] = new Smarty_Variable();
                $_from = $_smarty_tpl->tpl_vars['childLinks']->value;
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['obj']->key => $_smarty_tpl->tpl_vars['obj']->value) {
                    $_smarty_tpl->tpl_vars['obj']->_loop = true;
                    $_smarty_tpl->tpl_vars['index']->value = $_smarty_tpl->tpl_vars['obj']->key;
                    if ($_smarty_tpl->tpl_vars['obj']->value->getLabel() == null) {
                        ?>
<li class="divider">&nbsp;</li><?php 
                    } else {
                        $_smarty_tpl->tpl_vars["id"] = new Smarty_variable($_smarty_tpl->tpl_vars['obj']->value->getId(), null, 0);
                        $_smarty_tpl->tpl_vars["href"] = new Smarty_variable($_smarty_tpl->tpl_vars['obj']->value->getUrl(), null, 0);
                        $_smarty_tpl->tpl_vars["label"] = new Smarty_variable($_smarty_tpl->tpl_vars['obj']->value->getLabel(), null, 0);
                        $_smarty_tpl->tpl_vars["onclick"] = new Smarty_variable('', null, 0);
                        if (stripos($_smarty_tpl->tpl_vars['obj']->value->getUrl(), 'javascript:') === 0) {
                            $_smarty_tpl->tpl_vars["onclick"] = new Smarty_variable("onclick=" . $_smarty_tpl->tpl_vars['href']->value, null, 0);
                            $_smarty_tpl->tpl_vars["href"] = new Smarty_variable("javascript:;", null, 0);
                        }
                        ?>
<li><a target="<?php 
                        echo $_smarty_tpl->tpl_vars['obj']->value->target;
                        ?>
" id="menubar_item_right_<?php 
                        echo Vtiger_Util_Helper::replaceSpaceWithUnderScores($_smarty_tpl->tpl_vars['label']->value);
                        ?>
" <?php 
                        if ($_smarty_tpl->tpl_vars['label']->value == 'Switch to old look') {
                            ?>
switchLook<?php 
                        }
                        ?>
 href="<?php 
                        echo $_smarty_tpl->tpl_vars['href']->value;
                        ?>
" <?php 
                        echo $_smarty_tpl->tpl_vars['onclick']->value;
                        ?>
><?php 
                        echo vtranslate($_smarty_tpl->tpl_vars['label']->value, $_smarty_tpl->tpl_vars['MODULE']->value);
                        ?>
</a></li><?php 
                    }
                }
                ?>
</ul><?php 
            }
            ?>
</span><?php 
        }
        ?>
</span><div id="headerLinksCompact"><span class="btn-group dropdown qCreate cursorPointer"><img src="<?php 
        echo vimage_path('btnAdd_white.png');
        ?>
" class="" alt="<?php 
        echo vtranslate('LBL_QUICK_CREATE', $_smarty_tpl->tpl_vars['MODULE']->value);
        ?>
" title="<?php 
        echo vtranslate('LBL_QUICK_CREATE', $_smarty_tpl->tpl_vars['MODULE']->value);
        ?>
" data-toggle="dropdown"/><ul class="dropdown-menu dropdownStyles pull-right commonActionsButtonDropDown"><li class="title"><strong><?php 
        echo vtranslate('Quick Create', $_smarty_tpl->tpl_vars['MODULE']->value);
        ?>
</strong></li><hr/><li id="compactquickCreate"><div class="CompactQC"><?php 
        $_smarty_tpl->tpl_vars['moduleModel'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['moduleModel']->_loop = false;
        $_smarty_tpl->tpl_vars['moduleName'] = new Smarty_Variable();
        $_from = $_smarty_tpl->tpl_vars['MENUS']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['moduleModel']->key => $_smarty_tpl->tpl_vars['moduleModel']->value) {
            $_smarty_tpl->tpl_vars['moduleModel']->_loop = true;
            $_smarty_tpl->tpl_vars['moduleName']->value = $_smarty_tpl->tpl_vars['moduleModel']->key;
            if ($_smarty_tpl->tpl_vars['moduleModel']->value->isPermitted('EditView')) {
                $_smarty_tpl->tpl_vars['quickCreateModule'] = new Smarty_variable($_smarty_tpl->tpl_vars['moduleModel']->value->isQuickCreateSupported(), null, 0);
                $_smarty_tpl->tpl_vars['singularLabel'] = new Smarty_variable($_smarty_tpl->tpl_vars['moduleModel']->value->getSingularLabelKey(), null, 0);
                if ($_smarty_tpl->tpl_vars['quickCreateModule']->value == '1') {
                    ?>
<a class="quickCreateModule" data-name="<?php 
                    echo $_smarty_tpl->tpl_vars['moduleModel']->value->getName();
                    ?>
"data-url="<?php 
                    echo $_smarty_tpl->tpl_vars['moduleModel']->value->getQuickCreateUrl();
                    ?>
" href="javascript:void(0)"><?php 
                    echo vtranslate($_smarty_tpl->tpl_vars['singularLabel']->value, $_smarty_tpl->tpl_vars['moduleName']->value);
                    ?>
</a><?php 
                }
            }
        }
        ?>
</div></li></ul></span><span  class="dropdown"><a class="dropdown-toggle btn-navbar" data-toggle="dropdown" href="#"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><ul class="dropdown-menu pull-right"><?php 
        $_smarty_tpl->tpl_vars['obj'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['obj']->_loop = false;
        $_smarty_tpl->tpl_vars['index'] = new Smarty_Variable();
        $_from = $_smarty_tpl->tpl_vars['HEADER_LINKS']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        $_smarty_tpl->tpl_vars['smarty']->value['foreach']["compactIndex"]['index'] = -1;
        foreach ($_from as $_smarty_tpl->tpl_vars['obj']->key => $_smarty_tpl->tpl_vars['obj']->value) {
            $_smarty_tpl->tpl_vars['obj']->_loop = true;
            $_smarty_tpl->tpl_vars['index']->value = $_smarty_tpl->tpl_vars['obj']->key;
            $_smarty_tpl->tpl_vars['smarty']->value['foreach']["compactIndex"]['index']++;
            $_smarty_tpl->tpl_vars["src"] = new Smarty_variable($_smarty_tpl->tpl_vars['obj']->value->getIconPath(), null, 0);
            $_smarty_tpl->tpl_vars["icon"] = new Smarty_variable($_smarty_tpl->tpl_vars['obj']->value->getIcon(), null, 0);
            $_smarty_tpl->tpl_vars["title"] = new Smarty_variable($_smarty_tpl->tpl_vars['obj']->value->getLabel(), null, 0);
            $_smarty_tpl->tpl_vars["childLinks"] = new Smarty_variable($_smarty_tpl->tpl_vars['obj']->value->getChildLinks(), null, 0);
            if ($_smarty_tpl->getVariable('smarty')->value['foreach']['compactIndex']['index'] != 0) {
                ?>
<li class="divider">&nbsp;</li><?php 
            }
            $_smarty_tpl->tpl_vars['obj'] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars['obj']->_loop = false;
            $_smarty_tpl->tpl_vars['index'] = new Smarty_Variable();
            $_from = $_smarty_tpl->tpl_vars['childLinks']->value;
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars['obj']->key => $_smarty_tpl->tpl_vars['obj']->value) {
                $_smarty_tpl->tpl_vars['obj']->_loop = true;
                $_smarty_tpl->tpl_vars['index']->value = $_smarty_tpl->tpl_vars['obj']->key;
                $_smarty_tpl->tpl_vars["id"] = new Smarty_variable($_smarty_tpl->tpl_vars['obj']->value->getId(), null, 0);
                $_smarty_tpl->tpl_vars["href"] = new Smarty_variable($_smarty_tpl->tpl_vars['obj']->value->getUrl(), null, 0);
                $_smarty_tpl->tpl_vars["label"] = new Smarty_variable($_smarty_tpl->tpl_vars['obj']->value->getLabel(), null, 0);
                $_smarty_tpl->tpl_vars["onclick"] = new Smarty_variable('', null, 0);
                if (stripos($_smarty_tpl->tpl_vars['obj']->value->getUrl(), 'javascript:') === 0) {
                    $_smarty_tpl->tpl_vars["onclick"] = new Smarty_variable("onclick=" . $_smarty_tpl->tpl_vars['href']->value, null, 0);
                    $_smarty_tpl->tpl_vars["href"] = new Smarty_variable("javascript:;", null, 0);
                }
                ?>
<li><a target="<?php 
                echo $_smarty_tpl->tpl_vars['obj']->value->target;
                ?>
" id="menubar_item_right_<?php 
                echo Vtiger_Util_Helper::replaceSpaceWithUnderScores($_smarty_tpl->tpl_vars['label']->value);
                ?>
" <?php 
                if ($_smarty_tpl->tpl_vars['label']->value == 'Switch to old look') {
                    ?>
switchLook<?php 
                }
                ?>
 href="<?php 
                echo $_smarty_tpl->tpl_vars['href']->value;
                ?>
" <?php 
                echo $_smarty_tpl->tpl_vars['onclick']->value;
                ?>
><?php 
                echo vtranslate($_smarty_tpl->tpl_vars['label']->value, $_smarty_tpl->tpl_vars['MODULE']->value);
                ?>
</a></li><?php 
            }
        }
        ?>
</ul></span></div></div></div><div class="clearfix"></div></div></div><?php 
        $_smarty_tpl->tpl_vars["announcement"] = new Smarty_variable($_smarty_tpl->tpl_vars['ANNOUNCEMENT']->value->get('announcement'), null, 0);
        ?>
<div class="announcement noprint" id="announcement"><marquee direction="left" scrolldelay="10" scrollamount="3" behavior="scroll" class="marStyle" onMouseOver="this.setAttribute('scrollamount', 0, 0);" OnMouseOut="this.setAttribute('scrollamount', 6, 0);"><?php 
        if (!empty($_smarty_tpl->tpl_vars['announcement']->value)) {
            echo $_smarty_tpl->tpl_vars['announcement']->value;
        } else {
            echo vtranslate('LBL_NO_ANNOUNCEMENTS', $_smarty_tpl->tpl_vars['MODULE']->value);
        }
        ?>
</marquee></div><input type='hidden' value="<?php 
        echo $_smarty_tpl->tpl_vars['MODULE']->value;
        ?>
" id='module' name='module'/><input type="hidden" value="<?php 
        echo $_smarty_tpl->tpl_vars['PARENT_MODULE']->value;
        ?>
" id="parent" name='parent' /><input type='hidden' value="<?php 
        echo $_smarty_tpl->tpl_vars['VIEW']->value;
        ?>
" id='view' name='view'/>
<?php 
    }
Ejemplo n.º 20
0
 /**
  * Function to returns all skins(themes)
  * @return <Array>
  */
 public function getAllSkins()
 {
     return Vtiger_Theme::getAllSkins();
 }
Ejemplo n.º 21
0
 /**
  * Function to get the list of Css models to be included
  * @param Vtiger_Request $request
  * @return <Array> - List of Vtiger_CssScript_Model instances
  */
 function getHeaderCss(Vtiger_Request $request)
 {
     global $log;
     $headerCssInstances = parent::getHeaderCss($request);
     $headerCss = Vtiger_Link_Model::getAllByType(Vtiger_Link::IGNORE_MODULE, array('HEADERCSS'));
     $selectedThemeCssPath = Vtiger_Theme::getStylePath();
     //TODO : check the filename whether it is less or css and add relative less
     $isLessType = strpos($selectedThemeCssPath, ".less") !== false ? true : false;
     $cssScriptModel = new Vtiger_CssScript_Model();
     $headerCssInstances[] = $cssScriptModel->set('href', $selectedThemeCssPath)->set('rel', $isLessType ? Vtiger_CssScript_Model::LESS_REL : Vtiger_CssScript_Model::DEFAULT_REL);
     foreach ($headerCss as $headerType => $cssLinks) {
         foreach ($cssLinks as $cssLink) {
             if ($this->checkFileUriInRelocatedMouldesFolder($cssLink->linkurl)) {
                 $headerCssInstances[] = Vtiger_CssScript_Model::getInstanceFromLinkObject($cssLink);
             }
         }
     }
     return $headerCssInstances;
 }
Ejemplo n.º 22
0
 /**
  * Function to get Settings links
  * @return <Array>
  */
 public function getSettingLinks()
 {
     if (!$this->isEntityModule()) {
         return array();
     }
     vimport('~~modules/com_vtiger_workflow/VTWorkflowUtils.php');
     $layoutEditorImagePath = Vtiger_Theme::getImagePath('LayoutEditor.gif');
     $editWorkflowsImagePath = Vtiger_Theme::getImagePath('EditWorkflows.png');
     $settingsLinks = array();
     $settingsLinks[] = array('linktype' => 'LISTVIEWSETTING', 'linklabel' => 'LBL_EDIT_FIELDS', 'linkurl' => 'index.php?parent=Settings&module=LayoutEditor&sourceModule=' . $this->getName(), 'linkicon' => $layoutEditorImagePath);
     $settingsLinks[] = array('linktype' => 'LISTVIEWSETTING', 'linklabel' => 'LBL_ARRANGE_RELATED_TABS', 'linkurl' => 'index.php?parent=Settings&module=LayoutEditor&mode=showRelatedListLayout&block=2&fieldid=41&sourceModule=' . $this->getName(), 'linkicon' => $layoutEditorImagePath);
     $settingsLinks[] = array('linktype' => 'LISTVIEWSETTING', 'linklabel' => 'LBL_QUICK_CREATE_EDITOR', 'linkurl' => 'index.php?parent=Settings&module=QuickCreateEditor&sourceModule=' . $this->getName(), 'linkicon' => $layoutEditorImagePath);
     $settingsLinks[] = array('linktype' => 'LISTVIEWSETTING', 'linklabel' => 'LBL_TREES_MANAGER', 'linkurl' => 'index.php?parent=Settings&module=TreesManager&view=List&sourceModule=' . $this->getName(), 'linkicon' => $layoutEditorImagePath);
     $settingsLinks[] = array('linktype' => 'LISTVIEWSETTING', 'linklabel' => 'LBL_WIDGETS_MANAGMENT', 'linkurl' => 'index.php?parent=Settings&module=Widgets&view=Index&sourceModule=' . $this->getName(), 'linkicon' => $layoutEditorImagePath);
     if (VTWorkflowUtils::checkModuleWorkflow($this->getName())) {
         $settingsLinks[] = array('linktype' => 'LISTVIEWSETTING', 'linklabel' => 'LBL_EDIT_WORKFLOWS', 'linkurl' => 'index.php?parent=Settings&module=Workflows&view=List&sourceModule=' . $this->getName(), 'linkicon' => $editWorkflowsImagePath);
     }
     $settingsLinks[] = array('linktype' => 'LISTVIEWSETTING', 'linklabel' => 'LBL_EDIT_PICKLIST_VALUES', 'linkurl' => 'index.php?parent=Settings&module=Picklist&view=Index&source_module=' . $this->getName(), 'linkicon' => '');
     $settingsLinks[] = array('linktype' => 'LISTVIEWSETTING', 'linklabel' => 'LBL_PICKLIST_DEPENDENCY', 'linkurl' => 'index.php?parent=Settings&module=PickListDependency&view=List&formodule=' . $this->getName(), 'linkicon' => '');
     if ($this->hasSequenceNumberField()) {
         $settingsLinks[] = array('linktype' => 'LISTVIEWSETTING', 'linklabel' => 'LBL_MODULE_SEQUENCE_NUMBERING', 'linkurl' => 'index.php?parent=Settings&module=Vtiger&view=CustomRecordNumbering&sourceModule=' . $this->getName(), 'linkicon' => '');
     }
     $webformSupportedModule = Settings_Webforms_Module_Model::getSupportedModulesList();
     if (array_key_exists($this->getName(), $webformSupportedModule)) {
         $settingsLinks[] = array('linktype' => 'LISTVIEWSETTING', 'linklabel' => 'LBL_SETUP_WEBFORMS', 'linkurl' => 'index.php?module=Webforms&parent=Settings&view=Edit&sourceModule=' . $this->getName(), 'linkicon' => '');
     }
     return $settingsLinks;
 }
Ejemplo n.º 23
0
 /**
  * Function to get the list of Css models to be included
  * @param Vtiger_Request $request
  * @return <Array> - List of Vtiger_CssScript_Model instances
  */
 function getHeaderCss(Vtiger_Request $request)
 {
     $headerCssInstances = parent::getHeaderCss($request);
     $headerCss = Vtiger_Link_Model::getAllByType(Vtiger_Link::IGNORE_MODULE, ['HEADERCSS']);
     $selectedThemeCssPath = Vtiger_Theme::getThemeStyle();
     $cssScriptModel = new Vtiger_CssScript_Model();
     $headerCssInstances[] = $cssScriptModel->set('href', $selectedThemeCssPath);
     foreach ($headerCss as $headerType => $cssLinks) {
         foreach ($cssLinks as $cssLink) {
             if ($this->checkFileUriInRelocatedMouldesFolder($cssLink->linkurl)) {
                 $headerCssInstances[] = Vtiger_CssScript_Model::getInstanceFromLinkObject($cssLink);
             }
         }
     }
     return $headerCssInstances;
 }
Ejemplo n.º 24
0
 /**
  * Function returns the css files
  * @param <Array> $cssFileNames
  * @param <String> $fileExtension
  * @return <Array of Vtiger_CssScript_Model>
  *
  * First check if $cssFileName exists
  * if not, check under layout folder $cssFileName eg:layouts/vlayout/$cssFileName
  */
 function checkAndConvertCssStyles($cssFileNames, $fileExtension = 'css')
 {
     $cssStyleInstances = array();
     foreach ($cssFileNames as $cssFileName) {
         $cssScriptModel = new Vtiger_CssScript_Model();
         if (strpos($cssFileName, 'http://') === 0 || strpos($cssFileName, 'https://') === 0) {
             $cssStyleInstances[] = $cssScriptModel->set('href', $cssFileName);
             continue;
         }
         $completeFilePath = Vtiger_Loader::resolveNameToPath($cssFileName, $fileExtension);
         $filePath = NULL;
         if (file_exists($completeFilePath)) {
             if (strpos($cssFileName, '~') === 0) {
                 $filePath = ltrim(ltrim($cssFileName, '~'), '/');
                 // if ~~ (reference is outside vtiger6 folder)
                 if (substr_count($cssFileName, "~") == 2) {
                     $filePath = "../" . $filePath;
                 }
             } else {
                 $filePath = str_replace('.', '/', $cssFileName) . '.' . $fileExtension;
                 $filePath = Vtiger_Theme::getStylePath($filePath);
             }
             $cssStyleInstances[] = $cssScriptModel->set('href', $filePath);
         }
     }
     return $cssStyleInstances;
 }
Ejemplo n.º 25
0
 /**
  * Function to retrieve the icon path for the link icon
  * @return <String/Boolean> - returns image path if icon exits
  *                              else returns false;
  */
 public function getIconPath()
 {
     if (!$this->isIconExists()) {
         return false;
     }
     return Vtiger_Theme::getImagePath($this->getIcon());
 }
Ejemplo n.º 26
0
 /**
  * Function to get the Image file path
  * @return <String>
  */
 public function getImagePath()
 {
     return Vtiger_Theme::getImagePath($this->get('imagename'));
 }
Ejemplo n.º 27
0
 /**
  * Function to get the Image file path
  * @return <String>
  */
 public function getImagePath()
 {
     global $log;
     $log->debug("Entering ./models/Image.php::getImagePath");
     return Vtiger_Theme::getImagePath($this->get('imagename'));
 }