mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Fix with php-cs-fixer
This commit is contained in:
parent
ba10d60a0b
commit
54e6de0d7f
|
|
@ -192,7 +192,7 @@ if ($type == 'directory') {
|
|||
|
||||
$maxlengthname = 40;
|
||||
$excludefiles = array('^SPECIMEN\.pdf$', '^\.', '(\.meta|_preview.*\.png)$', '^temp$', '^payments$', '^CVS$', '^thumbs$');
|
||||
$sorting = (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC);
|
||||
$sorting = (strtolower($sortorder) == 'desc' ? SORT_DESC : SORT_ASC);
|
||||
|
||||
// Right area. If module is defined here, we are in automatic ecm.
|
||||
$automodules = array(
|
||||
|
|
@ -310,7 +310,7 @@ if ($type == 'directory') {
|
|||
'max_file_size' => string '2097152' (length=7)
|
||||
'sendit' => string 'Envoyer fichier' (length=15)
|
||||
*/
|
||||
$relativepath = GETPOST('file', 'alpha') ?GETPOST('file', 'alpha') : GETPOST('section_dir', 'alpha');
|
||||
$relativepath = GETPOST('file', 'alpha') ? GETPOST('file', 'alpha') : GETPOST('section_dir', 'alpha');
|
||||
if ($relativepath && $relativepath != '/') {
|
||||
$relativepath .= '/';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -484,7 +484,7 @@ function treeOutputForAbsoluteDir($sqltree, $selecteddir, $fullpathselecteddir,
|
|||
$htmltooltip = '<b>'.$langs->trans("ECMSection").'</b>: '.$val['label'].'<br>';
|
||||
$htmltooltip = '<b>'.$langs->trans("Type").'</b>: '.$langs->trans("ECMSectionManual").'<br>';
|
||||
$htmltooltip .= '<b>'.$langs->trans("ECMCreationUser").'</b>: '.$userstatic->getNomUrl(1, '', false, 1).'<br>';
|
||||
$htmltooltip .= '<b>'.$langs->trans("ECMCreationDate").'</b>: '.(isset($val['date_c']) ?dol_print_date($val['date_c'], "dayhour") : $langs->trans("NeedRefresh")).'<br>';
|
||||
$htmltooltip .= '<b>'.$langs->trans("ECMCreationDate").'</b>: '.(isset($val['date_c']) ? dol_print_date($val['date_c'], "dayhour") : $langs->trans("NeedRefresh")).'<br>';
|
||||
$htmltooltip .= '<b>'.$langs->trans("Description").'</b>: '.$val['description'].'<br>';
|
||||
$htmltooltip .= '<b>'.$langs->trans("ECMNbOfFilesInDir").'</b>: '.((isset($val['cachenbofdoc']) && $val['cachenbofdoc'] >= 0) ? $val['cachenbofdoc'] : $langs->trans("NeedRefresh")).'<br>';
|
||||
if ($nboffilesinsubdir > 0) {
|
||||
|
|
|
|||
|
|
@ -23,11 +23,21 @@
|
|||
* \brief File to return Ajax response on third parties request
|
||||
*/
|
||||
|
||||
if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', 1); // Disables token renewal
|
||||
if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1');
|
||||
if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1');
|
||||
if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
|
||||
if (!defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1');
|
||||
if (!defined('NOTOKENRENEWAL')) {
|
||||
define('NOTOKENRENEWAL', 1);
|
||||
} // Disables token renewal
|
||||
if (!defined('NOREQUIREMENU')) {
|
||||
define('NOREQUIREMENU', '1');
|
||||
}
|
||||
if (!defined('NOREQUIREHTML')) {
|
||||
define('NOREQUIREHTML', '1');
|
||||
}
|
||||
if (!defined('NOREQUIREAJAX')) {
|
||||
define('NOREQUIREAJAX', '1');
|
||||
}
|
||||
if (!defined('NOREQUIRESOC')) {
|
||||
define('NOREQUIRESOC', '1');
|
||||
}
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ if ($module != "test" && !isModEnabled($module)) {
|
|||
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
$chunk_file = $temp_dir.'/'.$flowFilename.'.part'.$flowChunkNumber;
|
||||
if (file_exists($chunk_file)) {
|
||||
header("HTTP/1.0 200 Ok");
|
||||
header("HTTP/1.0 200 Ok");
|
||||
} else {
|
||||
header("HTTP/1.0 404 Not Found");
|
||||
}
|
||||
|
|
@ -103,28 +103,30 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
|||
echo json_encode('File '.$flowIdentifier.' was already uploaded');
|
||||
header("HTTP/1.0 200 Ok");
|
||||
die();
|
||||
} elseif (!empty($_FILES)) foreach ($_FILES as $file) {
|
||||
// check the error status
|
||||
if ($file['error'] != 0) {
|
||||
dol_syslog('error '.$file['error'].' in file '.$flowFilename);
|
||||
continue;
|
||||
}
|
||||
} elseif (!empty($_FILES)) {
|
||||
foreach ($_FILES as $file) {
|
||||
// check the error status
|
||||
if ($file['error'] != 0) {
|
||||
dol_syslog('error '.$file['error'].' in file '.$flowFilename);
|
||||
continue;
|
||||
}
|
||||
|
||||
// init the destination file (format <filename.ext>.part<#chunk>
|
||||
// the file is stored in a temporary directory
|
||||
$dest_file = $temp_dir.'/'.$flowFilename.'.part'.$flowChunkNumber;
|
||||
// init the destination file (format <filename.ext>.part<#chunk>
|
||||
// the file is stored in a temporary directory
|
||||
$dest_file = $temp_dir.'/'.$flowFilename.'.part'.$flowChunkNumber;
|
||||
|
||||
// create the temporary directory
|
||||
if (!dol_is_dir($temp_dir)) {
|
||||
dol_mkdir($temp_dir);
|
||||
}
|
||||
// create the temporary directory
|
||||
if (!dol_is_dir($temp_dir)) {
|
||||
dol_mkdir($temp_dir);
|
||||
}
|
||||
|
||||
// move the temporary file
|
||||
if (!dol_move_uploaded_file($file['tmp_name'], $dest_file, 0)) {
|
||||
dol_syslog('Error saving (move_uploaded_file) chunk '.$flowChunkNumber.' for file '.$flowFilename);
|
||||
} else {
|
||||
// check if all the parts present, and create the final destination file
|
||||
$result = createFileFromChunks($temp_dir, $upload_dir, $flowFilename, $flowChunkSize, $flowTotalSize);
|
||||
// move the temporary file
|
||||
if (!dol_move_uploaded_file($file['tmp_name'], $dest_file, 0)) {
|
||||
dol_syslog('Error saving (move_uploaded_file) chunk '.$flowChunkNumber.' for file '.$flowFilename);
|
||||
} else {
|
||||
// check if all the parts present, and create the final destination file
|
||||
$result = createFileFromChunks($temp_dir, $upload_dir, $flowFilename, $flowChunkSize, $flowTotalSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ if (GETPOST('location_incoterms')) {
|
|||
//var_dump($db);
|
||||
if ($resql) {
|
||||
while ($row = $db->fetch_array($resql)) {
|
||||
$row_array['label'] = $row['location_incoterms'].($row['label']?' - '.$row['label'] : '');
|
||||
$row_array['label'] = $row['location_incoterms'].($row['label'] ? ' - '.$row['label'] : '');
|
||||
if ($location_incoterms) {
|
||||
$row_array['value'] = $row['location_incoterms'];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -120,7 +120,8 @@ if (GETPOST('roworder', 'alpha', 3) && GETPOST('table_element_line', 'aZ09', 3)
|
|||
$perm = 1;
|
||||
} else {
|
||||
$tmparray = explode('_', $table_element_line);
|
||||
$tmpmodule = $tmparray[0]; $tmpobject = preg_replace('/line$/', '', $tmparray[1]);
|
||||
$tmpmodule = $tmparray[0];
|
||||
$tmpobject = preg_replace('/line$/', '', $tmparray[1]);
|
||||
if (!empty($tmpmodule) && !empty($tmpobject) && !empty($conf->$tmpmodule->enabled) && $user->hasRight($tmpobject, 'write')) {
|
||||
$perm = 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@ require '../../main.inc.php';
|
|||
$id = GETPOST('id', 'int');
|
||||
$action = GETPOST('action', 'aZ09'); // 'getSellerVATRates' or 'getBuyerVATRates'
|
||||
$htmlname = GETPOST('htmlname', 'alpha');
|
||||
$selected = (GETPOST('selected') ?GETPOST('selected') : '-1');
|
||||
$productid = (GETPOST('productid', 'int') ?GETPOST('productid', 'int') : 0);
|
||||
$selected = (GETPOST('selected') ? GETPOST('selected') : '-1');
|
||||
$productid = (GETPOST('productid', 'int') ? GETPOST('productid', 'int') : 0);
|
||||
|
||||
// Security check
|
||||
$result = restrictedArea($user, 'societe', $id, '&societe', '', 'fk_soc', 'rowid', 0);
|
||||
|
|
|
|||
|
|
@ -62,10 +62,11 @@ class box_activity extends ModeleBoxes
|
|||
// FIXME: Pb into some status
|
||||
$this->enabled = ($conf->global->MAIN_FEATURES_LEVEL); // Not enabled by default due to bugs (see previous comments)
|
||||
|
||||
$this->hidden = !((isModEnabled('facture') && $user->hasRight('facture', 'read'))
|
||||
$this->hidden = !(
|
||||
(isModEnabled('facture') && $user->hasRight('facture', 'read'))
|
||||
|| (isModEnabled('commande') && $user->hasRight('commande', 'read'))
|
||||
|| (isModEnabled('propal') && $user->hasRight('propal', 'read'))
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -116,10 +116,11 @@ class box_dolibarr_state_board extends ModeleBoxes
|
|||
'members' => isModEnabled('adherent') && $user->hasRight('adherent', 'lire'),
|
||||
'customers' => isModEnabled('societe') && $user->hasRight('societe', 'lire') && !getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS') && !getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS_STATS'),
|
||||
'prospects' => isModEnabled('societe') && $user->hasRight('societe', 'lire') && !getDolGlobalString('SOCIETE_DISABLE_PROSPECTS') && !getDolGlobalString('SOCIETE_DISABLE_PROSPECTS_STATS'),
|
||||
'suppliers' => ((isModEnabled("fournisseur") && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight('fournisseur', 'lire'))
|
||||
'suppliers' => (
|
||||
(isModEnabled("fournisseur") && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight('fournisseur', 'lire'))
|
||||
|| (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire'))
|
||||
|| (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire'))
|
||||
)
|
||||
)
|
||||
&& !getDolGlobalString('SOCIETE_DISABLE_SUPPLIERS_STATS'),
|
||||
'contacts' => isModEnabled('societe') && $user->hasRight('societe', 'contact', 'lire'),
|
||||
'products' => isModEnabled('product') && $user->hasRight('product', 'read'),
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ class box_graph_invoices_permonth extends ModeleBoxes
|
|||
|
||||
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
|
||||
if ($shownb) {
|
||||
$data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09') == $refreshaction ?-1 : (3600 * 24)), ($WIDTH < 300 ? 2 : 0), $startmonth);
|
||||
$data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09') == $refreshaction ? -1 : (3600 * 24)), ($WIDTH < 300 ? 2 : 0), $startmonth);
|
||||
|
||||
$filenamenb = $dir."/".$prefix."invoicesnbinyear-".$endyear.".png";
|
||||
// default value for customer mode
|
||||
|
|
@ -182,7 +182,7 @@ class box_graph_invoices_permonth extends ModeleBoxes
|
|||
|
||||
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
|
||||
if ($showtot) {
|
||||
$data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09') == $refreshaction ?-1 : (3600 * 24)), ($WIDTH < 300 ? 2 : 0), $startmonth);
|
||||
$data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09') == $refreshaction ? -1 : (3600 * 24)), ($WIDTH < 300 ? 2 : 0), $startmonth);
|
||||
|
||||
$filenamenb = $dir."/".$prefix."invoicesamountinyear-".$endyear.".png";
|
||||
// default value for customer mode
|
||||
|
|
|
|||
|
|
@ -75,7 +75,9 @@ class box_graph_invoices_peryear extends ModeleBoxes
|
|||
//$facturestatic=new Facture($this->db);
|
||||
|
||||
$startmonth = $conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1;
|
||||
if (!getDolGlobalString('GRAPH_USE_FISCAL_YEAR')) $startmonth = 1;
|
||||
if (!getDolGlobalString('GRAPH_USE_FISCAL_YEAR')) {
|
||||
$startmonth = 1;
|
||||
}
|
||||
|
||||
$text = $langs->trans("Turnover", $max);
|
||||
$this->info_box_head = array(
|
||||
|
|
@ -92,8 +94,12 @@ class box_graph_invoices_peryear extends ModeleBoxes
|
|||
$dir = ''; // We don't need a path because image file will not be saved into disk
|
||||
$prefix = '';
|
||||
$socid = 0;
|
||||
if ($user->socid) $socid = $user->socid;
|
||||
if (!$user->hasRight('societe', 'client', 'voir') || $socid) $prefix .= 'private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user
|
||||
if ($user->socid) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
if (!$user->hasRight('societe', 'client', 'voir') || $socid) {
|
||||
$prefix .= 'private-'.$user->id.'-';
|
||||
} // If user has no permission to see all, output dir is specific to user
|
||||
|
||||
if ($user->hasRight('facture', 'lire')) {
|
||||
$mesg = '';
|
||||
|
|
@ -112,9 +118,13 @@ class box_graph_invoices_peryear extends ModeleBoxes
|
|||
$endyear = $tmparray['year'];
|
||||
$showtot = $tmparray['showtot'];
|
||||
}
|
||||
if (empty($showtot)) { $showtot = 1; }
|
||||
if (empty($showtot)) {
|
||||
$showtot = 1;
|
||||
}
|
||||
$nowarray = dol_getdate(dol_now(), true);
|
||||
if (empty($endyear)) $endyear = $nowarray['year'];
|
||||
if (empty($endyear)) {
|
||||
$endyear = $nowarray['year'];
|
||||
}
|
||||
$numberyears = (!getDolGlobalString('MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH') ? 5 : $conf->global->MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH);
|
||||
$startyear = $endyear - $numberyears;
|
||||
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
|
|||
|
||||
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
|
||||
if ($shownb) {
|
||||
$data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09') == $refreshaction ?-1 : (3600 * 24)), ($WIDTH < 300 ? 2 : 0), $startmonth);
|
||||
$data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09') == $refreshaction ? -1 : (3600 * 24)), ($WIDTH < 300 ? 2 : 0), $startmonth);
|
||||
|
||||
$filenamenb = $dir."/".$prefix."invoicessuppliernbinyear-".$endyear.".png";
|
||||
// default value for customer mode
|
||||
|
|
@ -178,7 +178,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
|
|||
|
||||
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
|
||||
if ($showtot) {
|
||||
$data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09') == $refreshaction ?-1 : (3600 * 24)), ($WIDTH < 300 ? 2 : 0), $startmonth);
|
||||
$data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09') == $refreshaction ? -1 : (3600 * 24)), ($WIDTH < 300 ? 2 : 0), $startmonth);
|
||||
|
||||
$filenamenb = $dir."/".$prefix."invoicessupplieramountinyear-".$endyear.".png";
|
||||
// default value for customer mode
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ require_once DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php";
|
|||
*/
|
||||
class box_graph_nb_ticket_last_x_days extends ModeleBoxes
|
||||
{
|
||||
|
||||
public $boxcode = "box_graph_nb_ticket_last_x_days";
|
||||
public $boximg = "ticket";
|
||||
public $boxlabel;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ require_once DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php";
|
|||
*/
|
||||
class box_graph_nb_tickets_type extends ModeleBoxes
|
||||
{
|
||||
|
||||
public $boxcode = "box_graph_nb_tickets_type";
|
||||
public $boximg = "ticket";
|
||||
public $boxlabel;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ require_once DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php";
|
|||
*/
|
||||
class box_graph_new_vs_close_ticket extends ModeleBoxes
|
||||
{
|
||||
|
||||
public $boxcode = "box_nb_tickets_type";
|
||||
public $boximg = "ticket";
|
||||
public $boxlabel;
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ class box_graph_orders_permonth extends ModeleBoxes
|
|||
|
||||
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
|
||||
if ($shownb) {
|
||||
$data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09') == $refreshaction ?-1 : (3600 * 24)), ($WIDTH < 300 ? 2 : 0), $startmonth);
|
||||
$data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09') == $refreshaction ? -1 : (3600 * 24)), ($WIDTH < 300 ? 2 : 0), $startmonth);
|
||||
|
||||
$filenamenb = $dir."/".$prefix."ordersnbinyear-".$endyear.".png";
|
||||
// default value for customer mode
|
||||
|
|
@ -182,7 +182,7 @@ class box_graph_orders_permonth extends ModeleBoxes
|
|||
|
||||
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
|
||||
if ($showtot) {
|
||||
$data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09') == $refreshaction ?-1 : (3600 * 24)), ($WIDTH < 300 ? 2 : 0), $startmonth);
|
||||
$data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09') == $refreshaction ? -1 : (3600 * 24)), ($WIDTH < 300 ? 2 : 0), $startmonth);
|
||||
|
||||
$filenamenb = $dir."/".$prefix."ordersamountinyear-".$endyear.".png";
|
||||
// default value for customer mode
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
|
|||
|
||||
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
|
||||
if ($shownb) {
|
||||
$data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09') == $refreshaction ?-1 : (3600 * 24)), ($WIDTH < 300 ? 2 : 0), $startmonth);
|
||||
$data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09') == $refreshaction ? -1 : (3600 * 24)), ($WIDTH < 300 ? 2 : 0), $startmonth);
|
||||
|
||||
$filenamenb = $dir."/".$prefix."orderssuppliernbinyear-".$endyear.".png";
|
||||
// default value for customer mode
|
||||
|
|
@ -181,7 +181,7 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
|
|||
|
||||
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
|
||||
if ($showtot) {
|
||||
$data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09') == $refreshaction ?-1 : (3600 * 24)), ($WIDTH < 300 ? 2 : 0), $startmonth);
|
||||
$data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09') == $refreshaction ? -1 : (3600 * 24)), ($WIDTH < 300 ? 2 : 0), $startmonth);
|
||||
|
||||
$filenamenb = $dir."/".$prefix."orderssupplieramountinyear-".$endyear.".png";
|
||||
// default value for customer mode
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ class box_graph_product_distribution extends ModeleBoxes
|
|||
$showpointvalue = 1;
|
||||
$nocolor = 0;
|
||||
$stats_proposal = new PropaleStats($this->db, $socid, ($userid > 0 ? $userid : 0));
|
||||
$data2 = $stats_proposal->getAllByProductEntry($year, (GETPOST('action', 'aZ09') == $refreshaction ?-1 : (3600 * 24)), $max);
|
||||
$data2 = $stats_proposal->getAllByProductEntry($year, (GETPOST('action', 'aZ09') == $refreshaction ? -1 : (3600 * 24)), $max);
|
||||
if (empty($data2)) {
|
||||
$showpointvalue = 0;
|
||||
$nocolor = 1;
|
||||
|
|
@ -224,7 +224,7 @@ class box_graph_product_distribution extends ModeleBoxes
|
|||
$nocolor = 0;
|
||||
$mode = 'customer';
|
||||
$stats_order = new CommandeStats($this->db, $socid, $mode, ($userid > 0 ? $userid : 0));
|
||||
$data3 = $stats_order->getAllByProductEntry($year, (GETPOST('action', 'aZ09') == $refreshaction ?-1 : (3600 * 24)), $max);
|
||||
$data3 = $stats_order->getAllByProductEntry($year, (GETPOST('action', 'aZ09') == $refreshaction ? -1 : (3600 * 24)), $max);
|
||||
if (empty($data3)) {
|
||||
$showpointvalue = 0;
|
||||
$nocolor = 1;
|
||||
|
|
@ -288,7 +288,7 @@ class box_graph_product_distribution extends ModeleBoxes
|
|||
$nocolor = 0;
|
||||
$mode = 'customer';
|
||||
$stats_invoice = new FactureStats($this->db, $socid, $mode, ($userid > 0 ? $userid : 0));
|
||||
$data1 = $stats_invoice->getAllByProductEntry($year, (GETPOST('action', 'aZ09') == $refreshaction ?-1 : (3600 * 24)), $max);
|
||||
$data1 = $stats_invoice->getAllByProductEntry($year, (GETPOST('action', 'aZ09') == $refreshaction ? -1 : (3600 * 24)), $max);
|
||||
|
||||
if (empty($data1)) {
|
||||
$showpointvalue = 0;
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ class box_graph_propales_permonth extends ModeleBoxes
|
|||
|
||||
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
|
||||
if ($shownb) {
|
||||
$data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09') == $refreshaction ?-1 : (3600 * 24)), ($WIDTH < 300 ? 2 : 0), $startmonth);
|
||||
$data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09') == $refreshaction ? -1 : (3600 * 24)), ($WIDTH < 300 ? 2 : 0), $startmonth);
|
||||
$datatype1 = array_pad(array(), ($endyear - $startyear + 1), 'bars');
|
||||
|
||||
$filenamenb = $dir."/".$prefix."propalsnbinyear-".$endyear.".png";
|
||||
|
|
@ -179,7 +179,7 @@ class box_graph_propales_permonth extends ModeleBoxes
|
|||
|
||||
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
|
||||
if ($showtot) {
|
||||
$data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09') == $refreshaction ?-1 : (3600 * 24)), ($WIDTH < 300 ? 2 : 0), $startmonth);
|
||||
$data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09') == $refreshaction ? -1 : (3600 * 24)), ($WIDTH < 300 ? 2 : 0), $startmonth);
|
||||
$datatype2 = array_pad(array(), ($endyear - $startyear + 1), 'bars');
|
||||
//$datatype2 = array('lines','bars');
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ require_once DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php";
|
|||
*/
|
||||
class box_last_modified_ticket extends ModeleBoxes
|
||||
{
|
||||
|
||||
public $boxcode = "box_last_modified_ticket";
|
||||
public $boximg = "ticket";
|
||||
public $boxlabel;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ require_once DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php";
|
|||
*/
|
||||
class box_last_ticket extends ModeleBoxes
|
||||
{
|
||||
|
||||
public $boxcode = "box_last_ticket";
|
||||
public $boximg = "ticket";
|
||||
public $boxlabel;
|
||||
|
|
|
|||
|
|
@ -150,9 +150,9 @@ class box_produits extends ModeleBoxes
|
|||
$productstatic->accountancy_code_buy_export = $objp->accountancy_code_buy_export;
|
||||
$productstatic->date_modification = $datem;
|
||||
|
||||
$usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS')?$user->hasRight('product', 'product_advance', 'read_prices'):$user->hasRight('product', 'read');
|
||||
$usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS') ? $user->hasRight('product', 'product_advance', 'read_prices') : $user->hasRight('product', 'read');
|
||||
if ($productstatic->isService()) {
|
||||
$usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS')?$user->hasRight('service', 'service_advance', 'read_prices'):$user->hasRight('service', 'read');
|
||||
$usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS') ? $user->hasRight('service', 'service_advance', 'read_prices') : $user->hasRight('service', 'read');
|
||||
}
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
|
|
@ -170,7 +170,7 @@ class box_produits extends ModeleBoxes
|
|||
if ($usercancreadprice) {
|
||||
if (!isModEnabled('dynamicprices') || empty($objp->fk_price_expression)) {
|
||||
$price_base_type = $langs->trans($objp->price_base_type);
|
||||
$price = ($objp->price_base_type == 'HT') ?price($objp->price) : $price = price($objp->price_ttc);
|
||||
$price = ($objp->price_base_type == 'HT') ? price($objp->price) : $price = price($objp->price_ttc);
|
||||
} else {
|
||||
//Parse the dynamic price
|
||||
$productstatic->fetch($objp->rowid, '', '', 1);
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ class box_produits_alerte_stock extends ModeleBoxes
|
|||
|
||||
if (!isModEnabled('dynamicprices') || empty($objp->fk_price_expression)) {
|
||||
$price_base_type = $langs->trans($objp->price_base_type);
|
||||
$price = ($objp->price_base_type == 'HT') ?price($objp->price) : $price = price($objp->price_ttc);
|
||||
$price = ($objp->price_base_type == 'HT') ? price($objp->price) : $price = price($objp->price_ttc);
|
||||
} else { //Parse the dynamic price
|
||||
$productstatic->fetch($objp->rowid, '', '', 1);
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
|
|||
*/
|
||||
class box_services_expired extends ModeleBoxes
|
||||
{
|
||||
|
||||
public $boxcode = "expiredservices"; // id of box
|
||||
public $boximg = "object_contract";
|
||||
public $boxlabel = "BoxOldestExpiredServices";
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
|
|||
*/
|
||||
class box_supplier_orders extends ModeleBoxes
|
||||
{
|
||||
|
||||
public $boxcode = "latestsupplierorders";
|
||||
public $boximg = "object_order";
|
||||
public $boxlabel = "BoxLatestSupplierOrders";
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
|
|||
*/
|
||||
class box_supplier_orders_awaiting_reception extends ModeleBoxes
|
||||
{
|
||||
|
||||
public $boxcode = "supplierordersawaitingreception";
|
||||
public $boximg = "object_order";
|
||||
public $boxlabel = "BoxLatestSupplierOrdersAwaitingReception";
|
||||
|
|
|
|||
|
|
@ -1091,7 +1091,7 @@ class CMailFile
|
|||
$keyforsupportedoauth2array = 'OAUTH_'.$keyforsupportedoauth2array.'_NAME';
|
||||
|
||||
$OAUTH_SERVICENAME = 'Unknown';
|
||||
if ( array_key_exists($keyforsupportedoauth2array, $supportedoauth2array)
|
||||
if (array_key_exists($keyforsupportedoauth2array, $supportedoauth2array)
|
||||
&& array_key_exists('name', $supportedoauth2array[$keyforsupportedoauth2array])
|
||||
&& !empty($supportedoauth2array[$keyforsupportedoauth2array]['name'])) {
|
||||
$OAUTH_SERVICENAME = $supportedoauth2array[$keyforsupportedoauth2array]['name'].(!empty($keyforprovider) ? '-'.$keyforprovider : '');
|
||||
|
|
@ -1729,7 +1729,8 @@ class CMailFile
|
|||
|
||||
dol_syslog("Try socket connection to host=".$host." port=".$port." timeout=".$timeout);
|
||||
//See if we can connect to the SMTP server
|
||||
$errno = 0; $errstr = '';
|
||||
$errno = 0;
|
||||
$errstr = '';
|
||||
if ($socket = @fsockopen(
|
||||
$host, // Host to test, IP or domain. Add ssl:// for SSL/TLS.
|
||||
$port, // which Port number to use
|
||||
|
|
@ -2015,7 +2016,7 @@ class CMailFile
|
|||
} elseif (!$name) {
|
||||
$newemail = '<'.$email.'>';
|
||||
} else {
|
||||
$newemail = ($format == 3 ? '"' : '').($encode ?self::encodetorfc2822($name) : $name).($format == 3 ? '"' : '').' <'.$email.'>';
|
||||
$newemail = ($format == 3 ? '"' : '').($encode ? self::encodetorfc2822($name) : $name).($format == 3 ? '"' : '').' <'.$email.'>';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -92,13 +92,13 @@ class CGenericDic extends CommonDict
|
|||
// Clean parameters
|
||||
|
||||
if (isset($this->code)) {
|
||||
$this->code = trim($this->code);
|
||||
$this->code = trim($this->code);
|
||||
}
|
||||
if (isset($this->label)) {
|
||||
$this->label = trim($this->label);
|
||||
$this->label = trim($this->label);
|
||||
}
|
||||
if (isset($this->active)) {
|
||||
$this->active = trim($this->active);
|
||||
$this->active = trim($this->active);
|
||||
}
|
||||
|
||||
// Insert request
|
||||
|
|
@ -317,13 +317,13 @@ class CGenericDic extends CommonDict
|
|||
// Clean parameters
|
||||
|
||||
if (isset($this->code)) {
|
||||
$this->code = trim($this->code);
|
||||
$this->code = trim($this->code);
|
||||
}
|
||||
if (isset($this->label)) {
|
||||
$this->label = trim($this->label);
|
||||
$this->label = trim($this->label);
|
||||
}
|
||||
if (isset($this->active)) {
|
||||
$this->active = trim($this->active);
|
||||
$this->active = trim($this->active);
|
||||
}
|
||||
|
||||
// Check parameters
|
||||
|
|
|
|||
|
|
@ -562,13 +562,13 @@ abstract class CommonDocGenerator
|
|||
$array_key.'_incoterms' => (method_exists($object, 'display_incoterms') ? $object->display_incoterms() : ''),
|
||||
|
||||
$array_key.'_total_ht_locale'=>price($object->total_ht, 0, $outputlangs),
|
||||
$array_key.'_total_vat_locale'=>(!empty($object->total_vat) ?price($object->total_vat, 0, $outputlangs) : price($object->total_tva, 0, $outputlangs)),
|
||||
$array_key.'_total_vat_locale'=>(!empty($object->total_vat) ? price($object->total_vat, 0, $outputlangs) : price($object->total_tva, 0, $outputlangs)),
|
||||
$array_key.'_total_localtax1_locale'=>price($object->total_localtax1, 0, $outputlangs),
|
||||
$array_key.'_total_localtax2_locale'=>price($object->total_localtax2, 0, $outputlangs),
|
||||
$array_key.'_total_ttc_locale'=>price($object->total_ttc, 0, $outputlangs),
|
||||
|
||||
$array_key.'_total_ht'=>price2num($object->total_ht),
|
||||
$array_key.'_total_vat'=>(!empty($object->total_vat) ?price2num($object->total_vat) : price2num($object->total_tva)),
|
||||
$array_key.'_total_vat'=>(!empty($object->total_vat) ? price2num($object->total_vat) : price2num($object->total_tva)),
|
||||
$array_key.'_total_localtax1'=>price2num($object->total_localtax1),
|
||||
$array_key.'_total_localtax2'=>price2num($object->total_localtax2),
|
||||
$array_key.'_total_ttc'=>price2num($object->total_ttc),
|
||||
|
|
@ -756,8 +756,8 @@ abstract class CommonDocGenerator
|
|||
|
||||
// Units
|
||||
if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
|
||||
$resarray['line_unit'] = $outputlangs->trans($line->getLabelOfUnit('long'));
|
||||
$resarray['line_unit_short'] = $outputlangs->trans($line->getLabelOfUnit('short'));
|
||||
$resarray['line_unit'] = $outputlangs->trans($line->getLabelOfUnit('long'));
|
||||
$resarray['line_unit_short'] = $outputlangs->trans($line->getLabelOfUnit('short'));
|
||||
}
|
||||
|
||||
// Retrieve extrafields
|
||||
|
|
@ -1348,7 +1348,9 @@ abstract class CommonDocGenerator
|
|||
$extrafields = $this->extrafieldsCache;
|
||||
|
||||
$extrafieldOutputContent = '';
|
||||
if (isset($object->array_options[$extrafieldOptionsKey])) $extrafieldOutputContent = $extrafields->showOutputField($extrafieldKey, $object->array_options[$extrafieldOptionsKey], '', $object->table_element);
|
||||
if (isset($object->array_options[$extrafieldOptionsKey])) {
|
||||
$extrafieldOutputContent = $extrafields->showOutputField($extrafieldKey, $object->array_options[$extrafieldOptionsKey], '', $object->table_element);
|
||||
}
|
||||
|
||||
// TODO : allow showOutputField to be pdf public friendly, ex: in a link to object, clean getNomUrl to remove link and images... like a getName methode ...
|
||||
if ($extrafields->attributes[$object->table_element]['type'][$extrafieldKey] == 'link') {
|
||||
|
|
|
|||
|
|
@ -1250,7 +1250,9 @@ abstract class CommonInvoice extends CommonObject
|
|||
// So it inits or erases the $stripearrayofkeysbyenv
|
||||
$stripe = new Stripe($this->db);
|
||||
|
||||
if (empty($savstripearrayofkeysbyenv)) $savstripearrayofkeysbyenv = $stripearrayofkeysbyenv;
|
||||
if (empty($savstripearrayofkeysbyenv)) {
|
||||
$savstripearrayofkeysbyenv = $stripearrayofkeysbyenv;
|
||||
}
|
||||
dol_syslog("makeStripeSepaRequest Current Stripe environment is " . $stripearrayofkeysbyenv[$servicestatus]['publishable_key']);
|
||||
dol_syslog("makeStripeSepaRequest Current Saved Stripe environment is ".$savstripearrayofkeysbyenv[$servicestatus]['publishable_key']);
|
||||
|
||||
|
|
|
|||
|
|
@ -2202,7 +2202,7 @@ abstract class CommonObject
|
|||
}
|
||||
$restrictiononfksoc = empty($this->restrictiononfksoc) ? 0 : $this->restrictiononfksoc;
|
||||
$sql = "SELECT MAX(te.".$fieldid.")";
|
||||
$sql .= " FROM ".(empty($nodbprefix) ?$this->db->prefix():'').$this->table_element." as te";
|
||||
$sql .= " FROM ".(empty($nodbprefix) ? $this->db->prefix() : '').$this->table_element." as te";
|
||||
if (isset($this->ismultientitymanaged) && !is_numeric($this->ismultientitymanaged)) {
|
||||
$tmparray = explode('@', $this->ismultientitymanaged);
|
||||
$sql .= ", ".$this->db->prefix().$tmparray[1]." as ".($tmparray[1] == 'societe' ? 's' : 'parenttable'); // If we need to link to this table to limit select to entity
|
||||
|
|
@ -2272,7 +2272,7 @@ abstract class CommonObject
|
|||
$this->ref_previous = $row[0];
|
||||
|
||||
$sql = "SELECT MIN(te.".$fieldid.")";
|
||||
$sql .= " FROM ".(empty($nodbprefix) ?$this->db->prefix():'').$this->table_element." as te";
|
||||
$sql .= " FROM ".(empty($nodbprefix) ? $this->db->prefix() : '').$this->table_element." as te";
|
||||
if (isset($this->ismultientitymanaged) && !is_numeric($this->ismultientitymanaged)) {
|
||||
$tmparray = explode('@', $this->ismultientitymanaged);
|
||||
$sql .= ", ".$this->db->prefix().$tmparray[1]." as ".($tmparray[1] == 'societe' ? 's' : 'parenttable'); // If we need to link to this table to limit select to entity
|
||||
|
|
@ -2403,8 +2403,7 @@ abstract class CommonObject
|
|||
$sql .= " SET fk_project = NULL";
|
||||
}
|
||||
$sql .= ' WHERE id = '.((int) $this->id);
|
||||
} else // Special case for old architecture objects
|
||||
{
|
||||
} else { // Special case for old architecture objects
|
||||
if ($projectid) {
|
||||
$sql .= ' SET fk_projet = '.((int) $projectid);
|
||||
} else {
|
||||
|
|
@ -2453,7 +2452,8 @@ abstract class CommonObject
|
|||
{
|
||||
global $user;
|
||||
|
||||
$error = 0; $notrigger = 0;
|
||||
$error = 0;
|
||||
$notrigger = 0;
|
||||
|
||||
dol_syslog(get_class($this).'::setPaymentMethods('.$id.')');
|
||||
|
||||
|
|
@ -2970,7 +2970,7 @@ abstract class CommonObject
|
|||
$this->db->rollback();
|
||||
return -1;
|
||||
} else {
|
||||
$this->shipping_method_id = ($shipping_method_id == 'NULL') ?null:$shipping_method_id;
|
||||
$this->shipping_method_id = ($shipping_method_id == 'NULL') ? null : $shipping_method_id;
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -2999,7 +2999,7 @@ abstract class CommonObject
|
|||
$sql .= " WHERE rowid=".((int) $this->id);
|
||||
|
||||
if ($this->db->query($sql)) {
|
||||
$this->warehouse_id = ($warehouse_id == 'NULL') ?null:$warehouse_id;
|
||||
$this->warehouse_id = ($warehouse_id == 'NULL') ? null : $warehouse_id;
|
||||
return 1;
|
||||
} else {
|
||||
dol_syslog(get_class($this).'::setWarehouse Error ', LOG_DEBUG);
|
||||
|
|
@ -3099,7 +3099,7 @@ abstract class CommonObject
|
|||
$this->db->rollback();
|
||||
return -1;
|
||||
} else {
|
||||
$this->fk_account = ($fk_account == 'NULL') ?null:$fk_account;
|
||||
$this->fk_account = ($fk_account == 'NULL') ? null : $fk_account;
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -3947,7 +3947,9 @@ abstract class CommonObject
|
|||
// Hook for explicitly set the targettype if it must be differtent than $this->element
|
||||
$reshook = $hookmanager->executeHooks('setLinkedObjectSourceTargetType', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook > 0) {
|
||||
if (!empty($hookmanager->resArray['targettype'])) $targettype = $hookmanager->resArray['targettype'];
|
||||
if (!empty($hookmanager->resArray['targettype'])) {
|
||||
$targettype = $hookmanager->resArray['targettype'];
|
||||
}
|
||||
}
|
||||
|
||||
$this->db->begin();
|
||||
|
|
@ -4036,10 +4038,18 @@ abstract class CommonObject
|
|||
// Hook for explicitly set the targettype if it must be differtent than $this->element
|
||||
$reshook = $hookmanager->executeHooks('setLinkedObjectSourceTargetType', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook > 0) {
|
||||
if (!empty($hookmanager->resArray['sourcetype'])) $sourcetype = $hookmanager->resArray['sourcetype'];
|
||||
if (!empty($hookmanager->resArray['sourceid'])) $sourceid = $hookmanager->resArray['sourceid'];
|
||||
if (!empty($hookmanager->resArray['targettype'])) $targettype = $hookmanager->resArray['targettype'];
|
||||
if (!empty($hookmanager->resArray['targetid'])) $targetid = $hookmanager->resArray['targetid'];
|
||||
if (!empty($hookmanager->resArray['sourcetype'])) {
|
||||
$sourcetype = $hookmanager->resArray['sourcetype'];
|
||||
}
|
||||
if (!empty($hookmanager->resArray['sourceid'])) {
|
||||
$sourceid = $hookmanager->resArray['sourceid'];
|
||||
}
|
||||
if (!empty($hookmanager->resArray['targettype'])) {
|
||||
$targettype = $hookmanager->resArray['targettype'];
|
||||
}
|
||||
if (!empty($hookmanager->resArray['targetid'])) {
|
||||
$targetid = $hookmanager->resArray['targetid'];
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($sourceid) && !empty($sourcetype) && empty($targetid)) {
|
||||
|
|
@ -4157,7 +4167,7 @@ abstract class CommonObject
|
|||
$classpath = 'adherents/class';
|
||||
$module = 'adherent';
|
||||
} elseif ($objecttype == 'contact') {
|
||||
$module = 'societe';
|
||||
$module = 'societe';
|
||||
}
|
||||
// Set classfile
|
||||
$classfile = strtolower($subelement);
|
||||
|
|
@ -4748,9 +4758,9 @@ abstract class CommonObject
|
|||
if (is_numeric($element)) { // very old usage array('table1', 'table2', ...)
|
||||
$this->errors[] = $langs->transnoentitiesnoconv("ErrorRecordHasAtLeastOneChildOfType", method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref, $table);
|
||||
} elseif (is_string($element)) { // old usage array('table1' => 'TranslateKey1', 'table2' => 'TranslateKey2', ...)
|
||||
$this->errors[] = $langs->transnoentitiesnoconv("ErrorRecordHasAtLeastOneChildOfType", method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref, $langs->transnoentitiesnoconv($element));
|
||||
$this->errors[] = $langs->transnoentitiesnoconv("ErrorRecordHasAtLeastOneChildOfType", method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref, $langs->transnoentitiesnoconv($element));
|
||||
} else { // new usage: $element['name']=Translation key
|
||||
$this->errors[] = $langs->transnoentitiesnoconv("ErrorRecordHasAtLeastOneChildOfType", method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref, $langs->transnoentitiesnoconv($element['name']));
|
||||
$this->errors[] = $langs->transnoentitiesnoconv("ErrorRecordHasAtLeastOneChildOfType", method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref, $langs->transnoentitiesnoconv($element['name']));
|
||||
}
|
||||
break; // We found at least one, we stop here
|
||||
}
|
||||
|
|
@ -4809,7 +4819,7 @@ abstract class CommonObject
|
|||
*/
|
||||
public function getTotalDiscount()
|
||||
{
|
||||
if (!empty($this->table_element_line) ) {
|
||||
if (!empty($this->table_element_line)) {
|
||||
$total_discount = 0.00;
|
||||
|
||||
$sql = "SELECT subprice as pu_ht, qty, remise_percent, total_ht";
|
||||
|
|
@ -5282,7 +5292,9 @@ abstract class CommonObject
|
|||
//if (is_object($hookmanager) && (($line->product_type == 9 && !empty($line->special_code)) || !empty($line->fk_parent_line))) {
|
||||
if (is_object($hookmanager)) { // Old code is commented on preceding line.
|
||||
$parameters = array('line'=>$line, 'i'=>$i, 'restrictlist'=>$restrictlist, 'selectedLines'=> $selectedLines);
|
||||
if (!empty($line->fk_parent_line)) { $parameters['fk_parent_line'] = $line->fk_parent_line; }
|
||||
if (!empty($line->fk_parent_line)) {
|
||||
$parameters['fk_parent_line'] = $line->fk_parent_line;
|
||||
}
|
||||
$reshook = $hookmanager->executeHooks('printOriginObjectLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||
}
|
||||
if (empty($reshook)) {
|
||||
|
|
@ -7135,7 +7147,7 @@ abstract class CommonObject
|
|||
// Special case that force options and type ($type can be integer, varchar, ...)
|
||||
if (!empty($this->fields[$key]['arrayofkeyval']) && is_array($this->fields[$key]['arrayofkeyval'])) {
|
||||
$param['options'] = $this->fields[$key]['arrayofkeyval'];
|
||||
$type = (($this->fields[$key]['type']=='checkbox')?$this->fields[$key]['type']:'select');
|
||||
$type = (($this->fields[$key]['type']=='checkbox') ? $this->fields[$key]['type'] : 'select');
|
||||
}
|
||||
|
||||
$label = $this->fields[$key]['label'];
|
||||
|
|
@ -7208,7 +7220,9 @@ abstract class CommonObject
|
|||
$showtime = 1;
|
||||
|
||||
// Do not show current date when field not required (see selectDate() method)
|
||||
if (!$required && $value == '') $value = '-1';
|
||||
if (!$required && $value == '') {
|
||||
$value = '-1';
|
||||
}
|
||||
|
||||
// TODO Must also support $moreparam
|
||||
$out = $form->selectDate($value, $keyprefix.$key.$keysuffix, $showtime, $showtime, $required, '', 1, (($keyprefix != 'search_' && $keyprefix != 'search_options_') ? 1 : 0), 0, 1, '', '', '', 1, '', '', 'tzuserrel');
|
||||
|
|
@ -7294,7 +7308,8 @@ abstract class CommonObject
|
|||
$param_list = array_keys($param['options']);
|
||||
$InfoFieldList = explode(":", $param_list[0], 5);
|
||||
if (! empty($InfoFieldList[4])) {
|
||||
$pos = 0; $parenthesisopen = 0;
|
||||
$pos = 0;
|
||||
$parenthesisopen = 0;
|
||||
while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) {
|
||||
if (substr($InfoFieldList[4], $pos, 1) == '(') {
|
||||
$parenthesisopen++;
|
||||
|
|
@ -7474,7 +7489,7 @@ abstract class CommonObject
|
|||
$out .= '</select>';
|
||||
} elseif ($type == 'checkbox') {
|
||||
$value_arr = explode(',', $value);
|
||||
$out = $form->multiselectarray($keyprefix.$key.$keysuffix, (empty($param['options']) ?null:$param['options']), $value_arr, '', 0, $morecss, 0, '100%');
|
||||
$out = $form->multiselectarray($keyprefix.$key.$keysuffix, (empty($param['options']) ? null : $param['options']), $value_arr, '', 0, $morecss, 0, '100%');
|
||||
} elseif ($type == 'radio') {
|
||||
$out = '';
|
||||
foreach ($param['options'] as $keyopt => $valopt) {
|
||||
|
|
@ -7506,7 +7521,7 @@ abstract class CommonObject
|
|||
$keyList = (empty($InfoFieldList[2]) ? 'rowid' : $InfoFieldList[2].' as rowid');
|
||||
|
||||
if (count($InfoFieldList) > 3 && !empty($InfoFieldList[3])) {
|
||||
list ($parentName, $parentField) = explode('|', $InfoFieldList[3]);
|
||||
list($parentName, $parentField) = explode('|', $InfoFieldList[3]);
|
||||
$keyList .= ', '.$parentField;
|
||||
}
|
||||
if (count($InfoFieldList) > 4 && !empty($InfoFieldList[4])) {
|
||||
|
|
@ -7774,7 +7789,7 @@ abstract class CommonObject
|
|||
$type = 'varchar'; // convert varchar(xx) int varchar
|
||||
}
|
||||
if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
|
||||
$type = (($this->fields[$key]['type']=='checkbox')?$this->fields[$key]['type']:'select');
|
||||
$type = (($this->fields[$key]['type']=='checkbox') ? $this->fields[$key]['type'] : 'select');
|
||||
}
|
||||
if (preg_match('/^integer:(.*):(.*)/i', $val['type'], $reg)) {
|
||||
$type = 'link';
|
||||
|
|
@ -7897,7 +7912,7 @@ abstract class CommonObject
|
|||
$value = price($value, 0, $langs, 0, 0, -1, $conf->currency);
|
||||
}
|
||||
} elseif ($type == 'select') {
|
||||
$value = isset($param['options'][$value])?$param['options'][$value]:'';
|
||||
$value = isset($param['options'][$value]) ? $param['options'][$value] : '';
|
||||
} elseif ($type == 'sellist') {
|
||||
$param_list = array_keys($param['options']);
|
||||
$InfoFieldList = explode(":", $param_list[0]);
|
||||
|
|
@ -8340,23 +8355,31 @@ abstract class CommonObject
|
|||
if (!$validate->isTimestamp($fieldValue)) {
|
||||
$this->setFieldError($fieldKey, $validate->error);
|
||||
return false;
|
||||
} else { return true; }
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} elseif ($type == 'duration') {
|
||||
if (!$validate->isDuration($fieldValue)) {
|
||||
$this->setFieldError($fieldKey, $validate->error);
|
||||
return false;
|
||||
} else { return true; }
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} elseif (in_array($type, array('double', 'real', 'price'))) {
|
||||
// is numeric
|
||||
if (!$validate->isNumeric($fieldValue)) {
|
||||
$this->setFieldError($fieldKey, $validate->error);
|
||||
return false;
|
||||
} else { return true; }
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} elseif ($type == 'boolean') {
|
||||
if (!$validate->isBool($fieldValue)) {
|
||||
$this->setFieldError($fieldKey, $validate->error);
|
||||
return false;
|
||||
} else { return true; }
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} elseif ($type == 'mail') {
|
||||
if (!$validate->isEmail($fieldValue)) {
|
||||
$this->setFieldError($fieldKey, $validate->error);
|
||||
|
|
@ -8366,17 +8389,23 @@ abstract class CommonObject
|
|||
if (!$validate->isUrl($fieldValue)) {
|
||||
$this->setFieldError($fieldKey, $validate->error);
|
||||
return false;
|
||||
} else { return true; }
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} elseif ($type == 'phone') {
|
||||
if (!$validate->isPhone($fieldValue)) {
|
||||
$this->setFieldError($fieldKey, $validate->error);
|
||||
return false;
|
||||
} else { return true; }
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} elseif ($type == 'select' || $type == 'radio') {
|
||||
if (!isset($param['options'][$fieldValue])) {
|
||||
$this->error = $langs->trans('RequireValidValue');
|
||||
return false;
|
||||
} else { return true; }
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} elseif ($type == 'sellist' || $type == 'chkbxlst') {
|
||||
$param_list = array_keys($param['options']);
|
||||
$InfoFieldList = explode(":", $param_list[0]);
|
||||
|
|
@ -8391,7 +8420,9 @@ abstract class CommonObject
|
|||
if (!$validate->isInDb($value_arr, $InfoFieldList[0], $selectkey)) {
|
||||
$this->setFieldError($fieldKey, $validate->error);
|
||||
return false;
|
||||
} else { return true; }
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} elseif ($type == 'link') {
|
||||
$param_list = array_keys($param['options']); // $param_list='ObjectName:classPath'
|
||||
$InfoFieldList = explode(":", $param_list[0]);
|
||||
|
|
@ -8400,7 +8431,9 @@ abstract class CommonObject
|
|||
if (!$validate->isFetchable($fieldValue, $classname, $classpath)) {
|
||||
$this->setFieldError($fieldKey, $validate->error);
|
||||
return false;
|
||||
} else { return true; }
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// if no test failled all is ok
|
||||
|
|
@ -8902,7 +8935,7 @@ abstract class CommonObject
|
|||
$buyPrice = 0;
|
||||
|
||||
if (($unitPrice > 0) && (isset($conf->global->ForceBuyingPriceIfNull) && getDolGlobalInt('ForceBuyingPriceIfNull') > 0)) {
|
||||
// When ForceBuyingPriceIfNull is set
|
||||
// When ForceBuyingPriceIfNull is set
|
||||
$buyPrice = $unitPrice * (1 - $discountPercent / 100);
|
||||
} else {
|
||||
// Get cost price for margin calculation
|
||||
|
|
@ -9007,7 +9040,7 @@ abstract class CommonObject
|
|||
$return = '<!-- Photo -->'."\n";
|
||||
$nbphoto = 0;
|
||||
|
||||
$filearray = dol_dir_list($dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1);
|
||||
$filearray = dol_dir_list($dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ? SORT_DESC : SORT_ASC), 1);
|
||||
|
||||
/*if (getDolGlobalInt('PRODUCT_USE_OLD_PATH_FOR_PHOTO')) // For backward compatiblity, we scan also old dirs
|
||||
{
|
||||
|
|
@ -9084,7 +9117,7 @@ abstract class CommonObject
|
|||
if ($val['share']) {
|
||||
if (empty($maxHeight) || ($photo_vignette && $imgarray['height'] > $maxHeight)) {
|
||||
$return .= '<!-- Show original file (thumb not yet available with shared links) -->';
|
||||
$return .= '<img class="photo photowithmargin'.($addphotorefcss ? ' '.$addphotorefcss : '').'"'.($maxHeight ?' height="'.$maxHeight.'"': '').' src="'.DOL_URL_ROOT.'/viewimage.php?hashp='.urlencode($val['share']).($cache ? '&cache='.urlencode($cache) : '').'" title="'.dol_escape_htmltag($alt).'">';
|
||||
$return .= '<img class="photo photowithmargin'.($addphotorefcss ? ' '.$addphotorefcss : '').'"'.($maxHeight ? ' height="'.$maxHeight.'"' : '').' src="'.DOL_URL_ROOT.'/viewimage.php?hashp='.urlencode($val['share']).($cache ? '&cache='.urlencode($cache) : '').'" title="'.dol_escape_htmltag($alt).'">';
|
||||
} else {
|
||||
$return .= '<!-- Show original file -->';
|
||||
$return .= '<img class="photo photowithmargin'.($addphotorefcss ? ' '.$addphotorefcss : '').'" height="'.$maxHeight.'" src="'.DOL_URL_ROOT.'/viewimage.php?hashp='.urlencode($val['share']).($cache ? '&cache='.urlencode($cache) : '').'" title="'.dol_escape_htmltag($alt).'">';
|
||||
|
|
@ -9096,7 +9129,7 @@ abstract class CommonObject
|
|||
} else {
|
||||
if (empty($maxHeight) || ($photo_vignette && $imgarray['height'] > $maxHeight)) {
|
||||
$return .= '<!-- Show thumb -->';
|
||||
$return .= '<img class="photo photowithmargin'.($addphotorefcss ? ' '.$addphotorefcss : '').' maxwidth150onsmartphone maxwidth200"'.($maxHeight ?' height="'.$maxHeight.'"': '').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$this->entity.($cache ? '&cache='.urlencode($cache) : '').'&file='.urlencode($pdirthumb.$photo_vignette).'" title="'.dol_escape_htmltag($alt).'">';
|
||||
$return .= '<img class="photo photowithmargin'.($addphotorefcss ? ' '.$addphotorefcss : '').' maxwidth150onsmartphone maxwidth200"'.($maxHeight ? ' height="'.$maxHeight.'"' : '').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$this->entity.($cache ? '&cache='.urlencode($cache) : '').'&file='.urlencode($pdirthumb.$photo_vignette).'" title="'.dol_escape_htmltag($alt).'">';
|
||||
} else {
|
||||
$return .= '<!-- Show original file -->';
|
||||
$return .= '<img class="photo photowithmargin'.($addphotorefcss ? ' '.$addphotorefcss : '').'" height="'.$maxHeight.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$this->entity.($cache ? '&cache='.urlencode($cache) : '').'&file='.urlencode($pdir.$photo).'" title="'.dol_escape_htmltag($alt).'">';
|
||||
|
|
@ -9393,7 +9426,7 @@ abstract class CommonObject
|
|||
} elseif ($this->isInt($info)) {
|
||||
$queryarray[$field] = (int) $this->{$field}; // If '0', it may be set to null later if $info['notnull'] == -1
|
||||
} elseif ($this->isFloat($info)) {
|
||||
$queryarray[$field] = (double) $this->{$field}; // If '0', it may be set to null later if $info['notnull'] == -1
|
||||
$queryarray[$field] = (float) $this->{$field}; // If '0', it may be set to null later if $info['notnull'] == -1
|
||||
}
|
||||
} else {
|
||||
$queryarray[$field] = null;
|
||||
|
|
@ -9441,7 +9474,7 @@ abstract class CommonObject
|
|||
if (empty($obj->$field)) {
|
||||
$this->$field = null;
|
||||
} else {
|
||||
$this->$field = (double) $obj->$field;
|
||||
$this->$field = (float) $obj->$field;
|
||||
}
|
||||
} else {
|
||||
if (!is_null($obj->$field) || (isset($info['notnull']) && $info['notnull'] == 1)) {
|
||||
|
|
@ -9456,11 +9489,11 @@ abstract class CommonObject
|
|||
if (empty($obj->$field)) {
|
||||
$this->$field = null;
|
||||
} else {
|
||||
$this->$field = (double) $obj->$field;
|
||||
$this->$field = (float) $obj->$field;
|
||||
}
|
||||
} else {
|
||||
if (!is_null($obj->$field) || (isset($info['notnull']) && $info['notnull'] == 1)) {
|
||||
$this->$field = (double) $obj->$field;
|
||||
$this->$field = (float) $obj->$field;
|
||||
} else {
|
||||
$this->$field = null;
|
||||
}
|
||||
|
|
@ -10534,6 +10567,7 @@ abstract class CommonObject
|
|||
if ($project_result >= 0) {
|
||||
$element = 'projet/'.dol_sanitizeFileName($this->project->ref).'/';
|
||||
}
|
||||
// no break
|
||||
default:
|
||||
$element = $this->element;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ abstract class CommonOrderLine extends CommonObjectLine
|
|||
* Product description
|
||||
* @var string
|
||||
*/
|
||||
public $product_desc;
|
||||
public $product_desc;
|
||||
|
||||
/**
|
||||
* Product use lot
|
||||
|
|
|
|||
|
|
@ -283,7 +283,7 @@ trait CommonPeople
|
|||
$this->firstname = dol_ucwords(dol_strtolower($this->firstname));
|
||||
$this->name = dol_ucwords(dol_strtolower($this->name));
|
||||
if (property_exists($this, 'name_alias')) {
|
||||
$this->name_alias = isset($this->name_alias)?dol_ucwords(dol_strtolower($this->name_alias)):'';
|
||||
$this->name_alias = isset($this->name_alias) ? dol_ucwords(dol_strtolower($this->name_alias)) : '';
|
||||
}
|
||||
}
|
||||
if (getDolGlobalString('MAIN_ALL_TO_UPPER')) {
|
||||
|
|
|
|||
|
|
@ -298,7 +298,7 @@ abstract class CommonStickerGenerator extends CommonDocGenerator
|
|||
// phpcs:enable
|
||||
$this->_Metric = $format['metric'];
|
||||
$this->_Avery_Name = $format['name'];
|
||||
$this->_Avery_Code = empty($format['code'])?'':$format['code'];
|
||||
$this->_Avery_Code = empty($format['code']) ? '' : $format['code'];
|
||||
$this->_Margin_Left = $this->convertMetric($format['marginLeft'], $this->_Metric, $this->_Metric_Doc);
|
||||
$this->_Margin_Top = $this->convertMetric($format['marginTop'], $this->_Metric, $this->_Metric_Doc);
|
||||
$this->_X_Space = $this->convertMetric($format['SpaceX'], $this->_Metric, $this->_Metric_Doc);
|
||||
|
|
|
|||
|
|
@ -262,7 +262,9 @@ class Conf extends stdClass
|
|||
// Unset all old modules values
|
||||
if (!empty($this->modules)) {
|
||||
foreach ($this->modules as $m) {
|
||||
if (isset($this->$m)) unset($this->$m);
|
||||
if (isset($this->$m)) {
|
||||
unset($this->$m);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -687,15 +689,23 @@ class Conf extends stdClass
|
|||
// If module lot/serial enabled, we force the inc/dec mode to STOCK_CALCULATE_ON_SHIPMENT_CLOSE and STOCK_CALCULATE_ON_RECEPTION_CLOSE
|
||||
$this->global->STOCK_CALCULATE_ON_BILL = 0;
|
||||
$this->global->STOCK_CALCULATE_ON_VALIDATE_ORDER = 0;
|
||||
if (empty($this->global->STOCK_CALCULATE_ON_SHIPMENT)) $this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE = 1;
|
||||
if (empty($this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) $this->global->STOCK_CALCULATE_ON_SHIPMENT = 1;
|
||||
if (empty($this->global->STOCK_CALCULATE_ON_SHIPMENT)) {
|
||||
$this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE = 1;
|
||||
}
|
||||
if (empty($this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) {
|
||||
$this->global->STOCK_CALCULATE_ON_SHIPMENT = 1;
|
||||
}
|
||||
$this->global->STOCK_CALCULATE_ON_SUPPLIER_BILL = 0;
|
||||
$this->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER = 0;
|
||||
if (!isModEnabled('reception')) {
|
||||
$this->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER = 1;
|
||||
} else {
|
||||
if (empty($this->global->STOCK_CALCULATE_ON_RECEPTION)) $this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE = 1;
|
||||
if (empty($this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) $this->global->STOCK_CALCULATE_ON_RECEPTION = 1;
|
||||
if (empty($this->global->STOCK_CALCULATE_ON_RECEPTION)) {
|
||||
$this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE = 1;
|
||||
}
|
||||
if (empty($this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) {
|
||||
$this->global->STOCK_CALCULATE_ON_RECEPTION = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -75,13 +75,13 @@ class Ctyperesource extends CommonDict
|
|||
// Clean parameters
|
||||
|
||||
if (isset($this->code)) {
|
||||
$this->code = trim($this->code);
|
||||
$this->code = trim($this->code);
|
||||
}
|
||||
if (isset($this->label)) {
|
||||
$this->label = trim($this->label);
|
||||
$this->label = trim($this->label);
|
||||
}
|
||||
if (isset($this->active)) {
|
||||
$this->active = trim($this->active);
|
||||
$this->active = trim($this->active);
|
||||
}
|
||||
|
||||
// Insert request
|
||||
|
|
@ -273,13 +273,13 @@ class Ctyperesource extends CommonDict
|
|||
// Clean parameters
|
||||
|
||||
if (isset($this->code)) {
|
||||
$this->code = trim($this->code);
|
||||
$this->code = trim($this->code);
|
||||
}
|
||||
if (isset($this->label)) {
|
||||
$this->label = trim($this->label);
|
||||
$this->label = trim($this->label);
|
||||
}
|
||||
if (isset($this->active)) {
|
||||
$this->active = trim($this->active);
|
||||
$this->active = trim($this->active);
|
||||
}
|
||||
|
||||
// Check parameters
|
||||
|
|
|
|||
|
|
@ -406,7 +406,6 @@ class CUnits extends CommonDict
|
|||
*/
|
||||
public function getUnitFromCode($code, $mode = 'code', $unit_type = '')
|
||||
{
|
||||
|
||||
if ($mode == 'short_label') {
|
||||
return dol_getIdFromCode($this->db, $code, 'c_units', 'short_label', 'rowid', 0, " AND unit_type = '".$this->db->escape($unit_type)."'");
|
||||
} elseif ($mode == 'code') {
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ class DolEditor
|
|||
$rows = round($height / 20);
|
||||
}
|
||||
if (!$cols) {
|
||||
$cols = ($width ?round($width / 6) : 80);
|
||||
$cols = ($width ? round($width / 6) : 80);
|
||||
}
|
||||
$shorttoolbarname = preg_replace('/_encoded$/', '', $toolbarname);
|
||||
|
||||
|
|
|
|||
|
|
@ -1294,13 +1294,15 @@ class DolGraph
|
|||
$this->stringtoshow .= '});' . "\n";
|
||||
} else {
|
||||
// Other cases, graph of type 'bars', 'lines', 'linesnopoint'
|
||||
$type = 'bar'; $xaxis = '';
|
||||
$type = 'bar';
|
||||
$xaxis = '';
|
||||
|
||||
if (!isset($this->type[$firstlot]) || $this->type[$firstlot] == 'bars') {
|
||||
$type = 'bar';
|
||||
}
|
||||
if (isset($this->type[$firstlot]) && $this->type[$firstlot] == 'horizontalbars') {
|
||||
$type = 'bar'; $xaxis = "indexAxis: 'y', ";
|
||||
$type = 'bar';
|
||||
$xaxis = "indexAxis: 'y', ";
|
||||
}
|
||||
if (isset($this->type[$firstlot]) && ($this->type[$firstlot] == 'lines' || $this->type[$firstlot] == 'linesnopoint')) {
|
||||
$type = 'line';
|
||||
|
|
|
|||
|
|
@ -780,8 +780,11 @@ class dolReceiptPrinter extends Printer
|
|||
$this->printer->text($title.$spaces.str_pad(price($object->total_ttc), 10, ' ', STR_PAD_LEFT)."\n");
|
||||
break;
|
||||
case 'DOL_PRINT_CURR_DATE':
|
||||
if (strlen($vals[$tplline]['value'])<2) $this->printer->text(date('d/m/Y H:i:s')."\n");
|
||||
else $this->printer->text(date($vals[$tplline]['value'])."\n");
|
||||
if (strlen($vals[$tplline]['value'])<2) {
|
||||
$this->printer->text(date('d/m/Y H:i:s')."\n");
|
||||
} else {
|
||||
$this->printer->text(date($vals[$tplline]['value'])."\n");
|
||||
}
|
||||
break;
|
||||
case 'DOL_LINE_FEED':
|
||||
$this->printer->feed();
|
||||
|
|
@ -924,7 +927,7 @@ class dolReceiptPrinter extends Printer
|
|||
$action = '';
|
||||
$reshook = $hookmanager->executeHooks('sendToPrinterAfter', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
if (!$reshook || $reshook < 0 ) {
|
||||
if (!$reshook || $reshook < 0) {
|
||||
$this->printer->text($vals[$tplline]['tag']);
|
||||
$this->printer->text($vals[$tplline]['value']);
|
||||
$this->errors[] = 'UnknowTag: <'.strtolower($vals[$tplline]['tag']).'>';
|
||||
|
|
|
|||
|
|
@ -96,7 +96,6 @@
|
|||
*/
|
||||
class EvalMath
|
||||
{
|
||||
|
||||
public $suppress_errors = false;
|
||||
|
||||
public $last_error = null;
|
||||
|
|
@ -155,8 +154,8 @@ class EvalMath
|
|||
if (substr($expr, - 1, 1) == ';') {
|
||||
$expr = substr($expr, 0, strlen($expr) - 1); // strip semicolons at the end
|
||||
}
|
||||
// ===============
|
||||
// is it a variable assignment?
|
||||
// ===============
|
||||
// is it a variable assignment?
|
||||
$matches = array();
|
||||
if (preg_match('/^\s*([a-z]\w*)\s*=\s*(.+)$/', $expr, $matches)) {
|
||||
if (in_array($matches[1], $this->vb)) { // make sure we're not assigning to a constant
|
||||
|
|
@ -244,7 +243,7 @@ class EvalMath
|
|||
$ops_p = array('+' => 0, '-' => 0, '*' => 1, '/' => 1, '_' => 1, '^' => 2); // operator precedence
|
||||
|
||||
$expecting_op = false; // we use this in syntax-checking the expression
|
||||
// and determining when a - is a negation
|
||||
// and determining when a - is a negation
|
||||
|
||||
$matches = array();
|
||||
if (preg_match("/[^\w\s+*^\/()\.,-]/", $expr, $matches)) { // make sure the characters are all good
|
||||
|
|
@ -383,7 +382,7 @@ class EvalMath
|
|||
$stack = new EvalMathStack();
|
||||
|
||||
foreach ($tokens as $token) { // nice and easy
|
||||
// if the token is a binary operator, pop two values off the stack, do the operation, and push the result back on
|
||||
// if the token is a binary operator, pop two values off the stack, do the operation, and push the result back on
|
||||
$matches = array();
|
||||
if (in_array($token, array('+', '-', '*', '/', '^'))) {
|
||||
if (is_null($op2 = $stack->pop())) {
|
||||
|
|
|
|||
|
|
@ -1027,7 +1027,7 @@ class ExtraFields
|
|||
// search filter on a date extrafield shows two inputs to select a date range
|
||||
$prefill = array(
|
||||
'start' => isset($value['start']) ? $value['start'] : '',
|
||||
'end' => isset($value['end']) ? $value['end'] : ''
|
||||
'end' => isset($value['end']) ? $value['end'] : ''
|
||||
);
|
||||
$out = '<div ' . ($moreparam ? $moreparam : '') . '><div class="nowrap">';
|
||||
$out .= $form->selectDate($prefill['start'], $keyprefix.$key.$keysuffix.'_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
|
||||
|
|
@ -1052,7 +1052,7 @@ class ExtraFields
|
|||
// search filter on a date extrafield shows two inputs to select a date range
|
||||
$prefill = array(
|
||||
'start' => isset($value['start']) ? $value['start'] : '',
|
||||
'end' => isset($value['end']) ? $value['end'] : ''
|
||||
'end' => isset($value['end']) ? $value['end'] : ''
|
||||
);
|
||||
$out = '<div ' . ($moreparam ? $moreparam : '') . '><div class="nowrap">';
|
||||
$out .= $form->selectDate($prefill['start'], $keyprefix.$key.$keysuffix.'_start', 1, 1, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"), 'tzuserrel');
|
||||
|
|
@ -1063,7 +1063,7 @@ class ExtraFields
|
|||
// TODO Must also support $moreparam
|
||||
$out = $form->selectDate($value, $keyprefix.$key.$keysuffix, $showtime, $showtime, $required, '', 1, (($keyprefix != 'search_' && $keyprefix != 'search_options_') ? 1 : 0), 0, 1, '', '', '', 1, '', '', 'tzuserrel');
|
||||
}
|
||||
} elseif (in_array($type, array('int', 'integer'))) {
|
||||
} elseif (in_array($type, array('int', 'integer'))) {
|
||||
$tmp = explode(',', $size);
|
||||
$newsize = $tmp[0];
|
||||
$out = '<input type="text" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" maxlength="'.$newsize.'" value="'.dol_escape_htmltag($value).'"'.($moreparam ? $moreparam : '').'>';
|
||||
|
|
@ -1362,7 +1362,7 @@ class ExtraFields
|
|||
if (!is_array($value)) {
|
||||
$value_arr = explode(',', $value);
|
||||
}
|
||||
$out = $form->multiselectarray($keyprefix.$key.$keysuffix, (empty($param['options']) ?null:$param['options']), $value_arr, '', 0, '', 0, '100%');
|
||||
$out = $form->multiselectarray($keyprefix.$key.$keysuffix, (empty($param['options']) ? null : $param['options']), $value_arr, '', 0, '', 0, '100%');
|
||||
} elseif ($type == 'radio') {
|
||||
$out = '';
|
||||
foreach ($param['options'] as $keyopt => $val) {
|
||||
|
|
@ -1395,7 +1395,7 @@ class ExtraFields
|
|||
$keyList = (empty($InfoFieldList[2]) ? 'rowid' : $InfoFieldList[2].' as rowid');
|
||||
|
||||
if (count($InfoFieldList) > 3 && !empty($InfoFieldList[3])) {
|
||||
list ($parentName, $parentField) = explode('|', $InfoFieldList[3]);
|
||||
list($parentName, $parentField) = explode('|', $InfoFieldList[3]);
|
||||
$keyList .= ', '.$parentField;
|
||||
}
|
||||
if (count($InfoFieldList) > 4 && !empty($InfoFieldList[4])) {
|
||||
|
|
@ -1913,7 +1913,9 @@ class ExtraFields
|
|||
}
|
||||
}
|
||||
}
|
||||
if (!empty($toprint)) $value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
|
||||
if (!empty($toprint)) {
|
||||
$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
|
||||
}
|
||||
} else {
|
||||
dol_syslog(get_class($this).'::showOutputField error '.$this->db->lasterror(), LOG_WARNING);
|
||||
}
|
||||
|
|
@ -2039,8 +2041,8 @@ class ExtraFields
|
|||
$disabledcookiewrite = 1; // We keep status of group unchanged into the cookie
|
||||
}
|
||||
|
||||
$out = '<'.$tagtype.' id="trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').'" class="trextrafieldseparator trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').'">';
|
||||
$out .= '<'.$tagtype_dyn.' '.(!empty($colspan)?'colspan="' . $colspan . '"':'').'>';
|
||||
$out = '<'.$tagtype.' id="trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'" class="trextrafieldseparator trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'">';
|
||||
$out .= '<'.$tagtype_dyn.' '.(!empty($colspan) ? 'colspan="' . $colspan . '"' : '').'>';
|
||||
// Some js code will be injected here to manage the collapsing of extrafields
|
||||
// Output the picto
|
||||
$out .= '<span class="'.($extrafield_collapse_display_value ? 'cursorpointer ' : '').($extrafield_collapse_display_value == 0 ? 'fas fa-square opacitymedium' : 'far fa-'.(($expand_display ? 'minus' : 'plus').'-square')).'"></span>';
|
||||
|
|
@ -2071,14 +2073,14 @@ class ExtraFields
|
|||
$out .= ' document.cookie = "DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key.'=1; path='.$_SERVER["PHP_SELF"].'"'."\n";
|
||||
}
|
||||
}
|
||||
$out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').'").click(function(){'."\n";
|
||||
$out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'").click(function(){'."\n";
|
||||
$out .= ' console.log("We click on collapse/uncollapse to hide/show .trextrafields_collapse'.$collapse_group.'");'."\n";
|
||||
$out .= ' jQuery(".trextrafields_collapse'.$collapse_group.'").toggle(100, function(){'."\n";
|
||||
$out .= ' if (jQuery(".trextrafields_collapse'.$collapse_group.'").is(":hidden")) {'."\n";
|
||||
$out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').' '.$tagtype_dyn.' span").addClass("fa-plus-square").removeClass("fa-minus-square");'."\n";
|
||||
$out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').' '.$tagtype_dyn.' span").addClass("fa-plus-square").removeClass("fa-minus-square");'."\n";
|
||||
$out .= ' document.cookie = "DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key.'=0; path='.$_SERVER["PHP_SELF"].'"'."\n";
|
||||
$out .= ' } else {'."\n";
|
||||
$out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').' '.$tagtype_dyn.' span").addClass("fa-minus-square").removeClass("fa-plus-square");'."\n";
|
||||
$out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').' '.$tagtype_dyn.' span").addClass("fa-minus-square").removeClass("fa-plus-square");'."\n";
|
||||
$out .= ' document.cookie = "DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key.'=1; path='.$_SERVER["PHP_SELF"].'"'."\n";
|
||||
$out .= ' }'."\n";
|
||||
$out .= ' });'."\n";
|
||||
|
|
|
|||
|
|
@ -211,7 +211,6 @@ class FileUpload
|
|||
*/
|
||||
protected function getFileObject($file_name)
|
||||
{
|
||||
|
||||
$file_path = $this->options['upload_dir'].$file_name;
|
||||
if (is_file($file_path) && $file_name[0] !== '.') {
|
||||
$file = new stdClass();
|
||||
|
|
@ -309,8 +308,9 @@ class FileUpload
|
|||
$file_size = $_SERVER['CONTENT_LENGTH'];
|
||||
}
|
||||
if ($this->options['max_file_size'] && (
|
||||
$file_size > $this->options['max_file_size'] ||
|
||||
$file->size > $this->options['max_file_size'])
|
||||
$file_size > $this->options['max_file_size'] ||
|
||||
$file->size > $this->options['max_file_size']
|
||||
)
|
||||
) {
|
||||
$file->error = 'maxFileSize';
|
||||
return false;
|
||||
|
|
@ -321,7 +321,8 @@ class FileUpload
|
|||
return false;
|
||||
}
|
||||
if (is_numeric($this->options['max_number_of_files']) && (
|
||||
count($this->getFileObjects()) >= $this->options['max_number_of_files'])
|
||||
count($this->getFileObjects()) >= $this->options['max_number_of_files']
|
||||
)
|
||||
) {
|
||||
$file->error = 'maxNumberOfFiles';
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -2644,22 +2644,34 @@ class Form
|
|||
$sql = 'SELECT b.rowid, b.ref, b.label, b.fk_product';
|
||||
$sql .= ' FROM ' . MAIN_DB_PREFIX . 'bom_bom as b';
|
||||
$sql .= ' WHERE b.entity IN (' . getEntity('bom') . ')';
|
||||
if (!empty($status)) $sql .= ' AND status = ' . (int) $status;
|
||||
if (!empty($type)) $sql .= ' AND bomtype = ' . (int) $type;
|
||||
if (!empty($TProducts)) $sql .= ' AND fk_product IN (' . $this->db->sanitize(implode(',', $TProducts)) . ')';
|
||||
if (!empty($limit)) $sql .= ' LIMIT ' . (int) $limit;
|
||||
if (!empty($status)) {
|
||||
$sql .= ' AND status = ' . (int) $status;
|
||||
}
|
||||
if (!empty($type)) {
|
||||
$sql .= ' AND bomtype = ' . (int) $type;
|
||||
}
|
||||
if (!empty($TProducts)) {
|
||||
$sql .= ' AND fk_product IN (' . $this->db->sanitize(implode(',', $TProducts)) . ')';
|
||||
}
|
||||
if (!empty($limit)) {
|
||||
$sql .= ' LIMIT ' . (int) $limit;
|
||||
}
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
if ($showempty) {
|
||||
$out .= '<option value="-1"';
|
||||
if (empty($selected)) $out .= ' selected';
|
||||
if (empty($selected)) {
|
||||
$out .= ' selected';
|
||||
}
|
||||
$out .= '> </option>';
|
||||
}
|
||||
while ($obj = $db->fetch_object($resql)) {
|
||||
$product = new Product($db);
|
||||
$res = $product->fetch($obj->fk_product);
|
||||
$out .= '<option value="' . $obj->rowid . '"';
|
||||
if ($obj->rowid == $selected) $out .= 'selected';
|
||||
if ($obj->rowid == $selected) {
|
||||
$out .= 'selected';
|
||||
}
|
||||
$out .= '>' . $obj->ref . ' - ' . $product->label . ' - ' . $obj->label . '</option>';
|
||||
}
|
||||
} else {
|
||||
|
|
@ -3430,7 +3442,7 @@ class Form
|
|||
$urloption = ($socid > 0 ? 'socid=' . $socid . '&' : '') . 'htmlname=' . $htmlname . '&outjson=1&price_level=' . $price_level . '&type=' . $filtertype . '&mode=2&status=' . $status . '&finished=' . $finished . '&alsoproductwithnosupplierprice=' . $alsoproductwithnosupplierprice;
|
||||
print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
|
||||
|
||||
print ($hidelabel ? '' : $langs->trans("RefOrLabel") . ' : ') . '<input type="text" class="minwidth300" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . $placeholder . '"' : '') . '>';
|
||||
print($hidelabel ? '' : $langs->trans("RefOrLabel") . ' : ') . '<input type="text" class="minwidth300" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . $placeholder . '"' : '') . '>';
|
||||
} else {
|
||||
print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', $status, 0, 0, $alsoproductwithnosupplierprice, $morecss, 0, $placeholder);
|
||||
}
|
||||
|
|
@ -3737,8 +3749,7 @@ class Form
|
|||
if (empty($alsoproductwithnosupplierprice)) { // No supplier price defined for couple product/supplier
|
||||
$optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>';
|
||||
$outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier");
|
||||
} else // No supplier price defined for product, even on other suppliers
|
||||
{
|
||||
} else { // No supplier price defined for product, even on other suppliers
|
||||
$optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>';
|
||||
$outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier");
|
||||
}
|
||||
|
|
@ -7324,7 +7335,9 @@ class Form
|
|||
$out = '';
|
||||
|
||||
// check parameters
|
||||
if (is_null($ajaxoptions)) $ajaxoptions = array();
|
||||
if (is_null($ajaxoptions)) {
|
||||
$ajaxoptions = array();
|
||||
}
|
||||
|
||||
if (!empty($conf->use_javascript_ajax) && getDolGlobalString('TICKET_USE_SEARCH_TO_SELECT')) {
|
||||
$placeholder = '';
|
||||
|
|
@ -7340,8 +7353,9 @@ class Form
|
|||
$urloption = '';
|
||||
$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
|
||||
|
||||
if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel") . ' : ';
|
||||
elseif ($hidelabel > 1) {
|
||||
if (empty($hidelabel)) {
|
||||
$out .= $langs->trans("RefOrLabel") . ' : ';
|
||||
} elseif ($hidelabel > 1) {
|
||||
$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
|
||||
if ($hidelabel == 2) {
|
||||
$out .= img_picto($langs->trans("Search"), 'search');
|
||||
|
|
@ -7401,14 +7415,20 @@ class Form
|
|||
// For natural search
|
||||
$scrit = explode(' ', $filterkey);
|
||||
$i = 0;
|
||||
if (count($scrit) > 1) $sql .= "(";
|
||||
if (count($scrit) > 1) {
|
||||
$sql .= "(";
|
||||
}
|
||||
foreach ($scrit as $crit) {
|
||||
if ($i > 0) $sql .= " AND ";
|
||||
if ($i > 0) {
|
||||
$sql .= " AND ";
|
||||
}
|
||||
$sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.subject LIKE '" . $this->db->escape($prefix . $crit) . "%'";
|
||||
$sql .= ")";
|
||||
$i++;
|
||||
}
|
||||
if (count($scrit) > 1) $sql .= ")";
|
||||
if (count($scrit) > 1) {
|
||||
$sql .= ")";
|
||||
}
|
||||
$sql .= ')';
|
||||
}
|
||||
|
||||
|
|
@ -7436,12 +7456,19 @@ class Form
|
|||
// Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'.
|
||||
//if (!empty($conf->use_javascript_ajax) || $forcecombo) $textifempty='';
|
||||
if (getDolGlobalString('TICKET_USE_SEARCH_TO_SELECT')) {
|
||||
if ($showempty && !is_numeric($showempty)) $textifempty = $langs->trans($showempty);
|
||||
else $textifempty .= $langs->trans("All");
|
||||
if ($showempty && !is_numeric($showempty)) {
|
||||
$textifempty = $langs->trans($showempty);
|
||||
} else {
|
||||
$textifempty .= $langs->trans("All");
|
||||
}
|
||||
} else {
|
||||
if ($showempty && !is_numeric($showempty)) $textifempty = $langs->trans($showempty);
|
||||
if ($showempty && !is_numeric($showempty)) {
|
||||
$textifempty = $langs->trans($showempty);
|
||||
}
|
||||
}
|
||||
if ($showempty) {
|
||||
$out .= '<option value="0" selected>' . $textifempty . '</option>';
|
||||
}
|
||||
if ($showempty) $out .= '<option value="0" selected>' . $textifempty . '</option>';
|
||||
|
||||
$i = 0;
|
||||
while ($num && $i < $num) {
|
||||
|
|
@ -7500,7 +7527,9 @@ class Form
|
|||
$opt .= '>';
|
||||
$opt .= $objp->ref;
|
||||
$objRef = $objp->ref;
|
||||
if (!empty($filterkey) && $filterkey != '') $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
|
||||
if (!empty($filterkey) && $filterkey != '') {
|
||||
$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
|
||||
}
|
||||
|
||||
$opt .= "</option>\n";
|
||||
$optJson = array('key' => $outkey, 'value' => $outref, 'type' => $outtype);
|
||||
|
|
@ -7532,7 +7561,9 @@ class Form
|
|||
$out = '';
|
||||
|
||||
// check parameters
|
||||
if (is_null($ajaxoptions)) $ajaxoptions = array();
|
||||
if (is_null($ajaxoptions)) {
|
||||
$ajaxoptions = array();
|
||||
}
|
||||
|
||||
if (!empty($conf->use_javascript_ajax) && getDolGlobalString('TICKET_USE_SEARCH_TO_SELECT')) {
|
||||
$placeholder = '';
|
||||
|
|
@ -7548,8 +7579,9 @@ class Form
|
|||
$urloption = '';
|
||||
$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
|
||||
|
||||
if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel") . ' : ';
|
||||
elseif ($hidelabel > 1) {
|
||||
if (empty($hidelabel)) {
|
||||
$out .= $langs->trans("RefOrLabel") . ' : ';
|
||||
} elseif ($hidelabel > 1) {
|
||||
$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
|
||||
if ($hidelabel == 2) {
|
||||
$out .= img_picto($langs->trans("Search"), 'search');
|
||||
|
|
@ -7608,14 +7640,20 @@ class Form
|
|||
// For natural search
|
||||
$scrit = explode(' ', $filterkey);
|
||||
$i = 0;
|
||||
if (count($scrit) > 1) $sql .= "(";
|
||||
if (count($scrit) > 1) {
|
||||
$sql .= "(";
|
||||
}
|
||||
foreach ($scrit as $crit) {
|
||||
if ($i > 0) $sql .= " AND ";
|
||||
if ($i > 0) {
|
||||
$sql .= " AND ";
|
||||
}
|
||||
$sql .= "p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%'";
|
||||
$sql .= "";
|
||||
$i++;
|
||||
}
|
||||
if (count($scrit) > 1) $sql .= ")";
|
||||
if (count($scrit) > 1) {
|
||||
$sql .= ")";
|
||||
}
|
||||
$sql .= ')';
|
||||
}
|
||||
|
||||
|
|
@ -7643,12 +7681,19 @@ class Form
|
|||
// Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'.
|
||||
//if (!empty($conf->use_javascript_ajax) || $forcecombo) $textifempty='';
|
||||
if (getDolGlobalString('PROJECT_USE_SEARCH_TO_SELECT')) {
|
||||
if ($showempty && !is_numeric($showempty)) $textifempty = $langs->trans($showempty);
|
||||
else $textifempty .= $langs->trans("All");
|
||||
if ($showempty && !is_numeric($showempty)) {
|
||||
$textifempty = $langs->trans($showempty);
|
||||
} else {
|
||||
$textifempty .= $langs->trans("All");
|
||||
}
|
||||
} else {
|
||||
if ($showempty && !is_numeric($showempty)) $textifempty = $langs->trans($showempty);
|
||||
if ($showempty && !is_numeric($showempty)) {
|
||||
$textifempty = $langs->trans($showempty);
|
||||
}
|
||||
}
|
||||
if ($showempty) {
|
||||
$out .= '<option value="0" selected>' . $textifempty . '</option>';
|
||||
}
|
||||
if ($showempty) $out .= '<option value="0" selected>' . $textifempty . '</option>';
|
||||
|
||||
$i = 0;
|
||||
while ($num && $i < $num) {
|
||||
|
|
@ -7710,7 +7755,9 @@ class Form
|
|||
$opt .= '>';
|
||||
$opt .= $objp->ref;
|
||||
$objRef = $objp->ref;
|
||||
if (!empty($filterkey) && $filterkey != '') $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
|
||||
if (!empty($filterkey) && $filterkey != '') {
|
||||
$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
|
||||
}
|
||||
|
||||
$opt .= "</option>\n";
|
||||
$optJson = array('key' => $outkey, 'value' => $outref, 'type' => $outtype);
|
||||
|
|
@ -7743,7 +7790,9 @@ class Form
|
|||
$out = '';
|
||||
|
||||
// check parameters
|
||||
if (is_null($ajaxoptions)) $ajaxoptions = array();
|
||||
if (is_null($ajaxoptions)) {
|
||||
$ajaxoptions = array();
|
||||
}
|
||||
|
||||
if (!empty($conf->use_javascript_ajax) && getDolGlobalString('TICKET_USE_SEARCH_TO_SELECT')) {
|
||||
$placeholder = '';
|
||||
|
|
@ -7761,8 +7810,9 @@ class Form
|
|||
|
||||
$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
|
||||
|
||||
if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel") . ' : ';
|
||||
elseif ($hidelabel > 1) {
|
||||
if (empty($hidelabel)) {
|
||||
$out .= $langs->trans("RefOrLabel") . ' : ';
|
||||
} elseif ($hidelabel > 1) {
|
||||
$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
|
||||
if ($hidelabel == 2) {
|
||||
$out .= img_picto($langs->trans("Search"), 'search');
|
||||
|
|
@ -7823,14 +7873,20 @@ class Form
|
|||
// For natural search
|
||||
$scrit = explode(' ', $filterkey);
|
||||
$i = 0;
|
||||
if (count($scrit) > 1) $sql .= "(";
|
||||
if (count($scrit) > 1) {
|
||||
$sql .= "(";
|
||||
}
|
||||
foreach ($scrit as $crit) {
|
||||
if ($i > 0) $sql .= " AND ";
|
||||
if ($i > 0) {
|
||||
$sql .= " AND ";
|
||||
}
|
||||
$sql .= "(p.firstname LIKE '" . $this->db->escape($prefix . $crit) . "%'";
|
||||
$sql .= " OR p.lastname LIKE '" . $this->db->escape($prefix . $crit) . "%')";
|
||||
$i++;
|
||||
}
|
||||
if (count($scrit) > 1) $sql .= ")";
|
||||
if (count($scrit) > 1) {
|
||||
$sql .= ")";
|
||||
}
|
||||
$sql .= ')';
|
||||
}
|
||||
if ($status != -1) {
|
||||
|
|
@ -7860,10 +7916,15 @@ class Form
|
|||
// Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'.
|
||||
//if (!empty($conf->use_javascript_ajax) || $forcecombo) $textifempty='';
|
||||
if (getDolGlobalString('PROJECT_USE_SEARCH_TO_SELECT')) {
|
||||
if ($showempty && !is_numeric($showempty)) $textifempty = $langs->trans($showempty);
|
||||
else $textifempty .= $langs->trans("All");
|
||||
if ($showempty && !is_numeric($showempty)) {
|
||||
$textifempty = $langs->trans($showempty);
|
||||
} else {
|
||||
$textifempty .= $langs->trans("All");
|
||||
}
|
||||
} else {
|
||||
if ($showempty && !is_numeric($showempty)) $textifempty = $langs->trans($showempty);
|
||||
if ($showempty && !is_numeric($showempty)) {
|
||||
$textifempty = $langs->trans($showempty);
|
||||
}
|
||||
}
|
||||
if ($showempty) {
|
||||
$out .= '<option value="-1" selected>' . $textifempty . '</option>';
|
||||
|
|
@ -8381,7 +8442,7 @@ class Form
|
|||
}
|
||||
}
|
||||
$out .= "</select>";
|
||||
// Add code for jquery to use multiselect
|
||||
// Add code for jquery to use multiselect
|
||||
if ($addjscombo && $jsbeautify) {
|
||||
// Enhance with select2
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
|
||||
|
|
@ -8528,7 +8589,7 @@ class Form
|
|||
return '';
|
||||
}
|
||||
|
||||
$out = '<select type="text"'.($textfortitle? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' ' . $morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>';
|
||||
$out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' ' . $morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>';
|
||||
|
||||
$formattedarrayresult = array();
|
||||
|
||||
|
|
@ -10541,7 +10602,8 @@ class Form
|
|||
|
||||
$nbofchars = dol_strlen($search_component_params_hidden);
|
||||
$arrayofandtags = array();
|
||||
$i = 0; $s = '';
|
||||
$i = 0;
|
||||
$s = '';
|
||||
$countparenthesis = 0;
|
||||
while ($i < $nbofchars) {
|
||||
$char = dol_substr($search_component_params_hidden, $i, 1);
|
||||
|
|
|
|||
|
|
@ -449,7 +449,7 @@ class FormAccounting extends Form
|
|||
}
|
||||
|
||||
|
||||
$out .= Form::selectarray($htmlname, $options, $selected, ($showempty ? (is_numeric($showempty) ? 1 : $showempty): 0), 0, 0, '', 0, 0, 0, '', $morecss, 1);
|
||||
$out .= Form::selectarray($htmlname, $options, $selected, ($showempty ? (is_numeric($showempty) ? 1 : $showempty) : 0), 0, 0, '', 0, 0, 0, '', $morecss, 1);
|
||||
|
||||
$this->nbaccounts = count($options) - ($showempty == 2 ? 1 : 0);
|
||||
|
||||
|
|
@ -533,7 +533,7 @@ class FormAccounting extends Form
|
|||
|
||||
// Build select
|
||||
$out = '';
|
||||
$out .= Form::selectarray($htmlname, $aux_account, $selectid, ($showempty ? (is_numeric($showempty) ? 1 : $showempty): 0), 0, 0, '', 0, 0, 0, '', $morecss, 1);
|
||||
$out .= Form::selectarray($htmlname, $aux_account, $selectid, ($showempty ? (is_numeric($showempty) ? 1 : $showempty) : 0), 0, 0, '', 0, 0, 0, '', $morecss, 1);
|
||||
//automatic filling if we give the name of the subledger_label input
|
||||
if (!empty($conf->use_javascript_ajax) && !empty($labelhtmlname)) {
|
||||
$out .= '<script nonce="'.getNonce().'">
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ class FormCategory extends Form
|
|||
}
|
||||
$i++;
|
||||
}
|
||||
print ('</select>');
|
||||
print('</select>');
|
||||
|
||||
return $num_rows;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.form.class.php';
|
|||
*/
|
||||
class FormCompany extends Form
|
||||
{
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Return list of labels (translated) of third parties type
|
||||
|
|
|
|||
|
|
@ -397,7 +397,7 @@ class FormFile
|
|||
$printer = 0;
|
||||
// The direct print feature is implemented only for such elements
|
||||
if (in_array($modulepart, array('contract', 'facture', 'supplier_proposal', 'propal', 'proposal', 'order', 'commande', 'expedition', 'commande_fournisseur', 'expensereport', 'delivery', 'ticket'))) {
|
||||
$printer = (!empty($user->rights->printing->read) && !empty($conf->printing->enabled)) ?true:false;
|
||||
$printer = (!empty($user->rights->printing->read) && !empty($conf->printing->enabled)) ? true : false;
|
||||
}
|
||||
|
||||
$hookmanager->initHooks(array('formfile'));
|
||||
|
|
@ -1205,7 +1205,7 @@ class FormFile
|
|||
|
||||
// Define relative path used to store the file
|
||||
if (empty($relativepath)) {
|
||||
$relativepath = (!empty($object->ref) ?dol_sanitizeFileName($object->ref) : '').'/';
|
||||
$relativepath = (!empty($object->ref) ? dol_sanitizeFileName($object->ref) : '').'/';
|
||||
if (!empty($object->element) && $object->element == 'invoice_supplier') {
|
||||
$relativepath = get_exdir($object->id, 2, 0, 0, $object, 'invoice_supplier').$relativepath; // TODO Call using a defined value for $relativepath
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,7 +81,9 @@ class FormIntervention
|
|||
$sql .= " AND f.fk_soc = ".((int) $socid);
|
||||
}
|
||||
}
|
||||
if ($draftonly) $sql .= " AND f.fk_statut = 0";
|
||||
if ($draftonly) {
|
||||
$sql .= " AND f.fk_statut = 0";
|
||||
}
|
||||
|
||||
dol_syslog(get_class($this)."::select_intervention", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
|
|
@ -89,8 +91,11 @@ class FormIntervention
|
|||
$out .= '<select id="interventionid" class="flat" name="'.dol_escape_htmltag($htmlname).'">';
|
||||
if ($showempty) {
|
||||
$out .= '<option value="0">';
|
||||
if (!is_numeric($showempty)) $out .= $showempty;
|
||||
else $out .= ' ';
|
||||
if (!is_numeric($showempty)) {
|
||||
$out .= $showempty;
|
||||
} else {
|
||||
$out .= ' ';
|
||||
}
|
||||
$out .= '</option>';
|
||||
}
|
||||
$num = $this->db->num_rows($resql);
|
||||
|
|
|
|||
|
|
@ -613,7 +613,7 @@ class FormMail extends Form
|
|||
|
||||
// Add also company main email
|
||||
if (getDolGlobalString('MAIN_INFO_SOCIETE_MAIL')) {
|
||||
$s = (!getDolGlobalString('MAIN_INFO_SOCIETE_NOM')?$conf->global->MAIN_INFO_SOCIETE_EMAIL:$conf->global->MAIN_INFO_SOCIETE_NOM).' <' . getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>';
|
||||
$s = (!getDolGlobalString('MAIN_INFO_SOCIETE_NOM') ? $conf->global->MAIN_INFO_SOCIETE_EMAIL : $conf->global->MAIN_INFO_SOCIETE_NOM).' <' . getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>';
|
||||
$liste['company'] = array('label' => $s, 'data-html' => $s);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ class FormMargin
|
|||
// $marginInfos['margin_on_products'] += -1 * (abs($pv) - $pa);
|
||||
//}
|
||||
//else
|
||||
$marginInfos['margin_on_products'] += $pv - $pa;
|
||||
$marginInfos['margin_on_products'] += $pv - $pa;
|
||||
} elseif (getDolGlobalString('MARGIN_METHODE_FOR_DISCOUNT') == '2') { // remise globale considérée comme service
|
||||
$marginInfos['pa_services'] += $pa;
|
||||
$marginInfos['pv_services'] += $pv;
|
||||
|
|
@ -135,7 +135,7 @@ class FormMargin
|
|||
//if ($pv < 0)
|
||||
// $marginInfos['margin_on_services'] += -1 * (abs($pv) - $pa);
|
||||
//else
|
||||
$marginInfos['margin_on_services'] += $pv - $pa;
|
||||
$marginInfos['margin_on_services'] += $pv - $pa;
|
||||
} elseif (getDolGlobalString('MARGIN_METHODE_FOR_DISCOUNT') == '3') { // remise globale prise en compte uniqt sur total
|
||||
$marginInfos['pa_total'] += $pa;
|
||||
$marginInfos['pv_total'] += $pv;
|
||||
|
|
@ -154,7 +154,7 @@ class FormMargin
|
|||
//}
|
||||
//else
|
||||
//{
|
||||
$marginInfos['margin_on_products'] += $pv - $pa;
|
||||
$marginInfos['margin_on_products'] += $pv - $pa;
|
||||
//}
|
||||
} elseif ($type == 1) { // service
|
||||
$marginInfos['pa_services'] += $pa;
|
||||
|
|
@ -165,7 +165,7 @@ class FormMargin
|
|||
//if ($pv < 0)
|
||||
// $marginInfos['margin_on_services'] += -1 * (abs($pv) - $pa);
|
||||
//else
|
||||
$marginInfos['margin_on_services'] += $pv - $pa;
|
||||
$marginInfos['margin_on_services'] += $pv - $pa;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -187,7 +187,7 @@ class FormMargin
|
|||
//if ($marginInfos['pv_total'] < 0)
|
||||
// $marginInfos['total_margin'] = -1 * (abs($marginInfos['pv_total']) - $marginInfos['pa_total']);
|
||||
//else
|
||||
$marginInfos['total_margin'] = $marginInfos['pv_total'] - $marginInfos['pa_total'];
|
||||
$marginInfos['total_margin'] = $marginInfos['pv_total'] - $marginInfos['pa_total'];
|
||||
if ($marginInfos['pa_total'] > 0) {
|
||||
$marginInfos['total_margin_rate'] = 100 * $marginInfos['total_margin'] / $marginInfos['pa_total'];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
|
|||
*/
|
||||
class FormOrder extends Form
|
||||
{
|
||||
|
||||
/**
|
||||
* Return combo list of differents status of a orders
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1219,7 +1219,7 @@ class FormOther
|
|||
// $boxidactivatedforuser will be array of boxes choosed by user
|
||||
|
||||
$selectboxlist = '';
|
||||
$boxactivated = InfoBox::listBoxes($db, 'activated', $areacode, (empty($user->conf->$confuserzone) ?null:$user), array(), 0); // Search boxes of common+user (or common only if user has no specific setup)
|
||||
$boxactivated = InfoBox::listBoxes($db, 'activated', $areacode, (empty($user->conf->$confuserzone) ? null : $user), array(), 0); // Search boxes of common+user (or common only if user has no specific setup)
|
||||
|
||||
$boxidactivatedforuser = array();
|
||||
foreach ($boxactivated as $box) {
|
||||
|
|
@ -1317,7 +1317,7 @@ class FormOther
|
|||
if (!count($arrayboxtoactivatelabel)) {
|
||||
$selectboxlist .= 'jQuery("#boxcombo").hide();';
|
||||
}
|
||||
$selectboxlist .= '
|
||||
$selectboxlist .= '
|
||||
|
||||
jQuery("#boxhalfleft, #boxhalfright").sortable({
|
||||
handle: \'.boxhandle\',
|
||||
|
|
|
|||
|
|
@ -537,7 +537,9 @@ class FormProjets extends Form
|
|||
}
|
||||
|
||||
$linkedtothirdparty = false;
|
||||
if (!in_array($table_element, array(
|
||||
if (!in_array(
|
||||
$table_element,
|
||||
array(
|
||||
'don',
|
||||
'expensereport_det',
|
||||
'expensereport', 'loan',
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ class FormPropal
|
|||
} else {
|
||||
print '<option value="2,4">';
|
||||
}
|
||||
print ($langs->trans($prefix.'Signed'.($short ? 'Short' : '')).' '.$langs->trans("or").' '.$langs->trans($prefix.'Billed'.($short ? 'Short' : '')));
|
||||
print($langs->trans($prefix.'Signed'.($short ? 'Short' : '')).' '.$langs->trans("or").' '.$langs->trans($prefix.'Billed'.($short ? 'Short' : '')));
|
||||
print '</option>';
|
||||
}
|
||||
print '</select>';
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ class FormSetup
|
|||
* @param array $attributes an array of attributes keys and values,
|
||||
* @return string attribute string
|
||||
*/
|
||||
static public function generateAttributesStringFromArray($attributes)
|
||||
public static function generateAttributesStringFromArray($attributes)
|
||||
{
|
||||
$Aattr = array();
|
||||
if (is_array($attributes)) {
|
||||
|
|
@ -124,7 +124,7 @@ class FormSetup
|
|||
}
|
||||
}
|
||||
|
||||
return !empty($Aattr)?implode(' ', $Aattr):'';
|
||||
return !empty($Aattr) ? implode(' ', $Aattr) : '';
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -305,7 +305,6 @@ class FormSetup
|
|||
*/
|
||||
public function generateLineOutput($item, $editMode = false)
|
||||
{
|
||||
|
||||
$out = '';
|
||||
if ($item->enabled==1) {
|
||||
$trClass = 'oddeven';
|
||||
|
|
@ -351,7 +350,9 @@ class FormSetup
|
|||
*/
|
||||
public function addItemsFromParamsArray($params)
|
||||
{
|
||||
if (!is_array($params) || empty($params)) { return false; }
|
||||
if (!is_array($params) || empty($params)) {
|
||||
return false;
|
||||
}
|
||||
foreach ($params as $confKey => $param) {
|
||||
$this->addItemFromParams($confKey, $param); // todo manage error
|
||||
}
|
||||
|
|
@ -369,7 +370,9 @@ class FormSetup
|
|||
*/
|
||||
public function addItemFromParams($confKey, $params)
|
||||
{
|
||||
if (empty($confKey) || empty($params['type'])) { return false; }
|
||||
if (empty($confKey) || empty($params['type'])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* Exemple from old module builder setup page
|
||||
|
|
@ -427,8 +430,9 @@ class FormSetup
|
|||
*/
|
||||
public function reloadConfs()
|
||||
{
|
||||
|
||||
if (!array($this->items)) { return false; }
|
||||
if (!array($this->items)) {
|
||||
return false;
|
||||
}
|
||||
foreach ($this->items as $item) {
|
||||
$item->loadValueFromConf();
|
||||
}
|
||||
|
|
@ -799,7 +803,9 @@ class FormSetupItem
|
|||
*/
|
||||
public function getHelpText()
|
||||
{
|
||||
if (!empty($this->helpText)) { return $this->helpText; }
|
||||
if (!empty($this->helpText)) {
|
||||
return $this->helpText;
|
||||
}
|
||||
return (($this->langs->trans($this->confKey . 'Tooltip') != $this->confKey . 'Tooltip') ? $this->langs->trans($this->confKey . 'Tooltip') : '');
|
||||
}
|
||||
|
||||
|
|
@ -810,7 +816,9 @@ class FormSetupItem
|
|||
*/
|
||||
public function getNameText()
|
||||
{
|
||||
if (!empty($this->nameText)) { return $this->nameText; }
|
||||
if (!empty($this->nameText)) {
|
||||
return $this->nameText;
|
||||
}
|
||||
return (($this->langs->trans($this->confKey) != $this->confKey) ? $this->langs->trans($this->confKey) : $this->langs->trans('MissingTranslationForConfKey', $this->confKey));
|
||||
}
|
||||
|
||||
|
|
@ -892,7 +900,9 @@ class FormSetupItem
|
|||
*/
|
||||
public function generateInputFieldText()
|
||||
{
|
||||
if (empty($this->fieldAttr)) { $this->fieldAttr['class'] = 'flat '.(empty($this->cssClass) ? 'minwidth200' : $this->cssClass); }
|
||||
if (empty($this->fieldAttr)) {
|
||||
$this->fieldAttr['class'] = 'flat '.(empty($this->cssClass) ? 'minwidth200' : $this->cssClass);
|
||||
}
|
||||
return '<input '.FormSetup::generateAttributesStringFromArray($this->fieldAttr).' />';
|
||||
}
|
||||
|
||||
|
|
@ -934,7 +944,7 @@ class FormSetupItem
|
|||
|
||||
$tmp = explode(':', $this->type);
|
||||
$out = img_picto('', 'category', 'class="pictofixedwidth"');
|
||||
$out .= $formother->select_categories($tmp[1], $this->fieldValue, $this->confKey, 0, $this->langs->trans('CustomersProspectsCategoriesShort'));
|
||||
$out .= $formother->select_categories($tmp[1], $this->fieldValue, $this->confKey, 0, $this->langs->trans('CustomersProspectsCategoriesShort'));
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
|
@ -980,7 +990,7 @@ class FormSetupItem
|
|||
public function generateInputFieldSecureKey()
|
||||
{
|
||||
global $conf;
|
||||
$out = '<input required="required" type="text" class="flat" id="'.$this->confKey.'" name="'.$this->confKey.'" value="'.(GETPOST($this->confKey, 'alpha') ?GETPOST($this->confKey, 'alpha') : $this->fieldValue).'" size="40">';
|
||||
$out = '<input required="required" type="text" class="flat" id="'.$this->confKey.'" name="'.$this->confKey.'" value="'.(GETPOST($this->confKey, 'alpha') ? GETPOST($this->confKey, 'alpha') : $this->fieldValue).'" size="40">';
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
$out.= ' '.img_picto($this->langs->trans('Generate'), 'refresh', 'id="generate_token'.$this->confKey.'" class="linkobject"');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ class FormSms
|
|||
*/
|
||||
public function show_form($morecss = 'titlefield', $showform = 1)
|
||||
{
|
||||
// phpcs:enable
|
||||
// phpcs:enable
|
||||
global $conf, $langs, $form;
|
||||
|
||||
if (!is_object($form)) {
|
||||
|
|
|
|||
|
|
@ -425,7 +425,7 @@ class FormTicket
|
|||
} else {
|
||||
$subject = GETPOST('subject', 'alpha');
|
||||
}
|
||||
print '<input class="text minwidth500" id="subject" name="subject" value="'.$subject.'"'.(empty($this->withemail)?' autofocus':'').' />';
|
||||
print '<input class="text minwidth500" id="subject" name="subject" value="'.$subject.'"'.(empty($this->withemail) ? ' autofocus' : '').' />';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
|
@ -726,7 +726,7 @@ class FormTicket
|
|||
|
||||
$ticketstat->loadCacheTypesTickets();
|
||||
|
||||
print '<select id="select'.$htmlname.'" class="flat minwidth100'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.($multiselect?'[]':'').'"'.($multiselect?' multiple':'').'>';
|
||||
print '<select id="select'.$htmlname.'" class="flat minwidth100'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.($multiselect ? '[]' : '').'"'.($multiselect ? ' multiple' : '').'>';
|
||||
if ($empty) {
|
||||
print '<option value=""> </option>';
|
||||
}
|
||||
|
|
@ -911,7 +911,7 @@ class FormTicket
|
|||
$selectedgroups = array();
|
||||
$groupvalue = "";
|
||||
$groupticket=GETPOST($htmlname, 'aZ09');
|
||||
$child_id=GETPOST($htmlname.'_child_id', 'aZ09')?GETPOST($htmlname.'_child_id', 'aZ09'):0;
|
||||
$child_id=GETPOST($htmlname.'_child_id', 'aZ09') ? GETPOST($htmlname.'_child_id', 'aZ09') : 0;
|
||||
if (!empty($groupticket)) {
|
||||
$tmpgroupticket = $groupticket;
|
||||
$sql = "SELECT ctc.rowid, ctc.fk_parent, ctc.code";
|
||||
|
|
@ -970,9 +970,9 @@ class FormTicket
|
|||
|
||||
$isparent = $obj->isparent;
|
||||
if (is_array($selectedgroups)) {
|
||||
$iselected = in_array($obj->code, $selectedgroups) ?'selected':'';
|
||||
$iselected = in_array($obj->code, $selectedgroups) ? 'selected' : '';
|
||||
} else {
|
||||
$iselected = $groupticket == $obj->code ?'selected':'';
|
||||
$iselected = $groupticket == $obj->code ? 'selected' : '';
|
||||
}
|
||||
$stringtoprint .= '<option '.$iselected.' class="'.$htmlname.dol_escape_htmltag($grouprowid).'" value="'.dol_escape_htmltag($groupvalue).'" data-html="'.dol_escape_htmltag($grouplabel).'">'.dol_escape_htmltag($grouplabel).'</option>';
|
||||
if ($isparent == 'NOTPARENT') {
|
||||
|
|
@ -1047,13 +1047,13 @@ class FormTicket
|
|||
$arraycodenotparent[] = $groupvalue;
|
||||
}
|
||||
if (is_array($selectedgroups)) {
|
||||
$iselected = in_array($obj->code, $selectedgroups) ?'selected':'';
|
||||
$iselected = in_array($obj->code, $selectedgroups) ? 'selected' : '';
|
||||
} else {
|
||||
$iselected = $groupticket == $obj->code ?'selected':'';
|
||||
$iselected = $groupticket == $obj->code ? 'selected' : '';
|
||||
}
|
||||
$stringtoprint .= '<option '.$iselected.' class="'.$htmlname.'_'.dol_escape_htmltag($fatherid).'_child_'.$levelid.'" value="'.dol_escape_htmltag($groupvalue).'" data-html="'.dol_escape_htmltag($grouplabel).'">'.dol_escape_htmltag($grouplabel).'</option>';
|
||||
if (empty($tabscript[$groupcodefather])) {
|
||||
$tabscript[$groupcodefather] = 'if ($("#'.$htmlname.($levelid > 1 ?'_child_'.($levelid-1):'').'").val() == "'.dol_escape_js($groupcodefather).'"){
|
||||
$tabscript[$groupcodefather] = 'if ($("#'.$htmlname.($levelid > 1 ? '_child_'.($levelid-1) : '').'").val() == "'.dol_escape_js($groupcodefather).'"){
|
||||
$(".'.$htmlname.'_'.dol_escape_htmltag($fatherid).'_child_'.$levelid.'").show()
|
||||
console.log("We show childs tickets of '.$groupcodefather.' group ticket")
|
||||
}else{
|
||||
|
|
@ -1071,7 +1071,7 @@ class FormTicket
|
|||
|
||||
$stringtoprint .='<script nonce="'.getNonce().'">';
|
||||
$stringtoprint .='arraynotparents = '.json_encode($arraycodenotparent).';'; // when the last visible combo list is number x, this is the array of group
|
||||
$stringtoprint .='if (arraynotparents.includes($("#'.$htmlname.($levelid > 1 ?'_child_'.($levelid-1):'').'").val())){
|
||||
$stringtoprint .='if (arraynotparents.includes($("#'.$htmlname.($levelid > 1 ? '_child_'.($levelid-1) : '').'").val())){
|
||||
console.log("'.$htmlname.'_child_'.$levelid.'")
|
||||
if($("#'.$htmlname.'_child_'.$levelid.'").val() == "" && ($("#'.$htmlname.'_child_'.$levelid.'").attr("child_id")>'.$child_id.')){
|
||||
$("#'.$htmlname.'_child_'.$levelid.'").hide();
|
||||
|
|
@ -1083,8 +1083,8 @@ class FormTicket
|
|||
console.log("We choose '.$htmlname.' input and reload hidden input");
|
||||
}
|
||||
}
|
||||
$("#'.$htmlname.($levelid > 1 ?'_child_'.($levelid-1):'').'").change(function() {
|
||||
child_id = $("#'.$htmlname.($levelid > 1 ?'_child_'.$levelid:'').'").attr("child_id");
|
||||
$("#'.$htmlname.($levelid > 1 ? '_child_'.($levelid-1) : '').'").change(function() {
|
||||
child_id = $("#'.$htmlname.($levelid > 1 ? '_child_'.$levelid : '').'").attr("child_id");
|
||||
|
||||
/* Change of value to select this value*/
|
||||
if (arraynotparents.includes($(this).val()) || $(this).attr("child_id") == '.$use_multilevel.') {
|
||||
|
|
@ -1454,7 +1454,7 @@ class FormTicket
|
|||
$res = $ticketstat->fetch('', '', $this->track_id);
|
||||
|
||||
print '<tr><td></td><td>';
|
||||
$checkbox_selected = (GETPOST('send_email') == "1" ? ' checked' : (getDolGlobalInt('TICKETS_MESSAGE_FORCE_MAIL')?'checked':''));
|
||||
$checkbox_selected = (GETPOST('send_email') == "1" ? ' checked' : (getDolGlobalInt('TICKETS_MESSAGE_FORCE_MAIL') ? 'checked' : ''));
|
||||
print '<input type="checkbox" name="send_email" value="1" id="send_msg_email" '.$checkbox_selected.'/> ';
|
||||
print '<label for="send_msg_email">'.$langs->trans('SendMessageByEmail').'</label>';
|
||||
$texttooltip = $langs->trans("TicketMessageSendEmailHelp");
|
||||
|
|
@ -1480,7 +1480,7 @@ class FormTicket
|
|||
// Zone to select its email template
|
||||
if (count($modelmail_array) > 0) {
|
||||
print '<tr class="email_line"><td></td><td colspan="2"><div style="padding: 3px 0 3px 0">'."\n";
|
||||
print $langs->trans('SelectMailModel').': '.$formmail->selectarray('modelmailselected', $modelmail_array, $this->param['models_id'], 1, 0, "", "", 0, 0, 0, '', 'minwidth200');
|
||||
print $langs->trans('SelectMailModel').': '.$formmail->selectarray('modelmailselected', $modelmail_array, $this->param['models_id'], 1, 0, "", "", 0, 0, 0, '', 'minwidth200');
|
||||
if ($user->admin) {
|
||||
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ class FormWebsite
|
|||
}
|
||||
|
||||
$out = '';
|
||||
$out .= '<select id="select'.$htmlname.'" class="selectSampleOfContainer'.($morecss? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
|
||||
$out .= '<select id="select'.$htmlname.'" class="selectSampleOfContainer'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
|
||||
|
||||
if ($useempty == 1 || $useempty == 2) {
|
||||
$out .= '<option value="-1"> </option>';
|
||||
|
|
|
|||
|
|
@ -1109,7 +1109,7 @@ class Ldap
|
|||
if (!empty($activefilter)) { // Use a predefined trusted filter (defined into setup by admin).
|
||||
if (((string) $activefilter == '1' || (string) $activefilter == 'user') && $this->filter) {
|
||||
$filter = '('.$this->filter.')';
|
||||
} elseif (((string) $activefilter == 'group') && $this->filtergroup ) {
|
||||
} elseif (((string) $activefilter == 'group') && $this->filtergroup) {
|
||||
$filter = '('.$this->filtergroup.')';
|
||||
} elseif (((string) $activefilter == 'member') && $this->filter) {
|
||||
$filter = '('.$this->filtermember.')';
|
||||
|
|
|
|||
|
|
@ -433,16 +433,16 @@ class Lessc
|
|||
if (is_null($env) ||
|
||||
!empty($env->block->type) && $env->block->type != "media"
|
||||
) {
|
||||
return $childQueries;
|
||||
return $childQueries;
|
||||
}
|
||||
|
||||
// plain old block, skip
|
||||
// plain old block, skip
|
||||
if (empty($env->block->type)) {
|
||||
return $this->multiplyMedia($env->parent, $childQueries);
|
||||
}
|
||||
|
||||
$out = array();
|
||||
$queries = $env->block->queries;
|
||||
$out = array();
|
||||
$queries = $env->block->queries;
|
||||
if (is_null($childQueries)) {
|
||||
$out = $queries;
|
||||
} else {
|
||||
|
|
@ -453,7 +453,7 @@ class Lessc
|
|||
}
|
||||
}
|
||||
|
||||
return $this->multiplyMedia($env->parent, $out);
|
||||
return $this->multiplyMedia($env->parent, $out);
|
||||
}
|
||||
|
||||
protected function expandParentSelectors(&$tag, $replace)
|
||||
|
|
@ -818,13 +818,13 @@ class Lessc
|
|||
is_string($subProp[1]) &&
|
||||
$subProp[1][0] != $this->vPrefix
|
||||
) {
|
||||
$subProp[2] = array(
|
||||
$subProp[2] = array(
|
||||
'list', ' ',
|
||||
array($subProp[2], array('keyword', $suffix))
|
||||
);
|
||||
}
|
||||
|
||||
$this->compileProp($subProp, $mixin, $out);
|
||||
$this->compileProp($subProp, $mixin, $out);
|
||||
}
|
||||
|
||||
$mixin->parent = $oldParent;
|
||||
|
|
@ -863,7 +863,7 @@ class Lessc
|
|||
|
||||
break;
|
||||
case "import_mixin":
|
||||
list(,$importId) = $prop;
|
||||
list(, $importId) = $prop;
|
||||
$import = $this->env->imports[$importId];
|
||||
if ($import[0] === false) {
|
||||
if (isset($import[1])) {
|
||||
|
|
@ -1129,6 +1129,7 @@ class Lessc
|
|||
return $this->lib_e($items[0]);
|
||||
}
|
||||
$this->throwError("unrecognised input"); // This end function by throwing an exception
|
||||
// no break
|
||||
case "string":
|
||||
$arg[1] = "";
|
||||
return $arg;
|
||||
|
|
@ -1754,7 +1755,7 @@ class Lessc
|
|||
}
|
||||
return $value;
|
||||
case "escape":
|
||||
list(,$inner) = $value;
|
||||
list(, $inner) = $value;
|
||||
return $this->lib_e($this->reduce($inner));
|
||||
case "function":
|
||||
$color = $this->funcToColor($value);
|
||||
|
|
@ -1775,7 +1776,7 @@ class Lessc
|
|||
$args = self::compressList($args[2], $args[1]);
|
||||
}
|
||||
|
||||
$ret = call_user_func($f, $this->reduce($args, true), $this);
|
||||
$ret = call_user_func($f, $this->reduce($args, true), $this);
|
||||
|
||||
if (is_null($ret)) {
|
||||
return array("string", "", array(
|
||||
|
|
@ -1783,14 +1784,14 @@ class Lessc
|
|||
));
|
||||
}
|
||||
|
||||
// convert to a typed value if the result is a php primitive
|
||||
// convert to a typed value if the result is a php primitive
|
||||
if (is_numeric($ret)) {
|
||||
$ret = array('number', $ret, "");
|
||||
} elseif (!is_array($ret)) {
|
||||
$ret = array('keyword', $ret);
|
||||
}
|
||||
|
||||
return $ret;
|
||||
return $ret;
|
||||
}
|
||||
|
||||
// plain function, reduce args
|
||||
|
|
@ -2107,7 +2108,7 @@ class Lessc
|
|||
|
||||
protected function makeOutputBlock($type, $selectors = null)
|
||||
{
|
||||
$b = new stdclass;
|
||||
$b = new stdclass();
|
||||
$b->lines = array();
|
||||
$b->children = array();
|
||||
$b->selectors = $selectors;
|
||||
|
|
@ -2119,7 +2120,7 @@ class Lessc
|
|||
// the state of execution
|
||||
protected function pushEnv($block = null)
|
||||
{
|
||||
$e = new stdclass;
|
||||
$e = new stdclass();
|
||||
$e->parent = $this->env;
|
||||
$e->store = array();
|
||||
$e->block = $block;
|
||||
|
|
@ -2372,10 +2373,10 @@ class Lessc
|
|||
if (!is_string($this->formatterName)) {
|
||||
return $this->formatterName;
|
||||
}
|
||||
$className = "lessc_formatter_$this->formatterName";
|
||||
$className = "lessc_formatter_$this->formatterName";
|
||||
}
|
||||
|
||||
return new $className;
|
||||
return new $className();
|
||||
}
|
||||
|
||||
public function setPreserveComments($preserve)
|
||||
|
|
@ -2440,7 +2441,7 @@ class Lessc
|
|||
public static function ccompile($in, $out, $less = null)
|
||||
{
|
||||
if ($less === null) {
|
||||
$less = new self;
|
||||
$less = new self();
|
||||
}
|
||||
return $less->checkedCompile($in, $out);
|
||||
}
|
||||
|
|
@ -2448,7 +2449,7 @@ class Lessc
|
|||
public static function cexecute($in, $force = false, $less = null)
|
||||
{
|
||||
if ($less === null) {
|
||||
$less = new self;
|
||||
$less = new self();
|
||||
}
|
||||
return $less->cachedCompile($in, $force);
|
||||
}
|
||||
|
|
@ -2686,12 +2687,12 @@ class lessc_parser
|
|||
array_keys(self::$precedence)
|
||||
)).')';
|
||||
|
||||
$commentSingle = Lessc::preg_quote(self::$commentSingle);
|
||||
$commentMultiLeft = Lessc::preg_quote(self::$commentMultiLeft);
|
||||
$commentMultiRight = Lessc::preg_quote(self::$commentMultiRight);
|
||||
$commentSingle = Lessc::preg_quote(self::$commentSingle);
|
||||
$commentMultiLeft = Lessc::preg_quote(self::$commentMultiLeft);
|
||||
$commentMultiRight = Lessc::preg_quote(self::$commentMultiRight);
|
||||
|
||||
self::$commentMulti = $commentMultiLeft.'.*?'.$commentMultiRight;
|
||||
self::$whitePattern = '/'.$commentSingle.'[^\n]*\s*|('.self::$commentMulti.')\s*|\s+/Ais';
|
||||
self::$commentMulti = $commentMultiLeft.'.*?'.$commentMultiRight;
|
||||
self::$whitePattern = '/'.$commentSingle.'[^\n]*\s*|('.self::$commentMulti.')\s*|\s+/Ais';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2716,23 +2717,23 @@ class lessc_parser
|
|||
// trim whitespace on head
|
||||
// if (preg_match('/^\s+/', $this->buffer, $m)) {
|
||||
// $this->line += substr_count($m[0], "\n");
|
||||
// $this->buffer = ltrim($this->buffer);
|
||||
// }
|
||||
$this->whitespace();
|
||||
// $this->buffer = ltrim($this->buffer);
|
||||
// }
|
||||
$this->whitespace();
|
||||
|
||||
// parse the entire file
|
||||
while (false !== $this->parseChunk());
|
||||
// parse the entire file
|
||||
while (false !== $this->parseChunk());
|
||||
|
||||
if ($this->count != strlen($this->buffer)) {
|
||||
$this->throwError('parse error count '.$this->count.' != len buffer '.strlen($this->buffer));
|
||||
}
|
||||
|
||||
// TODO report where the block was opened
|
||||
// TODO report where the block was opened
|
||||
if (!property_exists($this->env, 'parent') || !is_null($this->env->parent)) {
|
||||
throw new exception('parse error: unclosed block');
|
||||
}
|
||||
|
||||
return $this->env;
|
||||
return $this->env;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -2801,14 +2802,14 @@ class lessc_parser
|
|||
if ($this->keyword($key) && $this->assign() &&
|
||||
$this->propertyValue($value, $key) && $this->end()
|
||||
) {
|
||||
$this->append(array('assign', $key, $value), $s);
|
||||
return true;
|
||||
$this->append(array('assign', $key, $value), $s);
|
||||
return true;
|
||||
} else {
|
||||
$this->seek($s);
|
||||
}
|
||||
|
||||
|
||||
// look for special css blocks
|
||||
// look for special css blocks
|
||||
if ($this->literal('@', false)) {
|
||||
$this->count--;
|
||||
|
||||
|
|
@ -2817,9 +2818,9 @@ class lessc_parser
|
|||
if ($this->mediaQueryList($mediaQueries)
|
||||
&& $this->literal('{')
|
||||
) {
|
||||
$media = $this->pushSpecialBlock("media");
|
||||
$media->queries = is_null($mediaQueries) ? array() : $mediaQueries;
|
||||
return true;
|
||||
$media = $this->pushSpecialBlock("media");
|
||||
$media->queries = is_null($mediaQueries) ? array() : $mediaQueries;
|
||||
return true;
|
||||
} else {
|
||||
$this->seek($s);
|
||||
return false;
|
||||
|
|
@ -2831,12 +2832,12 @@ class lessc_parser
|
|||
if ($this->openString("{", $dirValue, null, array(";")) &&
|
||||
$this->literal("{")
|
||||
) {
|
||||
$dir = $this->pushSpecialBlock("directive");
|
||||
$dir->name = $dirName;
|
||||
$dir = $this->pushSpecialBlock("directive");
|
||||
$dir->name = $dirName;
|
||||
if (isset($dirValue)) {
|
||||
$dir->value = $dirValue;
|
||||
}
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
} elseif ($this->isDirective($dirName, $this->lineDirectives)) {
|
||||
if ($this->propertyValue($dirValue) && $this->end()) {
|
||||
|
|
@ -2849,12 +2850,12 @@ class lessc_parser
|
|||
$this->seek($s);
|
||||
}
|
||||
|
||||
// setting a variable
|
||||
// setting a variable
|
||||
if ($this->variable($var) && $this->assign() &&
|
||||
$this->propertyValue($value) && $this->end()
|
||||
) {
|
||||
$this->append(array('assign', $var, $value), $s);
|
||||
return true;
|
||||
$this->append(array('assign', $var, $value), $s);
|
||||
return true;
|
||||
} else {
|
||||
$this->seek($s);
|
||||
}
|
||||
|
|
@ -2864,23 +2865,23 @@ class lessc_parser
|
|||
return true;
|
||||
}
|
||||
|
||||
// opening parametric mixin
|
||||
// opening parametric mixin
|
||||
if ($this->tag($tag, true) && $this->argumentDef($args, $isVararg) &&
|
||||
$this->guards($guards) &&
|
||||
$this->literal('{')
|
||||
) {
|
||||
$block = $this->pushBlock($this->fixTags(array($tag)));
|
||||
$block->args = $args;
|
||||
$block->isVararg = $isVararg;
|
||||
$block = $this->pushBlock($this->fixTags(array($tag)));
|
||||
$block->args = $args;
|
||||
$block->isVararg = $isVararg;
|
||||
if (!empty($guards)) {
|
||||
$block->guards = $guards;
|
||||
}
|
||||
return true;
|
||||
return true;
|
||||
} else {
|
||||
$this->seek($s);
|
||||
}
|
||||
|
||||
// opening a simple block
|
||||
// opening a simple block
|
||||
if ($this->tags($tags) && $this->literal('{', false)) {
|
||||
$tags = $this->fixTags($tags);
|
||||
$this->pushBlock($tags);
|
||||
|
|
@ -2889,7 +2890,7 @@ class lessc_parser
|
|||
$this->seek($s);
|
||||
}
|
||||
|
||||
// closing a block
|
||||
// closing a block
|
||||
if ($this->literal('}', false)) {
|
||||
try {
|
||||
$block = $this->pop();
|
||||
|
|
@ -2922,24 +2923,24 @@ class lessc_parser
|
|||
}
|
||||
|
||||
// this is done here so comments aren't bundled into he block that
|
||||
// was just closed
|
||||
$this->whitespace();
|
||||
return true;
|
||||
// was just closed
|
||||
$this->whitespace();
|
||||
return true;
|
||||
}
|
||||
|
||||
// mixin
|
||||
// mixin
|
||||
if ($this->mixinTags($tags) &&
|
||||
$this->argumentDef($argv, $isVararg) &&
|
||||
$this->keyword($suffix) && $this->end()
|
||||
) {
|
||||
$tags = $this->fixTags($tags);
|
||||
$this->append(array('mixin', $tags, $argv, $suffix), $s);
|
||||
return true;
|
||||
$tags = $this->fixTags($tags);
|
||||
$this->append(array('mixin', $tags, $argv, $suffix), $s);
|
||||
return true;
|
||||
} else {
|
||||
$this->seek($s);
|
||||
}
|
||||
|
||||
// spare ;
|
||||
// spare ;
|
||||
if ($this->literal(';')) {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -2970,7 +2971,7 @@ class lessc_parser
|
|||
return $tags;
|
||||
}
|
||||
|
||||
// a list of expressions
|
||||
// a list of expressions
|
||||
protected function expressionList(&$exps)
|
||||
{
|
||||
$exp = null;
|
||||
|
|
@ -2989,10 +2990,10 @@ class lessc_parser
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempt to consume an expression.
|
||||
* @link http://en.wikipedia.org/wiki/Operator-precedence_parser#Pseudo-code
|
||||
*/
|
||||
/**
|
||||
* Attempt to consume an expression.
|
||||
* @link http://en.wikipedia.org/wiki/Operator-precedence_parser#Pseudo-code
|
||||
*/
|
||||
protected function expression(&$out)
|
||||
{
|
||||
$lhs = null;
|
||||
|
|
@ -3075,7 +3076,7 @@ class lessc_parser
|
|||
return $lhs;
|
||||
}
|
||||
|
||||
// consume a list of values for a property
|
||||
// consume a list of values for a property
|
||||
public function propertyValue(&$value, $keyName = null)
|
||||
{
|
||||
$v = null;
|
||||
|
|
@ -3126,18 +3127,18 @@ class lessc_parser
|
|||
($this->inParens = true) && $this->expression($exp) &&
|
||||
$this->literal(")")
|
||||
) {
|
||||
$out = $exp;
|
||||
$this->inParens = $inParens;
|
||||
return true;
|
||||
$out = $exp;
|
||||
$this->inParens = $inParens;
|
||||
return true;
|
||||
} else {
|
||||
$this->inParens = $inParens;
|
||||
$this->seek($s);
|
||||
}
|
||||
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
// a single value
|
||||
// a single value
|
||||
protected function value(&$value)
|
||||
{
|
||||
$inner = null;
|
||||
|
|
@ -3155,8 +3156,8 @@ class lessc_parser
|
|||
$this->unit($inner) ||
|
||||
$this->parenValue($inner))
|
||||
) {
|
||||
$value = array("unary", "-", $inner);
|
||||
return true;
|
||||
$value = array("unary", "-", $inner);
|
||||
return true;
|
||||
} else {
|
||||
$this->seek($s);
|
||||
}
|
||||
|
|
@ -3209,7 +3210,7 @@ class lessc_parser
|
|||
return false;
|
||||
}
|
||||
|
||||
// an import statement
|
||||
// an import statement
|
||||
protected function import(&$out, $value = '')
|
||||
{
|
||||
if (!$this->literal('@import')) {
|
||||
|
|
@ -3293,21 +3294,21 @@ class lessc_parser
|
|||
($this->literal(":") && $this->expression($value)) &&
|
||||
$this->literal(")")
|
||||
) {
|
||||
$out = array("mediaExp", $feature);
|
||||
$out = array("mediaExp", $feature);
|
||||
if ($value) {
|
||||
$out[] = $value;
|
||||
}
|
||||
return true;
|
||||
return true;
|
||||
} elseif ($this->variable($variable)) {
|
||||
$out = array('variable', $variable);
|
||||
return true;
|
||||
}
|
||||
|
||||
$this->seek($s);
|
||||
return false;
|
||||
$this->seek($s);
|
||||
return false;
|
||||
}
|
||||
|
||||
// an unbounded string stopped by $end
|
||||
// an unbounded string stopped by $end
|
||||
protected function openString($end, &$out, $nestingOpen = null, $rejectStrs = null)
|
||||
{
|
||||
$str = null;
|
||||
|
|
@ -3401,8 +3402,8 @@ class lessc_parser
|
|||
$patt = '([^\n]*?)(@\{|\\\\|'.
|
||||
Lessc::preg_quote($delim).')';
|
||||
|
||||
$oldWhite = $this->eatWhiteDefault;
|
||||
$this->eatWhiteDefault = false;
|
||||
$oldWhite = $this->eatWhiteDefault;
|
||||
$this->eatWhiteDefault = false;
|
||||
|
||||
$m = array();
|
||||
while ($this->match($patt, $m, false)) {
|
||||
|
|
@ -3426,15 +3427,15 @@ class lessc_parser
|
|||
}
|
||||
}
|
||||
|
||||
$this->eatWhiteDefault = $oldWhite;
|
||||
$this->eatWhiteDefault = $oldWhite;
|
||||
|
||||
if ($this->literal($delim)) {
|
||||
$out = array("string", $delim, $content);
|
||||
return true;
|
||||
}
|
||||
|
||||
$this->seek($s);
|
||||
return false;
|
||||
$this->seek($s);
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function interpolation(&$out)
|
||||
|
|
@ -3449,17 +3450,17 @@ class lessc_parser
|
|||
$this->openString("}", $interp, null, array("'", '"', ";")) &&
|
||||
$this->literal("}", false)
|
||||
) {
|
||||
$out = array("interpolate", $interp);
|
||||
$this->eatWhiteDefault = $oldWhite;
|
||||
$out = array("interpolate", $interp);
|
||||
$this->eatWhiteDefault = $oldWhite;
|
||||
if ($this->eatWhiteDefault) {
|
||||
$this->whitespace();
|
||||
}
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
$this->eatWhiteDefault = $oldWhite;
|
||||
$this->seek($s);
|
||||
return false;
|
||||
$this->eatWhiteDefault = $oldWhite;
|
||||
$this->seek($s);
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function unit(&$unit)
|
||||
|
|
@ -3608,8 +3609,8 @@ class lessc_parser
|
|||
return true;
|
||||
}
|
||||
|
||||
// consume a list of tags
|
||||
// this accepts a hanging delimiter
|
||||
// consume a list of tags
|
||||
// this accepts a hanging delimiter
|
||||
protected function tags(&$tags, $simple = false, $delim = ',')
|
||||
{
|
||||
$tt = array();
|
||||
|
|
@ -3628,8 +3629,8 @@ class lessc_parser
|
|||
return true;
|
||||
}
|
||||
|
||||
// list of tags of specifying mixin path
|
||||
// optionally separated by > (lazy, accepts extra >)
|
||||
// list of tags of specifying mixin path
|
||||
// optionally separated by > (lazy, accepts extra >)
|
||||
protected function mixinTags(&$tags)
|
||||
{
|
||||
$tt = array();
|
||||
|
|
@ -3647,7 +3648,7 @@ class lessc_parser
|
|||
return true;
|
||||
}
|
||||
|
||||
// a bracketed value (contained within in a tag definition)
|
||||
// a bracketed value (contained within in a tag definition)
|
||||
protected function tagBracket(&$parts, &$hasExpression)
|
||||
{
|
||||
$str = null;
|
||||
|
|
@ -3723,7 +3724,7 @@ class lessc_parser
|
|||
return false;
|
||||
}
|
||||
|
||||
// a space separated list of selectors
|
||||
// a space separated list of selectors
|
||||
protected function tag(&$tag, $simple = false)
|
||||
{
|
||||
$interp = null;
|
||||
|
|
@ -3794,7 +3795,7 @@ class lessc_parser
|
|||
return true;
|
||||
}
|
||||
|
||||
// a css function
|
||||
// a css function
|
||||
protected function func(&$func)
|
||||
{
|
||||
$s = $this->seek();
|
||||
|
|
@ -3860,12 +3861,12 @@ class lessc_parser
|
|||
} else {
|
||||
$name = $this->lessc->vPrefix.$name;
|
||||
}
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
$name = null;
|
||||
$this->seek($s);
|
||||
return false;
|
||||
$name = null;
|
||||
$this->seek($s);
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -4034,9 +4035,9 @@ class lessc_parser
|
|||
}
|
||||
|
||||
|
||||
// advance counter to next occurrence of $what
|
||||
// $until - don't include $what in advance
|
||||
// $allowNewline, if string, will be used as valid char set
|
||||
// advance counter to next occurrence of $what
|
||||
// $until - don't include $what in advance
|
||||
// $allowNewline, if string, will be used as valid char set
|
||||
protected function to($what, &$out, $until = false, $allowNewline = false)
|
||||
{
|
||||
if (is_string($allowNewline)) {
|
||||
|
|
@ -4055,7 +4056,7 @@ class lessc_parser
|
|||
return true;
|
||||
}
|
||||
|
||||
// try to match something on head of buffer
|
||||
// try to match something on head of buffer
|
||||
protected function match($regex, &$out, $eatWhitespace = null)
|
||||
{
|
||||
if ($eatWhitespace === null) {
|
||||
|
|
@ -4073,7 +4074,7 @@ class lessc_parser
|
|||
return false;
|
||||
}
|
||||
|
||||
// match some whitespace
|
||||
// match some whitespace
|
||||
protected function whitespace()
|
||||
{
|
||||
if ($this->writeComments) {
|
||||
|
|
@ -4094,7 +4095,7 @@ class lessc_parser
|
|||
}
|
||||
}
|
||||
|
||||
// match something without consuming it
|
||||
// match something without consuming it
|
||||
protected function peek($regex, &$out = null, $from = null)
|
||||
{
|
||||
if (is_null($from)) {
|
||||
|
|
@ -4106,7 +4107,7 @@ class lessc_parser
|
|||
return $result;
|
||||
}
|
||||
|
||||
// seek to a spot in the buffer or return where we are on no argument
|
||||
// seek to a spot in the buffer or return where we are on no argument
|
||||
protected function seek($where = null)
|
||||
{
|
||||
if ($where === null) {
|
||||
|
|
@ -4117,7 +4118,7 @@ class lessc_parser
|
|||
return true;
|
||||
}
|
||||
|
||||
/* misc functions */
|
||||
/* misc functions */
|
||||
|
||||
public function throwError($msg = "parse error", $count = null)
|
||||
{
|
||||
|
|
@ -4143,7 +4144,7 @@ class lessc_parser
|
|||
|
||||
protected function pushBlock($selectors = null, $type = null)
|
||||
{
|
||||
$b = new stdclass;
|
||||
$b = new stdclass();
|
||||
$b->parent = $this->env;
|
||||
|
||||
$b->type = $type;
|
||||
|
|
@ -4159,13 +4160,13 @@ class lessc_parser
|
|||
return $b;
|
||||
}
|
||||
|
||||
// push a block that doesn't multiply tags
|
||||
// push a block that doesn't multiply tags
|
||||
protected function pushSpecialBlock($type)
|
||||
{
|
||||
return $this->pushBlock(null, $type);
|
||||
}
|
||||
|
||||
// append a property to the current block
|
||||
// append a property to the current block
|
||||
protected function append($prop, $pos = null)
|
||||
{
|
||||
if ($pos !== null) {
|
||||
|
|
@ -4174,7 +4175,7 @@ class lessc_parser
|
|||
$this->env->props[] = $prop;
|
||||
}
|
||||
|
||||
// pop something off the stack
|
||||
// pop something off the stack
|
||||
protected function pop()
|
||||
{
|
||||
$old = $this->env;
|
||||
|
|
@ -4182,8 +4183,8 @@ class lessc_parser
|
|||
return $old;
|
||||
}
|
||||
|
||||
// remove comments from $text
|
||||
// todo: make it work for all functions, not just url
|
||||
// remove comments from $text
|
||||
// todo: make it work for all functions, not just url
|
||||
protected function removeComments($text)
|
||||
{
|
||||
$look = array(
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ class Menu
|
|||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->liste = array();
|
||||
$this->liste = array();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class Notify
|
|||
public $fk_project;
|
||||
|
||||
// This codes actions are defined into table llx_notify_def
|
||||
static public $arrayofnotifsupported = array(
|
||||
public static $arrayofnotifsupported = array(
|
||||
'BILL_VALIDATE',
|
||||
'BILL_PAYED',
|
||||
'ORDER_CREATE',
|
||||
|
|
|
|||
|
|
@ -335,7 +335,8 @@ class SimpleOpenID
|
|||
// phpcs:enable
|
||||
$get = array();
|
||||
|
||||
$matches1 = array(); $matches2 = array();
|
||||
$matches1 = array();
|
||||
$matches2 = array();
|
||||
|
||||
// Get details of their OpenID server and (optional) delegate
|
||||
preg_match_all('/<link[^>]*rel=[\'"]openid.server[\'"][^>]*href=[\'"]([^\'"]+)[\'"][^>]*\/?>/i', $content, $matches1);
|
||||
|
|
|
|||
|
|
@ -1661,11 +1661,11 @@ class SMTPs
|
|||
// Add plain text message part before html part
|
||||
$content .= 'Content-Type: multipart/alternative; boundary="'.$this->_getBoundary('alternative').'"'."\r\n";
|
||||
$content .= "\r\n";
|
||||
$content .= "--".$this->_getBoundary('alternative')."\r\n";
|
||||
$content .= "--".$this->_getBoundary('alternative')."\r\n";
|
||||
|
||||
$content .= "Content-Type: text/plain; charset=".$this->getCharSet()."\r\n";
|
||||
$content .= "\r\n".$_content['dataText']."\r\n";
|
||||
$content .= "--".$this->_getBoundary('alternative')."\r\n";
|
||||
$content .= "Content-Type: text/plain; charset=".$this->getCharSet()."\r\n";
|
||||
$content .= "\r\n".$_content['dataText']."\r\n";
|
||||
$content .= "--".$this->_getBoundary('alternative')."\r\n";
|
||||
}
|
||||
|
||||
$content .= 'Content-Type: '.$_content['mimeType'].'; charset='.$this->getCharSet();
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ abstract class Stats
|
|||
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
|
||||
* @return int value
|
||||
*/
|
||||
protected abstract function getNbByMonth($year, $format = 0);
|
||||
abstract protected function getNbByMonth($year, $format = 0);
|
||||
|
||||
/**
|
||||
* Return nb of elements by month for several years
|
||||
|
|
@ -174,7 +174,7 @@ abstract class Stats
|
|||
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
|
||||
* @return int value
|
||||
*/
|
||||
protected abstract function getAmountByMonth($year, $format = 0);
|
||||
abstract protected function getAmountByMonth($year, $format = 0);
|
||||
|
||||
/**
|
||||
* Return amount of elements by month for several years.
|
||||
|
|
@ -274,7 +274,7 @@ abstract class Stats
|
|||
* @param int $year year number
|
||||
* @return array array of values
|
||||
*/
|
||||
protected abstract function getAverageByMonth($year);
|
||||
abstract protected function getAverageByMonth($year);
|
||||
|
||||
/**
|
||||
* Return average of entity by month for several years
|
||||
|
|
|
|||
|
|
@ -525,13 +525,15 @@ class TimeSpent extends CommonObject
|
|||
$sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'timespent/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
$error++;
|
||||
$this->error = $this->db->lasterror();
|
||||
}
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'timespent/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filepath = 'timespent/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
$error++;
|
||||
$this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
|
|
@ -723,7 +725,7 @@ class TimeSpent extends CommonObject
|
|||
$label = $langs->trans("ShowTimeSpent");
|
||||
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||
}
|
||||
$linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
|
||||
$linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
|
||||
$linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
|
||||
} else {
|
||||
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
|
||||
|
|
|
|||
|
|
@ -321,10 +321,18 @@ class Validate
|
|||
|
||||
if (!empty($object->table_element) && $object->isExistingObject($object->table_element, $id)) {
|
||||
return true;
|
||||
} else { $this->error = $this->outputLang->trans('RequireValidExistingElement'); }
|
||||
} else { $this->error = $this->outputLang->trans('BadSetupOfFieldClassNotFoundForValidation'); }
|
||||
} else { $this->error = $this->outputLang->trans('BadSetupOfFieldFileNotFound'); }
|
||||
} else { $this->error = $this->outputLang->trans('BadSetupOfField'); }
|
||||
} else {
|
||||
$this->error = $this->outputLang->trans('RequireValidExistingElement');
|
||||
}
|
||||
} else {
|
||||
$this->error = $this->outputLang->trans('BadSetupOfFieldClassNotFoundForValidation');
|
||||
}
|
||||
} else {
|
||||
$this->error = $this->outputLang->trans('BadSetupOfFieldFileNotFound');
|
||||
}
|
||||
} else {
|
||||
$this->error = $this->outputLang->trans('BadSetupOfField');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user