forked from Wavyzz/dolibarr
Compare commits
89 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
af6e95aa79 | ||
|
|
5d942c9d1a | ||
|
|
10e32c056e | ||
|
|
eb7dd74026 | ||
|
|
88f6c71e88 | ||
|
|
b081cf5cba | ||
|
|
3ea9c297ea | ||
|
|
474260e526 | ||
|
|
eead9a93d3 | ||
|
|
4bdf10c995 | ||
|
|
7f759c6ff5 | ||
|
|
20aa51f26b | ||
|
|
35f32391a0 | ||
|
|
ec6e933f66 | ||
|
|
e0c8ccb9fb | ||
|
|
ef00cb0736 | ||
|
|
d7f7f5bf3d | ||
|
|
7c0a6946a7 | ||
|
|
1ecc1afa9e | ||
|
|
ceb1e699b7 | ||
|
|
c028819cab | ||
|
|
5dbf060f00 | ||
|
|
53149bb7cd | ||
|
|
394104291a | ||
|
|
b847eb1b7e | ||
|
|
2aee62ea28 | ||
|
|
7aac67f79c | ||
|
|
935e84d985 | ||
|
|
fbb8808f29 | ||
|
|
00394493eb | ||
|
|
6db7414f88 | ||
|
|
0d3a2f800b | ||
|
|
bdd57ecce7 | ||
|
|
2d59f6bb3d | ||
|
|
e8932335aa | ||
|
|
0a1f4b7931 | ||
|
|
4c4a0b796e | ||
|
|
891eaf50e1 | ||
|
|
45ea80a336 | ||
|
|
a872b7d42f | ||
|
|
cd7d3f1a36 | ||
|
|
b100cdb9db | ||
|
|
2035cbaee1 | ||
|
|
6b43c325c7 | ||
|
|
58a7640dc3 | ||
|
|
fc1d4704a5 | ||
|
|
e1ee079254 | ||
|
|
c5572e0176 | ||
|
|
162498d2f8 | ||
|
|
de3ec5682c | ||
|
|
7f127989b2 | ||
|
|
04606ec6a3 | ||
|
|
ec7ebe9f39 | ||
|
|
200b66d11f | ||
|
|
9093be2f0a | ||
|
|
b21006614c | ||
|
|
6a68c8cd99 | ||
|
|
9305403bea | ||
|
|
252bd6d9ba | ||
|
|
7c29fb614c | ||
|
|
5bac3d4d2b | ||
|
|
319bc7ec8a | ||
|
|
28218a00b3 | ||
|
|
1318e26cda | ||
|
|
4cbfb67d63 | ||
|
|
420f3bbdab | ||
|
|
5726b40a10 | ||
|
|
7fd1051efc | ||
|
|
b40041146b | ||
|
|
15fd24a511 | ||
|
|
e11bd8c70d | ||
|
|
c79b9b9704 | ||
|
|
234ad4c76a | ||
|
|
1d980342ec | ||
|
|
ba88d89ff5 | ||
|
|
b85ed3e0b7 | ||
|
|
3a99ef7319 | ||
|
|
3ae2d71ea6 | ||
|
|
91ae365588 | ||
|
|
6206519456 | ||
|
|
2e6cb2afaa | ||
|
|
dc9f8a349f | ||
|
|
80ef97e215 | ||
|
|
759427f6ac | ||
|
|
81bf7d07e3 | ||
|
|
72dd3705ed | ||
|
|
1b5cabad71 | ||
|
|
d59b1bb0c6 | ||
|
|
9d582a53ca |
10
.stickler.yml
Normal file
10
.stickler.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
linters:
|
||||
phpcs:
|
||||
standard: 'dev/setup/codesniffer/ruleset.xml'
|
||||
extensions: 'php'
|
||||
tab_width: 4
|
||||
fixer: true
|
||||
|
||||
fixers:
|
||||
enable: true
|
||||
@@ -99,6 +99,7 @@ else
|
||||
}
|
||||
|
||||
print "Release : ".$release."\n";
|
||||
print "Working on files into : ".DOL_DOCUMENT_ROOT."\n";
|
||||
print "Include custom in signature : ".$includecustom."\n";
|
||||
print "Include constants in signature : ";
|
||||
foreach ($includeconstants as $countrycode => $tmp)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2016 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2016 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* 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
|
||||
@@ -60,6 +61,7 @@ $langs->load("loans");
|
||||
llxHeader('', $langs->trans("AccountancyArea"));
|
||||
|
||||
print load_fiche_titre($langs->trans("AccountancyArea"), '', 'title_accountancy');
|
||||
dol_fiche_head();
|
||||
|
||||
$step = 0;
|
||||
|
||||
@@ -175,6 +177,7 @@ else
|
||||
{
|
||||
print $langs->trans("Module10Desc")."<br>\n";
|
||||
}
|
||||
dol_fiche_end();
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@@ -216,22 +216,22 @@ class Adherent extends CommonObject
|
||||
'__ID__'=>$this->id,
|
||||
'__MEMBER_ID__'=>$this->id,
|
||||
'__CIVILITY__'=>$this->getCivilityLabel(),
|
||||
'__FIRSTNAME__'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname,
|
||||
'__LASTNAME__'=>$msgishtml?dol_htmlentitiesbr($this->lastname):$this->lastname,
|
||||
'__FIRSTNAME__'=>$msgishtml?dol_htmlentitiesbr($this->firstname):($this->firstname?$this->firstname:''),
|
||||
'__LASTNAME__'=>$msgishtml?dol_htmlentitiesbr($this->lastname):($this->lastname?$this->lastname:''),
|
||||
'__FULLNAME__'=>$msgishtml?dol_htmlentitiesbr($this->getFullName($langs)):$this->getFullName($langs),
|
||||
'__COMPANY__'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe,
|
||||
'__ADDRESS__'=>$msgishtml?dol_htmlentitiesbr($this->address):$this->address,
|
||||
'__ZIP__'=>$msgishtml?dol_htmlentitiesbr($this->zip):$this->zip,
|
||||
'__TOWN__'=>$msgishtml?dol_htmlentitiesbr($this->town):$this->town,
|
||||
'__COUNTRY__'=>$msgishtml?dol_htmlentitiesbr($this->country):$this->country,
|
||||
'__EMAIL__'=>$msgishtml?dol_htmlentitiesbr($this->email):$this->email,
|
||||
'__BIRTH__'=>$msgishtml?dol_htmlentitiesbr($birthday):$birthday,
|
||||
'__PHOTO__'=>$msgishtml?dol_htmlentitiesbr($this->photo):$this->photo,
|
||||
'__LOGIN__'=>$msgishtml?dol_htmlentitiesbr($this->login):$this->login,
|
||||
'__PASSWORD__'=>$msgishtml?dol_htmlentitiesbr($this->pass):$this->pass,
|
||||
'__PHONE__'=>$msgishtml?dol_htmlentitiesbr($this->phone):$this->phone,
|
||||
'__PHONEPRO__'=>$msgishtml?dol_htmlentitiesbr($this->phone_perso):$this->phone_perso,
|
||||
'__PHONEMOBILE__'=>$msgishtml?dol_htmlentitiesbr($this->phone_mobile):$this->phone_mobile,
|
||||
'__COMPANY__'=>$msgishtml?dol_htmlentitiesbr($this->societe):($this->societe?$this->societe:''),
|
||||
'__ADDRESS__'=>$msgishtml?dol_htmlentitiesbr($this->address):($this->address?$this->address:''),
|
||||
'__ZIP__'=>$msgishtml?dol_htmlentitiesbr($this->zip):($this->zip?$this->zip:''),
|
||||
'__TOWN__'=>$msgishtml?dol_htmlentitiesbr($this->town):($this->town?$this->town:''),
|
||||
'__COUNTRY__'=>$msgishtml?dol_htmlentitiesbr($this->country):($this->country?$this->country:''),
|
||||
'__EMAIL__'=>$msgishtml?dol_htmlentitiesbr($this->email):($this->email?$this->email:''),
|
||||
'__BIRTH__'=>$msgishtml?dol_htmlentitiesbr($birthday):($birthday?$birthday:''),
|
||||
'__PHOTO__'=>$msgishtml?dol_htmlentitiesbr($this->photo):($this->photo?$this->photo:''),
|
||||
'__LOGIN__'=>$msgishtml?dol_htmlentitiesbr($this->login):($this->login?$this->login:''),
|
||||
'__PASSWORD__'=>$msgishtml?dol_htmlentitiesbr($this->pass):($this->pass?$this->pass:''),
|
||||
'__PHONE__'=>$msgishtml?dol_htmlentitiesbr($this->phone):($this->phone?$this->phone:''),
|
||||
'__PHONEPRO__'=>$msgishtml?dol_htmlentitiesbr($this->phone_perso):($this->phone_perso?$this->phone_perso:''),
|
||||
'__PHONEMOBILE__'=>$msgishtml?dol_htmlentitiesbr($this->phone_mobile):($this->phone_mobile?$this->phone_mobile:'')
|
||||
);
|
||||
|
||||
complete_substitutions_array($substitutionarray, $langs, $this);
|
||||
|
||||
@@ -264,7 +264,7 @@ if ($search_month_date_when > 0)
|
||||
if ($search_year_date_when > 0 && empty($search_day_date_when))
|
||||
$sql.= " AND f.date_when BETWEEN '".$db->idate(dol_get_first_day($search_year_date_when,$search_month_date_when,false))."' AND '".$db->idate(dol_get_last_day($search_year_date_when,$search_month_date_when,false))."'";
|
||||
else if ($search_year_date_when > 0 && ! empty($search_day_date_when))
|
||||
$sql.= " AND f.date_date_when_reglement BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month_date_when, $search_day_date_when, $search_year_date_when))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month_date_when, $search_day_date_when, $search_year_date_when))."'";
|
||||
$sql.= " AND f.date_when BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month_date_when, $search_day_date_when, $search_year_date_when))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month_date_when, $search_day_date_when, $search_year_date_when))."'";
|
||||
else
|
||||
$sql.= " AND date_format(f.date_when, '%m') = '".$db->escape($search_month_date_when)."'";
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ $sql.= " AND pl.fk_prelevement_bons = p.rowid";
|
||||
$sql.= " AND f.fk_soc = s.rowid";
|
||||
$sql.= " AND pf.fk_facture = f.rowid";
|
||||
$sql.= " AND f.entity = ".$conf->entity;
|
||||
if ($prev_id) $sql.= " AND p.rowid=".$prev_id;
|
||||
if ($object->id) $sql.= " AND p.rowid=".$object->id;
|
||||
if ($socid) $sql.= " AND s.rowid = ".$socid;
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
|
||||
@@ -291,17 +291,17 @@ class ChargeSociales extends CommonObject
|
||||
$sql.= ", date_ech='".$this->db->idate($this->date_ech)."'";
|
||||
$sql.= ", periode='".$this->db->idate($this->periode)."'";
|
||||
$sql.= ", amount='".price2num($this->amount,'MT')."'";
|
||||
$sql.= ", fk_projet='".$this->db->escape($this->fk_project)."'";
|
||||
$sql.= ", fk_projet=".($this->fk_project>0?$this->db->escape($this->fk_project):"NULL");
|
||||
$sql.= ", fk_user_modif=".$user->id;
|
||||
$sql.= " WHERE rowid=".$this->id;
|
||||
|
||||
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
|
||||
|
||||
if (! $resql) {
|
||||
$error++; $this->errors[]="Error ".$this->db->lasterror();
|
||||
}
|
||||
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
if (! $notrigger)
|
||||
@@ -312,7 +312,7 @@ class ChargeSociales extends CommonObject
|
||||
// End call triggers
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Commit or rollback
|
||||
if ($error)
|
||||
{
|
||||
@@ -329,8 +329,8 @@ class ChargeSociales extends CommonObject
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2014-2019 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
|
||||
@@ -46,14 +46,14 @@ $show_files=GETPOST('show_files','int');
|
||||
$confirm=GETPOST('confirm','alpha');
|
||||
$toselect = GETPOST('toselect', 'array');
|
||||
|
||||
$search_name=GETPOST('search_name');
|
||||
$search_email=GETPOST('search_email');
|
||||
$search_name=GETPOST('search_name', 'alpha');
|
||||
$search_email=GETPOST('search_email', 'alpha');
|
||||
$search_town=GETPOST('search_town','alpha');
|
||||
$search_zip=GETPOST('search_zip','alpha');
|
||||
$search_state=trim(GETPOST("search_state"));
|
||||
$search_country=GETPOST("search_country",'int');
|
||||
$search_type_thirdparty=GETPOST("search_type_thirdparty",'int');
|
||||
$search_contract=GETPOST('search_contract');
|
||||
$search_contract=GETPOST('search_contract','alpha');
|
||||
$search_ref_customer=GETPOST('search_ref_customer','alpha');
|
||||
$search_ref_supplier=GETPOST('search_ref_supplier','alpha');
|
||||
$sall=trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml'));
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2019 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -46,9 +47,9 @@ if (! $sortorder) $sortorder="ASC";
|
||||
|
||||
$mode = GETPOST("mode");
|
||||
$filter=GETPOST("filter");
|
||||
$search_name=GETPOST("search_name");
|
||||
$search_contract=GETPOST("search_contract");
|
||||
$search_service=GETPOST("search_service");
|
||||
$search_name=GETPOST("search_name", 'alpha');
|
||||
$search_contract=GETPOST("search_contract", 'alpha');
|
||||
$search_service=GETPOST("search_service", 'alpha');
|
||||
$search_status=GETPOST("search_status","alpha");
|
||||
$statut=GETPOST('statut')?GETPOST('statut'):1;
|
||||
$search_product_category=GETPOST('search_product_category','int');
|
||||
|
||||
@@ -69,6 +69,8 @@ if (! $error && $massaction == 'confirm_presend')
|
||||
$listofobjectid=array();
|
||||
$listofobjectthirdparties=array();
|
||||
$listofobjectref=array();
|
||||
$attachedfilesThirdpartyObj=array();
|
||||
$oneemailperrecipient=(GETPOST('oneemailperrecipient')=='on'?1:0);
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
@@ -93,7 +95,7 @@ if (! $error && $massaction == 'confirm_presend')
|
||||
}
|
||||
|
||||
// Check mandatory parameters
|
||||
if (empty($user->email))
|
||||
if (GETPOST('fromtype','alpha') === 'user' && empty($user->email))
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($langs->trans("NoSenderEmailDefined"), null, 'warnings');
|
||||
@@ -193,7 +195,6 @@ if (! $error && $massaction == 'confirm_presend')
|
||||
$sendtocc=implode(',',$tmparray);
|
||||
|
||||
//var_dump($listofobjectref);exit;
|
||||
$attachedfiles=array('paths'=>array(), 'names'=>array(), 'mimes'=>array());
|
||||
$listofqualifiedobj=array();
|
||||
$listofqualifiedref=array();
|
||||
$thirdpartywithoutemail=array();
|
||||
@@ -208,7 +209,7 @@ if (! $error && $massaction == 'confirm_presend')
|
||||
$resaction.='<div class="error">'.$langs->trans('ErrorOnlyProposalNotDraftCanBeSentInMassAction',$objectobj->ref).'</div><br>';
|
||||
continue; // Payment done or started or canceled
|
||||
}
|
||||
if ($objectclass == 'Commande' && $objectoj->statut == Commande::STATUS_DRAFT)
|
||||
if ($objectclass == 'Commande' && $objectobj->statut == Commande::STATUS_DRAFT)
|
||||
{
|
||||
$langs->load("errors");
|
||||
$nbignored++;
|
||||
@@ -263,12 +264,12 @@ if (! $error && $massaction == 'confirm_presend')
|
||||
|
||||
if (dol_is_file($file))
|
||||
{
|
||||
// Create form object
|
||||
$attachedfiles=array(
|
||||
'paths'=>array_merge($attachedfiles['paths'],array($file)),
|
||||
'names'=>array_merge($attachedfiles['names'],array($filename)),
|
||||
'mimes'=>array_merge($attachedfiles['mimes'],array($mime))
|
||||
);
|
||||
// Create form object
|
||||
$attachedfilesThirdpartyObj[$thirdpartyid][$objectid]=array(
|
||||
'paths'=>array($file),
|
||||
'names'=>array($filename),
|
||||
'mimes'=>array($mime)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -333,12 +334,16 @@ if (! $error && $massaction == 'confirm_presend')
|
||||
if ($objectclass == 'CommandeFournisseur') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO));
|
||||
if ($objectclass == 'FactureFournisseur') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO));
|
||||
|
||||
// $listofqualifiedobj is array with key = object id of qualified objects for the current thirdparty
|
||||
$oneemailperrecipient=(GETPOST('oneemailperrecipient')=='on'?1:0);
|
||||
// $listofqualifiedobj is array with key = object id and value is instance of qualified objects, for the current thirdparty (but thirdparty property is not loaded yet)
|
||||
|
||||
$looparray=array();
|
||||
if (! $oneemailperrecipient)
|
||||
{
|
||||
$looparray = $listofqualifiedobj;
|
||||
foreach ($looparray as $key => $objecttmp)
|
||||
{
|
||||
$looparray[$key]->thirdparty = $thirdparty;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -347,8 +352,9 @@ if (! $error && $massaction == 'confirm_presend')
|
||||
$looparray[0]=$objectforloop;
|
||||
}
|
||||
//var_dump($looparray);exit;
|
||||
|
||||
foreach ($looparray as $objecttmp) // $objecttmp is a real object or an empty if we choose to send one email per thirdparty instead of per record
|
||||
dol_syslog("We have set an array of ".count($looparray)." emails to send. oneemailperrecipient=".$oneemailperrecipient);
|
||||
//var_dump($oneemailperrecipient); var_dump($listofqualifiedobj); var_dump($listofqualifiedref);
|
||||
foreach ($looparray as $objectid => $objecttmp) // $objecttmp is a real object or an empty object if we choose to send one email per thirdparty instead of one per object
|
||||
{
|
||||
// Make substitution in email content
|
||||
$substitutionarray=getCommonSubstitutionArray($langs, 0, null, $objecttmp);
|
||||
@@ -358,20 +364,54 @@ if (! $error && $massaction == 'confirm_presend')
|
||||
$substitutionarray['__CHECK_READ__'] = '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>';
|
||||
|
||||
$parameters=array('mode'=>'formemail');
|
||||
|
||||
if ( ! empty( $listofobjectthirdparties ) ) {
|
||||
$parameters['listofobjectthirdparties'] = $listofobjectthirdparties;
|
||||
}
|
||||
if ( ! empty( $listofobjectref ) ) {
|
||||
$parameters['listofobjectref'] = $listofobjectref;
|
||||
}
|
||||
|
||||
complete_substitutions_array($substitutionarray, $langs, $objecttmp, $parameters);
|
||||
|
||||
$subject=make_substitutions($subject, $substitutionarray);
|
||||
$message=make_substitutions($message, $substitutionarray);
|
||||
$subjectreplaced=make_substitutions($subject, $substitutionarray);
|
||||
$messagereplaced=make_substitutions($message, $substitutionarray);
|
||||
|
||||
|
||||
$attachedfiles=array('paths'=>array(), 'names'=>array(), 'mimes'=>array());
|
||||
if($oneemailperrecipient)
|
||||
{
|
||||
// if "one email per recipient" isn't check we must collate $attachedfiles by thirdparty
|
||||
if(is_array($attachedfilesThirdpartyObj[$thirdparty->id]) && count($attachedfilesThirdpartyObj[$thirdparty->id]))
|
||||
{
|
||||
foreach ($attachedfilesThirdpartyObj[$thirdparty->id] as $keyObjId => $objAttachedFiles){
|
||||
// Create form object
|
||||
$attachedfiles=array(
|
||||
'paths'=>array_merge($attachedfiles['paths'], $objAttachedFiles['paths']),
|
||||
'names'=>array_merge($attachedfiles['names'], $objAttachedFiles['names']),
|
||||
'mimes'=>array_merge($attachedfiles['mimes'], $objAttachedFiles['mimes'])
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif(!empty($attachedfilesThirdpartyObj[$thirdparty->id][$objectid])){
|
||||
// Create form object
|
||||
// if "one email per recipient" isn't check we must separate $attachedfiles by object
|
||||
$attachedfiles=$attachedfilesThirdpartyObj[$thirdparty->id][$objectid];
|
||||
}
|
||||
|
||||
$filepath = $attachedfiles['paths'];
|
||||
$filename = $attachedfiles['names'];
|
||||
$mimetype = $attachedfiles['mimes'];
|
||||
|
||||
|
||||
|
||||
|
||||
//var_dump($filepath);
|
||||
|
||||
// Send mail (substitutionarray must be done just before this)
|
||||
require_once(DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php');
|
||||
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1);
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||
$mailfile = new CMailFile($subjectreplaced, $sendto, $from, $messagereplaced, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, -1);
|
||||
if ($mailfile->error)
|
||||
{
|
||||
$resaction.='<div class="error">'.$mailfile->error.'</div>';
|
||||
@@ -386,8 +426,12 @@ if (! $error && $massaction == 'confirm_presend')
|
||||
$error=0;
|
||||
|
||||
// Insert logs into agenda
|
||||
foreach($listofqualifiedobj as $objid => $objectobj)
|
||||
foreach($listofqualifiedobj as $objid2 => $objectobj2)
|
||||
{
|
||||
if ((! $oneemailperrecipient) && $objid2 != $objectid) continue; // We discard this pass to avoid duplicate with other pass in looparray at higher level
|
||||
|
||||
dol_syslog("Try to insert email event into agenda for objid=".$objid2." => objectobj=".get_class($objectobj2));
|
||||
|
||||
/*if ($objectclass == 'Propale') $actiontypecode='AC_PROP';
|
||||
if ($objectclass == 'Commande') $actiontypecode='AC_COM';
|
||||
if ($objectclass == 'Facture') $actiontypecode='AC_FAC';
|
||||
@@ -399,18 +443,18 @@ if (! $error && $massaction == 'confirm_presend')
|
||||
if ($message)
|
||||
{
|
||||
if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
|
||||
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
|
||||
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subjectreplaced);
|
||||
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
|
||||
$actionmsg = dol_concatdesc($actionmsg, $message);
|
||||
$actionmsg = dol_concatdesc($actionmsg, $messagereplaced);
|
||||
}
|
||||
$actionmsg2='';
|
||||
|
||||
// Initialisation donnees
|
||||
$objectobj->sendtoid = 0;
|
||||
$objectobj->actionmsg = $actionmsg; // Long text
|
||||
$objectobj->actionmsg2 = $actionmsg2; // Short text
|
||||
$objectobj->fk_element = $objid;
|
||||
$objectobj->elementtype = $objectobj->element;
|
||||
$objectobj2->sendtoid = 0;
|
||||
$objectobj2->actionmsg = $actionmsg; // Long text
|
||||
$objectobj2->actionmsg2 = $actionmsg2; // Short text
|
||||
$objectobj2->fk_element = $objid2;
|
||||
$objectobj2->elementtype = $objectobj2->element;
|
||||
|
||||
$triggername = strtoupper(get_class($objectobj)) .'_SENTBYMAIL';
|
||||
if ($triggername == 'SOCIETE_SENTBYMAIL') $triggername = 'COMPANY_SENTBYEMAIL';
|
||||
@@ -425,9 +469,9 @@ if (! $error && $massaction == 'confirm_presend')
|
||||
if (! empty($triggername))
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||
include_once DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php";
|
||||
$interface=new Interfaces($db);
|
||||
$result=$interface->run_triggers($triggername, $objectobj, $user, $langs, $conf);
|
||||
$result=$interface->run_triggers($triggername, $objectobj2, $user, $langs, $conf);
|
||||
if ($result < 0) { $error++; $errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
|
||||
@@ -437,9 +481,9 @@ if (! $error && $massaction == 'confirm_presend')
|
||||
dol_syslog("Error in trigger ".$triggername.' '.$db->lasterror(), LOG_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
$nbsent++;
|
||||
}
|
||||
|
||||
$nbsent++; // Nb of email sent (may be lower than number of record selected if we group thirdparties)
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -504,13 +548,15 @@ if ($massaction == 'confirm_createbills')
|
||||
$objecttmp = new Facture($db);
|
||||
if (!empty($createbills_onebythird) && !empty($TFactThird[$cmd->socid])) $objecttmp = $TFactThird[$cmd->socid]; // If option "one bill per third" is set, we use already created order.
|
||||
else {
|
||||
// Load extrafields of order
|
||||
$cmd->fetch_optionals();
|
||||
|
||||
$objecttmp->socid = $cmd->socid;
|
||||
$objecttmp->type = Facture::TYPE_STANDARD;
|
||||
$objecttmp->cond_reglement_id = $cmd->cond_reglement_id;
|
||||
$objecttmp->mode_reglement_id = $cmd->mode_reglement_id;
|
||||
$objecttmp->fk_project = $cmd->fk_project;
|
||||
|
||||
$objecttmp->multicurrency_code = $cmd->multicurrency_code;
|
||||
$datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
|
||||
if (empty($datefacture))
|
||||
{
|
||||
@@ -521,6 +567,8 @@ if ($massaction == 'confirm_createbills')
|
||||
$objecttmp->origin = 'commande';
|
||||
$objecttmp->origin_id = $id_order;
|
||||
|
||||
$objecttmp->array_options = $cmd->array_options; // Copy extrafields
|
||||
|
||||
$res = $objecttmp->create($user);
|
||||
|
||||
if($res > 0) $nb_bills_created++;
|
||||
@@ -560,6 +608,12 @@ if ($massaction == 'confirm_createbills')
|
||||
for ($i=0;$i<$num;$i++)
|
||||
{
|
||||
$desc=($lines[$i]->desc?$lines[$i]->desc:$lines[$i]->libelle);
|
||||
// If we build one invoice for several order, we must put the invoice of order on the line
|
||||
if (! empty($createbills_onebythird))
|
||||
{
|
||||
$desc=dol_concatdesc($desc, $langs->trans("Order").' '.$cmd->ref.' - '.dol_print_date($cmd->date, 'day', $langs));
|
||||
}
|
||||
|
||||
if ($lines[$i]->subprice < 0)
|
||||
{
|
||||
// Negative line, we create a discount line
|
||||
@@ -670,6 +724,7 @@ if ($massaction == 'confirm_createbills')
|
||||
if (! $error && $validate_invoices)
|
||||
{
|
||||
$massaction = $action = 'builddoc';
|
||||
|
||||
foreach($TAllFact as &$objecttmp)
|
||||
{
|
||||
$result = $objecttmp->validate($user);
|
||||
@@ -687,7 +742,12 @@ if ($massaction == 'confirm_createbills')
|
||||
$donotredirect = 1;
|
||||
$upload_dir = $conf->facture->dir_output;
|
||||
$permissioncreate=$user->rights->facture->creer;
|
||||
|
||||
// Call action to build doc
|
||||
$savobject = $object;
|
||||
$object = $objecttmp;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||
$object = $savobject;
|
||||
}
|
||||
|
||||
$massaction = $action = 'confirm_createbills';
|
||||
@@ -696,7 +756,7 @@ if ($massaction == 'confirm_createbills')
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
setEventMessage($langs->trans('BillCreated', $nb_bills_created));
|
||||
setEventMessages($langs->trans('BillCreated', $nb_bills_created), null, 'mesgs');
|
||||
|
||||
// Make a redirect to avoid to bill twice if we make a refresh or back
|
||||
$param='';
|
||||
|
||||
@@ -43,7 +43,7 @@ if (GETPOST('addfile','alpha'))
|
||||
$vardir=$conf->user->dir_output."/".$user->id;
|
||||
$upload_dir_tmp = $vardir.'/temp'; // TODO Add $keytoavoidconflict in upload_dir path
|
||||
|
||||
dol_add_file_process($upload_dir_tmp, 0, 0, 'addedfile', '', null, $trackid);
|
||||
dol_add_file_process($upload_dir_tmp, 1, 0, 'addedfile', '', null, $trackid);
|
||||
$action='presend';
|
||||
}
|
||||
|
||||
@@ -460,7 +460,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
||||
$mesg='<div class="error">';
|
||||
if ($mailfile->error)
|
||||
{
|
||||
$mesg.=$langs->trans('ErrorFailedToSendMail',$from,$sendto);
|
||||
$mesg.=$langs->transnoentities('ErrorFailedToSendMail',dol_escape_htmltag($from),dol_escape_htmltag($sendto));
|
||||
$mesg.='<br>'.$mailfile->error;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -908,7 +908,6 @@ class FormMail extends Form
|
||||
$defaultmessage=preg_replace("/^(<br>)+/","",$defaultmessage);
|
||||
$defaultmessage=preg_replace("/^\n+/","",$defaultmessage);
|
||||
}
|
||||
|
||||
$out.= '<tr>';
|
||||
$out.= '<td valign="top">'.$langs->trans("MailText").'</td>';
|
||||
$out.= '<td>';
|
||||
|
||||
@@ -372,9 +372,9 @@ class FormOther
|
||||
* @param string $morecss More CSS
|
||||
* @return string Html combo list code
|
||||
*/
|
||||
function select_salesrepresentatives($selected,$htmlname,$user,$showstatus=0,$showempty=1,$morecss='')
|
||||
function select_salesrepresentatives($selected, $htmlname, $user, $showstatus=0, $showempty=1, $morecss='')
|
||||
{
|
||||
global $conf,$langs;
|
||||
global $conf, $langs;
|
||||
$langs->load('users');
|
||||
|
||||
$out = '';
|
||||
@@ -396,17 +396,44 @@ class FormOther
|
||||
// Get list of users allowed to be viewed
|
||||
$sql_usr = "SELECT u.rowid, u.lastname, u.firstname, u.statut, u.login";
|
||||
$sql_usr.= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||
$sql_usr.= " WHERE u.entity IN (0,".$conf->entity.")";
|
||||
|
||||
if (! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))
|
||||
{
|
||||
if (! empty($user->admin) && empty($user->entity) && $conf->entity == 1) {
|
||||
$sql_usr.= " WHERE u.entity IS NOT NULL"; // Show all users
|
||||
} else {
|
||||
$sql_usr.= " WHERE EXISTS (SELECT ug.fk_user FROM ".MAIN_DB_PREFIX."usergroup_user as ug WHERE u.rowid = ug.fk_user AND ug.entity IN (".getEntity('user')."))";
|
||||
$sql_usr.= " OR u.entity = 0"; // Show always superadmin
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql_usr.= " WHERE u.entity IN (".getEntity('user').")";
|
||||
}
|
||||
|
||||
if (empty($user->rights->user->user->lire)) $sql_usr.=" AND u.rowid = ".$user->id;
|
||||
if (! empty($user->societe_id)) $sql_usr.=" AND u.fk_soc = ".$user->societe_id;
|
||||
if (! empty($user->socid)) $sql_usr.=" AND u.fk_soc = ".$user->socid;
|
||||
// Add existing sales representatives of thirdparty of external user
|
||||
if (empty($user->rights->user->user->lire) && $user->societe_id)
|
||||
if (empty($user->rights->user->user->lire) && $user->socid)
|
||||
{
|
||||
$sql_usr.=" UNION ";
|
||||
$sql_usr.= "SELECT u2.rowid, u2.lastname, u2.firstname, u2.statut, u2.login";
|
||||
$sql_usr.= " FROM ".MAIN_DB_PREFIX."user as u2, ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql_usr.= " WHERE u2.entity IN (0,".$conf->entity.")";
|
||||
$sql_usr.= " AND u2.rowid = sc.fk_user AND sc.fk_soc=".$user->societe_id;
|
||||
|
||||
if (! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))
|
||||
{
|
||||
if (! empty($user->admin) && empty($user->entity) && $conf->entity == 1) {
|
||||
$sql_usr.= " WHERE u2.entity IS NOT NULL"; // Show all users
|
||||
} else {
|
||||
$sql_usr.= " WHERE EXISTS (SELECT ug2.fk_user FROM ".MAIN_DB_PREFIX."usergroup_user as ug2 WHERE u2.rowid = ug2.fk_user AND ug2.entity IN (".getEntity('user')."))";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql_usr.= " WHERE u2.entity IN (".getEntity('user').")";
|
||||
}
|
||||
|
||||
$sql_usr.= " AND u2.rowid = sc.fk_user AND sc.fk_soc=".$user->socid;
|
||||
}
|
||||
$sql_usr.= " ORDER BY statut DESC, lastname ASC"; // Do not use 'ORDER BY u.statut' here, not compatible with the UNION.
|
||||
//print $sql_usr;exit;
|
||||
|
||||
@@ -291,18 +291,20 @@ class Utils
|
||||
$ok=0;
|
||||
dol_syslog("Run command ".$fullcommandcrypted);
|
||||
$handlein = popen($fullcommandclear, 'r');
|
||||
$i=0;
|
||||
while (!feof($handlein))
|
||||
{
|
||||
$i++; // output line number
|
||||
$read = fgets($handlein);
|
||||
// Exclude warning line we don't want
|
||||
if ($i == 1 && preg_match('/Warning.*Using a password/i', $read)) continue;
|
||||
fwrite($handle,$read);
|
||||
if (preg_match('/'.preg_quote('-- Dump completed').'/i',$read)) $ok=1;
|
||||
elseif (preg_match('/'.preg_quote('SET SQL_NOTES=@OLD_SQL_NOTES').'/i',$read)) $ok=1;
|
||||
if ($handlein) {
|
||||
$i=0;
|
||||
while (!feof($handlein))
|
||||
{
|
||||
$i++; // output line number
|
||||
$read = fgets($handlein);
|
||||
// Exclude warning line we don't want
|
||||
if ($i == 1 && preg_match('/Warning.*Using a password/i', $read)) continue;
|
||||
fwrite($handle,$read);
|
||||
if (preg_match('/'.preg_quote('-- Dump completed').'/i',$read)) $ok=1;
|
||||
elseif (preg_match('/'.preg_quote('SET SQL_NOTES=@OLD_SQL_NOTES').'/i',$read)) $ok=1;
|
||||
}
|
||||
pclose($handlein);
|
||||
}
|
||||
pclose($handlein);
|
||||
|
||||
if ($compression == 'none') fclose($handle);
|
||||
if ($compression == 'gz') gzclose($handle);
|
||||
|
||||
@@ -739,7 +739,7 @@ function show_projects($conf, $langs, $db, $object, $backtopage='', $nocreatelin
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr class="oddeven"><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
print '<tr class="oddeven"><td colspan="8" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
$db->free($result);
|
||||
}
|
||||
|
||||
@@ -1540,6 +1540,11 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio
|
||||
$info = pathinfo($destfile);
|
||||
$destfile = dol_sanitizeFileName($info['filename'].'.'.strtolower($info['extension']));
|
||||
|
||||
// We apply dol_string_nohtmltag also to clean file names (this remove duplicate spaces) because
|
||||
// this function is also applied when we make try to download file (by the GETPOST(filename, 'alphanohtml') call).
|
||||
$destfile = dol_string_nohtmltag($destfile);
|
||||
$destfull = dol_string_nohtmltag($destfull);
|
||||
|
||||
$resupload = dol_move_uploaded_file($TFile['tmp_name'][$i], $destfull, $allowoverwrite, 0, $TFile['error'][$i], 0, $varfiles);
|
||||
|
||||
if (is_numeric($resupload) && $resupload > 0) // $resupload can be 'ErrorFileAlreadyExists'
|
||||
|
||||
@@ -1376,6 +1376,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
|
||||
$fileimagebis = $file.'_preview-0.png'; // If PDF has more than one page
|
||||
$relativepathimage = $relativepath.'_preview.png';
|
||||
|
||||
|
||||
// Si fichier PDF existe
|
||||
if (file_exists($file))
|
||||
{
|
||||
@@ -1387,7 +1388,8 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
|
||||
{
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_THUMBS)) // If you experienc trouble with pdf thumb generation and imagick, you can disable here.
|
||||
{
|
||||
$ret = dol_convert_file($file, 'png', $fileimage);
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
$ret = dol_convert_file($file, 'png', $fileimage);
|
||||
if ($ret < 0) $error++;
|
||||
}
|
||||
}
|
||||
@@ -5733,6 +5735,8 @@ function make_substitutions($text, $substitutionarray, $outputlangs=null)
|
||||
// Make substitition for array $substitutionarray
|
||||
foreach ($substitutionarray as $key => $value)
|
||||
{
|
||||
if (! isset($value)) continue; // If value is null, it same than not having substitution key at all into array, we do not replace.
|
||||
|
||||
if ($key == '__SIGNATURE__' && (! empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))) $value=''; // Protection
|
||||
if ($key == '__USER_SIGNATURE__' && (! empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))) $value=''; // Protection
|
||||
|
||||
|
||||
@@ -1244,6 +1244,10 @@ function check_value($mask,$value)
|
||||
if (! empty($reg[3]) && preg_match('/^@/',$reg[3])) $maskraz=preg_replace('/^@/','',$reg[3]);
|
||||
if ($maskraz >= 0)
|
||||
{
|
||||
if ($maskraz == 99) {
|
||||
$maskraz = date('m');
|
||||
$resetEveryMonth = true;
|
||||
}
|
||||
if ($maskraz > 12) return 'ErrorBadMaskBadRazMonth';
|
||||
|
||||
// Define reg
|
||||
|
||||
@@ -393,7 +393,11 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
|
||||
}
|
||||
}
|
||||
// Make substitutions into odt of thirdparty
|
||||
$tmparray=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
|
||||
if ($socobject->element == 'contact') {
|
||||
$tmparray = $this->get_substitutionarray_contact($socobject, $outputlangs);
|
||||
} else {
|
||||
$tmparray = $this->get_substitutionarray_thirdparty($socobject, $outputlangs);
|
||||
}
|
||||
foreach($tmparray as $key=>$value)
|
||||
{
|
||||
try {
|
||||
|
||||
@@ -278,9 +278,9 @@ class modAdherent extends DolibarrModules
|
||||
$this->export_code[$r]=$this->rights_class.'_'.$r;
|
||||
$this->export_label[$r]='MembersAndSubscriptions';
|
||||
$this->export_permission[$r]=array(array("adherent","export"));
|
||||
$this->export_fields_array[$r]=array('a.rowid'=>'Id','a.civility'=>"UserTitle",'a.lastname'=>"Lastname",'a.firstname'=>"Firstname",'a.login'=>"Login",'a.morphy'=>'Nature','a.societe'=>'Company','a.address'=>"Address",'a.zip'=>"Zip",'a.town'=>"Town",'d.nom'=>"State",'co.code'=>"CountryCode",'co.label'=>"Country",'a.phone'=>"PhonePro",'a.phone_perso'=>"PhonePerso",'a.phone_mobile'=>"PhoneMobile",'a.email'=>"Email",'a.birth'=>"Birthday",'a.statut'=>"Status",'a.photo'=>"Photo",'a.note_public'=>"NotePublic",'a.note_private'=>"NotePrivate",'a.datec'=>'DateCreation','a.datevalid'=>'DateValidation','a.tms'=>'DateLastModification','a.datefin'=>'DateEndSubscription','ta.rowid'=>'MemberTypeId','ta.libelle'=>'MemberTypeLabel','c.rowid'=>'SubscriptionId','c.dateadh'=>'DateSubscription','c.subscription'=>'Amount');
|
||||
$this->export_TypeFields_array[$r]=array('a.civility'=>"Text",'a.lastname'=>"Text",'a.firstname'=>"Text",'a.login'=>"Text",'a.morphy'=>'Text','a.societe'=>'Text','a.address'=>"Text",'a.zip'=>"Text",'a.town'=>"Text",'d.nom'=>"Text",'co.code'=>'Text','co.label'=>"Text",'a.phone'=>"Text",'a.phone_perso'=>"Text",'a.phone_mobile'=>"Text",'a.email'=>"Text",'a.birth'=>"Date",'a.statut'=>"Status",'a.note_public'=>"Text",'a.note_private'=>"Text",'a.datec'=>'Date','a.datevalid'=>'Date','a.tms'=>'Date','a.datefin'=>'Date','ta.rowid'=>'List:adherent_type:libelle','ta.libelle'=>'Text','c.rowid'=>'Numeric','c.dateadh'=>'Date','c.subscription'=>'Numeric');
|
||||
$this->export_entities_array[$r]=array('a.rowid'=>'member','a.civility'=>"member",'a.lastname'=>"member",'a.firstname'=>"member",'a.login'=>"member",'a.morphy'=>'member','a.societe'=>'member','a.address'=>"member",'a.zip'=>"member",'a.town'=>"member",'d.nom'=>"member",'co.code'=>"member",'co.label'=>"member",'a.phone'=>"member",'a.phone_perso'=>"member",'a.phone_mobile'=>"member",'a.email'=>"member",'a.birth'=>"member",'a.statut'=>"member",'a.photo'=>"member",'a.note_public'=>"member",'a.note_private'=>"member",'a.datec'=>'member','a.datevalid'=>'member','a.tms'=>'member','a.datefin'=>'member','ta.rowid'=>'member_type','ta.libelle'=>'member_type','c.rowid'=>'subscription','c.dateadh'=>'subscription','c.subscription'=>'subscription');
|
||||
$this->export_fields_array[$r]=array('a.rowid'=>'Id','a.civility'=>"UserTitle",'a.lastname'=>"Lastname",'a.firstname'=>"Firstname",'a.login'=>"Login",'a.morphy'=>'Nature','a.societe'=>'Company','a.address'=>"Address",'a.zip'=>"Zip",'a.town'=>"Town",'d.nom'=>"State",'co.code'=>"CountryCode",'co.label'=>"Country",'a.phone'=>"PhonePro",'a.phone_perso'=>"PhonePerso",'a.phone_mobile'=>"PhoneMobile",'a.email'=>"Email",'a.birth'=>"Birthday",'a.statut'=>"Status",'a.photo'=>"Photo",'a.note_public'=>"NotePublic",'a.note_private'=>"NotePrivate",'a.datec'=>'DateCreation','a.datevalid'=>'DateValidation','a.tms'=>'DateLastModification','a.datefin'=>'DateEndSubscription','ta.rowid'=>'MemberTypeId','ta.libelle'=>'MemberTypeLabel','c.rowid'=>'SubscriptionId','c.dateadh'=>'DateSubscription','c.datef'=>'DateEndSubscription','c.subscription'=>'Amount');
|
||||
$this->export_TypeFields_array[$r]=array('a.civility'=>"Text",'a.lastname'=>"Text",'a.firstname'=>"Text",'a.login'=>"Text",'a.morphy'=>'Text','a.societe'=>'Text','a.address'=>"Text",'a.zip'=>"Text",'a.town'=>"Text",'d.nom'=>"Text",'co.code'=>'Text','co.label'=>"Text",'a.phone'=>"Text",'a.phone_perso'=>"Text",'a.phone_mobile'=>"Text",'a.email'=>"Text",'a.birth'=>"Date",'a.statut'=>"Status",'a.note_public'=>"Text",'a.note_private'=>"Text",'a.datec'=>'Date','a.datevalid'=>'Date','a.tms'=>'Date','a.datefin'=>'Date','ta.rowid'=>'List:adherent_type:libelle','ta.libelle'=>'Text','c.rowid'=>'Numeric','c.dateadh'=>'Date','c.datef'=>'Date','c.subscription'=>'Numeric');
|
||||
$this->export_entities_array[$r]=array('a.rowid'=>'member','a.civility'=>"member",'a.lastname'=>"member",'a.firstname'=>"member",'a.login'=>"member",'a.morphy'=>'member','a.societe'=>'member','a.address'=>"member",'a.zip'=>"member",'a.town'=>"member",'d.nom'=>"member",'co.code'=>"member",'co.label'=>"member",'a.phone'=>"member",'a.phone_perso'=>"member",'a.phone_mobile'=>"member",'a.email'=>"member",'a.birth'=>"member",'a.statut'=>"member",'a.photo'=>"member",'a.note_public'=>"member",'a.note_private'=>"member",'a.datec'=>'member','a.datevalid'=>'member','a.tms'=>'member','a.datefin'=>'member','ta.rowid'=>'member_type','ta.libelle'=>'member_type','c.rowid'=>'subscription','c.dateadh'=>'subscription','c.datef'=>'subscription','c.subscription'=>'subscription');
|
||||
// Add extra fields
|
||||
$keyforselect='adherent'; $keyforelement='member'; $keyforaliasextra='extra';
|
||||
include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
|
||||
|
||||
@@ -247,8 +247,8 @@ class modProjet extends DolibarrModules
|
||||
$keyforselect='projet'; $keyforelement='project'; $keyforaliasextra='extra';
|
||||
include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
|
||||
// Add fields for tasks
|
||||
$this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array('pt.rowid'=>'RefTask','pt.label'=>'LabelTask','pt.dateo'=>"TaskDateStart",'pt.datee'=>"TaskDateEnd",'pt.duration_effective'=>"DurationEffective",'pt.planned_workload'=>"PlannedWorkload",'pt.progress'=>"Progress",'pt.description'=>"TaskDescription"));
|
||||
$this->export_entities_array[$r]=array_merge($this->export_entities_array[$r], array('pt.rowid'=>'projecttask','pt.label'=>'projecttask','pt.dateo'=>"projecttask",'pt.datee'=>"projecttask",'pt.duration_effective'=>"projecttask",'pt.planned_workload'=>"projecttask",'pt.progress'=>"projecttask",'pt.description'=>"projecttask"));
|
||||
$this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array('pt.rowid'=>'TaskId', 'pt.ref'=>'RefTask', 'pt.label'=>'LabelTask','pt.dateo'=>"TaskDateStart",'pt.datee'=>"TaskDateEnd",'pt.duration_effective'=>"DurationEffective",'pt.planned_workload'=>"PlannedWorkload",'pt.progress'=>"Progress",'pt.description'=>"TaskDescription"));
|
||||
$this->export_entities_array[$r]=array_merge($this->export_entities_array[$r], array('pt.rowid'=>'projecttask', 'pt.ref'=>'projecttask', 'pt.label'=>'projecttask','pt.dateo'=>"projecttask",'pt.datee'=>"projecttask",'pt.duration_effective'=>"projecttask",'pt.planned_workload'=>"projecttask",'pt.progress'=>"projecttask",'pt.description'=>"projecttask"));
|
||||
// Add extra fields for task
|
||||
$keyforselect='projet_task'; $keyforelement='projecttask'; $keyforaliasextra='extra2';
|
||||
include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
|
||||
|
||||
@@ -138,8 +138,8 @@ class modReceiptPrinter extends DolibarrModules
|
||||
// Clean before activation
|
||||
$this->remove($options);
|
||||
$sql = array(
|
||||
"CREATE TABLE IF NOT EXISTS llx_printer_receipt (rowid integer AUTO_INCREMENT PRIMARY KEY, name varchar(128), fk_type integer, fk_profile integer, parameter varchar(128), entity integer) ENGINE=innodb;",
|
||||
"CREATE TABLE IF NOT EXISTS llx_printer_receipt_template (rowid integer AUTO_INCREMENT PRIMARY KEY, name varchar(128), template text, entity integer) ENGINE=innodb;",
|
||||
"CREATE TABLE IF NOT EXISTS ".MAIN_DB_PREFIX."printer_receipt (rowid integer AUTO_INCREMENT PRIMARY KEY, name varchar(128), fk_type integer, fk_profile integer, parameter varchar(128), entity integer) ENGINE=innodb;",
|
||||
"CREATE TABLE IF NOT EXISTS ".MAIN_DB_PREFIX."printer_receipt_template (rowid integer AUTO_INCREMENT PRIMARY KEY, name varchar(128), template text, entity integer) ENGINE=innodb;",
|
||||
);
|
||||
return $this->_init($sql,$options);
|
||||
}
|
||||
|
||||
@@ -274,7 +274,7 @@ class modStock extends DolibarrModules
|
||||
'ps.fk_product'=>"PREF123456",'ps.fk_entrepot'=>"ALM001",'ps.reel'=>"10"
|
||||
);
|
||||
$this->import_run_sql_after_array[$r]=array( // Because we may change data that are denormalized, we must update dernormalized data after.
|
||||
'UPDATE llx_product p SET p.stock= (SELECT SUM(ps.reel) FROM llx_product_stock ps WHERE ps.fk_product = p.rowid);'
|
||||
'UPDATE '.MAIN_DB_PREFIX.'product p SET p.stock= (SELECT SUM(ps.reel) FROM '.MAIN_DB_PREFIX.'product_stock ps WHERE ps.fk_product = p.rowid);'
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
@@ -36,11 +36,12 @@ if ($massaction == 'presend')
|
||||
{
|
||||
$langs->load("mails");
|
||||
|
||||
$listofselectedid = array();
|
||||
$listofselectedthirdparties = array();
|
||||
$listofselectedref = array();
|
||||
|
||||
if (! GETPOST('cancel', 'alpha'))
|
||||
{
|
||||
$listofselectedid = array();
|
||||
$listofselectedthirdparties = array();
|
||||
$listofselectedref = array();
|
||||
foreach ($arrayofselected as $toselectid)
|
||||
{
|
||||
$result = $objecttmp->fetch($toselectid);
|
||||
@@ -106,7 +107,8 @@ if ($massaction == 'presend')
|
||||
$formmail->withtoreadonly = 1;
|
||||
}
|
||||
|
||||
$formmail->withoptiononeemailperrecipient = empty($liste)?0:((GETPOST('oneemailperrecipient')=='on')?1:-1);
|
||||
$formmail->withoptiononeemailperrecipient = ((count($listofselectedref) == 1 && count(reset($listofselectedref)) == 1) || empty($liste)) ? 0 : ((GETPOST('oneemailperrecipient')=='on')?1:-1);
|
||||
|
||||
$formmail->withto = empty($liste)?(GETPOST('sendto','alpha')?GETPOST('sendto','alpha'):array()):$liste;
|
||||
$formmail->withtofree = empty($liste)?1:0;
|
||||
$formmail->withtocc = 1;
|
||||
@@ -125,6 +127,7 @@ if ($massaction == 'presend')
|
||||
|
||||
// Make substitution in email content
|
||||
$substitutionarray = getCommonSubstitutionArray($langs, 0, null, $object);
|
||||
|
||||
$substitutionarray['__EMAIL__'] = $sendto;
|
||||
$substitutionarray['__CHECK_READ__'] = (is_object($object) && is_object($object->thirdparty)) ? '<img src="' . DOL_MAIN_URL_ROOT . '/public/emailing/mailing-read.php?tag=' . $object->thirdparty->tag . '&securitykey=' . urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY) . '" width="1" height="1" style="width:1px;height:1px" border="0"/>' : '';
|
||||
$substitutionarray['__PERSONALIZED__'] = ''; // deprecated
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2019 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -67,7 +68,7 @@ if (!$sortfield) $sortfield="d.date_debut";
|
||||
$id = GETPOST('id', 'int');
|
||||
|
||||
$sall = trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml'));
|
||||
$search_ref = GETPOST('search_ref');
|
||||
$search_ref = GETPOST('search_ref', 'alpha');
|
||||
$search_user = GETPOST('search_user','int');
|
||||
$search_amount_ht = GETPOST('search_amount_ht','alpha');
|
||||
$search_amount_vat = GETPOST('search_amount_vat','alpha');
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2019 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -31,10 +32,19 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
if ($conf->projet->enabled) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
||||
}
|
||||
if ($conf->contrat->enabled) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/contrat/class/contrat.class.php';
|
||||
}
|
||||
|
||||
|
||||
|
||||
$langs->load("companies");
|
||||
$langs->load("bills");
|
||||
$langs->load("interventions");
|
||||
$langs->load("exports");
|
||||
|
||||
$action=GETPOST('action','alpha');
|
||||
$massaction=GETPOST('massaction','alpha');
|
||||
@@ -42,12 +52,12 @@ $show_files=GETPOST('show_files','int');
|
||||
$confirm=GETPOST('confirm','alpha');
|
||||
$toselect = GETPOST('toselect', 'array');
|
||||
|
||||
$search_ref=GETPOST('search_ref')?GETPOST('search_ref','alpha'):GETPOST('search_inter','alpha');
|
||||
$search_company=GETPOST('search_company','alpha');
|
||||
$search_desc=GETPOST('search_desc','alpha');
|
||||
$search_status=GETPOST('search_status');
|
||||
//$search_ref=GETPOST('search_ref')?GETPOST('search_ref','alpha'):GETPOST('search_inter','alpha');
|
||||
//$search_company=GETPOST('search_company','alpha');
|
||||
//$search_desc=GETPOST('search_desc','alpha');
|
||||
//$search_status=GETPOST('search_status');
|
||||
$sall=trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml'));
|
||||
$optioncss = GETPOST('optioncss','alpha');
|
||||
//$optioncss = GETPOST('optioncss','alpha');
|
||||
$socid=GETPOST('socid','int');
|
||||
|
||||
// Security check
|
||||
@@ -81,6 +91,8 @@ $search_company=GETPOST('search_company','alpha');
|
||||
$search_desc=GETPOST('search_desc','alpha');
|
||||
$search_status=GETPOST('search_status');
|
||||
$optioncss = GETPOST('optioncss','alpha');
|
||||
$search_project=GETPOST('search_project','alpha');
|
||||
$search_contract=GETPOST('search_contract','alpha');
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array($contextpage));
|
||||
@@ -104,10 +116,10 @@ if (! empty($conf->global->FICHINTER_DISABLE_DETAILS)) unset($fieldstosearchall[
|
||||
$arrayfields=array(
|
||||
'f.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
|
||||
's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1),
|
||||
'f.fk_project'=>array('label'=>$langs->trans("Project"), 'checked'=>1),
|
||||
'f.fk_projet'=>array('label'=>$langs->trans("Project"), 'checked'=>1),
|
||||
'f.fk_contrat'=>array('label'=>$langs->trans("Contract"), 'checked'=>1),
|
||||
'f.description'=>array('label'=>$langs->trans("Description"), 'checked'=>1),
|
||||
'fd.description'=>array('label'=>"xx", 'checked'=>1, 'enabled'=>empty($conf->global->FICHINTER_DISABLE_DETAILS)?1:0),
|
||||
'fd.description'=>array('label'=>$langs->trans("LineDescription"), 'checked'=>1, 'enabled'=>empty($conf->global->FICHINTER_DISABLE_DETAILS)?1:0),
|
||||
'fd.date'=>array('label'=>$langs->trans("Date"), 'checked'=>1, 'enabled'=>empty($conf->global->FICHINTER_DISABLE_DETAILS)?1:0),
|
||||
'fd.duree'=>array('label'=>$langs->trans("Duration"), 'checked'=>1, 'enabled'=>empty($conf->global->FICHINTER_DISABLE_DETAILS)?1:0),
|
||||
'f.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
|
||||
@@ -174,6 +186,12 @@ $form = new Form($db);
|
||||
$formfile = new FormFile($db);
|
||||
$objectstatic=new Fichinter($db);
|
||||
$companystatic=new Societe($db);
|
||||
if ($conf->projet->enabled) {
|
||||
$projectstatic = new Project($db);
|
||||
}
|
||||
if ($conf->contrat->enabled) {
|
||||
$contratstatic = new Contrat($db);
|
||||
}
|
||||
|
||||
$title=$langs->trans("ListOfInterventions");
|
||||
llxHeader('', $title);
|
||||
@@ -183,6 +201,12 @@ $sql = "SELECT";
|
||||
$sql.= " f.ref, f.rowid, f.fk_statut, f.description, f.datec as date_creation, f.tms as date_update, f.note_private,";
|
||||
if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) $sql.= " fd.description as descriptiondetail, fd.date as dp, fd.duree,";
|
||||
$sql.= " s.nom as name, s.rowid as socid, s.client";
|
||||
if (! empty($arrayfields['f.fk_projet']['checked'])){
|
||||
$sql.= " ,p.rowid as projectid, p.ref as projectref, p.title as projecttitle";
|
||||
}
|
||||
if (! empty($arrayfields['f.fk_contrat']['checked'])){
|
||||
$sql.= " ,c.rowid as contractid, c.ref as contractref";
|
||||
}
|
||||
// Add fields from extrafields
|
||||
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
|
||||
// Add fields from hooks
|
||||
@@ -190,6 +214,12 @@ $parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql.=$hookmanager->resPrint;
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."fichinter as f";
|
||||
if (! empty($arrayfields['f.fk_projet']['checked'])){
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON f.fk_projet = p.rowid";
|
||||
}
|
||||
if (! empty($arrayfields['f.fk_contrat']['checked'])){
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."contrat as c ON f.fk_contrat = c.rowid";
|
||||
}
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."fichinter_extrafields as ef on (f.rowid = ef.fk_object)";
|
||||
if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."fichinterdet as fd ON fd.fk_fichinter = f.rowid";
|
||||
if (! $user->rights->societe->client->voir && empty($socid)) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
@@ -213,6 +243,12 @@ if (! $user->rights->societe->client->voir && empty($socid))
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if ($socid)
|
||||
$sql.= " AND s.rowid = " . $socid;
|
||||
if ($search_project) {
|
||||
$sql .= natural_search('p.ref', $search_project);
|
||||
}
|
||||
if ($search_contract) {
|
||||
$sql .= natural_search('c.ref', $search_contract);
|
||||
}
|
||||
if ($sall) {
|
||||
$sql .= natural_search(array_keys($fieldstosearchall), $sall);
|
||||
}
|
||||
@@ -258,6 +294,8 @@ if ($resql)
|
||||
if ($search_company) $param.="&search_company=".urlencode($search_company);
|
||||
if ($search_desc) $param.="&search_desc=".urlencode($search_desc);
|
||||
if ($search_status != '' && $search_status > -1) $param.="&search_status=".urlencode($search_status);
|
||||
if ($search_project) $param.="&search_project=".urlencode($search_project);
|
||||
if ($search_contract) $param.="&search_contract=".urlencode($search_contract);
|
||||
if ($show_files) $param.='&show_files=' .$show_files;
|
||||
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
||||
// Add $param from extra fields
|
||||
@@ -331,6 +369,18 @@ if ($resql)
|
||||
print '<input type="text" class="flat" name="search_company" value="'.$search_company.'" size="10">';
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['f.fk_projet']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre">';
|
||||
print '<input type="text" class="flat" name="search_project" value="'.$search_project.'" size="10">';
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['f.fk_contrat']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre">';
|
||||
print '<input type="text" class="flat" name="search_contract" value="'.$search_contract.'" size="10">';
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['f.description']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre">';
|
||||
@@ -386,21 +436,23 @@ if ($resql)
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
if (! empty($arrayfields['f.ref']['checked'])) print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"f.ref","",$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre("ThirdParty",$_SERVER["PHP_SELF"],"s.nom","",$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['f.description']['checked'])) print_liste_field_titre("Description",$_SERVER["PHP_SELF"],"f.description","",$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['fd.description']['checked'])) print_liste_field_titre('',$_SERVER["PHP_SELF"],'');
|
||||
if (! empty($arrayfields['fd.date']['checked'])) print_liste_field_titre("Date",$_SERVER["PHP_SELF"],"fd.date","",$param,'align="center"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['fd.duree']['checked'])) print_liste_field_titre("Duration",$_SERVER["PHP_SELF"],"fd.duree","",$param,'align="right"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['f.ref']['checked'])) print_liste_field_titre($arrayfields['f.ref']['label'],$_SERVER["PHP_SELF"],"f.ref","",$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'],$_SERVER["PHP_SELF"],"s.nom","",$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['f.fk_projet']['checked'])) print_liste_field_titre($arrayfields['f.fk_projet']['label'],$_SERVER["PHP_SELF"],"p.ref","",$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['f.fk_contrat']['checked'])) print_liste_field_titre($arrayfields['f.fk_contrat']['label'],$_SERVER["PHP_SELF"],"p.ref","",$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['f.description']['checked'])) print_liste_field_titre($arrayfields['f.description']['label'],$_SERVER["PHP_SELF"],"f.description","",$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['fd.description']['checked'])) print_liste_field_titre($arrayfields['fd.description']['label'],$_SERVER["PHP_SELF"],'');
|
||||
if (! empty($arrayfields['fd.date']['checked'])) print_liste_field_titre($arrayfields['fd.date']['label'],$_SERVER["PHP_SELF"],"fd.date","",$param,'align="center"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['fd.duree']['checked'])) print_liste_field_titre($arrayfields['fd.duree']['label'],$_SERVER["PHP_SELF"],"fd.duree","",$param,'align="right"',$sortfield,$sortorder);
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||
// Hook fields
|
||||
$parameters=array('arrayfields'=>$arrayfields);
|
||||
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
if (! empty($arrayfields['f.datec']['checked'])) print_liste_field_titre("DateCreationShort",$_SERVER["PHP_SELF"],"f.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['f.tms']['checked'])) print_liste_field_titre("DateModificationShort",$_SERVER["PHP_SELF"],"f.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['f.fk_statut']['checked'])) print_liste_field_titre("Status",$_SERVER["PHP_SELF"],"f.fk_statut","",$param,'align="right"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['f.datec']['checked'])) print_liste_field_titre($arrayfields['f.datec']['label'],$_SERVER["PHP_SELF"],"f.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['f.tms']['checked'])) print_liste_field_titre($arrayfields['f.tms']['label'],$_SERVER["PHP_SELF"],"f.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['f.fk_statut']['checked'])) print_liste_field_titre($arrayfields['f.fk_statut']['label'],$_SERVER["PHP_SELF"],"f.fk_statut","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
@@ -464,6 +516,29 @@ if ($resql)
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (! empty($arrayfields['f.fk_projet']['checked']))
|
||||
{
|
||||
print '<td>';
|
||||
if ($obj->projectid > 0) {
|
||||
$projectstatic->ref = $obj->projectref;
|
||||
$projectstatic->id = $obj->projectid;
|
||||
$projectstatic->title = $obj->projecttitle;
|
||||
print $projectstatic->getNomUrl(1, '', 44);
|
||||
}
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (! empty($arrayfields['f.fk_contrat']['checked']))
|
||||
{
|
||||
print '<td>';
|
||||
if ($obj->contractid > 0) {
|
||||
$contratstatic->ref = $obj->contractref;
|
||||
$contratstatic->id = $obj->contractid;
|
||||
print $contratstatic->getNomUrl(1, '', 44);
|
||||
}
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (! empty($arrayfields['f.description']['checked']))
|
||||
{
|
||||
print '<td>'.dol_trunc(dolGetFirstLineOfText($obj->description),48).'</td>';
|
||||
|
||||
@@ -1228,7 +1228,7 @@ class CommandeFournisseur extends CommonOrder
|
||||
false,
|
||||
$this->lines[$i]->date_start,
|
||||
$this->lines[$i]->date_end,
|
||||
0,
|
||||
$this->lines[$i]->array_options,
|
||||
$this->lines[$i]->fk_unit
|
||||
);
|
||||
if ($result < 0)
|
||||
@@ -1338,6 +1338,10 @@ class CommandeFournisseur extends CommonOrder
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// get extrafields so they will be clone
|
||||
foreach($this->lines as $line)
|
||||
$line->fetch_optionals($line->rowid);
|
||||
|
||||
// Load source object
|
||||
$objFrom = clone $this;
|
||||
|
||||
|
||||
@@ -774,7 +774,7 @@ if ($ok && GETPOST('clean_product_stock_batch','alpha'))
|
||||
if ($resql2)
|
||||
{
|
||||
// We update product_stock, so we must field stock into product too.
|
||||
$sql3='UPDATE llx_product p SET p.stock= (SELECT SUM(ps.reel) FROM llx_product_stock ps WHERE ps.fk_product = p.rowid)';
|
||||
$sql3='UPDATE '.MAIN_DB_PREFIX.'product p SET p.stock= (SELECT SUM(ps.reel) FROM '.MAIN_DB_PREFIX.'product_stock ps WHERE ps.fk_product = p.rowid)';
|
||||
$resql3=$db->query($sql3);
|
||||
if (! $resql3)
|
||||
{
|
||||
|
||||
@@ -660,8 +660,8 @@ function migrate_paiements_orphelins_1($db,$langs,$conf)
|
||||
$sql = "SELECT distinct p.rowid, p.datec, p.amount as pamount, bu.fk_bank, b.amount as bamount,";
|
||||
$sql.= " bu2.url_id as socid";
|
||||
$sql.= " FROM (".MAIN_DB_PREFIX."paiement as p, ".MAIN_DB_PREFIX."bank_url as bu, ".MAIN_DB_PREFIX."bank as b)";
|
||||
$sql.= " LEFT JOIN llx_paiement_facture as pf ON pf.fk_paiement = p.rowid";
|
||||
$sql.= " LEFT JOIN llx_bank_url as bu2 ON (bu.fk_bank=bu2.fk_bank AND bu2.type = 'company')";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON pf.fk_paiement = p.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu2 ON (bu.fk_bank=bu2.fk_bank AND bu2.type = 'company')";
|
||||
$sql.= " WHERE pf.rowid IS NULL AND (p.rowid=bu.url_id AND bu.type='payment') AND bu.fk_bank = b.rowid";
|
||||
$sql.= " AND b.rappro = 1";
|
||||
$sql.= " AND (p.fk_facture = 0 OR p.fk_facture IS NULL)";
|
||||
@@ -787,8 +787,8 @@ function migrate_paiements_orphelins_2($db,$langs,$conf)
|
||||
$sql = "SELECT distinct p.rowid, p.datec, p.amount as pamount, bu.fk_bank, b.amount as bamount,";
|
||||
$sql.= " bu2.url_id as socid";
|
||||
$sql.= " FROM (".MAIN_DB_PREFIX."paiement as p, ".MAIN_DB_PREFIX."bank_url as bu, ".MAIN_DB_PREFIX."bank as b)";
|
||||
$sql.= " LEFT JOIN llx_paiement_facture as pf ON pf.fk_paiement = p.rowid";
|
||||
$sql.= " LEFT JOIN llx_bank_url as bu2 ON (bu.fk_bank = bu2.fk_bank AND bu2.type = 'company')";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON pf.fk_paiement = p.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu2 ON (bu.fk_bank = bu2.fk_bank AND bu2.type = 'company')";
|
||||
$sql.= " WHERE pf.rowid IS NULL AND (p.fk_bank = bu.fk_bank AND bu.type = 'payment') AND bu.fk_bank = b.rowid";
|
||||
$sql.= " AND (p.fk_facture = 0 OR p.fk_facture IS NULL)";
|
||||
|
||||
@@ -1104,7 +1104,7 @@ function migrate_contracts_date1($db,$langs,$conf)
|
||||
print '<br>';
|
||||
print '<b>'.$langs->trans('MigrationContractsEmptyDatesUpdate')."</b><br>\n";
|
||||
|
||||
$sql="update llx_contrat set date_contrat=tms where date_contrat is null";
|
||||
$sql="update ".MAIN_DB_PREFIX."contrat set date_contrat=tms where date_contrat is null";
|
||||
dolibarr_install_syslog("upgrade2::migrate_contracts_date1");
|
||||
$resql = $db->query($sql);
|
||||
if (! $resql) dol_print_error($db);
|
||||
@@ -1113,7 +1113,7 @@ function migrate_contracts_date1($db,$langs,$conf)
|
||||
else
|
||||
print $langs->trans('MigrationContractsEmptyDatesNothingToUpdate')."<br>\n";
|
||||
|
||||
$sql="update llx_contrat set datec=tms where datec is null";
|
||||
$sql="update ".MAIN_DB_PREFIX."contrat set datec=tms where datec is null";
|
||||
dolibarr_install_syslog("upgrade2::migrate_contracts_date1");
|
||||
$resql = $db->query($sql);
|
||||
if (! $resql) dol_print_error($db);
|
||||
@@ -1204,7 +1204,7 @@ function migrate_contracts_date3($db,$langs,$conf)
|
||||
print '<br>';
|
||||
print '<b>'.$langs->trans('MigrationContractsIncoherentCreationDateUpdate')."</b><br>\n";
|
||||
|
||||
$sql="update llx_contrat set datec=date_contrat where datec is null or datec > date_contrat";
|
||||
$sql="update ".MAIN_DB_PREFIX."contrat set datec=date_contrat where datec is null or datec > date_contrat";
|
||||
dolibarr_install_syslog("upgrade2::migrate_contracts_date3");
|
||||
$resql = $db->query($sql);
|
||||
if (! $resql) dol_print_error($db);
|
||||
@@ -1231,7 +1231,7 @@ function migrate_contracts_open($db,$langs,$conf)
|
||||
print '<br>';
|
||||
print '<b>'.$langs->trans('MigrationReopeningContracts')."</b><br>\n";
|
||||
|
||||
$sql = "SELECT c.rowid as cref FROM llx_contrat as c, llx_contratdet as cd";
|
||||
$sql = "SELECT c.rowid as cref FROM ".MAIN_DB_PREFIX."contrat as c, ".MAIN_DB_PREFIX."contratdet as cd";
|
||||
$sql.= " WHERE cd.statut = 4 AND c.statut=2 AND c.rowid=cd.fk_contrat";
|
||||
dolibarr_install_syslog("upgrade2::migrate_contracts_open");
|
||||
$resql = $db->query($sql);
|
||||
@@ -1964,7 +1964,7 @@ function migrate_modeles($db,$langs,$conf)
|
||||
if (count($modellist)==0)
|
||||
{
|
||||
// Aucun model par defaut.
|
||||
$sql=" insert into llx_document_model(nom,type) values('crabe','invoice')";
|
||||
$sql=" insert into ".MAIN_DB_PREFIX."document_model(nom,type) values('crabe','invoice')";
|
||||
$resql = $db->query($sql);
|
||||
if (! $resql) dol_print_error($db);
|
||||
}
|
||||
@@ -1977,7 +1977,7 @@ function migrate_modeles($db,$langs,$conf)
|
||||
if (count($modellist)==0)
|
||||
{
|
||||
// Aucun model par defaut.
|
||||
$sql=" insert into llx_document_model(nom,type) values('einstein','order')";
|
||||
$sql=" insert into ".MAIN_DB_PREFIX."document_model(nom,type) values('einstein','order')";
|
||||
$resql = $db->query($sql);
|
||||
if (! $resql) dol_print_error($db);
|
||||
}
|
||||
@@ -1990,7 +1990,7 @@ function migrate_modeles($db,$langs,$conf)
|
||||
if (count($modellist)==0)
|
||||
{
|
||||
// Aucun model par defaut.
|
||||
$sql=" insert into llx_document_model(nom,type) values('rouget','shipping')";
|
||||
$sql=" insert into ".MAIN_DB_PREFIX."document_model(nom,type) values('rouget','shipping')";
|
||||
$resql = $db->query($sql);
|
||||
if (! $resql) dol_print_error($db);
|
||||
}
|
||||
|
||||
@@ -897,7 +897,7 @@ class Product extends CommonObject
|
||||
$sql.= ", accountancy_code_sell= '" . $this->db->escape($this->accountancy_code_sell)."'";
|
||||
$sql.= ", accountancy_code_sell_intra= '" . $this->db->escape($this->accountancy_code_sell_intra)."'";
|
||||
$sql.= ", accountancy_code_sell_export= '" . $this->db->escape($this->accountancy_code_sell_export)."'";
|
||||
$sql.= ", desiredstock = " . ((isset($this->desiredstock) && $this->desiredstock != '') ? $this->desiredstock : "null");
|
||||
$sql.= ", desiredstock = " . ((isset($this->desiredstock) && is_numeric($this->desiredstock)) ? $this->desiredstock : "null");
|
||||
$sql.= ", cost_price = " . ($this->cost_price != '' ? $this->db->escape($this->cost_price) : 'null');
|
||||
$sql.= ", fk_unit= " . (!$this->fk_unit ? 'NULL' : $this->fk_unit);
|
||||
$sql.= ", price_autogen = " . (!$this->price_autogen ? 0 : 1);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2012-2016 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2013-2016 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013-2019 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2013 Jean Heimburger <jean@tiaris.info>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
@@ -52,11 +52,11 @@ $confirm=GETPOST('confirm','alpha');
|
||||
$toselect = GETPOST('toselect', 'array');
|
||||
|
||||
$sall=trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml'));
|
||||
$search_ref=GETPOST("search_ref");
|
||||
$search_barcode=GETPOST("search_barcode");
|
||||
$search_label=GETPOST("search_label");
|
||||
$search_ref=GETPOST("search_ref",'alpha');
|
||||
$search_barcode=GETPOST("search_barcode",'alpha');
|
||||
$search_label=GETPOST("search_label", 'alpha');
|
||||
$search_type = GETPOST("search_type",'int');
|
||||
$search_sale = GETPOST("search_sale");
|
||||
$search_sale = GETPOST("search_sale", 'int');
|
||||
$search_categ = GETPOST("search_categ",'int');
|
||||
$search_tosell = GETPOST("search_tosell", 'int');
|
||||
$search_tobuy = GETPOST("search_tobuy", 'int');
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2019 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -40,11 +41,11 @@ $result=restrictedArea($user,'produit|service');
|
||||
|
||||
|
||||
$action=GETPOST('action','alpha');
|
||||
$sref=GETPOST("sref");
|
||||
$snom=GETPOST("snom");
|
||||
$sref=GETPOST("sref", 'alpha');
|
||||
$snom=GETPOST("snom", 'alpha');
|
||||
$sall=trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml'));
|
||||
$type=GETPOST("type","int");
|
||||
$search_barcode=GETPOST("search_barcode");
|
||||
$search_barcode=GETPOST("search_barcode", 'alpha');
|
||||
$catid=GETPOST('catid','int');
|
||||
$toolowstock=GETPOST('toolowstock');
|
||||
$tosell = GETPOST("tosell");
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2019 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -43,8 +44,8 @@ $result=restrictedArea($user,'produit|service');
|
||||
|
||||
|
||||
$action=GETPOST('action','alpha');
|
||||
$sref=GETPOST("sref");
|
||||
$snom=GETPOST("snom");
|
||||
$sref=GETPOST("sref", 'alpha');
|
||||
$snom=GETPOST("snom", 'alpha');
|
||||
$sall=trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml'));
|
||||
$type=GETPOST("type","int");
|
||||
$search_barcode=GETPOST("search_barcode",'alpha');
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
|
||||
* Copyright (C) 2019 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -69,9 +70,9 @@ $pagenext = $page + 1;
|
||||
|
||||
$search_all=GETPOST('search_all', 'alphanohtml');
|
||||
$search_categ=GETPOST("search_categ",'alpha');
|
||||
$search_ref=GETPOST("search_ref");
|
||||
$search_label=GETPOST("search_label");
|
||||
$search_societe=GETPOST("search_societe");
|
||||
$search_ref=GETPOST("search_ref",'alpha');
|
||||
$search_label=GETPOST("search_label",'alpha');
|
||||
$search_societe=GETPOST("search_societe",'alpha');
|
||||
$search_year=GETPOST("search_year");
|
||||
$search_status=GETPOST("search_status",'int');
|
||||
$search_opp_status=GETPOST("search_opp_status",'alpha');
|
||||
|
||||
@@ -850,7 +850,7 @@ class Website extends CommonObject
|
||||
}
|
||||
foreach($listofpages as $pageid => $objectpageold)
|
||||
{
|
||||
$line = 'INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, title, description, keyword, status, date_creation, tms, lang, import_key, grabbed_from, content)';
|
||||
$line = 'INSERT INTO '.MAIN_DB_PREFIX.'website_page(rowid, fk_page, fk_website, pageurl, title, description, keyword, status, date_creation, tms, lang, import_key, grabbed_from, content)';
|
||||
$line.= " VALUES(";
|
||||
$line.= $objectpageold->newid."+__MAXROWID__, ";
|
||||
$line.= ($objectpageold->newfk_page ? $this->db->escape($objectpageold->newfk_page)."+__MAXROWID__" : "null").", ";
|
||||
|
||||
Reference in New Issue
Block a user