Beispiel #1
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');
 }
Beispiel #2
0
 public function process(Vtiger_Request $request)
 {
     ${"GLOBALS"}["xnxyxvsvrf"] = "moduleName";
     $jilpvudc = "qualifiedModuleName";
     ${${"GLOBALS"}["muyhebdebu"]} = PearDatabase::getInstance();
     ${${"GLOBALS"}["xnxyxvsvrf"]} = $request->getModule();
     ${$jilpvudc} = $request->getModule(false);
     $fbqyempw = "request";
     ${${"GLOBALS"}["lftszpiucg"]} = $this->getViewer(${$fbqyempw});
     ${${"GLOBALS"}["hzvjzgp"]} = $request->get("configuration");
     if (!empty(${${"GLOBALS"}["hzvjzgp"]})) {
         ${${"GLOBALS"}["hzvjzgp"]} = Zend_Json::decode(base64_decode($request->get("configuration")), true);
     } else {
         ${${"GLOBALS"}["lqniwaxp"]} = $request->get("toModule");
         ${"GLOBALS"}["pvobwqmjqbh"] = "toModule";
         ${${"GLOBALS"}["hzvjzgp"]} = array("module" => ${${"GLOBALS"}["pvobwqmjqbh"]}, "condition" => array());
     }
     $fjfifovud = "configuration";
     ${${"GLOBALS"}["jupnbyhuc"]} = new \Workflow\Preset\Condition("condition", null, array("fromModule" => $request->get("fromModule"), "toModule" => ${${"GLOBALS"}["hzvjzgp"]}["module"], "enableHasChanged" => false, "container" => "conditionalPopupContainer"));
     $preset->beforeGetTaskform(array(array("condition" => ${$fjfifovud}["condition"]), ${${"GLOBALS"}["lftszpiucg"]}));
     $vxwvlrwj = "qualifiedModuleName";
     $viewer->assign("toModule", ${${"GLOBALS"}["hzvjzgp"]}["module"]);
     $viewer->assign("javascript", $preset->getInlineJS());
     $viewer->assign("title", getTranslatedString($request->get("title"), "Settings:Workflow2"));
     $viewer->view("ConditionPopup.tpl", ${$vxwvlrwj});
 }
Beispiel #3
0
function GetForgotPasswordUI($mail_send_message = '')
{
    $list .= '<html class="bg-gray"><head>';
    $list .= '<link rel="stylesheet" type="text/css" href="css/style.css">';
    $list .= '<meta name="viewport" content="width=device-width,initial-scale=1" />';
    $list .= '<link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" />';
    $list .= '<link href="css/font-awesome.min.css" rel="stylesheet" type="text/css" />';
    $list .= '<link href="css/ionicons.min.css" rel="stylesheet" type="text/css" />';
    $list .= '<link href="css/morris/morris.css" rel="stylesheet" type="text/css" />';
    $list .= '<link href="css/jvectormap/jquery-jvectormap-1.2.2.css" rel="stylesheet" type="text/css" />';
    $list .= '<link href="css/datepicker/datepicker3.css" rel="stylesheet" type="text/css" />';
    $list .= '<link href="css/daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css" />';
    $list .= '<link href="css/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css" rel="stylesheet" type="text/css" />';
    $list .= '<link href="css/AdminLTE.css" rel="stylesheet" type="text/css" /></head>';
    $list .= '<body class="bg-gray">';
    $list .= '<div class="form-box" id="login-box">';
    $list .= '<div class="header" style="font-weight: 400;">' . getTranslatedString('LBL_FORGOT_LOGIN') . '</div>';
    $list .= '<form name="forgot_password" action="index.php" method="post">';
    $list .= '<input type="hidden" name="email_id">';
    $list .= '<input type="hidden" name="param" value="forgot_password">';
    $list .= '<div class="body bg-gray">';
    $list .= '<div class="form-group">';
    if ($mail_send_message != '') {
        $list .= "<span style = 'color:red;'>" . $mail_send_message . "</span>";
    }
    $list .= '<input class="form-control" type="text" PLACEHOLDER="' . getTranslatedString('LBL_YOUR_EMAIL') . '" name="email_id" VALUE=""/></div>';
    $list .= '</div>';
    $list .= '<div class="footer"><button class="btn bg-light-blue btn-block" type="submit" value="" style="font-size:16px;font=weight:500;">' . getTranslatedString('LBL_SEND_PASSWORD') . '</button><br/><a href = "login.php">' . getTranslatedString('LBL_BACK_TO_LOGIN') . '</a>';
    $list .= '</div></form></div></body></html>';
    return $list;
}
 /**
  * Process the request for Folder opertions
  * @global <type> $list_max_entries_per_page
  * @param MailManager_Request $request
  * @return MailManager_Response
  */
 function process(MailManager_Request $request)
 {
     global $list_max_entries_per_page, $current_user;
     $response = new Vtiger_Response();
     if ('open' == $request->getOperationArg()) {
         $q = $request->get('q');
         $foldername = $request->get('_folder');
         $type = $request->get('type');
         $connector = $this->getConnector($foldername);
         $folder = $connector->folderInstance($foldername);
         if (empty($q)) {
             $connector->folderMails($folder, intval($request->get('_page', 0)), $list_max_entries_per_page);
         } else {
             if (empty($type)) {
                 $type = 'ALL';
             }
             if ($type == 'ON') {
                 $dateFormat = $current_user->date_format;
                 if ($dateFormat == 'mm-dd-yyyy') {
                     $dateArray = explode('-', $q);
                     $temp = $dateArray[0];
                     $dateArray[0] = $dateArray[1];
                     $dateArray[1] = $temp;
                     $q = implode('-', $dateArray);
                 }
                 $query = date('d M Y', strtotime($q));
                 $q = '' . $type . ' "' . vtlib_purify($query) . '"';
             } else {
                 $q = '' . $type . ' "' . vtlib_purify($q) . '"';
             }
             $connector->searchMails($q, $folder, intval($request->get('_page', 0)), $list_max_entries_per_page);
         }
         $folderList = $connector->getFolderList();
         $viewer = $this->getViewer();
         $viewer->assign('TYPE', $type);
         $viewer->assign('QUERY', $request->get('q'));
         $viewer->assign('FOLDER', $folder);
         $viewer->assign('FOLDERLIST', $folderList);
         $viewer->assign('SEARCHOPTIONS', self::getSearchOptions());
         $viewer->assign("JS_DATEFORMAT", parse_calendardate(getTranslatedString('NTC_DATE_FORMAT')));
         $response->setResult($viewer->fetch($this->getModuleTpl('FolderOpen.tpl')));
     } elseif ('drafts' == $request->getOperationArg()) {
         $q = $request->get('q');
         $type = $request->get('type');
         $page = intval($request->get('_page', 0));
         $connector = $this->getConnector('__vt_drafts');
         $folder = $connector->folderInstance();
         if (empty($q)) {
             $draftMails = $connector->getDrafts($page, $list_max_entries_per_page, $folder);
         } else {
             $draftMails = $connector->searchDraftMails($q, $type, $page, $list_max_entries_per_page, $folder);
         }
         $viewer = $this->getViewer();
         $viewer->assign('MAILS', $draftMails);
         $viewer->assign('FOLDER', $folder);
         $viewer->assign('SEARCHOPTIONS', MailManager_DraftController::getSearchOptions());
         $response->setResult($viewer->fetch($this->getModuleTpl('FolderDrafts.tpl')));
     }
     return $response;
 }
