Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into develop

Conflicts:
	htdocs/admin/dict.php
	htdocs/admin/mails_templates.php
This commit is contained in:
Laurent Destailleur 2017-09-08 13:30:54 +02:00
commit 259cca0230
57 changed files with 463 additions and 307 deletions

File diff suppressed because one or more lines are too long

View File

@ -249,8 +249,9 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key); $tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey]; $typ=$extrafields->attribute_type[$tmpkey];
$mode=0; $mode=0;
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{ {
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode); $sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
} }

View File

@ -390,13 +390,13 @@ if ($rowid > 0)
} }
if ($status != '') if ($status != '')
{ {
$sql.= " AND d.statut IN (".$status.")"; // Peut valoir un nombre ou liste de nombre separes par virgules $sql.= " AND d.statut IN (".$db->escape($status).")"; // Peut valoir un nombre ou liste de nombre separes par virgules
} }
if ($action == 'search') if ($action == 'search')
{ {
if (GETPOST('search')) if (GETPOST('search'))
{ {
$sql.= natural_search(array("d.firstname","d.lastname"), GETPOST('search')); $sql.= natural_search(array("d.firstname","d.lastname"), GETPOST('search','alpha'));
} }
} }
if (! empty($search_lastname)) if (! empty($search_lastname))

View File

@ -243,6 +243,7 @@ print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" id="action" name="action" value="">'; print '<input type="hidden" id="action" name="action" value="">';
print '<input type="hidden" id="mode" name="mode" value="'.dol_escape_htmltag($mode).'">'; print '<input type="hidden" id="mode" name="mode" value="'.dol_escape_htmltag($mode).'">';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
// Page // Page
@ -301,13 +302,13 @@ print '<input type="text" class="flat minwidth200 maxwidthonsmartphone" name="de
print '</td>'."\n"; print '</td>'."\n";
// Field // Field
print '<td>'; print '<td>';
print '<input type="text" class="flat maxwidth100" name="defaultkey" value="">'; print '<input type="text" class="flat maxwidth100onsmartphone" name="defaultkey" value="">';
print '</td>'; print '</td>';
// Value // Value
if ($mode != 'focus') if ($mode != 'focus')
{ {
print '<td>'; print '<td>';
print '<input type="text" class="flat maxwidthonsmartphone" name="defaultvalue" value="">'; print '<input type="text" class="flat maxwidth100onsmartphone" name="defaultvalue" value="">';
print '</td>'; print '</td>';
} }
// Limit to superadmin // Limit to superadmin
@ -409,6 +410,7 @@ else
print '</table>'; print '</table>';
print '</div>';
dol_fiche_end(); dol_fiche_end();

View File

@ -67,7 +67,7 @@ $actl[0] = img_picto($langs->trans("Disabled"),'switch_off');
$actl[1] = img_picto($langs->trans("Activated"),'switch_on'); $actl[1] = img_picto($langs->trans("Activated"),'switch_on');
$listoffset=GETPOST('listoffset'); $listoffset=GETPOST('listoffset');
$listlimit=GETPOST('listlimit')>0?GETPOST('listlimit'):1000; $listlimit=GETPOST('listlimit')>0?GETPOST('listlimit'):1000; // To avoid too long dictionaries
$active = 1; $active = 1;
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
@ -1155,11 +1155,6 @@ if ($id)
print '</table>'; print '</table>';
print '</div>'; print '</div>';
/*if (! empty($alabelisused) && $id != 25) // If there is one label among fields, we show legend of *
{
print '* '.$langs->trans("LabelUsedByDefault").'.<br>';
}*/
} }
print '</form>'; print '</form>';
@ -1179,9 +1174,10 @@ if ($id)
$i = 0; $i = 0;
// There is several pages // There is several pages
if ($num > $listlimit) if ($num > $listlimit || $page)
{ {
print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), '<li class="pagination"><span>'.$langs->trans("Page").' '.($page+1).'</span></li>'); print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), '<li class="pagination"><span>'.$langs->trans("Page").' '.($page+1).'</span></li>');
print '<div class="clearboth"></div>';
} }
print '<div class="div-table-responsive">'; print '<div class="div-table-responsive">';
@ -1645,6 +1641,8 @@ else
*/ */
$lastlineisempty=false; $lastlineisempty=false;
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
//print '<td>'.$langs->trans("Module").'</td>'; //print '<td>'.$langs->trans("Module").'</td>';
@ -1697,6 +1695,7 @@ else
} }
} }
print '</table>'; print '</table>';
print '</div>';
} }
print '<br>'; print '<br>';

View File

@ -221,9 +221,38 @@ elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS')
} else { } else {
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} elseif ($action == 'set_FICHINTER_WITHOUT_DURATION') {
$val = GETPOST('FICHINTER_WITHOUT_DURATION', 'alpha');
$res = dolibarr_set_const($db, "FICHINTER_WITHOUT_DURATION", ($val == 'on' ? 1 : 0), 'bool', 0, '',
$conf->entity);
if (!$res > 0) {
$error++;
}
if (!$error) {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
} elseif ($action == 'set_FICHINTER_DATE_WITHOUT_HOUR') {
$val = GETPOST('FICHINTER_DATE_WITHOUT_HOUR', 'alpha');
$res = dolibarr_set_const($db, "FICHINTER_DATE_WITHOUT_HOUR", ($val == 'on' ? 1 : 0), 'bool', 0, '',
$conf->entity);
if (!$res > 0) {
$error++;
}
if (!$error) {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
} }
/* /*
* View * View
*/ */
@ -575,6 +604,40 @@ print '<input type="submit" class="button" value="' . $langs->trans("Modify") .
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
print '</form>'; print '</form>';
// Use duration
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="action" value="set_FICHINTER_WITHOUT_DURATION">';
print '<tr class="oddeven">';
print '<td>';
print $langs->trans("UseDurationOnFichinter");
print '</td>';
print '<td align="center">';
print '<input type="checkbox" name="FICHINTER_WITHOUT_DURATION"' . ($conf->global->FICHINTER_WITHOUT_DURATION?' checked':'') . '>';
print '</td>';
print '<td align="right">';
print '<input type="submit" class="button" value="' . $langs->trans("Modify") . '">';
print '</td>';
print '</tr>';
print '</form>';
// use date without hour
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="action" value="set_FICHINTER_DATE_WITHOUT_HOUR">';
print '<tr class="oddeven">';
print '<td>';
print $langs->trans("UseDateWithoutHourOnFichinter");
print '</td>';
print '<td align="center">';
print '<input type="checkbox" name="FICHINTER_DATE_WITHOUT_HOUR"' . ($conf->global->FICHINTER_DATE_WITHOUT_HOUR?' checked':'') . '>';
print '</td>';
print '<td align="right">';
print '<input type="submit" class="button" value="' . $langs->trans("Modify") . '">';
print '</td>';
print '</tr>';
print '</form>';
print '</table>'; print '</table>';

View File

@ -506,6 +506,7 @@ print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="from" value="'.dol_escape_htmltag(GETPOST('from','alpha')).'">'; print '<input type="hidden" name="from" value="'.dol_escape_htmltag(GETPOST('from','alpha')).'">';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
// Line to enter new values (title) // Line to enter new values (title)
@ -619,6 +620,7 @@ $colspan=count($fieldlist)+1;
//print '<tr><td colspan="'.$colspan.'">&nbsp;</td></tr>'; // Keep &nbsp; to have a line with enough height //print '<tr><td colspan="'.$colspan.'">&nbsp;</td></tr>'; // Keep &nbsp; to have a line with enough height
print '</table>'; print '</table>';
print '</div>';
print '</form>'; print '</form>';
@ -629,6 +631,7 @@ print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="from" value="'.dol_escape_htmltag(GETPOST('from','alpha')).'">'; print '<input type="hidden" name="from" value="'.dol_escape_htmltag(GETPOST('from','alpha')).'">';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
// List of available record in database // List of available record in database
@ -913,6 +916,7 @@ else {
} }
print '</table>'; print '</table>';
print '</div>';
print '</form>'; print '</form>';

