2
0
forked from Wavyzz/dolibarr

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.

This commit is contained in:
Laurent Destailleur
2011-08-31 18:12:44 +00:00
parent f4a20c3a1d
commit 36633d0053
2 changed files with 34 additions and 19 deletions

View File

@@ -120,13 +120,13 @@ if ($action == 'del')
{
$type='order';
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
$sql.= " WHERE nom = '".$db->escape($value)."'";
$sql.= " WHERE nom = '".$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,7 +207,22 @@ if ($action == 'set_COMMANDE_FREE_TEXT')
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
}
}
/*
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
@@ -402,16 +417,16 @@ foreach ($conf->file->dol_document_root as $dirroot)
print "<td align=\"center\">\n";
if (in_array($name, $def))
{
//if ($conf->global->COMMANDE_ADDON_PDF != "$name")
//{
if ($conf->global->COMMANDE_ADDON_PDF != "$name")
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
print img_picto($langs->trans("Activated"),'switch_on');
print '</a>';
//}
//else
//{
// print img_picto($langs->trans("Activated"),'switch_on');
//}
}
else
{
print img_picto($langs->trans("Activated"),'switch_on');
}
}
else
{

View File

@@ -193,12 +193,12 @@ if ($action == 'del')
{
$type='propal';
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
$sql.= " WHERE nom = '".$db->escape($value)."'";
$sql.= " WHERE nom = '".$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 '<td align="center">'."\n";
if (in_array($name, $def))
{
//if ($conf->global->PROPALE_ADDON_PDF != "$name")
//{
if ($conf->global->PROPALE_ADDON_PDF != "$name")
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
print img_picto($langs->trans("Activated"),'switch_on');
print '</a>';
//}
//else
//{
// print img_picto($langs->trans("Activated"),'switch_on');
//}
}
else
{
print img_picto($langs->trans("Activated"),'switch_on');
}
}
else
{