From 6b1b6b4fee9671835db8fc518906e09aed7e2030 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 24 Jul 2013 20:20:10 +0200 Subject: [PATCH 01/19] Fix: Color no more lost --- .../livraison/pdf/pdf_typhon.modules.php | 49 ++++++++++--------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php index 44ffd2cb208..6db383e10e7 100644 --- a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php @@ -162,7 +162,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $dir = $conf->expedition->dir_output."/receipt/" . $objectref; $file = $dir . "/" . $objectref . ".pdf"; } - + if (! file_exists($dir)) { if (dol_mkdir($dir) < 0) @@ -175,7 +175,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder if (file_exists($dir)) { $nblines = count($object->lines); - + // Create pdf instance $pdf=pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance @@ -288,7 +288,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $curX = $this->posxdesc-1; $showpricebeforepagebreak=1; - + $pdf->startTransaction(); pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxcomm-$curX,3,$curX,$curY,$hideref,$hidedesc); $pageposafter=$pdf->getPage(); @@ -320,7 +320,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder { $pdf->commitTransaction(); } - + $nexY = $pdf->GetY(); $pageposafter=$pdf->getPage(); $pdf->setPage($pageposbefore); @@ -429,11 +429,11 @@ class pdf_typhon extends ModelePDFDeliveryOrder // 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(); @@ -539,20 +539,20 @@ class pdf_typhon extends ModelePDFDeliveryOrder { 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 * @@ -568,13 +568,13 @@ class pdf_typhon extends ModelePDFDeliveryOrder 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); - + // Amount in (at tab_top - 1) $pdf->SetTextColor(0,0,0); $pdf->SetFont('','', $default_font_size - 2); @@ -586,11 +586,11 @@ class pdf_typhon extends ModelePDFDeliveryOrder { $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($this->posxcomm - $this->posxdesc,2, $outputlangs->transnoentities("Designation"),'','L'); @@ -634,15 +634,15 @@ class pdf_typhon extends ModelePDFDeliveryOrder { 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/'.$this->emetteur->logo; if ($this->emetteur->logo) @@ -694,21 +694,21 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->SetTextColor(0,0,60); $posy+=2; - + // Show list of linked objects $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size); - + if ($showaddress) { // 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); @@ -729,7 +729,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->SetXY($posx+2,$posy); $pdf->SetFont('','', $default_font_size - 1); $pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L'); - + // Client destinataire $posy=42; $pdf->SetTextColor(0,0,0); @@ -786,6 +786,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L'); } + $pdf->SetTextColor(0,0,60); } /** From 16d530b22d9ec62fc500334eb13bbd977e65464e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 25 Jul 2013 18:56:09 +0200 Subject: [PATCH 02/19] Fix: Watermark make pagebreak crazy. --- htdocs/core/lib/pdf.lib.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index d6d846c2b23..098ad08812e 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -407,19 +407,24 @@ function pdf_watermark(&$pdf, $outputlangs, $h, $w, $unit, $text) elseif ($unit=='cm') $k=72/2.54; elseif ($unit=='in') $k=72; - $watermark_angle=atan($h/$w); - $watermark_x=5; - $watermark_y=$h-50; // We must be sure to not print into margins - $watermark_width=$h; - $pdf->SetFont('','B',50); + $savx=$pdf->getX(); $savy=$pdf->getY(); + + $watermark_angle=atan($h/$w)/2; + $watermark_x_pos=0; + $watermark_y_pos=$h/3; + $watermark_x=$w/2; + $watermark_y=$h/3; + $pdf->SetFont('','B',40); $pdf->SetTextColor(255,192,203); //rotate $pdf->_out(sprintf('q %.5F %.5F %.5F %.5F %.2F %.2F cm 1 0 0 1 %.2F %.2F cm',cos($watermark_angle),sin($watermark_angle),-sin($watermark_angle),cos($watermark_angle),$watermark_x*$k,($h-$watermark_y)*$k,-$watermark_x*$k,-($h-$watermark_y)*$k)); //print watermark - $pdf->SetXY($watermark_x,$watermark_y); - $pdf->Cell($watermark_width,25,$outputlangs->convToOutputCharset($text),0,2,"C",0); + $pdf->SetXY($watermark_x_pos,$watermark_y_pos); + $pdf->Cell($w-20,25,$outputlangs->convToOutputCharset($text),"",2,"C",0); //antirotate $pdf->_out('Q'); + + $pdf->SetXY($savx,$savy); } From 2f112efad51c31c134503ab091a9e009d4a551b2 Mon Sep 17 00:00:00 2001 From: Florian Henry Date: Thu, 25 Jul 2013 20:18:45 +0200 Subject: [PATCH 03/19] Avoid php warning if extrafield list from table have bad settings --- htdocs/core/class/extrafields.class.php | 111 +++++++++++++----------- 1 file changed, 58 insertions(+), 53 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index ceca4575f50..1d24a8b55c1 100755 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -677,49 +677,52 @@ class ExtraFields } elseif ($type == 'sellist') { + $out=''; } @@ -824,23 +827,25 @@ class ExtraFields } elseif ($type == 'sellist') { - $param_list=array_keys($params['options']); - $InfoFieldList = explode(":", $param_list[0]); - $keyList='rowid'; - if (count($InfoFieldList)==3) - $keyList=$InfoFieldList[2]; - - - $sql = 'SELECT '.$InfoFieldList[1]; - $sql.= ' FROM '.MAIN_DB_PREFIX .$InfoFieldList[0]; - $sql.= ' WHERE '.$keyList.'=\''.$this->db->escape($value).'\''; - //$sql.= ' AND entity = '.$conf->entity; - dol_syslog(get_class($this).':showOutputField:$type=sellist sql='.$sql); - $resql = $this->db->query($sql); - if ($resql) - { - $obj = $this->db->fetch_object($resql); - $value=$obj->$InfoFieldList[1]; + if (is_array($params['options'])) { + $param_list=array_keys($params['options']); + $InfoFieldList = explode(":", $param_list[0]); + $keyList='rowid'; + if (count($InfoFieldList)==3) + $keyList=$InfoFieldList[2]; + + + $sql = 'SELECT '.$InfoFieldList[1]; + $sql.= ' FROM '.MAIN_DB_PREFIX .$InfoFieldList[0]; + $sql.= ' WHERE '.$keyList.'=\''.$this->db->escape($value).'\''; + //$sql.= ' AND entity = '.$conf->entity; + dol_syslog(get_class($this).':showOutputField:$type=sellist sql='.$sql); + $resql = $this->db->query($sql); + if ($resql) + { + $obj = $this->db->fetch_object($resql); + $value=$obj->$InfoFieldList[1]; + } } } elseif ($type == 'radio') From 95bc40d0df2860fe9b69ff5aadd0eef1dc2c9a5b Mon Sep 17 00:00:00 2001 From: jfefe Date: Fri, 26 Jul 2013 08:51:22 +0200 Subject: [PATCH 04/19] Missing attribute to indicate required fields --- htdocs/core/class/commonobject.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index d8b3e923781..25248dd21a4 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2242,6 +2242,10 @@ abstract class CommonObject { $value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$this->db->jdate($this->array_options['options_'.$key]); } + + if($extrafields->attribute_required[$key]) + $label = ''.$label.''; + $out .= ''.$label.''; $out .=''; From e82b8e9b9e54fbf0c32097d25089950eb60cc280 Mon Sep 17 00:00:00 2001 From: Florian Henry Date: Fri, 26 Jul 2013 12:16:39 +0200 Subject: [PATCH 05/19] Fix [ bug #990 ] Filter + sort does not work on order list --- htdocs/fourn/commande/liste.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/fourn/commande/liste.php b/htdocs/fourn/commande/liste.php index ce998889778..76270c8ea20 100644 --- a/htdocs/fourn/commande/liste.php +++ b/htdocs/fourn/commande/liste.php @@ -132,12 +132,12 @@ if ($resql) print '
'; print ''; print ''; - print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"cf.ref","","",'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","",'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Author"),$_SERVER["PHP_SELF"],"u.login","","",'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"total_ttc","","",'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("OrderDate"),$_SERVER["PHP_SELF"],"dc","","",'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"cf.fk_statut","","",'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"cf.ref","",$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Author"),$_SERVER["PHP_SELF"],"u.login","",$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"total_ttc","",$param,$sortfield,$sortorder); + print_liste_field_titre($langs->trans("OrderDate"),$_SERVER["PHP_SELF"],"dc","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"cf.fk_statut","",$param,'align="right"',$sortfield,$sortorder); print "\n"; print ''; From 116988febdc7128831bb04305005c1d7b8a86677 Mon Sep 17 00:00:00 2001 From: Florian Henry Date: Fri, 26 Jul 2013 12:49:11 +0200 Subject: [PATCH 06/19] =?UTF-8?q?=20Fix=20[=20bug=20#1001=20]=20Charge=20s?= =?UTF-8?q?ociale=20:=20=C3=A9tat=20incorrect?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/compta/payment_sc/fiche.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/payment_sc/fiche.php b/htdocs/compta/payment_sc/fiche.php index 0bf129c567b..a5c1e8f07b2 100644 --- a/htdocs/compta/payment_sc/fiche.php +++ b/htdocs/compta/payment_sc/fiche.php @@ -262,7 +262,7 @@ if ($resql) // Expected to pay print ''; // Status - print ''; + print ''; // Amount payed print ''; print "\n"; From 8721b7cfa73379b0268fe958add700999ed390c8 Mon Sep 17 00:00:00 2001 From: Florian Henry Date: Fri, 26 Jul 2013 12:51:28 +0200 Subject: [PATCH 07/19] =?UTF-8?q?Fix=20=20[=20bug=20#1001=20]=20Charge=20s?= =?UTF-8?q?ociale=20:=20=C3=A9tat=20incorrect?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/compta/payment_sc/fiche.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/payment_sc/fiche.php b/htdocs/compta/payment_sc/fiche.php index c8d710e2831..0ad3eaf8622 100644 --- a/htdocs/compta/payment_sc/fiche.php +++ b/htdocs/compta/payment_sc/fiche.php @@ -262,7 +262,7 @@ if ($resql) // Expected to pay print ''; // Status - print ''; + print ''; // Amount payed print ''; print "\n"; From 7af45ccdf3abafdd8939b7d1abaac6785b3a8c49 Mon Sep 17 00:00:00 2001 From: Florian Henry Date: Fri, 26 Jul 2013 12:52:51 +0200 Subject: [PATCH 08/19] update changelog --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 59549e19355..06189a39564 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,7 @@ English Dolibarr ChangeLog - Fix: [ bug #903 ] Fatal error: Call to undefined function dol_get_first_day() in htdocs/commande/liste.php - Fix: [ bug #934 ] Error on proformat invoice creation (pgsql) - Fix: [ bug #947 ] Can't create proposal lines with unit price = 0 +- Fix: [ bug #1001 ] Social Contribution : State not correct ***** ChangeLog for 3.3.2 compared to 3.3.1 ***** From c431fc716f0c8b4fd463c2f67712a644bfa50469 Mon Sep 17 00:00:00 2001 From: jfefe Date: Fri, 26 Jul 2013 10:46:45 +0200 Subject: [PATCH 09/19] Check if an required extrafield is filled. Method setOptionalsFromPost now return -1 if required field is blank --- htdocs/core/class/extrafields.class.php | 37 +++++++++++++++++-------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 1d24a8b55c1..177bd82c1af 100755 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -677,28 +677,28 @@ class ExtraFields } elseif ($type == 'sellist') { - + $out=''; + $out.= ''; if ($delallowed) { From d0af692ed58153954aba0aa010259f81c3695c88 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Jul 2013 15:23:41 +0200 Subject: [PATCH 12/19] Fix: date must be reported according to user timezone Conflicts: htdocs/core/class/html.formfile.class.php --- htdocs/core/class/html.formfile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 78b83a927cd..05e1e32a409 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -483,7 +483,7 @@ class FormFile // Show file date $date=(! empty($file['date'])?$file['date']:dol_filemtime($filedir."/".$file["name"])); - $out.= ''; + $out.= ''; if ($delallowed) { From 473541f19d957e2ccdd6147211761b44c63173a1 Mon Sep 17 00:00:00 2001 From: jfefe Date: Fri, 26 Jul 2013 15:41:17 +0200 Subject: [PATCH 13/19] Fix : bad test field when checking extrafield is required --- htdocs/core/class/extrafields.class.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 177bd82c1af..096928d5cbc 100755 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -904,8 +904,7 @@ class ExtraFields foreach ($extralabels as $key => $value) { $key_type = $this->attribute_type[$key]; - - if($this->attribute_required[$key] && !GETPOST($value)) + if($this->attribute_required[$key] && !GETPOST("options_$key",2)) { $nofillrequired++; $error_field_required[] = $value; From 020c0f33a0ef4129d3870c5aac61f2114ca081d9 Mon Sep 17 00:00:00 2001 From: jfefe Date: Fri, 26 Jul 2013 15:42:32 +0200 Subject: [PATCH 14/19] Check required extrafields on proposals --- htdocs/comm/propal.php | 108 +++++++++++++++++++++++------------------ 1 file changed, 60 insertions(+), 48 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 9420a7d992f..33fed6c76d1 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -331,7 +331,7 @@ else if ($action == 'add' && $user->rights->propal->creer) $object->origin = GETPOST('origin'); $object->origin_id = GETPOST('originid'); - for ($i = 1 ; $i <= $conf->global->PRODUCT_SHOW_WHEN_CREATE; $i++) + for ($i = 1; $i <= $conf->global->PRODUCT_SHOW_WHEN_CREATE; $i++) { if ($_POST['idprod'.$i]) { @@ -344,55 +344,61 @@ else if ($action == 'add' && $user->rights->propal->creer) // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels,$object); - - $id = $object->create($user); + if($ret < 0) { + $error++; + $action = 'create'; + } } - if ($id > 0) - { - // Insertion contact par defaut si defini - if (GETPOST('contactidp') > 0) - { - $result=$object->add_contact(GETPOST('contactidp'),'CUSTOMER','external'); - if ($result < 0) - { - $error++; - setEventMessage($langs->trans("ErrorFailedToAddContact"), 'errors'); - } - } + if(!$error) { + $id = $object->create($user); - if (! $error) + if ($id > 0) { - $db->commit(); - - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + // Insertion contact par defaut si defini + if (GETPOST('contactidp') > 0) { - // Define output language - $outputlangs = $langs; - if (! empty($conf->global->MAIN_MULTILANGS)) + $result=$object->add_contact(GETPOST('contactidp'),'CUSTOMER','external'); + if ($result < 0) { - $outputlangs = new Translate("",$conf); - $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); - $outputlangs->setDefaultLang($newlang); + $error++; + setEventMessage($langs->trans("ErrorFailedToAddContact"), 'errors'); } - $ret=$object->fetch($id); // Reload to get new records - propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); } - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); - exit; + if (! $error) + { + $db->commit(); + + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + // Define output language + $outputlangs = $langs; + if (! empty($conf->global->MAIN_MULTILANGS)) + { + $outputlangs = new Translate("",$conf); + $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); + $outputlangs->setDefaultLang($newlang); + } + $ret=$object->fetch($id); // Reload to get new records + propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + } + + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); + exit; + } + else + { + $db->rollback(); + } } else { + dol_print_error($db,$object->error); $db->rollback(); + exit; } } - else - { - dol_print_error($db,$object->error); - $db->rollback(); - exit; - } } } @@ -1121,24 +1127,30 @@ else if ($action == 'update_extras') $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); $ret = $extrafields->setOptionalsFromPost($extralabels,$object); - // Actions on extra fields (by external module or standard code) - // FIXME le hook fait double emploi avec le trigger !! - $hookmanager->initHooks(array('propaldao')); - $parameters=array('id'=>$object->id); - $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks - if (empty($reshook)) - { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if($ret < 0) { + $error++; + $action = 'edit_extras'; + } + + if(!$error) { + // Actions on extra fields (by external module or standard code) + // FIXME le hook fait double emploi avec le trigger !! + $hookmanager->initHooks(array('propaldao')); + $parameters=array('id'=>$object->id); + $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + if (empty($reshook)) { - $result=$object->insertExtraFields(); - if ($result < 0) + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used { - $error++; + $result=$object->insertExtraFields(); + if ($result < 0) + { + $error++; + } } } + else if ($reshook < 0) $error++; } - else if ($reshook < 0) $error++; - } if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->propal->creer) From bddbc6f6b211ff81d0d0f6f7d28c5985969bef99 Mon Sep 17 00:00:00 2001 From: jfefe Date: Fri, 26 Jul 2013 16:02:48 +0200 Subject: [PATCH 15/19] Fix : show input fields if missing required extrafield when editing invoice --- htdocs/compta/facture.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index dd7015227ba..b995fb8f44c 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1881,6 +1881,10 @@ if ($action == 'update_extras') } else if ($reshook < 0) $error++; } + else + { + $action = 'edit_extras'; + } } From 7ee4e4271038686b516db576224f14f43afe2c46 Mon Sep 17 00:00:00 2001 From: jfefe Date: Fri, 26 Jul 2013 16:04:09 +0200 Subject: [PATCH 16/19] Check required extrafields on orders --- htdocs/commande/fiche.php | 212 +++++++++++++++++++++----------------- 1 file changed, 117 insertions(+), 95 deletions(-) diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 2926a040298..907977d7cbd 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -275,117 +275,130 @@ else if ($action == 'add' && $user->rights->commande->creer) // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels,$object); + if($ret < 0) + $error++; - $object_id = $object->create($user); + if(!$error) { + $object_id = $object->create($user); - if ($object_id > 0) - { - dol_include_once('/'.$element.'/class/'.$subelement.'.class.php'); - - $classname = ucfirst($subelement); - $srcobject = new $classname($db); - - dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines"); - $result=$srcobject->fetch($object->origin_id); - if ($result > 0) + if ($object_id > 0) { - $lines = $srcobject->lines; - if (empty($lines) && method_exists($srcobject,'fetch_lines')) $lines = $srcobject->fetch_lines(); + dol_include_once('/'.$element.'/class/'.$subelement.'.class.php'); - $fk_parent_line=0; - $num=count($lines); + $classname = ucfirst($subelement); + $srcobject = new $classname($db); - for ($i=0;$i<$num;$i++) + dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines"); + $result=$srcobject->fetch($object->origin_id); + if ($result > 0) { - $label=(! empty($lines[$i]->label)?$lines[$i]->label:''); - $desc=(! empty($lines[$i]->desc)?$lines[$i]->desc:$lines[$i]->libelle); - $product_type=(! empty($lines[$i]->product_type)?$lines[$i]->product_type:0); + $lines = $srcobject->lines; + if (empty($lines) && method_exists($srcobject,'fetch_lines')) $lines = $srcobject->fetch_lines(); - // Dates - // TODO mutualiser - $date_start=$lines[$i]->date_debut_prevue; - if ($lines[$i]->date_debut_reel) $date_start=$lines[$i]->date_debut_reel; - if ($lines[$i]->date_start) $date_start=$lines[$i]->date_start; - $date_end=$lines[$i]->date_fin_prevue; - if ($lines[$i]->date_fin_reel) $date_end=$lines[$i]->date_fin_reel; - if ($lines[$i]->date_end) $date_end=$lines[$i]->date_end; + $fk_parent_line=0; + $num=count($lines); - // Reset fk_parent_line for no child products and special product - if (($lines[$i]->product_type != 9 && empty($lines[$i]->fk_parent_line)) || $lines[$i]->product_type == 9) { - $fk_parent_line = 0; - } - - $result = $object->addline( - $object_id, - $desc, - $lines[$i]->subprice, - $lines[$i]->qty, - $lines[$i]->tva_tx, - $lines[$i]->localtax1_tx, - $lines[$i]->localtax2_tx, - $lines[$i]->fk_product, - $lines[$i]->remise_percent, - $lines[$i]->info_bits, - $lines[$i]->fk_remise_except, - 'HT', - 0, - $date_start, - $date_end, - $product_type, - $lines[$i]->rang, - $lines[$i]->special_code, - $fk_parent_line, - $lines[$i]->fk_fournprice, - $lines[$i]->pa_ht, - $label - ); - - if ($result < 0) + for ($i=0;$i<$num;$i++) { - $error++; - break; + $label=(! empty($lines[$i]->label)?$lines[$i]->label:''); + $desc=(! empty($lines[$i]->desc)?$lines[$i]->desc:$lines[$i]->libelle); + $product_type=(! empty($lines[$i]->product_type)?$lines[$i]->product_type:0); + + // Dates + // TODO mutualiser + $date_start=$lines[$i]->date_debut_prevue; + if ($lines[$i]->date_debut_reel) $date_start=$lines[$i]->date_debut_reel; + if ($lines[$i]->date_start) $date_start=$lines[$i]->date_start; + $date_end=$lines[$i]->date_fin_prevue; + if ($lines[$i]->date_fin_reel) $date_end=$lines[$i]->date_fin_reel; + if ($lines[$i]->date_end) $date_end=$lines[$i]->date_end; + + // Reset fk_parent_line for no child products and special product + if (($lines[$i]->product_type != 9 && empty($lines[$i]->fk_parent_line)) || $lines[$i]->product_type == 9) { + $fk_parent_line = 0; + } + + $result = $object->addline( + $object_id, + $desc, + $lines[$i]->subprice, + $lines[$i]->qty, + $lines[$i]->tva_tx, + $lines[$i]->localtax1_tx, + $lines[$i]->localtax2_tx, + $lines[$i]->fk_product, + $lines[$i]->remise_percent, + $lines[$i]->info_bits, + $lines[$i]->fk_remise_except, + 'HT', + 0, + $date_start, + $date_end, + $product_type, + $lines[$i]->rang, + $lines[$i]->special_code, + $fk_parent_line, + $lines[$i]->fk_fournprice, + $lines[$i]->pa_ht, + $label + ); + + if ($result < 0) + { + $error++; + break; + } + + // Defined the new fk_parent_line + if ($result > 0 && $lines[$i]->product_type == 9) { + $fk_parent_line = $result; + } } - // Defined the new fk_parent_line - if ($result > 0 && $lines[$i]->product_type == 9) { - $fk_parent_line = $result; - } + // Hooks + $parameters=array('objFrom'=>$srcobject); + $reshook=$hookmanager->executeHooks('createFrom',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + if ($reshook < 0) $error++; + } + else + { + $mesg=$srcobject->error; + $error++; } - - // Hooks - $parameters=array('objFrom'=>$srcobject); - $reshook=$hookmanager->executeHooks('createFrom',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - if ($reshook < 0) $error++; } else { - $mesg=$srcobject->error; + $mesg=$object->error; $error++; } } else { - $mesg=$object->error; - $error++; + // Required extrafield left blank, error message already defined by setOptionalsFromPost() + $action='create'; } } else { // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels,$object); + if($ret < 0) + $error++; - $object_id = $object->create($user); + if(!$error) { + $object_id = $object->create($user); - // If some invoice's lines already known - $NBLINES=8; - for ($i = 1 ; $i <= $NBLINES ; $i++) - { - if ($_POST['idprod'.$i]) + // If some invoice's lines already known + $NBLINES=8; + for ($i = 1 ; $i <= $NBLINES ; $i++) { - $xid = 'idprod'.$i; - $xqty = 'qty'.$i; - $xremise = 'remise_percent'.$i; - $object->add_product($_POST[$xid],$_POST[$xqty],$_POST[$xremise]); + if ($_POST['idprod'.$i]) + { + $xid = 'idprod'.$i; + $xqty = 'qty'.$i; + $xremise = 'remise_percent'.$i; + $object->add_product($_POST[$xid],$_POST[$xqty],$_POST[$xremise]); + } } } } @@ -1130,23 +1143,32 @@ else if ($action == 'update_extras') $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); $ret = $extrafields->setOptionalsFromPost($extralabels,$object); - // Actions on extra fields (by external module or standard code) - // FIXME le hook fait double emploi avec le trigger !! - $hookmanager->initHooks(array('orderdao')); - $parameters=array('id'=>$object->id); - $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks - if (empty($reshook)) - { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if($ret < 0) + $error++; + + if(!$error) { + // Actions on extra fields (by external module or standard code) + // FIXME le hook fait double emploi avec le trigger !! + $hookmanager->initHooks(array('orderdao')); + $parameters=array('id'=>$object->id); + $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + if (empty($reshook)) { - $result=$object->insertExtraFields(); - if ($result < 0) + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used { - $error++; + $result=$object->insertExtraFields(); + if ($result < 0) + { + $error++; + } } } + else if ($reshook < 0) $error++; + } + else + { + $action = 'edit_extras'; } - else if ($reshook < 0) $error++; } @@ -1335,7 +1357,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G } } -if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->commande->creer) +if (! $error && ! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->commande->creer) { if ($action == 'addcontact') { From ae9c3cd780dca1de208cf736185d46960e87b506 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Jul 2013 16:43:06 +0200 Subject: [PATCH 17/19] Prepare 3.3.4 --- build/debian/changelog | 2 +- build/exe/doliwamp/doliwamp.iss | 4 ++-- build/makepack-dolibarr.pl | 2 +- build/rpm/dolibarr_fedora.spec | 2 +- build/rpm/dolibarr_generic.spec | 2 +- build/rpm/dolibarr_mandriva.spec | 2 +- build/rpm/dolibarr_opensuse.spec | 2 +- htdocs/filefunc.inc.php | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build/debian/changelog b/build/debian/changelog index d364648aadc..b8b2826d43c 100644 --- a/build/debian/changelog +++ b/build/debian/changelog @@ -1,4 +1,4 @@ -dolibarr (3.3.3+nmu1) unstable; urgency=low +dolibarr (3.3.4+nmu1) unstable; urgency=low * Non-maintainer upload. * New upstream release. diff --git a/build/exe/doliwamp/doliwamp.iss b/build/exe/doliwamp/doliwamp.iss index 90d0595b41b..e2940f68c87 100644 --- a/build/exe/doliwamp/doliwamp.iss +++ b/build/exe/doliwamp/doliwamp.iss @@ -17,9 +17,9 @@ ; ----- Change this ----- AppName=DoliWamp ; DoliWamp-x.x.x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x -AppVerName=DoliWamp-3.3.3 +AppVerName=DoliWamp-3.3.4 ; DoliWamp-x.x x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x -OutputBaseFilename=DoliWamp-3.3.3 +OutputBaseFilename=DoliWamp-3.3.4 ; Define full path from wich all relative path are defined ; You must modify this to put here your dolibarr root directory ;SourceDir=C:\Documents and Settings\ldestailleur\git\dolibarr_old diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 2510da50a08..fe171e3f32a 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -10,7 +10,7 @@ use Cwd; $PROJECT="dolibarr"; $MAJOR="3"; $MINOR="3"; -$BUILD="3"; # Mettre x pour release, x-dev pour dev, x-beta pour beta, x-rc pour release candidate +$BUILD="4"; # Mettre x pour release, x-dev pour dev, x-beta pour beta, x-rc pour release candidate $RPMSUBVERSION="auto"; # auto use value found into BUILD @LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index 69553f983b1..16f72b5784d 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -335,5 +335,5 @@ fi %changelog -* Mon Apr 22 2013 Laurent Destailleur 3.3.3-0.3 +* Mon Apr 22 2013 Laurent Destailleur 3.3.4-0.3 - Initial version (#723326) diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index 7e0c426a53d..fe091c37734 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -544,5 +544,5 @@ fi %changelog -* Mon Apr 22 2013 Laurent Destailleur 3.3.3-0.3 +* Mon Apr 22 2013 Laurent Destailleur 3.3.4-0.3 - Initial version (#723326) diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index 04ce7640657..518723e35a2 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -333,5 +333,5 @@ fi %changelog -* Mon Apr 22 2013 Laurent Destailleur 3.3.3-0.3 +* Mon Apr 22 2013 Laurent Destailleur 3.3.4-0.3 - Initial version (#723326) diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index 3a35aaa9bc6..ad7f0d933ba 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -338,5 +338,5 @@ fi %changelog -* Mon Apr 22 2013 Laurent Destailleur 3.3.3-0.3 +* Mon Apr 22 2013 Laurent Destailleur 3.3.4-0.3 - Initial version (#723326) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 5249c47e4ea..f27b144fe17 100755 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -29,7 +29,7 @@ * \brief File that include conf.php file and commons lib like functions.lib.php */ -if (! defined('DOL_VERSION')) define('DOL_VERSION','3.3.3'); +if (! defined('DOL_VERSION')) define('DOL_VERSION','3.3.4'); if (! defined('EURO')) define('EURO',chr(128)); // Define syslog constants From 14dfbfc40ced01162b02438fa464b356f5b15259 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 27 Jul 2013 13:29:06 +0200 Subject: [PATCH 18/19] Fix: W3C (form into tr make some browsers crazy) --- htdocs/core/tpl/contacts.tpl.php | 124 +++++++++++++++---------------- 1 file changed, 61 insertions(+), 63 deletions(-) diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index e085342cf19..dc97d84e9b6 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2012 Regis Houssin + * Copyright (C) 2013 Laurent Destailleur * * 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 @@ -13,7 +14,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * */ if (! class_exists('Contact')) { @@ -40,83 +40,81 @@ $userstatic=new User($db); ?> -
'.price($objp->sc_amount).''.$socialcontrib->LibStatut($objp->fk_statut,2).''.$socialcontrib->getLibStatut(4).''.price($objp->amount).'
'.price($objp->sc_amount).''.$socialcontrib->LibStatut($objp->fk_statut,2).''.$socialcontrib->getLibStatut(4).''.price($objp->amount).'
'.dol_print_date($date, 'dayhour').''.dol_print_date($date, 'dayhour', 'tzuser').''.dol_print_date($date, 'dayhour').''.dol_print_date($date, 'dayhour', 'tzuser').'
+
-
- - - - - - + +
trans("Source"); ?>
+
trans("Company"); ?>
+
trans("Contacts"); ?>
+
trans("ContactType"); ?>
+
 
+
 
+ - " /> - - > - - - - - - +
trans("Users"); ?>
+
global->MAIN_INFO_SOCIETE_NOM; ?>
+
select_dolusers($user->id, 'userid', 0, (! empty($userAlreadySelected)?$userAlreadySelected:null), 0, null, null, 0, 56); ?>
+
selectTypeContact($object, '', 'type','internal'); ?>
+
 
+
">
- " /> - - - - - > - + action="id; ?>" method="POST"> + + + + +
trans("ThirdPartyContacts"); ?>
use_javascript_ajax && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) { ?> - - + - - + - - - + - - - - - - - - + +
trans("Source"); ?>
+
trans("Company"); ?>
+
trans("Contacts"); ?>
+
trans("ContactType"); ?>
+
trans("Status"); ?>
+
 
+ @@ -130,12 +128,12 @@ $userstatic=new User($db); $var = !$var; ?> - valign="top"> - - - - - - - + + -
trans("Source"); ?>trans("Company"); ?>trans("Contacts"); ?>trans("ContactType"); ?> 
trans("Users"); ?>global->MAIN_INFO_SOCIETE_NOM; ?>select_dolusers($user->id,'userid',0,(! empty($userAlreadySelected)?$userAlreadySelected:'')); ?>selectTypeContact($object, '', 'type','internal'); ?>">
trans("ThirdPartyContacts"); ?> +
'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php',1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled')); print $form->select_company($object->socid,'socid','',1,0,0,$events); ?> -
+ +
select_contacts($object->socid, '', 'contactid'); ?> -
+
socid; ?> selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany'); ?> -
+ +
select_contacts($selectedCompany, '', 'contactid'); ?> -
+
selectTypeContact($object, '', 'type','external'); ?> -
+ +
 
+
"> -
trans("Source"); ?>trans("Company"); ?>trans("Contacts"); ?>trans("ContactType"); ?>trans("Status"); ?> 
+
> +
trans("User"); ?> trans("ThirdPartyContact"); ?> -
+ +
0) { @@ -151,8 +149,8 @@ $userstatic=new User($db); echo ' '; } ?> -
+ +
getNomUrl(1); } ?> -
+ +
+
+ +
 "> -