View File

@ -77,7 +77,7 @@ if ($action == 'update')
dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_SECOND_TAX", $_POST["MAIN_PDF_MAIN_HIDE_SECOND_TAX"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_SECOND_TAX", $_POST["MAIN_PDF_MAIN_HIDE_SECOND_TAX"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_THIRD_TAX", $_POST["_MAIN_PDF_MAIN_HIDE_THIRD_TAX"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_THIRD_TAX", $_POST["MAIN_PDF_MAIN_HIDE_THIRD_TAX"],'chaine',0,'',$conf->entity);
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
exit; exit;
@ -134,7 +134,8 @@ if ($action == 'edit') // Edit
// Misc options // Misc options
print load_fiche_titre($langs->trans("DictionaryPaperFormat"),'','').'<br>'; print load_fiche_titre($langs->trans("DictionaryPaperFormat"),'','').'<br>';
$var=true;
print '<div class="div-table-responsive-no-min">';
print '<table summary="more" class="noborder" width="100%">'; print '<table summary="more" class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>'; print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
@ -161,13 +162,15 @@ if ($action == 'edit') // Edit
print '</td></tr>'; print '</td></tr>';
print '</table>'; print '</table>';
print '</div>';
print '<br>'; print '<br>';
// Addresses // Addresses
print load_fiche_titre($langs->trans("PDFAddressForging"),'','').'<br>'; print load_fiche_titre($langs->trans("PDFAddressForging"),'','').'<br>';
$var=true;
print '<div class="div-table-responsive-no-min">';
print '<table summary="more" class="noborder" width="100%">'; print '<table summary="more" class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>'; print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
@ -250,6 +253,7 @@ if ($action == 'edit') // Edit
} }
print '</table>'; print '</table>';
print '</div>';
print '<br>'; print '<br>';
@ -277,7 +281,7 @@ if ($action == 'edit') // Edit
} }
print load_fiche_titre($langs->trans("PDFLocaltax",$locales),'',''); print load_fiche_titre($langs->trans("PDFLocaltax",$locales),'','');
$var=true;
print '<table summary="more" class="noborder" width="100%">'; print '<table summary="more" class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>'; print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
print $text; print $text;
@ -289,8 +293,9 @@ if ($action == 'edit') // Edit
// Other // Other
print load_fiche_titre($langs->trans("Other"),'','').'<br>'; print load_fiche_titre($langs->trans("Other"),'','').'<br>';
$var=true;
print '<table summary="more" class="noborder" width="100%">'; print '<div class="div-table-responsive-no-min">';
print '<table summary="more" class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>'; print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
// Hide any PDF informations // Hide any PDF informations
@ -329,6 +334,7 @@ if ($action == 'edit') // Edit
print '</td></tr>'; print '</td></tr>';
print '</table>'; print '</table>';
print '</div>';
print '<br><div class="center">'; print '<br><div class="center">';
print '<input class="button" type="submit" name="save" value="'.$langs->trans("Save").'">'; print '<input class="button" type="submit" name="save" value="'.$langs->trans("Save").'">';
@ -341,12 +347,11 @@ if ($action == 'edit') // Edit
} }
else // Show else // Show
{ {
$var=true;
// Misc options // Misc options
print load_fiche_titre($langs->trans("DictionaryPaperFormat"),'',''); print load_fiche_titre($langs->trans("DictionaryPaperFormat"),'','');
print '<div class="div-table-responsive-no-min">';
print '<table summary="more" class="noborder" width="100%">'; print '<table summary="more" class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>'; print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
@ -391,13 +396,15 @@ else // Show
print empty($conf->global->MAIN_PDF_MARGIN_BOTTOM)?10:$conf->global->MAIN_PDF_MARGIN_BOTTOM; print empty($conf->global->MAIN_PDF_MARGIN_BOTTOM)?10:$conf->global->MAIN_PDF_MARGIN_BOTTOM;
print '</td></tr>'; print '</td></tr>';
print '</table>'; print '</table>';
print '</div>';
print '<br>'; print '<br>';
print load_fiche_titre($langs->trans("PDFAddressForging"),'',''); print load_fiche_titre($langs->trans("PDFAddressForging"),'','');
print '<table class="noborder" width="100%">';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>'; print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
// Hide Intra VAT on address // Hide Intra VAT on address
@ -479,6 +486,7 @@ else // Show
} }
print '</table>'."\n"; print '</table>'."\n";
print '</div>';
print '<br>'; print '<br>';
@ -506,11 +514,10 @@ else // Show
} }
print load_fiche_titre($langs->trans("PDFLocaltax",$locales),'',''); print load_fiche_titre($langs->trans("PDFLocaltax",$locales),'','');
$var=true;
print '<table summary="more" class="noborder" width="100%">'; print '<table summary="more" class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>'; print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
print $text; print $text;
print '</table>'; print '</table>';
print '<br>'; print '<br>';
@ -518,11 +525,11 @@ else // Show
// Other // Other
print load_fiche_titre($langs->trans("Other"),'',''); print load_fiche_titre($langs->trans("Other"),'','');
$var=true;
print '<div class="div-table-responsive-no-min">';
print '<table summary="more" class="noborder" width="100%">'; print '<table summary="more" class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px" colspan="2">'.$langs->trans("Value").'</td></tr>'; print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px" colspan="2">'.$langs->trans("Value").'</td></tr>';
// Encrypt and protect PDF // Encrypt and protect PDF
print '<tr class="oddeven">'; print '<tr class="oddeven">';
@ -586,14 +593,17 @@ else // Show
print '</td></tr>'; print '</td></tr>';
print '</table>'; print '</table>';
print '</div>';
/* /*
* Library * Library
*/ */
print '<br>'; print '<br>';
print load_fiche_titre($langs->trans("Library")); print load_fiche_titre($langs->trans("Library"));
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'."\n"; print '<table class="noborder" width="100%">'."\n";
print '<tr class="liste_titre">'."\n"; print '<tr class="liste_titre">'."\n";
@ -601,7 +611,6 @@ else // Show
print '<td>'.$langs->trans("Value").'</td>'."\n"; print '<td>'.$langs->trans("Value").'</td>'."\n";
print "</tr>\n"; print "</tr>\n";
$var=false;
if (! empty($dolibarr_pdf_force_fpdf)) if (! empty($dolibarr_pdf_force_fpdf))
{ {
@ -652,6 +661,7 @@ else // Show
print '</tr>'."\n"; print '</tr>'."\n";
print "</table>\n"; print "</table>\n";
print '</div>';
if (! empty($dolibarr_pdf_force_fpdf)) if (! empty($dolibarr_pdf_force_fpdf))
{ {

View File

@ -131,6 +131,7 @@ dol_fiche_head($head, 'file', $langs->trans("Security"), -1);
// Upload options // Upload options
$var=false; $var=false;
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="2">'.$langs->trans("Parameters").'</td>'; print '<td colspan="2">'.$langs->trans("Parameters").'</td>';
@ -193,6 +194,7 @@ print "</td>";
print '</tr>'; print '</tr>';
print '</table>'; print '</table>';
print '</div>';
dol_fiche_end(); dol_fiche_end();

View File

@ -46,6 +46,7 @@ print load_fiche_titre($langs->trans("FileCheckDolibarr"),'','title_setup');
print $langs->trans("FileCheckDesc").'<br><br>'; print $langs->trans("FileCheckDesc").'<br><br>';
// Version // Version
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Version").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n"; print '<tr class="liste_titre"><td>'.$langs->trans("Version").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
print '<tr class="oddeven"><td width="300">'.$langs->trans("VersionLastInstall").'</td><td>'.$conf->global->MAIN_VERSION_LAST_INSTALL.'</td></tr>'."\n"; print '<tr class="oddeven"><td width="300">'.$langs->trans("VersionLastInstall").'</td><td>'.$conf->global->MAIN_VERSION_LAST_INSTALL.'</td></tr>'."\n";
@ -63,6 +64,7 @@ if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE)) {
} }
print '</td></tr>'."\n"; print '</td></tr>'."\n";
print '</table>'; print '</table>';
print '</div>';
print '<br>'; print '<br>';
@ -161,6 +163,7 @@ if ($xml)
{ {
$out.=load_fiche_titre($langs->trans("ForcedConstants")); $out.=load_fiche_titre($langs->trans("ForcedConstants"));
$out.='<div class="div-table-responsive-no-min">';
$out.='<table class="noborder">'; $out.='<table class="noborder">';
$out.='<tr class="liste_titre">'; $out.='<tr class="liste_titre">';
$out.='<td>#</td>'; $out.='<td>#</td>';
@ -196,6 +199,7 @@ if ($xml)
$out.='<tr class="oddeven"><td colspan="4" class="opacitymedium">'.$langs->trans("None").'</td></tr>'; $out.='<tr class="oddeven"><td colspan="4" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
} }
$out.='</table>'; $out.='</table>';
$out.='</div>';
$out.='<br>'; $out.='<br>';
} }
@ -227,6 +231,7 @@ if ($xml)
// Files missings // Files missings
$out.=load_fiche_titre($langs->trans("FilesMissing")); $out.=load_fiche_titre($langs->trans("FilesMissing"));
$out.='<div class="div-table-responsive-no-min">';
$out.='<table class="noborder">'; $out.='<table class="noborder">';
$out.='<tr class="liste_titre">'; $out.='<tr class="liste_titre">';
$out.='<td>#</td>'; $out.='<td>#</td>';
@ -252,6 +257,7 @@ if ($xml)
$out.='<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("None").'</td></tr>'; $out.='<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
} }
$out.='</table>'; $out.='</table>';
$out.='</div>';
$out.='<br>'; $out.='<br>';
@ -259,6 +265,7 @@ if ($xml)
$out.=load_fiche_titre($langs->trans("FilesModified")); $out.=load_fiche_titre($langs->trans("FilesModified"));
$totalsize=0; $totalsize=0;
$out.='<div class="div-table-responsive-no-min">';
$out.='<table class="noborder">'; $out.='<table class="noborder">';
$out.='<tr class="liste_titre">'; $out.='<tr class="liste_titre">';
$out.='<td>#</td>'; $out.='<td>#</td>';
@ -300,6 +307,7 @@ if ($xml)
$out.='<tr class="oddeven"><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>'; $out.='<tr class="oddeven"><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
} }
$out.='</table>'; $out.='</table>';
$out.='</div>';
$out.='<br>'; $out.='<br>';
@ -307,6 +315,7 @@ if ($xml)
$out.=load_fiche_titre($langs->trans("FilesAdded")); $out.=load_fiche_titre($langs->trans("FilesAdded"));
$totalsize = 0; $totalsize = 0;
$out.='<div class="div-table-responsive-no-min">';
$out.='<table class="noborder">'; $out.='<table class="noborder">';
$out.='<tr class="liste_titre">'; $out.='<tr class="liste_titre">';
$out.='<td>#</td>'; $out.='<td>#</td>';
@ -348,6 +357,7 @@ if ($xml)
$out.='<tr class="oddeven"><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>'; $out.='<tr class="oddeven"><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
} }
$out.='</table>'; $out.='</table>';
$out.='</div>';
// Show warning // Show warning

View File

@ -40,26 +40,27 @@ if (!$user->admin) accessforbidden();
* View * View
*/ */
llxHeader(); llxHeader('', $langs->trans("InfoWebServer"));
print load_fiche_titre($langs->trans("InfoWebServer"),'','title_setup'); print load_fiche_titre($langs->trans("InfoWebServer"),'','title_setup');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print "<tr class=\"liste_titre\"><td>".$langs->trans("Parameter")."</td><td>".$langs->trans("Value")."</td></tr>\n"; print '<tr class="liste_titre"><td>'.$langs->trans("Parameter")."</td><td>".$langs->trans("Value")."</td></tr>\n";
print "<tr $bc[0]><td width=\"240\">".$langs->trans("Version")."</td><td>".$_SERVER["SERVER_SOFTWARE"]."</td></tr>\n"; print '<tr class="oddeven"><td>'.$langs->trans("Version")."</td><td>".$_SERVER["SERVER_SOFTWARE"]."</td></tr>\n";
print "<tr $bc[1]><td>".$langs->trans("VirtualServerName")."</td><td>" . $_SERVER["SERVER_NAME"] . "</td></tr>\n"; print '<tr class="oddeven"><td>'.$langs->trans("VirtualServerName")."</td><td>" . $_SERVER["SERVER_NAME"] . "</td></tr>\n";
print "<tr $bc[0]><td width=\"240\">".$langs->trans("IP")."</td><td>".$_SERVER["SERVER_ADDR"]."</td></tr>\n"; print '<tr class="oddeven"><td>'.$langs->trans("IP")."</td><td>".$_SERVER["SERVER_ADDR"]."</td></tr>\n";
print "<tr $bc[1]><td>".$langs->trans("Port")."</td><td>" . $_SERVER["SERVER_PORT"] . "</td></tr>\n"; print '<tr><td>'.$langs->trans("Port")."</td><td>" . $_SERVER["SERVER_PORT"] . "</td></tr>\n";
print "<tr $bc[0]><td width=\"240\">".$langs->trans("DocumentRootServer")."</td><td>".$_SERVER["DOCUMENT_ROOT"]."</td></tr>\n"; print '<tr><td>'.$langs->trans("DocumentRootServer")."</td><td>".$_SERVER["DOCUMENT_ROOT"]."</td></tr>\n";
print "<tr $bc[1]><td>".$langs->trans("DataRootServer")."</td><td>" . DOL_DATA_ROOT . "</td></tr>\n"; print '<tr><td>'.$langs->trans("DataRootServer")."</td><td>" . DOL_DATA_ROOT . "</td></tr>\n";
$labeluser=dol_getwebuser('user'); $labeluser=dol_getwebuser('user');
$labelgroup=dol_getwebuser('group'); $labelgroup=dol_getwebuser('group');
if ($labeluser && $labelgroup) if ($labeluser && $labelgroup)
{ {
print "<tr $bc[0]><td>".$langs->trans("WebUserGroup")."</td><td>".$labeluser.'/'.$labelgroup."</td></tr>\n"; print '<tr><td>'.$langs->trans("WebUserGroup")."</td><td>".$labeluser.'/'.$labelgroup."</td></tr>\n";
} }
print '</table>'; print '</table>';
print '</div>';
llxFooter(); llxFooter();

View File

@ -465,13 +465,17 @@ if (! empty($_SESSION["commandbackuplastdone"]))
} }
?> ?>
</div> </div> <!-- end div center button -->
<?php <?php
print '</td></tr></table>'; print '</td></tr>';
print '</table>';
?> ?>
</div> </div> <!-- end div fichehalfleft -->
<div id="backupdatabaseright" class="fichehalfright" style="height:480px; overflow: auto;"> <div id="backupdatabaseright" class="fichehalfright" style="height:480px; overflow: auto;">
<div class="ficheaddleft"> <div class="ficheaddleft">
@ -481,6 +485,7 @@ $result=$formfile->list_of_documents($filearray,null,'systemtools','',1,'backup/
print '<br>'; print '<br>';
?> ?>
</div> </div>
</div> </div>

View File

@ -162,6 +162,7 @@ if ($action == 'delete')
* View * View
*/ */
$form = new Form($db);
$formadmin = new FormAdmin($db); $formadmin = new FormAdmin($db);
$wikihelp='EN:Setup|FR:Paramétrage|ES:Configuración'; $wikihelp='EN:Setup|FR:Paramétrage|ES:Configuración';
@ -233,6 +234,7 @@ if ($mode == 'overwrite')
print '<input type="hidden" id="action" name="action" value="">'; print '<input type="hidden" id="action" name="action" value="">';
print '<input type="hidden" id="mode" name="mode" value="'.$mode.'">'; print '<input type="hidden" id="mode" name="mode" value="'.$mode.'">';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre( $langs->trans("Language").' (en_US, es_MX, ...)',$_SERVER["PHP_SELF"],'lang,transkey','',$param,'',$sortfield,$sortorder); print_liste_field_titre( $langs->trans("Language").' (en_US, es_MX, ...)',$_SERVER["PHP_SELF"],'lang,transkey','',$param,'',$sortfield,$sortorder);
@ -319,8 +321,8 @@ if ($mode == 'overwrite')
} }
} }
print '</table>'; print '</table>';
print '</div>';
} }
@ -391,6 +393,7 @@ if ($mode == 'searchkey')
print '<input type="hidden" id="action" name="action" value="search">'; print '<input type="hidden" id="action" name="action" value="search">';
print '<input type="hidden" id="mode" name="mode" value="'.$mode.'">'; print '<input type="hidden" id="mode" name="mode" value="'.$mode.'">';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre( $langs->trans("Language").' (en_US, es_MX, ...)',$_SERVER["PHP_SELF"],'lang,transkey','',$param,'',$sortfield,$sortorder).'</td>'; print_liste_field_titre( $langs->trans("Language").' (en_US, es_MX, ...)',$_SERVER["PHP_SELF"],'lang,transkey','',$param,'',$sortfield,$sortorder).'</td>';
@ -465,7 +468,7 @@ if ($mode == 'searchkey')
} }
print '</table>'; print '</table>';
print '</form>'; print '</div>';
} }
dol_fiche_end(); dol_fiche_end();

View File

@ -640,16 +640,16 @@ class AdvanceTargetingMailing extends CommonObject
$sqlwhere[]=$this->transformToSQL('t.firstname',$arrayquery['contact_firstname']); $sqlwhere[]=$this->transformToSQL('t.firstname',$arrayquery['contact_firstname']);
} }
if (!empty($arrayquery['contact_country']) && count($arrayquery['contact_country'])) { if (!empty($arrayquery['contact_country']) && count($arrayquery['contact_country'])) {
$sqlwhere[]= " (t.fk_pays IN (".implode(',',$arrayquery['contact_country'])."))"; $sqlwhere[]= " (t.fk_pays IN (".$db->escape(implode(',',$arrayquery['contact_country']))."))";
} }
if (!empty($arrayquery['contact_status']) && count($arrayquery['contact_status'])>0) { if (!empty($arrayquery['contact_status']) && count($arrayquery['contact_status'])>0) {
$sqlwhere[]= " (t.statut IN (".implode(',',$arrayquery['contact_status'])."))"; $sqlwhere[]= " (t.statut IN (".$db->escape(implode(',',$arrayquery['contact_status']))."))";
} }
if (!empty($arrayquery['contact_civility']) && count($arrayquery['contact_civility'])>0) { if (!empty($arrayquery['contact_civility']) && count($arrayquery['contact_civility'])>0) {
$sqlwhere[]= " (t.civility IN ('".implode("','",$arrayquery['contact_civility'])."'))"; $sqlwhere[]= " (t.civility IN ('".$db->escape(implode("','",$arrayquery['contact_civility']))."'))";
} }
if ($arrayquery['contact_no_email']!='') { if ($arrayquery['contact_no_email']!='') {
$sqlwhere[]= " (t.no_email='".$arrayquery['contact_no_email']."')"; $sqlwhere[]= " (t.no_email='".$db->escape($arrayquery['contact_no_email'])."')";
} }
if ($arrayquery['contact_update_st_dt']!='') { if ($arrayquery['contact_update_st_dt']!='') {
$sqlwhere[]= " (t.tms >= '".$this->db->idate($arrayquery['contact_update_st_dt'])."' AND t.tms <= '".$this->db->idate($arrayquery['contact_update_end_dt'])."')"; $sqlwhere[]= " (t.tms >= '".$this->db->idate($arrayquery['contact_update_st_dt'])."' AND t.tms <= '".$this->db->idate($arrayquery['contact_update_end_dt'])."')";
@ -658,7 +658,7 @@ class AdvanceTargetingMailing extends CommonObject
$sqlwhere[]= " (t.datec >= '".$this->db->idate($arrayquery['contact_create_st_dt'])."' AND t.datec <= '".$this->db->idate($arrayquery['contact_create_end_dt'])."')"; $sqlwhere[]= " (t.datec >= '".$this->db->idate($arrayquery['contact_create_st_dt'])."' AND t.datec <= '".$this->db->idate($arrayquery['contact_create_end_dt'])."')";
} }
if (!empty($arrayquery['contact_categ']) && count($arrayquery['contact_categ'])>0) { if (!empty($arrayquery['contact_categ']) && count($arrayquery['contact_categ'])>0) {
$sqlwhere[]= " (contactcateg.fk_categorie IN (".implode(",",$arrayquery['contact_categ'])."))"; $sqlwhere[]= " (contactcateg.fk_categorie IN (".$db->escape(implode(",",$arrayquery['contact_categ']))."))";
} }
//Standard Extrafield feature //Standard Extrafield feature

View File

@ -320,8 +320,9 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key); $tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey]; $typ=$extrafields->attribute_type[$tmpkey];
$mode=0; $mode=0;
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{ {
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode); $sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
} }

View File

@ -92,7 +92,7 @@ dol_mkdir($dir);
$stats = new PropaleStats($db, $socid, ($userid>0?$userid:0), $mode); $stats = new PropaleStats($db, $socid, ($userid>0?$userid:0), $mode);
if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND p.fk_statut IN ('.$object_status.')'; if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND p.fk_statut IN ('.$db->escape($object_status).')';
// Build graphic number of object // Build graphic number of object
$data = $stats->getNbByMonthWithPrevYear($endyear,$startyear); $data = $stats->getNbByMonthWithPrevYear($endyear,$startyear);

View File

