Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into
develop FIX #19013
This commit is contained in:
parent
e1047afb05
commit
d5130f2541
@ -1788,13 +1788,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
|
||||
print '<table class="border tableforfield tableforfield centpercent">';
|
||||
|
||||
// Birth Date
|
||||
print '<tr><td class="titlefield">'.$langs->trans("DateOfBirth").'</td><td class="valeur">'.dol_print_date($object->birth, 'day').'</td></tr>';
|
||||
|
||||
// Public
|
||||
print '<tr><td>'.$langs->trans("Public").'</td><td class="valeur">'.yn($object->public).'</td></tr>';
|
||||
|
||||
// Categories
|
||||
// Tags / Categories
|
||||
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
|
||||
print '<tr><td>'.$langs->trans("Categories").'</td>';
|
||||
print '<td colspan="2">';
|
||||
@ -1802,6 +1796,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Birth Date
|
||||
print '<tr><td class="titlefield">'.$langs->trans("DateOfBirth").'</td><td class="valeur">'.dol_print_date($object->birth, 'day').'</td></tr>';
|
||||
|
||||
// Public
|
||||
print '<tr><td>'.$langs->trans("Public").'</td><td class="valeur">'.yn($object->public).'</td></tr>';
|
||||
|
||||
// Other attributes
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
|
||||
@ -618,7 +618,7 @@ if (empty($reshook)) {
|
||||
if ($ret > 0) {
|
||||
$log_action = $langs->trans('TicketInitialMessageModified')." \n";
|
||||
// include the Diff class
|
||||
dol_include_once('/ticket/class/utils_diff.class.php');
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/utils_diff.class.php';
|
||||
// output the result of comparing two files as plain text
|
||||
$log_action .= Diff::toString(Diff::compare(strip_tags($oldvalue_message), strip_tags($object->message)));
|
||||
|
||||
@ -1048,11 +1048,11 @@ if ($action == 'create' || $action == 'presend') {
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td class="nowrap">';
|
||||
print $langs->trans("AssignedTo");
|
||||
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 '</td><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>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td></tr></table>';
|
||||
print '</td><td>';
|
||||
if ($object->fk_user_assign > 0) {
|
||||
if (GETPOST('set', 'alpha') != "assign_ticket" && $object->fk_user_assign > 0) {
|
||||
$userstat->fetch($object->fk_user_assign);
|
||||
print $userstat->getNomUrl(-1);
|
||||
}
|
||||
@ -1063,30 +1063,30 @@ if ($action == 'create' || $action == 'presend') {
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="assign_user">';
|
||||
print '<input type="hidden" name="track_id" value="'.$object->track_id.'">';
|
||||
print '<label for="fk_user_assign">'.$langs->trans("AssignUser").'</label> ';
|
||||
//print '<label for="fk_user_assign">'.$langs->trans("AssignUser").'</label> ';
|
||||
print $form->select_dolusers($user->id, 'fk_user_assign', 1);
|
||||
print ' <input type="submit" class="button" name="btn_assign_user" value="'.$langs->trans("Validate").'" />';
|
||||
print ' <input type="submit" class="button small" name="btn_assign_user" value="'.$langs->trans("Validate").'" />';
|
||||
print '</form>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Progression
|
||||
print '<tr><td>';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td class="nowrap">';
|
||||
print '<table class="nobordernopadding centpercent"><tr><td class="nowrap">';
|
||||
print $langs->trans('Progression').'</td><td class="left">';
|
||||
print '</td>';
|
||||
if ($action != 'progression' && $object->fk_statut < $object::STATUS_CLOSED && !$user->socid) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$url_page_current.'?action=progression&track_id='.$object->track_id.'">'.img_edit($langs->trans('Modify')).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="5">';
|
||||
print '</td><td>';
|
||||
if ($user->rights->ticket->write && $action == 'progression') {
|
||||
print '<form action="'.$url_page_current.'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="track_id" value="'.$track_id.'">';
|
||||
print '<input type="hidden" name="action" value="set_progression">';
|
||||
print '<input type="text" class="flat" size="20" name="progress" value="'.$object->progress.'">';
|
||||
print ' <input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
|
||||
print '<input type="text" class="flat width75" name="progress" value="'.$object->progress.'">';
|
||||
print ' <input type="submit" class="button button-edit small" value="'.$langs->trans('Modify').'">';
|
||||
print '</form>';
|
||||
} else {
|
||||
print($object->progress > 0 ? $object->progress : '0').'%';
|
||||
@ -1095,32 +1095,53 @@ if ($action == 'create' || $action == 'presend') {
|
||||
print '</tr>';
|
||||
|
||||
// Timing (Duration sum of linked fichinter)
|
||||
if ($conf->ficheinter->enabled) {
|
||||
if (!empty($conf->ficheinter->enabled)) {
|
||||
$object->fetchObjectLinked();
|
||||
$num = count($object->linkedObjects);
|
||||
$timing = 0;
|
||||
$foundinter = 0;
|
||||
if ($num) {
|
||||
foreach ($object->linkedObjects as $objecttype => $objects) {
|
||||
if ($objecttype = "fichinter") {
|
||||
foreach ($objects as $fichinter) {
|
||||
$foundinter++;
|
||||
$timing += $fichinter->duration;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
print '<tr><td valign="top">';
|
||||
|
||||
print '<tr><td>';
|
||||
print $form->textwithpicto($langs->trans("TicketDurationAuto"), $langs->trans("TicketDurationAutoInfos"), 1);
|
||||
print '</td><td>';
|
||||
print convertSecondToTime($timing, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY);
|
||||
print $foundinter ? convertSecondToTime($timing, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY) : '';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Other attributes
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
// Fin colonne gauche et début colonne droite
|
||||
print '</div><div class="fichehalfright">';
|
||||
|
||||
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="track_id" value="'.$track_id.'">';
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
// Categories
|
||||
if ($conf->categorie->enabled) {
|
||||
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="border tableforfield centpercent noborderbottom">';
|
||||
|
||||
print '<tr>';
|
||||
print '<td class="valignmiddle">';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td class="nowrap">';
|
||||
print '<td class="valignmiddle titlefield">';
|
||||
print '<table class="nobordernopadding centpercent"><tr><td class="nowrap">';
|
||||
print $langs->trans("Categories");
|
||||
if ($action != 'categories' && !$user->socid) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$url_page_current.'?action=categories&track_id='.$object->track_id.'">'.img_edit($langs->trans('Modify')).'</a></td>';
|
||||
@ -1130,7 +1151,7 @@ if ($action == 'create' || $action == 'presend') {
|
||||
|
||||
if ($user->rights->ticket->write && $action == 'categories') {
|
||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_TICKET, '', 'parent', 64, 0, 1);
|
||||
if (count($cate_arbo)) {
|
||||
if (is_array($cate_arbo)) {
|
||||
// Categories
|
||||
print '<td colspan="3">';
|
||||
print '<form action="'.$url_page_current.'" method="post">';
|
||||
@ -1146,7 +1167,7 @@ if ($action == 'create' || $action == 'presend') {
|
||||
}
|
||||
|
||||
print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
|
||||
print '<input type="submit" class="button button-edit" value="'.$langs->trans('Save').'">';
|
||||
print '<input type="submit" class="button button-edit small" value="'.$langs->trans('Save').'">';
|
||||
print '</form>';
|
||||
print "</td>";
|
||||
}
|
||||
@ -1155,27 +1176,15 @@ if ($action == 'create' || $action == 'presend') {
|
||||
print $form->showCategories($object->id, Categorie::TYPE_TICKET, 1);
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
}
|
||||
|
||||
// Other attributes
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
// Fin colonne gauche et début colonne droite
|
||||
print '</div><div class="fichehalfright">';
|
||||
|
||||
|
||||
// View Original message
|
||||
$actionobject->viewTicketOriginalMessage($user, $action, $object);
|
||||
|
||||
// Classification of ticket
|
||||
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="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
|
||||
print '<table class="noborder tableforfield centpercent margintable">';
|
||||
print '<tr class="liste_titre">';
|
||||
@ -1184,11 +1193,11 @@ if ($action == 'create' || $action == 'presend') {
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if (GETPOST('set', 'alpha') == 'properties' && $user->rights->ticket->write) {
|
||||
print '<input type="submit" class="button" name="btn_update_ticket_prop" value="'.$langs->trans("Modify").'" />';
|
||||
print '<input type="submit" class="button small" name="btn_update_ticket_prop" value="'.$langs->trans("Modify").'" />';
|
||||
} else {
|
||||
// Button to edit Properties
|
||||
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>';
|
||||
print ' <a class="editfielda" href="card.php?track_id='.$object->track_id.'&action=view&set=properties">'.img_edit($langs->trans('Modify')).'</a>';
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
@ -1198,7 +1207,7 @@ if ($action == 'create' || $action == 'presend') {
|
||||
print '<tr>';
|
||||
// Type
|
||||
print '<td class="titlefield">';
|
||||
print $langs->trans('TicketChangeType');
|
||||
print $langs->trans('Type');
|
||||
print '</td><td>';
|
||||
$formticket->selectTypesTickets($object->type_code, 'update_value_type', '', 2);
|
||||
print '</td>';
|
||||
@ -1206,15 +1215,15 @@ if ($action == 'create' || $action == 'presend') {
|
||||
// Group
|
||||
print '<tr>';
|
||||
print '<td>';
|
||||
print $langs->trans('TicketChangeCategory');
|
||||
print $langs->trans('TicketCategory');
|
||||
print '</td><td>';
|
||||
$formticket->selectGroupTickets($object->category_code, 'update_value_category', '', 2);
|
||||
$formticket->selectGroupTickets($object->category_code, 'update_value_category', '', 2, 0, 0, 0, 'maxwidth500');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
// Severity
|
||||
print '<tr>';
|
||||
print '<td>';
|
||||
print $langs->trans('TicketChangeSeverity');
|
||||
print $langs->trans('TicketSeverity');
|
||||
print '</td><td>';
|
||||
$formticket->selectSeveritiesTickets($object->severity_code, 'update_value_severity', '', 2);
|
||||
print '</td>';
|
||||
|
||||
@ -1258,12 +1258,12 @@ 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, 6=Long 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)
|
||||
{
|
||||
return $this->libStatut($this->fk_statut, $mode);
|
||||
return $this->libStatut($this->fk_statut, $mode, 0, $this->progress);
|
||||
}
|
||||
|
||||
|
||||
@ -1274,9 +1274,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
|
||||
* @param int $progress Progression (0 to 100)
|
||||
* @return string Label
|
||||
*/
|
||||
public function LibStatut($status, $mode = 0, $notooltip = 0)
|
||||
public function LibStatut($status, $mode = 0, $notooltip = 0, $progress = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
@ -1312,7 +1313,15 @@ class Ticket extends CommonObject
|
||||
$params = array('tooltip' => 'no');
|
||||
}
|
||||
|
||||
return dolGetStatus($langs->transnoentitiesnoconv($labelStatus), $langs->transnoentitiesnoconv($labelStatusShort), '', $statusType, $mode, '', $params);
|
||||
$labelStatus = $langs->transnoentitiesnoconv($labelStatus);
|
||||
$labelStatusShort = $langs->transnoentitiesnoconv($labelStatusShort);
|
||||
|
||||
if ($status == self::STATUS_IN_PROGRESS && $progress > 0) {
|
||||
$labelStatus .= ' ('.round($progress).'%)';
|
||||
$labelStatusShort .= ' ('.round($progress).'%)';
|
||||
}
|
||||
|
||||
return dolGetStatus($labelStatus, $labelStatusShort, '', $statusType, $mode, '', $params);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user