Beispiel #5
0
 /**
  * Overrided to remove Edit button, Duplicate button
  * To remove related links
  */
 public function getDetailViewLinks($linkParams)
 {
     $linkTypes = array('DETAILVIEWBASIC', 'DETAILVIEW');
     $moduleModel = $this->getModule();
     $recordModel = $this->getRecord();
     $moduleName = $moduleModel->getName();
     $recordId = $recordModel->getId();
     $detailViewLink = array();
     $linkModelListDetails = Vtiger_Link_Model::getAllByType($moduleModel->getId(), $linkTypes, $linkParams);
     //Mark all detail view basic links as detail view links.
     //Since ui will be look ugly if you need many basic links
     $detailViewBasiclinks = $linkModelListDetails['DETAILVIEWBASIC'];
     unset($linkModelListDetails['DETAILVIEWBASIC']);
     if (Users_Privileges_Model::isPermitted($moduleName, 'Delete', $recordId)) {
         $deletelinkModel = array('linktype' => 'DETAILVIEW', 'linklabel' => sprintf("%s %s", getTranslatedString('LBL_DELETE', $moduleName), vtranslate('SINGLE_' . $moduleName, $moduleName)), 'linkurl' => 'javascript:Vtiger_Detail_Js.deleteRecord("' . $recordModel->getDeleteUrl() . '")', 'linkicon' => '');
         $linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($deletelinkModel);
     }
     if (!empty($detailViewBasiclinks)) {
         foreach ($detailViewBasiclinks as $linkModel) {
             // Remove view history, needed in vtiger5 to see history but not in vtiger6
             if ($linkModel->linklabel == 'View History') {
                 continue;
             }
             $linkModelList['DETAILVIEW'][] = $linkModel;
         }
     }
     $widgets = $this->getWidgets();
     foreach ($widgets as $widgetLinkModel) {
         $linkModelList['DETAILVIEWWIDGET'][] = $widgetLinkModel;
     }
     return $linkModelList;
 }
Beispiel #6
0
 function getDisplayName()
 {
     if ($this->_fieldLabel === false) {
         $this->_fieldLabel = $this->fieldInstance->getFieldLabel();
     }
     return getTranslatedString($this->_fieldLabel, $this->parent->module);
 }
Beispiel #7
0
 public static function getTypes($moduleName = '')
 {
     ${"GLOBALS"}["rsyforj"] = "items";
     $yhghycrv = "item";
     ${"GLOBALS"}["jjpaouxrl"] = "items";
     ${${"GLOBALS"}["rsyforj"]} = self::getItems();
     ${"GLOBALS"}["mlipujvkt"] = "return";
     ${${"GLOBALS"}["qpuxdgoupyck"]} = array();
     foreach (${${"GLOBALS"}["jjpaouxrl"]} as ${$yhghycrv}) {
         $cjmtnrv = "moduleName";
         $ofeidrpfdz = "configs";
         ${"GLOBALS"}["cnnjcfbylpp"] = "configs";
         ${${"GLOBALS"}["cnnjcfbylpp"]} = $item->getFieldTypes(${$cjmtnrv});
         ${"GLOBALS"}["rmvovczyrx"] = "field";
         foreach (${$ofeidrpfdz} as ${${"GLOBALS"}["rmvovczyrx"]}) {
             ${"GLOBALS"}["dueprqjk"] = "ItemCache";
             $tkjitre = "field";
             ${${"GLOBALS"}["qrbgenphlby"]}["file"] = $item->getExtendableKey();
             ${"GLOBALS"}["xkxphut"] = "field";
             $gbyjpxfwu = "field";
             ${$gbyjpxfwu}["title"] = getTranslatedString(${${"GLOBALS"}["xkxphut"]}["title"], "Settings:Workflow2");
             ${"GLOBALS"}["nfnyiwbb"] = "field";
             self::${${"GLOBALS"}["dueprqjk"]}[${${"GLOBALS"}["qrbgenphlby"]}["id"]] = ${$tkjitre};
             ${${"GLOBALS"}["qpuxdgoupyck"]}[] = ${${"GLOBALS"}["nfnyiwbb"]};
         }
     }
     return ${${"GLOBALS"}["mlipujvkt"]};
 }
