diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index 5503a906af2026089a7b15aafba89b92e9c8d270..328866eb9647f20c71e8d5c1a4b2e73b3122f856 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -171,28 +171,27 @@ if ($action == 'setModuleOptions') $db->begin(); for($i=0;$i < $post_size;$i++) - { - if (array_key_exists('param'.$i,$_POST)) - { - $param=GETPOST("param".$i,'alpha'); - $value=GETPOST("value".$i,'alpha'); - if ($param) $res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity); - if (! $res > 0) $error++; - } - } + { + if (array_key_exists('param'.$i,$_POST)) + { + $param=GETPOST("param".$i,'alpha'); + $value=GETPOST("value".$i,'alpha'); + if ($param) $res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity); + if (! $res > 0) $error++; + } + } if (! $error) - { - $db->commit(); - setEventMessage($langs->trans("SetupSaved")); - } - else - { - $db->rollback(); - setEventMessage($langs->trans("Error"),'errors'); + { + $db->commit(); + setEventMessage($langs->trans("SetupSaved")); + } + else + { + $db->rollback(); + setEventMessage($langs->trans("Error"),'errors'); } } - // Activate a model if ($action == 'set') { diff --git a/htdocs/core/modules/project/pdf/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php similarity index 99% rename from htdocs/core/modules/project/pdf/doc_generic_project_odt.modules.php rename to htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index 5b3aa9a85e2c01f0393e0b8226286d203593081b..fc18f1068cebf74dd7940e2f331ec12ce5c4b93a 100644 --- a/htdocs/core/modules/project/pdf/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -19,7 +19,7 @@ */ /** - * \file htdocs/core/modules/project/pdf/doc_generic_project_odt.modules.php + * \file htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php * \ingroup project * \brief File of class to build ODT documents for third parties */ diff --git a/htdocs/core/modules/project/pdf/index.html b/htdocs/core/modules/project/doc/index.html similarity index 100% rename from htdocs/core/modules/project/pdf/index.html rename to htdocs/core/modules/project/doc/index.html diff --git a/htdocs/core/modules/project/pdf/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php similarity index 99% rename from htdocs/core/modules/project/pdf/pdf_baleine.modules.php rename to htdocs/core/modules/project/doc/pdf_baleine.modules.php index 502e98eece2e5937df52b1adba6661a59728a452..6ce839daf992ed9d8adae967c3a16a7de8f20a69 100644 --- a/htdocs/core/modules/project/pdf/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php @@ -17,7 +17,7 @@ */ /** - * \file htdocs/core/modules/project/pdf/pdf_baleine.modules.php + * \file htdocs/core/modules/project/doc/pdf_baleine.modules.php * \ingroup project * \brief Fichier de la classe permettant de generer les projets au modele Baleine * \author Regis Houssin diff --git a/htdocs/core/modules/project/task/pdf/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php similarity index 96% rename from htdocs/core/modules/project/task/pdf/doc_generic_task_odt.modules.php rename to htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index acbd33bcc5a8dd4b0b4ea31735ddd8ee96eb3125..dd70a49f3e125c5dd1265e2022346a2cb956498e 100644 --- a/htdocs/core/modules/project/task/pdf/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -1,28 +1,28 @@ <?php /* Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es> -* Copyright (C) 2013 Florian Henry <florian.henry@ope-concept.pro> -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see <http://www.gnu.org/licenses/>. -* or see http://www.gnu.org/ -*/ + * Copyright (C) 2013 Florian Henry <florian.henry@ope-concept.pro> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * or see http://www.gnu.org/ + */ /** - * \file htdocs/core/modules/project/task/pdf/doc_generic_task_odt.modules.php + * \file htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php * \ingroup project * \brief File of class to build ODT documents for third parties -*/ + */ require_once DOL_DOCUMENT_ROOT.'/core/modules/project/modules_project.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/project/task/modules_task.php'; @@ -304,7 +304,7 @@ class doc_generic_task_odt extends ModelePDFTask $texte = $this->description.".<br>\n"; $texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'; $texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; - $texte.= '<input type="hidden" name="action" value="setModuleOptionsTask">'; + $texte.= '<input type="hidden" name="action" value="setModuleOptions">'; $texte.= '<input type="hidden" name="param1" value="PROJECT_TASK_ADDON_PDF_ODT_PATH">'; $texte.= '<table class="nobordernopadding" width="100%">'; @@ -367,7 +367,7 @@ class doc_generic_task_odt extends ModelePDFTask */ function write_file($object,$outputlangs,$srctemplatepath) { - global $user,$langs,$conf,$mysoc; + global $user,$langs,$conf,$mysoc,$hookmanager; if (empty($srctemplatepath)) { @@ -819,8 +819,8 @@ class doc_generic_task_odt extends ModelePDFTask // Call the beforeODTSave hook $parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); $reshook=$hookmanager->executeHooks('beforeODTSave',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks - - + + // Write new file if (!empty($conf->global->MAIN_ODT_AS_PDF)) { try { @@ -838,9 +838,9 @@ class doc_generic_task_odt extends ModelePDFTask return -1; } } - + $reshook=$hookmanager->executeHooks('afterODTCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks - + if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); diff --git a/htdocs/core/modules/project/task/pdf/index.html b/htdocs/core/modules/project/task/doc/index.html similarity index 100% rename from htdocs/core/modules/project/task/pdf/index.html rename to htdocs/core/modules/project/task/doc/index.html diff --git a/htdocs/projet/admin/project.php b/htdocs/projet/admin/project.php index a23f65edafbbb35fe90973fc308288b889348726..bf9951129ad88224e15e10819a21ecb4f61d8183 100644 --- a/htdocs/projet/admin/project.php +++ b/htdocs/projet/admin/project.php @@ -1,9 +1,9 @@ <?php -/* Copyright (C) 2010 Regis Houssin <regis.houssin@capnetworks.com> - * Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net> - * Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es> - * Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com> - * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> +/* Copyright (C) 2010-2014 Regis Houssin <regis.houssin@capnetworks.com> + * Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net> + * Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es> + * Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com> + * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -99,7 +99,7 @@ else if ($action == 'specimen') $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); foreach($dirmodels as $reldir) { - $file=dol_buildpath($reldir."core/modules/project/pdf/pdf_".$modele.".modules.php",0); + $file=dol_buildpath($reldir."core/modules/project/doc/pdf_".$modele.".modules.php",0); if (file_exists($file)) { $filefound=1; @@ -144,7 +144,7 @@ else if ($action == 'specimentask') $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); foreach($dirmodels as $reldir) { - $file=dol_buildpath($reldir."core/modules/project/task/pdf/pdf_".$modele.".modules.php",0); + $file=dol_buildpath($reldir."core/modules/project/task/doc/pdf_".$modele.".modules.php",0); if (file_exists($file)) { $filefound=1; @@ -177,6 +177,35 @@ else if ($action == 'specimentask') } } +// Define constants for submodules that contains parameters (forms with param1, param2, ... and value1, value2, ...) +if ($action == 'setModuleOptions') +{ + $post_size=count($_POST); + + $db->begin(); + + for($i=0;$i < $post_size;$i++) + { + if (array_key_exists('param'.$i,$_POST)) + { + $param=GETPOST("param".$i,'alpha'); + $value=GETPOST("value".$i,'alpha'); + if ($param) $res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity); + if (! $res > 0) $error++; + } + } + if (! $error) + { + $db->commit(); + setEventMessage($langs->trans("SetupSaved")); + } + else + { + $db->rollback(); + setEventMessage($langs->trans("Error"),'errors'); + } +} + // Activate a model else if ($action == 'set') { @@ -256,26 +285,10 @@ else if ($action == 'setmodtask') dolibarr_set_const($db, "PROJECT_TASK_ADDON",$value,'chaine',0,'',$conf->entity); } -else if ($action=='setModuleOptions') { - if (dolibarr_set_const($db, "PROJECT_ADDON_PDF_ODT_PATH",GETPOST('value1'),'chaine',0,'',$conf->entity)) - { - // La constante qui a ete lue en avant du nouveau set - // on passe donc par une variable pour avoir un affichage coherent - $conf->global->PROJECT_ADDON_PDF_ODT_PATH = GETPOST('value1'); - } -} -else if ($action=='setModuleOptionsTask') { - if (dolibarr_set_const($db, "PROJECT_TASK_ADDON_PDF_ODT_PATH",GETPOST('value1'),'chaine',0,'',$conf->entity)) - { - // La constante qui a ete lue en avant du nouveau set - // on passe donc par une variable pour avoir un affichage coherent - $conf->global->PROJECT_TASK_ADDON_PDF_ODT_PATH = GETPOST('value1'); - } -} /* * View -*/ + */ $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); @@ -542,99 +555,108 @@ clearstatcache(); $var=true; foreach ($dirmodels as $reldir) { - $dir = dol_buildpath($reldir."core/modules/project/pdf/"); - - if (is_dir($dir)) + foreach (array('','/doc') as $valdir) { - $handle=opendir($dir); - if (is_resource($handle)) + $dir = dol_buildpath($reldir."core/modules/project/".$valdir); + + if (is_dir($dir)) { - while (($file = readdir($handle))!==false) + $handle=opendir($dir); + if (is_resource($handle)) { - if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file)) + while (($file = readdir($handle))!==false) { - if (file_exists($dir.'/'.$file)) - { - $name = substr($file, 4, dol_strlen($file) -16); - $classname = substr($file, 0, dol_strlen($file) -12); - - require_once $dir.'/'.$file; - $module = new $classname($db); - - $modulequalified=1; - if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0; - if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0; + $filelist[]=$file; + } + closedir($handle); + arsort($filelist); - if ($modulequalified) + foreach($filelist as $file) + { + if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file)) + { + if (file_exists($dir.'/'.$file)) { - $var=!$var; - print '<tr '.$bc[$var].'><td width="100">'; - print (empty($module->name)?$name:$module->name); - print "</td><td>\n"; - if (method_exists($module,'info')) print $module->info($langs); - else print $module->description; - print "</td>\n"; - - // Active - if (in_array($name, $def)) - { - print "<td align=\"center\">\n"; - print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'; - print img_picto($langs->trans("Enabled"),'switch_on'); - print '</a>'; - print "</td>"; - } - else - { - print "<td align=\"center\">\n"; - print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>'; - print "</td>"; - } + $name = substr($file, 4, dol_strlen($file) -16); + $classname = substr($file, 0, dol_strlen($file) -12); - // Default - print "<td align=\"center\">"; - if ($conf->global->PROJECT_ADDON_PDF == "$name") - { - print img_picto($langs->trans("Default"),'on'); - } - else - { - print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>'; - } - print '</td>'; + require_once $dir.'/'.$file; + $module = new $classname($db); - // Info - $htmltooltip = ''.$langs->trans("Name").': '.$module->name; - $htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); - if ($module->type == 'pdf') - { - $htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; - } - $htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>'; - $htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); - - print '<td align="center">'; - print $form->textwithpicto('',$htmltooltip,1,0); - print '</td>'; - - // Preview - print '<td align="center">'; - if ($module->type == 'pdf') - { - print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'bill').'</a>'; - } - else + $modulequalified=1; + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0; + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0; + + if ($modulequalified) { - print img_object($langs->trans("PreviewNotAvailable"),'generic'); + $var=!$var; + print '<tr '.$bc[$var].'><td width="100">'; + print (empty($module->name)?$name:$module->name); + print "</td><td>\n"; + if (method_exists($module,'info')) print $module->info($langs); + else print $module->description; + print "</td>\n"; + + // Active + if (in_array($name, $def)) + { + print "<td align=\"center\">\n"; + print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'; + print img_picto($langs->trans("Enabled"),'switch_on'); + print '</a>'; + print "</td>"; + } + else + { + print "<td align=\"center\">\n"; + print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>'; + print "</td>"; + } + + // Default + print "<td align=\"center\">"; + if ($conf->global->PROJECT_ADDON_PDF == "$name") + { + print img_picto($langs->trans("Default"),'on'); + } + else + { + print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>'; + } + print '</td>'; + + // Info + $htmltooltip = ''.$langs->trans("Name").': '.$module->name; + $htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); + if ($module->type == 'pdf') + { + $htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; + } + $htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>'; + $htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); + + print '<td align="center">'; + print $form->textwithpicto('',$htmltooltip,1,0); + print '</td>'; + + // Preview + print '<td align="center">'; + if ($module->type == 'pdf') + { + print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'bill').'</a>'; + } + else + { + print img_object($langs->trans("PreviewNotAvailable"),'generic'); + } + print '</td>'; + + print "</tr>\n"; } - print '</td>'; - - print "</tr>\n"; - } + } } } } - closedir($handle); } } } @@ -688,98 +710,107 @@ clearstatcache(); $var=true; foreach ($dirmodels as $reldir) { - $dir = dol_buildpath($reldir."core/modules/project/task/pdf/"); - - if (is_dir($dir)) + foreach (array('','/doc') as $valdir) { - $handle=opendir($dir); - if (is_resource($handle)) + $dir = dol_buildpath($reldir."core/modules/project/task/".$valdir); + + if (is_dir($dir)) { - while (($file = readdir($handle))!==false) + $handle=opendir($dir); + if (is_resource($handle)) { - if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file)) + while (($file = readdir($handle))!==false) { - if (file_exists($dir.'/'.$file)) - { - $name = substr($file, 4, dol_strlen($file) -16); - $classname = substr($file, 0, dol_strlen($file) -12); - - require_once $dir.'/'.$file; - $module = new $classname($db); - - $modulequalified=1; - if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0; - if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0; + $filelist[]=$file; + } + closedir($handle); + arsort($filelist); - if ($modulequalified) + foreach($filelist as $file) + { + if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file)) + { + if (file_exists($dir.'/'.$file)) { - $var = !$var; - print '<tr '.$bc[$var].'><td width="100">'; - print (empty($module->name)?$name:$module->name); - print "</td><td>\n"; - if (method_exists($module,'info')) print $module->info($langs); - else print $module->description; - print "</td>\n"; - - // Active - if (in_array($name, $def)) - { - print "<td align=\"center\">\n"; - print '<a href="'.$_SERVER["PHP_SELF"].'?action=deltask&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'; - print img_picto($langs->trans("Enabled"),'switch_on'); - print '</a>'; - print "</td>"; - } - else - { - print "<td align=\"center\">\n"; - print '<a href="'.$_SERVER["PHP_SELF"].'?action=settask&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>'; - print "</td>"; - } + $name = substr($file, 4, dol_strlen($file) -16); + $classname = substr($file, 0, dol_strlen($file) -12); - // Defaut - print "<td align=\"center\">"; - if ($conf->global->PROJECT_TASK_ADDON_PDF == "$name") - { - print img_picto($langs->trans("Default"),'on'); - } - else - { - print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoctask&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>'; - } - print '</td>'; + require_once $dir.'/'.$file; + $module = new $classname($db); - // Info - $htmltooltip = ''.$langs->trans("Name").': '.$module->name; - $htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); - if ($module->type == 'pdf') - { - $htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; - } - $htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>'; - $htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); - - print '<td align="center">'; - print $form->textwithpicto('',$htmltooltip,1,0); - print '</td>'; - - // Preview - print '<td align="center">'; - if ($module->type == 'pdf') - { - print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimentask&module='.$name.'">'.img_object($langs->trans("Preview"),'bill').'</a>'; - } - else + $modulequalified=1; + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0; + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0; + + if ($modulequalified) { - print img_object($langs->trans("PreviewNotAvailable"),'generic'); + $var = !$var; + print '<tr '.$bc[$var].'><td width="100">'; + print (empty($module->name)?$name:$module->name); + print "</td><td>\n"; + if (method_exists($module,'info')) print $module->info($langs); + else print $module->description; + print "</td>\n"; + + // Active + if (in_array($name, $def)) + { + print "<td align=\"center\">\n"; + print '<a href="'.$_SERVER["PHP_SELF"].'?action=deltask&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'; + print img_picto($langs->trans("Enabled"),'switch_on'); + print '</a>'; + print "</td>"; + } + else + { + print "<td align=\"center\">\n"; + print '<a href="'.$_SERVER["PHP_SELF"].'?action=settask&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>'; + print "</td>"; + } + + // Defaut + print "<td align=\"center\">"; + if ($conf->global->PROJECT_TASK_ADDON_PDF == "$name") + { + print img_picto($langs->trans("Default"),'on'); + } + else + { + print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoctask&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>'; + } + print '</td>'; + + // Info + $htmltooltip = ''.$langs->trans("Name").': '.$module->name; + $htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); + if ($module->type == 'pdf') + { + $htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; + } + $htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>'; + $htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); + + print '<td align="center">'; + print $form->textwithpicto('',$htmltooltip,1,0); + print '</td>'; + + // Preview + print '<td align="center">'; + if ($module->type == 'pdf') + { + print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimentask&module='.$name.'">'.img_object($langs->trans("Preview"),'bill').'</a>'; + } + else + { + print img_object($langs->trans("PreviewNotAvailable"),'generic'); + } + print '</td>'; + print "</tr>\n"; } - print '</td>'; - print "</tr>\n"; } } } } - closedir($handle); } } } diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index fb7da8636b274c518f889cfa0a40fd260089eefe..9659eb2ffe8f1711f1a443c4f997679b69e5749c 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1368,7 +1368,7 @@ class Project extends CommonObject } } - $modelpath = "core/modules/project/pdf/"; + $modelpath = "core/modules/project/doc/"; return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref); } diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 2f4cc85cf7f9d0ee4ef8e51f294a266d3e431685..13360110310c9b00626704f0ee21740e4d672e5f 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -1343,7 +1343,7 @@ class Task extends CommonObject } } - $modelpath = "core/modules/project/task/pdf/"; + $modelpath = "core/modules/project/task/doc/"; return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref); } diff --git a/test/phpunit/BuildDocTest.php b/test/phpunit/BuildDocTest.php index 3f20b99fd14b795efb181a59c88d79356b5d8be9..3ed7a6524c7bda3298e686f331409586b5aa30d4 100644 --- a/test/phpunit/BuildDocTest.php +++ b/test/phpunit/BuildDocTest.php @@ -42,7 +42,7 @@ require_once dirname(__FILE__).'/../../htdocs/core/lib/pdf.lib.php'; require_once dirname(__FILE__).'/../../htdocs/core/modules/facture/doc/pdf_crabe.modules.php'; require_once dirname(__FILE__).'/../../htdocs/core/modules/propale/doc/pdf_azur.modules.php'; require_once dirname(__FILE__).'/../../htdocs/core/modules/commande/doc/pdf_einstein.modules.php'; -require_once dirname(__FILE__).'/../../htdocs/core/modules/project/pdf/pdf_baleine.modules.php'; +require_once dirname(__FILE__).'/../../htdocs/core/modules/project/doc/pdf_baleine.modules.php'; require_once dirname(__FILE__).'/../../htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php'; require_once dirname(__FILE__).'/../../htdocs/core/modules/expedition/doc/pdf_merou.modules.php'; require_once dirname(__FILE__).'/../../htdocs/core/modules/expedition/doc/pdf_rouget.modules.php';