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

Conflicts:
	ChangeLog
	dev/initdata/mysqldump_dolibarr_3.5.0.sql
	htdocs/commande/fiche.php
	htdocs/compta/facture.php
	htdocs/product/index.php
	htdocs/user/fiche.php
This commit is contained in:
Laurent Destailleur 2014-04-12 00:53:25 +02:00
commit 1b02cdd352
25 changed files with 331 additions and 168 deletions

View File

@ -124,7 +124,6 @@ Fix: Error on ajax_constantonoff function.
Fix: [ bug #1323 ] problème pour générer un odt depuis les taches dans projet. Fix: [ bug #1323 ] problème pour générer un odt depuis les taches dans projet.
Fix: Can not make withdrawals Fix: Can not make withdrawals
***** ChangeLog for 3.5.1 compared to 3.5.0 ***** ***** ChangeLog for 3.5.1 compared to 3.5.0 *****
Fix: Do not report trigger errors twice. Fix: Do not report trigger errors twice.
Fix: Error when creating event was not reported. Fix: Error when creating event was not reported.
@ -162,10 +161,11 @@ Fix: [ bug #520 ] Product statistics and detailed lists are wrong.
Fix: [ bug #1240 ] traduction. Fix: [ bug #1240 ] traduction.
Fix: [ bug #1238 ] When creating accompte with a %, free product are used for calculation. Fix: [ bug #1238 ] When creating accompte with a %, free product are used for calculation.
Fix: [ bug #1280 ] service with not end of date was tagged as expired. Fix: [ bug #1280 ] service with not end of date was tagged as expired.
Fix: [ bug #1295 ] Error when creating an agenda extrafield with a number as reference Fix: [ bug #1295 ] Error when creating an agenda extrafield with a number as reference.
Fix: [ bug #1306 ] Fatal error when adding an external calendar Fix: [ bug #1306 ] Fatal error when adding an external calendar.
New: Added es_CL language New: Added es_CL language
Fix: Margin tabs bad data show Fix: Margin tabs bad data show
Fix: [ bug #1318 ] Problem with enter key when adding an existing product to a customer invoice.
***** ChangeLog for 3.5 compared to 3.4.* ***** ***** ChangeLog for 3.5 compared to 3.4.* *****
For users: For users:

View File

@ -37,7 +37,7 @@ $force_install_lockinstall='444';
//$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; //$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
//$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; //$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip';
//$force_dolibarr_lib_PHPEXCEL_PATH=''; //$force_dolibarr_lib_PHPEXCEL_PATH='';
//$force_dolibarr_js_CKEDITOR='/javascript/ckeditor'; //$force_dolibarr_js_CKEDITOR='/javascript/ckeditor'; // Use '/javascript/ckeditor' or 'disabled'
//$force_dolibarr_js_JQUERY='/javascript/jquery'; //$force_dolibarr_js_JQUERY='/javascript/jquery';
//$force_dolibarr_js_JQUERY_UI='/javascript/jquery-ui'; //$force_dolibarr_js_JQUERY_UI='/javascript/jquery-ui';
//$force_dolibarr_js_JQUERY_FLOT='/javascript/flot'; //$force_dolibarr_js_JQUERY_FLOT='/javascript/flot';

File diff suppressed because one or more lines are too long

View File

@ -171,6 +171,7 @@ export list="
--ignore-table=$base.llx_abonne_extrafields --ignore-table=$base.llx_abonne_extrafields
--ignore-table=$base.llx_abonne_type --ignore-table=$base.llx_abonne_type
--ignore-table=$base.llx_abonnement --ignore-table=$base.llx_abonnement
--ignore-table=$base.llx_bootstrap
--ignore-table=$base.llx_bt_namemap --ignore-table=$base.llx_bt_namemap
--ignore-table=$base.llx_bt_speedlimit --ignore-table=$base.llx_bt_speedlimit
--ignore-table=$base.llx_bt_summary --ignore-table=$base.llx_bt_summary

View File

@ -183,7 +183,7 @@ if ($resql)
if ($type > 0) if ($type > 0)
{ {
$membertype=new AdherentType($db); $membertype=new AdherentType($db);
$result=$membertype->fetch($_REQUEST["type"]); $result=$membertype->fetch(GETPOST("type"));
$titre.=" (".$membertype->libelle.")"; $titre.=" (".$membertype->libelle.")";
} }
@ -193,6 +193,7 @@ if ($resql)
if ($search_login) $param.="&search_login=".$search_login; if ($search_login) $param.="&search_login=".$search_login;
if ($search_email) $param.="&search_email=".$search_email; if ($search_email) $param.="&search_email=".$search_email;
if ($filter) $param.="&filter=".$filter; if ($filter) $param.="&filter=".$filter;
if ($type > 0) $param.="&type=".$type;
print_barre_liste($titre,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); print_barre_liste($titre,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords);
if ($sall) if ($sall)

View File

@ -544,8 +544,8 @@ else if ($action == 'addline' && $user->rights->commande->creer) {
if (! $error && ($qty >= 0) && (! empty($product_desc) || ! empty($idprod))) { if (! $error && ($qty >= 0) && (! empty($product_desc) || ! empty($idprod))) {
// Clean parameters // Clean parameters
$date_start = dol_mktime(0, 0, 0, GETPOST('date_start' . $predef . 'month'), GETPOST('date_start' . $predef . 'day'), GETPOST('date_start' . $predef . 'year')); $date_start=dol_mktime(GETPOST('date_start'.$predef.'hour'), GETPOST('date_start'.$predef.'min'), 0, GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year'));
$date_end = dol_mktime(0, 0, 0, GETPOST('date_end' . $predef . 'month'), GETPOST('date_end' . $predef . 'day'), GETPOST('date_end' . $predef . 'year')); $date_end=dol_mktime(GETPOST('date_start'.$predef.'hour'), GETPOST('date_start'.$predef.'min'), 0, GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year'));
$price_base_type = (GETPOST('price_base_type', 'alpha')?GETPOST('price_base_type', 'alpha'):'HT'); $price_base_type = (GETPOST('price_base_type', 'alpha')?GETPOST('price_base_type', 'alpha'):'HT');
// Ecrase $pu par celui du produit // Ecrase $pu par celui du produit
@ -737,8 +737,8 @@ else if ($action == 'updateligne' && $user->rights->commande->creer && GETPOST('
// Clean parameters // Clean parameters
$date_start=''; $date_start='';
$date_end=''; $date_end='';
$date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear')); $date_start=dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), 0, GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear'));
$date_end = dol_mktime(0, 0, 0, GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); $date_end=dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), 0, GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear'));
$description=dol_htmlcleanlastbr(GETPOST('product_desc')); $description=dol_htmlcleanlastbr(GETPOST('product_desc'));
$pu_ht=GETPOST('price_ht'); $pu_ht=GETPOST('price_ht');
$vat_rate=(GETPOST('tva_tx')?GETPOST('tva_tx'):0); $vat_rate=(GETPOST('tva_tx')?GETPOST('tva_tx'):0);
@ -1648,7 +1648,7 @@ if ($action == 'create' && $user->rights->commande->creer) {
// => 1), // => 1),
// array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"),
// 'value' => 1), // 'value' => 1),
array('type' => 'other','name' => 'idwarehouse','label' => $langs->trans("SelectWarehouseForStockDecrease"),'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse'), 'idwarehouse', '', 1))); array('type' => 'other','name' => 'idwarehouse','label' => $langs->trans("SelectWarehouseForStockDecrease"),'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1)));
} }
$formconfirm = $form->formconfirm($_SERVER ["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ValidateOrder'), $text, 'confirm_validate', $formquestion, 0, 1, 220); $formconfirm = $form->formconfirm($_SERVER ["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ValidateOrder'), $text, 'confirm_validate', $formquestion, 0, 1, 220);
@ -1668,7 +1668,7 @@ if ($action == 'create' && $user->rights->commande->creer) {
// => 1), // => 1),
// array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"),
// 'value' => 1), // 'value' => 1),
array('type' => 'other','name' => 'idwarehouse','label' => $langs->trans("SelectWarehouseForStockIncrease"),'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse'), 'idwarehouse', '', 1))); array('type' => 'other','name' => 'idwarehouse','label' => $langs->trans("SelectWarehouseForStockIncrease"),'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1)));
} }
$formconfirm = $form->formconfirm($_SERVER ["PHP_SELF"] . '?id=' . $object->id, $langs->trans('UnvalidateOrder'), $text, 'confirm_modif', $formquestion, "yes", 1, 220); $formconfirm = $form->formconfirm($_SERVER ["PHP_SELF"] . '?id=' . $object->id, $langs->trans('UnvalidateOrder'), $text, 'confirm_modif', $formquestion, "yes", 1, 220);
@ -1697,7 +1697,7 @@ if ($action == 'create' && $user->rights->commande->creer) {
// => 1), // => 1),
// array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"),
// 'value' => 1), // 'value' => 1),
array('type' => 'other','name' => 'idwarehouse','label' => $langs->trans("SelectWarehouseForStockIncrease"),'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse'), 'idwarehouse', '', 1))); array('type' => 'other','name' => 'idwarehouse','label' => $langs->trans("SelectWarehouseForStockIncrease"),'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1)));
} }
$formconfirm = $form->formconfirm($_SERVER ["PHP_SELF"] . '?id=' . $object->id, $langs->trans('Cancel'), $text, 'confirm_cancel', $formquestion, 0, 1); $formconfirm = $form->formconfirm($_SERVER ["PHP_SELF"] . '?id=' . $object->id, $langs->trans('Cancel'), $text, 'confirm_cancel', $formquestion, 0, 1);

View File

@ -1043,7 +1043,9 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
$error = 0; $error = 0;
// Set if we used free entry or predefined product // Set if we used free entry or predefined product
if (GETPOST('addline_libre')) if (GETPOST('addline_libre')
|| (GETPOST('dp_desc') && ! GETPOST('addline_libre') && ! GETPOST('idprod', 'int')>0) // we push enter onto qty field
)
{ {
$predef = ''; $predef = '';
$idprod = 0; $idprod = 0;
@ -1051,7 +1053,9 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
$price_ht = GETPOST('price_ht'); $price_ht = GETPOST('price_ht');
$tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0);
} }
if (GETPOST('addline_predefined')) if (GETPOST('addline_predefined')
|| (! GETPOST('dp_desc') && ! GETPOST('addline_predefined') && GETPOST('idprod', 'int')>0) // we push enter onto qty field
)
{ {
$predef = (($conf->global->MAIN_FEATURES_LEVEL < 2) ? '_predef' : ''); $predef = (($conf->global->MAIN_FEATURES_LEVEL < 2) ? '_predef' : '');
$idprod = GETPOST('idprod', 'int'); $idprod = GETPOST('idprod', 'int');
@ -2461,7 +2465,7 @@ if ($action == 'create')
// 1), // 1),
// array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value'
// => 1), // => 1),
array('type' => 'other','name' => 'idwarehouse','label' => $label,'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse'), 'idwarehouse', '', 1, 0, 0, $langs->trans("NoStockAction")))); array('type' => 'other','name' => 'idwarehouse','label' => $label,'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, $langs->trans("NoStockAction"))));
$formconfirm = $form->formconfirm($_SERVER ['PHP_SELF'] . '?facid=' . $object->id, $langs->trans('DeleteBill'), $text, 'confirm_delete', $formquestion, "yes", 1); $formconfirm = $form->formconfirm($_SERVER ['PHP_SELF'] . '?facid=' . $object->id, $langs->trans('DeleteBill'), $text, 'confirm_delete', $formquestion, "yes", 1);
} else { } else {
$formconfirm = $form->formconfirm($_SERVER ['PHP_SELF'] . '?facid=' . $object->id, $langs->trans('DeleteBill'), $text, 'confirm_delete', '', '', 1); $formconfirm = $form->formconfirm($_SERVER ['PHP_SELF'] . '?facid=' . $object->id, $langs->trans('DeleteBill'), $text, 'confirm_delete', '', '', 1);
@ -2512,7 +2516,7 @@ if ($action == 'create')
$value = '<input type="hidden" id="idwarehouse" name="idwarehouse" value="' . key($warehouse_array) . '">'; $value = '<input type="hidden" id="idwarehouse" name="idwarehouse" value="' . key($warehouse_array) . '">';
} else { } else {
$label = $object->type == Facture::TYPE_CREDIT_NOTE ? $langs->trans("SelectWarehouseForStockIncrease") : $langs->trans("SelectWarehouseForStockDecrease"); $label = $object->type == Facture::TYPE_CREDIT_NOTE ? $langs->trans("SelectWarehouseForStockIncrease") : $langs->trans("SelectWarehouseForStockDecrease");
$value = $formproduct->selectWarehouses(GETPOST('idwarehouse'), 'idwarehouse', '', 1); $value = $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1);
} }
$formquestion = array( $formquestion = array(
// 'text' => $langs->trans("ConfirmClone"), // 'text' => $langs->trans("ConfirmClone"),
@ -2552,7 +2556,7 @@ if ($action == 'create')
$value = '<input type="hidden" id="idwarehouse" name="idwarehouse" value="' . key($warehouse_array) . '">'; $value = '<input type="hidden" id="idwarehouse" name="idwarehouse" value="' . key($warehouse_array) . '">';
} else { } else {
$label = $object->type == Facture::TYPE_CREDIT_NOTE ? $langs->trans("SelectWarehouseForStockDecrease") : $langs->trans("SelectWarehouseForStockIncrease"); $label = $object->type == Facture::TYPE_CREDIT_NOTE ? $langs->trans("SelectWarehouseForStockDecrease") : $langs->trans("SelectWarehouseForStockIncrease");
$value = $formproduct->selectWarehouses(GETPOST('idwarehouse'), 'idwarehouse', '', 1); $value = $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1);
} }
$formquestion = array( $formquestion = array(
// 'text' => $langs->trans("ConfirmClone"), // 'text' => $langs->trans("ConfirmClone"),

View File

@ -791,6 +791,7 @@ class ExtraFields
$labeltoshow=dol_trunc($obj->$field_toshow,18).' '; $labeltoshow=dol_trunc($obj->$field_toshow,18).' ';
} }
} }
$out.='<option value="'.$obj->rowid.'" selected="selected">'.$labeltoshow.'</option>';
} }
else else
{ {

View File

@ -510,6 +510,12 @@ function dol_copy($srcfile, $destfile, $newmask=0, $overwriteifexists=1)
return -3; return -3;
} }
if (empty($newmask) && ! empty($conf->global->MAIN_UMASK)) $newmask=$conf->global->MAIN_UMASK; if (empty($newmask) && ! empty($conf->global->MAIN_UMASK)) $newmask=$conf->global->MAIN_UMASK;
if (empty($newmask)) // This should no happen
{
dol_syslog("Warning: dol_copy called with empty value for newmask and no default value defined", LOG_WARNING);
$newmask='0664';
}
@chmod($newpathofdestfile, octdec($newmask)); @chmod($newpathofdestfile, octdec($newmask));
return 1; return 1;

