Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into new_branch_03_09…
Browse files Browse the repository at this point in the history
…_2018
  • Loading branch information
grandoc committed Sep 6, 2018
2 parents 056b0b2 + f7c87a9 commit 3c06527
Show file tree
Hide file tree
Showing 21 changed files with 57 additions and 38 deletions.
2 changes: 1 addition & 1 deletion htdocs/commande/card.php
Expand Up @@ -679,7 +679,7 @@
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++;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/contact/list.php
Expand Up @@ -307,7 +307,7 @@
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);
Expand Down
12 changes: 9 additions & 3 deletions htdocs/core/class/html.form.class.php
Expand Up @@ -6674,16 +6674,17 @@ function showbarcode(&$object,$width=100)
* @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];
Expand All @@ -6707,6 +6708,7 @@ static function showphoto($modulepart, $object, $width=100, $height=0, $caneditf
$originalfile=get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.$object->photo;
}
$email=$object->email;
$capture='user';
}
else if ($modulepart=='userphoto')
{
Expand All @@ -6720,6 +6722,7 @@ static function showphoto($modulepart, $object, $width=100, $height=0, $caneditf
}
if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility
$email=$object->email;
$capture='user';
}
else if ($modulepart=='memberphoto')
{
Expand All @@ -6733,6 +6736,7 @@ static function showphoto($modulepart, $object, $width=100, $height=0, $caneditf
}
if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility
$email=$object->email;
$capture='user';
}
else
{
Expand All @@ -6749,6 +6753,8 @@ static function showphoto($modulepart, $object, $width=100, $height=0, $caneditf
$email=$object->email;
}

if ($forcecapture) $capture = $forcecapture;

if ($dir)
{
if ($file && file_exists($dir."/".$file))
Expand Down Expand Up @@ -6805,7 +6811,7 @@ static function showphoto($modulepart, $object, $width=100, $height=0, $caneditf
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>';
}

Expand Down
13 changes: 11 additions & 2 deletions htdocs/core/lib/pdf.lib.php
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/modules/commande/doc/pdf_einstein.modules.php
Expand Up @@ -883,7 +883,7 @@ function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
$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);

Expand Down
3 changes: 1 addition & 2 deletions htdocs/core/modules/facture/doc/pdf_crabe.modules.php
Expand Up @@ -1113,7 +1113,7 @@ function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
$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);

Expand Down Expand Up @@ -1338,7 +1338,6 @@ function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
}

$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;
Expand Down
3 changes: 3 additions & 0 deletions htdocs/core/modules/modAdherent.class.php
Expand Up @@ -347,6 +347,8 @@ function __construct($db)
);

// Cronjobs
$arraydate=dol_getdate(dol_now());
$datestart=dol_mktime(22, 0, 0, $arraydate['mon'], $arraydate['mday'], $arraydate['year']);
$this->cronjobs = array(
0=>array(
'label'=>'SendReminderForExpiredSubscriptionTitle',
Expand All @@ -360,6 +362,7 @@ function __construct($db)
'priority'=>50,
'status'=>0,
'test'=>true,
'datestart'=>$datestart
),
);
}
Expand Down
4 changes: 2 additions & 2 deletions htdocs/core/modules/modAgenda.class.php
Expand Up @@ -113,9 +113,9 @@ function __construct($db)

// Cronjobs
//------------
$datestart=dol_now();
$this->cronjobs = array(
0=>array('label'=>'SendEmailsReminders', 'jobtype'=>'method', 'class'=>'comm/action/class/actioncomm.class.php', 'objectname'=>'ActionComm', 'method'=>'sendEmailsReminder', 'parameters'=>'', 'comment'=>'SendEMailsReminder', 'frequency'=>10, 'unitfrequency'=>60, 'priority'=>10, 'status'=>1, 'test'=>'1'),
// 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600*24)
0=>array('label'=>'SendEmailsReminders', 'jobtype'=>'method', 'class'=>'comm/action/class/actioncomm.class.php', 'objectname'=>'ActionComm', 'method'=>'sendEmailsReminder', 'parameters'=>'', 'comment'=>'SendEMailsReminder', 'frequency'=>10, 'unitfrequency'=>60, 'priority'=>10, 'status'=>1, 'test'=>'1', 'datestart'=>$datestart),
);

// Permissions
Expand Down
6 changes: 3 additions & 3 deletions htdocs/core/modules/modAsset.class.php
Expand Up @@ -174,9 +174,9 @@ public function __construct($db)

