Merge branch '3.7' of git@github.com:Dolibarr/dolibarr.git into 3.7

This commit is contained in:
Florian HENRY 2015-03-09 10:52:09 +01:00
commit 15dfd7c08d
26 changed files with 149 additions and 121 deletions

View File

@ -199,6 +199,7 @@ Dolibarr better:
- Fix: [ bug #1825 ] External agenda: hide/show checkbox doesn't work - Fix: [ bug #1825 ] External agenda: hide/show checkbox doesn't work
- Fix: [ bug #1790 ] Email form behaves in an unexpected way when pressing Enter key - Fix: [ bug #1790 ] Email form behaves in an unexpected way when pressing Enter key
- Fix: Bad SEPA xml file creation - Fix: Bad SEPA xml file creation
- Fix: [ bug #1892 ] PHP Fatal error when using USER_UPDATE_SESSION trigger and adding a supplier invoice payment
***** ChangeLog for 3.6.2 compared to 3.6.1 ***** ***** ChangeLog for 3.6.2 compared to 3.6.1 *****
- Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice. - Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice.

View File

@ -41,7 +41,7 @@ $actiontest=GETPOST('test','alpha');
$actionsave=GETPOST('save','alpha'); $actionsave=GETPOST('save','alpha');
if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5; if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5;
$MAXAGENDA=empty($conf->global->AGENDA_EXT_NB)?5:$conf->global->AGENDA_EXT_NB; $MAXAGENDA=$conf->global->AGENDA_EXT_NB;
// List of aviable colors // List of aviable colors
$colorlist=array('BECEDD','DDBECE','BFDDBE','F598B4','F68654','CBF654','A4A4A5'); $colorlist=array('BECEDD','DDBECE','BFDDBE','F598B4','F68654','CBF654','A4A4A5');

View File

@ -1330,17 +1330,23 @@ class Categorie extends CommonObject
* Build thumb * Build thumb
* *
* @param string $file Chemin du fichier d'origine * @param string $file Chemin du fichier d'origine
* @param int $maxWidth Largeur maximum que dois faire la miniature (160 par defaut)
* @param int $maxHeight Hauteur maximum que dois faire la miniature (120 par defaut)
* @return void * @return void
*/ */
function add_thumb($file, $maxWidth = 160, $maxHeight = 120) function add_thumb($file)
{ {
require_once DOL_DOCUMENT_ROOT .'/core/lib/images.lib.php'; global $maxwidthsmall, $maxheightsmall, $maxwidthmini, $maxheightmini, $quality;
require_once DOL_DOCUMENT_ROOT .'/core/lib/images.lib.php'; // This define also $maxwidthsmall, $quality, ...
if (file_exists($file)) if (file_exists($file))
{ {
vignette($file,$maxWidth,$maxHeight); // Create small thumbs for company (Ratio is near 16/9)
// Used on logon for example
$imgThumbSmall = vignette($file, $maxwidthsmall, $maxheightsmall, '_small', $quality);
// Create mini thumbs for company (Ratio is near 16/9)
// Used on menu or for setup page for example
$imgThumbMini = vignette($file, $maxwidthmini, $maxheightmini, '_mini', $quality);
} }
} }

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Eric Seigne <erics@rycks.com> * Copyright (C) 2003 Eric Seigne <erics@rycks.com>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr> * Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
@ -39,6 +39,9 @@ if (! empty($conf->projet->enabled)) {
if (! isset($conf->global->AGENDA_MAX_EVENTS_DAY_VIEW)) $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW=3; if (! isset($conf->global->AGENDA_MAX_EVENTS_DAY_VIEW)) $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW=3;
if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5;
$MAXAGENDA=$conf->global->AGENDA_EXT_NB;
$filter=GETPOST("filter",'',3); $filter=GETPOST("filter",'',3);
$filtert = GETPOST("usertodo","int",3)?GETPOST("usertodo","int",3):GETPOST("filtert","int",3); $filtert = GETPOST("usertodo","int",3)?GETPOST("usertodo","int",3):GETPOST("filtert","int",3);
$usergroup = GETPOST("usergroup","int",3); $usergroup = GETPOST("usergroup","int",3);
@ -170,7 +173,7 @@ $listofextcals=array();
if (empty($conf->global->AGENDA_DISABLE_EXT)) if (empty($conf->global->AGENDA_DISABLE_EXT))
{ {
$i=0; $i=0;
while($i < $conf->global->AGENDA_EXT_NB) while($i < $MAXAGENDA)
{ {
$i++; $i++;
$source='AGENDA_EXT_SRC'.$i; $source='AGENDA_EXT_SRC'.$i;
@ -188,7 +191,7 @@ if (empty($conf->global->AGENDA_DISABLE_EXT))
if (empty($user->conf->AGENDA_DISABLE_EXT)) if (empty($user->conf->AGENDA_DISABLE_EXT))
{ {
$i=0; $i=0;
while($i < $conf->global->AGENDA_EXT_NB) while($i < $MAXAGENDA)
{ {
$i++; $i++;
$source='AGENDA_EXT_SRC_'.$user->id.'_'.$i; $source='AGENDA_EXT_SRC_'.$user->id.'_'.$i;
@ -360,17 +363,16 @@ if (! empty($conf->use_javascript_ajax))
{ {
foreach ($showextcals as $val) foreach ($showextcals as $val)
{ {
$htmlname = dol_string_nospecial($val['name']); $htmlname = md5($val['name']);
$htmlname = dol_string_nospecial($htmlname,'_',array("\.","#"));
$s.='<script type="text/javascript">' . "\n"; $s.='<script type="text/javascript">' . "\n";
$s.='jQuery(document).ready(function () {' . "\n"; $s.='jQuery(document).ready(function () {' . "\n";
$s.=' jQuery("#check_' . $htmlname . '").click(function() {'; $s.=' jQuery("#check_ext' . $htmlname . '").click(function() {';
$s.=' /* alert("'.$htmlname.'"); */'; $s.=' /* alert("'.$htmlname.'"); */';
$s.=' jQuery(".family_' . $htmlname . '").toggle();'; $s.=' jQuery(".family_ext' . $htmlname . '").toggle();';
$s.=' });' . "\n"; $s.=' });' . "\n";
$s.='});' . "\n"; $s.='});' . "\n";
$s.='</script>' . "\n"; $s.='</script>' . "\n";
$s.='<div class="nowrap float"><input type="checkbox" id="check_' . $htmlname . '" name="check_' . $htmlname . '" checked="true"> ' . $val ['name'] . ' &nbsp; </div>'; $s.='<div class="nowrap float"><input type="checkbox" id="check_ext' . $htmlname . '" name="check_ext' . $htmlname . '" checked="true"> ' . $val ['name'] . ' &nbsp; </div>';
} }
} }
$s.='<div class="nowrap float"><input type="checkbox" id="check_birthday" name="check_birthday"> '.$langs->trans("AgendaShowBirthdayEvents").' &nbsp; </div>'; $s.='<div class="nowrap float"><input type="checkbox" id="check_birthday" name="check_birthday"> '.$langs->trans("AgendaShowBirthdayEvents").' &nbsp; </div>';
@ -1171,7 +1173,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$numicals[dol_string_nospecial($event->icalname)]++; $numicals[dol_string_nospecial($event->icalname)]++;
} }
$color=$event->icalcolor; $color=$event->icalcolor;
$cssclass=(! empty($event->icalname)?'family_'.dol_string_nospecial($event->icalname):'family_other unmovable'); $cssclass=(! empty($event->icalname)?'family_ext'.md5($event->icalname):'family_other unmovable');
} }
else if ($event->type_code == 'BIRTHDAY') else if ($event->type_code == 'BIRTHDAY')
{ {

View File

@ -305,16 +305,16 @@ if ($conf->use_javascript_ajax)
{ {
foreach ($showextcals as $val) foreach ($showextcals as $val)
{ {
$htmlname = dol_string_nospecial($val['name']); $htmlname = md5($val['name']);
$s.='<script type="text/javascript">' . "\n"; $s.='<script type="text/javascript">' . "\n";
$s.='jQuery(document).ready(function () {' . "\n"; $s.='jQuery(document).ready(function () {' . "\n";
$s.=' jQuery("#check_' . $htmlname . '").click(function() {'; $s.=' jQuery("#check_ext' . $htmlname . '").click(function() {';
$s.=' /* alert("'.$htmlname.'"); */'; $s.=' /* alert("'.$htmlname.'"); */';
$s.=' jQuery(".family_' . $htmlname . '").toggle();'; $s.=' jQuery(".family_ext' . $htmlname . '").toggle();';
$s.=' });' . "\n"; $s.=' });' . "\n";
$s.='});' . "\n"; $s.='});' . "\n";
$s.='</script>' . "\n"; $s.='</script>' . "\n";
$s.='<div class="nowrap float"><input type="checkbox" id="check_' . $htmlname . '" name="check_' . $htmlname . '" checked="true"> ' . $val ['name'] . ' &nbsp; </div>'; $s.='<div class="nowrap float"><input type="checkbox" id="check_ext' . $htmlname . '" name="check_ext' . $htmlname . '" checked="true"> ' . $val ['name'] . ' &nbsp; </div>';
} }
} }
} }
@ -869,7 +869,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
} }
$color=$event->icalcolor; $color=$event->icalcolor;
$cssclass=(! empty($event->icalname)?'family_'.dol_string_nospecial($event->icalname):'family_other unsortable'); $cssclass=(! empty($event->icalname)?'family_ext'.md5($event->icalname):'family_other unsortable');
} }
else if ($event->type_code == 'BIRTHDAY') else if ($event->type_code == 'BIRTHDAY')
{ {

View File

@ -207,13 +207,13 @@ if (empty($reshook))
if ($datecommande == '') { if ($datecommande == '') {
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentities('Date')), 'errors'); setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentities('Date')), 'errors');
$action = 'create'; $action = 'create';
$error ++; $error++;
} }
if ($socid < 1) { if ($socid < 1) {
setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), 'errors'); setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), 'errors');
$action = 'create'; $action = 'create';
$error ++; $error++;
} }
if (! $error) { if (! $error) {
@ -334,7 +334,7 @@ if (empty($reshook))
$result = $object->addline($desc, $lines [$i]->subprice, $lines [$i]->qty, $lines [$i]->tva_tx, $lines [$i]->localtax1_tx, $lines [$i]->localtax2_tx, $lines [$i]->fk_product, $lines [$i]->remise_percent, $lines [$i]->info_bits, $lines [$i]->fk_remise_except, 'HT', 0, $date_start, $date_end, $product_type, $lines [$i]->rang, $lines [$i]->special_code, $fk_parent_line, $lines [$i]->fk_fournprice, $lines [$i]->pa_ht, $label, $array_option); $result = $object->addline($desc, $lines [$i]->subprice, $lines [$i]->qty, $lines [$i]->tva_tx, $lines [$i]->localtax1_tx, $lines [$i]->localtax2_tx, $lines [$i]->fk_product, $lines [$i]->remise_percent, $lines [$i]->info_bits, $lines [$i]->fk_remise_except, 'HT', 0, $date_start, $date_end, $product_type, $lines [$i]->rang, $lines [$i]->special_code, $fk_parent_line, $lines [$i]->fk_fournprice, $lines [$i]->pa_ht, $label, $array_option);
if ($result < 0) { if ($result < 0) {
$error ++; $error++;
break; break;
} }
@ -349,14 +349,14 @@ if (empty($reshook))
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been $reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been
// modified by hook // modified by hook
if ($reshook < 0) if ($reshook < 0)
$error ++; $error++;
} else { } else {
setEventMessage($srcobject->error, 'errors'); setEventMessage($srcobject->error, 'errors');
$error ++; $error++;
} }
} else { } else {
setEventMessage($object->error, 'errors'); setEventMessage($object->error, 'errors');
$error ++; $error++;
} }
} else { } else {
// Required extrafield left blank, error message already defined by setOptionalsFromPost() // Required extrafield left blank, error message already defined by setOptionalsFromPost()
@ -390,7 +390,7 @@ if (empty($reshook))
$result = $object->add_contact(GETPOST('contactid'), 'CUSTOMER', 'external'); $result = $object->add_contact(GETPOST('contactid'), 'CUSTOMER', 'external');
if ($result < 0) { if ($result < 0) {
setEventMessage($langs->trans("ErrorFailedToAddContact"), 'errors'); setEventMessage($langs->trans("ErrorFailedToAddContact"), 'errors');
$error ++; $error++;
} }
} }
@ -554,24 +554,24 @@ if (empty($reshook))
if (empty($idprod) && ($price_ht < 0) && ($qty < 0)) { if (empty($idprod) && ($price_ht < 0) && ($qty < 0)) {
setEventMessage($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), 'errors'); setEventMessage($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), 'errors');
$error ++; $error++;
} }
if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && GETPOST('type') < 0) { if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && GETPOST('type') < 0) {
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), 'errors'); setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), 'errors');
$error ++; $error++;
} }
if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && (! ($price_ht >= 0) || $price_ht == '')) // Unit price can be 0 but not '' if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && (! ($price_ht >= 0) || $price_ht == '')) // Unit price can be 0 but not ''
{ {
setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), 'errors'); setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), 'errors');
$error ++; $error++;
} }
if ($qty == '') { if ($qty == '') {
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), 'errors'); setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), 'errors');
$error ++; $error++;
} }
if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && empty($product_desc)) { if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && empty($product_desc)) {
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), 'errors'); setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), 'errors');
$error ++; $error++;
} }
if (! $error && ($qty >= 0) && (! empty($product_desc) || ! empty($idprod))) { if (! $error && ($qty >= 0) && (! empty($product_desc) || ! empty($idprod))) {
@ -826,7 +826,7 @@ if (empty($reshook))
if ($price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min))) { if ($price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min))) {
setEventMessage($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), 'errors'); setEventMessage($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), 'errors');
$error ++; $error++;
} }
} else { } else {
$type = GETPOST('type'); $type = GETPOST('type');
@ -835,7 +835,7 @@ if (empty($reshook))
// Check parameters // Check parameters
if (GETPOST('type') < 0) { if (GETPOST('type') < 0) {
setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), 'errors'); setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), 'errors');
$error ++; $error++;
} }
} }
@ -1137,10 +1137,10 @@ if (empty($reshook))
if (empty($reshook)) { if (empty($reshook)) {
$result = $object->insertExtraFields(); $result = $object->insertExtraFields();
if ($result < 0) { if ($result < 0) {
$error ++; $error++;
} }
} else if ($reshook < 0) } else if ($reshook < 0)
$error ++; $error++;
} }
if ($error) if ($error)