Beispiel #8
0
 public static function assignMessages($crmid, $viewer)
 {
     $chwmfkvuq = "current_user";
     $dpddjpchus = "row";
     ${"GLOBALS"}["pvcpgoobkx"] = "sql";
     ${"GLOBALS"}["dbjyloqr"] = "cu_model";
     ${$chwmfkvuq} = ${${"GLOBALS"}["dbjyloqr"]} = \Users_Record_Model::getCurrentUserModel();
     ${${"GLOBALS"}["gmbukkbbs"]} = \PearDatabase::getInstance();
     $twasrbuxi = "result";
     ${${"GLOBALS"}["uxfpyp"]} = "SELECT * FROM vtiger_wf_messages WHERE\n        (\n                (crmid = " . ${${"GLOBALS"}["podklxc"]} . " AND target = \"record\") OR\n                (crmid = " . $current_user->id . " AND target = \"user\")\n            )\n        AND (show_until =  \"0000-00-00 00:00:00\" OR show_until >= NOW())";
     ${${"GLOBALS"}["ciokylfx"]} = $adb->query(${${"GLOBALS"}["pvcpgoobkx"]});
     ${"GLOBALS"}["esusgmf"] = "sql";
     ${${"GLOBALS"}["hbelbc"]} = array();
     while (${$dpddjpchus} = $adb->fetchByAssoc(${$twasrbuxi})) {
         $wyoevilr = "row";
         ${"GLOBALS"}["wtiuxgl"] = "messages";
         ${"GLOBALS"}["txeedjxevu"] = "row";
         if (${$wyoevilr}["show_until"] != "0000-00-00 00:00:00") {
             $ticepvccqsn = "row";
             ${"GLOBALS"}["kemkeniiqmz"] = "row";
             ${${"GLOBALS"}["kemkeniiqmz"]}["show_until"] = getTranslatedString("LBL_VISIBLE_UNTIL", "Workflow2") . ": " . \DateTimeField::convertToUserFormat(${$ticepvccqsn}["show_until"]);
         } else {
             ${${"GLOBALS"}["wiurqquqjut"]}["show_until"] = "";
         }
         ${${"GLOBALS"}["wtiuxgl"]}[] = ${${"GLOBALS"}["txeedjxevu"]};
     }
     $viewer->assign("messages", ${${"GLOBALS"}["hbelbc"]});
     ${${"GLOBALS"}["esusgmf"]} = "DELETE FROM vtiger_wf_messages WHERE\n            (\n                (crmid = " . intval($_REQUEST["record"]) . " AND target = 'record') OR\n                (crmid = " . intval($current_user->id) . " AND target = 'user')\n            ) AND\n            (show_once = '1' OR (show_until != '0000-00-00 00:00:00' AND show_until < NOW()))";
     $adb->query(${${"GLOBALS"}["uxfpyp"]});
 }
 function pageInfo()
 {
     $s = max(1, $this->mPageCurrent * $this->mPageLimit + 1);
     $e = min($s + $this->mPageLimit - 1, $this->mCount);
     $t = $this->mCount;
     return sprintf("%s - %s " . getTranslatedString('LBL_LIST_OF') . " %s", $s, $e, $t);
 }
 public function process(Vtiger_Request $request)
 {
     $error_code = '';
     $error_message = '';
     $success = true;
     if (!$request->get('mod') && !$request->get('path')) {
         $error_code = 'error-param';
         $error_message = getTranslatedString("LBL_ERROR_PARAM", $moduleName);
         $success = false;
     }
     //Get module's structure from manifest file
     if ($request->get("mod")) {
         $o_module = $this->getStructureFromExistantModule($request->get("mod"));
     } elseif ($request->get("path")) {
         $o_module = $this->getStructureFromZipPackage($request->get("path"));
     }
     //Make JSON response
     $response = new Vtiger_Response();
     if (!$success) {
         $response->setError($error_code, $error_message);
     } else {
         $response->setResult(array('module' => $o_module, 'basedir' => $this->moduleBaseDir));
     }
     $response->emit();
 }
Beispiel #11
0
 public function process(Vtiger_Request $request)
 {
     ${"GLOBALS"}["psbjpvo"] = "result";
     ${"GLOBALS"}["uswgngzmuwcw"] = "row";
     ${"GLOBALS"}["nzxhurjvkxw"] = "adb";
     ${${"GLOBALS"}["nzxhurjvkxw"]} = PearDatabase::getInstance();
     ${${"GLOBALS"}["yoromzzx"]} = (int) $request->get("objectID");
     echo "    <div class=\"modelContainer\" style=\"width:550px;\">\n        <form method=\"POST\" id=\"WorkflowImportForm\" action=\"index.php?module=Workflow2&parent=Settings&action=WorkflowImport\" enctype=\"multipart/form-data\">\n    <div class=\"modal-header contentsBackground\">\n    \t<button class=\"close\" aria-hidden=\"true\" data-dismiss=\"modal\" type=\"button\" title=\"{vtranslate('LBL_CLOSE')}\">x</button>\n        <h3>Workflow Import</h3>\n    </div>\n            <input type=\"hidden\" name=\"workflowObjectId\"id=\"workflowObjectId\" value=\"";
     ${"GLOBALS"}["fxqlcmyx"] = "sql";
     echo ${${"GLOBALS"}["yoromzzx"]};
     $icmyyhunnhjw = "sql";
     echo "\" />\n        <div style=\"padding: 10px;\">\n\n            ";
     echo "<select id='recordSelector'>";
     ${${"GLOBALS"}["fxqlcmyx"]} = "SELECT user_name, id, first_name, last_name FROM vtiger_users WHERE deleted = 0 AND status = 'Active'";
     ${${"GLOBALS"}["iesrbgkyl"]} = $adb->query(${$icmyyhunnhjw}, ${${"GLOBALS"}["emsdxnpocl"]});
     ${${"GLOBALS"}["qrzksvmls"]} = array();
     while (${${"GLOBALS"}["uswgngzmuwcw"]} = $adb->fetch_array(${${"GLOBALS"}["psbjpvo"]})) {
         $ggrdmeqlbp = "row";
         $mkyvkf = "row";
         echo "<option value='" . ${${"GLOBALS"}["spxwbund"]}["id"] . "'>" . ${${"GLOBALS"}["spxwbund"]}["user_name"] . " [" . ${$ggrdmeqlbp}["last_name"] . ", " . ${$mkyvkf}["first_name"] . "]</option>";
     }
     echo "</select>";
     echo "        </div>\n        <div class=\"modal-footer quickCreateActions\">\n                <a class=\"cancelLink cancelLinkContainer pull-right\" type=\"reset\" data-dismiss=\"modal\">";
     echo getTranslatedString("LBL_CLOSE", "Settings:Workflow2");
     echo "</a>\n            <button class=\"btn btn-success\" type=\"submit\" id=\"modalSubmitButton\" ><strong>Set</strong></button>\n       \t</div>\n        </form>\n    </div>\n    ";
     exit;
 }