View File

@ -146,8 +146,8 @@ function pdf_getInstance($format='',$metric='mm',$pagetype='P')
// For TCPDF, we specify permission we want to block // For TCPDF, we specify permission we want to block
$pdfrights = array('modify','copy'); $pdfrights = array('modify','copy');
$pdfuserpass = ''; // Mot de passe pour l'utilisateur final $pdfuserpass = ''; // Password for the end user
$pdfownerpass = NULL; // Mot de passe du proprietaire, cree aleatoirement si pas defini $pdfownerpass = NULL; // Password of the owner, created randomly if not defined
$pdf->SetProtection($pdfrights,$pdfuserpass,$pdfownerpass); $pdf->SetProtection($pdfrights,$pdfuserpass,$pdfownerpass);
} }
else else
@ -259,7 +259,7 @@ function pdf_getPDFFontSize($outputlangs)
/** /**
* Return height to use for Logo onot PDF * Return height to use for Logo onto PDF
* *
* @param string $logo Full path to logo file to use * @param string $logo Full path to logo file to use
* @param bool $url Image with url (true or false) * @param bool $url Image with url (true or false)
@ -312,7 +312,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
if (empty($conf->global->MAIN_PDF_DISABLESOURCEDETAILS)) if (empty($conf->global->MAIN_PDF_DISABLESOURCEDETAILS))
{ {
// Tel // Phone
if ($sourcecompany->phone) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($sourcecompany->phone); if ($sourcecompany->phone) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($sourcecompany->phone);
// Fax // Fax
if ($sourcecompany->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($sourcecompany->fax); if ($sourcecompany->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($sourcecompany->fax);
@ -345,7 +345,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS)) if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS))
{ {
// Tel // Phone
if ($targetcontact->phone_pro) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($targetcontact->phone_pro); if ($targetcontact->phone_pro) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($targetcontact->phone_pro);
// Fax // Fax
if ($targetcontact->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcontact->fax); if ($targetcontact->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcontact->fax);
@ -363,7 +363,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS)) if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS))
{ {
// Tel // Phone
if ($targetcompany->phone) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($targetcompany->phone); if ($targetcompany->phone) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($targetcompany->phone);
// Fax // Fax
if ($targetcompany->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcompany->fax); if ($targetcompany->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcompany->fax);
@ -411,7 +411,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
{ {
$stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($deliverycompany))."\n"; $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($deliverycompany))."\n";
// Tel // Phone
if ($deliverycompany->phone) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($deliverycompany->phone); if ($deliverycompany->phone) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($deliverycompany->phone);
// Fax // Fax
if ($deliverycompany->fax) $stringaddress .= ($stringaddress ? ($deliverycompany->phone ? " - " : "\n") : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($deliverycompany->fax); if ($deliverycompany->fax) $stringaddress .= ($stringaddress ? ($deliverycompany->phone ? " - " : "\n") : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($deliverycompany->fax);
@ -447,7 +447,7 @@ function pdf_pagehead(&$pdf,$outputlangs,$page_height)
* @param Translate $outputlangs Object lang * @param Translate $outputlangs Object lang
* @param int $h Height of PDF * @param int $h Height of PDF
* @param int $w Width of PDF * @param int $w Width of PDF
* @param string $unit Unit of height (mmn, pt, ...) * @param string $unit Unit of height (mm, pt, ...)
* @param string $text Text to show * @param string $text Text to show
* @return void * @return void
*/ */
@ -783,7 +783,7 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
$pdf->SetFont('','',7); $pdf->SetFont('','',7);
$pdf->SetDrawColor(224,224,224); $pdf->SetDrawColor(224,224,224);
// On positionne le debut du bas de page selon nbre de lignes de ce bas de page // The start of the bottom of this page footer is positioned according to # of lines
$freetextheight=0; $freetextheight=0;
if ($line) // Free text if ($line) // Free text
{ {
@ -1015,7 +1015,7 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
// If line linked to a product // If line linked to a product
if ($idprod) if ($idprod)
{ {
// On ajoute la ref // We add ref
if ($prodser->ref) if ($prodser->ref)
{ {
$prefix_prodserv = ""; $prefix_prodserv = "";

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org> * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
@ -184,12 +184,6 @@ class modProjet extends DolibarrModules
$this->export_permission[$r]=array(array("projet","export")); $this->export_permission[$r]=array(array("projet","export"));
$this->export_dependencies_array[$r]=array('task_time'=>'ppt.rowid'); $this->export_dependencies_array[$r]=array('task_time'=>'ppt.rowid');
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','s.fk_pays'=>'Country',
's.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode',
'p.rowid'=>"ProjectId",'p.ref'=>"RefProject",'p.datec'=>"DateCreation",'p.dateo'=>"DateStart",'p.datee'=>"DateEnd",'p.fk_statut'=>'Status','p.description'=>"Description",
'pt.rowid'=>'RefTask','pt.dateo'=>"TaskDateStart",'pt.datee'=>"TaskDateEnd",'pt.duration_effective'=>"DurationEffective",'pt.planned_workload'=>"PlannedWorkload",'pt.progress'=>"Progress",'pt.description'=>"TaskDescription",
'ptt.task_date'=>'TaskTimeDate','ptt.task_duration'=>"TimesSpent",'ptt.fk_user'=>"TaskTimeUser",'ptt.note'=>"TaskTimeNote");
$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_pays:libelle', $this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_pays:libelle',
's.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text', 's.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text',
'p.rowid'=>"List:projet:ref",'p.ref'=>"Text",'p.datec'=>"Date",'p.dateo'=>"Date",'p.datee'=>"Date",'p.fk_statut'=>'Status','p.description'=>"Text", 'p.rowid'=>"List:projet:ref",'p.ref'=>"Text",'p.datec'=>"Date",'p.dateo'=>"Date",'p.datee'=>"Date",'p.fk_statut'=>'Status','p.description'=>"Text",
@ -198,15 +192,96 @@ class modProjet extends DolibarrModules
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','s.fk_pays'=>'company', $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','s.fk_pays'=>'company',
's.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company', 's.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company',
'p.rowid'=>"project",'p.ref'=>"project",'p.datec'=>"project",'p.dateo'=>"project",'p.datee'=>"project",'p.duree'=>"project",'p.fk_statut'=>"project",'p.description'=>"project", 'p.rowid'=>"project",'p.ref'=>"project",'p.datec'=>"project",'p.dateo'=>"project",'p.datee'=>"project",'p.duree'=>"project",'p.fk_statut'=>"project",'p.description'=>"project");
'pt.rowid'=>'projecttask','pt.dateo'=>"projecttask",'pt.datee'=>"projecttask",'pt.duration_effective'=>"projecttask",'pt.planned_workload'=>"projecttask",'pt.progress'=>"projecttask",'pt.description'=>"projecttask",
'ptt.task_date'=>'task_time','ptt.task_duration'=>"task_time",'ptt.fk_user'=>"task_time",'ptt.note'=>"task_time");
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','s.fk_pays'=>'Country',
's.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode',
'p.rowid'=>"ProjectId",'p.ref'=>"RefProject",'p.datec'=>"DateCreation",'p.dateo'=>"DateStart",'p.datee'=>"DateEnd",'p.fk_statut'=>'Status','p.description'=>"Description");
// Add fields for project
$this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array());
// Add extra fields
$sql="SELECT name, label FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'projet'";
$resql=$this->db->query($sql);
if ($resql) // This can fail when class is used on old database (during migration for example)
{
while ($obj=$this->db->fetch_object($resql))
{
$fieldname='extra.'.$obj->name;
$fieldlabel=ucfirst($obj->label);
$typeFilter="Text";
switch($obj->type)
{
case 'int':
case 'double':
case 'price':
$typeFilter="Numeric";
break;
case 'date':
case 'datetime':
$typeFilter="Date";
break;
case 'boolean':
$typeFilter="Boolean";
break;
case 'sellist':
$typeFilter="List:".$obj->param;
break;
}
$this->export_fields_array[$r][$fieldname]=$fieldlabel;
$this->export_TypeFields_array[$r][$fieldname]=$typeFilter;
$this->export_entities_array[$r][$fieldname]='project';
}
}
// End add extra fields
// Add fields for tasks
$this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array('pt.rowid'=>'RefTask','pt.dateo'=>"TaskDateStart",'pt.datee'=>"TaskDateEnd",'pt.duration_effective'=>"DurationEffective",'pt.planned_workload'=>"PlannedWorkload",'pt.progress'=>"Progress",'pt.description'=>"TaskDescription"));
$this->export_entities_array[$r]=array_merge($this->export_entities_array[$r], array('pt.rowid'=>'projecttask','pt.dateo'=>"projecttask",'pt.datee'=>"projecttask",'pt.duration_effective'=>"projecttask",'pt.planned_workload'=>"projecttask",'pt.progress'=>"projecttask",'pt.description'=>"projecttask"));
// Add extra fields
$sql="SELECT name, label FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'projet_task'";
$resql=$this->db->query($sql);
if ($resql) // This can fail when class is used on old database (during migration for example)
{
while ($obj=$this->db->fetch_object($resql))
{
$fieldname='extra2.'.$obj->name;
$fieldlabel=ucfirst($obj->label);
$typeFilter="Text";
switch($obj->type)
{
case 'int':
case 'double':
case 'price':
$typeFilter="Numeric";
break;
case 'date':
case 'datetime':
$typeFilter="Date";
break;
case 'boolean':
$typeFilter="Boolean";
break;
case 'sellist':
$typeFilter="List:".$obj->param;
break;
}
$this->export_fields_array[$r][$fieldname]=$fieldlabel;
$this->export_TypeFields_array[$r][$fieldname]=$typeFilter;
$this->export_entities_array[$r][$fieldname]='projecttask';
}
}
// End add extra fields
$this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array('ptt.task_date'=>'TaskTimeDate','ptt.task_duration'=>"TimesSpent",'ptt.fk_user'=>"TaskTimeUser",'ptt.note'=>"TaskTimeNote"));
$this->export_entities_array[$r]=array_merge($this->export_entities_array[$r], array('ptt.task_date'=>'task_time','ptt.task_duration'=>"task_time",'ptt.fk_user'=>"task_time",'ptt.note'=>"task_time"));
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'projet as p, '.MAIN_DB_PREFIX.'societe as s)'; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'projet as p';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX."projet_task as pt ON (p.rowid = pt.fk_projet)"; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet_extrafields as extra ON p.rowid = extra.fk_object';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX."projet_task_time as ptt ON (pt.rowid = ptt.fk_task)"; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX."projet_task as pt ON p.rowid = pt.fk_projet";
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet_task_extrafields as extra2 ON pt.rowid = extra2.fk_object';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX."projet_task_time as ptt ON pt.rowid = ptt.fk_task,";
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'societe as s';
$this->export_sql_end[$r] .=' WHERE p.fk_soc = s.rowid'; $this->export_sql_end[$r] .=' WHERE p.fk_soc = s.rowid';
$this->export_sql_end[$r] .=' AND p.entity = '.$conf->entity; $this->export_sql_end[$r] .=' AND p.entity = '.$conf->entity;
@ -228,6 +303,47 @@ class modProjet extends DolibarrModules
// Permissions // Permissions
$this->remove($options); $this->remove($options);
//ODT template for project
$src=DOL_DOCUMENT_ROOT.'/install/doctemplates/projects/template_project.odt';
$dirodt=DOL_DATA_ROOT.'/doctemplates/projects';
$dest=$dirodt.'/template_project.odt';
if (file_exists($src) && ! file_exists($dest))
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
dol_mkdir($dirodt);
$result=dol_copy($src,$dest,0,0);
if ($result < 0)
{
$langs->load("errors");
$this->error=$langs->trans('ErrorFailToCopyFile',$src,$dest);
return 0;
}
}
//ODT template for tasks
$src=DOL_DOCUMENT_ROOT.'/install/doctemplates/tasks/template_task_summary.odt';
$dirodt=DOL_DATA_ROOT.'/doctemplates/tasks';
$dest=$dirodt.'/template_task_summary.odt';
if (file_exists($src) && ! file_exists($dest))
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
dol_mkdir($dirodt);
$result=dol_copy($src,$dest,0,0);
if ($result < 0)
{
$langs->load("errors");
$this->error=$langs->trans('ErrorFailToCopyFile',$src,$dest);
return 0;
}
}
$sql = array(
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->const[0][2]."' AND entity = ".$conf->entity,
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->const[0][2]."','invoice',".$conf->entity.")"
);
$sql = array( $sql = array(
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->const[0][2]."' AND entity = ".$conf->entity, "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->const[0][2]."' AND entity = ".$conf->entity,
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->const[0][2]."','project',".$conf->entity.")", "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->const[0][2]."','project',".$conf->entity.")",

View File

@ -171,7 +171,7 @@ function task_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0, $h
} }
else else
{ {
$modele='baleine'; $modele='nodefault';
} }
} }
@ -194,7 +194,7 @@ function task_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0, $h
$file = $prefix."_".$modele.".modules.php"; $file = $prefix."_".$modele.".modules.php";
// On verifie l'emplacement du modele // On verifie l'emplacement du modele
$file=dol_buildpath($reldir."core/modules/project/pdf/".$file,0); $file=dol_buildpath($reldir."core/modules/project/task/pdf/".$file,0);
if (file_exists($file)) if (file_exists($file))
{ {
$filefound=1; $filefound=1;

View File

@ -526,7 +526,6 @@ class doc_generic_task_odt extends ModelePDFTask
else // Text else // Text
{ {
$odfHandler->setVars($key, $value, true, 'UTF-8'); $odfHandler->setVars($key, $value, true, 'UTF-8');
$odfHandler->setVarsHeadFooter($key, $value, true, 'UTF-8');
} }
} }
catch(OdfException $e) catch(OdfException $e)