View File

@ -1300,7 +1300,7 @@ class BonPrelevement extends CommonObject
while ($i < $num) while ($i < $num)
{ {
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
$fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $ListOfFactures , $obj->idfac, $obj->iban, $obj->bic, $obj->datec, $obj->drum); $fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $ListOfFactures, $obj->idfac, $obj->iban, $obj->bic, $obj->datec, $obj->drum);
$this->total = $this->total + $obj->somme; $this->total = $this->total + $obj->somme;
$i++; $i++;
} }

View File

@ -1098,7 +1098,7 @@ else
$ref = substr($object->ref, 1, 4); $ref = substr($object->ref, 1, 4);
if ($ref == 'PROV' && !empty($modCodeContract->code_auto)) if ($ref == 'PROV' && !empty($modCodeContract->code_auto))
{ {
$numref = $object->getNextNumRef($soc); $numref = $object->getNextNumRef($object->thirdparty);
} }
else else
{ {

View File

@ -3759,8 +3759,8 @@ function dol_nl2br($stringtoencode,$nl2brmode=0,$forxml=false)
/** /**
* This function is called to encode a string into a HTML string but differs from htmlentities because * This function is called to encode a string into a HTML string but differs from htmlentities because
* all entities but &,<,> are converted. This permits to encode special chars to entities with no double * a detection is done before to see if text is already HTML or not. Also, all entities but &,<,> are converted.
* encoding for already encoded HTML strings. * This permits to encode special chars to entities with no double encoding for already encoded HTML strings.
* This function also remove last EOL or BR if $removelasteolbr=1 (default). * This function also remove last EOL or BR if $removelasteolbr=1 (default).
* For PDF usage, you can show text by 2 ways: * For PDF usage, you can show text by 2 ways:
* - writeHTMLCell -> param must be encoded into HTML. * - writeHTMLCell -> param must be encoded into HTML.
@ -3777,7 +3777,7 @@ function dol_nl2br($stringtoencode,$nl2brmode=0,$forxml=false)
function dol_htmlentitiesbr($stringtoencode,$nl2brmode=0,$pagecodefrom='UTF-8',$removelasteolbr=1) function dol_htmlentitiesbr($stringtoencode,$nl2brmode=0,$pagecodefrom='UTF-8',$removelasteolbr=1)
{ {
$newstring=$stringtoencode; $newstring=$stringtoencode;
if (dol_textishtml($stringtoencode)) if (dol_textishtml($stringtoencode)) // Check if text is already HTML or not
{ {
$newstring=preg_replace('/<br(\s[\sa-zA-Z_="]*)?\/?>/i','<br>',$newstring); // Replace "<br type="_moz" />" by "<br>". It's same and avoid pb with FPDF. $newstring=preg_replace('/<br(\s[\sa-zA-Z_="]*)?\/?>/i','<br>',$newstring); // Replace "<br type="_moz" />" by "<br>". It's same and avoid pb with FPDF.
if ($removelasteolbr) $newstring=preg_replace('/<br>$/i','',$newstring); // Remove last <br> (remove only last one) if ($removelasteolbr) $newstring=preg_replace('/<br>$/i','',$newstring); // Remove last <br> (remove only last one)

View File

@ -121,7 +121,7 @@ class mod_commande_saphir extends ModeleNumRefCommandes
return 0; return 0;
} }
$numFinal=get_next_value($db,$mask,'commande','ref','',$objsoc->code_client,$object->date); $numFinal=get_next_value($db,$mask,'commande','ref','',$objsoc,$object->date);
return $numFinal; return $numFinal;
} }

View File

@ -112,7 +112,7 @@ class mod_contract_magre extends ModelNumRefContracts
return 0; return 0;
} }
$numFinal=get_next_value($db,$mask,'contrat','ref','',$objsoc->code_client,$contract->date_contrat); $numFinal=get_next_value($db,$mask,'contrat','ref','',$objsoc,$contract->date_contrat);
return $numFinal; return $numFinal;
} }

View File

@ -120,7 +120,7 @@ class mod_arctic extends ModeleNumRefFicheinter
return 0; return 0;
} }
$numFinal=get_next_value($db,$mask,'fichinter','ref','',$objsoc->code_client,$object->datec); $numFinal=get_next_value($db,$mask,'fichinter','ref','',$objsoc,$object->datec);
return $numFinal; return $numFinal;
} }

View File

@ -120,7 +120,7 @@ class mod_livraison_saphir extends ModeleNumRefDeliveryOrder
return 0; return 0;
} }
$numFinal=get_next_value($db,$mask,'livraison','ref','',$objsoc->code_client,$object->date_livraison); $numFinal=get_next_value($db,$mask,'livraison','ref','',$objsoc,$object->date_livraison);
return $numFinal; return $numFinal;
} }

View File

@ -123,7 +123,7 @@ class mod_propale_saphir extends ModeleNumRefPropales
$date=$propal->datep; $date=$propal->datep;
$customercode=$objsoc->code_client; $customercode=$objsoc->code_client;
$numFinal=get_next_value($db,$mask,'propal','ref','',$customercode,$date); $numFinal=get_next_value($db,$mask,'propal','ref','',$objsoc,$date);
return $numFinal; return $numFinal;
} }

View File

@ -126,7 +126,7 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices
} }
//Supplier invoices take invoice date instead of creation date for the mask //Supplier invoices take invoice date instead of creation date for the mask
$numFinal=get_next_value($db,$mask,'facture_fourn','ref','',$objsoc->code_fournisseur,$object->date); $numFinal=get_next_value($db,$mask,'facture_fourn','ref','',$objsoc,$object->date);
return $numFinal; return $numFinal;
} }

View File

@ -121,7 +121,7 @@ class mod_commande_fournisseur_orchidee extends ModeleNumRefSuppliersOrders
return 0; return 0;
} }
$numFinal=get_next_value($db,$mask,'commande_fournisseur','ref','',$objsoc->code_fournisseur,$object->date_commande); $numFinal=get_next_value($db,$mask,'commande_fournisseur','ref','',$objsoc,$object->date_commande);
return $numFinal; return $numFinal;
} }

View File

@ -153,12 +153,12 @@ else {
if (empty($senderissupplier)) if (empty($senderissupplier))
{ {
$form->select_produits('', 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(),$buyer->id); $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(),$buyer->id);
} }
else else
{ {
$ajaxoptions=array( $ajaxoptions=array(
'update' => array('qty'=>'qty','remise_percent' => 'discount'), // html id tag will be edited with which ajax json response key 'update' => array('qty'=>'qty','remise_percent' => 'discount'), // html id tags that will be edited with which ajax json response key
'option_disabled' => 'addPredefinedProductButton', // html id to disable once select is done 'option_disabled' => 'addPredefinedProductButton', // html id to disable once select is done
'warning' => $langs->trans("NoPriceDefinedForThisSupplier") // translation of an error saved into var 'error' 'warning' => $langs->trans("NoPriceDefinedForThisSupplier") // translation of an error saved into var 'error'
); );
@ -192,23 +192,16 @@ else {
</td> </td>
<td align="right"><?php <td align="right"><?php
if (GETPOST('prod_entry_mode') != 'predef') if ($seller->tva_assuj == "0") echo '<input type="hidden" name="tva_tx" id="tva_tx" value="0">0';
{ else echo $form->load_tva('tva_tx', (isset($_POST["tva_tx"])?$_POST["tva_tx"]:-1), $seller, $buyer);
if ($seller->tva_assuj == "0") echo '<input type="hidden" name="tva_tx" id="tva_tx" value="0">0';
else echo $form->load_tva('tva_tx', (isset($_POST["tva_tx"])?$_POST["tva_tx"]:-1), $seller, $buyer);
}
?> ?>
</td> </td>
<td align="right"> <td align="right">
<?php if (GETPOST('prod_entry_mode') != 'predef') { ?>
<input type="text" size="5" name="price_ht" id="price_ht" class="flat" value="<?php echo (isset($_POST["price_ht"])?$_POST["price_ht"]:''); ?>"> <input type="text" size="5" name="price_ht" id="price_ht" class="flat" value="<?php echo (isset($_POST["price_ht"])?$_POST["price_ht"]:''); ?>">
<?php } ?>
</td> </td>
<?php if (! empty($inputalsopricewithtax)) { ?> <?php if (! empty($inputalsopricewithtax)) { ?>
<td align="right"> <td align="right">
<?php if (GETPOST('prod_entry_mode') != 'predef') { ?>
<input type="text" size="5" name="price_ttc" id="price_ttc" class="flat" value="<?php echo (isset($_POST["price_ttc"])?$_POST["price_ttc"]:''); ?>"> <input type="text" size="5" name="price_ttc" id="price_ttc" class="flat" value="<?php echo (isset($_POST["price_ttc"])?$_POST["price_ttc"]:''); ?>">
<?php } ?>
</td> </td>
<?php } ?> <?php } ?>
<td align="right"><input type="text" size="2" name="qty" id="qty" class="flat" value="<?php echo (isset($_POST["qty"])?$_POST["qty"]:1); ?>"> <td align="right"><input type="text" size="2" name="qty" id="qty" class="flat" value="<?php echo (isset($_POST["qty"])?$_POST["qty"]:1); ?>">
@ -273,7 +266,7 @@ else {
</tr> </tr>
<?php <?php
if (! empty($conf->service->enabled) && $dateSelector && GETPOST('type') != '0') if ((! empty($conf->service->enabled) || ($object->element == 'contrat')) && $dateSelector && GETPOST('type') != '0') // We show date field if required
{ {
if(! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) $colspan = 10; if(! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) $colspan = 10;
else $colspan = 9; else $colspan = 9;
@ -493,6 +486,11 @@ jQuery(document).ready(function() {
if (jQuery('#idprod').val() > 0) jQuery('#dp_desc').focus(); if (jQuery('#idprod').val() > 0) jQuery('#dp_desc').focus();
if (jQuery('#idprodfournprice').val() > 0) jQuery('#dp_desc').focus(); if (jQuery('#idprodfournprice').val() > 0) jQuery('#dp_desc').focus();
}); });
<?php if (GETPOST('prod_entry_mode') == 'predef') { // When we submit with a predef product and it fails we must start with predef ?>
setforpredef();
<?php } ?>
}); });
/* Function to set fields from choice */ /* Function to set fields from choice */

View File

@ -251,7 +251,7 @@ if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
$idprod=0; $idprod=0;
$productsupplier = new ProductFournisseur($db); $productsupplier = new ProductFournisseur($db);
if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-2; // Same behaviour than with combolist. When not select idprodfournprice is now -2 (to avoid conflict with next action that may return -1) if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-99; // Same behaviour than with combolist. When not select idprodfournprice is now -99 (to avoid conflict with next action that may return -1, -2, ...)
if (GETPOST('idprodfournprice') > 0) if (GETPOST('idprodfournprice') > 0)
{ {
@ -294,12 +294,12 @@ if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
$date_end $date_end
); );
} }
if ($idprod == -2 || $idprod == 0) if ($idprod == 0 || $idprod == -99)
{ {
// Product not selected // Product not selected
$error++; $error++;
$langs->load("errors"); $langs->load("errors");
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("ProductOrService")), 'errors'); setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("ProductOrService")).' '.$langs->trans("or").' '.$langs->trans("NoPriceDefinedForThisSupplier"), 'errors');
} }
if ($idprod == -1) if ($idprod == -1)
{ {

View File

@ -32,9 +32,9 @@
*/ */
require '../../main.inc.php'; require '../../main.inc.php';
require DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
require DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
require DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
$langs->load('companies'); $langs->load('companies');
$langs->load('bills'); $langs->load('bills');

View File

@ -1095,8 +1095,8 @@ ALTER TABLE llx_projet_task_time ADD INDEX idx_projet_task_time_task (fk_task);
ALTER TABLE llx_projet_task_time ADD INDEX idx_projet_task_time_date (task_date); ALTER TABLE llx_projet_task_time ADD INDEX idx_projet_task_time_date (task_date);
ALTER TABLE llx_projet_task_time ADD INDEX idx_projet_task_time_datehour (task_datehour); ALTER TABLE llx_projet_task_time ADD INDEX idx_projet_task_time_datehour (task_datehour);
ALTER TABLE llx_projet_task CHANGE COLUMN duration_effective real DEFAULT 0 NULL; ALTER TABLE llx_projet_task MODIFY COLUMN duration_effective real DEFAULT 0 NULL;
ALTER TABLE llx_projet_task CHANGE COLUMN planned_workload real DEFAULT 0 NULL; ALTER TABLE llx_projet_task MODIFY COLUMN planned_workload real DEFAULT 0 NULL;
-- add extrafield on ficheinter lines -- add extrafield on ficheinter lines

View File

@ -1229,14 +1229,14 @@ class Product extends CommonObject
} }
else else
{ {
$this->error=$this->db->error(); $this->error=$this->db->lasterror();
return -3; return -3;
} }
} }
} }
else else
{ {
$this->error=$this->db->error(); $this->error=$this->db->lasterror();
return -2; return -2;
} }
} }
@ -3100,11 +3100,9 @@ class Product extends CommonObject
* *
* @param string $sdir Target directory * @param string $sdir Target directory
* @param string $file Array of file info of file to upload: array('name'=>..., 'tmp_name'=>...) * @param string $file Array of file info of file to upload: array('name'=>..., 'tmp_name'=>...)
* @param int $maxWidth Largeur maximum que dois faire la miniature (160 by defaut)
* @param int $maxHeight Hauteur maximum que dois faire la miniature (120 by defaut)
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function add_photo($sdir, $file, $maxWidth = 160, $maxHeight = 120) function add_photo($sdir, $file)
{ {
global $conf; global $conf;
@ -3114,10 +3112,12 @@ class Product extends CommonObject
$dir = $sdir; $dir = $sdir;
if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) $dir .= '/'. get_exdir($this->id,2) . $this->id ."/photos"; if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) $dir .= '/'. get_exdir($this->id,2) . $this->id ."/photos";
else $dir .= '/'.dol_sanitizeFileName($this->ref);
dol_mkdir($dir); dol_mkdir($dir);
$dir_osencoded=$dir; $dir_osencoded=$dir;
if (is_dir($dir_osencoded)) if (is_dir($dir_osencoded))
{ {
$originImage = $dir . '/' . $file['name']; $originImage = $dir . '/' . $file['name'];
@ -3128,7 +3128,7 @@ class Product extends CommonObject
if (file_exists(dol_osencode($originImage))) if (file_exists(dol_osencode($originImage)))
{ {
// Cree fichier en taille vignette // Cree fichier en taille vignette
$this->add_thumb($originImage,$maxWidth,$maxHeight); $this->add_thumb($originImage);
} }
} }
@ -3140,18 +3140,24 @@ class Product extends CommonObject
* Build thumb * Build thumb
* *
* @param string $file Chemin du fichier d'origine * @param string $file Chemin du fichier d'origine
* @param int $maxWidth Largeur maximum que dois faire la miniature (160 par defaut)
* @param int $maxHeight Hauteur maximum que dois faire la miniature (120 par defaut)
* @return void * @return void
*/ */
function add_thumb($file, $maxWidth = 160, $maxHeight = 120) function add_thumb($file)
{ {
require_once DOL_DOCUMENT_ROOT .'/core/lib/images.lib.php'; global $maxwidthsmall, $maxheightsmall, $maxwidthmini, $maxheightmini, $quality;
require_once DOL_DOCUMENT_ROOT .'/core/lib/images.lib.php'; // This define also $maxwidthsmall, $quality, ...
$file_osencoded=dol_osencode($file); $file_osencoded=dol_osencode($file);
if (file_exists($file_osencoded)) if (file_exists($file_osencoded))
{ {
vignette($file,$maxWidth,$maxHeight); // Create small thumbs for company (Ratio is near 16/9)
// Used on logon for example
$imgThumbSmall = vignette($file, $maxwidthsmall, $maxheightsmall, '_small', $quality);
// Create mini thumbs for company (Ratio is near 16/9)
// Used on menu or for setup page for example
$imgThumbMini = vignette($file, $maxwidthmini, $maxheightmini, '_mini', $quality);
} }
} }

