Skip to content
Snippets Groups Projects
Commit 5fd1a87a authored by Regis Houssin's avatar Regis Houssin
Browse files

Works on module hook integration

parent 3696195e
No related branches found
No related tags found
No related merge requests found
......@@ -1408,6 +1408,14 @@ class CommonObject
{
$product_static = new Product($db);
$product_static->type=$line->fk_product_type;
$product_static->id=$line->fk_product;
$product_static->ref=$line->ref;
$product_static->libelle=$line->product_label;
$text=$product_static->getNomUrl(1);
$text.= ' - '.$line->product_label;
$description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($line->description));
include(DOL_DOCUMENT_ROOT.'/core/tpl/predefinedproductline_view.tpl.php');
}
else
......@@ -1419,72 +1427,14 @@ class CommonObject
// Ligne en mode update
if ($this->statut == 0 && $_GET["action"] == 'editline' && $user->rights->propale->creer && $_GET["lineid"] == $line->id)
{
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'#'.$line->id.'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="updateligne">';
print '<input type="hidden" name="id" value="'.$this->id.'">';
print '<input type="hidden" name="lineid" value="'.$_GET["lineid"].'">';
print '<tr '.$bc[$var].'>';
print '<td>';
print '<a name="'.$line->id.'"></a>'; // ancre pour retourner sur la ligne
if ($line->fk_product > 0)
{
print '<input type="hidden" name="productid" value="'.$line->fk_product.'">';
print '<a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$line->fk_product.'">';
if ($line->fk_product_type==1) print img_object($langs->trans('ShowService'),'service');
else print img_object($langs->trans('ShowProduct'),'product');
print ' '.$line->ref.'</a>';
print ' - '.nl2br($line->product_label);
print '<br>';
}
// editeur wysiwyg
$nbrows=ROWS_2;
if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT;
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
$doleditor=new DolEditor('desc',$line->description,164,'dolibarr_details','',false,true,$conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70);
$doleditor->Create();
print '</td>';
// TODO a déplacer dans classe module marge
//if ($conf->global->PRODUIT_USE_MARKUP) print '<td align="right">'.vatrate($line->marge_tx).'%</td>';
print '<td align="right">';
print $html->select_tva('tva_tx',$line->tva_tx,$mysoc,$societe,'',$line->info_bits);
print '</td>';
print '<td align="right"><input size="6" type="text" class="flat" name="subprice" value="'.price($line->subprice,0,'',0).'"></td>';
print '<td align="right">';
if (($line->info_bits & 2) != 2)
{
print '<input size="2" type="text" class="flat" name="qty" value="'.$line->qty.'">';
}
else print '&nbsp;';
print '</td>';
print '<td align="right" nowrap>';
if (($line->info_bits & 2) != 2)
{
print '<input size="1" type="text" class="flat" name="remise_percent" value="'.$line->remise_percent.'">%';
include(DOL_DOCUMENT_ROOT.'/core/tpl/predefinedproductline_edit.tpl.php');
}
else print '&nbsp;';
print '</td>';
print '<td align="center" colspan="5" valign="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
print '<br><input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></td>';
print '</tr>' . "\n";
// Start and end dates selector
if ($conf->service->enabled && $dateSelector)
else
{
print '<tr '.$bc[$var].'>';
print '<td colspan="9">'.$langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' ';
print $html->select_date($line->date_start,'date_start',$usehm,$usehm,$line->date_start?0:1,"updateligne");
print ' '.$langs->trans('to').' ';
print $html->select_date($line->date_end,'date_end',$usehm,$usehm,$line->date_end?0:1,"updateligne");
print '</td>';
print '</tr>';
include(DOL_DOCUMENT_ROOT.'/core/tpl/freeproductline_edit.tpl.php');
}
print "</form>\n";
}
}
......
......@@ -21,6 +21,61 @@
<!-- BEGIN PHP TEMPLATE freeproductline_edit.tpl.php -->
<form action="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'#'.$line->id; ?>" method="POST">';
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>">
<input type="hidden" name="action" value="updateligne">
<input type="hidden" name="id" value="<?php echo $this->id; ?>">
<input type="hidden" name="lineid" value="<?php echo $_GET["lineid"]; ?>">
<tr <?php echo $bc[$var]; ?>>
<td>
<a name="<?php echo $line->id; ?>"></a>
<?php
// editeur wysiwyg
$nbrows=ROWS_2;
if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT;
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
$doleditor=new DolEditor('desc',$line->description,164,'dolibarr_details','',false,true,$conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70);
$doleditor->Create();
?>
</td>
<td align="right"><?php echo $html->select_tva('tva_tx',$line->tva_tx,$mysoc,$societe,'',$line->info_bits); ?></td>
<td align="right"><input size="6" type="text" class="flat" name="subprice" value="<?php echo price($line->subprice,0,'',0); ?>"></td>
<td align="right">
<?php if (($line->info_bits & 2) != 2) { ?>
<input size="2" type="text" class="flat" name="qty" value="<?php echo $line->qty; ?>">
<?php } else { ?>
&nbsp;
<?php } ?>
</td>
<td align="right" nowrap>
<?php if (($line->info_bits & 2) != 2) { ?>
<input size="1" type="text" class="flat" name="remise_percent" value="<?php echo $line->remise_percent; ?>">%
<?php } else { ?>
&nbsp;
<?php } ?>
</td>
<td align="center" colspan="5" valign="center"><input type="submit" class="button" name="save" value="<?php echo $langs->trans("Save"); ?>">
<br><input type="submit" class="button" name="cancel" value="<?php echo $langs->trans("Cancel"); ?>"></td>
</tr>
<?php if ($conf->service->enabled && $dateSelector) { ?>
<tr <?php echo $bc[$var]; ?>>
<td colspan="9"><?php echo $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; ?>
<?php
echo $html->select_date($line->date_start,'date_start',$usehm,$usehm,$line->date_start?0:1,"updateligne");
echo ' '.$langs->trans('to').' ';
echo $html->select_date($line->date_end,'date_end',$usehm,$usehm,$line->date_end?0:1,"updateligne");
?>
</td>
</tr>
<?php } ?>
</form>
<!-- END PHP TEMPLATE freeproductline_edit.tpl.php -->
......@@ -21,6 +21,70 @@
<!-- BEGIN PHP TEMPLATE predefinedproductline_edit.tpl.php -->
<form action="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'#'.$line->id; ?>" method="POST">';
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>">
<input type="hidden" name="action" value="updateligne">
<input type="hidden" name="id" value="<?php echo $this->id; ?>">
<input type="hidden" name="lineid" value="<?php echo $_GET["lineid"]; ?>">
<tr <?php echo $bc[$var]; ?>>
<td>
<a name="<?php echo $line->id; ?>"></a>
<input type="hidden" name="productid" value="<?php echo $line->fk_product; ?>">
<a href="<?php echo DOL_URL_ROOT.'/product/fiche.php?id='.$line->fk_product; ?>">
<?php
if ($line->fk_product_type==1) echo img_object($langs->trans('ShowService'),'service');
else print img_object($langs->trans('ShowProduct'),'product');
echo ' '.$line->ref.'</a>';
echo ' - '.nl2br($line->product_label);
echo '<br>';
// editeur wysiwyg
$nbrows=ROWS_2;
if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT;
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
$doleditor=new DolEditor('desc',$line->description,164,'dolibarr_details','',false,true,$conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70);
$doleditor->Create();
?>
</td>
<td align="right"><?php echo $html->select_tva('tva_tx',$line->tva_tx,$mysoc,$societe,'',$line->info_bits); ?></td>
<td align="right"><input size="6" type="text" class="flat" name="subprice" value="<?php echo price($line->subprice,0,'',0); ?>"></td>
<td align="right">
<?php if (($line->info_bits & 2) != 2) { ?>
<input size="2" type="text" class="flat" name="qty" value="<?php echo $line->qty; ?>">
<?php } else { ?>
&nbsp;
<?php } ?>
</td>
<td align="right" nowrap>
<?php if (($line->info_bits & 2) != 2) { ?>
<input size="1" type="text" class="flat" name="remise_percent" value="<?php echo $line->remise_percent; ?>">%
<?php } else { ?>
&nbsp;
<?php } ?>
</td>
<td align="center" colspan="5" valign="center"><input type="submit" class="button" name="save" value="<?php echo $langs->trans("Save"); ?>">
<br><input type="submit" class="button" name="cancel" value="<?php echo $langs->trans("Cancel"); ?>"></td>
</tr>
<?php if ($conf->service->enabled && $dateSelector) { ?>
<tr <?php echo $bc[$var]; ?>>
<td colspan="9"><?php echo $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; ?>
<?php
echo $html->select_date($line->date_start,'date_start',$usehm,$usehm,$line->date_start?0:1,"updateligne");
echo ' '.$langs->trans('to').' ';
echo $html->select_date($line->date_end,'date_end',$usehm,$usehm,$line->date_end?0:1,"updateligne");
?>
</td>
</tr>
<?php } ?>
</form>
<!-- END PHP TEMPLATE predefinedproductline_edit.tpl.php -->
......@@ -25,14 +25,6 @@
<td>
<a name="<?php echo $line->id; ?>"></a>
<?php
// Show product and description
$product_static->type=$line->fk_product_type;
$product_static->id=$line->fk_product;
$product_static->ref=$line->ref;
$product_static->libelle=$line->product_label;
$text=$product_static->getNomUrl(1);
$text.= ' - '.$line->product_label;
$description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($line->description));
echo $html->textwithtooltip($text,$description,3,'','',$i);
// Show range
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment