diff --git a/.editorconfig b/.editorconfig index 143f0739505..5b3e0d6a8df 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,14 +8,10 @@ charset = utf-8 end_of_line = lf insert_final_newline = true [*.php] -indent_style = space -indent_size = 4 +indent_style = tab [*.js] -indent_style = space -indent_size = 2 +indent_style = tab [*.css] -indent_style = space -indent_size = 2 +indent_style = tab [*.xml] -indent_style = space -indent_size = 4 +indent_style = tab diff --git a/htdocs/adherents/admin/public.php b/htdocs/adherents/admin/public.php index 0f92e017437..19fce918a31 100644 --- a/htdocs/adherents/admin/public.php +++ b/htdocs/adherents/admin/public.php @@ -164,7 +164,7 @@ print ''; print ''; print $langs->trans("DefaultAmount"); print ''; -print '';; +print ''; print "\n"; // Can edit @@ -197,7 +197,7 @@ if (! empty($conf->paybox->enabled) || ! empty($conf->paypal->enabled)) print ''; print $langs->trans("MEMBER_PAYONLINE_SENDEMAIL"); print ''; - print '';; + print ''; print "\n"; } diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 6aa9e074ff6..0fe6366ae58 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -249,7 +249,7 @@ if (empty($reshook)) } $lastname=$_POST["lastname"]; $firstname=$_POST["firstname"]; - $morphy=$morphy=$_POST["morphy"];; + $morphy=$morphy=$_POST["morphy"]; if ($morphy != 'mor' && empty($lastname)) { $error++; $langs->load("errors"); diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 8de52ef73c5..167b38562ad 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -913,7 +913,7 @@ if ($id) print ""; $colspan=count($fieldlist)+2; - if ($id == 4) $colspan++;; + if ($id == 4) $colspan++; if (! empty($alabelisused)) // Si un des champs est un libelle { diff --git a/htdocs/cashdesk/admin/cashdesk.php b/htdocs/cashdesk/admin/cashdesk.php index 7be283528b4..4739a55e2c8 100644 --- a/htdocs/cashdesk/admin/cashdesk.php +++ b/htdocs/cashdesk/admin/cashdesk.php @@ -164,7 +164,7 @@ if (! empty($conf->service->enabled)) $var=! $var; print ''; print $langs->trans("CashdeskShowServices"); - print '';; + print ''; print $form->selectyesno("CASHDESK_SERVICES",$conf->global->CASHDESK_SERVICES,1); print "\n"; } diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 3149d9ae4e2..22e84f88d61 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -1164,7 +1164,7 @@ class Categorie extends CommonObject { $cats = array(); - $typeid=-1; $table='';; + $typeid=-1; $table=''; if ($type == '0' || $type == 'product') { $typeid=0; $table='product'; $type='product'; } else if ($type == '1' || $type == 'supplier') { $typeid=1; $table='societe'; $type='fournisseur'; } else if ($type == '2' || $type == 'customer') { $typeid=2; $table='societe'; $type='societe'; } diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 27d958914a2..81e8b396963 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -155,7 +155,7 @@ if (empty($reshook)) if ($action == 'setoutstanding_limit') { $object->fetch($id); - $object->outstanding_limit=GETPOST('setoutstanding_limit'); + $object->outstanding_limit=GETPOST('outstanding_limit'); $result=$object->set_OutstandingBill($user); if ($result < 0) setEventMessage($object->error,'errors'); } @@ -406,9 +406,15 @@ if ($id > 0) $limit_field_type = (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE)) ? 'numeric' : 'amount'; print $form->editfieldval("OutstandingBill",'outstanding_limit',$object->outstanding_limit,$object,$user->rights->societe->creer,$limit_field_type,($object->outstanding_limit != '' ? price($object->outstanding_limit) : '')); // display amount and link to unpaid bill - $outstandigBills = $object->get_OutstandingBill(); - if ($outstandigBills != 0) - print " (".$langs->trans("CurrentOutstandingBill")." ".price($outstandigBills, '', $langs, 0, 0, -1, $conf->currency).')'; + $outstandingBills = $object->get_OutstandingBill(); + if ($outstandingBills != 0) { + print ' ('.$langs->trans("CurrentOutstandingBill"); + print ' '; + print price($outstandingBills, '', $langs, 0, -1, -1, $conf->currency); + print ''; + if ($outstandingBills > $object->outstanding_limit) print img_warning($langs->trans("OutstandingBillReached")); + print ')'; + } print ''; print ''; } diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 2a845f1e6e1..6705752e71e 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -579,6 +579,103 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) } } +/* + * Opened Order + */ +if (! empty($conf->commande->enabled) && $user->rights->commande->lire) +{ + $langs->load("order"); + + $sql = "SELECT s.nom as name, s.rowid, c.rowid as commandeid, c.total as total_ttc, c.total_ht, c.tva as total_tva, c.ref, c.ref_client, c.fk_statut, c.date_valid as dv "; + $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; + $sql.= ", ".MAIN_DB_PREFIX."commande as c"; + if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql.= " WHERE c.fk_soc = s.rowid"; + $sql.= " AND c.entity = ".$conf->entity; + $sql.= " AND c.fk_statut = 1"; + if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; + if ($socid) $sql.= " AND s.rowid = ".$socid; + $sql.= " ORDER BY c.rowid DESC"; + + $result=$db->query($sql); + if ($result) + { + $total = 0; + $num = $db->num_rows($result); + $i = 0; + if ($num > 0) + { + $var=true; + + print ''; + print ''; + + $nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?500:$conf->global->MAIN_MAXLIST_OVERLOAD)); + while ($i < $nbofloop) + { + $obj = $db->fetch_object($result); + $var=!$var; + print ''; + + // Ref + print '"; + + print ''; + print ''."\n"; + print ''; + print ''."\n"; + print ''."\n"; + $i++; + $total += $obj->total_ttc; + } + if ($num > $nbofloop) + { + print '"; + } + else if ($total>0) + { + print '"; + } + print "
'.$langs->trans("OrdersOpened").' '.$num.'
'; + + $orderstatic->id=$obj->commandeid; + $orderstatic->ref=$obj->ref; + $orderstatic->ref_client=$obj->ref_client; + $orderstatic->total_ht = $obj->total_ht; + $orderstatic->total_tva = $obj->total_tva; + $orderstatic->total_ttc = $obj->total_ttc; + + print ''; + print ''; + print ''; + print '
'; + print $orderstatic->getNomUrl(1); + print ''; + //if ($db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); + print ''; + $filename=dol_sanitizeFileName($obj->ref); + $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); + $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->propalid; + print $formfile->getDocumentsLink($orderstatic->element, $filename, $filedir); + print '
'; + + print "
'; + $companystatic->id=$obj->rowid; + $companystatic->name=$obj->name; + $companystatic->client=$obj->client; + $companystatic->canvas=$obj->canvas; + print $companystatic->getNomUrl(1, 'company', 44); + print ''; + print dol_print_date($db->jdate($obj->dp),'day').''.price($obj->total_ttc).''.$orderstatic->LibStatut($obj->fk_statut,3).'
'.$langs->trans("XMoreLines", ($num - $nbofloop))."
'.$langs->trans("Total")."".price($total)." 

