Skip to content

Commit

Permalink
Dolibarrize ticket module
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Mar 25, 2018
1 parent 8102ae6 commit b2c63a1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion htdocs/ticketsup/class/ticketsup.class.php
Expand Up @@ -1339,7 +1339,7 @@ function getNomUrl($withpicto=0, $option='', $notooltip=0, $morecss='', $save_la
$label = '<u>' . $langs->trans("ShowTicket") . '</u>';
$label.= '<br>';
$label.= '<b>' . $langs->trans('Ref') . ':</b> ' . $this->ref.'<br>';
$label.= '<b>' . $langs->trans('TrackID') . ':</b> ' . $this->track_id.'<br>';
$label.= '<b>' . $langs->trans('TicketTrackId') . ':</b> ' . $this->track_id.'<br>';
$label.= '<b>' . $langs->trans('Subject') . ':</b> ' . $this->subject;

$url = dol_buildpath('/ticketsup/card.php',1).'?id='.$this->id;
Expand Down
24 changes: 18 additions & 6 deletions htdocs/ticketsup/index.php
Expand Up @@ -67,6 +67,7 @@
*/

$form = new Form($db);
$tickesupstatic = new Ticketsup($db);

llxHeader('', $langs->trans('TicketsIndex'), '');

Expand Down Expand Up @@ -264,8 +265,8 @@
* Last tickets
*/
$max = 15;
$sql = "SELECT t.rowid, t.ref, t.track_id, t.datec, t.subject, t.type_code, t.category_code, t.severity_code";
$sql .= ", type.label as type_label, category.label as category_label, severity.label as severity_label";
$sql = "SELECT t.rowid, t.ref, t.track_id, t.datec, t.subject, t.type_code, t.category_code, t.severity_code, t.fk_statut, t.progress,";
$sql .= " type.label as type_label, category.label as category_label, severity.label as severity_label";
$sql .= " FROM " . MAIN_DB_PREFIX . "ticketsup as t";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_ticketsup_type as type ON type.code=t.type_code";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_ticketsup_category as category ON category.code=t.category_code";
Expand Down Expand Up @@ -308,23 +309,29 @@
print '<th>' . $langs->trans('Type') . '</th>';
print '<th>' . $langs->trans('Category') . '</th>';
print '<th>' . $langs->trans('Severity') . '</th>';
print '<th></th>';
print '</tr>';
if ($num > 0) {
$var = true;

while ($i < $num) {
$objp = $db->fetch_object($result);

$var = !$var;
print "<tr $bc[$var]>";
$tickesupstatic->id = $objp->rowid;
$tickesupstatic->ref = $objp->ref;
$tickesupstatic->track_id = $objp->track_id;
$tickesupstatic->fk_statut = $objp->fk_statut;
$tickesupstatic->progress = $objp->progress;
$tickesupstatic->subject = $objp->subject;

print '<tr class="oddeven">';
// Creation date
print '<td align="left">';
print dol_print_date($db->jdate($objp->datec), 'dayhour');
print "</td>";

// Ref
print '<td class="nowrap">';
print '<a href="card.php?track_id=' . $objp->track_id . '">' . $objp->ref . '</a>';
print $tickesupstatic->getNomUrl(1);
print "</td>\n";

// Subject
Expand All @@ -346,6 +353,11 @@
print '<td class="nowrap">';
print $objp->severity_label;
print "</td>";

print '<td class="nowrap">';
print $tickesupstatic->getLibStatut(3);
print "</td>";

print "</tr>\n";
$i++;
}
Expand Down

0 comments on commit b2c63a1

Please sign in to comment.