Merge remote-tracking branch 'origin/3.7' into develop

Conflicts:
	htdocs/core/class/html.form.class.php
	htdocs/core/lib/ecm.lib.php
This commit is contained in:
Laurent Destailleur 2014-12-22 03:14:22 +01:00
commit 2a3bb96c34
35 changed files with 7877 additions and 154 deletions

File diff suppressed because one or more lines are too long

View File

@ -193,13 +193,15 @@ export list="
--ignore-table=$base.llx_cabinetmed_societe --ignore-table=$base.llx_cabinetmed_societe
--ignore-table=$base.llx_fournisseur_ca --ignore-table=$base.llx_fournisseur_ca
--ignore-table=$base.llx_google_maps --ignore-table=$base.llx_google_maps
--ignore-table=$base.llx_notes
--ignore-table=$base.llx_pos_paiement_ticket --ignore-table=$base.llx_pos_paiement_ticket
--ignore-table=$base.llx_pos_places --ignore-table=$base.llx_pos_places
--ignore-table=$base.llx_pos_ticket --ignore-table=$base.llx_pos_ticket
--ignore-table=$base.llx_publi_c_contact_list --ignore-table=$base.llx_publi_c_contact_list
--ignore-table=$base.llx_publi_c_dnd_list --ignore-table=$base.llx_publi_c_dnd_list
--ignore-table=$base.llx_publi_c_method_list --ignore-table=$base.llx_publi_c_method_list
--ignore-table=$base.llx_ultimatepdf --ignore-table=$base.llx_ultimatepdf
--ignore-table=$base.llx_ventilation_achat
" "
echo "mysqldump -P$port -u$admin -p***** $list $base > $mydir/$dumpfile" echo "mysqldump -P$port -u$admin -p***** $list $base > $mydir/$dumpfile"
mysqldump -P$port -u$admin $passwd $list $base > $mydir/$dumpfile mysqldump -P$port -u$admin $passwd $list $base > $mydir/$dumpfile

View File