Beispiel #12
0
 public function process(Vtiger_Request $request)
 {
     $viewer = $this->getViewer($request);
     $moduleName = $request->getModule();
     $qualifiedModuleName = $request->getModule(false);
     if (!$request->get("label") && !$request->get("block") || !$request->get("languages")) {
         //Make JSON response
         $response = new Vtiger_Response();
         $response->setError('error-param', getTranslatedString("LBL_ERROR_PARAM", $moduleName));
         $response->emit();
         exit;
     }
     $languages = trim($request->get("languages"));
     $a_languages = explode(",", $languages);
     $a_block = $request->get("block");
     //Repair bug with utf8 characters
     if (!is_array($a_block)) {
         $oldValue = Zend_Json::$useBuiltinEncoderDecoder;
         Zend_Json::$useBuiltinEncoderDecoder = true;
         $a_block = Zend_Json::decode($a_block);
         Zend_Json::$useBuiltinEncoderDecoder = $oldValue;
         foreach ($a_block as &$val) {
             $val = utf8_encode($val);
         }
     }
     $viewer->assign('MODULE', $moduleName);
     $viewer->assign('QUALIFIED_MODULE', $qualifiedModuleName);
     $viewer->assign('LIST_PARENT_TABS', $a_parent_tabs);
     $viewer->assign('LIST_MODULES', $a_modules);
     $viewer->assign('LIST_MANIFEST_TEMPLATES', $a_manifest_templates);
     $viewer->assign('LIST_DIR_TEMPLATES', $a_dir_templates);
     $viewer->assign('a_block', $a_block);
     $viewer->assign('a_languages', $a_languages);
     echo $viewer->view('EditBlockPopup.tpl', $qualifiedModuleName, true);
 }
Beispiel #13
0
/** Function to  returns the combo field values in array format
 * @param $combofieldNames -- combofieldNames:: Type string array
 * @returns $comboFieldArray -- comboFieldArray:: Type string array
 */
function getComboArray($combofieldNames)
{
    global $log, $mod_strings;
    $log->debug("Entering getComboArray(" . $combofieldNames . ") method ...");
    global $adb, $current_user;
    $roleid = $current_user->roleid;
    $comboFieldArray = array();
    foreach ($combofieldNames as $tableName => $arrayName) {
        $fldArrName = $arrayName;
        $arrayName = array();
        $sql = "select {$tableName} from vtiger_{$tableName}";
        $params = array();
        if (!is_admin($current_user)) {
            $subrole = getRoleSubordinates($roleid);
            if (count($subrole) > 0) {
                $roleids = $subrole;
                array_push($roleids, $roleid);
            } else {
                $roleids = $roleid;
            }
            $sql = "select distinct {$tableName} from vtiger_{$tableName}  inner join vtiger_role2picklist on vtiger_role2picklist.picklistvalueid = vtiger_{$tableName}.picklist_valueid where roleid in(" . generateQuestionMarks($roleids) . ") order by sortid";
            $params = array($roleids);
        }
        $result = $adb->pquery($sql, $params);
        while ($row = $adb->fetch_array($result)) {
            $val = $row[$tableName];
            $arrayName[$val] = getTranslatedString($val);
        }
        $comboFieldArray[$fldArrName] = $arrayName;
    }
    $log->debug("Exiting getComboArray method ...");
    return $comboFieldArray;
}
 /**
   * Function to get the Login History values of the User.
   * @param $navigation_array - Array values to navigate through the number of entries.
   * @param $sortorder - DESC
   * @param $orderby - login_time
   * Returns the login history entries in an array format.
 **/
 function getHistoryListViewEntries($username, $navigation_array, $sorder = '', $orderby = '')
 {
     global $log, $adb, $current_user;
     $log->debug("Entering getHistoryListViewEntries() method ...");
     if ($sorder != '' && $order_by != '') {
         $list_query = "Select * from vtiger_loginhistory where user_name=? order by " . $order_by . " " . $sorder;
     } else {
         $list_query = "Select * from vtiger_loginhistory where user_name=? order by " . $this->default_order_by . " " . $this->default_sort_order;
     }
     $result = $adb->pquery($list_query, array($username));
     $entries_list = array();
     if ($navigation_array['end_val'] != 0) {
         $in = getTranslatedString('Signed in');
         $out = getTranslatedString('Signed off');
         for ($i = $navigation_array['start']; $i <= $navigation_array['end_val']; $i++) {
             $entries = array();
             $loginid = $adb->query_result($result, $i - 1, 'login_id');
             $entries[] = $adb->query_result($result, $i - 1, 'user_name');
             $entries[] = $adb->query_result($result, $i - 1, 'user_ip');
             $entries[] = $adb->query_result($result, $i - 1, 'login_time');
             $entries[] = $adb->query_result($result, $i - 1, 'logout_time');
             $entries[] = $adb->query_result($result, $i - 1, 'status') == 'Signed in' ? $in : $out;
             $entries_list[] = $entries;
         }
         $log->debug("Exiting getHistoryListViewEntries() method ...");
         return $entries_list;
     }
 }
