';
print '
'.$langs->trans("StatisticsOn").'
';
-$newarrayoftype = array();
-foreach ($arrayoftype as $key => $val) {
- if (dol_eval($val['enabled'], 1, 1, '1')) {
- $newarrayoftype[$key] = $arrayoftype[$key];
- }
- if ($val['langs']) {
- $langs->load($val['langs']);
- }
-}
print $form->selectarray('objecttype', $newarrayoftype, $objecttype, 0, 0, 0, '', 1, 0, 0, '', 'minwidth200', 1);
if (empty($conf->use_javascript_ajax)) {
print '
';
@@ -412,7 +427,6 @@ print '
';
// Add measures into array
$count = 0;
-$arrayofmesures = fillArrayOfMeasures($object, 't', $langs->trans($newarrayoftype[$objecttype]['label']), $arrayofmesures, 0, $count);
//var_dump($arrayofmesures);
print '
';
// XAxis
$count = 0;
-$arrayofxaxis = fillArrayOfXAxis($object, 't', $langs->trans($newarrayoftype[$objecttype]['label']), $arrayofxaxis, 0, $count);
-$arrayofxaxis = dol_sort_array($arrayofxaxis, 'position', 'asc', 0, 0, 1);
print '
';
// Group by
$count = 0;
-$arrayofgroupby = fillArrayOfGroupBy($object, 't', $langs->trans($newarrayoftype[$objecttype]['label']), $arrayofgroupby, 0, $count);
-$arrayofgroupby = dol_sort_array($arrayofgroupby, 'position', 'asc', 0, 0, 1);
print '
';
print '
';
print $formother->selectGroupByField($object, $search_groupby, $arrayofgroupby, 'minwidth200 maxwidth250', $langs->trans("GroupBy")); // Fill the array $arrayofgroupby with possible fields
@@ -1100,14 +1110,31 @@ function fillArrayOfGroupBy($object, $tablealias, $labelofobject, &$arrayofgroup
continue;
}
if (in_array($val['type'], array('timestamp', 'date', 'datetime'))) {
- $arrayofgroupby[$tablealias.'.'.$key.'-year'] = array('label' => img_picto('', $object->picto, 'class="pictofixedwidth"').' '.$labelofobject.': '.$langs->trans($val['label']).'
('.$YYYY.') ', 'position' => ($val['position']+($count * 100000)).'.1');
- $arrayofgroupby[$tablealias.'.'.$key.'-month'] = array('label' => img_picto('', $object->picto, 'class="pictofixedwidth"').' '.$labelofobject.': '.$langs->trans($val['label']).'
('.$YYYY.'-'.$MM.') ', 'position' => ($val['position']+($count * 100000)).'.2');
- $arrayofgroupby[$tablealias.'.'.$key.'-day'] = array('label' => img_picto('', $object->picto, 'class="pictofixedwidth"').' '.$labelofobject.': '.$langs->trans($val['label']).'
('.$YYYY.'-'.$MM.'-'.$DD.') ', 'position' => ($val['position']+($count * 100000)).'.3');
+ $arrayofgroupby[$tablealias.'.'.$key.'-year'] = array(
+ 'label' => img_picto('', $object->picto,
+ 'class="pictofixedwidth"').' '.$labelofobject.': '.$langs->trans($val['label']).'
('.$YYYY.') ', 'position' => ($val['position']+($count * 100000)).'.1',
+ 'table' => $object->table_element
+ );
+ $arrayofgroupby[$tablealias.'.'.$key.'-month'] = array(
+ 'label' => img_picto('', $object->picto,
+ 'class="pictofixedwidth"').' '.$labelofobject.': '.$langs->trans($val['label']).'
('.$YYYY.'-'.$MM.') ', 'position' => ($val['position']+($count * 100000)).'.2',
+ 'table' => $object->table_element
+ );
+ $arrayofgroupby[$tablealias.'.'.$key.'-day'] = array(
+ 'label' => img_picto('', $object->picto,
+ 'class="pictofixedwidth"').' '.$labelofobject.': '.$langs->trans($val['label']).'
('.$YYYY.'-'.$MM.'-'.$DD.') ', 'position' => ($val['position']+($count * 100000)).'.3',
+ 'table' => $object->table_element
+ );
} else {
- $arrayofgroupby[$tablealias.'.'.$key] = array('label' => img_picto('', $object->picto, 'class="pictofixedwidth"').' '.$labelofobject.': '.$langs->trans($val['label']), 'position' => ($val['position']+($count * 100000)));
+ $arrayofgroupby[$tablealias.'.'.$key] = array(
+ 'label' => img_picto('', $object->picto,
+ 'class="pictofixedwidth"').' '.$labelofobject.': '.$langs->trans($val['label']), 'position' => ($val['position']+($count * 100000)),
+ 'table' => $object->table_element
+ );
}
}
}
+
// Add extrafields to Group by
if ($object->isextrafieldmanaged) {
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
@@ -1117,9 +1144,14 @@ function fillArrayOfGroupBy($object, $tablealias, $labelofobject, &$arrayofgroup
if (!empty($extrafields->attributes[$object->table_element]['totalizable'][$key])) {
continue;
}
- $arrayofgroupby[$tablealias.'e.'.$key] = array('label' => img_picto('', $object->picto, 'class="pictofixedwidth"').' '.$labelofobject.': '.$langs->trans($extrafields->attributes[$object->table_element]['label'][$key]), 'position' => 1000 + (int) $extrafields->attributes[$object->table_element]['pos'][$key] + ($count * 100000));
+ $arrayofgroupby[$tablealias.'e.'.$key] = array(
+ 'label' => img_picto('', $object->picto,
+ 'class="pictofixedwidth"').' '.$labelofobject.': '.$langs->trans($extrafields->attributes[$object->table_element]['label'][$key]), 'position' => 1000 + (int) $extrafields->attributes[$object->table_element]['pos'][$key] + ($count * 100000),
+ 'table' => $object->table_element
+ );
}
}
+
// Add fields for parent objects
foreach ($object->fields as $key => $val) {
if (preg_match('/^[^:]+:[^:]+:/', $val['type'])) {
@@ -1129,10 +1161,7 @@ function fillArrayOfGroupBy($object, $tablealias, $labelofobject, &$arrayofgroup
dol_include_once($tmptype[2]);
if (class_exists($newobject)) {
$tmpobject = new $newobject($db);
- /*var_dump($val['label']);
- var_dump($tmptype);
- var_dump($arrayofmesures);
- var_dump('t-'.$key);*/
+ //var_dump($key); var_dump($tmpobject->element); var_dump($val['label']); var_dump($tmptype); var_dump('t-'.$key);
$count++;
$arrayofgroupby = fillArrayOfGroupBy($tmpobject, $tablealias.'__'.$key, $langs->trans($val['label']), $arrayofgroupby, $level + 1, $count);
} else {
diff --git a/htdocs/core/tpl/objectline_title.tpl.php b/htdocs/core/tpl/objectline_title.tpl.php
index c40f07716f2..e8dbec2ac77 100644
--- a/htdocs/core/tpl/objectline_title.tpl.php
+++ b/htdocs/core/tpl/objectline_title.tpl.php
@@ -71,7 +71,9 @@ if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || !empty($conf->global->FA
if (in_array($object->element, array('propal', 'commande', 'facture')) && $object->status == $object::STATUS_DRAFT) {
global $mysoc;
- print '
id.'">'.img_edit($langs->trans("UpdateForAllLines"), 0, 'class="clickvatforalllines opacitymedium paddingleft cursorpointer"').' ';
+ if (empty($disableedit)) {
+ print '
id.'">'.img_edit($langs->trans("UpdateForAllLines"), 0, 'class="clickvatforalllines opacitymedium paddingleft cursorpointer"').' ';
+ }
//print '';
if (GETPOST('mode', 'aZ09') == 'vatforalllines') {
print '
';
diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php
index e8316392043..c2d81b81eb5 100644
--- a/htdocs/core/tpl/objectline_view.tpl.php
+++ b/htdocs/core/tpl/objectline_view.tpl.php
@@ -172,13 +172,13 @@ if (($line->info_bits & 2) == 2) {
print '
';
}
if ($line->date_start_fill) {
- print ''.$langs->trans('AutoFillDateFromShort').': '.yn($line->date_start_fill);
+ print ''.$langs->trans('AutoFillDateFromShort').': '.yn($line->date_start_fill);
}
if ($line->date_start_fill && $line->date_end_fill) {
print ' - ';
}
if ($line->date_end_fill) {
- print ''.$langs->trans('AutoFillDateToShort').': '.yn($line->date_end_fill);
+ print ''.$langs->trans('AutoFillDateToShort').': '.yn($line->date_end_fill);
}
if ($line->date_start_fill || $line->date_end_fill) {
print '
';
@@ -200,7 +200,16 @@ if (($line->info_bits & 2) == 2) {
}
}
- //print get_date_range($line->date_start, $line->date_end, $format);
+ // If we show the lines in a context to create a recurring sale invoice
+ if (basename($_SERVER["PHP_SELF"]) == 'card-rec.php') {
+ $default_start_fill = getDolGlobalInt('INVOICEREC_SET_AUTOFILL_DATE_START');
+ $default_end_fill = getDolGlobalInt('INVOICEREC_SET_AUTOFILL_DATE_END');
+ print '
';
+ print ''.$langs->trans('AutoFillDateFromShort').': '.yn($default_start_fill);
+ print ' - ';
+ print ''.$langs->trans('AutoFillDateToShort').': '.yn($default_end_fill);
+ print '
';
+ }
}
// Add description in form