From f313fb925ba2e04f31084c45a33792c968595a9f Mon Sep 17 00:00:00 2001 From: John Date: Wed, 21 Feb 2018 17:06:40 +0100 Subject: [PATCH] Add new checkbox for lines --- htdocs/commande/card.php | 2 +- htdocs/compta/facture/card.php | 2 +- htdocs/core/class/commonobject.class.php | 13 ++++++++++++- htdocs/core/tpl/objectline_view.tpl.php | 5 ++++- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 54c7db7d6ca..440e69cb19d 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2473,7 +2473,7 @@ if ($action == 'create' && $user->rights->commande->creer) /* * Form to add new line */ - if ($object->statut == Commande::STATUS_DRAFT && $user->rights->commande->creer) + if ($object->statut == Commande::STATUS_DRAFT && $user->rights->commande->creer && $action != 'selectlines') { if ($action != 'editline') { diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index ab7e0826553..7d8997ee0c7 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4224,7 +4224,7 @@ else if ($id > 0 || ! empty($ref)) // Form to add new line if ($object->statut == 0 && $user->rights->facture->creer && $action != 'valid' && $action != 'editline' && ($object->is_first() || !$object->situation_cycle_ref)) { - if ($action != 'editline') + if ($action != 'editline' && $action != 'selectlines') { // Add free products/services $object->formAddObjectLine(1, $mysoc, $soc); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 18d2add801c..d5eb70c6811 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3594,7 +3594,7 @@ abstract class CommonObject if (empty($reshook)) { print ''; - + if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) print ' '; // Description @@ -3661,6 +3661,14 @@ abstract class CommonObject print ''; + if($action == 'selectlines') + { + print ''; + print ''; + print ''; + print ''; + } + print "\n"; } @@ -5882,6 +5890,8 @@ abstract class CommonObject $colspan='0'; } + if($action == 'selectlines'){ $colspan++; } + // Convert date into timestamp format (value in memory must be a timestamp) if (in_array($extrafields->attribute_type[$key],array('date','datetime'))) { @@ -5914,6 +5924,7 @@ abstract class CommonObject } $out .= ''; + if (! empty($conf->global->MAIN_EXTRAFIELDS_USE_TWO_COLUMS) && (($e % 2) == 1)) $out .= ''; else $out .= ''; diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index cdc7044cd42..f68d6ea5cf8 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -251,7 +251,7 @@ $domData .= ' data-product_type="'.$line->product_type.'"'; statut == 0 && ($object_rights->creer)) { ?> + if ($this->statut == 0 && ($object_rights->creer) && $action != 'selectlines' ) { ?> info_bits & 2) == 2 || ! empty($disableedit)) { ?> @@ -291,6 +291,9 @@ $domData .= ' data-product_type="'.$line->product_type.'"'; + + +