function ShowModuleIdField($selected_module, $tab_only = false)
{
    $db = PearDatabase::getInstance();
    $names = array('Emails', 'PBXManager', 'ModComments', 'SMSNotifier', 'OSSPdf');
    foreach ($names as $id) {
        $in .= "'" . $id . "',";
    }
    $in = trim($in, ',');
    $query = "select tabid, name, customized from vtiger_tab where isentitytype = '1' and presence <> '2' and name not in ( {$in} )";
    $wynik = $db->query($query, true);
    $tablist = array();
    for ($i = 0; $i < $db->num_rows($wynik); $i++) {
        $tablist[$i]['id'] = $db->query_result($wynik, $i, "tabid");
        $label = $db->query_result($wynik, $i, "name");
        if ($db->query_result($wynik, $i, "customized") == 0) {
            $tablist[$i]['label'] = getTranslatedString($label);
        } else {
            $tablist[$i]['label'] = getTranslatedString($label, $label);
        }
    }
    if ($selected_module == '') {
        $SMODULE = $tablist[0]['id'];
    } else {
        $SMODULE = $selected_module;
    }
    if ($tab_only == false) {
        $viewer = new Vtiger_Viewer();
        $viewer->assign("TABLIST", $tablist);
        $viewer->assign("SMODULE", $SMODULE);
        $viewer->assign("SELECTED_MODULE", $selected_module);
        return $viewer->fetch('modules/OSSPdf/FieldModuleid.tpl');
    } else {
        return $tablist;
    }
}
 public static function getAvailableProviders($moduleName = '')
 {
     ${"GLOBALS"}["fszplger"] = "return";
     $mtmlptd = "items";
     ${${"GLOBALS"}["xrbpdln"]} = self::getItems();
     $vhjblzajvdb = "item";
     ${${"GLOBALS"}["fszplger"]} = array();
     foreach (${$mtmlptd} as ${$vhjblzajvdb}) {
         ${"GLOBALS"}["qjsgods"] = "moduleName";
         $ttcmqlpkvr = "configs";
         ${"GLOBALS"}["uqexxsohux"] = "configs";
         ${$ttcmqlpkvr} = $item->getFieldTypes(${${"GLOBALS"}["qjsgods"]});
         foreach (${${"GLOBALS"}["uqexxsohux"]} as ${${"GLOBALS"}["ogluyjq"]}) {
             ${"GLOBALS"}["lxboqgupnt"] = "field";
             ${"GLOBALS"}["rrvrfmhtxpr"] = "ItemCache";
             ${${"GLOBALS"}["lxboqgupnt"]}["file"] = $item->getExtendableKey();
             ${"GLOBALS"}["gdnoehttu"] = "field";
             $ybobgedjafue = "field";
             ${${"GLOBALS"}["ogluyjq"]}["title"] = getTranslatedString(${${"GLOBALS"}["ogluyjq"]}["title"], "Settings:Workflow2");
             self::${${"GLOBALS"}["rrvrfmhtxpr"]}[${${"GLOBALS"}["ogluyjq"]}["id"]] = ${$ybobgedjafue};
             ${${"GLOBALS"}["osiilynbg"]}[] = ${${"GLOBALS"}["gdnoehttu"]};
         }
     }
     return ${${"GLOBALS"}["osiilynbg"]};
 }
Beispiel #17
0
 /**
   * Function to get the Audit Trail Information values of the actions performed by a particular User.
   * @param integer $userid - User's ID
   * @param $navigation_array - Array values to navigate through the number of entries.
   * @param $sortorder - DESC
   * @param $orderby - actiondate
   * Returns the audit trail entries in an array format.
 **/
 function getAuditTrailEntries($userid, $navigation_array, $sorder = '', $orderby = '')
 {
     global $log;
     $log->debug("Entering getAuditTrailEntries(" . $userid . ") method ...");
     global $adb, $current_user;
     if ($sorder != '' && $order_by != '') {
         $list_query = "Select * from vtiger_audit_trial where userid =? order by " . $order_by . " " . $sorder;
     } else {
         $list_query = "Select * from vtiger_audit_trial where userid =? order by " . $this->default_order_by . " " . $this->default_sort_order;
     }
     $result = $adb->pquery($list_query, array($userid));
     $entries_list = array();
     if ($navigation_array['end_val'] != 0) {
         for ($i = $navigation_array['start']; $i <= $navigation_array['end_val']; $i++) {
             $entries = array();
             $userid = $adb->query_result($result, $i - 1, 'userid');
             $entries[] = getTranslatedString($adb->query_result($result, $i - 1, 'module'));
             $entries[] = $adb->query_result($result, $i - 1, 'action');
             $entries[] = $adb->query_result($result, $i - 1, 'recordid');
             $entries[] = getDisplayDate($adb->query_result($result, $i - 1, 'actiondate'));
             $entries_list[] = $entries;
         }
         $log->debug("Exiting getAuditTrailEntries() method ...");
         return $entries_list;
     }
 }
Beispiel #18
0
 public function process(Vtiger_Request $request)
 {
     $error_code = '';
     $error_message = '';
     $success = true;
     $uploaded_file = null;
     if (isset($_FILES["myfile"])) {
         //Filter the file types , if you want.
         if ($_FILES["myfile"]["error"] > 0) {
             $success = false;
             $error_code = "upload-error";
             $error_message = $_FILES["file"]["error"];
         } else {
             //move the uploaded file to uploads folder;
             move_uploaded_file($_FILES["myfile"]["tmp_name"], DIR_TEMP . $_FILES["myfile"]["name"]);
             $uploaded_file = DIR_TEMP . $_FILES["myfile"]["name"];
         }
     } else {
         $success = false;
         $error_code = "file-empty";
         $error_message = getTranslatedString("LBL_UPLOADED_FILE_NOT_DEFINED");
     }
     //Make JSON response
     $response = new Vtiger_Response();
     if (!$success) {
         $response->setError($error_code, $error_message);
     } else {
         $response->setResult(array('file' => $uploaded_file));
     }
     $response->emit();
 }
 function buildFooterModel()
 {
     $footerModel = new Vtiger_PDF_Model();
     $termsconditionLabel = getTranslatedString('Description', $this->moduleName);
     $footerModel->set('title', $termsconditionLabel);
     $footerModel->set('content', from_html($this->focusColumnValue("description")));
     return $footerModel;
 }
Beispiel #20
0
 public function __construct($data, $fields = array())
 {
     global $current_language;
     parent::__construct($data, $fields, substr($current_language, 0, 2), 'include/validation/lang');
     foreach ($this->CustomValidations as $validation => $function) {
         $this->addRule($validation, $function, getTranslatedString('INVALID'));
     }
 }