@ -546,8 +546,9 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key); $tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey]; $typ=$extrafields->attribute_type[$tmpkey];
$mode=0; $mode=0;
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{ {
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode); $sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
} }

View File

@ -88,11 +88,11 @@ dol_mkdir($dir);
$stats = new CommandeStats($db, $socid, $mode, ($userid>0?$userid:0)); $stats = new CommandeStats($db, $socid, $mode, ($userid>0?$userid:0));
if ($mode == 'customer') if ($mode == 'customer')
{ {
if ($object_status != '' && $object_status >= -1) $stats->where .= ' AND c.fk_statut IN ('.$object_status.')'; if ($object_status != '' && $object_status >= -1) $stats->where .= ' AND c.fk_statut IN ('.$db->escape($object_status).')';
} }
if ($mode == 'supplier') if ($mode == 'supplier')
{ {
if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND c.fk_statut IN ('.$object_status.')'; if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND c.fk_statut IN ('.$db->escape($object_status).')';
} }

View File

@ -508,8 +508,9 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key); $tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey]; $typ=$extrafields->attribute_type[$tmpkey];
$mode=0; $mode=0;
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{ {
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode); $sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
} }

View File

@ -165,8 +165,9 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key); $tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey]; $typ=$extrafields->attribute_type[$tmpkey];
$mode=0; $mode=0;
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{ {
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode); $sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
} }

View File

@ -474,8 +474,9 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key); $tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey]; $typ=$extrafields->attribute_type[$tmpkey];
$mode=0; $mode=0;
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{ {
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode); $sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
} }

View File

@ -84,11 +84,11 @@ dol_mkdir($dir);
$stats = new FactureStats($db, $socid, $mode, ($userid>0?$userid:0)); $stats = new FactureStats($db, $socid, $mode, ($userid>0?$userid:0));
if ($mode == 'customer') if ($mode == 'customer')
{ {
if ($object_status != '' && $object_status >= -1) $stats->where .= ' AND f.fk_statut IN ('.$object_status.')'; if ($object_status != '' && $object_status >= -1) $stats->where .= ' AND f.fk_statut IN ('.$db->escape($object_status).')';
} }
if ($mode == 'supplier') if ($mode == 'supplier')
{ {
if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND f.fk_statut IN ('.$object_status.')'; if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND f.fk_statut IN ('.$db->escape($object_status).')';
} }
// Build graphic number of object // Build graphic number of object

View File

@ -328,8 +328,9 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key); $tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey]; $typ=$extrafields->attribute_type[$tmpkey];
$mode=0; $mode=0;
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{ {
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode); $sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
} }

View File

@ -255,8 +255,9 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key); $tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey]; $typ=$extrafields->attribute_type[$tmpkey];
$mode=0; $mode=0;
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{ {
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode); $sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
} }

View File

@ -25,6 +25,7 @@
$maxsizestring=255; $maxsizestring=255;
$maxsizeint=10; $maxsizeint=10;
$mesg=array();
$extrasize=GETPOST('size','int'); $extrasize=GETPOST('size','int');
$type=GETPOST('type','alpha'); $type=GETPOST('type','alpha');

View File

@ -1919,7 +1919,7 @@ class Form
$sql.= ' WHERE p.entity IN ('.getEntity('product').')'; $sql.= ' WHERE p.entity IN ('.getEntity('product').')';
if (count($warehouseStatusArray)) if (count($warehouseStatusArray))
{ {
$sql.= ' AND (p.fk_product_type = 1 OR e.statut IN ('.implode(',',$warehouseStatusArray).'))'; $sql.= ' AND (p.fk_product_type = 1 OR e.statut IN ('.$db->escape(implode(',',$warehouseStatusArray)).'))';
} }
if (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD)) { if (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD)) {

View File

@ -6207,7 +6207,7 @@ function dol_getmypid()
* like "keyword1 keyword2" = We want record field like keyword1 AND field like keyword2 * like "keyword1 keyword2" = We want record field like keyword1 AND field like keyword2
* or like "keyword1|keyword2" = We want record field like keyword1 OR field like keyword2 * or like "keyword1|keyword2" = We want record field like keyword1 OR field like keyword2
* If param $mode is 1, can contains an operator <, > or = like "<10" or ">=100.5 < 1000" * If param $mode is 1, can contains an operator <, > or = like "<10" or ">=100.5 < 1000"
* If param $mode is 2, can contains a list of id separated by comma like "1,3,4" * If param $mode is 2, can contains a list of int id separated by comma like "1,3,4"
* @param integer $mode 0=value is list of keyword strings, 1=value is a numeric test (Example ">5.5 <10"), 2=value is a list of id separated with comma (Example '1,3,4') * @param integer $mode 0=value is list of keyword strings, 1=value is a numeric test (Example ">5.5 <10"), 2=value is a list of id separated with comma (Example '1,3,4')
* @param integer $nofirstand 1=Do not output the first 'AND' * @param integer $nofirstand 1=Do not output the first 'AND'
* @return string $res The statement to append to the SQL query * @return string $res The statement to append to the SQL query

View File

@ -277,7 +277,15 @@ class pdf_soleil extends ModelePDFFicheinter
$curX = $this->posxdesc-1; $curX = $this->posxdesc-1;
// Description of product line // Description of product line
$txt=$outputlangs->transnoentities("Date")." : ".dol_print_date($objectligne->datei,'dayhour',false,$outputlangs,true); if (empty($conf->global->FICHINTER_DATE_WITHOUT_HOUR))
{
$txt=$outputlangs->transnoentities("Date")." : ".dol_print_date($objectligne->datei,'dayhour',false,$outputlangs,true);
}
else
{
$txt=$outputlangs->transnoentities("Date")." : ".dol_print_date($objectligne->datei,'day',false,$outputlangs,true);
}
if ($objectligne->duration > 0) if ($objectligne->duration > 0)
{ {
$txt.=" - ".$outputlangs->transnoentities("Duration")." : ".convertSecondToTime($objectligne->duration); $txt.=" - ".$outputlangs->transnoentities("Duration")." : ".convertSecondToTime($objectligne->duration);

View File

@ -211,8 +211,9 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key); $tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey]; $typ=$extrafields->attribute_type[$tmpkey];
$mode=0; $mode=0;
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{ {
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode); $sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
} }

View File

@ -92,11 +92,11 @@ $sql.= " FROM ".MAIN_DB_PREFIX."don as d LEFT JOIN ".MAIN_DB_PREFIX."projet AS p
$sql.= " ON p.rowid = d.fk_projet WHERE 1 = 1"; $sql.= " ON p.rowid = d.fk_projet WHERE 1 = 1";
if ($statut != '' && $statut != '-1') if ($statut != '' && $statut != '-1')
{ {
$sql .= " AND d.fk_statut IN (".$statut.")"; $sql .= " AND d.fk_statut IN (".$db->escape($statut).")";
} }
if (trim($search_ref) != '') if (trim($search_ref) != '')
{ {
$sql.= natural_search('d.ref',$search_ref); $sql.= natural_search('d.ref', $search_ref);
} }
if (trim($search_all) != '') if (trim($search_all) != '')
{ {

View File

@ -231,8 +231,9 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key); $tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey]; $typ=$extrafields->attribute_type[$tmpkey];
$mode=0; $mode=0;
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{ {
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode); $sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
} }

View File

@ -253,8 +253,9 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key); $tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey]; $typ=$extrafields->attribute_type[$tmpkey];
$mode=0; $mode=0;
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{ {
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode); $sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
} }