View File

@ -37,7 +37,7 @@ function dolDispatchToDo($order_id)
$dispatched = array(); $dispatched = array();
$ordered = array(); $ordered = array();
# Count nb of quantity dispatched per product // Count nb of quantity dispatched per product
$sql = 'SELECT fk_product, SUM(qty) FROM ' . MAIN_DB_PREFIX . 'commande_fournisseur_dispatch'; $sql = 'SELECT fk_product, SUM(qty) FROM ' . MAIN_DB_PREFIX . 'commande_fournisseur_dispatch';
$sql.= ' WHERE fk_commande = ' . $order_id; $sql.= ' WHERE fk_commande = ' . $order_id;
$sql.= ' GROUP BY fk_product'; $sql.= ' GROUP BY fk_product';
@ -49,7 +49,7 @@ function dolDispatchToDo($order_id)
$dispatched[$obj->fk_product] = $obj; $dispatched[$obj->fk_product] = $obj;
} }
# Count nb of quantity to dispatch per product // Count nb of quantity to dispatch per product
$sql = 'SELECT fk_product, SUM(qty) FROM ' . MAIN_DB_PREFIX . 'commande_fournisseurdet'; $sql = 'SELECT fk_product, SUM(qty) FROM ' . MAIN_DB_PREFIX . 'commande_fournisseurdet';
$sql.= ' WHERE fk_commande = ' . $order_id; $sql.= ' WHERE fk_commande = ' . $order_id;
$sql.= ' AND fk_product > 0'; $sql.= ' AND fk_product > 0';

