Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into camelCaps2
Browse files Browse the repository at this point in the history
  • Loading branch information
frederic34 committed Sep 2, 2018
2 parents 61c4e98 + d2afffa commit e13a8ec
Show file tree
Hide file tree
Showing 102 changed files with 479 additions and 354 deletions.
9 changes: 4 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,17 @@ env:
matrix:
fast_finish: true
allow_failures:
- php: hhvm
- php: nightly
# We exclude some combinations not usefull to save Travis CPU
exclude:
- php: '5.5'
env: DB=mysql
env: DB=mariadb
- php: '5.6'
env: DB=mysql
env: DB=mariadb
- php: '7.0'
env: DB=mysql
env: DB=mariadb
- php: '7.1'
env: DB=mysql
env: DB=mariadb
- php: '5.5'
env: DB=postgresql
- php: '5.6'
Expand Down
4 changes: 2 additions & 2 deletions dev/setup/codesniffer/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,9 @@
<!--<rule ref="PEAR.Commenting.FunctionComment.MissingReturn">
<severity>0</severity>
</rule>-->
<!--<rule ref="PEAR.Commenting.FunctionComment.Missing">
<rule ref="PEAR.Commenting.FunctionComment.Missing">
<severity>0</severity>
</rule>-->
</rule>

<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType" />

Expand Down
11 changes: 1 addition & 10 deletions htdocs/adherents/admin/website.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,12 @@
$amount=GETPOST('MEMBER_NEWFORM_AMOUNT');
$editamount=GETPOST('MEMBER_NEWFORM_EDITAMOUNT');
$payonline=GETPOST('MEMBER_NEWFORM_PAYONLINE');
$email=GETPOST('MEMBER_PAYONLINE_SENDEMAIL');
$forcetype=GETPOST('MEMBER_NEWFORM_FORCETYPE');
$forcetype=GETPOST('MEMBER_NEWFORM_FORCETYPE');

$res=dolibarr_set_const($db, "MEMBER_ENABLE_PUBLIC",$public,'chaine',0,'',$conf->entity);
$res=dolibarr_set_const($db, "MEMBER_NEWFORM_AMOUNT",$amount,'chaine',0,'',$conf->entity);
$res=dolibarr_set_const($db, "MEMBER_NEWFORM_EDITAMOUNT",$editamount,'chaine',0,'',$conf->entity);
$res=dolibarr_set_const($db, "MEMBER_NEWFORM_PAYONLINE",$payonline,'chaine',0,'',$conf->entity);
$res=dolibarr_set_const($db, "MEMBER_PAYONLINE_SENDEMAIL",$email,'chaine',0,'',$conf->entity);
if ($forcetype < 0) $res=dolibarr_del_const($db, "MEMBER_NEWFORM_FORCETYPE",$conf->entity);
else $res=dolibarr_set_const($db, "MEMBER_NEWFORM_FORCETYPE",$forcetype,'chaine',0,'',$conf->entity);

Expand Down Expand Up @@ -211,13 +209,6 @@ function initfields()
print $form->selectarray("MEMBER_NEWFORM_PAYONLINE",$listofval,(! empty($conf->global->MEMBER_NEWFORM_PAYONLINE)?$conf->global->MEMBER_NEWFORM_PAYONLINE:''),0);
print "</td></tr>\n";

// Jump to an online payment page
print '<tr class="oddeven" id="tremail"><td>';
print $langs->trans("MEMBER_PAYONLINE_SENDEMAIL");
print '</td><td align="right">';
print '<input type="text" id="MEMBER_PAYONLINE_SENDEMAIL" name="MEMBER_PAYONLINE_SENDEMAIL" size="24" value="'.(! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL)?$conf->global->MEMBER_PAYONLINE_SENDEMAIL:'').'">';
print "</td></tr>\n";

print '</table>';

