Debug v19. Remove some TODO.

This commit is contained in:
Laurent Destailleur 2023-11-09 10:56:13 +01:00
parent 6288b803ea
commit 4cd4221a52
5 changed files with 26 additions and 28 deletions

View File

@ -57,7 +57,7 @@ $modules = array(
'MAILING' => 'FCKeditorForMailing',
'MAIL' => 'FCKeditorForMail',
'TICKET' => 'FCKeditorForTicket',
'SPECIALCHAR' => 'SpecialChar activation',
'SPECIALCHAR' => 'SpecialCharActivation',
);
// Conditions for the option to be offered
$conditions = array(
@ -100,13 +100,9 @@ foreach ($modules as $const => $desc) {
if ($const == 'PRODUCTDESC' && getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) {
dolibarr_set_const($db, "FCKEDITOR_ENABLE_DETAILS", "1", 'chaine', 0, '', $conf->entity);
}
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
if ($action == 'disable_'.strtolower($const)) {
dolibarr_set_const($db, "FCKEDITOR_ENABLE_".$const, "0", 'chaine', 0, '', $conf->entity);
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
}
@ -179,9 +175,9 @@ if (empty($conf->use_javascript_ajax)) {
print '<td class="center centpercent width100">';
$value = (isset($conf->global->$constante) ? $conf->global->$constante : 0);
if ($value == 0) {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=enable_'.strtolower($const).'&token='.newToken().'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=enable_'.strtolower($const).'&token='.newToken().'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
} elseif ($value == 1) {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=disable_'.strtolower($const).'&token='.newToken().'">'.img_picto($langs->trans("Enabled"), 'switch_on').'</a>';
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=disable_'.strtolower($const).'&token='.newToken().'">'.img_picto($langs->trans("Enabled"), 'switch_on').'</a>';
}
print "</td>";

View File

@ -1576,7 +1576,7 @@ class FormTicket
// Attached files
if (!empty($this->withfile)) {
$out = '<tr>';
$out .= '<td width="180">'.$langs->trans("MailFile").'</td>';
$out .= '<td>'.$langs->trans("MailFile").'</td>';
$out .= '<td>';
// TODO Trick to have param removedfile containing nb of image to delete. But this does not works without javascript
$out .= '<input type="hidden" class="removedfilehidden" name="removedfile" value="">'."\n";
@ -1662,7 +1662,7 @@ class FormTicket
//$toolbarname = 'dolibarr_details';
$toolbarname = 'dolibarr_notes';
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor('message', $defaultmessage, '100%', 200, $toolbarname, '', false, $uselocalbrowser, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_5, 70);
$doleditor = new DolEditor('message', $defaultmessage, '100%', 200, $toolbarname, '', false, $uselocalbrowser, getDolGlobalInt('FCKEDITOR_ENABLE_TICKET'), ROWS_5, '90%');
$doleditor->Create();
print '</td></tr>';
@ -1682,7 +1682,7 @@ class FormTicket
print '</table>';
print '<center><br>';
print '<br><center>';
print '<input type="submit" class="button" name="btn_add_message" value="'.$langs->trans("Add").'"';
// Add a javascript test to avoid to forget to submit file before sending email
if ($this->withfile == 2 && !empty($conf->use_javascript_ajax)) {
@ -1697,7 +1697,7 @@ class FormTicket
print '<input type="hidden" name="page_y">'."\n";
print "</form>\n";
print "</form><br>\n";
// Disable enter key if option MAIN_MAILFORM_DISABLE_ENTERKEY is set
if (!empty($conf->global->MAIN_MAILFORM_DISABLE_ENTERKEY)) {

View File

@ -2424,3 +2424,4 @@ ReEncryptDesc=Reencrypt data if not yet encrypted
PasswordFieldEncrypted=%s new record have this field been encrypted
ExtrafieldsDeleted=Extrafields %s has been deleted
LargeModern=Large - Modern
SpecialCharActivation=Enable the button to open a virtual keyboard to enter special characters

View File

@ -182,10 +182,8 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
}
if (!$error && $action == "add_message" && $display_ticket && GETPOSTISSET('btn_add_message')) {
// TODO Add message...
$ret = $object->dao->newMessage($user, $action, 0, 1);
if (!$error) {
$action = 'view_ticket';
}
@ -334,7 +332,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
$fuser = new User($db);
$fuser->fetch($object->dao->fk_user_assign);
print img_picto('', 'user', 'class="pictofixedwidth"');
print $fuser->getFullName($langs, 1);
print $fuser->getFullName($langs, 0);
}
print '</td></tr>';

View File

@ -1708,16 +1708,16 @@ class Ticket extends CommonObject
/**
* Add message into database
*
* @param User $user User that creates
* @param int $notrigger 0=launch triggers after, 1=disable triggers
* @param array $filename_list List of files to attach (full path of filename on file system)
* @param array $mimetype_list List of MIME type of attached files
* @param array $mimefilename_list List of attached file name in message
* @param boolean $send_email Whether the message is sent by email
* @param boolean $public_area 1=Is the public area
* @return int <0 if KO, >0 if OK
* @param User $user User that creates
* @param int $notrigger 0=launch triggers after, 1=disable triggers
* @param array $filename_list List of files to attach (full path of filename on file system)
* @param array $mimetype_list List of MIME type of attached files
* @param array $mimefilename_list List of attached file name in message
* @param boolean $send_email Whether the message is sent by email
* @param int $public_area 0=Default, 1 if we are creating the message from a public area (so we can search contact from email to add it as contact of ticket if TICKET_ASSIGN_CONTACT_TO_MESSAGE is set)
* @return int <0 if KO, >0 if OK
*/
public function createTicketMessage($user, $notrigger = 0, $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array(), $send_email = false, $public_area = false)
public function createTicketMessage($user, $notrigger = 0, $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array(), $send_email = false, $public_area = 0)
{
global $conf, $langs;
$error = 0;
@ -2528,8 +2528,10 @@ class Ticket extends CommonObject
*
* @param User $user User for action
* @param string $action Action string
* @param int $private 1=Message is private. TODO Implement this. What does this means ?
* @param int $public_area 1=Is the public area
* @param int $private 1=Message is private (must not be visible by external users)
* @param int $public_area 0=Default,
* 1=If we are creating the message from a public area, so confirmation email will be sent to the author
* and we can search contact from email to add it as contact of ticket if TICKET_ASSIGN_CONTACT_TO_MESSAGE is set
* @return int <0 if KO, >= 0 if OK
*/
public function newMessage($user, &$action, $private = 1, $public_area = 0)
@ -2856,12 +2858,13 @@ class Ticket extends CommonObject
}
}
// Set status to "answered" if not set yet, but only if internal user and not private message
// Or set status to "answered" if the client has answered and if the ticket has started
// Set status back to "In progress" if not set yet, but only if internal user and not a private message
// Or set status to "In porgress" if the client has answered and if the ticket has started
// So we are sure to leave the STATUS_DRAFT, STATUS_NEED_INFO.
if (($object->status < self::STATUS_IN_PROGRESS && !$user->socid && !$private) ||
($object->status > self::STATUS_IN_PROGRESS && $public_area)
) {
$object->setStatut(3);
$object->setStatut($object::STATUS_IN_PROGRESS);
}
return 1;
} else {