forked from Wavyzz/dolibarr
Look and feel v20
This commit is contained in:
@@ -1201,64 +1201,21 @@ if ($action == 'create' || $action == 'presend') {
|
||||
print '<input type="hidden" name="track_id" value="'.$track_id.'">';
|
||||
print '<input type="hidden" name="trackid" value="'.$trackid.'">';
|
||||
|
||||
// Categories
|
||||
if (isModEnabled('category')) {
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border centpercent tableforfield">';
|
||||
print '<tr>';
|
||||
print '<td class="valignmiddle titlefield">';
|
||||
print '<table class="nobordernopadding centpercent"><tr><td class="titlefield">';
|
||||
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>';
|
||||
}
|
||||
print '</table>';
|
||||
print '</td>';
|
||||
|
||||
if ($user->hasRight('ticket', 'write') && $action == 'categories') {
|
||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_TICKET, '', 'parent', 64, 0, 1);
|
||||
if (is_array($cate_arbo)) {
|
||||
// Categories
|
||||
print '<td colspan="3">';
|
||||
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_categories">';
|
||||
|
||||
$category = new Categorie($db);
|
||||
$cats = $category->containing($object->id, 'ticket');
|
||||
$arrayselected = array();
|
||||
foreach ($cats as $cat) {
|
||||
$arrayselected[] = $cat->id;
|
||||
}
|
||||
|
||||
print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
|
||||
print '<input type="submit" class="button button-edit small" value="'.$langs->trans('Save').'">';
|
||||
print '</form>';
|
||||
print "</td>";
|
||||
}
|
||||
} else {
|
||||
print '<td colspan="3">';
|
||||
print $form->showCategories($object->id, Categorie::TYPE_TICKET, 1);
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
}
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
// View Original message
|
||||
$actionobject->viewTicketOriginalMessage($user, $action, $object);
|
||||
|
||||
// Classification of ticket
|
||||
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
|
||||
print '<table class="noborder tableforfield centpercent margintable">';
|
||||
print '<table class="border tableforfield centpercent margintable">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>';
|
||||
print $langs->trans('TicketProperties');
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if (GETPOST('set', 'alpha') == 'properties' && $user->hasRight('ticket', 'write')) {
|
||||
print '<input type="submit" class="button small" name="btn_update_ticket_prop" value="'.$langs->trans("Modify").'" />';
|
||||
print '<input type="submit" class="button smallpaddingimp" name="btn_update_ticket_prop" value="'.$langs->trans("Modify").'" />';
|
||||
} else {
|
||||
// Button to edit Properties
|
||||
if (isset($object->status) && ($object->status < $object::STATUS_NEED_MORE_INFO || getDolGlobalString('TICKET_ALLOW_CLASSIFICATION_MODIFICATION_EVEN_IF_CLOSED')) && $user->hasRight('ticket', 'write')) {
|
||||
@@ -1320,6 +1277,51 @@ if ($action == 'create' || $action == 'presend') {
|
||||
|
||||
print '</form>';
|
||||
|
||||
// Tags/Categories
|
||||
if (isModEnabled('category')) {
|
||||
print '<table class="border centpercent tableforfield">';
|
||||
print '<tr>';
|
||||
print '<td class="valignmiddle titlefield">';
|
||||
print '<table class="nobordernopadding centpercent"><tr><td class="titlefield">';
|
||||
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>';
|
||||
}
|
||||
print '</table>';
|
||||
print '</td>';
|
||||
|
||||
if ($user->hasRight('ticket', 'write') && $action == 'categories') {
|
||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_TICKET, '', 'parent', 64, 0, 1);
|
||||
if (is_array($cate_arbo)) {
|
||||
// Categories
|
||||
print '<td colspan="3">';
|
||||
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_categories">';
|
||||
|
||||
$category = new Categorie($db);
|
||||
$cats = $category->containing($object->id, 'ticket');
|
||||
$arrayselected = array();
|
||||
foreach ($cats as $cat) {
|
||||
$arrayselected[] = $cat->id;
|
||||
}
|
||||
|
||||
print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'maxwidth500 widthcentpercentminusx', 0, 0);
|
||||
print '<input type="submit" class="button button-edit smallpaddingimp" value="'.$langs->trans('Save').'">';
|
||||
print '</form>';
|
||||
print "</td>";
|
||||
}
|
||||
} else {
|
||||
print '<td colspan="3">';
|
||||
print $form->showCategories($object->id, Categorie::TYPE_TICKET, 1);
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
}
|
||||
|
||||
|
||||
// Display navbar with links to change ticket status
|
||||
print '<!-- navbar with status -->';
|
||||
if (!$user->socid && $user->hasRight('ticket', 'write') && isset($object->status) && $object->status < $object::STATUS_CLOSED && GETPOST('set') !== 'properties') {
|
||||
|
||||
@@ -186,7 +186,7 @@ class ActionsTicket extends CommonHookActions
|
||||
*/
|
||||
public function viewTicketOriginalMessage($user, $action, $object)
|
||||
{
|
||||
global $conf, $langs;
|
||||
global $langs;
|
||||
|
||||
print '<!-- initial message of ticket -->'."\n";
|
||||
if ($user->hasRight('ticket', 'manage') && $action == 'edit_message_init') {
|
||||
@@ -199,7 +199,7 @@ class ActionsTicket extends CommonHookActions
|
||||
|
||||
// Initial message
|
||||
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
|
||||
print '<table class="noborder centpercent margintable margintable">';
|
||||
print '<table class="border centpercent margintable margintable">';
|
||||
print '<tr class="liste_titre trforfield"><td class="nowrap titlefield">';
|
||||
print $langs->trans("InitialMessage");
|
||||
print '</td><td>';
|
||||
@@ -234,8 +234,8 @@ class ActionsTicket extends CommonHookActions
|
||||
}
|
||||
if ($user->hasRight('ticket', 'manage') && $action == 'edit_message_init') {
|
||||
print '<div class="center">';
|
||||
print ' <input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
|
||||
print ' <input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print ' <input type="submit" class="button button-edit small" value="'.$langs->trans('Modify').'">';
|
||||
print ' <input type="submit" class="button button-cancel small" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</div>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
Reference in New Issue
Block a user