print '<center>';
Expand Down
2 changes: 1 addition & 1 deletion htdocs/adherents/class/adherent.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1364,7 +1364,7 @@ function subscription($date, $amount, $accountid=0, $operation='', $label='', $n
* @param string $num_chq Numero cheque (if Id bank account provided)
* @param string $emetteur_nom Name of cheque writer
* @param string $emetteur_banque Name of bank of cheque
* @param string $autocreatethirdparty Auto create new thirdparty if member not linked to a thirdparty and we request an option that generate invoice.
* @param string $autocreatethirdparty Auto create new thirdparty if member not yet linked to a thirdparty and we request an option that generate invoice.
* @return int <0 if KO, >0 if OK
*/
function subscriptionComplementaryActions($subscriptionid, $option, $accountid, $datesubscription, $paymentdate, $operation, $label, $amount, $num_chq, $emetteur_nom='', $emetteur_banque='', $autocreatethirdparty=0)
Expand Down
2 changes: 1 addition & 1 deletion htdocs/admin/system/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
print '<table class="noborder" width="100%">';
print "<tr class=\"liste_titre\"><td colspan=\"2\">".$langs->trans("Browser")."</td></tr>\n";
print "<tr $bc[0]><td width=\"280\">".$langs->trans("UserAgent")."</td><td>" .$_SERVER["HTTP_USER_AGENT"]."</td></tr>\n";
print "<tr $bc[1]><td width=\"280\">".$langs->trans("Smartphone")."</td><td>".(empty($conf->browser->phone)?$langs->trans("No"):$conf->browser->phone)."</td></tr>\n";
print "<tr $bc[1]><td width=\"280\">".$langs->trans("Smartphone")."</td><td>".(($conf->browser->layout != 'phone')?$langs->trans("No"):$langs->trans("Yes"))."</td></tr>\n";
print '</table>';
print '<br>';

Expand Down
18 changes: 6 additions & 12 deletions htdocs/comm/action/class/actioncommreminder.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,38 +181,32 @@ static function LibStatut($status,$mode=0)
// phpcs:enable
global $langs;

if ($mode == 0)
if ($mode == 0 || $mode == 1)
{
$prefix='';
if ($status == 1) return $langs->trans('Done');
if ($status == 0) return $langs->trans('ToDo');
}
if ($mode == 1)
{
if ($status == 1) return $langs->trans('Done');
if ($status == 0) return $langs->trans('ToDo');
}
if ($mode == 2)
elseif ($mode == 2)
{
if ($status == 1) return img_picto($langs->trans('Done'),'statut4').' '.$langs->trans('Done');
if ($status == 0) return img_picto($langs->trans('ToDo'),'statut5').' '.$langs->trans('ToDo');
}
if ($mode == 3)
elseif ($mode == 3)
{
if ($status == 1) return img_picto($langs->trans('Done'),'statut4');
if ($status == 0) return img_picto($langs->trans('ToDo'),'statut5');
}
if ($mode == 4)
elseif ($mode == 4)
{
if ($status == 1) return img_picto($langs->trans('Done'),'statut4').' '.$langs->trans('Done');
if ($status == 0) return img_picto($langs->trans('ToDo'),'statut5').' '.$langs->trans('ToDo');
}
if ($mode == 5)
elseif ($mode == 5)
{
if ($status == 1) return $langs->trans('Done').' '.img_picto($langs->trans('Done'),'statut4');
if ($status == 0) return $langs->trans('ToDo').' '.img_picto($langs->trans('ToDo'),'statut5');
}
if ($mode == 6)
elseif ($mode == 6)
{
if ($status == 1) return $langs->trans('Done').' '.img_picto($langs->trans('Done'),'statut4');
if ($status == 0) return $langs->trans('ToDo').' '.img_picto($langs->trans('ToDo'),'statut5');
Expand Down
29 changes: 27 additions & 2 deletions htdocs/core/actions_setnotes.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,33 @@
{
if (empty($action) || ! is_object($object) || empty($id)) dol_print_error('','Include of actions_setnotes.inc.php was done but required variable was not set before');
if (empty($object->id)) $object->fetch($id); // Fetch may not be already done
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_public', 'none'), ENT_QUOTES),'_public');
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');

$result_update=$object->update_note(dol_html_entity_decode(GETPOST('note_public', 'none'), ENT_QUOTES),'_public');

if ($result_update < 0) setEventMessages($object->error, $object->errors, 'errors');
elseif (in_array($object->table_element, array('supplier_proposal', 'propal', 'commande_fournisseur', 'commande', 'facture_fourn', 'facture')))
{
// Define output language
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{
$outputlangs = $langs;
$newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
}
$model=$object->modelpdf;
$hidedetails = (GETPOST('hidedetails','int') ? GETPOST('hidedetails','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0));
$hidedesc = (GETPOST('hidedesc','int') ? GETPOST('hidedesc','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0));
$hideref = (GETPOST('hideref','int') ? GETPOST('hideref','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0));

$result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);

if ($result < 0) dol_print_error($db,$result);
}
}
}
// Set public note
else if ($action == 'setnote_private' && ! empty($permissionnote) && ! GETPOST('cancel','alpha'))
Expand Down
4 changes: 2 additions & 2 deletions htdocs/core/class/html.form.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1149,8 +1149,9 @@ function select_thirdparty_list($selected='',$htmlname='socid',$filter='',$showe
if (count($scrit) > 1) $sql.=")";
if (! empty($conf->barcode->enabled))
{
$sql .= " OR s.barcode LIKE '".$this->db->escape($filterkey)."%'";
$sql .= " OR s.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
}
$sql.= " OR s.code_client LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.code_fournisseur LIKE '".$this->db->escape($prefix.$filterkey)."%'";
$sql.=")";
}
$sql.=$this->db->order("nom","ASC");
Expand Down Expand Up @@ -4998,7 +4999,6 @@ function select_date($set_time='', $prefix='re', $h=0, $m=0, $empty=0, $form_nam
if (! empty($conf->use_javascript_ajax) && (empty($conf->global->MAIN_POPUP_CALENDAR) || $conf->global->MAIN_POPUP_CALENDAR != "none")) {
$usecalendar = ((empty($conf->global->MAIN_POPUP_CALENDAR) || $conf->global->MAIN_POPUP_CALENDAR == 'eldy')?'jquery':$conf->global->MAIN_POPUP_CALENDAR);
}
//if (! empty($conf->browser->phone)) $usecalendar='combo';

if ($d)
{
Expand Down
8 changes: 4 additions & 4 deletions htdocs/core/class/html.formfile.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class FormFile
* @var string Error code (or message)
*/
public $error;

public $numoffiles;
public $infofiles; // Used to return informations by function getDocumentsLink

Expand Down Expand Up @@ -678,7 +678,7 @@ function showdocuments($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed
$formadmin=new FormAdmin($this->db);
$defaultlang=$codelang?$codelang:$langs->getDefaultLang();
$morecss='maxwidth150';
if (! empty($conf->browser->phone)) $morecss='maxwidth100';
if ($conf->browser->layout == 'phone') $morecss='maxwidth100';
$out.= $formadmin->select_language($defaultlang, 'lang_id', 0, 0, 0, 0, 0, $morecss);
}
else
Expand Down Expand Up @@ -1318,7 +1318,7 @@ function list_of_documents($filearray,$object,$modulepart,$param='',$forcedownlo

if (empty($disablemove))
{
if ($nboffiles > 1 && empty($conf->browser->phone)) {
if ($nboffiles > 1 && $conf->browser->layout != 'phone') {
print '<td align="center" class="linecolmove tdlineupdown">';
if ($i > 0) {
print '<a class="lineupdown" href="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=up&amp;rowid='.$line->id.'">'.img_up('default',0,'imgupforline').'</a>';
Expand All @@ -1329,7 +1329,7 @@ function list_of_documents($filearray,$object,$modulepart,$param='',$forcedownlo
print '</td>';
}
else {
print '<td align="center"'.((empty($conf->browser->phone) && empty($disablemove)) ?' class="linecolmove tdlineupdown"':' class="linecolmove"').'>';
print '<td align="center"'.(($conf->browser->layout != 'phone' && empty($disablemove)) ?' class="linecolmove tdlineupdown"':' class="linecolmove"').'>';
print '</td>';
}
}
Expand Down
8 changes: 4 additions & 4 deletions htdocs/core/class/html.formother.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
class FormOther
{
private $db;

/**
* @var string Error code (or message)
*/
Expand Down Expand Up @@ -1029,7 +1029,7 @@ static function getBoxesArea($user,$areacode)
if (! empty($boxidactivatedforuser[$box->id])) continue; // Already visible for user
$label=$langs->transnoentitiesnoconv($box->boxlabel);
//if (preg_match('/graph/',$box->class)) $label.=' ('.$langs->trans("Graph").')';
if (preg_match('/graph/',$box->class) && empty($conf->browser->phone))
if (preg_match('/graph/',$box->class) && $conf->browser->layout != 'phone')
{
$label=$label.' <span class="fa fa-bar-chart"></span>';
}
Expand Down Expand Up @@ -1163,7 +1163,7 @@ function updateBoxOrder(closing) {
}
}

if (empty($conf->browser->phone))
if ($conf->browser->layout != 'phone')
{
$emptybox->box_id='A';
$emptybox->info_box_head=array();
Expand All @@ -1190,7 +1190,7 @@ function updateBoxOrder(closing) {
}
}

if (empty($conf->browser->phone))
if ($conf->browser->layout != 'phone')
{
$emptybox->box_id='B';
$emptybox->info_box_head=array();
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/get_info.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@

// Link to print main content area
/*
if (empty($conf->global->MAIN_PRINT_DISABLELINK) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && empty($conf->browser->phone))
if (empty($conf->global->MAIN_PRINT_DISABLELINK) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && $conf->browser->layout != 'phone')
{
$qs=dol_escape_htmltag($_SERVER["QUERY_STRING"]);
Expand Down
8 changes: 4 additions & 4 deletions htdocs/core/lib/agenda.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh

print '<div class="fichecenter">';

if (! empty($conf->browser->phone)) print '<div class="fichehalfleft">';
if ($conf->browser->layout == 'phone') print '<div class="fichehalfleft">';
else print '<table class="nobordernopadding" width="100%"><tr><td class="borderright">';

print '<table class="nobordernopadding centpercent">';
Expand Down Expand Up @@ -180,10 +180,10 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh

print '</table>';

if (! empty($conf->browser->phone)) print '</div>';
if ($conf->browser->layout == 'phone') print '</div>';
else print '</td>';

if (! empty($conf->browser->phone)) print '<div class="fichehalfright">';
if ($conf->browser->layout == 'phone') print '<div class="fichehalfright">';
else print '<td align="center" valign="middle" class="nowrap">';

print '<table class="centpercent"><tr><td align="center">';
Expand All @@ -193,7 +193,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
print '</td></tr>';
print '</table>';

if (! empty($conf->browser->phone)) print '</div>';
if ($conf->browser->layout == 'phone') print '</div>';
else print '</td></tr></table>';

print '</div>'; // Close fichecenter
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/lib/ajax.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $

// select2 disabled for smartphones with standard browser.
// TODO With select2 v4, it seems ok, except that responsive style on table become crazy when scrolling at end of array)
if (! empty($conf->browser->phone)) return '';
if ($conf->browser->layout == 'phone') return '';

if (! empty($conf->global->MAIN_DISABLE_AJAX_COMBOX)) return '';
if (empty($conf->use_javascript_ajax)) return '';
Expand Down
6 changes: 3 additions & 3 deletions htdocs/core/lib/functions.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1353,7 +1353,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
$width=80; $cssclass='photoref';
$showimage=$object->is_photo_available($conf->product->multidir_output[$entity]);
$maxvisiblephotos=(isset($conf->global->PRODUCT_MAX_VISIBLE_PHOTO)?$conf->global->PRODUCT_MAX_VISIBLE_PHOTO:5);
if ($conf->browser->phone) $maxvisiblephotos=1;
if ($conf->browser->layout == 'phone') $maxvisiblephotos=1;
if ($showimage) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$object->show_photos('product', $conf->product->multidir_output[$entity],'small',$maxvisiblephotos,0,0,0,$width,0).'</div>';
else
{
Expand All @@ -1372,7 +1372,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
$width=80; $cssclass='photoref';
$showimage=$object->is_photo_available($conf->ticket->multidir_output[$entity].'/'.$object->track_id);
$maxvisiblephotos=(isset($conf->global->TICKETSUP_MAX_VISIBLE_PHOTO)?$conf->global->TICKETSUP_MAX_VISIBLE_PHOTO:2);
if ($conf->browser->phone) $maxvisiblephotos=1;
if ($conf->browser->layout == 'phone') $maxvisiblephotos=1;
if ($showimage) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$object->show_photos('ticket', $conf->ticket->multidir_output[$entity],'small',$maxvisiblephotos,0,0,0,$width,0).'</div>';
else
{
Expand Down Expand Up @@ -2549,7 +2549,7 @@ function dol_print_phone($phone,$countrycode='',$cid=0,$socid=0,$addlink='',$sep
}
if (! empty($addlink)) // Link on phone number (+ link to add action if conf->global->AGENDA_ADDACTIONFORPHONE set)
{
if (! empty($conf->browser->phone) || (! empty($conf->clicktodial->enabled) && ! empty($conf->global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS))) // If phone or option for, we use link of phone
if ($conf->browser->layout == 'phone' || (! empty($conf->clicktodial->enabled) && ! empty($conf->global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS))) // If phone or option for, we use link of phone
{
$newphone ='<a href="tel:'.$phone.'"';
$newphone.='>'.$phone.'</a>';
Expand Down
12 changes: 10 additions & 2 deletions htdocs/core/lib/pdf.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1195,8 +1195,16 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
$note=(! empty($object->lines[$i]->note)?$object->lines[$i]->note:'');
$dbatch=(! empty($object->lines[$i]->detail_batch)?$object->lines[$i]->detail_batch:false);

if ($issupplierline) $prodser = new ProductFournisseur($db);
else $prodser = new Product($db);
if ($issupplierline)
{
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
$prodser = new ProductFournisseur($db);
}
else
{
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$prodser = new Product($db);
}

if ($idprod)
{
Expand Down
Loading

0 comments on commit e13a8ec

Please sign in to comment.