Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts: htdocs/accountancy/bookkeeping/list.php htdocs/core/actions_massactions.inc.php htdocs/core/lib/functions.lib.php htdocs/core/lib/memory.lib.php htdocs/langs/en_US/holiday.lang htdocs/ticket/card.php
This commit is contained in:
commit
a298a845f1
@ -24,6 +24,7 @@
|
|||||||
* \ingroup Accountancy (Double entries)
|
* \ingroup Accountancy (Double entries)
|
||||||
* \brief List operation of book keeping
|
* \brief List operation of book keeping
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancyexport.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancyexport.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||||
@ -333,10 +334,6 @@ if (empty($reshook)) {
|
|||||||
$filter['t.numero_compte<='] = $search_accountancy_code_end;
|
$filter['t.numero_compte<='] = $search_accountancy_code_end;
|
||||||
$param .= '&search_accountancy_code_end='.urlencode($search_accountancy_code_end);
|
$param .= '&search_accountancy_code_end='.urlencode($search_accountancy_code_end);
|
||||||
}
|
}
|
||||||
if (!empty($search_accountancy_aux_code)) {
|
|
||||||
$filter['t.subledger_account'] = $search_accountancy_aux_code;
|
|
||||||
$param .= '&search_accountancy_aux_code='.urlencode($search_accountancy_aux_code);
|
|
||||||
}
|
|
||||||
if (!empty($search_accountancy_aux_code_start)) {
|
if (!empty($search_accountancy_aux_code_start)) {
|
||||||
$filter['t.subledger_account>='] = $search_accountancy_aux_code_start;
|
$filter['t.subledger_account>='] = $search_accountancy_aux_code_start;
|
||||||
$param .= '&search_accountancy_aux_code_start='.urlencode($search_accountancy_aux_code_start);
|
$param .= '&search_accountancy_aux_code_start='.urlencode($search_accountancy_aux_code_start);
|
||||||
@ -533,11 +530,11 @@ if (count($filter) > 0) {
|
|||||||
$sqlwhere[] = $key."='".$db->idate($value)."'";
|
$sqlwhere[] = $key."='".$db->idate($value)."'";
|
||||||
} elseif ($key == 't.doc_date>=' || $key == 't.doc_date<=') {
|
} elseif ($key == 't.doc_date>=' || $key == 't.doc_date<=') {
|
||||||
$sqlwhere[] = $key."'".$db->idate($value)."'";
|
$sqlwhere[] = $key."'".$db->idate($value)."'";
|
||||||
} elseif ($key == 't.numero_compte>=' || $key == 't.numero_compte<=') {
|
} elseif ($key == 't.numero_compte>=' || $key == 't.numero_compte<=' || $key == 't.subledger_account>=' || $key == 't.subledger_account<=') {
|
||||||
$sqlwhere[] = $key."'".$db->escape($value)."'";
|
$sqlwhere[] = $key."'".$db->escape($value)."'";
|
||||||
} elseif ($key == 't.fk_doc' || $key == 't.fk_docdet' || $key == 't.piece_num') {
|
} elseif ($key == 't.fk_doc' || $key == 't.fk_docdet' || $key == 't.piece_num') {
|
||||||
$sqlwhere[] = $key.'='.((int) $value);
|
$sqlwhere[] = $key.'='.((int) $value);
|
||||||
} elseif ($key == 't.numero_compte') {
|
} elseif ($key == 't.subledger_account' || $key == 't.numero_compte') {
|
||||||
$sqlwhere[] = $key." LIKE '".$db->escape($value)."%'";
|
$sqlwhere[] = $key." LIKE '".$db->escape($value)."%'";
|
||||||
} elseif ($key == 't.subledger_account') {
|
} elseif ($key == 't.subledger_account') {
|
||||||
$sqlwhere[] = natural_search($key, $value, 0, 1);
|
$sqlwhere[] = natural_search($key, $value, 0, 1);
|
||||||
|
|||||||
@ -225,6 +225,9 @@ if (!empty($conf->contrat->enabled) && !empty($user->rights->contrat->lire)) {
|
|||||||
if (!empty($conf->ticket->enabled) && !empty($user->rights->ticket->read)) {
|
if (!empty($conf->ticket->enabled) && !empty($user->rights->ticket->read)) {
|
||||||
$elementList['ticket_send'] = img_picto('', 'ticket', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToTicket'));
|
$elementList['ticket_send'] = img_picto('', 'ticket', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToTicket'));
|
||||||
}
|
}
|
||||||
|
if (!empty($conf->expensereport->enabled) && !empty($user->rights->expensereport->lire)) {
|
||||||
|
$elementList['expensereport_send'] = img_picto('', 'trip', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToTExpenseReport'));
|
||||||
|
}
|
||||||
if (!empty($conf->agenda->enabled)) {
|
if (!empty($conf->agenda->enabled)) {
|
||||||
$elementList['actioncomm_send'] = img_picto('', 'action', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendEventPush'));
|
$elementList['actioncomm_send'] = img_picto('', 'action', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendEventPush'));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -186,7 +186,7 @@ foreach ($fulltree as $key => $val) {
|
|||||||
? $categstatic->getObjectsInCateg("account", 1) // Categorie::TYPE_ACCOUNT is "bank_account" instead of "account"
|
? $categstatic->getObjectsInCateg("account", 1) // Categorie::TYPE_ACCOUNT is "bank_account" instead of "account"
|
||||||
: $categstatic->getObjectsInCateg($type, 1);
|
: $categstatic->getObjectsInCateg($type, 1);
|
||||||
|
|
||||||
$counter = "<td class='left' width='40px;'>".(is_countable($elements) ? count($elements) : '0')."</td>";
|
$counter = "<td class='left' width='40px;'>".(is_array($elements) ? count($elements) : '0')."</td>";
|
||||||
}
|
}
|
||||||
|
|
||||||
$color = $categstatic->color ? ' style="background: #'.sprintf("%06s", $categstatic->color).';"' : ' style="background: #bbb"';
|
$color = $categstatic->color ? ' style="background: #'.sprintf("%06s", $categstatic->color).';"' : ' style="background: #bbb"';
|
||||||
|
|||||||
@ -413,7 +413,7 @@ if ($cats < 0) {
|
|||||||
? $categstatic->getObjectsInCateg("account", 1) // Categorie::TYPE_ACCOUNT is "bank_account" instead of "account"
|
? $categstatic->getObjectsInCateg("account", 1) // Categorie::TYPE_ACCOUNT is "bank_account" instead of "account"
|
||||||
: $categstatic->getObjectsInCateg($type, 1);
|
: $categstatic->getObjectsInCateg($type, 1);
|
||||||
|
|
||||||
$counter = "<td class='left' width='40px;'>".(is_countable($elements) ? count($elements) : '0')."</td>";
|
$counter = "<td class='left' width='40px;'>".(is_array($elements) ? count($elements) : '0')."</td>";
|
||||||
}
|
}
|
||||||
|
|
||||||
$color = $categstatic->color ? ' style="background: #'.sprintf("%06s", $categstatic->color).';"' : ' style="background: #bbb"';
|
$color = $categstatic->color ? ' style="background: #'.sprintf("%06s", $categstatic->color).';"' : ' style="background: #bbb"';
|
||||||
|
|||||||
@ -903,6 +903,10 @@ if ($resql) {
|
|||||||
|
|
||||||
// Add $param from extra fields
|
// Add $param from extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||||
|
// Add $param from hooks
|
||||||
|
$parameters = array();
|
||||||
|
$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
|
$param .= $hookmanager->resPrint;
|
||||||
|
|
||||||
// List of mass actions available
|
// List of mass actions available
|
||||||
$arrayofmassactions = array(
|
$arrayofmassactions = array(
|
||||||
|
|||||||
@ -829,6 +829,11 @@ if ($resql) {
|
|||||||
// Add $param from extra fields
|
// Add $param from extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||||
|
|
||||||
|
// Add $param from hooks
|
||||||
|
$parameters = array();
|
||||||
|
$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
|
$param .= $hookmanager->resPrint;
|
||||||
|
|
||||||
// List of mass actions available
|
// List of mass actions available
|
||||||
$arrayofmassactions = array(
|
$arrayofmassactions = array(
|
||||||
'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
|
'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
|
||||||
|
|||||||
@ -1660,6 +1660,11 @@ if (empty($reshook)) {
|
|||||||
$discount->tva_tx = $lines[$i]->tva_tx;
|
$discount->tva_tx = $lines[$i]->tva_tx;
|
||||||
$discount->fk_user = $user->id;
|
$discount->fk_user = $user->id;
|
||||||
$discount->description = $desc;
|
$discount->description = $desc;
|
||||||
|
$discount->multicurrency_subprice = abs($lines[$i]->multicurrency_subprice);
|
||||||
|
$discount->multicurrency_amount_ht = abs($lines[$i]->multicurrency_total_ht);
|
||||||
|
$discount->multicurrency_amount_tva = abs($lines[$i]->multicurrency_total_tva);
|
||||||
|
$discount->multicurrency_amount_ttc = abs($lines[$i]->multicurrency_total_ttc);
|
||||||
|
|
||||||
$discountid = $discount->create($user);
|
$discountid = $discount->create($user);
|
||||||
if ($discountid > 0) {
|
if ($discountid > 0) {
|
||||||
$result = $object->insert_discount($discountid); // This include link_to_invoice
|
$result = $object->insert_discount($discountid); // This include link_to_invoice
|
||||||
|
|||||||
@ -100,14 +100,6 @@ if ($action == 'addcontact' && $user->rights->facture->creer) {
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (empty($object->id)) {
|
|
||||||
llxHeader();
|
|
||||||
$langs->load('errors');
|
|
||||||
echo '<div class="error">'.$langs->trans("ErrorRecordNotFound").'</div>';
|
|
||||||
llxFooter();
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
$title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('ContactsAddresses');
|
$title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('ContactsAddresses');
|
||||||
$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes";
|
$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes";
|
||||||
llxHeader('', $title, $helpurl);
|
llxHeader('', $title, $helpurl);
|
||||||
|
|||||||
@ -76,7 +76,7 @@ $search_phone_mobile = GETPOST("search_phone_mobile", 'alpha');
|
|||||||
$search_fax = GETPOST("search_fax", 'alpha');
|
$search_fax = GETPOST("search_fax", 'alpha');
|
||||||
$search_email = GETPOST("search_email", 'alpha');
|
$search_email = GETPOST("search_email", 'alpha');
|
||||||
if (!empty($conf->mailing->enabled)) {
|
if (!empty($conf->mailing->enabled)) {
|
||||||
$search_no_email = GETPOST("search_no_email", 'int');
|
$search_no_email = GETPOSTISSET("search_no_email") ? GETPOST("search_no_email", 'int') : -1;
|
||||||
} else {
|
} else {
|
||||||
$search_no_email = -1;
|
$search_no_email = -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1306,6 +1306,12 @@ if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == '
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($objectclass == 'Holiday' && ! in_array($objecttmp->statut, array(Holiday::STATUS_DRAFT, Holiday::STATUS_CANCELED, Holiday::STATUS_REFUSED))) {
|
||||||
|
$nbignored++;
|
||||||
|
$resaction .= '<div class="error">'.$langs->trans('ErrorLeaveRequestMustBeDraftCanceledOrRefusedToBeDeleted', $objecttmp->ref).'</div><br>';
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if ($objectclass == "Task" && $objecttmp->hasChildren() > 0) {
|
if ($objectclass == "Task" && $objecttmp->hasChildren() > 0) {
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."projet_task SET fk_task_parent = 0 WHERE fk_task_parent = ".((int) $objecttmp->id);
|
$sql = "UPDATE ".MAIN_DB_PREFIX."projet_task SET fk_task_parent = 0 WHERE fk_task_parent = ".((int) $objecttmp->id);
|
||||||
$res = $db->query($sql);
|
$res = $db->query($sql);
|
||||||
@ -1342,8 +1348,10 @@ if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == '
|
|||||||
// Message for elements well deleted
|
// Message for elements well deleted
|
||||||
if ($nbok > 1) {
|
if ($nbok > 1) {
|
||||||
setEventMessages($langs->trans("RecordsDeleted", $nbok), null, 'mesgs');
|
setEventMessages($langs->trans("RecordsDeleted", $nbok), null, 'mesgs');
|
||||||
} elseif ($nbok == 1) {
|
} elseif ($nbok > 0) {
|
||||||
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
|
setEventMessages($langs->trans("RecordDeleted", $nbok), null, 'mesgs');
|
||||||
|
} else {
|
||||||
|
setEventMessages($langs->trans("NoRecordDeleted"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Message for elements which can't be deleted
|
// Message for elements which can't be deleted
|
||||||
|
|||||||
@ -65,9 +65,14 @@ if (!empty($user->socid)) {
|
|||||||
$socid = $user->socid;
|
$socid = $user->socid;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if (empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
|
if (in_array($field, array('status'))) {
|
||||||
accessforbidden('Calling this file is allowed only when MAIN_DIRECT_STATUS_UPDATE is set');
|
restrictedArea($user, $element, $id);
|
||||||
}*/
|
} elseif ($element == 'product' && in_array($field, array('tosell', 'tobuy', 'tobatch'))) { // Special case for products
|
||||||
|
restrictedArea($user, 'produit|service', $id, 'product&product', '', '', 'rowid');
|
||||||
|
} else {
|
||||||
|
accessforbidden("Bad value for combination of parameters element/field.", 0, 0, 1);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -78,15 +83,6 @@ top_httphead();
|
|||||||
|
|
||||||
print '<!-- Ajax page called with url '.dol_escape_htmltag($_SERVER["PHP_SELF"]).'?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]).' -->'."\n";
|
print '<!-- Ajax page called with url '.dol_escape_htmltag($_SERVER["PHP_SELF"]).'?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]).' -->'."\n";
|
||||||
|
|
||||||
if (in_array($field, array('status'))) {
|
|
||||||
restrictedArea($user, $element, $id);
|
|
||||||
} elseif ($element == 'product' && in_array($field, array('tosell', 'tobuy', 'tobatch'))) { // Special case for products
|
|
||||||
restrictedArea($user, 'produit|service', $id, 'product&product', '', '', 'rowid');
|
|
||||||
} else {
|
|
||||||
accessforbidden("Bad value for combination of parameters element/field.", 0, 0, 1);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Registering new values
|
// Registering new values
|
||||||
if (($action == 'set') && !empty($id)) {
|
if (($action == 'set') && !empty($id)) {
|
||||||
$triggerkey = strtoupper($element).'_UPDATE';
|
$triggerkey = strtoupper($element).'_UPDATE';
|
||||||
|
|||||||
@ -237,7 +237,7 @@ class box_funnel_of_prospection extends ModeleBoxes
|
|||||||
$dolgraph->setBorderColor(array_values($bordercolorseries));
|
$dolgraph->setBorderColor(array_values($bordercolorseries));
|
||||||
$dolgraph->setShowLegend(2);
|
$dolgraph->setShowLegend(2);
|
||||||
if (!empty($conf->dol_optimize_smallscreen)) {
|
if (!empty($conf->dol_optimize_smallscreen)) {
|
||||||
$px1->SetWidth(320);
|
$dolgraph->SetWidth(320);
|
||||||
}
|
}
|
||||||
$dolgraph->setShowPercent(1);
|
$dolgraph->setShowPercent(1);
|
||||||
$dolgraph->setMirrorGraphValues(true);
|
$dolgraph->setMirrorGraphValues(true);
|
||||||
|
|||||||
@ -869,7 +869,7 @@ abstract class CommonObject
|
|||||||
if (!empty($conf->socialnetworks->enabled)) {
|
if (!empty($conf->socialnetworks->enabled)) {
|
||||||
$outsocialnetwork = '';
|
$outsocialnetwork = '';
|
||||||
|
|
||||||
if (!empty($this->socialnetworks) && is_countable($this->socialnetworks) && count($this->socialnetworks) > 0) {
|
if (!empty($this->socialnetworks) && is_array($this->socialnetworks) && count($this->socialnetworks) > 0) {
|
||||||
$socialnetworksdict = getArrayOfSocialNetworks();
|
$socialnetworksdict = getArrayOfSocialNetworks();
|
||||||
foreach ($this->socialnetworks as $key => $value) {
|
foreach ($this->socialnetworks as $key => $value) {
|
||||||
if ($value) {
|
if ($value) {
|
||||||
|
|||||||
@ -8159,9 +8159,9 @@ function verifCond($strToEvaluate)
|
|||||||
global $leftmenu;
|
global $leftmenu;
|
||||||
global $rights; // To export to dol_eval function
|
global $rights; // To export to dol_eval function
|
||||||
|
|
||||||
//print $strRights."<br>\n";
|
//print $strToEvaluate."<br>\n";
|
||||||
$rights = true;
|
$rights = true;
|
||||||
if ($strToEvaluate !== '') {
|
if (isset($strToEvaluate) && $strToEvaluate !== '') {
|
||||||
$str = 'if(!('.$strToEvaluate.')) { $rights = false; }';
|
$str = 'if(!('.$strToEvaluate.')) { $rights = false; }';
|
||||||
dol_eval($str); // The dol_eval must contains all the global $xxx used into a condition
|
dol_eval($str); // The dol_eval must contains all the global $xxx used into a condition
|
||||||
}
|
}
|
||||||
|
|||||||
@ -93,7 +93,7 @@ function dol_setcache($memoryid, $data, $expire = 0)
|
|||||||
$dolmemcache->add($memoryid, $data, $expire); // This fails if key already exists
|
$dolmemcache->add($memoryid, $data, $expire); // This fails if key already exists
|
||||||
$rescode = $dolmemcache->getResultCode();
|
$rescode = $dolmemcache->getResultCode();
|
||||||
if ($rescode == 0) {
|
if ($rescode == 0) {
|
||||||
return is_array($data) ? count($data) : 0;
|
return is_array($data) ? count($data) : (is_scalar($data) ? strlen($data) : 0);
|
||||||
} else {
|
} else {
|
||||||
return -$rescode;
|
return -$rescode;
|
||||||
}
|
}
|
||||||
@ -113,7 +113,7 @@ function dol_setcache($memoryid, $data, $expire = 0)
|
|||||||
//$dolmemcache->setOption(Memcached::OPT_COMPRESSION, false);
|
//$dolmemcache->setOption(Memcached::OPT_COMPRESSION, false);
|
||||||
$result = $dolmemcache->add($memoryid, $data, false, $expire); // This fails if key already exists
|
$result = $dolmemcache->add($memoryid, $data, false, $expire); // This fails if key already exists
|
||||||
if ($result) {
|
if ($result) {
|
||||||
return is_array($data) ? count($data) : 0;
|
return is_array($data) ? count($data) : (is_scalar($data) ? strlen($data) : 0);
|
||||||
} else {
|
} else {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -478,7 +478,7 @@ if ($num > 0) {
|
|||||||
if (empty($obj)) {
|
if (empty($obj)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!verifCond($obj->test)) {
|
if (isset($obj->test) && !verifCond($obj->test)) {
|
||||||
continue; // Discard line with test = false
|
continue; // Discard line with test = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -284,6 +284,12 @@ if ($search_user > 0) {
|
|||||||
$sql .= ", ".MAIN_DB_PREFIX."element_contact as ec";
|
$sql .= ", ".MAIN_DB_PREFIX."element_contact as ec";
|
||||||
$sql .= ", ".MAIN_DB_PREFIX."c_type_contact as tc";
|
$sql .= ", ".MAIN_DB_PREFIX."c_type_contact as tc";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add table from hooks
|
||||||
|
$parameters = array();
|
||||||
|
$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
|
$sql .= $hookmanager->resPrint;
|
||||||
|
|
||||||
$sql .= " WHERE e.entity IN (".getEntity('expedition').")";
|
$sql .= " WHERE e.entity IN (".getEntity('expedition').")";
|
||||||
if ($search_product_category > 0) {
|
if ($search_product_category > 0) {
|
||||||
$sql .= " AND cp.fk_categorie = ".((int) $search_product_category);
|
$sql .= " AND cp.fk_categorie = ".((int) $search_product_category);
|
||||||
@ -471,6 +477,11 @@ if ($optioncss != '') {
|
|||||||
// Add $param from extra fields
|
// Add $param from extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||||
|
|
||||||
|
// Add $param from hooks
|
||||||
|
$parameters = array();
|
||||||
|
$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
|
$param .= $hookmanager->resPrint;
|
||||||
|
|
||||||
$arrayofmassactions = array(
|
$arrayofmassactions = array(
|
||||||
'builddoc' => img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
|
'builddoc' => img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
|
||||||
//'classifyclose'=>$langs->trans("Close"), TODO massive close shipment ie: when truck is charged
|
//'classifyclose'=>$langs->trans("Close"), TODO massive close shipment ie: when truck is charged
|
||||||
|
|||||||
@ -134,3 +134,4 @@ HolidaysToApprove=Holidays to approve
|
|||||||
NobodyHasPermissionToValidateHolidays=Nobody has permission to validate holidays
|
NobodyHasPermissionToValidateHolidays=Nobody has permission to validate holidays
|
||||||
HolidayBalanceMonthlyUpdate=Monthly update of holiday balance
|
HolidayBalanceMonthlyUpdate=Monthly update of holiday balance
|
||||||
XIsAUsualNonWorkingDay=%s is usualy a NON working day
|
XIsAUsualNonWorkingDay=%s is usualy a NON working day
|
||||||
|
ErrorLeaveRequestMustBeDraftCanceledOrRefusedToBeDeleted=Leave request %s must be draft, canceled or refused to be deleted
|
||||||
|
|||||||
@ -8,21 +8,21 @@ FONTFORPDF=helvetica
|
|||||||
FONTSIZEFORPDF=10
|
FONTSIZEFORPDF=10
|
||||||
SeparatorDecimal=,
|
SeparatorDecimal=,
|
||||||
SeparatorThousand=Space
|
SeparatorThousand=Space
|
||||||
FormatDateShort=%m/%d/%Y
|
FormatDateShort=%d-%m-%Y
|
||||||
FormatDateShortInput=%m/%d/%Y
|
FormatDateShortInput=%d-%m-%Y
|
||||||
FormatDateShortJava=MM/dd/yyyy
|
FormatDateShortJava=dd-MM-yyyy
|
||||||
FormatDateShortJavaInput=MM/dd/yyyy
|
FormatDateShortJavaInput=dd-MM-yyyy
|
||||||
FormatDateShortJQuery=mm/dd/yy
|
FormatDateShortJQuery=dd-mm-yy
|
||||||
FormatDateShortJQueryInput=mm/dd/yy
|
FormatDateShortJQueryInput=dd-mm-yy
|
||||||
FormatHourShortJQuery=HH:MI
|
FormatHourShortJQuery=HH:MI
|
||||||
FormatHourShort=%I:%M %p
|
FormatHourShort=%I:%M %p
|
||||||
FormatHourShortDuration=%H:%M
|
FormatHourShortDuration=%H:%M
|
||||||
FormatDateTextShort=%b %d, %Y
|
FormatDateTextShort=%d %b %Y
|
||||||
FormatDateText=%B %d, %Y
|
FormatDateText=%d %B %Y
|
||||||
FormatDateHourShort=%m/%d/%Y %I:%M %p
|
FormatDateHourShort=%d-%m-%Y %I:%M %p
|
||||||
FormatDateHourSecShort=%m/%d/%Y %I:%M:%S %p
|
FormatDateHourSecShort=%d-%m-%Y %I:%M:%S %p
|
||||||
FormatDateHourTextShort=%b %d, %Y, %I:%M %p
|
FormatDateHourTextShort=%d %b %Y, %I:%M %p
|
||||||
FormatDateHourText=%B %d, %Y, %I:%M %p
|
FormatDateHourText=%d %B %Y, %I:%M %p
|
||||||
DatabaseConnection=Databaseverbinding
|
DatabaseConnection=Databaseverbinding
|
||||||
NoTemplateDefined=Geen sjabloon beschikbaar voor dit e-mailtype
|
NoTemplateDefined=Geen sjabloon beschikbaar voor dit e-mailtype
|
||||||
AvailableVariables=Beschikbare substitutievariabelen
|
AvailableVariables=Beschikbare substitutievariabelen
|
||||||
|
|||||||
@ -233,7 +233,7 @@ if (empty($reshook)) {
|
|||||||
if ($user->rights->produit->creer || $user->rights->service->creer) {
|
if ($user->rights->produit->creer || $user->rights->service->creer) {
|
||||||
print '<a class="butAction" href="' . DOL_URL_ROOT . '/product/traduction.php?action=add&token='.newToken().'&id=' . $object->id . '">' . $langs->trans("Add") . '</a>';
|
print '<a class="butAction" href="' . DOL_URL_ROOT . '/product/traduction.php?action=add&token='.newToken().'&id=' . $object->id . '">' . $langs->trans("Add") . '</a>';
|
||||||
if ($cnt_trans > 0) {
|
if ($cnt_trans > 0) {
|
||||||
print '<a class="butAction" href="' . DOL_URL_ROOT . '/product/traduction.php?action=edit&token='.newToken().'&id=' . $object->id . '">' . $langs->trans("Update") . '</a>';
|
print '<a class="butAction" href="' . DOL_URL_ROOT . '/product/traduction.php?action=edit&token='.newToken().'&id=' . $object->id . '">' . $langs->trans("Modify") . '</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -513,7 +513,6 @@ if (!empty($conf->global->MAIN_DEFAULT_WORKING_DAYS)) {
|
|||||||
|
|
||||||
for ($idw = 0; $idw < 7; $idw++) {
|
for ($idw = 0; $idw < 7; $idw++) {
|
||||||
$dayinloopfromfirstdaytoshow = dol_time_plus_duree($firstdaytoshow, $idw, 'd'); // $firstdaytoshow is a date with hours = 0
|
$dayinloopfromfirstdaytoshow = dol_time_plus_duree($firstdaytoshow, $idw, 'd'); // $firstdaytoshow is a date with hours = 0
|
||||||
$dayinloop = dol_time_plus_duree($startday, $idw, 'd');
|
|
||||||
|
|
||||||
// Useless because $dayinloopwithouthours should be same than $dayinloopfromfirstdaytoshow
|
// Useless because $dayinloopwithouthours should be same than $dayinloopfromfirstdaytoshow
|
||||||
//$tmparray = dol_getdate($dayinloop);
|
//$tmparray = dol_getdate($dayinloop);
|
||||||
|
|||||||
@ -438,7 +438,7 @@ if (empty($reshook)) {
|
|||||||
if (!$error) {
|
if (!$error) {
|
||||||
// Log action in ticket logs table
|
// Log action in ticket logs table
|
||||||
$object->fetch_user($usertoassign);
|
$object->fetch_user($usertoassign);
|
||||||
$log_action = $langs->trans('TicketLogAssignedTo', $object->user->getFullName($langs));
|
//$log_action = $langs->trans('TicketLogAssignedTo', $object->user->getFullName($langs));
|
||||||
|
|
||||||
setEventMessages($langs->trans('TicketAssigned'), null, 'mesgs');
|
setEventMessages($langs->trans('TicketAssigned'), null, 'mesgs');
|
||||||
|
|
||||||
@ -493,7 +493,7 @@ if (empty($reshook)) {
|
|||||||
$object->close($user);
|
$object->close($user);
|
||||||
|
|
||||||
// Log action in ticket logs table
|
// Log action in ticket logs table
|
||||||
$log_action = $langs->trans('TicketLogClosedBy', $_SESSION['email_customer']);
|
//$log_action = $langs->trans('TicketLogClosedBy', $_SESSION['email_customer']);
|
||||||
|
|
||||||
setEventMessages('<div class="confirm">'.$langs->trans('TicketMarkedAsClosed').'</div>', null, 'mesgs');
|
setEventMessages('<div class="confirm">'.$langs->trans('TicketMarkedAsClosed').'</div>', null, 'mesgs');
|
||||||
|
|
||||||
@ -579,7 +579,7 @@ if (empty($reshook)) {
|
|||||||
$res = $object->setStatut(Ticket::STATUS_ASSIGNED);
|
$res = $object->setStatut(Ticket::STATUS_ASSIGNED);
|
||||||
if ($res) {
|
if ($res) {
|
||||||
// Log action in ticket logs table
|
// Log action in ticket logs table
|
||||||
$log_action = $langs->trans('TicketLogReopen');
|
//$log_action = $langs->trans('TicketLogReopen');
|
||||||
|
|
||||||
$url = 'card.php?action=view&track_id='.$object->track_id;
|
$url = 'card.php?action=view&track_id='.$object->track_id;
|
||||||
header("Location: ".$url);
|
header("Location: ".$url);
|
||||||
@ -616,11 +616,11 @@ if (empty($reshook)) {
|
|||||||
$object->message = $fieldtomodify;
|
$object->message = $fieldtomodify;
|
||||||
$ret = $object->update($user);
|
$ret = $object->update($user);
|
||||||
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
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/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)));
|
||||||
|
|
||||||
setEventMessages($langs->trans('TicketMessageSuccesfullyUpdated'), null, 'mesgs');
|
setEventMessages($langs->trans('TicketMessageSuccesfullyUpdated'), null, 'mesgs');
|
||||||
} else {
|
} else {
|
||||||
@ -684,7 +684,7 @@ if (empty($reshook)) {
|
|||||||
|
|
||||||
$ret = $object->update($user);
|
$ret = $object->update($user);
|
||||||
if ($ret > 0) {
|
if ($ret > 0) {
|
||||||
$log_action = $langs->trans('TicketLogPropertyChanged', $oldvalue_label, $newvalue_label);
|
//$log_action = $langs->trans('TicketLogPropertyChanged', $oldvalue_label, $newvalue_label);
|
||||||
|
|
||||||
setEventMessages($langs->trans('TicketUpdated'), null, 'mesgs');
|
setEventMessages($langs->trans('TicketUpdated'), null, 'mesgs');
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -2367,7 +2367,7 @@ if ($action == 'generatesitemaps' && $usercanedit) {
|
|||||||
}
|
}
|
||||||
if ($tmpshortlangcode != $shortlangcode) {
|
if ($tmpshortlangcode != $shortlangcode) {
|
||||||
$xhtmllink = $domtree->createElement('xhtml:link', '');
|
$xhtmllink = $domtree->createElement('xhtml:link', '');
|
||||||
$xhtmllink->setAttribute("rel", "alternante");
|
$xhtmllink->setAttribute("rel", "alternate");
|
||||||
$xhtmllink->setAttribute("hreflang", $tmpshortlangcode);
|
$xhtmllink->setAttribute("hreflang", $tmpshortlangcode);
|
||||||
$xhtmllink->setAttribute("href", $domainname.($objp->fk_default_home == $tmppage->id ? '/' : (($tmpshortlangcode != substr($object->lang, 0, 2)) ? '/'.$tmpshortlangcode : '').'/'.$tmppage->pageurl.'.php'));
|
$xhtmllink->setAttribute("href", $domainname.($objp->fk_default_home == $tmppage->id ? '/' : (($tmpshortlangcode != substr($object->lang, 0, 2)) ? '/'.$tmpshortlangcode : '').'/'.$tmppage->pageurl.'.php'));
|
||||||
$url->appendChild($xhtmllink);
|
$url->appendChild($xhtmllink);
|
||||||
|
|||||||
@ -594,7 +594,7 @@ class SecurityTest extends PHPUnit\Framework\TestCase
|
|||||||
print __METHOD__." login=".$login."\n";
|
print __METHOD__." login=".$login."\n";
|
||||||
$this->assertEquals($login, 'admin', 'The test to check if pass of user "admin" is "admin" has failed');
|
$this->assertEquals($login, 'admin', 'The test to check if pass of user "admin" is "admin" has failed');
|
||||||
|
|
||||||
$login=checkLoginPassEntity('admin', 'admin', 1, array('http','dolibarr')); // Should work because of second authetntication method
|
$login=checkLoginPassEntity('admin', 'admin', 1, array('http','dolibarr')); // Should work because of second authentication method
|
||||||
print __METHOD__." login=".$login."\n";
|
print __METHOD__." login=".$login."\n";
|
||||||
$this->assertEquals($login, 'admin');
|
$this->assertEquals($login, 'admin');
|
||||||
|
|
||||||
@ -749,42 +749,42 @@ class SecurityTest extends PHPUnit\Framework\TestCase
|
|||||||
$url = 'https://www.dolibarr.fr'; // This is a redirect 301 page
|
$url = 'https://www.dolibarr.fr'; // This is a redirect 301 page
|
||||||
$tmp = getURLContent($url, 'GET', '', 0); // We do NOT follow
|
$tmp = getURLContent($url, 'GET', '', 0); // We do NOT follow
|
||||||
print __METHOD__." url=".$url."\n";
|
print __METHOD__." url=".$url."\n";
|
||||||
$this->assertEquals(301, $tmp['http_code'], 'GET url 301 without following -> 301');
|
$this->assertEquals(301, $tmp['http_code'], 'Should GET url 301 without following -> 301');
|
||||||
|
|
||||||
$url = 'https://www.dolibarr.fr'; // This is a redirect 301 page
|
$url = 'https://www.dolibarr.fr'; // This is a redirect 301 page
|
||||||
$tmp = getURLContent($url); // We DO follow
|
$tmp = getURLContent($url); // We DO follow a page with return 300 so result should be 200
|
||||||
print __METHOD__." url=".$url."\n";
|
print __METHOD__." url=".$url."\n";
|
||||||
$this->assertEquals(200, $tmp['http_code'], 'GET url 301 with following -> 200'); // Test error if return does not contains 'not supported'
|
$this->assertEquals(200, $tmp['http_code'], 'Should GET url 301 with following -> 200 but we get '.$tmp['http_code']);
|
||||||
|
|
||||||
$url = 'http://localhost';
|
$url = 'http://localhost';
|
||||||
$tmp = getURLContent($url, 'GET', '', 0, array(), array('http', 'https'), 0); // Only external URL
|
$tmp = getURLContent($url, 'GET', '', 0, array(), array('http', 'https'), 0); // Only external URL
|
||||||
print __METHOD__." url=".$url."\n";
|
print __METHOD__." url=".$url."\n";
|
||||||
$this->assertEquals(400, $tmp['http_code'], 'GET url to '.$url.' that resolves to a local URL'); // Test we receive an error because localtest.me is not an external URL
|
$this->assertEquals(400, $tmp['http_code'], 'Should GET url to '.$url.' that resolves to a local URL'); // Test we receive an error because localtest.me is not an external URL
|
||||||
|
|
||||||
$url = 'http://127.0.0.1';
|
$url = 'http://127.0.0.1';
|
||||||
$tmp = getURLContent($url, 'GET', '', 0, array(), array('http', 'https'), 0); // Only external URL
|
$tmp = getURLContent($url, 'GET', '', 0, array(), array('http', 'https'), 0); // Only external URL
|
||||||
print __METHOD__." url=".$url."\n";
|
print __METHOD__." url=".$url."\n";
|
||||||
$this->assertEquals(400, $tmp['http_code'], 'GET url to '.$url.' that is a local URL'); // Test we receive an error because 127.0.0.1 is not an external URL
|
$this->assertEquals(400, $tmp['http_code'], 'Should GET url to '.$url.' that is a local URL'); // Test we receive an error because 127.0.0.1 is not an external URL
|
||||||
|
|
||||||
$url = 'http://127.0.2.1';
|
$url = 'http://127.0.2.1';
|
||||||
$tmp = getURLContent($url, 'GET', '', 0, array(), array('http', 'https'), 0); // Only external URL
|
$tmp = getURLContent($url, 'GET', '', 0, array(), array('http', 'https'), 0); // Only external URL
|
||||||
print __METHOD__." url=".$url."\n";
|
print __METHOD__." url=".$url."\n";
|
||||||
$this->assertEquals(400, $tmp['http_code'], 'GET url to '.$url.' that is a local URL'); // Test we receive an error because 127.0.2.1 is not an external URL
|
$this->assertEquals(400, $tmp['http_code'], 'Should GET url to '.$url.' that is a local URL'); // Test we receive an error because 127.0.2.1 is not an external URL
|
||||||
|
|
||||||
$url = 'https://169.254.0.1';
|
$url = 'https://169.254.0.1';
|
||||||
$tmp = getURLContent($url, 'GET', '', 0, array(), array('http', 'https'), 0); // Only external URL
|
$tmp = getURLContent($url, 'GET', '', 0, array(), array('http', 'https'), 0); // Only external URL
|
||||||
print __METHOD__." url=".$url."\n";
|
print __METHOD__." url=".$url."\n";
|
||||||
$this->assertEquals(400, $tmp['http_code'], 'GET url to '.$url.' that is a local URL'); // Test we receive an error because 169.254.0.1 is not an external URL
|
$this->assertEquals(400, $tmp['http_code'], 'Should GET url to '.$url.' that is a local URL'); // Test we receive an error because 169.254.0.1 is not an external URL
|
||||||
|
|
||||||
$url = 'http://[::1]';
|
$url = 'http://[::1]';
|
||||||
$tmp = getURLContent($url, 'GET', '', 0, array(), array('http', 'https'), 0); // Only external URL
|
$tmp = getURLContent($url, 'GET', '', 0, array(), array('http', 'https'), 0); // Only external URL
|
||||||
print __METHOD__." url=".$url."\n";
|
print __METHOD__." url=".$url."\n";
|
||||||
$this->assertEquals(400, $tmp['http_code'], 'GET url to '.$url.' that is a local URL'); // Test we receive an error because [::1] is not an external URL
|
$this->assertEquals(400, $tmp['http_code'], 'Should GET url to '.$url.' that is a local URL'); // Test we receive an error because [::1] is not an external URL
|
||||||
|
|
||||||
/*$url = 'localtest.me';
|
/*$url = 'localtest.me';
|
||||||
$tmp = getURLContent($url, 'GET', '', 0, array(), array('http', 'https'), 0); // Only external URL
|
$tmp = getURLContent($url, 'GET', '', 0, array(), array('http', 'https'), 0); // Only external URL
|
||||||
print __METHOD__." url=".$url."\n";
|
print __METHOD__." url=".$url."\n";
|
||||||
$this->assertEquals(400, $tmp['http_code'], 'GET url to '.$url.' that resolves to a local URL'); // Test we receive an error because localtest.me is not an external URL
|
$this->assertEquals(400, $tmp['http_code'], 'Should GET url to '.$url.' that resolves to a local URL'); // Test we receive an error because localtest.me is not an external URL
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user