/** Function to get primary columns for an advanced filter
 *  This function accepts The module as an argument
 *  This generate columns of the primary modules for the advanced filter 
 *  It returns a HTML string of combo values 
 */
function getPrimaryColumns_AdvFilterHTML($module, $selected = "")
{
    global $ogReport, $app_list_strings, $current_language;
    $mod_strings = return_module_language($current_language, $module);
    $block_listed = array();
    foreach ($ogReport->module_list[$module] as $key => $value) {
        if (isset($ogReport->pri_module_columnslist[$module][$value]) && !$block_listed[$value]) {
            $block_listed[$value] = true;
            $shtml .= "<optgroup label=\"" . $app_list_strings['moduleList'][$module] . " " . getTranslatedString($value) . "\" class=\"select\" style=\"border:none\">";
            foreach ($ogReport->pri_module_columnslist[$module][$value] as $field => $fieldlabel) {
                if (isset($mod_strings[$fieldlabel])) {
                    //fix for ticket 5191
                    $selected = decode_html($selected);
                    $field = decode_html($field);
                    //fix ends
                    if ($selected == $field) {
                        $shtml .= "<option selected value=\"" . $field . "\">" . $mod_strings[$fieldlabel] . "</option>";
                    } else {
                        $shtml .= "<option value=\"" . $field . "\">" . $mod_strings[$fieldlabel] . "</option>";
                    }
                } else {
                    if ($selected == $field) {
                        $shtml .= "<option selected value=\"" . $field . "\">" . $fieldlabel . "</option>";
                    } else {
                        $shtml .= "<option value=\"" . $field . "\">" . $fieldlabel . "</option>";
                    }
                }
            }
        }
    }
    return $shtml;
}
<?php if ($_valid && !is_callable('content_56059c18e4bca')) {function content_56059c18e4bca($_smarty_tpl) {?>
<?php $_smarty_tpl->tpl_vars["FIELD_INFO"] = new Smarty_variable(Zend_Json::encode($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldInfo()), null, 0);?><div class="row-fluid"><?php $_smarty_tpl->tpl_vars['ASSIGNED_USER_ID'] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('name'), null, 0);?><?php $_smarty_tpl->tpl_vars['ALL_ACTIVEUSER_LIST'] = new Smarty_variable($_smarty_tpl->tpl_vars['USER_MODEL']->value->getAccessibleUsers(), null, 0);?><?php $_smarty_tpl->tpl_vars['SEARCH_VALUES'] = new Smarty_variable(explode(',',$_smarty_tpl->tpl_vars['SEARCH_INFO']->value['searchValue']), null, 0);?><?php $_smarty_tpl->tpl_vars['SEARCH_VALUES'] = new Smarty_variable(array_map("trim",$_smarty_tpl->tpl_vars['SEARCH_VALUES']->value), null, 0);?><?php if ($_smarty_tpl->tpl_vars['ASSIGNED_USER_ID']->value!='modifiedby'){?><?php $_smarty_tpl->tpl_vars['ALL_ACTIVEGROUP_LIST'] = new Smarty_variable($_smarty_tpl->tpl_vars['USER_MODEL']->value->getAccessibleGroups(), null, 0);?><?php }else{ ?><?php $_smarty_tpl->tpl_vars['ALL_ACTIVEGROUP_LIST'] = new Smarty_variable(array(), null, 0);?><?php }?><?php $_smarty_tpl->tpl_vars['ACCESSIBLE_USER_LIST'] = new Smarty_variable($_smarty_tpl->tpl_vars['USER_MODEL']->value->getAccessibleUsersForModule($_smarty_tpl->tpl_vars['MODULE']->value), null, 0);?><?php $_smarty_tpl->tpl_vars['ACCESSIBLE_GROUP_LIST'] = new Smarty_variable($_smarty_tpl->tpl_vars['USER_MODEL']->value->getAccessibleGroupForModule($_smarty_tpl->tpl_vars['MODULE']->value), null, 0);?><select class="select2 listSearchContributor span10 <?php echo $_smarty_tpl->tpl_vars['ASSIGNED_USER_ID']->value;?>
"  name="<?php echo $_smarty_tpl->tpl_vars['ASSIGNED_USER_ID']->value;?>
" multiple style="width:150px;"data-fieldinfo='<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['FIELD_INFO']->value, ENT_QUOTES, 'UTF-8', true);?>
'><optgroup label="<?php echo vtranslate('LBL_USERS');?>
"><?php  $_smarty_tpl->tpl_vars['OWNER_NAME'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['OWNER_NAME']->_loop = false;
 $_smarty_tpl->tpl_vars['OWNER_ID'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['ALL_ACTIVEUSER_LIST']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['OWNER_NAME']->key => $_smarty_tpl->tpl_vars['OWNER_NAME']->value){
$_smarty_tpl->tpl_vars['OWNER_NAME']->_loop = true;
 $_smarty_tpl->tpl_vars['OWNER_ID']->value = $_smarty_tpl->tpl_vars['OWNER_NAME']->key;
?><option value="<?php echo $_smarty_tpl->tpl_vars['OWNER_NAME']->value;?>
" data-picklistvalue= '<?php echo $_smarty_tpl->tpl_vars['OWNER_NAME']->value;?>
' <?php if (in_array(trim(decode_html($_smarty_tpl->tpl_vars['OWNER_NAME']->value)),$_smarty_tpl->tpl_vars['SEARCH_VALUES']->value)){?> selected <?php }?><?php if (array_key_exists($_smarty_tpl->tpl_vars['OWNER_ID']->value,$_smarty_tpl->tpl_vars['ACCESSIBLE_USER_LIST']->value)){?> data-recordaccess=true <?php }else{ ?> data-recordaccess=false <?php }?>data-userId="<?php echo $_smarty_tpl->tpl_vars['CURRENT_USER_ID']->value;?>
"><?php echo $_smarty_tpl->tpl_vars['OWNER_NAME']->value;?>
</option><?php } ?></optgroup><?php if (count($_smarty_tpl->tpl_vars['ALL_ACTIVEGROUP_LIST']->value)>0){?><optgroup label="<?php echo vtranslate('LBL_GROUPS');?>
"><?php  $_smarty_tpl->tpl_vars['OWNER_NAME'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['OWNER_NAME']->_loop = false;
 $_smarty_tpl->tpl_vars['OWNER_ID'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['ALL_ACTIVEGROUP_LIST']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['OWNER_NAME']->key => $_smarty_tpl->tpl_vars['OWNER_NAME']->value){
$_smarty_tpl->tpl_vars['OWNER_NAME']->_loop = true;
 $_smarty_tpl->tpl_vars['OWNER_ID']->value = $_smarty_tpl->tpl_vars['OWNER_NAME']->key;
?><option value="<?php echo $_smarty_tpl->tpl_vars['OWNER_NAME']->value;?>
" data-picklistvalue= '<?php echo $_smarty_tpl->tpl_vars['OWNER_NAME']->value;?>
' <?php if (in_array(trim($_smarty_tpl->tpl_vars['OWNER_NAME']->value),$_smarty_tpl->tpl_vars['SEARCH_VALUES']->value)){?> selected <?php }?><?php if (array_key_exists($_smarty_tpl->tpl_vars['OWNER_ID']->value,$_smarty_tpl->tpl_vars['ACCESSIBLE_GROUP_LIST']->value)){?> data-recordaccess=true <?php }else{ ?> data-recordaccess=false <?php }?> ><?php echo $_smarty_tpl->tpl_vars['OWNER_NAME']->value;?>
</option><?php } ?></optgroup><?php }?></select></div><?php }} ?>
Example #3
0
 public function getLastSavedDate()
 {
     global $log;
     $log->debug("Entering ./models/Notebook.php::getLastSavedDate");
     $data = Zend_Json::decode(decode_html($this->get('data')));
     return $data['lastSavedOn'];
 }
