This commit is contained in:
Frédéric FRANCE
2019-10-20 11:17:54 +02:00
parent 66b0c27645
commit 33c35780e0
26 changed files with 479 additions and 506 deletions

View File

@@ -148,7 +148,7 @@ foreach ($modulesdir as $dir)
}*/ }*/
//$listofapis[]=array('classname'=>$classname, 'fullpath'=>$file_searched); //$listofapis[]=array('classname'=>$classname, 'fullpath'=>$file_searched);
/* } /* }
}*/ }*/
} }

View File

@@ -262,9 +262,9 @@ class DolibarrApi
if ($tmp[$i]==')') $counter--; if ($tmp[$i]==')') $counter--;
if ($counter < 0) if ($counter < 0)
{ {
$error="Bad sqlfilters=".$sqlfilters; $error="Bad sqlfilters=".$sqlfilters;
dol_syslog($error, LOG_WARNING); dol_syslog($error, LOG_WARNING);
return false; return false;
} }
$i++; $i++;
} }

View File

@@ -533,13 +533,15 @@ class Setup extends DolibarrApi
if (!empty($multicurrency)) $sql.= " , cr.date_sync, cr.rate "; if (!empty($multicurrency)) $sql.= " , cr.date_sync, cr.rate ";
$sql.= " FROM ".MAIN_DB_PREFIX."c_currencies as t"; $sql.= " FROM ".MAIN_DB_PREFIX."c_currencies as t";
if (!empty($multicurrency)) { if (!empty($multicurrency)) {
$sql.= " JOIN ".MAIN_DB_PREFIX."multicurrency as m ON m.code=t.code_iso"; $sql.= " JOIN ".MAIN_DB_PREFIX."multicurrency as m ON m.code=t.code_iso";
$sql.= " JOIN ".MAIN_DB_PREFIX."multicurrency_rate as cr ON (m.rowid = cr.fk_multicurrency)"; $sql.= " JOIN ".MAIN_DB_PREFIX."multicurrency_rate as cr ON (m.rowid = cr.fk_multicurrency)";
} }
$sql.= " WHERE t.active = ".$active; $sql.= " WHERE t.active = ".$active;
if (!empty($multicurrency)) { if (!empty($multicurrency)) {
$sql.= " AND m.entity IN (".getEntity('multicurrency').")"; $sql.= " AND m.entity IN (".getEntity('multicurrency').")";
if (!empty($multicurrency) && $multicurrency != 2) $sql.= " AND cr.date_sync = (SELECT MAX(cr2.date_sync) FROM ".MAIN_DB_PREFIX."multicurrency_rate AS cr2 WHERE cr2.fk_multicurrency = m.rowid)"; if (!empty($multicurrency) && $multicurrency != 2) {
$sql.= " AND cr.date_sync = (SELECT MAX(cr2.date_sync) FROM ".MAIN_DB_PREFIX."multicurrency_rate AS cr2 WHERE cr2.fk_multicurrency = m.rowid)";
}
} }
// Add sql filters // Add sql filters
@@ -924,7 +926,7 @@ class Setup extends DolibarrApi
$sql = "SELECT rowid, code, pos, label, use_default, description"; $sql = "SELECT rowid, code, pos, label, use_default, description";
$sql.= " FROM ".MAIN_DB_PREFIX."c_ticket_category as t"; $sql.= " FROM ".MAIN_DB_PREFIX."c_ticket_category as t";
$sql.= " WHERE t.active = ".$active; $sql.= " WHERE t.active = ".$active;
// Add sql filters // Add sql filters
if ($sqlfilters) if ($sqlfilters)
{ {

View File

@@ -574,7 +574,7 @@ jQuery(document).ready(function () {
if(!empty($conf->global->BLOCKEDLOG_USE_REMOTE_AUTHORITY) && !empty($conf->global->BLOCKEDLOG_AUTHORITY_URL)) if(!empty($conf->global->BLOCKEDLOG_USE_REMOTE_AUTHORITY) && !empty($conf->global->BLOCKEDLOG_AUTHORITY_URL))
{ {
?> ?>
<script type="text/javascript"> <script type="text/javascript">
$.ajax({ $.ajax({
@@ -592,7 +592,7 @@ if(!empty($conf->global->BLOCKEDLOG_USE_REMOTE_AUTHORITY) && !empty($conf->globa
}); });
</script> </script>
<?php <?php
} }
if (GETPOST('withtab', 'alpha')) if (GETPOST('withtab', 'alpha'))

View File

@@ -575,7 +575,7 @@ class BlockedLog
foreach($tmpobject->thirdparty as $key=>$value) foreach($tmpobject->thirdparty as $key=>$value)
{ {
if (in_array($key, $arrayoffieldstoexclude)) continue; // Discard some properties if (in_array($key, $arrayoffieldstoexclude)) continue; // Discard some properties
if (! in_array($key, array( if (! in_array($key, array(
'name','name_alias','ref_ext','address','zip','town','state_code','country_code','idprof1','idprof2','idprof3','idprof4','idprof5','idprof6','phone','fax','email','barcode', 'name','name_alias','ref_ext','address','zip','town','state_code','country_code','idprof1','idprof2','idprof3','idprof4','idprof5','idprof6','phone','fax','email','barcode',
'tva_intra', 'localtax1_assuj', 'localtax1_value', 'localtax2_assuj', 'localtax2_value', 'managers', 'capital', 'typent_code', 'forme_juridique_code', 'code_client', 'code_fournisseur' 'tva_intra', 'localtax1_assuj', 'localtax1_value', 'localtax2_assuj', 'localtax2_value', 'managers', 'capital', 'typent_code', 'forme_juridique_code', 'code_client', 'code_fournisseur'
))) continue; // Discard if not into a dedicated list ))) continue; // Discard if not into a dedicated list
@@ -592,7 +592,7 @@ class BlockedLog
foreach($tmpobject as $key=>$value) foreach($tmpobject as $key=>$value)
{ {
if (in_array($key, $arrayoffieldstoexclude)) continue; // Discard some properties if (in_array($key, $arrayoffieldstoexclude)) continue; // Discard some properties
if (! in_array($key, array( if (! in_array($key, array(
'ref','ref_client','ref_supplier','date','datef','type','total_ht','total_tva','total_ttc','localtax1','localtax2','revenuestamp','datepointoftax','note_public' 'ref','ref_client','ref_supplier','date','datef','type','total_ht','total_tva','total_ttc','localtax1','localtax2','revenuestamp','datepointoftax','note_public'
))) continue; // Discard if not into a dedicated list ))) continue; // Discard if not into a dedicated list
if (!is_object($value)) if (!is_object($value))

View File

@@ -47,22 +47,20 @@ $colspan = 3; // Columns: total ht + col edit + col delete
// Lines for extrafield // Lines for extrafield
$objectline = new BOMLine($this->db); $objectline = new BOMLine($this->db);
?>
<!-- BEGIN PHP TEMPLATE objectline_create.tpl.php --> print "<!-- BEGIN PHP TEMPLATE objectline_create.tpl.php -->\n";
<?php
$nolinesbefore=(count($this->lines) == 0 || $forcetoshowtitlelines); $nolinesbefore=(count($this->lines) == 0 || $forcetoshowtitlelines);
if ($nolinesbefore) { if ($nolinesbefore) {
?> print '<tr class="liste_titre'.($nolinesbefore?'':' liste_titre_add_').' nodrag nodrop">';
<tr class="liste_titre<?php echo ($nolinesbefore?'':' liste_titre_add_') ?> nodrag nodrop"> if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
<?php if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?> print '<td class="linecolnum center"></td>';
<td class="linecolnum center"></td> }
<?php } ?> print '<td class="linecoldescription minwidth500imp">';
<td class="linecoldescription minwidth500imp"> print '<div id="add"></div><span class="hideonsmartphone">'.$langs->trans('AddNewLine').'</span>';
<div id="add"></div><span class="hideonsmartphone"><?php echo $langs->trans('AddNewLine'); ?></span><?php // echo $langs->trans("FreeZone"); ?> // echo $langs->trans("FreeZone");
</td> print '</td>';
<td class="linecolqty right"><?php echo $langs->trans('Qty'); ?></td> print '<td class="linecolqty right">'.$langs->trans('Qty').'</td>';
<?php
if ($conf->global->PRODUCT_USE_UNITS) if ($conf->global->PRODUCT_USE_UNITS)
{ {
print '<td class="linecoluseunit left">'; print '<td class="linecoluseunit left">';
@@ -70,76 +68,68 @@ if ($nolinesbefore) {
print $langs->trans('Unit'); print $langs->trans('Unit');
print '</span></td>'; print '</span></td>';
} }
?> print '<td class="linecollost right">'.$form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')).'</td>';
<td class="linecollost right"><?php echo $form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')); ?></td> print '<td class="linecoledit" colspan="'.$colspan.'">&nbsp;</td>';
<td class="linecoledit" colspan="<?php echo $colspan; ?>">&nbsp;</td> print '</tr>';
</tr>
<?php
} }
?> print '<tr class="pair nodrag nodrop nohoverpair'.($nolinesbefore || $object->element=='contrat')?'':' liste_titre_create'.'">';
<tr class="pair nodrag nodrop nohoverpair<?php echo ($nolinesbefore || $object->element=='contrat')?'':' liste_titre_create'; ?>"> $coldisplay=0;
<?php
$coldisplay=0;
// Adds a line numbering column
if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
$coldisplay++;
echo '<td class="nobottom linecolnum center"></td>';
}
// Adds a line numbering column
if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
$coldisplay++; $coldisplay++;
?> echo '<td class="nobottom linecolnum center"></td>';
<td class="nobottom linecoldescription minwidth500imp"> }
<?php $coldisplay++;
// Predefined product/service print '<td class="nobottom linecoldescription minwidth500imp">';
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled))
// Predefined product/service
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled))
{
if ($forceall >= 0 && $freelines) echo '<br>';
echo '<span class="prod_entry_mode_predef">';
$filtertype='';
if (! empty($object->element) && $object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $filtertype='1';
$statustoshow = -1;
if (! empty($conf->global->ENTREPOT_EXTRA_STATUS))
{ {
if ($forceall >= 0 && $freelines) echo '<br>'; // hide products in closed warehouse, but show products for internal transfer
echo '<span class="prod_entry_mode_predef">'; $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array'));
$filtertype=''; }
if (! empty($object->element) && $object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $filtertype='1'; else
{
$statustoshow = -1; $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, '', GETPOST('combinations', 'array'));
if (! empty($conf->global->ENTREPOT_EXTRA_STATUS))
{
// hide products in closed warehouse, but show products for internal transfer
$form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array'));
}
else
{
$form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, '', GETPOST('combinations', 'array'));
}
echo '</span>';
} }
$coldisplay++; echo '</span>';
?> }
<td class="nobottom linecolqty right"><input type="text" size="2" name="qty" id="qty" class="flat right" value="<?php echo (isset($_POST["qty"])?GETPOST("qty", 'alpha', 2):1); ?>">
</td>
<?php
if($conf->global->PRODUCT_USE_UNITS)
{
$coldisplay++;
print '<td class="nobottom linecoluseunit left">';
print $form->selectUnits($line->fk_unit, "units");
print '</td>';
}
$coldisplay++; $coldisplay++;
?> print '<td class="nobottom linecolqty right"><input type="text" size="2" name="qty" id="qty" class="flat right" value="'.(isset($_POST["qty"])?GETPOST("qty", 'alpha', 2):1).'">';
<td class="nobottom nowrap linecollost right"><input type="text" size="1" name="efficiency" id="efficiency" class="flat right" value="<?php echo (GETPOSTISSET("efficiency")?GETPOST("efficiency", 'alpha'):1); ?>"></td> print '</td>';
<?php if($conf->global->PRODUCT_USE_UNITS)
{
$coldisplay++;
print '<td class="nobottom linecoluseunit left">';
print $form->selectUnits($line->fk_unit, "units");
print '</td>';
}
$coldisplay+=$colspan; $coldisplay++;
?>
<td class="nobottom linecoledit center valignmiddle" colspan="<?php echo $colspan; ?>"> print '<td class="nobottom nowrap linecollost right">';
<input type="submit" class="button" value="<?php echo $langs->trans('Add'); ?>" name="addline" id="addline"> print '<input type="text" size="1" name="efficiency" id="efficiency" class="flat right" value="'.(GETPOSTISSET("efficiency")?GETPOST("efficiency", 'alpha'):1).'">';
</td> print '</td>';
</tr>
$coldisplay += $colspan;
print '<td class="nobottom linecoledit center valignmiddle" colspan="'.$colspan.'">';
print '<input type="submit" class="button" value="'.$langs->trans('Add').'" name="addline" id="addline">';
print '</td>';
print '</tr>';
<?php
if (is_object($objectline)) { if (is_object($objectline)) {
print $objectline->showOptionals($extrafields, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1); print $objectline->showOptionals($extrafields, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1);
} }

View File

@@ -49,22 +49,19 @@ $colspan = 3; // Columns: total ht + col edit + col delete
// Lines for extrafield // Lines for extrafield
$objectline = new BOMLine($this->db); $objectline = new BOMLine($this->db);
?>
<!-- BEGIN PHP TEMPLATE objectline_edit.tpl.php --> print "<!-- BEGIN PHP TEMPLATE objectline_edit.tpl.php -->\n";
<?php
$coldisplay=0; $coldisplay=0;
?> print '<tr class="oddeven tredited">';
<tr class="oddeven tredited"> // Adds a line numbering column
<?php if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
// Adds a line numbering column print '<td class="linecolnum center">'.($i+1).'</td>';
if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?>
<td class="linecolnum center"><?php $coldisplay++; ?><?php echo ($i+1); ?></td>
<?php }
$coldisplay++; $coldisplay++;
?> }
$coldisplay++;
?>
<td> <td>
<div id="line_<?php echo $line->id; ?>"></div> <div id="line_<?php echo $line->id; ?>"></div>
@@ -74,72 +71,66 @@ $coldisplay=0;
<input type="hidden" id="special_code" name="special_code" value="<?php echo $line->special_code; ?>"> <input type="hidden" id="special_code" name="special_code" value="<?php echo $line->special_code; ?>">
<input type="hidden" id="fk_parent_line" name="fk_parent_line" value="<?php echo $line->fk_parent_line; ?>"> <input type="hidden" id="fk_parent_line" name="fk_parent_line" value="<?php echo $line->fk_parent_line; ?>">
<?php
// Predefined product/service
if ($line->fk_product > 0) {
$tmpproduct = new Product($object->db);
$tmpproduct->fetch($line->fk_product);
print $tmpproduct->getNomUrl(1);
}
if (is_object($hookmanager))
{
$fk_parent_line = (GETPOST('fk_parent_line') ? GETPOST('fk_parent_line') : $line->fk_parent_line);
$parameters=array('line'=>$line,'fk_parent_line'=>$fk_parent_line,'var'=>$var,'dateSelector'=>$dateSelector,'seller'=>$seller,'buyer'=>$buyer);
$reshook=$hookmanager->executeHooks('formEditProductOptions', $parameters, $this, $action);
}
?>
</td>
<?php
/*if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines
{
$coldisplay++;
?>
<td class="right"><input id="fourn_ref" name="fourn_ref" class="flat minwidth75" value="<?php echo ($line->ref_supplier ? $line->ref_supplier : $line->ref_fourn); ?>"></td>
<?php
*/
$coldisplay++;
?>
<td class="nobottom linecolqty right">
<?php if (($line->info_bits & 2) != 2) {
// I comment this because it shows info even when not required
// for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated
// must also not be output for most entities (proposal, intervention, ...)
//if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." ";
print '<input size="3" type="text" class="flat right" name="qty" id="qty" value="' . $line->qty . '">';
}
?>
</td>
<?php
if($conf->global->PRODUCT_USE_UNITS)
{
$coldisplay++;
print '<td class="nobottom linecoluseunit left">';
print $form->selectUnits($line->fk_unit, "units");
print '</td>';
}
$coldisplay++;
?>
<td class="nobottom nowrap linecollost right"><input type="text" size="1" name="efficiency" id="efficiency" class="flat right" value="<?php echo $line->efficiency; ?>"></td>
<?php
$coldisplay+=$colspan;
?>
<td class="nobottom linecoledit center valignmiddle" colspan="<?php echo $colspan; ?>"><?php $coldisplay+=$colspan; ?>
<input type="submit" class="button" id="savelinebutton" name="save" value="<?php echo $langs->trans("Save"); ?>"><br>
<input type="submit" class="button" id="cancellinebutton" name="cancel" value="<?php echo $langs->trans("Cancel"); ?>">
</td>
</tr>
<?php <?php
// Predefined product/service
if ($line->fk_product > 0) {
$tmpproduct = new Product($object->db);
$tmpproduct->fetch($line->fk_product);
print $tmpproduct->getNomUrl(1);
}
if (is_object($hookmanager))
{
$fk_parent_line = (GETPOST('fk_parent_line') ? GETPOST('fk_parent_line') : $line->fk_parent_line);
$parameters=array('line'=>$line,'fk_parent_line'=>$fk_parent_line,'var'=>$var,'dateSelector'=>$dateSelector,'seller'=>$seller,'buyer'=>$buyer);
$reshook=$hookmanager->executeHooks('formEditProductOptions', $parameters, $this, $action);
}
print '</td>';
/*if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines
{
$coldisplay++;
?>
<td class="right"><input id="fourn_ref" name="fourn_ref" class="flat minwidth75" value="<?php echo ($line->ref_supplier ? $line->ref_supplier : $line->ref_fourn); ?>"></td>
<?php
*/
$coldisplay++;
print '<td class="nobottom linecolqty right">';
if (($line->info_bits & 2) != 2) {
// I comment this because it shows info even when not required
// for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated
// must also not be output for most entities (proposal, intervention, ...)
//if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." ";
print '<input size="3" type="text" class="flat right" name="qty" id="qty" value="' . $line->qty . '">';
}
print '</td>';
if ($conf->global->PRODUCT_USE_UNITS)
{
$coldisplay++;
print '<td class="nobottom linecoluseunit left">';
print $form->selectUnits($line->fk_unit, "units");
print '</td>';
}
$coldisplay++;
print '<td class="nobottom nowrap linecollost right">';
print '<input type="text" size="1" name="efficiency" id="efficiency" class="flat right" value="'.$line->efficiency.'"></td>';
$coldisplay+=$colspan;
print '<td class="nobottom linecoledit center valignmiddle" colspan="'.$colspan.'">';
$coldisplay+=$colspan;
print '<input type="submit" class="button" id="savelinebutton" name="save" value="'.$langs->trans("Save").'">';
print '<br>';
print '<input type="submit" class="button" id="cancellinebutton" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</td>';
print '</tr>';
if (is_object($objectline)) { if (is_object($objectline)) {
print $objectline->showOptionals($extrafields, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1); print $objectline->showOptionals($extrafields, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1);
} }
?>
<!-- END PHP TEMPLATE objectline_edit.tpl.php --> print "<!-- END PHP TEMPLATE objectline_edit.tpl.php -->\n";

View File

@@ -39,9 +39,7 @@ if (empty($object) || ! is_object($object))
print "Error, template page can't be called as URL"; print "Error, template page can't be called as URL";
exit; exit;
} }
?> print "<!-- BEGIN PHP TEMPLATE objectline_title.tpl.php -->\n";
<!-- BEGIN PHP TEMPLATE objectline_title.tpl.php -->
<?php
// Title line // Title line
print "<thead>\n"; print "<thead>\n";
@@ -79,6 +77,5 @@ if ($action == 'selectlines')
print "</tr>\n"; print "</tr>\n";
print "</thead>\n"; print "</thead>\n";
?>
<!-- END PHP TEMPLATE objectline_title.tpl.php --> print "<!-- END PHP TEMPLATE objectline_title.tpl.php -->\n";

View File

@@ -59,100 +59,93 @@ $domData .= ' data-product_type="'.$line->product_type.'"';
// Lines for extrafield // Lines for extrafield
$objectline = new BOMLine($object->db); $objectline = new BOMLine($object->db);
?> $coldisplay=0;
<?php $coldisplay=0; ?> print "<!-- BEGIN PHP TEMPLATE objectline_view.tpl.php -->\n";
<!-- BEGIN PHP TEMPLATE objectline_view.tpl.php --> print '<tr id="row-'.$line->id.'" class="drag drop oddeven" '.$domData.' >';
<tr id="row-<?php echo $line->id?>" class="drag drop oddeven" <?php echo $domData; ?> > if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
<?php if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?> print '<td class="linecolnum center">'.($i+1).'</td>';
<td class="linecolnum center"><?php $coldisplay++; ?><?php echo ($i+1); ?></td> $coldisplay++;
<?php } ?> }
<td class="linecoldescription minwidth300imp"><?php $coldisplay++; ?><div id="line_<?php echo $line->id; ?>"></div> print '<td class="linecoldescription minwidth300imp">';
<?php print '<div id="line_'.$line->id.'"></div>';
$tmpproduct = new Product($object->db); $coldisplay++;
$tmpproduct->fetch($line->fk_product); $tmpproduct = new Product($object->db);
print $tmpproduct->getNomUrl(1); $tmpproduct->fetch($line->fk_product);
?> print $tmpproduct->getNomUrl(1);
</td> print '</td>';
<td class="linecolqty nowrap right"><?php $coldisplay++; ?> print '<td class="linecolqty nowrap right">';
<?php $coldisplay++;
echo price($line->qty, 0, '', 0, 0); // Yes, it is a quantity, not a price, but we just want the formating role of function price echo price($line->qty, 0, '', 0, 0); // Yes, it is a quantity, not a price, but we just want the formating role of function price
?> print '</td>';
</td>
<?php if($conf->global->PRODUCT_USE_UNITS)
if($conf->global->PRODUCT_USE_UNITS) {
{ print '<td class="linecoluseunit nowrap left">';
print '<td class="linecoluseunit nowrap left">'; $label = $line->getLabelOfUnit('short');
$label = $line->getLabelOfUnit('short'); if ($label !== '') {
if ($label !== '') { print $langs->trans($label);
print $langs->trans($label); }
print '</td>';
}
print '<td class="linecolqty nowrap right">';
$coldisplay++;
echo $line->efficiency;
print '</td>';
if ($this->statut == 0 && ($object_rights->write) && $action != 'selectlines' ) {
print '<td class="linecoledit center">';
$coldisplay++;
if (($line->info_bits & 2) == 2 || ! empty($disableedit)) {
} else {
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=editline&amp;lineid='.$line->id.'#line_'.$line->id.'">'.img_edit().'</a>';
}
print '</td>';
print '<td class="linecoldelete center">';
$coldisplay++;
if (($line->fk_prev_id == null ) && empty($disableremove)) {
//La suppression n'est autorisée que si il n'y a pas de ligne dans une précédente situation
print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $this->id . '&amp;action=deleteline&amp;lineid=' . $line->id . '">';
print img_delete();
print '</a>';
}
print '</td>';
if ($num > 1 && $conf->browser->layout != 'phone' && empty($disablemove)) {
print '<td class="linecolmove tdlineupdown center">';
$coldisplay++;
if ($i > 0) {
print '<a class="lineupdown" href="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=up&amp;rowid='.$line->id.'">';
echo img_up('default', 0, 'imgupforline');
print '</a>';
}
if ($i < $num-1) {
print '<a class="lineupdown" href="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=down&amp;rowid='.$line->id.'">';
echo img_down('default', 0, 'imgdownforline');
print '</a>';
} }
print '</td>'; print '</td>';
} else {
print '<td '.(($conf->browser->layout != 'phone' && empty($disablemove)) ?' class="linecolmove tdlineupdown center"':' class="linecolmove center"').'></td>';
$coldisplay++;
} }
?> } else {
<td class="linecolqty nowrap right"><?php $coldisplay++; ?> print '<td colspan="3"></td>';
<?php $coldisplay=$coldisplay+3;
echo $line->efficiency; }
?>
</td>
<?php
if ($this->statut == 0 && ($object_rights->write) && $action != 'selectlines' ) { ?> if ($action == 'selectlines') {
<td class="linecoledit center"><?php $coldisplay++; ?> print '<td class="linecolcheck center">';
<?php if (($line->info_bits & 2) == 2 || ! empty($disableedit)) { ?> print '<input type="checkbox" class="linecheckbox" name="line_checkbox['.($i+1).']" value="'.$line->id.'" >';
<?php } else { ?> print '</td>';
<a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=editline&amp;lineid='.$line->id.'#line_'.$line->id; ?>"> }
<?php echo img_edit(); ?>
</a>
<?php } ?>
</td>
<td class="linecoldelete center"><?php $coldisplay++; ?> print '</tr>';
<?php
if (($line->fk_prev_id == null ) && empty($disableremove)) { //La suppression n'est autorisée que si il n'y a pas de ligne dans une précédente situation
print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $this->id . '&amp;action=deleteline&amp;lineid=' . $line->id . '">';
print img_delete();
print '</a>';
}
?>
</td>
<?php
if ($num > 1 && $conf->browser->layout != 'phone' && empty($disablemove)) { ?>
<td class="linecolmove tdlineupdown center"><?php $coldisplay++; ?>
<?php if ($i > 0) { ?>
<a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=up&amp;rowid='.$line->id; ?>">
<?php echo img_up('default', 0, 'imgupforline'); ?>
</a>
<?php } ?>
<?php if ($i < $num-1) { ?>
<a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=down&amp;rowid='.$line->id; ?>">
<?php echo img_down('default', 0, 'imgdownforline'); ?>
</a>
<?php } ?>
</td>
<?php } else { ?>
<td <?php echo (($conf->browser->layout != 'phone' && empty($disablemove)) ?' class="linecolmove tdlineupdown center"':' class="linecolmove center"'); ?>><?php $coldisplay++; ?></td>
<?php } ?>
<?php
} else {
?>
<td colspan="3"><?php $coldisplay=$coldisplay+3; ?></td>
<?php
}
if($action == 'selectlines'){ ?>
<td class="linecolcheck center"><input type="checkbox" class="linecheckbox" name="line_checkbox[<?php echo $i+1; ?>]" value="<?php echo $line->id; ?>" ></td>
<?php } ?>
</tr>
<?php
//Line extrafield //Line extrafield
if (!empty($extrafields)) if (!empty($extrafields))
{ {
print $line->showOptionals($extrafields, 'view', array('style'=>'class="drag drop oddeven"','colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1); print $line->showOptionals($extrafields, 'view', array('style'=>'class="drag drop oddeven"','colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1);
} }
?>
<!-- END PHP TEMPLATE objectline_view.tpl.php --> print "<!-- END PHP TEMPLATE objectline_view.tpl.php -->\n";

View File

@@ -155,8 +155,8 @@ $type='directory';
// This test if file exists should be useless. We keep it to find bug more easily // This test if file exists should be useless. We keep it to find bug more easily
if (! dol_is_dir($upload_dir)) if (! dol_is_dir($upload_dir))
{ {
// dol_mkdir($upload_dir); //dol_mkdir($upload_dir);
/* $langs->load("install"); /*$langs->load("install");
dol_print_error(0,$langs->trans("ErrorDirDoesNotExists",$upload_dir)); dol_print_error(0,$langs->trans("ErrorDirDoesNotExists",$upload_dir));
exit;*/ exit;*/
} }

View File

@@ -73,7 +73,7 @@ if ($boxorder && $zone != '' && $userid > 0)
$langs->load("boxes"); $langs->load("boxes");
if (! GETPOST('closing')) if (! GETPOST('closing'))
{ {
setEventMessages($langs->trans("BoxAdded"), null); setEventMessages($langs->trans("BoxAdded"), null);
} }
} }
} }

View File

@@ -318,7 +318,7 @@ function FileUpload($resourceType, $currentFolder, $sCommand, $CKEcallback = '')
else else
{ {
//issue the CKEditor Callback //issue the CKEditor Callback
SendCKEditorResults( SendCKEditorResults(
$CKEcallback, $CKEcallback,
$sFileUrl, $sFileUrl,
($sErrorNumber != 0 ? 'Error '. $sErrorNumber. ' upload failed.' : 'Upload Successful') ($sErrorNumber != 0 ? 'Error '. $sErrorNumber. ' upload failed.' : 'Upload Successful')

View File

@@ -401,11 +401,11 @@ EOF;
*/ */
function SendCKEditorResults($callback, $sFileUrl, $customMsg = '') function SendCKEditorResults($callback, $sFileUrl, $customMsg = '')
{ {
echo '<script type="text/javascript">'; echo '<script type="text/javascript">';
$rpl = array( '\\' => '\\\\', '"' => '\\"' ); $rpl = array( '\\' => '\\\\', '"' => '\\"' );
echo 'window.parent.CKEDITOR.tools.callFunction("'. $callback. '","'. strtr($sFileUrl, $rpl). '", "'. strtr($customMsg, $rpl). '");' ; echo 'window.parent.CKEDITOR.tools.callFunction("'. $callback. '","'. strtr($sFileUrl, $rpl). '", "'. strtr($customMsg, $rpl). '");' ;
echo '</script>'; echo '</script>';
} }

View File

@@ -1039,16 +1039,16 @@ function price2numjs(amount) {
if (amount == '') return ''; if (amount == '') return '';
<?php <?php
$dec = ','; $dec = ',';
$thousand = ' '; $thousand = ' ';
if ($langs->transnoentitiesnoconv("SeparatorDecimal") != "SeparatorDecimal") { if ($langs->transnoentitiesnoconv("SeparatorDecimal") != "SeparatorDecimal") {
$dec = $langs->transnoentitiesnoconv("SeparatorDecimal"); $dec = $langs->transnoentitiesnoconv("SeparatorDecimal");
} }
if ($langs->transnoentitiesnoconv("SeparatorThousand") != "SeparatorThousand") { if ($langs->transnoentitiesnoconv("SeparatorThousand") != "SeparatorThousand") {
$thousand = $langs->transnoentitiesnoconv("SeparatorThousand"); $thousand = $langs->transnoentitiesnoconv("SeparatorThousand");
} }
if ($thousand == 'Space') $thousand=' '; if ($thousand == 'Space') $thousand=' ';
print "var dec='" . dol_escape_js($dec) . "'; var thousand='" . dol_escape_js($thousand) . "';\n"; // Set var in javascript print "var dec='" . dol_escape_js($dec) . "'; var thousand='" . dol_escape_js($thousand) . "';\n"; // Set var in javascript
?> ?>
var main_max_dec_shown = <?php echo (int) str_replace('.', '', $conf->global->MAIN_MAX_DECIMALS_SHOWN); ?>; var main_max_dec_shown = <?php echo (int) str_replace('.', '', $conf->global->MAIN_MAX_DECIMALS_SHOWN); ?>;

View File

@@ -140,5 +140,5 @@ if (! ($_SERVER['HTTP_REFERER'] === $dolibarr_main_url_root . '/' || $_SERVER['H
time_js_next_test += time_auto_update; time_js_next_test += time_auto_update;
console.log('Updated time_js_next_test. New value is '+time_js_next_test); console.log('Updated time_js_next_test. New value is '+time_js_next_test);
} }
<?php <?php
} }

View File

@@ -260,7 +260,7 @@ function show_array_actions_to_do($max = 5)
$staticaction->id=$obj->id; $staticaction->id=$obj->id;
print '<td>'.$staticaction->getNomUrl(1, 34).'</td>'; print '<td>'.$staticaction->getNomUrl(1, 34).'</td>';
// print '<td>'.dol_trunc($obj->label,22).'</td>'; // print '<td>'.dol_trunc($obj->label,22).'</td>';
print '<td>'; print '<td>';
if ($obj->rowid > 0) if ($obj->rowid > 0)
@@ -414,10 +414,10 @@ function agenda_prepare_head()
if ($conf->global->MAIN_FEATURES_LEVEL > 0) if ($conf->global->MAIN_FEATURES_LEVEL > 0)
{ {
$head[$h][0] = DOL_URL_ROOT."/admin/agenda_reminder.php"; $head[$h][0] = DOL_URL_ROOT."/admin/agenda_reminder.php";
$head[$h][1] = $langs->trans("Reminders"); $head[$h][1] = $langs->trans("Reminders");
$head[$h][2] = 'reminders'; $head[$h][2] = 'reminders';
$h++; $h++;
} }
$head[$h][0] = DOL_URL_ROOT."/admin/agenda_xcal.php"; $head[$h][0] = DOL_URL_ROOT."/admin/agenda_xcal.php";

View File

@@ -47,13 +47,13 @@ function bank_prepare_head(Account $object)
$head[$h][2] = 'journal'; $head[$h][2] = 'journal';
$h++; $h++;
// if ($conf->global->MAIN_FEATURES_LEVEL >= 1) // if ($conf->global->MAIN_FEATURES_LEVEL >= 1)
// { // {
$head[$h][0] = DOL_URL_ROOT . "/compta/bank/treso.php?account=" . $object->id; $head[$h][0] = DOL_URL_ROOT . "/compta/bank/treso.php?account=" . $object->id;
$head[$h][1] = $langs->trans("PlannedTransactions"); $head[$h][1] = $langs->trans("PlannedTransactions");
$head[$h][2] = 'cash'; $head[$h][2] = 'cash';
$h++; $h++;
// } // }
$head[$h][0] = DOL_URL_ROOT . "/compta/bank/annuel.php?account=" . $object->id; $head[$h][0] = DOL_URL_ROOT . "/compta/bank/annuel.php?account=" . $object->id;
$head[$h][1] = $langs->trans("IOMonthlyReporting"); $head[$h][1] = $langs->trans("IOMonthlyReporting");

View File

@@ -624,7 +624,7 @@ function dolReplaceInFile($srcfile, $arrayreplacement, $destfile = '', $newmask
if (empty($arrayreplacementisregex)) if (empty($arrayreplacementisregex))
{ {
$content = make_substitutions($content, $arrayreplacement, null); $content = make_substitutions($content, $arrayreplacement, null);
} }
else else
{ {
@@ -1044,8 +1044,8 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
$checkvirusarray=dolCheckVirus($src_file); $checkvirusarray=dolCheckVirus($src_file);
if (count($checkvirusarray)) if (count($checkvirusarray))
{ {
dol_syslog('Files.lib::dol_move_uploaded_file File "'.$src_file.'" (target name "'.$dest_file.'") KO with antivirus: errors='.join(',', $checkvirusarray), LOG_WARNING); dol_syslog('Files.lib::dol_move_uploaded_file File "'.$src_file.'" (target name "'.$dest_file.'") KO with antivirus: errors='.join(',', $checkvirusarray), LOG_WARNING);
return 'ErrorFileIsInfectedWithAVirus: '.join(',', $checkvirusarray); return 'ErrorFileIsInfectedWithAVirus: '.join(',', $checkvirusarray);
} }
} }

View File

@@ -464,36 +464,36 @@ function GETPOST($paramname, $check = 'none', $method = 0, $filter = null, $opti
$maxloop=20; $loopnb=0; // Protection against infinite loop $maxloop=20; $loopnb=0; // Protection against infinite loop
while (preg_match('/__([A-Z0-9]+_?[A-Z0-9]+)__/i', $out, $reg) && ($loopnb < $maxloop)) // Detect '__ABCDEF__' as key 'ABCDEF' and '__ABC_DEF__' as key 'ABC_DEF'. Detection is also correct when 2 vars are side by side. while (preg_match('/__([A-Z0-9]+_?[A-Z0-9]+)__/i', $out, $reg) && ($loopnb < $maxloop)) // Detect '__ABCDEF__' as key 'ABCDEF' and '__ABC_DEF__' as key 'ABC_DEF'. Detection is also correct when 2 vars are side by side.
{ {
$loopnb++; $newout = ''; $loopnb++; $newout = '';
if ($reg[1] == 'DAY') { $tmp=dol_getdate(dol_now(), true); $newout = $tmp['mday']; } if ($reg[1] == 'DAY') { $tmp=dol_getdate(dol_now(), true); $newout = $tmp['mday']; }
elseif ($reg[1] == 'MONTH') { $tmp=dol_getdate(dol_now(), true); $newout = $tmp['mon']; } elseif ($reg[1] == 'MONTH') { $tmp=dol_getdate(dol_now(), true); $newout = $tmp['mon']; }
elseif ($reg[1] == 'YEAR') { $tmp=dol_getdate(dol_now(), true); $newout = $tmp['year']; } elseif ($reg[1] == 'YEAR') { $tmp=dol_getdate(dol_now(), true); $newout = $tmp['year']; }
elseif ($reg[1] == 'PREVIOUS_DAY') { $tmp=dol_getdate(dol_now(), true); $tmp2=dol_get_prev_day($tmp['mday'], $tmp['mon'], $tmp['year']); $newout = $tmp2['day']; } elseif ($reg[1] == 'PREVIOUS_DAY') { $tmp=dol_getdate(dol_now(), true); $tmp2=dol_get_prev_day($tmp['mday'], $tmp['mon'], $tmp['year']); $newout = $tmp2['day']; }
elseif ($reg[1] == 'PREVIOUS_MONTH') { $tmp=dol_getdate(dol_now(), true); $tmp2=dol_get_prev_month($tmp['mon'], $tmp['year']); $newout = $tmp2['month']; } elseif ($reg[1] == 'PREVIOUS_MONTH') { $tmp=dol_getdate(dol_now(), true); $tmp2=dol_get_prev_month($tmp['mon'], $tmp['year']); $newout = $tmp2['month']; }
elseif ($reg[1] == 'PREVIOUS_YEAR') { $tmp=dol_getdate(dol_now(), true); $newout = ($tmp['year'] - 1); } elseif ($reg[1] == 'PREVIOUS_YEAR') { $tmp=dol_getdate(dol_now(), true); $newout = ($tmp['year'] - 1); }
elseif ($reg[1] == 'NEXT_DAY') { $tmp=dol_getdate(dol_now(), true); $tmp2=dol_get_next_day($tmp['mday'], $tmp['mon'], $tmp['year']); $newout = $tmp2['day']; } elseif ($reg[1] == 'NEXT_DAY') { $tmp=dol_getdate(dol_now(), true); $tmp2=dol_get_next_day($tmp['mday'], $tmp['mon'], $tmp['year']); $newout = $tmp2['day']; }
elseif ($reg[1] == 'NEXT_MONTH') { $tmp=dol_getdate(dol_now(), true); $tmp2=dol_get_next_month($tmp['mon'], $tmp['year']); $newout = $tmp2['month']; } elseif ($reg[1] == 'NEXT_MONTH') { $tmp=dol_getdate(dol_now(), true); $tmp2=dol_get_next_month($tmp['mon'], $tmp['year']); $newout = $tmp2['month']; }
elseif ($reg[1] == 'NEXT_YEAR') { $tmp=dol_getdate(dol_now(), true); $newout = ($tmp['year'] + 1); } elseif ($reg[1] == 'NEXT_YEAR') { $tmp=dol_getdate(dol_now(), true); $newout = ($tmp['year'] + 1); }
elseif ($reg[1] == 'MYCOMPANY_COUNTRY_ID' || $reg[1] == 'MYCOUNTRY_ID' || $reg[1] == 'MYCOUNTRYID') elseif ($reg[1] == 'MYCOMPANY_COUNTRY_ID' || $reg[1] == 'MYCOUNTRY_ID' || $reg[1] == 'MYCOUNTRYID')
{ {
$newout = $mysoc->country_id; $newout = $mysoc->country_id;
} }
elseif ($reg[1] == 'USER_ID' || $reg[1] == 'USERID') elseif ($reg[1] == 'USER_ID' || $reg[1] == 'USERID')
{ {
$newout = $user->id; $newout = $user->id;
} }
elseif ($reg[1] == 'USER_SUPERVISOR_ID' || $reg[1] == 'SUPERVISOR_ID' || $reg[1] == 'SUPERVISORID') elseif ($reg[1] == 'USER_SUPERVISOR_ID' || $reg[1] == 'SUPERVISOR_ID' || $reg[1] == 'SUPERVISORID')
{ {
$newout = $user->fk_user; $newout = $user->fk_user;
} }
elseif ($reg[1] == 'ENTITY_ID' || $reg[1] == 'ENTITYID') elseif ($reg[1] == 'ENTITY_ID' || $reg[1] == 'ENTITYID')
{ {
$newout = $conf->entity; $newout = $conf->entity;
} }
else $newout = ''; // Key not found, we replace with empty string else $newout = ''; // Key not found, we replace with empty string
//var_dump('__'.$reg[1].'__ -> '.$newout); //var_dump('__'.$reg[1].'__ -> '.$newout);
$out = preg_replace('/__'.preg_quote($reg[1], '/').'__/', $newout, $out); $out = preg_replace('/__'.preg_quote($reg[1], '/').'__/', $newout, $out);
} }
} }
@@ -876,7 +876,7 @@ function dol_string_unaccent($str)
else else
{ {
// See http://www.ascii-code.com/ // See http://www.ascii-code.com/
$string = strtr( $string = strtr(
$str, $str,
"\xC0\xC1\xC2\xC3\xC4\xC5\xC7 "\xC0\xC1\xC2\xC3\xC4\xC5\xC7
\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1 \xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1
@@ -3829,7 +3829,7 @@ function dol_print_error($db = '', $error = '', $errors = null)
if (! empty($conf->modules)) if (! empty($conf->modules))
{ {
$out.="<b>".$langs->trans("Modules").":</b> ".join(', ', $conf->modules)."<br>\n"; $out.="<b>".$langs->trans("Modules").":</b> ".join(', ', $conf->modules)."<br>\n";
} }
if (is_object($db)) if (is_object($db))
@@ -5867,7 +5867,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
// Add SIGNATURE into substitutionarray first, so, when we will make the substitution, // Add SIGNATURE into substitutionarray first, so, when we will make the substitution,
// this will include signature content first and then replace var found into content of signature // this will include signature content first and then replace var found into content of signature
$signature = $user->signature; $signature = $user->signature;
$substitutionarray=array_merge($substitutionarray, array( $substitutionarray=array_merge($substitutionarray, array(
'__USER_SIGNATURE__' => (string) (($signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? ($onlykey == 2 ? dol_trunc(dol_string_nohtmltag($signature), 30) : $signature) : '') '__USER_SIGNATURE__' => (string) (($signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? ($onlykey == 2 ? dol_trunc(dol_string_nohtmltag($signature), 30) : $signature) : '')
) )
); );
@@ -5877,7 +5877,7 @@ $substitutionarray=array_merge($substitutionarray, array(
$substitutionarray['__SIGNATURE__'] = (string) (($signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? ($onlykey == 2 ? dol_trunc(dol_string_nohtmltag($signature), 30) : $signature) : ''); $substitutionarray['__SIGNATURE__'] = (string) (($signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? ($onlykey == 2 ? dol_trunc(dol_string_nohtmltag($signature), 30) : $signature) : '');
} }
$substitutionarray=array_merge($substitutionarray, array( $substitutionarray=array_merge($substitutionarray, array(
'__USER_ID__' => (string) $user->id, '__USER_ID__' => (string) $user->id,
'__USER_LOGIN__' => (string) $user->login, '__USER_LOGIN__' => (string) $user->login,
'__USER_LASTNAME__' => (string) $user->lastname, '__USER_LASTNAME__' => (string) $user->lastname,
@@ -5890,7 +5890,7 @@ $substitutionarray=array_merge($substitutionarray, array(
} }
if ((empty($exclude) || ! in_array('mycompany', $exclude)) && is_object($mysoc)) if ((empty($exclude) || ! in_array('mycompany', $exclude)) && is_object($mysoc))
{ {
$substitutionarray=array_merge($substitutionarray, array( $substitutionarray=array_merge($substitutionarray, array(
'__MYCOMPANY_NAME__' => $mysoc->name, '__MYCOMPANY_NAME__' => $mysoc->name,
'__MYCOMPANY_EMAIL__' => $mysoc->email, '__MYCOMPANY_EMAIL__' => $mysoc->email,
'__MYCOMPANY_PROFID1__' => $mysoc->idprof1, '__MYCOMPANY_PROFID1__' => $mysoc->idprof1,
@@ -6388,11 +6388,11 @@ function dolGetFirstLastname($firstname, $lastname, $nameorder = -1)
} }
elseif ($nameorder == 2 || $nameorder == 3) elseif ($nameorder == 2 || $nameorder == 3)
{ {
$ret.=$firstname; $ret.=$firstname;
if (empty($ret) && $nameorder == 3) if (empty($ret) && $nameorder == 3)
{ {
$ret.=$lastname; $ret.=$lastname;
} }
} }
else else
{ {

View File

@@ -317,19 +317,19 @@ function utf162utf8($utf16)
switch(true) { switch(true) {
case ((0x7F & $bytes) == $bytes): case ((0x7F & $bytes) == $bytes):
// this case should never be reached, because we are in ASCII range // this case should never be reached, because we are in ASCII range
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
return chr($bytes); return chr($bytes);
case (0x07FF & $bytes) == $bytes: case (0x07FF & $bytes) == $bytes:
// return a 2-byte UTF-8 character // return a 2-byte UTF-8 character
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
return chr(0xC0 | (($bytes >> 6) & 0x1F)) return chr(0xC0 | (($bytes >> 6) & 0x1F))
. chr(0x80 | ($bytes & 0x3F)); . chr(0x80 | ($bytes & 0x3F));
case (0xFFFF & $bytes) == $bytes: case (0xFFFF & $bytes) == $bytes:
// return a 3-byte UTF-8 character // return a 3-byte UTF-8 character
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
return chr(0xE0 | (($bytes >> 12) & 0x0F)) return chr(0xE0 | (($bytes >> 12) & 0x0F))
. chr(0x80 | (($bytes >> 6) & 0x3F)) . chr(0x80 | (($bytes >> 6) & 0x3F))
. chr(0x80 | ($bytes & 0x3F)); . chr(0x80 | ($bytes & 0x3F));

View File

@@ -780,171 +780,171 @@ function projectLinesPerAction(&$inc, $parent, $fuser, $lines, &$level, &$projec
//if ($lines[$i]->fk_task_parent == $parent) //if ($lines[$i]->fk_task_parent == $parent)
//{ //{
// If we want all or we have a role on task, we show it // If we want all or we have a role on task, we show it
if (empty($mine) || ! empty($tasksrole[$lines[$i]->id])) if (empty($mine) || ! empty($tasksrole[$lines[$i]->id]))
{
//dol_syslog("projectLinesPerWeek Found line ".$i.", a qualified task (i have role or want to show all tasks) with id=".$lines[$i]->id." project id=".$lines[$i]->fk_project);
// Break on a new project
if ($parent == 0 && $lines[$i]->fk_project != $lastprojectid)
{ {
//dol_syslog("projectLinesPerWeek Found line ".$i.", a qualified task (i have role or want to show all tasks) with id=".$lines[$i]->id." project id=".$lines[$i]->fk_project); $lastprojectid=$lines[$i]->fk_project;
if ($preselectedday)
// Break on a new project
if ($parent == 0 && $lines[$i]->fk_project != $lastprojectid)
{ {
$lastprojectid=$lines[$i]->fk_project; $projectstatic->id = $lines[$i]->fk_project;
if ($preselectedday)
{
$projectstatic->id = $lines[$i]->fk_project;
}
} }
if (empty($workloadforid[$projectstatic->id]))
{
if ($preselectedday)
{
$projectstatic->loadTimeSpent($preselectedday, 0, $fuser->id); // Load time spent from table projet_task_time for the project into this->weekWorkLoad and this->weekWorkLoadPerTask for all days of a week
$workloadforid[$projectstatic->id]=1;
}
}
$projectstatic->id=$lines[$i]->fk_project;
$projectstatic->ref=$lines[$i]->project_ref;
$projectstatic->title=$lines[$i]->project_label;
$projectstatic->public=$lines[$i]->public;
$taskstatic->id=$lines[$i]->task_id;
$taskstatic->ref=($lines[$i]->task_ref?$lines[$i]->task_ref:$lines[$i]->task_id);
$taskstatic->label=$lines[$i]->task_label;
$taskstatic->date_start=$lines[$i]->date_start;
$taskstatic->date_end=$lines[$i]->date_end;
$thirdpartystatic->id=$lines[$i]->socid;
$thirdpartystatic->name=$lines[$i]->thirdparty_name;
$thirdpartystatic->email=$lines[$i]->thirdparty_email;
if (empty($oldprojectforbreak) || ($oldprojectforbreak != -1 && $oldprojectforbreak != $projectstatic->id))
{
print '<tr class="oddeven trforbreak">'."\n";
print '<td colspan="11">';
print $projectstatic->getNomUrl(1, '', 0, $langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]);
if ($projectstatic->title)
{
print ' - ';
print $projectstatic->title;
}
print '</td>';
print '</tr>';
}
if ($oldprojectforbreak != -1) $oldprojectforbreak = $projectstatic->id;
print '<tr class="oddeven">'."\n";
// User
/*
print '<td class="nowrap">';
print $fuser->getNomUrl(1, 'withproject', 'time');
print '</td>';
*/
// Project
print "<td>";
if ($oldprojectforbreak == -1)
{
print $projectstatic->getNomUrl(1, '', 0, $langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]);
print '<br>'.$projectstatic->title;
}
print "</td>";
// Thirdparty
print '<td class="tdoverflowmax100">';
if ($thirdpartystatic->id > 0) print $thirdpartystatic->getNomUrl(1, 'project', 10);
print '</td>';
// Ref
print '<td>';
print '<!-- Task id = '.$lines[$i]->id.' -->';
for ($k = 0 ; $k < $level ; $k++) print "&nbsp;&nbsp;&nbsp;";
print $taskstatic->getNomUrl(1, 'withproject', 'time');
// Label task
print '<br>';
for ($k = 0 ; $k < $level ; $k++) print "&nbsp;&nbsp;&nbsp;";
print $taskstatic->label;
//print "<br>";
//for ($k = 0 ; $k < $level ; $k++) print "&nbsp;&nbsp;&nbsp;";
//print get_date_range($lines[$i]->date_start,$lines[$i]->date_end,'',$langs,0);
print "</td>\n";
// Date
print '<td class="center">';
print dol_print_date($lines[$i]->timespent_datehour, 'day');
print '</td>';
$disabledproject=1;$disabledtask=1;
//print "x".$lines[$i]->fk_project;
//var_dump($lines[$i]);
//var_dump($projectsrole[$lines[$i]->fk_project]);
// If at least one role for project
if ($lines[$i]->public || ! empty($projectsrole[$lines[$i]->fk_project]) || $user->rights->projet->all->creer)
{
$disabledproject=0;
$disabledtask=0;
}
// If $restricteditformytask is on and I have no role on task, i disable edit
if ($restricteditformytask && empty($tasksrole[$lines[$i]->id]))
{
$disabledtask=1;
}
// Hour
print '<td class="nowrap center">';
print dol_print_date($lines[$i]->timespent_datehour, 'hour');
print '</td>';
$cssonholiday='';
if (! $isavailable[$preselectedday]['morning'] && ! $isavailable[$preselectedday]['afternoon']) $cssonholiday.='onholidayallday ';
elseif (! $isavailable[$preselectedday]['morning']) $cssonholiday.='onholidaymorning ';
elseif (! $isavailable[$preselectedday]['afternoon']) $cssonholiday.='onholidayafternoon ';
// Duration
print '<td class="duration'.($cssonholiday?' '.$cssonholiday:'').' center">';
$dayWorkLoad = $lines[$i]->timespent_duration;
$totalforeachline[$preselectedday]+=$lines[$i]->timespent_duration;
$alreadyspent='';
if ($dayWorkLoad > 0) $alreadyspent=convertSecondToTime($lines[$i]->timespent_duration, 'allhourmin');
print convertSecondToTime($lines[$i]->timespent_duration, 'allhourmin');
$modeinput='hours';
print '<script type="text/javascript">';
print "jQuery(document).ready(function () {\n";
print " jQuery('.inputhour, .inputminute').bind('keyup', function(e) { updateTotal(0, '".$modeinput."') });";
print "})\n";
print '</script>';
print '</td>';
// Note
print '<td class="center">';
print '<textarea name="'.$lines[$i]->id.'note" rows="'.ROWS_2.'" id="'.$lines[$i]->id.'note"'.($disabledtask?' disabled="disabled"':'').'>';
print $lines[$i]->timespent_note;
print '</textarea>';
print '</td>';
// Warning
print '<td class="right">';
/*if ((! $lines[$i]->public) && $disabledproject) print $form->textwithpicto('',$langs->trans("UserIsNotContactOfProject"));
else if ($disabledtask)
{
$titleassigntask = $langs->trans("AssignTaskToMe");
if ($fuser->id != $user->id) $titleassigntask = $langs->trans("AssignTaskToUser", '...');
print $form->textwithpicto('',$langs->trans("TaskIsNotAssignedToUser", $titleassigntask));
}*/
print '</td>';
print "</tr>\n";
} }
if (empty($workloadforid[$projectstatic->id]))
{
if ($preselectedday)
{
$projectstatic->loadTimeSpent($preselectedday, 0, $fuser->id); // Load time spent from table projet_task_time for the project into this->weekWorkLoad and this->weekWorkLoadPerTask for all days of a week
$workloadforid[$projectstatic->id]=1;
}
}
$projectstatic->id=$lines[$i]->fk_project;
$projectstatic->ref=$lines[$i]->project_ref;
$projectstatic->title=$lines[$i]->project_label;
$projectstatic->public=$lines[$i]->public;
$taskstatic->id=$lines[$i]->task_id;
$taskstatic->ref=($lines[$i]->task_ref?$lines[$i]->task_ref:$lines[$i]->task_id);
$taskstatic->label=$lines[$i]->task_label;
$taskstatic->date_start=$lines[$i]->date_start;
$taskstatic->date_end=$lines[$i]->date_end;
$thirdpartystatic->id=$lines[$i]->socid;
$thirdpartystatic->name=$lines[$i]->thirdparty_name;
$thirdpartystatic->email=$lines[$i]->thirdparty_email;
if (empty($oldprojectforbreak) || ($oldprojectforbreak != -1 && $oldprojectforbreak != $projectstatic->id))
{
print '<tr class="oddeven trforbreak">'."\n";
print '<td colspan="11">';
print $projectstatic->getNomUrl(1, '', 0, $langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]);
if ($projectstatic->title)
{
print ' - ';
print $projectstatic->title;
}
print '</td>';
print '</tr>';
}
if ($oldprojectforbreak != -1) $oldprojectforbreak = $projectstatic->id;
print '<tr class="oddeven">'."\n";
// User
/*
print '<td class="nowrap">';
print $fuser->getNomUrl(1, 'withproject', 'time');
print '</td>';
*/
// Project
print "<td>";
if ($oldprojectforbreak == -1)
{
print $projectstatic->getNomUrl(1, '', 0, $langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]);
print '<br>'.$projectstatic->title;
}
print "</td>";
// Thirdparty
print '<td class="tdoverflowmax100">';
if ($thirdpartystatic->id > 0) print $thirdpartystatic->getNomUrl(1, 'project', 10);
print '</td>';
// Ref
print '<td>';
print '<!-- Task id = '.$lines[$i]->id.' -->';
for ($k = 0 ; $k < $level ; $k++) print "&nbsp;&nbsp;&nbsp;";
print $taskstatic->getNomUrl(1, 'withproject', 'time');
// Label task
print '<br>';
for ($k = 0 ; $k < $level ; $k++) print "&nbsp;&nbsp;&nbsp;";
print $taskstatic->label;
//print "<br>";
//for ($k = 0 ; $k < $level ; $k++) print "&nbsp;&nbsp;&nbsp;";
//print get_date_range($lines[$i]->date_start,$lines[$i]->date_end,'',$langs,0);
print "</td>\n";
// Date
print '<td class="center">';
print dol_print_date($lines[$i]->timespent_datehour, 'day');
print '</td>';
$disabledproject=1;$disabledtask=1;
//print "x".$lines[$i]->fk_project;
//var_dump($lines[$i]);
//var_dump($projectsrole[$lines[$i]->fk_project]);
// If at least one role for project
if ($lines[$i]->public || ! empty($projectsrole[$lines[$i]->fk_project]) || $user->rights->projet->all->creer)
{
$disabledproject=0;
$disabledtask=0;
}
// If $restricteditformytask is on and I have no role on task, i disable edit
if ($restricteditformytask && empty($tasksrole[$lines[$i]->id]))
{
$disabledtask=1;
}
// Hour
print '<td class="nowrap center">';
print dol_print_date($lines[$i]->timespent_datehour, 'hour');
print '</td>';
$cssonholiday='';
if (! $isavailable[$preselectedday]['morning'] && ! $isavailable[$preselectedday]['afternoon']) $cssonholiday.='onholidayallday ';
elseif (! $isavailable[$preselectedday]['morning']) $cssonholiday.='onholidaymorning ';
elseif (! $isavailable[$preselectedday]['afternoon']) $cssonholiday.='onholidayafternoon ';
// Duration
print '<td class="duration'.($cssonholiday?' '.$cssonholiday:'').' center">';
$dayWorkLoad = $lines[$i]->timespent_duration;
$totalforeachline[$preselectedday]+=$lines[$i]->timespent_duration;
$alreadyspent='';
if ($dayWorkLoad > 0) $alreadyspent=convertSecondToTime($lines[$i]->timespent_duration, 'allhourmin');
print convertSecondToTime($lines[$i]->timespent_duration, 'allhourmin');
$modeinput='hours';
print '<script type="text/javascript">';
print "jQuery(document).ready(function () {\n";
print " jQuery('.inputhour, .inputminute').bind('keyup', function(e) { updateTotal(0, '".$modeinput."') });";
print "})\n";
print '</script>';
print '</td>';
// Note
print '<td class="center">';
print '<textarea name="'.$lines[$i]->id.'note" rows="'.ROWS_2.'" id="'.$lines[$i]->id.'note"'.($disabledtask?' disabled="disabled"':'').'>';
print $lines[$i]->timespent_note;
print '</textarea>';
print '</td>';
// Warning
print '<td class="right">';
/*if ((! $lines[$i]->public) && $disabledproject) print $form->textwithpicto('',$langs->trans("UserIsNotContactOfProject"));
else if ($disabledtask)
{
$titleassigntask = $langs->trans("AssignTaskToMe");
if ($fuser->id != $user->id) $titleassigntask = $langs->trans("AssignTaskToUser", '...');
print $form->textwithpicto('',$langs->trans("TaskIsNotAssignedToUser", $titleassigntask));
}*/
print '</td>';
print "</tr>\n";
}
//} //}
//else //else
//{ //{

View File

@@ -105,18 +105,18 @@ function reception_admin_prepare_head()
if (! empty($conf->global->MAIN_SUBMODULE_RECEPTION)) if (! empty($conf->global->MAIN_SUBMODULE_RECEPTION))
{ {
$head[$h][0] = DOL_URL_ROOT.'/admin/reception_extrafields.php'; $head[$h][0] = DOL_URL_ROOT.'/admin/reception_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields"); $head[$h][1] = $langs->trans("ExtraFields");
$head[$h][2] = 'attributes_reception'; $head[$h][2] = 'attributes_reception';
$h++; $h++;
} }
if (! empty($conf->global->MAIN_SUBMODULE_RECEPTION)) if (! empty($conf->global->MAIN_SUBMODULE_RECEPTION))
{ {
$head[$h][0] = DOL_URL_ROOT.'/admin/commande_fournisseur_dispatch_extrafields.php'; $head[$h][0] = DOL_URL_ROOT.'/admin/commande_fournisseur_dispatch_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsLines"); $head[$h][1] = $langs->trans("ExtraFieldsLines");
$head[$h][2] = 'attributeslines_reception'; $head[$h][2] = 'attributeslines_reception';
$h++; $h++;
} }

View File

@@ -320,7 +320,7 @@ function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filt
fwrite($fichier, $form); fwrite($fichier, $form);
$form='<description><![CDATA['.$desc.'.]]></description>'."\n". $form='<description><![CDATA['.$desc.'.]]></description>'."\n".
// '<language>fr</language>'."\n". // '<language>fr</language>'."\n".
'<copyright>Dolibarr</copyright>'."\n". '<copyright>Dolibarr</copyright>'."\n".
'<lastBuildDate>'.$date.'</lastBuildDate>'."\n". '<lastBuildDate>'.$date.'</lastBuildDate>'."\n".
'<generator>Dolibarr</generator>'."\n"; '<generator>Dolibarr</generator>'."\n";

View File

@@ -177,13 +177,13 @@ class InterfaceLogevents extends DolibarrTriggers
} }
// If not found // If not found
/* /*
else else
{ {
dol_syslog("Trigger '".$this->name."' for action '$action' was ran by ".__FILE__." but no handler found for this action."); dol_syslog("Trigger '".$this->name."' for action '$action' was ran by ".__FILE__." but no handler found for this action.");
return 0; return 0;
} }
*/ */
// Add more information into desc from the context property // Add more information into desc from the context property
if (! empty($desc) && ! empty($object->context['audit'])) $desc.=' - '.$object->context['audit']; if (! empty($desc) && ! empty($object->context['audit'])) $desc.=' - '.$object->context['audit'];

View File

@@ -251,7 +251,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
} }
elseif ($action == 'BILL_UNVALIDATE') elseif ($action == 'BILL_UNVALIDATE')
{ {
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("agenda","other","bills")); $langs->loadLangs(array("agenda","other","bills"));
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceBackToDraftInDolibarr", $object->ref); if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceBackToDraftInDolibarr", $object->ref);
@@ -808,9 +808,9 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->actionmsg=$langs->transnoentities("TICKET_ASSIGNEDInDolibarr", $object->ref); $object->actionmsg=$langs->transnoentities("TICKET_ASSIGNEDInDolibarr", $object->ref);
if ($object->oldcopy->fk_user_assign > 0) if ($object->oldcopy->fk_user_assign > 0)
{ {
$tmpuser=new User($this->db); $tmpuser=new User($this->db);
$tmpuser->fetch($object->oldcopy->fk_user_assign); $tmpuser->fetch($object->oldcopy->fk_user_assign);
$object->actionmsg.="\n".$langs->transnoentities("OldUser").': '.$tmpuser->getFullName($langs); $object->actionmsg.="\n".$langs->transnoentities("OldUser").': '.$tmpuser->getFullName($langs);
} }
else else
{ {

View File

@@ -181,7 +181,7 @@ class InterfaceZapierTriggers extends DolibarrTriggers
case 'CONTACT_MODIFY': case 'CONTACT_MODIFY':
case 'CONTACT_DELETE': case 'CONTACT_DELETE':
case 'CONTACT_ENABLEDISABLE': case 'CONTACT_ENABLEDISABLE':
break;
// Products // Products
// case 'PRODUCT_CREATE': // case 'PRODUCT_CREATE':
// case 'PRODUCT_MODIFY': // case 'PRODUCT_MODIFY':
@@ -221,7 +221,7 @@ class InterfaceZapierTriggers extends DolibarrTriggers
case 'LINEORDER_INSERT': case 'LINEORDER_INSERT':
case 'LINEORDER_UPDATE': case 'LINEORDER_UPDATE':
case 'LINEORDER_DELETE': case 'LINEORDER_DELETE':
break;
// Supplier orders // Supplier orders
// case 'ORDER_SUPPLIER_CREATE': // case 'ORDER_SUPPLIER_CREATE':
// case 'ORDER_SUPPLIER_CLONE': // case 'ORDER_SUPPLIER_CLONE':