Skip to content
Snippets Groups Projects
Commit de16e355 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Change to add possibility to have two root directory (for dev of modules)

parent 920c0596
Branches
Tags
No related merge requests found
...@@ -103,7 +103,7 @@ if (-d "/usr/src/RPM") { ...@@ -103,7 +103,7 @@ if (-d "/usr/src/RPM") {
$RPMDIR="/usr/src/RPM"; $RPMDIR="/usr/src/RPM";
} }
$SOURCE="$DIR/../../dolibarr"; $SOURCE="$DIR/..";
$DESTI="$SOURCE/build"; $DESTI="$SOURCE/build";
......
...@@ -161,15 +161,22 @@ llxHeader("",""); ...@@ -161,15 +161,22 @@ llxHeader("","");
print_fiche_titre($langs->trans("ModulesSetup"),'','setup'); print_fiche_titre($langs->trans("ModulesSetup"),'','setup');
// Recherche les modules // Search modules
$dir = DOL_DOCUMENT_ROOT . "/includes/modules/"; $dirlist=array();
$dirlist[]=DOL_DOCUMENT_ROOT;
if (defined('DOL_DOCUMENT_ROOT_BIS')) $dirlist[]=DOL_DOCUMENT_ROOT_BIS;
// Charge tableaux modules, nom, numero, orders depuis r�pertoire dir
$handle=opendir($dir);
$filename = array(); $filename = array();
$modules = array(); $modules = array();
$orders = array(); $orders = array();
$categ = array(); $categ = array();
$dirmod = array();
foreach ($dirlist as $dirroot)
{
$dir = $dirroot . "/includes/modules/";
// Charge tableaux modules, nom, numero, orders depuis r�pertoire dir
$handle=opendir($dir);
$i = 0; $i = 0;
$j = 0; $j = 0;
while (($file = readdir($handle))!==false) while (($file = readdir($handle))!==false)
...@@ -209,15 +216,17 @@ while (($file = readdir($handle))!==false) ...@@ -209,15 +216,17 @@ while (($file = readdir($handle))!==false)
$filename[$i]= $modName; $filename[$i]= $modName;
$orders[$i] = "$objMod->family"."_".$j; // Tri par famille puis numero module $orders[$i] = "$objMod->family"."_".$j; // Tri par famille puis numero module
$categ[$objMod->special]++; // Array of all different modules categories $categ[$objMod->special]++; // Array of all different modules categories
$dirmod[$i] = $dirroot;
$j++; $j++;
$i++; $i++;
} }
} }
} }
} }
}
asort($orders);
asort($orders);
// Affichage debut page // Affichage debut page
...@@ -368,15 +377,16 @@ foreach ($orders as $key => $value) ...@@ -368,15 +377,16 @@ foreach ($orders as $key => $value)
$i=0; $i=0;
foreach ($objMod->config_page_url as $page) foreach ($objMod->config_page_url as $page)
{ {
$urlpage=$page;
if ($i++) if ($i++)
{ {
print '<a href="'.$page.'" alt="'.$langs->trans($page).'">'.img_picto(ucfirst($page),"setup").'</a>&nbsp;'; print '<a href="'.$urlpage.'" alt="'.$langs->trans($page).'">'.img_picto(ucfirst($page),"setup").'</a>&nbsp;';
// print '<a href="'.$page.'">'.ucfirst($page).'</a>&nbsp;'; // print '<a href="'.$page.'">'.ucfirst($page).'</a>&nbsp;';
} }
else else
{ {
//print '<a href="'.$page.'">'.$langs->trans("Setup").'</a>&nbsp;'; //print '<a href="'.$page.'">'.$langs->trans("Setup").'</a>&nbsp;';
print '<a href="'.$page.'" alt="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"),"setup").'</a>&nbsp;'; print '<a href="'.$urlpage.'" alt="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"),"setup").'</a>&nbsp;';
} }
} }
print "</td>\n"; print "</td>\n";
......
...@@ -16,18 +16,17 @@ ...@@ -16,18 +16,17 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*/ */
/** /**
\file htdocs/admin/pre.inc.php \file htdocs/admin/pre.inc.php
\brief Fichier gestionnaire du menu de gauche de l'espace configuration \brief Fichier gestionnaire du menu de gauche de l'espace configuration
\version $Revision$ \version $Id$
*/ */
require("../main.inc.php"); $res=@include("../main.inc.php");
if (! $res) include("../../../dolibarr/htdocs/main.inc.php"); // Used on dev env only
$langs->load("admin"); $langs->load("admin");
......
...@@ -78,7 +78,7 @@ if (! isset($dolibarr_main_db_type)) ...@@ -78,7 +78,7 @@ if (! isset($dolibarr_main_db_type))
{ {
$dolibarr_main_db_type='mysql'; // Pour compatibilite avec anciennes configs, si non defini, on prend 'mysql' $dolibarr_main_db_type='mysql'; // Pour compatibilite avec anciennes configs, si non defini, on prend 'mysql'
} }
if (! $dolibarr_main_data_root) { if (empty($dolibarr_main_data_root)) {
// Si repertoire documents non defini, on utilise celui par defaut // Si repertoire documents non defini, on utilise celui par defaut
$dolibarr_main_data_root=ereg_replace("/htdocs","",$dolibarr_main_document_root); $dolibarr_main_data_root=ereg_replace("/htdocs","",$dolibarr_main_document_root);
$dolibarr_main_data_root.="/documents"; $dolibarr_main_data_root.="/documents";
...@@ -91,6 +91,9 @@ $pos = strstr ($uri, '/'); // $pos contient alors url sans nom domaine ...@@ -91,6 +91,9 @@ $pos = strstr ($uri, '/'); // $pos contient alors url sans nom domaine
if ($pos == '/') $pos = ''; // si $pos vaut /, on le met a '' if ($pos == '/') $pos = ''; // si $pos vaut /, on le met a ''
define('DOL_URL_ROOT', $pos); // URL racine relative define('DOL_URL_ROOT', $pos); // URL racine relative
// Special code for alternate dev directories (Used on dev env only)
if (! empty($dolibarr_main_document_root_bis)) define('DOL_DOCUMENT_ROOT_BIS', $dolibarr_main_document_root_bis);
/* /*
* Controle validite fichier conf * Controle validite fichier conf
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment