Merge remote-tracking branch 'upstream/develop' into camelCaps2

This commit is contained in:
Frédéric FRANCE 2018-09-05 21:02:16 +02:00
commit 4cbfa2073a
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
18 changed files with 1498 additions and 28 deletions

View File

@ -679,7 +679,7 @@ if (empty($reshook))
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors');
$error++;
}
if ($prod_entry_mode == 'free' && empty($idprod) && (! ($price_ht >= 0) || $price_ht == '') && (! ($price_ht_devise >= 0) || $price_ht_devise == '')) // Unit price can be 0 but not ''
if ($prod_entry_mode == 'free' && empty($idprod) && $price_ht == '' && $price_ht_devise == '') // Unit price can be 0 but not ''. Also price can be negative for order.
{
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors');
$error++;

View File

@ -307,7 +307,7 @@ if ($search_societe) $sql.= natural_search('s.nom', $search_socie
if ($search_country) $sql .= " AND p.fk_pays IN (".$search_country.')';
if (strlen($search_poste)) $sql.= natural_search('p.poste', $search_poste);
if (strlen($search_phone_perso)) $sql.= natural_search('p.phone_perso', $search_phone_perso);
if (strlen($search_phone_pro)) $sql.= natural_search('p.phone', $search_phone);
if (strlen($search_phone_pro)) $sql.= natural_search('p.phone', $search_phone_pro);
if (strlen($search_phone_mobile)) $sql.= natural_search('p.phone_mobile', $search_phone_mobile);
if (strlen($search_fax)) $sql.= natural_search('p.fax', $search_fax);
if (strlen($search_skype)) $sql.= natural_search('p.skype', $search_skype);

View File

@ -6717,16 +6717,17 @@ class Form
* @param string $imagesize 'mini', 'small' or '' (original)
* @param int $addlinktofullsize Add link to fullsize image
* @param int $cache 1=Accept to use image in cache
* @param string $forcecapture Force parameter capture on HTML input file element to ask a smartphone to allow to open camera to take photo. Auto if empty.
* @return string HTML code to output photo
*/
static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $imagesize='', $addlinktofullsize=1, $cache=0)
static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $imagesize='', $addlinktofullsize=1, $cache=0, $forcecapture='')
{
global $conf,$langs;
$entity = (! empty($object->entity) ? $object->entity : $conf->entity);
$id = (! empty($object->id) ? $object->id : $object->rowid);
$ret='';$dir='';$file='';$originalfile='';$altfile='';$email='';
$ret='';$dir='';$file='';$originalfile='';$altfile='';$email='';$capture='';
if ($modulepart=='societe')
{
$dir=$conf->societe->multidir_output[$entity];
@ -6750,6 +6751,7 @@ class Form
$originalfile=get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.$object->photo;
}
$email=$object->email;
$capture='user';
}
else if ($modulepart=='userphoto')
{
@ -6763,6 +6765,7 @@ class Form
}
if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility
$email=$object->email;
$capture='user';
}
else if ($modulepart=='memberphoto')
{
@ -6776,6 +6779,7 @@ class Form
}
if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility
$email=$object->email;
$capture='user';
}
else
{
@ -6792,6 +6796,8 @@ class Form
$email=$object->email;
}
if ($forcecapture) $capture = $forcecapture;
if ($dir)
{
if ($file && file_exists($dir."/".$file))
@ -6848,7 +6854,7 @@ class Form
if ($object->photo) $ret.="<br>\n";
$ret.='<table class="nobordernopadding centpercent">';
if ($object->photo) $ret.='<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> '.$langs->trans("Delete").'<br><br></td></tr>';
$ret.='<tr><td class="tdoverflow"><input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput"></td></tr>';
$ret.='<tr><td class="tdoverflow"><input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput"'.($capture?' capture="'.$capture.'"':'').'></td></tr>';
$ret.='</table>';
}

View File

