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

This commit is contained in:
Laurent Destailleur 2017-10-11 12:21:52 +02:00
commit 1e7f726168
11 changed files with 105 additions and 88 deletions

View File

@ -366,7 +366,7 @@ if ($mode == 'desc')
if ($mode == 'feature') if ($mode == 'feature')
{ {
$text.='<br><strong>'.$langs->trans("DependsOn").':</strong> '; $text.='<br><strong>'.$langs->trans("DependsOn").':</strong> ';
if (count($objMod->requiredby)) $text.=join(',', $objMod->depends); if (count($objMod->depends)) $text.=join(',', $objMod->depends);
else $text.=$langs->trans("None"); else $text.=$langs->trans("None");
$text.='<br><strong>'.$langs->trans("RequiredBy").':</strong> '; $text.='<br><strong>'.$langs->trans("RequiredBy").':</strong> ';
if (count($objMod->requiredby)) $text.=join(',', $objMod->requiredby); if (count($objMod->requiredby)) $text.=join(',', $objMod->requiredby);

View File

@ -623,7 +623,7 @@ if ($mode == 'common')
$imginfo="info_black"; $imginfo="info_black";
} }
print '<tr>'."\n"; print '<tr class="oddeven">'."\n";
// Picto + Name of module // Picto + Name of module
print ' <td width="200px">'; print ' <td width="200px">';

View File

@ -747,7 +747,7 @@ class ExtraFields
$this->attribute_pos[$tab->name]=$tab->pos; $this->attribute_pos[$tab->name]=$tab->pos;
$this->attribute_alwayseditable[$tab->name]=$tab->alwayseditable; $this->attribute_alwayseditable[$tab->name]=$tab->alwayseditable;
$this->attribute_perms[$tab->name]=$tab->perms; $this->attribute_perms[$tab->name]=$tab->perms;
$this->attribute_langfile[$tab->langs]=$tab->langs; $this->attribute_langfile[$tab->name]=$tab->langs;
$this->attribute_list[$tab->name]=$tab->list; $this->attribute_list[$tab->name]=$tab->list;
$this->attribute_hidden[$tab->name]=$tab->ishidden; $this->attribute_hidden[$tab->name]=$tab->ishidden;
$this->attribute_entityid[$tab->name]=$tab->entity; $this->attribute_entityid[$tab->name]=$tab->entity;

View File

