From 665aefe75e23835a6c9b5adcce5c3a272a6525ef Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 19 Aug 2010 20:36:01 +0000 Subject: [PATCH] Fix: Error management if javascript disabled. --- htdocs/core/photos_resize.php | 6 ++++++ htdocs/projet/ganttview.php | 27 +++++++++++++++++++-------- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/htdocs/core/photos_resize.php b/htdocs/core/photos_resize.php index 7d01174fb37..f4a0e149898 100644 --- a/htdocs/core/photos_resize.php +++ b/htdocs/core/photos_resize.php @@ -152,6 +152,9 @@ print '
'; print '
'."\n"; +if (! empty($conf->use_javascript_ajax)) +{ + $infoarray=dol_getImageSize($conf->product->dir_output."/".urldecode($_GET["file"])); $height=$infoarray['height']; $width=$infoarray['width']; @@ -182,5 +185,8 @@ print '
'; print ''; +} + + llxFooter('$Date$ - $Revision$'); ?> \ No newline at end of file diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php index 6bc14908700..95021110f00 100644 --- a/htdocs/projet/ganttview.php +++ b/htdocs/projet/ganttview.php @@ -65,11 +65,13 @@ $arrayofcss=array( '/includes/jsgantt/jsgantt.css' ); -$arrayofjs=array( -'/includes/jsgantt/jsgantt.js', -'/projet/jsgantt_language.js.php?lang='.$langs->defaultlang -); - +if (! empty($conf->use_javascript_ajax)) +{ + $arrayofjs=array( + '/includes/jsgantt/jsgantt.js', + '/projet/jsgantt_language.js.php?lang='.$langs->defaultlang + ); +} $form=new Form($db); $formother=new FormOther($db); @@ -236,9 +238,18 @@ if (sizeof($tasksarray)>0) //var_dump($tasks); print "\n"; - print '
'."\n"; - include_once(DOL_DOCUMENT_ROOT.'/projet/ganttchart.php'); - print '
'."\n"; + + if (! empty($conf->use_javascript_ajax)) + { + print '
'."\n"; + include_once(DOL_DOCUMENT_ROOT.'/projet/ganttchart.php'); + print '
'."\n"; + } + else + { + $langs->load("admin"); + print $langs->trans("AvailableOnlyIfJavascriptAndAjaxNotDisabled"); + } } else {