View File

@ -74,7 +74,7 @@ print load_fiche_titre($title, $mesg);
dol_mkdir($dir); dol_mkdir($dir);
$stats = new ExpenseReportStats($db, $socid, $userid); $stats = new ExpenseReportStats($db, $socid, $userid);
if ($object_status != '' && $object_status >= -1) $stats->where .= ' AND e.fk_statut IN ('.$object_status.')'; if ($object_status != '' && $object_status >= -1) $stats->where .= ' AND e.fk_statut IN ('.$db->escape($object_status).')';
// Build graphic number of object // Build graphic number of object
// $data = array(array('Lib',val1,val2,val3),...) // $data = array(array('Lib',val1,val2,val3),...)

View File

@ -1379,7 +1379,7 @@ else if ($id > 0 || ! empty($ref))
print dol_htmlentitiesbr($objp->description); print dol_htmlentitiesbr($objp->description);
// Date // Date
print '<td align="center" width="150">'.dol_print_date($db->jdate($objp->date_intervention),'dayhour').'</td>'; print '<td align="center" width="150">'.(empty($conf->global->FICHINTER_DATE_WITHOUT_HOUR)?dol_print_date($db->jdate($objp->date_intervention),'dayhour'):dol_print_date($db->jdate($objp->date_intervention),'day')).'</td>';
// Duration // Duration
print '<td align="right" width="150">'.(empty($conf->global->FICHINTER_WITHOUT_DURATION)?convertSecondToTime($objp->duree):'').'</td>'; print '<td align="right" width="150">'.(empty($conf->global->FICHINTER_WITHOUT_DURATION)?convertSecondToTime($objp->duree):'').'</td>';
@ -1452,7 +1452,8 @@ else if ($id > 0 || ! empty($ref))
// Date d'intervention // Date d'intervention
print '<td align="center" class="nowrap">'; print '<td align="center" class="nowrap">';
$form->select_date($db->jdate($objp->date_intervention),'di',1,1,0,"date_intervention"); if (!empty($conf->global->FICHINTER_DATE_WITHOUT_HOUR)) $form->select_date($db->jdate($objp->date_intervention),'di',0,0,0,"date_intervention");
else $form->select_date($db->jdate($objp->date_intervention),'di',1,1,0,"date_intervention");
print '</td>'; print '</td>';
// Duration // Duration
@ -1519,7 +1520,8 @@ else if ($id > 0 || ! empty($ref))
$timearray=dol_getdate($now); $timearray=dol_getdate($now);
if (! GETPOST('diday','int')) $timewithnohour=dol_mktime(0,0,0,$timearray['mon'],$timearray['mday'],$timearray['year']); if (! GETPOST('diday','int')) $timewithnohour=dol_mktime(0,0,0,$timearray['mon'],$timearray['mday'],$timearray['year']);
else $timewithnohour=dol_mktime(GETPOST('dihour','int'),GETPOST('dimin','int'), 0,GETPOST('dimonth','int'),GETPOST('diday','int'),GETPOST('diyear','int')); else $timewithnohour=dol_mktime(GETPOST('dihour','int'),GETPOST('dimin','int'), 0,GETPOST('dimonth','int'),GETPOST('diday','int'),GETPOST('diyear','int'));
$form->select_date($timewithnohour,'di',1,1,0,"addinter"); if (!empty($conf->global->FICHINTER_DATE_WITHOUT_HOUR)) $form->select_date($timewithnohour,'di',0,0,0,"addinter");
else $form->select_date($timewithnohour,'di',1,1,0,"addinter");
print '</td>'; print '</td>';
// Duration // Duration

View File

@ -223,8 +223,9 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key); $tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey]; $typ=$extrafields->attribute_type[$tmpkey];
$mode=0; $mode=0;
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{ {
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode); $sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
} }

View File

@ -75,7 +75,7 @@ print load_fiche_titre($title,'','title_commercial.png');
dol_mkdir($dir); dol_mkdir($dir);
$stats = new FichinterStats($db, $socid, $mode, ($userid>0?$userid:0)); $stats = new FichinterStats($db, $socid, $mode, ($userid>0?$userid:0));
if ($object_status != '' && $object_status > -1) $stats->where .= ' AND c.fk_statut IN ('.$object_status.')'; if ($object_status != '' && $object_status > -1) $stats->where .= ' AND c.fk_statut IN ('.$db->escape($object_status).')';
// Build graphic number of object // Build graphic number of object
$data = $stats->getNbByMonthWithPrevYear($endyear,$startyear); $data = $stats->getNbByMonthWithPrevYear($endyear,$startyear);

View File

@ -535,9 +535,9 @@ if ($search_request_author) $sql.=natural_search(array('u.lastname','u.firstname
if ($billed != '' && $billed >= 0) $sql .= " AND cf.billed = ".$billed; if ($billed != '' && $billed >= 0) $sql .= " AND cf.billed = ".$billed;
//Required triple check because statut=0 means draft filter //Required triple check because statut=0 means draft filter
if (GETPOST('statut', 'alpha') !== '') if (GETPOST('statut', 'intcomma') !== '')
{ {
$sql .= " AND cf.fk_statut IN (".$db->escape(GETPOST('statut', 'alpha')).")"; $sql .= " AND cf.fk_statut IN (".$db->escape($db->escape(GETPOST('statut', 'intcomma'))).")";
} }
if ($search_status != '' && $search_status >= 0) if ($search_status != '' && $search_status >= 0)
{ {
@ -589,8 +589,9 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key); $tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey]; $typ=$extrafields->attribute_type[$tmpkey];
$mode=0; $mode=0;
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{ {
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode); $sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
} }

View File

@ -373,8 +373,9 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key); $tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey]; $typ=$extrafields->attribute_type[$tmpkey];
$mode=0; $mode=0;
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{ {
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode); $sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
} }

View File

