From 3e9a8677c6f26826b43fee1a0e535946099f0143 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 19 Apr 2013 09:48:55 +0200 Subject: [PATCH 01/44] Fix: no result with a number with a comma --- htdocs/compta/facture/list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index a27041c82a5..1222a5bdb4a 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -3,7 +3,7 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005 Marc Barilley / Ocebo - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2013 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2010-2012 Juanjo Menent * Copyright (C) 2012 Christophe Battarel @@ -184,11 +184,11 @@ if ($search_societe) } if ($search_montant_ht) { - $sql.= ' AND f.total = \''.$db->escape(trim($search_montant_ht)).'\''; + $sql.= ' AND f.total = \''.$db->escape(price2num(trim($search_montant_ht))).'\''; } if ($search_montant_ttc) { - $sql.= ' AND f.total_ttc = \''.$db->escape(trim($search_montant_ttc)).'\''; + $sql.= ' AND f.total_ttc = \''.$db->escape(price2num(trim($search_montant_ttc))).'\''; } if ($month > 0) { From df0b0ebf51d6289cc3269afc9573702d03483ccd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Apr 2013 09:52:25 +0200 Subject: [PATCH 02/44] Fix: Uniformize pdf code for typhon. This should also solve problem of overlapped text into delivery receipts. Conflicts: htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php --- .../livraison/pdf/pdf_typhon.modules.php | 383 +++++++++++------- 1 file changed, 232 insertions(+), 151 deletions(-) diff --git a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php index 0e65800698a..adf1b8689b1 100644 --- a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php @@ -38,6 +38,22 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; */ class pdf_typhon extends ModelePDFDeliveryOrder { + var $db; + var $name; + var $description; + var $type; + + var $phpmin = array(4,3,0); // Minimum version of PHP required by module + var $version = 'dolibarr'; + + var $page_largeur; + var $page_hauteur; + var $format; + var $marge_gauche; + var $marge_droite; + var $marge_haute; + var $marge_basse; + var $emetteur; // Objet societe qui emet /** @@ -75,26 +91,26 @@ class pdf_typhon extends ModelePDFDeliveryOrder $this->franchise=!$mysoc->tva_assuj; - // Recupere emmetteur + // Get source company $this->emetteur=$mysoc; - if (! $this->emetteur->pays_code) $this->emetteur->pays_code=substr($langs->defaultlang,-2); // Par defaut, si n'�tait pas d�fini + if (empty($this->emetteur->country_code)) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default, if was not defined - // Defini position des colonnes + // Define position of columns $this->posxdesc=$this->marge_gauche+1; - $this->posxcomm=120; + $this->posxcomm=111; //$this->posxtva=111; - $this->posxup=132; - $this->posxqty=168; - $this->posxdiscount=162; - $this->postotalht=177; + //$this->posxup=126; + $this->posxqty=174; + //$this->posxdiscount=162; + //$this->postotalht=174; if ($this->page_largeur < 210) // To work with US executive format { $this->posxcomm-=20; //$this->posxtva-=20; - $this->posxup-=20; + //$this->posxup-=20; $this->posxqty-=20; - $this->posxdiscount-=20; - $this->postotalht-=20; + //$this->posxdiscount-=20; + //$this->postotalht-=20; } $this->tva=array(); @@ -104,15 +120,19 @@ class pdf_typhon extends ModelePDFDeliveryOrder /** - * Fonction generant le bon de livraison sur le disque - * - * @param Object $object Object livraison a generer - * @param Translate $outputlangs Lang output object - * @return int 1 if OK, <=0 if KO + * Function to build pdf onto disk + * + * @param Object $object Object to generate + * @param Translate $outputlangs Lang output object + * @param string $srctemplatepath Full path of source filename for generator using a template file + * @param int $hidedetails Do not show line details + * @param int $hidedesc Do not show desc + * @param int $hideref Do not show ref + * @return int 1=OK, 0=KO */ - function write_file($object,$outputlangs) + function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0) { - global $user,$langs,$conf; + global $user,$langs,$conf,$mysoc,$hookmanager; if (! is_object($outputlangs)) $outputlangs=$langs; // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO @@ -126,17 +146,23 @@ class pdf_typhon extends ModelePDFDeliveryOrder $outputlangs->load("deliveries"); $outputlangs->load("sendings"); - if ($conf->expedition->dir_output."/receipt") + if ($conf->expedition->dir_output) { $object->fetch_thirdparty(); - $nblines = count($object->lines); - - $objectref = dol_sanitizeFileName($object->ref); - $dir = $conf->expedition->dir_output."/receipt"; - if (! preg_match('/specimen/i',$objectref)) $dir.= "/" . $objectref; - $file = $dir . "/" . $objectref . ".pdf"; - + // Definition of $dir and $file + if ($object->specimen) + { + $dir = $conf->expedition->dir_output."/receipt"; + $file = $dir . "/SPECIMEN.pdf"; + } + else + { + $objectref = dol_sanitizeFileName($object->ref); + $dir = $conf->expedition->dir_output."/receipt/" . $objectref; + $file = $dir . "/" . $objectref . ".pdf"; + } + if (! file_exists($dir)) { if (dol_mkdir($dir) < 0) @@ -148,9 +174,12 @@ class pdf_typhon extends ModelePDFDeliveryOrder if (file_exists($dir)) { - $pdf=pdf_getInstance($this->format); + $nblines = count($object->lines); + + // Create pdf instance + $pdf=pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance - $heightforinfotot = 50; // Height reserved to output the info and total part + $heightforinfotot = 30; // Height reserved to output the info and total part $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) $pdf->SetAutoPageBreak(1,0); @@ -195,7 +224,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder /* // Positionne $this->atleastonediscount si on a au moins une remise - for ($i = 0 ; $i < $nblignes ; $i++) + for ($i = 0 ; $i < $nblines ; $i++) { if ($object->lines[$i]->remise_percent) { @@ -214,7 +243,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->SetTextColor(0,0,0); $tab_top = 90; - $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?22:10); + $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10); $tab_height = 130; $tab_height_newpage = 150; @@ -223,7 +252,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder { $tab_top = 88; - $pdf->SetFont('','', $default_font_size - 1); // Dans boucle pour gerer multi-page + $pdf->SetFont('','', $default_font_size - 1); $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($object->note_public), 0, 1); $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; @@ -252,13 +281,46 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->SetTextColor(0,0,0); $pdf->setTopMargin($tab_top_newpage); - $pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it. $pageposbefore=$pdf->getPage(); // Description of product line $curX = $this->posxdesc-1; - pdf_writelinedesc($pdf,$object,$i,$outputlangs,108,3,$curX,$curY); + $showpricebeforepagebreak=1; + + $pdf->startTransaction(); + pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxcomm-$curX,3,$curX,$curY,$hideref,$hidedesc); + $pageposafter=$pdf->getPage(); + if ($pageposafter > $pageposbefore) // There is a pagebreak + { + $pdf->rollbackTransaction(true); + $pageposafter=$pageposbefore; + //print $pageposafter.'-'.$pageposbefore;exit; + $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxcomm-$curX,4,$curX,$curY,$hideref,$hidedesc); + $posyafter=$pdf->GetY(); + if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))) // There is no space left for total+free text + { + if ($i == ($nblines-1)) // No more lines, and no space left to show total, so we create a new page + { + $pdf->AddPage('','',true); + if (! empty($tplidx)) $pdf->useTemplate($tplidx); + if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); + $pdf->setPage($pagenb+1); + } + } + else + { + // We found a page break + $showpricebeforepagebreak=0; + } + } + else // No pagebreak + { + $pdf->commitTransaction(); + } + $nexY = $pdf->GetY(); $pageposafter=$pdf->getPage(); $pdf->setPage($pageposbefore); @@ -266,17 +328,15 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. // We suppose that a too long description is moved completely on next page - if ($pageposafter > $pageposbefore) { + if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { $pdf->setPage($pageposafter); $curY = $tab_top_newpage; } $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut - $nexY = $pdf->GetY()+4; - /* // TVA - $pdf->SetXY($this->posxtva, $curY); + $pdf->SetXY($this->posxcomm, $curY); $pdf->MultiCell(10, 4, ($object->lines[$i]->tva_tx < 0 ? '*':'').abs($object->lines[$i]->tva_tx), 0, 'R'); // Prix unitaire HT avant remise @@ -284,8 +344,9 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->MultiCell(20, 4, price($object->lines[$i]->subprice), 0, 'R', 0); */ // Quantity + //$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails); $pdf->SetXY($this->posxqty, $curY); - $pdf->MultiCell(30, 3, $object->lines[$i]->qty_shipped, 0, 'R'); + $pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->posxqty, 3, $object->lines[$i]->qty_shipped, 0, 'R'); /* // Remise sur ligne $pdf->SetXY($this->posxdiscount, $curY); @@ -307,7 +368,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder */ // Add line - if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) + if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblines - 1)) { $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); //$pdf->SetDrawColor(190,190,200); @@ -333,6 +394,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pagenb++; $pdf->setPage($pagenb); $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); } if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak) { @@ -349,34 +411,38 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->AddPage(); if (! empty($tplidx)) $pdf->useTemplate($tplidx); $pagenb++; + if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); } } // Show square if ($pagenb == 1) { - $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0); - $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1; + $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0); + $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } else { - $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1); - $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1; + $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); + $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } - /* - * Pied de page - */ + // Affiche zone infos + $posy=$this->_tableau_info($pdf, $object, $bottomlasttab, $outputlangs); + + // Pied de page $this->_pagefoot($pdf,$object,$outputlangs); - + $pdf->AliasNbPages(); + // Check product remaining to be delivered // TODO doit etre modifie //$waitingDelivery = $object->getRemainingDelivered(); + /* $waitingDelivery=''; if (is_array($waitingDelivery) & !empty($waitingDelivery)) { - $pdf->AddPage('P', 'A4'); + $pdf->AddPage(); $this->_pagehead($pdf, $object, 1, $outputlangs); $pdf-> SetY(90); @@ -426,17 +492,28 @@ class pdf_typhon extends ModelePDFDeliveryOrder $this->_pagefoot($pdf,$object,$outputlangs); - } - - $pdf->AliasNbPages(); + $pdf->AliasNbPages(); + }*/ $pdf->Close(); $pdf->Output($file,'F'); - if (! empty($conf->global->MAIN_UMASK)) - @chmod($file, octdec($conf->global->MAIN_UMASK)); - return 1; + // Add pdfgeneration hook + if (! is_object($hookmanager)) + { + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; + $hookmanager=new HookManager($this->db); + } + $hookmanager->initHooks(array('pdfgeneration')); + $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); + global $action; + $reshook=$hookmanager->executeHooks('afterPDFCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + + if (! empty($conf->global->MAIN_UMASK)) + @chmod($file, octdec($conf->global->MAIN_UMASK)); + + return 1; // pas d'erreur } else { @@ -449,66 +526,90 @@ class pdf_typhon extends ModelePDFDeliveryOrder return 0; } - + /** + * Show miscellaneous information (payment mode, payment term, ...) + * + * @param PDF &$pdf Object PDF + * @param Object $object Object to show + * @param int $posy Y + * @param Translate $outputlangs Langs object + * @return void + */ + function _tableau_info(&$pdf, $object, $posy, $outputlangs) + { + global $conf; + $default_font_size = pdf_getPDFFontSize($outputlangs); + + $pdf->SetFont('','', $default_font_size); + $pdf->SetXY($this->marge_gauche, $posy); + + $larg_sign = ($this->page_largeur-$this->marge_gauche-$this->marge_droite)/3; + $pdf->Rect($this->marge_gauche, $posy + 1, $larg_sign, 25); + $pdf->SetXY($this->marge_gauche + 2, $posy + 2); + $pdf->MultiCell($larg_sign,2, $outputlangs->trans("For").' '.$outputlangs->convToOutputCharset($mysoc->name).":",'','L'); + + $pdf->Rect(2*$larg_sign+$this->marge_gauche, $posy + 1, $larg_sign, 25); + $pdf->SetXY(2*$larg_sign+$this->marge_gauche + 2, $posy + 2); + $pdf->MultiCell($larg_sign,2, $outputlangs->trans("ForCustomer").':','','L'); + } + /** * Show table for lines * * @param PDF &$pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) - * @param int $nexY Y + * @param int $nexY Y (not used) * @param Translate $outputlangs Langs object - * @param int $hidetop Hide top bar of array + * @param int $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title * @param int $hidebottom Hide bottom bar of array * @return void */ function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0) { global $conf,$mysoc; + + // Force to disable hidetop and hidebottom + $hidebottom=0; + if ($hidetop) $hidetop=-1; + $default_font_size = pdf_getPDFFontSize($outputlangs); - - $pdf->SetDrawColor(128,128,128); - - // Rect prend une longueur en 3eme param - $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height); - // line prend une position y en 3eme param - if (empty($hidetop)) - $pdf->line($this->marge_gauche, $tab_top+6, $this->page_largeur-$this->marge_droite, $tab_top+6); - + + // Amount in (at tab_top - 1) $pdf->SetTextColor(0,0,0); + $pdf->SetFont('','', $default_font_size - 2); + + // Output Rec + $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + + if (empty($hidetop)) + { + $pdf->line($this->marge_gauche, $tab_top+6, $this->page_largeur-$this->marge_droite, $tab_top+6); + } + + $pdf->SetDrawColor(128,128,128); $pdf->SetFont('','', $default_font_size - 1); - if (empty($hidetop)) { + if (empty($hidetop)) + { $pdf->SetXY($this->posxdesc-1, $tab_top+1); - $pdf->MultiCell(80,2, $outputlangs->transnoentities("Designation"),'','L'); + $pdf->MultiCell($this->posxcomm - $this->posxdesc,2, $outputlangs->transnoentities("Designation"),'','L'); } // Modif SEB pour avoir une col en plus pour les commentaires clients $pdf->line($this->posxcomm, $tab_top, $this->posxcomm, $tab_top + $tab_height); if (empty($hidetop)) { $pdf->SetXY($this->posxcomm, $tab_top+1); - $pdf->MultiCell(80,2, $outputlangs->transnoentities("Comments"),'','L'); + $pdf->MultiCell($this->posxqty - $this->posxcomm,2, $outputlangs->transnoentities("Comments"),'','L'); } // Qty $pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height); if (empty($hidetop)) { $pdf->SetXY($this->posxqty-1, $tab_top+1); - $pdf->MultiCell(30, 2, $outputlangs->transnoentities("QtyShipped"),'','R'); + $pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->posxqty, 2, $outputlangs->transnoentities("QtyShipped"),'','R'); } - if (empty($hidebottom)) { - // Modif Seb cadres signatures - $pdf->SetFont('','', $default_font_size); - $larg_sign = ($this->page_largeur-$this->marge_gauche-$this->marge_droite)/3; - $pdf->Rect($this->marge_gauche, ($tab_top + $tab_height + 3), $larg_sign, 25); - $pdf->SetXY($this->marge_gauche + 2, $tab_top + $tab_height + 5); - $pdf->MultiCell($larg_sign,2, $outputlangs->trans("For").' '.$outputlangs->convToOutputCharset($mysoc->name).":",'','L'); - - $pdf->Rect(2*$larg_sign+$this->marge_gauche, ($tab_top + $tab_height + 3), $larg_sign, 25); - $pdf->SetXY(2*$larg_sign+$this->marge_gauche + 2, $tab_top + $tab_height + 5); - $pdf->MultiCell($larg_sign,2, $outputlangs->trans("ForCustomer").':','','L'); - } } /** @@ -522,22 +623,29 @@ class pdf_typhon extends ModelePDFDeliveryOrder */ function _pagehead(&$pdf, $object, $showaddress, $outputlangs) { - global $langs,$conf,$mysoc; + global $conf,$langs,$hookmanager; + $default_font_size = pdf_getPDFFontSize($outputlangs); pdf_pagehead($pdf,$outputlangs,$this->page_hauteur); - $pdf->SetTextColor(0,0,60); - $pdf->SetFont('','B', $default_font_size + 3); - - $posx=$this->page_largeur-$this->marge_droite-100; - $posy=$this->marge_haute; - - $pdf->SetXY($this->marge_gauche,$posy); - + // Show Draft Watermark + if($object->statut==0 && (! empty($conf->global->COMMANDE_DRAFT_WATERMARK)) ) + { + pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->COMMANDE_DRAFT_WATERMARK); + } + + $pdf->SetTextColor(0,0,60); + $pdf->SetFont('','B', $default_font_size + 3); + + $posy=$this->marge_haute; + $posx=$this->page_largeur-$this->marge_droite-100; + + $pdf->SetXY($this->marge_gauche,$posy); + // Logo - $logo=$conf->mycompany->dir_output.'/logos/'.$mysoc->logo; - if ($mysoc->logo) + $logo=$conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo; + if ($this->emetteur->logo) { if (is_readable($logo)) { @@ -548,8 +656,8 @@ class pdf_typhon extends ModelePDFDeliveryOrder { $pdf->SetTextColor(200,0,0); $pdf->SetFont('','B', $default_font_size - 2); - $pdf->MultiCell(100, 3, $langs->transnoentities("ErrorLogoFileNotFound",$logo), 0, 'L'); - $pdf->MultiCell(100, 3, $langs->transnoentities("ErrorGoToModuleSetup"), 0, 'L'); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound",$logo), 0, 'L'); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L'); } } else $pdf->MultiCell(100, 4, $this->emetteur->name, 0, 'L'); @@ -557,7 +665,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->SetFont('','B', $default_font_size + 2); $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); - $pdf->MultiCell(100, 4, $outputlangs->transnoentities("DeliveryOrder")." ".$outputlangs->convToOutputCharset($object->ref), '', 'R'); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("DeliveryOrder")." ".$outputlangs->convToOutputCharset($object->ref), '', 'R'); $pdf->SetFont('','',$default_font_size + 2); @@ -585,69 +693,42 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->SetTextColor(0,0,60); - // Add origin linked objects - // TODO extend to other objects - $object->fetchObjectLinked('','',$object->id,'delivery'); - - if (! empty($object->linkedObjects)) - { - $outputlangs->load('orders'); - - foreach($object->linkedObjects as $elementtype => $objects) - { - $object->fetchObjectLinked('','',$objects[0]->id,$objects[0]->element); - - foreach($object->linkedObjects as $elementtype => $objects) - { - $num=count($objects); - for ($i=0;$i<$num;$i++) - { - $order=new Commande($this->db); - $result=$order->fetch($objects[$i]->id); - if ($result >= 0) - { - $posy+=5; - $pdf->SetXY($posx,$posy); - $pdf->SetFont('','', $default_font_size - 1); - $text=$order->ref; - if ($order->ref_client) $text.=' ('.$order->ref_client.')'; - $pdf->MultiCell(100, 4, $outputlangs->transnoentities("RefOrder")." : ".$outputlangs->transnoentities($text), '', 'R'); - } - } - } - } - } - + $posy+=2; + + // Show list of linked objects + $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size); + if ($showaddress) { - // Emetteur + // Sender properties + $carac_emetteur = pdf_build_address($outputlangs,$this->emetteur); + + // Show sender $posy=42; + $posx=$this->marge_gauche; + if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur-$this->marge_droite-80; $hautcadre=40; + + // Show sender frame $pdf->SetTextColor(0,0,0); $pdf->SetFont('','', $default_font_size - 2); - $pdf->SetXY($this->marge_gauche,$posy-5); - $pdf->MultiCell(66,5, $outputlangs->transnoentities("BillFrom").":"); - - - $pdf->SetXY($this->marge_gauche,$posy); + $pdf->SetXY($posx,$posy-5); + $pdf->MultiCell(66,5, $outputlangs->transnoentities("BillFrom").":", 0, 'L'); + $pdf->SetXY($posx,$posy); $pdf->SetFillColor(230,230,230); $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1); - - - $pdf->SetXY($this->marge_gauche+2,$posy+3); - - // Nom emetteur $pdf->SetTextColor(0,0,60); + + // Show sender name + $pdf->SetXY($posx+2,$posy+3); $pdf->SetFont('','B',$default_font_size); $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); - // Sender properties - $carac_emetteur = pdf_build_address($outputlangs,$this->emetteur); - - $pdf->SetFont('','', $default_font_size - 1); - $pdf->SetXY($this->marge_gauche+2,$posy+9); - $pdf->MultiCell(80, 3, $carac_emetteur, 0, 'L'); - + // Show sender information + $pdf->SetXY($posx+2,$posy+8); + $pdf->SetFont('','', $default_font_size - 1); + $pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L'); + // Client destinataire $posy=42; $pdf->SetTextColor(0,0,0); @@ -655,7 +736,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->SetXY(102,$posy-5); $pdf->MultiCell(80,5, $outputlangs->transnoentities("DeliveryAddress").":", 0, 'L'); - // If SHIPPING contact defined on invoice, we use it + // If SHIPPING contact defined on order, we use it $usecontact=false; $arrayidcontact=$object->commande->getIdContact('external','SHIPPING'); if (count($arrayidcontact) > 0) @@ -677,7 +758,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $carac_client_name=$outputlangs->convToOutputCharset($object->client->nom); } - $carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,$object->contact,$usecontact,'target'); + $carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,($usecontact?$object->contact:''),$usecontact,'target'); // Show recipient $widthrecbox=100; @@ -700,7 +781,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder // Show recipient information $pdf->SetFont('','', $default_font_size - 1); - $pdf->SetXY($posx+2,$posy+8); + $pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($carac_client_name,50)*4)); $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L'); } @@ -713,7 +794,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text - * @return void + * @return int Return height of bottom margin including footer text */ function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0) { From 17d5ab97744865c2fee376285d6183d8034d71b7 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 19 Apr 2013 09:57:13 +0200 Subject: [PATCH 03/44] Fix: no result with a number with a comma Conflicts: htdocs/fourn/facture/index.php Change-Id: I6c67e3d2936673ea0993adfa1597bd11caf125fe --- htdocs/comm/propal/list.php | 4 ++-- htdocs/fourn/facture/index.php | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 95e549c0b1d..81306b47033 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005 Marc Barilley / Ocebo - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2013 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2010-2011 Juanjo Menent * Copyright (C) 2010-2011 Philippe Grand @@ -167,7 +167,7 @@ if ($search_societe) } if ($search_montant_ht) { - $sql.= " AND p.total_ht='".$db->escape(trim($search_montant_ht))."'"; + $sql.= " AND p.total_ht='".$db->escape(price2num(trim($search_montant_ht)))."'"; } if ($sall) $sql.= " AND (s.nom LIKE '%".$db->escape($sall)."%' OR p.note LIKE '%".$db->escape($sall)."%' OR pd.description LIKE '%".$db->escape($sall)."%')"; if ($socid) $sql.= ' AND s.rowid = '.$socid; diff --git a/htdocs/fourn/facture/index.php b/htdocs/fourn/facture/index.php index 6181ec15b24..5d1f9795380 100644 --- a/htdocs/fourn/facture/index.php +++ b/htdocs/fourn/facture/index.php @@ -1,7 +1,8 @@ - * Copyright (C) 2004-2011 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2004-2013 Laurent Destailleur + * Copyright (C) 2005-2013 Regis Houssin + * Copyright (C) 2013 Philippe Grand * * 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 @@ -155,12 +156,12 @@ if (GETPOST("search_societe")) if (GETPOST("search_montant_ht")) { - $sql .= " AND fac.total_ht = '".$db->escape(GETPOST("search_montant_ht"))."'"; + $sql .= " AND fac.total_ht = '".$db->escape(price2num(GETPOST("search_montant_ht")))."'"; } if (GETPOST("search_montant_ttc")) { - $sql .= " AND fac.total_ttc = '".$db->escape(GETPOST("search_montant_ttc"))."'"; + $sql .= " AND fac.total_ttc = '".$db->escape(price2num(GETPOST("search_montant_ttc")))."'"; } $sql.= $db->order($sortfield,$sortorder); From a3c5bef38150deb60d7b4d122016dd03329bf396 Mon Sep 17 00:00:00 2001 From: fhenry Date: Fri, 19 Apr 2013 15:12:02 +0200 Subject: [PATCH 04/44] Fix bug FactureLine update for PgSQL http://www.dolibarr.fr/forum/527-bugs-sur-la-version-stable-courante/41317-impossible-de-modifier-une-ligne-de-facture#41422 --- htdocs/compta/facture/class/facture.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 2333802cc40..578049503c4 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -3457,7 +3457,7 @@ class FactureLigne $sql.= ",total_localtax1=".price2num($this->total_localtax1).""; $sql.= ",total_localtax2=".price2num($this->total_localtax2).""; } - $sql.= " , fk_product_fournisseur_price='".$this->fk_fournprice."'"; + $sql.= " , fk_product_fournisseur_price=".(! empty($this->fk_fournprice)?"'".$this->db->escape($this->fk_fournprice)."'":"null"); $sql.= " , buy_price_ht='".price2num($this->pa_ht)."'"; $sql.= ",fk_parent_line=".($this->fk_parent_line>0?$this->fk_parent_line:"null"); if (! empty($this->rang)) $sql.= ", rang=".$this->rang; From becd40a8251436b51b21e93602c7b6165c1c97cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Fri, 19 Apr 2013 15:38:24 +0200 Subject: [PATCH 05/44] Fixed bug #828: Error when code_region is not a number in llx_c_regions (with postgres) --- ChangeLog | 3 ++- htdocs/admin/dict.php | 26 ++++++++++++++++++-------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 945bf875bfd..e605a1f3cfb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,11 +19,12 @@ English Dolibarr ChangeLog - Fix: [ bug #806 ] Margins module with orders2invoice does not respect cost price - Fix: Orderstoinvoice didn't act as expected when no order was checked - Fix: Bad link to all proposals into Third party card if customer is prospect +- Fix: [ bug #774 ] Bug on creating event with box "all day" crossed - Fix: [ bug #789 ] VAT not being calculated in POS - Fix: [ bug #794 ] Lost filter on zipcode in prospect list -- Fix: [ bug #774 ] Bug on creating event with box "all day" crossed - Fix: [ bug #810 ] Cannot update ODT template path - Fix: [ bug #824 ] MAIN_DB_PREFIX not use into dictionnary +- Fix: [ bug #828 ] Error when code_region is not a number in llx_c_regions (with postgres) ***** ChangeLog for 3.3.1 compared to 3.3 ***** diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 2e49d0f2859..281ae05a65b 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -383,7 +383,7 @@ if ($id == 11) // Define localtax_typeList (used for dictionnary "c_tva") $localtax_typeList = array(); -if (GETPOST("id") == 10) +if ($id == 10) { $localtax_typeList = array( "0" => $langs->trans("No"), @@ -433,7 +433,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) if ($fieldnamekey == 'position') $fieldnamekey = 'Position'; if ($fieldnamekey == 'unicode') $fieldnamekey = 'Unicode'; - $msg.=$langs->trans("ErrorFieldRequired",$langs->transnoentities($fieldnamekey)).'
'; + $msg.=$langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)).'
'; } } // Other checks @@ -441,14 +441,24 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $ok=0; $msg.="Value 'system' and 'systemauto' for type is reserved. You can use 'user' as value to add your own record.
"; } - if (isset($_POST["code"]) && $_POST["code"]=='0') { - $ok=0; - $msg.="Code can't contains value 0
"; + if (isset($_POST["code"]) + { + if ($_POST["code"]=='0') + { + $ok=0; + $msg.="Code can't contains value 0
"; + } + if (!is_numeric($_POST['code'])) + { + $ok = 0; + $msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'
'; + } } if (isset($_POST["pays"]) && $_POST["pays"]=='0') { $ok=0; - $msg.=$langs->trans("ErrorFieldRequired",$langs->trans("Country")).'
'; + $msg.=$langs->transnoentities("ErrorFieldRequired",$langs->transnoentities("Country")).'
'; } + // Clean some parameters if (isset($_POST["localtax1"]) && empty($_POST["localtax1"])) $_POST["localtax1"]='0'; // If empty, we force to 0 if (isset($_POST["localtax2"]) && empty($_POST["localtax2"])) $_POST["localtax2"]='0'; // If empty, we force to 0 @@ -510,7 +520,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) else { if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { - $msg=$langs->trans("ErrorRecordAlreadyExists").'
'; + $msg=$langs->transnoentities("ErrorRecordAlreadyExists").'
'; } else { dol_print_error($db); @@ -580,7 +590,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') // delete { if ($db->errno() == 'DB_ERROR_CHILD_EXISTS') { - $msg='
'.$langs->trans("ErrorRecordIsUsedByChild").'
'; + $msg='
'.$langs->transnoentities("ErrorRecordIsUsedByChild").'
'; } else { From 8030b395360fdc9006ef7a4eec8d4b13b6342a1c Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 19 Apr 2013 19:45:06 +0200 Subject: [PATCH 06/44] fix : undefined variable --- htdocs/core/class/hookmanager.class.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index efd7ad6932d..8e585f7e34a 100755 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -138,8 +138,6 @@ class HookManager { foreach($modules as $module => $actionclassinstance) { - //var_dump(get_class($actionclassinstance).'->'.$method); - // jump to next class if method does not exists if (! method_exists($actionclassinstance,$method)) continue; // test to avoid to run twice a hook, when a module implements several active contexts @@ -164,13 +162,13 @@ class HookManager } // Generic hooks that return a string (printSearchForm, printLeftBlock, printTopRightMenu, formAddObjectLine, formBuilddocOptions, ...) else - { + { // TODO. this should be done into the method by returning nothing if (is_array($parameters) && ! empty($parameters['special_code']) && $parameters['special_code'] > 3 && $parameters['special_code'] != $actionclassinstance->module_number) continue; $result = $actionclassinstance->$method($parameters, $object, $action, $this); - if (is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results); + if (! empty($actionclassinstance->results) && is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results); if (! empty($actionclassinstance->resprints)) $this->resPrint.=$actionclassinstance->resprints; // TODO. remove this. array result must be set into $actionclassinstance->results @@ -179,7 +177,7 @@ class HookManager if (! is_array($result) && ! is_numeric($result)) $this->resPrint.=$result; } - //print "method=".$method." results=".count($actionclassinstance->results)." resprints=".count($actionclassinstance->resprints)." result=".$result." resaction=".$resaction; + //print "method=".$method." results=".count($actionclassinstance->results)." resprints=".count($actionclassinstance->resprints)." result=".$result." resaction=".$resaction; } } } From 458b1cdf60da94a89f2412d1b0d0edfd21511054 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Fri, 19 Apr 2013 23:33:54 +0200 Subject: [PATCH 07/44] Improved dictionary translations + minor bug fix --- ChangeLog | 2 +- htdocs/admin/dict.php | 7 ++++--- htdocs/langs/en_US/admin.lang | 2 ++ htdocs/langs/es_ES/admin.lang | 4 +++- htdocs/langs/es_ES/bills.lang | 2 +- htdocs/langs/fr_FR/admin.lang | 2 ++ 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index e605a1f3cfb..e7991515f6a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,7 +6,7 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.3.2 compared to 3.3.1 ***** -- Fix: Ducth (nl_NL) translation +- Fix: Dutch (nl_NL) translation - Fix: [ bug #790 ] Spanish localtax RE not being correctly calculated - Generalize fix: file with a specific mask not found, again - Fix: translations and BILL_SUPPLIER_BUILDDOC trigger diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 281ae05a65b..5a4db149b87 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -439,14 +439,14 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) // Other checks if ($tabname[$id] == MAIN_DB_PREFIX."c_actioncomm" && isset($_POST["type"]) && in_array($_POST["type"],array('system','systemauto'))) { $ok=0; - $msg.="Value 'system' and 'systemauto' for type is reserved. You can use 'user' as value to add your own record.
"; + $msg.= $langs->transnoentities('ErrorReservedTypeSystemSystemAuto').'
'; } - if (isset($_POST["code"]) + if (isset($_POST["code"])) { if ($_POST["code"]=='0') { $ok=0; - $msg.="Code can't contains value 0
"; + $msg.= $langs->transnoentities('ErrorCodeCantContainZero').'
'; } if (!is_numeric($_POST['code'])) { @@ -988,6 +988,7 @@ if ($id) $valuetoshow=($obj->code && $key != "Civility".strtoupper($obj->code)?$key:$obj->$fieldlist[$field]); } else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_type_contact') { + $langs->load('agenda'); $key=$langs->trans("TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code)); $valuetoshow=($obj->code && $key != "TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code)?$key:$obj->$fieldlist[$field]); } diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 8d613053e3a..736a24cc635 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -46,6 +46,8 @@ ErrorModuleRequireDolibarrVersion=Error, this module requires Dolibarr version % ErrorDecimalLargerThanAreForbidden=Error, a precision higher than %s is not supported. DictionnarySetup=Dictionary setup Dictionnary=Dictionaries +ErrorReservedTypeSystemSystemAuto=Value 'system' and 'systemauto' for type is reserved. You can use 'user' as value to add your own record +ErrorCodeCantContainZero=Code can't contain value 0 DisableJavascript=Disable JavaScript and Ajax functions ConfirmAjax=Use Ajax confirmation popups UseSearchToSelectCompany=Use autocompletion fields to choose third parties (instead of using a list box).