@ -4750,7 +4750,9 @@ class Form
// You can set MAIN_POPUP_CALENDAR to 'eldy' or 'jquery' // You can set MAIN_POPUP_CALENDAR to 'eldy' or 'jquery'
$usecalendar='combo'; $usecalendar='combo';
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)?'jquery':$conf->global->MAIN_POPUP_CALENDAR; 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 (! empty($conf->browser->phone)) $usecalendar='combo';
if ($d) if ($d)
@ -4795,7 +4797,6 @@ class Form
{ {
$retstring.="<script type='text/javascript'>"; $retstring.="<script type='text/javascript'>";
$retstring.="$(function(){ $('#".$prefix."').datepicker({ $retstring.="$(function(){ $('#".$prefix."').datepicker({
dateFormat: '".$langs->trans("FormatDateShortJQueryInput")."',
autoclose: true, autoclose: true,
todayHighlight: true,"; todayHighlight: true,";
if (empty($conf->global->MAIN_POPUP_CALENDAR_ON_FOCUS)) if (empty($conf->global->MAIN_POPUP_CALENDAR_ON_FOCUS))

View File

@ -45,68 +45,68 @@ else header('Cache-Control: no-cache');
// Define tradMonths javascript array (we define this in datepicker AND in parent page to avoid errors with IE8) // Define tradMonths javascript array (we define this in datepicker AND in parent page to avoid errors with IE8)
$tradMonths=array( $tradMonths=array(
dol_escape_js($langs->transnoentitiesnoconv("January")), dol_escape_js($langs->transnoentitiesnoconv("January")),
dol_escape_js($langs->transnoentitiesnoconv("February")), dol_escape_js($langs->transnoentitiesnoconv("February")),
dol_escape_js($langs->transnoentitiesnoconv("March")), dol_escape_js($langs->transnoentitiesnoconv("March")),
dol_escape_js($langs->transnoentitiesnoconv("April")), dol_escape_js($langs->transnoentitiesnoconv("April")),
dol_escape_js($langs->transnoentitiesnoconv("May")), dol_escape_js($langs->transnoentitiesnoconv("May")),
dol_escape_js($langs->transnoentitiesnoconv("June")), dol_escape_js($langs->transnoentitiesnoconv("June")),
dol_escape_js($langs->transnoentitiesnoconv("July")), dol_escape_js($langs->transnoentitiesnoconv("July")),
dol_escape_js($langs->transnoentitiesnoconv("August")), dol_escape_js($langs->transnoentitiesnoconv("August")),
dol_escape_js($langs->transnoentitiesnoconv("September")), dol_escape_js($langs->transnoentitiesnoconv("September")),
dol_escape_js($langs->transnoentitiesnoconv("October")), dol_escape_js($langs->transnoentitiesnoconv("October")),
dol_escape_js($langs->transnoentitiesnoconv("November")), dol_escape_js($langs->transnoentitiesnoconv("November")),
dol_escape_js($langs->transnoentitiesnoconv("December")) dol_escape_js($langs->transnoentitiesnoconv("December"))
); );
$tradMonthsShort=array( $tradMonthsShort=array(
$langs->trans("JanuaryMin"), $langs->trans("JanuaryMin"),
$langs->trans("FebruaryMin"), $langs->trans("FebruaryMin"),
$langs->trans("MarchMin"), $langs->trans("MarchMin"),
$langs->trans("AprilMin"), $langs->trans("AprilMin"),
$langs->trans("MayMin"), $langs->trans("MayMin"),
$langs->trans("JuneMin"), $langs->trans("JuneMin"),
$langs->trans("JulyMin"), $langs->trans("JulyMin"),
$langs->trans("AugustMin"), $langs->trans("AugustMin"),
$langs->trans("SeptemberMin"), $langs->trans("SeptemberMin"),
$langs->trans("OctoberMin"), $langs->trans("OctoberMin"),
$langs->trans("NovemberMin"), $langs->trans("NovemberMin"),
$langs->trans("DecemberMin") $langs->trans("DecemberMin")
); );
$tradDays=array( $tradDays=array(
$langs->trans("Sunday"), $langs->trans("Sunday"),
$langs->trans("Monday"), $langs->trans("Monday"),
$langs->trans("Tuesday"), $langs->trans("Tuesday"),
$langs->trans("Wednesday"), $langs->trans("Wednesday"),
$langs->trans("Thursday"), $langs->trans("Thursday"),
$langs->trans("Friday"), $langs->trans("Friday"),
$langs->trans("Saturday") $langs->trans("Saturday")
); );
$tradDaysShort=array( $tradDaysShort=array(
$langs->trans("ShortSunday"), $langs->trans("ShortSunday"),
$langs->trans("ShortMonday"), $langs->trans("ShortMonday"),
$langs->trans("ShortTuesday"), $langs->trans("ShortTuesday"),
$langs->trans("ShortWednesday"), $langs->trans("ShortWednesday"),
$langs->trans("ShortThursday"), $langs->trans("ShortThursday"),
$langs->trans("ShortFriday"), $langs->trans("ShortFriday"),
$langs->trans("ShortSaturday") $langs->trans("ShortSaturday")
); );
$tradDaysMin=array( $tradDaysMin=array(
$langs->trans("SundayMin"), $langs->trans("SundayMin"),
$langs->trans("MondayMin"), $langs->trans("MondayMin"),
$langs->trans("TuesdayMin"), $langs->trans("TuesdayMin"),
$langs->trans("WednesdayMin"), $langs->trans("WednesdayMin"),
$langs->trans("ThursdayMin"), $langs->trans("ThursdayMin"),
$langs->trans("FridayMin"), $langs->trans("FridayMin"),
$langs->trans("SaturdayMin") $langs->trans("SaturdayMin")
); );
?> ?>
// For eldy and jQuery date picker // For jQuery date picker
var tradMonths = <?php echo json_encode($tradMonths) ?>; var tradMonths = <?php echo json_encode($tradMonths) ?>;
var tradMonthsShort = <?php echo json_encode($tradMonthsShort) ?>; var tradMonthsShort = <?php echo json_encode($tradMonthsShort) ?>;
var tradDays = <?php echo json_encode($tradDays) ?>; var tradDays = <?php echo json_encode($tradDays) ?>;
@ -140,8 +140,8 @@ jQuery(function($){
dateFormat: '<?php echo $langs->trans("FormatDateShortJQuery"); ?>', dateFormat: '<?php echo $langs->trans("FormatDateShortJQuery"); ?>',
firstDay: <?php echo (isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:'1'); ?>, firstDay: <?php echo (isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:'1'); ?>,
isRTL: <?php echo ($langs->trans("DIRECTION")=='rtl'?'true':'false'); ?>, isRTL: <?php echo ($langs->trans("DIRECTION")=='rtl'?'true':'false'); ?>,
showMonthAfterYear: false, // TODO add specific to country showMonthAfterYear: false, /* TODO add specific to country */
yearSuffix: '' // TODO add specific to country yearSuffix: '' /* TODO add specific to country */
}; };
$.datepicker.setDefaults($.datepicker.regional['<?php echo $langs->defaultlang ?>']); $.datepicker.setDefaults($.datepicker.regional['<?php echo $langs->defaultlang ?>']);
}); });

View File

@ -2194,9 +2194,21 @@ function dol_print_phone($phone,$countrycode='',$cid=0,$socid=0,$addlink='',$sep
$titlealt=($withpicto=='fax'?$langs->trans("Fax"):$langs->trans("Phone")); $titlealt=($withpicto=='fax'?$langs->trans("Fax"):$langs->trans("Phone"));
} }
$rep=''; $rep='';
$picto = '';
if($withpicto){
if($withpicto=='fax'){
$picto = 'phoning_fax';
}elseif($withpicto=='phone'){
$picto = 'phoning';
}elseif($withpicto=='mobile'){
$picto = 'phoning_mobile';
}else{
$picto = '';
}
}
if ($adddivfloat) $rep.='<div class="nospan float" style="margin-right: 10px">'; if ($adddivfloat) $rep.='<div class="nospan float" style="margin-right: 10px">';
else $rep.='<span style="margin-right: 10px;">'; else $rep.='<span style="margin-right: 10px;">';
$rep.=($withpicto?img_picto($titlealt, 'object_'.($withpicto=='fax'?'phoning_fax':'phoning').'.png').' ':'').$newphone; $rep.=($withpicto?img_picto($titlealt, 'object_'.$picto.'.png').' ':'').$newphone;
if ($adddivfloat) $rep.='</div>'; if ($adddivfloat) $rep.='</div>';
else $rep.='</span>'; else $rep.='</span>';
return $rep; return $rep;

View File

@ -1566,7 +1566,7 @@ class pdf_crabe extends ModelePDFFactures
if ($object->type == 1) $title=$outputlangs->transnoentities("InvoiceReplacement"); if ($object->type == 1) $title=$outputlangs->transnoentities("InvoiceReplacement");
if ($object->type == 2) $title=$outputlangs->transnoentities("InvoiceAvoir"); if ($object->type == 2) $title=$outputlangs->transnoentities("InvoiceAvoir");
if ($object->type == 3) $title=$outputlangs->transnoentities("InvoiceDeposit"); if ($object->type == 3) $title=$outputlangs->transnoentities("InvoiceDeposit");
if ($object->type == 4) $title=$outputlangs->transnoentities("InvoiceProFormat"); if ($object->type == 4) $title=$outputlangs->transnoentities("InvoiceProForma");
if ($this->situationinvoice) $title=$outputlangs->transnoentities("InvoiceSituation"); if ($this->situationinvoice) $title=$outputlangs->transnoentities("InvoiceSituation");
$pdf->MultiCell($w, 3, $title, '', 'R'); $pdf->MultiCell($w, 3, $title, '', 'R');

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2010-2017 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2010-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2012-2017 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
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -61,39 +61,43 @@ print "</tr>\n";
if (count($extrafields->attribute_type)) if (count($extrafields->attribute_type))
{ {
foreach($extrafields->attribute_type as $key => $value) foreach($extrafields->attribute_type as $key => $value)
{ {
// Load language if required
if (! empty($extrafields->attribute_langfile[$key])) {
$langs->load($extrafields->attribute_langfile[$key]);
}
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print "<td>".$extrafields->attribute_pos[$key]."</td>\n"; print "<td>".$extrafields->attribute_pos[$key]."</td>\n";
print "<td>".$extrafields->attribute_label[$key]."</td>\n"; print "<td>".$extrafields->attribute_label[$key]."</td>\n"; // We don't translate here, we want admin to know what is the key not translated value
print "<td>".$key."</td>\n"; print "<td>".$key."</td>\n";
print "<td>".$type2label[$extrafields->attribute_type[$key]]."</td>\n"; print "<td>".$type2label[$extrafields->attribute_type[$key]]."</td>\n";
print '<td align="right">'.$extrafields->attribute_size[$key]."</td>\n"; print '<td align="right">'.$extrafields->attribute_size[$key]."</td>\n";
print '<td align="center">'.yn($extrafields->attribute_unique[$key])."</td>\n"; print '<td align="center">'.yn($extrafields->attribute_unique[$key])."</td>\n";
print '<td>'.dol_trunc($extrafields->attribute_computed[$key], 20)."</td>\n"; print '<td>'.dol_trunc($extrafields->attribute_computed[$key], 20)."</td>\n";
print '<td align="center">'.yn($extrafields->attribute_required[$key])."</td>\n"; print '<td align="center">'.yn($extrafields->attribute_required[$key])."</td>\n";
print '<td align="center">'.yn($extrafields->attribute_alwayseditable[$key])."</td>\n"; print '<td align="center">'.yn($extrafields->attribute_alwayseditable[$key])."</td>\n";
print '<td align="center">'.$extrafields->attribute_list[$key]."</td>\n"; print '<td align="center">'.$extrafields->attribute_list[$key]."</td>\n";
if (! empty($conf->global->MAIN_CAN_HIDE_EXTRAFIELDS)) print '<td align="center">'.yn($extrafields->attribute_hidden[$key])."</td>\n"; // Add hidden option on not working feature. Why hide if user can't see it. if (! empty($conf->global->MAIN_CAN_HIDE_EXTRAFIELDS)) print '<td align="center">'.yn($extrafields->attribute_hidden[$key])."</td>\n"; // Add hidden option on not working feature. Why hide if user can't see it.
if ($conf->multicompany->enabled) { if (! empty($conf->multicompany->enabled)) {
print '<td align="center">'.($extrafields->attribute_entityid[$key]==0?$langs->trans("All"):$extrafields->attribute_entitylabel[$key]).'</td>'; print '<td align="center">'.($extrafields->attribute_entityid[$key]==0?$langs->trans("All"):$extrafields->attribute_entitylabel[$key]).'</td>';
} }
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=edit&attrname='.$key.'">'.img_edit().'</a>'; print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=edit&attrname='.$key.'">'.img_edit().'</a>';
print "&nbsp; <a href=\"".$_SERVER["PHP_SELF"]."?action=delete&attrname=$key\">".img_delete()."</a></td>\n"; print "&nbsp; <a href=\"".$_SERVER["PHP_SELF"]."?action=delete&attrname=$key\">".img_delete()."</a></td>\n";
print "</tr>"; print "</tr>";
} }
} }
else else
{ {
$colspan=9; $colspan=9;
if (! empty($conf->global->MAIN_CAN_HIDE_EXTRAFIELDS)) $colspan++; if (! empty($conf->global->MAIN_CAN_HIDE_EXTRAFIELDS)) $colspan++;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td class="opacitymedium" colspan="'.$colspan.'">'; print '<td class="opacitymedium" colspan="'.$colspan.'">';
print $langs->trans("None"); print $langs->trans("None");
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
} }
print "</table>"; print "</table>";

View File

@ -1322,11 +1322,11 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
print '<!-- Includes JS of Dolibarr -->'."\n"; print '<!-- Includes JS of Dolibarr -->'."\n";
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/core/js/lib_head.js.php?lang='.$langs->defaultlang.($ext?'&amp;'.$ext:'').'"></script>'."\n"; print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/core/js/lib_head.js.php?lang='.$langs->defaultlang.($ext?'&amp;'.$ext:'').'"></script>'."\n";
// Add datepicker default options // Add datepicker default options (needed by jquery datepicker!)
/*if (! defined('DISABLE_DATE_PICKER')) if (! defined('DISABLE_DATE_PICKER'))
{ {
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/core/js/datepicker.js.php?lang='.$langs->defaultlang.($ext?'&'.$ext:'').'"></script>'."\n"; print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/core/js/datepicker.js.php?lang='.$langs->defaultlang.($ext?'&'.$ext:'').'"></script>'."\n";
}*/ }
// JS forced by modules (relative url starting with /) // JS forced by modules (relative url starting with /)
if (! empty($conf->modules_parts['js'])) // $conf->modules_parts['js'] is array('module'=>array('file1','file2')) if (! empty($conf->modules_parts['js'])) // $conf->modules_parts['js'] is array('module'=>array('file1','file2'))

Binary file not shown.

After

Width:  |  Height:  |  Size: 435 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 435 B