@ -141,7 +141,7 @@ $server->register(
* @param array $authentication Array of authentication information * @param array $authentication Array of authentication information
* @param int $id Id of object * @param int $id Id of object
* @param string $ref Ref of object * @param string $ref Ref of object
* @param ref_ext $ref_ext Ref external of object * @param string $ref_ext Ref external of object
* @return mixed * @return mixed
*/ */
function getSkeleton($authentication,$id,$ref='',$ref_ext='') function getSkeleton($authentication,$id,$ref='',$ref_ext='')

View File

@ -1045,7 +1045,7 @@ class Adherent extends CommonObject
* @param int $rowid Id of object to load * @param int $rowid Id of object to load
* @param string $ref To load member from its ref * @param string $ref To load member from its ref
* @param int $fk_soc To load member from its link to third party * @param int $fk_soc To load member from its link to third party
* @param int $ref_ext External reference * @param string $ref_ext External reference
* @return int >0 if OK, 0 if not found, <0 if KO * @return int >0 if OK, 0 if not found, <0 if KO
*/ */
function fetch($rowid,$ref='',$fk_soc='',$ref_ext='') function fetch($rowid,$ref='',$fk_soc='',$ref_ext='')

View File

@ -24,6 +24,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$langs->load("admin"); $langs->load("admin");
$langs->load("install"); $langs->load("install");
@ -51,6 +52,13 @@ print_fiche_titre($langs->trans("PerfDolibarr"),'','setup');
print $langs->trans("YouMayFindPerfAdviceHere",'http://wiki.dolibarr.org/index.php/FAQ_Increase_Performance').' (<a href="'.$_SERVER["PHP_SELF"].'">'.$langs->trans("Reload").'</a>)<br>'; print $langs->trans("YouMayFindPerfAdviceHere",'http://wiki.dolibarr.org/index.php/FAQ_Increase_Performance').' (<a href="'.$_SERVER["PHP_SELF"].'">'.$langs->trans("Reload").'</a>)<br>';
// Recupere la version de PHP
$phpversion=version_php();
print "<br>PHP - ".$langs->trans("Version").": ".$phpversion."<br>\n";
// Recupere la version du serveur web
print "<br>Web server - ".$langs->trans("Version").": ".$_SERVER["SERVER_SOFTWARE"]."<br>\n";
// XDebug // XDebug
print '<br>'; print '<br>';
print '<strong>'.$langs->trans("XDebug").'</strong>: '; print '<strong>'.$langs->trans("XDebug").'</strong>: ';

View File

@ -54,7 +54,7 @@ print "\n";
$var=false; $var=false;
// Recupere la version de l'OS // Recupere la version de PHP
$phpversion=version_php(); $phpversion=version_php();
print "<tr ".$bc[$var].'><td width="220px">'.$langs->trans("Version")."</td><td>".$phpversion."</td></tr>\n"; print "<tr ".$bc[$var].'><td width="220px">'.$langs->trans("Version")."</td><td>".$phpversion."</td></tr>\n";

View File

@ -30,9 +30,7 @@
/** /**
* \class BankCateg * Class to manage bank categories
* \brief Class to manage bank categories
* \remarks Initialy built by build_class_from_table on 2009-01-02 15:26
*/ */
class BankCateg // extends CommonObject class BankCateg // extends CommonObject
{ {
@ -300,7 +298,7 @@ class BankCateg // extends CommonObject
$error=0; $error=0;
$object=new Bank_categ($this->db); $object=new BankCateg($this->db);
$this->db->begin(); $this->db->begin();

View File

@ -2479,7 +2479,7 @@ class Facture extends CommonInvoice
* Return next reference of customer invoice not already used (or last reference) * Return next reference of customer invoice not already used (or last reference)
* according to numbering module defined into constant FACTURE_ADDON * according to numbering module defined into constant FACTURE_ADDON
* *
* @param Society $soc object company * @param Societe $soc object company
* @param string $mode 'next' for next value or 'last' for last value * @param string $mode 'next' for next value or 'last' for last value
* @return string free ref or last ref * @return string free ref or last ref
*/ */
@ -2838,7 +2838,7 @@ class Facture extends CommonInvoice
function demande_prelevement($user) function demande_prelevement($user)
{ {
$error=0; $error=0;
dol_syslog(get_class($this)."::demande_prelevement", LOG_DEBUG); dol_syslog(get_class($this)."::demande_prelevement", LOG_DEBUG);
if ($this->statut > 0 && $this->paye == 0) if ($this->statut > 0 && $this->paye == 0)
@ -2896,12 +2896,12 @@ class Facture extends CommonInvoice
{ {
// Force payment mode of invoice to withdraw // Force payment mode of invoice to withdraw
$payment_mode_id = dol_getIdFromCode($this->db, 'PRE', 'c_paiement'); $payment_mode_id = dol_getIdFromCode($this->db, 'PRE', 'c_paiement');
if ($payment_mode_id > 0) if ($payment_mode_id > 0)
{ {
$result=$this->setPaymentMethods($payment_mode_id); $result=$this->setPaymentMethods($payment_mode_id);
} }
} }
if ($error) return -1; if ($error) return -1;
return 1; return 1;
} }
@ -3519,7 +3519,7 @@ class FactureLigne extends CommonInvoiceLine
return -1; return -1;
} }
} }
// POS or by external module, take lowest buying price // POS or by external module, take lowest buying price
if (!empty($this->fk_product) && empty($this->fk_fournprice) && empty($this->pa_ht)) { if (!empty($this->fk_product) && empty($this->fk_fournprice) && empty($this->pa_ht)) {
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';

View File

@ -58,7 +58,7 @@ class BonPrelevement extends CommonObject
var $invoice_in_error=array(); var $invoice_in_error=array();
/** /**
* Constructor * Constructor
* *
@ -1634,7 +1634,7 @@ class BonPrelevement extends CommonObject
* @param int $nombre 0 or 1 * @param int $nombre 0 or 1
* @param float $total Total * @param float $total Total
* @param string $CrLf End of line character * @param string $CrLf End of line character
* @return SEPA * @return string String with SEAP Sender
*/ */
function EnregEmetteurSEPA($configuration, $ladate, $nombre, $total, $CrLf='\n') function EnregEmetteurSEPA($configuration, $ladate, $nombre, $total, $CrLf='\n')
{ // SEPA INITIALISATION { // SEPA INITIALISATION

View File

@ -209,6 +209,8 @@ $maxyear=substr($maxyearmonth,0,4);
$nowyear=strftime("%Y",dol_now()); $nowyear=strftime("%Y",dol_now());
$nowyearmonth=strftime("%Y-%m",dol_now()); $nowyearmonth=strftime("%Y-%m",dol_now());
$maxyearmonth=max($maxyearmonth,$nowyearmonth); $maxyearmonth=max($maxyearmonth,$nowyearmonth);
$now=dol_now();
$casenow = dol_print_date($now,"%Y-%m");
// Loop on each month // Loop on each month
$nb_mois_decalage = $conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START-1):0; $nb_mois_decalage = $conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START-1):0;
@ -220,22 +222,37 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++)
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print "<td>".dol_print_date(dol_mktime(12,0,0,$mois_modulo,1,2000),"%B")."</td>"; print "<td>".dol_print_date(dol_mktime(12,0,0,$mois_modulo,1,2000),"%B")."</td>";
for ($annee = $year_start ; $annee <= $year_end ; $annee++) for ($annee = $year_start -1 ; $annee <= $year_end ; $annee++) // We start one year before to have data to be able to make delta
{ {
$now=dol_now();
$annee_decalage=$annee; $annee_decalage=$annee;
if ($mois>12) {$annee_decalage=$annee+1;} if ($mois>12) {$annee_decalage=$annee+1;}
$casenow = dol_print_date($now,"%Y-%m");
$case = dol_print_date(dol_mktime(1,1,1,$mois_modulo,1,$annee_decalage),"%Y-%m"); $case = dol_print_date(dol_mktime(1,1,1,$mois_modulo,1,$annee_decalage),"%Y-%m");
$caseprev = dol_print_date(dol_mktime(1,1,1,$mois_modulo,1,$annee_decalage-1),"%Y-%m"); $caseprev = dol_print_date(dol_mktime(1,1,1,$mois_modulo,1,$annee_decalage-1),"%Y-%m");
if ($modecompta == 'CREANCES-DETTES') { if ($annee >= $year_start)
// Valeur CA du mois w/o VAT {
if ($modecompta == 'CREANCES-DETTES') {
// Valeur CA du mois w/o VAT
print '<td align="right">';
if ($cum_ht[$case])
{
$now_show_delta=1; // On a trouve le premier mois de la premiere annee generant du chiffre.
print '<a href="casoc.php?year='.$annee_decalage.'&month='.$mois_modulo.($modecompta?'&modecompta='.$modecompta:'').'">'.price($cum_ht[$case],1).'</a>';
}
else
{
if ($minyearmonth < $case && $case <= max($maxyearmonth,$nowyearmonth)) { print '0'; }
else { print '&nbsp;'; }
}
print "</td>";
}
// Valeur CA du mois
print '<td align="right">'; print '<td align="right">';
if ($cum_ht[$case]) if ($cum[$case])
{ {
$now_show_delta=1; // On a trouve le premier mois de la premiere annee generant du chiffre. $now_show_delta=1; // On a trouve le premier mois de la premiere annee generant du chiffre.
print '<a href="casoc.php?year='.$annee_decalage.'&month='.$mois_modulo.($modecompta?'&modecompta='.$modecompta:'').'">'.price($cum_ht[$case],1).'</a>'; print '<a href="casoc.php?year='.$annee_decalage.'&month='.$mois_modulo.($modecompta?'&modecompta='.$modecompta:'').'">'.price($cum[$case],1).'</a>';
} }
else else
{ {
@ -243,60 +260,46 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++)
else { print '&nbsp;'; } else { print '&nbsp;'; }
} }
print "</td>"; print "</td>";
}
// Valeur CA du mois // Pourcentage du mois
print '<td align="right">'; if ($annee_decalage > $minyear && $case <= $casenow)
if ($cum[$case])
{
$now_show_delta=1; // On a trouve le premier mois de la premiere annee generant du chiffre.
print '<a href="casoc.php?year='.$annee_decalage.'&month='.$mois_modulo.($modecompta?'&modecompta='.$modecompta:'').'">'.price($cum[$case],1).'</a>';
}
else
{
if ($minyearmonth < $case && $case <= max($maxyearmonth,$nowyearmonth)) { print '0'; }
else { print '&nbsp;'; }
}
print "</td>";
// Pourcentage du mois
if ($annee_decalage > $minyear && $case <= $casenow)
{
if ($cum[$caseprev] && $cum[$case])
{ {
$percent=(round(($cum[$case]-$cum[$caseprev])/$cum[$caseprev],4)*100); if ($cum[$caseprev] && $cum[$case])
//print "X $cum[$case] - $cum[$caseprev] - $cum[$caseprev] - $percent X"; {
print '<td align="right" class="borderrightlight">'.($percent>=0?"+$percent":"$percent").'%</td>'; $percent=(round(($cum[$case]-$cum[$caseprev])/$cum[$caseprev],4)*100);
//print "X $cum[$case] - $cum[$caseprev] - $cum[$caseprev] - $percent X";
print '<td align="right" class="borderrightlight">'.($percent>=0?"+$percent":"$percent").'%</td>';
}
if ($cum[$caseprev] && ! $cum[$case])
{
print '<td align="right" class="borderrightlight">-100%</td>';
}
if (! $cum[$caseprev] && $cum[$case])
{
//print '<td align="right">+Inf%</td>';
print '<td align="right" class="borderrightlight">-</td>';
}
if (isset($cum[$caseprev]) && ! $cum[$caseprev] && ! $cum[$case])
{
print '<td align="right" class="borderrightlight">+0%</td>';
}
if (! isset($cum[$caseprev]) && ! $cum[$case])
{
print '<td align="right" class="borderrightlight">-</td>';
}
} }
if ($cum[$caseprev] && ! $cum[$case]) else
{ {
print '<td align="right" class="borderrightlight">-100%</td>'; print '<td align="right" class="borderrightlight">';
if ($minyearmonth <= $case && $case <= $maxyearmonth) { print '-'; }
else { print '&nbsp;'; }
print '</td>';
} }
if (! $cum[$caseprev] && $cum[$case]) if ($annee_decalage != $year_end) print '<td width="15">&nbsp;</td>';
{
//print '<td align="right">+Inf%</td>';
print '<td align="right" class="borderrightlight">-</td>';
}
if (isset($cum[$caseprev]) && ! $cum[$caseprev] && ! $cum[$case])
{
print '<td align="right" class="borderrightlight">+0%</td>';
}
if (! isset($cum[$caseprev]) && ! $cum[$case])
{
print '<td align="right" class="borderrightlight">-</td>';
}
}
else
{
print '<td align="right" class="borderrightlight">';
if ($minyearmonth <= $case && $case <= $maxyearmonth) { print '-'; }
else { print '&nbsp;'; }
print '</td>';
} }
$total_ht[$annee]+=!empty($cum_ht[$case]) ? $cum_ht[$case] : 0;; $total_ht[$annee]+=!empty($cum_ht[$case]) ? $cum_ht[$case] : 0;;
$total[$annee]+=$cum[$case]; $total[$annee]+=$cum[$case];
if ($annee_decalage != $year_end) print '<td width="15">&nbsp;</td>';
} }
print '</tr>'; print '</tr>';
@ -406,7 +409,7 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++)
} }
if (! $total[$annee-1] && $total[$annee]) if (! $total[$annee-1] && $total[$annee])
{ {
print '<td align="right" class="borderrightlight">+Inf%</td>'; print '<td align="right" class="borderrightlight">+zzzz'.$total[$annee-1].$langs->trans('Inf').'%</td>';
} }
if (! $total[$annee-1] && ! $total[$annee]) if (! $total[$annee-1] && ! $total[$annee])
{ {

View File

@ -343,7 +343,7 @@ class Tva extends CommonObject
} }
/** /**
* Total of the VAT from invoices emitted by the society. * Total of the VAT from invoices emitted by the thirdparty.
* *
* @param int $year Year * @param int $year Year
* @return double Amount * @return double Amount

View File

@ -88,7 +88,7 @@ class Contrat extends CommonObject
/** /**
* Return next contract ref * Return next contract ref
* *
* @param Societe $soc objet society * @param Societe $soc Thirdparty object
* @return string free reference for contract * @return string free reference for contract
*/ */
function getNextNumRef($soc) function getNextNumRef($soc)

