From 247fd296627719a869414e94d86e1111135ec241 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 31 Aug 2011 18:47:29 +0000 Subject: [PATCH] For the "default" field, we keep usa of standard on and off button because it is not a feature we activate or not but a choice of one line among others. I will change this later to replace with a checkbox. --- htdocs/admin/commande.php | 33 ++++++---------------- htdocs/admin/expedition.php | 50 ++++++++++++++++----------------- htdocs/admin/facture.php | 31 +++++++++++---------- htdocs/admin/fichinter.php | 55 ++++++++++++++++--------------------- htdocs/admin/livraison.php | 35 ++++++++++++----------- htdocs/admin/project.php | 44 +++++++++++++++-------------- htdocs/admin/propale.php | 20 +++++++------- 7 files changed, 123 insertions(+), 145 deletions(-) diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 9111e4e7210..a4ba25d7d1a 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -120,13 +120,13 @@ if ($action == 'del') { $type='order'; $sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model"; - $sql.= " WHERE nom = '".$value."'"; + $sql.= " WHERE nom = '".$db->escape($value)."'"; $sql.= " AND type = '".$type."'"; $sql.= " AND entity = ".$conf->entity; if ($db->query($sql)) { - + if ($conf->global->COMMANDE_ADDON_PDF == "$value") dolibarr_del_const($db, 'COMMANDE_ADDON_PDF',$conf->entity); } } @@ -207,22 +207,7 @@ if ($action == 'set_COMMANDE_FREE_TEXT') $mesg = "".$langs->trans("Error").""; } } -/* -if ($action == 'setvalidorder') -{ - dolibarr_set_const($db, "COMMANDE_VALID_AFTER_CLOSE_PROPAL",$_POST["validorder"],'chaine',0,'',$conf->entity); -} -if ($action == 'deliverycostline') -{ - dolibarr_set_const($db, "COMMANDE_ADD_DELIVERY_COST_LINE",$_POST["addline"],'chaine',0,'',$conf->entity); -} - -if ($action == 'set_use_customer_contact_as_recipient') -{ - dolibarr_set_const($db, "COMMANDE_USE_CUSTOMER_CONTACT_AS_RECIPIENT",$_POST["use_customer_contact_as_recipient"],'chaine',0,'',$conf->entity); -} -*/ /* * View @@ -417,16 +402,16 @@ foreach ($conf->file->dol_document_root as $dirroot) print "\n"; if (in_array($name, $def)) { - if ($conf->global->COMMANDE_ADDON_PDF != "$name") - { + //if ($conf->global->COMMANDE_ADDON_PDF != "$name") + //{ print 'scandir.'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Activated"),'switch_on'); print ''; - } - else - { - print img_picto($langs->trans("Activated"),'switch_on'); - } + //} + //else + //{ + // print img_picto($langs->trans("Activated"),'switch_on'); + //} } else { diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index f0e468c7c53..c6423d0832b 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -90,7 +90,7 @@ if ($action == 'set') { $label = GETPOST("label"); $scandir = GETPOST("scandir"); - + $type='shipping'; $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)"; $sql.= " VALUES ('".$db->escape($value)."','".$type."',".$conf->entity.", "; @@ -107,13 +107,13 @@ if ($action == 'del') { $type='shipping'; $sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model"; - $sql.= " WHERE nom = '".$value."'"; + $sql.= " WHERE nom = '".$db->escape($value)."'"; $sql.= " AND type = '".$type."'"; $sql.= " AND entity = ".$conf->entity; if ($db->query($sql)) { - + if ($conf->global->EXPEDITION_ADDON_PDF == "$value") dolibarr_del_const($db, 'EXPEDITION_ADDON_PDF',$conf->entity); } } @@ -122,7 +122,7 @@ if ($action == 'setdoc') { $label = GETPOST("label"); $scandir = GETPOST("scandir"); - + $db->begin(); if (dolibarr_set_const($db, "EXPEDITION_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) @@ -157,7 +157,7 @@ if ($action == 'setdoc') // TODO A quoi servent les methode d'expedition ? if ($action == 'setmethod' || $action== 'setmod') { - $module=GETPOST("module"); + $module=GETPOST("module"); $moduleid=GETPOST("moduleid"); $statut=GETPOST("statut"); @@ -229,11 +229,11 @@ if ($action == 'setmod') { // TODO Verifier si module numerotation choisi peut etre active // par appel methode canBeActivated - - $module=GETPOST("module"); - + + $module=GETPOST("module"); + dolibarr_set_const($db, "EXPEDITION_ADDON",$module,'chaine',0,'',$conf->entity); - + } if ($action == 'updateMask') @@ -241,7 +241,7 @@ if ($action == 'updateMask') $maskconst=GETPOST("maskconstexpedition"); $maskvalue=GETPOST("maskexpedition"); if ($maskconst) $res = dolibarr_set_const($db,$maskconst,$maskvalue,'chaine',0,'',$conf->entity); - + if (! $res > 0) $error++; if (! $error) @@ -263,7 +263,7 @@ if ($action == 'set_SHIPPING_DRAFT_WATERMARK') { $draft=GETPOST("SHIPPING_DRAFT_WATERMARK"); $res = dolibarr_set_const($db, "SHIPPING_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity); - + if (! $res > 0) $error++; if (! $error) @@ -343,7 +343,7 @@ print ''.$langs->trans("Name").''; print ''.$langs->trans("Description").''; print ''.$langs->trans("Example").''; print ''.$langs->trans("Status").''; -print ''.$langs->trans("Infos").''; +print ''.$langs->trans("Infos").''; print "\n"; clearstatcache(); @@ -479,7 +479,7 @@ print ''.$langs->trans("Name").''; print ''.$langs->trans("Description").''; print ''.$langs->trans("Status").''; print ''.$langs->trans("Default").''; -print ''.$langs->trans("Infos").''; +print ''.$langs->trans("Infos").''; print "\n"; clearstatcache(); @@ -516,16 +516,16 @@ foreach ($conf->file->dol_document_root as $dirroot) if (in_array($name, $def)) { print "\n"; - if ($conf->global->EXPEDITION_ADDON_PDF != $name) - { + //if ($conf->global->EXPEDITION_ADDON_PDF != $name) + //{ print ''; print img_picto($langs->trans("Activated"),'switch_on'); print ''; - } - else - { - print img_picto($langs->trans("Activated"),'switch_on'); - } + //} + //else + //{ + // print img_picto($langs->trans("Activated"),'switch_on'); + //} print ""; } else @@ -539,11 +539,11 @@ foreach ($conf->file->dol_document_root as $dirroot) print ""; if ($conf->global->EXPEDITION_ADDON_PDF == $name) { - print img_picto($langs->trans("Default"),'switch_on'); + print img_picto($langs->trans("Default"),'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; } print ''; @@ -554,10 +554,8 @@ foreach ($conf->file->dol_document_root as $dirroot) $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); print ''; - print $html->textwithpicto('',$htmltooltip,1,0); - print ''; - print ''; - print 'scandir.'&label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"),'sending').''; + $link='scandir.'&label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"),'sending').''; + print $html->textwithpicto('     '.$link,$htmltooltip,-1,0); print ''; print ''; diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 5e3d5e5f45d..285f2ec3584 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2010 Laurent Destailleur + * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005 Eric Seigne * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) @@ -38,6 +38,9 @@ $langs->load("errors"); if (!$user->admin) accessforbidden(); +$action = GETPOST("action"); +$value = GETPOST("value"); + $typeconst=array('yesno','texte','chaine'); @@ -123,13 +126,13 @@ if ($_GET["action"] == 'del') { $type='invoice'; $sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model"; - $sql.= " WHERE nom = '".$_GET["value"]."'"; + $sql.= " WHERE nom = '".$db->escape($value)."'"; $sql.= " AND type = '".$type."'"; $sql.= " AND entity = ".$conf->entity; if ($db->query($sql)) { - + if ($conf->global->FACTURE_ADDON_PDF == "$value") dolibarr_del_const($db, 'FACTURE_ADDON_PDF',$conf->entity); } } @@ -314,11 +317,11 @@ foreach ($conf->file->dol_document_root as $dirroot) //print "> ".$conf->global->FACTURE_ADDON." - ".$file; if ($conf->global->FACTURE_ADDON == $file || $conf->global->FACTURE_ADDON.'.php' == $file) { - print img_picto($langs->trans("Activated"),'on'); + print img_picto($langs->trans("Activated"),'switch_on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').''; } print ''; @@ -473,22 +476,22 @@ foreach ($conf->file->dol_document_root as $dirroot) if (in_array($name, $def)) { print "\n"; - if ($conf->global->FACTURE_ADDON_PDF != "$name") - { + //if ($conf->global->FACTURE_ADDON_PDF != "$name") + //{ print ''; - print img_picto($langs->trans("Enabled"),'on'); + print img_picto($langs->trans("Enabled"),'switch_on'); print ''; - } - else - { - print img_picto($langs->trans("Enabled"),'on'); - } + //} + //else + //{ + // print img_picto($langs->trans("Enabled"),'on'); + //} print ""; } else { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; print ""; } diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index c3ed4a97ec0..0cfeb8874f8 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -34,7 +34,7 @@ require_once(DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'); $langs->load("admin"); $langs->load("errors"); /*$langs->load("other"); -$langs->load("interventions");*/ +$langs->load("interventions");*/ if (!$user->admin) accessforbidden(); @@ -50,7 +50,7 @@ if ($action == 'updateMask') $maskconst=GETPOST("maskconst"); $maskvalue=getpost("maskvalue"); if ($maskconst) $res = dolibarr_set_const($db,$maskconst,$maskvalue,'chaine',0,'',$conf->entity); - + if (! $res > 0) $error++; if (! $error) @@ -67,7 +67,7 @@ if ($action == 'set_FICHINTER_FREE_TEXT') { $freetext= GETPOST("FICHINTER_FREE_TEXT"); $res = dolibarr_set_const($db, "FICHINTER_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity); - + if (! $res > 0) $error++; if (! $error) @@ -83,9 +83,9 @@ if ($action == 'set_FICHINTER_FREE_TEXT') if ($action == 'set_FICHINTER_DRAFT_WATERMARK') { $draft= GETPOST("FICHINTER_DRAFT_WATERMARK"); - + $res = dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity); - + if (! $res > 0) $error++; if (! $error) @@ -137,7 +137,7 @@ if ($action == 'set') { $label = GETPOST("label"); $scandir = GETPOST("scandir"); - + $type='ficheinter'; $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)"; $sql.= " VALUES ('".$db->escape($value)."','".$type."',".$conf->entity.", "; @@ -154,13 +154,13 @@ if ($action == 'del') { $type='ficheinter'; $sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model"; - $sql.= " WHERE nom = '".$value."'"; + $sql.= " WHERE nom = '".$db->escape($value)."'"; $sql.= " AND type = '".$type."'"; $sql.= " AND entity = ".$conf->entity; if ($db->query($sql)) { - + if ($conf->global->FICHEINTER_ADDON_PDF == "$value") dolibarr_del_const($db, 'FICHEINTER_ADDON_PDF',$conf->entity); } } @@ -168,7 +168,7 @@ if ($action == 'setdoc') { $label = GETPOST("label"); $scandir = GETPOST("scandir"); - + $db->begin(); if (dolibarr_set_const($db, "FICHEINTER_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) @@ -212,16 +212,9 @@ if ($action == 'setmod') dolibarr_set_const($db, "FICHEINTER_ADDON",$value,'chaine',0,'',$conf->entity); } -/* -// defini les constantes du modele arctic -if ($_POST["action"] == 'updateMatrice') dolibarr_set_const($db, "FICHEINTER_NUM_MATRICE",$_POST["matrice"],'chaine',0,'',$conf->entity); -if ($_POST["action"] == 'updatePrefix') dolibarr_set_const($db, "FICHEINTER_NUM_PREFIX",$_POST["prefix"],'chaine',0,'',$conf->entity); -if ($_POST["action"] == 'setOffset') dolibarr_set_const($db, "FICHEINTER_NUM_DELTA",$_POST["offset"],'chaine',0,'',$conf->entity); -if ($_POST["action"] == 'setNumRestart') dolibarr_set_const($db, "FICHEINTER_NUM_RESTART_BEGIN_YEAR",$_POST["numrestart"],'chaine',0,'',$conf->entity); -*/ /* - * Affichage page + * View */ llxHeader(); @@ -242,7 +235,7 @@ print ''.$langs->trans("Name").''; print ''.$langs->trans("Description").''; print ''.$langs->trans("Example").''; print ''.$langs->trans("Status").''; -print ''.$langs->trans("Infos").''; +print ''.$langs->trans("Infos").''; print "\n"; clearstatcache(); @@ -359,7 +352,7 @@ print ''.$langs->trans("Name").''; print ''.$langs->trans("Description").''; print ''.$langs->trans("Status")."\n"; print ''.$langs->trans("Default")."\n"; -print ''.$langs->trans("Infos").''; +print ''.$langs->trans("Infos").''; print "\n"; clearstatcache(); @@ -395,16 +388,16 @@ foreach ($conf->file->dol_document_root as $dirroot) if (in_array($name, $def)) { print "\n"; - if ($conf->global->FICHEINTER_ADDON_PDF != "$name") - { + //if ($conf->global->FICHEINTER_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"),'switch_on'); - } + //} + //else + //{ + // print img_picto($langs->trans("Enabled"),'switch_on'); + //} print ""; } else @@ -418,11 +411,11 @@ foreach ($conf->file->dol_document_root as $dirroot) print ""; if ($conf->global->FICHEINTER_ADDON_PDF == "$name") { - print img_picto($langs->trans("Default"),'switch_on'); + print img_picto($langs->trans("Default"),'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; } print ''; @@ -437,10 +430,8 @@ foreach ($conf->file->dol_document_root as $dirroot) $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1); $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1); print ''; - print $html->textwithpicto('',$htmltooltip,1,0); - print ''; - print ''; - print ''.img_object($langs->trans("Preview"),'intervention').''; + $link=''.img_object($langs->trans("Preview"),'intervention').''; + print $html->textwithpicto('     '.$link,$htmltooltip,-1,0); print ''; print ''; diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php index ca93bb35313..8e986327700 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/livraison.php @@ -6,7 +6,7 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2011 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 * the Free Software Foundation; either version 2 of the License, or @@ -48,7 +48,7 @@ if ($action == 'updateMask') $maskconstdelivery=GETPOST("maskconstdelivery"); $maskdelivery=GETPOST("maskdelivery"); if ($maskconstdelivery) $res = dolibarr_set_const($db,$maskconstdelivery,$maskdelivery,'chaine',0,'',$conf->entity); - + if (! $res > 0) $error++; if (! $error) @@ -64,7 +64,7 @@ if ($action == 'updateMask') if ($action == 'specimen') { $modele=GETPOST("module"); - + $sending = new Livraison($db); $sending->initAsSpecimen(); //$sending->fetch_commande(); @@ -101,7 +101,7 @@ if ($action == 'set') { $label = GETPOST("label"); $scandir = GETPOST("scandir"); - + $type='delivery'; $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)"; $sql.= " VALUES ('".$db->escape($value)."','".$type."',".$conf->entity.", "; @@ -110,7 +110,6 @@ if ($action == 'set') $sql.= ")"; if ($db->query($sql)) { - } } @@ -118,13 +117,13 @@ if ($action == 'del') { $type='delivery'; $sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model"; - $sql.= " WHERE nom = '".$value."'"; + $sql.= " WHERE nom = '".$db->escape($value)."'"; $sql.= " AND type = '".$type."'"; $sql.= " AND entity = ".$conf->entity; if ($db->query($sql)) { - + if ($conf->global->LIVRAISON_ADDON_PDF == "$value") dolibarr_del_const($db, 'LIVRAISON_ADDON_PDF',$conf->entity); } } @@ -167,7 +166,7 @@ if ($action == 'set_DELIVERY_FREE_TEXT') { $free=GETPOST("DELIVERY_FREE_TEXT"); $res=dolibarr_set_const($db, "DELIVERY_FREE_TEXT",$free,'chaine',0,'',$conf->entity); - + if (! $res > 0) $error++; if (! $error) @@ -273,7 +272,7 @@ foreach ($conf->file->dol_document_root as $dirroot) // Show example of numbering module print ''; $tmp=$module->getExample(); - if (preg_match('/^Error/',$tmp)) + if (preg_match('/^Error/',$tmp)) { $langs->load("errors"); print $langs->trans($tmp); @@ -402,16 +401,16 @@ foreach ($conf->file->dol_document_root as $dirroot) if (in_array($name, $def)) { print "\n"; - if ($conf->global->LIVRAISON_ADDON_PDF != "$name") - { + //if ($conf->global->LIVRAISON_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"),'switch_on'); - } + //} + //else + //{ + // print img_picto($langs->trans("Enabled"),'switch_on'); + //} print ""; } else @@ -425,11 +424,11 @@ foreach ($conf->file->dol_document_root as $dirroot) print ""; if ($conf->global->LIVRAISON_ADDON_PDF == "$name") { - print img_picto($langs->trans("Default"),'switch_on'); + print img_picto($langs->trans("Default"),'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; } print ''; diff --git a/htdocs/admin/project.php b/htdocs/admin/project.php index 14c9417be02..dc58d8c77f6 100644 --- a/htdocs/admin/project.php +++ b/htdocs/admin/project.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2010 Regis Houssin + * Copyright (C) 2011 Laurent Destailleur * * 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 @@ -18,7 +19,7 @@ /** * \file htdocs/admin/project.php * \ingroup project - * \brief Page d'administration-configuration du module Projet + * \brief Page to setup project module */ require("../main.inc.php"); @@ -33,6 +34,9 @@ $langs->load("projects"); if (!$user->admin) accessforbidden(); +$value=GETPOST('value'); +$action=GETPOST('action'); + /* * Actions @@ -98,12 +102,12 @@ if ($_GET["action"] == 'del') { $type='project'; $sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model"; - $sql.= " WHERE nom = '".$_GET["value"]."'"; + $sql.= " WHERE nom = '".$db->escape($value)."'"; $sql.= " AND type = '".$type."'"; $sql.= " AND entity = ".$conf->entity; if ($db->query($sql)) { - + if ($conf->global->PROJECT_ADDON_PDF == "$value") dolibarr_del_const($db, 'PROJECT_ADDON_PDF',$conf->entity); } } @@ -174,7 +178,7 @@ print ''.$langs->trans("Name").''; print ''.$langs->trans("Description").''; print ''.$langs->trans("Example").''; print ''.$langs->trans("Activated").''; -print ''.$langs->trans("Info").''; +print ''.$langs->trans("Infos").''; print "\n"; clearstatcache(); @@ -215,11 +219,11 @@ if (is_resource($handle)) print ''; if ($conf->global->PROJECT_ADDON == "$file") { - print img_picto($langs->trans("Activated"),'on'); + print img_picto($langs->trans("Activated"),'switch_on'); } else { - print ''.img_picto($langs->trans("Disabled"),'off').''; + print ''.img_picto($langs->trans("Disabled"),'switch_off').''; } print ''; @@ -297,7 +301,7 @@ print ' '.$langs->trans("Name")."\n"; print " ".$langs->trans("Description")."\n"; print ''.$langs->trans("Activated")."\n"; print ''.$langs->trans("Default")."\n"; -print ''.$langs->trans("Info").''; +print ''.$langs->trans("Infos").''; print "\n"; clearstatcache(); @@ -326,22 +330,22 @@ if (is_resource($handle)) if (in_array($name, $def)) { print "\n"; - if ($conf->global->PROJECT_ADDON_PDF != "$name") - { + //if ($conf->global->PROJECT_ADDON_PDF != "$name") + //{ print 'scandir.'&label='.urlencode($module->name).'">'; - print img_picto($langs->trans("Enabled"),'on'); + print img_picto($langs->trans("Enabled"),'switch_on'); print ''; - } - else - { - print img_picto($langs->trans("Enabled"),'on'); - } + //} + //else + //{ + // print img_picto($langs->trans("Enabled"),'on'); + //} print ""; } else { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; print ""; } @@ -364,10 +368,8 @@ if (is_resource($handle)) $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); print ''; - print $html->textwithpicto('',$htmltooltip,1,0); - print ''; - print ''; - print ''.img_object($langs->trans("Preview"),'order').''; + $link=''.img_object($langs->trans("Preview"),'order').''; + print $html->textwithpicto('     '.$link,$htmltooltip,-1,0); print ''; print "\n"; diff --git a/htdocs/admin/propale.php b/htdocs/admin/propale.php index 10bc8630f03..2d80a71b387 100644 --- a/htdocs/admin/propale.php +++ b/htdocs/admin/propale.php @@ -193,12 +193,12 @@ if ($action == 'del') { $type='propal'; $sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model"; - $sql.= " WHERE nom = '".$value."'"; + $sql.= " WHERE nom = '".$db->escape($value)."'"; $sql.= " AND type = '".$type."'"; $sql.= " AND entity = ".$conf->entity; if ($db->query($sql)) { - + if ($conf->global->PROPALE_ADDON_PDF == "$value") dolibarr_del_const($db, 'PROPALE_ADDON_PDF',$conf->entity); } } @@ -209,7 +209,7 @@ if ($action == 'setdoc') $db->begin(); - if (dolibarr_set_const($db, "PROPALE_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) + if (dolibarr_set_const($db, "PROPALE_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) { $conf->global->PROPALE_ADDON_PDF = $value; } @@ -438,16 +438,16 @@ foreach ($conf->file->dol_document_root as $dirroot) print ''."\n"; if (in_array($name, $def)) { - if ($conf->global->PROPALE_ADDON_PDF != "$name") - { + //if ($conf->global->PROPALE_ADDON_PDF != "$name") + //{ print 'scandir.'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Activated"),'switch_on'); print ''; - } - else - { - print img_picto($langs->trans("Activated"),'switch_on'); - } + //} + //else + //{ + // print img_picto($langs->trans("Activated"),'switch_on'); + //} } else {