Esempio n. 1
0
 public function GetListviewData()
 {
     global $current_user;
     $sql = "SELECT templateid, module FROM vtiger_pdfmaker GROUP BY module";
     $result = $this->db->pquery($sql, array());
     $return_data = array();
     $num_rows = $this->db->num_rows($result);
     if (!$num_rows) {
         include_once "modules/PDFMaker/PDFMaker.php";
         $C_PDFMaker = new PDFMaker();
         $C_PDFMaker->executeSql();
         $result = $this->db->pquery($sql, array());
         $num_rows = $this->db->num_rows($result);
     }
     for ($i = 0; $i < $num_rows; $i++) {
         $currModule = $this->db->query_result($result, $i, 'module');
         $templateid = $this->db->query_result($result, $i, 'templateid');
         $pdftemplatearray = array();
         $pdftemplatearray['templateid'] = $templateid;
         $pdftemplatearray['module'] = $pdftemplatearray['filename'] = "<a href=\"index.php?module=PDFMaker&view=Detail&templateid=" . $templateid . "\">" . vtranslate($currModule, $currModule) . "</a>";
         if ($this->CheckPermissions("EDIT")) {
             $pdftemplatearray['edit'] = "<a href=\"index.php?module=PDFMaker&view=Edit&return_view=List&templateid=" . $templateid . "\">" . vtranslate("LBL_EDIT") . "</a>";
         }
         $return_data[] = $pdftemplatearray;
     }
     return $return_data;
 }