Fix: Bad path for some includes

New: Add more predefined actions
This commit is contained in:
Laurent Destailleur 2010-05-12 11:58:58 +00:00
parent fa8a201d04
commit 2a29f90d14
13 changed files with 79 additions and 55 deletions

View File

@ -25,13 +25,14 @@ For users:
- New: Move permission "see hidden categories" into "see hidden products/services".
- New: Can delete several files at once in FTP module.
- New: Add box "last contracts".
- New: Works even if Web hosting provider has disabled glob function.
- Fix: Format number was wrong for ar_AR language.
- Fix: Can change password if has only permission change password.
- Fix: Project PDF document show the tasks.
- Fix: bug #29278 : SMTP fails with IP
- Fix: Default language on login page.
- Fix: Complete support of euros sign (even in PDF).
For developers:
- More comments in code.
- Uniformize some code.

View File

@ -171,7 +171,7 @@ if (($_POST['action'] == 'send' || $_POST['action'] == 'sendhtml')
$deliveryreceipt= $_POST["deliveryreceipt"];
// Create form object
include_once('../core/class/html.formmail.class.php');
include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php');
$formmail = new FormMail($db);
$attachedfiles=$formmail->get_attached_files();

View File

@ -823,7 +823,7 @@ else
print_titre($langs->trans("TestMailing"));
// Create l'objet formulaire mail
include_once("../../core/class/html.formmail.class.php");
include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php');
$formmail = new FormMail($db);
$formmail->fromname = $mil->email_from;
$formmail->frommail = $mil->email_from;

View File

@ -416,15 +416,16 @@ if ($_POST['action'] == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile']
$langs->load('mails');
$propal= new Propal($db);
if ( $propal->fetch($_POST['propalid']) )
$result=$propal->fetch($_POST['propalid']);
$result=$propal->fetch_thirdparty();
if ($result > 0)
{
$propalref = dol_sanitizeFileName($propal->ref);
$file = $conf->propale->dir_output . '/' . $propalref . '/' . $propalref . '.pdf';
if (is_readable($file))
{
$propal->fetch_client();
if ($_POST['sendto'])
{
// Le destinataire a ete fourni via le champ libre
@ -472,7 +473,7 @@ if ($_POST['action'] == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile']
}
// Create form object
include_once('../core/class/html.formmail.class.php');
include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php');
$formmail = new FormMail($db);
$attachedfiles=$formmail->get_attached_files();
@ -1963,7 +1964,7 @@ if ($id > 0 || ! empty($ref))
print_titre($langs->trans('SendPropalByMail'));
// Create form object
include_once('../core/class/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;

View File

@ -811,9 +811,9 @@ if ($_POST['action'] == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile']
$commande= new Commande($db);
$result=$commande->fetch($_POST['orderid']);
$result=$commande->fetch_client();
$result=$commande->fetch_thirdparty();
if ($result)
if ($result > 0)
{
$ref = dol_sanitizeFileName($commande->ref);
$file = $conf->commande->dir_output . '/' . $ref . '/' . $ref . '.pdf';
@ -867,7 +867,7 @@ if ($_POST['action'] == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile']
}
// Create form object
include_once('../core/class/html.formmail.class.php');
include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php');
$formmail = new FormMail($db);
$attachedfiles=$formmail->get_attached_files();

View File

@ -1128,9 +1128,9 @@ if (($_POST['action'] == 'send' || $_POST['action'] == 'relance') && ! $_POST['a
$fac = new Facture($db,'',$_POST['facid']);
$result=$fac->fetch($_POST['facid']);
$result=$fac->fetch_client();
$result=$fac->fetch_thirdparty();
if ($result)
if ($result > 0)
{
$ref = dol_sanitizeFileName($fac->ref);
$file = $conf->facture->dir_output . '/' . $ref . '/' . $ref . '.pdf';
@ -1197,7 +1197,7 @@ if (($_POST['action'] == 'send' || $_POST['action'] == 'relance') && ! $_POST['a
}
// Create form object
include_once('../core/class/html.formmail.class.php');
include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php');
$formmail = new FormMail($db);
$attachedfiles=$formmail->get_attached_files();

View File

@ -410,10 +410,10 @@ class CommonObject
}
/**
* \brief Charge le tiers d'id $this->socid dans this->client
* \brief Load the third party of object from id $this->socid into this->client
* \return int <0 if KO, >0 if OK
*/
function fetch_client()
function fetch_thirdparty()
{
global $conf;
@ -429,6 +429,15 @@ class CommonObject
return $result;
}
/**
* @deprecated Replaced by fetch_thirdparty
* Kept for backward compatibility
*/
function fetch_client()
{
return $this->fetch_thirdparty();
}
/**
* \brief Charge le projet d'id $this->fk_project dans this->projet
* \return int <0 if KO, >=0 if OK

View File

@ -551,11 +551,11 @@ if ($_POST['action'] == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile']
{
$langs->load('mails');
$commande= new Commande($db);
$commande= new CommandeFournisseur($db);
$result=$commande->fetch($_POST['orderid']);
$result=$commande->fetch_client();
$result=$commande->fetch_thirdparty();
if ($result)
if ($result > 0)
{
$ref = dol_sanitizeFileName($commande->ref);
$file = $conf->fournisseur->commande->dir_output . '/' . $ref . '/' . $ref . '.pdf';
@ -596,8 +596,8 @@ if ($_POST['action'] == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile']
if ($_POST['action'] == 'send')
{
if (strlen($_POST['subject'])) $subject=$_POST['subject'];
else $subject = $langs->transnoentities('Order').' '.$commande->ref;
$actiontypecode='AC_COM';
else $subject = $langs->transnoentities('CustomerOrder').' '.$commande->ref;
$actiontypecode='AC_SUP_ORD';
$actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n";
if ($message)
{
@ -609,7 +609,7 @@ if ($_POST['action'] == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile']
}
// Create form object
include_once('../core/class/html.formmail.class.php');
include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php');
$formmail = new FormMail($db);
$attachedfiles=$formmail->get_attached_files();
@ -643,7 +643,7 @@ if ($_POST['action'] == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile']
// Appel des triggers
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
$interface=new Interfaces($db);
$result=$interface->run_triggers('ORDER_SENTBYMAIL',$commande,$user,$langs,$conf);
$result=$interface->run_triggers('ORDER_SUPPLIER_SENTBYMAIL',$commande,$user,$langs,$conf);
if ($result < 0) { $error++; $this->errors=$interface->errors; }
// Fin appel triggers

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
/* 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
@ -17,25 +17,24 @@
*/
/**
\file htdocs/includes/triggers/interface_all_Demo.class.php
\ingroup core
\brief Fichier de demo de personalisation des actions du workflow
\remarks Son propre fichier d'actions peut etre cree par recopie de celui-ci:
- Le nom du fichier doit etre: interface_modMymodule_Mytrigger.class.php
ou: interface_all_Mytrigger.class.php
- Le fichier doit rester stocke dans includes/triggers
- Le nom de la classe doit etre InterfaceMytrigger
- Le nom de la methode constructeur doit etre InterfaceMytrigger
- Le nom de la propriete name doit etre Mytrigger
\version $Id$
*/
* \file htdocs/includes/triggers/interface_all_Demo.class.php
* \ingroup core
* \brief Fichier de demo de personalisation des actions du workflow
* \remarks Son propre fichier d'actions peut etre cree par recopie de celui-ci:
* - Le nom du fichier doit etre: interface_modMymodule_Mytrigger.class.php
* ou: interface_all_Mytrigger.class.php
* - Le fichier doit rester stocke dans includes/triggers
* - Le nom de la classe doit etre InterfaceMytrigger
* - Le nom de la methode constructeur doit etre InterfaceMytrigger
* - Le nom de la propriete name doit etre Mytrigger
* \version $Id$
*/
/**
\class InterfaceDemo
\brief Classe des fonctions triggers des actions personalisees du workflow
*/
* \class InterfaceDemo
* \brief Classe des fonctions triggers des actions personalisees du workflow
*/
class InterfaceDemo
{
var $db;
@ -213,6 +212,10 @@ class InterfaceDemo
{
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
elseif ($action == 'ORDER_SUPPLIER_SENTBYMAIL')
{
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
// Proposals
elseif ($action == 'PROPAL_CREATE')

View File

@ -33,11 +33,13 @@
--
delete from llx_c_actioncomm where id in (1,2,3,4,5,8,9,50);
insert into llx_c_actioncomm (id, code, type, libelle, module) values ( 1, 'AC_TEL', 'system', 'Appel Téléphonique' ,NULL);
insert into llx_c_actioncomm (id, code, type, libelle, module) values ( 2, 'AC_FAX', 'system', 'Envoi Fax' ,NULL);
insert into llx_c_actioncomm (id, code, type, libelle, module) values ( 3, 'AC_PROP', 'system', 'Envoi Proposition' ,'propal');
insert into llx_c_actioncomm (id, code, type, libelle, module) values ( 4, 'AC_EMAIL','system', 'Envoi Email' ,NULL);
insert into llx_c_actioncomm (id, code, type, libelle, module) values ( 1, 'AC_TEL', 'system', 'Phone call' ,NULL);
insert into llx_c_actioncomm (id, code, type, libelle, module) values ( 2, 'AC_FAX', 'system', 'Fax send' ,NULL);
insert into llx_c_actioncomm (id, code, type, libelle, module) values ( 3, 'AC_PROP', 'system', 'Send commercial proposal by email' ,'propal');
insert into llx_c_actioncomm (id, code, type, libelle, module) values ( 4, 'AC_EMAIL','system', 'Send Email' ,NULL);
insert into llx_c_actioncomm (id, code, type, libelle, module) values ( 5, 'AC_RDV', 'system', 'Rendez-vous' ,NULL);
insert into llx_c_actioncomm (id, code, type, libelle, module) values ( 8, 'AC_COM', 'system', 'Envoi Commande' ,'order');
insert into llx_c_actioncomm (id, code, type, libelle, module) values ( 9, 'AC_FAC', 'system', 'Envoi Facture' ,'invoice');
insert into llx_c_actioncomm (id, code, type, libelle, module) values (50, 'AC_OTH', 'system', 'Autre' ,NULL);
insert into llx_c_actioncomm (id, code, type, libelle, module) values ( 8, 'AC_COM', 'system', 'Send customer order by email' ,'order');
insert into llx_c_actioncomm (id, code, type, libelle, module) values ( 9, 'AC_FAC', 'system', 'Send customer invoice by email' ,'invoice');
insert into llx_c_actioncomm (id, code, type, libelle, module) values (30, 'AC_SUP_ORD', 'system', 'Send supplier invoice by email' ,'supplier_order');
insert into llx_c_actioncomm (id, code, type, libelle, module) values (31, 'AC_SUP_INV', 'system', 'Send supplier invoice by email' ,'supplier_invoice');
insert into llx_c_actioncomm (id, code, type, libelle, module) values (50, 'AC_OTH', 'system', 'Other' ,NULL);

View File

@ -199,4 +199,8 @@ ALTER TABLE llx_menu DROP INDEX idx_menu_uk_menu;
ALTER TABLE llx_menu ADD UNIQUE INDEX idx_menu_uk_menu (menu_handler, fk_menu, position, url, entity);
UPDATE llx_const SET name = 'MAIN_MODULE_PRODUCT' WHERE name = 'MAIN_MODULE_PRODUIT';
UPDATE llx_const SET name = 'MAIN_MODULE_PRODUCT' WHERE name = 'MAIN_MODULE_PRODUIT';
-- Add more predefined action codes --
insert into llx_c_actioncomm (id, code, type, libelle, module) values (30, 'AC_SUP_ORD', 'system', 'Send supplier invoice by email' ,'supplier_order');
insert into llx_c_actioncomm (id, code, type, libelle, module) values (31, 'AC_SUP_INV', 'system', 'Send supplier invoice by email' ,'supplier_invoice');

View File

@ -67,11 +67,13 @@ ActionUserAsk=Recorded by
ErrorStatusCantBeZeroIfStarted=If field '<b>Date done</b>' is filled, action is started (or finished), so field '<b>Status</b>' can't be 0%%.
ActionAC_TEL=Phone call
ActionAC_FAX=Send fax
ActionAC_PROP=Send proposal
ActionAC_PROP=Send proposal by mail
ActionAC_EMAIL=Send Email
ActionAC_RDV=Meetings
ActionAC_FAC=Send billing
ActionAC_REL=Send billing (reminder)
ActionAC_FAC=Send customer invoice by mail
ActionAC_REL=Send customer invoice by mail (reminder)
ActionAC_CLO=Close
ActionAC_EMAILING=Send mass email
ActionAC_COM=Send order by mail
ActionAC_COM=Send customer order by mail
ActionAC_SUP_ORD=Send supplier order by mail
ActionAC_SUP_INV=Send supplier invoice by mail

View File

@ -70,11 +70,13 @@ ActionAC_FAX=Envoi fax
ActionAC_PROP=Envoi proposition par mail
ActionAC_EMAIL=Envoi e-mail
ActionAC_RDV=Rendez-vous
ActionAC_FAC=Envoi facture par mail
ActionAC_REL=Relance facture par mail
ActionAC_FAC=Envoi facture client par mail
ActionAC_REL=Relance facture client par mail
ActionAC_CLO=Clôture
ActionAC_EMAILING=Envoi mailing masse
ActionAC_COM=Envoi commande par mail
ActionAC_COM=Envoi commande client par mail
ActionAC_SUP_ORD=Envoi commande fournisseur par mail
ActionAC_SUP_INV=Envoi facture fournisseur par mail
Stats=Statistiques de vente
CAOrder=Chiffre d'affaire (Commandes validées)
FromTo=du %s au %s