Also if you have a large number of third parties (> 100 000), you can increase speed by setting constant SOCIETE_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string. diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index ad4a06a6f79..162fc8a38d0 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -46,6 +46,8 @@ ErrorModuleRequireDolibarrVersion=Error, este módulo requiere una versión %s o ErrorDecimalLargerThanAreForbidden=Error, las precisiones superiores a %s no están soportadas. DictionnarySetup=Diccionarios Dictionnary=Diccionarios +ErrorReservedTypeSystemSystemAuto=El uso del tipo 'system' and 'systemauto' está reservado. Puede utilizar 'user' como valor para añadir su propio registro +ErrorCodeCantContainZero=El código no puede contener el valor 0 DisableJavascript=Desactivar las funciones Javascript ConfirmAjax=Utilizar los popups de confirmación Ajax UseSearchToSelectCompany=Utilizar un formulario de búsqueda para buscar terceros (en vez de lista desplegable)

Tenga en cuenta que si tiene un gran número de productos o servicios (>100 000), puede mejorar el rendimiento mediante la constante SOCIETE_DONOTSEARCH_ANYWHERE a 1 en Configuración->Varios. La búsqueda se limitará entonces al inicio de la cadena. @@ -294,7 +296,7 @@ ServerNotAvailableOnIPOrPort=Servidor no disponible en la dirección %s e DoTestServerAvailability=Probar conectividad con el servidor DoTestSend=Probar envío DoTestSendHTML=Probar envío HTML -ErrorCantUseRazInStartedYearIfNoYearMonthInMask=Error, no se puede usar opción @ si la secuencia {yy}{mm} o {yyyy}{mm} no se encuentra en la máscara. +ErrorCantUseRazInStartedYearIfNoYearMonthInMask=Error, no se puede usar la opción @ si la secuencia {yy}{mm} o {yyyy}{mm} no se encuentra en la máscara. UMask=Parámetro UMask de nuevos archivos en Unix/Linux/BSD. UMaskExplanation=Este parámetro determina los derechos de los archivos creados en el servidor Dolibarr (durante la subida, por ejemplo).
Este debe ser el valor octal (por ejemplo, 0666 significa lectura / escritura para todos).
Este parámetro no tiene ningún efecto sobre un servidor Windows. SeeWikiForAllTeam=Vea el wiki para más detalles de todos los actores y de su organización diff --git a/htdocs/langs/es_ES/bills.lang b/htdocs/langs/es_ES/bills.lang index 2ac03e256db..7f2fbf259ec 100644 --- a/htdocs/langs/es_ES/bills.lang +++ b/htdocs/langs/es_ES/bills.lang @@ -250,7 +250,7 @@ Deposit=Anticipo Deposits=Anticipos DiscountFromCreditNote=Descuento resultante del abono %s DiscountFromDeposit=Pagos de la factura de anticipo %s -AbsoluteDiscountUse=Este tipo de crédito no puede ser utilizado en una factura antes de su validación +AbsoluteDiscountUse=Este tipo de descuento no puede ser utilizado en una factura antes de su validación CreditNoteDepositUse=La factura debe de estar validada para poder utilizar este tipo de créditos NewGlobalDiscount=Nuevo descuento fijo NewRelativeDiscount=Nuevo descuento diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 616cfc6d550..66c398df90b 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -45,6 +45,8 @@ ErrorModuleRequireDolibarrVersion= Erreur, ce module requiert une version %s ou ErrorDecimalLargerThanAreForbidden= Erreur, les précisions supérieures à %s ne sont pas supportées. DictionnarySetup= Dictionnaires Dictionnary= Dictionnaires +ErrorReservedTypeSystemSystemAuto= +ErrorCodeCantContainZero= DisableJavascript= Désactiver les fonctions Javascript et Ajax ConfirmAjax= Utiliser les popups de confirmation Ajax UseSearchToSelectCompany= Utiliser un champ avec autocomplétion pour choisir un tiers (plutôt qu'une liste déroulante).

Notez que si vous avez un nombre important de produits ou services (> 100 000), vous pouvez améliorer les performances en définissant la constante SOCIETE_DONOTSEARCH_ANYWHERE à 1 dans Configuration->Divers. La recherche sera alors limitée au début de la chaine. From 40a9ab9772bf67106e40c9f12be38348902a48ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sat, 20 Apr 2013 00:08:09 +0200 Subject: [PATCH 08/44] Added missing translations --- htdocs/admin/menus/edit.php | 1 + htdocs/langs/en_US/admin.lang | 1 + htdocs/langs/en_US/commercial.lang | 1 + htdocs/langs/en_US/holiday.lang | 7 ++++++- htdocs/langs/es_ES/admin.lang | 3 ++- htdocs/langs/es_ES/commercial.lang | 1 + htdocs/langs/es_ES/holiday.lang | 7 ++++++- htdocs/langs/fr_FR/admin.lang | 1 + htdocs/langs/fr_FR/commercial.lang | 1 + htdocs/langs/fr_FR/holiday.lang | 7 ++++++- 10 files changed, 26 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php index f223f1f9d52..fd1c03ea52e 100644 --- a/htdocs/admin/menus/edit.php +++ b/htdocs/admin/menus/edit.php @@ -29,6 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php'; $langs->load("admin"); +$langs->load('other'); if (! $user->admin) accessforbidden(); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 736a24cc635..2347bcdf22c 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -526,6 +526,7 @@ Permission98=Dispatch invoice accountancy lines Permission101=Read sendings Permission102=Create/modify sendings Permission104=Validate sendings +Permission106=Export sendings Permission109=Delete sendings Permission111=Read financial accounts Permission112=Create/modify/delete and compare transactions diff --git a/htdocs/langs/en_US/commercial.lang b/htdocs/langs/en_US/commercial.lang index baac58e4642..c17ddf2e8be 100644 --- a/htdocs/langs/en_US/commercial.lang +++ b/htdocs/langs/en_US/commercial.lang @@ -81,6 +81,7 @@ ActionAC_SHIP=Send shipping by mail ActionAC_SUP_ORD=Send supplier order by mail ActionAC_SUP_INV=Send supplier invoice by mail ActionAC_OTH=Other +ActionAC_OTH_AUTO=Other (automatically inserted events) ActionAC_MANUAL=Manually inserted events ActionAC_AUTO=Automatically inserted events Stats=Sales statistics diff --git a/htdocs/langs/en_US/holiday.lang b/htdocs/langs/en_US/holiday.lang index 67adb36dfeb..8a5a55f6e01 100755 --- a/htdocs/langs/en_US/holiday.lang +++ b/htdocs/langs/en_US/holiday.lang @@ -131,4 +131,9 @@ NoCPforMonth=No leave this month. Jours=days nbJours=Number days TitleAdminCP=Configuration of Holidays -Permission20001=Read / Modify all requests of holidays +Permission20001=Read/create/modify their holidays +Permission20002=Read/modify all requests of holidays +Permission20003=Delete their holidays requests +Permission20004=Define users holidays +Permission20005=Review log of modified holidays +Permission20006=Access holidays monthly report \ No newline at end of file diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index 162fc8a38d0..ac215d36feb 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -46,7 +46,7 @@ ErrorModuleRequireDolibarrVersion=Error, este módulo requiere una versión %s o ErrorDecimalLargerThanAreForbidden=Error, las precisiones superiores a %s no están soportadas. DictionnarySetup=Diccionarios Dictionnary=Diccionarios -ErrorReservedTypeSystemSystemAuto=El uso del tipo 'system' and 'systemauto' está reservado. Puede utilizar 'user' como valor para añadir su propio registro +ErrorReservedTypeSystemSystemAuto=El uso del tipo 'system' y 'systemauto' está reservado. Puede utilizar 'user' como valor para añadir su propio registro ErrorCodeCantContainZero=El código no puede contener el valor 0 DisableJavascript=Desactivar las funciones Javascript ConfirmAjax=Utilizar los popups de confirmación Ajax @@ -527,6 +527,7 @@ Permission98=Desglosar líneas de facturas Permission101=Consultar expediciones Permission102=Crear/modificar expediciones Permission104=Validar expediciones +Permission106=Exportar expediciones Permission109=Eliminar expediciones Permission111=Consultar cuentas financieras (cuentas bancarias, cajas) Permission112=Crear/modificar cantidad/eliminar registros bancarios diff --git a/htdocs/langs/es_ES/commercial.lang b/htdocs/langs/es_ES/commercial.lang index 3b5d007aac9..9d774606bf0 100644 --- a/htdocs/langs/es_ES/commercial.lang +++ b/htdocs/langs/es_ES/commercial.lang @@ -81,6 +81,7 @@ ActionAC_SHIP=Envío expedición por correo ActionAC_SUP_ORD=Envío pedido a proveedor por correo ActionAC_SUP_INV=Envío factura de proveedor por correo ActionAC_OTH=Otra +ActionAC_OTH_AUTO=Otra (eventos insertados automáticamente) ActionAC_MANUAL=Eventos creados manualmente ActionAC_AUTO=Eventos creados automáticamente Stats=Estadísticas de venta diff --git a/htdocs/langs/es_ES/holiday.lang b/htdocs/langs/es_ES/holiday.lang index ebf1a0457d9..93387f29525 100644 --- a/htdocs/langs/es_ES/holiday.lang +++ b/htdocs/langs/es_ES/holiday.lang @@ -132,4 +132,9 @@ NoCPforMonth=Sin vacaciones este mes. Jours=días nbJours=Número de días TitleAdminCP=Configuración de las vacaciones -Permission20001=Leer / Crear / Modificar sus vacaciones \ No newline at end of file +Permission20001=Consultar/crear/modificar sus vacaciones +Permission20002=Consultar/modificar todas las solicitudes de permisos retribuídos +Permission20003=Eliminar las solicitudes de permisos retribuídos +Permission20004=Definir los permisos retribuídos de los usuarios +Permission20005=Consultar el historial de modificaciones de permisos retribuidos +Permission20006=Acceder al informe mensual de permisos retribuidos \ No newline at end of file diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 66c398df90b..51966eebcf2 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -520,6 +520,7 @@ Permission98= Ventiler les lignes de factures Permission101= Consulter les expéditions Permission102= Créer/modifier les expéditions Permission104= Valider les expéditions +Permission106= Exporter les expéditions Permission109= Supprimer les expéditions Permission111= Consulter les comptes financiers (comptes bancaires, caisses) Permission112= Créer/modifier montant/supprimer écritures bancaires diff --git a/htdocs/langs/fr_FR/commercial.lang b/htdocs/langs/fr_FR/commercial.lang index 79937cb84fb..e9ab93d8f37 100644 --- a/htdocs/langs/fr_FR/commercial.lang +++ b/htdocs/langs/fr_FR/commercial.lang @@ -81,6 +81,7 @@ ActionAC_SHIP=Envoi bon d'expédition par mail ActionAC_SUP_ORD=Envoi commande fournisseur par mail ActionAC_SUP_INV=Envoi facture fournisseur par mail ActionAC_OTH=Autre +ActionAC_OTH_AUTO=Autre (evênements insérés automatiquement) ActionAC_MANUAL=Evênements insérés manuellement ActionAC_AUTO=Evênements insérés automatiquement Stats=Statistiques de vente diff --git a/htdocs/langs/fr_FR/holiday.lang b/htdocs/langs/fr_FR/holiday.lang index c01d84218bf..e09d0de2cbd 100644 --- a/htdocs/langs/fr_FR/holiday.lang +++ b/htdocs/langs/fr_FR/holiday.lang @@ -130,4 +130,9 @@ NoCPforMonth=Aucun congé ce mois-ci. Jours=jours nbJours=Nombre jours TitleAdminCP=Configuration des Congés -Permission20001=Lire / Créer / modifier ses congès \ No newline at end of file +Permission20001=Lire / Créer / modifier ses congès +Permission20002=Lire / Modifier toutes les demandes de congés payés +Permission20003=Supprimer des demandes de congés payés +Permission20004=Définir les congés payés des utilisateurs +Permission20005=Voir les logs de modification des congés payés +Permission20006=Accéder au rapport mensuel des congés payés \ No newline at end of file From d90a0acbec2183323ce5ddbd2ea8f937d381c7c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sat, 20 Apr 2013 00:18:57 +0200 Subject: [PATCH 09/44] Missing externalsite module translations --- htdocs/externalsite/frames.php | 4 ++-- htdocs/externalsite/frametop.php | 2 +- htdocs/langs/en_US/externalsite.lang | 3 ++- htdocs/langs/es_ES/externalsite.lang | 3 ++- htdocs/langs/fr_FR/externalsite.lang | 3 ++- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/htdocs/externalsite/frames.php b/htdocs/externalsite/frames.php index e93dc392d93..825398f3636 100644 --- a/htdocs/externalsite/frames.php +++ b/htdocs/externalsite/frames.php @@ -25,12 +25,12 @@ require '../main.inc.php'; -$langs->load("externalsite@externalsite"); +$langs->load("externalsite"); if (empty($conf->global->EXTERNALSITE_URL)) { llxHeader(); - print '
Module ExternalSite was not configured properly.
'; + print '
'.$langs->trans('ExternalSiteModuleNotComplete').'
'; llxFooter(); } diff --git a/htdocs/externalsite/frametop.php b/htdocs/externalsite/frametop.php index 5808c974909..0bf7a259c8f 100644 --- a/htdocs/externalsite/frametop.php +++ b/htdocs/externalsite/frametop.php @@ -24,7 +24,7 @@ require ("../main.inc.php"); -$langs->load("@externalsite"); +$langs->load("externalsite"); top_htmlhead("",""); top_menu("","","_top"); diff --git a/htdocs/langs/en_US/externalsite.lang b/htdocs/langs/en_US/externalsite.lang index 3ae2098b92a..213fa314ab1 100644 --- a/htdocs/langs/en_US/externalsite.lang +++ b/htdocs/langs/en_US/externalsite.lang @@ -1,4 +1,5 @@ # Dolibarr language file - en_US - externalsite CHARSET=UTF-8 ExternalSiteSetup=Setup link to external website -ExternalSiteURL=External Site URL \ No newline at end of file +ExternalSiteURL=External Site URL +ExternalSiteModuleNotComplete=Module ExternalSite was not configured properly. \ No newline at end of file diff --git a/htdocs/langs/es_ES/externalsite.lang b/htdocs/langs/es_ES/externalsite.lang index 6052639eb4b..131d9f69fc4 100644 --- a/htdocs/langs/es_ES/externalsite.lang +++ b/htdocs/langs/es_ES/externalsite.lang @@ -1,4 +1,5 @@ # Dolibarr language file - es_ES - externalsite CHARSET=UTF-8 ExternalSiteSetup=Configuración del enlace al sitio web externo -ExternalSiteURL=URL del sitio externo \ No newline at end of file +ExternalSiteURL=URL del sitio externo +ExternalSiteModuleNotComplete=El módulo Sitio web externo no ha sido configurado correctamente. \ No newline at end of file diff --git a/htdocs/langs/fr_FR/externalsite.lang b/htdocs/langs/fr_FR/externalsite.lang index ff1fb3112c1..36c8686a3c3 100644 --- a/htdocs/langs/fr_FR/externalsite.lang +++ b/htdocs/langs/fr_FR/externalsite.lang @@ -1,4 +1,5 @@ # Dolibarr language file - fr_FR - externalsite CHARSET=UTF-8 ExternalSiteSetup=Configuration du lien vers le site externe -ExternalSiteURL=URL du site externe \ No newline at end of file +ExternalSiteURL=URL du site externe +ExternalSiteModuleNotComplete= \ No newline at end of file From 95ca8db9eb8708c537bb38b73fba1cea2c5132ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sat, 20 Apr 2013 00:34:03 +0200 Subject: [PATCH 10/44] Improved es_ES translations --- htdocs/langs/es_ES/admin.lang | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index ac215d36feb..769f635bc4c 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -464,6 +464,8 @@ Module2900Name=GeoIPMaxmind Module2900Desc=Capacidades de conversión GeoIP Maxmind Module5000Name=Multi-empresa Module5000Desc=Permite gestionar varias empresas +Module6000Name=Workflow +Module6000Desc=Gestión de flujos de trabajo Module20000Name=Días libres Module20000Desc=Gestión de los días libres de los empleados Module50000Name=PayBox @@ -896,7 +898,7 @@ MAIN_ROUNDING_RULE_TOT=Tamaño rango para el redondeo (para algunos países que UnitPriceOfProduct=Precio unitario sin IVA de un producto TotalPriceAfterRounding=Precio total después del redondeo ParameterActiveForNextInputOnly=Parámetro efectivo solamente a partir de las próximas sesiones -NoEventOrNoAuditSetup=No se han registrado eventos de seguridad. Esto puede ser normal si la auditoría no ha sido habilitado en la página "configuración->seguridad->auditoría". +NoEventOrNoAuditSetup=No se han registrado eventos de seguridad. Esto puede ser normal si la auditoría no ha sido habilitada en la página "configuración->seguridad->auditoría". NoEventFoundWithCriteria=No se han encontrado eventos de seguridad para tales criterios de búsqueda. SeeLocalSendMailSetup=Ver la configuración local de sendmail BackupDesc=Para realizar una copia de seguridad completa de Dolibarr, usted debe: From f2bd1461b24b81dddc47eb9e63606cae6a95b4af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Sat, 20 Apr 2013 07:33:10 +0200 Subject: [PATCH 11/44] Improved reports Added amount without VAT for "CREANCES-DETTES" mode Added turnover by products/services Added categories filter for users and products/services Added period management Added list sorting --- htdocs/compta/stats/cabyuser.php | 248 +++++++++++++++----- htdocs/compta/stats/casoc.php | 300 ++++++++++++++++++------ htdocs/core/menus/standard/eldy.lib.php | 2 + htdocs/langs/en_US/compta.lang | 3 +- htdocs/langs/en_US/errors.lang | 3 +- htdocs/langs/fr_FR/compta.lang | 3 +- htdocs/langs/fr_FR/errors.lang | 3 +- 7 files changed, 427 insertions(+), 135 deletions(-) diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php index 86f16cf3684..d4ef827ad0f 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -2,6 +2,7 @@ /* Copyright (C) 2001-2003 Rodolphe Quiedeville * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2013 Antoine Iauch * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -46,6 +47,12 @@ if (! $sortfield) $sortfield="name"; // Date range $year=GETPOST("year"); $month=GETPOST("month"); +$date_startyear = GETPOST("date_startyear"); +$date_startmonth = GETPOST("date_startmonth"); +$date_startday = GETPOST("date_startday"); +$date_endyear = GETPOST("date_endyear"); +$date_endmonth = GETPOST("date_endmonth"); +$date_endday = GETPOST("date_endday"); if (empty($year)) { $year_current = strftime("%Y",dol_now()); @@ -89,9 +96,34 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end else { // TODO We define q - } +$commonparams=array(); +$commonparams['modecompta']=$modecompta; +$commonparams['sortorder'] = $sortorder; +$commonparams['sortfield'] = $sortfield; + +$headerparams = array(); +$headerparams['date_startyear'] = $date_startyear; +$headerparams['date_startmonth'] = $date_startmonth; +$headerparams['date_startday'] = $date_startday; +$headerparams['date_endyear'] = $date_endyear; +$headerparams['date_endmonth'] = $date_endmonth; +$headerparams['date_endday'] = $date_endday; +$headerparams['q'] = $q; + +$tableparams = array(); +$tableparams['search_categ'] = $selected_cat; +$tableparams['subcat'] = ($subcat === true)?'yes':''; + +// Adding common parameters +$allparams = array_merge($commonparams, $headerparams, $tableparams); +$headerparams = array_merge($commonparams, $headerparams); +$tableparams = array_merge($commonparams, $tableparams); + +foreach($allparams as $key => $value) { + $paramslink .= '&' . $key . '=' . $value; +} /* * View @@ -102,9 +134,8 @@ llxHeader(); $form=new Form($db); -// Affiche en-tete du rapport -if ($modecompta=="CREANCES-DETTES") -{ +// Show report header +if ($modecompta=="CREANCES-DETTES") { $nom=$langs->trans("SalesTurnover").', '.$langs->trans("ByUserAuthorOfInvoice"); $nom.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); @@ -114,8 +145,7 @@ if ($modecompta=="CREANCES-DETTES") else $description.= $langs->trans("DepositsAreIncluded"); $builddate=time(); //$exportlink=$langs->trans("NotYetAvailable"); -} -else { +} else { $nom=$langs->trans("SalesTurnover").', '.$langs->trans("ByUserAuthorOfInvoice"); $nom.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); @@ -131,31 +161,42 @@ if (! empty($modecompta)) $moreparam['modecompta']=$modecompta; report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,$moreparam); -// Charge tableau -$catotal=0; -if ($modecompta == 'CREANCES-DETTES') +// Show array +print '
'; +// Extra parameters management +foreach($headerparams as $key => $value) { + print ''; +} + +$catotal=0; +if ($modecompta == 'CREANCES-DETTES') { $sql = "SELECT u.rowid as rowid, u.lastname as name, u.firstname as firstname, sum(f.total) as amount, sum(f.total_ttc) as amount_ttc"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON f.fk_user_author = u.rowid"; $sql.= " WHERE f.fk_statut in (1,2)"; - if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2)"; - else $sql.= " AND f.type IN (0,1,2,3)"; - if ($date_start && $date_end) $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; -} -else -{ + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql.= " AND f.type IN (0,1,2)"; + } else { + $sql.= " AND f.type IN (0,1,2,3)"; + } + if ($date_start && $date_end) { + $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; + } +} else { /* * Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les * vieilles versions, ils n'etaient pas lies via paiement_facture. On les ajoute plus loin) */ - $sql = "SELECT u.rowid as rowid, u.lastname as name, u.firstname as firstname, sum(pf.amount) as amount_ttc"; + $sql = "SELECT u.rowid as rowid, u.lastname as name, u.firstname as firstname, sum(DISTINCT pf.amount) as amount_ttc"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u" ; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON f.fk_user_author = u.rowid "; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON pf.fk_facture = f.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement as p ON p.rowid = pf.fk_paiement"; $sql.= " WHERE 1=1"; - if ($date_start && $date_end) $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; + if ($date_start && $date_end) { + $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; + } } $sql.= " AND f.entity = ".$conf->entity; if ($socid) $sql.= " AND f.fk_soc = ".$socid; @@ -163,27 +204,25 @@ $sql .= " GROUP BY u.rowid, u.lastname, u.firstname"; $sql .= " ORDER BY u.rowid"; $result = $db->query($sql); -if ($result) -{ +if ($result) { $num = $db->num_rows($result); $i=0; - while ($i < $num) - { + while ($i < $num) { $obj = $db->fetch_object($result); - $amount[$obj->rowid] = $obj->amount_ttc; - $name[$obj->rowid] = $obj->lastname.' '.$obj->firstname; - $catotal+=$obj->amount_ttc; - $i++; + $amount_ht[$obj->rowid] = $obj->amount; + $amount[$obj->rowid] = $obj->amount_ttc; + $name[$obj->rowid] = $obj->name.' '.$obj->firstname; + $catotal_ht+=$obj->amount; + $catotal+=$obj->amount_ttc; + $i++; } -} -else { +} else { dol_print_error($db); } -// On ajoute les paiements ancienne version, non lies par paiement_facture donc sans user -if ($modecompta != 'CREANCES-DETTES') -{ - $sql = "SELECT -1 as rowidx, '' as lastname, '' as firstname, sum(p.amount) as amount_ttc"; +// Adding old-version payments, non-bound by "paiement_facture" then without User +if ($modecompta != 'CREANCES-DETTES') { + $sql = "SELECT -1 as rowidx, '' as name, '' as firstname, sum(DISTINCT p.amount) as amount_ttc"; $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; $sql.= ", ".MAIN_DB_PREFIX."bank_account as ba"; $sql.= ", ".MAIN_DB_PREFIX."paiement as p"; @@ -192,42 +231,86 @@ if ($modecompta != 'CREANCES-DETTES') $sql.= " AND p.fk_bank = b.rowid"; $sql.= " AND b.fk_account = ba.rowid"; $sql.= " AND ba.entity = ".$conf->entity; - if ($date_start && $date_end) $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; + if ($date_start && $date_end) { + $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; + } $sql.= " GROUP BY rowidx, name, firstname"; $sql.= " ORDER BY rowidx"; $result = $db->query($sql); - if ($result) - { + if ($result) { $num = $db->num_rows($result); $i=0; - while ($i < $num) - { + while ($i < $num) { $obj = $db->fetch_object($result); $amount[$obj->rowidx] = $obj->amount_ttc; - $name[$obj->rowidx] = $obj->lastname.' '.$obj->firstname; + $name[$obj->rowidx] = $obj->name.' '.$obj->firstname; $catotal+=$obj->amount_ttc; $i++; } - } - else { + } else { dol_print_error($db); } } - $i = 0; print ""; print ""; -print_liste_field_titre($langs->trans("User"),$_SERVER["PHP_SELF"],"name","",'&year='.($year).'&modecompta='.$modecompta,"",$sortfield,$sortorder); -print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"amount_ttc","",'&year='.($year).'&modecompta='.$modecompta,'align="right"',$sortfield,$sortorder); -print_liste_field_titre($langs->trans("Percentage"),$_SERVER["PHP_SELF"],"amount_ttc","",'&year='.($year).'&modecompta='.$modecompta,'align="right"',$sortfield,$sortorder); -print_liste_field_titre($langs->trans("OtherStatistics"),$_SERVER["PHP_SELF"],"","","",'align="center" width="20%"'); +print_liste_field_titre( + $langs->trans("User"), + $_SERVER["PHP_SELF"], + "name", + "", + $paramslink, + "", + $sortfield, + $sortorder + ); +if ($modecompta == 'CREANCES-DETTES') { + print_liste_field_titre( + $langs->trans('AmountHT'), + $_SERVER["PHP_SELF"], + "amount_ht", + "", + $paramslink, + 'align="right"', + $sortfield, + $sortorder + ); + } else { + print ''; +} +print_liste_field_titre( + $langs->trans("AmountTTC"), + $_SERVER["PHP_SELF"], + "amount_ttc", + "", + $paramslink, + 'align="right"', + $sortfield, + $sortorder + ); +print_liste_field_titre( + $langs->trans("Percentage"), + $_SERVER["PHP_SELF"],"amount_ttc", + "", + $paramslink, + 'align="right"', + $sortfield, + $sortorder + ); +print_liste_field_titre( + $langs->trans("OtherStatistics"), + $_SERVER["PHP_SELF"], + "", + "", + "", + 'align="center" width="20%"' + ); print "\n"; $var=true; -if (count($amount)) -{ +if (count($amount)) { $arrayforsort=$name; // We define arrayforsort @@ -239,6 +322,14 @@ if (count($amount)) arsort($name); $arrayforsort=$name; } + if ($sortfield == 'amount_ht' && $sortorder == 'asc') { + asort($amount_ht); + $arrayforsort=$amount_ht; + } + if ($sortfield == 'amount_ht' && $sortorder == 'desc') { + arsort($amount_ht); + $arrayforsort=$amount_ht; + } if ($sortfield == 'amount_ttc' && $sortorder == 'asc') { asort($amount); $arrayforsort=$amount; @@ -248,8 +339,7 @@ if (count($amount)) $arrayforsort=$amount; } - foreach($arrayforsort as $key => $value) - { + foreach($arrayforsort as $key => $value) { $var=!$var; print ""; @@ -257,23 +347,44 @@ if (count($amount)) $fullname=$name[$key]; if ($key >= 0) { $linkname=''.img_object($langs->trans("ShowUser"),'user').' '.$fullname.''; - } - else { + } else { $linkname=$langs->trans("PaymentsNotLinkedToUser"); } print "\n"; - // Amount + // Amount w/o VAT print ''; + + // Amount with VAT + print ''; @@ -283,17 +394,30 @@ if (count($amount)) // Other stats print ''; - print "\n"; $i++; } // Total - print ''; + print ''; + print ''; + if ($modecompta != 'CREANCES-DETTES') { + print ''; + } else { + print ''; + } + print ''; + print ''; print ''; print ''; diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index b658cf636d6..32d527cc779 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2007 Franky Van Liedekerke + * Copyright (C) 2013 Antoine Iauch * * 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 @@ -27,8 +28,10 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; $langs->load("companies"); +$langs->load("categories"); // Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES') $modecompta = $conf->global->COMPTA_MODE; @@ -41,6 +44,13 @@ if (! $sortfield) $sortfield="nom"; $socid = GETPOST('socid','int'); +// Category +$selected_cat = (int)GETPOST('search_categ', 'int'); +$subcat = false; +if (GETPOST('subcat', 'alpha') === 'yes') { + $subcat = true; +} + // Security check if ($user->societe_id > 0) $socid = $user->societe_id; if (! empty($conf->comptabilite->enabled)) $result=restrictedArea($user,'compta','','','resultat'); @@ -49,6 +59,12 @@ if (! empty($conf->accounting->enabled)) $result=restrictedArea($user,'accountin // Date range $year=GETPOST("year"); $month=GETPOST("month"); +$date_startyear = GETPOST("date_startyear"); +$date_startmonth = GETPOST("date_startmonth"); +$date_startday = GETPOST("date_startday"); +$date_endyear = GETPOST("date_endyear"); +$date_endmonth = GETPOST("date_endmonth"); +$date_endday = GETPOST("date_endday"); if (empty($year)) { $year_current = strftime("%Y",dol_now()); @@ -92,10 +108,34 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end else { // TODO We define q - } +$commonparams=array(); +$commonparams['modecompta']=$modecompta; +$commonparams['sortorder'] = $sortorder; +$commonparams['sortfield'] = $sortfield; +$headerparams = array(); +$headerparams['date_startyear'] = $date_startyear; +$headerparams['date_startmonth'] = $date_startmonth; +$headerparams['date_startday'] = $date_startday; +$headerparams['date_endyear'] = $date_endyear; +$headerparams['date_endmonth'] = $date_endmonth; +$headerparams['date_endday'] = $date_endday; +$headerparams['q'] = $q; + +$tableparams = array(); +$tableparams['search_categ'] = $selected_cat; +$tableparams['subcat'] = ($subcat === true)?'yes':''; + +// Adding common parameters +$allparams = array_merge($commonparams, $headerparams, $tableparams); +$headerparams = array_merge($commonparams, $headerparams); +$tableparams = array_merge($commonparams, $tableparams); + +foreach($allparams as $key => $value) { + $paramslink .= '&' . $key . '=' . $value; +} /* * View @@ -105,8 +145,9 @@ llxHeader(); $form=new Form($db); $thirdparty_static=new Societe($db); +$formother = new FormOther($db); -// Affiche en-tete de rapport +// Show report header if ($modecompta=="CREANCES-DETTES") { $nom=$langs->trans("SalesTurnover").', '.$langs->trans("ByThirdParties"); @@ -118,8 +159,7 @@ if ($modecompta=="CREANCES-DETTES") else $description.= $langs->trans("DepositsAreIncluded"); $builddate=time(); //$exportlink=$langs->trans("NotYetAvailable"); -} -else { +} else { $nom=$langs->trans("SalesTurnover").', '.$langs->trans("ByThirdParties"); $nom.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); @@ -129,26 +169,44 @@ else { $builddate=time(); //$exportlink=$langs->trans("NotYetAvailable"); } -$moreparam=array(); -if (! empty($modecompta)) $moreparam['modecompta']=$modecompta; -report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,$moreparam); + +report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,$tableparams); -// Charge tableau +// Show Array $catotal=0; -if ($modecompta == 'CREANCES-DETTES') -{ - $sql = "SELECT s.rowid as socid, s.nom as name, sum(f.total) as amount, sum(f.total_ttc) as amount_ttc"; +if ($modecompta == 'CREANCES-DETTES') { + $sql = "SELECT DISTINCT s.rowid as socid, s.nom as name,"; + $sql.= " sum(DISTINCT f.total) as amount, sum(DISTINCT f.total_ttc) as amount_ttc"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; - $sql.= ", ".MAIN_DB_PREFIX."facture as f"; + $sql.= " JOIN ".MAIN_DB_PREFIX."facture as f"; + if ($selected_cat === -2) { + $sql.= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_societe"; + } + if ($selected_cat && $selected_cat !== -2) { + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON c.rowid = ".$selected_cat; + if (subcat) { + $sql.=" OR c.fk_parent = " . $selected_cat; + } + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_societe as cs ON cs.fk_categorie = c.rowid"; + } $sql.= " WHERE f.fk_statut in (1,2)"; - if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2)"; - else $sql.= " AND f.type IN (0,1,2,3)"; + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql.= " AND f.type IN (0,1,2)"; + } else { + $sql.= " AND f.type IN (0,1,2,3)"; + } $sql.= " AND f.fk_soc = s.rowid"; - if ($date_start && $date_end) $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; -} -else -{ + if ($date_start && $date_end) { + $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; + } + if ($selected_cat === -2) { + $sql.=" AND cs.fk_societe is null"; + } + if ($selected_cat && $selected_cat !== -2) { + $sql.= " AND cs.fk_societe = s.rowid"; + } + } else { /* * Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les * vieilles versions, ils n'etaient pas lies via paiement_facture. On les ajoute plus loin) @@ -161,7 +219,9 @@ else $sql .= " WHERE p.rowid = pf.fk_paiement"; $sql.= " AND pf.fk_facture = f.rowid"; $sql.= " AND f.fk_soc = s.rowid"; - if ($date_start && $date_end) $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; + if ($date_start && $date_end) { + $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; + } } $sql.= " AND f.entity = ".$conf->entity; if ($socid) $sql.= " AND f.fk_soc = ".$socid; @@ -169,27 +229,26 @@ $sql.= " GROUP BY s.rowid, s.nom"; $sql.= " ORDER BY s.rowid"; $result = $db->query($sql); -if ($result) -{ +if ($result) { $num = $db->num_rows($result); $i=0; - while ($i < $num) - { + while ($i < $num) { $obj = $db->fetch_object($result); - $amount[$obj->socid] += $obj->amount_ttc; - $name[$obj->socid] = $obj->name; - $catotal+=$obj->amount_ttc; - $i++; + $amount_ht[$obj->socid] = $obj->amount; + $amount[$obj->socid] = $obj->amount_ttc; + $name[$obj->socid] = $obj->name.' '.$obj->firstname; + $catotal_ht+=$obj->amount; + $catotal+=$obj->amount_ttc; + $i++; + } -} -else { +} else { dol_print_error($db); } // On ajoute les paiements anciennes version, non lies par paiement_facture -if ($modecompta != 'CREANCES-DETTES') -{ - $sql = "SELECT '0' as socid, 'Autres' as name, sum(p.amount) as amount_ttc"; +if ($modecompta != 'CREANCES-DETTES') { + $sql = "SELECT '0' as socid, 'Autres' as name, sum(DISTINCT p.amount) as amount_ttc"; $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; $sql.= ", ".MAIN_DB_PREFIX."bank_account as ba"; $sql.= ", ".MAIN_DB_PREFIX."paiement as p"; @@ -203,20 +262,17 @@ if ($modecompta != 'CREANCES-DETTES') $sql.= " ORDER BY name"; $result = $db->query($sql); - if ($result) - { + if ($result) { $num = $db->num_rows($result); $i=0; - while ($i < $num) - { + while ($i < $num) { $obj = $db->fetch_object($result); $amount[$obj->rowid] += $obj->amount_ttc; $name[$obj->rowid] = $obj->name; $catotal+=$obj->amount_ttc; $i++; } - } - else { + } else { dol_print_error($db); } } @@ -224,20 +280,87 @@ if ($modecompta != 'CREANCES-DETTES') // Show array $i = 0; +print ''; +// Extra parameters management +foreach($headerparams as $key => $value) +{ + print ''; +} print "
".$linkname."'; if ($modecompta != 'CREANCES-DETTES') { - if ($key > 0) print ''; - else print ''; + if ($key > 0) { + print ''; + } else { + print ''; + } + } else { + if ($key > 0) { + print ''; + } else { + print ''; + } + print price($amount_ht[$key]); } - else - { - if ($key > 0) print ''; - else print ''; + print ''; + if ($modecompta != 'CREANCES-DETTES') { + if ($key > 0) { + print ''; + } else { + print ''; + } + } else { + if ($key > 0) { + print ''; + } else { + print ''; + } } print price($amount[$key]); print ''; - if (! empty($conf->propal->enabled) && $key>0) print ' '.img_picto($langs->trans("ProposalStats"),"stats").' '; - if (! empty($conf->commande->enabled) && $key>0) print ' '.img_picto($langs->trans("OrderStats"),"stats").' '; - if (! empty($conf->facture->enabled) && $key>0) print ' '.img_picto($langs->trans("InvoiceStats"),"stats").' '; + if (! empty($conf->propal->enabled) && $key>0) { + print ' '.img_picto($langs->trans("ProposalStats"),"stats").' '; + } + if (! empty($conf->commande->enabled) && $key>0) { + print ' '.img_picto($langs->trans("OrderStats"),"stats").' '; + } + if (! empty($conf->facture->enabled) && $key>0) { + print ' '.img_picto($langs->trans("InvoiceStats"),"stats").' '; + } print '
'.$langs->trans("Total").''.price($catotal).' 
'.$langs->trans("Total").''.price($catotal_ht).''.price($catotal).'  
"; -print ""; -print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"nom","",'&year='.($year).'&modecompta='.$modecompta,"",$sortfield,$sortorder); -print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"amount_ttc","",'&year='.($year).'&modecompta='.$modecompta,'align="right"',$sortfield,$sortorder); -print_liste_field_titre($langs->trans("Percentage"),$_SERVER["PHP_SELF"],"amount_ttc","",'&year='.($year).'&modecompta='.$modecompta,'align="right"',$sortfield,$sortorder); -print_liste_field_titre($langs->trans("OtherStatistics"),$_SERVER["PHP_SELF"],"","","",'align="center" width="20%"'); + // Category filter +print ''; +print ''; +print ''; +print ''; + // Array titles +print ""; +print_liste_field_titre( + $langs->trans("Company"), + $_SERVER["PHP_SELF"], + "nom", + "", + $paramslink, + "", + $sortfield,$sortorder + ); +if ($modecompta == 'CREANCES-DETTES') { + print_liste_field_titre( + $langs->trans('AmountHT'), + $_SERVER["PHP_SELF"], + "amount_ht", + "", + $paramslink, + 'align="right"', + $sortfield, + $sortorder + ); + } else { + print ''; +} +print_liste_field_titre( + $langs->trans("AmountTTC"), + $_SERVER["PHP_SELF"], + "amount_ttc", + "", + $paramslink, + 'align="right"', + $sortfield, + $sortorder + ); +print_liste_field_titre( + $langs->trans("Percentage"), + $_SERVER["PHP_SELF"], + "amount_ttc", + "", + $paramslink, + 'align="right"', + $sortfield, + $sortorder + ); +print_liste_field_titre( + $langs->trans("OtherStatistics"), + $_SERVER["PHP_SELF"], + "", + "", + "", + 'align="center" width="20%"' + ); print "\n"; $var=true; -if (count($amount)) -{ +if (count($amount)) { $arrayforsort=$name; - - // On definit tableau arrayforsort + // Defining array arrayforsort if ($sortfield == 'nom' && $sortorder == 'asc') { asort($name); $arrayforsort=$name; @@ -246,6 +369,14 @@ if (count($amount)) arsort($name); $arrayforsort=$name; } + if ($sortfield == 'amount_ht' && $sortorder == 'asc') { + asort($amount_ht); + $arrayforsort=$amount_ht; + } + if ($sortfield == 'amount_ht' && $sortorder == 'desc') { + arsort($amount_ht); + $arrayforsort=$amount_ht; + } if ($sortfield == 'amount_ttc' && $sortorder == 'asc') { asort($amount); $arrayforsort=$amount; @@ -255,8 +386,7 @@ if (count($amount)) $arrayforsort=$amount; } - foreach($arrayforsort as $key=>$value) - { + foreach($arrayforsort as $key=>$value) { $var=!$var; print ""; @@ -267,23 +397,43 @@ if (count($amount)) $thirdparty_static->name=$fullname; $thirdparty_static->client=1; $linkname=$thirdparty_static->getNomUrl(1,'customer'); - } - else { + } else { $linkname=$langs->trans("PaymentsNotLinkedToInvoice"); } print "\n"; - // Amount + // Amount w/o VAT print ''; + + // Amount with VAT + print ''; - - print "\n"; - $i++; + print "\n"; + $i++; } // Total - print ''; + print ''; + print ''; + if ($modecompta != 'CREANCES-DETTES') { + print ''; + } else { + print ''; + } + print ''; + print ''; print ''; print ''; @@ -312,8 +475,7 @@ if (count($amount)) } print "
'; +print $langs->trans("Category") . ': ' . $formother->select_categories(2, $selected_cat, 'search_categ', true); +print ' '; +print $langs->trans("SubCats") . '? '; +print ''; +print ''; +print '
".$linkname."'; - if ($modecompta != 'CREANCES-DETTES') - { - if ($key > 0) print ''; - else print ''; + if ($modecompta != 'CREANCES-DETTES') { + if ($key > 0) { + print ''; + } else { + print ''; + } + } else { + if ($key > 0) { + print ''; + } else { + print ''; + } + print price($amount_ht[$key]); } - else - { - if ($key > 0) print ''; - else print ''; + print ''; + if ($modecompta != 'CREANCES-DETTES') { + if ($key > 0) { + print ''; + } else { + print ''; + } + } else { + if ($key > 0) { + print ''; + } else { + print ''; + } } print price($amount[$key]); print ''; @@ -294,17 +444,30 @@ if (count($amount)) // Other stats print ''; - if (! empty($conf->propal->enabled) && $key>0) print ' '.img_picto($langs->trans("ProposalStats"),"stats").' '; - if (! empty($conf->commande->enabled) && $key>0) print ' '.img_picto($langs->trans("OrderStats"),"stats").' '; - if (! empty($conf->facture->enabled) && $key>0) print ' '.img_picto($langs->trans("InvoiceStats"),"stats").' '; + if (! empty($conf->propal->enabled) && $key>0) { + print ' '.img_picto($langs->trans("ProposalStats"),"stats").' '; + } + if (! empty($conf->commande->enabled) && $key>0) { + print ' '.img_picto($langs->trans("OrderStats"),"stats").' '; + } + if (! empty($conf->facture->enabled) && $key>0) { + print ' '.img_picto($langs->trans("InvoiceStats"),"stats").' '; + } print '
'.$langs->trans("Total").''.price($catotal).' 
'.$langs->trans("Total").''.price($catotal_ht).''.price($catotal).'  
"; -print '
'; - +print '
'; llxFooter(); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 641925f42a9..f4d7f3581db 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -852,6 +852,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu */ if (empty($leftmenu) || $leftmenu=="ca") $newmenu->add("/compta/stats/casoc.php?leftmenu=ca",$langs->trans("ByCompanies"),2,$user->rights->compta->resultat->lire||$user->rights->accounting->comptarapport->lire); if (empty($leftmenu) || $leftmenu=="ca") $newmenu->add("/compta/stats/cabyuser.php?leftmenu=ca",$langs->trans("ByUsers"),2,$user->rights->compta->resultat->lire||$user->rights->accounting->comptarapport->lire); + if (empty($leftmenu) || $leftmenu=="ca") $newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=ca", $langs->trans("ByProductsAndServices"),2,$user->rights->compta->resultat->lire||$user->rights->accounting->comptarapport->lire); + // Journaux //if ($leftmenu=="ca") $newmenu->add("/compta/journaux/index.php?leftmenu=ca",$langs->trans("Journaux"),1,$user->rights->compta->resultat->lire||$user->rights->accounting->comptarapport->lire); diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index 5e3a36e5051..a1b3cba5004 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -152,4 +152,5 @@ Pcg_type=Pcg type Pcg_subtype=Pcg subtype InvoiceLinesToDispatch=Invoice lines to dispatch InvoiceDispatched=Dispatched invoices -AccountancyDashboard=Accountancy summary \ No newline at end of file +AccountancyDashboard=Accountancy summary +ByProductsAndServices=By products and services diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 48795ba2ce7..3cfee357c81 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -136,4 +136,5 @@ WarningLockFileDoesNotExists=Warning, once setup is finished, you must disable i WarningUntilDirRemoved=All security warnings (visible by admin users only) will remain active as long as the vulnerability is present (or that constant MAIN_REMOVE_INSTALL_WARNING is added in Setup->Other setup). WarningCloseAlways=Warning, closing is done even if amount differs between source and target elements. Enable this feature with caution. WarningUsingThisBoxSlowDown=Warning, using this box slow down seriously all pages showing the box. -WarningClickToDialUserSetupNotComplete=Setup of ClickToDial information for your user are not complete (see tab ClickToDial onto your user card). \ No newline at end of file +WarningClickToDialUserSetupNotComplete=Setup of ClickToDial information for your user are not complete (see tab ClickToDial onto your user card). +WarningNotRelevant=Irrelevant operation for this dataset diff --git a/htdocs/langs/fr_FR/compta.lang b/htdocs/langs/fr_FR/compta.lang index 1491a7820f4..227b6b734ad 100644 --- a/htdocs/langs/fr_FR/compta.lang +++ b/htdocs/langs/fr_FR/compta.lang @@ -163,4 +163,5 @@ Pcg_type=Classe de compte Pcg_subtype=Sous classe de compte InvoiceLinesToDispatch=Lignes de factures à ventiler InvoiceDispatched=Factures ventilées -AccountancyDashboard=Synthèse compta/tréso \ No newline at end of file +AccountancyDashboard=Synthèse compta/tréso +ByProductsAndServices=Par produits et services diff --git a/htdocs/langs/fr_FR/errors.lang b/htdocs/langs/fr_FR/errors.lang index f1316e03d13..5081f66d5f7 100644 --- a/htdocs/langs/fr_FR/errors.lang +++ b/htdocs/langs/fr_FR/errors.lang @@ -137,4 +137,5 @@ WarningLockFileDoesNotExists=Attention, une fois l'installation terminée, les o WarningUntilDirRemoved=Les alertes de sécurité sont visibles par les administrateurs uniquement et resteront actives tant que la vulnérabilité sera avérée (ou que la constante MAIN_REMOVE_INSTALL_WARNING aura été définie dans Configuration->Divers) WarningCloseAlways=Attention, la fermeture se fait même lorsque le montant diffère. N'activez cette fonctionnalité qu'en connaissance de cause. WarningUsingThisBoxSlowDown=Attention, l'utilisation de cette boite provoque de sérieux ralentissement des pages affichant cette boite. -WarningClickToDialUserSetupNotComplete=La configuration ClickToDial pour votre compte utilisateur n'est pas complète (voir l'onglet ClickToDial sur votre fiche utilisateur) \ No newline at end of file +WarningClickToDialUserSetupNotComplete=La configuration ClickToDial pour votre compte utilisateur n'est pas complète (voir l'onglet ClickToDial sur votre fiche utilisateur) +WarningNotRelevant=Opération non pertinente pour cet ensemble de données From 4202c8fc914aee06e4e5a03e58b06e2e16dd01ac Mon Sep 17 00:00:00 2001 From: fhenry Date: Sat, 20 Apr 2013 17:56:39 +0200 Subject: [PATCH 12/44] required once instead of require --- htdocs/compta/facture.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 32505622a85..d5e24eb61f8 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -29,13 +29,13 @@ */ require '../main.inc.php'; -require DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; -require DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php'; -require DOL_DOCUMENT_ROOT . '/core/modules/facture/modules_facture.php'; -require DOL_DOCUMENT_ROOT . '/core/class/discount.class.php'; -require DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; -require DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; -require DOL_DOCUMENT_ROOT . '/core/lib/invoice.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 . '/core/modules/facture/modules_facture.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/discount.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/invoice.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; From 50eb88db5df9d6b34998dbac7c63cb5563574621 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Sun, 21 Apr 2013 10:11:19 +0200 Subject: [PATCH 13/44] Fixed turnover by user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mistakingly used distinct in SQL request --- htdocs/compta/stats/cabyuser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php index d4ef827ad0f..82bbff465eb 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -188,7 +188,7 @@ if ($modecompta == 'CREANCES-DETTES') { * Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les * vieilles versions, ils n'etaient pas lies via paiement_facture. On les ajoute plus loin) */ - $sql = "SELECT u.rowid as rowid, u.lastname as name, u.firstname as firstname, sum(DISTINCT pf.amount) as amount_ttc"; + $sql = "SELECT u.rowid as rowid, u.lastname as name, u.firstname as firstname, sum(pf.amount) as amount_ttc"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u" ; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON f.fk_user_author = u.rowid "; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON pf.fk_facture = f.rowid"; From 6cce2c0b10fd76428743ba0243051f50750e7ba2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Sun, 21 Apr 2013 10:19:07 +0200 Subject: [PATCH 14/44] Added forgotten file --- htdocs/compta/stats/cabyprodserv.php | 390 +++++++++++++++++++++++++++ 1 file changed, 390 insertions(+) create mode 100644 htdocs/compta/stats/cabyprodserv.php diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php new file mode 100644 index 00000000000..6adbd4ebf06 --- /dev/null +++ b/htdocs/compta/stats/cabyprodserv.php @@ -0,0 +1,390 @@ + + * + * 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/stats/cabyprodserv.php + * \brief Page reporting TO by Products & Services + */ + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; + +$langs->load("products"); +$langs->load("categories"); +$langs->load("errors"); + +// Security pack (data & check) +$socid = GETPOST('socid','int'); + +if ($user->societe_id > 0) $socid = $user->societe_id; +if (! empty($conf->comptabilite->enabled)) $result=restrictedArea($user,'compta','','','resultat'); +if (! empty($conf->accounting->enabled)) $result=restrictedArea($user,'accounting','','','comptarapport'); + +// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES') +$modecompta = $conf->global->COMPTA_MODE; +if (GETPOST("modecompta")) $modecompta=GETPOST("modecompta"); + +$sortorder=isset($_GET["sortorder"])?$_GET["sortorder"]:$_POST["sortorder"]; +$sortfield=isset($_GET["sortfield"])?$_GET["sortfield"]:$_POST["sortfield"]; +if (! $sortorder) $sortorder="asc"; +if (! $sortfield) $sortfield="name"; + +// Category +$selected_cat = (int)GETPOST('search_categ', 'int'); +$subcat = false; +if (GETPOST('subcat', 'alpha') === 'yes') { + $subcat = true; +} + +// Date range +$year=GETPOST("year"); +$month=GETPOST("month"); +$date_startyear = GETPOST("date_startyear"); +$date_startmonth = GETPOST("date_startmonth"); +$date_startday = GETPOST("date_startday"); +$date_endyear = GETPOST("date_endyear"); +$date_endmonth = GETPOST("date_endmonth"); +$date_endday = GETPOST("date_endday"); +if (empty($year)) +{ + $year_current = strftime("%Y",dol_now()); + $month_current = strftime("%m",dol_now()); + $year_start = $year_current; +} else { + $year_current = $year; + $month_current = strftime("%m",dol_now()); + $year_start = $year; +} +$date_start=dol_mktime(0,0,0,$_REQUEST["date_startmonth"],$_REQUEST["date_startday"],$_REQUEST["date_startyear"]); +$date_end=dol_mktime(23,59,59,$_REQUEST["date_endmonth"],$_REQUEST["date_endday"],$_REQUEST["date_endyear"]); +// Quarter +if (empty($date_start) || empty($date_end)) // We define date_start and date_end +{ + $q=GETPOST("q")?GETPOST("q"):0; + if ($q==0) + { + // We define date_start and date_end + $month_start=GETPOST("month")?GETPOST("month"):($conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START):1); + $year_end=$year_start; + $month_end=$month_start; + if (! GETPOST("month")) // If month not forced + { + if (! GETPOST('year') && $month_start > $month_current) + { + $year_start--; + $year_end--; + } + $month_end=$month_start-1; + if ($month_end < 1) $month_end=12; + else $year_end++; + } + $date_start=dol_get_first_day($year_start,$month_start,false); $date_end=dol_get_last_day($year_end,$month_end,false); + } + if ($q==1) { $date_start=dol_get_first_day($year_start,1,false); $date_end=dol_get_last_day($year_start,3,false); } + if ($q==2) { $date_start=dol_get_first_day($year_start,4,false); $date_end=dol_get_last_day($year_start,6,false); } + if ($q==3) { $date_start=dol_get_first_day($year_start,7,false); $date_end=dol_get_last_day($year_start,9,false); } + if ($q==4) { $date_start=dol_get_first_day($year_start,10,false); $date_end=dol_get_last_day($year_start,12,false); } +} else { + // TODO We define q +} + +$commonparams=array(); +$commonparams['modecompta']=$modecompta; +$commonparams['sortorder'] = $sortorder; +$commonparams['sortfield'] = $sortfield; + +$headerparams = array(); +$headerparams['date_startyear'] = $date_startyear; +$headerparams['date_startmonth'] = $date_startmonth; +$headerparams['date_startday'] = $date_startday; +$headerparams['date_endyear'] = $date_endyear; +$headerparams['date_endmonth'] = $date_endmonth; +$headerparams['date_endday'] = $date_endday; +$headerparams['q'] = $q; + +$tableparams = array(); +$tableparams['search_categ'] = $selected_cat; +$tableparams['subcat'] = ($subcat === true)?'yes':''; + +// Adding common parameters +$allparams = array_merge($commonparams, $headerparams, $tableparams); +$headerparams = array_merge($commonparams, $headerparams); +$tableparams = array_merge($commonparams, $tableparams); + +foreach($allparams as $key => $value) { + $paramslink .= '&' . $key . '=' . $value; +} +/* + * View + */ +llxHeader(); +$form=new Form($db); +$formother = new FormOther($db); + +// Show report header +$nom=$langs->trans("SalesTurnover").', '.$langs->trans("ByProductsAndServices"); + +if ($modecompta=="CREANCES-DETTES") { + $nom.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; + + $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); + + $description=$langs->trans("RulesCADue"); + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $description.= $langs->trans("DepositsAreNotIncluded"); + } else { + $description.= $langs->trans("DepositsAreIncluded"); + } + + $builddate=time(); +} else { + $nom.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; + + $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); + + $description=$langs->trans("RulesCAIn"); + $description.= $langs->trans("DepositsAreIncluded"); + + $builddate=time(); +} + +report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,$tableparams); + + +// SQL request +$catotal=0; + +if ($modecompta == 'CREANCES-DETTES') { + $sql = "SELECT DISTINCT p.rowid as rowid, p.ref as ref, p.label as label,"; + $sql.= " sum(DISTINCT l.total_ht) as amount, sum(DISTINCT l.total_ttc) as amount_ttc"; + $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; + $sql.= " JOIN ".MAIN_DB_PREFIX."facturedet as l"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON l.fk_facture = f.rowid"; + if ($selected_cat === -2) { + $sql.=" LEFT OUTER JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product"; + } + if ($selected_cat && $selected_cat !== -2) { + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON c.rowid = " . $selected_cat; + if ($subcat) { + $sql.=" OR c.fk_parent = " . $selected_cat; + } + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON cp.fk_categorie = c.rowid"; + } + $sql.= " WHERE l.fk_product = p.rowid"; + $sql.= " AND f.fk_statut in (1,2)"; + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql.= " AND f.type IN (0,1,2)"; + } else { + $sql.= " AND f.type IN (0,1,2,3)"; + } + if ($date_start && $date_end) { + $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; + } + if ($selected_cat === -2) { + $sql.=" AND cp.fk_product is null"; + } + if ($selected_cat && $selected_cat !== -2) { + $sql.= " AND cp.fk_product = p.rowid"; + } + $sql.= " AND f.entity = ".$conf->entity; + $sql.= " GROUP BY p.rowid "; + $sql.= "ORDER BY p.ref "; + + $result = $db->query($sql); + if ($result) { + $num = $db->num_rows($result); + $i=0; + while ($i < $num) { + $obj = $db->fetch_object($result); + $amount_ht[$obj->rowid] = $obj->amount; + $amount[$obj->rowid] = $obj->amount_ttc; + $name[$obj->rowid] = $obj->ref . ' - ' . $obj->label; + $catotal_ht+=$obj->amount; + $catotal+=$obj->amount_ttc; + $i++; + } + } else { + dol_print_error($db); + } + + // Show Array + $i=0; + print '
'; + // Extra parameters management + foreach($headerparams as $key => $value) + { + print ''; + } + + print ''; + // Category filter + print ''; + print ''; + print ''; + // Array header + print ""; + print_liste_field_titre( + $langs->trans("Product"), + $_SERVER["PHP_SELF"], + "name", + "", + $paramslink, + "", + $sortfield, + $sortorder + ); + print_liste_field_titre( + $langs->trans('AmountHT'), + $_SERVER["PHP_SELF"], + "amount_ht", + "", + $paramslink, + 'align="right"', + $sortfield, + $sortorder + ); + print_liste_field_titre( + $langs->trans("AmountTTC"), + $_SERVER["PHP_SELF"], + "amount_ttc", + "", + $paramslink, + 'align="right"', + $sortfield, + $sortorder + ); + print_liste_field_titre( + $langs->trans("Percentage"), + $_SERVER["PHP_SELF"], + "amount_ttc", + "", + $paramslink, + 'align="right"', + $sortfield, + $sortorder + ); + // TODO: statistics? + print "\n"; + + // Array Data + $var=true; + + if (count($amount)) { + $arrayforsort=$name; + // defining arrayforsort + if ($sortfield == 'nom' && $sortorder == 'asc') { + asort($name); + $arrayforsort=$name; + } + if ($sortfield == 'nom' && $sortorder == 'desc') { + arsort($name); + $arrayforsort=$name; + } + if ($sortfield == 'amount_ht' && $sortorder == 'asc') { + asort($amount_ht); + $arrayforsort=$amount_ht; + } + if ($sortfield == 'amount_ht' && $sortorder == 'desc') { + arsort($amount_ht); + $arrayforsort=$amount_ht; + } + if ($sortfield == 'amount_ttc' && $sortorder == 'asc') { + asort($amount); + $arrayforsort=$amount; + } + if ($sortfield == 'amount_ttc' && $sortorder == 'desc') { + arsort($amount); + $arrayforsort=$amount; + } + foreach($arrayforsort as $key=>$value) { + $var=!$var; + print ""; + + // Third party + $fullname=$name[$key]; + if ($key >= 0) { + $linkname=''.img_object($langs->trans("ShowProduct"),'product').' '.$fullname.''; + } else { + $linkname=$langs->trans("PaymentsNotLinkedToProduct"); + } + + print "\n"; + + // Amount w/o VAT + print ''; + + // Amount with VAT + print ''; + + // Percent; + print ''; + + // TODO: statistics? + + print "\n"; + $i++; + } + + // Total + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + $db->free($result); + } + print "
'; + print $langs->trans("Category") . ': ' . $formother->select_categories(0, $selected_cat, 'search_categ', true); + print ' '; + print $langs->trans("SubCats") . '? '; + print ''; + print ''; + print '
".$linkname."'; + if ($key > 0) { + print ''; + } else { + print ''; + } + print price($amount_ht[$key]); + print ''; + if ($key > 0) { + print ''; + } else { + print ''; + } + print price($amount[$key]); + print ''; + print ''.($catotal > 0 ? round(100 * $amount[$key] / $catotal, 2).'%' : ' ').'
'.$langs->trans("Total").''.price($catotal_ht).''.price($catotal).' 
"; + print '
'; +} else { + // $modecompta != 'CREANCES-DETTES' + // TODO: better message + print '
' . $langs->trans("WarningNotRelevant") . '
'; +} + +llxFooter(); +$db->close(); +?> From 52b4daf69670d59687de70f89d5060303b67a96d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sun, 21 Apr 2013 10:43:34 +0200 Subject: [PATCH 15/44] Refactor + replaced "OK" and "Error" status install messages with images --- htdocs/install/etape1.php | 42 ++++++++++++++++----------------------- htdocs/install/etape2.php | 20 +++++++++---------- 2 files changed, 27 insertions(+), 35 deletions(-) diff --git a/htdocs/install/etape1.php b/htdocs/install/etape1.php index 24e56a7ecf0..53f1aba9e19 100644 --- a/htdocs/install/etape1.php +++ b/htdocs/install/etape1.php @@ -458,7 +458,7 @@ if (! $error && $db->connected && $action == "set") print ''; print $langs->trans("ConfFileReload"); print ''; - print ''.$langs->trans("OK").''; + print 'Ok'; $userroot=isset($_POST["db_user_root"])?$_POST["db_user_root"]:""; @@ -508,7 +508,7 @@ if (! $error && $db->connected && $action == "set") print $langs->trans("UserCreation").' : '; print $dolibarr_main_db_user; print ''; - print ''.$langs->trans("OK").''; + print 'Ok'; } else { @@ -542,7 +542,7 @@ if (! $error && $db->connected && $action == "set") print $langs->trans("UserCreation").' : '; print $dolibarr_main_db_user; print ''; - print ''.$langs->trans("Error").''; + print 'Error'; print ''; // Affiche aide diagnostique @@ -576,7 +576,7 @@ if (! $error && $db->connected && $action == "set") print $langs->trans("DatabaseCreation")." (".$langs->trans("User")." ".$userroot.") : "; print $dolibarr_main_db_name; print ''; - print "".$langs->trans("OK").""; + print 'Ok'; $check1=$newdb->getDefaultCharacterSetDatabase(); $check2=$newdb->getDefaultCollationDatabase(); @@ -606,7 +606,7 @@ if (! $error && $db->connected && $action == "set") print $langs->trans("DatabaseCreation")." (".$langs->trans("User")." ".$userroot.") : "; print $dolibarr_main_db_name; print ''; - print ''.$langs->trans("Error").''; + print 'Error'; print ''; // Affiche aide diagnostique @@ -632,43 +632,35 @@ if (! $error && $db->connected && $action == "set") if ($db->connected == 1) { + dolibarr_install_syslog("etape1: connexion to server by user ".$conf->db->user." is ok", LOG_DEBUG); + print ""; + print $langs->trans("ServerConnection")." (".$langs->trans("User")." ".$conf->db->user.") : "; + print $dolibarr_main_db_host; + print ""; + print 'Ok'; + print ""; + // si acces serveur ok et acces base ok, tout est ok, on ne va pas plus loin, on a meme pas utilise le compte root. if ($db->database_selected == 1) { - dolibarr_install_syslog("etape1: connexion to server by user ".$conf->db->user." is ok", LOG_DEBUG); - print ""; - print $langs->trans("ServerConnection")." (".$langs->trans("User")." ".$conf->db->user.") : "; - print $dolibarr_main_db_host; - print ""; - print $langs->trans("OK"); - print ""; - dolibarr_install_syslog("etape1: connexion to database : ".$conf->db->name.", by user : ".$conf->db->user." is ok", LOG_DEBUG); print ""; print $langs->trans("DatabaseConnection")." (".$langs->trans("User")." ".$conf->db->user.") : "; print $dolibarr_main_db_name; print ""; - print $langs->trans("OK"); + print 'Ok'; print ""; $error = 0; } else { - dolibarr_install_syslog("etape1: connexion to server by user ".$conf->db->user." is ok", LOG_DEBUG); - print ""; - print $langs->trans("ServerConnection")." (".$langs->trans("User")." ".$conf->db->user.") : "; - print $dolibarr_main_db_host; - print ""; - print $langs->trans("OK"); - print ""; - dolibarr_install_syslog("etape1: connexion to database ".$conf->db->name.", by user : ".$conf->db->user." has failed", LOG_ERR); print ""; print $langs->trans("DatabaseConnection")." (".$langs->trans("User")." ".$conf->db->user.") : "; print $dolibarr_main_db_name; print ''; - print $langs->trans("Error"); + print 'Error'; print ""; // Affiche aide diagnostique @@ -688,7 +680,7 @@ if (! $error && $db->connected && $action == "set") print $langs->trans("ServerConnection")." (".$langs->trans("User")." ".$conf->db->user.") : "; print $dolibarr_main_db_host; print ''; - print ''.$db->error.''; + print 'Error'; print ""; // Affiche aide diagnostique @@ -938,7 +930,7 @@ function write_conf_file($conffile) print $langs->trans("SaveConfigurationFile"); print ' '.$conffile.''; print ""; - print $langs->trans("OK"); + print 'Ok'; print ""; } else diff --git a/htdocs/install/etape2.php b/htdocs/install/etape2.php index 9ad310dec9d..92b5f2111b7 100644 --- a/htdocs/install/etape2.php +++ b/htdocs/install/etape2.php @@ -87,12 +87,12 @@ if ($action == "set") if ($db->connected == 1) { print ""; - print $langs->trans("ServerConnection")." : ".$conf->db->host."".$langs->trans("OK").""; + print $langs->trans("ServerConnection")." : ".$conf->db->host.'Ok'; $ok = 1 ; } else { - print "Failed to connect to server : ".$conf->db->host."".$langs->trans("Error").""; + print "Failed to connect to server : ".$conf->db->host.'Error'; } if ($ok) @@ -104,7 +104,7 @@ if ($action == "set") else { dolibarr_install_syslog("etape2: Connexion failed to database : ".$conf->db->name); - print "Failed to select database ".$conf->db->name."".$langs->trans("Error").""; + print "Failed to select database ".$conf->db->name.'Error'; $ok = 0 ; } } @@ -241,13 +241,13 @@ if ($action == "set") if ($error == 0) { print ''; - print $langs->trans("TablesAndPrimaryKeysCreation").''.$langs->trans("OK").''; + print $langs->trans("TablesAndPrimaryKeysCreation").'Ok'; $ok = 1; } } else { - print ''.$langs->trans("ErrorFailedToFindSomeFiles",$dir).''.$langs->trans("Error").''; + print ''.$langs->trans("ErrorFailedToFindSomeFiles",$dir).'Error'; dolibarr_install_syslog("Failed to find files to create database in directory ".$dir,LOG_ERR); } } @@ -388,7 +388,7 @@ if ($action == "set") if ($tablefound && $error == 0) { print ''; - print $langs->trans("OtherKeysCreation").''.$langs->trans("OK").''; + print $langs->trans("OtherKeysCreation").'Ok'; $okkeys = 1; } } @@ -466,11 +466,11 @@ if ($action == "set") print "".$langs->trans("FunctionsCreation").""; if ($ok) { - print "".$langs->trans("OK").""; + print 'Ok'; } else { - print ''.$langs->trans("Error").''; + print 'Error'; $ok = 1 ; } @@ -588,11 +588,11 @@ if ($action == "set") print "".$langs->trans("ReferenceDataLoading").""; if ($ok) { - print "".$langs->trans("OK").""; + print 'Ok'; } else { - print ''.$langs->trans("Error").''; + print 'Error'; $ok = 1; // Data loading are not blocking errors } } From 7befeae37124186e2fa797ab1efd17617d649474 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sun, 21 Apr 2013 12:40:46 +0200 Subject: [PATCH 16/44] ECM Refactor --- htdocs/core/ajax/ajaxdirpreview.php | 139 +++++++++------------------- 1 file changed, 43 insertions(+), 96 deletions(-) diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index ef4d976d4d7..b7ac13d3bd3 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -139,8 +139,7 @@ if (! dol_is_dir($upload_dir)) print ''."\n"; print ''."\n"; -$param=''; -$param.=($sortfield?'&sortfield='.$sortfield:'').($sortorder?'&sortorder='.$sortorder:''); +$param=($sortfield?'&sortfield='.$sortfield:'').($sortorder?'&sortorder='.$sortorder:''); $url=DOL_URL_ROOT.'/ecm/index.php'; // Dir scan @@ -149,126 +148,74 @@ if ($type == 'directory') $formfile=new FormFile($db); $maxlengthname=40; + $excludefiles = array('^SPECIMEN\.pdf$','^\.','\.meta$','^temp$','^payments$','^CVS$','^thumbs$'); + $sorting = (strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC); // Right area. If module is defined, we are in automatic ecm. - if ($module == 'company') // Auto area for suppliers invoices - { - $upload_dir = $conf->societe->dir_output; // TODO change for multicompany sharing - $filearray=dol_dir_list($upload_dir,"files",1,'',array('^SPECIMEN\.pdf$','^\.','\.meta$','^temp$','^payments$','^CVS$','^thumbs$'),$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); + $automodules = array('company', 'invoice', 'invoice_supplier', 'propal', 'order', 'order_supplier', 'contract', 'product', 'tax', 'project'); - $param.='&module='.$module; - $textifempty=($section?$langs->trans("NoFileFound"):($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("NoFileFound"))); - - $formfile->list_of_autoecmfiles($upload_dir,$filearray,$module,$param,1,'',$user->rights->ecm->upload,1,$textifempty,$maxlengthname,$url); - } - else if ($module == 'invoice') // Auto area for suppliers invoices - { - $upload_dir = $conf->facture->dir_output; - $filearray=dol_dir_list($upload_dir,"files",1,'',array('^SPECIMEN\.pdf$','^\.','\.meta$','^temp$','^payments$','^CVS$','^thumbs$'),$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); - - $param.='&module='.$module; - $textifempty=($section?$langs->trans("NoFileFound"):($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("NoFileFound"))); - - $formfile->list_of_autoecmfiles($upload_dir,$filearray,$module,$param,1,'',$user->rights->ecm->upload,1,$textifempty,$maxlengthname,$url); - } - else if ($module == 'invoice_supplier') // Auto area for suppliers invoices + // TODO change for multicompany sharing + // Auto area for suppliers invoices + if ($module == 'company') $upload_dir = $conf->societe->dir_output; + // Auto area for suppliers invoices + else if ($module == 'invoice') $upload_dir = $conf->facture->dir_output; + // Auto area for suppliers invoices + else if ($module == 'invoice_supplier') { $relativepath='facture'; $upload_dir = $conf->fournisseur->dir_output.'/'.$relativepath; - $filearray=dol_dir_list($upload_dir,"files",1,'',array('^SPECIMEN\.pdf$','^\.','\.meta$','^temp$','^CVS$','^thumbs$'),$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); - $param.='&module='.$module; - $textifempty=($section?$langs->trans("NoFileFound"):($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("NoFileFound"))); - $formfile->list_of_autoecmfiles($upload_dir,$filearray,$module,$param,1,'',$user->rights->ecm->upload,1,$textifempty,$maxlengthname,$url); } - else if ($module == 'propal') // Auto area for customers orders - { - $upload_dir = $conf->propal->dir_output; - $filearray=dol_dir_list($upload_dir,"files",1,'',array('^SPECIMEN\.pdf$','^\.','\.meta$','^temp$','^payments$','^CVS$','^thumbs$'),$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); - - $param.='&module='.$module; - $textifempty=($section?$langs->trans("NoFileFound"):($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("NoFileFound"))); - - $formfile->list_of_autoecmfiles($upload_dir,$filearray,$module,$param,1,'',$user->rights->ecm->upload,1,$textifempty,$maxlengthname,$url); - } - else if ($module == 'order') // Auto area for customers orders - { - $upload_dir = $conf->commande->dir_output; - $filearray=dol_dir_list($upload_dir,"files",1,'',array('^SPECIMEN\.pdf$','^\.','\.meta$','^temp$','^payments$','^CVS$','^thumbs$'),$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); - - $param.='&module='.$module; - $textifempty=($section?$langs->trans("NoFileFound"):($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("NoFileFound"))); - - $formfile->list_of_autoecmfiles($upload_dir,$filearray,$module,$param,1,'',$user->rights->ecm->upload,1,$textifempty,$maxlengthname,$url); - } - else if ($module == 'order_supplier') // Auto area for suppliers orders + // Auto area for customers orders + else if ($module == 'propal') $upload_dir = $conf->propal->dir_output; + // Auto area for customers orders + else if ($module == 'order') $upload_dir = $conf->commande->dir_output; + // Auto area for suppliers orders + else if ($module == 'order_supplier') { $relativepath='commande'; $upload_dir = $conf->fournisseur->dir_output.'/'.$relativepath; - $filearray=dol_dir_list($upload_dir,"files",1,'',array('^SPECIMEN\.pdf$','^\.','\.meta$','^temp$','^payments$','^CVS$','^thumbs$'),$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); + } + // Auto area for suppliers invoices + else if ($module == 'contract') $upload_dir = $conf->contrat->dir_output; + // Auto area for products + else if ($module == 'product') $upload_dir = $conf->product->dir_output; + // Auto area for suppliers invoices + else if ($module == 'tax') $upload_dir = $conf->tax->dir_output; + // Auto area for projects + else if ($module == 'project') $upload_dir = $conf->projet->dir_output; + if (in_array($module, $automodules)) + { $param.='&module='.$module; $textifempty=($section?$langs->trans("NoFileFound"):($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("NoFileFound"))); + $filearray=dol_dir_list($upload_dir,"files",1,'', $excludefiles, $sortfield, $sorting,1); + var_dump($filearray); $formfile->list_of_autoecmfiles($upload_dir,$filearray,$module,$param,1,'',$user->rights->ecm->upload,1,$textifempty,$maxlengthname,$url); } - else if ($module == 'contract') // Auto area for suppliers invoices - { - $upload_dir = $conf->contrat->dir_output; - $filearray=dol_dir_list($upload_dir,"files",1,'',array('^SPECIMEN\.pdf$','^\.','\.meta$','^temp$','^CVS$','^thumbs$'),$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); - - $param.='&module='.$module; - $textifempty=($section?$langs->trans("NoFileFound"):($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("NoFileFound"))); - - $formfile->list_of_autoecmfiles($upload_dir,$filearray,$module,$param,1,'',$user->rights->ecm->upload,1,$textifempty,$maxlengthname,$url); - } - else if ($module == 'product') // Auto area for products - { - $upload_dir = $conf->product->dir_output; - $filearray=dol_dir_list($upload_dir,"files",1,'',array('^SPECIMEN\.pdf$','^\.','\.meta$','^temp$','^CVS$','^thumbs$'),$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); - - $param.='&module='.$module; - $textifempty=($section?$langs->trans("NoFileFound"):($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("NoFileFound"))); - - $formfile->list_of_autoecmfiles($upload_dir,$filearray,$module,$param,1,'',$user->rights->ecm->upload,1,$textifempty,$maxlengthname,$url); - } - else if ($module == 'tax') // Auto area for suppliers invoices - { - $upload_dir = $conf->tax->dir_output; - $filearray=dol_dir_list($upload_dir,"files",1,'',array('^SPECIMEN\.pdf$','^\.','\.meta$','^temp$','^CVS$','^thumbs$'),$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); - - $param.='&module='.$module; - $textifempty=($section?$langs->trans("NoFileFound"):($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("NoFileFound"))); - - $formfile->list_of_autoecmfiles($upload_dir,$filearray,$module,$param,1,'',$user->rights->ecm->upload,1,$textifempty,$maxlengthname,$url); - } - else if ($module == 'project') // Auto area for projects - { - $upload_dir = $conf->projet->dir_output; - $filearray=dol_dir_list($upload_dir,"files",1,'',array('^SPECIMEN\.pdf$','^\.','\.meta$','^temp$','^CVS$','^thumbs$'),$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); - - $param.='&module='.$module; - $textifempty=($section?$langs->trans("NoFileFound"):($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("NoFileFound"))); - - $formfile->list_of_autoecmfiles($upload_dir,$filearray,$module,$param,1,'',$user->rights->ecm->upload,1,$textifempty,$maxlengthname,$url); - } - else // Manual area + //Manual area + else { $relativepath=$ecmdir->getRelativePath(); $upload_dir = $conf->ecm->dir_output.'/'.$relativepath; - $filearray=dol_dir_list($upload_dir,"files",0,'',array('^\.','\.meta$','^temp$','^CVS$'),$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); - - if ($section) $param.='§ion='.$section; - $textifempty=($section?$langs->trans("NoFileFound"):($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("ECMSelectASection"))); // If $section defined with value 0 if ($section === '0') { - $filearray=array(); - $textifempty='
'.$langs->trans("DirNotSynchronizedSyncFirst").'

'; + $filearray=array(); + $textifempty='
'.$langs->trans("DirNotSynchronizedSyncFirst").'

'; } + else $filearray=dol_dir_list($upload_dir,"files",0,'',array('^\.','\.meta$','^temp$','^CVS$'),$sortfield, $sorting,1); + + if ($section) + { + $param.='§ion='.$section; + $textifempty = $langs->trans('NoFileFound'); + } + else $textifempty=($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("ECMSelectASection")); + $formfile->list_of_documents($filearray,'','ecm',$param,1,$relativepath,$user->rights->ecm->upload,1,$textifempty,$maxlengthname,'',$url); } - } if (! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) From 17902a84557204c65730f690ccb83474bd38c636 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sun, 21 Apr 2013 12:44:13 +0200 Subject: [PATCH 17/44] Removed var_dump --- htdocs/core/ajax/ajaxdirpreview.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index b7ac13d3bd3..73147edeeb0 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -190,7 +190,6 @@ if ($type == 'directory') $textifempty=($section?$langs->trans("NoFileFound"):($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("NoFileFound"))); $filearray=dol_dir_list($upload_dir,"files",1,'', $excludefiles, $sortfield, $sorting,1); - var_dump($filearray); $formfile->list_of_autoecmfiles($upload_dir,$filearray,$module,$param,1,'',$user->rights->ecm->upload,1,$textifempty,$maxlengthname,$url); } //Manual area From 293fc89a9fb173692fd6d4de9a9b5c40fefd8d0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sun, 21 Apr 2013 12:45:34 +0200 Subject: [PATCH 18/44] Missing copyright --- htdocs/core/ajax/ajaxdirpreview.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index 73147edeeb0..2389a681000 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -4,6 +4,7 @@ * Copyright (C) 2005 Simon Tosser * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010 Pierre Morin + * Copyright (C) 2013 Marcos García * * 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 From 82e3a8d0b9c16c744dde875a290d09f6d617f23a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sun, 21 Apr 2013 14:14:30 +0200 Subject: [PATCH 19/44] New: [ task #823 ] Shipping_validate email notification --- ChangeLog | 1 + ..._50_modNotification_Notification.class.php | 17 ++++++++++- htdocs/expedition/fiche.php | 30 +++++++++++++------ htdocs/langs/en_US/other.lang | 1 + htdocs/langs/es_ES/other.lang | 1 + htdocs/langs/fr_FR/other.lang | 1 + 6 files changed, 41 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2eca52d30a7..22a4e6fde72 100644 --- a/ChangeLog +++ b/ChangeLog @@ -50,6 +50,7 @@ For users: - New: [ task #770 ] Add ODT document generation for Projects module - New: [ task #741 ] Add intervention box - New: [ task #826 ] Optionnal increase stock when deleting an invoice already validated +- New: [ task #823 ] Shipping_validate email notification For translators: - Update language files. diff --git a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php index c2785445800..f3b10e7f1f8 100755 --- a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php +++ b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2011 Regis Houssin + * Copyright (C) 2013 Marcos García * * 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 @@ -35,7 +36,8 @@ class InterfaceNotification 'PROPAL_VALIDATE', 'FICHINTER_VALIDATE', 'ORDER_SUPPLIER_APPROVE', - 'ORDER_SUPPLIER_REFUSE' + 'ORDER_SUPPLIER_REFUSE', + 'SHIPPING_VALIDATE' ); /** @@ -196,6 +198,19 @@ class InterfaceNotification $notify = new Notify($this->db); $notify->send($action, $object->socid, $mesg, 'order_supplier', $object->id, $filepdf); } + elseif ($action == 'SHIPPING_VALIDATE') + { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + + $ref = dol_sanitizeFileName($object->ref); + $filepdf = $conf->expedition->dir_output . '/sending/' . $ref . '/' . $ref . '.pdf'; + if (! file_exists($filepdf)) $filepdf=''; + $mesg = $langs->transnoentitiesnoconv("EMailTextExpeditionValidated",$object->ref); + + + $notify = new Notify($this->db); + $notify->send($action, $object->socid, $mesg, 'expedition', $object->id, $filepdf); + } // If not found /* diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index de3107b663f..996e41a649a 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -5,6 +5,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2011-2012 Juanjo Menent * Copyright (C) 2013 Florian Henry + * Copyright (C) 2013 Marcos García * * 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 @@ -698,16 +699,16 @@ if ($action == 'create') //$lines = $object->fetch_lines(1); $numAsked = count($object->lines); - print ''; + }); + '; print '
'; @@ -904,7 +905,7 @@ if ($action == 'create') print '
'; - print ''; + print ''; print '
'; } @@ -974,7 +975,18 @@ else { $numref = $object->ref; } - $ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('ValidateSending'),$langs->trans("ConfirmValidateSending",$numref),'confirm_valid','',0,1); + + $text = $langs->trans("ConfirmValidateSending",$numref); + + if (! empty($conf->notification->enabled)) + { + require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php'; + $notify=new Notify($db); + $text.='
'; + $text.=$notify->confirmMessage('SHIPPING_VALIDATE',$object->socid); + } + + $ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('ValidateSending'),$text,'confirm_valid','',0,1); if ($ret == 'html') print '
'; } /* diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index 6a350078731..bb6c4873c93 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -152,6 +152,7 @@ EMailTextOrderApproved=The order %s has been approved. EMailTextOrderApprovedBy=The order %s has been approved by %s. EMailTextOrderRefused=The order %s has been refused. EMailTextOrderRefusedBy=The order %s has been refused by %s. +EMailTextExpeditionValidated=The shipping %s has been validated. ImportedWithSet=Importation data set DolibarrNotification=Automatic notification ResizeDesc=Enter new width OR new height. Ratio will be kept during resizing... diff --git a/htdocs/langs/es_ES/other.lang b/htdocs/langs/es_ES/other.lang index 60af821e8c1..6d53b9de9cb 100644 --- a/htdocs/langs/es_ES/other.lang +++ b/htdocs/langs/es_ES/other.lang @@ -151,6 +151,7 @@ EMailTextOrderApproved=Pedido %s aprobado EMailTextOrderApprovedBy=Pedido %s aprobado por %s EMailTextOrderRefused=Pedido %s rechazado EMailTextOrderRefusedBy=Pedido %s rechazado por %s +EMailTextExpeditionValidated=El envío %s ha sido validado. ImportedWithSet=Lote de importación (import key) DolibarrNotification=Notificación automática ResizeDesc=Introduzca el nuevo ancho O la nueva altura. La relación se conserva al cambiar el tamaño ... diff --git a/htdocs/langs/fr_FR/other.lang b/htdocs/langs/fr_FR/other.lang index de941e850a6..86218e219be 100644 --- a/htdocs/langs/fr_FR/other.lang +++ b/htdocs/langs/fr_FR/other.lang @@ -151,6 +151,7 @@ EMailTextOrderApproved=La commande %s a été approuvée. EMailTextOrderApprovedBy=La commande %s a été approuvée par %s. EMailTextOrderRefused=La commande %s a été refusée. EMailTextOrderRefusedBy=La commande %s a été refusée par %s. +EMailTextExpeditionValidated= ImportedWithSet=Lot d'importation (Import key) DolibarrNotification=Notification automatique ResizeDesc=Entrer la nouvelle largeur OU la nouvelle hauteur. Le ratio est conservé lors du redimensionnement... From 5b248805c26bd0e793e54c45304d9bf146016bf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sun, 21 Apr 2013 14:24:19 +0200 Subject: [PATCH 20/44] Notifications popup messages were not showing real notifications that were going to be sent --- htdocs/comm/propal.php | 4 ++-- htdocs/commande/fiche.php | 28 ++++++++++++++-------------- htdocs/compta/facture.php | 6 +++--- htdocs/fourn/commande/fiche.php | 6 +++--- htdocs/fourn/facture/fiche.php | 14 +++++++------- 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index c178c37078b..2a7c92dce56 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1534,7 +1534,7 @@ else require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php'; $notify=new Notify($db); $text.='
'; - $text.=$notify->confirmMessage('NOTIFY_VAL_PROPAL',$object->socid); + $text.=$notify->confirmMessage('PROPAL_VALIDATE',$object->socid); } if (! $error) $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateProp'), $text, 'confirm_validate','',0,1); @@ -2171,7 +2171,7 @@ else //print ''; - print ''; + print ''; } diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 9cc8da95d51..4801305a091 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -1784,7 +1784,7 @@ else require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php'; $notify=new Notify($db); $text.='
'; - $text.=$notify->confirmMessage('NOTIFY_VAL_ORDER',$object->socid); + $text.=$notify->confirmMessage('ORDER_VALIDATE',$object->socid); } $formquestion=array(); if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $object->hasProductsOrServices(1)) @@ -1935,15 +1935,15 @@ else print ''.$soc->getNomUrl(1).''; print ''; - if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) - { - $filterabsolutediscount="fk_facture_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice - $filtercreditnote="fk_facture_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice - } - else - { - $filterabsolutediscount="fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description='(DEPOSIT)')"; - $filtercreditnote="fk_facture_source IS NOT NULL AND description <> '(DEPOSIT)'"; + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) + { + $filterabsolutediscount="fk_facture_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice + $filtercreditnote="fk_facture_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice + } + else + { + $filterabsolutediscount="fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description='(DEPOSIT)')"; + $filtercreditnote="fk_facture_source IS NOT NULL AND description <> '(DEPOSIT)'"; } // Relative and absolute discounts @@ -2170,9 +2170,9 @@ else } } - $rowspan=4; - if ($mysoc->localtax1_assuj=="1") $rowspan++; - if ($mysoc->localtax2_assuj=="1") $rowspan++; + $rowspan=4; + if ($mysoc->localtax1_assuj=="1") $rowspan++; + if ($mysoc->localtax2_assuj=="1") $rowspan++; // Total HT print ''.$langs->trans('AmountHT').''; @@ -2411,7 +2411,7 @@ else print ''; } } - print '
'; + print '
'; if ($action != 'presend') diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 2a02522bbcc..6c190bac20b 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -2523,7 +2523,7 @@ else if ($id > 0 || ! empty($ref)) require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php'; $notify=new Notify($db); $text.='
'; - $text.=$notify->confirmMessage('NOTIFY_VAL_FAC',$object->socid); + $text.=$notify->confirmMessage('BILL_VALIDATE',$object->socid); } $formquestion=array(); @@ -3618,7 +3618,7 @@ else if ($id > 0 || ! empty($ref)) print ''; } } - print '
'; + print '
'; if ($action != 'prerelance' && $action != 'presend') { @@ -3659,7 +3659,7 @@ else if ($id > 0 || ! empty($ref)) $somethingshown=$formactions->showactions($object,'invoice',$socid); //print ''; - print ''; + print ''; } else { diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index 653397cfaf5..cad571686e8 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -1077,7 +1077,7 @@ elseif (! empty($object->id)) require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php'; $notify=new Notify($db); $text.='
'; - $text.=$notify->confirmMessage(3,$object->socid); + $text.=$notify->confirmMessage('ORDER_SUPPLIER_APPROVE', $object->socid); } $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateOrder'), $text, 'confirm_valid', '', 0, 1); @@ -1762,10 +1762,10 @@ elseif (! empty($object->id)) print ""; } - print "
"; + print "
"; - print '
'; + print '
'; //print '\n"; print '
'; //print ''; // ancre diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 23ed291c681..1ea01631f79 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -1342,12 +1342,12 @@ else } $text=$langs->trans('ConfirmValidateBill',$numref); - /*if (! empty($conf->notification->enabled)) - { - require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php'; - $notify=new Notify($db); - $text.='
'; - $text.=$notify->confirmMessage('NOTIFY_VAL_FAC_SUP',$object->socid); + /*if (! empty($conf->notification->enabled)) + { + require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php'; + $notify=new Notify($db); + $text.='
'; + $text.=$notify->confirmMessage('BILL_SUPPLIER_VALIDATE',$object->socid); }*/ $formquestion=array(); @@ -2066,7 +2066,7 @@ else print ''.$langs->trans('Delete').''; } print ''; - print '
'; + print '
'; if ($action != 'edit') { From fcf1eeba203bdefeaff9619fe8e126402e034d4c Mon Sep 17 00:00:00 2001 From: JF FERRY Date: Sun, 21 Apr 2013 14:55:32 +0200 Subject: [PATCH 21/44] Task #838 - change regex to look at ods document too --- htdocs/core/lib/functions2.lib.php | 2 +- htdocs/core/modules/societe/doc/doc_generic_odt.modules.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 059400d7399..dc6c57002c9 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1283,7 +1283,7 @@ function getListOfModels($db,$type,$maxfilenamelength=0) if (! $tmpdir) { unset($listofdir[$key]); continue; } if (is_dir($tmpdir)) { - $tmpfiles=dol_dir_list($tmpdir,'files',0,'\.odt','','name',SORT_ASC,0,true); // Disable hook for the moment + $tmpfiles=dol_dir_list($tmpdir,'files',0,'\.od(s|t)$','','name',SORT_ASC,0,true); // Disable hook for the moment if (count($tmpfiles)) $listoffiles=array_merge($listoffiles,$tmpfiles); } } diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php index ca93ab1880e..fe40e5c0ad4 100644 --- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php +++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php @@ -109,7 +109,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc if (! is_dir($tmpdir)) $texttitle.=img_warning($langs->trans("ErrorDirNotFound",$tmpdir),0); else { - $tmpfiles=dol_dir_list($tmpdir,'files',0,'\.odt','','name',SORT_ASC,0,true); // Disable hook for the moment + $tmpfiles=dol_dir_list($tmpdir,'files',0,'\.od(s|t)$','','name',SORT_ASC,0,true); // Disable hook for the moment if (count($tmpfiles)) $listoffiles=array_merge($listoffiles,$tmpfiles); } } From 83028b958a4532457717ca27e93357d38271125b Mon Sep 17 00:00:00 2001 From: JF FERRY Date: Sun, 21 Apr 2013 15:12:48 +0200 Subject: [PATCH 22/44] Task #838 : retieve extension to work with ods document --- .../core/modules/societe/doc/doc_generic_odt.modules.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php index fe40e5c0ad4..22835fec8e8 100644 --- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php +++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php @@ -210,16 +210,20 @@ class doc_generic_odt extends ModeleThirdPartyDoc { //print "srctemplatepath=".$srctemplatepath; // Src filename $newfile=basename($srctemplatepath); - $newfiletmp=preg_replace('/\.odt/i','',$newfile); + $newfiletmp=preg_replace('/\.od(s|t)/i','',$newfile); $newfiletmp=preg_replace('/template_/i','',$newfiletmp); $newfiletmp=preg_replace('/modele_/i','',$newfiletmp); - $filename=$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; + // Get extension (ods or odt) + $newfileformat=substr($newfile, strrpos($newfile, '.')+1); + $filename=$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.'.$newfileformat; $file=$dir.'/'.$filename; $object->builddoc_filename=$filename; // For triggers + //print "newfileformat=".$newfileformat; //print "newdir=".$dir; //print "newfile=".$newfile; //print "file=".$file; //print "conf->societe->dir_temp=".$conf->societe->dir_temp; + //exit; dol_mkdir($conf->societe->multidir_temp[$object->entity]); From 0a853c9c7cc58e5c3b4cac4464f1a298529be565 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Sun, 21 Apr 2013 16:14:40 +0300 Subject: [PATCH 23/44] Update products.lang --- htdocs/langs/fr_FR/products.lang | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/fr_FR/products.lang b/htdocs/langs/fr_FR/products.lang index 3d27fdd9d6d..4a805a5c2dc 100644 --- a/htdocs/langs/fr_FR/products.lang +++ b/htdocs/langs/fr_FR/products.lang @@ -184,4 +184,12 @@ AlwaysUseNewPrice=Toujours utiliser le prix du jour AlwaysUseFixedPrice=Utiliser le prix fixé PriceByQuantity=Prix par quantité PriceByQuantityRange=Grille de quantités -ProductsDashboard=Synthèse produits/services \ No newline at end of file +ProductsDashboard=Synthèse produits/services +### composition fabrication +Building=Fabrication +Build=Fabriquer +BuildIt=Lancer la fabrication +BuildindListInfo=Nombre de produit fabricable par entrepot, si saisie à zéro on ne fabrique pas +QtyNeed=Affectée +UnitPmp=Prix Achat Unitaire +CostPmpHT=Cout à l'achat HT From 72e571fcd5aad0b05cafbe12accf5b314a1d1950 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Sun, 21 Apr 2013 16:16:13 +0300 Subject: [PATCH 24/44] Update products.lang Add Fabrication Feature --- htdocs/langs/en_US/products.lang | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index b58dec53dcb..deb19df8e12 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -184,4 +184,14 @@ AlwaysUseNewPrice=Always use current price of product/service AlwaysUseFixedPrice=Use the fixed price PriceByQuantity=Price by quantity PriceByQuantityRange=Quantity range -ProductsDashboard=Products/Services summary \ No newline at end of file +ProductsDashboard=Products/Services summary +### composition fabrication +Building=Production and items dispatchment +Build=Produce +BuildIt=Produce & Dispatch +BuildindListInfo=Available quantity for production per warehouse (set it to 0 for no further action) +QtyNeed=Qty +UnitPmp=Net unit VWAP +CostPmpHT=Net total VWAP +ProductUsedForBuild=Auto consumed by production +ProductBuilded=Production completed From f4513d1beb526534c5321127cf5c8adcb592289b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 21 Apr 2013 16:01:36 +0200 Subject: [PATCH 25/44] Move option ate better place --- htdocs/admin/agenda.php | 49 +----------- htdocs/admin/agenda_other.php | 135 +++++++++++++++++++++++++++++++++ htdocs/core/lib/agenda.lib.php | 5 ++ 3 files changed, 144 insertions(+), 45 deletions(-) create mode 100644 htdocs/admin/agenda_other.php diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php index 7eb659bde97..4e53a709d20 100644 --- a/htdocs/admin/agenda.php +++ b/htdocs/admin/agenda.php @@ -65,8 +65,8 @@ else /* -* Actions -*/ + * Actions + */ if ($action == "save" && empty($cancel)) { $i=0; @@ -125,7 +125,7 @@ if (preg_match('/del_(.*)/',$action,$reg)) /** - * Affichage du formulaire de saisie + * View */ llxHeader(); @@ -184,48 +184,7 @@ print ""; print "\n"; -print ''; - -/* - * Other options -*/ - -print_titre($langs->trans("OtherOptions")); - -$var=true; - -print ''."\n"; -print ''."\n"; -print ''."\n"; -print ''."\n"; -print ''."\n"; -print ''."\n"; - -// Manual or automatic -$var=!$var; -print ''."\n"; -print ''."\n"; -print ''."\n"; - -print ''."\n"; - -print '
'.$langs->trans("Parameters").' '.$langs->trans("Value").'
'.$langs->trans("AGENDA_USE_EVENT_TYPE").' '."\n"; -if ($conf->use_javascript_ajax) -{ - print ajax_constantonoff('AGENDA_USE_EVENT_TYPE'); -} -else -{ - if($conf->global->AGENDA_USE_EVENT_TYPE == 0) - { - print ''.img_picto($langs->trans("Disabled"),'off').''; - } - else if($conf->global->BUSINESS_VISIBLE_TO_ALL_BY_DEFAULT == 1) - { - print ''.img_picto($langs->trans("Enabled"),'on').''; - } -} -print '
'; +dol_fiche_end(); print "
"; diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php new file mode 100644 index 00000000000..cffbed706ce --- /dev/null +++ b/htdocs/admin/agenda_other.php @@ -0,0 +1,135 @@ + + * Copyright (C) 2011 Regis Houssin + * Copyright (C) 2011-2012 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 + * 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/admin/agenda.php + * \ingroup agenda + * \brief Autocreate actions for agenda module setup page + */ + +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; + +if (!$user->admin) + accessforbidden(); + +$langs->load("admin"); +$langs->load("other"); + +$action = GETPOST('action','alpha'); +$cancel = GETPOST('cancel','alpha'); + + +/* + * Actions + */ + +if (preg_match('/set_(.*)/',$action,$reg)) +{ + $code=$reg[1]; + $value=(GETPOST($code) ? GETPOST($code) : 1); + if (dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity) > 0) + { + Header("Location: ".$_SERVER["PHP_SELF"]); + exit; + } + else + { + dol_print_error($db); + } +} + +if (preg_match('/del_(.*)/',$action,$reg)) +{ + $code=$reg[1]; + if (dolibarr_del_const($db, $code, $conf->entity) > 0) + { + Header("Location: ".$_SERVER["PHP_SELF"]); + exit; + } + else + { + dol_print_error($db); + } +} + + +/** + * View + */ + +llxHeader(); + +$linkback=''.$langs->trans("BackToModuleList").''; +print_fiche_titre($langs->trans("AgendaSetup"),$linkback,'setup'); +print "
\n"; + + +$head=agenda_prepare_head(); + +dol_fiche_head($head, 'other', $langs->trans("Agenda")); + +print_titre($langs->trans("OtherOptions")); + +$var=true; + +print ''."\n"; +print ''."\n"; +print ''."\n"; +print ''."\n"; +print ''."\n"; +print ''."\n"; + +// Manual or automatic +$var=!$var; +print ''."\n"; +print ''."\n"; +print ''."\n"; + +print ''."\n"; + +print '
'.$langs->trans("Parameters").' '.$langs->trans("Value").'
'.$langs->trans("AGENDA_USE_EVENT_TYPE").' '."\n"; +if ($conf->use_javascript_ajax) +{ + print ajax_constantonoff('AGENDA_USE_EVENT_TYPE'); +} +else +{ + if($conf->global->AGENDA_USE_EVENT_TYPE == 0) + { + print ''.img_picto($langs->trans("Disabled"),'off').''; + } + else if($conf->global->BUSINESS_VISIBLE_TO_ALL_BY_DEFAULT == 1) + { + print ''.img_picto($langs->trans("Enabled"),'on').''; + } +} +print '
'; + +dol_fiche_end(); + +print "
"; + +dol_htmloutput_mesg($mesg); + +llxFooter(); + +$db->close(); +?> diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 9b7f37b6fee..a11fdac4dda 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -384,6 +384,11 @@ function agenda_prepare_head() $head[$h][2] = 'extsites'; $h++; + $head[$h][0] = DOL_URL_ROOT."/admin/agenda_other.php"; + $head[$h][1] = $langs->trans("Other"); + $head[$h][2] = 'other'; + $h++; + complete_head_from_modules($conf,$langs,$object,$head,$h,'agenda_admin'); $head[$h][0] = DOL_URL_ROOT."/admin/agenda_extrafields.php"; From 642ba10d84f038aca41bfdfc9b4f26d25292a587 Mon Sep 17 00:00:00 2001 From: JF FERRY Date: Sun, 21 Apr 2013 17:04:54 +0200 Subject: [PATCH 26/44] New hidden option to introduce timing value into odt document nam --- .../core/modules/societe/doc/doc_generic_odt.modules.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php index 22835fec8e8..e748e45a498 100644 --- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php +++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php @@ -215,7 +215,14 @@ class doc_generic_odt extends ModeleThirdPartyDoc $newfiletmp=preg_replace('/modele_/i','',$newfiletmp); // Get extension (ods or odt) $newfileformat=substr($newfile, strrpos($newfile, '.')+1); - $filename=$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.'.$newfileformat; + if ( ! empty($conf->global->MAIN_ODT_USE_TIMING)) + { + $filename=$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.'.$newfileformat; + } + else + { + $filename=$newfiletmp.'.'.$newfileformat; + } $file=$dir.'/'.$filename; $object->builddoc_filename=$filename; // For triggers //print "newfileformat=".$newfileformat; From 8cb7770a6a3ef3b19c6e1158ca95baaba2747015 Mon Sep 17 00:00:00 2001 From: JF FERRY Date: Sun, 21 Apr 2013 17:06:25 +0200 Subject: [PATCH 27/44] Add ODS document for example --- .../thirdparties/template_thirdparty.ods | Bin 0 -> 14558 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 htdocs/install/doctemplates/thirdparties/template_thirdparty.ods diff --git a/htdocs/install/doctemplates/thirdparties/template_thirdparty.ods b/htdocs/install/doctemplates/thirdparties/template_thirdparty.ods new file mode 100644 index 0000000000000000000000000000000000000000..ad50961b562d95810ea98e692c74827e9ece247d GIT binary patch literal 14558 zcmeHuWmr|)7AQ(fgLHRyNSAbXH*8?jus0wr9ZE?fA>Ab0%9&E=K!2$&Z^>9I|pzMM60I-J> zz|_gf4rp!)20A*hx;a>|IGTchAQnd_fP;mjxvM?E0n7q&asilHfUE%ku*yGZTAYr- z_z*!sJzRJYni|%w_GS*IKsyjC_~$K)lY>>bijp+S6M`oY5ENM%2{p+79w?|sPzaA9 zcOGZuxlm9<60#Cv8ZXlJ(mg~q#!0#lN(Z2z5fHN9y?Yt(F$RguhCnwFn7F29vUJ>1 zxeG`Uvd8MrQ&4?a;Kj_o-a9e&~<3QkS zd9=})85FK2uAR7{`_f)0slMO*+Lqx)n~y(;&cWd3a`@n;Wp$w&Iv_&bFsVzsOz}-i z+}ZQ5B7qBQDCK3o+uu{L_l-paOozi=l6nbQeK^6+JvJ5ZMvy+C8Tg%lE0Oijq>cPy z&`NimFpm^kiFmk_3^iYkuOI52BgEh>$ZC8P^R@8s6{~i+_eD5LiZCmwNSkZ10M__; zwuIY(+2zNr=A!{*`jR4z^}V56PUSTL8P%CZo(}0m?R89o5o6Euqj58buP?F;_t#$2 zWES>hm5%5)lwFsEUKaJ25bWgc=j1$2*VIgDv*LOYg~R`JU4AOnCqxoy@0H^mCLsZl zN%vQ`^2EfszVUs|i2@2m&{%Szs2Hfqc}1cp=wo8(0*E(DRqQqdwRA3(Rg$2z%T|{D zbNBgb#Z?ue?$r_Z`NGYi@pVCKMm|FNZF_Mut$PEBJ}Li>iV>(%u08$zmhtsQdCSQV zF-sKDVEeMM(kfS5d15VscG-ZB+wIz^u@bJM0^>$TQF`6f+pAUp8_H0|{e}Fz>J}~{ z1=rk%!(vrqhn8;==$!vARSwdt$b&4X>@nS>u!AJ*r{k^1uq4!Jr2#q+9n6QfT}=W3tNRAV+iP{ z9dq~;isG`!3vY7=C@dsSw!;Z*H{rxNd=4K(wb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q)~Fnhs7?_BfOi6`S9Emq-x|QB;P_-*@j>(LpV#SZqTbDdsc2U z2j#sFzk4@5ni5P0lU9LzdM9DCYB?qXLdhd_r{5eO9A9QmkUmR%5`|;oJn{u!>M-)^ zP_f?l!5i-SK1W!OprDo@y_JgmqsLF7{{2kS510M*^Yet#e`5XTsiVITpfn)2|8@rH zCzYQ*{rg(s!-s%h1)lhyp9TIC^Y632hqc6C<&NwhD~tb$`1daTVRHDZSVDsQ*HrN* z-oJJDzwr8)AqTl2Jic&(56SOW8TuWaf26{Hr}U7XeicNH|2ERE)cEgI{;8M9zfk#^ zD*v6%Kc#X14V_=9^A9RNBl|&zpZV`0dHyP8zoGIksq}wE(?3;&;rwqy{XLQXQ@FpU jgNIc5s|Z5q{5G+w$iqU$!B9}>kUt(6D5y7F4^RIGT@Nx0 literal 0 HcmV?d00001 From 5893fadb585373bdbe2adc419abe52c99e1d0081 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 21 Apr 2013 17:56:29 +0200 Subject: [PATCH 28/44] Look: Minor style enhancement --- htdocs/comm/action/fiche.php | 16 +- htdocs/core/lib/functions.lib.php | 23 +- htdocs/fourn/fiche.php | 20 +- htdocs/holiday/index.php | 13 +- htdocs/langs/en_US/agenda.lang | 2 +- htdocs/langs/fr_FR/agenda.lang | 2 +- htdocs/langs/fr_FR/main.lang | 4 +- htdocs/theme/amarok/graph-color.php | 10 +- htdocs/theme/amarok/style.css.php | 360 +++++++++++++++------------- htdocs/theme/eldy/style.css.php | 24 +- 10 files changed, 264 insertions(+), 210 deletions(-) diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index b6357880dad..4b4917715b5 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005 Simon TOSSER * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010 Juanjo Menent @@ -663,7 +663,6 @@ if ($id > 0) */ $head=actions_prepare_head($act); - dol_fiche_head($head, 'card', $langs->trans("Action"),0,'action'); $now=dol_now(); $delay_warning=$conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60; @@ -711,6 +710,8 @@ if ($id > 0) print ''; if ($backtopage) print ''; + dol_fiche_head($head, 'card', $langs->trans("Action"),0,'action'); + print ''; // Ref @@ -836,7 +837,9 @@ if ($id > 0) print '
'; - print '

