Removed deprecated use of string in dol_print_date(). Only date allowed.
This commit is contained in:
parent
fc983fa65c
commit
8fe1be1a67
@ -24,7 +24,10 @@ Following changes may create regressions for some external modules, but were nec
|
||||
* All methods set_draft() were renamed into setDraft().
|
||||
* Removed deprecated function function test_sql_and_script_inject that was replaced with testSqlAndScriptInject.
|
||||
* Method load_measuring_units were renamed into selectMeasuringUnits and select_measuring_units was deprecated.
|
||||
* Hidden option CHANGE_ORDER_CONCAT_DESCRIPTION were renamed into MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION
|
||||
* Hidden option CHANGE_ORDER_CONCAT_DESCRIPTION were renamed into MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION.
|
||||
* Method dolEscapeXML was moved from functions.lib.php into function2.lib.php (not used enough to be loaded by default).
|
||||
* Removed deprecated use of string in dol_print_date(). Only date allowed.
|
||||
|
||||
|
||||
|
||||
***** ChangeLog for 9.0.1 compared to 9.0.0 *****
|
||||
|
||||
@ -407,18 +407,17 @@ foreach ($accounts as $key=>$type)
|
||||
|
||||
$found++;
|
||||
|
||||
$obj = new Account($db);
|
||||
$obj->fetch($key);
|
||||
$result = $objecttmp->fetch($key);
|
||||
|
||||
$solde = $obj->solde(1);
|
||||
$solde = $objecttmp->solde(1);
|
||||
|
||||
if (! empty($lastcurrencycode) && $lastcurrencycode != $obj->currency_code)
|
||||
if (! empty($lastcurrencycode) && $lastcurrencycode != $objecttmp->currency_code)
|
||||
{
|
||||
$lastcurrencycode='various'; // We found several different currencies
|
||||
}
|
||||
if ($lastcurrencycode != 'various')
|
||||
{
|
||||
$lastcurrencycode=$obj->currency_code;
|
||||
$lastcurrencycode=$objecttmp->currency_code;
|
||||
}
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
@ -426,14 +425,14 @@ foreach ($accounts as $key=>$type)
|
||||
// Ref
|
||||
if (! empty($arrayfields['b.ref']['checked']))
|
||||
{
|
||||
print '<td class="nowrap">'.$obj->getNomUrl(1).'</td>';
|
||||
print '<td class="nowrap">'.$objecttmp->getNomUrl(1).'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Label
|
||||
if (! empty($arrayfields['b.label']['checked']))
|
||||
{
|
||||
print '<td>'.$obj->label.'</td>';
|
||||
print '<td>'.$objecttmp->label.'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
@ -441,7 +440,7 @@ foreach ($accounts as $key=>$type)
|
||||
if (! empty($arrayfields['accountype']['checked']))
|
||||
{
|
||||
print '<td>';
|
||||
print $obj->type_lib[$obj->type];
|
||||
print $objecttmp->type_lib[$objecttmp->type];
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
@ -449,7 +448,7 @@ foreach ($accounts as $key=>$type)
|
||||
// Number
|
||||
if (! empty($arrayfields['b.number']['checked']))
|
||||
{
|
||||
print '<td>'.$obj->number.'</td>';
|
||||
print '<td>'.$objecttmp->number.'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
@ -460,12 +459,12 @@ foreach ($accounts as $key=>$type)
|
||||
if (! empty($conf->accounting->enabled))
|
||||
{
|
||||
$accountingaccount = new AccountingAccount($db);
|
||||
$accountingaccount->fetch('', $obj->account_number, 1);
|
||||
$accountingaccount->fetch('', $objecttmp->account_number, 1);
|
||||
print $accountingaccount->getNomUrl(0, 1, 1, '', 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
print $obj->account_number;
|
||||
print $objecttmp->account_number;
|
||||
}
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
@ -478,7 +477,7 @@ foreach ($accounts as $key=>$type)
|
||||
if (! empty($conf->accounting->enabled))
|
||||
{
|
||||
$accountingjournal = new AccountingJournal($db);
|
||||
$accountingjournal->fetch($obj->fk_accountancy_journal);
|
||||
$accountingjournal->fetch($objecttmp->fk_accountancy_journal);
|
||||
print $accountingjournal->getNomUrl(0, 1, 1, '', 1);
|
||||
}
|
||||
else
|
||||
@ -493,7 +492,7 @@ foreach ($accounts as $key=>$type)
|
||||
if (! empty($arrayfields['b.currency_code']['checked']))
|
||||
{
|
||||
print '<td class="center">';
|
||||
print $obj->currency_code;
|
||||
print $objecttmp->currency_code;
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
@ -502,11 +501,11 @@ foreach ($accounts as $key=>$type)
|
||||
if (! empty($arrayfields['toreconcile']['checked']))
|
||||
{
|
||||
print '<td class="center">';
|
||||
if ($obj->rappro)
|
||||
if ($objecttmp->rappro)
|
||||
{
|
||||
$result=$obj->load_board($user, $obj->id);
|
||||
$result=$objecttmp->load_board($user, $objecttmp->id);
|
||||
if ($result<0) {
|
||||
setEventMessages($obj->error, $obj->errors, 'errors');
|
||||
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
|
||||
} else {
|
||||
print $result->nbtodo;
|
||||
if ($result->nbtodolate) print ' ('.$result->nbtodolate.img_warning($langs->trans("Late")).')';
|
||||
@ -520,14 +519,14 @@ foreach ($accounts as $key=>$type)
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|
||||
// Fields from hook
|
||||
$parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
|
||||
$reshook=$hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
|
||||
$parameters=array('arrayfields'=>$arrayfields);
|
||||
$reshook=$hookmanager->executeHooks('printFieldListValue', $parameters, $objecttmp); // Note that $action and $objecttmpect may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Date creation
|
||||
if (! empty($arrayfields['b.datec']['checked']))
|
||||
{
|
||||
print '<td class="center">';
|
||||
print dol_print_date($obj->date_creation, 'dayhour');
|
||||
print dol_print_date($objecttmp->date_creation, 'dayhour');
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
@ -535,7 +534,7 @@ foreach ($accounts as $key=>$type)
|
||||
if (! empty($arrayfields['b.tms']['checked']))
|
||||
{
|
||||
print '<td class="center">';
|
||||
print dol_print_date($obj->date_update, 'dayhour');
|
||||
print dol_print_date($objecttmp->date_update, 'dayhour');
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
@ -543,7 +542,7 @@ foreach ($accounts as $key=>$type)
|
||||
// Status
|
||||
if (! empty($arrayfields['b.clos']['checked']))
|
||||
{
|
||||
print '<td class="center">'.$obj->getLibStatut(5).'</td>';
|
||||
print '<td class="center">'.$objecttmp->getLibStatut(5).'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
@ -551,7 +550,7 @@ foreach ($accounts as $key=>$type)
|
||||
if (! empty($arrayfields['balance']['checked']))
|
||||
{
|
||||
print '<td class="nowraponall right">';
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?id='.$obj->id.'">'.price($solde, 0, $langs, 0, -1, -1, $obj->currency_code).'</a>';
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?id='.$objecttmp->id.'">'.price($solde, 0, $langs, 0, -1, -1, $objecttmp->currency_code).'</a>';
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['totalbalancefield']=$totalarray['nbfield'];
|
||||
@ -563,15 +562,15 @@ foreach ($accounts as $key=>$type)
|
||||
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||
{
|
||||
$selected=0;
|
||||
if (in_array($obj->rowid, $arrayofselected)) $selected=1;
|
||||
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected?' checked="checked"':'').'>';
|
||||
if (in_array($objecttmp->id, $arrayofselected)) $selected=1;
|
||||
print '<input id="cb'.$objecttmp->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$objecttmp->id.'"'.($selected?' checked="checked"':'').'>';
|
||||
}
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
|
||||
print '</tr>';
|
||||
|
||||
$total[$obj->currency_code] += $solde;
|
||||
$total[$objecttmp->currency_code] += $solde;
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
@ -1592,6 +1592,9 @@ class BonPrelevement extends CommonObject
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
$CrLf = "\n";
|
||||
$Rowing = sprintf("%06d", $row_idfac);
|
||||
|
||||
|
||||
@ -224,9 +224,9 @@ class FormAccounting extends Form
|
||||
/**
|
||||
* Return select filter with date of transaction
|
||||
*
|
||||
* @param string $htmlname Name of select field
|
||||
* @param string $selectedkey Value
|
||||
* @return string HTML edit field
|
||||
* @param string $htmlname Name of select field
|
||||
* @param string $selectedkey Value
|
||||
* @return string HTML edit field
|
||||
*/
|
||||
public function select_bookkeeping_importkey($htmlname = 'importkey', $selectedkey = '')
|
||||
{
|
||||
@ -247,7 +247,7 @@ class FormAccounting extends Form
|
||||
}
|
||||
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
$options[$obj->import_key] = dol_print_date($obj->import_key, 'dayhourtext');
|
||||
$options[$obj->import_key] = $obj->import_key;
|
||||
}
|
||||
|
||||
return Form::selectarray($htmlname, $options, $selectedkey);
|
||||
|
||||
@ -886,17 +886,6 @@ function dol_string_nospecial($str, $newstr = '_', $badcharstoreplace = '')
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Encode string for xml usage
|
||||
*
|
||||
* @param string $string String to encode
|
||||
* @return string String encoded
|
||||
*/
|
||||
function dolEscapeXML($string)
|
||||
{
|
||||
return strtr($string, array('\''=>''','"'=>'"','&'=>'&','<'=>'<','>'=>'>'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns text escaped for inclusion into javascript code
|
||||
*
|
||||
@ -1785,8 +1774,8 @@ function dol_print_date($time, $format = '', $tzoutput = 'tzserver', $outputlang
|
||||
if (preg_match('/^([0-9]+)\-([0-9]+)\-([0-9]+) ?([0-9]+)?:?([0-9]+)?:?([0-9]+)?/i', $time, $reg)
|
||||
|| preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])$/i', $time, $reg)) // Deprecated. Ex: 1970-01-01, 1970-01-01 01:00:00, 19700101010000
|
||||
{
|
||||
// TODO Remove this. This part of code should not be used.
|
||||
dol_syslog("Functions.lib::dol_print_date function call with deprecated value of time in page ".$_SERVER["PHP_SELF"], LOG_WARNING);
|
||||
// This part of code should not be used.
|
||||
/*dol_syslog("Functions.lib::dol_print_date function called with a bad value from page ".$_SERVER["PHP_SELF"], LOG_WARNING);
|
||||
//if (function_exists('debug_print_backtrace')) debug_print_backtrace();
|
||||
// Date has format 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS' or 'YYYYMMDDHHMMSS'
|
||||
$syear = (! empty($reg[1]) ? $reg[1] : '');
|
||||
@ -1797,7 +1786,9 @@ function dol_print_date($time, $format = '', $tzoutput = 'tzserver', $outputlang
|
||||
$ssec = (! empty($reg[6]) ? $reg[6] : '');
|
||||
|
||||
$time=dol_mktime($shour, $smin, $ssec, $smonth, $sday, $syear, true);
|
||||
$ret=adodb_strftime($format, $time+$offsettz+$offsetdst, $to_gmt);
|
||||
$ret=adodb_strftime($format, $time+$offsettz+$offsetdst, $to_gmt);*/
|
||||
dol_print_error("Functions.lib::dol_print_date function called with a bad value from page ".$_SERVER["PHP_SELF"]);
|
||||
return '';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -2414,28 +2414,39 @@ function getModuleDirForApiClass($module)
|
||||
return $moduledirforclass;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Return 2 hexa code randomly
|
||||
*
|
||||
* @param $min int Between 0 and 255
|
||||
* @param $max int Between 0 and 255
|
||||
* @return String
|
||||
* @param int $min Between 0 and 255
|
||||
* @param int $max Between 0 and 255
|
||||
* @return string A color string '12'
|
||||
*/
|
||||
function random_color_part($min = 0, $max = 255)
|
||||
function randomColorPart($min = 0, $max = 255)
|
||||
{
|
||||
return str_pad(dechex(mt_rand($min, $max)), 2, '0', STR_PAD_LEFT);
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Return hexadecimal color randomly
|
||||
*
|
||||
* @param $min int Between 0 and 255
|
||||
* @param $max int Between 0 and 255
|
||||
* @return String
|
||||
* @param int $min Between 0 and 255
|
||||
* @param int $max Between 0 and 255
|
||||
* @return string A color string '123456'
|
||||
*/
|
||||
function random_color($min = 0, $max = 255)
|
||||
function randomColor($min = 0, $max = 255)
|
||||
{
|
||||
return random_color_part($min, $max) . random_color_part($min, $max) . random_color_part($min, $max);
|
||||
return randomColorPart($min, $max) . randomColorPart($min, $max) . randomColorPart($min, $max);
|
||||
}
|
||||
|
||||
/**
|
||||
* Encode string for xml usage
|
||||
*
|
||||
* @param string $string String to encode
|
||||
* @return string String encoded
|
||||
*/
|
||||
function dolEscapeXML($string)
|
||||
{
|
||||
return strtr($string, array('\''=>''','"'=>'"','&'=>'&','<'=>'<','>'=>'>'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -117,7 +117,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
|
||||
/**
|
||||
* Issuer
|
||||
* @var Company object that emits
|
||||
* @var Societe object that emits
|
||||
*/
|
||||
public $emetteur;
|
||||
|
||||
@ -856,7 +856,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$invoice->fetch($obj->fk_facture_source);
|
||||
|
||||
$pdf->SetXY($tab3_posx, $tab3_top+$y);
|
||||
$pdf->MultiCell(20, 3, dol_print_date($obj->datef, 'day', false, $outputlangs, true), 0, 'L', 0);
|
||||
$pdf->MultiCell(20, 3, dol_print_date($db->jdate($obj->datef), 'day', false, $outputlangs, true), 0, 'L', 0);
|
||||
$pdf->SetXY($tab3_posx+21, $tab3_top+$y);
|
||||
$pdf->MultiCell(20, 3, price(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $obj->multicurrency_amount_ttc : $obj->amount_ttc, 0, $outputlangs), 0, 'L', 0);
|
||||
$pdf->SetXY($tab3_posx+40, $tab3_top+$y);
|
||||
|
||||
@ -928,7 +928,7 @@ class pdf_sponge extends ModelePDFFactures
|
||||
$invoice->fetch($obj->fk_facture_source);
|
||||
|
||||
$pdf->SetXY($tab3_posx, $tab3_top+$y);
|
||||
$pdf->MultiCell(20, 3, dol_print_date($obj->datef, 'day', false, $outputlangs, true), 0, 'L', 0);
|
||||
$pdf->MultiCell(20, 3, dol_print_date($db->jdate($obj->datef), 'day', false, $outputlangs, true), 0, 'L', 0);
|
||||
$pdf->SetXY($tab3_posx+21, $tab3_top+$y);
|
||||
$pdf->MultiCell(20, 3, price(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $obj->multicurrency_amount_ttc : $obj->amount_ttc, 0, $outputlangs), 0, 'L', 0);
|
||||
$pdf->SetXY($tab3_posx+40, $tab3_top+$y);
|
||||
@ -1829,7 +1829,7 @@ class pdf_sponge extends ModelePDFFactures
|
||||
* Define Array Column Field
|
||||
*
|
||||
* @param object $object common object
|
||||
* @param outputlangs $outputlangs langs
|
||||
* @param Translate $outputlangs langs
|
||||
* @param int $hidedetails Do not show line details
|
||||
* @param int $hidedesc Do not show desc
|
||||
* @param int $hideref Do not show ref
|
||||
|
||||
@ -64,9 +64,11 @@ if (!empty($object->comments))
|
||||
$fk_user = $comment->fk_user_author;
|
||||
$userstatic->fetch($fk_user);
|
||||
|
||||
if(empty($TColors[$fk_user])) {
|
||||
$bgcolor = random_color(180, 240);
|
||||
if(!empty($userstatic->color)) {
|
||||
if (empty($TColors[$fk_user]))
|
||||
{
|
||||
$bgcolor = randomColor(180, 240);
|
||||
if (!empty($userstatic->color))
|
||||
{
|
||||
$bgcolor = $userstatic->color;
|
||||
}
|
||||
$color = (colorIsLight($bgcolor))?'555':'fff';
|
||||
|
||||
@ -173,10 +173,10 @@ else
|
||||
print '</td>';
|
||||
print '<td>' . $user->getFullName($langs) . '</td>';
|
||||
print '<td>' . $obj->label . '</td>';
|
||||
print '<td class="center">' . dol_print_date($obj->date_debut, 'day');
|
||||
print '<td class="center">' . dol_print_date($db->jdate($obj->date_debut), 'day');
|
||||
print ' <span class="opacitymedium">('.$langs->trans($listhalfday[$starthalfday]).')</span>';
|
||||
print '</td>';
|
||||
print '<td class="center">' . dol_print_date($obj->date_fin, 'day');
|
||||
print '<td class="center">' . dol_print_date($db->jdate($obj->date_fin), 'day');
|
||||
print ' <span class="opacitymedium">('.$langs->trans($listhalfday[$endhalfday]).')</span>';
|
||||
print '</td>';
|
||||
print '<td class="right">' . num_open_day($date_start, $date_end, 0, 1, $obj->halfday) . '</td>';
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2012-2016 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2013-2018 Juanjo Menent <jmenent@2byte.es>
|
||||
@ -981,7 +981,7 @@ if ($resql)
|
||||
if (! empty($arrayfields['p.datec']['checked']))
|
||||
{
|
||||
print '<td class="center">';
|
||||
print dol_print_date($obj->date_creation, 'dayhour', 'tzuser');
|
||||
print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
@ -989,7 +989,7 @@ if ($resql)
|
||||
if (! empty($arrayfields['p.tms']['checked']))
|
||||
{
|
||||
print '<td class="center">';
|
||||
print dol_print_date($obj->date_update, 'dayhour', 'tzuser');
|
||||
print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser');
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
@ -479,6 +479,20 @@ if (empty($conf->global->PROJECT_HIDE_TASKS) && ! empty($conf->global->PROJECT_S
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
$projectstatic->id = $obj->projectid;
|
||||
$projectstatic->ref = $obj->ref;
|
||||
$projectstatic->title = $obj->title;
|
||||
$projectstatic->statut = $obj->status;
|
||||
$projectstatic->public = $obj->public;
|
||||
$projectstatic->dateo = $db->jdate($obj->projdateo);
|
||||
$projectstatic->datee = $db->jdate($obj->projdatee);
|
||||
|
||||
$taskstatic->projectstatus = $obj->projectstatus;
|
||||
$taskstatic->progress = $obj->progress;
|
||||
$taskstatic->fk_statut = $obj->status;
|
||||
$taskstatic->dateo = $db->jdate($obj->dateo);
|
||||
$taskstatic->datee = $db->jdate($obj->datee);
|
||||
|
||||
$username='';
|
||||
if ($obj->userid && $userstatic->id != $obj->userid) // We have a user and it is not last loaded user
|
||||
{
|
||||
@ -490,14 +504,6 @@ if (empty($conf->global->PROJECT_HIDE_TASKS) && ! empty($conf->global->PROJECT_S
|
||||
print '<tr class="oddeven">';
|
||||
//print '<td>'.$username.'</td>';
|
||||
print '<td>';
|
||||
$projectstatic->id=$obj->projectid;
|
||||
$projectstatic->ref=$obj->ref;
|
||||
$projectstatic->title=$obj->title;
|
||||
$projectstatic->statut = $obj->status;
|
||||
$projectstatic->public = $obj->public;
|
||||
$projectstatic->dateo = $db->jdate($obj->projdateo);
|
||||
$projectstatic->datee = $db->jdate($obj->projdatee);
|
||||
|
||||
print $projectstatic->getNomUrl(1, '', 0, '', '<br>');
|
||||
print '</td>';
|
||||
if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
|
||||
@ -517,14 +523,8 @@ if (empty($conf->global->PROJECT_HIDE_TASKS) && ! empty($conf->global->PROJECT_S
|
||||
}
|
||||
else print $langs->trans("NoTasks");
|
||||
print '</td>';
|
||||
$taskstatic->projectstatus = $obj->projectstatus;
|
||||
$taskstatic->progress = $obj->progress;
|
||||
$taskstatic->fk_statut = $obj->status;
|
||||
$taskstatic->dateo = $db->jdate($obj->dateo);
|
||||
$taskstatic->datee = $db->jdate($obj->datee);
|
||||
print '<td class="center">'.dol_print_date($db->jdate($obj->dateo), 'day').'</td>';
|
||||
print '<td class="center">'.dol_print_date($db->jdate($obj->datee), 'day');
|
||||
print dol_print_date($obj->date_end, 'dayhour');
|
||||
if ($taskstatic->hasDelay()) print img_warning($langs->trans("Late"));
|
||||
print '</td>';
|
||||
print '<td class="right"><a href="'.DOL_URL_ROOT.'/projet/tasks/time.php?id='.$obj->taskid.'&withproject=1">';
|
||||
|
||||
@ -519,21 +519,21 @@ if ($action == "view_ticketlist")
|
||||
// Date ticket
|
||||
if (!empty($arrayfields['t.datec']['checked'])) {
|
||||
print '<td>';
|
||||
print dol_print_date($obj->datec, 'dayhour');
|
||||
print dol_print_date($db->jdate($obj->datec), 'dayhour');
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Date read
|
||||
if (!empty($arrayfields['t.date_read']['checked'])) {
|
||||
print '<td>';
|
||||
print dol_print_date($obj->date_read, 'dayhour');
|
||||
print dol_print_date($db->jdate($obj->date_read), 'dayhour');
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Date close
|
||||
if (!empty($arrayfields['t.date_close']['checked'])) {
|
||||
print '<td>';
|
||||
print dol_print_date($obj->date_close, 'dayhour');
|
||||
print dol_print_date($db->jdate($obj->date_close), 'dayhour');
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
@ -616,7 +616,7 @@ if ($action == "view_ticketlist")
|
||||
}
|
||||
|
||||
if (!empty($arrayfields['t.tms']['checked'])) {
|
||||
print '<td>' . dol_print_date($obj->tms, 'dayhour') . '</td>';
|
||||
print '<td>' . dol_print_date($db->jdate($obj->tms), 'dayhour') . '</td>';
|
||||
}
|
||||
|
||||
// Extra fields
|
||||
|
||||
@ -1049,46 +1049,47 @@ function getProductsForCategory($authentication, $id, $lang = '')
|
||||
if ($res)
|
||||
{
|
||||
$iProduct = 0;
|
||||
$tmpproduct = new Product($db);
|
||||
$products=array();
|
||||
while ($rec = $db->fetch_array($res))
|
||||
{
|
||||
$obj = new Product($db);
|
||||
$obj->fetch($rec['fk_'.$field]);
|
||||
if($obj->status > 0 )
|
||||
$tmpproduct->fetch($rec['fk_'.$field]);
|
||||
if ($tmpproduct->status > 0)
|
||||
{
|
||||
$dir = (!empty($conf->product->dir_output)?$conf->product->dir_output:$conf->service->dir_output);
|
||||
$pdir = get_exdir($obj->id, 2, 0, 0, $product, 'product') . $obj->id ."/photos/";
|
||||
$pdir = get_exdir($tmpproduct->id, 2, 0, 0, $tmpproduct, 'product') . $tmpproduct->id ."/photos/";
|
||||
$dir = $dir . '/'. $pdir;
|
||||
|
||||
$products[] = array(
|
||||
'id' => $obj->id,
|
||||
'ref' => $obj->ref,
|
||||
'ref_ext' => $obj->ref_ext,
|
||||
'label' => ! empty($obj->multilangs[$langs->defaultlang]["label"]) ? $obj->multilangs[$langs->defaultlang]["label"] : $obj->label,
|
||||
'description' => ! empty($obj->multilangs[$langs->defaultlang]["description"]) ? $obj->multilangs[$langs->defaultlang]["description"] : $obj->description,
|
||||
'date_creation' => dol_print_date($obj->date_creation, 'dayhourrfc'),
|
||||
'date_modification' => dol_print_date($obj->date_modification, 'dayhourrfc'),
|
||||
'note' => ! empty($obj->multilangs[$langs->defaultlang]["note"]) ? $obj->multilangs[$langs->defaultlang]["note"] : $obj->note,
|
||||
'status_tosell' => $obj->status,
|
||||
'status_tobuy' => $obj->status_buy,
|
||||
'type' => $obj->type,
|
||||
'barcode' => $obj->barcode,
|
||||
'barcode_type' => $obj->barcode_type,
|
||||
'country_id' => $obj->country_id>0?$obj->country_id:'',
|
||||
'country_code' => $obj->country_code,
|
||||
'custom_code' => $obj->customcode,
|
||||
'id' => $tmpproduct->id,
|
||||
'ref' => $tmpproduct->ref,
|
||||
'ref_ext' => $tmpproduct->ref_ext,
|
||||
'label' => ! empty($tmpproduct->multilangs[$langs->defaultlang]["label"]) ? $tmpproduct->multilangs[$langs->defaultlang]["label"] : $tmpproduct->label,
|
||||
'description' => ! empty($tmpproduct->multilangs[$langs->defaultlang]["description"]) ? $tmpproduct->multilangs[$langs->defaultlang]["description"] : $tmpproduct->description,
|
||||
'date_creation' => dol_print_date($tmpproduct->date_creation, 'dayhourrfc'),
|
||||
'date_modification' => dol_print_date($tmpproduct->date_modification, 'dayhourrfc'),
|
||||
'note' => ! empty($tmpproduct->multilangs[$langs->defaultlang]["note"]) ? $tmpproduct->multilangs[$langs->defaultlang]["note"] : $tmpproduct->note,
|
||||
'status_tosell' => $tmpproduct->status,
|
||||
'status_tobuy' => $tmpproduct->status_buy,
|
||||
'type' => $tmpproduct->type,
|
||||
'barcode' => $tmpproduct->barcode,
|
||||
'barcode_type' => $tmpproduct->barcode_type,
|
||||
'country_id' => $tmpproduct->country_id>0?$tmpproduct->country_id:'',
|
||||
'country_code' => $tmpproduct->country_code,
|
||||
'custom_code' => $tmpproduct->customcode,
|
||||
|
||||
'price_net' => $obj->price,
|
||||
'price' => $obj->price_ttc,
|
||||
'vat_rate' => $obj->tva_tx,
|
||||
'price_net' => $tmpproduct->price,
|
||||
'price' => $tmpproduct->price_ttc,
|
||||
'vat_rate' => $tmpproduct->tva_tx,
|
||||
|
||||
'price_base_type' => $obj->price_base_type,
|
||||
'price_base_type' => $tmpproduct->price_base_type,
|
||||
|
||||
'stock_real' => $obj->stock_reel,
|
||||
'stock_alert' => $obj->seuil_stock_alerte,
|
||||
'pmp' => $obj->pmp,
|
||||
'import_key' => $obj->import_key,
|
||||
'stock_real' => $tmpproduct->stock_reel,
|
||||
'stock_alert' => $tmpproduct->seuil_stock_alerte,
|
||||
'pmp' => $tmpproduct->pmp,
|
||||
'import_key' => $tmpproduct->import_key,
|
||||
'dir' => $pdir,
|
||||
'images' => $obj->liste_photos($dir, $nbmax)
|
||||
'images' => $tmpproduct->liste_photos($dir, $nbmax)
|
||||
);
|
||||
|
||||
//Retreive all extrafield for thirdsparty
|
||||
@ -1096,11 +1097,11 @@ function getProductsForCategory($authentication, $id, $lang = '')
|
||||
$extrafields=new ExtraFields($db);
|
||||
$extralabels=$extrafields->fetch_name_optionals_label('product', true);
|
||||
//Get extrafield values
|
||||
$obj->fetch_optionals();
|
||||
$tmpproduct->fetch_optionals();
|
||||
|
||||
foreach($extrafields->attribute_label as $key=>$label)
|
||||
{
|
||||
$products[$iProduct]=array_merge($products[$iProduct], array('options_'.$key => $obj->array_options['options_'.$key]));
|
||||
$products[$iProduct]=array_merge($products[$iProduct], array('options_'.$key => $tmpproduct->array_options['options_'.$key]));
|
||||
}
|
||||
|
||||
$iProduct++;
|
||||
@ -1117,7 +1118,7 @@ function getProductsForCategory($authentication, $id, $lang = '')
|
||||
{
|
||||
$errorcode='NORECORDS_FOR_ASSOCIATION'; $errorlabel='No products associated'.$sql;
|
||||
$objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel));
|
||||
dol_syslog("getProductsForCategory:: ".$c->error, LOG_DEBUG);
|
||||
dol_syslog("getProductsForCategory:: ".$errorcode, LOG_DEBUG);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Loading…
Reference in New Issue
Block a user