From b30669a5d69bd2745686731e200dfe7584f5f22f Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 5 Apr 2012 11:07:16 +0200 Subject: [PATCH 01/10] Fix: missing $langs --- htdocs/core/modules/modSociete.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index 32aeb19fae367..77be89de79596 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier - * Copyright (C) 2005-2011 Regis Houssin + * Copyright (C) 2005-2012 Regis Houssin * * 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 @@ -327,7 +327,7 @@ function modSociete($db) */ function init($options='') { - global $conf; + global $conf, $langs; // We disable this to prevent pb of modules not correctly disabled //$this->remove($options); From d3068e0ba56e292ed93f3cc206dd6004fc74b3c7 Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Thu, 5 Apr 2012 11:46:56 +0200 Subject: [PATCH 02/10] Prepair to display within a custom place --- htdocs/admin/project.php | 308 +++++++++++++++++++++------------------ 1 file changed, 169 insertions(+), 139 deletions(-) diff --git a/htdocs/admin/project.php b/htdocs/admin/project.php index 1a7bc3b37f752..4dd4702a115d0 100644 --- a/htdocs/admin/project.php +++ b/htdocs/admin/project.php @@ -2,6 +2,7 @@ /* Copyright (C) 2010 Regis Houssin * Copyright (C) 2011 Laurent Destailleur * Copyright (C) 2011-2012 Juanjo Menent + * Copyright (C) 2011-2012 Philippe Grand * * 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 @@ -35,8 +36,8 @@ if (!$user->admin) accessforbidden(); -$value=GETPOST('value','action'); -$action=GETPOST('action','action'); +$value=GETPOST('value','alpha'); +$action=GETPOST('action','alpha'); /* @@ -69,17 +70,28 @@ $project = new Project($db); $project->initAsSpecimen(); - // Charge le modele - $dir = DOL_DOCUMENT_ROOT . "/core/modules/project/pdf/"; - $file = "pdf_".$modele.".modules.php"; - if (file_exists($dir.$file)) + // Search template files + $file=''; $classname=''; $filefound=0; + $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); + foreach($dirmodels as $reldir) { - $classname = "pdf_".$modele; - require_once($dir.$file); + $file=dol_buildpath($reldir."core/modules/project/pdf/pdf_".$modele.".modules.php",0); + if (file_exists($file)) + { + $filefound=1; + $classname = "pdf_".$modele; + break; + } + } + + + if ($filefound) + { + require_once($file); - $obj = new $classname($db); + $module = new $classname($db); - if ($obj->write_file($project,$langs) > 0) + if ($module->write_file($project,$langs) > 0) { header("Location: ".DOL_URL_ROOT."/document.php?modulepart=project&file=SPECIMEN.pdf"); return; @@ -172,6 +184,8 @@ * View */ +$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); + $form=new Form($db); llxHeader(); @@ -199,80 +213,89 @@ clearstatcache(); -$handle = opendir($dir); -if (is_resource($handle)) +foreach ($dirmodels as $reldir) { - $var=true; + $dir = dol_buildpath($reldir."core/modules/project/"); - while (($file = readdir($handle))!==false) + if (is_dir($dir)) { - if (substr($file, 0, 12) == 'mod_project_' && substr($file, dol_strlen($file)-3, 3) == 'php') + $handle = opendir($dir); + if (is_resource($handle)) { - $file = substr($file, 0, dol_strlen($file)-4); - - require_once(DOL_DOCUMENT_ROOT ."/core/modules/project/".$file.".php"); - - $module = new $file; + $var=true; - if ($module->isEnabled()) + while (($file = readdir($handle))!==false) { - // Show modules according to features level - if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; - if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; - - $var=!$var; - print ''.$module->nom."\n"; - print $module->info(); - print ''; - - // Show example of numbering module - print ''; - $tmp=$module->getExample(); - if (preg_match('/^Error/',$tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; } - elseif ($tmp=='NotConfigured') print $langs->trans($tmp); - else print $tmp; - print ''."\n"; - - print ''; - if ($conf->global->PROJECT_ADDON == "$file") - { - print img_picto($langs->trans("Activated"),'switch_on'); - } - else + if (preg_match('/^(mod_.*)\.php$/i',$file,$reg)) { - print ''.img_picto($langs->trans("Disabled"),'switch_off').''; - } - print ''; + $file = $reg[1]; + $classname = substr($file,4); - $project=new Project($db); - $project->initAsSpecimen(); + require_once(DOL_DOCUMENT_ROOT ."/core/modules/project/".$file.".php"); - // Info - $htmltooltip=''; - $htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
'; - $nextval=$module->getNextValue($mysoc,$project); - if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval - { - $htmltooltip.=''.$langs->trans("NextValue").': '; - if ($nextval) - { - $htmltooltip.=$nextval.'
'; - } - else + $module = new $file; + + if ($module->isEnabled()) { - $htmltooltip.=$langs->trans($module->error).'
'; + // Show modules according to features level + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; + + $var=!$var; + print ''.$module->nom."\n"; + print $module->info(); + print ''; + + // Show example of numbering module + print ''; + $tmp=$module->getExample(); + if (preg_match('/^Error/',$tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; } + elseif ($tmp=='NotConfigured') print $langs->trans($tmp); + else print $tmp; + print ''."\n"; + + print ''; + if ($conf->global->PROJECT_ADDON == "$file") + { + print img_picto($langs->trans("Activated"),'switch_on'); + } + else + { + print ''.img_picto($langs->trans("Disabled"),'switch_off').''; + } + print ''; + + $project=new Project($db); + $project->initAsSpecimen(); + + // Info + $htmltooltip=''; + $htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
'; + $nextval=$module->getNextValue($mysoc,$project); + if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval + { + $htmltooltip.=''.$langs->trans("NextValue").': '; + if ($nextval) + { + $htmltooltip.=$nextval.'
'; + } + else + { + $htmltooltip.=$langs->trans($module->error).'
'; + } + } + + print ''; + print $form->textwithpicto('',$htmltooltip,1,0); + print ''; + + print ''; } } - - print ''; - print $form->textwithpicto('',$htmltooltip,1,0); - print ''; - - print ''; } + closedir($handle); } } - closedir($handle); } print '
'; @@ -282,7 +305,7 @@ * Modeles documents for projects */ -$dir = DOL_DOCUMENT_ROOT.'/core/modules/project/pdf/'; +//$dir = DOL_DOCUMENT_ROOT.'/core/modules/project/pdf/'; print_titre($langs->trans("ProjectsModelModule")); @@ -323,76 +346,83 @@ clearstatcache(); -$handle=opendir($dir); - $var=true; -if (is_resource($handle)) +foreach ($dirmodels as $reldir) { - while (($file = readdir($handle))!==false) - { - if (preg_match('/\.modules\.php$/i',$file) && substr($file,0,4) == 'pdf_') - { - $name = substr($file, 4, dol_strlen($file) -16); - $classname = substr($file, 0, dol_strlen($file) -12); - - $var=!$var; - print "\n $name"; - print "\n \n"; - require_once($dir.$file); - $module = new $classname($db); - print $module->description; - print "\n"; - - // Active - if (in_array($name, $def)) - { - print "\n"; - //if ($conf->global->PROJECT_ADDON_PDF != "$name") - //{ - print 'scandir.'&label='.urlencode($module->name).'">'; - print img_picto($langs->trans("Enabled"),'switch_on'); - print ''; - //} - //else - //{ - // print img_picto($langs->trans("Enabled"),'on'); - //} - print ""; - } - else - { - print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; - print ""; - } - - // Defaut - print ""; - if ($conf->global->PROJECT_ADDON_PDF == "$name") - { - print img_picto($langs->trans("Default"),'on'); - } - else - { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; - } - print ''; - - // Info - $htmltooltip = ''.$langs->trans("Name").': '.$module->name; - $htmltooltip.='
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); - $htmltooltip.='
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; - $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; - $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); - print ''; - $link=''.img_object($langs->trans("Preview"),'order').''; - print $form->textwithpicto('     '.$link,$htmltooltip,-1,0); - print ''; - - print "\n"; - } - } - closedir($handle); + $dir = dol_buildpath($reldir."core/modules/project/pdf/"); + + if (is_dir($dir)) + { + $handle=opendir($dir); + if (is_resource($handle)) + { + while (($file = readdir($handle))!==false) + { + if (substr($file, dol_strlen($file) -12) == '.modules.php' && substr($file,0,4) == 'pdf_') + { + $name = substr($file, 4, dol_strlen($file) -16); + $classname = substr($file, 0, dol_strlen($file) -12); + + $var=!$var; + print "\n $name"; + print "\n \n"; + require_once($dir.$file); + $module = new $classname($db); + print $module->description; + print "\n"; + + // Active + if (in_array($name, $def)) + { + print "\n"; + //if ($conf->global->PROJECT_ADDON_PDF != "$name") + //{ + print 'scandir.'&label='.urlencode($module->name).'">'; + print img_picto($langs->trans("Enabled"),'switch_on'); + print ''; + //} + //else + //{ + // print img_picto($langs->trans("Enabled"),'on'); + //} + print ""; + } + else + { + print "\n"; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print ""; + } + + // Defaut + print ""; + if ($conf->global->PROJECT_ADDON_PDF == "$name") + { + print img_picto($langs->trans("Default"),'on'); + } + else + { + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + } + print ''; + + // Info + $htmltooltip = ''.$langs->trans("Name").': '.$module->name; + $htmltooltip.='
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); + $htmltooltip.='
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; + $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; + $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); + print ''; + $link=''.img_object($langs->trans("Preview"),'order').''; + print $form->textwithpicto('     '.$link,$htmltooltip,-1,0); + print ''; + + print "\n"; + } + } + closedir($handle); + } + } } print '
'; @@ -402,4 +432,4 @@ $db->close(); llxFooter(); -?> +?> \ No newline at end of file From a66c18c4f8c40a59f43c62c8a9a027f06eadafea Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Thu, 5 Apr 2012 13:00:09 +0200 Subject: [PATCH 03/10] Prepair to display within a custom place --- .../core/modules/project/modules_project.php | 84 ++++++++++++++----- 1 file changed, 63 insertions(+), 21 deletions(-) diff --git a/htdocs/core/modules/project/modules_project.php b/htdocs/core/modules/project/modules_project.php index 03885e85a16ff..9a3403c449cfa 100644 --- a/htdocs/core/modules/project/modules_project.php +++ b/htdocs/core/modules/project/modules_project.php @@ -138,70 +138,112 @@ function getVersion() /** - * Create object on disk + * Create an intervention document on disk using template defined into PROJECT_ADDON_PDF * - * @param DoliDB $db objet base de donnee - * @param Object $object object project - * @param string $model force le modele a utiliser ('' to not force) - * @param Translate $outputlangs objet lang a utiliser pour traduction + * @param DoliDB $db objet base de donnee + * @param Object $object Object fichinter + * @param string $modele force le modele a utiliser ('' par defaut) + * @param Translate $outputlangs objet lang a utiliser pour traduction + * @param int $hidedetails Hide details of lines + * @param int $hidedesc Hide description + * @param int $hideref Hide ref + * @param HookManager $hookmanager Hook manager instance * @return int 0 if KO, 1 if OK */ -function project_pdf_create($db, $object, $model,$outputlangs) +function project_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $hookmanager=false) { global $conf,$langs; $langs->load("projects"); - $dir = DOL_DOCUMENT_ROOT."/core/modules/project/pdf/"; + $error=0; + + $srctemplatepath=''; // Positionne modele sur le nom du modele de projet a utiliser - if (! dol_strlen($model)) + if (! dol_strlen($modele)) { if (! empty($conf->global->PROJECT_ADDON_PDF)) { - $model = $conf->global->PROJECT_ADDON_PDF; + $modele = $conf->global->PROJECT_ADDON_PDF; } else { - $model='baleine'; - //print $langs->trans("Error")." ".$langs->trans("Error_PROJECT_ADDON_PDF_NotDefined"); - //return 0; + $modele='baleine'; } } + // If selected modele is a filename template (then $modele="modelname:filename") + $tmp=explode(':',$modele,2); + if (! empty($tmp[1])) + { + $modele=$tmp[0]; + $srctemplatepath=$tmp[1]; + } + + // Search template files + $file=''; $classname=''; $filefound=0; + $dirmodels=array('/'); + if (is_array($conf->modules_parts['models'])) $dirmodels=array_merge($dirmodels,$conf->modules_parts['models']); + foreach($dirmodels as $reldir) + { + foreach(array('doc','pdf') as $prefix) + { + $file = $prefix."_".$modele.".modules.php"; + + // On verifie l'emplacement du modele + $file=dol_buildpath($reldir."core/modules/project/pdf/".$file,0); + if (file_exists($file)) + { + $filefound=1; + $classname=$prefix.'_'.$modele; + break; + } + } + if ($filefound) break; + } + // Charge le modele - $file = "pdf_".$model.".modules.php"; - if (file_exists($dir.$file)) + if ($filefound) { - $classname = "pdf_".$model; - require_once($dir.$file); + require_once($file); $obj = new $classname($db); // We save charset_output to restore it because write_file can change it if needed for // output format that does not support UTF8. $sav_charset_output=$outputlangs->charset_output; - if ($obj->write_file($object,$outputlangs) > 0) + if ($obj->write_file($object, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref, $hookmanager) > 0) { $outputlangs->charset_output=$sav_charset_output; // we delete preview files require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); dol_delete_preview($object); + + // Success in building document. We build meta file. + dol_meta_create($object); + + // Appel des triggers + /*include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"); + $interface=new Interfaces($db); + $result=$interface->run_triggers('PROJECT_BUILDDOC',$object,$user,$langs,$conf); + if ($result < 0) { $error++; $this->errors=$interface->errors; }*/ + // Fin appel triggers + return 1; } else { $outputlangs->charset_output=$sav_charset_output; - dol_syslog("Erreur dans project_pdf_create"); - dol_print_error($db,$obj->error); + dol_print_error($db,"project_pdf_create Error: ".$obj->error); return 0; } } else { - print $langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists",$dir.$file); + print $langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists",$file); return 0; } } -?> +?> \ No newline at end of file From 8cfed3ff3f3fb934a95d7d14d356978582378b97 Mon Sep 17 00:00:00 2001 From: defrance69 Date: Thu, 5 Apr 2012 14:01:15 +0300 Subject: [PATCH 04/10] Update htdocs/product/index.php --- htdocs/product/index.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 670b0c0e2d6d6..27b8bf7065f6e 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -186,7 +186,7 @@ print ''; - print ''; + print ''; $var=True; @@ -222,6 +222,14 @@ print ""; + // Sell price + if (empty($conf->global->PRODUIT_MULTIPRICES)) + { + print ''; + } print '"; From df132198dfb10ec1c637302fbaea3fe6da017612 Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Thu, 5 Apr 2012 14:49:51 +0200 Subject: [PATCH 05/10] Prepair to display within a custom place --- htdocs/admin/project.php | 100 ++++++++++++--------------------------- 1 file changed, 29 insertions(+), 71 deletions(-) diff --git a/htdocs/admin/project.php b/htdocs/admin/project.php index 4dd4702a115d0..520bf2cb2862c 100644 --- a/htdocs/admin/project.php +++ b/htdocs/admin/project.php @@ -30,14 +30,17 @@ require_once(DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'); $langs->load("admin"); +$langs->load("errors"); $langs->load("other"); $langs->load("projects"); -if (!$user->admin) -accessforbidden(); +if (!$user->admin) accessforbidden(); -$value=GETPOST('value','alpha'); -$action=GETPOST('action','alpha'); +$value = GETPOST('value','alpha'); +$action = GETPOST('action','alpha'); +$label = GETPOST('label','alpha'); +$scandir = GETPOST('scandir','alpha'); +$type='project'; /* @@ -83,7 +86,6 @@ break; } } - if ($filefound) { @@ -111,26 +113,13 @@ if ($action == 'set') { - $label = GETPOST('label','alpha'); - $scandir = GETPOST('scandir','alpha'); - - $type='project'; - $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)"; - $sql.= " VALUES ('".$db->escape($value)."','".$type."',".$conf->entity.", "; - $sql.= ($label?"'".$db->escape($label)."'":'null').", "; - $sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null"); - $sql.= ")"; - $resql=$db->query($sql); + $ret = addDocumentModel($value, $type, $label, $scandir); } if ($action == 'del') { - $type='project'; - $sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model"; - $sql.= " WHERE nom = '".$db->escape($value)."'"; - $sql.= " AND type = '".$type."'"; - $sql.= " AND entity = ".$conf->entity; - if ($db->query($sql)) + $ret = delDocumentModel($value, $type); + if ($ret > 0) { if ($conf->global->PROJECT_ADDON_PDF == "$value") dolibarr_del_const($db, 'PROJECT_ADDON_PDF',$conf->entity); } @@ -138,37 +127,18 @@ if ($action == 'setdoc') { - $label = GETPOST('label','alpha'); - $scandir = GETPOST('scandir','alpha'); - - $db->begin(); - if (dolibarr_set_const($db, "PROJECT_ADDON_PDF",$value,'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 = $value; } // On active le modele - $type='project'; - $sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model"; - $sql_del.= " WHERE nom = '".$db->escape($value)."'"; - $sql_del.= " AND type = '".$type."'"; - $sql_del.= " AND entity = ".$conf->entity; - $result1=$db->query($sql_del); - - $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)"; - $sql.= " VALUES ('".$db->escape($value)."', '".$type."', ".$conf->entity.", "; - $sql.= ($label?"'".$db->escape($label)."'":'null').", "; - $sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null"); - $sql.= ")"; - $result2=$db->query($sql); - if ($result1 && $result2) + $ret = delDocumentModel($value, $type); + if ($ret > 0) { - $db->commit(); - } - else - { - $db->rollback(); + $ret = addDocumentModel($value, $type, $label, $scandir); } } @@ -177,7 +147,7 @@ // TODO Verifier si module numerotation choisi peut etre active // par appel methode canBeActivated - dolibarr_set_const($db, "PROJECT_ADDON",GETPOST('value','alpha'),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "PROJECT_ADDON",$value,'chaine',0,'',$conf->entity); } /* @@ -186,10 +156,10 @@ $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); -$form=new Form($db); - llxHeader(); +$form=new Form($db); + $linkback=''.$langs->trans("BackToModuleList").''; print_fiche_titre($langs->trans("ProjectsSetup"),$linkback,'setup'); @@ -197,9 +167,6 @@ // Project numbering module - -$dir = DOL_DOCUMENT_ROOT."/core/modules/project/"; - print_titre($langs->trans("ProjectsNumberingModules")); print '
'.$transRecordedType.'
'.$transRecordedType.'
"; print dol_print_date($db->jdate($objp->datem),'day'); print "'; + if ($objp->price_base_type == 'TTC') print price($objp->price_ttc).' '.$langs->trans("TTC"); + else print price($objp->price).' '.$langs->trans("HT"); + print ''; print $product_static->LibStatut($objp->tosell,5,0); print "
'; @@ -235,12 +202,12 @@ $module = new $file; - if ($module->isEnabled()) - { - // Show modules according to features level - if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; - if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; + // Show modules according to features level + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; + if ($module->isEnabled()) + { $var=!$var; print ''."\n"; print ''; @@ -305,8 +272,6 @@ * Modeles documents for projects */ -//$dir = DOL_DOCUMENT_ROOT.'/core/modules/project/pdf/'; - print_titre($langs->trans("ProjectsModelModule")); // Defini tableau def de modele @@ -374,17 +339,10 @@ // Active if (in_array($name, $def)) { - print ""; } else From 6f7773d7e29976ddee083b33b732244bf032a2dd Mon Sep 17 00:00:00 2001 From: FHenry Date: Thu, 5 Apr 2012 16:45:41 +0200 Subject: [PATCH 06/10] Correction lien desincription et mailto:email --- htdocs/comm/mailing/fiche.php | 4 ++-- scripts/emailings/mailing-send.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/mailing/fiche.php b/htdocs/comm/mailing/fiche.php index 6cad6fd8d497b..5ee7326f9bcdd 100644 --- a/htdocs/comm/mailing/fiche.php +++ b/htdocs/comm/mailing/fiche.php @@ -191,9 +191,9 @@ $tmpfield=explode('=',$other[4],2); $other5=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]); $substitutionarray=array( '__ID__' => $obj->source_id, - '__EMAIL__' => $obj->email, + '__EMAIL__' => ''.$obj->email.'', '__CHECK_READ__' => '', - '__UNSUSCRIBE__' => ''.$langs->trans("MailUnsubcribe").'', + '__UNSUSCRIBE__' => ''.$langs->trans("MailUnsubcribe").'', '__LASTNAME__' => $obj->nom, '__FIRSTNAME__' => $obj->prenom, '__OTHER1__' => $other1, diff --git a/scripts/emailings/mailing-send.php b/scripts/emailings/mailing-send.php index 4f74cd76439b2..160efde5c44f9 100644 --- a/scripts/emailings/mailing-send.php +++ b/scripts/emailings/mailing-send.php @@ -135,9 +135,9 @@ $other5=$other[4]; $substitutionarray=array( '__ID__' => $obj->source_id, - '__EMAIL__' => $obj->email, + '__EMAIL__' => ''.$obj->email.'', '__CHECK_READ__' => '', - '__UNSUSCRIBE__' => ''.$langs->trans("MailUnsubcribe").'', + '__UNSUSCRIBE__' => ''.$langs->trans("MailUnsubcribe").'', '__LASTNAME__' => $obj->lastname, '__FIRSTNAME__' => $obj->firstname, '__OTHER1__' => $other1, From 6d9d0c60e21b3d42469306fd439df93efbf2add1 Mon Sep 17 00:00:00 2001 From: FHenry Date: Thu, 5 Apr 2012 16:50:00 +0200 Subject: [PATCH 07/10] . --- htdocs/public/emailing/mailing-read.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/public/emailing/mailing-read.php b/htdocs/public/emailing/mailing-read.php index 1df669ee8b54a..a2aa89137c199 100644 --- a/htdocs/public/emailing/mailing-read.php +++ b/htdocs/public/emailing/mailing-read.php @@ -1,4 +1,3 @@ -#!/usr/bin/php From a8b0493531e3c7088c8e5646ae068ec776c5e979 Mon Sep 17 00:00:00 2001 From: simnandez Date: Thu, 5 Apr 2012 16:20:37 +0100 Subject: [PATCH 08/10] Fix: Sanitize data --- htdocs/boutique/admin/boutique.php | 45 ++++++++++++++-------------- htdocs/paybox/admin/paybox.php | 22 +++++++------- htdocs/paypal/admin/paypal.php | 48 +++++++++++++++--------------- 3 files changed, 58 insertions(+), 57 deletions(-) diff --git a/htdocs/boutique/admin/boutique.php b/htdocs/boutique/admin/boutique.php index 664a7041480ee..ba6dc123bac1a 100644 --- a/htdocs/boutique/admin/boutique.php +++ b/htdocs/boutique/admin/boutique.php @@ -3,6 +3,7 @@ * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2006 Laurent Destailleur + * Copyright (C) 2012 Juanjo Menent * * 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 @@ -39,17 +40,17 @@ * Actions */ -if ($_POST["save"]) +if (GETPOST('save','alpha')) { $db->begin(); $i=0; - $i+=dolibarr_set_const($db,'OSC_DB_HOST',trim($_POST["oscommerce_dbhost"]),'chaine',0,'',$conf->entity); - $i+=dolibarr_set_const($db,'OSC_DB_NAME',trim($_POST["oscommerce_dbname"]),'chaine',0,'',$conf->entity); - $i+=dolibarr_set_const($db,'OSC_DB_USER',trim($_POST["oscommerce_dbuser"]),'chaine',0,'',$conf->entity); - $i+=dolibarr_set_const($db,'OSC_DB_PASS',trim($_POST["oscommerce_dbpass"]),'chaine',0,'',$conf->entity); - $i+=dolibarr_set_const($db,'OSC_DB_TABLE_PREFIX',trim($_POST["oscommerce_db_table_prefix"]),'chaine',0,'',$conf->entity); + $i+=dolibarr_set_const($db,'OSC_DB_HOST',trim(GETPOST('oscommerce_dbhost','alpha')),'chaine',0,'',$conf->entity); + $i+=dolibarr_set_const($db,'OSC_DB_NAME',trim(GETPOST('oscommerce_dbname','alpha')),'chaine',0,'',$conf->entity); + $i+=dolibarr_set_const($db,'OSC_DB_USER',trim(GETPOST('oscommerce_dbuser','alpha')),'chaine',0,'',$conf->entity); + $i+=dolibarr_set_const($db,'OSC_DB_PASS',trim(GETPOST('oscommerce_dbpass','alpha')),'chaine',0,'',$conf->entity); + $i+=dolibarr_set_const($db,'OSC_DB_TABLE_PREFIX',trim(GETPOST('oscommerce_db_table_prefix','alpha')),'chaine',0,'',$conf->entity); $i+=dolibarr_set_const($db,'OSC_LANGUAGE_ID',1,'chaine',0,'',$conf->entity); if ($i >= 4) @@ -64,18 +65,18 @@ exit; } } -elseif ($_POST["test"]) +elseif (GETPOST('test','alpha')) { //$resql=$db->query("select count(*) from ".MAIN_DB_PREFIX."const"); //print "< ".$db." - ".$db->db." - ".$resql." - ".$db->error().">
\n"; // Test de la connexion a la database webcalendar $conf->oscommerce->db->type=$dolibarr_main_db_type; - $conf->oscommerce->db->host=$_POST["oscommerce_dbhost"]; - $conf->oscommerce->db->port=$_POST["oscommerce_dbport"]; - $conf->oscommerce->db->name=$_POST["oscommerce_dbname"]; - $conf->oscommerce->db->user=$_POST["oscommerce_dbuser"]; - $conf->oscommerce->db->pass=$_POST["oscommerce_dbpass"]; + $conf->oscommerce->db->host=GETPOST('oscommerce_dbhost','alpha'); + $conf->oscommerce->db->port=GETPOST('oscommerce_dbport','alpha'); + $conf->oscommerce->db->name=GETPOST('oscommerce_dbname','alpha'); + $conf->oscommerce->db->user=GETPOST('oscommerce_dbuser','alpha'); + $conf->oscommerce->db->pass=GETPOST('oscommerce_dbpass','alpha'); $oscommercedb=getDoliDBInstance($conf->oscommerce->db->type,$conf->oscommerce->db->host,$conf->oscommerce->db->user,$conf->oscommerce->db->pass,$conf->oscommerce->db->name,$conf->oscommerce->db->port); @@ -87,11 +88,11 @@ $sql.=" WHERE configuration_key='STORE_NAME'"; $resql=$oscommercedb->query($sql); if ($resql) { - $mesg ="
".$langs->trans("OSCommerceTestOk",$_POST["oscommerce_dbhost"],$_POST["oscommerce_dbname"],$_POST["oscommerce_dbuser"]); + $mesg ="
".$langs->trans("OSCommerceTestOk",GETPOST('oscommerce_dbhost','alpha'),GETPOST('oscommerce_dbname','alpha'),GETPOST('oscommerce_dbuser','alpha')); $mesg.="
"; } else { - $mesg ="
".$langs->trans("OSCommerceErrorConnectOkButWrongDatabase",'STORE_NAME',$_POST["oscommerce_db_table_prefix"]."configuration"); + $mesg ="
".$langs->trans("OSCommerceErrorConnectOkButWrongDatabase",'STORE_NAME',GETPOST('oscommerce_db_table_prefix','alpha')."configuration"); $mesg.="
"; } @@ -99,14 +100,14 @@ } elseif ($oscommercedb->connected == 1 && $oscommercedb->database_selected != 1) { - $mesg ="
".$langs->trans("OSCommerceTestKo1",$_POST["oscommerce_dbhost"],$_POST["oscommerce_dbname"]); + $mesg ="
".$langs->trans("OSCommerceTestKo1",GETPOST('oscommerce_dbhost','alpha'),GETPOST('oscommerce_dbname','alpha')); $mesg.="
".$oscommercedb->error(); $mesg.="
"; //$oscommercedb->close(); Ne pas fermer car la conn de webcal est la meme que dolibarr si parametre host/user/pass identique } else { - $mesg ="
".$langs->trans("OSCommerceTestKo2",$_POST["oscommerce_dbhost"],$_POST["oscommerce_dbuser"]); + $mesg ="
".$langs->trans("OSCommerceTestKo2",GETPOST('oscommerce_dbhost','alpha'),GETPOST('oscommerce_dbuser','alpha')); $mesg.="
".$oscommercedb->error(); $mesg.="
"; } @@ -142,7 +143,7 @@ $var=!$var; print "
"; print ""; -print ""; +print ""; print ""; @@ -150,7 +151,7 @@ $var=!$var; print ""; print ""; -print ""; +print ""; print ""; @@ -158,14 +159,14 @@ $var=!$var; print ""; print ""; -print ""; +print ""; print ""; print ""; $var=!$var; print ""; print ""; -print ""; +print ""; print ""; @@ -173,7 +174,7 @@ $var=!$var; print ""; print ""; -print ""; +print ""; print ''; @@ -181,7 +182,7 @@ $var=!$var; print ""; print ""; -print ""; +print ""; print ''; diff --git a/htdocs/paybox/admin/paybox.php b/htdocs/paybox/admin/paybox.php index c6f0966ed66d9..b28fe5f084eb7 100644 --- a/htdocs/paybox/admin/paybox.php +++ b/htdocs/paybox/admin/paybox.php @@ -1,7 +1,7 @@ * Copyright (C) 2005-2010 Laurent Destailleur - * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2011-2012 Juanjo Menent * * 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 @@ -36,30 +36,30 @@ if (!$user->admin) accessforbidden(); -$action = GETPOST("action"); +$action = GETPOST('action','alpha'); if ($action == 'setvalue' && $user->admin) { $db->begin(); //$result=dolibarr_set_const($db, "PAYBOX_IBS_DEVISE",$_POST["PAYBOX_IBS_DEVISE"],'chaine',0,'',$conf->entity); - $result=dolibarr_set_const($db, "PAYBOX_CGI_URL_V1", GETPOST("PAYBOX_CGI_URL_V1"),'chaine',0,'',$conf->entity); + $result=dolibarr_set_const($db, "PAYBOX_CGI_URL_V1", GETPOST('PAYBOX_CGI_URL_V1','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; - $result=dolibarr_set_const($db, "PAYBOX_CGI_URL_V2",GETPOST("PAYBOX_CGI_URL_V2"),'chaine',0,'',$conf->entity); + $result=dolibarr_set_const($db, "PAYBOX_CGI_URL_V2",GETPOST('PAYBOX_CGI_URL_V2','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; - $result=dolibarr_set_const($db, "PAYBOX_IBS_SITE",GETPOST("PAYBOX_IBS_SITE"),'chaine',0,'',$conf->entity); + $result=dolibarr_set_const($db, "PAYBOX_IBS_SITE",GETPOST('PAYBOX_IBS_SITE','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; - $result=dolibarr_set_const($db, "PAYBOX_IBS_RANG",GETPOST("PAYBOX_IBS_RANG"),'chaine',0,'',$conf->entity); + $result=dolibarr_set_const($db, "PAYBOX_IBS_RANG",GETPOST('PAYBOX_IBS_RANG','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; - $result=dolibarr_set_const($db, "PAYBOX_PBX_IDENTIFIANT",GETPOST("PAYBOX_PBX_IDENTIFIANT"),'chaine',0,'',$conf->entity); + $result=dolibarr_set_const($db, "PAYBOX_PBX_IDENTIFIANT",GETPOST('PAYBOX_PBX_IDENTIFIANT','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; - $result=dolibarr_set_const($db, "PAYBOX_CREDITOR",GETPOST("PAYBOX_CREDITOR"),'chaine',0,'',$conf->entity); + $result=dolibarr_set_const($db, "PAYBOX_CREDITOR",GETPOST('PAYBOX_CREDITOR','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; - $result=dolibarr_set_const($db, "PAYBOX_CSS_URL",GETPOST("PAYBOX_CSS_URL"),'chaine',0,'',$conf->entity); + $result=dolibarr_set_const($db, "PAYBOX_CSS_URL",GETPOST('PAYBOX_CSS_URL','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; - $result=dolibarr_set_const($db, "PAYBOX_MESSAGE_OK",GETPOST("PAYBOX_MESSAGE_OK"),'chaine',0,'',$conf->entity); + $result=dolibarr_set_const($db, "PAYBOX_MESSAGE_OK",GETPOST('PAYBOX_MESSAGE_OK','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; - $result=dolibarr_set_const($db, "PAYBOX_MESSAGE_KO",GETPOST("PAYBOX_MESSAGE_KO"),'chaine',0,'',$conf->entity); + $result=dolibarr_set_const($db, "PAYBOX_MESSAGE_KO",GETPOST('PAYBOX_MESSAGE_KO','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; if (! $error) diff --git a/htdocs/paypal/admin/paypal.php b/htdocs/paypal/admin/paypal.php index cf254f1de30ef..7d185c65c03a5 100644 --- a/htdocs/paypal/admin/paypal.php +++ b/htdocs/paypal/admin/paypal.php @@ -2,7 +2,7 @@ /* Copyright (C) 2004 Rodolphe Quiedeville * Copyright (C) 2005-2011 Laurent Destailleur * Copyright (C) 2011-2012 Regis Houssin - * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2011-2012 Juanjo Menent * * 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 @@ -39,34 +39,34 @@ if (!$user->admin) accessforbidden(); -$action = GETPOST("action"); +$action = GETPOST('action','alpha'); if ($action == 'setvalue' && $user->admin) { $db->begin(); - $result=dolibarr_set_const($db, "PAYPAL_API_SANDBOX",GETPOST("PAYPAL_API_SANDBOX"),'chaine',0,'',$conf->entity); + $result=dolibarr_set_const($db, "PAYPAL_API_SANDBOX",GETPOST('PAYPAL_API_SANDBOX','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; - $result=dolibarr_set_const($db, "PAYPAL_API_USER",GETPOST("PAYPAL_API_USER"),'chaine',0,'',$conf->entity); + $result=dolibarr_set_const($db, "PAYPAL_API_USER",GETPOST('PAYPAL_API_USER','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; - $result=dolibarr_set_const($db, "PAYPAL_API_PASSWORD",GETPOST("PAYPAL_API_PASSWORD"),'chaine',0,'',$conf->entity); + $result=dolibarr_set_const($db, "PAYPAL_API_PASSWORD",GETPOST('PAYPAL_API_PASSWORD','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; - $result=dolibarr_set_const($db, "PAYPAL_API_SIGNATURE",GETPOST("PAYPAL_API_SIGNATURE"),'chaine',0,'',$conf->entity); + $result=dolibarr_set_const($db, "PAYPAL_API_SIGNATURE",GETPOST('PAYPAL_API_SIGNATURE','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; - $result=dolibarr_set_const($db, "PAYPAL_CREDITOR",GETPOST("PAYPAL_CREDITOR"),'chaine',0,'',$conf->entity); + $result=dolibarr_set_const($db, "PAYPAL_CREDITOR",GETPOST('PAYPAL_CREDITOR','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; - $result=dolibarr_set_const($db, "PAYPAL_API_INTEGRAL_OR_PAYPALONLY",GETPOST("PAYPAL_API_INTEGRAL_OR_PAYPALONLY"),'chaine',0,'',$conf->entity); + $result=dolibarr_set_const($db, "PAYPAL_API_INTEGRAL_OR_PAYPALONLY",GETPOST('PAYPAL_API_INTEGRAL_OR_PAYPALONLY','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; - $result=dolibarr_set_const($db, "PAYPAL_CSS_URL",GETPOST("PAYPAL_CSS_URL"),'chaine',0,'',$conf->entity); + $result=dolibarr_set_const($db, "PAYPAL_CSS_URL",GETPOST('PAYPAL_CSS_URL','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; - $result=dolibarr_set_const($db, "PAYPAL_SECURITY_TOKEN",GETPOST("PAYPAL_SECURITY_TOKEN"),'chaine',0,'',$conf->entity); + $result=dolibarr_set_const($db, "PAYPAL_SECURITY_TOKEN",GETPOST('PAYPAL_SECURITY_TOKEN','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; - $result=dolibarr_set_const($db, "PAYPAL_SECURITY_TOKEN_UNIQUE",GETPOST("PAYPAL_SECURITY_TOKEN_UNIQUE"),'chaine',0,'',$conf->entity); + $result=dolibarr_set_const($db, "PAYPAL_SECURITY_TOKEN_UNIQUE",GETPOST('PAYPAL_SECURITY_TOKEN_UNIQUE','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; - $result=dolibarr_set_const($db, "PAYPAL_ADD_PAYMENT_URL",GETPOST("PAYPAL_ADD_PAYMENT_URL"),'chaine',0,'',$conf->entity); + $result=dolibarr_set_const($db, "PAYPAL_ADD_PAYMENT_URL",GETPOST('PAYPAL_ADD_PAYMENT_URL','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; - $result=dolibarr_set_const($db, "PAYPAL_MESSAGE_OK",GETPOST("PAYPAL_MESSAGE_OK"),'chaine',0,'',$conf->entity); + $result=dolibarr_set_const($db, "PAYPAL_MESSAGE_OK",GETPOST('PAYPAL_MESSAGE_OK','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; - $result=dolibarr_set_const($db, "PAYPAL_MESSAGE_KO",GETPOST("PAYPAL_MESSAGE_KO"),'chaine',0,'',$conf->entity); + $result=dolibarr_set_const($db, "PAYPAL_MESSAGE_KO",GETPOST('PAYPAL_MESSAGE_KO','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; if (! $error) @@ -286,12 +286,12 @@ function(token) { $langs->load("orders"); print '
'; print $langs->trans("EnterRefToBuildUrl",$langs->transnoentitiesnoconv("Order")).': '; - print ''; + print ''; print ''; - if (GETPOST('generate_order_ref')) + if (GETPOST('generate_order_ref','alpha')) { print '
-> '; - $url=getPaypalPaymentUrl(0,'order',GETPOST('generate_order_ref')); + $url=getPaypalPaymentUrl(0,'order',GETPOST('generate_order_ref','alpha')); print $url; print "
\n"; } @@ -308,12 +308,12 @@ function(token) { $langs->load("bills"); print ''; print $langs->trans("EnterRefToBuildUrl",$langs->transnoentitiesnoconv("Invoice")).': '; - print ''; + print ''; print ''; - if (GETPOST('generate_invoice_ref')) + if (GETPOST('generate_invoice_ref','alpha')) { print '
-> '; - $url=getPaypalPaymentUrl(0,'invoice',GETPOST('generate_invoice_ref')); + $url=getPaypalPaymentUrl(0,'invoice',GETPOST('generate_invoice_ref','alpha')); print $url; print "
\n"; } @@ -330,12 +330,12 @@ function(token) { $langs->load("contract"); print ''; print $langs->trans("EnterRefToBuildUrl",$langs->transnoentitiesnoconv("Contract")).': '; - print ''; + print ''; print ''; if (GETPOST('generate_contract_ref')) { print '
-> '; - $url=getPaypalPaymentUrl(0,'contractline',GETPOST('generate_contract_ref')); + $url=getPaypalPaymentUrl(0,'contractline',GETPOST('generate_contract_ref','alpha')); print $url; print "
\n"; } @@ -352,12 +352,12 @@ function(token) { $langs->load("members"); print ''; print $langs->trans("EnterRefToBuildUrl",$langs->transnoentitiesnoconv("Member")).': '; - print ''; + print ''; print ''; if (GETPOST('generate_member_ref')) { print '
-> '; - $url=getPaypalPaymentUrl(0,'membersubscription',GETPOST('generate_member_ref')); + $url=getPaypalPaymentUrl(0,'membersubscription',GETPOST('generate_member_ref','alpha')); print $url; print "
\n"; } From 75859e6cd692bb2a5e88dda0c0ec40825f824ec2 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 5 Apr 2012 19:25:58 +0200 Subject: [PATCH 09/10] Fix: avoid warning --- htdocs/main.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index e178e6461a4ea..a3bfc1f222f3a 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -868,8 +868,8 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs print ''."\n"; // Output style sheets (optioncss='print' or '') $themepath=dol_buildpath((empty($conf->global->MAIN_FORCETHEMEDIR)?'':$conf->global->MAIN_FORCETHEMEDIR).$conf->css,1); - $themeparam='?lang='.$langs->defaultlang.'&theme='.$conf->theme.(GETPOST('optioncss')?'&optioncss='.GETPOST('optioncss','alpha',1):''); - if (! empty($_SESSION['dol_resetcache'])) $themeparam.='&dol_resetcache='.$_SESSION['dol_resetcache']; + $themeparam='?lang='.$langs->defaultlang.'&theme='.$conf->theme.(GETPOST('optioncss')?'&optioncss='.GETPOST('optioncss','alpha',1):''); + if (! empty($_SESSION['dol_resetcache'])) $themeparam.='&dol_resetcache='.$_SESSION['dol_resetcache']; //print 'themepath='.$themepath.' themeparam='.$themeparam;exit; print ''."\n"; // CSS forced by modules (relative url starting with /) From a22259907b31aacfb80186375ac4f56ae09d5ed6 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 5 Apr 2012 20:12:11 +0200 Subject: [PATCH 10/10] Fix: possibility to custom helpdoc image --- htdocs/core/lib/functions.lib.php | 2 +- htdocs/main.inc.php | 2 +- htdocs/theme/{common => auguria/img}/helpdoc.png | Bin htdocs/theme/bureau2crea/img/helpdoc.png | Bin 0 -> 693 bytes htdocs/theme/cameleo/img/helpdoc.png | Bin 0 -> 693 bytes htdocs/theme/eldy/img/helpdoc.png | Bin 0 -> 693 bytes 6 files changed, 2 insertions(+), 2 deletions(-) rename htdocs/theme/{common => auguria/img}/helpdoc.png (100%) create mode 100644 htdocs/theme/bureau2crea/img/helpdoc.png create mode 100644 htdocs/theme/cameleo/img/helpdoc.png create mode 100644 htdocs/theme/eldy/img/helpdoc.png diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 4b2644d33d858..c98df1da5e630 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1705,7 +1705,7 @@ function img_picto_common($alt, $picto, $options='', $pictoisfullpath=0) global $conf; if (! preg_match('/(\.png|\.gif)$/i',$picto)) $picto.='.png'; if ($pictoisfullpath) return ''.dol_escape_htmltag($alt).''; - if (! empty($conf->global->MAIN_MODULE_CAN_OVERWRITE_COMMONICONS) && file_exists(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/'.$picto)) return ''.dol_escape_htmltag($alt).''; + if (! empty($conf->global->MAIN_MODULE_CAN_OVERWRITE_COMMONICONS) && file_exists(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/img/'.$picto)) return ''.dol_escape_htmltag($alt).''; return ''.dol_escape_htmltag($alt).''; } diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index a3bfc1f222f3a..309b93c9984a4 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1446,7 +1446,7 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me print '" href="'; print sprintf($helpbaseurl,urlencode(html_entity_decode($helppage))); print '">'; - print img_picto('',DOL_URL_ROOT.'/theme/common/helpdoc.png','',1).' '; + print img_picto('', 'helpdoc').' '; print $langs->trans($mode == 'wiki' ? 'OnlineHelp': 'Help'); //if ($mode == 'wiki') print ' ('.dol_trunc(strtr($helppage,'_',' '),8).')'; print ''; diff --git a/htdocs/theme/common/helpdoc.png b/htdocs/theme/auguria/img/helpdoc.png similarity index 100% rename from htdocs/theme/common/helpdoc.png rename to htdocs/theme/auguria/img/helpdoc.png diff --git a/htdocs/theme/bureau2crea/img/helpdoc.png b/htdocs/theme/bureau2crea/img/helpdoc.png new file mode 100644 index 0000000000000000000000000000000000000000..8cd950e7be1aabd9b452c150ddd128e6223f72e1 GIT binary patch literal 693 zcmeAS@N?(olHy`uVBq!ia0vp^0zk~i!3-n?Kj!QJQtTz3zOL*yIm8(h1*R4sQwIuh z7I;J!Gca%qfiUBxyLEqnf-LEdzK#qG8~eHcB(gFvFbW3vgt#WhMCT+Y<)x(*q^A{T zq!(wTmtW@nYe1b)pXa_PHJtQ(%w3?qit$u`?Ri(ncbbUdwb^e_0F5nw|MI0)pKU8nKygW z;ssllEZVwc(Y9racPwAJW5u$aE0^tBxqSD^<$G4G*t2@&-Zd-tty#5i?dtvO)*Rlr z{>Y~FN4IP|wr$Jt?ORXo*mi2yj?=q$p5C+T%--GS5AHvI=)i@;2QM5sboJ!%tEWy} zKXdBl`LlN}UATMs(u3>Q9^Sn1=+@20w{JbUd;96VyHD@md-3Sui^q>%J$dr_>C+Fd zUw?Z4?(>KDUp{{L{_W$>@85s_{8_O+r3V;T(Ir8C!T)In80P%iu?J|)0Z$jl5RU7< z{l|rx92lIhx4M>XOnBe4_xrj8ap`RvdH?)xf6>tQY|@$CDvY~U8m*eeI3ujYSz1p6?#fDol7fyyMQn;~@~bO(*jkIbo15g5+^oDJ*!SLv-94?NHTAgq&26>YkF*?h z-hD;pQ=P-MV|}4EcJ*1?o$qh^rx$wU$|uW5X7%wRialj+Rg5pQ^%CbiI4TMB3xlVt KpUXO@geCx!B8$ub literal 0 HcmV?d00001 diff --git a/htdocs/theme/cameleo/img/helpdoc.png b/htdocs/theme/cameleo/img/helpdoc.png new file mode 100644 index 0000000000000000000000000000000000000000..8cd950e7be1aabd9b452c150ddd128e6223f72e1 GIT binary patch literal 693 zcmeAS@N?(olHy`uVBq!ia0vp^0zk~i!3-n?Kj!QJQtTz3zOL*yIm8(h1*R4sQwIuh z7I;J!Gca%qfiUBxyLEqnf-LEdzK#qG8~eHcB(gFvFbW3vgt#WhMCT+Y<)x(*q^A{T zq!(wTmtW@nYe1b)pXa_PHJtQ(%w3?qit$u`?Ri(ncbbUdwb^e_0F5nw|MI0)pKU8nKygW z;ssllEZVwc(Y9racPwAJW5u$aE0^tBxqSD^<$G4G*t2@&-Zd-tty#5i?dtvO)*Rlr z{>Y~FN4IP|wr$Jt?ORXo*mi2yj?=q$p5C+T%--GS5AHvI=)i@;2QM5sboJ!%tEWy} zKXdBl`LlN}UATMs(u3>Q9^Sn1=+@20w{JbUd;96VyHD@md-3Sui^q>%J$dr_>C+Fd zUw?Z4?(>KDUp{{L{_W$>@85s_{8_O+r3V;T(Ir8C!T)In80P%iu?J|)0Z$jl5RU7< z{l|rx92lIhx4M>XOnBe4_xrj8ap`RvdH?)xf6>tQY|@$CDvY~U8m*eeI3ujYSz1p6?#fDol7fyyMQn;~@~bO(*jkIbo15g5+^oDJ*!SLv-94?NHTAgq&26>YkF*?h z-hD;pQ=P-MV|}4EcJ*1?o$qh^rx$wU$|uW5X7%wRialj+Rg5pQ^%CbiI4TMB3xlVt KpUXO@geCx!B8$ub literal 0 HcmV?d00001 diff --git a/htdocs/theme/eldy/img/helpdoc.png b/htdocs/theme/eldy/img/helpdoc.png new file mode 100644 index 0000000000000000000000000000000000000000..8cd950e7be1aabd9b452c150ddd128e6223f72e1 GIT binary patch literal 693 zcmeAS@N?(olHy`uVBq!ia0vp^0zk~i!3-n?Kj!QJQtTz3zOL*yIm8(h1*R4sQwIuh z7I;J!Gca%qfiUBxyLEqnf-LEdzK#qG8~eHcB(gFvFbW3vgt#WhMCT+Y<)x(*q^A{T zq!(wTmtW@nYe1b)pXa_PHJtQ(%w3?qit$u`?Ri(ncbbUdwb^e_0F5nw|MI0)pKU8nKygW z;ssllEZVwc(Y9racPwAJW5u$aE0^tBxqSD^<$G4G*t2@&-Zd-tty#5i?dtvO)*Rlr z{>Y~FN4IP|wr$Jt?ORXo*mi2yj?=q$p5C+T%--GS5AHvI=)i@;2QM5sboJ!%tEWy} zKXdBl`LlN}UATMs(u3>Q9^Sn1=+@20w{JbUd;96VyHD@md-3Sui^q>%J$dr_>C+Fd zUw?Z4?(>KDUp{{L{_W$>@85s_{8_O+r3V;T(Ir8C!T)In80P%iu?J|)0Z$jl5RU7< z{l|rx92lIhx4M>XOnBe4_xrj8ap`RvdH?)xf6>tQY|@$CDvY~U8m*eeI3ujYSz1p6?#fDol7fyyMQn;~@~bO(*jkIbo15g5+^oDJ*!SLv-94?NHTAgq&26>YkF*?h z-hD;pQ=P-MV|}4EcJ*1?o$qh^rx$wU$|uW5X7%wRialj+Rg5pQ^%CbiI4TMB3xlVt KpUXO@geCx!B8$ub literal 0 HcmV?d00001
'.$module->nom."\n"; print $module->info(); @@ -255,13 +222,13 @@ print ''; - if ($conf->global->PROJECT_ADDON == "$file") + if ($conf->global->PROJECT_ADDON == $classname) { print img_picto($langs->trans("Activated"),'switch_on'); } else { - print ''.img_picto($langs->trans("Disabled"),'switch_off').''; + print ''.img_picto($langs->trans("Disabled"),'switch_off').''; } print '\n"; - //if ($conf->global->PROJECT_ADDON_PDF != "$name") - //{ - print 'scandir.'&label='.urlencode($module->name).'">'; - print img_picto($langs->trans("Enabled"),'switch_on'); - print ''; - //} - //else - //{ - // print img_picto($langs->trans("Enabled"),'on'); - //} + print "\n"; + print 'scandir.'&label='.urlencode($module->name).'">'; + print img_picto($langs->trans("Enabled"),'switch_on'); + print ''; print "
".$langs->trans("OSCommerceServer")."global->OSC_DB_HOST) . "\" size=\"30\">global->OSC_DB_HOST) . "\" size=\"30\">localhost"; //print "
__dolibarr_main_db_host__ (".$dolibarr_main_db_host.")" print "
".$langs->trans("OSCommerceDatabaseName")."global->OSC_DB_NAME) . "\" size=\"30\">global->OSC_DB_NAME) . "\" size=\"30\">oscommerce"; //print "
__dolibarr_main_db_name__ (".$dolibarr_main_db_name.")"; print "
".$langs->trans("OSCommercePrefix")."global->DB_TABLE_PREFIX) . "\" size=\"30\">global->DB_TABLE_PREFIX) . "\" size=\"30\">osc_"; print "
".$langs->trans("OSCommerceUser")."global->OSC_DB_USER) . "\" size=\"30\">global->OSC_DB_USER) . "\" size=\"30\">oscommerceuser"; //print "
__dolibarr_main_db_user__ (".$dolibarr_main_db_user.")"; print "
".$langs->trans("Password")."global->OSC_DB_PASS) . "\" size=\"30\">global->OSC_DB_PASS) . "\" size=\"30\">'; //if ($dolibarr_main_db_pass) print '__dolibarr_main_db_pass__ ('.preg_replace('/./i','*',$dolibarr_main_db_pass).')'; print ' 
".$langs->trans("PasswordRetype")."global->OSC_DB_PASS) ."\" size=\"30\">global->OSC_DB_PASS) ."\" size=\"30\">'; //if ($dolibarr_main_db_pass) print '__dolibarr_main_db_pass__ ('.preg_replace('/./i','*',$dolibarr_main_db_pass).')'; print '