"; + } + } + else + { + dol_print_error($db); + } +} + + print ''; diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index 6f207b198cf..c89f45d0d2c 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -379,7 +379,7 @@ else elseif ($links[$key]['type']=='payment_supplier') { $paymentsupplierstatic->id=$links[$key]['url_id']; - $paymentsupplierstatic->ref=$langs->trans("Payment");; + $paymentsupplierstatic->ref=$langs->trans("Payment"); print ' '.$paymentsupplierstatic->getNomUrl(1); $newline=0; } diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 169e499b619..01df11a61ab 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1966,12 +1966,12 @@ if ($action == 'create') print $soc->getNomUrl(1); print ''; // Outstanding Bill - $outstandigBills = $soc->get_OutstandingBill(); + $outstandingBills = $soc->get_OutstandingBill(); print ' (' . $langs->trans('CurrentOutstandingBill') . ': '; - print price($outstandigBills, '', $langs, 0, 0, -1, $conf->currency); + print price($outstandingBills, '', $langs, 0, 0, -1, $conf->currency); if ($soc->outstanding_limit != '') { - if ($outstandigBills > $soc->outstanding_limit) print img_warning($langs->trans("OutstandingBillReached")); + if ($outstandingBills > $soc->outstanding_limit) print img_warning($langs->trans("OutstandingBillReached")); print ' / ' . price($soc->outstanding_limit, '', $langs, 0, 0, -1, $conf->currency); } print ')'; @@ -2832,11 +2832,11 @@ if ($action == 'create') print '   '; print '(' . $langs->trans('OtherBills') . ''; // Outstanding Bill - $outstandigBills = $soc->get_OutstandingBill(); + $outstandingBills = $soc->get_OutstandingBill(); print ' - ' . $langs->trans('CurrentOutstandingBill') . ': '; - print price($outstandigBills, '', $langs, 0, 0, - 1, $conf->currency); + print price($outstandingBills, '', $langs, 0, 0, - 1, $conf->currency); if ($soc->outstanding_limit != '') { - if ($outstandigBills > $soc->outstanding_limit) + if ($outstandingBills > $soc->outstanding_limit) print img_warning($langs->trans("OutstandingBillReached")); print ' / ' . price($soc->outstanding_limit); } diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index f704ca90f73..a44cb4ed48e 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -298,7 +298,7 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++) if ($annee_decalage != $year_end) print ' '; } - $total_ht[$annee]+=!empty($cum_ht[$case]) ? $cum_ht[$case] : 0;; + $total_ht[$annee]+=!empty($cum_ht[$case]) ? $cum_ht[$case] : 0; $total[$annee]+=$cum[$case]; } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index f2e4980ea47..6a15904ffab 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3350,25 +3350,26 @@ abstract class CommonObject $this->db->begin(); $sql = "DELETE FROM ".MAIN_DB_PREFIX."element_resources"; - $sql.= " WHERE rowid =".$rowid; + $sql.= " WHERE rowid=".$rowid; dol_syslog(get_class($this)."::delete_resource", LOG_DEBUG); - if ($this->db->query($sql)) - { - if (! $notrigger) + $resql=$this->db->query($sql); + if (! $resql) + { + $this->error=$this->db->lasterror(); + $this->db->rollback(); + return -1; + } + else + { + if (! $notrigger) { $result=$this->call_trigger(strtoupper($element).'_DELETE_RESOURCE', $user); if ($result < 0) { $this->db->rollback(); return -1; } } - - return 1; - } - else - { - $this->error=$this->db->lasterror(); - $this->db->rollback(); - return -1; - } + $this->db->commit(); + return 1; + } } diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 4a8ae857a2d..44507bbb919 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -1,7 +1,7 @@ * Copyright (C) 2005-2011 Regis Houssin - * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2011-2015 Juanjo Menent * * 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 @@ -836,18 +836,18 @@ function monthArray($outputlangs,$short=0) if (! empty($short)) { $montharray = array ( - 1 => $outputlangs->trans("Jan"), - 2 => $outputlangs->trans("Feb"), - 3 => $outputlangs->trans("Mar"), - 4 => $outputlangs->trans("Apr"), - 5 => $outputlangs->trans("May"), - 6 => $outputlangs->trans("Jun"), - 7 => $outputlangs->trans("Jul"), - 8 => $outputlangs->trans("Aug"), - 9 => $outputlangs->trans("Sep"), - 10 => $outputlangs->trans("Oct"), - 11 => $outputlangs->trans("Nov"), - 12 => $outputlangs->trans("Dec") + 1 => $outputlangs->trans("JanuaryMin"), + 2 => $outputlangs->trans("FebruaryMin"), + 3 => $outputlangs->trans("MarchMin"), + 4 => $outputlangs->trans("AprilMin"), + 5 => $outputlangs->trans("MayMin"), + 6 => $outputlangs->trans("JuneMin"), + 7 => $outputlangs->trans("JulyMin"), + 8 => $outputlangs->trans("AugustMin"), + 9 => $outputlangs->trans("SeptemberMin"), + 10 => $outputlangs->trans("OctoberMin"), + 11 => $outputlangs->trans("NovemberMin"), + 12 => $outputlangs->trans("DecemberMin") ); } diff --git a/htdocs/core/lib/memory.lib.php b/htdocs/core/lib/memory.lib.php index a6fae1c7b1f..b68016c3a46 100644 --- a/htdocs/core/lib/memory.lib.php +++ b/htdocs/core/lib/memory.lib.php @@ -231,7 +231,7 @@ function dol_getshmop($memoryid) global $shmkeys,$shmoffset; if (empty($shmkeys[$memoryid]) || ! function_exists("shmop_open")) return 0; - $shmkey=dol_getshmopaddress($memoryid);; + $shmkey=dol_getshmopaddress($memoryid); //print 'dol_getshmop memoryid='.$memoryid." shmkey=".$shmkey."
\n"; $handle=@shmop_open($shmkey,'a',0,0); if ($handle) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 2aa3ae93474..af37283d074 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -117,17 +117,17 @@ function task_prepare_head($object) $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/task.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');; + $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/task.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':''); $head[$h][1] = $langs->trans("Card"); $head[$h][2] = 'task_task'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/contact.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');; + $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/contact.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':''); $head[$h][1] = $langs->trans("TaskRessourceLinks"); $head[$h][2] = 'task_contact'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/time.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');; + $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/time.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':''); $head[$h][1] = $langs->trans("TimeSpent"); $head[$h][2] = 'task_time'; $h++; @@ -143,14 +143,14 @@ function task_prepare_head($object) $nbNote = 0; if(!empty($object->note_private)) $nbNote++; if(!empty($object->note_public)) $nbNote++; - $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/note.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');; + $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/note.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':''); $head[$h][1] = $langs->trans('Notes'); if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; $head[$h][2] = 'task_notes'; $h++; } - $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/document.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');; + $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/document.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':''); $filesdir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($object->project->ref) . '/' .dol_sanitizeFileName($object->ref); include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $listoffiles=dol_dir_list($filesdir,'files',1,'','thumbs'); diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php index f6623362dcc..a163047e61b 100644 --- a/htdocs/core/lib/tax.lib.php +++ b/htdocs/core/lib/tax.lib.php @@ -496,7 +496,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, $sql.= " AND f.fk_statut in (1,2)"; // Paid (partially or completely) if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2,5)"; else $sql.= " AND f.type IN (0,1,2,3,5)"; - $sql.= " AND f.rowid = d.".$fk_facture;; + $sql.= " AND f.rowid = d.".$fk_facture; $sql.= " AND pf.".$fk_facture2." = f.rowid"; $sql.= " AND pa.rowid = pf.".$fk_payment; if ($y && $m) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 3139963a6c3..e076e674be2 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -218,9 +218,9 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0) // Tools - $tmpentry=array('enabled'=>(! empty($conf->barcode->enabled) || ! empty($conf->mailing->enabled) || ! empty($conf->export->enabled) || ! empty($conf->import->enabled) || ! empty($conf->opensurvey->enabled)), - 'perms'=>(! empty($conf->barcode->enabled) || ! empty($user->rights->mailing->lire) || ! empty($user->rights->export->lire) || ! empty($user->rights->import->run) || ! empty($user->rights->opensurvey->read)), - 'module'=>'mailing|export|import|opensurvey'); + $tmpentry=array('enabled'=>(! empty($conf->barcode->enabled) || ! empty($conf->mailing->enabled) || ! empty($conf->export->enabled) || ! empty($conf->import->enabled) || ! empty($conf->opensurvey->enabled) || ! empty($conf->resource->enabled)), + 'perms'=>(! empty($conf->barcode->enabled) || ! empty($user->rights->mailing->lire) || ! empty($user->rights->export->lire) || ! empty($user->rights->import->run) || ! empty($user->rights->opensurvey->read) || ! empty($user->rights->resource->read)), + 'module'=>'mailing|export|import|opensurvey|resource'); $showmode=dol_eldy_showmenu($type_user, $tmpentry, $listofmodulesforexternal); if ($showmode) { diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index 22008bb054d..da59679b1be 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -376,7 +376,7 @@ class ImportCsv extends ModeleImports if ($obj) $tablewithentity_cache[$tablename]=1; // table contains entity field else $tablewithentity_cache[$tablename]=0; // table does not contains entity field } - else dol_print_error($this->db);; + else dol_print_error($this->db); } else { diff --git a/htdocs/core/modules/modResource.class.php b/htdocs/core/modules/modResource.class.php index e63f44c3945..da1f807ecac 100644 --- a/htdocs/core/modules/modResource.class.php +++ b/htdocs/core/modules/modResource.class.php @@ -61,7 +61,7 @@ class modResource extends DolibarrModules // (where XXX is value of numeric property 'numero' of module) $this->description = "Manage resources (printers, cars, room, ...) you can then share into events"; // Possible values for version are: 'development', 'experimental' or version - $this->version = 'development'; + $this->version = 'dolibarr'; // Key used in llx_const table to save module status enabled/disabled // (where MYMODULE is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_' . strtoupper($this->name); @@ -114,8 +114,7 @@ class modResource extends DolibarrModules $this->requiredby = array('modPlace'); // Minimum version of PHP required by module $this->phpmin = array(5, 3); - // Minimum version of Dolibarr required by module - $this->need_dolibarr_version = array(3, 5); + $this->langfiles = array("resource@resource"); // langfiles@resource // Constants // List of particular constants to add when module is enabled 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 8a9669dadf1..31172a32f43 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 @@ -416,7 +416,7 @@ class doc_generic_task_odt extends ModelePDFTask $project= new Project($this->db); $project->fetch($object->fk_project); - $dir = $conf->projet->dir_output. "/" . $project->ref. "/";; + $dir = $conf->projet->dir_output. "/" . $project->ref. "/"; $objectref = dol_sanitizeFileName($object->ref); if (! preg_match('/specimen/i',$objectref)) $dir.= "/" . $objectref; $file = $dir . "/" . $objectref . ".odt"; diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index b3ff4710f1b..2d4300f76da 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -589,6 +589,57 @@ class pdf_azur extends ModelePDFPropales $this->_pagefoot($pdf,$object,$outputlangs); if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages(); + //If propal merge product PDF is active + if (!empty($conf->global->PRODUIT_PDF_MERGE_PROPAL)) + { + require_once DOL_DOCUMENT_ROOT.'/product/class/propalmergepdfproduct.class.php'; + + $already_merged = array (); + foreach ( $object->lines as $line ) { + if (! empty($line->fk_product) && ! (in_array($line->fk_product, $already_merged))) { + // Find the desire PDF + $filetomerge = new Propalmergepdfproduct($this->db); + + if ($conf->global->MAIN_MULTILANGS) { + $filetomerge->fetch_by_product($line->fk_product, $outputlangs->defaultlang); + } else { + $filetomerge->fetch_by_product($line->fk_product); + } + + $already_merged[] = $line->fk_product; + + // If PDF is selected and file is not empty + if (count($filetomerge->lines) > 0) { + foreach ( $filetomerge->lines as $linefile ) { + if (! empty($linefile->id) && ! empty($linefile->file_name)) { + if (! empty($conf->product->enabled)) + $filetomerge_dir = $conf->product->multidir_output[$conf->entity] . '/' . dol_sanitizeFileName($line->product_ref); + elseif (! empty($conf->service->enabled)) + $filetomerge_dir = $conf->service->multidir_output[$conf->entity] . '/' . dol_sanitizeFileName($line->product_ref); + + dol_syslog(get_class($this) . ':: upload_dir=' . $filetomerge_dir, LOG_DEBUG); + + $infile = $filetomerge_dir . '/' . $linefile->file_name; + if (is_file($infile)) { + $pagecount = $pdf->setSourceFile($infile); + for($i = 1; $i <= $pagecount; $i ++) { + $tplidx = $pdf->ImportPage($i); + $s = $pdf->getTemplatesize($tplidx); + $pdf->AddPage($s['h'] > $s['w'] ? 'P' : 'L'); + $pdf->useTemplate($tplidx); + } + } + } + } + } + } + } + } + + //exit; + + + $pdf->Close(); $pdf->Output($file,'F'); diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php index f5e6c957b1a..269232ddb76 100644 --- a/htdocs/core/tpl/admin_extrafields_add.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php @@ -56,7 +56,7 @@ else if (type == 'boolean') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide();} else if (type == 'price') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide();} else if (type == 'select') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();} - else if (type == 'link') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();;jQuery("#helpchkbxlst").hide();jQuery("#helplink").show();} + else if (type == 'link') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").show();} else if (type == 'sellist') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").show();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();} else if (type == 'radio') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();} else if (type == 'checkbox') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();} diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index f267091db40..f3131ca928a 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -129,7 +129,7 @@ if (empty($usemargins)) $usemargins=0; tva_tx,'%',$line->info_bits); ?> - pu_ht); ?> + subprice); ?> pu_ttc)?price($line->pu_ttc):price($line->subprice)); ?> diff --git a/htdocs/core/tpl/resource_view.tpl.php b/htdocs/core/tpl/resource_view.tpl.php index d57b66cc331..75a69996603 100644 --- a/htdocs/core/tpl/resource_view.tpl.php +++ b/htdocs/core/tpl/resource_view.tpl.php @@ -90,7 +90,7 @@ if( (array) $linked_resources && count($linked_resources) > 0) print img_edit(); print ''; print ' '; - print ''; + print ''; print img_delete(); print ''; print ''; diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 0d30602987f..c6c638f06f3 100755 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -623,7 +623,7 @@ class ExpenseReport extends CommonObject print $langs->trans('Draft').' '.img_picto($langs->trans('Draft'),'statut0'); break; case 2: - print $langs->trans('TripForValid').' '.img_picto($langs->trans('TripForValid'),'statut3');; + print $langs->trans('TripForValid').' '.img_picto($langs->trans('TripForValid'),'statut3'); break; case 5: print $langs->trans('TripForPaid').' '.img_picto($langs->trans('TripForPaid'),'statut3'); diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index a2e6b9d22bc..e1b57b60c91 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -424,7 +424,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie // Bouton Enregistrer if ($action != 'add_paiement') { - print '<
'.$langs->trans("ClosePaidInvoicesAutomatically"); + print '
'.$langs->trans("ClosePaidInvoicesAutomatically"); print '
'; } diff --git a/htdocs/install/mysql/migration/3.7.0-3.8.0.sql b/htdocs/install/mysql/migration/3.7.0-3.8.0.sql index 6c70b73030f..c8b2ad9a057 100644 --- a/htdocs/install/mysql/migration/3.7.0-3.8.0.sql +++ b/htdocs/install/mysql/migration/3.7.0-3.8.0.sql @@ -520,3 +520,14 @@ create table llx_c_price_global_variable_updater ALTER TABLE llx_adherent CHANGE COLUMN note note_private text DEFAULT NULL; ALTER TABLE llx_adherent ADD COLUMN note_public text DEFAULT NULL after note_private; +CREATE TABLE IF NOT EXISTS llx_propal_merge_pdf_product ( + rowid integer NOT NULL auto_increment PRIMARY KEY, + fk_product integer NOT NULL, + file_name varchar(200) NOT NULL, + lang varchar(5) DEFAULT NULL, + fk_user_author integer DEFAULT NULL, + fk_user_mod integer NOT NULL, + datec datetime NOT NULL, + tms timestamp NOT NULL, + import_key varchar(14) DEFAULT NULL +) ENGINE=InnoDB; \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_propal_merge_pdf_product.sql b/htdocs/install/mysql/tables/llx_propal_merge_pdf_product.sql new file mode 100644 index 00000000000..93af93c9190 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_propal_merge_pdf_product.sql @@ -0,0 +1,28 @@ +-- +-- Copyright (C) 2013 Florian HENRY +-- +-- 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 . + +CREATE TABLE IF NOT EXISTS llx_propal_merge_pdf_product ( + rowid integer NOT NULL auto_increment PRIMARY KEY, + fk_product integer NOT NULL, + file_name varchar(200) NOT NULL, + lang varchar(5) DEFAULT NULL, + fk_user_author integer DEFAULT NULL, + fk_user_mod integer NOT NULL, + datec datetime NOT NULL, + tms timestamp NOT NULL, + import_key varchar(14) DEFAULT NULL +) ENGINE=InnoDB; + diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index cd57a4d5a16..06b18dfbc27 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1384,6 +1384,7 @@ NumberOfProductShowInSelect=Max number of products in combos select lists (0=no ConfirmDeleteProductLineAbility=Confirmation when removing product lines in forms ModifyProductDescAbility=Personalization of product descriptions in forms ViewProductDescInFormAbility=Visualization of product descriptions in the forms (otherwise as popup tooltip) +MergePropalProductCard=Activate in product/service Attached Files tab an option to merge product PDF document to proposal PDF azur if product/service is in the proposal ViewProductDescInThirdpartyLanguageAbility=Visualization of products descriptions in the thirdparty language UseSearchToSelectProductTooltip=Also if you have a large number of product (> 100 000), you can increase speed by setting constant PRODUCT_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string. UseSearchToSelectProduct=Use a search form to choose a product (rather than a drop-down list). diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 781f867b5fe..c261b6ff6da 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -267,3 +267,5 @@ GlobalVariableUpdaterHelpFormat1=format is {"URL": "http://example.com/urlofws", UpdateInterval=Update interval (minutes) LastUpdated=Last updated CorrectlyUpdated=Correctly updated +PropalMergePdfProductActualFile=Files use to add into PDF Azur are/is +PropalMergePdfProductChooseFile=Select PDF files diff --git a/htdocs/livraison/card.php b/htdocs/livraison/card.php index e50fb9c8ea8..f4f46e263c2 100644 --- a/htdocs/livraison/card.php +++ b/htdocs/livraison/card.php @@ -394,7 +394,7 @@ if ($action == 'create') */ print ''; $quantite_livree = $commande->livraisons[$line->id]; - print $quantite_livree;; + print $quantite_livree; print ''; $quantite_commandee = $line->qty; diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php index cf4034308ef..a217f34d939 100644 --- a/htdocs/opensurvey/card.php +++ b/htdocs/opensurvey/card.php @@ -367,7 +367,7 @@ if ($comments) { } else { - print $langs->trans("NoCommentYet").'
';; + print $langs->trans("NoCommentYet").'
'; } print '
'; diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index c3de8edd468..05f77597cb2 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -159,6 +159,10 @@ else if ($action == 'viewProdTextsInThirdpartyLanguage') $view = GETPOST('activate_viewProdTextsInThirdpartyLanguage','alpha'); $res = dolibarr_set_const($db, "PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE", $view,'chaine',0,'',$conf->entity); } +elseif ($action == 'mergePropalProductCard') { + $view = GETPOST('activate_mergePropalProductCard','alpha'); + $res = dolibarr_set_const($db, "PRODUIT_PDF_MERGE_PROPAL", $view,'chaine',0,'',$conf->entity); +} else if ($action == 'usesearchtoselectproduct') { $usesearch = GETPOST('activate_usesearchtoselectproduct','alpha'); @@ -428,6 +432,21 @@ print ''; print ''; print ''; +// Activate propal merge produt card +$var=!$var; +print '
'; +print ''; +print ''; +print ''; +print ''.$langs->trans("MergePropalProductCard").''; +print ''; +print $form->selectyesno("activate_mergePropalProductCard",$conf->global->PRODUIT_PDF_MERGE_PROPAL,1); +print ''; +print ''; +print ''; +print ''; +print '
'; + // View product description in thirdparty language if (! empty($conf->global->MAIN_MULTILANGS)) { diff --git a/htdocs/product/class/propalmergepdfproduct.class.php b/htdocs/product/class/propalmergepdfproduct.class.php new file mode 100644 index 00000000000..b2b7296d311 --- /dev/null +++ b/htdocs/product/class/propalmergepdfproduct.class.php @@ -0,0 +1,656 @@ + + * Copyright (C) 2015 Florian HENRY + * + * 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/product/class/propalmergepdfproduct.class.php + * \ingroup product + * \brief This file is an CRUD class file (Create/Read/Update/Delete) + */ + +require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"); + + + +/** + * Put here description of your class + */ +class Propalmergepdfproduct extends CommonObject +{ + var $db; //!< To store db handler + var $error; //!< To return error code (or message) + var $errors=array(); //!< To return several error codes (or messages) + var $element='propal_merge_pdf_product'; //!< Id that identify managed objects + var $table_element='propal_merge_pdf_product'; //!< Name of table without prefix where object is stored + + var $id; + + var $fk_product; + var $file_name; + var $fk_user_author; + var $fk_user_mod; + var $datec=''; + var $tms=''; + var $import_key; + var $lang; + + var $lines=array(); + + + + + /** + * Constructor + * + * @param DoliDb $db Database handler + */ + function __construct($db) + { + $this->db = $db; + return 1; + } + + + /** + * Create object into database + * + * @param User $user User that creates + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int <0 if KO, Id of created object if OK + */ + function create($user, $notrigger=0) + { + global $conf, $langs; + $error=0; + + // Clean parameters + + if (isset($this->fk_product)) $this->fk_product=trim($this->fk_product); + if (isset($this->file_name)) $this->file_name=trim($this->file_name); + if (isset($this->fk_user_author)) $this->fk_user_author=trim($this->fk_user_author); + if (isset($this->fk_user_mod)) $this->fk_user_mod=trim($this->fk_user_mod); + if (isset($this->lang)) $this->lang=trim($this->lang); + if (isset($this->import_key)) $this->import_key=trim($this->import_key); + + + + // Check parameters + // Put here code to add control on parameters values + + // Insert request + $sql = "INSERT INTO ".MAIN_DB_PREFIX."propal_merge_pdf_product("; + + $sql.= "fk_product,"; + $sql.= "file_name,"; + if ($conf->global->MAIN_MULTILANGS) { + $sql.= "lang,"; + } + $sql.= "fk_user_author,"; + $sql.= "fk_user_mod,"; + $sql.= "datec"; + + + $sql.= ") VALUES ("; + + $sql.= " ".(! isset($this->fk_product)?'NULL':"'".$this->fk_product."'").","; + $sql.= " ".(! isset($this->file_name)?'NULL':"'".$this->db->escape($this->file_name)."'").","; + if ($conf->global->MAIN_MULTILANGS) { + $sql.= " ".(! isset($this->lang)?'NULL':"'".$this->db->escape($this->lang)."'").","; + } + $sql.= " ".$user->id.","; + $sql.= " ".$user->id.","; + $sql.= " '".$this->db->idate(dol_now())."'"; + + + $sql.= ")"; + + $this->db->begin(); + + dol_syslog(get_class($this)."::".__METHOD__, LOG_DEBUG); + $resql=$this->db->query($sql); + if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } + + if (! $error) + { + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."propal_merge_pdf_product"); + + if (! $notrigger) + { + // Uncomment this and change MYOBJECT to your own tag if you + // want this action calls a trigger. + + //// Call triggers + //include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + //$interface=new Interfaces($this->db); + //$result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf); + //if ($result < 0) { $error++; $this->errors=$interface->errors; } + //// End call triggers + } + } + + // Commit or rollback + if ($error) + { + foreach($this->errors as $errmsg) + { + dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR); + $this->error.=($this->error?', '.$errmsg:$errmsg); + } + $this->db->rollback(); + return -1*$error; + } + else + { + $this->db->commit(); + return $this->id; + } + } + + + /** + * Load object in memory from the database + * + * @param int $id Id object + * @return int <0 if KO, >0 if OK + */ + function fetch($id) + { + global $langs,$conf; + + $sql = "SELECT"; + $sql.= " t.rowid,"; + + $sql.= " t.fk_product,"; + $sql.= " t.file_name,"; + $sql.= " t.lang,"; + $sql.= " t.fk_user_author,"; + $sql.= " t.fk_user_mod,"; + $sql.= " t.datec,"; + $sql.= " t.tms,"; + $sql.= " t.import_key"; + + + $sql.= " FROM ".MAIN_DB_PREFIX."propal_merge_pdf_product as t"; + $sql.= " WHERE t.rowid = ".$id; + + dol_syslog(get_class($this)."::".__METHOD__, LOG_DEBUG); + $resql=$this->db->query($sql); + if ($resql) + { + if ($this->db->num_rows($resql)) + { + $obj = $this->db->fetch_object($resql); + + $this->id = $obj->rowid; + + $this->fk_product = $obj->fk_product; + $this->file_name = $obj->file_name; + if ($conf->global->MAIN_MULTILANGS) { + $this->lang = $obj->lang; + } + $this->fk_user_author = $obj->fk_user_author; + $this->fk_user_mod = $obj->fk_user_mod; + $this->datec = $this->db->jdate($obj->datec); + $this->tms = $this->db->jdate($obj->tms); + $this->import_key = $obj->import_key; + + + } + $this->db->free($resql); + + return 1; + } + else + { + $this->error="Error ".$this->db->lasterror(); + dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR); + return -1; + } + } + + /** + * Load object in memory from the database + * + * @param int $id Id object + * @param string $lang lang string id + * @return int <0 if KO, >0 if OK + */ + function fetch_by_product($product_id, $lang='') + { + global $langs,$conf; + + $sql = "SELECT"; + $sql.= " t.rowid,"; + + $sql.= " t.fk_product,"; + $sql.= " t.file_name,"; + $sql.= " t.lang,"; + $sql.= " t.fk_user_author,"; + $sql.= " t.fk_user_mod,"; + $sql.= " t.datec,"; + $sql.= " t.tms,"; + $sql.= " t.import_key"; + + + $sql.= " FROM ".MAIN_DB_PREFIX."propal_merge_pdf_product as t"; + $sql.= " WHERE t.fk_product = ".$product_id; + if ($conf->global->MAIN_MULTILANGS && !empty($lang)) { + $sql.= " AND t.lang = '".$lang."'"; + } + + dol_syslog(get_class($this)."::".__METHOD__, LOG_DEBUG); + $resql=$this->db->query($sql); + if ($resql) + { + if ($this->db->num_rows($resql)) + { + while($obj = $this->db->fetch_object($resql)) { + + $line = new PropalmergepdfproductLine(); + + $line->id = $obj->rowid; + + $line->fk_product = $obj->fk_product; + $line->file_name = $obj->file_name; + if ($conf->global->MAIN_MULTILANGS) { + $line->lang = $obj->lang; + } + $line->fk_user_author = $obj->fk_user_author; + $line->fk_user_mod = $obj->fk_user_mod; + $line->datec = $this->db->jdate($obj->datec); + $line->tms = $this->db->jdate($obj->tms); + $line->import_key = $obj->import_key; + + + if ($conf->global->MAIN_MULTILANGS) { + $this->lines[$obj->file_name.'_'.$obj->lang]=$line; + }else { + $this->lines[$obj->file_name]=$line; + } + + + } + + + } + $this->db->free($resql); + + return 1; + } + else + { + $this->error="Error ".$this->db->lasterror(); + dol_syslog(get_class($this)."::fetch_by_product ".$this->error, LOG_ERR); + return -1; + } + } + + + /** + * Update object into database + * + * @param User $user User that modifies + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int <0 if KO, >0 if OK + */ + function update($user=0, $notrigger=0) + { + global $conf, $langs; + $error=0; + + // Clean parameters + + if (isset($this->fk_product)) $this->fk_product=trim($this->fk_product); + if (isset($this->file_name)) $this->file_name=trim($this->file_name); + if (isset($this->fk_user_mod)) $this->fk_user_mod=trim($this->fk_user_mod); + if (isset($this->lang)) $this->lang=trim($this->lang); + + + + + // Check parameters + // Put here code to add a control on parameters values + + // Update request + $sql = "UPDATE ".MAIN_DB_PREFIX."propal_merge_pdf_product SET"; + + $sql.= " fk_product=".(isset($this->fk_product)?$this->fk_product:"null").","; + $sql.= " file_name=".(isset($this->file_name)?"'".$this->db->escape($this->file_name)."'":"null").","; + if ($conf->global->MAIN_MULTILANGS) { + $sql.= " lang=".(isset($this->lang)?"'".$this->db->escape($this->lang)."'":"null").","; + } + $sql.= " fk_user_mod=".$user->id; + + + $sql.= " WHERE rowid=".$this->id; + + $this->db->begin(); + + dol_syslog(get_class($this)."::".__METHOD__, LOG_DEBUG); + $resql = $this->db->query($sql); + if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } + + if (! $error) + { + if (! $notrigger) + { + // Uncomment this and change MYOBJECT to your own tag if you + // want this action calls a trigger. + + //// Call triggers + //include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + //$interface=new Interfaces($this->db); + //$result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf); + //if ($result < 0) { $error++; $this->errors=$interface->errors; } + //// End call triggers + } + } + + // Commit or rollback + if ($error) + { + foreach($this->errors as $errmsg) + { + dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR); + $this->error.=($this->error?', '.$errmsg:$errmsg); + } + $this->db->rollback(); + return -1*$error; + } + else + { + $this->db->commit(); + return 1; + } + } + + + /** + * Delete object in database + * + * @param User $user User that deletes + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int <0 if KO, >0 if OK + */ + function delete($user, $notrigger=0) + { + global $conf, $langs; + $error=0; + + $this->db->begin(); + + if (! $error) + { + if (! $notrigger) + { + // Uncomment this and change MYOBJECT to your own tag if you + // want this action calls a trigger. + + //// Call triggers + //include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + //$interface=new Interfaces($this->db); + //$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf); + //if ($result < 0) { $error++; $this->errors=$interface->errors; } + //// End call triggers + } + } + + if (! $error) + { + $sql = "DELETE FROM ".MAIN_DB_PREFIX."propal_merge_pdf_product"; + $sql.= " WHERE rowid=".$this->id; + + dol_syslog(get_class($this)."::".__METHOD__, LOG_DEBUG); + $resql = $this->db->query($sql); + if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } + } + + // Commit or rollback + if ($error) + { + foreach($this->errors as $errmsg) + { + dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR); + $this->error.=($this->error?', '.$errmsg:$errmsg); + } + $this->db->rollback(); + return -1*$error; + } + else + { + $this->db->commit(); + return 1; + } + } + + /** + * Delete object in database + * + * @param User $user User that deletes + * @param int $product_id product_id + * @param string $lang_id language + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int <0 if KO, >0 if OK + */ + function delete_by_product($user, $product_id, $lang_id='', $notrigger=0) + { + global $conf, $langs; + $error=0; + + $this->db->begin(); + + if (! $error) + { + if (! $notrigger) + { + // Uncomment this and change MYOBJECT to your own tag if you + // want this action calls a trigger. + + //// Call triggers + //include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + //$interface=new Interfaces($this->db); + //$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf); + //if ($result < 0) { $error++; $this->errors=$interface->errors; } + //// End call triggers + } + } + + if (! $error) + { + $sql = "DELETE FROM ".MAIN_DB_PREFIX."propal_merge_pdf_product"; + $sql.= " WHERE fk_product=".$product_id; + + if ($conf->global->MAIN_MULTILANGS && !empty($lang_id)) { + $sql.= " AND lang='".$lang_id."'"; + } + + dol_syslog(get_class($this)."::".__METHOD__, LOG_DEBUG); + $resql = $this->db->query($sql); + if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } + } + + // Commit or rollback + if ($error) + { + foreach($this->errors as $errmsg) + { + dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR); + $this->error.=($this->error?', '.$errmsg:$errmsg); + } + $this->db->rollback(); + return -1*$error; + } + else + { + $this->db->commit(); + return 1; + } + } + + /** + * Delete object in database + * + * @param User $user User that deletes + * @return int <0 if KO, >0 if OK + */ + function delete_by_file($user) + { + global $conf, $langs; + $error=0; + + $this->db->begin(); + + if (! $error) + { + if (! $notrigger) + { + // Uncomment this and change MYOBJECT to your own tag if you + // want this action calls a trigger. + + //// Call triggers + //include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + //$interface=new Interfaces($this->db); + //$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf); + //if ($result < 0) { $error++; $this->errors=$interface->errors; } + //// End call triggers + } + } + + if (! $error) + { + $sql = "DELETE FROM ".MAIN_DB_PREFIX."propal_merge_pdf_product"; + $sql.= " WHERE fk_product=".$this->fk_product." AND file_name='".$this->db->escape($this->file_name)."'"; + + dol_syslog(get_class($this)."::".__METHOD__, LOG_DEBUG); + $resql = $this->db->query($sql); + if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } + } + + // Commit or rollback + if ($error) + { + foreach($this->errors as $errmsg) + { + dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR); + $this->error.=($this->error?', '.$errmsg:$errmsg); + } + $this->db->rollback(); + return -1*$error; + } + else + { + $this->db->commit(); + return 1; + } + } + + + + /** + * Load an object from its id and create a new one in database + * + * @param int $fromid Id of object to clone + * @return int New id of clone + */ + function createFromClone($fromid) + { + global $user,$langs; + + $error=0; + + $object=new Propalmergepdfproduct($this->db); + + $this->db->begin(); + + // Load source object + $object->fetch($fromid); + $object->id=0; + $object->statut=0; + + // Clear fields + // ... + + // Create clone + $result=$object->create($user); + + // Other options + if ($result < 0) + { + $this->error=$object->error; + $error++; + } + + if (! $error) + { + + + } + + // End + if (! $error) + { + $this->db->commit(); + return $object->id; + } + else + { + $this->db->rollback(); + return -1; + } + } + + + /** + * Initialise object with example values + * Id must be 0 if object instance is a specimen + * + * @return void + */ + function initAsSpecimen() + { + $this->id=0; + + $this->fk_product=''; + $this->file_name=''; + $this->fk_user_author=''; + $this->fk_user_mod=''; + $this->datec=''; + $this->tms=''; + $this->import_key=''; + + + } + +} + +class PropalmergepdfproductLine{ + var $id; + + var $fk_product; + var $file_name; + var $lang; + var $fk_user_author; + var $fk_user_mod; + var $datec=''; + var $tms=''; + var $import_key; + + function __construct() { + return 1; + } + +} diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index fc3a41a8861..773d08fae72 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -268,7 +268,7 @@ if ($id > 0 || ! empty($ref)) $productstatic->type=$value["fk_product_type"]; $productstatic->ref=$value['label']; print ''; - print ''.$productstatic->getNomUrl(1,'composition').'';; + print ''.$productstatic->getNomUrl(1,'composition').''; print ''; } print ''; diff --git a/htdocs/product/document.php b/htdocs/product/document.php index 810a131be60..615f4accf70 100644 --- a/htdocs/product/document.php +++ b/htdocs/product/document.php @@ -33,6 +33,8 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +if (!empty($conf->global->PRODUIT_PDF_MERGE_PROPAL)) + require_once DOL_DOCUMENT_ROOT.'/product/class/propalmergepdfproduct.class.php'; $langs->load("other"); $langs->load("products"); @@ -84,8 +86,70 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e if (empty($reshook)) { + //Delete line if product propal merge is linked to a file + if (!empty($conf->global->PRODUIT_PDF_MERGE_PROPAL)) { + if ($action == 'confirm_deletefile' && $confirm == 'yes') + { + print 'toto'; + //extract file name + $urlfile = GETPOST('urlfile', 'alpha'); + $filename = basename($urlfile); + $filetomerge = new Propalmergepdfproduct($db); + $filetomerge->fk_product=$object->id; + $filetomerge->file_name=$filename; + $result=$filetomerge->delete_by_file($user); + if ($result<0) { + setEventMessage($filetomerge->error,'errors'); + } + } + } + // Action sending file include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_pre_headers.tpl.php'; + +} + +if ($action=='filemerge') { + $is_refresh = GETPOST('refresh'); + if (empty($is_refresh)) { + + $filetomerge_file_array = GETPOST('filetoadd'); + + $filetomerge_file_array = GETPOST('filetoadd'); + + if ($conf->global->MAIN_MULTILANGS) { + $lang_id = GETPOST('lang_id'); + } + + // Delete all file already associated + $filetomerge = new Propalmergepdfproduct($db); + + if ($conf->global->MAIN_MULTILANGS) { + $result=$filetomerge->delete_by_product($user, $object->id, $lang_id); + } else { + $result=$filetomerge->delete_by_product($user, $object->id); + } + if ($result<0) { + setEventMessage($filetomerge->error,'errors'); + } + + // for each file checked add it to the product + if (is_array($filetomerge_file_array)) { + foreach ( $filetomerge_file_array as $filetomerge_file ) { + $filetomerge->fk_product = $object->id; + $filetomerge->file_name = $filetomerge_file; + + if ($conf->global->MAIN_MULTILANGS) { + $filetomerge->lang = $lang_id; + } + + $result=$filetomerge->create($user); + if ($result<0) { + setEventMessage($filetomerge->error,'errors'); + } + } + } + } } @@ -142,13 +206,139 @@ if ($object->id) print ''.$langs->trans("NbOfAttachedFiles").''.count($filearray).''; print ''.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").''; print ''; - + print '
'; $modulepart = 'produit'; $permission = (($object->type == Product::TYPE_PRODUCT && $user->rights->produit->creer) || ($object->type == Product::TYPE_SERVICE && $user->rights->service->creer)); $param = '&id=' . $object->id; include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; + + + //Merge propal PDF docuemnt PDF files + if (!empty($conf->global->PRODUIT_PDF_MERGE_PROPAL)) + { + $filetomerge = new Propalmergepdfproduct($db); + + if ($conf->global->MAIN_MULTILANGS) { + $lang_id = GETPOST('lang_id'); + $result = $filetomerge->fetch_by_product($object->id, $lang_id); + } else { + $result = $filetomerge->fetch_by_product($object->id); + } + + $form = new Form($db); + + $filearray = dol_dir_list($upload_dir, "files", 0, '', '\.meta$', 'name', SORT_ASC, 1); + + // For each file build select list with PDF extention + if (count($filearray) > 0) { + print '
'; + // Actual file to merge is : + if (count($filetomerge->lines) > 0) { + print $langs->trans('PropalMergePdfProductActualFile'); + } + + print '
'; + print ''; + print ''; + if (count($filetomerge->lines) == 0) { + print $langs->trans('PropalMergePdfProductChooseFile'); + } + + print ''; + + // Get language + if ($conf->global->MAIN_MULTILANGS) { + + $langs->load("languages"); + + print ''; + } + + $style = 'impair'; + foreach ( $filearray as $filetoadd ) { + + if ($ext = pathinfo($filetoadd['name'], PATHINFO_EXTENSION) == 'pdf') { + + if ($style == 'pair') { + $style = 'impair'; + } else { + $style = 'pair'; + } + + $checked = ''; + $filename = $filetoadd['name']; + + if ($conf->global->MAIN_MULTILANGS) { + if (array_key_exists($filetoadd['name'] . '_' . $delauft_lang, $filetomerge->lines)) { + $filename = $filetoadd['name'] . ' - ' . $langs->trans('Language_' . $delauft_lang); + $checked = ' checked="checked" '; + } + } else { + if (array_key_exists($filetoadd['name'], $filetomerge->lines)) { + $checked = ' checked="checked" '; + } + } + + print ''; + } + } + print ''; + print '
'; + + $delauft_lang = (empty($lang_id)) ? $langs->getDefaultLang() : $lang_id; + + $langs_available = $langs->get_available_languages(DOL_DOCUMENT_ROOT, 12); + + print ''; + + if ($conf->global->MAIN_MULTILANGS) { + print ''; + } + + print '
'; + + print '' . $filename . ''; + print '
'; + + print ''; + print '
'; + + print '
'; + } + } + } else { @@ -157,4 +347,4 @@ else llxFooter(); -$db->close(); +$db->close(); \ No newline at end of file diff --git a/htdocs/product/stock/valo.php b/htdocs/product/stock/valo.php index 6f5cb7ae578..871ec4d30f1 100644 --- a/htdocs/product/stock/valo.php +++ b/htdocs/product/stock/valo.php @@ -31,7 +31,7 @@ $langs->load("stocks"); // Security check $result=restrictedArea($user,'stock'); -$sref=GETPOST("sref");; +$sref=GETPOST("sref"); $snom=GETPOST("snom"); $sall=GETPOST("sall"); diff --git a/htdocs/projet/note.php b/htdocs/projet/note.php index 583326b3e34..f501f25c866 100644 --- a/htdocs/projet/note.php +++ b/htdocs/projet/note.php @@ -129,7 +129,7 @@ if ($id > 0 || ! empty($ref)) $colwidth=30; include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; - dol_fiche_end();; + dol_fiche_end(); } llxFooter(); diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index d50c9a4ec6f..6b6b5553d72 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -59,7 +59,7 @@ $hookmanager->initHooks(array('element_resource')); $object->available_resources = array('resource'); // Get parameters -$id = GETPOST('id','int'); +$id = GETPOST('id','int'); $action = GETPOST('action','alpha'); $mode = GETPOST('mode','alpha'); $lineid = GETPOST('lineid','int'); @@ -70,6 +70,7 @@ $resource_type = GETPOST('resource_type','alpha'); $busy = GETPOST('busy','int'); $mandatory = GETPOST('mandatory','int'); $cancel = GETPOST('cancel','alpha'); +$confirm = GETPOST('confirm','alpha'); if($action == 'add_element_resource' && ! $cancel) { @@ -113,22 +114,22 @@ if ($action == 'update_linked_resource' && $user->rights->resource->write && !GE } // Delete a resource linked to an element -if ($action == 'confirm_delete_linked_resource' && $user->rights->resource->delete && GETPOST('confirm') == 'yes') +if ($action == 'confirm_delete_linked_resource' && $user->rights->resource->delete && $confirm === 'yes') { - $res = $object->fetch(GETPOST('id')); - if($res) + $res = $object->fetch($id); + if($res > 0) { - $result = $object->delete_resource($lineid,$element); + $result = $object->delete_resource($lineid,$element); - if ($result >= 0) - { - setEventMessage($langs->trans('RessourceLineSuccessfullyDeleted')); - Header("Location: ".$_SERVER['PHP_SELF']."?element=".$element."&element_id=".$element_id); - exit; - } - else { - setEventMessage($object->error,'errors'); - } + if ($result >= 0) + { + setEventMessage($langs->trans('RessourceLineSuccessfullyDeleted')); + Header("Location: ".$_SERVER['PHP_SELF']."?element=".$element."&element_id=".$element_id); + exit; + } + else { + setEventMessage($object->error,'errors'); + } } else { @@ -173,7 +174,7 @@ else // Confirmation suppression resource line if ($action == 'delete_resource') { - print $form->formconfirm("element_resource.php?element=".$element."&element_id=".$element_id."&lineid=".$lineid,$langs->trans("DeleteResource"),$langs->trans("ConfirmDeleteResourceElement"),"confirm_delete_linked_resource",'','',1); + print $form->formconfirm("element_resource.php?element=".$element."&element_id=".$element_id."&id=".$id."&lineid=".$lineid,$langs->trans("DeleteResource"),$langs->trans("ConfirmDeleteResourceElement"),"confirm_delete_linked_resource",'','',1); } diff --git a/htdocs/societe/canvas/company/tpl/card_view.tpl.php b/htdocs/societe/canvas/company/tpl/card_view.tpl.php index 4ea5afcbdcb..26c1e77742f 100644 --- a/htdocs/societe/canvas/company/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_view.tpl.php @@ -107,7 +107,7 @@ dol_fiche_head($head, 'card', $langs->trans("ThirdParty"),0,'company'); trans('EMail'); ?> - control->tpl['email'];; ?> + control->tpl['email']; ?> trans('Web'); ?> control->tpl['url']; ?> diff --git a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php index d2fc7e5551b..bc83f2955da 100644 --- a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php @@ -106,7 +106,7 @@ dol_fiche_head($head, 'card', $langs->trans("ThirdParty"),0,'company'); trans('EMail'); ?> - control->tpl['email'];; ?> + control->tpl['email']; ?> trans('Web'); ?> control->tpl['url']; ?> diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 8b8f3755fff..6eb8b823184 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2014 Laurent Destailleur - * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2013-2015 Juanjo Menent * * Version V1.1 Initial version of Philippe Berthet * Version V2 Change to be compatible with 3.4 and enhanced to be more generic @@ -75,6 +75,7 @@ $langs->load("bills"); $langs->load("orders"); $langs->load("suppliers"); $langs->load("propal"); +$langs->load("interventions"); // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('consumptionthirdparty')); @@ -98,7 +99,7 @@ $form = new Form($db); $formother = new FormOther($db); $productstatic=new Product($db); -$title = $langs->trans("Referer",$object->name); +$title = $langs->trans("Referers",$object->name); if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; llxHeader('',$title,$help_url); diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index f5497aed0ac..87a3ae49ac0 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -2164,7 +2164,7 @@ else print ''."\n"; //Select mail models is same action as presend - if (!empty(GETPOST('modelselected'))) { + if (GETPOST('modelselected')) { $action = 'presend'; } if ($action == 'presend') diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 6f17f10113a..35b63230e1f 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -255,8 +255,9 @@ textarea.cke_source:focus input, input.flat, textarea, textarea.flat, form.flat select, select.flat { font-size: px; - font-family: ; - background: #FDFDFD; + font-family: ; + background: #FDFDFD; + color: #444; border: 1px solid #C0C0C0; /*padding: 1px 1px 1px 1px; */ margin: 0px 0px 0px 0px; @@ -1778,11 +1779,11 @@ table.noborder tr, div.noborder form { border-left-width: 1px; border-left-color: #BBBBBB; border-left-style: solid; - height: 26px; + min-height: 20px; } table.noborder th, table.noborder td, div.noborder form, div.noborder form div { - padding: 1px 2px 1px 3px; /* t r b l */ + padding: 5px 2px 5px 3px; /* t r b l */ } table.nobordernopadding { @@ -1917,7 +1918,7 @@ table.liste td { background-color: #f9f9f9; } tr.pair td, tr.impair td { - padding: 2px; + padding: 5px 2px; border-bottom: 1px solid #ddd; } div.liste_titre .tagtd { diff --git a/htdocs/webservices/demo_wsclient_actioncomm.php-NORUN b/htdocs/webservices/demo_wsclient_actioncomm.php-NORUN index 1e14c07a5bf..d3044fc9bd8 100755 --- a/htdocs/webservices/demo_wsclient_actioncomm.php-NORUN +++ b/htdocs/webservices/demo_wsclient_actioncomm.php-NORUN @@ -160,6 +160,6 @@ echo ''; echo '

SOAP Message

'; echo '
' . htmlspecialchars($soapclient->response, ENT_QUOTES) . '
'; -echo ''."\n";; -echo ''."\n";; +echo ''."\n"; +echo ''."\n"; ?> diff --git a/htdocs/webservices/demo_wsclient_category.php-NORUN b/htdocs/webservices/demo_wsclient_category.php-NORUN index 0793fd1806c..e0d78681eac 100755 --- a/htdocs/webservices/demo_wsclient_category.php-NORUN +++ b/htdocs/webservices/demo_wsclient_category.php-NORUN @@ -92,6 +92,6 @@ echo '

SOAP Message

'; echo '
' . htmlspecialchars($soapclient->response, ENT_QUOTES) . '
'; -echo ''."\n";; -echo ''."\n";; +echo ''."\n"; +echo ''."\n"; ?> diff --git a/htdocs/webservices/demo_wsclient_invoice.php-NORUN b/htdocs/webservices/demo_wsclient_invoice.php-NORUN index ad6612692fc..8708e89e13f 100755 --- a/htdocs/webservices/demo_wsclient_invoice.php-NORUN +++ b/htdocs/webservices/demo_wsclient_invoice.php-NORUN @@ -136,6 +136,6 @@ echo ''; echo '

SOAP Message

'; echo '
' . htmlspecialchars($soapclient2->response, ENT_QUOTES) . '
'; -echo ''."\n";; -echo ''."\n";; +echo ''."\n"; +echo ''."\n"; ?> diff --git a/htdocs/webservices/demo_wsclient_other.php-NORUN b/htdocs/webservices/demo_wsclient_other.php-NORUN index 60c801e10fc..0de1ac6b71a 100755 --- a/htdocs/webservices/demo_wsclient_other.php-NORUN +++ b/htdocs/webservices/demo_wsclient_other.php-NORUN @@ -99,6 +99,6 @@ echo ''; echo '

SOAP Message

'; echo '
' . htmlspecialchars($soapclient->response, ENT_QUOTES) . '
'; -echo ''."\n";; -echo ''."\n";; +echo ''."\n"; +echo ''."\n"; ?> diff --git a/htdocs/webservices/demo_wsclient_productorservice.php-NORUN b/htdocs/webservices/demo_wsclient_productorservice.php-NORUN index e27db313bfc..e684a39b1e7 100755 --- a/htdocs/webservices/demo_wsclient_productorservice.php-NORUN +++ b/htdocs/webservices/demo_wsclient_productorservice.php-NORUN @@ -177,6 +177,6 @@ echo ''; echo '

SOAP Message

'; echo '
' . htmlspecialchars($soapclient3->response, ENT_QUOTES) . '
'; -echo ''."\n";; -echo ''."\n";; +echo ''."\n"; +echo ''."\n"; ?> diff --git a/htdocs/webservices/demo_wsclient_thirdparty.php-NORUN b/htdocs/webservices/demo_wsclient_thirdparty.php-NORUN index 3260549b712..45f3d89939f 100755 --- a/htdocs/webservices/demo_wsclient_thirdparty.php-NORUN +++ b/htdocs/webservices/demo_wsclient_thirdparty.php-NORUN @@ -223,6 +223,6 @@ echo ''; echo '

SOAP Message

'; echo '
' . htmlspecialchars($soapclient->response, ENT_QUOTES) . '
'; -echo ''."\n";; -echo ''."\n";; +echo ''."\n"; +echo ''."\n"; ?> diff --git a/scripts/contracts/email_expire_services_to_representatives.php b/scripts/contracts/email_expire_services_to_representatives.php index ae51af38009..44ccb4c7e97 100755 --- a/scripts/contracts/email_expire_services_to_representatives.php +++ b/scripts/contracts/email_expire_services_to_representatives.php @@ -116,7 +116,7 @@ if ($resql) $oldemail = $obj->email; $olduid = $obj->uid; $oldlang = $obj->lang; - $oldsalerepresentative=dolGetFirstLastname($obj->firstname, $obj->lastname);; + $oldsalerepresentative=dolGetFirstLastname($obj->firstname, $obj->lastname); $message = ''; $total = 0; $foundtoprocess = 0; diff --git a/scripts/invoices/email_unpaid_invoices_to_representatives.php b/scripts/invoices/email_unpaid_invoices_to_representatives.php index 2960e2eb685..2870766ff21 100755 --- a/scripts/invoices/email_unpaid_invoices_to_representatives.php +++ b/scripts/invoices/email_unpaid_invoices_to_representatives.php @@ -120,7 +120,7 @@ if ($resql) $oldemail = $obj->email; $olduid = $obj->uid; $oldlang = $obj->lang; - $oldsalerepresentative=dolGetFirstLastname($obj->firstname, $obj->lastname);; + $oldsalerepresentative=dolGetFirstLastname($obj->firstname, $obj->lastname); $message = ''; $total = 0; $foundtoprocess = 0;