mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
according to new tree directory
This commit is contained in:
parent
8a9fe373d6
commit
a981577553
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
require("../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
|
||||
$langs->load("users");
|
||||
$langs->load("admin");
|
||||
|
|
|
|||
|
|
@ -850,7 +850,7 @@ else
|
|||
print_titre($langs->trans("TestMailing"));
|
||||
|
||||
// Create l'objet formulaire mail
|
||||
include_once("../../html.formmail.class.php");
|
||||
include_once("../../core/class/html.formmail.class.php");
|
||||
$formmail = new FormMail($db);
|
||||
$formmail->fromname = $mil->email_from;
|
||||
$formmail->frommail = $mil->email_from;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ require("../main.inc.php");
|
|||
require_once(DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php');
|
||||
require_once(DOL_DOCUMENT_ROOT."/includes/modules/propale/modules_propale.php");
|
||||
require_once(DOL_DOCUMENT_ROOT.'/comm/action/actioncomm.class.php');
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/propal.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php");
|
||||
if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/projet/class/project.class.php');
|
||||
|
|
|
|||
|
|
@ -787,7 +787,7 @@ if ($_POST['addfile'])
|
|||
{
|
||||
$mesg = '<div class="ok">'.$langs->trans("FileTransferComplete").'</div>';
|
||||
|
||||
include_once(DOL_DOCUMENT_ROOT.'/html.formmail.class.php');
|
||||
include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php');
|
||||
$formmail = new FormMail($db);
|
||||
// Add file in list of files in session
|
||||
$formmail->add_attached_files($upload_dir . "/" . $_FILES['addedfile']['name'],$_FILES['addedfile']['name'],$_FILES['addedfile']['type']);
|
||||
|
|
@ -842,7 +842,7 @@ if (! empty($_POST['removedfile']))
|
|||
$message = '<div class="ok">'.$langs->trans("FileWasRemoved",$filetodelete).'</div>';
|
||||
//print_r($_FILES);
|
||||
|
||||
include_once(DOL_DOCUMENT_ROOT.'/html.formmail.class.php');
|
||||
include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php');
|
||||
$formmail = new FormMail($db);
|
||||
$formmail->remove_attached_files($keytodelete);
|
||||
}
|
||||
|
|
@ -915,7 +915,7 @@ if ($_POST['action'] == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile']
|
|||
}
|
||||
|
||||
// Create form object
|
||||
include_once('../html.formmail.class.php');
|
||||
include_once('../core/class/html.formmail.class.php');
|
||||
$formmail = new FormMail($db);
|
||||
|
||||
$attachedfiles=$formmail->get_attached_files();
|
||||
|
|
@ -2280,7 +2280,7 @@ else
|
|||
print_titre($langs->trans('SendOrderByMail'));
|
||||
|
||||
// Cree l'objet formulaire mail
|
||||
include_once(DOL_DOCUMENT_ROOT.'/html.formmail.class.php');
|
||||
include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php');
|
||||
$formmail = new FormMail($db);
|
||||
$formmail->fromtype = 'user';
|
||||
$formmail->fromid = $user->id;
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
*/
|
||||
|
||||
require("../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT ."/core/class/notify.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT ."/commande/class/commande.class.php");
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
|
||||
require("../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT ."/commande/class/commande.class.php");
|
||||
|
||||
$langs->load('orders');
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
*/
|
||||
|
||||
require("../../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/order.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/sendings.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT ."/commande/class/commande.class.php");
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
*/
|
||||
|
||||
require("../../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
|
||||
|
||||
$langs->load('companies');
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
require("../../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/compta/deplacement/class/deplacement.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
if ($conf->projet->enabled)
|
||||
{
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/project.lib.php");
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
require("../../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/includes/modules/dons/modules_don.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/compta/dons/class/don.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/compta/paiement/class/paiement.class.php");
|
||||
if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/lib/project.lib.php');
|
||||
|
|
|
|||
|
|
@ -1105,7 +1105,7 @@ if ($_POST['addfile'])
|
|||
{
|
||||
$mesg = '<div class="ok">'.$langs->trans("FileTransferComplete").'</div>';
|
||||
|
||||
include_once(DOL_DOCUMENT_ROOT.'/html.formmail.class.php');
|
||||
include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php');
|
||||
$formmail = new FormMail($db);
|
||||
$formmail->add_attached_files($upload_dir . "/" . $_FILES['addedfile']['name'],$_FILES['addedfile']['name'],$_FILES['addedfile']['type']);
|
||||
}
|
||||
|
|
@ -1159,7 +1159,7 @@ if (! empty($_POST['removedfile']))
|
|||
$message = '<div class="ok">'.$langs->trans("FileWasRemoved",$filetodelete).'</div>';
|
||||
//print_r($_FILES);
|
||||
|
||||
include_once(DOL_DOCUMENT_ROOT.'/html.formmail.class.php');
|
||||
include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php');
|
||||
$formmail = new FormMail($db);
|
||||
$formmail->remove_attached_files($keytodelete);
|
||||
}
|
||||
|
|
@ -1245,7 +1245,7 @@ if (($_POST['action'] == 'send' || $_POST['action'] == 'relance') && ! $_POST['a
|
|||
}
|
||||
|
||||
// Create form object
|
||||
include_once('../html.formmail.class.php');
|
||||
include_once('../core/class/html.formmail.class.php');
|
||||
$formmail = new FormMail($db);
|
||||
|
||||
$attachedfiles=$formmail->get_attached_files();
|
||||
|
|
@ -3441,7 +3441,7 @@ else
|
|||
print_titre($langs->trans($titre));
|
||||
|
||||
// Cree l'objet formulaire mail
|
||||
include_once(DOL_DOCUMENT_ROOT.'/html.formmail.class.php');
|
||||
include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php');
|
||||
$formmail = new FormMail($db);
|
||||
$formmail->fromtype = 'user';
|
||||
$formmail->fromid = $user->id;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
|
|||
require_once(DOL_DOCUMENT_ROOT.'/core/class/discount.class.php');
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/invoice.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
|
||||
$langs->load('propal');
|
||||
$langs->load('compta');
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
*/
|
||||
|
||||
require("../../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/compta/paiement/class/paiement.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
*/
|
||||
|
||||
require('../main.inc.php');
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php');
|
||||
require_once(DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php');
|
||||
if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php');
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
*/
|
||||
|
||||
require("./pre.inc.php"); // We use pre.inc.php to have a dynamic menu
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php');
|
||||
require_once(DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/remisecheque.class.php');
|
||||
require_once(DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php');
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
*/
|
||||
|
||||
require('../main.inc.php');
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/comm/propal/class/propal.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/propal.lib.php");
|
||||
if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/projet/class/project.class.php');
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ require ("../main.inc.php");
|
|||
require_once(DOL_DOCUMENT_ROOT."/lib/contract.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
|
||||
$langs->load("other");
|
||||
$langs->load("products");
|
||||
|
|
|
|||
530
htdocs/core/class/html.formfile.class.php
Normal file
530
htdocs/core/class/html.formfile.class.php
Normal file
|
|
@ -0,0 +1,530 @@
|
|||
<?php
|
||||
/* Copyright (c) 2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/html.formfile.class.php
|
||||
* \brief Fichier de la classe des fonctions predefinie de composants html fichiers
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \class FormFile
|
||||
* \brief Classe permettant la generation de composants html fichiers
|
||||
*/
|
||||
class FormFile
|
||||
{
|
||||
var $db;
|
||||
var $error;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Constructeur
|
||||
* \param DB handler d'acces base de donnee
|
||||
*/
|
||||
function FormFile($DB)
|
||||
{
|
||||
$this->db = $DB;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Show file add form
|
||||
* \param url Url
|
||||
* \param title Title zone
|
||||
* \param addcancel 1=Add 'Cancel' button
|
||||
* \param sectionid If upload must be done inside a particular ECM section
|
||||
* \param perm Value of permission to allow upload
|
||||
* \return int <0 si ko, >0 si ok
|
||||
*/
|
||||
function form_attach_new_file($url,$title='',$addcancel=0, $sectionid=0, $perm=1)
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
print "\n\n<!-- Start form attach new file -->\n";
|
||||
|
||||
if (! $title) $title=$langs->trans("AttachANewFile");
|
||||
print_titre($title);
|
||||
|
||||
print '<form name="userfile" action="'.$url.'" enctype="multipart/form-data" method="POST">';
|
||||
print '<input type="hidden" name="section" value="'.$sectionid.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
||||
print '<table width="100%" class="nobordernopadding">';
|
||||
print '<tr><td width="50%" valign="top">';
|
||||
|
||||
$max=$conf->global->MAIN_UPLOAD_DOC; // En Kb
|
||||
$maxphp=@ini_get('upload_max_filesize'); // En inconnu
|
||||
if (preg_match('/m$/i',$maxphp)) $maxphp=$maxphp*1024;
|
||||
if (preg_match('/k$/i',$maxphp)) $maxphp=$maxphp;
|
||||
// Now $max and $maxphp are in Kb
|
||||
if ($maxphp > 0) $max=min($max,$maxphp);
|
||||
|
||||
if ($max > 0)
|
||||
{
|
||||
print '<input type="hidden" name="max_file_size" value="'.($max*1024).'">';
|
||||
}
|
||||
print '<input class="flat" type="file" name="userfile" size="70"';
|
||||
print (empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled="true"':'');
|
||||
print '>';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="sendit" value="'.$langs->trans("Upload").'"';
|
||||
print (empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled="true"':'');
|
||||
print '>';
|
||||
|
||||
if ($addcancel)
|
||||
{
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
}
|
||||
|
||||
if (! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
{
|
||||
if ($perm)
|
||||
{
|
||||
print ' ('.$langs->trans("MaxSize").': '.$max.' '.$langs->trans("Kb");
|
||||
print ' '.info_admin($langs->trans("ThisLimitIsDefinedInSetup",$max,$maxphp),1);
|
||||
print ')';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print ' ('.$langs->trans("UploadDisabled").')';
|
||||
}
|
||||
print "</td></tr>";
|
||||
print "</table>";
|
||||
|
||||
print '</form>';
|
||||
if (empty($sectionid)) print '<br>';
|
||||
|
||||
print "\n<!-- End form attach new file -->\n\n";
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Show the box with list of available documents for object
|
||||
* \param modulepart propal=propal, facture=facture, ...
|
||||
* \param filename Sub dir to scan (Example: '9/9', 'FA9999'). Use '' if filedir already complete)
|
||||
* \param filedir Dir to scan
|
||||
* \param urlsource Url of origin page (for return)
|
||||
* \param genallowed Generation is allowed (1/0 or array of formats)
|
||||
* \param delallowed Remove is allowed (1/0)
|
||||
* \param modelselected Model to preselect by default
|
||||
* \param allowgenifempty Show warning if no model activated
|
||||
* \param forcenomultilang Do not show language option (even if MAIN_MULTILANGS defined)
|
||||
* \param iconPDF Show only PDF icon with link (1/0)
|
||||
* \param maxfilenamelength Max length for filename shown
|
||||
* \param noform Do not output html form tags
|
||||
* \param param More param on http links
|
||||
* \param title Title to show on top of form
|
||||
* \param buttonlabel Label on submit button
|
||||
* \param codelang Default language code to use on lang combo box if multilang is enabled
|
||||
* \return int <0 if KO, number of shown files if OK
|
||||
*/
|
||||
function show_documents($modulepart,$filename,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$maxfilenamelength=28,$noform=0,$param='',$title='',$buttonlabel='',$codelang='')
|
||||
{
|
||||
// filedir = conf->...dir_ouput."/".get_exdir(id)
|
||||
include_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php');
|
||||
|
||||
global $langs,$bc,$conf;
|
||||
$var=true;
|
||||
|
||||
if ($iconPDF == 1)
|
||||
{
|
||||
$genallowed = '';
|
||||
$delallowed = 0;
|
||||
$modelselected = '';
|
||||
$forcenomultilang=0;
|
||||
}
|
||||
|
||||
$filename = dol_sanitizeFileName($filename);
|
||||
$headershown=0;
|
||||
$showempty=0;
|
||||
$i=0;
|
||||
|
||||
print "\n".'<!-- Start show_document -->'."\n";
|
||||
//print 'filedir='.$filedir;
|
||||
|
||||
// Affiche en-tete tableau
|
||||
if ($genallowed)
|
||||
{
|
||||
$modellist=array();
|
||||
if ($modulepart == 'company')
|
||||
{
|
||||
$showempty=1;
|
||||
if (is_array($genallowed)) $modellist=$genallowed;
|
||||
else
|
||||
{
|
||||
include_once(DOL_DOCUMENT_ROOT.'/includes/modules/societe/modules_societe.class.php');
|
||||
$model=new ModeleThirdPartyDoc();
|
||||
$modellist=$model->liste_modeles($this->db);
|
||||
}
|
||||
}
|
||||
else if ($modulepart == 'propal')
|
||||
{
|
||||
if (is_array($genallowed)) $modellist=$genallowed;
|
||||
else
|
||||
{
|
||||
include_once(DOL_DOCUMENT_ROOT.'/includes/modules/propale/modules_propale.php');
|
||||
$model=new ModelePDFPropales();
|
||||
$modellist=$model->liste_modeles($this->db);
|
||||
}
|
||||
}
|
||||
else if ($modulepart == 'commande')
|
||||
{
|
||||
if (is_array($genallowed)) $modellist=$genallowed;
|
||||
else
|
||||
{
|
||||
include_once(DOL_DOCUMENT_ROOT.'/includes/modules/commande/modules_commande.php');
|
||||
$model=new ModelePDFCommandes();
|
||||
$modellist=$model->liste_modeles($this->db);
|
||||
}
|
||||
}
|
||||
elseif ($modulepart == 'expedition')
|
||||
{
|
||||
if (is_array($genallowed)) $modellist=$genallowed;
|
||||
else
|
||||
{
|
||||
include_once(DOL_DOCUMENT_ROOT.'/includes/modules/expedition/pdf/ModelePdfExpedition.class.php');
|
||||
$model=new ModelePDFExpedition();
|
||||
$modellist=$model->liste_modeles($this->db);
|
||||
}
|
||||
}
|
||||
elseif ($modulepart == 'livraison')
|
||||
{
|
||||
if (is_array($genallowed)) $modellist=$genallowed;
|
||||
else
|
||||
{
|
||||
include_once(DOL_DOCUMENT_ROOT.'/includes/modules/livraison/modules_livraison.php');
|
||||
$model=new ModelePDFDeliveryOrder();
|
||||
$modellist=$model->liste_modeles($this->db);
|
||||
}
|
||||
}
|
||||
else if ($modulepart == 'ficheinter')
|
||||
{
|
||||
if (is_array($genallowed)) $modellist=$genallowed;
|
||||
else
|
||||
{
|
||||
include_once(DOL_DOCUMENT_ROOT.'/includes/modules/fichinter/modules_fichinter.php');
|
||||
$model=new ModelePDFFicheinter();
|
||||
$modellist=$model->liste_modeles($this->db);
|
||||
}
|
||||
}
|
||||
elseif ($modulepart == 'facture')
|
||||
{
|
||||
if (is_array($genallowed)) $modellist=$genallowed;
|
||||
else
|
||||
{
|
||||
include_once(DOL_DOCUMENT_ROOT.'/includes/modules/facture/modules_facture.php');
|
||||
$model=new ModelePDFFactures();
|
||||
$modellist=$model->liste_modeles($this->db);
|
||||
}
|
||||
}
|
||||
elseif ($modulepart == 'project')
|
||||
{
|
||||
if (is_array($genallowed)) $modellist=$genallowed;
|
||||
else
|
||||
{
|
||||
include_once(DOL_DOCUMENT_ROOT.'/includes/modules/project/modules_project.php');
|
||||
$model=new ModelePDFProjects();
|
||||
$modellist=$model->liste_modeles($this->db);
|
||||
}
|
||||
}
|
||||
elseif ($modulepart == 'export')
|
||||
{
|
||||
if (is_array($genallowed)) $modellist=$genallowed;
|
||||
else
|
||||
{
|
||||
include_once(DOL_DOCUMENT_ROOT.'/includes/modules/export/modules_export.php');
|
||||
$model=new ModeleExports();
|
||||
$modellist=$model->liste_modeles($this->db);
|
||||
}
|
||||
}
|
||||
else if ($modulepart == 'commande_fournisseur')
|
||||
{
|
||||
if (is_array($genallowed)) $modellist=$genallowed;
|
||||
else
|
||||
{
|
||||
include_once(DOL_DOCUMENT_ROOT.'/includes/modules/supplier_order/modules_commandefournisseur.php');
|
||||
$model=new ModelePDFSuppliersOrders();
|
||||
$modellist=$model->liste_modeles($this->db);
|
||||
}
|
||||
}
|
||||
else if ($modulepart == 'facture_fournisseur')
|
||||
{
|
||||
if (is_array($genallowed)) $modellist=$genallowed;
|
||||
else
|
||||
{
|
||||
include_once(DOL_DOCUMENT_ROOT.'/fourn/facture/modules/modules_facturefournisseur.php');
|
||||
$model=new ModelePDFFacturesSuppliers();
|
||||
$modellist=$model->liste_modeles($this->db);
|
||||
}
|
||||
}
|
||||
else if ($modulepart == 'remisecheque')
|
||||
{
|
||||
if (is_array($genallowed)) $modellist=$genallowed;
|
||||
else
|
||||
{
|
||||
// ??
|
||||
}
|
||||
}
|
||||
elseif ($modulepart == 'donation')
|
||||
{
|
||||
if (is_array($genallowed)) $modellist=$genallowed;
|
||||
else
|
||||
{
|
||||
include_once(DOL_DOCUMENT_ROOT.'/includes/modules/dons/modules_don.php');
|
||||
$model=new ModeleDon();
|
||||
$modellist=$model->liste_modeles($this->db);
|
||||
}
|
||||
}
|
||||
else if ($modulepart == 'unpaid')
|
||||
{
|
||||
$modellist='';
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($this->db,'Bad value for modulepart');
|
||||
return -1;
|
||||
}
|
||||
|
||||
$headershown=1;
|
||||
|
||||
$html = new Form($db);
|
||||
$buttonlabeltoshow=$buttonlabel;
|
||||
if (empty($buttonlabel)) $buttonlabel=$langs->trans('Generate');
|
||||
|
||||
if (empty($noform)) print '<form action="'.$urlsource.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc').'" method="post">';
|
||||
print '<input type="hidden" name="action" value="builddoc">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
||||
print_titre($langs->trans("Documents"));
|
||||
print '<table class="border" summary="listofdocumentstable" width="100%">';
|
||||
|
||||
print '<tr '.$bc[$var].'>';
|
||||
|
||||
// Model
|
||||
if (! empty($modellist))
|
||||
{
|
||||
print '<td align="center">';
|
||||
print $langs->trans('Model').' ';
|
||||
print $html->selectarray('model',$modellist,$modelselected,$showempty,0,0);
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="left">';
|
||||
print $langs->trans("Files");
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Language code (if multilang)
|
||||
print '<td align="center">';
|
||||
if (($allowgenifempty || (is_array($modellist) && sizeof($modellist) > 0)) && $conf->global->MAIN_MULTILANGS && ! $forcenomultilang)
|
||||
{
|
||||
include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php');
|
||||
$formadmin=new FormAdmin($this->db);
|
||||
$defaultlang=$codelang?$codelang:$langs->getDefaultLang();
|
||||
$formadmin->select_lang($defaultlang);
|
||||
}
|
||||
else
|
||||
{
|
||||
print ' ';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Button
|
||||
print '<td align="center" colspan="'.($delallowed?'2':'1').'">';
|
||||
print '<input class="button" ';
|
||||
//print ((is_array($modellist) && sizeof($modellist))?'':' disabled="true"') // Always allow button "Generate" (even if no model activated)
|
||||
print ' type="submit" value="'.$buttonlabel.'"';
|
||||
if (! $allowgenifempty && ! is_array($modellist) && empty($modellist)) print ' disabled="true"';
|
||||
print '>';
|
||||
if ($allowgenifempty && ! is_array($modellist) && empty($modellist))
|
||||
{
|
||||
$langs->load("errors");
|
||||
print ' '.img_warning($langs->trans("WarningNoDocumentModelActivated"));
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Get list of files
|
||||
$png = '';
|
||||
$filter = '';
|
||||
if ($iconPDF==1)
|
||||
{
|
||||
$png = '\.png$';
|
||||
$filter = $filename.'.pdf';
|
||||
}
|
||||
$file_list=dol_dir_list($filedir,'files',0,$filter,'\.meta$'.($png?'|'.$png:''),'date',SORT_DESC);
|
||||
|
||||
// Affiche en-tete tableau si non deja affiche
|
||||
if (sizeof($file_list) && ! $headershown && !$iconPDF)
|
||||
{
|
||||
$headershown=1;
|
||||
$titletoshow=$langs->trans("Documents");
|
||||
if (! empty($title)) $titletoshow=$title;
|
||||
print_titre($titletoshow);
|
||||
print '<table class="border" summary="listofdocumentstable" width="100%">';
|
||||
}
|
||||
|
||||
// Loop on each file found
|
||||
foreach($file_list as $i => $file)
|
||||
{
|
||||
$var=!$var;
|
||||
|
||||
// Define relative path for download link (depends on module)
|
||||
$relativepath=$file["name"]; // Cas general
|
||||
if ($filename) $relativepath=$filename."/".$file["name"]; // Cas propal, facture...
|
||||
// Autre cas
|
||||
if ($modulepart == 'donation') { $relativepath = get_exdir($filename,2).$file["name"]; }
|
||||
if ($modulepart == 'export') { $relativepath = $file["name"]; }
|
||||
|
||||
if (!$iconPDF) print "<tr ".$bc[$var].">";
|
||||
|
||||
// Show file name with link to download
|
||||
if (!$iconPDF) print '<td nowrap="nowrap">';
|
||||
print '<a href="'.DOL_URL_ROOT . '/document.php?modulepart='.$modulepart.'&file='.urlencode($relativepath).'">';
|
||||
if (!$iconPDF)
|
||||
{
|
||||
print img_mime($file["name"],$langs->trans("File").': '.$file["name"]).' '.dol_trunc($file["name"],$maxfilenamelength);
|
||||
}
|
||||
else
|
||||
{
|
||||
print img_pdf($file["name"],2);
|
||||
}
|
||||
print '</a>';
|
||||
if (!$iconPDF) print '</td>';
|
||||
// Affiche taille fichier
|
||||
if (!$iconPDF) print '<td align="right" nowrap="nowrap">'.dol_print_size(dol_filesize($filedir."/".$file["name"])).'</td>';
|
||||
// Affiche date fichier
|
||||
if (!$iconPDF) print '<td align="right" nowrap="nowrap">'.dol_print_date(dol_filemtime($filedir."/".$file["name"]),'dayhour').'</td>';
|
||||
|
||||
if ($delallowed)
|
||||
{
|
||||
print '<td align="right"><a href="'.DOL_URL_ROOT.'/document.php?action=remove_file&modulepart='.$modulepart.'&file='.urlencode($relativepath);
|
||||
print ($param?'&'.$param:'');
|
||||
print '&urlsource='.urlencode($urlsource);
|
||||
print '">'.img_delete().'</a></td>';
|
||||
}
|
||||
|
||||
if (!$iconPDF) print '</tr>';
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
if ($headershown)
|
||||
{
|
||||
// Affiche pied du tableau
|
||||
print "</table>\n";
|
||||
if ($genallowed)
|
||||
{
|
||||
if (empty($noform)) print '</form>'."\n";
|
||||
}
|
||||
}
|
||||
print '<!-- End show_document -->'."\n";
|
||||
return ($i?$i:$headershown);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Show list of documents in a directory
|
||||
* \param filearray Array of files loaded by dol_dir_list function
|
||||
* \param object Object on which document is linked to
|
||||
* \param modulepart Value for modulepart used by download wrapper
|
||||
* \param param Parameters on sort links
|
||||
* \param forcedownload Force to open dialog box "Save As" when clicking on file
|
||||
* \param relativepath Relative path of docs (autodefined if not provided)
|
||||
* \param permtodelete Permission to delete
|
||||
* \param useinecm Change output for use in ecm module
|
||||
* \param textifempty Text to show if filearray is empty
|
||||
* \return int <0 if KO, nb of files shown if OK
|
||||
*/
|
||||
function list_of_documents($filearray,$object,$modulepart,$param,$forcedownload=0,$relativepath='',$permtodelete=1,$useinecm=0,$textifempty='',$maxlength=0)
|
||||
{
|
||||
global $user, $conf, $langs;
|
||||
global $bc;
|
||||
global $sortfield, $sortorder;
|
||||
|
||||
// Affiche liste des documents existant
|
||||
if (empty($useinecm)) print_titre($langs->trans("AttachedFiles"));
|
||||
else { $bc[true]=''; $bc[false]=''; };
|
||||
$url=$_SERVER["PHP_SELF"];
|
||||
print '<table width="100%" class="nobordernopadding">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Documents2"),$_SERVER["PHP_SELF"],"name","",$param,'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Size"),$_SERVER["PHP_SELF"],"size","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"date","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('','','');
|
||||
print '</tr>';
|
||||
|
||||
$var=true;
|
||||
foreach($filearray as $key => $file)
|
||||
{
|
||||
if (!is_dir($dir.$file['name'])
|
||||
&& $file['name'] != '.'
|
||||
&& $file['name'] != '..'
|
||||
&& $file['name'] != 'CVS'
|
||||
&& ! preg_match('/\.meta$/i',$file['name']))
|
||||
{
|
||||
// Define relative path used to store the file
|
||||
if (! $relativepath) $relativepath=dol_sanitizeFileName($object->ref).'/';
|
||||
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]><td>";
|
||||
//print "XX".$file['name']; //$file['name'] must be utf8
|
||||
print '<a href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart;
|
||||
if ($forcedownload) print '&attachment=1';
|
||||
print '&file='.urlencode($relativepath.$file['name']).'">';
|
||||
print img_mime($file['name'],$file['name'].' ('.dol_print_size($file['size'],0,0).')').' ';
|
||||
print dol_trunc($file['name'],$maxlength,'middle');
|
||||
print '</a>';
|
||||
print "</td>\n";
|
||||
print '<td align="right">'.dol_print_size($file['size'],1,1).'</td>';
|
||||
print '<td align="center">'.dol_print_date($file['date'],"dayhour").'</td>';
|
||||
print '<td align="right">';
|
||||
//print ' ';
|
||||
if ($permtodelete)
|
||||
print '<a href="'.$url.'?id='.$object->id.'§ion='.$_REQUEST["section"].'&action=delete&urlfile='.urlencode($file['name']).'">'.img_delete().'</a>';
|
||||
else
|
||||
print ' ';
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
}
|
||||
if (sizeof($filearray) == 0)
|
||||
{
|
||||
print '<tr '.$bc[$var].'><td colspan="4">';
|
||||
if (empty($textifempty)) print $langs->trans("NoFileFound");
|
||||
else print $textifempty;
|
||||
print '</td></tr>';
|
||||
}
|
||||
print "</table>";
|
||||
// Fin de zone
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
577
htdocs/core/class/html.formmail.class.php
Normal file
577
htdocs/core/class/html.formmail.class.php
Normal file
|
|
@ -0,0 +1,577 @@
|
|||
<?PHP
|
||||
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/html.formmail.class.php
|
||||
* \brief Fichier de la classe permettant la generation du formulaire html d'envoi de mail unitaire
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
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
|
||||
* \remarks Utilisation: $formail = new FormMail($db)
|
||||
* \remarks $formmail->proprietes=1 ou chaine ou tableau de valeurs
|
||||
* \remarks $formmail->show_form() affiche le formulaire
|
||||
*/
|
||||
class FormMail
|
||||
{
|
||||
var $db;
|
||||
|
||||
var $fromname;
|
||||
var $frommail;
|
||||
var $replytoname;
|
||||
var $replytomail;
|
||||
var $toname;
|
||||
var $tomail;
|
||||
|
||||
var $withsubstit; // Show substitution array
|
||||
var $withfrom;
|
||||
var $withto;
|
||||
var $withtocc;
|
||||
var $withtopic;
|
||||
var $withfile; // 0=No attaches files, 1=Show attached files, 2=Can add new attached files
|
||||
var $withbody;
|
||||
|
||||
var $withfromreadonly;
|
||||
var $withreplytoreadonly;
|
||||
var $withtoreadonly;
|
||||
var $withtoccreadonly;
|
||||
var $withtopicreadonly;
|
||||
var $withdeliveryreceipt;
|
||||
var $withcancel;
|
||||
|
||||
var $substit=array();
|
||||
var $param=array();
|
||||
|
||||
var $error;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Constructeur
|
||||
* \param DB handler d'acces base de donnee
|
||||
*/
|
||||
function FormMail($DB)
|
||||
{
|
||||
$this->db = $DB;
|
||||
|
||||
$this->withfrom=1;
|
||||
$this->withto=1;
|
||||
$this->withtocc=1;
|
||||
$this->withtoccc=0;
|
||||
$this->witherrorsto=0;
|
||||
$this->withtopic=1;
|
||||
$this->withfile=0;
|
||||
$this->withbody=1;
|
||||
|
||||
$this->withfromreadonly=1;
|
||||
$this->withreplytoreadonly=1;
|
||||
$this->withtoreadonly=0;
|
||||
$this->withtoccreadonly=0;
|
||||
$this->witherrorstoreadonly=0;
|
||||
$this->withtopicreadonly=0;
|
||||
$this->withbodyreadonly=0;
|
||||
$this->withdeliveryreceiptreadonly=0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear list of attached files in send mail form (stored in session)
|
||||
*/
|
||||
function clear_attached_files()
|
||||
{
|
||||
global $conf,$user;
|
||||
|
||||
// Set tmp user directory
|
||||
$vardir=$conf->user->dir_output."/".$user->id;
|
||||
$upload_dir = $vardir.'/temp/';
|
||||
if (is_dir($upload_dir)) dol_delete_dir_recursive($upload_dir);
|
||||
|
||||
unset($_SESSION["listofpaths"]);
|
||||
unset($_SESSION["listofnames"]);
|
||||
unset($_SESSION["listofmimes"]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a file into the list of attached files (stored in SECTION array)
|
||||
*
|
||||
* @param unknown_type $path
|
||||
* @param unknown_type $file
|
||||
* @param unknown_type $type
|
||||
*/
|
||||
function add_attached_files($path,$file,$type)
|
||||
{
|
||||
$listofpaths=array();
|
||||
$listofnames=array();
|
||||
$listofmimes=array();
|
||||
if (! empty($_SESSION["listofpaths"])) $listofpaths=explode(';',$_SESSION["listofpaths"]);
|
||||
if (! empty($_SESSION["listofnames"])) $listofnames=explode(';',$_SESSION["listofnames"]);
|
||||
if (! empty($_SESSION["listofmimes"])) $listofmimes=explode(';',$_SESSION["listofmimes"]);
|
||||
if (! in_array($file,$listofnames))
|
||||
{
|
||||
$listofpaths[]=$path;
|
||||
$listofnames[]=$file;
|
||||
$listofmimes[]=$type;
|
||||
$_SESSION["listofpaths"]=join(';',$listofpaths);
|
||||
$_SESSION["listofnames"]=join(';',$listofnames);
|
||||
$_SESSION["listofmimes"]=join(';',$listofmimes);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a file from the list of attached files (stored in SECTION array)
|
||||
*
|
||||
* @param unknown_type $file
|
||||
*/
|
||||
function remove_attached_files($keytodelete)
|
||||
{
|
||||
$listofpaths=array();
|
||||
$listofnames=array();
|
||||
$listofmimes=array();
|
||||
if (! empty($_SESSION["listofpaths"])) $listofpaths=explode(';',$_SESSION["listofpaths"]);
|
||||
if (! empty($_SESSION["listofnames"])) $listofnames=explode(';',$_SESSION["listofnames"]);
|
||||
if (! empty($_SESSION["listofmimes"])) $listofmimes=explode(';',$_SESSION["listofmimes"]);
|
||||
if ($keytodelete >= 0)
|
||||
{
|
||||
unset ($listofpaths[$keytodelete]);
|
||||
unset ($listofnames[$keytodelete]);
|
||||
unset ($listofmimes[$keytodelete]);
|
||||
$_SESSION["listofpaths"]=join(';',$listofpaths);
|
||||
$_SESSION["listofnames"]=join(';',$listofnames);
|
||||
$_SESSION["listofmimes"]=join(';',$listofmimes);
|
||||
//var_dump($_SESSION['listofpaths']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return list of attached files (stored in SECTION array)
|
||||
*
|
||||
* @return unknown_type $type
|
||||
*/
|
||||
function get_attached_files()
|
||||
{
|
||||
$listofpaths=array();
|
||||
$listofnames=array();
|
||||
$listofmimes=array();
|
||||
if (! empty($_SESSION["listofpaths"])) $listofpaths=explode(';',$_SESSION["listofpaths"]);
|
||||
if (! empty($_SESSION["listofnames"])) $listofnames=explode(';',$_SESSION["listofnames"]);
|
||||
if (! empty($_SESSION["listofmimes"])) $listofmimes=explode(';',$_SESSION["listofmimes"]);
|
||||
return array('paths'=>$listofpaths, 'names'=>$listofnames, 'mimes'=>$listofmimes);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Show the form to input an email
|
||||
* \param addfileaction Name of action when posting file attachments
|
||||
* \param removefileaction Name of action when removing file attachments
|
||||
* \remarks this->withfile: 0=No attaches files, 1=Show attached files, 2=Can add new attached files
|
||||
*/
|
||||
function show_form($addfileaction='addfile',$removefileaction='removefile')
|
||||
{
|
||||
global $conf, $langs, $user;
|
||||
|
||||
$langs->load("other");
|
||||
$langs->load("mails");
|
||||
|
||||
// Define list of attached files
|
||||
$listofpaths=array();
|
||||
$listofnames=array();
|
||||
$listofmimes=array();
|
||||
if (! empty($_SESSION["listofpaths"])) $listofpaths=explode(';',$_SESSION["listofpaths"]);
|
||||
if (! empty($_SESSION["listofnames"])) $listofnames=explode(';',$_SESSION["listofnames"]);
|
||||
if (! empty($_SESSION["listofmimes"])) $listofmimes=explode(';',$_SESSION["listofmimes"]);
|
||||
|
||||
|
||||
$form=new Form($DB);
|
||||
|
||||
print "\n<!-- Debut form mail -->\n";
|
||||
print "<form method=\"POST\" name=\"mailform\" enctype=\"multipart/form-data\" action=\"".$this->param["returnurl"]."\">\n";
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
foreach ($this->param as $key=>$value)
|
||||
{
|
||||
print "<input type=\"hidden\" name=\"$key\" value=\"$value\">\n";
|
||||
}
|
||||
print "<table class=\"border\" width=\"100%\">\n";
|
||||
|
||||
// Substitution array
|
||||
if ($this->withsubstit)
|
||||
{
|
||||
print "<tr><td colspan=\"2\">";
|
||||
$help="";
|
||||
foreach($this->substit as $key => $val)
|
||||
{
|
||||
$help.=$key.' -> '.$langs->trans($val).'<br>';
|
||||
}
|
||||
print $form->textwithpicto($langs->trans("EMailTestSubstitutionReplacedByGenericValues"),$help);
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
|
||||
// From
|
||||
if ($this->withfrom)
|
||||
{
|
||||
if ($this->withfromreadonly)
|
||||
{
|
||||
print '<input type="hidden" name="fromname" value="'.$this->fromname.'">';
|
||||
print '<input type="hidden" name="frommail" value="'.$this->frommail.'">';
|
||||
print "<tr><td width=\"180\">".$langs->trans("MailFrom")."</td><td>";
|
||||
if ($this->fromtype == 'user')
|
||||
{
|
||||
$langs->load("users");
|
||||
$fuser=new User($this->db);
|
||||
$fuser->fetch($this->fromid);
|
||||
print $fuser->getNomUrl(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
print $this->fromname;
|
||||
}
|
||||
if ($this->frommail)
|
||||
{
|
||||
print " <".$this->frommail.">";
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($this->fromtype)
|
||||
{
|
||||
$langs->load("errors");
|
||||
print '<font class="warning"> <'.$langs->trans("ErrorNoMailDefinedForThisUser").'> </font>';
|
||||
}
|
||||
}
|
||||
print "</td></tr>\n";
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<tr><td>".$langs->trans("MailFrom")."</td><td>";
|
||||
print $langs->trans("Name").':<input type="text" name="fromname" size="32" value="'.$this->fromname.'">';
|
||||
print ' ';
|
||||
print $langs->trans("EMail").':<<input type="text" name="frommail" size="32" value="'.$this->frommail.'">>';
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
}
|
||||
|
||||
// Replyto
|
||||
if ($this->withreplyto)
|
||||
{
|
||||
if ($this->withreplytoreadonly)
|
||||
{
|
||||
print '<input type="hidden" name="replyname" value="'.$this->replytoname.'">';
|
||||
print '<input type="hidden" name="replymail" value="'.$this->replytomail.'">';
|
||||
print "<tr><td>".$langs->trans("MailReply")."</td><td>".$this->replytoname.($this->replytomail?(" <".$this->replytomail.">"):"");
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
}
|
||||
|
||||
// Errorsto
|
||||
if ($this->witherrorsto)
|
||||
{
|
||||
//if (! $this->errorstomail) $this->errorstomail=$this->frommail;
|
||||
if ($this->witherrorstoreadonly)
|
||||
{
|
||||
print '<input type="hidden" name="errorstomail" value="'.$this->errorstomail.'">';
|
||||
print "<tr><td>".$langs->trans("MailErrorsTo")."</td><td>";
|
||||
print $this->errorstomail;
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<tr><td>".$langs->trans("MailErrorsTo")."</td><td>";
|
||||
print "<input size=\"30\" name=\"errorstomail\" value=\"".$this->errorstomail."\">";
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
}
|
||||
|
||||
// To
|
||||
if ($this->withto || is_array($this->withto))
|
||||
{
|
||||
print '<tr><td width="180">';
|
||||
print $form->textwithpicto($langs->trans("MailTo"),$langs->trans("YouCanUseCommaSeparatorForSeveralRecipients"));
|
||||
print '</td><td>';
|
||||
if ($this->withtoreadonly)
|
||||
{
|
||||
print (! is_array($this->withto) && ! is_numeric($this->withto))?$this->withto:"";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<input size=\"".(is_array($this->withto)?"30":"60")."\" name=\"sendto\" value=\"".(! is_array($this->withto) && ! is_numeric($this->withto)? (isset($_REQUEST["sendto"])?$_REQUEST["sendto"]:$this->withto) :"")."\">";
|
||||
if ($this->withtosocid > 0)
|
||||
{
|
||||
$liste=array();
|
||||
$liste[0]=' ';
|
||||
$soc=new Societe($this->db);
|
||||
$soc->fetch($this->withtosocid);
|
||||
foreach ($soc->thirdparty_and_contact_email_array() as $key=>$value)
|
||||
{
|
||||
$liste[$key]=$value;
|
||||
}
|
||||
print " ".$langs->trans("or")." ";
|
||||
//var_dump($_REQUEST);exit;
|
||||
print $form->selectarray("receiver", $liste, isset($_REQUEST["receiver"])?$_REQUEST["receiver"]:0);
|
||||
}
|
||||
}
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
|
||||
// CC
|
||||
if ($this->withtocc || is_array($this->withtocc))
|
||||
{
|
||||
print '<tr><td width="180">';
|
||||
print $form->textwithpicto($langs->trans("MailCC"),$langs->trans("YouCanUseCommaSeparatorForSeveralRecipients"));
|
||||
print '</td><td>';
|
||||
if ($this->withtoccreadonly)
|
||||
{
|
||||
print (! is_array($this->withtocc) && ! is_numeric($this->withtocc))?$this->withtocc:"";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<input size=\"".(is_array($this->withtocc)?"30":"60")."\" name=\"sendtocc\" value=\"".((! is_array($this->withtocc) && ! is_numeric($this->withtocc))? (isset($_POST["sendtocc"])?$_POST["sendtocc"]:$this->withtocc) : (isset($_POST["sendtocc"])?$_POST["sendtocc"]:"") )."\">";
|
||||
if ($this->withtoccsocid > 0)
|
||||
{
|
||||
$liste=array();
|
||||
$liste[0]=' ';
|
||||
$soc=new Societe($this->db);
|
||||
$soc->fetch($this->withtoccsocid);
|
||||
foreach ($soc->thirdparty_and_contact_email_array() as $key=>$value)
|
||||
{
|
||||
$liste[$key]=$value;
|
||||
}
|
||||
print " ".$langs->trans("or")." ";
|
||||
$form->select_array("receivercc", $liste, isset($_REQUEST["receivercc"])?$_REQUEST["receivercc"]:0);
|
||||
}
|
||||
}
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
|
||||
// CCC
|
||||
if ($this->withtoccc || is_array($this->withtoccc))
|
||||
{
|
||||
print '<tr><td width="180">';
|
||||
print $form->textwithpicto($langs->trans("MailCCC"),$langs->trans("YouCanUseCommaSeparatorForSeveralRecipients"));
|
||||
print '</td><td>';
|
||||
if ($this->withtocccreadonly)
|
||||
{
|
||||
print (! is_array($this->withtoccc) && ! is_numeric($this->withtoccc))?$this->withtoccc:"";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<input size=\"".(is_array($this->withtoccc)?"30":"60")."\" name=\"sendtoccc\" value=\"".((! is_array($this->withtoccc) && ! is_numeric($this->withtoccc))? (isset($_POST["sendtoccc"])?$_POST["sendtoccc"]:$this->withtoccc) : (isset($_POST["sendtoccc"])?$_POST["sendtoccc"]:"") )."\">";
|
||||
if ($this->withtocccsocid > 0)
|
||||
{
|
||||
$liste=array();
|
||||
$liste[0]=' ';
|
||||
$soc=new Societe($this->db);
|
||||
$soc->fetch($this->withtosocid);
|
||||
foreach ($soc->thirdparty_and_contact_email_array() as $key=>$value)
|
||||
{
|
||||
$liste[$key]=$value;
|
||||
}
|
||||
print " ".$langs->trans("or")." ";
|
||||
$form->select_array("receiverccc", $liste, isset($_REQUEST["receiverccc"])?$_REQUEST["receiverccc"]:0);
|
||||
}
|
||||
}
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
|
||||
// Ask delivery receipt
|
||||
if ($this->withdeliveryreceipt)
|
||||
{
|
||||
print '<tr><td width="180">'.$langs->trans("DeliveryReceipt").'</td><td>';
|
||||
|
||||
if ($this->withdeliveryreceiptreadonly)
|
||||
{
|
||||
print yn($this->withdeliveryreceipt);
|
||||
}
|
||||
else
|
||||
{
|
||||
print $form->selectyesno('deliveryreceipt', (isset($_POST["deliveryreceipt"])?$_POST["deliveryreceipt"]:0) ,1);
|
||||
}
|
||||
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
|
||||
// Topic
|
||||
if ($this->withtopic)
|
||||
{
|
||||
$this->withtopic=make_substitutions($this->withtopic,$this->substit,$langs);
|
||||
|
||||
print "<tr>";
|
||||
print "<td width=\"180\">".$langs->trans("MailTopic")."</td>";
|
||||
print "<td>";
|
||||
if ($this->withtopicreadonly)
|
||||
{
|
||||
print $this->withtopic;
|
||||
print "<input type=\"hidden\" size=\"60\" name=\"subject\" value=\"".$this->withtopic."\">";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<input type=\"text\" size=\"60\" name=\"subject\" value=\"". (isset($_POST["subject"])?$_POST["subject"]:$this->withtopic) ."\">";
|
||||
}
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
|
||||
// Attached files
|
||||
if ($this->withfile)
|
||||
{
|
||||
print "<tr>";
|
||||
print '<td width="180">'.$langs->trans("MailFile")."</td>";
|
||||
print "<td>";
|
||||
//print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
if (sizeof($listofpaths))
|
||||
{
|
||||
foreach($listofpaths as $key => $val)
|
||||
{
|
||||
print img_mime($listofnames[$key]).' '.$listofnames[$key];
|
||||
print ' <input type="image" style="border: 0px;" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/delete.png" value="'.($key+1).'" name="removedfile">';
|
||||
print '<br>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("NoAttachedFiles").'<br>';
|
||||
}
|
||||
if ($this->withfile == 2) // Can add other files
|
||||
{
|
||||
//print '<td><td align="right">';
|
||||
print '<input type="file" class="flat" name="addedfile" value="'.$langs->trans("Upload").'"/>';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="'.$addfileaction.'" value="'.$langs->trans("MailingAddFile").'">';
|
||||
//print '</td></tr></table>';
|
||||
}
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
|
||||
// Message
|
||||
if ($this->withbody)
|
||||
{
|
||||
$defaultmessage="";
|
||||
|
||||
// TODO A partir du type, proposer liste de messages dans table llx_models
|
||||
if ($this->param["models"]=='body') { $defaultmessage=$this->withbody; }
|
||||
if ($this->param["models"]=='facture_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendInvoice"); }
|
||||
if ($this->param["models"]=='facture_relance') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendInvoiceReminder"); }
|
||||
if ($this->param["models"]=='propal_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendProposal"); }
|
||||
if ($this->param["models"]=='order_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendOrder"); }
|
||||
|
||||
$defaultmessage=make_substitutions($defaultmessage,$this->substit,$langs);
|
||||
if (isset($_POST["message"])) $defaultmessage=$_POST["message"];
|
||||
$defaultmessage=str_replace('\n',"\n",$defaultmessage);
|
||||
|
||||
print "<tr>";
|
||||
print "<td width=\"180\" valign=\"top\">".$langs->trans("MailText")."</td>";
|
||||
print "<td>";
|
||||
if ($this->withbodyreadonly)
|
||||
{
|
||||
print nl2br($defaultmessage);
|
||||
print '<input type="hidden" name="message" value="'.$defaultmessage.'">';
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($this->withfckeditor)
|
||||
{
|
||||
// Editeur wysiwyg
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
|
||||
$doleditor=new DolEditor('message',$defaultmessage,280,'dolibarr_notes','In',true);
|
||||
$doleditor->Create();
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<textarea cols="72" rows="8" name="message">';
|
||||
print $defaultmessage;
|
||||
print '</textarea>';
|
||||
}
|
||||
|
||||
}
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
|
||||
print "<tr><td align=center colspan=2><center>";
|
||||
print "<input class=\"button\" type=\"submit\" name=\"sendmail\" value=\"".$langs->trans("SendMail")."\"";
|
||||
// Add a javascript test to avoid to forget to submit file before sending email
|
||||
if ($this->withfile == 2 && $conf->use_javascript_ajax)
|
||||
{
|
||||
print ' onClick="if (document.mailform.addedfile.value != \'\') { alert(\''.dol_escape_js($langs->trans("FileWasNotUploaded")).'\'); return false; } else { return true; }"';
|
||||
}
|
||||
print ">";
|
||||
if ($this->withcancel)
|
||||
{
|
||||
print " ";
|
||||
print "<input class=\"button\" type=\"submit\" name=\"cancel\" value=\"".$langs->trans("Cancel")."\">";
|
||||
}
|
||||
print "</center></td></tr>\n";
|
||||
print "</table>\n";
|
||||
|
||||
print "</form>\n";
|
||||
print "<!-- Fin form mail -->\n";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Affiche la partie de formulaire pour saisie d'un mail
|
||||
* \param withtopic 1 pour proposer a la saisie le sujet
|
||||
* \param withbody 1 pour proposer a la saisie le corps du message
|
||||
* \param withfile 1 pour proposer a la saisie l'ajout d'un fichier joint
|
||||
* \todo Fonction a virer quand fichier /comm/mailing.php vire (= quand ecran dans /comm/mailing prets)
|
||||
*/
|
||||
function mail_topicmessagefile($withtopic=1,$withbody=1,$withfile=1,$defaultbody)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$langs->load("other");
|
||||
|
||||
print "<table class=\"border\" width=\"100%\">";
|
||||
|
||||
// Topic
|
||||
if ($withtopic)
|
||||
{
|
||||
print "<tr>";
|
||||
print "<td width=\"180\">".$langs->trans("MailTopic")."</td>";
|
||||
print "<td>";
|
||||
print "<input type=\"text\" size=\"60\" name=\"subject\" value=\"\">";
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
// Message
|
||||
if ($withbody)
|
||||
{
|
||||
print "<tr>";
|
||||
print "<td width=\"180\" valign=\"top\">".$langs->trans("MailText")."</td>";
|
||||
print "<td>";
|
||||
print "<textarea rows=\"8\" cols=\"72\" name=\"message\">";
|
||||
print $defaultbody;
|
||||
print "</textarea>";
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
// Si fichier joint
|
||||
if ($withfile)
|
||||
{
|
||||
print "<tr>";
|
||||
print "<td width=\"180\">".$langs->trans("MailFile")."</td>";
|
||||
print "<td>";
|
||||
print "<input type=\"file\" name=\"addedfile\" value=\"".$langs->trans("Upload")."\"/>";
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
117
htdocs/core/class/html.formorder.class.php
Normal file
117
htdocs/core/class/html.formorder.class.php
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
<?php
|
||||
/* Copyright (C) 2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/html.formorder.class.php
|
||||
* \brief File of predefined functions for HTML forms for order module
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \class FormOrder
|
||||
* \brief Classe permettant la generation de composants html
|
||||
* \remarks Only common components must be here.
|
||||
*/
|
||||
class FormOrder
|
||||
{
|
||||
var $db;
|
||||
var $error;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* \brief Constructeur
|
||||
* \param DB handler d'acces base de donnee
|
||||
*/
|
||||
function FormOrder($DB)
|
||||
{
|
||||
$this->db = $DB;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Renvoie la liste des sources de commandes
|
||||
* \param selected Id de la source pre-selectionnee
|
||||
* \param htmlname Nom de la liste deroulante
|
||||
* \param addempty 0=liste sans valeur nulle, 1=ajoute valeur inconnue
|
||||
* \return array Tableau des sources de commandes
|
||||
*/
|
||||
function selectSourcesCommande($selected='',$htmlname='source_id',$addempty=0)
|
||||
{
|
||||
global $conf,$langs;
|
||||
print '<select class="flat" name="'.$htmlname.'" '.$htmloption.'>';
|
||||
if ($addempty) print '<option value="-1" selected="true"> </option>';
|
||||
|
||||
// \TODO Aller chercher les sources dans dictionnaire
|
||||
print '<option value="0"'.($selected=='0'?' selected="true"':'').'>'.$langs->trans('OrderSource0').'</option>';
|
||||
print '<option value="1"'.($selected=='1'?' selected="true"':'').'>'.$langs->trans('OrderSource1').'</option>';
|
||||
print '<option value="2"'.($selected=='2'?' selected="true"':'').'>'.$langs->trans('OrderSource2').'</option>';
|
||||
print '<option value="3"'.($selected=='3'?' selected="true"':'').'>'.$langs->trans('OrderSource3').'</option>';
|
||||
print '<option value="4"'.($selected=='4'?' selected="true"':'').'>'.$langs->trans('OrderSource4').'</option>';
|
||||
print '<option value="5"'.($selected=='5'?' selected="true"':'').'>'.$langs->trans('OrderSource5').'</option>';
|
||||
print '<option value="6"'.($selected=='6'?' selected="true"':'').'>'.$langs->trans('OrderSource6').'</option>';
|
||||
|
||||
print '</select>';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
function select_methodes_commande($selected='',$htmlname='source_id',$addempty=0)
|
||||
{
|
||||
global $conf,$langs;
|
||||
$listemethodes=array();
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.form.class.php");
|
||||
$form=new Form($this->db);
|
||||
|
||||
$sql = "SELECT rowid, libelle ";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_methode_commande_fournisseur";
|
||||
$sql.= " WHERE active = 1";
|
||||
|
||||
dol_syslog("Form::select_methodes_commande sql=".$sql);
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$i = 0;
|
||||
$num = $this->db->num_rows($resql);
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$listemethodes[$obj->rowid] = $obj->libelle;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
return -1;
|
||||
}
|
||||
|
||||
print $form->select_array($htmlname,$listemethodes,$selected,$addempty);
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
493
htdocs/core/class/html.formother.class.php
Normal file
493
htdocs/core/class/html.formother.class.php
Normal file
|
|
@ -0,0 +1,493 @@
|
|||
<?php
|
||||
/* Copyright (c) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||
* Copyright (C) 2006 Marc Barilley/Ocebo <marc@ocebo.com>
|
||||
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerker@telenet.be>
|
||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
*
|
||||
* 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/html.formother.class.php
|
||||
* \brief Fichier de la classe des fonctions predefinie de composants html autre
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \class FormOther
|
||||
* \brief Classe permettant la generation de composants html autre
|
||||
* \remarks Only common components must be here.
|
||||
*/
|
||||
class FormOther
|
||||
{
|
||||
var $db;
|
||||
var $error;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Constructeur
|
||||
* \param DB handler d'acces base de donnee
|
||||
*/
|
||||
function FormOther($DB)
|
||||
{
|
||||
$this->db = $DB;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Retourne la liste des modeles d'export
|
||||
* \param selected Id modele pre-selectionne
|
||||
* \param htmlname Nom de la zone select
|
||||
* \param type Type des modeles recherches
|
||||
* \param useempty Affiche valeur vide dans liste
|
||||
*/
|
||||
function select_export_model($selected='',$htmlname='exportmodelid',$type='',$useempty=0)
|
||||
{
|
||||
$sql = "SELECT rowid, label";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."export_model";
|
||||
$sql.= " WHERE type = '".$type."'";
|
||||
$sql.= " ORDER BY rowid";
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
print '<select class="flat" name="'.$htmlname.'">';
|
||||
if ($useempty)
|
||||
{
|
||||
print '<option value="-1"> </option>';
|
||||
}
|
||||
|
||||
$num = $this->db->num_rows($result);
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $this->db->fetch_object($result);
|
||||
if ($selected == $obj->rowid)
|
||||
{
|
||||
print '<option value="'.$obj->rowid.'" selected="true">';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<option value="'.$obj->rowid.'">';
|
||||
}
|
||||
print $obj->label;
|
||||
print '</option>';
|
||||
$i++;
|
||||
}
|
||||
print "</select>";
|
||||
}
|
||||
else {
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Retourne la liste des modeles d'import
|
||||
* \param selected Id modele pre-selectionne
|
||||
* \param htmlname Nom de la zone select
|
||||
* \param type Type des modeles recherches
|
||||
* \param useempty Affiche valeur vide dans liste
|
||||
*/
|
||||
function select_import_model($selected='',$htmlname='importmodelid',$type='',$useempty=0)
|
||||
{
|
||||
$sql = "SELECT rowid, label";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."import_model";
|
||||
$sql.= " WHERE type = '".$type."'";
|
||||
$sql.= " ORDER BY rowid";
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
print '<select class="flat" name="'.$htmlname.'">';
|
||||
if ($useempty)
|
||||
{
|
||||
print '<option value="-1"> </option>';
|
||||
}
|
||||
|
||||
$num = $this->db->num_rows($result);
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $this->db->fetch_object($result);
|
||||
if ($selected == $obj->rowid)
|
||||
{
|
||||
print '<option value="'.$obj->rowid.'" selected="true">';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<option value="'.$obj->rowid.'">';
|
||||
}
|
||||
print $obj->label;
|
||||
print '</option>';
|
||||
$i++;
|
||||
}
|
||||
print "</select>";
|
||||
}
|
||||
else {
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Retourne la liste des ecotaxes avec tooltip sur le libelle
|
||||
* \param selected code ecotaxes pre-selectionne
|
||||
* \param htmlname nom de la liste deroulante
|
||||
*/
|
||||
function select_ecotaxes($selected='',$htmlname='ecotaxe_id')
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$sql = "SELECT e.rowid, e.code, e.libelle, e.price, e.organization,";
|
||||
$sql.= " p.libelle as pays";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_ecotaxe as e,".MAIN_DB_PREFIX."c_pays as p";
|
||||
$sql.= " WHERE e.active = 1 AND e.fk_pays = p.rowid";
|
||||
$sql.= " ORDER BY pays, e.organization ASC, e.code ASC";
|
||||
|
||||
if ($this->db->query($sql))
|
||||
{
|
||||
print '<select class="flat" name="'.$htmlname.'">';
|
||||
$num = $this->db->num_rows();
|
||||
$i = 0;
|
||||
print '<option value="-1"> </option>'."\n";
|
||||
if ($num)
|
||||
{
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $this->db->fetch_object();
|
||||
if ($selected && $selected == $obj->rowid)
|
||||
{
|
||||
print '<option value="'.$obj->rowid.'" selected="true">';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<option value="'.$obj->rowid.'">';
|
||||
//print '<option onmouseover="showtip(\''.$obj->libelle.'\')" onMouseout="hidetip()" value="'.$obj->rowid.'">';
|
||||
}
|
||||
$selectOptionValue = $obj->code.' : '.price($obj->price).' '.$langs->trans("HT").' ('.$obj->organization.')';
|
||||
print $selectOptionValue;
|
||||
print '</option>';
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
print '</select>';
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Retourne une liste de pourcentage
|
||||
* \param selected pourcentage pre-selectionne
|
||||
* \param htmlname nom de la liste deroulante
|
||||
* \param increment increment value
|
||||
* \param start start value
|
||||
* \param end end value
|
||||
* \return return combo
|
||||
*/
|
||||
function select_percent($selected=0,$htmlname='percent',$disabled=0,$increment=5,$start=0,$end=100)
|
||||
{
|
||||
$return = '<select class="flat" name="'.$htmlname.'" '.($disabled?'disabled="true"':'').'>';
|
||||
|
||||
for ($i = $start ; $i <= $end ; $i += $increment)
|
||||
{
|
||||
if ($selected == $i)
|
||||
{
|
||||
$return.= '<option value="'.$i.'" selected="true">';
|
||||
}
|
||||
else
|
||||
{
|
||||
$return.= '<option value="'.$i.'">';
|
||||
}
|
||||
$return.= $i.' % ';
|
||||
$return.= '</option>';
|
||||
}
|
||||
|
||||
$return.= '</select>';
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief 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 selected Preselected value
|
||||
* \param htmlname Name of combo list
|
||||
* \return return Html combo list code
|
||||
*/
|
||||
function select_categories($type,$selected=0,$htmlname='search_categ')
|
||||
{
|
||||
global $langs;
|
||||
require_once(DOL_DOCUMENT_ROOT."/categories/class/categorie.class.php");
|
||||
|
||||
// Load list of "categories"
|
||||
$static_categs = new Categorie($this->db);
|
||||
$tab_categs = $static_categs->get_full_arbo($type);
|
||||
|
||||
// Print a select with each of them
|
||||
$moreforfilter ='<select class="flat" name="'.$htmlname.'">';
|
||||
$moreforfilter.='<option value=""> </option>';
|
||||
|
||||
if (is_array($tab_categs))
|
||||
{
|
||||
foreach ($tab_categs as $categ)
|
||||
{
|
||||
$moreforfilter.='<option value="'.$categ['id'].'"';
|
||||
if ($categ['id'] == $selected) $moreforfilter.=' selected="true"';
|
||||
$moreforfilter.='>'.dol_trunc($categ['fulllabel'],50,'middle').'</option>';
|
||||
}
|
||||
}
|
||||
$moreforfilter.='</select>';
|
||||
|
||||
return $moreforfilter;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Return select list for categories (to use in form search selectors)
|
||||
* \param selected Preselected value
|
||||
* \param htmlname Name of combo list
|
||||
* \return return Html combo list code
|
||||
*/
|
||||
function select_salesrepresentatives($selected=0,$htmlname='search_sale')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
// Select each sales and print them in a select input
|
||||
$moreforfilter ='<select class="flat" name="'.$htmlname.'">';
|
||||
$moreforfilter.='<option value=""> </option>';
|
||||
|
||||
$sql_usr = "SELECT u.rowid, u.name, u.firstname, u.login";
|
||||
$sql_usr.= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||
$sql_usr.= " WHERE u.entity IN (0,".$conf->entity.")";
|
||||
$sql_usr.= " ORDER BY u.name ASC";
|
||||
|
||||
$resql_usr = $this->db->query($sql_usr);
|
||||
if ($resql_usr)
|
||||
{
|
||||
while ($obj_usr = $this->db->fetch_object($resql_usr))
|
||||
{
|
||||
$moreforfilter.='<option value="'.$obj_usr->rowid.'"';
|
||||
|
||||
if ($obj_usr->rowid == $selected) $moreforfilter.=' selected="true"';
|
||||
|
||||
$moreforfilter.='>';
|
||||
$moreforfilter.=$obj_usr->firstname." ".$obj_usr->name." (".$obj_usr->login.')';
|
||||
$moreforfilter.='</option>';
|
||||
$i++;
|
||||
}
|
||||
$this->db->free($resql_usr);
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
$moreforfilter.='</select>';
|
||||
|
||||
return $moreforfilter;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Retourn list of project and tasks
|
||||
* \param selected Pre-selected value
|
||||
* \param projectid Project id
|
||||
* \param htmlname Name of html select
|
||||
* \param modeproject 1 to restrict on projects owned by user
|
||||
* \param modetask 1 to restrict on tasks associated to user
|
||||
* \param mode 0=Return list of tasks and their projects, 1=Return projects and tasks if exists
|
||||
*/
|
||||
function selectProjectTasks($selected='', $projectid=0, $htmlname='task_parent', $modeproject=0, $modetask=0, $mode=0, $useempty=0)
|
||||
{
|
||||
global $user, $langs;
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT."/projet/class/task.class.php");
|
||||
|
||||
//print $modeproject.'-'.$modetask;
|
||||
$task=new Task($this->db);
|
||||
$tasksarray=$task->getTasksArray($modetask?$user:0, $modeproject?$user:0, $projectid, 0, $mode);
|
||||
if ($tasksarray)
|
||||
{
|
||||
print '<select class="flat" name="'.$htmlname.'">';
|
||||
if ($useempty) print '<option value="0" selected="true"> </option>';
|
||||
$j=0;
|
||||
$level=0;
|
||||
PLineSelect($j, 0, $tasksarray, $level, $selected);
|
||||
print '</select>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<div class="warning">'.$langs->trans("NoProject").'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Affiche zone de selection de couleur
|
||||
* @param set_color Couleur de pre-selection
|
||||
* @param prefix Prefix pour nom champ
|
||||
* @param form_name Nom du formulaire de provenance.
|
||||
*/
|
||||
function select_color($set_color='', $prefix='f_color', $form_name='objForm')
|
||||
{
|
||||
print "\n".'<table class="nobordernopadding"><tr><td valign="middle">';
|
||||
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/lib/lib_colorpicker.js"></script>'."\n";
|
||||
print '<script type="text/javascript">
|
||||
window.onload = function()
|
||||
{
|
||||
fctLoad();
|
||||
}
|
||||
window.onscroll = function()
|
||||
{
|
||||
fctShow();
|
||||
}
|
||||
window.onresize = function()
|
||||
{
|
||||
fctShow();
|
||||
}
|
||||
</script>'."\n";
|
||||
print '<input type="text" size="10" name="'.$prefix.'" value="'.$set_color.'" maxlength="7" class="flat">'."\n";
|
||||
print '</td><td valign="middle">';
|
||||
print '<img src="'.DOL_URL_ROOT.'/theme/common/colorpicker.png" width="21" height="20" border="0" onClick="fctShow(document.'.$form_name.'.'.$prefix.');" style="cursor:pointer;">'."\n";
|
||||
print '</td></tr></table>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Creation d'un icone de couleur
|
||||
* @param color Couleur de l'image
|
||||
* @param module Nom du module
|
||||
* @param name Nom de l'image
|
||||
* @param x Largeur de l'image en pixels
|
||||
* @param y Hauteur de l'image en pixels
|
||||
*/
|
||||
function CreateColorIcon($color,$module,$name,$x='12',$y='12')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$file = $conf->$module->dir_temp.'/'.$name.'.png';
|
||||
|
||||
// On cree le repertoire contenant les icones
|
||||
if (! file_exists($conf->$module->dir_temp))
|
||||
{
|
||||
create_exdir($conf->$module->dir_temp);
|
||||
}
|
||||
|
||||
// On cree l'image en vraies couleurs
|
||||
$image = imagecreatetruecolor($x,$y);
|
||||
|
||||
$color = substr($color,1,6);
|
||||
|
||||
$rouge = hexdec(substr($color,0,2)); //conversion du canal rouge
|
||||
$vert = hexdec(substr($color,2,2)); //conversion du canal vert
|
||||
$bleu = hexdec(substr($color,4,2)); //conversion du canal bleu
|
||||
|
||||
$couleur = imagecolorallocate($image,$rouge,$vert,$bleu);
|
||||
//print $rouge.$vert.$bleu;
|
||||
imagefill($image,0,0,$couleur); //on remplit l'image
|
||||
// On cree la couleur et on l'attribue a une variable pour ne pas la perdre
|
||||
ImagePng($image,$file); //renvoie une image sous format png
|
||||
ImageDestroy($image);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Write all lines of a project (if parent = 0)
|
||||
*
|
||||
* @param unknown_type $inc
|
||||
* @param unknown_type $parent
|
||||
* @param unknown_type $lines
|
||||
* @param unknown_type $level
|
||||
*/
|
||||
function PLineSelect(&$inc, $parent, $lines, $level=0, $selected=0)
|
||||
{
|
||||
global $langs, $user, $conf;
|
||||
|
||||
$lastprojectid=0;
|
||||
|
||||
for ($i = 0 ; $i < sizeof($lines) ; $i++)
|
||||
{
|
||||
if ($lines[$i]->fk_parent == $parent)
|
||||
{
|
||||
$var = !$var;
|
||||
|
||||
// Break on a new project
|
||||
if ($parent == 0)
|
||||
{
|
||||
if ($lines[$i]->fk_project != $lastprojectid)
|
||||
{
|
||||
if ($i > 0 && $conf->browser->firefox) print '<option value="0" disabled="true">----------</option>';
|
||||
print '<option value="'.$lines[$i]->fk_project.'_0">'; // Project -> Task
|
||||
print $langs->trans("Project").' '.$lines[$i]->projectref;
|
||||
if (empty($lines[$i]->public))
|
||||
{
|
||||
print ' ('.$langs->trans("Visibility").': '.$langs->trans("PrivateProject").')';
|
||||
}
|
||||
else
|
||||
{
|
||||
print ' ('.$langs->trans("Visibility").': '.$langs->trans("SharedProject").')';
|
||||
}
|
||||
//print '-'.$parent.'-'.$lines[$i]->fk_project.'-'.$lastprojectid;
|
||||
print "</option>\n";
|
||||
|
||||
$lastprojectid=$lines[$i]->fk_project;
|
||||
$inc++;
|
||||
}
|
||||
}
|
||||
|
||||
// Print task
|
||||
if ($lines[$i]->id > 0)
|
||||
{
|
||||
print '<option value="'.$lines[$i]->fk_project.'_'.$lines[$i]->id.'"';
|
||||
if ($lines[$i]->id == $selected) print ' selected="true"';
|
||||
print '>';
|
||||
print $langs->trans("Project").' '.$lines[$i]->projectref;
|
||||
if (empty($lines[$i]->public))
|
||||
{
|
||||
print ' ('.$langs->trans("Visibility").': '.$langs->trans("PrivateProject").')';
|
||||
}
|
||||
else
|
||||
{
|
||||
print ' ('.$langs->trans("Visibility").': '.$langs->trans("SharedProject").')';
|
||||
}
|
||||
if ($lines[$i]->id) print ' > ';
|
||||
for ($k = 0 ; $k < $level ; $k++)
|
||||
{
|
||||
print " ";
|
||||
}
|
||||
print $lines[$i]->label."</option>\n";
|
||||
$inc++;
|
||||
}
|
||||
|
||||
$level++;
|
||||
if ($lines[$i]->id) PLineSelect($inc, $lines[$i]->id, $lines, $level, $selected);
|
||||
$level--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
*/
|
||||
|
||||
require("../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/ecm/class/htmlecm.form.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/ecm/class/ecmdirectory.class.php");
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
*/
|
||||
|
||||
require("../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/ecm/class/htmlecm.form.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/ecm/class/ecmdirectory.class.php");
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
*/
|
||||
|
||||
require("../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/ecm/class/ecmdirectory.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/ecm.lib.php");
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
*/
|
||||
|
||||
require("../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
|
||||
// Load traductions files
|
||||
$langs->load("ecm");
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
*/
|
||||
|
||||
require("../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/ecm.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/treeview.lib.php");
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
*/
|
||||
|
||||
require("../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/ecm.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/treeview.lib.php");
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
require("../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/expedition/class/expedition.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/includes/modules/expedition/pdf/ModelePdfExpedition.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/product/class/html.formproduct.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/product.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/sendings.lib.php");
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
require("../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/expedition/class/expedition.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/order.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/sendings.lib.php");
|
||||
if ($conf->produit->enabled || $conf->service->enabled) require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php");
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
require_once("../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formother.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formother.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/exports/class/export.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT.'/includes/modules/export/modules_export.php');
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ require("../main.inc.php");
|
|||
require_once(DOL_DOCUMENT_ROOT."/fichinter/class/fichinter.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/fichinter.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
|
||||
$langs->load("other");
|
||||
$langs->load("fichinter");
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
*/
|
||||
|
||||
require("../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/fichinter/class/fichinter.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/includes/modules/fichinter/modules_fichinter.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/fichinter.lib.php");
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ require("../../main.inc.php");
|
|||
require_once(DOL_DOCUMENT_ROOT.'/lib/order.lib.php');
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/fourn.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
require_once DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.commande.class.php";
|
||||
|
||||
$langs->load('orders');
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
require("../../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formorder.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formorder.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT.'/includes/modules/supplier_order/modules_commandefournisseur.php');
|
||||
require_once DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.commande.class.php";
|
||||
require_once DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.product.class.php";
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ require_once(DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php');
|
|||
require_once(DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php');
|
||||
require_once(DOL_DOCUMENT_ROOT.'/lib/fourn.lib.php');
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
|
||||
$langs->load('bills');
|
||||
$langs->load('other');
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
*/
|
||||
|
||||
require("../../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php');
|
||||
require_once(DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php');
|
||||
require_once(DOL_DOCUMENT_ROOT.'/fourn/facture/paiementfourn.class.php');
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
*/
|
||||
|
||||
require("../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formother.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formother.class.php");
|
||||
|
||||
$langs->load("suppliers");
|
||||
$langs->load("orders");
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
*/
|
||||
|
||||
require("./pre.inc.php"); // We use pre.inc.php to have a dynamic menu
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/treeview.lib.php");
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
require_once("../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formother.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formother.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/imports/class/import.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT.'/includes/modules/import/modules_import.php');
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
require("../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/livraison/class/livraison.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/includes/modules/livraison/modules_livraison.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/sendings.lib.php");
|
||||
if ($conf->produit->enabled || $conf->service->enabled) require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php");
|
||||
if ($conf->expedition_bon->enabled) require_once(DOL_DOCUMENT_ROOT."/expedition/class/expedition.class.php");
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ require('../main.inc.php');
|
|||
require_once(DOL_DOCUMENT_ROOT."/lib/product.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
|
||||
$langs->load("other");
|
||||
$langs->load("products");
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
require("../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT.'/product/class/product.class.php');
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formother.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formother.class.php");
|
||||
if ($conf->categorie->enabled) require_once(DOL_DOCUMENT_ROOT."/categories/class/categorie.class.php");
|
||||
|
||||
$langs->load("products");
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
require("../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/product.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
|
||||
$langs->load("products");
|
||||
$langs->load("bills");
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ require('../main.inc.php');
|
|||
require_once(DOL_DOCUMENT_ROOT."/projet/class/project.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT.'/lib/project.lib.php');
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
|
||||
$langs->load('projects');
|
||||
$langs->load('other');
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
require("../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/projet/class/project.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/project.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/includes/modules/project/modules_project.php");
|
||||
|
||||
$langs->load("projects");
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ require_once(DOL_DOCUMENT_ROOT."/projet/class/project.class.php");
|
|||
require_once(DOL_DOCUMENT_ROOT."/projet/class/task.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT.'/lib/project.lib.php');
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
|
||||
if (!$user->rights->projet->lire) accessforbidden();
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ require_once(DOL_DOCUMENT_ROOT."/projet/class/project.class.php");
|
|||
require_once(DOL_DOCUMENT_ROOT."/projet/class/task.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/project.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/date.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formother.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formother.class.php");
|
||||
|
||||
$projectid='';
|
||||
$projectid=isset($_REQUEST["id"])?$_REQUEST["id"]:$_POST["id"];
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ require ("../../main.inc.php");
|
|||
require_once(DOL_DOCUMENT_ROOT."/projet/class/project.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/projet/class/task.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/project.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formother.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formother.class.php");
|
||||
|
||||
$taskid = (isset($_GET["id"])?$_GET["id"]:(isset($_POST["id"])?$_POST["id"]:''));
|
||||
$taskref = (isset($_GET["ref"])?$_GET["ref"]:'');
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
require("../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
|
||||
$langs->load("companies");
|
||||
$langs->load('other');
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user