'; + dol_fiche_end(); + + print '
'; print '     '; print '
'; @@ -844,6 +847,8 @@ if ($id > 0) } else { + dol_fiche_head($head, 'card', $langs->trans("Action"),0,'action'); + // Affichage fiche action en mode visu print ''; @@ -1021,14 +1026,13 @@ if ($id > 0) } print '


'; } - } - print "\n"; + dol_fiche_end(); + } /* * Barre d'actions - * */ print '
'; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 45683412037..b2c2998a462 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -814,13 +814,14 @@ function dol_print_date($time,$format='',$tzoutput='tzserver',$outputlangs='',$e } if (! is_object($outputlangs)) $outputlangs=$langs; if (! $format) $format='daytextshort'; - + $reduceformat=(! empty($conf->dol_optimize_smallscreen) && in_array($format,array('day','hour')))?1:0; + // Change predefined format into computer format. If found translation in lang file we use it, otherwise we use default. - if ($format == 'day') $format=($outputlangs->trans("FormatDateShort")!="FormatDateShort"?$outputlangs->trans("FormatDateShort"):$conf->format_date_short); - else if ($format == 'hour') $format=($outputlangs->trans("FormatHourShort")!="FormatHourShort"?$outputlangs->trans("FormatHourShort"):$conf->format_hour_short); - else if ($format == 'hourduration') $format=($outputlangs->trans("FormatHourShortDuration")!="FormatHourShortDuration"?$outputlangs->trans("FormatHourShortDuration"):$conf->format_hour_short_duration); + if ($format == 'day') $format=($outputlangs->trans("FormatDateShort")!="FormatDateShort"?$outputlangs->trans("FormatDateShort"):$conf->format_date_short); + else if ($format == 'hour') $format=($outputlangs->trans("FormatHourShort")!="FormatHourShort"?$outputlangs->trans("FormatHourShort"):$conf->format_hour_short); + else if ($format == 'hourduration') $format=($outputlangs->trans("FormatHourShortDuration")!="FormatHourShortDuration"?$outputlangs->trans("FormatHourShortDuration"):$conf->format_hour_short_duration); else if ($format == 'daytext') $format=($outputlangs->trans("FormatDateText")!="FormatDateText"?$outputlangs->trans("FormatDateText"):$conf->format_date_text); - else if ($format == 'daytextshort') $format=($outputlangs->trans("FormatDateTextShort")!="FormatDateTextShort"?$outputlangs->trans("FormatDateTextShort"):$conf->format_date_text_short); + else if ($format == 'daytextshort') $format=($outputlangs->trans("FormatDateTextShort")!="FormatDateTextShort"?$outputlangs->trans("FormatDateTextShort"):$conf->format_date_text_short); else if ($format == 'dayhour') $format=($outputlangs->trans("FormatDateHourShort")!="FormatDateHourShort"?$outputlangs->trans("FormatDateHourShort"):$conf->format_date_hour_short); else if ($format == 'dayhoursec') $format=($outputlangs->trans("FormatDateHourSecShort")!="FormatDateHourSecShort"?$outputlangs->trans("FormatDateHourSecShort"):$conf->format_date_hour_sec_short); else if ($format == 'dayhourtext') $format=($outputlangs->trans("FormatDateHourText")!="FormatDateHourText"?$outputlangs->trans("FormatDateHourText"):$conf->format_date_hour_text); @@ -828,12 +829,18 @@ function dol_print_date($time,$format='',$tzoutput='tzserver',$outputlangs='',$e // Format not sensitive to language else if ($format == 'dayhourlog') $format='%Y%m%d%H%M%S'; else if ($format == 'dayhourldap') $format='%Y%m%d%H%M%SZ'; - else if ($format == 'dayhourxcard') $format='%Y%m%dT%H%M%SZ'; - else if ($format == 'dayxcard') $format='%Y%m%d'; + else if ($format == 'dayhourxcard') $format='%Y%m%dT%H%M%SZ'; + else if ($format == 'dayxcard') $format='%Y%m%d'; else if ($format == 'dayrfc') $format='%Y-%m-%d'; // DATE_RFC3339 else if ($format == 'dayhourrfc') $format='%Y-%m-%dT%H:%M:%SZ'; // DATETIME RFC3339 - else if ($format == 'standard') $format='%Y-%m-%d %H:%M:%S'; + else if ($format == 'standard') $format='%Y-%m-%d %H:%M:%S'; + if ($reduceformat) + { + $format=str_replace('%Y','%y',$format); + $format=str_replace('yyyy','yy',$format); + } + // If date undefined or "", we return "" if (dol_strlen($time) == 0) return ''; // $time=0 allowed (it means 01/01/1970 00:00:00) diff --git a/htdocs/fourn/fiche.php b/htdocs/fourn/fiche.php index 2d9a7a151b3..13ef8ea8523 100644 --- a/htdocs/fourn/fiche.php +++ b/htdocs/fourn/fiche.php @@ -85,8 +85,9 @@ if ($object->fetch($id)) dol_fiche_head($head, 'supplier', $langs->trans("ThirdParty"),0,'company'); - print ''; - print ''; + //print '
'; + print '
'; + //print ''; + //print ''; - print '
'; print ''; print '
'.$langs->trans("ThirdPartyName").''; @@ -216,7 +217,11 @@ if ($object->fetch($id)) print '
'; - print '
'; + + print '
'; + //print '
'; + + $var=true; $MAXLIST=5; @@ -367,9 +372,12 @@ if ($object->fetch($id)) } } - print '
' . "\n"; - print '
'; + print '
'; + print '
'; + //print '
' . "\n"; + + dol_fiche_end(); /* diff --git a/htdocs/holiday/index.php b/htdocs/holiday/index.php index c269a148615..06c75411453 100644 --- a/htdocs/holiday/index.php +++ b/htdocs/holiday/index.php @@ -1,6 +1,6 @@ - * Copyright (C) 2012 Laurent Destailleur + * Copyright (C) 2013 Laurent Destailleur * Copyright (C) 2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -228,7 +228,6 @@ if ($id > 0) print "

