Merge branch 'develop' of ssh://git@github.com/Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
66b001653c
@ -2,6 +2,7 @@
|
|||||||
/* Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr>
|
/* Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr>
|
||||||
* Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
|
* Copyright (C) 2011-2012 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -29,14 +30,17 @@ require_once(DOL_DOCUMENT_ROOT.'/projet/class/project.class.php');
|
|||||||
require_once(DOL_DOCUMENT_ROOT.'/projet/class/task.class.php');
|
require_once(DOL_DOCUMENT_ROOT.'/projet/class/task.class.php');
|
||||||
|
|
||||||
$langs->load("admin");
|
$langs->load("admin");
|
||||||
|
$langs->load("errors");
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
$langs->load("projects");
|
$langs->load("projects");
|
||||||
|
|
||||||
if (!$user->admin)
|
if (!$user->admin) accessforbidden();
|
||||||
accessforbidden();
|
|
||||||
|
|
||||||
$value=GETPOST('value','action');
|
$value = GETPOST('value','alpha');
|
||||||
$action=GETPOST('action','action');
|
$action = GETPOST('action','alpha');
|
||||||
|
$label = GETPOST('label','alpha');
|
||||||
|
$scandir = GETPOST('scandir','alpha');
|
||||||
|
$type='project';
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -69,17 +73,27 @@ if ($action == 'specimen')
|
|||||||
$project = new Project($db);
|
$project = new Project($db);
|
||||||
$project->initAsSpecimen();
|
$project->initAsSpecimen();
|
||||||
|
|
||||||
// Charge le modele
|
// Search template files
|
||||||
$dir = DOL_DOCUMENT_ROOT . "/core/modules/project/pdf/";
|
$file=''; $classname=''; $filefound=0;
|
||||||
$file = "pdf_".$modele.".modules.php";
|
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
|
||||||
if (file_exists($dir.$file))
|
foreach($dirmodels as $reldir)
|
||||||
{
|
{
|
||||||
$classname = "pdf_".$modele;
|
$file=dol_buildpath($reldir."core/modules/project/pdf/pdf_".$modele.".modules.php",0);
|
||||||
require_once($dir.$file);
|
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");
|
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=project&file=SPECIMEN.pdf");
|
||||||
return;
|
return;
|
||||||
@ -99,26 +113,13 @@ if ($action == 'specimen')
|
|||||||
|
|
||||||
if ($action == 'set')
|
if ($action == 'set')
|
||||||
{
|
{
|
||||||
$label = GETPOST('label','alpha');
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||||
$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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'del')
|
if ($action == 'del')
|
||||||
{
|
{
|
||||||
$type='project';
|
$ret = delDocumentModel($value, $type);
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
|
if ($ret > 0)
|
||||||
$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);
|
if ($conf->global->PROJECT_ADDON_PDF == "$value") dolibarr_del_const($db, 'PROJECT_ADDON_PDF',$conf->entity);
|
||||||
}
|
}
|
||||||
@ -126,37 +127,18 @@ if ($action == 'del')
|
|||||||
|
|
||||||
if ($action == 'setdoc')
|
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))
|
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;
|
$conf->global->PROJECT_ADDON_PDF = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
// On active le modele
|
// On active le modele
|
||||||
$type='project';
|
$ret = delDocumentModel($value, $type);
|
||||||
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
|
if ($ret > 0)
|
||||||
$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)
|
|
||||||
{
|
{
|
||||||
$db->commit();
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$db->rollback();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -165,17 +147,19 @@ if ($action == 'setmod')
|
|||||||
// TODO Verifier si module numerotation choisi peut etre active
|
// TODO Verifier si module numerotation choisi peut etre active
|
||||||
// par appel methode canBeActivated
|
// 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$form=new Form($db);
|
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
|
||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
|
$form=new Form($db);
|
||||||
|
|
||||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||||
print_fiche_titre($langs->trans("ProjectsSetup"),$linkback,'setup');
|
print_fiche_titre($langs->trans("ProjectsSetup"),$linkback,'setup');
|
||||||
|
|
||||||
@ -183,9 +167,6 @@ print "<br>";
|
|||||||
|
|
||||||
|
|
||||||
// Project numbering module
|
// Project numbering module
|
||||||
|
|
||||||
$dir = DOL_DOCUMENT_ROOT."/core/modules/project/";
|
|
||||||
|
|
||||||
print_titre($langs->trans("ProjectsNumberingModules"));
|
print_titre($langs->trans("ProjectsNumberingModules"));
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
@ -199,80 +180,89 @@ print "</tr>\n";
|
|||||||
|
|
||||||
clearstatcache();
|
clearstatcache();
|
||||||
|
|
||||||
$handle = opendir($dir);
|
foreach ($dirmodels as $reldir)
|
||||||
if (is_resource($handle))
|
|
||||||
{
|
{
|
||||||
$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);
|
$var=true;
|
||||||
|
|
||||||
require_once(DOL_DOCUMENT_ROOT ."/core/modules/project/".$file.".php");
|
while (($file = readdir($handle))!==false)
|
||||||
|
|
||||||
$module = new $file;
|
|
||||||
|
|
||||||
if ($module->isEnabled())
|
|
||||||
{
|
{
|
||||||
// Show modules according to features level
|
if (preg_match('/^(mod_.*)\.php$/i',$file,$reg))
|
||||||
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 '<tr '.$bc[$var].'><td>'.$module->nom."</td><td>\n";
|
|
||||||
print $module->info();
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
// Show example of numbering module
|
|
||||||
print '<td nowrap="nowrap">';
|
|
||||||
$tmp=$module->getExample();
|
|
||||||
if (preg_match('/^Error/',$tmp)) { $langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>'; }
|
|
||||||
elseif ($tmp=='NotConfigured') print $langs->trans($tmp);
|
|
||||||
else print $tmp;
|
|
||||||
print '</td>'."\n";
|
|
||||||
|
|
||||||
print '<td align="center">';
|
|
||||||
if ($conf->global->PROJECT_ADDON == "$file")
|
|
||||||
{
|
{
|
||||||
print img_picto($langs->trans("Activated"),'switch_on');
|
$file = $reg[1];
|
||||||
}
|
$classname = substr($file,4);
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.$file.'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
$project=new Project($db);
|
require_once(DOL_DOCUMENT_ROOT ."/core/modules/project/".$file.".php");
|
||||||
$project->initAsSpecimen();
|
|
||||||
|
|
||||||
// Info
|
$module = new $file;
|
||||||
$htmltooltip='';
|
|
||||||
$htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
|
// Show modules according to features level
|
||||||
$nextval=$module->getNextValue($mysoc,$project);
|
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
|
||||||
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
|
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
|
||||||
{
|
|
||||||
$htmltooltip.=''.$langs->trans("NextValue").': ';
|
if ($module->isEnabled())
|
||||||
if ($nextval)
|
{
|
||||||
{
|
$var=!$var;
|
||||||
$htmltooltip.=$nextval.'<br>';
|
print '<tr '.$bc[$var].'><td>'.$module->nom."</td><td>\n";
|
||||||
}
|
print $module->info();
|
||||||
else
|
print '</td>';
|
||||||
{
|
|
||||||
$htmltooltip.=$langs->trans($module->error).'<br>';
|
// Show example of numbering module
|
||||||
|
print '<td nowrap="nowrap">';
|
||||||
|
$tmp=$module->getExample();
|
||||||
|
if (preg_match('/^Error/',$tmp)) { $langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>'; }
|
||||||
|
elseif ($tmp=='NotConfigured') print $langs->trans($tmp);
|
||||||
|
else print $tmp;
|
||||||
|
print '</td>'."\n";
|
||||||
|
|
||||||
|
print '<td align="center">';
|
||||||
|
if ($conf->global->PROJECT_ADDON == $classname)
|
||||||
|
{
|
||||||
|
print img_picto($langs->trans("Activated"),'switch_on');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.$classname.'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
$project=new Project($db);
|
||||||
|
$project->initAsSpecimen();
|
||||||
|
|
||||||
|
// Info
|
||||||
|
$htmltooltip='';
|
||||||
|
$htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
|
||||||
|
$nextval=$module->getNextValue($mysoc,$project);
|
||||||
|
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 $form->textwithpicto('',$htmltooltip,1,0);
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print '</tr>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<td align="center">';
|
|
||||||
print $form->textwithpicto('',$htmltooltip,1,0);
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
print '</tr>';
|
|
||||||
}
|
}
|
||||||
|
closedir($handle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
closedir($handle);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table><br>';
|
print '</table><br>';
|
||||||
@ -282,8 +272,6 @@ print '</table><br>';
|
|||||||
* Modeles documents for projects
|
* Modeles documents for projects
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$dir = DOL_DOCUMENT_ROOT.'/core/modules/project/pdf/';
|
|
||||||
|
|
||||||
print_titre($langs->trans("ProjectsModelModule"));
|
print_titre($langs->trans("ProjectsModelModule"));
|
||||||
|
|
||||||
// Defini tableau def de modele
|
// Defini tableau def de modele
|
||||||
@ -323,76 +311,76 @@ print "</tr>\n";
|
|||||||
|
|
||||||
clearstatcache();
|
clearstatcache();
|
||||||
|
|
||||||
$handle=opendir($dir);
|
|
||||||
|
|
||||||
$var=true;
|
$var=true;
|
||||||
if (is_resource($handle))
|
foreach ($dirmodels as $reldir)
|
||||||
{
|
{
|
||||||
while (($file = readdir($handle))!==false)
|
$dir = dol_buildpath($reldir."core/modules/project/pdf/");
|
||||||
{
|
|
||||||
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;
|
if (is_dir($dir))
|
||||||
print "<tr ".$bc[$var].">\n <td>$name";
|
{
|
||||||
print "</td>\n <td>\n";
|
$handle=opendir($dir);
|
||||||
require_once($dir.$file);
|
if (is_resource($handle))
|
||||||
$module = new $classname($db);
|
{
|
||||||
print $module->description;
|
while (($file = readdir($handle))!==false)
|
||||||
print "</td>\n";
|
{
|
||||||
|
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);
|
||||||
|
|
||||||
// Active
|
$var=!$var;
|
||||||
if (in_array($name, $def))
|
print "<tr ".$bc[$var].">\n <td>$name";
|
||||||
{
|
print "</td>\n <td>\n";
|
||||||
print "<td align=\"center\">\n";
|
require_once($dir.$file);
|
||||||
//if ($conf->global->PROJECT_ADDON_PDF != "$name")
|
$module = new $classname($db);
|
||||||
//{
|
print $module->description;
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
print "</td>\n";
|
||||||
print img_picto($langs->trans("Enabled"),'switch_on');
|
|
||||||
print '</a>';
|
|
||||||
//}
|
|
||||||
//else
|
|
||||||
//{
|
|
||||||
// print img_picto($langs->trans("Enabled"),'on');
|
|
||||||
//}
|
|
||||||
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"),'switch_off').'</a>';
|
|
||||||
print "</td>";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Defaut
|
// Active
|
||||||
print "<td align=\"center\">";
|
if (in_array($name, $def))
|
||||||
if ($conf->global->PROJECT_ADDON_PDF == "$name")
|
{
|
||||||
{
|
print "<td align=\"center\">\n";
|
||||||
print img_picto($langs->trans("Default"),'on');
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
||||||
}
|
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||||
else
|
print '</a>';
|
||||||
{
|
print "</td>";
|
||||||
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>';
|
}
|
||||||
}
|
else
|
||||||
print '</td>';
|
{
|
||||||
|
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"),'switch_off').'</a>';
|
||||||
|
print "</td>";
|
||||||
|
}
|
||||||
|
|
||||||
// Info
|
// Defaut
|
||||||
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
print "<td align=\"center\">";
|
||||||
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
|
if ($conf->global->PROJECT_ADDON_PDF == "$name")
|
||||||
$htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
{
|
||||||
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
print img_picto($langs->trans("Default"),'on');
|
||||||
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
|
}
|
||||||
print '<td align="center">';
|
else
|
||||||
$link='<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'order').'</a>';
|
{
|
||||||
print $form->textwithpicto(' '.$link,$htmltooltip,-1,0);
|
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>';
|
}
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
print "</tr>\n";
|
// Info
|
||||||
}
|
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
||||||
}
|
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
|
||||||
closedir($handle);
|
$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);
|
||||||
|
print '<td align="center">';
|
||||||
|
$link='<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'order').'</a>';
|
||||||
|
print $form->textwithpicto(' '.$link,$htmltooltip,-1,0);
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print "</tr>\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
closedir($handle);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table><br/>';
|
print '</table><br/>';
|
||||||
@ -402,4 +390,4 @@ dol_htmloutput_mesg($mesg);
|
|||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
?>
|
?>
|
||||||
@ -3,6 +3,7 @@
|
|||||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||||
* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -39,17 +40,17 @@ if (!$user->admin) accessforbidden();
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($_POST["save"])
|
if (GETPOST('save','alpha'))
|
||||||
{
|
{
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
$i=0;
|
$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_HOST',trim(GETPOST('oscommerce_dbhost','alpha')),'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_NAME',trim(GETPOST('oscommerce_dbname','alpha')),'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_USER',trim(GETPOST('oscommerce_dbuser','alpha')),'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_PASS',trim(GETPOST('oscommerce_dbpass','alpha')),'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_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);
|
$i+=dolibarr_set_const($db,'OSC_LANGUAGE_ID',1,'chaine',0,'',$conf->entity);
|
||||||
|
|
||||||
if ($i >= 4)
|
if ($i >= 4)
|
||||||
@ -64,18 +65,18 @@ if ($_POST["save"])
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif ($_POST["test"])
|
elseif (GETPOST('test','alpha'))
|
||||||
{
|
{
|
||||||
//$resql=$db->query("select count(*) from ".MAIN_DB_PREFIX."const");
|
//$resql=$db->query("select count(*) from ".MAIN_DB_PREFIX."const");
|
||||||
//print "< ".$db." - ".$db->db." - ".$resql." - ".$db->error()."><br>\n";
|
//print "< ".$db." - ".$db->db." - ".$resql." - ".$db->error()."><br>\n";
|
||||||
|
|
||||||
// Test de la connexion a la database webcalendar
|
// Test de la connexion a la database webcalendar
|
||||||
$conf->oscommerce->db->type=$dolibarr_main_db_type;
|
$conf->oscommerce->db->type=$dolibarr_main_db_type;
|
||||||
$conf->oscommerce->db->host=$_POST["oscommerce_dbhost"];
|
$conf->oscommerce->db->host=GETPOST('oscommerce_dbhost','alpha');
|
||||||
$conf->oscommerce->db->port=$_POST["oscommerce_dbport"];
|
$conf->oscommerce->db->port=GETPOST('oscommerce_dbport','alpha');
|
||||||
$conf->oscommerce->db->name=$_POST["oscommerce_dbname"];
|
$conf->oscommerce->db->name=GETPOST('oscommerce_dbname','alpha');
|
||||||
$conf->oscommerce->db->user=$_POST["oscommerce_dbuser"];
|
$conf->oscommerce->db->user=GETPOST('oscommerce_dbuser','alpha');
|
||||||
$conf->oscommerce->db->pass=$_POST["oscommerce_dbpass"];
|
$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);
|
$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 @@ elseif ($_POST["test"])
|
|||||||
$sql.=" WHERE configuration_key='STORE_NAME'";
|
$sql.=" WHERE configuration_key='STORE_NAME'";
|
||||||
$resql=$oscommercedb->query($sql);
|
$resql=$oscommercedb->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$mesg ="<div class=\"ok\">".$langs->trans("OSCommerceTestOk",$_POST["oscommerce_dbhost"],$_POST["oscommerce_dbname"],$_POST["oscommerce_dbuser"]);
|
$mesg ="<div class=\"ok\">".$langs->trans("OSCommerceTestOk",GETPOST('oscommerce_dbhost','alpha'),GETPOST('oscommerce_dbname','alpha'),GETPOST('oscommerce_dbuser','alpha'));
|
||||||
$mesg.="</div>";
|
$mesg.="</div>";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$mesg ="<div class=\"error\">".$langs->trans("OSCommerceErrorConnectOkButWrongDatabase",'STORE_NAME',$_POST["oscommerce_db_table_prefix"]."configuration");
|
$mesg ="<div class=\"error\">".$langs->trans("OSCommerceErrorConnectOkButWrongDatabase",'STORE_NAME',GETPOST('oscommerce_db_table_prefix','alpha')."configuration");
|
||||||
$mesg.="</div>";
|
$mesg.="</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,14 +100,14 @@ elseif ($_POST["test"])
|
|||||||
}
|
}
|
||||||
elseif ($oscommercedb->connected == 1 && $oscommercedb->database_selected != 1)
|
elseif ($oscommercedb->connected == 1 && $oscommercedb->database_selected != 1)
|
||||||
{
|
{
|
||||||
$mesg ="<div class=\"error\">".$langs->trans("OSCommerceTestKo1",$_POST["oscommerce_dbhost"],$_POST["oscommerce_dbname"]);
|
$mesg ="<div class=\"error\">".$langs->trans("OSCommerceTestKo1",GETPOST('oscommerce_dbhost','alpha'),GETPOST('oscommerce_dbname','alpha'));
|
||||||
$mesg.="<br>".$oscommercedb->error();
|
$mesg.="<br>".$oscommercedb->error();
|
||||||
$mesg.="</div>";
|
$mesg.="</div>";
|
||||||
//$oscommercedb->close(); Ne pas fermer car la conn de webcal est la meme que dolibarr si parametre host/user/pass identique
|
//$oscommercedb->close(); Ne pas fermer car la conn de webcal est la meme que dolibarr si parametre host/user/pass identique
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$mesg ="<div class=\"error\">".$langs->trans("OSCommerceTestKo2",$_POST["oscommerce_dbhost"],$_POST["oscommerce_dbuser"]);
|
$mesg ="<div class=\"error\">".$langs->trans("OSCommerceTestKo2",GETPOST('oscommerce_dbhost','alpha'),GETPOST('oscommerce_dbuser','alpha'));
|
||||||
$mesg.="<br>".$oscommercedb->error();
|
$mesg.="<br>".$oscommercedb->error();
|
||||||
$mesg.="</div>";
|
$mesg.="</div>";
|
||||||
}
|
}
|
||||||
@ -142,7 +143,7 @@ print "</tr>";
|
|||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr ".$bc[$var].">";
|
print "<tr ".$bc[$var].">";
|
||||||
print "<td>".$langs->trans("OSCommerceServer")."</td>";
|
print "<td>".$langs->trans("OSCommerceServer")."</td>";
|
||||||
print "<td><input type=\"text\" class=\"flat\" name=\"oscommerce_dbhost\" value=\"". ($_POST["oscommerce_dbhost"]?$_POST["oscommerce_dbhost"]:$conf->global->OSC_DB_HOST) . "\" size=\"30\"></td>";
|
print "<td><input type=\"text\" class=\"flat\" name=\"oscommerce_dbhost\" value=\"". (GETPOST('oscommerce_dbhost','alpha')?GETPOST('oscommerce_dbhost','alpha'):$conf->global->OSC_DB_HOST) . "\" size=\"30\"></td>";
|
||||||
print "<td>localhost";
|
print "<td>localhost";
|
||||||
//print "<br>__dolibarr_main_db_host__ <i>(".$dolibarr_main_db_host.")</i>"
|
//print "<br>__dolibarr_main_db_host__ <i>(".$dolibarr_main_db_host.")</i>"
|
||||||
print "</td>";
|
print "</td>";
|
||||||
@ -150,7 +151,7 @@ print "</tr>";
|
|||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr ".$bc[$var].">";
|
print "<tr ".$bc[$var].">";
|
||||||
print "<td>".$langs->trans("OSCommerceDatabaseName")."</td>";
|
print "<td>".$langs->trans("OSCommerceDatabaseName")."</td>";
|
||||||
print "<td><input type=\"text\" class=\"flat\" name=\"oscommerce_dbname\" value=\"". ($_POST["oscommerce_dbname"]?$_POST["oscommerce_dbname"]:$conf->global->OSC_DB_NAME) . "\" size=\"30\"></td>";
|
print "<td><input type=\"text\" class=\"flat\" name=\"oscommerce_dbname\" value=\"". (GETPOST('oscommerce_dbname','alpha')?GETPOST('oscommerce_dbname','alpha'):$conf->global->OSC_DB_NAME) . "\" size=\"30\"></td>";
|
||||||
print "<td>oscommerce";
|
print "<td>oscommerce";
|
||||||
//print "<br>__dolibarr_main_db_name__ <i>(".$dolibarr_main_db_name.")</i>";
|
//print "<br>__dolibarr_main_db_name__ <i>(".$dolibarr_main_db_name.")</i>";
|
||||||
print "</td>";
|
print "</td>";
|
||||||
@ -158,14 +159,14 @@ print "</tr>";
|
|||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr ".$bc[$var].">";
|
print "<tr ".$bc[$var].">";
|
||||||
print "<td>".$langs->trans("OSCommercePrefix")."</td>";
|
print "<td>".$langs->trans("OSCommercePrefix")."</td>";
|
||||||
print "<td><input type=\"text\" class=\"flat\" name=\"oscommerce_db_table_prefix\" value=\"". ($_POST["oscommerce_db_table_prefix"]?$_POST["oscommerce_db_table_prefix"]:$conf->global->DB_TABLE_PREFIX) . "\" size=\"30\"></td>";
|
print "<td><input type=\"text\" class=\"flat\" name=\"oscommerce_db_table_prefix\" value=\"". (GETPOST('oscommerce_db_table_prefix','alpha')?GETPOST('oscommerce_db_table_prefix','alpha'):$conf->global->DB_TABLE_PREFIX) . "\" size=\"30\"></td>";
|
||||||
print "<td>osc_";
|
print "<td>osc_";
|
||||||
print "</td>";
|
print "</td>";
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr ".$bc[$var].">";
|
print "<tr ".$bc[$var].">";
|
||||||
print "<td>".$langs->trans("OSCommerceUser")."</td>";
|
print "<td>".$langs->trans("OSCommerceUser")."</td>";
|
||||||
print "<td><input type=\"text\" class=\"flat\" name=\"oscommerce_dbuser\" value=\"". ($_POST["oscommerce_dbuser"]?$_POST["oscommerce_dbuser"]:$conf->global->OSC_DB_USER) . "\" size=\"30\"></td>";
|
print "<td><input type=\"text\" class=\"flat\" name=\"oscommerce_dbuser\" value=\"". (GETPOST('oscommerce_dbuser','alpha')?GETPOST('oscommerce_dbuser','alpha'):$conf->global->OSC_DB_USER) . "\" size=\"30\"></td>";
|
||||||
print "<td>oscommerceuser";
|
print "<td>oscommerceuser";
|
||||||
//print "<br>__dolibarr_main_db_user__ <i>(".$dolibarr_main_db_user.")</i>";
|
//print "<br>__dolibarr_main_db_user__ <i>(".$dolibarr_main_db_user.")</i>";
|
||||||
print "</td>";
|
print "</td>";
|
||||||
@ -173,7 +174,7 @@ print "</tr>";
|
|||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr ".$bc[$var].">";
|
print "<tr ".$bc[$var].">";
|
||||||
print "<td>".$langs->trans("Password")."</td>";
|
print "<td>".$langs->trans("Password")."</td>";
|
||||||
print "<td><input type=\"password\" class=\"flat\" name=\"oscommerce_dbpass\" value=\"" . ($_POST["oscommerce_dbpass"]?$_POST["oscommerce_dbpass"]:$conf->global->OSC_DB_PASS) . "\" size=\"30\"></td>";
|
print "<td><input type=\"password\" class=\"flat\" name=\"oscommerce_dbpass\" value=\"" . (GETPOST('oscommerce_dbpass','alpha')?GETPOST('oscommerce_dbpass','alpha'):$conf->global->OSC_DB_PASS) . "\" size=\"30\"></td>";
|
||||||
print '<td>';
|
print '<td>';
|
||||||
//if ($dolibarr_main_db_pass) print '__dolibarr_main_db_pass__ <i>('.preg_replace('/./i','*',$dolibarr_main_db_pass).')</i>';
|
//if ($dolibarr_main_db_pass) print '__dolibarr_main_db_pass__ <i>('.preg_replace('/./i','*',$dolibarr_main_db_pass).')</i>';
|
||||||
print ' </td>';
|
print ' </td>';
|
||||||
@ -181,7 +182,7 @@ print "</tr>";
|
|||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr ".$bc[$var].">";
|
print "<tr ".$bc[$var].">";
|
||||||
print "<td>".$langs->trans("PasswordRetype")."</td>";
|
print "<td>".$langs->trans("PasswordRetype")."</td>";
|
||||||
print "<td><input type=\"password\" class=\"flat\" name=\"oscommerce_dbpass2\" value=\"" . ($_POST["oscommerce_dbpass2"]?$_POST["oscommerce_dbpass2"]:$conf->global->OSC_DB_PASS) ."\" size=\"30\"></td>";
|
print "<td><input type=\"password\" class=\"flat\" name=\"oscommerce_dbpass2\" value=\"" . (GETPOST('oscommerce_dbpass2','alpha')?GETPOST('oscommerce_dbpass2','alpha'):$conf->global->OSC_DB_PASS) ."\" size=\"30\"></td>";
|
||||||
print '<td>';
|
print '<td>';
|
||||||
//if ($dolibarr_main_db_pass) print '__dolibarr_main_db_pass__ <i>('.preg_replace('/./i','*',$dolibarr_main_db_pass).')</i>';
|
//if ($dolibarr_main_db_pass) print '__dolibarr_main_db_pass__ <i>('.preg_replace('/./i','*',$dolibarr_main_db_pass).')</i>';
|
||||||
print ' </td>';
|
print ' </td>';
|
||||||
|
|||||||
@ -191,9 +191,9 @@ if ($action == 'sendallconfirmed' && $confirm == 'yes')
|
|||||||
$tmpfield=explode('=',$other[4],2); $other5=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]);
|
$tmpfield=explode('=',$other[4],2); $other5=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]);
|
||||||
$substitutionarray=array(
|
$substitutionarray=array(
|
||||||
'__ID__' => $obj->source_id,
|
'__ID__' => $obj->source_id,
|
||||||
'__EMAIL__' => $obj->email,
|
'__EMAIL__' => '<a href="mailto:'.$obj->email.'">'.$obj->email.'</a>',
|
||||||
'__CHECK_READ__' => '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$obj->tag.'" width="0" height="0" style="width:0px;height:0px" border="0"/>',
|
'__CHECK_READ__' => '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$obj->tag.'" width="0" height="0" style="width:0px;height:0px" border="0"/>',
|
||||||
'__UNSUSCRIBE__' => '<a href="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-usubscribe.php?tag='.$obj->tag.'&unsuscrib=1" target="_blank"/>'.$langs->trans("MailUnsubcribe").'</a>',
|
'__UNSUSCRIBE__' => '<a href="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-usubscribe.php?tag='.$obj->tag.'&unsuscrib=1" target="_blank">'.$langs->trans("MailUnsubcribe").'</a>',
|
||||||
'__LASTNAME__' => $obj->nom,
|
'__LASTNAME__' => $obj->nom,
|
||||||
'__FIRSTNAME__' => $obj->prenom,
|
'__FIRSTNAME__' => $obj->prenom,
|
||||||
'__OTHER1__' => $other1,
|
'__OTHER1__' => $other1,
|
||||||
|
|||||||
@ -1705,7 +1705,7 @@ function img_picto_common($alt, $picto, $options='', $pictoisfullpath=0)
|
|||||||
global $conf;
|
global $conf;
|
||||||
if (! preg_match('/(\.png|\.gif)$/i',$picto)) $picto.='.png';
|
if (! preg_match('/(\.png|\.gif)$/i',$picto)) $picto.='.png';
|
||||||
if ($pictoisfullpath) return '<img src="'.$picto.'" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'"'.($options?' '.$options:'').'>';
|
if ($pictoisfullpath) return '<img src="'.$picto.'" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'"'.($options?' '.$options:'').'>';
|
||||||
if (! empty($conf->global->MAIN_MODULE_CAN_OVERWRITE_COMMONICONS) && file_exists(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/'.$picto)) return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/'.$picto.'" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'"'.($options?' '.$options:'').'>';
|
if (! empty($conf->global->MAIN_MODULE_CAN_OVERWRITE_COMMONICONS) && file_exists(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/img/'.$picto)) return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/'.$picto.'" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'"'.($options?' '.$options:'').'>';
|
||||||
return '<img src="'.DOL_URL_ROOT.'/theme/common/'.$picto.'" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'"'.($options?' '.$options:'').'>';
|
return '<img src="'.DOL_URL_ROOT.'/theme/common/'.$picto.'" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'"'.($options?' '.$options:'').'>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -327,7 +327,7 @@ class modSociete extends DolibarrModules
|
|||||||
*/
|
*/
|
||||||
function init($options='')
|
function init($options='')
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf, $langs;
|
||||||
|
|
||||||
// We disable this to prevent pb of modules not correctly disabled
|
// We disable this to prevent pb of modules not correctly disabled
|
||||||
//$this->remove($options);
|
//$this->remove($options);
|
||||||
|
|||||||
@ -138,70 +138,112 @@ abstract class ModeleNumRefProjects
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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 DoliDB $db objet base de donnee
|
||||||
* @param Object $object object project
|
* @param Object $object Object fichinter
|
||||||
* @param string $model force le modele a utiliser ('' to not force)
|
* @param string $modele force le modele a utiliser ('' par defaut)
|
||||||
* @param Translate $outputlangs objet lang a utiliser pour traduction
|
* @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
|
* @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;
|
global $conf,$langs;
|
||||||
$langs->load("projects");
|
$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
|
// 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))
|
if (! empty($conf->global->PROJECT_ADDON_PDF))
|
||||||
{
|
{
|
||||||
$model = $conf->global->PROJECT_ADDON_PDF;
|
$modele = $conf->global->PROJECT_ADDON_PDF;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$model='baleine';
|
$modele='baleine';
|
||||||
//print $langs->trans("Error")." ".$langs->trans("Error_PROJECT_ADDON_PDF_NotDefined");
|
|
||||||
//return 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Charge le modele
|
// If selected modele is a filename template (then $modele="modelname:filename")
|
||||||
$file = "pdf_".$model.".modules.php";
|
$tmp=explode(':',$modele,2);
|
||||||
if (file_exists($dir.$file))
|
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)
|
||||||
{
|
{
|
||||||
$classname = "pdf_".$model;
|
foreach(array('doc','pdf') as $prefix)
|
||||||
require_once($dir.$file);
|
{
|
||||||
|
$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
|
||||||
|
if ($filefound)
|
||||||
|
{
|
||||||
|
require_once($file);
|
||||||
|
|
||||||
$obj = new $classname($db);
|
$obj = new $classname($db);
|
||||||
|
|
||||||
// We save charset_output to restore it because write_file can change it if needed for
|
// We save charset_output to restore it because write_file can change it if needed for
|
||||||
// output format that does not support UTF8.
|
// output format that does not support UTF8.
|
||||||
$sav_charset_output=$outputlangs->charset_output;
|
$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;
|
$outputlangs->charset_output=$sav_charset_output;
|
||||||
|
|
||||||
// we delete preview files
|
// we delete preview files
|
||||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
|
require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
|
||||||
dol_delete_preview($object);
|
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;
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$outputlangs->charset_output=$sav_charset_output;
|
$outputlangs->charset_output=$sav_charset_output;
|
||||||
dol_syslog("Erreur dans project_pdf_create");
|
dol_print_error($db,"project_pdf_create Error: ".$obj->error);
|
||||||
dol_print_error($db,$obj->error);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print $langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists",$dir.$file);
|
print $langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists",$file);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@ -868,8 +868,8 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
|
|||||||
print '<!-- Includes for Dolibarr, modules or specific pages-->'."\n";
|
print '<!-- Includes for Dolibarr, modules or specific pages-->'."\n";
|
||||||
// Output style sheets (optioncss='print' or '')
|
// Output style sheets (optioncss='print' or '')
|
||||||
$themepath=dol_buildpath((empty($conf->global->MAIN_FORCETHEMEDIR)?'':$conf->global->MAIN_FORCETHEMEDIR).$conf->css,1);
|
$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):'');
|
$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'];
|
if (! empty($_SESSION['dol_resetcache'])) $themeparam.='&dol_resetcache='.$_SESSION['dol_resetcache'];
|
||||||
//print 'themepath='.$themepath.' themeparam='.$themeparam;exit;
|
//print 'themepath='.$themepath.' themeparam='.$themeparam;exit;
|
||||||
print '<link rel="stylesheet" type="text/css" title="default" href="'.$themepath.$themeparam.'">'."\n";
|
print '<link rel="stylesheet" type="text/css" title="default" href="'.$themepath.$themeparam.'">'."\n";
|
||||||
// CSS forced by modules (relative url starting with /)
|
// CSS forced by modules (relative url starting with /)
|
||||||
@ -1446,7 +1446,7 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me
|
|||||||
print '" href="';
|
print '" href="';
|
||||||
print sprintf($helpbaseurl,urlencode(html_entity_decode($helppage)));
|
print sprintf($helpbaseurl,urlencode(html_entity_decode($helppage)));
|
||||||
print '">';
|
print '">';
|
||||||
print img_picto('',DOL_URL_ROOT.'/theme/common/helpdoc.png','',1).' ';
|
print img_picto('', 'helpdoc').' ';
|
||||||
print $langs->trans($mode == 'wiki' ? 'OnlineHelp': 'Help');
|
print $langs->trans($mode == 'wiki' ? 'OnlineHelp': 'Help');
|
||||||
//if ($mode == 'wiki') print ' ('.dol_trunc(strtr($helppage,'_',' '),8).')';
|
//if ($mode == 'wiki') print ' ('.dol_trunc(strtr($helppage,'_',' '),8).')';
|
||||||
print '</a>';
|
print '</a>';
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.org>
|
* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.org>
|
||||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -36,30 +36,30 @@ $langs->load("paybox");
|
|||||||
if (!$user->admin)
|
if (!$user->admin)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
$action = GETPOST("action");
|
$action = GETPOST('action','alpha');
|
||||||
|
|
||||||
|
|
||||||
if ($action == 'setvalue' && $user->admin)
|
if ($action == 'setvalue' && $user->admin)
|
||||||
{
|
{
|
||||||
$db->begin();
|
$db->begin();
|
||||||
//$result=dolibarr_set_const($db, "PAYBOX_IBS_DEVISE",$_POST["PAYBOX_IBS_DEVISE"],'chaine',0,'',$conf->entity);
|
//$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++;
|
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++;
|
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++;
|
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++;
|
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++;
|
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++;
|
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++;
|
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++;
|
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 (! $result > 0) $error++;
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.org>
|
* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.org>
|
||||||
* Copyright (C) 2011-2012 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2011-2012 Regis Houssin <regis@dolibarr.fr>
|
||||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -39,34 +39,34 @@ $langs->load("paybox");
|
|||||||
if (!$user->admin)
|
if (!$user->admin)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
$action = GETPOST("action");
|
$action = GETPOST('action','alpha');
|
||||||
|
|
||||||
if ($action == 'setvalue' && $user->admin)
|
if ($action == 'setvalue' && $user->admin)
|
||||||
{
|
{
|
||||||
$db->begin();
|
$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++;
|
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++;
|
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++;
|
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++;
|
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++;
|
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++;
|
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++;
|
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++;
|
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++;
|
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++;
|
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++;
|
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 (! $result > 0) $error++;
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
@ -286,12 +286,12 @@ if ($conf->commande->enabled)
|
|||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||||
print $langs->trans("EnterRefToBuildUrl",$langs->transnoentitiesnoconv("Order")).': ';
|
print $langs->trans("EnterRefToBuildUrl",$langs->transnoentitiesnoconv("Order")).': ';
|
||||||
print '<input type="text class="flat" id="generate_order_ref" name="generate_order_ref" value="'.GETPOST('generate_order_ref').'" size="10">';
|
print '<input type="text class="flat" id="generate_order_ref" name="generate_order_ref" value="'.GETPOST('generate_order_ref','alpha').'" size="10">';
|
||||||
print '<input type="submit" class="none" value="'.$langs->trans("GetSecuredUrl").'">';
|
print '<input type="submit" class="none" value="'.$langs->trans("GetSecuredUrl").'">';
|
||||||
if (GETPOST('generate_order_ref'))
|
if (GETPOST('generate_order_ref','alpha'))
|
||||||
{
|
{
|
||||||
print '<br> -> <strong>';
|
print '<br> -> <strong>';
|
||||||
$url=getPaypalPaymentUrl(0,'order',GETPOST('generate_order_ref'));
|
$url=getPaypalPaymentUrl(0,'order',GETPOST('generate_order_ref','alpha'));
|
||||||
print $url;
|
print $url;
|
||||||
print "</strong><br>\n";
|
print "</strong><br>\n";
|
||||||
}
|
}
|
||||||
@ -308,12 +308,12 @@ if ($conf->facture->enabled)
|
|||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||||
print $langs->trans("EnterRefToBuildUrl",$langs->transnoentitiesnoconv("Invoice")).': ';
|
print $langs->trans("EnterRefToBuildUrl",$langs->transnoentitiesnoconv("Invoice")).': ';
|
||||||
print '<input type="text class="flat" id="generate_invoice_ref" name="generate_invoice_ref" value="'.GETPOST('generate_invoice_ref').'" size="10">';
|
print '<input type="text class="flat" id="generate_invoice_ref" name="generate_invoice_ref" value="'.GETPOST('generate_invoice_ref','alpha').'" size="10">';
|
||||||
print '<input type="submit" class="none" value="'.$langs->trans("GetSecuredUrl").'">';
|
print '<input type="submit" class="none" value="'.$langs->trans("GetSecuredUrl").'">';
|
||||||
if (GETPOST('generate_invoice_ref'))
|
if (GETPOST('generate_invoice_ref','alpha'))
|
||||||
{
|
{
|
||||||
print '<br> -> <strong>';
|
print '<br> -> <strong>';
|
||||||
$url=getPaypalPaymentUrl(0,'invoice',GETPOST('generate_invoice_ref'));
|
$url=getPaypalPaymentUrl(0,'invoice',GETPOST('generate_invoice_ref','alpha'));
|
||||||
print $url;
|
print $url;
|
||||||
print "</strong><br>\n";
|
print "</strong><br>\n";
|
||||||
}
|
}
|
||||||
@ -330,12 +330,12 @@ if ($conf->contrat->enabled)
|
|||||||
$langs->load("contract");
|
$langs->load("contract");
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||||
print $langs->trans("EnterRefToBuildUrl",$langs->transnoentitiesnoconv("Contract")).': ';
|
print $langs->trans("EnterRefToBuildUrl",$langs->transnoentitiesnoconv("Contract")).': ';
|
||||||
print '<input type="text class="flat" id="generate_contract_ref" name="generate_contract_ref" value="'.GETPOST('generate_contract_ref').'" size="10">';
|
print '<input type="text class="flat" id="generate_contract_ref" name="generate_contract_ref" value="'.GETPOST('generate_contract_ref','alpha').'" size="10">';
|
||||||
print '<input type="submit" class="none" value="'.$langs->trans("GetSecuredUrl").'">';
|
print '<input type="submit" class="none" value="'.$langs->trans("GetSecuredUrl").'">';
|
||||||
if (GETPOST('generate_contract_ref'))
|
if (GETPOST('generate_contract_ref'))
|
||||||
{
|
{
|
||||||
print '<br> -> <strong>';
|
print '<br> -> <strong>';
|
||||||
$url=getPaypalPaymentUrl(0,'contractline',GETPOST('generate_contract_ref'));
|
$url=getPaypalPaymentUrl(0,'contractline',GETPOST('generate_contract_ref','alpha'));
|
||||||
print $url;
|
print $url;
|
||||||
print "</strong><br>\n";
|
print "</strong><br>\n";
|
||||||
}
|
}
|
||||||
@ -352,12 +352,12 @@ if ($conf->adherent->enabled)
|
|||||||
$langs->load("members");
|
$langs->load("members");
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||||
print $langs->trans("EnterRefToBuildUrl",$langs->transnoentitiesnoconv("Member")).': ';
|
print $langs->trans("EnterRefToBuildUrl",$langs->transnoentitiesnoconv("Member")).': ';
|
||||||
print '<input type="text class="flat" id="generate_member_ref" name="generate_member_ref" value="'.GETPOST('generate_member_ref').'" size="10">';
|
print '<input type="text class="flat" id="generate_member_ref" name="generate_member_ref" value="'.GETPOST('generate_member_ref','alpha').'" size="10">';
|
||||||
print '<input type="submit" class="none" value="'.$langs->trans("GetSecuredUrl").'">';
|
print '<input type="submit" class="none" value="'.$langs->trans("GetSecuredUrl").'">';
|
||||||
if (GETPOST('generate_member_ref'))
|
if (GETPOST('generate_member_ref'))
|
||||||
{
|
{
|
||||||
print '<br> -> <strong>';
|
print '<br> -> <strong>';
|
||||||
$url=getPaypalPaymentUrl(0,'membersubscription',GETPOST('generate_member_ref'));
|
$url=getPaypalPaymentUrl(0,'membersubscription',GETPOST('generate_member_ref','alpha'));
|
||||||
print $url;
|
print $url;
|
||||||
print "</strong><br>\n";
|
print "</strong><br>\n";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -186,7 +186,7 @@ if ($result)
|
|||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
|
|
||||||
print '<tr class="liste_titre"><td colspan="5">'.$transRecordedType.'</td></tr>';
|
print '<tr class="liste_titre"><td colspan="6">'.$transRecordedType.'</td></tr>';
|
||||||
|
|
||||||
$var=True;
|
$var=True;
|
||||||
|
|
||||||
@ -222,6 +222,14 @@ if ($result)
|
|||||||
print "<td>";
|
print "<td>";
|
||||||
print dol_print_date($db->jdate($objp->datem),'day');
|
print dol_print_date($db->jdate($objp->datem),'day');
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
// Sell price
|
||||||
|
if (empty($conf->global->PRODUIT_MULTIPRICES))
|
||||||
|
{
|
||||||
|
print '<td align="right">';
|
||||||
|
if ($objp->price_base_type == 'TTC') print price($objp->price_ttc).' '.$langs->trans("TTC");
|
||||||
|
else print price($objp->price).' '.$langs->trans("HT");
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
print '<td align="right" nowrap="nowrap">';
|
print '<td align="right" nowrap="nowrap">';
|
||||||
print $product_static->LibStatut($objp->tosell,5,0);
|
print $product_static->LibStatut($objp->tosell,5,0);
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
#!/usr/bin/php
|
|
||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 693 B After Width: | Height: | Size: 693 B |
BIN
htdocs/theme/bureau2crea/img/helpdoc.png
Normal file
BIN
htdocs/theme/bureau2crea/img/helpdoc.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 693 B |
BIN
htdocs/theme/cameleo/img/helpdoc.png
Normal file
BIN
htdocs/theme/cameleo/img/helpdoc.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 693 B |
BIN
htdocs/theme/eldy/img/helpdoc.png
Normal file
BIN
htdocs/theme/eldy/img/helpdoc.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 693 B |
@ -135,9 +135,9 @@ if ($resql)
|
|||||||
$other5=$other[4];
|
$other5=$other[4];
|
||||||
$substitutionarray=array(
|
$substitutionarray=array(
|
||||||
'__ID__' => $obj->source_id,
|
'__ID__' => $obj->source_id,
|
||||||
'__EMAIL__' => $obj->email,
|
'__EMAIL__' => '<a href="mailto:'.$obj->email.'">'.$obj->email.'</a>',
|
||||||
'__CHECK_READ__' => '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$obj->tag.'" width="0" height="0" style="width:0px;height:0px" border="0"/>',
|
'__CHECK_READ__' => '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$obj->tag.'" width="0" height="0" style="width:0px;height:0px" border="0"/>',
|
||||||
'__UNSUSCRIBE__' => '<a href="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-usubscribe.php?tag='.$obj->tag.'&unsuscrib=1" target="_blank"/>'.$langs->trans("MailUnsubcribe").'</a>',
|
'__UNSUSCRIBE__' => '<a href="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-usubscribe.php?tag='.$obj->tag.'&unsuscrib=1" target="_blank">'.$langs->trans("MailUnsubcribe").'</a>',
|
||||||
'__LASTNAME__' => $obj->lastname,
|
'__LASTNAME__' => $obj->lastname,
|
||||||
'__FIRSTNAME__' => $obj->firstname,
|
'__FIRSTNAME__' => $obj->firstname,
|
||||||
'__OTHER1__' => $other1,
|
'__OTHER1__' => $other1,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user