View File

@ -807,7 +807,7 @@ class Task extends CommonObject
if ($ret >= 0) if ($ret >= 0)
{ {
$sql = "UPDATE ".MAIN_DB_PREFIX."projet_task"; $sql = "UPDATE ".MAIN_DB_PREFIX."projet_task";
$sql.= " SET duration_effective = duration_effective + '".price2num($this->timespent_duration)."'"; $sql.= " SET duration_effective = (SELECT SUM(task_duration) FROM ".MAIN_DB_PREFIX."projet_task_time as ptt where ptt.fk_task = ".$this->id.")";
if (isset($this->progress)) $sql.= ", progress = " . $this->progress; // Do not overwrite value if not provided if (isset($this->progress)) $sql.= ", progress = " . $this->progress; // Do not overwrite value if not provided
$sql.= " WHERE rowid = ".$this->id; $sql.= " WHERE rowid = ".$this->id;
@ -980,7 +980,7 @@ class Task extends CommonObject
$newDuration = $this->timespent_duration - $this->timespent_old_duration; $newDuration = $this->timespent_duration - $this->timespent_old_duration;
$sql = "UPDATE ".MAIN_DB_PREFIX."projet_task"; $sql = "UPDATE ".MAIN_DB_PREFIX."projet_task";
$sql.= " SET duration_effective = duration_effective + '".$newDuration."'"; $sql.= " SET duration_effective = (SELECT SUM(task_duration) FROM ".MAIN_DB_PREFIX."projet_task_time as ptt where ptt.fk_task = ".$this->id.")";
$sql.= " WHERE rowid = ".$this->id; $sql.= " WHERE rowid = ".$this->id;
dol_syslog(get_class($this)."::updateTimeSpent", LOG_DEBUG); dol_syslog(get_class($this)."::updateTimeSpent", LOG_DEBUG);

View File

@ -22,6 +22,10 @@
* http://127.0.0.1/dolibarr/public/agenda/agendaexport.php?format=vcal&exportkey=cle * http://127.0.0.1/dolibarr/public/agenda/agendaexport.php?format=vcal&exportkey=cle
* http://127.0.0.1/dolibarr/public/agenda/agendaexport.php?format=ical&type=event&exportkey=cle * http://127.0.0.1/dolibarr/public/agenda/agendaexport.php?format=ical&type=event&exportkey=cle
* http://127.0.0.1/dolibarr/public/agenda/agendaexport.php?format=rss&exportkey=cle * http://127.0.0.1/dolibarr/public/agenda/agendaexport.php?format=rss&exportkey=cle
* Other parameters into url are:
* &notolderthan=99
* &year=2015
* &id=..., &idfrom=..., &idto=...
*/ */
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); //if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1');
@ -55,23 +59,26 @@ require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
// Security check // Security check
if (empty($conf->agenda->enabled)) accessforbidden('',1,1,1); if (empty($conf->agenda->enabled)) accessforbidden('',1,1,1);
// Not older than
if (! isset($conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY)) $conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY=100; // default limit
// Define format, type and filter // Define format, type and filter
$format='ical'; $format='ical';
$type='event'; $type='event';
if (! empty($_GET["format"])) $format=$_GET["format"]; if (! empty($_GET["format"])) $format=$_GET["format"];
if (! empty($_GET["type"])) $type=$_GET["type"]; if (! empty($_GET["type"])) $type=$_GET["type"];
$filters=array(); $filters=array();
if (! empty($_GET["year"])) $filters['year']=$_GET["year"]; if (! empty($_GET["year"])) $filters['year']=$_GET["year"];
if (! empty($_GET["id"])) $filters['id']=$_GET["id"]; if (! empty($_GET["id"])) $filters['id']=$_GET["id"];
if (! empty($_GET["idfrom"])) $filters['idfrom']=$_GET["idfrom"]; if (! empty($_GET["idfrom"])) $filters['idfrom']=$_GET["idfrom"];
if (! empty($_GET["idto"])) $filters['idto']=$_GET["idto"]; if (! empty($_GET["idto"])) $filters['idto']=$_GET["idto"];
if (! empty($_GET["project"])) $filters['project']=$_GET["project"]; if (! empty($_GET["project"])) $filters['project']=$_GET["project"];
if (! empty($_GET["login"])) $filters['login']=$_GET["login"]; if (! empty($_GET["login"])) $filters['login']=$_GET["login"];
if (! empty($_GET["logina"])) $filters['logina']=$_GET["logina"]; if (! empty($_GET["logina"])) $filters['logina']=$_GET["logina"];
if (! empty($_GET["logint"])) $filters['logint']=$_GET["logint"]; if (! empty($_GET["logint"])) $filters['logint']=$_GET["logint"];
// Not older than if (GETPOST("notolderthan")) $filters['notolderthan']=GETPOST("notolderthan","int");
if (! isset($conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY)) $conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY=100; else $filters['notolderthan']=$conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY;
$filters['notolderthan']=$conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY;
// Check config // Check config
if (empty($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY)) if (empty($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY))

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2002-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2003 Brian Fraval <brian@fraval.org> * Copyright (C) 2003 Brian Fraval <brian@fraval.org>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
@ -42,7 +42,7 @@ class Societe extends CommonObject
public $element='societe'; public $element='societe';
public $table_element = 'societe'; public $table_element = 'societe';
public $fk_element='fk_soc'; public $fk_element='fk_soc';
protected $childtables=array("propal","commande","facture","contrat","facture_fourn","commande_fournisseur"); // To test if we can delete object protected $childtables=array("propal","commande","facture","contrat","facture_fourn","commande_fournisseur","projet"); // To test if we can delete object
/** /**
* 0=No test on entity, 1=Test with field entity, 2=Test with link by societe * 0=No test on entity, 1=Test with field entity, 2=Test with link by societe

View File

@ -8,7 +8,7 @@
* Copyright (C) 2011 Herve Prot <herve.prot@symeos.com> * Copyright (C) 2011 Herve Prot <herve.prot@symeos.com>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -985,6 +985,15 @@ if (($action == 'create') || ($action == 'adduserldap'))
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";
// Accountancy code
if ($conf->salaries->enabled)
{
print '<tr><td valign="top">'.$langs->trans("AccountancyCode").'</td>';
print '<td>';
print '<input size="30" type="text" name="accountancy_code" value="'.GETPOST('accountancy_code').'">';
print '</td></tr>';
}
// User color // User color
if (! empty($conf->agenda->enabled)) if (! empty($conf->agenda->enabled))
{ {
@ -1127,7 +1136,7 @@ else
*/ */
if ($action != 'edit') if ($action != 'edit')
{ {
$rowspan=17; $rowspan=19;
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
@ -1323,11 +1332,10 @@ else
print "</tr>\n"; print "</tr>\n";
// Accountancy code // Accountancy code
if (! empty($conf->global->USER_ENABLE_ACCOUNTANCY_CODE)) // For the moment field is not used so must not appeared. if ($conf->salaries->enabled)
{ {
$rowspan++; print '<tr><td valign="top">'.$langs->trans("AccountancyCode").'</td>';
print '<tr><td valign="top">'.$langs->trans("AccountancyCode").'</td>'; print '<td colspan="2">'.$object->accountancy_code.'</td>';
print '<td colspan="2">'.$object->accountancy_code.'</td>';
} }
// Color user // Color user
@ -1658,7 +1666,7 @@ else
*/ */
if ($action == 'edit' && ($canedituser || $caneditfield || $caneditpassword || ($user->id == $object->id))) if ($action == 'edit' && ($canedituser || $caneditfield || $caneditpassword || ($user->id == $object->id)))
{ {
$rowspan=15; $rowspan=16;
if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file->main_authentication) && ! empty($conf->global->MAIN_OPENIDURL_PERUSER)) $rowspan++; if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file->main_authentication) && ! empty($conf->global->MAIN_OPENIDURL_PERUSER)) $rowspan++;
if (! empty($conf->societe->enabled)) $rowspan++; if (! empty($conf->societe->enabled)) $rowspan++;
if (! empty($conf->adherent->enabled)) $rowspan++; if (! empty($conf->adherent->enabled)) $rowspan++;
@ -2025,23 +2033,23 @@ else
print "</tr>\n"; print "</tr>\n";
// Accountancy code // Accountancy code
if (! empty($conf->global->USER_ENABLE_ACCOUNTANCY_CODE)) // For the moment field is not used so must not appeared. if ($conf->salaries->enabled)
{ {
print "<tr>"; print "<tr>";
print '<td valign="top">'.$langs->trans("AccountancyCode").'</td>'; print '<td valign="top">'.$langs->trans("AccountancyCode").'</td>';
print '<td>'; print '<td>';
if ($caneditfield) if ($caneditfield)
{ {
print '<input size="30" type="text" class="flat" name="accountancy_code" value="'.$object->accountancy_code.'">'; print '<input size="30" type="text" class="flat" name="accountancy_code" value="'.$object->accountancy_code.'">';
} }
else else
{ {
print '<input type="hidden" name="accountancy_code" value="'.$object->accountancy_code.'">'; print '<input type="hidden" name="accountancy_code" value="'.$object->accountancy_code.'">';
print $object->accountancy_code; print $object->accountancy_code;
} }
print '</td>'; print '</td>';
print "</tr>"; print "</tr>";
} }
// User color // User color
if (! empty($conf->agenda->enabled)) if (! empty($conf->agenda->enabled))