'; - } else { @@ -242,7 +241,15 @@ $nbaquis=$holiday->getCPforUser($user_id); $nbdeduced=$holiday->getConfCP('nbHolidayDeducted'); $nb_holiday = $nbaquis / $nbdeduced; print $langs->trans('SoldeCPUser',round($nb_holiday,2)).($nbdeduced != 1 ? ' ('.$nbaquis.' / '.$nbdeduced.')' : ''); -print '
'; + +if ($id > 0) +{ + dol_fiche_end(); + print '
'; +} +else { + print '
'; +} print '
'."\n"; print ''; diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang index 3d0aadefec2..33d52b04c94 100644 --- a/htdocs/langs/en_US/agenda.lang +++ b/htdocs/langs/en_US/agenda.lang @@ -32,7 +32,7 @@ ViewCal=Month view ViewDay=Day view ViewWeek=Week view ViewWithPredefinedFilters= View with predefined filters -AutoActions= Automatic filling of agenda +AutoActions= Automatic filling AgendaAutoActionDesc= Define here events for which you want Dolibarr to create automatically an event in agenda. If nothing is checked (by default), only manual actions will be included in agenda. AgendaSetupOtherDesc= This page provides options to allow export of your Dolibarr events into an external calendar (thunderbird, google calendar, ...) AgendaExtSitesDesc=This page allows to declare external sources of calendars to see their events into Dolibarr agenda. diff --git a/htdocs/langs/fr_FR/agenda.lang b/htdocs/langs/fr_FR/agenda.lang index 6c41e3e95c2..62b09ec39d1 100644 --- a/htdocs/langs/fr_FR/agenda.lang +++ b/htdocs/langs/fr_FR/agenda.lang @@ -32,7 +32,7 @@ ViewCal=Vue mois ViewDay=Vue jour ViewWeek=Vue semaine ViewWithPredefinedFilters=Vues avec filtres prédéfinis -AutoActions=Alimentation automatique de l'agenda +AutoActions=Alimentation automatique AgendaAutoActionDesc=Définissez dans cet onglet les événements pour lesquels dolibarr créera automatiquement une action dans l'agenda. Si aucune case n'est cochée (par défaut), seules les actions manuelles seront incluses dans l'agenda. AgendaSetupOtherDesc=Cette page permet de configurer quelques options permettant d'exporter une vue de votre agenda Dolibarr vers un calendrier externe (thunderbird, google calendar, ...) AgendaExtSitesDesc=Cette page permet d'ajouter des sources de calendriers externes pour les visualiser au sein de l'agenda Dolibarr. diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index 1173c74e14f..bad84a57548 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -3,9 +3,9 @@ CHARSET=UTF-8 DIRECTION=ltr SeparatorDecimal=, SeparatorThousand= -FormatDateShort=%d/%m/%y +FormatDateShort=%d/%m/%Y FormatDateShortInput=%d/%m/%Y -FormatDateShortJava=dd/MM/yy +FormatDateShortJava=dd/MM/yyyy FormatDateShortJavaInput=dd/MM/yyyy FormatDateShortJQuery=dd/mm/yy FormatDateShortJQueryInput=dd/mm/yy diff --git a/htdocs/theme/amarok/graph-color.php b/htdocs/theme/amarok/graph-color.php index 96e9894c7fa..1a0d2253a2a 100755 --- a/htdocs/theme/amarok/graph-color.php +++ b/htdocs/theme/amarok/graph-color.php @@ -22,10 +22,10 @@ * \ingroup core */ -global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet; -$theme_bordercolor = array(235,235,224); -$theme_datacolor = array(array(125,135,150), array(200,160,180), array(190,190,220), array(170,140,190), array(190,190,170)); -$theme_bgcolor = array(hexdec('F4'),hexdec('F4'),hexdec('F4')); -$theme_bgcoloronglet = array(hexdec('DE'),hexdec('E7'),hexdec('EC')); +global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet; +$theme_bordercolor = array(235,235,224); +$theme_datacolor = array(array(190,190,220), array(200,160,180), array(125,135,150), array(170,140,190), array(190,190,170)); +$theme_bgcolor = array(hexdec('F4'),hexdec('F4'),hexdec('F4')); +$theme_bgcoloronglet = array(hexdec('DE'),hexdec('E7'),hexdec('EC')); ?> diff --git a/htdocs/theme/amarok/style.css.php b/htdocs/theme/amarok/style.css.php index 6bf44532621..c5e92cdcb1b 100755 --- a/htdocs/theme/amarok/style.css.php +++ b/htdocs/theme/amarok/style.css.php @@ -21,25 +21,28 @@ /** * \file htdocs/theme/amarok/style.css.php - * \brief Fichier de style CSS du theme amarok + * \brief File for CSS style sheet Amarok */ -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled because need to load personalized language //if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled to increase speed. Language code is found on url. if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled cause need to do translations +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled because need to do translations if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK',1); if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1); -if (! defined('NOLOGIN')) define('NOLOGIN',1); +if (! defined('NOLOGIN')) define('NOLOGIN',1); // File must be accessed by logon page so without login if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1); if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); session_cache_limiter(FALSE); -require_once("../../main.inc.php"); +require_once '../../main.inc.php'; + +// Load user to have $user->conf loaded (not done into main because of NOLOGIN constant defined) +if (empty($user->id) && ! empty($_SESSION['dol_login'])) $user->fetch('',$_SESSION['dol_login']); // Define css type header('Content-type: text/css'); @@ -69,12 +72,55 @@ $fontlist='helvetica,arial,tahoma,verdana'; //$fontlist='Verdana,Helvetica,Ar $img_liste_titre=dol_buildpath($path.'/theme/'.$theme.'/img/menus/trtitle.png',1); $img_head=dol_buildpath($path.'/theme/'.$theme.'/img/headbg2.jpg',1); $img_button=dol_buildpath($path.'/theme/'.$theme.'/img/button_bg.png',1); +$dol_hide_topmenu=$conf->dol_hide_topmenu; +$dol_hide_leftmenu=$conf->dol_hide_leftmenu; +$dol_optimize_smallscreen=$conf->dol_optimize_smallscreen; +$dol_no_mouse_hover=$conf->dol_no_mouse_hover; +$dol_use_jmobile=$conf->dol_use_jmobile; + + +// Define reference colors +// Example: Light grey: $colred=235;$colgreen=235;$colblue=235; +// Example: Pink: $colred=230;$colgreen=210;$colblue=230; +// Example: Green: $colred=210;$colgreen=230;$colblue=210; +// Example: Ocean: $colred=220;$colgreen=220;$colblue=240; +//$conf->global->THEME_ELDY_ENABLE_PERSONALIZED=0; +//$user->conf->THEME_ELDY_ENABLE_PERSONALIZED=0; +//var_dump($user->conf->THEME_ELDY_RGB); +$colred =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_RGB)?235:hexdec(substr($conf->global->THEME_ELDY_RGB,0,2))):(empty($user->conf->THEME_ELDY_RGB)?235:hexdec(substr($user->conf->THEME_ELDY_RGB,0,2))); +$colgreen=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_RGB)?235:hexdec(substr($conf->global->THEME_ELDY_RGB,2,2))):(empty($user->conf->THEME_ELDY_RGB)?235:hexdec(substr($user->conf->THEME_ELDY_RGB,2,2))); +$colblue =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_RGB)?235:hexdec(substr($conf->global->THEME_ELDY_RGB,4,2))):(empty($user->conf->THEME_ELDY_RGB)?235:hexdec(substr($user->conf->THEME_ELDY_RGB,4,2))); + +// Colors +$isred=max(0,(2*$colred-$colgreen-$colblue)/2); // 0 - 255 +$isgreen=max(0,(2*$colgreen-$colred-$colblue)/2); // 0 - 255 +$isblue=max(0,(2*$colblue-$colred-$colgreen)/2); // 0 - 255 +$colorback1=($colred-3).','.($colgreen-3).','.($colblue-3); // topmenu +$colorback2=($colred+5).','.($colgreen+5).','.($colblue+5); +$colorbacktab1=($colred+15).','.($colgreen+16).','.($colblue+17); // vmenu +$colorbacktab1b=($colred+5).','.($colgreen+6).','.($colblue+7); // vmenu (not menu) +$colorbacktab2=($colred-15).','.($colgreen-15).','.($colblue-15); +$colorbacktitle1=($colred-5).','.($colgreen-5).','.($colblue-5); // title of array +$colorbacktitle2=($colred-15).','.($colgreen-15).','.($colblue-15); +$colorbacktabcard1=($colred+15).','.($colgreen+16).','.($colblue+17); // card +$colorbacktabcard2=($colred-15).','.($colgreen-15).','.($colblue-15); +$colorbacktabactive=($colred-15).','.($colgreen-15).','.($colblue-15); +$colorbacklineimpair1=(244+round($isred/3)).','.(244+round($isgreen/3)).','.(244+round($isblue/3)); // line impair +$colorbacklineimpair2=(250+round($isred/3)).','.(250+round($isgreen/3)).','.(250+round($isblue/3)); // line impair +$colorbacklineimpairhover=(230+round(($isred+$isgreen+$isblue)/9)).','.(230+round(($isred+$isgreen+$isblue)/9)).','.(230+round(($isred+$isgreen+$isblue)/9)); // line impair +$colorbacklinepair1='255,255,255'; // line pair +$colorbacklinepair2='255,255,255'; // line pair +$colorbacklinepairhover=(230+round(($isred+$isgreen+$isblue)/9)).','.(230+round(($isred+$isgreen+$isblue)/9)).','.(230+round(($isred+$isgreen+$isblue)/9)); +$colorbackbody='#f5f5f5'; +$colortext='40,40,40'; +$fontsize=empty($conf->dol_optimize_smallscreen)?'12':'14'; +$fontsizesmaller=empty($conf->dol_optimize_smallscreen)?'11':'14'; ?> /* ============================================================================== */ -/* Styles par défaut */ +/* Default styles */ /* ============================================================================== */ *, html { @@ -84,31 +130,17 @@ font-size:100%; } body { - background-color:#f5f5f5; - - - background-image:url(); - background-repeat:repeat-y; - margin:0px; - - - background-image:url(); - margin:100px; - +dol_optimize_smallscreen)) { ?> + background-color: #FFFFFF; + + background-color: ; + color:#232323; font-size:px; font-family:; - trans("DIRECTION").";\n"; ?> } -.checkVatPopup { - background-color:#f5f5f5; - background-image:none; - margin:10px; - line-height:16px; -} - a { font-family:; font-weight:bold; @@ -194,6 +226,15 @@ div.inline-block display:inline-block; } +th .button { + -moz-box-shadow: none !important; + -webkit-box-shadow: none !important; + box-shadow: none !important; + -moz-border-radius:0px !important; + -webkit-border-radius:0px !important; + border-radius:0px !important; +} + .valignmiddle { vertical-align: middle; } @@ -211,11 +252,102 @@ div.inline-block } +.blockvmenubookmarks .menu_contenu { + background-color: transparent; +} + +/* ! Message d'erreur lors du login : */ +center .error { padding:8px !important; padding-left:26px !important; padding-right:20px; width:inherit; max-width:450px;color:#552323 !important; font-size:14px; border-radius:8px; text-align: left;} + + + /* ============================================================================== */ -/* Login */ +/* Styles to hide objects */ /* ============================================================================== */ -body.body center{color:white;} +.hideobject { display:none; } + +.hideonsmartphone { display: none; } +.noenlargeonsmartphone { width : 50px !important; display: inline !important; } + +.linkobject { cursor:pointer; } + + +/* ============================================================================== */ +/* Styles for dragging lines */ +/* ============================================================================== */ + +.dragClass { + color: #333333; +} +td.showDragHandle { + cursor: move; +} +.tdlineupdown { + white-space: nowrap; +} + +/* ============================================================================== */ +/* Menu top et 1ere ligne tableau */ +/* ============================================================================== */ + +div.tmenu { + + display:none; + + position:relative; + display:block; + margin:0; + padding:0; + padding-left:1em; + top:0; + left:0; + right:0; + white-space:nowrap; + height:36px; + browser->name != 'ie') echo "line-height:36px; /* disabled for ie9 */ \n"; ?> + background:#333333; + background-image:linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); + background-image:-o-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); + background-image:-moz-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); + background-image:-webkit-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); + background-image:-ms-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); + background-image:-webkit-gradient( + linear, + left top, + left bottom, + color-stop(0, rgba(255,255,255,.3)), + color-stop(1, rgba(0,0,0,.3)) + ); + border-bottom:solid 1px rgba(0,0,0,.8); + box-shadow:0 0 6px rgba(0,0,0,.4) !important; + z-index:100; + +} + +div.tmenu a { + font-weight:normal; +} + +div.tmenu li { + display:inline-table; + margin-right:1em; + text-transform:uppercase; +} + +div.tmenu li a {color:#cccccc;} +div.tmenu li a:hover { color:rgba(255,255,255,1);} + +div.tmenu ul li a.tmenusel {/* texte du menu principal sélectionné */ + color:#ffffff; + font-weight:bold; +} + +.tmenudisabled { color:#808080 !important; cursor: not-allowed; } + + + +/* Login */ form#login { display:block; @@ -329,96 +461,6 @@ table.login_table .vmenu { font-size:120%; } -.blockvmenubookmarks .menu_contenu { - background-color: transparent; -} - -/* ! Message d'erreur lors du login : */ -center .error { padding:8px !important; padding-left:26px !important; padding-right:20px; width:inherit; max-width:450px;color:#552323 !important; font-size:14px; border-radius:8px; text-align: left;} - - - -/* ============================================================================== */ -/* Styles to hide objects */ -/* ============================================================================== */ - -.hideobject { display:none; } - -.hideonsmartphone { display: none; } -.noenlargeonsmartphone { width : 50px !important; display: inline !important; } - -.linkobject { cursor:pointer; } - - -/* For dragging lines */ - -.dragClass {color:#333333;} -td.showDragHandle {cursor:move;} -.tdlineupdown {white-space:nowrap;} - - -/* ============================================================================== */ -/* Menu top et 1ère ligne tableau */ -/* ============================================================================== */ - -div.tmenu { - - display:none; - - position:relative; - display:block; - margin:0; - padding:0; - padding-left:1em; - top:0; - left:0; - right:0; - white-space:nowrap; - height:36px; - browser->name != 'ie') echo "line-height:36px; /* disabled for ie9 */ \n"; ?> - background:#333333; - background-image:linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); - background-image:-o-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); - background-image:-moz-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); - background-image:-webkit-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); - background-image:-ms-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); - background-image:-webkit-gradient( - linear, - left top, - left bottom, - color-stop(0, rgba(255,255,255,.3)), - color-stop(1, rgba(0,0,0,.3)) - ); - border-bottom:solid 1px rgba(0,0,0,.8); - box-shadow:0 0 6px rgba(0,0,0,.4) !important; - z-index:100; - -} - -div.tmenu a { - font-weight:normal; -} - -div.tmenu li { - display:inline-table; - margin-right:1em; - text-transform:uppercase; -} - -div.tmenu li a {color:#cccccc;} -div.tmenu li a:hover {color:rgba(255,255,255,.2);} - -div.tmenu ul li a.tmenusel {/* texte du menu principal sélectionné */ - color:#ffffff; - font-weight:bold; -} - -.tmenudisabled { color:#808080 !important; cursor: not-allowed; } - -/* --- end nav --- */ - -/* Login */ - div.login_block { position:absolute; top:5px; @@ -438,16 +480,16 @@ div.login_block table { div.login { white-space:nowrap; - padding:8px 0px 0px 0px; + padding: dol_optimize_smallscreen?'0':'8')?>px 0px 0px 0px; margin:0px 0px 0px 8px; font-weight:bold; } img.login, img.printer, img.entity { - padding:8px 0px 0px 0px; + padding: dol_optimize_smallscreen?'0':'8')?>px 0px 0px 0px; margin:0px 0px 0px 8px; text-decoration:none; - color:#ffffff; + color: white; font-weight:bold; } @@ -461,6 +503,9 @@ div.vmenu { display:none; width:170px; + -moz-box-shadow: 4px 4px 4px #CCC; + -webkit-box-shadow: 4px 4px 4px #CCC; + box-shadow: 4px 4px 4px #CCC; } @@ -773,8 +818,11 @@ div.tabs { div.tabBar { background-color:#ffffff; padding:6px; - margin:3px 0px 5px; + margin:3px 0px 14px 0px; border:1px solid #bbbbbb; + -moz-box-shadow: 4px 4px 4px #DDD; + -webkit-box-shadow: 4px 4px 4px #DDD; + box-shadow: 4px 4px 4px #DDD; } div.tabBar table.notopnoleftnoright { @@ -1066,7 +1114,7 @@ table.liste { table.liste td {padding:1px 2px 1px 0px;} -tr.liste_titre, tr.box_titre { +div.liste_titre, tr.liste_titre, tr.box_titre { padding:4px; background-color:rgba(0,0,0,.2); background-image:linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); @@ -1116,13 +1164,13 @@ tr.impair td, tr.pair td {padding:1px 1px 1px 2px;} tr.impair table.nobordernopadding td, tr.pair table.nobordernopadding td {padding:1px 0px;} .impair { - background:#f4f4f4; + background:#fdfdfd; font-family:; border:0px; } .pair { - background:#eaeaea; + background:#f4f4f4; font-family:; border:0px; } @@ -1147,12 +1195,12 @@ tr.impair table.nobordernopadding td, tr.pair table.nobordernopadding td {paddin } tr.box_impair { - background:#f4f4f4; + background:#fdfdfd; font-family:; } tr.box_pair { - background:#eaeaea; + background:#f4f4f4; font-family:; } @@ -1423,7 +1471,7 @@ td.dpHead { /* Jour courant */ .dpSelected { - background-color:#a61111; + background-color:#0B63A2; color:#ffffff; font-weight:bold; } @@ -1468,7 +1516,7 @@ td.dpHead { padding:0px 2px; font-size:9px; border-width:0px; - color:#a61111; + color:#0B63A2; vertical-align:middle; cursor:pointer; } @@ -1499,17 +1547,9 @@ table.cal_month { border-spacing: 0px; } .cal_current_month_right { border-right: solid 1px #E0E0E0; } .cal_other_month_right { border-right: solid 1px #C0C0C0; } -.cal_other_month { - background:#dddddd; -} - -.cal_past_month { - background:#eeeeee; -} - -.cal_current_month { - background:#ffffff; -} +.cal_other_month { opacity: 0.6; background: #EAEAEA; padding-: 2px; padding-: 1px; padding-top: 0px; padding-bottom: 0px; } +.cal_past_month { opacity: 0.6; background: #EEEEEE; padding-: 2px; padding-: 1px; padding-top: 0px; padding-bottom: 0px; } +.cal_current_month { background: #FFFFFF; border-left: solid 1px #E0E0E0; padding-: 2px; padding-: 1px; padding-top: 0px; padding-bottom: 0px; } .cal_today { background:#ffffff; @@ -1518,37 +1558,19 @@ table.cal_month { border-spacing: 0px; } div.dayevent table.nobordernopadding tr td {padding:1px;} -table.cal_event { - border-collapse:collapse; - margin-bottom:1px; -} - -ul.cal_event { padding-right: 2px; padding-top: 1px; border: none; list-style-type: none; margin: 0 auto; padding-left: 0px; padding-start: 0px; -khtml-padding-start: 0px; -o-padding-start: 0px; -webkit-padding-start: 0px; -webkit-padding-start: 0px; } +table.cal_event { border: none; border-collapse: collapse; margin-bottom: 1px; -webkit-border-radius: 6px; border-radius: 6px; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.25); + moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.25); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.25); + background: -webkit-gradient(linear, left top, left bottom, from(#006aac), to(#00438d)); + } +table.cal_event td { border: none; padding-: 2px; padding-: 2px; padding-top: 0px; padding-bottom: 0px; } +ul.cal_event { padding-right: 2px; padding-top: 1px; border: none; list-style-type: none; margin: 0 auto; padding-left: 0px; padding-start: 0px; -khtml-padding-start: 0px; -o-padding-start: 0px; -moz-padding-start: 0px; -webkit-padding-start: 0px; } li.cal_event { border: none; list-style-type: none; } - -.cal_event a:link { - color:#232323; - font-size:11px; - font-weight:normal !important; -} - -.cal_event a:visited { - color:#232323; - font-size:11px; - font-weight:normal !important; -} - -.cal_event a:active { - color:#232323; - font-size:11px; - font-weight:normal !important; -} - -.cal_event a:hover { - color:rgba(255,255,255,.75); - font-size:11px; - font-weight:normal !important; -} +.cal_event a:link { color: #111111; font-size: 11px; font-weight: normal !important; } +.cal_event a:visited { color: #111111; font-size: 11px; font-weight: normal !important; } +.cal_event a:active { color: #111111; font-size: 11px; font-weight: normal !important; } +.cal_event a:hover { color: #111111; font-size: 11px; font-weight: normal !important; color:rgba(255,255,255,.75); } /* ============================================================================== */ diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 47e27f3f968..43af5fc2482 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -58,6 +58,8 @@ if (GETPOST('theme')) $conf->theme=GETPOST('theme'); // If theme was forced on $langs->load("main",0,1); $right=($langs->trans("DIRECTION")=='rtl'?'left':'right'); $left=($langs->trans("DIRECTION")=='rtl'?'right':'left'); +$fontsize=empty($conf->dol_optimize_smallscreen)?'12':'12'; +$fontsizesmaller=empty($conf->dol_optimize_smallscreen)?'11':'11'; $path=''; // This value may be used in future for external module to overwrite theme $theme='eldy'; // Value of theme @@ -198,7 +200,7 @@ if (! empty($conf->dol_optimize_smallscreen)) $fontsize=11; ?> /* ============================================================================== */ -/* Styles par defaut */ +/* Default styles */ /* ============================================================================== */ body { @@ -304,8 +306,8 @@ input[type=image] { background-color: transparent; border: none; box-shadow: non box-shadow: 4px 4px 4px #CCC; } form { - padding: 0em 0em 0em 0em; - margin: 0em 0em 0em 0em; + padding:0px; + margin:0px; } div.float { @@ -852,9 +854,9 @@ td.vmenu { .vmenu { margin-left: 4px; - + display: none; - + } .menu_contenu { padding-top: 1px; } @@ -1317,11 +1319,14 @@ div.tabsAction { a.tabTitle { - background: #657090; - color: white; +/* background: #657090; + color: white;*/ + color:rgba(0,0,0,.5); + margin-right:10px; + text-shadow:1px 1px 1px #ffffff; font-family: ; font-weight: normal; - padding: 0px 6px 2px 6px; + padding: 5px 6px 2px 6px; margin: 0px 6px; text-decoration: none; white-space: nowrap; @@ -1329,7 +1334,7 @@ a.tabTitle { a.tab:link, a.tab:visited, a.tab:hover, a.tab#active { font-family: ; - padding: 2px 6px 2px 6px; + padding: 5px 6px 2px 6px; margin: 0em 0.2em; text-decoration: none; white-space: nowrap; @@ -1364,6 +1369,7 @@ a.tab#active { a.tab:link, a.tab:visited, a.tab:hover, a.tab#active { color: #; + font-weight: normal !important; } a.tabimage { From 1f0adfaff57b7fd578567160a7f20fd27364b501 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 21 Apr 2013 23:44:33 +0200 Subject: [PATCH 29/44] Can remove an element from category when on category view. --- htdocs/adherents/class/adherent.class.php | 7 +- htdocs/categories/categorie.php | 7 +- htdocs/categories/class/categorie.class.php | 1 + htdocs/categories/viewcat.php | 121 +++++++++++++++++--- htdocs/product/class/product.class.php | 4 + htdocs/societe/class/societe.class.php | 11 +- 6 files changed, 133 insertions(+), 18 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 87a9b14877e..13a6bdea810 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1520,7 +1520,12 @@ class Adherent extends CommonObject $lien = ''; $lienfin=''; } - + if ($option == 'category') + { + $lien = ''; + $lienfin=''; + } + $picto='user'; $label=$langs->trans("ShowMember"); diff --git a/htdocs/categories/categorie.php b/htdocs/categories/categorie.php index ddc7079c786..ec2a2b49d63 100644 --- a/htdocs/categories/categorie.php +++ b/htdocs/categories/categorie.php @@ -99,7 +99,7 @@ $error=$hookmanager->error; $errors=array_merge($errors, (array) $hookmanager->e if (empty($reshook)) { - //Suppression d'un objet d'une categorie + // Remove element from category if ($removecat > 0) { if ($type==0 && ($user->rights->produit->creer || $user->rights->service->creer)) @@ -113,17 +113,20 @@ if (empty($reshook)) { $object = new Societe($db); $result = $object->fetch($objectid); + $elementtype = 'fournisseur'; } if ($type==2 && $user->rights->societe->creer) { $object = new Societe($db); $result = $object->fetch($objectid); + $elementtype = 'societe'; } if ($type == 3 && $user->rights->adherent->creer) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; $object = new Adherent($db); $result = $object->fetch($objectid); + $elementtype = 'member'; } $cat = new Categorie($db); $result=$cat->fetch($removecat); @@ -507,7 +510,7 @@ function formCategory($db,$object,$typeid,$socid=0) //print $c->getNomUrl(1); print img_object('','category').' '.$way.""; - // Lien supprimer + // Link to delete from category print ''; + $nbofsubproducts=count($product->get_arbo_each_prod()); + print ''; dol_fiche_end(); - // List of subproducts + // List of products into this virtual product $prods_arbo = $product->get_arbo_each_prod(); if (count($prods_arbo) > 0) { @@ -231,8 +234,10 @@ if ($id || $ref) print ''; } - // Number of parent products - print ''; + // Number of parent virtual products + print ''; if (count($prodsfather) > 0) { From 5b4b0583998752ac9993d1e1745d58475ba5c2ae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Apr 2013 12:30:52 +0200 Subject: [PATCH 35/44] Perf: Minor perf enhancement --- htdocs/product/composition/fiche.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/product/composition/fiche.php b/htdocs/product/composition/fiche.php index 206dd87ceae..d02253b4d24 100644 --- a/htdocs/product/composition/fiche.php +++ b/htdocs/product/composition/fiche.php @@ -198,9 +198,10 @@ if ($id || $ref) print ''; // Number of subproducts - $prodsfather = $product->getFather(); //Parent Products + $prodsfather = $product->getFather(); // Parent Products $product->get_sousproduits_arbo(); - $nbofsubproducts=count($product->get_arbo_each_prod()); + $prods_arbo=$product->get_arbo_each_prod(); + $nbofsubproducts=count($prods_arbo); print ''; @@ -209,7 +210,6 @@ if ($id || $ref) // List of products into this virtual product - $prods_arbo = $product->get_arbo_each_prod(); if (count($prods_arbo) > 0) { print ''; - print ''; + //print ''; + print ''; if (! empty($conf->stock->enabled)) print ''; print ''; } From 54040bed1d4b5280cd76eb4c751335f439c29941 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Apr 2013 12:48:56 +0200 Subject: [PATCH 36/44] Fix: No slash alone --- htdocs/core/lib/company.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index d01c0456250..695b6deb2c1 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -47,7 +47,7 @@ function societe_prepare_head($object) { $head[$h][0] = DOL_URL_ROOT.'/comm/fiche.php?socid='.$object->id; if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && ($object->client==2 || $object->client==3)) $head[$h][1] = $langs->trans("Prospect"); - if ($object->client==3) $head[$h][1] .= '/'; + if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && $object->client==3) $head[$h][1] .= '/'; if (empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && ($object->client==1 || $object->client==3)) $head[$h][1] .= $langs->trans("Customer"); $head[$h][2] = 'customer'; $h++; From c87c7703cd4a50b78fd4f3ad4882b5cde4d83d4d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Apr 2013 13:01:22 +0200 Subject: [PATCH 37/44] Qual: Make code simpler. --- htdocs/product/class/product.class.php | 95 +++++++++----------------- htdocs/product/composition/fiche.php | 16 +++-- 2 files changed, 43 insertions(+), 68 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 9422eed8250..8cac5ebe573 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1803,7 +1803,7 @@ class Product extends CommonObject $result=$this->del_sousproduit($id_pere, $id_fils); if ($result < 0) return $result; - + // Check not already father of id_pere (to avoid father -> child -> father links) $sql = 'SELECT fk_product_pere from '.MAIN_DB_PREFIX.'product_association'; $sql .= ' WHERE fk_product_pere = '.$id_fils.' AND fk_product_fils = '.$id_pere; @@ -1852,11 +1852,11 @@ class Product extends CommonObject { if (! is_numeric($fk_parent)) $fk_parent=0; if (! is_numeric($fk_child)) $fk_child=0; - + $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_association"; $sql.= " WHERE fk_product_pere = ".$fk_parent; $sql.= " AND fk_product_fils = ".$fk_child; - + dol_syslog(get_class($this).'::del_sousproduit sql='.$sql); if (! $this->db->query($sql)) { @@ -2122,7 +2122,7 @@ class Product extends CommonObject * Define value of this->res * * @param array $prod Products array - * @param string $compl_path Directory path + * @param string $compl_path Directory path of parents to add before * @param int $multiply Because each sublevel must be multiplicated by parent nb * @param int $level Init level * @return void @@ -2132,7 +2132,8 @@ class Product extends CommonObject global $conf,$langs; $product = new Product($this->db); - foreach($prod as $nom_pere => $desc_pere) + //var_dump($prod); + foreach($prod as $id_product => $desc_pere) // nom_pere is 0 or id of sub_product { if (is_array($desc_pere)) // If this parent desc is an array, this is an array of childs { @@ -2140,58 +2141,27 @@ class Product extends CommonObject $nb=(! empty($desc_pere[1]) ? $desc_pere[1] :''); $type=(! empty($desc_pere[2]) ? $desc_pere[2] :''); $label=(! empty($desc_pere[3]) ? $desc_pere[3] :''); + if ($multiply < 1) $multiply=1; - if ($multiply) - { - //print "XXX ".$desc_pere[1]." multiply=".$multiply; - $img=""; - $this->fetch($id); - $this->load_stock(); - if ($this->stock_warehouse[1]->real < $this->seuil_stock_alerte) - { - $img=img_warning($langs->trans("StockTooLow")); - } - $this->res[]= array( -/* " - ", - $desc_pere[0], // Id product -*/ 'id'=>$id, // Id product - 'nb'=>$nb, // Nb of units that compose parent product - 'nb_total'=>$nb*$multiply, // Nb of units for all nb of product - 'stock'=>$this->stock_warehouse[1]->real, // Stock - 'stock_alert'=>$this->seuil_stock_alerte, // Stock alert - 'fullpath' => $compl_path.$label, // Label - 'type'=>$type // Nb of units that compose parent product - ); - } - else - { - $this->fetch($desc_pere[0]); - $this->load_stock(); - $this->res[]= array( -/* $compl_path.$nom_pere." (".$desc_pere[1].")", - $desc_pere[0], // Id product -*/ 'id'=>$id, // Id product + //print "XXX We add id=".$id." - label=".$label." - nb=".$nb." - multiply=".$multiply." fullpath=".$compl_path.$label."\n"; + $this->fetch($id); + $this->load_stock(); + $this->res[]= array( + 'id'=>$id, // Id product 'nb'=>$nb, // Nb of units that compose parent product - 'nb_total'=>$nb, // Nb of units for all nb of product - 'stock'=>$this->stock_warehouse[1]->real, // Stock + 'nb_total'=>$nb*$multiply, // Nb of units for all nb of product + 'stock'=>$this->stock_warehouse[1]->real, // Stock 'stock_alert'=>$this->seuil_stock_alerte, // Stock alert - 'fullpath' => $compl_path.$nom_pere, // Label - 'type'=>$type // Nb of units that compose parent product - ); - } - } - else if($nom_pere != "0" && $nom_pere != "1") - { - $this->res[]= array($compl_path.$nom_pere,$desc_pere); + 'fullpath' => $compl_path.$label, // Label + 'type'=>$type // Nb of units that compose parent product + ); } // Recursive call if child is an array - if (is_array($desc_pere[0])) + if (is_array($desc_pere['childs'])) { - $this ->fetch_prod_arbo($desc_pere[0], $nom_pere." -> ", $desc_pere[1]*$multiply, $level+1); + //print 'YYY We go down for '.$desc_pere[3]." -> \n"; + $this ->fetch_prod_arbo($desc_pere['childs'], $compl_path.$desc_pere[3]." -> ", $desc_pere[1]*$multiply, $level+1); } } } @@ -2228,11 +2198,12 @@ class Product extends CommonObject $this->res = array(); if (isset($this->sousprods) && is_array($this->sousprods)) { - foreach($this->sousprods as $nom_pere => $desc_pere) + foreach($this->sousprods as $prod_name => $desc_product) { - if (is_array($desc_pere)) $this->fetch_prod_arbo($desc_pere,"",$multiply); + if (is_array($desc_product)) $this->fetch_prod_arbo($desc_product,"",$multiply); } } + //var_dump($this->res); return $this->res; } @@ -2293,7 +2264,7 @@ class Product extends CommonObject /** - * Return all parent products fo current product + * Return all direct parent products fo current product * * @return array prod */ @@ -2324,19 +2295,19 @@ class Product extends CommonObject } /** - * Return childs of product with if fk_parent + * Return childs of product $id * - * @param int $fk_parent Id of product to search childs of + * @param int $id Id of product to search childs of * @return array Prod */ - function getChildsArbo($fk_parent) + function getChildsArbo($id) { $sql = "SELECT p.rowid, p.label as label, pa.qty as qty, pa.fk_product_fils as id, p.fk_product_type"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; $sql.= ", ".MAIN_DB_PREFIX."product_association as pa"; $sql.= " WHERE p.rowid = pa.fk_product_fils"; - $sql.= " AND pa.fk_product_pere = ".$fk_parent; - $sql.= " AND pa.fk_product_fils != ".$fk_parent; // This should not happens, it is to avoid invinite loop if it happens + $sql.= " AND pa.fk_product_pere = ".$id; + $sql.= " AND pa.fk_product_fils != ".$id; // This should not happens, it is to avoid infinite loop if it happens dol_syslog(get_class($this).'::getChildsArbo sql='.$sql); $res = $this->db->query($sql); @@ -2351,7 +2322,7 @@ class Product extends CommonObject $listofchilds=$this->getChildsArbo($rec['id']); foreach($listofchilds as $keyChild => $valueChild) { - $prods[$rec['rowid']][$keyChild] = $valueChild; + $prods[$rec['rowid']]['childs'][$keyChild] = $valueChild; } } @@ -2373,14 +2344,14 @@ class Product extends CommonObject function get_sousproduits_arbo() { $parent = $this->getParent(); - foreach($parent as $key => $value) + foreach($parent as $key => $value) // key=label, value[0]=id { foreach($this->getChildsArbo($value[0]) as $keyChild => $valueChild) { $parent[$key][$keyChild] = $valueChild; } } - foreach($parent as $key => $value) + foreach($parent as $key => $value) // key=label, value is array of childs { $this->sousprods[$key] = $value; } @@ -2418,7 +2389,7 @@ class Product extends CommonObject else if ($option == 'category') { $lien = ''; - } + } else { $lien = ''; diff --git a/htdocs/product/composition/fiche.php b/htdocs/product/composition/fiche.php index d02253b4d24..71ce35c76e1 100644 --- a/htdocs/product/composition/fiche.php +++ b/htdocs/product/composition/fiche.php @@ -227,7 +227,7 @@ if ($id || $ref) //print $value[0]; // This contains a tr line. print ''; //print ''; - print ''; + print ''; if (! empty($conf->stock->enabled)) print ''; print ''; } @@ -292,12 +292,14 @@ if ($id || $ref) // Number of subproducts $prodsfather = $product->getFather(); //Parent Products $product->get_sousproduits_arbo(); - print ''; + $prods_arbo=$product->get_arbo_each_prod(); + $nbofsubproducts=count($prods_arbo); + print ''; print ''; // List of subproducts - $prods_arbo = $product->get_arbo_each_prod(); - //var_dump($prods_arbo); if(count($prods_arbo) > 0) { print ''; } - // Number of parent products - print ''; + // Number of parent virtual products + print ''; if (count($prodsfather) > 0) { From 335c8cd5112df9a55c0e456d85729547213743fb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Apr 2013 13:01:38 +0200 Subject: [PATCH 38/44] Look: Minor change --- htdocs/theme/eldy/style.css.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 43af5fc2482..bcfb9a051bd 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1326,7 +1326,7 @@ a.tabTitle { text-shadow:1px 1px 1px #ffffff; font-family: ; font-weight: normal; - padding: 5px 6px 2px 6px; + padding: 4px 6px 2px 6px; margin: 0px 6px; text-decoration: none; white-space: nowrap; @@ -1334,7 +1334,7 @@ a.tabTitle { a.tab:link, a.tab:visited, a.tab:hover, a.tab#active { font-family: ; - padding: 5px 6px 2px 6px; + padding: 4px 6px 2px 6px; margin: 0em 0.2em; text-decoration: none; white-space: nowrap; From ed4c18b9d36fdb83c4d0fee00bd339879c61c0e5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Apr 2013 13:15:33 +0200 Subject: [PATCH 39/44] Update changelog. Fix: Fix template ODS. --- ChangeLog | 69 +++++++++--------- .../thirdparties/template_thirdparty.ods | Bin 14558 -> 13595 bytes 2 files changed, 36 insertions(+), 33 deletions(-) diff --git a/ChangeLog b/ChangeLog index c4b8ccf1e55..a70c0f58da2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.4 compared to 3.3.2 ***** For users: +- New: Can use ODS templates as document templates. - New: Add link to autofill/reset with quantity to ship when creating a delivery receipt. - New: Event into calendar use different colors for different users. @@ -11,46 +12,48 @@ For users: - New: Add a tab "consumption" on thirdparties to list products bought/sells. - New: Some performance enhancements. - New: Can attach files onto trip and expenses modules. -- New: Add option MAIN_PDF_TITLE_BACKGROUND_COLOR. +- New: Add hidden option MAIN_PDF_TITLE_BACKGROUND_COLOR. - New: Merge tab customer and prospect. - New: Add ES formated address country rule. -- New: Can define a hierarchical responsible on user. -- New: Add a hierarchical view for users. +- New: Can define a hierarchical responsible on user and add a tree view to + see hierarchy of users. - New: Can expand/collapse menus, categories and users list. -- New: extra parameters are supported into ODT templates. -- New: total per vat rate are available as tags for ODT templates. -- New: Add more types for extra parameters (lists, phone, emails, checkbox, prices). +- New: extra parameters are supported into ODT/ODS templates. +- New: total per vat rate are available as tags for ODT/ODS templates. - New: Some part of interface use more CSS3 (ie: agenda) -- New: [ task #707 ] Create option ProfIdx are mandatory to validate a invoice. +- New: [ task #707 ] Create option "ProfIdx is mandatory to validate a invoice". - New: Can define if we want to use VAT or not for subscriptions (foundation module). -- New: Can define a default choice for choice "More action when recording - a subscription" (foundation module). -- New: Add link to check professional id for india. +- New: Can define a default choice for "More action when recording a + subscription" (foundation module). +- New: Add link to check professional id for India. - New: [ task #731 ] Uniformize ref generation - New: [ task #748 ] Add a link "Dolibarr" into left menu -- New: Script email_unpaid_invoices_to_representative accepts now a parameter test - and a delay. -- New: Can define a different clicktodial setup per user. -- New: Add option INVOICE_CAN_NEVER_BE_REMOVED. -- New: Enhance agenda module to reach RFC2445 (add busy information). +- New: Script email_unpaid_invoices_to_representative accepts now a parameter "test" + and a "late delay". +- New: Can define different clicktodial setups for each user. +- New: Add hidden option INVOICE_CAN_NEVER_BE_REMOVED. +- New: Enhance agenda module to reach RFC2445 ("type" not enabled by default and add + "busy" information). - New: Add module Opensurvey. -- New: Default aprrover for holidays i sby default hierchical parent. +- New: Default approver for holidays is set by default to hierchical parent. - First change to prepare feature "click to print" (IPP) for PDF. -- New: [ task #350 ] Merge tab customer and prospect -- New: [ task #710 ] Add substitution into mailing send (and HTML is now valid) -- New: [ task #711 ] Add combobox for contact as done for product/thirdparty -- New: [ task #714 ] In Emailing module admin autogenerate security key of READRECIEPT -- New: [ task #743 ] GED : Add aministration option to disabled autotree to display -- New: [ task #767 ] Customer Address fallback when a contact doesn't have an address -- New: [ task #768 ] WYSIWYG for all mail -- New: [ task #773 ] Add Project document in GED(ECM) modules -- New: [ task #783 ] Add checkbox and radio into extrafield feature -- New: [ task #798 ] Add range limit date on product/services as it is done on order and invoice -- New: [ task #814 ] Add extrafield feature into Project/project tasks module -- New: [ task #770 ] Add ODT document generation for Projects module -- New: [ task #741 ] Add intervention box -- New: [ task #826 ] Optionnal increase stock when deleting an invoice already validated -- New: [ task #823 ] Shipping_validate email notification +- New: [ task #350 ] Merge tab customer and prospect. +- New: [ task #710 ] Add substitution into mailing send (and HTML is now valid). +- New: [ task #711 ] Add combobox for contact, as done for product/thirdparty. +- New: [ task #714 ] In Emailing module admin autogenerate security key of READRECEIPT. +- New: [ task #743 ] GED : Add aministration option to disable autotree display. +- New: [ task #767 ] Customer Address fallback when a contact doesn't have an address. +- New: [ task #768 ] WYSIWYG for all mails. +- New: [ task #773 ] Add Project document in GED(ECM) modules. +- New: [ task #783 ] Add more types for extra parameters (lists, phone, emails, checkbox, + prices, radio). +- New: [ task #798 ] Add range limit date on product/services as it is done on order + and invoice. +- New: [ task #814 ] Add extrafield feature for projects ands tasks. +- New: [ task #770 ] Add ODT document generation for Projects module. +- New: [ task #741 ] Add intervention box. +- New: [ task #826 ] Optionnal increase stock when deleting an invoice already validated. +- New: [ task #823 ] Shipping_validate email notification. For translators: - Update language files. @@ -60,8 +63,8 @@ For developers: - An external module can force its theme. - Add function dol_set_focus('#xxx'). - A mymodule can bring its own core/modules/mymodule/modules_mymodule.php file. -- Removed not used libraries. -- More web services. +- Removed some not used libraries. +- More web services. - Renamed some database fields, code variables and parameters from french to english. - First change to manage margins on contracts. - Add hook getFormMail. diff --git a/htdocs/install/doctemplates/thirdparties/template_thirdparty.ods b/htdocs/install/doctemplates/thirdparties/template_thirdparty.ods index ad50961b562d95810ea98e692c74827e9ece247d..c715d7fb80f94399f3a39710b5d67c73a91db913 100644 GIT binary patch literal 13595 zcmeHuWmsIx(k>b_2~L1OaCdhN7Th&Ra2uS#Ww0Q@B{&54V8J~=AXtFGCAb9$?r>+a zcTTeR+2_0G`*(lbhK99zRlQwZU0q%MtXj%)@CZ0CFvu`4-r7mx!M1$i%rG!8&bMbI6Gj?#WwK6ewv9brSxB*O=?TwwSoSE$%%mAkLCa!j702gLw2PZRQQ)f#v zGZ*E*V7iDK0JY&^V4(E}rkRT|v%8(Gpa|p-shgRTGXzzLoQ;{4oYV|pVsB~%un;2G zP?uujB^MD!6|^@uw=yx~|Je}}L?UBS2rIyu|BpvPIgc9KZf|DJ9bu9PL@CJfA(bI zWNK>rFZ$mG0HNhzv0yPZb}?phvoZrxkdywY$KMprPA>dYyHGKN1%C)*0+~nXL^DB{ z&4k%m**KV3Ihokm)Y;hhxw!b*cm!GgflkoWg#WJ$?CNYB{Hz@OTo8tz5C7=F%+$&S zGRaJ)u1-IC5>{5{l;Pr3;NnpG6Z_vN{>o_LVPb3MEX?&c>OY(RptUdqm_gv}orLAB zUOAa5{jeey4rVS&c`JacyP-BOw;?wt>2D7W9h~f~%}iWaIJj8t*eJzat!z!1*#GR~ z7aVk?KXe3zHgq=3@NH){M!--WA{iF?#Yp z8cob>ZGX0LaQ@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oS`BfKAQp0L-!us!6q`$!e+M8Md zK&;|Gu)V1h=zky+{07;{(aF{6f$#sogJg*R5*1>7D;EF=^uNXZoswWjN4x)x^*cEq zu$)XC0CxXF&fjsfv~z^Cik~L^-6}2ZZ?rQthXlbN(a37<>f-X}QVuj^)d&6|B|<$M zEO{vZ?y27?@eqBke>2(d#KDG8Rg}~aW0qBtVzoDQ09pb-Kh}}T)Y~0Cks-I7Gg9pP zmlYs#?`4g&zPpB!N_&ck+>vi{?<wVNyAmdq)~Fnhs7?_BfOi6`S9Emq-x|QB;P_-*@j>(LpV#SZqTbDdsc2U z2j#sFzk4@5ni5P0lU9LzdM9DCYB?qXLdhd_r{5eO9A9QmkUmR%5`|;oJn{u!>M-)^ zP_f?l!5i-SK1W!OprDo@y_JgmqsLF7{{2kS510M*^Yet#e`5XTsiVITpfn)2|8@rH zCzYQ*{rg(s!-s%h1)lhyp9TIC^Y632hqc6C<&NwhD~tb$`1daTVRHDZSVDsQ*HrN* z-oJJDzwr8)AqTl2Jic&(56SOW8TuWaf26{Hr}U7XeicNH|2ERE)cEgI{;8M9zfk#^ zD*v6%Kc#X14V_=9^A9RNBl|&zpZV`0dHyP8zoGIksq}wE(?3;&;rwqy{XLQXQ@FpU jgNIc5s|Z5q{5G+w$iqU$!B9}>kUt(6D5y7F4^RIGT@Nx0 From e65e6516c5bc7f781f1a6d881f2d500df07f83c3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Apr 2013 14:33:47 +0200 Subject: [PATCH 40/44] Fix: Logon theme on amarok --- htdocs/core/tpl/login.tpl.php | 2 +- htdocs/theme/amarok/style.css.php | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 8717225cd3f..7f10efcc1ec 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -179,7 +179,7 @@ if ($forgetpasslink || $helpcenterlink) -
+

