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">';
|
print '<table class="border tableforfield tableforfield centpercent">';
|
||||||
|
|
||||||
// Birth Date
|
// Tags / Categories
|
||||||
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
|
|
||||||
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
|
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
|
||||||
print '<tr><td>'.$langs->trans("Categories").'</td>';
|
print '<tr><td>'.$langs->trans("Categories").'</td>';
|
||||||
print '<td colspan="2">';
|
print '<td colspan="2">';
|
||||||
@ -1802,6 +1796,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
print '</td></tr>';
|
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
|
// Other attributes
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
||||||
|
|
||||||
|
|||||||
@ -618,7 +618,7 @@ if (empty($reshook)) {
|
|||||||
if ($ret > 0) {
|
if ($ret > 0) {
|
||||||
$log_action = $langs->trans('TicketInitialMessageModified')." \n";
|
$log_action = $langs->trans('TicketInitialMessageModified')." \n";
|
||||||
// include the Diff class
|
// 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
|
// output the result of comparing two files as plain text
|
||||||
$log_action .= Diff::toString(Diff::compare(strip_tags($oldvalue_message), strip_tags($object->message)));
|
$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 '<table class="nobordernopadding" width="100%"><tr><td class="nowrap">';
|
||||||
print $langs->trans("AssignedTo");
|
print $langs->trans("AssignedTo");
|
||||||
if ($object->fk_statut < $object::STATUS_CLOSED && 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 '</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>';
|
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);
|
$userstat->fetch($object->fk_user_assign);
|
||||||
print $userstat->getNomUrl(-1);
|
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="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="assign_user">';
|
print '<input type="hidden" name="action" value="assign_user">';
|
||||||
print '<input type="hidden" name="track_id" value="'.$object->track_id.'">';
|
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 $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 '</form>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Progression
|
// Progression
|
||||||
print '<tr><td>';
|
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 $langs->trans('Progression').'</td><td class="left">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($action != 'progression' && $object->fk_statut < $object::STATUS_CLOSED && !$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&track_id='.$object->track_id.'">'.img_edit($langs->trans('Modify')).'</a></td>';
|
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 '</tr></table>';
|
||||||
print '</td><td colspan="5">';
|
print '</td><td>';
|
||||||
if ($user->rights->ticket->write && $action == 'progression') {
|
if ($user->rights->ticket->write && $action == 'progression') {
|
||||||
print '<form action="'.$url_page_current.'" method="post">';
|
print '<form action="'.$url_page_current.'" method="post">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="track_id" value="'.$track_id.'">';
|
print '<input type="hidden" name="track_id" value="'.$track_id.'">';
|
||||||
print '<input type="hidden" name="action" value="set_progression">';
|
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="text" class="flat width75" name="progress" value="'.$object->progress.'">';
|
||||||
print ' <input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
|
print ' <input type="submit" class="button button-edit small" value="'.$langs->trans('Modify').'">';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
} else {
|
} else {
|
||||||
print($object->progress > 0 ? $object->progress : '0').'%';
|
print($object->progress > 0 ? $object->progress : '0').'%';
|
||||||
@ -1095,32 +1095,53 @@ if ($action == 'create' || $action == 'presend') {
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Timing (Duration sum of linked fichinter)
|
// Timing (Duration sum of linked fichinter)
|
||||||
if ($conf->ficheinter->enabled) {
|
if (!empty($conf->ficheinter->enabled)) {
|
||||||
$object->fetchObjectLinked();
|
$object->fetchObjectLinked();
|
||||||
$num = count($object->linkedObjects);
|
$num = count($object->linkedObjects);
|
||||||
$timing = 0;
|
$timing = 0;
|
||||||
|
$foundinter = 0;
|
||||||
if ($num) {
|
if ($num) {
|
||||||
foreach ($object->linkedObjects as $objecttype => $objects) {
|
foreach ($object->linkedObjects as $objecttype => $objects) {
|
||||||
if ($objecttype = "fichinter") {
|
if ($objecttype = "fichinter") {
|
||||||
foreach ($objects as $fichinter) {
|
foreach ($objects as $fichinter) {
|
||||||
|
$foundinter++;
|
||||||
$timing += $fichinter->duration;
|
$timing += $fichinter->duration;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '<tr><td valign="top">';
|
print '<tr><td>';
|
||||||
|
|
||||||
print $form->textwithpicto($langs->trans("TicketDurationAuto"), $langs->trans("TicketDurationAutoInfos"), 1);
|
print $form->textwithpicto($langs->trans("TicketDurationAuto"), $langs->trans("TicketDurationAutoInfos"), 1);
|
||||||
print '</td><td>';
|
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>';
|
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
|
// Categories
|
||||||
if ($conf->categorie->enabled) {
|
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 '<tr>';
|
||||||
print '<td class="valignmiddle">';
|
print '<td class="valignmiddle titlefield">';
|
||||||
print '<table class="nobordernopadding" width="100%"><tr><td class="nowrap">';
|
print '<table class="nobordernopadding centpercent"><tr><td class="nowrap">';
|
||||||
print $langs->trans("Categories");
|
print $langs->trans("Categories");
|
||||||
if ($action != 'categories' && !$user->socid) {
|
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>';
|
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') {
|
if ($user->rights->ticket->write && $action == 'categories') {
|
||||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_TICKET, '', 'parent', 64, 0, 1);
|
$cate_arbo = $form->select_all_categories(Categorie::TYPE_TICKET, '', 'parent', 64, 0, 1);
|
||||||
if (count($cate_arbo)) {
|
if (is_array($cate_arbo)) {
|
||||||
// Categories
|
// Categories
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
print '<form action="'.$url_page_current.'" method="post">';
|
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 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 '</form>';
|
||||||
print "</td>";
|
print "</td>";
|
||||||
}
|
}
|
||||||
@ -1155,27 +1176,15 @@ if ($action == 'create' || $action == 'presend') {
|
|||||||
print $form->showCategories($object->id, Categorie::TYPE_TICKET, 1);
|
print $form->showCategories($object->id, Categorie::TYPE_TICKET, 1);
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Other attributes
|
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
}
|
||||||
|
|
||||||
// Fin colonne gauche et début colonne droite
|
|
||||||
print '</div><div class="fichehalfright">';
|
|
||||||
|
|
||||||
|
|
||||||
// View Original message
|
// View Original message
|
||||||
$actionobject->viewTicketOriginalMessage($user, $action, $object);
|
$actionobject->viewTicketOriginalMessage($user, $action, $object);
|
||||||
|
|
||||||
// Classification of ticket
|
// 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 '<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 '<table class="noborder tableforfield centpercent margintable">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
@ -1184,7 +1193,7 @@ if ($action == 'create' || $action == 'presend') {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if (GETPOST('set', 'alpha') == 'properties' && $user->rights->ticket->write) {
|
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 {
|
} else {
|
||||||
// Button to edit Properties
|
// Button to edit Properties
|
||||||
if ($object->fk_statut < $object::STATUS_NEED_MORE_INFO && $user->rights->ticket->write) {
|
if ($object->fk_statut < $object::STATUS_NEED_MORE_INFO && $user->rights->ticket->write) {
|
||||||
@ -1198,7 +1207,7 @@ if ($action == 'create' || $action == 'presend') {
|
|||||||
print '<tr>';
|
print '<tr>';
|
||||||
// Type
|
// Type
|
||||||
print '<td class="titlefield">';
|
print '<td class="titlefield">';
|
||||||
print $langs->trans('TicketChangeType');
|
print $langs->trans('Type');
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
$formticket->selectTypesTickets($object->type_code, 'update_value_type', '', 2);
|
$formticket->selectTypesTickets($object->type_code, 'update_value_type', '', 2);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -1206,15 +1215,15 @@ if ($action == 'create' || $action == 'presend') {
|
|||||||
// Group
|
// Group
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $langs->trans('TicketChangeCategory');
|
print $langs->trans('TicketCategory');
|
||||||
print '</td><td>';
|
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 '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
// Severity
|
// Severity
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $langs->trans('TicketChangeSeverity');
|
print $langs->trans('TicketSeverity');
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
$formticket->selectSeveritiesTickets($object->severity_code, 'update_value_severity', '', 2);
|
$formticket->selectSeveritiesTickets($object->severity_code, 'update_value_severity', '', 2);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -1263,7 +1263,7 @@ class Ticket extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public function getLibStatut($mode = 0)
|
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 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 $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 $notooltip 1=No tooltip
|
||||||
|
* @param int $progress Progression (0 to 100)
|
||||||
* @return string Label
|
* @return string Label
|
||||||
*/
|
*/
|
||||||
public function LibStatut($status, $mode = 0, $notooltip = 0)
|
public function LibStatut($status, $mode = 0, $notooltip = 0, $progress = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
@ -1312,7 +1313,15 @@ class Ticket extends CommonObject
|
|||||||
$params = array('tooltip' => 'no');
|
$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