Debug ticket module

This commit is contained in:
Laurent Destailleur 2018-03-13 13:56:45 +01:00
parent e6d8219396
commit e6dd312bd5
7 changed files with 22 additions and 19 deletions

View File

@ -18,9 +18,9 @@
*/
/**
* \file ticketsup/core/boxes/ticketsup_latest.php
* \ingroup ticketsup
* \brief This box shows latest UNREAD tickets
* \file core/boxes/box_last_modified_ticketsup.php
* \ingroup ticketsup
* \brief This box shows latest modified tickets
*/
require_once DOL_DOCUMENT_ROOT . "/core/boxes/modules_boxes.php";

View File

@ -18,9 +18,9 @@
*/
/**
* \file ticketsup/core/boxes/ticketsup_latest.php
* \ingroup ticketsup
* \brief This box shows latest tickets
* \file core/boxes/box_ticketsup_latest.php
* \ingroup ticketsup
* \brief This box shows latest created tickets
*/
require_once DOL_DOCUMENT_ROOT . "/core/boxes/modules_boxes.php";

View File

@ -162,30 +162,35 @@ class modTicketsup extends DolibarrModules
// Permissions
$this->rights = array(); // Permission array used by this module
$r=0;
$this->rights[$r][0] = 56001; // id de la permission
$this->rights[$r][1] = "Read ticket"; // libelle de la permission
$this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour)
$this->rights[$r][3] = 1; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'read';
$r++;
$this->rights[$r][0] = 56002; // id de la permission
$this->rights[$r][1] = "Create les tickets"; // libelle de la permission
$this->rights[$r][2] = 'w'; // type de la permission (deprecie a ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'write';
$r++;
$this->rights[$r][0] = 56003; // id de la permission
$this->rights[$r][1] = "Delete les tickets"; // libelle de la permission
$this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'delete';
$r++;
$this->rights[$r][0] = 56004; // id de la permission
$this->rights[$r][1] = "Manage tickets"; // libelle de la permission
//$this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'manage';
$r++;
$this->rights[$r][0] = 56005; // id de la permission
$this->rights[$r][1] = 'See all tickets, even if not assigned to (not effective for external users, always restricted to the thirdpardy they depends on)'; // libelle de la permission
$this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour)

View File

@ -291,11 +291,11 @@ TicketNotificationNumberEmailSent=Notification email sent : %s
#
# Boxes
#
BoxLastTicketsup=Last tickets
BoxLastTicketsupDescription=Last %s tickets saved
BoxLastTicketsup=Latest created tickets
BoxLastTicketsupDescription=Latest %s created tickets
BoxLastTicketsupContent=
BoxLastTicketsupNoRecordedTickets=No recent unread tickets
BoxLastModifiedTicketsup=Last modified tickets
BoxLastModifiedTicketsupDescription=Last %s tickets modified
BoxLastModifiedTicketsup=Latest modified tickets
BoxLastModifiedTicketsupDescription=Latest %s modified tickets
BoxLastModifiedTicketsupContent=
BoxLastModifiedTicketsupNoRecordedTickets=No recent modified tickets

View File

@ -220,6 +220,7 @@ if ($object->ismultientitymanaged == 1) $sql.= " WHERE t.entity IN (".getEntity(
else $sql.=" WHERE 1 = 1";
foreach($search as $key => $val)
{
if ($key == 'status' && $search[$key] == -1) continue;
$mode_search=(($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key]))?1:0);
if ($search[$key] != '') $sql.=natural_search($key, $search[$key], (($key == 'status')?2:$mode_search));
}

View File

