Skip to content

Commit

Permalink
Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into d…
Browse files Browse the repository at this point in the history
…evelop
  • Loading branch information
ldestailleur committed Jan 2, 2019
2 parents bc00fb1 + f965e9e commit 7cb3b8d
Show file tree
Hide file tree
Showing 21 changed files with 262 additions and 320 deletions.
2 changes: 1 addition & 1 deletion htdocs/admin/export.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
// Subheader
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">'
. $langs->trans("BackToModuleList") . '</a>';
print_fiche_titre($langs->trans($page_name), $linkback);
print load_fiche_titre($langs->trans($page_name), $linkback);

// Configuration header

Expand Down
432 changes: 180 additions & 252 deletions htdocs/admin/stock.php

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions htdocs/admin/ticket.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@
* Projects Numbering model
*/

print_titre($langs->trans("TicketNumberingModules"));
print load_fiche_titre($langs->trans("TicketNumberingModules"));

print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
Expand Down Expand Up @@ -353,7 +353,7 @@
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="action" value="setvarother">';
}
print_titre($langs->trans("TicketParamPublicInterface"));
print load_fiche_titre($langs->trans("TicketParamPublicInterface"));

print '<table class="noborder" width="100%">';

Expand Down Expand Up @@ -422,7 +422,7 @@

print '</table><br>';

print_titre($langs->trans("TicketParams"));
print load_fiche_titre($langs->trans("TicketParams"));
print '<table class="noborder" width="100%">';

// Activate email notifications
Expand Down Expand Up @@ -515,7 +515,7 @@
}

// Admin var of module
print_titre($langs->trans("TicketParamMail"));
print load_fiche_titre($langs->trans("TicketParamMail"));

print '<table class="noborder" width="100%">';

Expand Down
4 changes: 2 additions & 2 deletions htdocs/admin/ticket_extrafields.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@

if ($action == 'create') {
print "<br>";
print_titre($langs->trans('NewAttribute'));
print load_fiche_titre($langs->trans('NewAttribute'));

include DOL_DOCUMENT_ROOT . '/core/tpl/admin_extrafields_add.tpl.php';
}
Expand All @@ -104,7 +104,7 @@
/* ************************************************************************** */
if ($action == 'edit' && !empty($attrname)) {
print "<br>";
print_titre($langs->trans("FieldEdition", $attrname));
print load_fiche_titre($langs->trans("FieldEdition", $attrname));

include DOL_DOCUMENT_ROOT . '/core/tpl/admin_extrafields_edit.tpl.php';
}
Expand Down
2 changes: 1 addition & 1 deletion htdocs/compta/charges/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@

print "<br>";