Beispiel #21
0
/**
 * this function returns the picklists available for a module
 * @param array $picklist_details - the details about the picklists in the module
 * @return array $module_pick - the picklists present in the module in an array format
 */
function get_available_module_picklist($picklist_details)
{
    $avail_pick_values = $picklist_details;
    foreach ($avail_pick_values as $key => $val) {
        $module_pick[$avail_pick_values[$key]['fieldname']] = getTranslatedString($avail_pick_values[$key]['fieldlabel']);
    }
    return $module_pick;
}
    public function handleEvent($handlerType, $entityData)
    {
        switch ($handlerType) {
            case 'vtiger.dispatch.before':
                return;
                require_once 'modules/SwVtTools/filecache.php';
                $cacheFile = vglobal('root_directory') . '/modules/SwVtTools/cache/Module.php';
                if (!file_exists($cacheFile) || $_REQUEST['clearcache'] == '1') {
                    swtools_filecache(glob(vglobal('root_directory') . '/modules/*/models/Module.php'), $cacheFile);
                }
                require_once $cacheFile;
                break;
            case 'vtiger.process.customview.editajax.view.finish':
                if (empty(self::$DATA['recordId'])) {
                    return;
                }
                $content = ob_get_contents();
                ob_end_clean();
                $customViewModel = CustomView_Record_Model::getInstanceById(self::$DATA['recordId']);
                $blocks = \SwVtTools\VtUtils::getFieldsWithBlocksForModule(self::$DATA['moduleName']);
                $html = '<h4 class="filterHeaders">Filter Sort Order:</h4><br/>';
                $html .= '<div class="contentsBackground well">';
                $html .= '
                <table cellpadding="4" cellspacing="0" width="100%" border="0">
                  <tbody><tr>
                      <td class="dvtCellInfo" width="5%" align="right">Column:
                      </td>
                      <td class="dvtCellInfo" width="20%">

                      <select name="order_col" id="order_col"  class="chzn-select">
                          <option value="">' . getTranslatedString('LBL_NONE') . '</option>';
                foreach ($blocks as $blockLabel => $fields) {
                    $html .= '<optgroup label="' . $blockLabel . '">';
                    foreach ($fields as $field) {
                        $html .= '<option ' . ($customViewModel->get('order_col') == $field->name ? 'selected="selected"' : '') . ' value="' . $field->name . '">' . $field->label . '</option>';
                    }
                    $html .= '</optgroup>';
                }
                $html .= '</select>
                    </td>
                                  <td class="dvtCellInfo" width="20%">
                                      <select name="order_dir" id="order_dir" class="small">
                                          <option value="ASC" ' . ($customViewModel->get('order_dir') == 'ASC' ? 'selected="selected"' : '') . '>&uarr; ASC Ascending</option>
                                          <option value="DESC" ' . ($customViewModel->get('order_dir') == 'DESC' ? 'selected="selected"' : '') . '>&darr; DESC Descending</option>
                                      </select>
                                  </td>
                                  <td class="dvtCellInfo" width="10%" align="right">numerische Sortierung:
                                  </td>
                                  <td class="dvtCellInfo" width="15%">
                                      <input type="checkbox" name="order_numeric_check" value="1" ' . ($customViewModel->get('order_numeric_check') > 0 ? 'checked="checked"' : '') . '>
                                      Skip Chars: <input type="text" alt="ignore the first X chars to get a numberic value" title="ignore the first X chars to get a numberic value" style="width:20px;" name="order_numeric" value="' . $customViewModel->get('order_numeric') . '">
                                  </td></tr></table>';
                $html .= '</div>';
                $content = str_replace('<div class="filterActions">', $html . '<div class="filterActions">', $content);
                echo $content;
                break;
        }
    }
 function buildHeaderModelColumnRight()
 {
     $issueDateLabel = getTranslatedString('Issued Date', $this->moduleName);
     $validDateLabel = getTranslatedString('Due Date', $this->moduleName);
     $billingAddressLabel = getTranslatedString('Billing Address', $this->moduleName);
     $shippingAddressLabel = getTranslatedString('Shipping Address', $this->moduleName);
     $modelColumn2 = array('dates' => array($issueDateLabel => $this->formatDate(date("Y-m-d")), $validDateLabel => $this->formatDate($this->focusColumnValue('duedate'))), $billingAddressLabel => $this->buildHeaderBillingAddress(), $shippingAddressLabel => $this->buildHeaderShippingAddress());
     return $modelColumn2;
 }
 public function addFile($filePath, $parentDirectory)
 {
     if (empty($parentDirectory)) {
         $this->addTrailingSlash($parentDirectory);
     }
     $sucess = $this->zip->addFromString($parentDirectory . 'database.sql', file_get_contents($filePath));
     if ($sucess == false) {
         throw new VtigerBackupException(VtigerBackupErrorCode::$ZIP_CREATE_FAILED, getTranslatedString('LBL_ZIP_FILE_ADD_FAILURE', 'VtigerBackup'));
     }
 }
