diff --git a/ChangeLog b/ChangeLog index dafb9ae8fa1..d531ec987b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -135,7 +135,14 @@ Dolibarr better: creation of a pdf or odt, hook "afterPDFCreation" or "afterODTCreation" must be used instead. - A lot of pages called fiche.php were renamed into card.php - A lot of pages called liste.php were renamed into list.php - + + + +***** ChangeLog for 3.6.2 compared to 3.6.1 ***** +- Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice +- Fix: bug 1588 : relative discount +- Fix: label of input method not tranlated. + ***** ChangeLog for 3.6.1 compared to 3.6.* ***** For users: - Fix: Can upload files on services. @@ -154,7 +161,13 @@ For users: - Fix: Extrafield feature select from table should try to translate multiple column when not needed - Fix: cents for indian ruppes are calle paisa and paise. - Fix: Invoices payments may be older than invoices. +- Fix: Withdrawal total amount is double - Fix: [ bug #1593 ] Spanish Localtax IRPF not being calculated since 3.6.0 in supplier invoices when adding a line +- Fix: Web service categorie WDSL declaration is correct +- Fix: ErrorBadValueForParamNotAString was displayed in virtual product if no base price defined +- Fix: Category creation failed and no message output +- Fix: Lanf for Payment Type +- Fix: PHPCheckstyle 1.5.5 ***** ChangeLog for 3.6 compared to 3.5.* ***** For users: diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 0b881cedb35..0e8f2ea0fdd 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -442,6 +442,7 @@ if ($nboftargetok) { $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/nltechno*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/pos*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/teclib*`; $ret=`rm -fr $BUILDROOT/$PROJECT/test`; $ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`; $ret=`rm -f $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`; diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php index e043bff88aa..a0bb5c4b605 100644 --- a/htdocs/admin/ldap_groups.php +++ b/htdocs/admin/ldap_groups.php @@ -219,6 +219,10 @@ if (function_exists("ldap_connect")) $info=$object->_load_ldap_info(); $dn=$object->_load_ldap_dn($info); + // Get a gid number for objectclass PosixGroup + if(in_array('posixGroup',$info['objectclass'])) + $info['gidNumber'] = $ldap->getNextGroupGid(); + $result1=$ldap->delete($dn); // To be sure to delete existing records $result2=$ldap->add($dn,$info,$user); // Now the test $result3=$ldap->delete($dn); // Clean what we did diff --git a/htdocs/categories/card.php b/htdocs/categories/card.php index f09a526b327..672c92b9508 100644 --- a/htdocs/categories/card.php +++ b/htdocs/categories/card.php @@ -144,6 +144,10 @@ if ($action == 'add' && $user->rights->categorie->creer) $action = 'confirmed'; $_POST["addcat"] = ''; } + else + { + setEventMessage($object->error,'errors'); + } } } diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 34adf5d5f68..cd327d785c9 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -770,12 +770,12 @@ else if ($action == 'addline' && $user->rights->propal->creer) { // On defini prix unitaire if (! empty($conf->global->PRODUIT_MULTIPRICES) && $object->thirdparty->price_level) { - $pu_ht = $prod->multiprices [$object->thirdparty->price_level]; - $pu_ttc = $prod->multiprices_ttc [$object->thirdparty->price_level]; - $price_min = $prod->multiprices_min [$object->thirdparty->price_level]; - $price_base_type = $prod->multiprices_base_type [$object->thirdparty->price_level]; - $tva_tx=$prod->multiprices_tva_tx[$object->thirdparty->price_level]; - $tva_npr=$prod->multiprices_recuperableonly[$object->thirdparty->price_level]; + $pu_ht = $prod->multiprices[$object->thirdparty->price_level]; + $pu_ttc = $prod->multiprices_ttc[$object->thirdparty->price_level]; + $price_min = $prod->multiprices_min[$object->thirdparty->price_level]; + $price_base_type = $prod->multiprices_base_type[$object->thirdparty->price_level]; + if (isset($prod->multiprices_tva_tx[$object->thirdparty->price_level])) $tva_tx=$prod->multiprices_tva_tx[$object->thirdparty->price_level]; + if (isset($prod->multiprices_recuperableonly[$object->thirdparty->price_level])) $tva_npr=$prod->multiprices_recuperableonly[$object->thirdparty->price_level]; } elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 7140dd9d361..cdd5618c6b7 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -8,7 +8,7 @@ * Copyright (C) 2008 Raphael Bertrand * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2010-2011 Philippe Grand - * Copyright (C) 2012-214 Christophe Battarel + * Copyright (C) 2012-2014 Christophe Battarel * Copyright (C) 2013 Florian Henry * Copyright (C) 2014 Marcos García * @@ -802,7 +802,10 @@ class Propal extends CommonObject $fk_parent_line, $this->lines[$i]->fk_fournprice, $this->lines[$i]->pa_ht, - $this->lines[$i]->label + $this->lines[$i]->label, + $this->lines[$i]->date_start, + $this->lines[$i]->date_end, + $this->lines[$i]->array_options ); if ($result < 0) @@ -932,6 +935,10 @@ class Propal extends CommonObject $this->db->begin(); + // get extrafields so they will be clone + foreach($this->lines as $line) + $line->fetch_optionals($line->rowid); + // Load source object $objFrom = dol_clone($this); @@ -1070,7 +1077,7 @@ class Propal extends CommonObject $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_input_reason as dr ON p.fk_input_reason = dr.rowid'; $sql.= " WHERE p.fk_statut = c.id"; $sql.= " AND p.entity = ".$conf->entity; - if ($ref) $sql.= " AND p.ref='".$this->db->escape($ref)."'"; + if ($ref) $sql.= " AND p.ref='".$ref."'"; else $sql.= " AND p.rowid=".$rowid; dol_syslog(get_class($this)."::fetch", LOG_DEBUG); diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 92fed596819..136ade4df3c 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -600,10 +600,12 @@ else if ($action == 'addline' && $user->rights->commande->creer) { // multiprix if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->thirdparty->price_level)) { - $pu_ht = $prod->multiprices [$object->thirdparty->price_level]; - $pu_ttc = $prod->multiprices_ttc [$object->thirdparty->price_level]; - $price_min = $prod->multiprices_min [$object->thirdparty->price_level]; - $price_base_type = $prod->multiprices_base_type [$object->thirdparty->price_level]; + $pu_ht = $prod->multiprices[$object->thirdparty->price_level]; + $pu_ttc = $prod->multiprices_ttc[$object->thirdparty->price_level]; + $price_min = $prod->multiprices_min[$object->thirdparty->price_level]; + $price_base_type = $prod->multiprices_base_type[$object->thirdparty->price_level]; + if (isset($prod->multiprices_tva_tx[$object->client->price_level])) $tva_tx=$prod->multiprices_tva_tx[$object->client->price_level]; + if (isset($prod->multiprices_recuperableonly[$object->client->price_level])) $tva_npr=$prod->multiprices_recuperableonly[$object->client->price_level]; $tva_tx=$prod->multiprices_tva_tx[$object->thirdparty->price_level]; $tva_npr=$prod->multiprices_recuperableonly[$object->thirdparty->price_level]; } @@ -616,14 +618,20 @@ else if ($action == 'addline' && $user->rights->commande->creer) { $filter = array('t.fk_product' => $prod->id,'t.fk_soc' => $object->thirdparty->id); $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); - if ($result) { - if (count($prodcustprice->lines) > 0) { + if ($result >= 0) + { + if (count($prodcustprice->lines) > 0) + { $pu_ht = price($prodcustprice->lines [0]->price); $pu_ttc = price($prodcustprice->lines [0]->price_ttc); $price_base_type = $prodcustprice->lines [0]->price_base_type; $prod->tva_tx = $prodcustprice->lines [0]->tva_tx; } } + else + { + setEventMessage($prodcustprice->error,'errors'); + } } // if price ht is forced (ie: calculated by margin rate and cost price) @@ -1875,9 +1883,9 @@ if ($action == 'create' && $user->rights->commande->creer) { // Local taxes if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) - $nbrow ++; + $nbrow++; if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0 ) - $nbrow ++; + $nbrow++; print ''; @@ -2529,7 +2537,7 @@ if ($action == 'create' && $user->rights->commande->creer) { if (is_array($contactarr) && count($contactarr) > 0) { foreach ($contactarr as $contact) { - if ($contact ['libelle'] == $langs->trans('TypeContact_commande_external_CUSTOMER')) { // TODO Use code and not label + if ($contact['libelle'] == $langs->trans('TypeContact_commande_external_CUSTOMER')) { // TODO Use code and not label $contactstatic = new Contact($db); $contactstatic->fetch($contact ['id']); $custcontact = $contactstatic->getFullName($langs, 1); @@ -2537,15 +2545,15 @@ if ($action == 'create' && $user->rights->commande->creer) { } if (! empty($custcontact)) { - $formmail->substit ['__CONTACTCIVNAME__'] = $custcontact; + $formmail->substit['__CONTACTCIVNAME__'] = $custcontact; } } // Tableau des parametres complementaires - $formmail->param ['action'] = 'send'; - $formmail->param ['models'] = 'order_send'; - $formmail->param ['orderid'] = $object->id; - $formmail->param ['returnurl'] = $_SERVER["PHP_SELF"] . '?id=' . $object->id; + $formmail->param['action'] = 'send'; + $formmail->param['models'] = 'order_send'; + $formmail->param['orderid'] = $object->id; + $formmail->param['returnurl'] = $_SERVER["PHP_SELF"] . '?id=' . $object->id; // Init list of files if (GETPOST("mode") == 'init') { diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index a86162c5775..25c8a1d11c3 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -5,7 +5,7 @@ * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2011 Jean Heimburger - * Copyright (C) 2012 Christophe Battarel + * Copyright (C) 2012-2014 Christophe Battarel * Copyright (C) 2013 Florian Henry * Copyright (C) 2014 Marcos García * @@ -726,7 +726,8 @@ class Commande extends CommonOrder $fk_parent_line, $this->lines[$i]->fk_fournprice, $this->lines[$i]->pa_ht, - $this->lines[$i]->label + $this->lines[$i]->label, + $this->lines[$i]->array_options ); if ($result < 0) { @@ -863,6 +864,10 @@ class Commande extends CommonOrder $this->db->begin(); + // get extrafields so they will be clone + foreach($this->lines as $line) + $line->fetch_optionals($line->rowid); + // Load source object $objFrom = dol_clone($this); diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index a358598264e..9b727f15e5e 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1201,8 +1201,8 @@ else if ($action == 'addline' && $user->rights->facture->creer) $pu_ttc = $prod->multiprices_ttc[$object->thirdparty->price_level]; $price_min = $prod->multiprices_min[$object->thirdparty->price_level]; $price_base_type = $prod->multiprices_base_type[$object->thirdparty->price_level]; - //$tva_tx=$prod->multiprices_tva_tx[$object->thirdparty->price_level]; - //$tva_npr=$prod->multiprices_recuperableonly[$object->thirdparty->price_level]; + if (isset($prod->multiprices_tva_tx[$object->thirdparty->price_level])) $tva_tx=$prod->multiprices_tva_tx[$object->thirdparty->price_level]; + if (isset($prod->multiprices_recuperableonly[$object->thirdparty->price_level])) $tva_npr=$prod->multiprices_recuperableonly[$object->thirdparty->price_level]; } elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 193443dd64d..e07881d73db 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -8,7 +8,7 @@ * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2010-2014 Juanjo Menent - * Copyright (C) 2012 Christophe Battarel + * Copyright (C) 2012-2014 Christophe Battarel * Copyright (C) 2012-2014 Marcos García * Copyright (C) 2013 Cedric Gross * Copyright (C) 2013 Florian Henry @@ -394,7 +394,7 @@ class Facture extends CommonInvoice $this->lines[$i]->fk_fournprice, $this->lines[$i]->pa_ht, $this->lines[$i]->label, - '' + $this->lines[$i]->array_options ); if ($result < 0) { @@ -591,6 +591,10 @@ class Facture extends CommonInvoice $this->db->begin(); + // get extrafields so they will be clone + foreach($this->lines as $line) + $line->fetch_optionals($line->rowid); + // Load source object $objFrom = dol_clone($this); diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index ed5b123d923..87bab387344 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2010-2014 Laurent Destailleur + * Copyright (C) 2014 Ferran Marcet * * 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 @@ -1342,7 +1343,7 @@ class BonPrelevement extends CommonObject fputs($this->file, ' '.$CrLf); fputs($this->file, ''.$CrLf); - $sql = "SELECT pl.amount"; + /*$sql = "SELECT pl.amount"; $sql.= " FROM"; $sql.= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,"; $sql.= " ".MAIN_DB_PREFIX."facture as f,"; @@ -1368,7 +1369,7 @@ class BonPrelevement extends CommonObject else { $result = -2; - } + }*/ } diff --git a/htdocs/compta/sociales/charges.php b/htdocs/compta/sociales/charges.php index af070901517..afe2c27a3be 100644 --- a/htdocs/compta/sociales/charges.php +++ b/htdocs/compta/sociales/charges.php @@ -350,7 +350,7 @@ if ($id > 0) * Payments */ $sql = "SELECT p.rowid, p.num_paiement, datep as dp, p.amount,"; - $sql.= "c.libelle as paiement_type"; + $sql.= "c.code as type_code,c.libelle as paiement_type"; $sql.= " FROM ".MAIN_DB_PREFIX."paiementcharge as p"; $sql.= ", ".MAIN_DB_PREFIX."c_paiement as c "; $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; @@ -383,8 +383,9 @@ if ($id > 0) print "'; print '\n"; - print "\n"; - print '\n"; + $labeltype=$langs->trans("PaymentType".$objp->type_code)!=("PaymentType".$objp->type_code)?$langs->trans("PaymentType".$objp->type_code):$objp->paiement_type; + print "\n"; + print '\n"; print ""; $totalpaye += $objp->amount; $i++; diff --git a/htdocs/core/actions_extrafields.inc.php b/htdocs/core/actions_extrafields.inc.php index 55a538a2195..89edfcbae8e 100644 --- a/htdocs/core/actions_extrafields.inc.php +++ b/htdocs/core/actions_extrafields.inc.php @@ -28,7 +28,7 @@ $extrasize=GETPOST('size'); if (GETPOST('type')=='double' && strpos($extrasize,',')===false) $extrasize='24,8'; if (GETPOST('type')=='date') $extrasize=''; if (GETPOST('type')=='datetime') $extrasize=''; -if (GETPOST('type')=='select') $extrasize=''; +if (GETPOST('type')=='select') $extrasize=''; // Add attribute @@ -87,7 +87,7 @@ if ($action == 'add') $mesg[]=$langs->trans("ErrorNoValueForRadioType"); $action = 'create'; } - if (((GETPOST('type')=='radio') || (GETPOST('type')=='checkbox')) && GETPOST('param')) + if (((GETPOST('type')=='radio') || (GETPOST('type')=='checkbox')) && GETPOST('param')) { // Construct array for parameter (value of select list) $parameters = GETPOST('param'); @@ -95,7 +95,7 @@ if ($action == 'add') foreach($parameters_array as $param_ligne) { if (!empty($param_ligne)) { - if (preg_match_all('/,/',$param_ligne,$matches)) + if (preg_match_all('/,/',$param_ligne,$matches)) { if (count($matches[0])>1) { $error++; @@ -104,7 +104,7 @@ if ($action == 'add') $action = 'create'; } } - else + else { $error++; $langs->load("errors"); @@ -112,12 +112,12 @@ if ($action == 'add') $action = 'create'; } } - } + } } if (! $error) { - // attrname must be alphabetical and lower case only + // attrname must be alphabetical and lower case only if (isset($_POST["attrname"]) && preg_match("/^[a-z0-9-_]+$/",$_POST['attrname'])) { // Construct array for parameter (value of select list) @@ -139,8 +139,8 @@ if ($action == 'add') list($key,$value) = explode(',',$param_ligne); $params['options'][$key] = $value; } - } - + } + $result=$extrafields->addExtraField($_POST['attrname'],$_POST['label'],$_POST['type'],$_POST['pos'],$extrasize,$elementtype,(GETPOST('unique')?1:0),(GETPOST('required')?1:0),$default_value,$params); if ($result > 0) { @@ -164,7 +164,7 @@ if ($action == 'add') $action = 'create'; } } - else + else { setEventMessage($mesg,'errors'); } diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 0cd428ebc4f..42c505a54bf 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -154,7 +154,7 @@ class ExtraFields { $table=$elementtype.'_extrafields'; - if (isset($attrname) && $attrname != '' && preg_match("/^\w[a-zA-Z0-9-_]*$/",$attrname)) + if (! empty($attrname) && preg_match("/^\w[a-zA-Z0-9-_]*$/",$attrname) && ! is_numeric($attrname)) { if ($type=='boolean') { $typedb='int'; @@ -226,8 +226,7 @@ class ExtraFields // Clean parameters if (empty($pos)) $pos=0; - - if (isset($attrname) && $attrname != '' && preg_match("/^\w[a-zA-Z0-9-_]*$/",$attrname)) + if (! empty($attrname) && preg_match("/^\w[a-zA-Z0-9-_]*$/",$attrname) && ! is_numeric($attrname)) { if(is_array($param) and count($param) > 0) { diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 17915465543..ce621e40a86 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -211,7 +211,7 @@ else { - + rights->cron->ex } else { - if ($object->lastresult > 0) setEventMessage($langs->trans("JobFinished"),'warnings'); - else setEventMessage($langs->trans("JobFinished"),'mesgs'); - $action=''; + $res = $object->reprogram_jobs($user->login); + if ($res > 0) + { + if ($object->lastresult > 0) setEventMessage($langs->trans("JobFinished"),'warnings'); + else setEventMessage($langs->trans("JobFinished"),'mesgs'); + $action=''; + } + else + { + setEventMessage($object->error,'errors'); + $action=''; + } } } diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index a9789ec055e..79e5ae5b1a4 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -100,6 +100,21 @@ if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->ex if ($result < 0) { setEventMessage($object->error,'errors'); } + else + { + $res = $object->reprogram_jobs($user->login); + if ($res > 0) + { + if ($object->lastresult > 0) setEventMessage($langs->trans("JobFinished"),'warnings'); + else setEventMessage($langs->trans("JobFinished"),'mesgs'); + $action=''; + } + else + { + setEventMessage($object->error,'errors'); + $action=''; + } + } header("Location: ".DOL_URL_ROOT.'/cron/list.php?status=-1'); // Make a call to avoid to run twice job when using back exit; diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 9bbc27ca51c..93ea02b0759 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -57,7 +57,7 @@ $hookmanager->initHooks(array('suppliercard','globalcard')); */ $parameters=array('socid'=>$socid); -$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if ($action == 'setsupplieraccountancycode') diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index f60763ab90a..7983060490d 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1970,7 +1970,8 @@ class CommandeFournisseur extends CommonOrder } /** - * Returns the translated input method + * Returns the translated input method of object (defined if $this->methode_commande_id > 0). + * This function make a sql request to get translation. No cache yet, try to not use it inside a loop. * * @return string */ @@ -1980,21 +1981,19 @@ class CommandeFournisseur extends CommonOrder if ($this->methode_commande_id > 0) { - $sql = "SELECT rowid, code, libelle"; + $sql = "SELECT rowid, code, libelle as label"; $sql.= " FROM ".MAIN_DB_PREFIX.'c_input_method'; $sql.= " WHERE active=1 AND rowid = ".$db->escape($this->methode_commande_id); $query = $db->query($sql); - if ($query && $db->num_rows($query)) { - $result = $db->fetch_object($query); + $obj = $db->fetch_object($query); - $string = $langs->trans($result->code); - - if ($string == $result->code) + $string = $langs->trans($obj->code); + if ($string == $obj->code) { - $string = $obj->libelle != '-' ? $obj->libelle : ''; + $string = $obj->label != '-' ? $obj->label : ''; } return $string; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index b9521d6594b..fa959b38277 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1404,6 +1404,7 @@ class Product extends CommonObject $sql.= " weight, weight_units, length, length_units, surface, surface_units, volume, volume_units, barcode, fk_barcode_type, finished,"; $sql.= " accountancy_code_buy, accountancy_code_sell, stock, pmp,"; $sql.= " datec, tms, import_key, entity, desiredstock, tobatch"; + $sql.= " ,ref_ext"; $sql.= " FROM ".MAIN_DB_PREFIX."product"; if ($id) $sql.= " WHERE rowid = ".$this->db->escape($id); else @@ -1478,6 +1479,8 @@ class Product extends CommonObject $this->date_modification = $obj->tms; $this->import_key = $obj->import_key; $this->entity = $obj->entity; + + $this->ref_ext = $obj->ref_ext; $this->db->free($resql); diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 801573a316f..3ff496356a8 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -410,10 +410,14 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES)) // Prix mini print ''; diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 2f25e2f3c2c..25006a81047 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -42,7 +42,7 @@ class Task extends CommonObject var $fk_task_parent; var $label; var $description; - var $duration_effective; + var $duration_effective; // total of time spent on this task var $planned_workload; var $date_c; var $date_start; diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index ac6c72ec44c..73400bbcc6e 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -450,7 +450,7 @@ if ($id > 0 || ! empty($ref)) if ($object->planned_workload) { $tmparray=$object->getSummaryOfTimeSpent(); - if ($tmparray['total_duration'] > 0) print round($tmparray['total_duration']/$object->planned_workload*100, 2).' %'; + if ($tmparray['total_duration'] > 0) print round($tmparray['total_duration'] / $object->planned_workload * 100, 2).' %'; else print '0 %'; } else print ''; diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index f7b9f28e16a..13b1e48f477 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -337,6 +337,30 @@ if ($id > 0 || ! empty($ref)) print ''; } + // Date start + print ''; + + // Date end + print ''; + + // Planned workload + print ''; + + // Declared progress + print ''; + + // Calculated progress + print ''; + print '
"; print ''.img_object($langs->trans("Payment"),"payment").' '.$objp->rowid.''.dol_print_date($db->jdate($objp->dp),'day')."".$objp->paiement_type.' '.$objp->num_paiement."'.price($objp->amount)." ".$langs->trans("Currency".$conf->currency)."".$labeltype.' '.$objp->num_paiement."'.price($objp->amount)." ".$langs->trans("Currency".$conf->currency)."
"> remise_client); ?>">%remise_percent); ?>">%
' . $langs->trans("MinPrice") . ' ' . $i . ''; - if ($object->multiprices_base_type ["$i"] == 'TTC') { + if (empty($object->multiprices_base_type["$i"])) $object->multiprices_base_type["$i"]="HT"; + if ($object->multiprices_base_type["$i"] == 'TTC') + { print price($object->multiprices_min_ttc["$i"]) . ' ' . $langs->trans($object->multiprices_base_type["$i"]); - } else { - print price($object->multiprices_min["$i"]) . ' ' . $langs->trans(empty($object->multiprices_base_type["$i"])?'HT':$object->multiprices_base_type["$i"]); + } + else + { + print price($object->multiprices_min["$i"]) . ' ' . $langs->trans($object->multiprices_base_type["$i"]); } print '
'.$langs->trans("DateStart").''; + print dol_print_date($object->date_start,'dayhour'); + print '
'.$langs->trans("DateEnd").''; + print dol_print_date($object->date_end,'dayhour'); + print '
'.$langs->trans("PlannedWorkload").''.convertSecondToTime($object->planned_workload,'allhourmin').'
'.$langs->trans("ProgressDeclared").''; + print $object->progress.' %'; + print '
'.$langs->trans("ProgressCalculated").''; + if ($object->planned_workload) print round(100 * $object->duration_effective / $object->planned_workload,2).' %'; + else print ''; + print '
'; dol_fiche_end(); diff --git a/htdocs/user/group/ldap.php b/htdocs/user/group/ldap.php index eaee979e802..f53775b9b3e 100644 --- a/htdocs/user/group/ldap.php +++ b/htdocs/user/group/ldap.php @@ -62,6 +62,10 @@ if ($action == 'dolibarr2ldap') $result=$ldap->connect_bind(); $info=$fgroup->_load_ldap_info(); + // Get a gid number for objectclass PosixGroup + if(in_array('posixGroup',$info['objectclass'])) + $info['gidNumber'] = $ldap->getNextGroupGid(); + $dn=$fgroup->_load_ldap_dn($info); $olddn=$dn; // We can say that old dn = dn as we force synchro diff --git a/htdocs/webservices/server_category.php b/htdocs/webservices/server_category.php index 3c723947764..345679f7c9a 100644 --- a/htdocs/webservices/server_category.php +++ b/htdocs/webservices/server_category.php @@ -106,56 +106,41 @@ $server->wsdl->addComplexType( 'tns:categorie' ); -/* - * Tableau des catégories - -$server->wsdl->addComplexType( - 'categories', - 'complexType', - 'array', - '', - 'SOAP-ENC:Array', - array(), - array( - array('id'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:categorie[]') - ), - 'tns:categories' -); + /* + * Image of product */ - -/* - * Les photos de la catégorie (un tableau indéxé qui contient les images avec leur vignette) + $server->wsdl->addComplexType( + 'PhotosArray', + 'complexType', + 'array', + 'sequence', + '', + array( + 'image' => array( + 'name' => 'image', + 'type' => 'tns:image', + 'minOccurs' => '0', + 'maxOccurs' => 'unbounded' + ) + ) + ); + + /* + * An image */ -$server->wsdl->addComplexType( - 'PhotosArray', - 'complexType', - 'array', - '', - 'SOAP-ENC:Array', - array(), - array( - array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:image[]') - ), - '' -); - -/* - * Une photo ( nom image / nom_vignette ) - */ -$server->wsdl->addComplexType( - 'image', - 'complexType', - 'array', - '', - 'SOAP-ENC:Array', - array(), - array( - 'photo' => array('name'=>'photo','type'=>'xsd:string'), - 'photo_vignette' => array('name'=>'photo_vignette','type'=>'xsd:string'), - 'imgWidth' => array('name'=>'imgWidth','type'=>'xsd:string'), - 'imgHeight' => array('name'=>'imgHeight','type'=>'xsd:string') - ) -); + $server->wsdl->addComplexType( + 'image', + 'complexType', + 'struct', + 'all', + '', + array( + 'photo' => array('name'=>'photo','type'=>'xsd:string'), + 'photo_vignette' => array('name'=>'photo_vignette','type'=>'xsd:string'), + 'imgWidth' => array('name'=>'imgWidth','type'=>'xsd:string'), + 'imgHeight' => array('name'=>'imgHeight','type'=>'xsd:string') + ) + ); /* * Retour