dol_optimize_smallscreen)) { print "width: 50%;\n"; } ?> } div.ficheaddleft { - dol_optimize_smallscreen)) { print "padding-left: 16px;\n"; } + dol_optimize_smallscreen)) { print "padding-left: 16px;\n"; } else print "margin-top: 10px;\n"; ?> } From 1be6a2c1208c7e6b5337892712b1beb1c0d0d1aa Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 22 Apr 2013 12:35:31 +0200 Subject: [PATCH 41/44] Fix: broken features for fileupload --- htdocs/comm/action/document.php | 2 +- htdocs/core/class/fileupload.class.php | 28 +++++++++++++++++++++++++- htdocs/projet/class/task.class.php | 1 + htdocs/projet/tasks/document.php | 8 ++++++-- 4 files changed, 35 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 9fcbca3e743..042f330b199 100755 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -263,7 +263,7 @@ if ($objectid > 0) // Affiche formulaire upload $formfile=new FormFile($db); - $formfile->form_attach_new_file(DOL_URL_ROOT.'/comm/action/document.php?id='.$act->id,'',0,0,($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create)); + $formfile->form_attach_new_file(DOL_URL_ROOT.'/comm/action/document.php?id='.$act->id,'',0,0,($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create),50,$act); // List of document diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php index c5e83017940..a86073e6969 100644 --- a/htdocs/core/class/fileupload.class.php +++ b/htdocs/core/class/fileupload.class.php @@ -56,6 +56,8 @@ class FileUpload $filename = $regs[2]; } + $parentForeignKey = ''; + // For compatibility if ($element == 'propal') { $pathname = 'comm/propal'; @@ -69,6 +71,14 @@ class FileUpload $element = $pathname = 'projet'; $dir_output=$conf->$element->dir_output; } + elseif ($element == 'project_task') { + $pathname = 'projet'; $filename='task'; + $dir_output=$conf->projet->dir_output; + $parentForeignKey = 'fk_project'; + $parentClass = 'Project'; + $parentElement = 'projet'; + $parentObject = 'project'; + } elseif ($element == 'fichinter') { $element='ficheinter'; $dir_output=$conf->$element->dir_output; @@ -80,6 +90,10 @@ class FileUpload elseif ($element == 'invoice_supplier') { $pathname = 'fourn'; $filename='fournisseur.facture'; $dir_output=$conf->fournisseur->facture->dir_output; + } + elseif ($element == 'action') { + $pathname = 'comm/action'; $filename='actioncomm'; + $dir_output=$conf->agenda->dir_output; } else { $dir_output=$conf->$element->dir_output; } @@ -97,11 +111,23 @@ class FileUpload $object = new $classname($db); $object->fetch($fk_element); - $object->fetch_thirdparty(); + if (!empty($parentForeignKey)) { + dol_include_once('/'.$parentElement.'/class/'.$parentObject.'.class.php'); + $parent = new $parentClass($db); + $parent->fetch($object->$parentForeignKey); + if (!empty($parent->socid)) { + $parent->fetch_thirdparty(); + } + $object->$parentObject = dol_clone($parent); + } else { + $object->fetch_thirdparty(); + } $object_ref = dol_sanitizeFileName($object->ref); if ($element == 'invoice_supplier') { $object_ref = get_exdir($object->id, 2) . $object_ref; + } else if ($element == 'project_task') { + $object_ref = $object->project->ref . '/' . $object_ref; } $this->options = array( diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index ac29870106b..a177ddf838b 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -183,6 +183,7 @@ class Task extends CommonObject $sql.= " t.label,"; $sql.= " t.description,"; $sql.= " t.duration_effective,"; + $sql.= " t.datec,"; $sql.= " t.dateo,"; $sql.= " t.datee,"; $sql.= " t.fk_user_creat,"; diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index 5d42a44d54b..90adc2925c2 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -93,7 +93,11 @@ if ($id > 0 || ! empty($ref)) { $projectstatic->fetch($object->fk_project); - if (! empty($projectstatic->socid)) $projectstatic->societe->fetch($projectstatic->socid); + if (! empty($projectstatic->socid)) { + $projectstatic->fetch_thirdparty(); + } + + $object->project = dol_clone($projectstatic); $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref); } @@ -114,7 +118,7 @@ if ($action=='delete') { $langs->load("other"); $file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). - $ret=dol_delete_file($file); + $ret=dol_delete_file($file,0,0,0,$object); if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); From 733872e9c90bcbbd263260c228f4e6eeb6b09d11 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 22 Apr 2013 14:47:37 +0200 Subject: [PATCH 42/44] Fix: merge problem --- htdocs/comm/action/document.php | 323 ++++++++++++++++---------------- 1 file changed, 162 insertions(+), 161 deletions(-) diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 042f330b199..6a576c580ca 100755 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -51,6 +51,19 @@ if ($user->societe_id > 0) $socid = $user->societe_id; } +$act = new ActionComm($db); + +if ($objectid > 0) +{ + $ret = $act->fetch($objectid); + if ($ret > 0) { + $company=new Societe($db); + $company->fetch($act->societe->id); + $act->societe=$company; // For backward compatibility + $act->thirdparty=$company; + } +} + // Get parameters $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); @@ -79,7 +92,7 @@ if ($action == 'delete') { $upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($objectid); $file = $upload_dir . '/' . $_GET['urlfile']; // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). - $ret=dol_delete_file($file); + $ret=dol_delete_file($file,0,0,0,$act); if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); $action=''; @@ -96,184 +109,172 @@ $help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda'; llxHeader('',$langs->trans("Agenda"),$help_url); -if ($objectid > 0) +if ($act->id > 0) { - $act = new ActionComm($db); - if ($act->fetch($objectid)) + $upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($objectid); + + $author=new User($db); + $author->fetch($act->author->id); + $act->author=$author; + + if ($act->contact->id) $act->fetch_contact($act->contact->id); + + $head=actions_prepare_head($act); + dol_fiche_head($head, 'documents', $langs->trans("Action"),0,'action'); + + // Affichage fiche action en mode visu + print '
'; $permission=0; if ($typeid == 0) $permission=($user->rights->produit->creer || $user->rights->service->creer); diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 96c111f2dc0..377c06fd8d8 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -420,6 +420,7 @@ class Categorie $sql .= " WHERE fk_categorie = ".$this->id; $sql .= " AND fk_".($type=='fournisseur'?'societe':$type)." = ".$obj->id; + dol_syslog(get_class($this).'::del_type sql='.$sql); if ($this->db->query($sql)) { return 1; diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index f174f5f4a60..57cffd387de 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -36,6 +36,7 @@ $ref=GETPOST('ref'); $type=GETPOST('type'); $action=GETPOST('action'); $confirm=GETPOST('confirm'); +$removeelem = GETPOST('removeelem','int'); if ($id == "") { @@ -61,6 +62,40 @@ $type=$object->type; * Actions */ +// Remove element from category +if ($id > 0 && $removeelem > 0) +{ + if ($type==0 && ($user->rights->produit->creer || $user->rights->service->creer)) + { + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; + $tmpobject = new Product($db); + $result = $tmpobject->fetch($removeelem); + $elementtype = 'product'; + } + if ($type==1 && $user->rights->societe->creer) + { + $tmpobject = new Societe($db); + $result = $tmpobject->fetch($removeelem); + $elementtype = 'fournisseur'; + } + if ($type==2 && $user->rights->societe->creer) + { + $tmpobject = new Societe($db); + $result = $tmpobject->fetch($removeelem); + $elementtype = 'societe'; + } + if ($type == 3 && $user->rights->adherent->creer) + { + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; + $tmpobject = new Adherent($db); + $result = $tmpobject->fetch($removeelem); + $elementtype = 'member'; + } + + $result=$object->del_type($tmpobject,$elementtype); + if ($result < 0) dol_print_error('',$object->error); +} + if ($user->rights->categorie->supprimer && $action == 'confirm_delete' && $confirm == 'yes') { if ($object->delete($user) >= 0) @@ -214,7 +249,7 @@ if ($object->type == 0) { print "
"; print "\n"; - print '\n"; + print '\n"; if (count($prods) > 0) { @@ -224,10 +259,24 @@ if ($object->type == 0) $var=!$var; print "\t\n"; print '\n"; + print $prod->getNomUrl(1,'category'); + print "\n"; print '\n"; + // Link to delete from category + print ''; print "\n"; } } @@ -249,8 +298,8 @@ if ($object->type == 1) else { print "
"; - print "
'.$langs->trans("ProductsAndServices")."
'.$langs->trans("ProductsAndServices")."
'; - if ($prod->type == 1) print img_object($langs->trans("ShowService"),"service"); - else print img_object($langs->trans("ShowProduct"),"product"); - print " ".$prod->ref."'.$prod->libelle."'; + $typeid=$object->type; + $permission=0; + if ($typeid == 0) $permission=($user->rights->produit->creer || $user->rights->service->creer); + if ($typeid == 1) $permission=$user->rights->societe->creer; + if ($typeid == 2) $permission=$user->rights->societe->creer; + if ($typeid == 3) $permission=$user->rights->adherent->creer; + if ($permission) + { + print ""; + print img_delete($langs->trans("DeleteFromCat")).' '; + print $langs->trans("DeleteFromCat").""; + } + print '
\n"; - print "\n"; + print '
".$langs->trans("Suppliers")."
'."\n"; + print '\n"; if (count($socs) > 0) { @@ -261,9 +310,24 @@ if ($object->type == 1) print "\t\n"; print '\n"; - + // Link to delete from category + print ''; + print "\n"; } } @@ -285,8 +349,8 @@ if($object->type == 2) else { print "
"; - print "
'.$langs->trans("Suppliers")."
'; - print $soc->getNomUrl(1); + print $soc->getNomUrl(1,'category_supplier'); print "'; + $typeid=$object->type; + $permission=0; + if ($typeid == 0) $permission=($user->rights->produit->creer || $user->rights->service->creer); + if ($typeid == 1) $permission=$user->rights->societe->creer; + if ($typeid == 2) $permission=$user->rights->societe->creer; + if ($typeid == 3) $permission=$user->rights->adherent->creer; + if ($permission) + { + print ""; + print img_delete($langs->trans("DeleteFromCat")).' '; + print $langs->trans("DeleteFromCat").""; + } + print '
\n"; - print "\n"; + print '
".$langs->trans("Customers")."
'."\n"; + print '\n"; if (count($socs) > 0) { @@ -298,9 +362,23 @@ if($object->type == 2) $var=!$var; print "\t\n"; print '\n"; - + // Link to delete from category + print ''; print "\n"; } } @@ -326,7 +404,7 @@ if ($object->type == 3) { print "
"; print "
'.$langs->trans("Customers")."
'; - print $soc->getNomUrl(1); + print $soc->getNomUrl(1,'category'); print "'; + $typeid=$object->type; + $permission=0; + if ($typeid == 0) $permission=($user->rights->produit->creer || $user->rights->service->creer); + if ($typeid == 1) $permission=$user->rights->societe->creer; + if ($typeid == 2) $permission=$user->rights->societe->creer; + if ($typeid == 3) $permission=$user->rights->adherent->creer; + if ($permission) + { + print ""; + print img_delete($langs->trans("DeleteFromCat")).' '; + print $langs->trans("DeleteFromCat").""; + } + print '
\n"; - print '\n"; + print '\n"; if (count($prods) > 0) { @@ -336,10 +414,25 @@ if ($object->type == 3) $var=!$var; print "\t\n"; print '\n"; print '\n"; print '\n"; + // Link to delete from category + print '\n"; } } diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index a8803d6e5e8..3d5749169ad 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -2412,6 +2412,10 @@ class Product extends CommonObject $lien = ''; $lienfin=''; } + else if ($option == 'category') + { + $lien = ''; + } else { $lien = ''; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index d6666495a14..0c1b8016938 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1455,6 +1455,15 @@ class Societe extends CommonObject { $lien = 'canvas)?'&canvas='.$this->canvas:'').'">'; + $lien.=(!empty($this->canvas)?'&canvas='.$this->canvas:'').'">'; $lienfin=''; if ($withpicto) $result.=($lien.img_object($langs->trans("ShowCompany").': '.$name,'company').$lienfin); From ecb19e2225906ddda9ae6179b7840ff8fbbbdc66 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Apr 2013 00:28:12 +0200 Subject: [PATCH 30/44] Fix: Removed warning --- dev/skeletons/modMyModule.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dev/skeletons/modMyModule.class.php b/dev/skeletons/modMyModule.class.php index 2f203cbfeb2..5711b61c4ac 100644 --- a/dev/skeletons/modMyModule.class.php +++ b/dev/skeletons/modMyModule.class.php @@ -133,7 +133,11 @@ class modMyModule extends DolibarrModules $this->tabs = array(); // Dictionnaries - if (! isset($conf->mymodule->enabled)) $conf->mymodule->enabled=0; + if (! isset($conf->mymodule->enabled)) + { + $conf->mymodule=new stdClass(); + $conf->mymodule->enabled=0; + } $this->dictionnaries=array(); /* Example: if (! isset($conf->mymodule->enabled)) $conf->mymodule->enabled=0; // This is to avoid warnings From e19e0ff55742d4f6e6fcc8cbb7ec50a20ec0d549 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Apr 2013 00:57:56 +0200 Subject: [PATCH 31/44] Fix: Error management --- htdocs/core/ajax/ajaxdirtree.php | 2 +- htdocs/ecm/class/ecmdirectory.class.php | 3 ++- htdocs/ecm/docdir.php | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/ajax/ajaxdirtree.php b/htdocs/core/ajax/ajaxdirtree.php index ded1a4a30c4..db8af5ba265 100644 --- a/htdocs/core/ajax/ajaxdirtree.php +++ b/htdocs/core/ajax/ajaxdirtree.php @@ -117,7 +117,7 @@ if (file_exists($fullpathselecteddir)) // Loop on all database entries (sqltree) to find the one matching the subdir found into dir to scan foreach($sqltree as $key => $tmpval) { - //print "-- key=".$key." - ".$val['fullrelativename']." vs ".(($selecteddir != '/'?$selecteddir.'/':'').$file).'
'; + //print "-- key=".$key." - ".$tmpval['fullrelativename']." vs ".(($selecteddir != '/'?$selecteddir.'/':'').$file)."
\n"; if ($tmpval['fullrelativename'] == (($selecteddir != '/'?$selecteddir.'/':'').$file)) // We found equivalent record into database { $val=$tmpval; diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php index bdb8dd0f366..3c12fe066e9 100644 --- a/htdocs/ecm/class/ecmdirectory.class.php +++ b/htdocs/ecm/class/ecmdirectory.class.php @@ -142,7 +142,8 @@ class EcmDirectory // extends CommonObject $dir=$conf->ecm->dir_output.'/'.$this->getRelativePath(); $result=dol_mkdir($dir); - + if ($result < 0) { $error++; $this->error="ErrorFailedToCreateDir"; } + // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); diff --git a/htdocs/ecm/docdir.php b/htdocs/ecm/docdir.php index 8f71bf4ed97..5ab21beed0d 100644 --- a/htdocs/ecm/docdir.php +++ b/htdocs/ecm/docdir.php @@ -118,6 +118,7 @@ if ($action == 'add' && $user->rights->ecm->setup) { $langs->load("errors"); setEventMessage($langs->trans($ecmdir->error), 'errors'); + setEventMessage($ecmdir->errors, 'errors'); $action = 'create'; } } From 7ff2e559aa0538e75622a1ac7a6ff100885c566c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Apr 2013 01:59:52 +0200 Subject: [PATCH 32/44] Fix: PGsql compatibility --- htdocs/product/class/product.class.php | 62 +++++++++++++------------- htdocs/product/composition/fiche.php | 4 +- 2 files changed, 34 insertions(+), 32 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 3d5749169ad..396695aa98d 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1797,8 +1797,16 @@ class Product extends CommonObject */ function add_sousproduit($id_pere, $id_fils,$qty) { - $sql = 'DELETE from '.MAIN_DB_PREFIX.'product_association'; - $sql .= ' WHERE fk_product_pere = "'.$id_pere.'" AND fk_product_fils = "'.$id_fils.'"'; + // Clean parameters + if (! is_numeric($id_pere)) $id_pere=0; + if (! is_numeric($id_fils)) $id_fils=0; + + $result=$this->del_sousproduit($id_pere, $id_fils); + if ($result < 0) return $result; + + // Check not already father of id_pere (to avoid father -> child -> father links) + $sql = 'SELECT fk_product_pere from '.MAIN_DB_PREFIX.'product_association'; + $sql .= ' WHERE fk_product_pere = '.$id_fils.' AND fk_product_fils = '.$id_pere; if (! $this->db->query($sql)) { dol_print_error($this->db); @@ -1806,37 +1814,27 @@ class Product extends CommonObject } else { - $sql = 'SELECT fk_product_pere from '.MAIN_DB_PREFIX.'product_association'; - $sql .= ' WHERE fk_product_pere = "'.$id_fils.'" AND fk_product_fils = "'.$id_pere.'"'; - if (! $this->db->query($sql)) + $result = $this->db->query($sql); + if ($result) { - dol_print_error($this->db); - return -1; - } - else - { - $result = $this->db->query($sql); - if ($result) + $num = $this->db->num_rows($result); + if($num > 0) { - $num = $this->db->num_rows($result); - if($num > 0) + $this->error="isFatherOfThis"; + return -1; + } + else + { + $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'product_association(fk_product_pere,fk_product_fils,qty)'; + $sql .= ' VALUES ('.$id_pere.', '.$id_fils.', '.$qty.')'; + if (! $this->db->query($sql)) { - $this->error="isFatherOfThis"; + dol_print_error($this->db); return -1; } else { - $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'product_association(fk_product_pere,fk_product_fils,qty)'; - $sql .= ' VALUES ("'.$id_pere.'","'.$id_fils.'","'.$qty.'")'; - if (! $this->db->query($sql)) - { - dol_print_error($this->db); - return -1; - } - else - { - return 1; - } + return 1; } } } @@ -1848,14 +1846,18 @@ class Product extends CommonObject * * @param int $fk_parent Id du produit auquel ne sera plus lie le produit lie * @param int $fk_child Id du produit a ne plus lie - * @return int < 0 si erreur, > 0 si ok + * @return int < 0 if KO, > 0 if OK */ function del_sousproduit($fk_parent, $fk_child) { + if (! is_numeric($fk_parent)) $fk_parent=0; + if (! is_numeric($fk_child)) $fk_child=0; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_association"; - $sql.= " WHERE fk_product_pere = '".$fk_parent."'"; - $sql.= " AND fk_product_fils = '".$fk_child."'"; - + $sql.= " WHERE fk_product_pere = ".$fk_parent; + $sql.= " AND fk_product_fils = ".$fk_child; + + dol_syslog(get_class($this).'::del_sousproduit sql='.$sql); if (! $this->db->query($sql)) { dol_print_error($this->db); diff --git a/htdocs/product/composition/fiche.php b/htdocs/product/composition/fiche.php index 804759afe3a..395275a9911 100644 --- a/htdocs/product/composition/fiche.php +++ b/htdocs/product/composition/fiche.php @@ -72,8 +72,8 @@ $cancel <> $langs->trans("Cancel") && $error=0; for($i=0;$i<$_POST["max_prod"];$i++) { - // print "
: ".$_POST["prod_id_chk".$i]; - if($_POST["prod_id_chk".$i] != "") + print "
: ".$_POST["prod_id_chk".$i]; + if ($_POST["prod_id_chk".$i] > 0) { if($product->add_sousproduit($id, $_POST["prod_id_".$i],$_POST["prod_qty_".$i]) > 0) { From ab4a3dcaa7793e0a51c6acbf80bd0bc95c90e4eb Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 22 Apr 2013 10:18:03 +0200 Subject: [PATCH 33/44] Fix: missing rename field --- htdocs/core/modules/modFacture.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 666bcb9a22a..4d18c3d8757 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -198,10 +198,10 @@ class modFacture extends DolibarrModules $this->export_label[$r]='CustomersInvoicesAndPayments'; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_icon[$r]='bill'; $this->export_permission[$r]=array(array("facture","facture","export")); - $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note'=>"NotePrivate",'f.note_public'=>"NotePublic",'p.rowid'=>'PaymentId','pf.amount'=>'AmountPayment','p.datep'=>'DatePayment','p.num_paiement'=>'PaymentNumber'); - //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.rowid'=>"List:facture:facnumber",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Number",'f.total_ttc'=>"Number",'f.tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note'=>"Text",'f.note_public'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number'); - $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.rowid'=>"List:facture:facnumber",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Number",'f.total_ttc'=>"Number",'f.tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note'=>"Text",'f.note_public'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number'); - $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'f.note_public'=>"invoice",'p.rowid'=>'payment','pf.amount'=>'payment','p.datep'=>'payment','p.num_paiement'=>'payment'); + $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note_private'=>"NotePrivate",'f.note_public'=>"NotePublic",'p.rowid'=>'PaymentId','pf.amount'=>'AmountPayment','p.datep'=>'DatePayment','p.num_paiement'=>'PaymentNumber'); + //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.rowid'=>"List:facture:facnumber",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Number",'f.total_ttc'=>"Number",'f.tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number'); + $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.rowid'=>"List:facture:facnumber",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Number",'f.total_ttc'=>"Number",'f.tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number'); + $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note_private'=>"invoice",'f.note_public'=>"invoice",'p.rowid'=>'payment','pf.amount'=>'payment','p.datep'=>'payment','p.num_paiement'=>'payment'); $this->export_dependencies_array[$r]=array('payment'=>'p.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $this->export_sql_start[$r]='SELECT DISTINCT '; From ee843924dd56d1d5b47346a99125bb3f2e8f91c4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Apr 2013 10:33:06 +0200 Subject: [PATCH 34/44] Fix: Some translation change to have things more clear. --- htdocs/core/class/html.form.class.php | 4 ++-- htdocs/langs/en_US/products.lang | 12 +++++++----- htdocs/langs/fr_FR/products.lang | 16 +++++++++------- htdocs/product/class/product.class.php | 7 ++++--- htdocs/product/composition/fiche.php | 15 ++++++++++----- 5 files changed, 32 insertions(+), 22 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 944f364ee4b..97658572831 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -344,7 +344,7 @@ class Form * Show a text and picto with tooltip on text or picto * * @param string $text Text to show - * @param string $htmltext Content html of tooltip. Must be HTML/UTF8 encoded. + * @param string $htmltext HTML content of tooltip. Must be HTML/UTF8 encoded. * @param int $tooltipon 1=tooltip sur texte, 2=tooltip sur picto, 3=tooltip sur les 2 * @param int $direction -1=Le picto est avant, 0=pas de picto, 1=le picto est apres * @param string $img Code img du picto (use img_xxx() function to get it) @@ -383,7 +383,7 @@ class Form //if ($text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.(($direction < 0)?' ':'').$text.(($direction > 0)?' ':'').''; $paramfortooltiptd.= (($direction < 0)?' style="padding-left: 3px !important;"':''); $paramfortooltiptd.= (($direction > 0)?' style="padding-right: 3px !important;"':''); - if ($text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.$text.''; + if ((string) $text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.$text.''; if ($direction > 0) $s.='<'.$tag.$paramfortooltipimg.' valign="top" width="14">'.$img.''; if (empty($notabs)) $s.='
'.$langs->trans("Member")."
'.$langs->trans("Member")."
'; - print $member->getNomUrl(1); + $member->ref=$member->login; + print $member->getNomUrl(1,0,'category'); print "'.$member->lastname."'.$member->firstname."'; + $typeid=$object->type; + $permission=0; + if ($typeid == 0) $permission=($user->rights->produit->creer || $user->rights->service->creer); + if ($typeid == 1) $permission=$user->rights->societe->creer; + if ($typeid == 2) $permission=$user->rights->societe->creer; + if ($typeid == 3) $permission=$user->rights->adherent->creer; + if ($permission) + { + print ""; + print img_delete($langs->trans("DeleteFromCat")).' '; + print $langs->trans("DeleteFromCat").""; + } print "
'; diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index b58dec53dcb..6ba653600e4 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -111,10 +111,12 @@ ServiceLimitedDuration=If product is a service with limited duration: MultiPricesAbility=Activate the multi-prices MultiPricesNumPrices=Number of price MultiPriceLevelsName=Price categories -AssociatedProductsAbility=Activate the sub-products -AssociatedProducts=Sub-products -AssociatedProductsNumber=Number of products composing this product -ParentProductsNumber=Number of parent product +AssociatedProductsAbility=Activate the virtual products feature +AssociatedProducts=Virtual product +AssociatedProductsNumber=Number of products composing this virtual product +ParentProductsNumber=Number of parent virtual product +IfZeroItIsNotAVirtualProduct=If 0, this product is not a virtual product +IfZeroItIsNotUsedByVirtualProduct=If 0, this product is not used by any virtual product EditAssociate=Associate Translation=Translation KeywordFilter=Keyword filter @@ -124,7 +126,7 @@ AddDel=Add/Delete Quantity=Quantity NoMatchFound=No match found ProductAssociationList=List of related products/services: name of product/service (quantity affected) -ProductParentList=List of products/services with this product as a component +ProductParentList=List of virtual products/services with this product as a component ErrorAssociationIsFatherOfThis=One of selected product is parent with current product DeleteProduct=Delete a product/service ConfirmDeleteProduct=Are you sure you want to delete this product/service? diff --git a/htdocs/langs/fr_FR/products.lang b/htdocs/langs/fr_FR/products.lang index 3d27fdd9d6d..f5ce6482353 100644 --- a/htdocs/langs/fr_FR/products.lang +++ b/htdocs/langs/fr_FR/products.lang @@ -111,11 +111,13 @@ ServiceLimitedDuration=Si produit de type service à durée limitée : MultiPricesAbility=Prise en charge de prix multiples MultiPricesNumPrices=Nombre de prix MultiPriceLevelsName=Catégorie de prix -AssociatedProductsAbility=Prise en charge des produits composés -AssociatedProducts=Composition -AssociatedProductsNumber=Nbre de sous-produits composant ce produit -ParentProductsNumber=Nbre de produits parent -EditAssociate=Composer +AssociatedProductsAbility=Prise en charge des produits virtuels +AssociatedProducts=Produit virtuel +AssociatedProductsNumber=Nbre de sous-produits constituant ce produit virtuel +ParentProductsNumber=Nbre de produits virtuels parent +IfZeroItIsNotAVirtualProduct=Si 0, ce produit n'est pas un produit virtuel +IfZeroItIsNotUsedByVirtualProduct=Si 0, ce produit n'est pas utilisé par un produit virtuel +EditAssociate=Composer comme produit virtuel Translation=Traduction KeywordFilter=Filtre par mot-clé CategoryFilter=Filtre par catégorie @@ -123,8 +125,8 @@ ProductToAddSearch=Recherche des produits à ajouter AddDel=Ajouter/Retirer Quantity=Quantité NoMatchFound=Aucun résultat n'a été trouvé -ProductAssociationList=Liste des produits/services composant ce produit: Le nombre entre parenthèse est la quantité affectée dans cette composition. -ProductParentList=Liste des produits/services avec ce produit comme composante +ProductAssociationList=Liste des produits/services composant ce produit virtuel: Le nombre entre parenthèse est la quantité affectée dans cette composition. +ProductParentList=Liste des produits/services virtuels avec ce produit comme composante ErrorAssociationIsFatherOfThis=L'un des produits sélectionnés est parent du produit en cours DeleteProduct=Supprimer un produit/service ConfirmDeleteProduct=Êtes-vous sûr de vouloir supprimer ce produit/service ? diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index a8803d6e5e8..f6219d5acd4 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -2137,6 +2137,7 @@ class Product extends CommonObject $id=(! empty($desc_pere[0]) ? $desc_pere[0] :''); $nb=(! empty($desc_pere[1]) ? $desc_pere[1] :''); $type=(! empty($desc_pere[2]) ? $desc_pere[2] :''); + $label=(! empty($desc_pere[3]) ? $desc_pere[3] :''); if ($multiply) { @@ -2157,10 +2158,10 @@ class Product extends CommonObject */ 'id'=>$id, // Id product 'nb'=>$nb, // Nb of units that compose parent product 'nb_total'=>$nb*$multiply, // Nb of units for all nb of product - 'stock'=>$this->stock_warehouse[1]->real, // Stock + 'stock'=>$this->stock_warehouse[1]->real, // Stock 'stock_alert'=>$this->seuil_stock_alerte, // Stock alert - 'fullpath' => $compl_path.$nom_pere, // Label - 'type'=>$type // Nb of units that compose parent product + 'fullpath' => $compl_path.$label, // Label + 'type'=>$type // Nb of units that compose parent product ); } else diff --git a/htdocs/product/composition/fiche.php b/htdocs/product/composition/fiche.php index 804759afe3a..471631cc464 100644 --- a/htdocs/product/composition/fiche.php +++ b/htdocs/product/composition/fiche.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2006 Andre Cianfarani @@ -200,12 +200,15 @@ if ($id || $ref) // Number of subproducts $prodsfather = $product->getFather(); //Parent Products $product->get_sousproduits_arbo(); - print '
'.$langs->trans("AssociatedProductsNumber").''.count($product->get_arbo_each_prod()).'
'.$langs->trans("AssociatedProductsNumber").''; + print $form->textwithpicto($nbofsubproducts, $langs->trans('IfZeroItIsNotAVirtualProduct')); + print '
'.$langs->trans("ParentProductsNumber").''.count($prodsfather).'
'.$langs->trans("ParentProductsNumber").''; + print $form->textwithpicto(count($prodsfather), $langs->trans('IfZeroItIsNotUsedByVirtualProduct')); + print '
'.$langs->trans("AssociatedProductsNumber").''; print $form->textwithpicto($nbofsubproducts, $langs->trans('IfZeroItIsNotAVirtualProduct')); print '
'; @@ -226,7 +226,8 @@ if ($id || $ref) //print $productstatic->getNomUrl(1).'
'; //print $value[0]; // This contains a tr line. print '
'.$productstatic->getNomUrl(1,'composition').' ('.$value['nb'].')    '.$productstatic->getNomUrl(1,'composition').' ('.$value['nb'].($value['nb_total'] > $value['nb']?'->'.$value['nb_total']:'').')    '.$productstatic->getNomUrl(1,'composition').' ('.$value['nb_total'].')    '.$langs->trans("Stock").' : '.$productstatic->stock_reel.'
      -> - ".$compl_path.stripslashes($nom_pere)." - (".$desc_pere[1].") ".($desc_pere[1]*$multiply)."  ".$this->stock_entrepot[1]." ".$img."
'.$productstatic->getNomUrl(1,'composition').' ('.$value['nb'].($value['nb_total'] > $value['nb']?'->'.$value['nb_total']:'').')    '.$productstatic->getNomUrl(1,'composition').' ('.$value['nb_total'].')    '.$productstatic->getNomUrl(1,'composition').' ('.$value['nb'].')    '.$langs->trans("Stock").' : '.$productstatic->stock_reel.'
'.$langs->trans("AssociatedProductsNumber").''.count($product->get_arbo_each_prod()).'
'.$langs->trans("AssociatedProductsNumber").''; + print $form->textwithpicto($nbofsubproducts, $langs->trans('IfZeroItIsNotAVirtualProduct')); + print '
'; @@ -322,8 +324,10 @@ if ($id || $ref) print '
'.$langs->trans("ParentProductsNumber").''.count($prodsfather).'
'.$langs->trans("ParentProductsNumber").''; + print $form->textwithpicto(count($prodsfather), $langs->trans('IfZeroItIsNotUsedByVirtualProduct')); + print '
'; + + $linkback = ''.$langs->trans("BackToList").''; + + // Ref + print ''; + + // Type + if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) { - $upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($objectid); + print ''; + } - $company=new Societe($db); - $company->fetch($act->societe->id); - $act->societe=$company; + // Title + print ''; - $author=new User($db); - $author->fetch($act->author->id); - $act->author=$author; + // Full day event + print ''; - if ($act->contact->id) $act->fetch_contact($act->contact->id); + // Date start + print ''; + print ''; + print ''; - $head=actions_prepare_head($act); - dol_fiche_head($head, 'documents', $langs->trans("Action"),0,'action'); + // Date end + print ''; - // Affichage fiche action en mode visu - print '
'.$langs->trans("Ref").''; + print $form->showrefnav($act, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', ''); + print '
'.$langs->trans("Type").''.$act->type.'
'.$langs->trans("Title").''.$act->label.'
'.$langs->trans("EventOnFullDay").''.yn($act->fulldayevent).'
'.$langs->trans("DateActionStart").''; + if (! $act->fulldayevent) print dol_print_date($act->datep,'dayhour'); + else print dol_print_date($act->datep,'day'); + if ($act->percentage == 0 && $act->datep && $act->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late")); + print ''."\n"; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + //print ''; + print img_picto($langs->trans("ViewCal"),'object_calendar').' '; + print ''."\n"; + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + //print ''; + print img_picto($langs->trans("ViewCal"),'object_calendarweek').' '; + print '
'."\n"; + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + //print ''; + print img_picto($langs->trans("ViewCal"),'object_calendarday').' '; + print '
'."\n"; + print '
'.$langs->trans("DateActionEnd").''; + if (! $act->fulldayevent) print dol_print_date($act->datef,'dayhour'); + else print dol_print_date($act->datef,'day'); + if ($act->percentage > 0 && $act->percentage < 100 && $act->datef && $act->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late")); + print '
'; + // Status + print ''; - $linkback = ''.$langs->trans("BackToList").''; + // Location + print ''; - // Ref - print ''; - // Type - if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) + print '
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; + print $act->getLibStatut(4); + print '
'.$langs->trans("Location").''.$act->location.'
'.$langs->trans("Ref").''; - print $form->showrefnav($act, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', ''); - print '