View File

@ -142,7 +142,7 @@ class InterfaceMailmanSpipsynchro
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
// We add subscription if we change category (new category may means more mailing-list to subscribe) // We add subscription if we change category (new category may means more mailing-list to subscribe)
if ($object->linkto->add_to_abo() < 0) if (is_object($object->linkto) && method_exists($object->linkto, 'add_to_abo') && $object->linkto->add_to_abo() < 0)
{ {
$this->error=$object->linkto->error; $this->error=$object->linkto->error;
$this->errors=$object->linkto->errors; $this->errors=$object->linkto->errors;
@ -160,7 +160,7 @@ class InterfaceMailmanSpipsynchro
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
// We remove subscription if we change category (lessw category may means less mailing-list to subscribe) // We remove subscription if we change category (lessw category may means less mailing-list to subscribe)
if ($object->unlinkoff->del_to_abo() < 0) if (is_object($object->unlinkoff) && method_exists($object->unlinkoff, 'del_to_abo') && $object->unlinkoff->del_to_abo() < 0)
{ {
$this->error=$object->unlinkoff->error; $this->error=$object->unlinkoff->error;
$this->errors=$object->unlinkoff->errors; $this->errors=$object->unlinkoff->errors;

View File

@ -39,6 +39,10 @@ TaskTimeDate=Date
NewTimeSpent=Nouveau consommé NewTimeSpent=Nouveau consommé
MyTimeSpent=Mon consommé MyTimeSpent=Mon consommé
MyTasks=Mes tâches MyTasks=Mes tâches
TaskTimeSpent=Temps consommé sur les tâches
TaskTimeUser=Utilisateur
TaskTimeNote=Note
TaskTimeDate=Date
Tasks=Tâches Tasks=Tâches
Task=Tâche Task=Tâche
TaskDateStart=Date de début de tâche TaskDateStart=Date de début de tâche

View File

@ -20,7 +20,7 @@
/** /**
* \file htdocs/product/index.php * \file htdocs/product/index.php
* \ingroup product * \ingroup product
* \brief Page accueil des produits et services * \brief Homepage products and services
*/ */
require '../main.inc.php'; require '../main.inc.php';
@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
$type=isset($_GET["type"])?$_GET["type"]:(isset($_POST["type"])?$_POST["type"]:''); $type=isset($_GET["type"])?$_GET["type"]:(isset($_POST["type"])?$_POST["type"]:'');
if ($type =='' && !$user->rights->produit->lire) $type='1'; // Force global page on service page only if ($type =='' && !$user->rights->produit->lire) $type='1'; // Force global page on service page only
if ($type =='' && !$user->rights->service->lire) $type='0'; // Force global page on prpduct page only if ($type =='' && !$user->rights->service->lire) $type='0'; // Force global page on product page only
// Security check // Security check
if ($type=='0') $result=restrictedArea($user,'produit'); if ($type=='0') $result=restrictedArea($user,'produit');
@ -72,7 +72,7 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
/* /*
* Zone recherche produit/service * Search Area of product/service
*/ */
$rowspan=2; $rowspan=2;
if (! empty($conf->barcode->enabled)) $rowspan++; if (! empty($conf->barcode->enabled)) $rowspan++;
@ -99,7 +99,7 @@ print "</table></form><br>";
/* /*
* Nombre de produits et/ou services * Number of products and/or services
*/ */
$prodser = array(); $prodser = array();
$prodser[0][0]=$prodser[0][1]=$prodser[1][0]=$prodser[1][1]=0; $prodser[0][0]=$prodser[0][1]=$prodser[1][0]=$prodser[1][1]=0;
@ -280,10 +280,10 @@ function activitytrim($product_type)
{ {
global $conf,$langs,$db; global $conf,$langs,$db;
// on affiche les 3 dernières années // We display the last 3 years
$yearofbegindate=date('Y',dol_time_plus_duree(time(), -3, "y")); $yearofbegindate=date('Y',dol_time_plus_duree(time(), -3, "y"));
// ventilation par trimestre // breakdown by quarter
$sql = "SELECT DATE_FORMAT(p.datep,'%Y') as annee, DATE_FORMAT(p.datep,'%m') as mois, SUM(fd.total_ht) as Mnttot"; $sql = "SELECT DATE_FORMAT(p.datep,'%Y') as annee, DATE_FORMAT(p.datep,'%m') as mois, SUM(fd.total_ht) as Mnttot";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."facturedet as fd"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."facturedet as fd";
$sql.= " , ".MAIN_DB_PREFIX."paiement as p,".MAIN_DB_PREFIX."paiement_facture as pf"; $sql.= " , ".MAIN_DB_PREFIX."paiement as p,".MAIN_DB_PREFIX."paiement_facture as pf";
@ -342,7 +342,7 @@ function activitytrim($product_type)
print '</tr>'; print '</tr>';
$lgn++; $lgn++;
} }
// on passe à l'année suivante // We go to the following year
$tmpyear = $objp->annee; $tmpyear = $objp->annee;
$trim1=0; $trim1=0;
$trim2=0; $trim2=0;

View File

@ -223,7 +223,7 @@ foreach ($listofreferent as $key => $value)
print '<input type="hidden" name="action" value="addelement">'; print '<input type="hidden" name="action" value="addelement">';
print '<table><tr><td>'.$langs->trans("SelectElement").'</td>'; print '<table><tr><td>'.$langs->trans("SelectElement").'</td>';
print '<td>'.$selectList.'</td>'; print '<td>'.$selectList.'</td>';
print '<td><input type="submit" class="button" value="'.$langs->trans("AddElement").'"></td>'; print '<td><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("AddElement")).'"></td>';
print '</tr></table>'; print '</tr></table>';
print '</form>'; print '</form>';
} }

View File

@ -129,9 +129,9 @@ if ($action == 'add' && $user->rights->projet->creer)
$db->begin(); $db->begin();
$object->ref = GETPOST('ref','alpha'); $object->ref = GETPOST('ref','alpha');
$object->title = GETPOST('title','alpha'); $object->title = GETPOST('title'); // Do not use 'alpha' here, we want field as it is
$object->socid = GETPOST('socid','int'); $object->socid = GETPOST('socid','int');
$object->description = GETPOST('description','alpha'); $object->description = GETPOST('description'); // Do not use 'alpha' here, we want field as it is
$object->public = GETPOST('public','alpha'); $object->public = GETPOST('public','alpha');
$object->datec=dol_now(); $object->datec=dol_now();
$object->date_start=$date_start; $object->date_start=$date_start;
@ -205,9 +205,9 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->projet->creer)
$old_start_date = $object->date_start; $old_start_date = $object->date_start;
$object->ref = GETPOST('ref','alpha'); $object->ref = GETPOST('ref','alpha');
$object->title = GETPOST('title','alpha'); $object->title = GETPOST('title'); // Do not use 'alpha' here, we want field as it is
$object->socid = GETPOST('socid','int'); $object->socid = GETPOST('socid','int');
$object->description = GETPOST('description','alpha'); $object->description = GETPOST('description'); // Do not use 'alpha' here, we want field as it is
$object->public = GETPOST('public','alpha'); $object->public = GETPOST('public','alpha');
$object->date_start = empty($_POST["project"])?'':$date_start; $object->date_start = empty($_POST["project"])?'':$date_start;
$object->date_end = empty($_POST["projectend"])?'':$date_end; $object->date_end = empty($_POST["projectend"])?'':$date_end;

View File

@ -166,7 +166,6 @@ function constructGanttLine($tarr,$task,$project_dependencies,$level=0,$project_
} }
// Add line to gantt // Add line to gantt
$s = "// Add taks id=".$task["task_id"]." level = ".$level."\n"; $s = "// Add taks id=".$task["task_id"]." level = ".$level."\n";
//$s.= "g.AddElementItem(new JSGantt.ElementItem('task',".$task['task_id'].",'".$name."','".$start_date."', '".$end_date."', '".$task['task_color']."', '', ".$task['task_milestone'].", '".$resources."', ".$percent.", ".($task["task_is_group"]>0?1:0).", ".$parent.", 1".($depend?", ".$depend:"")."));";
$s = "g.AddTaskItem(new JSGantt.TaskItem(".$task['task_id'].",'".dol_escape_js($name)."','".$start_date."', '".$end_date."', '".$task['task_color']."', '".$link."', ".$task['task_milestone'].", '".$resources."', ".$percent.", ".($task["task_is_group"]>0?1:0).", '".$parent."', 1, '".($depend?$depend:"")."'));"; $s = "g.AddTaskItem(new JSGantt.TaskItem(".$task['task_id'].",'".dol_escape_js($name)."','".$start_date."', '".$end_date."', '".$task['task_color']."', '".$link."', ".$task['task_milestone'].", '".$resources."', ".$percent.", ".($task["task_is_group"]>0?1:0).", '".$parent."', 1, '".($depend?$depend:"")."'));";
echo $s."\n"; echo $s."\n";
} }

