';
-print '';
+//print '
';
+//print '';
+print '';
// Search contract
@@ -286,8 +286,8 @@ if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire)
}
-//print '
';
-print ' ';
+print '';
// Last modified contracts
diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php
index 36eb166f499..0f4264b223f 100755
--- a/htdocs/core/class/commondocgenerator.class.php
+++ b/htdocs/core/class/commondocgenerator.class.php
@@ -197,25 +197,25 @@ abstract class CommonDocGenerator
}
- /**
- * Define array with couple subtitution key => subtitution value
- *
- * @param Translate $outputlangs Language object for output
- * @return array Array of substitution key->code
- */
- function get_substitutionarray_other($outputlangs)
- {
- global $conf;
+ /**
+ * Define array with couple subtitution key => subtitution value
+ *
+ * @param Translate $outputlangs Language object for output
+ * @return array Array of substitution key->code
+ */
+ function get_substitutionarray_other($outputlangs)
+ {
+ global $conf;
$now=dol_now('gmt'); // gmt
- $array_other = array(
+ $array_other = array(
'current_date'=>dol_print_date($now,'day','tzuser'),
'current_datehour'=>dol_print_date($now,'dayhour','tzuser'),
'current_server_date'=>dol_print_date($now,'day','tzserver'),
'current_server_datehour'=>dol_print_date($now,'dayhour','tzserver'),
- );
+ );
- return $array_other;
+ return $array_other;
}
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index b128455b8ff..4f7ce047d9b 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -1556,8 +1556,8 @@ abstract class CommonObject
$i++;
}
- // Add revenue stamp to total
- $this->total_ttc += isset($this->revenuestamp)?$this->revenuestamp:0;
+ // Add revenue stamp to total
+ $this->total_ttc += isset($this->revenuestamp)?$this->revenuestamp:0;
$this->db->free($resql);
@@ -2720,12 +2720,12 @@ abstract class CommonObject
// Product
if ($line->fk_product > 0)
{
- $product_static = new Product($this->db);
-
- $product_static->type=$line->fk_product_type;
- $product_static->id=$line->fk_product;
- $product_static->ref=$line->ref;
- $text=$product_static->getNomUrl(1);
+ $product_static = new Product($this->db);
+
+ $product_static->type=$line->fk_product_type;
+ $product_static->id=$line->fk_product;
+ $product_static->ref=$line->ref;
+ $text=$product_static->getNomUrl(1);
// Define output language (TODO Does this works ?)
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE))
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 4807ec768fa..7d7713b297c 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -691,19 +691,19 @@ class Form
//$minLength = (is_numeric($conf->global->COMPANY_USE_SEARCH_TO_SELECT)?$conf->global->COMPANY_USE_SEARCH_TO_SELECT:2);
$out.= ajax_combobox($htmlname, $event, $conf->global->COMPANY_USE_SEARCH_TO_SELECT);
/*
- if ($selected && empty($selected_input_value))
- {
- require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
- $product = new Product($this->db);
- $product->fetch($selected);
- $selected_input_value=$product->ref;
- }
+ if ($selected && empty($selected_input_value))
+ {
+ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
+ $product = new Product($this->db);
+ $product->fetch($selected);
+ $selected_input_value=$product->ref;
+ }
// mode=1 means customers products
- $ajaxoptions=array();
- $urloption='htmlname='.$htmlname.'&outjson=1&filter='.urlencode($filter).'&showtype='.$showtype;
- $out.=ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
+ $ajaxoptions=array();
+ $urloption='htmlname='.$htmlname.'&outjson=1&filter='.urlencode($filter).'&showtype='.$showtype;
+ $out.=ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
$out.='
';
- */
+ */
}
$out.= '
';
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index 840e2912766..51c2f981c4b 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -359,9 +359,9 @@ class FormFile
}
// For normalized external modules
else
- {
- $file=dol_buildpath('/'.$modulepart.'/core/modules/'.$modulepart.'/modules_'.$modulepart.'.php',0);
- $res=include_once $file;
+ {
+ $file=dol_buildpath('/'.$modulepart.'/core/modules/'.$modulepart.'/modules_'.$modulepart.'.php',0);
+ $res=include_once $file;
}
$class='Modele'.ucfirst($modulepart);
if (class_exists($class))
diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php
index cf7c6fb8bf6..9fca74bc397 100644
--- a/htdocs/core/class/html.formother.class.php
+++ b/htdocs/core/class/html.formother.class.php
@@ -208,59 +208,59 @@ class FormOther
}
- /**
- * Return list of revenue stamp for country
- *
- * @param string $selected Value of preselected revenue stamp
- * @param string $htmlname Name of combo list
- * @return string HTML select list
- */
- function select_revenue_stamp($selected='',$htmlname='revenuestamp',$country_code='')
- {
- global $langs;
+ /**
+ * Return list of revenue stamp for country
+ *
+ * @param string $selected Value of preselected revenue stamp
+ * @param string $htmlname Name of combo list
+ * @return string HTML select list
+ */
+ function select_revenue_stamp($selected='',$htmlname='revenuestamp',$country_code='')
+ {
+ global $langs;
$out='';
-
- $sql = "SELECT r.taux";
- $sql.= " FROM ".MAIN_DB_PREFIX."c_revenuestamp as r,".MAIN_DB_PREFIX."c_pays as p";
- $sql.= " WHERE r.active = 1 AND r.fk_pays = p.rowid";
- $sql.= " AND p.code = '".$country_code."'";
- dol_syslog(get_class($this).'::select_revenue_stamp sql='.$sql);
- $resql=$this->db->query($sql);
- if ($resql)
- {
- $out.='';
- $num = $this->db->num_rows($resql);
- $i = 0;
- $out.=' '."\n";
- if ($num)
- {
- while ($i < $num)
- {
- $obj = $this->db->fetch_object($resql);
- if (($selected && $selected == $obj->taux) || $num == 1)
- {
- $out.='';
- }
- else
- {
- $out.=' ';
- //print ' ';
- }
- $out.=$obj->taux;
- $out.=' ';
- $i++;
- }
- }
- $out.=' ';
- return $out;
- }
- else
- {
- dol_print_error($this->db);
- return '';
- }
+ $sql = "SELECT r.taux";
+ $sql.= " FROM ".MAIN_DB_PREFIX."c_revenuestamp as r,".MAIN_DB_PREFIX."c_pays as p";
+ $sql.= " WHERE r.active = 1 AND r.fk_pays = p.rowid";
+ $sql.= " AND p.code = '".$country_code."'";
+
+ dol_syslog(get_class($this).'::select_revenue_stamp sql='.$sql);
+ $resql=$this->db->query($sql);
+ if ($resql)
+ {
+ $out.='';
+ $num = $this->db->num_rows($resql);
+ $i = 0;
+ $out.=' '."\n";
+ if ($num)
+ {
+ while ($i < $num)
+ {
+ $obj = $this->db->fetch_object($resql);
+ if (($selected && $selected == $obj->taux) || $num == 1)
+ {
+ $out.='';
+ }
+ else
+ {
+ $out.=' ';
+ //print ' ';
+ }
+ $out.=$obj->taux;
+ $out.=' ';
+ $i++;
+ }
+ }
+ $out.=' ';
+ return $out;
+ }
+ else
+ {
+ dol_print_error($this->db);
+ return '';
+ }
}
diff --git a/htdocs/core/getmenu_jmobile.php b/htdocs/core/getmenu_jmobile.php
index f7eaada8283..4075bbc77b6 100644
--- a/htdocs/core/getmenu_jmobile.php
+++ b/htdocs/core/getmenu_jmobile.php
@@ -51,42 +51,42 @@ $left=($langs->trans("DIRECTION")=='rtl'?'right':'left');
*/
// URL http://mydolibarr/core/getmenu_jmobime?mainmenu=mainmenu&leftmenu=leftmenu can be used for tests
-$arrayofjs=array('/includes/jquery/plugins/mobile/jquery.mobile-latest.min.js');
+$arrayofjs=array('/includes/jquery/plugins/mobile/jquery.mobile-latest.min.js');
$arrayofcss=array('/includes/jquery/plugins/mobile/jquery.mobile-latest.min.css');
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
print ''."\n";
-if (empty($user->societe_id)) // If internal user or not defined
-{
- $conf->standard_menu=(empty($conf->global->MAIN_MENU_STANDARD_FORCED)?(empty($conf->global->MAIN_MENU_STANDARD)?'eldy_menu.php':$conf->global->MAIN_MENU_STANDARD):$conf->global->MAIN_MENU_STANDARD_FORCED);
- $conf->smart_menu=(empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?(empty($conf->global->MAIN_MENU_SMARTPHONE)?'smartphone_menu.php':$conf->global->MAIN_MENU_SMARTPHONE):$conf->global->MAIN_MENU_SMARTPHONE_FORCED);
-}
-else // If external user
-{
- $conf->standard_menu=(empty($conf->global->MAIN_MENUFRONT_STANDARD_FORCED)?(empty($conf->global->MAIN_MENUFRONT_STANDARD)?'eldy_menu.php':$conf->global->MAIN_MENUFRONT_STANDARD):$conf->global->MAIN_MENUFRONT_STANDARD_FORCED);
- $conf->smart_menu=(empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?(empty($conf->global->MAIN_MENUFRONT_SMARTPHONE)?'smartphone_menu.php':$conf->global->MAIN_MENUFRONT_SMARTPHONE):$conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED);
-}
-
-// Load the menu manager (only if not already done)
-$file_menu=empty($conf->browser->phone)?$conf->standard_menu:$conf->smart_menu;
-if (GETPOST('menu')) $file_menu=GETPOST('menu'); // example: menu=eldy_menu.php
-if (! class_exists('MenuManager'))
-{
- $menufound=0;
- $dirmenus=array_merge(array("/core/menus/"),(array) $conf->modules_parts['menus']);
- foreach($dirmenus as $dirmenu)
- {
- $menufound=dol_include_once($dirmenu."standard/".$file_menu);
- if ($menufound) break;
- }
- if (! $menufound) // If failed to include, we try with standard
- {
- dol_syslog("You define a menu manager '".$file_menu."' that can not be loaded.", LOG_WARNING);
- $file_menu='eldy_menu.php';
- include_once DOL_DOCUMENT_ROOT."/core/menus/standard/".$file_menu;
- }
-}
+if (empty($user->societe_id)) // If internal user or not defined
+{
+ $conf->standard_menu=(empty($conf->global->MAIN_MENU_STANDARD_FORCED)?(empty($conf->global->MAIN_MENU_STANDARD)?'eldy_menu.php':$conf->global->MAIN_MENU_STANDARD):$conf->global->MAIN_MENU_STANDARD_FORCED);
+ $conf->smart_menu=(empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?(empty($conf->global->MAIN_MENU_SMARTPHONE)?'smartphone_menu.php':$conf->global->MAIN_MENU_SMARTPHONE):$conf->global->MAIN_MENU_SMARTPHONE_FORCED);
+}
+else // If external user
+{
+ $conf->standard_menu=(empty($conf->global->MAIN_MENUFRONT_STANDARD_FORCED)?(empty($conf->global->MAIN_MENUFRONT_STANDARD)?'eldy_menu.php':$conf->global->MAIN_MENUFRONT_STANDARD):$conf->global->MAIN_MENUFRONT_STANDARD_FORCED);
+ $conf->smart_menu=(empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?(empty($conf->global->MAIN_MENUFRONT_SMARTPHONE)?'smartphone_menu.php':$conf->global->MAIN_MENUFRONT_SMARTPHONE):$conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED);
+}
+
+// Load the menu manager (only if not already done)
+$file_menu=empty($conf->browser->phone)?$conf->standard_menu:$conf->smart_menu;
+if (GETPOST('menu')) $file_menu=GETPOST('menu'); // example: menu=eldy_menu.php
+if (! class_exists('MenuManager'))
+{
+ $menufound=0;
+ $dirmenus=array_merge(array("/core/menus/"),(array) $conf->modules_parts['menus']);
+ foreach($dirmenus as $dirmenu)
+ {
+ $menufound=dol_include_once($dirmenu."standard/".$file_menu);
+ if ($menufound) break;
+ }
+ if (! $menufound) // If failed to include, we try with standard
+ {
+ dol_syslog("You define a menu manager '".$file_menu."' that can not be loaded.", LOG_WARNING);
+ $file_menu='eldy_menu.php';
+ include_once DOL_DOCUMENT_ROOT."/core/menus/standard/".$file_menu;
+ }
+}
$menumanager = new MenuManager($db, empty($user->societe_id)?0:1);
$menumanager->loadMenu();
diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php
index b7d012cc51a..9b74e999fbe 100644
--- a/htdocs/core/lib/company.lib.php
+++ b/htdocs/core/lib/company.lib.php
@@ -90,11 +90,11 @@ function societe_prepare_head($object)
$head[$h][2] = 'note';
$h++;
- $head[$h][0] = DOL_URL_ROOT.'/societe/consumption.php?socid='.$object->id;
- $head[$h][1] = $langs->trans("Referers");
- $head[$h][2] = 'consumption';
- $h++;
-
+ $head[$h][0] = DOL_URL_ROOT.'/societe/consumption.php?socid='.$object->id;
+ $head[$h][1] = $langs->trans("Referers");
+ $head[$h][2] = 'consumption';
+ $h++;
+
// Attached files
$head[$h][0] = DOL_URL_ROOT.'/societe/document.php?socid='.$object->id;
$head[$h][1] = $langs->trans("Documents");
diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php
index 23bf990ae69..726b3486e30 100644
--- a/htdocs/core/lib/files.lib.php
+++ b/htdocs/core/lib/files.lib.php
@@ -42,7 +42,7 @@ function dol_basename($pathfile)
* @param string $path Starting path from which to search
* @param string $types Can be "directories", "files", or "all"
* @param int $recursive Determines whether subdirectories are searched
- * @param string $filter Regex for include filter
+ * @param string $filter Regex filter to restrict list. This regex value must be escaped for '/', since this char is used for preg_match function
* @param string $excludefilter Array of Regex for exclude filter (example: array('\.meta$','^\.'))
* @param string $sortcriteria Sort criteria ("","fullname","name","date","size")
* @param string $sortorder Sort order (SORT_ASC, SORT_DESC)
@@ -65,7 +65,7 @@ function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefil
$path=preg_replace('/([\\/]+)$/i','',$path);
$newpath=dol_osencode($path);
- if (! $nohook)
+ if (! $nohook)
{
$hookmanager->initHooks(array('fileslib'));
@@ -1212,11 +1212,11 @@ function dol_uncompress($inputfile,$outputdir)
/**
- * Return most recent file
+ * Return file(s) into a directory (by default most recent)
*
* @param string $dir Directory to scan
- * @param string $regexfilter Regexfilter
- * @param string $excludefilter Array of Regex for exclude filter (example: array('\.meta$','^\.'))
+ * @param string $regexfilter Regex filter to restrict list. This regex value must be escaped for '/', since this char is used for preg_match function
+ * @param string $excludefilter Array of Regex for exclude filter (example: array('\.meta$','^\.')). This regex value must be escaped for '/', since this char is used for preg_match function
* @param int $nohook Disable all hooks
* @return string Full path to most recent file
*/
@@ -1225,4 +1225,5 @@ function dol_most_recent_file($dir,$regexfilter='',$excludefilter=array('\.meta$
$tmparray=dol_dir_list($dir,'files',0,$regexfilter,$excludefilter,'date',SORT_DESC,'',$nohook);
return $tmparray[0];
}
-?>
+
+?>
\ No newline at end of file
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index edc39c6d164..d0ad263d71a 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -2630,9 +2630,9 @@ function price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerou
{
$listofcurrenciesbefore=array('USD');
if (in_array($currency_code,$listofcurrenciesbefore)) $cursymbolbefore.=$outlangs->getCurrencySymbol($currency_code);
- else $cursymbolafter.=$outlangs->getCurrencySymbol($currency_code);
+ else $cursymbolafter.=$outlangs->getCurrencySymbol($currency_code);
}
- $output.=$cursymbolbefore.$end.$cursymbolafter;
+ $output.=$cursymbolbefore.$end.$cursymbolafter;
return $output;
}
@@ -3660,21 +3660,21 @@ function dolGetFirstLastname($firstname,$lastname,$nameorder=-1)
{
global $conf;
- $ret='';
- // If order not defined, we use the setup
- if ($nameorder < 0) $nameorder=(empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION));
- if ($nameorder)
- {
- $ret.=$firstname;
- if ($firstname && $lastname) $ret.=' ';
- $ret.=$lastname;
- }
- else
- {
- $ret.=$lastname;
- if ($firstname && $lastname) $ret.=' ';
- $ret.=$firstname;
- }
+ $ret='';
+ // If order not defined, we use the setup
+ if ($nameorder < 0) $nameorder=(empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION));
+ if ($nameorder)
+ {
+ $ret.=$firstname;
+ if ($firstname && $lastname) $ret.=' ';
+ $ret.=$lastname;
+ }
+ else
+ {
+ $ret.=$lastname;
+ if ($firstname && $lastname) $ret.=' ';
+ $ret.=$firstname;
+ }
return $ret;
}
@@ -4293,18 +4293,18 @@ function colorArrayToHex($arraycolor,$colorifnotfound='888888')
return dechex($arraycolor[0]).dechex($arraycolor[1]).dechex($arraycolor[2]);
}
-/**
- * Set focus onto field with selector
- *
- * @param string $selector Selector ('#id')
- * @return string HTML code to set focus
- */
-function dol_set_focus($selector)
-{
- print ''."\n";
- print ''."\n";
-}
-
+/**
+ * Set focus onto field with selector
+ *
+ * @param string $selector Selector ('#id')
+ * @return string HTML code to set focus
+ */
+function dol_set_focus($selector)
+{
+ print ''."\n";
+ print ''."\n";
+}
+
if (! function_exists('getmypid'))
{
diff --git a/htdocs/core/lib/treeview.lib.php b/htdocs/core/lib/treeview.lib.php
index f565467575e..2e87dfceea8 100644
--- a/htdocs/core/lib/treeview.lib.php
+++ b/htdocs/core/lib/treeview.lib.php
@@ -23,7 +23,7 @@
*/
-// ------------------------------- Used by ajax tree view -----------------
+// ------------------------------- Used by ajax tree view -----------------
/**
* Show indent and picto of a tree line. Return array with information of line.
@@ -159,7 +159,7 @@ function tree_recur($tab, $pere, $rang, $iddivjstree='iddivjstree')
print '';
}
}
- if (! empty($ulprinted) && ! empty($pere['rowid'])) { print ''."\n"; }
+ if (! empty($ulprinted) && ! empty($pere['rowid'])) { print ''."\n"; }
if (empty($pere['rowid'])) print '';
}
diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php
index 6faf6e90a50..ebf70b6d9c9 100644
--- a/htdocs/core/menus/standard/auguria.lib.php
+++ b/htdocs/core/menus/standard/auguria.lib.php
@@ -21,7 +21,7 @@
* \file htdocs/core/menus/standard/auguria.lib.php
* \brief Library for file auguria menus
*/
-require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
@@ -40,8 +40,8 @@ function print_auguria_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0)
{
global $user,$conf,$langs,$dolibarr_main_db_name;
- $mainmenu=$_SESSION["mainmenu"];
- $leftmenu=$_SESSION["leftmenu"];
+ $mainmenu=$_SESSION["mainmenu"];
+ $leftmenu=$_SESSION["leftmenu"];
$id='mainmenu';
$listofmodulesforexternal=explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL);
@@ -75,7 +75,7 @@ function print_auguria_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0)
$shorturl = $newTabMenu[$i]['url'].$param;
}
$url=preg_replace('/__LOGIN__/',$user->login,$url);
- $shorturl=preg_replace('/__LOGIN__/',$user->login,$shorturl);
+ $shorturl=preg_replace('/__LOGIN__/',$user->login,$shorturl);
// Define the class (top menu selected or not)
if (! empty($_SESSION['idmenu']) && $newTabMenu[$i]['rowid'] == $_SESSION['idmenu']) $classname='class="tmenusel"';
@@ -84,9 +84,9 @@ function print_auguria_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0)
}
else if ($showmode == 2) $classname='class="tmenu"';
- if (empty($noout)) print_start_menu_entry_auguria($idsel,$classname,$showmode);
- if (empty($noout)) print_text_menu_entry_auguria($newTabMenu[$i]['titre'], $showmode, $url, $id, $idsel, $classname, ($newTabMenu[$i]['target']?$newTabMenu[$i]['target']:$atarget));
- if (empty($noout)) print_end_menu_entry_auguria($showmode);
+ if (empty($noout)) print_start_menu_entry_auguria($idsel,$classname,$showmode);
+ if (empty($noout)) print_text_menu_entry_auguria($newTabMenu[$i]['titre'], $showmode, $url, $id, $idsel, $classname, ($newTabMenu[$i]['target']?$newTabMenu[$i]['target']:$atarget));
+ if (empty($noout)) print_end_menu_entry_auguria($showmode);
$menu->add($shorturl, $newTabMenu[$i]['titre'], 0, $showmode, ($newTabMenu[$i]['target']?$newTabMenu[$i]['target']:$atarget), ($newTabMenu[$i]['mainmenu']?$newTabMenu[$i]['mainmenu']:$newTabMenu[$i]['rowid']), '');
}
@@ -138,23 +138,23 @@ function print_start_menu_entry_auguria($idsel,$classname,$showmode)
*/
function print_text_menu_entry_auguria($text, $showmode, $url, $id, $idsel, $classname, $atarget)
{
- global $langs;
+ global $langs;
- if ($showmode == 1)
- {
- print '';
- print '';
- print '';
- print $text;
- print ' ';
- print ' ';
- }
- if ($showmode == 2)
- {
- print '
';
- print '';
+ if ($showmode == 1)
+ {
+ print ' ';
+ print '';
+ print '';
+ print $text;
+ print ' ';
+ print ' ';
+ }
+ if ($showmode == 2)
+ {
+ print '
';
+ print '';
print '';
print $text;
print ' ';
@@ -245,7 +245,7 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
if (is_array($menu_array_before)) $menu_array=array_merge($menu_array_before, $menu_array);
if (is_array($menu_array_after)) $menu_array=array_merge($menu_array, $menu_array_after);
//var_dump($menu_array);exit;
- if (! is_array($menu_array)) return 0;
+ if (! is_array($menu_array)) return 0;
// Show menu
if (empty($noout))
diff --git a/htdocs/core/menus/standard/auguria_menu.php b/htdocs/core/menus/standard/auguria_menu.php
index 19b4b15764f..e33d08403ac 100644
--- a/htdocs/core/menus/standard/auguria_menu.php
+++ b/htdocs/core/menus/standard/auguria_menu.php
@@ -36,7 +36,7 @@ class MenuManager
var $menu_array;
var $menu_array_after;
- var $tabMenu;
+ var $tabMenu;
/**
@@ -52,59 +52,59 @@ class MenuManager
}
- /**
- * Load this->tabMenu
- *
- * @return void
- */
- function loadMenu()
- {
+ /**
+ * Load this->tabMenu
+ *
+ * @return void
+ */
+ function loadMenu()
+ {
global $conf, $user, $langs;
- // On sauve en session le menu principal choisi
- if (isset($_GET["mainmenu"])) $_SESSION["mainmenu"]=$_GET["mainmenu"];
- if (isset($_GET["idmenu"])) $_SESSION["idmenu"]=$_GET["idmenu"];
-
- // Read mainmenu and leftmenu that define which menu to show
- if (isset($_GET["mainmenu"]))
- {
- // On sauve en session le menu principal choisi
- $mainmenu=$_GET["mainmenu"];
- $_SESSION["mainmenu"]=$mainmenu;
- $_SESSION["leftmenuopened"]="";
- }
- else
- {
- // On va le chercher en session si non defini par le lien
- $mainmenu=isset($_SESSION["mainmenu"])?$_SESSION["mainmenu"]:'';
- }
-
- if (isset($_GET["leftmenu"]))
- {
- // On sauve en session le menu principal choisi
- $leftmenu=$_GET["leftmenu"];
- $_SESSION["leftmenu"]=$leftmenu;
-
- if ($_SESSION["leftmenuopened"]==$leftmenu) // To collapse
- {
- //$leftmenu="";
- $_SESSION["leftmenuopened"]="";
- }
- else
- {
- $_SESSION["leftmenuopened"]=$leftmenu;
- }
- } else {
- // On va le chercher en session si non defini par le lien
- $leftmenu=isset($_SESSION["leftmenu"])?$_SESSION["leftmenu"]:'';
- }
-
- require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
- $tabMenu=array();
- $menuArbo = new Menubase($this->db,'auguria');
+ // On sauve en session le menu principal choisi
+ if (isset($_GET["mainmenu"])) $_SESSION["mainmenu"]=$_GET["mainmenu"];
+ if (isset($_GET["idmenu"])) $_SESSION["idmenu"]=$_GET["idmenu"];
+
+ // Read mainmenu and leftmenu that define which menu to show
+ if (isset($_GET["mainmenu"]))
+ {
+ // On sauve en session le menu principal choisi
+ $mainmenu=$_GET["mainmenu"];
+ $_SESSION["mainmenu"]=$mainmenu;
+ $_SESSION["leftmenuopened"]="";
+ }
+ else
+ {
+ // On va le chercher en session si non defini par le lien
+ $mainmenu=isset($_SESSION["mainmenu"])?$_SESSION["mainmenu"]:'';
+ }
+
+ if (isset($_GET["leftmenu"]))
+ {
+ // On sauve en session le menu principal choisi
+ $leftmenu=$_GET["leftmenu"];
+ $_SESSION["leftmenu"]=$leftmenu;
+
+ if ($_SESSION["leftmenuopened"]==$leftmenu) // To collapse
+ {
+ //$leftmenu="";
+ $_SESSION["leftmenuopened"]="";
+ }
+ else
+ {
+ $_SESSION["leftmenuopened"]=$leftmenu;
+ }
+ } else {
+ // On va le chercher en session si non defini par le lien
+ $leftmenu=isset($_SESSION["leftmenu"])?$_SESSION["leftmenu"]:'';
+ }
+
+ require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
+ $tabMenu=array();
+ $menuArbo = new Menubase($this->db,'auguria');
$menuArbo->menuLoad($mainmenu, $leftmenu, $this->type_user, 'auguria', $tabMenu);
- // Modules system tools
+ // Modules system tools
// TODO Find a way to add parent menu only if child menu exists. For the moment, no other method than hard coded methods.
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled) || ! empty($conf->global->MAIN_MENU_ENABLE_MODULETOOLS))
{
@@ -141,8 +141,8 @@ class MenuManager
'type'=>'left',
'position'=>20
));
- }
- }
+ }
+ }
$this->tabMenu=$tabMenu;
}
@@ -169,58 +169,58 @@ class MenuManager
$res='ErrorBadParameterForMode';
require_once DOL_DOCUMENT_ROOT.'/core/class/menu.class.php';
- $this->menu=new Menu();
+ $this->menu=new Menu();
if ($mode == 'top') $res=print_auguria_menu($this->db,$this->atarget,$this->type_user,$this->tabMenu,$this->menu);
if ($mode == 'left') $res=print_left_auguria_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$this->menu);
- if ($mode == 'jmobile')
- {
- $res=print_auguria_menu($this->db,$this->atarget,$this->type_user,$this->tabMenu,$this->menu,1);
-
- foreach($this->menu->liste as $key => $val) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu'
- {
- print '';
- print '';
- if ($val['enabled'] == 1)
- {
- $relurl=dol_buildpath($val['url'],1);
-
- print ''.$val['titre'].' '."\n";
- // Search submenu fot this entry
- $tmpmainmenu=$val['mainmenu'];
- $tmpleftmenu='all';
- $submenu=new Menu();
- $res=print_left_auguria_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$submenu,1,$tmpmainmenu,$tmpleftmenu);
- $nexturl=dol_buildpath($submenu->liste[0]['url'],1);
- $canonrelurl=preg_replace('/\?.*$/','',$relurl);
- $canonnexturl=preg_replace('/\?.*$/','',$nexturl);
- //var_dump($canonrelurl);
- //var_dump($canonnexturl);
- print '';
- if ($canonrelurl != $canonnexturl && $val['mainmenu'] != 'home')
- {
- // We add sub entry
- print ''.$langs->trans("MainArea").'-'.$val['titre'].' '."\n";
- }
- foreach($submenu->liste as $key2 => $val2) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu'
- {
- $relurl2=dol_buildpath($val2['url'],1);
- //var_dump($val2);
- print ''.$val2['titre'].' '."\n";
- }
- //var_dump($submenu);
- print ' ';
- }
- if ($val['enabled'] == 2)
- {
- print '';
- }
- print ' ';
- print ' '."\n";
- }
+ if ($mode == 'jmobile')
+ {
+ $res=print_auguria_menu($this->db,$this->atarget,$this->type_user,$this->tabMenu,$this->menu,1);
+
+ foreach($this->menu->liste as $key => $val) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu'
+ {
+ print '';
+ print '';
+ if ($val['enabled'] == 1)
+ {
+ $relurl=dol_buildpath($val['url'],1);
+
+ print ''.$val['titre'].' '."\n";
+ // Search submenu fot this entry
+ $tmpmainmenu=$val['mainmenu'];
+ $tmpleftmenu='all';
+ $submenu=new Menu();
+ $res=print_left_auguria_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$submenu,1,$tmpmainmenu,$tmpleftmenu);
+ $nexturl=dol_buildpath($submenu->liste[0]['url'],1);
+ $canonrelurl=preg_replace('/\?.*$/','',$relurl);
+ $canonnexturl=preg_replace('/\?.*$/','',$nexturl);
+ //var_dump($canonrelurl);
+ //var_dump($canonnexturl);
+ print '';
+ if ($canonrelurl != $canonnexturl && $val['mainmenu'] != 'home')
+ {
+ // We add sub entry
+ print ''.$langs->trans("MainArea").'-'.$val['titre'].' '."\n";
+ }
+ foreach($submenu->liste as $key2 => $val2) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu'
+ {
+ $relurl2=dol_buildpath($val2['url'],1);
+ //var_dump($val2);
+ print ''.$val2['titre'].' '."\n";
+ }
+ //var_dump($submenu);
+ print ' ';
+ }
+ if ($val['enabled'] == 2)
+ {
+ print '';
+ }
+ print ' ';
+ print ' '."\n";
+ }
}
- unset($this->menu);
+ unset($this->menu);
return $res;
}
diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php
index 23970e6897c..42ab594b387 100644
--- a/htdocs/core/menus/standard/eldy.lib.php
+++ b/htdocs/core/menus/standard/eldy.lib.php
@@ -22,7 +22,7 @@
* \file htdocs/core/menus/standard/eldy.lib.php
* \brief Library for file eldy menus
*/
-require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
/**
@@ -58,7 +58,7 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0)
if (empty($noout)) print_start_menu_entry($idsel,$classname,$showmode);
if (empty($noout)) print_text_menu_entry($langs->trans("Home"), 1, DOL_URL_ROOT.'/index.php?mainmenu=home&leftmenu=', $id, $idsel, $classname, $atarget);
if (empty($noout)) print_end_menu_entry($showmode);
- $menu->add('/index.php?mainmenu=home&leftmenu=', $langs->trans("Home"), 0, $showmode, $atarget, "home", '');
+ $menu->add('/index.php?mainmenu=home&leftmenu=', $langs->trans("Home"), 0, $showmode, $atarget, "home", '');
// Third parties
$tmpentry=array('enabled'=>(! empty($conf->societe->enabled) || ! empty($conf->fournisseur->enabled)), 'perms'=>(! empty($user->rights->societe->lire) || ! empty($user->rights->fournisseur->lire)), 'module'=>'societe|fournisseur');
@@ -187,9 +187,9 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0)
else $classname = 'class="tmenu"';
$idsel='project';
- if (empty($noout)) print_start_menu_entry($idsel,$classname,$showmode);
- if (empty($noout)) print_text_menu_entry($langs->trans("Projects"), $showmode, DOL_URL_ROOT.'/projet/index.php?mainmenu=project&leftmenu=', $id, $idsel, $classname, $atarget);
- if (empty($noout)) print_end_menu_entry($showmode);
+ if (empty($noout)) print_start_menu_entry($idsel,$classname,$showmode);
+ if (empty($noout)) print_text_menu_entry($langs->trans("Projects"), $showmode, DOL_URL_ROOT.'/projet/index.php?mainmenu=project&leftmenu=', $id, $idsel, $classname, $atarget);
+ if (empty($noout)) print_end_menu_entry($showmode);
$menu->add('/projet/index.php?mainmenu=project&leftmenu=', $langs->trans("Projects"), 0, $showmode, $atarget, "project", '');
}
@@ -279,7 +279,7 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0)
$shorturl = $newTabMenu[$i]['url'].$param;
}
$url=preg_replace('/__LOGIN__/',$user->login,$url);
- $shorturl=preg_replace('/__LOGIN__/',$user->login,$shorturl);
+ $shorturl=preg_replace('/__LOGIN__/',$user->login,$shorturl);
// Define the class (top menu selected or not)
if (! empty($_SESSION['idmenu']) && $newTabMenu[$i]['rowid'] == $_SESSION['idmenu']) $classname='class="tmenusel"';
@@ -344,10 +344,10 @@ function print_text_menu_entry($text, $showmode, $url, $id, $idsel, $classname,
if ($showmode == 1)
{
- print ' ';
- print '';
+ print ' ';
+ print '';
print '';
print $text;
print ' ';
@@ -355,8 +355,8 @@ function print_text_menu_entry($text, $showmode, $url, $id, $idsel, $classname,
}
if ($showmode == 2)
{
- print '
';
- print ' ';
+ print '
';
+ print ' ';
print '';
print $text;
print ' ';
@@ -1168,7 +1168,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
if (is_array($menu_array_before)) $menu_array=array_merge($menu_array_before, $menu_array);
if (is_array($menu_array_after)) $menu_array=array_merge($menu_array, $menu_array_after);
//var_dump($menu_array);exit;
- if (! is_array($menu_array)) return 0;
+ if (! is_array($menu_array)) return 0;
// Show menu
if (empty($noout))
diff --git a/htdocs/core/menus/standard/eldy_menu.php b/htdocs/core/menus/standard/eldy_menu.php
index fdf3a93e2fb..8b381ed7038 100644
--- a/htdocs/core/menus/standard/eldy_menu.php
+++ b/htdocs/core/menus/standard/eldy_menu.php
@@ -76,29 +76,29 @@ class MenuManager
$mainmenu=isset($_SESSION["mainmenu"])?$_SESSION["mainmenu"]:'';
}
- if (isset($_GET["leftmenu"]))
- {
- // On sauve en session le menu principal choisi
- $leftmenu=$_GET["leftmenu"];
- $_SESSION["leftmenu"]=$leftmenu;
+ if (isset($_GET["leftmenu"]))
+ {
+ // On sauve en session le menu principal choisi
+ $leftmenu=$_GET["leftmenu"];
+ $_SESSION["leftmenu"]=$leftmenu;
- if ($_SESSION["leftmenuopened"]==$leftmenu) // To collapse
- {
- //$leftmenu="";
- $_SESSION["leftmenuopened"]="";
- }
- else
- {
- $_SESSION["leftmenuopened"]=$leftmenu;
- }
- } else {
- // On va le chercher en session si non defini par le lien
- $leftmenu=isset($_SESSION["leftmenu"])?$_SESSION["leftmenu"]:'';
- }
+ if ($_SESSION["leftmenuopened"]==$leftmenu) // To collapse
+ {
+ //$leftmenu="";
+ $_SESSION["leftmenuopened"]="";
+ }
+ else
+ {
+ $_SESSION["leftmenuopened"]=$leftmenu;
+ }
+ } else {
+ // On va le chercher en session si non defini par le lien
+ $leftmenu=isset($_SESSION["leftmenu"])?$_SESSION["leftmenu"]:'';
+ }
- require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
+ require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
$tabMenu=array();
- $menuArbo = new Menubase($this->db,'eldy');
+ $menuArbo = new Menubase($this->db,'eldy');
$menuArbo->menuLoad($mainmenu, $leftmenu, $this->type_user, 'eldy', $tabMenu);
$this->tabMenu=$tabMenu;
}
@@ -126,7 +126,7 @@ class MenuManager
require_once DOL_DOCUMENT_ROOT.'/core/class/menu.class.php';
$this->menu=new Menu();
-
+
if ($mode == 'top') $res=print_eldy_menu($this->db,$this->atarget,$this->type_user,$this->tabMenu,$this->menu);
if ($mode == 'left') $res=print_left_eldy_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$this->menu);
if ($mode == 'jmobile')
@@ -156,7 +156,7 @@ class MenuManager
if ($canonrelurl != $canonnexturl && $val['mainmenu'] != 'home')
{
// We add sub entry
- print ''.$langs->trans("MainArea").'-'.$val['titre'].' '."\n";
+ print ''.$langs->trans("MainArea").'-'.$val['titre'].' '."\n";
}
foreach($submenu->liste as $key2 => $val2) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu'
{
@@ -165,7 +165,7 @@ class MenuManager
print ''.$val2['titre'].' '."\n";
}
//var_dump($submenu);
- print '';
+ print '';
}
if ($val['enabled'] == 2)
{
diff --git a/htdocs/core/menus/standard/empty.php b/htdocs/core/menus/standard/empty.php
index 2e401e3cf10..14093ce5995 100644
--- a/htdocs/core/menus/standard/empty.php
+++ b/htdocs/core/menus/standard/empty.php
@@ -46,12 +46,12 @@ class MenuManager
}
- /**
- * Load this->tabMenu
- *
- * @return void
- */
- function loadMenu()
+ /**
+ * Load this->tabMenu
+ *
+ * @return void
+ */
+ function loadMenu()
{
}
@@ -70,7 +70,7 @@ class MenuManager
$id='mainmenu';
require_once DOL_DOCUMENT_ROOT.'/core/class/menu.class.php';
- $this->menu=new Menu();
+ $this->menu=new Menu();
if ($mode == 'top')
{
@@ -183,7 +183,7 @@ class MenuManager
*/
function print_start_menu_array_empty()
{
- print '';
llxFooter();
diff --git a/htdocs/exports/class/export.class.php b/htdocs/exports/class/export.class.php
index 9def962c8ec..2311c6fe66e 100644
--- a/htdocs/exports/class/export.class.php
+++ b/htdocs/exports/class/export.class.php
@@ -237,7 +237,7 @@ class Export
}
$sql.=$sqlWhere;
}
- $sql.=$this->array_export_sql_order[$indice];
+ $sql.=$this->array_export_sql_order[$indice];
return $sql;
}
diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php
index fcd968eeeb0..b40988ca571 100644
--- a/htdocs/exports/export.php
+++ b/htdocs/exports/export.php
@@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/export/modules_export.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$langs->load("exports");
-$langs->load("users");
+$langs->load("users");
// Everybody should be able to go on this page
//if (! $user->admin)
diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php
index b3ae77d7ac3..4e93a5710b1 100755
--- a/htdocs/filefunc.inc.php
+++ b/htdocs/filefunc.inc.php
@@ -234,7 +234,7 @@ if (! file_exists(DOL_DOCUMENT_ROOT ."/core/lib/functions.lib.php"))
print "Please run dolibarr setup by calling page /install . \n";
exit;
}
-
+
// Included by default
include_once DOL_DOCUMENT_ROOT .'/core/lib/functions.lib.php';
diff --git a/htdocs/fourn/index.php b/htdocs/fourn/index.php
index ec832a670d2..a4a9e06ccef 100644
--- a/htdocs/fourn/index.php
+++ b/htdocs/fourn/index.php
@@ -53,7 +53,7 @@ print_fiche_titre($langs->trans("SuppliersArea"));
//print ' ';
//print '';
-print '';
+print '
';
// Orders
@@ -226,7 +226,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
//print '
';
-print '';
+print '
';
/*
@@ -321,7 +321,7 @@ if (count($companystatic->SupplierCategories))
//print "
\n";
-print '
';
+print '
';
llxFooter();
diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php
index 27e45118fa8..8dfaf85ac71 100644
--- a/htdocs/holiday/class/holiday.class.php
+++ b/htdocs/holiday/class/holiday.class.php
@@ -82,12 +82,12 @@ class Holiday extends CommonObject
*/
function updateSold()
{
- // Mets à jour les congés payés en début de mois
- $this->updateSoldeCP();
-
- // Vérifie le nombre d'utilisateur et mets à jour si besoin
- $this->verifNbUsers($this->countActiveUsers(),$this->getConfCP('nbUser'));
- return 1;
+ // Mets à jour les congés payés en début de mois
+ $this->updateSoldeCP();
+
+ // Vérifie le nombre d'utilisateur et mets à jour si besoin
+ $this->verifNbUsers($this->countActiveUsers(),$this->getConfCP('nbUser'));
+ return 1;
}
/**
diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php
index e5b609e36d1..e654dfe0117 100644
--- a/htdocs/holiday/define_holiday.php
+++ b/htdocs/holiday/define_holiday.php
@@ -74,10 +74,10 @@ if ($action == 'update' && isset($_POST['update_cp']))
// If it first update of sold, we set date to havoid to have sold incremented by new month
$now=dol_now();
- $sql = "UPDATE ".MAIN_DB_PREFIX."holiday_config SET";
- $sql.= " value = '".dol_print_date($now,'%Y%m%d%H%M%S')."'";
- $sql.= " WHERE name = 'lastUpdate' and value IS NULL"; // Add value IS NULL to be sure to update only at init.
- dol_syslog('define_holiday update lastUpdate entry sql='.$sql);
+ $sql = "UPDATE ".MAIN_DB_PREFIX."holiday_config SET";
+ $sql.= " value = '".dol_print_date($now,'%Y%m%d%H%M%S')."'";
+ $sql.= " WHERE name = 'lastUpdate' and value IS NULL"; // Add value IS NULL to be sure to update only at init.
+ dol_syslog('define_holiday update lastUpdate entry sql='.$sql);
$result = $db->query($sql);
$mesg=''.$langs->trans('UpdateConfCPOK').'
';
diff --git a/htdocs/holiday/index.php b/htdocs/holiday/index.php
index eb6d5dd5d7c..36f7afd87b1 100644
--- a/htdocs/holiday/index.php
+++ b/htdocs/holiday/index.php
@@ -30,11 +30,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php';
require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php';
-require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.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/usergroups.lib.php';
-$langs->load('users');
-$langs->load('holidays');
+$langs->load('users');
+$langs->load('holidays');
// Protection if external user
if ($user->societe_id > 0) accessforbidden();
@@ -79,7 +79,7 @@ $search_statut = GETPOST('select_statut');
$holiday = new Holiday($db);
$holidaystatic=new Holiday($db);
-$fuser = new User($db);
+$fuser = new User($db);
// Update sold
$holiday->updateSold();
@@ -165,12 +165,12 @@ if(!empty($search_statut) && $search_statut != -1) {
// Récupération de l'ID de l'utilisateur
$user_id = $user->id;
-if ($id > 0)
-{
- // Charge utilisateur edite
- $fuser->fetch($id);
+if ($id > 0)
+{
+ // Charge utilisateur edite
+ $fuser->fetch($id);
$fuser->getrights();
- $user_id = $fuser->id;
+ $user_id = $fuser->id;
}
// Récupération des congés payés de l'utilisateur ou de tous les users
if (!$user->rights->holiday->lire_tous || $id > 0)
@@ -197,38 +197,38 @@ if ($holiday_payes == '-1')
* Affichage du tableau des congés payés
*************************************/
-$var=true; $num = count($holiday->holiday);
-$form = new Form($db);
-$formother = new FormOther($db);
+$var=true; $num = count($holiday->holiday);
+$form = new Form($db);
+$formother = new FormOther($db);
if ($id > 0)
{
- $head = user_prepare_head($fuser);
-
- $title = $langs->trans("User");
+ $head = user_prepare_head($fuser);
+
+ $title = $langs->trans("User");
dol_fiche_head($head, 'paidholidays', $title, 0, 'user');
- print '';
-
- // Ref
- print ''.$langs->trans("Ref").' ';
- print '';
- print $form->showrefnav($fuser,'id','',$user->rights->user->user->lire || $user->admin);
- print ' ';
- print ' ';
-
- // LastName
- print ''.$langs->trans("LastName").' ';
- print ''.$fuser->lastname.' ';
- print " \n";
-
- // FirstName
- print ''.$langs->trans("FirstName").' ';
- print ''.$fuser->firstname.' ';
- print " \n";
-
- print '
';
-
+ print '';
+
+ // Ref
+ print ''.$langs->trans("Ref").' ';
+ print '';
+ print $form->showrefnav($fuser,'id','',$user->rights->user->user->lire || $user->admin);
+ print ' ';
+ print ' ';
+
+ // LastName
+ print ''.$langs->trans("LastName").' ';
+ print ''.$fuser->lastname.' ';
+ print " \n";
+
+ // FirstName
+ print ''.$langs->trans("FirstName").' ';
+ print ''.$fuser->firstname.' ';
+ print " \n";
+
+ print '
';
+
}
else
{
diff --git a/htdocs/install/etape5.php b/htdocs/install/etape5.php
index 0ae7303bf38..08651603e61 100644
--- a/htdocs/install/etape5.php
+++ b/htdocs/install/etape5.php
@@ -142,8 +142,8 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i',$action))
$db=getDoliDBInstance($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name,$conf->db->port);
- // Create the global $hookmanager object
- include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
+ // Create the global $hookmanager object
+ include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
$hookmanager=new HookManager($db);
$ok = 0;
diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php
index ad9af68a6b9..7d4a22fffa2 100644
--- a/htdocs/install/inc.php
+++ b/htdocs/install/inc.php
@@ -314,25 +314,25 @@ function conf($dolibarr_main_document_root)
//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');
- }
-
+ // 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');
+ }
+
if (empty($conf->loghandlers[$handler])) $conf->loghandlers[$handler]=$loghandlerinstance;
- }
+ }
return 1;
}
diff --git a/htdocs/install/upgrade.php b/htdocs/install/upgrade.php
index e04a3a94261..811f41f64e8 100644
--- a/htdocs/install/upgrade.php
+++ b/htdocs/install/upgrade.php
@@ -374,30 +374,30 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action')))
// Run sql script
$ok=run_sql($dir.$file, 0, '', 1);
- // Scan if there is migration scripts for modules htdocs/module/sql or htdocs/custom/module/sql
- $modulesfile = array();
- foreach ($conf->file->dol_document_root as $type => $dirroot)
- {
- $handlemodule=@opendir($dirroot);
- if (is_resource($handlemodule))
+ // Scan if there is migration scripts for modules htdocs/module/sql or htdocs/custom/module/sql
+ $modulesfile = array();
+ foreach ($conf->file->dol_document_root as $type => $dirroot)
+ {
+ $handlemodule=@opendir($dirroot);
+ if (is_resource($handlemodule))
{
- while (($filemodule = readdir($handlemodule))!==false)
- {
- if (is_dir($dirroot.'/'.$filemodule.'/sql'))
+ while (($filemodule = readdir($handlemodule))!==false)
+ {
+ if (is_dir($dirroot.'/'.$filemodule.'/sql'))
{
- //print "Scan for ".$dirroot . '/' . $filemodule . '/sql/'.$file;
- if (is_file($dirroot . '/' . $filemodule . '/sql/'.$file))
- {
- $modulesfile[$dirroot . '/' . $filemodule . '/sql/'.$file] = '/' . $filemodule . '/sql/'.$file;
- }
- }
- }
- closedir($handlemodule);
- }
- }
+ //print "Scan for ".$dirroot . '/' . $filemodule . '/sql/'.$file;
+ if (is_file($dirroot . '/' . $filemodule . '/sql/'.$file))
+ {
+ $modulesfile[$dirroot . '/' . $filemodule . '/sql/'.$file] = '/' . $filemodule . '/sql/'.$file;
+ }
+ }
+ }
+ closedir($handlemodule);
+ }
+ }
foreach ($modulesfile as $modulefilelong => $modulefileshort)
- {
+ {
print ' ';
print ''.$langs->trans("ChoosedMigrateScript").' (external modules) '.$modulefileshort.' '."\n";
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 88efcfd76b5..d94fcab199d 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -139,7 +139,7 @@ function analyse_sql_and_script(&$var, $type)
// Check consitency of NOREQUIREXXX DEFINES
-if ((defined('NOREQUIREDB') || defined('NOREQUIRETRAN')) && ! defined('NOREQUIREMENU')) dol_print_error('','If define NOREQUIREDB or NOREQUIRETRAN are set, you must also set NOREQUIREMENU or not use them');
+if ((defined('NOREQUIREDB') || defined('NOREQUIRETRAN')) && ! defined('NOREQUIREMENU')) dol_print_error('','If define NOREQUIREDB or NOREQUIRETRAN are set, you must also set NOREQUIREMENU or not use them');
// Sanity check on URL
if (! empty($_SERVER["PHP_SELF"]))
@@ -761,7 +761,7 @@ else
$heightforframes=52;
// Switch to another entity
-// TODO Multicompany Remove this
+// TODO Multicompany Remove this
if (! empty($conf->multicompany->enabled) && GETPOST('action') == 'switchentity')
{
if ($mc->switchEntity(GETPOST('entity','int')) > 0)
diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php
index 36f85c9524e..7212ea38f5b 100644
--- a/htdocs/master.inc.php
+++ b/htdocs/master.inc.php
@@ -76,7 +76,7 @@ if (! empty($dolibarr_main_document_root_alt))
}
// Set properties specific to multicompany
-// TODO Multicompany Remove this. Useless. Var should be read when required.
+// TODO Multicompany Remove this. Useless. Var should be read when required.
$conf->multicompany->transverse_mode = empty($multicompany_transverse_mode)?'':$multicompany_transverse_mode; // Force Multi-Company transverse mode
$conf->multicompany->force_entity = empty($multicompany_force_entity)?'':(int) $multicompany_force_entity; // Force entity in login page
@@ -143,7 +143,7 @@ if (! defined('NOREQUIREDB'))
{
$conf->entity = DOLENTITY;
}
- // TODO Multicompany Remove this.
+ // TODO Multicompany Remove this.
else if (! empty($conf->multicompany->force_entity) && is_int($conf->multicompany->force_entity)) // To force entity in login page
{
$conf->entity = $conf->multicompany->force_entity;
diff --git a/htdocs/product/index.php b/htdocs/product/index.php
index f0ab56ae6f0..8e3c3e795fd 100644
--- a/htdocs/product/index.php
+++ b/htdocs/product/index.php
@@ -69,7 +69,7 @@ print_fiche_titre($transAreaType);
//print '';
//print '';
-print '';
+print '
';
/*
@@ -160,7 +160,7 @@ print '
';
//print '';
-print '';
+print '
';
/*
@@ -259,7 +259,7 @@ else
}
//print '
';
-print '
';
+print '
';
llxFooter();
diff --git a/htdocs/product/stock/index.php b/htdocs/product/stock/index.php
index d544175b2fd..beb4c7829ba 100644
--- a/htdocs/product/stock/index.php
+++ b/htdocs/product/stock/index.php
@@ -45,7 +45,7 @@ print_fiche_titre($langs->trans("StocksArea"));
//print '';
//print '';
-print '';
+print '
';
/*
@@ -106,7 +106,7 @@ else
//print '
';
-print '';
+print '
';
// Last movements
@@ -164,7 +164,7 @@ if ($resql)
}
//print '
';
-print '
';
+print '
';
llxFooter();
diff --git a/htdocs/public/paybox/paymentko.php b/htdocs/public/paybox/paymentko.php
index 0b6635fa390..5afeab8d639 100644
--- a/htdocs/public/paybox/paymentko.php
+++ b/htdocs/public/paybox/paymentko.php
@@ -58,9 +58,9 @@ $langs->load("paypal");
dol_syslog("Callback url when a PayBox payment was canceled. query_string=".(empty($_SERVER["QUERY_STRING"])?'':$_SERVER["QUERY_STRING"])." script_uri=".(empty($_SERVER["SCRIPT_URI"])?'':$_SERVER["SCRIPT_URI"]), LOG_DEBUG, 0, '_paybox');
-$tracepost = "";
-foreach($_POST as $k => $v) $tracepost .= "{$k} - {$v}\n";
-dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_paybox');
+$tracepost = "";
+foreach($_POST as $k => $v) $tracepost .= "{$k} - {$v}\n";
+dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_paybox');
llxHeaderPayBox($langs->trans("PaymentForm"));
diff --git a/htdocs/public/paybox/paymentok.php b/htdocs/public/paybox/paymentok.php
index d46ae4f33a7..5553956ce82 100644
--- a/htdocs/public/paybox/paymentok.php
+++ b/htdocs/public/paybox/paymentok.php
@@ -57,9 +57,9 @@ $langs->load("paypal");
dol_syslog("Callback url when a PayBox payment was done. query_string=".(empty($_SERVER["QUERY_STRING"])?'':$_SERVER["QUERY_STRING"])." script_uri=".(empty($_SERVER["SCRIPT_URI"])?'':$_SERVER["SCRIPT_URI"]), LOG_DEBUG, 0, '_paybox');
-$tracepost = "";
-foreach($_POST as $k => $v) $tracepost .= "{$k} - {$v}\n";
-dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_paybox');
+$tracepost = "";
+foreach($_POST as $k => $v) $tracepost .= "{$k} - {$v}\n";
+dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_paybox');
llxHeaderPayBox($langs->trans("PaymentForm"));
diff --git a/htdocs/public/paypal/paymentko.php b/htdocs/public/paypal/paymentko.php
index 610e68c93e3..13c4718c361 100755
--- a/htdocs/public/paypal/paymentko.php
+++ b/htdocs/public/paypal/paymentko.php
@@ -66,9 +66,9 @@ $langs->load("paypal");
dol_syslog("Callback url when a PayPal payment was canceled. query_string=".(empty($_SERVER["QUERY_STRING"])?'':$_SERVER["QUERY_STRING"])." script_uri=".(empty($_SERVER["SCRIPT_URI"])?'':$_SERVER["SCRIPT_URI"]), LOG_DEBUG, 0, '_paypal');
-$tracepost = "";
-foreach($_POST as $k => $v) $tracepost .= "{$k} - {$v}\n";
-dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_paypal');
+$tracepost = "";
+foreach($_POST as $k => $v) $tracepost .= "{$k} - {$v}\n";
+dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_paypal');
llxHeaderPaypal($langs->trans("PaymentForm"));
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index ecf387e13c2..37b81403acd 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -82,9 +82,9 @@ class Societe extends CommonObject
var $idprof1; // IdProf1 (Ex: Siren in France)
var $idprof2; // IdProf2 (Ex: Siret in France)
var $idprof3; // IdProf3 (Ex: Ape in France)
- var $idprof4; // IdProf4 (Ex: RCS in France)
- var $idprof5; // IdProf5
- var $idprof6; // IdProf6
+ var $idprof4; // IdProf4 (Ex: RCS in France)
+ var $idprof5; // IdProf5
+ var $idprof6; // IdProf6
var $prefix_comm;
diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php
index 4f61d24a4aa..0edb8291677 100644
--- a/htdocs/societe/consumption.php
+++ b/htdocs/societe/consumption.php
@@ -70,9 +70,9 @@ if (GETPOST("button_removefilter"))
$thirdTypeSelect = GETPOST("third_select_id");
$type_element = GETPOST('type_element')?GETPOST('type_element'):'invoice';
-$langs->load("bills");
-$langs->load("orders");
-$langs->load("suppliers");
+$langs->load("bills");
+$langs->load("orders");
+$langs->load("suppliers");
/*
@@ -87,7 +87,7 @@ $langs->load("suppliers");
$form = new Form($db);
$formother = new FormOther($db);
-$productstatic=new Product($db);
+$productstatic=new Product($db);
$titre = $langs->trans("Referer",$object->name);
llxHeader('',$titre,'');
@@ -174,7 +174,7 @@ if ($type_element == 'order')
{
// TODO
-}
+}
if ($type_element == 'supplier_order')
{ // Supplier : Show products from orders.
$documentstatic=new CommandeFournisseur($db);
@@ -217,13 +217,13 @@ $sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($limit + 1, $offset);
-// Define type of elements
-$typeElementString = $form->selectarray("type_element",$elementTypeArray,GETPOST('type_element'));
-$button = ' ';
-$param="&sref=".$sref."&month=".$month."&year=".$year."&sprod_fulldescr=".$sprod_fulldescr."&socid=".$socid;
-
-print_barre_liste($langs->trans('ProductsIntoElements', $typeElementString.' '.$button), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, '', '');
-
+// Define type of elements
+$typeElementString = $form->selectarray("type_element",$elementTypeArray,GETPOST('type_element'));
+$button = ' ';
+$param="&sref=".$sref."&month=".$month."&year=".$year."&sprod_fulldescr=".$sprod_fulldescr."&socid=".$socid;
+
+print_barre_liste($langs->trans('ProductsIntoElements', $typeElementString.' '.$button), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, '', '');
+
if ($sql_select)
{
dol_syslog("sql=".$sql);
@@ -276,115 +276,115 @@ if ($sql_select)
print ' ';
// Define text, description and type
- $text=''; $description=''; $type=0;
+ $text=''; $description=''; $type=0;
- // Code to show product duplicated from commonobject->printObjectLine
- if ($objp->fk_product > 0)
- {
- $product_static = new Product($db);
-
- $product_static->type=$objp->fk_product_type;
- $product_static->id=$objp->fk_product;
- $product_static->ref=$objp->ref;
- $text=$product_static->getNomUrl(1);
+ // Code to show product duplicated from commonobject->printObjectLine
+ if ($objp->fk_product > 0)
+ {
+ $product_static = new Product($db);
+
+ $product_static->type=$objp->fk_product_type;
+ $product_static->id=$objp->fk_product;
+ $product_static->ref=$objp->ref;
+ $text=$product_static->getNomUrl(1);
}
- // Product
- if ($objp->fk_product > 0)
- {
- // Define output language
- if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE))
- {
- $this->fetch_thirdparty();
- $prod = new Product($db);
- $prod->fetch($objp->fk_product);
-
- $outputlangs = $langs;
- $newlang='';
- if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id');
- if (empty($newlang)) $newlang=$this->client->default_lang;
- if (! empty($newlang))
- {
- $outputlangs = new Translate("",$conf);
- $outputlangs->setDefaultLang($newlang);
- }
-
- $label = (! empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $objp->product_label;
- }
- else
- {
- $label = $objp->product_label;
- }
-
- $text.= ' - '.(! empty($objp->label)?$objp->label:$label);
- $description=(! empty($conf->global->PRODUIT_DESC_IN_FORM)?'':dol_htmlentitiesbr($objp->description));
+ // Product
+ if ($objp->fk_product > 0)
+ {
+ // Define output language
+ if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE))
+ {
+ $this->fetch_thirdparty();
+ $prod = new Product($db);
+ $prod->fetch($objp->fk_product);
+
+ $outputlangs = $langs;
+ $newlang='';
+ if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id');
+ if (empty($newlang)) $newlang=$this->client->default_lang;
+ if (! empty($newlang))
+ {
+ $outputlangs = new Translate("",$conf);
+ $outputlangs->setDefaultLang($newlang);
+ }
+
+ $label = (! empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $objp->product_label;
+ }
+ else
+ {
+ $label = $objp->product_label;
+ }
+
+ $text.= ' - '.(! empty($objp->label)?$objp->label:$label);
+ $description=(! empty($conf->global->PRODUIT_DESC_IN_FORM)?'':dol_htmlentitiesbr($objp->description));
}
- if (($objp->info_bits & 2) == 2) { ?>
-
- trans("ShowReduc"),'reduc').' ';
- if ($objp->description == '(DEPOSIT)') $txt=$langs->trans("Deposit");
- //else $txt=$langs->trans("Discount");
- print $txt;
- ?>
-
- description)
- {
- if ($objp->description == '(CREDIT_NOTE)' && $objp->fk_remise_except > 0)
- {
- $discount=new DiscountAbsolute($db);
- $discount->fetch($objp->fk_remise_except);
- echo ($txt?' - ':'').$langs->transnoentities("DiscountFromCreditNote",$discount->getNomUrl(0));
- }
- elseif ($objp->description == '(DEPOSIT)' && $objp->fk_remise_except > 0)
- {
- $discount=new DiscountAbsolute($db);
- $discount->fetch($objp->fk_remise_except);
- echo ($txt?' - ':'').$langs->transnoentities("DiscountFromDeposit",$discount->getNomUrl(0));
- // Add date of deposit
- if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) echo ' ('.dol_print_date($discount->datec).')';
- }
- else
- {
- echo ($txt?' - ':'').dol_htmlentitiesbr($objp->description);
- }
- }
- }
- else
- {
- if ($objp->fk_product > 0) {
-
- echo $form->textwithtooltip($text,$description,3,'','',$i,0,'');
-
- // Show range
- echo get_date_range($objp->date_start, $objp->date_end);
-
- // Add description in form
- if (! empty($conf->global->PRODUIT_DESC_IN_FORM))
- {
- print (! empty($objp->description) && $objp->description!=$objp->product_label)?' '.dol_htmlentitiesbr($objp->description):'';
- }
-
- } else {
-
- //if (! empty($objp->fk_parent_line)) echo img_picto('', 'rightarrow');
- if ($type==1) $text = img_object($langs->trans('Service'),'service');
- else $text = img_object($langs->trans('Product'),'product');
-
- if (! empty($objp->label)) {
- $text.= ' '.$objp->label.' ';
- echo $form->textwithtooltip($text,dol_htmlentitiesbr($objp->description),3,'','',$i,0,'');
- } else {
- echo $text.' '.dol_htmlentitiesbr($objp->description);
- }
-
- // Show range
- echo get_date_range($objp->date_start,$objp->date_end);
- }
- }
+ if (($objp->info_bits & 2) == 2) { ?>
+
+ trans("ShowReduc"),'reduc').' ';
+ if ($objp->description == '(DEPOSIT)') $txt=$langs->trans("Deposit");
+ //else $txt=$langs->trans("Discount");
+ print $txt;
+ ?>
+
+ description)
+ {
+ if ($objp->description == '(CREDIT_NOTE)' && $objp->fk_remise_except > 0)
+ {
+ $discount=new DiscountAbsolute($db);
+ $discount->fetch($objp->fk_remise_except);
+ echo ($txt?' - ':'').$langs->transnoentities("DiscountFromCreditNote",$discount->getNomUrl(0));
+ }
+ elseif ($objp->description == '(DEPOSIT)' && $objp->fk_remise_except > 0)
+ {
+ $discount=new DiscountAbsolute($db);
+ $discount->fetch($objp->fk_remise_except);
+ echo ($txt?' - ':'').$langs->transnoentities("DiscountFromDeposit",$discount->getNomUrl(0));
+ // Add date of deposit
+ if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) echo ' ('.dol_print_date($discount->datec).')';
+ }
+ else
+ {
+ echo ($txt?' - ':'').dol_htmlentitiesbr($objp->description);
+ }
+ }
+ }
+ else
+ {
+ if ($objp->fk_product > 0) {
+
+ echo $form->textwithtooltip($text,$description,3,'','',$i,0,'');
+
+ // Show range
+ echo get_date_range($objp->date_start, $objp->date_end);
+
+ // Add description in form
+ if (! empty($conf->global->PRODUIT_DESC_IN_FORM))
+ {
+ print (! empty($objp->description) && $objp->description!=$objp->product_label)?' '.dol_htmlentitiesbr($objp->description):'';
+ }
+
+ } else {
+
+ //if (! empty($objp->fk_parent_line)) echo img_picto('', 'rightarrow');
+ if ($type==1) $text = img_object($langs->trans('Service'),'service');
+ else $text = img_object($langs->trans('Product'),'product');
+
+ if (! empty($objp->label)) {
+ $text.= ' '.$objp->label.' ';
+ echo $form->textwithtooltip($text,dol_htmlentitiesbr($objp->description),3,'','',$i,0,'');
+ } else {
+ echo $text.' '.dol_htmlentitiesbr($objp->description);
+ }
+
+ // Show range
+ echo get_date_range($objp->date_start,$objp->date_end);
+ }
+ }
/*
$prodreftxt='';
@@ -396,16 +396,16 @@ if ($sql_select)
$prodreftxt = $productstatic->getNomUrl(0);
if(!empty($objp->product_label)) $prodreftxt .= ' - '.$objp->product_label;
}
- // Show range
- $prodreftxt .= get_date_range($objp->date_start, $objp->date_end);
- // Add description in form
- if (! empty($conf->global->PRODUIT_DESC_IN_FORM))
- {
- $prodreftxt .= (! empty($objp->description) && $objp->description!=$objp->product_label)?' '.dol_htmlentitiesbr($objp->description):'';
+ // Show range
+ $prodreftxt .= get_date_range($objp->date_start, $objp->date_end);
+ // Add description in form
+ if (! empty($conf->global->PRODUIT_DESC_IN_FORM))
+ {
+ $prodreftxt .= (! empty($objp->description) && $objp->description!=$objp->product_label)?' '.dol_htmlentitiesbr($objp->description):'';
}
*/
- print ' ';
-
+ print '';
+
//print ''.$prodreftxt.' ';
print ''.$objp->prod_qty.' ';
diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php
index e113ad7e0e1..74d8b74c4d4 100644
--- a/htdocs/societe/index.php
+++ b/htdocs/societe/index.php
@@ -51,7 +51,7 @@ print_fiche_titre($transAreaType);
//print '';
//print '';
-print '';
+print '
';
/*
@@ -152,7 +152,7 @@ print '
';
//print '';
-print '';
+print '
';
/*
diff --git a/htdocs/theme/bureau2crea/style.css.php b/htdocs/theme/bureau2crea/style.css.php
index 6f806f4594f..45e2285d44a 100644
--- a/htdocs/theme/bureau2crea/style.css.php
+++ b/htdocs/theme/bureau2crea/style.css.php
@@ -60,7 +60,7 @@ $fontsizesmaller=empty($conf->browser->phone)?'11':'11';
$fontlist='arial,tahoma,verdana,helvetica';
//$fontlist='Verdana,Helvetica,Arial,sans-serif';
-$path=''; // This value may be used in future for external module to overwrite theme
+$path=''; // This value may be used in future for external module to overwrite theme
$theme='bureau2crea'; // Value of theme
if (! empty($conf->global->MAIN_OVERWRITE_THEME_RES)) { $path='/'.$conf->global->MAIN_OVERWRITE_THEME_RES; $theme=$conf->global->MAIN_OVERWRITE_THEME_RES; }
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php
index 665f58b0b89..0cd62a11591 100644
--- a/htdocs/theme/eldy/style.css.php
+++ b/htdocs/theme/eldy/style.css.php
@@ -61,7 +61,7 @@ $left=($langs->trans("DIRECTION")=='rtl'?'right':'left');
$path=''; // This value may be used in future for external module to overwrite theme
$theme='eldy'; // Value of theme
-if (! empty($conf->global->MAIN_OVERWRITE_THEME_RES)) { $path='/'.$conf->global->MAIN_OVERWRITE_THEME_RES; $theme=$conf->global->MAIN_OVERWRITE_THEME_RES; }
+if (! empty($conf->global->MAIN_OVERWRITE_THEME_RES)) { $path='/'.$conf->global->MAIN_OVERWRITE_THEME_RES; $theme=$conf->global->MAIN_OVERWRITE_THEME_RES; }
// Define image path files
$fontlist='arial,tahoma,verdana,helvetica'; //$fontlist='Verdana,Helvetica,Arial,sans-serif';
diff --git a/htdocs/theme/phones/smartphone/tpl/menu.tpl.php b/htdocs/theme/phones/smartphone/tpl/menu.tpl.php
index 971dbc80885..d286345eada 100644
--- a/htdocs/theme/phones/smartphone/tpl/menu.tpl.php
+++ b/htdocs/theme/phones/smartphone/tpl/menu.tpl.php
@@ -15,14 +15,14 @@
* along with this program. If not, see .
*/
-// Load the smartphone menu manager
-$result=@include_once DOL_DOCUMENT_ROOT ."/core/menus/smartphone/".$conf->smart_menu;
-if (! $result) // If failed to include, we try with standard
-{
- $conf->smart_menu='smartphone_menu.php';
- include_once DOL_DOCUMENT_ROOT ."/core/menus/smartphone/".$conf->smart_menu;
-}
-$menusmart = new MenuSmart($db, $user->societe_id?1:0);
+// Load the smartphone menu manager
+$result=@include_once DOL_DOCUMENT_ROOT ."/core/menus/smartphone/".$conf->smart_menu;
+if (! $result) // If failed to include, we try with standard
+{
+ $conf->smart_menu='smartphone_menu.php';
+ include_once DOL_DOCUMENT_ROOT ."/core/menus/smartphone/".$conf->smart_menu;
+}
+$menusmart = new MenuSmart($db, $user->societe_id?1:0);
top_httphead();
diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index bd7095f4d03..c04f96b09db 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.php
@@ -913,10 +913,10 @@ class User extends CommonObject
$this->office_fax = $contact->fax;
$this->user_mobile = $contact->phone_mobile;
$this->address = $contact->address;
- $this->zip = $contact->zip;
- $this->town = $contact->town;
+ $this->zip = $contact->zip;
+ $this->town = $contact->town;
$this->state_id = $contact->state_id;
- $this->country_id = $contact->country_id;
+ $this->country_id = $contact->country_id;
if (empty($login)) $login=strtolower(substr($contact->firstname, 0, 4)) . strtolower(substr($contact->lastname, 0, 4));
$this->login = $login;
@@ -984,11 +984,11 @@ class User extends CommonObject
$this->email = $member->email;
$this->fk_member = $member->id;
$this->pass = $member->pass;
- $this->address = $member->address;
- $this->zip = $member->zip;
- $this->town = $member->town;
- $this->state_id = $member->state_id;
- $this->country_id = $member->country_id;
+ $this->address = $member->address;
+ $this->zip = $member->zip;
+ $this->town = $member->town;
+ $this->state_id = $member->state_id;
+ $this->country_id = $member->country_id;
if (empty($login)) $login=strtolower(substr($member->firstname, 0, 4)) . strtolower(substr($member->lastname, 0, 4));
$this->login = $login;
@@ -2108,205 +2108,205 @@ class User extends CommonObject
}
- /**
- * Return and array with all instanciated children users of current user
- *
- * @return void
- */
- function get_children()
- {
- $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."user";
- $sql.= " WHERE fk_user = ".$this->id;
+ /**
+ * Return and array with all instanciated children users of current user
+ *
+ * @return void
+ */
+ function get_children()
+ {
+ $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."user";
+ $sql.= " WHERE fk_user = ".$this->id;
- dol_syslog(get_class($this)."::get_children result=".$result, LOG_DEBUG);
- $res = $this->db->query($sql);
- if ($res)
- {
- $users = array ();
- while ($rec = $this->db->fetch_array($res))
- {
- $user = new User($this->db);
- $user->fetch($rec['rowid']);
- $users[] = $user;
- }
- return $users;
- }
- else
- {
- dol_print_error($this->db);
- return -1;
- }
- }
-
-
- /**
- * Load this->parentof that is array(id_son=>id_parent, ...)
- *
- * @return int <0 if KO, >0 if OK
- */
- private function load_parentof()
- {
- global $conf;
-
- $this->parentof=array();
-
- // Load array[child]=parent
- $sql = "SELECT fk_user as id_parent, rowid as id_son";
- $sql.= " FROM ".MAIN_DB_PREFIX."user";
- $sql.= " WHERE fk_user != 0";
- $sql.= " AND entity = ".$conf->entity;
-
- dol_syslog(get_class($this)."::load_parentof sql=".$sql);
- $resql = $this->db->query($sql);
- if ($resql)
- {
- while ($obj= $this->db->fetch_object($resql))
- {
- $this->parentof[$obj->id_son]=$obj->id_parent;
- }
- return 1;
- }
- else
- {
- dol_print_error($this->db);
- return -1;
- }
- }
-
- /**
- * Reconstruit l'arborescence hierarchique des users sous la forme d'un tableau
- * Renvoi un tableau de tableau('id','id_parent',...) trie selon arbre et avec:
- * id = id du user
- * id_parent = id du user parent
- * id_children = tableau des id enfant
- * name = nom du user
- * fullname = nom avec chemin complet du user
- * fullpath = chemin complet compose des id
- *
- * @param int $markafterid Removed all users including the leaf $markafterid in user tree.
- * @return array Array of users. this->users and this->parentof are set.
- */
- function get_full_tree($markafterid=0)
- {
- $this->users = array();
-
- // Init this->parentof that is array(id_son=>id_parent, ...)
- $this->load_parentof();
-
- // Init $this->users array
- $sql = "SELECT DISTINCT u.rowid, u.firstname, u.lastname, u.fk_user, u.login, u.statut"; // Distinct reduce pb with old tables with duplicates
- $sql.= " FROM ".MAIN_DB_PREFIX."user as u";
- $sql.= " WHERE u.entity IN (".getEntity('user',1).")";
-
- dol_syslog(get_class($this)."::get_full_tree get user list sql=".$sql, LOG_DEBUG);
- $resql = $this->db->query($sql);
- if ($resql)
- {
- $i=0;
- while ($obj = $this->db->fetch_object($resql))
- {
- $this->users[$obj->rowid]['rowid'] = $obj->rowid;
- $this->users[$obj->rowid]['id'] = $obj->rowid;
- $this->users[$obj->rowid]['fk_user'] = $obj->fk_user;
- $this->users[$obj->rowid]['firstname'] = $obj->firstname;
- $this->users[$obj->rowid]['lastname'] = $obj->lastname;
+ dol_syslog(get_class($this)."::get_children result=".$result, LOG_DEBUG);
+ $res = $this->db->query($sql);
+ if ($res)
+ {
+ $users = array ();
+ while ($rec = $this->db->fetch_array($res))
+ {
+ $user = new User($this->db);
+ $user->fetch($rec['rowid']);
+ $users[] = $user;
+ }
+ return $users;
+ }
+ else
+ {
+ dol_print_error($this->db);
+ return -1;
+ }
+ }
+
+
+ /**
+ * Load this->parentof that is array(id_son=>id_parent, ...)
+ *
+ * @return int <0 if KO, >0 if OK
+ */
+ private function load_parentof()
+ {
+ global $conf;
+
+ $this->parentof=array();
+
+ // Load array[child]=parent
+ $sql = "SELECT fk_user as id_parent, rowid as id_son";
+ $sql.= " FROM ".MAIN_DB_PREFIX."user";
+ $sql.= " WHERE fk_user != 0";
+ $sql.= " AND entity = ".$conf->entity;
+
+ dol_syslog(get_class($this)."::load_parentof sql=".$sql);
+ $resql = $this->db->query($sql);
+ if ($resql)
+ {
+ while ($obj= $this->db->fetch_object($resql))
+ {
+ $this->parentof[$obj->id_son]=$obj->id_parent;
+ }
+ return 1;
+ }
+ else
+ {
+ dol_print_error($this->db);
+ return -1;
+ }
+ }
+
+ /**
+ * Reconstruit l'arborescence hierarchique des users sous la forme d'un tableau
+ * Renvoi un tableau de tableau('id','id_parent',...) trie selon arbre et avec:
+ * id = id du user
+ * id_parent = id du user parent
+ * id_children = tableau des id enfant
+ * name = nom du user
+ * fullname = nom avec chemin complet du user
+ * fullpath = chemin complet compose des id
+ *
+ * @param int $markafterid Removed all users including the leaf $markafterid in user tree.
+ * @return array Array of users. this->users and this->parentof are set.
+ */
+ function get_full_tree($markafterid=0)
+ {
+ $this->users = array();
+
+ // Init this->parentof that is array(id_son=>id_parent, ...)
+ $this->load_parentof();
+
+ // Init $this->users array
+ $sql = "SELECT DISTINCT u.rowid, u.firstname, u.lastname, u.fk_user, u.login, u.statut"; // Distinct reduce pb with old tables with duplicates
+ $sql.= " FROM ".MAIN_DB_PREFIX."user as u";
+ $sql.= " WHERE u.entity IN (".getEntity('user',1).")";
+
+ dol_syslog(get_class($this)."::get_full_tree get user list sql=".$sql, LOG_DEBUG);
+ $resql = $this->db->query($sql);
+ if ($resql)
+ {
+ $i=0;
+ while ($obj = $this->db->fetch_object($resql))
+ {
+ $this->users[$obj->rowid]['rowid'] = $obj->rowid;
+ $this->users[$obj->rowid]['id'] = $obj->rowid;
+ $this->users[$obj->rowid]['fk_user'] = $obj->fk_user;
+ $this->users[$obj->rowid]['firstname'] = $obj->firstname;
+ $this->users[$obj->rowid]['lastname'] = $obj->lastname;
$this->users[$obj->rowid]['login'] = $obj->login;
$this->users[$obj->rowid]['statut'] = $obj->statut;
- $i++;
- }
- }
- else
- {
- dol_print_error($this->db);
- return -1;
- }
-
- // We add the fullpath property to each elements of first level (no parent exists)
- dol_syslog(get_class($this)."::get_full_tree call to build_path_from_id_user", LOG_DEBUG);
- foreach($this->users as $key => $val)
- {
- $this->build_path_from_id_user($key,0); // Process a branch from the root user key (this user has no parent)
- }
-
- // Exclude leaf including $markafterid from tree
- if ($markafterid)
- {
- //print "Look to discard user ".$markafterid."\n";
- $keyfilter1='^'.$markafterid.'$';
- $keyfilter2='_'.$markafterid.'$';
- $keyfilter3='^'.$markafterid.'_';
- $keyfilter4='_'.$markafterid.'_';
- foreach($this->users as $key => $val)
- {
- if (preg_match('/'.$keyfilter1.'/',$val['fullpath']) || preg_match('/'.$keyfilter2.'/',$val['fullpath'])
- || preg_match('/'.$keyfilter3.'/',$val['fullpath']) || preg_match('/'.$keyfilter4.'/',$val['fullpath']))
- {
- unset($this->users[$key]);
- }
- }
- }
-
- dol_syslog(get_class($this)."::get_full_tree dol_sort_array", LOG_DEBUG);
- $this->users=dol_sort_array($this->users, 'fullname', 'asc', true, false);
-
- //$this->debug_users();
-
- return $this->users;
- }
-
- /**
- * For user id_user and its childs available in this->users, define property fullpath and fullname
- *
- * @param int $id_user id_user entry to update
- * @param int $protection Deep counter to avoid infinite loop
- * @return void
- */
- function build_path_from_id_user($id_user,$protection=1000)
- {
- dol_syslog(get_class($this)."::build_path_from_id_user id_user=".$id_user." protection=".$protection, LOG_DEBUG);
-
- if (! empty($this->users[$id_user]['fullpath']))
- {
- // Already defined
- dol_syslog(get_class($this)."::build_path_from_id_user fullpath and fullname already defined", LOG_WARNING);
- return;
- }
-
- // Define fullpath and fullname
- $this->users[$id_user]['fullpath'] = '_'.$id_user;
- $this->users[$id_user]['fullname'] = $this->users[$id_user]['label'];
- $i=0; $cursor_user=$id_user;
-
- while ((empty($protection) || $i < $protection) && ! empty($this->parentof[$cursor_user]))
- {
- $this->users[$id_user]['fullpath'] = '_'.$this->parentof[$cursor_user].$this->users[$id_user]['fullpath'];
- $this->users[$id_user]['fullname'] = $this->users[$this->parentof[$cursor_user]]['label'].' >> '.$this->users[$id_user]['fullname'];
- $i++; $cursor_user=$this->parentof[$cursor_user];
- }
-
- // We count number of _ to have level
- $this->users[$id_user]['level']=dol_strlen(preg_replace('/[^_]/i','',$this->users[$id_user]['fullpath']));
-
- return;
- }
-
- /**
- * Affiche contenu de $this->users
- *
- * @return void
- */
- function debug_users()
- {
- // Affiche $this->users
- foreach($this->users as $key => $val)
- {
- print 'id: '.$this->users[$key]['id'];
- print ' name: '.$this->users[$key]['name'];
- print ' parent: '.$this->users[$key]['fk_user'];
- print ' fullpath: '.$this->users[$key]['fullpath'];
- print ' fullname: '.$this->users[$key]['fullname'];
- print " \n";
- }
+ $i++;
+ }
+ }
+ else
+ {
+ dol_print_error($this->db);
+ return -1;
+ }
+
+ // We add the fullpath property to each elements of first level (no parent exists)
+ dol_syslog(get_class($this)."::get_full_tree call to build_path_from_id_user", LOG_DEBUG);
+ foreach($this->users as $key => $val)
+ {
+ $this->build_path_from_id_user($key,0); // Process a branch from the root user key (this user has no parent)
+ }
+
+ // Exclude leaf including $markafterid from tree
+ if ($markafterid)
+ {
+ //print "Look to discard user ".$markafterid."\n";
+ $keyfilter1='^'.$markafterid.'$';
+ $keyfilter2='_'.$markafterid.'$';
+ $keyfilter3='^'.$markafterid.'_';
+ $keyfilter4='_'.$markafterid.'_';
+ foreach($this->users as $key => $val)
+ {
+ if (preg_match('/'.$keyfilter1.'/',$val['fullpath']) || preg_match('/'.$keyfilter2.'/',$val['fullpath'])
+ || preg_match('/'.$keyfilter3.'/',$val['fullpath']) || preg_match('/'.$keyfilter4.'/',$val['fullpath']))
+ {
+ unset($this->users[$key]);
+ }
+ }
+ }
+
+ dol_syslog(get_class($this)."::get_full_tree dol_sort_array", LOG_DEBUG);
+ $this->users=dol_sort_array($this->users, 'fullname', 'asc', true, false);
+
+ //$this->debug_users();
+
+ return $this->users;
+ }
+
+ /**
+ * For user id_user and its childs available in this->users, define property fullpath and fullname
+ *
+ * @param int $id_user id_user entry to update
+ * @param int $protection Deep counter to avoid infinite loop
+ * @return void
+ */
+ function build_path_from_id_user($id_user,$protection=1000)
+ {
+ dol_syslog(get_class($this)."::build_path_from_id_user id_user=".$id_user." protection=".$protection, LOG_DEBUG);
+
+ if (! empty($this->users[$id_user]['fullpath']))
+ {
+ // Already defined
+ dol_syslog(get_class($this)."::build_path_from_id_user fullpath and fullname already defined", LOG_WARNING);
+ return;
+ }
+
+ // Define fullpath and fullname
+ $this->users[$id_user]['fullpath'] = '_'.$id_user;
+ $this->users[$id_user]['fullname'] = $this->users[$id_user]['label'];
+ $i=0; $cursor_user=$id_user;
+
+ while ((empty($protection) || $i < $protection) && ! empty($this->parentof[$cursor_user]))
+ {
+ $this->users[$id_user]['fullpath'] = '_'.$this->parentof[$cursor_user].$this->users[$id_user]['fullpath'];
+ $this->users[$id_user]['fullname'] = $this->users[$this->parentof[$cursor_user]]['label'].' >> '.$this->users[$id_user]['fullname'];
+ $i++; $cursor_user=$this->parentof[$cursor_user];
+ }
+
+ // We count number of _ to have level
+ $this->users[$id_user]['level']=dol_strlen(preg_replace('/[^_]/i','',$this->users[$id_user]['fullpath']));
+
+ return;
+ }
+
+ /**
+ * Affiche contenu de $this->users
+ *
+ * @return void
+ */
+ function debug_users()
+ {
+ // Affiche $this->users
+ foreach($this->users as $key => $val)
+ {
+ print 'id: '.$this->users[$key]['id'];
+ print ' name: '.$this->users[$key]['name'];
+ print ' parent: '.$this->users[$key]['fk_user'];
+ print ' fullpath: '.$this->users[$key]['fullpath'];
+ print ' fullname: '.$this->users[$key]['fullname'];
+ print " \n";
+ }
}
}
diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php
index 0d2586c9639..a614416dcf8 100644
--- a/htdocs/user/fiche.php
+++ b/htdocs/user/fiche.php
@@ -682,7 +682,7 @@ if (($action == 'create') || ($action == 'adduserldap'))
print ' ';
}
- print dol_set_focus('#lastname');
+ print dol_set_focus('#lastname');
print '
';
-
+
// openid
if (isset($conf->authmode) && preg_match('/myopenid/',$conf->authmode))
{
@@ -1832,10 +1832,10 @@ else
print '';
}
- // Hierarchy
- print '