Beispiel #25
0
function getStdContactFlds(&$queryFields, $adb, $valueArray)
{
    global $current_language, $mod_strings;
    require_once 'modules/Contacts/language/' . $current_language . '.lang.php';
    $query = "SELECT fieldid, columnname, fieldlabel FROM vtiger_field WHERE tablename='vtiger_contactdetails' AND uitype='56' and vtiger_field.presence in (0,2)";
    $result = $adb->query($query, true, "Error: " . "<BR>{$query}");
    for ($tmp = 0; $tmp < $adb->num_rows($result); $tmp++) {
        $myData = $adb->fetchByAssoc($result);
        $queryFields[] = array('columnname' => $myData['columnname'], 'uitype' => '56', 'fieldlabel' => getTranslatedString($myData['fieldlabel'], 'Contacts'), 'value' => $valueArray);
    }
}
 public function process(Vtiger_Request $request)
 {
     $vjkrouwxqxg = "adb";
     $gcdjhqf = "qualifiedModuleName";
     global $current_user, $vtiger_current_version;
     ${$vjkrouwxqxg} = \PearDatabase::getInstance();
     ${${"GLOBALS"}["akkaaxj"]} = $request->getModule();
     $ouunxgnsld = "request";
     $ajphdwe = "frontendConfig";
     ${"GLOBALS"}["puwhbwyb"] = "viewer";
     ${"GLOBALS"}["siofbb"] = "result";
     ${$gcdjhqf} = $request->getModule(false);
     $ewjidydor = "result";
     ${"GLOBALS"}["htwyidb"] = "sql";
     ${${"GLOBALS"}["puwhbwyb"]} = $this->getViewer(${$ouunxgnsld});
     $qkosdv = "workflows";
     ${${"GLOBALS"}["udsqyib"]} = "SELECT * FROM vtiger_wf_settings WHERE module_name != '' ORDER BY module_name, active DESC, title";
     ${$ewjidydor} = $adb->query(${${"GLOBALS"}["udsqyib"]});
     ${${"GLOBALS"}["dqeacf"]} = array();
     ${"GLOBALS"}["uefqvuszrov"] = "result";
     ${"GLOBALS"}["gwxxtnn"] = "lastModule";
     $beldzffo = "sql";
     ${${"GLOBALS"}["gwxxtnn"]} = "";
     ${${"GLOBALS"}["vvtgrwtbcfo"]} = false;
     while (${${"GLOBALS"}["gssyjqumq"]} = $adb->fetch_array(${${"GLOBALS"}["uefqvuszrov"]})) {
         $cjtnhyvnkf = "row";
         $jajxmkpor = "row";
         ${${"GLOBALS"}["akkaaxj"]} = getTranslatedString(${$jajxmkpor}["module_name"], ${$cjtnhyvnkf}["module_name"]);
         ${${"GLOBALS"}["dqeacf"]}[${${"GLOBALS"}["akkaaxj"]}][] = ${${"GLOBALS"}["gssyjqumq"]};
     }
     $viewer->assign("workflows", ${$qkosdv});
     ${${"GLOBALS"}["udsqyib"]} = "SELECT\n                    vtiger_wf_frontendmanager.*,\n                    vtiger_wf_settings.title,\n                    vtiger_wf_settings.module_name\n                FROM vtiger_wf_frontendmanager\n                    INNER JOIN vtiger_wf_settings ON (vtiger_wf_settings.id = vtiger_wf_frontendmanager.workflow_id) ORDER BY vtiger_wf_settings.module_name, `order`\n        ";
     ${"GLOBALS"}["nurkhxfjw"] = "row";
     ${${"GLOBALS"}["lmrlntqdxii"]} = $adb->query(${${"GLOBALS"}["htwyidb"]});
     ${${"GLOBALS"}["fpwwfluqpb"]} = array();
     ${"GLOBALS"}["ckwdlbpcyum"] = "row";
     ${"GLOBALS"}["xnurlbcjd"] = "sql";
     while (${${"GLOBALS"}["nurkhxfjw"]} = $adb->fetchByAssoc(${${"GLOBALS"}["siofbb"]})) {
         ${"GLOBALS"}["dtxrkza"] = "links";
         ${"GLOBALS"}["uofvjudvq"] = "row";
         ${${"GLOBALS"}["dtxrkza"]}[getTranslatedString(${${"GLOBALS"}["uofvjudvq"]}["module_name"], ${${"GLOBALS"}["gssyjqumq"]}["module_name"])][] = ${${"GLOBALS"}["gssyjqumq"]};
     }
     ${"GLOBALS"}["civzlardf"] = "result";
     $viewer->assign("links", ${${"GLOBALS"}["fpwwfluqpb"]});
     ${${"GLOBALS"}["xnurlbcjd"]} = "SELECT * FROM vtiger_wf_frontend_config";
     ${${"GLOBALS"}["lmrlntqdxii"]} = $adb->query(${$beldzffo});
     ${$ajphdwe} = array();
     while (${${"GLOBALS"}["ckwdlbpcyum"]} = $adb->fetchByAssoc(${${"GLOBALS"}["civzlardf"]})) {
         ${"GLOBALS"}["vlxikvpmo"] = "frontendConfig";
         ${${"GLOBALS"}["vlxikvpmo"]}[${${"GLOBALS"}["gssyjqumq"]}["module"]] = ${${"GLOBALS"}["gssyjqumq"]};
     }
     $viewer->assign("frontendConfig", ${${"GLOBALS"}["zwejlthnu"]});
     $viewer->view("FrontendManager.tpl", ${${"GLOBALS"}["ikeinoxbrc"]});
 }
 public function getFieldTypes($moduleName)
 {
     $fields = array();
     $modules = \Workflow\VtUtils::getEntityModules();
     $relmodules = array('' => getTranslatedString('module of records', 'Workflow2'));
     foreach ($modules as $mod) {
         $relmodules[$mod[0]] = vtranslate($mod[1], $mod[0]);
     }
     $fields[] = array('id' => 'records', 'title' => 'select Record', 'config' => array('module' => array('type' => 'picklist', 'label' => 'Records from module', 'options' => $relmodules, 'nomodify' => true), 'condition' => array('type' => 'condition', 'moduleField' => 'module', 'label' => 'Search possible Records')));
     return $fields;
 }
 public function getConfigurations($moduleName)
 {
     $configuration = array('html' => '<a href="#" class="attachmentsConfigLink" onclick="attachCRMDocument();">Select Documents to attach</a>', 'script' => "\nfunction attachCRMDocument() {\n    var popupInstance = Vtiger_Popup_Js.getInstance();\n    popupInstance.show('module=Documents&view=Popup&src_module=Emails&src_field=testfield&multi_select=1', function(value) {\n        var file = jQuery.parseJSON(value);\n\n        jQuery.each(file, function(index, value) {\n            addDocumentAttachment(index, value.name, false);\n        });\n    });\n}\nfunction addDocumentAttachment(entityid, title, filename) {\n    if(typeof filename == 'undefined') {\n        filename = false;\n    }\n\n    Attachments.addAttachment('s#documents#' + entityid, title, filename);\n}\n        ");
     $return = array($configuration);
     if ($moduleName === 'Documents') {
         $return[] = array('html' => '<a href="#"  class="attachmentsConfigLink" onclick="addDocumentAttachment(\'current_document\', \'Current document\');return false;">Attach this document</a><br>');
     }
     $return[] = array('html' => '<a href="#" class="attachmentsConfigLink" data-type="documents">Attach every Document related to record</a>
         <div class="attachmentsConfig" data-type="documents" style="display: none;"><div class="insertTextfield" style="display:inline;" data-name="attachEveryChildValue" data-style="width:250px;" data-id="attachEveryChildValue">$crmid</div></div>', 'script' => "\nAttachments.registerCallback('documents', function() {\n    var value = jQuery('#attachEveryChildValue').val();\n\n    return [\n        {\n            'id'        : 's#documents#all_childs#' + value,\n            'label'     : '" . getTranslatedString('all Childdocuments', 'Settings:Workflow2') . "',\n            'filename'  : '',\n            'options'   : {\n                'val'    : value\n            }\n        }\n    ];\n});\n            ");
     return $return;
 }
Beispiel #29
0
 public function getConfigurations($moduleName)
 {
     $configuration = array('html' => '<a href="#" onclick="attachCRMDocument(); ">Select Documents to attach</a>', 'script' => "\nfunction attachCRMDocument() {\n    var popupInstance = Vtiger_Popup_Js.getInstance();\n    popupInstance.show('module=Documents&view=Popup&src_module=Emails&src_field=testfield&multi_select=1', function(value) {\n        var file = jQuery.parseJSON(value);\n\n        jQuery.each(file, function(index, value) {\n            addDocumentAttachment(index, value.name, false);\n        });\n    });\n}\nfunction addDocumentAttachment(entityid, title, filename) {\n    if(typeof filename == 'undefined') {\n        filename = false;\n    }\n\n    Attachments.addAttachment('s#documents#' + entityid, title, filename);\n}\n        ");
     $return = array($configuration);
     if ($moduleName === 'Documents') {
         $return[] = array('html' => '<a href="#" onclick="addDocumentAttachment(\'current_document\', \'Current document\');return false;">Attach this document</a><br>');
     }
     $return[] = array('html' => '<a href="#" onclick="attachEveryChildDocumentStart(); ">Attach every Document related to record</a>
         <div id="attachEveryChildContainer" style="display: none;"><div class="insertTextfield" style="display:inline;" data-name="attachEveryChildValue" data-style="width:150px;" data-id="attachEveryChildValue">$crmid</div>&nbsp;<button type="button" class="btn btn-primary" onclick="attachEveryChildDocumentFinish();">add</button><input type="button" class="btn btn-warning" onclick="jQuery(\'#attachEveryChildContainer\').hide();" value="Cancel"> </div>', 'script' => "function attachEveryChildDocumentStart() {\n                jQuery('#attachEveryChildContainer').show();\n            }\n            function attachEveryChildDocumentFinish() {\n                var value = jQuery('#attachEveryChildValue').val();\n                Attachments.addAttachment('s#documents#all_childs#' + value, '" . getTranslatedString('all Childdocuments', 'Settings:Workflow2') . "', '',{val:value});\n                jQuery('#attachEveryChildContainer').hide();\n            }\n            ");
     return $return;
 }
Beispiel #30
-1
 static function lookupMailInVtiger($searchTerm, $user)
 {
     $handler = vtws_getModuleHandlerFromName('Emails', $user);
     $meta = $handler->getMeta();
     $moduleFields = $meta->getModuleFields();
     $parentIdFieldInstance = $moduleFields['parent_id'];
     $referenceModules = $parentIdFieldInstance->getReferenceList();
     $filteredResult = array();
     foreach ($referenceModules as $referenceModule) {
         $referenceModuleHandler = vtws_getModuleHandlerFromName($referenceModule, $user);
         $referenceModuleMeta = $referenceModuleHandler->getMeta();
         $referenceModuleEmailFields = $referenceModuleMeta->getEmailFields();
         $referenceModuleEntityFields = $referenceModuleMeta->getNameFields();
         $referenceModuleEntityFieldsArray = explode(',', $referenceModuleEntityFields);
         $searchFieldList = array_merge($referenceModuleEmailFields, $referenceModuleEntityFieldsArray);
         if (!empty($searchFieldList) && !empty($referenceModuleEmailFields)) {
             $searchFieldListString = implode(',', $referenceModuleEmailFields);
             $where = null;
             for ($i = 0; $i < count($searchFieldList); $i++) {
                 if ($i == count($searchFieldList) - 1) {
                     $where .= sprintf($searchFieldList[$i] . " like '%s'", $searchTerm);
                 } else {
                     $where .= sprintf($searchFieldList[$i] . " like '%s' or ", $searchTerm);
                 }
             }
             if (!empty($where)) {
                 $where = "WHERE {$where}";
             }
             if ($referenceModule == 'Users' && !is_admin($user)) {
                 //Have to do seperate query since webservices will throw permission denied for users module for non admin users
                 global $adb;
                 $where .= " AND vtiger_users.status='Active'";
                 $query = "select {$searchFieldListString},id from vtiger_users {$where}";
                 $dbResult = $adb->pquery($query, array());
                 $num_rows = $adb->num_rows($dbResult);
                 $result = array();
                 for ($i = 0; $i < $num_rows; $i++) {
                     $row = $adb->query_result_rowdata($dbResult, $i);
                     $id = $row['id'];
                     $webserviceId = vtws_getWebserviceEntityId($referenceModule, $id);
                     $row['id'] = $webserviceId;
                     $result[] = $row;
                 }
             } else {
                 $result = vtws_query("select {$searchFieldListString} from {$referenceModule} {$where};", $user);
             }
             foreach ($result as $record) {
                 foreach ($searchFieldList as $searchField) {
                     if (!empty($record[$searchField])) {
                         $filteredResult[] = array('id' => $record[$searchField], 'name' => $record[$searchField] . " - " . getTranslatedString($referenceModule), 'record' => $record['id'], 'module' => $referenceModule);
                     }
                 }
             }
         }
     }
     return $filteredResult;
 }