Merge branch '16.0' of git@github.com:Dolibarr/dolibarr.git into 16.0
This commit is contained in:
commit
7af97386fc
@ -883,8 +883,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
//Default language
|
||||
if (!empty($conf->global->MAIN_MULTILANGS)) {
|
||||
print '<tr><td>'.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).'</td><td colspan="3" class="maxwidthonsmartphone">'."\n";
|
||||
print $formadmin->select_language(GETPOST('default_lang', 'alpha') ?GETPOST('default_lang', 'alpha') : ($object->default_lang ? $object->default_lang : ''), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone', 0, 0, 0, null, 1);
|
||||
|
||||
print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language(GETPOST('default_lang', 'alpha') ? GETPOST('default_lang', 'alpha') : ($object->default_lang ? $object->default_lang : ''), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
@ -1171,8 +1170,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
//Default language
|
||||
if (!empty($conf->global->MAIN_MULTILANGS)) {
|
||||
print '<tr><td>'.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).'</td><td colspan="3" class="maxwidthonsmartphone">'."\n";
|
||||
print $formadmin->select_language($object->default_lang, 'default_lang', 0, 0, 1, 0, 0, '', 0, 0, 0, null, 1);
|
||||
|
||||
print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language(GETPOST('default_lang', 'alpha') ? GETPOST('default_lang', 'alpha') : ($object->default_lang ? $object->default_lang : ''), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
@ -1403,7 +1401,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
//$s=picto_from_langcode($object->default_lang);
|
||||
//print ($s?$s.' ':'');
|
||||
$langs->load("languages");
|
||||
$labellang = ($object->default_lang ? $langs->trans('Language_'.$object->default_lang.'_'.strtoupper($object->default_lang)) : '');
|
||||
$labellang = ($object->default_lang ? $langs->trans('Language_'.$object->default_lang) : '');
|
||||
print picto_from_langcode($object->default_lang, 'class="paddingrightonly saturatemedium opacitylow"');
|
||||
print $labellang;
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@ -1552,10 +1552,10 @@ function complete_elementList_with_modules(&$elementList)
|
||||
|
||||
// We discard modules according to features level (PS: if module is activated we always show it)
|
||||
$const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', get_class($objMod)));
|
||||
if ($objMod->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2 && !$conf->global->$const_name) {
|
||||
if ($objMod->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2 && getDolGlobalString($const_name)) {
|
||||
$modulequalified = 0;
|
||||
}
|
||||
if ($objMod->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1 && !$conf->global->$const_name) {
|
||||
if ($objMod->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1 && getDolGlobalString($const_name)) {
|
||||
$modulequalified = 0;
|
||||
}
|
||||
//If module is not activated disqualified
|
||||
|
||||
@ -123,7 +123,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
|
||||
$texte .= '<input type="hidden" name="page_y" value="">';
|
||||
$texte .= '<input type="hidden" name="action" value="setModuleOptions">';
|
||||
$texte .= '<input type="hidden" name="param1" value="USERGROUP_ADDON_PDF_ODT_PATH">';
|
||||
if ($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT > 0) {
|
||||
if (!empty($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT)) {
|
||||
$texte .= '<input type="hidden" name="param2" value="USERGROUP_ADDON_PDF_ODT_DEFAULT">';
|
||||
$texte .= '<input type="hidden" name="param3" value="USERGROUP_ADDON_PDF_ODT_TOBILL">';
|
||||
$texte .= '<input type="hidden" name="param4" value="USERGROUP_ADDON_PDF_ODT_CLOSED">';
|
||||
@ -169,7 +169,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
|
||||
if (count($listofdir)) {
|
||||
$texte .= $langs->trans("NumberOfModelFilesFound").': <b>'.count($listoffiles).'</b>';
|
||||
|
||||
if ($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT > 0) {
|
||||
if (!empty($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT)) {
|
||||
// Model for creation
|
||||
$list = ModelePDFUserGroup::liste_modeles($this->db);
|
||||
$texte .= '<table width="50%;">';
|
||||
|
||||
@ -99,13 +99,12 @@ if (!$sortorder) {
|
||||
$search_all = GETPOST('search_all', 'alphanohtml');
|
||||
$search = array();
|
||||
foreach ($object->fields as $key => $val) {
|
||||
if (GETPOST('search_'.$key, 'alpha') !== '') {
|
||||
if ($key == "lang") {
|
||||
$search[$key] = GETPOST('search_'.$key, 'alpha')!='0' ? GETPOST('search_'.$key, 'alpha') : '';
|
||||
} else {
|
||||
$search[$key] = GETPOST('search_'.$key, 'alpha');
|
||||
}
|
||||
if ($key == "lang") {
|
||||
$search[$key] = GETPOST('search_'.$key, 'alpha')!='0' ? GETPOST('search_'.$key, 'alpha') : '';
|
||||
} else {
|
||||
$search[$key] = GETPOST('search_'.$key, 'alpha');
|
||||
}
|
||||
|
||||
if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
|
||||
$search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int'));
|
||||
$search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int'));
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
* Copyright (C) 2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2022 Charlene Benke <charlene@patas-monkey.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -206,7 +207,7 @@ if (empty($reshook)) {
|
||||
$fk_user_assign = GETPOST("fk_user_assign", 'int');
|
||||
if ($fk_user_assign > 0) {
|
||||
$object->fk_user_assign = $fk_user_assign;
|
||||
$object->fk_status = $object::STATUS_ASSIGNED;
|
||||
$object->status = $object::STATUS_ASSIGNED;
|
||||
}
|
||||
|
||||
$object->fk_project = $projectid;
|
||||
@ -286,7 +287,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'update' && $user->rights->ticket->write && $object->fk_status < Ticket::STATUS_CLOSED) {
|
||||
if ($action == 'update' && $user->rights->ticket->write && $object->status < Ticket::STATUS_CLOSED) {
|
||||
$error = 0;
|
||||
|
||||
$ret = $object->fetch(GETPOST('id', 'int'), GETPOST('ref', 'alpha'), GETPOST('track_id', 'alpha'));
|
||||
@ -548,7 +549,7 @@ if (empty($reshook)) {
|
||||
if ($action == 'confirm_reopen' && $user->rights->ticket->manage && !GETPOST('cancel')) {
|
||||
if ($object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) {
|
||||
// prevent browser refresh from reopening ticket several times
|
||||
if ($object->fk_status == Ticket::STATUS_CLOSED || $object->fk_status == Ticket::STATUS_CANCELED) {
|
||||
if ($object->status == Ticket::STATUS_CLOSED || $object->status == Ticket::STATUS_CANCELED) {
|
||||
$res = $object->setStatut(Ticket::STATUS_ASSIGNED);
|
||||
if ($res) {
|
||||
// Log action in ticket logs table
|
||||
@ -607,7 +608,7 @@ if (empty($reshook)) {
|
||||
// Reopen ticket
|
||||
if ($object->fetch(GETPOST('id', 'int'), GETPOST('track_id', 'alpha')) >= 0) {
|
||||
$new_status = GETPOST('new_status', 'int');
|
||||
$old_status = $object->fk_status;
|
||||
$old_status = $object->status;
|
||||
$res = $object->setStatut($new_status);
|
||||
if ($res) {
|
||||
// Log action in ticket logs table
|
||||
@ -726,7 +727,7 @@ if ($action == 'create' || $action == 'presend') {
|
||||
$formticket->withcancel = 1;
|
||||
|
||||
$formticket->showForm(1, 'create', 0);
|
||||
/*} elseif ($action == 'edit' && $user->rights->ticket->write && $object->fk_status < Ticket::STATUS_CLOSED) {
|
||||
/*} elseif ($action == 'edit' && $user->rights->ticket->write && $object->status < Ticket::STATUS_CLOSED) {
|
||||
$formticket = new FormTicket($db);
|
||||
|
||||
$head = ticket_prepare_head($object);
|
||||
@ -941,7 +942,7 @@ if ($action == 'create' || $action == 'presend') {
|
||||
// Thirdparty
|
||||
if (!empty($conf->societe->enabled)) {
|
||||
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' ';
|
||||
if ($action != 'editcustomer' && $object->fk_status < 8 && !$user->socid && $user->rights->ticket->write) {
|
||||
if ($action != 'editcustomer' && $object->status < 8 && !$user->socid && $user->rights->ticket->write) {
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$url_page_current.'?action=editcustomer&token='.newToken().'&track_id='.$object->track_id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 0).'</a> : ';
|
||||
}
|
||||
if ($action == 'editcustomer') {
|
||||
@ -1058,7 +1059,7 @@ if ($action == 'create' || $action == 'presend') {
|
||||
print '<tr><td>';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td class="nowrap">';
|
||||
print $langs->trans("AssignedTo");
|
||||
if (isset($object->fk_status) && $object->fk_status < $object::STATUS_CLOSED && GETPOST('set', 'alpha') != "assign_ticket" && $user->rights->ticket->manage) {
|
||||
if (isset($object->status) && $object->status < $object::STATUS_CLOSED && GETPOST('set', 'alpha') != "assign_ticket" && $user->rights->ticket->manage) {
|
||||
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 '</td></tr></table>';
|
||||
@ -1069,7 +1070,7 @@ if ($action == 'create' || $action == 'presend') {
|
||||
}
|
||||
|
||||
// Show user list to assignate one if status is "read"
|
||||
if (GETPOST('set', 'alpha') == "assign_ticket" && $object->fk_status < 8 && !$user->socid && $user->rights->ticket->write) {
|
||||
if (GETPOST('set', 'alpha') == "assign_ticket" && $object->status < 8 && !$user->socid && $user->rights->ticket->write) {
|
||||
print '<form method="post" name="ticket" enctype="multipart/form-data" action="'.$url_page_current.'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="assign_user">';
|
||||
@ -1086,7 +1087,7 @@ if ($action == 'create' || $action == 'presend') {
|
||||
print '<table class="nobordernopadding centpercent"><tr><td class="nowrap">';
|
||||
print $langs->trans('Progression').'</td><td class="left">';
|
||||
print '</td>';
|
||||
if ($action != 'progression' && isset($object->fk_status) && $object->fk_status < $object::STATUS_CLOSED && !$user->socid) {
|
||||
if ($action != 'progression' && isset($object->status) && $object->status < $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>';
|
||||
@ -1204,7 +1205,7 @@ if ($action == 'create' || $action == 'presend') {
|
||||
print '<input type="submit" class="button small" name="btn_update_ticket_prop" value="'.$langs->trans("Modify").'" />';
|
||||
} else {
|
||||
// Button to edit Properties
|
||||
if (isset($object->fk_status) && $object->fk_status < $object::STATUS_NEED_MORE_INFO && $user->rights->ticket->write) {
|
||||
if (isset($object->status) && $object->status < $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>';
|
||||
}
|
||||
}
|
||||
@ -1263,7 +1264,7 @@ if ($action == 'create' || $action == 'presend') {
|
||||
|
||||
// Display navbar with links to change ticket status
|
||||
print '<!-- navbar with status -->';
|
||||
if (!$user->socid && $user->rights->ticket->write && isset($object->fk_status) && $object->fk_status < $object::STATUS_CLOSED && GETPOST('set') !== 'properties') {
|
||||
if (!$user->socid && $user->rights->ticket->write && isset($object->status) && $object->status < $object::STATUS_CLOSED && GETPOST('set') !== 'properties') {
|
||||
$actionobject->viewStatusActions($object);
|
||||
}
|
||||
|
||||
@ -1350,7 +1351,7 @@ if ($action == 'create' || $action == 'presend') {
|
||||
print '</div>';
|
||||
|
||||
print '<div class="tagtd center">';
|
||||
if ($object->statut >= 0) {
|
||||
if ($object->status >= 0) {
|
||||
echo '<a href="contact.php?track_id='.$object->track_id.'&action=swapstatut&ligne='.$tab[$i]['rowid'].'">';
|
||||
}
|
||||
|
||||
@ -1366,7 +1367,7 @@ if ($action == 'create' || $action == 'presend') {
|
||||
$contactstatic->firstname = $tab[$i]['firstname'];
|
||||
echo $contactstatic->LibStatut($tab[$i]['statuscontact'], 3);
|
||||
}
|
||||
if ($object->statut >= 0) {
|
||||
if ($object->status >= 0) {
|
||||
echo '</a>';
|
||||
}
|
||||
|
||||
@ -1399,7 +1400,7 @@ if ($action == 'create' || $action == 'presend') {
|
||||
|
||||
if (empty($reshook)) {
|
||||
// Show link to add a message (if read and not closed)
|
||||
if (isset($object->fk_status) && $object->fk_status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage") {
|
||||
if (isset($object->status) && $object->status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage") {
|
||||
print dolGetButtonAction('', $langs->trans('TicketAddMessage'), 'default', $_SERVER["PHP_SELF"].'?action=presend_addmessage&mode=init&token='.newToken().'&track_id='.$object->track_id, '');
|
||||
}
|
||||
|
||||
@ -1408,28 +1409,28 @@ if ($action == 'create' || $action == 'presend') {
|
||||
if (!$object->fk_soc && $user->hasRight("ficheinter", "creer")) {
|
||||
print dolGetButtonAction($langs->trans('UnableToCreateInterIfNoSocid'), $langs->trans('TicketAddIntervention'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
|
||||
}
|
||||
if ($object->fk_soc > 0 && isset($object->fk_status) && $object->fk_status < Ticket::STATUS_CLOSED && $user->rights->ficheinter->creer) {
|
||||
if ($object->fk_soc > 0 && isset($object->status) && $object->status < Ticket::STATUS_CLOSED && $user->rights->ficheinter->creer) {
|
||||
print dolGetButtonAction('', $langs->trans('TicketAddIntervention'), 'default', DOL_URL_ROOT.'/fichinter/card.php?action=create&token='.newToken().'&socid='. $object->fk_soc.'&origin=ticket_ticket&originid='. $object->id, '');
|
||||
}
|
||||
|
||||
/* This is useless. We can already modify each field individually
|
||||
if ($user->rights->ticket->write && $object->fk_status < Ticket::STATUS_CLOSED) {
|
||||
if ($user->rights->ticket->write && $object->status < Ticket::STATUS_CLOSED) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?track_id='.$object->track_id.'&action=edit&token='.newToken().'">'.$langs->trans('Modify').'</a></div>';
|
||||
}
|
||||
*/
|
||||
|
||||
// Close ticket if statut is read
|
||||
if (isset($object->fk_status) && $object->fk_status > 0 && $object->fk_status < Ticket::STATUS_CLOSED && $user->rights->ticket->write) {
|
||||
if (isset($object->status) && $object->status > 0 && $object->status < Ticket::STATUS_CLOSED && $user->rights->ticket->write) {
|
||||
print dolGetButtonAction('', $langs->trans('CloseTicket'), 'default', $_SERVER["PHP_SELF"].'?action=close&token='.newToken().'&track_id='.$object->track_id, '');
|
||||
}
|
||||
|
||||
// Abadon ticket if statut is read
|
||||
if (isset($object->fk_status) && $object->fk_status > 0 && $object->fk_status < Ticket::STATUS_CLOSED && $user->rights->ticket->write) {
|
||||
if (isset($object->status) && $object->status > 0 && $object->status < Ticket::STATUS_CLOSED && $user->rights->ticket->write) {
|
||||
print dolGetButtonAction('', $langs->trans('AbandonTicket'), 'default', $_SERVER["PHP_SELF"].'?action=abandon&token='.newToken().'&track_id='.$object->track_id, '');
|
||||
}
|
||||
|
||||
// Re-open ticket
|
||||
if (!$user->socid && (isset($object->fk_status) && ($object->fk_status == Ticket::STATUS_CLOSED || $object->fk_status == Ticket::STATUS_CANCELED)) && !$user->socid) {
|
||||
if (!$user->socid && (isset($object->status) && ($object->status == Ticket::STATUS_CLOSED || $object->status == Ticket::STATUS_CANCELED)) && !$user->socid) {
|
||||
print dolGetButtonAction('', $langs->trans('ReOpen'), 'default', $_SERVER["PHP_SELF"].'?action=reopen&token='.newToken().'&track_id='.$object->track_id, '');
|
||||
}
|
||||
|
||||
@ -1533,12 +1534,12 @@ if ($action == 'create' || $action == 'presend') {
|
||||
$morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 1);
|
||||
|
||||
// Show link to add a message (if read and not closed)
|
||||
$btnstatus = $object->fk_status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage" && $action != "add_message";
|
||||
$btnstatus = $object->status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage" && $action != "add_message";
|
||||
$url = 'card.php?track_id='.$object->track_id.'&action=presend_addmessage&mode=init';
|
||||
$morehtmlright .= dolGetButtonTitle($langs->trans('TicketAddMessage'), '', 'fa fa-comment-dots', $url, 'add-new-ticket-title-button', $btnstatus);
|
||||
|
||||
// Show link to add event (if read and not closed)
|
||||
$btnstatus = $object->fk_status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage" && $action != "add_message"; ;
|
||||
$btnstatus = $object->status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage" && $action != "add_message"; ;
|
||||
$url = dol_buildpath('/comm/action/card.php', 1).'?action=create&datep='.date('YmdHi').'&origin=ticket&originid='.$object->id.'&projectid='.$object->fk_project.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id);
|
||||
$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', $url, 'add-new-ticket-even-button', $btnstatus);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user