clean indent

This commit is contained in:
Frédéric FRANCE
2019-10-27 17:01:23 +01:00
parent a25ec35fd4
commit 8f6d38ee82
88 changed files with 2591 additions and 2636 deletions

View File

@@ -186,7 +186,7 @@
<!-- Check indent are done with spaces and with correct number -->
<!-- Disabled as this does not support tab -->
<!-- <rule ref="Generic.WhiteSpace.ScopeIndent" /> -->
<!-- TODO Enable this
<arg name="tab-width" value="4"/>
<rule ref="Generic.WhiteSpace.ScopeIndent">
<properties>
@@ -194,7 +194,7 @@
<property name="tabIndent" value="true"/>
</properties>
</rule>
-->
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace.Indent" />

View File

@@ -82,8 +82,8 @@ elseif (GETPOST('linkit', 'none') && ! empty($conf->global->MAIN_UPLOAD_DOC))
if ($action == 'confirm_deletefile' && $confirm == 'yes')
{
$urlfile = GETPOST('urlfile', 'alpha', 0, null, null, 1); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
if (GETPOST('section', 'alpha')) // For a delete from the ECM module, upload_dir is ECM root dir and urlfile contains relative path from upload_dir
{
if (GETPOST('section', 'alpha')) {
// For a delete from the ECM module, upload_dir is ECM root dir and urlfile contains relative path from upload_dir
$file = $upload_dir . (preg_match('/\/$/', $upload_dir) ? '' : '/') . $urlfile;
}
else // For a delete from the file manager into another module, or from documents pages, upload_dir contains already path to file from module dir, so we clean path into urlfile.
@@ -94,8 +94,8 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
}
$linkid = GETPOST('linkid', 'int');
if ($urlfile) // delete of a file
{
if ($urlfile) {
// delete of a file
$dir = dirname($file).'/'; // Chemin du dossier contenant l'image d'origine
$dirthumb = $dir.'/thumbs/'; // Chemin du dossier contenant la vignette (if file is an image)
@@ -118,8 +118,11 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
}
}
if ($ret) setEventMessages($langs->trans("FileWasRemoved", $urlfile), null, 'mesgs');
else setEventMessages($langs->trans("ErrorFailToDeleteFile", $urlfile), null, 'errors');
if ($ret) {
setEventMessages($langs->trans("FileWasRemoved", $urlfile), null, 'mesgs');
} else {
setEventMessages($langs->trans("ErrorFailToDeleteFile", $urlfile), null, 'errors');
}
}
elseif ($linkid) // delete of external link
{
@@ -140,10 +143,8 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
}
}
if (is_object($object) && $object->id > 0)
{
if ($backtopage)
{
if (is_object($object) && $object->id > 0) {
if ($backtopage) {
header('Location: ' . $backtopage);
exit;
}

View File

@@ -220,8 +220,7 @@ class DoliDBMssql extends DoliDB
*/
public function close()
{
if ($this->db)
{
if ($this->db) {
if ($this->transaction_opened > 0) dol_syslog(get_class($this)."::close Closing a connection with an opened transaction depth=".$this->transaction_opened, LOG_ERR);
$this->connected=false;
return mssql_close($this->db);

View File

@@ -1135,13 +1135,16 @@ class DoliDBPgsql extends DoliDB
$sql .= " ".$field_desc['attribute'];
if (preg_match("/^[^\s]/i", $field_desc['null']))
$sql .= " ".$field_desc['null'];
if (preg_match("/^[^\s]/i", $field_desc['default']))
if (preg_match("/null/i", $field_desc['default']))
if (preg_match("/^[^\s]/i", $field_desc['default'])) {
if (preg_match("/null/i", $field_desc['default'])) {
$sql .= " default ".$field_desc['default'];
else
} else {
$sql .= " default '".$field_desc['default']."'";
if (preg_match("/^[^\s]/i", $field_desc['extra']))
}
}
if (preg_match("/^[^\s]/i", $field_desc['extra'])) {
$sql .= " ".$field_desc['extra'];
}
$sql .= " ".$field_position;
dol_syslog($sql, LOG_DEBUG);

View File

@@ -240,7 +240,6 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest)
// Load translation files required by the page
$langs->loadLangs(array('main', 'other', 'errors'));
;
$_SESSION["dol_loginmesg"]=($ldap->error?$ldap->error:$langs->trans("ErrorBadLoginPassword"));
}

View File

@@ -307,10 +307,12 @@ class MenuManager
print $val2['titre'];
if ($relurl2)
{
if ($val2['enabled']) // Allowed
if ($val2['enabled']) {
// Allowed
print '</a>';
else
} else {
print '</a>';
}
}
print '</li>'."\n";
}

View File

@@ -952,8 +952,6 @@ class pdf_einstein extends ModelePDFCommandes
{
//$this->atleastoneratenotnull++;
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);

View File

@@ -7,7 +7,7 @@
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
*
* 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
@@ -1107,7 +1107,6 @@ class pdf_eratosthene extends ModelePDFCommandes
if ($tvakey!=0) // On affiche pas taux 0
{
//$this->atleastoneratenotnull++;
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
@@ -1139,8 +1138,6 @@ class pdf_eratosthene extends ModelePDFCommandes
{
//$this->atleastoneratenotnull++;
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);

View File

@@ -324,8 +324,7 @@ class html_cerfafr extends ModeleDon
if ($unite[$i]==1) {
$secon[$i]='vingt et';
$prim[$i]=$chif[$unite[$i]];
}
else {
} else {
$secon[$i]='vingt';
$prim[$i]=$chif[$unite[$i]];
}
@@ -334,8 +333,7 @@ class html_cerfafr extends ModeleDon
if ($unite[$i]==1) {
$secon[$i]='trente et';
$prim[$i]=$chif[$unite[$i]];
}
else {
} else {
$secon[$i]='trente';
$prim[$i]=$chif[$unite[$i]];
}

View File

@@ -218,10 +218,9 @@ class pdf_rouget extends ModelePdfExpedition
$realpath='';
foreach ($objphoto->liste_photos($dir, 1) as $key => $obj)
{
if (empty($conf->global->CAT_HIGH_QUALITY_IMAGES)) // If CAT_HIGH_QUALITY_IMAGES not defined, we use thumb if defined and then original photo
{
foreach ($objphoto->liste_photos($dir, 1) as $key => $obj) {
if (empty($conf->global->CAT_HIGH_QUALITY_IMAGES)) {
// If CAT_HIGH_QUALITY_IMAGES not defined, we use thumb if defined and then original photo
if ($obj['photo_vignette'])
{
$filename= $obj['photo_vignette'];

View File

@@ -139,19 +139,19 @@ class mod_expensereport_jade extends ModeleNumRefExpenseReport
$result = $db->query($sql);
if($db->num_rows($result) > 0):
if ($db->num_rows($result) > 0) {
$objp = $db->fetch_object($result);
$newref = $objp->max;
$newref++;
while(strlen($newref) < $num_car):
while (strlen($newref) < $num_car) {
$newref = "0".$newref;
endwhile;
else:
}
} else {
$newref = 1;
while(strlen($newref) < $num_car):
while (strlen($newref) < $num_car) {
$newref = "0".$newref;
endwhile;
endif;
}
}
$ref_number_int = ($newref+1)-1;

View File

@@ -1271,8 +1271,7 @@ class pdf_crabe extends ModelePDFFactures
//Local tax 1 after VAT
//if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
//{
foreach($this->localtax1 as $localtax_type => $localtax_rate)
{
foreach ($this->localtax1 as $localtax_type => $localtax_rate) {
if (in_array((string) $localtax_type, array('2','4','6'))) continue;
foreach($localtax_rate as $tvakey => $tvaval)

View File

@@ -769,10 +769,12 @@ class pdf_sponge extends ModelePDFFactures
}
// retrieve global local tax
if ($localtax1_type && $localtax1ligne != 0)
if ($localtax1_type && $localtax1ligne != 0) {
$this->localtax1[$localtax1_type][$localtax1_rate]+=$localtax1ligne;
if ($localtax2_type && $localtax2ligne != 0)
}
if ($localtax2_type && $localtax2ligne != 0) {
$this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne;
}
if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*';
if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]=0;
@@ -781,8 +783,7 @@ class pdf_sponge extends ModelePDFFactures
$nexY = max($nexY, $posYAfterImage);
// Add line
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblines - 1))
{
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblines - 1)) {
$pdf->setPage($pageposafter);
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(80,80,80)));
//$pdf->SetDrawColor(190,190,200);
@@ -793,11 +794,9 @@ class pdf_sponge extends ModelePDFFactures
$nexY+=2; // Add space between lines
// Detect if some page were added automatically and output _tableau for past pages
while ($pagenb < $pageposafter)
{
while ($pagenb < $pageposafter) {
$pdf->setPage($pagenb);
if ($pagenb == $pageposbeforeprintlines)
{
if ($pagenb == $pageposbeforeprintlines) {
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code);
}
else
@@ -811,10 +810,8 @@ class pdf_sponge extends ModelePDFFactures
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
}
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
{
if ($pagenb == $pageposafter)
{
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak) {
if ($pagenb == $pageposafter) {
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code);
}
else
@@ -1270,9 +1267,6 @@ class pdf_sponge extends ModelePDFFactures
$pdf->setY($tab2_top);
$posy = $pdf->GetY();
foreach ($TPreviousIncoice as &$fac) {
if($posy > $this->page_hauteur - 4 ) {
$this->_pagefoot($pdf, $object, $outputlangs, 1);
@@ -1453,8 +1447,6 @@ class pdf_sponge extends ModelePDFFactures
{
//$this->atleastoneratenotnull++;
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
@@ -1473,7 +1465,6 @@ class pdf_sponge extends ModelePDFFactures
}
}
}
//}
// VAT

View File

@@ -255,7 +255,9 @@ class mailing_fraise extends MailingTargets
$sql.= " WHERE a.entity IN (".getEntity('member').") AND a.email <> ''"; // Note that null != '' is false
$sql.= " AND a.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$this->db->escape($mailing_id).")";
// Filter on status
if (isset($_POST["filter"]) && $_POST["filter"] == '-1') $sql.= " AND a.statut=-1";
if (isset($_POST["filter"]) && $_POST["filter"] == '-1') {
$sql.= " AND a.statut=-1";
}
if (isset($_POST["filter"]) && $_POST["filter"] == '1a') $sql.= " AND a.statut=1 AND (a.datefin >= '".$this->db->idate($now)."' OR ta.subscription = 0)";
if (isset($_POST["filter"]) && $_POST["filter"] == '1b') $sql.= " AND a.statut=1 AND ((a.datefin IS NULL or a.datefin < '".$this->db->idate($now)."') AND ta.subscription = 1)";
if (isset($_POST["filter"]) && $_POST["filter"] == '0') $sql.= " AND a.statut=0";

View File

@@ -291,8 +291,7 @@ class mailing_thirdparties extends MailingTargets
$s.= $langs->trans('ProspectCustomer');
$s.=': <select name="filter_client" class="flat">';
$s.= '<option value="-1">&nbsp;</option>';
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS))
{
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) {
$s.= '<option value="2">'.$langs->trans('Prospect').'</option>';
}
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS)) {

View File

@@ -72,7 +72,8 @@ class modComptabilite extends DolibarrModules
$this->const = array();
// Data directories to create when module is enabled
$this->dirs = array("/comptabilite/temp",
$this->dirs = array(
"/comptabilite/temp",
"/comptabilite/rapport",
"/comptabilite/export",
"/comptabilite/bordereau"

View File

@@ -298,8 +298,7 @@ class modExpedition extends DolibarrModules
$this->export_sql_end[$r] .=' , '.MAIN_DB_PREFIX.'commandedet as cd';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on cd.fk_product = p.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product_extrafields as extraprod ON p.rowid = extraprod.fk_object';
if ($idcontacts && ! empty($conf->global->SHIPMENT_ADD_CONTACTS_IN_EXPORT))
{
if ($idcontacts && ! empty($conf->global->SHIPMENT_ADD_CONTACTS_IN_EXPORT)) {
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'element_contact as ee ON ee.element_id = cd.fk_commande AND ee.fk_c_type_contact IN ('.$idcontacts.')';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople as sp ON sp.rowid = ee.fk_socpeople';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople_extrafields as extra3 ON sp.rowid = extra3.fk_object';

View File

@@ -223,8 +223,7 @@ class modReception extends DolibarrModules
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'commande_fournisseur_dispatch_extrafields as extra2 ON ed.rowid = extra2.fk_object';
$this->export_sql_end[$r] .=' , '.MAIN_DB_PREFIX.'commande_fournisseurdet as cd';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on cd.fk_product = p.rowid';
if ($idcontacts && ! empty($conf->global->RECEPTION_ADD_CONTACTS_IN_EXPORT))
{
if ($idcontacts && ! empty($conf->global->RECEPTION_ADD_CONTACTS_IN_EXPORT)) {
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'element_contact as ee ON ee.element_id = cd.fk_commande AND ee.fk_c_type_contact IN ('.$idcontacts.')';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople as sp ON sp.rowid = ee.fk_socpeople';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople_extrafields as extra3 ON sp.rowid = extra3.fk_object';

View File

@@ -82,8 +82,8 @@ class modStripe extends DolibarrModules
// New pages on tabs
$this->tabs = array();
// Boxes
$this->boxes = array(); // List of boxes
// List of boxes
$this->boxes = array();
$r=0;
// Permissions

View File

@@ -186,14 +186,12 @@ class modWebsite extends DolibarrModules
dol_mkdir($destroot);
$docs=dol_dir_list($srcroot, 'files', 0, 'website_.*(\.zip|\.jpg)$');
foreach($docs as $cursorfile)
{
foreach($docs as $cursorfile) {
$src=$srcroot.'/'.$cursorfile['name'];
$dest=$destroot.'/'.$cursorfile['name'];
$result=dol_copy($src, $dest, 0, 0);
if ($result < 0)
{
if ($result < 0) {
$langs->load("errors");
$this->error=$langs->trans('ErrorFailToCopyFile', $src, $dest);
}

View File

@@ -668,8 +668,7 @@ class pdf_standard extends ModelePDFProduct
$pdf->line($this->posxunit - 1, $tab_top, $this->posxunit - 1, $tab_top + $tab_height);
if (empty($hidetop)) {
$pdf->SetXY($this->posxunit - 1, $tab_top + 1);
$pdf->MultiCell($this->posxdiscount - $this->posxunit - 1, 2, $outputlangs->transnoentities("Unit"), '',
'C');
$pdf->MultiCell($this->posxdiscount - $this->posxunit - 1, 2, $outputlangs->transnoentities("Unit"), '', 'C');
}
}

View File

@@ -142,10 +142,9 @@ class pdf_squille extends ModelePdfReception
$realpath='';
foreach ($objphoto->liste_photos($dir, 1) as $key => $obj)
{
if (empty($conf->global->CAT_HIGH_QUALITY_IMAGES)) // If CAT_HIGH_QUALITY_IMAGES not defined, we use thumb if defined and then original photo
{
foreach ($objphoto->liste_photos($dir, 1) as $key => $obj) {
if (empty($conf->global->CAT_HIGH_QUALITY_IMAGES)) {
// If CAT_HIGH_QUALITY_IMAGES not defined, we use thumb if defined and then original photo
if ($obj['photo_vignette'])
{
$filename= $obj['photo_vignette'];
@@ -461,8 +460,7 @@ class pdf_squille extends ModelePdfReception
$pdf->writeHTMLCell($this->posxqtyordered - $this->posxweightvol + 2, 3, $this->posxweightvol - 1, $curY, $weighttxt.(($weighttxt && $voltxt)?'<br>':'').$voltxt, 0, 0, false, true, 'C');
//$pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), 3, $weighttxt.(($weighttxt && $voltxt)?'<br>':'').$voltxt,'','C');
if (empty($conf->global->RECEPTION_PDF_HIDE_ORDERED))
{
if (empty($conf->global->RECEPTION_PDF_HIDE_ORDERED)) {
$pdf->SetXY($this->posxqtyordered, $curY);
if($object->lines[$i]->fk_commandefourndet!=$fk_commandefourndet){
$pdf->MultiCell(($this->posxqtytoship - $this->posxqtyordered), 3, $object->lines[$i]->qty_asked, '', 'C');

View File

@@ -198,8 +198,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc
}
// Add odtgeneration hook
if (! is_object($hookmanager))
{
if (! is_object($hookmanager)) {
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
$hookmanager=new HookManager($this->db);
}
@@ -412,8 +411,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc
$odfHandler->title = $object->builddoc_filename;
$odfHandler->subject = $object->builddoc_filename;
if (! empty($conf->global->ODT_ADD_DOLIBARR_ID))
{
if (! empty($conf->global->ODT_ADD_DOLIBARR_ID)) {
$odfHandler->userdefined['dol_id'] = $object->id;
$odfHandler->userdefined['dol_element'] = $object->element;
}

View File

@@ -715,8 +715,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
//if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
//{
//Local tax 1
foreach($this->localtax1 as $tvakey => $tvaval)
{
foreach ($this->localtax1 as $tvakey => $tvaval) {
if ($tvakey != 0) // On affiche pas taux 0
{
//$this->atleastoneratenotnull++;
@@ -743,8 +742,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
//if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
//{
//Local tax 2
foreach($this->localtax2 as $tvakey => $tvaval)
{
foreach($this->localtax2 as $tvakey => $tvaval) {
if ($tvakey != 0) // On affiche pas taux 0
{
//$this->atleastoneratenotnull++;

View File

@@ -4,7 +4,7 @@
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
* Copyright (C) 2018-2019 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2019 Tim Otte <otte@meuser.it>
*
* This program is free software; you can redistribute it and/or modify

View File

@@ -464,8 +464,7 @@ print '<script type="text/javascript" language="javascript">
if($value == 'radio')$value = 'select';
}
foreach ($extrafields->attributes[$elementtype]['label'] as $key => $val)
{
foreach ($extrafields->attributes[$elementtype]['label'] as $key => $val) {
print '<tr><td>' . $extrafields->attributes[$elementtype]['label'][$key];
if ($array_query['options_' . $key . '_cnct'] != '' || (is_array($array_query['options_' . $key . '_cnct']) && count($array_query['options_' . $key . '_cnct']) > 0)) {
print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
@@ -486,7 +485,6 @@ print '<script type="text/javascript" language="javascript">
print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>';
print $form->selectDate('', 'options_' . $key . '_end_dt' . '_cnct');
print '</td></tr></table>';
print '</td><td>' . "\n";
print $form->textwithpicto('', $langs->trans("AdvTgtSearchDtHelp"), 1, 'help');
} elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'boolean')) {
@@ -515,24 +513,19 @@ print '<script type="text/javascript" language="javascript">
print $extrafields->showInputField($key, $array_query['options_' . $key . '_cnct'], '', '_cnct');
}
print '</td></tr></table>';
print '</td><td>' . "\n";
}
print '</td></tr>' . "\n";
}
}
print '<tr>' . "\n";
print '<td colspan="3" class="right">' . "\n";
print '<input type="button" name="addcontact" id="addcontact" value="' . $langs->trans('AdvTgtAddContact') . '" class="butAction"/>' . "\n";
print '</td>' . "\n";
print '</tr>' . "\n";
print '</table>' . "\n";
print '</form>' . "\n";
print '</div>' . "\n";
print '<form action="' . $_SERVER['PHP_SELF'] . '?action=clear&id=' . $object->id . '" method="POST">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print load_fiche_titre($langs->trans("ToClearAllRecipientsClickHere"));

View File

@@ -211,8 +211,7 @@ if ($permission) {
</div>
<div class="tagtd"><?php echo $tab[$i]['libelle']; ?></div>
<div class="tagtd center">
<?php //if ($object->statut >= 0) echo '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=swapstatut&amp;ligne='.$tab[$i]['rowid'].'">'; ?>
<?php
<?php //if ($object->statut >= 0) echo '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=swapstatut&amp;ligne='.$tab[$i]['rowid'].'">';
if ($tab[$i]['source']=='internal')
{
echo $userstatic->LibStatut($tab[$i]['statuscontact'], 3);
@@ -221,8 +220,7 @@ if ($permission) {
{
echo $contactstatic->LibStatut($tab[$i]['statuscontact'], 3);
}
?>
<?php //if ($object->statut >= 0) echo '</a>'; ?>
//if ($object->statut >= 0) echo '</a>'; ?>
</div>
<div class="tagtd nowrap right">
<?php if ($permission) { ?>
@@ -231,21 +229,16 @@ if ($permission) {
</div>
</form>
<?php $i++; ?>
<?php
<?php $i++;
}
}
?>
</div>
</div>
<!-- TEMPLATE CONTACTS HOOK BEGIN HERE -->
<?php
if (is_object($hookmanager))
{
print "</div>\n";
print "</div>\n";
print "<!-- TEMPLATE CONTACTS HOOK BEGIN HERE -->\n";
if (is_object($hookmanager)) {
$hookmanager->initHooks(array('contacttpl'));
$parameters=array();
$reshook=$hookmanager->executeHooks('formContactTpl', $parameters, $object, $action);
}
?>
<!-- END PHP TEMPLATE CONTACTS -->
print "<!-- END PHP TEMPLATE CONTACTS -->\n";

View File

@@ -63,10 +63,8 @@ if (! isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) $conf->global->THEME_ELDY_
$colorbackhmenu1 = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TOPMENU_BACK1)?$colorbackhmenu1:$conf->global->THEME_ELDY_TOPMENU_BACK1):(empty($user->conf->THEME_ELDY_TOPMENU_BACK1)?$colorbackhmenu1:$user->conf->THEME_ELDY_TOPMENU_BACK1);
$colorbackhmenu1 = join(',', colorStringToArray($colorbackhmenu1)); // Normalize value to 'x,y,z'
?>
<!-- BEGIN PHP TEMPLATE LOGIN.TPL.PHP -->
print "<!-- BEGIN PHP TEMPLATE LOGIN.TPL.PHP -->\n";
<?php
if (!empty($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND)) {
// For example $conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND = 'https://source.unsplash.com/random'
?>

View File

@@ -90,10 +90,8 @@ if (!empty($extrafields))
}
}
?>
<!-- BEGIN PHP TEMPLATE objectline_create.tpl.php -->
<?php
print "<!-- BEGIN PHP TEMPLATE objectline_create.tpl.php -->\n";
$nolinesbefore=(count($this->lines) == 0 || $forcetoshowtitlelines);
if ($nolinesbefore) {
?>
@@ -373,9 +371,9 @@ if ($nolinesbefore) {
$coldisplay++;
?>
<td class="nobottom linecolresupplier"><input id="fourn_ref" name="fourn_ref" class="flat minwidth50 maxwidth150" value="<?php echo (isset($_POST["fourn_ref"])?GETPOST("fourn_ref", 'alpha', 2):''); ?>"></td>
<?php } ?>
<?php }
<td class="nobottom linecolvat right"><?php
print '<td class="nobottom linecolvat right">';
$coldisplay++;
if ($seller->tva_assuj == "0") echo '<input type="hidden" name="tva_tx" id="tva_tx" value="0">'.vatrate(0, true);
else echo $form->load_tva('tva_tx', (isset($_POST["tva_tx"])?GETPOST("tva_tx", 'alpha', 2):-1), $seller, $buyer, 0, 0, '', false, 1);
@@ -392,9 +390,9 @@ if ($nolinesbefore) {
<td class="nobottom linecoluht_currency right">
<input type="text" size="5" name="multicurrency_price_ht" id="multicurrency_price_ht" class="flat right" value="<?php echo (isset($_POST["multicurrency_price_ht"])?GETPOST("multicurrency_price_ht", 'alpha', 2):''); ?>">
</td>
<?php } ?>
<?php }
<?php if (! empty($inputalsopricewithtax)) {
if (! empty($inputalsopricewithtax)) {
$coldisplay++;
?>
<td class="nobottom linecoluttc right">
@@ -512,17 +510,13 @@ if ((! empty($conf->service->enabled) || ($object->element == 'contrat')) && $da
print 'jQuery("#date_endmin").val("'.$conf->global->MAIN_DEFAULT_DATE_END_MIN.'");';
}
}
print '</script>'
?>
</td>
</tr>
<?php
print '</script>';
print '</td>';
print "</tr>\n";
}
?>
<script>
print "<script>\n";
<?php
if (! empty($usemargins) && $user->rights->margins->creer)
{
?>

View File

@@ -54,11 +54,9 @@ $colspan = 3; // Col total ht + col edit + col delete
if (! empty($inputalsopricewithtax)) $colspan++; // We add 1 if col total ttc
if (in_array($object->element, array('propal','supplier_proposal','facture','facturerec','invoice','commande','order','order_supplier','invoice_supplier'))) $colspan++; // With this, there is a column move button
if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) $colspan+=2;
?>
<!-- BEGIN PHP TEMPLATE objectline_edit.tpl.php -->
print "<!-- BEGIN PHP TEMPLATE objectline_edit.tpl.php -->\n";
<?php
$coldisplay=0;
?>
<tr class="oddeven tredited">
@@ -168,8 +166,9 @@ $coldisplay=0;
print '></td>';
}
?>
<td class="right"><?php $coldisplay++; ?>
<?php if (($line->info_bits & 2) != 2) {
<td class="right">
<?php $coldisplay++;
if (($line->info_bits & 2) != 2) {
// I comment this because it shows info even when not required
// for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated
// must also not be output for most entities (proposal, intervention, ...)
@@ -192,8 +191,9 @@ $coldisplay=0;
}
?>
<td class="nowrap right"><?php $coldisplay++; ?>
<?php if (($line->info_bits & 2) != 2) {
<td class="nowrap right">
<?php $coldisplay++;
if (($line->info_bits & 2) != 2) {
print '<input size="1" type="text" class="flat right" name="remise_percent" id="remise_percent" value="' . $line->remise_percent . '"';
if ($line->fk_prev_id != null ) print ' readonly';
print '>%';

View File

@@ -39,9 +39,9 @@ if (empty($object) || ! is_object($object))
print "Error, template page can't be called as URL";
exit;
}
?>
<!-- BEGIN PHP TEMPLATE objectline_title.tpl.php -->
<?php
print "<!-- BEGIN PHP TEMPLATE objectline_title.tpl.php -->\n";
// Title line
print "<thead>\n";
@@ -90,17 +90,20 @@ if ($usemargins && ! empty($conf->margin->enabled) && empty($user->societe_id))
{
if (!empty($user->rights->margins->creer))
{
if ($conf->global->MARGIN_TYPE == "1")
if ($conf->global->MARGIN_TYPE == "1") {
print '<td class="linecolmargin1 margininfos right" style="width: 80px">'.$langs->trans('BuyingPrice').'</td>';
else
} else {
print '<td class="linecolmargin1 margininfos right" style="width: 80px">'.$langs->trans('CostPrice').'</td>';
}
}
if (! empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous)
if (! empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous) {
print '<td class="linecolmargin2 margininfos right" style="width: 50px">'.$langs->trans('MarginRate').'</td>';
if (! empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous)
}
if (! empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous) {
print '<td class="linecolmargin2 margininfos right" style="width: 50px">'.$langs->trans('MarkRate').'</td>';
}
}
// Total HT
print '<td class="linecolht right">'.$langs->trans('TotalHTShort').'</td>';
@@ -126,6 +129,5 @@ if($action == 'selectlines')
print "</tr>\n";
print "</thead>\n";
?>
<!-- END PHP TEMPLATE objectline_title.tpl.php -->
print "<!-- END PHP TEMPLATE objectline_title.tpl.php -->\n";

View File

@@ -64,8 +64,7 @@ $domData .= ' data-qty="'.$line->qty.'"';
$domData .= ' data-product_type="'.$line->product_type.'"';
?>
<?php $coldisplay=0; ?>
$coldisplay=0; ?>
<!-- BEGIN PHP TEMPLATE objectline_view.tpl.php -->
<tr id="row-<?php echo $line->id?>" class="drag drop oddeven" <?php echo $domData; ?> >
<?php if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?>
@@ -74,9 +73,7 @@ $domData .= ' data-product_type="'.$line->product_type.'"';
<td class="linecoldescription minwidth300imp"><?php $coldisplay++; ?><div id="line_<?php echo $line->id; ?>"></div>
<?php
if (($line->info_bits & 2) == 2) {
?>
<a href="<?php echo DOL_URL_ROOT.'/comm/remx.php?id='.$this->socid; ?>">
<?php
print '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$this->socid.'">';
$txt='';
print img_object($langs->trans("ShowReduc"), 'reduc').' ';
if ($line->description == '(DEPOSIT)') $txt=$langs->trans("Deposit");
@@ -84,9 +81,7 @@ $domData .= ' data-product_type="'.$line->product_type.'"';
elseif ($line->description == '(EXCESS PAID)') $txt=$langs->trans("ExcessPaid");
//else $txt=$langs->trans("Discount");
print $txt;
?>
</a>
<?php
print '</a>';
if ($line->description)
{
if ($line->description == '(CREDIT_NOTE)' && $line->fk_remise_except > 0)
@@ -188,20 +183,16 @@ $domData .= ' data-product_type="'.$line->product_type.'"';
echo '<div class="clearboth"></div><br><span class="opacitymedium">' . $langs->trans('AccountingAffectation') . ' : </span>' . $accountingaccount->getNomUrl(0, 1, 1);
}
?>
</td>
<?php
print '</td>';
if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines
{
?>
<td class="linecolrefsupplier"><?php
print '<td class="linecolrefsupplier">';
echo ($line->ref_fourn?$line->ref_fourn:$line->ref_supplier);
?></td>
<?php
print '</td>';
}
// VAT Rate
?>
<td class="linecolvat nowrap right"><?php $coldisplay++; ?><?php
print '<td class="linecolvat nowrap right">';
$coldisplay++;
$positiverates='';
if (price2num($line->tva_tx)) $positiverates.=($positiverates?'/':'').price2num($line->tva_tx);
if (price2num($line->total_localtax1)) $positiverates.=($positiverates?'/':'').price2num($line->localtax1_tx);
@@ -215,9 +206,9 @@ $domData .= ' data-product_type="'.$line->product_type.'"';
<?php if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { ?>
<td class="linecoluht_currency nowrap right"><?php $coldisplay++; ?><?php echo price($line->multicurrency_subprice); ?></td>
<?php } ?>
<?php }
<?php if ($inputalsopricewithtax) { ?>
if ($inputalsopricewithtax) { ?>
<td class="linecoluttc nowrap right"><?php $coldisplay++; ?><?php echo (isset($line->pu_ttc)?price($line->pu_ttc):price($line->subprice)); ?></td>
<?php } ?>
@@ -230,10 +221,8 @@ $domData .= ' data-product_type="'.$line->product_type.'"';
//if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." ";
echo price($line->qty, 0, '', 0, 0); // Yes, it is a quantity, not a price, but we just want the formating role of function price
} else echo '&nbsp;';
?>
</td>
print '</td>';
<?php
if ($conf->global->PRODUCT_USE_UNITS)
{
print '<td class="linecoluseunit nowrap left">';
@@ -243,17 +232,16 @@ $domData .= ' data-product_type="'.$line->product_type.'"';
}
print '</td>';
}
?>
<?php if (!empty($line->remise_percent) && $line->special_code != 3) { ?>
<td class="linecoldiscount right"><?php
if (!empty($line->remise_percent) && $line->special_code != 3) {
print '<td class="linecoldiscount right">';
$coldisplay++;
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
echo dol_print_reduction($line->remise_percent, $langs);
?></td>
<?php } else { ?>
<td class="linecoldiscount"><?php $coldisplay++; ?>&nbsp;</td>
<?php }
print '</td>';
} else {
print '<td class="linecoldiscount">&nbsp;</td>';
$coldisplay++;
}
$rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT, $conf->global->MAIN_MAX_DECIMALS_TOT);
@@ -273,20 +261,18 @@ $domData .= ' data-product_type="'.$line->product_type.'"';
{
if (!empty($user->rights->margins->creer)) { ?>
<td class="linecolmargin1 nowrap margininfos right"><?php $coldisplay++; ?><?php echo price($line->pa_ht); ?></td>
<?php } ?>
<?php if (! empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous) { ?>
<?php }
if (! empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous) { ?>
<td class="linecolmargin2 nowrap margininfos right"><?php $coldisplay++; ?><?php echo (($line->pa_ht == 0)?'n/a':price($line->marge_tx, null, null, null, null, $rounding).'%'); ?></td>
<?php }
if (! empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous) {?>
<td class="linecolmargin2 nowrap margininfos right"><?php $coldisplay++; ?><?php echo price($line->marque_tx, null, null, null, null, $rounding).'%'; ?></td>
<?php }
}
?>
<?php if ($line->special_code == 3) { ?>
if ($line->special_code == 3) { ?>
<td class="linecoloption nowrap right"><?php $coldisplay++; ?><?php echo $langs->trans('Option'); ?></td>
<?php } else { ?>
<td class="linecolht nowrap right"><?php
<?php } else {
print '<td class="linecolht nowrap right">';
$coldisplay++;
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
@@ -303,74 +289,69 @@ $domData .= ' data-product_type="'.$line->product_type.'"';
{
print '</span>';
}
?>
</td>
<?php if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { ?>
<td class="linecolutotalht_currency nowrap right"><?php $coldisplay++; ?><?php echo price($line->multicurrency_total_ht); ?></td>
<?php } ?>
<?php } ?>
<?php if ($outputalsopricetotalwithtax) { ?>
<td class="linecolht nowrap right"><?php $coldisplay++; ?><?php echo price($line->total_ttc); ?></td>
<?php } ?>
print '</td>';
if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) {
print '<td class="linecolutotalht_currency nowrap right">'.price($line->multicurrency_total_ht).'</td>';
$coldisplay++;
}
}
if ($outputalsopricetotalwithtax) {
print '<td class="linecolht nowrap right">'.price($line->total_ttc).'</td>';
$coldisplay++;
}
<?php
if ($this->statut == 0 && ($object_rights->creer) && $action != 'selectlines' ) { ?>
<td class="linecoledit center"><?php $coldisplay++; ?>
<?php if (($line->info_bits & 2) == 2 || ! empty($disableedit)) { ?>
<?php } else { ?>
if ($this->statut == 0 && ($object_rights->creer) && $action != 'selectlines' ) {
print '<td class="linecoledit center">';
$coldisplay++;
if (($line->info_bits & 2) == 2 || ! empty($disableedit)) {
} else { ?>
<a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=editline&amp;lineid='.$line->id.'#line_'.$line->id; ?>">
<?php echo img_edit(); ?>
</a>
<?php } ?>
</td>
<?php echo img_edit().'</a>';
}
print '</td>';
<td class="linecoldelete center"><?php $coldisplay++; ?>
<?php
print '<td class="linecoldelete center">';
$coldisplay++;
if (($line->fk_prev_id == null ) && empty($disableremove)) { //La suppression n'est autorisée que si il n'y a pas de ligne dans une précédente situation
print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $this->id . '&amp;action=ask_deleteline&amp;lineid=' . $line->id . '">';
print img_delete();
print '</a>';
}
?>
</td>
print '</td>';
<?php
if ($num > 1 && $conf->browser->layout != 'phone' && ($this->situation_counter == 1 || !$this->situation_cycle_ref) && empty($disablemove)) { ?>
<td class="linecolmove tdlineupdown center"><?php $coldisplay++; ?>
<?php if ($i > 0) { ?>
if ($num > 1 && $conf->browser->layout != 'phone' && ($this->situation_counter == 1 || !$this->situation_cycle_ref) && empty($disablemove)) {
print '<td class="linecolmove tdlineupdown center">';
$coldisplay++;
if ($i > 0) { ?>
<a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=up&amp;rowid='.$line->id; ?>">
<?php echo img_up('default', 0, 'imgupforline'); ?>
</a>
<?php } ?>
<?php if ($i < $num-1) { ?>
<?php }
if ($i < $num-1) { ?>
<a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=down&amp;rowid='.$line->id; ?>">
<?php echo img_down('default', 0, 'imgdownforline'); ?>
</a>
<?php } ?>
</td>
<?php } else { ?>
<td <?php echo (($conf->browser->layout != 'phone' && empty($disablemove)) ?' class="linecolmove tdlineupdown center"':' class="linecolmove center"'); ?>><?php $coldisplay++; ?></td>
<?php } ?>
<?php
<?php }
print '</td>';
} else {
?>
<td colspan="3"><?php $coldisplay=$coldisplay+3; ?></td>
<?php
print '<td '.(($conf->browser->layout != 'phone' && empty($disablemove)) ?' class="linecolmove tdlineupdown center"':' class="linecolmove center"').'></td>';
$coldisplay++;
}
} else {
print '<td colspan="3"></td>';
$coldisplay = $coldisplay+3;
}
if ($action == 'selectlines') { ?>
<td class="linecolcheck center"><input type="checkbox" class="linecheckbox" name="line_checkbox[<?php echo $i+1; ?>]" value="<?php echo $line->id; ?>" ></td>
<?php } ?>
<?php }
</tr>
print "</tr>\n";
<?php
//Line extrafield
if (!empty($extrafields))
{
print $line->showOptionals($extrafields, 'view', array('style'=>'class="drag drop oddeven"','colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1);
}
?>
<!-- END PHP TEMPLATE objectline_view.tpl.php -->
print "<!-- END PHP TEMPLATE objectline_view.tpl.php -->\n";

View File

@@ -537,8 +537,9 @@ if ($resql)
if (! empty($arrayfields['d.date_debut']['checked']))
{
print '<td class="liste_titre" align="center">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY))
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) {
print '<input class="flat width25" type="text" maxlength="2" name="day_start" value="'.dol_escape_htmltag($day_start).'">';
}
print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="month_start" value="'.$month_start.'">';
$formother->select_year($year_start, 'year_start', 1, $min_year, $max_year);
@@ -548,8 +549,9 @@ if ($resql)
if (! empty($arrayfields['d.date_fin']['checked']))
{
print '<td class="liste_titre" align="center">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY))
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) {
print '<input class="flat width25" type="text" maxlength="2" name="day_end" value="'.dol_escape_htmltag($day_end).'">';
}
print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="month_end" value="'.$month_end.'">';
$formother->select_year($year_end, 'year_end', 1, $min_year, $max_year);
print '</td>';

View File

@@ -24,11 +24,9 @@ if (empty($conf) || ! is_object($conf))
exit;
}
?>
<!-- BEGIN PHP TEMPLATE -->
print "<!-- BEGIN PHP TEMPLATE -->\n";
<?php
global $user;
@@ -55,6 +53,5 @@ foreach($linkedObjectBlock as $key => $objectlink)
</tr>
<?php
}
?>
<!-- END PHP TEMPLATE -->
print "<!-- END PHP TEMPLATE -->\n";

View File

@@ -1196,8 +1196,9 @@ elseif ($id > 0 || ! empty($ref))
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->ficheinter->creer)
{
if ($action != 'classify')
if ($action != 'classify') {
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
}
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@@ -141,9 +141,10 @@ if ($id > 0 || ! empty($ref))
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->ficheinter->creer)
{
if ($action != 'classify')
if ($action != 'classify') {
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
$morehtmlref.=' : ';
}
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@@ -120,9 +120,10 @@ if ($object->id)
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->commande->creer)
{
if ($action != 'classify')
if ($action != 'classify') {
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
$morehtmlref.=' : ';
}
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@@ -86,9 +86,10 @@ if ($id > 0 || ! empty($ref))
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->commande->creer)
{
if ($action != 'classify')
if ($action != 'classify') {
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
$morehtmlref.=' : ';
}
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@@ -22,11 +22,9 @@ if (empty($conf) || ! is_object($conf))
exit;
}
?>
<!-- BEGIN PHP TEMPLATE -->
print "<!-- BEGIN PHP TEMPLATE -->\n";
<?php
global $user;
@@ -56,6 +54,5 @@ foreach($linkedObjectBlock as $key => $objectlink)
</tr>
<?php
}
?>
<!-- END PHP TEMPLATE -->
print "<!-- END PHP TEMPLATE -->\n";

View File

@@ -283,7 +283,8 @@ if (empty($user->societe_id) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTAT
DOL_URL_ROOT.'/don/list.php?leftmenu=donations'
);
// Translation lang files
$langfile=array("users",
$langfile=array(
"users",
"companies",
"prospects",
"suppliers",
@@ -302,7 +303,7 @@ if (empty($user->societe_id) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTAT
"projects",
"trips",
"holiday",
"donations"
"donations",
);

View File

@@ -390,8 +390,9 @@ if ($id)
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->salaries->write)
{
if ($action != 'classify')
if ($action != 'classify') {
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
}
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@@ -101,9 +101,10 @@ if (empty($conf) || ! is_object($conf))
<td><?php echo $langs->trans('SupplierCategory'); ?></td>
<td colspan="3"><?php echo $this->control->tpl['select_suppliercategory']; ?></td>
</tr>
<?php } }?>
<?php }
}
<?php if (! empty($conf->barcode->enabled)) { ?>
if (! empty($conf->barcode->enabled)) { ?>
<tr>
<td><?php echo $langs->trans('Gencod'); ?></td>
<td colspan="3"><input type="text" name="barcode" value="<?php echo $this->control->tpl['barcode']; ?>"></td>

View File

@@ -119,9 +119,8 @@ if ($this->control->tpl['fournisseur']) {
<?php
}
}
?>
<?php if (! empty($conf->barcode->enabled)) { ?>
if (! empty($conf->barcode->enabled)) { ?>
<tr>
<td><?php echo $langs->trans('Gencod'); ?></td>
<td colspan="3"><input type="text" name="barcode" value="<?php echo $this->control->tpl['barcode']; ?>"></td>
@@ -209,9 +208,9 @@ for ($i=1; $i<=4; $i++) {
<td><?php echo $langs->trans("DefaultLang"); ?></td>
<td colspan="3"><?php echo $this->control->tpl['select_lang']; ?></td>
</tr>
<?php } ?>
<?php }
<?php if(!empty($this->control->tpl['localtax'])) echo $this->control->tpl['localtax']; ?>
if(!empty($this->control->tpl['localtax'])) echo $this->control->tpl['localtax']; ?>
</table>
<br>

View File

@@ -25,10 +25,8 @@ if (empty($conf) || ! is_object($conf))
$soc = $GLOBALS['objcanvas']->control->object;
?>
<!-- BEGIN PHP TEMPLATE CARD_VIEW.TPL.PHP COMPANY -->
<?php
print "<!-- BEGIN PHP TEMPLATE CARD_VIEW.TPL.PHP COMPANY -->\n";
$head = societe_prepare_head($soc);

View File

@@ -111,9 +111,10 @@ if (empty($conf) || ! is_object($conf))
<td><?php echo $langs->trans('SupplierCategory'); ?></td>
<td colspan="3"><?php echo $this->control->tpl['select_suppliercategory']; ?></td>
</tr>
<?php } }?>
<?php }
}
<?php if (! empty($conf->barcode->enabled)) { ?>
if (! empty($conf->barcode->enabled)) { ?>
<tr>
<td><?php echo $langs->trans('Gencod'); ?></td>
<td colspan="3"><input type="text" name="barcode" value="<?php echo $this->control->tpl['barcode']; ?>"></td>

View File

@@ -25,19 +25,15 @@ if (empty($conf) || ! is_object($conf))
$object = $GLOBALS['objcanvas']->control->object;
?>
<!-- BEGIN PHP TEMPLATE CARD_VIEW.TPL.PHP INDIVIDUAL -->
<?php
print "<!-- BEGIN PHP TEMPLATE CARD_VIEW.TPL.PHP INDIVIDUAL -->\n";
$head = societe_prepare_head($object);
dol_fiche_head($head, 'card', $langs->trans("ThirdParty"), 0, 'company');
?>
<?php if ($this->control->tpl['error']) echo $this->control->tpl['error']; ?>
<?php if ($this->control->tpl['action_delete']) echo $this->control->tpl['action_delete']; ?>
if ($this->control->tpl['error']) echo $this->control->tpl['error'];
if ($this->control->tpl['action_delete']) echo $this->control->tpl['action_delete']; ?>
<table class="border allwidth">
@@ -230,6 +226,5 @@ $result=show_contacts($conf, $langs, $db, $object);
// Projects list
$result=show_projects($conf, $langs, $db, $object);
?>
<!-- END PHP TEMPLATE -->
print "<!-- END PHP TEMPLATE -->\n";

View File

@@ -1062,10 +1062,11 @@ class Thirdparties extends DolibarrApi
foreach ($accounts as $account) {
$object = array();
foreach($account as $key => $value)
foreach ($account as $key => $value) {
if (in_array($key, $fields)) {
$object[$key] = $value;
}
}
$returnAccounts[] = $object;
}
@@ -1323,10 +1324,11 @@ class Thirdparties extends DolibarrApi
foreach ($accounts as $account) {
$object = array();
foreach($account as $key => $value)
foreach ($account as $key => $value) {
if(in_array($key, $fields)) {
$object[$key] = $value;
}
}
$returnAccounts[] = $object;
}
@@ -1439,17 +1441,19 @@ class Thirdparties extends DolibarrApi
$account->fk_soc = $id;
$account->site = $site;
if ($account->create(DolibarrApiAccess::$user) < 0)
if ($account->create(DolibarrApiAccess::$user) < 0) {
throw new RestException(500, 'Error creating SocieteAccount entity.');
}
// We found an existing SocieteAccount entity, we are replacing it
} else {
if (isset($request_data['site']) && $request_data['site'] !== $site) {
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe_account WHERE fk_soc = ".$id." AND site = '". $request_data['site']."' ";
$result = $db->query($sql);
if($result->num_rows !== 0)
if ($result->num_rows !== 0) {
throw new RestException(409, "You are trying to update this thirdparty SocieteAccount (gateway record) from $site to ".$request_data['site'] . " but another SocieteAccount entity already exists with this site key.");
}
}
$obj = $db->fetch_object($result);

View File

@@ -619,9 +619,7 @@ if (empty($reshook))
$sql = "UPDATE ".MAIN_DB_PREFIX."oauth_token";
$sql.= " SET tokenstring = '".dol_json_encode($tokenstring)."'";
$sql.= " WHERE fk_soc = ".$object->id." AND service = '".$service."' AND entity = ".$conf->entity; // Keep = here for entity. Only 1 record must be modified !
}
catch(Exception $e)
{
} catch(Exception $e) {
$error++;
setEventMessages($e->getMessage(), null, 'errors');
}
@@ -637,9 +635,7 @@ if (empty($reshook))
$tokenstring['type'] = $stripesup->type;
$sql = "INSERT INTO ".MAIN_DB_PREFIX."oauth_token (service, fk_soc, entity, tokenstring)";
$sql .= " VALUES ('".$service."', ".$object->id.", ".$conf->entity.", '".dol_json_encode($tokenstring)."')";
}
catch(Exception $e)
{
} catch(Exception $e) {
$error++;
setEventMessages($e->getMessage(), null, 'errors');
}
@@ -711,11 +707,13 @@ if (empty($reshook))
{
$cu = $stripe->customerStripe($object, $stripeacc, $servicestatus);
$card = $cu->sources->retrieve("$source");
if ($card)
{
if ($card) {
// $card->detach(); Does not work with card_, only with src_
if (method_exists($card, 'detach')) $card->detach();
else $card->delete();
if (method_exists($card, 'detach')) {
$card->detach();
} else {
$card->delete();
}
}
}
@@ -1318,8 +1316,11 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
foreach ($balance->available as $cpt)
{
$arrayzerounitcurrency=array('BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'VND', 'VUV', 'XAF', 'XOF', 'XPF');
if (! in_array($cpt->currency, $arrayzerounitcurrency)) $currencybalance[$cpt->currency]->available=$cpt->amount / 100;
else $currencybalance[$cpt->currency]->available=$cpt->amount;
if (! in_array($cpt->currency, $arrayzerounitcurrency)) {
$currencybalance[$cpt->currency]->available=$cpt->amount / 100;
} else {
$currencybalance[$cpt->currency]->available=$cpt->amount;
}
$currencybalance[$cpt->currency]->currency=$cpt->currency;
}
}
@@ -1329,8 +1330,11 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
foreach ($balance->pending as $cpt)
{
$arrayzerounitcurrency=array('BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'VND', 'VUV', 'XAF', 'XOF', 'XPF');
if (! in_array($cpt->currency, $arrayzerounitcurrency)) $currencybalance[$cpt->currency]->pending=$currencybalance[$cpt->currency]->available+$cpt->amount / 100;
else $currencybalance[$cpt->currency]->pending=$currencybalance[$cpt->currency]->available+$cpt->amount;
if (! in_array($cpt->currency, $arrayzerounitcurrency)) {
$currencybalance[$cpt->currency]->pending=$currencybalance[$cpt->currency]->available+$cpt->amount / 100;
} else {
$currencybalance[$cpt->currency]->pending=$currencybalance[$cpt->currency]->available+$cpt->amount;
}
}
}
@@ -1394,12 +1398,13 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
$string .= $rib->code_guichet.' ';
} elseif ($val == 'BankAccountNumberKey') {
$string .= $rib->cle_rib.' ';
/* Already output after
}elseif ($val == 'BIC') {
$string .= $rib->bic.' ';
}elseif ($val == 'IBAN') {
$string .= $rib->iban.' ';*/
}
// Already output after
// } elseif ($val == 'BIC') {
// $string .= $rib->bic.' ';
// } elseif ($val == 'IBAN') {
// $string .= $rib->iban.' ';*/
//}
}
if (! empty($rib->label) && $rib->number) {
if (! checkBanForAccount($rib)) {

View File

@@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2018 Thibault FOUCART <support@ptibogxiv.net>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
*
* 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
@@ -132,8 +133,7 @@ if (!$rowid)
$status = $form->textwithpicto(img_picto($langs->trans("".$charge->status.""), 'statut8'), $label, 1);
}
if ($charge->payment_method_details->type=='card')
{
if ($charge->payment_method_details->type=='card') {
$type = $langs->trans("card");
} elseif ($charge->source->type=='card'){
$type = $langs->trans("card");
@@ -216,14 +216,20 @@ if (!$rowid)
$object->fetch($charge->metadata->dol_id);
if ($object->id > 0) {
print "<a href='".DOL_URL_ROOT."/commande/card.php?id=".$object->id."'>".img_picto('', 'object_order')." ".$object->ref."</a>";
} else print $FULLTAG;
} else {
print $FULLTAG;
}
} elseif ($charge->metadata->dol_type=="invoice") {
$object = new Facture($db);
$object->fetch($charge->metadata->dol_id);
if ($object->id > 0) {
print "<a href='".DOL_URL_ROOT."/compta/facture/card.php?facid=".$charge->metadata->dol_id."'>".img_picto('', 'object_invoice')." ".$object->ref."</a>";
} else print $FULLTAG;
} else print $FULLTAG;
} else {
print $FULLTAG;
}
} else {
print $FULLTAG;
}
print "</td>\n";
// Date payment
print '<td class="center">'.dol_print_date($charge->created, '%d/%m/%Y %H:%M')."</td>\n";

View File

@@ -62,6 +62,9 @@ class Stripe extends CommonObject
public $code;
public $declinecode;
/**
* @var string Message
*/
public $message;
/**
@@ -338,8 +341,11 @@ class Stripe extends CommonObject
} elseif ($fee < $conf->global->STRIPE_APPLICATION_FEE_MINIMAL) {
$fee = $conf->global->STRIPE_APPLICATION_FEE_MINIMAL;
}
if (! in_array($currency_code, $arrayzerounitcurrency)) $stripefee = round($fee * 100);
else $stripefee = round($fee);
if (! in_array($currency_code, $arrayzerounitcurrency)) {
$stripefee = round($fee * 100);
} else {
$stripefee = round($fee);
}
$paymentintent = null;

View File

@@ -187,11 +187,11 @@ if (empty($reshook))
}
// Check parameters
// if (! GETPOST('paiementcode'))
// {
// setEventMessages($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('PaymentMode')), null, 'errors');
// $error++;
// }
/*if (! GETPOST('paiementcode'))
{
setEventMessages($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('PaymentMode')), null, 'errors');
$error++;
}*/
if (! empty($conf->banque->enabled))
{
@@ -209,11 +209,11 @@ if (empty($reshook))
$error++;
}
// if (empty($datepaye))
// {
// setEventMessages($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('Date')), null, 'errors');
// $error++;
// }
/*if (empty($datepaye))
{
setEventMessages($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('Date')), null, 'errors');
$error++;
}*/
// Check if payments in both currency
if ($totalpayment > 0 && $multicurrency_totalpayment > 0)