@ -445,8 +445,17 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
if (!empty($targetcontact->address)) {
$stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($targetcontact));
}else {
$stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($targetcompany));
} else {
$companytouseforaddress = $targetcompany;
// Contact on a thirdparty that is a different thirdparty than the thirdparty of object
if ($targetcontact->socid > 0 && $targetcontact->socid != $targetcompany->id)
{
$targetcontact->fetch_thirparty();
$companytouseforaddress = $targetcontact->thirdparty;
}
$stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($companytouseforaddress));
}
// Country
if (!empty($targetcontact->country_code) && $targetcontact->country_code != $sourcecompany->country_code) {

View File

@ -33,16 +33,17 @@ abstract class ModeleAction extends CommonDocGenerator
*/
public $error='';
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return list of active generation modules
*
* @param DoliDB $db Database handler
* @param DoliDB $db Database handler
* @param integer $maxfilenamelength Max length of value to show
* @return array List of templates
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
static function liste_modeles($db,$maxfilenamelength=0)
{
// phpcs:enable
global $conf;
$type='action';
@ -54,6 +55,8 @@ abstract class ModeleAction extends CommonDocGenerator
return $liste;
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Create an product document on disk using template defined into PRODUCT_ADDON_PDF
*
@ -66,9 +69,9 @@ abstract class ModeleAction extends CommonDocGenerator
* @param int $hideref Hide ref
* @return int 0 if KO, 1 if OK
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function action_create($db, $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
{
// phpcs:enable
global $conf,$langs,$user;
$langs->load("action");

File diff suppressed because it is too large Load Diff

View File

@ -43,6 +43,7 @@ abstract class ModelePDFContract extends CommonDocGenerator
public $error='';
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return list of active generation modules
*
@ -50,9 +51,9 @@ abstract class ModelePDFContract extends CommonDocGenerator
* @param integer $maxfilenamelength Max length of value to show
* @return array List of templates
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
static function liste_modeles($db,$maxfilenamelength=0)
{
// phpcs:enable
global $conf;
$type='contract';

View File

@ -1117,7 +1117,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetXY($col1x, $tab2_top + 0);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
$total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
$total_ht = (($conf->multicurrency->enabled && isset($object->mylticurrency_tx) && $object->mylticurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
$pdf->SetXY($col2x, $tab2_top + 0);
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * ($total_ht + (! empty($object->remise)?$object->remise:0)), 0, $outputlangs), 0, 'R', 1);
@ -1342,7 +1342,6 @@ class pdf_crabe extends ModelePDFFactures
}
$pdf->SetTextColor(0,0,0);
$creditnoteamount=$object->getSumCreditNotesUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0); // Warning, this also include excess received
$depositsamount=$object->getSumDepositsUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0);
//print "x".$creditnoteamount."-".$depositsamount;exit;

View File

@ -1064,7 +1064,7 @@ class pdf_azur extends ModelePDFPropales
$pdf->SetXY($col1x, $tab2_top + 0);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
$total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
$total_ht = (($conf->multicurrency->enabled && isset($object->mylticurrency_tx) && $object->mylticurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
$pdf->SetXY($col2x, $tab2_top + 0);
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (! empty($object->remise)?$object->remise:0), 0, $outputlangs), 0, 'R', 1);

View File

@ -651,7 +651,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$pdf->SetXY($col1x, $tab2_top + 0);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
$total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
$total_ht = (($conf->multicurrency->enabled && isset($object->mylticurrency_tx) && $object->mylticurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
$pdf->SetXY($col2x, $tab2_top + 0);
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + $object->remise), 0, 'R', 1);

View File

@ -825,7 +825,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$pdf->SetXY($col1x, $tab2_top + 0);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
$total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
$total_ht = (($conf->multicurrency->enabled && isset($object->mylticurrency_tx) && $object->mylticurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
$pdf->SetXY($col2x, $tab2_top + 0);
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (! empty($object->remise)?$object->remise:0)), 0, 'R', 1);

View File

@ -9,7 +9,7 @@
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
* Copyright (C) 2014-2017 Francis Appels <francis.appels@yahoo.com>
* Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2016-2018 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2016 Yasser Carreón <yacasia@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
@ -1041,7 +1041,7 @@ if ($action == 'create')
if ($object->fetch_optionals() > 0) {
$expe->array_options = array_merge($expe->array_options, $object->array_options);
}
print $object->showOptionals($extrafields, 'edit');
print $expe->showOptionals($extrafields, 'edit');
}

View File

@ -79,5 +79,5 @@ CronCannotLoadObject=Class file %s was loaded, but object %s was not found into
UseMenuModuleToolsToAddCronJobs=Go into menu "Home - Admin tools - Scheduled jobs" to see and edit scheduled jobs.
JobDisabled=Job disabled
MakeLocalDatabaseDumpShort=Local database backup
MakeLocalDatabaseDump=Create a local database dump. Parameters are: compression ('gz' or 'bz' or 'none'), backup type ('mysql' or 'pgsql'), 1, 'auto' or filename to build, number of backup files to keep
MakeLocalDatabaseDump=Create a local database dump. Parameters are: compression ('gz' or 'bz' or 'none'), backup type ('mysql', 'pgsql', 'auto'), 1, 'auto' or filename to build, number of backup files to keep
WarningCronDelayed=Attention, for performance purpose, whatever is next date of execution of enabled jobs, your jobs may be delayed to a maximum of %s hours, before being run.

View File

@ -79,5 +79,5 @@ CronCannotLoadObject=Le fichier de classe %s a été chargé, mais l'objet %s n'
UseMenuModuleToolsToAddCronJobs=Aller à la page "Accueil - Outils administration - Travaux planifiées" pour voir la listes des travaux programmées et les modifier.
JobDisabled=Travail désactivé
MakeLocalDatabaseDumpShort=Sauvegarde locale de base
MakeLocalDatabaseDump=Créez un fichier dump de base local. Les paramètres sont: compression ('gz' ou 'bz' ou 'none'), type de sauvegarde ('mysql' ou 'pgsql'), 1, 'auto' ou nom du fichier à générer, nb de fichiers de sauvegarde à garder
MakeLocalDatabaseDump=Créez un fichier dump de base local. Les paramètres sont: compression ('gz' ou 'bz' ou 'none'), type de sauvegarde ('mysql', 'pgsql', 'auto'), 1, 'auto' ou nom du fichier à générer, nb de fichiers de sauvegarde à garder
WarningCronDelayed=Attention, à des fins de performance, quelle que soit la prochaine date d'exécution des travaux activés, vos travaux peuvent être retardés jusqu'à %s heures avant d'être exécutés.

View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@

View File

@ -319,11 +319,12 @@ if ($resql)
{
$objp = $db->fetch_object($resql);
print '<tr>';
print '<td class="nowrap">';
$product=new Product($db);
$product->fetch($objp->rowid);
$product->load_stock();
print '<tr>';
print '<td class="nowrap">';
print $product->getNomUrl(1,'',16);
//if ($objp->stock_theorique < $objp->seuil_stock_alerte) print ' '.img_warning($langs->trans("StockTooLow"));
print '</td>';
@ -360,15 +361,13 @@ if ($resql)
}
}
// Virtual stock
if ($virtualdiffersfromphysical)
{
print '<td align="right">';
print '<td align="right">';
if ($objp->seuil_stock_alerte != '' && ($product->stock_theorique < $objp->seuil_stock_alerte)) print img_warning($langs->trans("StockTooLow")).' ';
print $product->stock_theorique;
print '</td>';
print $product->stock_theorique;
print '</td>';
}
print '<td align="right"><a href="'.DOL_URL_ROOT.'/product/stock/mouvement.php?idproduct='.$product->id.'">'.$langs->trans("Movements").'</a></td>';
print '<td align="right" class="nowrap">'.$product->LibStatut($objp->statut,5,0).'</td>';

View File

@ -1010,7 +1010,7 @@ if ($action == 'create' || $action == 'adduserldap')
}
else
{
print '<input size="40" type="text" name="skype" value="'.GETPOST('skype').'">';
print '<input class="maxwidth200" type="text" name="skype" value="'.GETPOST('skype').'">';
}
print '</td></tr>';
}