Example #1
0
    public function getList(Vtiger_Request $request) {

        PDFMaker_Debugger_Model::GetInstance()->Init();

        $PDFMaker = new PDFMaker_PDFMaker_Model();
        
        if ($PDFMaker->CheckPermissions("DETAIL") == false)
            $PDFMaker->DieDuePermission();

        $viewer = $this->getViewer($request);
        $orderby = "templateid";
        $dir = "asc";

        if (isset($_REQUEST["dir"]) && $_REQUEST["dir"] == "desc")
            $dir = "desc";

        if (isset($_REQUEST["orderby"])) {
            switch ($_REQUEST["orderby"]) {
                case "name":
                    $orderby = "filename";
                    break;

                case "module":
                    $orderby = "module";
                    break;

                case "description":
                    $orderby = "description";
                    break;

                case "order":
                    $orderby = "order";
                    break;
                default:
                    $orderby = $_REQUEST["orderby"];
                    break;
            }
        }

        $version_type = $PDFMaker->GetVersionType();
        $license_key = $PDFMaker->GetLicenseKey();

        $viewer->assign("VERSION_TYPE", $version_type);
        $viewer->assign("VERSION", ucfirst($version_type) . " " . PDFMaker_Version_Helper::$version);
    
        if ($PDFMaker->CheckPermissions("EDIT")) {
            $viewer->assign("EDIT", "permitted");
        }

        $notif = $PDFMaker->GetReleasesNotif();
        $viewer->assign("RELEASE_NOTIF", $notif);

        $php_version = phpversion();
        $notif = false;
        $max_in_vars = ini_get("max_input_vars");
        if ($max_in_vars <= 1000 && $php_version >= "5.3.9")
            $notif = true;

        $test = ini_set("memory_limit", "256M");
        $memory_limit = ini_get("memory_limit");
        if (substr($memory_limit, 0, -1) <= 128)
            $notif = true;

        $max_exec_time = ini_get("max_execution_time");
        if ($max_exec_time <= 60)
            $notif = true;

        if (extension_loaded('suhosin')) {
            $request_max_vars = ini_get("suhosin.request.max_vars");
            $post_max_vars = ini_get("suhosin.post.max_vars");
            if ($request_max_vars <= 1000)
                $notif = true;
            if ($post_max_vars <= 1000)
                $notif = true;
        }

        $viewer->assign("MOD", $mod_strings);
        $viewer->assign("APP", $app_strings);
        $viewer->assign("THEME", $theme);
        $viewer->assign("PARENTTAB", getParentTab());
        $viewer->assign("IMAGE_PATH", $image_path);

        $return_data = $PDFMaker->GetListviewData($orderby, $dir);
        $viewer->assign("PDFTEMPLATES", $return_data);
        $category = getParentTab();
        $viewer->assign("CATEGORY", $category);

        if (is_admin($current_user)) {
            $viewer->assign('IS_ADMIN', '1');
        }
        
        $linkModels = $PDFMaker->getListViewLinks($linkParams);
        $viewer->assign('LISTVIEW_LINKS', $linkModels);
        
        $tpl = "ListPDFTemplates";
        if ($request->get('ajax') == "true")
            $tpl .= "Contents";

        $viewer->view($tpl.".tpl", 'PDFMaker');
    }