View File

@ -310,7 +310,7 @@ if ($id > 0 || ! empty($ref))
print '<td colspan="1">'; print '<td colspan="1">';
// On recupere les id des users deja selectionnes // On recupere les id des users deja selectionnes
$contactsofproject=$projectstatic->getListContactId('internal'); $contactsofproject=$projectstatic->getListContactId('internal');
$form->select_users($user->id,'userid',0,'',0,'',$contactsofproject); $form->select_users($user->id,'contactid',0,'',0,'',$contactsofproject);
print '</td>'; print '</td>';
print '<td>'; print '<td>';
$formcompany->selectTypeContact($object, '', 'type','internal','rowid'); $formcompany->selectTypeContact($object, '', 'type','internal','rowid');

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2006-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.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

View File

@ -1160,7 +1160,8 @@ class Societe extends CommonObject
return -1; return -1;
} }
} }
else dol_syslog("Can't remove thirdparty with id ".$id.". There is ".$objectisused." childs", LOG_WARNING);
return 0;
} }
/** /**

View File

@ -192,6 +192,7 @@ if ($action == 'add' && $canadduser)
$object->accountancy_code = GETPOST("accountancy_code"); $object->accountancy_code = GETPOST("accountancy_code");
$object->note = GETPOST("note"); $object->note = GETPOST("note");
$object->ldap_sid = GETPOST("ldap_sid"); $object->ldap_sid = GETPOST("ldap_sid");
$object->fk_user = GETPOST("fk_user")>0?GETPOST("fk_user"):0;
// Fill array 'array_options' with data from add form // Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels,$object); $ret = $extrafields->setOptionalsFromPost($extralabels,$object);

1
test/.gitignore vendored
View File

@ -1 +1,2 @@
/report /report
/test.xml