Example #4
0
	/**
	 * Fuction to get the Name of the record
	 * @return <String> - Entity Name of the record
	 */
	public function getName() {
		$displayName = $this->get('label');
		if(empty($displayName)) {
			$displayName = $this->getDisplayName();
		}
		return Vtiger_Util_Helper::toSafeHTML(decode_html($displayName));
	}
 /**
  * Functions that gets translated string
  * @param <String> $key - string which need to be translated
  * @param <String> $module - module scope in which the translation need to be check
  * @return <String> - translated string
  */
 public static function getTranslatedString($key, $module = '', $currentLanguage = '')
 {
     // SalesPlatform begin temporary fix
     $key = htmlspecialchars_decode($key);
     // SalesPlatform end
     if (empty($currentLanguage)) {
         $currentLanguage = self::getLanguage();
     }
     //decoding for Start Date & Time and End Date & Time
     if (!is_array($key)) {
         $key = decode_html($key);
     }
     $translatedString = self::getLanguageTranslatedString($currentLanguage, $key, $module);
     // label not found in users language pack, then check in the default language pack(config.inc.php)
     if ($translatedString === null) {
         $defaultLanguage = vglobal('default_language');
         if (!empty($defaultLanguage) && strcasecmp($defaultLanguage, $currentLanguage) !== 0) {
             $translatedString = self::getLanguageTranslatedString($defaultLanguage, $key, $module);
         }
         // SalesPlatform.ru begin Localize Install tittle
         if (empty($defaultLanguage) && $key == 'Install') {
             $translatedString = self::getLanguageTranslatedString('ru_ru', $key, 'Install');
         }
         // SalesPlatform.ru end
     }
     // If translation is not found then return label
     if ($translatedString === null) {
         $translatedString = $key;
     }
     return $translatedString;
 }
    function content_54e3fed576ed9($_smarty_tpl)
    {
        $_smarty_tpl->tpl_vars['WIDTHTYPE'] = new Smarty_variable($_smarty_tpl->tpl_vars['USER_MODEL']->value->get('rowheight'), null, 0);
        ?>
<table class="table table-bordered detailview-table"><thead><tr><th class="blockHeader" colspan="4"><?php 
        echo vtranslate('Email Template - Properties of ', $_smarty_tpl->tpl_vars['MODULE_NAME']->value);
        ?>
 " <?php 
        echo decode_html($_smarty_tpl->tpl_vars['RECORD']->value->get('templatename'));
        ?>
 "</th></tr></thead><tbody<tr><td class="fieldLabel <?php 
        echo $_smarty_tpl->tpl_vars['WIDTHTYPE']->value;
        ?>
"><label class="muted marginRight10px"><?php 
        echo vtranslate('Templatename', $_smarty_tpl->tpl_vars['MODULE_NAME']->value);
        ?>
</label></td><td class="fieldValue <?php 
        echo $_smarty_tpl->tpl_vars['WIDTHTYPE']->value;
        ?>
"><?php 
        echo decode_html($_smarty_tpl->tpl_vars['RECORD']->value->get('templatename'));
        ?>
</td></tr><tr><td class="fieldLabel <?php 
        echo $_smarty_tpl->tpl_vars['WIDTHTYPE']->value;
        ?>
"><label class="muted marginRight10px"><?php 
        echo vtranslate('Description', $_smarty_tpl->tpl_vars['MODULE_NAME']->value);
        ?>
</label></td><td class="fieldValue <?php 
        echo $_smarty_tpl->tpl_vars['WIDTHTYPE']->value;
        ?>
"><?php 
        echo decode_html($_smarty_tpl->tpl_vars['RECORD']->value->get('description'));
        ?>
</td></tr><tr><td class="fieldLabel <?php 
        echo $_smarty_tpl->tpl_vars['WIDTHTYPE']->value;
        ?>
"><label class="muted marginRight10px"><?php 
        echo vtranslate('Subject', $_smarty_tpl->tpl_vars['MODULE_NAME']->value);
        ?>
</label></td><td class="fieldValue <?php 
        echo $_smarty_tpl->tpl_vars['WIDTHTYPE']->value;
        ?>
"><?php 
        echo decode_html($_smarty_tpl->tpl_vars['RECORD']->value->get('subject'));
        ?>
</td></tr><tr><td class="fieldLabel <?php 
        echo $_smarty_tpl->tpl_vars['WIDTHTYPE']->value;
        ?>
"><label class="muted marginRight10px"><?php 
        echo vtranslate('Message', $_smarty_tpl->tpl_vars['MODULE_NAME']->value);
        ?>
</label></td><td class="fieldValue <?php 
        echo $_smarty_tpl->tpl_vars['WIDTHTYPE']->value;
        ?>
"><?php 
        echo decode_html($_smarty_tpl->tpl_vars['RECORD']->value->get('body'));
        ?>
</td></tr></tbody></table><?php 
    }
