Merge branch 'develop' of ssh://git@github.com/Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
39395b02d0
@ -6,7 +6,7 @@
|
|||||||
* Copyright (C) 2004 Andre Cianfarani <acianfa@free.fr>
|
* Copyright (C) 2004 Andre Cianfarani <acianfa@free.fr>
|
||||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2011 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
|
||||||
@ -375,98 +375,119 @@ print "</tr>\n";
|
|||||||
|
|
||||||
clearstatcache();
|
clearstatcache();
|
||||||
|
|
||||||
|
$var=true;
|
||||||
foreach ($conf->file->dol_document_root as $dirroot)
|
foreach ($conf->file->dol_document_root as $dirroot)
|
||||||
{
|
{
|
||||||
$dir = $dirroot . "/core/modules/commande/";
|
foreach (array('','/doc') as $valdir)
|
||||||
|
{
|
||||||
|
$dir = $dirroot . "/core/modules/commande".$valdir;
|
||||||
|
|
||||||
if (is_dir($dir))
|
if (is_dir($dir))
|
||||||
{
|
{
|
||||||
$handle = opendir($dir);
|
$handle=opendir($dir);
|
||||||
if (is_resource($handle))
|
if (is_resource($handle))
|
||||||
{
|
{
|
||||||
$var=true;
|
while (($file = readdir($handle))!==false)
|
||||||
while (($file = readdir($handle))!==false)
|
{
|
||||||
{
|
$filelist[]=$file;
|
||||||
if (preg_match('/\.modules\.php$/i',$file) && substr($file,0,4) == 'pdf_')
|
}
|
||||||
{
|
closedir($handle);
|
||||||
$name = substr($file, 4, dol_strlen($file) -16);
|
|
||||||
$classname = substr($file, 0, dol_strlen($file) -12);
|
|
||||||
|
|
||||||
$var=!$var;
|
foreach($filelist as $file)
|
||||||
print "<tr ".$bc[$var].">\n <td>";
|
{
|
||||||
print "$name";
|
if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file))
|
||||||
print "</td>\n <td>\n";
|
|
||||||
require_once($dir.$file);
|
|
||||||
$module = new $classname($db);
|
|
||||||
print $module->description;
|
|
||||||
print "</td>\n";
|
|
||||||
|
|
||||||
// Activated
|
|
||||||
print "<td align=\"center\">\n";
|
|
||||||
if (in_array($name, $def))
|
|
||||||
{
|
|
||||||
//if ($conf->global->COMMANDE_ADDON_PDF != "$name")
|
|
||||||
//{
|
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scandir='.$module->scandir.'&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 '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
|
||||||
print img_picto($langs->trans("Disabled"),'switch_off');
|
|
||||||
print '</a>';
|
|
||||||
}
|
|
||||||
print "</td>";
|
|
||||||
|
|
||||||
// Defaut
|
|
||||||
print "<td align=\"center\">";
|
|
||||||
if ($conf->global->COMMANDE_ADDON_PDF == "$name")
|
|
||||||
{
|
|
||||||
print img_picto($langs->trans("Yes"),'on');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
|
||||||
print img_picto($langs->trans("No"),'off');
|
|
||||||
print '</a>';
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
// 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;
|
if (file_exists($dir.'/'.$file))
|
||||||
|
{
|
||||||
|
$name = substr($file, 4, dol_strlen($file) -16);
|
||||||
|
$classname = substr($file, 0, dol_strlen($file) -12);
|
||||||
|
|
||||||
|
require_once($dir.'/'.$file);
|
||||||
|
$module = new $classname($db);
|
||||||
|
|
||||||
|
$modulequalified=1;
|
||||||
|
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0;
|
||||||
|
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0;
|
||||||
|
|
||||||
|
if ($modulequalified)
|
||||||
|
{
|
||||||
|
$var = !$var;
|
||||||
|
print '<tr '.$bc[$var].'><td width="100">';
|
||||||
|
print (empty($module->name)?$name:$module->name);
|
||||||
|
print "</td><td>\n";
|
||||||
|
if (method_exists($module,'info')) print $module->info($langs);
|
||||||
|
else print $module->description;
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
// Active
|
||||||
|
if (in_array($name, $def))
|
||||||
|
{
|
||||||
|
print '<td align="center">'."\n";
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
|
||||||
|
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||||
|
print '</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"),'switch_off').'</a>';
|
||||||
|
print "</td>";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Defaut
|
||||||
|
print "<td align=\"center\">";
|
||||||
|
if ($conf->global->PROPALE_ADDON_PDF == "$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"));
|
||||||
|
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("PaymentMode").': '.yn($module->option_modereg,1,1);
|
||||||
|
$htmltooltip.='<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1);
|
||||||
|
$htmltooltip.='<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1);
|
||||||
|
//$htmltooltip.='<br>'.$langs->trans("Escompte").': '.yn($module->option_escompte,1,1);
|
||||||
|
//$htmltooltip.='<br>'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1);
|
||||||
|
$htmltooltip.='<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1);
|
||||||
|
|
||||||
|
|
||||||
|
print '<td align="center">';
|
||||||
|
print $form->textwithpicto('',$htmltooltip,1,0);
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
// Preview
|
||||||
|
print '<td align="center">';
|
||||||
|
if ($module->type == 'pdf')
|
||||||
|
{
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'bill').'</a>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print img_object($langs->trans("PreviewNotAvailable"),'generic');
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print "</tr>\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
}
|
||||||
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
|
}
|
||||||
$htmltooltip.='<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1);
|
}
|
||||||
$htmltooltip.='<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1);
|
}
|
||||||
$htmltooltip.='<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1);
|
|
||||||
//$htmltooltip.='<br>'.$langs->trans("Escompte").': '.yn($module->option_escompte,1,1);
|
|
||||||
//$htmltooltip.='<br>'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1);
|
|
||||||
$htmltooltip.='<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1);
|
|
||||||
|
|
||||||
print '<td align="center">';
|
|
||||||
print $form->textwithpicto('',$htmltooltip,1,0);
|
|
||||||
print '</td>';
|
|
||||||
print '<td align="center">';
|
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'order').'</a>';
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
print "</tr>\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
closedir($handle);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (c) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (c) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2010-2011 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2010-2011 Regis Houssin <regis@dolibarr.fr>
|
||||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
@ -25,8 +25,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \class FormActions
|
* Class to manage building of HTML components
|
||||||
* \brief Class to manage building of HTML components
|
|
||||||
*/
|
*/
|
||||||
class FormActions
|
class FormActions
|
||||||
{
|
{
|
||||||
@ -37,23 +36,23 @@ class FormActions
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param DoliDB $DB Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function FormActions($DB)
|
function FormActions($db)
|
||||||
{
|
{
|
||||||
$this->db = $DB;
|
$this->db = $db;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show list of action status
|
* Show list of action status
|
||||||
*
|
*
|
||||||
* @param formname Name of form where select in included
|
* @param string $formname Name of form where select in included
|
||||||
* @param selected Preselected value
|
* @param string $selected Preselected value
|
||||||
* @param canedit 1=can edit, 0=read only
|
* @param int $canedit 1=can edit, 0=read only
|
||||||
* @param htmlname Name of html prefix for html fields (selectX and valX)
|
* @param string $htmlname Name of html prefix for html fields (selectX and valX)
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function form_select_status_action($formname,$selected,$canedit=1,$htmlname='complete')
|
function form_select_status_action($formname,$selected,$canedit=1,$htmlname='complete')
|
||||||
{
|
{
|
||||||
@ -101,11 +100,12 @@ class FormActions
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show list of actions for element
|
* Show list of actions for element
|
||||||
* @param object Object
|
*
|
||||||
* @param typeelement 'invoice','propal','order','invoice_supplier','order_supplier','fichinter'
|
* @param Object $object Object
|
||||||
* @param socid socid of user
|
* @param string $typeelement 'invoice','propal','order','invoice_supplier','order_supplier','fichinter'
|
||||||
* @return int <0 if KO, >=0 if OK
|
* @param int $socid socid of user
|
||||||
|
* @return int <0 if KO, >=0 if OK
|
||||||
*/
|
*/
|
||||||
function showactions($object,$typeelement,$socid=0)
|
function showactions($object,$typeelement,$socid=0)
|
||||||
{
|
{
|
||||||
@ -159,9 +159,11 @@ class FormActions
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Output list of type of event
|
* Output list of type of event
|
||||||
* @param selected Type pre-selectionne
|
*
|
||||||
* @param htmlname Nom champ formulaire
|
* @param string $selected Type pre-selectionne
|
||||||
|
* @param string $htmlname Nom champ formulaire
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function select_type_actions($selected='',$htmlname='actioncode')
|
function select_type_actions($selected='',$htmlname='actioncode')
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||||
*
|
*
|
||||||
@ -25,8 +25,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \class FormAdmin
|
* Class to generate html code for admin pages
|
||||||
* \brief Class to generate html code for admin pages
|
|
||||||
*/
|
*/
|
||||||
class FormAdmin
|
class FormAdmin
|
||||||
{
|
{
|
||||||
@ -42,7 +41,6 @@ class FormAdmin
|
|||||||
function FormAdmin($db)
|
function FormAdmin($db)
|
||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -279,7 +277,7 @@ class FormAdmin
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retourne la liste deroulante des menus disponibles (eldy)
|
* Return a HTML select list of timezones
|
||||||
*
|
*
|
||||||
* @param string $selected Menu pre-selectionnee
|
* @param string $selected Menu pre-selectionnee
|
||||||
* @param string $htmlname Nom de la zone select
|
* @param string $htmlname Nom de la zone select
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2007-2011 Regis Houssin <regis@dolibarr.fr>
|
/* Copyright (C) 2007-2011 Regis Houssin <regis@dolibarr.fr>
|
||||||
* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* 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
|
||||||
@ -24,8 +24,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \class Form
|
* Class to manage barcode HTML
|
||||||
* \brief Classe permettant la generation de composants html
|
|
||||||
*/
|
*/
|
||||||
class FormBarCode
|
class FormBarCode
|
||||||
{
|
{
|
||||||
@ -41,7 +40,6 @@ class FormBarCode
|
|||||||
function FormBarCode($db)
|
function FormBarCode($db)
|
||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2008-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* 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
|
||||||
@ -23,9 +23,8 @@
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \class FormCompany
|
* Class to build HTML component for third parties management
|
||||||
* \brief Class to build HTML component for third parties management
|
* Only common components are here.
|
||||||
* \remarks Only common components must be here.
|
|
||||||
*/
|
*/
|
||||||
class FormCompany
|
class FormCompany
|
||||||
{
|
{
|
||||||
|
|||||||
@ -25,8 +25,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \class FormFile
|
* Class to offer components to list and upload files
|
||||||
* \brief Class to offer components to list and upload files
|
|
||||||
*/
|
*/
|
||||||
class FormFile
|
class FormFile
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?PHP
|
<?PHP
|
||||||
/* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||||
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
@ -25,11 +25,11 @@
|
|||||||
require_once(DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php");
|
require_once(DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php");
|
||||||
|
|
||||||
|
|
||||||
/** \class FormMail
|
/**
|
||||||
* \brief Classe permettant la generation du formulaire html d'envoi de mail unitaire
|
* Classe permettant la generation du formulaire html d'envoi de mail unitaire
|
||||||
* \remarks Utilisation: $formail = new FormMail($db)
|
* Usage: $formail = new FormMail($db)
|
||||||
* \remarks $formmail->proprietes=1 ou chaine ou tableau de valeurs
|
* $formmail->proprietes=1 ou chaine ou tableau de valeurs
|
||||||
* \remarks $formmail->show_form() affiche le formulaire
|
* $formmail->show_form() affiche le formulaire
|
||||||
*/
|
*/
|
||||||
class FormMail
|
class FormMail
|
||||||
{
|
{
|
||||||
@ -69,12 +69,13 @@ class FormMail
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Constructeur
|
* Constructor
|
||||||
* \param DB handler d'acces base de donnee
|
*
|
||||||
|
* @param DoliDB $DB Database handler
|
||||||
*/
|
*/
|
||||||
function FormMail($DB)
|
function FormMail($db)
|
||||||
{
|
{
|
||||||
$this->db = $DB;
|
$this->db = $db;
|
||||||
|
|
||||||
$this->withform=1;
|
$this->withform=1;
|
||||||
|
|
||||||
@ -103,6 +104,8 @@ class FormMail
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Clear list of attached files in send mail form (stored in session)
|
* Clear list of attached files in send mail form (stored in session)
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function clear_attached_files()
|
function clear_attached_files()
|
||||||
{
|
{
|
||||||
@ -125,6 +128,7 @@ class FormMail
|
|||||||
* @param string $path Full absolute path on filesystem of file, including file name
|
* @param string $path Full absolute path on filesystem of file, including file name
|
||||||
* @param string $file Only filename
|
* @param string $file Only filename
|
||||||
* @param string $type Mime type
|
* @param string $type Mime type
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function add_attached_files($path,$file,$type)
|
function add_attached_files($path,$file,$type)
|
||||||
{
|
{
|
||||||
@ -148,7 +152,8 @@ class FormMail
|
|||||||
/**
|
/**
|
||||||
* Remove a file from the list of attached files (stored in SECTION array)
|
* Remove a file from the list of attached files (stored in SECTION array)
|
||||||
*
|
*
|
||||||
* @param $keytodelete Key in file array
|
* @param string $keytodelete Key in file array
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function remove_attached_files($keytodelete)
|
function remove_attached_files($keytodelete)
|
||||||
{
|
{
|
||||||
@ -190,8 +195,9 @@ class FormMail
|
|||||||
* Show the form to input an email
|
* Show the form to input an email
|
||||||
* this->withfile: 0=No attaches files, 1=Show attached files, 2=Can add new attached files
|
* this->withfile: 0=No attaches files, 1=Show attached files, 2=Can add new attached files
|
||||||
*
|
*
|
||||||
* @param addfileaction Name of action when posting file attachments
|
* @param string $addfileaction Name of action when posting file attachments
|
||||||
* @param removefileaction Name of action when removing file attachments
|
* @param string $removefileaction Name of action when removing file attachments
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function show_form($addfileaction='addfile',$removefileaction='removefile')
|
function show_form($addfileaction='addfile',$removefileaction='removefile')
|
||||||
{
|
{
|
||||||
@ -202,8 +208,9 @@ class FormMail
|
|||||||
* Get the form to input an email
|
* Get the form to input an email
|
||||||
* this->withfile: 0=No attaches files, 1=Show attached files, 2=Can add new attached files
|
* this->withfile: 0=No attaches files, 1=Show attached files, 2=Can add new attached files
|
||||||
*
|
*
|
||||||
* @param addfileaction Name of action when posting file attachments
|
* @param string $addfileaction Name of action when posting file attachments
|
||||||
* @param removefileaction Name of action when removing file attachments
|
* @param string $removefileaction Name of action when removing file attachments
|
||||||
|
* @return string Form to show
|
||||||
*/
|
*/
|
||||||
function get_form($addfileaction='addfile',$removefileaction='removefile')
|
function get_form($addfileaction='addfile',$removefileaction='removefile')
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* 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
|
||||||
@ -23,9 +23,8 @@
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \class FormOrder
|
* Classe permettant la generation de composants html
|
||||||
* \brief Classe permettant la generation de composants html
|
* Only common components are here.
|
||||||
* \remarks Only common components must be here.
|
|
||||||
*/
|
*/
|
||||||
class FormOrder
|
class FormOrder
|
||||||
{
|
{
|
||||||
@ -35,24 +34,24 @@ class FormOrder
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Constructeur
|
* Constructor
|
||||||
* \param DB handler d'acces base de donnee
|
*
|
||||||
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function FormOrder($DB)
|
function FormOrder($db)
|
||||||
{
|
{
|
||||||
$this->db = $DB;
|
$this->db = $db;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renvoie la liste des sources de commandes
|
* Return list of way to order
|
||||||
*
|
*
|
||||||
* @param selected Id de la source pre-selectionnee
|
* @param string $selected Id of preselected order origin
|
||||||
* @param htmlname Nom de la liste deroulante
|
* @param string $htmlname Name of HTML select list
|
||||||
* @param addempty 0=liste sans valeur nulle, 1=ajoute valeur inconnue
|
* @param int $addempty 0=liste sans valeur nulle, 1=ajoute valeur inconnue
|
||||||
* @return array Tableau des sources de commandes
|
* @return array Tableau des sources de commandes
|
||||||
*/
|
*/
|
||||||
function selectSourcesCommande($selected='',$htmlname='source_id',$addempty=0)
|
function selectSourcesCommande($selected='',$htmlname='source_id',$addempty=0)
|
||||||
{
|
{
|
||||||
@ -74,8 +73,12 @@ class FormOrder
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Return list of way to order
|
||||||
*
|
*
|
||||||
*
|
* @param string $selected Id of preselected input method
|
||||||
|
* @param string $htmlname Name of HTML select list
|
||||||
|
* @param int $addempty 0=liste sans valeur nulle, 1=ajoute valeur inconnue
|
||||||
|
* @return array Tableau des sources de commandes
|
||||||
*/
|
*/
|
||||||
function select_methodes_commande($selected='',$htmlname='source_id',$addempty=0)
|
function select_methodes_commande($selected='',$htmlname='source_id',$addempty=0)
|
||||||
{
|
{
|
||||||
@ -89,7 +92,7 @@ class FormOrder
|
|||||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_input_method";
|
$sql.= " FROM ".MAIN_DB_PREFIX."c_input_method";
|
||||||
$sql.= " WHERE active = 1";
|
$sql.= " WHERE active = 1";
|
||||||
|
|
||||||
dol_syslog("Form::select_methodes_commande sql=".$sql);
|
dol_syslog(get_class($this)."::select_methodes_commande sql=".$sql);
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (c) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (c) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||||
@ -32,9 +32,8 @@
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \class FormOther
|
* Classe permettant la generation de composants html autre
|
||||||
* \brief Classe permettant la generation de composants html autre
|
* Only common components are here.
|
||||||
* \remarks Only common components must be here.
|
|
||||||
*/
|
*/
|
||||||
class FormOther
|
class FormOther
|
||||||
{
|
{
|
||||||
@ -210,12 +209,12 @@ class FormOther
|
|||||||
/**
|
/**
|
||||||
* Return a HTML select list to select a percent
|
* Return a HTML select list to select a percent
|
||||||
*
|
*
|
||||||
* @param selected pourcentage pre-selectionne
|
* @param string $selected pourcentage pre-selectionne
|
||||||
* @param htmlname nom de la liste deroulante
|
* @param string $htmlname nom de la liste deroulante
|
||||||
* @param increment increment value
|
* @param int $increment increment value
|
||||||
* @param start start value
|
* @param int $start start value
|
||||||
* @param end end value
|
* @param int $end end value
|
||||||
* @return return combo
|
* @return string HTML select string
|
||||||
*/
|
*/
|
||||||
function select_percent($selected=0,$htmlname='percent',$disabled=0,$increment=5,$start=0,$end=100)
|
function select_percent($selected=0,$htmlname='percent',$disabled=0,$increment=5,$start=0,$end=100)
|
||||||
{
|
{
|
||||||
@ -243,10 +242,10 @@ class FormOther
|
|||||||
/**
|
/**
|
||||||
* Return select list for categories (to use in form search selectors)
|
* Return select list for categories (to use in form search selectors)
|
||||||
*
|
*
|
||||||
* @param type Type of categories (0=product, 1=suppliers, 2=customers, 3=members)
|
* @param int $type Type of categories (0=product, 1=suppliers, 2=customers, 3=members)
|
||||||
* @param selected Preselected value
|
* @param string $selected Preselected value
|
||||||
* @param htmlname Name of combo list
|
* @param string $htmlname Name of combo list
|
||||||
* @return return Html combo list code
|
* @return string Html combo list code
|
||||||
*/
|
*/
|
||||||
function select_categories($type,$selected=0,$htmlname='search_categ')
|
function select_categories($type,$selected=0,$htmlname='search_categ')
|
||||||
{
|
{
|
||||||
@ -279,10 +278,10 @@ class FormOther
|
|||||||
/**
|
/**
|
||||||
* Return select list for categories (to use in form search selectors)
|
* Return select list for categories (to use in form search selectors)
|
||||||
*
|
*
|
||||||
* @param selected Preselected value
|
* @param string $selected Preselected value
|
||||||
* @param htmlname Name of combo list
|
* @param string $htmlname Name of combo list
|
||||||
* @param user Object user
|
* @param User $user Object user
|
||||||
* @return return Html combo list code
|
* @return string Html combo list code
|
||||||
*/
|
*/
|
||||||
function select_salesrepresentatives($selected=0,$htmlname='search_sale',$user)
|
function select_salesrepresentatives($selected=0,$htmlname='search_sale',$user)
|
||||||
{
|
{
|
||||||
@ -373,11 +372,11 @@ class FormOther
|
|||||||
/**
|
/**
|
||||||
* Output a HTML code to select a color
|
* Output a HTML code to select a color
|
||||||
*
|
*
|
||||||
* @param set_color Pre-selected color
|
* @param string $set_color Pre-selected color
|
||||||
* @param prefix Name of HTML field
|
* @param string $prefix Name of HTML field
|
||||||
* @param form_name Name of form
|
* @param string $form_name Name of form
|
||||||
* @param showcolorbox 1=Show color code and color box, 0=Show only color code
|
* @param int $showcolorbox 1=Show color code and color box, 0=Show only color code
|
||||||
* @param arrayofcolors Array of colors. Example: array('29527A','5229A3','A32929','7A367A','B1365F','0D7813')
|
* @param array $arrayofcolors Array of colors. Example: array('29527A','5229A3','A32929','7A367A','B1365F','0D7813')
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function select_color($set_color='', $prefix='f_color', $form_name='objForm', $showcolorbox=1, $arrayofcolors='')
|
function select_color($set_color='', $prefix='f_color', $form_name='objForm', $showcolorbox=1, $arrayofcolors='')
|
||||||
|
|||||||
@ -24,11 +24,11 @@
|
|||||||
require_once(DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php");
|
require_once(DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php");
|
||||||
|
|
||||||
|
|
||||||
/** \class FormSms
|
/**
|
||||||
* \brief Classe permettant la generation du formulaire d'envoi de Sms
|
* Classe permettant la generation du formulaire d'envoi de Sms
|
||||||
* \remarks Utilisation: $formsms = new FormSms($db)
|
* Usage: $formsms = new FormSms($db)
|
||||||
* \remarks $formsms->proprietes=1 ou chaine ou tableau de valeurs
|
* $formsms->proprietes=1 ou chaine ou tableau de valeurs
|
||||||
* \remarks $formsms->show_form() affiche le formulaire
|
* $formsms->show_form() affiche le formulaire
|
||||||
*/
|
*/
|
||||||
class FormSms
|
class FormSms
|
||||||
{
|
{
|
||||||
@ -62,11 +62,11 @@ class FormSms
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param DoliDB $DB Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function FormSms($DB)
|
function FormSms($db)
|
||||||
{
|
{
|
||||||
$this->db = $DB;
|
$this->db = $db;
|
||||||
|
|
||||||
$this->withfrom=1;
|
$this->withfrom=1;
|
||||||
$this->withto=1;
|
$this->withto=1;
|
||||||
|
|||||||
@ -25,8 +25,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \class Interfaces
|
* Class to manage triggers
|
||||||
* \brief Classe de la gestion des triggers
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class Interfaces
|
class Interfaces
|
||||||
@ -45,26 +44,27 @@ class Interfaces
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Fonction appelee lors du declenchement d'un evenement Dolibarr.
|
* Function called when a Dolibarr business event occurs
|
||||||
* Cette fonction declenche tous les triggers trouves actifs.
|
* This function call all qualified triggers.
|
||||||
* \param action Trigger event code
|
*
|
||||||
* \param object Objet concern
|
* @param string $action Trigger event code
|
||||||
* \param user Objet user
|
* @param Object $object Objet concern
|
||||||
* \param lang Objet lang
|
* @param User $user Objet user
|
||||||
* \param conf Objet conf
|
* @param Lang $lang Objet lang
|
||||||
* \return int Nb of triggers ran if no error, -Nb of triggers with errors otherwise.
|
* @param Conf $conf Objet conf
|
||||||
|
* @return int Nb of triggers ran if no error, -Nb of triggers with errors otherwise.
|
||||||
*/
|
*/
|
||||||
function run_triggers($action,$object,$user,$langs,$conf)
|
function run_triggers($action,$object,$user,$langs,$conf)
|
||||||
{
|
{
|
||||||
// Check parameters
|
// Check parameters
|
||||||
if (! is_object($object) || ! is_object($conf)) // Error
|
if (! is_object($object) || ! is_object($conf)) // Error
|
||||||
{
|
{
|
||||||
dol_syslog('interface::run_triggers was called with wrong parameters action='.$action.' object='.is_object($object).' user='.is_object($user).' langs='.is_object($langs).' conf='.is_object($conf), LOG_ERR);
|
dol_syslog(get_class($this).'::run_triggers was called with wrong parameters action='.$action.' object='.is_object($object).' user='.is_object($user).' langs='.is_object($langs).' conf='.is_object($conf), LOG_ERR);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (! is_object($user) || ! is_object($langs)) // Warning
|
if (! is_object($user) || ! is_object($langs)) // Warning
|
||||||
{
|
{
|
||||||
dol_syslog('interface::run_triggers was called with wrong parameters action='.$action.' object='.is_object($object).' user='.is_object($user).' langs='.is_object($langs).' conf='.is_object($conf), LOG_WARNING);
|
dol_syslog(get_class($this).'::run_triggers was called with wrong parameters action='.$action.' object='.is_object($object).' user='.is_object($user).' langs='.is_object($langs).' conf='.is_object($conf), LOG_WARNING);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($conf->triggers_modules as $reldir)
|
foreach($conf->triggers_modules as $reldir)
|
||||||
@ -175,9 +175,10 @@ class Interfaces
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return list of triggers. Function used by admin page htdoc/admin/triggers
|
* Return list of triggers. Function used by admin page htdoc/admin/triggers
|
||||||
* @param workflow 0=Return all triggers, 1=Return only triggers not disabled if workflow module activated
|
*
|
||||||
* @return array Array list of triggers
|
* @param int $workflow 0=Return all triggers, 1=Return only triggers not disabled if workflow module activated
|
||||||
|
* @return array Array list of triggers
|
||||||
*/
|
*/
|
||||||
function getTriggersList($workflow=0)
|
function getTriggersList($workflow=0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -30,7 +30,6 @@
|
|||||||
*/
|
*/
|
||||||
class Ldap
|
class Ldap
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tableau des serveurs (IP addresses ou nom d'hotes)
|
* Tableau des serveurs (IP addresses ou nom d'hotes)
|
||||||
*/
|
*/
|
||||||
@ -90,7 +89,6 @@ class Ldap
|
|||||||
var $ldapcharset='UTF-8'; // LDAP should be UTF-8 encoded
|
var $ldapcharset='UTF-8'; // LDAP should be UTF-8 encoded
|
||||||
|
|
||||||
|
|
||||||
// 1.2 Private properties ----------------------------------------------------
|
|
||||||
/**
|
/**
|
||||||
* The internal LDAP connection handle
|
* The internal LDAP connection handle
|
||||||
*/
|
*/
|
||||||
@ -135,15 +133,16 @@ class Ldap
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 2.1 Connection handling methods -------------------------------------------
|
// Connection handling methods -------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 2.1.1 : Connects to the server. Just creates a connection which is used
|
* Connects to the server. Just creates a connection which is used
|
||||||
* in all later access to the LDAP server. If it can't connect and bind
|
* in all later access to the LDAP server. If it can't connect and bind
|
||||||
* anonymously, it creates an error code of -1. Returns true if connected,
|
* anonymously, it creates an error code of -1. Returns true if connected,
|
||||||
* false if failed. Takes an array of possible servers - if one doesn't work,
|
* false if failed. Takes an array of possible servers - if one doesn't work,
|
||||||
* it tries the next and so on.
|
* it tries the next and so on.
|
||||||
* \deprecated Utiliser connect_bind a la place
|
*
|
||||||
|
* @deprecated Utiliser connect_bind a la place
|
||||||
*/
|
*/
|
||||||
function connect()
|
function connect()
|
||||||
{
|
{
|
||||||
@ -181,10 +180,11 @@ class Ldap
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Connect and bind
|
* Connect and bind
|
||||||
* \return <0 si KO, 1 si bind anonymous, 2 si bind auth
|
* Use this->server, this->serverPort, this->ldapProtocolVersion, this->serverType, this->searchUser, this->searchPassword
|
||||||
* \remarks Use this->server, this->serverPort, this->ldapProtocolVersion, this->serverType, this->searchUser, this->searchPassword
|
* After return, this->connection and $this->bind are defined
|
||||||
* After return, this->connection and $this->bind are defined
|
*
|
||||||
|
* @return int <0 si KO, 1 si bind anonymous, 2 si bind auth
|
||||||
*/
|
*/
|
||||||
function connect_bind()
|
function connect_bind()
|
||||||
{
|
{
|
||||||
@ -283,8 +283,10 @@ class Ldap
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 2.1.2 : Simply closes the connection set up earlier.
|
* Simply closes the connection set up earlier.
|
||||||
* Returns true if OK, false if there was an error.
|
* Returns true if OK, false if there was an error.
|
||||||
|
*
|
||||||
|
* @return boolean true or false
|
||||||
*/
|
*/
|
||||||
function close()
|
function close()
|
||||||
{
|
{
|
||||||
@ -299,8 +301,10 @@ class Ldap
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 2.1.3 : Anonymously binds to the connection. After this is done,
|
* Anonymously binds to the connection. After this is done,
|
||||||
* queries and searches can be done - but read-only.
|
* queries and searches can be done - but read-only.
|
||||||
|
*
|
||||||
|
* @return boolean true or false
|
||||||
*/
|
*/
|
||||||
function bind()
|
function bind()
|
||||||
{
|
{
|
||||||
@ -318,10 +322,14 @@ class Ldap
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 2.1.4 : Binds as an authenticated user, which usually allows for write
|
* Binds as an authenticated user, which usually allows for write
|
||||||
* access. The FULL dn must be passed. For a directory manager, this is
|
* access. The FULL dn must be passed. For a directory manager, this is
|
||||||
* "cn=Directory Manager" under iPlanet. For a user, it will be something
|
* "cn=Directory Manager" under iPlanet. For a user, it will be something
|
||||||
* like "uid=jbloggs,ou=People,dc=foo,dc=com".
|
* like "uid=jbloggs,ou=People,dc=foo,dc=com".
|
||||||
|
*
|
||||||
|
* @param string $bindDn DN
|
||||||
|
* @param string $pass Password
|
||||||
|
* @return boolean true or false
|
||||||
*/
|
*/
|
||||||
function bindauth($bindDn,$pass)
|
function bindauth($bindDn,$pass)
|
||||||
{
|
{
|
||||||
@ -339,9 +347,9 @@ class Ldap
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Unbind du serveur ldap.
|
* Unbind du serveur ldap.
|
||||||
* \param ds
|
*
|
||||||
* \return bool
|
* @return boolean true or false
|
||||||
*/
|
*/
|
||||||
function unbind()
|
function unbind()
|
||||||
{
|
{
|
||||||
@ -355,9 +363,9 @@ class Ldap
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief verification de la version du serveur ldap.
|
* Verification de la version du serveur ldap.
|
||||||
* \param ds
|
*
|
||||||
* \return version
|
* @return string version
|
||||||
*/
|
*/
|
||||||
function getVersion()
|
function getVersion()
|
||||||
{
|
{
|
||||||
@ -367,8 +375,9 @@ class Ldap
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief changement de la version du serveur ldap.
|
* Change ldap protocol version to use.
|
||||||
* \return version
|
*
|
||||||
|
* @return string version
|
||||||
*/
|
*/
|
||||||
function setVersion() {
|
function setVersion() {
|
||||||
// LDAP_OPT_PROTOCOL_VERSION est une constante qui vaut 17
|
// LDAP_OPT_PROTOCOL_VERSION est une constante qui vaut 17
|
||||||
@ -377,8 +386,9 @@ class Ldap
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief changement du referrals.
|
* changement du referrals.
|
||||||
* \return referrals
|
*
|
||||||
|
* @return string referrals
|
||||||
*/
|
*/
|
||||||
function setReferrals() {
|
function setReferrals() {
|
||||||
// LDAP_OPT_REFERRALS est une constante qui vaut ?
|
// LDAP_OPT_REFERRALS est une constante qui vaut ?
|
||||||
@ -388,12 +398,13 @@ class Ldap
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Add a LDAP entry
|
* Add a LDAP entry
|
||||||
* \param dn DN entry key
|
* Ldap object connect and bind must have been done
|
||||||
* \param info Attributes array
|
*
|
||||||
* \param user Objet user that create
|
* @param string $dn DN entry key
|
||||||
* \return int <0 if KO, >0 if OK
|
* @param string $info Attributes array
|
||||||
* \remarks Ldap object connect and bind must have been done
|
* @param User $user Objet user that create
|
||||||
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function add($dn, $info, $user)
|
function add($dn, $info, $user)
|
||||||
{
|
{
|
||||||
@ -439,12 +450,13 @@ class Ldap
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Modify a LDAP entry
|
* Modify a LDAP entry
|
||||||
* \param dn DN entry key
|
* Ldap object connect and bind must have been done
|
||||||
* \param info Attributes array
|
*
|
||||||
* \param user Objet user that modify
|
* @param string $dn DN entry key
|
||||||
* \return int <0 if KO, >0 if OK
|
* @param string $info Attributes array
|
||||||
* \remarks Ldap object connect and bind must have been done
|
* @param string $user Objet user that modify
|
||||||
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function modify($dn, $info, $user)
|
function modify($dn, $info, $user)
|
||||||
{
|
{
|
||||||
@ -490,13 +502,14 @@ class Ldap
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Modify a LDAP entry (to use if dn != olddn)
|
* Modify a LDAP entry (to use if dn != olddn)
|
||||||
* \param dn DN entry key
|
* Ldap object connect and bind must have been done
|
||||||
* \param info Attributes array
|
*
|
||||||
* \param user Objet user that delete
|
* @param string $dn DN entry key
|
||||||
* \param olddn Old DN entry key (before update)
|
* @param string $info Attributes array
|
||||||
* \return int <0 if KO, >0 if OK
|
* @param User $user Objet user that delete
|
||||||
* \remarks Ldap object connect and bind must have been done
|
* @param string $olddn Old DN entry key (before update)
|
||||||
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function update($dn,$info,$user,$olddn)
|
function update($dn,$info,$user,$olddn)
|
||||||
{
|
{
|
||||||
@ -544,10 +557,11 @@ class Ldap
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Delete a LDAP entry
|
* Delete a LDAP entry
|
||||||
* \param dn DN entry key
|
* Ldap object connect and bind must have been done
|
||||||
* \return int <0 si KO, >0 si OK
|
*
|
||||||
* \remarks Ldap object connect and bind must have been done
|
* @param string $dn DN entry key
|
||||||
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function delete($dn)
|
function delete($dn)
|
||||||
{
|
{
|
||||||
@ -577,10 +591,11 @@ class Ldap
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Build a LDAP message
|
* Build a LDAP message
|
||||||
* \param dn DN entry key
|
*
|
||||||
* \param info Attributes array
|
* @param string $dn DN entry key
|
||||||
* \return string Content of file
|
* @param string $info Attributes array
|
||||||
|
* @return string Content of file
|
||||||
*/
|
*/
|
||||||
function dump_content($dn, $info)
|
function dump_content($dn, $info)
|
||||||
{
|
{
|
||||||
@ -618,10 +633,11 @@ class Ldap
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Dump a LDAP message to ldapinput.in file
|
* Dump a LDAP message to ldapinput.in file
|
||||||
* \param dn DN entry key
|
*
|
||||||
* \param info Attributes array
|
* @param string $dn DN entry key
|
||||||
* \return int <0 if KO, >0 if OK
|
* @param string $info Attributes array
|
||||||
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function dump($dn, $info)
|
function dump($dn, $info)
|
||||||
{
|
{
|
||||||
@ -650,15 +666,16 @@ class Ldap
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 2.4 Attribute methods -----------------------------------------------------
|
// Attribute methods -----------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Add a LDAP attribute in entry
|
* Add a LDAP attribute in entry
|
||||||
* \param dn DN entry key
|
* Ldap object connect and bind must have been done
|
||||||
* \param info Attributes array
|
*
|
||||||
* \param user Objet user that create
|
* @param string $dn DN entry key
|
||||||
* \return int <0 if KO, >0 if OK
|
* @param string $info Attributes array
|
||||||
* \remarks Ldap object connect and bind must have been done
|
* @param User $user Objet user that create
|
||||||
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function addAttribute($dn, $info, $user)
|
function addAttribute($dn, $info, $user)
|
||||||
{
|
{
|
||||||
@ -704,12 +721,13 @@ class Ldap
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Update a LDAP attribute in entry
|
* Update a LDAP attribute in entry
|
||||||
* \param dn DN entry key
|
* Ldap object connect and bind must have been done
|
||||||
* \param info Attributes array
|
*
|
||||||
* \param user Objet user that create
|
* @param string $dn DN entry key
|
||||||
* \return int <0 if KO, >0 if OK
|
* @param string $info Attributes array
|
||||||
* \remarks Ldap object connect and bind must have been done
|
* @param User $user Objet user that create
|
||||||
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function updateAttribute($dn, $info, $user)
|
function updateAttribute($dn, $info, $user)
|
||||||
{
|
{
|
||||||
@ -755,12 +773,13 @@ class Ldap
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Delete a LDAP attribute in entry
|
* Delete a LDAP attribute in entry
|
||||||
* \param dn DN entry key
|
* Ldap object connect and bind must have been done
|
||||||
* \param info Attributes array
|
*
|
||||||
* \param user Objet user that create
|
* @param string $dn DN entry key
|
||||||
* \return int <0 if KO, >0 if OK
|
* @param string $info Attributes array
|
||||||
* \remarks Ldap object connect and bind must have been done
|
* @param User $user Objet user that create
|
||||||
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function deleteAttribute($dn, $info, $user)
|
function deleteAttribute($dn, $info, $user)
|
||||||
{
|
{
|
||||||
@ -807,6 +826,10 @@ class Ldap
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an array containing attributes and values for first record
|
* Returns an array containing attributes and values for first record
|
||||||
|
*
|
||||||
|
* @param string $dn DN entry key
|
||||||
|
* @param string $filter Filter
|
||||||
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function getAttribute($dn,$filter)
|
function getAttribute($dn,$filter)
|
||||||
{
|
{
|
||||||
@ -848,6 +871,10 @@ class Ldap
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an array containing values for an attribute and for first record matching filterrecord
|
* Returns an array containing values for an attribute and for first record matching filterrecord
|
||||||
|
*
|
||||||
|
* @param string $filterrecord Record
|
||||||
|
* @param string $attribute Attributes
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function getAttributeValues($filterrecord,$attribute)
|
function getAttributeValues($filterrecord,$attribute)
|
||||||
{
|
{
|
||||||
@ -882,14 +909,15 @@ class Ldap
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Returns an array containing a details of elements
|
* Returns an array containing a details of elements
|
||||||
* \param $search Valeur champ cle recherche, sinon '*' pour tous.
|
* ldapsearch -LLLx -hlocalhost -Dcn=admin,dc=parinux,dc=org -w password -b "ou=adherents,ou=people,dc=parinux,dc=org" userPassword
|
||||||
* \param $userDn DN (Ex: ou=adherents,ou=people,dc=parinux,dc=org)
|
*
|
||||||
* \param $useridentifier Nom du champ cle (Ex: uid)
|
* @param string $search Valeur champ cle recherche, sinon '*' pour tous.
|
||||||
* \param $attributeArray Array of fields required (Ex: sn,userPassword)
|
* @param string $userDn DN (Ex: ou=adherents,ou=people,dc=parinux,dc=org)
|
||||||
* \param $activefilter 1=utilise le champ this->filter comme filtre
|
* @param string $useridentifier Name of key field (Ex: uid)
|
||||||
* \return array Array of [id_record][ldap_field]=value
|
* @param array $attributeArray Array of fields required (Ex: sn,userPassword)
|
||||||
* \remarks ldapsearch -LLLx -hlocalhost -Dcn=admin,dc=parinux,dc=org -w password -b "ou=adherents,ou=people,dc=parinux,dc=org" userPassword
|
* @param int $activefilter 1=utilise le champ this->filter comme filtre
|
||||||
|
* @return array Array of [id_record][ldap_field]=value
|
||||||
*/
|
*/
|
||||||
function getRecords($search, $userDn, $useridentifier, $attributeArray, $activefilter=0)
|
function getRecords($search, $userDn, $useridentifier, $attributeArray, $activefilter=0)
|
||||||
{
|
{
|
||||||
@ -980,9 +1008,12 @@ class Ldap
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts a little-endian hex-number to one, that 'hexdec' can convert
|
* Converts a little-endian hex-number to one, that 'hexdec' can convert
|
||||||
* Indispensable pour Active Directory
|
* Required by Active Directory
|
||||||
|
*
|
||||||
|
* @param string $hex
|
||||||
*/
|
*/
|
||||||
function littleEndian($hex) {
|
function littleEndian($hex)
|
||||||
|
{
|
||||||
for ($x=dol_strlen($hex)-2; $x >= 0; $x=$x-2) {
|
for ($x=dol_strlen($hex)-2; $x >= 0; $x=$x-2) {
|
||||||
$result .= substr($hex,$x,2);
|
$result .= substr($hex,$x,2);
|
||||||
}
|
}
|
||||||
@ -991,9 +1022,10 @@ class Ldap
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Recupere le SID de l'utilisateur
|
* Recupere le SID de l'utilisateur
|
||||||
* ldapuser. le login de l'utilisateur
|
* Required by Active Directory
|
||||||
* Indispensable pour Active Directory
|
*
|
||||||
|
* @param string $ldapuser Login de l'utilisateur
|
||||||
*/
|
*/
|
||||||
function getObjectSid($ldapUser)
|
function getObjectSid($ldapUser)
|
||||||
{
|
{
|
||||||
@ -1050,8 +1082,12 @@ class Ldap
|
|||||||
/**
|
/**
|
||||||
* Returns the textual SID
|
* Returns the textual SID
|
||||||
* Indispensable pour Active Directory
|
* Indispensable pour Active Directory
|
||||||
|
*
|
||||||
|
* @param string $binsid Binary SID
|
||||||
|
* @return string Textual SID
|
||||||
*/
|
*/
|
||||||
function binSIDtoText($binsid) {
|
function binSIDtoText($binsid)
|
||||||
|
{
|
||||||
$hex_sid=bin2hex($binsid);
|
$hex_sid=bin2hex($binsid);
|
||||||
$rev = hexdec(substr($hex_sid,0,2)); // Get revision-part of SID
|
$rev = hexdec(substr($hex_sid,0,2)); // Get revision-part of SID
|
||||||
$subcount = hexdec(substr($hex_sid,2,2)); // Get count of sub-auth entries
|
$subcount = hexdec(substr($hex_sid,2,2)); // Get count of sub-auth entries
|
||||||
@ -1066,14 +1102,15 @@ class Ldap
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Fonction de recherche avec filtre
|
* Fonction de recherche avec filtre
|
||||||
* \remarks this->connection doit etre defini donc la methode bind ou bindauth doit avoir deja ete appelee
|
* this->connection doit etre defini donc la methode bind ou bindauth doit avoir deja ete appelee
|
||||||
* \param checkDn DN de recherche (Ex: ou=users,cn=my-domain,cn=com)
|
* Ne pas utiliser pour recherche d'une liste donnee de proprietes
|
||||||
* \param filter Filtre de recherche (ex: (sn=nom_personne) )
|
* car conflit majuscule-minuscule. A n'utiliser que pour les pages
|
||||||
* \return array Tableau des reponses (cle en minuscule-valeur)
|
* 'Fiche LDAP' qui affiche champ lisibles par defaut.
|
||||||
* \remarks Ne pas utiliser pour recherche d'une liste donnee de proprietes
|
*
|
||||||
* car conflit majuscule-minuscule. A n'utiliser que pour les pages
|
* @param checkDn DN de recherche (Ex: ou=users,cn=my-domain,cn=com)
|
||||||
* 'Fiche LDAP' qui affiche champ lisibles par defaut.
|
* @param filter Filtre de recherche (ex: (sn=nom_personne) )
|
||||||
|
* @return array Tableau des reponses (cle en minuscule-valeur)
|
||||||
*/
|
*/
|
||||||
function search($checkDn, $filter)
|
function search($checkDn, $filter)
|
||||||
{
|
{
|
||||||
@ -1105,10 +1142,11 @@ class Ldap
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Load all attribute of a LDAP user
|
* Load all attribute of a LDAP user
|
||||||
* @param $user User to search for. Not used if a filter is provided.
|
*
|
||||||
* @param filter Filter for search. Must start with &.
|
* @param User $user User to search for. Not used if a filter is provided.
|
||||||
* Examples: &(objectClass=inetOrgPerson) &(objectClass=user)(objectCategory=person) &(isMemberOf=cn=Sales,ou=Groups,dc=opencsi,dc=com)
|
* @param string $filter Filter for search. Must start with &.
|
||||||
* @return int >0 if ok, <0 if ko
|
* Examples: &(objectClass=inetOrgPerson) &(objectClass=user)(objectCategory=person) &(isMemberOf=cn=Sales,ou=Groups,dc=opencsi,dc=com)
|
||||||
|
* @return int >0 if OK, <0 if KO
|
||||||
*/
|
*/
|
||||||
function fetch($user,$filter)
|
function fetch($user,$filter)
|
||||||
{
|
{
|
||||||
@ -1195,12 +1233,15 @@ class Ldap
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 2.6 helper methods
|
// helper methods
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the correct user identifier to use, based on the ldap server type
|
* Returns the correct user identifier to use, based on the ldap server type
|
||||||
|
*
|
||||||
|
* @return string Login
|
||||||
*/
|
*/
|
||||||
function getUserIdentifier() {
|
function getUserIdentifier()
|
||||||
|
{
|
||||||
if ($this->serverType == "activedirectory") {
|
if ($this->serverType == "activedirectory") {
|
||||||
return $this->attr_sambalogin;
|
return $this->attr_sambalogin;
|
||||||
} else {
|
} else {
|
||||||
@ -1209,10 +1250,13 @@ class Ldap
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief UserAccountControl Flgs to more human understandable form...
|
* UserAccountControl Flgs to more human understandable form...
|
||||||
*
|
*
|
||||||
|
* @param string $uacf UACF
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function parseUACF($uacf) {
|
function parseUACF($uacf)
|
||||||
|
{
|
||||||
//All flags array
|
//All flags array
|
||||||
$flags = array( "TRUSTED_TO_AUTH_FOR_DELEGATION" => 16777216,
|
$flags = array( "TRUSTED_TO_AUTH_FOR_DELEGATION" => 16777216,
|
||||||
"PASSWORD_EXPIRED" => 8388608,
|
"PASSWORD_EXPIRED" => 8388608,
|
||||||
@ -1250,10 +1294,13 @@ class Ldap
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief SamAccountType value to text
|
* SamAccountType value to text
|
||||||
*
|
*
|
||||||
|
* @param string $samtype SamType
|
||||||
|
* @return string Sam string
|
||||||
*/
|
*/
|
||||||
function parseSAT($samtype) {
|
function parseSAT($samtype)
|
||||||
|
{
|
||||||
$stypes = array( 805306368 => "NORMAL_ACCOUNT",
|
$stypes = array( 805306368 => "NORMAL_ACCOUNT",
|
||||||
805306369 => "WORKSTATION_TRUST",
|
805306369 => "WORKSTATION_TRUST",
|
||||||
805306370 => "INTERDOMAIN_TRUST",
|
805306370 => "INTERDOMAIN_TRUST",
|
||||||
@ -1275,9 +1322,10 @@ class Ldap
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Convertit le temps ActiveDirectory en Unix timestamp
|
* Convertit le temps ActiveDirectory en Unix timestamp
|
||||||
* \param string AD time to convert
|
*
|
||||||
* \return string Unix timestamp
|
* @param string $value AD time to convert
|
||||||
|
* @return string Unix timestamp
|
||||||
*/
|
*/
|
||||||
function convert_time($value)
|
function convert_time($value)
|
||||||
{
|
{
|
||||||
@ -1292,9 +1340,9 @@ class Ldap
|
|||||||
/**
|
/**
|
||||||
* Convert a string into output/memory charset
|
* Convert a string into output/memory charset
|
||||||
*
|
*
|
||||||
* @param str String to convert
|
* @param string $str String to convert
|
||||||
* @param pagecodefrom Page code of src string
|
* @param string $pagecodefrom Page code of src string
|
||||||
* @return string Converted string
|
* @return string Converted string
|
||||||
*/
|
*/
|
||||||
private function convToOutputCharset($str,$pagecodefrom='UTF-8')
|
private function convToOutputCharset($str,$pagecodefrom='UTF-8')
|
||||||
{
|
{
|
||||||
@ -1307,21 +1355,22 @@ class Ldap
|
|||||||
/**
|
/**
|
||||||
* Convert a string from output/memory charset
|
* Convert a string from output/memory charset
|
||||||
*
|
*
|
||||||
* @param str String to convert
|
* @param string $str String to convert
|
||||||
* @param pagecodeto Page code for result string
|
* @param string $pagecodeto Page code for result string
|
||||||
* @return string Converted string
|
* @return string Converted string
|
||||||
*/
|
*/
|
||||||
function convFromOutputCharset($str,$pagecodeto='UTF-8')
|
function convFromOutputCharset($str,$pagecodeto='UTF-8')
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
if ($pagecodeto == 'ISO-8859-1' && $conf->file->character_set_client == 'UTF-8') $str=utf8_decode($str);
|
if ($pagecodeto == 'ISO-8859-1' && $conf->file->character_set_client == 'UTF-8') $str=utf8_decode($str);
|
||||||
if ($pagecodeto == 'UTF-8' && $conf->file->character_set_client == 'ISO-8859-1') $str=utf8_encode($str);
|
if ($pagecodeto == 'UTF-8' && $conf->file->character_set_client == 'ISO-8859-1') $str=utf8_encode($str);
|
||||||
return $str;
|
return $str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return available value of group GID
|
* Return available value of group GID
|
||||||
|
*
|
||||||
* @return int gid number
|
* @return int gid number
|
||||||
*/
|
*/
|
||||||
function getNextGroupGid()
|
function getNextGroupGid()
|
||||||
|
|||||||
@ -24,8 +24,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \class Menu
|
* Class to manage left menus
|
||||||
* \brief Class to manage left menus
|
|
||||||
*/
|
*/
|
||||||
class Menu
|
class Menu
|
||||||
{
|
{
|
||||||
|
|||||||
@ -24,8 +24,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \class Menubase
|
* Class to manage menu entries
|
||||||
* \brief Class to manage menu entries
|
|
||||||
*/
|
*/
|
||||||
class Menubase
|
class Menubase
|
||||||
{
|
{
|
||||||
|
|||||||
@ -25,8 +25,7 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/CMailFile.class.php");
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \class Notify
|
* Class to manage notifications
|
||||||
* \brief Classe de gestion des notifications
|
|
||||||
*/
|
*/
|
||||||
class Notify
|
class Notify
|
||||||
{
|
{
|
||||||
|
|||||||
@ -27,8 +27,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \class Translate
|
* Class to manage translations
|
||||||
* \brief Class to manage translations
|
|
||||||
*/
|
*/
|
||||||
class Translate
|
class Translate
|
||||||
{
|
{
|
||||||
|
|||||||
@ -0,0 +1,495 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2010-2011 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
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
* or see http://www.gnu.org/
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file htdocs/core/modules/commande/doc_generic_order_odt.modules.php
|
||||||
|
* \ingroup societe
|
||||||
|
* \brief File of class to build ODT documents for third parties
|
||||||
|
*/
|
||||||
|
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/core/modules/commande/modules_commande.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/core/lib/company.lib.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \class doc_generic_order_odt
|
||||||
|
* \brief Class to build documents using ODF templates generator
|
||||||
|
*/
|
||||||
|
class doc_generic_order_odt extends ModelePDFCommandes
|
||||||
|
{
|
||||||
|
var $emetteur; // Objet societe qui emet
|
||||||
|
|
||||||
|
var $phpmin = array(5,2,0); // Minimum version of PHP required by module
|
||||||
|
var $version = 'development';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param DoliDB $DB Database handler
|
||||||
|
*/
|
||||||
|
function doc_generic_order_odt($db)
|
||||||
|
{
|
||||||
|
global $conf,$langs,$mysoc;
|
||||||
|
|
||||||
|
$langs->load("main");
|
||||||
|
$langs->load("companies");
|
||||||
|
|
||||||
|
$this->db = $db;
|
||||||
|
$this->name = "ODT templates";
|
||||||
|
$this->description = $langs->trans("DocumentModelOdt");
|
||||||
|
$this->scandir = 'COMMANDE_ADDON_PDF_ODT_PATH'; // Name of constant that is used to save list of directories to scan
|
||||||
|
|
||||||
|
// Dimension page pour format A4
|
||||||
|
$this->type = 'odt';
|
||||||
|
$this->page_largeur = 0;
|
||||||
|
$this->page_hauteur = 0;
|
||||||
|
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||||
|
$this->marge_gauche=0;
|
||||||
|
$this->marge_droite=0;
|
||||||
|
$this->marge_haute=0;
|
||||||
|
$this->marge_basse=0;
|
||||||
|
|
||||||
|
$this->option_logo = 1; // Affiche logo
|
||||||
|
$this->option_tva = 0; // Gere option tva COMMANDE_TVAOPTION
|
||||||
|
$this->option_modereg = 0; // Affiche mode reglement
|
||||||
|
$this->option_condreg = 0; // Affiche conditions reglement
|
||||||
|
$this->option_codeproduitservice = 0; // Affiche code produit-service
|
||||||
|
$this->option_multilang = 0; // Dispo en plusieurs langues
|
||||||
|
$this->option_escompte = 0; // Affiche si il y a eu escompte
|
||||||
|
$this->option_credit_note = 0; // Support credit notes
|
||||||
|
$this->option_freetext = 1; // Support add of a personalised text
|
||||||
|
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
|
||||||
|
|
||||||
|
// Recupere emetteur
|
||||||
|
$this->emetteur=$mysoc;
|
||||||
|
if (! $this->emetteur->pays_code) $this->emetteur->pays_code=substr($langs->defaultlang,-2); // Par defaut, si n'etait pas defini
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define array with couple substitution key => substitution value
|
||||||
|
*
|
||||||
|
* @param Object $object Main object to use as data source
|
||||||
|
* @param Translate $outputlangs Lang object to use for output
|
||||||
|
*/
|
||||||
|
function get_substitutionarray_object($object,$outputlangs)
|
||||||
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
|
return array(
|
||||||
|
'object_id'=>$object->id,
|
||||||
|
'object_ref'=>$object->ref,
|
||||||
|
'object_ref_ext'=>$object->ref_ext,
|
||||||
|
'object_ref_customer'=>$object->ref_client,
|
||||||
|
'object_date'=>dol_print_date($object->date,'day'),
|
||||||
|
'object_fin_validite'=>dol_print_date($object->fin_validite,'dayhour'),
|
||||||
|
'object_date_creation'=>dol_print_date($object->date_creation,'day'),
|
||||||
|
'object_date_modification'=>dol_print_date($object->date_modification,'day'),
|
||||||
|
'object_date_validation'=>dol_print_date($object->date_validation,'dayhour'),
|
||||||
|
'object_payment_mode'=>$object->mode_reglement,
|
||||||
|
'object_payment_term'=>$object->cond_reglement,
|
||||||
|
'object_total_ht'=>price($object->total_ht,0,$outputlangs),
|
||||||
|
'object_total_vat'=>price($object->total_tva,0,$outputlangs),
|
||||||
|
'object_total_ttc'=>price($object->total_ttc,0,$outputlangs),
|
||||||
|
'object_vatrate'=>vatrate($object->tva),
|
||||||
|
'object_note_private'=>$object->note,
|
||||||
|
'object_note'=>$object->note_public,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define array with couple substitution key => substitution value
|
||||||
|
*
|
||||||
|
* @param array $line
|
||||||
|
* @param Translate $outputlangs Lang object to use for output
|
||||||
|
*/
|
||||||
|
function get_substitutionarray_lines($line,$outputlangs)
|
||||||
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
|
return array(
|
||||||
|
'line_fulldesc'=>$line->product_ref.(($line->product_ref && $line->desc)?' - ':'').$line->desc,
|
||||||
|
'line_product_ref'=>$line->product_ref,
|
||||||
|
'line_desc'=>$line->desc,
|
||||||
|
'line_vatrate'=>vatrate($line->tva_tx,true,$line->info_bits),
|
||||||
|
'line_up'=>price($line->subprice, 0, $outputlangs),
|
||||||
|
'line_qty'=>$line->qty,
|
||||||
|
'line_discount_percent'=>($line->remise_percent?$line->remise_percent.'%':''),
|
||||||
|
'line_price_ht'=>price($line->total_ht, 0, $outputlangs),
|
||||||
|
'line_price_ttc'=>price($line->total_ttc, 0, $outputlangs),
|
||||||
|
'line_price_vat'=>price($line->total_tva, 0, $outputlangs),
|
||||||
|
'line_date_start'=>$line->date_start,
|
||||||
|
'line_date_end'=>$line->date_end
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return description of a module
|
||||||
|
* @param langs Lang object to use for output
|
||||||
|
* @return string Description
|
||||||
|
*/
|
||||||
|
function info($langs)
|
||||||
|
{
|
||||||
|
global $conf,$langs;
|
||||||
|
|
||||||
|
$langs->load("companies");
|
||||||
|
$langs->load("errors");
|
||||||
|
|
||||||
|
$form = new Form($this->db);
|
||||||
|
|
||||||
|
$texte = $this->description.".<br>\n";
|
||||||
|
$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||||
|
$texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
$texte.= '<input type="hidden" name="action" value="setModuleOptions">';
|
||||||
|
$texte.= '<input type="hidden" name="param1" value="COMMANDE_ADDON_PDF_ODT_PATH">';
|
||||||
|
$texte.= '<table class="nobordernopadding" width="100%">';
|
||||||
|
|
||||||
|
// List of directories area
|
||||||
|
$texte.= '<tr><td>';
|
||||||
|
$texttitle=$langs->trans("ListOfDirectories");
|
||||||
|
$listofdir=explode(',',preg_replace('/[\r\n]+/',',',trim($conf->global->COMMANDE_ADDON_PDF_ODT_PATH)));
|
||||||
|
$listoffiles=array();
|
||||||
|
foreach($listofdir as $key=>$tmpdir)
|
||||||
|
{
|
||||||
|
$tmpdir=trim($tmpdir);
|
||||||
|
$tmpdir=preg_replace('/DOL_DATA_ROOT/',DOL_DATA_ROOT,$tmpdir);
|
||||||
|
if (! $tmpdir) { unset($listofdir[$key]); continue; }
|
||||||
|
if (! is_dir($tmpdir)) $texttitle.=img_warning($langs->trans("ErrorDirNotFound",$tmpdir),0);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$tmpfiles=dol_dir_list($tmpdir,'files',0,'\.odt');
|
||||||
|
if (count($tmpfiles)) $listoffiles=array_merge($listoffiles,$tmpfiles);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$texthelp=$langs->trans("ListOfDirectoriesForModelGenODT");
|
||||||
|
// Add list of substitution keys
|
||||||
|
$texthelp.='<br>'.$langs->trans("FollowingSubstitutionKeysCanBeUsed").'<br>';
|
||||||
|
$texthelp.=$langs->transnoentitiesnoconv("FullListOnOnlineDocumentation"); // This contains an url, we don't modify it
|
||||||
|
|
||||||
|
$texte.= $form->textwithpicto($texttitle,$texthelp,1,'help','',1);
|
||||||
|
$texte.= '<table><tr><td>';
|
||||||
|
$texte.= '<textarea class="flat" cols="60" name="value1">';
|
||||||
|
$texte.=$conf->global->COMMANDE_ADDON_PDF_ODT_PATH;
|
||||||
|
$texte.= '</textarea>';
|
||||||
|
$texte.= '</td>';
|
||||||
|
$texte.= '<td align="center"> ';
|
||||||
|
$texte.= '<input type="submit" class="button" value="'.$langs->trans("Modify").'" name="Button">';
|
||||||
|
$texte.= '</td>';
|
||||||
|
$texte.= '</tr>';
|
||||||
|
$texte.= '</table>';
|
||||||
|
|
||||||
|
// Scan directories
|
||||||
|
if (count($listofdir)) $texte.=$langs->trans("NumberOfModelFilesFound").': <b>'.count($listoffiles).'</b>';
|
||||||
|
|
||||||
|
$texte.= '</td>';
|
||||||
|
|
||||||
|
|
||||||
|
$texte.= '<td valign="top" rowspan="2">';
|
||||||
|
$texte.= $langs->trans("ExampleOfDirectoriesForModelGen");
|
||||||
|
$texte.= '</td>';
|
||||||
|
$texte.= '</tr>';
|
||||||
|
|
||||||
|
/*$texte.= '<tr>';
|
||||||
|
$texte.= '<td align="center">';
|
||||||
|
$texte.= '<input type="submit" class="button" value="'.$langs->trans("Modify").'" name="Button">';
|
||||||
|
$texte.= '</td>';
|
||||||
|
$texte.= '</tr>';*/
|
||||||
|
|
||||||
|
$texte.= '</table>';
|
||||||
|
$texte.= '</form>';
|
||||||
|
|
||||||
|
return $texte;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function to build a document on disk using the generic odt module.
|
||||||
|
*
|
||||||
|
* @param Commande $object Object source to build document
|
||||||
|
* @param Translate $outputlangs Lang output object
|
||||||
|
* @param string $srctemplatepath Full path of source filename for generator using a template file
|
||||||
|
* @return int 1 if OK, <=0 if KO
|
||||||
|
*/
|
||||||
|
function write_file($object,$outputlangs,$srctemplatepath)
|
||||||
|
{
|
||||||
|
global $user,$langs,$conf,$mysoc;
|
||||||
|
|
||||||
|
if (empty($srctemplatepath))
|
||||||
|
{
|
||||||
|
dol_syslog("doc_generic_odt::write_file parameter srctemplatepath empty", LOG_WARNING);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! is_object($outputlangs)) $outputlangs=$langs;
|
||||||
|
$sav_charset_output=$outputlangs->charset_output;
|
||||||
|
$outputlangs->charset_output='UTF-8';
|
||||||
|
|
||||||
|
$outputlangs->load("main");
|
||||||
|
$outputlangs->load("dict");
|
||||||
|
$outputlangs->load("companies");
|
||||||
|
$outputlangs->load("bills");
|
||||||
|
|
||||||
|
if ($conf->commande->dir_output)
|
||||||
|
{
|
||||||
|
// If $object is id instead of object
|
||||||
|
if (! is_object($object))
|
||||||
|
{
|
||||||
|
$id = $object;
|
||||||
|
$object = new Commande($this->db);
|
||||||
|
$result=$object->fetch($id);
|
||||||
|
if ($result < 0)
|
||||||
|
{
|
||||||
|
dol_print_error($this->db,$object->error);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$dir = $conf->commande->dir_output;
|
||||||
|
$objectref = dol_sanitizeFileName($object->ref);
|
||||||
|
if (! preg_match('/specimen/i',$objectref)) $dir.= "/" . $objectref;
|
||||||
|
$file = $dir . "/" . $objectref . ".odt";
|
||||||
|
|
||||||
|
if (! file_exists($dir))
|
||||||
|
{
|
||||||
|
if (create_exdir($dir) < 0)
|
||||||
|
{
|
||||||
|
$this->error=$langs->transnoentities("ErrorCanNotCreateDir",$dir);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (file_exists($dir))
|
||||||
|
{
|
||||||
|
//print "srctemplatepath=".$srctemplatepath; // Src filename
|
||||||
|
$newfile=basename($srctemplatepath);
|
||||||
|
$newfiletmp=preg_replace('/\.odt/i','',$newfile);
|
||||||
|
$newfiletmp=preg_replace('/template_/i','',$newfiletmp);
|
||||||
|
$newfiletmp=preg_replace('/modele_/i','',$newfiletmp);
|
||||||
|
$newfiletmp=$objectref.'_'.$newfiletmp;
|
||||||
|
//$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
|
||||||
|
$file=$dir.'/'.$newfiletmp.'.odt';
|
||||||
|
//print "newdir=".$dir;
|
||||||
|
//print "newfile=".$newfile;
|
||||||
|
//print "file=".$file;
|
||||||
|
//print "conf->societe->dir_temp=".$conf->societe->dir_temp;
|
||||||
|
|
||||||
|
create_exdir($conf->commande->dir_temp);
|
||||||
|
|
||||||
|
|
||||||
|
// If BILLING contact defined on invoice, we use it
|
||||||
|
$usecontact=false;
|
||||||
|
$arrayidcontact=$object->getIdContact('external','BILLING');
|
||||||
|
if (count($arrayidcontact) > 0)
|
||||||
|
{
|
||||||
|
$usecontact=true;
|
||||||
|
$result=$object->fetch_contact($arrayidcontact[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Recipient name
|
||||||
|
if (! empty($usecontact))
|
||||||
|
{
|
||||||
|
// On peut utiliser le nom de la societe du contact
|
||||||
|
if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) $socobject = $object->contact;
|
||||||
|
else $socobject = $object->client;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$socobject=$object->client;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Make substitution
|
||||||
|
$substitutionarray=array(
|
||||||
|
'__FROM_NAME__' => $this->emetteur->nom,
|
||||||
|
'__FROM_EMAIL__' => $this->emetteur->email,
|
||||||
|
'__TOTAL_TTC__' => $object->total_ttc,
|
||||||
|
'__TOTAL_HT__' => $object->total_ht,
|
||||||
|
'__TOTAL_VAT__' => $object->total_vat
|
||||||
|
);
|
||||||
|
complete_substitutions_array($substitutionarray, $langs, $object);
|
||||||
|
|
||||||
|
// Line of free text
|
||||||
|
$newfreetext='';
|
||||||
|
$paramfreetext='COMMANDE_FREE_TEXT';
|
||||||
|
if (! empty($conf->global->$paramfreetext))
|
||||||
|
{
|
||||||
|
$newfreetext=make_substitutions($conf->global->$paramfreetext,$substitutionarray);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Open and load template
|
||||||
|
require_once(ODTPHP_PATH.'odf.php');
|
||||||
|
$odfHandler = new odf($srctemplatepath, array(
|
||||||
|
'PATH_TO_TMP' => $conf->commande->dir_temp,
|
||||||
|
'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy.
|
||||||
|
'DELIMITER_LEFT' => '{',
|
||||||
|
'DELIMITER_RIGHT' => '}')
|
||||||
|
);
|
||||||
|
// After construction $odfHandler->contentXml contains content and
|
||||||
|
// [!-- BEGIN row.lines --]*[!-- END row.lines --] has been replaced by
|
||||||
|
// [!-- BEGIN lines --]*[!-- END lines --]
|
||||||
|
//print html_entity_decode($odfHandler->__toString());
|
||||||
|
//print exit;
|
||||||
|
|
||||||
|
|
||||||
|
// Make substitutions into odt of freetext
|
||||||
|
try {
|
||||||
|
$odfHandler->setVars('free_text', $newfreetext, true, 'UTF-8');
|
||||||
|
}
|
||||||
|
catch(OdfException $e)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// Make substitutions into odt of user info
|
||||||
|
$tmparray=$this->get_substitutionarray_user($user,$outputlangs);
|
||||||
|
//var_dump($tmparray); exit;
|
||||||
|
foreach($tmparray as $key=>$value)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
if (preg_match('/logo$/',$key)) // Image
|
||||||
|
{
|
||||||
|
//var_dump($value);exit;
|
||||||
|
if (file_exists($value)) $odfHandler->setImage($key, $value);
|
||||||
|
else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
|
||||||
|
}
|
||||||
|
else // Text
|
||||||
|
{
|
||||||
|
$odfHandler->setVars($key, $value, true, 'UTF-8');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(OdfException $e)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Make substitutions into odt of mysoc
|
||||||
|
$tmparray=$this->get_substitutionarray_mysoc($mysoc,$outputlangs);
|
||||||
|
//var_dump($tmparray); exit;
|
||||||
|
foreach($tmparray as $key=>$value)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
if (preg_match('/logo$/',$key)) // Image
|
||||||
|
{
|
||||||
|
//var_dump($value);exit;
|
||||||
|
if (file_exists($value)) $odfHandler->setImage($key, $value);
|
||||||
|
else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
|
||||||
|
}
|
||||||
|
else // Text
|
||||||
|
{
|
||||||
|
$odfHandler->setVars($key, $value, true, 'UTF-8');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(OdfException $e)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Make substitutions into odt of thirdparty
|
||||||
|
$tmparray=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
|
||||||
|
foreach($tmparray as $key=>$value)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
if (preg_match('/logo$/',$key)) // Image
|
||||||
|
{
|
||||||
|
if (file_exists($value)) $odfHandler->setImage($key, $value);
|
||||||
|
else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
|
||||||
|
}
|
||||||
|
else // Text
|
||||||
|
{
|
||||||
|
$odfHandler->setVars($key, $value, true, 'UTF-8');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(OdfException $e)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Replace tags of object + external modules
|
||||||
|
$tmparray=$this->get_substitutionarray_object($object,$outputlangs);
|
||||||
|
complete_substitutions_array($tmparray, $outputlangs, $object);
|
||||||
|
foreach($tmparray as $key=>$value)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
if (preg_match('/logo$/',$key)) // Image
|
||||||
|
{
|
||||||
|
if (file_exists($value)) $odfHandler->setImage($key, $value);
|
||||||
|
else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
|
||||||
|
}
|
||||||
|
else // Text
|
||||||
|
{
|
||||||
|
$odfHandler->setVars($key, $value, true, 'UTF-8');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(OdfException $e)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Replace tags of lines
|
||||||
|
try
|
||||||
|
{
|
||||||
|
$listlines = $odfHandler->setSegment('lines');
|
||||||
|
foreach ($object->lines as $line)
|
||||||
|
{
|
||||||
|
$tmparray=$this->get_substitutionarray_lines($line,$outputlangs);
|
||||||
|
foreach($tmparray as $key => $val)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
$listlines->setVars($key, $val, true, 'UTF-8');
|
||||||
|
}
|
||||||
|
catch(OdfException $e)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
catch(SegmentException $e)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$listlines->merge();
|
||||||
|
}
|
||||||
|
$odfHandler->mergeSegment($listlines);
|
||||||
|
}
|
||||||
|
catch(OdfException $e)
|
||||||
|
{
|
||||||
|
$this->error=$e->getMessage();
|
||||||
|
dol_syslog($this->error, LOG_WARNING);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Write new file
|
||||||
|
//$result=$odfHandler->exportAsAttachedFile('toto');
|
||||||
|
$odfHandler->saveToDisk($file);
|
||||||
|
|
||||||
|
if (! empty($conf->global->MAIN_UMASK))
|
||||||
|
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||||
|
|
||||||
|
$odfHandler=null; // Destroy object
|
||||||
|
|
||||||
|
return 1; // Success
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->error=$langs->transnoentities("ErrorCanNotCreateDir",$dir);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
@ -4,6 +4,7 @@
|
|||||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||||
|
* 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
|
||||||
@ -156,46 +157,55 @@ function commande_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0
|
|||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
$dir = "/core/modules/commande/";
|
$dir = "/core/modules/commande/";
|
||||||
$srctemplatepath='';
|
$srctemplatepath='';
|
||||||
$modelisok=0;
|
|
||||||
$liste=array();
|
|
||||||
|
|
||||||
// Positionne modele sur le nom du modele de commande a utiliser
|
// Positionne le modele sur le nom du modele a utiliser
|
||||||
$file = "pdf_".$modele.".modules.php";
|
if (! dol_strlen($modele))
|
||||||
// On verifie l'emplacement du modele
|
|
||||||
$file = dol_buildpath($dir.$file);
|
|
||||||
if ($modele && file_exists($file)) $modelisok=1;
|
|
||||||
|
|
||||||
// Si model pas encore bon
|
|
||||||
if (! $modelisok)
|
|
||||||
{
|
{
|
||||||
if ($conf->global->COMMANDE_ADDON_PDF) $modele = $conf->global->COMMANDE_ADDON_PDF;
|
if (! empty($conf->global->COMMANDE_ADDON_PDF))
|
||||||
$file = "pdf_".$modele.".modules.php";
|
{
|
||||||
// On verifie l'emplacement du modele
|
$modele = $conf->global->COMMANDE_ADDON_PDF;
|
||||||
$file = dol_buildpath($dir.$file);
|
}
|
||||||
if (file_exists($file)) $modelisok=1;
|
else
|
||||||
|
{
|
||||||
|
$modele = 'einstein';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Si model pas encore bon
|
// If selected modele is a filename template (then $modele="modelname:filename")
|
||||||
if (! $modelisok)
|
$tmp=explode(':',$modele,2);
|
||||||
|
if (! empty($tmp[1]))
|
||||||
|
{
|
||||||
|
$modele=$tmp[0];
|
||||||
|
$srctemplatepath=$tmp[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Search template file
|
||||||
|
$file=''; $classname=''; $filefound=0;
|
||||||
|
foreach(array('doc','pdf') as $prefix)
|
||||||
{
|
{
|
||||||
$liste=ModelePDFCommandes::liste_modeles($db);
|
$file = $prefix."_".$modele.".modules.php";
|
||||||
$modele=key($liste); // Renvoie premiere valeur de cle trouvee dans le tableau
|
|
||||||
$file = "pdf_".$modele.".modules.php";
|
// On verifie l'emplacement du modele
|
||||||
// On verifie l'emplacement du modele
|
$file = dol_buildpath($dir.'doc/'.$file);
|
||||||
$file = dol_buildpath($dir.$file);
|
|
||||||
if (file_exists($file)) $modelisok=1;
|
if (file_exists($file))
|
||||||
|
{
|
||||||
|
$filefound=1;
|
||||||
|
$classname=$prefix.'_'.$modele;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Charge le modele
|
// Charge le modele
|
||||||
if ($modelisok)
|
if ($filefound)
|
||||||
{
|
{
|
||||||
$classname = "pdf_".$modele;
|
|
||||||
require_once($file);
|
require_once($file);
|
||||||
|
|
||||||
$obj = new $classname($db);
|
$obj = new $classname($db);
|
||||||
|
$obj->message = $message;
|
||||||
|
|
||||||
// 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.
|
||||||
@ -204,10 +214,13 @@ function commande_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0
|
|||||||
{
|
{
|
||||||
$outputlangs->charset_output=$sav_charset_output;
|
$outputlangs->charset_output=$sav_charset_output;
|
||||||
|
|
||||||
// we delete preview files
|
// We delete old preview
|
||||||
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
|
// Appel des triggers
|
||||||
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||||
$interface=new Interfaces($db);
|
$interface=new Interfaces($db);
|
||||||
@ -220,22 +233,15 @@ function commande_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$outputlangs->charset_output=$sav_charset_output;
|
$outputlangs->charset_output=$sav_charset_output;
|
||||||
dol_syslog("Error");
|
dol_print_error($db,"order_pdf_create Error: ".$obj->error);
|
||||||
dol_print_error($db,$obj->error);
|
return -1;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (! $conf->global->COMMANDE_ADDON_PDF)
|
dol_print_error('',$langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists",$file));
|
||||||
{
|
return -1;
|
||||||
print $langs->trans("Error")." ".$langs->trans("Error_COMMANDE_ADDON_PDF_NotDefined");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print $langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists",$file);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||||
|
* 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
|
||||||
@ -89,6 +90,13 @@ class modCommande extends DolibarrModules
|
|||||||
$this->const[$r][2] = "mod_commande_marbre";
|
$this->const[$r][2] = "mod_commande_marbre";
|
||||||
$this->const[$r][3] = 'Nom du gestionnaire de numerotation des commandes';
|
$this->const[$r][3] = 'Nom du gestionnaire de numerotation des commandes';
|
||||||
$this->const[$r][4] = 0;
|
$this->const[$r][4] = 0;
|
||||||
|
|
||||||
|
$r++;
|
||||||
|
$this->const[$r][0] = "COMMANDE_ADDON_PDF_ODT_PATH";
|
||||||
|
$this->const[$r][1] = "chaine";
|
||||||
|
$this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/orders";
|
||||||
|
$this->const[$r][3] = "";
|
||||||
|
$this->const[$r][4] = 0;
|
||||||
|
|
||||||
// Boites
|
// Boites
|
||||||
$this->boxes = array();
|
$this->boxes = array();
|
||||||
|
|||||||
BIN
htdocs/install/doctemplates/orders/template_order.odt
Normal file
BIN
htdocs/install/doctemplates/orders/template_order.odt
Normal file
Binary file not shown.
@ -6,6 +6,7 @@ Agenda=Agenda
|
|||||||
Agendas=Agendes
|
Agendas=Agendes
|
||||||
Calendar=Calendari
|
Calendar=Calendari
|
||||||
Calendars=Calendaris
|
Calendars=Calendaris
|
||||||
|
LocalAgenda=Calendari local
|
||||||
AffectedTo=Assignada a
|
AffectedTo=Assignada a
|
||||||
DoneBy=Realitzat per
|
DoneBy=Realitzat per
|
||||||
Events=Esdeveniments
|
Events=Esdeveniments
|
||||||
@ -29,8 +30,8 @@ ViewDay=Vista diària
|
|||||||
ViewWeek=Vista setmanal
|
ViewWeek=Vista setmanal
|
||||||
ViewWithPredefinedFilters=Veure amb els filtres predefinits
|
ViewWithPredefinedFilters=Veure amb els filtres predefinits
|
||||||
AutoActions=Inclusió automàtica a l'agenda
|
AutoActions=Inclusió automàtica a l'agenda
|
||||||
AgendaAutoActionDesc=Definir els esdeveniments aquí per què voleu que Dolibarr creu automàticament una acció en l'ordre del dia. Si no està marcada (per defecte), es podran crear manualment.
|
AgendaAutoActionDesc=Indiqueu en aquesta pestanya els esdeveniments per els que desitja que Dolibarr creu automàticament una acció a l'agenda. Si no es marca cap cas (per defecte), només les accions manuals s'han d'incloure en l'agenda.
|
||||||
AgendaSetupOtherDesc=Aquesta pàgina us permet configurar altres paràmetres del mòdul agenda.
|
AgendaSetupOtherDesc=Aquesta pàgina permet configurar algunes opcions que permeten exportar una vista de la seva agenda Dolibar a un calendari extern (thunderbird, google calendar, ...)
|
||||||
AgendaExtSitesDesc=Aquesta pàgina permet configurar calendaris externs per a la seva visualització en l'agenda de Dolibarr.
|
AgendaExtSitesDesc=Aquesta pàgina permet configurar calendaris externs per a la seva visualització en l'agenda de Dolibarr.
|
||||||
ActionsEvents=Esdeveniments per a què Dolibarr crei una acció de forma automàtica
|
ActionsEvents=Esdeveniments per a què Dolibarr crei una acció de forma automàtica
|
||||||
PropalValidatedInDolibarr=Pressupost %s validat
|
PropalValidatedInDolibarr=Pressupost %s validat
|
||||||
|
|||||||
@ -326,6 +326,7 @@ NoDolibarrAccess=Sense accés d'usuari
|
|||||||
ExportDataset_company_1=Tercers (empreses/institucions) i atributs
|
ExportDataset_company_1=Tercers (empreses/institucions) i atributs
|
||||||
ExportDataset_company_2=Contactes de tercers i atributs
|
ExportDataset_company_2=Contactes de tercers i atributs
|
||||||
ImportDataset_company_1=Tercers (empreses/institucions) i atributs
|
ImportDataset_company_1=Tercers (empreses/institucions) i atributs
|
||||||
|
ImportDataset_company_2=Contactes (tercers o lliures) i atributs
|
||||||
PriceLevel=Nivell de preus
|
PriceLevel=Nivell de preus
|
||||||
DeliveriesAddress=Adreça(es) d'enviament
|
DeliveriesAddress=Adreça(es) d'enviament
|
||||||
DeliveryAddress=Adreça d'enviament
|
DeliveryAddress=Adreça d'enviament
|
||||||
|
|||||||
@ -65,6 +65,7 @@ ErrorPasswordsMustMatch=Les 2 contrasenyes indicades s'han de correspondre
|
|||||||
ErrorContactEMail=S'ha produït un error tècnic. Contacti amb l'administrador al e-mail <b>%s</b>, indicant el codi d'error <b>%s</b> en el seu missatge, o pot també adjuntar una còpia de pantalla d'aquesta pàgina.
|
ErrorContactEMail=S'ha produït un error tècnic. Contacti amb l'administrador al e-mail <b>%s</b>, indicant el codi d'error <b>%s</b> en el seu missatge, o pot també adjuntar una còpia de pantalla d'aquesta pàgina.
|
||||||
ErrorWrongValueForField=Valor incorrecte per al camp número <b>%s</b> (el valor '<b>%s</b>' no compleix amb la regla <b>%s</b>)
|
ErrorWrongValueForField=Valor incorrecte per al camp número <b>%s</b> (el valor '<b>%s</b>' no compleix amb la regla <b>%s</b>)
|
||||||
ErrorFieldValueNotIn=Valor incorrecte per al camp nombre <b>%s</b> (el valor '<b>%s</b>' no es un valor en el camp <b>%s</b> de la taula <b>%s</b>)
|
ErrorFieldValueNotIn=Valor incorrecte per al camp nombre <b>%s</b> (el valor '<b>%s</b>' no es un valor en el camp <b>%s</b> de la taula <b>%s</b>)
|
||||||
|
ErrorFieldRefNotIn=Valor incorrecte per al camp nombre <b>%s</b> (el valor '<b>%s</b>' no és una referència existent en <b>%s</b>)
|
||||||
ErrorsOnXLines=Errors a <b>%s</b> línies font
|
ErrorsOnXLines=Errors a <b>%s</b> línies font
|
||||||
ErrorFileIsInfectedWithAVirus=L'antivirus no ha pogut validar aquest arxiu (és probable que estigui infectat per un virus)!
|
ErrorFileIsInfectedWithAVirus=L'antivirus no ha pogut validar aquest arxiu (és probable que estigui infectat per un virus)!
|
||||||
ErrorSpecialCharNotAllowedForField=Els caràcters especials no són admesos pel camp "%s"
|
ErrorSpecialCharNotAllowedForField=Els caràcters especials no són admesos pel camp "%s"
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# Dolibarr language file - ca_ES - exports
|
# Dolibarr language file - ca_ES - exports
|
||||||
CHARSET=UTF-8
|
CHARSET=UTF-8
|
||||||
ExportsArea=Àrea exportació
|
ExportsArea=Àrea exportació
|
||||||
ImportArea=Àrea importació
|
ImportArea=Àrea importació
|
||||||
@ -103,8 +103,12 @@ NbOfLinesImported=Nombre de línies correctament importades: <b>%s</b>.
|
|||||||
DataComeFromNoWhere=El valor a inserir no correspon a cap camp de l'arxiu origen.
|
DataComeFromNoWhere=El valor a inserir no correspon a cap camp de l'arxiu origen.
|
||||||
DataComeFromFileFieldNb=El valor a inserir es correspon al camp nombre <<b>%s</b> de l'arxiu origen.
|
DataComeFromFileFieldNb=El valor a inserir es correspon al camp nombre <<b>%s</b> de l'arxiu origen.
|
||||||
DataComeFromIdFoundFromRef=El valor donat per el camp <b>%s</b> de l'arxiu origen serà utilitzat per trobar el ID de l'objecte pare a fer servir (l'objecte <b>%s</b> amb la referència de l'arxiu origen ha d'existir a Dolibarr).
|
DataComeFromIdFoundFromRef=El valor donat per el camp <b>%s</b> de l'arxiu origen serà utilitzat per trobar el ID de l'objecte pare a fer servir (l'objecte <b>%s</b> amb la referència de l'arxiu origen ha d'existir a Dolibarr).
|
||||||
|
DataComeFromIdFoundFromCodeId=El codi del camp número <b>%s</b> de l'arxiu d'origen s'utilitzarà per trobar l'id de l'objecte pare a utilitzar (el codi de l'arxiu d'origen ha d'existir en el diccionari <b>%s</b>). Tingueu en compte que si coneix l'id, pot usar-lo en lloc del codi a l'arxiu d'origen. La importació funcionarà en els 2 casos.
|
||||||
DataIsInsertedInto=Les dades de l'arxiu d'origen s'inseriran en el següent camp:
|
DataIsInsertedInto=Les dades de l'arxiu d'origen s'inseriran en el següent camp:
|
||||||
DataIDSourceIsInsertedInto=L'ID de l'objecte pare trobat a partir de la dada origen, s'inserirà en el següent camp:
|
DataIDSourceIsInsertedInto=L'ID de l'objecte pare trobat a partir de la dada origen, s'inserirà en el següent camp:
|
||||||
|
DataCodeIDSourceIsInsertedInto=L'id de la línia pare trobada a partir del codi, s'ha d'inserir en el següent camp:
|
||||||
SourceRequired=Dades d'origen obligatòries
|
SourceRequired=Dades d'origen obligatòries
|
||||||
SourceExample=Exemple de dades d'origen possibles
|
SourceExample=Exemple de dades d'origen possibles
|
||||||
CSVFormatDesc=Arxiu amb format <b>Valors separats per coma</b> (.csv).<br>És un fitxer amb format de text en què els camps són separats pel caràcter [ %s ]. Si el separador es troba en el contingut d'un camp, el camp ha d'estar tancat per el caràcter [ %s ]. El caràcter d'escapament per a incloure un caràcter d'entorn en una dada és [ %s ].
|
ExampleAnyRefFoundIntoElement=Totes les referències trobades per als elements <b>%s</b>
|
||||||
|
ExampleAnyCodeOrIdFoundIntoDictionnary=Tots els codis (o id) trobats en el diccionari <b>%s</b>
|
||||||
|
CSVFormatDesc=Arxiu amb format <b>Valors separats per coma</b> (.csv).<br>És un fitxer amb format de text en què els camps són separats pel caràcter [ %s ]. Si el separador es troba en el contingut d'un camp, el camp ha d'estar tancat per el caràcter [ %s ]. El caràcter d'escapament per a incloure un caràcter d'entorn en una dada és [ %s ].
|
||||||
|
|||||||
@ -6,6 +6,7 @@ Agenda=Agenda
|
|||||||
Agendas=Agendas
|
Agendas=Agendas
|
||||||
Calendar=Calendario
|
Calendar=Calendario
|
||||||
Calendars=Calendarios
|
Calendars=Calendarios
|
||||||
|
LocalAgenda=Calendario local
|
||||||
AffectedTo=Asignada a
|
AffectedTo=Asignada a
|
||||||
DoneBy=Realizado por
|
DoneBy=Realizado por
|
||||||
Events=Eventos
|
Events=Eventos
|
||||||
@ -29,8 +30,8 @@ ViewDay=Vista diaria
|
|||||||
ViewWeek=Vista semanal
|
ViewWeek=Vista semanal
|
||||||
ViewWithPredefinedFilters=Ver con los filtros predefinidos
|
ViewWithPredefinedFilters=Ver con los filtros predefinidos
|
||||||
AutoActions=Inclusión automática en la agenda
|
AutoActions=Inclusión automática en la agenda
|
||||||
AgendaAutoActionDesc=Definir los eventos aquí para los que desea que Dolibarr cree automáticamente una acción en el orden del día. Si no está marcada (por defecto), se podrán crear manualmente.
|
AgendaAutoActionDesc=Indique en esta pestaña los eventos para los que desea que Dolibarr cree automáticamente una acción en la agenda. Si no se marca ningún caso (por defecto), solamente las acciones manuales se incluirán en la agenda.
|
||||||
AgendaSetupOtherDesc=Esta página le permite configurar otros parámetros del módulo agenda.
|
AgendaSetupOtherDesc=Esta página le permite configurar algunas opciones que permiten exportar una vista de su agenda Dolibar a un calendario externo (thunderbird, google calendar, ...)
|
||||||
AgendaExtSitesDesc=Esta página le permite configurar calendarios externos para su visualización en la agenda de Dolibarr.
|
AgendaExtSitesDesc=Esta página le permite configurar calendarios externos para su visualización en la agenda de Dolibarr.
|
||||||
ActionsEvents=Eventos para que Dolibarr cree una acción de forma automática
|
ActionsEvents=Eventos para que Dolibarr cree una acción de forma automática
|
||||||
PropalValidatedInDolibarr=Presupuesto %s validado
|
PropalValidatedInDolibarr=Presupuesto %s validado
|
||||||
|
|||||||
@ -326,6 +326,7 @@ NoDolibarrAccess=Sin acceso de usuario
|
|||||||
ExportDataset_company_1=Terceros (empresas/instituciones) y atributos
|
ExportDataset_company_1=Terceros (empresas/instituciones) y atributos
|
||||||
ExportDataset_company_2=Contactos de terceros y atributos
|
ExportDataset_company_2=Contactos de terceros y atributos
|
||||||
ImportDataset_company_1=Terceros (empresas/instituciones) y atributos
|
ImportDataset_company_1=Terceros (empresas/instituciones) y atributos
|
||||||
|
ImportDataset_company_2=Contactos (terceros o libres) y atributos
|
||||||
PriceLevel=Nivel de precios
|
PriceLevel=Nivel de precios
|
||||||
DeliveriesAddress=Dirección(es) de envío
|
DeliveriesAddress=Dirección(es) de envío
|
||||||
DeliveryAddress=Dirección de envío
|
DeliveryAddress=Dirección de envío
|
||||||
|
|||||||
@ -65,6 +65,7 @@ ErrorPasswordsMustMatch=Las 2 contraseñas indicadas deben corresponderse
|
|||||||
ErrorContactEMail=Se ha producido un error técnico. Contacte con el administrador al e-mail <b>%s</b>, indicando el código de error <b>%s</b> en su mensaje, o puede también adjuntar una copia de pantalla de esta página.
|
ErrorContactEMail=Se ha producido un error técnico. Contacte con el administrador al e-mail <b>%s</b>, indicando el código de error <b>%s</b> en su mensaje, o puede también adjuntar una copia de pantalla de esta página.
|
||||||
ErrorWrongValueForField=Valor incorrecto para el campo número <b>%s</b> (el valor '<b>%s</b>' no cumple con la regla <b>%s</b>)
|
ErrorWrongValueForField=Valor incorrecto para el campo número <b>%s</b> (el valor '<b>%s</b>' no cumple con la regla <b>%s</b>)
|
||||||
ErrorFieldValueNotIn=Valor incorrecto para el campo número <b>%s</b> (el valor '<b>%s</b>' no es un valor en el campo <b>%s</b> de la tabla <b>%s</b>)
|
ErrorFieldValueNotIn=Valor incorrecto para el campo número <b>%s</b> (el valor '<b>%s</b>' no es un valor en el campo <b>%s</b> de la tabla <b>%s</b>)
|
||||||
|
ErrorFieldRefNotIn=Valor incorrecto para el campo número <b>%s</b> (el valor '<b>%s</b>' no es una referencia existente en <b>%s</b>)
|
||||||
ErrorsOnXLines=Errores en <b>%s</b> líneas fuente
|
ErrorsOnXLines=Errores en <b>%s</b> líneas fuente
|
||||||
ErrorFileIsInfectedWithAVirus=¡El antivirus no ha podido validar este archivo (es probable que esté infectado por un virus)!
|
ErrorFileIsInfectedWithAVirus=¡El antivirus no ha podido validar este archivo (es probable que esté infectado por un virus)!
|
||||||
ErrorSpecialCharNotAllowedForField=Los caracteres especiales no son admitidos por el campo "%s"
|
ErrorSpecialCharNotAllowedForField=Los caracteres especiales no son admitidos por el campo "%s"
|
||||||
|
|||||||
@ -1,110 +1,114 @@
|
|||||||
# Dolibarr language file - es_ES - exports
|
# Dolibarr language file - es_ES - exports
|
||||||
CHARSET= UTF-8
|
CHARSET=UTF-8
|
||||||
ExportsArea= Área exportación
|
ExportsArea=Área exportación
|
||||||
ImportArea= Área importación
|
ImportArea=Área importación
|
||||||
NewExport= Nueva exportación
|
NewExport=Nueva exportación
|
||||||
NewImport= Nueva importación
|
NewImport=Nueva importación
|
||||||
ExportableDatas= Conjunto de datos exportables
|
ExportableDatas=Conjunto de datos exportables
|
||||||
ImportableDatas= Conjunto de datos importables
|
ImportableDatas=Conjunto de datos importables
|
||||||
SelectExportDataSet= Elija un conjunto predefinido de datos que desee exportar...
|
SelectExportDataSet=Elija un conjunto predefinido de datos que desee exportar...
|
||||||
SelectImportDataSet= Seleccione un lote de datos predefinidos que desee importar...
|
SelectImportDataSet=Seleccione un lote de datos predefinidos que desee importar...
|
||||||
SelectExportFields= Elija los campos que deben exportarse, o elija un perfil de exportación predefinido
|
SelectExportFields=Elija los campos que deben exportarse, o elija un perfil de exportación predefinido
|
||||||
SelectImportFields= Seleccione los campos a importar, o seleccione un perfil predefinido de importación
|
SelectImportFields=Seleccione los campos a importar, o seleccione un perfil predefinido de importación
|
||||||
NotImportedFields= Campos del archivo origen no importados
|
NotImportedFields=Campos del archivo origen no importados
|
||||||
SaveExportModel= Guardar este perfil de exportación si desea reutilizarlo posteriormente...
|
SaveExportModel=Guardar este perfil de exportación si desea reutilizarlo posteriormente...
|
||||||
SaveImportModel= Guarde este perfil de importación si desea reutilizarlo de nuevo posteriormente...
|
SaveImportModel=Guarde este perfil de importación si desea reutilizarlo de nuevo posteriormente...
|
||||||
ExportModelName= Nombre del perfil de exportación
|
ExportModelName=Nombre del perfil de exportación
|
||||||
ExportModelSaved= Perfil de exportación guardado con el nombre de <b>%s</b>.
|
ExportModelSaved=Perfil de exportación guardado con el nombre de <b>%s</b>.
|
||||||
ExportableFields= Campos exportables
|
ExportableFields=Campos exportables
|
||||||
ExportedFields= Campos a exportar
|
ExportedFields=Campos a exportar
|
||||||
ImportModelName= Nombre del perfil de importación
|
ImportModelName=Nombre del perfil de importación
|
||||||
ImportModelSaved= Perfil de importación guardado bajo el nombre <b>%s</b>.
|
ImportModelSaved=Perfil de importación guardado bajo el nombre <b>%s</b>.
|
||||||
ImportableFields= Campos importables
|
ImportableFields=Campos importables
|
||||||
ImportedFields= Campos a importar
|
ImportedFields=Campos a importar
|
||||||
DatasetToExport= Conjunto de datos a exportar
|
DatasetToExport=Conjunto de datos a exportar
|
||||||
DatasetToImport= Lote de datos a importar
|
DatasetToImport=Lote de datos a importar
|
||||||
NoDiscardedFields= Sin campos del archivo origen rechazados
|
NoDiscardedFields=Sin campos del archivo origen rechazados
|
||||||
Dataset= Conjunto de datos
|
Dataset=Conjunto de datos
|
||||||
ChooseFieldsOrdersAndTitle= Elija el orden de los campos...
|
ChooseFieldsOrdersAndTitle=Elija el orden de los campos...
|
||||||
FieldsOrder= Orden de los campos
|
FieldsOrder=Orden de los campos
|
||||||
FieldsTitle= Título campos
|
FieldsTitle=Título campos
|
||||||
FieldOrder= Orden del campo
|
FieldOrder=Orden del campo
|
||||||
FieldTitle= Título campo
|
FieldTitle=Título campo
|
||||||
ChooseExportFormat= Elija el formato de exportación
|
ChooseExportFormat=Elija el formato de exportación
|
||||||
NowClickToGenerateToBuildExportFile= Ahora, seleccione el formato de exportación de la lista desplegable y haga clic en "Generar" para generar el archivo exportación...
|
NowClickToGenerateToBuildExportFile=Ahora, seleccione el formato de exportación de la lista desplegable y haga clic en "Generar" para generar el archivo exportación...
|
||||||
AvailableFormats= Formatos dispo.
|
AvailableFormats=Formatos dispo.
|
||||||
LibraryShort= Librería
|
LibraryShort=Librería
|
||||||
LibraryUsed= Librería utilizada
|
LibraryUsed=Librería utilizada
|
||||||
LibraryVersion= Versión
|
LibraryVersion=Versión
|
||||||
Step= Paso
|
Step=Paso
|
||||||
FormatedImport= Asistente de importación
|
FormatedImport=Asistente de importación
|
||||||
FormatedImportDesc1= Esta área permite realizar importaciones personalizadas de datos mediante un ayudante que evita tener conocimientos técnicos de Dolibarr.
|
FormatedImportDesc1=Esta área permite realizar importaciones personalizadas de datos mediante un ayudante que evita tener conocimientos técnicos de Dolibarr.
|
||||||
FormatedImportDesc2= El primer paso consiste en elegir el tipo de dato que debe importarse, luego el archivo y a continuación elegir los campos que desea importar.
|
FormatedImportDesc2=El primer paso consiste en elegir el tipo de dato que debe importarse, luego el archivo y a continuación elegir los campos que desea importar.
|
||||||
FormatedExport= Asistente de exportación
|
FormatedExport=Asistente de exportación
|
||||||
FormatedExportDesc1= Esta área permite realizar exportaciones personalizadas de los datos mediante un ayudante que evita tener conocimientos técnicos de Dolibarr.
|
FormatedExportDesc1=Esta área permite realizar exportaciones personalizadas de los datos mediante un ayudante que evita tener conocimientos técnicos de Dolibarr.
|
||||||
FormatedExportDesc2= El primer paso consiste en elegir uno de los conjuntos de datos predefinidos, a continuación elegir los campos que quiere exportar al archivo y en que orden.
|
FormatedExportDesc2=El primer paso consiste en elegir uno de los conjuntos de datos predefinidos, a continuación elegir los campos que quiere exportar al archivo y en que orden.
|
||||||
FormatedExportDesc3= Una vez seleccionados los datos, es posible elegir el formato del archivo de exportación generado.
|
FormatedExportDesc3=Una vez seleccionados los datos, es posible elegir el formato del archivo de exportación generado.
|
||||||
Sheet= Hoja
|
Sheet=Hoja
|
||||||
NoImportableData= Sin tablas de datos importables (ningún módulo con las definiciones de los perfiles de importación está activo)
|
NoImportableData=Sin tablas de datos importables (ningún módulo con las definiciones de los perfiles de importación está activo)
|
||||||
FileSuccessfullyBuilt= Archivo de exportación generado
|
FileSuccessfullyBuilt=Archivo de exportación generado
|
||||||
SQLUsedForExport= Consulta SQL utilizada para construir el archivo de exportación
|
SQLUsedForExport=Consulta SQL utilizada para construir el archivo de exportación
|
||||||
LineId= ID de línea
|
LineId=ID de línea
|
||||||
LineDescription= Descripción de línea
|
LineDescription=Descripción de línea
|
||||||
LineUnitPrice= Precio unitario de la línea
|
LineUnitPrice=Precio unitario de la línea
|
||||||
LineVATRate= Tipo de IVA de la línea
|
LineVATRate=Tipo de IVA de la línea
|
||||||
LineQty= Cantidad de la línea
|
LineQty=Cantidad de la línea
|
||||||
LineTotalHT= Importe sin IVA de la línea
|
LineTotalHT=Importe sin IVA de la línea
|
||||||
LineTotalTTC= Importe total de la línea
|
LineTotalTTC=Importe total de la línea
|
||||||
LineTotalVAT= Importe IVA de la línea
|
LineTotalVAT=Importe IVA de la línea
|
||||||
TypeOfLineServiceOrProduct= Tipo de línea (0=producto, 1=servicio)
|
TypeOfLineServiceOrProduct=Tipo de línea (0=producto, 1=servicio)
|
||||||
FileWithDataToImport= Archivo que contiene los datos a importar
|
FileWithDataToImport=Archivo que contiene los datos a importar
|
||||||
FileToImport= Archivo origen a importar
|
FileToImport=Archivo origen a importar
|
||||||
FileMustHaveOneOfFollowingFormat= El archivo de importación debe tener uno de los siguientes formatos
|
FileMustHaveOneOfFollowingFormat=El archivo de importación debe tener uno de los siguientes formatos
|
||||||
ChooseFormatOfFileToImport= Elija el formato de archivo que desea importar haciendo en el picto %s para seleccionarlo...
|
ChooseFormatOfFileToImport=Elija el formato de archivo que desea importar haciendo en el picto %s para seleccionarlo...
|
||||||
ChooseFileToImport= Elija el archivo de importación y haga clic en el picto %s para seleccionarlo como archivo origen de importación...
|
ChooseFileToImport=Elija el archivo de importación y haga clic en el picto %s para seleccionarlo como archivo origen de importación...
|
||||||
DownloadEmptyExample= Descargar archivo de ejemplo vacío
|
DownloadEmptyExample=Descargar archivo de ejemplo vacío
|
||||||
SourceFileFormat= Formato del archivo origen
|
SourceFileFormat=Formato del archivo origen
|
||||||
FieldsInSourceFile= Campos en el archivo origen
|
FieldsInSourceFile=Campos en el archivo origen
|
||||||
FieldsInTargetDatabase= Campos destino en la base de datos Dolibarr (*=obligatorio)
|
FieldsInTargetDatabase=Campos destino en la base de datos Dolibarr (*=obligatorio)
|
||||||
Field= Campo
|
Field=Campo
|
||||||
NoFields= Ningún campo
|
NoFields=Ningún campo
|
||||||
MoveField= Mover campo columna número %s
|
MoveField=Mover campo columna número %s
|
||||||
ExampleOfImportFile= Ejemplo_de_archivo_importación
|
ExampleOfImportFile=Ejemplo_de_archivo_importación
|
||||||
SaveImportProfile= Guardar este perfil de importación
|
SaveImportProfile=Guardar este perfil de importación
|
||||||
ErrorImportDuplicateProfil= No se puede guardar el perfil de importación bajo este nombre. Ya existe un perfil con ese nombre.
|
ErrorImportDuplicateProfil=No se puede guardar el perfil de importación bajo este nombre. Ya existe un perfil con ese nombre.
|
||||||
ImportSummary= Resumen de la configuración de importación
|
ImportSummary=Resumen de la configuración de importación
|
||||||
TablesTarget= Tablas de destino
|
TablesTarget=Tablas de destino
|
||||||
FieldsTarget= Campos de destino
|
FieldsTarget=Campos de destino
|
||||||
TableTarget= Tabla destino
|
TableTarget=Tabla destino
|
||||||
FieldTarget= Campo destino
|
FieldTarget=Campo destino
|
||||||
FieldSource= Campo origen
|
FieldSource=Campo origen
|
||||||
DoNotImportFirstLine= No importar la primera línea del archivo fuente
|
DoNotImportFirstLine=No importar la primera línea del archivo fuente
|
||||||
NbOfSourceLines= Número de líneas del archivo fuente
|
NbOfSourceLines=Número de líneas del archivo fuente
|
||||||
NowClickToTestTheImport= Compruebe los parámetros de importación establecidos. Si está de acuerdo, haga clic en el botón "<b>%s</b>" para ejecutar una simulación de importación (ningún dato será modificado, inicialmente sólo será una simulación)...
|
NowClickToTestTheImport=Compruebe los parámetros de importación establecidos. Si está de acuerdo, haga clic en el botón "<b>%s</b>" para ejecutar una simulación de importación (ningún dato será modificado, inicialmente sólo será una simulación)...
|
||||||
RunSimulateImportFile= Ejecutar la simulación de importación
|
RunSimulateImportFile=Ejecutar la simulación de importación
|
||||||
FieldNeedSource= Este campo requiere obligatoriamente una fuente de datos
|
FieldNeedSource=Este campo requiere obligatoriamente una fuente de datos
|
||||||
SomeMandatoryFieldHaveNoSource= Algunos campos obligatorios no tienen campo fuente en el archivo de origen
|
SomeMandatoryFieldHaveNoSource=Algunos campos obligatorios no tienen campo fuente en el archivo de origen
|
||||||
InformationOnSourceFile= Información del archivo origen
|
InformationOnSourceFile=Información del archivo origen
|
||||||
InformationOnTargetTables= Información sobre los campos de destino
|
InformationOnTargetTables=Información sobre los campos de destino
|
||||||
SelectAtLeastOneField= Bascular al menos un campo origen en la columna de campos a exportar
|
SelectAtLeastOneField=Bascular al menos un campo origen en la columna de campos a exportar
|
||||||
SelectFormat= Seleccione este formato de archivo de importación
|
SelectFormat=Seleccione este formato de archivo de importación
|
||||||
RunImportFile= Lanzar la importación
|
RunImportFile=Lanzar la importación
|
||||||
NowClickToRunTheImport= Compruebe los resultados de la simulación. Si todo está bien, inicie la importación definitiva.
|
NowClickToRunTheImport=Compruebe los resultados de la simulación. Si todo está bien, inicie la importación definitiva.
|
||||||
DataLoadedWithId= Todos los datos serán importados con la siguiente id de importación: <b>%s</b>
|
DataLoadedWithId=Todos los datos serán importados con la siguiente id de importación: <b>%s</b>
|
||||||
ErrorMissingMandatoryValue= Dato obligatorio no indicado en el archivo fuente, campo número <b>%s</b>.
|
ErrorMissingMandatoryValue=Dato obligatorio no indicado en el archivo fuente, campo número <b>%s</b>.
|
||||||
TooMuchErrors= Todavía hay <b>%s</b> líneas con error, pero su visualización ha sido limitada.
|
TooMuchErrors=Todavía hay <b>%s</b> líneas con error, pero su visualización ha sido limitada.
|
||||||
TooMuchWarnings= Todavía hay <b>%s</b> líneas con warnings, pero su visualización ha sido limitada.
|
TooMuchWarnings=Todavía hay <b>%s</b> líneas con warnings, pero su visualización ha sido limitada.
|
||||||
EmptyLine= Línea en blanco
|
EmptyLine=Línea en blanco
|
||||||
CorrectErrorBeforeRunningImport= Debe corregir todos los errores antes de iniciar la importación definitiva.
|
CorrectErrorBeforeRunningImport=Debe corregir todos los errores antes de iniciar la importación definitiva.
|
||||||
FileWasImported= El archivo se ha importado con el número de importación <b>%s</b>.
|
FileWasImported=El archivo se ha importado con el número de importación <b>%s</b>.
|
||||||
YouCanUseImportIdToFindRecord= Puede encontrar los registros de esta importación en su base de datos filtrando el campo <b>import_key='%s'</b>.
|
YouCanUseImportIdToFindRecord=Puede encontrar los registros de esta importación en su base de datos filtrando el campo <b>import_key='%s'</b>.
|
||||||
NbOfLinesOK= Número de líneas sin errores ni warnings: <b>%s</b>.
|
NbOfLinesOK=Número de líneas sin errores ni warnings: <b>%s</b>.
|
||||||
NbOfLinesImported= Número de líneas correctamente importadas: <b>%s</b>.
|
NbOfLinesImported=Número de líneas correctamente importadas: <b>%s</b>.
|
||||||
DataComeFromNoWhere= El valor a insertar no corresponde a ningún campo del archivo origen.
|
DataComeFromNoWhere=El valor a insertar no corresponde a ningún campo del archivo origen.
|
||||||
DataComeFromFileFieldNb= El valor a insertar se corresponde al campo número <b>%s</b> del archivo origen.
|
DataComeFromFileFieldNb=El valor a insertar se corresponde al campo número <b>%s</b> del archivo origen.
|
||||||
DataComeFromIdFoundFromRef= El valor dado por el campo <b>%s</b> del archivo origen será utilizado para encontrar el ID del objeto padre a usar (el objeto <b>%s</b> con la referencia del archivo origen debe existir en Dolibarr).
|
DataComeFromIdFoundFromRef=El valor dado por el campo <b>%s</b> del archivo origen será utilizado para encontrar el ID del objeto padre a usar (el objeto <b>%s</b> con la referencia del archivo origen debe existir en Dolibarr).
|
||||||
DataIsInsertedInto= Los datos del archivo de origen se insertarán en el siguiente campo:
|
DataComeFromIdFoundFromCodeId=El código del campo número <b>%s</b> del archivo de origen se utilizará para encontrar el id del objeto padre a usar (el código del archivo de origen debe existir en el diccionario <b>%s</b>). Tenga en cuenta que si conoce el id, puede usarlo en lugar del código en el archivo de origen. La importación funcionará en los 2 casos.
|
||||||
DataIDSourceIsInsertedInto= El ID del objeto padre encontrado a partir del dato origen, se insertará en el siguiente campo:
|
DataIsInsertedInto=Los datos del archivo de origen se insertarán en el siguiente campo:
|
||||||
SourceRequired= Datos de origen obligatorios
|
DataIDSourceIsInsertedInto=El ID del objeto padre encontrado a partir del dato origen, se insertará en el siguiente campo:
|
||||||
SourceExample= Ejemplo de datos de origen posibles
|
DataCodeIDSourceIsInsertedInto=El id de la línea padre encontrada a partir del código, se insertará en el siguiente campo:
|
||||||
CSVFormatDesc=Archivo con formato <b>Valores separados por coma</b> (.csv).<br>Es un fichero con formato de texto en el que los campos son separados por el carácter [ %s ]. Si el separador se encuentra en el contenido de un campo, El campo debe de estar acotado por el carácter [ %s ]. El carácter de escape para incluir un carácter de entorno en un dato es [ %s ].
|
SourceRequired=Datos de origen obligatorios
|
||||||
|
SourceExample=Ejemplo de datos de origen posibles
|
||||||
|
ExampleAnyRefFoundIntoElement=Todas las referencias encontradas para los elementos <b>%s</b>
|
||||||
|
ExampleAnyCodeOrIdFoundIntoDictionnary=Todos los códigos (o id) encontrados en el diccionario <b>%s</b>
|
||||||
|
CSVFormatDesc=Archivo con formato <b>Valores separados por coma</b> (.csv).<br>Es un fichero con formato de texto en el que los campos son separados por el carácter [ %s ]. Si el separador se encuentra en el contenido de un campo, El campo debe de estar acotado por el carácter [ %s ]. El carácter de escape para incluir un carácter de entorno en un dato es [ %s ].
|
||||||
|
|||||||
@ -103,7 +103,7 @@ NbOfLinesImported=Nombre de lignes importées avec succès: <b>%s</b>.
|
|||||||
DataComeFromNoWhere=La valeur à insérer n'est issue d'aucun champ du fichier source.
|
DataComeFromNoWhere=La valeur à insérer n'est issue d'aucun champ du fichier source.
|
||||||
DataComeFromFileFieldNb=La valeur à insérer sera issue du champ numéro <b>%s</b> du fichier source.
|
DataComeFromFileFieldNb=La valeur à insérer sera issue du champ numéro <b>%s</b> du fichier source.
|
||||||
DataComeFromIdFoundFromRef=La valeur issue du champ numéro <b>%s</b> du fichier source sera utilisée pour trouver l'id de l'objet père à utiliser (L'objet <b>%s</b> ayant la réf. issue du fichier source doit donc exister dans Dolibarr).
|
DataComeFromIdFoundFromRef=La valeur issue du champ numéro <b>%s</b> du fichier source sera utilisée pour trouver l'id de l'objet père à utiliser (L'objet <b>%s</b> ayant la réf. issue du fichier source doit donc exister dans Dolibarr).
|
||||||
DataComeFromIdFoundFromCodeId=Le code issu du champ numéro <b>%s</b> du fichier source sera utilisée pour trouver l'id de l'objet père à utiliser (Le code issue du fichier source doit donc exister dans le dictionnaire <b>%s</b>). Noton que si vous connaissez cet id, vou spouvez l'utiliser dans le fichier source au lieu du code. L'import fonctionnera dans les 2 cas.
|
DataComeFromIdFoundFromCodeId=Le code issu du champ numéro <b>%s</b> du fichier source sera utilisée pour trouver l'id de l'objet père à utiliser (Le code issue du fichier source doit donc exister dans le dictionnaire <b>%s</b>). Noton que si vous connaissez cet id, vous pouvez l'utiliser dans le fichier source au lieu du code. L'import fonctionnera dans les 2 cas.
|
||||||
DataIsInsertedInto=La donnée issue du fichier source sera insérée dans le champ suivant:
|
DataIsInsertedInto=La donnée issue du fichier source sera insérée dans le champ suivant:
|
||||||
DataIDSourceIsInsertedInto=L'id de l'objet père retrouvé à partir de la donnée source, sera insérée dans le champ suivant:
|
DataIDSourceIsInsertedInto=L'id de l'objet père retrouvé à partir de la donnée source, sera insérée dans le champ suivant:
|
||||||
DataCodeIDSourceIsInsertedInto=L'id de la ligne père retrouvé à partir du code, sera insérée dans le champ suivant:
|
DataCodeIDSourceIsInsertedInto=L'id de la ligne père retrouvé à partir du code, sera insérée dans le champ suivant:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user