@ -155,6 +155,12 @@ ALTER TABLE llx_projet ADD COLUMN fk_user_modif integer;
ALTER TABLE llx_projet_task_time ADD COLUMN datec date; ALTER TABLE llx_projet_task_time ADD COLUMN datec date;
ALTER TABLE llx_projet_task_time ADD COLUMN tms timestamp; ALTER TABLE llx_projet_task_time ADD COLUMN tms timestamp;
ALTER TABLE llx_product_price ADD COLUMN fk_multicurrency integer;
ALTER TABLE llx_product_price ADD COLUMN multicurrency_code varchar(255);
ALTER TABLE llx_product_price ADD COLUMN multicurrency_tx double(24,8) DEFAULT 1;
ALTER TABLE llx_product_price ADD COLUMN multicurrency_price double(24,8) DEFAULT NULL;
ALTER TABLE llx_product_price ADD COLUMN multicurrency_price_ttc double(24,8) DEFAULT NULL;
ALTER TABLE llx_product_price_by_qty ADD COLUMN fk_user_creat integer; ALTER TABLE llx_product_price_by_qty ADD COLUMN fk_user_creat integer;
ALTER TABLE llx_product_price_by_qty ADD COLUMN fk_user_modif integer; ALTER TABLE llx_product_price_by_qty ADD COLUMN fk_user_modif integer;
ALTER TABLE llx_product_price_by_qty DROP COLUMN date_price; ALTER TABLE llx_product_price_by_qty DROP COLUMN date_price;
@ -534,6 +540,9 @@ ALTER TABLE llx_website_page ADD UNIQUE INDEX uk_website_page_url (fk_website,pa
ALTER TABLE llx_website_page ADD CONSTRAINT fk_website_page_website FOREIGN KEY (fk_website) REFERENCES llx_website (rowid); ALTER TABLE llx_website_page ADD CONSTRAINT fk_website_page_website FOREIGN KEY (fk_website) REFERENCES llx_website (rowid);
ALTER TABLE llx_website_page ADD COLUMN fk_user_create integer;
ALTER TABLE llx_website_page ADD COLUMN fk_user_modif integer;
UPDATE llx_extrafields set elementtype='categorie' where elementtype='categories'; UPDATE llx_extrafields set elementtype='categorie' where elementtype='categories';

View File

@ -409,7 +409,7 @@ ComputedFormulaDesc=You can enter here a formula using other properties of objec
ExtrafieldParamHelpselect=List of values must be lines with format key,value (where key can't be '0')<br><br> for example : <br>1,value1<br>2,value2<br>code3,value3<br>...<br><br>In order to have the list depending on another complementary attribute list :<br>1,value1|options_<i>parent_list_code</i>:parent_key<br>2,value2|options_<i>parent_list_code</i>:parent_key <br><br>In order to have the list depending on another list :<br>1,value1|<i>parent_list_code</i>:parent_key<br>2,value2|<i>parent_list_code</i>:parent_key ExtrafieldParamHelpselect=List of values must be lines with format key,value (where key can't be '0')<br><br> for example : <br>1,value1<br>2,value2<br>code3,value3<br>...<br><br>In order to have the list depending on another complementary attribute list :<br>1,value1|options_<i>parent_list_code</i>:parent_key<br>2,value2|options_<i>parent_list_code</i>:parent_key <br><br>In order to have the list depending on another list :<br>1,value1|<i>parent_list_code</i>:parent_key<br>2,value2|<i>parent_list_code</i>:parent_key
ExtrafieldParamHelpcheckbox=List of values must be lines with format key,value (where key can't be '0')<br><br> for example : <br>1,value1<br>2,value2<br>3,value3<br>... ExtrafieldParamHelpcheckbox=List of values must be lines with format key,value (where key can't be '0')<br><br> for example : <br>1,value1<br>2,value2<br>3,value3<br>...
ExtrafieldParamHelpradio=List of values must be lines with format key,value (where key can't be '0')<br><br> for example : <br>1,value1<br>2,value2<br>3,value3<br>... ExtrafieldParamHelpradio=List of values must be lines with format key,value (where key can't be '0')<br><br> for example : <br>1,value1<br>2,value2<br>3,value3<br>...
ExtrafieldParamHelpsellist=List of values comes from a table<br>Syntax : table_name:label_field:id_field::filter<br>Example : c_typent:libelle:id::filter<br><br>filter can be a simple test (eg active=1) to display only active value<br>You can also use $ID$ in filter witch is the current id of current object<br>To do a SELECT in filter use $SEL$<br>if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)<br><br>In order to have the list depending on another complementary attribute list:<br>c_typent:libelle:id:options_<i>parent_list_code</i>|parent_column:filter <br><br>In order to have the list depending on another list:<br>c_typent:libelle:id:<i>parent_list_code</i>|parent_column:filter ExtrafieldParamHelpsellist=List of values comes from a table<br>Syntax : table_name:label_field:id_field::filter<br>Example : c_typent:libelle:id::filter<br><br>- idfilter is necessarly a primary int key<br>- filter can be a simple test (eg active=1) to display only active value<br>You can also use $ID$ in filter witch is the current id of current object<br>To do a SELECT in filter use $SEL$<br>if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)<br><br>In order to have the list depending on another complementary attribute list:<br>c_typent:libelle:id:options_<i>parent_list_code</i>|parent_column:filter <br><br>In order to have the list depending on another list:<br>c_typent:libelle:id:<i>parent_list_code</i>|parent_column:filter
ExtrafieldParamHelpchkbxlst=List of values comes from a table<br>Syntax : table_name:label_field:id_field::filter<br>Example : c_typent:libelle:id::filter<br><br>filter can be a simple test (eg active=1) to display only active value<br>You can also use $ID$ in filter witch is the current id of current object<br>To do a SELECT in filter use $SEL$<br>if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)<br><br>In order to have the list depending on another complementary attribute list :<br>c_typent:libelle:id:options_<i>parent_list_code</i>|parent_column:filter <br><br>In order to have the list depending on another list:<br>c_typent:libelle:id:<i>parent_list_code</i>|parent_column:filter ExtrafieldParamHelpchkbxlst=List of values comes from a table<br>Syntax : table_name:label_field:id_field::filter<br>Example : c_typent:libelle:id::filter<br><br>filter can be a simple test (eg active=1) to display only active value<br>You can also use $ID$ in filter witch is the current id of current object<br>To do a SELECT in filter use $SEL$<br>if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)<br><br>In order to have the list depending on another complementary attribute list :<br>c_typent:libelle:id:options_<i>parent_list_code</i>|parent_column:filter <br><br>In order to have the list depending on another list:<br>c_typent:libelle:id:<i>parent_list_code</i>|parent_column:filter
ExtrafieldParamHelplink=Parameters must be ObjectName:Classpath<br>Syntax : ObjectName:Classpath<br>Example : Societe:societe/class/societe.class.php ExtrafieldParamHelplink=Parameters must be ObjectName:Classpath<br>Syntax : ObjectName:Classpath<br>Example : Societe:societe/class/societe.class.php
LibraryToBuildPDF=Library used for PDF generation LibraryToBuildPDF=Library used for PDF generation

View File

@ -48,6 +48,8 @@ TypeContact_fichinter_external_CUSTOMER=Following-up customer contact
PrintProductsOnFichinter=Print also lines of type "product" (not only services) on intervention card PrintProductsOnFichinter=Print also lines of type "product" (not only services) on intervention card
PrintProductsOnFichinterDetails=interventions generated from orders PrintProductsOnFichinterDetails=interventions generated from orders
UseServicesDurationOnFichinter=Use services duration for interventions generated from orders UseServicesDurationOnFichinter=Use services duration for interventions generated from orders
UseDurationOnFichinter=Hides the duration field for intervention records
UseDateWithoutHourOnFichinter=Hides hours and minutes off the date field for intervention records
InterventionStatistics=Statistics of interventions InterventionStatistics=Statistics of interventions
NbOfinterventions=Nb of intervention cards NbOfinterventions=Nb of intervention cards
NumberOfInterventionsByMonth=Nb of intervention cards by month (date of validation) NumberOfInterventionsByMonth=Nb of intervention cards by month (date of validation)

View File

@ -48,6 +48,8 @@ TypeContact_fichinter_external_CUSTOMER=Contact client suivi de l'intervention
PrintProductsOnFichinter=Imprimer aussi les lignes de type "produit" (pas seulement de type service) sur les fiches d'intervention PrintProductsOnFichinter=Imprimer aussi les lignes de type "produit" (pas seulement de type service) sur les fiches d'intervention
PrintProductsOnFichinterDetails=interventions générées à partir des commandes PrintProductsOnFichinterDetails=interventions générées à partir des commandes
UseServicesDurationOnFichinter=Utiliser la durée des services dans les interventions créées depuis des commandes UseServicesDurationOnFichinter=Utiliser la durée des services dans les interventions créées depuis des commandes
UseDurationOnFichinter=Masquer le champ durée dans les fiches d'intervention
UseDateWithoutHourOnFichinter=Masquer l'heure de la date d'intervention
InterventionStatistics=Statistiques des interventions InterventionStatistics=Statistiques des interventions
NbOfinterventions=Nb de fiches d'intervention NbOfinterventions=Nb de fiches d'intervention
NumberOfInterventionsByMonth=Nb de fiches d'intervention par mois (date de validation) NumberOfInterventionsByMonth=Nb de fiches d'intervention par mois (date de validation)

