Пример #1
0
 function Xml()
 {
     // Start/End dates
     $this->SetupStartEnd();
     // Chart_Rendering event
     $this->Chart_Rendering();
     // Chart attributes
     foreach ($this->ChartAttrs as $attr => $value) {
         $this->SetAttribute($this->XmlDoc->documentElement, $attr, $value);
     }
     $this->SetAttribute($this->XmlDoc->documentElement, 'dateFormat', $this->DateFormat);
     $this->Chart_DataRendered($this->XmlDoc->documentElement);
     // Categories
     $this->OutputCategories();
     // Processes
     $this->OutputProcesses();
     // DataTable
     $this->OutputDataTable();
     // Tasks
     $this->OutputTasks();
     // Milestones
     if ($this->MilestoneTable != "") {
         $sql = "SELECT * FROM " . ewr_QuotedName($this->MilestoneTable);
         $this->OutputQuery($sql, 'milestones', 'milestone', array(), $this->MilestoneAttrs);
     } elseif ($this->TaskMilestoneDateField != "") {
         // Use task table as milestone table
         $sql = "SELECT " . ewr_QuotedName($this->TaskIdField) . " AS " . ewr_QuotedName('taskId') . ", " . ewr_QuotedName($this->TaskMilestoneDateField) . " AS " . ewr_QuotedName('date') . " FROM " . ewr_QuotedName($this->TaskTable) . " WHERE " . ewr_QuotedName($this->TaskMilestoneDateField) . " IS NOT NULL";
         $this->OutputQuery($sql, 'milestones', 'milestone', array(), $this->MilestoneAttrs);
     }
     $this->OutputArray($this->Milestones, 'milestones', 'milestone', array(), $this->MilestoneAttrs);
     // Trendlines
     if ($this->TrendlineTable != "") {
         $sql = "SELECT * FROM " . ewr_QuotedName($this->TrendlineTable);
         $this->OutputQuery($sql, 'trendlines', 'line', array(), $this->TrendlineAttrs);
     }
     $this->OutputArray($this->Trendlines, 'trendlines', 'line', array(), $this->TrendlineAttrs);
     // Connectors
     if ($this->ConnectorTable != "") {
         $sql = "SELECT * FROM " . ewr_QuotedName($this->ConnectorTable);
         $this->OutputQuery($sql, 'connectors', 'connector', $this->ConnectorsAttrs, $this->ConnectorAttrs);
     } elseif ($this->TaskFromTaskIdField != "") {
         // Use task table as connector table
         $sql = "SELECT " . ewr_QuotedName($this->TaskFromTaskIdField) . " AS " . ewr_QuotedName('fromTaskId') . ", " . ewr_QuotedName($this->TaskIdField) . " AS " . ewr_QuotedName('toTaskId') . " FROM " . ewr_QuotedName($this->TaskTable);
         $this->OutputQuery($sql, 'connectors', 'connector', $this->ConnectorsAttrs, $this->ConnectorAttrs);
     }
     $this->OutputArray($this->Connectors, 'connectors', 'connector', $this->ConnectorsAttrs, $this->ConnectorAttrs);
     // Get the XML
     $xml = $this->XmlDoc->saveXML();
     // Chart_Rendered event
     $this->Chart_Rendered($xml);
     // Output
     return $xml;
 }
Пример #2
0
 function CurrentUserInfo($fldname)
 {
     $info = NULL;
     if (defined("EWR_USER_TABLE") && !$this->IsSysAdmin()) {
         $user = $this->CurrentUserName();
         if (strval($user) != "") {
             return ewr_ExecuteScalar("SELECT " . ewr_QuotedName($fldname) . " FROM " . EWR_USER_TABLE . " WHERE " . str_replace("%u", ewr_AdjustSql($user), EWR_USER_NAME_FILTER));
         }
     }
     return $info;
 }