'; + + + // Third party - Contact + print ''; + print "
".dol_print_phone($act->societe->tel); } - - // Title - print ''; - - // Full day event - print ''; - - // Date start - print ''; - print ''; - print ''; - - // Date end - print ''; - - // Status - print ''; - - // Location - print ''; - - - print '
'.$langs->trans("ActionOnCompany").''.($act->societe->id?$act->societe->getNomUrl(1):$langs->trans("None")); + if ($act->societe->id && $act->type_code == 'AC_TEL') + { + if ($act->societe->fetch($act->societe->id)) { - print '
'.$langs->trans("Type").''.$act->type.'
'.$langs->trans("Title").''.$act->label.'
'.$langs->trans("EventOnFullDay").''.yn($act->fulldayevent).'
'.$langs->trans("DateActionStart").''; - if (! $act->fulldayevent) print dol_print_date($act->datep,'dayhour'); - else print dol_print_date($act->datep,'day'); - if ($act->percentage == 0 && $act->datep && $act->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late")); - print ''."\n"; - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - //print ''; - print img_picto($langs->trans("ViewCal"),'object_calendar').' '; - print '
'."\n"; - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - //print ''; - print img_picto($langs->trans("ViewCal"),'object_calendarweek').' '; - print '
'."\n"; - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - //print ''; - print img_picto($langs->trans("ViewCal"),'object_calendarday').' '; - print '
'."\n"; - print '
'.$langs->trans("DateActionEnd").''; - if (! $act->fulldayevent) print dol_print_date($act->datef,'dayhour'); - else print dol_print_date($act->datef,'day'); - if ($act->percentage > 0 && $act->percentage < 100 && $act->datef && $act->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late")); - print '
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; - print $act->getLibStatut(4); - print '
'.$langs->trans("Location").''.$act->location.'


