From 5e30e4cd301ae6275352d53d13654bab34492846 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/propale.php | 20 ++++++++++---------- 2 files changed, 19 insertions(+), 34 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/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 {