Example #7
0
 function Reports($reportId = "")
 {
     $db = PearDatabase::getInstance();
     $currentUser = Users_Record_Model::getCurrentUserModel();
     $userId = $currentUser->getId();
     $this->initListOfModules();
     if ($reportId != "") {
         // Lookup information in cache first
         $cachedInfo = VTCacheUtils::lookupReport_Info($userId, $reportId);
         $subOrdinateUsers = VTCacheUtils::lookupReport_SubordinateUsers($reportId);
         if ($cachedInfo === false) {
             $ssql = "SELECT vtiger_reportmodules.*, vtiger_report.* FROM vtiger_report\n\t\t\t\t\t\t\tINNER JOIN vtiger_reportmodules ON vtiger_report.reportid = vtiger_reportmodules.reportmodulesid\n\t\t\t\t\t\t\tWHERE vtiger_report.reportid = ?";
             $params = array($reportId);
             require_once 'include/utils/GetUserGroups.php';
             require 'user_privileges/user_privileges_' . $userId . '.php';
             $userGroups = new GetUserGroups();
             $userGroups->getAllUserGroups($userId);
             $userGroupsList = $userGroups->user_groups;
             if (!empty($userGroupsList) && $currentUser->isAdminUser() == false) {
                 $userGroupsQuery = " (shareid IN (" . generateQuestionMarks($userGroupsList) . ") AND setype='groups') OR";
                 array_push($params, $userGroupsList);
             }
             $nonAdminQuery = " vtiger_report.reportid IN (SELECT reportid from vtiger_reportsharing\n\t\t\t\t\t\t\t\t\tWHERE {$userGroupsQuery} (shareid=? AND setype='users'))";
             if ($currentUser->isAdminUser() == false) {
                 $ssql .= " AND (({$nonAdminQuery})\n\t\t\t\t\t\t\t\tOR vtiger_report.sharingtype = 'Public'\n\t\t\t\t\t\t\t\tOR vtiger_report.owner = ? OR vtiger_report.owner IN\n\t\t\t\t\t\t\t\t\t(SELECT vtiger_user2role.userid FROM vtiger_user2role\n\t\t\t\t\t\t\t\t\tINNER JOIN vtiger_users ON vtiger_users.id = vtiger_user2role.userid\n\t\t\t\t\t\t\t\t\tINNER JOIN vtiger_role ON vtiger_role.roleid = vtiger_user2role.roleid\n\t\t\t\t\t\t\t\t\tWHERE vtiger_role.parentrole LIKE '{$current_user_parent_role_seq}::%')\n\t\t\t\t\t\t\t\t)";
                 array_push($params, $userId, $userId);
             }
             $result = $db->pquery($ssql, $params);
             if ($result && $db->num_rows($result)) {
                 $reportModulesRow = $db->fetch_array($result);
                 // Update information in cache now
                 VTCacheUtils::updateReport_Info($userId, $reportId, $reportModulesRow["primarymodule"], $reportModulesRow["secondarymodules"], $reportModulesRow["reporttype"], $reportModulesRow["reportname"], $reportModulesRow["description"], $reportModulesRow["folderid"], $reportModulesRow["owner"]);
             }
             $subOrdinateUsers = array();
             $subResult = $db->pquery("SELECT userid FROM vtiger_user2role\n\t\t\t\t\t\t\t\t\tINNER JOIN vtiger_users ON vtiger_users.id = vtiger_user2role.userid\n\t\t\t\t\t\t\t\t\tINNER JOIN vtiger_role ON vtiger_role.roleid = vtiger_user2role.roleid\n\t\t\t\t\t\t\t\t\tWHERE vtiger_role.parentrole LIKE '{$current_user_parent_role_seq}::%'", array());
             $numOfSubRows = $db->num_rows($subResult);
             for ($i = 0; $i < $numOfSubRows; $i++) {
                 $subOrdinateUsers[] = $db->query_result($subResult, $i, 'userid');
             }
             // Update subordinate user information for re-use
             VTCacheUtils::updateReport_SubordinateUsers($reportId, $subOrdinateUsers);
             // Re-look at cache to maintain code-consistency below
             $cachedInfo = VTCacheUtils::lookupReport_Info($userId, $reportId);
         }
         if ($cachedInfo) {
             $this->primodule = $cachedInfo["primarymodule"];
             $this->secmodule = $cachedInfo["secondarymodules"];
             $this->reporttype = $cachedInfo["reporttype"];
             $this->reportname = decode_html($cachedInfo["reportname"]);
             $this->reportdescription = decode_html($cachedInfo["description"]);
             $this->folderid = $cachedInfo["folderid"];
             if ($currentUser->isAdminUser() == true || in_array($cachedInfo["owner"], $subOrdinateUsers) || $cachedInfo["owner"] == $userId) {
                 $this->is_editable = true;
             } else {
                 $this->is_editable = false;
             }
         }
     }
     return $this;
 }