'; - - - // Third party - Contact - print ''; - print ''; - print ''; - - // Project - if (! empty($conf->projet->enabled)) - { - print ''; - } - - // Priority - print ''; - - - print '
'.$langs->trans("ActionOnCompany").''.($act->societe->id?$act->societe->getNomUrl(1):$langs->trans("None")); - if ($act->societe->id && $act->type_code == 'AC_TEL') - { - if ($act->societe->fetch($act->societe->id)) - { - print "
".dol_print_phone($act->societe->tel); - } - } - print '
'.$langs->trans("Contact").''; - if ($act->contact->id > 0) - { - print $act->contact->getNomUrl(1); - if ($act->contact->id && $act->type_code == 'AC_TEL') - { - if ($act->contact->fetch($act->contact->id)) - { - print "
".dol_print_phone($act->contact->phone_pro); - } - } - } - else - { - print $langs->trans("None"); - } - - print '
'.$langs->trans("Project").''; - if ($act->fk_project) - { - $project=new Project($db); - $project->fetch($act->fk_project); - print $project->getNomUrl(1); - } - print '
'.$langs->trans("Priority").''; - print ($act->priority?$act->priority:''); - print '


'; - - // Construit liste des fichiers - $filearray=dol_dir_list($upload_dir,"files",0,'','\.meta$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); - $totalsize=0; - foreach($filearray as $key => $file) + } + print ''; + print ''; + print ''; - print ''; - print '
'.$langs->trans("Contact").''; + if ($act->contact->id > 0) + { + print $act->contact->getNomUrl(1); + if ($act->contact->id && $act->type_code == 'AC_TEL') { - $totalsize+=$file['size']; + if ($act->contact->fetch($act->contact->id)) + { + print "
".dol_print_phone($act->contact->phone_pro); + } } - - - print '
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
'; - - print '
'; - - - // Affiche formulaire upload - $formfile=new FormFile($db); - $formfile->form_attach_new_file(DOL_URL_ROOT.'/comm/action/document.php?id='.$act->id,'',0,0,($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create),50,$act); - - - // List of document - $param='&id='.$act->id; - $formfile->list_of_documents($filearray,$act,'actions',$param,0,'',$user->rights->agenda->myactions->create); } else { - dol_print_error($db); + print $langs->trans("None"); } + + print ''; + + // Project + if (! empty($conf->projet->enabled)) + { + print ''.$langs->trans("Project").''; + if ($act->fk_project) + { + $project=new Project($db); + $project->fetch($act->fk_project); + print $project->getNomUrl(1); + } + print ''; + } + + // Priority + print ''.$langs->trans("Priority").''; + print ($act->priority?$act->priority:''); + print ''; + + + print '

