diff --git a/htdocs/adherents/cotisations.php b/htdocs/adherents/cotisations.php
index dfba0935953..12f9d09ff38 100644
--- a/htdocs/adherents/cotisations.php
+++ b/htdocs/adherents/cotisations.php
@@ -46,8 +46,8 @@ if (! $sortfield) { $sortfield="c.dateadh"; }
$msg='';
$date_select=isset($_GET["date_select"])?$_GET["date_select"]:$_POST["date_select"];
-// Security check
-$result=restrictedArea($user,'adherent','','','cotisation');
+// Security check
+$result=restrictedArea($user,'adherent','','','cotisation');
/*
diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php
index af2676a7d31..36517958a10 100644
--- a/htdocs/adherents/index.php
+++ b/htdocs/adherents/index.php
@@ -31,8 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
$langs->load("companies");
$langs->load("members");
-// Security check
-$result=restrictedArea($user,'adherent');
+// Security check
+$result=restrictedArea($user,'adherent');
/*
diff --git a/htdocs/adherents/liste.php b/htdocs/adherents/liste.php
index 5e26c9e35ab..836d79bfdb2 100644
--- a/htdocs/adherents/liste.php
+++ b/htdocs/adherents/liste.php
@@ -31,8 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
$langs->load("members");
$langs->load("companies");
-// Security check
-$result=restrictedArea($user,'adherent');
+// Security check
+$result=restrictedArea($user,'adherent');
$action=GETPOST("action");
$filter=GETPOST("filter");
diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php
index d78ab4fe61f..938b348e208 100755
--- a/htdocs/adherents/stats/geo.php
+++ b/htdocs/adherents/stats/geo.php
@@ -37,7 +37,7 @@ if ($user->societe_id > 0)
$action = '';
$socid = $user->societe_id;
}
-$result=restrictedArea($user,'adherent','','','cotisation');
+$result=restrictedArea($user,'adherent','','','cotisation');
$year = strftime("%Y", time());
$startyear=$year-2;
diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php
index dd96c83e797..3f89f74294d 100644
--- a/htdocs/admin/modules.php
+++ b/htdocs/admin/modules.php
@@ -206,7 +206,7 @@ if ($mode==='expdev') print $langs->trans("ModuleFamilyExperimental")."
$nbofactivatedmodules=count($conf->modules);
print $langs->trans("TotalNumberOfActivatedModules",($nbofactivatedmodules-1));
if ($nbofactivatedmodules <= 1) print ' '.img_warning($langs->trans("YouMustEnableOneModule"));
-print ' '."\n";
+print ' '."\n";
$h = 0;
@@ -265,9 +265,9 @@ $head[$h][2] = 'marketplace';
$h++;
-// Show warning about external users
-print showModulesExludedForExternal($modules).' '."\n";
-print " \n";
+// Show warning about external users
+print showModulesExludedForExternal($modules).' '."\n";
+print " \n";
dol_fiche_head($head, $mode, $langs->trans("Modules"));
diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php
index 06aa68f8caf..3ee7b9a9ed8 100755
--- a/htdocs/admin/pdf.php
+++ b/htdocs/admin/pdf.php
@@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
-require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
$langs->load("admin");
$langs->load("languages");
@@ -398,40 +398,40 @@ else // Show
print '';
- /*
- * Library
- */
- print ' ';
- print_titre($langs->trans("Library"));
-
- print '
'."\n";
+ /*
+ * Library
+ */
+ print ' ';
+ print_titre($langs->trans("Library"));
- print ''."\n";
- print ''.$langs->trans("Name").' '."\n";
- print ''.$langs->trans("Value").' '."\n";
- print " \n";
+ print ''."\n";
+
+ print ''."\n";
+ print ''.$langs->trans("Name").' '."\n";
+ print ''.$langs->trans("Value").' '."\n";
+ print " \n";
$var=false;
if (! empty($dolibarr_pdf_force_fpdf))
{
- $var=!$var;
- print ''."\n";
- print 'dolibarr_pdf_force_fpdf '."\n";
- print '';
+ $var=!$var;
+ print ' '."\n";
+ print 'dolibarr_pdf_force_fpdf '."\n";
+ print '';
print $dolibarr_pdf_force_fpdf;
print ' ';
print ' ';
}
$var=!$var;
- print ''."\n";
- print ''.$langs->trans("LibraryToBuildPDF").' '."\n";
+ print ' '."\n";
+ print ''.$langs->trans("LibraryToBuildPDF").' '."\n";
print '';
$i=0;
$pdf=pdf_getInstance('A4');
- if (class_exists('FPDF') && ! class_exists('TCPDF'))
+ if (class_exists('FPDF') && ! class_exists('TCPDF'))
{
- if ($i) print ' + ';
+ if ($i) print ' + ';
print 'FPDF';
print ' ('.@constant('FPDF_PATH').')';
$i++;
@@ -451,8 +451,8 @@ else // Show
$i++;
}
print '';
- print ' '."\n";
- print ' '."\n";
+ print ''."\n";
+ print ''."\n";
print "
\n";
diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php
index 28627537977..3ccb81b2f19 100644
--- a/htdocs/admin/perms.php
+++ b/htdocs/admin/perms.php
@@ -69,7 +69,7 @@ print_fiche_titre($langs->trans("SecuritySetup"),'','setup');
print $langs->trans("DefaultRightsDesc");
print " ".$langs->trans("OnlyActiveElementsAreShown")." \n";
-// Show warning about external users
+// Show warning about external users
print showModulesExludedForExternal($modules).' '."\n";
print " \n";
diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php
index 2ec2e5c3253..0d66d0d74ab 100644
--- a/htdocs/comm/action/class/actioncomm.class.php
+++ b/htdocs/comm/action/class/actioncomm.class.php
@@ -247,8 +247,8 @@ class ActionComm extends CommonObject
}
else
{
- $this->db->rollback();
- return -1;
+ $this->db->rollback();
+ return -1;
}
}
else
@@ -599,16 +599,16 @@ class ActionComm extends CommonObject
$this->nbtodo=$this->nbtodolate=0;
- $sql = "SELECT a.id, a.datep as dp";
- $sql.= " FROM (".MAIN_DB_PREFIX."actioncomm as a";
- $sql.= ")";
- if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
- $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid";
- $sql.= " WHERE a.percent >= 0 AND a.percent < 100";
- $sql.= " AND a.entity = ".$conf->entity;
- if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")";
- if ($user->societe_id) $sql.=" AND a.fk_soc = ".$user->societe_id;
- if (! $user->rights->agenda->allactions->read) $sql.= " AND (a.fk_user_author = ".$user->id . " OR a.fk_user_action = ".$user->id . " OR a.fk_user_done = ".$user->id . ")";
+ $sql = "SELECT a.id, a.datep as dp";
+ $sql.= " FROM (".MAIN_DB_PREFIX."actioncomm as a";
+ $sql.= ")";
+ if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
+ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid";
+ $sql.= " WHERE a.percent >= 0 AND a.percent < 100";
+ $sql.= " AND a.entity = ".$conf->entity;
+ if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")";
+ if ($user->societe_id) $sql.=" AND a.fk_soc = ".$user->societe_id;
+ if (! $user->rights->agenda->allactions->read) $sql.= " AND (a.fk_user_author = ".$user->id . " OR a.fk_user_action = ".$user->id . " OR a.fk_user_done = ".$user->id . ")";
$resql=$this->db->query($sql);
if ($resql)
diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php
index b0c01cdd9f4..1a480fa56d8 100644
--- a/htdocs/comm/action/fiche.php
+++ b/htdocs/comm/action/fiche.php
@@ -961,8 +961,8 @@ if ($id > 0)
print '
';
// Third party - Contact
- if ($conf->societe->enabled)
- {
+ if ($conf->societe->enabled)
+ {
print ''.$langs->trans("ActionOnCompany").' '.($act->societe->id?$act->societe->getNomUrl(1):$langs->trans("None"));
if ($act->societe->id && $act->type_code == 'AC_TEL')
{
diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php
index eaa6c3559ca..cb30b1522c4 100644
--- a/htdocs/comm/action/index.php
+++ b/htdocs/comm/action/index.php
@@ -304,16 +304,16 @@ $sql.= ' a.fk_user_author,a.fk_user_action,a.fk_user_done,';
$sql.= ' a.priority, a.fulldayevent, a.location,';
$sql.= ' a.fk_soc, a.fk_contact,';
$sql.= ' ca.code';
-$sql.= ' FROM ('.MAIN_DB_PREFIX.'c_actioncomm as ca,';
-$sql.= " ".MAIN_DB_PREFIX.'user as u,';
-$sql.= " ".MAIN_DB_PREFIX."actioncomm as a)";
-if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
-$sql.= ' WHERE a.fk_action = ca.id';
-$sql.= ' AND a.fk_user_author = u.rowid';
-$sql.= ' AND a.entity IN ('.getEntity().')';
-if ($actioncode) $sql.=" AND ca.code='".$db->escape($actioncode)."'";
-if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid);
-if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")";
+$sql.= ' FROM ('.MAIN_DB_PREFIX.'c_actioncomm as ca,';
+$sql.= " ".MAIN_DB_PREFIX.'user as u,';
+$sql.= " ".MAIN_DB_PREFIX."actioncomm as a)";
+if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
+$sql.= ' WHERE a.fk_action = ca.id';
+$sql.= ' AND a.fk_user_author = u.rowid';
+$sql.= ' AND a.entity IN ('.getEntity().')';
+if ($actioncode) $sql.=" AND ca.code='".$db->escape($actioncode)."'";
+if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid);
+if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")";
if ($user->societe_id) $sql.= ' AND a.fk_soc = '.$user->societe_id; // To limit to external user company
if ($action == 'show_day')
{
diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php
index f08e819a3e3..34eeb239c6e 100644
--- a/htdocs/comm/action/listactions.php
+++ b/htdocs/comm/action/listactions.php
@@ -152,22 +152,22 @@ $sql.= " ua.login as loginauthor, ua.rowid as useridauthor,";
$sql.= " ut.login as logintodo, ut.rowid as useridtodo,";
$sql.= " ud.login as logindone, ud.rowid as useriddone,";
$sql.= " sp.name, sp.firstname";
-$sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm as c,";
-$sql.= " ".MAIN_DB_PREFIX.'user as u,';
-$sql.= " ".MAIN_DB_PREFIX."actioncomm as a)";
-if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
-$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid";
-$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
-$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as ua ON a.fk_user_author = ua.rowid";
-$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as ut ON a.fk_user_action = ut.rowid";
-$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as ud ON a.fk_user_done = ud.rowid";
-$sql.= " WHERE c.id = a.fk_action";
-$sql.= ' AND a.fk_user_author = u.rowid';
-$sql.= ' AND a.entity IN ('.getEntity().')'; // To limit to entity
-if ($actioncode) $sql.=" AND c.code='".$db->escape($actioncode)."'";
-if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid);
-if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")";
-if ($socid) $sql.= " AND s.rowid = ".$socid;
+$sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm as c,";
+$sql.= " ".MAIN_DB_PREFIX.'user as u,';
+$sql.= " ".MAIN_DB_PREFIX."actioncomm as a)";
+if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
+$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid";
+$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
+$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as ua ON a.fk_user_author = ua.rowid";
+$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as ut ON a.fk_user_action = ut.rowid";
+$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as ud ON a.fk_user_done = ud.rowid";
+$sql.= " WHERE c.id = a.fk_action";
+$sql.= ' AND a.fk_user_author = u.rowid';
+$sql.= ' AND a.entity IN ('.getEntity().')'; // To limit to entity
+if ($actioncode) $sql.=" AND c.code='".$db->escape($actioncode)."'";
+if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid);
+if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")";
+if ($socid) $sql.= " AND s.rowid = ".$socid;
if ($type) $sql.= " AND c.id = ".$type;
if ($status == 'done') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; }
if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; }
diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php
index 35896917b86..20f26cb0a7f 100644
--- a/htdocs/comm/mailing/index.php
+++ b/htdocs/comm/mailing/index.php
@@ -31,8 +31,8 @@ $langs->load("commercial");
$langs->load("orders");
-// Security check
-$result=restrictedArea($user,'mailing');
+// Security check
+$result=restrictedArea($user,'mailing');
/*
diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php
index a1e9acf3607..b696106280a 100644
--- a/htdocs/commande/fiche.php
+++ b/htdocs/commande/fiche.php
@@ -1404,7 +1404,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
$remise_absolue = (!empty($objectsrc->remise_absolue)?$objectsrc->remise_absolue:(!empty($soc->remise_absolue)?$soc->remise_absolue:0));
$dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0;
- $datedelivery = (!empty($objectsrc->date_livraison)?$objectsrc->date_livraison:'');
+ $datedelivery = (!empty($objectsrc->date_livraison)?$objectsrc->date_livraison:'');
$note_private = (! empty($objectsrc->note) ? $objectsrc->note : (! empty($objectsrc->note_private) ? $objectsrc->note_private : ''));
$note_public = (! empty($objectsrc->note_public) ? $objectsrc->note_public : '');
diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php
index f8183d76bee..6ea714805bf 100644
--- a/htdocs/compta/facture/fiche-rec.php
+++ b/htdocs/compta/facture/fiche-rec.php
@@ -390,12 +390,12 @@ else
print " ";
// Payment mode
- print ''.$langs->trans("PaymentMode").' ';
- $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id,'none');
- print " ";
+ print ''.$langs->trans("PaymentMode").' ';
+ $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id,'none');
+ print " ";
print ''.$langs->trans("Note").' '.nl2br($object->note)." ";
-
+
print "
";
print '';
diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php
index b2f3ae3816e..d74d37e307f 100644
--- a/htdocs/compta/facture/impayees.php
+++ b/htdocs/compta/facture/impayees.php
@@ -130,18 +130,18 @@ if ($action == "builddoc" && $user->rights->facture->lire)
}
// Remove file
-if ($action == 'remove_file')
-{
- require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
-
- $langs->load("other");
- $upload_dir = $diroutputpdf;
+if ($action == 'remove_file')
+{
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
+
+ $langs->load("other");
+ $upload_dir = $diroutputpdf;
$file = $upload_dir . '/' . GETPOST('file');
- $ret=dol_delete_file($file,0,0,0,'');
- if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
- else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
- $action='';
-}
+ $ret=dol_delete_file($file,0,0,0,'');
+ if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
+ else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
+ $action='';
+}
diff --git a/htdocs/compta/journal/sellsjournal.php b/htdocs/compta/journal/sellsjournal.php
index df18c41a697..c571235c8e5 100755
--- a/htdocs/compta/journal/sellsjournal.php
+++ b/htdocs/compta/journal/sellsjournal.php
@@ -42,10 +42,10 @@ $date_endmonth=GETPOST('date_endmonth');
$date_endday=GETPOST('date_endday');
$date_endyear=GETPOST('date_endyear');
-// Security check
-if ($user->societe_id > 0) $socid = $user->societe_id;
-if (! empty($conf->comptabilite->enabled)) $result=restrictedArea($user,'compta','','','resultat');
-if (! empty($conf->accounting->enabled)) $result=restrictedArea($user,'accounting','','','comptarapport');
+// Security check
+if ($user->societe_id > 0) $socid = $user->societe_id;
+if (! empty($conf->comptabilite->enabled)) $result=restrictedArea($user,'compta','','','resultat');
+if (! empty($conf->accounting->enabled)) $result=restrictedArea($user,'accounting','','','comptarapport');
/*
* Actions
diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php
index 4a100fe00dc..5e74b74b684 100644
--- a/htdocs/compta/resultat/index.php
+++ b/htdocs/compta/resultat/index.php
@@ -40,8 +40,8 @@ else {
// Security check
$socid = GETPOST('socid','int');
if ($user->societe_id > 0) $socid = $user->societe_id;
-if (! empty($conf->comptabilite->enabled)) $result=restrictedArea($user,'compta','','','resultat');
-if (! empty($conf->accounting->enabled)) $result=restrictedArea($user,'accounting','','','comptarapport');
+if (! empty($conf->comptabilite->enabled)) $result=restrictedArea($user,'compta','','','resultat');
+if (! empty($conf->accounting->enabled)) $result=restrictedArea($user,'accounting','','','comptarapport');
// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES')
diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php
index 699465c5c60..196b485647c 100644
--- a/htdocs/compta/stats/index.php
+++ b/htdocs/compta/stats/index.php
@@ -36,10 +36,10 @@ else {
$year_end=$year_start + ($nbofyear-1);
}
$userid=GETPOST('userid','int');
-$socid = GETPOST('socid','int');
-// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES')
-$modecompta = $conf->global->COMPTA_MODE;
-if ($_GET["modecompta"]) $modecompta=$_GET["modecompta"];
+$socid = GETPOST('socid','int');
+// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES')
+$modecompta = $conf->global->COMPTA_MODE;
+if ($_GET["modecompta"]) $modecompta=$_GET["modecompta"];
// Security check
if ($user->societe_id > 0) $socid = $user->societe_id;
diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php
index 9f9739dbc8f..1a0709a6962 100644
--- a/htdocs/core/boxes/box_actions.php
+++ b/htdocs/core/boxes/box_actions.php
@@ -75,16 +75,16 @@ class box_actions extends ModeleBoxes
$sql = "SELECT a.id, a.label, a.datep as dp, a.percent as percentage,";
$sql.= " ta.code,";
$sql.= " s.nom, s.rowid as socid";
- $sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm AS ta, ";
- $sql.= MAIN_DB_PREFIX."actioncomm AS a)";
- if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
- $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid";
- $sql.= " WHERE a.fk_action = ta.id";
- $sql.= " AND a.entity = ".$conf->entity;
- $sql.= " AND a.percent >= 0 AND a.percent < 100";
- if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")";
- if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
- if (! $user->rights->agenda->allactions->read) $sql.= " AND (a.fk_user_author = ".$user->id . " OR a.fk_user_action = ".$user->id . " OR a.fk_user_done = ".$user->id . ")";
+ $sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm AS ta, ";
+ $sql.= MAIN_DB_PREFIX."actioncomm AS a)";
+ if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
+ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid";
+ $sql.= " WHERE a.fk_action = ta.id";
+ $sql.= " AND a.entity = ".$conf->entity;
+ $sql.= " AND a.percent >= 0 AND a.percent < 100";
+ if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")";
+ if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
+ if (! $user->rights->agenda->allactions->read) $sql.= " AND (a.fk_user_author = ".$user->id . " OR a.fk_user_action = ".$user->id . " OR a.fk_user_done = ".$user->id . ")";
$sql.= " ORDER BY a.datec DESC";
$sql.= $db->plimit($max, 0);
diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php
index 0735f298761..7839f4c30aa 100644
--- a/htdocs/core/boxes/box_activity.php
+++ b/htdocs/core/boxes/box_activity.php
@@ -79,9 +79,9 @@ class box_activity extends ModeleBoxes
$textHead = $langs->trans("Activity").' ('.$nbofyears.' '.$langs->trans("years").')';
$this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead));
- // compute the year limit to show
- $tmpdate= dol_time_plus_duree(time(), -1*$nbofyears, "y");
-
+ // compute the year limit to show
+ $tmpdate= dol_time_plus_duree(time(), -1*$nbofyears, "y");
+
// list the summary of the bills
if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
{
@@ -128,7 +128,7 @@ class box_activity extends ModeleBoxes
}
if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedInvoices"));
}
- else dol_print_error($db);
+ else dol_print_error($db);
$sql = "SELECT f.paye, f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 02691a2b2de..d83208c5c1b 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -1525,20 +1525,20 @@ abstract class CommonObject
if ($this->total_localtax1 == 0)
{
// Search to know if there is a localtax of type 7
- // TODO : store local taxes types into object lines and remove this. We should use here $obj->localtax1_type but it is not yet filled into database, so we search into table of vat rate
+ // TODO : store local taxes types into object lines and remove this. We should use here $obj->localtax1_type but it is not yet filled into database, so we search into table of vat rate
global $mysoc;
- $localtax1_array=getLocalTaxesFromRate($vatrate,1,$mysoc);
+ $localtax1_array=getLocalTaxesFromRate($vatrate,1,$mysoc);
if (empty($obj->localtax1_type))
{
$obj->localtax1_type = $localtax1_array[0];
$obj->localtax1_tx = $localtax1_array[1];
- }
+ }
//end TODO
if ($obj->localtax1_type == '7')
{
- $this->total_localtax1 += $obj->localtax1_tx;
- $this->total_ttc += $obj->localtax1_tx;
+ $this->total_localtax1 += $obj->localtax1_tx;
+ $this->total_ttc += $obj->localtax1_tx;
}
}
if ($this->total_localtax2 == 0)
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 76868d7dad0..8918731ea0e 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -2724,36 +2724,36 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="")
return 0;
}
-/**
- * Get type and rate of localtaxes for a particular vat rate/country fo thirdparty
- *
- * @param real $vatrate VAT Rate
- * @param int $local Number of localtax (1 / 2)
- * @param int $thirdparty company object
+/**
+ * Get type and rate of localtaxes for a particular vat rate/country fo thirdparty
+ *
+ * @param real $vatrate VAT Rate
+ * @param int $local Number of localtax (1 / 2)
+ * @param int $thirdparty company object
* @return array array(Type of local tax (1 to 7 / 0 if not found), rate or amount of localtax)
- * @deprecated TODO We should remove this function by storing rate and type into detail lines.
- */
-function getLocalTaxesFromRate($vatrate, $local, $thirdparty)
-{
- global $db;
+ * @deprecated TODO We should remove this function by storing rate and type into detail lines.
+ */
+function getLocalTaxesFromRate($vatrate, $local, $thirdparty)
+{
+ global $db;
- dol_syslog("getLocalTaxesFromRate vatrate=".$vatrate." local=".$local." thirdparty id=".(is_object($thirdparty)?$thirdparty->id:''));
-
- // Search local taxes
- $sql = "SELECT t.localtax1, t.localtax1_type, t.localtax2, t.localtax2_type";
- $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p";
- $sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$thirdparty->country_code."'";
- $sql .= " AND t.taux = ".$vatrate." AND t.active = 1";
-
- $resql=$db->query($sql);
- if ($resql)
- {
- $obj = $db->fetch_object($resql);
- if ($local == 1) return array($obj->localtax1_type, $obj->localtax1);
- elseif ($local == 2) return array($obj->localtax2_type, $obj->localtax2);
- }
-
- return 0;
+ dol_syslog("getLocalTaxesFromRate vatrate=".$vatrate." local=".$local." thirdparty id=".(is_object($thirdparty)?$thirdparty->id:''));
+
+ // Search local taxes
+ $sql = "SELECT t.localtax1, t.localtax1_type, t.localtax2, t.localtax2_type";
+ $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p";
+ $sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$thirdparty->country_code."'";
+ $sql .= " AND t.taux = ".$vatrate." AND t.active = 1";
+
+ $resql=$db->query($sql);
+ if ($resql)
+ {
+ $obj = $db->fetch_object($resql);
+ if ($local == 1) return array($obj->localtax1_type, $obj->localtax1);
+ elseif ($local == 2) return array($obj->localtax2_type, $obj->localtax2);
+ }
+
+ return 0;
}
/**
diff --git a/htdocs/core/lib/json.lib.php b/htdocs/core/lib/json.lib.php
index c518e550cd8..61c0cfea96e 100644
--- a/htdocs/core/lib/json.lib.php
+++ b/htdocs/core/lib/json.lib.php
@@ -49,7 +49,7 @@ function dol_json_encode($elements)
if (is_object($elements)) // Count number of properties for an object
{
$num=0;
- foreach($elements as $key => $value) $num++;
+ foreach($elements as $key => $value) $num++;
}
//var_dump($num);
diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php
index b72e6f8e16c..172525833e5 100644
--- a/htdocs/core/lib/security2.lib.php
+++ b/htdocs/core/lib/security2.lib.php
@@ -160,42 +160,42 @@ function dol_loginfunction($langs,$conf,$mysoc)
// Note: $conf->css looks like '/theme/eldy/style.css.php'
$conf->css = "/theme/".(GETPOST('theme')?GETPOST('theme','alpha'):$conf->theme)."/style.css.php";
- $themepath=dol_buildpath((empty($conf->global->MAIN_FORCETHEMEDIR)?'':$conf->global->MAIN_FORCETHEMEDIR).$conf->css,1);
- if (! empty($conf->modules_parts['theme'])) // Using this feature slow down application
- {
- foreach($conf->modules_parts['theme'] as $reldir)
- {
- if (file_exists(dol_buildpath($reldir.$conf->css, 0)))
- {
- $themepath=dol_buildpath($reldir.$conf->css, 1);
- break;
- }
- }
+ $themepath=dol_buildpath((empty($conf->global->MAIN_FORCETHEMEDIR)?'':$conf->global->MAIN_FORCETHEMEDIR).$conf->css,1);
+ if (! empty($conf->modules_parts['theme'])) // Using this feature slow down application
+ {
+ foreach($conf->modules_parts['theme'] as $reldir)
+ {
+ if (file_exists(dol_buildpath($reldir.$conf->css, 0)))
+ {
+ $themepath=dol_buildpath($reldir.$conf->css, 1);
+ break;
+ }
+ }
}
$conf_css = $themepath."?lang=".$langs->defaultlang;
- // Select templates
- if (! empty($conf->browser->phone) && preg_match('/^smartphone/',$conf->smart_menu))
- {
- $template_dir = DOL_DOCUMENT_ROOT.'/theme/phones/smartphone/tpl/';
- }
- else
+ // Select templates
+ if (! empty($conf->browser->phone) && preg_match('/^smartphone/',$conf->smart_menu))
+ {
+ $template_dir = DOL_DOCUMENT_ROOT.'/theme/phones/smartphone/tpl/';
+ }
+ else
{
if (! empty($conf->modules_parts['tpl'])) // Using this feature slow down application
- {
- $dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl/'));
- foreach($dirtpls as $reldir)
+ {
+ $dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl/'));
+ foreach($dirtpls as $reldir)
{
$tmp=dol_buildpath($reldir.'login.tpl.php');
- if (file_exists($tmp)) { $template_dir=preg_replace('/login\.tpl\.php$/','',$tmp); break; }
- }
- }
- else
- {
- $template_dir = DOL_DOCUMENT_ROOT."/core/tpl/";
- }
- }
-
+ if (file_exists($tmp)) { $template_dir=preg_replace('/login\.tpl\.php$/','',$tmp); break; }
+ }
+ }
+ else
+ {
+ $template_dir = DOL_DOCUMENT_ROOT."/core/tpl/";
+ }
+ }
+
// Set cookie for timeout management
$prefix=dol_getprefix();
$sessiontimeout='DOLSESSTIMEOUT_'.$prefix;
diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php
index 6dedf4cc805..cae544c6aa4 100644
--- a/htdocs/core/menus/standard/auguria.lib.php
+++ b/htdocs/core/menus/standard/auguria.lib.php
@@ -388,8 +388,8 @@ function dol_auguria_showmenu($type_user, &$menuentry, &$listofmodulesforexterna
if (! $found) return 0; // Entry is for menus all excluded to external users
}
if (! $menuentry['perms'] && $type_user) return 0; // No permissions and user is external
- if (! $menuentry['perms'] && ! empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED)) return 0; // No permissions and option to hide when not allowed, even for internal user, is on
- if (! $menuentry['perms']) return 2; // No permissions and user is external
+ if (! $menuentry['perms'] && ! empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED)) return 0; // No permissions and option to hide when not allowed, even for internal user, is on
+ if (! $menuentry['perms']) return 2; // No permissions and user is external
return 1;
}
diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php
index bb47d82fd9b..7fdff999410 100644
--- a/htdocs/core/menus/standard/eldy.lib.php
+++ b/htdocs/core/menus/standard/eldy.lib.php
@@ -110,10 +110,10 @@ function print_eldy_menu($db,$atarget,$type_user)
}
// Products-Services
- $tmpentry=array('enabled'=>($conf->product->enabled || $conf->service->enabled), 'perms'=>($user->rights->produit->lire || $user->rights->service->lire), 'module'=>'product|service');
- $showmode=dol_eldy_showmenu($type_user, $tmpentry, $listofmodulesforexternal);
- if ($showmode)
- {
+ $tmpentry=array('enabled'=>($conf->product->enabled || $conf->service->enabled), 'perms'=>($user->rights->produit->lire || $user->rights->service->lire), 'module'=>'product|service');
+ $showmode=dol_eldy_showmenu($type_user, $tmpentry, $listofmodulesforexternal);
+ if ($showmode)
+ {
$langs->load("products");
$classname="";
@@ -451,10 +451,10 @@ function print_eldy_menu($db,$atarget,$type_user)
{
$idsel=(empty($newTabMenu[$i]['mainmenu'])?'none':$newTabMenu[$i]['mainmenu']);
- $showmode=dol_eldy_showmenu($type_user,$newTabMenu[$i],$listofmodulesforexternal);
+ $showmode=dol_eldy_showmenu($type_user,$newTabMenu[$i],$listofmodulesforexternal);
- if ($showmode == 1)
- {
+ if ($showmode == 1)
+ {
if (preg_match("/^(http:\/\/|https:\/\/)/i",$newTabMenu[$i]['url']))
{
$url = $newTabMenu[$i]['url'];
@@ -1462,36 +1462,36 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
}
-/**
- * Function to test if an entry is enabled or not
- *
- * @param string $type_user 0=We need backoffice menu, 1=We need frontoffice menu
- * @param array &$menuentry Array for menu entry
- * @param array &$listofmodulesforexternal Array with list of modules allowed to external users
- * @return int 0=Hide, 1=Show, 2=Show gray
- */
-function dol_eldy_showmenu($type_user, &$menuentry, &$listofmodulesforexternal)
-{
- //print 'type_user='.$type_user.' module='.$menuentry['module'].' enabled='.$menuentry['enabled'].' perms='.$menuentry['perms'];
- //print 'ok='.in_array($menuentry['module'], $listofmodulesforexternal);
-
- if (empty($menuentry['enabled'])) return 0; // Entry disabled by condition
- if ($type_user && $menuentry['module'])
- {
- $tmploops=explode('|',$menuentry['module']);
- $found=0;
- foreach($tmploops as $tmploop)
- {
- if (in_array($tmploop, $listofmodulesforexternal)) {
- $found++; break;
- }
- }
- if (! $found) return 0; // Entry is for menus all excluded to external users
- }
- if (! $menuentry['perms'] && $type_user) return 0; // No permissions and user is external
- if (! $menuentry['perms'] && ! empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED)) return 0; // No permissions and option to hide when not allowed, even for internal user, is on
- if (! $menuentry['perms']) return 2; // No permissions and user is external
- return 1;
+/**
+ * Function to test if an entry is enabled or not
+ *
+ * @param string $type_user 0=We need backoffice menu, 1=We need frontoffice menu
+ * @param array &$menuentry Array for menu entry
+ * @param array &$listofmodulesforexternal Array with list of modules allowed to external users
+ * @return int 0=Hide, 1=Show, 2=Show gray
+ */
+function dol_eldy_showmenu($type_user, &$menuentry, &$listofmodulesforexternal)
+{
+ //print 'type_user='.$type_user.' module='.$menuentry['module'].' enabled='.$menuentry['enabled'].' perms='.$menuentry['perms'];
+ //print 'ok='.in_array($menuentry['module'], $listofmodulesforexternal);
+
+ if (empty($menuentry['enabled'])) return 0; // Entry disabled by condition
+ if ($type_user && $menuentry['module'])
+ {
+ $tmploops=explode('|',$menuentry['module']);
+ $found=0;
+ foreach($tmploops as $tmploop)
+ {
+ if (in_array($tmploop, $listofmodulesforexternal)) {
+ $found++; break;
+ }
+ }
+ if (! $found) return 0; // Entry is for menus all excluded to external users
+ }
+ if (! $menuentry['perms'] && $type_user) return 0; // No permissions and user is external
+ if (! $menuentry['perms'] && ! empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED)) return 0; // No permissions and option to hide when not allowed, even for internal user, is on
+ if (! $menuentry['perms']) return 2; // No permissions and user is external
+ return 1;
}
?>
diff --git a/htdocs/core/modules/action/rapport.pdf.php b/htdocs/core/modules/action/rapport.pdf.php
index 10192c1f4ca..ac7ffec5164 100644
--- a/htdocs/core/modules/action/rapport.pdf.php
+++ b/htdocs/core/modules/action/rapport.pdf.php
@@ -231,8 +231,8 @@ class CommActionRapport
$code=$obj->code;
if (empty($conf->global->AGENDA_USE_EVENT_TYPE))
{
- if ($code == 'AC_OTH') $code='AC_MANUAL';
- if ($code == 'AC_OTH_AUTO') $code='AC_AUTO';
+ if ($code == 'AC_OTH') $code='AC_MANUAL';
+ if ($code == 'AC_OTH_AUTO') $code='AC_AUTO';
}
$pdf->SetXY(60,$y);
$pdf->MultiCell(32, $height, dol_trunc($outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Action".$code)),32), 0, 'L', 0);
diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php
index 538599c72db..4baeebd7ae3 100644
--- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php
+++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php
@@ -118,8 +118,8 @@ class pdf_einstein extends ModelePDFCommandes
}
$this->tva=array();
- $this->localtax1=array();
- $this->localtax2=array();
+ $this->localtax1=array();
+ $this->localtax2=array();
$this->atleastoneratenotnull=0;
$this->atleastonediscount=0;
}
diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php
index 535b4d6f76a..84b6c50771f 100644
--- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php
+++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php
@@ -297,16 +297,16 @@ class doc_generic_odt extends ModeleThirdPartyDoc
}
}
- // Add odtgeneration hook
- if (! is_object($hookmanager))
- {
- include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
- $hookmanager=new HookManager($this->db);
- }
- $hookmanager->initHooks(array('odtgeneration'));
- $parameters=array('odfHandler'=>$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
- global $action;
- $reshook=$hookmanager->executeHooks('beforeODTSave',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
+ // Add odtgeneration hook
+ if (! is_object($hookmanager))
+ {
+ include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
+ $hookmanager=new HookManager($this->db);
+ }
+ $hookmanager->initHooks(array('odtgeneration'));
+ $parameters=array('odfHandler'=>$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
+ global $action;
+ $reshook=$hookmanager->executeHooks('beforeODTSave',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
// Write new file
//$result=$odfHandler->exportAsAttachedFile('toto');
diff --git a/htdocs/core/tpl/freeproductline_create.tpl.php b/htdocs/core/tpl/freeproductline_create.tpl.php
index 763e8d414c9..5c4b055ddf0 100644
--- a/htdocs/core/tpl/freeproductline_create.tpl.php
+++ b/htdocs/core/tpl/freeproductline_create.tpl.php
@@ -127,9 +127,9 @@ if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($ob
element) && $object->element == 'contrat')
{
- print $langs->trans("DateStartPlanned").' ';
- $form->select_date('',"date_start_sl",$usehm,$usehm,1,"addline_sl");
- print ' '.$langs->trans("DateEndPlanned").' ';
+ print $langs->trans("DateStartPlanned").' ';
+ $form->select_date('',"date_start_sl",$usehm,$usehm,1,"addline_sl");
+ print ' '.$langs->trans("DateEndPlanned").' ';
$form->select_date('',"date_end_sl",$usehm,$usehm,1,"addline_sl");
}
else
diff --git a/htdocs/core/tpl/predefinedproductline_create.tpl.php b/htdocs/core/tpl/predefinedproductline_create.tpl.php
index 07178b42bb2..6bfd94fa817 100644
--- a/htdocs/core/tpl/predefinedproductline_create.tpl.php
+++ b/htdocs/core/tpl/predefinedproductline_create.tpl.php
@@ -25,8 +25,8 @@
* $line defined
*/
-$usemargins=0;
-if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($object->element,array('facture','propal','commande'))) $usemargins=1;
+$usemargins=0;
+if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($object->element,array('facture','propal','commande'))) $usemargins=1;
?>
@@ -134,15 +134,15 @@ if (! empty($conf->service->enabled) && $dateSelector)
>
element) && $object->element == 'contrat')
+ if (! empty($object->element) && $object->element == 'contrat')
{
- print $langs->trans("DateStartPlanned").' ';
- $form->select_date('',"date_start",$usehm,$usehm,1,"addline");
- print ' '.$langs->trans("DateEndPlanned").' ';
+ print $langs->trans("DateStartPlanned").' ';
+ $form->select_date('',"date_start",$usehm,$usehm,1,"addline");
+ print ' '.$langs->trans("DateEndPlanned").' ';
$form->select_date('',"date_end",$usehm,$usehm,1,"addline");
}
else
- {
+ {
echo $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' ';
echo $form->select_date('','date_start_predef',$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,1,"addpredefinedproduct");
echo ' '.$langs->trans('to').' ';
diff --git a/htdocs/exports/index.php b/htdocs/exports/index.php
index a0501a3418e..29ce5835299 100644
--- a/htdocs/exports/index.php
+++ b/htdocs/exports/index.php
@@ -27,8 +27,8 @@ require_once DOL_DOCUMENT_ROOT.'/exports/class/export.class.php';
$langs->load("exports");
-// Security check
-$result=restrictedArea($user,'export');
+// Security check
+$result=restrictedArea($user,'export');
diff --git a/htdocs/ftp/index.php b/htdocs/ftp/index.php
index d09751b1f26..44de3441426 100644
--- a/htdocs/ftp/index.php
+++ b/htdocs/ftp/index.php
@@ -68,8 +68,8 @@ $ftp_name=$conf->global->$s_ftp_name;
$ftp_server=$conf->global->$s_ftp_server;
$ftp_port=$conf->global->$s_ftp_port; if (empty($ftp_port)) $ftp_port=21;
$ftp_user=$conf->global->$s_ftp_user;
-$ftp_password=$conf->global->$s_ftp_password;
-$ftp_passive=$conf->global->$s_ftp_passive;
+$ftp_password=$conf->global->$s_ftp_password;
+$ftp_passive=$conf->global->$s_ftp_passive;
$conn_id=0; // FTP connection ID
@@ -666,9 +666,9 @@ function dol_ftp_connect($ftp_server, $ftp_port, $ftp_user, $ftp_password, $sect
{
if (ftp_login($conn_id, $ftp_user, $ftp_password))
{
- // Turn on passive mode transfers (must be after a successful login
- if ($ftp_passive) ftp_pasv($conn_id, true);
-
+ // Turn on passive mode transfers (must be after a successful login
+ if ($ftp_passive) ftp_pasv($conn_id, true);
+
// Change the dir
$newsectioniso=utf8_decode($section);
ftp_chdir($conn_id, $newsectioniso);
diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php
index ca424a19a90..5ae3a3a9854 100644
--- a/htdocs/holiday/class/holiday.class.php
+++ b/htdocs/holiday/class/holiday.class.php
@@ -38,7 +38,7 @@ class Holiday extends CommonObject
var $errors=array();
var $rowid;
- var $ref;
+ var $ref;
var $fk_user;
var $date_create='';
@@ -356,11 +356,11 @@ class Holiday extends CommonObject
$sql.= " cp.fk_user_cancel,";
$sql.= " cp.detail_refuse,";
- $sql.= " uu.name as user_lastname,";
- $sql.= " uu.firstname as user_firstname,";
+ $sql.= " uu.name as user_lastname,";
+ $sql.= " uu.firstname as user_firstname,";
- $sql.= " ua.name as validator_lastname,";
- $sql.= " ua.firstname as validator_firstname";
+ $sql.= " ua.name as validator_lastname,";
+ $sql.= " ua.firstname as validator_firstname";
$sql.= " FROM ".MAIN_DB_PREFIX."holiday as cp, ".MAIN_DB_PREFIX."user as uu, ".MAIN_DB_PREFIX."user as ua";
$sql.= " WHERE cp.fk_user = uu.rowid AND cp.fk_validator = ua.rowid "; // Hack pour la recherche sur le tableau
@@ -461,7 +461,7 @@ class Holiday extends CommonObject
} else {
$error++;
}
- $sql.= " halfday = ".$this->halfday.",";
+ $sql.= " halfday = ".$this->halfday.",";
if(!empty($this->statut) && is_numeric($this->statut)) {
$sql.= " statut = '".$this->statut."',";
} else {
@@ -603,8 +603,8 @@ class Holiday extends CommonObject
foreach($this->holiday as $infos_CP)
{
- if ($infos_CP['statut'] == 4) continue; // ignore not validated holidays
- if ($infos_CP['statut'] == 5) continue; // ignore not validated holidays
+ if ($infos_CP['statut'] == 4) continue; // ignore not validated holidays
+ if ($infos_CP['statut'] == 5) continue; // ignore not validated holidays
// TODO Also use halfday for the check
if ($dateDebut >= $infos_CP['date_debut'] && $dateDebut <= $infos_CP['date_fin'] || $dateFin <= $infos_CP['date_fin'] && $dateFin >= $infos_CP['date_debut'])
@@ -618,42 +618,42 @@ class Holiday extends CommonObject
}
- /**
- * Return clicable name (with picto eventually)
- *
- * @param int $withpicto 0=_No picto, 1=Includes the picto in the linkn, 2=Picto only
- * @return string String with URL
- */
- function getNomUrl($withpicto=0)
- {
- global $langs;
-
- $result='';
-
- $lien = '';
- $lienfin=' ';
-
- $picto='holiday';
-
- $label=$langs->trans("Show").': '.$this->ref;
-
- if ($withpicto) $result.=($lien.img_object($label,$picto).$lienfin);
- if ($withpicto && $withpicto != 2) $result.=' ';
- if ($withpicto != 2) $result.=$lien.$this->ref.$lienfin;
- return $result;
+ /**
+ * Return clicable name (with picto eventually)
+ *
+ * @param int $withpicto 0=_No picto, 1=Includes the picto in the linkn, 2=Picto only
+ * @return string String with URL
+ */
+ function getNomUrl($withpicto=0)
+ {
+ global $langs;
+
+ $result='';
+
+ $lien = '';
+ $lienfin=' ';
+
+ $picto='holiday';
+
+ $label=$langs->trans("Show").': '.$this->ref;
+
+ if ($withpicto) $result.=($lien.img_object($label,$picto).$lienfin);
+ if ($withpicto && $withpicto != 2) $result.=' ';
+ if ($withpicto != 2) $result.=$lien.$this->ref.$lienfin;
+ return $result;
}
- /**
- * Returns the label status
- *
- * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
- * @return string Label
- */
- function getLibStatut($mode=0)
- {
- return $this->LibStatut($this->statut, $mode, $this->date_debut);
- }
+ /**
+ * Returns the label status
+ *
+ * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
+ * @return string Label
+ */
+ function getLibStatut($mode=0)
+ {
+ return $this->LibStatut($this->statut, $mode, $this->date_debut);
+ }
/**
* Returns the label of a statut
@@ -675,26 +675,26 @@ class Holiday extends CommonObject
if ($statut == 4) return $langs->trans('CancelCP');
if ($statut == 5) return $langs->trans('RefuseCP');
}
- if ($mode == 2)
- {
+ if ($mode == 2)
+ {
$pictoapproved='statut6';
if (! empty($startdate) && $startdate > dol_now()) $pictoapproved='statut4';
- if ($statut == 1) return img_picto($langs->trans('DraftCP'),'statut0').' '.$langs->trans('DraftCP'); // Draft
- if ($statut == 2) return img_picto($langs->trans('ToValidateCP'),'statut1').' '.$langs->trans('ToValidateCP'); // Waiting approval
- if ($statut == 3) return img_picto($langs->trans('ValidateCP'),$pictoapproved).' '.$langs->trans('ValidateCP');
- if ($statut == 4) return img_picto($langs->trans('CancelCP'),'statut5').' '.$langs->trans('CancelCP');
- if ($statut == 5) return img_picto($langs->trans('RefuseCP'),'statut5').' '.$langs->trans('RefuseCP');
- }
- if ($mode == 5)
+ if ($statut == 1) return img_picto($langs->trans('DraftCP'),'statut0').' '.$langs->trans('DraftCP'); // Draft
+ if ($statut == 2) return img_picto($langs->trans('ToValidateCP'),'statut1').' '.$langs->trans('ToValidateCP'); // Waiting approval
+ if ($statut == 3) return img_picto($langs->trans('ValidateCP'),$pictoapproved).' '.$langs->trans('ValidateCP');
+ if ($statut == 4) return img_picto($langs->trans('CancelCP'),'statut5').' '.$langs->trans('CancelCP');
+ if ($statut == 5) return img_picto($langs->trans('RefuseCP'),'statut5').' '.$langs->trans('RefuseCP');
+ }
+ if ($mode == 5)
{
- $pictoapproved='statut6';
+ $pictoapproved='statut6';
if (! empty($startdate) && $startdate > dol_now()) $pictoapproved='statut4';
- if ($statut == 1) return $langs->trans('DraftCP').' '.img_picto($langs->trans('DraftCP'),'statut0'); // Draft
- if ($statut == 2) return $langs->trans('ToValidateCP').' '.img_picto($langs->trans('ToValidateCP'),'statut1'); // Waiting approval
- if ($statut == 3) return $langs->trans('ValidateCP').' '.img_picto($langs->trans('ValidateCP'),$pictoapproved);
- if ($statut == 4) return $langs->trans('CancelCP').' '.img_picto($langs->trans('CancelCP'),'statut5');
- if ($statut == 5) return $langs->trans('RefuseCP').' '.img_picto($langs->trans('RefuseCP'),'statut5');
- }
+ if ($statut == 1) return $langs->trans('DraftCP').' '.img_picto($langs->trans('DraftCP'),'statut0'); // Draft
+ if ($statut == 2) return $langs->trans('ToValidateCP').' '.img_picto($langs->trans('ToValidateCP'),'statut1'); // Waiting approval
+ if ($statut == 3) return $langs->trans('ValidateCP').' '.img_picto($langs->trans('ValidateCP'),$pictoapproved);
+ if ($statut == 4) return $langs->trans('CancelCP').' '.img_picto($langs->trans('CancelCP'),'statut5');
+ if ($statut == 5) return $langs->trans('RefuseCP').' '.img_picto($langs->trans('RefuseCP'),'statut5');
+ }
return $statut;
}
diff --git a/htdocs/holiday/common.inc.php b/htdocs/holiday/common.inc.php
index 4a3f1049557..9b80f2aebe6 100644
--- a/htdocs/holiday/common.inc.php
+++ b/htdocs/holiday/common.inc.php
@@ -58,7 +58,7 @@ if ($obj->value == null)
$warnpicto=img_error($langs->trans("WarningMandatorySetupNotComplete"));
print '';
print $warnpicto.' '.$langs->trans("NotConfigModCP");
- print '
';
+ print '';
llxFooter();
exit();
diff --git a/htdocs/holiday/fiche.php b/htdocs/holiday/fiche.php
index 5e8711facde..e129c546e3b 100644
--- a/htdocs/holiday/fiche.php
+++ b/htdocs/holiday/fiche.php
@@ -52,7 +52,7 @@ $now=dol_now();
// Si création de la demande
if ($action == 'create')
{
- $cp = new Holiday($db);
+ $cp = new Holiday($db);
// Si pas le droit de créer une demande
if(!$user->rights->holiday->write)
@@ -63,12 +63,12 @@ if ($action == 'create')
$date_debut = dol_mktime(0, 0, 0, GETPOST('date_debut_month'), GETPOST('date_debut_day'), GETPOST('date_debut_year'));
$date_fin = dol_mktime(0, 0, 0, GETPOST('date_fin_month'), GETPOST('date_fin_day'), GETPOST('date_fin_year'));
- $starthalfday=GETPOST('starthalfday');
+ $starthalfday=GETPOST('starthalfday');
$endhalfday=GETPOST('endhalfday');
$halfday=0;
if ($starthalfday == 'afternoon' && $endhalfday == 'morning') $halfday=2;
else if ($starthalfday == 'afternoon') $halfday=-1;
- else if ($endhalfday == 'morning') $halfday=1;
+ else if ($endhalfday == 'morning') $halfday=1;
$valideur = GETPOST('valideur');
$description = trim(GETPOST('description'));
@@ -144,14 +144,14 @@ if ($action == 'create')
if ($action == 'update')
{
- $date_debut = dol_mktime(0, 0, 0, GETPOST('date_debut_month'), GETPOST('date_debut_day'), GETPOST('date_debut_year'));
- $date_fin = dol_mktime(0, 0, 0, GETPOST('date_fin_month'), GETPOST('date_fin_day'), GETPOST('date_fin_year'));
- $starthalfday=GETPOST('starthalfday');
- $endhalfday=GETPOST('endhalfday');
- $halfday=0;
- if ($starthalfday == 'afternoon' && $endhalfday == 'morning') $halfday=2;
- else if ($starthalfday == 'afternoon') $halfday=-1;
- else if ($endhalfday == 'morning') $halfday=1;
+ $date_debut = dol_mktime(0, 0, 0, GETPOST('date_debut_month'), GETPOST('date_debut_day'), GETPOST('date_debut_year'));
+ $date_fin = dol_mktime(0, 0, 0, GETPOST('date_fin_month'), GETPOST('date_fin_day'), GETPOST('date_fin_year'));
+ $starthalfday=GETPOST('starthalfday');
+ $endhalfday=GETPOST('endhalfday');
+ $halfday=0;
+ if ($starthalfday == 'afternoon' && $endhalfday == 'morning') $halfday=2;
+ else if ($starthalfday == 'afternoon') $halfday=-1;
+ else if ($endhalfday == 'morning') $halfday=1;
// Si pas le droit de modifier une demande
if(!$user->rights->holiday->write)
@@ -575,9 +575,9 @@ if ($action == 'confirm_cancel' && $_GET['confirm'] == 'yes')
*/
$form = new Form($db);
-$cp = new Holiday($db);
+$cp = new Holiday($db);
-$listhalfday=array('morning'=>$langs->trans("Morning"),"afternoon"=>$langs->trans("Afternoon"));
+$listhalfday=array('morning'=>$langs->trans("Morning"),"afternoon"=>$langs->trans("Afternoon"));
llxHeader(array(),$langs->trans('CPTitreMenu'));
@@ -859,12 +859,12 @@ else
print ' ';
print ''.$langs->trans("Ref").' ';
print '';
- print $form->showrefnav($cp, 'id', $linkback, 1, 'rowid', 'ref');
+ print $form->showrefnav($cp, 'id', $linkback, 1, 'rowid', 'ref');
print ' ';
print ' ';
$starthalfday=($cp->halfday == -1 || $cp->halfday == 2)?'afternoon':'morning';
- $endhalfday=($cp->halfday == 1 || $cp->halfday == 2)?'morning':'afternoon';
+ $endhalfday=($cp->halfday == 1 || $cp->halfday == 2)?'morning':'afternoon';
if(!$edit) {
print '';
@@ -890,7 +890,7 @@ else
print ' ';
print ''.$langs->trans('DateFinCP').' ('.$langs->trans("LastDayOfHoliday").') ';
print ''.dol_print_date($cp->date_fin,'day');
- print ' ';
+ print ' ';
print $langs->trans($listhalfday[$endhalfday]);
print ' ';
print ' ';
@@ -1026,10 +1026,10 @@ else
{
print ''.$langs->trans("Validate").' ';
}
- if($user->rights->holiday->delete && $cp->statut == 1)
- {
- print ''.$langs->trans("DeleteCP").' ';
- }
+ if($user->rights->holiday->delete && $cp->statut == 1)
+ {
+ print ''.$langs->trans("DeleteCP").' ';
+ }
// Si le statut est en attente de validation et que le valideur est connecté
if ($userID == $cp->fk_validator && $cp->statut == 2)
diff --git a/htdocs/holiday/index.php b/htdocs/holiday/index.php
index 8ab1b2ceb71..5d876796f87 100644
--- a/htdocs/holiday/index.php
+++ b/htdocs/holiday/index.php
@@ -288,8 +288,8 @@ if (! empty($holiday->holiday))
// Valideur
$approbatorstatic->id=$infos_CP['fk_validator'];
- $approbatorstatic->lastname=$infos_CP['validator_lastname'];
- $approbatorstatic->firstname=$infos_CP['validator_firstname'];
+ $approbatorstatic->lastname=$infos_CP['validator_lastname'];
+ $approbatorstatic->firstname=$infos_CP['validator_firstname'];
$date = $infos_CP['date_create'];
diff --git a/htdocs/holiday/month_report.php b/htdocs/holiday/month_report.php
index 5c0468d27b3..ab40b8e939d 100644
--- a/htdocs/holiday/month_report.php
+++ b/htdocs/holiday/month_report.php
@@ -111,8 +111,8 @@ if($num == '0') {
$user->fetch($holiday['fk_user']);
$var=!$var;
- $holidaystatic->id=$holiday['rowid'];
- $holidaystatic->ref=$holiday['rowid'];
+ $holidaystatic->id=$holiday['rowid'];
+ $holidaystatic->ref=$holiday['rowid'];
$start_date=$db->jdate($holiday['date_debut']);
$end_date=$db->jdate($holiday['date_fin']);
diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php
index 04d4ac6de93..799ce4e2e98 100644
--- a/htdocs/install/inc.php
+++ b/htdocs/install/inc.php
@@ -199,36 +199,36 @@ if (constant('DOL_DATA_ROOT') && file_exists($lockfile))
// Force usage of log file for install and upgrades
$conf->syslog->enabled=1;
-$conf->global->SYSLOG_LEVEL=constant('LOG_DEBUG');
-if (! defined('SYSLOG_FILE')) // To avoid warning on systems with constant already defined
-{
- if (@is_writable('/tmp')) define('SYSLOG_FILE','/tmp/dolibarr_install.log');
- else if (! empty($_ENV["TMP"]) && @is_writable($_ENV["TMP"])) define('SYSLOG_FILE',$_ENV["TMP"].'/dolibarr_install.log');
- else if (! empty($_ENV["TEMP"]) && @is_writable($_ENV["TEMP"])) define('SYSLOG_FILE',$_ENV["TEMP"].'/dolibarr_install.log');
- else if (@is_writable('../../../../') && @file_exists('../../../../startdoliwamp.bat')) define('SYSLOG_FILE','../../../../dolibarr_install.log'); // For DoliWamp
- else if (@is_writable('../../')) define('SYSLOG_FILE','../../dolibarr_install.log'); // For others
- //print 'SYSLOG_FILE='.SYSLOG_FILE;exit;
-}
-if (! defined('SYSLOG_FILE_NO_ERROR')) define('SYSLOG_FILE_NO_ERROR',1);
-// We init log handler for install
-$handlers = array('mod_syslog_file');
-foreach ($handlers as $handler)
-{
- $file = DOL_DOCUMENT_ROOT.'/core/modules/syslog/'.$handler.'.php';
- if (!file_exists($file))
- {
- throw new Exception('Missing log handler file '.$handler.'.php');
- }
-
- require_once $file;
- $loghandlerinstance = new $handler();
- if (!$loghandlerinstance instanceof LogHandlerInterface)
- {
- throw new Exception('Log handler does not extend LogHandlerInterface');
- }
-
- $conf->loghandlers[]=$loghandlerinstance;
-}
+$conf->global->SYSLOG_LEVEL=constant('LOG_DEBUG');
+if (! defined('SYSLOG_FILE')) // To avoid warning on systems with constant already defined
+{
+ if (@is_writable('/tmp')) define('SYSLOG_FILE','/tmp/dolibarr_install.log');
+ else if (! empty($_ENV["TMP"]) && @is_writable($_ENV["TMP"])) define('SYSLOG_FILE',$_ENV["TMP"].'/dolibarr_install.log');
+ else if (! empty($_ENV["TEMP"]) && @is_writable($_ENV["TEMP"])) define('SYSLOG_FILE',$_ENV["TEMP"].'/dolibarr_install.log');
+ else if (@is_writable('../../../../') && @file_exists('../../../../startdoliwamp.bat')) define('SYSLOG_FILE','../../../../dolibarr_install.log'); // For DoliWamp
+ else if (@is_writable('../../')) define('SYSLOG_FILE','../../dolibarr_install.log'); // For others
+ //print 'SYSLOG_FILE='.SYSLOG_FILE;exit;
+}
+if (! defined('SYSLOG_FILE_NO_ERROR')) define('SYSLOG_FILE_NO_ERROR',1);
+// We init log handler for install
+$handlers = array('mod_syslog_file');
+foreach ($handlers as $handler)
+{
+ $file = DOL_DOCUMENT_ROOT.'/core/modules/syslog/'.$handler.'.php';
+ if (!file_exists($file))
+ {
+ throw new Exception('Missing log handler file '.$handler.'.php');
+ }
+
+ require_once $file;
+ $loghandlerinstance = new $handler();
+ if (!$loghandlerinstance instanceof LogHandlerInterface)
+ {
+ throw new Exception('Log handler does not extend LogHandlerInterface');
+ }
+
+ $conf->loghandlers[]=$loghandlerinstance;
+}
// Removed magic_quotes
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 70a90128787..718fc43318b 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -914,13 +914,13 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
$themepath=dol_buildpath((empty($conf->global->MAIN_FORCETHEMEDIR)?'':$conf->global->MAIN_FORCETHEMEDIR).$conf->css,1);
if (! empty($conf->modules_parts['theme'])) // This slow down
{
- foreach($conf->modules_parts['theme'] as $reldir)
+ foreach($conf->modules_parts['theme'] as $reldir)
{
if (file_exists(dol_buildpath($reldir.$conf->css, 0)))
{
$themepath=dol_buildpath($reldir.$conf->css, 1);
break;
- }
+ }
}
}
$themeparam='?lang='.$langs->defaultlang.'&theme='.$conf->theme.(GETPOST('optioncss')?'&optioncss='.GETPOST('optioncss','alpha',1):'').'&userid='.$user->id.'&entity='.$conf->entity;
@@ -1160,20 +1160,20 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
$toprightmenu='';
- // Define menu manager in setup
- if (empty($user->societe_id)) // If internal user or not defined
- {
- $conf->top_menu=(empty($conf->global->MAIN_MENU_STANDARD_FORCED)?$conf->global->MAIN_MENU_STANDARD:$conf->global->MAIN_MENU_STANDARD_FORCED);
- $conf->smart_menu=(empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?$conf->global->MAIN_MENU_SMARTPHONE:$conf->global->MAIN_MENU_SMARTPHONE_FORCED);
- }
- else // If external user
- {
- $conf->top_menu=(empty($conf->global->MAIN_MENUFRONT_STANDARD_FORCED)?$conf->global->MAIN_MENUFRONT_STANDARD:$conf->global->MAIN_MENUFRONT_STANDARD_FORCED);
- $conf->smart_menu=(empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?$conf->global->MAIN_MENUFRONT_SMARTPHONE:$conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED);
- }
- // For backward compatibility
- if ($conf->top_menu == 'eldy.php') $conf->top_menu='eldy_backoffice.php';
- elseif ($conf->top_menu == 'rodolphe.php') $conf->top_menu='eldy_backoffice.php';
+ // Define menu manager in setup
+ if (empty($user->societe_id)) // If internal user or not defined
+ {
+ $conf->top_menu=(empty($conf->global->MAIN_MENU_STANDARD_FORCED)?$conf->global->MAIN_MENU_STANDARD:$conf->global->MAIN_MENU_STANDARD_FORCED);
+ $conf->smart_menu=(empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?$conf->global->MAIN_MENU_SMARTPHONE:$conf->global->MAIN_MENU_SMARTPHONE_FORCED);
+ }
+ else // If external user
+ {
+ $conf->top_menu=(empty($conf->global->MAIN_MENUFRONT_STANDARD_FORCED)?$conf->global->MAIN_MENUFRONT_STANDARD:$conf->global->MAIN_MENUFRONT_STANDARD_FORCED);
+ $conf->smart_menu=(empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?$conf->global->MAIN_MENUFRONT_SMARTPHONE:$conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED);
+ }
+ // For backward compatibility
+ if ($conf->top_menu == 'eldy.php') $conf->top_menu='eldy_backoffice.php';
+ elseif ($conf->top_menu == 'rodolphe.php') $conf->top_menu='eldy_backoffice.php';
if (! $conf->top_menu) $conf->top_menu ='eldy_backoffice.php';
// For backward compatibility with old modules
diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php
index b3fc8884334..a8f97d9563e 100644
--- a/htdocs/master.inc.php
+++ b/htdocs/master.inc.php
@@ -54,7 +54,7 @@ $conf->db->character_set = $dolibarr_main_db_character_set;
$conf->db->dolibarr_main_db_collation = $dolibarr_main_db_collation;
$conf->db->dolibarr_main_db_encryption = $dolibarr_main_db_encryption;
$conf->db->dolibarr_main_db_cryptkey = $dolibarr_main_db_cryptkey;
-if (defined('TEST_DB_FORCE_TYPE')) $conf->db->type=constant('TEST_DB_FORCE_TYPE'); // Force db type (for test purpose, by PHP unit for example)
+if (defined('TEST_DB_FORCE_TYPE')) $conf->db->type=constant('TEST_DB_FORCE_TYPE'); // Force db type (for test purpose, by PHP unit for example)
// Set properties specific to conf file
$conf->file->main_limit_users = $dolibarr_main_limit_users;
diff --git a/htdocs/product/admin/product_tools.php b/htdocs/product/admin/product_tools.php
index e19a7f605a6..744bf99de8b 100644
--- a/htdocs/product/admin/product_tools.php
+++ b/htdocs/product/admin/product_tools.php
@@ -138,13 +138,13 @@ print_fiche_titre($title,'','setup');
print $langs->trans("ProductVatMassChangeDesc").' ';
-if (empty($mysoc->country_code))
-{
- $langs->load("errors");
- $warnpicto=img_error($langs->trans("WarningMandatorySetupNotComplete"));
- print ''.$warnpicto.' '.$langs->trans("WarningMandatorySetupNotComplete").' ';
-}
-else
+if (empty($mysoc->country_code))
+{
+ $langs->load("errors");
+ $warnpicto=img_error($langs->trans("WarningMandatorySetupNotComplete"));
+ print ''.$warnpicto.' '.$langs->trans("WarningMandatorySetupNotComplete").' ';
+}
+else
{
$var=true;
diff --git a/htdocs/product/stock/fiche-valo.php b/htdocs/product/stock/fiche-valo.php
index 976df224365..f18dfbc0ba5 100644
--- a/htdocs/product/stock/fiche-valo.php
+++ b/htdocs/product/stock/fiche-valo.php
@@ -31,8 +31,8 @@ $langs->load("stocks");
$langs->load("companies");
$mesg = '';
-// Security check
-$result=restrictedArea($user,'stock');
+// Security check
+$result=restrictedArea($user,'stock');
/*
diff --git a/htdocs/product/stock/fiche.php b/htdocs/product/stock/fiche.php
index fbf597aee34..b87f42a4bed 100644
--- a/htdocs/product/stock/fiche.php
+++ b/htdocs/product/stock/fiche.php
@@ -44,8 +44,8 @@ if (! $sortorder) $sortorder="DESC";
$mesg = '';
-// Security check
-$result=restrictedArea($user,'stock');
+// Security check
+$result=restrictedArea($user,'stock');
diff --git a/htdocs/product/stock/index.php b/htdocs/product/stock/index.php
index 76732b5ac07..4cc37664aa6 100644
--- a/htdocs/product/stock/index.php
+++ b/htdocs/product/stock/index.php
@@ -29,8 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
$langs->load("stocks");
-// Security check
-$result=restrictedArea($user,'stock');
+// Security check
+$result=restrictedArea($user,'stock');
/*
diff --git a/htdocs/product/stock/info.php b/htdocs/product/stock/info.php
index 0dc4938ab2f..14afe0b49d9 100644
--- a/htdocs/product/stock/info.php
+++ b/htdocs/product/stock/info.php
@@ -28,8 +28,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/stock.lib.php';
$langs->load("stocks");
-// Security check
-$result=restrictedArea($user,'stock');
+// Security check
+$result=restrictedArea($user,'stock');
/*
diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php
index 584d4c2e2e3..619daee82e2 100644
--- a/htdocs/public/demo/index.php
+++ b/htdocs/public/demo/index.php
@@ -389,7 +389,7 @@ if (! empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && ! empty($conf->global->MAIN
llxFooterVierge();
-$db->close();
+$db->close();
/**
diff --git a/htdocs/societe/societe.php b/htdocs/societe/societe.php
index 9a15c6d09f7..a5207f80c8c 100644
--- a/htdocs/societe/societe.php
+++ b/htdocs/societe/societe.php
@@ -113,7 +113,7 @@ if ($mode == 'search')
// Filter on type of thirdparty
if ($search_type > 0 && in_array($search_type,array('1,3','2,3'))) $sql .= " AND s.client IN (".$db->escape($search_type).")";
if ($search_type > 0 && in_array($search_type,array('4'))) $sql .= " AND s.fournisseur = 1";
- if ($search_type == '0') $sql .= " AND s.client = 0 AND s.fournisseur = 0";
+ if ($search_type == '0') $sql .= " AND s.client = 0 AND s.fournisseur = 0";
$result=$db->query($sql);
if ($result)
@@ -236,7 +236,7 @@ if ($search_idprof3) $sql .= " AND s.ape LIKE '%".$db->escape($search_idprof3)."
if ($search_idprof4) $sql .= " AND s.idprof4 LIKE '%".$db->escape($search_idprof4)."%'";
if ($search_idprof5) $sql .= " AND s.idprof5 LIKE '%".$db->escape($search_idprof5)."%'";
if ($search_idprof6) $sql .= " AND s.idprof6 LIKE '%".$db->escape($search_idprof6)."%'";
-// Filter on type of thirdparty
+// Filter on type of thirdparty
if ($search_type > 0 && in_array($search_type,array('1,3','2,3'))) $sql .= " AND s.client IN (".$db->escape($search_type).")";
if ($search_type > 0 && in_array($search_type,array('4'))) $sql .= " AND s.fournisseur = 1";
if ($search_type == '0') $sql .= " AND s.client = 0 AND s.fournisseur = 0";
@@ -353,14 +353,14 @@ if ($resql)
print '';
print ' ';
print ' ';
- // Type (customer/prospect/supplier)
- print '';
- print '';
- print ' ';
- print ''.$langs->trans('Customer').' ';
- if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) print ''.$langs->trans('Prospect').' ';
- //if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) print ''.$langs->trans('ProspectCustomer').' ';
- print ''.$langs->trans('Supplier').' ';
+ // Type (customer/prospect/supplier)
+ print '';
+ print '';
+ print ' ';
+ print ''.$langs->trans('Customer').' ';
+ if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) print ''.$langs->trans('Prospect').' ';
+ //if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) print ''.$langs->trans('ProspectCustomer').' ';
+ print ''.$langs->trans('Supplier').' ';
print ''.$langs->trans('Others').' ';
print ' ';
// Status
diff --git a/htdocs/theme/amarok/graph-color.php b/htdocs/theme/amarok/graph-color.php
index 12662b3bdc6..035e52089cc 100755
--- a/htdocs/theme/amarok/graph-color.php
+++ b/htdocs/theme/amarok/graph-color.php
@@ -22,10 +22,10 @@
* \ingroup core
*/
-global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet;
-$theme_bordercolor = array(235,235,224);
-$theme_datacolor = array(array(125,135,150), array(200,160,180), array(190,190,220), array(170,140,190), array(190,190,170));
-$theme_bgcolor = array(hexdec('F4'),hexdec('F4'),hexdec('F4'));
-$theme_bgcoloronglet = array(hexdec('DE'),hexdec('E7'),hexdec('EC'));
+global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet;
+$theme_bordercolor = array(235,235,224);
+$theme_datacolor = array(array(125,135,150), array(200,160,180), array(190,190,220), array(170,140,190), array(190,190,170));
+$theme_bgcolor = array(hexdec('F4'),hexdec('F4'),hexdec('F4'));
+$theme_bgcoloronglet = array(hexdec('DE'),hexdec('E7'),hexdec('EC'));
?>
diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php
index fd314fef0a8..30a81270280 100644
--- a/htdocs/user/fiche.php
+++ b/htdocs/user/fiche.php
@@ -391,24 +391,24 @@ if ($action == 'update' && ! $_POST["cancel"])
$contact=new Contact($db);
$contact->fetch($contactid);
- $sql = "UPDATE ".MAIN_DB_PREFIX."user";
- $sql.= " SET fk_socpeople=".$contactid;
- if ($contact->socid) $sql.=", fk_societe=".$contact->socid;
- $sql.= " WHERE rowid=".$object->id;
+ $sql = "UPDATE ".MAIN_DB_PREFIX."user";
+ $sql.= " SET fk_socpeople=".$contactid;
+ if ($contact->socid) $sql.=", fk_societe=".$contact->socid;
+ $sql.= " WHERE rowid=".$object->id;
}
else
{
- $sql = "UPDATE ".MAIN_DB_PREFIX."user";
- $sql.= " SET fk_socpeople=NULL, fk_societe=NULL";
- $sql.= " WHERE rowid=".$object->id;
+ $sql = "UPDATE ".MAIN_DB_PREFIX."user";
+ $sql.= " SET fk_socpeople=NULL, fk_societe=NULL";
+ $sql.= " WHERE rowid=".$object->id;
}
- $resql=$db->query($sql);
+ $resql=$db->query($sql);
dol_syslog("fiche::update sql=".$sql, LOG_DEBUG);
if (! $resql)
{
$error++;
$message.=''.$db->lasterror().'
';
- }
+ }
}
if (! $error && ! count($object->errors))
@@ -1191,12 +1191,12 @@ else
print ' '."\n";
// ldap sid
- if ($object->ldap_sid)
- {
+ if ($object->ldap_sid)
+ {
print ''.$langs->trans("Type").' ';
- print $langs->trans("DomainUser",$ldap->domainFQDN);
+ print $langs->trans("DomainUser",$ldap->domainFQDN);
print ' '."\n";
- }
+ }
// Tel pro
print ''.$langs->trans("PhonePro").' ';
@@ -1402,13 +1402,13 @@ else
if ($user->id <> $id && $candisableuser &&
(empty($conf->multicompany->enabled) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1)))
{
- if ($user->admin || ! $object->admin) // If user edited is admin, delete is possible on for an admin
+ if ($user->admin || ! $object->admin) // If user edited is admin, delete is possible on for an admin
{
print ''.$langs->trans("DeleteUser").' ';
}
else
{
- print ''.$langs->trans("DeleteUser").' ';
+ print ''.$langs->trans("DeleteUser").' ';
}
}
@@ -1758,10 +1758,10 @@ else
print '';
if ($user->id == $object->id || ! $user->admin)
{
- $type=$langs->trans("Internal");
- if ($object->societe_id) $type=$langs->trans("External");
- print $form->textwithpicto($type,$langs->trans("InternalExternalDesc"));
- if ($object->ldap_sid) print ' ('.$langs->trans("DomainUser").')';
+ $type=$langs->trans("Internal");
+ if ($object->societe_id) $type=$langs->trans("External");
+ print $form->textwithpicto($type,$langs->trans("InternalExternalDesc"));
+ if ($object->ldap_sid) print ' ('.$langs->trans("DomainUser").')';
}
else
{
diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php
index 2930a1cdc61..745da280887 100644
--- a/htdocs/user/passwordforgotten.php
+++ b/htdocs/user/passwordforgotten.php
@@ -174,21 +174,21 @@ else
}
}
-// Note: $conf->css looks like '/theme/eldy/style.css.php'
-$conf->css = "/theme/".(GETPOST('theme')?GETPOST('theme','alpha'):$conf->theme)."/style.css.php";
-$themepath=dol_buildpath((empty($conf->global->MAIN_FORCETHEMEDIR)?'':$conf->global->MAIN_FORCETHEMEDIR).$conf->css,1);
-if (! empty($conf->modules_parts['theme'])) // This slow down
-{
- foreach($conf->modules_parts['theme'] as $reldir)
- {
- if (file_exists(dol_buildpath($reldir.$conf->css, 0)))
- {
- $themepath=dol_buildpath($reldir.$conf->css, 1);
- break;
- }
- }
-}
-$conf_css = $themepath."?lang=".$langs->defaultlang;
+// Note: $conf->css looks like '/theme/eldy/style.css.php'
+$conf->css = "/theme/".(GETPOST('theme')?GETPOST('theme','alpha'):$conf->theme)."/style.css.php";
+$themepath=dol_buildpath((empty($conf->global->MAIN_FORCETHEMEDIR)?'':$conf->global->MAIN_FORCETHEMEDIR).$conf->css,1);
+if (! empty($conf->modules_parts['theme'])) // This slow down
+{
+ foreach($conf->modules_parts['theme'] as $reldir)
+ {
+ if (file_exists(dol_buildpath($reldir.$conf->css, 0)))
+ {
+ $themepath=dol_buildpath($reldir.$conf->css, 1);
+ break;
+ }
+ }
+}
+$conf_css = $themepath."?lang=".$langs->defaultlang;
$jquerytheme = 'smoothness';
if (! empty($conf->global->MAIN_USE_JQUERY_THEME)) $jquerytheme = $conf->global->MAIN_USE_JQUERY_THEME;
diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php
index 15e6bd24801..a0f2ce6fb99 100644
--- a/htdocs/user/perms.php
+++ b/htdocs/user/perms.php
@@ -27,8 +27,8 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
-require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
-require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
$langs->load("users");
$langs->load("admin");
@@ -267,8 +267,8 @@ print ' '."\n";
print ' ';
if ($user->admin) print info_admin($langs->trans("WarningOnlyPermissionOfActivatedModules"), 0, 1).' ';
-// Show warning about external users
-print showModulesExludedForExternal($modules).' '."\n";
+// Show warning about external users
+print showModulesExludedForExternal($modules).' '."\n";
print " \n";
// For multicompany transversal mode