Debug v16
This commit is contained in:
parent
32a1c20154
commit
d0c95d87af
@ -99,6 +99,50 @@ if ($action == 'updateMask') {
|
|||||||
// par appel methode canBeActivated
|
// par appel methode canBeActivated
|
||||||
|
|
||||||
dolibarr_set_const($db, "TICKET_ADDON", $value, 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, "TICKET_ADDON", $value, 'chaine', 0, '', $conf->entity);
|
||||||
|
} elseif ($action == 'setvarworkflow') {
|
||||||
|
$param_auto_read = GETPOST('TICKET_AUTO_READ_WHEN_CREATED_FROM_BACKEND', 'alpha');
|
||||||
|
$res = dolibarr_set_const($db, 'TICKET_AUTO_READ_WHEN_CREATED_FROM_BACKEND', $param_auto_read, 'chaine', 0, '', $conf->entity);
|
||||||
|
if (!($res > 0)) {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$param_auto_assign = GETPOST('TICKET_AUTO_ASSIGN_USER_CREATE', 'alpha');
|
||||||
|
$res = dolibarr_set_const($db, 'TICKET_AUTO_ASSIGN_USER_CREATE', $param_auto_assign, 'chaine', 0, '', $conf->entity);
|
||||||
|
if (!($res > 0)) {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$param_limit_view = GETPOST('TICKET_LIMIT_VIEW_ASSIGNED_ONLY', 'alpha');
|
||||||
|
$res = dolibarr_set_const($db, 'TICKET_LIMIT_VIEW_ASSIGNED_ONLY', $param_limit_view, 'chaine', 0, '', $conf->entity);
|
||||||
|
if (!($res > 0)) {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (GETPOSTISSET('product_category_id')) {
|
||||||
|
$param_ticket_product_category = GETPOST('product_category_id', 'int');
|
||||||
|
$res = dolibarr_set_const($db, 'TICKET_PRODUCT_CATEGORY', $param_ticket_product_category, 'chaine', 0, '', $conf->entity);
|
||||||
|
if (!($res > 0)) {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$param_delay_first_response = GETPOST('delay_first_response', 'int');
|
||||||
|
$res = dolibarr_set_const($db, 'TICKET_DELAY_BEFORE_FIRST_RESPONSE', $param_delay_first_response, 'chaine', 0, '', $conf->entity);
|
||||||
|
if (!($res > 0)) {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$param_delay_between_responses = GETPOST('delay_between_responses', 'int');
|
||||||
|
$res = dolibarr_set_const($db, 'TICKET_DELAY_SINCE_LAST_RESPONSE', $param_delay_between_responses, 'chaine', 0, '', $conf->entity);
|
||||||
|
if (!($res > 0)) {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$param_auto_notify_close = GETPOST('TICKET_NOTIFY_AT_CLOSING', 'alpha');
|
||||||
|
$res = dolibarr_set_const($db, 'TICKET_NOTIFY_AT_CLOSING', $param_auto_notify_close, 'chaine', 0, '', $conf->entity);
|
||||||
|
if (!($res > 0)) {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
} elseif ($action == 'setvar') {
|
} elseif ($action == 'setvar') {
|
||||||
include_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
|
include_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
|
||||||
|
|
||||||
@ -146,50 +190,6 @@ if ($action == 'updateMask') {
|
|||||||
if (!($res > 0)) {
|
if (!($res > 0)) {
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ($action == 'setvarworkflow') {
|
|
||||||
$param_auto_read = GETPOST('TICKET_AUTO_READ_WHEN_CREATED_FROM_BACKEND', 'alpha');
|
|
||||||
$res = dolibarr_set_const($db, 'TICKET_AUTO_READ_WHEN_CREATED_FROM_BACKEND', $param_auto_read, 'chaine', 0, '', $conf->entity);
|
|
||||||
if (!($res > 0)) {
|
|
||||||
$error++;
|
|
||||||
}
|
|
||||||
|
|
||||||
$param_auto_assign = GETPOST('TICKET_AUTO_ASSIGN_USER_CREATE', 'alpha');
|
|
||||||
$res = dolibarr_set_const($db, 'TICKET_AUTO_ASSIGN_USER_CREATE', $param_auto_assign, 'chaine', 0, '', $conf->entity);
|
|
||||||
if (!($res > 0)) {
|
|
||||||
$error++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($action == 'setvarworkflowother' || $action == 'setvarworkflow') {
|
|
||||||
$param_ticket_product_category = GETPOST('product_category_id', 'int');
|
|
||||||
$res = dolibarr_set_const($db, 'TICKET_PRODUCT_CATEGORY', $param_ticket_product_category, 'chaine', 0, '', $conf->entity);
|
|
||||||
if (!($res > 0)) {
|
|
||||||
$error++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($action == 'setvarother') {
|
|
||||||
$param_must_exists = GETPOST('TICKET_EMAIL_MUST_EXISTS', 'alpha');
|
|
||||||
$res = dolibarr_set_const($db, 'TICKET_EMAIL_MUST_EXISTS', $param_must_exists, 'chaine', 0, '', $conf->entity);
|
|
||||||
if (!($res > 0)) {
|
|
||||||
$error++;
|
|
||||||
}
|
|
||||||
|
|
||||||
$param_disable_email = GETPOST('TICKET_DISABLE_NOTIFICATION_MAILS', 'alpha');
|
|
||||||
$res = dolibarr_set_const($db, 'TICKET_DISABLE_NOTIFICATION_MAILS', $param_disable_email, 'chaine', 0, '', $conf->entity);
|
|
||||||
if (!($res > 0)) {
|
|
||||||
$error++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
|
||||||
$param_show_module_logo = GETPOST('TICKET_SHOW_MODULE_LOGO', 'alpha');
|
|
||||||
$res = dolibarr_set_const($db, 'TICKET_SHOW_MODULE_LOGO', $param_show_module_logo, 'chaine', 0, '', $conf->entity);
|
|
||||||
if (!($res > 0)) {
|
|
||||||
$error++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
||||||
$param_notification_also_main_addressemail = GETPOST('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', 'alpha');
|
$param_notification_also_main_addressemail = GETPOST('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', 'alpha');
|
||||||
@ -198,34 +198,9 @@ if ($action == 'setvarother') {
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$param_limit_view = GETPOST('TICKET_LIMIT_VIEW_ASSIGNED_ONLY', 'alpha');
|
|
||||||
$res = dolibarr_set_const($db, 'TICKET_LIMIT_VIEW_ASSIGNED_ONLY', $param_limit_view, 'chaine', 0, '', $conf->entity);
|
|
||||||
if (!($res > 0)) {
|
|
||||||
$error++;
|
|
||||||
}
|
|
||||||
|
|
||||||
$param_delay_first_response = GETPOST('delay_first_response', 'int');
|
|
||||||
$res = dolibarr_set_const($db, 'TICKET_DELAY_BEFORE_FIRST_RESPONSE', $param_delay_first_response, 'chaine', 0, '', $conf->entity);
|
|
||||||
if (!($res > 0)) {
|
|
||||||
$error++;
|
|
||||||
}
|
|
||||||
|
|
||||||
$param_delay_between_responses = GETPOST('delay_between_responses', 'int');
|
|
||||||
$res = dolibarr_set_const($db, 'TICKET_DELAY_SINCE_LAST_RESPONSE', $param_delay_between_responses, 'chaine', 0, '', $conf->entity);
|
|
||||||
if (!($res > 0)) {
|
|
||||||
$error++;
|
|
||||||
}
|
|
||||||
|
|
||||||
$param_auto_notify_close = GETPOST('TICKET_NOTIFY_AT_CLOSING', 'alpha');
|
|
||||||
$res = dolibarr_set_const($db, 'TICKET_NOTIFY_AT_CLOSING', $param_auto_notify_close, 'chaine', 0, '', $conf->entity);
|
|
||||||
if (!($res > 0)) {
|
|
||||||
$error++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
@ -384,8 +359,8 @@ if ($resql) {
|
|||||||
|
|
||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print "<table class=\"noborder\" width=\"100%\">\n";
|
print '<table class="noborder cenpercent">'."\n";
|
||||||
print "<tr class=\"liste_titre\">\n";
|
print '<tr class="liste_titre">'."\n";
|
||||||
print '<td>'.$langs->trans("Name").'</td>';
|
print '<td>'.$langs->trans("Name").'</td>';
|
||||||
print '<td>'.$langs->trans("Description").'</td>';
|
print '<td>'.$langs->trans("Description").'</td>';
|
||||||
print '<td class="center" width="60">'.$langs->trans("Status")."</td>\n";
|
print '<td class="center" width="60">'.$langs->trans("Status")."</td>\n";
|
||||||
@ -502,13 +477,14 @@ foreach ($dirmodels as $reldir) {
|
|||||||
print '</table>';
|
print '</table>';
|
||||||
print '</div><br>';
|
print '</div><br>';
|
||||||
|
|
||||||
if (empty($conf->use_javascript_ajax)) {
|
|
||||||
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'" enctype="multipart/form-data" >';
|
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'" enctype="multipart/form-data" >';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="setvarworkflow">';
|
print '<input type="hidden" name="action" value="setvarworkflow">';
|
||||||
}
|
print '<input type="hidden" name="page_y" value="">';
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("Other"), '', '');
|
print load_fiche_titre($langs->trans("Other"), '', '');
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
@ -563,34 +539,24 @@ print $formcategory->textwithpicto('', $langs->trans("TicketsAutoNotifyCloseHelp
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Choose which product category is used for tickets
|
if (! empty($conf->product->enabled)) {
|
||||||
if ($conf->use_javascript_ajax) {
|
print '<tr class="oddeven"><td>'.$langs->trans("TicketChooseProductCategory").'</td>';
|
||||||
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'" enctype="multipart/form-data" >';
|
print '<td class="left">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
$formcategory->selectProductCategory($conf->global->TICKET_PRODUCT_CATEGORY, 'product_category_id');
|
||||||
print '<input type="hidden" name="action" value="setvarworkflowother">';
|
if ($conf->use_javascript_ajax) {
|
||||||
|
print ajax_combobox('select_'.$htmlname);
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
print '<td class="center">';
|
||||||
|
print $formcategory->textwithpicto('', $langs->trans("TicketChooseProductCategoryHelp"), 1, 'help');
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("TicketChooseProductCategory").'</td>';
|
|
||||||
print '<td class="left">';
|
|
||||||
$formcategory->selectProductCategory($conf->global->TICKET_PRODUCT_CATEGORY, 'product_category_id');
|
|
||||||
if ($conf->use_javascript_ajax) {
|
|
||||||
print ajax_combobox('select_'.$htmlname);
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
print '<td class="center">';
|
|
||||||
print $formcategory->textwithpicto('', $langs->trans("TicketChooseProductCategoryHelp"), 1, 'help');
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Define wanted maximum time elapsed before answers to tickets
|
|
||||||
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'" enctype="multipart/form-data" >';
|
|
||||||
print '<input type="hidden" name="action" value="setvarother">';
|
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$langs->trans("TicketsDelayBeforeFirstAnswer")."</td>";
|
print '<td>'.$langs->trans("TicketsDelayBeforeFirstAnswer")."</td>";
|
||||||
print '<td class="left">
|
print '<td class="left">
|
||||||
<input type="number" value="'.$conf->global->TICKET_DELAY_BEFORE_FIRST_RESPONSE.'" name="delay_first_response">
|
<input type="number" value="'.$conf->global->TICKET_DELAY_BEFORE_FIRST_RESPONSE.'" name="delay_first_response" class="width50">
|
||||||
<input type="submit" class="button small" value="'.$langs->trans("Save").'">
|
|
||||||
</td>';
|
</td>';
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
print $formcategory->textwithpicto('', $langs->trans("TicketsDelayBeforeFirstAnswerHelp"), 1, 'help');
|
print $formcategory->textwithpicto('', $langs->trans("TicketsDelayBeforeFirstAnswerHelp"), 1, 'help');
|
||||||
@ -600,8 +566,7 @@ print '</tr>';
|
|||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$langs->trans("TicketsDelayBetweenAnswers")."</td>";
|
print '<td>'.$langs->trans("TicketsDelayBetweenAnswers")."</td>";
|
||||||
print '<td class="left">
|
print '<td class="left">
|
||||||
<input type="number" value="'.$conf->global->TICKET_DELAY_SINCE_LAST_RESPONSE.'" name="delay_between_responses">
|
<input type="number" value="'.$conf->global->TICKET_DELAY_SINCE_LAST_RESPONSE.'" name="delay_between_responses" class="width50">
|
||||||
<input type="submit" class="button small" value="'.$langs->trans("Save").'">
|
|
||||||
</td>';
|
</td>';
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
print $formcategory->textwithpicto('', $langs->trans("TicketsDelayBetweenAnswersHelp"), 1, 'help');
|
print $formcategory->textwithpicto('', $langs->trans("TicketsDelayBetweenAnswersHelp"), 1, 'help');
|
||||||
@ -610,9 +575,7 @@ print '</tr>';
|
|||||||
|
|
||||||
print '</table><br>';
|
print '</table><br>';
|
||||||
|
|
||||||
print '<div class="center">';
|
print $formcategory->buttonsSaveCancel("Save", '', array(), 0, 'reposition');
|
||||||
print '<input type="submit" class="button button-save" value="'.$langs->trans("Save").'">';
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
@ -622,9 +585,10 @@ print load_fiche_titre($langs->trans("Notification"), '', '');
|
|||||||
|
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
|
|
||||||
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'" enctype="multipart/form-data" >';
|
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'" enctype="multipart/form-data" >';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="setvar">';
|
print '<input type="hidden" name="action" value="setvar">';
|
||||||
|
print '<input type="hidden" name="page_y" value="">';
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td colspan="3">'.$langs->trans("Email").'</td>';
|
print '<td colspan="3">'.$langs->trans("Email").'</td>';
|
||||||
@ -699,7 +663,7 @@ print '</td></tr>';
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print $formcategory->buttonsSaveCancel("Save", '');
|
print $formcategory->buttonsSaveCancel("Save", '', array(), 0, 'reposition');
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
|
|||||||
@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php";
|
|||||||
class box_graph_nb_ticket_last_x_days extends ModeleBoxes
|
class box_graph_nb_ticket_last_x_days extends ModeleBoxes
|
||||||
{
|
{
|
||||||
|
|
||||||
public $boxcode = "box_nb_ticket_last_x_days";
|
public $boxcode = "box_graph_nb_ticket_last_x_days";
|
||||||
public $boximg = "ticket";
|
public $boximg = "ticket";
|
||||||
public $boxlabel;
|
public $boxlabel;
|
||||||
public $depends = array("ticket");
|
public $depends = array("ticket");
|
||||||
@ -102,18 +102,17 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes
|
|||||||
'text' => $text,
|
'text' => $text,
|
||||||
'limit' => dol_strlen($text)
|
'limit' => dol_strlen($text)
|
||||||
);
|
);
|
||||||
$today = date_time_set(date_create(), 0, 0);
|
$today = dol_now();
|
||||||
$todayformat = date('Y-m-d', date_timestamp_get($today));
|
$intervaltoadd = 1;
|
||||||
$intervaltosub = new DateInterval('P'.dol_escape_htmltag($days - 1).'D');
|
$minimumdatec = dol_time_plus_duree($today, -1 * ($days - 1), 'd');
|
||||||
$intervaltoadd = new DateInterval('P1D');
|
$minimumdatecformated = dol_print_date($minimumdatec, 'dayrfc');
|
||||||
$minimumdatec = date_sub($today, $intervaltosub);
|
|
||||||
$minimumdatecformated = date('Y-m-d', date_timestamp_get($minimumdatec));
|
|
||||||
|
|
||||||
if ($user->rights->ticket->read) {
|
if ($user->rights->ticket->read) {
|
||||||
$sql = "SELECT CAST(t.datec AS DATE) as datec, COUNT(t.datec) as nb";
|
$sql = "SELECT CAST(t.datec AS DATE) as datec, COUNT(t.datec) as nb";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."ticket as t";
|
$sql .= " FROM ".MAIN_DB_PREFIX."ticket as t";
|
||||||
$sql .= " WHERE CAST(t.datec AS DATE) > DATE_SUB(CURRENT_DATE, INTERVAL ".$days." DAY)";
|
$sql .= " WHERE CAST(t.datec AS DATE) > '".$this->db->idate($minimumdatec)."'";
|
||||||
$sql .= " GROUP BY CAST(t.datec AS DATE)";
|
$sql .= " GROUP BY CAST(t.datec AS DATE)";
|
||||||
|
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$num = $this->db->num_rows($resql);
|
$num = $this->db->num_rows($resql);
|
||||||
@ -122,18 +121,18 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes
|
|||||||
$objp = $this->db->fetch_object($resql);
|
$objp = $this->db->fetch_object($resql);
|
||||||
while ($minimumdatecformated < $objp->datec) {
|
while ($minimumdatecformated < $objp->datec) {
|
||||||
$dataseries[] = array('label' => dol_print_date($minimumdatecformated, 'day'), 'data' => 0);
|
$dataseries[] = array('label' => dol_print_date($minimumdatecformated, 'day'), 'data' => 0);
|
||||||
$minimumdatec = date_add($minimumdatec, $intervaltoadd);
|
$minimumdatec = dol_time_plus_duree($minimumdatec, $intervaltoadd, 'd');
|
||||||
$minimumdatecformated = date('Y-m-d', date_timestamp_get($minimumdatec));
|
$minimumdatecformated = dol_print_date($minimumdatec, 'dayrfc');
|
||||||
}
|
}
|
||||||
$dataseries[] = array('label' => dol_print_date($objp->datec, 'day'), 'data' => $objp->nb);
|
$dataseries[] = array('label' => dol_print_date($objp->datec, 'day'), 'data' => $objp->nb);
|
||||||
$minimumdatec = date_add($minimumdatec, $intervaltoadd);
|
$minimumdatec = dol_time_plus_duree($minimumdatec, $intervaltoadd, 'd');
|
||||||
$minimumdatecformated = date('Y-m-d', date_timestamp_get($minimumdatec));
|
$minimumdatecformated = dol_print_date($minimumdatec, 'dayrfc');
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
while (count($dataseries) < $days) {
|
while (count($dataseries) < $days) {
|
||||||
$dataseries[] = array('label' => dol_print_date($minimumdatecformated, 'day'), 'data' => 0);
|
$dataseries[] = array('label' => dol_print_date($minimumdatecformated, 'day'), 'data' => 0);
|
||||||
$minimumdatec = date_add($minimumdatec, $intervaltoadd);
|
$minimumdatec = dol_time_plus_duree($minimumdatec, $intervaltoadd, 'd');
|
||||||
$minimumdatecformated = date('Y-m-d', date_timestamp_get($minimumdatec));
|
$minimumdatecformated = dol_print_date($minimumdatec, 'dayrfc');
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php";
|
|||||||
class box_graph_nb_tickets_type extends ModeleBoxes
|
class box_graph_nb_tickets_type extends ModeleBoxes
|
||||||
{
|
{
|
||||||
|
|
||||||
public $boxcode = "box_nb_tickets_type";
|
public $boxcode = "box_graph_nb_tickets_type";
|
||||||
public $boximg = "ticket";
|
public $boximg = "ticket";
|
||||||
public $boxlabel;
|
public $boxlabel;
|
||||||
public $depends = array("ticket");
|
public $depends = array("ticket");
|
||||||
@ -171,7 +171,7 @@ class box_graph_nb_tickets_type extends ModeleBoxes
|
|||||||
}
|
}
|
||||||
$stringtoprint .= '</div>';
|
$stringtoprint .= '</div>';
|
||||||
$this->info_box_contents[][]=array(
|
$this->info_box_contents[][]=array(
|
||||||
'td' => 'center',
|
'td' => 'class="center"',
|
||||||
'text' => $stringtoprint
|
'text' => $stringtoprint
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -191,19 +191,19 @@ class box_graph_ticket_by_severity extends ModeleBoxes
|
|||||||
}
|
}
|
||||||
$stringtoprint .= '</div>';
|
$stringtoprint .= '</div>';
|
||||||
$this->info_box_contents[][]=array(
|
$this->info_box_contents[][]=array(
|
||||||
'td' => 'center',
|
'td' => 'class="center"',
|
||||||
'text' => $stringtoprint
|
'text' => $stringtoprint
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$this->info_box_contents[0][0] = array(
|
$this->info_box_contents[0][0] = array(
|
||||||
'td' => 'class="center opacitymedium"',
|
'td' => '',
|
||||||
'text' => $langs->trans("BoxNoTicketSeverity")
|
'text' => '<span class="opacitymedium">'.$langs->trans("BoxNoTicketSeverity").'</span>'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->info_box_contents[0][0] = array(
|
$this->info_box_contents[0][0] = array(
|
||||||
'td' => 'class="left"',
|
'td' => '',
|
||||||
'text' => $langs->trans("ReadPermissionNotAllowed"),
|
'text' => '<span class="opacitymedium">'.$langs->trans("ReadPermissionNotAllowed").'</span>',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -177,15 +177,15 @@ class box_last_modified_ticket extends ModeleBoxes
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($num == 0) {
|
if ($num == 0) {
|
||||||
$this->info_box_contents[$i][0] = array('td' => 'class="center"', 'text'=>$langs->trans("BoxLastModifiedTicketNoRecordedTickets"));
|
$this->info_box_contents[$i][0] = array('td' => '', 'text'=>'<span class="opacitymedium">'.$langs->trans("BoxLastModifiedTicketNoRecordedTickets").'</span>');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
dol_print_error($this->db);
|
dol_print_error($this->db);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->info_box_contents[0][0] = array(
|
$this->info_box_contents[0][0] = array(
|
||||||
'td' => 'class="left"',
|
'td' => '',
|
||||||
'text' => $langs->trans("ReadPermissionNotAllowed"),
|
'text' => '<span class="opacitymedium">'.$langs->trans("ReadPermissionNotAllowed").'</span>',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -85,9 +85,9 @@ class box_last_ticket extends ModeleBoxes
|
|||||||
);
|
);
|
||||||
|
|
||||||
if ($user->rights->ticket->read) {
|
if ($user->rights->ticket->read) {
|
||||||
$sql = "SELECT t.rowid as id, t.ref, t.track_id, t.fk_soc, t.fk_user_create, t.fk_user_assign, t.subject, t.message, t.fk_statut, t.type_code, t.category_code, t.severity_code, t.datec, t.date_read, t.date_close, t.origin_email ";
|
$sql = "SELECT t.rowid as id, t.ref, t.track_id, t.fk_soc, t.fk_user_create, t.fk_user_assign, t.subject, t.message, t.fk_statut as status, t.type_code, t.category_code, t.severity_code, t.datec, t.date_read, t.date_close, t.origin_email,";
|
||||||
$sql .= ", type.label as type_label, category.label as category_label, severity.label as severity_label";
|
$sql .= " type.label as type_label, category.label as category_label, severity.label as severity_label,";
|
||||||
$sql .= ", s.nom as company_name, s.email as socemail, s.client, s.fournisseur";
|
$sql .= " s.nom as company_name, s.email as socemail, s.client, s.fournisseur";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."ticket as t";
|
$sql .= " FROM ".MAIN_DB_PREFIX."ticket as t";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_type as type ON type.code=t.type_code";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_type as type ON type.code=t.type_code";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_category as category ON category.code=t.category_code";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_category as category ON category.code=t.category_code";
|
||||||
@ -113,6 +113,7 @@ class box_last_ticket extends ModeleBoxes
|
|||||||
|
|
||||||
while ($i < $num) {
|
while ($i < $num) {
|
||||||
$objp = $this->db->fetch_object($resql);
|
$objp = $this->db->fetch_object($resql);
|
||||||
|
|
||||||
$datec = $this->db->jdate($objp->datec);
|
$datec = $this->db->jdate($objp->datec);
|
||||||
//$dateterm = $this->db->jdate($objp->fin_validite);
|
//$dateterm = $this->db->jdate($objp->fin_validite);
|
||||||
//$dateclose = $this->db->jdate($objp->date_close);
|
//$dateclose = $this->db->jdate($objp->date_close);
|
||||||
@ -122,7 +123,8 @@ class box_last_ticket extends ModeleBoxes
|
|||||||
$ticket->id = $objp->id;
|
$ticket->id = $objp->id;
|
||||||
$ticket->track_id = $objp->track_id;
|
$ticket->track_id = $objp->track_id;
|
||||||
$ticket->ref = $objp->ref;
|
$ticket->ref = $objp->ref;
|
||||||
$ticket->fk_statut = $objp->fk_statut;
|
$ticket->fk_statut = $objp->status;
|
||||||
|
$ticket->status = $objp->status;
|
||||||
$ticket->subject = $objp->subject;
|
$ticket->subject = $objp->subject;
|
||||||
if ($objp->fk_soc > 0) {
|
if ($objp->fk_soc > 0) {
|
||||||
$thirdparty = new Societe($this->db);
|
$thirdparty = new Societe($this->db);
|
||||||
@ -149,8 +151,8 @@ class box_last_ticket extends ModeleBoxes
|
|||||||
// Subject
|
// Subject
|
||||||
$this->info_box_contents[$i][$r] = array(
|
$this->info_box_contents[$i][$r] = array(
|
||||||
'td' => 'class="tdoverflowmax200"',
|
'td' => 'class="tdoverflowmax200"',
|
||||||
'text' => '<span title="'.$objp->subject.'">'.$objp->subject.'</span>', // Some event have no ref
|
'text' => '<span title="'.dol_escape_htmltag($objp->subject).'">'.dol_escape_htmltag($objp->subject).'</span>', // Some event have no ref
|
||||||
'url' => DOL_URL_ROOT."/ticket/card.php?track_id=".$objp->track_id,
|
'url' => DOL_URL_ROOT."/ticket/card.php?track_id=".urlencode($objp->track_id),
|
||||||
);
|
);
|
||||||
$r++;
|
$r++;
|
||||||
|
|
||||||
@ -180,14 +182,14 @@ class box_last_ticket extends ModeleBoxes
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($num == 0) {
|
if ($num == 0) {
|
||||||
$this->info_box_contents[$i][0] = array('td' => 'class="center"', 'text' => $langs->trans("BoxLastTicketNoRecordedTickets"));
|
$this->info_box_contents[$i][0] = array('td' => '', 'text' => '<span class="opacitymedium">'.$langs->trans("BoxLastTicketNoRecordedTickets").'</span>');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
dol_print_error($this->db);
|
dol_print_error($this->db);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->info_box_contents[0][0] = array('td' => 'class="left"',
|
$this->info_box_contents[0][0] = array('td' => '',
|
||||||
'text' => $langs->trans("ReadPermissionNotAllowed"));
|
'text' => '<span class="opacitymedium">'.$langs->trans("ReadPermissionNotAllowed").'</span>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -72,7 +72,10 @@ class FormCategory extends Form
|
|||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$sql = "SELECT cp.fk_categorie as cat_index, cat.label FROM `llx_categorie_product` as cp INNER JOIN llx_categorie as cat ON cat.rowid = cp.fk_categorie GROUP BY cp.fk_categorie;";
|
$sql = "SELECT cp.fk_categorie as cat_index, cat.label";
|
||||||
|
$sql .= " FROM ".MAIN_DB_PREFIX."categorie_product as cp";
|
||||||
|
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."categorie as cat ON cat.rowid = cp.fk_categorie";
|
||||||
|
$sql .= " GROUP BY cp.fk_categorie, cat.label";
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::selectProductCategory", LOG_DEBUG);
|
dol_syslog(get_class($this)."::selectProductCategory", LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
|
|||||||
@ -171,8 +171,8 @@ class modTicket extends DolibarrModules
|
|||||||
0=>array('file'=>'box_last_ticket.php', 'enabledbydefaulton'=>'Home'),
|
0=>array('file'=>'box_last_ticket.php', 'enabledbydefaulton'=>'Home'),
|
||||||
1=>array('file'=>'box_last_modified_ticket.php', 'enabledbydefaulton'=>'Home'),
|
1=>array('file'=>'box_last_modified_ticket.php', 'enabledbydefaulton'=>'Home'),
|
||||||
2=>array('file'=>'box_ticket_by_severity.php', 'enabledbydefaulton'=>'ticketindex'),
|
2=>array('file'=>'box_ticket_by_severity.php', 'enabledbydefaulton'=>'ticketindex'),
|
||||||
3=>array('file'=>'box_nb_ticket_last_x_days.php', 'enabledbydefaulton'=>'ticketindex'),
|
3=>array('file'=>'box_graph_nb_ticket_last_x_days.php', 'enabledbydefaulton'=>'ticketindex'),
|
||||||
4=>array('file'=>'box_nb_tickets_type.php', 'enabledbydefaulton'=>'ticketindex'),
|
4=>array('file'=>'box_graph_nb_tickets_type.php', 'enabledbydefaulton'=>'ticketindex'),
|
||||||
5=>array('file'=>'box_new_vs_close_ticket.php', 'enabledbydefaulton'=>'ticketindex')
|
5=>array('file'=>'box_new_vs_close_ticket.php', 'enabledbydefaulton'=>'ticketindex')
|
||||||
); // Boxes list
|
); // Boxes list
|
||||||
|
|
||||||
|
|||||||
@ -55,8 +55,9 @@ $userid = $user->id;
|
|||||||
// Security check
|
// Security check
|
||||||
$result = restrictedArea($user, 'ticket', 0, '', '', '', '');
|
$result = restrictedArea($user, 'ticket', 0, '', '', '', '');
|
||||||
|
|
||||||
$nowyear = strftime("%Y", dol_now());
|
$nowarray = dol_getdate(dol_now(), true);
|
||||||
$year = GETPOST('year') > 0 ? GETPOST('year') : $nowyear;
|
$nowyear = $nowarray['year'];
|
||||||
|
$year = GETPOST('year', 'int') > 0 ? GETPOST('year', 'int') : $nowyear;
|
||||||
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
|
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
|
||||||
$endyear = $year;
|
$endyear = $year;
|
||||||
|
|
||||||
@ -76,7 +77,6 @@ $object = new Ticket($db);
|
|||||||
$resultboxes = FormOther::getBoxesArea($user, "11"); // Load $resultboxes (selectboxlist + boxactivated + boxlista + boxlistb)
|
$resultboxes = FormOther::getBoxesArea($user, "11"); // Load $resultboxes (selectboxlist + boxactivated + boxlista + boxlistb)
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$tickesupstatic = new Ticket($db);
|
|
||||||
|
|
||||||
llxHeader('', $langs->trans('TicketsIndex'), '');
|
llxHeader('', $langs->trans('TicketsIndex'), '');
|
||||||
|
|
||||||
@ -108,7 +108,6 @@ if (empty($shownb) && empty($showtot)) {
|
|||||||
$shownb = 0;
|
$shownb = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$nowarray = dol_getdate(dol_now(), true);
|
|
||||||
if (empty($endyear)) {
|
if (empty($endyear)) {
|
||||||
$endyear = $nowarray['year'];
|
$endyear = $nowarray['year'];
|
||||||
}
|
}
|
||||||
@ -204,21 +203,21 @@ if ($result) {
|
|||||||
$dataseries = array();
|
$dataseries = array();
|
||||||
$colorseries = array();
|
$colorseries = array();
|
||||||
|
|
||||||
$dataseries[] = array('label' => $langs->transnoentitiesnoconv($tickesupstatic->statuts_short[Ticket::STATUS_NOT_READ]), 'data' => round($tick['unread']));
|
$dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->statuts_short[Ticket::STATUS_NOT_READ]), 'data' => round($tick['unread']));
|
||||||
$colorseries[Ticket::STATUS_NOT_READ] = '-'.$badgeStatus0;
|
$colorseries[Ticket::STATUS_NOT_READ] = '-'.$badgeStatus0;
|
||||||
$dataseries[] = array('label' => $langs->transnoentitiesnoconv($tickesupstatic->statuts_short[Ticket::STATUS_READ]), 'data' => round($tick['read']));
|
$dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->statuts_short[Ticket::STATUS_READ]), 'data' => round($tick['read']));
|
||||||
$colorseries[Ticket::STATUS_READ] = $badgeStatus1;
|
$colorseries[Ticket::STATUS_READ] = $badgeStatus1;
|
||||||
$dataseries[] = array('label' => $langs->transnoentitiesnoconv($tickesupstatic->statuts_short[Ticket::STATUS_ASSIGNED]), 'data' => round($tick['assigned']));
|
$dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->statuts_short[Ticket::STATUS_ASSIGNED]), 'data' => round($tick['assigned']));
|
||||||
$colorseries[Ticket::STATUS_ASSIGNED] = $badgeStatus3;
|
$colorseries[Ticket::STATUS_ASSIGNED] = $badgeStatus3;
|
||||||
$dataseries[] = array('label' => $langs->transnoentitiesnoconv($tickesupstatic->statuts_short[Ticket::STATUS_IN_PROGRESS]), 'data' => round($tick['inprogress']));
|
$dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->statuts_short[Ticket::STATUS_IN_PROGRESS]), 'data' => round($tick['inprogress']));
|
||||||
$colorseries[Ticket::STATUS_IN_PROGRESS] = $badgeStatus4;
|
$colorseries[Ticket::STATUS_IN_PROGRESS] = $badgeStatus4;
|
||||||
$dataseries[] = array('label' => $langs->transnoentitiesnoconv($tickesupstatic->statuts_short[Ticket::STATUS_WAITING]), 'data' => round($tick['waiting']));
|
$dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->statuts_short[Ticket::STATUS_WAITING]), 'data' => round($tick['waiting']));
|
||||||
$colorseries[Ticket::STATUS_WAITING] = '-'.$badgeStatus4;
|
$colorseries[Ticket::STATUS_WAITING] = '-'.$badgeStatus4;
|
||||||
$dataseries[] = array('label' => $langs->transnoentitiesnoconv($tickesupstatic->statuts_short[Ticket::STATUS_NEED_MORE_INFO]), 'data' => round($tick['needmoreinfo']));
|
$dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->statuts_short[Ticket::STATUS_NEED_MORE_INFO]), 'data' => round($tick['needmoreinfo']));
|
||||||
$colorseries[Ticket::STATUS_NEED_MORE_INFO] = '-'.$badgeStatus3;
|
$colorseries[Ticket::STATUS_NEED_MORE_INFO] = '-'.$badgeStatus3;
|
||||||
$dataseries[] = array('label' => $langs->transnoentitiesnoconv($tickesupstatic->statuts_short[Ticket::STATUS_CANCELED]), 'data' => round($tick['canceled']));
|
$dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->statuts_short[Ticket::STATUS_CANCELED]), 'data' => round($tick['canceled']));
|
||||||
$colorseries[Ticket::STATUS_CANCELED] = $badgeStatus9;
|
$colorseries[Ticket::STATUS_CANCELED] = $badgeStatus9;
|
||||||
$dataseries[] = array('label' => $langs->transnoentitiesnoconv($tickesupstatic->statuts_short[Ticket::STATUS_CLOSED]), 'data' => round($tick['closed']));
|
$dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->statuts_short[Ticket::STATUS_CLOSED]), 'data' => round($tick['closed']));
|
||||||
$colorseries[Ticket::STATUS_CLOSED] = $badgeStatus6;
|
$colorseries[Ticket::STATUS_CLOSED] = $badgeStatus6;
|
||||||
} else {
|
} else {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
@ -358,18 +357,18 @@ if ($result) {
|
|||||||
while ($i < $num) {
|
while ($i < $num) {
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
|
|
||||||
$tickesupstatic->id = $objp->rowid;
|
$object->id = $objp->rowid;
|
||||||
$tickesupstatic->ref = $objp->ref;
|
$object->ref = $objp->ref;
|
||||||
$tickesupstatic->track_id = $objp->track_id;
|
$object->track_id = $objp->track_id;
|
||||||
$tickesupstatic->fk_statut = $objp->fk_statut;
|
$object->fk_statut = $objp->fk_statut;
|
||||||
$tickesupstatic->progress = $objp->progress;
|
$object->progress = $objp->progress;
|
||||||
$tickesupstatic->subject = $objp->subject;
|
$object->subject = $objp->subject;
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<td class="nowraponall">';
|
print '<td class="nowraponall">';
|
||||||
print $tickesupstatic->getNomUrl(1);
|
print $object->getNomUrl(1);
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|
||||||
// Creation date
|
// Creation date
|
||||||
@ -405,7 +404,7 @@ if ($result) {
|
|||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
print '<td class="nowraponall right">';
|
print '<td class="nowraponall right">';
|
||||||
print $tickesupstatic->getLibStatut(5);
|
print $object->getLibStatut(5);
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user