'; + + // Construit liste des fichiers + $filearray=dol_dir_list($upload_dir,"files",0,'','\.meta$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); + $totalsize=0; + foreach($filearray as $key => $file) + { + $totalsize+=$file['size']; + } + + + print ''; + print ''; + print '
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
'; + + print '
'; + + + // Affiche formulaire upload + $formfile=new FormFile($db); + $formfile->form_attach_new_file(DOL_URL_ROOT.'/comm/action/document.php?id='.$act->id,'',0,0,($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create),50,$act); + + + // List of document + $param='&id='.$act->id; + $formfile->list_of_documents($filearray,$act,'actions',$param,0,'',$user->rights->agenda->myactions->create); } else { From 29a8c10504369d925bc17b0814a28ef152c6ca49 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 22 Apr 2013 15:09:19 +0200 Subject: [PATCH 43/44] Fix: broken features --- htdocs/compta/sociales/class/chargesociales.class.php | 2 +- htdocs/compta/sociales/document.php | 4 ++-- htdocs/core/class/fileupload.class.php | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index 6fbd0a23143..f62b2fcc594 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; */ class ChargeSociales extends CommonObject { - public $element='rowid'; + public $element='chargesociales'; public $table='chargesociales'; public $table_element='chargesociales'; diff --git a/htdocs/compta/sociales/document.php b/htdocs/compta/sociales/document.php index dcb082b41d7..452de21285a 100644 --- a/htdocs/compta/sociales/document.php +++ b/htdocs/compta/sociales/document.php @@ -79,7 +79,7 @@ if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC)) if ($action == 'delete') { $file = $upload_dir . '/' . GETPOST("urlfile"); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). - $ret=dol_delete_file($file); + $ret=dol_delete_file($file,0,0,0,$object); if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); } @@ -172,7 +172,7 @@ if ($object->id) // Affiche formulaire upload $formfile=new FormFile($db); - $formfile->form_attach_new_file(DOL_URL_ROOT.'/compta/sociales/document.php?id='.$object->id,'',0,0,$user->rights->tax->charges->creer); + $formfile->form_attach_new_file(DOL_URL_ROOT.'/compta/sociales/document.php?id='.$object->id,'',0,0,$user->rights->tax->charges->creer,50,$object); // List of document diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php index a86073e6969..6bb5b9209d1 100644 --- a/htdocs/core/class/fileupload.class.php +++ b/htdocs/core/class/fileupload.class.php @@ -94,6 +94,10 @@ class FileUpload elseif ($element == 'action') { $pathname = 'comm/action'; $filename='actioncomm'; $dir_output=$conf->agenda->dir_output; + } + elseif ($element == 'chargesociales') { + $pathname = 'compta/sociales'; $filename='chargesociales'; + $dir_output=$conf->tax->dir_output; } else { $dir_output=$conf->$element->dir_output; } From 28757c8d8888db695fedc32b62dcf69ec8e3a205 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 22 Apr 2013 15:26:14 +0200 Subject: [PATCH 44/44] Fix: missing commit --- htdocs/core/class/fileupload.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php index 6bb5b9209d1..910ad55e0a0 100644 --- a/htdocs/core/class/fileupload.class.php +++ b/htdocs/core/class/fileupload.class.php @@ -91,6 +91,9 @@ class FileUpload $pathname = 'fourn'; $filename='fournisseur.facture'; $dir_output=$conf->fournisseur->facture->dir_output; } + elseif ($element == 'product') { + $dir_output = $conf->product->multidir_output[$conf->entity]; + } elseif ($element == 'action') { $pathname = 'comm/action'; $filename='actioncomm'; $dir_output=$conf->agenda->dir_output;