Debug v13

This commit is contained in:
Laurent Destailleur 2020-12-17 11:57:12 +01:00
parent 36e0f07090
commit b0d524beed
18 changed files with 98 additions and 97 deletions

View File

@ -7154,20 +7154,20 @@ abstract class CommonObject
$dir = $sdir.'/';
$pdir = '/';
$dir .= get_exdir(0, 0, 0, 0, $this, $modulepart).$this->ref.'/';
$pdir .= get_exdir(0, 0, 0, 0, $this, $modulepart).$this->ref.'/';
$dir .= get_exdir(0, 0, 0, 0, $this, $modulepart);
$pdir .= get_exdir(0, 0, 0, 0, $this, $modulepart);
// For backward compatibility
if ($modulepart == 'product' && !empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO))
{
$dir = $sdir.'/'.get_exdir($this->id, 2, 0, 0, $this, $modulepart).$this->id."/photos/";
$pdir = '/'.get_exdir($this->id, 2, 0, 0, $this, $modulepart).$this->id."/photos/";
if ($modulepart == 'product') {
if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) {
$dir = $sdir.'/'.get_exdir($this->id, 2, 0, 0, $this, $modulepart).$this->id."/photos/";
$pdir = '/'.get_exdir($this->id, 2, 0, 0, $this, $modulepart).$this->id."/photos/";
}
}
// Defined relative dir to DOL_DATA_ROOT
$relativedir = '';
if ($dir)
{
if ($dir) {
$relativedir = preg_replace('/^'.preg_quote(DOL_DATA_ROOT, '/').'/', '', $dir);
$relativedir = preg_replace('/^[\\/]/', '', $relativedir);
$relativedir = preg_replace('/[\\/]$/', '', $relativedir);
@ -7189,23 +7189,19 @@ abstract class CommonObject
completeFileArrayWithDatabaseInfo($filearray, $relativedir);
if (count($filearray))
{
if ($sortfield && $sortorder)
{
if (count($filearray)) {
if ($sortfield && $sortorder) {
$filearray = dol_sort_array($filearray, $sortfield, $sortorder);
}
foreach ($filearray as $key => $val)
{
foreach ($filearray as $key => $val) {
$photo = '';
$file = $val['name'];
//if (! utf8_check($file)) $file=utf8_encode($file); // To be sure file is stored in UTF8 in memory
//if (dol_is_file($dir.$file) && image_format_supported($file) >= 0)
if (image_format_supported($file) >= 0)
{
if (image_format_supported($file) >= 0) {
$nbphoto++;
$photo = $file;
$viewfilename = $file;
@ -7242,12 +7238,9 @@ abstract class CommonObject
$alt .= ' - '.$langs->transnoentitiesnoconv('Size').': '.$imgarray['width'].'x'.$imgarray['height'];
if ($notitle) $alt = '';
if ($usesharelink)
{
if ($val['share'])
{
if (empty($maxHeight) || $photo_vignette && $imgarray['height'] > $maxHeight)
{
if ($usesharelink) {
if ($val['share']) {
if (empty($maxHeight) || $photo_vignette && $imgarray['height'] > $maxHeight) {
$return .= '<!-- Show original file (thumb not yet available with shared links) -->';
$return .= '<img class="photo photowithmargin" height="'.$maxHeight.'" src="'.DOL_URL_ROOT.'/viewimage.php?hashp='.urlencode($val['share']).'" title="'.dol_escape_htmltag($alt).'">';
} else {
@ -7259,10 +7252,9 @@ abstract class CommonObject
$return .= '<img class="photo photowithmargin" height="'.$maxHeight.'" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png" title="'.dol_escape_htmltag($alt).'">';
}
} else {
if (empty($maxHeight) || $photo_vignette && $imgarray['height'] > $maxHeight)
{
if (empty($maxHeight) || $photo_vignette && $imgarray['height'] > $maxHeight) {
$return .= '<!-- Show thumb -->';
$return .= '<img class="photo photowithmargin" height="'.$maxHeight.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$this->entity.'&file='.urlencode($pdirthumb.$photo_vignette).'" title="'.dol_escape_htmltag($alt).'">';
$return .= '<img class="photo photowithmargin maxwidth150onsmartphone" height="'.$maxHeight.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$this->entity.'&file='.urlencode($pdirthumb.$photo_vignette).'" title="'.dol_escape_htmltag($alt).'">';
} else {
$return .= '<!-- Show original file -->';
$return .= '<img class="photo photowithmargin" height="'.$maxHeight.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$this->entity.'&file='.urlencode($pdir.$photo).'" title="'.dol_escape_htmltag($alt).'">';

View File

@ -1254,7 +1254,7 @@ class FormFile
} else {
print '<a href="'.$urlforhref['url'].'" class="'.$urlforhref['css'].'" target="'.$urlforhref['target'].'" mime="'.$urlforhref['mime'].'">';
}
print '<img class="photo maxwidth200 shadow" height="'.(($useinecm == 4 || $useinecm == 5 || $useinecm == 6) ? '12' : $maxheightmini).'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.(!empty($object->entity) ? $object->entity : $conf->entity).'&file='.urlencode($relativepath.$smallfile).'" title="">';
print '<img class="photo maxwidth200 shadow valignmiddle" height="'.(($useinecm == 4 || $useinecm == 5 || $useinecm == 6) ? '12' : $maxheightmini).'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.(!empty($object->entity) ? $object->entity : $conf->entity).'&file='.urlencode($relativepath.$smallfile).'" title="">';
print '</a>';
} else print '&nbsp;';
print '</td>';
@ -1779,7 +1779,7 @@ class FormFile
print '<!-- listOfLinks -->'."\n";
// Show list of associated links
print load_fiche_titre($langs->trans("LinkedFiles"), '', 'external-link-square-alt', 0, '', 'table-list-of-links');
print load_fiche_titre($langs->trans("LinkedFiles"), '', 'link', 0, '', 'table-list-of-links');
print '<form action="'.$_SERVER['PHP_SELF'].($param ? '?'.$param : '').'" method="POST">';
print '<input type="hidden" name="token" value="'.newToken().'">';
@ -1913,11 +1913,12 @@ class FormFile
{
$out .= '<a class="pictopreview '.$urladvancedpreview['css'].'" href="'.$urladvancedpreview['url'].'"'.(empty($urladvancedpreview['mime']) ? '' : ' mime="'.$urladvancedpreview['mime'].'"').' '.(empty($urladvancedpreview['target']) ? '' : ' target="'.$urladvancedpreview['target'].'"').'>';
//$out.= '<a class="pictopreview">';
if (empty($ruleforpicto))
{
if (empty($ruleforpicto)) {
//$out.= img_picto($langs->trans('Preview').' '.$file['name'], 'detail');
$out .= '<span class="fa fa-search-plus" style="color: gray"></span>';
} else $out .= img_mime($relativepath, $langs->trans('Preview').' '.$file['name']);
} else {
$out .= img_mime($relativepath, $langs->trans('Preview').' '.$file['name']);
}
$out .= '</a>';
}
}

View File

@ -1620,6 +1620,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
$showimage = $object->is_photo_available($conf->ticket->multidir_output[$entity].'/'.$object->ref);
$maxvisiblephotos = (isset($conf->global->TICKET_MAX_VISIBLE_PHOTO) ? $conf->global->TICKET_MAX_VISIBLE_PHOTO : 2);
if ($conf->browser->layout == 'phone') $maxvisiblephotos = 1;
if ($showimage)
{
$showphoto = $object->show_photos('ticket', $conf->ticket->multidir_output[$entity], 'small', $maxvisiblephotos, 0, 0, 0, $width, 0);
@ -1636,8 +1637,11 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
$nophoto = '';
$morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref"></div>';
} else { // Show no photo link
$nophoto = '/public/theme/common/nophoto.png';
$morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref"><img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="No photo" border="0"'.($width ? ' style="width: '.$width.'px"' : '').' src="'.DOL_URL_ROOT.$nophoto.'"></div>';
$nophoto = img_picto('No photo', 'object_ticket');
$morehtmlleft .= '<!-- No photo to show -->';
$morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref">';
$morehtmlleft .= $nophoto;
$morehtmlleft .= '</div></div>';
}
}
} else {
@ -3213,7 +3217,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'delete', 'dolly', 'dollyrevert', 'donation', 'download', 'edit', 'ellipsis-h', 'email', 'eraser', 'external-link-alt', 'external-link-square-alt',
'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'folder', 'folder-open', 'globe', 'globe-americas', 'grip', 'grip_title', 'group',
'help', 'holiday',
'intervention', 'label', 'language', 'list', 'listlight', 'lot',
'intervention', 'label', 'language', 'link', 'list', 'listlight', 'lot',
'map-marker-alt', 'member', 'money-bill-alt', 'mrp', 'note', 'next',
'object_accounting', 'object_account', 'object_accountline', 'object_action', 'object_barcode', 'object_bill', 'object_billa', 'object_billd', 'object_bom',
'object_category', 'object_conversation', 'object_bookmark', 'object_bug', 'object_dolly', 'object_dollyrevert', 'object_generic', 'object_folder',
@ -5590,12 +5594,10 @@ function get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart = '
if ($level == 3) $path = substr($num, 2, 1).'/'.substr($num, 1, 1).'/'.substr($num, 0, 1);
} else {
// We will enhance here a common way of forging path for document storage.
// In a future, we may distribut directories on several levels depending on setup and object.
// In a future, we may distribute directories on several levels depending on setup and object.
// Here, $object->id, $object->ref and $modulepart are required.
//var_dump($modulepart);
if (!in_array($modulepart, array('product'))) { // Test to remove
$path = dol_sanitizeFileName(empty($object->ref) ? (string) $object->id : $object->ref);
}
$path = dol_sanitizeFileName(empty($object->ref) ? (string) $object->id : $object->ref);
}
if (empty($withoutslash) && !empty($path)) $path .= '/';
@ -8533,7 +8535,7 @@ function dolGetBadge($label, $html = '', $type = 'primary', $mode = '', $url = '
* @param string $statusType status0 status1 status2 status3 status4 status5 status6 status7 status8 status9 : image name or badge name
* @param int $displayMode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto, 6=Long label + Picto
* @param string $url The url for link
* @param array $params Various params. Example: array('tooltip'=>'...', 'badgeParams'=>...)
* @param array $params Various params. Example: array('tooltip'=>'no|...', 'badgeParams'=>...)
* @return string Html status string
*/
function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $statusType = 'status0', $displayMode = 0, $url = '', $params = array())
@ -8602,7 +8604,7 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st
$statusLabelShort = (empty($statusLabelShort) ? $statusLabel : $statusLabelShort);
$dolGetBadgeParams['attr']['class'] = 'badge-status';
$dolGetBadgeParams['attr']['title'] = empty($params['tooltip']) ? $statusLabel : $params['tooltip'];
$dolGetBadgeParams['attr']['title'] = empty($params['tooltip']) ? $statusLabel : ($params['tooltip'] != 'no' ? $params['tooltip'] : '');
if ($displayMode == 3) {
$return = dolGetBadge((empty($conf->dol_optimize_smallscreen) ? $statusLabel : (empty($statusLabelShort) ? $statusLabel : $statusLabelShort)), '', $statusType, 'dot', $url, $dolGetBadgeParams);

View File

@ -674,7 +674,7 @@ SendMail=Send email
Email=Email
NoEMail=No email
AlreadyRead=Already read
NotRead=Not read
NotRead=Unread
NoMobilePhone=No mobile phone
Owner=Owner
FollowingConstantsWillBeSubstituted=The following constants will be replaced with the corresponding value.
@ -1109,4 +1109,5 @@ SecurityTokenHasExpiredSoActionHasBeenCanceledPleaseRetry=Security token has exp
UpToDate=Up-to-date
OutOfDate=Out-of-date
EventReminder=Event Reminder
UpdateForAllLines=Update for all lines
UpdateForAllLines=Update for all lines
OnHold=On hold

View File

@ -58,7 +58,6 @@ OriginEmail=Email source
Notify_TICKET_SENTBYMAIL=Send ticket message by email
# Status
NotRead=Not read
Read=Read
Assigned=Assigned
InProgress=In progress

View File

@ -672,6 +672,7 @@ Email=Email
NoEMail=Pas d'email
AlreadyRead=Déjà lu
NotRead=Non lu
Unread=Non lu
NoMobilePhone=Pas de téléphone portable
Owner=Propriétaire
FollowingConstantsWillBeSubstituted=Les constantes suivantes seront substituées par leur valeur correspondante.

View File

@ -60,7 +60,6 @@ OriginEmail=E-mail source
Notify_TICKET_SENTBYMAIL=Envoi d'un message du ticket par e-mail
# Status
NotRead=Non lu
Read=Lu
Assigned=Assigné
InProgress=En cours
@ -231,7 +230,6 @@ TicketChangeStatus=Changer l'état
TicketConfirmChangeStatus=Confirmez le changement d'état: %s?
TicketLogStatusChanged=Statut modifié: %s à %s
TicketNotNotifyTiersAtCreate=Ne pas notifier l'entreprise à la création
Unread=Non lu
TicketNotCreatedFromPublicInterface=Non disponible. Le ticket na pas été créé à partir de l'interface publique.
PublicInterfaceNotEnabled=Linterface publique na pas été activée
ErrorTicketRefRequired=La référence du ticket est requise

View File

@ -5136,7 +5136,7 @@ class Product extends CommonObject
if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) {
$dir .= '/'.get_exdir($this->id, 2, 0, 0, $this, 'product').$this->id."/photos/";
} else {
$dir .= '/'.get_exdir(0, 0, 0, 0, $this, 'product').dol_sanitizeFileName($this->ref).'/';
$dir .= '/'.get_exdir(0, 0, 0, 0, $this, 'product');
}
$nbphoto = 0;

View File

@ -72,8 +72,8 @@ if ($id > 0 || !empty($ref))
{
$result = $object->fetch($id, $ref);
if (!empty($conf->product->enabled)) $upload_dir = $conf->product->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 0, $object, 'product').dol_sanitizeFileName($object->ref);
elseif (!empty($conf->service->enabled)) $upload_dir = $conf->service->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 0, $object, 'product').dol_sanitizeFileName($object->ref);
if (!empty($conf->product->enabled)) $upload_dir = $conf->product->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 1, $object, 'product');
elseif (!empty($conf->service->enabled)) $upload_dir = $conf->service->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 1, $object, 'product');
if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) // For backward compatiblity, we scan also old dirs
{

View File

@ -319,10 +319,13 @@ input.buttonpaymentstripe {
max-width: 320px;
}
a.buttonticket {
a.butStatus {
padding-left: 5px;
padding-right: 5px;
/* height: 40px; */
background-color: transparent;
color: var(--colortext) !important;
border: 2px solid var( --butactionbg);
margin: 0 0.45em !important;
}
/* Used by timesheets */
@ -1498,7 +1501,7 @@ select.widthcentpercentminusxx, input.widthcentpercentminusxx {
}
.linkobject { cursor: pointer; }
table.tableforfield tr>td:first-of-type, div.tableforfield div.tagtr>div.tagtd:first-of-type {
table.tableforfield tr>td:first-of-type, tr.trforfield>td:first-of-type, div.tableforfield div.tagtr>div.tagtd:first-of-type {
color: var(--tableforfieldcolor);
}
@ -3695,8 +3698,8 @@ table.noborder.paymenttable {
box-shadow: 0px 0px 0px #DDD !important;
}
.shadow {
-webkit-box-shadow: 2px 2px 5px #CCC !important;
box-shadow: 2px 2px 5px #CCC !important;
-webkit-box-shadow: 1px 1px 7px #CCC !important;
box-shadow: 1px 1px 7px #CCC !important;
}
div.tabBar .noborder {

View File

@ -114,7 +114,7 @@ $badgeStatus4 = '#25a580'; // Color ok
$badgeStatus4b = '#25a580'; // Color ok
$badgeStatus5 = '#cad2d2';
$badgeStatus6 = '#cad2d2';
$badgeStatus7 = '#baa32b';
$badgeStatus7 = '#25a580';
$badgeStatus8 = '#993013';
$badgeStatus9 = '#e7f0f0';

View File

@ -459,9 +459,13 @@ input.buttonpaymentstripe {
.logopublicpayment #dolpaymentlogo {
max-height: 100px;
}
a.buttonticket {
a.butStatus {
padding-left: 5px;
padding-right: 5px;
background-color: transparent;
color: var(--colortext) !important;
border: 2px solid var( --butactionbg);
margin: 0 0.45em !important;
}
/* Used by timesheets */
@ -1453,7 +1457,7 @@ table[summary="list_of_modules"] .fa-cog {
}
.linkobject { cursor: pointer; }
table.tableforfield tr>td:first-of-type, div.tableforfield div.tagtr>div.tagtd:first-of-type {
table.tableforfield tr>td:first-of-type, tr.trforfield>td:first-of-type, div.tableforfield div.tagtr>div.tagtd:first-of-type {
color: #666;
}

View File

@ -97,6 +97,6 @@ $badgeStatus3 = '#bca52b';
$badgeStatus4 = '#277d1e';
$badgeStatus5 = '#cad2d2';
$badgeStatus6 = '#cad2d2';
$badgeStatus7 = '#baa32b';
$badgeStatus7 = '#277d1e';
$badgeStatus8 = '#993013';
$badgeStatus9 = '#e7f0f0';

View File

@ -667,9 +667,6 @@ if ($action == 'create' || $action == 'presend')
$formticket->withfile = 2;
$formticket->withextrafields = 1;
$formticket->param = array('origin' => GETPOST('origin'), 'originid' => GETPOST('originid'));
if (empty($defaultref)) {
$defaultref = '';
}
$formticket->showForm(1, 'create');
} elseif ($action == 'edit' && $user->rights->ticket->write && $object->fk_statut < Ticket::STATUS_CLOSED) {
@ -863,8 +860,7 @@ elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action =
}
// Thirdparty
if (!empty($conf->societe->enabled))
{
if (!empty($conf->societe->enabled)) {
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' ';
if ($action != 'editcustomer' && $object->fk_statut < 8 && !$user->socid && $user->rights->ticket->write) {
$morehtmlref .= '<a class="editfielda" href="'.$url_page_current.'?action=editcustomer&track_id='.$object->track_id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 0).'</a> : ';
@ -877,12 +873,10 @@ elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action =
}
// Project
if (!empty($conf->projet->enabled))
{
if (!empty($conf->projet->enabled)) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->ticket->write)
{
if ($user->rights->ticket->write) {
if ($action != 'classify')
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&amp;id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a>';
$morehtmlref .= ' : ';
@ -967,7 +961,7 @@ elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action =
print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td class="nowrap">';
print $langs->trans("AssignedTo");
if ($object->fk_statut < 8 && GETPOST('set', 'alpha') != "assign_ticket" && $user->rights->ticket->manage) {
if ($object->fk_statut < $object::STATUS_CLOSED && GETPOST('set', 'alpha') != "assign_ticket" && $user->rights->ticket->manage) {
print '<td class="right"><a class="editfielda" href="'.$url_page_current.'?track_id='.$object->track_id.'&action=view&set=assign_ticket">'.img_edit($langs->trans('Modify'), '').'</a></td>';
}
print '</tr></table>';
@ -995,7 +989,7 @@ elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action =
print '<table class="nobordernopadding" width="100%"><tr><td class="nowrap">';
print $langs->trans('Progression').'</td><td class="left">';
print '</td>';
if ($action != 'progression' && $object->fk_statut < 8 && !$user->socid) {
if ($action != 'progression' && $object->fk_statut < $object::STATUS_CLOSED && !$user->socid) {
print '<td class="right"><a class="editfielda" href="'.$url_page_current.'?action=progression&amp;track_id='.$object->track_id.'">'.img_edit($langs->trans('Modify')).'</a></td>';
}
print '</tr></table>';
@ -1054,7 +1048,6 @@ elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action =
print '<form method="post" name="formticketproperties" action="'.$url_page_current.'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="change_property">';
print '<input type="hidden" name="property" value="'.$property['dict'].'">';
print '<input type="hidden" name="track_id" value="'.$track_id.'">';
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
@ -1068,7 +1061,7 @@ elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action =
print '<input class="button" type="submit" name="btn_update_ticket_prop" value="'.$langs->trans("Modify").'" />';
} else {
// Button to edit Properties
if ($object->fk_statut < 5 && $user->rights->ticket->write) {
if ($object->fk_statut < $object::STATUS_NEED_MORE_INFO && $user->rights->ticket->write) {
print '<a class="editfielda" href="card.php?track_id='.$object->track_id.'&action=view&set=properties">'.img_edit($langs->trans('Modify')).'</a>';
}
}
@ -1121,7 +1114,7 @@ elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action =
// Display navbar with links to change ticket status
print '<!-- navbar with status -->';
if (!$user->socid && $user->rights->ticket->write && $object->fk_statut < 8 && GETPOST('set') !== 'properties') {
if (!$user->socid && $user->rights->ticket->write && $object->fk_statut < $object::STATUS_CLOSED && GETPOST('set') !== 'properties') {
$actionobject->viewStatusActions($object);
}

View File

@ -193,7 +193,7 @@ class ActionsTicket
print '<div class="underbanner clearboth"></div>';
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
print '<table class="noborder centpercent margintable">';
print '<tr class="liste_titre"><td class="nowrap titlefield">';
print '<tr class="liste_titre trforfield"><td class="nowrap titlefield">';
print $langs->trans("InitialMessage");
print '</td><td>';
if ($user->rights->ticket->manage) {
@ -404,15 +404,16 @@ class ActionsTicket
if (!in_array($status, $exclude_status)) {
print '<div class="inline-block center marginbottomonly">';
if ($status == 1)
{
if ($status == 1) {
$urlforbutton = $_SERVER['PHP_SELF'].'?track_id='.$object->track_id.'&action=mark_ticket_read'; // To set as read, we use a dedicated action
} else {
$urlforbutton = $_SERVER['PHP_SELF'].'?track_id='.$object->track_id.'&action=set_status&token='.newToken().'&new_status='.$status;
}
print '<a class="butAction buttonticket marginbottomonly" href="'.$urlforbutton.'">';
print img_picto($langs->trans($object->statuts_short[$status]), 'statut'.$status.'.png@ticket').' '.$langs->trans($object->statuts_short[$status]);
print '<a class="butAction butStatus marginbottomonly" href="'.$urlforbutton.'">';
print $object->LibStatut($status, 3, 1).' ';
//print img_picto($langs->trans($object->statuts_short[$status]), 'statut'.$status.'.png@ticket', '', false, 0, 0, '', 'valignmiddle').' ';
print $langs->trans($object->statuts_short[$status]);
print '</a>';
print '</div>';
}

View File

@ -217,7 +217,7 @@ class Ticket extends CommonObject
const STATUS_ASSIGNED = 2;
const STATUS_IN_PROGRESS = 3;
const STATUS_NEED_MORE_INFO = 5;
const STATUS_WAITING = 7;
const STATUS_WAITING = 7; // on hold
const STATUS_CLOSED = 8;
const STATUS_CANCELED = 9;
@ -292,8 +292,8 @@ class Ticket extends CommonObject
self::STATUS_READ => 'Read',
self::STATUS_ASSIGNED => 'Assigned',
self::STATUS_IN_PROGRESS => 'InProgress',
self::STATUS_WAITING => 'OnHold',
self::STATUS_NEED_MORE_INFO => 'NeedMoreInformation',
self::STATUS_WAITING => 'Suspended',
self::STATUS_CLOSED => 'Closed',
self::STATUS_CANCELED => 'Canceled'
);
@ -302,8 +302,8 @@ class Ticket extends CommonObject
self::STATUS_READ => 'Read',
self::STATUS_ASSIGNED => 'Assigned',
self::STATUS_IN_PROGRESS => 'InProgress',
self::STATUS_WAITING => 'OnHold',
self::STATUS_NEED_MORE_INFO => 'NeedMoreInformation',
self::STATUS_WAITING => 'Suspended',
self::STATUS_CLOSED => 'Closed',
self::STATUS_CANCELED => 'Canceled'
);
@ -1244,8 +1244,8 @@ class Ticket extends CommonObject
/**
* Return status label of object
*
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
* @return string Label
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
* @return string Label
*/
public function getLibStatut($mode = 0)
{
@ -1259,9 +1259,10 @@ class Ticket extends CommonObject
*
* @param string $status Id status
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
* @param int $notooltip 1=No tooltip
* @return string Label
*/
public function LibStatut($status, $mode = 0)
public function LibStatut($status, $mode = 0, $notooltip = 0)
{
// phpcs:enable
global $langs;
@ -1274,13 +1275,13 @@ class Ticket extends CommonObject
} elseif ($status == self::STATUS_READ) {
$statusType = 'status1';
} elseif ($status == self::STATUS_ASSIGNED) {
$statusType = 'status3';
$statusType = 'status2';
} elseif ($status == self::STATUS_IN_PROGRESS) {
$statusType = 'status4';
} elseif ($status == self::STATUS_WAITING) {
$statusType = 'status3';
$statusType = 'status7';
} elseif ($status == self::STATUS_NEED_MORE_INFO) {
$statusType = 'status9';
$statusType = 'status3';
} elseif ($status == self::STATUS_CANCELED) {
$statusType = 'status9';
} elseif ($status == self::STATUS_CLOSED) {
@ -1292,7 +1293,12 @@ class Ticket extends CommonObject
$mode = 0;
}
return dolGetStatus($langs->trans($labelStatus), $langs->trans($labelStatusShort), '', $statusType, $mode);
$params = array();
if ($notooltip) {
$params = array('tooltip' => 'no');
}
return dolGetStatus($langs->trans($labelStatus), $langs->trans($labelStatusShort), '', $statusType, $mode, '', $params);
}

View File

@ -186,21 +186,21 @@ if ($result) {
$dataseries = array();
$colorseries = array();
$dataseries[] = array('label' => $langs->trans("Unread"), 'data' => round($tick['unread']));
$dataseries[] = array('label' => $langs->transnoentitiesnoconv($tickesupstatic->statuts_short[Ticket::STATUS_NOT_READ]), 'data' => round($tick['unread']));
$colorseries[Ticket::STATUS_NOT_READ] = '-'.$badgeStatus0;
$dataseries[] = array('label' => $langs->trans("Read"), 'data' => round($tick['read']));
$dataseries[] = array('label' => $langs->transnoentitiesnoconv($tickesupstatic->statuts_short[Ticket::STATUS_READ]), 'data' => round($tick['read']));
$colorseries[Ticket::STATUS_READ] = $badgeStatus1;
$dataseries[] = array('label' => $langs->trans("Assigned"), 'data' => round($tick['assigned']));
$dataseries[] = array('label' => $langs->transnoentitiesnoconv($tickesupstatic->statuts_short[Ticket::STATUS_ASSIGNED]), 'data' => round($tick['assigned']));
$colorseries[Ticket::STATUS_ASSIGNED] = $badgeStatus3;
$dataseries[] = array('label' => $langs->trans("InProgress"), 'data' => round($tick['inprogress']));
$dataseries[] = array('label' => $langs->transnoentitiesnoconv($tickesupstatic->statuts_short[Ticket::STATUS_IN_PROGRESS]), 'data' => round($tick['inprogress']));
$colorseries[Ticket::STATUS_IN_PROGRESS] = $badgeStatus4;
$dataseries[] = array('label' => $langs->trans("Suspended"), 'data' => round($tick['waiting']));
$colorseries[Ticket::STATUS_WAITING] = '-'.$badgeStatus3;
$dataseries[] = array('label' => $langs->trans("NeedMoreInformation"), 'data' => round($tick['needmoreinfo']));
$colorseries[Ticket::STATUS_NEED_MORE_INFO] = $badgeStatus9;
$dataseries[] = array('label' => $langs->trans("Canceled"), 'data' => round($tick['canceled']));
$dataseries[] = array('label' => $langs->transnoentitiesnoconv($tickesupstatic->statuts_short[Ticket::STATUS_WAITING]), 'data' => round($tick['waiting']));
$colorseries[Ticket::STATUS_WAITING] = '-'.$badgeStatus4;
$dataseries[] = array('label' => $langs->transnoentitiesnoconv($tickesupstatic->statuts_short[Ticket::STATUS_NEED_MORE_INFO]), 'data' => round($tick['needmoreinfo']));
$colorseries[Ticket::STATUS_NEED_MORE_INFO] = '-'.$badgeStatus3;
$dataseries[] = array('label' => $langs->transnoentitiesnoconv($tickesupstatic->statuts_short[Ticket::STATUS_CANCELED]), 'data' => round($tick['canceled']));
$colorseries[Ticket::STATUS_CANCELED] = $badgeStatus9;
$dataseries[] = array('label' => $langs->trans("Closed"), 'data' => round($tick['closed']));
$dataseries[] = array('label' => $langs->transnoentitiesnoconv($tickesupstatic->statuts_short[Ticket::STATUS_CLOSED]), 'data' => round($tick['closed']));
$colorseries[Ticket::STATUS_CLOSED] = $badgeStatus6;
} else {
dol_print_error($db);

View File

@ -154,10 +154,10 @@ if ($object->id)
// Login
print '<tr><td class="titlefield">'.$langs->trans("Login").'</td><td class="valeur">'.$object->login.'&nbsp;</td></tr>';
// Nbre files
// Nunber of files
print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td>'.count($filearray).'</td></tr>';
//Total taille
// Total size
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td>'.dol_print_size($totalsize, 1, 1).'</td></tr>';
print '</table>';