// Cronjobs (List of cron jobs entries to add when module is enabled)
// unit_frequency must be 60 for minute, 3600 for hour, 86400 for day, 604800 for week
$this->cronjobs = array(
0=>array('label'=>'MyJob label', 'jobtype'=>'method', 'class'=>'/asset/class/asset.class.php', 'objectname'=>'Asset', 'method'=>'doScheduledJob', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600, 'status'=>0, 'test'=>true)
);
//$this->cronjobs = array(
// 0=>array('label'=>'MyJob label', 'jobtype'=>'method', 'class'=>'/asset/class/asset.class.php', 'objectname'=>'Asset', 'method'=>'doScheduledJob', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600, 'status'=>0, 'test'=>true)
//);
// Example: $this->cronjobs=array(0=>array('label'=>'My label', 'jobtype'=>'method', 'class'=>'/dir/class/file.class.php', 'objectname'=>'MyClass', 'method'=>'myMethod', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600, 'status'=>0, 'test'=>true),
// 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600*24, 'status'=>0, 'test'=>true)
// );
Expand Down
4 changes: 2 additions & 2 deletions htdocs/core/modules/modDav.class.php
Expand Up @@ -173,9 +173,9 @@ public function __construct($db)

// Cronjobs (List of cron jobs entries to add when module is enabled)
// unit_frequency must be 60 for minute, 3600 for hour, 86400 for day, 604800 for week
$this->cronjobs = array(
//$this->cronjobs = array(
//0=>array('label'=>'MyJob label', 'jobtype'=>'method', 'class'=>'/dav/class/myobject.class.php', 'objectname'=>'MyObject', 'method'=>'doScheduledJob', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600, 'status'=>0, 'test'=>true)
);
//);
// Example: $this->cronjobs=array(0=>array('label'=>'My label', 'jobtype'=>'method', 'class'=>'/dir/class/file.class.php', 'objectname'=>'MyClass', 'method'=>'myMethod', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600, 'status'=>0, 'test'=>true),
// 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600*24, 'status'=>0, 'test'=>true)
// );
Expand Down
13 changes: 7 additions & 6 deletions htdocs/core/modules/modFacture.class.php
Expand Up @@ -114,13 +114,14 @@ function __construct($db)
2=>array('file'=>'box_graph_invoices_permonth.php', 'enabledbydefaulton'=>'Home')
);

// Cronjobs
$this->cronjobs = array(
0=>array('label'=>'RecurringInvoices', 'jobtype'=>'method', 'class'=>'compta/facture/class/facture-rec.class.php', 'objectname'=>'FactureRec', 'method'=>'createRecurringInvoices', 'parameters'=>'', 'comment'=>'Generate recurring invoices', 'frequency'=>1, 'unitfrequency'=>3600 * 24, 'priority'=>50, 'status'=>1, 'test'=>true),
// 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>3600, 'unitfrequency'=>3600)
);
// Cronjobs
$arraydate=dol_getdate(dol_now());
$datestart=dol_mktime(23, 0, 0, $arraydate['mon'], $arraydate['mday'], $arraydate['year']);
$this->cronjobs = array(
0=>array('label'=>'RecurringInvoices', 'jobtype'=>'method', 'class'=>'compta/facture/class/facture-rec.class.php', 'objectname'=>'FactureRec', 'method'=>'createRecurringInvoices', 'parameters'=>'', 'comment'=>'Generate recurring invoices', 'frequency'=>1, 'unitfrequency'=>3600 * 24, 'priority'=>50, 'status'=>1, 'test'=>true, 'datestart'=>$datestart),
);

// Permissions
// Permissions
$this->rights = array();
$this->rights_class = 'facture';
$r = 0;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/modules/propale/doc/pdf_azur.modules.php
Expand Up @@ -1060,7 +1060,7 @@ function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
$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);

Expand Down
Expand Up @@ -649,7 +649,7 @@ function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
$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);

Expand Down
Expand Up @@ -821,7 +821,7 @@ function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
$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);

Expand Down
4 changes: 2 additions & 2 deletions htdocs/expedition/card.php
Expand Up @@ -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
Expand Down Expand Up @@ -1041,7 +1041,7 @@
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');
}


Expand Down
2 changes: 1 addition & 1 deletion htdocs/langs/en_US/cron.lang
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion htdocs/langs/fr_FR/cron.lang
Expand Up @@ -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.
1 change: 1 addition & 0 deletions htdocs/product/dynamic_price/class/index.html
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions htdocs/product/dynamic_price/index.html
@@ -0,0 +1 @@

13 changes: 6 additions & 7 deletions htdocs/product/reassort.php
Expand Up @@ -319,11 +319,12 @@
{
$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>';
Expand Down Expand Up @@ -360,15 +361,13 @@
}
}



// 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>';
Expand Down
2 changes: 1 addition & 1 deletion htdocs/user/card.php
Expand Up @@ -1010,7 +1010,7 @@
}
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>';
}
Expand Down

0 comments on commit 3c06527

Please sign in to comment.