Example #8
0
 public function process(Vtiger_Request $request)
 {
     PDFMaker_Debugger_Model::GetInstance()->Init();
     $PDFMaker = new PDFMaker_PDFMaker_Model();
     if ($PDFMaker->CheckPermissions("DETAIL") == false) {
         $PDFMaker->DieDuePermission();
     }
     $viewer = $this->getViewer($request);
     if ($request->has('templateid') && !$request->isEmpty('templateid')) {
         $pdftemplateResult = $PDFMaker->GetDetailViewData($_REQUEST['templateid']);
         $viewer->assign("TEMPLATEID", $pdftemplateResult["templateid"]);
         $viewer->assign("MODULENAME", getTranslatedString($pdftemplateResult["module"]));
         $viewer->assign("BODY", decode_html($pdftemplateResult["body"]));
         $viewer->assign("HEADER", decode_html($pdftemplateResult["header"]));
         $viewer->assign("FOOTER", decode_html($pdftemplateResult["footer"]));
     }
     $version_type = $PDFMaker->GetVersionType();
     $viewer->assign("VERSION", $version_type . " " . PDFMaker_Version_Helper::$version);
     if ($PDFMaker->CheckPermissions("EDIT") && $PDFMaker->GetVersionType() != "deactivate") {
         $viewer->assign("EDIT", "permitted");
     }
     $category = getParentTab();
     $viewer->assign("CATEGORY", $category);
     $viewer->view('Detail.tpl', 'PDFMaker');
 }
 public function getWorkflowQuery($workflow)
 {
     $conditions = Zend_Json::decode(decode_html($workflow->test));
     $moduleName = $workflow->moduleName;
     $queryGenerator = new QueryGenerator($moduleName, $this->user);
     $queryGenerator->setFields(array('id'));
     $this->addWorkflowConditionsToQueryGenerator($queryGenerator, $conditions);
     if ($moduleName == 'Calendar' || $moduleName == 'Events') {
         if ($conditions) {
             $queryGenerator->addConditionGlue('AND');
         }
         // We should only get the records related to proper activity type
         if ($moduleName == 'Calendar') {
             $queryGenerator->addCondition('activitytype', 'Emails', 'n');
             $queryGenerator->addCondition('activitytype', 'Task', 'e', 'AND');
         } else {
             if ($moduleName == "Events") {
                 $queryGenerator->addCondition('activitytype', 'Emails', 'n');
                 $queryGenerator->addCondition('activitytype', 'Task', 'n', 'AND');
             }
         }
     }
     $query = $queryGenerator->getQuery();
     return $query;
 }
Example #10
0
	/**
	 * Function to get Image Details
	 * @return <array> Image Details List
	 */
	public function getImageDetails() {
		$db = PearDatabase::getInstance();
		$imageDetails = array();
		$recordId = $this->getId();

		if ($recordId) {
			$sql = "SELECT vtiger_attachments.*, vtiger_crmentity.setype FROM vtiger_attachments
						INNER JOIN vtiger_seattachmentsrel ON vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid
						INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_attachments.attachmentsid
						WHERE vtiger_crmentity.setype = 'Contacts Image' and vtiger_seattachmentsrel.crmid = ?";

			$result = $db->pquery($sql, array($recordId));

			$imageId = $db->query_result($result, 0, 'attachmentsid');
			$imagePath = $db->query_result($result, 0, 'path');
			$imageName = $db->query_result($result, 0, 'name');

			//decode_html - added to handle UTF-8 characters in file names
			$imageOriginalName = decode_html($imageName);

			//urlencode - added to handle special characters like #, %, etc.,
			$imageName = urlencode($imageName);

			$imageDetails[] = array(
					'id' => $imageId,
					'orgname' => $imageOriginalName,
					'path' => $imagePath.$imageId,
					'name' => $imageName
			);
		}
		return $imageDetails;
	}
