diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index ffc44066fba..bb148f304c3 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -75,6 +75,7 @@ $search_user = GETPOST('search_user', 'int'); $search_sale = GETPOST('search_sale', 'int'); $search_total_ht = GETPOST('search_total_ht', 'alpha'); $search_total_ttc = GETPOST('search_total_ttc', 'alpha'); +$search_login=GETPOST('search_login', 'alpha'); $search_categ_cus = trim(GETPOST("search_categ_cus", 'int')); $optioncss = GETPOST('optioncss', 'alpha'); $billed = GETPOST('billed', 'int'); @@ -140,6 +141,7 @@ $arrayfields = array( 'c.total_ht'=>array('label'=>"AmountHT", 'checked'=>1), 'c.total_vat'=>array('label'=>"AmountVAT", 'checked'=>0), 'c.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0), + 'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>10), 'c.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), 'c.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500), 'c.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>500), @@ -195,6 +197,7 @@ if (empty($reshook)) $search_total_ht = ''; $search_total_vat = ''; $search_total_ttc = ''; + $search_login=''; $search_dateorder_start = ''; $search_dateorder_end = ''; $search_datedelivery_start = ''; @@ -246,10 +249,11 @@ if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT'; $sql .= ' s.rowid as socid, s.nom as name, s.email, s.town, s.zip, s.fk_pays, s.client, s.code_client,'; $sql .= " typent.code as typent_code,"; $sql .= " state.code_departement as state_code, state.nom as state_name,"; -$sql .= ' c.rowid, c.ref, c.total_ht, c.tva as total_tva, c.total_ttc, c.ref_client,'; +$sql.= ' c.rowid, c.ref, c.total_ht, c.tva as total_tva, c.total_ttc, c.ref_client, c.fk_user_author,'; $sql .= ' c.date_valid, c.date_commande, c.note_private, c.date_livraison as date_delivery, c.fk_statut, c.facture as billed,'; $sql .= ' c.date_creation as date_creation, c.tms as date_update, c.date_cloture as date_cloture,'; $sql .= " p.rowid as project_id, p.ref as project_ref, p.title as project_label"; +$sql.= " u.login"; if ($search_categ_cus) $sql .= ", cc.fk_categorie, cc.fk_soc"; // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) @@ -268,6 +272,8 @@ if (is_array($extrafields->attributes[$object->table_element]['label']) && count if ($sall || $search_product_category > 0) $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'commandedet as pd ON c.rowid=pd.fk_commande'; if ($search_product_category > 0) $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=pd.fk_product'; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = c.fk_projet"; +$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as u ON c.fk_user_author = u.rowid'; + // We'll need this table joined to the select in order to filter by sale if ($search_sale > 0 || (!$user->rights->societe->client->voir && !$socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if ($search_user > 0) @@ -322,6 +328,7 @@ if ($search_sale > 0) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$s if ($search_user > 0) $sql .= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='commande' AND tc.source='internal' AND ec.element_id = c.rowid AND ec.fk_socpeople = ".$search_user; if ($search_total_ht != '') $sql .= natural_search('c.total_ht', $search_total_ht, 1); if ($search_total_ttc != '') $sql .= natural_search('c.total_ttc', $search_total_ttc, 1); +if ($search_login) $sql .= natural_search("u.login", $search_login); if ($search_project_ref != '') $sql .= natural_search("p.ref", $search_project_ref); if ($search_project != '') $sql .= natural_search("p.title", $search_project); if ($search_categ_cus > 0) $sql .= " AND cc.fk_categorie = ".$db->escape($search_categ_cus); @@ -417,6 +424,7 @@ if ($resql) if ($search_total_ht != '') $param .= '&search_total_ht='.urlencode($search_total_ht); if ($search_total_vat != '') $param .= '&search_total_vat='.urlencode($search_total_vat); if ($search_total_ttc != '') $param .= '&search_total_ttc='.urlencode($search_total_ttc); + if ($search_login) $param.='&search_login='.urlencode($search_login); if ($search_project_ref >= 0) $param .= "&search_project_ref=".urlencode($search_project_ref); if ($search_town != '') $param .= '&search_town='.urlencode($search_town); if ($search_zip != '') $param .= '&search_zip='.urlencode($search_zip); @@ -689,6 +697,13 @@ if ($resql) print ''; print ''; } + if (! empty($arrayfields['u.login']['checked'])) + { + // Author + print ''; + print ''; + print ''; + } // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook @@ -760,6 +775,8 @@ if ($resql) if (!empty($arrayfields['c.total_ht']['checked'])) print_liste_field_titre($arrayfields['c.total_ht']['label'], $_SERVER["PHP_SELF"], 'c.total_ht', '', $param, '', $sortfield, $sortorder, 'right '); if (!empty($arrayfields['c.total_vat']['checked'])) print_liste_field_titre($arrayfields['c.total_vat']['label'], $_SERVER["PHP_SELF"], 'c.tva', '', $param, '', $sortfield, $sortorder, 'right '); if (!empty($arrayfields['c.total_ttc']['checked'])) print_liste_field_titre($arrayfields['c.total_ttc']['label'], $_SERVER["PHP_SELF"], 'c.total_ttc', '', $param, '', $sortfield, $sortorder, 'right '); + if (! empty($arrayfields['u.login']['checked'])) print_liste_field_titre($arrayfields['u.login']['label'], $_SERVER["PHP_SELF"], 'u.login', '', $param, 'align="center"', $sortfield, $sortorder); + // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields @@ -781,7 +798,7 @@ if ($resql) $generic_commande = new Commande($db); $generic_product = new Product($db); - + $userstatic = new User($db); $i = 0; $totalarray = array(); while ($i < min($num, $limit)) @@ -1080,6 +1097,19 @@ if ($resql) $totalarray['val']['c.total_ttc'] += $obj->total_ttc; } + $userstatic->id=$obj->fk_user_author; + $userstatic->login=$obj->login; + + // Author + if (! empty($arrayfields['u.login']['checked'])) + { + print ''; + if ($userstatic->id) print $userstatic->getLoginUrl(1); + else print ' '; + print "\n"; + if (! $i) $totalarray['nbfield']++; + } + // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index 1d445614981..f32621f93ac 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -105,6 +105,7 @@ require_once DOL_DOCUMENT_ROOT .'/includes/mike42/escpos-php/autoload.php'; use Mike42\Escpos\PrintConnectors\FilePrintConnector; use Mike42\Escpos\PrintConnectors\NetworkPrintConnector; use Mike42\Escpos\PrintConnectors\WindowsPrintConnector; +use Mike42\Escpos\PrintConnectors\DummyPrintConnector; use Mike42\Escpos\CapabilityProfile; use Mike42\Escpos\Printer; use Mike42\Escpos\EscposImage; @@ -529,7 +530,13 @@ class dolReceiptPrinter extends Printer $this->printer->text("Most simple example\n"); $this->printer->feed(); $this->printer->cut(); - //print '
'.print_r($this->connector, true).'
'; + + // If is DummyPrintConnector send to log to debugging + if($this->printer->connector instanceof DummyPrintConnector) + { + $data = $this->printer->connector-> getData(); + dol_syslog($data); + } $this->printer->close(); } catch (Exception $e) { $this->errors[] = $e->getMessage(); @@ -713,9 +720,13 @@ class dolReceiptPrinter extends Printer break; } } - // Close and print - // uncomment next line to see content sent to printer - //print '
'.print_r($this->connector, true).'
'; + // If is DummyPrintConnector send to log to debugging + if($this->printer->connector instanceof DummyPrintConnector) + { + $data = $this->printer->connector->getData(); + dol_syslog($data); + } + // Close and print $this->printer->close(); } return $error; @@ -783,7 +794,6 @@ class dolReceiptPrinter extends Printer try { switch ($obj['fk_type']) { case 1: - require_once DOL_DOCUMENT_ROOT .'/includes/mike42/escpos-php/src/DummyPrintConnector.php'; $this->connector = new DummyPrintConnector(); break; case 2: diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 4494f09aa76..836861f6131 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -168,27 +168,33 @@ $isInEEC = isInEEC($mysoc); $arrayfields = array( 'p.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1), //'pfp.ref_fourn'=>array('label'=>$langs->trans("RefSupplier"), 'checked'=>1, 'enabled'=>(! empty($conf->barcode->enabled))), - 'p.label'=>array('label'=>$langs->trans("Label"), 'checked'=>1), - 'p.fk_product_type'=>array('label'=>$langs->trans("Type"), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && !empty($conf->service->enabled))), - 'p.barcode'=>array('label'=>$langs->trans("Gencod"), 'checked'=>1, 'enabled'=>(!empty($conf->barcode->enabled))), - 'p.duration'=>array('label'=>$langs->trans("Duration"), 'checked'=>($contextpage != 'productlist'), 'enabled'=>(!empty($conf->service->enabled) && (string) $type == '1')), - 'p.weight'=>array('label'=>$langs->trans("Weight"), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled))), - 'p.length'=>array('label'=>$langs->trans("Length"), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && empty($conf->global->PRODUCT_DISABLE_SIZE))), - 'p.width'=>array('label'=>$langs->trans('Width'), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && empty($conf->global->PRODUCT_DISABLE_SIZE))), - 'p.height'=>array('label'=>$langs->trans('Height'), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && empty($conf->global->PRODUCT_DISABLE_SIZE))), - 'p.surface'=>array('label'=>$langs->trans("Surface"), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && empty($conf->global->PRODUCT_DISABLE_SURFACE))), - 'p.volume'=>array('label'=>$langs->trans("Volume"), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && empty($conf->global->PRODUCT_DISABLE_VOLUME))), - 'cu.label'=>array('label'=>$langs->trans("DefaultUnitToShow"), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && !empty($conf->global->PRODUCT_USE_UNITS))), - 'p.sellprice'=>array('label'=>$langs->trans("SellingPrice"), 'checked'=>1, 'enabled'=>empty($conf->global->PRODUIT_MULTIPRICES)), - 'p.minbuyprice'=>array('label'=>$langs->trans("BuyingPriceMinShort"), 'checked'=>1, 'enabled'=>(!empty($user->rights->fournisseur->lire))), - 'p.numbuyprice'=>array('label'=>$langs->trans("BuyingPriceNumShort"), 'checked'=>0, 'enabled'=>(!empty($user->rights->fournisseur->lire))), - 'p.tva_tx'=>array('label'=>$langs->trans("VATRate"), 'checked'=>0, 'enabled'=>(!empty($user->rights->fournisseur->lire))), - 'p.pmp'=>array('label'=>$langs->trans("PMPValueShort"), 'checked'=>0, 'enabled'=>(!empty($user->rights->fournisseur->lire))), - 'p.seuil_stock_alerte'=>array('label'=>$langs->trans("StockLimit"), 'checked'=>0, 'enabled'=>(!empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service')), - 'p.desiredstock'=>array('label'=>$langs->trans("DesiredStock"), 'checked'=>1, 'enabled'=>(!empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service')), - 'p.stock'=>array('label'=>$langs->trans("PhysicalStock"), 'checked'=>1, 'enabled'=>(!empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service')), - 'stock_virtual'=>array('label'=>$langs->trans("VirtualStock"), 'checked'=>1, 'enabled'=>(!empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service' && $virtualdiffersfromphysical)), - 'p.tobatch'=>array('label'=>$langs->trans("ManageLotSerial"), 'checked'=>0, 'enabled'=>(!empty($conf->productbatch->enabled))), + 'p.label'=>array('label'=>$langs->trans("Label"), 'checked'=>1, 'position'=>10), + 'p.fk_product_type'=>array('label'=>$langs->trans("Type"), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && !empty($conf->service->enabled)), 'position'=>11), + 'p.barcode'=>array('label'=>$langs->trans("Gencod"), 'checked'=>1, 'enabled'=>(!empty($conf->barcode->enabled)), 'position'=>12), + 'p.duration'=>array('label'=>$langs->trans("Duration"), 'checked'=>($contextpage != 'productlist'), 'enabled'=>(!empty($conf->service->enabled) && (string) $type == '1'), 'position'=>13), + 'p.weight'=>array('label'=>$langs->trans('Weight'), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && $type != '1'), 'position'=>20), + 'p.weight_units'=>array('label'=>$langs->trans('WeightUnits'), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && $type != '1'), 'position'=>21), + 'p.length'=>array('label'=>$langs->trans('Length'), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && empty($conf->global->PRODUCT_DISABLE_SIZE) && $type != '1'), 'position'=>22), + 'p.length_units'=>array('label'=>$langs->trans('LengthUnits'), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && empty($conf->global->PRODUCT_DISABLE_SIZE) && $type != '1'), 'position'=>23), + 'p.width'=>array('label'=>$langs->trans('Width'), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && empty($conf->global->PRODUCT_DISABLE_SIZE) && $type != '1'), 'position'=>24), + 'p.width_units'=>array('label'=>$langs->trans('WidthUnits'), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && empty($conf->global->PRODUCT_DISABLE_SIZE) && $type != '1'), 'position'=>25), + 'p.height'=>array('label'=>$langs->trans('Height'), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && empty($conf->global->PRODUCT_DISABLE_SIZE) && $type != '1'), 'position'=>26), + 'p.height_units'=>array('label'=>$langs->trans('HeightUnits'), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && empty($conf->global->PRODUCT_DISABLE_SIZE) && $type != '1'), 'position'=>27), + 'p.surface'=>array('label'=>$langs->trans('Surface'), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && empty($conf->global->PRODUCT_DISABLE_SURFACE) && $type != '1'), 'position'=>28), + 'p.surface_units'=>array('label'=>$langs->trans('SurfaceUnits'), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && empty($conf->global->PRODUCT_DISABLE_SURFACE) && $type != '1'), 'position'=>29), + 'p.volume'=>array('label'=>$langs->trans('Volume'), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && empty($conf->global->PRODUCT_DISABLE_VOLUME) && $type != '1'), 'position'=>30), + 'p.volume_units'=>array('label'=>$langs->trans('VolumeUnits'), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && empty($conf->global->PRODUCT_DISABLE_VOLUME) && $type != '1'), 'position'=>31), + 'cu.label'=>array('label'=>$langs->trans("DefaultUnitToShow"), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && !empty($conf->global->PRODUCT_USE_UNITS)), 'position'=>32), + 'p.sellprice'=>array('label'=>$langs->trans("SellingPrice"), 'checked'=>1, 'enabled'=>empty($conf->global->PRODUIT_MULTIPRICES), 'position'=>40), + 'p.minbuyprice'=>array('label'=>$langs->trans("BuyingPriceMinShort"), 'checked'=>1, 'enabled'=>(!empty($user->rights->fournisseur->lire)), 'position'=>41), + 'p.numbuyprice'=>array('label'=>$langs->trans("BuyingPriceNumShort"), 'checked'=>0, 'enabled'=>(!empty($user->rights->fournisseur->lire)), 'position'=>42), + 'p.tva_tx'=>array('label'=>$langs->trans("VATRate"), 'checked'=>0, 'enabled'=>(!empty($user->rights->fournisseur->lire)), 'position'=>43), + 'p.pmp'=>array('label'=>$langs->trans("PMPValueShort"), 'checked'=>0, 'enabled'=>(!empty($user->rights->fournisseur->lire)), 'position'=>44), + 'p.seuil_stock_alerte'=>array('label'=>$langs->trans("StockLimit"), 'checked'=>0, 'enabled'=>(!empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service'), 'position'=>50), + 'p.desiredstock'=>array('label'=>$langs->trans("DesiredStock"), 'checked'=>1, 'enabled'=>(!empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service'),'position'=>51), + 'p.stock'=>array('label'=>$langs->trans("PhysicalStock"), 'checked'=>1, 'enabled'=>(!empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service'), 'position'=>52), + 'stock_virtual'=>array('label'=>$langs->trans("VirtualStock"), 'checked'=>1, 'enabled'=>(!empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service' && $virtualdiffersfromphysical), 'position'=>53), + 'p.tobatch'=>array('label'=>$langs->trans("ManageLotSerial"), 'checked'=>0, 'enabled'=>(!empty($conf->productbatch->enabled)), 'position'=>60), 'p.accountancy_code_sell'=>array('label'=>$langs->trans("ProductAccountancySellCode"), 'checked'=>0, 'position'=>400), 'p.accountancy_code_sell_intra'=>array('label'=>$langs->trans("ProductAccountancySellIntraCode"), 'checked'=>0, 'enabled'=>$isInEEC, 'position'=>401), 'p.accountancy_code_sell_export'=>array('label'=>$langs->trans("ProductAccountancySellExportCode"), 'checked'=>0, 'position'=>402), @@ -630,36 +636,65 @@ if ($resql) print ''; print ''; } + // Weight units + if (!empty($arrayfields['p.weight_units']['checked'])) { + print ''; + print ''; + } // Length if (!empty($arrayfields['p.length']['checked'])) { print ''; print ''; } + // Length units + if (!empty($arrayfields['p.length_units']['checked'])) { + print ''; + print ''; + } // Width - if (!empty($arrayfields['p.width']['checked'])) - { + if (!empty($arrayfields['p.width']['checked'])) { print ''; print ''; } + // Width units + if (!empty($arrayfields['p.width_units']['checked'])) { + print ''; + print ''; + } // Height if (!empty($arrayfields['p.height']['checked'])) { print ''; print ''; } + // Height units + if (!empty($arrayfields['p.height_units']['checked'])) { + print ''; + print ''; + } // Surface if (!empty($arrayfields['p.surface']['checked'])) { print ''; print ''; } + // Surface units + if (!empty($arrayfields['p.surface_units']['checked'])) { + print ''; + print ''; + } // Volume if (!empty($arrayfields['p.volume']['checked'])) { print ''; print ''; } + // Volume units + if (!empty($arrayfields['p.volume_units']['checked'])) { + print ''; + print ''; + } // Unit if (!empty($arrayfields['cu.label']['checked'])) @@ -784,13 +819,19 @@ if ($resql) if (!empty($arrayfields['p.duration']['checked'])) { print_liste_field_titre($arrayfields['p.duration']['label'], $_SERVER["PHP_SELF"], "p.duration", "", $param, '', $sortfield, $sortorder, 'center '); } - if (!empty($arrayfields['p.weight']['checked'])) print_liste_field_titre($arrayfields['p.weight']['label'], $_SERVER["PHP_SELF"], "p.weight", "", $param, '', $sortfield, $sortorder, 'center '); - if (!empty($arrayfields['p.length']['checked'])) print_liste_field_titre($arrayfields['p.length']['label'], $_SERVER["PHP_SELF"], "p.length", "", $param, '', $sortfield, $sortorder, 'center '); - if (!empty($arrayfields['p.width']['checked'])) print_liste_field_titre($arrayfields['p.width']['label'], $_SERVER['PHP_SELF'], 'p.width', '', $param, '', $sortfield, $sortorder, 'center '); - if (!empty($arrayfields['p.height']['checked'])) print_liste_field_titre($arrayfields['p.height']['label'], $_SERVER['PHP_SELF'], 'p.height', '', $param, '', $sortfield, $sortorder, 'center '); - if (!empty($arrayfields['p.surface']['checked'])) print_liste_field_titre($arrayfields['p.surface']['label'], $_SERVER["PHP_SELF"], "p.surface", "", $param, '', $sortfield, $sortorder, 'center '); - if (!empty($arrayfields['p.volume']['checked'])) print_liste_field_titre($arrayfields['p.volume']['label'], $_SERVER["PHP_SELF"], "p.volume", "", $param, '', $sortfield, $sortorder, 'center '); - if (!empty($arrayfields['cu.label']['checked'])) print_liste_field_titre($arrayfields['cu.label']['label'], $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'center '); + if (!empty($arrayfields['p.weight']['checked'])) print_liste_field_titre($arrayfields['p.weight']['label'], $_SERVER['PHP_SELF'], 'p.weight', '', $param, '', $sortfield, $sortorder, 'center '); + if (!empty($arrayfields['p.weight_units']['checked'])) print_liste_field_titre($arrayfields['p.weight_units']['label'], $_SERVER['PHP_SELF'], 'p.weight_units', '', $param, '', $sortfield, $sortorder, 'center '); + if (!empty($arrayfields['p.length']['checked'])) print_liste_field_titre($arrayfields['p.length']['label'], $_SERVER['PHP_SELF'], 'p.length', '', $param, '', $sortfield, $sortorder, 'center '); + if (!empty($arrayfields['p.length_units']['checked'])) print_liste_field_titre($arrayfields['p.length_units']['label'], $_SERVER['PHP_SELF'], 'p.length_units', '', $param, '', $sortfield, $sortorder, 'center '); + if (!empty($arrayfields['p.width']['checked'])) print_liste_field_titre($arrayfields['p.width']['label'], $_SERVER['PHP_SELF'], 'p.width', '', $param, '', $sortfield, $sortorder, 'center '); + if (!empty($arrayfields['p.width_units']['checked'])) print_liste_field_titre($arrayfields['p.width_units']['label'], $_SERVER['PHP_SELF'], 'p.width_units', '', $param, '', $sortfield, $sortorder, 'center '); + if (!empty($arrayfields['p.height']['checked'])) print_liste_field_titre($arrayfields['p.height']['label'], $_SERVER['PHP_SELF'], 'p.height', '', $param, '', $sortfield, $sortorder, 'center '); + if (!empty($arrayfields['p.height_units']['checked'])) print_liste_field_titre($arrayfields['p.height_units']['label'], $_SERVER['PHP_SELF'], 'p.height_units', '', $param, '', $sortfield, $sortorder, 'center '); + if (!empty($arrayfields['p.surface']['checked'])) print_liste_field_titre($arrayfields['p.surface']['label'], $_SERVER['PHP_SELF'], "p.surface", '', $param, '', $sortfield, $sortorder, 'center '); + if (!empty($arrayfields['p.surface_units']['checked'])) print_liste_field_titre($arrayfields['p.surface_units']['label'], $_SERVER['PHP_SELF'], 'p.surface_units', '', $param, '', $sortfield, $sortorder, 'center '); + if (!empty($arrayfields['p.volume']['checked'])) print_liste_field_titre($arrayfields['p.volume']['label'], $_SERVER['PHP_SELF'], 'p.volume', '', $param, '', $sortfield, $sortorder, 'center '); + if (!empty($arrayfields['p.volume_units']['checked'])) print_liste_field_titre($arrayfields['p.volume_units']['label'], $_SERVER['PHP_SELF'], 'p.volume_units', '', $param, '', $sortfield, $sortorder, 'center '); + if (!empty($arrayfields['cu.label']['checked'])) print_liste_field_titre($arrayfields['cu.label']['label'], $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'center '); if (!empty($arrayfields['p.sellprice']['checked'])) { print_liste_field_titre($arrayfields['p.sellprice']['label'], $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right '); } @@ -1005,6 +1046,13 @@ if ($resql) print ''; if (!$i) $totalarray['nbfield']++; } + // Weight units + if (!empty($arrayfields['p.weight_units']['checked'])) { + print ''; + if ($product_static->weight != '') print measuringUnitString(0, 'weight', $product_static->weight_units); + print ''; + if (!$i) $totalarray['nbfield']++; + } // Length if (!empty($arrayfields['p.length']['checked'])) { @@ -1013,6 +1061,13 @@ if ($resql) print ''; if (!$i) $totalarray['nbfield']++; } + // Length units + if (!empty($arrayfields['p.length_units']['checked'])) { + print ''; + if ($product_static->length != '') print measuringUnitString(0, 'size', $product_static->length_units); + print ''; + if (!$i) $totalarray['nbfield']++; + } // Width if (!empty($arrayfields['p.width']['checked'])) { @@ -1021,6 +1076,13 @@ if ($resql) print ''; if (!$i) $totalarray['nbfield']++; } + // Width units + if (!empty($arrayfields['p.width_units']['checked'])) { + print ''; + if ($product_static->width != '') print measuringUnitString(0, 'size', $product_static->width_units); + print ''; + if (!$i) $totalarray['nbfield']++; + } // Height if (!empty($arrayfields['p.height']['checked'])) { @@ -1029,6 +1091,13 @@ if ($resql) print ''; if (!$i) $totalarray['nbfield']++; } + // Height units + if (!empty($arrayfields['p.height_units']['checked'])) { + print ''; + if ($product_static->height != '') print measuringUnitString(0, 'size', $product_static->height_units); + print ''; + if (!$i) $totalarray['nbfield']++; + } // Surface if (!empty($arrayfields['p.surface']['checked'])) { @@ -1037,6 +1106,13 @@ if ($resql) print ''; if (!$i) $totalarray['nbfield']++; } + // Surface units + if (!empty($arrayfields['p.surface_units']['checked'])) { + print ''; + if ($product_static->surface != '') print measuringUnitString(0, 'surface', $product_static->surface_units); + print ''; + if (!$i) $totalarray['nbfield']++; + } // Volume if (!empty($arrayfields['p.volume']['checked'])) { @@ -1045,6 +1121,13 @@ if ($resql) print ''; if (!$i) $totalarray['nbfield']++; } + // Volume units + if (!empty($arrayfields['p.volume_units']['checked'])) { + print ''; + if ($product_static->volume != '') print measuringUnitString(0, 'volume', $product_static->volume_units); + print ''; + if (!$i) $totalarray['nbfield']++; + } // Unit if (!empty($arrayfields['cu.label']['checked'])) { diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 60657b08061..2fcb012f3c4 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -156,6 +156,7 @@ class Task extends CommonObject $sql = "INSERT INTO ".MAIN_DB_PREFIX."projet_task ("; $sql .= "fk_projet"; $sql .= ", ref"; + $sql.= ", entity"; $sql .= ", fk_task_parent"; $sql .= ", label"; $sql .= ", description"; @@ -168,6 +169,7 @@ class Task extends CommonObject $sql .= ") VALUES ("; $sql .= $this->fk_project; $sql .= ", ".(!empty($this->ref) ? "'".$this->db->escape($this->ref)."'" : 'null'); + $sql.= ", ".$conf->entity; $sql .= ", ".$this->fk_task_parent; $sql .= ", '".$this->db->escape($this->label)."'"; $sql .= ", '".$this->db->escape($this->description)."'";