mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Fix: Removed warnings
This commit is contained in:
parent
8398c093c7
commit
e82923b525
|
|
@ -40,7 +40,7 @@ accessforbidden();
|
|||
|
||||
$typeconst=array('yesno','texte','chaine');
|
||||
|
||||
$action = getpost("action");
|
||||
$action = GETPOST("action");
|
||||
|
||||
|
||||
// Action mise a jour ou ajout d'une constante
|
||||
|
|
@ -48,7 +48,7 @@ if ($action == 'update' || $action == 'add')
|
|||
{
|
||||
$const=GETPOST("constname");
|
||||
$value=GETPOST("constvalue");
|
||||
|
||||
|
||||
if (($const=='ADHERENT_CARD_TYPE' || $const=='ADHERENT_ETIQUETTE_TYPE')
|
||||
&& $value == -1) $value='';
|
||||
if ($const=='ADHERENT_LOGIN_NOT_REQUIRED') // Invert choice
|
||||
|
|
@ -62,7 +62,7 @@ if ($action == 'update' || $action == 'add')
|
|||
$type=$_POST["consttype"];
|
||||
$constnote=GETPOST("constnote");
|
||||
$res=dolibarr_set_const($db,$const,$value,$typeconst[$type],0,$constnote,$conf->entity);
|
||||
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
|
|
|
|||
|
|
@ -28,24 +28,24 @@ require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
|
|||
|
||||
$langs->load("admin");
|
||||
|
||||
if (!$user->admin)
|
||||
accessforbidden();
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
$action = GETPOST("action");
|
||||
|
||||
$action = getpost("action");
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
if ($action == 'setvalue' && $user->admin)
|
||||
{
|
||||
$result=dolibarr_set_const($db, "CLICKTODIAL_URL",GETPOST("url"),'chaine',0,'',$conf->entity);
|
||||
if ($result >= 0)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
$result=dolibarr_set_const($db, "CLICKTODIAL_URL",GETPOST("url"),'chaine',0,'',$conf->entity);
|
||||
if ($result >= 0)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -87,11 +87,11 @@ print '<tr><td colspan="3" align="center"><br><input type="submit" class="button
|
|||
print '</table></form>';
|
||||
|
||||
/*if (! empty($conf->global->CLICKTODIAL_URL))
|
||||
{
|
||||
print $langs->trans("Test");
|
||||
// Add a phone number to test
|
||||
}
|
||||
*/
|
||||
{
|
||||
print $langs->trans("Test");
|
||||
// Add a phone number to test
|
||||
}
|
||||
*/
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
|
|
|
|||
|
|
@ -28,8 +28,7 @@ require_once(DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php');
|
|||
$langs->load("admin");
|
||||
$langs->load("errors");
|
||||
|
||||
if (!$user->admin)
|
||||
accessforbidden();
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
$action = GETPOST("action");
|
||||
$value = GETPOST("value");
|
||||
|
|
@ -46,13 +45,13 @@ if (empty($conf->global->CONTRACT_ADDON))
|
|||
|
||||
if ($action == 'updateMask')
|
||||
{
|
||||
$maskconst=$_POST['maskconstcontract'];
|
||||
$maskvalue=$_POST['maskcontract'];
|
||||
if ($maskconst) $res = dolibarr_set_const($db,$maskconst,$maskvalue,'chaine',0,'',$conf->entity);
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
$maskconst=$_POST['maskconstcontract'];
|
||||
$maskvalue=$_POST['maskcontract'];
|
||||
if ($maskconst) $res = dolibarr_set_const($db,$maskconst,$maskvalue,'chaine',0,'',$conf->entity);
|
||||
|
||||
if (! $error)
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
}
|
||||
|
|
@ -64,16 +63,16 @@ if ($action == 'updateMask')
|
|||
|
||||
if ($action == 'setmod')
|
||||
{
|
||||
dolibarr_set_const($db, "CONTRACT_ADDON",$value,'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "CONTRACT_ADDON",$value,'chaine',0,'',$conf->entity);
|
||||
}
|
||||
|
||||
/*
|
||||
// constants of magre model
|
||||
if ($action == 'updateMatrice') dolibarr_set_const($db, "CONTRACT_NUM_MATRICE",$_POST["matrice"],'chaine',0,'',$conf->entity);
|
||||
if ($action == 'updatePrefix') dolibarr_set_const($db, "CONTRACT_NUM_PREFIX",$_POST["prefix"],'chaine',0,'',$conf->entity);
|
||||
if ($action == 'setOffset') dolibarr_set_const($db, "CONTRACT_NUM_DELTA",$_POST["offset"],'chaine',0,'',$conf->entity);
|
||||
if ($action == 'setNumRestart') dolibarr_set_const($db, "CONTRACT_NUM_RESTART_BEGIN_YEAR",$_POST["numrestart"],'chaine',0,'',$conf->entity);
|
||||
*/
|
||||
// constants of magre model
|
||||
if ($action == 'updateMatrice') dolibarr_set_const($db, "CONTRACT_NUM_MATRICE",$_POST["matrice"],'chaine',0,'',$conf->entity);
|
||||
if ($action == 'updatePrefix') dolibarr_set_const($db, "CONTRACT_NUM_PREFIX",$_POST["prefix"],'chaine',0,'',$conf->entity);
|
||||
if ($action == 'setOffset') dolibarr_set_const($db, "CONTRACT_NUM_DELTA",$_POST["offset"],'chaine',0,'',$conf->entity);
|
||||
if ($action == 'setNumRestart') dolibarr_set_const($db, "CONTRACT_NUM_RESTART_BEGIN_YEAR",$_POST["numrestart"],'chaine',0,'',$conf->entity);
|
||||
*/
|
||||
|
||||
/*
|
||||
* View
|
||||
|
|
@ -106,29 +105,29 @@ $dir = "../includes/modules/contract/";
|
|||
$handle = opendir($dir);
|
||||
if (is_resource($handle))
|
||||
{
|
||||
$var=true;
|
||||
$var=true;
|
||||
|
||||
while (($file = readdir($handle))!==false)
|
||||
{
|
||||
if (substr($file, 0, 13) == 'mod_contract_' && substr($file, dol_strlen($file)-3, 3) == 'php')
|
||||
{
|
||||
$file = substr($file, 0, dol_strlen($file)-4);
|
||||
while (($file = readdir($handle))!==false)
|
||||
{
|
||||
if (substr($file, 0, 13) == 'mod_contract_' && substr($file, dol_strlen($file)-3, 3) == 'php')
|
||||
{
|
||||
$file = substr($file, 0, dol_strlen($file)-4);
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/contract/".$file.".php");
|
||||
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/contract/".$file.".php");
|
||||
|
||||
$module = new $file;
|
||||
$module = new $file;
|
||||
|
||||
// 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 '<tr '.$bc[$var].'><td>'.$module->nom."</td>\n";
|
||||
print '<td>';
|
||||
print $module->info();
|
||||
print '</td>';
|
||||
if ($module->isEnabled())
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$module->nom."</td>\n";
|
||||
print '<td>';
|
||||
print $module->info();
|
||||
print '</td>';
|
||||
|
||||
// Show example of numbering module
|
||||
print '<td nowrap="nowrap">';
|
||||
|
|
@ -137,49 +136,49 @@ if (is_resource($handle))
|
|||
else print $tmp;
|
||||
print '</td>'."\n";
|
||||
|
||||
print '<td align="center">';
|
||||
if ($conf->global->CONTRACT_ADDON == "$file")
|
||||
{
|
||||
print img_picto($langs->trans("Activated"),'switch_on');
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.$file.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
||||
print img_picto($langs->trans("Disabled"),'switch_off');
|
||||
print '</a>';
|
||||
}
|
||||
print '</td>';
|
||||
print '<td align="center">';
|
||||
if ($conf->global->CONTRACT_ADDON == "$file")
|
||||
{
|
||||
print img_picto($langs->trans("Activated"),'switch_on');
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.$file.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
||||
print img_picto($langs->trans("Disabled"),'switch_off');
|
||||
print '</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
$contract=new Contrat($db);
|
||||
$contract->initAsSpecimen();
|
||||
$contract=new Contrat($db);
|
||||
$contract->initAsSpecimen();
|
||||
|
||||
// Info
|
||||
$htmltooltip='';
|
||||
$htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
|
||||
$facture->type=0;
|
||||
$nextval=$module->getNextValue($mysoc,$contract);
|
||||
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
|
||||
{
|
||||
$htmltooltip.=''.$langs->trans("NextValue").': ';
|
||||
if ($nextval)
|
||||
{
|
||||
$htmltooltip.=$nextval.'<br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$htmltooltip.=$langs->trans($module->error).'<br>';
|
||||
}
|
||||
}
|
||||
// Info
|
||||
$htmltooltip='';
|
||||
$htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
|
||||
$facture->type=0;
|
||||
$nextval=$module->getNextValue($mysoc,$contract);
|
||||
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
|
||||
{
|
||||
$htmltooltip.=''.$langs->trans("NextValue").': ';
|
||||
if ($nextval)
|
||||
{
|
||||
$htmltooltip.=$nextval.'<br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$htmltooltip.=$langs->trans($module->error).'<br>';
|
||||
}
|
||||
}
|
||||
|
||||
print '<td align="center">';
|
||||
print $html->textwithpicto('',$htmltooltip,1,0);
|
||||
print '</td>';
|
||||
print '<td align="center">';
|
||||
print $html->textwithpicto('',$htmltooltip,1,0);
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
|
||||
print '</table><br>';
|
||||
|
|
|
|||
|
|
@ -27,53 +27,53 @@ require_once(DOL_DOCUMENT_ROOT."/compta/dons/class/don.class.php");
|
|||
$langs->load("admin");
|
||||
$langs->load("donations");
|
||||
|
||||
if (!$user->admin)
|
||||
accessforbidden();
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
$typeconst=array('yesno','texte','chaine');
|
||||
|
||||
|
||||
/*
|
||||
* Action
|
||||
*/
|
||||
|
||||
if ($_GET["action"] == 'specimen')
|
||||
{
|
||||
$modele=$_GET["module"];
|
||||
$modele=$_GET["module"];
|
||||
|
||||
$don = new Don($db);
|
||||
$don->initAsSpecimen();
|
||||
$don = new Don($db);
|
||||
$don->initAsSpecimen();
|
||||
|
||||
// Charge le modele
|
||||
$dir = DOL_DOCUMENT_ROOT . "/includes/modules/dons/";
|
||||
$file = $modele.".modules.php";
|
||||
if (file_exists($dir.$file))
|
||||
{
|
||||
$classname = $modele;
|
||||
require_once($dir.$file);
|
||||
// Charge le modele
|
||||
$dir = DOL_DOCUMENT_ROOT . "/includes/modules/dons/";
|
||||
$file = $modele.".modules.php";
|
||||
if (file_exists($dir.$file))
|
||||
{
|
||||
$classname = $modele;
|
||||
require_once($dir.$file);
|
||||
|
||||
$obj = new $classname($db);
|
||||
$obj = new $classname($db);
|
||||
|
||||
if ($obj->write_file($don,$langs) > 0)
|
||||
{
|
||||
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=donation&file=SPECIMEN.html");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<div class="error">'.$obj->error.'</div>';
|
||||
dol_syslog($obj->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorModuleNotFound").'</div>';
|
||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||
}
|
||||
if ($obj->write_file($don,$langs) > 0)
|
||||
{
|
||||
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=donation&file=SPECIMEN.html");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<div class="error">'.$obj->error.'</div>';
|
||||
dol_syslog($obj->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorModuleNotFound").'</div>';
|
||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
if ($_GET["action"] == 'setdoc')
|
||||
{
|
||||
$db->begin();
|
||||
$db->begin();
|
||||
|
||||
if (dolibarr_set_const($db, "DON_ADDON_MODEL",$_GET["value"],'chaine',0,'',$conf->entity))
|
||||
{
|
||||
|
|
@ -94,17 +94,17 @@ if ($_GET["action"] == 'setdoc')
|
|||
$result2=$db->query($sql);
|
||||
if ($result1 && $result2)
|
||||
{
|
||||
$db->commit();
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
|
||||
if ($_GET["action"] == 'set')
|
||||
{
|
||||
$type='donation';
|
||||
$type='donation';
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
|
||||
$sql.= " VALUES ('".$db->escape($_GET["value"])."','".$type."',".$conf->entity.", ";
|
||||
$sql.= ($_GET["label"]?"'".$db->escape($_GET["label"])."'":'null').", ";
|
||||
|
|
@ -148,18 +148,18 @@ $sql.= " WHERE type = '".$type."'";
|
|||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$i = 0;
|
||||
$num_rows=$db->num_rows($resql);
|
||||
while ($i < $num_rows)
|
||||
{
|
||||
$array = $db->fetch_array($resql);
|
||||
array_push($def, $array[0]);
|
||||
$i++;
|
||||
}
|
||||
$i = 0;
|
||||
$num_rows=$db->num_rows($resql);
|
||||
while ($i < $num_rows)
|
||||
{
|
||||
$array = $db->fetch_array($resql);
|
||||
array_push($def, $array[0]);
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
print '<table class="noborder" width=\"100%\">';
|
||||
|
|
@ -186,74 +186,74 @@ if (is_resource($handle))
|
|||
$name = substr($file, 0, dol_strlen($file) -12);
|
||||
$classname = substr($file, 0, dol_strlen($file) -12);
|
||||
|
||||
require_once($dir.'/'.$file);
|
||||
$module=new $classname($db);
|
||||
require_once($dir.'/'.$file);
|
||||
$module=new $classname($db);
|
||||
|
||||
// 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())
|
||||
{
|
||||
print '<tr '.$bc[$var].'><td width=\"100\">';
|
||||
echo $module->name;
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print $module->description;
|
||||
print '</td>';
|
||||
if ($module->isEnabled())
|
||||
{
|
||||
print '<tr '.$bc[$var].'><td width=\"100\">';
|
||||
echo $module->name;
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print $module->description;
|
||||
print '</td>';
|
||||
|
||||
// Active
|
||||
if (in_array($name, $def))
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
if ($conf->global->DON_ADDON_MODEL == $name)
|
||||
{
|
||||
print img_picto($langs->trans("Enabled"),'on');
|
||||
}
|
||||
else
|
||||
{
|
||||
print ' ';
|
||||
print '</td><td align="center">';
|
||||
print '<a href="dons.php?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Enabled"),'on').'</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"),'off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
// Active
|
||||
if (in_array($name, $def))
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
if ($conf->global->DON_ADDON_MODEL == $name)
|
||||
{
|
||||
print img_picto($langs->trans("Enabled"),'on');
|
||||
}
|
||||
else
|
||||
{
|
||||
print ' ';
|
||||
print '</td><td align="center">';
|
||||
print '<a href="dons.php?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Enabled"),'on').'</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"),'off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
// Defaut
|
||||
print "<td align=\"center\">";
|
||||
if ($conf->global->DON_ADDON_MODEL == "$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>';
|
||||
// Defaut
|
||||
print "<td align=\"center\">";
|
||||
if ($conf->global->DON_ADDON_MODEL == "$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"));
|
||||
// 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);
|
||||
$htmltooltip.='<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1);
|
||||
$text='<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'" target="specimen">'.img_object($langs->trans("Preview"),'generic').'</a>';
|
||||
print '<td align="center">';
|
||||
print $html->textwithpicto(' '.$text,$htmltooltip,-1,0);
|
||||
print '</td>';
|
||||
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
||||
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
|
||||
$htmltooltip.='<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1);
|
||||
$text='<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'" target="specimen">'.img_object($langs->trans("Preview"),'generic').'</a>';
|
||||
print '<td align="center">';
|
||||
print $html->textwithpicto(' '.$text,$htmltooltip,-1,0);
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
|
|
|
|||
|
|
@ -30,8 +30,7 @@ require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
|
|||
$langs->load("admin");
|
||||
$langs->load("fckeditor");
|
||||
|
||||
if (!$user->admin)
|
||||
accessforbidden();
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
// Constante et traduction de la description du module
|
||||
$modules = array(
|
||||
|
|
@ -67,26 +66,25 @@ $picto = array(
|
|||
* Actions
|
||||
*/
|
||||
|
||||
|
||||
foreach($modules as $const => $desc)
|
||||
{
|
||||
if ($_GET["action"] == 'activate_'.strtolower($const))
|
||||
{
|
||||
dolibarr_set_const($db, "FCKEDITOR_ENABLE_".$const, "1",'chaine',0,'',$conf->entity);
|
||||
// Si fckeditor est active dans la description produit/service, on l'active dans les formulaires
|
||||
if ($const == 'PRODUCTDESC' && $conf->global->PRODUIT_DESC_IN_FORM)
|
||||
{
|
||||
dolibarr_set_const($db, "FCKEDITOR_ENABLE_DETAILS", "1",'chaine',0,'',$conf->entity);
|
||||
}
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
if ($_GET["action"] == 'disable_'.strtolower($const))
|
||||
{
|
||||
dolibarr_del_const($db, "FCKEDITOR_ENABLE_".$const,$conf->entity);
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
if ($_GET["action"] == 'activate_'.strtolower($const))
|
||||
{
|
||||
dolibarr_set_const($db, "FCKEDITOR_ENABLE_".$const, "1",'chaine',0,'',$conf->entity);
|
||||
// Si fckeditor est active dans la description produit/service, on l'active dans les formulaires
|
||||
if ($const == 'PRODUCTDESC' && $conf->global->PRODUIT_DESC_IN_FORM)
|
||||
{
|
||||
dolibarr_set_const($db, "FCKEDITOR_ENABLE_DETAILS", "1",'chaine',0,'',$conf->entity);
|
||||
}
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
if ($_GET["action"] == 'disable_'.strtolower($const))
|
||||
{
|
||||
dolibarr_del_const($db, "FCKEDITOR_ENABLE_".$const,$conf->entity);
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
if ($_POST["save"])
|
||||
|
|
@ -118,34 +116,34 @@ print "</tr>\n";
|
|||
// Modules
|
||||
foreach($modules as $const => $desc)
|
||||
{
|
||||
// Si condition non remplie, on ne propose pas l'option
|
||||
if (! $conditions[$const]) continue;
|
||||
// Si condition non remplie, on ne propose pas l'option
|
||||
if (! $conditions[$const]) continue;
|
||||
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
print '<td width="16">'.img_object("",$picto[$const]).'</td>';
|
||||
print '<td>'.$langs->trans($desc).'</td>';
|
||||
print '<td align="center" width="20">';
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
print '<td width="16">'.img_object("",$picto[$const]).'</td>';
|
||||
print '<td>'.$langs->trans($desc).'</td>';
|
||||
print '<td align="center" width="20">';
|
||||
|
||||
$constante = 'FCKEDITOR_ENABLE_'.$const;
|
||||
$value = $conf->global->$constante;
|
||||
$constante = 'FCKEDITOR_ENABLE_'.$const;
|
||||
$value = $conf->global->$constante;
|
||||
|
||||
print $value == 1 ? img_picto($langs->trans("Active"),'tick') : ' ';
|
||||
print $value == 1 ? img_picto($langs->trans("Active"),'tick') : ' ';
|
||||
|
||||
print '</td>';
|
||||
print '<td align="center" width="100">';
|
||||
print '</td>';
|
||||
print '<td align="center" width="100">';
|
||||
|
||||
if($value == 0)
|
||||
{
|
||||
print '<a href="fckeditor.php?action=activate_'.strtolower($const).'">'.$langs->trans("Activate").'</a>';
|
||||
}
|
||||
else if($value == 1)
|
||||
{
|
||||
print '<a href="fckeditor.php?action=disable_'.strtolower($const).'">'.$langs->trans("Disable").'</a>';
|
||||
}
|
||||
if($value == 0)
|
||||
{
|
||||
print '<a href="fckeditor.php?action=activate_'.strtolower($const).'">'.$langs->trans("Activate").'</a>';
|
||||
}
|
||||
else if($value == 1)
|
||||
{
|
||||
print '<a href="fckeditor.php?action=disable_'.strtolower($const).'">'.$langs->trans("Disable").'</a>';
|
||||
}
|
||||
|
||||
print "</td>";
|
||||
print '</tr>';
|
||||
print "</td>";
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print '</table>'."\n";
|
||||
|
|
@ -162,11 +160,11 @@ print '<center><br><input class="button" type="submit" name="save" value="'.$lan
|
|||
print '</form>'."\n";
|
||||
|
||||
/*
|
||||
print '<!-- Result -->';
|
||||
print $_POST["formtestfield"];
|
||||
print '<!-- Result -->';
|
||||
print $conf->global->FCKEDITOR_TEST;
|
||||
*/
|
||||
print '<!-- Result -->';
|
||||
print $_POST["formtestfield"];
|
||||
print '<!-- Result -->';
|
||||
print $conf->global->FCKEDITOR_TEST;
|
||||
*/
|
||||
|
||||
$db->close();
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ $value = GETPOST("value");
|
|||
if ($action == 'updateMask')
|
||||
{
|
||||
$maskconst=GETPOST("maskconst");
|
||||
$maskvalue=getpost("maskvalue");
|
||||
$maskvalue=GETPOST("maskvalue");
|
||||
if ($maskconst) $res = dolibarr_set_const($db,$maskconst,$maskvalue,'chaine',0,'',$conf->entity);
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.org>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
*
|
||||
* 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
|
||||
|
|
@ -41,20 +41,20 @@ $action = GETPOST("action");
|
|||
if ($action == 'set')
|
||||
{
|
||||
$error=0;
|
||||
|
||||
$gimcdf= getpost("GEOIPMAXMIND_COUNTRY_DATAFILE");
|
||||
|
||||
|
||||
$gimcdf= GETPOST("GEOIPMAXMIND_COUNTRY_DATAFILE");
|
||||
|
||||
if (! $gimcdf && ! file_exists($gimcdf))
|
||||
{
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorFileNotFound",$gimcdf).'</div>';
|
||||
$error++;
|
||||
}
|
||||
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$res = dolibarr_set_const($db,"GEOIPMAXMIND_COUNTRY_DATAFILE",$gimcdf,'chaine',0,'',$conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user