';
@@ -245,20 +238,23 @@ $sql .= ", tms";
$sql .= ", entity";
$sql .= " FROM ".MAIN_DB_PREFIX."const";
$sql .= " WHERE entity IN (".$user->entity.",".$conf->entity.")";
-if ((empty($user->entity) || $user->admin) && $debug) {} // to force for superadmin to debug
-elseif (!GETPOST('visible') || GETPOST('visible') != 'all') $sql .= " AND visible = 1"; // We must always have this. Otherwise, array is too large and submitting data fails due to apache POST or GET limits
-if (GETPOST('name')) $sql .= natural_search("name", GETPOST('name'));
+if ((empty($user->entity) || $user->admin) && $debug) {
+} elseif (!GETPOST('visible') || GETPOST('visible') != 'all') {
+ // to force for superadmin to debug
+ $sql .= " AND visible = 1"; // We must always have this. Otherwise, array is too large and submitting data fails due to apache POST or GET limits
+}
+if (GETPOST('name')) {
+ $sql .= natural_search("name", GETPOST('name'));
+}
$sql .= $db->order($sortfield, $sortorder);
dol_syslog("Const::listConstant", LOG_DEBUG);
$result = $db->query($sql);
-if ($result)
-{
+if ($result) {
$num = $db->num_rows($result);
$i = 0;
- while ($i < $num)
- {
+ while ($i < $num) {
$obj = $db->fetch_object($result);
print "\n";
@@ -284,8 +280,7 @@ if ($result)
print '';
// Entity limit to superadmin
- if (!empty($conf->multicompany->enabled) && !$user->entity)
- {
+ if (!empty($conf->multicompany->enabled) && !$user->entity) {
print '
';
print '';
print '
';
@@ -295,8 +290,7 @@ if ($result)
print '';
}
- if ($conf->use_javascript_ajax)
- {
+ if ($conf->use_javascript_ajax) {
print '';
} else {
print ''.img_delete().'';
@@ -313,8 +307,7 @@ if ($result)
print '
'."\n";
$needToFetchEachLine = 0;
if (is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) {
foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) {
- if (preg_match('/\$object/', $val)) $needToFetchEachLine++; // There is at least one compute field that use $object
+ if (preg_match('/\$object/', $val)) {
+ $needToFetchEachLine++; // There is at least one compute field that use $object
+ }
}
}
@@ -616,11 +647,15 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
print '
';
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
$selected = 0;
- if (in_array($object->id, $arrayofselected)) $selected = 1;
+ if (in_array($object->id, $arrayofselected)) {
+ $selected = 1;
+ }
print '';
}
print '
';
+}
+// If the user can view prospects other than his'
+if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) {
+ include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
+ $moreforfilter .= '
';
- // If the user can view prospects other than his'
- if ($user->rights->societe->client->voir || $socid) {
- $langs->load("commercial");
- $moreforfilter .= '
';
- }
- // If the user can view prospects other than his'
- if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) {
- include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
- $moreforfilter .= '
';
+}
+// Extra fields
+include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
- if (!empty($moreforfilter)) {
- print '
';
- print $moreforfilter;
- print '
';
- }
+// Fields from hook
+$parameters = array('arrayfields'=>$arrayfields);
+$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
+print $hookmanager->resPrint;
+// Date creation
+if (!empty($arrayfields['e.datec']['checked'])) {
+ print '
';
- }
- // Extra fields
- include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
-
- // Fields from hook
- $parameters = array('arrayfields'=>$arrayfields);
- $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
- print $hookmanager->resPrint;
- // Date creation
- if (!empty($arrayfields['e.datec']['checked'])) {
- print '
';
- print '
';
- }
- // Date modification
- if (!empty($arrayfields['e.tms']['checked'])) {
- print '
';
- print '
';
- }
- // Status
- if (!empty($arrayfields['e.fk_statut']['checked'])) {
- print '
';
- if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
- $selected = 0;
- if (in_array($obj->rowid, $arrayofselected)) {
- $selected = 1;
- }
- print '';
+ print '
';
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
}
- // Show list of available documents
- $urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
- $urlsource .= str_replace('&', '&', $param);
+ // Action column
+ print '
';
+ if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
+ $selected = 0;
+ if (in_array($obj->rowid, $arrayofselected)) {
+ $selected = 1;
+ }
+ print '';
+ }
+ print '
';
@@ -529,7 +533,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ
} else {
//if (! empty($conf->modules))
if (!empty($conf->modules_parts['hooks'])) { // If there is at least one module with one hook, we show message to say nothing was done
- print '
';
+ // Set constant to ask to remake a new ping to inform about upgrade (if first ping was done and OK)
$sql = 'UPDATE '.MAIN_DB_PREFIX."const SET VALUE = 'torefresh' WHERE name = 'MAIN_FIRST_PING_OK_ID'";
$db->query($sql, 1);
@@ -563,7 +568,39 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ
// Actions for all versions (no database change but rename some directories)
migrate_rename_directories($db, $langs, $conf, '/banque/bordereau', '/bank/checkdeposits');
- print '
'.$langs->trans("MigrationFinished").'
';
+ $silent = 0;
+ if (!$silent) {
+ print '
';
+ print '
'.$langs->trans("MigrationFinished").'
';
+ print '
';
+ if ($error == 0) {
+ //print ''.$langs->trans("OK").' - '; // $error = 0 does not mean there is no error (error are not always trapped)
+ } else {
+ print ''.$langs->trans("Error").' - ';
+ }
+
+ //if (!empty($conf->use_javascript_ajax)) { // use_javascript_ajax is not defined
+ print '';
+ print ''.$langs->trans("ShowHideDetails").'';
+ //}
+
+ print '
'."\n";
+ print '
';
+ }
+
+ //print '
'.$langs->trans("MigrationFinished").'
';
} else {
print '
'.$langs->trans('ErrorWrongParameters').'
';
$error++;
@@ -4296,7 +4333,7 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo
$mod = new $classname($db);
//$mod->remove('noboxes');
- $mod->delete_menus(); // We must delete to be sure it is insert with new values
+ $mod->delete_menus(); // We must delete to be sure it is inserted with new values
$mod->init($reloadmode);
} else {
dolibarr_install_syslog('Failed to include '.DOL_DOCUMENT_ROOT.'/core/modules/mod'.$moduletoreloadshort.'.class.php');
@@ -4320,7 +4357,7 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo
}
if (!empty($mod) && is_object($mod)) {
- print '
';
+ print '
';
print ''.$langs->trans('Upgrade').': ';
print $langs->trans('MigrationReloadModule').' '.$mod->getName(); // We keep getName outside of trans because getName is already encoded/translated
print "";
@@ -4355,7 +4392,7 @@ function migrate_reload_menu($db, $langs, $conf)
}
foreach ($listofmenuhandler as $key => $val) {
- print '
\n";
}
@@ -884,7 +888,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
if (!empty($arrayfields['m.label']['checked'])) {
// Label of movement
- print '
'.$objp->label.'
';
+ print '
'.$objp->label.'
';
}
if (!empty($arrayfields['m.type_mouvement']['checked'])) {
// Type of movement
@@ -907,6 +911,14 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Origin of movement
print '
';
}
// EMail
diff --git a/htdocs/public/recruitment/index.php b/htdocs/public/recruitment/index.php
index 204d3bf3140..c7381059a39 100644
--- a/htdocs/public/recruitment/index.php
+++ b/htdocs/public/recruitment/index.php
@@ -32,8 +32,12 @@ if (!defined('NOREQUIREMENU')) {
if (!defined("NOLOGIN")) {
define("NOLOGIN", '1');
}
-if (!defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
-if (!defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1');
+if (!defined('NOIPCHECK')) {
+ define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
+}
+if (!defined('NOBROWSERNOTIF')) {
+ define('NOBROWSERNOTIF', '1');
+}
// If this page is public (can be called outside logged session)
require '../../main.inc.php';
@@ -206,7 +210,9 @@ if ($display_ticket_list) {
$limit = $conf->liste_limit;
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
- if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
+ if (empty($page) || $page == -1) {
+ $page = 0;
+ } // If $page is not defined, or '' or -1
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
@@ -237,8 +243,9 @@ if ($display_ticket_list) {
$sql .= " type.label as type_label, category.label as category_label, severity.label as severity_label";
// Add fields for extrafields
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
- foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val)
+ foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : '');
+ }
}
$sql .= " FROM ".MAIN_DB_PREFIX."recruitment_recruitmentjobposition as t";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid=t.fk_soc";
@@ -360,8 +367,7 @@ if ($display_ticket_list) {
print_liste_field_titre($selectedfields, $url_page_current, "", '', '', 'align="right"', $sortfield, $sortorder, 'center maxwidthsearch ');
print '';
- while ($obj = $db->fetch_object($resql))
- {
+ while ($obj = $db->fetch_object($resql)) {
print '
';
// Date ticket
diff --git a/htdocs/public/recruitment/view.php b/htdocs/public/recruitment/view.php
index b8858b921e9..27aaa0fd0f4 100644
--- a/htdocs/public/recruitment/view.php
+++ b/htdocs/public/recruitment/view.php
@@ -21,10 +21,18 @@
* \brief Public file to show on job
*/
-if (!defined('NOLOGIN')) define("NOLOGIN", 1); // This means this output page does not require to be logged.
-if (!defined('NOCSRFCHECK')) define("NOCSRFCHECK", 1); // We accept to go on this page from external web site.
-if (!defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
-if (!defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1');
+if (!defined('NOLOGIN')) {
+ define("NOLOGIN", 1); // This means this output page does not require to be logged.
+}
+if (!defined('NOCSRFCHECK')) {
+ define("NOCSRFCHECK", 1); // We accept to go on this page from external web site.
+}
+if (!defined('NOIPCHECK')) {
+ define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
+}
+if (!defined('NOBROWSERNOTIF')) {
+ define('NOBROWSERNOTIF', '1');
+}
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentjobposition.class.php';
@@ -52,10 +60,8 @@ if (isset($_SESSION['email_customer'])) {
$object = new RecruitmentJobPosition($db);
-if (!$action)
-{
- if (!$ref)
- {
+if (!$action) {
+ if (!$ref) {
print $langs->trans('ErrorBadParameters')." - ref missing";
exit;
} else {
@@ -73,10 +79,8 @@ $urlwithroot = DOL_MAIN_URL_ROOT; // This is to use same domain name than curren
* Actions
*/
-if ($cancel)
-{
- if (!empty($backtopage))
- {
+if ($cancel) {
+ if (!empty($backtopage)) {
header("Location: ".$backtopage);
exit;
}
@@ -125,8 +129,7 @@ if ($action == "view" || $action == "presend" || $action == "close" || $action =
if ($error || $errors) {
setEventMessages($object->error, $object->errors, 'errors');
- if ($action == "add_message")
- {
+ if ($action == "add_message") {
$action = 'presend';
} else {
$action = '';
@@ -150,7 +153,9 @@ include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
*/
$head = '';
-if (!empty($conf->global->MAIN_RECRUITMENT_CSS_URL)) $head = ''."\n";
+if (!empty($conf->global->MAIN_RECRUITMENT_CSS_URL)) {
+ $head = ''."\n";
+}
$conf->dol_hide_topmenu = 1;
$conf->dol_hide_leftmenu = 1;
@@ -188,24 +193,24 @@ print '
@@ -171,7 +185,7 @@ if ($dolibarr_main_prod) {
LightDark
-
+
status
@@ -188,7 +202,7 @@ if ($dolibarr_main_prod) {
<span class="badge badge-pill badge-info">Info</span>
<span class="badge badge-pill badge-light">Light</span>
<span class="badge badge-pill badge-dark">Dark</span>
-
+
<span class="badge badge-pill badge-status" >status</span>
@@ -210,7 +224,7 @@ if ($dolibarr_main_prod) {
-
+
@@ -227,7 +241,7 @@ if ($dolibarr_main_prod) {
<span class="badge badge-dot badge-info"></span>
<span class="badge badge-dot badge-light"></span>
<span class="badge badge-dot badge-dark"></span>
-
+
<span class="badge badge-dot badge-status" ></span>
@@ -256,7 +270,7 @@ if ($dolibarr_main_prod) {
InfoLightDark
-
+
status
@@ -271,7 +285,7 @@ if ($dolibarr_main_prod) {
<a href="#" class="badge badge-info">Info</a>
<a href="#" class="badge badge-light">Light</a>
<a href="#" class="badge badge-dark">Dark</a>
-
+
<a href="#" class="badge badge-status" >status</a>
@@ -326,7 +340,7 @@ if ($dolibarr_main_prod) {
-
+
\ No newline at end of file
diff --git a/htdocs/public/test/test_arrays.php b/htdocs/public/test/test_arrays.php
index 879f37ed5dc..b2a87a75480 100644
--- a/htdocs/public/test/test_arrays.php
+++ b/htdocs/public/test/test_arrays.php
@@ -2,15 +2,25 @@
//define("NOLOGIN",1); // This means this output page does not require to be logged.
//if (!defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1');
//if (!defined('NOREQUIREDB')) define('NOREQUIREDB', '1');
-if (!defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1');
+if (!defined('NOREQUIRESOC')) {
+ define('NOREQUIRESOC', '1');
+}
//if (!defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1');
-if (!defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data
-if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check anti CSRF attack test
-if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not check anti POST attack test
+if (!defined('NOSTYLECHECK')) {
+ define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data
+}
+if (!defined('NOCSRFCHECK')) {
+ define('NOCSRFCHECK', '1'); // Do not check anti CSRF attack test
+}
+if (!defined('NOTOKENRENEWAL')) {
+ define('NOTOKENRENEWAL', '1'); // Do not check anti POST attack test
+}
//if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu
//if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php
//if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library
-if (!defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session)
+if (!defined("NOLOGIN")) {
+ define("NOLOGIN", '1'); // If this page is public (can be called outside logged session)
+}
require '../../main.inc.php';
@@ -29,8 +39,7 @@ $form = new Form($db);
// HEADER
//--------
-if (empty($usedolheader))
-{
+if (empty($usedolheader)) {
header("Content-type: text/html; charset=UTF8");
?>
@@ -75,7 +84,7 @@ if (empty($usedolheader))
'/includes/pdfmake/pdfmake.min.js',
'/includes/pdfmake/vfs_fonts.js'
);
- */
+ */
llxHeader('', '', '', '', 0, 0, $arrayjs, $arraycss);
}
@@ -125,14 +134,14 @@ This page is a sample of page using tables. It is designed to make test with
Example 0c: Table with table+tr+td containg a select that should be overflowed and truncated => Use this to align text or form
-
-
+
+
-
-
+
+
-
-
+
+
@@ -144,16 +153,16 @@ This page is a sample of page using tables. It is designed to make test with
@@ -169,19 +178,39 @@ $sortfield = 'aaa';
$sortorder = 'ASC';
$tasksarray = array(1, 2, 3); // To force having several lines
$tagidfortablednd = 'tablelines3';
-if (!empty($conf->use_javascript_ajax)) include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
+if (!empty($conf->use_javascript_ajax)) {
+ include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
+}
$nav = '';
$nav .= '
';
print $moreforfilter;
$parameters = array();
@@ -249,18 +277,18 @@ if (!empty($moreforfilter))
-->
@@ -299,54 +327,55 @@ $(document).ready(function(){
use_javascript_ajax)) include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
+if (!empty($conf->use_javascript_ajax)) {
+ include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
+}
?>
-
-
Title A
-
title B
-
title C
-
title D
-
-
-
line4
-
dfsdf
-
-
bbbb
-
-
-
line5
-
dfsdf
-
-
bbbb
-
-
-
line6
-
jghjgh
-
5
-
lll
-
+
+
Title A
+
title B
+
title C
+
title D
+
+
+
line4
+
dfsdf
+
+
bbbb
+
+
+
line5
+
dfsdf
+
+
bbbb
+
+
+
line6
+
jghjgh
+
5
+
lll
+
+
line1
+
+
+
+
+
+
line2
+
+
+
+
-->
diff --git a/htdocs/public/test/test_forms.php b/htdocs/public/test/test_forms.php
index 646eeb2abc1..d89e04e12a6 100644
--- a/htdocs/public/test/test_forms.php
+++ b/htdocs/public/test/test_forms.php
@@ -1,7 +1,9 @@
\n";
print 'PHP_SESSION_DISABLED='.PHP_SESSION_DISABLED." \n";
diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php
index 6b035a46643..81c375671b0 100644
--- a/htdocs/public/ticket/create_ticket.php
+++ b/htdocs/public/ticket/create_ticket.php
@@ -22,14 +22,30 @@
* \brief Display public form to add new ticket
*/
-if (!defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1');
-if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1');
-if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1');
-if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1');
-if (!defined('NOLOGIN')) define("NOLOGIN", 1); // This means this output page does not require to be logged.
-if (!defined('NOCSRFCHECK')) define("NOCSRFCHECK", 1); // We accept to go on this page from external web site.
-if (!defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
-if (!defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1');
+if (!defined('NOREQUIREUSER')) {
+ define('NOREQUIREUSER', '1');
+}
+if (!defined('NOTOKENRENEWAL')) {
+ define('NOTOKENRENEWAL', '1');
+}
+if (!defined('NOREQUIREMENU')) {
+ define('NOREQUIREMENU', '1');
+}
+if (!defined('NOREQUIREHTML')) {
+ define('NOREQUIREHTML', '1');
+}
+if (!defined('NOLOGIN')) {
+ define("NOLOGIN", 1); // This means this output page does not require to be logged.
+}
+if (!defined('NOCSRFCHECK')) {
+ define("NOCSRFCHECK", 1); // We accept to go on this page from external web site.
+}
+if (!defined('NOIPCHECK')) {
+ define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
+}
+if (!defined('NOBROWSERNOTIF')) {
+ define('NOBROWSERNOTIF', '1');
+}
require '../../main.inc.php';
diff --git a/htdocs/public/ticket/index.php b/htdocs/public/ticket/index.php
index b3e8a5e237e..81d13832ca4 100644
--- a/htdocs/public/ticket/index.php
+++ b/htdocs/public/ticket/index.php
@@ -22,17 +22,29 @@
* \brief Public page to add and manage ticket
*/
-if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1');
-if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1');
-if (!defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session)
-if (!defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
-if (!defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1');
+if (!defined('NOCSRFCHECK')) {
+ define('NOCSRFCHECK', '1');
+}
+if (!defined('NOREQUIREMENU')) {
+ define('NOREQUIREMENU', '1');
+}
+if (!defined("NOLOGIN")) {
+ define("NOLOGIN", '1'); // If this page is public (can be called outside logged session)
+}
+if (!defined('NOIPCHECK')) {
+ define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
+}
+if (!defined('NOBROWSERNOTIF')) {
+ define('NOBROWSERNOTIF', '1');
+}
// For MultiCompany module.
// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php
// TODO This should be useless. Because entity must be retrieve from object ref and not from url.
$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1));
-if (is_numeric($entity)) define("DOLENTITY", $entity);
+if (is_numeric($entity)) {
+ define("DOLENTITY", $entity);
+}
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/ticket/class/actions_ticket.class.php';
@@ -57,8 +69,7 @@ $action = GETPOST('action', 'aZ09');
$form = new Form($db);
$formticket = new FormTicket($db);
-if (empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE))
-{
+if (empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
print $langs->trans('TicketPublicInterfaceForbidden');
exit;
}
diff --git a/htdocs/public/ticket/list.php b/htdocs/public/ticket/list.php
index 0f9542c986a..befeee00a7b 100644
--- a/htdocs/public/ticket/list.php
+++ b/htdocs/public/ticket/list.php
@@ -32,8 +32,12 @@ if (!defined('NOREQUIREMENU')) {
if (!defined("NOLOGIN")) {
define("NOLOGIN", '1');
}
-if (!defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
-if (!defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1');
+if (!defined('NOIPCHECK')) {
+ define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
+}
+if (!defined('NOBROWSERNOTIF')) {
+ define('NOBROWSERNOTIF', '1');
+}
// If this page is public (can be called outside logged session)
require '../../main.inc.php';
@@ -174,8 +178,7 @@ llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss);
print '
';
-if ($action == "view_ticketlist")
-{
+if ($action == "view_ticketlist") {
print ' ';
if ($display_ticket_list) {
// Filters
@@ -295,7 +298,9 @@ if ($action == "view_ticketlist")
$limit = $conf->liste_limit;
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
- if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
+ if (empty($page) || $page == -1) {
+ $page = 0;
+ } // If $page is not defined, or '' or -1
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
@@ -326,8 +331,9 @@ if ($action == "view_ticketlist")
$sql .= " type.label as type_label, category.label as category_label, severity.label as severity_label";
// Add fields for extrafields
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
- foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val)
+ foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : '');
+ }
}
$sql .= " FROM ".MAIN_DB_PREFIX."ticket as t";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_type as type ON type.code=t.type_code";
@@ -528,8 +534,7 @@ if ($action == "view_ticketlist")
print_liste_field_titre($selectedfields, $url_page_current, "", '', '', 'align="right"', $sortfield, $sortorder, 'center maxwidthsearch ');
print '
';
- while ($obj = $db->fetch_object($resql))
- {
+ while ($obj = $db->fetch_object($resql)) {
print '
';
// Date ticket
diff --git a/htdocs/public/ticket/view.php b/htdocs/public/ticket/view.php
index 02c7c9e51d8..d556ca2935f 100644
--- a/htdocs/public/ticket/view.php
+++ b/htdocs/public/ticket/view.php
@@ -33,8 +33,12 @@ if (!defined('NOREQUIREMENU')) {
if (!defined("NOLOGIN")) {
define("NOLOGIN", '1');
}
-if (!defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
-if (!defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1');
+if (!defined('NOIPCHECK')) {
+ define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
+}
+if (!defined('NOBROWSERNOTIF')) {
+ define('NOBROWSERNOTIF', '1');
+}
// If this page is public (can be called outside logged session)
require '../../main.inc.php';
@@ -69,10 +73,8 @@ $object = new ActionsTicket($db);
* Actions
*/
-if ($cancel)
-{
- if (!empty($backtopage))
- {
+if ($cancel) {
+ if (!empty($backtopage)) {
header("Location: ".$backtopage);
exit;
}
@@ -104,13 +106,11 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
if ($ret && $object->dao->id > 0) {
// Check if emails provided is the one of author
$emailofticket = CMailFile::getValidAddress($object->dao->origin_email, 2);
- if ($emailofticket == $email)
- {
+ if ($emailofticket == $email) {
$display_ticket = true;
$_SESSION['email_customer'] = $email;
- }
- // Check if emails provided is inside list of contacts
- else {
+ } else {
+ // Check if emails provided is inside list of contacts
$contacts = $object->dao->liste_contact(-1, 'external');
foreach ($contacts as $contact) {
if ($contact['email'] == $email) {
@@ -131,8 +131,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
}
}
// Check if email is email of creator
- if ($object->dao->fk_user_create > 0)
- {
+ if ($object->dao->fk_user_create > 0) {
$tmpuser = new User($db);
$tmpuser->fetch($object->dao->fk_user_create);
if ($email == $tmpuser->email) {
@@ -141,8 +140,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
}
}
// Check if email is email of creator
- if ($object->dao->fk_user_assign > 0 && $object->dao->fk_user_assign != $object->dao->fk_user_create)
- {
+ if ($object->dao->fk_user_assign > 0 && $object->dao->fk_user_assign != $object->dao->fk_user_create) {
$tmpuser = new User($db);
$tmpuser->fetch($object->dao->fk_user_assign);
if ($email == $tmpuser->email) {
@@ -157,8 +155,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
}
}
- if (!$error && $action == 'confirm_public_close' && $display_ticket)
- {
+ if (!$error && $action == 'confirm_public_close' && $display_ticket) {
if ($object->dao->close($user)) {
setEventMessages($langs->trans('TicketMarkedAsClosed'), null, 'mesgs');
@@ -171,24 +168,21 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
}
}
- if (!$error && $action == "add_message" && $display_ticket && GETPOSTISSET('btn_add_message'))
- {
+ if (!$error && $action == "add_message" && $display_ticket && GETPOSTISSET('btn_add_message')) {
// TODO Add message...
$ret = $object->dao->newMessage($user, $action, 0, 1);
- if (!$error)
- {
+ if (!$error) {
$action = 'view_ticket';
}
}
if ($error || $errors) {
setEventMessages($object->error, $object->errors, 'errors');
- if ($action == "add_message")
- {
+ if ($action == "add_message") {
$action = 'presend';
} else {
$action = '';
@@ -228,8 +222,7 @@ llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss);
print '
';
if ($action == "view_ticket" || $action == "presend" || $action == "close" || $action == "confirm_public_close") {
- if ($display_ticket)
- {
+ if ($display_ticket) {
// Confirmation close
if ($action == 'close') {
print $form->formconfirm($_SERVER["PHP_SELF"]."?track_id=".$track_id, $langs->trans("CloseATicket"), $langs->trans("ConfirmCloseAticket"), "confirm_public_close", '', '', 1);
diff --git a/htdocs/public/website/index.php b/htdocs/public/website/index.php
index 4edd733b9e6..d72fedefa7e 100644
--- a/htdocs/public/website/index.php
+++ b/htdocs/public/website/index.php
@@ -30,14 +30,30 @@
* \brief Wrapper to output pages when website is powered by Dolibarr instead of a native web server
*/
-if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', 1); // Disables token renewal
-if (!defined('NOLOGIN')) define("NOLOGIN", 1);
-if (!defined('NOCSRFCHECK')) define("NOCSRFCHECK", 1); // We accept to go on this page from external web site.
-if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1');
-if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1');
-if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
-if (!defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
-if (!defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1');
+if (!defined('NOTOKENRENEWAL')) {
+ define('NOTOKENRENEWAL', 1); // Disables token renewal
+}
+if (!defined('NOLOGIN')) {
+ define("NOLOGIN", 1);
+}
+if (!defined('NOCSRFCHECK')) {
+ define("NOCSRFCHECK", 1); // We accept to go on this page from external web site.
+}
+if (!defined('NOREQUIREMENU')) {
+ define('NOREQUIREMENU', '1');
+}
+if (!defined('NOREQUIREHTML')) {
+ define('NOREQUIREHTML', '1');
+}
+if (!defined('NOREQUIREAJAX')) {
+ define('NOREQUIREAJAX', '1');
+}
+if (!defined('NOIPCHECK')) {
+ define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
+}
+if (!defined('NOBROWSERNOTIF')) {
+ define('NOBROWSERNOTIF', '1');
+}
/**
* Header empty
@@ -69,18 +85,15 @@ $accessallowed = 1;
$type = '';
-if (empty($pageid))
-{
+if (empty($pageid)) {
require_once DOL_DOCUMENT_ROOT.'/website/class/website.class.php';
require_once DOL_DOCUMENT_ROOT.'/website/class/websitepage.class.php';
$object = new Website($db);
$object->fetch(0, $websitekey);
- if (empty($object->id))
- {
- if (empty($pageid))
- {
+ if (empty($object->id)) {
+ if (empty($pageid)) {
// Return header 404
header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found", true, 404);
@@ -91,57 +104,52 @@ if (empty($pageid))
$objectpage = new WebsitePage($db);
- if ($pageref)
- {
+ if ($pageref) {
$result = $objectpage->fetch(0, $object->id, $pageref);
- if ($result > 0)
- {
+ if ($result > 0) {
$pageid = $objectpage->id;
- } elseif ($result == 0)
- {
+ } elseif ($result == 0) {
// Page not found from ref=pageurl, we try using alternative alias
$result = $objectpage->fetch(0, $object->id, null, $pageref);
- if ($result > 0)
- {
+ if ($result > 0) {
$pageid = $objectpage->id;
}
}
} else {
- if ($object->fk_default_home > 0)
- {
+ if ($object->fk_default_home > 0) {
$result = $objectpage->fetch($object->fk_default_home);
- if ($result > 0)
- {
+ if ($result > 0) {
$pageid = $objectpage->id;
}
}
- if (empty($pageid))
- {
+ if (empty($pageid)) {
$array = $objectpage->fetchAll($object->id); // TODO Can filter on container of type pages only ?
- if (is_array($array) && count($array) > 0)
- {
+ if (is_array($array) && count($array) > 0) {
$firstrep = reset($array);
$pageid = $firstrep->id;
}
}
}
}
-if (empty($pageid))
-{
+if (empty($pageid)) {
// Return header 404
header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found", true, 404);
$langs->load("website");
- if (!GETPOSTISSET('pageref')) print $langs->trans("PreviewOfSiteNotYetAvailable", $websitekey);
+ if (!GETPOSTISSET('pageref')) {
+ print $langs->trans("PreviewOfSiteNotYetAvailable", $websitekey);
+ }
include DOL_DOCUMENT_ROOT.'/public/error-404.php';
exit;
}
$appli = constant('DOL_APPLICATION_TITLE');
-if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $appli = $conf->global->MAIN_APPLICATION_TITLE;
+if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
+ $appli = $conf->global->MAIN_APPLICATION_TITLE;
+}
@@ -155,8 +163,7 @@ if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $appli = $conf->global->MAIN_
// Security: Delete string ../ into $original_file
global $dolibarr_main_data_root;
-if ($pageid == 'css') // No more used ?
-{
+if ($pageid == 'css') { // No more used ?
header('Content-type: text/css');
// Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access.
//if (empty($dolibarr_nocache)) header('Cache-Control: max-age=3600, public, must-revalidate');
@@ -172,16 +179,14 @@ $refname = basename(dirname($original_file)."/");
// Security:
// Limite acces si droits non corrects
-if (!$accessallowed)
-{
+if (!$accessallowed) {
accessforbidden();
}
// Security:
// On interdit les remontees de repertoire ainsi que les pipe dans
// les noms de fichiers.
-if (preg_match('/\.\./', $original_file) || preg_match('/[<>|]/', $original_file))
-{
+if (preg_match('/\.\./', $original_file) || preg_match('/[<>|]/', $original_file)) {
dol_syslog("Refused to deliver file ".$original_file);
$file = basename($original_file); // Do no show plain path of original_file in shown error message
dol_print_error(0, $langs->trans("ErrorFileNameInvalid", $file));
@@ -197,8 +202,7 @@ dol_syslog("index.php include $original_file $filename content-type=$type");
$original_file_osencoded = dol_osencode($original_file); // New file name encoded in OS encoding charset
// This test if file exists should be useless. We keep it to find bug more easily
-if (!file_exists($original_file_osencoded))
-{
+if (!file_exists($original_file_osencoded)) {
// Return header 404
header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found", true, 404);
@@ -215,4 +219,6 @@ define('USEDOLIBARRSERVER', 1);
print ''."\n";
include_once $original_file_osencoded; // Note: The pageXXX.tpl.php showed here contains a formatage with dolWebsiteOutput() at end of page.
-if (is_object($db)) $db->close();
+if (is_object($db)) {
+ $db->close();
+}
diff --git a/htdocs/public/website/styles.css.php b/htdocs/public/website/styles.css.php
index 75257a8facc..a0002b5380b 100644
--- a/htdocs/public/website/styles.css.php
+++ b/htdocs/public/website/styles.css.php
@@ -21,14 +21,30 @@
* \brief Page to output style page. Called with
*/
-if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', 1); // Disables token renewal
-if (!defined('NOLOGIN')) define("NOLOGIN", 1);
-if (!defined('NOCSRFCHECK')) define("NOCSRFCHECK", 1); // We accept to go on this page from external web site.
-if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1');
-if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1');
-if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
-if (!defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
-if (!defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1');
+if (!defined('NOTOKENRENEWAL')) {
+ define('NOTOKENRENEWAL', 1); // Disables token renewal
+}
+if (!defined('NOLOGIN')) {
+ define("NOLOGIN", 1);
+}
+if (!defined('NOCSRFCHECK')) {
+ define("NOCSRFCHECK", 1); // We accept to go on this page from external web site.
+}
+if (!defined('NOREQUIREMENU')) {
+ define('NOREQUIREMENU', '1');
+}
+if (!defined('NOREQUIREHTML')) {
+ define('NOREQUIREHTML', '1');
+}
+if (!defined('NOREQUIREAJAX')) {
+ define('NOREQUIREAJAX', '1');
+}
+if (!defined('NOIPCHECK')) {
+ define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
+}
+if (!defined('NOBROWSERNOTIF')) {
+ define('NOBROWSERNOTIF', '1');
+}
/**
* Header empty
@@ -65,18 +81,18 @@ $type = '';
*/
$appli = constant('DOL_APPLICATION_TITLE');
-if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $appli = $conf->global->MAIN_APPLICATION_TITLE;
+if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
+ $appli = $conf->global->MAIN_APPLICATION_TITLE;
+}
//print 'Directory with '.$appli.' websites. ';
-if (empty($pageid))
-{
+if (empty($pageid)) {
require_once DOL_DOCUMENT_ROOT.'/website/class/website.class.php';
require_once DOL_DOCUMENT_ROOT.'/website/class/websitepage.class.php';
$object = new Website($db);
- if ($websiteid)
- {
+ if ($websiteid) {
$object->fetch($websiteid);
$website = $object->ref;
} else {
@@ -85,21 +101,21 @@ if (empty($pageid))
$objectpage = new WebsitePage($db);
/* Not required for CSS file
- $array=$objectpage->fetchAll($object->id);
+ $array=$objectpage->fetchAll($object->id);
- if (is_array($array) && count($array) > 0)
- {
- $firstrep=reset($array);
- $pageid=$firstrep->id;
- }
- */
+ if (is_array($array) && count($array) > 0)
+ {
+ $firstrep=reset($array);
+ $pageid=$firstrep->id;
+ }
+ */
}
/* Not required for CSS file
if (empty($pageid))
{
- $langs->load("website");
- print $langs->trans("PreviewOfSiteNotYetAvailable");
- exit;
+ $langs->load("website");
+ print $langs->trans("PreviewOfSiteNotYetAvailable");
+ exit;
}
*/
@@ -113,16 +129,14 @@ $refname = basename(dirname($original_file)."/");
// Security:
// Limite acces si droits non corrects
-if (!$accessallowed)
-{
+if (!$accessallowed) {
accessforbidden();
}
// Security:
// On interdit les remontees de repertoire ainsi que les pipe dans
// les noms de fichiers.
-if (preg_match('/\.\./', $original_file) || preg_match('/[<>|]/', $original_file))
-{
+if (preg_match('/\.\./', $original_file) || preg_match('/[<>|]/', $original_file)) {
dol_syslog("Refused to deliver file ".$original_file);
$file = basename($original_file); // Do no show plain path of original_file in shown error message
dol_print_error(0, $langs->trans("ErrorFileNameInvalid", $file));
@@ -138,8 +152,7 @@ dol_syslog("styles.css.php include $original_file $filename content-type=$type")
$original_file_osencoded = dol_osencode($original_file); // New file name encoded in OS encoding charset
// This test if file exists should be useless. We keep it to find bug more easily
-if (!file_exists($original_file_osencoded))
-{
+if (!file_exists($original_file_osencoded)) {
$langs->load("website");
print $langs->trans("RequestedPageHasNoContentYet", $pageid);
//dol_print_error(0,$langs->trans("ErrorFileDoesNotExists",$original_file));
@@ -153,4 +166,6 @@ print '/* Page content '.$original_file.' : CSS content that was saved into tpl
require_once $original_file_osencoded;
-if (is_object($db)) $db->close();
+if (is_object($db)) {
+ $db->close();
+}
diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php
index b4be34aaf7e..661c14c9d01 100644
--- a/htdocs/reception/list.php
+++ b/htdocs/reception/list.php
@@ -127,6 +127,8 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
$object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position');
+$error = 0;
+
/*
* Actions
@@ -527,6 +529,7 @@ if (!$resql) {
dol_print_error($db);
exit;
}
+
$num = $db->num_rows($resql);
$reception = new Reception($db);
@@ -577,9 +580,9 @@ if ($search_type_thirdparty) {
$param .= "&search_type_thirdparty=".urlencode($search_type_thirdparty);
}
if ($search_ref_supplier) {
- $param .= "&search_ref_supplier=".urlencode($search_ref_supplier);
+ $param .= "&search_ref_supplier=".urlencode($search_ref_supplier);
}
- // Add $param from extra fields
+// Add $param from extra fields
foreach ($search_array_options as $key => $val) {
$crit = $val;
$tmpkey = preg_replace('/search_options_/', '', $key);
@@ -590,7 +593,7 @@ foreach ($search_array_options as $key => $val) {
$arrayofmassactions = array(
-// 'presend'=>$langs->trans("SendByMail"),
+ // 'presend'=>$langs->trans("SendByMail"),
);
if ($user->rights->fournisseur->facture->creer) {
@@ -615,7 +618,6 @@ print '';
print_barre_liste($langs->trans('ListOfReceptions'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'dollyrevert', 0, '', '', $limit, 0, 0, 1);
-
if ($massaction == 'createbills') {
//var_dump($_REQUEST);
print '';
@@ -1009,7 +1011,8 @@ while ($i < min($num, $limit)) {
// Action column
print '
';
- if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
+ if ($massactionbutton || $massaction) {
+ // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
$selected = 0;
if (in_array($obj->rowid, $arrayofselected)) {
$selected = 1;
@@ -1026,6 +1029,17 @@ while ($i < min($num, $limit)) {
$i++;
}
+// If no record found
+if ($num == 0) {
+ $colspan = 1;
+ foreach ($arrayfields as $key => $val) {
+ if (!empty($val['checked'])) {
+ $colspan++;
+ }
+ }
+ print '
'.$langs->trans("NoRecordFound").'
';
+}
+
print "
";
print "";
print '';
diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php
index 5a7de9d9450..8b54144cbff 100644
--- a/htdocs/societe/card.php
+++ b/htdocs/societe/card.php
@@ -1339,7 +1339,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
if (!empty($conf->barcode->enabled))
{
print '