View File

@ -227,8 +227,9 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key); $tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey]; $typ=$extrafields->attribute_type[$tmpkey];
$mode=0; $mode=0;
if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
if ($crit != '' && (! in_array($typ, array('select')) || $crit != '0')) if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{ {
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode); $sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
} }
@ -355,7 +356,7 @@ $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
$selectedfields.=$form->showCheckAddButtons('checkforselect', 1); $selectedfields.=$form->showCheckAddButtons('checkforselect', 1);
print '<div class="div-table-responsive">'; print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n"; print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";

View File

@ -115,14 +115,14 @@ class FormProduct
$sql.= " WHERE e.entity IN (".getEntity('stock').")"; $sql.= " WHERE e.entity IN (".getEntity('stock').")";
if (count($warehouseStatus)) if (count($warehouseStatus))
{ {
$sql.= " AND e.statut IN (".implode(',',$warehouseStatus).")"; $sql.= " AND e.statut IN (".$db->escape(implode(',',$warehouseStatus)).")";
} }
else else
{ {
$sql.= " AND e.statut = 1"; $sql.= " AND e.statut = 1";
} }
if(!empty($exclude)) $sql.= ' AND e.rowid NOT IN('.implode(',', $exclude).')'; if(!empty($exclude)) $sql.= ' AND e.rowid NOT IN('.$db->escape(implode(',', $exclude)).')';
if ($sumStock && empty($fk_product)) $sql.= " GROUP BY e.rowid, e.label, e.description, e.fk_parent"; if ($sumStock && empty($fk_product)) $sql.= " GROUP BY e.rowid, e.label, e.description, e.fk_parent";
$sql.= " ORDER BY e.label"; $sql.= " ORDER BY e.label";

View File

@ -3750,7 +3750,7 @@ class Product extends CommonObject
$sql.= " WHERE w.entity IN (".getEntity('stock').")"; $sql.= " WHERE w.entity IN (".getEntity('stock').")";
$sql.= " AND w.rowid = ps.fk_entrepot"; $sql.= " AND w.rowid = ps.fk_entrepot";
$sql.= " AND ps.fk_product = ".$this->id; $sql.= " AND ps.fk_product = ".$this->id;
if ($conf->global->ENTREPOT_EXTRA_STATUS && count($warehouseStatus)) $sql.= " AND w.statut IN (".implode(',',$warehouseStatus).")"; if ($conf->global->ENTREPOT_EXTRA_STATUS && count($warehouseStatus)) $sql.= " AND w.statut IN (".$db->escape(implode(',',$warehouseStatus)).")";
dol_syslog(get_class($this)."::load_stock", LOG_DEBUG); dol_syslog(get_class($this)."::load_stock", LOG_DEBUG);
$result = $this->db->query($sql); $result = $this->db->query($sql);

View File

@ -226,8 +226,9 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key); $tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey]; $typ=$extrafields->attribute_type[$tmpkey];
$mode=0; $mode=0;
if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{ {
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode); $sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
} }

View File

@ -321,8 +321,9 @@ else
$tmpkey=preg_replace('/search_options_/','',$key); $tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey]; $typ=$extrafields->attribute_type[$tmpkey];
$mode=0; $mode=0;
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{ {
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode); $sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
} }

View File

@ -325,8 +325,9 @@ else
$tmpkey=preg_replace('/search_options_/','',$key); $tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey]; $typ=$extrafields->attribute_type[$tmpkey];
$mode=0; $mode=0;
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{ {
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode); $sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
} }

View File

@ -465,8 +465,9 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key); $tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey]; $typ=$extrafields->attribute_type[$tmpkey];
$mode=0; $mode=0;
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{ {
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode); $sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
} }

View File

@ -244,8 +244,9 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key); $tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey]; $typ=$extrafields->attribute_type[$tmpkey];
$mode=0; $mode=0;
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{ {
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode); $sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
} }

View File

@ -323,8 +323,9 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key); $tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey]; $typ=$extrafields->attribute_type[$tmpkey];
$mode=0; $mode=0;
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{ {
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode); $sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
} }

View File

@ -321,8 +321,9 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key); $tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey]; $typ=$extrafields->attribute_type[$tmpkey];
$mode=0; $mode=0;
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{ {
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode); $sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
} }

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2017 Alexandre Spangaro <aspangaro@zendsi.com> /* Copyright (C) 2017 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2017 Saasprov <saasprov@gmail.com> * Copyright (C) 2017 Saasprov <saasprov@gmail.com>
* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -1084,6 +1085,7 @@ if (preg_match('/^dopayment/',$action))
box-shadow: 0 1px 3px 0 #e6ebf1; box-shadow: 0 1px 3px 0 #e6ebf1;
-webkit-transition: box-shadow 150ms ease; -webkit-transition: box-shadow 150ms ease;
transition: box-shadow 150ms ease; transition: box-shadow 150ms ease;
width: 350px;
} }
.StripeElement--focus { .StripeElement--focus {

View File

@ -76,8 +76,9 @@ foreach ($search_array_options as $key => $val)
$param.='&search_options_'.$tmpkey.'='.urlencode($val); $param.='&search_options_'.$tmpkey.'='.urlencode($val);
} }
$mode=0; $mode=0;
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{ {
$filter['ef.'.$tmpkey]=natural_search('ef.'.$tmpkey, $crit, $mode); $filter['ef.'.$tmpkey]=natural_search('ef.'.$tmpkey, $crit, $mode);
} }

View File

@ -473,12 +473,14 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key); $tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey]; $typ=$extrafields->attribute_type[$tmpkey];
$mode=0; $mode=0;
if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
if ($crit != '' && (! in_array($typ, array('select')) || $crit != '0')) if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{ {
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode); $sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
} }
} }
// Add where from hooks // Add where from hooks
$parameters=array(); $parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook

View File

@ -284,7 +284,7 @@ if ($search_montant_vat != '') $sql.= natural_search("sp.tva", $search_montant_v
if ($search_montant_ttc != '') $sql.= natural_search("sp.total", $search_montant_ttc, 1); if ($search_montant_ttc != '') $sql.= natural_search("sp.total", $search_montant_ttc, 1);
if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall); if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall);
if ($socid) $sql.= ' AND s.rowid = '.$socid; if ($socid) $sql.= ' AND s.rowid = '.$socid;
if ($search_status >= 0 && $search_status != '') $sql.= ' AND sp.fk_statut IN ('.$search_status.')'; if ($search_status >= 0 && $search_status != '') $sql.= ' AND sp.fk_statut IN ('.$db->escape($search_status).')';
if ($month > 0) if ($month > 0)
{ {
if ($year > 0 && empty($day)) if ($year > 0 && empty($day))
@ -323,8 +323,9 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key); $tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey]; $typ=$extrafields->attribute_type[$tmpkey];
$mode=0; $mode=0;
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{ {
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode); $sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
} }

View File

@ -224,8 +224,9 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key); $tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey]; $typ=$extrafields->attribute_type[$tmpkey];
$mode=0; $mode=0;
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{ {
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode); $sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
} }