Example #11
0
 /**
  * Function to delete google synchronization completely. Deletes all mapping information stored.
  * @param <string> $module - Module Name
  * @param <integer> $user - User Id
  */
 public function deleteSync($module, $user)
 {
     if ($module == 'Contacts' || $module == 'Calendar') {
         $name = 'Vtiger_Google' . $module;
     } else {
         return;
     }
     $db = PearDatabase::getInstance();
     $db->pquery("DELETE FROM vtiger_google_oauth2 WHERE service = ? AND userid = ?", array('Google' . $module, $user));
     $db->pquery("DELETE FROM vtiger_google_sync WHERE googlemodule = ? AND user = ?", array($module, $user));
     $result = $db->pquery("SELECT stateencodedvalues FROM vtiger_wsapp_sync_state WHERE name = ? AND userid = ?", array($name, $user));
     $stateValuesJson = $db->query_result($result, 0, 'stateencodedvalues');
     $stateValues = Zend_Json::decode(decode_html($stateValuesJson));
     $appKey = $stateValues['synctrackerid'];
     $result = $db->pquery("SELECT appid FROM vtiger_wsapp WHERE appkey = ?", array($appKey));
     $appId = $db->query_result($result, 0, 'appid');
     $db->pquery("DELETE FROM vtiger_wsapp_recordmapping WHERE appid = ?", array($appId));
     $db->pquery("DELETE FROM vtiger_wsapp WHERE appid = ?", array($appId));
     $db->pquery("DELETE FROM vtiger_wsapp_sync_state WHERE name = ? AND userid = ?", array($name, $user));
     if ($module == 'Contacts') {
         $db->pquery("DELETE FROM vtiger_google_sync_settings WHERE user = ?", array($user));
         $db->pquery("DELETE FROM vtiger_google_sync_fieldmapping WHERE user = ?", array($user));
     }
     Google_Utils_Helper::errorLog();
     return;
 }
Example #12
0
 /**
  * Function to get the url to get to the Settings Menu Item
  * @return <String> - Menu Item landing url
  */
 public function getUrl()
 {
     $url = $this->get('linkto');
     $url = decode_html($url);
     if (isset(self::$transformedUrlMapping[$url])) {
         $url = self::$transformedUrlMapping[$url];
     }
     $url .= '&block=' . $this->getMenu()->getId() . '&fieldid=' . $this->getId();
     return $url;
 }
Example #13
0
 static function lookupVTEMailAssociation($emailId)
 {
     global $adb;
     $result = $adb->pquery("SELECT vtiger_mailmanager_mailrel.* FROM vtiger_mailmanager_mailrel INNER JOIN\n\t\t\tvtiger_crmentity ON vtiger_crmentity.crmid=vtiger_mailmanager_mailrel.crmid AND vtiger_crmentity.deleted=0\n\t\t\tAND vtiger_mailmanager_mailrel.mailuid=? LIMIT 1", array(decode_html($mailuid)));
     if ($adb->num_rows($result)) {
         $resultrow = $adb->fetch_array($result);
         return $resultrow;
     }
     return false;
 }
Example #14
0
 /**
  * Initialize this instance.
  */
 function initialize($valuemap)
 {
     $this->tabid = $valuemap['tabid'];
     $this->linkid = $valuemap['linkid'];
     $this->linktype = $valuemap['linktype'];
     $this->linklabel = $valuemap['linklabel'];
     $this->linkurl = decode_html($valuemap['linkurl']);
     $this->linkicon = decode_html($valuemap['linkicon']);
     $this->sequence = $valuemap['sequence'];
     $this->status = $valuemap['status'];
 }
 function handleEvent($eventName, $data)
 {
     global $adb;
     if ($eventName == 'vtiger.entity.aftersave') {
         $labelInfo = getEntityName($data->getModuleName(), $data->getId(), true);
         if ($labelInfo) {
             $label = decode_html($labelInfo[$data->getId()]);
             $adb->pquery('UPDATE vtiger_crmentity SET label=? WHERE crmid=?', array($label, $data->getId()));
         }
     }
 }