View File

@ -1201,7 +1201,7 @@ class Form
if (is_array($exclude) && $excludeUsers) $sql.= " AND u.rowid NOT IN ('".$excludeUsers."')"; if (is_array($exclude) && $excludeUsers) $sql.= " AND u.rowid NOT IN ('".$excludeUsers."')";
if (is_array($include) && $includeUsers) $sql.= " AND u.rowid IN ('".$includeUsers."')"; if (is_array($include) && $includeUsers) $sql.= " AND u.rowid IN ('".$includeUsers."')";
if (! empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX)) $sql.= " AND u.statut <> 0"; if (! empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX)) $sql.= " AND u.statut <> 0";
if (! empty($morefilter)) $sql.=$morefilter; if (! empty($morefilter)) $sql.=" ".$morefilter;
$sql.= " ORDER BY u.lastname ASC"; $sql.= " ORDER BY u.lastname ASC";
dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG); dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG);
@ -1219,7 +1219,7 @@ class Form
$out.= ajax_combobox($htmlname); $out.= ajax_combobox($htmlname);
$nodatarole=' data-role="none"'; $nodatarole=' data-role="none"';
} }
$out.= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled?' disabled="disabled"':'').$nodatarole.'>'; $out.= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled?' disabled="disabled"':'').$nodatarole.'>';
if ($show_empty) $out.= '<option value="-1"'.((empty($selected) || $selected==-1)?' selected="selected"':'').'>&nbsp;</option>'."\n"; if ($show_empty) $out.= '<option value="-1"'.((empty($selected) || $selected==-1)?' selected="selected"':'').'>&nbsp;</option>'."\n";
@ -3773,7 +3773,7 @@ class Form
* @param string $prefix Prefix for fields name * @param string $prefix Prefix for fields name
* @param int $h 1=Show also hours * @param int $h 1=Show also hours
* @param int $m 1=Show also minutes * @param int $m 1=Show also minutes
* @param int $empty 0=Fields required, 1=Empty input is allowed * @param int $empty 0=Fields required, 1=Empty inputs are allowed, 2=Empty inputs are allowed for hours only
* @param string $form_name Not used * @param string $form_name Not used
* @param int $d 1=Show days, month, years * @param int $d 1=Show days, month, years
* @param int $addnowbutton Add a button "Now" * @param int $addnowbutton Add a button "Now"
@ -3792,9 +3792,13 @@ class Form
if($prefix=='') $prefix='re'; if($prefix=='') $prefix='re';
if($h == '') $h=0; if($h == '') $h=0;
if($m == '') $m=0; if($m == '') $m=0;
if($empty == '') $empty=0; $emptydate=0;
$emptyhours=0;
if ($empty == 1) { $emptydate=1; $emptyhours=1; }
if ($empty == 2) { $emptydate=0; $emptyhours=1; }
$orig_set_time=$set_time;
if ($set_time === '' && $empty == 0) if ($set_time === '' && $emptydate == 0)
{ {
include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
$set_time = dol_now('tzuser')-(getServerTimeZoneInt('now')*3600); // set_time must be relative to PHP server timezone $set_time = dol_now('tzuser')-(getServerTimeZoneInt('now')*3600); // set_time must be relative to PHP server timezone
@ -3816,8 +3820,11 @@ class Form
$syear = dol_print_date($set_time, "%Y"); $syear = dol_print_date($set_time, "%Y");
$smonth = dol_print_date($set_time, "%m"); $smonth = dol_print_date($set_time, "%m");
$sday = dol_print_date($set_time, "%d"); $sday = dol_print_date($set_time, "%d");
$shour = dol_print_date($set_time, "%H"); if ($orig_set_time != '')
$smin = dol_print_date($set_time, "%M"); {
$shour = dol_print_date($set_time, "%H");
$smin = dol_print_date($set_time, "%M");
}
} }
else else
{ {
@ -3879,7 +3886,7 @@ class Form
// Day // Day
$retstring.='<select'.($disabled?' disabled="disabled"':'').' class="flat" name="'.$prefix.'day">'; $retstring.='<select'.($disabled?' disabled="disabled"':'').' class="flat" name="'.$prefix.'day">';
if ($empty || $set_time == -1) if ($emptydate || $set_time == -1)
{ {
$retstring.='<option value="0" selected="selected">&nbsp;</option>'; $retstring.='<option value="0" selected="selected">&nbsp;</option>';
} }
@ -3892,7 +3899,7 @@ class Form
$retstring.="</select>"; $retstring.="</select>";
$retstring.='<select'.($disabled?' disabled="disabled"':'').' class="flat" name="'.$prefix.'month">'; $retstring.='<select'.($disabled?' disabled="disabled"':'').' class="flat" name="'.$prefix.'month">';
if ($empty || $set_time == -1) if ($emptydate || $set_time == -1)
{ {
$retstring.='<option value="0" selected="selected">&nbsp;</option>'; $retstring.='<option value="0" selected="selected">&nbsp;</option>';
} }
@ -3907,7 +3914,7 @@ class Form
$retstring.="</select>"; $retstring.="</select>";
// Year // Year
if ($empty || $set_time == -1) if ($emptydate || $set_time == -1)
{ {
$retstring.='<input'.($disabled?' disabled="disabled"':'').' placeholder="'.dol_escape_htmltag($langs->trans("Year")).'" class="flat" type="text" size="3" maxlength="4" name="'.$prefix.'year" value="'.$syear.'">'; $retstring.='<input'.($disabled?' disabled="disabled"':'').' placeholder="'.dol_escape_htmltag($langs->trans("Year")).'" class="flat" type="text" size="3" maxlength="4" name="'.$prefix.'year" value="'.$syear.'">';
} }
@ -3930,7 +3937,7 @@ class Form
{ {
// Show hour // Show hour
$retstring.='<select'.($disabled?' disabled="disabled"':'').' class="flat '.($fullday?$fullday.'hour':'').'" name="'.$prefix.'hour">'; $retstring.='<select'.($disabled?' disabled="disabled"':'').' class="flat '.($fullday?$fullday.'hour':'').'" name="'.$prefix.'hour">';
if ($empty) $retstring.='<option value="-1">&nbsp;</option>'; if ($emptyhours) $retstring.='<option value="-1">&nbsp;</option>';
for ($hour = 0; $hour < 24; $hour++) for ($hour = 0; $hour < 24; $hour++)
{ {
if (strlen($hour) < 2) $hour = "0" . $hour; if (strlen($hour) < 2) $hour = "0" . $hour;
@ -3944,7 +3951,7 @@ class Form
{ {
// Show minutes // Show minutes
$retstring.='<select'.($disabled?' disabled="disabled"':'').' class="flat '.($fullday?$fullday.'min':'').'" name="'.$prefix.'min">'; $retstring.='<select'.($disabled?' disabled="disabled"':'').' class="flat '.($fullday?$fullday.'min':'').'" name="'.$prefix.'min">';
if ($empty) $retstring.='<option value="-1">&nbsp;</option>'; if ($emptyhours) $retstring.='<option value="-1">&nbsp;</option>';
for ($min = 0; $min < 60 ; $min++) for ($min = 0; $min < 60 ; $min++)
{ {
if (strlen($min) < 2) $min = "0" . $min; if (strlen($min) < 2) $min = "0" . $min;
@ -4003,18 +4010,22 @@ class Form
/** /**
* Function to show a form to select a duration on a page * Function to show a form to select a duration on a page
* *
* @param string $prefix Prefix * @param string $prefix Prefix for input fields
* @param int $iSecond Default preselected duration (number of seconds) * @param int $iSecond Default preselected duration (number of seconds)
* @param int $disabled Disable the combo box * @param int $disabled Disable the combo box
* @param string $typehour If 'select' then input hour and input min is a combo, if 'text' input hour is in text and input min is a combo * @param string $typehour If 'select' then input hour and input min is a combo, if 'text' input hour is in text and input min is a combo
* @param string $minunderhours If 1, show minutes selection under the hours * @param string $minunderhours If 1, show minutes selection under the hours
* @param int $nooutput Do not output html string but return it
* @return void * @return void
*/ */
function select_duration($prefix, $iSecond='', $disabled=0, $typehour='select', $minunderhours=0) function select_duration($prefix, $iSecond='', $disabled=0, $typehour='select', $minunderhours=0, $nooutput=0)
{ {
global $langs; global $langs;
$retstring='';
$hourSelected=0; $minSelected=0; $hourSelected=0; $minSelected=0;
if ($iSecond) if ($iSecond)
{ {
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
@ -4025,36 +4036,51 @@ class Form
if ($typehour=='select') if ($typehour=='select')
{ {
print '<select class="flat" name="'.$prefix.'hour"'.($disabled?' disabled="disabled"':'').'>'; $retstring.='<select class="flat" name="'.$prefix.'hour"'.($disabled?' disabled="disabled"':'').'>';
for ($hour = 0; $hour < 25; $hour++) // For a duration, we allow 24 hours for ($hour = 0; $hour < 25; $hour++) // For a duration, we allow 24 hours
{ {
print '<option value="'.$hour.'"'; $retstring.='<option value="'.$hour.'"';
if ($hourSelected == $hour) if ($hourSelected == $hour)
{ {
print " selected=\"true\""; $retstring.=" selected=\"true\"";
} }
print ">".$hour."</option>"; $retstring.=">".$hour."</option>";
} }
print "</select>"; $retstring.="</select>";
} }
elseif ($typehour=='text') elseif ($typehour=='text')
{ {
print '<input type="text" size="3" name="'.$prefix.'hour"'.($disabled?' disabled="disabled"':'').' class="flat" value="'.((int) $hourSelected).'">'; $retstring.='<input type="text" size="2" name="'.$prefix.'hour"'.($disabled?' disabled="disabled"':'').' class="flat" value="'.($hourSelected?((int) $hourSelected):'').'">';
} }
print ' '.$langs->trans('HourShort'); else return 'BadValueForParameterTypeHour';
if ($minunderhours) print '<br>'; $retstring.=' '.$langs->trans('HourShort');
else print "&nbsp;";
print '<select class="flat" name="'.$prefix.'min"'.($disabled?' disabled="disabled"':'').'>'; if ($minunderhours) $retstring.='<br>';
for ($min = 0; $min <= 55; $min=$min+5) else $retstring.="&nbsp;";
if ($typehour=='select')
{ {
print '<option value="'.$min.'"'; $retstring.='<select class="flat" name="'.$prefix.'min"'.($disabled?' disabled="disabled"':'').'>';
if ($minSelected == $min) print ' selected="selected"'; for ($min = 0; $min <= 55; $min=$min+5)
print '>'.$min.'</option>'; {
$retstring.='<option value="'.$min.'"';
if ($minSelected == $min) $retstring.=' selected="selected"';
$retstring.='>'.$min.'</option>';
}
$retstring.="</select>";
} }
print "</select>"; elseif ($typehour=='text')
print ' '.$langs->trans('MinuteShort'). "&nbsp;"; {
$retstring.='<input type="text" size="2" name="'.$prefix.'min"'.($disabled?' disabled="disabled"':'').' class="flat" value="'.($minSelected?((int) $minSelected):'').'">';
}
$retstring.=' '.$langs->trans('MinuteShort');
$retstring.="&nbsp;";
if (! empty($nooutput)) return $retstring;
print $retstring;
return;
} }
@ -4524,7 +4550,7 @@ class Form
} }
$out.= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled?' disabled="disabled"':'').$nodatarole.'>'; $out.= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled?' disabled="disabled"':'').$nodatarole.'>';
$num = $this->db->num_rows($resql); $num = $this->db->num_rows($resql);
$i = 0; $i = 0;
if ($num) if ($num)

View File

@ -668,7 +668,7 @@ class DoliDBPgsql extends DoliDB
/** /**
* Renvoie le code erreur generique de l'operation precedente. * Renvoie le code erreur generique de l'operation precedente.
* *
* @return error_num (Exemples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...) * @return string Error code (Exemples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...)
*/ */
function errno() function errno()
{ {
@ -734,7 +734,7 @@ class DoliDBPgsql extends DoliDB
/** /**
* Renvoie le texte de l'erreur pgsql de l'operation precedente * Renvoie le texte de l'erreur pgsql de l'operation precedente
* *
* @return error_text * @return string Error text
*/ */
function error() function error()
{ {

View File

@ -535,7 +535,7 @@ class DoliDBSqlite extends DoliDB
/** /**
* Renvoie le code erreur generique de l'operation precedente. * Renvoie le code erreur generique de l'operation precedente.
* *
* @return string $error_num (Exemples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...) * @return string Error code (Exemples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...)
*/ */
function errno() function errno()
{ {
@ -597,7 +597,7 @@ class DoliDBSqlite extends DoliDB
/** /**
* Renvoie le texte de l'erreur mysql de l'operation precedente. * Renvoie le texte de l'erreur mysql de l'operation precedente.
* *
* @return string $error_text * @return string Error text
*/ */
function error() function error()
{ {

View File

@ -32,6 +32,8 @@
function ecm_prepare_dasboard_head($object) function ecm_prepare_dasboard_head($object)
{ {
global $langs, $conf, $user, $form; global $langs, $conf, $user, $form;
global $helptext1, $helptext2;
$h = 0; $h = 0;
$head = array(); $head = array();
$helptext =$langs->trans("ECMAreaDesc").'<br>'; $helptext =$langs->trans("ECMAreaDesc").'<br>';

View File

@ -1273,7 +1273,7 @@ function pdf_getlineupexcltax($object,$i,$outputlangs,$hidedetails=0)
* *
* @param Object $object Object * @param Object $object Object
* @param int $i Current line number * @param int $i Current line number
* @param Tranlate $outputlangs Object langs for output * @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide value (0 = no, 1 = yes, 2 = just special lines) * @param int $hidedetails Hide value (0 = no, 1 = yes, 2 = just special lines)
* @return void * @return void
*/ */

View File

@ -384,10 +384,13 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
else print '</a>'; else print '</a>';
print '</td>'; print '</td>';
// Progress calculated // Progress calculated (Note: ->duration is time spent)
// Note: ->duration is in fact time spent i think
print '<td align="right">'; print '<td align="right">';
if ($lines[$i]->planned_workload) print round(100 * $lines[$i]->duration / $lines[$i]->planned_workload,2).' %'; if ($lines[$i]->planned_workload || $lines[$i]->duration)
{
if ($lines[$i]->planned_workload) print round(100 * $lines[$i]->duration / $lines[$i]->planned_workload,2).' %';
else print $langs->trans('WorkloadNotDefined');
}
print '</td>'; print '</td>';
// Tick to drag and drop // Tick to drag and drop
@ -430,7 +433,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
print convertSecondToTime($total_projectlinesa_spent, 'allhourmin'); print convertSecondToTime($total_projectlinesa_spent, 'allhourmin');
print '</td>'; print '</td>';
print '<td align="right" class="nowrap liste_total">'; print '<td align="right" class="nowrap liste_total">';
if ($total_projectlinesa_planned) print round(100 * $total_projectlinesa_spent_if_planned / $total_projectlinesa_planned,2).' %'; if ($total_projectlinesa_planned) print round(100 * $total_projectlinesa_spent / $total_projectlinesa_planned,2).' %';
print '</td>'; print '</td>';
if ($addordertick) print '<td class="hideonsmartphone"></td>'; if ($addordertick) print '<td class="hideonsmartphone"></td>';
print '</tr>'; print '</tr>';
@ -562,13 +565,16 @@ function projectLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksr
$disabledtask=1; $disabledtask=1;
} }
print '<td class="nowrap">'; // Form to add new time
$s =$form->select_date('',$lines[$i]->id,'','','',"addtime",1,0,1,$disabledtask); print '<td class="nowrap" align="right">';
$s='';
$s.=$form->select_date('',$lines[$i]->id,0,0,2,"addtime",1,0,1,$disabledtask);
$s.='&nbsp;&nbsp;&nbsp;'; $s.='&nbsp;&nbsp;&nbsp;';
$s.=$form->select_duration($lines[$i]->id,'',$disabledtask,'text'); $s.=$form->select_duration($lines[$i]->id,'',$disabledtask,'text',0,1);
$s.='&nbsp;<input type="submit" class="button"'.($disabledtask?' disabled="disabled"':'').' value="'.$langs->trans("Add").'">'; $s.='&nbsp;<input type="submit" class="button"'.($disabledtask?' disabled="disabled"':'').' value="'.$langs->trans("Add").'">';
print $s; print $s;
print '</td>'; print '</td>';
print '<td align="right">'; print '<td align="right">';
if ((! $lines[$i]->public) && $disabledproject) print $form->textwithpicto('',$langs->trans("YouAreNotContactOfProject")); if ((! $lines[$i]->public) && $disabledproject) print $form->textwithpicto('',$langs->trans("YouAreNotContactOfProject"));
else if ($disabledtask) print $form->textwithpicto('',$langs->trans("TaskIsNotAffectedToYou")); else if ($disabledtask) print $form->textwithpicto('',$langs->trans("TaskIsNotAffectedToYou"));

View File

@ -44,7 +44,7 @@ interface LogHandlerInterface
/** /**
* Return if logger active * Return if logger active
* *
* @return boolen True if active * @return boolean True if active
*/ */
public function isActive(); public function isActive();

View File

@ -113,7 +113,7 @@ class Expedition extends CommonObject
/** /**
* Return next contract ref * Return next contract ref
* *
* @param Societe $soc Objet society * @param Societe $soc Thirdparty object
* @return string Free reference for contract * @return string Free reference for contract
*/ */
function getNextNumRef($soc) function getNextNumRef($soc)
@ -604,9 +604,11 @@ class Expedition extends CommonObject
if (! empty($conf->productbatch->enabled)) { if (! empty($conf->productbatch->enabled)) {
$details=ExpeditionLigneBatch::FetchAll($this->db,$obj->rowid); $details=ExpeditionLigneBatch::FetchAll($this->db,$obj->rowid);
foreach ($details as $dbatch) { if (! empty($details)) {
$result=$mouvS->livraison_batch($dbatch->fk_origin_stock,$dbatch->dluo_qty); foreach ($details as $dbatch) {
if ($result < 0) { $error++; $this->errors[]=$mouvS->$error; break 2; } $result=$mouvS->livraison_batch($dbatch->fk_origin_stock,$dbatch->dluo_qty);
if ($result < 0) { $error++; $this->errors[]=$mouvS->$error; break 2; }
}
} }
} }
} }

View File

@ -561,7 +561,7 @@ class Fichinter extends CommonObject
* Returns the next non used reference of intervention * Returns the next non used reference of intervention
* depending on the module numbering assets within FICHEINTER_ADDON * depending on the module numbering assets within FICHEINTER_ADDON
* *
* @param Societe $soc Object society * @param Societe $soc Thirdparty object
* @return string Free reference for intervention * @return string Free reference for intervention
*/ */
function getNextNumRef($soc) function getNextNumRef($soc)

View File

@ -1493,7 +1493,7 @@ class FactureFournisseur extends CommonInvoice
* Return next reference of supplier invoice not already used (or last reference) * Return next reference of supplier invoice not already used (or last reference)
* according to numbering module defined into constant INVOICE_SUPPLIER_ADDON_NUMBER * according to numbering module defined into constant INVOICE_SUPPLIER_ADDON_NUMBER
* *
* @param Society $soc object company * @param Societe $soc Thirdparty object
* @param string $mode 'next' for next value or 'last' for last value * @param string $mode 'next' for next value or 'last' for last value
* @return string free ref or last ref * @return string free ref or last ref
*/ */

View File

@ -46,7 +46,7 @@ llxHeader(array(),$langs->trans('CPTitreMenu'));
print_fiche_titre($langs->trans('MenuConfCP')); print_fiche_titre($langs->trans('MenuConfCP'));
$congespayes = new Holidays($db); $congespayes = new Holiday($db);
$listUsers = $congespayes->fetchUsers(false, true); $listUsers = $congespayes->fetchUsers(false, true);
// Si il y a une action de mise à jour // Si il y a une action de mise à jour

View File

@ -181,7 +181,7 @@ print '<td align="center">'.$langs->trans("DateEnd").'</td>';
print '<td align="right">'.$langs->trans("PlannedWorkload").'</td>'; print '<td align="right">'.$langs->trans("PlannedWorkload").'</td>';
print '<td align="right">'.$langs->trans("ProgressDeclared").'</td>'; print '<td align="right">'.$langs->trans("ProgressDeclared").'</td>';
print '<td align="right">'.$langs->trans("TimeSpent").'</td>'; print '<td align="right">'.$langs->trans("TimeSpent").'</td>';
print '<td colspan="2">'.$langs->trans("AddDuration").'</td>'; print '<td colspan="2" align="right">'.$langs->trans("NewTimeSpent").'</td>';
print "</tr>\n"; print "</tr>\n";
// By default, we can edit only tasks we are assigned to // By default, we can edit only tasks we are assigned to

View File

@ -215,8 +215,6 @@ if ($id > 0 || ! empty($ref))
print '</table>'; print '</table>';
dol_fiche_end(); dol_fiche_end();
print '<br>';
} }
// To verify role of users // To verify role of users

View File

@ -179,8 +179,6 @@ if ($object->id > 0)
print '</table>'; print '</table>';
dol_fiche_end(); dol_fiche_end();
print '<br>';
} }
$head = task_prepare_head($object); $head = task_prepare_head($object);

View File

@ -161,8 +161,6 @@ if ($object->id > 0)
print '</table>'; print '</table>';
dol_fiche_end(); dol_fiche_end();
print '<br>';
} }
$head = task_prepare_head($object); $head = task_prepare_head($object);

View File

@ -262,8 +262,6 @@ if ($id > 0 || ! empty($ref))
print '</table>'; print '</table>';
dol_fiche_end(); dol_fiche_end();
print '<br>';
} }
/* /*

View File

@ -259,8 +259,6 @@ if ($id > 0 || ! empty($ref))
print '</table>'; print '</table>';
dol_fiche_end(); dol_fiche_end();
print '<br>';
} }
$head=task_prepare_head($object); $head=task_prepare_head($object);
@ -362,8 +360,7 @@ if ($id > 0 || ! empty($ref))
print '<td>'.$langs->trans("By").'</td>'; print '<td>'.$langs->trans("By").'</td>';
print '<td>'.$langs->trans("Note").'</td>'; print '<td>'.$langs->trans("Note").'</td>';
print '<td>'.$langs->trans("ProgressDeclared").'</td>'; print '<td>'.$langs->trans("ProgressDeclared").'</td>';
print '<td align="right">'.$langs->trans("Duration").'</td>'; print '<td align="right" colspan="2">'.$langs->trans("NewTimeSpent").'</td>';
print '<td width="80">&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";
print '<tr '.$bc[false].'>'; print '<tr '.$bc[false].'>';
@ -396,7 +393,7 @@ if ($id > 0 || ! empty($ref))
print $formother->select_percent(GETPOST('progress')?GETPOST('progress'):$object->progress,'progress'); print $formother->select_percent(GETPOST('progress')?GETPOST('progress'):$object->progress,'progress');
print '</td>'; print '</td>';
// Duration // Duration - Time spent
print '<td class="nowrap" align="right">'; print '<td class="nowrap" align="right">';
print $form->select_duration('timespent_duration', ($_POST['timespent_duration']?$_POST['timespent_duration']:''), 0, 'text'); print $form->select_duration('timespent_duration', ($_POST['timespent_duration']?$_POST['timespent_duration']:''), 0, 'text');
print '</td>'; print '</td>';
@ -446,13 +443,13 @@ if ($id > 0 || ! empty($ref))
print '<input type="hidden" name="action" value="updateline">'; print '<input type="hidden" name="action" value="updateline">';
print '<input type="hidden" name="id" value="'.$object->id.'">'; print '<input type="hidden" name="id" value="'.$object->id.'">';
print '<input type="hidden" name="withproject" value="'.$withproject.'">'; print '<input type="hidden" name="withproject" value="'.$withproject.'">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td width="100">'.$langs->trans("Date").'</td>'; print '<td width="100">'.$langs->trans("Date").'</td>';
print '<td>'.$langs->trans("By").'</td>'; print '<td>'.$langs->trans("By").'</td>';
print '<td align="left">'.$langs->trans("Note").'</td>'; print '<td align="left">'.$langs->trans("Note").'</td>';
print '<td align="right">'.$langs->trans("Duration").'</td>'; print '<td align="right">'.$langs->trans("TimeSpent").'</td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";

View File

@ -2382,7 +2382,7 @@ class Societe extends CommonObject
* *
* @param int $idprof 1,2,3,4 (Example: 1=siren,2=siret,3=naf,4=rcs/rm) * @param int $idprof 1,2,3,4 (Example: 1=siren,2=siret,3=naf,4=rcs/rm)
* @param string $value Value of profid * @param string $value Value of profid
* @param int $socid Id of society if update * @param int $socid Id of thirdparty if update
* @return boolean true if exists, false if not * @return boolean true if exists, false if not
*/ */
function id_prof_exists($idprof,$value,$socid=0) function id_prof_exists($idprof,$value,$socid=0)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 710 B

After

Width:  |  Height:  |  Size: 528 B

View File

@ -138,7 +138,7 @@ class User extends CommonObject
* *
* @param int $id Si defini, id a utiliser pour recherche * @param int $id Si defini, id a utiliser pour recherche
* @param string $login Si defini, login a utiliser pour recherche * @param string $login Si defini, login a utiliser pour recherche
* @param strinf $sid Si defini, sid a utiliser pour recherche * @param string $sid Si defini, sid a utiliser pour recherche
* @param int $loadpersonalconf Also load personal conf of user (in $user->conf->xxx) * @param int $loadpersonalconf Also load personal conf of user (in $user->conf->xxx)
* @return int <0 if KO, 0 not found, >0 if OK * @return int <0 if KO, 0 not found, >0 if OK
*/ */

View File

@ -234,7 +234,7 @@ $server->register(
* @param array $authentication Array of authentication information * @param array $authentication Array of authentication information
* @param int $id Id of object * @param int $id Id of object
* @param string $ref Ref of object * @param string $ref Ref of object
* @param ref_ext $ref_ext Ref external of object * @param string $ref_ext Ref external of object
* @return mixed * @return mixed
*/ */
function getContact($authentication,$id,$ref='',$ref_ext='') function getContact($authentication,$id,$ref='',$ref_ext='')

View File

@ -327,7 +327,7 @@ $server->register(
* @param array $authentication Array of authentication information * @param array $authentication Array of authentication information
* @param int $id Id of object * @param int $id Id of object
* @param string $ref Ref of object * @param string $ref Ref of object
* @param ref_ext $ref_ext Ref external of object * @param string $ref_ext Ref external of object
* @param string $lang Lang to force * @param string $lang Lang to force
* @return mixed * @return mixed
*/ */
@ -378,7 +378,7 @@ function getProductOrService($authentication,$id='',$ref='',$ref_ext='',$lang=''
if (! empty($product->multilangs[$langs->defaultlang]["label"])) $product->label = $product->multilangs[$langs->defaultlang]["label"]; if (! empty($product->multilangs[$langs->defaultlang]["label"])) $product->label = $product->multilangs[$langs->defaultlang]["label"];
if (! empty($product->multilangs[$langs->defaultlang]["description"])) $product->description = $product->multilangs[$langs->defaultlang]["description"]; if (! empty($product->multilangs[$langs->defaultlang]["description"])) $product->description = $product->multilangs[$langs->defaultlang]["description"];
if (! empty($product->multilangs[$langs->defaultlang]["note"])) $product->note = $product->multilangs[$langs->defaultlang]["note"]; if (! empty($product->multilangs[$langs->defaultlang]["note"])) $product->note = $product->multilangs[$langs->defaultlang]["note"];
$productorservice_result_fields = array( $productorservice_result_fields = array(
'id' => $product->id, 'id' => $product->id,
'ref' => $product->ref, 'ref' => $product->ref,
@ -396,7 +396,7 @@ function getProductOrService($authentication,$id='',$ref='',$ref_ext='',$lang=''
'country_id' => $product->country_id>0?$product->country_id:'', 'country_id' => $product->country_id>0?$product->country_id:'',
'country_code' => $product->country_code, 'country_code' => $product->country_code,
'custom_code' => $product->customcode, 'custom_code' => $product->customcode,
'price_net' => $product->price, 'price_net' => $product->price,
'price' => $product->price_ttc, 'price' => $product->price_ttc,
'price_min_net' => $product->price_min, 'price_min_net' => $product->price_min,
@ -408,7 +408,7 @@ function getProductOrService($authentication,$id='',$ref='',$ref_ext='',$lang=''
//! Spanish local taxes //! Spanish local taxes
'localtax1_tx' => $product->localtax1_tx, 'localtax1_tx' => $product->localtax1_tx,
'localtax2_tx' => $product->localtax2_tx, 'localtax2_tx' => $product->localtax2_tx,
'stock_real' => $product->stock_reel, 'stock_real' => $product->stock_reel,
'stock_alert' => $product->seuil_stock_alerte, 'stock_alert' => $product->seuil_stock_alerte,
'pmp' => $product->pmp, 'pmp' => $product->pmp,
@ -416,19 +416,19 @@ function getProductOrService($authentication,$id='',$ref='',$ref_ext='',$lang=''
'dir' => $pdir, 'dir' => $pdir,
'images' => $product->liste_photos($dir,$nbmax=10) 'images' => $product->liste_photos($dir,$nbmax=10)
); );
//Retreive all extrafield for thirdsparty //Retreive all extrafield for thirdsparty
// fetch optionals attributes and labels // fetch optionals attributes and labels
$extrafields=new ExtraFields($db); $extrafields=new ExtraFields($db);
$extralabels=$extrafields->fetch_name_optionals_label('product',true); $extralabels=$extrafields->fetch_name_optionals_label('product',true);
//Get extrafield values //Get extrafield values
$product->fetch_optionals($product->id,$extralabels); $product->fetch_optionals($product->id,$extralabels);
foreach($extrafields->attribute_label as $key=>$label) foreach($extrafields->attribute_label as $key=>$label)
{ {
$productorservice_result_fields=array_merge($productorservice_result_fields,array('options_'.$key => $product->array_options['options_'.$key])); $productorservice_result_fields=array_merge($productorservice_result_fields,array('options_'.$key => $product->array_options['options_'.$key]));
} }
// Create // Create
$objectresp = array( $objectresp = array(
'result'=>array('result_code'=>'OK', 'result_label'=>''), 'result'=>array('result_code'=>'OK', 'result_label'=>''),
@ -533,7 +533,7 @@ function createProductOrService($authentication,$product)
}*/ }*/
//var_dump($product['ref_ext']); //var_dump($product['ref_ext']);
//var_dump($product['lines'][0]['type']); //var_dump($product['lines'][0]['type']);
$extrafields=new ExtraFields($db); $extrafields=new ExtraFields($db);
$extralabels=$extrafields->fetch_name_optionals_label('product',true); $extralabels=$extrafields->fetch_name_optionals_label('product',true);
foreach($extrafields->attribute_label as $key=>$label) foreach($extrafields->attribute_label as $key=>$label)
@ -652,7 +652,7 @@ function updateProductOrService($authentication,$product)
}*/ }*/
//var_dump($product['ref_ext']); //var_dump($product['ref_ext']);
//var_dump($product['lines'][0]['type']); //var_dump($product['lines'][0]['type']);
$extrafields=new ExtraFields($db); $extrafields=new ExtraFields($db);
$extralabels=$extrafields->fetch_name_optionals_label('product',true); $extralabels=$extrafields->fetch_name_optionals_label('product',true);
foreach($extrafields->attribute_label as $key=>$label) foreach($extrafields->attribute_label as $key=>$label)
@ -965,19 +965,19 @@ function getProductsForCategory($authentication,$id,$lang='')
'dir' => $pdir, 'dir' => $pdir,
'images' => $obj->liste_photos($dir,$nbmax=10) 'images' => $obj->liste_photos($dir,$nbmax=10)
); );
//Retreive all extrafield for thirdsparty //Retreive all extrafield for thirdsparty
// fetch optionals attributes and labels // fetch optionals attributes and labels
$extrafields=new ExtraFields($db); $extrafields=new ExtraFields($db);
$extralabels=$extrafields->fetch_name_optionals_label('product',true); $extralabels=$extrafields->fetch_name_optionals_label('product',true);
//Get extrafield values //Get extrafield values
$product->fetch_optionals($obj->id,$extralabels); $product->fetch_optionals($obj->id,$extralabels);
foreach($extrafields->attribute_label as $key=>$label) foreach($extrafields->attribute_label as $key=>$label)
{ {
$products[$iProduct]=array_merge($products[$iProduct],array('options_'.$key => $product->array_options['options_'.$key])); $products[$iProduct]=array_merge($products[$iProduct],array('options_'.$key => $product->array_options['options_'.$key]));
} }
$iProduct++; $iProduct++;
} }

View File

@ -299,7 +299,7 @@ $server->register(
* @param array $authentication Array of authentication information * @param array $authentication Array of authentication information
* @param int $id Id of object * @param int $id Id of object
* @param string $ref Ref of object * @param string $ref Ref of object
* @param ref_ext $ref_ext Ref external of object * @param string $ref_ext Ref external of object
* @return mixed * @return mixed
*/ */
function getUser($authentication,$id,$ref='',$ref_ext='') function getUser($authentication,$id,$ref='',$ref_ext='')