clean indent
This commit is contained in:
parent
e2afcfb999
commit
a25ec35fd4
@ -1072,31 +1072,28 @@ if ($action == 'create')
|
|||||||
print '<script type="text/javascript" language="javascript">
|
print '<script type="text/javascript" language="javascript">
|
||||||
jQuery(document).ready(function() {
|
jQuery(document).ready(function() {
|
||||||
jQuery("#autofill").click(function() {';
|
jQuery("#autofill").click(function() {';
|
||||||
$i=0;
|
$i=0;
|
||||||
while($i < $numAsked)
|
while($i < $numAsked)
|
||||||
{
|
{
|
||||||
print 'jQuery("#qtyl'.$i.'").val(jQuery("#qtyasked'.$i.'").val() - jQuery("#qtydelivered'.$i.'").val());'."\n";
|
print 'jQuery("#qtyl'.$i.'").val(jQuery("#qtyasked'.$i.'").val() - jQuery("#qtydelivered'.$i.'").val());'."\n";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
print '});
|
print '});
|
||||||
jQuery("#autoreset").click(function() {';
|
jQuery("#autoreset").click(function() {';
|
||||||
$i=0;
|
$i=0;
|
||||||
while($i < $numAsked)
|
while($i < $numAsked)
|
||||||
{
|
{
|
||||||
print 'jQuery("#qtyl'.$i.'").val(0);'."\n";
|
print 'jQuery("#qtyl'.$i.'").val(0);'."\n";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
print '});
|
print '});
|
||||||
});
|
});
|
||||||
</script>';
|
</script>';
|
||||||
|
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
|
|
||||||
|
|
||||||
// Load shipments already done for same order
|
// Load shipments already done for same order
|
||||||
$object->loadExpeditions();
|
$object->loadExpeditions();
|
||||||
|
|
||||||
|
|||||||
@ -288,19 +288,20 @@ if ($id > 0 || ! empty($ref))
|
|||||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||||
if ($user->rights->commande->creer)
|
if ($user->rights->commande->creer)
|
||||||
{
|
{
|
||||||
if ($action != 'classify')
|
if ($action != 'classify') {
|
||||||
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||||
if ($action == 'classify') {
|
}
|
||||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
if ($action == 'classify') {
|
||||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||||
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||||
$morehtmlref.='</form>';
|
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||||
} else {
|
$morehtmlref.='</form>';
|
||||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
} else {
|
||||||
}
|
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (! empty($object->fk_project)) {
|
if (! empty($object->fk_project)) {
|
||||||
$proj = new Project($db);
|
$proj = new Project($db);
|
||||||
|
|||||||
@ -23,11 +23,9 @@ if (empty($conf) || ! is_object($conf))
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
||||||
<!-- BEGIN PHP TEMPLATE -->
|
print "<!-- BEGIN PHP TEMPLATE -->\n";
|
||||||
|
|
||||||
<?php
|
|
||||||
|
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
@ -37,24 +35,25 @@ $linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
|
|||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->load("sendings");
|
$langs->load("sendings");
|
||||||
|
|
||||||
$total=0; $ilink=0;
|
$total=0;
|
||||||
|
$ilink=0;
|
||||||
foreach($linkedObjectBlock as $key => $objectlink)
|
foreach($linkedObjectBlock as $key => $objectlink)
|
||||||
{
|
{
|
||||||
$ilink++;
|
$ilink++;
|
||||||
|
|
||||||
$trclass='oddeven';
|
$trclass='oddeven';
|
||||||
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
|
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
|
||||||
?>
|
?>
|
||||||
<tr class="<?php echo $trclass; ?>">
|
<tr class="<?php echo $trclass; ?>">
|
||||||
<td><?php echo $langs->trans("Shipment"); ?></td>
|
<td><?php echo $langs->trans("Shipment"); ?></td>
|
||||||
<td><?php echo $objectlink->getNomUrl(1); ?></td>
|
<td><?php echo $objectlink->getNomUrl(1); ?></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td class="center"><?php echo dol_print_date($objectlink->date_delivery, 'day'); ?></td>
|
<td class="center"><?php echo dol_print_date($objectlink->date_delivery, 'day'); ?></td>
|
||||||
<td class="right"><?php
|
<td class="right"><?php
|
||||||
if ($user->rights->expedition->lire) {
|
if ($user->rights->expedition->lire) {
|
||||||
$total = $total + $objectlink->total_ht;
|
$total = $total + $objectlink->total_ht;
|
||||||
echo price($objectlink->total_ht);
|
echo price($objectlink->total_ht);
|
||||||
} ?></td>
|
} ?></td>
|
||||||
<td class="right"><?php echo $objectlink->getLibStatut(3); ?></td>
|
<td class="right"><?php echo $objectlink->getLibStatut(3); ?></td>
|
||||||
<td class="right">
|
<td class="right">
|
||||||
<?php
|
<?php
|
||||||
@ -66,7 +65,7 @@ foreach($linkedObjectBlock as $key => $objectlink)
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
if (count($linkedObjectBlock) > 1) {
|
if (count($linkedObjectBlock) > 1) {
|
||||||
?>
|
?>
|
||||||
@ -81,6 +80,5 @@ if (count($linkedObjectBlock) > 1) {
|
|||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
|
|
||||||
<!-- END PHP TEMPLATE -->
|
print "<!-- END PHP TEMPLATE -->\n";
|
||||||
|
|||||||
@ -319,78 +319,92 @@ if (empty($reshook))
|
|||||||
$id = $object->create($user);
|
$id = $object->create($user);
|
||||||
if ($id > 0)
|
if ($id > 0)
|
||||||
{
|
{
|
||||||
dol_include_once('/' . $element . '/class/' . $subelement . '.class.php');
|
dol_include_once('/' . $element . '/class/' . $subelement . '.class.php');
|
||||||
|
|
||||||
$classname = ucfirst($subelement);
|
$classname = ucfirst($subelement);
|
||||||
$srcobject = new $classname($db);
|
$srcobject = new $classname($db);
|
||||||
|
|
||||||
dol_syslog("Try to find source object origin=" . $object->origin . " originid=" . $object->origin_id . " to add lines");
|
dol_syslog("Try to find source object origin=" . $object->origin . " originid=" . $object->origin_id . " to add lines");
|
||||||
$result = $srcobject->fetch($object->origin_id);
|
$result = $srcobject->fetch($object->origin_id);
|
||||||
|
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
|
{
|
||||||
|
$lines = $srcobject->lines;
|
||||||
|
if (empty($lines) && method_exists($srcobject, 'fetch_lines'))
|
||||||
{
|
{
|
||||||
|
$srcobject->fetch_lines();
|
||||||
$lines = $srcobject->lines;
|
$lines = $srcobject->lines;
|
||||||
if (empty($lines) && method_exists($srcobject, 'fetch_lines'))
|
}
|
||||||
{
|
|
||||||
$srcobject->fetch_lines();
|
$fk_parent_line=0;
|
||||||
$lines = $srcobject->lines;
|
$num=count($lines);
|
||||||
|
for ($i=0;$i<$num;$i++)
|
||||||
|
{
|
||||||
|
$label=(! empty($lines[$i]->label)?$lines[$i]->label:'');
|
||||||
|
$desc=(! empty($lines[$i]->desc)?$lines[$i]->desc:$lines[$i]->libelle);
|
||||||
|
|
||||||
|
// Positive line
|
||||||
|
$product_type = ($lines[$i]->product_type ? $lines[$i]->product_type : 0);
|
||||||
|
|
||||||
|
// Reset fk_parent_line for no child products and special product
|
||||||
|
if (($lines[$i]->product_type != 9 && empty($lines[$i]->fk_parent_line)) || $lines[$i]->product_type == 9) {
|
||||||
|
$fk_parent_line = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$fk_parent_line=0;
|
// Extrafields
|
||||||
$num=count($lines);
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
|
||||||
for ($i=0;$i<$num;$i++)
|
$lines[$i]->fetch_optionals();
|
||||||
{
|
$array_options = $lines[$i]->array_options;
|
||||||
$label=(! empty($lines[$i]->label)?$lines[$i]->label:'');
|
|
||||||
$desc=(! empty($lines[$i]->desc)?$lines[$i]->desc:$lines[$i]->libelle);
|
|
||||||
|
|
||||||
// Positive line
|
|
||||||
$product_type = ($lines[$i]->product_type ? $lines[$i]->product_type : 0);
|
|
||||||
|
|
||||||
// Reset fk_parent_line for no child products and special product
|
|
||||||
if (($lines[$i]->product_type != 9 && empty($lines[$i]->fk_parent_line)) || $lines[$i]->product_type == 9) {
|
|
||||||
$fk_parent_line = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Extrafields
|
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
|
|
||||||
$lines[$i]->fetch_optionals();
|
|
||||||
$array_options = $lines[$i]->array_options;
|
|
||||||
}
|
|
||||||
|
|
||||||
$result = $object->addline(
|
|
||||||
$desc, $lines[$i]->subprice, $lines[$i]->qty, $lines[$i]->tva_tx,
|
|
||||||
$lines[$i]->localtax1_tx, $lines[$i]->localtax2_tx,
|
|
||||||
$lines[$i]->fk_product, $lines[$i]->remise_percent,
|
|
||||||
'HT', 0, $lines[$i]->info_bits, $product_type,
|
|
||||||
$lines[$i]->rang, $lines[$i]->special_code, $fk_parent_line,
|
|
||||||
$lines[$i]->fk_fournprice, $lines[$i]->pa_ht, $label, $array_options,
|
|
||||||
$lines[$i]->ref_supplier, $lines[$i]->fk_unit
|
|
||||||
);
|
|
||||||
|
|
||||||
if ($result > 0) {
|
|
||||||
$lineid = $result;
|
|
||||||
} else {
|
|
||||||
$lineid = 0;
|
|
||||||
$error ++;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Defined the new fk_parent_line
|
|
||||||
if ($result > 0 && $lines[$i]->product_type == 9) {
|
|
||||||
$fk_parent_line = $result;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hooks
|
$result = $object->addline(
|
||||||
$parameters = array('objFrom' => $srcobject);
|
$desc,
|
||||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been
|
$lines[$i]->subprice,
|
||||||
// modified by hook
|
$lines[$i]->qty,
|
||||||
if ($reshook < 0)
|
$lines[$i]->tva_tx,
|
||||||
|
$lines[$i]->localtax1_tx,
|
||||||
|
$lines[$i]->localtax2_tx,
|
||||||
|
$lines[$i]->fk_product,
|
||||||
|
$lines[$i]->remise_percent,
|
||||||
|
'HT',
|
||||||
|
0,
|
||||||
|
$lines[$i]->info_bits,
|
||||||
|
$product_type,
|
||||||
|
$lines[$i]->rang,
|
||||||
|
$lines[$i]->special_code,
|
||||||
|
$fk_parent_line,
|
||||||
|
$lines[$i]->fk_fournprice,
|
||||||
|
$lines[$i]->pa_ht, $label,
|
||||||
|
$array_options,
|
||||||
|
$lines[$i]->ref_supplier,
|
||||||
|
$lines[$i]->fk_unit
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($result > 0) {
|
||||||
|
$lineid = $result;
|
||||||
|
} else {
|
||||||
|
$lineid = 0;
|
||||||
$error ++;
|
$error ++;
|
||||||
} else {
|
break;
|
||||||
setEventMessages($srcobject->error, $srcobject->errors, 'errors');
|
}
|
||||||
|
|
||||||
|
// Defined the new fk_parent_line
|
||||||
|
if ($result > 0 && $lines[$i]->product_type == 9) {
|
||||||
|
$fk_parent_line = $result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hooks
|
||||||
|
$parameters = array('objFrom' => $srcobject);
|
||||||
|
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been
|
||||||
|
// modified by hook
|
||||||
|
if ($reshook < 0) {
|
||||||
$error ++;
|
$error ++;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
setEventMessages($srcobject->error, $srcobject->errors, 'errors');
|
||||||
|
$error ++;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
$error ++;
|
$error ++;
|
||||||
@ -736,64 +750,64 @@ if (empty($reshook))
|
|||||||
|
|
||||||
if (! $error && $result > 0)
|
if (! $error && $result > 0)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
|
|
||||||
$ret=$object->fetch($object->id); // Reload to get new records
|
$ret=$object->fetch($object->id); // Reload to get new records
|
||||||
|
|
||||||
// Define output language
|
// Define output language
|
||||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
||||||
{
|
{
|
||||||
$outputlangs = $langs;
|
$outputlangs = $langs;
|
||||||
$newlang = '';
|
$newlang = '';
|
||||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09');
|
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09');
|
||||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
|
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
|
||||||
if (! empty($newlang)) {
|
if (! empty($newlang)) {
|
||||||
$outputlangs = new Translate("", $conf);
|
$outputlangs = new Translate("", $conf);
|
||||||
$outputlangs->setDefaultLang($newlang);
|
$outputlangs->setDefaultLang($newlang);
|
||||||
}
|
|
||||||
$model=$object->modelpdf;
|
|
||||||
$ret = $object->fetch($id); // Reload to get new records
|
|
||||||
|
|
||||||
$result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
|
||||||
if ($result < 0) dol_print_error($db, $result);
|
|
||||||
}
|
}
|
||||||
|
$model=$object->modelpdf;
|
||||||
|
$ret = $object->fetch($id); // Reload to get new records
|
||||||
|
|
||||||
unset($_POST['prod_entry_mode']);
|
$result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
|
if ($result < 0) dol_print_error($db, $result);
|
||||||
|
}
|
||||||
|
|
||||||
unset($_POST['qty']);
|
unset($_POST['prod_entry_mode']);
|
||||||
unset($_POST['type']);
|
|
||||||
unset($_POST['remise_percent']);
|
|
||||||
unset($_POST['pu']);
|
|
||||||
unset($_POST['price_ht']);
|
|
||||||
unset($_POST['multicurrency_price_ht']);
|
|
||||||
unset($_POST['price_ttc']);
|
|
||||||
unset($_POST['tva_tx']);
|
|
||||||
unset($_POST['label']);
|
|
||||||
unset($_POST['product_ref']);
|
|
||||||
unset($_POST['product_label']);
|
|
||||||
unset($_POST['product_desc']);
|
|
||||||
unset($_POST['fournprice']);
|
|
||||||
unset($_POST['buying_price']);
|
|
||||||
unset($localtax1_tx);
|
|
||||||
unset($localtax2_tx);
|
|
||||||
unset($_POST['np_marginRate']);
|
|
||||||
unset($_POST['np_markRate']);
|
|
||||||
unset($_POST['dp_desc']);
|
|
||||||
unset($_POST['idprodfournprice']);
|
|
||||||
unset($_POST['idprod']);
|
|
||||||
|
|
||||||
unset($_POST['date_starthour']);
|
unset($_POST['qty']);
|
||||||
unset($_POST['date_startmin']);
|
unset($_POST['type']);
|
||||||
unset($_POST['date_startsec']);
|
unset($_POST['remise_percent']);
|
||||||
unset($_POST['date_startday']);
|
unset($_POST['pu']);
|
||||||
unset($_POST['date_startmonth']);
|
unset($_POST['price_ht']);
|
||||||
unset($_POST['date_startyear']);
|
unset($_POST['multicurrency_price_ht']);
|
||||||
unset($_POST['date_endhour']);
|
unset($_POST['price_ttc']);
|
||||||
unset($_POST['date_endmin']);
|
unset($_POST['tva_tx']);
|
||||||
unset($_POST['date_endsec']);
|
unset($_POST['label']);
|
||||||
unset($_POST['date_endday']);
|
unset($_POST['product_ref']);
|
||||||
unset($_POST['date_endmonth']);
|
unset($_POST['product_label']);
|
||||||
unset($_POST['date_endyear']);
|
unset($_POST['product_desc']);
|
||||||
|
unset($_POST['fournprice']);
|
||||||
|
unset($_POST['buying_price']);
|
||||||
|
unset($localtax1_tx);
|
||||||
|
unset($localtax2_tx);
|
||||||
|
unset($_POST['np_marginRate']);
|
||||||
|
unset($_POST['np_markRate']);
|
||||||
|
unset($_POST['dp_desc']);
|
||||||
|
unset($_POST['idprodfournprice']);
|
||||||
|
unset($_POST['idprod']);
|
||||||
|
|
||||||
|
unset($_POST['date_starthour']);
|
||||||
|
unset($_POST['date_startmin']);
|
||||||
|
unset($_POST['date_startsec']);
|
||||||
|
unset($_POST['date_startday']);
|
||||||
|
unset($_POST['date_startmonth']);
|
||||||
|
unset($_POST['date_startyear']);
|
||||||
|
unset($_POST['date_endhour']);
|
||||||
|
unset($_POST['date_endmin']);
|
||||||
|
unset($_POST['date_endsec']);
|
||||||
|
unset($_POST['date_endday']);
|
||||||
|
unset($_POST['date_endmonth']);
|
||||||
|
unset($_POST['date_endyear']);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -801,7 +815,6 @@ if (empty($reshook))
|
|||||||
|
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1452,19 +1465,20 @@ if ($action == 'create')
|
|||||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||||
if ($user->rights->supplier_proposal->creer)
|
if ($user->rights->supplier_proposal->creer)
|
||||||
{
|
{
|
||||||
if ($action != 'classify')
|
if ($action != 'classify') {
|
||||||
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||||
if ($action == 'classify') {
|
}
|
||||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
if ($action == 'classify') {
|
||||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||||
$morehtmlref.=$formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$object->socid:-1), $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
$morehtmlref.=$formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$object->socid:-1), $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||||
$morehtmlref.='</form>';
|
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||||
} else {
|
$morehtmlref.='</form>';
|
||||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
} else {
|
||||||
}
|
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (! empty($object->fk_project)) {
|
if (! empty($object->fk_project)) {
|
||||||
$proj = new Project($db);
|
$proj = new Project($db);
|
||||||
|
|||||||
@ -1739,16 +1739,15 @@ class SupplierProposal extends CommonObject
|
|||||||
|
|
||||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
||||||
{
|
{
|
||||||
// Define output language
|
// Define output language
|
||||||
$outputlangs = $langs;
|
$outputlangs = $langs;
|
||||||
if (! empty($conf->global->MAIN_MULTILANGS))
|
if (! empty($conf->global->MAIN_MULTILANGS)) {
|
||||||
{
|
$outputlangs = new Translate("", $conf);
|
||||||
$outputlangs = new Translate("", $conf);
|
$newlang=(GETPOST('lang_id', 'aZ09') ? GETPOST('lang_id', 'aZ09') : $this->thirdparty->default_lang);
|
||||||
$newlang=(GETPOST('lang_id', 'aZ09') ? GETPOST('lang_id', 'aZ09') : $this->thirdparty->default_lang);
|
$outputlangs->setDefaultLang($newlang);
|
||||||
$outputlangs->setDefaultLang($newlang);
|
}
|
||||||
}
|
//$ret=$object->fetch($id); // Reload to get new records
|
||||||
//$ret=$object->fetch($id); // Reload to get new records
|
$this->generateDocument($modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
$this->generateDocument($modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Call trigger
|
// Call trigger
|
||||||
|
|||||||
@ -158,20 +158,21 @@ if ($id > 0 || ! empty($ref))
|
|||||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||||
if ($permissiontoedit)
|
if ($permissiontoedit)
|
||||||
{
|
{
|
||||||
if ($action != 'classify')
|
if ($action != 'classify') {
|
||||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||||
$morehtmlref.=' : ';
|
$morehtmlref.=' : ';
|
||||||
if ($action == 'classify') {
|
}
|
||||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
if ($action == 'classify') {
|
||||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||||
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||||
$morehtmlref.='</form>';
|
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||||
} else {
|
$morehtmlref.='</form>';
|
||||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
} else {
|
||||||
}
|
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (! empty($object->fk_project)) {
|
if (! empty($object->fk_project)) {
|
||||||
$proj = new Project($db);
|
$proj = new Project($db);
|
||||||
|
|||||||
@ -113,20 +113,21 @@ if ($object->id > 0)
|
|||||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||||
if ($user->rights->supplier_proposal->creer)
|
if ($user->rights->supplier_proposal->creer)
|
||||||
{
|
{
|
||||||
if ($action != 'classify')
|
if ($action != 'classify') {
|
||||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||||
$morehtmlref.=' : ';
|
$morehtmlref.=' : ';
|
||||||
if ($action == 'classify') {
|
}
|
||||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
if ($action == 'classify') {
|
||||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||||
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||||
$morehtmlref.='</form>';
|
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||||
} else {
|
$morehtmlref.='</form>';
|
||||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
} else {
|
||||||
}
|
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (! empty($object->fk_project)) {
|
if (! empty($object->fk_project)) {
|
||||||
$proj = new Project($db);
|
$proj = new Project($db);
|
||||||
|
|||||||
@ -78,20 +78,21 @@ if (! empty($conf->projet->enabled))
|
|||||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||||
if ($user->rights->supplier_proposal->creer)
|
if ($user->rights->supplier_proposal->creer)
|
||||||
{
|
{
|
||||||
if ($action != 'classify')
|
if ($action != 'classify') {
|
||||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||||
$morehtmlref.=' : ';
|
$morehtmlref.=' : ';
|
||||||
if ($action == 'classify') {
|
}
|
||||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
if ($action == 'classify') {
|
||||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||||
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||||
$morehtmlref.='</form>';
|
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||||
} else {
|
$morehtmlref.='</form>';
|
||||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
} else {
|
||||||
}
|
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (! empty($object->fk_project)) {
|
if (! empty($object->fk_project)) {
|
||||||
$proj = new Project($db);
|
$proj = new Project($db);
|
||||||
|
|||||||
@ -98,20 +98,21 @@ if ($id > 0 || ! empty($ref))
|
|||||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||||
if ($user->rights->supplier_proposal->creer)
|
if ($user->rights->supplier_proposal->creer)
|
||||||
{
|
{
|
||||||
if ($action != 'classify')
|
if ($action != 'classify') {
|
||||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||||
$morehtmlref.=' : ';
|
$morehtmlref.=' : ';
|
||||||
if ($action == 'classify') {
|
}
|
||||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
if ($action == 'classify') {
|
||||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||||
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||||
$morehtmlref.='</form>';
|
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||||
} else {
|
$morehtmlref.='</form>';
|
||||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
} else {
|
||||||
}
|
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (! empty($object->fk_project)) {
|
if (! empty($object->fk_project)) {
|
||||||
$proj = new Project($db);
|
$proj = new Project($db);
|
||||||
|
|||||||
@ -24,39 +24,38 @@ if (empty($conf) || ! is_object($conf))
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
||||||
<!-- BEGIN PHP TEMPLATE LINKEDOBJECTBOCK-->
|
print "<!-- BEGIN PHP TEMPLATE LINKEDOBJECTBOCK-->\n";
|
||||||
|
|
||||||
<?php
|
|
||||||
|
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
$langs = $GLOBALS['langs'];
|
$langs = $GLOBALS['langs'];
|
||||||
$linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
|
$linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
|
||||||
|
|
||||||
$total=0; $ilink=0;
|
$total=0;
|
||||||
|
$ilink=0;
|
||||||
foreach($linkedObjectBlock as $key => $objectlink)
|
foreach($linkedObjectBlock as $key => $objectlink)
|
||||||
{
|
{
|
||||||
$ilink++;
|
$ilink++;
|
||||||
|
|
||||||
$trclass='oddeven';
|
$trclass='oddeven';
|
||||||
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
|
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
|
||||||
?>
|
?>
|
||||||
<tr class="<?php echo $trclass; ?>">
|
<tr class="<?php echo $trclass; ?>">
|
||||||
<td><?php echo $langs->trans("SupplierProposal"); ?></td>
|
<td><?php echo $langs->trans("SupplierProposal"); ?></td>
|
||||||
<td><a href="<?php echo DOL_URL_ROOT.'/supplier_proposal/card.php?id='.$objectlink->id ?>"><?php echo img_object($langs->trans("ShowSupplierProposal"), "supplier_proposal").' '.$objectlink->ref; ?></a></td>
|
<td><a href="<?php echo DOL_URL_ROOT.'/supplier_proposal/card.php?id='.$objectlink->id ?>"><?php echo img_object($langs->trans("ShowSupplierProposal"), "supplier_proposal").' '.$objectlink->ref; ?></a></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td class="center"><?php echo dol_print_date($objectlink->datec, 'day'); ?></td>
|
<td class="center"><?php echo dol_print_date($objectlink->datec, 'day'); ?></td>
|
||||||
<td class="right"><?php
|
<td class="right"><?php
|
||||||
if ($user->rights->supplier_proposal->lire) {
|
if ($user->rights->supplier_proposal->lire) {
|
||||||
$total = $total + $objectlink->total_ht;
|
$total = $total + $objectlink->total_ht;
|
||||||
echo price($objectlink->total_ht);
|
echo price($objectlink->total_ht);
|
||||||
} ?></td>
|
} ?></td>
|
||||||
<td class="right"><?php echo $objectlink->getLibStatut(3); ?></td>
|
<td class="right"><?php echo $objectlink->getLibStatut(3); ?></td>
|
||||||
<td class="right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td>
|
<td class="right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
if (count($linkedObjectBlock) > 1)
|
if (count($linkedObjectBlock) > 1)
|
||||||
{
|
{
|
||||||
@ -72,6 +71,5 @@ if (count($linkedObjectBlock) > 1)
|
|||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
|
|
||||||
<!-- END PHP TEMPLATE -->
|
print "<!-- END PHP TEMPLATE -->\n";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user