Doc
This commit is contained in:
parent
d01a8f22bd
commit
cf184ec351
@ -22,7 +22,7 @@
|
||||
* \file htdocs/core/class/commonobject.class.php
|
||||
* \ingroup core
|
||||
* \brief File of parent class of all other business classes (invoices, contracts, proposals, orders, ...)
|
||||
* \version $Id: commonobject.class.php,v 1.146 2011/07/13 16:55:25 eldy Exp $
|
||||
* \version $Id: commonobject.class.php,v 1.145 2011/07/10 16:50:40 eldy Exp $
|
||||
*/
|
||||
|
||||
|
||||
@ -365,10 +365,9 @@ class CommonObject
|
||||
* Return array with list of possible values for type of contacts
|
||||
* @param source internal, external or all if not defined
|
||||
* @param order Sort order by : code or rowid
|
||||
* @param option 0=Return array id->label, 1=Return array code->label
|
||||
* @return array Array list of type of contacts (id->label if option=0, code->label if option=1)
|
||||
* @return array List of type of contacts
|
||||
*/
|
||||
function liste_type_contact($source='internal', $order='code', $option=0)
|
||||
function liste_type_contact($source='internal', $order='code')
|
||||
{
|
||||
global $langs;
|
||||
|
||||
@ -391,8 +390,7 @@ class CommonObject
|
||||
|
||||
$transkey="TypeContact_".$this->element."_".$source."_".$obj->code;
|
||||
$libelle_type=($langs->trans($transkey)!=$transkey ? $langs->trans($transkey) : $obj->libelle);
|
||||
if (empty($option)) $tab[$obj->rowid]=$libelle_type;
|
||||
else $tab[$obj->code]=$libelle_type;
|
||||
$tab[$obj->rowid]=$libelle_type;
|
||||
$i++;
|
||||
}
|
||||
return $tab;
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
* \ingroup core
|
||||
* \brief Fichier de la classe de stockage de la config courante
|
||||
* \remarks La config est stockee dans le fichier conf/conf.php
|
||||
* \version $Id: conf.class.php,v 1.61 2011/07/13 18:04:25 eldy Exp $
|
||||
* \version $Id: conf.class.php,v 1.60 2011/07/09 05:28:42 hregis Exp $
|
||||
*/
|
||||
|
||||
|
||||
@ -145,13 +145,13 @@ class Conf
|
||||
elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_TRIGGERS$/i',$key,$reg))
|
||||
{
|
||||
$modulename = strtolower($reg[1]);
|
||||
$this->triggers_modules[] = '/'.$modulename.'/inc/triggers/'; // TODO Replace inc by includes to have same path than standard
|
||||
$this->triggers_modules[] = '/'.$modulename.'/inc/triggers/';
|
||||
}
|
||||
// If this is constant for login method activated by a module
|
||||
elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_LOGIN_METHOD$/i',$key,$reg))
|
||||
{
|
||||
$modulename = strtolower($reg[1]);
|
||||
$this->login_method_modules[] = DOL_DOCUMENT_ROOT.'/'.$modulename.'/inc/login/'; // TODO Replace inc by includes to have same path than standard
|
||||
$this->login_method_modules[] = DOL_DOCUMENT_ROOT.'/'.$modulename.'/inc/login/';
|
||||
}
|
||||
// If this is constant for hook activated by a module. Value is list of hooked tabs separated with :
|
||||
elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_HOOKS$/i',$key,$reg))
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
* \file htdocs/core/class/html.formmail.class.php
|
||||
* \ingroup core
|
||||
* \brief Fichier de la classe permettant la generation du formulaire html d'envoi de mail unitaire
|
||||
* \version $Id: html.formmail.class.php,v 1.32 2011/07/13 16:55:25 eldy Exp $
|
||||
* \version $Id: html.formmail.class.php,v 1.31 2011/07/10 20:03:41 eldy Exp $
|
||||
*/
|
||||
require_once(DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php");
|
||||
|
||||
@ -519,7 +519,7 @@ class FormMail
|
||||
foreach($listofpaths as $key => $val)
|
||||
{
|
||||
$out.= '<div id="attachfile_'.$key.'">';
|
||||
$out.= img_mime($listofnames[$key]).' '.$listofnames[$key];
|
||||
$out.= img_mime($listofnames[$key]).' '.$listofnames[$key];
|
||||
if (! $this->withfilereadonly)
|
||||
{
|
||||
$out.= ' <input type="image" style="border: 0px;" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/delete.png" value="'.($key+1).'" class="removedfile" id="removedfile_'.$key.'" name="removedfile_'.$key.'" />';
|
||||
@ -547,15 +547,15 @@ class FormMail
|
||||
$defaultmessage="";
|
||||
|
||||
// TODO A partir du type, proposer liste de messages dans table llx_models
|
||||
if ($this->param["models"]=='facture_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendInvoice"); }
|
||||
elseif ($this->param["models"]=='facture_relance') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendInvoiceReminder"); }
|
||||
elseif ($this->param["models"]=='propal_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendProposal"); }
|
||||
elseif ($this->param["models"]=='order_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendOrder"); }
|
||||
elseif ($this->param["models"]=='order_supplier_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendSupplierOrder"); }
|
||||
elseif ($this->param["models"]=='invoice_supplier_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendSupplierInvoice"); }
|
||||
elseif ($this->param["models"]=='shipping_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendShipping"); }
|
||||
elseif ($this->param["models"]=='fichinter_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendFichInter"); }
|
||||
elseif (! is_numeric($this->withbody)) { $defaultmessage=$this->withbody; }
|
||||
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"); }
|
||||
if ($this->param["models"]=='order_supplier_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendSupplierOrder"); }
|
||||
if ($this->param["models"]=='invoice_supplier_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendSupplierInvoice"); }
|
||||
if ($this->param["models"]=='shipping_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendShipping"); }
|
||||
if ($this->param["models"]=='fichinter_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendFichInter"); }
|
||||
|
||||
if ($conf->paypal->enabled && $conf->global->PAYPAL_ADD_PAYMENT_URL)
|
||||
{
|
||||
@ -565,12 +565,12 @@ class FormMail
|
||||
|
||||
if ($this->param["models"]=='order_send')
|
||||
{
|
||||
$url=getPaypalPaymentUrl('order',$this->substit['__ORDERREF__']);
|
||||
$url=getPaymentUrl('order',$this->substit['__ORDERREF__']);
|
||||
$defaultmessage=$langs->transnoentities("PredefinedMailContentSendOrderWithPaypalLink",$url);
|
||||
}
|
||||
if ($this->param["models"]=='facture_send')
|
||||
{
|
||||
$url=getPaypalPaymentUrl('invoice',$this->substit['__FACREF__']);
|
||||
$url=getPaymentUrl('invoice',$this->substit['__FACREF__']);
|
||||
$defaultmessage=$langs->transnoentities("PredefinedMailContentSendInvoiceWithPaypalLink",$url);
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
* \file htdocs/includes/triggers/interface_modAgenda_ActionsAuto.class.php
|
||||
* \ingroup agenda
|
||||
* \brief Trigger file for agenda module
|
||||
* \version $Id: interface_modAgenda_ActionsAuto.class.php,v 1.34 2011/07/13 18:05:27 eldy Exp $
|
||||
* \version $Id: interface_modAgenda_ActionsAuto.class.php,v 1.33 2011/07/07 09:18:27 simnandez Exp $
|
||||
*/
|
||||
|
||||
|
||||
@ -550,14 +550,8 @@ class InterfaceActionsAuto
|
||||
{
|
||||
$now=dol_now();
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php');
|
||||
require_once(DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php');
|
||||
$contactforaction=new Contact($this->db);
|
||||
$societeforaction=new Societe($this->db);
|
||||
if ($object->sendtoid > 0) $contactforaction->fetch($object->sendtoid);
|
||||
if ($object->socid > 0) $societeforaction->fetch($object->socid);
|
||||
|
||||
// Insertion action
|
||||
require_once(DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php');
|
||||
require_once(DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php');
|
||||
$actioncomm = new ActionComm($this->db);
|
||||
$actioncomm->type_code = $object->actiontypecode;
|
||||
@ -568,8 +562,8 @@ class InterfaceActionsAuto
|
||||
$actioncomm->durationp = 0;
|
||||
$actioncomm->punctual = 1;
|
||||
$actioncomm->percentage = -1; // Not applicable
|
||||
$actioncomm->contact = $contactforaction;
|
||||
$actioncomm->societe = $societeforaction;
|
||||
$actioncomm->contact = new Contact($this->db,$object->sendtoid);
|
||||
$actioncomm->societe = new Societe($this->db,$object->socid);
|
||||
$actioncomm->author = $user; // User saving action
|
||||
//$actioncomm->usertodo = $user; // User affected to action
|
||||
$actioncomm->userdone = $user; // User doing action
|
||||
|
||||
@ -42,7 +42,7 @@ ErrCatAlreadyExists=Ce nom est déjà utilisé
|
||||
AddProductToCat=Ajouter ce produit à une catégorie ?
|
||||
ImpossibleAddCat=Impossible d'ajouter la catégorie
|
||||
ImpossibleAssociateCategory=Impossible d'associer la catégorie
|
||||
WasAddedSuccessfully=<b>%s</b> a été ajouté avec succès.
|
||||
WasAddedSuccessfully=<b>%s</b> a été ajoutée avec succès.
|
||||
ObjectAlreadyLinkedToCategory=L'élément est déjà lié à cette catégorie.
|
||||
CategorySuccessfullyCreated=La catégorie %s a été ajouté avec succès.
|
||||
ProductIsInCategories=Ce produit/service est dans les catégories suivantes
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
* \file htdocs/paypal/lib/paypal.lib.php
|
||||
* \ingroup paypal
|
||||
* \brief Library for common paypal functions
|
||||
* \version $Id: paypal.lib.php,v 1.25 2011/07/13 16:55:34 eldy Exp $
|
||||
* \version $Id$
|
||||
*/
|
||||
function llxHeaderPaypal($title, $head = "")
|
||||
{
|
||||
@ -132,7 +132,7 @@ function html_print_paypal_footer($fromcompany,$langs)
|
||||
function paypaladmin_prepare_head()
|
||||
{
|
||||
global $langs, $conf;
|
||||
|
||||
|
||||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
@ -140,7 +140,7 @@ function paypaladmin_prepare_head()
|
||||
$head[$h][1] = $langs->trans("Account");
|
||||
$head[$h][2] = 'paypalaccount';
|
||||
$h++;
|
||||
|
||||
|
||||
// Show more tabs from modules
|
||||
// Entries must be declared in modules descriptor with line
|
||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||
@ -151,24 +151,24 @@ function paypaladmin_prepare_head()
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
function getPaypalPaymentUrl($source='',$ref='',$amount=0,$freetag='')
|
||||
function getPaymentUrl($source='',$ref='',$amount=0,$freetag='')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/security.lib.php");
|
||||
|
||||
|
||||
if (! empty($source) && ! empty($ref))
|
||||
{
|
||||
$token='';
|
||||
if (! empty($conf->global->PAYPAL_SECURITY_TOKEN)) $token='&securekey='.dol_hash($conf->global->PAYPAL_SECURITY_TOKEN.$source.$ref, 2);
|
||||
|
||||
|
||||
if ($source == 'commande') $source = 'order';
|
||||
if ($source == 'facture') $source = 'invoice';
|
||||
|
||||
|
||||
$url = DOL_MAIN_URL_ROOT.'/public/paypal/newpayment.php?source='.$source.'&ref='.$ref.$token;
|
||||
|
||||
|
||||
return $url;
|
||||
}
|
||||
}
|
||||
@ -482,7 +482,7 @@ function hash_call($methodName,$nvpStr)
|
||||
global $conf, $langs;
|
||||
global $API_Endpoint, $API_Url, $API_version, $USE_PROXY, $PROXY_HOST, $PROXY_PORT, $PROXY_USER, $PROXY_PASS;
|
||||
global $PAYPAL_API_USER, $PAYPAL_API_PASSWORD, $PAYPAL_API_SIGNATURE;
|
||||
|
||||
|
||||
// TODO problem with triggers
|
||||
$API_version="56";
|
||||
if ($conf->global->PAYPAL_API_SANDBOX)
|
||||
@ -495,7 +495,7 @@ function hash_call($methodName,$nvpStr)
|
||||
$API_Endpoint = "https://api-3t.paypal.com/nvp";
|
||||
$API_Url = "https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=";
|
||||
}
|
||||
|
||||
|
||||
// Clean parameters
|
||||
$PAYPAL_API_USER="";
|
||||
if ($conf->global->PAYPAL_API_USER) $PAYPAL_API_USER=$conf->global->PAYPAL_API_USER;
|
||||
@ -506,7 +506,7 @@ function hash_call($methodName,$nvpStr)
|
||||
$PAYPAL_API_SANDBOX="";
|
||||
if ($conf->global->PAYPAL_API_SANDBOX) $PAYPAL_API_SANDBOX=$conf->global->PAYPAL_API_SANDBOX;
|
||||
// TODO END problem with triggers
|
||||
|
||||
|
||||
dol_syslog("Paypal API endpoint ".$API_Endpoint);
|
||||
|
||||
//setting the curl parameters.
|
||||
@ -580,19 +580,19 @@ function hash_call($methodName,$nvpStr)
|
||||
function GetApiError()
|
||||
{
|
||||
$errors=array();
|
||||
|
||||
|
||||
$resArray=$_SESSION['reshash'];
|
||||
|
||||
|
||||
if(isset($_SESSION['curl_error_no']))
|
||||
{
|
||||
$errors[] = $_SESSION['curl_error_no'].'-'.$_SESSION['curl_error_msg'];
|
||||
}
|
||||
|
||||
|
||||
foreach($resArray as $key => $value)
|
||||
{
|
||||
$errors[] = $key.'-'.$value;
|
||||
}
|
||||
|
||||
|
||||
return $errors;
|
||||
}
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
* \file htdocs/societe/socnote.php
|
||||
* \brief Tab for notes on third party
|
||||
* \ingroup societe
|
||||
* \version $Id: socnote.php,v 1.22 2011/07/13 16:24:57 eldy Exp $
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
require("../main.inc.php");
|
||||
@ -44,13 +44,13 @@ $result = restrictedArea($user, 'societe', $socid);
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == 'add' && ! GETPOST('cancel'))
|
||||
if ($action == 'add')
|
||||
{
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET note='".$db->escape($_POST["note"])."' WHERE rowid=".$_POST["socid"];
|
||||
$result = $db->query($sql);
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET note='".$db->escape($_POST["note"])."' WHERE rowid=".$_POST["socid"];
|
||||
$result = $db->query($sql);
|
||||
|
||||
$_GET["socid"]=$_POST["socid"]; // Pour retour sur fiche
|
||||
$socid = $_GET["socid"];
|
||||
$_GET["socid"]=$_POST["socid"]; // Pour retour sur fiche
|
||||
$socid = $_GET["socid"];
|
||||
}
|
||||
|
||||
|
||||
@ -70,25 +70,25 @@ if ($socid > 0)
|
||||
$societe = new Societe($db, $socid);
|
||||
$societe->fetch($socid);
|
||||
|
||||
/*
|
||||
* Affichage onglets
|
||||
*/
|
||||
/*
|
||||
* Affichage onglets
|
||||
*/
|
||||
if ($conf->notification->enabled) $langs->load("mails");
|
||||
|
||||
$head = societe_prepare_head($societe);
|
||||
$head = societe_prepare_head($societe);
|
||||
|
||||
dol_fiche_head($head, 'note', $langs->trans("ThirdParty"),0,'company');
|
||||
dol_fiche_head($head, 'note', $langs->trans("ThirdParty"),0,'company');
|
||||
|
||||
|
||||
print "<form method=\"post\" action=\"".DOL_URL_ROOT."/societe/socnote.php\">";
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print "<form method=\"post\" action=\"".DOL_URL_ROOT."/societe/socnote.php\">";
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td width="20%">'.$langs->trans('ThirdPartyName').'</td>';
|
||||
print '<td colspan="3">';
|
||||
print $form->showrefnav($societe,'socid','',($user->societe_id?0:1),'rowid','nom');
|
||||
print '</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans('ThirdPartyName').'</td>';
|
||||
print '<td colspan="3">';
|
||||
print $form->showrefnav($societe,'socid','',($user->societe_id?0:1),'rowid','nom');
|
||||
print '</td></tr>';
|
||||
|
||||
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
|
||||
{
|
||||
@ -113,36 +113,32 @@ if ($socid > 0)
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("Note").'</td>';
|
||||
print '<td valign="top">';
|
||||
if ($action == 'edit' && $user->rights->societe->creer)
|
||||
{
|
||||
print "<input type=\"hidden\" name=\"action\" value=\"add\">";
|
||||
print "<input type=\"hidden\" name=\"socid\" value=\"".$societe->id."\">";
|
||||
print '<tr><td valign="top">'.$langs->trans("Note").'</td>';
|
||||
print '<td valign="top">';
|
||||
if ($action == 'edit' && $user->rights->societe->creer)
|
||||
{
|
||||
print "<input type=\"hidden\" name=\"action\" value=\"add\">";
|
||||
print "<input type=\"hidden\" name=\"socid\" value=\"".$societe->id."\">";
|
||||
|
||||
// Editeur wysiwyg
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
|
||||
$doleditor=new DolEditor('note',$societe->note,'',360,'dolibarr_notes','In',true,false,$conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_SOCIETE,20,70);
|
||||
$doleditor->Create();
|
||||
}
|
||||
else
|
||||
{
|
||||
print dol_textishtml($societe->note)?$societe->note:dol_nl2br($societe->note,1,true);
|
||||
}
|
||||
print "</td></tr>";
|
||||
// Editeur wysiwyg
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
|
||||
$doleditor=new DolEditor('note',$societe->note,'',360,'dolibarr_notes','In',true,false,$conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_SOCIETE,20,70);
|
||||
$doleditor->Create();
|
||||
}
|
||||
else
|
||||
{
|
||||
print dol_textishtml($societe->note)?$societe->note:dol_nl2br($societe->note,1,true);
|
||||
}
|
||||
print "</td></tr>";
|
||||
|
||||
if ($action == 'edit')
|
||||
{
|
||||
print '<tr><td colspan="2" align="center">';
|
||||
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</td></tr>';
|
||||
}
|
||||
if ($action == 'edit')
|
||||
{
|
||||
print '<tr><td colspan="2" align="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></td></tr>';
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
print "</table>";
|
||||
|
||||
print '</form>';
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
@ -167,5 +163,5 @@ if ($action != 'edit')
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter('$Date: 2011/07/13 16:24:57 $ - $Revision: 1.22 $');
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
?>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user