Merge branch '16.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
2b5205b639
@ -218,7 +218,6 @@ if ($mode == 'setup' && $user->admin) {
|
||||
$tokenobj = null;
|
||||
// Token
|
||||
require_once DOL_DOCUMENT_ROOT.'/includes/OAuth/bootstrap.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/includes/OAuth/bootstrap.php';
|
||||
// Dolibarr storage
|
||||
$storage = new DoliStorage($db, $conf);
|
||||
try {
|
||||
|
||||
@ -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>';
|
||||
}
|
||||
|
||||
@ -73,7 +73,7 @@ if ($type == 'proposal') {
|
||||
$securekeyseed = getDolGlobalString('PROPOSAL_ONLINE_SIGNATURE_SECURITY_TOKEN');
|
||||
}
|
||||
|
||||
if (empty($SECUREKEY) || !dol_verifyHash($securekeyseed.$type.$ref, $SECUREKEY, '0')) {
|
||||
if (empty($SECUREKEY) || !dol_verifyHash($securekeyseed.$type.$ref.(empty($conf->multicompany->enabled) ? '' : $entity), $SECUREKEY, '0')) {
|
||||
http_response_code(403);
|
||||
print 'Bad value for securitykey. Value provided '.dol_escape_htmltag($SECUREKEY).' does not match expected value for ref='.dol_escape_htmltag($ref);
|
||||
exit(-1);
|
||||
|
||||
@ -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
|
||||
|
||||
@ -90,7 +90,7 @@ function getOnlineSignatureUrl($mode, $type, $ref = '', $localorexternal = 1)
|
||||
if ($mode == 1) {
|
||||
$out .= "hash('".$securekeyseed."' + '".$type."' + proposal_ref)";
|
||||
} else {
|
||||
$out .= '&securekey='.dol_hash($securekeyseed.$type.$ref, '0');
|
||||
$out .= '&securekey='.dol_hash($securekeyseed.$type.$ref.(empty($conf->multicompany->enabled) ? '' : $object->entity), '0');
|
||||
}
|
||||
/*
|
||||
if ($mode == 1) {
|
||||
|
||||
@ -199,7 +199,7 @@ if (empty($reshook)) {
|
||||
if ($result <= 0) {
|
||||
dol_print_error($db);
|
||||
}
|
||||
$multicurrency_amountsresttopay[$cursorfacid] = price2num($tmpinvoice->total_ttc - $tmpinvoice->getSommePaiement(1));
|
||||
$multicurrency_amountsresttopay[$cursorfacid] = price2num($tmpinvoice->multicurrency_total_ttc - $tmpinvoice->getSommePaiement(1));
|
||||
if ($multicurrency_amounts[$cursorfacid]) {
|
||||
// Check amount
|
||||
if ($multicurrency_amounts[$cursorfacid] && (abs($multicurrency_amounts[$cursorfacid]) > abs($multicurrency_amountsresttopay[$cursorfacid]))) {
|
||||
|
||||
@ -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'));
|
||||
|
||||
@ -4801,9 +4801,10 @@ class Product extends CommonObject
|
||||
* @param int $id Id of product to search childs of
|
||||
* @param int $firstlevelonly Return only direct child
|
||||
* @param int $level Level of recursing call (start to 1)
|
||||
* @param array $parents Array of all parents of $id
|
||||
* @return array Return array(prodid=>array(0=prodid, 1=>qty, 2=>product type, 3=>label, 4=>incdec, 5=>product ref)
|
||||
*/
|
||||
public function getChildsArbo($id, $firstlevelonly = 0, $level = 1)
|
||||
public function getChildsArbo($id, $firstlevelonly = 0, $level = 1, $parents = array())
|
||||
{
|
||||
global $alreadyfound;
|
||||
|
||||
@ -4821,7 +4822,7 @@ class Product extends CommonObject
|
||||
$sql .= " AND pa.fk_product_fils <> ".((int) $id); // This should not happens, it is to avoid infinite loop if it happens
|
||||
$sql.= " ORDER BY pa.rang";
|
||||
|
||||
dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level, LOG_DEBUG);
|
||||
dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level. ' parents='.$parents, LOG_DEBUG);
|
||||
|
||||
if ($level == 1) {
|
||||
$alreadyfound = array($id=>1); // We init array of found object to start of tree, so if we found it later (should not happened), we stop immediatly
|
||||
@ -4837,7 +4838,9 @@ class Product extends CommonObject
|
||||
while ($rec = $this->db->fetch_array($res)) {
|
||||
if (!empty($alreadyfound[$rec['rowid']])) {
|
||||
dol_syslog(get_class($this).'::getChildsArbo the product id='.$rec['rowid'].' was already found at a higher level in tree. We discard to avoid infinite loop', LOG_WARNING);
|
||||
continue;
|
||||
if (in_array($rec['id'], $parents)) {
|
||||
continue; // We discard this child if it is already found at a higher level in tree in the same branch.
|
||||
}
|
||||
}
|
||||
$alreadyfound[$rec['rowid']] = 1;
|
||||
$prods[$rec['rowid']] = array(
|
||||
@ -4853,7 +4856,7 @@ class Product extends CommonObject
|
||||
//$prods[$this->db->escape($rec['label'])]= array(0=>$rec['id'],1=>$rec['qty'],2=>$rec['fk_product_type']);
|
||||
//$prods[$this->db->escape($rec['label'])]= array(0=>$rec['id'],1=>$rec['qty']);
|
||||
if (empty($firstlevelonly)) {
|
||||
$listofchilds = $this->getChildsArbo($rec['rowid'], 0, $level + 1);
|
||||
$listofchilds = $this->getChildsArbo($rec['rowid'], 0, $level + 1, array_push($parents, $rec['rowid']));
|
||||
foreach ($listofchilds as $keyChild => $valueChild) {
|
||||
$prods[$rec['rowid']]['childs'][$keyChild] = $valueChild;
|
||||
}
|
||||
|
||||
@ -139,7 +139,7 @@ if ($source == 'proposal') {
|
||||
$securekeyseed = getDolGlobalString('PROPOSAL_ONLINE_SIGNATURE_SECURITY_TOKEN');
|
||||
}
|
||||
|
||||
if (!dol_verifyHash($securekeyseed.$type.$ref, $SECUREKEY, '0')) {
|
||||
if (!dol_verifyHash($securekeyseed.$type.$ref.(empty($conf->multicompany->enabled) ? '' : $entity), $SECUREKEY, '0')) {
|
||||
http_response_code(403);
|
||||
print 'Bad value for securitykey. Value provided '.dol_escape_htmltag($SECUREKEY).' does not match expected value for ref='.dol_escape_htmltag($ref);
|
||||
exit(-1);
|
||||
@ -293,7 +293,6 @@ if ($source == 'proposal') {
|
||||
$result = $object->fetch_thirdparty($object->socid);
|
||||
|
||||
// Creditor
|
||||
|
||||
print '<tr class="CTableRow2"><td class="CTableRow2">'.$langs->trans("Creditor");
|
||||
print '</td><td class="CTableRow2">';
|
||||
print img_picto('', 'company', 'class="pictofixedwidth"');
|
||||
@ -302,7 +301,6 @@ if ($source == 'proposal') {
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Debitor
|
||||
|
||||
print '<tr class="CTableRow2"><td class="CTableRow2">'.$langs->trans("ThirdParty");
|
||||
print '</td><td class="CTableRow2">';
|
||||
print img_picto('', 'company', 'class="pictofixedwidth"');
|
||||
@ -310,14 +308,12 @@ if ($source == 'proposal') {
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Amount
|
||||
|
||||
print '<tr class="CTableRow2"><td class="CTableRow2">'.$langs->trans("Amount");
|
||||
print '</td><td class="CTableRow2">';
|
||||
print '<b>'.price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency).'</b>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Object
|
||||
|
||||
$text = '<b>'.$langs->trans("SignatureProposalRef", $object->ref).'</b>';
|
||||
print '<tr class="CTableRow2"><td class="CTableRow2">'.$langs->trans("Designation");
|
||||
print '</td><td class="CTableRow2">'.$text;
|
||||
|
||||
@ -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
|
||||
@ -218,7 +219,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;
|
||||
@ -298,7 +299,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'));
|
||||
@ -560,7 +561,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
|
||||
@ -619,7 +620,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
|
||||
@ -738,7 +739,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);
|
||||
@ -953,7 +954,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') {
|
||||
@ -1070,7 +1071,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>';
|
||||
@ -1081,7 +1082,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">';
|
||||
@ -1098,7 +1099,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>';
|
||||
@ -1216,7 +1217,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>';
|
||||
}
|
||||
}
|
||||
@ -1275,7 +1276,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);
|
||||
}
|
||||
|
||||
@ -1362,7 +1363,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'].'">';
|
||||
}
|
||||
|
||||
@ -1378,7 +1379,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>';
|
||||
}
|
||||
|
||||
@ -1411,7 +1412,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, '');
|
||||
}
|
||||
|
||||
@ -1420,28 +1421,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, '');
|
||||
}
|
||||
|
||||
@ -1545,12 +1546,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);
|
||||
|
||||
|
||||
@ -56,7 +56,6 @@ $projectid = GETPOST('projectid', 'int');
|
||||
$project_ref = GETPOST('project_ref', 'alpha');
|
||||
$search_societe = GETPOST('search_societe', 'alpha');
|
||||
$search_fk_project = GETPOST('search_fk_project', 'int') ?GETPOST('search_fk_project', 'int') : GETPOST('projectid', 'int');
|
||||
$search_fk_status = GETPOST('search_fk_statut', 'array');
|
||||
$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int'));
|
||||
$search_date_end = dol_mktime(23, 59, 59, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
|
||||
$search_dateread_start = dol_mktime(0, 0, 0, GETPOST('search_dateread_startmonth', 'int'), GETPOST('search_dateread_startday', 'int'), GETPOST('search_dateread_startyear', 'int'));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user