Add new checkbox for lines

This commit is contained in:
John 2018-02-21 17:06:40 +01:00
parent bd0e8506f5
commit f313fb925b
4 changed files with 18 additions and 4 deletions

View File

@ -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')
{

View File

@ -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);

View File

@ -3594,7 +3594,7 @@ abstract class CommonObject
if (empty($reshook))
{
print '<tr class="liste_titre nodrag nodrop">';
if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) print '<td class="linecolnum" align="center" width="5">&nbsp;</td>';
// Description
@ -3661,6 +3661,14 @@ abstract class CommonObject
print '<td class="linecolmove" width="10"></td>';
if($action == 'selectlines')
{
print '<td class="linecolcheckall" align="center">';
print '<input type="checkbox" class="linecheckboxtoggle" />';
print '<script type="text/javascript">$(document).ready(function() {$(".linecheckboxtoggle").click(function() {var checkBoxes = $(".linecheckbox");checkBoxes.prop("checked", this.checked);})});</script>';
print '</td>';
}
print "</tr>\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 .= '</td>';
if (! empty($conf->global->MAIN_EXTRAFIELDS_USE_TWO_COLUMS) && (($e % 2) == 1)) $out .= '</tr>';
else $out .= '</tr>';

View File

@ -251,7 +251,7 @@ $domData .= ' data-product_type="'.$line->product_type.'"';
<?php
if ($this->statut == 0 && ($object_rights->creer)) { ?>
if ($this->statut == 0 && ($object_rights->creer) && $action != 'selectlines' ) { ?>
<td class="linecoledit" align="center"><?php $coldisplay++; ?>
<?php if (($line->info_bits & 2) == 2 || ! empty($disableedit)) { ?>
<?php } else { ?>
@ -291,6 +291,9 @@ $domData .= ' data-product_type="'.$line->product_type.'"';
<?php } else { ?>
<td colspan="3"><?php $coldisplay=$coldisplay+3; ?></td>
<?php } ?>
<?php if($action == 'selectlines'){ ?>
<td class="linecolcheck" align="center"><input type="checkbox" class="linecheckbox" name="line_checkbox[<?php echo $line->id; ?>]" value="<?php echo $line->id; ?>" ></td>
<?php } ?>
<?php
//Line extrafield