";
diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php
index ad0da9451e9..d0b59b67dd7 100644
--- a/htdocs/core/boxes/box_activity.php
+++ b/htdocs/core/boxes/box_activity.php
@@ -42,21 +42,21 @@ class box_activity extends ModeleBoxes
var $info_box_contents = array();
- /**
- * Constructor
- *
- * @param DoliDB $db Database handler
- * @param string $param More parameters
- */
- function __construct($db,$param)
- {
- global $conf;
-
- $this->db=$db;
+ /**
+ * Constructor
+ *
+ * @param DoliDB $db Database handler
+ * @param string $param More parameters
+ */
+ function __construct($db,$param)
+ {
+ global $conf;
+
+ $this->db=$db;
// FIXME: Use a cache to save data because this slow down too much main home page. This box slow down too seriously software.
// FIXME: Removed number_format (not compatible with all languages)
// FIXME: Pb into some status
- $this->enabled=$conf->global->MAIN_FEATURES_LEVEL; // Not enabled by default due to bugs (see previous FIXME)
+ $this->enabled=$conf->global->MAIN_FEATURES_LEVEL; // Not enabled by default due to bugs (see previous FIXME)
}
/**
diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php
index 3ec5add8a05..5bce26306f3 100644
--- a/htdocs/core/boxes/box_graph_invoices_permonth.php
+++ b/htdocs/core/boxes/box_graph_invoices_permonth.php
@@ -39,18 +39,18 @@ class box_graph_invoices_permonth extends ModeleBoxes
var $info_box_contents = array();
- /**
- * Constructor
- *
- * @param DoliDB $db Database handler
- * @param string $param More parameters
- */
- function __construct($db,$param)
+ /**
+ * Constructor
+ *
+ * @param DoliDB $db Database handler
+ * @param string $param More parameters
+ */
+ function __construct($db,$param)
{
global $conf;
-
- $this->db=$db;
- $this->enabled=$conf->global->MAIN_FEATURES_LEVEL;
+
+ $this->db=$db;
+ $this->enabled=$conf->global->MAIN_FEATURES_LEVEL;
}
/**
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 2cbf113b362..419174a31dc 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -81,24 +81,24 @@ abstract class CommonObject
return dol_trunc($ret,$maxlen);
}
- /**
- * Return full address of contact
- *
- * @param int $withcountry 1=Add country into address string
- * @param string $sep Separator to use to build string
- * @return string Full address string
- */
- function getFullAddress($withcountry=0,$sep="\n")
- {
- if ($withcountry && $this->country_id && (empty($this->country_code) || empty($this->country)))
- {
- require_once DOL_DOCUMENT_ROOT .'/core/lib/company.lib.php';
- $tmparray=getCountry($this->country_id,'all');
- $this->country_code=$tmparray['code'];
- $this->country =$tmparray['label'];
- }
+ /**
+ * Return full address of contact
+ *
+ * @param int $withcountry 1=Add country into address string
+ * @param string $sep Separator to use to build string
+ * @return string Full address string
+ */
+ function getFullAddress($withcountry=0,$sep="\n")
+ {
+ if ($withcountry && $this->country_id && (empty($this->country_code) || empty($this->country)))
+ {
+ require_once DOL_DOCUMENT_ROOT .'/core/lib/company.lib.php';
+ $tmparray=getCountry($this->country_id,'all');
+ $this->country_code=$tmparray['code'];
+ $this->country =$tmparray['label'];
+ }
- return dol_format_address($this, $withcountry, $sep);
+ return dol_format_address($this, $withcountry, $sep);
}
/**
diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php
index a7a8fe04903..4ce1bbf8c3d 100644
--- a/htdocs/core/class/conf.class.php
+++ b/htdocs/core/class/conf.class.php
@@ -63,11 +63,11 @@ class Conf
//! Used to store list of entities to use for each element
public $entities = array();
- public $dol_hide_topmenu; // Set if we force param dol_hide_topmenu into login url
- public $dol_hide_leftmenu; // Set if we force param dol_hide_leftmenu into login url
- public $dol_optimize_smallscreen; // Set if we force param dol_optimize_smallscreen into login url or if browser is smartphone
- public $dol_no_mouse_hover; // Set if we force param dol_no_mouse_hover into login url or if browser is smartphone
- public $dol_use_jmobile; // Set if we force param dol_use_jmobile into login url
+ public $dol_hide_topmenu; // Set if we force param dol_hide_topmenu into login url
+ public $dol_hide_leftmenu; // Set if we force param dol_hide_leftmenu into login url
+ public $dol_optimize_smallscreen; // Set if we force param dol_optimize_smallscreen into login url or if browser is smartphone
+ public $dol_no_mouse_hover; // Set if we force param dol_no_mouse_hover into login url or if browser is smartphone
+ public $dol_use_jmobile; // Set if we force param dol_use_jmobile into login url
/**
diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php
index 58c7063e40a..43722bb59f2 100755
--- a/htdocs/core/class/hookmanager.class.php
+++ b/htdocs/core/class/hookmanager.class.php
@@ -166,8 +166,8 @@ class HookManager
}
}
- if (is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results);
- if (! empty($actionclassinstance->resprints)) $this->resPrint.=$actionclassinstance->resprints;
+ if (is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results);
+ if (! empty($actionclassinstance->resprints)) $this->resPrint.=$actionclassinstance->resprints;
}
// Generic hooks that return a string or array (printSearchForm, printLeftBlock, printTopRightMenu, formAddObjectLine, formBuilddocOptions, ...)
else
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 6501dd94ef8..d68d9c8d59f 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -702,13 +702,13 @@ class Form
$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;
- }
+ 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;
+ }
>>>>>>> refs/remotes/origin/3.3
// mode=1 means customers products
$ajaxoptions=array();
diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php
index b7477c203f5..ef8422a7dbc 100644
--- a/htdocs/core/class/html.formactions.class.php
+++ b/htdocs/core/class/html.formactions.class.php
@@ -230,7 +230,7 @@ class FormActions
//asort($arraylist);
if ($selected == 'manual') $selected='AC_OTH';
- if ($selected == 'auto') $selected='AC_OTH_AUTO';
+ if ($selected == 'auto') $selected='AC_OTH_AUTO';
print $form->selectarray($htmlname, $arraylist, $selected);
if ($user->admin && empty($onlyautoornot)) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index 5d2fbf4f225..f8f2503c9a7 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -383,18 +383,18 @@ class FormFile
$buttonlabeltoshow=$buttonlabel;
if (empty($buttonlabel)) $buttonlabel=$langs->trans('Generate');
-
-// Keep this. Used for test with jmobile
-/*print '
-
-';*/
+
+// Keep this. Used for test with jmobile
+/*print '
+
+';*/
if (empty($noform)) $out.= '
\n";
diff --git a/htdocs/core/lib/barcode.lib.php b/htdocs/core/lib/barcode.lib.php
index 67b51748d3e..83d161a20a0 100644
--- a/htdocs/core/lib/barcode.lib.php
+++ b/htdocs/core/lib/barcode.lib.php
@@ -253,7 +253,7 @@ function barcode_encode_genbarcode($code,$encoding)
$command=escapeshellarg($genbarcode_loc);
//$paramclear=" \"".str_replace("\"", "\\\"",$code)."\" \"".str_replace("\"", "\\\"",strtoupper($encoding))."\"";
- $paramclear=" ".escapeshellarg($code)." ".escapeshellarg(strtoupper($encoding));
+ $paramclear=" ".escapeshellarg($code)." ".escapeshellarg(strtoupper($encoding));
$fullcommandclear=$command." ".$paramclear." 2>&1";
//print $fullcommandclear." \n";exit;
diff --git a/htdocs/core/lib/contact.lib.php b/htdocs/core/lib/contact.lib.php
index bbbce42315b..96da640962d 100644
--- a/htdocs/core/lib/contact.lib.php
+++ b/htdocs/core/lib/contact.lib.php
@@ -66,11 +66,11 @@ function contact_prepare_head($object)
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'contact');
- // Notes
- $head[$h][0] = DOL_URL_ROOT.'/contact/note.php?id='.$object->id;
- $head[$h][1] = $langs->trans("Note");
- $head[$h][2] = 'note';
- $h++;
+ // Notes
+ $head[$h][0] = DOL_URL_ROOT.'/contact/note.php?id='.$object->id;
+ $head[$h][1] = $langs->trans("Note");
+ $head[$h][2] = 'note';
+ $h++;
// Info
$head[$h][0] = DOL_URL_ROOT.'/contact/info.php?id='.$object->id;
diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php
index 1845334e6e9..b2073ff314f 100644
--- a/htdocs/core/lib/files.lib.php
+++ b/htdocs/core/lib/files.lib.php
@@ -1251,175 +1251,175 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$re
$sqlprotectagainstexternals='';
$ret=array();
- // find the subdirectory name as the reference
+ // find the subdirectory name as the reference
if (empty($refname)) $refname=basename(dirname($original_file)."/");
// Wrapping for some images
- if ($modulepart == 'companylogo')
- {
- $accessallowed=1;
- $original_file=$conf->mycompany->dir_output.'/logos/'.$original_file;
- }
- // Wrapping for users photos
- elseif ($modulepart == 'userphoto')
- {
- $accessallowed=1;
- $original_file=$conf->user->dir_output.'/'.$original_file;
- }
- // Wrapping for members photos
- elseif ($modulepart == 'memberphoto')
- {
- $accessallowed=1;
- $original_file=$conf->adherent->dir_output.'/'.$original_file;
+ if ($modulepart == 'companylogo')
+ {
+ $accessallowed=1;
+ $original_file=$conf->mycompany->dir_output.'/logos/'.$original_file;
}
- // Wrapping pour les apercu factures
- elseif ($modulepart == 'apercufacture')
- {
- if ($user->rights->facture->lire) $accessallowed=1;
- $original_file=$conf->facture->dir_output.'/'.$original_file;
- }
- // Wrapping pour les apercu propal
- elseif ($modulepart == 'apercupropal')
- {
- if ($user->rights->propale->lire) $accessallowed=1;
- $original_file=$conf->propal->dir_output.'/'.$original_file;
- }
- // Wrapping pour les apercu commande
- elseif ($modulepart == 'apercucommande')
- {
- if ($user->rights->commande->lire) $accessallowed=1;
- $original_file=$conf->commande->dir_output.'/'.$original_file;
- }
- // Wrapping pour les apercu intervention
- elseif ($modulepart == 'apercufichinter')
- {
- if ($user->rights->ficheinter->lire) $accessallowed=1;
- $original_file=$conf->ficheinter->dir_output.'/'.$original_file;
- }
- // Wrapping pour les images des stats propales
- elseif ($modulepart == 'propalstats')
- {
- if ($user->rights->propale->lire) $accessallowed=1;
- $original_file=$conf->propal->dir_temp.'/'.$original_file;
- }
- // Wrapping pour les images des stats commandes
- elseif ($modulepart == 'orderstats')
- {
- if ($user->rights->commande->lire) $accessallowed=1;
- $original_file=$conf->commande->dir_temp.'/'.$original_file;
- }
- elseif ($modulepart == 'orderstatssupplier')
- {
- if ($user->rights->fournisseur->commande->lire) $accessallowed=1;
- $original_file=$conf->fournisseur->dir_output.'/commande/temp/'.$original_file;
- }
- // Wrapping pour les images des stats factures
- elseif ($modulepart == 'billstats')
- {
- if ($user->rights->facture->lire) $accessallowed=1;
- $original_file=$conf->facture->dir_temp.'/'.$original_file;
- }
- elseif ($modulepart == 'billstatssupplier')
- {
- if ($user->rights->fournisseur->facture->lire) $accessallowed=1;
- $original_file=$conf->fournisseur->dir_output.'/facture/temp/'.$original_file;
- }
- // Wrapping pour les images des stats expeditions
- elseif ($modulepart == 'expeditionstats')
- {
- if ($user->rights->expedition->lire) $accessallowed=1;
- $original_file=$conf->expedition->dir_temp.'/'.$original_file;
- }
- // Wrapping pour les images des stats expeditions
- elseif ($modulepart == 'tripsexpensesstats')
- {
- if ($user->rights->deplacement->lire) $accessallowed=1;
- $original_file=$conf->deplacement->dir_temp.'/'.$original_file;
- }
- // Wrapping pour les images des stats expeditions
- elseif ($modulepart == 'memberstats')
- {
- if ($user->rights->adherent->lire) $accessallowed=1;
- $original_file=$conf->adherent->dir_temp.'/'.$original_file;
- }
- // Wrapping pour les images des stats produits
- elseif (preg_match('/^productstats_/i',$modulepart))
- {
- if ($user->rights->produit->lire || $user->rights->service->lire) $accessallowed=1;
- $original_file=(!empty($conf->product->multidir_temp[$entity])?$conf->product->multidir_temp[$entity]:$conf->service->multidir_temp[$entity]).'/'.$original_file;
- }
- // Wrapping for products or services
- elseif ($modulepart == 'tax')
- {
- if ($user->rights->tax->charges->lire) $accessallowed=1;
- $original_file=$conf->tax->dir_output.'/'.$original_file;
- }
- // Wrapping for products or services
- elseif ($modulepart == 'actions')
- {
- if ($user->rights->agenda->myactions->read) $accessallowed=1;
- $original_file=$conf->agenda->dir_output.'/'.$original_file;
- }
- // Wrapping for categories
- elseif ($modulepart == 'category')
- {
- if ($user->rights->categorie->lire) $accessallowed=1;
- $original_file=$conf->categorie->multidir_output[$entity].'/'.$original_file;
- }
- // Wrapping pour les prelevements
- elseif ($modulepart == 'prelevement')
+ // Wrapping for users photos
+ elseif ($modulepart == 'userphoto')
+ {
+ $accessallowed=1;
+ $original_file=$conf->user->dir_output.'/'.$original_file;
+ }
+ // Wrapping for members photos
+ elseif ($modulepart == 'memberphoto')
+ {
+ $accessallowed=1;
+ $original_file=$conf->adherent->dir_output.'/'.$original_file;
+ }
+ // Wrapping pour les apercu factures
+ elseif ($modulepart == 'apercufacture')
+ {
+ if ($user->rights->facture->lire) $accessallowed=1;
+ $original_file=$conf->facture->dir_output.'/'.$original_file;
+ }
+ // Wrapping pour les apercu propal
+ elseif ($modulepart == 'apercupropal')
+ {
+ if ($user->rights->propale->lire) $accessallowed=1;
+ $original_file=$conf->propal->dir_output.'/'.$original_file;
+ }
+ // Wrapping pour les apercu commande
+ elseif ($modulepart == 'apercucommande')
+ {
+ if ($user->rights->commande->lire) $accessallowed=1;
+ $original_file=$conf->commande->dir_output.'/'.$original_file;
+ }
+ // Wrapping pour les apercu intervention
+ elseif ($modulepart == 'apercufichinter')
+ {
+ if ($user->rights->ficheinter->lire) $accessallowed=1;
+ $original_file=$conf->ficheinter->dir_output.'/'.$original_file;
+ }
+ // Wrapping pour les images des stats propales
+ elseif ($modulepart == 'propalstats')
+ {
+ if ($user->rights->propale->lire) $accessallowed=1;
+ $original_file=$conf->propal->dir_temp.'/'.$original_file;
+ }
+ // Wrapping pour les images des stats commandes
+ elseif ($modulepart == 'orderstats')
+ {
+ if ($user->rights->commande->lire) $accessallowed=1;
+ $original_file=$conf->commande->dir_temp.'/'.$original_file;
+ }
+ elseif ($modulepart == 'orderstatssupplier')
+ {
+ if ($user->rights->fournisseur->commande->lire) $accessallowed=1;
+ $original_file=$conf->fournisseur->dir_output.'/commande/temp/'.$original_file;
+ }
+ // Wrapping pour les images des stats factures
+ elseif ($modulepart == 'billstats')
+ {
+ if ($user->rights->facture->lire) $accessallowed=1;
+ $original_file=$conf->facture->dir_temp.'/'.$original_file;
+ }
+ elseif ($modulepart == 'billstatssupplier')
+ {
+ if ($user->rights->fournisseur->facture->lire) $accessallowed=1;
+ $original_file=$conf->fournisseur->dir_output.'/facture/temp/'.$original_file;
+ }
+ // Wrapping pour les images des stats expeditions
+ elseif ($modulepart == 'expeditionstats')
+ {
+ if ($user->rights->expedition->lire) $accessallowed=1;
+ $original_file=$conf->expedition->dir_temp.'/'.$original_file;
+ }
+ // Wrapping pour les images des stats expeditions
+ elseif ($modulepart == 'tripsexpensesstats')
+ {
+ if ($user->rights->deplacement->lire) $accessallowed=1;
+ $original_file=$conf->deplacement->dir_temp.'/'.$original_file;
+ }
+ // Wrapping pour les images des stats expeditions
+ elseif ($modulepart == 'memberstats')
+ {
+ if ($user->rights->adherent->lire) $accessallowed=1;
+ $original_file=$conf->adherent->dir_temp.'/'.$original_file;
+ }
+ // Wrapping pour les images des stats produits
+ elseif (preg_match('/^productstats_/i',$modulepart))
+ {
+ if ($user->rights->produit->lire || $user->rights->service->lire) $accessallowed=1;
+ $original_file=(!empty($conf->product->multidir_temp[$entity])?$conf->product->multidir_temp[$entity]:$conf->service->multidir_temp[$entity]).'/'.$original_file;
+ }
+ // Wrapping for products or services
+ elseif ($modulepart == 'tax')
+ {
+ if ($user->rights->tax->charges->lire) $accessallowed=1;
+ $original_file=$conf->tax->dir_output.'/'.$original_file;
+ }
+ // Wrapping for products or services
+ elseif ($modulepart == 'actions')
+ {
+ if ($user->rights->agenda->myactions->read) $accessallowed=1;
+ $original_file=$conf->agenda->dir_output.'/'.$original_file;
+ }
+ // Wrapping for categories
+ elseif ($modulepart == 'category')
+ {
+ if ($user->rights->categorie->lire) $accessallowed=1;
+ $original_file=$conf->categorie->multidir_output[$entity].'/'.$original_file;
+ }
+ // Wrapping pour les prelevements
+ elseif ($modulepart == 'prelevement')
{
if ($user->rights->prelevement->bons->lire || preg_match('/^specimen/i',$original_file))
{
$accessallowed=1;
}
- $original_file=$conf->prelevement->dir_output.'/'.$original_file;
- }
- // Wrapping pour les graph energie
- elseif ($modulepart == 'graph_stock')
- {
- $accessallowed=1;
- $original_file=$conf->stock->dir_temp.'/'.$original_file;
- }
- // Wrapping pour les graph fournisseurs
- elseif ($modulepart == 'graph_fourn')
- {
- $accessallowed=1;
- $original_file=$conf->fournisseur->dir_temp.'/'.$original_file;
- }
- // Wrapping pour les graph des produits
- elseif ($modulepart == 'graph_product')
- {
- $accessallowed=1;
- $original_file=$conf->product->multidir_temp[$entity].'/'.$original_file;
- }
- // Wrapping pour les code barre
- elseif ($modulepart == 'barcode')
- {
- $accessallowed=1;
- // If viewimage is called for barcode, we try to output an image on the fly,
- // with not build of file on disk.
- //$original_file=$conf->barcode->dir_temp.'/'.$original_file;
- $original_file='';
- }
- // Wrapping pour les icones de background des mailings
- elseif ($modulepart == 'iconmailing')
- {
- $accessallowed=1;
- $original_file=$conf->mailing->dir_temp.'/'.$original_file;
- }
- // Wrapping pour les icones de background des mailings
- elseif ($modulepart == 'scanner_user_temp')
- {
- $accessallowed=1;
- $original_file=$conf->scanner->dir_temp.'/'.$user->id.'/'.$original_file;
- }
- // Wrapping pour les images fckeditor
- elseif ($modulepart == 'fckeditor')
- {
- $accessallowed=1;
- $original_file=$conf->fckeditor->dir_output.'/'.$original_file;
- }
+ $original_file=$conf->prelevement->dir_output.'/'.$original_file;
+ }
+ // Wrapping pour les graph energie
+ elseif ($modulepart == 'graph_stock')
+ {
+ $accessallowed=1;
+ $original_file=$conf->stock->dir_temp.'/'.$original_file;
+ }
+ // Wrapping pour les graph fournisseurs
+ elseif ($modulepart == 'graph_fourn')
+ {
+ $accessallowed=1;
+ $original_file=$conf->fournisseur->dir_temp.'/'.$original_file;
+ }
+ // Wrapping pour les graph des produits
+ elseif ($modulepart == 'graph_product')
+ {
+ $accessallowed=1;
+ $original_file=$conf->product->multidir_temp[$entity].'/'.$original_file;
+ }
+ // Wrapping pour les code barre
+ elseif ($modulepart == 'barcode')
+ {
+ $accessallowed=1;
+ // If viewimage is called for barcode, we try to output an image on the fly,
+ // with not build of file on disk.
+ //$original_file=$conf->barcode->dir_temp.'/'.$original_file;
+ $original_file='';
+ }
+ // Wrapping pour les icones de background des mailings
+ elseif ($modulepart == 'iconmailing')
+ {
+ $accessallowed=1;
+ $original_file=$conf->mailing->dir_temp.'/'.$original_file;
+ }
+ // Wrapping pour les icones de background des mailings
+ elseif ($modulepart == 'scanner_user_temp')
+ {
+ $accessallowed=1;
+ $original_file=$conf->scanner->dir_temp.'/'.$user->id.'/'.$original_file;
+ }
+ // Wrapping pour les images fckeditor
+ elseif ($modulepart == 'fckeditor')
+ {
+ $accessallowed=1;
+ $original_file=$conf->fckeditor->dir_output.'/'.$original_file;
+ }
// Wrapping for third parties
else if ($modulepart == 'company' || $modulepart == 'societe')
@@ -1711,36 +1711,36 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$re
else
{
// Define $accessallowed
- if (preg_match('/^([a-z]+)_user_temp$/i',$modulepart,$reg))
- {
- if ($user->rights->$reg[1]->lire || $user->rights->$reg[1]->read || ($user->rights->$reg[1]->download)) $accessallowed=1;
- $original_file=$conf->$reg[1]->dir_temp.'/'.$user->id.'/'.$original_file;
- }
- else if (preg_match('/^([a-z]+)_temp$/i',$modulepart,$reg))
- {
- if ($user->rights->$reg[1]->lire || $user->rights->$reg[1]->read || ($user->rights->$reg[1]->download)) $accessallowed=1;
- $original_file=$conf->$reg[1]->dir_temp.'/'.$original_file;
- }
- else if (preg_match('/^([a-z]+)_user$/i',$modulepart,$reg))
- {
- if ($user->rights->$reg[1]->lire || $user->rights->$reg[1]->read || ($user->rights->$reg[1]->download)) $accessallowed=1;
- $original_file=$conf->$reg[1]->dir_output.'/'.$user->id.'/'.$original_file;
- }
- else
- {
- $perm=GETPOST('perm');
- $subperm=GETPOST('subperm');
- if ($perm || $subperm)
- {
- if (($perm && ! $subperm && $user->rights->$modulepart->$perm) || ($perm && $subperm && $user->rights->$modulepart->$perm->$subperm)) $accessallowed=1;
- $original_file=$conf->$modulepart->dir_output.'/'.$original_file;
- }
- else
- {
- if ($user->rights->$modulepart->lire || $user->rights->$modulepart->read) $accessallowed=1;
- $original_file=$conf->$modulepart->dir_output.'/'.$original_file;
- }
- }
+ if (preg_match('/^([a-z]+)_user_temp$/i',$modulepart,$reg))
+ {
+ if ($user->rights->$reg[1]->lire || $user->rights->$reg[1]->read || ($user->rights->$reg[1]->download)) $accessallowed=1;
+ $original_file=$conf->$reg[1]->dir_temp.'/'.$user->id.'/'.$original_file;
+ }
+ else if (preg_match('/^([a-z]+)_temp$/i',$modulepart,$reg))
+ {
+ if ($user->rights->$reg[1]->lire || $user->rights->$reg[1]->read || ($user->rights->$reg[1]->download)) $accessallowed=1;
+ $original_file=$conf->$reg[1]->dir_temp.'/'.$original_file;
+ }
+ else if (preg_match('/^([a-z]+)_user$/i',$modulepart,$reg))
+ {
+ if ($user->rights->$reg[1]->lire || $user->rights->$reg[1]->read || ($user->rights->$reg[1]->download)) $accessallowed=1;
+ $original_file=$conf->$reg[1]->dir_output.'/'.$user->id.'/'.$original_file;
+ }
+ else
+ {
+ $perm=GETPOST('perm');
+ $subperm=GETPOST('subperm');
+ if ($perm || $subperm)
+ {
+ if (($perm && ! $subperm && $user->rights->$modulepart->$perm) || ($perm && $subperm && $user->rights->$modulepart->$perm->$subperm)) $accessallowed=1;
+ $original_file=$conf->$modulepart->dir_output.'/'.$original_file;
+ }
+ else
+ {
+ if ($user->rights->$modulepart->lire || $user->rights->$modulepart->read) $accessallowed=1;
+ $original_file=$conf->$modulepart->dir_output.'/'.$original_file;
+ }
+ }
if (preg_match('/^specimen/i',$original_file)) $accessallowed=1; // If link to a specimen
if ($user->admin) $accessallowed=1; // If user is admin
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 49a0fff506f..b54a370817f 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -741,7 +741,7 @@ function dol_format_address($object,$withcountry=0,$sep="\n")
}
}
- if ($withcountry) $ret.=($object->country?$sep.$object->country:'');
+ if ($withcountry) $ret.=($object->country?$sep.$object->country:'');
return $ret;
}
@@ -834,12 +834,12 @@ function dol_print_date($time,$format='',$tzoutput='tzserver',$outputlangs='',$e
else if ($format == 'dayxcard') $format='%Y%m%d';
else if ($format == 'dayrfc') $format='%Y-%m-%d'; // DATE_RFC3339
else if ($format == 'dayhourrfc') $format='%Y-%m-%dT%H:%M:%SZ'; // DATETIME RFC3339
- else if ($format == 'standard') $format='%Y-%m-%d %H:%M:%S';
+ else if ($format == 'standard') $format='%Y-%m-%d %H:%M:%S';
if ($reduceformat)
{
- $format=str_replace('%Y','%y',$format);
- $format=str_replace('yyyy','yy',$format);
+ $format=str_replace('%Y','%y',$format);
+ $format=str_replace('yyyy','yy',$format);
}
// If date undefined or "", we return ""
@@ -1230,8 +1230,8 @@ function dol_print_phone($phone,$country='',$cid=0,$socid=0,$addlink='',$separ="
{
if (! empty($conf->browser->phone)) // If phone, we use link of phone
{
- $newphone =''.$phone.'';
+ $newphone =''.$phone.'';
}
else if (! empty($conf->clicktodial->enabled) && $addlink == 'AC_TEL') // If click to dial, we use click to dial url
{
@@ -2329,10 +2329,10 @@ function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $m
if (! empty($conf->dol_optimize_smallscreen) && empty($thead) && $field) // If this is a sort field
{
- $options=preg_replace('/sortfield=([a-zA-Z0-9,\s\.]+)/i','',$moreparam);
- $options=preg_replace('/sortorder=([a-zA-Z0-9,\s\.]+)/i','',$options);
- $options=preg_replace('/&+/i','&',$options);
- if (! preg_match('/^&/',$options)) $options='&'.$options;
+ $options=preg_replace('/sortfield=([a-zA-Z0-9,\s\.]+)/i','',$moreparam);
+ $options=preg_replace('/sortorder=([a-zA-Z0-9,\s\.]+)/i','',$options);
+ $options=preg_replace('/&+/i','&',$options);
+ if (! preg_match('/^&/',$options)) $options='&'.$options;
if ($sortorder == 'DESC' ) $out.= '';
if ($sortorder == 'ASC' ) $out.= '';
@@ -2342,7 +2342,7 @@ function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $m
if (! empty($conf->dol_optimize_smallscreen) && empty($thead) && $field) // If this is a sort field
{
- $out.='';
+ $out.='';
}
if (empty($conf->dol_optimize_smallscreen) && empty($thead) && $field) // If this is a sort field
diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php
index ab41e5aaec7..1ff0fd47b0a 100644
--- a/htdocs/core/lib/functions2.lib.php
+++ b/htdocs/core/lib/functions2.lib.php
@@ -745,18 +745,18 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
{
$counterpadded=str_pad($counter,dol_strlen($maskcounter),"0",STR_PAD_LEFT);
- // Define $maskLike
- $maskLike = dol_string_nospecial($mask);
- $maskLike = str_replace("%","_",$maskLike);
- // Replace protected special codes with matching number of _ as wild card caracter
- $maskLike = preg_replace('/\{yyyy\}/i','____',$maskLike);
- $maskLike = preg_replace('/\{yy\}/i','__',$maskLike);
- $maskLike = preg_replace('/\{y\}/i','_',$maskLike);
- $maskLike = preg_replace('/\{mm\}/i','__',$maskLike);
- $maskLike = preg_replace('/\{dd\}/i','__',$maskLike);
- $maskLike = str_replace(dol_string_nospecial('{'.$masktri.'}'),$counterpadded,$maskLike);
- if ($maskrefclient) $maskLike = str_replace(dol_string_nospecial('{'.$maskrefclient.'}'),str_pad("",dol_strlen($maskrefclient),"_"),$maskLike);
- if ($masktype) $maskLike = str_replace(dol_string_nospecial('{'.$masktype.'}'),$masktype_value,$maskLike);
+ // Define $maskLike
+ $maskLike = dol_string_nospecial($mask);
+ $maskLike = str_replace("%","_",$maskLike);
+ // Replace protected special codes with matching number of _ as wild card caracter
+ $maskLike = preg_replace('/\{yyyy\}/i','____',$maskLike);
+ $maskLike = preg_replace('/\{yy\}/i','__',$maskLike);
+ $maskLike = preg_replace('/\{y\}/i','_',$maskLike);
+ $maskLike = preg_replace('/\{mm\}/i','__',$maskLike);
+ $maskLike = preg_replace('/\{dd\}/i','__',$maskLike);
+ $maskLike = str_replace(dol_string_nospecial('{'.$masktri.'}'),$counterpadded,$maskLike);
+ if ($maskrefclient) $maskLike = str_replace(dol_string_nospecial('{'.$maskrefclient.'}'),str_pad("",dol_strlen($maskrefclient),"_"),$maskLike);
+ if ($masktype) $maskLike = str_replace(dol_string_nospecial('{'.$masktype.'}'),$masktype_value,$maskLike);
$ref='';
$sql = "SELECT ".$field." as ref";
@@ -764,8 +764,8 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
$sql.= " WHERE ".$field." LIKE '".$maskLike."'";
$sql.= " AND ".$field." NOT LIKE '%PROV%'";
$sql.= " AND entity IN (".getEntity($table, 1).")";
- if ($where) $sql.=$where;
- if ($sqlwhere) $sql.=' AND '.$sqlwhere;
+ if ($where) $sql.=$where;
+ if ($sqlwhere) $sql.=' AND '.$sqlwhere;
dol_syslog("functions2::get_next_value sql=".$sql);
$resql=$db->query($sql);
diff --git a/htdocs/core/lib/invoice2.lib.php b/htdocs/core/lib/invoice2.lib.php
index dd9e1ba987d..6a6855b7ed9 100644
--- a/htdocs/core/lib/invoice2.lib.php
+++ b/htdocs/core/lib/invoice2.lib.php
@@ -238,7 +238,7 @@ function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filte
$filename='mergedpdf';
if (! empty($option)) $filename.='_'.$option;
- $file=$diroutputpdf.'/'.$filename.'.pdf';
+ $file=$diroutputpdf.'/'.$filename.'.pdf';
if (! $error && $pagecount)
{
diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php
index dcb94bd084a..556007967f4 100644
--- a/htdocs/core/lib/security2.lib.php
+++ b/htdocs/core/lib/security2.lib.php
@@ -291,9 +291,9 @@ function dol_loginfunction($langs,$conf,$mysoc)
// Set dol_hide_topmenu, dol_hide_leftmenu, dol_optimize_smallscreen, dol_nomousehover
$dol_hide_topmenu=GETPOST('dol_hide_topmenu');
$dol_hide_leftmenu=GETPOST('dol_hide_leftmenu');
- $dol_optimize_smallscreen=GETPOST('dol_optimize_smallscreen');
- $dol_no_mouse_hover=GETPOST('dol_no_mouse_hover');
- $dol_use_jmobile=GETPOST('dol_use_jmobile');
+ $dol_optimize_smallscreen=GETPOST('dol_optimize_smallscreen');
+ $dol_no_mouse_hover=GETPOST('dol_no_mouse_hover');
+ $dol_use_jmobile=GETPOST('dol_use_jmobile');
// Include login page template
include $template_dir.'login.tpl.php';
diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php
index 316c4d5b607..4d1bfad0ba3 100644
--- a/htdocs/core/menus/standard/auguria.lib.php
+++ b/htdocs/core/menus/standard/auguria.lib.php
@@ -76,8 +76,8 @@ function print_auguria_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0)
}
$url=preg_replace('/__LOGIN__/',$user->login,$url);
$shorturl=preg_replace('/__LOGIN__/',$user->login,$shorturl);
- $url=preg_replace('/__USERID__/',$user->id,$url);
- $shorturl=preg_replace('/__USERID__/',$user->id,$shorturl);
+ $url=preg_replace('/__USERID__/',$user->id,$url);
+ $shorturl=preg_replace('/__USERID__/',$user->id,$shorturl);
// Define the class (top menu selected or not)
if (! empty($_SESSION['idmenu']) && $newTabMenu[$i]['rowid'] == $_SESSION['idmenu']) $classname='class="tmenusel"';
@@ -238,54 +238,54 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
$menuArbo = new Menubase($db,'auguria');
$newmenu = $menuArbo->menuLeftCharger($newmenu,$mainmenu,$leftmenu,($user->societe_id?1:0),'auguria',$tabMenu);
- // We update newmenu for special dynamic menus
- if ($conf->banque->enabled && $user->rights->banque->lire && $mainmenu == 'bank') // Entry for each bank account
- {
- $sql = "SELECT rowid, label, courant, rappro, courant";
- $sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
- $sql.= " WHERE entity = ".$conf->entity;
- $sql.= " AND clos = 0";
- $sql.= " ORDER BY label";
-
- $resql = $db->query($sql);
- if ($resql)
- {
- $numr = $db->num_rows($resql);
- $i = 0;
-
- if ($numr > 0) $newmenu->add('/compta/bank/index.php',$langs->trans("BankAccounts"),0,$user->rights->banque->lire);
-
- while ($i < $numr)
- {
- $objp = $db->fetch_object($resql);
- $newmenu->add('/compta/bank/fiche.php?id='.$objp->rowid,$objp->label,1,$user->rights->banque->lire);
- if ($objp->rappro && $objp->courant != 2 && empty($objp->clos)) // If not cash account and not closed and can be reconciliate
- {
- $newmenu->add('/compta/bank/rappro.php?account='.$objp->rowid,$langs->trans("Conciliate"),2,$user->rights->banque->consolidate);
- }
- $i++;
- }
- }
- else dol_print_error($db);
- $db->free($resql);
+ // We update newmenu for special dynamic menus
+ if ($conf->banque->enabled && $user->rights->banque->lire && $mainmenu == 'bank') // Entry for each bank account
+ {
+ $sql = "SELECT rowid, label, courant, rappro, courant";
+ $sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
+ $sql.= " WHERE entity = ".$conf->entity;
+ $sql.= " AND clos = 0";
+ $sql.= " ORDER BY label";
+
+ $resql = $db->query($sql);
+ if ($resql)
+ {
+ $numr = $db->num_rows($resql);
+ $i = 0;
+
+ if ($numr > 0) $newmenu->add('/compta/bank/index.php',$langs->trans("BankAccounts"),0,$user->rights->banque->lire);
+
+ while ($i < $numr)
+ {
+ $objp = $db->fetch_object($resql);
+ $newmenu->add('/compta/bank/fiche.php?id='.$objp->rowid,$objp->label,1,$user->rights->banque->lire);
+ if ($objp->rappro && $objp->courant != 2 && empty($objp->clos)) // If not cash account and not closed and can be reconciliate
+ {
+ $newmenu->add('/compta/bank/rappro.php?account='.$objp->rowid,$langs->trans("Conciliate"),2,$user->rights->banque->consolidate);
+ }
+ $i++;
+ }
+ }
+ else dol_print_error($db);
+ $db->free($resql);
}
if ($conf->ftp->enabled && $mainmenu == 'ftp') // Entry for FTP
{
- $MAXFTP=20;
- $i=1;
- while ($i <= $MAXFTP)
- {
- $paramkey='FTP_NAME_'.$i;
- //print $paramkey;
- if (! empty($conf->global->$paramkey))
- {
- $link="/ftp/index.php?idmenu=".$_SESSION["idmenu"]."&numero_ftp=".$i;
-
- $newmenu->add($link, dol_trunc($conf->global->$paramkey,24));
- }
- $i++;
- }
+ $MAXFTP=20;
+ $i=1;
+ while ($i <= $MAXFTP)
+ {
+ $paramkey='FTP_NAME_'.$i;
+ //print $paramkey;
+ if (! empty($conf->global->$paramkey))
+ {
+ $link="/ftp/index.php?idmenu=".$_SESSION["idmenu"]."&numero_ftp=".$i;
+
+ $newmenu->add($link, dol_trunc($conf->global->$paramkey,24));
+ }
+ $i++;
+ }
}
@@ -334,8 +334,8 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
// Add mainmenu in GET url. This make to go back on correct menu even when using Back on browser.
$url=dol_buildpath($menu_array[$i]['url'],1);
- $url=preg_replace('/__LOGIN__/',$user->login,$url);
- $url=preg_replace('/__USERID__/',$user->id,$url);
+ $url=preg_replace('/__LOGIN__/',$user->login,$url);
+ $url=preg_replace('/__USERID__/',$user->id,$url);
if (! preg_match('/mainmenu=/i',$menu_array[$i]['url']))
{
diff --git a/htdocs/core/menus/standard/auguria_menu.php b/htdocs/core/menus/standard/auguria_menu.php
index 802bda1ff3d..97788a14770 100644
--- a/htdocs/core/menus/standard/auguria_menu.php
+++ b/htdocs/core/menus/standard/auguria_menu.php
@@ -101,7 +101,7 @@ class MenuManager
// On va le chercher en session si non defini par le lien
$leftmenu=isset($_SESSION["leftmenu"])?$_SESSION["leftmenu"]:'';
}
- if (! empty($forceleftmenu)) $leftmenu=$forceleftmenu;
+ if (! empty($forceleftmenu)) $leftmenu=$forceleftmenu;
require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
$tabMenu=array();
@@ -191,8 +191,8 @@ class MenuManager
if ($val['enabled'] == 1)
{
$relurl=dol_buildpath($val['url'],1);
- $relurl=preg_replace('/__LOGIN__/',$user->login,$relurl);
- $relurl=preg_replace('/__USERID__/',$user->id,$relurl);
+ $relurl=preg_replace('/__LOGIN__/',$user->login,$relurl);
+ $relurl=preg_replace('/__USERID__/',$user->id,$relurl);
print ''.$val['titre'].''."\n";
// Search submenu fot this entry
@@ -201,7 +201,7 @@ class MenuManager
$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);
@@ -210,12 +210,12 @@ class MenuManager
if (($canonrelurl != $canonnexturl && ! in_array($val['mainmenu'],array('tools')))
|| (strpos($canonrelurl,'/product/index.php') !== false || strpos($canonrelurl,'/compta/bank/index.php') !== false))
{
- // We add sub entry
- print str_pad('',1).'
';
-
- // Other attributes
- $parameters=array('colspan' => ' colspan="3"');
- $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
- if (empty($reshook) && ! empty($extrafields->attribute_label))
- {
- if ($action == 'edit_extras')
- {
- print '
";
-
- if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
- {
- $blocname = 'contacts';
- $title = $langs->trans('ContactsAddresses');
- include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';
- }
-
- if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB))
- {
- $blocname = 'notes';
- $title = $langs->trans('Notes');
- include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';
- }
-
- /*
- * Lignes d'intervention
- */
- $sql = 'SELECT ft.rowid, ft.description, ft.fk_fichinter, ft.duree, ft.rang,';
- $sql.= ' ft.date as date_intervention';
- $sql.= ' FROM '.MAIN_DB_PREFIX.'fichinterdet as ft';
- $sql.= ' WHERE ft.fk_fichinter = '.$object->id;
- $sql.= ' ORDER BY ft.rang ASC, ft.rowid';
-
- $resql = $db->query($sql);
- if ($resql)
- {
- $num = $db->num_rows($resql);
- $i = 0;
-
- if ($num)
- {
- print '
';
-
- print '
';
- print '
'.$langs->trans('Description').'
';
- print '
'.$langs->trans('Date').'
';
- print '
'.$langs->trans('Duration').'
';
- print '
';
- print "
\n";
- }
- $var=true;
- while ($i < $num)
- {
- $objp = $db->fetch_object($resql);
- $var=!$var;
-
- // Ligne en mode visu
- if ($action != 'editline' || GETPOST('line_id','int') != $objp->rowid)
- {
- print '
';
- print '
';
- print ''; // ancre pour retourner sur la ligne
- print dol_htmlentitiesbr($objp->description);
-
- // Date
- print '
';
+
+ // Other attributes
+ $parameters=array('colspan' => ' colspan="3"');
+ $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
+ if (empty($reshook) && ! empty($extrafields->attribute_label))
+ {
+ if ($action == 'edit_extras')
+ {
+ print '
";
+
+ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
+ {
+ $blocname = 'contacts';
+ $title = $langs->trans('ContactsAddresses');
+ include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';
+ }
+
+ if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB))
+ {
+ $blocname = 'notes';
+ $title = $langs->trans('Notes');
+ include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';
+ }
+
+ /*
+ * Lignes d'intervention
+ */
+ $sql = 'SELECT ft.rowid, ft.description, ft.fk_fichinter, ft.duree, ft.rang,';
+ $sql.= ' ft.date as date_intervention';
+ $sql.= ' FROM '.MAIN_DB_PREFIX.'fichinterdet as ft';
+ $sql.= ' WHERE ft.fk_fichinter = '.$object->id;
+ $sql.= ' ORDER BY ft.rang ASC, ft.rowid';
+
+ $resql = $db->query($sql);
+ if ($resql)
+ {
+ $num = $db->num_rows($resql);
+ $i = 0;
+
+ if ($num)
+ {
+ print '
';
+
+ print '
';
+ print '
'.$langs->trans('Description').'
';
+ print '
'.$langs->trans('Date').'
';
+ print '
'.$langs->trans('Duration').'
';
+ print '
';
+ print "
\n";
+ }
+ $var=true;
+ while ($i < $num)
+ {
+ $objp = $db->fetch_object($resql);
+ $var=!$var;
+
+ // Ligne en mode visu
+ if ($action != 'editline' || GETPOST('line_id','int') != $objp->rowid)
+ {
+ print '
';
+ print '
';
+ print ''; // ancre pour retourner sur la ligne
+ print dol_htmlentitiesbr($objp->description);
+
+ // Date
+ print '
';
+
+ // List of actions on element
+ include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
+ $formactions=new FormActions($db);
+ $somethingshown=$formactions->showactions($object,'fichinter',$socid);
+
+ print '
';
+ //print "
\n";
+ }
+
+
+ /*
+ * Action presend
+ */
+ if ($action == 'presend')
+ {
+ $ref = dol_sanitizeFileName($object->ref);
+ include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
+ $fileparams = dol_most_recent_file($conf->ficheinter->dir_output . '/' . $ref, preg_quote($ref,'/'));
+ $file=$fileparams['fullname'];
+
+ // Build document if it not exists
+ if (! $file || ! is_readable($file))
+ {
+ // Define output language
+ $outputlangs = $langs;
+ $newlang='';
+ if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id'];
+ if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
+ if (! empty($newlang))
+ {
+ $outputlangs = new Translate("",$conf);
+ $outputlangs->setDefaultLang($newlang);
+ }
+
+ $result=fichinter_create($db, $object, GETPOST('model')?GETPOST('model'):$object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
+ if ($result <= 0)
+ {
+ dol_print_error($db,$result);
+ exit;
+ }
+ $fileparams = dol_most_recent_file($conf->ficheinter->dir_output . '/' . $ref, preg_quote($ref,'/'));
+ $file=$fileparams['fullname'];
+ }
+
+ print ' ';
+ print_titre($langs->trans('SendInterventionByMail'));
+
+ // Create form object
+ include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
+ $formmail = new FormMail($db);
+ $formmail->fromtype = 'user';
+ $formmail->fromid = $user->id;
+ $formmail->fromname = $user->getFullName($langs);
+ $formmail->frommail = $user->email;
+ $formmail->withfrom=1;
+ $liste=array();
+ foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value;
+ $formmail->withto=GETPOST("sendto")?GETOST("sendto"):$liste;
+ $formmail->withtocc=$liste;
+ $formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC;
+ $formmail->withtopic=$langs->trans('SendInterventionRef','__FICHINTERREF__');
+ $formmail->withfile=2;
+ $formmail->withbody=1;
+ $formmail->withdeliveryreceipt=1;
+ $formmail->withcancel=1;
+
+ // Tableau des substitutions
+ $formmail->substit['__FICHINTERREF__']=$object->ref;
+ $formmail->substit['__SIGNATURE__']=$user->signature;
+ $formmail->substit['__PERSONALIZED__']='';
+ $formmail->substit['__CONTACTCIVNAME__']='';
+
+ //Find the good contact adress
+ $custcontact='';
+ $contactarr=array();
+ $contactarr=$object->liste_contact(-1,'external');
+
+ if (is_array($contactarr) && count($contactarr)>0) {
+ foreach($contactarr as $contact) {
+ if ($contact['libelle']==$langs->trans('TypeContact_fichinter_external_CUSTOMER')) {
+ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
+ $contactstatic=new Contact($db);
+ $contactstatic->fetch($contact['id']);
+ $custcontact=$contactstatic->getFullName($langs,1);
+ }
+ }
+
+ if (!empty($custcontact)) {
+ $formmail->substit['__CONTACTCIVNAME__']=$custcontact;
+ }
+ }
+
+ // Tableau des parametres complementaires
+ $formmail->param['action']='send';
+ $formmail->param['models']='fichinter_send';
+ $formmail->param['fichinter_id']=$object->id;
+ $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id;
+
+ // Init list of files
+ if (GETPOST("mode")=='init')
+ {
+ $formmail->clear_attached_files();
+ $formmail->add_attached_files($file,basename($file),dol_mimetype($file));
+ }
+
+ $formmail->show_form();
+
+ print ' ';
+ }
+}
+
+
+llxFooter();
+
+$db->close();
+?>
diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php
index e3bc1fadb8b..19912e3f58f 100644
--- a/htdocs/fourn/class/fournisseur.facture.class.php
+++ b/htdocs/fourn/class/fournisseur.facture.class.php
@@ -855,42 +855,42 @@ class FactureFournisseur extends CommonInvoice
}
}
- if (! $error)
- {
- $this->oldref = '';
-
- // Rename directory if dir was a temporary ref
- if (preg_match('/^[\(]?PROV/i', $this->ref))
- {
- // On renomme repertoire facture ($this->ref = ancienne ref, $num = nouvelle ref)
- // afin de ne pas perdre les fichiers attaches
- $facref = dol_sanitizeFileName($this->ref);
+ if (! $error)
+ {
+ $this->oldref = '';
+
+ // Rename directory if dir was a temporary ref
+ if (preg_match('/^[\(]?PROV/i', $this->ref))
+ {
+ // On renomme repertoire facture ($this->ref = ancienne ref, $num = nouvelle ref)
+ // afin de ne pas perdre les fichiers attaches
+ $facref = dol_sanitizeFileName($this->ref);
$snumfa = dol_sanitizeFileName($num);
- $dirsource = $conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id,2).$facref;
+ $dirsource = $conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id,2).$facref;
$dirdest = $conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id,2).$snumfa;
- if (file_exists($dirsource))
- {
- dol_syslog(get_class($this)."::validate rename dir ".$dirsource." into ".$dirdest);
-
- if (@rename($dirsource, $dirdest))
- {
- $this->oldref = $facref;
-
- dol_syslog("Rename ok");
- // Suppression ancien fichier PDF dans nouveau rep
- dol_delete_file($conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id,2).$snumfa.'/'.$facref.'*.*');
- }
- }
- }
+ if (file_exists($dirsource))
+ {
+ dol_syslog(get_class($this)."::validate rename dir ".$dirsource." into ".$dirdest);
+
+ if (@rename($dirsource, $dirdest))
+ {
+ $this->oldref = $facref;
+
+ dol_syslog("Rename ok");
+ // Suppression ancien fichier PDF dans nouveau rep
+ dol_delete_file($conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id,2).$snumfa.'/'.$facref.'*.*');
+ }
+ }
+ }
}
- // Set new ref and define current statut
- if (! $error)
- {
- $this->ref = $num;
- $this->statut=1;
- //$this->date_validation=$now; this is stored into log table
+ // Set new ref and define current statut
+ if (! $error)
+ {
+ $this->ref = $num;
+ $this->statut=1;
+ //$this->date_validation=$now; this is stored into log table
}
// Triggers call
diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php
index aa9658a9d84..c2dc17f798f 100644
--- a/htdocs/fourn/facture/fiche.php
+++ b/htdocs/fourn/facture/fiche.php
@@ -114,14 +114,14 @@ elseif ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->fourni
$object->fetch($id);
$object->fetch_thirdparty();
- $qualified_for_stock_change=0;
- if (empty($conf->global->STOCK_SUPPORTS_SERVICES))
- {
- $qualified_for_stock_change=$object->hasProductsOrServices(2);
- }
- else
- {
- $qualified_for_stock_change=$object->hasProductsOrServices(1);
+ $qualified_for_stock_change=0;
+ if (empty($conf->global->STOCK_SUPPORTS_SERVICES))
+ {
+ $qualified_for_stock_change=$object->hasProductsOrServices(2);
+ }
+ else
+ {
+ $qualified_for_stock_change=$object->hasProductsOrServices(1);
}
// Check parameters
diff --git a/htdocs/fourn/fiche.php b/htdocs/fourn/fiche.php
index 38ce1e648b3..1af03e83a01 100644
--- a/htdocs/fourn/fiche.php
+++ b/htdocs/fourn/fiche.php
@@ -219,7 +219,7 @@ if ($object->fetch($id))
print '';
- print '
';
+ print '
';
//print '
';
diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php
index 65ec397e242..f2681a936f7 100644
--- a/htdocs/imports/import.php
+++ b/htdocs/imports/import.php
@@ -1314,11 +1314,11 @@ if ($step == 5 && $datatoimport)
$sourcelinenb++;
// Read line and stor it into $arrayrecord
$arrayrecord=$obj->import_read_record();
- if ($arrayrecord === false)
- {
+ if ($arrayrecord === false)
+ {
$arrayofwarnings[$sourcelinenb][0]=array('lib'=>'File has '.$nboflines.' lines. However we reach end of file after record '.$sourcelinenb.'. This may occurs when some records are split onto several lines.','type'=>'EOF_RECORD_ON_SEVERAL_LINES');
- $endoffile++;
- continue;
+ $endoffile++;
+ continue;
}
if ($excludefirstline && $sourcelinenb == 1) continue;
diff --git a/htdocs/imports/index.php b/htdocs/imports/index.php
index ac9e9d645fa..19642c63378 100644
--- a/htdocs/imports/index.php
+++ b/htdocs/imports/index.php
@@ -98,7 +98,7 @@ if (count($import->array_import_code))
//}
}
print '';
-print ' ';
+print ' ';
print '
';
@@ -137,5 +137,5 @@ print '
';
llxFooter();
-$db->close();
+$db->close();
?>
diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php
index e477ec3b6a5..280d9c5b746 100644
--- a/htdocs/install/upgrade2.php
+++ b/htdocs/install/upgrade2.php
@@ -335,11 +335,11 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action')))
$beforeversionarray=explode('.','3.4.9');
if (versioncompare($versiontoarray,$afterversionarray) >= 0 && versioncompare($versiontoarray,$beforeversionarray) <= 0)
{
- // Reload modules (this must be always and only into last targeted version)
- migrate_reload_modules($db,$langs,$conf);
-
- // Reload menus (this must be always and only into last targeted version)
- migrate_reload_menu($db,$langs,$conf,$versionto);
+ // Reload modules (this must be always and only into last targeted version)
+ migrate_reload_modules($db,$langs,$conf);
+
+ // Reload menus (this must be always and only into last targeted version)
+ migrate_reload_menu($db,$langs,$conf,$versionto);
}
print '
'.$langs->trans("MigrationFinished").'
';
@@ -3526,9 +3526,9 @@ function migrate_delete_old_files($db,$langs,$conf)
DOL_DOCUMENT_ROOT.'/core/menus/smartphone/iphone.lib.php',
DOL_DOCUMENT_ROOT.'/core/menus/smartphone/iphone_backoffice.php',
DOL_DOCUMENT_ROOT.'/core/menus/smartphone/iphone_frontoffice.php',
- DOL_DOCUMENT_ROOT.'/core/menus/standard/auguria_backoffice.php',
- DOL_DOCUMENT_ROOT.'/core/menus/standard/auguria_frontoffice.php',
- DOL_DOCUMENT_ROOT.'/core/menus/standard/eldy_backoffice.php',
+ DOL_DOCUMENT_ROOT.'/core/menus/standard/auguria_backoffice.php',
+ DOL_DOCUMENT_ROOT.'/core/menus/standard/auguria_frontoffice.php',
+ DOL_DOCUMENT_ROOT.'/core/menus/standard/eldy_backoffice.php',
DOL_DOCUMENT_ROOT.'/core/menus/standard/eldy_frontoffice.php',
DOL_DOCUMENT_ROOT.'/core/modules/mailings/dolibarr_services_expired.modules.php',
DOL_DOCUMENT_ROOT.'/core/modules/mailings/peche.modules.php',
diff --git a/htdocs/mailmanspip/class/mailmanspip.class.php b/htdocs/mailmanspip/class/mailmanspip.class.php
index 26c9cb3a24b..6d576ee2067 100644
--- a/htdocs/mailmanspip/class/mailmanspip.class.php
+++ b/htdocs/mailmanspip/class/mailmanspip.class.php
@@ -42,8 +42,8 @@ class MailmanSpip
var $mladded_ok;
var $mladded_ko;
- var $mlremoved_ok;
- var $mlremoved_ko;
+ var $mlremoved_ok;
+ var $mlremoved_ko;
/**
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 48169cdfd31..af53c2460e3 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -345,17 +345,17 @@ if (! defined('NOLOGIN'))
// It is not already authenticated and it requests the login / password
include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
- $dol_dst_observed=GETPOST("dst_observed",3);
- $dol_dst_first=GETPOST("dst_first",3);
- $dol_dst_second=GETPOST("dst_second",3);
- $dol_screenwidth=GETPOST("screenwidth",3);
- $dol_screenheight=GETPOST("screenheight",3);
- $dol_hide_topmenu=GETPOST('dol_hide_topmenu',3);
- $dol_hide_leftmenu=GETPOST('dol_hide_leftmenu',3);
- $dol_optimize_smallscreen=GETPOST('dol_optimize_smallscreen',3);
- $dol_no_mouse_hover=GETPOST('dol_no_mouse_hover',3);
- $dol_use_jmobile=GETPOST('dol_use_jmobile',3);
- //dol_syslog("POST key=".join(array_keys($_POST),',').' value='.join($_POST,','));
+ $dol_dst_observed=GETPOST("dst_observed",3);
+ $dol_dst_first=GETPOST("dst_first",3);
+ $dol_dst_second=GETPOST("dst_second",3);
+ $dol_screenwidth=GETPOST("screenwidth",3);
+ $dol_screenheight=GETPOST("screenheight",3);
+ $dol_hide_topmenu=GETPOST('dol_hide_topmenu',3);
+ $dol_hide_leftmenu=GETPOST('dol_hide_leftmenu',3);
+ $dol_optimize_smallscreen=GETPOST('dol_optimize_smallscreen',3);
+ $dol_no_mouse_hover=GETPOST('dol_no_mouse_hover',3);
+ $dol_use_jmobile=GETPOST('dol_use_jmobile',3);
+ //dol_syslog("POST key=".join(array_keys($_POST),',').' value='.join($_POST,','));
// If in demo mode, we check we go to home page through the public/demo/index.php page
if (! empty($dolibarr_main_demo) && $_SERVER['PHP_SELF'] == DOL_URL_ROOT.'/index.php') // We ask index page
@@ -589,7 +589,7 @@ if (! defined('NOLOGIN'))
if (! empty($dol_hide_leftmenu)) $_SESSION['dol_hide_leftmenu']=$dol_hide_leftmenu;
if (! empty($dol_optimize_smallscreen)) $_SESSION['dol_optimize_smallscreen']=$dol_optimize_smallscreen;
if (! empty($dol_no_mouse_hover)) $_SESSION['dol_no_mouse_hover']=$dol_no_mouse_hover;
- if (! empty($dol_use_jmobile)) $_SESSION['dol_use_jmobile']=$dol_use_jmobile;
+ if (! empty($dol_use_jmobile)) $_SESSION['dol_use_jmobile']=$dol_use_jmobile;
dol_syslog("This is a new started user session. _SESSION['dol_login']=".$_SESSION["dol_login"]." Session id=".session_id());
@@ -680,15 +680,15 @@ if (GETPOST('theme'))
$conf->css = "/theme/".$conf->theme."/style.css.php";
}
-// Set javascript option
-if (! GETPOST('nojs')) // If javascript was not disabled on URL
-{
- if (! empty($user->conf->MAIN_DISABLE_JAVASCRIPT))
- {
- $conf->use_javascript_ajax=! $user->conf->MAIN_DISABLE_JAVASCRIPT;
- }
-}
-else $conf->use_javascript_ajax=0;
+// Set javascript option
+if (! GETPOST('nojs')) // If javascript was not disabled on URL
+{
+ if (! empty($user->conf->MAIN_DISABLE_JAVASCRIPT))
+ {
+ $conf->use_javascript_ajax=! $user->conf->MAIN_DISABLE_JAVASCRIPT;
+ }
+}
+else $conf->use_javascript_ajax=0;
// Set terminal output option
if (GETPOST('dol_hide_leftmenu') || ! empty($_SESSION['dol_hide_leftmenu'])) $conf->dol_hide_leftmenu=1;
@@ -937,9 +937,9 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
print ''."\n";
$favicon=dol_buildpath('/theme/'.$conf->theme.'/img/favicon.ico',1);
print ''."\n";
- if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print ''."\n";
- if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print ''."\n";
- if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print ''."\n";
+ if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print ''."\n";
+ if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print ''."\n";
+ if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print ''."\n";
// Displays title
$appli='Dolibarr';
@@ -980,9 +980,9 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
{
print ''."\n";
}
- // jQuery jMobile
- if (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || ! empty($conf->dol_use_jmobile))
- {
+ // jQuery jMobile
+ if (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || ! empty($conf->dol_use_jmobile))
+ {
print ''."\n";
}
@@ -1145,30 +1145,30 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
print ''."\n";
print ''."\n";
}
- // jQuery jMobile
- if (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || (! empty($conf->dol_use_jmobile) && $conf->dol_use_jmobile > 0))
+ // jQuery jMobile
+ if (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || (! empty($conf->dol_use_jmobile) && $conf->dol_use_jmobile > 0))
{
// Note: We can force not using ajax because cache of jquery does not load js of other pages by setting ajaxEnabled.
if (empty($conf->dol_use_jmobile) || $conf->dol_use_jmobile != 2)
{
- print '';
}
- print ''."\n";
- }
+ print ''."\n";
+ }
}
- if (! $disablejs && ! empty($conf->use_javascript_ajax))
+ if (! $disablejs && ! empty($conf->use_javascript_ajax))
{
// CKEditor
if (! empty($conf->fckeditor->enabled) && (empty($conf->global->FCKEDITOR_EDITORNAME) || $conf->global->FCKEDITOR_EDITORNAME == 'ckeditor'))
@@ -1579,19 +1579,19 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me
print "\n";
}
- //Dolibarr version
- $doliurl='http://www.dolibarr.org';
- $appli='Dolibarr';
- if (! empty($conf->global->MAIN_APPLICATION_TITLE)) {
- $appli=$conf->global->MAIN_APPLICATION_TITLE; $doliurl='';
- }
- $appli.=" ".DOL_VERSION;
- print '