print_fiche_titre( $langs->trans("SalariesPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', '');
print load_fiche_titre( $langs->trans("SalariesPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', '');

$sql = "SELECT s.rowid, s.amount, s.label, s.datep as datep, s.datev as datev, s.datesp, s.dateep, s.salary, s.fk_bank, u.salary as current_salary,";
$sql.= " pct.code as payment_code,";
Expand Down
2 changes: 1 addition & 1 deletion htdocs/compta/sociales/payments.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@

print "<br>";

print_fiche_titre($langs->trans("SalariesPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', '');
print load_fiche_titre($langs->trans("SalariesPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', '');

$sql = "SELECT s.rowid, s.amount, s.label, s.datep as datep, s.datev as datev, s.datesp, s.dateep, s.salary, u.salary as current_salary";
$sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as s, ".MAIN_DB_PREFIX."user as u";
Expand Down
4 changes: 2 additions & 2 deletions htdocs/contact/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@
// Jabber
if (! empty($conf->global->SOCIALNETWORKS_JABBER))
{
print '<tr><td><label for="skype">'.fieldLabel('Jabber','jabberid').'</label></td>';
print '<tr><td><label for="skype">'.$form->editfieldkey('Jabber','jabberid', '', $object, 0).'</label></td>';
print '<td colspan="3"><input type="text" name="jabberid" id="jabberid" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOSTISSET("jabberid")?GETPOST("jabberid",'alpha'):$object->jabberid).'"></td></tr>';
}
// Skype
Expand Down Expand Up @@ -968,7 +968,7 @@
// Jabber ID
if (! empty($conf->global->SOCIALNETWORKS_JABBER))
{
print '<tr><td><label for="jabberid">'.fieldLabel('Jabber','jabberid').'</label></td>';
print '<tr><td><label for="jabberid">'.$form->editfieldkey('Jabber','jabberid', '', $object, 0).'</label></td>';
print '<td><input type="text" name="jabberid" id="jabberid" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOSTISSET("jabberid")?GETPOST("jabberid",'alpha'):$object->jabberid).'"></td></tr>';
}
// Skype
Expand Down
42 changes: 0 additions & 42 deletions htdocs/core/lib/functions.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,48 +39,6 @@
include_once DOL_DOCUMENT_ROOT .'/core/lib/json.lib.php';


/**
* Function to return value of a static property when class
* name is dynamically defined (not hard coded).
* This is because $myclass::$myvar works from PHP 5.3.0+ only
*
* @param string $class Class name
* @param string $member Name of property
* @return mixed Return value of static property
* @deprecated Dolibarr now requires 5.3.0+, use $class::$property syntax
* @see https://php.net/manual/language.oop5.static.php
*/
function getStaticMember($class, $member)
{
dol_syslog(__FUNCTION__ . " is deprecated", LOG_WARNING);

// This part is deprecated. Uncomment if for php 5.2.*, and comment next isset class::member
/*if (version_compare(phpversion(), '5.3.0', '<'))
{
if (is_object($class)) $class = get_class($class);
$classObj = new ReflectionClass($class);
$result = null;
$found=0;
foreach($classObj->getStaticProperties() as $prop => $value)
{
if ($prop == $member)
{
$result = $value;
$found++;
break;
}
}
if ($found) return $result;
}*/

if (isset($class::$member)) return $class::$member;
dol_print_error('','Try to get a static member "'.$member.'" in class "'.$class.'" that does not exists or is not static.');
return null;
}


/**
* Return a DoliDB instance (database handler).
*
Expand Down
4 changes: 2 additions & 2 deletions htdocs/core/tpl/advtarget.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
</script>';


print_fiche_titre($langs->trans("AdvTgtTitle"));
print load_fiche_titre($langs->trans("AdvTgtTitle"));

print '<div class="tabBar">' . "\n";
print '<form name="find_customer" id="find_customer" action="' . $_SERVER['PHP_SELF'] . '?id=' . $id . '" method="POST">' . "\n";
Expand Down Expand Up @@ -520,7 +520,7 @@

print '<form action="' . $_SERVER['PHP_SELF'] . '?action=clear&id=' . $object->id . '" method="POST">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print_titre($langs->trans("ToClearAllRecipientsClickHere"));
print load_fiche_titre($langs->trans("ToClearAllRecipientsClickHere"));
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td class="liste_titre" align="right"><input type="submit" class="button" value="' . $langs->trans("TargetsReset") . '"></td>';
Expand Down
2 changes: 1 addition & 1 deletion htdocs/holiday/month_report.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

llxHeader('', $langs->trans('CPTitreMenu'));

print_fiche_titre($langs->trans('MenuReportMonth'));
print load_fiche_titre($langs->trans('MenuReportMonth'));

$html = new Form($db);
$formother = new FormOther($db);
Expand Down
2 changes: 2 additions & 0 deletions htdocs/langs/en_US/cashdesk.lang
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@ OrderPrinters=Order printers
SearchProduct=Search product
Receipt=Receipt
AmountAtEndOfPeriod=Amount at end of period (day, month or year)
Header=Header
Footer=Footer
2 changes: 2 additions & 0 deletions htdocs/langs/es_ES/cashdesk.lang
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@ TakeposConnectorNecesary='Conector TakePOS' requerido
OrderPrinters=Impresoras de pedidos
SearchProduct=Buscar producto
Receipt=Comprobante
Header=Cabecera
Footer=Pie de página
2 changes: 2 additions & 0 deletions htdocs/langs/fr_FR/cashdesk.lang
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@ TakeposConnectorNecesary='Connecteur TakePOS' requis
OrderPrinters=Commande imprimantes
SearchProduct=Rechercher un produit
Receipt=Le reçu
Header=Entête
Footer=Bas de page
2 changes: 1 addition & 1 deletion htdocs/margin/checkMargins.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@

llxHeader('', $title);

// print_fiche_titre($text);
// print load_fiche_titre($text);

$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/product/stock/product.php
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@

if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE)) {
print '<br><br>';
print_titre($langs->trans('AddNewProductStockWarehouse'));
print load_fiche_titre($langs->trans('AddNewProductStockWarehouse'));

if (!empty($user->rights->produit->creer)) {
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
Expand Down
41 changes: 41 additions & 0 deletions htdocs/takepos/admin/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
require '../../main.inc.php'; // Load $user and permissions
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';

// If socid provided by ajax company selector
if (! empty($_REQUEST['CASHDESK_ID_THIRDPARTY_id']))
Expand Down Expand Up @@ -59,6 +60,8 @@
$res = dolibarr_set_const($db,"TAKEPOS_BAR_RESTAURANT", GETPOST('TAKEPOS_BAR_RESTAURANT','alpha'),'chaine',0,'',$conf->entity);
$res = dolibarr_set_const($db,"TAKEPOS_PRINT_SERVER", GETPOST('TAKEPOS_PRINT_SERVER','alpha'),'chaine',0,'',$conf->entity);
$res = dolibarr_set_const($db,"TAKEPOS_ORDER_PRINTERS", GETPOST('TAKEPOS_ORDER_PRINTERS','alpha'),'chaine',0,'',$conf->entity);
$res = dolibarr_set_const($db,"TAKEPOS_HEADER", GETPOST('TAKEPOS_HEADER','alpha'),'chaine',0,'',$conf->entity);
$res = dolibarr_set_const($db,"TAKEPOS_FOOTER", GETPOST('TAKEPOS_FOOTER','alpha'),'chaine',0,'',$conf->entity);

dol_syslog("admin/cashdesk: level ".GETPOST('level','alpha'));

Expand Down Expand Up @@ -140,6 +143,44 @@
print '</td></tr>';
}

$substitutionarray=pdf_getSubstitutionArray($langs, null, null, 2);
$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
$htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
foreach($substitutionarray as $key => $val) $htmltext.=$key.'<br>';
$htmltext.='</i>';

print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("FreeLegalTextOnInvoices")." - ".$langs->trans("Header"), $htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
print '</td><td>';
$variablename='TAKEPOS_HEADER';
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
}
else
{
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_notes');
print $doleditor->Create();
}
print "</td></tr>\n";

print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("FreeLegalTextOnInvoices")." - ".$langs->trans("Footer"), $htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
print '</td><td>';
$variablename='TAKEPOS_FOOTER';
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
}
else
{
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_notes');
print $doleditor->Create();
}
print "</td></tr>\n";

print '</table>';

print '<br>';
Expand Down
20 changes: 14 additions & 6 deletions htdocs/takepos/receipt.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,14 @@
</center>
<br>
<p align="left">
<?php print dol_nl2br(dol_format_address($mysoc)).'<br>'.$langs->trans("Phone").': '.$mysoc->phone;
?>

<?php
$substitutionarray=getCommonSubstitutionArray($langs);
if (! empty($conf->global->TAKEPOS_HEADER))
{
$newfreetext=make_substitutions($conf->global->TAKEPOS_HEADER,$substitutionarray);
echo $newfreetext;
}
?>
</p>
<p align="right">
<?php
Expand Down Expand Up @@ -107,9 +112,12 @@
<br>
<br>
<?php
echo $langs->trans("Cashier: ");
echo $user->firstname.'<br>'.$mysoc->url.'<br>';
echo '<center>'.$langs->trans("Thanks for your coming !").'</center>';
$substitutionarray=getCommonSubstitutionArray($langs);
if (! empty($conf->global->TAKEPOS_FOOTER))
{
$newfreetext=make_substitutions($conf->global->TAKEPOS_FOOTER,$substitutionarray);
echo $newfreetext;
}
?>

<script type="text/javascript">
Expand Down
2 changes: 1 addition & 1 deletion htdocs/ticket/class/actions_ticket.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,7 @@ public function viewTicketMessages($show_private, $show_user = true)
$this->viewTicketOriginalMessage($user, $action);

if (is_array($this->dao->cache_msgs_ticket) && count($this->dao->cache_msgs_ticket) > 0) {
print_titre($langs->trans('TicketMailExchanges'));
print load_fiche_titre($langs->trans('TicketMailExchanges'));

print '<table class="border" style="width:100%;">';

Expand Down
2 changes: 1 addition & 1 deletion htdocs/ticket/tpl/linkedobjectblock.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
$langs->load('ticket');
$linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
echo '<br>';
print_titre($langs->trans('RelatedTickets'));
print load_fiche_titre($langs->trans('RelatedTickets'));
?>
<table class="noborder" width="100%">
<tr class="liste_titre">
Expand Down
2 changes: 1 addition & 1 deletion htdocs/variants/combinations.php
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@
} else {
$title = $langs->trans('EditProductCombination');
}
print_fiche_titre($title);
print load_fiche_titre($title);

if ($action == 'add') {
$prodattr_all = $prodattr->fetchAll();
Expand Down
3 changes: 2 additions & 1 deletion htdocs/website/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2333,6 +2333,7 @@

if (GETPOST('WEBSITE_REF')) $siteref=GETPOST('WEBSITE_REF','alpha');
if (GETPOST('WEBSITE_DESCRIPTION')) $sitedesc=GETPOST('WEBSITE_DESCRIPTION','alpha');
if (GETPOST('WEBSITE_VIRTUALHOST')) $sitevhost=GETPOST('WEBSITE_VIRTUALHOST','alpha');

print '<tr><td class="titlefieldcreate fieldrequired">';
print $langs->trans('Ref');
Expand All @@ -2354,7 +2355,7 @@

print $form->textwithpicto($langs->trans('Virtualhost'), $htmltext, 1, 'help', '', 0, 2, 'tooltipvirtual');
print '</td><td>';
print '<input type="text" class="flat minwidth300" name="WEBSITE_DESCRIPTION" value="'.dol_escape_htmltag($sitedesc).'">';
print '<input type="text" class="flat minwidth300" name="WEBSITE_VIRTUALHOST" value="'.dol_escape_htmltag($sitevhost).'">';
print '</td></tr>';


Expand Down

0 comments on commit 7cb3b8d

Please sign in to comment.