Example #2
0
 public function getList(Vtiger_Request $request)
 {
     PDFMaker_Debugger_Model::GetInstance()->Init();
     $PDFMaker = new PDFMaker_PDFMaker_Model();
     if ($PDFMaker->CheckPermissions("DETAIL") == false) {
         $PDFMaker->DieDuePermission();
     }
     $viewer = $this->getViewer($request);
     $orderby = "templateid";
     $dir = "asc";
     if (isset($_REQUEST["dir"]) && $_REQUEST["dir"] == "desc") {
         $dir = "desc";
     }
     if (isset($_REQUEST["orderby"])) {
         switch ($_REQUEST["orderby"]) {
             case "name":
                 $orderby = "filename";
                 break;
             case "module":
                 $orderby = "module";
                 break;
             case "description":
                 $orderby = "description";
                 break;
             case "order":
                 $orderby = "order";
                 break;
             default:
                 $orderby = $_REQUEST["orderby"];
                 break;
         }
     }
     $version_type = $PDFMaker->GetVersionType();
     $license_key = $PDFMaker->GetLicenseKey();
     $viewer->assign("VERSION_TYPE", $version_type);
     $viewer->assign("VERSION", ucfirst($version_type) . " " . PDFMaker_Version_Helper::$version);
     $viewer->assign("LICENSE_KEY", $license_key);
     // $to_update = "false";
     // $smarty->assign("TO_UPDATE",$to_update);
     if ($PDFMaker->CheckPermissions("EDIT")) {
         $viewer->assign("EXPORT", "yes");
     }
     if ($PDFMaker->CheckPermissions("EDIT") && $PDFMaker->GetVersionType() != "deactivate") {
         $viewer->assign("EDIT", "permitted");
         $viewer->assign("IMPORT", "yes");
     }
     if ($PDFMaker->CheckPermissions("DELETE") && $PDFMaker->GetVersionType() != "deactivate") {
         $viewer->assign("DELETE", "permitted");
     }
     $notif = $PDFMaker->GetReleasesNotif();
     $viewer->assign("RELEASE_NOTIF", $notif);
     $php_version = phpversion();
     $notif = false;
     $max_in_vars = ini_get("max_input_vars");
     if ($max_in_vars <= 1000 && $php_version >= "5.3.9") {
         $notif = true;
     }
     $test = ini_set("memory_limit", "256M");
     $memory_limit = ini_get("memory_limit");
     if (substr($memory_limit, 0, -1) <= 128) {
         $notif = true;
     }
     $max_exec_time = ini_get("max_execution_time");
     if ($max_exec_time <= 60) {
         $notif = true;
     }
     if (extension_loaded('suhosin')) {
         $request_max_vars = ini_get("suhosin.request.max_vars");
         $post_max_vars = ini_get("suhosin.post.max_vars");
         if ($request_max_vars <= 1000) {
             $notif = true;
         }
         if ($post_max_vars <= 1000) {
             $notif = true;
         }
     }
     if ($notif === true) {
         //$notif = '<a href="index.php?module=PDFMaker&action=Debugging&parenttab=Settings" title="' . vtranslate("LBL_GOTO_DEBUG","PDFMaker") . '" style="color:red;">' . vtranslate("LBL_DBG_NOTIF","PDFMaker") . '</a>';
         //$viewer->assign("DEBUG_NOTIF", $notif);
     }
     $viewer->assign("MOD", $mod_strings);
     $viewer->assign("APP", $app_strings);
     $viewer->assign("THEME", $theme);
     $viewer->assign("PARENTTAB", getParentTab());
     $viewer->assign("IMAGE_PATH", $image_path);
     $viewer->assign("ORDERBY", $orderby);
     $viewer->assign("DIR", $dir);
     $return_data = $PDFMaker->GetListviewData($orderby, $dir);
     $viewer->assign("PDFTEMPLATES", $return_data);
     $category = getParentTab();
     $viewer->assign("CATEGORY", $category);
     if (is_admin($current_user)) {
         $viewer->assign('IS_ADMIN', '1');
     }
     //$tool_buttons = Button_Check($currentModule);
     //$viewer->assign('CHECK', $tool_buttons);
     $linkParams = array('MODULE' => $moduleName, 'ACTION' => $request->get('view'));
     $linkModels = $PDFMaker->getListViewLinks($linkParams);
     $viewer->assign('LISTVIEW_MASSACTIONS', $linkModels['LISTVIEWMASSACTION']);
     $viewer->assign('LISTVIEW_LINKS', $linkModels);
     $tpl = "ListPDFTemplates";
     if ($request->get('ajax') == "true") {
         $tpl .= "Contents";
     }
     $viewer->view($tpl . ".tpl", 'PDFMaker');
 }