- \ No newline at end of file + + From 3c6b1f17d1932068b1ebe2b0d8aa0deed7c27afd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 27 Jul 2013 14:10:57 +0200 Subject: [PATCH 19/19] Fix: print of a function that already contains the print. --- htdocs/adherents/fiche.php | 2 +- htdocs/adherents/stats/index.php | 2 +- htdocs/admin/prelevement.php | 2 +- htdocs/comm/propal/stats/index.php | 2 +- htdocs/commande/stats/index.php | 2 +- htdocs/compta/deplacement/fiche.php | 4 ++-- htdocs/compta/deplacement/stats/index.php | 2 +- htdocs/compta/facture/stats/index.php | 2 +- htdocs/contrat/fiche.php | 4 ++-- htdocs/holiday/define_holiday.php | 2 +- htdocs/projet/tasks.php | 2 +- htdocs/projet/tasks/time.php | 4 ++-- 12 files changed, 15 insertions(+), 15 deletions(-) diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index a2a9211dfe5..d297e6aad81 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -914,7 +914,7 @@ else // Login Dolibarr print ''.$langs->trans("LinkedToDolibarrUser").''; - print $form->select_users($object->user_id,'userid',1); + print $form->select_dolusers($object->user_id,'userid',1); print ''; */ diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php index 6d0fcf6bb9e..7b3260aa920 100644 --- a/htdocs/adherents/stats/index.php +++ b/htdocs/adherents/stats/index.php @@ -155,7 +155,7 @@ $filter='s.client in (1,2,3)'; print $form->select_company($id,'memberid',$filter,1); print ''; print ''.$langs->trans("User").''; -print $form->select_users($userid,'userid',1); +print $form->select_dolusers($userid,'userid',1); print ''; print ''; print ''; diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 2e21c3cfb4c..0c87c347e5c 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -142,7 +142,7 @@ print ""; print ''.$langs->trans("ResponsibleUser").''; print ''; print ''; -print $form->select_users($conf->global->PRELEVEMENT_USER,'value0',1); +print $form->select_dolusers($conf->global->PRELEVEMENT_USER,'value0',1); print ''; print ''; diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index cb35f6c782a..ec9a0f982a0 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -235,7 +235,7 @@ print '
'; print ''; // User print ''.$langs->trans("CreatedBy").''; - print $form->select_users($userid,'userid',1); + print $form->select_dolusers($userid,'userid',1); print ''; // Year print ''.$langs->trans("Year").''; diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index 85bbaae9ef2..d6e1d471139 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -257,7 +257,7 @@ print '
'; print ''; // User print ''.$langs->trans("CreatedBy").''; - print $form->select_users($userid,'userid',1); + print $form->select_dolusers($userid,'userid',1); print ''; // Year print ''.$langs->trans("Year").''; diff --git a/htdocs/compta/deplacement/fiche.php b/htdocs/compta/deplacement/fiche.php index b09754c2405..958aed0b90a 100644 --- a/htdocs/compta/deplacement/fiche.php +++ b/htdocs/compta/deplacement/fiche.php @@ -281,7 +281,7 @@ if ($action == 'create') print ""; print ''.$langs->trans("Person").''; - print $form->select_users(GETPOST('fk_user','int'),'fk_user',1); + print $form->select_dolusers(GETPOST('fk_user','int'),'fk_user',1); print ''; print ""; @@ -376,7 +376,7 @@ else if ($id) // Who print ""; print ''.$langs->trans("Person").''; - print $form->select_users(GETPOST('fk_user','int')?GETPOST('fk_user','int'):$object->fk_user,'fk_user',0); + print $form->select_dolusers(GETPOST('fk_user','int')?GETPOST('fk_user','int'):$object->fk_user,'fk_user',0); print ''; // Date diff --git a/htdocs/compta/deplacement/stats/index.php b/htdocs/compta/deplacement/stats/index.php index d6c1465937f..8c1b9e2d832 100755 --- a/htdocs/compta/deplacement/stats/index.php +++ b/htdocs/compta/deplacement/stats/index.php @@ -220,7 +220,7 @@ print $form->select_company($socid,'socid',$filter,1,1); print ''; // User print ''.$langs->trans("User").'/'.$langs->trans("SalesRepresentative").''; -print $form->select_users($userid,'userid',1); +print $form->select_dolusers($userid,'userid',1); print ''; // Year print ''.$langs->trans("Year").''; diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index af45fb24ca7..9dfd38c4a82 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -235,7 +235,7 @@ print '
'; print ''; // User print ''.$langs->trans("CreatedBy").''; - print $form->select_users($userid,'userid',1); + print $form->select_dolusers($userid,'userid',1); print ''; // Year print ''.$langs->trans("Year").''; diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index 77553e67d13..d49fb69c32e 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -850,12 +850,12 @@ if ($action == 'create') // Commercial suivi print ''.$langs->trans("TypeContact_contrat_internal_SALESREPFOLL").''; - print $form->select_users(GETPOST("commercial_suivi_id")?GETPOST("commercial_suivi_id"):$user->id,'commercial_suivi_id',1,''); + print $form->select_dolusers(GETPOST("commercial_suivi_id")?GETPOST("commercial_suivi_id"):$user->id,'commercial_suivi_id',1,''); print ''; // Commercial signature print ''.$langs->trans("TypeContact_contrat_internal_SALESREPSIGN").''; - print $form->select_users(GETPOST("commercial_signature_id")?GETPOST("commercial_signature_id"):$user->id,'commercial_signature_id',1,''); + print $form->select_dolusers(GETPOST("commercial_signature_id")?GETPOST("commercial_signature_id"):$user->id,'commercial_signature_id',1,''); print ''; print ''.$langs->trans("Date").''; diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index 82b8003a274..ea26e5b4b36 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -133,7 +133,7 @@ if($cp_events == 1) print $langs->trans('MotifCP').' : '; print $holiday->selectEventCP(); print '   '.$langs->trans('UserCP').' : '; - print $form->select_users('',"userCP",1,"",0,''); + print $form->select_dolusers('',"userCP",1,"",0,''); print ' '; print '
'; diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index b79bb65ed74..4ed9e1b3dca 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -279,7 +279,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->socie print ''; print ''.$langs->trans("AffectedTo").''; - print $form->select_users($user->id,'userid',1); + print $form->select_dolusers($user->id,'userid',1); print ''; // Date start diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 7f32feadccb..2ed5b249625 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -318,7 +318,7 @@ if ($id > 0 || ! empty($ref)) print ''; $contactoftask=$object->getListContactId('internal'); print img_object('','user'); - print $form->select_users($_POST["userid"]?$_POST["userid"]:$user->id,'userid',0,'',0,'',$contactoftask); + print $form->select_dolusers($_POST["userid"]?$_POST["userid"]:$user->id,'userid',0,'',0,'',$contactoftask); print ''; // Note @@ -407,7 +407,7 @@ if ($id > 0 || ! empty($ref)) print ''; if ($_GET['action'] == 'editline' && $_GET['lineid'] == $task_time->rowid) { - print $form->select_users($task_time->fk_user,'userid_line'); + print $form->select_dolusers($task_time->fk_user,'userid_line'); } else {