@ -181,7 +181,6 @@ class Ticketsup extends CommonObject
'fk_user_assign' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'AuthorAssign', 'visible'=>1, 'enabled'=>1, 'position'=>510, 'notnull'=>1),
'subject' => array('type'=>'varchar(255)', 'label'=>'Subject', 'visible'=>1, 'enabled'=>1, 'position'=>12, 'notnull'=>-1, 'searchall'=>1, 'help'=>""),
'message' => array('type'=>'text', 'label'=>'Message', 'visible'=>-2, 'enabled'=>1, 'position'=>60, 'notnull'=>-1,),
'fk_statut' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>600, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array(0 => 'NotRead', 1 => 'Read', 3 => 'Answered', 4 => 'Assigned', 5 => 'InProgress', 6 => 'Waiting', 8 => 'Closed', 9 => 'Deleted')),
'resolution' => array('type'=>'integer', 'label'=>'Resolution', 'visible'=>-2, 'enabled'=>1, 'position'=>40, 'notnull'=>1),
'progress' => array('type'=>'varchar(100)', 'label'=>'Progression', 'visible'=>1, 'enabled'=>1, 'position'=>41, 'notnull'=>-1, 'searchall'=>1, 'help'=>""),
'timing' => array('type'=>'varchar(20)', 'label'=>'Timing', 'visible'=>-1, 'enabled'=>1, 'position'=>42, 'notnull'=>-1, 'searchall'=>1, 'help'=>""),
@ -191,8 +190,8 @@ class Ticketsup extends CommonObject
'datec' => array('type'=>'datetime', 'label'=>'DateCreation', 'visible'=>-2, 'enabled'=>1, 'position'=>500, 'notnull'=>1),
'date_read' => array('type'=>'datetime', 'label'=>'TicketReadOn', 'visible'=>-2, 'enabled'=>1, 'position'=>500, 'notnull'=>1),
'date_close' => array('type'=>'datetime', 'label'=>'TicketCloseOn', 'visible'=>-2, 'enabled'=>1, 'position'=>500, 'notnull'=>1),
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'visible'=>-2, 'enabled'=>1, 'position'=>501, 'notnull'=>1)
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'visible'=>-2, 'enabled'=>1, 'position'=>501, 'notnull'=>1),
'fk_statut' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>600, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array(0 => 'NotRead', 1 => 'Read', 3 => 'Answered', 4 => 'Assigned', 5 => 'InProgress', 6 => 'Waiting', 8 => 'Closed', 9 => 'Deleted'))
);
/**

View File

@ -214,8 +214,9 @@ if ($object->ismultientitymanaged == 1) $sql.= " WHERE t.entity IN (".getEntity(
else $sql.=" WHERE 1 = 1";
foreach($search as $key => $val)
{
if ($key == 'fk_statut' && $search[$key] == -1) continue;
$mode_search=(($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key]))?1:0);
if ($search[$key] != '') $sql.=natural_search($key, $search[$key], (($key == 'status')?2:$mode_search));
if ($search[$key] != '') $sql.=natural_search($key, $search[$key], (($key == 'fk_statut')?2:$mode_search));
}
if ($search_all) $sql.= natural_search(array_keys($fieldstosearchall), $search_all);
@ -436,8 +437,9 @@ print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print '<input type="hidden" name="mode" value="' . $mode . '" >';
$buttontocreate = '<div class="inline-block divButAction"><a class="butAction" href="new.php?action=create_ticket' . ($socid ? '&socid=' . $socid : '') . ($projectid ? '&origin=projet_project&originid=' . $projectid : '') . '">' . $langs->trans('NewTicket') . '</a></div>';
print_barre_liste($langs->trans('TicketList'), $page, 'list.php', $param, $sortfield, $sortorder, '', $num, $num_total, 'title_ticketsup');
print_barre_liste($langs->trans('TicketList'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_ticketsup', 0, $buttontocreate, '', $limit);
if ($mode == 'my_assign') {
print '<div class="opacitymedium">' . $langs->trans('TicketAssignedToMeInfos') . '</div><br>';
@ -674,10 +676,6 @@ print '</div>'."\n";
print '</form>'."\n";
print '<div class="tabsAction">';
print '<div class="inline-block divButAction"><a class="butAction" href="new.php?action=create_ticket' . ($socid ? '&socid=' . $socid : '') . ($projectid ? '&origin=projet_project&originid=' . $projectid : '') . '">' . $langs->trans('NewTicket') . '</a></div>';
print '</div>';
if (in_array('builddoc',$arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords))
{