Example #16
0
 function get($key)
 {
     $value = parent::get($key);
     if ($key === 'content' && $_REQUEST['view'] == 'Detail') {
         return Vtiger_Functions::removeHtmlTags(array('link', 'style', 'a', 'img', 'script'), decode_html($value));
     }
     if ($key === 'uid' || $key === 'content') {
         return decode_html($value);
     }
     return $value;
 }
    function content_54e3fed56365c($_smarty_tpl)
    {
        ?>
<span class="span10 margin0px"><span class="row-fluid"><span class="recordLabel font-x-x-large textOverflowEllipsis span pushDown" title="<?php 
        echo $_smarty_tpl->tpl_vars['RECORD']->value->getName();
        ?>
"><span class="templatename"><?php 
        echo decode_html($_smarty_tpl->tpl_vars['RECORD']->value->get('templatename'));
        ?>
</span>&nbsp;</span></span></span><?php 
    }
    function content_5694b10795b54($_smarty_tpl)
    {
        ?>

<div class="quickLinksDiv"><?php 
        $_smarty_tpl->tpl_vars['SIDEBARLINK'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['SIDEBARLINK']->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['QUICK_LINKS']->value['SIDEBARLINK'];
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['SIDEBARLINK']->key => $_smarty_tpl->tpl_vars['SIDEBARLINK']->value) {
            $_smarty_tpl->tpl_vars['SIDEBARLINK']->_loop = true;
            $_smarty_tpl->tpl_vars['SIDE_LINK_URL'] = new Smarty_variable(decode_html($_smarty_tpl->tpl_vars['SIDEBARLINK']->value->getUrl()), null, 0);
            $_smarty_tpl->tpl_vars["EXPLODED_PARSE_URL"] = new Smarty_variable(explode('?', $_smarty_tpl->tpl_vars['SIDE_LINK_URL']->value), null, 0);
            $_smarty_tpl->tpl_vars["COUNT_OF_EXPLODED_URL"] = new Smarty_variable(count($_smarty_tpl->tpl_vars['EXPLODED_PARSE_URL']->value), null, 0);
            if ($_smarty_tpl->tpl_vars['COUNT_OF_EXPLODED_URL']->value > 1) {
                $_smarty_tpl->tpl_vars["EXPLODED_URL"] = new Smarty_variable($_smarty_tpl->tpl_vars['EXPLODED_PARSE_URL']->value[$_smarty_tpl->tpl_vars['COUNT_OF_EXPLODED_URL']->value - 1], null, 0);
            }
            $_smarty_tpl->tpl_vars["PARSE_URL"] = new Smarty_variable(explode('&', $_smarty_tpl->tpl_vars['EXPLODED_URL']->value), null, 0);
            $_smarty_tpl->tpl_vars["CURRENT_LINK_VIEW"] = new Smarty_variable('view=' . $_smarty_tpl->tpl_vars['CURRENT_VIEW']->value, null, 0);
            $_smarty_tpl->tpl_vars["LINK_LIST_VIEW"] = new Smarty_variable(in_array($_smarty_tpl->tpl_vars['CURRENT_LINK_VIEW']->value, $_smarty_tpl->tpl_vars['PARSE_URL']->value), null, 0);
            $_smarty_tpl->tpl_vars["CURRENT_MODULE_NAME"] = new Smarty_variable('module=' . $_smarty_tpl->tpl_vars['MODULE']->value, null, 0);
            $_smarty_tpl->tpl_vars["IS_LINK_MODULE_NAME"] = new Smarty_variable(in_array($_smarty_tpl->tpl_vars['CURRENT_MODULE_NAME']->value, $_smarty_tpl->tpl_vars['PARSE_URL']->value), null, 0);
            ?>
<p onclick="window.location.href = '<?php 
            echo $_smarty_tpl->tpl_vars['SIDEBARLINK']->value->getUrl();
            ?>
'" id="<?php 
            echo $_smarty_tpl->tpl_vars['MODULE']->value;
            ?>
_sideBar_link_<?php 
            echo Vtiger_Util_Helper::replaceSpaceWithUnderScores($_smarty_tpl->tpl_vars['SIDEBARLINK']->value->getLabel());
            ?>
"class="<?php 
            if ($_smarty_tpl->tpl_vars['LINK_LIST_VIEW']->value && $_smarty_tpl->tpl_vars['IS_LINK_MODULE_NAME']->value) {
                ?>
selectedQuickLink <?php 
            } else {
                ?>
unSelectedQuickLink<?php 
            }
            ?>
"><a class="quickLinks" href="<?php 
            echo $_smarty_tpl->tpl_vars['SIDEBARLINK']->value->getUrl();
            ?>
"><strong><?php 
            echo vtranslate($_smarty_tpl->tpl_vars['SIDEBARLINK']->value->getLabel(), $_smarty_tpl->tpl_vars['MODULE']->value);
            ?>
</strong></a></p><?php 
        }
        ?>
</div><?php 
    }
Example #19
0
 protected function prepareFilterDetailUsingResultRow($resultrow)
 {
     $filter = array();
     $filter['cvid'] = $resultrow['cvid'];
     $filter['viewname'] = decode_html($resultrow['viewname']);
     $filter['setdefault'] = $resultrow['setdefault'];
     $filter['setmetrics'] = $resultrow['setmetrics'];
     $filter['moduleName'] = decode_html($resultrow['entitytype']);
     $filter['status'] = decode_html($resultrow['status']);
     $filter['userName'] = decode_html($resultrow['user_name']);
     return $filter;
 }
Example #20
0
 /**
  * Function to get the Company Logo
  * @return Vtiger_Image_Model instance
  */
 public function getLogo()
 {
     $logoName = decode_html($this->get('logoname'));
     $logoModel = new Vtiger_Image_Model();
     if (!empty($logoName)) {
         $companyLogo = array();
         $companyLogo['imagepath'] = "storage/Logo/{$logoName}";
         $companyLogo['alt'] = $companyLogo['title'] = $companyLogo['imagename'] = $logoName;
         $logoModel->setData($companyLogo);
     }
     return $logoModel;
 }
