PEAR FunctionCallSignature

This commit is contained in:
Frédéric FRANCE 2019-02-10 10:45:49 +01:00
parent 580e5c42d2
commit 1e43f8e54a
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
129 changed files with 321 additions and 332 deletions

View File

@ -345,12 +345,6 @@
</rule> </rule>
<rule ref="PEAR.Functions.FunctionCallSignature.SpaceBeforeOpenBracket"> <rule ref="PEAR.Functions.FunctionCallSignature.SpaceBeforeOpenBracket">
<severity>0</severity> <severity>0</severity>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket">
<severity>0</severity>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket">
<severity>0</severity>
</rule> </rule>
<rule ref="PEAR.Functions.FunctionCallSignature.SpaceAfterCloseBracket"> <rule ref="PEAR.Functions.FunctionCallSignature.SpaceAfterCloseBracket">
<severity>0</severity> <severity>0</severity>

View File

@ -173,7 +173,7 @@ while ($obj = $db->fetch_object($resql)) {
$sql.= $db->plimit($limit+1, $offset); $sql.= $db->plimit($limit+1, $offset);
dol_syslog ( "/accountancy/bookkeeping/thirdparty_lettrage_supplier.php", LOG_DEBUG ); dol_syslog ("/accountancy/bookkeeping/thirdparty_lettrage_supplier.php", LOG_DEBUG);
$resql = $db->query($sql); $resql = $db->query($sql);
if (! $resql) if (! $resql)
{ {
@ -183,7 +183,7 @@ if (! $resql)
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
dol_syslog ( "/accountancy/bookkeeping/thirdparty_lettrage_supplier.php", LOG_DEBUG ); dol_syslog ("/accountancy/bookkeeping/thirdparty_lettrage_supplier.php", LOG_DEBUG);
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) { if ($resql) {
$num = $db->num_rows($resql); $num = $db->num_rows($resql);

View File

@ -475,7 +475,7 @@ class AccountancyExport
// elarifr: date format must be fixed format : 6 char ddmmyy = %d%m%yand not defined by user / dolibarr setting // elarifr: date format must be fixed format : 6 char ddmmyy = %d%m%yand not defined by user / dolibarr setting
if (! empty($data->date_echeance)) if (! empty($data->date_echeance))
//$Tab['date_echeance'] = dol_print_date($data->date_echeance, $conf->global->ACCOUNTING_EXPORT_DATE); //$Tab['date_echeance'] = dol_print_date($data->date_echeance, $conf->global->ACCOUNTING_EXPORT_DATE);
$Tab['date_echeance'] = dol_print_date($data->date_echeance, '%d%m%y' ); // elarifr: format must be ddmmyy $Tab['date_echeance'] = dol_print_date($data->date_echeance, '%d%m%y'); // elarifr: format must be ddmmyy
else else
$Tab['date_echeance'] = '000000'; $Tab['date_echeance'] = '000000';

View File

@ -633,12 +633,12 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
print '"' . $key . '"' . $sep; print '"' . $key . '"' . $sep;
print '"' . $date . '"' . $sep; print '"' . $date . '"' . $sep;
print '"' . $val["refsologest"] . '"' . $sep; print '"' . $val["refsologest"] . '"' . $sep;
print '"' . utf8_decode ( dol_trunc($companystatic->name, 32) ). '"' . $sep; print '"' . utf8_decode (dol_trunc($companystatic->name, 32)). '"' . $sep;
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep; print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
print '"' . $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER . '"' . $sep; print '"' . $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER . '"' . $sep;
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep; print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
print '"' . $langs->trans("Thirdparty") . '"' . $sep; print '"' . $langs->trans("Thirdparty") . '"' . $sep;
print '"' . utf8_decode ( dol_trunc($companystatic->name, 16) ) . ' - ' . $val["refsuppliersologest"] . ' - ' . $langs->trans("Thirdparty") . '"' . $sep; print '"' . utf8_decode (dol_trunc($companystatic->name, 16)) . ' - ' . $val["refsuppliersologest"] . ' - ' . $langs->trans("Thirdparty") . '"' . $sep;
print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep; print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep;
print '"' . ($mt >= 0 ? price($mt) : '') . '"'. $sep; print '"' . ($mt >= 0 ? price($mt) : '') . '"'. $sep;
print '"' . $journal . '"' ; print '"' . $journal . '"' ;
@ -654,12 +654,12 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
print '"' . $key . '"' . $sep; print '"' . $key . '"' . $sep;
print '"' . $date . '"' . $sep; print '"' . $date . '"' . $sep;
print '"' . $val["refsologest"] . '"' . $sep; print '"' . $val["refsologest"] . '"' . $sep;
print '"' . utf8_decode ( dol_trunc($companystatic->name, 32) ) . '"' . $sep; print '"' . utf8_decode (dol_trunc($companystatic->name, 32)) . '"' . $sep;
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
print '""' . $sep; print '""' . $sep;
print '"' . utf8_decode ( dol_trunc($accountingaccount->label, 32) ) . '"' . $sep; print '"' . utf8_decode (dol_trunc($accountingaccount->label, 32)) . '"' . $sep;
print '"' . utf8_decode ( dol_trunc($companystatic->name, 16) ) . ' - ' . $val["refsuppliersologest"] . ' - ' . dol_trunc($accountingaccount->label, 32) . '"' . $sep; print '"' . utf8_decode (dol_trunc($companystatic->name, 16)) . ' - ' . $val["refsuppliersologest"] . ' - ' . dol_trunc($accountingaccount->label, 32) . '"' . $sep;
print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep; print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep;
print '"' . ($mt < 0 ? price(- $mt) : '') . '"'. $sep; print '"' . ($mt < 0 ? price(- $mt) : '') . '"'. $sep;
print '"' . $journal . '"' ; print '"' . $journal . '"' ;
@ -679,12 +679,12 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
print '"' . $key . '"' . $sep; print '"' . $key . '"' . $sep;
print '"' . $date . '"' . $sep; print '"' . $date . '"' . $sep;
print '"' . $val["refsologest"] . '"' . $sep; print '"' . $val["refsologest"] . '"' . $sep;
print '"' . utf8_decode ( dol_trunc($companystatic->name, 32) ) . '"' . $sep; print '"' . utf8_decode (dol_trunc($companystatic->name, 32)) . '"' . $sep;
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
print '""' . $sep; print '""' . $sep;
print '"' . $langs->trans("VAT") . ' - ' . $def_tva[$key] . '"' . $sep; print '"' . $langs->trans("VAT") . ' - ' . $def_tva[$key] . '"' . $sep;
print '"' . utf8_decode(dol_trunc($companystatic->name, 16) ) . ' - ' . $val["refsuppliersologest"] . ' - ' . $langs->trans("VAT") . join(', ', $def_tva[$key][$k]) .' %' . ($numtax?' - Localtax '.$numtax:'') . '"' . $sep; print '"' . utf8_decode(dol_trunc($companystatic->name, 16)) . ' - ' . $val["refsuppliersologest"] . ' - ' . $langs->trans("VAT") . join(', ', $def_tva[$key][$k]) .' %' . ($numtax?' - Localtax '.$numtax:'') . '"' . $sep;
print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep; print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep;
print '"' . ($mt < 0 ? price(- $mt) : '') . '"'. $sep; print '"' . ($mt < 0 ? price(- $mt) : '') . '"'. $sep;
print '"' . $journal . '"' ; print '"' . $journal . '"' ;
@ -700,12 +700,12 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
print '"' . $key . '"' . $sep; print '"' . $key . '"' . $sep;
print '"' . $date . '"' . $sep; print '"' . $date . '"' . $sep;
print '"' . $val["refsologest"] . '"' . $sep; print '"' . $val["refsologest"] . '"' . $sep;
print '"' . utf8_decode ( dol_trunc($companystatic->name, 32) ). '"' . $sep; print '"' . utf8_decode (dol_trunc($companystatic->name, 32)). '"' . $sep;
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep; print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep; print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep; print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
print '"' . $langs->trans("Thirdparty") . '"' . $sep; print '"' . $langs->trans("Thirdparty") . '"' . $sep;
print '"' . utf8_decode ( dol_trunc($companystatic->name, 16) ) . ' - ' . $val["refsuppliersologest"] . ' - ' . $langs->trans("VAT") . ' NPR"' . $sep; print '"' . utf8_decode (dol_trunc($companystatic->name, 16)) . ' - ' . $val["refsuppliersologest"] . ' - ' . $langs->trans("VAT") . ' NPR"' . $sep;
print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep; print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep;
print '"' . ($mt >= 0 ? price($mt) : '') . '"'. $sep; print '"' . ($mt >= 0 ? price($mt) : '') . '"'. $sep;
print '"' . $journal . '"' ; print '"' . $journal . '"' ;

View File

@ -1297,7 +1297,7 @@ else
print "</td></tr>\n"; print "</td></tr>\n";
// Categories // Categories
if (! empty( $conf->categorie->enabled ) && !empty( $user->rights->categorie->lire )) if (! empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire))
{ {
print '<tr><td>' . $form->editfieldkey("Categories", 'memcats', '', $object, 0) . '</td>'; print '<tr><td>' . $form->editfieldkey("Categories", 'memcats', '', $object, 0) . '</td>';
print '<td>'; print '<td>';

View File

@ -608,7 +608,7 @@ if ($rowid > 0)
print "</tr>\n"; print "</tr>\n";
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre( $langs->trans("Name")." / ".$langs->trans("Company"), $_SERVER["PHP_SELF"], "d.lastname", $param, "", "", $sortfield, $sortorder); print_liste_field_titre($langs->trans("Name")." / ".$langs->trans("Company"), $_SERVER["PHP_SELF"], "d.lastname", $param, "", "", $sortfield, $sortorder);
print_liste_field_titre("Login", $_SERVER["PHP_SELF"], "d.login", $param, "", "", $sortfield, $sortorder); print_liste_field_titre("Login", $_SERVER["PHP_SELF"], "d.login", $param, "", "", $sortfield, $sortorder);
print_liste_field_titre("Nature", $_SERVER["PHP_SELF"], "d.morphy", $param, "", "", $sortfield, $sortorder); print_liste_field_titre("Nature", $_SERVER["PHP_SELF"], "d.morphy", $param, "", "", $sortfield, $sortorder);
print_liste_field_titre("EMail", $_SERVER["PHP_SELF"], "d.email", $param, "", "", $sortfield, $sortorder); print_liste_field_titre("EMail", $_SERVER["PHP_SELF"], "d.email", $param, "", "", $sortfield, $sortorder);

View File

@ -493,7 +493,7 @@ if ($action == 'edit' || $action == 'updateedit')
print '<tr class="oddeven"><td><label for="profid2">'.$langs->transcountry("ProfId2", $mysoc->country_code).'</label></td><td>'; print '<tr class="oddeven"><td><label for="profid2">'.$langs->transcountry("ProfId2", $mysoc->country_code).'</label></td><td>';
if (! empty($mysoc->country_code)) if (! empty($mysoc->country_code))
{ {
print '<input name="siret" id="profid2" class="minwidth200" value="' . dol_escape_htmltag(! empty($conf->global->MAIN_INFO_SIRET) ? $conf->global->MAIN_INFO_SIRET : '' ) . '">'; print '<input name="siret" id="profid2" class="minwidth200" value="' . dol_escape_htmltag(! empty($conf->global->MAIN_INFO_SIRET) ? $conf->global->MAIN_INFO_SIRET : '') . '">';
} }
else else
{ {

View File

@ -207,7 +207,7 @@ elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS')
} }
} elseif ($action == 'set_FICHINTER_USE_SERVICE_DURATION') { } elseif ($action == 'set_FICHINTER_USE_SERVICE_DURATION') {
$val = GETPOST('FICHINTER_USE_SERVICE_DURATION', 'alpha'); $val = GETPOST('FICHINTER_USE_SERVICE_DURATION', 'alpha');
$res = dolibarr_set_const($db, "FICHINTER_USE_SERVICE_DURATION", ($val == 'on' ? 1 : 0), 'bool', 0, '', $res = dolibarr_set_const($db, "FICHINTER_USE_SERVICE_DURATION", ($val == 'on' ? 1 : 0), 'bool', 0, '',
$conf->entity); $conf->entity);
if (!$res > 0) { if (!$res > 0) {

View File

@ -170,7 +170,7 @@ elseif ($action == 'set_SUPPLIER_ORDER_OTHER')
{ {
$freetext = GETPOST('SUPPLIER_ORDER_FREE_TEXT', 'none'); // No alpha here, we want exact string $freetext = GETPOST('SUPPLIER_ORDER_FREE_TEXT', 'none'); // No alpha here, we want exact string
$doubleapproval = GETPOST('SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED', 'alpha'); $doubleapproval = GETPOST('SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED', 'alpha');
$doubleapproval = price2num($doubleapproval ); $doubleapproval = price2num($doubleapproval);
$res1 = dolibarr_set_const($db, "SUPPLIER_ORDER_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity); $res1 = dolibarr_set_const($db, "SUPPLIER_ORDER_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
$res2 = dolibarr_set_const($db, "SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED", $doubleapproval, 'chaine', 0, '', $conf->entity); $res2 = dolibarr_set_const($db, "SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED", $doubleapproval, 'chaine', 0, '', $conf->entity);

View File

@ -281,7 +281,7 @@ if ($mode == 'overwrite')
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre( $langs->trans("Language").' (en_US, es_MX, ...)', $_SERVER["PHP_SELF"], 'lang,transkey', '', $param, '', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Language").' (en_US, es_MX, ...)', $_SERVER["PHP_SELF"], 'lang,transkey', '', $param, '', $sortfield, $sortorder);
print_liste_field_titre("Key", $_SERVER["PHP_SELF"], 'transkey', '', $param, '', $sortfield, $sortorder); print_liste_field_titre("Key", $_SERVER["PHP_SELF"], 'transkey', '', $param, '', $sortfield, $sortorder);
print_liste_field_titre("NewTranslationStringToShow", $_SERVER["PHP_SELF"], 'transvalue', '', $param, '', $sortfield, $sortorder); print_liste_field_titre("NewTranslationStringToShow", $_SERVER["PHP_SELF"], 'transvalue', '', $param, '', $sortfield, $sortorder);
//if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre("Entity"),$_SERVER["PHP_SELF"],'entity,transkey','',$param,'',$sortfield,$sortorder); //if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre("Entity"),$_SERVER["PHP_SELF"],'entity,transkey','',$param,'',$sortfield,$sortorder);
@ -470,7 +470,7 @@ if ($mode == 'searchkey')
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre( $langs->trans("Language").' (en_US, es_MX, ...)', $_SERVER["PHP_SELF"], 'lang,transkey', '', $param, '', $sortfield, $sortorder).'</td>'; print_liste_field_titre($langs->trans("Language").' (en_US, es_MX, ...)', $_SERVER["PHP_SELF"], 'lang,transkey', '', $param, '', $sortfield, $sortorder).'</td>';
print_liste_field_titre("Key", $_SERVER["PHP_SELF"], 'transkey', '', $param, '', $sortfield, $sortorder); print_liste_field_titre("Key", $_SERVER["PHP_SELF"], 'transkey', '', $param, '', $sortfield, $sortorder);
print_liste_field_titre("CurrentTranslationString", $_SERVER["PHP_SELF"], 'transvalue', '', $param, '', $sortfield, $sortorder); print_liste_field_titre("CurrentTranslationString", $_SERVER["PHP_SELF"], 'transvalue', '', $param, '', $sortfield, $sortorder);
//if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre("Entity",$_SERVER["PHP_SELF"],'entity,transkey','',$param,'',$sortfield,$sortorder); //if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre("Entity",$_SERVER["PHP_SELF"],'entity,transkey','',$param,'',$sortfield,$sortorder);

View File

@ -161,7 +161,7 @@ class BlockedLogAuthority
$sql.= " FROM ".MAIN_DB_PREFIX."blockedlog_authority as b"; $sql.= " FROM ".MAIN_DB_PREFIX."blockedlog_authority as b";
if ($id) $sql.= " WHERE b.rowid = ". $id; if ($id) $sql.= " WHERE b.rowid = ". $id;
elseif($signature)$sql.= " WHERE b.signature = '". $this->db->escape( $signature ) ."'" ; elseif($signature)$sql.= " WHERE b.signature = '". $this->db->escape($signature) ."'" ;
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)

View File

@ -701,10 +701,10 @@ class Categorie extends CommonObject
// For backward compatibility // For backward compatibility
if ($type == 'societe') { if ($type == 'societe') {
$type = 'customer'; $type = 'customer';
dol_syslog( get_class( $this ) . "::del_type(): type 'societe' is deprecated, please use 'customer' instead", LOG_WARNING); dol_syslog(get_class($this) . "::del_type(): type 'societe' is deprecated, please use 'customer' instead", LOG_WARNING);
} elseif ($type == 'fournisseur') { } elseif ($type == 'fournisseur') {
$type = 'supplier'; $type = 'supplier';
dol_syslog( get_class( $this ) . "::del_type(): type 'fournisseur' is deprecated, please use 'supplier' instead", LOG_WARNING); dol_syslog(get_class($this) . "::del_type(): type 'fournisseur' is deprecated, please use 'supplier' instead", LOG_WARNING);
} }
$this->db->begin(); $this->db->begin();
@ -758,7 +758,7 @@ class Categorie extends CommonObject
$sql = "SELECT c.fk_" . $this->MAP_CAT_FK[$type]; $sql = "SELECT c.fk_" . $this->MAP_CAT_FK[$type];
$sql .= " FROM " . MAIN_DB_PREFIX . "categorie_" . $this->MAP_CAT_TABLE[$type] . " as c"; $sql .= " FROM " . MAIN_DB_PREFIX . "categorie_" . $this->MAP_CAT_TABLE[$type] . " as c";
$sql .= ", " . MAIN_DB_PREFIX . $this->MAP_OBJ_TABLE[$type] . " as o"; $sql .= ", " . MAIN_DB_PREFIX . $this->MAP_OBJ_TABLE[$type] . " as o";
$sql .= " WHERE o.entity IN (" . getEntity( $obj->element).")"; $sql .= " WHERE o.entity IN (" . getEntity($obj->element).")";
$sql.= " AND c.fk_categorie = ".$this->id; $sql.= " AND c.fk_categorie = ".$this->id;
$sql .= " AND c.fk_" . $this->MAP_CAT_FK[$type] . " = o.rowid"; $sql .= " AND c.fk_" . $this->MAP_CAT_FK[$type] . " = o.rowid";
@ -775,7 +775,7 @@ class Categorie extends CommonObject
else else
{ {
$obj = new $this->MAP_OBJ_CLASS[$type]( $this->db ); $obj = new $this->MAP_OBJ_CLASS[$type]( $this->db );
$obj->fetch( $rec['fk_' . $this->MAP_CAT_FK[$type]]); $obj->fetch($rec['fk_' . $this->MAP_CAT_FK[$type]]);
$objs[] = $obj; $objs[] = $obj;
} }
} }
@ -1008,7 +1008,7 @@ class Categorie extends CommonObject
if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= ", t.label as label_trans, t.description as description_trans"; if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= ", t.label as label_trans, t.description as description_trans";
$sql.= " FROM ".MAIN_DB_PREFIX."categorie as c"; $sql.= " FROM ".MAIN_DB_PREFIX."categorie as c";
if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_lang as t ON t.fk_category=c.rowid AND t.lang='".$current_lang."'"; if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_lang as t ON t.fk_category=c.rowid AND t.lang='".$current_lang."'";
$sql .= " WHERE c.entity IN (" . getEntity( 'category') . ")"; $sql .= " WHERE c.entity IN (" . getEntity('category') . ")";
$sql .= " AND c.type = " . $type; $sql .= " AND c.type = " . $type;
dol_syslog(get_class($this)."::get_full_arbo get category list", LOG_DEBUG); dol_syslog(get_class($this)."::get_full_arbo get category list", LOG_DEBUG);
@ -1418,7 +1418,7 @@ class Categorie extends CommonObject
$sql = "SELECT ct.fk_categorie, c.label, c.rowid"; $sql = "SELECT ct.fk_categorie, c.label, c.rowid";
$sql .= " FROM " . MAIN_DB_PREFIX . "categorie_" . $this->MAP_CAT_TABLE[$type] . " as ct, " . MAIN_DB_PREFIX . "categorie as c"; $sql .= " FROM " . MAIN_DB_PREFIX . "categorie_" . $this->MAP_CAT_TABLE[$type] . " as ct, " . MAIN_DB_PREFIX . "categorie as c";
$sql .= " WHERE ct.fk_categorie = c.rowid AND ct.fk_" . $this->MAP_CAT_FK[$type] . " = " . (int) $id . " AND c.type = " . $this->MAP_ID[$type]; $sql .= " WHERE ct.fk_categorie = c.rowid AND ct.fk_" . $this->MAP_CAT_FK[$type] . " = " . (int) $id . " AND c.type = " . $this->MAP_ID[$type];
$sql .= " AND c.entity IN (" . getEntity( 'category') . ")"; $sql .= " AND c.entity IN (" . getEntity('category') . ")";
$res = $this->db->query($sql); $res = $this->db->query($sql);
if ($res) if ($res)
@ -1470,16 +1470,16 @@ class Categorie extends CommonObject
// For backward compatibility // For backward compatibility
if (is_numeric($type)) { if (is_numeric($type)) {
// We want to reverse lookup // We want to reverse lookup
$map_type = array_flip( $this->MAP_ID ); $map_type = array_flip($this->MAP_ID);
$type = $map_type[$type]; $type = $map_type[$type];
dol_syslog( get_class( $this ) . "::rechercher(): numeric types are deprecated, please use string instead", dol_syslog( get_class($this) . "::rechercher(): numeric types are deprecated, please use string instead",
LOG_WARNING ); LOG_WARNING );
} }
// Generation requete recherche // Generation requete recherche
$sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "categorie"; $sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "categorie";
$sql .= " WHERE type = " . $this->MAP_ID[$type]; $sql .= " WHERE type = " . $this->MAP_ID[$type];
$sql .= " AND entity IN (" . getEntity( 'category') . ")"; $sql .= " AND entity IN (" . getEntity('category') . ")";
if ($nom) if ($nom)
{ {
if (! $exact) if (! $exact)

View File

@ -77,7 +77,7 @@ if (isset($_FILES['userfile']) && $_FILES['userfile']['size'] > 0 && $_POST["sen
{ {
if(empty($file['tmp_name'][$i]) || intval($conf->global->MAIN_UPLOAD_DOC) * 1000 <= filesize($file['tmp_name'][$i]) ) if(empty($file['tmp_name'][$i]) || intval($conf->global->MAIN_UPLOAD_DOC) * 1000 <= filesize($file['tmp_name'][$i]) )
{ {
setEventMessage($file['name'][$i] .' : '. $langs->trans(empty($file['tmp_name'][$i])? 'ErrorFailedToSaveFile' : 'MaxSizeForUploadedFiles' ) ); setEventMessage($file['name'][$i] .' : '. $langs->trans(empty($file['tmp_name'][$i])? 'ErrorFailedToSaveFile' : 'MaxSizeForUploadedFiles'));
unset($file['name'][$i], $file['type'][$i], $file['tmp_name'][$i], $file['error'][$i], $file['size'][$i]); unset($file['name'][$i], $file['type'][$i], $file['tmp_name'][$i], $file['error'][$i], $file['size'][$i]);
} }
} }

View File

@ -487,7 +487,7 @@ if ($object->id > 0)
$langs->load("categories"); $langs->load("categories");
print '<tr><td>' . $langs->trans("CustomersCategoriesShort") . '</td>'; print '<tr><td>' . $langs->trans("CustomersCategoriesShort") . '</td>';
print '<td>'; print '<td>';
print $form->showCategories( $object->id, 'customer', 1 ); print $form->showCategories($object->id, 'customer', 1);
print "</td></tr>"; print "</td></tr>";
} }

View File

@ -64,17 +64,17 @@ class FormAdvTargetEmailing extends Form
$sql .= " FROM " . MAIN_DB_PREFIX . "c_prospectlevel"; $sql .= " FROM " . MAIN_DB_PREFIX . "c_prospectlevel";
$sql .= " WHERE active > 0"; $sql .= " WHERE active > 0";
$sql .= " ORDER BY sortorder"; $sql .= " ORDER BY sortorder";
dol_syslog ( get_class( $this ) . '::multiselectProspectionStatus sql=' . $sql, LOG_DEBUG ); dol_syslog (get_class($this) . '::multiselectProspectionStatus sql=' . $sql, LOG_DEBUG);
$resql = $this->db->query( $sql ); $resql = $this->db->query($sql);
if ($resql) { if ($resql) {
$num = $this->db->num_rows( $resql ); $num = $this->db->num_rows($resql);
$i = 0; $i = 0;
while ( $i < $num ) { while ( $i < $num ) {
$obj = $this->db->fetch_object( $resql ); $obj = $this->db->fetch_object($resql);
$level = $langs->trans( $obj->code ); $level = $langs->trans($obj->code);
if ($level == $obj->code) if ($level == $obj->code)
$level = $langs->trans( $obj->label ); $level = $langs->trans($obj->label);
$options_array[$obj->code] = $level; $options_array[$obj->code] = $level;
$i ++; $i ++;
@ -120,10 +120,10 @@ class FormAdvTargetEmailing extends Form
$foundselected = false; $foundselected = false;
while ($i < $num) { while ($i < $num) {
$obj = $this->db->fetch_object ( $resql ); $obj = $this->db->fetch_object ($resql);
$countryArray [$i] ['rowid'] = $obj->rowid; $countryArray [$i] ['rowid'] = $obj->rowid;
$countryArray [$i] ['code_iso'] = $obj->code_iso; $countryArray [$i] ['code_iso'] = $obj->code_iso;
$countryArray [$i] ['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country" . $obj->code_iso ) != "Country" . $obj->code_iso ? $langs->transnoentitiesnoconv ( "Country" . $obj->code_iso ) : ($obj->label != '-' ? $obj->label : '')); $countryArray [$i] ['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country" . $obj->code_iso) != "Country" . $obj->code_iso ? $langs->transnoentitiesnoconv ("Country" . $obj->code_iso) : ($obj->label != '-' ? $obj->label : ''));
$label[$i] = $countryArray[$i]['label']; $label[$i] = $countryArray[$i]['label'];
$i ++; $i ++;
} }
@ -166,25 +166,25 @@ class FormAdvTargetEmailing extends Form
$sql_usr .= " WHERE u2.entity IN (0," . $conf->entity . ")"; $sql_usr .= " WHERE u2.entity IN (0," . $conf->entity . ")";
$sql_usr .= " AND u2.rowid = sc.fk_user "; $sql_usr .= " AND u2.rowid = sc.fk_user ";
if (! empty ( $conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX )) if (! empty ($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX))
$sql_usr .= " AND u2.statut<>0 "; $sql_usr .= " AND u2.statut<>0 ";
$sql_usr .= " ORDER BY name ASC"; $sql_usr .= " ORDER BY name ASC";
// print $sql_usr;exit; // print $sql_usr;exit;
$resql_usr = $this->db->query ( $sql_usr ); $resql_usr = $this->db->query ($sql_usr);
if ($resql_usr) { if ($resql_usr) {
while ( $obj_usr = $this->db->fetch_object ( $resql_usr ) ) { while ( $obj_usr = $this->db->fetch_object ($resql_usr) ) {
$label = $obj_usr->firstname . " " . $obj_usr->name . " (" . $obj_usr->login . ')'; $label = $obj_usr->firstname . " " . $obj_usr->name . " (" . $obj_usr->login . ')';
$options_array [$obj_usr->rowid] = $label; $options_array [$obj_usr->rowid] = $label;
} }
$this->db->free ( $resql_usr ); $this->db->free ($resql_usr);
} else { } else {
dol_print_error ( $this->db ); dol_print_error ($this->db);
} }
return $this->advMultiselectarray ( $htmlname, $options_array, $selected_array ); return $this->advMultiselectarray ($htmlname, $options_array, $selected_array);
} }
/** /**
@ -227,8 +227,8 @@ class FormAdvTargetEmailing extends Form
if (is_array($sqlqueryparam)) if (is_array($sqlqueryparam))
{ {
$param_list = array_keys ( $sqlqueryparam ); $param_list = array_keys ($sqlqueryparam);
$InfoFieldList = explode ( ":", $param_list [0] ); $InfoFieldList = explode (":", $param_list [0]);
// 0 1 : tableName // 0 1 : tableName
// 1 2 : label field name Nom du champ contenant le libelle // 1 2 : label field name Nom du champ contenant le libelle
@ -237,8 +237,8 @@ class FormAdvTargetEmailing extends Form
$keyList = 'rowid'; $keyList = 'rowid';
if (count ( $InfoFieldList ) >= 3) { if (count ($InfoFieldList) >= 3) {
if (strpos ( $InfoFieldList [3], 'extra.' ) !== false) { if (strpos ($InfoFieldList [3], 'extra.') !== false) {
$keyList = 'main.' . $InfoFieldList [2] . ' as rowid'; $keyList = 'main.' . $InfoFieldList [2] . ' as rowid';
} else { } else {
$keyList = $InfoFieldList [2] . ' as rowid'; $keyList = $InfoFieldList [2] . ' as rowid';
@ -247,10 +247,10 @@ class FormAdvTargetEmailing extends Form
$sql = 'SELECT ' . $keyList . ', ' . $InfoFieldList [1]; $sql = 'SELECT ' . $keyList . ', ' . $InfoFieldList [1];
$sql .= ' FROM ' . MAIN_DB_PREFIX . $InfoFieldList [0]; $sql .= ' FROM ' . MAIN_DB_PREFIX . $InfoFieldList [0];
if (! empty ( $InfoFieldList [3] )) { if (! empty ($InfoFieldList [3])) {
// We have to join on extrafield table // We have to join on extrafield table
if (strpos ( $InfoFieldList [3], 'extra' ) !== false) { if (strpos ($InfoFieldList [3], 'extra') !== false) {
$sql .= ' as main, ' . MAIN_DB_PREFIX . $InfoFieldList [0] . '_extrafields as extra'; $sql .= ' as main, ' . MAIN_DB_PREFIX . $InfoFieldList [0] . '_extrafields as extra';
$sql .= ' WHERE extra.fk_object=main.' . $InfoFieldList [2] . ' AND ' . $InfoFieldList [3]; $sql .= ' WHERE extra.fk_object=main.' . $InfoFieldList [2] . ' AND ' . $InfoFieldList [3];
} else { } else {
@ -270,13 +270,13 @@ class FormAdvTargetEmailing extends Form
$i = 0; $i = 0;
if ($num) { if ($num) {
while ( $i < $num ) { while ( $i < $num ) {
$obj = $this->db->fetch_object ( $resql ); $obj = $this->db->fetch_object ($resql);
$labeltoshow = dol_trunc ( $obj->$InfoFieldList [1], 90 ); $labeltoshow = dol_trunc ($obj->$InfoFieldList [1], 90);
$options_array[$obj->rowid]=$labeltoshow; $options_array[$obj->rowid]=$labeltoshow;
$i ++; $i ++;
} }
} }
$this->db->free ( $resql ); $this->db->free ($resql);
} }
} }
@ -328,7 +328,7 @@ class FormAdvTargetEmailing extends Form
dol_print_error($this->db); dol_print_error($this->db);
} }
return $this->advMultiselectarray ( $htmlname, $options_array, $selected_array ); return $this->advMultiselectarray ($htmlname, $options_array, $selected_array);
} }
/** /**
@ -415,7 +415,7 @@ class FormAdvTargetEmailing extends Form
dol_print_error($this->db); dol_print_error($this->db);
} }
return $this->advMultiselectarray( $htmlname, $options_array, $selected_array ); return $this->advMultiselectarray($htmlname, $options_array, $selected_array);
} }
/** /**
@ -438,19 +438,19 @@ class FormAdvTargetEmailing extends Form
$sql .= " WHERE type_element='$type_element'"; $sql .= " WHERE type_element='$type_element'";
$sql .= " ORDER BY c.name"; $sql .= " ORDER BY c.name";
dol_syslog ( get_class ( $this ) . "::".__METHOD__, LOG_DEBUG ); dol_syslog (get_class ($this) . "::".__METHOD__, LOG_DEBUG);
$resql = $this->db->query ( $sql ); $resql = $this->db->query ($sql);
if ($resql) { if ($resql) {
$out .= '<select id="' . $htmlname . '" class="flat" name="' . $htmlname . '">'; $out .= '<select id="' . $htmlname . '" class="flat" name="' . $htmlname . '">';
if ($showempty) if ($showempty)
$out .= '<option value=""></option>'; $out .= '<option value=""></option>';
$num = $this->db->num_rows ( $resql ); $num = $this->db->num_rows ($resql);
$i = 0; $i = 0;
if ($num) { if ($num) {
while ( $i < $num ) { while ( $i < $num ) {
$obj = $this->db->fetch_object ( $resql ); $obj = $this->db->fetch_object ($resql);
$label = $obj->name; $label = $obj->name;
if (empty($label)) { if (empty($label)) {
$label=$obj->fk_element; $label=$obj->fk_element;
@ -466,9 +466,9 @@ class FormAdvTargetEmailing extends Form
} }
$out .= '</select>'; $out .= '</select>';
} else { } else {
dol_print_error ( $this->db ); dol_print_error ($this->db);
} }
$this->db->free ( $resql ); $this->db->free ($resql);
return $out; return $out;
} }
} }

View File

@ -724,7 +724,7 @@ if (empty($reshook))
{ {
$lineId = intval($lineId); $lineId = intval($lineId);
$originLine = new $lineClassName($db); $originLine = new $lineClassName($db);
if(intval($fromElementid) > 0 && $originLine->fetch( $lineId ) > 0) if(intval($fromElementid) > 0 && $originLine->fetch($lineId) > 0)
{ {
$originLine->fetch_optionals($lineId); $originLine->fetch_optionals($lineId);
$desc = $originLine->desc; $desc = $originLine->desc;
@ -1895,7 +1895,7 @@ if ($action == 'create')
{ {
require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
$notify = new Notify($db); $notify = new Notify($db);
$formquestion = array_merge($formquestion, array( $formquestion = array_merge($formquestion, array(
array('type' => 'onecolumn', 'value' => $notify->confirmMessage('PROPAL_CLOSE_SIGNED', $object->socid, $object)), array('type' => 'onecolumn', 'value' => $notify->confirmMessage('PROPAL_CLOSE_SIGNED', $object->socid, $object)),
)); ));
} }

View File

@ -665,7 +665,7 @@ class Proposals extends DolibarrApi
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
} }
$result = $this->propal->classifyBilled(DolibarrApiAccess::$user ); $result = $this->propal->classifyBilled(DolibarrApiAccess::$user);
if ($result < 0) { if ($result < 0) {
throw new RestException(500, 'Error : '.$this->propal->error); throw new RestException(500, 'Error : '.$this->propal->error);
} }

View File

@ -667,7 +667,7 @@ class Propal extends CommonObject
{ {
global $mysoc; global $mysoc;
dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise_percent=$remise_percent, dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise_percent=$remise_percent,
txtva=$txtva, desc=$desc, price_base_type=$price_base_type, info_bits=$info_bits, special_code=$special_code, fk_parent_line=$fk_parent_line, pa_ht=$pa_ht, type=$type, date_start=$date_start, date_end=$date_end"); txtva=$txtva, desc=$desc, price_base_type=$price_base_type, info_bits=$info_bits, special_code=$special_code, fk_parent_line=$fk_parent_line, pa_ht=$pa_ht, type=$type, date_start=$date_start, date_end=$date_end");
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';

View File

@ -1347,7 +1347,7 @@ if (empty($reshook))
{ {
$lineId = intval($lineId); $lineId = intval($lineId);
$originLine = new $lineClassName($db); $originLine = new $lineClassName($db);
if(intval($fromElementid) > 0 && $originLine->fetch( $lineId ) > 0) if(intval($fromElementid) > 0 && $originLine->fetch($lineId) > 0)
{ {
$originLine->fetch_optionals($lineId); $originLine->fetch_optionals($lineId);
$desc = $originLine->desc; $desc = $originLine->desc;

View File

@ -463,7 +463,7 @@ if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read))
print "<br>"; print "<br>";
print load_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 = "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,"; $sql.= " pct.code as payment_code,";

View File

@ -2118,7 +2118,7 @@ if (empty($reshook))
} }
} }
$result = $object->updateline(GETPOST('lineid'), $description, $pu_ht, $qty, GETPOST('remise_percent'), $result = $object->updateline(GETPOST('lineid'), $description, $pu_ht, $qty, GETPOST('remise_percent'),
$date_start, $date_end, $vat_rate, $localtax1_rate, $localtax2_rate, 'HT', $info_bits, $type, $date_start, $date_end, $vat_rate, $localtax1_rate, $localtax2_rate, 'HT', $info_bits, $type,
GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $special_code, $array_options, GETPOST('progress'), GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $special_code, $array_options, GETPOST('progress'),
$_POST['units'], $pu_ht_devise); $_POST['units'], $pu_ht_devise);
@ -2352,7 +2352,7 @@ if (empty($reshook))
{ {
$lineId = intval($lineId); $lineId = intval($lineId);
$originLine = new $lineClassName($db); $originLine = new $lineClassName($db);
if(intval($fromElementid) > 0 && $originLine->fetch( $lineId ) > 0) if(intval($fromElementid) > 0 && $originLine->fetch($lineId) > 0)
{ {
$originLine->fetch_optionals($lineId); $originLine->fetch_optionals($lineId);
$desc = $originLine->desc; $desc = $originLine->desc;

View File

@ -1858,7 +1858,7 @@ class FactureLigneRec extends CommonInvoiceLine
} }
$sql.= ", rang=".$this->rang; $sql.= ", rang=".$this->rang;
$sql.= ", special_code=".$this->special_code; $sql.= ", special_code=".$this->special_code;
$sql.= ", fk_unit=".($this->fk_unit ?"'".$this->db->escape($this->fk_unit )."'":"null"); $sql.= ", fk_unit=".($this->fk_unit ?"'".$this->db->escape($this->fk_unit)."'":"null");
$sql.= ", fk_contract_line=".($this->fk_contract_line?$this->fk_contract_line:"null"); $sql.= ", fk_contract_line=".($this->fk_contract_line?$this->fk_contract_line:"null");
$sql.= " WHERE rowid = ".$this->id; $sql.= " WHERE rowid = ".$this->id;

View File

@ -855,7 +855,7 @@ if (empty($reshook))
// Update line // Update line
if (! $error) if (! $error)
{ {
$result = $object->updateline( $result = $object->updateline(
GETPOST('lineid'), GETPOST('lineid'),
$description, $description,
$pu_ht, $pu_ht,

View File

@ -303,7 +303,7 @@ if ($massaction == 'withdrawrequest')
$error++; $error++;
setEventMessages($objecttmp->ref.' '.$langs->trans("RequestAlreadyDone"), $objecttmp->errors, 'warnings'); setEventMessages($objecttmp->ref.' '.$langs->trans("RequestAlreadyDone"), $objecttmp->errors, 'warnings');
} }
elseif (!empty($objecttmp->mode_reglement_code ) && $objecttmp->mode_reglement_code != 'PRE'){ elseif (!empty($objecttmp->mode_reglement_code) && $objecttmp->mode_reglement_code != 'PRE'){
$error++; $error++;
setEventMessages($objecttmp->ref.' '.$langs->trans("BadPaymentMethod"), $objecttmp->errors, 'errors'); setEventMessages($objecttmp->ref.' '.$langs->trans("BadPaymentMethod"), $objecttmp->errors, 'errors');
} }

View File

@ -321,7 +321,7 @@ if ($modecompta == 'CREANCES-DETTES')
// Array header // Array header
print "<tr class=\"liste_titre\">"; print "<tr class=\"liste_titre\">";
print_liste_field_titre( print_liste_field_titre(
$langs->trans("Product"), $langs->trans("Product"),
$_SERVER["PHP_SELF"], $_SERVER["PHP_SELF"],
"ref", "ref",
@ -331,7 +331,7 @@ if ($modecompta == 'CREANCES-DETTES')
$sortfield, $sortfield,
$sortorder $sortorder
); );
print_liste_field_titre( print_liste_field_titre(
$langs->trans('Quantity'), $langs->trans('Quantity'),
$_SERVER["PHP_SELF"], $_SERVER["PHP_SELF"],
"qty", "qty",
@ -341,7 +341,7 @@ if ($modecompta == 'CREANCES-DETTES')
$sortfield, $sortfield,
$sortorder $sortorder
); );
print_liste_field_titre( print_liste_field_titre(
$langs->trans("Percentage"), $langs->trans("Percentage"),
$_SERVER["PHP_SELF"], $_SERVER["PHP_SELF"],
"qty", "qty",
@ -351,7 +351,7 @@ if ($modecompta == 'CREANCES-DETTES')
$sortfield, $sortfield,
$sortorder $sortorder
); );
print_liste_field_titre( print_liste_field_titre(
$langs->trans('AmountHT'), $langs->trans('AmountHT'),
$_SERVER["PHP_SELF"], $_SERVER["PHP_SELF"],
"amount", "amount",
@ -361,7 +361,7 @@ if ($modecompta == 'CREANCES-DETTES')
$sortfield, $sortfield,
$sortorder $sortorder
); );
print_liste_field_titre( print_liste_field_titre(
$langs->trans("AmountTTC"), $langs->trans("AmountTTC"),
$_SERVER["PHP_SELF"], $_SERVER["PHP_SELF"],
"amount_ttc", "amount_ttc",
@ -371,7 +371,7 @@ if ($modecompta == 'CREANCES-DETTES')
$sortfield, $sortfield,
$sortorder $sortorder
); );
print_liste_field_titre( print_liste_field_titre(
$langs->trans("Percentage"), $langs->trans("Percentage"),
$_SERVER["PHP_SELF"], $_SERVER["PHP_SELF"],
"amount_ttc", "amount_ttc",

View File

@ -378,10 +378,10 @@ if (! $error && $massaction == 'confirm_presend')
$parameters=array('mode'=>'formemail'); $parameters=array('mode'=>'formemail');
if ( ! empty( $listofobjectthirdparties ) ) { if ( ! empty($listofobjectthirdparties) ) {
$parameters['listofobjectthirdparties'] = $listofobjectthirdparties; $parameters['listofobjectthirdparties'] = $listofobjectthirdparties;
} }
if ( ! empty( $listofobjectref ) ) { if ( ! empty($listofobjectref) ) {
$parameters['listofobjectref'] = $listofobjectref; $parameters['listofobjectref'] = $listofobjectref;
} }

View File

@ -1297,16 +1297,15 @@ class CMailFile
$port, // which Port number to use $port, // which Port number to use
$errno, // actual system level error $errno, // actual system level error
$errstr, // and any text that goes with the error $errstr, // and any text that goes with the error
$timeout $timeout // timeout for reading/writing data over the socket
)) // timeout for reading/writing data over the socket )) {
{
// Windows still does not have support for this timeout function // Windows still does not have support for this timeout function
if (function_exists('stream_set_timeout')) stream_set_timeout($socket, $timeout, 0); if (function_exists('stream_set_timeout')) stream_set_timeout($socket, $timeout, 0);
dol_syslog("Now we wait for answer 220"); dol_syslog("Now we wait for answer 220");
// Check response from Server // Check response from Server
if ( $_retVal = $this->server_parse($socket, "220") ) $_retVal = $socket; if ($_retVal = $this->server_parse($socket, "220")) $_retVal = $socket;
} }
else else
{ {

View File

@ -882,7 +882,7 @@ abstract class CommonDocGenerator
// Sorting // Sorting
uasort ( $this->cols, array( $this, 'columnSort' ) ); uasort ($this->cols, array( $this, 'columnSort' ));
// Positionning // Positionning
$curX = $this->page_largeur-$this->marge_droite; // start from right $curX = $this->page_largeur-$this->marge_droite; // start from right
@ -899,7 +899,7 @@ abstract class CommonDocGenerator
if(!empty($colDef['scale'])){ if(!empty($colDef['scale'])){
// In case of column widht is defined by percentage // In case of column widht is defined by percentage
$colDef['width'] = abs($arrayWidth * $colDef['scale'] / 100 ); $colDef['width'] = abs($arrayWidth * $colDef['scale'] / 100);
} }
if(empty($colDef['width'])){ if(empty($colDef['width'])){
@ -1049,7 +1049,7 @@ abstract class CommonDocGenerator
if(empty($columnText)) return; if(empty($columnText)) return;
$pdf->SetXY($this->getColumnContentXStart($colKey), $curY); // Set curent position $pdf->SetXY($this->getColumnContentXStart($colKey), $curY); // Set curent position
$colDef = $this->cols[$colKey]; $colDef = $this->cols[$colKey];
$pdf->writeHTMLCell( $this->getColumnContentWidth($colKey), 2, $this->getColumnContentXStart($colKey), $curY, $columnText, 0, 0, 0, true, $colDef['content']['align']); $pdf->writeHTMLCell($this->getColumnContentWidth($colKey), 2, $this->getColumnContentXStart($colKey), $curY, $columnText, 0, 0, 0, true, $colDef['content']['align']);
} }
} }

View File

@ -7183,8 +7183,8 @@ abstract class CommonObject
if (! $error) if (! $error)
{ {
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.$this->table_element; $sql = 'INSERT INTO '.MAIN_DB_PREFIX.$this->table_element;
$sql.= ' ('.implode( ", ", $keys ).')'; $sql.= ' ('.implode(", ", $keys).')';
$sql.= ' VALUES ('.implode( ", ", $values ).')'; $sql.= ' VALUES ('.implode(", ", $values).')';
$res = $this->db->query($sql); $res = $this->db->query($sql);
if ($res===false) { if ($res===false) {
@ -7312,7 +7312,7 @@ abstract class CommonObject
}*/ }*/
} }
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element.' SET '.implode( ',', $tmp ).' WHERE rowid='.$this->id ; $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element.' SET '.implode(',', $tmp).' WHERE rowid='.$this->id ;
$this->db->begin(); $this->db->begin();
if (! $error) if (! $error)

View File

@ -1346,11 +1346,11 @@ class ExtraFields
// Init des compteurs // Init des compteurs
$nbPregRepl = $nbPregSel = 0; $nbPregRepl = $nbPregSel = 0;
// On retire toutes les parenthèses sans = avant // On retire toutes les parenthèses sans = avant
$InfoFieldList[4]=preg_replace( '#([^=])(\([^)^(]*(' . $word . ')[^)^(]*\))#', '$1 $3 ', $InfoFieldList[4], -1, $nbPregRepl); $InfoFieldList[4]=preg_replace('#([^=])(\([^)^(]*(' . $word . ')[^)^(]*\))#', '$1 $3 ', $InfoFieldList[4], -1, $nbPregRepl);
// On retire les espaces autour des = et parenthèses // On retire les espaces autour des = et parenthèses
$InfoFieldList[4]=preg_replace('# *(=|\(|\)) *#', '$1', $InfoFieldList[4]); $InfoFieldList[4]=preg_replace('# *(=|\(|\)) *#', '$1', $InfoFieldList[4]);
// On retire toutes les parenthèses avec = avant // On retire toutes les parenthèses avec = avant
$InfoFieldList[4]=preg_replace( '#\b[a-zA-Z0-9-\.-_]+\b=\([^)^(]*(' . $word . ')[^)^(]*\)#', '$1 ', $InfoFieldList[4], -1, $nbPregSel); $InfoFieldList[4]=preg_replace('#\b[a-zA-Z0-9-\.-_]+\b=\([^)^(]*(' . $word . ')[^)^(]*\)#', '$1 ', $InfoFieldList[4], -1, $nbPregSel);
// On retire les espaces autour des = et parenthèses // On retire les espaces autour des = et parenthèses
$InfoFieldList[4]=preg_replace('# *(=|\(|\)) *#', '$1', $InfoFieldList[4]); $InfoFieldList[4]=preg_replace('# *(=|\(|\)) *#', '$1', $InfoFieldList[4]);

View File

@ -145,7 +145,7 @@ class HookManager
// Define type of hook ('output' or 'addreplace'. 'returnvalue' is deprecated because a 'addreplace' hook can also return resPrint and resArray). // Define type of hook ('output' or 'addreplace'. 'returnvalue' is deprecated because a 'addreplace' hook can also return resPrint and resArray).
$hooktype='output'; $hooktype='output';
if (in_array( if (in_array(
$method, $method,
array( array(
'addCalendarChoice', 'addCalendarChoice',

View File

@ -1526,7 +1526,7 @@ class Form
'showsoc'=>$showsoc, 'showsoc'=>$showsoc,
); );
$reshook = $hookmanager->executeHooks( 'afterSelectContactOptions', $parameters, $this, $action ); // Note that $action and $object may have been modified by some hooks $reshook = $hookmanager->executeHooks('afterSelectContactOptions', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
if ($htmlname != 'none' && ! $options_only) if ($htmlname != 'none' && ! $options_only)
{ {

View File

@ -1722,7 +1722,7 @@ class FormFile
print '<table width="100%" class="liste">'; print '<table width="100%" class="liste">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre( print_liste_field_titre(
$langs->trans("Links"), $langs->trans("Links"),
$_SERVER['PHP_SELF'], $_SERVER['PHP_SELF'],
"name", "name",
@ -1732,7 +1732,7 @@ class FormFile
$sortfield, $sortfield,
$sortorder $sortorder
); );
print_liste_field_titre( print_liste_field_titre(
"", "",
"", "",
"", "",
@ -1740,7 +1740,7 @@ class FormFile
"", "",
'class="right"' 'class="right"'
); );
print_liste_field_titre( print_liste_field_titre(
$langs->trans("Date"), $langs->trans("Date"),
$_SERVER['PHP_SELF'], $_SERVER['PHP_SELF'],
"date", "date",
@ -1750,7 +1750,7 @@ class FormFile
$sortfield, $sortfield,
$sortorder $sortorder
); );
print_liste_field_titre( print_liste_field_titre(
'', '',
$_SERVER['PHP_SELF'], $_SERVER['PHP_SELF'],
"", "",

View File

@ -426,8 +426,7 @@ class FormMail extends Form
$out.= '<input class="button" type="submit" value="'.$langs->trans('Apply').'" name="modelselected" id="modelselected">'; $out.= '<input class="button" type="submit" value="'.$langs->trans('Apply').'" name="modelselected" id="modelselected">';
$out.= ' &nbsp; '; $out.= ' &nbsp; ';
$out.= '</div>'; $out.= '</div>';
} } elseif (! empty($this->param['models']) && in_array($this->param['models'], array(
elseif (! empty($this->param['models']) && in_array($this->param['models'], array(
'propal_send','order_send','facture_send', 'propal_send','order_send','facture_send',
'shipping_send','fichinter_send','supplier_proposal_send','order_supplier_send', 'shipping_send','fichinter_send','supplier_proposal_send','order_supplier_send',
'invoice_supplier_send','thirdparty','contract','user','all' 'invoice_supplier_send','thirdparty','contract','user','all'

View File

@ -90,7 +90,7 @@ class FormProjets
$selected_input_value=$project->ref; $selected_input_value=$project->ref;
} }
$urloption='socid='.$socid.'&htmlname='.$htmlname.'&discardclosed='.$discard_closed; $urloption='socid='.$socid.'&htmlname='.$htmlname.'&discardclosed='.$discard_closed;
$out.=ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PROJECT_USE_SEARCH_TO_SELECT, 0, array( $out.=ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PROJECT_USE_SEARCH_TO_SELECT, 0, array(
// 'update' => array( // 'update' => array(
// 'projectid' => 'id' // 'projectid' => 'id'
// ) // )

View File

@ -382,9 +382,8 @@ class SMTPs
$this->getPort(), // which Port number to use $this->getPort(), // which Port number to use
$this->errno, // actual system level error $this->errno, // actual system level error
$this->errstr, // and any text that goes with the error $this->errstr, // and any text that goes with the error
$this->_smtpTimeout $this->_smtpTimeout // timeout for reading/writing data over the socket
)) // timeout for reading/writing data over the socket )) {
{
// Fix from PHP SMTP class by 'Chris Ryan' // Fix from PHP SMTP class by 'Chris Ryan'
// Sometimes the SMTP server takes a little longer to respond // Sometimes the SMTP server takes a little longer to respond
// so we will give it a longer timeout for the first read // so we will give it a longer timeout for the first read
@ -990,7 +989,7 @@ class SMTPs
$aryHost = $this->_msgRecipients; $aryHost = $this->_msgRecipients;
// Only run this if we have something // Only run this if we have something
if ( !empty ($_addrList )) if ( !empty ($_addrList))
{ {
// $_addrList can be a STRING or an array // $_addrList can be a STRING or an array
if ( is_string($_addrList) ) if ( is_string($_addrList) )

View File

@ -93,7 +93,7 @@ function SendError($number, $text)
if ( $_GET['Command'] == 'FileUpload' ) if ( $_GET['Command'] == 'FileUpload' )
SendUploadResults($number, "", "", $text); SendUploadResults($number, "", "", $text);
if ( isset( $GLOBALS['HeaderSent'] ) && $GLOBALS['HeaderSent'] ) if ( isset($GLOBALS['HeaderSent']) && $GLOBALS['HeaderSent'] )
{ {
SendErrorNode($number, $text); SendErrorNode($number, $text);
CreateXmlFooter(); CreateXmlFooter();

View File

@ -140,7 +140,7 @@ function CreateFolder($resourceType, $currentFolder)
$sErrorNumber = '0' ; $sErrorNumber = '0' ;
$sErrorMsg = '' ; $sErrorMsg = '' ;
if ( isset( $_GET['NewFolderName'] ) ) if ( isset($_GET['NewFolderName']) )
{ {
$sNewFolderName = $_GET['NewFolderName'] ; $sNewFolderName = $_GET['NewFolderName'] ;
$sNewFolderName = SanitizeFolderName($sNewFolderName); $sNewFolderName = SanitizeFolderName($sNewFolderName);
@ -202,7 +202,7 @@ function FileUpload($resourceType, $currentFolder, $sCommand, $CKEcallback = '')
$sErrorNumber = '0' ; $sErrorNumber = '0' ;
$sFileName = '' ; $sFileName = '' ;
if ( isset( $_FILES['NewFile'] ) && !is_null($_FILES['NewFile']['tmp_name']) if ( isset($_FILES['NewFile']) && !is_null($_FILES['NewFile']['tmp_name'])
// This is for the QuickUpload tab box // This is for the QuickUpload tab box
or (isset($_FILES['upload']) && !is_null($_FILES['upload']['tmp_name']))) or (isset($_FILES['upload']) && !is_null($_FILES['upload']['tmp_name'])))
{ {
@ -223,7 +223,7 @@ function FileUpload($resourceType, $currentFolder, $sCommand, $CKEcallback = '')
$sExtension = substr($sFileName, (strrpos($sFileName, '.') + 1)); $sExtension = substr($sFileName, (strrpos($sFileName, '.') + 1));
$sExtension = strtolower($sExtension); $sExtension = strtolower($sExtension);
if ( isset( $Config['SecureImageUploads'] ) ) if ( isset($Config['SecureImageUploads']) )
{ {
if ( ( $isImageValid = IsImageValid($oFile['tmp_name'], $sExtension) ) === false ) if ( ( $isImageValid = IsImageValid($oFile['tmp_name'], $sExtension) ) === false )
{ {
@ -231,7 +231,7 @@ function FileUpload($resourceType, $currentFolder, $sCommand, $CKEcallback = '')
} }
} }
if ( isset( $Config['HtmlExtensions'] ) ) if ( isset($Config['HtmlExtensions']) )
{ {
if (!IsHtmlExtension($sExtension, $Config['HtmlExtensions']) && if (!IsHtmlExtension($sExtension, $Config['HtmlExtensions']) &&
($detectHtml = DetectHtml($oFile['tmp_name'])) === true) ($detectHtml = DetectHtml($oFile['tmp_name'])) === true)
@ -261,13 +261,13 @@ function FileUpload($resourceType, $currentFolder, $sCommand, $CKEcallback = '')
if ( is_file($sFilePath) ) if ( is_file($sFilePath) )
{ {
if ( isset( $Config['ChmodOnUpload'] ) && !$Config['ChmodOnUpload'] ) if ( isset($Config['ChmodOnUpload']) && !$Config['ChmodOnUpload'] )
{ {
break ; break ;
} }
$permissions = '0777'; $permissions = '0777';
if ( isset( $Config['ChmodOnUpload'] ) && $Config['ChmodOnUpload'] ) if ( isset($Config['ChmodOnUpload']) && $Config['ChmodOnUpload'] )
{ {
$permissions = (string) $Config['ChmodOnUpload'] ; $permissions = (string) $Config['ChmodOnUpload'] ;
} }
@ -285,12 +285,12 @@ function FileUpload($resourceType, $currentFolder, $sCommand, $CKEcallback = '')
if ( file_exists($sFilePath) ) if ( file_exists($sFilePath) )
{ {
//previous checks failed, try once again //previous checks failed, try once again
if ( isset( $isImageValid ) && $isImageValid === -1 && IsImageValid($sFilePath, $sExtension) === false ) if ( isset($isImageValid) && $isImageValid === -1 && IsImageValid($sFilePath, $sExtension) === false )
{ {
@unlink($sFilePath); @unlink($sFilePath);
$sErrorNumber = '202' ; $sErrorNumber = '202' ;
} }
elseif ( isset( $detectHtml ) && $detectHtml === -1 && DetectHtml($sFilePath) === true ) elseif ( isset($detectHtml) && $detectHtml === -1 && DetectHtml($sFilePath) === true )
{ {
@unlink($sFilePath); @unlink($sFilePath);
$sErrorNumber = '202' ; $sErrorNumber = '202' ;
@ -318,7 +318,7 @@ function FileUpload($resourceType, $currentFolder, $sCommand, $CKEcallback = '')
else else
{ {
//issue the CKEditor Callback //issue the CKEditor Callback
SendCKEditorResults( SendCKEditorResults(
$CKEcallback, $CKEcallback,
$sFileUrl, $sFileUrl,
($sErrorNumber != 0 ? 'Error '. $sErrorNumber. ' upload failed.' : 'Upload Successful') ($sErrorNumber != 0 ? 'Error '. $sErrorNumber. ' upload failed.' : 'Upload Successful')

View File

@ -45,7 +45,7 @@ function DoResponse()
if (!isset($_GET)) { if (!isset($_GET)) {
global $_GET; global $_GET;
} }
if ( !isset( $_GET['Command'] ) || !isset( $_GET['Type'] ) || !isset( $_GET['CurrentFolder'] ) ) if ( !isset($_GET['Command']) || !isset($_GET['Type']) || !isset($_GET['CurrentFolder']) )
return; return;
// Get the main request informaiton. // Get the main request informaiton.

View File

@ -175,14 +175,14 @@ function CreateServerFolder($folderPath, $lastFolder = null)
// Enable error tracking to catch the error. // Enable error tracking to catch the error.
ini_set('track_errors', '1'); ini_set('track_errors', '1');
if ( isset( $Config['ChmodOnFolderCreate'] ) && !$Config['ChmodOnFolderCreate'] ) if ( isset($Config['ChmodOnFolderCreate']) && !$Config['ChmodOnFolderCreate'] )
{ {
mkdir($folderPath); mkdir($folderPath);
} }
else else
{ {
$permissions = '0777'; $permissions = '0777';
if ( isset( $Config['ChmodOnFolderCreate'] ) && $Config['ChmodOnFolderCreate']) if ( isset($Config['ChmodOnFolderCreate']) && $Config['ChmodOnFolderCreate'])
{ {
$permissions = (string) $Config['ChmodOnFolderCreate']; $permissions = (string) $Config['ChmodOnFolderCreate'];
} }
@ -315,7 +315,7 @@ function GetCurrentFolder()
if (!isset($_GET)) { if (!isset($_GET)) {
global $_GET; global $_GET;
} }
$sCurrentFolder = isset( $_GET['CurrentFolder'] ) ? GETPOST('CurrentFolder', '', 1) : '/' ; $sCurrentFolder = isset($_GET['CurrentFolder']) ? GETPOST('CurrentFolder', '', 1) : '/' ;
// Check the current folder syntax (must begin and start with a slash). // Check the current folder syntax (must begin and start with a slash).
if (!preg_match('|/$|', $sCurrentFolder)) if (!preg_match('|/$|', $sCurrentFolder))

View File

@ -47,7 +47,7 @@ if ( !$Config['Enabled'] )
$sCommand = 'QuickUpload' ; $sCommand = 'QuickUpload' ;
// The file type (from the QueryString, by default 'File'). // The file type (from the QueryString, by default 'File').
$sType = isset( $_GET['Type'] ) ? $_GET['Type'] : 'File' ; $sType = isset($_GET['Type']) ? $_GET['Type'] : 'File' ;
$sCurrentFolder = "/" ; $sCurrentFolder = "/" ;

View File

@ -136,7 +136,7 @@ function dol_time_plus_duree($time, $duration_value, $duration_unit)
$interval = new DateInterval($deltastring); $interval = new DateInterval($deltastring);
if($sub) $date->sub($interval); if($sub) $date->sub($interval);
else $date->add( $interval ); else $date->add($interval);
return $date->getTimestamp(); return $date->getTimestamp();
} }

View File

@ -13,7 +13,7 @@
* Copyright (C) 2014 Cédric GROSS <c.gross@kreiz-it.fr> * Copyright (C) 2014 Cédric GROSS <c.gross@kreiz-it.fr>
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* 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 * 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
@ -843,7 +843,7 @@ function dol_string_unaccent($str)
else else
{ {
// See http://www.ascii-code.com/ // See http://www.ascii-code.com/
$string = strtr( $string = strtr(
$str, $str,
"\xC0\xC1\xC2\xC3\xC4\xC5\xC7 "\xC0\xC1\xC2\xC3\xC4\xC5\xC7
\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1 \xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1
@ -2969,8 +2969,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
$picto .= '.png'; $picto .= '.png';
} }
$fullpathpicto = $picto; $fullpathpicto = $picto;
} } else {
else {
$pictowithoutext = preg_replace('/(\.png|\.gif|\.svg)$/', '', $picto); $pictowithoutext = preg_replace('/(\.png|\.gif|\.svg)$/', '', $picto);
//if (in_array($picto, array('switch_off', 'switch_on', 'off', 'on'))) //if (in_array($picto, array('switch_off', 'switch_on', 'off', 'on')))
@ -5306,7 +5305,7 @@ function dol_mkdir($dir, $dataroot = '', $newmask = null)
umask(0); umask(0);
$dirmaskdec=octdec($newmask); $dirmaskdec=octdec($newmask);
if (empty($newmask)) { if (empty($newmask)) {
$dirmaskdec = empty( $conf->global->MAIN_UMASK ) ? octdec( '0755' ) : octdec( $conf->global->MAIN_UMASK ); $dirmaskdec = empty($conf->global->MAIN_UMASK) ? octdec('0755') : octdec($conf->global->MAIN_UMASK);
} }
$dirmaskdec |= octdec('0111'); // Set x bit required for directories $dirmaskdec |= octdec('0111'); // Set x bit required for directories
if (! @mkdir($ccdir_osencoded, $dirmaskdec)) if (! @mkdir($ccdir_osencoded, $dirmaskdec))
@ -5792,7 +5791,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
// Add SIGNATURE into substitutionarray first, so, when we will make the substitution, // Add SIGNATURE into substitutionarray first, so, when we will make the substitution,
// this will include signature content first and then replace var found into content of signature // this will include signature content first and then replace var found into content of signature
$signature = $user->signature; $signature = $user->signature;
$substitutionarray=array_merge($substitutionarray, array( $substitutionarray=array_merge($substitutionarray, array(
'__USER_SIGNATURE__' => (string) (($signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? ($onlykey == 2 ? dol_trunc(dol_string_nohtmltag($signature), 30) : $signature) : '') '__USER_SIGNATURE__' => (string) (($signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? ($onlykey == 2 ? dol_trunc(dol_string_nohtmltag($signature), 30) : $signature) : '')
) )
); );
@ -5802,7 +5801,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
$substitutionarray['__SIGNATURE__'] = (string) (($signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? ($onlykey == 2 ? dol_trunc(dol_string_nohtmltag($signature), 30) : $signature) : ''); $substitutionarray['__SIGNATURE__'] = (string) (($signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? ($onlykey == 2 ? dol_trunc(dol_string_nohtmltag($signature), 30) : $signature) : '');
} }
$substitutionarray=array_merge($substitutionarray, array( $substitutionarray=array_merge($substitutionarray, array(
'__USER_ID__' => (string) $user->id, '__USER_ID__' => (string) $user->id,
'__USER_LOGIN__' => (string) $user->login, '__USER_LOGIN__' => (string) $user->login,
'__USER_LASTNAME__' => (string) $user->lastname, '__USER_LASTNAME__' => (string) $user->lastname,
@ -5815,7 +5814,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
} }
if ((empty($exclude) || ! in_array('mycompany', $exclude)) && is_object($mysoc)) if ((empty($exclude) || ! in_array('mycompany', $exclude)) && is_object($mysoc))
{ {
$substitutionarray=array_merge($substitutionarray, array( $substitutionarray=array_merge($substitutionarray, array(
'__MYCOMPANY_NAME__' => $mysoc->name, '__MYCOMPANY_NAME__' => $mysoc->name,
'__MYCOMPANY_EMAIL__' => $mysoc->email, '__MYCOMPANY_EMAIL__' => $mysoc->email,
'__MYCOMPANY_PROFID1__' => $mysoc->idprof1, '__MYCOMPANY_PROFID1__' => $mysoc->idprof1,
@ -6072,7 +6071,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
$tmp4=dol_get_next_day($tmp['mday'], $tmp['mon'], $tmp['year']); $tmp4=dol_get_next_day($tmp['mday'], $tmp['mon'], $tmp['year']);
$tmp5=dol_get_next_month($tmp['mon'], $tmp['year']); $tmp5=dol_get_next_month($tmp['mon'], $tmp['year']);
$substitutionarray=array_merge($substitutionarray, array( $substitutionarray=array_merge($substitutionarray, array(
'__DAY__' => (string) $tmp['mday'], '__DAY__' => (string) $tmp['mday'],
'__DAY_TEXT__' => $outputlangs->trans('Day'.$tmp['wday']), // Monday '__DAY_TEXT__' => $outputlangs->trans('Day'.$tmp['wday']), // Monday
'__DAY_TEXT_SHORT__' => $outputlangs->trans($tmp['weekday'].'Min'), // Mon '__DAY_TEXT_SHORT__' => $outputlangs->trans($tmp['weekday'].'Min'), // Mon

View File

@ -2318,7 +2318,7 @@ function getModuleDirForApiClass($module)
*/ */
function random_color_part($min = 0, $max = 255) function random_color_part($min = 0, $max = 255)
{ {
return str_pad( dechex( mt_rand( $min, $max) ), 2, '0', STR_PAD_LEFT); return str_pad(dechex(mt_rand($min, $max)), 2, '0', STR_PAD_LEFT);
} }
/* /*

View File

@ -273,7 +273,7 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = '
if ($val['default'] != '') if ($val['default'] != '')
{ {
if (preg_match('/^null$/i', $val['default'])) $texttoinsert.= " DEFAULT NULL"; if (preg_match('/^null$/i', $val['default'])) $texttoinsert.= " DEFAULT NULL";
elseif (preg_match('/varchar/', $type )) $texttoinsert.= " DEFAULT '".$db->escape($val['default'])."'"; elseif (preg_match('/varchar/', $type)) $texttoinsert.= " DEFAULT '".$db->escape($val['default'])."'";
else $texttoinsert.= (($val['default'] > 0)?' DEFAULT '.$val['default']:''); else $texttoinsert.= (($val['default'] > 0)?' DEFAULT '.$val['default']:'');
} }
} }

View File

@ -124,7 +124,7 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di
$invoicefieldref='ref'; $invoicefieldref='ref';
} }
if ( strpos( $type, 'localtax' ) === 0 ) { if ( strpos($type, 'localtax') === 0 ) {
$f_rate = $type . '_tx'; $f_rate = $type . '_tx';
} else { } else {
$f_rate = 'tva_tx'; $f_rate = 'tva_tx';
@ -593,7 +593,7 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire
$invoicefieldref='ref'; $invoicefieldref='ref';
} }
if ( strpos( $type, 'localtax' ) === 0 ) { if ( strpos($type, 'localtax') === 0 ) {
$f_rate = $type . '_tx'; $f_rate = $type . '_tx';
} else { } else {
$f_rate = 'tva_tx'; $f_rate = 'tva_tx';

View File

@ -1228,7 +1228,7 @@ class pdf_eratosthene extends ModelePDFCommandes
if (empty($hidetop)) if (empty($hidetop))
{ {
$pdf->SetXY($colDef['xStartPos'] + $colDef['title']['padding'][3], $tab_top + $colDef['title']['padding'][0] ); $pdf->SetXY($colDef['xStartPos'] + $colDef['title']['padding'][3], $tab_top + $colDef['title']['padding'][0]);
$textWidth = $colDef['width'] - $colDef['title']['padding'][3] -$colDef['title']['padding'][1]; $textWidth = $colDef['width'] - $colDef['title']['padding'][3] -$colDef['title']['padding'][1];
$pdf->MultiCell($textWidth, 2, $colDef['title']['label'], '', $colDef['title']['align']); $pdf->MultiCell($textWidth, 2, $colDef['title']['label'], '', $colDef['title']['align']);

View File

@ -601,7 +601,7 @@ class pdf_standard extends ModeleExpenseReport
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalttc, 4, price($object->lines[$linenumber]->total_ttc), 0, 'R'); $pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalttc, 4, price($object->lines[$linenumber]->total_ttc), 0, 'R');
// Comments // Comments
$pdf->SetXY($this->posxcomment, $curY ); $pdf->SetXY($this->posxcomment, $curY);
$comment = $outputlangs->trans("Date").':'. dol_print_date($object->lines[$linenumber]->date, "day", false, $outputlangs).' '; $comment = $outputlangs->trans("Date").':'. dol_print_date($object->lines[$linenumber]->date, "day", false, $outputlangs).' ';
$comment .= $outputlangs->trans("Type").':'. $expensereporttypecodetoshow.'<br>'; $comment .= $outputlangs->trans("Type").':'. $expensereporttypecodetoshow.'<br>';
if (! empty($object->lines[$linenumber]->projet_ref)) { if (! empty($object->lines[$linenumber]->projet_ref)) {

View File

@ -1519,7 +1519,7 @@ class pdf_sponge extends ModelePDFFactures
if (empty($hidetop)) if (empty($hidetop))
{ {
$pdf->SetXY($colDef['xStartPos'] + $colDef['title']['padding'][3], $tab_top + $colDef['title']['padding'][0] ); $pdf->SetXY($colDef['xStartPos'] + $colDef['title']['padding'][3], $tab_top + $colDef['title']['padding'][0]);
$textWidth = $colDef['width'] - $colDef['title']['padding'][3] -$colDef['title']['padding'][1]; $textWidth = $colDef['width'] - $colDef['title']['padding'][3] -$colDef['title']['padding'][1];
$pdf->MultiCell($textWidth, 2, $colDef['title']['label'], '', $colDef['title']['align']); $pdf->MultiCell($textWidth, 2, $colDef['title']['label'], '', $colDef['title']['align']);

View File

@ -44,7 +44,7 @@ class modHRM extends DolibarrModules
$this->family = "hr"; $this->family = "hr";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace( '/^mod/i', '', get_class($this)); $this->name = preg_replace('/^mod/i', '', get_class($this));
$this->description = "Management of employees carrier and feelings (department, employment contract)"; $this->description = "Management of employees carrier and feelings (department, employment contract)";
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version // Possible values for version are: 'development', 'experimental', 'dolibarr' or version

View File

@ -438,7 +438,7 @@ class modProduct extends DolibarrModules
if (is_object($mysoc) && $mysoc->useNPR()) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r], array('sp.recuperableonly'=>'VATNPR')); if (is_object($mysoc) && $mysoc->useNPR()) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r], array('sp.recuperableonly'=>'VATNPR'));
if (is_object($mysoc) && $mysoc->useLocalTax(1)) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r], array('sp.localtax1_tx'=>'LT1', 'sp.localtax1_type'=>'LT1Type')); if (is_object($mysoc) && $mysoc->useLocalTax(1)) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r], array('sp.localtax1_tx'=>'LT1', 'sp.localtax1_type'=>'LT1Type'));
if (is_object($mysoc) && $mysoc->useLocalTax(2)) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r], array('sp.localtax2_tx'=>'LT2', 'sp.localtax2_type'=>'LT2Type')); if (is_object($mysoc) && $mysoc->useLocalTax(2)) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r], array('sp.localtax2_tx'=>'LT2', 'sp.localtax2_type'=>'LT2Type'));
$this->import_fields_array[$r]=array_merge($this->import_fields_array[$r], array( $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r], array(
'sp.price'=>"PriceQtyMinHT*", 'sp.price'=>"PriceQtyMinHT*",
'sp.unitprice'=>'UnitPriceHT*', // TODO Make this field not required and calculate it from price and qty 'sp.unitprice'=>'UnitPriceHT*', // TODO Make this field not required and calculate it from price and qty
'sp.remise_percent'=>'DiscountQtyMin' 'sp.remise_percent'=>'DiscountQtyMin'

View File

@ -1398,7 +1398,7 @@ class pdf_cyan extends ModelePDFPropales
if (empty($hidetop)) if (empty($hidetop))
{ {
$pdf->SetXY($colDef['xStartPos'] + $colDef['title']['padding'][3], $tab_top + $colDef['title']['padding'][0] ); $pdf->SetXY($colDef['xStartPos'] + $colDef['title']['padding'][3], $tab_top + $colDef['title']['padding'][0]);
$textWidth = $colDef['width'] - $colDef['title']['padding'][3] -$colDef['title']['padding'][1]; $textWidth = $colDef['width'] - $colDef['title']['padding'][3] -$colDef['title']['padding'][1];
$pdf->MultiCell($textWidth, 2, $colDef['title']['label'], '', $colDef['title']['align']); $pdf->MultiCell($textWidth, 2, $colDef['title']['label'], '', $colDef['title']['align']);

View File

@ -909,7 +909,7 @@ class pdf_standard extends ModelePDFStock
if (empty($hidetop)) if (empty($hidetop))
{ {
$pdf->SetXY($this->posxunit - 1, $tab_top + 1); $pdf->SetXY($this->posxunit - 1, $tab_top + 1);
$pdf->MultiCell($this->posxdiscount - $this->posxunit - 1, 2, $outputlangs->transnoentities("EstimatedStockValueShort"), '', $pdf->MultiCell($this->posxdiscount - $this->posxunit - 1, 2, $outputlangs->transnoentities("EstimatedStockValueShort"), '',
'C'); 'C');
} }

View File

@ -146,7 +146,7 @@ print '<script type="text/javascript" language="javascript">
print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
} }
print '</td><td>'; print '</td><td>';
print $formadvtargetemaling->advMultiselectarray('cust_status', array ( print $formadvtargetemaling->advMultiselectarray('cust_status', array (
'0' => $langs->trans('ActivityCeased'), '0' => $langs->trans('ActivityCeased'),
'1' => $langs->trans('InActivity') '1' => $langs->trans('InActivity')
), $array_query['cust_status']); ), $array_query['cust_status']);
@ -341,7 +341,7 @@ print '<script type="text/javascript" language="javascript">
print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
} }
print '</td><td>'; print '</td><td>';
print $formadvtargetemaling->advMultiselectarray('contact_status', array ( print $formadvtargetemaling->advMultiselectarray('contact_status', array (
'0' => $langs->trans('ActivityCeased'), '0' => $langs->trans('ActivityCeased'),
'1' => $langs->trans('InActivity') '1' => $langs->trans('InActivity')
), $array_query['contact_status']); ), $array_query['contact_status']);
@ -390,7 +390,7 @@ print '<script type="text/javascript" language="javascript">
print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
} }
print '</td><td>' . "\n"; print '</td><td>' . "\n";
print $form->selectarray('contact_no_email', array ( print $form->selectarray('contact_no_email', array (
'' => '', '' => '',
'1' => $langs->trans('Yes'), '1' => $langs->trans('Yes'),
'0' => $langs->trans('No') '0' => $langs->trans('No')

View File

@ -52,7 +52,7 @@ if (in_array($modulepart, array('product', 'produit', 'societe', 'user', 'ticket
if ($action == 'delete') if ($action == 'delete')
{ {
$langs->load("companies"); // Need for string DeleteFile+ConfirmDeleteFiles $langs->load("companies"); // Need for string DeleteFile+ConfirmDeleteFiles
print $form->formconfirm( print $form->formconfirm(
$_SERVER["PHP_SELF"] . '?id=' . $object->id . '&urlfile=' . urlencode(GETPOST("urlfile")) . '&linkid=' . GETPOST('linkid', 'int') . (empty($param)?'':$param), $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&urlfile=' . urlencode(GETPOST("urlfile")) . '&linkid=' . GETPOST('linkid', 'int') . (empty($param)?'':$param),
$langs->trans('DeleteFile'), $langs->trans('DeleteFile'),
$langs->trans('ConfirmDeleteFile'), $langs->trans('ConfirmDeleteFile'),

View File

@ -33,8 +33,7 @@
*/ */
// Protection to avoid direct call of template // Protection to avoid direct call of template
if (empty($object) || ! is_object($object)) if (empty($object) || ! is_object($object)) {
{
print "Error: this template page cannot be called directly as an URL"; print "Error: this template page cannot be called directly as an URL";
exit; exit;
} }

View File

@ -102,7 +102,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
// Order classify billed proposal // Order classify billed proposal
if ($action == 'ORDER_CLASSIFY_BILLED') if ($action == 'ORDER_CLASSIFY_BILLED')
{ {
dol_syslog( "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id ); dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
if (! empty($conf->propal->enabled) && ! empty($conf->workflow->enabled) && ! empty($conf->global->WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL)) if (! empty($conf->propal->enabled) && ! empty($conf->workflow->enabled) && ! empty($conf->global->WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL))
{ {
$object->fetchObjectLinked('', 'propal', $object->id, $object->element); $object->fetchObjectLinked('', 'propal', $object->id, $object->element);
@ -113,7 +113,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
{ {
if ($element->statut == Propal::STATUS_SIGNED || $element->statut == Propal::STATUS_BILLED) $totalonlinkedelements += $element->total_ht; if ($element->statut == Propal::STATUS_SIGNED || $element->statut == Propal::STATUS_BILLED) $totalonlinkedelements += $element->total_ht;
} }
dol_syslog( "Amount of linked proposals = ".$totalonlinkedelements.", of order = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht) ); dol_syslog("Amount of linked proposals = ".$totalonlinkedelements.", of order = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht));
if ( ($totalonlinkedelements == $object->total_ht) || (! empty($conf->global->WORKFLOW_CLASSIFY_IF_AMOUNTS_ARE_DIFFERENTS)) ) if ( ($totalonlinkedelements == $object->total_ht) || (! empty($conf->global->WORKFLOW_CLASSIFY_IF_AMOUNTS_ARE_DIFFERENTS)) )
{ {
foreach($object->linkedObjects['propal'] as $element) foreach($object->linkedObjects['propal'] as $element)
@ -129,7 +129,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
// classify billed order & billed propososal // classify billed order & billed propososal
if ($action == 'BILL_VALIDATE') if ($action == 'BILL_VALIDATE')
{ {
dol_syslog( "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id ); dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
// First classify billed the order to allow the proposal classify process // First classify billed the order to allow the proposal classify process
if (! empty($conf->commande->enabled) && ! empty($conf->workflow->enabled) && ! empty($conf->global->WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER)) if (! empty($conf->commande->enabled) && ! empty($conf->workflow->enabled) && ! empty($conf->global->WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER))
@ -142,7 +142,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
{ {
if ($element->statut == Commande::STATUS_VALIDATED || $element->statut == Commande::STATUS_SHIPMENTONPROCESS || $element->statut == Commande::STATUS_CLOSED) $totalonlinkedelements += $element->total_ht; if ($element->statut == Commande::STATUS_VALIDATED || $element->statut == Commande::STATUS_SHIPMENTONPROCESS || $element->statut == Commande::STATUS_CLOSED) $totalonlinkedelements += $element->total_ht;
} }
dol_syslog( "Amount of linked orders = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht) ); dol_syslog("Amount of linked orders = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht));
if ( ($totalonlinkedelements == $object->total_ht) || (! empty($conf->global->WORKFLOW_CLASSIFY_IF_AMOUNTS_ARE_DIFFERENTS)) ) if ( ($totalonlinkedelements == $object->total_ht) || (! empty($conf->global->WORKFLOW_CLASSIFY_IF_AMOUNTS_ARE_DIFFERENTS)) )
{ {
foreach($object->linkedObjects['commande'] as $element) foreach($object->linkedObjects['commande'] as $element)
@ -165,7 +165,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
{ {
if ($element->statut == Propal::STATUS_SIGNED || $element->statut == Propal::STATUS_BILLED) $totalonlinkedelements += $element->total_ht; if ($element->statut == Propal::STATUS_SIGNED || $element->statut == Propal::STATUS_BILLED) $totalonlinkedelements += $element->total_ht;
} }
dol_syslog( "Amount of linked proposals = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht) ); dol_syslog("Amount of linked proposals = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht));
if ( ($totalonlinkedelements == $object->total_ht) || (! empty($conf->global->WORKFLOW_CLASSIFY_IF_AMOUNTS_ARE_DIFFERENTS)) ) if ( ($totalonlinkedelements == $object->total_ht) || (! empty($conf->global->WORKFLOW_CLASSIFY_IF_AMOUNTS_ARE_DIFFERENTS)) )
{ {
foreach($object->linkedObjects['propal'] as $element) foreach($object->linkedObjects['propal'] as $element)
@ -181,7 +181,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
// classify billed order & billed propososal // classify billed order & billed propososal
if ($action == 'BILL_SUPPLIER_VALIDATE') if ($action == 'BILL_SUPPLIER_VALIDATE')
{ {
dol_syslog( "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id ); dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
// First classify billed the order to allow the proposal classify process // First classify billed the order to allow the proposal classify process
if (! empty($conf->fournisseur->enabled) && ! empty($conf->global->WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER)) if (! empty($conf->fournisseur->enabled) && ! empty($conf->global->WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER))
@ -194,7 +194,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
{ {
if ($element->statut == CommandeFournisseur::STATUS_ACCEPTED || $element->statut == CommandeFournisseur::STATUS_ORDERSENT || $element->statut == CommandeFournisseur::STATUS_RECEIVED_PARTIALLY || $element->statut == CommandeFournisseur::STATUS_RECEIVED_COMPLETELY) $totalonlinkedelements += $element->total_ht; if ($element->statut == CommandeFournisseur::STATUS_ACCEPTED || $element->statut == CommandeFournisseur::STATUS_ORDERSENT || $element->statut == CommandeFournisseur::STATUS_RECEIVED_PARTIALLY || $element->statut == CommandeFournisseur::STATUS_RECEIVED_COMPLETELY) $totalonlinkedelements += $element->total_ht;
} }
dol_syslog( "Amount of linked orders = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht) ); dol_syslog("Amount of linked orders = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht));
if ( ($totalonlinkedelements == $object->total_ht) || (! empty($conf->global->WORKFLOW_CLASSIFY_IF_AMOUNTS_ARE_DIFFERENTS)) ) if ( ($totalonlinkedelements == $object->total_ht) || (! empty($conf->global->WORKFLOW_CLASSIFY_IF_AMOUNTS_ARE_DIFFERENTS)) )
{ {
foreach($object->linkedObjects['order_supplier'] as $element) foreach($object->linkedObjects['order_supplier'] as $element)
@ -217,7 +217,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
{ {
if ($element->statut == SupplierProposal::STATUS_SIGNED || $element->statut == SupplierProposal::STATUS_BILLED) $totalonlinkedelements += $element->total_ht; if ($element->statut == SupplierProposal::STATUS_SIGNED || $element->statut == SupplierProposal::STATUS_BILLED) $totalonlinkedelements += $element->total_ht;
} }
dol_syslog( "Amount of linked supplier proposals = ".$totalonlinkedelements.", of supplier invoice = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht) ); dol_syslog("Amount of linked supplier proposals = ".$totalonlinkedelements.", of supplier invoice = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht));
if ( ($totalonlinkedelements == $object->total_ht) || (! empty($conf->global->WORKFLOW_CLASSIFY_IF_AMOUNTS_ARE_DIFFERENTS)) ) if ( ($totalonlinkedelements == $object->total_ht) || (! empty($conf->global->WORKFLOW_CLASSIFY_IF_AMOUNTS_ARE_DIFFERENTS)) )
{ {
foreach($object->linkedObjects['supplier_proposal'] as $element) foreach($object->linkedObjects['supplier_proposal'] as $element)
@ -233,7 +233,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
// Invoice classify billed order // Invoice classify billed order
if ($action == 'BILL_PAYED') if ($action == 'BILL_PAYED')
{ {
dol_syslog( "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id ); dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
if (! empty($conf->commande->enabled) && ! empty($conf->global->WORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER)) if (! empty($conf->commande->enabled) && ! empty($conf->global->WORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER))
{ {
@ -245,7 +245,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
{ {
if ($element->statut == Commande::STATUS_VALIDATED || $element->statut == Commande::STATUS_SHIPMENTONPROCESS || $element->statut == Commande::STATUS_CLOSED) $totalonlinkedelements += $element->total_ht; if ($element->statut == Commande::STATUS_VALIDATED || $element->statut == Commande::STATUS_SHIPMENTONPROCESS || $element->statut == Commande::STATUS_CLOSED) $totalonlinkedelements += $element->total_ht;
} }
dol_syslog( "Amount of linked orders = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht) ); dol_syslog("Amount of linked orders = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht));
if ( ($totalonlinkedelements == $object->total_ht) || (! empty($conf->global->WORKFLOW_CLASSIFY_IF_AMOUNTS_ARE_DIFFERENTS)) ) if ( ($totalonlinkedelements == $object->total_ht) || (! empty($conf->global->WORKFLOW_CLASSIFY_IF_AMOUNTS_ARE_DIFFERENTS)) )
{ {
foreach($object->linkedObjects['commande'] as $element) foreach($object->linkedObjects['commande'] as $element)
@ -260,7 +260,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
if ($action=='SHIPPING_VALIDATE') if ($action=='SHIPPING_VALIDATE')
{ {
dol_syslog( "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id ); dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
if (! empty($conf->commande->enabled) && ! empty($conf->expedition->enabled) && ! empty($conf->workflow->enabled) && ! empty($conf->global->WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING)) if (! empty($conf->commande->enabled) && ! empty($conf->expedition->enabled) && ! empty($conf->workflow->enabled) && ! empty($conf->global->WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING))
{ {

View File

@ -86,7 +86,7 @@ class InterfaceActionsBlockedLog extends DolibarrTriggers
{ {
$qualified++; $qualified++;
if (in_array($action, array( if (in_array($action, array(
'MEMBER_SUBSCRIPTION_CREATE','MEMBER_SUBSCRIPTION_MODIFY','MEMBER_SUBSCRIPTION_DELETE', 'MEMBER_SUBSCRIPTION_CREATE','MEMBER_SUBSCRIPTION_MODIFY','MEMBER_SUBSCRIPTION_DELETE',
'DON_VALIDATE','DON_MODIFY','DON_DELETE'))) $amounts = (double) $object->amount; 'DON_VALIDATE','DON_MODIFY','DON_DELETE'))) $amounts = (double) $object->amount;
elseif ($action == 'CASHCONTROL_VALIDATE') elseif ($action == 'CASHCONTROL_VALIDATE')

View File

@ -300,7 +300,7 @@ class Don extends CommonObject
$len=dol_strlen($this->amount); $len=dol_strlen($this->amount);
for ($i = 0; $i < $len; $i++) for ($i = 0; $i < $len; $i++)
{ {
if (!isset($map[substr($this->amount, $i, 1)] )) if (!isset($map[substr($this->amount, $i, 1)]))
{ {
$error_string[] = $langs->trans('ErrorFieldRequired', $langs->trans('Amount')); $error_string[] = $langs->trans('ErrorFieldRequired', $langs->trans('Amount'));
$err++; $err++;

View File

@ -209,7 +209,7 @@ if ($action == 'add') {
} elseif ($action == 'setdate_when' && $user->rights->ficheinter->creer) { } elseif ($action == 'setdate_when' && $user->rights->ficheinter->creer) {
// Set next date of execution // Set next date of execution
$object->fetch($id); $object->fetch($id);
$date = dol_mktime( $date = dol_mktime(
GETPOST('date_whenhour'), GETPOST('date_whenmin'), 0, GETPOST('date_whenhour'), GETPOST('date_whenmin'), 0,
GETPOST('date_whenmonth'), GETPOST('date_whenday'), GETPOST('date_whenyear') GETPOST('date_whenmonth'), GETPOST('date_whenday'), GETPOST('date_whenyear')
); );
@ -294,7 +294,7 @@ if ($action == 'create') {
if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) { if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) {
// Duration // Duration
print '<tr><td>'.$langs->trans("TotalDuration").'</td>'; print '<tr><td>'.$langs->trans("TotalDuration").'</td>';
print '<td colspan="3">'.convertSecondToTime( print '<td colspan="3">'.convertSecondToTime(
$object->duration, 'all', $object->duration, 'all',
$conf->global->MAIN_DURATION_OF_WORKDAY $conf->global->MAIN_DURATION_OF_WORKDAY
).'</td>'; ).'</td>';
@ -307,7 +307,7 @@ if ($action == 'create') {
print "<tr><td>".$langs->trans("Project")."</td><td>"; print "<tr><td>".$langs->trans("Project")."</td><td>";
$projectid = GETPOST('projectid')?GETPOST('projectid'):$object->fk_project; $projectid = GETPOST('projectid')?GETPOST('projectid'):$object->fk_project;
$numprojet = $formproject->select_projects( $numprojet = $formproject->select_projects(
$object->thirdparty->id, $projectid, 'projectid', $object->thirdparty->id, $projectid, 'projectid',
0, 0, 1, 0, 0, 0, 0, '', 0, 0, '' 0, 0, 1, 0, 0, 0, 0, '', 0, 0, ''
); );
@ -342,7 +342,7 @@ if ($action == 'create') {
print $form->textwithpicto($langs->trans("Frequency"), $langs->transnoentitiesnoconv('toolTipFrequency')); print $form->textwithpicto($langs->trans("Frequency"), $langs->transnoentitiesnoconv('toolTipFrequency'));
print "</td><td>"; print "</td><td>";
print "<input type='text' name='frequency' value='".GETPOST('frequency', 'int')."' size='4' />&nbsp;"; print "<input type='text' name='frequency' value='".GETPOST('frequency', 'int')."' size='4' />&nbsp;";
print $form->selectarray( print $form->selectarray(
'unit_frequency', 'unit_frequency',
array('d'=>$langs->trans('Day'), 'm'=>$langs->trans('Month'), 'y'=>$langs->trans('Year')), array('d'=>$langs->trans('Day'), 'm'=>$langs->trans('Month'), 'y'=>$langs->trans('Year')),
(GETPOST('unit_frequency')?GETPOST('unit_frequency'):'m') (GETPOST('unit_frequency')?GETPOST('unit_frequency'):'m')
@ -352,7 +352,7 @@ if ($action == 'create') {
// First date of execution for cron // First date of execution for cron
print "<tr><td>".$langs->trans('NextDateToExecution')."</td><td>"; print "<tr><td>".$langs->trans('NextDateToExecution')."</td><td>";
if ($date_next_execution != "") if ($date_next_execution != "")
$date_next_execution = (GETPOST('remonth') ? dol_mktime( $date_next_execution = (GETPOST('remonth') ? dol_mktime(
12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear') 12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')
) : -1); ) : -1);
print $form->selectDate($date_next_execution, '', 1, 1, '', "add", 1, 1); print $form->selectDate($date_next_execution, '', 1, 1, '', "add", 1, 1);
@ -801,7 +801,7 @@ if ($action == 'create') {
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) { if ($resql) {
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
print_barre_liste( print_barre_liste(
$langs->trans("RepeatableInterventional"), $page, $langs->trans("RepeatableInterventional"), $page,
$_SERVER['PHP_SELF'], "&socid=$socid", $sortfield, $sortorder, $_SERVER['PHP_SELF'], "&socid=$socid", $sortfield, $sortorder,
'', $num, '', 'title_commercial.png' '', $num, '', 'title_commercial.png'
@ -812,12 +812,12 @@ if ($action == 'create') {
$i = 0; $i = 0;
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre( print_liste_field_titre(
$langs->trans("Ref"), $_SERVER['PHP_SELF'], "f.titre", "", "", $langs->trans("Ref"), $_SERVER['PHP_SELF'], "f.titre", "", "",
'width="200px" align="left"', $sortfiled, $sortorder 'width="200px" align="left"', $sortfiled, $sortorder
); );
print_liste_field_titre( print_liste_field_titre(
$langs->trans("Company"), $_SERVER['PHP_SELF'], "s.nom", "", "", $langs->trans("Company"), $_SERVER['PHP_SELF'], "s.nom", "", "",
'width="200px" align="left"', $sortfiled, $sortorder 'width="200px" align="left"', $sortfiled, $sortorder
); );
@ -834,29 +834,29 @@ if ($action == 'create') {
"f.fk_project", "", "", "f.fk_project", "", "",
'width="100px" align="left"', $sortfiled, $sortorder 'width="100px" align="left"', $sortfiled, $sortorder
); );
print_liste_field_titre( print_liste_field_titre(
$langs->trans("Duration"), $_SERVER['PHP_SELF'], $langs->trans("Duration"), $_SERVER['PHP_SELF'],
'f.duree', '', '', 'f.duree', '', '',
'width="50px" align="right"', $sortfiled, $sortorder 'width="50px" align="right"', $sortfiled, $sortorder
); );
// Recurring or not // Recurring or not
print_liste_field_titre( print_liste_field_titre(
$langs->trans("Frequency"), $_SERVER['PHP_SELF'], $langs->trans("Frequency"), $_SERVER['PHP_SELF'],
"f.frequency", "", "", "f.frequency", "", "",
'width="100px" align="center"', $sortfiled, $sortorder 'width="100px" align="center"', $sortfiled, $sortorder
); );
print_liste_field_titre( print_liste_field_titre(
$langs->trans("NbOfGenerationDone"), $_SERVER['PHP_SELF'], $langs->trans("NbOfGenerationDone"), $_SERVER['PHP_SELF'],
"f.nb_gen_done", "", "", "f.nb_gen_done", "", "",
'width="100px" align="center"', $sortfiled, $sortorder 'width="100px" align="center"', $sortfiled, $sortorder
); );
print_liste_field_titre( print_liste_field_titre(
$langs->trans("DateLastGeneration"), $_SERVER['PHP_SELF'], $langs->trans("DateLastGeneration"), $_SERVER['PHP_SELF'],
"f.date_last_gen", "", "", "f.date_last_gen", "", "",
'width="100px" align="center"', $sortfiled, $sortorder 'width="100px" align="center"', $sortfiled, $sortorder
); );
print_liste_field_titre( print_liste_field_titre(
$langs->trans("NextDateToIntervention"), $_SERVER['PHP_SELF'], $langs->trans("NextDateToIntervention"), $_SERVER['PHP_SELF'],
"f.date_when", "", "", "f.date_when", "", "",
'width="100px" align="center"', $sortfiled, $sortorder 'width="100px" align="center"', $sortfiled, $sortorder

View File

@ -626,7 +626,7 @@ if (empty($reshook))
} }
} }
$result = $object->updateline( $result = $object->updateline(
$lineid, $lineid,
$_POST['product_desc'], $_POST['product_desc'],
$ht, $ht,

View File

@ -330,8 +330,8 @@ if ($search_montant_localtax2 != '') $sql.= natural_search('f.localtax2', $searc
if ($search_montant_ttc != '') $sql.= natural_search('f.total_ttc', $search_montant_ttc, 1); if ($search_montant_ttc != '') $sql.= natural_search('f.total_ttc', $search_montant_ttc, 1);
if ($search_status != '' && $search_status >= 0) $sql.= " AND f.fk_statut = ".$db->escape($search_status); if ($search_status != '' && $search_status >= 0) $sql.= " AND f.fk_statut = ".$db->escape($search_status);
if ($search_paymentmode > 0) $sql .= " AND f.fk_mode_reglement = ".$search_paymentmode.""; if ($search_paymentmode > 0) $sql .= " AND f.fk_mode_reglement = ".$search_paymentmode."";
$sql.= dolSqlDateFilter( "f.datef", $day, $month, $year); $sql.= dolSqlDateFilter("f.datef", $day, $month, $year);
$sql.= dolSqlDateFilter( "f.date_lim_reglement", $day_lim, $month_lim, $year_lim); $sql.= dolSqlDateFilter("f.date_lim_reglement", $day_lim, $month_lim, $year_lim);
if ($option == 'late') $sql.=" AND f.date_lim_reglement < '".$db->idate(dol_now() - $conf->facture->fournisseur->warning_delay)."'"; if ($option == 'late') $sql.=" AND f.date_lim_reglement < '".$db->idate(dol_now() - $conf->facture->fournisseur->warning_delay)."'";
if ($search_label) $sql .= natural_search('f.libelle', $search_label); if ($search_label) $sql .= natural_search('f.libelle', $search_label);
if ($search_status != '' && $search_status >= 0) if ($search_status != '' && $search_status >= 0)

View File

@ -202,7 +202,7 @@ if ($action == 'create')
print '<tr>'; print '<tr>';
print '<td>'.$form->editfieldkey('Zip', 'zipcode', '', $object, 0).'</td>'; print '<td>'.$form->editfieldkey('Zip', 'zipcode', '', $object, 0).'</td>';
print '<td>'; print '<td>';
print $formcompany->select_ziptown( print $formcompany->select_ziptown(
GETPOST('zipcode', 'alpha'), GETPOST('zipcode', 'alpha'),
'zipcode', 'zipcode',
array ( array (
@ -218,7 +218,7 @@ if ($action == 'create')
print '<tr>'; print '<tr>';
print '<td>'.$form->editfieldkey('Town', 'town', '', $object, 0).'</td>'; print '<td>'.$form->editfieldkey('Town', 'town', '', $object, 0).'</td>';
print '<td>'; print '<td>';
print $formcompany->select_ziptown(GETPOST('town', 'alpha'), 'town', array ( print $formcompany->select_ziptown(GETPOST('town', 'alpha'), 'town', array (
'zipcode', 'zipcode',
'selectcountry_id' 'selectcountry_id'
)); ));
@ -292,12 +292,12 @@ if (($id || $ref) && $action == 'edit')
// Zipcode / Town // Zipcode / Town
print '<tr><td>'.$form->editfieldkey('Zip', 'zipcode', '', $object, 0).'</td><td>'; print '<tr><td>'.$form->editfieldkey('Zip', 'zipcode', '', $object, 0).'</td><td>';
print $formcompany->select_ziptown($object->zip, 'zipcode', array ( print $formcompany->select_ziptown($object->zip, 'zipcode', array (
'town', 'town',
'selectcountry_id' 'selectcountry_id'
), 6) . '</tr>'; ), 6) . '</tr>';
print '<tr><td>'.$form->editfieldkey('Town', 'town', '', $object, 0).'</td><td>'; print '<tr><td>'.$form->editfieldkey('Town', 'town', '', $object, 0).'</td><td>';
print $formcompany->select_ziptown($object->town, 'town', array ( print $formcompany->select_ziptown($object->town, 'town', array (
'zipcode', 'zipcode',
'selectcountry_id' 'selectcountry_id'
)) . '</td></tr>'; )) . '</td></tr>';

View File

@ -452,7 +452,7 @@ class PaymentLoan extends CommonObject
if ($mode == 'payment_loan') $total=-$total; if ($mode == 'payment_loan') $total=-$total;
// Insert payment into llx_bank // Insert payment into llx_bank
$bank_line_id = $acc->addline( $bank_line_id = $acc->addline(
$this->datep, $this->datep,
$this->paymenttype, // Payment mode id or code ("CHQ or VIR for example") $this->paymenttype, // Payment mode id or code ("CHQ or VIR for example")
$label, $label,

View File

@ -224,7 +224,7 @@ class MyModuleFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase
{ {
$this->url('/custom/mymodule/admin/about.php'); $this->url('/custom/mymodule/admin/about.php');
$this->authenticate(); $this->authenticate();
return $this->assertEquals( return $this->assertEquals(
'Dolibarr Module Template (aka My Module)', 'Dolibarr Module Template (aka My Module)',
$this->byTag('h1')->text(), $this->byTag('h1')->text(),
"Readme title" "Readme title"
@ -254,7 +254,7 @@ class MyModuleFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase
{ {
$this->url('/admin/triggers.php'); $this->url('/admin/triggers.php');
$this->authenticate(); $this->authenticate();
return $this->assertContains( return $this->assertContains(
'interface_99_modMyModule_MyModuleTriggers.class.php', 'interface_99_modMyModule_MyModuleTriggers.class.php',
$this->byTag('body')->text(), $this->byTag('body')->text(),
"Trigger declared" "Trigger declared"
@ -271,7 +271,7 @@ class MyModuleFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase
{ {
$this->url('/admin/triggers.php'); $this->url('/admin/triggers.php');
$this->authenticate(); $this->authenticate();
return $this->assertContains( return $this->assertContains(
'tick.png', 'tick.png',
$this->byXPath('//td[text()="interface_99_modMyModule_MyTrigger.class.php"]/following::img')->attribute('src'), $this->byXPath('//td[text()="interface_99_modMyModule_MyTrigger.class.php"]/following::img')->attribute('src'),
"Trigger enabled" "Trigger enabled"

View File

@ -119,7 +119,7 @@ elseif($action==='save_composed_product')
{ {
foreach ($TProduct as $id_product => $row) foreach ($TProduct as $id_product => $row)
{ {
if ($row['qty'] > 0) $object->update_sousproduit($id, $id_product, $row['qty'], isset($row['incdec']) ? 1 : 0 ); if ($row['qty'] > 0) $object->update_sousproduit($id, $id_product, $row['qty'], isset($row['incdec']) ? 1 : 0);
else $object->del_sousproduit($id, $id_product); else $object->del_sousproduit($id, $id_product);
} }
setEventMessages('RecordSaved', null); setEventMessages('RecordSaved', null);

View File

@ -143,7 +143,7 @@ class PriceParser
} }
//Accessible product values by expressions //Accessible product values by expressions
$values = array_merge($values, array( $values = array_merge($values, array(
"tva_tx" => $product->tva_tx, "tva_tx" => $product->tva_tx,
"localtax1_tx" => $product->localtax1_tx, "localtax1_tx" => $product->localtax1_tx,
"localtax2_tx" => $product->localtax2_tx, "localtax2_tx" => $product->localtax2_tx,
@ -264,7 +264,7 @@ class PriceParser
$supplier_min_price = $productFournisseur->find_min_price_product_fournisseur($product->id, 0, 0); $supplier_min_price = $productFournisseur->find_min_price_product_fournisseur($product->id, 0, 0);
//Accessible values by expressions //Accessible values by expressions
$extra_values = array_merge($extra_values, array( $extra_values = array_merge($extra_values, array(
"supplier_min_price" => $supplier_min_price, "supplier_min_price" => $supplier_min_price,
)); ));
@ -300,7 +300,7 @@ class PriceParser
$product_supplier->fetch($product_supplier->id, '', '', 1); $product_supplier->fetch($product_supplier->id, '', '', 1);
//Accessible values by expressions //Accessible values by expressions
$extra_values = array_merge($extra_values, array( $extra_values = array_merge($extra_values, array(
"supplier_quantity" => $product_supplier->fourn_qty, "supplier_quantity" => $product_supplier->fourn_qty,
"supplier_tva_tx" => $product_supplier->fourn_tva_tx, "supplier_tva_tx" => $product_supplier->fourn_tva_tx,
)); ));
@ -324,12 +324,12 @@ class PriceParser
$product->fetch($product_id, '', '', 1); $product->fetch($product_id, '', '', 1);
//Values for product expressions //Values for product expressions
$extra_values = array_merge($extra_values, array( $extra_values = array_merge($extra_values, array(
"supplier_min_price" => 1, "supplier_min_price" => 1,
)); ));
//Values for supplier product expressions //Values for supplier product expressions
$extra_values = array_merge($extra_values, array( $extra_values = array_merge($extra_values, array(
"supplier_quantity" => 2, "supplier_quantity" => 2,
"supplier_tva_tx" => 3, "supplier_tva_tx" => 3,
)); ));

View File

@ -14,7 +14,7 @@ $put = GETPOST('put');
$fk_det_inventory = GETPOST('fk_det_inventory'); $fk_det_inventory = GETPOST('fk_det_inventory');
$det = new Inventorydet($db); $det = new Inventorydet($db);
if( $det->fetch( $fk_det_inventory)) if( $det->fetch($fk_det_inventory))
{ {
$det->qty_view+=GETPOST('qty'); $det->qty_view+=GETPOST('qty');
$res = $det->update($user); $res = $det->update($user);
@ -34,7 +34,7 @@ $put = GETPOST('put');
$fk_det_inventory = GETPOST('fk_det_inventory'); $fk_det_inventory = GETPOST('fk_det_inventory');
$det = new Inventorydet($db); $det = new Inventorydet($db);
if( $det->fetch( $fk_det_inventory)) if( $det->fetch($fk_det_inventory))
{ {
$det->new_pmp=price2num(GETPOST('pmp')); $det->new_pmp=price2num(GETPOST('pmp'));
$det->update($user); $det->update($user);

View File

@ -130,8 +130,8 @@ if (empty($conf) || ! is_object($conf))
<?php } ?> <?php } ?>
<?php if ($can_validate == 1) { ?> <?php if ($can_validate == 1) { ?>
<td align="center" style="background-color: #e8e8ff;"><?php echo $row['qty_stock']; ?></td> <td align="center" style="background-color: #e8e8ff;"><?php echo $row['qty_stock']; ?></td>
<td align="right" style="background-color: #e8e8ff;"><?php echo price( $row['pmp_stock']); ?></td> <td align="right" style="background-color: #e8e8ff;"><?php echo price($row['pmp_stock']); ?></td>
<td align="right" style="background-color: #e8e8ff;"><?php echo price( $row['pa_stock']); ?></td> <td align="right" style="background-color: #e8e8ff;"><?php echo price($row['pa_stock']); ?></td>
<?php <?php
if(!empty($conf->global->INVENTORY_USE_MIN_PA_IF_NO_LAST_PA)){ if(!empty($conf->global->INVENTORY_USE_MIN_PA_IF_NO_LAST_PA)){
echo '<td align="right" style="background-color: #e8e8ff;">'.price($row['current_pa_stock']).'</td>'; echo '<td align="right" style="background-color: #e8e8ff;">'.price($row['current_pa_stock']).'</td>';

View File

@ -484,7 +484,7 @@ if ($resql)
} }
//Show/hide child products. Hidden by default //Show/hide child products. Hidden by default
if (!empty($conf->variants->enabled) && !empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD )) { if (!empty($conf->variants->enabled) && !empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD)) {
$moreforfilter.='<div class="divsearchfield">'; $moreforfilter.='<div class="divsearchfield">';
$moreforfilter.= '<input type="checkbox" id="search_show_childproducts" name="search_show_childproducts"'.($show_childproducts ? 'checked="checked"':'').'>'; $moreforfilter.= '<input type="checkbox" id="search_show_childproducts" name="search_show_childproducts"'.($show_childproducts ? 'checked="checked"':'').'>';
$moreforfilter.= ' <label for="search_show_childproducts">'.$langs->trans('ShowChildProducts').'</label>'; $moreforfilter.= ' <label for="search_show_childproducts">'.$langs->trans('ShowChildProducts').'</label>';

View File

@ -321,8 +321,8 @@ if ($resql)
} }
if ($virtualdiffersfromphysical) print_liste_field_titre("VirtualStock", $_SERVER["PHP_SELF"], "", $param, "", 'align="right"', $sortfield, $sortorder); if ($virtualdiffersfromphysical) print_liste_field_titre("VirtualStock", $_SERVER["PHP_SELF"], "", $param, "", 'align="right"', $sortfield, $sortorder);
print_liste_field_titre(''); print_liste_field_titre('');
print_liste_field_titre( $langs->trans("Status").' ('.$langs->trans("Sell").')', $_SERVER["PHP_SELF"], "p.tosell", $param, "", 'align="right"', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Status").' ('.$langs->trans("Sell").')', $_SERVER["PHP_SELF"], "p.tosell", $param, "", 'align="right"', $sortfield, $sortorder);
print_liste_field_titre( $langs->trans("Status").' ('.$langs->trans("Buy").')', $_SERVER["PHP_SELF"], "p.tobuy", $param, "", 'align="right"', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Status").' ('.$langs->trans("Buy").')', $_SERVER["PHP_SELF"], "p.tobuy", $param, "", 'align="right"', $sortfield, $sortorder);
print_liste_field_titre(''); print_liste_field_titre('');
print "</tr>\n"; print "</tr>\n";

View File

@ -312,8 +312,8 @@ if ($resql)
// TODO Add info of running suppliers/customers orders // TODO Add info of running suppliers/customers orders
//print_liste_field_titre("TheoreticalStock",$_SERVER["PHP_SELF"], "stock_theorique",$param,"",'align="right"',$sortfield,$sortorder); //print_liste_field_titre("TheoreticalStock",$_SERVER["PHP_SELF"], "stock_theorique",$param,"",'align="right"',$sortfield,$sortorder);
print_liste_field_titre(''); print_liste_field_titre('');
print_liste_field_titre( $langs->trans("Status").' ('.$langs->trans("Sell").')', $_SERVER["PHP_SELF"], "p.tosell", "", $param, 'align="right"', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Status").' ('.$langs->trans("Sell").')', $_SERVER["PHP_SELF"], "p.tosell", "", $param, 'align="right"', $sortfield, $sortorder);
print_liste_field_titre( $langs->trans("Status").' ('.$langs->trans("Buy").')', $_SERVER["PHP_SELF"], "p.tobuy", "", $param, 'align="right"', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Status").' ('.$langs->trans("Buy").')', $_SERVER["PHP_SELF"], "p.tobuy", "", $param, 'align="right"', $sortfield, $sortorder);
print_liste_field_titre(''); print_liste_field_titre('');
print "</tr>\n"; print "</tr>\n";

View File

@ -468,7 +468,7 @@ if ($sref || $snom || $sall || $salert || $draftorder || GETPOST('search', 'alph
$filters .= '&mode=' . $mode; $filters .= '&mode=' . $mode;
$filters .= '&fk_supplier=' . $fk_supplier; $filters .= '&fk_supplier=' . $fk_supplier;
$filters .= '&fk_entrepot=' . $fk_entrepot; $filters .= '&fk_entrepot=' . $fk_entrepot;
print_barre_liste( print_barre_liste(
$texte, $texte,
$page, $page,
'replenish.php', 'replenish.php',
@ -487,7 +487,7 @@ if ($sref || $snom || $sall || $salert || $draftorder || GETPOST('search', 'alph
$filters .= '&mode=' . $mode; $filters .= '&mode=' . $mode;
$filters .= '&fk_supplier=' . $fk_supplier; $filters .= '&fk_supplier=' . $fk_supplier;
$filters .= '&fk_entrepot=' . $fk_entrepot; $filters .= '&fk_entrepot=' . $fk_entrepot;
print_barre_liste( print_barre_liste(
$texte, $texte,
$page, $page,
'replenish.php', 'replenish.php',

View File

@ -108,7 +108,7 @@ if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
unset($data1); unset($data1);
if ($nocolor) if ($nocolor)
$px->SetDataColor(array ( $px->SetDataColor(array (
array ( array (
220, 220,
220, 220,
@ -126,7 +126,7 @@ if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
$px->SetShading(3); $px->SetShading(3);
$px->SetHorizTickIncrement(1); $px->SetHorizTickIncrement(1);
$px->SetCssPrefix("cssboxes"); $px->SetCssPrefix("cssboxes");
$px->SetType(array ( $px->SetType(array (
'pie' 'pie'
)); ));
$px->SetTitle($langs->trans('OpportunitiesStatusForProjects')); $px->SetTitle($langs->trans('OpportunitiesStatusForProjects'));

View File

@ -508,7 +508,7 @@ if ($action == 'charge' && ! empty($conf->stripe->enabled))
if (empty($vatcleaned)) $taxinfo=null; if (empty($vatcleaned)) $taxinfo=null;
dol_syslog("Create anonymous customer card profile", LOG_DEBUG, 0, '_stripe'); dol_syslog("Create anonymous customer card profile", LOG_DEBUG, 0, '_stripe');
$customer = \Stripe\Customer::create(array( $customer = \Stripe\Customer::create(array(
'email' => $email, 'email' => $email,
'description' => ($email?'Anonymous customer for '.$email:'Anonymous customer'), 'description' => ($email?'Anonymous customer for '.$email:'Anonymous customer'),
'metadata' => $metadata, 'metadata' => $metadata,
@ -524,7 +524,7 @@ if ($action == 'charge' && ! empty($conf->stripe->enabled))
// The customer was just created with a source, so we can make a charge // The customer was just created with a source, so we can make a charge
// with no card defined, the source just used for customer creation will be used. // with no card defined, the source just used for customer creation will be used.
dol_syslog("Create charge", LOG_DEBUG, 0, '_stripe'); dol_syslog("Create charge", LOG_DEBUG, 0, '_stripe');
$charge = \Stripe\Charge::create(array( $charge = \Stripe\Charge::create(array(
'customer' => $customer->id, 'customer' => $customer->id,
'amount' => price2num($amountstripe, 'MU'), 'amount' => price2num($amountstripe, 'MU'),
'currency' => $currency, 'currency' => $currency,

View File

@ -226,7 +226,7 @@ elseif ($event->type == 'payout.paid') {
$message = "A bank transfer of ".price2num($event->data->object->amount/100)." ".$event->data->object->currency." has been done to your account the ".dol_print_date($event->data->object->arrival_date, 'dayhour'); $message = "A bank transfer of ".price2num($event->data->object->amount/100)." ".$event->data->object->currency." has been done to your account the ".dol_print_date($event->data->object->arrival_date, 'dayhour');
$mailfile = new CMailFile( $mailfile = new CMailFile(
$subject, $subject,
$sendto, $sendto,
$replyto, $replyto,

View File

@ -687,7 +687,7 @@ if (empty($reshook))
if (! $error && !empty($user->rights->categorie->lire)) if (! $error && !empty($user->rights->categorie->lire))
{ {
// Customer categories association // Customer categories association
$categories = GETPOST( 'custcats', 'array' ); $categories = GETPOST('custcats', 'array');
$result = $object->setCategories($categories, 'customer'); $result = $object->setCategories($categories, 'customer');
if ($result < 0) if ($result < 0)
{ {

View File

@ -415,7 +415,7 @@ class Thirdparties extends DolibarrApi
// External modules should update their ones too // External modules should update their ones too
if (!$errors) if (!$errors)
{ {
$reshook = $hookmanager->executeHooks('replaceThirdparty', array( $reshook = $hookmanager->executeHooks('replaceThirdparty', array(
'soc_origin' => $soc_origin->id, 'soc_origin' => $soc_origin->id,
'soc_dest' => $object->id 'soc_dest' => $object->id
), $soc_dest, $action); ), $soc_dest, $action);

View File

@ -2019,7 +2019,7 @@ class Societe extends CommonObject
if (! empty($conf->global->SOCIETE_ADD_REF_IN_LIST) && (!empty($withpicto))) if (! empty($conf->global->SOCIETE_ADD_REF_IN_LIST) && (!empty($withpicto)))
{ {
$code = ''; $code = '';
if (($this->client) && (! empty ( $this->code_client )) if (($this->client) && (! empty ($this->code_client))
&& ($conf->global->SOCIETE_ADD_REF_IN_LIST == 1 && ($conf->global->SOCIETE_ADD_REF_IN_LIST == 1
|| $conf->global->SOCIETE_ADD_REF_IN_LIST == 2 || $conf->global->SOCIETE_ADD_REF_IN_LIST == 2
) )
@ -2028,7 +2028,7 @@ class Societe extends CommonObject
$code = $this->code_client . ' - '; $code = $this->code_client . ' - ';
} }
if (($this->fournisseur) && (! empty ( $this->code_fournisseur )) if (($this->fournisseur) && (! empty ($this->code_fournisseur))
&& ($conf->global->SOCIETE_ADD_REF_IN_LIST == 1 && ($conf->global->SOCIETE_ADD_REF_IN_LIST == 1
|| $conf->global->SOCIETE_ADD_REF_IN_LIST == 3 || $conf->global->SOCIETE_ADD_REF_IN_LIST == 3
) )

View File

@ -243,7 +243,7 @@ if ($id > 0 || ! empty($ref))
print "<table class=\"noborder\" width=\"100%\">"; print "<table class=\"noborder\" width=\"100%\">";
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "d.rowid", $param, "", "", $sortfield, $sortorder); print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "d.rowid", $param, "", "", $sortfield, $sortorder);
print_liste_field_titre( $langs->trans("Name")." / ".$langs->trans("Company"), $_SERVER["PHP_SELF"], "d.lastname", $param, "", "", $sortfield, $sortorder); print_liste_field_titre($langs->trans("Name")." / ".$langs->trans("Company"), $_SERVER["PHP_SELF"], "d.lastname", $param, "", "", $sortfield, $sortorder);
print_liste_field_titre("Login", $_SERVER["PHP_SELF"], "d.login", $param, "", "", $sortfield, $sortorder); print_liste_field_titre("Login", $_SERVER["PHP_SELF"], "d.login", $param, "", "", $sortfield, $sortorder);
print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "t.libelle", $param, "", "", $sortfield, $sortorder); print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "t.libelle", $param, "", "", $sortfield, $sortorder);
print_liste_field_titre("Person", $_SERVER["PHP_SELF"], "d.morphy", $param, "", "", $sortfield, $sortorder); print_liste_field_titre("Person", $_SERVER["PHP_SELF"], "d.morphy", $param, "", "", $sortfield, $sortorder);

View File

@ -1104,7 +1104,7 @@ if ($action == 'create' || $action == 'adduserldap')
{ {
print '<tr><td>' . $form->editfieldkey('Categories', 'usercats', '', $object, 0) . '</td><td colspan="3">'; print '<tr><td>' . $form->editfieldkey('Categories', 'usercats', '', $object, 0) . '</td><td colspan="3">';
$cate_arbo = $form->select_all_categories('user', null, 'parent', null, null, 1); $cate_arbo = $form->select_all_categories('user', null, 'parent', null, null, 1);
print $form->multiselectarray('usercats', $cate_arbo, GETPOST('usercats', 'array'), null, null, null, print $form->multiselectarray('usercats', $cate_arbo, GETPOST('usercats', 'array'), null, null, null,
null, '90%' ); null, '90%' );
print "</td></tr>"; print "</td></tr>";
} }
@ -1612,9 +1612,9 @@ else
// Categories // Categories
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
{ {
print '<tr><td>' . $langs->trans( "Categories" ) . '</td>'; print '<tr><td>' . $langs->trans("Categories") . '</td>';
print '<td colspan="3">'; print '<td colspan="3">';
print $form->showCategories( $object->id, 'user', 1 ); print $form->showCategories($object->id, 'user', 1);
print '</td></tr>'; print '</td></tr>';
} }
@ -2379,21 +2379,21 @@ else
print '</tr>'; print '</tr>';
// Categories // Categories
if (!empty( $conf->categorie->enabled ) && !empty( $user->rights->categorie->lire )) if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire))
{ {
print '<tr><td>' . $form->editfieldkey('Categories', 'usercats', '', $object, 0) . '</td>'; print '<tr><td>' . $form->editfieldkey('Categories', 'usercats', '', $object, 0) . '</td>';
print '<td>'; print '<td>';
$cate_arbo = $form->select_all_categories( Categorie::TYPE_USER, null, null, null, null, 1 ); $cate_arbo = $form->select_all_categories(Categorie::TYPE_USER, null, null, null, null, 1);
$c = new Categorie( $db ); $c = new Categorie($db);
$cats = $c->containing($object->id, Categorie::TYPE_USER); $cats = $c->containing($object->id, Categorie::TYPE_USER);
foreach ($cats as $cat) { foreach ($cats as $cat) {
$arrayselected[] = $cat->id; $arrayselected[] = $cat->id;
} }
if ($caneditfield) if ($caneditfield)
{ {
print $form->multiselectarray( 'usercats', $cate_arbo, $arrayselected, '', 0, '', 0, '90%' ); print $form->multiselectarray('usercats', $cate_arbo, $arrayselected, '', 0, '', 0, '90%');
}else{ }else{
print $form->showCategories( $object->id, 'user', 1 ); print $form->showCategories($object->id, 'user', 1);
} }
print "</td></tr>"; print "</td></tr>";
} }

View File

@ -1977,7 +1977,7 @@ class User extends CommonObject
dol_syslog(get_class($this)."::send_password changelater is on, url=".$url); dol_syslog(get_class($this)."::send_password changelater is on, url=".$url);
} }
$mailfile = new CMailFile( $mailfile = new CMailFile(
$subject, $subject,
$this->email, $this->email,
$conf->global->MAIN_MAIL_EMAIL_FROM, $conf->global->MAIN_MAIL_EMAIL_FROM,

View File

@ -31,7 +31,7 @@ header('Content-Type: application/json');
$id = GETPOST('id', 'int'); $id = GETPOST('id', 'int');
if (!$id) { if (!$id) {
print json_encode(array( print json_encode(array(
'error' => 'ID not set' 'error' => 'ID not set'
)); ));
exit(); exit();
@ -40,7 +40,7 @@ if (!$id) {
$product = new Product($db); $product = new Product($db);
if ($product->fetch($id) < 0) { if ($product->fetch($id) < 0) {
print json_encode(array( print json_encode(array(
'error' => 'Product not found' 'error' => 'Product not found'
)); ));
} }

View File

@ -31,7 +31,7 @@ header('Content-Type: application/json');
$id = GETPOST('id'); $id = GETPOST('id');
if (!$id) { if (!$id) {
print json_encode(array( print json_encode(array(
'error' => 'ID not set' 'error' => 'ID not set'
)); ));
exit(); exit();
@ -40,7 +40,7 @@ if (!$id) {
$prodattr = new ProductAttribute($db); $prodattr = new ProductAttribute($db);
if ($prodattr->fetch($id) < 0) { if ($prodattr->fetch($id) < 0) {
print json_encode(array( print json_encode(array(
'error' => 'Attribute not found' 'error' => 'Attribute not found'
)); ));
exit(); exit();
@ -51,7 +51,7 @@ $prodattrval = new ProductAttributeValue($db);
$res = $prodattrval->fetchAllByProductAttribute($id); $res = $prodattrval->fetchAllByProductAttribute($id);
if ($res == -1) { if ($res == -1) {
print json_encode(array( print json_encode(array(
'error' => 'Internal error' 'error' => 'Internal error'
)); ));
exit(); exit();

View File

@ -202,7 +202,7 @@ if ($action == 'edit') { ?>
if ($action == 'delete') { if ($action == 'delete') {
$form = new Form($db); $form = new Form($db);
print $form->formconfirm( print $form->formconfirm(
"card.php?id=".$object->id, "card.php?id=".$object->id,
$langs->trans('Delete'), $langs->trans('Delete'),
$langs->trans('ProductAttributeDeleteDialog'), $langs->trans('ProductAttributeDeleteDialog'),
@ -217,7 +217,7 @@ if ($action == 'edit') { ?>
$form = new Form($db); $form = new Form($db);
print $form->formconfirm( print $form->formconfirm(
"card.php?id=".$object->id."&valueid=".$objectval->id, "card.php?id=".$object->id."&valueid=".$objectval->id,
$langs->trans('Delete'), $langs->trans('Delete'),
$langs->trans('ProductAttributeValueDeleteDialog', dol_htmlentities($objectval->value), dol_htmlentities($objectval->ref)), $langs->trans('ProductAttributeValueDeleteDialog', dol_htmlentities($objectval->value), dol_htmlentities($objectval->ref)),

View File

@ -641,7 +641,7 @@ if (! empty($id) || ! empty($ref))
} }
} elseif ($action === 'copy') { } elseif ($action === 'copy') {
print $form->formconfirm( print $form->formconfirm(
'combinations.php?id='.$id, 'combinations.php?id='.$id,
$langs->trans('CloneCombinationsProduct'), $langs->trans('CloneCombinationsProduct'),
$langs->trans('ConfirmCloneProductCombinations'), $langs->trans('ConfirmCloneProductCombinations'),

View File

@ -660,7 +660,7 @@ function createInvoiceFromOrder($authentication, $id_order = '', $ref_order = ''
$now=dol_now(); $now=dol_now();
dol_syslog("Function: createInvoiceFromOrder login=".$authentication['login']." id=".$id_order. dol_syslog("Function: createInvoiceFromOrder login=".$authentication['login']." id=".$id_order.
", ref=".$ref_order.", ref_ext=".$ref_ext_order); ", ref=".$ref_order.", ref_ext=".$ref_ext_order);
if ($authentication['entity']) $conf->entity=$authentication['entity']; if ($authentication['entity']) $conf->entity=$authentication['entity'];
@ -744,7 +744,7 @@ function updateInvoice($authentication, $invoice)
{ {
global $db,$conf,$langs; global $db,$conf,$langs;
dol_syslog("Function: updateInvoice login=".$authentication['login']." id=".$invoice['id']. dol_syslog("Function: updateInvoice login=".$authentication['login']." id=".$invoice['id'].
", ref=".$invoice['ref'].", ref_ext=".$invoice['ref_ext']); ", ref=".$invoice['ref'].", ref_ext=".$invoice['ref_ext']);
if ($authentication['entity']) $conf->entity=$authentication['entity']; if ($authentication['entity']) $conf->entity=$authentication['entity'];