From e3f0ab9109822c3dd66e41f249a844deecfbb2a0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 30 Jul 2016 14:05:39 +0200 Subject: [PATCH] Fix tag was not visible --- dev/initdata/README | 2 +- dev/initdemo/initdemo.sh | 36 +++++++++++++++++------------------- htdocs/categories/index.php | 9 +++++++-- 3 files changed, 25 insertions(+), 22 deletions(-) diff --git a/dev/initdata/README b/dev/initdata/README index 1db130dfe3e..97f5f0d3cd7 100644 --- a/dev/initdata/README +++ b/dev/initdata/README @@ -2,4 +2,4 @@ README ------ Scripts in this directory can be used to load or purge data of a database instance. -WARNING: This may erase data. +WARNING: Some of this script may delete definitely data. diff --git a/dev/initdemo/initdemo.sh b/dev/initdemo/initdemo.sh index 10dc671e09d..5e24b7f3816 100755 --- a/dev/initdemo/initdemo.sh +++ b/dev/initdemo/initdemo.sh @@ -15,7 +15,7 @@ export mydir=`echo "$0" | sed -e 's/initdemo.sh//'`; -if [ "x$mydir" = "x" ] +if [ "x$mydir" = 'x' -o "x$mydir" = 'x./' ] then export mydir="." fi @@ -132,24 +132,7 @@ then exit;; esac - # ---------------------------- chemin d'acces du repertoire documents - #DIALOG=${DIALOG=dialog} - #fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$ - #trap "rm -f $fichtemp" 0 1 2 5 15 - #$DIALOG --title "Init Dolibarr with demo values" --clear \ - # --inputbox "Full path to documents directory (ex: /var/www/dolibarr/documents)- no / at end :" 16 55 2> $fichtemp - - #valret=$? - - #case $valret in - # 0) - #docs=`cat $fichtemp`;; - # 1) - #exit;; - # 255) - #exit;; - #esac - + # ---------------------------- confirmation DIALOG=${DIALOG=dialog} $DIALOG --title "Init Dolibarr with demo values" --clear \ @@ -177,6 +160,21 @@ echo "mysql -P$port -u$admin -p***** $base < $mydir/$dumpfile" mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile export res=$? + +# ---------------------------- copy demo files +export documentdir=`cat $mydir/../../htdocs/conf/conf.php | grep '^\$dolibarr_main_data_root' | sed -e 's/$dolibarr_main_data_root=//' | sed -e 's/;//' | sed -e "s/'//g" ` +if [ "x$documentdir" != "x" ] +then + echo cp -pr $mydir/documents_demo/* "$documentdir/" + cp -pr $mydir/documents_demo/* "$documentdir/" + echo cp -pr $mydir/../../htdocs/install/doctemplates/* "$documentdir/doctemplates/" + cp -pr $mydir/../../htdocs/install/doctemplates/* "$documentdir/doctemplates/" +else + echo Detection of documents directory failed so demo files were not copied. +fi + + + if [ "x$res" = "x0" ] then echo "Success, file successfully loaded." diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index f7102bc44e2..a2c7186933e 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2005 Eric Seigne - * Copyright (C) 2006-2015 Laurent Destailleur + * Copyright (C) 2006-2016 Laurent Destailleur * Copyright (C) 2007 Patrick Raguin * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2015 Raphaƫl Doursenaud @@ -118,9 +118,14 @@ if ($catname || $id > 0) $categstatic->ref=$cat->label; $categstatic->label=$cat->label; $categstatic->type=$cat->type; + $categstatic->color=$cat->color; + print 'color?' style="background: #'.$categstatic->color.';"':' style="background: #aaa"').'>'; print $categstatic->getNomUrl(1,''); + print ''; + print "\n"; + print "\t\t"; + print $cat->description; print "\n"; - print "\t\t".$cat->description."\n"; print "\t\n"; } print "";