Example #21
0
 public function setWidgetModel($widgetModel)
 {
     $this->widgetModel = $widgetModel;
     $this->extraData = $this->widgetModel->get('data');
     // Decode data if not done already.
     if (is_string($this->extraData)) {
         $this->extraData = Zend_Json::decode(decode_html($this->extraData));
     }
     if ($this->extraData == NULL) {
         throw new Exception("Invalid data");
     }
 }
Example #22
0
	/**
	 * Function to get the Company Logo
	 * @return Vtiger_Image_Model instance
	 */
	public function getLogo(){
		global $WERPASCOPEDIR;
		$logoName = decode_html($this->get('logoname'));
		$logoModel = new Vtiger_Image_Model();
		if(!empty($logoName)) {
			$companyLogo = array();
			$companyLogo['imagepath'] = $WERPASCOPEDIR."/images/$logoName";
			$companyLogo['alt'] = $companyLogo['title'] = $companyLogo['imagename'] = $logoName;
			$logoModel->setData($companyLogo);
		}
		return $logoModel;
	}
<?php if ($_valid && !is_callable('content_56059c15ef65a')) {function content_56059c15ef65a($_smarty_tpl) {?>
<div class="recordNamesList"><div class="row-fluid"><div class=""><ul class="nav nav-list"><?php  $_smarty_tpl->tpl_vars['recordsModel'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['recordsModel']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['RECORDS']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['recordsModel']->key => $_smarty_tpl->tpl_vars['recordsModel']->value){
$_smarty_tpl->tpl_vars['recordsModel']->_loop = true;
?><li><a data-id=<?php echo $_smarty_tpl->tpl_vars['recordsModel']->value->getId();?>
 href="<?php echo $_smarty_tpl->tpl_vars['recordsModel']->value->getDetailViewUrl();?>
" title="<?php echo decode_html($_smarty_tpl->tpl_vars['recordsModel']->value->getName());?>
"><?php echo decode_html($_smarty_tpl->tpl_vars['recordsModel']->value->getName());?>
</a></li><?php }
if (!$_smarty_tpl->tpl_vars['recordsModel']->_loop) {
?><li style="text-align:center"><?php echo vtranslate('LBL_NO_RECORDS',$_smarty_tpl->tpl_vars['MODULE']->value);?>
</li><?php } ?></ul></div></div></div><?php }} ?>
Example #24
0
 public function checkDuplicate(Vtiger_Request $request)
 {
     $groupName = $request->get('groupname');
     $recordId = $request->get('record');
     $recordModel = Settings_Groups_Record_Model::getInstanceByName(decode_html($groupName), array($recordId));
     $response = new Vtiger_Response();
     if (!empty($recordModel)) {
         $response->setResult(array('success' => true, 'message' => vtranslate('LBL_DUPLICATES_EXIST', $request->getModule(false))));
     } else {
         $response->setResult(array('success' => false));
     }
     $response->emit();
 }
Example #25
0
	public static function getInstanceById($reportModel) {
		$self = new self();
		$db = PearDatabase::getInstance();
		$result = $db->pquery('SELECT * FROM vtiger_reporttype WHERE reportid = ?', array($reportModel->getId()));
		$data = $db->query_result($result, 0, 'data');
		if(!empty($data)) {
			$decodeData = Zend_Json::decode(decode_html($data));
			$self->setData($decodeData);
			$self->setParent($reportModel);
			$self->setId($reportModel->getId());
		}
		return $self;
	}
Example #26
0
 function captureNow($request)
 {
     $returnURL = false;
     try {
         foreach ($request as $key => $value) {
             $request[utf8_decode($key)] = $value;
         }
         if (!vtlib_isModuleActive('Webforms')) {
             throw new Exception('webforms is not active');
         }
         $webform = Webforms_Model::retrieveWithPublicId(vtlib_purify($request['publicid']));
         if (empty($webform)) {
             throw new Exception("Webform not found.");
         }
         $returnURL = $webform->getReturnUrl();
         // Retrieve user information
         $user = CRMEntity::getInstance('Users');
         $user->id = $user->getActiveAdminId();
         $user->retrieve_entity_info($user->id, 'Users');
         // Prepare the parametets
         $parameters = array();
         $webformFields = $webform->getFields();
         foreach ($webformFields as $webformField) {
             if ($webformField->getDefaultValue() != null) {
                 $parameters[$webformField->getFieldName()] = decode_html($webformField->getDefaultValue());
             } else {
                 $webformNeutralizedField = html_entity_decode($webformField->getNeutralizedField());
                 if (is_array(vtlib_purify($request[$webformNeutralizedField]))) {
                     $fieldData = implode(" |##| ", vtlib_purify($request[$webformNeutralizedField]));
                 } else {
                     $fieldData = vtlib_purify($request[$webformNeutralizedField]);
                     $fieldData = decode_html($fieldData);
                 }
                 $parameters[$webformField->getFieldName()] = stripslashes($fieldData);
             }
             if ($webformField->getRequired()) {
                 if (empty($parameters[$webformField->getFieldName()])) {
                     throw new Exception("Required fields not filled");
                 }
             }
         }
         $parameters['assigned_user_id'] = vtws_getWebserviceEntityId('Users', $webform->getOwnerId());
         // Create the record
         $record = vtws_create($webform->getTargetModule(), $parameters, $user);
         $this->sendResponse($returnURL, 'ok');
         return;
     } catch (Exception $e) {
         $this->sendResponse($returnURL, false, $e->getMessage());
         return;
     }
 }
Example #27
0
 public function getName()
 {
     $widgetName = $this->get('name');
     if (empty($widgetName)) {
         //since the html entitites will be encoded
         //TODO : See if you need to push decode_html to base model
         $linkUrl = decode_html($this->getUrl());
         preg_match('/name=[a-zA-Z]+/', $linkUrl, $matches);
         $matches = explode('=', $matches[0]);
         $widgetName = $matches[1];
         $this->set('name', $widgetName);
     }
     return $widgetName;
 }
Example #28
0
 /**
  * Function to save a given record model of the current module
  * @param EmailtTemplates_Record_Model $recordModel
  * @return <integer> template id
  */
 public function saveRecord(EmailTemplates_Record_Model $recordModel)
 {
     $db = PearDatabase::getInstance();
     $templateid = $recordModel->getId();
     if (empty($templateid)) {
         $templateid = $db->getUniqueID('vtiger_emailtemplates');
         $sql = "INSERT INTO vtiger_emailtemplates(templatename, subject, description, body, deleted, templateid) VALUES (?,?,?,?,?,?)";
     } else {
         $sql = "UPDATE vtiger_emailtemplates SET templatename=?, subject=?, description=?, body=?, deleted=? WHERE templateid = ?";
     }
     $params = array(decode_html($recordModel->get('templatename')), decode_html($recordModel->get('subject')), decode_html($recordModel->get('description')), $recordModel->get('body'), 0, $templateid);
     $db->pquery($sql, $params);
     return $recordModel->setId($templateid);
 }
Example #29
0
 public function setWidgetModel($widgetModel)
 {
     global $log;
     $log->debug("Entering ./models/MiniList.php::setWidgetModel");
     $this->widgetModel = $widgetModel;
     $this->extraData = $this->widgetModel->get('data');
     // Decode data if not done already.
     if (is_string($this->extraData)) {
         $this->extraData = Zend_Json::decode(decode_html($this->extraData));
     }
     if ($this->extraData == NULL) {
         throw new Exception("Invalid data");
     }
 }
Example #30
-9
 function captureNow($request)
 {
     $currentLanguage = Vtiger_Language_Handler::getLanguage();
     $moduleLanguageStrings = Vtiger_Language_Handler::getModuleStringsFromFile($currentLanguage);
     vglobal('app_strings', $moduleLanguageStrings['languageStrings']);
     $returnURL = false;
     try {
         if (!vtlib_isModuleActive('Webforms')) {
             throw new Exception('webforms is not active');
         }
         $webform = Webforms_Model::retrieveWithPublicId(vtlib_purify($request['publicid']));
         if (empty($webform)) {
             throw new Exception("Webform not found.");
         }
         $returnURL = $webform->getReturnUrl();
         $roundrobin = $webform->getRoundrobin();
         // Retrieve user information
         $user = CRMEntity::getInstance('Users');
         $user->id = $user->getActiveAdminId();
         $user->retrieve_entity_info($user->id, 'Users');
         // Prepare the parametets
         $parameters = array();
         $webformFields = $webform->getFields();
         foreach ($webformFields as $webformField) {
             if ($webformField->getDefaultValue() != null) {
                 $parameters[$webformField->getFieldName()] = decode_html($webformField->getDefaultValue());
             } else {
                 $webformNeutralizedField = html_entity_decode($webformField->getNeutralizedField(), ENT_COMPAT, "UTF-8");
                 if (is_array(vtlib_purify($request[$webformNeutralizedField]))) {
                     $fieldData = implode(" |##| ", vtlib_purify($request[$webformNeutralizedField]));
                 } else {
                     $fieldData = vtlib_purify($request[$webformNeutralizedField]);
                     $fieldData = decode_html($fieldData);
                 }
                 $parameters[$webformField->getFieldName()] = stripslashes($fieldData);
             }
             if ($webformField->getRequired()) {
                 if (!isset($parameters[$webformField->getFieldName()])) {
                     throw new Exception("Required fields not filled");
                 }
             }
         }
         if ($roundrobin) {
             $ownerId = $webform->getRoundrobinOwnerId();
             $ownerType = vtws_getOwnerType($ownerId);
             $parameters['assigned_user_id'] = vtws_getWebserviceEntityId($ownerType, $ownerId);
         } else {
             $ownerId = $webform->getOwnerId();
             $ownerType = vtws_getOwnerType($ownerId);
             $parameters['assigned_user_id'] = vtws_getWebserviceEntityId($ownerType, $ownerId);
         }
         // Create the record
         $record = vtws_create($webform->getTargetModule(), $parameters, $user);
         $this->sendResponse($returnURL, 'ok');
         return;
     } catch (Exception $e) {
         $this->sendResponse($returnURL, false, $e->getMessage());
         return;
     }
 }