diff --git a/.gitignore b/.gitignore index 1ece034ae94..aa332681474 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ dolibarr_install.log upgrade.log doxygen_warnings.log /.project +/.vscode .DS_Store .idea *.iml diff --git a/ChangeLog b/ChangeLog index 9982ac8e029..8a80591f652 100644 --- a/ChangeLog +++ b/ChangeLog @@ -25,6 +25,40 @@ Following changes may create regressions for some external modules, but were nec +***** ChangeLog for 8.0.2 compared to 8.0.1 ***** +FIX: #8452 +FIX: #9043 +FIX: #9316 Error when listing invoices +FIX: #9317 +FIX: #9353 Bug: html error - div inside span on graphs +FIX: #9355 +FIX: #9393 inconsistency behaviour. option FACTURE_ENABLE_NEGATIVE_LINES +FIX: #9394 +FIX: #9396 +FIX: #9403 +FIX: #9412 +FIX: #9497 +FIX: Add paypal error message in alert email when online payment fails. +FIX: better compatibility with multicompany +FIX: capital must be empty and not 0 if undefined +FIX: character making error on bill list +FIX: Entering negative price on order. +FIX: Expedition not showing extrafields on creation. +FIX: Homepage links were using wrong topmenus +FIX: inconsistency behaviour on option FACTURE_ENABLE_NEGATIVE_LINES +FIX: invert mime type and name. +FIX: invoice popup hide localtax2 and 3 if not defined. +FIX: Lose filter on payment type or category after a sort on invoice list. +FIX: Maxi debug to allow to load chart of account with multicompany. +FIX: Missing translation in predefined email to membership renewal. +FIX: Mixing tickets of different thirdparties. +FIX: "Other ..." link so the "Back to" link works. +FIX: PDF address: handle when contact thirdparty is different from thirdparty of document +FIX: Problems with permissions of module to record payment of salaries +FIX: remove debug +FIX: Several fixes on the management of minimal amount for orders +FIX: wrong var name + ***** ChangeLog for 8.0.1 compared to 8.0.0 ***** FIX: #9258 FIX: #9328 diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 7c9aff25977..7c19f883210 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -846,6 +846,8 @@ if ($mode == 'common') dol_fiche_end(); + print '
'; + // Show warning about external users print info_admin(showModulesExludedForExternal($modules))."\n"; diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index 9c2ee62565d..99a07c17248 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -156,7 +156,8 @@ $i=0; foreach($_SESSION as $key => $val) { if ($i > 0) print ', '; - print $key.' => '.dol_escape_htmltag($val); + if (is_array($val)) print $key.' => array(...)'; + else print $key.' => '.dol_escape_htmltag($val); $i++; } print ''."\n"; diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 8fd1f1b0030..f968f9800e9 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -40,6 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; @@ -251,6 +252,19 @@ if ($action == 'add') } } $object->fk_project = isset($_POST["projectid"])?$_POST["projectid"]:0; + + $taskid = GETPOST('taskid','int'); + if(!empty($taskid)){ + + $taskProject = new Task($db); + if($taskProject->fetch($taskid)>0){ + $object->fk_project = $taskProject->fk_project; + } + + $object->fk_element = $taskid; + $object->elementtype = 'task'; + } + $object->datep = $datep; $object->datef = $datef; $object->percentage = $percentage; @@ -876,11 +890,38 @@ if ($action == 'create') { // Projet associe $langs->load("projects"); + + $projectid = GETPOST('projectid', 'int'); - print ''.$langs->trans("Project").''; + print ''.$langs->trans("Project").''; - $numproject=$formproject->select_projects((! empty($societe->id)?$societe->id:-1), GETPOST("projectid")?GETPOST("projectid"):'', 'projectid', 0, 0, 1, 1); + $numproject=$formproject->select_projects((! empty($societe->id)?$societe->id:-1), $projectid, 'projectid', 0, 0, 1, 1); + print '   '.$langs->trans("AddProject").''; + $urloption='?action=create'; + $url = dol_buildpath('comm/action/card.php',2).$urloption; + + // update task list + print "\n".''."\n"; + + print ''; + + print ''.$langs->trans("Task").''; + + $projectsListId=false; + if(!empty($projectid)){ $projectsListId=$projectid; } + $tid=GETPOST("projecttaskid")?GETPOST("projecttaskid"):''; + $formproject->selectTasks((! empty($societe->id)?$societe->id:-1), $tid, 'taskid', 24, 0, '1', 1, 0, 0, 'maxwidth500',$projectsListId); print ''; } if (!empty($origin) && !empty($originid)) @@ -1270,10 +1311,41 @@ if ($id > 0) include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; print ''; print ''.$langs->trans("LinkedObject").''; - print ''.dolGetElementUrl($object->fk_element,$object->elementtype,1); - print ''; - print ''; - print ''; + + if ($object->elementtype == 'task' && ! empty($conf->projet->enabled)) + { + print ''; + + $urloption='?action=create'; // we use create not edit for more flexibility + $url = DOL_URL_ROOT.'/comm/action/card.php'.$urloption; + + // update task list + print "\n".''."\n"; + + $formproject->selectTasks((! empty($societe->id)?$societe->id:-1), $object->fk_element, 'fk_element', 24, 0, 0, 1, 0, 0, 'maxwidth500',$object->fk_project); + print ''; + + print ''; + } + else + { + print ''; + print dolGetElementUrl($object->fk_element,$object->elementtype,1); + print ''; + print ''; + print ''; + } + print ''; } diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 5874a7b855c..596c3cb3c5b 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -666,6 +666,8 @@ if ($object->id > 0) */ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) { + $langs->load("propal"); + $sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.fk_statut, p.total_ht"; $sql.= ", p.tva as total_tva"; $sql.= ", p.total as total_ttc"; @@ -674,7 +676,7 @@ if ($object->id > 0) $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c"; $sql.= " WHERE p.fk_soc = s.rowid AND p.fk_statut = c.id"; $sql.= " AND s.rowid = ".$object->id; - $sql.= " AND p.entity = ".$conf->entity; + $sql.= " AND p.entity IN (".getEntity('propal').")"; $sql.= " ORDER BY p.datep DESC"; $resql=$db->query($sql); diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index de234159f93..2160e77cc2d 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -13,6 +13,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2014-2015 Marcos García * Copyright (C) 2018 Nicolas ZABOURI + * Copyright (C) 2018 Frédéric France * * 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 @@ -1032,6 +1033,7 @@ class Propal extends CommonObject // Add linked object (deprecated, use ->linkedObjectsIds instead) if (! $error && $this->origin && $this->origin_id) { + dol_syslog('Deprecated use of linked object, use ->linkedObjectsIds instead', LOG_WARNING); $ret = $this->add_object_linked(); if (! $ret) dol_print_error($this->db); } @@ -1104,13 +1106,6 @@ class Propal extends CommonObject } } - // Add linked object - if (! $error && $this->origin && $this->origin_id) - { - $ret = $this->add_object_linked(); - if (! $ret) dol_print_error($this->db); - } - // Set delivery address if (! $error && $this->fk_delivery_address) { diff --git a/htdocs/compta/compta-files.php b/htdocs/compta/compta-files.php new file mode 100644 index 00000000000..2a4af918234 --- /dev/null +++ b/htdocs/compta/compta-files.php @@ -0,0 +1,310 @@ + + + * Copyright (C) 2004-2017 Laurent Destailleur + * Copyright (C) 2017 Pierre-Henry Favre + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +/** + * \file htdocs/compta/recap-compta.php + * \ingroup compta + * \brief Page de fiche recap customer + */ +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; +restrictedArea($user,'banque'); +$langs->load("companies"); +if (! empty($conf->facture->enabled)) $langs->load("bills"); +$date_start =GETPOST('date_start','alpha'); +$date_startDay= GETPOST('date_startday','int'); +$date_startMonth= GETPOST('date_startmonth','int'); +$date_startYear= GETPOST('date_startyear','int'); +$date_start=($date_startDay)?dol_mktime(0,0,0,$date_startMonth,$date_startDay,$date_startYear):strtotime($date_start); +$date_stop =GETPOST('date_stop','alpha'); +$date_stopDay= GETPOST('date_stopday','int'); +$date_stopMonth= GETPOST('date_stopmonth','int'); +$date_stopYear= GETPOST('date_stopyear','int'); +//FIXME doldate +$date_stop=($date_stopDay)?dol_mktime(0,0,0,$date_stopMonth,$date_stopDay,$date_stopYear):strtotime($date_stop); +$action =GETPOST('action','alpha'); +// Security check +//if ($user->societe_id) $id=$user->societe_id; +//$result = restrictedArea($user, 'societe', $id, '&societe'); +//$object = new Societe($db); +//if ($id > 0) $object->fetch($id); +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('comptafilescard','globalcard')); +// Load variable for pagination +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; +$sortfield = GETPOST('sortfield','alpha'); +$sortorder = GETPOST('sortorder','alpha'); +$page = GETPOST('page','int'); +if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (! $sortfield) $sortfield="f.datef,f.rowid"; // Set here default search field +if (! $sortorder) $sortorder="DESC"; +$arrayfields=array( + 'date'=>array('label'=>"Date", 'checked'=>1), + //... +); +/* + * Actions + */ +//$parameters = array('socid' => $id); +//$reshook = $hookmanager->executeHooks('doActions', $parameters, $object); // Note that $object may have been modified by some hooks +//if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +/* + * Fetch the lines/files from db / + */ +$filesarray=array(); +$result=false; +if(($action=="searchfiles"||$action=="dl" ) && $date_start && $date_stop){ + $wheretail=" '".$db->idate($date_start)."' AND '".$db->idate($date_stop)."'"; + $sql="SELECT rowid as id, facnumber as ref,paye as paid,total_ttc,fk_soc,datef as date, 'Invoice' as item FROM ".MAIN_DB_PREFIX."facture"; + $sql.=" WHERE datef between ".$wheretail; + $sql.=" UNION ALL"; + $sql.=" SELECT rowid as id,ref, paye as paid, total_ttc, fk_soc,datef as date, 'InvoiceSupplier' as item FROM ".MAIN_DB_PREFIX."facture_fourn"; + $sql.=" WHERE datef between ".$wheretail; + $sql.=" UNION ALL"; + $sql.=" SELECT rowid as id,ref,paid,total_ttc,fk_user_author as fk_soc,date_fin as date,'Expense' as item FROM ".MAIN_DB_PREFIX."expensereport"; + $sql.=" WHERE date_fin between ".$wheretail; + $sql.=" UNION ALL"; + $sql.=" SELECT rowid as id,ref,paid,amount as total_ttc,CONCAT(firstname,' ',lastname) as fk_soc,datedon as date,'Donation' as item FROM ".MAIN_DB_PREFIX."don"; + $sql.=" WHERE datedon between ".$wheretail; + $sql.=" UNION ALL"; + $sql.=" SELECT rowid as id,label as ref,1 as paid,amount as total_ttc,fk_user as fk_soc,datep as date,'Salary' as item FROM ".MAIN_DB_PREFIX."payment_salary"; + $sql.=" WHERE datep between ".$wheretail; + $sql.=" UNION ALL"; + $sql.=" SELECT rowid as id,num_paiement as ref,1 as paid,amount as total_ttc,fk_charge as fk_soc,datep as date,'Charge' as item FROM ".MAIN_DB_PREFIX."paiementcharge"; + $sql.=" WHERE datep between ".$wheretail; + $resd = $db->query($sql); + $files=array(); + $link=''; + + if ($resd) + { + $numd = $db->num_rows($resd); + + $upload_dir =''; + $i=0; + while($i<$numd) + { + + + $objd = $db->fetch_object($resd); + + switch($objd->item){ + case "Invoice": + $subdir=dol_sanitizeFileName($objd->ref); + $upload_dir = $conf->facture->dir_output.'/'.$subdir; + $link="../../document.php?modulepart=facture&file=".str_replace('/','%2F',$subdir).'%2F'; + break; + case "InvoiceSupplier": + $subdir=get_exdir($objd->id,2,0,0,$objd,'invoice_supplier').dol_sanitizeFileName($objd->ref); + $upload_dir = $conf->fournisseur->facture->dir_output.'/'.$subdir; + $link="../../document.php?modulepart=facture_fournisseur&file=".str_replace('/','%2F',$subdir).'%2F'; + break; + case "Expense": + $subdir=dol_sanitizeFileName($objd->ref); + $upload_dir = $conf->expensereport->dir_output.'/'.$subdir; + $link="../../document.php?modulepart=expensereport&file=".str_replace('/','%2F',$subdir).'%2F'; + break; + case "Salary": + $subdir=dol_sanitizeFileName($objd->id); + $upload_dir = $conf->salaries->dir_output.'/'.$subdir; + $link="../../document.php?modulepart=salaries&file=".str_replace('/','%2F',$subdir).'%2F'; + break; + case "Donation": + $subdir=get_exdir(null,2,0,1,$objd,'donation'). '/'. dol_sanitizeFileName($objd->id); + $upload_dir = $conf->don->dir_output . '/' . $subdir; + $link="../../document.php?modulepart=don&file=".str_replace('/','%2F',$subdir).'%2F'; + break; + case "Charge": + $subdir=dol_sanitizeFileName($objd->id); + $upload_dir = $conf->tax->dir_output . '/' . $subdir; + $link="../../document.php?modulepart=tax&file=".str_replace('/','%2F',$subdir).'%2F'; + break; + default: + break; + } + + if(!empty($upload_dir)){ + $result=true; + $files=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview\.png)$','',SORT_ASC,1); + foreach ($files as $key => $file){ + $file['date']=$db->idate($objd->date); + $file['paid']=$objd->paid; + $file['amount']=$objd->total_ttc; + $file['ref']=$objd->ref; + $file['fk']=$objd->fk_soc; + $file['item']=$objd->item; + $file['link']=$link.$file['name']; + $out.= '
'.$file['name'].''; + $filesarray[]=$file; + } + if(count($files)<1){ + $nofile['date']=$db->idate($objd->date); + $nofile['paid']=$objd->paid; + $nofile['amount']=$objd->total_ttc; + $nofile['ref']=$objd->ref; + $nofile['fk']=$objd->fk_soc; + $nofile['item']=$objd->item; + $filesarray[]=$nofile; + } + } + $i++; + } + } + $db->free($resd); + +} +/* + * cleanup of old ZIP + */ +//FIXME +/* +*ZIP creation +*/ +if($result & $action=="dl"){ + unset($zip); + $log='date,type,ref,total,paid,filename,item_id'."\n"; + $zipname = ($date_start)."-".($date_stop).'_export.zip'; + $zip = new ZipArchive; + $res = $zip->open($zipname, ZipArchive::OVERWRITE|ZipArchive::CREATE); + if ($res){ + foreach ($filesarray as $key=> $file) { + if(file_exists($file["fullname"])) $zip->addFile($file["fullname"],$file["name"]);// + $log.=$file['date'].','.$file['item'].','.$file['ref'].','.$file['amount'].','.$file['paid'].','.$file["name"].','.$file['fk']."\n"; + } + $zip->addFromString('log.csv', $log); + $zip->close(); + ///Then download the zipped file. + header('Content-Type: application/zip'); + header('Content-disposition: attachment; filename='.$zipname); + header('Content-Length: ' . filesize($zipname)); + readfile($zipname); + unlink($zipname); + exit(); + } +} +// None +/* + * View + */ +$form = new Form($db); +$userstatic=new User($db); +$title=$langs->trans("ComptaFiles").' - '.$langs->trans("List"); +//if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name.' - '.$langs->trans("Symmary"); +$help_url='EN:Module_Accounting|FR:Module_Compatibilite'; //FIXME +llxHeader('',$title,$help_url); +print ''."\n\t\t"; +if (!empty($date_start) && !empty($date_stop))echo dol_print_date($date_start)." - ".dol_print_date($date_stop); +print ''; +print ''; +//if (! empty($arrayfields['f.datef']['checked'])) +print_liste_field_titre($arrayfields['date']['label'],$_SERVER["PHP_SELF"],"date","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +if ($result) +{ + $TData = dol_sort_array($filesarray, 'date', 'ASC'); + if(empty($TData)) { + print ''; + } else { + // Sort array by date ASC to calucalte balance + + $totalDebit = 0; + $totalCredit = 0; + // Balance calculation + $balance = 0; + foreach($TData as &$data1) { + if($data1['item']!='Invoice'&& $data1['item']!='Donation' ){ + $data1['amount']=-$data1['amount']; + } + if ($data1['amount']>0){ + }else{ + } + $balance += $data1['amount']; + $data1['balance'] = $balance; + } + // Display array + foreach($TData as $data) { + $html_class = ''; + //if (!empty($data['fk_facture'])) $html_class = 'facid-'.$data['fk_facture']; + //elseif (!empty($data['fk_paiement'])) $html_class = 'payid-'.$data['fk_paiement']; + print ''; + print "\n"; + print ''; + print ''; + print '\n"; + print ''; + print '\n"; + $totalDebit += ($data['amount'] > 0) ? abs($data['amount']) : 0; + print '\n"; + $totalCredit += ($data['amount'] > 0) ? 0 : abs($data['amount']); + // Balance + print '\n"; + print "\n"; + } + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + } + + } +print "
'.$langs->trans("Type").''.$langs->trans("Ref").''.$langs->trans("File").''.$langs->trans("Paid").''.$langs->trans("Debit").''.$langs->trans("Credit").''.$langs->trans("Balance").'
'.$langs->trans("NoItem").'
"; + print dol_print_date($data['date'],'day'); + print "'.$data['item'].''.$data['ref'].' ".$data['name']."'.$data['paid'].''.(($data['amount'] > 0) ? price(abs($data['amount'])) : '')."'.(($data['amount'] > 0) ? '' : price(abs($data['amount'])))."'.price($data['balance'])."
 '.price($totalDebit).''.price($totalCredit).''.price(price2num($totalDebit - $totalCredit, 'MT')).'
"; +print '
'."\n\t\t\t"; + +print ''; +print ''; + +//print ''; +//print ''; +//print ''; + +//print ''; +//print ''; +//print ''; + + +print '
'."\n\t\t\n\t\t\n\t\t\t"; + + + +llxFooter(); +$db->close(); diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index c11b0beef6e..c80358315c6 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -958,7 +958,7 @@ class FormMail extends Form if (count($validpaymentmethod) > 0 && $paymenturl) { $langs->load('other'); - $this->substit['__ONLINE_PAYMENT_TEXT_AND_URL__']=str_replace('\n',"\n",$langs->transnoentities("PredefinedMailContentLink", $paymenturl)); + $this->substit['__ONLINE_PAYMENT_TEXT_AND_URL__']=str_replace('\n', "\n", $langs->transnoentities("PredefinedMailContentLink", $paymenturl)); $this->substit['__ONLINE_PAYMENT_URL__']=$paymenturl; } else diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index cb938eb81bb..30e9c054262 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4175,13 +4175,13 @@ function print_fiche_titre($title, $mesg='', $picto='title_generic.png', $pictoi * @param string $morehtmlright Added message to show on right * @param string $picto Icon to use before title (should be a 32x32 transparent png file) * @param int $pictoisfullpath 1=Icon name is a full absolute url of image - * @param int $id To force an id on html objects + * @param string $id To force an id on html objects * @param string $morecssontable More css on table * @param string $morehtmlcenter Added message to show on center * @return string * @see print_barre_liste */ -function load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png', $pictoisfullpath=0, $id=0, $morecssontable='', $morehtmlcenter='') +function load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='') { global $conf; @@ -4191,7 +4191,7 @@ function load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png', $return.= "\n"; $return.= ''; - if ($picto) $return.= ''; + if ($picto) $return.= ''; $return.= ''; @@ -6110,7 +6110,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob $paymenturl=$url; } - $substitutionarray['__ONLINE_PAYMENT_TEXT_AND_URL__']=($paymenturl?$outputlangs->trans("PredefinedMailContentLink", $paymenturl):''); + $substitutionarray['__ONLINE_PAYMENT_TEXT_AND_URL__']=($paymenturl?str_replace('\n', "\n", $outputlangs->trans("PredefinedMailContentLink", $paymenturl)):''); $substitutionarray['__ONLINE_PAYMENT_URL__']=$paymenturl; } } diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index 53b3731d533..3839edb85c1 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -46,9 +46,9 @@ class doc_generic_order_odt extends ModelePDFCommandes public $emetteur; /** - * @var array() Minimum version of PHP required by module. + * @var array() Minimum version of PHP required by module. * e.g.: PHP ≥ 5.4 = array(5, 4) - */ + */ public $phpmin = array(5, 4); /** diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index cba8ed016b9..9cbd5f31959 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -7,6 +7,7 @@ * Copyright (C) 2012 Cedric Salvador * Copyright (C) 2015 Marcos García * Copyright (C) 2017-2018 Ferran Marcet + * Copyright (C) 2018 Frédéric France * * 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 @@ -887,7 +888,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetXY($col1x, $tab2_top + 0); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); - $total_ht = (($conf->multicurrency->enabled && isset($object->mylticurrency_tx) && $object->mylticurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = (($conf->multicurrency->enabled && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + 0); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (! empty($object->remise)?$object->remise:0), 0, $outputlangs), 0, 'R', 1); diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php index 5ba56d8b73d..8a3fdd53ebc 100644 --- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php +++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php @@ -44,9 +44,9 @@ class doc_generic_contract_odt extends ModelePDFContract public $emetteur; /** - * @var array() Minimum version of PHP required by module. + * @var array() Minimum version of PHP required by module. * e.g.: PHP ≥ 5.4 = array(5, 4) - */ + */ public $phpmin = array(5, 4); /** diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php index 53738f23df2..5a128ec99d3 100644 --- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php +++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php @@ -47,9 +47,9 @@ class doc_generic_shipment_odt extends ModelePdfExpedition public $emetteur; /** - * @var array() Minimum version of PHP required by module. + * @var array() Minimum version of PHP required by module. * e.g.: PHP ≥ 5.4 = array(5, 4) - */ + */ public $phpmin = array(5, 4); /** diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index 47689938fc1..93f4dbe88ca 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -45,9 +45,9 @@ class doc_generic_invoice_odt extends ModelePDFFactures public $emetteur; // Objet societe qui emet /** - * @var array() Minimum version of PHP required by module. + * @var array() Minimum version of PHP required by module. * e.g.: PHP ≥ 5.4 = array(5, 4) - */ + */ public $phpmin = array(5, 4); /** diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 44e88a64c17..7d39969ece9 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -8,6 +8,7 @@ * Copyright (C) 2012-2014 Raphaël Doursenaud * Copyright (C) 2015 Marcos García * Copyright (C) 2017-2018 Ferran Marcet + * Copyright (C) 2018 Frédéric France * * 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 @@ -1117,7 +1118,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetXY($col1x, $tab2_top + 0); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); - $total_ht = (($conf->multicurrency->enabled && isset($object->mylticurrency_tx) && $object->mylticurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = (($conf->multicurrency->enabled && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + 0); $pdf->MultiCell($largcol2, $tab2_hl, price($sign * ($total_ht + (! empty($object->remise)?$object->remise:0)), 0, $outputlangs), 0, 'R', 1); diff --git a/htdocs/core/modules/modBanque.class.php b/htdocs/core/modules/modBanque.class.php index 3ca1a082580..aebc570ab36 100644 --- a/htdocs/core/modules/modBanque.class.php +++ b/htdocs/core/modules/modBanque.class.php @@ -86,49 +86,49 @@ class modBanque extends DolibarrModules $r++; $this->rights[$r][0] = 111; // id de la permission - $this->rights[$r][1] = 'Lire les comptes bancaires'; // libelle de la permission + $this->rights[$r][1] = 'Read bank account and transactions'; $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'lire'; $r++; $this->rights[$r][0] = 112; // id de la permission - $this->rights[$r][1] = 'Creer/modifier montant/supprimer ecriture bancaire'; // libelle de la permission + $this->rights[$r][1] = 'Creer/modifier montant/supprimer ecriture bancaire'; $this->rights[$r][2] = 'w'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'modifier'; $r++; $this->rights[$r][0] = 113; // id de la permission - $this->rights[$r][1] = 'Configurer les comptes bancaires (creer, gerer categories)'; // libelle de la permission + $this->rights[$r][1] = 'Configurer les comptes bancaires (creer, gerer categories)'; $this->rights[$r][2] = 'a'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'configurer'; $r++; $this->rights[$r][0] = 114; // id de la permission - $this->rights[$r][1] = 'Rapprocher les ecritures bancaires'; // libelle de la permission + $this->rights[$r][1] = 'Rapprocher les ecritures bancaires'; $this->rights[$r][2] = 'w'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'consolidate'; $r++; $this->rights[$r][0] = 115; // id de la permission - $this->rights[$r][1] = 'Exporter transactions et releves'; // libelle de la permission + $this->rights[$r][1] = 'Exporter transactions et releves'; $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'export'; $r++; $this->rights[$r][0] = 116; // id de la permission - $this->rights[$r][1] = 'Virements entre comptes'; // libelle de la permission + $this->rights[$r][1] = 'Virements entre comptes'; $this->rights[$r][2] = 'w'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'transfer'; $r++; $this->rights[$r][0] = 117; // id de la permission - $this->rights[$r][1] = 'Gerer les envois de cheques'; // libelle de la permission + $this->rights[$r][1] = 'Gerer les envois de cheques'; $this->rights[$r][2] = 'w'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'cheque'; diff --git a/htdocs/core/modules/modSalaries.class.php b/htdocs/core/modules/modSalaries.class.php index 4b79261a8da..727b410cacb 100644 --- a/htdocs/core/modules/modSalaries.class.php +++ b/htdocs/core/modules/modSalaries.class.php @@ -50,7 +50,9 @@ class modSalaries extends DolibarrModules $this->db = $db; $this->numero = 510; // Perms from 501..519 - $this->family = "compta"; + // Family can be 'base' (core modules),'crm','financial','hr','projects','products','ecm','technic' (transverse modules),'interface' (link with external tools),'other','...' + // It is used to group modules by family in module setup page + $this->family = "financial"; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); // Module description used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) diff --git a/htdocs/core/modules/modStripe.class.php b/htdocs/core/modules/modStripe.class.php index 1f6f1e92f05..348b44aaa1d 100644 --- a/htdocs/core/modules/modStripe.class.php +++ b/htdocs/core/modules/modStripe.class.php @@ -102,7 +102,7 @@ class modStripe extends DolibarrModules 'langs'=>'stripe', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'position'=>500, 'enabled'=>'$conf->stripe->enabled && $conf->banque->enabled && $conf->global->MAIN_FEATURES_LEVEL >= 2', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. - 'perms'=>'$user->rights->banque->consolidate', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules + 'perms'=>'$user->rights->banque->modifier', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules 'target'=>'', 'user'=>2 ); // 0=Menu for internal users, 1=external users, 2=both @@ -117,8 +117,8 @@ class modStripe extends DolibarrModules 'url' => '', 'langs' => 'stripe', 'position' => 100, - 'enabled' => '$conf->global->MAIN_FEATURES_LEVEL >= 1', - 'perms' => '$user->rights->banque->configurer', + 'enabled' => '$conf->stripe->enabled && $conf->banque->enabled && $conf->global->MAIN_FEATURES_LEVEL >= 1', + 'perms' => '$user->rights->banque->lire', 'target' => '', 'user' => 0 ); @@ -131,8 +131,8 @@ class modStripe extends DolibarrModules 'url' => '/stripe/charge.php', 'langs' => 'stripe', 'position' => 102, - 'enabled' => '$conf->stripe->enabled && $conf->banque->enabled && $conf->global->MAIN_FEATURES_LEVEL >= 2', - 'perms' => '$user->rights->banque->configurer', + 'enabled' => '$conf->stripe->enabled && $conf->banque->enabled && $conf->global->MAIN_FEATURES_LEVEL >= 1', + 'perms' => '$user->rights->banque->lire', 'target' => '', 'user' => 0 ); @@ -145,8 +145,8 @@ class modStripe extends DolibarrModules 'url' => '/stripe/transaction.php', 'langs' => 'stripe', 'position' => 102, - 'enabled' => '$conf->stripe->enabled && $conf->banque->enabled && $conf->global->MAIN_FEATURES_LEVEL >= 2', - 'perms' => '$user->rights->banque->configurer', + 'enabled' => '$conf->stripe->enabled && $conf->banque->enabled && $conf->global->MAIN_FEATURES_LEVEL >= 1', + 'perms' => '$user->rights->banque->lire', 'target' => '', 'user' => 0 ); diff --git a/htdocs/core/modules/modSyslog.class.php b/htdocs/core/modules/modSyslog.class.php index d401b2f1621..7166a787809 100644 --- a/htdocs/core/modules/modSyslog.class.php +++ b/htdocs/core/modules/modSyslog.class.php @@ -85,7 +85,20 @@ class modSyslog extends DolibarrModules // Cronjobs $this->cronjobs = array( - 0=>array('label'=>'CompressSyslogs', 'jobtype'=>'method', 'class'=>'core/class/utils.class.php', 'objectname'=>'Utils', 'method'=>'compressSyslogs', 'parameters'=>'', 'comment'=>'Compress and archive log files. Warning: batch must be run with same account than your web server to avoid to get log files with different owner than required by web server. Another solution is to set web server Operating System group as the group of directory documents and set GROUP permission "rws" on this directory so log files will always have the group and permissions of the web server Operating System group', 'frequency'=>1, 'unitfrequency'=> 3600 * 24, 'priority'=>50, 'status'=>0, 'test'=>true), + 0 => array( + 'label' => 'CompressSyslogs', + 'jobtype' => 'method', + 'class' => 'core/class/utils.class.php', + 'objectname' => 'Utils', + 'method' => 'compressSyslogs', + 'parameters' => '', + 'comment' => 'Compress and archive log files. Warning: batch must be run with same account than your web server to avoid to get log files with different owner than required by web server. Another solution is to set web server Operating System group as the group of directory documents and set GROUP permission "rws" on this directory so log files will always have the group and permissions of the web server Operating System group', + 'frequency' => 1, + 'unitfrequency' => 3600 * 24, + 'priority' => 50, + 'status' => 0, + 'test' => true, + ), ); } } diff --git a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php index 4e22f24d9a3..1ee00f486e5 100644 --- a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php +++ b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php @@ -43,9 +43,9 @@ class doc_generic_product_odt extends ModelePDFProduct public $emetteur; /** - * @var array() Minimum version of PHP required by module. + * @var array() Minimum version of PHP required by module. * e.g.: PHP ≥ 5.4 = array(5, 4) - */ + */ public $phpmin = array(5, 4); /** diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index f653f2fdad7..d76ae3b586a 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -61,9 +61,9 @@ class doc_generic_task_odt extends ModelePDFTask public $emetteur; // Objet societe qui emet /** - * @var array() Minimum version of PHP required by module. + * @var array() Minimum version of PHP required by module. * e.g.: PHP ≥ 5.4 = array(5, 4) - */ + */ public $phpmin = array(5, 4); /** diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index 0d05f298e9c..6b5bf3fe3a2 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -44,9 +44,9 @@ class doc_generic_proposal_odt extends ModelePDFPropales public $emetteur; // Objet societe qui emet /** - * @var array() Minimum version of PHP required by module. + * @var array() Minimum version of PHP required by module. * e.g.: PHP ≥ 5.4 = array(5, 4) - */ + */ public $phpmin = array(5, 4); /** diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 50af3db805e..54009821fff 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -7,6 +7,7 @@ * Copyright (C) 2012 Cedric Salvador * Copyright (C) 2015 Marcos García * Copyright (C) 2017-2018 Ferran Marcet + * Copyright (C) 2018 Frédéric France * * 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 @@ -1064,7 +1065,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetXY($col1x, $tab2_top + 0); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); - $total_ht = (($conf->multicurrency->enabled && isset($object->mylticurrency_tx) && $object->mylticurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = (($conf->multicurrency->enabled && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + 0); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (! empty($object->remise)?$object->remise:0), 0, $outputlangs), 0, 'R', 1); diff --git a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php index 925876185be..fb600eee268 100644 --- a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php +++ b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php @@ -43,9 +43,9 @@ class doc_generic_stock_odt extends ModelePDFStock public $emetteur; /** - * @var array() Minimum version of PHP required by module. + * @var array() Minimum version of PHP required by module. * e.g.: PHP ≥ 5.4 = array(5, 4) - */ + */ public $phpmin = array(5, 4); /** diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index 2a317a4c7a2..243a692eed8 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -2,6 +2,7 @@ /* Copyright (C) 2010-2011 Juanjo Menent * Copyright (C) 2010-2014 Laurent Destailleur * Copyright (C) 2015 Marcos García + * Copyright (C) 2018 Frédéric France * * 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 @@ -648,7 +649,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->SetXY($col1x, $tab2_top + 0); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); - $total_ht = (($conf->multicurrency->enabled && isset($object->mylticurrency_tx) && $object->mylticurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = (($conf->multicurrency->enabled && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + 0); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + $object->remise), 0, 'R', 1); diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index 53636898fb9..1be46ee2eca 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -5,6 +5,7 @@ * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2015 Marcos García * Copyright (C) 2017 Ferran Marcet + * Copyright (C) 2018 Frédéric France * * 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 @@ -821,7 +822,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetXY($col1x, $tab2_top + 0); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); - $total_ht = (($conf->multicurrency->enabled && isset($object->mylticurrency_tx) && $object->mylticurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = (($conf->multicurrency->enabled && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + 0); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (! empty($object->remise)?$object->remise:0)), 0, 'R', 1); diff --git a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php index b34fb7b03e6..f483738ecb7 100644 --- a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php @@ -44,9 +44,9 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal public $emetteur; /** - * @var array() Minimum version of PHP required by module. + * @var array() Minimum version of PHP required by module. * e.g.: PHP ≥ 5.4 = array(5, 4) - */ + */ public $phpmin = array(5, 4); /** diff --git a/htdocs/core/modules/ticket/mod_ticket_universal.php b/htdocs/core/modules/ticket/mod_ticket_universal.php index adca6897ac3..b6dd2a2873b 100644 --- a/htdocs/core/modules/ticket/mod_ticket_universal.php +++ b/htdocs/core/modules/ticket/mod_ticket_universal.php @@ -38,7 +38,7 @@ class mod_ticket_universal extends ModeleNumRefTicket /** * @var string Error code (or message) */ - public $error = ''; + public $error = ''; /** * @var string Nom du modele diff --git a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php index ab581553ab6..bce2aca823a 100644 --- a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php +++ b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php @@ -42,9 +42,9 @@ class doc_generic_user_odt extends ModelePDFUser public $emetteur; /** - * @var array() Minimum version of PHP required by module. + * @var array() Minimum version of PHP required by module. * e.g.: PHP ≥ 5.4 = array(5, 4) - */ + */ public $phpmin = array(5, 4); /** diff --git a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php index b89f68d755b..798231ed688 100644 --- a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php +++ b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php @@ -44,9 +44,9 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup public $emetteur; /** - * @var array() Minimum version of PHP required by module. + * @var array() Minimum version of PHP required by module. * e.g.: PHP ≥ 5.4 = array(5, 4) - */ + */ public $phpmin = array(5, 4); /** diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index 777bd4b4d15..ed093e4c506 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -24,34 +24,36 @@ * $parameters * $cols */ - // Protection to avoid direct call of template if (empty($object) || ! is_object($object)) { print "Error, template page can't be called as URL"; exit; } + if (! is_object($form)) $form=new Form($db); + ?> fk_soc)) $parameters['socid'] = $object->fk_soc; - $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); print $hookmanager->resPrint; if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + //var_dump($extrafields->attributes[$object->table_element]); if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]['label'])) + { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $label) { // Discard if extrafield is a hidden field on form + $enabled = 1; if ($enabled && isset($extrafields->attributes[$object->table_element]['enabled'][$key])) { @@ -74,7 +76,6 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] // Load language if required if (! empty($extrafields->attributes[$object->table_element]['langfile'][$key])) $langs->load($extrafields->attributes[$object->table_element]['langfile'][$key]); - if ($action == 'edit_extras') { $value = (isset($_POST["options_" . $key]) ? $_POST["options_" . $key] : $object->array_options["options_" . $key]); @@ -96,6 +97,7 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] print ''; if (! empty($extrafields->attributes[$object->table_element]['help'][$key])) print $form->textwithpicto($langs->trans($label), $langs->trans($extrafields->attributes[$object->table_element]['help'][$key])); @@ -105,18 +107,15 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] //TODO Improve element and rights detection //var_dump($user->rights); $permok=false; - $keyforperm=$object->element; if ($object->element == 'fichinter') $keyforperm='ficheinter'; if (isset($user->rights->$keyforperm)) $permok=$user->rights->$keyforperm->creer||$user->rights->$keyforperm->create||$user->rights->$keyforperm->write; - if ($object->element=='order_supplier') $permok=$user->rights->fournisseur->commande->creer; if ($object->element=='invoice_supplier') $permok=$user->rights->fournisseur->facture->creer; if ($object->element=='shipping') $permok=$user->rights->expedition->creer; if ($object->element=='delivery') $permok=$user->rights->expedition->livraison->creer; if ($object->element=='productlot') $permok=$user->rights->stock->creer; if ($object->element=='facturerec') $permok=$user->rights->facture->creer; - if (($object->statut == 0 || ! empty($extrafields->attributes[$object->table_element]['alwayseditable'][$key])) && $permok && ($action != 'edit_extras' || GETPOST('attribute') != $key) && empty($extrafields->attributes[$object->table_element]['computed'][$key])) @@ -129,6 +128,7 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] print ''; $html_id = !empty($object->id) ? $object->element.'_extras_'.$key.'_'.$object->id : ''; + print ''; print '' . "\n"; } @@ -203,11 +202,10 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] }); }); } - setListDependencies(); }); '."\n"; } } ?> - \ No newline at end of file + diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 848ac6dbf21..776506bdaee 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -66,7 +66,7 @@ $domData .= ' data-product_type="'.$line->product_type.'"'; ?> - > + > global->MAIN_VIEW_LINE_NUMBER)) { ?> diff --git a/htdocs/langs/en_US/boxes.lang b/htdocs/langs/en_US/boxes.lang index 96c23413955..4ae24fd2abe 100644 --- a/htdocs/langs/en_US/boxes.lang +++ b/htdocs/langs/en_US/boxes.lang @@ -73,10 +73,10 @@ BoxProposalsPerMonth=Proposals per month NoTooLowStockProducts=No products are under the low stock limit BoxProductDistribution=Products/Services Distribution BoxProductDistributionFor=Distribution of %s by %s -BoxTitleLastModifiedSupplierBills=Supplier Invoices: last %s modified -BoxTitleLatestModifiedSupplierOrders=Supplier Orders: last %s modified -BoxTitleLastModifiedCustomerBills=Customer Invoices: last %s modified -BoxTitleLastModifiedCustomerOrders=Customer Orders: last %s modified +BoxTitleLastModifiedSupplierBills=Latest %s modified vendors invoices +BoxTitleLatestModifiedSupplierOrders=Last %s modified purchase orders +BoxTitleLastModifiedCustomerBills=Latest %s modified customers invoices +BoxTitleLastModifiedCustomerOrders=Latest %s modified customer orders BoxTitleLastModifiedPropals=Latest %s modified proposals ForCustomersInvoices=Customers invoices ForCustomersOrders=Customers orders diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 5e8e9ff62da..7bbd173be30 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -328,7 +328,7 @@ Copy=Copy Paste=Paste Default=Default DefaultValue=Default value -DefaultValues=Default values +DefaultValues=Default values/filters/sorting Price=Price PriceCurrency=Price (currency) UnitPrice=Unit price @@ -951,3 +951,4 @@ Deletedraft=Delete draft ConfirmMassDraftDeletion=Draft mass delete confirmation FileSharedViaALink=File shared via a link SelectAThirdPartyFirst=Select a third party first... +YouAreCurrentlyInSandboxMode=You are currently in the %s "sandbox" mode diff --git a/htdocs/langs/en_US/paypal.lang b/htdocs/langs/en_US/paypal.lang index 724a3bbd813..c088debc518 100644 --- a/htdocs/langs/en_US/paypal.lang +++ b/htdocs/langs/en_US/paypal.lang @@ -14,7 +14,6 @@ PaypalModeOnlyPaypal=PayPal only ONLINE_PAYMENT_CSS_URL=Optional URL of CSS stylesheet on online payment page ThisIsTransactionId=This is id of transaction: %s PAYPAL_ADD_PAYMENT_URL=Add the url of PayPal payment when you send a document by mail -YouAreCurrentlyInSandboxMode=You are currently in the %s "sandbox" mode NewOnlinePaymentReceived=New online payment received NewOnlinePaymentFailed=New online payment tried but failed ONLINE_PAYMENT_SENDEMAIL=EMail to warn after a payment (success or not) diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index 6fba0af2b64..b68102ef90d 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -327,7 +327,7 @@ Copy=Copier Paste=Coller Default=Défaut DefaultValue=Valeur par défaut -DefaultValues=Valeurs par défaut +DefaultValues=Valeurs/Filtres/Tri par défaut Price=Prix PriceCurrency=Prix ​​(devise) UnitPrice=Prix unitaire diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php index cbd78a763dc..e0e4b590c1a 100644 --- a/htdocs/loan/class/loan.class.php +++ b/htdocs/loan/class/loan.class.php @@ -454,6 +454,36 @@ class Loan extends CommonObject return $result; } + + /** + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return void + */ + function initAsSpecimen() + { + global $user, $langs, $conf; + + $now=dol_now(); + + // Initialise parameters + $this->id = 0; + $this->fk_bank = 1; + $this->label = 'SPECIMEN'; + $this->specimen = 1; + $this->socid = 1; + $this->account_capital = 16; + $this->account_insurance = 616; + $this->account_interest = 518; + $this->datestart = $now; + $this->dateend = $now + (3600 * 24 * 365); + $this->note_public = 'SPECIMEN'; + $this->capital = 20000; + $this->nbterm = 48; + $this->rate = 4.3; + } /** * Return amount of payments already done diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 83ebdc47507..3303d63ef81 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -712,6 +712,9 @@ foreach ($listofreferent as $key => $value) $testnew=$value['testnew']; $project_field=$value['project_field']; + $exclude_select_element = array('payment_various'); + if (!empty($value['exclude_select_element'])) $exclude_select_element[] = $value['exclude_select_element']; + if ($qualified) { // If we want the project task array to have details of users @@ -731,7 +734,7 @@ foreach ($listofreferent as $key => $value) if (! empty($conf->global->PROJECT_OTHER_THIRDPARTY_ID_TO_ADD_ELEMENTS)) $idtofilterthirdparty.=','.$conf->global->PROJECT_OTHER_THIRDPARTY_ID_TO_ADD_ELEMENTS; } - if (empty($conf->global->PROJECT_LINK_ON_OVERWIEW_DISABLED) && $idtofilterthirdparty && !in_array($tablename, array('payment_various'))) + if (empty($conf->global->PROJECT_LINK_ON_OVERWIEW_DISABLED) && $idtofilterthirdparty && !in_array($tablename,$exclude_select_element)) { $selectList=$formproject->select_element($tablename, $idtofilterthirdparty, 'minwidth300',-2,!empty($project_field)?$project_field:'fk_projet'); if (! $selectList || ($selectList<0)) diff --git a/htdocs/stripe/charge.php b/htdocs/stripe/charge.php index d39cac84eca..0f26bf0e11a 100644 --- a/htdocs/stripe/charge.php +++ b/htdocs/stripe/charge.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2018 Thibault FOUCART * * 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 @@ -62,13 +62,13 @@ llxHeader('', $langs->trans("StripeChargeList")); if (! empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox','alpha'))) { $service = 'StripeTest'; - $servicestatus = '0'; + $servicestatus = '0'; dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning'); } else { - $service = 'StripeLive'; - $servicestatus = '1'; + $service = 'StripeLive'; + $servicestatus = '1'; } $stripeacc = $stripe->getStripeAccount($service); @@ -150,7 +150,7 @@ if (!$rowid) print ''; - if (! empty($conf->stripe->enabled) && !empty($stripeacc)) $connect=$stripeacc.'/'; + if (!empty($stripeacc)) $connect=$stripeacc.'/'; // Ref $url='https://dashboard.stripe.com/'.$connect.'test/payments/'.$charge->id; diff --git a/htdocs/stripe/transaction.php b/htdocs/stripe/transaction.php index cbc6013644d..595583a63f1 100644 --- a/htdocs/stripe/transaction.php +++ b/htdocs/stripe/transaction.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2018 Thibault FOUCART * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -26,9 +26,7 @@ require_once DOL_DOCUMENT_ROOT.'/stripe/class/stripe.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; -if (! empty($conf->accounting->enabled)) { - require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php'; -} +if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php'; // Load translation files required by the page $langs->loadLangs(array('compta', 'salaries', 'bills', 'hrm', 'stripe')); @@ -65,14 +63,16 @@ llxHeader('', $langs->trans("StripeTransactionList")); if (! empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox','alpha'))) { $service = 'StripeTest'; + $servicestatus = '0'; dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning'); } else { $service = 'StripeLive'; + $servicestatus = '1'; } -$stripeaccount = $stripe->getStripeAccount($service); +$stripeacc = $stripe->getStripeAccount($service); /*if (empty($stripeaccount)) { print $langs->trans('ErrorStripeAccountNotDefined'); @@ -81,9 +81,8 @@ $stripeaccount = $stripe->getStripeAccount($service); if (! $rowid) { print '
'; - if ($optioncss != '') { - print ''; - } + if ($optioncss != '') + print ''; print ''; print ''; print ''; @@ -92,7 +91,7 @@ if (! $rowid) { print ''; $title=$langs->trans("StripeTransactionList"); - $title.=($stripeaccount?' (Stripe connection with Stripe OAuth Connect account '.$stripeaccount.')':' (Stripe connection with keys from Stripe module setup)'); + $title.=($stripeaccount?' (Stripe connection with Stripe OAuth Connect account '.$stripeacc.')':' (Stripe connection with keys from Stripe module setup)'); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'title_accountancy.png', 0, '', '', $limit); @@ -113,9 +112,9 @@ if (! $rowid) { print "
\n"; - if ($stripeaccount) + if ($stripeacc) { - $txn = \Stripe\BalanceTransaction::all(array("limit" => $limit), array("stripe_account" => $stripeaccount)); + $txn = \Stripe\BalanceTransaction::all(array("limit" => $limit), array("stripe_account" => $stripeacc)); } else { @@ -160,9 +159,28 @@ if (! $rowid) { $societestatic->societe_id = $obj->fk_soc; print ''; - + // Ref - print "\n"; + if (!empty($stripeacc)) $connect=$stripeacc.'/'; + + // Ref + if (preg_match('/po_/i', $txn->source)){ + $origin="payouts"; + } elseif (preg_match('/fee_/i', $txn->source)) { + $origin="connect/application_fees"; + } else { + $origin="payments"; + } + + $url='https://dashboard.stripe.com/'.$connect.'test/'.$origin.'/'.$txn->source; + if ($servicestatus) + { + $url='https://dashboard.stripe.com/'.$connect.$origin.'/'.$txn->source; + } + if ($txn->type == 'stripe_fee' || $txn->type == 'reserve_transaction') { + print ""; + } else print "\n"; + // Stripe customer //print "\n"; // Link @@ -177,16 +195,15 @@ if (! $rowid) { } print "\n";*/ // Origine - //print "\n"; // Date payment @@ -198,13 +215,12 @@ if (! $rowid) { print ""; // Status print "'; print "\n"; } diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index d6595554dab..430bb2f121c 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1378,7 +1378,7 @@ div.nopadding { margin : 0px auto; } -#pictotitle { +.pictotitle { margin-: 8px; margin-bottom: 4px; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 6862825d2ed..d88a84c5090 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1372,7 +1372,7 @@ table.noborder tr.liste_titre td { margin : 0px auto; } -#pictotitle { +.pictotitle { margin-: 8px; margin-bottom: 4px; } diff --git a/test/phpunit/AllTests.php b/test/phpunit/AllTests.php index 15c3ee3f429..008014fbcb5 100644 --- a/test/phpunit/AllTests.php +++ b/test/phpunit/AllTests.php @@ -195,6 +195,8 @@ class AllTests $suite->addTestSuite('HolidayTest'); require_once dirname(__FILE__).'/ExpenseReportTest.php'; $suite->addTestSuite('ExpenseReportTest'); + require_once dirname(__FILE__).'/LoanTest.php'; + $suite->addTestSuite('LoanTest'); require_once dirname(__FILE__).'/EntrepotTest.php'; $suite->addTestSuite('EntrepotTest'); diff --git a/test/phpunit/LoanTest.php b/test/phpunit/LoanTest.php new file mode 100644 index 00000000000..d54c810049d --- /dev/null +++ b/test/phpunit/LoanTest.php @@ -0,0 +1,217 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * or see http://www.gnu.org/ + */ + +/** + * \file test/phpunit/LoanTest.php + * \ingroup test + * \brief PHPUnit test + * \remarks To run this script as CLI: phpunit filename.php + */ + +global $conf,$user,$langs,$db; +//define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver +//require_once 'PHPUnit/Autoload.php'; +require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; +require_once dirname(__FILE__).'/../../htdocs/loan/class/loan.class.php'; + +if (empty($user->id)) +{ + print "Load permissions for admin user nb 1\n"; + $user->fetch(1); + $user->getrights(); +} +$conf->global->MAIN_DISABLE_ALL_MAILS=1; + + +/** + * Class for PHPUnit tests + * + * @backupGlobals disabled + * @backupStaticAttributes enabled + * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. + */ +class LoanTest extends PHPUnit_Framework_TestCase +{ + protected $savconf; + protected $savuser; + protected $savlangs; + protected $savdb; + + /** + * Constructor + * We save global variables into local variables + * + * @return LoanTest + */ + function __construct() + { + parent::__construct(); + + //$this->sharedFixture + global $conf,$user,$langs,$db; + $this->savconf=$conf; + $this->savuser=$user; + $this->savlangs=$langs; + $this->savdb=$db; + + print __METHOD__." db->type=".$db->type." user->id=".$user->id; + //print " - db ".$db->db; + print "\n"; + } + + // Static methods + public static function setUpBeforeClass() + { + global $conf,$user,$langs,$db; + $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. + + print __METHOD__."\n"; + } + + // tear down after class + public static function tearDownAfterClass() + { + global $conf,$user,$langs,$db; + $db->rollback(); + + print __METHOD__."\n"; + } + + /** + * Init phpunit tests + * + * @return void + */ + protected function setUp() + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + print __METHOD__."\n"; + //print $db->getVersion()."\n"; + } + /** + * End phpunit tests + * + * @return void + */ + protected function tearDown() + { + print __METHOD__."\n"; + } + + /** + * testLoanCreate + * + * @return void + */ + public function testLoanCreate() + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + $localobject=new Loan($this->savdb); + $localobject->initAsSpecimen(); + $result=$localobject->create($user); + + $this->assertLessThan($result, 0); + print __METHOD__." result=".$result."\n"; + return $result; + } + + /** + * testLoanFetch + * + * @param int $id Id of object + * @return void + * + * @depends testLoanCreate + * The depends says test is run only if previous is ok + */ + public function testLoanFetch($id) + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + $localobject=new Loan($this->savdb); + $result=$localobject->fetch($id); + + $this->assertLessThan($result, 0); + print __METHOD__." id=".$id." result=".$result."\n"; + return $localobject; + } + + /** + * testLoanOther + * + * @param Loan $localobject Loan + * @return int + * + * @depends testLoanFetch + * The depends says test is run only if previous is ok + */ + public function testLoanOther($localobject) + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + $result=$localobject->set_paid($user); + + print __METHOD__." id=".$localobject->id." result=".$result."\n"; + $this->assertLessThan($result, 0); + return $localobject->id; + } + + /** + * testLoanDelete + * + * @param int $id Id of loan + * @return void + * + * @depends testLoanCreate + * The depends says test is run only if previous is ok + */ + public function testLoanDelete($id) + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + $localobject=new Loan($this->savdb); + $result=$localobject->fetch($id); + $result=$localobject->delete($user); + + print __METHOD__." id=".$id." result=".$result."\n"; + $this->assertLessThan($result, 0); + return $result; + } +}
'.img_picto('',$picto, 'class="valignmiddle widthpictotitle" id="pictotitle"', $pictoisfullpath).''.img_picto('',$picto, 'class="valignmiddle widthpictotitle pictotitle"', $pictoisfullpath).''; $return.= '
'.$titre.'
'; $return.= '
'; // Convert date into timestamp format @@ -143,21 +143,19 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] //print 'x'.$object->array_options['options_' . $key].'-'.$datenotinstring.' - '.dol_print_date($datenotinstring, 'dayhour'); $value = isset($_POST["options_" . $key]) ? dol_mktime($_POST["options_" . $key . "hour"], $_POST["options_" . $key . "min"], 0, $_POST["options_" . $key . "month"], $_POST["options_" . $key . "day"], $_POST["options_" . $key . "year"]) : $datenotinstring; } - //TODO Improve element and rights detection if ($action == 'edit_extras' && $permok && GETPOST('attribute','none') == $key) { $fieldid='id'; if ($object->table_element == 'societe') $fieldid='socid'; - print '
'; print ''; print ''; print ''; print ''; - print $extrafields->showInputField($key, $value, '', '', '', 0, $object->id); + print ''; print '
'; @@ -167,6 +165,7 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] //print $key.'-'.$value.'-'.$object->table_element; print $extrafields->showOutputField($key, $value, '', $object->table_element); } + print '
" . $txn->source . "".$txn->type."".img_picto($langs->trans('ShowInStripe'), 'object_globe')." " . $txn->source . "".$charge->customer.""; ////if ($charge->metadata->dol_type=="order"){ // $object = new Commande($db); // $object->fetch($charge->metadata->dol_id); - // print "".img_picto('', 'object_order')." ".$object->ref.""; + // print "".img_picto('', 'object_order')." ".$object->ref.""; //} elseif ($charge->metadata->dol_type=="invoice"){ // $object = new Facture($db); // $object->fetch($charge->metadata->dol_id); - // print "".img_picto('', 'object_invoice')." ".$object->ref.""; + // print "".img_picto('', 'object_invoice')." ".$object->ref.""; //} //print "" . price(($txn->fee) / 100, 0, '', 1, - 1, - 1, strtoupper($txn->currency)) . ""; - if ($txn->status=='available') { - print img_picto($langs->trans("".$txn->status.""),'statut4'); - } elseif ($txn->status=='pending') { - print img_picto($langs->trans("".$txn->status.""),'statut7'); - } elseif ($txn->status=='failed') { - print img_picto($langs->trans("".$txn->status.""),'statut8'); - } + if ($txn->status=='available') + {print img_picto($langs->trans("".$txn->status.""),'statut4');} + elseif ($txn->status=='pending') + {print img_picto($langs->trans("".$txn->status.""),'statut7');} + elseif ($txn->status=='failed') + {print img_picto($langs->trans("".$txn->status.""),'statut8');} print '